ohif-viewer/StandaloneViewer/SampleClientOnlyBuild/48eac8c64f443010750ab1b683a69e5f65dba791.js
2017-06-14 16:54:00 -03:00

276 lines
2.1 MiB
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

!function(){var n,t;(function(){n={}}).call(this),function(){(function(){var t=this,r=t._,e={},i=Array.prototype,u=Object.prototype,a=Function.prototype,c=i.push,o=i.slice,l=i.concat,f=u.toString,s=u.hasOwnProperty,p=i.forEach,h=i.map,v=i.reduce,y=i.reduceRight,d=i.filter,g=i.every,m=i.some,b=i.indexOf,_=i.lastIndexOf,w=Array.isArray,x=Object.keys,j=a.bind,A=function(n){return n instanceof A?n:this instanceof A?void(this._wrapped=n):new A(n)};"undefined"!=typeof n?("undefined"!=typeof module&&module.exports&&(n=module.exports=A),n._=A):t._=A,A.VERSION="1.5.2";var k=function(n){return"[object Arguments]"===f.call(n)};k(arguments)||(k=function(n){return!(!n||!s.call(n,"callee")||"function"!=typeof n.callee)});var O=function(n){return n.length===+n.length&&(k(n)||n.constructor!==Object)},E=A.each=A.forEach=function(n,t,r){if(null!=n)if(p&&n.forEach===p)n.forEach(t,r);else if(O(n)){for(var i=0,u=n.length;i<u;i++)if(t.call(r,n[i],i,n)===e)return}else for(var a=A.keys(n),i=0,u=a.length;i<u;i++)if(t.call(r,n[a[i]],a[i],n)===e)return};A.map=A.collect=function(n,t,r){var e=[];return null==n?e:h&&n.map===h?n.map(t,r):(E(n,function(n,i,u){e.push(t.call(r,n,i,u))}),e)};var F="Reduce of empty array with no initial value";A.reduce=A.foldl=A.inject=function(n,t,r,e){var i=arguments.length>2;if(null==n&&(n=[]),v&&n.reduce===v)return e&&(t=A.bind(t,e)),i?n.reduce(t,r):n.reduce(t);if(E(n,function(n,u,a){i?r=t.call(e,r,n,u,a):(r=n,i=!0)}),!i)throw new TypeError(F);return r},A.reduceRight=A.foldr=function(n,t,r,e){var i=arguments.length>2;if(null==n&&(n=[]),y&&n.reduceRight===y)return e&&(t=A.bind(t,e)),i?n.reduceRight(t,r):n.reduceRight(t);var u=n.length;if(!O(n)){var a=A.keys(n);u=a.length}if(E(n,function(c,o,l){o=a?a[--u]:--u,i?r=t.call(e,r,n[o],o,l):(r=n[o],i=!0)}),!i)throw new TypeError(F);return r},A.find=A.detect=function(n,t,r){var e;return M(n,function(n,i,u){if(t.call(r,n,i,u))return e=n,!0}),e},A.filter=A.select=function(n,t,r){var e=[];return null==n?e:d&&n.filter===d?n.filter(t,r):(E(n,function(n,i,u){t.call(r,n,i,u)&&e.push(n)}),e)},A.reject=function(n,t,r){return A.filter(n,function(n,e,i){return!t.call(r,n,e,i)},r)},A.every=A.all=function(n,t,r){t||(t=A.identity);var i=!0;return null==n?i:g&&n.every===g?n.every(t,r):(E(n,function(n,u,a){if(!(i=i&&t.call(r,n,u,a)))return e}),!!i)};var M=A.some=A.any=function(n,t,r){t||(t=A.identity);var i=!1;return null==n?i:m&&n.some===m?n.some(t,r):(E(n,function(n,u,a){if(i||(i=t.call(r,n,u,a)))return e}),!!i)};A.contains=A.include=function(n,t){return null!=n&&(b&&n.indexOf===b?n.indexOf(t)!=-1:M(n,function(n){return n===t}))},A.invoke=function(n,t){var r=o.call(arguments,2),e=A.isFunction(t);return A.map(n,function(n){return(e?t:n[t]).apply(n,r)})},A.pluck=function(n,t){return A.map(n,function(n){return n[t]})},A.where=function(n,t,r){return A.isEmpty(t)?r?void 0:[]:A[r?"find":"filter"](n,function(n){for(var r in t)if(t[r]!==n[r])return!1;return!0})},A.findWhere=function(n,t){return A.where(n,t,!0)},A.max=function(n,t,r){if(!t&&A.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.max.apply(Math,n);if(!t&&A.isEmpty(n))return-(1/0);var e={computed:-(1/0),value:-(1/0)};return E(n,function(n,i,u){var a=t?t.call(r,n,i,u):n;a>e.computed&&(e={value:n,computed:a})}),e.value},A.min=function(n,t,r){if(!t&&A.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.min.apply(Math,n);if(!t&&A.isEmpty(n))return 1/0;var e={computed:1/0,value:1/0};return E(n,function(n,i,u){var a=t?t.call(r,n,i,u):n;a<e.computed&&(e={value:n,computed:a})}),e.value},A.shuffle=function(n){var t,r=0,e=[];return E(n,function(n){t=A.random(r++),e[r-1]=e[t],e[t]=n}),e},A.sample=function(n,t,r){return arguments.length<2||r?n[A.random(n.length-1)]:A.shuffle(n).slice(0,Math.max(0,t))};var R=function(n){return A.isFunction(n)?n:function(t){return t[n]}};A.sortBy=function(n,t,r){var e=R(t);return A.pluck(A.map(n,function(n,t,i){return{value:n,index:t,criteria:e.call(r,n,t,i)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||void 0===r)return 1;if(r<e||void 0===e)return-1}return n.index-t.index}),"value")};var S=function(n){return function(t,r,e){var i={},u=null==r?A.identity:R(r);return E(t,function(r,a){var c=u.call(e,r,a,t);n(i,c,r)}),i}};A.groupBy=S(function(n,t,r){(A.has(n,t)?n[t]:n[t]=[]).push(r)}),A.indexBy=S(function(n,t,r){n[t]=r}),A.countBy=S(function(n,t){A.has(n,t)?n[t]++:n[t]=1}),A.sortedIndex=function(n,t,r,e){r=null==r?A.identity:R(r);for(var i=r.call(e,t),u=0,a=n.length;u<a;){var c=u+a>>>1;r.call(e,n[c])<i?u=c+1:a=c}return u},A.toArray=function(n){return n?A.isArray(n)?o.call(n):O(n)?A.map(n,A.identity):A.values(n):[]},A.size=function(n){return null==n?0:O(n)?n.length:A.keys(n).length},A.first=A.head=A.take=function(n,t,r){if(null!=n)return null==t||r?n[0]:o.call(n,0,t)},A.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},A.last=function(n,t,r){if(null!=n)return null==t||r?n[n.length-1]:o.call(n,Math.max(n.length-t,0))},A.rest=A.tail=A.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},A.compact=function(n){return A.filter(n,A.identity)};var I=function(n,t,r){return t&&A.every(n,A.isArray)?l.apply(r,n):(E(n,function(n){A.isArray(n)||A.isArguments(n)?t?c.apply(r,n):I(n,t,r):r.push(n)}),r)};A.flatten=function(n,t){return I(n,t,[])},A.without=function(n){return A.difference(n,o.call(arguments,1))},A.uniq=A.unique=function(n,t,r,e){A.isFunction(t)&&(e=r,r=t,t=!1);var i=r?A.map(n,r,e):n,u=[],a=[];return E(i,function(r,e){(t?e&&a[a.length-1]===r:A.contains(a,r))||(a.push(r),u.push(n[e]))}),u},A.union=function(){return A.uniq(A.flatten(arguments,!0))},A.intersection=function(n){var t=o.call(arguments,1);return A.filter(A.uniq(n),function(n){return A.every(t,function(t){return A.indexOf(t,n)>=0})})},A.difference=function(n){var t=l.apply(i,o.call(arguments,1));return A.filter(n,function(n){return!A.contains(t,n)})},A.zip=function(){for(var n=A.max(A.pluck(arguments,"length").concat(0)),t=new Array(n),r=0;r<n;r++)t[r]=A.pluck(arguments,""+r);return t},A.object=function(n,t){if(null==n)return{};for(var r={},e=0,i=n.length;e<i;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},A.indexOf=function(n,t,r){if(null==n)return-1;var e=0,i=n.length;if(r){if("number"!=typeof r)return e=A.sortedIndex(n,t),n[e]===t?e:-1;e=r<0?Math.max(0,i+r):r}if(b&&n.indexOf===b)return n.indexOf(t,r);for(;e<i;e++)if(n[e]===t)return e;return-1},A.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(_&&n.lastIndexOf===_)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var i=e?r:n.length;i--;)if(n[i]===t)return i;return-1},A.range=function(n,t,r){arguments.length<=1&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),i=0,u=new Array(e);i<e;)u[i++]=n,n+=r;return u};var T=function(){};A.bind=function(n,t){var r,e;if(j&&n.bind===j)return j.apply(n,o.call(arguments,1));if(!A.isFunction(n))throw new TypeError;return r=o.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(o.call(arguments)));T.prototype=n.prototype;var i=new T;T.prototype=null;var u=n.apply(i,r.concat(o.call(arguments)));return Object(u)===u?u:i}},A.partial=function(n){var t=o.call(arguments,1);return function(){return n.apply(this,t.concat(o.call(arguments)))}},A.bindAll=function(n){var t=o.call(arguments,1);if(0===t.length)throw new Error("bindAll must be passed function names");return E(t,function(t){n[t]=A.bind(n[t],n)}),n},A.memoize=function(n,t){var r={};return t||(t=A.identity),function(){var e=t.apply(this,arguments);return A.has(r,e)?r[e]:r[e]=n.apply(this,arguments)}},A.delay=function(n,t){var r=o.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},A.defer=function(n){return A.delay.apply(A,[n,1].concat(o.call(arguments,1)))},A.throttle=function(n,t,r){var e,i,u,a=null,c=0;r||(r={});var o=function(){c=r.leading===!1?0:new Date,a=null,u=n.apply(e,i)};return function(){var l=new Date;c||r.leading!==!1||(c=l);var f=t-(l-c);return e=this,i=arguments,f<=0?(clearTimeout(a),a=null,c=l,u=n.apply(e,i)):a||r.trailing===!1||(a=setTimeout(o,f)),u}},A.debounce=function(n,t,r){var e,i,u,a,c;return function(){u=this,i=arguments,a=new Date;var o=function(){var l=new Date-a;l<t?e=setTimeout(o,t-l):(e=null,r||(c=n.apply(u,i)))},l=r&&!e;return e||(e=setTimeout(o,t)),l&&(c=n.apply(u,i)),c}},A.once=function(n){var t=!1,r;return function(){return t?r:(t=!0,r=n.apply(this,arguments),n=null,r)}},A.wrap=function(n,t){return function(){var r=[n];return c.apply(r,arguments),t.apply(this,r)}},A.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},A.after=function(n,t){return function(){if(--n<1)return t.apply(this,arguments)}},A.keys=x||function(n){if(n!==Object(n))throw new TypeError("Invalid object");var t=[];for(var r in n)A.has(n,r)&&t.push(r);return t},A.values=function(n){for(var t=A.keys(n),r=t.length,e=new Array(r),i=0;i<r;i++)e[i]=n[t[i]];return e},A.pairs=function(n){for(var t=A.keys(n),r=t.length,e=new Array(r),i=0;i<r;i++)e[i]=[t[i],n[t[i]]];return e},A.invert=function(n){for(var t={},r=A.keys(n),e=0,i=r.length;e<i;e++)t[n[r[e]]]=r[e];return t},A.functions=A.methods=function(n){var t=[];for(var r in n)A.isFunction(n[r])&&t.push(r);return t.sort()},A.extend=function(n){return E(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},A.pick=function(n){var t={},r=l.apply(i,o.call(arguments,1));return E(r,function(r){r in n&&(t[r]=n[r])}),t},A.omit=function(n){var t={},r=l.apply(i,o.call(arguments,1));for(var e in n)A.contains(r,e)||(t[e]=n[e]);return t},A.defaults=function(n){return E(o.call(arguments,1),function(t){if(t)for(var r in t)void 0===n[r]&&(n[r]=t[r])}),n},A.clone=function(n){return A.isObject(n)?A.isArray(n)?n.slice():A.extend({},n):n},A.tap=function(n,t){return t(n),n};var N=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof A&&(n=n._wrapped),t instanceof A&&(t=t._wrapped);var i=f.call(n);if(i!=f.call(t))return!1;switch(i){case"[object String]":return n==String(t);case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var u=r.length;u--;)if(r[u]==n)return e[u]==t;var a=n.constructor,c=t.constructor;if(a!==c&&!(A.isFunction(a)&&a instanceof a&&A.isFunction(c)&&c instanceof c))return!1;r.push(n),e.push(t);var o=0,l=!0;if("[object Array]"==i){if(o=n.length,l=o==t.length)for(;o--&&(l=N(n[o],t[o],r,e)););}else{for(var s in n)if(A.has(n,s)&&(o++,!(l=A.has(t,s)&&N(n[s],t[s],r,e))))break;if(l){for(s in t)if(A.has(t,s)&&!o--)break;l=!o}}return r.pop(),e.pop(),l};A.isEqual=function(n,t){return N(n,t,[],[])},A.isEmpty=function(n){if(null==n)return!0;if(A.isArray(n)||A.isString(n))return 0===n.length;for(var t in n)if(A.has(n,t))return!1;return!0},A.isElement=function(n){return!(!n||1!==n.nodeType)},A.isArray=w||function(n){return"[object Array]"==f.call(n)},A.isObject=function(n){return n===Object(n)},E(["Arguments","Function","String","Number","Date","RegExp"],function(n){A["is"+n]=function(t){return f.call(t)=="[object "+n+"]"}}),A.isArguments(arguments)||(A.isArguments=function(n){return!(!n||!A.has(n,"callee"))}),"function"!=typeof/./&&(A.isFunction=function(n){return"function"==typeof n}),A.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},A.isNaN=function(n){return A.isNumber(n)&&n!=+n},A.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==f.call(n)},A.isNull=function(n){return null===n},A.isUndefined=function(n){return void 0===n},A.has=function(n,t){return s.call(n,t)},A.noConflict=function(){return t._=r,this},A.identity=function(n){return n},A.times=function(n,t,r){for(var e=Array(Math.max(0,n)),i=0;i<n;i++)e[i]=t.call(r,i);return e},A.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))};var q={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"}};q.unescape=A.invert(q.escape);var B={escape:new RegExp("["+A.keys(q.escape).join("")+"]","g"),unescape:new RegExp("("+A.keys(q.unescape).join("|")+")","g")};A.each(["escape","unescape"],function(n){A[n]=function(t){return null==t?"":(""+t).replace(B[n],function(t){return q[n][t]})}}),A.result=function(n,t){if(null!=n){var r=n[t];return A.isFunction(r)?r.call(n):r}},A.mixin=function(n){E(A.functions(n),function(t){var r=A[t]=n[t];A.prototype[t]=function(){var n=[this._wrapped];return c.apply(n,arguments),U.call(this,r.apply(A,n))}})};var D=0;A.uniqueId=function(n){var t=++D+"";return n?n+t:t},A.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var P=/(.)^/,z={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},C=/\\|'|\r|\n|\t|\u2028|\u2029/g;A.template=function(n,t,r){var e;r=A.defaults({},r,A.templateSettings);var i=new RegExp([(r.escape||P).source,(r.interpolate||P).source,(r.evaluate||P).source].join("|")+"|$","g"),u=0,a="__p+='";n.replace(i,function(t,r,e,i,c){return a+=n.slice(u,c).replace(C,function(n){return"\\"+z[n]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(a+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),i&&(a+="';\n"+i+"\n__p+='"),u=c+t.length,t}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{e=new Function(r.variable||"obj","_",a)}catch(n){throw n.source=a,n}if(t)return e(t,A);var c=function(n){return e.call(this,n,A)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},A.chain=function(n){return A(n).chain()};var U=function(n){return this._chain?A(n).chain():n};A.mixin(A),E(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=i[n];A.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],U.call(this,r)}}),E(["concat","join","slice"],function(n){var t=i[n];A.prototype[n]=function(){return U.call(this,t.apply(this._wrapped,arguments))}}),A.extend(A.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this)}.call(this),function(){t=n._}.call(this),"undefined"==typeof Package&&(Package={}),function(n,t){for(var r in t)r in n||(n[r]=t[r])}(Package.underscore={},{_:t})}();
!function(){var t=Package.underscore._,e,n,r;(function(){e=this}).call(this),function(){n=__meteor_runtime_config__.meteorEnv,r={isProduction:"production"===n.NODE_ENV,isDevelopment:"production"!==n.NODE_ENV,isClient:!0,isServer:!1,isCordova:!1},"object"==typeof __meteor_runtime_config__&&__meteor_runtime_config__.PUBLIC_SETTINGS&&(r.settings={public:__meteor_runtime_config__.PUBLIC_SETTINGS})}.call(this),function(){function e(t){if(t)return r._debug("Exception in callback of async function",t.stack?t.stack:t)}if(r.isServer)var n=Npm.require("fibers/future");"object"==typeof __meteor_runtime_config__&&__meteor_runtime_config__.meteorRelease&&(r.release=__meteor_runtime_config__.meteorRelease),t.extend(r,{_get:function(t){for(var e=1;e<arguments.length;e++){if(!(arguments[e]in t))return;t=t[arguments[e]]}return t},_ensure:function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];n in t||(t[n]={}),t=t[n]}return t},_delete:function(t){for(var e=[t],n=!0,r=1;r<arguments.length-1;r++){var o=arguments[r];if(!(o in t)){n=!1;break}if(t=t[o],"object"!=typeof t)break;e.push(t)}for(var r=e.length-1;r>=0;r--){var o=arguments[r+1];if(n)n=!1;else for(var i in e[r][o])return;delete e[r][o]}},wrapAsync:function(o,i){return function(){for(var a=i||this,s=t.toArray(arguments),u,c=s.length-1;c>=0;--c){var l=s[c],f=typeof l;if("undefined"!==f){"function"===f&&(u=l);break}}if(!u){if(r.isClient)u=e;else{var p=new n;u=p.resolver()}++c}s[c]=r.bindEnvironment(u);var _=o.apply(a,s);return p?p.wait():_}},_inherits:function(e,n){for(var r in n)t.has(n,r)&&(e[r]=n[r]);var o=function(){this.constructor=e};return o.prototype=n.prototype,e.prototype=new o,e.__super__=n.prototype,e}});var o=!1;r._wrapAsync=function(t,e){return o||(r._debug("Meteor._wrapAsync has been renamed to Meteor.wrapAsync"),o=!0),r.wrapAsync.apply(r,arguments)}}.call(this),function(){"use strict";function t(){if(o.setImmediate){var t=function(t){o.setImmediate(t)};return t.implementation="setImmediate",t}return null}function e(){function t(t,e){return"string"==typeof t&&t.substring(0,e.length)===e}function e(e){if(e.source===o&&t(e.data,s)){var n=e.data.substring(s.length);try{a[n]&&a[n]()}finally{delete a[n]}}}if(!o.postMessage||o.importScripts)return null;var n=!0,r=o.onmessage;if(o.onmessage=function(){n=!1},o.postMessage("","*"),o.onmessage=r,!n)return null;var i=0,a={},s="Meteor._setImmediate."+Math.random()+".";o.addEventListener?o.addEventListener("message",e,!1):o.attachEvent("onmessage",e);var u=function(t){++i,a[i]=t,o.postMessage(s+i,"*")};return u.implementation="postMessage",u}function n(){var t=function(t){o.setTimeout(t,0)};return t.implementation="setTimeout",t}var o=this;r._setImmediate=t()||e()||n()}.call(this),function(){var e=function(t){if(Package.ddp){var e=Package.ddp.DDP._CurrentInvocation;if(e.get()&&e.get().isSimulation)throw new Error("Can't set timers inside simulations");return function(){e.withValue(null,t)}}return t},n=function(t,n){return r.bindEnvironment(e(n),t)};t.extend(r,{setTimeout:function(t,e){return setTimeout(n("setTimeout callback",t),e)},setInterval:function(t,e){return setInterval(n("setInterval callback",t),e)},clearInterval:function(t){return clearInterval(t)},clearTimeout:function(t){return clearTimeout(t)},defer:function(t){r._setImmediate(n("defer callback",t))}})}.call(this),function(){r.makeErrorType=function(t,e){var n=function(){Error.captureStackTrace?Error.captureStackTrace(this,n):this.stack=(new Error).stack,e.apply(this,arguments),this.errorType=t};return r._inherits(n,Error),n},r.Error=r.makeErrorType("Meteor.Error",function(t,e,n){var r=this;r.error=t,r.reason=e,r.details=n,r.reason?r.message=r.reason+" ["+r.error+"]":r.message="["+r.error+"]"}),r.Error.prototype.clone=function(){var t=this;return new r.Error(t.error,t.reason,t.details)}}.call(this),function(){r._noYieldsAllowed=function(t){return t()},r._SynchronousQueue=function(){var t=this;t._tasks=[],t._running=!1,t._runTimeout=null},t.extend(r._SynchronousQueue.prototype,{runTask:function(e){var n=this;if(!n.safeToRunTask())throw new Error("Could not synchronously run a task from a running task");n._tasks.push(e);var o=n._tasks;n._tasks=[],n._running=!0,n._runTimeout&&(clearTimeout(n._runTimeout),n._runTimeout=null);try{for(;!t.isEmpty(o);){var i=o.shift();try{i()}catch(e){if(t.isEmpty(o))throw e;r._debug("Exception in queued task: "+(e.stack||e))}}}finally{n._running=!1}},queueTask:function(e){var n=this;n._tasks.push(e),n._runTimeout||(n._runTimeout=setTimeout(t.bind(n.flush,n),0))},flush:function(){var t=this;t.runTask(function(){})},drain:function(){var e=this;if(e.safeToRunTask())for(;!t.isEmpty(e._tasks);)e.flush()},safeToRunTask:function(){var t=this;return!t._running}})}.call(this),function(){var t=[],e=!1,n=!1,o=0,i=function(){o++},a=function(){o--,s()},s=function(){if(!(n||!e||o>0)){for(n=!0;t.length;)t.shift()();r.isCordova&&WebAppLocalServer.startupDidComplete()}},u=function(){e||(e=!0,s())};r.isCordova&&(i(),document.addEventListener("deviceready",a,!1)),"complete"===document.readyState||"loaded"===document.readyState?window.setTimeout(u):document.addEventListener?(document.addEventListener("DOMContentLoaded",u,!1),window.addEventListener("load",u,!1)):(document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&u()}),window.attachEvent("load",u)),r.startup=function(e){var o=!document.addEventListener&&document.documentElement.doScroll;if(o&&window===top){try{o("left")}catch(t){return void setTimeout(function(){r.startup(e)},50)}e()}else n?e():t.push(e)}}.call(this),function(){var t=0;r._debug=function(){if(t)return void t--;if("undefined"!=typeof console&&"undefined"!=typeof console.log)if(0==arguments.length)console.log("");else if("function"==typeof console.log.apply){for(var e=!0,n=0;n<arguments.length;n++)"string"!=typeof arguments[n]&&(e=!1);e?console.log.apply(console,[Array.prototype.join.call(arguments," ")]):console.log.apply(console,arguments)}else if("function"==typeof Function.prototype.bind){var r=Function.prototype.bind.call(console.log,console);r.apply(console,arguments)}else Function.prototype.call.call(console.log,console,Array.prototype.slice.call(arguments))},r._suppress_log=function(e){t+=e},r._suppressed_log_expected=function(){return 0!==t}}.call(this),function(){r._escapeRegExp=function(t){return String(t).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}}.call(this),function(){var t;t=r.isClient?n.TEST_METADATA:process.env.TEST_METADATA;var e=JSON.parse(t||"{}"),o=e.driverPackage;r.isTest=!!e.isTest,r.isAppTest=!!e.isAppTest,r.isPackageTest=!!o&&!r.isTest&&!r.isAppTest,"string"==typeof o&&r.startup(function(){var t=Package[o];if(!t)throw new Error("Can't find test driver package: "+o);if(r.isClient){if("function"!=typeof t.runTests)throw new Error("Test driver package "+o+" missing `runTests` export");t.runTests()}else"function"==typeof t.start&&t.start()})}.call(this),function(){var e=0,n=[];r.EnvironmentVariable=function(){this.slot=e++},t.extend(r.EnvironmentVariable.prototype,{get:function(){return n[this.slot]},getOrNullIfOutsideFiber:function(){return this.get()},withValue:function(t,e){var r=n[this.slot];try{n[this.slot]=t;var o=e()}finally{n[this.slot]=r}return o}}),r.bindEnvironment=function(e,o,i){var a=t.clone(n);if(!o||"string"==typeof o){var s=o||"callback of async function";o=function(t){r._debug("Exception in "+s+":",t&&t.stack||t)}}return function(){var r=n;try{n=a;var s=e.apply(i,t.toArray(arguments))}catch(t){o(t)}finally{n=r}return s}},r._nodeCodeMustBeInFiber=function(){}}.call(this),function(){r.absoluteUrl=function(e,n){n||"object"!=typeof e||(n=e,e=void 0),n=t.extend({},r.absoluteUrl.defaultOptions,n||{});var o=n.rootUrl;if(!o)throw new Error("Must pass options.rootUrl or set ROOT_URL in the server environment");return/^http[s]?:\/\//i.test(o)||(o="http://"+o),/\/$/.test(o)||(o+="/"),e&&(o+=e),n.secure&&/^http:/.test(o)&&!/http:\/\/localhost[:\/]/.test(o)&&!/http:\/\/127\.0\.0\.1[:\/]/.test(o)&&(o=o.replace(/^http:/,"https:")),n.replaceLocalhost&&(o=o.replace(/^http:\/\/localhost([:\/].*)/,"http://127.0.0.1$1")),o},r.absoluteUrl.defaultOptions={},"object"==typeof __meteor_runtime_config__&&__meteor_runtime_config__.ROOT_URL&&(r.absoluteUrl.defaultOptions.rootUrl=__meteor_runtime_config__.ROOT_URL),r._relativeToSiteRootUrl=function(t){return"object"==typeof __meteor_runtime_config__&&"/"===t.substr(0,1)&&(t=(__meteor_runtime_config__.ROOT_URL_PATH_PREFIX||"")+t),t}}.call(this),"undefined"==typeof Package&&(Package={}),function(t,e){for(var n in e)n in t||(t[n]=e[n])}(Package.meteor={},{Meteor:r,global:e,meteorEnv:n})}();
!function(){"undefined"==typeof Package&&(Package={}),Package["meteor-base"]={}}();
!function(){"undefined"==typeof Package&&(Package={}),Package["mobile-experience"]={}}();
!function(){var e=Package.meteor.Meteor,r=Package.meteor.global,n=Package.meteor.meteorEnv,t,o;t=function(e){"use strict";function r(e,r){return o(e)&&(l(P,e,r),i(w)&&w(b)),b}function n(e){this.id=e,this.children=[]}function t(e,r){return x.call(e,r)&&e[r]}function o(e){return e&&"object"==typeof e}function i(e){return"function"==typeof e}function u(e){return"string"==typeof e}function f(e){function r(r){var n=m(e,r);if(n)return a(n,e.m);var t=new Error("Cannot find module '"+r+"'");if(i(q))return q(r,e.m.id,t);throw t}return i(g)&&(r=g(r,e.m.id)),r.resolve=function(r){var n=m(e,r);if(n)return n.m.id;var t=new Error("Cannot find module '"+r+"'");if(q&&i(q.resolve))return q.resolve(r,e.m.id,t);throw t},r}function c(e,r){var t=this;t.p=r=r||null,t.m=new n(e)}function a(e,r){var n=e&&e.c,t=e.m;if(!x.call(t,"exports")){if(r){t.parent=r;var o=r.children;Array.isArray(o)&&o.push(t)}i(t.useNode)&&t.useNode()||n(t.require=t.require||f(e),t.exports={},t,e.m.id,e.p.m.id),t.loaded=!0}return i(t.runModuleSetters)&&t.runModuleSetters(),t.exports}function s(e){return e&&o(e.c)}function l(e,r,n){if(Array.isArray(r)){var f=[];r.forEach(function(e){u(e)?f.push(e):i(e)&&(r=e)}),i(r)?r.d=f:r=null}else i(r)?r.d=r.d||[]:u(r)||o(r)||(r=null);r&&(e.c=e.c||(o(r)?{}:r),o(r)&&s(e)&&Object.keys(r).forEach(function(o){if(".."===o)i=e.p;else{var i=t(e.c,o);i||(i=e.c[o]=new c(e.m.id.replace(/\/*$/,"/")+o,e),i.o=n)}l(i,r[o],n)}))}function p(e){return e.o&&e.o.extensions||y}function d(e,r,n){for(;e&&!s(e);)e=e.p;if(!e||!r||"."===r)return e;if(".."===r)return e.p;var o=t(e.c,r);if(n&&(!o||s(o)))for(var i=0;i<n.length;++i){var u=t(e.c,r+n[i]);if(u)return u}return o}function v(e,r,n){var t=r.split("/");return t.every(function(r,o){return e=o<t.length-1?d(e,r):d(e,r,n)}),e}function m(e,r,n){var t=p(e);for(e="/"===r.charAt(0)?v(P,r,t):"."===r.charAt(0)?v(e,r,t):h(e,r,t);s(e);){if(n=n||[],n.indexOf(e)<0){n.push(e);var o=d(e,"package.json"),i=o&&a(o).main;if(u(i)&&(e=v(e,i,t)||m(e,i,n)))continue}e=d(e,"index.js")}return e&&u(e.c)&&(e=m(e,e.c,n)),e}function h(e,r,n){if(i(k)&&(r=k(r,e.m.id)),u(r)){for(var t;e&&!t;e=e.p)t=s(e)&&v(e,"node_modules/"+r,n);return t}}e=e||{};var y=e.extensions||[".js",".json"],w=e.onInstall,g=e.wrapRequire,k=e.override,q=e.fallback,x={}.hasOwnProperty,P=new c("/",new c("/..")),b=f(P);return n.prototype.resolve=function(e){return this.require.resolve(e)},r.Module=n,r},"object"==typeof exports&&(exports.makeInstaller=t),function(){var r={},n=r.hasOwnProperty,i=/^[^.\/]/;"function"==typeof Profile&&process.env.METEOR_PROFILE&&(r.wrapRequire=function(e){return Profile(function(e){return"require("+JSON.stringify(e)+")"},e)}),r.fallback=function(e,r,n){if(i.test(e)&&"object"==typeof Npm&&"function"==typeof Npm.require)return Npm.require(e);throw n},r.fallback.resolve=function(r,n,t){if(e.isServer&&i.test(r))return r;throw t},o=t(r);var u=o.Module.prototype;e.isServer&&(u.useNode=function(){if("function"!=typeof npmRequire)return!1;var e=this.id.split("/"),r=0;if(""===e[r]&&++r,"node_modules"===e[r]&&"meteor"===e[r+1]&&(r+=2),e.indexOf("node_modules",r)<0)return!1;try{npmRequire.resolve(this.id)}catch(e){return!1}return this.exports=npmRequire(this.id),!0})}.call(this),"undefined"==typeof Package&&(Package={}),function(e,r){for(var n in r)n in e||(e[n]=r[n])}(Package["modules-runtime"]={},{meteorInstall:o})}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,r=Package.meteor.meteorEnv,n=Package.underscore._,i=Package["modules-runtime"].meteorInstall,o,s,a=i.replace("$set","$unset"modules:{"client.js":["./install-packages.js","./stubs.js","./buffer.js","./process.js","reify/lib/runtime","./css",function(e,t,r){e("./install-packages.js"),e("./stubs.js"),e("./buffer.js"),e("./process.js"),e("reify/lib/runtime").enable(r.constructor),t.addStyles=e("./css").addStyles}],"buffer.js":["buffer",function(e){try{o=t.Buffer||e("buffer").Buffer}catch(e){}}],"css.js":function(e,t){var r=document,n=r.getElementsByTagName("head").item(0);t.addStyles=function(e){var t=r.createElement("style");t.setAttribute("type","text/css");var i=t.sheet||t.styleSheet;return i?i.cssText=e:t.appendChild(r.createTextNode(e)),n.appendChild(t)}},"install-packages.js":function(e,t,r){function n(e,t){var r={};t?r[e+".js"]=[t,function(e,r,n){n.exports=e(t)}]:r[e+".js"]=function(t,r,n){n.exports=Package[e]},i({node_modules:{meteor:r}})}n("underscore"),n("meteor"),n("meteor-base"),n("mobile-experience"),n("modules-runtime"),n("modules","meteor/modules/client.js"),n("es5-shim","meteor/es5-shim/client.js"),n("promise","meteor/promise/client.js"),n("ecmascript-runtime","meteor/ecmascript-runtime/runtime.js"),n("babel-compiler"),n("ecmascript"),n("base64"),n("ejson"),n("id-map"),n("ordered-dict"),n("tracker"),n("babel-runtime","meteor/babel-runtime/babel-runtime.js"),n("random"),n("mongo-id"),n("diff-sequence"),n("geojson-utils","meteor/geojson-utils/main.js"),n("minimongo"),n("check","meteor/check/match.js"),n("retry"),n("ddp-common"),n("reload"),n("ddp-client"),n("ddp"),n("ddp-server"),n("allow-deny"),n("mongo"),n("blaze-html-templates"),n("reactive-var"),n("jquery","meteor/jquery/main.js"),n("standard-minifier-css"),n("standard-minifier-js"),n("shell-server"),n("ohif:polyfill"),n("standard-app-packages"),n("stylus"),n("observe-sequence"),n("deps"),n("htmljs"),n("blaze"),n("spacebars"),n("templating-compiler"),n("templating-runtime"),n("templating"),n("ui"),n("iron:core"),n("iron:dynamic-template"),n("iron:layout"),n("iron:url"),n("iron:middleware-stack"),n("iron:location"),n("reactive-dict"),n("iron:controller"),n("iron:router"),n("natestrauser:select2"),n("aldeed:simple-schema"),n("autoupdate"),n("meteor-platform"),n("webapp"),n("logging"),n("session"),n("livedata"),n("launch-screen"),n("ohif:core","meteor/ohif:core/main.js"),n("ohif:header","meteor/ohif:header/main.js"),n("ohif:themes-common"),n("ohif:themes"),n("ohif:design"),n("ohif:cornerstone","meteor/ohif:cornerstone/main.js"),n("url"),n("http"),n("momentjs:moment"),n("validatejs"),n("amplify"),n("ddp-rate-limiter"),n("localstorage"),n("callback-hook"),n("accounts-base","meteor/accounts-base/client_main.js"),n("u2622:persistent-session"),n("coffeescript"),n("practicalmeteor:chai"),n("practicalmeteor:loglevel"),n("ohif:log"),n("ohif:commands","meteor/ohif:commands/main.js"),n("ohif:hotkeys","meteor/ohif:hotkeys/main.js"),n("ohif:viewerbase","meteor/ohif:viewerbase/main.js"),n("ohif:metadata","meteor/ohif:metadata/main.js"),n("silentcicero:jszip"),n("raix:eventemitter"),n("aldeed:collection2-core"),n("aldeed:schema-index"),n("aldeed:schema-deny"),n("aldeed:collection2"),n("twbs:bootstrap"),n("dangrossman:bootstrap-daterangepicker"),n("ohif:dicom-services"),n("ohif:wadoproxy"),n("ohif:study-list"),n("ohif:hanging-protocols"),n("aldeed:template-extension"),n("fortawesome:fontawesome"),n("mrt:moment"),n("fastclick"),n("peppelg:bootstrap-3-modal"),n("hot-code-push"),n("mdg:validation-error"),n("service-configuration")},"process.js":["process",function(o,a,u){try{s=t.process||o("process")}catch(e){s={}}e.isServer?i({node_modules:{"process.js":function(e,t,r){r.exports=s}}}):(s.platform="browser",s.nextTick=s.nextTick||e._setImmediate),"object"!=typeof s.env&&(s.env={}),n.extend(s.env,r)}],"stubs.js":["meteor-node-stubs",function(e){try{e("meteor-node-stubs")}catch(e){}}],node_modules:{reify:{lib:{"runtime.js":["./entry.js","./utils.js",function(e,t,r){var n=e("./entry.js").Entry,i=e("./utils.js");t.enable=function(t){function r(e){var t=e.exports;t&&"object"==typeof t&&(t.__esModule=!0)}var o=t.prototype;return"function"==typeof o.import&&"function"==typeof o.export?t:(o.resolve=o.resolve||function e(t){throw new Error("Module.prototype.resolve not implemented")},o.runModuleSetters=function e(t){var r=n.get(this.id);return r&&r.runModuleSetters(this),t},o.import=function(t,i){var s=this;r(s);var a=s.resolve(t);if(i&&"object"==typeof i){var u=n.getOrCreate(a);u.addSetters(s,i)}var f=u&&u.runCount,l="function"==typeof s.require?s.require(a):e(a);u&&u.runCount===f&&u.runModuleSetters({id:a,exports:l,getExportByName:o.getExportByName})},o.export=function(e){var t=this;r(t),i.isPlainObject(e)&&n.getOrCreate(t.id).addGetters(e),t.loaded&&t.runModuleSetters()},o.getExportByName=function(e){var t=this.exports;return"*"===e?t:"default"!==e||t&&"object"==typeof t&&t.__esModule&&"default"in t?t&&t[e]:t},t)}}],"entry.js":["./utils.js",function(e,t,r){function n(e){this.id=e,this.runCount=0,this.setters=Object.create(null),this.getters=Object.create(null)}function i(e){var t=a[e.id];t&&t.runModuleSetters(e)}function o(e){var t=a[e.id];return t?t.runModuleGetters(e):0}var s=Object.prototype.hasOwnProperty,a=Object.create(null),u=e("./utils.js"),f=n.prototype;n.get=function(e){return a[e]||null},n.getOrCreate=function(e){return a[e]=a[e]||new n(e)},f.addSetters=function(e,t){var r=this;Object.keys(t).forEach(function(n){var i=t[n];"function"==typeof i&&"__esModule"!==n&&(i.parent=e,(r.setters[n]=r.setters[n]||[]).push(i))})},f.addGetters=function(e){var t=this;Object.keys(e).forEach(function(r){var n=e[r];"function"==typeof n&&"__esModule"!==r&&(t.getters[r]=n)})},f.runModuleGetters=function(e){var t=this,r=0;return Object.keys(t.getters).forEach(function(n){t.runGetter(e,n)&&++r}),r},f.runGetter=function(e,t){if(!s.call(this.getters,t))return!1;var r=this.getters[t];try{var n=r.call(e)}catch(e){}var i=e.exports;return(!s.call(i,t)||i[t]!==n)&&(i[t]=n,!0)},f.runModuleSetters=function(e){function t(t,i){function o(e,r,n){if("__esModule"!==n)return e.last=e.last||Object.create(null),s.call(e.last,n)&&e.last[n]===r?void 0:t.apply(i,arguments)}n.forEach(function(t){r.setters[t].forEach(function(r){var n=e.getExportByName(t);"*"===t?Object.keys(n).forEach(function(e){o(r,n[e],e)}):o(r,n,t)})})}var r=this,n=Object.keys(r.setters);r.runModuleGetters(e);var a=[],f,l;t(function(e,t,r){var n=e.parent;l=l||Object.create(null),s.call(l,n.id)||(f=f||Object.create(null),f[n.id]=n,u.isPlainObject(n.exports)?l[n.id]=u.assign({},n.exports):l[n.id]=n.exports),a.push(e,t,r)});for(var c=0;c<a.length;c+=3){var h=a[c],d=a[c+1],p=a[c+2];h.call(e,h.last[p]=d,p)}++r.runCount,f&&Object.keys(f).forEach(function(e){var t=f[e];if(o(t)>0)return i(t);var r=t.exports,n=l[t.id];u.shallowObjEqual(r,n)||i(t)})},t.Entry=n}],"utils.js":function(e,t){function r(e){return i.call(e)===o}var n=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=i.call({});t.isPlainObject=r,t.assign=Object.assign||function(e){for(var t=arguments.length,r=1;r<t;++r){var n=arguments[r];if(n&&"object"==typeof n)for(var i=Object.keys(n),o=0;o<i.length;++o){var s=i[o];e[s]=n[s]}}return e},t.shallowObjEqual=function(e,t){if(e===t)return!0;if(!r(e)||!r(t))return!1;var i=Object.keys(e),o=Object.keys(t);return i.length===o.length&&i.every(function(r){return n.call(t,r)&&e[r]===t[r]})}}}}}}},"meteor-node-stubs":{"package.json":function(e,t){t.name="meteor-node-stubs",t.version="0.2.11",t.main="index.js"},"index.js":["./map.json",function(e,t,r){var n=e("./map.json"),o={};Object.keys(n).forEach(function(e){if("string"==typeof n[e]){var i=r.id.split("/");i.pop(),i.push("node_modules",n[e]),t[e]=o[e+".js"]=i.join("/")}else t[e]=n[e],o[e+".js"]=function(){}}),"function"==typeof i&&i({"..":{node_modules:o}})}],"map.json":function(e,t,r){r.exports={assert:"assert/",buffer:"buffer/",child_process:null,cluster:null,console:"console-browserify",constants:"constants-browserify",crypto:"../wrappers/crypto.js",dgram:null,dns:null,domain:"domain-browser",events:"events/",fs:null,http:"http-browserify",https:"https-browserify",module:"../wrappers/module.js",net:null,os:"os-browserify/browser.js",path:"path-browserify",process:"process/browser.js",punycode:"punycode/",querystring:"querystring-es3/",readline:null,repl:null,stream:"stream-browserify",_stream_duplex:"readable-stream/duplex.js",_stream_passthrough:"readable-stream/passthrough.js",_stream_readable:"readable-stream/readable.js",_stream_transform:"readable-stream/transform.js",_stream_writable:"readable-stream/writable.js",string_decoder:"string_decoder/",sys:"util/util.js",timers:"timers-browserify",tls:null,tty:"tty-browserify",url:"url/",util:"util/util.js",vm:"vm-browserify",zlib:"browserify-zlib"}},deps:{"buffer.js":["buffer/",function(e){e("buffer/")}],"process.js":["process/browser.js",function(e){e("process/browser.js")}],"domain.js":["domain-browser",function(e){e("domain-browser")}],"tty.js":["tty-browserify",function(e){e("tty-browserify")}],"zlib.js":["browserify-zlib",function(e){e("browserify-zlib")}],"_stream_transform.js":["readable-stream/transform.js",function(e){e("readable-stream/transform.js")}],"stream.js":["stream-browserify",function(e){e("stream-browserify")}]},node_modules:{buffer:{"package.json":function(e,t){t.name="buffer",t.version="4.9.1",t.main="index.js"},"index.js":["base64-js","ieee754","isarray",function(e,r,n){"use strict";function i(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}function o(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(o()<t)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=a.prototype):(null===e&&(e=new a(t)),e.length=t),e}function a(e,t,r){if(!(a.TYPED_ARRAY_SUPPORT||this instanceof a))return new a(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return c(this,e)}return u(this,e,t,r)}function u(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?p(e,t,r,n):"string"==typeof t?h(e,t,r):_(e,t)}function f(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function l(e,t,r,n){return f(t),t<=0?s(e,t):void 0!==r?"string"==typeof n?s(e,t).fill(r,n):s(e,t).fill(r):s(e,t)}function c(e,t){if(f(t),e=s(e,t<0?0:0|g(t)),!a.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function h(e,t,r){if("string"==typeof r&&""!==r||(r="utf8"),!a.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|m(t,r);e=s(e,n);var i=e.write(t,r);return i!==n&&(e=e.slice(0,i)),e}function d(e,t){var r=t.length<0?0:0|g(t.length);e=s(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function p(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n),a.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=a.prototype):e=d(e,t),e}function _(e,t){if(a.isBuffer(t)){var r=0|g(t.length);return e=s(e,r),0===e.length?e:(t.copy(e,0,0,r),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||J(t.length)?s(e,0):d(e,t);if("Buffer"===t.type&&ee(t.data))return d(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function g(e){if(e>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function b(e){return+e!=e&&(e=0),a.alloc(+e)}function m(e,t){if(a.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return V(e).length;default:if(n)return G(e).length;t=(""+t).toLowerCase(),n=!0}}function y(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,t>>>=0,r<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return N(this,t,r);case"utf8":case"utf-8":return L(this,t,r);case"ascii":return M(this,t,r);case"latin1":case"binary":return z(this,t,r);case"base64":return O(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function v(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function w(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=a.from(t,n)),a.isBuffer(t))return 0===t.length?-1:j(e,t,r,n,i);if("number"==typeof t)return t=255&t,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):j(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function j(e,t,r,n,i){function o(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}var s=1,a=e.length,u=t.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}var f;if(i){var l=-1;for(f=r;f<a;f++)if(o(e,f)===o(t,l===-1?0:f-l)){if(l===-1&&(l=f),f-l+1===u)return l*s}else l!==-1&&(f-=f-l),l=-1}else for(r+u>a&&(r=a-u),f=r;f>=0;f--){for(var c=!0,h=0;h<u;h++)if(o(e,f+h)!==o(t,h)){c=!1;break}if(c)return f}return-1}function k(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))return s;e[r+s]=a}return s}function x(e,t,r,n){return X(G(t,e.length-r),e,r,n)}function E(e,t,r,n){return X(H(t),e,r,n)}function S(e,t,r,n){return E(e,t,r,n)}function A(e,t,r,n){return X(V(t),e,r,n)}function R(e,t,r,n){return X(K(t,e.length-r),e,r,n)}function O(e,t,r){return 0===t&&r===e.length?$.fromByteArray(e):$.fromByteArray(e.slice(t,r))}function L(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o=e[i],s=null,a=o>239?4:o>223?3:o>191?2:1;if(i+a<=r){var u,f,l,c;switch(a){case 1:o<128&&(s=o);break;case 2:u=e[i+1],128===(192&u)&&(c=(31&o)<<6|63&u,c>127&&(s=c));break;case 3:u=e[i+1],f=e[i+2],128===(192&u)&&128===(192&f)&&(c=(15&o)<<12|(63&u)<<6|63&f,c>2047&&(c<55296||c>57343)&&(s=c));break;case 4:u=e[i+1],f=e[i+2],l=e[i+3],128===(192&u)&&128===(192&f)&&128===(192&l)&&(c=(15&o)<<18|(63&u)<<12|(63&f)<<6|63&l,c>65535&&c<1114112&&(s=c))}}null===s?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),i+=a}return T(n)}function T(e){var t=e.length;if(t<=te)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=te));return r}function M(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function z(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function N(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=q(e[o]);return i}function I(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function P(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function B(e,t,r,n,i,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function D(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i<o;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function C(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i<o;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function U(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(e,t,r,n,i){return i||U(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(e,t,r,n,23,4),r+4}function Z(e,t,r,n,i){return i||U(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(e,t,r,n,52,8),r+8}function Y(e){if(e=W(e).replace(re,""),e.length<2)return"";for(;e.length%4!==0;)e+="=";return e}function W(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function q(e){return e<16?"0"+e.toString(16):e.toString(16)}function G(e,t){t=t||1/0;for(var r,n=e.length,i=null,o=[],s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function H(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function K(e,t){for(var r,n,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function V(e){return $.toByteArray(Y(e))}function X(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function J(e){return e!==e}var $=e("base64-js"),Q=e("ieee754"),ee=e("isarray");r.Buffer=a,r.SlowBuffer=b,r.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:i(),r.kMaxLength=o(),a.poolSize=8192,a._augment=function(e){return e.__proto__=a.prototype,e},a.from=function(e,t,r){return u(null,e,t,r)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(e,t,r){return l(null,e,t,r)},a.allocUnsafe=function(e){return c(null,e)},a.allocUnsafeSlow=function(e){return c(null,e)},a.isBuffer=function e(t){return!(null==t||!t._isBuffer)},a.compare=function e(t,r){if(!a.isBuffer(t)||!a.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var n=t.length,i=r.length,o=0,s=Math.min(n,i);o<s;++o)if(t[o]!==r[o]){n=t[o],i=r[o];break}return n<i?-1:i<n?1:0},a.isEncoding=function e(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function e(t,r){if(!ee(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);var n;if(void 0===r)for(r=0,n=0;n<t.length;++n)r+=t[n].length;var i=a.allocUnsafe(r),o=0;for(n=0;n<t.length;++n){var s=t[n];if(!a.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,o),o+=s.length}return i},a.byteLength=m,a.prototype._isBuffer=!0,a.prototype.swap16=function e(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)v(this,r,r+1);return this},a.prototype.swap32=function e(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)v(this,r,r+3),v(this,r+1,r+2);return this},a.prototype.swap64=function e(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)v(this,r,r+7),v(this,r+1,r+6),v(this,r+2,r+5),v(this,r+3,r+4);return this},a.prototype.toString=function e(){var t=0|this.length;return 0===t?"":0===arguments.length?L(this,0,t):y.apply(this,arguments)},a.prototype.equals=function e(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function e(){var t="",n=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},a.prototype.compare=function e(t,r,n,i,o){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===n&&(n=t?t.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),r<0||n>t.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===t)return 0;for(var s=o-i,u=n-r,f=Math.min(s,u),l=this.slice(i,o),c=t.slice(r,n),h=0;h<f;++h)if(l[h]!==c[h]){s=l[h],u=c[h];break}return s<u?-1:u<s?1:0},a.prototype.includes=function e(t,r,n){return this.indexOf(t,r,n)!==-1},a.prototype.indexOf=function e(t,r,n){return w(this,t,r,n,!0)},a.prototype.lastIndexOf=function e(t,r,n){return w(this,t,r,n,!1)},a.prototype.write=function e(t,r,n,i){if(void 0===r)i="utf8",n=this.length,r=0;else if(void 0===n&&"string"==typeof r)i=r,n=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r=0|r,isFinite(n)?(n=0|n,void 0===i&&(i="utf8")):(i=n,n=void 0)}var o=this.length-r;if((void 0===n||n>o)&&(n=o),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return k(this,t,r,n);case"utf8":case"utf-8":return x(this,t,r,n);case"ascii":return E(this,t,r,n);case"latin1":case"binary":return S(this,t,r,n);case"base64":return A(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},a.prototype.toJSON=function e(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var te=4096;a.prototype.slice=function e(t,r){var n=this.length;t=~~t,r=void 0===r?n:~~r,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<t&&(r=t);var i;if(a.TYPED_ARRAY_SUPPORT)i=this.subarray(t,r),i.__proto__=a.prototype;else{var o=r-t;i=new a(o,(void 0));for(var s=0;s<o;++s)i[s]=this[s+t]}return i},a.prototype.readUIntLE=function e(t,r,n){t=0|t,r=0|r,n||P(t,r,this.length);for(var i=this[t],o=1,s=0;++s<r&&(o*=256);)i+=this[t+s]*o;return i},a.prototype.readUIntBE=function e(t,r,n){t=0|t,r=0|r,n||P(t,r,this.length);for(var i=this[t+--r],o=1;r>0&&(o*=256);)i+=this[t+--r]*o;return i},a.prototype.readUInt8=function e(t,r){return r||P(t,1,this.length),this[t]},a.prototype.readUInt16LE=function e(t,r){return r||P(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function e(t,r){return r||P(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function e(t,r){return r||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function e(t,r){return r||P(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function e(t,r,n){t=0|t,r=0|r,n||P(t,r,this.length);for(var i=this[t],o=1,s=0;++s<r&&(o*=256);)i+=this[t+s]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*r)),i},a.prototype.readIntBE=function e(t,r,n){t=0|t,r=0|r,n||P(t,r,this.length);for(var i=r,o=1,s=this[t+--i];i>0&&(o*=256);)s+=this[t+--i]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*r)),s},a.prototype.readInt8=function e(t,r){return r||P(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},a.prototype.readInt16LE=function e(t,r){r||P(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt16BE=function e(t,r){r||P(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt32LE=function e(t,r){return r||P(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function e(t,r){return r||P(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function e(t,r){return r||P(t,4,this.length),Q.read(this,t,!0,23,4)},a.prototype.readFloatBE=function e(t,r){return r||P(t,4,this.length),Q.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function e(t,r){return r||P(t,8,this.length),Q.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function e(t,r){return r||P(t,8,this.length),Q.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function e(t,r,n,i){if(t=+t,r=0|r,n=0|n,!i){var o=Math.pow(2,8*n)-1;B(this,t,r,n,o,0)}var s=1,a=0;for(this[r]=255&t;++a<n&&(s*=256);)this[r+a]=t/s&255;return r+n},a.prototype.writeUIntBE=function e(t,r,n,i){if(t=+t,r=0|r,n=0|n,!i){var o=Math.pow(2,8*n)-1;B(this,t,r,n,o,0)}var s=n-1,a=1;for(this[r+s]=255&t;--s>=0&&(a*=256);)this[r+s]=t/a&255;return r+n},a.prototype.writeUInt8=function e(t,r,n){return t=+t,r=0|r,n||B(this,t,r,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},a.prototype.writeUInt16LE=function e(t,r,n){return t=+t,r=0|r,n||B(this,t,r,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):D(this,t,r,!0),r+2},a.prototype.writeUInt16BE=function e(t,r,n){return t=+t,r=0|r,n||B(this,t,r,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):D(this,t,r,!1),r+2},a.prototype.writeUInt32LE=function e(t,r,n){return t=+t,r=0|r,n||B(this,t,r,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):C(this,t,r,!0),r+4},a.prototype.writeUInt32BE=function e(t,r,n){return t=+t,r=0|r,n||B(this,t,r,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):C(this,t,r,!1),r+4},a.prototype.writeIntLE=function e(t,r,n,i){if(t=+t,r=0|r,!i){var o=Math.pow(2,8*n-1);B(this,t,r,n,o-1,-o)}var s=0,a=1,u=0;for(this[r]=255&t;++s<n&&(a*=256);)t<0&&0===u&&0!==this[r+s-1]&&(u=1),this[r+s]=(t/a>>0)-u&255;return r+n},a.prototype.writeIntBE=function e(t,r,n,i){if(t=+t,r=0|r,!i){var o=Math.pow(2,8*n-1);B(this,t,r,n,o-1,-o)}var s=n-1,a=1,u=0;for(this[r+s]=255&t;--s>=0&&(a*=256);)t<0&&0===u&&0!==this[r+s+1]&&(u=1),this[r+s]=(t/a>>0)-u&255;return r+n},a.prototype.writeInt8=function e(t,r,n){return t=+t,r=0|r,n||B(this,t,r,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},a.prototype.writeInt16LE=function e(t,r,n){return t=+t,r=0|r,n||B(this,t,r,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):D(this,t,r,!0),r+2},a.prototype.writeInt16BE=function e(t,r,n){return t=+t,r=0|r,n||B(this,t,r,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):D(this,t,r,!1),r+2},a.prototype.writeInt32LE=function e(t,r,n){return t=+t,r=0|r,n||B(this,t,r,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):C(this,t,r,!0),r+4},a.prototype.writeInt32BE=function e(t,r,n){return t=+t,r=0|r,n||B(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):C(this,t,r,!1),r+4},a.prototype.writeFloatLE=function e(t,r,n){return F(this,t,r,!0,n)},a.prototype.writeFloatBE=function e(t,r,n){return F(this,t,r,!1,n)},a.prototype.writeDoubleLE=function e(t,r,n){return Z(this,t,r,!0,n)},a.prototype.writeDoubleBE=function e(t,r,n){return Z(this,t,r,!1,n)},a.prototype.copy=function e(t,r,n,i){if(n||(n=0),i||0===i||(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i<n&&(i=n),i===n)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-r<i-n&&(i=t.length-r+n);var o=i-n,s;if(this===t&&n<r&&r<i)for(s=o-1;s>=0;--s)t[s+r]=this[s+n];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(s=0;s<o;++s)t[s+r]=this[s+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),r);return o},a.prototype.fill=function e(t,r,n,i){if("string"==typeof t){if("string"==typeof r?(i=r,r=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!a.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else"number"==typeof t&&(t=255&t);if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0);var s;if("number"==typeof t)for(s=r;s<n;++s)this[s]=t;else{var u=a.isBuffer(t)?t:G(new a(t,i).toString()),f=u.length;for(s=0;s<n-r;++s)this[s+r]=u[s%f]}return this};var re=/[^+\/0-9A-Za-z-_]/g}]},"base64-js":{"package.json":function(e,t){t.name="base64-js",t.version="1.2.0",t.main="index.js"},"index.js":function(e,t){"use strict";function r(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function n(e){return 3*e.length/4-r(e)}function i(e){var t,n,i,o,s,a,u=e.length;s=r(e),a=new l(3*u/4-s),i=s>0?u-4:u;var c=0;for(t=0,n=0;t<i;t+=4,n+=3)o=f[e.charCodeAt(t)]<<18|f[e.charCodeAt(t+1)]<<12|f[e.charCodeAt(t+2)]<<6|f[e.charCodeAt(t+3)],a[c++]=o>>16&255,a[c++]=o>>8&255,a[c++]=255&o;return 2===s?(o=f[e.charCodeAt(t)]<<2|f[e.charCodeAt(t+1)]>>4,a[c++]=255&o):1===s&&(o=f[e.charCodeAt(t)]<<10|f[e.charCodeAt(t+1)]<<4|f[e.charCodeAt(t+2)]>>2,a[c++]=o>>8&255,a[c++]=255&o),a}function o(e){return u[e>>18&63]+u[e>>12&63]+u[e>>6&63]+u[63&e]}function s(e,t,r){for(var n,i=[],s=t;s<r;s+=3)n=(e[s]<<16)+(e[s+1]<<8)+e[s+2],i.push(o(n));return i.join("")}function a(e){for(var t,r=e.length,n=r%3,i="",o=[],a=16383,f=0,l=r-n;f<l;f+=a)o.push(s(e,f,f+a>l?l:f+a));return 1===n?(t=e[r-1],i+=u[t>>2],i+=u[t<<4&63],i+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],i+=u[t>>10],i+=u[t>>4&63],i+=u[t<<2&63],i+="="),o.push(i),o.join("")}t.byteLength=n,t.toByteArray=i,t.fromByteArray=a;for(var u=[],f=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,d=c.length;h<d;++h)u[h]=c[h],f[c.charCodeAt(h)]=h;f["-".charCodeAt(0)]=62,f["_".charCodeAt(0)]=63}},ieee754:{"package.json":function(e,t){t.name="ieee754",t.version="1.1.8",t.main="index.js"},"index.js":function(e,t){t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,f=u>>1,l=-7,c=r?i-1:0,h=r?-1:1,d=e[t+c];for(c+=h,o=d&(1<<-l)-1,d>>=-l,l+=a;l>0;o=256*o+e[t+c],c+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+e[t+c],c+=h,l-=8);if(0===o)o=1-f;else{if(o===u)return s?NaN:(d?-1:1)*(1/0);s+=Math.pow(2,n),o-=f}return(d?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,f=8*o-i-1,l=(1<<f)-1,c=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,_=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),t+=s+c>=1?h/u:h*Math.pow(2,1-c),t*u>=2&&(s++,u/=2),s+c>=l?(a=0,s=l):s+c>=1?(a=(t*u-1)*Math.pow(2,i),s+=c):(a=t*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;e[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,f+=i;f>0;e[r+d]=255&s,d+=p,s/=256,f-=8);e[r+d-p]|=128*_;
}}},isarray:{"package.json":function(e,t){t.name="isarray",t.version="1.0.0",t.main="index.js"},"index.js":function(e,t,r){var n={}.toString;r.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}}},process:{"browser.js":function(e,t,r){function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function o(e){if(h===setTimeout)return setTimeout(e,0);if((h===n||!h)&&setTimeout)return h=setTimeout,setTimeout(e,0);try{return h(e,0)}catch(t){try{return h.call(null,e,0)}catch(t){return h.call(this,e,0)}}}function s(e){if(d===clearTimeout)return clearTimeout(e);if((d===i||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(e);try{return d(e)}catch(t){try{return d.call(null,e)}catch(t){return d.call(this,e)}}}function a(){_&&g&&(_=!1,g.length?p=g.concat(p):b=-1,p.length&&u())}function u(){if(!_){var e=o(a);_=!0;for(var t=p.length;t;){for(g=p,p=[];++b<t;)g&&g[b].run();b=-1,t=p.length}g=null,_=!1,s(e)}}function f(e,t){this.fun=e,this.array=t}function l(){}var c=r.exports={},h,d;!function(){try{h="function"==typeof setTimeout?setTimeout:n}catch(e){h=n}try{d="function"==typeof clearTimeout?clearTimeout:i}catch(e){d=i}}();var p=[],_=!1,g,b=-1;c.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];p.push(new f(e,t)),1!==p.length||_||o(u)},f.prototype.run=function(){this.fun.apply(null,this.array)},c.title="browser",c.browser=!0,c.env={},c.argv=[],c.version="",c.versions={},c.on=l,c.addListener=l,c.once=l,c.off=l,c.removeListener=l,c.removeAllListeners=l,c.emit=l,c.binding=function(e){throw new Error("process.binding is not supported")},c.cwd=function(){return"/"},c.chdir=function(e){throw new Error("process.chdir is not supported")},c.umask=function(){return 0}}},"domain-browser":{"package.json":function(e,t){t.name="domain-browser",t.version="1.1.7",t.main="./index.js"},"index.js":["events",function(e,t,r){"use strict";r.exports=function(){var t=e("events"),r={};return r.createDomain=r.create=function(){function e(e){r.emit("error",e)}var r=new t.EventEmitter;return r.add=function(t){t.on("error",e)},r.remove=function(t){t.removeListener("error",e)},r.bind=function(t){return function(){var r=Array.prototype.slice.call(arguments);try{t.apply(null,r)}catch(t){e(t)}}},r.intercept=function(t){return function(r){if(r)e(r);else{var n=Array.prototype.slice.call(arguments,1);try{t.apply(null,n)}catch(t){e(t)}}}},r.run=function(t){try{t()}catch(t){e(t)}return this},r.dispose=function(){return this.removeAllListeners(),this},r.enter=r.exit=function(){return this},r},r}.call(this)}]},events:{"package.json":function(e,t){t.name="events",t.version="1.1.1",t.main="./events.js"},"events.js":function(e,t,r){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(e){return"function"==typeof e}function o(e){return"number"==typeof e}function s(e){return"object"==typeof e&&null!==e}function a(e){return void 0===e}r.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if(!o(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,r,n,o,u,f;if(this._events||(this._events={}),"error"===e&&(!this._events.error||s(this._events.error)&&!this._events.error.length)){if(t=arguments[1],t instanceof Error)throw t;var l=new Error('Uncaught, unspecified "error" event. ('+t+")");throw l.context=t,l}if(r=this._events[e],a(r))return!1;if(i(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:o=Array.prototype.slice.call(arguments,1),r.apply(this,o)}else if(s(r))for(o=Array.prototype.slice.call(arguments,1),f=r.slice(),n=f.length,u=0;u<n;u++)f[u].apply(this,o);return!0},n.prototype.addListener=function(e,t){var r;if(!i(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,i(t.listener)?t.listener:t),this._events[e]?s(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,s(this._events[e])&&!this._events[e].warned&&(r=a(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,r&&r>0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}if(!i(t))throw TypeError("listener must be a function");var n=!1;return r.listener=t,this.on(e,r),this},n.prototype.removeListener=function(e,t){var r,n,o,a;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=this._events[e],o=r.length,n=-1,r===t||i(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(s(r)){for(a=o;a-- >0;)if(r[a]===t||r[a].listener&&r[a].listener===t){n=a;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],i(r))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?i(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(i(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}}},"tty-browserify":{"package.json":function(e,t){t.name="tty-browserify",t.version="0.0.0",t.main="index.js"},"index.js":function(e,t){function r(){throw new Error("tty.ReadStream is not implemented")}function n(){throw new Error("tty.ReadStream is not implemented")}t.isatty=function(){return!1},t.ReadStream=r,t.WriteStream=n}},"browserify-zlib":{"package.json":function(e,t){t.name="browserify-zlib",t.version="0.1.4",t.main="src/index.js"},src:{"index.js":["_stream_transform","./binding","util","assert","meteor-node-stubs/deps/_stream_transform",function(e,t){function r(e,t,r){function n(){for(var t;null!==(t=e.read());)a.push(t),u+=t.length;e.once("readable",n)}function i(t){e.removeListener("end",s),e.removeListener("readable",n),r(t)}function s(){var t=o.concat(a,u);a=[],r(null,t),e.close()}var a=[],u=0;e.on("error",i),e.on("end",s),e.end(t),n()}function n(e,t){if("string"==typeof t&&(t=new o(t)),!o.isBuffer(t))throw new TypeError("Not a string or buffer");var r=_.Z_FINISH;return e._processChunk(t,r)}function i(e){return this instanceof i?void d.call(this,e,_.DEFLATE):new i(e)}function a(e){return this instanceof a?void d.call(this,e,_.INFLATE):new a(e)}function u(e){return this instanceof u?void d.call(this,e,_.GZIP):new u(e)}function f(e){return this instanceof f?void d.call(this,e,_.GUNZIP):new f(e)}function l(e){return this instanceof l?void d.call(this,e,_.DEFLATERAW):new l(e)}function c(e){return this instanceof c?void d.call(this,e,_.INFLATERAW):new c(e)}function h(e){return this instanceof h?void d.call(this,e,_.UNZIP):new h(e)}function d(e,r){if(this._opts=e=e||{},this._chunkSize=e.chunkSize||t.Z_DEFAULT_CHUNK,p.call(this,e),e.flush&&e.flush!==_.Z_NO_FLUSH&&e.flush!==_.Z_PARTIAL_FLUSH&&e.flush!==_.Z_SYNC_FLUSH&&e.flush!==_.Z_FULL_FLUSH&&e.flush!==_.Z_FINISH&&e.flush!==_.Z_BLOCK)throw new Error("Invalid flush flag: "+e.flush);if(this._flushFlag=e.flush||_.Z_NO_FLUSH,e.chunkSize&&(e.chunkSize<t.Z_MIN_CHUNK||e.chunkSize>t.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBits<t.Z_MIN_WINDOWBITS||e.windowBits>t.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.level<t.Z_MIN_LEVEL||e.level>t.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevel<t.Z_MIN_MEMLEVEL||e.memLevel>t.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=t.Z_FILTERED&&e.strategy!=t.Z_HUFFMAN_ONLY&&e.strategy!=t.Z_RLE&&e.strategy!=t.Z_FIXED&&e.strategy!=t.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!o.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new _.Zlib(r);var n=this;this._hadError=!1,this._binding.onerror=function(e,r){n._binding=null,n._hadError=!0;var i=new Error(e);i.errno=r,i.code=t.codes[r],n.emit("error",i)};var i=t.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(i=e.level);var s=t.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(s=e.strategy),this._binding.init(e.windowBits||t.Z_DEFAULT_WINDOWBITS,i,e.memLevel||t.Z_DEFAULT_MEMLEVEL,s,e.dictionary),this._buffer=new o(this._chunkSize),this._offset=0,this._closed=!1,this._level=i,this._strategy=s,this.once("end",this.close)}var p=e("_stream_transform"),_=e("./binding"),g=e("util"),b=e("assert").ok;_.Z_MIN_WINDOWBITS=8,_.Z_MAX_WINDOWBITS=15,_.Z_DEFAULT_WINDOWBITS=15,_.Z_MIN_CHUNK=64,_.Z_MAX_CHUNK=1/0,_.Z_DEFAULT_CHUNK=16384,_.Z_MIN_MEMLEVEL=1,_.Z_MAX_MEMLEVEL=9,_.Z_DEFAULT_MEMLEVEL=8,_.Z_MIN_LEVEL=-1,_.Z_MAX_LEVEL=9,_.Z_DEFAULT_LEVEL=_.Z_DEFAULT_COMPRESSION,Object.keys(_).forEach(function(e){e.match(/^Z/)&&(t[e]=_[e])}),t.codes={Z_OK:_.Z_OK,Z_STREAM_END:_.Z_STREAM_END,Z_NEED_DICT:_.Z_NEED_DICT,Z_ERRNO:_.Z_ERRNO,Z_STREAM_ERROR:_.Z_STREAM_ERROR,Z_DATA_ERROR:_.Z_DATA_ERROR,Z_MEM_ERROR:_.Z_MEM_ERROR,Z_BUF_ERROR:_.Z_BUF_ERROR,Z_VERSION_ERROR:_.Z_VERSION_ERROR},Object.keys(t.codes).forEach(function(e){t.codes[t.codes[e]]=e}),t.Deflate=i,t.Inflate=a,t.Gzip=u,t.Gunzip=f,t.DeflateRaw=l,t.InflateRaw=c,t.Unzip=h,t.createDeflate=function(e){return new i(e)},t.createInflate=function(e){return new a(e)},t.createDeflateRaw=function(e){return new l(e)},t.createInflateRaw=function(e){return new c(e)},t.createGzip=function(e){return new u(e)},t.createGunzip=function(e){return new f(e)},t.createUnzip=function(e){return new h(e)},t.deflate=function(e,t,n){return"function"==typeof t&&(n=t,t={}),r(new i(t),e,n)},t.deflateSync=function(e,t){return n(new i(t),e)},t.gzip=function(e,t,n){return"function"==typeof t&&(n=t,t={}),r(new u(t),e,n)},t.gzipSync=function(e,t){return n(new u(t),e)},t.deflateRaw=function(e,t,n){return"function"==typeof t&&(n=t,t={}),r(new l(t),e,n)},t.deflateRawSync=function(e,t){return n(new l(t),e)},t.unzip=function(e,t,n){return"function"==typeof t&&(n=t,t={}),r(new h(t),e,n)},t.unzipSync=function(e,t){return n(new h(t),e)},t.inflate=function(e,t,n){return"function"==typeof t&&(n=t,t={}),r(new a(t),e,n)},t.inflateSync=function(e,t){return n(new a(t),e)},t.gunzip=function(e,t,n){return"function"==typeof t&&(n=t,t={}),r(new f(t),e,n)},t.gunzipSync=function(e,t){return n(new f(t),e)},t.inflateRaw=function(e,t,n){return"function"==typeof t&&(n=t,t={}),r(new c(t),e,n)},t.inflateRawSync=function(e,t){return n(new c(t),e)},g.inherits(d,p),d.prototype.params=function(e,r,n){if(e<t.Z_MIN_LEVEL||e>t.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(r!=t.Z_FILTERED&&r!=t.Z_HUFFMAN_ONLY&&r!=t.Z_RLE&&r!=t.Z_FIXED&&r!=t.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+r);if(this._level!==e||this._strategy!==r){var i=this;this.flush(_.Z_SYNC_FLUSH,function(){i._binding.params(e,r),i._hadError||(i._level=e,i._strategy=r,n&&n())})}else s.nextTick(n)},d.prototype.reset=function(){return this._binding.reset()},d.prototype._flush=function(e){this._transform(new o(0),"",e)},d.prototype.flush=function(e,t){var r=this._writableState;if(("function"==typeof e||void 0===e&&!t)&&(t=e,e=_.Z_FULL_FLUSH),r.ended)t&&s.nextTick(t);else if(r.ending)t&&this.once("end",t);else if(r.needDrain){var n=this;this.once("drain",function(){n.flush(t)})}else this._flushFlag=e,this.write(new o(0),"",t)},d.prototype.close=function(e){if(e&&s.nextTick(e),!this._closed){this._closed=!0,this._binding.close();var t=this;s.nextTick(function(){t.emit("close")})}},d.prototype._transform=function(e,t,r){var n,i=this._writableState,s=i.ending||i.ended,a=s&&(!e||i.length===e.length);if(null===!e&&!o.isBuffer(e))return r(new Error("invalid input"));a?n=_.Z_FINISH:(n=this._flushFlag,e.length>=i.length&&(this._flushFlag=this._opts.flush||_.Z_NO_FLUSH));var u=this;this._processChunk(e,n,r)},d.prototype._processChunk=function(e,t,r){function n(h,d){if(!u._hadError){var p=s-d;if(b(p>=0,"have should not go down"),p>0){var _=u._buffer.slice(u._offset,u._offset+p);u._offset+=p,f?u.push(_):(l.push(_),c+=_.length)}if((0===d||u._offset>=u._chunkSize)&&(s=u._chunkSize,u._offset=0,u._buffer=new o(u._chunkSize)),0===d){if(a+=i-h,i=h,!f)return!0;var g=u._binding.write(t,e,a,i,u._buffer,u._offset,u._chunkSize);return g.callback=n,void(g.buffer=e)}return!!f&&void r()}}var i=e&&e.length,s=this._chunkSize-this._offset,a=0,u=this,f="function"==typeof r;if(!f){var l=[],c=0,h;this.on("error",function(e){h=e});do var d=this._binding.writeSync(t,e,a,i,this._buffer,this._offset,s);while(!this._hadError&&n(d[0],d[1]));if(this._hadError)throw h;var p=o.concat(l,c);return this.close(),p}var _=this._binding.write(t,e,a,i,this._buffer,this._offset,s);_.buffer=e,_.callback=n},g.inherits(i,d),g.inherits(a,d),g.inherits(u,d),g.inherits(f,d),g.inherits(l,d),g.inherits(c,d),g.inherits(h,d)}],"binding.js":["pako/lib/zlib/messages","pako/lib/zlib/zstream","pako/lib/zlib/deflate.js","pako/lib/zlib/inflate.js","pako/lib/zlib/constants",function(e,t){function r(e){if(e<t.DEFLATE||e>t.UNZIP)throw new TypeError("Bad argument");this.mode=e,this.init_done=!1,this.write_in_progress=!1,this.pending_close=!1,this.windowBits=0,this.level=0,this.memLevel=0,this.strategy=0,this.dictionary=null}function n(e,t){for(var r=0;r<e.length;r++)this[t+r]=e[r]}var i=e("pako/lib/zlib/messages"),a=e("pako/lib/zlib/zstream"),u=e("pako/lib/zlib/deflate.js"),f=e("pako/lib/zlib/inflate.js"),l=e("pako/lib/zlib/constants");for(var c in l)t[c]=l[c];t.NONE=0,t.DEFLATE=1,t.INFLATE=2,t.GZIP=3,t.GUNZIP=4,t.DEFLATERAW=5,t.INFLATERAW=6,t.UNZIP=7,r.prototype.init=function(e,r,n,i,o){switch(this.windowBits=e,this.level=r,this.memLevel=n,this.strategy=i,this.mode!==t.GZIP&&this.mode!==t.GUNZIP||(this.windowBits+=16),this.mode===t.UNZIP&&(this.windowBits+=32),this.mode!==t.DEFLATERAW&&this.mode!==t.INFLATERAW||(this.windowBits=-this.windowBits),this.strm=new a,this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:var s=u.deflateInit2(this.strm,this.level,t.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:case t.UNZIP:var s=f.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}return s!==t.Z_OK?void this._error(s):(this.write_in_progress=!1,void(this.init_done=!0))},r.prototype.params=function(){throw new Error("deflateParams Not supported")},r.prototype._writeCheck=function(){if(!this.init_done)throw new Error("write before init");if(this.mode===t.NONE)throw new Error("already finalized");if(this.write_in_progress)throw new Error("write already in progress");if(this.pending_close)throw new Error("close is pending")},r.prototype.write=function(e,t,r,n,i,o,a){this._writeCheck(),this.write_in_progress=!0;var u=this;return s.nextTick(function(){u.write_in_progress=!1;var s=u._write(e,t,r,n,i,o,a);u.callback(s[0],s[1]),u.pending_close&&u.close()}),this},r.prototype.writeSync=function(e,t,r,n,i,o,s){return this._writeCheck(),this._write(e,t,r,n,i,o,s)},r.prototype._write=function(e,r,i,s,a,l,c){if(this.write_in_progress=!0,e!==t.Z_NO_FLUSH&&e!==t.Z_PARTIAL_FLUSH&&e!==t.Z_SYNC_FLUSH&&e!==t.Z_FULL_FLUSH&&e!==t.Z_FINISH&&e!==t.Z_BLOCK)throw new Error("Invalid flush value");null==r&&(r=new o(0),s=0,i=0),a._set?a.set=a._set:a.set=n;var h=this.strm;switch(h.avail_in=s,h.input=r,h.next_in=i,h.avail_out=c,h.output=a,h.next_out=l,this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:var d=u.deflate(h,e);break;case t.UNZIP:case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:var d=f.inflate(h,e);break;default:throw new Error("Unknown mode "+this.mode)}return d!==t.Z_STREAM_END&&d!==t.Z_OK&&this._error(d),this.write_in_progress=!1,[h.avail_in,h.avail_out]},r.prototype.close=function(){return this.write_in_progress?void(this.pending_close=!0):(this.pending_close=!1,this.mode===t.DEFLATE||this.mode===t.GZIP||this.mode===t.DEFLATERAW?u.deflateEnd(this.strm):f.inflateEnd(this.strm),void(this.mode=t.NONE))},r.prototype.reset=function(){switch(this.mode){case t.DEFLATE:case t.DEFLATERAW:var e=u.deflateReset(this.strm);break;case t.INFLATE:case t.INFLATERAW:var e=f.inflateReset(this.strm)}e!==t.Z_OK&&this._error(e)},r.prototype._error=function(e){this.onerror(i[e]+": "+this.strm.msg,e),this.write_in_progress=!1,this.pending_close&&this.close()},t.Zlib=r}]}},"readable-stream":{"transform.js":["./readable",function(e,t,r){r.exports=e("./readable").Transform}],"readable.js":["stream","./lib/_stream_readable.js","./lib/_stream_writable.js","./lib/_stream_duplex.js","./lib/_stream_transform.js","./lib/_stream_passthrough.js","meteor-node-stubs/deps/stream",function(e,t,r){var n=e("stream");"disable"===s.env.READABLE_STREAM&&n?(r.exports=n,t=r.exports=n.Readable,t.Readable=n.Readable,t.Writable=n.Writable,t.Duplex=n.Duplex,t.Transform=n.Transform,t.PassThrough=n.PassThrough,t.Stream=n):(t=r.exports=e("./lib/_stream_readable.js"),t.Stream=n||t,t.Readable=t,t.Writable=e("./lib/_stream_writable.js"),t.Duplex=e("./lib/_stream_duplex.js"),t.Transform=e("./lib/_stream_transform.js"),t.PassThrough=e("./lib/_stream_passthrough.js"))}],"writable.js":["stream","./lib/_stream_writable.js","meteor-node-stubs/deps/stream",function(e,t,r){var n=e("stream"),i=e("./lib/_stream_writable.js");"disable"===s.env.READABLE_STREAM&&(r.exports=n&&n.Writable||i),r.exports=i}],lib:{"_stream_writable.js":["process-nextick-args","util-deprecate","./internal/streams/stream","safe-buffer","util","./_stream_duplex",function(e,t,r){"use strict";function n(){}function i(e,t,r){this.chunk=e,this.encoding=t,this.callback=r,this.next=null}function o(t,r){S=S||e("./_stream_duplex"),t=t||{},this.objectMode=!!t.objectMode,r instanceof S&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var n=t.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var o=t.decodeStrings===!1;this.decodeStrings=!o,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){_(r,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new k(this)}function a(t){return S=S||e("./_stream_duplex"),L.call(a,this)||this instanceof S?(this._writableState=new o(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev)),void R.call(this)):new a(t)}function u(e,t){var r=new Error("write after end");e.emit("error",r),x(t,r)}function f(e,t,r,n){var i=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),x(n,o),i=!1),i}function l(e,t,r){return e.objectMode||e.decodeStrings===!1||"string"!=typeof t||(t=O.from(t,r)),t}function c(e,t,r,n,o,s){r||(n=l(t,n,o),O.isBuffer(n)&&(o="buffer"));var a=t.objectMode?1:n.length;t.length+=a;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var f=t.lastBufferedRequest;t.lastBufferedRequest=new i(n,o,s),f?f.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else h(e,t,!1,a,n,o,s);return u}function h(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function d(e,t,r,n,i){--t.pendingcb,r?x(i,n):i(n),e._writableState.errorEmitted=!0,e.emit("error",n)}function p(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function _(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(p(r),t)d(e,r,n,t,i);else{var o=y(r);o||r.corked||r.bufferProcessing||!r.bufferedRequest||m(e,r),n?E(g,e,r,o,i):g(e,r,o,i)}}function g(e,t,r,n){r||b(e,t),t.pendingcb--,n(),w(e,t)}function b(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function m(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var s=0;r;)i[s]=r,r=r.next,s+=1;h(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new k(t)}else{for(;r;){var a=r.chunk,u=r.encoding,f=r.callback,l=t.objectMode?1:a.length;if(h(e,t,!1,l,a,u,f),r=r.next,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequestCount=0,t.bufferedRequest=r,t.bufferProcessing=!1}function y(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function v(e,t){t.prefinished||(t.prefinished=!0,e.emit("prefinish"))}function w(e,t){var r=y(t);return r&&(0===t.pendingcb?(v(e,t),t.finished=!0,e.emit("finish")):v(e,t)),r}function j(e,t,r){t.ending=!0,w(e,t),r&&(t.finished?x(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function k(e){var t=this;this.next=null,this.entry=null,this.finish=function(r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}}r.exports=a;var x=e("process-nextick-args"),E=!s.browser&&["v0.10","v0.9."].indexOf(s.version.slice(0,5))>-1?setImmediate:x,S;a.WritableState=o;var A={deprecate:e("util-deprecate")},R=e("./internal/streams/stream"),O=e("safe-buffer").Buffer;e("util").inherits(a,R),o.prototype.getBuffer=function e(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r},function(){try{Object.defineProperty(o.prototype,"buffer",{get:A.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(e){}}();var L;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(L=Function.prototype[Symbol.hasInstance],Object.defineProperty(a,Symbol.hasInstance,{value:function(e){return!!L.call(this,e)||e&&e._writableState instanceof o}})):L=function(e){return e instanceof this},a.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},a.prototype.write=function(e,t,r){var i=this._writableState,o=!1,s=O.isBuffer(e);return"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=n),i.ended?u(this,r):(s||f(this,i,e,r))&&(i.pendingcb++,o=c(this,i,s,e,t,r)),o},a.prototype.cork=function(){var e=this._writableState;e.corked++},a.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||m(this,e))},a.prototype.setDefaultEncoding=function e(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},a.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},a.prototype._writev=null,a.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!==e&&void 0!==e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||j(this,n,r)}}],internal:{streams:{"stream.js":["stream","meteor-node-stubs/deps/stream",function(e,t,r){r.exports=e("stream")}],"BufferList.js":["safe-buffer",function(e,t,r){"use strict";function n(){this.head=null,this.tail=null,this.length=0}var i=e("safe-buffer").Buffer;r.exports=n,n.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},n.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},n.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},n.prototype.clear=function(){this.head=this.tail=null,this.length=0},n.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},n.prototype.concat=function(e){if(0===this.length)return i.alloc(0);if(1===this.length)return this.head.data;for(var t=i.allocUnsafe(e>>>0),r=this.head,n=0;r;)r.data.copy(t,n),n+=r.data.length,r=r.next;return t}}]}},"_stream_duplex.js":["process-nextick-args","./_stream_readable","./_stream_writable","util",function(e,t,r){"use strict";function n(e){return this instanceof n?(f.call(this,e),l.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),void this.once("end",i)):new n(e)}function i(){this.allowHalfOpen||this._writableState.ended||u(o,this)}function o(e){e.end()}function s(e,t){for(var r=0,n=e.length;r<n;r++)t(e[r],r)}var a=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};r.exports=n;var u=e("process-nextick-args"),f=e("./_stream_readable"),l=e("./_stream_writable");e("util").inherits(n,f);for(var c=a(l.prototype),h=0;h<c.length;h++){var d=c[h];n.prototype[d]||(n.prototype[d]=l.prototype[d])}}],"_stream_readable.js":["process-nextick-args","isarray","events","./internal/streams/stream","safe-buffer","util","./internal/streams/BufferList","./_stream_duplex","string_decoder/",function(e,t,r){"use strict";function n(e,t,r){return"function"==typeof e.prependListener?e.prependListener(t,r):void(e._events&&e._events[t]?T(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r))}function i(t,r){M=M||e("./_stream_duplex"),t=t||{},this.objectMode=!!t.objectMode,r instanceof M&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var n=t.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i,this.highWaterMark=~~this.highWaterMark,this.buffer=new C,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(U||(U=e("string_decoder/").StringDecoder),this.decoder=new U(t.encoding),this.encoding=t.encoding)}function o(t){return M=M||e("./_stream_duplex"),this instanceof o?(this._readableState=new i(t,this),this.readable=!0,t&&"function"==typeof t.read&&(this._read=t.read),void I.call(this)):new o(t)}function a(e,t,r,n,i){var o=c(t,r);if(o)e.emit("error",o);else if(null===r)t.reading=!1,h(e,t);else if(t.objectMode||r&&r.length>0)if(t.ended&&!i){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&i){var a=new Error("stream.unshift() after end event");e.emit("error",a)}else{var f;!t.decoder||i||n||(r=t.decoder.write(r),f=!t.objectMode&&0===r.length),i||(t.reading=!1),f||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&d(e))),_(e,t)}else i||(t.reading=!1);return u(t)}function u(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}function f(e){return e>=Z?e=Z:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function l(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=f(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function c(e,t){var r=null;return P.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}function h(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,d(e)}}function d(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(D("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?L(p,e):p(e))}function p(e){D("emit readable"),e.emit("readable"),w(e)}function _(e,t){t.readingMore||(t.readingMore=!0,L(g,e,t))}function g(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(D("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function b(e){return function(){var t=e._readableState;D("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&N(e,"data")&&(t.flowing=!0,w(e))}}function m(e){D("readable nexttick read 0"),e.read(0)}function y(e,t){t.resumeScheduled||(t.resumeScheduled=!0,L(v,e,t))}function v(e,t){t.reading||(D("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),w(e),t.flowing&&!t.reading&&e.read(0)}function w(e){var t=e._readableState;for(D("flow",t.flowing);t.flowing&&null!==e.read(););}function j(e,t){if(0===t.length)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=k(e,t.buffer,t.decoder),r}function k(e,t,r){var n;return e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():r?x(e,t):E(e,t),n}function x(e,t){var r=t.head,n=1,i=r.data;for(e-=i.length;r=r.next;){var o=r.data,s=e>o.length?o.length:e;if(i+=s===o.length?o:o.slice(0,e),e-=s,0===e){s===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(s));break}++n}return t.length-=n,i}function E(e,t){var r=P.allocUnsafe(e),n=t.head,i=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var o=n.data,s=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,s),e-=s,0===e){s===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(s));break}++i}return t.length-=i,r}function S(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,L(A,t,e))}function A(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function R(e,t){for(var r=0,n=e.length;r<n;r++)t(e[r],r)}function O(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}r.exports=o;var L=e("process-nextick-args"),T=e("isarray"),M;o.ReadableState=i;var z=e("events").EventEmitter,N=function(e,t){return e.listeners(t).length},I=e("./internal/streams/stream"),P=e("safe-buffer").Buffer,B=e("util"),D=void 0;D=B&&B.debuglog?B.debuglog("stream"):function(){};var C=e("./internal/streams/BufferList"),U;e("util").inherits(o,I);var F=["error","close","destroy","pause","resume"];o.prototype.push=function(e,t){var r=this._readableState;return r.objectMode||"string"!=typeof e||(t=t||r.defaultEncoding,t!==r.encoding&&(e=P.from(e,t),t="")),a(this,r,e,t,!1);
},o.prototype.unshift=function(e){var t=this._readableState;return a(this,t,e,"",!0)},o.prototype.isPaused=function(){return this._readableState.flowing===!1},o.prototype.setEncoding=function(t){return U||(U=e("string_decoder/").StringDecoder),this._readableState.decoder=new U(t),this._readableState.encoding=t,this};var Z=8388608;o.prototype.read=function(e){D("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return D("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?S(this):d(this),null;if(e=l(e,t),0===e&&t.ended)return 0===t.length&&S(this),null;var n=t.needReadable;D("need readable",n),(0===t.length||t.length-e<t.highWaterMark)&&(n=!0,D("length less than watermark",n)),t.ended||t.reading?(n=!1,D("reading or ended",n)):n&&(D("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=l(r,t)));var i;return i=e>0?j(e,t):null,null===i?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&S(this)),null!==i&&this.emit("data",i),i},o.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},o.prototype.pipe=function(e,t){function r(e){D("onunpipe"),e===h&&o()}function i(){D("onend"),e.end()}function o(){D("cleanup"),e.removeListener("close",f),e.removeListener("finish",l),e.removeListener("drain",g),e.removeListener("error",u),e.removeListener("unpipe",r),h.removeListener("end",i),h.removeListener("end",c),h.removeListener("data",a),m=!0,!d.awaitDrain||e._writableState&&!e._writableState.needDrain||g()}function a(t){D("ondata"),y=!1;var r=e.write(t);!1!==r||y||((1===d.pipesCount&&d.pipes===e||d.pipesCount>1&&O(d.pipes,e)!==-1)&&!m&&(D("false write response, pause",h._readableState.awaitDrain),h._readableState.awaitDrain++,y=!0),h.pause())}function u(t){D("onerror",t),c(),e.removeListener("error",u),0===N(e,"error")&&e.emit("error",t)}function f(){e.removeListener("finish",l),c()}function l(){D("onfinish"),e.removeListener("close",f),c()}function c(){D("unpipe"),h.unpipe(e)}var h=this,d=this._readableState;switch(d.pipesCount){case 0:d.pipes=e;break;case 1:d.pipes=[d.pipes,e];break;default:d.pipes.push(e)}d.pipesCount+=1,D("pipe count=%d opts=%j",d.pipesCount,t);var p=(!t||t.end!==!1)&&e!==s.stdout&&e!==s.stderr,_=p?i:c;d.endEmitted?L(_):h.once("end",_),e.on("unpipe",r);var g=b(h);e.on("drain",g);var m=!1,y=!1;return h.on("data",a),n(e,"error",u),e.once("close",f),e.once("finish",l),e.emit("pipe",h),d.flowing||(D("pipe resume"),h.resume()),e},o.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<n;i++)r[i].emit("unpipe",this);return this}var o=O(t.pipes,e);return o===-1?this:(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this),this)},o.prototype.on=function(e,t){var r=I.prototype.on.call(this,e,t);if("data"===e)this._readableState.flowing!==!1&&this.resume();else if("readable"===e){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&d(this,n):L(m,this))}return r},o.prototype.addListener=o.prototype.on,o.prototype.resume=function(){var e=this._readableState;return e.flowing||(D("resume"),e.flowing=!0,y(this,e)),this},o.prototype.pause=function(){return D("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(D("pause"),this._readableState.flowing=!1,this.emit("pause")),this},o.prototype.wrap=function(e){var t=this._readableState,r=!1,n=this;e.on("end",function(){if(D("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&n.push(e)}n.push(null)}),e.on("data",function(i){if(D("wrapped data"),t.decoder&&(i=t.decoder.write(i)),(!t.objectMode||null!==i&&void 0!==i)&&(t.objectMode||i&&i.length)){var o=n.push(i);o||(r=!0,e.pause())}});for(var i in e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<F.length;o++)e.on(F[o],n.emit.bind(n,F[o]));return n._read=function(t){D("wrapped _read",t),r&&(r=!1,e.resume())},n},o._fromList=j}],"_stream_transform.js":["./_stream_duplex","util",function(e,t,r){"use strict";function n(e){this.afterTransform=function(t,r){return i(e,t,r)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function i(e,t,r){var n=e._transformState;n.transforming=!1;var i=n.writecb;if(!i)return e.emit("error",new Error("no writecb in Transform class"));n.writechunk=null,n.writecb=null,null!==r&&void 0!==r&&e.push(r),i(t);var o=e._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&e._read(o.highWaterMark)}function o(e){if(!(this instanceof o))return new o(e);a.call(this,e),this._transformState=new n(this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.once("prefinish",function(){"function"==typeof this._flush?this._flush(function(e,r){s(t,e,r)}):s(t)})}function s(e,t,r){if(t)return e.emit("error",t);null!==r&&void 0!==r&&e.push(r);var n=e._writableState,i=e._transformState;if(n.length)throw new Error("Calling transform done when ws.length != 0");if(i.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}r.exports=o;var a=e("./_stream_duplex");e("util").inherits(o,a),o.prototype.push=function(e,t){return this._transformState.needTransform=!1,a.prototype.push.call(this,e,t)},o.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")},o.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},o.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0}}],"_stream_passthrough.js":["./_stream_transform","util",function(e,t,r){"use strict";function n(e){return this instanceof n?void i.call(this,e):new n(e)}r.exports=n;var i=e("./_stream_transform");e("util").inherits(n,i),n.prototype._transform=function(e,t,r){r(null,e)}}]},"duplex.js":["./readable",function(e,t,r){r.exports=e("./readable").Duplex}],"passthrough.js":["./readable",function(e,t,r){r.exports=e("./readable").PassThrough}]},"stream-browserify":{"package.json":function(e,t){t.name="stream-browserify",t.version="2.0.1",t.main="index.js"},"index.js":["events","inherits","readable-stream/readable.js","readable-stream/writable.js","readable-stream/duplex.js","readable-stream/transform.js","readable-stream/passthrough.js",function(e,t,r){function n(){i.call(this)}r.exports=n;var i=e("events").EventEmitter,o=e("inherits");o(n,i),n.Readable=e("readable-stream/readable.js"),n.Writable=e("readable-stream/writable.js"),n.Duplex=e("readable-stream/duplex.js"),n.Transform=e("readable-stream/transform.js"),n.PassThrough=e("readable-stream/passthrough.js"),n.Stream=n,n.prototype.pipe=function(e,t){function r(t){e.writable&&!1===e.write(t)&&f.pause&&f.pause()}function n(){f.readable&&f.resume&&f.resume()}function o(){l||(l=!0,e.end())}function s(){l||(l=!0,"function"==typeof e.destroy&&e.destroy())}function a(e){if(u(),0===i.listenerCount(this,"error"))throw e}function u(){f.removeListener("data",r),e.removeListener("drain",n),f.removeListener("end",o),f.removeListener("close",s),f.removeListener("error",a),e.removeListener("error",a),f.removeListener("end",u),f.removeListener("close",u),e.removeListener("close",u)}var f=this;f.on("data",r),e.on("drain",n),e._isStdio||t&&t.end===!1||(f.on("end",o),f.on("close",s));var l=!1;return f.on("error",a),e.on("error",a),f.on("end",u),f.on("close",u),e.on("close",u),e.emit("pipe",f),e}}]},inherits:{"package.json":function(e,t){t.name="inherits",t.version="2.0.1",t.main="./inherits_browser.js"},"inherits_browser.js":function(e,t,r){"function"==typeof Object.create?r.exports=function e(t,r){t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:r.exports=function e(t,r){t.super_=r;var n=function(){};n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t}}},"process-nextick-args":{"package.json":function(e,t){t.name="process-nextick-args",t.version="1.0.7",t.main="index.js"},"index.js":function(e,t,r){"use strict";function n(e,t,r,n){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i=arguments.length,o,a;switch(i){case 0:case 1:return s.nextTick(e);case 2:return s.nextTick(function r(){e.call(null,t)});case 3:return s.nextTick(function n(){e.call(null,t,r)});case 4:return s.nextTick(function i(){e.call(null,t,r,n)});default:for(o=new Array(i-1),a=0;a<o.length;)o[a++]=arguments[a];return s.nextTick(function t(){e.apply(null,o)})}}!s.version||0===s.version.indexOf("v0.")||0===s.version.indexOf("v1.")&&0!==s.version.indexOf("v1.8.")?r.exports=n:r.exports=s.nextTick}},"util-deprecate":{"package.json":function(e,t){t.name="util-deprecate",t.version="1.0.2",t.main="browser.js"},"browser.js":function(e,r,n){function i(e,t){function r(){if(!n){if(o("throwDeprecation"))throw new Error(t);o("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}if(o("noDeprecation"))return e;var n=!1;return r}function o(e){try{if(!t.localStorage)return!1}catch(e){return!1}var r=t.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}n.exports=i}},"safe-buffer":{"package.json":function(e,t){t.name="safe-buffer",t.version="5.0.1",t.main="./browser.js"},"browser.js":["buffer",function(e,t,r){r.exports=e("buffer")}]},util:{"package.json":function(e,t){t.name="util",t.version="0.10.3",t.main="./util.js"},"util.js":["./support/isBuffer","inherits",function(e,r,n){function i(e,t){var n={seen:[],stylize:a};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(t)?n.showHidden=t:t&&r._extend(n,t),j(n.showHidden)&&(n.showHidden=!1),j(n.depth)&&(n.depth=2),j(n.colors)&&(n.colors=!1),j(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=o),f(n,e,n.depth)}function o(e,t){var r=i.styles[t];return r?"["+i.colors[r][0]+"m"+e+"["+i.colors[r][1]+"m":e}function a(e,t){return e}function u(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}function f(e,t,n){if(e.customInspect&&t&&A(t.inspect)&&t.inspect!==r.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(n,e);return v(i)||(i=f(e,i,n)),i}var o=l(e,t);if(o)return o;var s=Object.keys(t),a=u(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(t)),S(t)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return c(t);if(0===s.length){if(A(t)){var g=t.name?": "+t.name:"";return e.stylize("[Function"+g+"]","special")}if(k(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(E(t))return e.stylize(Date.prototype.toString.call(t),"date");if(S(t))return c(t)}var b="",m=!1,y=["{","}"];if(_(t)&&(m=!0,y=["[","]"]),A(t)){var w=t.name?": "+t.name:"";b=" [Function"+w+"]"}if(k(t)&&(b=" "+RegExp.prototype.toString.call(t)),E(t)&&(b=" "+Date.prototype.toUTCString.call(t)),S(t)&&(b=" "+c(t)),0===s.length&&(!m||0==t.length))return y[0]+b+y[1];if(n<0)return k(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var j;return j=m?h(e,t,n,a,s):s.map(function(r){return d(e,t,n,a,r,m)}),e.seen.pop(),p(j,b,y)}function l(e,t){if(j(t))return e.stylize("undefined","undefined");if(v(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return y(t)?e.stylize(""+t,"number"):g(t)?e.stylize(""+t,"boolean"):b(t)?e.stylize("null","null"):void 0}function c(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,n,i){for(var o=[],s=0,a=t.length;s<a;++s)M(t,String(s))?o.push(d(e,t,r,n,String(s),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(d(e,t,r,n,i,!0))}),o}function d(e,t,r,n,i,o){var s,a,u;if(u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]},u.get?a=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(a=e.stylize("[Setter]","special")),M(n,i)||(s="["+i+"]"),a||(e.seen.indexOf(u.value)<0?(a=b(r)?f(e,u.value,null):f(e,u.value,r-1),a.indexOf("\n")>-1&&(a=o?a.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n"))):a=e.stylize("[Circular]","special")),j(s)){if(o&&i.match(/^\d+$/))return a;s=JSON.stringify(""+i),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function p(e,t,r){var n=0,i=e.reduce(function(e,t){return n++,t.indexOf("\n")>=0&&n++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function _(e){return Array.isArray(e)}function g(e){return"boolean"==typeof e}function b(e){return null===e}function m(e){return null==e}function y(e){return"number"==typeof e}function v(e){return"string"==typeof e}function w(e){return"symbol"==typeof e}function j(e){return void 0===e}function k(e){return x(e)&&"[object RegExp]"===O(e)}function x(e){return"object"==typeof e&&null!==e}function E(e){return x(e)&&"[object Date]"===O(e)}function S(e){return x(e)&&("[object Error]"===O(e)||e instanceof Error)}function A(e){return"function"==typeof e}function R(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function O(e){return Object.prototype.toString.call(e)}function L(e){return e<10?"0"+e.toString(10):e.toString(10)}function T(){var e=new Date,t=[L(e.getHours()),L(e.getMinutes()),L(e.getSeconds())].join(":");return[e.getDate(),P[e.getMonth()],t].join(" ")}function M(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var z=/%[sdj%]/g;r.format=function(e){if(!v(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(i(arguments[r]));return t.join(" ")}for(var r=1,n=arguments,o=n.length,s=String(e).replace(z,function(e){if("%%"===e)return"%";if(r>=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),a=n[r];r<o;a=n[++r])s+=b(a)||!x(a)?" "+a:" "+i(a);return s},r.deprecate=function(e,n){function i(){if(!o){if(s.throwDeprecation)throw new Error(n);s.traceDeprecation?console.trace(n):console.error(n),o=!0}return e.apply(this,arguments)}if(j(t.process))return function(){return r.deprecate(e,n).apply(this,arguments)};if(s.noDeprecation===!0)return e;var o=!1;return i};var N={},I;r.debuglog=function(e){if(j(I)&&(I=s.env.NODE_DEBUG||""),e=e.toUpperCase(),!N[e])if(new RegExp("\\b"+e+"\\b","i").test(I)){var t=s.pid;N[e]=function(){var n=r.format.apply(r,arguments);console.error("%s %d: %s",e,t,n)}}else N[e]=function(){};return N[e]},r.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=_,r.isBoolean=g,r.isNull=b,r.isNullOrUndefined=m,r.isNumber=y,r.isString=v,r.isSymbol=w,r.isUndefined=j,r.isRegExp=k,r.isObject=x,r.isDate=E,r.isError=S,r.isFunction=A,r.isPrimitive=R,r.isBuffer=e("./support/isBuffer");var P=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];r.log=function(){console.log("%s - %s",T(),r.format.apply(r,arguments))},r.inherits=e("inherits"),r._extend=function(e,t){if(!t||!x(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}}],support:{"isBuffer.js":function(e,t,r){r.exports=function e(t){return t instanceof o}}}},string_decoder:{"package.json":function(e,t){t.name="string_decoder",t.version="1.0.1",t.main="lib/string_decoder.js"},lib:{"string_decoder.js":["safe-buffer",function(e,t){"use strict";function r(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function n(e){var t=r(e);if("string"!=typeof t&&(b.isEncoding===m||!m(e)))throw new Error("Unknown encoding: "+e);return t||e}function i(e){this.encoding=n(e);var t;switch(this.encoding){case"utf16le":this.text=c,this.end=h,t=4;break;case"utf8":this.fillLast=u,t=4;break;case"base64":this.text=d,this.end=p,t=3;break;default:return this.write=_,void(this.end=g)}this.lastNeed=0,this.lastTotal=0,this.lastChar=b.allocUnsafe(t)}function o(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:-1}function s(e,t,r){var n=t.length-1;if(n<r)return 0;var i=o(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r?0:(i=o(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r?0:(i=o(t[n]),i>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0))}function a(e,t,r){if(128!==(192&t[0]))return e.lastNeed=0,"<22>".repeat(r);if(e.lastNeed>1&&t.length>1){if(128!==(192&t[1]))return e.lastNeed=1,"<22>".repeat(r+1);if(e.lastNeed>2&&t.length>2&&128!==(192&t[2]))return e.lastNeed=2,"<22>".repeat(r+2)}}function u(e){var t=this.lastTotal-this.lastNeed,r=a(this,e,t);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function f(e,t){var r=s(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"<22>".repeat(this.lastTotal-this.lastNeed):t}function c(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function h(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function d(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function p(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function _(e){return e.toString(this.encoding)}function g(e){return e&&e.length?this.write(e):""}var b=e("safe-buffer").Buffer,m=b.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),void 0===t)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},i.prototype.end=l,i.prototype.text=f,i.prototype.fillLast=function(e){return this.lastNeed<=e.length?(e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),void(this.lastNeed-=e.length))}}]}},pako:{lib:{zlib:{"messages.js":function(e,t,r){"use strict";r.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"}},"zstream.js":function(e,t,r){"use strict";function n(){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}r.exports=n},"deflate.js":["../utils/common","./trees","./adler32","./crc32","./messages",function(e,t){"use strict";function r(e,t){return e.msg=M[t],t}function n(e){return(e<<1)-(e>4?9:0)}function i(e){for(var t=e.length;--t>=0;)e[t]=0}function o(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(R.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function s(e,t){O._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,o(e.strm)}function a(e,t){e.pending_buf[e.pending++]=t}function u(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function f(e,t,r,n){var i=e.avail_in;return i>n&&(i=n),0===i?0:(e.avail_in-=i,R.arraySet(t,e.input,e.next_in,i,r),1===e.state.wrap?e.adler=L(e.adler,t,i,r):2===e.state.wrap&&(e.adler=T(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)}function l(e,t){var r=e.max_chain_length,n=e.strstart,i,o,s=e.prev_length,a=e.nice_match,u=e.strstart>e.w_size-fe?e.strstart-(e.w_size-fe):0,f=e.window,l=e.w_mask,c=e.prev,h=e.strstart+ue,d=f[n+s-1],p=f[n+s];e.prev_length>=e.good_match&&(r>>=2),a>e.lookahead&&(a=e.lookahead);do if(i=t,f[i+s]===p&&f[i+s-1]===d&&f[i]===f[n]&&f[++i]===f[n+1]){n+=2,i++;do;while(f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&n<h);if(o=ue-(h-n),n=h-ue,o>s){if(e.match_start=t,s=o,o>=a)break;d=f[n+s-1],p=f[n+s]}}while((t=c[t&l])>u&&0!==--r);return s<=e.lookahead?s:e.lookahead}function c(e){var t=e.w_size,r,n,i,o,s;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-fe)){R.arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,n=e.hash_size,r=n;do i=e.head[--r],e.head[r]=i>=t?i-t:0;while(--n);n=t,r=n;do i=e.prev[--r],e.prev[r]=i>=t?i-t:0;while(--n);o+=t}if(0===e.strm.avail_in)break;if(n=f(e.strm,e.window,e.strstart+e.lookahead,o),e.lookahead+=n,e.lookahead+e.insert>=ae)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+ae-1])&e.hash_mask,e.prev[s&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=s,s++,e.insert--,!(e.lookahead+e.insert<ae)););}while(e.lookahead<fe&&0!==e.strm.avail_in)}function h(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(c(e),0===e.lookahead&&t===z)return me;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,s(e,!1),0===e.strm.avail_out))return me;if(e.strstart-e.block_start>=e.w_size-fe&&(s(e,!1),0===e.strm.avail_out))return me}return e.insert=0,t===P?(s(e,!0),0===e.strm.avail_out?ve:we):e.strstart>e.block_start&&(s(e,!1),0===e.strm.avail_out)?me:me}function d(e,t){for(var r,n;;){if(e.lookahead<fe){if(c(e),e.lookahead<fe&&t===z)return me;if(0===e.lookahead)break}if(r=0,e.lookahead>=ae&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+ae-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-fe&&(e.match_length=l(e,r)),e.match_length>=ae)if(n=O._tr_tally(e,e.strstart-e.match_start,e.match_length-ae),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=ae){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+ae-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(0!==--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=O._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(s(e,!1),0===e.strm.avail_out))return me}return e.insert=e.strstart<ae-1?e.strstart:ae-1,t===P?(s(e,!0),0===e.strm.avail_out?ve:we):e.last_lit&&(s(e,!1),0===e.strm.avail_out)?me:ye}function p(e,t){for(var r,n,i;;){if(e.lookahead<fe){if(c(e),e.lookahead<fe&&t===z)return me;if(0===e.lookahead)break}if(r=0,e.lookahead>=ae&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+ae-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=ae-1,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-fe&&(e.match_length=l(e,r),e.match_length<=5&&(e.strategy===W||e.match_length===ae&&e.strstart-e.match_start>4096)&&(e.match_length=ae-1)),e.prev_length>=ae&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-ae,n=O._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-ae),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+ae-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(0!==--e.prev_length);if(e.match_available=0,e.match_length=ae-1,e.strstart++,n&&(s(e,!1),0===e.strm.avail_out))return me}else if(e.match_available){if(n=O._tr_tally(e,0,e.window[e.strstart-1]),n&&s(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return me}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=O._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<ae-1?e.strstart:ae-1,t===P?(s(e,!0),0===e.strm.avail_out?ve:we):e.last_lit&&(s(e,!1),0===e.strm.avail_out)?me:ye}function _(e,t){for(var r,n,i,o,a=e.window;;){if(e.lookahead<=ue){if(c(e),e.lookahead<=ue&&t===z)return me;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=ae&&e.strstart>0&&(i=e.strstart-1,n=a[i],n===a[++i]&&n===a[++i]&&n===a[++i])){o=e.strstart+ue;do;while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&i<o);e.match_length=ue-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=ae?(r=O._tr_tally(e,1,e.match_length-ae),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=O._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(s(e,!1),0===e.strm.avail_out))return me}return e.insert=0,t===P?(s(e,!0),0===e.strm.avail_out?ve:we):e.last_lit&&(s(e,!1),0===e.strm.avail_out)?me:ye}function g(e,t){for(var r;;){if(0===e.lookahead&&(c(e),0===e.lookahead)){if(t===z)return me;break}if(e.match_length=0,r=O._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(s(e,!1),0===e.strm.avail_out))return me}return e.insert=0,t===P?(s(e,!0),0===e.strm.avail_out?ve:we):e.last_lit&&(s(e,!1),0===e.strm.avail_out)?me:ye}function b(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}function m(e){e.window_size=2*e.w_size,i(e.head),e.max_lazy_match=ke[e.level].max_lazy,e.good_match=ke[e.level].good_length,e.nice_match=ke[e.level].nice_length,e.max_chain_length=ke[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=ae-1,e.match_available=0,e.ins_h=0}function y(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=X,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new R.Buf16(2*oe),this.dyn_dtree=new R.Buf16(2*(2*ne+1)),this.bl_tree=new R.Buf16(2*(2*ie+1)),i(this.dyn_ltree),i(this.dyn_dtree),i(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new R.Buf16(se+1),this.heap=new R.Buf16(2*re+1),i(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new R.Buf16(2*re+1),i(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function v(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=V,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?ce:ge,e.adler=2===t.wrap?0:1,t.last_flush=z,O._tr_init(t),D):r(e,U)}function w(e){var t=v(e);return t===D&&m(e.state),t}function j(e,t){return e&&e.state?2!==e.state.wrap?U:(e.state.gzhead=t,D):U}function k(e,t,n,i,o,s){if(!e)return U;var a=1;if(t===Y&&(t=6),i<0?(a=0,i=-i):i>15&&(a=2,i-=16),o<1||o>J||n!==X||i<8||i>15||t<0||t>9||s<0||s>H)return r(e,U);8===i&&(i=9);var u=new y;return e.state=u,u.strm=e,u.wrap=a,u.gzhead=null,u.w_bits=i,u.w_size=1<<u.w_bits,u.w_mask=u.w_size-1,u.hash_bits=o+7,u.hash_size=1<<u.hash_bits,u.hash_mask=u.hash_size-1,u.hash_shift=~~((u.hash_bits+ae-1)/ae),u.window=new R.Buf8(2*u.w_size),u.head=new R.Buf16(u.hash_size),u.prev=new R.Buf16(u.w_size),u.lit_bufsize=1<<o+6,u.pending_buf_size=4*u.lit_bufsize,u.pending_buf=new R.Buf8(u.pending_buf_size),u.d_buf=1*u.lit_bufsize,u.l_buf=3*u.lit_bufsize,u.level=t,u.strategy=s,u.method=n,w(e)}function x(e,t){return k(e,t,X,$,Q,K)}function E(e,t){var s,f,l,c;if(!e||!e.state||t>B||t<0)return e?r(e,U):U;if(f=e.state,!e.output||!e.input&&0!==e.avail_in||f.status===be&&t!==P)return r(e,0===e.avail_out?Z:U);if(f.strm=e,s=f.last_flush,f.last_flush=t,f.status===ce)if(2===f.wrap)e.adler=0,a(f,31),a(f,139),a(f,8),f.gzhead?(a(f,(f.gzhead.text?1:0)+(f.gzhead.hcrc?2:0)+(f.gzhead.extra?4:0)+(f.gzhead.name?8:0)+(f.gzhead.comment?16:0)),a(f,255&f.gzhead.time),a(f,f.gzhead.time>>8&255),a(f,f.gzhead.time>>16&255),a(f,f.gzhead.time>>24&255),a(f,9===f.level?2:f.strategy>=q||f.level<2?4:0),a(f,255&f.gzhead.os),f.gzhead.extra&&f.gzhead.extra.length&&(a(f,255&f.gzhead.extra.length),a(f,f.gzhead.extra.length>>8&255)),f.gzhead.hcrc&&(e.adler=T(e.adler,f.pending_buf,f.pending,0)),f.gzindex=0,f.status=he):(a(f,0),a(f,0),a(f,0),a(f,0),a(f,0),a(f,9===f.level?2:f.strategy>=q||f.level<2?4:0),a(f,je),f.status=ge);else{var h=X+(f.w_bits-8<<4)<<8,d=-1;d=f.strategy>=q||f.level<2?0:f.level<6?1:6===f.level?2:3,h|=d<<6,0!==f.strstart&&(h|=le),h+=31-h%31,f.status=ge,u(f,h),0!==f.strstart&&(u(f,e.adler>>>16),u(f,65535&e.adler)),e.adler=1}if(f.status===he)if(f.gzhead.extra){for(l=f.pending;f.gzindex<(65535&f.gzhead.extra.length)&&(f.pending!==f.pending_buf_size||(f.gzhead.hcrc&&f.pending>l&&(e.adler=T(e.adler,f.pending_buf,f.pending-l,l)),o(e),l=f.pending,f.pending!==f.pending_buf_size));)a(f,255&f.gzhead.extra[f.gzindex]),f.gzindex++;f.gzhead.hcrc&&f.pending>l&&(e.adler=T(e.adler,f.pending_buf,f.pending-l,l)),f.gzindex===f.gzhead.extra.length&&(f.gzindex=0,f.status=de)}else f.status=de;if(f.status===de)if(f.gzhead.name){l=f.pending;do{if(f.pending===f.pending_buf_size&&(f.gzhead.hcrc&&f.pending>l&&(e.adler=T(e.adler,f.pending_buf,f.pending-l,l)),o(e),l=f.pending,f.pending===f.pending_buf_size)){c=1;break}c=f.gzindex<f.gzhead.name.length?255&f.gzhead.name.charCodeAt(f.gzindex++):0,a(f,c)}while(0!==c);f.gzhead.hcrc&&f.pending>l&&(e.adler=T(e.adler,f.pending_buf,f.pending-l,l)),
0===c&&(f.gzindex=0,f.status=pe)}else f.status=pe;if(f.status===pe)if(f.gzhead.comment){l=f.pending;do{if(f.pending===f.pending_buf_size&&(f.gzhead.hcrc&&f.pending>l&&(e.adler=T(e.adler,f.pending_buf,f.pending-l,l)),o(e),l=f.pending,f.pending===f.pending_buf_size)){c=1;break}c=f.gzindex<f.gzhead.comment.length?255&f.gzhead.comment.charCodeAt(f.gzindex++):0,a(f,c)}while(0!==c);f.gzhead.hcrc&&f.pending>l&&(e.adler=T(e.adler,f.pending_buf,f.pending-l,l)),0===c&&(f.status=_e)}else f.status=_e;if(f.status===_e&&(f.gzhead.hcrc?(f.pending+2>f.pending_buf_size&&o(e),f.pending+2<=f.pending_buf_size&&(a(f,255&e.adler),a(f,e.adler>>8&255),e.adler=0,f.status=ge)):f.status=ge),0!==f.pending){if(o(e),0===e.avail_out)return f.last_flush=-1,D}else if(0===e.avail_in&&n(t)<=n(s)&&t!==P)return r(e,Z);if(f.status===be&&0!==e.avail_in)return r(e,Z);if(0!==e.avail_in||0!==f.lookahead||t!==z&&f.status!==be){var p=f.strategy===q?g(f,t):f.strategy===G?_(f,t):ke[f.level].func(f,t);if(p!==ve&&p!==we||(f.status=be),p===me||p===ve)return 0===e.avail_out&&(f.last_flush=-1),D;if(p===ye&&(t===N?O._tr_align(f):t!==B&&(O._tr_stored_block(f,0,0,!1),t===I&&(i(f.head),0===f.lookahead&&(f.strstart=0,f.block_start=0,f.insert=0))),o(e),0===e.avail_out))return f.last_flush=-1,D}return t!==P?D:f.wrap<=0?C:(2===f.wrap?(a(f,255&e.adler),a(f,e.adler>>8&255),a(f,e.adler>>16&255),a(f,e.adler>>24&255),a(f,255&e.total_in),a(f,e.total_in>>8&255),a(f,e.total_in>>16&255),a(f,e.total_in>>24&255)):(u(f,e.adler>>>16),u(f,65535&e.adler)),o(e),f.wrap>0&&(f.wrap=-f.wrap),0!==f.pending?D:C)}function S(e){var t;return e&&e.state?(t=e.state.status,t!==ce&&t!==he&&t!==de&&t!==pe&&t!==_e&&t!==ge&&t!==be?r(e,U):(e.state=null,t===ge?r(e,F):D)):U}function A(e,t){var r=t.length,n,o,s,a,u,f,l,h;if(!e||!e.state)return U;if(n=e.state,a=n.wrap,2===a||1===a&&n.status!==ce||n.lookahead)return U;for(1===a&&(e.adler=L(e.adler,t,r,0)),n.wrap=0,r>=n.w_size&&(0===a&&(i(n.head),n.strstart=0,n.block_start=0,n.insert=0),h=new R.Buf8(n.w_size),R.arraySet(h,t,r-n.w_size,n.w_size,0),t=h,r=n.w_size),u=e.avail_in,f=e.next_in,l=e.input,e.avail_in=r,e.next_in=0,e.input=t,c(n);n.lookahead>=ae;){o=n.strstart,s=n.lookahead-(ae-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[o+ae-1])&n.hash_mask,n.prev[o&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=o,o++;while(--s);n.strstart=o,n.lookahead=ae-1,c(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=ae-1,n.match_available=0,e.next_in=f,e.input=l,e.avail_in=u,n.wrap=a,D}var R=e("../utils/common"),O=e("./trees"),L=e("./adler32"),T=e("./crc32"),M=e("./messages"),z=0,N=1,I=3,P=4,B=5,D=0,C=1,U=-2,F=-3,Z=-5,Y=-1,W=1,q=2,G=3,H=4,K=0,V=2,X=8,J=9,$=15,Q=8,ee=29,te=256,re=te+1+ee,ne=30,ie=19,oe=2*re+1,se=15,ae=3,ue=258,fe=ue+ae+1,le=32,ce=42,he=69,de=73,pe=91,_e=103,ge=113,be=666,me=1,ye=2,ve=3,we=4,je=3,ke;ke=[new b(0,0,0,0,h),new b(4,4,8,4,d),new b(4,5,16,8,d),new b(4,6,32,32,d),new b(4,4,16,16,p),new b(8,16,32,32,p),new b(8,16,128,128,p),new b(8,32,128,256,p),new b(32,128,258,1024,p),new b(32,258,258,4096,p)],t.deflateInit=x,t.deflateInit2=k,t.deflateReset=w,t.deflateResetKeep=v,t.deflateSetHeader=j,t.deflate=E,t.deflateEnd=S,t.deflateSetDictionary=A,t.deflateInfo="pako deflate (from Nodeca project)"}],"trees.js":["../utils/common",function(e,t){"use strict";function r(e){for(var t=e.length;--t>=0;)e[t]=0}function n(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function i(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function o(e){return e<256?ae[e]:ae[256+(e>>>7)]}function s(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function a(e,t,r){e.bi_valid>K-r?(e.bi_buf|=t<<e.bi_valid&65535,s(e,e.bi_buf),e.bi_buf=t>>K-e.bi_valid,e.bi_valid+=r-K):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function u(e,t,r){a(e,r[2*t],r[2*t+1])}function f(e,t){var r=0;do r|=1&e,e>>>=1,r<<=1;while(--t>0);return r>>>1}function l(e){16===e.bi_valid?(s(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}function c(e,t){var r=t.dyn_tree,n=t.max_code,i=t.stat_desc.static_tree,o=t.stat_desc.has_stree,s=t.stat_desc.extra_bits,a=t.stat_desc.extra_base,u=t.stat_desc.max_length,f,l,c,h,d,p,_=0;for(h=0;h<=H;h++)e.bl_count[h]=0;for(r[2*e.heap[e.heap_max]+1]=0,f=e.heap_max+1;f<G;f++)l=e.heap[f],h=r[2*r[2*l+1]+1]+1,h>u&&(h=u,_++),r[2*l+1]=h,l>n||(e.bl_count[h]++,d=0,l>=a&&(d=s[l-a]),p=r[2*l],e.opt_len+=p*(h+d),o&&(e.static_len+=p*(i[2*l+1]+d)));if(0!==_){do{for(h=u-1;0===e.bl_count[h];)h--;e.bl_count[h]--,e.bl_count[h+1]+=2,e.bl_count[u]--,_-=2}while(_>0);for(h=u;0!==h;h--)for(l=e.bl_count[h];0!==l;)c=e.heap[--f],c>n||(r[2*c+1]!==h&&(e.opt_len+=(h-r[2*c+1])*r[2*c],r[2*c+1]=h),l--)}}function h(e,t,r){var n=new Array(H+1),i=0,o,s;for(o=1;o<=H;o++)n[o]=i=i+r[o-1]<<1;for(s=0;s<=t;s++){var a=e[2*s+1];0!==a&&(e[2*s]=f(n[a]++,a))}}function d(){var e,t,r,i,o,s=new Array(H+1);for(r=0,i=0;i<F-1;i++)for(fe[i]=r,e=0;e<1<<ee[i];e++)ue[r++]=i;for(ue[r-1]=i,o=0,i=0;i<16;i++)for(le[i]=o,e=0;e<1<<te[i];e++)ae[o++]=i;for(o>>=7;i<W;i++)for(le[i]=o<<7,e=0;e<1<<te[i]-7;e++)ae[256+o++]=i;for(t=0;t<=H;t++)s[t]=0;for(e=0;e<=143;)oe[2*e+1]=8,e++,s[8]++;for(;e<=255;)oe[2*e+1]=9,e++,s[9]++;for(;e<=279;)oe[2*e+1]=7,e++,s[7]++;for(;e<=287;)oe[2*e+1]=8,e++,s[8]++;for(h(oe,Y+1,s),e=0;e<W;e++)se[2*e+1]=5,se[2*e]=f(e,5);ce=new n(oe,ee,Z+1,Y,H),he=new n(se,te,0,W,H),de=new n(new Array(0),re,0,q,V)}function p(e){var t;for(t=0;t<Y;t++)e.dyn_ltree[2*t]=0;for(t=0;t<W;t++)e.dyn_dtree[2*t]=0;for(t=0;t<q;t++)e.bl_tree[2*t]=0;e.dyn_ltree[2*X]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function _(e){e.bi_valid>8?s(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function g(e,t,r,n){_(e),n&&(s(e,r),s(e,~r)),T.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}function b(e,t,r,n){var i=2*t,o=2*r;return e[i]<e[o]||e[i]===e[o]&&n[t]<=n[r]}function m(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&b(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!b(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function y(e,t,r){var n,i,s=0,f,l;if(0!==e.last_lit)do n=e.pending_buf[e.d_buf+2*s]<<8|e.pending_buf[e.d_buf+2*s+1],i=e.pending_buf[e.l_buf+s],s++,0===n?u(e,i,t):(f=ue[i],u(e,f+Z+1,t),l=ee[f],0!==l&&(i-=fe[f],a(e,i,l)),n--,f=o(n),u(e,f,r),l=te[f],0!==l&&(n-=le[f],a(e,n,l)));while(s<e.last_lit);u(e,X,t)}function v(e,t){var r=t.dyn_tree,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems,s,a,u=-1,f;for(e.heap_len=0,e.heap_max=G,s=0;s<o;s++)0!==r[2*s]?(e.heap[++e.heap_len]=u=s,e.depth[s]=0):r[2*s+1]=0;for(;e.heap_len<2;)f=e.heap[++e.heap_len]=u<2?++u:0,r[2*f]=1,e.depth[f]=0,e.opt_len--,i&&(e.static_len-=n[2*f+1]);for(t.max_code=u,s=e.heap_len>>1;s>=1;s--)m(e,r,s);f=o;do s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],m(e,r,1),a=e.heap[1],e.heap[--e.heap_max]=s,e.heap[--e.heap_max]=a,r[2*f]=r[2*s]+r[2*a],e.depth[f]=(e.depth[s]>=e.depth[a]?e.depth[s]:e.depth[a])+1,r[2*s+1]=r[2*a+1]=f,e.heap[1]=f++,m(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],c(e,t),h(r,u,e.bl_count)}function w(e,t,r){var n,i=-1,o,s=t[1],a=0,u=7,f=4;for(0===s&&(u=138,f=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)o=s,s=t[2*(n+1)+1],++a<u&&o===s||(a<f?e.bl_tree[2*o]+=a:0!==o?(o!==i&&e.bl_tree[2*o]++,e.bl_tree[2*J]++):a<=10?e.bl_tree[2*$]++:e.bl_tree[2*Q]++,a=0,i=o,0===s?(u=138,f=3):o===s?(u=6,f=3):(u=7,f=4))}function j(e,t,r){var n,i=-1,o,s=t[1],f=0,l=7,c=4;for(0===s&&(l=138,c=3),n=0;n<=r;n++)if(o=s,s=t[2*(n+1)+1],!(++f<l&&o===s)){if(f<c){do u(e,o,e.bl_tree);while(0!==--f)}else 0!==o?(o!==i&&(u(e,o,e.bl_tree),f--),u(e,J,e.bl_tree),a(e,f-3,2)):f<=10?(u(e,$,e.bl_tree),a(e,f-3,3)):(u(e,Q,e.bl_tree),a(e,f-11,7));f=0,i=o,0===s?(l=138,c=3):o===s?(l=6,c=3):(l=7,c=4)}}function k(e){var t;for(w(e,e.dyn_ltree,e.l_desc.max_code),w(e,e.dyn_dtree,e.d_desc.max_code),v(e,e.bl_desc),t=q-1;t>=3&&0===e.bl_tree[2*ne[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}function x(e,t,r,n){var i;for(a(e,t-257,5),a(e,r-1,5),a(e,n-4,4),i=0;i<n;i++)a(e,e.bl_tree[2*ne[i]+1],3);j(e,e.dyn_ltree,t-1),j(e,e.dyn_dtree,r-1)}function E(e){var t=4093624447,r;for(r=0;r<=31;r++,t>>>=1)if(1&t&&0!==e.dyn_ltree[2*r])return z;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return N;for(r=32;r<Z;r++)if(0!==e.dyn_ltree[2*r])return N;return z}function S(e){pe||(d(),pe=!0),e.l_desc=new i(e.dyn_ltree,ce),e.d_desc=new i(e.dyn_dtree,he),e.bl_desc=new i(e.bl_tree,de),e.bi_buf=0,e.bi_valid=0,p(e)}function A(e,t,r,n){a(e,(P<<1)+(n?1:0),3),g(e,t,r,!0)}function R(e){a(e,B<<1,3),u(e,X,oe),l(e)}function O(e,t,r,n){var i,o,s=0;e.level>0?(e.strm.data_type===I&&(e.strm.data_type=E(e)),v(e,e.l_desc),v(e,e.d_desc),s=k(e),i=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=i&&(i=o)):i=o=r+5,r+4<=i&&t!==-1?A(e,t,r,n):e.strategy===M||o===i?(a(e,(B<<1)+(n?1:0),3),y(e,oe,se)):(a(e,(D<<1)+(n?1:0),3),x(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),y(e,e.dyn_ltree,e.dyn_dtree)),p(e),n&&_(e)}function L(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(ue[r]+Z+1)]++,e.dyn_dtree[2*o(t)]++),e.last_lit===e.lit_bufsize-1}var T=e("../utils/common"),M=4,z=0,N=1,I=2,P=0,B=1,D=2,C=3,U=258,F=29,Z=256,Y=Z+1+F,W=30,q=19,G=2*Y+1,H=15,K=16,V=7,X=256,J=16,$=17,Q=18,ee=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],te=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],re=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],ne=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],ie=512,oe=new Array(2*(Y+2));r(oe);var se=new Array(2*W);r(se);var ae=new Array(ie);r(ae);var ue=new Array(U-C+1);r(ue);var fe=new Array(F);r(fe);var le=new Array(W);r(le);var ce,he,de,pe=!1;t._tr_init=S,t._tr_stored_block=A,t._tr_flush_block=O,t._tr_tally=L,t._tr_align=R}],"adler32.js":function(e,t,r){"use strict";function n(e,t,r,n){for(var i=65535&e|0,o=e>>>16&65535|0,s=0;0!==r;){s=r>2e3?2e3:r,r-=s;do i=i+t[n++]|0,o=o+i|0;while(--s);i%=65521,o%=65521}return i|o<<16|0}r.exports=n},"crc32.js":function(e,t,r){"use strict";function n(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}function i(e,t,r,n){var i=o,s=n+r;e^=-1;for(var a=n;a<s;a++)e=e>>>8^i[255&(e^t[a])];return e^-1}var o=n();r.exports=i},"inflate.js":["../utils/common","./adler32","./crc32","./inffast","./inftrees",function(e,t){"use strict";function r(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function n(){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 _.Buf16(320),this.work=new _.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function i(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=N,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new _.Buf32(he),t.distcode=t.distdyn=new _.Buf32(de),t.sane=1,t.back=-1,S):O}function o(e){var t;return e&&e.state?(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,i(e)):O}function s(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15)?O:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,o(e))):O}function a(e,t){var r,i;return e?(i=new n,e.state=i,i.window=null,r=s(e,t),r!==S&&(e.state=null),r):O}function u(e){return a(e,_e)}function f(e){if(ge){var t;for(be=new _.Buf32(512),me=new _.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(y(w,e.lens,0,288,be,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;y(j,e.lens,0,32,me,0,e.work,{bits:5}),ge=!1}e.lencode=be,e.lenbits=9,e.distcode=me,e.distbits=5}function l(e,t,r,n){var i,o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new _.Buf8(o.wsize)),n>=o.wsize?(_.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>n&&(i=n),_.arraySet(o.window,t,r-n,i,o.wnext),n-=i,n?(_.arraySet(o.window,t,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0}function c(e,t){var n,i,o,s,a,u,c,h,d,p,he,de,pe,_e,ge=0,be,me,ye,ve,we,je,ke,xe,Ee=new _.Buf8(4),Se,Ae,Re=[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 O;n=e.state,n.mode===q&&(n.mode=G),a=e.next_out,o=e.output,c=e.avail_out,s=e.next_in,i=e.input,u=e.avail_in,h=n.hold,d=n.bits,p=u,he=c,xe=S;e:for(;;)switch(n.mode){case N:if(0===n.wrap){n.mode=G;break}for(;d<16;){if(0===u)break e;u--,h+=i[s++]<<d,d+=8}if(2&n.wrap&&35615===h){n.check=0,Ee[0]=255&h,Ee[1]=h>>>8&255,n.check=b(n.check,Ee,2,0),h=0,d=0,n.mode=I;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&h)<<8)+(h>>8))%31){e.msg="incorrect header check",n.mode=fe;break}if((15&h)!==z){e.msg="unknown compression method",n.mode=fe;break}if(h>>>=4,d-=4,ke=(15&h)+8,0===n.wbits)n.wbits=ke;else if(ke>n.wbits){e.msg="invalid window size",n.mode=fe;break}n.dmax=1<<ke,e.adler=n.check=1,n.mode=512&h?Y:q,h=0,d=0;break;case I:for(;d<16;){if(0===u)break e;u--,h+=i[s++]<<d,d+=8}if(n.flags=h,(255&n.flags)!==z){e.msg="unknown compression method",n.mode=fe;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=fe;break}n.head&&(n.head.text=h>>8&1),512&n.flags&&(Ee[0]=255&h,Ee[1]=h>>>8&255,n.check=b(n.check,Ee,2,0)),h=0,d=0,n.mode=P;case P:for(;d<32;){if(0===u)break e;u--,h+=i[s++]<<d,d+=8}n.head&&(n.head.time=h),512&n.flags&&(Ee[0]=255&h,Ee[1]=h>>>8&255,Ee[2]=h>>>16&255,Ee[3]=h>>>24&255,n.check=b(n.check,Ee,4,0)),h=0,d=0,n.mode=B;case B:for(;d<16;){if(0===u)break e;u--,h+=i[s++]<<d,d+=8}n.head&&(n.head.xflags=255&h,n.head.os=h>>8),512&n.flags&&(Ee[0]=255&h,Ee[1]=h>>>8&255,n.check=b(n.check,Ee,2,0)),h=0,d=0,n.mode=D;case D:if(1024&n.flags){for(;d<16;){if(0===u)break e;u--,h+=i[s++]<<d,d+=8}n.length=h,n.head&&(n.head.extra_len=h),512&n.flags&&(Ee[0]=255&h,Ee[1]=h>>>8&255,n.check=b(n.check,Ee,2,0)),h=0,d=0}else n.head&&(n.head.extra=null);n.mode=C;case C:if(1024&n.flags&&(de=n.length,de>u&&(de=u),de&&(n.head&&(ke=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),_.arraySet(n.head.extra,i,s,de,ke)),512&n.flags&&(n.check=b(n.check,i,de,s)),u-=de,s+=de,n.length-=de),n.length))break e;n.length=0,n.mode=U;case U:if(2048&n.flags){if(0===u)break e;de=0;do ke=i[s+de++],n.head&&ke&&n.length<65536&&(n.head.name+=String.fromCharCode(ke));while(ke&&de<u);if(512&n.flags&&(n.check=b(n.check,i,de,s)),u-=de,s+=de,ke)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=F;case F:if(4096&n.flags){if(0===u)break e;de=0;do ke=i[s+de++],n.head&&ke&&n.length<65536&&(n.head.comment+=String.fromCharCode(ke));while(ke&&de<u);if(512&n.flags&&(n.check=b(n.check,i,de,s)),u-=de,s+=de,ke)break e}else n.head&&(n.head.comment=null);n.mode=Z;case Z:if(512&n.flags){for(;d<16;){if(0===u)break e;u--,h+=i[s++]<<d,d+=8}if(h!==(65535&n.check)){e.msg="header crc mismatch",n.mode=fe;break}h=0,d=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=q;break;case Y:for(;d<32;){if(0===u)break e;u--,h+=i[s++]<<d,d+=8}e.adler=n.check=r(h),h=0,d=0,n.mode=W;case W:if(0===n.havedict)return e.next_out=a,e.avail_out=c,e.next_in=s,e.avail_in=u,n.hold=h,n.bits=d,R;e.adler=n.check=1,n.mode=q;case q:if(t===x||t===E)break e;case G:if(n.last){h>>>=7&d,d-=7&d,n.mode=se;break}for(;d<3;){if(0===u)break e;u--,h+=i[s++]<<d,d+=8}switch(n.last=1&h,h>>>=1,d-=1,3&h){case 0:n.mode=H;break;case 1:if(f(n),n.mode=Q,t===E){h>>>=2,d-=2;break e}break;case 2:n.mode=X;break;case 3:e.msg="invalid block type",n.mode=fe}h>>>=2,d-=2;break;case H:for(h>>>=7&d,d-=7&d;d<32;){if(0===u)break e;u--,h+=i[s++]<<d,d+=8}if((65535&h)!==(h>>>16^65535)){e.msg="invalid stored block lengths",n.mode=fe;break}if(n.length=65535&h,h=0,d=0,n.mode=K,t===E)break e;case K:n.mode=V;case V:if(de=n.length){if(de>u&&(de=u),de>c&&(de=c),0===de)break e;_.arraySet(o,i,s,de,a),u-=de,s+=de,c-=de,a+=de,n.length-=de;break}n.mode=q;break;case X:for(;d<14;){if(0===u)break e;u--,h+=i[s++]<<d,d+=8}if(n.nlen=(31&h)+257,h>>>=5,d-=5,n.ndist=(31&h)+1,h>>>=5,d-=5,n.ncode=(15&h)+4,h>>>=4,d-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=fe;break}n.have=0,n.mode=J;case J:for(;n.have<n.ncode;){for(;d<3;){if(0===u)break e;u--,h+=i[s++]<<d,d+=8}n.lens[Re[n.have++]]=7&h,h>>>=3,d-=3}for(;n.have<19;)n.lens[Re[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,Se={bits:n.lenbits},xe=y(v,n.lens,0,19,n.lencode,0,n.work,Se),n.lenbits=Se.bits,xe){e.msg="invalid code lengths set",n.mode=fe;break}n.have=0,n.mode=$;case $:for(;n.have<n.nlen+n.ndist;){for(;ge=n.lencode[h&(1<<n.lenbits)-1],be=ge>>>24,me=ge>>>16&255,ye=65535&ge,!(be<=d);){if(0===u)break e;u--,h+=i[s++]<<d,d+=8}if(ye<16)h>>>=be,d-=be,n.lens[n.have++]=ye;else{if(16===ye){for(Ae=be+2;d<Ae;){if(0===u)break e;u--,h+=i[s++]<<d,d+=8}if(h>>>=be,d-=be,0===n.have){e.msg="invalid bit length repeat",n.mode=fe;break}ke=n.lens[n.have-1],de=3+(3&h),h>>>=2,d-=2}else if(17===ye){for(Ae=be+3;d<Ae;){if(0===u)break e;u--,h+=i[s++]<<d,d+=8}h>>>=be,d-=be,ke=0,de=3+(7&h),h>>>=3,d-=3}else{for(Ae=be+7;d<Ae;){if(0===u)break e;u--,h+=i[s++]<<d,d+=8}h>>>=be,d-=be,ke=0,de=11+(127&h),h>>>=7,d-=7}if(n.have+de>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=fe;break}for(;de--;)n.lens[n.have++]=ke}}if(n.mode===fe)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=fe;break}if(n.lenbits=9,Se={bits:n.lenbits},xe=y(w,n.lens,0,n.nlen,n.lencode,0,n.work,Se),n.lenbits=Se.bits,xe){e.msg="invalid literal/lengths set",n.mode=fe;break}if(n.distbits=6,n.distcode=n.distdyn,Se={bits:n.distbits},xe=y(j,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,Se),n.distbits=Se.bits,xe){e.msg="invalid distances set",n.mode=fe;break}if(n.mode=Q,t===E)break e;case Q:n.mode=ee;case ee:if(u>=6&&c>=258){e.next_out=a,e.avail_out=c,e.next_in=s,e.avail_in=u,n.hold=h,n.bits=d,m(e,he),a=e.next_out,o=e.output,c=e.avail_out,s=e.next_in,i=e.input,u=e.avail_in,h=n.hold,d=n.bits,n.mode===q&&(n.back=-1);break}for(n.back=0;ge=n.lencode[h&(1<<n.lenbits)-1],be=ge>>>24,me=ge>>>16&255,ye=65535&ge,!(be<=d);){if(0===u)break e;u--,h+=i[s++]<<d,d+=8}if(me&&0===(240&me)){for(ve=be,we=me,je=ye;ge=n.lencode[je+((h&(1<<ve+we)-1)>>ve)],be=ge>>>24,me=ge>>>16&255,ye=65535&ge,!(ve+be<=d);){if(0===u)break e;u--,h+=i[s++]<<d,d+=8}h>>>=ve,d-=ve,n.back+=ve}if(h>>>=be,d-=be,n.back+=be,n.length=ye,0===me){n.mode=oe;break}if(32&me){n.back=-1,n.mode=q;break}if(64&me){e.msg="invalid literal/length code",n.mode=fe;break}n.extra=15&me,n.mode=te;case te:if(n.extra){for(Ae=n.extra;d<Ae;){if(0===u)break e;u--,h+=i[s++]<<d,d+=8}n.length+=h&(1<<n.extra)-1,h>>>=n.extra,d-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=re;case re:for(;ge=n.distcode[h&(1<<n.distbits)-1],be=ge>>>24,me=ge>>>16&255,ye=65535&ge,!(be<=d);){if(0===u)break e;u--,h+=i[s++]<<d,d+=8}if(0===(240&me)){for(ve=be,we=me,je=ye;ge=n.distcode[je+((h&(1<<ve+we)-1)>>ve)],be=ge>>>24,me=ge>>>16&255,ye=65535&ge,!(ve+be<=d);){if(0===u)break e;u--,h+=i[s++]<<d,d+=8}h>>>=ve,d-=ve,n.back+=ve}if(h>>>=be,d-=be,n.back+=be,64&me){e.msg="invalid distance code",n.mode=fe;break}n.offset=ye,n.extra=15&me,n.mode=ne;case ne:if(n.extra){for(Ae=n.extra;d<Ae;){if(0===u)break e;u--,h+=i[s++]<<d,d+=8}n.offset+=h&(1<<n.extra)-1,h>>>=n.extra,d-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=fe;break}n.mode=ie;case ie:if(0===c)break e;if(de=he-c,n.offset>de){if(de=n.offset-de,de>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=fe;break}de>n.wnext?(de-=n.wnext,pe=n.wsize-de):pe=n.wnext-de,de>n.length&&(de=n.length),_e=n.window}else _e=o,pe=a-n.offset,de=n.length;de>c&&(de=c),c-=de,n.length-=de;do o[a++]=_e[pe++];while(--de);0===n.length&&(n.mode=ee);break;case oe:if(0===c)break e;o[a++]=n.length,c--,n.mode=ee;break;case se:if(n.wrap){for(;d<32;){if(0===u)break e;u--,h|=i[s++]<<d,d+=8}if(he-=c,e.total_out+=he,n.total+=he,he&&(e.adler=n.check=n.flags?b(n.check,o,he,a-he):g(n.check,o,he,a-he)),he=c,(n.flags?h:r(h))!==n.check){e.msg="incorrect data check",n.mode=fe;break}h=0,d=0}n.mode=ae;case ae:if(n.wrap&&n.flags){for(;d<32;){if(0===u)break e;u--,h+=i[s++]<<d,d+=8}if(h!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=fe;break}h=0,d=0}n.mode=ue;case ue:xe=A;break e;case fe:xe=L;break e;case le:return T;case ce:default:return O}return e.next_out=a,e.avail_out=c,e.next_in=s,e.avail_in=u,n.hold=h,n.bits=d,(n.wsize||he!==e.avail_out&&n.mode<fe&&(n.mode<se||t!==k))&&l(e,e.output,e.next_out,he-e.avail_out)?(n.mode=le,T):(p-=e.avail_in,he-=e.avail_out,e.total_in+=p,e.total_out+=he,n.total+=he,n.wrap&&he&&(e.adler=n.check=n.flags?b(n.check,o,he,e.next_out-he):g(n.check,o,he,e.next_out-he)),e.data_type=n.bits+(n.last?64:0)+(n.mode===q?128:0)+(n.mode===Q||n.mode===K?256:0),(0===p&&0===he||t===k)&&xe===S&&(xe=M),xe)}function h(e){if(!e||!e.state)return O;var t=e.state;return t.window&&(t.window=null),e.state=null,S}function d(e,t){var r;return e&&e.state?(r=e.state,0===(2&r.wrap)?O:(r.head=t,t.done=!1,S)):O}function p(e,t){var r=t.length,n,i,o;return e&&e.state?(n=e.state,0!==n.wrap&&n.mode!==W?O:n.mode===W&&(i=1,i=g(i,t,r,0),i!==n.check)?L:(o=l(e,t,r,r))?(n.mode=le,T):(n.havedict=1,S)):O}var _=e("../utils/common"),g=e("./adler32"),b=e("./crc32"),m=e("./inffast"),y=e("./inftrees"),v=0,w=1,j=2,k=4,x=5,E=6,S=0,A=1,R=2,O=-2,L=-3,T=-4,M=-5,z=8,N=1,I=2,P=3,B=4,D=5,C=6,U=7,F=8,Z=9,Y=10,W=11,q=12,G=13,H=14,K=15,V=16,X=17,J=18,$=19,Q=20,ee=21,te=22,re=23,ne=24,ie=25,oe=26,se=27,ae=28,ue=29,fe=30,le=31,ce=32,he=852,de=592,pe=15,_e=pe,ge=!0,be,me;t.inflateReset=o,t.inflateReset2=s,t.inflateResetKeep=i,t.inflateInit=u,t.inflateInit2=a,t.inflate=c,t.inflateEnd=h,t.inflateGetHeader=d,t.inflateSetDictionary=p,t.inflateInfo="pako inflate (from Nodeca project)"}],"inffast.js":function(e,t,r){"use strict";var n=30,i=12;r.exports=function e(t,r){var o,s,a,u,f,l,c,h,d,p,_,g,b,m,y,v,w,j,k,x,E,S,A,R,O;o=t.state,s=t.next_in,R=t.input,a=s+(t.avail_in-5),u=t.next_out,O=t.output,f=u-(r-t.avail_out),l=u+(t.avail_out-257),c=o.dmax,h=o.wsize,d=o.whave,p=o.wnext,_=o.window,g=o.hold,b=o.bits,m=o.lencode,y=o.distcode,v=(1<<o.lenbits)-1,w=(1<<o.distbits)-1;e:do{b<15&&(g+=R[s++]<<b,b+=8,g+=R[s++]<<b,b+=8),j=m[g&v];t:for(;;){if(k=j>>>24,g>>>=k,b-=k,k=j>>>16&255,0===k)O[u++]=65535&j;else{if(!(16&k)){if(0===(64&k)){j=m[(65535&j)+(g&(1<<k)-1)];continue t}if(32&k){o.mode=i;break e}t.msg="invalid literal/length code",o.mode=n;break e}x=65535&j,k&=15,k&&(b<k&&(g+=R[s++]<<b,b+=8),x+=g&(1<<k)-1,g>>>=k,b-=k),b<15&&(g+=R[s++]<<b,b+=8,g+=R[s++]<<b,b+=8),j=y[g&w];r:for(;;){if(k=j>>>24,g>>>=k,b-=k,k=j>>>16&255,!(16&k)){if(0===(64&k)){j=y[(65535&j)+(g&(1<<k)-1)];continue r}t.msg="invalid distance code",o.mode=n;break e}if(E=65535&j,k&=15,b<k&&(g+=R[s++]<<b,b+=8,b<k&&(g+=R[s++]<<b,b+=8)),E+=g&(1<<k)-1,E>c){t.msg="invalid distance too far back",o.mode=n;break e}if(g>>>=k,b-=k,k=u-f,E>k){if(k=E-k,k>d&&o.sane){t.msg="invalid distance too far back",o.mode=n;break e}if(S=0,A=_,0===p){if(S+=h-k,k<x){x-=k;do O[u++]=_[S++];while(--k);S=u-E,A=O}}else if(p<k){if(S+=h+p-k,k-=p,k<x){x-=k;do O[u++]=_[S++];while(--k);if(S=0,p<x){k=p,x-=k;do O[u++]=_[S++];while(--k);S=u-E,A=O}}}else if(S+=p-k,k<x){x-=k;do O[u++]=_[S++];while(--k);S=u-E,A=O}for(;x>2;)O[u++]=A[S++],O[u++]=A[S++],O[u++]=A[S++],x-=3;x&&(O[u++]=A[S++],x>1&&(O[u++]=A[S++]))}else{S=u-E;do O[u++]=O[S++],O[u++]=O[S++],O[u++]=O[S++],x-=3;while(x>2);x&&(O[u++]=O[S++],x>1&&(O[u++]=O[S++]))}break}}break}}while(s<a&&u<l);x=b>>3,s-=x,b-=x<<3,g&=(1<<b)-1,t.next_in=s,t.next_out=u,t.avail_in=s<a?5+(a-s):5-(s-a),t.avail_out=u<l?257+(l-u):257-(u-l),o.hold=g,o.bits=b}},"inftrees.js":["../utils/common",function(e,t,r){"use strict";var n=e("../utils/common"),i=15,o=852,s=592,a=0,u=1,f=2,l=[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],c=[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],h=[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],d=[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];r.exports=function e(t,r,p,_,g,b,m,y){var v=y.bits,w=0,j=0,k=0,x=0,E=0,S=0,A=0,R=0,O=0,L=0,T,M,z,N,I,P=null,B=0,D,C=new n.Buf16(i+1),U=new n.Buf16(i+1),F=null,Z=0,Y,W,q;for(w=0;w<=i;w++)C[w]=0;for(j=0;j<_;j++)C[r[p+j]]++;for(E=v,x=i;x>=1&&0===C[x];x--);if(E>x&&(E=x),0===x)return g[b++]=20971520,g[b++]=20971520,y.bits=1,0;for(k=1;k<x&&0===C[k];k++);for(E<k&&(E=k),R=1,w=1;w<=i;w++)if(R<<=1,R-=C[w],R<0)return-1;if(R>0&&(t===a||1!==x))return-1;for(U[1]=0,w=1;w<i;w++)U[w+1]=U[w]+C[w];for(j=0;j<_;j++)0!==r[p+j]&&(m[U[r[p+j]]++]=j);if(t===a?(P=F=m,D=19):t===u?(P=l,B-=257,F=c,Z-=257,D=256):(P=h,F=d,D=-1),L=0,j=0,w=k,I=b,S=E,A=0,z=-1,O=1<<E,N=O-1,t===u&&O>o||t===f&&O>s)return 1;for(var G=0;;){G++,Y=w-A,m[j]<D?(W=0,q=m[j]):m[j]>D?(W=F[Z+m[j]],q=P[B+m[j]]):(W=96,q=0),T=1<<w-A,M=1<<S,k=M;do M-=T,g[I+(L>>A)+M]=Y<<24|W<<16|q|0;while(0!==M);for(T=1<<w-1;L&T;)T>>=1;if(0!==T?(L&=T-1,L+=T):L=0,j++,0===--C[w]){if(w===x)break;w=r[p+m[j]]}if(w>E&&(L&N)!==z){for(0===A&&(A=E),I+=k,S=w-A,R=1<<S;S+A<x&&(R-=C[S+A],!(R<=0));)S++,R<<=1;if(O+=1<<S,t===u&&O>o||t===f&&O>s)return 1;z=L&N,g[z]=E<<24|S<<16|I-b|0}}return 0!==L&&(g[I+L]=w-A<<24|64<<16|0),y.bits=E,0}}],"constants.js":function(e,t,r){"use strict";r.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}}},utils:{"common.js":function(e,t){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)r.hasOwnProperty(n)&&(e[n]=r[n])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var n={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)return void e.set(t.subarray(r,r+n),i);for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){var t,r,n,i,o,s;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(s=new Uint8Array(n),i=0,t=0,r=e.length;t<r;t++)o=e[t],s.set(o,i),i+=o.length;return s}},i={arraySet:function(e,t,r,n,i){for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};t.setTyped=function(e){e?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,n)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,i))},t.setTyped(r)}}}},assert:{"package.json":function(e,t){t.name="assert",t.version="1.4.1",t.main="./assert.js"},"assert.js":["util/",function(e,r,n){"use strict";function i(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function o(e){return t.Buffer&&"function"==typeof t.Buffer.isBuffer?t.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}function s(e){return Object.prototype.toString.call(e)}function a(e){return!o(e)&&("function"==typeof t.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}function u(e){if(w.isFunction(e)){if(x)return e.name;var t=e.toString(),r=t.match(S);return r&&r[1]}}function f(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function l(e){if(x||!w.isFunction(e))return w.inspect(e);var t=u(e),r=t?": "+t:"";return"[Function"+r+"]"}function c(e){return f(l(e.actual),128)+" "+e.operator+" "+f(l(e.expected),128)}function h(e,t,r,n,i){throw new E.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:i})}function d(e,t){e||h(e,!0,t,"==",E.ok)}function p(e,t,r,n){if(e===t)return!0;if(o(e)&&o(t))return 0===i(e,t);if(w.isDate(e)&&w.isDate(t))return e.getTime()===t.getTime();if(w.isRegExp(e)&&w.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(a(e)&&a(t)&&s(e)===s(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===i(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(o(e)!==o(t))return!1;n=n||{actual:[],expected:[]};var u=n.actual.indexOf(e);return u!==-1&&u===n.expected.indexOf(t)||(n.actual.push(e),n.expected.push(t),g(e,t,r,n))}return r?e===t:e==t}function _(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function g(e,t,r,n){if(null===e||void 0===e||null===t||void 0===t)return!1;if(w.isPrimitive(e)||w.isPrimitive(t))return e===t;if(r&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var i=_(e),o=_(t);if(i&&!o||!i&&o)return!1;if(i)return e=k.call(e),t=k.call(t),p(e,t,r);var s=A(e),a=A(t),u,f;if(s.length!==a.length)return!1;for(s.sort(),a.sort(),f=s.length-1;f>=0;f--)if(s[f]!==a[f])return!1;for(f=s.length-1;f>=0;f--)if(u=s[f],!p(e[u],t[u],r,n))return!1;return!0}function b(e,t,r){p(e,t,!0)&&h(e,t,r,"notDeepStrictEqual",b)}function m(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&t.call({},e)===!0}function y(e){var t;try{e()}catch(e){t=e}return t}function v(e,t,r,n){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=y(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&h(i,r,"Missing expected exception"+n);var o="string"==typeof n,s=!e&&w.isError(i),a=!e&&i&&!r;if((s&&o&&m(i,r)||a)&&h(i,r,"Got unwanted exception"+n),e&&i&&r&&!m(i,r)||!e&&i)throw i}var w=e("util/"),j=Object.prototype.hasOwnProperty,k=Array.prototype.slice,x=function(){return"foo"===function e(){}.name}(),E=n.exports=d,S=/\s*function\s+([^\(\s]*)\s*/;E.AssertionError=function e(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=c(this),this.generatedMessage=!0);var r=t.stackStartFunction||h;if(Error.captureStackTrace)Error.captureStackTrace(this,r);else{var n=new Error;if(n.stack){var i=n.stack,o=u(r),s=i.indexOf("\n"+o);if(s>=0){var a=i.indexOf("\n",s+1);i=i.substring(a+1)}this.stack=i}}},w.inherits(E.AssertionError,Error),E.fail=h,E.ok=d,E.equal=function e(t,r,n){t!=r&&h(t,r,n,"==",E.equal)},E.notEqual=function e(t,r,n){t==r&&h(t,r,n,"!=",E.notEqual)},E.deepEqual=function e(t,r,n){p(t,r,!1)||h(t,r,n,"deepEqual",E.deepEqual)},E.deepStrictEqual=function e(t,r,n){p(t,r,!0)||h(t,r,n,"deepStrictEqual",E.deepStrictEqual)},E.notDeepEqual=function e(t,r,n){p(t,r,!1)&&h(t,r,n,"notDeepEqual",E.notDeepEqual)},E.notDeepStrictEqual=b,E.strictEqual=function e(t,r,n){t!==r&&h(t,r,n,"===",E.strictEqual)},E.notStrictEqual=function e(t,r,n){t===r&&h(t,r,n,"!==",E.notStrictEqual)},E.throws=function(e,t,r){v(!0,e,t,r)},E.doesNotThrow=function(e,t,r){v(!1,e,t,r)},E.ifError=function(e){if(e)throw e};var A=Object.keys||function(e){var t=[];for(var r in e)j.call(e,r)&&t.push(r);return t}}]}}},"babel-runtime":{regenerator:{"index.js":["regenerator-runtime",function(e,t,r){r.exports=e("regenerator-runtime");
}]},helpers:{"typeof.js":["../core-js/symbol/iterator","../core-js/symbol",function(e,t){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var n=e("../core-js/symbol/iterator"),i=r(n),o=e("../core-js/symbol"),s=r(o),a="function"==typeof s.default&&"symbol"==typeof i.default?function(e){return typeof e}:function(e){return e&&"function"==typeof s.default&&e.constructor===s.default&&e!==s.default.prototype?"symbol":typeof e};t.default="function"==typeof s.default&&"symbol"===a(i.default)?function(e){return"undefined"==typeof e?"undefined":a(e)}:function(e){return e&&"function"==typeof s.default&&e.constructor===s.default&&e!==s.default.prototype?"symbol":"undefined"==typeof e?"undefined":a(e)}}],"toConsumableArray.js":["../core-js/array/from",function(e,t){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var n=e("../core-js/array/from"),i=r(n);t.default=function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return(0,i.default)(e)}}],"classCallCheck.js":function(e,t){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},"extends.js":["../core-js/object/assign",function(e,t){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var n=e("../core-js/object/assign"),i=r(n);t.default=i.default||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}}],"possibleConstructorReturn.js":["../helpers/typeof",function(e,t){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var n=e("../helpers/typeof"),i=r(n);t.default=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==("undefined"==typeof t?"undefined":(0,i.default)(t))&&"function"!=typeof t?e:t}}],"inherits.js":["../core-js/object/set-prototype-of","../core-js/object/create","../helpers/typeof",function(e,t){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var n=e("../core-js/object/set-prototype-of"),i=r(n),o=e("../core-js/object/create"),s=r(o),a=e("../helpers/typeof"),u=r(a);t.default=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof t?"undefined":(0,u.default)(t)));e.prototype=(0,s.default)(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(i.default?(0,i.default)(e,t):e.__proto__=t)}}],"createClass.js":["../core-js/object/define-property",function(e,t){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var n=e("../core-js/object/define-property"),i=r(n);t.default=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),(0,i.default)(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}()}]},"core-js":{symbol:{"iterator.js":["core-js/library/fn/symbol/iterator",function(e,t,r){r.exports={default:e("core-js/library/fn/symbol/iterator"),__esModule:!0}}]},"symbol.js":["core-js/library/fn/symbol",function(e,t,r){r.exports={default:e("core-js/library/fn/symbol"),__esModule:!0}}],array:{"from.js":["core-js/library/fn/array/from",function(e,t,r){r.exports={default:e("core-js/library/fn/array/from"),__esModule:!0}}]},object:{"assign.js":["core-js/library/fn/object/assign",function(e,t,r){r.exports={default:e("core-js/library/fn/object/assign"),__esModule:!0}}],"set-prototype-of.js":["core-js/library/fn/object/set-prototype-of",function(e,t,r){r.exports={default:e("core-js/library/fn/object/set-prototype-of"),__esModule:!0}}],"create.js":["core-js/library/fn/object/create",function(e,t,r){r.exports={default:e("core-js/library/fn/object/create"),__esModule:!0}}],"define-property.js":["core-js/library/fn/object/define-property",function(e,t,r){r.exports={default:e("core-js/library/fn/object/define-property"),__esModule:!0}}]}}},"regenerator-runtime":{"package.json":function(e,t,r){t.name="regenerator-runtime",t.version="0.10.5",t.main="runtime-module.js"},"runtime-module.js":["./runtime",function(e,r,n){var i="object"==typeof t?t:"object"==typeof window?window:"object"==typeof self?self:this,o=i.regeneratorRuntime&&Object.getOwnPropertyNames(i).indexOf("regeneratorRuntime")>=0,s=o&&i.regeneratorRuntime;if(i.regeneratorRuntime=void 0,n.exports=e("./runtime"),o)i.regeneratorRuntime=s;else try{delete i.regeneratorRuntime}catch(e){i.regeneratorRuntime=void 0}}],"runtime.js":function(e,r,n){!function(e){"use strict";function t(e,t,r,n){var o=t&&t.prototype instanceof i?t:i,s=Object.create(o.prototype),a=new d(n||[]);return s._invoke=f(e,r,a),s}function r(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}function i(){}function o(){}function s(){}function a(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function u(t){function n(e,i,o,s){var a=r(t[e],t,i);if("throw"!==a.type){var u=a.arg,f=u.value;return f&&"object"==typeof f&&b.call(f,"__await")?Promise.resolve(f.__await).then(function(e){n("next",e,o,s)},function(e){n("throw",e,o,s)}):Promise.resolve(f).then(function(e){u.value=e,o(u)},s)}s(a.arg)}function i(e,t){function r(){return new Promise(function(r,i){n(e,t,r,i)})}return o=o?o.then(r,r):r()}"object"==typeof e.process&&e.process.domain&&(n=e.process.domain.bind(n));var o;this._invoke=i}function f(e,t,n){var i=E;return function o(s,a){if(i===A)throw new Error("Generator is already running");if(i===R){if("throw"===s)throw a;return _()}for(n.method=s,n.arg=a;;){var u=n.delegate;if(u){var f=l(u,n);if(f){if(f===O)continue;return f}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===E)throw i=R,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=A;var c=r(e,t,n);if("normal"===c.type){if(i=n.done?R:S,c.arg===O)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=R,n.method="throw",n.arg=c.arg)}}}function l(e,t){var n=e.iterator[t.method];if(n===m){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=m,l(e,t),"throw"===t.method))return O;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return O}var i=r(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,O;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=m),t.delegate=null,O):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,O)}function c(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function h(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function d(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(c,this),this.reset(!0)}function p(e){if(e){var t=e[v];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;)if(b.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=m,t.done=!0,t};return n.next=n}}return{next:_}}function _(){return{value:m,done:!0}}var g=Object.prototype,b=g.hasOwnProperty,m,y="function"==typeof Symbol?Symbol:{},v=y.iterator||"@@iterator",w=y.asyncIterator||"@@asyncIterator",j=y.toStringTag||"@@toStringTag",k="object"==typeof n,x=e.regeneratorRuntime;if(x)return void(k&&(n.exports=x));x=e.regeneratorRuntime=k?n.exports:{},x.wrap=t;var E="suspendedStart",S="suspendedYield",A="executing",R="completed",O={},L={};L[v]=function(){return this};var T=Object.getPrototypeOf,M=T&&T(T(p([])));M&&M!==g&&b.call(M,v)&&(L=M);var z=s.prototype=i.prototype=Object.create(L);o.prototype=z.constructor=s,s.constructor=o,s[j]=o.displayName="GeneratorFunction",x.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===o||"GeneratorFunction"===(t.displayName||t.name))},x.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,j in e||(e[j]="GeneratorFunction")),e.prototype=Object.create(z),e},x.awrap=function(e){return{__await:e}},a(u.prototype),u.prototype[w]=function(){return this},x.AsyncIterator=u,x.async=function(e,r,n,i){var o=new u(t(e,r,n,i));return x.isGeneratorFunction(r)?o:o.next().then(function(e){return e.done?e.value:o.next()})},a(z),z[j]="Generator",z[v]=function(){return this},z.toString=function(){return"[object Generator]"},x.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},x.values=p,d.prototype={constructor:d,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=m,this.done=!1,this.delegate=null,this.method="next",this.arg=m,this.tryEntries.forEach(h),!e)for(var t in this)"t"===t.charAt(0)&&b.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=m)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){function t(t,n){return o.type="throw",o.arg=e,r.next=t,n&&(r.method="next",r.arg=m),!!n}if(this.done)throw e;for(var r=this,n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n],o=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var s=b.call(i,"catchLoc"),a=b.call(i,"finallyLoc");if(s&&a){if(this.prev<i.catchLoc)return t(i.catchLoc,!0);if(this.prev<i.finallyLoc)return t(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return t(i.catchLoc,!0)}else{if(!a)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return t(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&b.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,O):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),O},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),h(r),O}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;h(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:p(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=m),O}}}("object"==typeof t?t:"object"==typeof window?window:"object"==typeof self?self:this)}},"core-js":{library:{fn:{symbol:{"iterator.js":["../../modules/es6.string.iterator","../../modules/web.dom.iterable","../../modules/_wks-ext",function(e,t,r){e("../../modules/es6.string.iterator"),e("../../modules/web.dom.iterable"),r.exports=e("../../modules/_wks-ext").f("iterator")}],"index.js":["../../modules/es6.symbol","../../modules/es6.object.to-string","../../modules/es7.symbol.async-iterator","../../modules/es7.symbol.observable","../../modules/_core",function(e,t,r){e("../../modules/es6.symbol"),e("../../modules/es6.object.to-string"),e("../../modules/es7.symbol.async-iterator"),e("../../modules/es7.symbol.observable"),r.exports=e("../../modules/_core").Symbol}]},array:{"from.js":["../../modules/es6.string.iterator","../../modules/es6.array.from","../../modules/_core",function(e,t,r){e("../../modules/es6.string.iterator"),e("../../modules/es6.array.from"),r.exports=e("../../modules/_core").Array.from}]},object:{"assign.js":["../../modules/es6.object.assign","../../modules/_core",function(e,t,r){e("../../modules/es6.object.assign"),r.exports=e("../../modules/_core").Object.assign}],"set-prototype-of.js":["../../modules/es6.object.set-prototype-of","../../modules/_core",function(e,t,r){e("../../modules/es6.object.set-prototype-of"),r.exports=e("../../modules/_core").Object.setPrototypeOf}],"create.js":["../../modules/es6.object.create","../../modules/_core",function(e,t,r){e("../../modules/es6.object.create");var n=e("../../modules/_core").Object;r.exports=function e(t,r){return n.create(t,r)}}],"define-property.js":["../../modules/es6.object.define-property","../../modules/_core",function(e,t,r){e("../../modules/es6.object.define-property");var n=e("../../modules/_core").Object;r.exports=function e(t,r,i){return n.defineProperty(t,r,i)}}]}},modules:{"es6.string.iterator.js":["./_string-at","./_iter-define",function(e){"use strict";var t=e("./_string-at")(!0);e("./_iter-define")(String,"String",function(e){this._t=String(e),this._i=0},function(){var e=this._t,r=this._i,n;return r>=e.length?{value:void 0,done:!0}:(n=t(e,r),this._i+=n.length,{value:n,done:!1})})}],"_string-at.js":["./_to-integer","./_defined",function(e,t,r){var n=e("./_to-integer"),i=e("./_defined");r.exports=function(e){return function(t,r){var o=String(i(t)),s=n(r),a=o.length,u,f;return s<0||s>=a?e?"":void 0:(u=o.charCodeAt(s),u<55296||u>56319||s+1===a||(f=o.charCodeAt(s+1))<56320||f>57343?e?o.charAt(s):u:e?o.slice(s,s+2):(u-55296<<10)+(f-56320)+65536)}}}],"_to-integer.js":function(e,t,r){var n=Math.ceil,i=Math.floor;r.exports=function(e){return isNaN(e=+e)?0:(e>0?i:n)(e)}},"_defined.js":function(e,t,r){r.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},"_iter-define.js":["./_library","./_export","./_redefine","./_hide","./_has","./_iterators","./_iter-create","./_set-to-string-tag","./_object-gpo","./_wks",function(e,t,r){"use strict";var n=e("./_library"),i=e("./_export"),o=e("./_redefine"),s=e("./_hide"),a=e("./_has"),u=e("./_iterators"),f=e("./_iter-create"),l=e("./_set-to-string-tag"),c=e("./_object-gpo"),h=e("./_wks")("iterator"),d=!([].keys&&"next"in[].keys()),p="@@iterator",_="keys",g="values",b=function(){return this};r.exports=function(e,t,r,m,y,v,w){f(r,t,m);var j=function(e){if(!d&&e in S)return S[e];switch(e){case _:return function t(){return new r(this,e)};case g:return function t(){return new r(this,e)}}return function t(){return new r(this,e)}},k=t+" Iterator",x=y==g,E=!1,S=e.prototype,A=S[h]||S[p]||y&&S[y],R=A||j(y),O=y?x?j("entries"):R:void 0,L="Array"==t?S.entries||A:A,T,M,z;if(L&&(z=c(L.call(new e)),z!==Object.prototype&&(l(z,k,!0),n||a(z,h)||s(z,h,b))),x&&A&&A.name!==g&&(E=!0,R=function e(){return A.call(this)}),n&&!w||!d&&!E&&S[h]||s(S,h,R),u[t]=R,u[k]=b,y)if(T={values:x?R:j(g),keys:v?R:j(_),entries:O},w)for(M in T)M in S||o(S,M,T[M]);else i(i.P+i.F*(d||E),t,T);return T}}],"_library.js":function(e,t,r){r.exports=!0},"_export.js":["./_global","./_core","./_ctx","./_hide",function(e,t,r){var n=e("./_global"),i=e("./_core"),o=e("./_ctx"),s=e("./_hide"),a="prototype",u=function(e,t,r){var f=e&u.F,l=e&u.G,c=e&u.S,h=e&u.P,d=e&u.B,p=e&u.W,_=l?i:i[t]||(i[t]={}),g=_[a],b=l?n:c?n[t]:(n[t]||{})[a],m,y,v;l&&(r=t);for(m in r)y=!f&&b&&void 0!==b[m],y&&m in _||(v=y?b[m]:r[m],_[m]=l&&"function"!=typeof b[m]?r[m]:d&&y?o(v,n):p&&b[m]==v?function(e){var t=function(t,r,n){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,r)}return new e(t,r,n)}return e.apply(this,arguments)};return t[a]=e[a],t}(v):h&&"function"==typeof v?o(Function.call,v):v,h&&((_.virtual||(_.virtual={}))[m]=v,e&u.R&&g&&!g[m]&&s(g,m,v)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,r.exports=u}],"_global.js":function(e,t,r){var n=r.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},"_core.js":function(e,t,r){var n=r.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n)},"_ctx.js":["./_a-function",function(e,t,r){var n=e("./_a-function");r.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}}}],"_a-function.js":function(e,t,r){r.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},"_hide.js":["./_object-dp","./_property-desc","./_descriptors",function(e,t,r){var n=e("./_object-dp"),i=e("./_property-desc");r.exports=e("./_descriptors")?function(e,t,r){return n.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}}],"_object-dp.js":["./_an-object","./_ie8-dom-define","./_to-primitive","./_descriptors",function(e,t){var r=e("./_an-object"),n=e("./_ie8-dom-define"),i=e("./_to-primitive"),o=Object.defineProperty;t.f=e("./_descriptors")?Object.defineProperty:function e(t,s,a){if(r(t),s=i(s,!0),r(a),n)try{return o(t,s,a)}catch(e){}if("get"in a||"set"in a)throw TypeError("Accessors not supported!");return"value"in a&&(t[s]=a.value),t}}],"_an-object.js":["./_is-object",function(e,t,r){var n=e("./_is-object");r.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}}],"_is-object.js":function(e,t,r){r.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},"_ie8-dom-define.js":["./_descriptors","./_fails","./_dom-create",function(e,t,r){r.exports=!e("./_descriptors")&&!e("./_fails")(function(){return 7!=Object.defineProperty(e("./_dom-create")("div"),"a",{get:function(){return 7}}).a})}],"_descriptors.js":["./_fails",function(e,t,r){r.exports=!e("./_fails")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})}],"_fails.js":function(e,t,r){r.exports=function(e){try{return!!e()}catch(e){return!0}}},"_dom-create.js":["./_is-object","./_global",function(e,t,r){var n=e("./_is-object"),i=e("./_global").document,o=n(i)&&n(i.createElement);r.exports=function(e){return o?i.createElement(e):{}}}],"_to-primitive.js":["./_is-object",function(e,t,r){var n=e("./_is-object");r.exports=function(e,t){if(!n(e))return e;var r,i;if(t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;if("function"==typeof(r=e.valueOf)&&!n(i=r.call(e)))return i;if(!t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;throw TypeError("Can't convert object to primitive value")}}],"_property-desc.js":function(e,t,r){r.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},"_redefine.js":["./_hide",function(e,t,r){r.exports=e("./_hide")}],"_has.js":function(e,t,r){var n={}.hasOwnProperty;r.exports=function(e,t){return n.call(e,t)}},"_iterators.js":function(e,t,r){r.exports={}},"_iter-create.js":["./_object-create","./_property-desc","./_set-to-string-tag","./_hide","./_wks",function(e,t,r){"use strict";var n=e("./_object-create"),i=e("./_property-desc"),o=e("./_set-to-string-tag"),s={};e("./_hide")(s,e("./_wks")("iterator"),function(){return this}),r.exports=function(e,t,r){e.prototype=n(s,{next:i(1,r)}),o(e,t+" Iterator")}}],"_object-create.js":["./_an-object","./_object-dps","./_enum-bug-keys","./_shared-key","./_dom-create","./_html",function(e,t,r){var n=e("./_an-object"),i=e("./_object-dps"),o=e("./_enum-bug-keys"),s=e("./_shared-key")("IE_PROTO"),a=function(){},u="prototype",f=function(){var t=e("./_dom-create")("iframe"),r=o.length,n="<",i=">",s;for(t.style.display="none",e("./_html").appendChild(t),t.src="javascript:",s=t.contentWindow.document,s.open(),s.write(n+"script"+i+"document.F=Object"+n+"/script"+i),s.close(),f=s.F;r--;)delete f[u][o[r]];return f()};r.exports=Object.create||function e(t,r){var o;return null!==t?(a[u]=n(t),o=new a,a[u]=null,o[s]=t):o=f(),void 0===r?o:i(o,r)}}],"_object-dps.js":["./_object-dp","./_an-object","./_object-keys","./_descriptors",function(e,t,r){var n=e("./_object-dp"),i=e("./_an-object"),o=e("./_object-keys");r.exports=e("./_descriptors")?Object.defineProperties:function e(t,r){i(t);for(var s=o(r),a=s.length,u=0,f;a>u;)n.f(t,f=s[u++],r[f]);return t}}],"_object-keys.js":["./_object-keys-internal","./_enum-bug-keys",function(e,t,r){var n=e("./_object-keys-internal"),i=e("./_enum-bug-keys");r.exports=Object.keys||function e(t){return n(t,i)}}],"_object-keys-internal.js":["./_has","./_to-iobject","./_array-includes","./_shared-key",function(e,t,r){var n=e("./_has"),i=e("./_to-iobject"),o=e("./_array-includes")(!1),s=e("./_shared-key")("IE_PROTO");r.exports=function(e,t){var r=i(e),a=0,u=[],f;for(f in r)f!=s&&n(r,f)&&u.push(f);for(;t.length>a;)n(r,f=t[a++])&&(~o(u,f)||u.push(f));return u}}],"_to-iobject.js":["./_iobject","./_defined",function(e,t,r){var n=e("./_iobject"),i=e("./_defined");r.exports=function(e){return n(i(e))}}],"_iobject.js":["./_cof",function(e,t,r){var n=e("./_cof");r.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==n(e)?e.split(""):Object(e)}}],"_cof.js":function(e,t,r){var n={}.toString;r.exports=function(e){return n.call(e).slice(8,-1)}},"_array-includes.js":["./_to-iobject","./_to-length","./_to-index",function(e,t,r){var n=e("./_to-iobject"),i=e("./_to-length"),o=e("./_to-index");r.exports=function(e){return function(t,r,s){var a=n(t),u=i(a.length),f=o(s,u),l;if(e&&r!=r){for(;u>f;)if(l=a[f++],l!=l)return!0}else for(;u>f;f++)if((e||f in a)&&a[f]===r)return e||f||0;return!e&&-1}}}],"_to-length.js":["./_to-integer",function(e,t,r){var n=e("./_to-integer"),i=Math.min;r.exports=function(e){return e>0?i(n(e),9007199254740991):0}}],"_to-index.js":["./_to-integer",function(e,t,r){var n=e("./_to-integer"),i=Math.max,o=Math.min;r.exports=function(e,t){return e=n(e),e<0?i(e+t,0):o(e,t)}}],"_shared-key.js":["./_shared","./_uid",function(e,t,r){var n=e("./_shared")("keys"),i=e("./_uid");r.exports=function(e){return n[e]||(n[e]=i(e))}}],"_shared.js":["./_global",function(e,t,r){var n=e("./_global"),i="__core-js_shared__",o=n[i]||(n[i]={});r.exports=function(e){return o[e]||(o[e]={})}}],"_uid.js":function(e,t,r){var n=0,i=Math.random();r.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+i).toString(36))}},"_enum-bug-keys.js":function(e,t,r){r.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},"_html.js":["./_global",function(e,t,r){r.exports=e("./_global").document&&document.documentElement}],"_set-to-string-tag.js":["./_object-dp","./_has","./_wks",function(e,t,r){var n=e("./_object-dp").f,i=e("./_has"),o=e("./_wks")("toStringTag");r.exports=function(e,t,r){e&&!i(e=r?e:e.prototype,o)&&n(e,o,{configurable:!0,value:t})}}],"_wks.js":["./_shared","./_uid","./_global",function(e,t,r){var n=e("./_shared")("wks"),i=e("./_uid"),o=e("./_global").Symbol,s="function"==typeof o,a=r.exports=function(e){return n[e]||(n[e]=s&&o[e]||(s?o:i)("Symbol."+e))};a.store=n}],"_object-gpo.js":["./_has","./_to-object","./_shared-key",function(e,t,r){var n=e("./_has"),i=e("./_to-object"),o=e("./_shared-key")("IE_PROTO"),s=Object.prototype;r.exports=Object.getPrototypeOf||function(e){return e=i(e),n(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?s:null}}],"_to-object.js":["./_defined",function(e,t,r){var n=e("./_defined");r.exports=function(e){return Object(n(e))}}],"web.dom.iterable.js":["./es6.array.iterator","./_global","./_hide","./_iterators","./_wks",function(e){e("./es6.array.iterator");for(var t=e("./_global"),r=e("./_hide"),n=e("./_iterators"),i=e("./_wks")("toStringTag"),o=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],s=0;s<5;s++){var a=o[s],u=t[a],f=u&&u.prototype;f&&!f[i]&&r(f,i,a),n[a]=n.Array}}],"es6.array.iterator.js":["./_add-to-unscopables","./_iter-step","./_iterators","./_to-iobject","./_iter-define",function(e,t,r){"use strict";var n=e("./_add-to-unscopables"),i=e("./_iter-step"),o=e("./_iterators"),s=e("./_to-iobject");r.exports=e("./_iter-define")(Array,"Array",function(e,t){this._t=s(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,r=this._i++;return!e||r>=e.length?(this._t=void 0,i(1)):"keys"==t?i(0,r):"values"==t?i(0,e[r]):i(0,[r,e[r]])},"values"),o.Arguments=o.Array,n("keys"),n("values"),n("entries")}],"_add-to-unscopables.js":function(e,t,r){r.exports=function(){}},"_iter-step.js":function(e,t,r){r.exports=function(e,t){return{value:t,done:!!e}}},"_wks-ext.js":["./_wks",function(e,t){t.f=e("./_wks")}],"es6.symbol.js":["./_global","./_has","./_descriptors","./_export","./_redefine","./_meta","./_fails","./_shared","./_set-to-string-tag","./_uid","./_wks","./_wks-ext","./_wks-define","./_keyof","./_enum-keys","./_is-array","./_an-object","./_to-iobject","./_to-primitive","./_property-desc","./_object-create","./_object-gopn-ext","./_object-gopd","./_object-dp","./_object-keys","./_object-gopn","./_object-pie","./_object-gops","./_library","./_hide",function(e){"use strict";var t=e("./_global"),r=e("./_has"),n=e("./_descriptors"),i=e("./_export"),o=e("./_redefine"),s=e("./_meta").KEY,a=e("./_fails"),u=e("./_shared"),f=e("./_set-to-string-tag"),l=e("./_uid"),c=e("./_wks"),h=e("./_wks-ext"),d=e("./_wks-define"),p=e("./_keyof"),_=e("./_enum-keys"),g=e("./_is-array"),b=e("./_an-object"),m=e("./_to-iobject"),y=e("./_to-primitive"),v=e("./_property-desc"),w=e("./_object-create"),j=e("./_object-gopn-ext"),k=e("./_object-gopd"),x=e("./_object-dp"),E=e("./_object-keys"),S=k.f,A=x.f,R=j.f,O=t.Symbol,L=t.JSON,T=L&&L.stringify,M="prototype",z=c("_hidden"),N=c("toPrimitive"),I={}.propertyIsEnumerable,P=u("symbol-registry"),B=u("symbols"),D=u("op-symbols"),C=Object[M],U="function"==typeof O,F=t.QObject,Z=!F||!F[M]||!F[M].findChild,Y=n&&a(function(){return 7!=w(A({},"a",{get:function(){return A(this,"a",{value:7}).a}})).a})?function(e,t,r){var n=S(C,t);n&&delete C[t],A(e,t,r),n&&e!==C&&A(C,t,n)}:A,W=function(e){var t=B[e]=w(O[M]);return t._k=e,t},q=U&&"symbol"==typeof O.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof O},G=function e(t,n,i){return t===C&&G(D,n,i),b(t),n=y(n,!0),b(i),r(B,n)?(i.enumerable?(r(t,z)&&t[z][n]&&(t[z][n]=!1),i=w(i,{enumerable:v(0,!1)})):(r(t,z)||A(t,z,v(1,{})),t[z][n]=!0),Y(t,n,i)):A(t,n,i)},H=function e(t,r){b(t);for(var n=_(r=m(r)),i=0,o=n.length,s;o>i;)G(t,s=n[i++],r[s]);return t},K=function e(t,r){return void 0===r?w(t):H(w(t),r)},V=function e(t){var n=I.call(this,t=y(t,!0));return!(this===C&&r(B,t)&&!r(D,t))&&(!(n||!r(this,t)||!r(B,t)||r(this,z)&&this[z][t])||n)},X=function e(t,n){if(t=m(t),n=y(n,!0),t!==C||!r(B,n)||r(D,n)){var i=S(t,n);return!i||!r(B,n)||r(t,z)&&t[z][n]||(i.enumerable=!0),i}},J=function e(t){for(var n=R(m(t)),i=[],o=0,a;n.length>o;)r(B,a=n[o++])||a==z||a==s||i.push(a);return i},$=function e(t){for(var n=t===C,i=R(n?D:m(t)),o=[],s=0,a;i.length>s;)!r(B,a=i[s++])||n&&!r(C,a)||o.push(B[a]);return o};U||(O=function e(){if(this instanceof O)throw TypeError("Symbol is not a constructor!");var t=l(arguments.length>0?arguments[0]:void 0),i=function(e){this===C&&i.call(D,e),r(this,z)&&r(this[z],t)&&(this[z][t]=!1),Y(this,t,v(1,e))};return n&&Z&&Y(C,t,{configurable:!0,set:i}),W(t)},o(O[M],"toString",function e(){return this._k}),k.f=X,x.f=G,e("./_object-gopn").f=j.f=J,e("./_object-pie").f=V,e("./_object-gops").f=$,n&&!e("./_library")&&o(C,"propertyIsEnumerable",V,!0),h.f=function(e){return W(c(e))}),i(i.G+i.W+i.F*!U,{Symbol:O});for(var Q="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ee=0;Q.length>ee;)c(Q[ee++]);for(var Q=E(c.store),ee=0;Q.length>ee;)d(Q[ee++]);i(i.S+i.F*!U,"Symbol",{for:function(e){return r(P,e+="")?P[e]:P[e]=O(e)},keyFor:function e(t){if(q(t))return p(P,t);throw TypeError(t+" is not a symbol!")},useSetter:function(){Z=!0},useSimple:function(){Z=!1}}),i(i.S+i.F*!U,"Object",{create:K,defineProperty:G,defineProperties:H,getOwnPropertyDescriptor:X,getOwnPropertyNames:J,getOwnPropertySymbols:$}),L&&i(i.S+i.F*(!U||a(function(){var e=O();return"[null]"!=T([e])||"{}"!=T({a:e})||"{}"!=T(Object(e))})),"JSON",{stringify:function e(t){if(void 0!==t&&!q(t)){for(var r=[t],n=1,i,o;arguments.length>n;)r.push(arguments[n++]);return i=r[1],"function"==typeof i&&(o=i),!o&&g(i)||(i=function(e,t){if(o&&(t=o.call(this,e,t)),!q(t))return t}),r[1]=i,T.apply(L,r)}}}),O[M][N]||e("./_hide")(O[M],N,O[M].valueOf),f(O,"Symbol"),f(Math,"Math",!0),f(t.JSON,"JSON",!0)}],"_meta.js":["./_uid","./_is-object","./_has","./_object-dp","./_fails",function(e,t,r){var n=e("./_uid")("meta"),i=e("./_is-object"),o=e("./_has"),s=e("./_object-dp").f,a=0,u=Object.isExtensible||function(){return!0},f=!e("./_fails")(function(){return u(Object.preventExtensions({}))}),l=function(e){s(e,n,{value:{i:"O"+ ++a,w:{}}})},c=function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,n)){if(!u(e))return"F";if(!t)return"E";l(e)}return e[n].i},h=function(e,t){if(!o(e,n)){if(!u(e))return!0;if(!t)return!1;l(e)}return e[n].w},d=function(e){return f&&p.NEED&&u(e)&&!o(e,n)&&l(e),e},p=r.exports={KEY:n,NEED:!1,fastKey:c,getWeak:h,onFreeze:d}}],"_wks-define.js":["./_global","./_core","./_library","./_wks-ext","./_object-dp",function(e,t,r){var n=e("./_global"),i=e("./_core"),o=e("./_library"),s=e("./_wks-ext"),a=e("./_object-dp").f;r.exports=function(e){var t=i.Symbol||(i.Symbol=o?{}:n.Symbol||{});"_"==e.charAt(0)||e in t||a(t,e,{value:s.f(e)})}}],"_keyof.js":["./_object-keys","./_to-iobject",function(e,t,r){var n=e("./_object-keys"),i=e("./_to-iobject");r.exports=function(e,t){for(var r=i(e),o=n(r),s=o.length,a=0,u;s>a;)if(r[u=o[a++]]===t)return u}}],"_enum-keys.js":["./_object-keys","./_object-gops","./_object-pie",function(e,t,r){var n=e("./_object-keys"),i=e("./_object-gops"),o=e("./_object-pie");r.exports=function(e){var t=n(e),r=i.f;if(r)for(var s=r(e),a=o.f,u=0,f;s.length>u;)a.call(e,f=s[u++])&&t.push(f);return t}}],"_object-gops.js":function(e,t){t.f=Object.getOwnPropertySymbols},"_object-pie.js":function(e,t){t.f={}.propertyIsEnumerable},"_is-array.js":["./_cof",function(e,t,r){var n=e("./_cof");r.exports=Array.isArray||function e(t){return"Array"==n(t)}}],"_object-gopn-ext.js":["./_to-iobject","./_object-gopn",function(e,t,r){var n=e("./_to-iobject"),i=e("./_object-gopn").f,o={}.toString,s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(e){try{return i(e)}catch(e){return s.slice()}};r.exports.f=function e(t){return s&&"[object Window]"==o.call(t)?a(t):i(n(t))}}],"_object-gopn.js":["./_object-keys-internal","./_enum-bug-keys",function(e,t){var r=e("./_object-keys-internal"),n=e("./_enum-bug-keys").concat("length","prototype");t.f=Object.getOwnPropertyNames||function e(t){return r(t,n)}}],"_object-gopd.js":["./_object-pie","./_property-desc","./_to-iobject","./_to-primitive","./_has","./_ie8-dom-define","./_descriptors",function(e,t){var r=e("./_object-pie"),n=e("./_property-desc"),i=e("./_to-iobject"),o=e("./_to-primitive"),s=e("./_has"),a=e("./_ie8-dom-define"),u=Object.getOwnPropertyDescriptor;t.f=e("./_descriptors")?u:function e(t,f){if(t=i(t),f=o(f,!0),a)try{return u(t,f)}catch(e){}if(s(t,f))return n(!r.f.call(t,f),t[f])}}],"es6.object.to-string.js":function(){},"es7.symbol.async-iterator.js":["./_wks-define",function(e){e("./_wks-define")("asyncIterator")}],"es7.symbol.observable.js":["./_wks-define",function(e){e("./_wks-define")("observable")}],"es6.array.from.js":["./_ctx","./_export","./_to-object","./_iter-call","./_is-array-iter","./_to-length","./_create-property","./core.get-iterator-method","./_iter-detect",function(e){"use strict";var t=e("./_ctx"),r=e("./_export"),n=e("./_to-object"),i=e("./_iter-call"),o=e("./_is-array-iter"),s=e("./_to-length"),a=e("./_create-property"),u=e("./core.get-iterator-method");r(r.S+r.F*!e("./_iter-detect")(function(e){Array.from(e)}),"Array",{from:function e(r){var f=n(r),l="function"==typeof this?this:Array,c=arguments.length,h=c>1?arguments[1]:void 0,d=void 0!==h,p=0,_=u(f),g,b,m,y;
if(d&&(h=t(h,c>2?arguments[2]:void 0,2)),void 0==_||l==Array&&o(_))for(g=s(f.length),b=new l(g);g>p;p++)a(b,p,d?h(f[p],p):f[p]);else for(y=_.call(f),b=new l;!(m=y.next()).done;p++)a(b,p,d?i(y,h,[m.value,p],!0):m.value);return b.length=p,b}})}],"_iter-call.js":["./_an-object",function(e,t,r){var n=e("./_an-object");r.exports=function(e,t,r,i){try{return i?t(n(r)[0],r[1]):t(r)}catch(t){var o=e.return;throw void 0!==o&&n(o.call(e)),t}}}],"_is-array-iter.js":["./_iterators","./_wks",function(e,t,r){var n=e("./_iterators"),i=e("./_wks")("iterator"),o=Array.prototype;r.exports=function(e){return void 0!==e&&(n.Array===e||o[i]===e)}}],"_create-property.js":["./_object-dp","./_property-desc",function(e,t,r){"use strict";var n=e("./_object-dp"),i=e("./_property-desc");r.exports=function(e,t,r){t in e?n.f(e,t,i(0,r)):e[t]=r}}],"core.get-iterator-method.js":["./_classof","./_wks","./_iterators","./_core",function(e,t,r){var n=e("./_classof"),i=e("./_wks")("iterator"),o=e("./_iterators");r.exports=e("./_core").getIteratorMethod=function(e){if(void 0!=e)return e[i]||e["@@iterator"]||o[n(e)]}}],"_classof.js":["./_cof","./_wks",function(e,t,r){var n=e("./_cof"),i=e("./_wks")("toStringTag"),o="Arguments"==n(function(){return arguments}()),s=function(e,t){try{return e[t]}catch(e){}};r.exports=function(e){var t,r,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=s(t=Object(e),i))?r:o?n(t):"Object"==(a=n(t))&&"function"==typeof t.callee?"Arguments":a}}],"_iter-detect.js":["./_wks",function(e,t,r){var n=e("./_wks")("iterator"),i=!1;try{var o=[7][n]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(e){}r.exports=function(e,t){if(!t&&!i)return!1;var r=!1;try{var o=[7],s=o[n]();s.next=function(){return{done:r=!0}},o[n]=function(){return s},e(o)}catch(e){}return r}}],"es6.object.assign.js":["./_export","./_object-assign",function(e){var t=e("./_export");t(t.S+t.F,"Object",{assign:e("./_object-assign")})}],"_object-assign.js":["./_object-keys","./_object-gops","./_object-pie","./_to-object","./_iobject","./_fails",function(e,t,r){"use strict";var n=e("./_object-keys"),i=e("./_object-gops"),o=e("./_object-pie"),s=e("./_to-object"),a=e("./_iobject"),u=Object.assign;r.exports=!u||e("./_fails")(function(){var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach(function(e){t[e]=e}),7!=u({},e)[r]||Object.keys(u({},t)).join("")!=n})?function e(t,r){for(var u=s(t),f=arguments.length,l=1,c=i.f,h=o.f;f>l;)for(var d=a(arguments[l++]),p=c?n(d).concat(c(d)):n(d),_=p.length,g=0,b;_>g;)h.call(d,b=p[g++])&&(u[b]=d[b]);return u}:u}],"es6.object.set-prototype-of.js":["./_export","./_set-proto",function(e){var t=e("./_export");t(t.S,"Object",{setPrototypeOf:e("./_set-proto").set})}],"_set-proto.js":["./_is-object","./_an-object","./_ctx","./_object-gopd",function(e,t,r){var n=e("./_is-object"),i=e("./_an-object"),o=function(e,t){if(i(e),!n(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};r.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,r,n){try{n=e("./_ctx")(Function.call,e("./_object-gopd").f(Object.prototype,"__proto__").set,2),n(t,[]),r=!(t instanceof Array)}catch(e){r=!0}return function e(t,i){return o(t,i),r?t.__proto__=i:n(t,i),t}}({},!1):void 0),check:o}}],"es6.object.create.js":["./_export","./_object-create",function(e){var t=e("./_export");t(t.S,"Object",{create:e("./_object-create")})}],"es6.object.define-property.js":["./_export","./_descriptors","./_object-dp",function(e){var t=e("./_export");t(t.S+t.F*!e("./_descriptors"),"Object",{defineProperty:e("./_object-dp").f})}]}}}}},{extensions:[".js",".json"]}),u=a("./node_modules/meteor/modules/client.js");"undefined"==typeof Package&&(Package={}),function(e,t){for(var r in t)r in e||(e[r]=t[r])}(Package.modules=u,{meteorInstall:i,Buffer:o,process:s})}();
!function(){var t=Package.meteor.Meteor,e=Package.meteor.global,r=Package.meteor.meteorEnv,n=Package.modules.meteorInstall,o=Package.modules.Buffer,i=Package.modules.process,a,c,u,f,s=n({node_modules:{meteor:{"es5-shim":{"client.js":["./import_globals.js","es5-shim/es5-shim.js","es5-shim/es5-sham.js","./console.js","./export_globals.js",function(t){t("./import_globals.js"),t("es5-shim/es5-shim.js"),t("es5-shim/es5-sham.js"),t("./console.js"),t("./export_globals.js")}],"console.js":function(){function t(t){var e=console[t];e&&"object"==typeof e&&(console[t]=function(){return Function.prototype.apply.call(e,console,arguments)})}var e=Object.prototype.hasOwnProperty;if("object"==typeof console&&"object"==typeof console.log)for(var r in console)e.call(console,r)&&t(r)},"export_globals.js":function(){e.Date!==a&&(e.Date=a),e.parseInt!==c&&(e.parseInt=c),e.parseFloat!==u&&(e.parseFloat=u);var t=String.prototype;t.replace!==f&&(t.replace=f)},"import_globals.js":function(){a=e.Date,c=e.parseInt,u=e.parseFloat,f=String.prototype.replace},node_modules:{"es5-shim":{"es5-shim.js":function(t,e,r){!function(t,n){"use strict";"function"==typeof define&&define.amd?define(n):"object"==typeof e?r.exports=n():t.returnExports=n()}(this,function(){var t=Array,e=t.prototype,r=Object,n=r.prototype,o=Function,i=o.prototype,f=String,s=f.prototype,l=Number,p=l.prototype,h=e.slice,y=e.splice,d=e.push,b=e.unshift,g=e.concat,v=e.join,w=i.call,j=i.apply,O=Math.max,m=Math.min,T=n.toString,E="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,x,S=Function.prototype.toString,_=/^\s*class /,P=function t(e){try{var r=S.call(e),n=r.replace(/\/\/.*\n/g,""),o=n.replace(/\/\*[.\s\S]*\*\//g,""),i=o.replace(/\n/gm," ").replace(/ {2}/g," ");return _.test(i)}catch(t){return!1}},M=function t(e){try{return!P(e)&&(S.call(e),!0)}catch(t){return!1}},I="[object Function]",D="[object GeneratorFunction]",x=function t(e){if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(E)return M(e);if(P(e))return!1;var r=T.call(e);return r===I||r===D},k,F=RegExp.prototype.exec,U=function t(e){try{return F.call(e),!0}catch(t){return!1}},N="[object RegExp]";k=function t(e){return"object"==typeof e&&(E?U(e):T.call(e)===N)};var C,A=String.prototype.valueOf,R=function t(e){try{return A.call(e),!0}catch(t){return!1}},$="[object String]";C=function t(e){return"string"==typeof e||"object"==typeof e&&(E?R(e):T.call(e)===$)};var z=r.defineProperty&&function(){try{var t={};r.defineProperty(t,"x",{enumerable:!1,value:t});for(var e in t)return!1;return t.x===t}catch(t){return!1}}(),J=function(t){var e;return e=z?function(t,e,n,o){!o&&e in t||r.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:!0,value:n})}:function(t,e,r,n){!n&&e in t||(t[e]=r)},function r(n,o,i){for(var a in o)t.call(o,a)&&e(n,a,o[a],i)}}(n.hasOwnProperty),G=function t(e){var r=typeof e;return null===e||"object"!==r&&"function"!==r},Z=l.isNaN||function t(e){return e!==e},Y={ToInteger:function t(e){var r=+e;return Z(r)?r=0:0!==r&&r!==1/0&&r!==-(1/0)&&(r=(r>0||-1)*Math.floor(Math.abs(r))),r},ToPrimitive:function t(e){var r,n,o;if(G(e))return e;if(n=e.valueOf,x(n)&&(r=n.call(e),G(r)))return r;if(o=e.toString,x(o)&&(r=o.call(e),G(r)))return r;throw new TypeError},ToObject:function(t){if(null==t)throw new TypeError("can't convert "+t+" to object");return r(t)},ToUint32:function t(e){return e>>>0}},W=function t(){};J(i,{bind:function t(e){var n=this;if(!x(n))throw new TypeError("Function.prototype.bind called on incompatible "+n);for(var i=h.call(arguments,1),a,c=function(){if(this instanceof a){var t=j.call(n,this,g.call(i,h.call(arguments)));return r(t)===t?t:this}return j.call(n,e,g.call(i,h.call(arguments)))},u=O(0,n.length-i.length),f=[],s=0;s<u;s++)d.call(f,"$"+s);return a=o("binder","return function ("+v.call(f,",")+"){ return binder.apply(this, arguments); }")(c),n.prototype&&(W.prototype=n.prototype,a.prototype=new W,W.prototype=null),a}});var B=w.bind(n.hasOwnProperty),X=w.bind(n.toString),H=w.bind(h),L=j.bind(h),q=w.bind(s.slice),K=w.bind(s.split),Q=w.bind(s.indexOf),V=w.bind(d),tt=w.bind(n.propertyIsEnumerable),et=w.bind(e.sort),rt=t.isArray||function t(e){return"[object Array]"===X(e)},nt=1!==[].unshift(0);J(e,{unshift:function(){return b.apply(this,arguments),this.length}},nt),J(t,{isArray:rt});var ot=r("a"),it="a"!==ot[0]||!(0 in ot),at=function t(e){var r=!0,n=!0,o=!1;if(e)try{e.call("foo",function(t,e,n){"object"!=typeof n&&(r=!1)}),e.call([1],function(){"use strict";n="string"==typeof this},"x")}catch(t){o=!0}return!!e&&!o&&r&&n};J(e,{forEach:function t(e){var r=Y.ToObject(this),n=it&&C(this)?K(this,""):r,o=-1,i=Y.ToUint32(n.length),a;if(arguments.length>1&&(a=arguments[1]),!x(e))throw new TypeError("Array.prototype.forEach callback must be a function");for(;++o<i;)o in n&&("undefined"==typeof a?e(n[o],o,r):e.call(a,n[o],o,r))}},!at(e.forEach)),J(e,{map:function e(r){var n=Y.ToObject(this),o=it&&C(this)?K(this,""):n,i=Y.ToUint32(o.length),a=t(i),c;if(arguments.length>1&&(c=arguments[1]),!x(r))throw new TypeError("Array.prototype.map callback must be a function");for(var u=0;u<i;u++)u in o&&("undefined"==typeof c?a[u]=r(o[u],u,n):a[u]=r.call(c,o[u],u,n));return a}},!at(e.map)),J(e,{filter:function t(e){var r=Y.ToObject(this),n=it&&C(this)?K(this,""):r,o=Y.ToUint32(n.length),i=[],a,c;if(arguments.length>1&&(c=arguments[1]),!x(e))throw new TypeError("Array.prototype.filter callback must be a function");for(var u=0;u<o;u++)u in n&&(a=n[u],("undefined"==typeof c?e(a,u,r):e.call(c,a,u,r))&&V(i,a));return i}},!at(e.filter)),J(e,{every:function t(e){var r=Y.ToObject(this),n=it&&C(this)?K(this,""):r,o=Y.ToUint32(n.length),i;if(arguments.length>1&&(i=arguments[1]),!x(e))throw new TypeError("Array.prototype.every callback must be a function");for(var a=0;a<o;a++)if(a in n&&!("undefined"==typeof i?e(n[a],a,r):e.call(i,n[a],a,r)))return!1;return!0}},!at(e.every)),J(e,{some:function t(e){var r=Y.ToObject(this),n=it&&C(this)?K(this,""):r,o=Y.ToUint32(n.length),i;if(arguments.length>1&&(i=arguments[1]),!x(e))throw new TypeError("Array.prototype.some callback must be a function");for(var a=0;a<o;a++)if(a in n&&("undefined"==typeof i?e(n[a],a,r):e.call(i,n[a],a,r)))return!0;return!1}},!at(e.some));var ct=!1;e.reduce&&(ct="object"==typeof e.reduce.call("es5",function(t,e,r,n){return n})),J(e,{reduce:function t(e){var r=Y.ToObject(this),n=it&&C(this)?K(this,""):r,o=Y.ToUint32(n.length);if(!x(e))throw new TypeError("Array.prototype.reduce callback must be a function");if(0===o&&1===arguments.length)throw new TypeError("reduce of empty array with no initial value");var i=0,a;if(arguments.length>=2)a=arguments[1];else for(;;){if(i in n){a=n[i++];break}if(++i>=o)throw new TypeError("reduce of empty array with no initial value")}for(;i<o;i++)i in n&&(a=e(a,n[i],i,r));return a}},!ct);var ut=!1;e.reduceRight&&(ut="object"==typeof e.reduceRight.call("es5",function(t,e,r,n){return n})),J(e,{reduceRight:function t(e){var r=Y.ToObject(this),n=it&&C(this)?K(this,""):r,o=Y.ToUint32(n.length);if(!x(e))throw new TypeError("Array.prototype.reduceRight callback must be a function");if(0===o&&1===arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var i,a=o-1;if(arguments.length>=2)i=arguments[1];else for(;;){if(a in n){i=n[a--];break}if(--a<0)throw new TypeError("reduceRight of empty array with no initial value")}if(a<0)return i;do a in n&&(i=e(i,n[a],a,r));while(a--);return i}},!ut);var ft=e.indexOf&&[0,1].indexOf(1,2)!==-1;J(e,{indexOf:function t(e){var r=it&&C(this)?K(this,""):Y.ToObject(this),n=Y.ToUint32(r.length);if(0===n)return-1;var o=0;for(arguments.length>1&&(o=Y.ToInteger(arguments[1])),o=o>=0?o:O(0,n+o);o<n;o++)if(o in r&&r[o]===e)return o;return-1}},ft);var st=e.lastIndexOf&&[0,1].lastIndexOf(0,-3)!==-1;J(e,{lastIndexOf:function t(e){var r=it&&C(this)?K(this,""):Y.ToObject(this),n=Y.ToUint32(r.length);if(0===n)return-1;var o=n-1;for(arguments.length>1&&(o=m(o,Y.ToInteger(arguments[1]))),o=o>=0?o:n-Math.abs(o);o>=0;o--)if(o in r&&e===r[o])return o;return-1}},st);var lt=function(){var t=[1,2],e=t.splice();return 2===t.length&&rt(e)&&0===e.length}();J(e,{splice:function t(e,r){return 0===arguments.length?[]:y.apply(this,arguments)}},!lt);var pt=function(){var t={};return e.splice.call(t,0,0,1),1===t.length}();J(e,{splice:function t(e,r){if(0===arguments.length)return[];var n=arguments;return this.length=O(Y.ToInteger(this.length),0),arguments.length>0&&"number"!=typeof r&&(n=H(arguments),n.length<2?V(n,this.length-e):n[1]=Y.ToInteger(r)),y.apply(this,n)}},!pt);var ht=function(){var e=new t(1e5);return e[8]="x",e.splice(1,1),7===e.indexOf("x")}(),yt=function(){var t=256,e=[];return e[t]="a",e.splice(t+1,0,"b"),"a"===e[t]}();J(e,{splice:function t(e,r){for(var n=Y.ToObject(this),o=[],i=Y.ToUint32(n.length),a=Y.ToInteger(e),c=a<0?O(i+a,0):m(a,i),u=m(O(Y.ToInteger(r),0),i-c),s=0,l;s<u;)l=f(c+s),B(n,l)&&(o[s]=n[l]),s+=1;var p=H(arguments,2),h=p.length,y;if(h<u){s=c;for(var d=i-u;s<d;)l=f(s+u),y=f(s+h),B(n,l)?n[y]=n[l]:delete n[y],s+=1;s=i;for(var b=i-u+h;s>b;)delete n[s-1],s-=1}else if(h>u)for(s=i-u;s>c;)l=f(s+u-1),y=f(s+h-1),B(n,l)?n[y]=n[l]:delete n[y],s-=1;s=c;for(var g=0;g<p.length;++g)n[s]=p[g],s+=1;return n.length=i-u+h,o}},!ht||!yt);var dt=e.join,bt;try{bt="1,2,3"!==Array.prototype.join.call("123",",")}catch(t){bt=!0}bt&&J(e,{join:function t(e){var r="undefined"==typeof e?",":e;return dt.call(C(this)?K(this,""):this,r)}},bt);var gt="1,2"!==[1,2].join(void 0);gt&&J(e,{join:function t(e){var r="undefined"==typeof e?",":e;return dt.call(this,r)}},gt);var vt=function t(e){for(var r=Y.ToObject(this),n=Y.ToUint32(r.length),o=0;o<arguments.length;)r[n+o]=arguments[o],o+=1;return r.length=n+o,n+o},wt=function(){var t={},e=Array.prototype.push.call(t,void 0);return 1!==e||1!==t.length||"undefined"!=typeof t[0]||!B(t,0)}();J(e,{push:function t(e){return rt(this)?d.apply(this,arguments):vt.apply(this,arguments)}},wt);var jt=function(){var t=[],e=t.push(void 0);return 1!==e||1!==t.length||"undefined"!=typeof t[0]||!B(t,0)}();J(e,{push:vt},jt),J(e,{slice:function(t,e){var r=C(this)?K(this,""):this;return L(r,arguments)}},it);var Ot=function(){try{return[1,2].sort(null),[1,2].sort({}),!0}catch(t){}return!1}(),mt=function(){try{return[1,2].sort(/a/),!1}catch(t){}return!0}(),Tt=function(){try{return[1,2].sort(void 0),!0}catch(t){}return!1}();J(e,{sort:function t(e){if("undefined"==typeof e)return et(this);if(!x(e))throw new TypeError("Array.prototype.sort callback must be a function");return et(this,e)}},Ot||!Tt||!mt);var Et=!tt({toString:null},"toString"),xt=tt(function(){},"prototype"),St=!B("x","0"),_t=function(t){var e=t.constructor;return e&&e.prototype===t},Pt={$window:!0,$console:!0,$parent:!0,$self:!0,$frame:!0,$frames:!0,$frameElement:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$external:!0},Mt=function(){if("undefined"==typeof window)return!1;for(var t in window)try{!Pt["$"+t]&&B(window,t)&&null!==window[t]&&"object"==typeof window[t]&&_t(window[t])}catch(t){return!0}return!1}(),It=function(t){if("undefined"==typeof window||!Mt)return _t(t);try{return _t(t)}catch(t){return!1}},Dt=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],kt=Dt.length,Ft=function t(e){return"[object Arguments]"===X(e)},Ut=function t(e){return null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&!rt(e)&&x(e.callee)},Nt=Ft(arguments)?Ft:Ut;J(r,{keys:function t(e){var r=x(e),n=Nt(e),o=null!==e&&"object"==typeof e,i=o&&C(e);if(!o&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var a=[],c=xt&&r;if(i&&St||n)for(var u=0;u<e.length;++u)V(a,f(u));if(!n)for(var s in e)c&&"prototype"===s||!B(e,s)||V(a,f(s));if(Et)for(var l=It(e),p=0;p<kt;p++){var h=Dt[p];l&&"constructor"===h||!B(e,h)||V(a,h)}return a}});var Ct=r.keys&&function(){return 2===r.keys(arguments).length}(1,2),At=r.keys&&function(){var t=r.keys(arguments);return 1!==arguments.length||1!==t.length||1!==t[0]}(1),Rt=r.keys;J(r,{keys:function t(e){return Rt(Nt(e)?H(e):e)}},!Ct||At);var $t=0!==new a((-0xc782b5b342b24)).getUTCMonth(),zt=new a((-0x55d318d56a724)),Jt=new a(14496624e5),Gt="Mon, 01 Jan -45875 11:59:59 GMT"!==zt.toUTCString(),Zt,Yt,Wt=zt.getTimezoneOffset();Wt<-720?(Zt="Tue Jan 02 -45875"!==zt.toDateString(),Yt=!/^Thu Dec 10 2015 \d\d:\d\d:\d\d GMT[-\+]\d\d\d\d(?: |$)/.test(Jt.toString())):(Zt="Mon Jan 01 -45875"!==zt.toDateString(),Yt=!/^Wed Dec 09 2015 \d\d:\d\d:\d\d GMT[-\+]\d\d\d\d(?: |$)/.test(Jt.toString()));var Bt=w.bind(a.prototype.getFullYear),Xt=w.bind(a.prototype.getMonth),Ht=w.bind(a.prototype.getDate),Lt=w.bind(a.prototype.getUTCFullYear),qt=w.bind(a.prototype.getUTCMonth),Kt=w.bind(a.prototype.getUTCDate),Qt=w.bind(a.prototype.getUTCDay),Vt=w.bind(a.prototype.getUTCHours),te=w.bind(a.prototype.getUTCMinutes),ee=w.bind(a.prototype.getUTCSeconds),re=w.bind(a.prototype.getUTCMilliseconds),ne=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],oe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ie=function t(e,r){return Ht(new a(r,e,0))};J(a.prototype,{getFullYear:function t(){if(!(this&&this instanceof a))throw new TypeError("this is not a Date object.");var e=Bt(this);return e<0&&Xt(this)>11?e+1:e},getMonth:function t(){if(!(this&&this instanceof a))throw new TypeError("this is not a Date object.");var e=Bt(this),r=Xt(this);return e<0&&r>11?0:r},getDate:function t(){if(!(this&&this instanceof a))throw new TypeError("this is not a Date object.");var e=Bt(this),r=Xt(this),n=Ht(this);if(e<0&&r>11){if(12===r)return n;var o=ie(0,e+1);return o-n+1}return n},getUTCFullYear:function t(){if(!(this&&this instanceof a))throw new TypeError("this is not a Date object.");var e=Lt(this);return e<0&&qt(this)>11?e+1:e},getUTCMonth:function t(){if(!(this&&this instanceof a))throw new TypeError("this is not a Date object.");var e=Lt(this),r=qt(this);return e<0&&r>11?0:r},getUTCDate:function t(){if(!(this&&this instanceof a))throw new TypeError("this is not a Date object.");var e=Lt(this),r=qt(this),n=Kt(this);if(e<0&&r>11){if(12===r)return n;var o=ie(0,e+1);return o-n+1}return n}},$t),J(a.prototype,{toUTCString:function t(){if(!(this&&this instanceof a))throw new TypeError("this is not a Date object.");var e=Qt(this),r=Kt(this),n=qt(this),o=Lt(this),i=Vt(this),c=te(this),u=ee(this);return ne[e]+", "+(r<10?"0"+r:r)+" "+oe[n]+" "+o+" "+(i<10?"0"+i:i)+":"+(c<10?"0"+c:c)+":"+(u<10?"0"+u:u)+" GMT"}},$t||Gt),J(a.prototype,{toDateString:function t(){if(!(this&&this instanceof a))throw new TypeError("this is not a Date object.");var e=this.getDay(),r=this.getDate(),n=this.getMonth(),o=this.getFullYear();return ne[e]+" "+oe[n]+" "+(r<10?"0"+r:r)+" "+o}},$t||Zt),($t||Yt)&&(a.prototype.toString=function t(){if(!(this&&this instanceof a))throw new TypeError("this is not a Date object.");var e=this.getDay(),r=this.getDate(),n=this.getMonth(),o=this.getFullYear(),i=this.getHours(),c=this.getMinutes(),u=this.getSeconds(),f=this.getTimezoneOffset(),s=Math.floor(Math.abs(f)/60),l=Math.floor(Math.abs(f)%60);return ne[e]+" "+oe[n]+" "+(r<10?"0"+r:r)+" "+o+" "+(i<10?"0"+i:i)+":"+(c<10?"0"+c:c)+":"+(u<10?"0"+u:u)+" GMT"+(f>0?"-":"+")+(s<10?"0"+s:s)+(l<10?"0"+l:l)},z&&r.defineProperty(a.prototype,"toString",{configurable:!0,enumerable:!1,writable:!0}));var ae=-621987552e5,ce="-000001",ue=a.prototype.toISOString&&new a(ae).toISOString().indexOf(ce)===-1,fe=a.prototype.toISOString&&"1969-12-31T23:59:59.999Z"!==new a((-1)).toISOString(),se=w.bind(a.prototype.getTime);J(a.prototype,{toISOString:function t(){if(!isFinite(this)||!isFinite(se(this)))throw new RangeError("Date.prototype.toISOString called on non-finite value.");var e=Lt(this),r=qt(this);e+=Math.floor(r/12),r=(r%12+12)%12;var n=[r+1,Kt(this),Vt(this),te(this),ee(this)];e=(e<0?"-":e>9999?"+":"")+q("00000"+Math.abs(e),0<=e&&e<=9999?-4:-6);for(var o=0;o<n.length;++o)n[o]=q("00"+n[o],-2);return e+"-"+H(n,0,2).join("-")+"T"+H(n,2).join(":")+"."+q("000"+re(this),-3)+"Z"}},ue||fe);var le=function(){try{return a.prototype.toJSON&&null===new a(NaN).toJSON()&&new a(ae).toJSON().indexOf(ce)!==-1&&a.prototype.toJSON.call({toISOString:function(){return!0}})}catch(t){return!1}}();le||(a.prototype.toJSON=function t(e){var n=r(this),o=Y.ToPrimitive(n);if("number"==typeof o&&!isFinite(o))return null;var i=n.toISOString;if(!x(i))throw new TypeError("toISOString property is not callable");return i.call(n)});var pe=1e15===a.parse("+033658-09-27T01:46:40.000Z"),he=!isNaN(a.parse("2012-04-04T24:00:00.500Z"))||!isNaN(a.parse("2012-11-31T23:59:59.000Z"))||!isNaN(a.parse("2012-12-31T23:59:60.000Z")),ye=isNaN(a.parse("2000-01-01T00:00:00.000Z"));if(ye||he||!pe){var de=Math.pow(2,31)-1,be=Z(new a(1970,0,1,0,0,0,de+1).getTime());a=function(t){var e=function r(n,o,i,a,c,u,s){var l=arguments.length,p;if(this instanceof t){var h=u,y=s;if(be&&l>=7&&s>de){var d=Math.floor(s/de)*de,b=Math.floor(d/1e3);h+=b,y-=1e3*b}p=1===l&&f(n)===n?new t(e.parse(n)):l>=7?new t(n,o,i,a,c,h,y):l>=6?new t(n,o,i,a,c,h):l>=5?new t(n,o,i,a,c):l>=4?new t(n,o,i,a):l>=3?new t(n,o,i):l>=2?new t(n,o):l>=1?new t(n instanceof t?+n:n):new t}else p=t.apply(this,arguments);return G(p)||J(p,{constructor:e},!0),p},r=new RegExp("^(\\d{4}|[+-]\\d{6})(?:-(\\d{2})(?:-(\\d{2})(?:T(\\d{2}):(\\d{2})(?::(\\d{2})(?:(\\.\\d{1,}))?)?(Z|(?:([-+])(\\d{2}):(\\d{2})))?)?)?)?$"),n=[0,31,59,90,120,151,181,212,243,273,304,334,365],o=function t(e,r){var o=r>1?1:0;return n[r]+Math.floor((e-1969+o)/4)-Math.floor((e-1901+o)/100)+Math.floor((e-1601+o)/400)+365*(e-1970)},i=function e(r){var n=0,o=r;if(be&&o>de){var i=Math.floor(o/de)*de,a=Math.floor(i/1e3);n+=a,o-=1e3*a}return l(new t(1970,0,1,0,0,n,o))};for(var a in t)B(t,a)&&(e[a]=t[a]);J(e,{now:t.now,UTC:t.UTC},!0),e.prototype=t.prototype,J(e.prototype,{constructor:e},!0);var c=function e(n){var a=r.exec(n);if(a){var c=l(a[1]),u=l(a[2]||1)-1,f=l(a[3]||1)-1,s=l(a[4]||0),p=l(a[5]||0),h=l(a[6]||0),y=Math.floor(1e3*l(a[7]||0)),d=Boolean(a[4]&&!a[8]),b="-"===a[9]?1:-1,g=l(a[10]||0),v=l(a[11]||0),w,j=p>0||h>0||y>0;return s<(j?24:25)&&p<60&&h<60&&y<1e3&&u>-1&&u<12&&g<24&&v<60&&f>-1&&f<o(c,u+1)-o(c,u)&&(w=60*(24*(o(c,u)+f)+s+g*b),w=1e3*(60*(w+p+v*b)+h)+y,d&&(w=i(w)),-864e13<=w&&w<=864e13)?w:NaN}return t.parse.apply(this,arguments)};return J(e,{parse:c}),e}(a)}a.now||(a.now=function t(){return(new a).getTime()});var ge=p.toFixed&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0)),ve={base:1e7,size:6,data:[0,0,0,0,0,0],multiply:function t(e,r){for(var n=-1,o=r;++n<ve.size;)o+=e*ve.data[n],ve.data[n]=o%ve.base,o=Math.floor(o/ve.base)},divide:function t(e){for(var r=ve.size,n=0;--r>=0;)n+=ve.data[r],ve.data[r]=Math.floor(n/e),n=n%e*ve.base},numToString:function t(){for(var e=ve.size,r="";--e>=0;)if(""!==r||0===e||0!==ve.data[e]){var n=f(ve.data[e]);""===r?r=n:r+=q("0000000",0,7-n.length)+n}return r},pow:function t(e,r,n){return 0===r?n:r%2===1?t(e,r-1,n*e):t(e*e,r/2,n)},log:function t(e){for(var r=0,n=e;n>=4096;)r+=12,n/=4096;for(;n>=2;)r+=1,n/=2;return r}},we=function t(e){var r,n,o,i,a,c,u,s;if(r=l(e),r=Z(r)?0:Math.floor(r),r<0||r>20)throw new RangeError("Number.toFixed called with invalid number of decimals");if(n=l(this),Z(n))return"NaN";if(n<=-1e21||n>=1e21)return f(n);if(o="",n<0&&(o="-",n=-n),i="0",n>1e-21)if(a=ve.log(n*ve.pow(2,69,1))-69,c=a<0?n*ve.pow(2,-a,1):n/ve.pow(2,a,1),c*=4503599627370496,a=52-a,a>0){for(ve.multiply(0,c),u=r;u>=7;)ve.multiply(1e7,0),u-=7;for(ve.multiply(ve.pow(10,u,1),0),u=a-1;u>=23;)ve.divide(1<<23),u-=23;ve.divide(1<<u),ve.multiply(1,1),ve.divide(2),i=ve.numToString()}else ve.multiply(0,c),ve.multiply(1<<-a,0),i=ve.numToString()+q("0.00000000000000000000",2,2+r);return r>0?(s=i.length,i=s<=r?o+q("0.0000000000000000000",0,r-s+2)+i:o+q(i,0,s-r)+"."+q(i,s-r)):i=o+i,i};J(p,{toFixed:we},ge);var je=function(){try{return"1"===1..toPrecision(void 0)}catch(t){return!0}}(),Oe=p.toPrecision;J(p,{toPrecision:function t(e){return"undefined"==typeof e?Oe.call(this):Oe.call(this,e)}},je),2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||"t"==="tesst".split(/(s)*/)[1]||4!=="test".split(/(?:)/,-1).length||"".split(/.?/).length||".".split(/()()/).length>1?!function(){var t="undefined"==typeof/()??/.exec("")[1],e=Math.pow(2,32)-1;s.split=function(r,n){var o=String(this);if("undefined"==typeof r&&0===n)return[];if(!k(r))return K(this,r,n);var i=[],a=(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.unicode?"u":"")+(r.sticky?"y":""),c=0,u,f,s,l,p=new RegExp(r.source,a+"g");t||(u=new RegExp("^"+p.source+"$(?!\\s)",a));var h="undefined"==typeof n?e:Y.ToUint32(n);for(f=p.exec(o);f&&(s=f.index+f[0].length,!(s>c&&(V(i,q(o,c,f.index)),!t&&f.length>1&&f[0].replace(u,function(){for(var t=1;t<arguments.length-2;t++)"undefined"==typeof arguments[t]&&(f[t]=void 0)}),f.length>1&&f.index<o.length&&d.apply(i,H(f,1)),l=f[0].length,c=s,i.length>=h)));)p.lastIndex===f.index&&p.lastIndex++,f=p.exec(o);return c===o.length?!l&&p.test("")||V(i,""):V(i,q(o,c)),i.length>h?H(i,0,h):i}}():"0".split(void 0,0).length&&(s.split=function t(e,r){return"undefined"==typeof e&&0===r?[]:K(this,e,r)});var me=s.replace,Te=function(){var t=[];return"x".replace(/x(.)?/g,function(e,r){V(t,r)}),1===t.length&&"undefined"==typeof t[0]}();Te||(s.replace=function t(e,r){var n=x(r),o=k(e)&&/\)[*?]/.test(e.source);if(n&&o){var i=function(t){var n=arguments.length,o=e.lastIndex;e.lastIndex=0;var i=e.exec(t)||[];return e.lastIndex=o,V(i,arguments[n-2],arguments[n-1]),r.apply(this,i)};return me.call(this,e,i)}return me.call(this,e,r)});var Ee=s.substr,xe="".substr&&"b"!=="0b".substr(-1);J(s,{substr:function t(e,r){var n=e;return e<0&&(n=O(this.length+e,0)),Ee.call(this,n,r)}},xe);var Se="\t\n\v\f\r    \u2028\u2029\ufeff",_e="",Pe="["+Se+"]",Me=new RegExp("^"+Pe+Pe+"*"),Ie=new RegExp(Pe+Pe+"*$"),De=s.trim&&(Se.trim()||!_e.trim());J(s,{trim:function t(){if("undefined"==typeof this||null===this)throw new TypeError("can't convert "+this+" to object");return f(this).replace(Me,"").replace(Ie,"")}},De);var ke=w.bind(String.prototype.trim),Fe=s.lastIndexOf&&"abcあい".lastIndexOf("あい",2)!==-1;J(s,{lastIndexOf:function t(e){if("undefined"==typeof this||null===this)throw new TypeError("can't convert "+this+" to object");for(var r=f(this),n=f(e),o=arguments.length>1?l(arguments[1]):NaN,i=Z(o)?1/0:Y.ToInteger(o),a=m(O(i,0),r.length),c=n.length,u=a+c;u>0;){u=O(0,u-c);var s=Q(q(r,u,a+c),n);if(s!==-1)return u+s}return-1}},Fe);var Ue=s.lastIndexOf;if(J(s,{lastIndexOf:function t(e){return Ue.apply(this,arguments)}},1!==s.lastIndexOf.length),8===c(Se+"08")&&22===c(Se+"0x16")||(c=function(t){var e=/^[\-+]?0[xX]/;return function r(n,o){var i=ke(String(n)),a=l(o)||(e.test(i)?16:10);return t(i,a)}}(c)),1/u("-0")!==-(1/0)&&(u=function(t){return function e(r){var n=ke(String(r)),o=t(n);return 0===o&&"-"===q(n,0,1)?-0:o}}(u)),"RangeError: test"!==String(new RangeError("test"))){var Ne=function t(){if("undefined"==typeof this||null===this)throw new TypeError("can't convert "+this+" to object");var e=this.name;"undefined"==typeof e?e="Error":"string"!=typeof e&&(e=f(e));var r=this.message;return"undefined"==typeof r?r="":"string"!=typeof r&&(r=f(r)),e?r?e+": "+r:e:r};Error.prototype.toString=Ne}if(z){var Ce=function(t,e){if(tt(t,e)){var r=Object.getOwnPropertyDescriptor(t,e);r.configurable&&(r.enumerable=!1,Object.defineProperty(t,e,r))}};Ce(Error.prototype,"message"),""!==Error.prototype.message&&(Error.prototype.message=""),Ce(Error.prototype,"name")}if("/a/gim"!==String(/a/gim)){var Ae=function t(){var e="/"+this.source+"/";return this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),e};RegExp.prototype.toString=Ae}})},"es5-sham.js":function(t,e,r){!function(t,n){"use strict";"function"==typeof define&&define.amd?define(n):"object"==typeof e?r.exports=n():t.returnExports=n()}(this,function(){var t=Function.call,e=Object.prototype,r=t.bind(e.hasOwnProperty),n=t.bind(e.propertyIsEnumerable),o=t.bind(e.toString),i,a,c,u,f=r(e,"__defineGetter__");f&&(i=t.bind(e.__defineGetter__),a=t.bind(e.__defineSetter__),c=t.bind(e.__lookupGetter__),u=t.bind(e.__lookupSetter__));var s=function t(e){return null==e||"object"!=typeof e&&"function"!=typeof e};Object.getPrototypeOf||(Object.getPrototypeOf=function t(r){var n=r.__proto__;return n||null===n?n:"[object Function]"===o(r.constructor)?r.constructor.prototype:r instanceof Object?e:null});var l=function t(e){try{return e.sentinel=0,0===Object.getOwnPropertyDescriptor(e,"sentinel").value}catch(t){return!1}};if(Object.defineProperty){var p=l({}),h="undefined"==typeof document||l(document.createElement("div"));if(!h||!p)var y=Object.getOwnPropertyDescriptor}if(!Object.getOwnPropertyDescriptor||y){var d="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function t(o,i){if(s(o))throw new TypeError(d+o);if(y)try{return y.call(Object,o,i)}catch(t){}var a;if(!r(o,i))return a;if(a={enumerable:n(o,i),configurable:!0},f){var l=o.__proto__,p=o!==e;p&&(o.__proto__=e);var h=c(o,i),b=u(o,i);if(p&&(o.__proto__=l),h||b)return h&&(a.get=h),b&&(a.set=b),a}return a.value=o[i],a.writable=!0,a}}if(Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function t(e){return Object.keys(e)}),!Object.create){var b,g=!({__proto__:null}instanceof Object),v=function t(){if(!document.domain)return!1;try{return!!new ActiveXObject("htmlfile")}catch(t){return!1}},w=function t(){var e,r;r=new ActiveXObject("htmlfile");var n="script";return r.write("<"+n+"></"+n+">"),r.close(),e=r.parentWindow.Object.prototype,r=null,e},j=function t(){var e=document.createElement("iframe"),r=document.body||document.documentElement,n;return e.style.display="none",r.appendChild(e),e.src="javascript:",n=e.contentWindow.Object.prototype,r.removeChild(e),e=null,n};b=g||"undefined"==typeof document?function(){return{__proto__:null}}:function(){var t=v()?w():j();delete t.constructor,delete t.hasOwnProperty,delete t.propertyIsEnumerable,delete t.isPrototypeOf,delete t.toLocaleString,delete t.toString,delete t.valueOf;var e=function t(){};return e.prototype=t,b=function(){return new e},new e},Object.create=function t(e,r){var n,o=function t(){};if(null===e)n=b();else{if(null!==e&&s(e))throw new TypeError("Object prototype may only be an Object or null");o.prototype=e,n=new o,n.__proto__=e}return void 0!==r&&Object.defineProperties(n,r),n}}var O=function t(e){try{return Object.defineProperty(e,"sentinel",{}),"sentinel"in e}catch(t){return!1}};if(Object.defineProperty){var m=O({}),T="undefined"==typeof document||O(document.createElement("div"));if(!m||!T)var E=Object.defineProperty,x=Object.defineProperties}if(!Object.defineProperty||E){var S="Property description must be an object: ",_="Object.defineProperty called on non-object: ",P="getters & setters can not be defined on this javascript engine";Object.defineProperty=function t(r,n,o){if(s(r))throw new TypeError(_+r);if(s(o))throw new TypeError(S+o);if(E)try{return E.call(Object,r,n,o)}catch(t){}if("value"in o)if(f&&(c(r,n)||u(r,n))){var l=r.__proto__;r.__proto__=e,delete r[n],r[n]=o.value,r.__proto__=l}else r[n]=o.value;else{var p="get"in o,h="set"in o;if(!f&&(p||h))throw new TypeError(P);p&&i(r,n,o.get),h&&a(r,n,o.set)}return r}}Object.defineProperties&&!x||(Object.defineProperties=function t(e,r){if(x)try{return x.call(Object,e,r)}catch(t){}return Object.keys(r).forEach(function(t){"__proto__"!==t&&Object.defineProperty(e,t,r[t])}),e}),Object.seal||(Object.seal=function t(e){if(Object(e)!==e)throw new TypeError("Object.seal can only be called on Objects.");return e}),Object.freeze||(Object.freeze=function t(e){if(Object(e)!==e)throw new TypeError("Object.freeze can only be called on Objects.");return e});try{Object.freeze(function(){})}catch(t){Object.freeze=function(t){return function e(r){return"function"==typeof r?r:t(r)}}(Object.freeze)}Object.preventExtensions||(Object.preventExtensions=function t(e){if(Object(e)!==e)throw new TypeError("Object.preventExtensions can only be called on Objects.");return e}),Object.isSealed||(Object.isSealed=function t(e){if(Object(e)!==e)throw new TypeError("Object.isSealed can only be called on Objects.");return!1}),Object.isFrozen||(Object.isFrozen=function t(e){if(Object(e)!==e)throw new TypeError("Object.isFrozen can only be called on Objects.");return!1}),Object.isExtensible||(Object.isExtensible=function t(e){if(Object(e)!==e)throw new TypeError("Object.isExtensible can only be called on Objects.");for(var n="";r(e,n);)n+="?";e[n]=!0;var o=r(e,n);return delete e[n],o})})}}}}}}},{extensions:[".js",".json"]}),l=s("./node_modules/meteor/es5-shim/client.js");"undefined"==typeof Package&&(Package={}),Package["es5-shim"]=l}();
!function(){var n=Package.meteor.Meteor,e=Package.meteor.global,t=Package.meteor.meteorEnv,o=Package.modules.meteorInstall,i=Package.modules.Buffer,r=Package.modules.process,u,c=o({node_modules:{meteor:{promise:{"client.js":["meteor-promise","./common.js",function(n,e){n("meteor-promise").makeCompatible(e.Promise=n("./common.js").Promise)}],"common.js":["promise/lib/es6-extensions",function(e,t){var o=this;"function"==typeof o.Promise?t.Promise=o.Promise:t.Promise=e("promise/lib/es6-extensions"),t.Promise.prototype.done=function(e,t){var o=this;arguments.length>0&&(o=this.then.apply(this,arguments)),o.then(null,function(e){n._setImmediate(function(){throw e})})}}],node_modules:{"meteor-promise":{"package.json":function(n,e){e.name="meteor-promise",e.version="0.8.0",e.main="promise_client.js"},"promise_client.js":function(e,t){function o(n){throw n}t.makeCompatible=function(e){var t=e.prototype.then;e.prototype.then=function(e,i){return"object"==typeof n&&"function"==typeof n.bindEnvironment?t.call(this,e&&n.bindEnvironment(e,o),i&&n.bindEnvironment(i,o)):t.call(this,e,i)}}}},promise:{lib:{"es6-extensions.js":["./core.js",function(n,e,t){"use strict";function o(n){var e=new i(i._61);return e._81=1,e._65=n,e}var i=n("./core.js");t.exports=i;var r=o(!0),u=o(!1),c=o(null),f=o(void 0),s=o(0),a=o("");i.resolve=function(n){if(n instanceof i)return n;if(null===n)return c;if(void 0===n)return f;if(n===!0)return r;if(n===!1)return u;if(0===n)return s;if(""===n)return a;if("object"==typeof n||"function"==typeof n)try{var e=n.then;if("function"==typeof e)return new i(e.bind(n))}catch(n){return new i(function(e,t){t(n)})}return o(n)},i.all=function(n){var e=Array.prototype.slice.call(n);return new i(function(n,t){function o(u,c){if(c&&("object"==typeof c||"function"==typeof c)){if(c instanceof i&&c.then===i.prototype.then){for(;3===c._81;)c=c._65;return 1===c._81?o(u,c._65):(2===c._81&&t(c._65),void c.then(function(n){o(u,n)},t))}var f=c.then;if("function"==typeof f){var s=new i(f.bind(c));return void s.then(function(n){o(u,n)},t)}}e[u]=c,0===--r&&n(e)}if(0===e.length)return n([]);for(var r=e.length,u=0;u<e.length;u++)o(u,e[u])})},i.reject=function(n){return new i(function(e,t){t(n)})},i.race=function(n){return new i(function(e,t){n.forEach(function(n){i.resolve(n).then(e,t)})})},i.prototype.catch=function(n){return this.then(null,n)}}],"core.js":["asap/raw",function(n,e,t){"use strict";function o(){}function i(n){try{return n.then}catch(n){return d=n,y}}function r(n,e){try{return n(e)}catch(n){return d=n,y}}function u(n,e,t){try{n(e,t)}catch(n){return d=n,y}}function c(n){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof n)throw new TypeError("not a function");this._45=0,this._81=0,this._65=null,this._54=null,n!==o&&_(n,this)}function f(n,e,t){return new n.constructor(function(i,r){var u=new c(o);u.then(i,r),s(n,new h(e,t,u))})}function s(n,e){for(;3===n._81;)n=n._65;return c._10&&c._10(n),0===n._81?0===n._45?(n._45=1,void(n._54=e)):1===n._45?(n._45=2,void(n._54=[n._54,e])):void n._54.push(e):void a(n,e)}function a(n,e){v(function(){var t=1===n._81?e.onFulfilled:e.onRejected;if(null===t)return void(1===n._81?l(e.promise,n._65):m(e.promise,n._65));var o=r(t,n._65);o===y?m(e.promise,d):l(e.promise,o)})}function l(n,e){if(e===n)return m(n,new TypeError("A promise cannot be resolved with itself."));if(e&&("object"==typeof e||"function"==typeof e)){var t=i(e);if(t===y)return m(n,d);if(t===n.then&&e instanceof c)return n._81=3,n._65=e,void p(n);if("function"==typeof t)return void _(t.bind(e),n)}n._81=1,n._65=e,p(n)}function m(n,e){n._81=2,n._65=e,c._97&&c._97(n,e),p(n)}function p(n){if(1===n._45&&(s(n,n._54),n._54=null),2===n._45){for(var e=0;e<n._54.length;e++)s(n,n._54[e]);n._54=null}}function h(n,e,t){this.onFulfilled="function"==typeof n?n:null,this.onRejected="function"==typeof e?e:null,this.promise=t}function _(n,e){var t=!1,o=u(n,function(n){t||(t=!0,l(e,n))},function(n){t||(t=!0,m(e,n))});t||o!==y||(t=!0,m(e,d))}var v=n("asap/raw"),d=null,y={};t.exports=c,c._10=null,c._97=null,c._61=o,c.prototype.then=function(n,e){if(this.constructor!==c)return f(this,n,e);var t=new c(o);return s(this,new h(n,e,t)),t}}]}},asap:{"raw.js":["domain",function(n,e,t){"use strict";function o(n){s.length||(u(),a=!0),s[s.length]=n}function i(){for(;l<s.length;){var n=l;if(l+=1,s[n].call(),l>m){for(var e=0,t=s.length-l;e<t;e++)s[e]=s[e+l];s.length-=l,l=0}}s.length=0,l=0,a=!1}function u(){var e=r.domain;e&&(c||(c=n("domain")),c.active=r.domain=null),a&&f?setImmediate(i):r.nextTick(i),e&&(c.active=r.domain=e)}var c,f="function"==typeof setImmediate;t.exports=o;var s=[],a=!1,l=0,m=1024;o.requestFlush=u}]}}}}}},{extensions:[".js",".json"]}),f=c("./node_modules/meteor/promise/client.js");"undefined"==typeof Package&&(Package={}),function(n,e){for(var t in e)t in n||(n[t]=e[t])}(Package.promise=f,{Promise:u})}();
!function(){var t=Package.meteor.Meteor,e=Package.meteor.global,r=Package.meteor.meteorEnv,o=Package.modules.meteorInstall,n=Package.modules.Buffer,s=Package.modules.process,i=Package.promise.Promise,c,u,a,_,f,l=o({node_modules:{meteor:{"ecmascript-runtime":{"runtime.js":["meteor-ecmascript-runtime",function(t,e,r){r.exports=t("meteor-ecmascript-runtime")}],node_modules:{"meteor-ecmascript-runtime":{"package.json":function(t,e){e.name="meteor-ecmascript-runtime",e.version="0.2.9",e.main="index.js"},"index.js":["core-js/es6/object","core-js/es6/array","core-js/es6/string","core-js/es6/function","core-js/fn/array/includes","core-js/fn/object/values","core-js/fn/object/entries","core-js/fn/object/get-own-property-descriptors","core-js/fn/string/pad-start","core-js/fn/string/pad-end","core-js/fn/string/trim-start","core-js/fn/string/trim-end","core-js/es6/symbol","core-js/es6/map","core-js/es6/set",function(t,r){t("core-js/es6/object"),t("core-js/es6/array"),t("core-js/es6/string"),t("core-js/es6/function"),t("core-js/fn/array/includes"),t("core-js/fn/object/values"),t("core-js/fn/object/entries"),t("core-js/fn/object/get-own-property-descriptors"),t("core-js/fn/string/pad-start"),t("core-js/fn/string/pad-end"),t("core-js/fn/string/trim-start"),t("core-js/fn/string/trim-end"),c=r.Symbol=e.Symbol||t("core-js/es6/symbol"),u=r.Map=t("core-js/es6/map"),a=r.Set=t("core-js/es6/set")}]},"core-js":{es6:{"object.js":["../modules/es6.symbol","../modules/es6.object.create","../modules/es6.object.define-property","../modules/es6.object.define-properties","../modules/es6.object.get-own-property-descriptor","../modules/es6.object.get-prototype-of","../modules/es6.object.keys","../modules/es6.object.get-own-property-names","../modules/es6.object.freeze","../modules/es6.object.seal","../modules/es6.object.prevent-extensions","../modules/es6.object.is-frozen","../modules/es6.object.is-sealed","../modules/es6.object.is-extensible","../modules/es6.object.assign","../modules/es6.object.is","../modules/es6.object.set-prototype-of","../modules/es6.object.to-string","../modules/_core",function(t,e,r){t("../modules/es6.symbol"),t("../modules/es6.object.create"),t("../modules/es6.object.define-property"),t("../modules/es6.object.define-properties"),t("../modules/es6.object.get-own-property-descriptor"),t("../modules/es6.object.get-prototype-of"),t("../modules/es6.object.keys"),t("../modules/es6.object.get-own-property-names"),t("../modules/es6.object.freeze"),t("../modules/es6.object.seal"),t("../modules/es6.object.prevent-extensions"),t("../modules/es6.object.is-frozen"),t("../modules/es6.object.is-sealed"),t("../modules/es6.object.is-extensible"),t("../modules/es6.object.assign"),t("../modules/es6.object.is"),t("../modules/es6.object.set-prototype-of"),t("../modules/es6.object.to-string"),r.exports=t("../modules/_core").Object}],"array.js":["../modules/es6.string.iterator","../modules/es6.array.is-array","../modules/es6.array.from","../modules/es6.array.of","../modules/es6.array.join","../modules/es6.array.slice","../modules/es6.array.sort","../modules/es6.array.for-each","../modules/es6.array.map","../modules/es6.array.filter","../modules/es6.array.some","../modules/es6.array.every","../modules/es6.array.reduce","../modules/es6.array.reduce-right","../modules/es6.array.index-of","../modules/es6.array.last-index-of","../modules/es6.array.copy-within","../modules/es6.array.fill","../modules/es6.array.find","../modules/es6.array.find-index","../modules/es6.array.species","../modules/es6.array.iterator","../modules/_core",function(t,e,r){t("../modules/es6.string.iterator"),t("../modules/es6.array.is-array"),t("../modules/es6.array.from"),t("../modules/es6.array.of"),t("../modules/es6.array.join"),t("../modules/es6.array.slice"),t("../modules/es6.array.sort"),t("../modules/es6.array.for-each"),t("../modules/es6.array.map"),t("../modules/es6.array.filter"),t("../modules/es6.array.some"),t("../modules/es6.array.every"),t("../modules/es6.array.reduce"),t("../modules/es6.array.reduce-right"),t("../modules/es6.array.index-of"),t("../modules/es6.array.last-index-of"),t("../modules/es6.array.copy-within"),t("../modules/es6.array.fill"),t("../modules/es6.array.find"),t("../modules/es6.array.find-index"),t("../modules/es6.array.species"),t("../modules/es6.array.iterator"),r.exports=t("../modules/_core").Array}],"string.js":["../modules/es6.string.from-code-point","../modules/es6.string.raw","../modules/es6.string.trim","../modules/es6.string.iterator","../modules/es6.string.code-point-at","../modules/es6.string.ends-with","../modules/es6.string.includes","../modules/es6.string.repeat","../modules/es6.string.starts-with","../modules/es6.string.anchor","../modules/es6.string.big","../modules/es6.string.blink","../modules/es6.string.bold","../modules/es6.string.fixed","../modules/es6.string.fontcolor","../modules/es6.string.fontsize","../modules/es6.string.italics","../modules/es6.string.link","../modules/es6.string.small","../modules/es6.string.strike","../modules/es6.string.sub","../modules/es6.string.sup","../modules/es6.regexp.match","../modules/es6.regexp.replace","../modules/es6.regexp.search","../modules/es6.regexp.split","../modules/_core",function(t,e,r){t("../modules/es6.string.from-code-point"),t("../modules/es6.string.raw"),t("../modules/es6.string.trim"),t("../modules/es6.string.iterator"),t("../modules/es6.string.code-point-at"),t("../modules/es6.string.ends-with"),t("../modules/es6.string.includes"),t("../modules/es6.string.repeat"),t("../modules/es6.string.starts-with"),t("../modules/es6.string.anchor"),t("../modules/es6.string.big"),t("../modules/es6.string.blink"),t("../modules/es6.string.bold"),t("../modules/es6.string.fixed"),t("../modules/es6.string.fontcolor"),t("../modules/es6.string.fontsize"),t("../modules/es6.string.italics"),t("../modules/es6.string.link"),t("../modules/es6.string.small"),t("../modules/es6.string.strike"),t("../modules/es6.string.sub"),t("../modules/es6.string.sup"),t("../modules/es6.regexp.match"),t("../modules/es6.regexp.replace"),t("../modules/es6.regexp.search"),t("../modules/es6.regexp.split"),r.exports=t("../modules/_core").String}],"function.js":["../modules/es6.function.bind","../modules/es6.function.name","../modules/es6.function.has-instance","../modules/_core",function(t,e,r){t("../modules/es6.function.bind"),t("../modules/es6.function.name"),t("../modules/es6.function.has-instance"),r.exports=t("../modules/_core").Function}],"symbol.js":["../modules/es6.symbol","../modules/es6.object.to-string","../modules/_core",function(t,e,r){t("../modules/es6.symbol"),t("../modules/es6.object.to-string"),r.exports=t("../modules/_core").Symbol}],"map.js":["../modules/es6.object.to-string","../modules/es6.string.iterator","../modules/web.dom.iterable","../modules/es6.map","../modules/_core",function(t,e,r){t("../modules/es6.object.to-string"),t("../modules/es6.string.iterator"),t("../modules/web.dom.iterable"),t("../modules/es6.map"),r.exports=t("../modules/_core").Map}],"set.js":["../modules/es6.object.to-string","../modules/es6.string.iterator","../modules/web.dom.iterable","../modules/es6.set","../modules/_core",function(t,e,r){t("../modules/es6.object.to-string"),t("../modules/es6.string.iterator"),t("../modules/web.dom.iterable"),t("../modules/es6.set"),r.exports=t("../modules/_core").Set}]},modules:{"es6.symbol.js":["./_global","./_has","./_descriptors","./_export","./_redefine","./_meta","./_fails","./_shared","./_set-to-string-tag","./_uid","./_wks","./_wks-ext","./_wks-define","./_keyof","./_enum-keys","./_is-array","./_an-object","./_to-iobject","./_to-primitive","./_property-desc","./_object-create","./_object-gopn-ext","./_object-gopd","./_object-dp","./_object-keys","./_object-gopn","./_object-pie","./_object-gops","./_library","./_hide",function(t){"use strict";var e=t("./_global"),r=t("./_has"),o=t("./_descriptors"),n=t("./_export"),s=t("./_redefine"),i=t("./_meta").KEY,c=t("./_fails"),u=t("./_shared"),a=t("./_set-to-string-tag"),_=t("./_uid"),f=t("./_wks"),l=t("./_wks-ext"),d=t("./_wks-define"),p=t("./_keyof"),j=t("./_enum-keys"),g=t("./_is-array"),b=t("./_an-object"),m=t("./_to-iobject"),h=t("./_to-primitive"),y=t("./_property-desc"),v=t("./_object-create"),x=t("./_object-gopn-ext"),w=t("./_object-gopd"),k=t("./_object-dp"),S=t("./_object-keys"),O=w.f,P=k.f,E=x.f,A=e.Symbol,F=e.JSON,M=F&&F.stringify,R="prototype",z=f("_hidden"),T=f("toPrimitive"),I={}.propertyIsEnumerable,C=u("symbol-registry"),N=u("symbols"),W=u("op-symbols"),D=Object[R],L="function"==typeof A,K=e.QObject,q=!K||!K[R]||!K[R].findChild,B=o&&c(function(){return 7!=v(P({},"a",{get:function(){return P(this,"a",{value:7}).a}})).a})?function(t,e,r){var o=O(D,e);o&&delete D[e],P(t,e,r),o&&t!==D&&P(D,e,o)}:P,G=function(t){var e=N[t]=v(A[R]);return e._k=t,e},J=L&&"symbol"==typeof A.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof A},U=function t(e,o,n){return e===D&&U(W,o,n),b(e),o=h(o,!0),b(n),r(N,o)?(n.enumerable?(r(e,z)&&e[z][o]&&(e[z][o]=!1),n=v(n,{enumerable:y(0,!1)})):(r(e,z)||P(e,z,y(1,{})),e[z][o]=!0),B(e,o,n)):P(e,o,n)},Y=function t(e,r){b(e);for(var o=j(r=m(r)),n=0,s=o.length,i;s>n;)U(e,i=o[n++],r[i]);return e},$=function t(e,r){return void 0===r?v(e):Y(v(e),r)},Q=function t(e){var o=I.call(this,e=h(e,!0));return!(this===D&&r(N,e)&&!r(W,e))&&(!(o||!r(this,e)||!r(N,e)||r(this,z)&&this[z][e])||o)},H=function t(e,o){if(e=m(e),o=h(o,!0),e!==D||!r(N,o)||r(W,o)){var n=O(e,o);return!n||!r(N,o)||r(e,z)&&e[z][o]||(n.enumerable=!0),n}},V=function t(e){for(var o=E(m(e)),n=[],s=0,c;o.length>s;)r(N,c=o[s++])||c==z||c==i||n.push(c);return n},X=function t(e){for(var o=e===D,n=E(o?W:m(e)),s=[],i=0,c;n.length>i;)!r(N,c=n[i++])||o&&!r(D,c)||s.push(N[c]);return s};L||(A=function t(){if(this instanceof A)throw TypeError("Symbol is not a constructor!");var e=_(arguments.length>0?arguments[0]:void 0),n=function(t){this===D&&n.call(W,t),r(this,z)&&r(this[z],e)&&(this[z][e]=!1),B(this,e,y(1,t))};return o&&q&&B(D,e,{configurable:!0,set:n}),G(e)},s(A[R],"toString",function t(){return this._k}),w.f=H,k.f=U,t("./_object-gopn").f=x.f=V,t("./_object-pie").f=Q,t("./_object-gops").f=X,o&&!t("./_library")&&s(D,"propertyIsEnumerable",Q,!0),l.f=function(t){return G(f(t))}),n(n.G+n.W+n.F*!L,{Symbol:A});for(var Z="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),tt=0;Z.length>tt;)f(Z[tt++]);for(var Z=S(f.store),tt=0;Z.length>tt;)d(Z[tt++]);n(n.S+n.F*!L,"Symbol",{for:function(t){return r(C,t+="")?C[t]:C[t]=A(t)},keyFor:function t(e){if(J(e))return p(C,e);throw TypeError(e+" is not a symbol!")},useSetter:function(){q=!0},useSimple:function(){q=!1}}),n(n.S+n.F*!L,"Object",{create:$,defineProperty:U,defineProperties:Y,getOwnPropertyDescriptor:H,getOwnPropertyNames:V,getOwnPropertySymbols:X}),F&&n(n.S+n.F*(!L||c(function(){var t=A();return"[null]"!=M([t])||"{}"!=M({a:t})||"{}"!=M(Object(t))})),"JSON",{stringify:function t(e){if(void 0!==e&&!J(e)){for(var r=[e],o=1,n,s;arguments.length>o;)r.push(arguments[o++]);return n=r[1],"function"==typeof n&&(s=n),!s&&g(n)||(n=function(t,e){if(s&&(e=s.call(this,t,e)),!J(e))return e}),r[1]=n,M.apply(F,r)}}}),A[R][T]||t("./_hide")(A[R],T,A[R].valueOf),a(A,"Symbol"),a(Math,"Math",!0),a(e.JSON,"JSON",!0)}],"_global.js":function(t,e,r){var o=r.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof _&&(_=o)},"_has.js":function(t,e,r){var o={}.hasOwnProperty;r.exports=function(t,e){return o.call(t,e)}},"_descriptors.js":["./_fails",function(t,e,r){r.exports=!t("./_fails")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})}],"_fails.js":function(t,e,r){r.exports=function(t){try{return!!t()}catch(t){return!0}}},"_export.js":["./_global","./_core","./_hide","./_redefine","./_ctx",function(t,e,r){var o=t("./_global"),n=t("./_core"),s=t("./_hide"),i=t("./_redefine"),c=t("./_ctx"),u="prototype",a=function(t,e,r){var _=t&a.F,f=t&a.G,l=t&a.S,d=t&a.P,p=t&a.B,j=f?o:l?o[e]||(o[e]={}):(o[e]||{})[u],g=f?n:n[e]||(n[e]={}),b=g[u]||(g[u]={}),m,h,y,v;f&&(r=e);for(m in r)h=!_&&j&&void 0!==j[m],y=(h?j:r)[m],v=p&&h?c(y,o):d&&"function"==typeof y?c(Function.call,y):y,j&&i(j,m,y,t&a.U),g[m]!=y&&s(g,m,v),d&&b[m]!=y&&(b[m]=y)};o.core=n,a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,r.exports=a}],"_core.js":function(t,e,r){var o=r.exports={version:"2.4.0"};"number"==typeof f&&(f=o)},"_hide.js":["./_object-dp","./_property-desc","./_descriptors",function(t,e,r){var o=t("./_object-dp"),n=t("./_property-desc");r.exports=t("./_descriptors")?function(t,e,r){return o.f(t,e,n(1,r))}:function(t,e,r){return t[e]=r,t}}],"_object-dp.js":["./_an-object","./_ie8-dom-define","./_to-primitive","./_descriptors",function(t,e){var r=t("./_an-object"),o=t("./_ie8-dom-define"),n=t("./_to-primitive"),s=Object.defineProperty;e.f=t("./_descriptors")?Object.defineProperty:function t(e,i,c){if(r(e),i=n(i,!0),r(c),o)try{return s(e,i,c)}catch(t){}if("get"in c||"set"in c)throw TypeError("Accessors not supported!");return"value"in c&&(e[i]=c.value),e}}],"_an-object.js":["./_is-object",function(t,e,r){var o=t("./_is-object");r.exports=function(t){if(!o(t))throw TypeError(t+" is not an object!");return t}}],"_is-object.js":function(t,e,r){r.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},"_ie8-dom-define.js":["./_descriptors","./_fails","./_dom-create",function(t,e,r){r.exports=!t("./_descriptors")&&!t("./_fails")(function(){return 7!=Object.defineProperty(t("./_dom-create")("div"),"a",{get:function(){return 7}}).a})}],"_dom-create.js":["./_is-object","./_global",function(t,e,r){var o=t("./_is-object"),n=t("./_global").document,s=o(n)&&o(n.createElement);r.exports=function(t){return s?n.createElement(t):{}}}],"_to-primitive.js":["./_is-object",function(t,e,r){var o=t("./_is-object");r.exports=function(t,e){if(!o(t))return t;var r,n;if(e&&"function"==typeof(r=t.toString)&&!o(n=r.call(t)))return n;if("function"==typeof(r=t.valueOf)&&!o(n=r.call(t)))return n;if(!e&&"function"==typeof(r=t.toString)&&!o(n=r.call(t)))return n;throw TypeError("Can't convert object to primitive value")}}],"_property-desc.js":function(t,e,r){r.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},"_redefine.js":["./_global","./_hide","./_has","./_uid","./_core",function(t,e,r){var o=t("./_global"),n=t("./_hide"),s=t("./_has"),i=t("./_uid")("src"),c="toString",u=Function[c],a=(""+u).split(c);t("./_core").inspectSource=function(t){return u.call(t)},(r.exports=function(t,e,r,c){var u="function"==typeof r;u&&(s(r,"name")||n(r,"name",e)),t[e]!==r&&(u&&(s(r,i)||n(r,i,t[e]?""+t[e]:a.join(String(e)))),t===o?t[e]=r:c?t[e]?t[e]=r:n(t,e,r):(delete t[e],n(t,e,r)))})(Function.prototype,c,function t(){return"function"==typeof this&&this[i]||u.call(this)})}],"_uid.js":function(t,e,r){var o=0,n=Math.random();r.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++o+n).toString(36))}},"_ctx.js":["./_a-function",function(t,e,r){var o=t("./_a-function");r.exports=function(t,e,r){if(o(t),void 0===e)return t;switch(r){case 1:return function(r){return t.call(e,r)};case 2:return function(r,o){return t.call(e,r,o)};case 3:return function(r,o,n){return t.call(e,r,o,n)}}return function(){return t.apply(e,arguments)}}}],"_a-function.js":function(t,e,r){r.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},"_meta.js":["./_uid","./_is-object","./_has","./_object-dp","./_fails",function(t,e,r){var o=t("./_uid")("meta"),n=t("./_is-object"),s=t("./_has"),i=t("./_object-dp").f,c=0,u=Object.isExtensible||function(){return!0},a=!t("./_fails")(function(){return u(Object.preventExtensions({}))}),_=function(t){i(t,o,{value:{i:"O"+ ++c,w:{}}})},f=function(t,e){if(!n(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!s(t,o)){if(!u(t))return"F";if(!e)return"E";_(t)}return t[o].i},l=function(t,e){if(!s(t,o)){if(!u(t))return!0;if(!e)return!1;_(t)}return t[o].w},d=function(t){return a&&p.NEED&&u(t)&&!s(t,o)&&_(t),t},p=r.exports={KEY:o,NEED:!1,fastKey:f,getWeak:l,onFreeze:d}}],"_shared.js":["./_global",function(t,e,r){var o=t("./_global"),n="__core-js_shared__",s=o[n]||(o[n]={});r.exports=function(t){return s[t]||(s[t]={})}}],"_set-to-string-tag.js":["./_object-dp","./_has","./_wks",function(t,e,r){var o=t("./_object-dp").f,n=t("./_has"),s=t("./_wks")("toStringTag");r.exports=function(t,e,r){t&&!n(t=r?t:t.prototype,s)&&o(t,s,{configurable:!0,value:e})}}],"_wks.js":["./_shared","./_uid","./_global",function(t,e,r){var o=t("./_shared")("wks"),n=t("./_uid"),s=t("./_global").Symbol,i="function"==typeof s,c=r.exports=function(t){return o[t]||(o[t]=i&&s[t]||(i?s:n)("Symbol."+t))};c.store=o}],"_wks-ext.js":["./_wks",function(t,e){e.f=t("./_wks")}],"_wks-define.js":["./_global","./_core","./_library","./_wks-ext","./_object-dp",function(t,e,r){var o=t("./_global"),n=t("./_core"),s=t("./_library"),i=t("./_wks-ext"),c=t("./_object-dp").f;r.exports=function(t){var e=n.Symbol||(n.Symbol=s?{}:o.Symbol||{});"_"==t.charAt(0)||t in e||c(e,t,{value:i.f(t)})}}],"_library.js":function(t,e,r){r.exports=!1},"_keyof.js":["./_object-keys","./_to-iobject",function(t,e,r){var o=t("./_object-keys"),n=t("./_to-iobject");r.exports=function(t,e){for(var r=n(t),s=o(r),i=s.length,c=0,u;i>c;)if(r[u=s[c++]]===e)return u}}],"_object-keys.js":["./_object-keys-internal","./_enum-bug-keys",function(t,e,r){var o=t("./_object-keys-internal"),n=t("./_enum-bug-keys");r.exports=Object.keys||function t(e){return o(e,n)}}],"_object-keys-internal.js":["./_has","./_to-iobject","./_array-includes","./_shared-key",function(t,e,r){var o=t("./_has"),n=t("./_to-iobject"),s=t("./_array-includes")(!1),i=t("./_shared-key")("IE_PROTO");r.exports=function(t,e){var r=n(t),c=0,u=[],a;for(a in r)a!=i&&o(r,a)&&u.push(a);for(;e.length>c;)o(r,a=e[c++])&&(~s(u,a)||u.push(a));return u}}],"_to-iobject.js":["./_iobject","./_defined",function(t,e,r){var o=t("./_iobject"),n=t("./_defined");r.exports=function(t){return o(n(t))}}],"_iobject.js":["./_cof",function(t,e,r){var o=t("./_cof");r.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==o(t)?t.split(""):Object(t)}}],"_cof.js":function(t,e,r){var o={}.toString;r.exports=function(t){return o.call(t).slice(8,-1)}},"_defined.js":function(t,e,r){r.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},"_array-includes.js":["./_to-iobject","./_to-length","./_to-index",function(t,e,r){var o=t("./_to-iobject"),n=t("./_to-length"),s=t("./_to-index");r.exports=function(t){return function(e,r,i){var c=o(e),u=n(c.length),a=s(i,u),_;if(t&&r!=r){for(;u>a;)if(_=c[a++],_!=_)return!0}else for(;u>a;a++)if((t||a in c)&&c[a]===r)return t||a||0;return!t&&-1}}}],"_to-length.js":["./_to-integer",function(t,e,r){var o=t("./_to-integer"),n=Math.min;r.exports=function(t){return t>0?n(o(t),9007199254740991):0}}],"_to-integer.js":function(t,e,r){var o=Math.ceil,n=Math.floor;r.exports=function(t){return isNaN(t=+t)?0:(t>0?n:o)(t)}},"_to-index.js":["./_to-integer",function(t,e,r){var o=t("./_to-integer"),n=Math.max,s=Math.min;r.exports=function(t,e){return t=o(t),t<0?n(t+e,0):s(t,e)}}],"_shared-key.js":["./_shared","./_uid",function(t,e,r){var o=t("./_shared")("keys"),n=t("./_uid");r.exports=function(t){return o[t]||(o[t]=n(t))}}],"_enum-bug-keys.js":function(t,e,r){r.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},"_enum-keys.js":["./_object-keys","./_object-gops","./_object-pie",function(t,e,r){var o=t("./_object-keys"),n=t("./_object-gops"),s=t("./_object-pie");r.exports=function(t){var e=o(t),r=n.f;if(r)for(var i=r(t),c=s.f,u=0,a;i.length>u;)c.call(t,a=i[u++])&&e.push(a);return e}}],"_object-gops.js":function(t,e){e.f=Object.getOwnPropertySymbols},"_object-pie.js":function(t,e){e.f={}.propertyIsEnumerable},"_is-array.js":["./_cof",function(t,e,r){var o=t("./_cof");r.exports=Array.isArray||function t(e){return"Array"==o(e)}}],"_object-create.js":["./_an-object","./_object-dps","./_enum-bug-keys","./_shared-key","./_dom-create","./_html",function(t,e,r){var o=t("./_an-object"),n=t("./_object-dps"),s=t("./_enum-bug-keys"),i=t("./_shared-key")("IE_PROTO"),c=function(){},u="prototype",a=function(){var e=t("./_dom-create")("iframe"),r=s.length,o="<",n=">",i;for(e.style.display="none",t("./_html").appendChild(e),e.src="javascript:",i=e.contentWindow.document,i.open(),i.write(o+"script"+n+"document.F=Object"+o+"/script"+n),i.close(),a=i.F;r--;)delete a[u][s[r]];return a()};r.exports=Object.create||function t(e,r){var s;return null!==e?(c[u]=o(e),s=new c,c[u]=null,s[i]=e):s=a(),void 0===r?s:n(s,r)}}],"_object-dps.js":["./_object-dp","./_an-object","./_object-keys","./_descriptors",function(t,e,r){var o=t("./_object-dp"),n=t("./_an-object"),s=t("./_object-keys");r.exports=t("./_descriptors")?Object.defineProperties:function t(e,r){n(e);for(var i=s(r),c=i.length,u=0,a;c>u;)o.f(e,a=i[u++],r[a]);return e}}],"_html.js":["./_global",function(t,e,r){r.exports=t("./_global").document&&document.documentElement}],"_object-gopn-ext.js":["./_to-iobject","./_object-gopn",function(t,e,r){var o=t("./_to-iobject"),n=t("./_object-gopn").f,s={}.toString,i="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],c=function(t){try{return n(t)}catch(t){return i.slice()}};r.exports.f=function t(e){return i&&"[object Window]"==s.call(e)?c(e):n(o(e))}}],"_object-gopn.js":["./_object-keys-internal","./_enum-bug-keys",function(t,e){var r=t("./_object-keys-internal"),o=t("./_enum-bug-keys").concat("length","prototype");e.f=Object.getOwnPropertyNames||function t(e){return r(e,o)}}],"_object-gopd.js":["./_object-pie","./_property-desc","./_to-iobject","./_to-primitive","./_has","./_ie8-dom-define","./_descriptors",function(t,e){var r=t("./_object-pie"),o=t("./_property-desc"),n=t("./_to-iobject"),s=t("./_to-primitive"),i=t("./_has"),c=t("./_ie8-dom-define"),u=Object.getOwnPropertyDescriptor;e.f=t("./_descriptors")?u:function t(e,a){if(e=n(e),a=s(a,!0),c)try{return u(e,a)}catch(t){}if(i(e,a))return o(!r.f.call(e,a),e[a])}}],"es6.object.create.js":["./_export","./_object-create",function(t){var e=t("./_export");e(e.S,"Object",{create:t("./_object-create")})}],"es6.object.define-property.js":["./_export","./_descriptors","./_object-dp",function(t){var e=t("./_export");e(e.S+e.F*!t("./_descriptors"),"Object",{defineProperty:t("./_object-dp").f})}],"es6.object.define-properties.js":["./_export","./_descriptors","./_object-dps",function(t){var e=t("./_export");e(e.S+e.F*!t("./_descriptors"),"Object",{defineProperties:t("./_object-dps")})}],"es6.object.get-own-property-descriptor.js":["./_to-iobject","./_object-gopd","./_object-sap",function(t){var e=t("./_to-iobject"),r=t("./_object-gopd").f;t("./_object-sap")("getOwnPropertyDescriptor",function(){return function t(o,n){return r(e(o),n)}})}],"_object-sap.js":["./_export","./_core","./_fails",function(t,e,r){var o=t("./_export"),n=t("./_core"),s=t("./_fails");r.exports=function(t,e){var r=(n.Object||{})[t]||Object[t],i={};i[t]=e(r),o(o.S+o.F*s(function(){r(1)}),"Object",i)}}],"es6.object.get-prototype-of.js":["./_to-object","./_object-gpo","./_object-sap",function(t){var e=t("./_to-object"),r=t("./_object-gpo");t("./_object-sap")("getPrototypeOf",function(){return function t(o){return r(e(o))}})}],"_to-object.js":["./_defined",function(t,e,r){var o=t("./_defined");r.exports=function(t){return Object(o(t))}}],"_object-gpo.js":["./_has","./_to-object","./_shared-key",function(t,e,r){var o=t("./_has"),n=t("./_to-object"),s=t("./_shared-key")("IE_PROTO"),i=Object.prototype;r.exports=Object.getPrototypeOf||function(t){return t=n(t),o(t,s)?t[s]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?i:null}}],"es6.object.keys.js":["./_to-object","./_object-keys","./_object-sap",function(t){var e=t("./_to-object"),r=t("./_object-keys");t("./_object-sap")("keys",function(){return function t(o){return r(e(o))}})}],"es6.object.get-own-property-names.js":["./_object-sap","./_object-gopn-ext",function(t){t("./_object-sap")("getOwnPropertyNames",function(){return t("./_object-gopn-ext").f})}],"es6.object.freeze.js":["./_is-object","./_meta","./_object-sap",function(t){var e=t("./_is-object"),r=t("./_meta").onFreeze;t("./_object-sap")("freeze",function(t){return function o(n){return t&&e(n)?t(r(n)):n}})}],"es6.object.seal.js":["./_is-object","./_meta","./_object-sap",function(t){var e=t("./_is-object"),r=t("./_meta").onFreeze;t("./_object-sap")("seal",function(t){return function o(n){return t&&e(n)?t(r(n)):n}})}],"es6.object.prevent-extensions.js":["./_is-object","./_meta","./_object-sap",function(t){var e=t("./_is-object"),r=t("./_meta").onFreeze;t("./_object-sap")("preventExtensions",function(t){return function o(n){return t&&e(n)?t(r(n)):n}})}],"es6.object.is-frozen.js":["./_is-object","./_object-sap",function(t){var e=t("./_is-object");t("./_object-sap")("isFrozen",function(t){return function r(o){return!e(o)||!!t&&t(o)}})}],"es6.object.is-sealed.js":["./_is-object","./_object-sap",function(t){var e=t("./_is-object");t("./_object-sap")("isSealed",function(t){return function r(o){return!e(o)||!!t&&t(o)}})}],"es6.object.is-extensible.js":["./_is-object","./_object-sap",function(t){var e=t("./_is-object");t("./_object-sap")("isExtensible",function(t){return function r(o){return!!e(o)&&(!t||t(o))}})}],"es6.object.assign.js":["./_export","./_object-assign",function(t){var e=t("./_export");e(e.S+e.F,"Object",{assign:t("./_object-assign")})}],"_object-assign.js":["./_object-keys","./_object-gops","./_object-pie","./_to-object","./_iobject","./_fails",function(t,e,r){"use strict";var o=t("./_object-keys"),n=t("./_object-gops"),s=t("./_object-pie"),i=t("./_to-object"),u=t("./_iobject"),a=Object.assign;r.exports=!a||t("./_fails")(function(){var t={},e={},r=c(),o="abcdefghijklmnopqrst";return t[r]=7,o.split("").forEach(function(t){e[t]=t}),7!=a({},t)[r]||Object.keys(a({},e)).join("")!=o})?function t(e,r){for(var c=i(e),a=arguments.length,_=1,f=n.f,l=s.f;a>_;)for(var d=u(arguments[_++]),p=f?o(d).concat(f(d)):o(d),j=p.length,g=0,b;j>g;)l.call(d,b=p[g++])&&(c[b]=d[b]);return c}:a}],"es6.object.is.js":["./_export","./_same-value",function(t){var e=t("./_export");e(e.S,"Object",{is:t("./_same-value")})}],"_same-value.js":function(t,e,r){r.exports=Object.is||function t(e,r){return e===r?0!==e||1/e===1/r:e!=e&&r!=r}},"es6.object.set-prototype-of.js":["./_export","./_set-proto",function(t){var e=t("./_export");e(e.S,"Object",{setPrototypeOf:t("./_set-proto").set})}],"_set-proto.js":["./_is-object","./_an-object","./_ctx","./_object-gopd",function(t,e,r){var o=t("./_is-object"),n=t("./_an-object"),s=function(t,e){if(n(t),!o(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};r.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,r,o){try{o=t("./_ctx")(Function.call,t("./_object-gopd").f(Object.prototype,"__proto__").set,2),o(e,[]),r=!(e instanceof Array)}catch(t){r=!0}return function t(e,n){return s(e,n),r?e.__proto__=n:o(e,n),e}}({},!1):void 0),check:s}}],"es6.object.to-string.js":["./_classof","./_wks","./_redefine",function(t){"use strict";var e=t("./_classof"),r={};r[t("./_wks")("toStringTag")]="z",r+""!="[object z]"&&t("./_redefine")(Object.prototype,"toString",function t(){return"[object "+e(this)+"]"},!0)}],"_classof.js":["./_cof","./_wks",function(t,e,r){var o=t("./_cof"),n=t("./_wks")("toStringTag"),s="Arguments"==o(function(){return arguments}()),i=function(t,e){try{return t[e]}catch(t){}};r.exports=function(t){var e,r,c;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=i(e=Object(t),n))?r:s?o(e):"Object"==(c=o(e))&&"function"==typeof e.callee?"Arguments":c}}],"es6.string.iterator.js":["./_string-at","./_iter-define",function(t){"use strict";var e=t("./_string-at")(!0);t("./_iter-define")(String,"String",function(t){this._t=String(t),this._i=0},function(){var t=this._t,r=this._i,o;return r>=t.length?{value:void 0,done:!0}:(o=e(t,r),this._i+=o.length,{value:o,done:!1})})}],"_string-at.js":["./_to-integer","./_defined",function(t,e,r){var o=t("./_to-integer"),n=t("./_defined");r.exports=function(t){return function(e,r){var s=String(n(e)),i=o(r),c=s.length,u,a;return i<0||i>=c?t?"":void 0:(u=s.charCodeAt(i),u<55296||u>56319||i+1===c||(a=s.charCodeAt(i+1))<56320||a>57343?t?s.charAt(i):u:t?s.slice(i,i+2):(u-55296<<10)+(a-56320)+65536)}}}],"_iter-define.js":["./_library","./_export","./_redefine","./_hide","./_has","./_iterators","./_iter-create","./_set-to-string-tag","./_object-gpo","./_wks",function(t,e,r){"use strict";var o=t("./_library"),n=t("./_export"),s=t("./_redefine"),i=t("./_hide"),c=t("./_has"),u=t("./_iterators"),a=t("./_iter-create"),_=t("./_set-to-string-tag"),f=t("./_object-gpo"),l=t("./_wks")("iterator"),d=!([].keys&&"next"in[].keys()),p="@@iterator",j="keys",g="values",b=function(){return this};r.exports=function(t,e,r,m,h,y,v){a(r,e,m);var x=function(t){if(!d&&t in O)return O[t];switch(t){case j:return function e(){return new r(this,t)};case g:return function e(){return new r(this,t)}}return function e(){return new r(this,t)}},w=e+" Iterator",k=h==g,S=!1,O=t.prototype,P=O[l]||O[p]||h&&O[h],E=P||x(h),A=h?k?x("entries"):E:void 0,F="Array"==e?O.entries||P:P,M,R,z;if(F&&(z=f(F.call(new t)),z!==Object.prototype&&(_(z,w,!0),o||c(z,l)||i(z,l,b))),k&&P&&P.name!==g&&(S=!0,E=function t(){return P.call(this)}),o&&!v||!d&&!S&&O[l]||i(O,l,E),u[e]=E,u[w]=b,h)if(M={values:k?E:x(g),keys:y?E:x(j),entries:A},v)for(R in M)R in O||s(O,R,M[R]);else n(n.P+n.F*(d||S),e,M);return M}}],"_iterators.js":function(t,e,r){r.exports={}},"_iter-create.js":["./_object-create","./_property-desc","./_set-to-string-tag","./_hide","./_wks",function(t,e,r){"use strict";var o=t("./_object-create"),n=t("./_property-desc"),s=t("./_set-to-string-tag"),i={};t("./_hide")(i,t("./_wks")("iterator"),function(){return this}),r.exports=function(t,e,r){t.prototype=o(i,{next:n(1,r)}),s(t,e+" Iterator")}}],"es6.array.is-array.js":["./_export","./_is-array",function(t){var e=t("./_export");e(e.S,"Array",{isArray:t("./_is-array")})}],"es6.array.from.js":["./_ctx","./_export","./_to-object","./_iter-call","./_is-array-iter","./_to-length","./_create-property","./core.get-iterator-method","./_iter-detect",function(t){"use strict";var e=t("./_ctx"),r=t("./_export"),o=t("./_to-object"),n=t("./_iter-call"),s=t("./_is-array-iter"),i=t("./_to-length"),c=t("./_create-property"),u=t("./core.get-iterator-method");r(r.S+r.F*!t("./_iter-detect")(function(t){Array.from(t)}),"Array",{from:function t(r){var a=o(r),_="function"==typeof this?this:Array,f=arguments.length,l=f>1?arguments[1]:void 0,d=void 0!==l,p=0,j=u(a),g,b,m,h;if(d&&(l=e(l,f>2?arguments[2]:void 0,2)),void 0==j||_==Array&&s(j))for(g=i(a.length),b=new _(g);g>p;p++)c(b,p,d?l(a[p],p):a[p]);else for(h=j.call(a),b=new _;!(m=h.next()).done;p++)c(b,p,d?n(h,l,[m.value,p],!0):m.value);return b.length=p,b}})}],"_iter-call.js":["./_an-object",function(t,e,r){var o=t("./_an-object");r.exports=function(t,e,r,n){try{return n?e(o(r)[0],r[1]):e(r)}catch(e){var s=t.return;throw void 0!==s&&o(s.call(t)),e}}}],"_is-array-iter.js":["./_iterators","./_wks",function(t,e,r){var o=t("./_iterators"),n=t("./_wks")("iterator"),s=Array.prototype;r.exports=function(t){return void 0!==t&&(o.Array===t||s[n]===t)}}],"_create-property.js":["./_object-dp","./_property-desc",function(t,e,r){"use strict";var o=t("./_object-dp"),n=t("./_property-desc");r.exports=function(t,e,r){e in t?o.f(t,e,n(0,r)):t[e]=r}}],"core.get-iterator-method.js":["./_classof","./_wks","./_iterators","./_core",function(t,e,r){var o=t("./_classof"),n=t("./_wks")("iterator"),s=t("./_iterators");r.exports=t("./_core").getIteratorMethod=function(t){if(void 0!=t)return t[n]||t["@@iterator"]||s[o(t)]}}],"_iter-detect.js":["./_wks",function(t,e,r){
var o=t("./_wks")("iterator"),n=!1;try{var s=[7][o]();s.return=function(){n=!0},Array.from(s,function(){throw 2})}catch(t){}r.exports=function(t,e){if(!e&&!n)return!1;var r=!1;try{var s=[7],i=s[o]();i.next=function(){return{done:r=!0}},s[o]=function(){return i},t(s)}catch(t){}return r}}],"es6.array.of.js":["./_export","./_create-property","./_fails",function(t){"use strict";var e=t("./_export"),r=t("./_create-property");e(e.S+e.F*t("./_fails")(function(){function t(){}return!(Array.of.call(t)instanceof t)}),"Array",{of:function t(){for(var e=0,o=arguments.length,n=new("function"==typeof this?this:Array)(o);o>e;)r(n,e,arguments[e++]);return n.length=o,n}})}],"es6.array.join.js":["./_export","./_to-iobject","./_iobject","./_strict-method",function(t){"use strict";var e=t("./_export"),r=t("./_to-iobject"),o=[].join;e(e.P+e.F*(t("./_iobject")!=Object||!t("./_strict-method")(o)),"Array",{join:function t(e){return o.call(r(this),void 0===e?",":e)}})}],"_strict-method.js":["./_fails",function(t,e,r){var o=t("./_fails");r.exports=function(t,e){return!!t&&o(function(){e?t.call(null,function(){},1):t.call(null)})}}],"es6.array.slice.js":["./_export","./_html","./_cof","./_to-index","./_to-length","./_fails",function(t){"use strict";var e=t("./_export"),r=t("./_html"),o=t("./_cof"),n=t("./_to-index"),s=t("./_to-length"),i=[].slice;e(e.P+e.F*t("./_fails")(function(){r&&i.call(r)}),"Array",{slice:function t(e,r){var c=s(this.length),u=o(this);if(r=void 0===r?c:r,"Array"==u)return i.call(this,e,r);for(var a=n(e,c),_=n(r,c),f=s(_-a),l=Array(f),d=0;d<f;d++)l[d]="String"==u?this.charAt(a+d):this[a+d];return l}})}],"es6.array.sort.js":["./_export","./_a-function","./_to-object","./_fails","./_strict-method",function(t){"use strict";var e=t("./_export"),r=t("./_a-function"),o=t("./_to-object"),n=t("./_fails"),s=[].sort,i=[1,2,3];e(e.P+e.F*(n(function(){i.sort(void 0)})||!n(function(){i.sort(null)})||!t("./_strict-method")(s)),"Array",{sort:function t(e){return void 0===e?s.call(o(this)):s.call(o(this),r(e))}})}],"es6.array.for-each.js":["./_export","./_array-methods","./_strict-method",function(t){"use strict";var e=t("./_export"),r=t("./_array-methods")(0),o=t("./_strict-method")([].forEach,!0);e(e.P+e.F*!o,"Array",{forEach:function t(e){return r(this,e,arguments[1])}})}],"_array-methods.js":["./_ctx","./_iobject","./_to-object","./_to-length","./_array-species-create",function(t,e,r){var o=t("./_ctx"),n=t("./_iobject"),s=t("./_to-object"),i=t("./_to-length"),c=t("./_array-species-create");r.exports=function(t,e){var r=1==t,u=2==t,a=3==t,_=4==t,f=6==t,l=5==t||f,d=e||c;return function(e,c,p){for(var j=s(e),g=n(j),b=o(c,p,3),m=i(g.length),h=0,y=r?d(e,m):u?d(e,0):void 0,v,x;m>h;h++)if((l||h in g)&&(v=g[h],x=b(v,h,j),t))if(r)y[h]=x;else if(x)switch(t){case 3:return!0;case 5:return v;case 6:return h;case 2:y.push(v)}else if(_)return!1;return f?-1:a||_?_:y}}}],"_array-species-create.js":["./_array-species-constructor",function(t,e,r){var o=t("./_array-species-constructor");r.exports=function(t,e){return new(o(t))(e)}}],"_array-species-constructor.js":["./_is-object","./_is-array","./_wks",function(t,e,r){var o=t("./_is-object"),n=t("./_is-array"),s=t("./_wks")("species");r.exports=function(t){var e;return n(t)&&(e=t.constructor,"function"!=typeof e||e!==Array&&!n(e.prototype)||(e=void 0),o(e)&&(e=e[s],null===e&&(e=void 0))),void 0===e?Array:e}}],"es6.array.map.js":["./_export","./_array-methods","./_strict-method",function(t){"use strict";var e=t("./_export"),r=t("./_array-methods")(1);e(e.P+e.F*!t("./_strict-method")([].map,!0),"Array",{map:function t(e){return r(this,e,arguments[1])}})}],"es6.array.filter.js":["./_export","./_array-methods","./_strict-method",function(t){"use strict";var e=t("./_export"),r=t("./_array-methods")(2);e(e.P+e.F*!t("./_strict-method")([].filter,!0),"Array",{filter:function t(e){return r(this,e,arguments[1])}})}],"es6.array.some.js":["./_export","./_array-methods","./_strict-method",function(t){"use strict";var e=t("./_export"),r=t("./_array-methods")(3);e(e.P+e.F*!t("./_strict-method")([].some,!0),"Array",{some:function t(e){return r(this,e,arguments[1])}})}],"es6.array.every.js":["./_export","./_array-methods","./_strict-method",function(t){"use strict";var e=t("./_export"),r=t("./_array-methods")(4);e(e.P+e.F*!t("./_strict-method")([].every,!0),"Array",{every:function t(e){return r(this,e,arguments[1])}})}],"es6.array.reduce.js":["./_export","./_array-reduce","./_strict-method",function(t){"use strict";var e=t("./_export"),r=t("./_array-reduce");e(e.P+e.F*!t("./_strict-method")([].reduce,!0),"Array",{reduce:function t(e){return r(this,e,arguments.length,arguments[1],!1)}})}],"_array-reduce.js":["./_a-function","./_to-object","./_iobject","./_to-length",function(t,e,r){var o=t("./_a-function"),n=t("./_to-object"),s=t("./_iobject"),i=t("./_to-length");r.exports=function(t,e,r,c,u){o(e);var a=n(t),_=s(a),f=i(a.length),l=u?f-1:0,d=u?-1:1;if(r<2)for(;;){if(l in _){c=_[l],l+=d;break}if(l+=d,u?l<0:f<=l)throw TypeError("Reduce of empty array with no initial value")}for(;u?l>=0:f>l;l+=d)l in _&&(c=e(c,_[l],l,a));return c}}],"es6.array.reduce-right.js":["./_export","./_array-reduce","./_strict-method",function(t){"use strict";var e=t("./_export"),r=t("./_array-reduce");e(e.P+e.F*!t("./_strict-method")([].reduceRight,!0),"Array",{reduceRight:function t(e){return r(this,e,arguments.length,arguments[1],!0)}})}],"es6.array.index-of.js":["./_export","./_array-includes","./_strict-method",function(t){"use strict";var e=t("./_export"),r=t("./_array-includes")(!1),o=[].indexOf,n=!!o&&1/[1].indexOf(1,-0)<0;e(e.P+e.F*(n||!t("./_strict-method")(o)),"Array",{indexOf:function t(e){return n?o.apply(this,arguments)||0:r(this,e,arguments[1])}})}],"es6.array.last-index-of.js":["./_export","./_to-iobject","./_to-integer","./_to-length","./_strict-method",function(t){"use strict";var e=t("./_export"),r=t("./_to-iobject"),o=t("./_to-integer"),n=t("./_to-length"),s=[].lastIndexOf,i=!!s&&1/[1].lastIndexOf(1,-0)<0;e(e.P+e.F*(i||!t("./_strict-method")(s)),"Array",{lastIndexOf:function t(e){if(i)return s.apply(this,arguments)||0;var c=r(this),u=n(c.length),a=u-1;for(arguments.length>1&&(a=Math.min(a,o(arguments[1]))),a<0&&(a=u+a);a>=0;a--)if(a in c&&c[a]===e)return a||0;return-1}})}],"es6.array.copy-within.js":["./_export","./_array-copy-within","./_add-to-unscopables",function(t){var e=t("./_export");e(e.P,"Array",{copyWithin:t("./_array-copy-within")}),t("./_add-to-unscopables")("copyWithin")}],"_array-copy-within.js":["./_to-object","./_to-index","./_to-length",function(t,e,r){"use strict";var o=t("./_to-object"),n=t("./_to-index"),s=t("./_to-length");r.exports=[].copyWithin||function t(e,r){var i=o(this),c=s(i.length),u=n(e,c),a=n(r,c),_=arguments.length>2?arguments[2]:void 0,f=Math.min((void 0===_?c:n(_,c))-a,c-u),l=1;for(a<u&&u<a+f&&(l=-1,a+=f-1,u+=f-1);f-- >0;)a in i?i[u]=i[a]:delete i[u],u+=l,a+=l;return i}}],"_add-to-unscopables.js":["./_wks","./_hide",function(t,e,r){var o=t("./_wks")("unscopables"),n=Array.prototype;void 0==n[o]&&t("./_hide")(n,o,{}),r.exports=function(t){n[o][t]=!0}}],"es6.array.fill.js":["./_export","./_array-fill","./_add-to-unscopables",function(t){var e=t("./_export");e(e.P,"Array",{fill:t("./_array-fill")}),t("./_add-to-unscopables")("fill")}],"_array-fill.js":["./_to-object","./_to-index","./_to-length",function(t,e,r){"use strict";var o=t("./_to-object"),n=t("./_to-index"),s=t("./_to-length");r.exports=function t(e){for(var r=o(this),i=s(r.length),c=arguments.length,u=n(c>1?arguments[1]:void 0,i),a=c>2?arguments[2]:void 0,_=void 0===a?i:n(a,i);_>u;)r[u++]=e;return r}}],"es6.array.find.js":["./_export","./_array-methods","./_add-to-unscopables",function(t){"use strict";var e=t("./_export"),r=t("./_array-methods")(5),o="find",n=!0;o in[]&&Array(1)[o](function(){n=!1}),e(e.P+e.F*n,"Array",{find:function t(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}}),t("./_add-to-unscopables")(o)}],"es6.array.find-index.js":["./_export","./_array-methods","./_add-to-unscopables",function(t){"use strict";var e=t("./_export"),r=t("./_array-methods")(6),o="findIndex",n=!0;o in[]&&Array(1)[o](function(){n=!1}),e(e.P+e.F*n,"Array",{findIndex:function t(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}}),t("./_add-to-unscopables")(o)}],"es6.array.species.js":["./_set-species",function(t){t("./_set-species")("Array")}],"_set-species.js":["./_global","./_object-dp","./_descriptors","./_wks",function(t,e,r){"use strict";var o=t("./_global"),n=t("./_object-dp"),s=t("./_descriptors"),i=t("./_wks")("species");r.exports=function(t){var e=o[t];s&&e&&!e[i]&&n.f(e,i,{configurable:!0,get:function(){return this}})}}],"es6.array.iterator.js":["./_add-to-unscopables","./_iter-step","./_iterators","./_to-iobject","./_iter-define",function(t,e,r){"use strict";var o=t("./_add-to-unscopables"),n=t("./_iter-step"),s=t("./_iterators"),i=t("./_to-iobject");r.exports=t("./_iter-define")(Array,"Array",function(t,e){this._t=i(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,r=this._i++;return!t||r>=t.length?(this._t=void 0,n(1)):"keys"==e?n(0,r):"values"==e?n(0,t[r]):n(0,[r,t[r]])},"values"),s.Arguments=s.Array,o("keys"),o("values"),o("entries")}],"_iter-step.js":function(t,e,r){r.exports=function(t,e){return{value:e,done:!!t}}},"es6.string.from-code-point.js":["./_export","./_to-index",function(t){var e=t("./_export"),r=t("./_to-index"),o=String.fromCharCode,n=String.fromCodePoint;e(e.S+e.F*(!!n&&1!=n.length),"String",{fromCodePoint:function t(e){for(var n=[],s=arguments.length,i=0,c;s>i;){if(c=+arguments[i++],r(c,1114111)!==c)throw RangeError(c+" is not a valid code point");n.push(c<65536?o(c):o(((c-=65536)>>10)+55296,c%1024+56320))}return n.join("")}})}],"es6.string.raw.js":["./_export","./_to-iobject","./_to-length",function(t){var e=t("./_export"),r=t("./_to-iobject"),o=t("./_to-length");e(e.S,"String",{raw:function t(e){for(var n=r(e.raw),s=o(n.length),i=arguments.length,c=[],u=0;s>u;)c.push(String(n[u++])),u<i&&c.push(String(arguments[u]));return c.join("")}})}],"es6.string.trim.js":["./_string-trim",function(t){"use strict";t("./_string-trim")("trim",function(t){return function e(){return t(this,3)}})}],"_string-trim.js":["./_export","./_defined","./_fails","./_string-ws",function(t,e,r){var o=t("./_export"),n=t("./_defined"),s=t("./_fails"),i=t("./_string-ws"),c="["+i+"]",u="…",a=RegExp("^"+c+c+"*"),_=RegExp(c+c+"*$"),f=function(t,e,r){var n={},c=s(function(){return!!i[t]()||u[t]()!=u}),a=n[t]=c?e(l):i[t];r&&(n[r]=a),o(o.P+o.F*c,"String",n)},l=f.trim=function(t,e){return t=String(n(t)),1&e&&(t=t.replace(a,"")),2&e&&(t=t.replace(_,"")),t};r.exports=f}],"_string-ws.js":function(t,e,r){r.exports="\t\n\v\f\r    \u2028\u2029\ufeff"},"es6.string.code-point-at.js":["./_export","./_string-at",function(t){"use strict";var e=t("./_export"),r=t("./_string-at")(!1);e(e.P,"String",{codePointAt:function t(e){return r(this,e)}})}],"es6.string.ends-with.js":["./_export","./_to-length","./_string-context","./_fails-is-regexp",function(t){"use strict";var e=t("./_export"),r=t("./_to-length"),o=t("./_string-context"),n="endsWith",s=""[n];e(e.P+e.F*t("./_fails-is-regexp")(n),"String",{endsWith:function t(e){var i=o(this,e,n),c=arguments.length>1?arguments[1]:void 0,u=r(i.length),a=void 0===c?u:Math.min(r(c),u),_=String(e);return s?s.call(i,_,a):i.slice(a-_.length,a)===_}})}],"_string-context.js":["./_is-regexp","./_defined",function(t,e,r){var o=t("./_is-regexp"),n=t("./_defined");r.exports=function(t,e,r){if(o(e))throw TypeError("String#"+r+" doesn't accept regex!");return String(n(t))}}],"_is-regexp.js":["./_is-object","./_cof","./_wks",function(t,e,r){var o=t("./_is-object"),n=t("./_cof"),s=t("./_wks")("match");r.exports=function(t){var e;return o(t)&&(void 0!==(e=t[s])?!!e:"RegExp"==n(t))}}],"_fails-is-regexp.js":["./_wks",function(t,e,r){var o=t("./_wks")("match");r.exports=function(t){var e=/./;try{"/./"[t](e)}catch(r){try{return e[o]=!1,!"/./"[t](e)}catch(t){}}return!0}}],"es6.string.includes.js":["./_export","./_string-context","./_fails-is-regexp",function(t){"use strict";var e=t("./_export"),r=t("./_string-context"),o="includes";e(e.P+e.F*t("./_fails-is-regexp")(o),"String",{includes:function t(e){return!!~r(this,e,o).indexOf(e,arguments.length>1?arguments[1]:void 0)}})}],"es6.string.repeat.js":["./_export","./_string-repeat",function(t){var e=t("./_export");e(e.P,"String",{repeat:t("./_string-repeat")})}],"_string-repeat.js":["./_to-integer","./_defined",function(t,e,r){"use strict";var o=t("./_to-integer"),n=t("./_defined");r.exports=function t(e){var r=String(n(this)),s="",i=o(e);if(i<0||i==1/0)throw RangeError("Count can't be negative");for(;i>0;(i>>>=1)&&(r+=r))1&i&&(s+=r);return s}}],"es6.string.starts-with.js":["./_export","./_to-length","./_string-context","./_fails-is-regexp",function(t){"use strict";var e=t("./_export"),r=t("./_to-length"),o=t("./_string-context"),n="startsWith",s=""[n];e(e.P+e.F*t("./_fails-is-regexp")(n),"String",{startsWith:function t(e){var i=o(this,e,n),c=r(Math.min(arguments.length>1?arguments[1]:void 0,i.length)),u=String(e);return s?s.call(i,u,c):i.slice(c,c+u.length)===u}})}],"es6.string.anchor.js":["./_string-html",function(t){"use strict";t("./_string-html")("anchor",function(t){return function e(r){return t(this,"a","name",r)}})}],"_string-html.js":["./_export","./_fails","./_defined",function(t,e,r){var o=t("./_export"),n=t("./_fails"),s=t("./_defined"),i=/"/g,c=function(t,e,r,o){var n=String(s(t)),c="<"+e;return""!==r&&(c+=" "+r+'="'+String(o).replace(i,"&quot;")+'"'),c+">"+n+"</"+e+">"};r.exports=function(t,e){var r={};r[t]=e(c),o(o.P+o.F*n(function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3}),"String",r)}}],"es6.string.big.js":["./_string-html",function(t){"use strict";t("./_string-html")("big",function(t){return function e(){return t(this,"big","","")}})}],"es6.string.blink.js":["./_string-html",function(t){"use strict";t("./_string-html")("blink",function(t){return function e(){return t(this,"blink","","")}})}],"es6.string.bold.js":["./_string-html",function(t){"use strict";t("./_string-html")("bold",function(t){return function e(){return t(this,"b","","")}})}],"es6.string.fixed.js":["./_string-html",function(t){"use strict";t("./_string-html")("fixed",function(t){return function e(){return t(this,"tt","","")}})}],"es6.string.fontcolor.js":["./_string-html",function(t){"use strict";t("./_string-html")("fontcolor",function(t){return function e(r){return t(this,"font","color",r)}})}],"es6.string.fontsize.js":["./_string-html",function(t){"use strict";t("./_string-html")("fontsize",function(t){return function e(r){return t(this,"font","size",r)}})}],"es6.string.italics.js":["./_string-html",function(t){"use strict";t("./_string-html")("italics",function(t){return function e(){return t(this,"i","","")}})}],"es6.string.link.js":["./_string-html",function(t){"use strict";t("./_string-html")("link",function(t){return function e(r){return t(this,"a","href",r)}})}],"es6.string.small.js":["./_string-html",function(t){"use strict";t("./_string-html")("small",function(t){return function e(){return t(this,"small","","")}})}],"es6.string.strike.js":["./_string-html",function(t){"use strict";t("./_string-html")("strike",function(t){return function e(){return t(this,"strike","","")}})}],"es6.string.sub.js":["./_string-html",function(t){"use strict";t("./_string-html")("sub",function(t){return function e(){return t(this,"sub","","")}})}],"es6.string.sup.js":["./_string-html",function(t){"use strict";t("./_string-html")("sup",function(t){return function e(){return t(this,"sup","","")}})}],"es6.regexp.match.js":["./_fix-re-wks",function(t){t("./_fix-re-wks")("match",1,function(t,e,r){return[function r(o){"use strict";var n=t(this),s=void 0==o?void 0:o[e];return void 0!==s?s.call(o,n):new RegExp(o)[e](String(n))},r]})}],"_fix-re-wks.js":["./_hide","./_redefine","./_fails","./_defined","./_wks",function(t,e,r){"use strict";var o=t("./_hide"),n=t("./_redefine"),s=t("./_fails"),i=t("./_defined"),c=t("./_wks");r.exports=function(t,e,r){var u=c(t),a=r(i,u,""[t]),_=a[0],f=a[1];s(function(){var e={};return e[u]=function(){return 7},7!=""[t](e)})&&(n(String.prototype,t,_),o(RegExp.prototype,u,2==e?function(t,e){return f.call(t,this,e)}:function(t){return f.call(t,this)}))}}],"es6.regexp.replace.js":["./_fix-re-wks",function(t){t("./_fix-re-wks")("replace",2,function(t,e,r){return[function o(n,s){"use strict";var i=t(this),c=void 0==n?void 0:n[e];return void 0!==c?c.call(n,i,s):r.call(String(i),n,s)},r]})}],"es6.regexp.search.js":["./_fix-re-wks",function(t){t("./_fix-re-wks")("search",1,function(t,e,r){return[function r(o){"use strict";var n=t(this),s=void 0==o?void 0:o[e];return void 0!==s?s.call(o,n):new RegExp(o)[e](String(n))},r]})}],"es6.regexp.split.js":["./_fix-re-wks","./_is-regexp",function(t){t("./_fix-re-wks")("split",2,function(e,r,o){"use strict";var n=t("./_is-regexp"),s=o,i=[].push,c="split",u="length",a="lastIndex";if("c"=="abbc"[c](/(b)*/)[1]||4!="test"[c](/(?:)/,-1)[u]||2!="ab"[c](/(?:ab)*/)[u]||4!="."[c](/(.?)(.?)/)[u]||"."[c](/()()/)[u]>1||""[c](/.?/)[u]){var _=void 0===/()??/.exec("")[1];o=function(t,e){var r=String(this);if(void 0===t&&0===e)return[];if(!n(t))return s.call(r,t,e);var o=[],c=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),f=0,l=void 0===e?4294967295:e>>>0,d=new RegExp(t.source,c+"g"),p,j,g,b,m;for(_||(p=new RegExp("^"+d.source+"$(?!\\s)",c));(j=d.exec(r))&&(g=j.index+j[0][u],!(g>f&&(o.push(r.slice(f,j.index)),!_&&j[u]>1&&j[0].replace(p,function(){for(m=1;m<arguments[u]-2;m++)void 0===arguments[m]&&(j[m]=void 0)}),j[u]>1&&j.index<r[u]&&i.apply(o,j.slice(1)),b=j[0][u],f=g,o[u]>=l)));)d[a]===j.index&&d[a]++;return f===r[u]?!b&&d.test("")||o.push(""):o.push(r.slice(f)),o[u]>l?o.slice(0,l):o}}else"0"[c](void 0,0)[u]&&(o=function(t,e){return void 0===t&&0===e?[]:s.call(this,t,e)});return[function t(n,s){var i=e(this),c=void 0==n?void 0:n[r];return void 0!==c?c.call(n,i,s):o.call(String(i),n,s)},o]})}],"es6.function.bind.js":["./_export","./_bind",function(t){var e=t("./_export");e(e.P,"Function",{bind:t("./_bind")})}],"_bind.js":["./_a-function","./_is-object","./_invoke",function(t,e,r){"use strict";var o=t("./_a-function"),n=t("./_is-object"),s=t("./_invoke"),i=[].slice,c={},u=function(t,e,r){if(!(e in c)){for(var o=[],n=0;n<e;n++)o[n]="a["+n+"]";c[e]=Function("F,a","return new F("+o.join(",")+")")}return c[e](t,r)};r.exports=Function.bind||function t(e){var r=o(this),c=i.call(arguments,1),a=function(){var t=c.concat(i.call(arguments));return this instanceof a?u(r,t.length,t):s(r,t,e)};return n(r.prototype)&&(a.prototype=r.prototype),a}}],"_invoke.js":function(t,e,r){r.exports=function(t,e,r){var o=void 0===r;switch(e.length){case 0:return o?t():t.call(r);case 1:return o?t(e[0]):t.call(r,e[0]);case 2:return o?t(e[0],e[1]):t.call(r,e[0],e[1]);case 3:return o?t(e[0],e[1],e[2]):t.call(r,e[0],e[1],e[2]);case 4:return o?t(e[0],e[1],e[2],e[3]):t.call(r,e[0],e[1],e[2],e[3])}return t.apply(r,e)}},"es6.function.name.js":["./_object-dp","./_property-desc","./_has","./_descriptors",function(t){var e=t("./_object-dp").f,r=t("./_property-desc"),o=t("./_has"),n=Function.prototype,s=/^\s*function ([^ (]*)/,i="name",c=Object.isExtensible||function(){return!0};i in n||t("./_descriptors")&&e(n,i,{configurable:!0,get:function(){try{var t=this,n=(""+t).match(s)[1];return o(t,i)||!c(t)||e(t,i,r(5,n)),n}catch(t){return""}}})}],"es6.function.has-instance.js":["./_is-object","./_object-gpo","./_wks","./_object-dp",function(t){"use strict";var e=t("./_is-object"),r=t("./_object-gpo"),o=t("./_wks")("hasInstance"),n=Function.prototype;o in n||t("./_object-dp").f(n,o,{value:function(t){if("function"!=typeof this||!e(t))return!1;if(!e(this.prototype))return t instanceof this;for(;t=r(t);)if(this.prototype===t)return!0;return!1}})}],"es7.array.includes.js":["./_export","./_array-includes","./_add-to-unscopables",function(t){"use strict";var e=t("./_export"),r=t("./_array-includes")(!0);e(e.P,"Array",{includes:function t(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}}),t("./_add-to-unscopables")("includes")}],"es7.object.values.js":["./_export","./_object-to-array",function(t){var e=t("./_export"),r=t("./_object-to-array")(!1);e(e.S,"Object",{values:function t(e){return r(e)}})}],"_object-to-array.js":["./_object-keys","./_to-iobject","./_object-pie",function(t,e,r){var o=t("./_object-keys"),n=t("./_to-iobject"),s=t("./_object-pie").f;r.exports=function(t){return function(e){for(var r=n(e),i=o(r),c=i.length,u=0,a=[],_;c>u;)s.call(r,_=i[u++])&&a.push(t?[_,r[_]]:r[_]);return a}}}],"es7.object.entries.js":["./_export","./_object-to-array",function(t){var e=t("./_export"),r=t("./_object-to-array")(!0);e(e.S,"Object",{entries:function t(e){return r(e)}})}],"es7.object.get-own-property-descriptors.js":["./_export","./_own-keys","./_to-iobject","./_object-gopd","./_create-property",function(t){var e=t("./_export"),r=t("./_own-keys"),o=t("./_to-iobject"),n=t("./_object-gopd"),s=t("./_create-property");e(e.S,"Object",{getOwnPropertyDescriptors:function t(e){for(var i=o(e),c=n.f,u=r(i),a={},_=0,f;u.length>_;)s(a,f=u[_++],c(i,f));return a}})}],"_own-keys.js":["./_object-gopn","./_object-gops","./_an-object","./_global",function(t,e,r){var o=t("./_object-gopn"),n=t("./_object-gops"),s=t("./_an-object"),i=t("./_global").Reflect;r.exports=i&&i.ownKeys||function t(e){var r=o.f(s(e)),i=n.f;return i?r.concat(i(e)):r}}],"es7.string.pad-start.js":["./_export","./_string-pad",function(t){"use strict";var e=t("./_export"),r=t("./_string-pad");e(e.P,"String",{padStart:function t(e){return r(this,e,arguments.length>1?arguments[1]:void 0,!0)}})}],"_string-pad.js":["./_to-length","./_string-repeat","./_defined",function(t,e,r){var o=t("./_to-length"),n=t("./_string-repeat"),s=t("./_defined");r.exports=function(t,e,r,i){var c=String(s(t)),u=c.length,a=void 0===r?" ":String(r),_=o(e);if(_<=u||""==a)return c;var f=_-u,l=n.call(a,Math.ceil(f/a.length));return l.length>f&&(l=l.slice(0,f)),i?l+c:c+l}}],"es7.string.pad-end.js":["./_export","./_string-pad",function(t){"use strict";var e=t("./_export"),r=t("./_string-pad");e(e.P,"String",{padEnd:function t(e){return r(this,e,arguments.length>1?arguments[1]:void 0,!1)}})}],"es7.string.trim-left.js":["./_string-trim",function(t){"use strict";t("./_string-trim")("trimLeft",function(t){return function e(){return t(this,1)}},"trimStart")}],"es7.string.trim-right.js":["./_string-trim",function(t){"use strict";t("./_string-trim")("trimRight",function(t){return function e(){return t(this,2)}},"trimEnd")}],"web.dom.iterable.js":["./es6.array.iterator","./_redefine","./_global","./_hide","./_iterators","./_wks",function(t){for(var e=t("./es6.array.iterator"),r=t("./_redefine"),o=t("./_global"),n=t("./_hide"),s=t("./_iterators"),i=t("./_wks"),c=i("iterator"),u=i("toStringTag"),a=s.Array,_=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],f=0;f<5;f++){var l=_[f],d=o[l],p=d&&d.prototype,j;if(p){p[c]||n(p,c,a),p[u]||n(p,u,l),s[l]=a;for(j in e)p[j]||r(p,j,e[j],!0)}}}],"es6.map.js":["./_collection-strong","./_collection",function(t,e,r){"use strict";var o=t("./_collection-strong");r.exports=t("./_collection")("Map",function(t){return function e(){return t(this,arguments.length>0?arguments[0]:void 0)}},{get:function t(e){var r=o.getEntry(this,e);return r&&r.v},set:function t(e,r){return o.def(this,0===e?0:e,r)}},o,!0)}],"_collection-strong.js":["./_object-dp","./_object-create","./_redefine-all","./_ctx","./_an-instance","./_defined","./_for-of","./_iter-define","./_iter-step","./_set-species","./_descriptors","./_meta",function(t,e,r){"use strict";var o=t("./_object-dp").f,n=t("./_object-create"),s=t("./_redefine-all"),i=t("./_ctx"),c=t("./_an-instance"),u=t("./_defined"),a=t("./_for-of"),_=t("./_iter-define"),f=t("./_iter-step"),l=t("./_set-species"),d=t("./_descriptors"),p=t("./_meta").fastKey,j=d?"_s":"size",g=function(t,e){var r=p(e),o;if("F"!==r)return t._i[r];for(o=t._f;o;o=o.n)if(o.k==e)return o};r.exports={getConstructor:function(t,e,r,_){var f=t(function(t,o){c(t,f,e,"_i"),t._i=n(null),t._f=void 0,t._l=void 0,t[j]=0,void 0!=o&&a(o,r,t[_],t)});return s(f.prototype,{clear:function t(){for(var e=this,r=e._i,o=e._f;o;o=o.n)o.r=!0,o.p&&(o.p=o.p.n=void 0),delete r[o.i];e._f=e._l=void 0,e[j]=0},delete:function(t){var e=this,r=g(e,t);if(r){var o=r.n,n=r.p;delete e._i[r.i],r.r=!0,n&&(n.n=o),o&&(o.p=n),e._f==r&&(e._f=o),e._l==r&&(e._l=n),e[j]--}return!!r},forEach:function t(e){c(this,f,"forEach");for(var r=i(e,arguments.length>1?arguments[1]:void 0,3),o;o=o?o.n:this._f;)for(r(o.v,o.k,this);o&&o.r;)o=o.p},has:function t(e){return!!g(this,e)}}),d&&o(f.prototype,"size",{get:function(){return u(this[j])}}),f},def:function(t,e,r){var o=g(t,e),n,s;return o?o.v=r:(t._l=o={i:s=p(e,!0),k:e,v:r,p:n=t._l,n:void 0,r:!1},t._f||(t._f=o),n&&(n.n=o),t[j]++,"F"!==s&&(t._i[s]=o)),t},getEntry:g,setStrong:function(t,e,r){_(t,e,function(t,e){this._t=t,this._k=e,this._l=void 0},function(){for(var t=this,e=t._k,r=t._l;r&&r.r;)r=r.p;return t._t&&(t._l=r=r?r.n:t._t._f)?"keys"==e?f(0,r.k):"values"==e?f(0,r.v):f(0,[r.k,r.v]):(t._t=void 0,f(1))},r?"entries":"values",!r,!0),l(e)}}}],"_redefine-all.js":["./_redefine",function(t,e,r){var o=t("./_redefine");r.exports=function(t,e,r){for(var n in e)o(t,n,e[n],r);return t}}],"_an-instance.js":function(t,e,r){r.exports=function(t,e,r,o){if(!(t instanceof e)||void 0!==o&&o in t)throw TypeError(r+": incorrect invocation!");return t}},"_for-of.js":["./_ctx","./_iter-call","./_is-array-iter","./_an-object","./_to-length","./core.get-iterator-method",function(t,e,r){var o=t("./_ctx"),n=t("./_iter-call"),s=t("./_is-array-iter"),i=t("./_an-object"),c=t("./_to-length"),u=t("./core.get-iterator-method"),a={},_={},e=r.exports=function(t,e,r,f,l){var d=l?function(){return t}:u(t),p=o(r,f,e?2:1),j=0,g,b,m,h;if("function"!=typeof d)throw TypeError(t+" is not iterable!");if(s(d)){for(g=c(t.length);g>j;j++)if(h=e?p(i(b=t[j])[0],b[1]):p(t[j]),h===a||h===_)return h}else for(m=d.call(t);!(b=m.next()).done;)if(h=n(m,p,b.value,e),h===a||h===_)return h};e.BREAK=a,e.RETURN=_}],"_collection.js":["./_global","./_export","./_redefine","./_redefine-all","./_meta","./_for-of","./_an-instance","./_is-object","./_fails","./_iter-detect","./_set-to-string-tag","./_inherit-if-required",function(t,e,r){"use strict";var o=t("./_global"),n=t("./_export"),s=t("./_redefine"),i=t("./_redefine-all"),c=t("./_meta"),u=t("./_for-of"),a=t("./_an-instance"),_=t("./_is-object"),f=t("./_fails"),l=t("./_iter-detect"),d=t("./_set-to-string-tag"),p=t("./_inherit-if-required");r.exports=function(t,e,r,j,g,b){var m=o[t],h=m,y=g?"set":"add",v=h&&h.prototype,x={},w=function(t){var e=v[t];s(v,t,"delete"==t?function(t){return!(b&&!_(t))&&e.call(this,0===t?0:t)}:"has"==t?function t(r){return!(b&&!_(r))&&e.call(this,0===r?0:r)}:"get"==t?function t(r){return b&&!_(r)?void 0:e.call(this,0===r?0:r)}:"add"==t?function t(r){return e.call(this,0===r?0:r),this}:function t(r,o){return e.call(this,0===r?0:r,o),this})};if("function"==typeof h&&(b||v.forEach&&!f(function(){(new h).entries().next()}))){var k=new h,S=k[y](b?{}:-0,1)!=k,O=f(function(){k.has(1)}),P=l(function(t){new h(t)}),E=!b&&f(function(){for(var t=new h,e=5;e--;)t[y](e,e);return!t.has(-0)});P||(h=e(function(e,r){a(e,h,t);var o=p(new m,e,h);return void 0!=r&&u(r,g,o[y],o),o}),h.prototype=v,v.constructor=h),(O||E)&&(w("delete"),w("has"),g&&w("get")),(E||S)&&w(y),b&&v.clear&&delete v.clear}else h=j.getConstructor(e,t,g,y),i(h.prototype,r),c.NEED=!0;return d(h,t),x[t]=h,n(n.G+n.W+n.F*(h!=m),x),b||j.setStrong(h,t,g),h}}],"_inherit-if-required.js":["./_is-object","./_set-proto",function(t,e,r){var o=t("./_is-object"),n=t("./_set-proto").set;r.exports=function(t,e,r){var s,i=e.constructor;return i!==r&&"function"==typeof i&&(s=i.prototype)!==r.prototype&&o(s)&&n&&n(t,s),t}}],"es6.set.js":["./_collection-strong","./_collection",function(t,e,r){"use strict";var o=t("./_collection-strong");r.exports=t("./_collection")("Set",function(t){return function e(){return t(this,arguments.length>0?arguments[0]:void 0)}},{add:function t(e){return o.def(this,e=0===e?0:e,e)}},o)}]},fn:{array:{"includes.js":["../../modules/es7.array.includes","../../modules/_core",function(t,e,r){t("../../modules/es7.array.includes"),r.exports=t("../../modules/_core").Array.includes}]},object:{"values.js":["../../modules/es7.object.values","../../modules/_core",function(t,e,r){t("../../modules/es7.object.values"),r.exports=t("../../modules/_core").Object.values}],"entries.js":["../../modules/es7.object.entries","../../modules/_core",function(t,e,r){t("../../modules/es7.object.entries"),r.exports=t("../../modules/_core").Object.entries}],"get-own-property-descriptors.js":["../../modules/es7.object.get-own-property-descriptors","../../modules/_core",function(t,e,r){t("../../modules/es7.object.get-own-property-descriptors"),r.exports=t("../../modules/_core").Object.getOwnPropertyDescriptors}]},string:{"pad-start.js":["../../modules/es7.string.pad-start","../../modules/_core",function(t,e,r){t("../../modules/es7.string.pad-start"),r.exports=t("../../modules/_core").String.padStart}],"pad-end.js":["../../modules/es7.string.pad-end","../../modules/_core",function(t,e,r){t("../../modules/es7.string.pad-end"),r.exports=t("../../modules/_core").String.padEnd}],"trim-start.js":["../../modules/es7.string.trim-left","../../modules/_core",function(t,e,r){t("../../modules/es7.string.trim-left"),r.exports=t("../../modules/_core").String.trimLeft}],"trim-end.js":["../../modules/es7.string.trim-right","../../modules/_core",function(t,e,r){t("../../modules/es7.string.trim-right"),r.exports=t("../../modules/_core").String.trimRight}]}}}}}}}},{extensions:[".js",".json"]}),d=l("./node_modules/meteor/ecmascript-runtime/runtime.js");"undefined"==typeof Package&&(Package={}),function(t,e){for(var r in e)r in t||(t[r]=e[r])}(Package["ecmascript-runtime"]=d,{Symbol:c,Map:u,Set:a})}();
!function(){"undefined"==typeof Package&&(Package={}),Package["babel-compiler"]={}}();
!function(){"undefined"==typeof Package&&(Package={}),Package.ecmascript={}}();
!function(){var n=Package.meteor.Meteor,r=Package.meteor.global,e=Package.meteor.meteorEnv,a;(function(){for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r={},e=0;e<n.length;e++)r[n.charAt(e)]=e;a={},a.encode=function(n){if("string"==typeof n){var r=n;n=a.newBinary(r.length);for(var e=0;e<r.length;e++){var l=r.charCodeAt(e);if(l>255)throw new Error("Not ascii. Base64.encode can only take ascii strings.");n[e]=l}}for(var u=[],i=null,o=null,c=null,f=null,e=0;e<n.length;e++)switch(e%3){case 0:i=n[e]>>2&63,o=(3&n[e])<<4;break;case 1:o|=n[e]>>4&15,c=(15&n[e])<<2;break;case 2:c|=n[e]>>6&3,f=63&n[e],u.push(t(i)),u.push(t(o)),u.push(t(c)),u.push(t(f)),i=null,o=null,c=null,f=null}return null!=i&&(u.push(t(i)),u.push(t(o)),null==c?u.push("="):u.push(t(c)),null==f&&u.push("=")),u.join("")};var t=function(r){return n.charAt(r)},l=function(n){return"="===n?-1:r[n]};a.newBinary=function(n){if("undefined"==typeof Uint8Array||"undefined"==typeof ArrayBuffer){for(var r=[],e=0;e<n;e++)r.push(0);return r.$Uint8ArrayPolyfill=!0,r}return new Uint8Array(new ArrayBuffer(n))},a.decode=function(n){var r=Math.floor(3*n.length/4);"="==n.charAt(n.length-1)&&(r--,"="==n.charAt(n.length-2)&&r--);for(var e=a.newBinary(r),t=null,u=null,i=null,o=0,c=0;c<n.length;c++){var f=n.charAt(c),s=l(f);switch(c%4){case 0:if(s<0)throw new Error("invalid base64 string");t=s<<2;break;case 1:if(s<0)throw new Error("invalid base64 string");t|=s>>4,e[o++]=t,u=(15&s)<<4;break;case 2:s>=0&&(u|=s>>2,e[o++]=u,i=(3&s)<<6);break;case 3:s>=0&&(e[o++]=i|s)}}return e}}).call(this),"undefined"==typeof Package&&(Package={}),function(n,r){for(var e in r)e in n||(n[e]=r[e])}(Package.base64={},{Base64:a})}();
!function(){var n=Package.meteor.Meteor,e=Package.meteor.global,t=Package.meteor.meteorEnv,r=Package.underscore._,u=Package.base64.Base64,a,i;(function(){a={},i={};var e={};a.addType=function(n,t){if(r.has(e,n))throw new Error("Type "+n+" already present");e[n]=t};var t=function(n){return r.isNaN(n)||n===1/0||n===-(1/0)},o=[{matchJSONValue:function(n){return r.has(n,"$date")&&1===r.size(n)},matchObject:function(n){return n instanceof Date},toJSONValue:function(n){return{$date:n.getTime()}},fromJSONValue:function(n){return new Date(n.$date)}},{matchJSONValue:function(n){return r.has(n,"$InfNaN")&&1===r.size(n)},matchObject:t,toJSONValue:function(n){var e;return e=r.isNaN(n)?0:n===1/0?1:-1,{$InfNaN:e}},fromJSONValue:function(n){return n.$InfNaN/0}},{matchJSONValue:function(n){return r.has(n,"$binary")&&1===r.size(n)},matchObject:function(n){return"undefined"!=typeof Uint8Array&&n instanceof Uint8Array||n&&r.has(n,"$Uint8ArrayPolyfill")},toJSONValue:function(n){return{$binary:u.encode(n)}},fromJSONValue:function(n){return u.decode(n.$binary)}},{matchJSONValue:function(n){return r.has(n,"$escape")&&1===r.size(n)},matchObject:function(n){return!(r.isEmpty(n)||r.size(n)>2)&&r.any(o,function(e){return e.matchJSONValue(n)})},toJSONValue:function(n){var e={};return r.each(n,function(n,t){e[t]=a.toJSONValue(n)}),{$escape:e}},fromJSONValue:function(n){var e={};return r.each(n.$escape,function(n,t){e[t]=a.fromJSONValue(n)}),e}},{matchJSONValue:function(n){return r.has(n,"$type")&&r.has(n,"$value")&&2===r.size(n)},matchObject:function(n){return a._isCustomType(n)},toJSONValue:function(e){var t=n._noYieldsAllowed(function(){return e.toJSONValue()});return{$type:e.typeName(),$value:t}},fromJSONValue:function(t){var u=t.$type;if(!r.has(e,u))throw new Error("Custom EJSON type "+u+" is not defined");var a=e[u];return n._noYieldsAllowed(function(){return a(t.$value)})}}];a._isCustomType=function(n){return n&&"function"==typeof n.toJSONValue&&"function"==typeof n.typeName&&r.has(e,n.typeName())},a._getTypes=function(){return e},a._getConverters=function(){return o};var f=a._adjustTypesToJSONValue=function(n){if(null===n)return null;var e=c(n);return void 0!==e?e:"object"!=typeof n?n:(r.each(n,function(e,r){if("object"==typeof e||void 0===e||t(e)){var u=c(e);return u?void(n[r]=u):void f(e)}}),n)},c=function(n){for(var e=0;e<o.length;e++){var t=o[e];if(t.matchObject(n))return t.toJSONValue(n)}};a.toJSONValue=function(n){var e=c(n);return void 0!==e?e:("object"==typeof n&&(n=a.clone(n),f(n)),n)};var l=a._adjustTypesFromJSONValue=function(n){if(null===n)return null;var e=s(n);return e!==n?e:"object"!=typeof n?n:(r.each(n,function(e,t){if("object"==typeof e){var r=s(e);if(e!==r)return void(n[t]=r);l(e)}}),n)},s=function(n){if("object"==typeof n&&null!==n&&r.size(n)<=2&&r.all(n,function(n,e){return"string"==typeof e&&"$"===e.substr(0,1)}))for(var e=0;e<o.length;e++){var t=o[e];if(t.matchJSONValue(n))return t.fromJSONValue(n)}return n};a.fromJSONValue=function(n){var e=s(n);return e===n&&"object"==typeof n?(n=a.clone(n),l(n),n):e},a.stringify=function(n,e){var t=a.toJSONValue(n);return e&&(e.canonical||e.indent)?a._canonicalStringify(t,e):JSON.stringify(t)},a.parse=function(n){if("string"!=typeof n)throw new Error("EJSON.parse argument should be a string");return a.fromJSONValue(JSON.parse(n))},a.isBinary=function(n){return!!("undefined"!=typeof Uint8Array&&n instanceof Uint8Array||n&&n.$Uint8ArrayPolyfill)},a.equals=function(n,e,t){var u,i=!(!t||!t.keyOrderSensitive);if(n===e)return!0;if(r.isNaN(n)&&r.isNaN(e))return!0;if(!n||!e)return!1;if("object"!=typeof n||"object"!=typeof e)return!1;if(n instanceof Date&&e instanceof Date)return n.valueOf()===e.valueOf();if(a.isBinary(n)&&a.isBinary(e)){if(n.length!==e.length)return!1;for(u=0;u<n.length;u++)if(n[u]!==e[u])return!1;return!0}if("function"==typeof n.equals)return n.equals(e,t);if("function"==typeof e.equals)return e.equals(n,t);if(n instanceof Array){if(!(e instanceof Array))return!1;if(n.length!==e.length)return!1;for(u=0;u<n.length;u++)if(!a.equals(n[u],e[u],t))return!1;return!0}switch(a._isCustomType(n)+a._isCustomType(e)){case 1:return!1;case 2:return a.equals(a.toJSONValue(n),a.toJSONValue(e))}var o;if(i){var f=[];return r.each(e,function(n,e){f.push(e)}),u=0,o=r.all(n,function(n,r){return!(u>=f.length)&&(r===f[u]&&(!!a.equals(n,e[f[u]],t)&&(u++,!0)))}),o&&u===f.length}return u=0,o=r.all(n,function(n,i){return!!r.has(e,i)&&(!!a.equals(n,e[i],t)&&(u++,!0))}),o&&r.size(e)===u},a.clone=function(n){var e;if("object"!=typeof n)return n;if(null===n)return null;if(n instanceof Date)return new Date(n.getTime());if(n instanceof RegExp)return n;if(a.isBinary(n)){e=a.newBinary(n.length);for(var t=0;t<n.length;t++)e[t]=n[t];return e}if(r.isArray(n)||r.isArguments(n)){for(e=[],t=0;t<n.length;t++)e[t]=a.clone(n[t]);return e}return"function"==typeof n.clone?n.clone():a._isCustomType(n)?a.fromJSONValue(a.clone(a.toJSONValue(n)),!0):(e={},r.each(n,function(n,t){e[t]=a.clone(n)}),e)},a.newBinary=u.newBinary}).call(this),function(){function n(n){return JSON.stringify(n)}var e=function(t,u,a,i,o){var f,c,l,s,y=i,h,N=u[t];switch(typeof N){case"string":return n(N);case"number":return isFinite(N)?String(N):"null";case"boolean":return String(N);case"object":if(!N)return"null";if(y=i+a,h=[],r.isArray(N)||r.isArguments(N)){for(s=N.length,f=0;f<s;f+=1)h[f]=e(f,N,a,y,o)||"null";return l=0===h.length?"[]":y?"[\n"+y+h.join(",\n"+y)+"\n"+i+"]":"["+h.join(",")+"]"}var p=r.keys(N);return o&&(p=p.sort()),r.each(p,function(t){l=e(t,N,a,y,o),l&&h.push(n(t)+(y?": ":":")+l)}),l=0===h.length?"{}":y?"{\n"+y+h.join(",\n"+y)+"\n"+i+"}":"{"+h.join(",")+"}"}};a._canonicalStringify=function(n,t){if(t=r.extend({indent:"",canonical:!1},t),t.indent===!0)t.indent=" ";else if("number"==typeof t.indent){for(var u="",a=0;a<t.indent;a++)u+=" ";t.indent=u}return e("",{"":n},t.indent,"",t.canonical)}}.call(this),"undefined"==typeof Package&&(Package={}),function(n,e){for(var t in e)t in n||(n[t]=e[t])}(Package.ejson={},{EJSON:a,EJSONTest:i})}();
!function(){var i=Package.meteor.Meteor,t=Package.meteor.global,a=Package.meteor.meteorEnv,n=Package.underscore._,e=Package.ejson.EJSON,r;(function(){r=function(i,t){var a=this;a._map={},a._idStringify=i||JSON.stringify,a._idParse=t||JSON.parse},n.extend(r.prototype,{get:function(i){var t=this,a=t._idStringify(i);return t._map[a]},set:function(i,t){var a=this,n=a._idStringify(i);a._map[n]=t},remove:function(i){var t=this,a=t._idStringify(i);delete t._map[a]},has:function(i){var t=this,a=t._idStringify(i);return n.has(t._map,a)},empty:function(){var i=this;return n.isEmpty(i._map)},clear:function(){var i=this;i._map={}},forEach:function(i){for(var t=this,a=n.keys(t._map),e=0;e<a.length;e++){var r=i.call(null,t._map[a[e]],t._idParse(a[e]));if(r===!1)return}},size:function(){var i=this;return n.size(i._map)},setDefault:function(i,t){var a=this,e=a._idStringify(i);return n.has(a._map,e)?a._map[e]:(a._map[e]=t,t)},clone:function(){var i=this,t=new r(i._idStringify,i._idParse);return i.forEach(function(i,a){t.set(a,e.clone(i))}),t}})}).call(this),"undefined"==typeof Package&&(Package={}),function(i,t){for(var a in t)a in i||(i[a]=t[a])}(Package["id-map"]={},{IdMap:r})}();
!function(){var t=Package.meteor.Meteor,e=Package.meteor.global,r=Package.meteor.meteorEnv,n=Package.underscore._,i;(function(){var t=function(t,e,r,n){return{key:t,value:e,next:r,prev:n}};i=function(){var t=this;t._dict={},t._first=null,t._last=null,t._size=0;var e=n.toArray(arguments);t._stringify=function(t){return t},"function"==typeof e[0]&&(t._stringify=e.shift()),n.each(e,function(e){t.putBefore(e[0],e[1],null)})},n.extend(i.prototype,{_k:function(t){return" "+this._stringify(t)},empty:function(){var t=this;return!t._first},size:function(){var t=this;return t._size},_linkEltIn:function(t){var e=this;t.next?(t.prev=t.next.prev,t.next.prev=t,t.prev&&(t.prev.next=t)):(t.prev=e._last,e._last&&(e._last.next=t),e._last=t),null!==e._first&&e._first!==t.next||(e._first=t)},_linkEltOut:function(t){var e=this;t.next&&(t.next.prev=t.prev),t.prev&&(t.prev.next=t.next),t===e._last&&(e._last=t.prev),t===e._first&&(e._first=t.next)},putBefore:function(e,r,n){var i=this;if(i._dict[i._k(e)])throw new Error("Item "+e+" already present in OrderedDict");var o=n?t(e,r,i._dict[i._k(n)]):t(e,r,null);if(void 0===o.next)throw new Error("could not find item to put this one before");i._linkEltIn(o),i._dict[i._k(e)]=o,i._size++},append:function(t,e){var r=this;r.putBefore(t,e,null)},remove:function(t){var e=this,r=e._dict[e._k(t)];if(void 0===r)throw new Error("Item "+t+" not present in OrderedDict");return e._linkEltOut(r),e._size--,delete e._dict[e._k(t)],r.value},get:function(t){var e=this;if(e.has(t))return e._dict[e._k(t)].value},has:function(t){var e=this;return n.has(e._dict,e._k(t))},forEach:function(t){for(var e=this,r=0,n=e._first;null!==n;){var o=t(n.value,n.key,r);if(o===i.BREAK)return;n=n.next,r++}},first:function(){var t=this;if(!t.empty())return t._first.key},firstValue:function(){var t=this;if(!t.empty())return t._first.value},last:function(){var t=this;if(!t.empty())return t._last.key},lastValue:function(){var t=this;if(!t.empty())return t._last.value},prev:function(t){var e=this;if(e.has(t)){var r=e._dict[e._k(t)];if(r.prev)return r.prev.key}return null},next:function(t){var e=this;if(e.has(t)){var r=e._dict[e._k(t)];if(r.next)return r.next.key}return null},moveBefore:function(t,e){var r=this,n=r._dict[r._k(t)],i=e?r._dict[r._k(e)]:null;if(void 0===n)throw new Error("Item to move is not present");if(void 0===i)throw new Error("Could not find element to move this one before");i!==n.next&&(r._linkEltOut(n),n.next=i,r._linkEltIn(n))},indexOf:function(t){var e=this,r=null;return e.forEach(function(n,o,f){if(e._k(o)===e._k(t))return r=f,i.BREAK}),r},_checkRep:function(){var t=this;n.each(t._dict,function(t,e){if(e.next===e)throw new Error("Next is a loop");if(e.prev===e)throw new Error("Prev is a loop")})}}),i.BREAK={break:!0}}).call(this),"undefined"==typeof Package&&(Package={}),function(t,e){for(var r in e)r in t||(t[r]=e[r])}(Package["ordered-dict"]={},{OrderedDict:i})}();
!function(){var n=Package.meteor.Meteor,t=Package.meteor.global,e=Package.meteor.meteorEnv,o,r;(function(){o={},o.active=!1,o.currentComputation=null;var t=function(n){o.currentComputation=n,o.active=!!n},e=function(){return"undefined"!=typeof n?n._debug:"undefined"!=typeof console&&console.error?function(){console.error.apply(console,arguments)}:function(){}},r=function(t){"undefined"!=typeof n&&n._suppressed_log_expected()&&n._suppress_log(t-1)},i=function(n,t){if(l)throw t;var o=["Exception from Tracker "+n+" function:"];if(t.stack&&t.message&&t.name){var i=t.stack.indexOf(t.message);if(i<0||i>t.name.length+2){var a=t.name+": "+t.message;o.push(a)}}o.push(t.stack),r(o.length);for(var u=0;u<o.length;u++)e()(o[u])},a=function(t){return"undefined"==typeof n||n.isClient?t:function(){var e=arguments;n._noYieldsAllowed(function(){t.apply(null,e)})}},u=1,c=[],p=!1,s=!1,f=!1,l=!1,d=[],h=function(){p||("undefined"!=typeof n?n._setImmediate(o._runFlush):setTimeout(o._runFlush,0),p=!0)},v=!1;o.Computation=function(n,t,e){if(!v)throw new Error("Tracker.Computation constructor is private; use Tracker.autorun");v=!1;var o=this;o.stopped=!1,o.invalidated=!1,o.firstRun=!0,o._id=u++,o._onInvalidateCallbacks=[],o._onStopCallbacks=[],o._parent=t,o._func=n,o._onError=e,o._recomputing=!1;var r=!0;try{o._compute(),r=!1}finally{o.firstRun=!1,r&&o.stop()}},o.Computation.prototype.onInvalidate=function(n){var t=this;if("function"!=typeof n)throw new Error("onInvalidate requires a function");t.invalidated?o.nonreactive(function(){a(n)(t)}):t._onInvalidateCallbacks.push(n)},o.Computation.prototype.onStop=function(n){var t=this;if("function"!=typeof n)throw new Error("onStop requires a function");t.stopped?o.nonreactive(function(){a(n)(t)}):t._onStopCallbacks.push(n)},o.Computation.prototype.invalidate=function(){var n=this;if(!n.invalidated){n._recomputing||n.stopped||(h(),c.push(this)),n.invalidated=!0;for(var t=0,e;e=n._onInvalidateCallbacks[t];t++)o.nonreactive(function(){a(e)(n)});n._onInvalidateCallbacks=[]}},o.Computation.prototype.stop=function(){var n=this;if(!n.stopped){n.stopped=!0,n.invalidate();for(var t=0,e;e=n._onStopCallbacks[t];t++)o.nonreactive(function(){a(e)(n)});n._onStopCallbacks=[]}},o.Computation.prototype._compute=function(){var n=this;n.invalidated=!1;var e=o.currentComputation;t(n);var r=f;f=!0;try{a(n._func)(n)}finally{t(e),f=r}},o.Computation.prototype._needsRecompute=function(){var n=this;return n.invalidated&&!n.stopped},o.Computation.prototype._recompute=function(){var n=this;n._recomputing=!0;try{if(n._needsRecompute())try{n._compute()}catch(t){n._onError?n._onError(t):i("recompute",t)}}finally{n._recomputing=!1}},o.Computation.prototype.flush=function(){var n=this;n._recomputing||n._recompute()},o.Computation.prototype.run=function(){var n=this;n.invalidate(),n.flush()},o.Dependency=function(){this._dependentsById={}},o.Dependency.prototype.depend=function(n){if(!n){if(!o.active)return!1;n=o.currentComputation}var t=this,e=n._id;return!(e in t._dependentsById)&&(t._dependentsById[e]=n,n.onInvalidate(function(){delete t._dependentsById[e]}),!0)},o.Dependency.prototype.changed=function(){var n=this;for(var t in n._dependentsById)n._dependentsById[t].invalidate()},o.Dependency.prototype.hasDependents=function(){var n=this;for(var t in n._dependentsById)return!0;return!1},o.flush=function(n){o._runFlush({finishSynchronously:!0,throwFirstError:n&&n._throwFirstError})},o._runFlush=function(n){if(s)throw new Error("Can't call Tracker.flush while flushing");if(f)throw new Error("Can't flush inside Tracker.autorun");n=n||{},s=!0,p=!0,l=!!n.throwFirstError;var t=0,e=!1;try{for(;c.length||d.length;){for(;c.length;){var r=c.shift();if(r._recompute(),r._needsRecompute()&&c.unshift(r),!n.finishSynchronously&&++t>1e3)return void(e=!0)}if(d.length){var a=d.shift();try{a()}catch(n){i("afterFlush",n)}}}e=!0}finally{if(e||(s=!1,o._runFlush({finishSynchronously:n.finishSynchronously,throwFirstError:!1})),p=!1,s=!1,c.length||d.length){if(n.finishSynchronously)throw new Error("still have more to do?");setTimeout(h,10)}}},o.autorun=function(n,t){if("function"!=typeof n)throw new Error("Tracker.autorun requires a function argument");t=t||{},v=!0;var e=new o.Computation(n,o.currentComputation,t.onError);return o.active&&o.onInvalidate(function(){e.stop()}),e},o.nonreactive=function(n){var e=o.currentComputation;t(null);try{return n()}finally{t(e)}},o.onInvalidate=function(n){if(!o.active)throw new Error("Tracker.onInvalidate requires a currentComputation");o.currentComputation.onInvalidate(n)},o.afterFlush=function(n){d.push(n),h()}}).call(this),function(){n.flush=o.flush,n.autorun=o.autorun,n.autosubscribe=o.autorun,o.depend=function(n){return n.depend()},r=o}.call(this),"undefined"==typeof Package&&(Package={}),function(n,t){for(var e in t)e in n||(n[e]=t[e])}(Package.tracker={},{Tracker:o,Deps:r})}();
!function(){var e=Package.meteor.Meteor,r=Package.meteor.global,n=Package.meteor.meteorEnv,t=Package.modules.meteorInstall,a=Package.modules.Buffer,o=Package.modules.process,i=Package.promise.Promise,l,u=t({node_modules:{meteor:{"babel-runtime":{"babel-runtime.js":["meteor-babel-helpers","babel-runtime/regenerator",function(e,r){r.meteorBabelHelpers=e("meteor-babel-helpers"),r.checkHelper=function e(r){return!1};try{var n=e("babel-runtime/regenerator")}catch(e){throw new Error(["The babel-runtime npm package could not be found in your node_modules ","directory. Please run the following command to install it:",""," meteor npm install --save babel-runtime",""].join("\n"))}if(n&&"function"==typeof i&&"function"==typeof i.asyncApply){var t=n.async;n.async=function(){return i.asyncApply(t,n,arguments)}}}],node_modules:{"meteor-babel-helpers":{"package.json":function(e,r){r.name="meteor-babel-helpers",r.version="0.0.3",r.main="index.js"},"index.js":function(e,r,n){function t(){var e={},r="t";try{Object.defineProperty(e,r,{enumerable:!1,value:e});for(var n in e)if(n===r)return!1}catch(e){return!1}return e[r]===e}function a(e){return e}function o(e){if(Array.isArray(e)){for(var r={},n=Object.keys(e),t=n.length,a=0;a<t;++a){var o=n[a];r[o]=e[o]}return r}return e}l=n.exports={sanitizeForInObject:t()?a:o,_sanitizeForInObjectHard:o}}}}}}}},{extensions:[".js",".json"]}),c=u("./node_modules/meteor/babel-runtime/babel-runtime.js");"undefined"==typeof Package&&(Package={}),function(e,r){for(var n in r)n in e||(e[n]=r[n])}(Package["babel-runtime"]=c,{meteorBabelHelpers:l})}();
!function(){var e=Package.meteor.Meteor,n=Package.meteor.global,r=Package.meteor.meteorEnv,t=Package.underscore._,o=Package.modules.meteorInstall,a=Package.modules.Buffer,i=Package.modules.process,d=Package["ecmascript-runtime"].Symbol,u=Package["ecmascript-runtime"].Map,c=Package["ecmascript-runtime"].Set,s=Package["babel-runtime"].meteorBabelHelpers,f=Package.promise.Promise,m,p=o({node_modules:{meteor:{random:{"random.js":function(n){function r(){return new d(d.Type.ALEA,{seeds:[new Date,u,c,s,Math.random()]})}if(e.isServer)var t=Npm.require("crypto");var o=function e(){function n(){var e=4022871197,n=function n(r){r=r.toString();for(var t=0;t<r.length;t++){e+=r.charCodeAt(t);var o=.02519603282416938*e;e=o>>>0,o-=e,o*=e,e=o>>>0,o-=e,e+=4294967296*o}return 2.3283064365386963e-10*(e>>>0)};return n.version="Mash 0.9",n}return function(e){var r=0,t=0,o=0,a=1;0==e.length&&(e=[+new Date]);var i=n();r=i(" "),t=i(" "),o=i(" ");for(var d=0;d<e.length;d++)r-=i(e[d]),r<0&&(r+=1),t-=i(e[d]),t<0&&(t+=1),o-=i(e[d]),o<0&&(o+=1);i=null;var u=function e(){var n=2091639*r+2.3283064365386963e-10*a;return r=t,t=o,o=n-(a=0|n)};return u.uint32=function(){return 4294967296*u()},u.fract53=function(){return u()+1.1102230246251565e-16*(2097152*u()|0)},u.version="Alea 0.9",u.args=e,u}(Array.prototype.slice.call(arguments))},a="23456789ABCDEFGHJKLMNPQRSTWXYZabcdefghijkmnopqrstuvwxyz",i="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_",d=function e(n,r){var t=this;if(t.type=n,!e.Type[n])throw new Error("Unknown random generator type: "+n);if(n===e.Type.ALEA){if(!r.seeds)throw new Error("No seeds were provided for Alea PRNG");t.alea=o.apply(null,r.seeds)}};d.Type={NODE_CRYPTO:"NODE_CRYPTO",BROWSER_CRYPTO:"BROWSER_CRYPTO",ALEA:"ALEA"},d.prototype.fraction=function(){var e=this;if(e.type===d.Type.ALEA)return e.alea();if(e.type===d.Type.NODE_CRYPTO){var n=parseInt(e.hexString(8),16);return 2.3283064365386963e-10*n}if(e.type===d.Type.BROWSER_CRYPTO){var r=new Uint32Array(1);return window.crypto.getRandomValues(r),2.3283064365386963e-10*r[0]}throw new Error("Unknown random generator type: "+e.type)},d.prototype.hexString=function(e){var n=this;if(n.type===d.Type.NODE_CRYPTO){var r=Math.ceil(e/2),o;try{o=t.randomBytes(r)}catch(e){o=t.pseudoRandomBytes(r)}var a=o.toString("hex");return a.substring(0,e)}return this._randomString(e,"0123456789abcdef")},d.prototype._randomString=function(e,n){for(var r=this,t=[],o=0;o<e;o++)t[o]=r.choice(n);return t.join("")},d.prototype.id=function(e){var n=this;return void 0===e&&(e=17),n._randomString(e,a)},d.prototype.secret=function(e){var n=this;return void 0===e&&(e=43),n._randomString(e,i)},d.prototype.choice=function(e){var n=Math.floor(this.fraction()*e.length);return"string"==typeof e?e.substr(n,1):e[n]};var u="undefined"!=typeof window&&window.innerHeight||"undefined"!=typeof document&&document.documentElement&&document.documentElement.clientHeight||"undefined"!=typeof document&&document.body&&document.body.clientHeight||1,c="undefined"!=typeof window&&window.innerWidth||"undefined"!=typeof document&&document.documentElement&&document.documentElement.clientWidth||"undefined"!=typeof document&&document.body&&document.body.clientWidth||1,s="undefined"!=typeof navigator&&navigator.userAgent||"";m=e.isServer?new d(d.Type.NODE_CRYPTO):"undefined"!=typeof window&&window.crypto&&window.crypto.getRandomValues?new d(d.Type.BROWSER_CRYPTO):r(),m.createWithSeeds=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];if(0===n.length)throw new Error("No seeds were provided");return new d(d.Type.ALEA,{seeds:n})},m.insecure=r()},"deprecated.js":function(){e.uuid=function(){for(var e="0123456789abcdef",n=[],r=0;r<36;r++)n[r]=m.choice(e);n[14]="4",n[19]=e.substr(3&parseInt(n[19],16)|8,1),n[8]=n[13]=n[18]=n[23]="-";var t=n.join("");return t}}}}}},{extensions:[".js",".json"]});p("./node_modules/meteor/random/random.js"),p("./node_modules/meteor/random/deprecated.js"),"undefined"==typeof Package&&(Package={}),function(e,n){for(var r in n)r in e||(e[r]=n[r])}(Package.random={},{Random:m})}();
!function(){var t=Package.meteor.Meteor,e=Package.meteor.global,r=Package.meteor.meteorEnv,o=Package.ejson.EJSON,n=Package["id-map"].IdMap,i=Package.random.Random,a;(function(){a={},a._looksLikeObjectID=function(t){return 24===t.length&&t.match(/^[0-9a-f]*$/)},a.ObjectID=function(t){var e=this;if(t){if(t=t.toLowerCase(),!a._looksLikeObjectID(t))throw new Error("Invalid hexadecimal string for creating an ObjectID");e._str=t}else e._str=i.hexString(24)},a.ObjectID.prototype.toString=function(){var t=this;return'ObjectID("'+t._str+'")'},a.ObjectID.prototype.equals=function(t){var e=this;return t instanceof a.ObjectID&&e.valueOf()===t.valueOf()},a.ObjectID.prototype.clone=function(){var t=this;return new a.ObjectID(t._str)},a.ObjectID.prototype.typeName=function(){return"oid"},a.ObjectID.prototype.getTimestamp=function(){var t=this;return parseInt(t._str.substr(0,8),16)},a.ObjectID.prototype.valueOf=a.ObjectID.prototype.toJSONValue=a.ObjectID.prototype.toHexString=function(){return this._str},o.addType("oid",function(t){return new a.ObjectID(t)}),a.idStringify=function(t){if(t instanceof a.ObjectID)return t.valueOf();if("string"==typeof t)return""===t?t:"-"===t.substr(0,1)||"~"===t.substr(0,1)||a._looksLikeObjectID(t)||"{"===t.substr(0,1)?"-"+t:t;if(void 0===t)return"-";if("object"==typeof t&&null!==t)throw new Error("Meteor does not currently support objects other than ObjectID as ids");return"~"+JSON.stringify(t)},a.idParse=function(t){return""===t?t:"-"===t?void 0:"-"===t.substr(0,1)?t.substr(1):"~"===t.substr(0,1)?JSON.parse(t.substr(1)):a._looksLikeObjectID(t)?new a.ObjectID(t):t}}).call(this),"undefined"==typeof Package&&(Package={}),function(t,e){for(var r in e)r in t||(t[r]=e[r])}(Package["mongo-id"]={},{MongoID:a})}();
!function(){var e=Package.meteor.Meteor,n=Package.meteor.global,d=Package.meteor.meteorEnv,i=Package.underscore._,a=Package.ejson.EJSON,r;(function(){r={},r.diffQueryChanges=function(e,n,d,i,a){e?r.diffQueryOrderedChanges(n,d,i,a):r.diffQueryUnorderedChanges(n,d,i,a)},r.diffQueryUnorderedChanges=function(e,n,d,o){o=o||{};var f=o.projectionFn||a.clone;if(d.movedBefore)throw new Error("_diffQueryUnordered called with a movedBefore observer!");n.forEach(function(n,o){var t=e.get(o);if(t){if(d.changed&&!a.equals(t,n)){var c=f(n),u=f(t),h=r.makeChangedFields(c,u);i.isEmpty(h)||d.changed(o,h)}}else if(d.added){var l=f(n);delete l._id,d.added(n._id,l)}}),d.removed&&e.forEach(function(e,i){n.has(i)||d.removed(i)})},r.diffQueryOrderedChanges=function(n,d,o,f){f=f||{};var t=f.projectionFn||a.clone,c={};i.each(d,function(n){c[n._id]&&e._debug("Duplicate _id in new_results"),c[n._id]=!0});var u={};i.each(n,function(n,d){n._id in u&&e._debug("Duplicate _id in old_results"),u[n._id]=d});for(var h=[],l=0,s=d.length,g=new Array(s),v=new Array(s),_=function(e){return u[d[e]._id]},m=0;m<s;m++)if(void 0!==u[d[m]._id]){for(var y=l;y>0&&!(_(g[y-1])<_(m));)y--;v[m]=0===y?-1:g[y-1],g[y]=m,y+1>l&&(l=y+1)}for(var k=0===l?-1:g[l-1];k>=0;)h.push(k),k=v[k];h.reverse(),h.push(d.length),i.each(n,function(e){c[e._id]||o.removed&&o.removed(e._id)});var p=0;i.each(h,function(e){for(var a=d[e]?d[e]._id:null,f,c,h,l,s,g=p;g<e;g++)c=d[g],i.has(u,c._id)?(f=n[u[c._id]],l=t(c),s=t(f),h=r.makeChangedFields(l,s),i.isEmpty(h)||o.changed&&o.changed(c._id,h),o.movedBefore&&o.movedBefore(c._id,a)):(h=t(c),delete h._id,o.addedBefore&&o.addedBefore(c._id,h,a),o.added&&o.added(c._id,h));a&&(c=d[e],f=n[u[c._id]],l=t(c),s=t(f),h=r.makeChangedFields(l,s),i.isEmpty(h)||o.changed&&o.changed(c._id,h)),p=e+1})},r.diffObjects=function(e,n,d){i.each(e,function(e,a){i.has(n,a)?d.both&&d.both(a,e,n[a]):d.leftOnly&&d.leftOnly(a,e)}),d.rightOnly&&i.each(n,function(n,a){i.has(e,a)||d.rightOnly(a,n)})},r.makeChangedFields=function(e,n){var d={};return r.diffObjects(n,e,{leftOnly:function(e,n){d[e]=void 0},rightOnly:function(e,n){d[e]=n},both:function(e,n,i){a.equals(n,i)||(d[e]=i)}}),d},r.applyChanges=function(e,n){i.each(n,function(n,d){void 0===n?delete e[d]:e[d]=n})}}).call(this),"undefined"==typeof Package&&(Package={}),function(e,n){for(var d in n)d in e||(e[d]=n[d])}(Package["diff-sequence"]={},{DiffSequence:r})}();
!function(){var n=Package.meteor.Meteor,t=Package.meteor.global,o=Package.meteor.meteorEnv,e=Package.modules.meteorInstall,a=Package.modules.Buffer,r=Package.modules.process,i,s=e({node_modules:{meteor:{"geojson-utils":{"main.js":["./geojson-utils.js",function(n,t){t.GeoJSON=n("./geojson-utils.js")}],"geojson-utils.js":function(n,t,o){!function(){function n(n){for(var t=[],o=[],e=0;e<n[0].length;e++)t.push(n[0][e][1]),o.push(n[0][e][0]);return t=t.sort(function(n,t){return n-t}),o=o.sort(function(n,t){return n-t}),[[t[0],o[0]],[t[t.length-1],o[o.length-1]]]}function t(n,t,o){for(var e=[[0,0]],a=0;a<o.length;a++){for(var r=0;r<o[a].length;r++)e.push(o[a][r]);e.push([0,0])}for(var i=!1,a=0,r=e.length-1;a<e.length;r=a++)e[a][0]>t!=e[r][0]>t&&n<(e[r][1]-e[a][1])*(t-e[a][0])/(e[r][0]-e[a][0])+e[a][1]&&(i=!i);return i}var e={};"undefined"!=typeof o&&o.exports&&(o.exports=e),e.lineStringsIntersect=function(n,t){for(var o=[],e=0;e<=n.coordinates.length-2;++e)for(var a=0;a<=t.coordinates.length-2;++a){var r={x:n.coordinates[e][1],y:n.coordinates[e][0]},i={x:n.coordinates[e+1][1],y:n.coordinates[e+1][0]},s={x:t.coordinates[a][1],y:t.coordinates[a][0]},c={x:t.coordinates[a+1][1],y:t.coordinates[a+1][0]},u=(c.x-s.x)*(r.y-s.y)-(c.y-s.y)*(r.x-s.x),h=(i.x-r.x)*(r.y-s.y)-(i.y-r.y)*(r.x-s.x),d=(c.y-s.y)*(i.x-r.x)-(c.x-s.x)*(i.y-r.y);if(0!=d){var l=u/d,g=h/d;0<=l&&l<=1&&0<=g&&g<=1&&o.push({type:"Point",coordinates:[r.x+l*(i.x-r.x),r.y+l*(i.y-r.y)]})}}return 0==o.length&&(o=!1),o},e.pointInBoundingBox=function(n,t){return!(n.coordinates[1]<t[0][0]||n.coordinates[1]>t[1][0]||n.coordinates[0]<t[0][1]||n.coordinates[0]>t[1][1])},e.pointInPolygon=function(o,a){for(var r="Polygon"==a.type?[a.coordinates]:a.coordinates,i=!1,s=0;s<r.length;s++)e.pointInBoundingBox(o,n(r[s]))&&(i=!0);if(!i)return!1;for(var c=!1,s=0;s<r.length;s++)t(o.coordinates[1],o.coordinates[0],r[s])&&(c=!0);return c},e.numberToRadius=function(n){return n*Math.PI/180},e.numberToDegree=function(n){return 180*n/Math.PI},e.drawCircle=function(n,t,o){for(var a=[t.coordinates[1],t.coordinates[0]],r=n/1e3/6371,i=[e.numberToRadius(a[0]),e.numberToRadius(a[1])],o=o||15,s=[[a[0],a[1]]],c=0;c<o;c++){var u=2*Math.PI*c/o,h=Math.asin(Math.sin(i[0])*Math.cos(r)+Math.cos(i[0])*Math.sin(r)*Math.cos(u)),d=i[1]+Math.atan2(Math.sin(u)*Math.sin(r)*Math.cos(i[0]),Math.cos(r)-Math.sin(i[0])*Math.sin(h));s[c]=[],s[c][1]=e.numberToDegree(h),s[c][0]=e.numberToDegree(d)}return{type:"Polygon",coordinates:[s]}},e.rectangleCentroid=function(n){var t=n.coordinates[0],o=t[0][0],e=t[0][1],a=t[2][0],r=t[2][1],i=a-o,s=r-e;return{type:"Point",coordinates:[o+i/2,e+s/2]}},e.pointDistance=function(n,t){var o=n.coordinates[0],a=n.coordinates[1],r=t.coordinates[0],i=t.coordinates[1],s=e.numberToRadius(i-a),c=e.numberToRadius(r-o),u=Math.pow(Math.sin(s/2),2)+Math.cos(e.numberToRadius(a))*Math.cos(e.numberToRadius(i))*Math.pow(Math.sin(c/2),2),h=2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u));return 6371*h*1e3},e.geometryWithinRadius=function(n,t,o){if("Point"==n.type)return e.pointDistance(n,t)<=o;if("LineString"==n.type||"Polygon"==n.type){var a={},r;r="Polygon"==n.type?n.coordinates[0]:n.coordinates;for(var i in r)if(a.coordinates=r[i],e.pointDistance(a,t)>o)return!1}return!0},e.area=function(n){for(var t=0,o=n.coordinates[0],e=o.length-1,a,r,i=0;i<o.length;e=i++){var a={x:o[i][1],y:o[i][0]},r={x:o[e][1],y:o[e][0]};t+=a.x*r.y,t-=a.y*r.x}return t/=2},e.centroid=function(n){for(var t,o=0,a=0,r=n.coordinates[0],i=r.length-1,s,c,u=0;u<r.length;i=u++){var s={x:r[u][1],y:r[u][0]},c={x:r[i][1],y:r[i][0]};t=s.x*c.y-c.x*s.y,o+=(s.x+c.x)*t,a+=(s.y+c.y)*t}return t=6*e.area(n),{type:"Point",coordinates:[a/t,o/t]}},e.simplify=function(n,t){t=t||20,n=n.map(function(n){return{lng:n.coordinates[0],lat:n.coordinates[1]}});var o,e,a,r,i,s,c,u,h,d,l,g,f,y,M,x,m,p,P,v=Math.PI/180*.5,b=new Array,T=new Array,j=new Array;if(n.length<3)return n;for(o=n.length,d=360*t/(2*Math.PI*6378137),d*=d,a=0,T[0]=0,j[0]=o-1,e=1;e>0;)if(r=T[e-1],i=j[e-1],e--,i-r>1){for(l=n[i].lng()-n[r].lng(),g=n[i].lat()-n[r].lat(),Math.abs(l)>180&&(l=360-Math.abs(l)),l*=Math.cos(v*(n[i].lat()+n[r].lat())),f=l*l+g*g,s=r+1,c=r,h=-1;s<i;s++)y=n[s].lng()-n[r].lng(),M=n[s].lat()-n[r].lat(),Math.abs(y)>180&&(y=360-Math.abs(y)),y*=Math.cos(v*(n[s].lat()+n[r].lat())),x=y*y+M*M,m=n[s].lng()-n[i].lng(),p=n[s].lat()-n[i].lat(),Math.abs(m)>180&&(m=360-Math.abs(m)),m*=Math.cos(v*(n[s].lat()+n[i].lat())),P=m*m+p*p,u=x>=f+P?P:P>=f+x?x:(y*g-M*l)*(y*g-M*l)/f,u>h&&(c=s,h=u);h<d?(b[a]=r,a++):(e++,T[e-1]=c,j[e-1]=i,e++,T[e-1]=r,j[e-1]=c)}else b[a]=r,a++;b[a]=o-1,a++;for(var I=new Array,s=0;s<a;s++)I.push(n[b[s]]);return I.map(function(n){return{type:"Point",coordinates:[n.lng,n.lat]}})},e.destinationPoint=function(n,t,o){o/=6371,t=e.numberToRadius(t);var a=e.numberToRadius(n.coordinates[0]),r=e.numberToRadius(n.coordinates[1]),i=Math.asin(Math.sin(a)*Math.cos(o)+Math.cos(a)*Math.sin(o)*Math.cos(t)),s=r+Math.atan2(Math.sin(t)*Math.sin(o)*Math.cos(a),Math.cos(o)-Math.sin(a)*Math.sin(i));return s=(s+3*Math.PI)%(2*Math.PI)-Math.PI,{type:"Point",coordinates:[e.numberToDegree(i),e.numberToDegree(s)]}}}()}}}}},{extensions:[".js",".json"]}),c=s("./node_modules/meteor/geojson-utils/main.js");"undefined"==typeof Package&&(Package={}),function(n,t){for(var o in t)o in n||(n[o]=t[o])}(Package["geojson-utils"]=c,{GeoJSON:i})}();
!function(){var e=Package.meteor.Meteor,r=Package.meteor.global,t=Package.meteor.meteorEnv,n=Package.underscore._,o=Package.ejson.EJSON,i=Package["id-map"].IdMap,a=Package["ordered-dict"].OrderedDict,s=Package.tracker.Tracker,c=Package.tracker.Deps,u=Package["mongo-id"].MongoID,d=Package.random.Random,f=Package["diff-sequence"].DiffSequence,l=Package["geojson-utils"].GeoJSON,h,p,v,_,m,y,g,w,$,b,E,I,C,O,k,S;(function(){h=function(r){var t=this;t.name=r,t._docs=new h._IdMap,t._observeQueue=new e._SynchronousQueue,t.next_qid=1,t.queries={},t._savedOriginals=null,t.paused=!1},p={},v={},_=function(e){var r=new Error(e);return r.name="MinimongoError",r},h.prototype.find=function(e,r){return 0===arguments.length&&(e={}),new h.Cursor(this,e,r)},h.Cursor=function(e,r,t){var n=this;t||(t={}),n.collection=e,n.sorter=null,n.matcher=new p.Matcher(r),h._selectorIsId(r)?n._selectorId=r:h._selectorIsIdPerhapsAsObject(r)?n._selectorId=r._id:(n._selectorId=void 0,(n.matcher.hasGeoQuery()||t.sort)&&(n.sorter=new p.Sorter(t.sort||[],{matcher:n.matcher}))),n.skip=t.skip,n.limit=t.limit,n.fields=t.fields,n._projectionFn=h._compileProjection(n.fields||{}),n._transform=h.wrapTransform(t.transform),"undefined"!=typeof s&&(n.reactive=void 0===t.reactive||t.reactive)},h.Cursor.prototype.rewind=function(){},h.prototype.findOne=function(e,r){return 0===arguments.length&&(e={}),r=r||{},r.limit=1,this.find(e,r).fetch()[0]},h.Cursor.prototype.forEach=function(e,r){var t=this,o=t._getRawObjects({ordered:!0});t.reactive&&t._depend({addedBefore:!0,removed:!0,changed:!0,movedBefore:!0}),n.each(o,function(n,o){n=t._projectionFn(n),t._transform&&(n=t._transform(n)),e.call(r,n,o,t)})},h.Cursor.prototype.getTransform=function(){return this._transform},h.Cursor.prototype.map=function(e,r){var t=this,n=[];return t.forEach(function(o,i){n.push(e.call(r,o,i,t))}),n},h.Cursor.prototype.fetch=function(){var e=this,r=[];return e.forEach(function(e){r.push(e)}),r},h.Cursor.prototype.count=function(){var e=this;return e.reactive&&e._depend({added:!0,removed:!0},!0),e._getRawObjects({ordered:!0}).length},h.Cursor.prototype._publishCursor=function(e){var r=this;if(!r.collection.name)throw new Error("Can't publish a cursor from a collection without a name.");var t=r.collection.name;if(!Package.mongo)throw new Error("Can't publish from Minimongo without the `mongo` package.");return Package.mongo.Mongo.Collection._publishCursor(r,e,t)},h.Cursor.prototype._getCollectionName=function(){var e=this;return e.collection.name},h._observeChangesCallbacksAreOrdered=function(e){if(e.added&&e.addedBefore)throw new Error("Please specify only one of added() and addedBefore()");return!(!e.addedBefore&&!e.movedBefore)},h._observeCallbacksAreOrdered=function(e){if(e.addedAt&&e.added)throw new Error("Please specify only one of added() and addedAt()");if(e.changedAt&&e.changed)throw new Error("Please specify only one of changed() and changedAt()");if(e.removed&&e.removedAt)throw new Error("Please specify only one of removed() and removedAt()");return!!(e.addedAt||e.movedTo||e.changedAt||e.removedAt)},h.ObserveHandle=function(){},n.extend(h.Cursor.prototype,{observe:function(e){var r=this;return h._observeFromObserveChanges(r,e)},observeChanges:function(e){var r=this,t=h._observeChangesCallbacksAreOrdered(e);if(!e._allow_unordered&&!t&&(r.skip||r.limit))throw new Error("must use ordered observe (ie, 'addedBefore' instead of 'added') with skip or limit");if(r.fields&&(0===r.fields._id||r.fields._id===!1))throw Error("You may not observe a cursor with {fields: {_id: 0}}");var i={dirty:!1,matcher:r.matcher,sorter:t&&r.sorter,distances:r.matcher.hasGeoQuery()&&t&&new h._IdMap,resultsSnapshot:null,ordered:t,cursor:r,projectionFn:r._projectionFn},a;r.reactive&&(a=r.collection.next_qid++,r.collection.queries[a]=i),i.results=r._getRawObjects({ordered:t,distances:i.distances}),r.collection.paused&&(i.resultsSnapshot=t?[]:new h._IdMap);var c=function(e){return e?function(){var t=this,n=arguments;r.collection.paused||r.collection._observeQueue.queueTask(function(){e.apply(t,n)})}:function(){}};if(i.added=c(e.added),i.changed=c(e.changed),i.removed=c(e.removed),t&&(i.addedBefore=c(e.addedBefore),i.movedBefore=c(e.movedBefore)),!e._suppress_initial&&!r.collection.paused){var u=t?n.bind(n.each,null,i.results):n.bind(i.results.forEach,i.results);u(function(e){var n=o.clone(e);delete n._id,t&&i.addedBefore(e._id,r._projectionFn(n),null),i.added(e._id,r._projectionFn(n))})}var d=new h.ObserveHandle;return n.extend(d,{collection:r.collection,stop:function(){r.reactive&&delete r.collection.queries[a]}}),r.reactive&&s.active&&s.onInvalidate(function(){d.stop()}),r.collection._observeQueue.drain(),d}}),h.Cursor.prototype._getRawObjects=function(e){var r=this;e=e||{};var t=e.ordered?[]:new h._IdMap;if(void 0!==r._selectorId){if(r.skip)return t;var n=r.collection._docs.get(r._selectorId);return n&&(e.ordered?t.push(n):t.set(r._selectorId,n)),t}var o;if(r.matcher.hasGeoQuery()&&e.ordered&&(e.distances?(o=e.distances,o.clear()):o=new h._IdMap),r.collection._docs.forEach(function(n,i){var a=r.matcher.documentMatches(n);return a.result&&(e.ordered?(t.push(n),o&&void 0!==a.distance&&o.set(i,a.distance)):t.set(i,n)),!(r.limit&&!r.skip&&!r.sorter&&t.length===r.limit)}),!e.ordered)return t;if(r.sorter){var i=r.sorter.getComparator({distances:o});t.sort(i)}var a=r.skip||0,s=r.limit?r.limit+a:t.length;return t.slice(a,s)},h.Cursor.prototype._depend=function(e,r){var t=this;if(s.active){var o=new s.Dependency;o.depend();var i=n.bind(o.changed,o),a={_suppress_initial:!0,_allow_unordered:r};n.each(["added","changed","removed","addedBefore","movedBefore"],function(r){e[r]&&(a[r]=i)}),t.observeChanges(a)}},h.prototype.insert=function(r,t){var i=this;r=o.clone(r),n.has(r,"_id")||(r._id=h._useOID?new u.ObjectID:d.id());var a=r._id;if(i._docs.has(a))throw _("Duplicate _id '"+a+"'");i._saveOriginal(a,void 0),i._docs.set(a,r);var s=[];for(var c in i.queries){var f=i.queries[c];if(!f.dirty){var l=f.matcher.documentMatches(r);l.result&&(f.distances&&void 0!==l.distance&&f.distances.set(a,l.distance),f.cursor.skip||f.cursor.limit?s.push(c):h._insertInResults(f,r))}}return n.each(s,function(e){i.queries[e]&&i._recomputeResults(i.queries[e])}),i._observeQueue.drain(),t&&e.defer(function(){t(null,a)}),a},h.prototype._eachPossiblyMatchingDoc=function(e,r){var t=this,n=h._idsMatchedBySelector(e);if(n)for(var o=0;o<n.length;++o){var i=n[o],a=t._docs.get(i);if(a){var s=r(a,i);if(s===!1)break}}else t._docs.forEach(r)},h.prototype.remove=function(r,t){var i=this;if(i.paused&&!i._savedOriginals&&o.equals(r,{})){var a=i._docs.size();return i._docs.clear(),n.each(i.queries,function(e){e.ordered?e.results=[]:e.results.clear()}),t&&e.defer(function(){t(null,a)}),a}var s=new p.Matcher(r),c=[];i._eachPossiblyMatchingDoc(r,function(e,r){s.documentMatches(e).result&&c.push(r)});for(var u=[],d=[],f=0;f<c.length;f++){var l=c[f],v=i._docs.get(l);n.each(i.queries,function(e,r){e.dirty||e.matcher.documentMatches(v).result&&(e.cursor.skip||e.cursor.limit?u.push(r):d.push({qid:r,doc:v}))}),i._saveOriginal(l,v),i._docs.remove(l)}return n.each(d,function(e){var r=i.queries[e.qid];r&&(r.distances&&r.distances.remove(e.doc._id),h._removeFromResults(r,e.doc))}),n.each(u,function(e){var r=i.queries[e];r&&i._recomputeResults(r)}),i._observeQueue.drain(),a=c.length,t&&e.defer(function(){t(null,a)}),a},h.prototype.update=function(r,t,i,a){var s=this;!a&&i instanceof Function&&(a=i,i=null),i||(i={});var c=new p.Matcher(r),u={},d=new h._IdMap,f=h._idsMatchedBySelector(r);n.each(s.queries,function(e,r){if((e.cursor.skip||e.cursor.limit)&&!s.paused){if(e.results instanceof h._IdMap)return void(u[r]=e.results.clone());if(!(e.results instanceof Array))throw new Error("Assertion failed: query.results not an array");var t=function(e){if(d.has(e._id))return d.get(e._id);var r;return r=f&&!n.any(f,function(r){return o.equals(r,e._id)})?e:o.clone(e),d.set(e._id,r),r};u[r]=e.results.map(t)}});var l={},v=0;s._eachPossiblyMatchingDoc(r,function(e,r){var n=c.documentMatches(e);return!(n.result&&(s._saveOriginal(r,e),s._modifyAndNotify(e,t,l,n.arrayIndices),++v,!i.multi))}),n.each(l,function(e,r){var t=s.queries[r];t&&s._recomputeResults(t,u[r])}),s._observeQueue.drain();var _;if(0===v&&i.upsert){var m=h._removeDollarOperators(r);h._modify(m,t,{isInsert:!0}),!m._id&&i.insertedId&&(m._id=i.insertedId),_=s.insert(m),v=1}var y;return i._returnObject?(y={numberAffected:v},void 0!==_&&(y.insertedId=_)):y=v,a&&e.defer(function(){a(null,y)}),y},h.prototype.upsert=function(e,r,t,o){var i=this;return o||"function"!=typeof t||(o=t,t={}),i.update(e,r,n.extend({},t,{upsert:!0,_returnObject:!0}),o)},h.prototype._modifyAndNotify=function(e,r,t,n){var i=this,a={};for(var s in i.queries){var c=i.queries[s];c.dirty||(c.ordered?a[s]=c.matcher.documentMatches(e).result:a[s]=c.results.has(e._id))}var u=o.clone(e);h._modify(e,r,{arrayIndices:n});for(s in i.queries)if(c=i.queries[s],!c.dirty){var d=a[s],f=c.matcher.documentMatches(e),l=f.result;l&&c.distances&&void 0!==f.distance&&c.distances.set(e._id,f.distance),c.cursor.skip||c.cursor.limit?(d||l)&&(t[s]=!0):d&&!l?h._removeFromResults(c,e):!d&&l?h._insertInResults(c,e):d&&l&&h._updateInResults(c,e,u)}},h._insertInResults=function(e,r){var t=o.clone(r);if(delete t._id,e.ordered){if(e.sorter){var n=h._insertInSortedList(e.sorter.getComparator({distances:e.distances}),e.results,r),i=e.results[n+1];i=i?i._id:null,e.addedBefore(r._id,e.projectionFn(t),i)}else e.addedBefore(r._id,e.projectionFn(t),null),e.results.push(r);e.added(r._id,e.projectionFn(t))}else e.added(r._id,e.projectionFn(t)),e.results.set(r._id,r)},h._removeFromResults=function(e,r){if(e.ordered){var t=h._findInOrderedResults(e,r);e.removed(r._id),e.results.splice(t,1)}else{var n=r._id;e.removed(r._id),e.results.remove(n)}},h._updateInResults=function(e,r,t){if(!o.equals(r._id,t._id))throw new Error("Can't change a doc's _id while updating");var i=e.projectionFn,a=f.makeChangedFields(i(r),i(t));if(!e.ordered)return void(n.isEmpty(a)||(e.changed(r._id,a),e.results.set(r._id,r)));var s=h._findInOrderedResults(e,r);if(n.isEmpty(a)||e.changed(r._id,a),e.sorter){e.results.splice(s,1);var c=h._insertInSortedList(e.sorter.getComparator({distances:e.distances}),e.results,r);if(s!==c){var u=e.results[c+1];u=u?u._id:null,e.movedBefore&&e.movedBefore(r._id,u)}}},h.prototype._recomputeResults=function(e,r){var t=this;return t.paused?void(e.dirty=!0):(t.paused||r||(r=e.results),e.distances&&e.distances.clear(),e.results=e.cursor._getRawObjects({ordered:e.ordered,distances:e.distances}),void(t.paused||h._diffQueryChanges(e.ordered,r,e.results,e,{projectionFn:e.projectionFn})))},h._findInOrderedResults=function(e,r){if(!e.ordered)throw new Error("Can't call _findInOrderedResults on unordered query");for(var t=0;t<e.results.length;t++)if(e.results[t]===r)return t;throw Error("object missing from query")},h._binarySearch=function(e,r,t){for(var n=0,o=r.length;o>0;){var i=Math.floor(o/2);e(t,r[n+i])>=0?(n+=i+1,o-=i+1):o=i}return n},h._insertInSortedList=function(e,r,t){if(0===r.length)return r.push(t),0;var n=h._binarySearch(e,r,t);return r.splice(n,0,t),n},h.prototype.saveOriginals=function(){var e=this;if(e._savedOriginals)throw new Error("Called saveOriginals twice without retrieveOriginals");e._savedOriginals=new h._IdMap},h.prototype.retrieveOriginals=function(){var e=this;if(!e._savedOriginals)throw new Error("Called retrieveOriginals without saveOriginals");var r=e._savedOriginals;return e._savedOriginals=null,r},h.prototype._saveOriginal=function(e,r){var t=this;t._savedOriginals&&(t._savedOriginals.has(e)||t._savedOriginals.set(e,o.clone(r)))},h.prototype.pauseObservers=function(){if(!this.paused){this.paused=!0;for(var e in this.queries){var r=this.queries[e];r.resultsSnapshot=o.clone(r.results)}}},h.prototype.resumeObservers=function(){var e=this;if(this.paused){this.paused=!1;for(var r in this.queries){var t=e.queries[r];t.dirty?(t.dirty=!1,e._recomputeResults(t,t.resultsSnapshot)):h._diffQueryChanges(t.ordered,t.resultsSnapshot,t.results,t,{projectionFn:t.projectionFn}),t.resultsSnapshot=null}e._observeQueue.drain()}}}).call(this),function(){h.wrapTransform=function(e){if(!e)return null;if(e.__wrappedTransform__)return e;var r=function(r){if(!n.has(r,"_id"))throw new Error("can only transform documents with _id");var t=r._id,i=s.nonreactive(function(){return e(r)});if(!y(i))throw new Error("transform must return object");if(n.has(i,"_id")){if(!o.equals(i._id,t))throw new Error("transformed document can't have different _id")}else i._id=t;return i};return r.__wrappedTransform__=!0,r}}.call(this),function(){m=function(e){return n.isArray(e)&&!o.isBinary(e)},y=h._isPlainObject=function(e){return e&&3===h._f._type(e)},g=function(e){return m(e)||y(e)},w=function(e,r){if(!y(e))return!1;var t=void 0;return n.each(e,function(n,o){var i="$"===o.substr(0,1);if(void 0===t)t=i;else if(t!==i){if(!r)throw new Error("Inconsistent operator: "+JSON.stringify(e));t=!1}}),!!t},$=function(e){return/^[0-9]+$/.test(e)}}.call(this),function(){p.Matcher=function(e){var r=this;r._paths={},r._hasGeoQuery=!1,r._hasWhere=!1,r._isSimple=!0,r._matchingDocument=void 0,r._selector=null,r._docMatcher=r._compileSelector(e)},n.extend(p.Matcher.prototype,{documentMatches:function(e){if(!e||"object"!=typeof e)throw Error("documentMatches needs a document");return this._docMatcher(e)},hasGeoQuery:function(){return this._hasGeoQuery},hasWhere:function(){return this._hasWhere},isSimple:function(){return this._isSimple},_compileSelector:function(r){var t=this;if(r instanceof Function)return t._isSimple=!1,t._selector=r,t._recordPathUsed(""),function(e){return{result:!!r.call(e)}};if(h._selectorIsId(r))return t._selector={_id:r},t._recordPathUsed("_id"),function(e){return{result:o.equals(e._id,r)}};if(!r||"_id"in r&&!r._id)return t._isSimple=!1,S;if("boolean"==typeof r||m(r)||o.isBinary(r))throw new Error("Invalid selector: "+r);return t._selector=o.clone(r),e(r,t,{isRoot:!0})},_recordPathUsed:function(e){this._paths[e]=!0},_getPaths:function(){return n.keys(this._paths)}});var e=function(e,t,o){o=o||{};var i=[];return n.each(e,function(e,a){if("$"===a.substr(0,1)){if(!n.has(s,a))throw new Error("Unrecognized logical operator: "+a);t._isSimple=!1,i.push(s[a](e,t,o.inElemMatch))}else{o.inElemMatch||t._recordPathUsed(a);var c=C(a),u=r(e,t,o.isRoot);i.push(function(e){var r=c(e);return u(r)})}}),j(i)},r=function(e,r,n){return e instanceof RegExp?(r._isSimple=!1,t(b(e))):w(e)?i(e,r,n):t(E(e))},t=function(e,r){return r=r||{},function(t){var o=t;r.dontExpandLeafArrays||(o=O(t,r.dontIncludeLeafArrays));var i={};return i.result=n.any(o,function(r){var t=e(r.value);return"number"==typeof t&&(r.arrayIndices||(r.arrayIndices=[t]),t=!0),t&&r.arrayIndices&&(i.arrayIndices=r.arrayIndices),t}),i}};b=function(e){return function(r){return r instanceof RegExp?n.isEqual(r,e):"string"==typeof r&&(e.lastIndex=0,e.test(r))}},E=function(e){if(w(e))throw Error("Can't create equalityValueSelector for operator object");return null==e?function(e){return null==e}:function(r){return h._f._equal(e,r)}};var i=function(e,r,o){var i=[];return n.each(e,function(a,s){var c=n.contains(["$lt","$lte","$gt","$gte"],s)&&n.isNumber(a),u=n.contains(["$ne","$eq"],s)&&!n.isObject(a),f=n.contains(["$in","$nin"],s)&&n.isArray(a)&&!n.any(a,n.isObject);if(c||f||u||(r._isSimple=!1),n.has(d,s))i.push(d[s](a,e,r,o));else{if(!n.has(I,s))throw new Error("Unrecognized operator: "+s);var l=I[s];i.push(t(l.compileElementSelector(a,e,r),l))}}),P(i)},a=function(r,t,o){if(!m(r)||n.isEmpty(r))throw Error("$and/$or/$nor must be nonempty array");return n.map(r,function(r){if(!y(r))throw Error("$or/$and/$nor entries need to be full objects");return e(r,t,{inElemMatch:o})})},s={$and:function(e,r,t){var n=a(e,r,t);return j(n)},$or:function(e,r,t){var o=a(e,r,t);return 1===o.length?o[0]:function(e){var r=n.any(o,function(r){return r(e).result});return{result:r}}},$nor:function(e,r,t){var o=a(e,r,t);return function(e){var r=n.all(o,function(r){return!r(e).result});return{result:r}}},$where:function(e,r){return r._recordPathUsed(""),r._hasWhere=!0,e instanceof Function||(e=Function("obj","return "+e)),function(r){return{result:e.call(r,r)}}},$comment:function(){return function(){return{result:!0}}}},c=function(e){return function(r){var t=e(r);return{result:!t.result}}},d={$eq:function(e){return t(E(e))},$not:function(e,t,n){return c(r(e,n))},$ne:function(e){return c(t(E(e)))},$nin:function(e){return c(t(I.$in.compileElementSelector(e)))},$exists:function(e){var r=t(function(e){return void 0!==e});return e?r:c(r)},$options:function(e,r){if(!n.has(r,"$regex"))throw Error("$options needs a $regex");return M},$maxDistance:function(e,r){if(!r.$near)throw Error("$maxDistance needs a $near");return M},$all:function(e,t,o){if(!m(e))throw Error("$all requires array");if(n.isEmpty(e))return S;var i=[];return n.each(e,function(e){if(w(e))throw Error("no $ expressions in $all");i.push(r(e,o))}),P(i)},$near:function(e,r,t,o){if(!o)throw Error("$near can't be inside another $ operator");t._hasGeoQuery=!0;var i,a,s;if(y(e)&&n.has(e,"$geometry"))i=e.$maxDistance,a=e.$geometry,s=function(e){return e&&e.type?"Point"===e.type?l.pointDistance(a,e):l.geometryWithinRadius(e,a,i)?0:i+1:null};else{if(i=r.$maxDistance,!m(e)&&!y(e))throw Error("$near argument must be coordinate pair or GeoJSON");a=_(e),s=function(e){return m(e)||y(e)?f(a,e):null}}return function(e){e=O(e);var r={result:!1};return n.each(e,function(e){var t=s(e.value);null===t||t>i||void 0!==r.distance&&r.distance<=t||(r.result=!0,r.distance=t,e.arrayIndices?r.arrayIndices=e.arrayIndices:delete r.arrayIndices)}),r}}},f=function(e,r){e=_(e),r=_(r);var t=e[0]-r[0],o=e[1]-r[1];return n.isNaN(t)||n.isNaN(o)?null:Math.sqrt(t*t+o*o)},_=function(e){return n.map(e,n.identity)},k=function(e){return{compileElementSelector:function(r){if(m(r))return function(){return!1};void 0===r&&(r=null);var t=h._f._type(r);return function(n){return void 0===n&&(n=null),h._f._type(n)===t&&e(h._f._cmp(n,r))}}}};I={$lt:k(function(e){return e<0}),$gt:k(function(e){return e>0}),$lte:k(function(e){return e<=0}),$gte:k(function(e){return e>=0}),$mod:{compileElementSelector:function(e){if(!m(e)||2!==e.length||"number"!=typeof e[0]||"number"!=typeof e[1])throw Error("argument to $mod must be an array of two numbers");var r=e[0],t=e[1];return function(e){return"number"==typeof e&&e%r===t}}},$in:{compileElementSelector:function(e){if(!m(e))throw Error("$in needs an array");var r=[];return n.each(e,function(e){if(e instanceof RegExp)r.push(b(e));else{if(w(e))throw Error("cannot nest $ under $in");r.push(E(e))}}),function(e){return void 0===e&&(e=null),n.any(r,function(r){return r(e)})}}},$size:{dontExpandLeafArrays:!0,compileElementSelector:function(e){if("string"==typeof e)e=0;else if("number"!=typeof e)throw Error("$size needs a number");return function(r){return m(r)&&r.length===e}}},$type:{dontIncludeLeafArrays:!0,compileElementSelector:function(e){if("number"!=typeof e)throw Error("$type needs a number");return function(r){return void 0!==r&&h._f._type(r)===e}}},$regex:{compileElementSelector:function(e,r){if(!("string"==typeof e||e instanceof RegExp))throw Error("$regex has to be a string or RegExp");var t;if(void 0!==r.$options){if(/[^gim]/.test(r.$options))throw new Error("Only the i, m, and g regexp options are supported");var n=e instanceof RegExp?e.source:e;t=new RegExp(n,r.$options)}else t=e instanceof RegExp?e:new RegExp(e);return b(t)}},$elemMatch:{dontExpandLeafArrays:!0,compileElementSelector:function(t,o,i){if(!y(t))throw Error("$elemMatch need an object");var a,c;return w(n.omit(t,n.keys(s)),!0)?(a=r(t,i),c=!1):(a=e(t,i,{inElemMatch:!0}),c=!0),function(e){if(!m(e))return!1;for(var r=0;r<e.length;++r){var t=e[r],n;if(c){if(!y(t)&&!m(t))return!1;n=t}else n=[{value:t,dontIterate:!0}];if(a(n).result)return r}return!1}}}},C=function(e,r){r=r||{};var t=e.split("."),o=t.length?t[0]:"",i=$(o),a=t.length>=2&&$(t[1]),s;t.length>1&&(s=C(t.slice(1).join(".")));var c=function(e){return e.dontIterate||delete e.dontIterate,e.arrayIndices&&!e.arrayIndices.length&&delete e.arrayIndices,e};return function(e,t){if(t||(t=[]),m(e)){if(!(i&&o<e.length))return[];t=t.concat(+o,"x")}var u=e[o];if(!s)return[c({value:u,dontIterate:m(e)&&m(u),arrayIndices:t})];if(!g(u))return m(e)?[]:[c({value:void 0,arrayIndices:t})];var d=[],f=function(e){Array.prototype.push.apply(d,e)};return f(s(u,t)),!m(u)||a&&r.forSort||n.each(u,function(e,r){y(e)&&f(s(e,t.concat(r)))}),d}},v.makeLookupFunction=C,O=function(e,r){var t=[];return n.each(e,function(e){var o=m(e.value);r&&o&&!e.dontIterate||t.push({value:e.value,arrayIndices:e.arrayIndices}),o&&!e.dontIterate&&n.each(e.value,function(r,n){t.push({value:r,arrayIndices:(e.arrayIndices||[]).concat(n)})})}),t};var S=function(e){return{result:!1}},M=function(e){return{result:!0}},A=function(e){return 0===e.length?M:1===e.length?e[0]:function(r){var t={};return t.result=n.all(e,function(e){var n=e(r);return n.result&&void 0!==n.distance&&void 0===t.distance&&(t.distance=n.distance),n.result&&n.arrayIndices&&(t.arrayIndices=n.arrayIndices),n.result}),t.result||(delete t.distance,delete t.arrayIndices),t}},j=A,P=A;h._f={_type:function(e){return"number"==typeof e?1:"string"==typeof e?2:"boolean"==typeof e?8:m(e)?4:null===e?10:e instanceof RegExp?11:"function"==typeof e?13:e instanceof Date?9:o.isBinary(e)?5:e instanceof u.ObjectID?7:3},_equal:function(e,r){return o.equals(e,r,{keyOrderSensitive:!0})},_typeorder:function(e){return[-1,1,2,3,4,5,-1,6,7,8,0,9,-1,100,2,100,1,8,1][e]},_cmp:function(e,r){if(void 0===e)return void 0===r?0:-1;if(void 0===r)return 1;var t=h._f._type(e),n=h._f._type(r),o=h._f._typeorder(t),i=h._f._typeorder(n);if(o!==i)return o<i?-1:1;if(t!==n)throw Error("Missing type coercion logic in _cmp");if(7===t&&(t=n=2,e=e.toHexString(),r=r.toHexString()),9===t&&(t=n=1,e=e.getTime(),r=r.getTime()),1===t)return e-r;if(2===n)return e<r?-1:e===r?0:1;if(3===t){var a=function(e){var r=[];for(var t in e)r.push(t),r.push(e[t]);return r};return h._f._cmp(a(e),a(r))}if(4===t)for(var s=0;;s++){if(s===e.length)return s===r.length?0:-1;if(s===r.length)return 1;var c=h._f._cmp(e[s],r[s]);if(0!==c)return c}if(5===t){if(e.length!==r.length)return e.length-r.length;for(s=0;s<e.length;s++){if(e[s]<r[s])return-1;if(e[s]>r[s])return 1}return 0}if(8===t)return e?r?0:1:r?-1:0;if(10===t)return 0;if(11===t)throw Error("Sorting not supported on regular expression");if(13===t)throw Error("Sorting not supported on Javascript code");throw Error("Unknown type to sort")}},h._removeDollarOperators=function(e){var r={};for(var t in e)"$"!==t.substr(0,1)&&(r[t]=e[t]);return r}}.call(this),function(){p.Sorter=function(r,t){var o=this;t=t||{},o._sortSpecParts=[],o._sortFunction=null;var i=function(e,r){if(!e)throw Error("sort keys must be non-empty");if("$"===e.charAt(0))throw Error("unsupported sort key: "+e);o._sortSpecParts.push({path:e,lookup:C(e,{forSort:!0}),ascending:r})};if(r instanceof Array)for(var a=0;a<r.length;a++)"string"==typeof r[a]?i(r[a],!0):i(r[a][0],"desc"!==r[a][1]);else if("object"==typeof r)n.each(r,function(e,r){i(r,e>=0)});else{if("function"!=typeof r)throw Error("Bad sort specification: "+JSON.stringify(r));o._sortFunction=r}if(!o._sortFunction){if(o.affectedByModifier){var s={};n.each(o._sortSpecParts,function(e){s[e.path]=1}),o._selectorForAffectedByModifier=new p.Matcher(s)}o._keyComparator=e(n.map(o._sortSpecParts,function(e,r){return o._keyFieldComparator(r)})),o._keyFilter=null,t.matcher&&o._useWithMatcher(t.matcher)}},n.extend(p.Sorter.prototype,{getComparator:function(r){var t=this;if(!r||!r.distances)return t._getBaseComparator();var n=r.distances;return e([t._getBaseComparator(),function(e,r){if(!n.has(e._id))throw Error("Missing distance for "+e._id);if(!n.has(r._id))throw Error("Missing distance for "+r._id);return n.get(e._id)-n.get(r._id)}])},_getPaths:function(){var e=this;return n.pluck(e._sortSpecParts,"path")},_getMinKeyFromDoc:function(e){var r=this,t=null;if(r._generateKeysFromDoc(e,function(e){if(r._keyCompatibleWithSelector(e))return null===t?void(t=e):void(r._compareKeys(e,t)<0&&(t=e))}),null===t)throw Error("sort selector found no keys in doc?");return t},_keyCompatibleWithSelector:function(e){var r=this;return!r._keyFilter||r._keyFilter(e)},_generateKeysFromDoc:function(e,r){var t=this;if(0===t._sortSpecParts.length)throw new Error("can't generate keys without a spec");var o=[],i=function(e){return e.join(",")+","},a=null;if(n.each(t._sortSpecParts,function(r,t){var s=O(r.lookup(e),!0);s.length||(s=[{value:null}]);var c=!1;if(o[t]={},n.each(s,function(e){if(!e.arrayIndices){if(s.length>1)throw Error("multiple branches but no array used?");return void(o[t][""]=e.value)}c=!0;var r=i(e.arrayIndices);if(n.has(o[t],r))throw Error("duplicate path: "+r);if(o[t][r]=e.value,a&&!n.has(a,r))throw Error("cannot index parallel arrays")}),a){if(!n.has(o[t],"")&&n.size(a)!==n.size(o[t]))throw Error("cannot index parallel arrays!")}else c&&(a={},n.each(o[t],function(e,r){a[r]=!0}))}),!a){var s=n.map(o,function(e){if(!n.has(e,""))throw Error("no value in sole key case?");return e[""]});return void r(s)}n.each(a,function(e,t){var i=n.map(o,function(e){if(n.has(e,""))return e[""];if(!n.has(e,t))throw Error("missing path?");return e[t]});r(i)})},_compareKeys:function(e,r){var t=this;if(e.length!==t._sortSpecParts.length||r.length!==t._sortSpecParts.length)throw Error("Key has wrong length");return t._keyComparator(e,r)},_keyFieldComparator:function(e){var r=this,t=!r._sortSpecParts[e].ascending;return function(r,n){var o=h._f._cmp(r[e],n[e]);return t&&(o=-o),o}},_getBaseComparator:function(){var e=this;return e._sortFunction?e._sortFunction:e._sortSpecParts.length?function(r,t){var n=e._getMinKeyFromDoc(r),o=e._getMinKeyFromDoc(t);return e._compareKeys(n,o)}:function(e,r){return 0}},_useWithMatcher:function(e){var r=this;if(r._keyFilter)throw Error("called _useWithMatcher twice?");if(!n.isEmpty(r._sortSpecParts)){var t=e._selector;if(!(t instanceof Function)){var o={};n.each(r._sortSpecParts,function(e,r){o[e.path]=[]}),n.each(t,function(e,r){var t=o[r];if(t){if(e instanceof RegExp){if(e.ignoreCase||e.multiline)return;return void t.push(b(e))}return w(e)?void n.each(e,function(r,o){n.contains(["$lt","$lte","$gt","$gte"],o)&&t.push(I[o].compileElementSelector(r)),"$regex"!==o||e.$options||t.push(I.$regex.compileElementSelector(r,e))}):void t.push(E(e))}}),n.isEmpty(o[r._sortSpecParts[0].path])||(r._keyFilter=function(e){return n.all(r._sortSpecParts,function(r,t){return n.all(o[r.path],function(r){return r(e[t])})})})}}}});var e=function(e){return function(r,t){for(var n=0;n<e.length;++n){var o=e[n](r,t);if(0!==o)return o}return 0}}}.call(this),function(){h._compileProjection=function(e){h._checkSupportedProjection(e);var r=!!n.isUndefined(e._id)||e._id,t=k(e),i=function(e,r){if(n.isArray(e))return n.map(e,function(e){return i(e,r)});var a=t.including?{}:o.clone(e);return n.each(r,function(r,s){n.has(e,s)&&(n.isObject(r)?n.isObject(e[s])&&(a[s]=i(e[s],r)):t.including?a[s]=o.clone(e[s]):delete a[s])}),a};return function(e){var o=i(e,t.tree);return r&&n.has(e,"_id")&&(o._id=e._id),!r&&n.has(o,"_id")&&delete o._id,o}},k=function(e){var r=n.keys(e).sort();!(r.length>0)||1===r.length&&"_id"===r[0]||n.contains(r,"_id")&&e._id||(r=n.reject(r,function(e){return"_id"===e}));var t=null;n.each(r,function(r){var n=!!e[r];if(null===t&&(t=n),t!==n)throw _("You cannot currently mix including and excluding fields.")});var o=S(r,function(e){return t},function(e,r,t){var n=t,o=r;throw _("both "+n+" and "+o+" found in fields option, using both of them may trigger unexpected behavior. Did you mean to use only one of them?")});return{tree:o,including:t}},S=function(e,r,t,o){return o=o||{},n.each(e,function(e){var i=o,a=e.split("."),s=n.all(a.slice(0,-1),function(r,o){if(n.has(i,r)){if(!n.isObject(i[r])&&(i[r]=t(i[r],a.slice(0,o+1).join("."),e),!n.isObject(i[r])))return!1}else i[r]={};return i=i[r],!0});if(s){var c=n.last(a);n.has(i,c)?i[c]=t(i[c],e,e):i[c]=r(e)}}),o},h._checkSupportedProjection=function(e){if(!n.isObject(e)||n.isArray(e))throw _("fields option must be an object");n.each(e,function(e,r){if(n.contains(r.split("."),"$"))throw _("Minimongo doesn't support $ operator in projections yet.");if("object"==typeof e&&n.intersection(["$elemMatch","$meta","$slice"],n.keys(e)).length>0)throw _("Minimongo doesn't support operators in projections yet.");if(n.indexOf([1,0,!0,!1],e)===-1)throw _("Projection values should be one of 1, 0, true, or false")})}}.call(this),function(){h._modify=function(i,a,s){if(s=s||{},!y(a))throw _("Modifier must be an object");a=o.clone(a);var c=w(a),u;if(c)u=o.clone(i),n.each(a,function(o,i){var a=t[i];if(s.isInsert&&"$setOnInsert"===i&&(a=t.$set),!a)throw _("Invalid modifier specified "+i);n.each(o,function(t,o){if(""===o)throw _("An empty update path is not valid.");if("_id"===o&&"$setOnInsert"!==i)throw _("Mod on _id not allowed");var c=o.split(".");if(!n.all(c,n.identity))throw _("The update path '"+o+"' contains an empty field name, which is not allowed.");var d=n.has(r,i),f="$rename"===i,l=e(u,c,{noCreate:r[i],forbidArray:"$rename"===i,arrayIndices:s.arrayIndices}),h=c.pop();a(l,h,t,o,u)})});else{if(a._id&&!o.equals(i._id,a._id))throw _("Cannot change the _id of a document");for(var d in a)if(/\./.test(d))throw _("When replacing document, field name may not contain '.'");u=a}n.each(n.keys(i),function(e){"_id"!==e&&delete i[e]}),n.each(u,function(e,r){i[r]=e})};var e=function(e,r,t){t=t||{};for(var n=!1,o=0;o<r.length;o++){var i=o===r.length-1,a=r[o],s=g(e);if(!s){if(t.noCreate)return;var c=_("cannot use the part '"+a+"' to traverse "+e);throw c.setPropertyError=!0,c}if(e instanceof Array){if(t.forbidArray)return null;if("$"===a){if(n)throw _("Too many positional (i.e. '$') elements");if(!t.arrayIndices||!t.arrayIndices.length)throw _("The positional operator did not find the match needed from the query");a=t.arrayIndices[0],n=!0}else{if(!$(a)){if(t.noCreate)return;throw _("can't append to array using string field name ["+a+"]")}a=parseInt(a)}if(i&&(r[o]=a),t.noCreate&&a>=e.length)return;for(;e.length<a;)e.push(null);if(!i)if(e.length===a)e.push({});else if("object"!=typeof e[a])throw _("can't modify field '"+r[o+1]+"' of list value "+JSON.stringify(e[a]))}else{if(a.length&&"$"===a.substr(0,1))throw _("can't set field named "+a);if(!(a in e)){if(t.noCreate)return;i||(e[a]={})}}if(i)return e;e=e[a]}},r={$unset:!0,$pop:!0,$rename:!0,$pull:!0,$pullAll:!0},t={$currentDate:function(e,r,t){if("object"==typeof t&&t.hasOwnProperty("$type")){if("date"!==t.$type)throw _("Minimongo does currently only support the date type in $currentDate modifiers")}else if(t!==!0)throw _("Invalid $currentDate modifier");e[r]=new Date},$min:function(e,r,t){if("number"!=typeof t)throw _("Modifier $min allowed for numbers only");if(r in e){if("number"!=typeof e[r])throw _("Cannot apply $min modifier to non-number");e[r]>t&&(e[r]=t)}else e[r]=t},$max:function(e,r,t){if("number"!=typeof t)throw _("Modifier $max allowed for numbers only");if(r in e){if("number"!=typeof e[r])throw _("Cannot apply $max modifier to non-number");e[r]<t&&(e[r]=t)}else e[r]=t},$inc:function(e,r,t){if("number"!=typeof t)throw _("Modifier $inc allowed for numbers only");if(r in e){if("number"!=typeof e[r])throw _("Cannot apply $inc modifier to non-number");e[r]+=t}else e[r]=t},$set:function(e,r,t){if(!n.isObject(e)){var o=_("Cannot set property on non-object field");throw o.setPropertyError=!0,o}if(null===e){var o=_("Cannot set property on null");throw o.setPropertyError=!0,o}e[r]=t},$setOnInsert:function(e,r,t){},$unset:function(e,r,t){void 0!==e&&(e instanceof Array?r in e&&(e[r]=null):delete e[r])},$push:function(e,r,t){if(void 0===e[r]&&(e[r]=[]),!(e[r]instanceof Array))throw _("Cannot apply $push modifier to non-array");if(!t||!t.$each)return void e[r].push(t);var n=t.$each;
if(!(n instanceof Array))throw _("$each must be an array");var o=void 0;if("$position"in t){if("number"!=typeof t.$position)throw _("$position must be a numeric value");if(t.$position<0)throw _("$position in $push must be zero or positive");o=t.$position}var i=void 0;if("$slice"in t){if("number"!=typeof t.$slice)throw _("$slice must be a numeric value");if(t.$slice>0)throw _("$slice in $push must be zero or negative");i=t.$slice}var a=void 0;if(t.$sort){if(void 0===i)throw _("$sort requires $slice to be present");a=new p.Sorter(t.$sort).getComparator();for(var s=0;s<n.length;s++)if(3!==h._f._type(n[s]))throw _("$push like modifiers using $sort require all elements to be objects")}if(void 0===o)for(var c=0;c<n.length;c++)e[r].push(n[c]);else{for(var u=[o,0],c=0;c<n.length;c++)u.push(n[c]);Array.prototype.splice.apply(e[r],u)}a&&e[r].sort(a),void 0!==i&&(0===i?e[r]=[]:e[r]=e[r].slice(i))},$pushAll:function(e,r,t){if(!("object"==typeof t&&t instanceof Array))throw _("Modifier $pushAll/pullAll allowed for arrays only");var n=e[r];if(void 0===n)e[r]=t;else{if(!(n instanceof Array))throw _("Cannot apply $pushAll modifier to non-array");for(var o=0;o<t.length;o++)n.push(t[o])}},$addToSet:function(e,r,t){var o=!1;if("object"==typeof t)for(var i in t){"$each"===i&&(o=!0);break}var a=o?t.$each:[t],s=e[r];if(void 0===s)e[r]=a;else{if(!(s instanceof Array))throw _("Cannot apply $addToSet modifier to non-array");n.each(a,function(e){for(var r=0;r<s.length;r++)if(h._f._equal(e,s[r]))return;s.push(e)})}},$pop:function(e,r,t){if(void 0!==e){var n=e[r];if(void 0!==n){if(!(n instanceof Array))throw _("Cannot apply $pop modifier to non-array");"number"==typeof t&&t<0?n.splice(0,1):n.pop()}}},$pull:function(e,r,t){if(void 0!==e){var n=e[r];if(void 0!==n){if(!(n instanceof Array))throw _("Cannot apply $pull/pullAll modifier to non-array");var o=[];if(null==t||"object"!=typeof t||t instanceof Array)for(var i=0;i<n.length;i++)h._f._equal(n[i],t)||o.push(n[i]);else for(var a=new p.Matcher(t),i=0;i<n.length;i++)a.documentMatches(n[i]).result||o.push(n[i]);e[r]=o}}},$pullAll:function(e,r,t){if(!("object"==typeof t&&t instanceof Array))throw _("Modifier $pushAll/pullAll allowed for arrays only");if(void 0!==e){var n=e[r];if(void 0!==n){if(!(n instanceof Array))throw _("Cannot apply $pull/pullAll modifier to non-array");for(var o=[],i=0;i<n.length;i++){for(var a=!1,s=0;s<t.length;s++)if(h._f._equal(n[i],t[s])){a=!0;break}a||o.push(n[i])}e[r]=o}}},$rename:function(r,t,n,o,i){if(o===n)throw _("$rename source must differ from target");if(null===r)throw _("$rename source field invalid");if("string"!=typeof n)throw _("$rename target must be a string");if(void 0!==r){var a=r[t];delete r[t];var s=n.split("."),c=e(i,s,{forbidArray:!0});if(null===c)throw _("$rename target field invalid");var u=s.pop();c[u]=a}},$bit:function(e,r,t){throw _("$bit is not supported")}}}.call(this),function(){h._diffQueryChanges=function(e,r,t,n,o){return f.diffQueryChanges(e,r,t,n,o)},h._diffQueryUnorderedChanges=function(e,r,t,n){return f.diffQueryUnorderedChanges(e,r,t,n)},h._diffQueryOrderedChanges=function(e,r,t,n){return f.diffQueryOrderedChanges(e,r,t,n)},h._diffObjects=function(e,r,t){return f.diffObjects(e,r,t)}}.call(this),function(){h._IdMap=function(){var e=this;i.call(e,u.idStringify,u.idParse)},e._inherits(h._IdMap,i)}.call(this),function(){h._CachingChangeObserver=function(e){var r=this;e=e||{};var t=e.callbacks&&h._observeChangesCallbacksAreOrdered(e.callbacks);if(n.has(e,"ordered")){if(r.ordered=e.ordered,e.callbacks&&e.ordered!==t)throw Error("ordered option doesn't match callbacks")}else{if(!e.callbacks)throw Error("must provide ordered or callbacks");r.ordered=t}var i=e.callbacks||{};r.ordered?(r.docs=new a(u.idStringify),r.applyChange={addedBefore:function(e,t,n){var a=o.clone(t);a._id=e,i.addedBefore&&i.addedBefore.call(r,e,t,n),i.added&&i.added.call(r,e,t),r.docs.putBefore(e,a,n||null)},movedBefore:function(e,t){var n=r.docs.get(e);i.movedBefore&&i.movedBefore.call(r,e,t),r.docs.moveBefore(e,t||null)}}):(r.docs=new h._IdMap,r.applyChange={added:function(e,t){var n=o.clone(t);i.added&&i.added.call(r,e,t),n._id=e,r.docs.set(e,n)}}),r.applyChange.changed=function(e,t){var n=r.docs.get(e);if(!n)throw new Error("Unknown id for changed: "+e);i.changed&&i.changed.call(r,e,o.clone(t)),f.applyChanges(n,t)},r.applyChange.removed=function(e){i.removed&&i.removed.call(r,e),r.docs.remove(e)}},h._observeFromObserveChanges=function(e,r){var t=e.getTransform()||function(e){return e},i=!!r._suppress_initial,a;if(h._observeCallbacksAreOrdered(r)){var s=!r._no_indices;a={addedBefore:function(e,o,a){var c=this;if(!i&&(r.addedAt||r.added)){var u=t(n.extend(o,{_id:e}));if(r.addedAt){var d=s?a?c.docs.indexOf(a):c.docs.size():-1;r.addedAt(u,d,a)}else r.added(u)}},changed:function(e,n){var i=this;if(r.changedAt||r.changed){var a=o.clone(i.docs.get(e));if(!a)throw new Error("Unknown id for changed: "+e);var c=t(o.clone(a));if(f.applyChanges(a,n),a=t(a),r.changedAt){var u=s?i.docs.indexOf(e):-1;r.changedAt(a,c,u)}else r.changed(a,c)}},movedBefore:function(e,n){var i=this;if(r.movedTo){var a=s?i.docs.indexOf(e):-1,c=s?n?i.docs.indexOf(n):i.docs.size():-1;c>a&&--c,r.movedTo(t(o.clone(i.docs.get(e))),a,c,n||null)}},removed:function(e){var n=this;if(r.removedAt||r.removed){var o=t(n.docs.get(e));if(r.removedAt){var i=s?n.docs.indexOf(e):-1;r.removedAt(o,i)}else r.removed(o)}}}}else a={added:function(e,o){if(!i&&r.added){var a=n.extend(o,{_id:e});r.added(t(a))}},changed:function(e,n){var i=this;if(r.changed){var a=i.docs.get(e),s=o.clone(a);f.applyChanges(s,n),r.changed(t(s),t(o.clone(a)))}},removed:function(e){var n=this;r.removed&&r.removed(t(n.docs.get(e)))}};var c=new h._CachingChangeObserver({callbacks:a}),u=e.observeChanges(c.applyChange);return i=!1,u}}.call(this),function(){h._selectorIsId=function(e){return"string"==typeof e||"number"==typeof e||e instanceof u.ObjectID},h._selectorIsIdPerhapsAsObject=function(e){return h._selectorIsId(e)||e&&"object"==typeof e&&e._id&&h._selectorIsId(e._id)&&1===n.size(e)},h._idsMatchedBySelector=function(e){if(h._selectorIsId(e))return[e];if(!e)return null;if(n.has(e,"_id"))return h._selectorIsId(e._id)?[e._id]:e._id&&e._id.$in&&n.isArray(e._id.$in)&&!n.isEmpty(e._id.$in)&&n.all(e._id.$in,h._selectorIsId)?e._id.$in:null;if(e.$and&&n.isArray(e.$and))for(var r=0;r<e.$and.length;++r){var t=h._idsMatchedBySelector(e.$and[r]);if(t)return t}return null}}.call(this),"undefined"==typeof Package&&(Package={}),function(e,r){for(var t in r)t in e||(e[t]=r[t])}(Package.minimongo={},{LocalCollection:h,Minimongo:p,MinimongoTest:v})}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,n=Package.meteor.meteorEnv,r=Package.modules.meteorInstall,a=Package.modules.Buffer,i=Package.modules.process,o=Package.underscore._,c=Package.ejson.EJSON,s,u,f=r({node_modules:{meteor:{check:{"match.js":["./isPlainObject.js",function(t,n){var r=new e.EnvironmentVariable,a=t("./isPlainObject.js").isPlainObject,i=n.check=function(e,t){var n=r.getOrNullIfOutsideFiber();n&&n.checking(e);var a=y(e,t);if(a){var i=new s.Error(a.message);throw a.path&&(i.message+=" in field "+a.path,i.path=a.path),i}},s=n.Match={Optional:function(e){return new u(e)},Maybe:function(e){return new f(e)},OneOf:function(){return new l(o.toArray(arguments))},Any:["__any__"],Where:function(e){return new h(e)},ObjectIncluding:function(e){return new p(e)},ObjectWithValues:function(e){return new g(e)},Integer:["__integer__"],Error:e.makeErrorType("Match.Error",function(t){this.message="Match error: "+t,this.path="",this.sanitizedError=new e.Error(400,"Match failed")}),test:function(e,t){return!y(e,t)},_failIfArgumentsAreNotAllChecked:function(e,t,n,a){var i=new v(n,a),o=r.withValue(i,function(){return e.apply(t,n)});return i.throwUnlessAllArgumentsHaveBeenChecked(),o}},u=function(e){this.pattern=e},f=function(e){this.pattern=e},l=function(e){if(o.isEmpty(e))throw new Error("Must provide at least one choice to Match.OneOf");this.choices=e},h=function(e){this.condition=e},p=function(e){this.pattern=e},g=function(e){this.pattern=e},d=function(e,t){if(t=t||{},null===e)return"null";if(t.onlyShowType)return typeof e;if("object"!=typeof e)return c.stringify(e);try{JSON.stringify(e)}catch(t){if("TypeError"===t.name)return typeof e}return c.stringify(e)},m=[[String,"string"],[Number,"number"],[Boolean,"boolean"],[Function,"function"],[void 0,"undefined"]],y=function(e,t){if(t===s.Any)return!1;for(var n=0;n<m.length;++n)if(t===m[n][0])return typeof e!==m[n][1]&&{message:"Expected "+m[n][1]+", got "+d(e,{onlyShowType:!0}),path:""};if(null===t)return null!==e&&{message:"Expected null, got "+d(e),path:""};if("string"==typeof t||"number"==typeof t||"boolean"==typeof t)return e!==t&&{message:"Expected "+t+", got "+d(e),path:""};if(t===s.Integer)return("number"!=typeof e||(0|e)!==e)&&{message:"Expected Integer, got "+d(e),path:""};if(t===Object&&(t=s.ObjectIncluding({})),t instanceof Array){if(1!==t.length)return{message:"Bad pattern: arrays must have one type element"+d(t),path:""};if(!o.isArray(e)&&!o.isArguments(e))return{message:"Expected array, got "+d(e),path:""};for(var n=0,r=e.length;n<r;n++){var i=y(e[n],t[0]);if(i)return i.path=k(n,i.path),i}return!1}if(t instanceof h){var i;try{i=t.condition(e)}catch(e){if(!(e instanceof s.Error))throw e;return{message:e.message,path:e.path}}return!i&&{message:"Failed Match.Where validation",path:""}}if(t instanceof f?t=s.OneOf(void 0,null,t.pattern):t instanceof u&&(t=s.OneOf(void 0,t.pattern)),t instanceof l){for(var n=0;n<t.choices.length;++n){var i=y(e,t.choices[n]);if(!i)return!1}return{message:"Failed Match.OneOf, Match.Maybe or Match.Optional validation",path:""}}if(t instanceof Function)return!(e instanceof t)&&{message:"Expected "+(t.name||"particular constructor"),path:""};var c=!1,v;if(t instanceof p&&(c=!0,t=t.pattern),t instanceof g&&(c=!0,v=[t.pattern],t={}),"object"!=typeof t)return{message:"Bad pattern: unknown pattern type",path:""};if("object"!=typeof e)return{message:"Expected object, got "+typeof e,path:""};if(null===e)return{message:"Expected object, got null",path:""};if(!a(e))return{message:"Expected plain object",path:""};var b={},w={};o.each(t,function(e,t){e instanceof u||e instanceof f?w[t]=e.pattern:b[t]=e});for(var O=function(e){var t=[];if(o.isObject(e))for(var n in e)t.push(n);return t},j=O(e),n=0,r=j.length;n<r;n++){var E=j[n],P=e[E];if(o.has(b,E)){var i=y(P,b[E]);if(i)return i.path=k(E,i.path),i;delete b[E]}else if(o.has(w,E)){var i=y(P,w[E]);if(i)return i.path=k(E,i.path),i}else{if(!c)return{message:"Unknown key",path:E};if(v){var i=y(P,v[0]);if(i)return i.path=k(E,i.path),i}}}var j=o.keys(b);return j.length?{message:"Missing key '"+j[0]+"'",path:""}:void 0},v=function(e,t){var n=this;n.args=o.clone(e),n.args.reverse(),n.description=t};o.extend(v.prototype,{checking:function(e){var t=this;t._checkingOneValue(e)||(o.isArray(e)||o.isArguments(e))&&o.each(e,o.bind(t._checkingOneValue,t))},_checkingOneValue:function(e){for(var t=this,n=0;n<t.args.length;++n)if(e===t.args[n]||o.isNaN(e)&&o.isNaN(t.args[n]))return t.args.splice(n,1),!0;return!1},throwUnlessAllArgumentsHaveBeenChecked:function(){var e=this;if(!o.isEmpty(e.args))throw new Error("Did not check() all arguments during "+e.description)}});var b=["do","if","in","for","let","new","try","var","case","else","enum","eval","false","null","this","true","void","with","break","catch","class","const","super","throw","while","yield","delete","export","import","public","return","static","switch","typeof","default","extends","finally","package","private","continue","debugger","function","arguments","interface","protected","implements","instanceof"],k=function(e,t){return"number"==typeof e||e.match(/^[0-9]+$/)?e="["+e+"]":e.match(/^[a-z_$][0-9a-z_$]*$/i)&&!o.contains(b,e)||(e=JSON.stringify([e])),t&&"["!==t[0]?e+"."+t:e+t}}],"isPlainObject.js":function(e,t){function n(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?a[i.call(e)]||"object":typeof e}function r(e){return null!=e&&e==e.window}var a={},i=a.toString,c=a.hasOwnProperty,s={};o.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){a["[object "+e+"]"]=e.toLowerCase()}),t.isPlainObject=function(e){var t;if(!e||"object"!==n(e)||e.nodeType||r(e))return!1;try{if(e.constructor&&!c.call(e,"constructor")&&!c.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}if(s.ownLast)for(t in e)return c.call(e,t);for(t in e);return void 0===t||c.call(e,t)}}}}}},{extensions:[".js",".json"]}),l=f("./node_modules/meteor/check/match.js");"undefined"==typeof Package&&(Package={}),function(e,t){for(var n in t)n in e||(e[n]=t[n])}(Package.check=l,{check:s,Match:u})}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,r=Package.meteor.meteorEnv,n=Package.underscore._,i=Package.random.Random,a;(function(){a=function(e){var t=this;n.extend(t,n.defaults(n.clone(e||{}),{baseTimeout:1e3,exponent:2.2,maxTimeout:3e5,minTimeout:10,minCount:2,fuzz:.5})),t.retryTimer=null},n.extend(a.prototype,{clear:function(){var e=this;e.retryTimer&&clearTimeout(e.retryTimer),e.retryTimer=null},_timeout:function(e){var t=this;if(e<t.minCount)return t.minTimeout;var r=Math.min(t.maxTimeout,t.baseTimeout*Math.pow(t.exponent,e));return r*=i.fraction()*t.fuzz+(1-t.fuzz/2)},retryLater:function(t,r){var n=this,i=n._timeout(t);return n.retryTimer&&clearTimeout(n.retryTimer),n.retryTimer=e.setTimeout(r,i),i}})}).call(this),"undefined"==typeof Package&&(Package={}),function(e,t){for(var r in t)r in e||(e[r]=t[r])}(Package.retry={},{Retry:a})}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,a=Package.meteor.meteorEnv,n=Package.check.check,r=Package.check.Match,i=Package.random.Random,o=Package.ejson.EJSON,c=Package.underscore._,s=Package.tracker.Tracker,l=Package.tracker.Deps,u=Package.retry.Retry,d;(function(){d={}}).call(this),function(){d.Heartbeat=function(e){var t=this;t.heartbeatInterval=e.heartbeatInterval,t.heartbeatTimeout=e.heartbeatTimeout,t._sendPing=e.sendPing,t._onTimeout=e.onTimeout,t._seenPacket=!1,t._heartbeatIntervalHandle=null,t._heartbeatTimeoutHandle=null},c.extend(d.Heartbeat.prototype,{stop:function(){var e=this;e._clearHeartbeatIntervalTimer(),e._clearHeartbeatTimeoutTimer()},start:function(){var e=this;e.stop(),e._startHeartbeatIntervalTimer()},_startHeartbeatIntervalTimer:function(){var t=this;t._heartbeatIntervalHandle=e.setInterval(c.bind(t._heartbeatIntervalFired,t),t.heartbeatInterval)},_startHeartbeatTimeoutTimer:function(){var t=this;t._heartbeatTimeoutHandle=e.setTimeout(c.bind(t._heartbeatTimeoutFired,t),t.heartbeatTimeout)},_clearHeartbeatIntervalTimer:function(){var t=this;t._heartbeatIntervalHandle&&(e.clearInterval(t._heartbeatIntervalHandle),t._heartbeatIntervalHandle=null)},_clearHeartbeatTimeoutTimer:function(){var t=this;t._heartbeatTimeoutHandle&&(e.clearTimeout(t._heartbeatTimeoutHandle),t._heartbeatTimeoutHandle=null)},_heartbeatIntervalFired:function(){var e=this;e._seenPacket||e._heartbeatTimeoutHandle||(e._sendPing(),e._startHeartbeatTimeoutTimer()),e._seenPacket=!1},_heartbeatTimeoutFired:function(){var e=this;e._heartbeatTimeoutHandle=null,e._onTimeout()},messageReceived:function(){var e=this;e._seenPacket=!0,e._heartbeatTimeoutHandle&&e._clearHeartbeatTimeoutTimer()}})}.call(this),function(){d.SUPPORTED_DDP_VERSIONS=["1","pre2","pre1"],d.parseDDP=function(t){try{var a=JSON.parse(t)}catch(a){return e._debug("Discarding message with invalid JSON",t),null}return null===a||"object"!=typeof a?(e._debug("Discarding non-object DDP message",t),null):(c.has(a,"cleared")&&(c.has(a,"fields")||(a.fields={}),c.each(a.cleared,function(e){a.fields[e]=void 0}),delete a.cleared),c.each(["fields","params","result"],function(e){c.has(a,e)&&(a[e]=o._adjustTypesFromJSONValue(a[e]))}),a)},d.stringifyDDP=function(e){var t=o.clone(e);if(c.has(e,"fields")){var a=[];c.each(e.fields,function(e,n){void 0===e&&(a.push(n),delete t.fields[n])}),c.isEmpty(a)||(t.cleared=a),c.isEmpty(t.fields)&&delete t.fields}if(c.each(["fields","params","result"],function(e){c.has(t,e)&&(t[e]=o._adjustTypesToJSONValue(t[e]))}),e.id&&"string"!=typeof e.id)throw new Error("Message id is not a string");return JSON.stringify(t)}}.call(this),function(){d.MethodInvocation=function(e){var t=this;this.isSimulation=e.isSimulation,this._unblock=e.unblock||function(){},this._calledUnblock=!1,this.userId=e.userId,this._setUserId=e.setUserId||function(){},this.connection=e.connection,this.randomSeed=e.randomSeed,this.randomStream=null},c.extend(d.MethodInvocation.prototype,{unblock:function(){var e=this;e._calledUnblock=!0,e._unblock()},setUserId:function(e){var t=this;if(t._calledUnblock)throw new Error("Can't call setUserId in a method after calling unblock");t.userId=e,t._setUserId(e)}})}.call(this),function(){function e(){return i.hexString(20)}d.RandomStream=function(t){var a=this;this.seed=[].concat(t.seed||e()),this.sequences={}},d.RandomStream.get=function(e,t){if(t||(t="default"),!e)return i.insecure;var a=e.randomStream;return a||(e.randomStream=a=new d.RandomStream({seed:e.randomSeed})),a._sequence(t)},d.makeRpcSeed=function(e,t){var a=d.RandomStream.get(e,"/rpc/"+t);return a.hexString(20)},c.extend(d.RandomStream.prototype,{_sequence:function(e){var t=this,a=t.sequences[e]||null;if(null===a){for(var n=t.seed.concat(e),r=0;r<n.length;r++)c.isFunction(n[r])&&(n[r]=n[r]());t.sequences[e]=a=i.createWithSeeds.apply(null,n)}return a}})}.call(this),"undefined"==typeof Package&&(Package={}),function(e,t){for(var a in t)a in e||(e[a]=t[a])}(Package["ddp-common"]={},{DDPCommon:d})}();
!function(){var a=Package.meteor.Meteor,e=Package.meteor.global,t=Package.meteor.meteorEnv,o=Package.underscore._,n=Package["ecmascript-runtime"].Symbol,r=Package["ecmascript-runtime"].Map,i=Package["ecmascript-runtime"].Set,c;(function(){c={};var e="Meteor_Reload",t={},n,r=null;try{r=window.sessionStorage,r?(r.setItem("__dummy__","1"),r.removeItem("__dummy__")):r=null}catch(a){r=null}c._getData=function(){return r&&r.getItem(e)},r&&(n=c._getData(),r.removeItem(e)),n||(n="{}");var i={};try{i=JSON.parse(n),"object"!=typeof i&&(a._debug("Got bad data on reload. Ignoring."),i={})}catch(e){a._debug("Got invalid JSON on reload. Ignoring.")}i.reload&&"object"==typeof i.data&&(t=i.data);var l=[];c._onMigrate=function(a,e){e||(e=a,a=void 0),l.push({name:a,callback:e})},c._migrationData=function(a){return t[a]};var d=function(a,e){a=a||function(){},e=e||{};for(var t={},n=o.clone(l),r=!0;n.length;){var i=n.shift(),c=i.callback(a,e);c[0]||(r=!1),c.length>1&&i.name&&(t[i.name]=c[1])}return r||e.immediateMigration?t:null};c._migrate=function(t,o){var n=d(t,o);if(null===n)return!1;try{var i=JSON.stringify({data:n,reload:!0})}catch(e){throw a._debug("Couldn't serialize data for migration",n),e}if(r)try{r.setItem(e,i)}catch(e){a._debug("Couldn't save data for migration to sessionStorage",e)}else a._debug("Browser does not support sessionStorage. Not saving migration state.");return!0},c._withFreshProvidersForTest=function(a){var e=o.clone(l);l=[];try{a()}finally{l=e}};var g=!1;c._reload=function(a){if(a=a||{},!g){g=!0;var e=function(){o.defer(function(){c._migrate(e,a)&&(window.location.hash||window.location.href.endsWith("#")?window.location.reload():window.location.replace(window.location.href))})};e()}}}).call(this),function(){a._reload={onMigrate:c._onMigrate,migrationData:c._migrationData,reload:c._reload}}.call(this),"undefined"==typeof Package&&(Package={}),function(a,e){for(var t in e)t in a||(a[t]=e[t])}(Package.reload={},{Reload:c})}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,n=Package.meteor.meteorEnv,r=Package.check.check,o=Package.check.Match,i=Package.random.Random,s=Package.ejson.EJSON,a=Package.underscore._,u=Package.tracker.Tracker,c=Package.tracker.Deps,d=Package.retry.Retry,l=Package["id-map"].IdMap,f=Package["ddp-common"].DDPCommon,_=Package["diff-sequence"].DiffSequence,p=Package["mongo-id"].MongoID,h,v,m,g,b,y,w;(function(){h={},v={}}).call(this),function(){m=function(){var e=this;l.call(e,p.idStringify,p.idParse)},e._inherits(m,l)}.call(this),function(){g=function(){var e=document,t=window,n={},r=function(){};r.prototype.addEventListener=function(e,t){this._listeners||(this._listeners={}),e in this._listeners||(this._listeners[e]=[]);var r=this._listeners[e];n.arrIndexOf(r,t)===-1&&r.push(t)},r.prototype.removeEventListener=function(e,t){if(this._listeners&&e in this._listeners){var r=this._listeners[e],o=n.arrIndexOf(r,t);return o!==-1?void(r.length>1?this._listeners[e]=r.slice(0,o).concat(r.slice(o+1)):delete this._listeners[e]):void 0}},r.prototype.dispatchEvent=function(e){var t=e.type,n=Array.prototype.slice.call(arguments,0);if(this["on"+t]&&this["on"+t].apply(this,n),this._listeners&&t in this._listeners)for(var r=0;r<this._listeners[t].length;r++)this._listeners[t][r].apply(this,n)};var o=function(e,t){if(this.type=e,"undefined"!=typeof t)for(var n in t)t.hasOwnProperty(n)&&(this[n]=t[n])};o.prototype.toString=function(){var e=[];for(var t in this)if(this.hasOwnProperty(t)){var n=this[t];"function"==typeof n&&(n="[function]"),e.push(t+"="+n)}return"SimpleEvent("+e.join(", ")+")"};var i=function(e){var t=this;t._events=e||[],t._listeners={}};i.prototype.emit=function(e){var t=this;if(t._verifyType(e),!t._nuked){var n=Array.prototype.slice.call(arguments,1);if(t["on"+e]&&t["on"+e].apply(t,n),e in t._listeners)for(var r=0;r<t._listeners[e].length;r++)t._listeners[e][r].apply(t,n)}},i.prototype.on=function(e,t){var n=this;n._verifyType(e),n._nuked||(e in n._listeners||(n._listeners[e]=[]),n._listeners[e].push(t))},i.prototype._verifyType=function(e){var t=this;n.arrIndexOf(t._events,e)===-1&&n.log("Event "+JSON.stringify(e)+" not listed "+JSON.stringify(t._events)+" in "+t)},i.prototype.nuke=function(){var e=this;e._nuked=!0;for(var t=0;t<e._events.length;t++)delete e[e._events[t]];e._listeners={}};var s="abcdefghijklmnopqrstuvwxyz0123456789_";n.random_string=function(e,t){t=t||s.length;var n,r=[];for(n=0;n<e;n++)r.push(s.substr(Math.floor(Math.random()*t),1));return r.join("")},n.random_number=function(e){return Math.floor(Math.random()*e)},n.random_number_string=function(e){var t=(""+(e-1)).length,r=Array(t+1).join("0");return(r+n.random_number(e)).slice(-t)},n.getOrigin=function(e){e+="/";var t=e.split("/").slice(0,3);return t.join("/")},n.isSameOriginUrl=function(e,n){return n||(n=t.location.href),e.split("/").slice(0,3).join("/")===n.split("/").slice(0,3).join("/")},n.isSameOriginScheme=function(e,n){return n||(n=t.location.href),e.split(":")[0]===n.split(":")[0]},n.getParentDomain=function(e){if(/^[0-9.]*$/.test(e))return e;if(/^\[/.test(e))return e;if(!/[.]/.test(e))return e;var t=e.split(".").slice(1);return t.join(".")},n.objectExtend=function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e};var a="_jp";n.polluteGlobalNamespace=function(){a in t||(t[a]={})},n.closeFrame=function(e,t){return"c"+JSON.stringify([e,t])},n.userSetCode=function(e){return 1e3===e||e>=3e3&&e<=4999},n.countRTO=function(e){var t;return t=e>100?3*e:e+200},n.log=function(){t.console&&console.log&&console.log.apply&&console.log.apply(console,arguments)},n.bind=function(e,t){return e.bind?e.bind(t):function(){return e.apply(t,arguments)}},n.flatUrl=function(e){return e.indexOf("?")===-1&&e.indexOf("#")===-1},n.amendUrl=function(t,r){var o;if(void 0===r)o=e.location;else{var i=/^([a-z0-9.+-]+:)/i.exec(r);if(i){var s=i[0].toLowerCase(),a=r.substring(s.length),u=/[a-z0-9\.-]+(:[0-9]+)?/.exec(a);if(u)var c=u[0]}if(!s||!c)throw new Error("relativeTo must be an absolute url");o={protocol:s,host:c}}if(!t)throw new Error("Wrong url for SockJS");if(!n.flatUrl(t))throw new Error("Only basic urls are supported in SockJS");0===t.indexOf("//")&&(t=o.protocol+t),0===t.indexOf("/")&&(t=o.protocol+"//"+o.host+t),t=t.replace(/[\/]+$/,"");var d=t.split("/");return("http:"===d[0]&&/:80$/.test(d[2])||"https:"===d[0]&&/:443$/.test(d[2]))&&(d[2]=d[2].replace(/:(80|443)$/,"")),t=d.join("/")},n.arrIndexOf=function(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1},n.arrSkip=function(e,t){var r=n.arrIndexOf(e,t);if(r===-1)return e.slice();var o=e.slice(0,r);return o.concat(e.slice(r+1))},n.isArray=Array.isArray||function(e){return{}.toString.call(e).indexOf("Array")>=0},n.delay=function(e,t){return"function"==typeof e&&(t=e,e=0),setTimeout(t,e)};var u=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,c={"\0":"\\u0000","":"\\u0001","":"\\u0002","":"\\u0003","":"\\u0004","":"\\u0005","":"\\u0006","":"\\u0007","\b":"\\b","\t":"\\t","\n":"\\n","\v":"\\u000b","\f":"\\f","\r":"\\r","":"\\u000e","":"\\u000f","":"\\u0010","":"\\u0011","":"\\u0012","":"\\u0013","":"\\u0014","":"\\u0015","":"\\u0016","":"\\u0017","":"\\u0018","":"\\u0019","":"\\u001a","":"\\u001b","":"\\u001c","":"\\u001d","":"\\u001e","":"\\u001f",'"':'\\"',"\\":"\\\\","":"\\u007f","€":"\\u0080","":"\\u0081","‚":"\\u0082","ƒ":"\\u0083","„":"\\u0084","…":"\\u0085","†":"\\u0086","‡":"\\u0087","ˆ":"\\u0088","‰":"\\u0089","Š":"\\u008a","‹":"\\u008b","Œ":"\\u008c","":"\\u008d","Ž":"\\u008e","":"\\u008f","":"\\u0090","‘":"\\u0091","’":"\\u0092","“":"\\u0093","”":"\\u0094","•":"\\u0095","–":"\\u0096","—":"\\u0097","˜":"\\u0098","™":"\\u0099","š":"\\u009a","›":"\\u009b","œ":"\\u009c","":"\\u009d","ž":"\\u009e","Ÿ":"\\u009f","­":"\\u00ad","؀":"\\u0600","؁":"\\u0601","؂":"\\u0602","؃":"\\u0603","؄":"\\u0604","܏":"\\u070f","":"\\u17b4","":"\\u17b5","":"\\u200c","":"\\u200d","":"\\u200e","":"\\u200f","\u2028":"\\u2028","\u2029":"\\u2029","":"\\u202a","":"\\u202b","":"\\u202c","":"\\u202d","":"\\u202e","":"\\u202f","":"\\u2060","":"\\u2061","":"\\u2062","":"\\u2063","":"\\u2064","":"\\u2065","":"\\u2066","":"\\u2067","":"\\u2068","":"\\u2069","":"\\u206a","":"\\u206b","":"\\u206c","":"\\u206d","":"\\u206e","":"\\u206f","\ufeff":"\\ufeff","":"\\ufff0","":"\\ufff1","":"\\ufff2","":"\\ufff3","":"\\ufff4","":"\\ufff5","":"\\ufff6","":"\\ufff7","":"\\ufff8","":"\\ufff9","":"\\ufffa","":"\\ufffb","":"\\ufffc","<22>":"\\ufffd","￾":"\\ufffe","￿":"\\uffff"},d=/[\x00-\x1f\ud800-\udfff\ufffe\uffff\u0300-\u0333\u033d-\u0346\u034a-\u034c\u0350-\u0352\u0357-\u0358\u035c-\u0362\u0374\u037e\u0387\u0591-\u05af\u05c4\u0610-\u0617\u0653-\u0654\u0657-\u065b\u065d-\u065e\u06df-\u06e2\u06eb-\u06ec\u0730\u0732-\u0733\u0735-\u0736\u073a\u073d\u073f-\u0741\u0743\u0745\u0747\u07eb-\u07f1\u0951\u0958-\u095f\u09dc-\u09dd\u09df\u0a33\u0a36\u0a59-\u0a5b\u0a5e\u0b5c-\u0b5d\u0e38-\u0e39\u0f43\u0f4d\u0f52\u0f57\u0f5c\u0f69\u0f72-\u0f76\u0f78\u0f80-\u0f83\u0f93\u0f9d\u0fa2\u0fa7\u0fac\u0fb9\u1939-\u193a\u1a17\u1b6b\u1cda-\u1cdb\u1dc0-\u1dcf\u1dfc\u1dfe\u1f71\u1f73\u1f75\u1f77\u1f79\u1f7b\u1f7d\u1fbb\u1fbe\u1fc9\u1fcb\u1fd3\u1fdb\u1fe3\u1feb\u1fee-\u1fef\u1ff9\u1ffb\u1ffd\u2000-\u2001\u20d0-\u20d1\u20d4-\u20d7\u20e7-\u20e9\u2126\u212a-\u212b\u2329-\u232a\u2adc\u302b-\u302c\uaab2-\uaab3\uf900-\ufa0d\ufa10\ufa12\ufa15-\ufa1e\ufa20\ufa22\ufa25-\ufa26\ufa2a-\ufa2d\ufa30-\ufa6d\ufa70-\ufad9\ufb1d\ufb1f\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufb4e\ufff0-\uffff]/g,l,f=JSON&&JSON.stringify||function(e){return u.lastIndex=0,u.test(e)&&(e=e.replace(u,function(e){return c[e]})),'"'+e+'"'},_=function(e){var t,n={},r=[];for(t=0;t<65536;t++)r.push(String.fromCharCode(t));return e.lastIndex=0,r.join("").replace(e,function(e){return n[e]="\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4),""}),e.lastIndex=0,n};n.quote=function(e){var t=f(e);return d.lastIndex=0,d.test(t)?(l||(l=_(d)),t.replace(d,function(e){return l[e]})):t};var p=["websocket","xdr-streaming","xhr-streaming","iframe-eventsource","iframe-htmlfile","xdr-polling","xhr-polling","iframe-xhr-polling","jsonp-polling"];n.probeProtocols=function(){for(var e={},t=0;t<p.length;t++){var n=p[t];e[n]=C[n]&&C[n].enabled()}return e},n.detectProtocols=function(e,t,n){var r={},o=[];t||(t=p);for(var i=0;i<t.length;i++){var s=t[i];r[s]=e[s]}var a=function(e){var t=e.shift();r[t]?o.push(t):e.length>0&&a(e)};return n.websocket!==!1&&a(["websocket"]),r["xhr-streaming"]&&!n.null_origin?o.push("xhr-streaming"):!r["xdr-streaming"]||n.cookie_needed||n.null_origin?a(["iframe-eventsource","iframe-htmlfile"]):o.push("xdr-streaming"),r["xhr-polling"]&&!n.null_origin?o.push("xhr-polling"):!r["xdr-polling"]||n.cookie_needed||n.null_origin?a(["iframe-xhr-polling","jsonp-polling"]):o.push("xdr-polling"),o};var h="_sockjs_global";n.createHook=function(){var e="a"+n.random_string(8);if(!(h in t)){var r={};t[h]=function(e){return e in r||(r[e]={id:e,del:function(){delete r[e]}}),r[e]}}return t[h](e)},n.attachMessage=function(e){n.attachEvent("message",e)},n.attachEvent=function(n,r){"undefined"!=typeof t.addEventListener?t.addEventListener(n,r,!1):(e.attachEvent("on"+n,r),t.attachEvent("on"+n,r))},n.detachMessage=function(e){n.detachEvent("message",e)},n.detachEvent=function(n,r){"undefined"!=typeof t.addEventListener?t.removeEventListener(n,r,!1):(e.detachEvent("on"+n,r),t.detachEvent("on"+n,r))};var v={},m=!1,g=function(){for(var e in v)v[e](),delete v[e]},b=function(){m||(m=!0,g())};n.attachEvent("unload",b),n.unload_add=function(e){var t=n.random_string(8);return v[t]=e,m&&n.delay(g),t},n.unload_del=function(e){e in v&&delete v[e]},n.createIframe=function(t,r){var o=e.createElement("iframe"),i,s,a=function(){clearTimeout(i);try{o.onload=null}catch(e){}o.onerror=null},u=function(){o&&(a(),setTimeout(function(){o&&o.parentNode.removeChild(o),o=null},0),n.unload_del(s))},c=function(e){o&&(u(),r(e))},d=function(e,t){try{o&&o.contentWindow&&o.contentWindow.postMessage(e,t)}catch(e){}};return o.src=t,o.style.display="none",o.style.position="absolute",o.onerror=function(){c("onerror")},o.onload=function(){clearTimeout(i),i=setTimeout(function(){c("onload timeout")},2e3)},e.body.appendChild(o),i=setTimeout(function(){c("timeout")},15e3),s=n.unload_add(u),{post:d,cleanup:u,loaded:a}},n.createHtmlfile=function(e,r){var o=new ActiveXObject("htmlfile"),i,s,u,c=function(){clearTimeout(i)},d=function(){o&&(c(),n.unload_del(s),u.parentNode.removeChild(u),u=o=null,CollectGarbage())},l=function(e){o&&(d(),r(e))},f=function(e,t){try{u&&u.contentWindow&&u.contentWindow.postMessage(e,t)}catch(e){}};o.open(),o.write('<html><script>document.domain="'+document.domain+'";</script></html>'),o.close(),o.parentWindow[a]=t[a];var _=o.createElement("div");return o.body.appendChild(_),u=o.createElement("iframe"),_.appendChild(u),u.src=e,i=setTimeout(function(){l("timeout")},15e3),s=n.unload_add(d),{post:f,cleanup:d,loaded:c}};var y=function(){};y.prototype=new i(["chunk","finish"]),y.prototype._start=function(e,r,o,i){var s=this;try{s.xhr=new XMLHttpRequest}catch(e){}if(!s.xhr)try{s.xhr=new t.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}(t.ActiveXObject||t.XDomainRequest)&&(r+=(r.indexOf("?")===-1?"?":"&")+"t="+ +new Date),s.unload_ref=n.unload_add(function(){s._cleanup(!0)});try{s.xhr.open(e,r,!0)}catch(e){return s.emit("finish",0,""),void s._cleanup()}if(i&&i.no_credentials||(s.xhr.withCredentials="true"),i&&i.headers)for(var a in i.headers)s.xhr.setRequestHeader(a,i.headers[a]);s.xhr.onreadystatechange=function(){if(s.xhr){var e=s.xhr;switch(e.readyState){case 3:try{var t=e.status,n=e.responseText}catch(e){}1223===t&&(t=204),n&&n.length>0&&s.emit("chunk",t,n);break;case 4:var t=e.status;1223===t&&(t=204),s.emit("finish",t,e.responseText),s._cleanup(!1)}}},s.xhr.send(o)},y.prototype._cleanup=function(e){var t=this;if(t.xhr){if(n.unload_del(t.unload_ref),t.xhr.onreadystatechange=function(){},e)try{t.xhr.abort()}catch(e){}t.unload_ref=t.xhr=null}},y.prototype.close=function(){var e=this;e.nuke(),e._cleanup(!0)};var w=n.XHRCorsObject=function(){var e=this,t=arguments;n.delay(function(){e._start.apply(e,t)})};w.prototype=new y;var S=n.XHRLocalObject=function(e,t,r){var o=this;n.delay(function(){o._start(e,t,r,{no_credentials:!0})})};S.prototype=new y;var k=n.XDRObject=function(e,t,r){var o=this;n.delay(function(){o._start(e,t,r)})};k.prototype=new i(["chunk","finish"]),k.prototype._start=function(e,t,r){var o=this,i=new XDomainRequest;t+=(t.indexOf("?")===-1?"?":"&")+"t="+ +new Date;var s=i.ontimeout=i.onerror=function(){o.emit("finish",0,""),o._cleanup(!1)};i.onprogress=function(){o.emit("chunk",200,i.responseText)},i.onload=function(){o.emit("finish",200,i.responseText),o._cleanup(!1)},o.xdr=i,o.unload_ref=n.unload_add(function(){o._cleanup(!0)});try{o.xdr.open(e,t),o.xdr.send(r)}catch(e){s()}},k.prototype._cleanup=function(e){var t=this;if(t.xdr){if(n.unload_del(t.unload_ref),t.xdr.ontimeout=t.xdr.onerror=t.xdr.onprogress=t.xdr.onload=null,e)try{t.xdr.abort()}catch(e){}t.unload_ref=t.xdr=null}},k.prototype.close=function(){var e=this;e.nuke(),e._cleanup(!0)},n.isXHRCorsCapable=function(){return t.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest?1:t.XDomainRequest&&e.domain?2:B.enabled()?3:4};var C=function(e,t,r){if(!(this instanceof C))return new C(e,t,r);var o=this,i;o._options={devel:!1,debug:!1,protocols_whitelist:[],info:void 0,rtt:void 0},r&&n.objectExtend(o._options,r),o._base_url=n.amendUrl(e),o._server=o._options.server||n.random_number_string(1e3),o._options.protocols_whitelist&&o._options.protocols_whitelist.length?i=o._options.protocols_whitelist:(i="string"==typeof t&&t.length>0?[t]:n.isArray(t)?t:null,i&&o._debug('Deprecated API: Use "protocols_whitelist" option instead of supplying protocol list as a second parameter to SockJS constructor.')),o._protocols=[],o.protocol=null,o.readyState=C.CONNECTING,o._ir=J(o._base_url),o._ir.onfinish=function(e,t){o._ir=null,e?(o._options.info&&(e=n.objectExtend(e,o._options.info)),o._options.rtt&&(t=o._options.rtt),o._applyInfo(e,t,i),o._didClose()):o._didClose(1002,"Can't connect to server",!0)}};C.prototype=new r,C.version="0.3.4",C.CONNECTING=0,C.OPEN=1,C.CLOSING=2,C.CLOSED=3,C.prototype._debug=function(){this._options.debug&&n.log.apply(n,arguments)},C.prototype._dispatchOpen=function(){var e=this;e.readyState===C.CONNECTING?(e._transport_tref&&(clearTimeout(e._transport_tref),e._transport_tref=null),e.readyState=C.OPEN,e.dispatchEvent(new o("open"))):e._didClose(1006,"Server lost session")},C.prototype._dispatchMessage=function(e){var t=this;t.readyState===C.OPEN&&t.dispatchEvent(new o("message",{data:e}))},C.prototype._dispatchHeartbeat=function(e){var t=this;t.readyState===C.OPEN&&t.dispatchEvent(new o("heartbeat",{}))},C.prototype._didClose=function(e,t,r){var i=this;if(i.readyState!==C.CONNECTING&&i.readyState!==C.OPEN&&i.readyState!==C.CLOSING)throw new Error("INVALID_STATE_ERR");i._ir&&(i._ir.nuke(),i._ir=null),i._transport&&(i._transport.doCleanup(),i._transport=null);var s=new o("close",{code:e,reason:t,wasClean:n.userSetCode(e)});if(!n.userSetCode(e)&&i.readyState===C.CONNECTING&&!r){if(i._try_next_protocol(s))return;s=new o("close",{code:2e3,reason:"All transports failed",wasClean:!1,last_event:s})}i.readyState=C.CLOSED,n.delay(function(){i.dispatchEvent(s)})},C.prototype._didMessage=function(e){var t=this,n=e.slice(0,1);switch(n){case"o":t._dispatchOpen();break;case"a":for(var r=JSON.parse(e.slice(1)||"[]"),o=0;o<r.length;o++)t._dispatchMessage(r[o]);break;case"m":var r=JSON.parse(e.slice(1)||"null");t._dispatchMessage(r);break;case"c":var r=JSON.parse(e.slice(1)||"[]");t._didClose(r[0],r[1]);break;case"h":t._dispatchHeartbeat()}},C.prototype._try_next_protocol=function(t){var r=this;for(r.protocol&&(r._debug("Closed transport:",r.protocol,""+t),r.protocol=null),r._transport_tref&&(clearTimeout(r._transport_tref),r._transport_tref=null);;){var o=r.protocol=r._protocols.shift();if(!o)return!1;if(C[o]&&C[o].need_body===!0&&(!e.body||"undefined"!=typeof e.readyState&&"complete"!==e.readyState))return r._protocols.unshift(o),r.protocol="waiting-for-load",n.attachEvent("load",function(){r._try_next_protocol()}),!0;if(C[o]&&C[o].enabled(r._options)){var i=C[o].roundTrips||1,s=(r._options.rto||0)*i||5e3;r._transport_tref=n.delay(s,function(){r.readyState===C.CONNECTING&&r._didClose(2007,"Transport timeouted")});var a=n.random_string(8),u=r._base_url+"/"+r._server+"/"+a;return r._debug("Opening transport:",o," url:"+u," RTO:"+r._options.rto),r._transport=new C[o](r,u,r._base_url),!0}r._debug("Skipping transport:",o)}},C.prototype.close=function(e,t){var r=this;if(e&&!n.userSetCode(e))throw new Error("INVALID_ACCESS_ERR");return(r.readyState===C.CONNECTING||r.readyState===C.OPEN)&&(r.readyState=C.CLOSING,r._didClose(e||1e3,t||"Normal closure"),!0)},C.prototype.send=function(e){var t=this;if(t.readyState===C.CONNECTING)throw new Error("INVALID_STATE_ERR");return t.readyState===C.OPEN&&t._transport.doSend(n.quote(""+e)),!0},C.prototype._applyInfo=function(t,r,o){var i=this;i._options.info=t,i._options.rtt=r,i._options.rto=n.countRTO(r),i._options.info.null_origin=!e.domain,t.base_url&&(i._base_url=n.amendUrl(t.base_url,i._base_url));var s=n.probeProtocols();i._protocols=n.detectProtocols(s,o,t),n.isSameOriginScheme(i._base_url)||2!==n.isXHRCorsCapable()||(i._protocols=["jsonp-polling"])};var E=C.websocket=function(e,r){var o=this,i=r+"/websocket";i="https"===i.slice(0,5)?"wss"+i.slice(5):"ws"+i.slice(4),o.ri=e,o.url=i;var s=t.WebSocket||t.MozWebSocket;o.ws=new s(o.url),o.ws.onmessage=function(e){o.ri._didMessage(e.data)},o.unload_ref=n.unload_add(function(){o.ws.close()}),o.ws.onclose=function(){o.ri._didMessage(n.closeFrame(1006,"WebSocket connection broken"))}};E.prototype.doSend=function(e){this.ws.send("["+e+"]")},E.prototype.doCleanup=function(){var e=this,t=e.ws;t&&(t.onmessage=t.onclose=null,t.close(),n.unload_del(e.unload_ref),e.unload_ref=e.ri=e.ws=null)},E.enabled=function(){return!(!t.WebSocket&&!t.MozWebSocket)},E.roundTrips=2;var O=function(){};O.prototype.send_constructor=function(e){var t=this;t.send_buffer=[],t.sender=e},O.prototype.doSend=function(e){var t=this;t.send_buffer.push(e),t.send_stop||t.send_schedule()},O.prototype.send_schedule_wait=function(){var e=this,t;e.send_stop=function(){e.send_stop=null,clearTimeout(t)},t=n.delay(25,function(){e.send_stop=null,e.send_schedule()})},O.prototype.send_schedule=function(){var e=this;if(e.send_buffer.length>0){var t="["+e.send_buffer.join(",")+"]";e.send_stop=e.sender(e.trans_url,t,function(t,n){e.send_stop=null,t===!1?e.ri._didClose(1006,"Sending error "+n):e.send_schedule_wait()}),e.send_buffer=[]}},O.prototype.send_destructor=function(){var e=this;e._send_stop&&e._send_stop(),e._send_stop=null};var T=function(t,r,o){var i=this;if(!("_send_form"in i)){var s=i._send_form=e.createElement("form"),a=i._send_area=e.createElement("textarea");a.name="d",s.style.display="none",s.style.position="absolute",s.method="POST",s.enctype="application/x-www-form-urlencoded",s.acceptCharset="UTF-8",s.appendChild(a),e.body.appendChild(s)}var s=i._send_form,a=i._send_area,u="a"+n.random_string(8);s.target=u,s.action=t+"/jsonp_send?i="+u;var c;try{c=e.createElement('<iframe name="'+u+'">')}catch(t){c=e.createElement("iframe"),c.name=u}c.id=u,s.appendChild(c),c.style.display="none";try{a.value=r}catch(e){n.log("Your browser is seriously broken. Go home! "+e.message)}s.submit();var d=function(e){c.onerror&&(c.onreadystatechange=c.onerror=c.onload=null,n.delay(500,function(){c.parentNode.removeChild(c),c=null}),a.value="",o(!0))};return c.onerror=c.onload=d,c.onreadystatechange=function(e){"complete"==c.readyState&&d()},d},D=function(e){return function(t,n,r){var o=new e("POST",t+"/xhr_send",n);return o.onfinish=function(e,t){r(200===e||204===e,"http status "+e)},function(e){r(!1,e)}}},M=function(t,r){var o,i=e.createElement("script"),s,a=function(e){s&&(s.parentNode.removeChild(s),s=null),i&&(clearTimeout(o),i.parentNode.removeChild(i),i.onreadystatechange=i.onerror=i.onload=i.onclick=null,i=null,r(e),r=null)},u=!1,c=null;if(i.id="a"+n.random_string(8),i.src=t,i.type="text/javascript",i.charset="UTF-8",i.onerror=function(e){c||(c=setTimeout(function(){u||a(n.closeFrame(1006,"JSONP script loaded abnormally (onerror)"))},1e3))},i.onload=function(e){a(n.closeFrame(1006,"JSONP script loaded abnormally (onload)"))},i.onreadystatechange=function(e){if(/loaded|closed/.test(i.readyState)){if(i&&i.htmlFor&&i.onclick){u=!0;try{i.onclick()}catch(e){}}i&&a(n.closeFrame(1006,"JSONP script loaded abnormally (onreadystatechange)"))}},"undefined"==typeof i.async&&e.attachEvent)if(/opera/i.test(navigator.userAgent))s=e.createElement("script"),s.text="try{var a = document.getElementById('"+i.id+"'); if(a)a.onerror();}catch(x){};",i.async=s.async=!1;else{try{i.htmlFor=i.id,i.event="onclick"}catch(e){}i.async=!0}"undefined"!=typeof i.async&&(i.async=!0),o=setTimeout(function(){a(n.closeFrame(1006,"JSONP script loaded abnormally (timeout)"))},35e3);var d=e.getElementsByTagName("head")[0];return d.insertBefore(i,d.firstChild),s&&d.insertBefore(s,d.firstChild),a},x=C["jsonp-polling"]=function(e,t){n.polluteGlobalNamespace();var r=this;r.ri=e,r.trans_url=t,r.send_constructor(T),r._schedule_recv()};x.prototype=new O,x.prototype._schedule_recv=function(){var e=this,t=function(t){e._recv_stop=null,t&&(e._is_closing||e.ri._didMessage(t)),e._is_closing||e._schedule_recv()};e._recv_stop=R(e.trans_url+"/jsonp",M,t)},x.enabled=function(){return!0},x.need_body=!0,x.prototype.doCleanup=function(){var e=this;e._is_closing=!0,e._recv_stop&&e._recv_stop(),e.ri=e._recv_stop=null,e.send_destructor()};var R=function(e,r,o){var i="a"+n.random_string(6),s=e+"?c="+escape(a+"."+i),u=0,c=function(e){switch(u){case 0:delete t[a][i],o(e);break;case 1:o(e),u=2;break;case 2:delete t[a][i]}},d=r(s,c);t[a][i]=d;var l=function(){t[a][i]&&(u=1,t[a][i](n.closeFrame(1e3,"JSONP user aborted read")))};return l},I=function(){};I.prototype=new O,I.prototype.run=function(e,t,n,r,o){var i=this;i.ri=e,i.trans_url=t,i.send_constructor(D(o)),i.poll=new K(e,r,t+n,o)},I.prototype.doCleanup=function(){var e=this;e.poll&&(e.poll.abort(),e.poll=null)};var P=C["xhr-streaming"]=function(e,t){this.run(e,t,"/xhr_streaming",re,n.XHRCorsObject)};P.prototype=new I,P.enabled=function(){return t.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest&&!/opera/i.test(navigator.userAgent)},P.roundTrips=2,P.need_body=!0;var N=C["xdr-streaming"]=function(e,t){this.run(e,t,"/xhr_streaming",re,n.XDRObject)};N.prototype=new I,N.enabled=function(){return!!t.XDomainRequest},N.roundTrips=2;var j=C["xhr-polling"]=function(e,t){this.run(e,t,"/xhr",re,n.XHRCorsObject)};j.prototype=new I,j.enabled=P.enabled,j.roundTrips=2;var A=C["xdr-polling"]=function(e,t){this.run(e,t,"/xhr",re,n.XDRObject)};A.prototype=new I,A.enabled=N.enabled,A.roundTrips=2;var B=function(){};B.prototype.i_constructor=function(e,t,r){var o=this;o.ri=e,o.origin=n.getOrigin(r),o.base_url=r,o.trans_url=t;var i=r+"/iframe.html";o.ri._options.devel&&(i+="?t="+ +new Date),o.window_id=n.random_string(8),i+="#"+o.window_id,o.iframeObj=n.createIframe(i,function(e){o.ri._didClose(1006,"Unable to load an iframe ("+e+")")}),o.onmessage_cb=n.bind(o.onmessage,o),n.attachMessage(o.onmessage_cb)},B.prototype.doCleanup=function(){var e=this;if(e.iframeObj){n.detachMessage(e.onmessage_cb);try{e.iframeObj.iframe.contentWindow&&e.postMessage("c")}catch(e){}e.iframeObj.cleanup(),e.iframeObj=null,e.onmessage_cb=e.iframeObj=null}},B.prototype.onmessage=function(e){var t=this;if(e.origin===t.origin){var n=e.data.slice(0,8),r=e.data.slice(8,9),o=e.data.slice(9);if(n===t.window_id)switch(r){case"s":t.iframeObj.loaded(),t.postMessage("s",JSON.stringify([C.version,t.protocol,t.trans_url,t.base_url]));break;case"t":t.ri._didMessage(o)}}},B.prototype.postMessage=function(e,t){var n=this;n.iframeObj.post(n.window_id+e+(t||""),n.origin)},B.prototype.doSend=function(e){this.postMessage("m",e)},B.enabled=function(){var e=navigator&&navigator.userAgent&&navigator.userAgent.indexOf("Konqueror")!==-1;return("function"==typeof t.postMessage||"object"==typeof t.postMessage)&&!e};var U,W=function(e,r){parent!==t?parent.postMessage(U+e+(r||""),"*"):n.log("Can't postMessage, no parent window.",e,r)},F=function(){};F.prototype._didClose=function(e,t){W("t",n.closeFrame(e,t))},F.prototype._didMessage=function(e){W("t",e)},F.prototype._doSend=function(e){this._transport.doSend(e)},F.prototype._doCleanup=function(){this._transport.doCleanup()},n.parent_origin=void 0,C.bootstrap_iframe=function(){var r;U=e.location.hash.slice(1);var o=function(e){if(e.source===parent&&("undefined"==typeof n.parent_origin&&(n.parent_origin=e.origin),e.origin===n.parent_origin)){var o=e.data.slice(0,8),i=e.data.slice(8,9),s=e.data.slice(9);if(o===U)switch(i){case"s":var a=JSON.parse(s),u=a[0],c=a[1],d=a[2],l=a[3];if(u!==C.version&&n.log('Incompatibile SockJS! Main site uses: "'+u+'", the iframe: "'+C.version+'".'),!n.flatUrl(d)||!n.flatUrl(l))return void n.log("Only basic urls are supported in SockJS");if(!n.isSameOriginUrl(d)||!n.isSameOriginUrl(l))return void n.log("Can't connect to different domain from within an iframe. ("+JSON.stringify([t.location.href,d,l])+")");r=new F,r._transport=new F[c](r,d,l);break;case"m":r._doSend(s);break;case"c":r&&r._doCleanup(),r=null}}};n.attachMessage(o),W("s")};var L=function(e,t){var r=this;n.delay(function(){r.doXhr(e,t)})};L.prototype=new i(["finish"]),L.prototype.doXhr=function(e,t){var r=this,o=(new Date).getTime(),i=new t("GET",e+"/info?cb="+n.random_string(10)),s=n.delay(8e3,function(){i.ontimeout()});i.onfinish=function(e,t){if(clearTimeout(s),s=null,200===e){var n=(new Date).getTime()-o,i=JSON.parse(t);"object"!=typeof i&&(i={}),r.emit("finish",i,n)}else r.emit("finish")},i.ontimeout=function(){i.close(),r.emit("finish")}};var H=function(t){var r=this,o=function(){var e=new B;e.protocol="w-iframe-info-receiver";var n=function(t){if("string"==typeof t&&"m"===t.substr(0,1)){var n=JSON.parse(t.substr(1)),o=n[0],i=n[1];r.emit("finish",o,i)}else r.emit("finish");e.doCleanup(),e=null},o={_options:{},_didClose:n,_didMessage:n};e.i_constructor(o,t,t)};e.body?o():n.attachEvent("load",o)};H.prototype=new i(["finish"]);var X=function(){var e=this;n.delay(function(){e.emit("finish",{},2e3)})};X.prototype=new i(["finish"]);var J=function(e){if(n.isSameOriginUrl(e))return new L(e,n.XHRLocalObject);switch(n.isXHRCorsCapable()){case 1:return new L(e,n.XHRLocalObject);case 2:return n.isSameOriginScheme(e)?new L(e,n.XDRObject):new X;case 3:return new H(e);default:return new X}},V=F["w-iframe-info-receiver"]=function(e,t,r){var o=new L(r,n.XHRLocalObject);o.onfinish=function(t,n){e._didMessage("m"+JSON.stringify([t,n])),e._didClose()}};V.prototype.doCleanup=function(){};var q=C["iframe-eventsource"]=function(){var e=this;e.protocol="w-iframe-eventsource",e.i_constructor.apply(e,arguments)};q.prototype=new B,q.enabled=function(){return"EventSource"in t&&B.enabled()},q.need_body=!0,q.roundTrips=3;var G=F["w-iframe-eventsource"]=function(e,t){this.run(e,t,"/eventsource",Z,n.XHRLocalObject)};G.prototype=new I;var Q=C["iframe-xhr-polling"]=function(){var e=this;e.protocol="w-iframe-xhr-polling",e.i_constructor.apply(e,arguments)};Q.prototype=new B,Q.enabled=function(){return t.XMLHttpRequest&&B.enabled()},Q.need_body=!0,Q.roundTrips=3;var z=F["w-iframe-xhr-polling"]=function(e,t){this.run(e,t,"/xhr",re,n.XHRLocalObject)};z.prototype=new I;var $=C["iframe-htmlfile"]=function(){var e=this;e.protocol="w-iframe-htmlfile",e.i_constructor.apply(e,arguments)};$.prototype=new B,$.enabled=function(){return B.enabled()},$.need_body=!0,$.roundTrips=3;var Y=F["w-iframe-htmlfile"]=function(e,t){this.run(e,t,"/htmlfile",ne,n.XHRLocalObject)};Y.prototype=new I;var K=function(e,t,n,r){var o=this;o.ri=e,o.Receiver=t,o.recv_url=n,o.AjaxObject=r,o._scheduleRecv()};K.prototype._scheduleRecv=function(){var e=this,t=e.poll=new e.Receiver(e.recv_url,e.AjaxObject),n=0;t.onmessage=function(t){n+=1,e.ri._didMessage(t.data)},t.onclose=function(n){e.poll=t=t.onmessage=t.onclose=null,e.poll_is_closing||("permanent"===n.reason?e.ri._didClose(1006,"Polling error ("+n.reason+")"):e._scheduleRecv())}},K.prototype.abort=function(){var e=this;e.poll_is_closing=!0,e.poll&&e.poll.abort()};var Z=function(e){var t=this,r=new EventSource(e);r.onmessage=function(e){t.dispatchEvent(new o("message",{data:unescape(e.data)}))},t.es_close=r.onerror=function(e,i){var s=i?"user":2!==r.readyState?"network":"permanent";t.es_close=r.onmessage=r.onerror=null,r.close(),r=null,n.delay(200,function(){t.dispatchEvent(new o("close",{reason:s}))})}};Z.prototype=new r,Z.prototype.abort=function(){var e=this;e.es_close&&e.es_close({},!0)};var ee,te=function(){if(void 0===ee)if("ActiveXObject"in t)try{ee=!!new ActiveXObject("htmlfile")}catch(e){}else ee=!1;return ee},ne=function(e){var r=this;n.polluteGlobalNamespace(),r.id="a"+n.random_string(6,26),e+=(e.indexOf("?")===-1?"?":"&")+"c="+escape(a+"."+r.id);var i=te()?n.createHtmlfile:n.createIframe,s;t[a][r.id]={start:function(){s.loaded()},message:function(e){r.dispatchEvent(new o("message",{data:e}))},stop:function(){r.iframe_close({},"network")}},r.iframe_close=function(e,n){s.cleanup(),r.iframe_close=s=null,delete t[a][r.id],r.dispatchEvent(new o("close",{reason:n}))},s=i(e,function(e){r.iframe_close({},"permanent")})};ne.prototype=new r,ne.prototype.abort=function(){var e=this;e.iframe_close&&e.iframe_close({},"user")};var re=function(e,t){var n=this,r=0;n.xo=new t("POST",e,null),n.xo.onchunk=function(e,t){if(200===e)for(;;){var i=t.slice(r),s=i.indexOf("\n");if(s===-1)break;r+=s+1;var a=i.slice(0,s);n.dispatchEvent(new o("message",{data:a}))}},n.xo.onfinish=function(e,t){n.xo.onchunk(e,t),n.xo=null;var r=200===e?"network":"permanent";n.dispatchEvent(new o("close",{reason:r}))}};return re.prototype=new r,re.prototype.abort=function(){var e=this;e.xo&&(e.xo.close(),e.dispatchEvent(new o("close",{reason:"user"})),e.xo=null)},C.getUtils=function(){return n},C.getIframeTransport=function(){return B},C}(),"_sockjs_onload"in window&&setTimeout(_sockjs_onload,1),"function"==typeof define&&define.amd&&define("sockjs",[],function(){return g})}.call(this),function(){v.ClientStream=function(e,t){var n=this;n.options=a.extend({retry:!0},t),n._initCommon(n.options),n.HEARTBEAT_TIMEOUT=1e5,n.rawUrl=e,n.socket=null,n.heartbeatTimer=null,"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("online",a.bind(n._online,n),!1),n._launchConnection()},a.extend(v.ClientStream.prototype,{send:function(e){var t=this;t.currentStatus.connected&&t.socket.send(e)},_changeUrl:function(e){var t=this;t.rawUrl=e},_connected:function(){var e=this;e.connectionTimer&&(clearTimeout(e.connectionTimer),e.connectionTimer=null),e.currentStatus.connected||(e.currentStatus.status="connected",e.currentStatus.connected=!0,e.currentStatus.retryCount=0,e.statusChanged(),a.each(e.eventCallbacks.reset,function(e){e()}))},_cleanup:function(e){var t=this;t._clearConnectionAndHeartbeatTimers(),t.socket&&(t.socket.onmessage=t.socket.onclose=t.socket.onerror=t.socket.onheartbeat=function(){},t.socket.close(),t.socket=null),a.each(t.eventCallbacks.disconnect,function(t){t(e)})},_clearConnectionAndHeartbeatTimers:function(){var e=this;e.connectionTimer&&(clearTimeout(e.connectionTimer),e.connectionTimer=null),e.heartbeatTimer&&(clearTimeout(e.heartbeatTimer),e.heartbeatTimer=null)},_heartbeat_timeout:function(){var t=this;e._debug("Connection timeout. No sockjs heartbeat received."),t._lostConnection(new h.ConnectionError("Heartbeat timed out"))},_heartbeat_received:function(){var e=this;e._forcedToDisconnect||(e.heartbeatTimer&&clearTimeout(e.heartbeatTimer),e.heartbeatTimer=setTimeout(a.bind(e._heartbeat_timeout,e),e.HEARTBEAT_TIMEOUT));
},_sockjsProtocolsWhitelist:function(){var e=["xdr-polling","xhr-polling","iframe-xhr-polling","jsonp-polling"],t=navigator&&/iPhone|iPad|iPod/.test(navigator.userAgent)&&/OS 4_|OS 5_/.test(navigator.userAgent);return t||(e=["websocket"].concat(e)),e},_launchConnection:function(){var t=this;t._cleanup();var n=a.extend({protocols_whitelist:t._sockjsProtocolsWhitelist()},t.options._sockjsOptions);t.socket=new g(b(t.rawUrl),(void 0),n),t.socket.onopen=function(e){t._connected()},t.socket.onmessage=function(e){t._heartbeat_received(),t.currentStatus.connected&&a.each(t.eventCallbacks.message,function(t){t(e.data)})},t.socket.onclose=function(){t._lostConnection()},t.socket.onerror=function(){e._debug("stream error",a.toArray(arguments),(new Date).toDateString())},t.socket.onheartbeat=function(){t._heartbeat_received()},t.connectionTimer&&clearTimeout(t.connectionTimer),t.connectionTimer=setTimeout(function(){t._lostConnection(new h.ConnectionError("DDP connection timed out"))},t.CONNECT_TIMEOUT)}})}.call(this),function(){var t=function(e,t){return e.length>=t.length&&e.substring(0,t.length)===t},n=function(e,t){return e.length>=t.length&&e.substring(e.length-t.length)===t},r=function(r,o,s){o||(o="http");var a=r.match(/^ddp(i?)\+sockjs:\/\//),u=r.match(/^http(s?):\/\//),c;if(a){var d=r.substr(a[0].length);c="i"===a[1]?o:o+"s";var l=d.indexOf("/"),f=l===-1?d:d.substr(0,l),_=l===-1?"":d.substr(l);return f=f.replace(/\*/g,function(){return Math.floor(10*i.fraction())}),c+"://"+f+_}if(u){c=u[1]?o+"s":o;var p=r.substr(u[0].length);r=c+"://"+p}return r.indexOf("://")!==-1||t(r,"/")||(r=o+"://"+r),r=e._relativeToSiteRootUrl(r),n(r,"/")?r+s:r+"/"+s};b=function(e){return r(e,"http","sockjs")},y=function(e){var t=r(e,"ws","websocket");return t},v.toSockjsUrl=b,a.extend(v.ClientStream.prototype,{on:function(e,t){var n=this;if("message"!==e&&"reset"!==e&&"disconnect"!==e)throw new Error("unknown event type: "+e);n.eventCallbacks[e]||(n.eventCallbacks[e]=[]),n.eventCallbacks[e].push(t)},_initCommon:function(e){var t=this;e=e||{},t.CONNECT_TIMEOUT=e.connectTimeoutMs||1e4,t.eventCallbacks={},t._forcedToDisconnect=!1,t.currentStatus={status:"connecting",connected:!1,retryCount:0},t.statusListeners="undefined"!=typeof u&&new u.Dependency,t.statusChanged=function(){t.statusListeners&&t.statusListeners.changed()},t._retry=new d,t.connectionTimer=null},reconnect:function(e){var t=this;return e=e||{},e.url&&t._changeUrl(e.url),e._sockjsOptions&&(t.options._sockjsOptions=e._sockjsOptions),t.currentStatus.connected?void((e._force||e.url)&&t._lostConnection(new h.ForcedReconnectError)):("connecting"===t.currentStatus.status&&t._lostConnection(),t._retry.clear(),t.currentStatus.retryCount-=1,void t._retryNow())},disconnect:function(e){var t=this;e=e||{},t._forcedToDisconnect||(e._permanent&&(t._forcedToDisconnect=!0),t._cleanup(),t._retry.clear(),t.currentStatus={status:e._permanent?"failed":"offline",connected:!1,retryCount:0},e._permanent&&e._error&&(t.currentStatus.reason=e._error),t.statusChanged())},_lostConnection:function(e){var t=this;t._cleanup(e),t._retryLater(e)},_online:function(){"offline"!=this.currentStatus.status&&this.reconnect()},_retryLater:function(e){var t=this,n=0;t.options.retry||e&&"DDP.ForcedReconnectError"===e.errorType?(n=t._retry.retryLater(t.currentStatus.retryCount,a.bind(t._retryNow,t)),t.currentStatus.status="waiting",t.currentStatus.retryTime=(new Date).getTime()+n):(t.currentStatus.status="failed",delete t.currentStatus.retryTime),t.currentStatus.connected=!1,t.statusChanged()},_retryNow:function(){var e=this;e._forcedToDisconnect||(e.currentStatus.retryCount+=1,e.currentStatus.status="connecting",e.currentStatus.connected=!1,delete e.currentStatus.retryTime,e.statusChanged(),e._launchConnection())},status:function(){var e=this;return e.statusListeners&&e.statusListeners.depend(),e.currentStatus}}),h.ConnectionError=e.makeErrorType("DDP.ConnectionError",function(e){var t=this;t.message=e}),h.ForcedReconnectError=e.makeErrorType("DDP.ForcedReconnectError",function(){})}.call(this),function(){v.SUPPORTED_DDP_VERSIONS=f.SUPPORTED_DDP_VERSIONS,h._CurrentInvocation=new e.EnvironmentVariable}.call(this),function(){h.randomStream=function(e){var t=h._CurrentInvocation.get();return f.RandomStream.get(t,e)}}.call(this),function(){if(e.isServer)var t=Npm.require("path"),n=Npm.require("fibers"),r=Npm.require(t.join("fibers","future"));var o=function(t,n){var r=this;n=a.extend({onConnected:function(){},onDDPVersionNegotiationFailure:function(t){e._debug(t)},heartbeatInterval:17500,heartbeatTimeout:15e3,npmFayeOptions:{},reloadWithOutstanding:!1,supportedDDPVersions:f.SUPPORTED_DDP_VERSIONS,retry:!0,respondToPings:!0,bufferedWritesInterval:5,bufferedWritesMaxAge:500},n),r.onReconnect=null,"object"==typeof t?r._stream=t:r._stream=new v.ClientStream(t,{retry:n.retry,headers:n.headers,_sockjsOptions:n._sockjsOptions,_dontPrintErrors:n._dontPrintErrors,connectTimeoutMs:n.connectTimeoutMs,npmFayeOptions:n.npmFayeOptions}),r._lastSessionId=null,r._versionSuggestion=null,r._version=null,r._stores={},r._methodHandlers={},r._nextMethodId=1,r._supportedDDPVersions=n.supportedDDPVersions,r._heartbeatInterval=n.heartbeatInterval,r._heartbeatTimeout=n.heartbeatTimeout,r._methodInvokers={},r._outstandingMethodBlocks=[],r._documentsWrittenByStub={},r._serverDocuments={},r._afterUpdateCallbacks=[],r._messagesBufferedUntilQuiescence=[],r._methodsBlockingQuiescence={},r._subsBeingRevived={},r._resetStores=!1,r._updatesForUnknownStores={},r._retryMigrate=null,r.__flushBufferedWrites=e.bindEnvironment(r._flushBufferedWrites,"flushing DDP buffered writes",r),r._bufferedWrites={},r._bufferedWritesFlushAt=null,r._bufferedWritesFlushHandle=null,r._bufferedWritesInterval=n.bufferedWritesInterval,r._bufferedWritesMaxAge=n.bufferedWritesMaxAge,r._subscriptions={},r._userId=null,r._userIdDeps=new u.Dependency,e.isClient&&Package.reload&&!n.reloadWithOutstanding&&Package.reload.Reload._onMigrate(function(e){if(r._readyToMigrate())return[!0];if(r._retryMigrate)throw new Error("Two migrations in progress?");return r._retryMigrate=e,!1});var o=function(t){try{var o=f.parseDDP(t)}catch(t){return void e._debug("Exception while parsing DDP",t)}if(r._heartbeat&&r._heartbeat.messageReceived(),null===o||!o.msg)return void(o&&o.server_id||e._debug("discarding invalid livedata message",o));if("connected"===o.msg)r._version=r._versionSuggestion,r._livedata_connected(o),n.onConnected();else if("failed"===o.msg)if(a.contains(r._supportedDDPVersions,o.version))r._versionSuggestion=o.version,r._stream.reconnect({_force:!0});else{var i="DDP version negotiation failed; server requested version "+o.version;r._stream.disconnect({_permanent:!0,_error:i}),n.onDDPVersionNegotiationFailure(i)}else"ping"===o.msg&&n.respondToPings?r._send({msg:"pong",id:o.id}):"pong"===o.msg||(a.include(["added","changed","removed","ready","updated"],o.msg)?r._livedata_data(o):"nosub"===o.msg?r._livedata_nosub(o):"result"===o.msg?r._livedata_result(o):"error"===o.msg?r._livedata_error(o):e._debug("discarding unknown livedata message type",o))},i=function(){var t={msg:"connect"};r._lastSessionId&&(t.session=r._lastSessionId),t.version=r._versionSuggestion||r._supportedDDPVersions[0],r._versionSuggestion=t.version,t.support=r._supportedDDPVersions,r._send(t),r._outstandingMethodBlocks.length>0&&a.each(r._outstandingMethodBlocks[0].methods,function(t){if(t.sentMessage&&t.noRetry){for(var n=r._outstandingMethodBlocks[0].methods,o,i=0;i<n.length&&(o=n[i],o.methodId!==t.methodId);i++);n.splice(i,1),t.receiveResult(new e.Error("invocation-failed","Method invocation might have failed due to dropped connection. Failing because `noRetry` option was passed to Meteor.apply."))}}),!a.isEmpty(r._outstandingMethodBlocks)&&a.isEmpty(r._outstandingMethodBlocks[0].methods)&&r._outstandingMethodBlocks.shift(),a.each(r._methodInvokers,function(e){e.sentMessage=!1}),r.onReconnect?r._callOnReconnectAndSendAppropriateOutstandingMethods():r._sendOutstandingMethods(),a.each(r._subscriptions,function(e,t){r._send({msg:"sub",id:t,name:e.name,params:e.params})})},s=function(){r._heartbeat&&(r._heartbeat.stop(),r._heartbeat=null)};e.isServer?(r._stream.on("message",e.bindEnvironment(o,"handling DDP message")),r._stream.on("reset",e.bindEnvironment(i,"handling DDP reset")),r._stream.on("disconnect",e.bindEnvironment(s,"handling DDP disconnect"))):(r._stream.on("message",o),r._stream.on("reset",i),r._stream.on("disconnect",s))},c=function(e){var t=this;t.methodId=e.methodId,t.sentMessage=!1,t._callback=e.callback,t._connection=e.connection,t._message=e.message,t._onResultReceived=e.onResultReceived||function(){},t._wait=e.wait,t.noRetry=e.noRetry,t._methodResult=null,t._dataVisible=!1,t._connection._methodInvokers[t.methodId]=t};a.extend(c.prototype,{sendMessage:function(){var e=this;if(e.gotResult())throw new Error("sendingMethod is called on method with result");e._dataVisible=!1,e.sentMessage=!0,e._wait&&(e._connection._methodsBlockingQuiescence[e.methodId]=!0),e._connection._send(e._message)},_maybeInvokeCallback:function(){var e=this;e._methodResult&&e._dataVisible&&(e._callback(e._methodResult[0],e._methodResult[1]),delete e._connection._methodInvokers[e.methodId],e._connection._outstandingMethodFinished())},receiveResult:function(e,t){var n=this;if(n.gotResult())throw new Error("Methods should only receive results once");n._methodResult=[e,t],n._onResultReceived(e,t),n._maybeInvokeCallback()},dataVisible:function(){var e=this;e._dataVisible=!0,e._maybeInvokeCallback()},gotResult:function(){var e=this;return!!e._methodResult}}),a.extend(o.prototype,{registerStore:function(e,t){var n=this;if(e in n._stores)return!1;var r={};a.each(["update","beginUpdate","endUpdate","saveOriginals","retrieveOriginals","getDoc","_getCollection"],function(e){r[e]=function(){return t[e]?t[e].apply(t,arguments):void 0}}),n._stores[e]=r;var o=n._updatesForUnknownStores[e];return o&&(r.beginUpdate(o.length,!1),a.each(o,function(e){r.update(e)}),r.endUpdate(),delete n._updatesForUnknownStores[e]),!0},subscribe:function(e){var t=this,n=Array.prototype.slice.call(arguments,1),r={};if(n.length){var o=n[n.length-1];a.isFunction(o)?r.onReady=n.pop():o&&a.any([o.onReady,o.onError,o.onStop],a.isFunction)&&(r=n.pop())}var c=a.find(t._subscriptions,function(t){return t.inactive&&t.name===e&&s.equals(t.params,n)}),d;c?(d=c.id,c.inactive=!1,r.onReady&&(c.ready||(c.readyCallback=r.onReady)),r.onError&&(c.errorCallback=r.onError),r.onStop&&(c.stopCallback=r.onStop)):(d=i.id(),t._subscriptions[d]={id:d,name:e,params:s.clone(n),inactive:!1,ready:!1,readyDeps:new u.Dependency,readyCallback:r.onReady,errorCallback:r.onError,stopCallback:r.onStop,connection:t,remove:function(){delete this.connection._subscriptions[this.id],this.ready&&this.readyDeps.changed()},stop:function(){this.connection._send({msg:"unsub",id:d}),this.remove(),r.onStop&&r.onStop()}},t._send({msg:"sub",id:d,name:e,params:n}));var l={stop:function(){a.has(t._subscriptions,d)&&t._subscriptions[d].stop()},ready:function(){if(!a.has(t._subscriptions,d))return!1;var e=t._subscriptions[d];return e.readyDeps.depend(),e.ready},subscriptionId:d};return u.active&&u.onInvalidate(function(e){a.has(t._subscriptions,d)&&(t._subscriptions[d].inactive=!0),u.afterFlush(function(){a.has(t._subscriptions,d)&&t._subscriptions[d].inactive&&l.stop()})}),l},_subscribeAndWait:function(e,t,n){var o=this,i=new r,s=!1,a;return t=t||[],t.push({onReady:function(){s=!0,i.return()},onError:function(e){s?n&&n.onLateError&&n.onLateError(e):i.throw(e)}}),a=o.subscribe.apply(o,[e].concat(t)),i.wait(),a},methods:function(e){var t=this;a.each(e,function(e,n){if("function"!=typeof e)throw new Error("Method '"+n+"' must be a function");if(t._methodHandlers[n])throw new Error("A method named '"+n+"' is already defined");t._methodHandlers[n]=e})},call:function(e){var t=Array.prototype.slice.call(arguments,1);if(t.length&&"function"==typeof t[t.length-1])var n=t.pop();return this.apply(e,t,n)},apply:function(t,n,o,i){var u=this;i||"function"!=typeof o||(i=o,o={}),o=o||{},i&&(i=e.bindEnvironment(i,"delivering result of invoking '"+t+"'")),n=s.clone(n);var d=function(){var e;return function(){return void 0===e&&(e=""+u._nextMethodId++),e}}(),l=h._CurrentInvocation.get(),_=l&&l.isSimulation,p=null,v=function(){return null===p&&(p=f.makeRpcSeed(l,t)),p},m=u._methodHandlers[t];if(m){var g=function(e){u.setUserId(e)},b=new f.MethodInvocation({isSimulation:!0,userId:u.userId(),setUserId:g,randomSeed:function(){return v()}});_||u._saveOriginals();try{var y=h._CurrentInvocation.withValue(b,function(){return e.isServer?e._noYieldsAllowed(function(){return m.apply(b,s.clone(n))}):m.apply(b,s.clone(n))})}catch(e){var w=e}_||u._retrieveAndStoreOriginals(d())}if(_){if(i)return void i(w,y);if(w)throw w;return y}if(w){if(o.throwStubExceptions)throw w;w.expected||e._debug("Exception while simulating the effect of invoking '"+t+"'",w,w.stack)}if(!i)if(e.isClient)i=function(n){n&&e._debug("Error invoking Method '"+t+"':",n.message)};else{var S=new r;i=S.resolver()}var k={msg:"method",method:t,params:n,id:d()};null!==p&&(k.randomSeed=p);var C=new c({methodId:d(),callback:i,connection:u,onResultReceived:o.onResultReceived,wait:!!o.wait,message:k,noRetry:!!o.noRetry});return o.wait?u._outstandingMethodBlocks.push({wait:!0,methods:[C]}):((a.isEmpty(u._outstandingMethodBlocks)||a.last(u._outstandingMethodBlocks).wait)&&u._outstandingMethodBlocks.push({wait:!1,methods:[]}),a.last(u._outstandingMethodBlocks).methods.push(C)),1===u._outstandingMethodBlocks.length&&C.sendMessage(),S?S.wait():o.returnStubValue?y:void 0},_saveOriginals:function(){var e=this;a.each(e._stores,function(e){e.saveOriginals()})},_retrieveAndStoreOriginals:function(e){var t=this;if(t._documentsWrittenByStub[e])throw new Error("Duplicate methodId in _retrieveAndStoreOriginals");var n=[];a.each(t._stores,function(r,o){var i=r.retrieveOriginals();i&&i.forEach(function(r,i){n.push({collection:o,id:i}),a.has(t._serverDocuments,o)||(t._serverDocuments[o]=new m);var s=t._serverDocuments[o].setDefault(i,{});s.writtenByStubs?s.writtenByStubs[e]=!0:(s.document=r,s.flushCallbacks=[],s.writtenByStubs={},s.writtenByStubs[e]=!0)})}),a.isEmpty(n)||(t._documentsWrittenByStub[e]=n)},_unsubscribeAll:function(){var e=this;a.each(a.clone(e._subscriptions),function(t,n){"meteor_autoupdate_clientVersions"!==t.name&&e._subscriptions[n].stop()})},_send:function(e){var t=this;t._stream.send(f.stringifyDDP(e))},_lostConnection:function(e){var t=this;t._stream._lostConnection(e)},status:function(){var e=this;return e._stream.status.apply(e._stream,arguments)},reconnect:function(){var e=this;return e._stream.reconnect.apply(e._stream,arguments)},disconnect:function(){var e=this;return e._stream.disconnect.apply(e._stream,arguments)},close:function(){var e=this;return e._stream.disconnect({_permanent:!0})},userId:function(){var e=this;return e._userIdDeps&&e._userIdDeps.depend(),e._userId},setUserId:function(e){var t=this;t._userId!==e&&(t._userId=e,t._userIdDeps&&t._userIdDeps.changed())},_waitingForQuiescence:function(){var e=this;return!a.isEmpty(e._subsBeingRevived)||!a.isEmpty(e._methodsBlockingQuiescence)},_anyMethodsAreOutstanding:function(){var e=this;return a.any(a.pluck(e._methodInvokers,"sentMessage"))},_livedata_connected:function(e){var t=this;if("pre1"!==t._version&&0!==t._heartbeatInterval&&(t._heartbeat=new f.Heartbeat({heartbeatInterval:t._heartbeatInterval,heartbeatTimeout:t._heartbeatTimeout,onTimeout:function(){t._lostConnection(new h.ConnectionError("DDP heartbeat timed out"))},sendPing:function(){t._send({msg:"ping"})}}),t._heartbeat.start()),t._lastSessionId&&(t._resetStores=!0),"string"==typeof e.session){var n=t._lastSessionId===e.session;t._lastSessionId=e.session}n||(t._updatesForUnknownStores={},t._resetStores&&(t._documentsWrittenByStub={},t._serverDocuments={}),t._afterUpdateCallbacks=[],t._subsBeingRevived={},a.each(t._subscriptions,function(e,n){e.ready&&(t._subsBeingRevived[n]=!0)}),t._methodsBlockingQuiescence={},t._resetStores&&a.each(t._methodInvokers,function(e){e.gotResult()?t._afterUpdateCallbacks.push(a.bind(e.dataVisible,e)):e.sentMessage&&(t._methodsBlockingQuiescence[e.methodId]=!0)}),t._messagesBufferedUntilQuiescence=[],t._waitingForQuiescence()||(t._resetStores&&(a.each(t._stores,function(e){e.beginUpdate(0,!0),e.endUpdate()}),t._resetStores=!1),t._runAfterUpdateCallbacks()))},_processOneDataMessage:function(e,t){var n=this;n["_process_"+e.msg](e,t)},_livedata_data:function(e){var t=this;if(t._waitingForQuiescence()){if(t._messagesBufferedUntilQuiescence.push(e),"nosub"===e.msg&&delete t._subsBeingRevived[e.id],a.each(e.subs||[],function(e){delete t._subsBeingRevived[e]}),a.each(e.methods||[],function(e){delete t._methodsBlockingQuiescence[e]}),t._waitingForQuiescence())return;a.each(t._messagesBufferedUntilQuiescence,function(e){t._processOneDataMessage(e,t._bufferedWrites)}),t._messagesBufferedUntilQuiescence=[]}else t._processOneDataMessage(e,t._bufferedWrites);var n=a.include(["added","changed","removed"],e.msg);if(0===t._bufferedWritesInterval||!n)return void t._flushBufferedWrites();if(null===t._bufferedWritesFlushAt)t._bufferedWritesFlushAt=(new Date).valueOf()+t._bufferedWritesMaxAge;else if(t._bufferedWritesFlushAt<(new Date).valueOf())return void t._flushBufferedWrites();t._bufferedWritesFlushHandle&&clearTimeout(t._bufferedWritesFlushHandle),t._bufferedWritesFlushHandle=setTimeout(t.__flushBufferedWrites,t._bufferedWritesInterval)},_flushBufferedWrites:function(){var e=this;e._bufferedWritesFlushHandle&&(clearTimeout(e._bufferedWritesFlushHandle),e._bufferedWritesFlushHandle=null),e._bufferedWritesFlushAt=null;var t=e._bufferedWrites;e._bufferedWrites={},e._performWrites(t)},_performWrites:function(e){var t=this;!t._resetStores&&a.isEmpty(e)||(a.each(t._stores,function(n,r){n.beginUpdate(a.has(e,r)?e[r].length:0,t._resetStores)}),t._resetStores=!1,a.each(e,function(e,n){var r=t._stores[n];r?a.each(e,function(e){r.update(e)}):(a.has(t._updatesForUnknownStores,n)||(t._updatesForUnknownStores[n]=[]),Array.prototype.push.apply(t._updatesForUnknownStores[n],e))}),a.each(t._stores,function(e){e.endUpdate()})),t._runAfterUpdateCallbacks()},_runAfterUpdateCallbacks:function(){var e=this,t=e._afterUpdateCallbacks;e._afterUpdateCallbacks=[],a.each(t,function(e){e()})},_pushUpdate:function(e,t,n){var r=this;a.has(e,t)||(e[t]=[]),e[t].push(n)},_getServerDoc:function(e,t){var n=this;if(!a.has(n._serverDocuments,e))return null;var r=n._serverDocuments[e];return r.get(t)||null},_process_added:function(e,t){var n=this,r=p.idParse(e.id),o=n._getServerDoc(e.collection,r);if(o){var i=void 0!==o.document;if(o.document=e.fields||{},o.document._id=r,n._resetStores){var s=n._stores[e.collection].getDoc(e.id);void 0!==s&&(e.fields=s),n._pushUpdate(t,e.collection,e)}else if(i)throw new Error("Server sent add for existing id: "+e.id)}else n._pushUpdate(t,e.collection,e)},_process_changed:function(e,t){var n=this,r=n._getServerDoc(e.collection,p.idParse(e.id));if(r){if(void 0===r.document)throw new Error("Server sent changed for nonexisting id: "+e.id);_.applyChanges(r.document,e.fields)}else n._pushUpdate(t,e.collection,e)},_process_removed:function(e,t){var n=this,r=n._getServerDoc(e.collection,p.idParse(e.id));if(r){if(void 0===r.document)throw new Error("Server sent removed for nonexisting id:"+e.id);r.document=void 0}else n._pushUpdate(t,e.collection,{msg:"removed",collection:e.collection,id:e.id})},_process_updated:function(e,t){var n=this;a.each(e.methods,function(e){a.each(n._documentsWrittenByStub[e],function(r){var o=n._getServerDoc(r.collection,r.id);if(!o)throw new Error("Lost serverDoc for "+JSON.stringify(r));if(!o.writtenByStubs[e])throw new Error("Doc "+JSON.stringify(r)+" not written by method "+e);delete o.writtenByStubs[e],a.isEmpty(o.writtenByStubs)&&(n._pushUpdate(t,r.collection,{msg:"replace",id:p.idStringify(r.id),replace:o.document}),a.each(o.flushCallbacks,function(e){e()}),n._serverDocuments[r.collection].remove(r.id))}),delete n._documentsWrittenByStub[e];var r=n._methodInvokers[e];if(!r)throw new Error("No callback invoker for method "+e);n._runWhenAllServerDocsAreFlushed(a.bind(r.dataVisible,r))})},_process_ready:function(e,t){var n=this;a.each(e.subs,function(e){n._runWhenAllServerDocsAreFlushed(function(){var t=n._subscriptions[e];t&&(t.ready||(t.ready=!0,t.readyCallback&&t.readyCallback(),t.readyDeps.changed()))})})},_runWhenAllServerDocsAreFlushed:function(e){var t=this,n=function(){t._afterUpdateCallbacks.push(e)},r=0,o=function(){--r,0===r&&n()};a.each(t._serverDocuments,function(e){e.forEach(function(e){var n=a.any(e.writtenByStubs,function(e,n){var r=t._methodInvokers[n];return r&&r.sentMessage});n&&(++r,e.flushCallbacks.push(o))})}),0===r&&n()},_livedata_nosub:function(t){var n=this;if(n._livedata_data(t),a.has(n._subscriptions,t.id)){var r=n._subscriptions[t.id].errorCallback,o=n._subscriptions[t.id].stopCallback;n._subscriptions[t.id].remove();var i=function(t){return t&&t.error&&new e.Error(t.error.error,t.error.reason,t.error.details)};r&&t.error&&r(i(t)),o&&o(i(t))}},_process_nosub:function(){},_livedata_result:function(t){var n=this;if(a.isEmpty(n._bufferedWrites)||n._flushBufferedWrites(),a.isEmpty(n._outstandingMethodBlocks))return void e._debug("Received method result but no methods outstanding");for(var r=n._outstandingMethodBlocks[0].methods,o,i=0;i<r.length&&(o=r[i],o.methodId!==t.id);i++);return o?(r.splice(i,1),void(a.has(t,"error")?o.receiveResult(new e.Error(t.error.error,t.error.reason,t.error.details)):o.receiveResult(void 0,t.result))):void e._debug("Can't match method response to original method call",t)},_outstandingMethodFinished:function(){var e=this;if(!e._anyMethodsAreOutstanding()){if(!a.isEmpty(e._outstandingMethodBlocks)){var t=e._outstandingMethodBlocks.shift();if(!a.isEmpty(t.methods))throw new Error("No methods outstanding but nonempty block: "+JSON.stringify(t));a.isEmpty(e._outstandingMethodBlocks)||e._sendOutstandingMethods()}e._maybeMigrate()}},_sendOutstandingMethods:function(){var e=this;a.isEmpty(e._outstandingMethodBlocks)||a.each(e._outstandingMethodBlocks[0].methods,function(e){e.sendMessage()})},_livedata_error:function(t){e._debug("Received error from server: ",t.reason),t.offendingMessage&&e._debug("For: ",t.offendingMessage)},_callOnReconnectAndSendAppropriateOutstandingMethods:function(){var e=this,t=e._outstandingMethodBlocks;if(e._outstandingMethodBlocks=[],e.onReconnect(),!a.isEmpty(t)){if(a.isEmpty(e._outstandingMethodBlocks))return e._outstandingMethodBlocks=t,void e._sendOutstandingMethods();a.last(e._outstandingMethodBlocks).wait||t[0].wait||(a.each(t[0].methods,function(t){a.last(e._outstandingMethodBlocks).methods.push(t),1===e._outstandingMethodBlocks.length&&t.sendMessage()}),t.shift()),a.each(t,function(t){e._outstandingMethodBlocks.push(t)})}},_readyToMigrate:function(){var e=this;return a.isEmpty(e._methodInvokers)},_maybeMigrate:function(){var e=this;e._retryMigrate&&e._readyToMigrate()&&(e._retryMigrate(),e._retryMigrate=null)}}),v.Connection=o,h.connect=function(e,t){var n=new o(e,t);return w.push(n),n},w=[],h._allSubscriptionsReady=function(){return a.all(w,function(e){return a.all(e._subscriptions,function(e){return e.ready})})}}.call(this),function(){if(e.refresh=function(e){},e.isClient){var t="/";"undefined"!=typeof __meteor_runtime_config__&&__meteor_runtime_config__.DDP_DEFAULT_CONNECTION_URL&&(t=__meteor_runtime_config__.DDP_DEFAULT_CONNECTION_URL);var n=new d,r=function(t){if(e._debug(t),Package.reload){var r=Package.reload.Reload._migrationData("livedata")||{},o=r.DDPVersionNegotiationFailures||0;++o,Package.reload.Reload._onMigrate("livedata",function(){return[!0,{DDPVersionNegotiationFailures:o}]}),n.retryLater(o,function(){Package.reload.Reload._reload()})}};e.connection=h.connect(t,{onDDPVersionNegotiationFailure:r}),a.each(["subscribe","methods","call","apply","status","reconnect","disconnect"],function(t){e[t]=a.bind(e.connection[t],e.connection)})}else e.connection=null;e.default_connection=e.connection,e.connect=h.connect}.call(this),"undefined"==typeof Package&&(Package={}),function(e,t){for(var n in t)n in e||(e[n]=t[n])}(Package["ddp-client"]={},{DDP:h,LivedataTest:v})}();
!function(){var a=Package["ddp-client"].DDP;"undefined"==typeof Package&&(Package={}),function(a,n){for(var e in n)e in a||(a[e]=n[e])}(Package.ddp={},{DDP:a})}();
!function(){"undefined"==typeof Package&&(Package={}),Package["ddp-server"]={}}();
!function(){var e=Package.meteor.Meteor,n=Package.meteor.global,r=Package.meteor.meteorEnv,t=Package.underscore._,o=Package.minimongo.LocalCollection,a=Package.minimongo.Minimongo,i=Package.check.check,c=Package.check.Match,l=Package.ejson.EJSON,s=Package["ddp-client"].DDP,d=Package.modules.meteorInstall,u=Package.modules.Buffer,f=Package.modules.process,h=Package["ecmascript-runtime"].Symbol,_=Package["ecmascript-runtime"].Map,m=Package["ecmascript-runtime"].Set,v=Package["babel-runtime"].meteorBabelHelpers,p=Package.promise.Promise,w,y=d({node_modules:{meteor:{"allow-deny":{"allow-deny.js":function(){function n(e,n){return e.transform?e.transform(n):n}function r(e,n,r){var t=n;return e.transform&&(t=l.clone(n),null!==r&&(t._id=r),t=e.transform(t)),t}function a(e,n,r){var a=["insert","update","remove","fetch","transform"];if(t.each(t.keys(r),function(e){if(!t.contains(a,e))throw new Error(n+": Invalid key: "+e)}),e._restricted=!0,t.each(["insert","update","remove"],function(t){if(r.hasOwnProperty(t)){if(!(r[t]instanceof Function))throw new Error(n+": Value for `"+t+"` must be a function");void 0===r.transform?r[t].transform=e._transform:r[t].transform=o.wrapTransform(r.transform),e._validators[t][n].push(r[t])}}),r.update||r.remove||r.fetch){if(r.fetch&&!(r.fetch instanceof Array))throw new Error(n+": Value for `fetch` must be an array");e._updateFetch(r.fetch)}}function d(n,r){if(!o._selectorIsIdPerhapsAsObject(n))throw new e.Error(403,"Not permitted. Untrusted code may only "+r+" documents by ID.")}function u(){var e=s._CurrentInvocation.get();return e&&e.isSimulation}w={CollectionPrototype:{}};var f=w.CollectionPrototype;f.allow=function(e){a(this,"allow",e)},f.deny=function(e){a(this,"deny",e)},f._defineMutationMethods=function(n){var r=this;n=n||{},r._restricted=!1,r._insecure=void 0,r._validators={insert:{allow:[],deny:[]},update:{allow:[],deny:[]},remove:{allow:[],deny:[]},upsert:{allow:[],deny:[]},fetch:[],fetchAllFields:!1},r._name&&(r._prefix="/"+r._name+"/",r._connection&&(r._connection===e.server||e.isClient)&&!function(){var o={};t.each(["insert","update","remove"],function(a){var l=r._prefix+a;if(n.useExisting){var s=e.isClient?"_methodHandlers":"method_handlers";if(r._connection[s]&&"function"==typeof r._connection[s][l])return}o[l]=function(){i(arguments,[c.Any]);var n=t.toArray(arguments);try{var o=null;if("insert"!==a||t.has(n[0],"_id")||(o=r._makeNewID()),this.isSimulation)return null!==o&&(n[0]._id=o),r._collection[a].apply(r._collection,n);if("insert"!==a&&d(n[0],a),r._restricted){if(0===r._validators[a].allow.length)throw new e.Error(403,"Access denied. No allow validators set on restricted collection for method '"+a+"'.");var l="_validated"+a.charAt(0).toUpperCase()+a.slice(1);return n.unshift(this.userId),"insert"===a&&n.push(o),r[l].apply(r,n)}if(r._isInsecure())return null!==o&&(n[0]._id=o),r._collection[a].apply(r._collection,n);throw new e.Error(403,"Access denied")}catch(n){throw"MongoError"===n.name||"MinimongoError"===n.name?new e.Error(409,n.toString()):n}}}),r._connection.methods(o)}())},f._updateFetch=function(e){var n=this;n._validators.fetchAllFields||(e?n._validators.fetch=t.union(n._validators.fetch,e):(n._validators.fetchAllFields=!0,n._validators.fetch=null))},f._isInsecure=function(){var e=this;return void 0===e._insecure?!!Package.insecure:e._insecure},f._validatedInsert=function(n,o,a){var i=this;if(t.any(i._validators.insert.deny,function(e){return e(n,r(e,o,a))}))throw new e.Error(403,"Access denied");if(t.all(i._validators.insert.allow,function(e){return!e(n,r(e,o,a))}))throw new e.Error(403,"Access denied");null!==a&&(o._id=a),i._collection.insert.call(i._collection,o)},f._validatedUpdate=function(r,a,c,l){var s=this;if(i(c,Object),l=t.clone(l)||{},!o._selectorIsIdPerhapsAsObject(a))throw new Error("validated update should be of a single ID");if(l.upsert)throw new e.Error(403,"Access denied. Upserts not allowed in a restricted collection.");var d="Access denied. In a restricted collection you can only update documents, not replace them. Use a Mongo update operator, such as '$set'.",u=[];if(t.isEmpty(c))throw new e.Error(403,d);t.each(c,function(n,r){if("$"!==r.charAt(0))throw new e.Error(403,d);if(!t.has(h,r))throw new e.Error(403,"Access denied. Operator "+r+" not allowed in a restricted collection.");t.each(t.keys(n),function(e){e.indexOf(".")!==-1&&(e=e.substring(0,e.indexOf("."))),t.contains(u,e)||u.push(e)})});var f={transform:null};s._validators.fetchAllFields||(f.fields={},t.each(s._validators.fetch,function(e){f.fields[e]=1}));var _=s._collection.findOne(a,f);if(!_)return 0;if(t.any(s._validators.update.deny,function(e){var t=n(e,_);return e(r,t,u,c)}))throw new e.Error(403,"Access denied");if(t.all(s._validators.update.allow,function(e){var t=n(e,_);return!e(r,t,u,c)}))throw new e.Error(403,"Access denied");return l._forbidReplace=!0,s._collection.update.call(s._collection,a,c,l)};var h={$inc:1,$set:1,$unset:1,$addToSet:1,$pop:1,$pullAll:1,$pull:1,$pushAll:1,$push:1,$bit:1};f._validatedRemove=function(r,o){var a=this,i={transform:null};a._validators.fetchAllFields||(i.fields={},t.each(a._validators.fetch,function(e){i.fields[e]=1}));var c=a._collection.findOne(o,i);if(!c)return 0;if(t.any(a._validators.remove.deny,function(e){return e(r,n(e,c))}))throw new e.Error(403,"Access denied");if(t.all(a._validators.remove.allow,function(e){return!e(r,n(e,c))}))throw new e.Error(403,"Access denied");return a._collection.remove.call(a._collection,o)},f._callMutatorMethod=function(){function n(n,r,t){!e.isClient||t||u()||(t=function(){function r(r){r&&e._debug(n+" failed: "+(r.reason||r.stack))}return r}());var o="update"===n||"remove"===n;o&&!u()&&d(r[0],n);var a=this._prefix+n;return this._connection.apply(a,r,{returnStubValue:!0},t)}return n}()}}}}},{extensions:[".js",".json"]});y("./node_modules/meteor/allow-deny/allow-deny.js"),"undefined"==typeof Package&&(Package={}),function(e,n){for(var r in n)r in e||(e[r]=n[r])}(Package["allow-deny"]={},{AllowDeny:w})}();
!function(){var e=Package.meteor.Meteor,n=Package.meteor.global,o=Package.meteor.meteorEnv,t=Package["allow-deny"].AllowDeny,r=Package.random.Random,i=Package.ejson.EJSON,c=Package.underscore._,l=Package.minimongo.LocalCollection,a=Package.minimongo.Minimongo,s=Package["ddp-client"].DDP,u=Package.tracker.Tracker,d=Package.tracker.Deps,f=Package["diff-sequence"].DiffSequence,_=Package["mongo-id"].MongoID,p=Package.check.check,m=Package.check.Match,g=Package.modules.meteorInstall,v=Package.modules.Buffer,h=Package.modules.process,w=Package["ecmascript-runtime"].Symbol,C=Package["ecmascript-runtime"].Map,y=Package["ecmascript-runtime"].Set,k=Package["babel-runtime"].meteorBabelHelpers,O=Package.promise.Promise,b,I,P=g({node_modules:{meteor:{mongo:{"local_collection_driver.js":function(){b=function e(){var n=this;n.noConnCollections={}};var e=function e(n,o){return n in o||(o[n]=new l(n)),o[n]};c.extend(b.prototype,{open:function(){function n(n,o){var t=this;return n?o?(o._mongo_livedata_collections||(o._mongo_livedata_collections={}),e(n,o._mongo_livedata_collections)):e(n,t.noConnCollections):new l}return n}()}),b=new b},"collection.js":function(n,o,i){function a(e){p(e,RegExp);var n={$regex:e.source},o="";return e.ignoreCase&&(o+="i"),e.multiline&&(o+="m"),o&&(n.$options=o),n}function u(e,n){if(e)return n=n||c.identity,function(o,t){e(o,!o&&n(t))}}function d(e){if(e.length&&(void 0===e[e.length-1]||e[e.length-1]instanceof Function))return e.pop()}I={},I.Collection=function(n,o){var t=this;if(!(t instanceof I.Collection))throw new Error('use "new" to construct a Mongo.Collection');if(n||null===n||(e._debug("Warning: creating anonymous collection. It will not be saved or synchronized over the network. (Pass null for the collection name to turn off this warning.)"),n=null),null!==n&&"string"!=typeof n)throw new Error("First argument to new Mongo.Collection must be a string or null");switch(o&&o.methods&&(o={connection:o}),o&&o.manager&&!o.connection&&(o.connection=o.manager),o=c.extend({connection:void 0,idGeneration:"STRING",transform:null,_driver:void 0,_preventAutopublish:!1},o),o.idGeneration){case"MONGO":t._makeNewID=function(){var e=n?s.randomStream("/collection/"+n):r.insecure;return new I.ObjectID(e.hexString(24))};break;case"STRING":default:t._makeNewID=function(){var e=n?s.randomStream("/collection/"+n):r.insecure;return e.id()}}if(t._transform=l.wrapTransform(o.transform),n&&null!==o.connection?o.connection?t._connection=o.connection:e.isClient?t._connection=e.connection:t._connection=e.server:t._connection=null,o._driver||(n&&t._connection===e.server&&"undefined"!=typeof MongoInternals&&MongoInternals.defaultRemoteCollectionDriver?o._driver=MongoInternals.defaultRemoteCollectionDriver():o._driver=b),t._collection=o._driver.open(n,t._connection),t._name=n,t._driver=o._driver,t._connection&&t._connection.registerStore){var i=t._connection.registerStore(n,{beginUpdate:function(){function e(e,n){(e>1||n)&&t._collection.pauseObservers(),n&&t._collection.remove({})}return e}(),update:function(){function e(e){var n=_.idParse(e.id),o=t._collection.findOne(n);if("replace"===e.msg){var r=e.replace;return void(r?o?t._collection.update(n,r):t._collection.insert(r):o&&t._collection.remove(n))}if("added"===e.msg){if(o)throw new Error("Expected not to find a document already present for an add");t._collection.insert(c.extend({_id:n},e.fields))}else if("removed"===e.msg){if(!o)throw new Error("Expected to find a document already present for removed");t._collection.remove(n)}else{if("changed"!==e.msg)throw new Error("I don't know how to deal with this message");if(!o)throw new Error("Expected to find a document to change");if(!c.isEmpty(e.fields)){var i={};c.each(e.fields,function(e,n){void 0===e?(i.$unset||(i.$unset={}),i.$unset[n]=1):(i.$set||(i.$set={}),i.$set[n]=e)}),t._collection.update(n,i)}}}return e}(),endUpdate:function(){function e(){t._collection.resumeObservers()}return e}(),saveOriginals:function(){function e(){t._collection.saveOriginals()}return e}(),retrieveOriginals:function(){function e(){return t._collection.retrieveOriginals()}return e}(),getDoc:function(){function e(e){return t.findOne(e)}return e}(),_getCollection:function(){function e(){return t}return e}()});if(!i){var a='There is already a collection named "'+n+'"';if(o._suppressSameNameError!==!0)throw new Error(a);console.warn?console.warn(a):console.log(a)}}if(o.defineMutationMethods!==!1)try{t._defineMutationMethods({useExisting:o._suppressSameNameError===!0})}catch(e){if(e.message==="A method named '/"+n+"/insert' is already defined")throw new Error('There is already a collection named "'+n+'"');throw e}Package.autopublish&&!o._preventAutopublish&&t._connection&&t._connection.publish&&t._connection.publish(null,function(){return t.find()},{is_auto:!0})},c.extend(I.Collection.prototype,{_getFindSelector:function(){function e(e){return 0==e.length?{}:e[0]}return e}(),_getFindOptions:function(){function e(e){var n=this;return e.length<2?{transform:n._transform}:(p(e[1],m.Optional(m.ObjectIncluding({fields:m.Optional(m.OneOf(Object,void 0)),sort:m.Optional(m.OneOf(Object,Array,Function,void 0)),limit:m.Optional(m.OneOf(Number,void 0)),skip:m.Optional(m.OneOf(Number,void 0))}))),c.extend({transform:n._transform},e[1]))}return e}(),find:function(){function e(){var e=this,n=c.toArray(arguments);return e._collection.find(e._getFindSelector(n),e._getFindOptions(n))}return e}(),findOne:function(){function e(){var e=this,n=c.toArray(arguments);return e._collection.findOne(e._getFindSelector(n),e._getFindOptions(n))}return e}()}),I.Collection._publishCursor=function(e,n,o){var t=e.observeChanges({added:function(){function e(e,t){n.added(o,e,t)}return e}(),changed:function(){function e(e,t){n.changed(o,e,t)}return e}(),removed:function(){function e(e){n.removed(o,e)}return e}()});return n.onStop(function(){t.stop()}),t},I.Collection._rewriteSelector=function(e){if(l._selectorIsId(e)&&(e={_id:e}),c.isArray(e))throw new Error("Mongo selector can't be an array.");if(!e||"_id"in e&&!e._id)return{_id:r.id()};var n={};return c.each(e,function(e,o){e instanceof RegExp?n[o]=a(e):e&&e.$regex instanceof RegExp?(n[o]=a(e.$regex),void 0!==e.$options&&(n[o].$options=e.$options)):c.contains(["$or","$and","$nor"],o)?n[o]=c.map(e,function(e){return I.Collection._rewriteSelector(e)}):n[o]=e}),n},I.Collection.prototype.insert=function(){function e(e,n){if(!e)throw new Error("insert requires an argument");if(e=c.extend({},e),"_id"in e){if(!e._id||!("string"==typeof e._id||e._id instanceof I.ObjectID))throw new Error("Meteor requires document _id fields to be non-empty strings or ObjectIDs")}else{var o=!0;if(this._isRemoteCollection()){var t=s._CurrentInvocation.get();t||(o=!1)}o&&(e._id=this._makeNewID())}var r=function(){function n(n){return e._id?e._id:(e._id=n,n)}return n}(),i=u(n,r);if(this._isRemoteCollection()){var l=this._callMutatorMethod("insert",[e],i);return r(l)}try{var a=this._collection.insert(e,i);return r(a)}catch(e){if(n)return n(e),null;throw e}}return e}(),I.Collection.prototype.update=function(){function e(e,n){for(var o=arguments.length,t=Array(o>2?o-2:0),r=2;r<o;r++)t[r-2]=arguments[r];var i=d(t);e=I.Collection._rewriteSelector(e);var l=c.clone(t[0])||{};if(l&&l.upsert)if(l.insertedId){if(!("string"==typeof l.insertedId||l.insertedId instanceof I.ObjectID))throw new Error("insertedId must be string or ObjectID")}else e._id||(l.insertedId=this._makeNewID());var a=u(i);if(this._isRemoteCollection()){var s=[e,n,l];return this._callMutatorMethod("update",s,a)}try{return this._collection.update(e,n,l,a)}catch(e){if(i)return i(e),null;throw e}}return e}(),I.Collection.prototype.remove=function(){function e(e,n){e=I.Collection._rewriteSelector(e);var o=u(n);if(this._isRemoteCollection())return this._callMutatorMethod("remove",[e],o);try{return this._collection.remove(e,o)}catch(e){if(n)return n(e),null;throw e}}return e}(),I.Collection.prototype._isRemoteCollection=function(){function n(){return this._connection&&this._connection!==e.server}return n}(),I.Collection.prototype.upsert=function(){function e(e,n,o,t){t||"function"!=typeof o||(t=o,o={});var r=c.extend({},o,{_returnObject:!0,upsert:!0});return this.update(e,n,r,t)}return e}(),I.Collection.prototype._ensureIndex=function(e,n){var o=this;if(!o._collection._ensureIndex)throw new Error("Can only call _ensureIndex on server collections");o._collection._ensureIndex(e,n)},I.Collection.prototype._dropIndex=function(e){var n=this;if(!n._collection._dropIndex)throw new Error("Can only call _dropIndex on server collections");n._collection._dropIndex(e)},I.Collection.prototype._dropCollection=function(){var e=this;if(!e._collection.dropCollection)throw new Error("Can only call _dropCollection on server collections");e._collection.dropCollection()},I.Collection.prototype._createCappedCollection=function(e,n){var o=this;if(!o._collection._createCappedCollection)throw new Error("Can only call _createCappedCollection on server collections");o._collection._createCappedCollection(e,n)},I.Collection.prototype.rawCollection=function(){var e=this;if(!e._collection.rawCollection)throw new Error("Can only call rawCollection on server collections");return e._collection.rawCollection()},I.Collection.prototype.rawDatabase=function(){var e=this;if(!e._driver.mongo||!e._driver.mongo.db)throw new Error("Can only call rawDatabase on server collections");return e._driver.mongo.db},I.ObjectID=_.ObjectID,I.Cursor=l.Cursor,I.Collection.Cursor=I.Cursor,I.Collection.ObjectID=I.ObjectID,e.Collection=I.Collection,c.extend(e.Collection.prototype,t.CollectionPrototype)}}}}},{extensions:[".js",".json"]});P("./node_modules/meteor/mongo/local_collection_driver.js"),P("./node_modules/meteor/mongo/collection.js"),"undefined"==typeof Package&&(Package={}),function(e,n){for(var o in n)o in e||(e[o]=n[o])}(Package.mongo={},{Mongo:I})}();
!function(){"undefined"==typeof Package&&(Package={}),Package["blaze-html-templates"]={}}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,n=Package.meteor.meteorEnv,a=Package.tracker.Tracker,r=Package.tracker.Deps,i;(function(){i=function(e,t){return this instanceof i?(this.curValue=e,this.equalsFunc=t,void(this.dep=new a.Dependency)):new i(e,t)},i._isEqual=function(e,t){var n=e,a=t;return n===a&&(!n||"number"==typeof n||"boolean"==typeof n||"string"==typeof n)},i.prototype.get=function(){return a.active&&this.dep.depend(),this.curValue},i.prototype.set=function(e){var t=this.curValue;(this.equalsFunc||i._isEqual)(t,e)||(this.curValue=e,this.dep.changed())},i.prototype.toString=function(){return"ReactiveVar{"+this.get()+"}"},i.prototype._numListeners=function(){var e=0;for(var t in this.dep._dependentsById)e++;return e}}).call(this),"undefined"==typeof Package&&(Package={}),function(e,t){for(var n in t)n in e||(e[n]=t[n])}(Package["reactive-var"]={},{ReactiveVar:i})}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,n=Package.meteor.meteorEnv,r=Package.modules.meteorInstall,i=Package.modules.Buffer,o=Package.modules.process,a,s,l=r({node_modules:{meteor:{jquery:{"main.js":["jquery","./jquery.js",function(e,t){var n=this;try{var r=e("jquery")}catch(t){r=e("./jquery.js")}t.$=t.jQuery=r,n.$=n.$||r,n.jQuery=n.jQuery||r}],"jquery.js":function(e,t,n){!function(e,t){"object"==typeof n&&"object"==typeof n.exports?n.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(e){var t=e.length,n=ie.type(e);return"function"!==n&&!ie.isWindow(e)&&(!(1!==e.nodeType||!t)||("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e))}function r(e,t,n){if(ie.isFunction(t))return ie.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return ie.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(de.test(t))return ie.filter(t,e,n);t=ie.filter(t,e)}return ie.grep(e,function(e){return ie.inArray(e,t)>=0!==n})}function i(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function o(e){var t=xe[e]={};return ie.each(e.match(be)||[],function(e,n){t[n]=!0}),t}function a(){he.addEventListener?(he.removeEventListener("DOMContentLoaded",s,!1),e.removeEventListener("load",s,!1)):(he.detachEvent("onreadystatechange",s),e.detachEvent("onload",s))}function s(){(he.addEventListener||"load"===event.type||"complete"===he.readyState)&&(a(),ie.ready())}function l(e,t,n){if(void 0===n&&1===e.nodeType){var r="data-"+t.replace(Ee,"-$1").toLowerCase();if(n=e.getAttribute(r),"string"==typeof n){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:Ne.test(n)?ie.parseJSON(n):n)}catch(e){}ie.data(e,t,n)}else n=void 0}return n}function u(e){var t;for(t in e)if(("data"!==t||!ie.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function c(e,t,n,r){if(ie.acceptData(e)){var i,o,a=ie.expando,s=e.nodeType,l=s?ie.cache:e,u=s?e[a]:e[a]&&a;if(u&&l[u]&&(r||l[u].data)||void 0!==n||"string"!=typeof t)return u||(u=s?e[a]=Q.pop()||ie.guid++:a),l[u]||(l[u]=s?{}:{toJSON:ie.noop}),"object"!=typeof t&&"function"!=typeof t||(r?l[u]=ie.extend(l[u],t):l[u].data=ie.extend(l[u].data,t)),o=l[u],r||(o.data||(o.data={}),o=o.data),void 0!==n&&(o[ie.camelCase(t)]=n),"string"==typeof t?(i=o[t],null==i&&(i=o[ie.camelCase(t)])):i=o,i}}function f(e,t,n){if(ie.acceptData(e)){var r,i,o=e.nodeType,a=o?ie.cache:e,s=o?e[ie.expando]:ie.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){ie.isArray(t)?t=t.concat(ie.map(t,ie.camelCase)):t in r?t=[t]:(t=ie.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;for(;i--;)delete r[t[i]];if(n?!u(r):!ie.isEmptyObject(r))return}(n||(delete a[s].data,u(a[s])))&&(o?ie.cleanData([e],!0):ne.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}function d(){return!0}function p(){return!1}function h(){try{return he.activeElement}catch(e){}}function m(e){var t=Fe.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function g(e,t){var n,r,i=0,o=typeof e.getElementsByTagName!==Te?e.getElementsByTagName(t||"*"):typeof e.querySelectorAll!==Te?e.querySelectorAll(t||"*"):void 0;if(!o)for(o=[],n=e.childNodes||e;null!=(r=n[i]);i++)!t||ie.nodeName(r,t)?o.push(r):ie.merge(o,g(r,t));return void 0===t||t&&ie.nodeName(e,t)?ie.merge([e],o):o}function y(e){De.test(e.type)&&(e.defaultChecked=e.checked)}function v(e,t){return ie.nodeName(e,"table")&&ie.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function b(e){return e.type=(null!==ie.find.attr(e,"type"))+"/"+e.type,e}function x(e){var t=Ve.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function w(e,t){for(var n,r=0;null!=(n=e[r]);r++)ie._data(n,"globalEval",!t||ie._data(t[r],"globalEval"))}function T(e,t){if(1===t.nodeType&&ie.hasData(e)){var n,r,i,o=ie._data(e),a=ie._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;r<i;r++)ie.event.add(t,n,s[n][r])}a.data&&(a.data=ie.extend({},a.data))}}function C(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!ne.noCloneEvent&&t[ie.expando]){i=ie._data(t);for(r in i.events)ie.removeEvent(t,r,i.handle);t.removeAttribute(ie.expando)}"script"===n&&t.text!==e.text?(b(t).text=e.text,x(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),ne.html5Clone&&e.innerHTML&&!ie.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&De.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}}function N(t,n){var r,i=ie(n.createElement(t)).appendTo(n.body),o=e.getDefaultComputedStyle&&(r=e.getDefaultComputedStyle(i[0]))?r.display:ie.css(i[0],"display");return i.detach(),o}function E(e){var t=he,n=Ze[e];return n||(n=N(e,t),"none"!==n&&n||(Ke=(Ke||ie("<iframe frameborder='0' width='0' height='0'/>")).appendTo(t.documentElement),t=(Ke[0].contentWindow||Ke[0].contentDocument).document,t.write(),t.close(),n=N(e,t),Ke.detach()),Ze[e]=n),n}function k(e,t){return{get:function(){var n=e();if(null!=n)return n?void delete this.get:(this.get=t).apply(this,arguments)}}}function S(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=dt.length;i--;)if(t=dt[i]+n,t in e)return t;return r}function j(e,t){for(var n,r,i,o=[],a=0,s=e.length;a<s;a++)r=e[a],r.style&&(o[a]=ie._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&je(r)&&(o[a]=ie._data(r,"olddisplay",E(r.nodeName)))):(i=je(r),(n&&"none"!==n||!i)&&ie._data(r,"olddisplay",i?n:ie.css(r,"display"))));for(a=0;a<s;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}function A(e,t,n){var r=lt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function D(e,t,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;o<4;o+=2)"margin"===n&&(a+=ie.css(e,n+Se[o],!0,i)),r?("content"===n&&(a-=ie.css(e,"padding"+Se[o],!0,i)),"margin"!==n&&(a-=ie.css(e,"border"+Se[o]+"Width",!0,i))):(a+=ie.css(e,"padding"+Se[o],!0,i),"padding"!==n&&(a+=ie.css(e,"border"+Se[o]+"Width",!0,i)));return a}function L(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=nt(e),a=ne.boxSizing&&"border-box"===ie.css(e,"boxSizing",!1,o);if(i<=0||null==i){if(i=rt(e,t,o),(i<0||null==i)&&(i=e.style[t]),tt.test(i))return i;r=a&&(ne.boxSizingReliable()||i===e.style[t]),i=parseFloat(i)||0}return i+D(e,t,n||(a?"border":"content"),r,o)+"px"}function H(e,t,n,r,i){return new H.prototype.init(e,t,n,r,i)}function q(){return setTimeout(function(){pt=void 0}),pt=ie.now()}function _(e,t){var n,r={height:e},i=0;for(t=t?1:0;i<4;i+=2-t)n=Se[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function M(e,t,n){for(var r,i=(bt[t]||[]).concat(bt["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function F(e,t,n){var r,i,o,a,s,l,u,c,f=this,d={},p=e.style,h=e.nodeType&&je(e),m=ie._data(e,"fxshow");n.queue||(s=ie._queueHooks(e,"fx"),null==s.unqueued&&(s.unqueued=0,l=s.empty.fire,s.empty.fire=function(){s.unqueued||l()}),s.unqueued++,f.always(function(){f.always(function(){s.unqueued--,ie.queue(e,"fx").length||s.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],u=ie.css(e,"display"),c="none"===u?ie._data(e,"olddisplay")||E(e.nodeName):u,"inline"===c&&"none"===ie.css(e,"float")&&(ne.inlineBlockNeedsLayout&&"inline"!==E(e.nodeName)?p.zoom=1:p.display="inline-block")),n.overflow&&(p.overflow="hidden",ne.shrinkWrapBlocks()||f.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t)if(i=t[r],mt.exec(i)){if(delete t[r],o=o||"toggle"===i,i===(h?"hide":"show")){if("show"!==i||!m||void 0===m[r])continue;h=!0}d[r]=m&&m[r]||ie.style(e,r)}else u=void 0;if(ie.isEmptyObject(d))"inline"===("none"===u?E(e.nodeName):u)&&(p.display=u);else{m?"hidden"in m&&(h=m.hidden):m=ie._data(e,"fxshow",{}),o&&(m.hidden=!h),h?ie(e).show():f.done(function(){ie(e).hide()}),f.done(function(){var t;ie._removeData(e,"fxshow");for(t in d)ie.style(e,t,d[t])});for(r in d)a=M(h?m[r]:0,r,f),r in m||(m[r]=a.start,h&&(a.end=a.start,a.start="width"===r||"height"===r?1:0))}}function O(e,t){var n,r,i,o,a;for(n in e)if(r=ie.camelCase(n),i=t[r],o=e[n],ie.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=ie.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}function P(e,t,n){var r,i,o=0,a=vt.length,s=ie.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;for(var t=pt||q(),n=Math.max(0,u.startTime+u.duration-t),r=n/u.duration||0,o=1-r,a=0,l=u.tweens.length;a<l;a++)u.tweens[a].run(o);return s.notifyWith(e,[u,o,n]),o<1&&l?n:(s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:ie.extend({},t),opts:ie.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:pt||q(),duration:n.duration,tweens:[],createTween:function(t,n){var r=ie.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)u.tweens[n].run(1);return t?s.resolveWith(e,[u,t]):s.rejectWith(e,[u,t]),this}}),c=u.props;for(O(c,u.opts.specialEasing);o<a;o++)if(r=vt[o].call(u,e,c,u.opts))return r;return ie.map(c,M,u),ie.isFunction(u.opts.start)&&u.opts.start.call(e,u),ie.fx.timer(ie.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function B(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(be)||[];if(ie.isFunction(n))for(;r=o[i++];)"+"===r.charAt(0)?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function R(e,t,n,r){function i(s){var l;return o[s]=!0,ie.each(e[s]||[],function(e,s){var u=s(t,n,r);return"string"!=typeof u||a||o[u]?a?!(l=u):void 0:(t.dataTypes.unshift(u),i(u),!1)}),l}var o={},a=e===zt;return i(t.dataTypes[0])||!o["*"]&&i("*")}function W(e,t){var n,r,i=ie.ajaxSettings.flatOptions||{};for(r in t)void 0!==t[r]&&((i[r]?e:n||(n={}))[r]=t[r]);return n&&ie.extend(!0,e,n),e}function $(e,t,n){for(var r,i,o,a,s=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===i&&(i=e.mimeType||t.getResponseHeader("Content-Type"));if(i)for(a in s)if(s[a]&&s[a].test(i)){l.unshift(a);break}if(l[0]in n)o=l[0];else{for(a in n){if(!l[0]||e.converters[a+" "+l[0]]){o=a;break}r||(r=a)}o=o||r}if(o)return o!==l[0]&&l.unshift(o),n[o]}function z(e,t,n,r){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(a=u[l+" "+o]||u["* "+o],!a)for(i in u)if(s=i.split(" "),s[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){a===!0?a=u[i]:u[i]!==!0&&(o=s[0],c.unshift(s[1]));break}if(a!==!0)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}function I(e,t,n,r){var i;if(ie.isArray(t))ie.each(t,function(t,i){n||Ut.test(e)?r(e,i):I(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==ie.type(t))r(e,t);else for(i in t)I(e+"["+i+"]",t[i],n,r)}function X(){try{return new e.XMLHttpRequest}catch(e){}}function U(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}function V(e){return ie.isWindow(e)?e:9===e.nodeType&&(e.defaultView||e.parentWindow)}var Q=[],J=Q.slice,Y=Q.concat,G=Q.push,K=Q.indexOf,Z={},ee=Z.toString,te=Z.hasOwnProperty,ne={},re="1.11.2",ie=function(e,t){return new ie.fn.init(e,t)},oe=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,ae=/^-ms-/,se=/-([\da-z])/gi,le=function(e,t){return t.toUpperCase()};ie.fn=ie.prototype={jquery:re,constructor:ie,selector:"",length:0,toArray:function(){return J.call(this)},get:function(e){return null!=e?e<0?this[e+this.length]:this[e]:J.call(this)},pushStack:function(e){var t=ie.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return ie.each(this,e,t)},map:function(e){return this.pushStack(ie.map(this,function(t,n){return e.call(t,n,t)}))},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]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:G,sort:Q.sort,splice:Q.splice},ie.extend=ie.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,l=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[s]||{},s++),"object"==typeof a||ie.isFunction(a)||(a={}),s===l&&(a=this,s--);s<l;s++)if(null!=(i=arguments[s]))for(r in i)e=a[r],n=i[r],a!==n&&(u&&n&&(ie.isPlainObject(n)||(t=ie.isArray(n)))?(t?(t=!1,o=e&&ie.isArray(e)?e:[]):o=e&&ie.isPlainObject(e)?e:{},a[r]=ie.extend(u,o,n)):void 0!==n&&(a[r]=n));return a},ie.extend({expando:"jQuery"+(re+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return"function"===ie.type(e)},isArray:Array.isArray||function(e){return"array"===ie.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!ie.isArray(e)&&e-parseFloat(e)+1>=0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},isPlainObject:function(e){var t;if(!e||"object"!==ie.type(e)||e.nodeType||ie.isWindow(e))return!1;try{if(e.constructor&&!te.call(e,"constructor")&&!te.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}if(ne.ownLast)for(t in e)return te.call(e,t);for(t in e);return void 0===t||te.call(e,t)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?Z[ee.call(e)]||"object":typeof e},globalEval:function(t){t&&ie.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(ae,"ms-").replace(se,le)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,r){var i,o=0,a=e.length,s=n(e);if(r){if(s)for(;o<a&&(i=t.apply(e[o],r),i!==!1);o++);else for(o in e)if(i=t.apply(e[o],r),i===!1)break}else if(s)for(;o<a&&(i=t.call(e[o],o,e[o]),i!==!1);o++);else for(o in e)if(i=t.call(e[o],o,e[o]),i===!1)break;return e},trim:function(e){return null==e?"":(e+"").replace(oe,"")},makeArray:function(e,t){var r=t||[];return null!=e&&(n(Object(e))?ie.merge(r,"string"==typeof e?[e]:e):G.call(r,e)),r},inArray:function(e,t,n){var r;if(t){if(K)return K.call(t,e,n);for(r=t.length,n=n?n<0?Math.max(0,r+n):n:0;n<r;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;)e[i++]=t[r++];if(n!==n)for(;void 0!==t[r];)e[i++]=t[r++];return e.length=i,e},grep:function(e,t,n){for(var r,i=[],o=0,a=e.length,s=!n;o<a;o++)r=!t(e[o],o),r!==s&&i.push(e[o]);return i},map:function(e,t,r){var i,o=0,a=e.length,s=n(e),l=[];if(s)for(;o<a;o++)i=t(e[o],o,r),null!=i&&l.push(i);else for(o in e)i=t(e[o],o,r),null!=i&&l.push(i);return Y.apply([],l)},guid:1,proxy:function(e,t){var n,r,i;if("string"==typeof t&&(i=e[t],t=e,e=i),ie.isFunction(e))return n=J.call(arguments,2),r=function(){return e.apply(t||this,n.concat(J.call(arguments)))},r.guid=e.guid=e.guid||ie.guid++,r},now:function(){return+new Date},support:ne}),ie.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){Z["[object "+t+"]"]=t.toLowerCase()});var ue=function(e){function t(e,t,n,r){var i,o,a,s,l,u,f,p,h,m;if((t?t.ownerDocument||t:R)!==H&&L(t),t=t||H,n=n||[],s=t.nodeType,"string"!=typeof e||!e||1!==s&&9!==s&&11!==s)return n;if(!r&&_){if(11!==s&&(i=ve.exec(e)))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&P(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return K.apply(n,t.getElementsByTagName(e)),n;if((a=i[3])&&w.getElementsByClassName)return K.apply(n,t.getElementsByClassName(a)),n}if(w.qsa&&(!M||!M.test(e))){if(p=f=B,h=t,m=1!==s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(u=E(e),(f=t.getAttribute("id"))?p=f.replace(xe,"\\$&"):t.setAttribute("id",p),p="[id='"+p+"'] ",l=u.length;l--;)u[l]=p+d(u[l]);h=be.test(e)&&c(t.parentNode)||t,m=u.join(",")}if(m)try{return K.apply(n,h.querySelectorAll(m)),n}catch(e){}finally{f||t.removeAttribute("id")}}}return S(e.replace(le,"$1"),t,n,r)}function n(){function e(n,r){return t.push(n+" ")>T.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[B]=!0,e}function i(e){var t=H.createElement("div");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=e.length;r--;)T.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||V)-(~e.sourceIndex||V);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function u(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function c(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function f(){}function d(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function p(e,t,n){var r=t.dir,i=n&&"parentNode"===r,o=$++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,l,u=[W,o];if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i){if(l=t[B]||(t[B]={}),(s=l[r])&&s[0]===W&&s[1]===o)return u[2]=s[2];if(l[r]=u,u[2]=e(t,n,a))return!0}}}function h(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function m(e,n,r){for(var i=0,o=n.length;i<o;i++)t(e,n[i],r);return r}function g(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,u=null!=t;s<l;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),u&&t.push(s)));return a}function y(e,t,n,i,o,a){return i&&!i[B]&&(i=y(i)),o&&!o[B]&&(o=y(o,a)),r(function(r,a,s,l){var u,c,f,d=[],p=[],h=a.length,y=r||m(t||"*",s.nodeType?[s]:s,[]),v=!e||!r&&t?y:g(y,d,e,s,l),b=n?o||(r?e:h||i)?[]:a:v;if(n&&n(v,b,s,l),i)for(u=g(b,p),i(u,[],s,l),c=u.length;c--;)(f=u[c])&&(b[p[c]]=!(v[p[c]]=f));if(r){if(o||e){if(o){for(u=[],c=b.length;c--;)(f=b[c])&&u.push(v[c]=f);o(null,b=[],u,l)}for(c=b.length;c--;)(f=b[c])&&(u=o?ee(r,f):d[c])>-1&&(r[u]=!(a[u]=f))}}else b=g(b===a?b.splice(h,b.length):b),o?o(null,a,b,l):K.apply(a,b)})}function v(e){for(var t,n,r,i=e.length,o=T.relative[e[0].type],a=o||T.relative[" "],s=o?1:0,l=p(function(e){return e===t},a,!0),u=p(function(e){return ee(t,e)>-1},a,!0),c=[function(e,n,r){var i=!o&&(r||n!==j)||((t=n).nodeType?l(e,n,r):u(e,n,r));return t=null,i}];s<i;s++)if(n=T.relative[e[s].type])c=[p(h(c),n)];else{if(n=T.filter[e[s].type].apply(null,e[s].matches),n[B]){for(r=++s;r<i&&!T.relative[e[r].type];r++);return y(s>1&&h(c),s>1&&d(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(le,"$1"),n,s<r&&v(e.slice(s,r)),r<i&&v(e=e.slice(r)),r<i&&d(e))}c.push(n)}return h(c)}function b(e,n){var i=n.length>0,o=e.length>0,a=function(r,a,s,l,u){var c,f,d,p=0,h="0",m=r&&[],y=[],v=j,b=r||o&&T.find.TAG("*",u),x=W+=null==v?1:Math.random()||.1,w=b.length;for(u&&(j=a!==H&&a);h!==w&&null!=(c=b[h]);h++){if(o&&c){for(f=0;d=e[f++];)if(d(c,a,s)){l.push(c);break}u&&(W=x)}i&&((c=!d&&c)&&p--,r&&m.push(c))}if(p+=h,i&&h!==p){for(f=0;d=n[f++];)d(m,y,a,s);if(r){if(p>0)for(;h--;)m[h]||y[h]||(y[h]=Y.call(l));y=g(y)}K.apply(l,y),u&&!r&&y.length>0&&p+n.length>1&&t.uniqueSort(l)}return u&&(W=x,j=v),m};return i?r(a):a}var x,w,T,C,N,E,k,S,j,A,D,L,H,q,_,M,F,O,P,B="sizzle"+1*new Date,R=e.document,W=0,$=0,z=n(),I=n(),X=n(),U=function(e,t){return e===t&&(D=!0),0},V=1<<31,Q={}.hasOwnProperty,J=[],Y=J.pop,G=J.push,K=J.push,Z=J.slice,ee=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},te="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",ne="[\\x20\\t\\r\\n\\f]",re="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ie=re.replace("w","w#"),oe="\\["+ne+"*("+re+")(?:"+ne+"*([*^$|!~]?=)"+ne+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ie+"))|)"+ne+"*\\]",ae=":("+re+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+oe+")*)|.*)\\)|)",se=new RegExp(ne+"+","g"),le=new RegExp("^"+ne+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ne+"+$","g"),ue=new RegExp("^"+ne+"*,"+ne+"*"),ce=new RegExp("^"+ne+"*([>+~]|"+ne+")"+ne+"*"),fe=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),de=new RegExp(ae),pe=new RegExp("^"+ie+"$"),he={ID:new RegExp("^#("+re+")"),CLASS:new RegExp("^\\.("+re+")"),TAG:new RegExp("^("+re.replace("w","w*")+")"),ATTR:new RegExp("^"+oe),PSEUDO:new RegExp("^"+ae),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},me=/^(?:input|select|textarea|button)$/i,ge=/^h\d$/i,ye=/^[^{]+\{\s*\[native \w/,ve=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,be=/[+~]/,xe=/'|\\/g,we=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),Te=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},Ce=function(){L()};try{K.apply(J=Z.call(R.childNodes),R.childNodes),J[R.childNodes.length].nodeType}catch(e){K={apply:J.length?function(e,t){G.apply(e,Z.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}w=t.support={},N=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},L=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:R;return r!==H&&9===r.nodeType&&r.documentElement?(H=r,q=r.documentElement,n=r.defaultView,n&&n!==n.top&&(n.addEventListener?n.addEventListener("unload",Ce,!1):n.attachEvent&&n.attachEvent("onunload",Ce)),_=!N(r),w.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),w.getElementsByTagName=i(function(e){return e.appendChild(r.createComment("")),!e.getElementsByTagName("*").length}),w.getElementsByClassName=ye.test(r.getElementsByClassName),w.getById=i(function(e){return q.appendChild(e).id=B,!r.getElementsByName||!r.getElementsByName(B).length}),w.getById?(T.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&_){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},T.filter.ID=function(e){var t=e.replace(we,Te);return function(e){return e.getAttribute("id")===t}}):(delete T.find.ID,T.filter.ID=function(e){var t=e.replace(we,Te);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),T.find.TAG=w.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):w.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},T.find.CLASS=w.getElementsByClassName&&function(e,t){if(_)return t.getElementsByClassName(e)},F=[],M=[],(w.qsa=ye.test(r.querySelectorAll))&&(i(function(e){q.appendChild(e).innerHTML="<a id='"+B+"'></a><select id='"+B+"-\f]' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&M.push("[*^$]="+ne+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||M.push("\\["+ne+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+B+"-]").length||M.push("~="),e.querySelectorAll(":checked").length||M.push(":checked"),e.querySelectorAll("a#"+B+"+*").length||M.push(".#.+[+~]")}),i(function(e){var t=r.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&M.push("name"+ne+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||M.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),M.push(",.*:")})),(w.matchesSelector=ye.test(O=q.matches||q.webkitMatchesSelector||q.mozMatchesSelector||q.oMatchesSelector||q.msMatchesSelector))&&i(function(e){w.disconnectedMatch=O.call(e,"div"),O.call(e,"[s!='']:x"),F.push("!=",ae)}),M=M.length&&new RegExp(M.join("|")),F=F.length&&new RegExp(F.join("|")),t=ye.test(q.compareDocumentPosition),P=t||ye.test(q.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},U=t?function(e,t){if(e===t)return D=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!w.sortDetached&&t.compareDocumentPosition(e)===n?e===r||e.ownerDocument===R&&P(R,e)?-1:t===r||t.ownerDocument===R&&P(R,t)?1:A?ee(A,e)-ee(A,t):0:4&n?-1:1)}:function(e,t){if(e===t)return D=!0,0;var n,i=0,o=e.parentNode,s=t.parentNode,l=[e],u=[t];if(!o||!s)return e===r?-1:t===r?1:o?-1:s?1:A?ee(A,e)-ee(A,t):0;if(o===s)return a(e,t);for(n=e;n=n.parentNode;)l.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;l[i]===u[i];)i++;return i?a(l[i],u[i]):l[i]===R?-1:u[i]===R?1:0},r):H},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==H&&L(e),n=n.replace(fe,"='$1']"),w.matchesSelector&&_&&(!F||!F.test(n))&&(!M||!M.test(n)))try{var r=O.call(e,n);if(r||w.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return t(n,H,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==H&&L(e),P(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==H&&L(e);var n=T.attrHandle[t.toLowerCase()],r=n&&Q.call(T.attrHandle,t.toLowerCase())?n(e,t,!_):void 0;return void 0!==r?r:w.attributes||!_?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,i=0;if(D=!w.detectDuplicates,A=!w.sortStable&&e.slice(0),e.sort(U),D){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return A=null,e},C=t.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=C(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=C(t);return n},T=t.selectors={cacheLength:50,createPseudo:r,match:he,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(we,Te),e[3]=(e[3]||e[4]||e[5]||"").replace(we,Te),"~="===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]||t.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]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return he.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&de.test(n)&&(t=E(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(we,Te).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=z[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&z(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(i){var o=t.attr(i,e);return null==o?"!="===n:!n||(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o.replace(se," ")+" ").indexOf(r)>-1:"|="===n&&(o===r||o.slice(0,r.length+1)===r+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,f,d,p,h,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s;if(g){if(o){for(;m;){for(f=t;f=f[m];)if(s?f.nodeName.toLowerCase()===y:1===f.nodeType)return!1;h=m="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?g.firstChild:g.lastChild],a&&v){for(c=g[B]||(g[B]={}),u=c[e]||[],p=u[0]===W&&u[1],d=u[0]===W&&u[2],f=p&&g.childNodes[p];f=++p&&f&&f[m]||(d=p=0)||h.pop();)if(1===f.nodeType&&++d&&f===t){c[e]=[W,p,d];break}}else if(v&&(u=(t[B]||(t[B]={}))[e])&&u[0]===W)d=u[1];else for(;(f=++p&&f&&f[m]||(d=p=0)||h.pop())&&((s?f.nodeName.toLowerCase()!==y:1!==f.nodeType)||!++d||(v&&((f[B]||(f[B]={}))[e]=[W,d]),f!==t)););return d-=i,d===r||d%r===0&&d/r>=0}}},PSEUDO:function(e,n){var i,o=T.pseudos[e]||T.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[B]?o(n):o.length>1?(i=[e,e,"",n],T.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),a=i.length;a--;)r=ee(e,i[a]),e[r]=!(t[r]=i[a])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=k(e.replace(le,"$1"));return i[B]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(we,Te),function(t){return(t.textContent||t.innerText||C(t)).indexOf(e)>-1}}),lang:r(function(e){return pe.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(we,Te).toLowerCase(),function(t){var n;do if(n=_?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===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===q},focus:function(e){return e===H.activeElement&&(!H.hasFocus||H.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},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,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!T.pseudos.empty(e)},header:function(e){return ge.test(e.nodeName)},input:function(e){return me.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"))||"text"===t.toLowerCase())},first:u(function(){return[0]}),last:u(function(e,t){return[t-1]}),eq:u(function(e,t,n){return[n<0?n+t:n]}),even:u(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:u(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:u(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:u(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}},T.pseudos.nth=T.pseudos.eq;for(x in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})T.pseudos[x]=s(x);for(x in{submit:!0,reset:!0})T.pseudos[x]=l(x);return f.prototype=T.filters=T.pseudos,
T.setFilters=new f,E=t.tokenize=function(e,n){var r,i,o,a,s,l,u,c=I[e+" "];if(c)return n?0:c.slice(0);for(s=e,l=[],u=T.preFilter;s;){r&&!(i=ue.exec(s))||(i&&(s=s.slice(i[0].length)||s),l.push(o=[])),r=!1,(i=ce.exec(s))&&(r=i.shift(),o.push({value:r,type:i[0].replace(le," ")}),s=s.slice(r.length));for(a in T.filter)!(i=he[a].exec(s))||u[a]&&!(i=u[a](i))||(r=i.shift(),o.push({value:r,type:a,matches:i}),s=s.slice(r.length));if(!r)break}return n?s.length:s?t.error(e):I(e,l).slice(0)},k=t.compile=function(e,t){var n,r=[],i=[],o=X[e+" "];if(!o){for(t||(t=E(e)),n=t.length;n--;)o=v(t[n]),o[B]?r.push(o):i.push(o);o=X(e,b(i,r)),o.selector=e}return o},S=t.select=function(e,t,n,r){var i,o,a,s,l,u="function"==typeof e&&e,f=!r&&E(e=u.selector||e);if(n=n||[],1===f.length){if(o=f[0]=f[0].slice(0),o.length>2&&"ID"===(a=o[0]).type&&w.getById&&9===t.nodeType&&_&&T.relative[o[1].type]){if(t=(T.find.ID(a.matches[0].replace(we,Te),t)||[])[0],!t)return n;u&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=he.needsContext.test(e)?0:o.length;i--&&(a=o[i],!T.relative[s=a.type]);)if((l=T.find[s])&&(r=l(a.matches[0].replace(we,Te),be.test(o[0].type)&&c(t.parentNode)||t))){if(o.splice(i,1),e=r.length&&d(o),!e)return K.apply(n,r),n;break}}return(u||k(e,f))(r,t,!_,n,be.test(e)&&c(t.parentNode)||t),n},w.sortStable=B.split("").sort(U).join("")===B,w.detectDuplicates=!!D,L(),w.sortDetached=i(function(e){return 1&e.compareDocumentPosition(H.createElement("div"))}),i(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),w.attributes&&i(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(te,function(e,t,n){var r;if(!n)return e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),t}(e);ie.find=ue,ie.expr=ue.selectors,ie.expr[":"]=ie.expr.pseudos,ie.unique=ue.uniqueSort,ie.text=ue.getText,ie.isXMLDoc=ue.isXML,ie.contains=ue.contains;var ce=ie.expr.match.needsContext,fe=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,de=/^.[^:#\[\.,]*$/;ie.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?ie.find.matchesSelector(r,e)?[r]:[]:ie.find.matches(e,ie.grep(t,function(e){return 1===e.nodeType}))},ie.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(ie(e).filter(function(){for(t=0;t<i;t++)if(ie.contains(r[t],this))return!0}));for(t=0;t<i;t++)ie.find(e,r[t],n);return n=this.pushStack(i>1?ie.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},filter:function(e){return this.pushStack(r(this,e||[],!1))},not:function(e){return this.pushStack(r(this,e||[],!0))},is:function(e){return!!r(this,"string"==typeof e&&ce.test(e)?ie(e):e||[],!1).length}});var pe,he=e.document,me=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,ge=ie.fn.init=function(e,t){var n,r;if(!e)return this;if("string"==typeof e){if(n="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:me.exec(e),!n||!n[1]&&t)return!t||t.jquery?(t||pe).find(e):this.constructor(t).find(e);if(n[1]){if(t=t instanceof ie?t[0]:t,ie.merge(this,ie.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:he,!0)),fe.test(n[1])&&ie.isPlainObject(t))for(n in t)ie.isFunction(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}if(r=he.getElementById(n[2]),r&&r.parentNode){if(r.id!==n[2])return pe.find(e);this.length=1,this[0]=r}return this.context=he,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):ie.isFunction(e)?"undefined"!=typeof pe.ready?pe.ready(e):e(ie):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),ie.makeArray(e,this))};ge.prototype=ie.fn,pe=ie(he);var ye=/^(?:parents|prev(?:Until|All))/,ve={children:!0,contents:!0,next:!0,prev:!0};ie.extend({dir:function(e,t,n){for(var r=[],i=e[t];i&&9!==i.nodeType&&(void 0===n||1!==i.nodeType||!ie(i).is(n));)1===i.nodeType&&r.push(i),i=i[t];return r},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}}),ie.fn.extend({has:function(e){var t,n=ie(e,this),r=n.length;return this.filter(function(){for(t=0;t<r;t++)if(ie.contains(this,n[t]))return!0})},closest:function(e,t){for(var n,r=0,i=this.length,o=[],a=ce.test(e)||"string"!=typeof e?ie(e,t||this.context):0;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&ie.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?ie.unique(o):o)},index:function(e){return e?"string"==typeof e?ie.inArray(this[0],ie(e)):ie.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(ie.unique(ie.merge(this.get(),ie(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),ie.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return ie.dir(e,"parentNode")},parentsUntil:function(e,t,n){return ie.dir(e,"parentNode",n)},next:function(e){return i(e,"nextSibling")},prev:function(e){return i(e,"previousSibling")},nextAll:function(e){return ie.dir(e,"nextSibling")},prevAll:function(e){return ie.dir(e,"previousSibling")},nextUntil:function(e,t,n){return ie.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return ie.dir(e,"previousSibling",n)},siblings:function(e){return ie.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return ie.sibling(e.firstChild)},contents:function(e){return ie.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:ie.merge([],e.childNodes)}},function(e,t){ie.fn[e]=function(n,r){var i=ie.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=ie.filter(r,i)),this.length>1&&(ve[e]||(i=ie.unique(i)),ye.test(e)&&(i=i.reverse())),this.pushStack(i)}});var be=/\S+/g,xe={};ie.Callbacks=function(e){e="string"==typeof e?xe[e]||o(e):ie.extend({},e);var t,n,r,i,a,s,l=[],u=!e.once&&[],c=function(o){for(n=e.memory&&o,r=!0,a=s||0,s=0,i=l.length,t=!0;l&&a<i;a++)if(l[a].apply(o[0],o[1])===!1&&e.stopOnFalse){n=!1;break}t=!1,l&&(u?u.length&&c(u.shift()):n?l=[]:f.disable())},f={add:function(){if(l){var r=l.length;!function t(n){ie.each(n,function(n,r){var i=ie.type(r);"function"===i?e.unique&&f.has(r)||l.push(r):r&&r.length&&"string"!==i&&t(r)})}(arguments),t?i=l.length:n&&(s=r,c(n))}return this},remove:function(){return l&&ie.each(arguments,function(e,n){for(var r;(r=ie.inArray(n,l,r))>-1;)l.splice(r,1),t&&(r<=i&&i--,r<=a&&a--)}),this},has:function(e){return e?ie.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],i=0,this},disable:function(){return l=u=n=void 0,this},disabled:function(){return!l},lock:function(){return u=void 0,n||f.disable(),this},locked:function(){return!u},fireWith:function(e,n){return!l||r&&!u||(n=n||[],n=[e,n.slice?n.slice():n],t?u.push(n):c(n)),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!r}};return f},ie.extend({Deferred:function(e){var t=[["resolve","done",ie.Callbacks("once memory"),"resolved"],["reject","fail",ie.Callbacks("once memory"),"rejected"],["notify","progress",ie.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return ie.Deferred(function(n){ie.each(t,function(t,o){var a=ie.isFunction(e[t])&&e[t];i[o[1]](function(){var e=a&&a.apply(this,arguments);e&&ie.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o[0]+"With"](this===r?n.promise():this,a?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?ie.extend(e,r):r}},i={};return r.pipe=r.then,ie.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=J.call(arguments),r=n.length,i=1!==r||e&&ie.isFunction(e.promise)?r:0,o=1===i?e:ie.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?J.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,l,u;if(r>1)for(s=new Array(r),l=new Array(r),u=new Array(r);t<r;t++)n[t]&&ie.isFunction(n[t].promise)?n[t].promise().done(a(t,u,n)).fail(o.reject).progress(a(t,l,s)):--i;return i||o.resolveWith(u,n),o.promise()}});var we;ie.fn.ready=function(e){return ie.ready.promise().done(e),this},ie.extend({isReady:!1,readyWait:1,holdReady:function(e){e?ie.readyWait++:ie.ready(!0)},ready:function(e){if(e===!0?!--ie.readyWait:!ie.isReady){if(!he.body)return setTimeout(ie.ready);ie.isReady=!0,e!==!0&&--ie.readyWait>0||(we.resolveWith(he,[ie]),ie.fn.triggerHandler&&(ie(he).triggerHandler("ready"),ie(he).off("ready")))}}}),ie.ready.promise=function(t){if(!we)if(we=ie.Deferred(),"complete"===he.readyState)setTimeout(ie.ready);else if(he.addEventListener)he.addEventListener("DOMContentLoaded",s,!1),e.addEventListener("load",s,!1);else{he.attachEvent("onreadystatechange",s),e.attachEvent("onload",s);var n=!1;try{n=null==e.frameElement&&he.documentElement}catch(e){}n&&n.doScroll&&!function e(){if(!ie.isReady){try{n.doScroll("left")}catch(t){return setTimeout(e,50)}a(),ie.ready()}}()}return we.promise(t)};var Te="undefined",Ce;for(Ce in ie(ne))break;ne.ownLast="0"!==Ce,ne.inlineBlockNeedsLayout=!1,ie(function(){var e,t,n,r;n=he.getElementsByTagName("body")[0],n&&n.style&&(t=he.createElement("div"),r=he.createElement("div"),r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).appendChild(t),typeof t.style.zoom!==Te&&(t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",ne.inlineBlockNeedsLayout=e=3===t.offsetWidth,e&&(n.style.zoom=1)),n.removeChild(r))}),function(){var e=he.createElement("div");if(null==ne.deleteExpando){ne.deleteExpando=!0;try{delete e.test}catch(e){ne.deleteExpando=!1}}e=null}(),ie.acceptData=function(e){var t=ie.noData[(e.nodeName+" ").toLowerCase()],n=+e.nodeType||1;return(1===n||9===n)&&(!t||t!==!0&&e.getAttribute("classid")===t)};var Ne=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Ee=/([A-Z])/g;ie.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?ie.cache[e[ie.expando]]:e[ie.expando],!!e&&!u(e)},data:function(e,t,n){return c(e,t,n)},removeData:function(e,t){return f(e,t)},_data:function(e,t,n){return c(e,t,n,!0)},_removeData:function(e,t){return f(e,t,!0)}}),ie.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=ie.data(o),1===o.nodeType&&!ie._data(o,"parsedAttrs"))){for(n=a.length;n--;)a[n]&&(r=a[n].name,0===r.indexOf("data-")&&(r=ie.camelCase(r.slice(5)),l(o,r,i[r])));ie._data(o,"parsedAttrs",!0)}return i}return"object"==typeof e?this.each(function(){ie.data(this,e)}):arguments.length>1?this.each(function(){ie.data(this,e,t)}):o?l(o,e,ie.data(o,e)):void 0},removeData:function(e){return this.each(function(){ie.removeData(this,e)})}}),ie.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=ie._data(e,t),n&&(!r||ie.isArray(n)?r=ie._data(e,t,ie.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=ie.queue(e,t),r=n.length,i=n.shift(),o=ie._queueHooks(e,t),a=function(){ie.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return ie._data(e,n)||ie._data(e,n,{empty:ie.Callbacks("once memory").add(function(){ie._removeData(e,t+"queue"),ie._removeData(e,n)})})}}),ie.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?ie.queue(this[0],e):void 0===t?this:this.each(function(){var n=ie.queue(this,e,t);ie._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&ie.dequeue(this,e)})},dequeue:function(e){return this.each(function(){ie.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=ie.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)n=ie._data(o[a],e+"queueHooks"),n&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var ke=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Se=["Top","Right","Bottom","Left"],je=function(e,t){return e=t||e,"none"===ie.css(e,"display")||!ie.contains(e.ownerDocument,e)},Ae=ie.access=function(e,t,n,r,i,o,a){var s=0,l=e.length,u=null==n;if("object"===ie.type(n)){i=!0;for(s in n)ie.access(e,t,s,n[s],!0,o,a)}else if(void 0!==r&&(i=!0,ie.isFunction(r)||(a=!0),u&&(a?(t.call(e,r),t=null):(u=t,t=function(e,t,n){return u.call(ie(e),n)})),t))for(;s<l;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:u?t.call(e):l?t(e[0],n):o},De=/^(?:checkbox|radio)$/i;!function(){var e=he.createElement("input"),t=he.createElement("div"),n=he.createDocumentFragment();if(t.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",ne.leadingWhitespace=3===t.firstChild.nodeType,ne.tbody=!t.getElementsByTagName("tbody").length,ne.htmlSerialize=!!t.getElementsByTagName("link").length,ne.html5Clone="<:nav></:nav>"!==he.createElement("nav").cloneNode(!0).outerHTML,e.type="checkbox",e.checked=!0,n.appendChild(e),ne.appendChecked=e.checked,t.innerHTML="<textarea>x</textarea>",ne.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue,n.appendChild(t),t.innerHTML="<input type='radio' checked='checked' name='t'/>",ne.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,ne.noCloneEvent=!0,t.attachEvent&&(t.attachEvent("onclick",function(){ne.noCloneEvent=!1}),t.cloneNode(!0).click()),null==ne.deleteExpando){ne.deleteExpando=!0;try{delete t.test}catch(e){ne.deleteExpando=!1}}}(),function(){var t,n,r=he.createElement("div");for(t in{submit:!0,change:!0,focusin:!0})n="on"+t,(ne[t+"Bubbles"]=n in e)||(r.setAttribute(n,"t"),ne[t+"Bubbles"]=r.attributes[n].expando===!1);r=null}();var Le=/^(?:input|select|textarea)$/i,He=/^key/,qe=/^(?:mouse|pointer|contextmenu)|click/,_e=/^(?:focusinfocus|focusoutblur)$/,Me=/^([^.]*)(?:\.(.+)|)$/;ie.event={global:{},add:function(e,t,n,r,i){var o,a,s,l,u,c,f,d,p,h,m,g=ie._data(e);if(g){for(n.handler&&(l=n,n=l.handler,i=l.selector),n.guid||(n.guid=ie.guid++),(a=g.events)||(a=g.events={}),(c=g.handle)||(c=g.handle=function(e){return typeof ie===Te||e&&ie.event.triggered===e.type?void 0:ie.event.dispatch.apply(c.elem,arguments)},c.elem=e),t=(t||"").match(be)||[""],s=t.length;s--;)o=Me.exec(t[s])||[],p=m=o[1],h=(o[2]||"").split(".").sort(),p&&(u=ie.event.special[p]||{},p=(i?u.delegateType:u.bindType)||p,u=ie.event.special[p]||{},f=ie.extend({type:p,origType:m,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&ie.expr.match.needsContext.test(i),namespace:h.join(".")},l),(d=a[p])||(d=a[p]=[],d.delegateCount=0,u.setup&&u.setup.call(e,r,h,c)!==!1||(e.addEventListener?e.addEventListener(p,c,!1):e.attachEvent&&e.attachEvent("on"+p,c))),u.add&&(u.add.call(e,f),f.handler.guid||(f.handler.guid=n.guid)),i?d.splice(d.delegateCount++,0,f):d.push(f),ie.event.global[p]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,f,d,p,h,m,g=ie.hasData(e)&&ie._data(e);if(g&&(c=g.events)){for(t=(t||"").match(be)||[""],u=t.length;u--;)if(s=Me.exec(t[u])||[],p=m=s[1],h=(s[2]||"").split(".").sort(),p){for(f=ie.event.special[p]||{},p=(r?f.delegateType:f.bindType)||p,d=c[p]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=d.length;o--;)a=d[o],!i&&m!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(d.splice(o,1),a.selector&&d.delegateCount--,f.remove&&f.remove.call(e,a));l&&!d.length&&(f.teardown&&f.teardown.call(e,h,g.handle)!==!1||ie.removeEvent(e,p,g.handle),delete c[p])}else for(p in c)ie.event.remove(e,p+t[u],n,r,!0);ie.isEmptyObject(c)&&(delete g.handle,ie._removeData(e,"events"))}},trigger:function(t,n,r,i){var o,a,s,l,u,c,f,d=[r||he],p=te.call(t,"type")?t.type:t,h=te.call(t,"namespace")?t.namespace.split("."):[];if(s=c=r=r||he,3!==r.nodeType&&8!==r.nodeType&&!_e.test(p+ie.event.triggered)&&(p.indexOf(".")>=0&&(h=p.split("."),p=h.shift(),h.sort()),a=p.indexOf(":")<0&&"on"+p,t=t[ie.expando]?t:new ie.Event(p,"object"==typeof t&&t),t.isTrigger=i?2:3,t.namespace=h.join("."),t.namespace_re=t.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:ie.makeArray(n,[t]),u=ie.event.special[p]||{},i||!u.trigger||u.trigger.apply(r,n)!==!1)){if(!i&&!u.noBubble&&!ie.isWindow(r)){for(l=u.delegateType||p,_e.test(l+p)||(s=s.parentNode);s;s=s.parentNode)d.push(s),c=s;c===(r.ownerDocument||he)&&d.push(c.defaultView||c.parentWindow||e)}for(f=0;(s=d[f++])&&!t.isPropagationStopped();)t.type=f>1?l:u.bindType||p,o=(ie._data(s,"events")||{})[t.type]&&ie._data(s,"handle"),o&&o.apply(s,n),o=a&&s[a],o&&o.apply&&ie.acceptData(s)&&(t.result=o.apply(s,n),t.result===!1&&t.preventDefault());if(t.type=p,!i&&!t.isDefaultPrevented()&&(!u._default||u._default.apply(d.pop(),n)===!1)&&ie.acceptData(r)&&a&&r[p]&&!ie.isWindow(r)){c=r[a],c&&(r[a]=null),ie.event.triggered=p;try{r[p]()}catch(e){}ie.event.triggered=void 0,c&&(r[a]=c)}return t.result}},dispatch:function(e){e=ie.event.fix(e);var t,n,r,i,o,a=[],s=J.call(arguments),l=(ie._data(this,"events")||{})[e.type]||[],u=ie.event.special[e.type]||{};if(s[0]=e,e.delegateTarget=this,!u.preDispatch||u.preDispatch.call(this,e)!==!1){for(a=ie.event.handlers.call(this,e,l),t=0;(i=a[t++])&&!e.isPropagationStopped();)for(e.currentTarget=i.elem,o=0;(r=i.handlers[o++])&&!e.isImmediatePropagationStopped();)e.namespace_re&&!e.namespace_re.test(r.namespace)||(e.handleObj=r,e.data=r.data,n=((ie.event.special[r.origType]||{}).handle||r.handler).apply(i.elem,s),void 0!==n&&(e.result=n)===!1&&(e.preventDefault(),e.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,a=[],s=t.delegateCount,l=e.target;if(s&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==e.type)){for(i=[],o=0;o<s;o++)r=t[o],n=r.selector+" ",void 0===i[n]&&(i[n]=r.needsContext?ie(n,this).index(l)>=0:ie.find(n,this,null,[l]).length),i[n]&&i.push(r);i.length&&a.push({elem:l,handlers:i})}return s<t.length&&a.push({elem:this,handlers:t.slice(s)}),a},fix:function(e){if(e[ie.expando])return e;var t,n,r,i=e.type,o=e,a=this.fixHooks[i];for(a||(this.fixHooks[i]=a=qe.test(i)?this.mouseHooks:He.test(i)?this.keyHooks:{}),r=a.props?this.props.concat(a.props):this.props,e=new ie.Event(o),t=r.length;t--;)n=r[t],e[n]=o[n];return e.target||(e.target=o.srcElement||he),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,a.filter?a.filter(e,o):e},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 fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,r,i,o=t.button,a=t.fromElement;return null==e.pageX&&null!=t.clientX&&(r=e.target.ownerDocument||he,i=r.documentElement,n=r.body,e.pageX=t.clientX+(i&&i.scrollLeft||n&&n.scrollLeft||0)-(i&&i.clientLeft||n&&n.clientLeft||0),e.pageY=t.clientY+(i&&i.scrollTop||n&&n.scrollTop||0)-(i&&i.clientTop||n&&n.clientTop||0)),!e.relatedTarget&&a&&(e.relatedTarget=a===e.target?t.toElement:a),e.which||void 0===o||(e.which=1&o?1:2&o?3:4&o?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==h()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){if(this===h()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if(ie.nodeName(this,"input")&&"checkbox"===this.type&&this.click)return this.click(),!1},_default:function(e){return ie.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=ie.extend(new ie.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?ie.event.trigger(i,null,t):ie.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},ie.removeEvent=he.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===Te&&(e[r]=null),e.detachEvent(r,n))},ie.Event=function(e,t){return this instanceof ie.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&e.returnValue===!1?d:p):this.type=e,t&&ie.extend(this,t),this.timeStamp=e&&e.timeStamp||ie.now(),void(this[ie.expando]=!0)):new ie.Event(e,t)},ie.Event.prototype={isDefaultPrevented:p,isPropagationStopped:p,isImmediatePropagationStopped:p,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=d,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=d,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=d,e&&e.stopImmediatePropagation&&e.stopImmediatePropagation(),this.stopPropagation()}},ie.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){ie.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return i&&(i===r||ie.contains(r,i))||(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),ne.submitBubbles||(ie.event.special.submit={setup:function(){return!ie.nodeName(this,"form")&&void ie.event.add(this,"click._submit keypress._submit",function(e){var t=e.target,n=ie.nodeName(t,"input")||ie.nodeName(t,"button")?t.form:void 0;n&&!ie._data(n,"submitBubbles")&&(ie.event.add(n,"submit._submit",function(e){e._submit_bubble=!0}),ie._data(n,"submitBubbles",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&ie.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return!ie.nodeName(this,"form")&&void ie.event.remove(this,"._submit")}}),ne.changeBubbles||(ie.event.special.change={setup:function(){return Le.test(this.nodeName)?("checkbox"!==this.type&&"radio"!==this.type||(ie.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),ie.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),ie.event.simulate("change",this,e,!0)})),!1):void ie.event.add(this,"beforeactivate._change",function(e){var t=e.target;Le.test(t.nodeName)&&!ie._data(t,"changeBubbles")&&(ie.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||ie.event.simulate("change",this.parentNode,e,!0)}),ie._data(t,"changeBubbles",!0))})},handle:function(e){var t=e.target;if(this!==t||e.isSimulated||e.isTrigger||"radio"!==t.type&&"checkbox"!==t.type)return e.handleObj.handler.apply(this,arguments)},teardown:function(){return ie.event.remove(this,"._change"),!Le.test(this.nodeName)}}),ne.focusinBubbles||ie.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){ie.event.simulate(t,e.target,ie.event.fix(e),!0)};ie.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=ie._data(r,t);i||r.addEventListener(e,n,!0),ie._data(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=ie._data(r,t)-1;i?ie._data(r,t,i):(r.removeEventListener(e,n,!0),ie._removeData(r,t))}}}),ie.fn.extend({on:function(e,t,n,r,i){var o,a;if("object"==typeof e){"string"!=typeof t&&(n=n||t,t=void 0);for(o in e)this.on(o,t,n,e[o],i);return this}if(null==n&&null==r?(r=t,n=t=void 0):null==r&&("string"==typeof t?(r=n,n=void 0):(r=n,n=t,t=void 0)),r===!1)r=p;else if(!r)return this;return 1===i&&(a=r,r=function(e){return ie().off(e),a.apply(this,arguments)},r.guid=a.guid||(a.guid=ie.guid++)),this.each(function(){ie.event.add(this,e,r,n,t)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,ie(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return t!==!1&&"function"!=typeof t||(n=t,t=void 0),n===!1&&(n=p),this.each(function(){ie.event.remove(this,e,n,t)})},trigger:function(e,t){return this.each(function(){ie.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return ie.event.trigger(e,t,n,!0)}});var Fe="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",Oe=/ jQuery\d+="(?:null|\d+)"/g,Pe=new RegExp("<(?:"+Fe+")[\\s/>]","i"),Be=/^\s+/,Re=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,We=/<([\w:]+)/,$e=/<tbody/i,ze=/<|&#?\w+;/,Ie=/<(?:script|style|link)/i,Xe=/checked\s*(?:[^=]|=\s*.checked.)/i,Ue=/^$|\/(?:java|ecma)script/i,Ve=/^true\/(.*)/,Qe=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Je={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:ne.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},Ye=m(he),Ge=Ye.appendChild(he.createElement("div"));Je.optgroup=Je.option,Je.tbody=Je.tfoot=Je.colgroup=Je.caption=Je.thead,Je.th=Je.td,ie.extend({clone:function(e,t,n){var r,i,o,a,s,l=ie.contains(e.ownerDocument,e);if(ne.html5Clone||ie.isXMLDoc(e)||!Pe.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Ge.innerHTML=e.outerHTML,Ge.removeChild(o=Ge.firstChild)),!(ne.noCloneEvent&&ne.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||ie.isXMLDoc(e)))for(r=g(o),s=g(e),a=0;null!=(i=s[a]);++a)r[a]&&C(i,r[a]);if(t)if(n)for(s=s||g(e),r=r||g(o),a=0;null!=(i=s[a]);a++)T(i,r[a]);else T(e,o);return r=g(o,"script"),r.length>0&&w(r,!l&&g(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){for(var i,o,a,s,l,u,c,f=e.length,d=m(t),p=[],h=0;h<f;h++)if(o=e[h],o||0===o)if("object"===ie.type(o))ie.merge(p,o.nodeType?[o]:o);else if(ze.test(o)){for(s=s||d.appendChild(t.createElement("div")),l=(We.exec(o)||["",""])[1].toLowerCase(),c=Je[l]||Je._default,s.innerHTML=c[1]+o.replace(Re,"<$1></$2>")+c[2],i=c[0];i--;)s=s.lastChild;if(!ne.leadingWhitespace&&Be.test(o)&&p.push(t.createTextNode(Be.exec(o)[0])),!ne.tbody)for(o="table"!==l||$e.test(o)?"<table>"!==c[1]||$e.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;i--;)ie.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u);for(ie.merge(p,s.childNodes),s.textContent="";s.firstChild;)s.removeChild(s.firstChild);s=d.lastChild}else p.push(t.createTextNode(o));for(s&&d.removeChild(s),ne.appendChecked||ie.grep(g(p,"input"),y),h=0;o=p[h++];)if((!r||ie.inArray(o,r)===-1)&&(a=ie.contains(o.ownerDocument,o),s=g(d.appendChild(o),"script"),a&&w(s),n))for(i=0;o=s[i++];)Ue.test(o.type||"")&&n.push(o);return s=null,d},cleanData:function(e,t){for(var n,r,i,o,a=0,s=ie.expando,l=ie.cache,u=ne.deleteExpando,c=ie.event.special;null!=(n=e[a]);a++)if((t||ie.acceptData(n))&&(i=n[s],o=i&&l[i])){if(o.events)for(r in o.events)c[r]?ie.event.remove(n,r):ie.removeEvent(n,r,o.handle);l[i]&&(delete l[i],u?delete n[s]:typeof n.removeAttribute!==Te?n.removeAttribute(s):n[s]=null,Q.push(i))}}}),ie.fn.extend({text:function(e){return Ae(this,function(e){return void 0===e?ie.text(this):this.empty().append((this[0]&&this[0].ownerDocument||he).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=v(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=v(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,r=e?ie.filter(e,this):this,i=0;null!=(n=r[i]);i++)t||1!==n.nodeType||ie.cleanData(g(n)),n.parentNode&&(t&&ie.contains(n.ownerDocument,n)&&w(g(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&ie.cleanData(g(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&ie.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return ie.clone(this,e,t)})},html:function(e){return Ae(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e)return 1===t.nodeType?t.innerHTML.replace(Oe,""):void 0;if("string"==typeof e&&!Ie.test(e)&&(ne.htmlSerialize||!Pe.test(e))&&(ne.leadingWhitespace||!Be.test(e))&&!Je[(We.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(Re,"<$1></$2>");try{for(;n<r;n++)t=this[n]||{},1===t.nodeType&&(ie.cleanData(g(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=arguments[0];return this.domManip(arguments,function(t){e=this.parentNode,ie.cleanData(g(this)),e&&e.replaceChild(t,this)}),e&&(e.length||e.nodeType)?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t){e=Y.apply([],e);var n,r,i,o,a,s,l=0,u=this.length,c=this,f=u-1,d=e[0],p=ie.isFunction(d);if(p||u>1&&"string"==typeof d&&!ne.checkClone&&Xe.test(d))return this.each(function(n){var r=c.eq(n);p&&(e[0]=d.call(this,n,r.html())),r.domManip(e,t)});if(u&&(s=ie.buildFragment(e,this[0].ownerDocument,!1,this),n=s.firstChild,1===s.childNodes.length&&(s=n),n)){for(o=ie.map(g(s,"script"),b),i=o.length;l<u;l++)r=s,l!==f&&(r=ie.clone(r,!0,!0),i&&ie.merge(o,g(r,"script"))),t.call(this[l],r,l);if(i)for(a=o[o.length-1].ownerDocument,ie.map(o,x),l=0;l<i;l++)r=o[l],Ue.test(r.type||"")&&!ie._data(r,"globalEval")&&ie.contains(a,r)&&(r.src?ie._evalUrl&&ie._evalUrl(r.src):ie.globalEval((r.text||r.textContent||r.innerHTML||"").replace(Qe,"")));s=n=null}return this}}),ie.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){ie.fn[e]=function(e){for(var n,r=0,i=[],o=ie(e),a=o.length-1;r<=a;r++)n=r===a?this:this.clone(!0),ie(o[r])[t](n),G.apply(i,n.get());return this.pushStack(i)}});var Ke,Ze={};!function(){var e;ne.shrinkWrapBlocks=function(){if(null!=e)return e;e=!1;var t,n,r;return n=he.getElementsByTagName("body")[0],n&&n.style?(t=he.createElement("div"),r=he.createElement("div"),r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).appendChild(t),typeof t.style.zoom!==Te&&(t.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",t.appendChild(he.createElement("div")).style.width="5px",e=3!==t.offsetWidth),n.removeChild(r),e):void 0}}();var et=/^margin/,tt=new RegExp("^("+ke+")(?!px)[a-z%]+$","i"),nt,rt,it=/^(top|right|bottom|left)$/;e.getComputedStyle?(nt=function(t){
return t.ownerDocument.defaultView.opener?t.ownerDocument.defaultView.getComputedStyle(t,null):e.getComputedStyle(t,null)},rt=function(e,t,n){var r,i,o,a,s=e.style;return n=n||nt(e),a=n?n.getPropertyValue(t)||n[t]:void 0,n&&(""!==a||ie.contains(e.ownerDocument,e)||(a=ie.style(e,t)),tt.test(a)&&et.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0===a?a:a+""}):he.documentElement.currentStyle&&(nt=function(e){return e.currentStyle},rt=function(e,t,n){var r,i,o,a,s=e.style;return n=n||nt(e),a=n?n[t]:void 0,null==a&&s&&s[t]&&(a=s[t]),tt.test(a)&&!it.test(t)&&(r=s.left,i=e.runtimeStyle,o=i&&i.left,o&&(i.left=e.currentStyle.left),s.left="fontSize"===t?"1em":a,a=s.pixelLeft+"px",s.left=r,o&&(i.left=o)),void 0===a?a:a+""||"auto"}),function(){function t(){var t,n,r,i;n=he.getElementsByTagName("body")[0],n&&n.style&&(t=he.createElement("div"),r=he.createElement("div"),r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).appendChild(t),t.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",o=a=!1,l=!0,e.getComputedStyle&&(o="1%"!==(e.getComputedStyle(t,null)||{}).top,a="4px"===(e.getComputedStyle(t,null)||{width:"4px"}).width,i=t.appendChild(he.createElement("div")),i.style.cssText=t.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",t.style.width="1px",l=!parseFloat((e.getComputedStyle(i,null)||{}).marginRight),t.removeChild(i)),t.innerHTML="<table><tr><td></td><td>t</td></tr></table>",i=t.getElementsByTagName("td"),i[0].style.cssText="margin:0;border:0;padding:0;display:none",s=0===i[0].offsetHeight,s&&(i[0].style.display="",i[1].style.display="none",s=0===i[0].offsetHeight),n.removeChild(r))}var n,r,i,o,a,s,l;n=he.createElement("div"),n.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",i=n.getElementsByTagName("a")[0],r=i&&i.style,r&&(r.cssText="float:left;opacity:.5",ne.opacity="0.5"===r.opacity,ne.cssFloat=!!r.cssFloat,n.style.backgroundClip="content-box",n.cloneNode(!0).style.backgroundClip="",ne.clearCloneStyle="content-box"===n.style.backgroundClip,ne.boxSizing=""===r.boxSizing||""===r.MozBoxSizing||""===r.WebkitBoxSizing,ie.extend(ne,{reliableHiddenOffsets:function(){return null==s&&t(),s},boxSizingReliable:function(){return null==a&&t(),a},pixelPosition:function(){return null==o&&t(),o},reliableMarginRight:function(){return null==l&&t(),l}}))}(),ie.swap=function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i};var ot=/alpha\([^)]*\)/i,at=/opacity\s*=\s*([^)]*)/,st=/^(none|table(?!-c[ea]).+)/,lt=new RegExp("^("+ke+")(.*)$","i"),ut=new RegExp("^([+-])=("+ke+")","i"),ct={position:"absolute",visibility:"hidden",display:"block"},ft={letterSpacing:"0",fontWeight:"400"},dt=["Webkit","O","Moz","ms"];ie.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=rt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:ne.cssFloat?"cssFloat":"styleFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=ie.camelCase(t),l=e.style;if(t=ie.cssProps[s]||(ie.cssProps[s]=S(l,s)),a=ie.cssHooks[t]||ie.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];if(o=typeof n,"string"===o&&(i=ut.exec(n))&&(n=(i[1]+1)*i[2]+parseFloat(ie.css(e,t)),o="number"),null!=n&&n===n&&("number"!==o||ie.cssNumber[s]||(n+="px"),ne.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),!(a&&"set"in a&&void 0===(n=a.set(e,n,r)))))try{l[t]=n}catch(e){}}},css:function(e,t,n,r){var i,o,a,s=ie.camelCase(t);return t=ie.cssProps[s]||(ie.cssProps[s]=S(e.style,s)),a=ie.cssHooks[t]||ie.cssHooks[s],a&&"get"in a&&(o=a.get(e,!0,n)),void 0===o&&(o=rt(e,t,r)),"normal"===o&&t in ft&&(o=ft[t]),""===n||n?(i=parseFloat(o),n===!0||ie.isNumeric(i)?i||0:o):o}}),ie.each(["height","width"],function(e,t){ie.cssHooks[t]={get:function(e,n,r){if(n)return st.test(ie.css(e,"display"))&&0===e.offsetWidth?ie.swap(e,ct,function(){return L(e,t,r)}):L(e,t,r)},set:function(e,n,r){var i=r&&nt(e);return A(e,n,r?D(e,t,r,ne.boxSizing&&"border-box"===ie.css(e,"boxSizing",!1,i),i):0)}}}),ne.opacity||(ie.cssHooks.opacity={get:function(e,t){return at.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=ie.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===ie.trim(o.replace(ot,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=ot.test(o)?o.replace(ot,i):o+" "+i)}}),ie.cssHooks.marginRight=k(ne.reliableMarginRight,function(e,t){if(t)return ie.swap(e,{display:"inline-block"},rt,[e,"marginRight"])}),ie.each({margin:"",padding:"",border:"Width"},function(e,t){ie.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+Se[r]+t]=o[r]||o[r-2]||o[0];return i}},et.test(e)||(ie.cssHooks[e+t].set=A)}),ie.fn.extend({css:function(e,t){return Ae(this,function(e,t,n){var r,i,o={},a=0;if(ie.isArray(t)){for(r=nt(e),i=t.length;a<i;a++)o[t[a]]=ie.css(e,t[a],!1,r);return o}return void 0!==n?ie.style(e,t,n):ie.css(e,t)},e,t,arguments.length>1)},show:function(){return j(this,!0)},hide:function(){return j(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){je(this)?ie(this).show():ie(this).hide()})}}),ie.Tween=H,H.prototype={constructor:H,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(ie.cssNumber[n]?"":"px")},cur:function(){var e=H.propHooks[this.prop];return e&&e.get?e.get(this):H.propHooks._default.get(this)},run:function(e){var t,n=H.propHooks[this.prop];return this.options.duration?this.pos=t=ie.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):H.propHooks._default.set(this),this}},H.prototype.init.prototype=H.prototype,H.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=ie.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){ie.fx.step[e.prop]?ie.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[ie.cssProps[e.prop]]||ie.cssHooks[e.prop])?ie.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},H.propHooks.scrollTop=H.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},ie.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},ie.fx=H.prototype.init,ie.fx.step={};var pt,ht,mt=/^(?:toggle|show|hide)$/,gt=new RegExp("^(?:([+-])=|)("+ke+")([a-z%]*)$","i"),yt=/queueHooks$/,vt=[F],bt={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=gt.exec(t),o=i&&i[3]||(ie.cssNumber[e]?"":"px"),a=(ie.cssNumber[e]||"px"!==o&&+r)&&gt.exec(ie.css(n.elem,e)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3],i=i||[],a=+r||1;do s=s||".5",a/=s,ie.style(n.elem,e,a+o);while(s!==(s=n.cur()/r)&&1!==s&&--l)}return i&&(a=n.start=+a||+r||0,n.unit=o,n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]),n}]};ie.Animation=ie.extend(P,{tweener:function(e,t){ie.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,i=e.length;r<i;r++)n=e[r],bt[n]=bt[n]||[],bt[n].unshift(t)},prefilter:function(e,t){t?vt.unshift(e):vt.push(e)}}),ie.speed=function(e,t,n){var r=e&&"object"==typeof e?ie.extend({},e):{complete:n||!n&&t||ie.isFunction(e)&&e,duration:e,easing:n&&t||t&&!ie.isFunction(t)&&t};return r.duration=ie.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in ie.fx.speeds?ie.fx.speeds[r.duration]:ie.fx.speeds._default,null!=r.queue&&r.queue!==!0||(r.queue="fx"),r.old=r.complete,r.complete=function(){ie.isFunction(r.old)&&r.old.call(this),r.queue&&ie.dequeue(this,r.queue)},r},ie.fn.extend({fadeTo:function(e,t,n,r){return this.filter(je).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=ie.isEmptyObject(e),o=ie.speed(t,n,r),a=function(){var t=P(this,ie.extend({},e),o);(i||ie._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=ie.timers,a=ie._data(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&yt.test(i)&&r(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));!t&&n||ie.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=ie._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=ie.timers,a=r?r.length:0;for(n.finish=!0,ie.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),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<a;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),ie.each(["toggle","show","hide"],function(e,t){var n=ie.fn[t];ie.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(_(t,!0),e,r,i)}}),ie.each({slideDown:_("show"),slideUp:_("hide"),slideToggle:_("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){ie.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),ie.timers=[],ie.fx.tick=function(){var e,t=ie.timers,n=0;for(pt=ie.now();n<t.length;n++)e=t[n],e()||t[n]!==e||t.splice(n--,1);t.length||ie.fx.stop(),pt=void 0},ie.fx.timer=function(e){ie.timers.push(e),e()?ie.fx.start():ie.timers.pop()},ie.fx.interval=13,ie.fx.start=function(){ht||(ht=setInterval(ie.fx.tick,ie.fx.interval))},ie.fx.stop=function(){clearInterval(ht),ht=null},ie.fx.speeds={slow:600,fast:200,_default:400},ie.fn.delay=function(e,t){return e=ie.fx?ie.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},function(){var e,t,n,r,i;t=he.createElement("div"),t.setAttribute("className","t"),t.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",r=t.getElementsByTagName("a")[0],n=he.createElement("select"),i=n.appendChild(he.createElement("option")),e=t.getElementsByTagName("input")[0],r.style.cssText="top:1px",ne.getSetAttribute="t"!==t.className,ne.style=/top/.test(r.getAttribute("style")),ne.hrefNormalized="/a"===r.getAttribute("href"),ne.checkOn=!!e.value,ne.optSelected=i.selected,ne.enctype=!!he.createElement("form").enctype,n.disabled=!0,ne.optDisabled=!i.disabled,e=he.createElement("input"),e.setAttribute("value",""),ne.input=""===e.getAttribute("value"),e.value="t",e.setAttribute("type","radio"),ne.radioValue="t"===e.value}();var xt=/\r/g;ie.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=ie.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,ie(this).val()):e,null==i?i="":"number"==typeof i?i+="":ie.isArray(i)&&(i=ie.map(i,function(e){return null==e?"":e+""})),t=ie.valHooks[this.type]||ie.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return t=ie.valHooks[i.type]||ie.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(xt,""):null==n?"":n)}}}),ie.extend({valHooks:{option:{get:function(e){var t=ie.find.attr(e,"value");return null!=t?t:ie.trim(ie.text(e))}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||i<0,a=o?null:[],s=o?i+1:r.length,l=i<0?s:o?i:0;l<s;l++)if(n=r[l],(n.selected||l===i)&&(ne.optDisabled?!n.disabled:null===n.getAttribute("disabled"))&&(!n.parentNode.disabled||!ie.nodeName(n.parentNode,"optgroup"))){if(t=ie(n).val(),o)return t;a.push(t)}return a},set:function(e,t){for(var n,r,i=e.options,o=ie.makeArray(t),a=i.length;a--;)if(r=i[a],ie.inArray(ie.valHooks.option.get(r),o)>=0)try{r.selected=n=!0}catch(e){r.scrollHeight}else r.selected=!1;return n||(e.selectedIndex=-1),i}}}}),ie.each(["radio","checkbox"],function(){ie.valHooks[this]={set:function(e,t){if(ie.isArray(t))return e.checked=ie.inArray(ie(e).val(),t)>=0}},ne.checkOn||(ie.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var wt,Tt,Ct=ie.expr.attrHandle,Nt=/^(?:checked|selected)$/i,Et=ne.getSetAttribute,kt=ne.input;ie.fn.extend({attr:function(e,t){return Ae(this,ie.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){ie.removeAttr(this,e)})}}),ie.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(e&&3!==o&&8!==o&&2!==o)return typeof e.getAttribute===Te?ie.prop(e,t,n):(1===o&&ie.isXMLDoc(e)||(t=t.toLowerCase(),r=ie.attrHooks[t]||(ie.expr.match.bool.test(t)?Tt:wt)),void 0===n?r&&"get"in r&&null!==(i=r.get(e,t))?i:(i=ie.find.attr(e,t),null==i?void 0:i):null!==n?r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:(e.setAttribute(t,n+""),n):void ie.removeAttr(e,t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(be);if(o&&1===e.nodeType)for(;n=o[i++];)r=ie.propFix[n]||n,ie.expr.match.bool.test(n)?kt&&Et||!Nt.test(n)?e[r]=!1:e[ie.camelCase("default-"+n)]=e[r]=!1:ie.attr(e,n,""),e.removeAttribute(Et?n:r)},attrHooks:{type:{set:function(e,t){if(!ne.radioValue&&"radio"===t&&ie.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}}}),Tt={set:function(e,t,n){return t===!1?ie.removeAttr(e,n):kt&&Et||!Nt.test(n)?e.setAttribute(!Et&&ie.propFix[n]||n,n):e[ie.camelCase("default-"+n)]=e[n]=!0,n}},ie.each(ie.expr.match.bool.source.match(/\w+/g),function(e,t){var n=Ct[t]||ie.find.attr;Ct[t]=kt&&Et||!Nt.test(t)?function(e,t,r){var i,o;return r||(o=Ct[t],Ct[t]=i,i=null!=n(e,t,r)?t.toLowerCase():null,Ct[t]=o),i}:function(e,t,n){if(!n)return e[ie.camelCase("default-"+t)]?t.toLowerCase():null}}),kt&&Et||(ie.attrHooks.value={set:function(e,t,n){return ie.nodeName(e,"input")?void(e.defaultValue=t):wt&&wt.set(e,t,n)}}),Et||(wt={set:function(e,t,n){var r=e.getAttributeNode(n);if(r||e.setAttributeNode(r=e.ownerDocument.createAttribute(n)),r.value=t+="","value"===n||t===e.getAttribute(n))return t}},Ct.id=Ct.name=Ct.coords=function(e,t,n){var r;if(!n)return(r=e.getAttributeNode(t))&&""!==r.value?r.value:null},ie.valHooks.button={get:function(e,t){var n=e.getAttributeNode(t);if(n&&n.specified)return n.value},set:wt.set},ie.attrHooks.contenteditable={set:function(e,t,n){wt.set(e,""!==t&&t,n)}},ie.each(["width","height"],function(e,t){ie.attrHooks[t]={set:function(e,n){if(""===n)return e.setAttribute(t,"auto"),n}}})),ne.style||(ie.attrHooks.style={get:function(e){return e.style.cssText||void 0},set:function(e,t){return e.style.cssText=t+""}});var St=/^(?:input|select|textarea|button|object)$/i,jt=/^(?:a|area)$/i;ie.fn.extend({prop:function(e,t){return Ae(this,ie.prop,e,t,arguments.length>1)},removeProp:function(e){return e=ie.propFix[e]||e,this.each(function(){try{this[e]=void 0,delete this[e]}catch(e){}})}}),ie.extend({propFix:{for:"htmlFor",class:"className"},prop:function(e,t,n){var r,i,o,a=e.nodeType;if(e&&3!==a&&8!==a&&2!==a)return o=1!==a||!ie.isXMLDoc(e),o&&(t=ie.propFix[t]||t,i=ie.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=ie.find.attr(e,"tabindex");return t?parseInt(t,10):St.test(e.nodeName)||jt.test(e.nodeName)&&e.href?0:-1}}}}),ne.hrefNormalized||ie.each(["href","src"],function(e,t){ie.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),ne.optSelected||(ie.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),ie.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){ie.propFix[this.toLowerCase()]=this}),ne.enctype||(ie.propFix.enctype="encoding");var At=/[\t\r\n\f]/g;ie.fn.extend({addClass:function(e){var t,n,r,i,o,a,s=0,l=this.length,u="string"==typeof e&&e;if(ie.isFunction(e))return this.each(function(t){ie(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(be)||[];s<l;s++)if(n=this[s],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(At," "):" ")){for(o=0;i=t[o++];)r.indexOf(" "+i+" ")<0&&(r+=i+" ");a=ie.trim(r),n.className!==a&&(n.className=a)}return this},removeClass:function(e){var t,n,r,i,o,a,s=0,l=this.length,u=0===arguments.length||"string"==typeof e&&e;if(ie.isFunction(e))return this.each(function(t){ie(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(be)||[];s<l;s++)if(n=this[s],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(At," "):"")){for(o=0;i=t[o++];)for(;r.indexOf(" "+i+" ")>=0;)r=r.replace(" "+i+" "," ");a=e?ie.trim(r):"",n.className!==a&&(n.className=a)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):ie.isFunction(e)?this.each(function(n){ie(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n)for(var t,r=0,i=ie(this),o=e.match(be)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else n!==Te&&"boolean"!==n||(this.className&&ie._data(this,"__className__",this.className),this.className=this.className||e===!1?"":ie._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;n<r;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(At," ").indexOf(t)>=0)return!0;return!1}}),ie.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){ie.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),ie.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,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var Dt=ie.now(),Lt=/\?/,Ht=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;ie.parseJSON=function(t){if(e.JSON&&e.JSON.parse)return e.JSON.parse(t+"");var n,r=null,i=ie.trim(t+"");return i&&!ie.trim(i.replace(Ht,function(e,t,i,o){return n&&t&&(r=0),0===r?e:(n=i||t,r+=!o-!i,"")}))?Function("return "+i)():ie.error("Invalid JSON: "+t)},ie.parseXML=function(t){var n,r;if(!t||"string"!=typeof t)return null;try{e.DOMParser?(r=new DOMParser,n=r.parseFromString(t,"text/xml")):(n=new ActiveXObject("Microsoft.XMLDOM"),n.async="false",n.loadXML(t))}catch(e){n=void 0}return n&&n.documentElement&&!n.getElementsByTagName("parsererror").length||ie.error("Invalid XML: "+t),n};var qt,_t,Mt=/#.*$/,Ft=/([?&])_=[^&]*/,Ot=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Pt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Bt=/^(?:GET|HEAD)$/,Rt=/^\/\//,Wt=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,$t={},zt={},It="*/".concat("*");try{_t=location.href}catch(e){_t=he.createElement("a"),_t.href="",_t=_t.href}qt=Wt.exec(_t.toLowerCase())||[],ie.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:_t,type:"GET",isLocal:Pt.test(qt[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":It,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":ie.parseJSON,"text xml":ie.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?W(W(e,ie.ajaxSettings),t):W(ie.ajaxSettings,e)},ajaxPrefilter:B($t),ajaxTransport:B(zt),ajax:function(e,t){function n(e,t,n,r){var i,c,y,v,x,T=t;2!==b&&(b=2,s&&clearTimeout(s),u=void 0,a=r||"",w.readyState=e>0?4:0,i=e>=200&&e<300||304===e,n&&(v=$(f,w,n)),v=z(f,v,w,i),i?(f.ifModified&&(x=w.getResponseHeader("Last-Modified"),x&&(ie.lastModified[o]=x),x=w.getResponseHeader("etag"),x&&(ie.etag[o]=x)),204===e||"HEAD"===f.type?T="nocontent":304===e?T="notmodified":(T=v.state,c=v.data,y=v.error,i=!y)):(y=T,!e&&T||(T="error",e<0&&(e=0))),w.status=e,w.statusText=(t||T)+"",i?h.resolveWith(d,[c,T,w]):h.rejectWith(d,[w,T,y]),w.statusCode(g),g=void 0,l&&p.trigger(i?"ajaxSuccess":"ajaxError",[w,f,i?c:y]),m.fireWith(d,[w,T]),l&&(p.trigger("ajaxComplete",[w,f]),--ie.active||ie.event.trigger("ajaxStop")))}"object"==typeof e&&(t=e,e=void 0),t=t||{};var r,i,o,a,s,l,u,c,f=ie.ajaxSetup({},t),d=f.context||f,p=f.context&&(d.nodeType||d.jquery)?ie(d):ie.event,h=ie.Deferred(),m=ie.Callbacks("once memory"),g=f.statusCode||{},y={},v={},b=0,x="canceled",w={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!c)for(c={};t=Ot.exec(a);)c[t[1].toLowerCase()]=t[2];t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return b||(f.mimeType=e),this},statusCode:function(e){var t;if(e)if(b<2)for(t in e)g[t]=[g[t],e[t]];else w.always(e[w.status]);return this},abort:function(e){var t=e||x;return u&&u.abort(t),n(0,t),this}};if(h.promise(w).complete=m.add,w.success=w.done,w.error=w.fail,f.url=((e||f.url||_t)+"").replace(Mt,"").replace(Rt,qt[1]+"//"),f.type=t.method||t.type||f.method||f.type,f.dataTypes=ie.trim(f.dataType||"*").toLowerCase().match(be)||[""],null==f.crossDomain&&(r=Wt.exec(f.url.toLowerCase()),f.crossDomain=!(!r||r[1]===qt[1]&&r[2]===qt[2]&&(r[3]||("http:"===r[1]?"80":"443"))===(qt[3]||("http:"===qt[1]?"80":"443")))),f.data&&f.processData&&"string"!=typeof f.data&&(f.data=ie.param(f.data,f.traditional)),R($t,f,t,w),2===b)return w;l=ie.event&&f.global,l&&0===ie.active++&&ie.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Bt.test(f.type),o=f.url,f.hasContent||(f.data&&(o=f.url+=(Lt.test(o)?"&":"?")+f.data,delete f.data),f.cache===!1&&(f.url=Ft.test(o)?o.replace(Ft,"$1_="+Dt++):o+(Lt.test(o)?"&":"?")+"_="+Dt++)),f.ifModified&&(ie.lastModified[o]&&w.setRequestHeader("If-Modified-Since",ie.lastModified[o]),ie.etag[o]&&w.setRequestHeader("If-None-Match",ie.etag[o])),(f.data&&f.hasContent&&f.contentType!==!1||t.contentType)&&w.setRequestHeader("Content-Type",f.contentType),w.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+It+"; q=0.01":""):f.accepts["*"]);for(i in f.headers)w.setRequestHeader(i,f.headers[i]);if(f.beforeSend&&(f.beforeSend.call(d,w,f)===!1||2===b))return w.abort();x="abort";for(i in{success:1,error:1,complete:1})w[i](f[i]);if(u=R(zt,f,t,w)){w.readyState=1,l&&p.trigger("ajaxSend",[w,f]),f.async&&f.timeout>0&&(s=setTimeout(function(){w.abort("timeout")},f.timeout));try{b=1,u.send(y,n)}catch(e){if(!(b<2))throw e;n(-1,e)}}else n(-1,"No Transport");return w},getJSON:function(e,t,n){return ie.get(e,t,n,"json")},getScript:function(e,t){return ie.get(e,void 0,t,"script")}}),ie.each(["get","post"],function(e,t){ie[t]=function(e,n,r,i){return ie.isFunction(n)&&(i=i||r,r=n,n=void 0),ie.ajax({url:e,type:t,dataType:i,data:n,success:r})}}),ie._evalUrl=function(e){return ie.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,throws:!0})},ie.fn.extend({wrapAll:function(e){if(ie.isFunction(e))return this.each(function(t){ie(this).wrapAll(e.call(this,t))});if(this[0]){var t=ie(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return ie.isFunction(e)?this.each(function(t){ie(this).wrapInner(e.call(this,t))}):this.each(function(){var t=ie(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=ie.isFunction(e);return this.each(function(n){ie(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){ie.nodeName(this,"body")||ie(this).replaceWith(this.childNodes)}).end()}}),ie.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0||!ne.reliableHiddenOffsets()&&"none"===(e.style&&e.style.display||ie.css(e,"display"))},ie.expr.filters.visible=function(e){return!ie.expr.filters.hidden(e)};var Xt=/%20/g,Ut=/\[\]$/,Vt=/\r?\n/g,Qt=/^(?:submit|button|image|reset|file)$/i,Jt=/^(?:input|select|textarea|keygen)/i;ie.param=function(e,t){var n,r=[],i=function(e,t){t=ie.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=ie.ajaxSettings&&ie.ajaxSettings.traditional),ie.isArray(e)||e.jquery&&!ie.isPlainObject(e))ie.each(e,function(){i(this.name,this.value)});else for(n in e)I(n,e[n],t,i);return r.join("&").replace(Xt,"+")},ie.fn.extend({serialize:function(){return ie.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=ie.prop(this,"elements");return e?ie.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!ie(this).is(":disabled")&&Jt.test(this.nodeName)&&!Qt.test(e)&&(this.checked||!De.test(e))}).map(function(e,t){var n=ie(this).val();return null==n?null:ie.isArray(n)?ie.map(n,function(e){return{name:t.name,value:e.replace(Vt,"\r\n")}}):{name:t.name,value:n.replace(Vt,"\r\n")}}).get()}}),ie.ajaxSettings.xhr=void 0!==e.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&X()||U()}:X;var Yt=0,Gt={},Kt=ie.ajaxSettings.xhr();e.attachEvent&&e.attachEvent("onunload",function(){for(var e in Gt)Gt[e](void 0,!0)}),ne.cors=!!Kt&&"withCredentials"in Kt,Kt=ne.ajax=!!Kt,Kt&&ie.ajaxTransport(function(e){if(!e.crossDomain||ne.cors){var t;return{send:function(n,r){var i,o=e.xhr(),a=++Yt;if(o.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(i in e.xhrFields)o[i]=e.xhrFields[i];e.mimeType&&o.overrideMimeType&&o.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(i in n)void 0!==n[i]&&o.setRequestHeader(i,n[i]+"");o.send(e.hasContent&&e.data||null),t=function(n,i){var s,l,u;if(t&&(i||4===o.readyState))if(delete Gt[a],t=void 0,o.onreadystatechange=ie.noop,i)4!==o.readyState&&o.abort();else{u={},s=o.status,"string"==typeof o.responseText&&(u.text=o.responseText);try{l=o.statusText}catch(e){l=""}s||!e.isLocal||e.crossDomain?1223===s&&(s=204):s=u.text?200:404}u&&r(s,l,u,o.getAllResponseHeaders())},e.async?4===o.readyState?setTimeout(t):o.onreadystatechange=Gt[a]=t:t()},abort:function(){t&&t(void 0,!0)}}}}),ie.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return ie.globalEval(e),e}}}),ie.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),ie.ajaxTransport("script",function(e){if(e.crossDomain){var t,n=he.head||ie("head")[0]||he.documentElement;return{send:function(r,i){t=he.createElement("script"),t.async=!0,e.scriptCharset&&(t.charset=e.scriptCharset),t.src=e.url,t.onload=t.onreadystatechange=function(e,n){(n||!t.readyState||/loaded|complete/.test(t.readyState))&&(t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),t=null,n||i(200,"success"))},n.insertBefore(t,n.firstChild)},abort:function(){t&&t.onload(void 0,!0)}}}});var Zt=[],en=/(=)\?(?=&|$)|\?\?/;ie.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Zt.pop()||ie.expando+"_"+Dt++;return this[e]=!0,e}}),ie.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,a,s=t.jsonp!==!1&&(en.test(t.url)?"url":"string"==typeof t.data&&!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&en.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=ie.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(en,"$1"+i):t.jsonp!==!1&&(t.url+=(Lt.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||ie.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},r.always(function(){e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,Zt.push(i)),a&&ie.isFunction(o)&&o(a[0]),a=o=void 0}),"script"}),ie.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||he;var r=fe.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=ie.buildFragment([e],t,i),i&&i.length&&ie(i).remove(),ie.merge([],r.childNodes))};var tn=ie.fn.load;ie.fn.load=function(e,t,n){if("string"!=typeof e&&tn)return tn.apply(this,arguments);var r,i,o,a=this,s=e.indexOf(" ");return s>=0&&(r=ie.trim(e.slice(s,e.length)),e=e.slice(0,s)),ie.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(o="POST"),a.length>0&&ie.ajax({url:e,type:o,dataType:"html",data:t}).done(function(e){i=arguments,a.html(r?ie("<div>").append(ie.parseHTML(e)).find(r):e)}).complete(n&&function(e,t){a.each(n,i||[e.responseText,t,e])}),this},ie.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ie.fn[t]=function(e){return this.on(t,e)}}),ie.expr.filters.animated=function(e){return ie.grep(ie.timers,function(t){return e===t.elem}).length};var nn=e.document.documentElement;ie.offset={setOffset:function(e,t,n){var r,i,o,a,s,l,u,c=ie.css(e,"position"),f=ie(e),d={};"static"===c&&(e.style.position="relative"),s=f.offset(),o=ie.css(e,"top"),l=ie.css(e,"left"),u=("absolute"===c||"fixed"===c)&&ie.inArray("auto",[o,l])>-1,u?(r=f.position(),a=r.top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(l)||0),ie.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(d.top=t.top-s.top+a),null!=t.left&&(d.left=t.left-s.left+i),"using"in t?t.using.call(e,d):f.css(d)}},ie.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){ie.offset.setOffset(this,e,t)});var t,n,r={top:0,left:0},i=this[0],o=i&&i.ownerDocument;if(o)return t=o.documentElement,ie.contains(t,i)?(typeof i.getBoundingClientRect!==Te&&(r=i.getBoundingClientRect()),n=V(o),{top:r.top+(n.pageYOffset||t.scrollTop)-(t.clientTop||0),left:r.left+(n.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}):r},position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===ie.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),ie.nodeName(e[0],"html")||(n=e.offset()),n.top+=ie.css(e[0],"borderTopWidth",!0),n.left+=ie.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-ie.css(r,"marginTop",!0),left:t.left-n.left-ie.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||nn;e&&!ie.nodeName(e,"html")&&"static"===ie.css(e,"position");)e=e.offsetParent;return e||nn})}}),ie.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n=/Y/.test(t);ie.fn[e]=function(r){return Ae(this,function(e,r,i){var o=V(e);return void 0===i?o?t in o?o[t]:o.document.documentElement[r]:e[r]:void(o?o.scrollTo(n?ie(o).scrollLeft():i,n?i:ie(o).scrollTop()):e[r]=i)},e,r,arguments.length,null)}}),ie.each(["top","left"],function(e,t){ie.cssHooks[t]=k(ne.pixelPosition,function(e,n){if(n)return n=rt(e,t),
tt.test(n)?ie(e).position()[t]+"px":n})}),ie.each({Height:"height",Width:"width"},function(e,t){ie.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){ie.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),a=n||(r===!0||i===!0?"margin":"border");return Ae(this,function(t,n,r){var i;return ie.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===r?ie.css(t,n,a):ie.style(t,n,r,a)},t,o?r:void 0,o,null)}})}),ie.fn.size=function(){return this.length},ie.fn.andSelf=ie.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return ie});var rn=e.jQuery,on=e.$;return ie.noConflict=function(t){return e.$===ie&&(e.$=on),t&&e.jQuery===ie&&(e.jQuery=rn),ie},typeof t===Te&&(e.jQuery=e.$=ie),ie})}}}}},{extensions:[".js",".json"]}),u=l("./node_modules/meteor/jquery/main.js");"undefined"==typeof Package&&(Package={}),function(e,t){for(var n in t)n in e||(e[n]=t[n])}(Package.jquery=u,{$:a,jQuery:s})}();
!function(){"undefined"==typeof Package&&(Package={}),Package["standard-minifier-css"]={}}();
!function(){"undefined"==typeof Package&&(Package={}),Package["standard-minifier-js"]={}}();
!function(){"undefined"==typeof Package&&(Package={}),Package["shell-server"]={}}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,r=Package.meteor.meteorEnv,o=Package.jquery.$,a=Package.jquery.jQuery,n=Package.modules.meteorInstall,i=Package.modules.Buffer,c=Package.modules.process,l=Package["ecmascript-runtime"].Symbol,s=Package["ecmascript-runtime"].Map,m=Package["ecmascript-runtime"].Set,u=Package["babel-runtime"].meteorBabelHelpers,g=Package.promise.Promise,f=n({node_modules:{meteor:{"ohif:polyfill":{client:{"index.js":["./ie",function(e,t,r){r.import("./ie")}],"ie.js":["meteor/jquery","./lib/absoluteUrl",function(e,t,r){var o;r.import("meteor/jquery",{$:function(e){o=e}});var a;if(r.import("./lib/absoluteUrl",{absoluteUrl:function(e){a=e}}),navigator&&/MSIE \d|Trident.*rv:/.test(navigator.userAgent)){var n=function e(t){var r=a("/packages/ohif_polyfill/public/js/"+t);document.write('<script src="'+r+'"></script>')};n("svgxuse.min.js"),n("typedarray.min.js"),window.addEventListener("click",function(e){window.SVGElementInstance&&e.target instanceof SVGElementInstance&&o(e.target.correspondingUseElement).trigger("click")},!0)}}],lib:{"absoluteUrl.js":["meteor/meteor",function(e,t,r){r.export({absoluteUrl:function(){return a}});var o;r.import("meteor/meteor",{Meteor:function(e){o=e}});var a=function e(t){return t&&(t=t.replace(/^\//,"")),o.absoluteUrl(t)}}]}}}}}},{extensions:[".js",".json"]});f("./node_modules/meteor/ohif:polyfill/client/index.js"),"undefined"==typeof Package&&(Package={}),Package["ohif:polyfill"]={}}();
!function(){"undefined"==typeof Package&&(Package={}),Package["standard-app-packages"]={}}();
!function(){"undefined"==typeof Package&&(Package={}),Package.stylus={}}();
!function(){var e=Package.meteor.Meteor,n=Package.meteor.global,r=Package.meteor.meteorEnv,o=Package.tracker.Tracker,t=Package.tracker.Deps,i=Package["mongo-id"].MongoID,a=Package["diff-sequence"].DiffSequence,c=Package.underscore._,f=Package.random.Random,u,d,s,l;(function(){var e=function(){u._suppressWarnings?u._suppressWarnings--:("undefined"!=typeof console&&console.warn&&console.warn.apply(console,arguments),u._loggedWarnings++)},n=i.idStringify,r=i.idParse;u={_suppressWarnings:0,_loggedWarnings:0,observe:function(e,n){var r=null,i=null,f=[],u=o.autorun(function(){var u=e();o.nonreactive(function(){var e;if(i&&(f=c.map(r.fetch(),function(e){return{_id:e._id,item:e}}),i.stop(),i=null),u)if(u instanceof Array)e=s(f,u,n);else{if(!a(u))throw t();var o=l(f,u,n);e=o[0],i=o[1]}else e=d(f,n);v(f,e,n),r=u,f=e})});return{stop:function(){u.stop(),i&&i.stop()}}},fetch:function(e){if(e){if(e instanceof Array)return e;if(a(e))return e.fetch();throw t()}return[]}};var t=function(){return new Error("{{#each}} currently only accepts arrays, cursors or falsey values.")},a=function(e){return e&&c.isObject(e)&&c.isFunction(e.observe)&&c.isFunction(e.fetch)},v=function(e,o,t){var i=Package["diff-sequence"].DiffSequence.diffQueryOrderedChanges,a=[],f=[],u={},d={},s={},l=e.length;c.each(o,function(e,r){f.push({_id:e._id}),d[n(e._id)]=r}),c.each(e,function(e,r){a.push({_id:e._id}),u[n(e._id)]=r,s[n(e._id)]=r}),i(a,f,{addedBefore:function(e,r,i){var a=i?s[n(i)]:l;i&&c.each(s,function(e,n){e>=a&&s[n]++}),l++,s[n(e)]=a,t.addedAt(e,o[d[n(e)]].item,a,i)},movedBefore:function(e,r){if(e!==r){var i=s[n(e)],a=r?s[n(r)]:l;a>i&&a--,c.each(s,function(e,n){i<e&&e<a?s[n]--:a<=e&&e<i&&s[n]++}),s[n(e)]=a,t.movedTo(e,o[d[n(e)]].item,i,a,r)}},removed:function(r){var o=s[n(r)];c.each(s,function(e,n){e>=o&&s[n]--}),delete s[n(r)],l--,t.removedAt(r,e[u[n(r)]].item,o)}}),c.each(d,function(n,i){var a=r(i);if(c.has(u,i)){var f=o[n].item,d=e[u[i]].item;"object"!=typeof f&&f===d||t.changedAt(a,f,d,n)}})};d=function(e,n){return[]},s=function(r,o,t){var i={},a=c.map(o,function(r,t){var a;if("string"==typeof r)a="-"+r;else if("number"==typeof r||"boolean"==typeof r||void 0===r||null===r)a=r;else{if("object"!=typeof r)throw new Error("{{#each}} doesn't support arrays with elements of type "+typeof r);a=r&&"_id"in r?r._id:t}var c=n(a);return i[c]?(r&&"object"==typeof r&&"_id"in r&&e("duplicate id "+a+" in",o),a=f.id()):i[c]=!0,{_id:a,item:r}});return a},l=function(e,n,r){var o=!0,t=[],i=n.observe({addedAt:function(e,n,i){if(o){if(null!==i)throw new Error("Expected initial data from observe in order");t.push({_id:e._id,item:e})}else r.addedAt(e._id,e,n,i)},changedAt:function(e,n,o){r.changedAt(e._id,e,n,o)},removedAt:function(e,n){r.removedAt(e._id,e,n)},movedTo:function(e,n,o,t){r.movedTo(e._id,e,n,o,t)}});return o=!1,[t,i]}}).call(this),"undefined"==typeof Package&&(Package={}),function(e,n){for(var r in n)r in e||(e[r]=n[r])}(Package["observe-sequence"]={},{ObserveSequence:u})}();
!function(){var a=Package.tracker.Tracker,e=Package.tracker.Deps;"undefined"==typeof Package&&(Package={}),function(a,e){for(var c in e)c in a||(a[c]=e[c])}(Package.deps={},{Tracker:a,Deps:e})}();
!function(){var t=Package.meteor.Meteor,e=Package.meteor.global,i=Package.meteor.meteorEnv,r=Package.tracker.Tracker,n=Package.tracker.Deps,o,a,s;(function(){o={},a=function(t){return t},s=Array.prototype.slice}).call(this),function(){var t=Object.prototype.hasOwnProperty,e=function(e,i){for(var r in i)t.call(i,r)&&(e[r]=i[r]);return e};o.Visitor=function(t){e(this,t)},o.Visitor.def=function(t){e(this.prototype,t)},o.Visitor.extend=function(t){var i=this,r=function t(){o.Visitor.apply(this,arguments)};return r.prototype=new i,r.extend=i.extend,r.def=i.def,t&&e(r.prototype,t),r},o.Visitor.def({visit:function(t){if(null==t)return this.visitNull.apply(this,arguments);if("object"==typeof t){if(t.htmljsType)switch(t.htmljsType){case o.Tag.htmljsType:return this.visitTag.apply(this,arguments);case o.CharRef.htmljsType:return this.visitCharRef.apply(this,arguments);case o.Comment.htmljsType:return this.visitComment.apply(this,arguments);case o.Raw.htmljsType:return this.visitRaw.apply(this,arguments);default:throw new Error("Unknown htmljs type: "+t.htmljsType)}return o.isArray(t)?this.visitArray.apply(this,arguments):this.visitObject.apply(this,arguments)}if("string"==typeof t||"boolean"==typeof t||"number"==typeof t)return this.visitPrimitive.apply(this,arguments);if("function"==typeof t)return this.visitFunction.apply(this,arguments);throw new Error("Unexpected object in htmljs: "+t)},visitNull:function(t){},visitPrimitive:function(t){},visitArray:function(t){},visitComment:function(t){},visitCharRef:function(t){},visitRaw:function(t){},visitTag:function(t){},visitObject:function(t){throw new Error("Unexpected object in htmljs: "+t)},visitFunction:function(t){throw new Error("Unexpected function in htmljs: "+t)}}),o.TransformingVisitor=o.Visitor.extend(),o.TransformingVisitor.def({visitNull:a,visitPrimitive:a,visitArray:function(t){for(var e=s.call(arguments),i=t,r=0;r<t.length;r++){var n=t[r];e[0]=n;var o=this.visit.apply(this,e);o!==n&&(i===t&&(i=t.slice()),i[r]=o)}return i},visitComment:a,visitCharRef:a,visitRaw:a,visitObject:a,visitFunction:a,visitTag:function(t){var e=t.children,i=s.call(arguments);i[0]=e;var r=this.visitChildren.apply(this,i),n=t.attrs;i[0]=n;var a=this.visitAttributes.apply(this,i);if(a===n&&r===e)return t;var l=o.getTag(t.tagName).apply(null,r);return l.attrs=a,l},visitChildren:function(t){return this.visitArray.apply(this,arguments)},visitAttributes:function(t){if(o.isArray(t)){for(var i=s.call(arguments),r=t,n=0;n<t.length;n++){var a=t[n];i[0]=a;var l=this.visitAttributes.apply(this,i);l!==a&&(r===t&&(r=t.slice()),r[n]=l)}return r}if(t&&o.isConstructedObject(t))throw new Error("The basic HTML.TransformingVisitor does not support foreign objects in attributes. Define a custom visitAttributes for this case.");var u=t,f=u;if(u){var c=[null,null];c.push.apply(c,arguments);for(var h in u){var p=u[h];c[0]=h,c[1]=p;var m=this.visitAttribute.apply(this,c);m!==p&&(f===u&&(f=e({},u)),f[h]=m)}}return f},visitAttribute:function(t,e,i){var r=s.call(arguments,2);return r[0]=e,this.visit.apply(this,r)}}),o.ToTextVisitor=o.Visitor.extend(),o.ToTextVisitor.def({visitNull:function(t){return""},visitPrimitive:function(t){var e=String(t);return this.textMode===o.TEXTMODE.RCDATA?e.replace(/&/g,"&amp;").replace(/</g,"&lt;"):this.textMode===o.TEXTMODE.ATTRIBUTE?e.replace(/&/g,"&amp;").replace(/"/g,"&quot;"):e},visitArray:function(t){for(var e=[],i=0;i<t.length;i++)e.push(this.visit(t[i]));return e.join("")},visitComment:function(t){throw new Error("Can't have a comment here")},visitCharRef:function(t){return this.textMode===o.TEXTMODE.RCDATA||this.textMode===o.TEXTMODE.ATTRIBUTE?t.html:t.str},visitRaw:function(t){return t.value},visitTag:function(t){return this.visit(this.toHTML(t))},visitObject:function(t){throw new Error("Unexpected object in htmljs in toText: "+t)},toHTML:function(t){return o.toHTML(t)}}),o.ToHTMLVisitor=o.Visitor.extend(),o.ToHTMLVisitor.def({visitNull:function(t){return""},visitPrimitive:function(t){var e=String(t);return e.replace(/&/g,"&amp;").replace(/</g,"&lt;")},visitArray:function(t){for(var e=[],i=0;i<t.length;i++)e.push(this.visit(t[i]));return e.join("")},visitComment:function(t){return"<!--"+t.sanitizedValue+"-->"},visitCharRef:function(t){return t.html},visitRaw:function(t){return t.value},visitTag:function(t){var e=[],i=t.tagName,r=t.children,n=t.attrs;if(n){n=o.flattenAttributes(n);for(var a in n)if("value"===a&&"textarea"===i)r=[n[a],r];else{var s=this.toText(n[a],o.TEXTMODE.ATTRIBUTE);e.push(" "+a+'="'+s+'"')}}var l="<"+i+e.join("")+">",u=[],f;if("textarea"===i){for(var c=0;c<r.length;c++)u.push(this.toText(r[c],o.TEXTMODE.RCDATA));f=u.join(""),"\n"===f.slice(0,1)&&(f="\n"+f)}else{for(var c=0;c<r.length;c++)u.push(this.visit(r[c]));f=u.join("")}var h=l+f;return!r.length&&o.isVoidElement(i)||(h+="</"+i+">"),h},visitObject:function(t){throw new Error("Unexpected object in htmljs in toHTML: "+t)},toText:function(t,e){return o.toText(t,e)}})}.call(this),function(){o.Tag=function(){},o.Tag.prototype.tagName="",o.Tag.prototype.attrs=null,o.Tag.prototype.children=Object.freeze?Object.freeze([]):[],o.Tag.prototype.htmljsType=o.Tag.htmljsType=["Tag"];var t=function(t){var e=function(){var t=this instanceof o.Tag?this:new e,i=0,r=arguments.length&&arguments[0];if(r&&"object"==typeof r)if(o.isConstructedObject(r)){if(r instanceof o.Attrs){var n=r.value;1===n.length?t.attrs=n[0]:n.length>1&&(t.attrs=n),i++}}else t.attrs=r,i++;return i<arguments.length&&(t.children=s.call(arguments,i)),t};return e.prototype=new o.Tag,e.prototype.constructor=e,e.prototype.tagName=t,e},e=o.Attrs=function(){var t=this instanceof e?this:new e;return t.value=s.call(arguments),t};o.getTag=function(e){var i=o.getSymbolName(e);if(i===e)throw new Error("Use the lowercase or camelCase form of '"+e+"' here");return o[i]||(o[i]=t(e)),o[i]},o.ensureTag=function(t){o.getTag(t)},o.isTagEnsured=function(t){return o.isKnownElement(t)},o.getSymbolName=function(t){return t.toUpperCase().replace(/-/g,"_")},o.knownElementNames="a abbr acronym address applet area article aside audio b base basefont bdi bdo big blockquote body br button canvas caption center cite code col colgroup command data datagrid datalist dd del details dfn dir div dl dt em embed eventsource fieldset figcaption figure font footer form frame frameset h1 h2 h3 h4 h5 h6 head header hgroup hr html i iframe img input ins isindex kbd keygen label legend li link main map mark menu meta meter nav noframes noscript object ol optgroup option output p param pre progress q rp rt ruby s samp script section select small source span strike strong style sub summary sup table tbody td textarea tfoot th thead time title tr track tt u ul var video wbr".split(" "),o.knownSVGElementNames="altGlyph altGlyphDef altGlyphItem animate animateColor animateMotion animateTransform circle clipPath color-profile cursor defs desc ellipse feBlend feColorMatrix feComponentTransfer feComposite feConvolveMatrix feDiffuseLighting feDisplacementMap feDistantLight feFlood feFuncA feFuncB feFuncG feFuncR feGaussianBlur feImage feMerge feMergeNode feMorphology feOffset fePointLight feSpecularLighting feSpotLight feTile feTurbulence filter font font-face font-face-format font-face-name font-face-src font-face-uri foreignObject g glyph glyphRef hkern image line linearGradient marker mask metadata missing-glyph path pattern polygon polyline radialGradient rect set stop style svg switch symbol text textPath title tref tspan use view vkern".split(" "),o.knownElementNames=o.knownElementNames.concat(o.knownSVGElementNames),o.voidElementNames="area base br col command embed hr img input keygen link meta param source track wbr".split(" ");var i={yes:!0},r=function(t){for(var e={},r=0;r<t.length;r++)e[t[r]]=i;return e},n=r(o.voidElementNames),a=r(o.knownElementNames),l=r(o.knownSVGElementNames);o.isKnownElement=function(t){return a[t]===i},o.isKnownSVGElement=function(t){return l[t]===i},o.isVoidElement=function(t){return n[t]===i};for(var u=0;u<o.knownElementNames.length;u++)o.ensureTag(o.knownElementNames[u]);var f=o.CharRef=function(t){if(!(this instanceof f))return new f(t);if(!(t&&t.html&&t.str))throw new Error("HTML.CharRef must be constructed with ({html:..., str:...})");this.html=t.html,this.str=t.str};f.prototype.htmljsType=f.htmljsType=["CharRef"];var c=o.Comment=function(t){if(!(this instanceof c))return new c(t);if("string"!=typeof t)throw new Error("HTML.Comment must be constructed with a string");this.value=t,this.sanitizedValue=t.replace(/^-|--+|-$/g,"")};c.prototype.htmljsType=c.htmljsType=["Comment"];var h=o.Raw=function(t){if(!(this instanceof h))return new h(t);if("string"!=typeof t)throw new Error("HTML.Raw must be constructed with a string");this.value=t};h.prototype.htmljsType=h.htmljsType=["Raw"],o.isArray=function(t){return t instanceof Array},o.isConstructedObject=function(t){return t&&"object"==typeof t&&t.constructor!==Object&&"function"==typeof t.constructor&&t instanceof t.constructor},o.isNully=function(t){if(null==t)return!0;if(o.isArray(t)){for(var e=0;e<t.length;e++)if(!o.isNully(t[e]))return!1;return!0}return!1},o.isValidAttributeName=function(t){return/^[:_A-Za-z][:_A-Za-z0-9.\-]*/.test(t)},o.flattenAttributes=function(t){if(!t)return t;var e=o.isArray(t);if(e&&0===t.length)return null;for(var i={},r=0,n=e?t.length:1;r<n;r++){var a=e?t[r]:t;if("object"!=typeof a||o.isConstructedObject(a))throw new Error("Expected plain JS object as attrs, found: "+a);for(var s in a){if(!o.isValidAttributeName(s))throw new Error("Illegal HTML attribute name: "+s);var l=a[s];o.isNully(l)||(i[s]=l)}}return i},o.toHTML=function(t){return(new o.ToHTMLVisitor).visit(t)},o.TEXTMODE={STRING:1,RCDATA:2,ATTRIBUTE:3},o.toText=function(t,e){if(!e)throw new Error("textMode required for HTML.toText");if(e!==o.TEXTMODE.STRING&&e!==o.TEXTMODE.RCDATA&&e!==o.TEXTMODE.ATTRIBUTE)throw new Error("Unknown textMode: "+e);var i=new o.ToTextVisitor({textMode:e});return i.visit(t)}}.call(this),"undefined"==typeof Package&&(Package={}),function(t,e){for(var i in e)i in t||(t[i]=e[i])}(Package.htmljs={},{HTML:o})}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,n=Package.meteor.meteorEnv,r=Package.jquery.$,i=Package.jquery.jQuery,a=Package.tracker.Tracker,o=Package.tracker.Deps,s=Package.check.check,l=Package.check.Match,c=Package.underscore._,u=Package["observe-sequence"].ObserveSequence,d=Package["reactive-var"].ReactiveVar,p=Package.htmljs.HTML,f,h,m,w,v;(function(){f={},f._escape=function(){var e={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;","&":"&amp;"},t=function(t){return e[t]};return function(e){return e.replace(/[&<>"'`]/g,t)}}(),f._warn=function(e){e="Warning: "+e,"undefined"!=typeof console&&console.warn&&console.warn(e)};var e=Function.prototype.bind;e?f._bind=function(t,n){if(2===arguments.length)return e.call(t,n);for(var r=new Array(arguments.length),i=0;i<r.length;i++)r[i]=arguments[i];return e.apply(t,r.slice(1))}:f._bind=c.bind}).call(this),function(){var e={};f._DOMBackend=e;var t="undefined"!=typeof i?i:"undefined"!=typeof Package?Package.jquery&&Package.jquery.jQuery:null;if(!t)throw new Error("jQuery not found");e._$jq=t,e.parseHTML=function(e){return t.parseHTML(e)||[]},e.Events={delegateEvents:function(e,n,r,i){t(e).on(n,r,i)},undelegateEvents:function(e,n,r){t(e).off(n,"**",r)},bindEventCapturer:function(n,r,i,a){var o=t(n),s=function(e){e=t.event.fix(e),e.currentTarget=e.target;var r=t(e.currentTarget);r.is(o.find(i))&&a.call(n,e)};a._meteorui_wrapper=s,r=e.Events.parseEventType(r),n.addEventListener(r,s,!0)},unbindEventCapturer:function(t,n,r){n=e.Events.parseEventType(n),t.removeEventListener(n,r._meteorui_wrapper,!0)},parseEventType:function(e){var t=e.indexOf(".");return t>=0?e.slice(0,t):e}};var n=function(){},r=function(e){this.next=this,this.prev=this,this.func=e};r.prototype.linkBefore=function(e){this.prev=e.prev,this.next=e,e.prev.next=this,e.prev=this},r.prototype.unlink=function(){this.prev.next=this.next,this.next.prev=this.prev},r.prototype.go=function(){var e=this.func;e&&e()},r.prototype.stop=r.prototype.unlink,e.Teardown={_JQUERY_EVENT_NAME:"blaze_teardown_watcher",_CB_PROP:"$blaze_teardown_callbacks",onElementTeardown:function(i,a){var o=new r(a),s=e.Teardown._CB_PROP;return i[s]||(i[s]=new r,t(i).on(e.Teardown._JQUERY_EVENT_NAME,n)),o.linkBefore(i[s]),o},tearDownElement:function(e){for(var n=[],r=e.getElementsByTagName("*"),i=0;i<r.length;i++)n.push(r[i]);n.push(e),t.cleanData(n)}},t.event.special[e.Teardown._JQUERY_EVENT_NAME]={setup:function(){},teardown:function(){var t=this,n=t[e.Teardown._CB_PROP];if(n){for(var r=n.next;r!==n;)r.go(),r=r.next;n.go(),t[e.Teardown._CB_PROP]=null}}},e.findBySelector=function(e,n){return t(e,n)}}.call(this),function(){var e=Object.freeze?Object.freeze([]):[];f._DOMRange=function(n){if(!(this instanceof t))return new t(n);var r=n||e;if(!r||"number"!=typeof r.length)throw new Error("Expected array");for(var i=0;i<r.length;i++)this._memberIn(r[i]);this.members=r,this.emptyRangePlaceholder=null,this.attached=!1,this.parentElement=null,this.parentRange=null,this.attachedCallbacks=e};var t=f._DOMRange;t._USE_COMMENT_PLACEHOLDERS=function(){var e=!1,t=document.createTextNode("");try{t.someProp=!0}catch(t){e=!0}return e}(),t._insert=function(e,n,r,i){var a=e;a instanceof t?a.attach(n,r,i):i?t._moveNodeWithHooks(a,n,r):t._insertNodeWithHooks(a,n,r)},t._remove=function(e){var n=e;n instanceof t?n.detach():t._removeNodeWithHooks(n)},t._removeNodeWithHooks=function(e){e.parentNode&&(1===e.nodeType&&e.parentNode._uihooks&&e.parentNode._uihooks.removeElement?e.parentNode._uihooks.removeElement(e):e.parentNode.removeChild(e))},t._insertNodeWithHooks=function(e,t,n){n=n||null,1===e.nodeType&&t._uihooks&&t._uihooks.insertElement?t._uihooks.insertElement(e,n):t.insertBefore(e,n)},t._moveNodeWithHooks=function(e,t,n){e.parentNode===t&&(n=n||null,1===e.nodeType&&t._uihooks&&t._uihooks.moveElement?t._uihooks.moveElement(e,n):t.insertBefore(e,n))},t.forElement=function(e){if(1!==e.nodeType)throw new Error("Expected element, found: "+e);for(var t=null;e&&!t;)t=e.$blaze_range||null,t||(e=e.parentNode);return t},t.prototype.attach=function(e,n,r,i){if((r||i)&&(this.parentElement!==e||!this.attached))throw new Error("Can only move or replace an attached DOMRange, and only under the same parent element");var a=this.members;if(a.length){this.emptyRangePlaceholder=null;for(var o=0;o<a.length;o++)t._insert(a[o],e,n,r)}else{var s=t._USE_COMMENT_PLACEHOLDERS?document.createComment(""):document.createTextNode("");this.emptyRangePlaceholder=s,e.insertBefore(s,n||null)}if(this.attached=!0,this.parentElement=e,!r&&!i)for(var o=0;o<this.attachedCallbacks.length;o++){var l=this.attachedCallbacks[o];l.attached&&l.attached(this,e)}},t.prototype.setMembers=function(e){var t=e;if(!t||"number"!=typeof t.length)throw new Error("Expected array");for(var n=this.members,r=0;r<n.length;r++)this._memberOut(n[r]);for(var r=0;r<t.length;r++)this._memberIn(t[r]);if(this.attached){if(t.length||n.length){var i=this.lastNode().nextSibling,a=this.parentElement;this.detach(!0),this.members=t,this.attach(a,i,!1,!0)}}else this.members=t},t.prototype.firstNode=function(){if(!this.attached)throw new Error("Must be attached");if(!this.members.length)return this.emptyRangePlaceholder;var e=this.members[0];return e instanceof t?e.firstNode():e},t.prototype.lastNode=function(){if(!this.attached)throw new Error("Must be attached");if(!this.members.length)return this.emptyRangePlaceholder;var e=this.members[this.members.length-1];return e instanceof t?e.lastNode():e},t.prototype.detach=function(e){if(!this.attached)throw new Error("Must be attached");var n=this.parentElement,r=this.members;if(r.length)for(var i=0;i<r.length;i++)t._remove(r[i]);else{var a=this.emptyRangePlaceholder;this.parentElement.removeChild(a),this.emptyRangePlaceholder=null}if(!e){this.attached=!1,this.parentElement=null;for(var i=0;i<this.attachedCallbacks.length;i++){var o=this.attachedCallbacks[i];o.detached&&o.detached(this,n)}}},t.prototype.addMember=function(e,n,r){var i=this.members;if(!(n>=0&&n<=i.length))throw new Error("Bad index in range.addMember: "+n);if(r||this._memberIn(e),this.attached)if(0===i.length)this.setMembers([e]);else{var a;if(n===i.length)a=this.lastNode().nextSibling;else{var o=i[n];a=o instanceof t?o.firstNode():o}i.splice(n,0,e),t._insert(e,this.parentElement,a,r)}else i.splice(n,0,e)},t.prototype.removeMember=function(n,r){var i=this.members;if(!(n>=0&&n<i.length))throw new Error("Bad index in range.removeMember: "+n);if(r)i.splice(n,1);else{var a=i[n];this._memberOut(a),1===i.length?this.setMembers(e):(i.splice(n,1),this.attached&&t._remove(a))}},t.prototype.moveMember=function(e,t){var n=this.members[e];this.removeMember(e,!0),this.addMember(n,t,!0)},t.prototype.getMember=function(e){var t=this.members;if(!(e>=0&&e<t.length))throw new Error("Bad index in range.getMember: "+e);return this.members[e]},t.prototype._memberIn=function(e){e instanceof t?e.parentRange=this:1===e.nodeType&&(e.$blaze_range=this)},t._destroy=function(e,n){e instanceof t?e.view&&f._destroyView(e.view,n):n||1!==e.nodeType||e.$blaze_range&&(f._destroyNode(e),e.$blaze_range=null)},t.prototype._memberOut=t._destroy,t.prototype.destroyMembers=function(e){for(var t=this.members,n=0;n<t.length;n++)this._memberOut(t[n],e)},t.prototype.destroy=function(e){t._destroy(this,e)},t.prototype.containsElement=function(e){if(!this.attached)throw new Error("Must be attached");if(!f._elementContains(this.parentElement,e))return!1;for(;e.parentNode!==this.parentElement;)e=e.parentNode;for(var t=e.$blaze_range;t&&t!==this;)t=t.parentRange;return t===this},t.prototype.containsRange=function(e){if(!this.attached)throw new Error("Must be attached");if(!e.attached)return!1;if(e.parentElement!==this.parentElement)return this.containsElement(e.parentElement);if(e===this)return!1;for(;e&&e!==this;)e=e.parentRange;return e===this},t.prototype.onAttached=function(e){this.onAttachedDetached({attached:e})},t.prototype.onAttachedDetached=function(t){this.attachedCallbacks===e&&(this.attachedCallbacks=[]),this.attachedCallbacks.push(t)},t.prototype.$=function(e){var t=this,n=this.parentElement;if(!n)throw new Error("Can't select in removed DomRange");if(11===n.nodeType)throw new Error("Can't use $ on an offscreen range");var r=f._DOMBackend.findBySelector(e,n),i=function(e){return"number"==typeof e&&(e=this),t.containsElement(e)};if(r.filter)r=r.filter(i);else{for(var a=[],o=0;o<r.length;o++){var s=r[o];i(s)&&a.push(s)}r=a}return r},f._elementContains=function(e,t){return 1===e.nodeType&&(e!==t&&(e.compareDocumentPosition?16&e.compareDocumentPosition(t):(t=t.parentNode,!(!t||1!==t.nodeType)&&(e===t||e.contains(t)))))}}.call(this),function(){var e=f._EventSupport={},t=f._DOMBackend,n=e.eventsToDelegate={blur:1,change:1,click:1,focus:1,focusin:1,focusout:1,reset:1,submit:1},r=e.EVENT_MODE={TBD:0,BUBBLING:1,CAPTURING:2},i=1,a=function(e,a,o,s,l){this.elem=e,this.type=a,this.selector=o,this.handler=s,this.recipient=l,this.id=i++,this.mode=r.TBD,this.delegatedHandler=function(e){return function(t){if(e.selector||t.currentTarget===t.target)return e.handler.apply(e.recipient,arguments)}}(this);var u=e.addEventListener&&!c.has(n,t.Events.parseEventType(a));u?this.capturingHandler=function(e){return function(n){if(e.mode===r.TBD){if(n.bubbles)return e.mode=r.BUBBLING,void t.Events.unbindEventCapturer(e.elem,e.type,e.capturingHandler);e.mode=r.CAPTURING,t.Events.undelegateEvents(e.elem,e.type,e.delegatedHandler)}e.delegatedHandler(n)}}(this):this.mode=r.BUBBLING};e.HandlerRec=a,a.prototype.bind=function(){this.mode!==r.BUBBLING&&t.Events.bindEventCapturer(this.elem,this.type,this.selector||"*",this.capturingHandler),this.mode!==r.CAPTURING&&t.Events.delegateEvents(this.elem,this.type,this.selector||"*",this.delegatedHandler)},a.prototype.unbind=function(){this.mode!==r.BUBBLING&&t.Events.unbindEventCapturer(this.elem,this.type,this.capturingHandler),this.mode!==r.CAPTURING&&t.Events.undelegateEvents(this.elem,this.type,this.delegatedHandler)},e.listen=function(e,t,n,r,i,o){try{e=e}finally{}var s=[];t.replace(/[^ \/]+/g,function(e){s.push(e)});for(var l=[],c=0,u=s.length;c<u;c++){var d=s[c],p=e.$blaze_events;p||(p=e.$blaze_events={});var f=p[d];f||(f=p[d]={},f.handlers=[]);var h=f.handlers,m=new a(e,d,n,r,i);if(l.push(m),m.bind(),h.push(m),o)for(var w=o(i);w;w=o(w))for(var v=0,_=h.length;v<_;v++){var g=h[v];g.recipient===w&&(g.unbind(),g.bind(),h.splice(v,1),h.push(g),v--,_--)}}return{stop:function(){var t=e.$blaze_events;if(t){for(var n=0;n<l.length;n++){var r=l[n],i=t[r.type];if(i)for(var a=i.handlers,o=a.length-1;o>=0;o--)a[o]===r&&(r.unbind(),a.splice(o,1))}l.length=0}}}}}.call(this),function(){var t=!1;f._allowJavascriptUrls=function(){t=!0},f._javascriptUrlsAllowed=function(){return t},h=function(e,t){this.name=e,this.value=t},f._AttributeHandler=h,h.prototype.update=function(e,t,n){null===n?null!==t&&e.removeAttribute(this.name):e.setAttribute(this.name,n)},h.extend=function(e){var t=this,n=function e(){h.apply(this,arguments)};return n.prototype=new t,n.extend=t.extend,e&&c.extend(n.prototype,e),n},f._DiffingAttributeHandler=h.extend({update:function(e,t,n){if(!this.getCurrentValue||!this.setValue||!this.parseValue)throw new Error("Missing methods in subclass of 'DiffingAttributeHandler'");var r=t?this.parseValue(t):{},i=n?this.parseValue(n):{},a=this.getCurrentValue(e),o=a?this.parseValue(a):{};c.each(c.keys(r),function(e){e in i||delete o[e]}),c.each(c.keys(i),function(e){o[e]=i[e]}),this.setValue(e,c.values(o).join(" "))}});var n=f._DiffingAttributeHandler.extend({getCurrentValue:function(e){return e.className},setValue:function(e,t){e.className=t},parseValue:function(e){var t={};return c.each(e.split(" "),function(e){e&&(t[e]=e)}),t}}),i=n.extend({getCurrentValue:function(e){return e.className.baseVal},setValue:function(e,t){e.setAttribute("class",t)}}),a=f._DiffingAttributeHandler.extend({getCurrentValue:function(e){return e.getAttribute("style")},setValue:function(e,t){""===t?e.removeAttribute("style"):e.setAttribute("style",t)},parseValue:function(e){for(var t={},n=/(\*?[-#\/\*\\\w]+(?:\[[0-9a-z_-]+\])?)\s*:\s*(?:\'(?:\\\'|.)*?\'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+[;\s]*/g,i=n.exec(e);i;)t[" "+i[1]]=i[0].trim?i[0].trim():r.trim(i[0]),i=n.exec(e);return t}}),o=h.extend({update:function(e,t,n){var r=this.name;null==n?null!=t&&(e[r]=!1):e[r]=!0}}),s=h.extend({update:function(e,t,n){var r=this.name;n!==e[r]&&(e[r]=n)}}),l=h.extend({update:function(e,t,n){var r="http://www.w3.org/1999/xlink";null===n?null!==t&&e.removeAttributeNS(r,this.name):e.setAttributeNS(r,this.name,this.value)}}),u=function(e){return"ownerSVGElement"in e},d=function(e,t){var n={FORM:["action"],BODY:["background"],BLOCKQUOTE:["cite"],Q:["cite"],DEL:["cite"],INS:["cite"],OBJECT:["classid","codebase","data","usemap"],APPLET:["codebase"],A:["href"],AREA:["href"],LINK:["href"],BASE:["href"],IMG:["longdesc","src","usemap"],FRAME:["longdesc","src"],IFRAME:["longdesc","src"],HEAD:["profile"],SCRIPT:["src"],INPUT:["src","usemap","formaction"],BUTTON:["formaction"],BASE:["href"],MENUITEM:["icon"],HTML:["manifest"],VIDEO:["poster"]};if("itemid"===t)return!0;var r=n[e]||[];return c.contains(r,t)};if(e.isClient)var p=document.createElement("A");var w=function(t){if(e.isClient)return p.href=t,(p.protocol||"").toLowerCase();throw new Error("getUrlProtocol not implemented on the server")},v=h.prototype.update,_=h.extend({update:function(e,t,n){var r=this,i=arguments;if(f._javascriptUrlsAllowed())v.apply(r,i);else{var a="javascript:"===w(n),o="vbscript:"===w(n);a||o?(f._warn("URLs that use the 'javascript:' or 'vbscript:' protocol are not allowed in URL attribute values. Call Blaze._allowJavascriptUrls() to enable them."),v.apply(r,[e,t,null])):v.apply(r,i)}}});f._makeAttributeHandler=function(e,t,r){return"class"===t?u(e)?new i(t,r):new n(t,r):"style"===t?new a(t,r):"OPTION"===e.tagName&&"selected"===t||"INPUT"===e.tagName&&"checked"===t?new o(t,r):"autofocus"===t||"disabled"===t||"hidden"===t||"readonly"===t||"required"===t?new o(t,r):"FORM"===e.tagName&&"novalidate"===t?new o(t,r):"IFRAME"!==e.tagName||"sandbox"!==t||r?"IMG"===e.tagName&&"ismap"===t?new o(t,r):"INPUT"!==e.tagName&&"SELECT"!==e.tagName||"multiple"!==t?"OL"===e.tagName&&"reversed"===t?new o(t,r):"SCRIPT"===e.tagName&&"defer"===t?new o(t,r):"VIDEO"!==e.tagName||"autoplay"!==t&&"controls"!==t&&"loop"!==t&&"muted"!==t?"TEXTAREA"!==e.tagName&&"INPUT"!==e.tagName||"value"!==t?"xlink:"===t.substring(0,6)?new l(t.substring(6),r):d(e.tagName,t)?new _(t,r):new h(t,r):new s(t,r):new o(t,r):new o(t,r):new o(t,(!!r))},m=function(e){this.elem=e,this.handlers={}},m.prototype.update=function(e){var t=this.elem,n=this.handlers;for(var r in n)if(!c.has(e,r)){var i=n[r],a=i.value;i.value=null,i.update(t,a,null),delete n[r]}for(var r in e){var i=null,a,o=e[r];c.has(n,r)?(i=n[r],a=i.value):null!==o&&(i=f._makeAttributeHandler(t,r,o),n[r]=i,a=null),a!==o&&(i.value=o,i.update(t,a,o),null===o&&delete n[r])}}}.call(this),function(){f._materializeDOM=function(t,n,r,i){var a=i||[];if(e(t,n,r,a),!i)for(;a.length;){var o=a.pop();o()}return n};var e=function(e,n,r,i){if(null!=e){switch(typeof e){case"string":case"boolean":case"number":return void n.push(document.createTextNode(String(e)));case"object":if(e.htmljsType)switch(e.htmljsType){case p.Tag.htmljsType:return void n.push(t(e,r,i));case p.CharRef.htmljsType:return void n.push(document.createTextNode(e.str));case p.Comment.htmljsType:return void n.push(document.createComment(e.sanitizedValue));case p.Raw.htmljsType:for(var a=f._DOMBackend.parseHTML(e.value),o=0;o<a.length;o++)n.push(a[o]);return}else{if(p.isArray(e)){for(var o=e.length-1;o>=0;o--)i.push(f._bind(f._materializeDOM,null,e[o],n,r,i));return}if(e instanceof f.Template&&(e=e.constructView()),e instanceof f.View)return void f._materializeView(e,r,i,n)}}throw new Error("Unexpected object in htmljs: "+e)}},t=function(e,t,r){var i=e.tagName,o;o=(p.isKnownSVGElement(i)||n(e))&&document.createElementNS?document.createElementNS("http://www.w3.org/2000/svg",i):document.createElement(i);var s=e.attrs,l=e.children;if("textarea"===i&&e.children.length&&!(s&&"value"in s)){if("function"==typeof s||p.isArray(s))throw new Error("Can't have reactive children of TEXTAREA node; use the 'value' attribute instead.");s=c.extend({},s||null),s.value=f._expand(l,t),l=[]}if(s){var u=new m(o),d=function(){var e=f._expandAttributes(s,t),n=p.flattenAttributes(e),r={};for(var i in n)r[i]=f._toText(n[i],t,p.TEXTMODE.STRING);u.update(r)},h;h=t?t.autorun(d,void 0,"updater"):a.nonreactive(function(){return a.autorun(function(){a._withCurrentView(t,d)})}),f._DOMBackend.Teardown.onElementTeardown(o,function e(){h.stop()})}if(l.length){var w=[];r.push(function(){for(var e=0;e<w.length;e++){var t=w[e];t instanceof f._DOMRange?t.attach(o):o.appendChild(t)}}),r.push(f._bind(f._materializeDOM,null,l,w,t,r))}return o},n=function(e){return"a"===e.tagName&&e.attrs&&void 0!==e.attrs["xlink:href"]}}.call(this),function(){var t;f._throwNextException=!1,f._reportException=function(n,r){if(f._throwNextException)throw f._throwNextException=!1,n;t||(t=function(){return"undefined"!=typeof e?e._debug:"undefined"!=typeof console&&console.log?console.log:function(){}}),t()(r||"Exception caught in template:",n.stack||n.message||n)},f._wrapCatchingExceptions=function(e,t){return"function"!=typeof e?e:function(){try{return e.apply(this,arguments)}catch(e){f._reportException(e,"Exception in "+t+":")}}}}.call(this),function(){f.View=function(e,t){return this instanceof f.View?("function"==typeof e&&(t=e,e=""),this.name=e,this._render=t,this._callbacks={created:null,rendered:null,destroyed:null},this.isCreated=!1,this._isCreatedForExpansion=!1,this.isRendered=!1,this._isAttached=!1,this.isDestroyed=!1,this._isInRender=!1,this.parentView=null,this._domrange=null,this._hasGeneratedParent=!1,this._scopeBindings={},void(this.renderCount=0)):new f.View(e,t)},f.View.prototype._render=function(){return null},f.View.prototype.onViewCreated=function(e){this._callbacks.created=this._callbacks.created||[],this._callbacks.created.push(e)},f.View.prototype._onViewRendered=function(e){this._callbacks.rendered=this._callbacks.rendered||[],this._callbacks.rendered.push(e)},f.View.prototype.onViewReady=function(e){var t=this,n=function(){a.afterFlush(function(){t.isDestroyed||f._withCurrentView(t,function(){e.call(t)})})};t._onViewRendered(function e(){t.isDestroyed||(t._domrange.attached?n():t._domrange.onAttached(n))})},f.View.prototype.onViewDestroyed=function(e){this._callbacks.destroyed=this._callbacks.destroyed||[],this._callbacks.destroyed.push(e)},f.View.prototype.removeViewDestroyedListener=function(e){var t=this._callbacks.destroyed;if(t){var n=c.lastIndexOf(t,e);n!==-1&&(t[n]=null)}},f.View.prototype.autorun=function(e,t,n){var r=this;if(!r.isCreated)throw new Error("View#autorun must be called from the created callback at the earliest");if(this._isInRender)throw new Error("Can't call View#autorun from inside render(); try calling it from the created or rendered callback");var i=f.Template._currentTemplateInstanceFunc,o=function n(a){return f._withCurrentView(t||r,function(){return f.Template._withTemplateInstanceFunc(i,function(){return e.call(r,a)})})};o.displayName=(r.name||"anonymous")+":"+(n||"anonymous");var s=a.autorun(o),l=function(){s.stop()};return r.onViewDestroyed(l),s.onStop(function(){r.removeViewDestroyedListener(l)}),s},f.View.prototype._errorIfShouldntCallSubscribe=function(){var e=this;if(!e.isCreated)throw new Error("View#subscribe must be called from the created callback at the earliest");if(e._isInRender)throw new Error("Can't call View#subscribe from inside render(); try calling it from the created or rendered callback");if(e.isDestroyed)throw new Error("Can't call View#subscribe from inside the destroyed callback, try calling it inside created or rendered.")},f.View.prototype.subscribe=function(t,n){var r=this;n=n||{},r._errorIfShouldntCallSubscribe();var i;return i=n.connection?n.connection.subscribe.apply(n.connection,t):e.subscribe.apply(e,t),r.onViewDestroyed(function(){i.stop()}),i},f.View.prototype.firstNode=function(){if(!this._isAttached)throw new Error("View must be attached before accessing its DOM");return this._domrange.firstNode()},f.View.prototype.lastNode=function(){if(!this._isAttached)throw new Error("View must be attached before accessing its DOM");return this._domrange.lastNode()},f._fireCallbacks=function(e,t){f._withCurrentView(e,function(){a.nonreactive(function n(){for(var r=e._callbacks[t],i=0,a=r&&r.length;i<a;i++)r[i]&&r[i].call(e)})})},f._createView=function(e,t,n){if(e.isCreated)throw new Error("Can't render the same View twice");e.parentView=t||null,e.isCreated=!0,n&&(e._isCreatedForExpansion=!0),f._fireCallbacks(e,"created")};var t=function(e,t){var n=new f._DOMRange(t);e._domrange=n,n.view=e,e.isRendered=!0,f._fireCallbacks(e,"rendered");var r=null;return n.onAttached(function t(n,i){e._isAttached=!0,r=f._DOMBackend.Teardown.onElementTeardown(i,function t(){f._destroyView(e,!0)})}),e.onViewDestroyed(function(){r&&r.stop(),r=null}),n};f._materializeView=function(e,n,r,i){f._createView(e,n);var o,s;return a.nonreactive(function(){e.autorun(function t(n){e.renderCount++,e._isInRender=!0;var r=e._render();e._isInRender=!1,n.firstRun||a.nonreactive(function t(){var n=f._materializeDOM(r,[],e);f._isContentEqual(s,r)||(o.setMembers(n),f._fireCallbacks(e,"rendered"))}),s=r,a.onInvalidate(function(){o&&o.destroyMembers()})},void 0,"materialize");var n;r?(n=[],r.push(function(){o=t(e,n),n=null,i.push(o)}),r.push(f._bind(f._materializeDOM,null,s,n,e,r))):(n=f._materializeDOM(s,[],e),o=t(e,n),n=null)}),r?null:o},f._expandView=function(e,t){f._createView(e,t,!0),e._isInRender=!0;var n=f._withCurrentView(e,function(){return e._render()});e._isInRender=!1;var r=f._expand(n,e);return a.active?a.onInvalidate(function(){f._destroyView(e)}):f._destroyView(e),r},f._HTMLJSExpander=p.TransformingVisitor.extend(),f._HTMLJSExpander.def({visitObject:function(e){return e instanceof f.Template&&(e=e.constructView()),e instanceof f.View?f._expandView(e,this.parentView):p.TransformingVisitor.prototype.visitObject.call(this,e)},visitAttributes:function(e){return"function"==typeof e&&(e=f._withCurrentView(this.parentView,e)),p.TransformingVisitor.prototype.visitAttributes.call(this,e)},visitAttribute:function(e,t,n){return"function"==typeof t&&(t=f._withCurrentView(this.parentView,t)),p.TransformingVisitor.prototype.visitAttribute.call(this,e,t,n)}});var n=function(){var e=f.currentView;return e&&e._isInRender?e:null};f._expand=function(e,t){return t=t||n(),new f._HTMLJSExpander({parentView:t}).visit(e)},f._expandAttributes=function(e,t){return t=t||n(),new f._HTMLJSExpander({parentView:t}).visitAttributes(e)},f._destroyView=function(e,t){e.isDestroyed||(e.isDestroyed=!0,f._fireCallbacks(e,"destroyed"),e._domrange&&e._domrange.destroyMembers(t))},f._destroyNode=function(e){1===e.nodeType&&f._DOMBackend.Teardown.tearDownElement(e)},f._isContentEqual=function(e,t){return e instanceof p.Raw?t instanceof p.Raw&&e.value===t.value:null==e?null==t:e===t&&("number"==typeof e||"boolean"==typeof e||"string"==typeof e)},f.currentView=null,f._withCurrentView=function(e,t){var n=f.currentView;try{return f.currentView=e,t()}finally{f.currentView=n}};var r=function(e){if(null===e)throw new Error("Can't render null");if("undefined"==typeof e)throw new Error("Can't render undefined");if(!(e instanceof f.View||e instanceof f.Template||"function"==typeof e))try{(new p.Visitor).visit(e)}catch(e){throw new Error("Expected Template or View")}},i=function(e){if(r(e),e instanceof f.Template)return e.constructView();if(e instanceof f.View)return e;var t=e;return"function"!=typeof t&&(t=function(){return e}),f.View("render",t)},o=function(e){return r(e),"function"!=typeof e?function(){return e}:e};f.render=function(e,t,r,a){if(t||f._warn("Blaze.render without a parent element is deprecated. You must specify where to insert the rendered content."),r instanceof f.View&&(a=r,r=null),t&&"number"!=typeof t.nodeType)throw new Error("'parentElement' must be a DOM node");if(r&&"number"!=typeof r.nodeType)throw new Error("'nextNode' must be a DOM node");a=a||n();var o=i(e);return f._materializeView(o,a),t&&o._domrange.attach(t,r),o},f.insert=function(e,t,n){if(f._warn("Blaze.insert has been deprecated. Specify where to insert the rendered content in the call to Blaze.render."),!(e&&e._domrange instanceof f._DOMRange))throw new Error("Expected template rendered with Blaze.render");e._domrange.attach(t,n)},f.renderWithData=function(e,t,n,r,i){return f.render(f._TemplateWith(t,o(e)),n,r,i)},f.remove=function(e){if(!(e&&e._domrange instanceof f._DOMRange))throw new Error("Expected template rendered with Blaze.render");for(;e;){if(!e.isDestroyed){var t=e._domrange;t.attached&&!t.parentRange&&t.detach(),t.destroy()}e=e._hasGeneratedParent&&e.parentView}},f.toHTML=function(e,t){return t=t||n(),p.toHTML(f._expandView(i(e),t))},f.toHTMLWithData=function(e,t,r){return r=r||n(),p.toHTML(f._expandView(f._TemplateWith(t,o(e)),r))},f._toText=function(e,t,r){if("function"==typeof e)throw new Error("Blaze._toText doesn't take a function, just HTMLjs");if(null==t||t instanceof f.View||(r=t,t=null),t=t||n(),!r)throw new Error("textMode required");if(r!==p.TEXTMODE.STRING&&r!==p.TEXTMODE.RCDATA&&r!==p.TEXTMODE.ATTRIBUTE)throw new Error("Unknown textMode: "+r);return p.toText(f._expand(e,t),r)},f.getData=function(e){var t;if(e)if(e instanceof f.View){var n=e;t="with"===n.name?n:f.getView(n,"with")}else{if("number"!=typeof e.nodeType)throw new Error("Expected DOM element or View");if(1!==e.nodeType)throw new Error("Expected DOM element");t=f.getView(e,"with")}else t=f.getView("with");return t?t.dataVar.get():null},f.getElementData=function(e){if(f._warn("Blaze.getElementData has been deprecated. Use Blaze.getData(element) instead."),1!==e.nodeType)throw new Error("Expected DOM element");return f.getData(e)},f.getView=function(e,t){var n=t;if("string"==typeof e&&(n=e,e=null),e){if(e instanceof f.View)return f._getParentView(e,n);if("number"==typeof e.nodeType)return f._getElementView(e,n);throw new Error("Expected DOM element or View")}return f._getCurrentView(n)},f._getCurrentView=function(e){var t=f.currentView;if(!t)throw new Error("There is no current view");if(e){for(;t&&t.name!==e;)t=t.parentView;return t||null}return t},f._getParentView=function(e,t){var n=e.parentView;if(t)for(;n&&n.name!==t;)n=n.parentView;return n||null},f._getElementView=function(e,t){for(var n=f._DOMRange.forElement(e),r=null;n&&!r;)r=n.view||null,r||(n=n.parentRange?n.parentRange:f._DOMRange.forElement(n.parentElement));if(t){for(;r&&r.name!==t;)r=r.parentView;return r||null}return r},f._addEventMap=function(e,t,n){n=n||null;var r=[];if(!e._domrange)throw new Error("View must have a DOMRange");e._domrange.onAttached(function i(a,o){c.each(t,function(t,i){var s=i.split(/,\s+/);c.each(s,function(i){var s=i.split(/\s+/);if(0!==s.length){var l=s.shift(),c=s.join(" ");r.push(f._EventSupport.listen(o,l,c,function(r){if(!a.containsElement(r.currentTarget))return null;var i=n||this,o=arguments;return f._withCurrentView(e,function(){return t.apply(i,o)})},a,function(e){return e.parentRange}))}})})}),e.onViewDestroyed(function(){c.each(r,function(e){e.stop()}),r.length=0})}}.call(this),function(){f._calculateCondition=function(e){return e instanceof Array&&0===e.length&&(e=!1),!!e},f.With=function(e,t){var n=f.View("with",t);return n.dataVar=new d,n.onViewCreated(function(){"function"==typeof e?n.autorun(function(){n.dataVar.set(e())},n.parentView,"setData"):n.dataVar.set(e)}),n},f._attachBindingsToView=function(e,t){t.onViewCreated(function(){c.each(e,function(e,n){t._scopeBindings[n]=new d,"function"==typeof e?t.autorun(function(){t._scopeBindings[n].set(e())},t.parentView):t._scopeBindings[n].set(e)})})},f.Let=function(e,t){var n=f.View("let",t);return f._attachBindingsToView(e,n),n},f.If=function(e,t,n,r){var i=new d,a=f.View(r?"unless":"if",function(){return i.get()?t():n?n():null});return a.__conditionVar=i,a.onViewCreated(function(){this.autorun(function(){var t=f._calculateCondition(e());i.set(r?!t:t)},this.parentView,"condition")}),a},f.Unless=function(e,t,n){return f.If(e,t,n,!0)},f.Each=function(e,t,n){var r=f.View("each",function(){var e=this.initialSubviews;return this.initialSubviews=null,this._isCreatedForExpansion&&(this.expandedValueDep=new a.Dependency,this.expandedValueDep.depend()),e});r.initialSubviews=[],r.numItems=0,r.inElseMode=!1,r.stopHandle=null,r.contentFunc=t,r.elseFunc=n,r.argVar=new d,r.variableName=null;var i=function(e,t){void 0===t&&(t=r.numItems-1);for(var n=e;n<=t;n++){var i=r._domrange.members[n].view;i._scopeBindings["@index"].set(n)}};return r.onViewCreated(function(){r.autorun(function(){var t=e();c.isObject(t)&&c.has(t,"_sequence")&&(r.variableName=t._variable||null,t=t._sequence),r.argVar.set(t)},r.parentView,"collection"),r.stopHandle=u.observe(function(){return r.argVar.get()},{addedAt:function(e,t,n){a.nonreactive(function(){var e;e=r.variableName?f.View("item",r.contentFunc):f.With(t,r.contentFunc),r.numItems++;var a={};if(a["@index"]=n,r.variableName&&(a[r.variableName]=t),f._attachBindingsToView(a,e),r.expandedValueDep)r.expandedValueDep.changed();else if(r._domrange){r.inElseMode&&(r._domrange.removeMember(0),r.inElseMode=!1);var o=f._materializeView(e,r);r._domrange.addMember(o,n),i(n)}else r.initialSubviews.splice(n,0,e)})},removedAt:function(e,t,n){a.nonreactive(function(){r.numItems--,r.expandedValueDep?r.expandedValueDep.changed():r._domrange?(r._domrange.removeMember(n),i(n),r.elseFunc&&0===r.numItems&&(r.inElseMode=!0,r._domrange.addMember(f._materializeView(f.View("each_else",r.elseFunc),r),0))):r.initialSubviews.splice(n,1)})},changedAt:function(e,t,n,i){a.nonreactive(function(){if(r.expandedValueDep)r.expandedValueDep.changed();else{var e;e=r._domrange?r._domrange.getMember(i).view:r.initialSubviews[i],r.variableName?e._scopeBindings[r.variableName].set(t):e.dataVar.set(t)}})},movedTo:function(e,t,n,o){a.nonreactive(function(){if(r.expandedValueDep)r.expandedValueDep.changed();else if(r._domrange)r._domrange.moveMember(n,o),i(Math.min(n,o),Math.max(n,o));else{var e=r.initialSubviews,t=e[n];e.splice(n,1),e.splice(o,0,t)}})}}),r.elseFunc&&0===r.numItems&&(r.inElseMode=!0,r.initialSubviews[0]=f.View("each_else",r.elseFunc))}),r.onViewDestroyed(function(){r.stopHandle&&r.stopHandle.stop()}),r},f._TemplateWith=function(e,t){var n,r=e;"function"!=typeof e&&(r=function(){return e});var i=function(){var e=null;return n.parentView&&"InOuterTemplateScope"===n.parentView.name&&(e=n.parentView.originalParentView),e?f._withCurrentView(e,r):r()},a=function(){var e=t.call(this);return e instanceof f.Template&&(e=e.constructView()),e instanceof f.View&&(e._hasGeneratedParent=!0),e};return n=f.With(i,a),n.__isTemplateWith=!0,n},f._InOuterTemplateScope=function(e,t){var n=f.View("InOuterTemplateScope",t),r=e.parentView;return r.__isTemplateWith&&(r=r.parentView),n.onViewCreated(function(){this.originalParentView=this.parentView,this.parentView=r,this.__childDoesntStartNewLexicalScope=!0}),n},f.InOuterTemplateScope=f._InOuterTemplateScope}.call(this),function(){f._globalHelpers={},f.registerHelper=function(e,t){f._globalHelpers[e]=t},f.deregisterHelper=function(e){delete f._globalHelpers[e]};var e=function(e,t){return"function"!=typeof e?e:f._bind(e,t)},t=function(e){return"function"==typeof e?function(){var t=f.getData();return null==t&&(t={}),e.apply(t,arguments)}:e};f._OLDSTYLE_HELPER={},f._getTemplateHelper=function(e,r,i){var a=!1;if(e.__helpers.has(r)){var o=e.__helpers.get(r);if(o!==f._OLDSTYLE_HELPER)return null!=o?n(t(o),i):null;a=!0}return r in e&&(a||(e.__helpers.set(r,f._OLDSTYLE_HELPER),e._NOWARN_OLDSTYLE_HELPERS||f._warn("Assigning helper with `"+e.viewName+"."+r+" = ...` is deprecated. Use `"+e.viewName+".helpers(...)` instead.")),null!=e[r])?n(t(e[r]),i):null};var n=function(e,t){
return"function"!=typeof e?e:function(){var n=this,r=arguments;return f.Template._withTemplateInstanceFunc(t,function(){return f._wrapCatchingExceptions(e,"template helper").apply(n,r)})}};f._lexicalBindingLookup=function(e,t){var n=e,r=[];do if(c.has(n._scopeBindings,t)){var i=n._scopeBindings[t];return function(){return i.get()}}while((!n.__startsNewLexicalScope||n.parentView&&n.parentView.__childDoesntStartNewLexicalScope)&&(n=n.parentView));return null},f._getTemplate=function(e,t){return e in f.Template&&f.Template[e]instanceof f.Template?f.Template[e]:null},f._getGlobalHelper=function(e,r){return null!=f._globalHelpers[e]?n(t(f._globalHelpers[e]),r):null},f.View.prototype.lookup=function(e,t){var n=this.template,r=t&&t.template,i,a,o,s;if(this.templateInstance&&(o=f._bind(this.templateInstance,this)),/^\./.test(e)){if(!/^(\.)+$/.test(e))throw new Error("id starting with dot must be a series of dots");return f._parentData(e.length-1,!0)}return n&&null!=(i=f._getTemplateHelper(n,e,o))?i:n&&null!=(a=f._lexicalBindingLookup(f.currentView,e))?a:r&&null!=(s=f._getTemplate(e,o))?s:null!=(i=f._getGlobalHelper(e,o))?i:function(){var t=arguments.length>0,n=f.getData(),i=n&&n[e];if(!i){if(r)throw new Error("No such template: "+e);if(t)throw new Error("No such function: "+e);if("@"===e.charAt(0)&&(null===i||void 0===i))throw new Error("Unsupported directive: "+e)}if(!n)return null;if("function"!=typeof i){if(t)throw new Error("Can't call non-function: "+i);return i}return i.apply(n,arguments)}},f._parentData=function(e,t){null==e&&(e=1);for(var n=f.getView("with"),r=0;r<e&&n;r++)n=f.getView(n,"with");return n?t?function(){return n.dataVar.get()}:n.dataVar.get():null},f.View.prototype.lookupTemplate=function(e){return this.lookup(e,{template:!0})}}.call(this),function(){f.Template=function(e,n){if(!(this instanceof f.Template))return new f.Template(e,n);if("function"==typeof e&&(n=e,e=""),"string"!=typeof e)throw new Error("viewName must be a String (or omitted)");if("function"!=typeof n)throw new Error("renderFunction must be a function");this.viewName=e,this.renderFunction=n,this.__helpers=new t,this.__eventMaps=[],this._callbacks={created:[],rendered:[],destroyed:[]}};var e=f.Template,t=function(){};t.prototype.get=function(e){return this[" "+e]},t.prototype.set=function(e,t){this[" "+e]=t},t.prototype.has=function(e){return" "+e in this},f.isTemplate=function(e){return e instanceof f.Template},e.prototype.onCreated=function(e){this._callbacks.created.push(e)},e.prototype.onRendered=function(e){this._callbacks.rendered.push(e)},e.prototype.onDestroyed=function(e){this._callbacks.destroyed.push(e)},e.prototype._getCallbacks=function(e){var t=this,n=t[e]?[t[e]]:[];return n=n.concat(t._callbacks[e])};var n=function(t,n){e._withTemplateInstanceFunc(function(){return n},function(){for(var e=0,r=t.length;e<r;e++)t[e].call(n)})};e.prototype.constructView=function(t,r){var i=this,a=f.View(i.viewName,i.renderFunction);a.template=i,a.templateContentBlock=t?new e("(contentBlock)",t):null,a.templateElseBlock=r?new e("(elseBlock)",r):null,(i.__eventMaps||"object"==typeof i.events)&&a._onViewRendered(function(){1===a.renderCount&&(i.__eventMaps.length||"object"!=typeof i.events||e.prototype.events.call(i,i.events),c.each(i.__eventMaps,function(e){f._addEventMap(a,e,a)}))}),a._templateInstance=new f.TemplateInstance(a),a.templateInstance=function(){var e=a._templateInstance;return e.data=f.getData(a),a._domrange&&!a.isDestroyed?(e.firstNode=a._domrange.firstNode(),e.lastNode=a._domrange.lastNode()):(e.firstNode=null,e.lastNode=null),e};var o=i._getCallbacks("created");a.onViewCreated(function(){n(o,a.templateInstance())});var s=i._getCallbacks("rendered");a.onViewReady(function(){n(s,a.templateInstance())});var l=i._getCallbacks("destroyed");return a.onViewDestroyed(function(){n(l,a.templateInstance())}),a},f.TemplateInstance=function(e){if(!(this instanceof f.TemplateInstance))return new f.TemplateInstance(e);if(!(e instanceof f.View))throw new Error("View required");e._templateInstance=this,this.view=e,this.data=null,this.firstNode=null,this.lastNode=null,this._allSubsReadyDep=new a.Dependency,this._allSubsReady=!1,this._subscriptionHandles={}},f.TemplateInstance.prototype.$=function(e){var t=this.view;if(!t._domrange)throw new Error("Can't use $ on template instance with no DOM");return t._domrange.$(e)},f.TemplateInstance.prototype.findAll=function(e){return Array.prototype.slice.call(this.$(e))},f.TemplateInstance.prototype.find=function(e){var t=this.$(e);return t[0]||null},f.TemplateInstance.prototype.autorun=function(e){return this.view.autorun(e)},f.TemplateInstance.prototype.subscribe=function(){var e=this,t=e._subscriptionHandles,n=c.toArray(arguments),r={};if(n.length){var i=c.last(n),a={onReady:l.Optional(Function),onError:l.Optional(Function),onStop:l.Optional(Function),connection:l.Optional(l.Any)};c.isFunction(i)?r.onReady=n.pop():i&&!c.isEmpty(i)&&l.test(i,a)&&(r=n.pop())}var o,s=r.onStop;r.onStop=function(n){delete t[o.subscriptionId],e._allSubsReady||e._allSubsReadyDep.changed(),s&&s(n)};var u=r.connection,d=c.pick(r,["onReady","onError","onStop"]);return n.push(d),o=e.view.subscribe.call(e.view,n,{connection:u}),c.has(t,o.subscriptionId)||(t[o.subscriptionId]=o,e._allSubsReady&&e._allSubsReadyDep.changed()),o},f.TemplateInstance.prototype.subscriptionsReady=function(){return this._allSubsReadyDep.depend(),this._allSubsReady=c.all(this._subscriptionHandles,function(e){return e.ready()}),this._allSubsReady},e.prototype.helpers=function(e){if(!c.isObject(e))throw new Error("Helpers dictionary has to be an object");for(var t in e)this.__helpers.set(t,e[t])},e._currentTemplateInstanceFunc=null,e._withTemplateInstanceFunc=function(t,n){if("function"!=typeof n)throw new Error("Expected function, got: "+n);var r=e._currentTemplateInstanceFunc;try{return e._currentTemplateInstanceFunc=t,n()}finally{e._currentTemplateInstanceFunc=r}},e.prototype.events=function(t){if(!c.isObject(t))throw new Error("Event map has to be an object");var n=this,r={};for(var i in t)r[i]=function(t,n){return function(t){var r=this,i=f.getData(t.currentTarget);null==i&&(i={});var a=Array.prototype.slice.call(arguments),o=f._bind(r.templateInstance,r);return a.splice(1,0,o()),e._withTemplateInstanceFunc(o,function(){return n.apply(i,a)})}}(i,t[i]);n.__eventMaps.push(r)},e.instance=function(){return e._currentTemplateInstanceFunc&&e._currentTemplateInstanceFunc()},e.currentData=f.getData,e.parentData=f._parentData,e.registerHelper=f.registerHelper,e.deregisterHelper=f.deregisterHelper}.call(this),function(){w=f,f.ReactiveVar=d,w._templateInstance=f.Template.instance,v={},v.registerHelper=f.registerHelper,v._escape=f._escape,v.SafeString=function(e){this.string=e},v.SafeString.prototype.toString=function(){return this.string.toString()}}.call(this),"undefined"==typeof Package&&(Package={}),function(e,t){for(var n in t)n in e||(e[n]=t[n])}(Package.blaze={},{Blaze:f,UI:w,Handlebars:v})}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,n=Package.meteor.meteorEnv,r=Package["observe-sequence"].ObserveSequence,a=Package.underscore._,u=Package.tracker.Tracker,i=Package.tracker.Deps,o=Package.htmljs.HTML,c=Package.blaze.Blaze,l=Package.blaze.UI,f=Package.blaze.Handlebars,p;(function(){p={};var e=function(e,t){return e===t};p.include=function(t,n,r){if(!t)return null;if("function"!=typeof t){var a=t;if(!c.isTemplate(a))throw new Error("Expected template or null, found: "+a);var u=t.constructView(n,r);return u.__startsNewLexicalScope=!0,u}var i=c.ReactiveVar(null,e),u=c.View("Spacebars.include",function(){var e=i.get();if(null===e)return null;if(!c.isTemplate(e))throw new Error("Expected template or null, found: "+e);return e.constructView(n,r)});return u.__templateVar=i,u.onViewCreated(function(){this.autorun(function(){i.set(t())})}),u.__startsNewLexicalScope=!0,u},p.mustacheImpl=function(e){var t=arguments;if(t.length>1){var n=t[t.length-1];if(n instanceof p.kw){var r={};for(var a in n.hash){var u=n.hash[a];r[a]="function"==typeof u?u():u}t[t.length-1]=p.kw(r)}else n=p.kw(),t=Array.prototype.slice.call(arguments),t.push(n)}return p.call.apply(null,t)},p.mustache=function(e){var t=p.mustacheImpl.apply(null,arguments);return t instanceof p.SafeString?o.Raw(t.toString()):null==t||t===!1?null:String(t)},p.attrMustache=function(e){var t=p.mustacheImpl.apply(null,arguments);if(null==t||""===t)return null;if("object"==typeof t)return t;if("string"==typeof t&&o.isValidAttributeName(t)){var n={};return n[t]="",n}throw new Error("Expected valid attribute name, '', null, or object")},p.dataMustache=function(e){var t=p.mustacheImpl.apply(null,arguments);return t},p.makeRaw=function(e){return null==e?null:e instanceof o.Raw?e:o.Raw(e)},p.call=function(e){if("function"==typeof e){for(var t=[],n=1;n<arguments.length;n++){var r=arguments[n];t[n-1]="function"==typeof r?r():r}return e.apply(null,t)}if(null!=e&&arguments.length>1)throw new Error("Can't call non-function: "+e);return e},p.kw=function(e){return this instanceof p.kw?void(this.hash=e||{}):new p.kw(e)},p.SafeString=function(e){return this instanceof p.SafeString?new f.SafeString(e):new p.SafeString(e)},p.SafeString.prototype=f.SafeString.prototype,p.dot=function(e,t){if(arguments.length>2){var n=[];return n.push(p.dot(e,t)),n.push.apply(n,Array.prototype.slice.call(arguments,2)),p.dot.apply(null,n)}if("function"==typeof e&&(e=e()),!e)return e;var r=e[t];return"function"!=typeof r?r:function(){return r.apply(e,arguments)}},p.With=function(e,t,n){var r=new c.ReactiveVar,a=c.View("Spacebars_with",function(){return c.If(function(){return r.get()},function(){return c.With(function(){return r.get()},t)},n)});return a.onViewCreated(function(){this.autorun(function(){r.set(e()),u.onInvalidate(function(){r.dep.changed()})})}),a},p.TemplateWith=c._TemplateWith}).call(this),"undefined"==typeof Package&&(Package={}),function(e,t){for(var n in t)n in e||(e[n]=t[n])}(Package.spacebars={},{Spacebars:p})}();
!function(){"undefined"==typeof Package&&(Package={}),Package["templating-compiler"]={}}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,n=Package.meteor.meteorEnv,a=Package.underscore._,o=Package.blaze.Blaze,c=Package.blaze.UI,r=Package.blaze.Handlebars,i=Package.spacebars.Spacebars,u=Package.htmljs.HTML,l;(function(){l=o.Template;var e="__proto__ name".split(" ");l.__checkName=function(t){if(t in l||a.contains(e,t)){if(l[t]instanceof l&&"body"!==t)throw new Error("There are multiple templates named '"+t+"'. Each template needs a unique name.");throw new Error("This template name is reserved: "+t)}},l.__define__=function(e,t){l.__checkName(e),l[e]=new l("Template."+e,t),l[e]._NOWARN_OLDSTYLE_HELPERS=!0},l.body=new l("body",function(){var e=this;return a.map(l.body.contentRenderFuncs,function(t){return t.apply(e)})}),l.body.contentRenderFuncs=[],l.body.view=null,l.body.addContent=function(e){l.body.contentRenderFuncs.push(e)},l.body.renderToDocument=function(){if(!l.body.view){var e=o.render(l.body,document.body);l.body.view=e}},c.body=l.body,l.__body__=l.body,l.__body__.__contentParts=l.body.contentViews,l.__body__.__instantiate=l.body.renderToDocument}).call(this),function(){l.__checkName("__dynamic"),l.__dynamic=new l("Template.__dynamic",function(){var e=this;return[o.View("lookup:checkContext",function(){return i.mustache(e.lookup("checkContext"))}),"\n ",o.If(function(){return i.call(e.lookup("dataContextPresent"))},function(){return["\n ",i.include(e.lookupTemplate("__dynamicWithDataContext"),function(){return o._InOuterTemplateScope(e,function(){return i.include(function(){return i.call(e.templateContentBlock)})})}),"\n "]},function(){return["\n \n ",o._TemplateWith(function(){return{template:i.call(e.lookup("template")),data:i.call(e.lookup(".."))}},function(){return i.include(e.lookupTemplate("__dynamicWithDataContext"),function(){return o._InOuterTemplateScope(e,function(){return i.include(function(){return i.call(e.templateContentBlock)})})})}),"\n "]})]}),l.__checkName("__dynamicWithDataContext"),l.__dynamicWithDataContext=new l("Template.__dynamicWithDataContext",function(){var e=this;return i.With(function(){return i.dataMustache(e.lookup("chooseTemplate"),e.lookup("template"))},function(){return["\n \n ",o._TemplateWith(function(){return i.call(i.dot(e.lookup(".."),"data"))},function(){return i.include(e.lookupTemplate(".."),function(){return o._InOuterTemplateScope(e,function(){return i.include(function(){return i.call(e.templateContentBlock)})})})}),"\n "]})})}.call(this),function(){var e=o.Template;e.__dynamicWithDataContext.helpers({chooseTemplate:function(t){return o._getTemplate(t,function(){return e.instance()})}}),e.__dynamic.helpers({dataContextPresent:function(){return a.has(this,"data")},checkContext:function(){if(!a.has(this,"template"))throw new Error("Must specify name in the 'template' argument to {{> Template.dynamic}}.");a.each(this,function(e,t){if("template"!==t&&"data"!==t)throw new Error("Invalid argument to {{> Template.dynamic}}: "+t)})}})}.call(this),"undefined"==typeof Package&&(Package={}),function(e,t){for(var n in t)n in e||(e[n]=t[n])}(Package["templating-runtime"]={},{Template:l})}();
!function(){var a=Package["templating-runtime"].Template;"undefined"==typeof Package&&(Package={}),function(a,e){for(var n in e)n in a||(a[n]=e[n])}(Package.templating={},{Template:a})}();
!function(){var a=Package.blaze.Blaze,e=Package.blaze.UI,n=Package.blaze.Handlebars;"undefined"==typeof Package&&(Package={}),function(a,e){for(var n in e)n in a||(a[n]=e[n])}(Package.ui={},{Blaze:a,UI:e,Handlebars:n})}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,n=Package.meteor.meteorEnv,r=Package.underscore._,o=Package.ejson.EJSON,i;(function(){if(Package["cmather:iron-core"])throw new Error("\n\n Sorry! The cmather:iron-{x} packages were migrated to the new package system with the wrong name, and you have duplicate copies.\n You can see which cmather:iron-{x} packages have been installed by using this command:\n\n > meteor list\n\n Can you remove any installed cmather:iron-{x} packages like this: \n\n > meteor remove cmather:iron-core\n > meteor remove cmather:iron-router\n > meteor remove cmather:iron-dynamic-template\n > meteor remove cmather:iron-dynamic-layout\n \n The new packages are named iron:{x}. For example:\n\n > meteor add iron:router\n\n Sorry for the hassle, but thank you! \n\n ")}).call(this),function(){i={},i.utils={},i.utils.assert=function(e,t){if(!e)throw new Error(t)},i.utils.warn=function(e,t){e||console&&console.warn&&console.warn(t)},i.utils.defaultValue=function(e,t,n){return"undefined"==typeof e[t]?(e[t]=n,n):e[t]},i.utils.inherits=function(e,t,n){i.utils.assert("undefined"!=typeof e,"Child is undefined in inherits function"),i.utils.assert("undefined"!=typeof t,"Parent is undefined in inherits function");for(var a in t)r.has(t,a)&&(e[a]=o.clone(t[a]));var s=function(){this.constructor=e};return s.prototype=t.prototype,e.prototype=new s,e.__super__=t.prototype,r.isObject(n)&&r.extend(e.prototype,n),e},i.utils.extend=function(e,t){t=t||{};var n=function(){var e;e=r.has(t,"constructor")?t.constructor:n.__super__.constructor,e.apply(this,arguments)};return i.utils.inherits(n,e,t)},i.utils.global=function(){return e.isClient?window:t}(),i.utils.namespace=function(e,t){var n=i.utils.global,r,o,a,s;i.utils.assert("string"==typeof e,"namespace must be a string"),r=e.split("."),a=r.pop(),s=n;for(var c=0;c<r.length;c++)o=r[c],s=s[o]=s[o]||{};return 2===arguments.length?(s[a]=t,t):s[a]},i.utils.resolve=function(e){var t=i.utils.global,n,r;if("string"==typeof e){n=e.split("."),r=t;for(var o=0;o<n.length;o++)if(r=r[n[o]],!r)return}else r=e;return r},i.utils.capitalize=function(e){return e.charAt(0).toUpperCase()+e.slice(1,e.length)},i.utils.classCase=function(e){var t=/_|-|\.|\//;return e?r.map(e.split(t),function(e){return i.utils.capitalize(e)}).join(""):""},i.utils.camelCase=function(e){var t=i.utils.classCase(e);return t=t.charAt(0).toLowerCase()+t.slice(1,t.length)},i.utils.notifyDeprecated=function(e){var t,n,o,i,a="[:where] ':name' is deprecated. Please use ':instead' instead.";r.isObject(e)?(t=e.name,n=e.instead,o=e.message||a,i=e.where||"IronRouter"):(o=e,t="",n="",i=""),"undefined"!=typeof console&&console.warn&&console.warn("<deprecated> "+o.replace(":name",t).replace(":instead",n).replace(":where",i)+" "+(new Error).stack)},i.utils.withDeprecatedNotice=function(e,t,n){return function(){return Utils.notifyDeprecated(e),t&&t.apply(n||this,arguments)}},Function.prototype.deprecate=function(e){var t=this;return i.utils.withDeprecatedNotice(e,t)},i.utils.debug=function(e){return i.utils.assert("string"==typeof e,"debug requires a package name"),function t(){if(console&&console.log&&i.debug===!0){var n=r.toArray(arguments).join(" ");console.log("%c<"+e+"> %c"+n,"color: #999;","color: #000;")}}},i.utils.get=function(e){for(var t=1;t<arguments.length;t++){if(!(e&&arguments[t]in e))return;e=e[arguments[t]]}return e},i.utils.global.Iron=i}.call(this),"undefined"==typeof Package&&(Package={}),function(e,t){for(var n in t)n in e||(e[n]=t[n])}(Package["iron:core"]={},{Iron:i})}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,n=Package.meteor.meteorEnv,a=Package.ui.Blaze,r=Package.ui.UI,i=Package.ui.Handlebars,o=Package.underscore._,s=Package.jquery.$,u=Package.jquery.jQuery,c=Package.tracker.Tracker,l=Package.tracker.Deps,p=Package["reactive-var"].ReactiveVar,h=Package["templating-runtime"].Template,d=Package.random.Random,m=Package["iron:core"].Iron,f=Package.htmljs.HTML,_=Package.spacebars.Spacebars,v;(function(){if(Package["cmather:iron-dynamic-template"])throw new Error("\n\n Sorry! The cmather:iron-{x} packages were migrated to the new package system with the wrong name, and you have duplicate copies.\n You can see which cmather:iron-{x} packages have been installed by using this command:\n\n > meteor list\n\n Can you remove any installed cmather:iron-{x} packages like this: \n\n > meteor remove cmather:iron-core\n > meteor remove cmather:iron-router\n > meteor remove cmather:iron-dynamic-template\n > meteor remove cmather:iron-dynamic-layout\n \n The new packages are named iron:{x}. For example:\n\n > meteor add iron:router\n\n Sorry for the hassle, but thank you! \n\n ")}).call(this),function(){h.__checkName("__DynamicTemplateError__"),h.__DynamicTemplateError__=new h("Template.__DynamicTemplateError__",function(){var e=this;return f.DIV({style:"margin: 0 auto; color: red;"},"\n ",a.View("lookup:msg",function(){return _.mustache(e.lookup("msg"))}),"\n ")})}.call(this),function(){var e=m.utils.debug("iron:dynamic-template"),t=m.utils.assert,n=m.utils.get,i=m.utils.camelCase,u=function(e){return Object.prototype.toString.call(e)};v=function(e){this._id=d.id(),this.options=e=e||{},this._template=e.template,this._defaultTemplate=e.defaultTemplate,this._content=e.content,this._data=e.data,this._templateDep=new c.Dependency,this._dataDep=new c.Dependency,this._lookupHostDep=new c.Dependency,this._lookupHostValue=null,this._hooks={},this._eventMap=null,this._eventHandles=null,this._eventThisArg=null,this.name=e.name||this.constructor.prototype.name||"DynamicTemplate",this.isCreated=!1,this.isDestroyed=!1},v.prototype.template=function(e){if(1===arguments.length&&e!==this._template)return this._template=e,void this._templateDep.changed();if(!(arguments.length>0))return this._templateDep.depend(),this._template?"function"==typeof this._template?this._template():this._template:this._defaultTemplate?"function"==typeof this._defaultTemplate?this._defaultTemplate():this._defaultTemplate:void 0},v.prototype.defaultTemplate=function(e){return 1!==arguments.length?this._defaultTemplate:void(this._defaultTemplate=e)},v.prototype.clear=function(){this._template=void 0,this._data=void 0,this._templateDep.changed()},v.prototype.data=function(e){return 1===arguments.length&&e!==this._data?(this._data=e,void this._dataDep.changed()):(this._dataDep.depend(),"function"==typeof this._data?this._data():this._data)},v.prototype.create=function(e){var t=this;if(this.isCreated)throw new Error("DynamicTemplate view is already created");this.isCreated=!0,this.isDestroyed=!1;var n=p(null),r=a.View("DynamicTemplate",function(){var e=this,r=n.get();return a.With(function(){var n=t.data();return"undefined"!=typeof n?n:v.getParentDataContext(e)},function(){return t.renderView(r)})});return r.onViewCreated(function(){this.autorun(function(){n.set(t.template())})}),o.each(["onViewCreated","onViewReady","_onViewRendered","onViewDestroyed"],function(e){r[e](function(){t._runHooks(e,this)})}),r._onViewRendered(function(){t.isInserted=!0,1===r.renderCount&&t._attachEvents()}),r.onViewDestroyed(function(){t._detachEvents()}),r._templateInstance=new a.TemplateInstance(r),r.templateInstance=function(){var e=r._templateInstance;return e.data=a.getData(r),r._domrange&&!r.isDestroyed?(e.firstNode=r._domrange.firstNode(),e.lastNode=r._domrange.lastNode()):(e.firstNode=null,e.lastNode=null),e},this.view=r,r.__dynamicTemplate__=this,r.name=this.name,r},v.prototype.renderView=function(e){var t=this,n=null;return"string"==typeof e?(n=h[e],n||(n=h[i(e)]),n||(n=a.With({msg:"Couldn't find a template named "+JSON.stringify(e)+" or "+JSON.stringify(i(e))+". Are you sure you defined it?"},function(){return h.__DynamicTemplateError__}))):"[object Object]"===u(e)?n=e:"undefined"!=typeof t._content&&(n=t._content),n},v.prototype.destroy=function(){this.isCreated&&(a.remove(this.view),this.view=null,this.isDestroyed=!0,this.isCreated=!1)},o.each(["onViewCreated","onViewReady","_onViewRendered","onViewDestroyed"],function(e){v.prototype[e]=function(t){var n=this._hooks[e]=this._hooks[e]||[];return n.push(t),this}}),v.prototype._runHooks=function(e,t){for(var n=this._hooks[e]||[],a,r=0;r<n.length;r++)a=n[r],a.call(t,this)},v.prototype.events=function(e,t){var n=this;this._detachEvents(),this._eventThisArg=t;var r=this._eventMap={};for(var i in e)r[i]=function(e,r){return function(e){var i=a.getData(e.currentTarget);null==i&&(i={});var o=n.view.templateInstance();return r.call(t||this,e,o,i)}}(i,e[i]);this._attachEvents()},v.prototype._attachEvents=function(){var e=this,t=e._eventThisArg,n=e._eventMap,r=e.view,i=e._eventHandles;if(r){var s=r._domrange;if(!s)throw new Error("no domrange");var u=function(t,s){o.each(n,function(n,u){var c=u.split(/,\s+/);o.each(c,function(o){var u=o.split(/\s+/);if(0!==u.length){var c=u.shift(),l=u.join(" ");i.push(a._EventSupport.listen(s,c,l,function(i){if(!t.containsElement(i.currentTarget))return null;var o=e._eventThisArg||this,s=arguments;return a._withCurrentView(r,function(){return n.apply(o,s)})},t,function(e){return e.parentRange}))}})})};s.attached?u(s,s.parentElement):s.onAttached(u)}},v.prototype._detachEvents=function(){o.each(this._eventHandles,function(e){e.stop()}),this._eventHandles=[]};var f=function(e,t,n,r){o.each(n,function(n,i){var s=i.split(/,\s+/);o.each(s,function(i){var o=i.split(/\s+/);if(0!==o.length){var s=o.shift(),u=o.join(" ");handles.push(a._EventSupport.listen(t,s,u,function(t){if(!e.containsElement(t.currentTarget))return null;var i=r||this,o=arguments;return a._withCurrentView(view,function(){return n.apply(i,o)})},e,function(e){return e.parentRange}))}})})};v.prototype.insert=function(e){if(e=e||{},!this.isInserted){this.isInserted=!0;var t=e.el||document.body,n=s(t);if(0===n.length)throw new Error("No element to insert layout into. Is your element defined? Try a Meteor.startup callback.");return this.view||this.create(e),a.render(this.view,n[0],e.nextNode,e.parentView),this}},v.prototype._getLookupHost=function(){return this._lookupHostValue},v.prototype._setLookupHost=function(e){var t=this;return t._lookupHostValue!==e&&(t._lookupHostValue=e,l.afterFlush(function(){t._lookupHostDep.changed()})),this},v.getParentDataContext=function(e){return v.getDataContext(e&&e.parentView)},v.getDataContext=function(e){for(;e;){if("with"===e.name&&!e.__isTemplateWith)return e.dataVar.get();e=e.parentView}return null},v.getInclusionArguments=function(e){var t=e&&e.parentView;return t&&t.__isTemplateWith?t.dataVar.get():null},v.args=function(e){return function(t){var n=v.getInclusionArguments(e);return n?t?n[t]:n:null}},v.extend=function(e){return m.utils.extend(this,e)},v.findFirstLookupHost=function(e){var n,r;for(t(e instanceof a.View,"view must be a Blaze.View");e;)if(e.__dynamicTemplate__){var n=e.__dynamicTemplate__._getLookupHost();if(n)return n}else e=e.parentView},v.findLookupHostWithProperty=function(e,r){var i,o;for(t(e instanceof a.View,"view must be a Blaze.View");e;){if(e.__dynamicTemplate__){var i=e.__dynamicTemplate__._getLookupHost();if(i&&n(i,r))return i}e=e.parentView}},v.findLookupHostWithHelper=function(e,r){var i,o;for(t(e instanceof a.View,"view must be a Blaze.View");e;){if(e.__dynamicTemplate__){var i=e.__dynamicTemplate__._getLookupHost();if(i&&n(i,"constructor","_helpers",r))return i}e=e.parentView}},"undefined"!=typeof h&&r.registerHelper("DynamicTemplate",new h("DynamicTemplateHelper",function(){var e=v.args(this);return new v({data:function(){return e("data")},template:function(){return e("template")},content:this.templateContentBlock}).create()})),m.DynamicTemplate=v}.call(this),function(){var e=m.utils.assert,t=m.utils.get,n=a.View.prototype.lookup;a.View.prototype.lookup=function(e){var r;return r=v.findLookupHostWithHelper(a.getView(),e),r?function n(){var a=t(r,"constructor","_helpers",e),i=[].slice.call(arguments);return"function"==typeof a?a.apply(r,i):a}:n.apply(this,arguments)}}.call(this),"undefined"==typeof Package&&(Package={}),Package["iron:dynamic-template"]={}}();
!function(){var e=Package.meteor.Meteor,n=Package.meteor.global,t=Package.meteor.meteorEnv,r=Package["templating-runtime"].Template,o=Package.blaze.Blaze,i=Package.blaze.UI,a=Package.blaze.Handlebars,s=Package.underscore._,c=Package.tracker.Tracker,u=Package.tracker.Deps,h=Package["iron:core"].Iron,l=Package.htmljs.HTML,g=Package.spacebars.Spacebars,d,p,m;(function(){var e=[];if(Package["cmather:iron-layout"]&&e.push("\n\n The cmather:iron-{x} packages were migrated to the new package system with the wrong name, and you have duplicate copies.\n You can see which cmather:iron-{x} packages have been installed by using this command:\n\n > meteor list\n\n Can you remove any installed cmather:iron-{x} packages like this: \n\n > meteor remove cmather:iron-core\n > meteor remove cmather:iron-router\n > meteor remove cmather:iron-dynamic-template\n > meteor remove cmather:iron-dynamic-layout\n \n The new packages are named iron:{x}. For example:\n\n > meteor add iron:router\n\n Sorry for the hassle, but thank you! \n\n "),Package["cmather:blaze-layout"]&&e.push("The blaze-layout package has been replaced by iron-layout. Please remove the package like this:\n> meteor remove cmather:blaze-layout\n"),e.length>0)throw new Error("Sorry! Looks like there's a few errors related to iron:layout\n\n"+e.join("\n\n"))}).call(this),function(){r.__checkName("__IronDefaultLayout__"),r.__IronDefaultLayout__=new r("Template.__IronDefaultLayout__",function(){var e=this;return g.include(e.lookupTemplate("yield"))})}.call(this),function(){var e=h.DynamicTemplate,n=h.utils.inherits;d=function(e){for(;e;){if("Iron.Layout"===e.name)return e.__dynamicTemplate__;e=e.parentView}return null},p=function(e){var n=this;p.__super__.constructor.apply(this,arguments),e=e||{},this.name="Iron.Layout",this._regions={},this._regionHooks={},this.defaultTemplate("__IronDefaultLayout__"),e.content&&this.render(e.content)},m=p.DEFAULT_REGION="main",n(p,h.DynamicTemplate),p.prototype.region=function(e,n){return this._ensureRegion(e,n)},p.prototype.destroyRegions=function(){s.each(this._regions,function(e){e.destroy()}),this._regions={}},p.prototype.render=function(e,n){n=n||{};var t=n.to||n.region||m,r=this.region(t);this._trackRenderedRegion(t),r.template(e),r.data(n.data)},p.prototype.has=function(e){return e=e||p.DEFAULT_REGION,!!this._regions[e]},p.prototype.regionKeys=function(){return s.keys(this._regions)},p.prototype.clear=function(e){return e=e||p.DEFAULT_REGION,this.has(e)&&this.region(e).template(null),this},p.prototype.clearAll=function(){return s.each(this._regions,function(e){e.template(null)}),this},p.prototype.beginRendering=function(e){var n=this;if(this._finishRenderingTransaction&&this._finishRenderingTransaction(),this._finishRenderingTransaction=s.once(function(){var t=n._endRendering({flush:!1});e&&e(t)}),u.afterFlush(this._finishRenderingTransaction),this._renderedRegions)throw new Error("You called beginRendering again before calling endRendering");this._renderedRegions={}},p.prototype._trackRenderedRegion=function(e){this._renderedRegions&&(this._renderedRegions[e]=!0)},p.prototype._endRendering=function(e){e=e||{},e.flush!==!1&&u.flush();var n=this._renderedRegions||{};return this._renderedRegions=null,s.keys(n)},s.each(["onRegionCreated","onRegionRendered","onRegionDestroyed"],function(e){p.prototype[e]=function(n){var t=this._regionHooks[e]=this._regionHooks[e]||[];return t.push(n),this}}),p.prototype._ensureRegion=function(e,n){return this._regions[e]=this._regions[e]||this._createDynamicTemplate(e,n)},p.prototype._createDynamicTemplate=function(e,n){var t=this,r=new h.DynamicTemplate(n),o=h.utils.capitalize;return r._region=e,s.each(["viewCreated","viewReady","viewDestroyed"],function(e){e=o(e),r["on"+e](function(n){var r=this,o={viewCreated:"regionCreated",viewReady:"regionRendered",viewDestroyed:"regionDestroyed"}[e];t._runRegionHooks("on"+o,r,n)})}),r},p.prototype._runRegionHooks=function(e,n,t){for(var r=this,o=this._regionHooks[e]||[],i,a=0;a<o.length;a++)i=o[a],i.call(n,t.region,t,this)},"undefined"!=typeof r&&(i.registerHelper("yield",new r("yield",function(){var n=d(this);if(!n)throw new Error("No Iron.Layout found so you can't use yield!");var t=e.getInclusionArguments(this),r,o;return s.isString(t)?r=t:s.isObject(t)&&(r=t.region),r=r||m,o=n.region(r),o.isCreated&&o.destroy(),o.create()})),i.registerHelper("contentFor",new r("contentFor",function(){var n=d(this);if(!n)throw new Error("No Iron.Layout found so you can't use contentFor!");var t=e.getInclusionArguments(this)||{},r=this.templateContentBlock,o=t.template,i=t.data,a;if(s.isString(t))a=t;else{if(!s.isObject(t))throw new Error("Which region is this contentFor block supposed to be for?");a=t.region}return n.region(a).template(o||r),n._trackRenderedRegion(a),i&&n.region(a).data(i),null})),i.registerHelper("hasRegion",function(e){var n=d(o.getView());if(!n)throw new Error("No Iron.Layout found so you can't use hasRegion!");if(!s.isString(e))throw new Error("You need to provide an region argument to hasRegion");return!!n.region(e).template()}),i.registerHelper("Layout",new r("layout",function(){var e=h.DynamicTemplate.args(this),n=new p({template:function(){return e("template")},data:function(){return e("data")},content:this.templateContentBlock});return n.create()}))),h.Layout=p}.call(this),"undefined"==typeof Package&&(Package={}),Package["iron:layout"]={}}();
!function(){var e=Package.meteor.Meteor,r=Package.meteor.global,t=Package.meteor.meteorEnv,n=Package.underscore._,i=Package["iron:core"].Iron,o,a;(function(){function e(e){return e.replace(/([=!:$\/()])/g,"\\$1")}function r(o,a,s){a&&"[object Array]"!==t(a)&&(s=a,a=null),a=a||[],s=s||{};var c=s.strict,u=s.end!==!1,p=s.sensitive?"":"i",l=0;if(o instanceof RegExp){var h=o.source.match(/\((?!\?)/g)||[];return a.push.apply(a,h.map(function(e,r){return{name:r,delimiter:null,optional:!1,repeat:!1}})),i(o,a)}if("[object Array]"===t(o))return o=o.map(function(e){return r(e,a,s).source}),i(new RegExp("(?:"+o.join("|")+")",p),a);o=o.replace(n,function(r,t,n,i,o,s,c,u){if(t)return t;if(u)return"\\"+u;var p="+"===c||"*"===c,h="?"===c||"*"===c;return a.push({name:i||l++,delimiter:n||"/",optional:h,repeat:p}),n=n?"\\"+n:"",o=e(o||s||"[^"+(n||"\\/")+"]+?"),p&&(o=o+"(?:"+n+o+")*"),h?"(?:"+n+"("+o+"))?":n+"("+o+")"});var f="/"===o[o.length-1];return c||(o=(f?o.slice(0,-2):o)+"(?:\\/(?=$))?"),u||(o+=c&&f?"":"(?=\\/|$)"),i(new RegExp("^"+o+(u?"$":""),p),a)}var t=function(e){return Object.prototype.toString.call(e)},n=new RegExp(["(\\\\.)","([\\/.])?(?:\\:(\\w+)(?:\\(((?:\\\\.|[^)])*)\\))?|\\(((?:\\\\.|[^)])*)\\))([+*?])?","([.+*?=^!:${}()[\\]|\\/])"].join("|"),"g"),i=function(e,r){return e.keys=r,e};o=r}).call(this),function(){function e(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(r){return void(r.constructor==URIError&&t("Tried to decode an invalid URI component: "+JSON.stringify(e)+" "+r.stack))}}function r(e){try{return decodeURI(e.replace(/\+/g," "))}catch(r){return void(r.constructor==URIError&&t("Tried to decode an invalid URI: "+JSON.stringify(e)+" "+r.stack))}}var t=i.utils.warn;a=function(e,r){r=r||{},this.options=r,this.keys=[],this.regexp=o(e,this.keys,r),this._originalPath=e,n.extend(this,a.parse(e))},a.normalize=function(e){if(e instanceof RegExp)return e;if("string"!=typeof e)return"/";var r=a.parse(e),t=r.pathname;return"/"!==t.charAt(0)&&(t="/"+t),t.length>1&&"/"===t.charAt(t.length-1)&&(t=t.slice(0,t.length-1)),t},a.isSameOrigin=function(e,r){var t=a.parse(e),n=a.parse(r),i=t.origin===n.origin;return i},a.fromQueryString=function(r){if(!r)return{};if("string"!=typeof r)throw new Error("expected string");"?"===r.charAt(0)&&(r=r.slice(1));var t=r.split("&"),i={},o;return n.each(t,function(r){var t=r.split("="),n=t[0],o=e(t[1]);"[]"===n.slice(-2)?(n=n.slice(0,-2),i[n]=i[n]||[],i[n].push(o)):i[n]=o}),i},a.toQueryString=function(e){var r=[];return"string"==typeof e?"?"!==e.charAt(0)?"?"+e:e:(n.each(e,function(e,t){n.isArray(e)?n.each(e,function(e){r.push(encodeURIComponent(t)+"[]="+encodeURIComponent(e))}):r.push(encodeURIComponent(t)+"="+encodeURIComponent(e))}),r.length>0?"?"+r.join("&"):"")},a.parse=function(e){if("string"!=typeof e)return{};var r=/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,t=e.match(r),n=t[1]?t[1].toLowerCase():void 0,i=t[3],o=!!i,s=t[4]?t[4].toLowerCase():void 0,c=s?s.split("@"):[],u,p;2==c.length?(p=c[0],u=c[1]):1==c.length?(u=c[0],p=void 0):(u=void 0,p=void 0);var l=u&&u.split(":")||[],h=l[0],f=l[1],g=n&&u?n+"//"+u:void 0,d=t[5],m=t[8],y=e,v=t[6],w,R=m&&m.indexOf("?")||-1;~R&&!v?(v=m.slice(R),m=m.substr(0,R),w=v.slice(1)):w=t[7];var x=d+(v||""),U=a.fromQueryString(w),S=[n||"",o?"//":"",s||""].join(""),k=[n||"",o?"//":"",s||"",d||"",v||"",m||""].join("");return{rootUrl:S||"",originalUrl:e||"",href:k||"",protocol:n||"",auth:p||"",host:u||"",hostname:h||"",port:f||"",origin:g||"",path:x||"",pathname:d||"",search:v||"",query:w||"",queryObject:U||"",hash:m||"",slashes:o}},a.prototype.test=function(e){return this.regexp.test(a.normalize(e))},a.prototype.exec=function(e){return this.regexp.exec(a.normalize(e))},a.prototype.params=function(t){if(!t)return[];var n=[],i=this.exec(t),o,s=this.keys,c,u;if(!i)throw new Error('The route named "'+this.name+'" does not match the path "'+t+'"');for(var p=1,l=i.length;p<l;++p)c=s[p-1],u="string"==typeof i[p]?e(i[p]):i[p],c?n[c.name]=void 0!==n[c.name]?n[c.name]:u:n.push(u);return t=r(t),"undefined"!=typeof t&&(o=t.split("?")[1],o&&(o=o.split("#")[0]),n.hash=t.split("#")[1]||null,n.query=a.fromQueryString(o)),n},a.prototype.resolve=function(e,r){var t,i,o,s=0,c=this._originalPath,u,p,l=[],h=e;if(r=r||{},e=e||[],p=r.query,u=r.hash&&r.hash.toString(),c instanceof RegExp)throw new Error("Cannot currently resolve a regular expression path");if(c=c.replace(/(\/)?(\.)?:(\w+)(?:(\(.*?\)))?(\?)?/g,function(r,o,a,s,c,u,p){if(o=o||"",a=a||"",t=e[s],i="undefined"!=typeof t,u&&!i)t="";else if(!i)return void l.push(s);t=n.isFunction(t)?t.call(e):t;var h=n.map(String(t).split("/"),function(e){return encodeURIComponent(e)}).join("/");return o+a+h}).replace(/\*/g,function(r){if("undefined"==typeof e[s])throw new Error("You are trying to access a wild card parameter at index "+s+" but the value of params at that index is undefined");var t=String(e[s++]);return n.map(t.split("/"),function(e){return encodeURIComponent(e)}).join("/")}),p=a.toQueryString(p),c+=p,u&&(u=encodeURI(u.replace("#","")),c=c+"#"+u),c=c.replace(/\/+/g,"/"),c=c.replace(/^(.+)\/$/g,"$1"),0==l.length)return c;if(r.throwOnMissingParams===!0)throw new Error("Missing required parameters on path "+JSON.stringify(this._originalPath)+". The missing params are: "+JSON.stringify(l)+". The params object passed in was: "+JSON.stringify(h)+".");return null},i.Url=a}.call(this),"undefined"==typeof Package&&(Package={}),Package["iron:url"]={}}();
!function(){var t=Package.meteor.Meteor,e=Package.meteor.global,n=Package.meteor.meteorEnv,r=Package.underscore._,i=Package.ejson.EJSON,o=Package["iron:core"].Iron,a,s;(function(){var t=o.Url;a=function(e,n,i){r.isFunction(e)&&(i=i||n||{},n=e,e="/",this.middleware=!0,"undefined"==typeof i.mount&&(i.mount=!0)),"object"==typeof n&&(i=n,n=i.action||"action"),i=i||{},this.options=i,this.mount=i.mount,this.method=i.method&&i.method.toLowerCase()||!1,this.where=i.where||"client",this.mount&&(i.end=!1),i.name?this.name=i.name:"string"==typeof e&&"/"!==e.charAt(0)?this.name=e:"string"==typeof e&&"/"!==e&&(this.name=e.split("/").slice(1).join(".")),e=i.path||e,"string"==typeof e&&"/"!==e.charAt(0)&&(e="/"+e),this.path=e,this.compiledUrl=new t(e,i),r.isString(n)?this.handle=function t(){var e=this[n];if("function"!=typeof e)throw new Error("No method named "+JSON.stringify(n)+" found on handler.");return e.apply(this,arguments)}:r.isFunction(n)&&(this.handle=n)},a.prototype.test=function(t,e){e=e||{};var n=this.compiledUrl.test(t),r=!0,i=!0;return this.method&&e.method&&(r=this.method==e.method.toLowerCase()),e.where&&(i=this.where==e.where),n&&r&&i},a.prototype.params=function(t){return this.compiledUrl.params(t)},a.prototype.resolve=function(t,e){return this.compiledUrl.resolve(t,e)},a.prototype.clone=function(){var t=new a(this.path,this.handle,this.options);return t.name=this.name,t}}).call(this),function(){var e=o.Url,n=o.utils.assert,h=o.utils.defaultValue;s=function(){this._stack=[],this.length=0},s.prototype._create=function(t,e,n){var i=new a(t,e,n),o=i.name;if(o){if(r.has(this._stack,o))throw new Error("Handler with name '"+o+"' already exists.");this._stack[o]=i}return i},s.prototype.findByName=function(t){return this._stack[t]},s.prototype.push=function(t,e,n){var r=this._create(t,e,n);return this._stack.push(r),this.length++,r},s.prototype.append=function(){var t=this,e=r.toArray(arguments),n={};return"object"==typeof e[e.length-1]&&(n=e.pop()),r.each(e,function(e){if("undefined"!=typeof e)if("function"==typeof e)t.push(e,n);else{if(!r.isArray(e))throw new Error("Can only append functions or arrays to the MiddlewareStack");t.append.apply(t,e.concat([n]))}}),this},s.prototype.insertAt=function(t,e,n,r){var i=this._create(e,n,r);return this._stack.splice(t,0,i),this.length=this._stack.length,this},s.prototype.insertBefore=function(t,e,n,i){var o,a;if(!(o=this._stack[t]))throw new Error("Couldn't find a handler named '"+t+"' on the path stack");return a=r.indexOf(this._stack,o),this.insertAt(a,e,n,i),this},s.prototype.insertAfter=function(t,e,n,i){var o,a;if(!(o=this._stack[t]))throw new Error("Couldn't find a handler named '"+t+"' on the path stack");return a=r.indexOf(this._stack,o),this.insertAt(a+1,e,n,i),this},s.prototype.concat=function(){var t=new s,e=Array.prototype.concat,n=i.clone(this._stack),o=r.map(r.toArray(arguments),function(t){return i.clone(t._stack)});return t._stack=e.apply(n,o),t.length=t._stack.length,t},s.prototype.dispatch=function r(i,o,a){var s=this,l=i;n("string"==typeof i,"Requires url"),n("object"==typeof o,"Requires context object"),i=e.normalize(i||"/"),h(o,"request",{}),h(o,"response",{}),h(o,"originalUrl",i),h(o,"_method",o.method),h(o,"_handlersForEnv",{client:!1,server:!1}),h(o,"_handled",!1),h(o,"isHandled",function(){return o._handled}),h(o,"willBeHandledOnClient",function(){return o._handlersForEnv.client}),h(o,"willBeHandledOnServer",function(){return o._handlersForEnv.server});var c=function(){if(a)try{a.apply(this,arguments)}catch(t){throw t._punt=!0,t}},u=0,p=t.bindEnvironment(function n(r){var a=s._stack[u++];if(o.url=o.request.url=o.originalUrl,!a)return c.call(o,r);if(!a.test(i,{method:o._method}))return p(r);var h=t.isClient?"client":"server";if(a.middleware||(o._handlersForEnv[a.where]=!0),a.where!==h)return p(r);if(o.next=p,a.mount){var l=e.normalize(a.compiledUrl.pathname),d=i.substr(l.length,i.length);d=e.normalize(d),o.url=o.request.url=d}try{var f=a.handle.length,m=o.request,y=o.response;return r&&4===f?a.handle.call(o,r,m,y,p):!r&&f<4?a.handle.call(o,m,y,p):p(r)}catch(t){if(t._punt)throw t;p(t)}finally{o._handled=!0,o.next=null}});return p(),o.next=null,o},o=o||{},o.MiddlewareStack=s}.call(this),"undefined"==typeof Package&&(Package={}),function(t,e){for(var n in e)n in t||(t[n]=e[n])}(Package["iron:middleware-stack"]={},{Handler:a})}();
!function(){var t=Package.meteor.Meteor,e=Package.meteor.global,n=Package.meteor.meteorEnv,a=Package.underscore._,r=Package.tracker.Tracker,o=Package.tracker.Deps,i=Package.jquery.$,c=Package.jquery.jQuery,s=Package["iron:core"].Iron,h,u,l,f,p;(function(){var t=s.Url,e="__hash__";h=function(n){var a=t.parse(n),r=a.hash&&a.hash.replace("#",""),o=a.search,i=a.pathname,c=a.rootUrl;if(r&&"!"!==r.charAt(0)){var s=e+"="+r;o=o?o+"&":"?",o+=s,r=""}return!r&&i?r="#!"+i.substring(1):r&&(r="#"+r),[c,r,o].join("")},u=function(n){var r=t.parse(n),o=r.hash&&r.hash.replace("#!","/"),i=r.search,c=r.rootUrl,s;return a.has(r.queryObject,e)?(s="#"+r.queryObject[e],delete r.queryObject[e]):s="",[c,o,t.toQueryString(r.queryObject),s].join("")},l=function(n){var a=t.parse(n),r=a.queryObject;return a.hash&&(r[e]=a.hash.replace("#","")),["!",a.pathname.substring(1),t.toQueryString(r)].join("")}}).call(this),function(){var t=s.Url;f=function(e,n){a.extend(this,t.parse(e),{options:n||{}})},f.prototype.equals=function(t){return!!t&&(t instanceof f&&(t.pathname==this.pathname&&t.search==this.search&&t.hash==this.hash&&t.options.historyState===this.options.historyState))},f.prototype.isCancelled=function(){return!!this._isCancelled},f.prototype.cancelUrlChange=function(){this._isCancelled=!0}}.call(this),function(){var e=s.Url,n=null,r=new o.Dependency,c={go:[],popState:[]},g=function(){return/MSIE 9/.test(navigator.appVersion)},y=function(){return/MSIE 8/.test(navigator.appVersion)},d=function(){return!!Package.appcache},S=function(){return"undefined"==typeof history||"function"!=typeof history.pushState},v=function(){return p.options.useHashPaths||y()||g()||d()||S()},k=function(){return!!p.options.useHashPaths},w=function(t,e){a.each(c[t],function(t){t.call(e)})},P=function(t){if(!(t instanceof f))throw new Error("Expected a State instance");return!t.equals(n)&&(n=t,r.changed(),!0)},m=function(){var t=location.href,e;e=k()?new f(u(t)):new f(t,{historyState:history.state}),w("popState",e),P(e)},j=function(t){var e=q;e&&e(t)},_=function(t,e){e=e||{};var n=new f(t,e);w("go",n),P(n)&&o.afterFlush(function(){n.isCancelled()||(k()?location.hash=l(t):e.replaceState===!0?history.replaceState(e.historyState,null,t):history.pushState(e.historyState,null,t))})},q=function(t){try{var n=t.currentTarget,a=n.href,r=n.pathname+n.search+n.hash;if(r=r.replace(/(^\/?)/,"/"),t.isDefaultPrevented())return void t.preventDefault();if(t.metaKey||t.ctrlKey||t.shiftKey)return;if(n.target)return;if(!e.isSameOrigin(a,location.href))return;t.preventDefault(),_(r)}catch(e){throw t.preventDefault(),e}};p={},p.options={linkSelector:"a[href]",useHashPaths:!1},p.configure=function(t){a.extend(this.options,t||{})},p.get=function(){return r.depend(),n},p.start=function(){if(!this._isStarted){var n=e.parse(location.href);if(v()){if(n.pathname.length>1){var a=h(location.href);window.location=a}this.configure({useHashPaths:!0})}var r=location.href;if(k()){var o=new f(u(r));P(o)}else{if("!"===n.hash.replace("#","")[0])var r=u(r);var c={initial:!0};history.replaceState(c,null,r);var o=new f(r,{historyState:c});P(o)}i(window).on("popstate.iron-location",m),i(window).on("hashchange.iron-location",m),t.startup(function(){i(document).on("click.iron-location",p.options.linkSelector,j)}),this._isStarted=!0}},p.stop=function(){this._isStarted&&(i(window).on("popstate.iron-location"),i(window).on("hashchange.iron-location"),i(document).off("click.iron-location"),this._isStarted=!1)},p.onClick=function(t){q=t},p.go=function(t,e){return _(t,e)},p.onGo=function(t){c.go.push(t)},p.onPopState=function(t){c.popState.push(t)},p.start(),s.Location=p}.call(this),"undefined"==typeof Package&&(Package={}),function(t,e){for(var n in e)n in t||(t[n]=e[n])}(Package["iron:location"]={},{urlToHashStyle:h,urlFromHashStyle:u})}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,n=Package.meteor.meteorEnv,a=Package.underscore._,i=Package.tracker.Tracker,r=Package.tracker.Deps,c=Package.ejson.EJSON,s=Package.modules.meteorInstall,o=Package.modules.Buffer,u=Package.modules.process,d=Package["ecmascript-runtime"].Symbol,f=Package["ecmascript-runtime"].Map,l=Package["ecmascript-runtime"].Set,k=Package["babel-runtime"].meteorBabelHelpers,p=Package.promise.Promise,y,g=s({node_modules:{meteor:{"reactive-dict":{"reactive-dict.js":["babel-runtime/helpers/typeof",function(e,t,n){var r;n.import("babel-runtime/helpers/typeof",{default:function(e){r=e}});var s=function e(t){return void 0===t?"undefined":c.stringify(t)},o=function e(t){if(void 0!==t&&"undefined"!==t)return c.parse(t)},u=function e(t){t&&t.changed()};y=function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e){if(e)if("string"==typeof e)y._registerDictForMigrate(e,this),this.keys=y._loadMigratedDict(e)||{},this.name=e;else{if("object"!==("undefined"==typeof e?"undefined":r(e)))throw new Error("Invalid ReactiveDict argument: "+e);this.keys=e}else this.keys={};this.allDeps=new i.Dependency,this.keyDeps={},this.keyValueDeps={}}),a.extend(y.prototype,{set:function(){function e(e,t){var n=this;if("object"===("undefined"==typeof e?"undefined":r(e))&&void 0===t)return void n._setObject(e);var i=e;t=s(t);var c=a.has(n.keys,i),o=c?n.keys[i]:"undefined",d=t!==o;n.keys[i]=t,!d&&c||n.allDeps.changed(),d&&(u(n.keyDeps[i]),n.keyValueDeps[i]&&(u(n.keyValueDeps[i][o]),u(n.keyValueDeps[i][t])))}return e}(),setDefault:function(){function e(e,t){var n=this;if("object"===("undefined"==typeof e?"undefined":r(e))&&void 0===t)return void n._setDefaultObject(e);var i=e;a.has(n.keys,i)||n.set(i,t)}return e}(),get:function(){function e(e){var t=this;return t._ensureKey(e),t.keyDeps[e].depend(),o(t.keys[e])}return e}(),equals:function(){function e(e,t){var n=this,r=null;if(Package.mongo&&(r=Package.mongo.Mongo.ObjectID),!("string"==typeof t||"number"==typeof t||"boolean"==typeof t||"undefined"==typeof t||t instanceof Date||r&&t instanceof r||null===t))throw new Error("ReactiveDict.equals: value must be scalar");var u=s(t);if(i.active){n._ensureKey(e),a.has(n.keyValueDeps[e],u)||(n.keyValueDeps[e][u]=new i.Dependency);var d=n.keyValueDeps[e][u].depend();d&&i.onInvalidate(function(){n.keyValueDeps[e][u].hasDependents()||delete n.keyValueDeps[e][u]})}var f=void 0;return a.has(n.keys,e)&&(f=o(n.keys[e])),c.equals(f,t)}return e}(),all:function(){function e(){this.allDeps.depend();var e={};return a.each(this.keys,function(t,n){e[n]=o(t)}),e}return e}(),clear:function(){function e(){var e=this,t=e.keys;e.keys={},e.allDeps.changed(),a.each(t,function(t,n){u(e.keyDeps[n]),e.keyValueDeps[n]&&(u(e.keyValueDeps[n][t]),u(e.keyValueDeps[n].undefined))})}return e}(),delete:function(){function e(e){var t=this,n=!1;if(a.has(t.keys,e)){var i=t.keys[e];delete t.keys[e],u(t.keyDeps[e]),t.keyValueDeps[e]&&(u(t.keyValueDeps[e][i]),u(t.keyValueDeps[e].undefined)),t.allDeps.changed(),n=!0}return n}return e}(),_setObject:function(){function e(e){var t=this;a.each(e,function(e,n){t.set(n,e)})}return e}(),_setDefaultObject:function(){function e(e){var t=this;a.each(e,function(e,n){t.setDefault(n,e)})}return e}(),_ensureKey:function(){function e(e){var t=this;e in t.keyDeps||(t.keyDeps[e]=new i.Dependency,t.keyValueDeps[e]={})}return e}(),_getMigrationData:function(){function e(){return this.keys}return e}()})}],"migration.js":function(){if(y._migratedDictData={},y._dictsToMigrate={},y._loadMigratedDict=function(e){return a.has(y._migratedDictData,e)?y._migratedDictData[e]:null},y._registerDictForMigrate=function(e,t){if(a.has(y._dictsToMigrate,e))throw new Error("Duplicate ReactiveDict name: "+e);y._dictsToMigrate[e]=t},e.isClient&&Package.reload){var t=Package.reload.Reload._migrationData("reactive-dict");t&&t.dicts&&(y._migratedDictData=t.dicts),Package.reload.Reload._onMigrate("reactive-dict",function(){var e=y._dictsToMigrate,t={};for(var n in k.sanitizeForInObject(e))t[n]=e[n]._getMigrationData();return[!0,{dicts:t}]})}}}}}},{extensions:[".js",".json"]});g("./node_modules/meteor/reactive-dict/reactive-dict.js"),g("./node_modules/meteor/reactive-dict/migration.js"),"undefined"==typeof Package&&(Package={}),function(e,t){for(var n in t)n in e||(e[n]=t[n])}(Package["reactive-dict"]={},{ReactiveDict:y})}();
!function(){var t=Package.meteor.Meteor,e=Package.meteor.global,n=Package.meteor.meteorEnv,a=Package.underscore._,o=Package.tracker.Tracker,i=Package.tracker.Deps,r=Package["reactive-dict"].ReactiveDict,u=Package["templating-runtime"].Template,s=Package["iron:core"].Iron,c=Package.blaze.Blaze,l=Package.blaze.UI,p=Package.blaze.Handlebars,d=Package.spacebars.Spacebars,y=Package.htmljs.HTML,h,f;(function(){var t=s.utils.assert,e=function(){for(var t={},e=i.currentComputation;e;)t[String(e._id)]=!0,e=e._parent;return t},n=function(n){var o=e(),i=a.keys(n._dependentsById);a.each(i,function(e){t(!o[e],"\n\nYou called wait() after calling ready() inside the same computation tree.\n\nYou can fix this problem in two possible ways:\n\n1) Put all of your wait() calls before any ready() calls.\n2) Put your ready() call in its own computation with Deps.autorun.")})};h=function(){this._readyDep=new i.Dependency,this._comps=[],this._notReadyCount=0},h.prototype.wait=function(t){var e=this,o=i.currentComputation;n(e._readyDep),i.nonreactive(function(){var n=null,r=i.autorun(function(a){var o=!!t(),i=e._notReadyCount;a.firstRun&&!o?e._notReadyCount++:null!==n&&o!==n&&o===!0?e._notReadyCount--:null!==n&&o!==n&&o===!1&&e._notReadyCount++,n=o,0===i&&e._notReadyCount>0?e._readyDep.changed():i>0&&0===e._notReadyCount&&e._readyDep.changed()});e._comps.push(r),o&&o.onInvalidate(function(){i.afterFlush(function(){r.stop(),e._comps.splice(a.indexOf(e._comps,r),1),n===!1&&(e._notReadyCount--,0===e._notReadyCount&&e._readyDep.changed())})})})},h.prototype.ready=function(){return this._readyDep.depend(),0===this._notReadyCount},h.prototype.stop=function(){a.each(this._comps,function(t){t.stop()}),this._comps=[]},s.WaitList=h}).call(this),function(){var t=s.utils.debug("iron:controller"),e=s.Layout,n=s.DynamicTemplate,o=function(t,e){return function(){return"function"==typeof t?t.apply(e,arguments):t}};f=function(t){var n=this;this.options=t||{},this._layout=this.options.layout||new e(this.options),this._isController=!0,this._layout._setLookupHost(this);var a=f._collectEventMaps.call(this.constructor);this._layout.events(a,this),this.init(t)},f.prototype.layout=function(t,e){var n=this;return this._layout.template(t),e&&a.has(e,"data")&&this._layout.data(o(e.data,this)),{data:function(t){return n._layout.data(o(t,n))}}},f.prototype.render=function(t,e){var n=this;e&&"undefined"!=typeof e.data&&(e.data=o(e.data,this));var a=this._layout.render(t,e);return{data:function(t){return a.data(o(t,n))}}},f.prototype.beginRendering=function(t){return this._layout.beginRendering(t)},f.extend=function(t){return s.utils.extend(this,t)},f.events=function(t){return this._eventMap=t,this};var i=function(t,e){var n={};return t.__super__&&a.extend(n,i(t.__super__.constructor,e)),a.has(t,e)?a.extend(n,t[e]):n};f._collectEventMaps=function(){return i(this,"_eventMap")},f._helpers={},f.helpers=function(t){return a.extend(this._helpers,t),this},"undefined"!=typeof u&&(s.controller=function(){return n.findLookupHostWithProperty(c.getView(),"_isController")},u.registerHelper("get",function(t){var e=s.controller();if(e&&e.state)return e.state.get(t)})),s.Controller=f}.call(this),function(){var t=s.Layout,e=s.utils.debug("iron:controller"),n=s.utils.defaultValue,o=function(t,e){return function(){return"function"==typeof t?t.apply(e,arguments):t}};f.prototype.init=function(t){this._waitlist=new h,this.state=new r},f.prototype.insert=function(t){return this._layout.insert.apply(this._layout,arguments)},f.prototype.wait=function(t){var e=this;if(t)return a.isArray(t)?a.each(t,function t(n){e.wait(n)}):t.ready?this._waitlist.wait(function(){return t.ready()}):this._waitlist.wait(t),this},f.prototype.ready=function(){return this._waitlist.ready()},f.prototype.stop=function(){this._waitlist.stop()}}.call(this),"undefined"==typeof Package&&(Package={}),Package["iron:controller"]={}}();
!function(){var t=Package.underscore._,o=Package.tracker.Tracker,e=Package.tracker.Deps,r=Package.blaze.Blaze,n=Package.blaze.UI,i=Package.blaze.Handlebars,a=Package["templating-runtime"].Template,u=Package.ejson.EJSON,s=Package.meteor.Meteor,l=Package.meteor.global,c=Package.meteor.meteorEnv,p=Package["iron:core"].Iron,h=Package.htmljs.HTML,f=Package.spacebars.Spacebars,d,y,_,m,g;(function(){d=new s.EnvironmentVariable}).call(this),function(){y=["get","post","put","delete","patch"]}.call(this),function(){var o=p.Controller,e=p.Url,r=p.MiddlewareStack,n=p.utils.assert;_=o.extend({constructor:function(o){_.__super__.constructor.apply(this,arguments),o=o||{},this.options=o,this._onStopCallbacks=[],this.route=o.route,this.params=[];var e=this.lookupOption("data");"function"==typeof e?this.data=t.bind(e,this):"undefined"!=typeof e&&(this.data=function(){return e}),this.init(o)}}),_.prototype.lookupOption=function(o){if(this.route&&this.route.options&&t.has(this.route.options,o))return this.route.options[o];if(t.has(this.options,o))return this.options[o];if("undefined"!=typeof this[o])return this[o];var e=d.get();return e&&t.has(e,o)?e[o]:this.router&&this.router.options&&t.has(this.router.options,o)?this.router.options[o]:void 0},_.prototype.configureFromUrl=function(t,o,e){n("string"==typeof t,"url must be a string"),o=o||{},this.request=o.request||{},this.response=o.response||{},this.url=o.url||t,this.originalUrl=o.originalUrl||t,this.method=this.request.method,this.route&&this.setParams(this.route.params(t),e)},_.prototype._collectHooks=function(){var o=this,e=t.toArray(arguments),r=function(e){if(!e)return[];var r=o.router.lookupHook,n=t.isArray(e)?e:[e];return t.map(n,function(t){return r(t)})},n=function(o,e){var i=[];return o.__super__&&(i=i.concat(n(o.__super__.constructor,e))),t.has(o.prototype,e)?i.concat(r(o.prototype[e])):i},i=function(t){for(var o=0;o<e.length;o++)t(e[o])},a=[];i(function(t){var e=o.route&&o.route.getName(),r=o.router.getHooks(t,e);a=a.concat(r)});var u=[];i(function(t){var e=n(o.constructor,t);u=u.concat(e)});var s=[];i(function(e){if(t.has(o,e)){var n=r(o[e]);s=s.concat(n)}});var l=[];o.route&&i(function(t){var e=r(o.route.options[t]);l=l.concat(e)});var c=a.concat(l).concat(u).concat(s);return c},_.prototype.runHooks=function(){for(var t=this._collectHooks.apply(this,arguments),o=0,e=t.length;o<e;o++){var r=t[o];r.call(this)}return t.length},_.prototype.getParams=function(){return this.params},_.prototype.setParams=function(t){return this.params=t,this},p.RouteController=_}.call(this),function(){var r=p.Controller,n=p.Url,i=p.MiddlewareStack,a=p.utils.debug("iron-router:RouteController");if(_.prototype.init=function(t){_.__super__.init.apply(this,arguments),this._computation=null,this._paramsDep=new o.Dependency,this.location=p.Location},_.prototype.getParams=function(){return this._paramsDep.depend(),this.params},_.prototype.setParams=function(o,e){var r=function(o,r){if(!(o instanceof Array))throw new Error("you called equals with a non array value in setParams");if(!(r instanceof Array))return!1;if(o.length!==r.length)return!1;for(var n=0;n<o.length;n++)if(!u.equals(o[n],r[n],e))return!1;var i=t.keys(o),a=t.keys(r),s;if(i.length!==a.length)return!1;for(var n=0;n<i.length;n++){if(s=i[n],!t.has(r,s))return!1;if(!u.equals(o[s],r[s]))return!1}return!0};if(!r(this.params,o))return this.params=o,e=e||{},e.reactive!==!1&&this._paramsDep.changed(),this},_.prototype.dispatch=function(t,o,r){if(this._computation&&!this._computation.stopped)throw new Error("RouteController computation is already running. Stop it first.");var n=this;return e.nonreactive(function(){e.autorun(function(e){n._computation=e,t.dispatch(o,n,r)})}),n},_.prototype._runRoute=function(o,r,n){var a=this,u=this._collectHooks("subscriptions");t.each(u,function(t){a.wait(t.call(a))});var s=this._collectHooks("waitOn");t.each(s,function(t){a.wait(t.call(a))});var l=s.length>0,c,h,f=function(){return e.nonreactive(function(){return a._layout.template()})},d=function(){return e.nonreactive(function(){var t=a._layout._regions.main;return t&&t.template()})},y=f(),m=d();this.beginRendering(function o(e){if(!a.isStopped){var r=f(),n=d();if(y!==r||m!=n){var i=a._layout.regionKeys(),u=t.difference(i,e);t.each(u,function(t){a._layout.clear(t)})}}}),this.layout(this.lookupOption("layoutTemplate"),{data:this.lookupOption("data")});var g=new i,v=new i,k=new i;v.append(this._collectHooks("onRun","load"),{where:"client"}),k.append(this._collectHooks("onRerun"),{where:"client"}),g.append(function t(o,e,r){this._computation.firstRun&&!_._hasJustReloaded&&v.length>0?v.dispatch(o.url,this,r):r(),_._hasJustReloaded=!1},function t(o,e,r){this._computation.firstRun?r():k.length>0?k.dispatch(o.url,this,r):r()},{where:"client"}),l&&g.push(t.bind(p.Router.hooks.loading,a));var w=this._collectHooks("onBeforeAction","before");g.append(w,{where:"client"}),0===o._actionStack.length&&o._actionStack.push(o._path,"action",o.options),g=g.concat(o._actionStack),this._rendered=!1,g.dispatch(r,this,n),e.afterFlush(function(){p.utils.warn(a._rendered||a.isStopped,"Route dispatch never rendered. Did you forget to call this.next() in an onBeforeAction?")}),this.runHooks("onAfterAction","after")},_.prototype.action=function(){this.render()},_.prototype.lookupTemplate=function(){return this.lookupOption("template")||this.router&&this.router.toTemplateName(this.route.getName())},_.prototype.lookupRegionTemplates=function(){return this.lookupOption("yieldRegions")||this.lookupOption("regionTemplates")||this.lookupOption("yieldTemplates")||{}},_.prototype.render=function(t,o){if(this._rendered=!0,0===arguments.length){var t=this.lookupTemplate(),e=_.__super__.render.call(this,t);return this.renderRegions(),e}return _.__super__.render.call(this,t,o)},_.prototype.renderRegions=function(){var o=this,e=this.lookupRegionTemplates();a("regionTemplates: "+JSON.stringify(e)),t.each(e,function(t,e){o.render(e,t)})},_.prototype.stop=function(){_.__super__.stop.call(this),this._computation&&this._computation.stop(),this.runHooks("onStop","unload"),this.isStopped=!0},_.prototype.redirect=function(){return this.router.go.apply(this.router,arguments)},_.prototype.subscribe=function(){var o=this,e=s.subscribe.apply(this,arguments);return t.extend(e,{wait:function(){o.wait(this)}})},Package.reload){Package.reload.Reload._onMigrate("iron-router",function(){return[!0,!0]});var l=Package.reload.Reload._migrationData("iron-router");_._hasJustReloaded=l}}.call(this),function(){var o=p.Url,e=p.MiddlewareStack,r=p.utils.assert;m=function(o,r,n){var i=function(t,o,e){var r=this;r.request=t,r.response=o,i.dispatch(t.url,r,e)};return"object"==typeof r&&(n=r,r=n.action),n=n||{},"string"==typeof o&&"/"!==o.charAt(0)&&(o=n.path?n.path:"/"+o),t.extend(i,this.constructor.prototype),n=i.options=n||{},i._actionStack=new e,i._beforeStack=new e,i._beforeStack.append(i.options.onBeforeAction),i._beforeStack.append(i.options.before),i._afterStack=new e,i._afterStack.append(i.options.onAfterAction),i._afterStack.append(i.options.after),i._methods={},"string"==typeof r?i._actionStack.push(o,t.extend(n,{template:r})):"function"!=typeof r&&"object"!=typeof r||i._actionStack.push(o,r,n),i._path=o,i},m.prototype.getName=function(){return this.handler&&this.handler.name},m.prototype.findControllerConstructor=function(){var t=this,o=function(t,o){o=o||{};var e=p.utils.resolve(t);if(e&&_.prototype.isPrototypeOf(e.prototype))return e;if(o.supressErrors!==!0)throw new Error("RouteController '"+t+"' is not defined.")},e=function(o){return t.router.toControllerName(o)},r,n=this.getName();return"function"==typeof this.options.controller?this.options.controller:"string"==typeof this.options.controller?o(this.options.controller):this.router&&this.router.options.controller?"function"==typeof this.router.options.controller?this.router.options.controller:"string"==typeof this.router.options.controller?o(this.router.options.controller):void 0:n&&(r=o(e(n),{supressErrors:!0}))?r:_},m.prototype.createController=function(t){t=t||{};var o=this.findControllerConstructor();t.route=this;var e=new o(t);return e},m.prototype.setControllerParams=function(t,o){},m.prototype.dispatch=function(t,o,e){return r(o._runRoute,"context doesn't have a _runRoute method"),o._runRoute(this,t,e)},m.prototype.path=function(t,o){return this.handler.resolve(t,o)},m.prototype.url=function(t,o){var e=this.path(t,o),r=o&&o.host||s.absoluteUrl();return"/"===r.charAt(r.length-1)&&(r=r.slice(0,r.length-1)),r+e},m.prototype.params=function(t){return this.handler.params(t)},t.each(y,function(t){m.prototype[t]=function(o){return this._methods[t]=!0,this._actionStack.push(this._path,o,{name:this.getName()+"_"+t.toLowerCase(),method:t,where:this.handler.where,mount:!1}),this}}),p.Route=m}.call(this),function(){var o=p.MiddlewareStack,e=p.Url,r=p.Layout,n=p.utils.warn,i=p.utils.assert;g=function(e){function r(t,o,e){r.dispatch(t.url,{request:t,response:o},e)}return r._stack=new o,r._globalHooks={},r.routes=[],r.routes._byPath={},this.configure.call(r,e),t.extend(r,this.constructor.prototype),this.init.call(r,e),s.startup(function(){s.defer(function(){r.options.autoStart!==!1&&r.start()})}),r},g.prototype.init=function(t){},g.prototype.configure=function(o){var e=this;o=o||{};var r=function(o){return o?t.isArray(o)?o:[o]:[]};return t.each(p.Router.HOOK_TYPES,function n(i){o[i]&&(t.each(r(o[i]),function t(o){e.addHook(i,o)}),delete o[i])}),this.options=this.options||{},t.extend(this.options,o),this},g.prototype.map=function(t){return t.call(this)},g.prototype.route=function(t,o,e){var r=function(t){return Object.prototype.toString.call(t)};i("[object String]"===r(t)||"[object RegExp]"===r(t),"Router.route requires a path that is a string or regular expression."),"object"==typeof o&&(e=o,o=e.action);var n=new m(t,o,e);e=e||{},e.mount=!1;var a=this._stack.push(t,n,e);return a.route=n,n.handler=a,n.router=this,i(!this.routes._byPath[a.path],"A route for the path "+JSON.stringify(a.path)+" already exists by the name of "+JSON.stringify(a.name)+"."),this.routes._byPath[a.path]=n,this.routes.push(n),"string"==typeof a.name&&(this.routes[a.name]=n),n},g.prototype.findFirstRoute=function(t){for(var o,e,r=0;r<this.routes.length;r++)if(e=this.routes[r],o=e.handler.test(t,{where:s.isServer?"server":"client"}))return e;return null},g.prototype.path=function(t,o,e){var r=this.routes[t];return n(r,"You called Router.path for a route named "+JSON.stringify(t)+" but that route doesn't seem to exist. Are you sure you created it?"),r&&r.path(o,e)},g.prototype.url=function(t,o,e){var r=this.routes[t];return n(r,"You called Router.url for a route named "+JSON.stringify(t)+" but that route doesn't seem to exist. Are you sure you created it?"),r&&r.url(o,e)},g.prototype.createController=function(t,o){var e=this.findFirstRoute(t),r;return o=o||{},r=e?e.createController({layout:this._layout}):new _({layout:this._layout}),r.router=this,r.configureFromUrl(t,o,{reactive:!1}),r},g.prototype.setTemplateNameConverter=function(t){return this._templateNameConverter=t,this},g.prototype.setControllerNameConverter=function(t){return this._controllerNameConverter=t,this},g.prototype.toTemplateName=function(t){return this._templateNameConverter?this._templateNameConverter(t):p.utils.classCase(t)},g.prototype.toControllerName=function(t){return this._controllerNameConverter?this._controllerNameConverter(t):p.utils.classCase(t)+"Controller"},g.prototype.addHook=function(o,e,r){var n=this;r=r||{};var i=function(o){return o?t.isArray(o)?o:[o]:[]};r.only&&(r.only=i(r.only)),r.except&&(r.except=i(r.except));var a=this._globalHooks[o]=this._globalHooks[o]||[],u=function(){var t=this,o=arguments;return d.withValue(r,function(){return n.lookupHook(e).apply(t,o)})};return a.push({options:r,hook:u}),this},g.prototype.lookupHook=function(o){var e=o;if(t.isFunction(e))return e;if(t.isString(e)&&t.isFunction(p.Router.hooks[e]))return p.Router.hooks[e];throw new Error("No hook found named: "+o)},g.prototype.getHooks=function(o,e){var r=this,n=[];return t.each(this._globalHooks[o],function(o){var r=o.options;return r.except&&t.include(r.except,e)?[]:r.only&&!t.include(r.only,e)?[]:void n.push(o.hook)}),n},g.HOOK_TYPES=["onRun","onRerun","onBeforeAction","onAfterAction","onStop","waitOn","subscriptions","load","before","after","unload"],g.hooks={},g.plugins={},t.each(g.HOOK_TYPES,function(t){g.prototype[t]=function(o,e){this.addHook(t,o,e)}}),g.prototype.plugin=function(t,o){var e;if("function"==typeof t?e=t:"string"==typeof t&&(e=p.Router.plugins[t]),!e)throw new Error("No plugin found named "+JSON.stringify(t));return e.call(this,this,o),this},p.Router=g}.call(this),function(){if("undefined"!=typeof a)var t=new a("DefaultLoadingTemplate",function(){return"Loading..."}),o=new a("DefaultDataNotFoundTemplate",function(){return"Data not found..."});g.hooks.loading=function(){if(this.ready())return void this.next();var o=this.lookupOption("loadingTemplate");this.render(o||t),this.renderRegions()},g.hooks.dataNotFound=function(){if(!this.ready())return void this.next();var t=this.lookupOption("data"),e,r=this.lookupOption("notFoundTemplate");return"function"!=typeof t||(e=t.call(this))?void this.next():(this.render(r||o),void this.renderRegions())}}.call(this),function(){var o=p.utils.warn,e=p.DynamicTemplate,i=p.utils.debug("iron:router <helpers>");n.registerHelper("Router",new r.Template("Router",function(){return g.createView()})),n.registerHelper("pathFor",function(e){var r;arguments.length>1&&(r=arguments[0],e=arguments[1]||{});var n=e&&e.hash;n=n||{};var i="",a=n.query,s=n.hash,r=r||n.route,l=t.extend({},n.data||this),c=g.routes[r];return o(c,"pathFor couldn't find a route named "+JSON.stringify(r)),c&&(t.each(c.handler.compiledUrl.keys,function(o){var e=o.name;t.has(n,e)&&(l[e]=u.clone(n[e]),delete n[e])}),i=c.path(l,{query:a,hash:s})),i}),n.registerHelper("urlFor",function(e){var r;arguments.length>1&&(r=arguments[0],e=arguments[1]||{});var n=e&&e.hash;n=n||{};var i="",a=n.query,s=n.hash,r=r||n.route,l=t.extend({},n.data||this),c=g.routes[r];return o(c,"urlFor couldn't find a route named "+JSON.stringify(r)),c&&(t.each(c.handler.compiledUrl.keys,function(o){var e=o.name;t.has(n,e)&&(l[e]=u.clone(n[e]),delete n[e])}),i=c.url(l,{query:a,hash:s})),i}),n.registerHelper("linkTo",new r.Template("linkTo",function(){var n=this,i=e.getInclusionArguments(this);if("object"!=typeof i)throw new Error("linkTo options must be key value pairs such as {{#linkTo route='my.route.name'}}. You passed: "+JSON.stringify(i));i=i||{};var a="",s=i.query,l=i.hash,c=i.route,p=t.extend({},i.data||e.getParentDataContext(this)),f=g.routes[c],d;o(f,"linkTo couldn't find a route named "+JSON.stringify(c)),f&&(t.each(f.handler.compiledUrl.keys,function(o){var e=o.name;t.has(i,e)&&(p[e]=u.clone(i[e]),delete i[e])}),a=f.path(p,{query:s,hash:l}));var y=t.omit(i,"route","query","hash","data");return y.href=a,r.With(function(){return e.getParentDataContext(n)},function(){return h.A(y,n.templateContentBlock)})}))}.call(this),function(){var o=p.MiddlewareStack,r=p.Url,n=p.Layout,i=p.utils.assert,a="__IronRouterNotFound__",u="__IronRouterNoRoutes__";g.prototype.init=function(t){var o=this;o._currentController=null,o._currentRoute=null,o._currentDep=new e.Dependency,o._locationComputation=null,o._layout=new n({template:o.options.layoutTemplate}),s.startup(function(){setTimeout(function t(){o.options.autoRender!==!1&&o.insert({el:document.body})})})},g.prototype.insert=function(t){return this._layout.insert(t),this},g.prototype.createView=function(){return this._layout.create()},g.prototype.lookupNotFoundTemplate=function(){return this.options.notFoundTemplate?this.options.notFoundTemplate:0===this.routes.length?u:a},g.prototype.lookupLayoutTemplate=function(){return this.options.layoutTemplate},g.prototype.dispatch=function(t,o,r){var n=this;i("string"==typeof t,"expected url string in router dispatch");var s=this._currentController,l=this.findFirstRoute(t),c=this._currentRoute;return this._currentRoute=l,this._currentController&&this._currentController.stop(),s&&l&&c===l?s.configureFromUrl(t,o):s=this.createController(t,o),this._currentController=s,s.dispatch(n._stack,t,function t(o){if(o)throw o;if(!s.isHandled()){var i=e.nonreactive(function(){return s.location.get().options.historyState});if(i&&i.initial===!0){this.layout(this.lookupOption("layoutTemplate"),{data:{url:this.url}});var l=this.lookupOption("notFoundTemplate");l||(l=0===n.routes.length?u:a),this.render(l,{data:{url:this.url}}),this.renderRegions(),s.isHandled=function(){return!0}}return r&&r.call(s)}}),this._currentController==s&&this._currentDep.changed(),s},g.prototype.current=function(){return this._currentDep.depend(),this._currentController},g.prototype._scrollToHash=function(t){try{var o=$(t);$("html, body").scrollTop(o.offset().top)}catch(t){}},g.prototype.start=function(){var t=this,o;t._locationComputation=e.autorun(function e(r){var n,i=p.Location.get(),a,u,s,l=t._currentController;!l||o&&o.path!==i.path?n=t.dispatch(i.href,null,function t(o){this.isHandled()||(i.cancelUrlChange(),window.location=i.path)}):(t._scrollToHash(i.hash),l.configureFromUrl(i.href)),o=i})},g.prototype.stop=function(){this._isStarted&&(this._locationComputation&&this._locationComputation.stop(),this._currentController&&this._currentController.stop(),this._isStarted=!1)},g.prototype.go=function(o,e,r){var n=this,a=/^\/|http/,u;if(r=r||{},a.test(o))u=o;else{var s=n.routes[o];i(s,"No route found named "+JSON.stringify(o)),u=s.path(e,t.extend(r,{throwOnMissingParams:!0}))}p.Location.go(u,r)}}.call(this),function(){g.plugins.loading=function(t,o){t.onBeforeAction("loading",o)},g.plugins.dataNotFound=function(t,o){t.onBeforeAction("dataNotFound",o)}}.call(this),function(){g=new p.Router}.call(this),function(){a.__checkName("__IronRouterNotFound__"),a.__IronRouterNotFound__=new a("Template.__IronRouterNotFound__",function(){var t=this;return h.DIV({style:"width: 600px; margin: 0 auto; padding: 20px;"},"\n ",h.DIV({style:"font-size: 18pt; color: #999;"},"\n Oops, looks like there's no route on the client or the server for url: \"",r.View("lookup:url",function(){return f.mustache(t.lookup("url"))}),'."\n '),"\n ")}),a.__checkName("__IronRouterNoRoutes__"),a.__IronRouterNoRoutes__=new a("Template.__IronRouterNoRoutes__",function(){var t=this;return h.Raw('<div style="font-family: helvetica; color: #777; max-width: 600px; margin: 20px auto;">\n <h1 style="text-align: center; margin: 0; font-size: 48pt;">\n iron:router\n </h1>\n <p style="text-align: center; font-size: 1.3em;">\n Organize your Meteor application.\n </p>\n <div style="margin: 50px 0px;">\n <pre style="background: #f2f2f2; margin: 0; padding: 10px;">\nRouter.route(\'/\', function () {\n this.render(\'Home\', {\n data: function () { return Items.findOne({_id: this.params._id}); }\n });\n});\n </pre>\n </div>\n <div style="margin: 50px 0px;">\n Check it out on Github:<br>\n <a href="https://github.com/eventedmind/iron-router" target="_blank">https://github.com/eventedmind/iron-router</a>\n <br>\n <br>\n And check out the new Guide:<br>\n <a href="https://iron-meteor.github.io/iron-router" target="_blank">\n https://iron-meteor.github.io/iron-router\n </a>\n </div>\n </div>')})}.call(this),"undefined"==typeof Package&&(Package={}),function(t,o){for(var e in o)e in t||(t[e]=o[e])}(Package["iron:router"]={},{Router:g,RouteController:_})}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,n=Package.meteor.meteorEnv,r=Package.jquery.$,i=Package.jquery.jQuery;!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof exports?require("jquery"):i)}(function(e){var t=function(){if(e&&e.fn&&e.fn.select2&&e.fn.select2.amd)var t=e.fn.select2.amd;var t;return function(){if(!t||!t.requirejs){t?n=t:t={};var e,n,r;!function(t){function i(e,t){return $.call(e,t)}function o(e,t){var n,r,i,o,s,a,l,c,u,d,p,h=t&&t.split("/"),f=y.map,g=f&&f["*"]||{};if(e&&"."===e.charAt(0))if(t){for(e=e.split("/"),s=e.length-1,y.nodeIdCompat&&b.test(e[s])&&(e[s]=e[s].replace(b,"")),e=h.slice(0,h.length-1).concat(e),u=0;u<e.length;u+=1)if(p=e[u],"."===p)e.splice(u,1),u-=1;else if(".."===p){if(1===u&&(".."===e[2]||".."===e[0]))break;u>0&&(e.splice(u-1,2),u-=2)}e=e.join("/")}else 0===e.indexOf("./")&&(e=e.substring(2));if((h||g)&&f){for(n=e.split("/"),u=n.length;u>0;u-=1){if(r=n.slice(0,u).join("/"),h)for(d=h.length;d>0;d-=1)if(i=f[h.slice(0,d).join("/")],i&&(i=i[r])){o=i,a=u;break}if(o)break;!l&&g&&g[r]&&(l=g[r],c=u)}!o&&l&&(o=l,a=c),o&&(n.splice(0,a,o),e=n.join("/"))}return e}function s(e,n){return function(){var r=w.call(arguments,0);return"string"!=typeof r[0]&&1===r.length&&r.push(null),h.apply(t,r.concat([e,n]))}}function a(e){return function(t){return o(t,e)}}function l(e){return function(t){m[e]=t}}function c(e){if(i(v,e)){var n=v[e];delete v[e],_[e]=!0,p.apply(t,n)}if(!i(m,e)&&!i(_,e))throw new Error("No "+e);return m[e]}function u(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 d(e){return function(){return y&&y.config&&y.config[e]||{}}}var p,h,f,g,m={},v={},y={},_={},$=Object.prototype.hasOwnProperty,w=[].slice,b=/\.js$/;f=function(e,t){var n,r=u(e),i=r[0];return e=r[1],i&&(i=o(i,t),n=c(i)),i?e=n&&n.normalize?n.normalize(e,a(t)):o(e,t):(e=o(e,t),r=u(e),i=r[0],e=r[1],i&&(n=c(i))),{f:i?i+"!"+e:e,n:e,pr:i,p:n}},g={require:function(e){return s(e)},exports:function(e){var t=m[e];return"undefined"!=typeof t?t:m[e]={}},module:function(e){return{id:e,uri:"",exports:m[e],config:d(e)}}},p=function(e,n,r,o){var a,u,d,p,h,y=[],$=typeof r,w;if(o=o||e,"undefined"===$||"function"===$){for(n=!n.length&&r.length?["require","exports","module"]:n,h=0;h<n.length;h+=1)if(p=f(n[h],o),u=p.f,"require"===u)y[h]=g.require(e);else if("exports"===u)y[h]=g.exports(e),w=!0;else if("module"===u)a=y[h]=g.module(e);else if(i(m,u)||i(v,u)||i(_,u))y[h]=c(u);else{if(!p.p)throw new Error(e+" missing "+u);p.p.load(p.n,s(o,!0),l(u),{}),y[h]=m[u]}d=r?r.apply(m[e],y):void 0,e&&(a&&a.exports!==t&&a.exports!==m[e]?m[e]=a.exports:d===t&&w||(m[e]=d))}else e&&(m[e]=r)},e=n=h=function(e,n,r,i,o){if("string"==typeof e)return g[e]?g[e](n):c(f(e,n).f);if(!e.splice){if(y=e,y.deps&&h(y.deps,y.callback),!n)return;n.splice?(e=n,n=r,r=null):e=t}return n=n||function(){},"function"==typeof r&&(r=i,i=o),i?p(t,e,n,r):setTimeout(function(){p(t,e,n,r)},4),h},h.config=function(e){return h(e)},e._defined=m,r=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),i(m,e)||i(v,e)||(v[e]=[e,t,n])},r.amd={jQuery:!0}}(),t.requirejs=e,t.require=n,t.define=r}}(),t.define("almond",function(){}),t.define("jquery",[],function(){var t=e||r;return null==t&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),t}),t.define("select2/utils",["jquery"],function(e){function t(e){var t=e.prototype,n=[];for(var r in t){var i=t[r];"function"==typeof i&&"constructor"!==r&&n.push(r)}return n}var n={};n.Extend=function(e,t){function n(){this.constructor=e}var r={}.hasOwnProperty;for(var i in t)r.call(t,i)&&(e[i]=t[i]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},n.Decorate=function(e,n){function r(){var t=Array.prototype.unshift,r=n.prototype.constructor.length,i=e.prototype.constructor;r>0&&(t.call(arguments,e.prototype.constructor),i=n.prototype.constructor),i.apply(this,arguments)}function i(){this.constructor=r}var o=t(n),s=t(e);n.displayName=e.displayName,r.prototype=new i;for(var a=0;a<s.length;a++){var l=s[a];r.prototype[l]=e.prototype[l]}for(var c=(function(e){var t=function(){};e in r.prototype&&(t=r.prototype[e]);var i=n.prototype[e];return function(){var e=Array.prototype.unshift;return e.call(arguments,t),i.apply(this,arguments)}}),u=0;u<o.length;u++){var d=o[u];r.prototype[d]=c(d)}return r};var r=function(){this.listeners={}};return r.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},r.prototype.trigger=function(e){var t=Array.prototype.slice,n=t.call(arguments,1);this.listeners=this.listeners||{},null==n&&(n=[]),0===n.length&&n.push({}),n[0]._type=e,e in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},r.prototype.invoke=function(e,t){for(var n=0,r=e.length;n<r;n++)e[n].apply(this,t)},n.Observable=r,n.generateChars=function(e){for(var t="",n=0;n<e;n++){var r=Math.floor(36*Math.random());t+=r.toString(36)}return t},n.bind=function(e,t){return function(){e.apply(t,arguments)}},n._convertData=function(e){for(var t in e){var n=t.split("-"),r=e;if(1!==n.length){for(var i=0;i<n.length;i++){var o=n[i];o=o.substring(0,1).toLowerCase()+o.substring(1),o in r||(r[o]={}),i==n.length-1&&(r[o]=e[t]),r=r[o]}delete e[t]}}return e},n.hasScroll=function(t,n){var r=e(n),i=n.style.overflowX,o=n.style.overflowY;return(i!==o||"hidden"!==o&&"visible"!==o)&&("scroll"===i||"scroll"===o||(r.innerHeight()<n.scrollHeight||r.innerWidth()<n.scrollWidth))},n.escapeMarkup=function(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},n.appendMany=function(t,n){if("1.7"===e.fn.jquery.substr(0,3)){var r=e();e.map(n,function(e){r=r.add(e)}),n=r}t.append(n)},n}),t.define("select2/results",["jquery","./utils"],function(e,t){function n(e,t,r){this.$element=e,this.data=r,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,t.Observable),n.prototype.render=function(){var t=e('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&t.attr("aria-multiselectable","true"),this.$results=t,t},n.prototype.clear=function(){this.$results.empty()},n.prototype.displayMessage=function(t){var n=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var r=e('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),i=this.options.get("translations").get(t.message);r.append(n(i(t.args))),r[0].className+=" select2-results__message",this.$results.append(r)},n.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},n.prototype.append=function(e){this.hideLoading();var t=[];if(null==e.results||0===e.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));e.results=this.sort(e.results);for(var n=0;n<e.results.length;n++){var r=e.results[n],i=this.option(r);t.push(i)}this.$results.append(t)},n.prototype.position=function(e,t){var n=t.find(".select2-results");n.append(e)},n.prototype.sort=function(e){var t=this.options.get("sorter");return t(e)},n.prototype.highlightFirstItem=function(){var e=this.$results.find(".select2-results__option[aria-selected]"),t=e.filter("[aria-selected=true]");t.length>0?t.first().trigger("mouseenter"):e.first().trigger("mouseenter"),this.ensureHighlightVisible()},n.prototype.setClasses=function(){var t=this;this.data.current(function(n){var r=e.map(n,function(e){return e.id.toString()}),i=t.$results.find(".select2-results__option[aria-selected]");i.each(function(){var t=e(this),n=e.data(this,"data"),i=""+n.id;null!=n.element&&n.element.selected||null==n.element&&e.inArray(i,r)>-1?t.attr("aria-selected","true"):t.attr("aria-selected","false")})})},n.prototype.showLoading=function(e){this.hideLoading();var t=this.options.get("translations").get("searching"),n={disabled:!0,loading:!0,text:t(e)},r=this.option(n);r.className+=" loading-results",this.$results.prepend(r)},n.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},n.prototype.option=function(t){var n=document.createElement("li");n.className="select2-results__option";var r={role:"treeitem","aria-selected":"false"};t.disabled&&(delete r["aria-selected"],r["aria-disabled"]="true"),null==t.id&&delete r["aria-selected"],null!=t._resultId&&(n.id=t._resultId),t.title&&(n.title=t.title),t.children&&(r.role="group",r["aria-label"]=t.text,delete r["aria-selected"]);for(var i in r){var o=r[i];n.setAttribute(i,o)}if(t.children){var s=e(n),a=document.createElement("strong");a.className="select2-results__group";var l=e(a);this.template(t,a);for(var c=[],u=0;u<t.children.length;u++){var d=t.children[u],p=this.option(d);c.push(p)}var h=e("<ul></ul>",{class:"select2-results__options select2-results__options--nested"});h.append(c),s.append(a),s.append(h)}else this.template(t,n);return e.data(n,"data",t),n},n.prototype.bind=function(t,n){var r=this,i=t.id+"-results";this.$results.attr("id",i),t.on("results:all",function(e){r.clear(),r.append(e.data),t.isOpen()&&(r.setClasses(),r.highlightFirstItem())}),t.on("results:append",function(e){r.append(e.data),t.isOpen()&&r.setClasses()}),t.on("query",function(e){r.hideMessages(),r.showLoading(e)}),t.on("select",function(){t.isOpen()&&(r.setClasses(),r.highlightFirstItem())}),t.on("unselect",function(){t.isOpen()&&(r.setClasses(),r.highlightFirstItem())}),t.on("open",function(){r.$results.attr("aria-expanded","true"),r.$results.attr("aria-hidden","false"),r.setClasses(),r.ensureHighlightVisible()}),t.on("close",function(){r.$results.attr("aria-expanded","false"),r.$results.attr("aria-hidden","true"),r.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=r.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e=r.getHighlightedResults();if(0!==e.length){var t=e.data("data");"true"==e.attr("aria-selected")?r.trigger("close",{}):r.trigger("select",{data:t})}}),t.on("results:previous",function(){var e=r.getHighlightedResults(),t=r.$results.find("[aria-selected]"),n=t.index(e);if(0!==n){var i=n-1;0===e.length&&(i=0);var o=t.eq(i);o.trigger("mouseenter");var s=r.$results.offset().top,a=o.offset().top,l=r.$results.scrollTop()+(a-s);0===i?r.$results.scrollTop(0):a-s<0&&r.$results.scrollTop(l)}}),t.on("results:next",function(){var e=r.getHighlightedResults(),t=r.$results.find("[aria-selected]"),n=t.index(e),i=n+1;if(!(i>=t.length)){var o=t.eq(i);o.trigger("mouseenter");var s=r.$results.offset().top+r.$results.outerHeight(!1),a=o.offset().top+o.outerHeight(!1),l=r.$results.scrollTop()+a-s;0===i?r.$results.scrollTop(0):a>s&&r.$results.scrollTop(l)}}),t.on("results:focus",function(e){e.element.addClass("select2-results__option--highlighted")}),t.on("results:message",function(e){r.displayMessage(e)}),e.fn.mousewheel&&this.$results.on("mousewheel",function(e){var t=r.$results.scrollTop(),n=r.$results.get(0).scrollHeight-t+e.deltaY,i=e.deltaY>0&&t-e.deltaY<=0,o=e.deltaY<0&&n<=r.$results.height();i?(r.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):o&&(r.$results.scrollTop(r.$results.get(0).scrollHeight-r.$results.height()),e.preventDefault(),e.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(t){var n=e(this),i=n.data("data");return"true"===n.attr("aria-selected")?void(r.options.get("multiple")?r.trigger("unselect",{originalEvent:t,data:i}):r.trigger("close",{})):void r.trigger("select",{originalEvent:t,data:i})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(t){var n=e(this).data("data");r.getHighlightedResults().removeClass("select2-results__option--highlighted"),r.trigger("results:focus",{data:n,element:e(this)})})},n.prototype.getHighlightedResults=function(){var e=this.$results.find(".select2-results__option--highlighted");return e},n.prototype.destroy=function(){this.$results.remove()},n.prototype.ensureHighlightVisible=function(){var e=this.getHighlightedResults();if(0!==e.length){var t=this.$results.find("[aria-selected]"),n=t.index(e),r=this.$results.offset().top,i=e.offset().top,o=this.$results.scrollTop()+(i-r),s=i-r;o-=2*e.outerHeight(!1),n<=2?this.$results.scrollTop(0):(s>this.$results.outerHeight()||s<0)&&this.$results.scrollTop(o)}},n.prototype.template=function(t,n){var r=this.options.get("templateResult"),i=this.options.get("escapeMarkup"),o=r(t,n);null==o?n.style.display="none":"string"==typeof o?n.innerHTML=i(o):e(n).append(o)},n}),t.define("select2/keys",[],function(){var e={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};return e}),t.define("select2/selection/base",["jquery","../utils","../keys"],function(e,t,n){function r(e,t){this.$element=e,this.options=t,r.__super__.constructor.call(this)}return t.Extend(r,t.Observable),r.prototype.render=function(){var t=e('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),t.attr("title",this.$element.attr("title")),t.attr("tabindex",this._tabindex),this.$selection=t,t},r.prototype.bind=function(e,t){var r=this,i=e.id+"-container",o=e.id+"-results";this.container=e,this.$selection.on("focus",function(e){r.trigger("focus",e)}),this.$selection.on("blur",function(e){r._handleBlur(e)}),this.$selection.on("keydown",function(e){r.trigger("keypress",e),e.which===n.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){r.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){r.update(e.data)}),e.on("open",function(){r.$selection.attr("aria-expanded","true"),r.$selection.attr("aria-owns",o),r._attachCloseHandler(e)}),e.on("close",function(){r.$selection.attr("aria-expanded","false"),r.$selection.removeAttr("aria-activedescendant"),r.$selection.removeAttr("aria-owns"),r.$selection.focus(),r._detachCloseHandler(e)}),e.on("enable",function(){r.$selection.attr("tabindex",r._tabindex)}),e.on("disable",function(){r.$selection.attr("tabindex","-1")})},r.prototype._handleBlur=function(t){var n=this;window.setTimeout(function(){document.activeElement==n.$selection[0]||e.contains(n.$selection[0],document.activeElement)||n.trigger("blur",t)},1)},r.prototype._attachCloseHandler=function(t){var n=this;e(document.body).on("mousedown.select2."+t.id,function(t){var n=e(t.target),r=n.closest(".select2"),i=e(".select2.select2-container--open");i.each(function(){var t=e(this);if(this!=r[0]){var n=t.data("element");n.select2("close")}})})},r.prototype._detachCloseHandler=function(t){e(document.body).off("mousedown.select2."+t.id)},r.prototype.position=function(e,t){var n=t.find(".selection");n.append(e)},r.prototype.destroy=function(){this._detachCloseHandler(this.container)},r.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},r}),t.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,r){function i(){i.__super__.constructor.apply(this,arguments)}return n.Extend(i,t),i.prototype.render=function(){var e=i.__super__.render.call(this);return e.addClass("select2-selection--single"),e.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),e},i.prototype.bind=function(e,t){var n=this;i.__super__.bind.apply(this,arguments);var r=e.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",r),this.$selection.attr("aria-labelledby",r),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),e.on("focus",function(t){e.isOpen()||n.$selection.focus()}),e.on("selection:update",function(e){n.update(e.data)})},i.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},i.prototype.display=function(e,t){var n=this.options.get("templateSelection"),r=this.options.get("escapeMarkup");return r(n(e,t))},i.prototype.selectionContainer=function(){return e("<span></span>")},i.prototype.update=function(e){if(0===e.length)return void this.clear();var t=e[0],n=this.$selection.find(".select2-selection__rendered"),r=this.display(t,n);n.empty().append(r),n.prop("title",t.title||t.text)},i}),t.define("select2/selection/multiple",["jquery","./base","../utils"],function(e,t,n){function r(e,t){r.__super__.constructor.apply(this,arguments)}return n.Extend(r,t),r.prototype.render=function(){var e=r.__super__.render.call(this);return e.addClass("select2-selection--multiple"),e.html('<ul class="select2-selection__rendered"></ul>'),e},r.prototype.bind=function(t,n){var i=this;r.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){i.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2-selection__choice__remove",function(t){if(!i.options.get("disabled")){var n=e(this),r=n.parent(),o=r.data("data");i.trigger("unselect",{originalEvent:t,data:o})}})},r.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},r.prototype.display=function(e,t){var n=this.options.get("templateSelection"),r=this.options.get("escapeMarkup");return r(n(e,t))},r.prototype.selectionContainer=function(){var t=e('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">&times;</span></li>');return t},r.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],r=0;r<e.length;r++){var i=e[r],o=this.selectionContainer(),s=this.display(i,o);o.append(s),o.prop("title",i.title||i.text),o.data("data",i),t.push(o)}var a=this.$selection.find(".select2-selection__rendered");n.appendMany(a,t)}},r}),t.define("select2/selection/placeholder",["../utils"],function(e){function t(e,t,n){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n)}return t.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},t.prototype.createPlaceholder=function(e,t){var n=this.selectionContainer();return n.html(this.display(t)),n.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),n},t.prototype.update=function(e,t){var n=1==t.length&&t[0].id!=this.placeholder.id,r=t.length>1;if(r||n)return e.call(this,t);this.clear();var i=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(i)},t}),t.define("select2/selection/allowClear",["jquery","../keys"],function(e,t){function n(){}return n.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(e){r._handleClear(e)}),t.on("keypress",function(e){r._handleKeyboardClear(e,t)})},n.prototype._handleClear=function(e,t){if(!this.options.get("disabled")){var n=this.$selection.find(".select2-selection__clear");if(0!==n.length){t.stopPropagation();for(var r=n.data("data"),i=0;i<r.length;i++){var o={data:r[i]};if(this.trigger("unselect",o),o.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},n.prototype._handleKeyboardClear=function(e,n,r){r.isOpen()||n.which!=t.DELETE&&n.which!=t.BACKSPACE||this._handleClear(n)},n.prototype.update=function(t,n){if(t.call(this,n),!(this.$selection.find(".select2-selection__placeholder").length>0||0===n.length)){var r=e('<span class="select2-selection__clear">&times;</span>');r.data("data",n),this.$selection.find(".select2-selection__rendered").prepend(r)}},n}),t.define("select2/selection/search",["jquery","../utils","../keys"],function(e,t,n){function r(e,t,n){e.call(this,t,n)}return r.prototype.render=function(t){var n=e('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=n,this.$search=n.find("input");var r=t.call(this);return this._transferTabIndex(),r},r.prototype.bind=function(e,t,r){var i=this;e.call(this,t,r),t.on("open",function(){i.$search.trigger("focus")}),t.on("close",function(){i.$search.val(""),i.$search.removeAttr("aria-activedescendant"),i.$search.trigger("focus")}),t.on("enable",function(){i.$search.prop("disabled",!1),i._transferTabIndex()}),t.on("disable",function(){i.$search.prop("disabled",!0)}),t.on("focus",function(e){i.$search.trigger("focus")}),t.on("results:focus",function(e){i.$search.attr("aria-activedescendant",e.id)}),this.$selection.on("focusin",".select2-search--inline",function(e){i.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){i._handleBlur(e)}),this.$selection.on("keydown",".select2-search--inline",function(e){e.stopPropagation(),i.trigger("keypress",e),i._keyUpPrevented=e.isDefaultPrevented();var t=e.which;if(t===n.BACKSPACE&&""===i.$search.val()){var r=i.$searchContainer.prev(".select2-selection__choice");if(r.length>0){var o=r.data("data");i.searchRemoveChoice(o),e.preventDefault()}}});var o=document.documentMode,s=o&&o<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(e){return s?void i.$selection.off("input.search input.searchcheck"):void i.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(e){if(s&&"input"===e.type)return void i.$selection.off("input.search input.searchcheck");var t=e.which;t!=n.SHIFT&&t!=n.CTRL&&t!=n.ALT&&t!=n.TAB&&i.handleSearch(e)})},r.prototype._transferTabIndex=function(e){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},r.prototype.createPlaceholder=function(e,t){this.$search.attr("placeholder",t.text)},r.prototype.update=function(e,t){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),e.call(this,t),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),n&&this.$search.focus()},r.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1},r.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t}),this.$search.val(t.text),this.handleSearch()},r.prototype.resizeSearch=function(){this.$search.css("width","25px");var e="";if(""!==this.$search.attr("placeholder"))e=this.$selection.find(".select2-selection__rendered").innerWidth();else{var t=this.$search.val().length+1;e=.75*t+"em"}this.$search.css("width",e)},r}),t.define("select2/selection/eventRelay",["jquery"],function(e){function t(){}return t.prototype.bind=function(t,n,r){var i=this,o=["open","opening","close","closing","select","selecting","unselect","unselecting"],s=["opening","closing","selecting","unselecting"];t.call(this,n,r),n.on("*",function(t,n){if(e.inArray(t,o)!==-1){n=n||{};var r=e.Event("select2:"+t,{params:n});i.$element.trigger(r),e.inArray(t,s)!==-1&&(n.prevented=r.isDefaultPrevented())}})},t}),t.define("select2/translation",["jquery","require"],function(e,t){function n(e){this.dict=e||{}}return n.prototype.all=function(){return this.dict},n.prototype.get=function(e){return this.dict[e]},n.prototype.extend=function(t){this.dict=e.extend({},t.all(),this.dict)},n._cache={},n.loadPath=function(e){if(!(e in n._cache)){var r=t(e);n._cache[e]=r}return new n(n._cache[e])},n}),t.define("select2/diacritics",[],function(){var e={"Ⓐ":"A","":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","":"x","ẋ":"x","ẍ":"x","ⓨ":"y","":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};return e}),t.define("select2/data/base",["../utils"],function(e){function t(e,n){t.__super__.constructor.call(this)}return e.Extend(t,e.Observable),t.prototype.current=function(e){throw new Error("The `current` method must be defined in child classes.")},t.prototype.query=function(e,t){throw new Error("The `query` method must be defined in child classes.")},t.prototype.bind=function(e,t){},t.prototype.destroy=function(){},t.prototype.generateResultId=function(t,n){var r=t.id+"-result-";return r+=e.generateChars(4),r+=null!=n.id?"-"+n.id.toString():"-"+e.generateChars(4)},t}),t.define("select2/data/select",["./base","../utils","jquery"],function(e,t,n){function r(e,t){this.$element=e,this.options=t,r.__super__.constructor.call(this)}return t.Extend(r,e),r.prototype.current=function(e){var t=[],r=this;this.$element.find(":selected").each(function(){var e=n(this),i=r.item(e);t.push(i)}),e(t);
},r.prototype.select=function(e){var t=this;if(e.selected=!0,n(e.element).is("option"))return e.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(r){var i=[];e=[e],e.push.apply(e,r);for(var o=0;o<e.length;o++){var s=e[o].id;n.inArray(s,i)===-1&&i.push(s)}t.$element.val(i),t.$element.trigger("change")});else{var r=e.id;this.$element.val(r),this.$element.trigger("change")}},r.prototype.unselect=function(e){var t=this;if(this.$element.prop("multiple"))return e.selected=!1,n(e.element).is("option")?(e.element.selected=!1,void this.$element.trigger("change")):void this.current(function(r){for(var i=[],o=0;o<r.length;o++){var s=r[o].id;s!==e.id&&n.inArray(s,i)===-1&&i.push(s)}t.$element.val(i),t.$element.trigger("change")})},r.prototype.bind=function(e,t){var n=this;this.container=e,e.on("select",function(e){n.select(e.data)}),e.on("unselect",function(e){n.unselect(e.data)})},r.prototype.destroy=function(){this.$element.find("*").each(function(){n.removeData(this,"data")})},r.prototype.query=function(e,t){var r=[],i=this,o=this.$element.children();o.each(function(){var t=n(this);if(t.is("option")||t.is("optgroup")){var o=i.item(t),s=i.matches(e,o);null!==s&&r.push(s)}}),t({results:r})},r.prototype.addOptions=function(e){t.appendMany(this.$element,e)},r.prototype.option=function(e){var t;e.children?(t=document.createElement("optgroup"),t.label=e.text):(t=document.createElement("option"),void 0!==t.textContent?t.textContent=e.text:t.innerText=e.text),e.id&&(t.value=e.id),e.disabled&&(t.disabled=!0),e.selected&&(t.selected=!0),e.title&&(t.title=e.title);var r=n(t),i=this._normalizeItem(e);return i.element=t,n.data(t,"data",i),r},r.prototype.item=function(e){var t={};if(t=n.data(e[0],"data"),null!=t)return t;if(e.is("option"))t={id:e.val(),text:e.text(),disabled:e.prop("disabled"),selected:e.prop("selected"),title:e.prop("title")};else if(e.is("optgroup")){t={text:e.prop("label"),children:[],title:e.prop("title")};for(var r=e.children("option"),i=[],o=0;o<r.length;o++){var s=n(r[o]),a=this.item(s);i.push(a)}t.children=i}return t=this._normalizeItem(t),t.element=e[0],n.data(e[0],"data",t),t},r.prototype._normalizeItem=function(e){n.isPlainObject(e)||(e={id:e,text:e}),e=n.extend({},{text:""},e);var t={selected:!1,disabled:!1};return null!=e.id&&(e.id=e.id.toString()),null!=e.text&&(e.text=e.text.toString()),null==e._resultId&&e.id&&null!=this.container&&(e._resultId=this.generateResultId(this.container,e)),n.extend({},t,e)},r.prototype.matches=function(e,t){var n=this.options.get("matcher");return n(e,t)},r}),t.define("select2/data/array",["./select","../utils","jquery"],function(e,t,n){function r(e,t){var n=t.get("data")||[];r.__super__.constructor.call(this,e,t),this.addOptions(this.convertToOptions(n))}return t.Extend(r,e),r.prototype.select=function(e){var t=this.$element.find("option").filter(function(t,n){return n.value==e.id.toString()});0===t.length&&(t=this.option(e),this.addOptions(t)),r.__super__.select.call(this,e)},r.prototype.convertToOptions=function(e){function r(e){return function(){return n(this).val()==e.id}}for(var i=this,o=this.$element.find("option"),s=o.map(function(){return i.item(n(this)).id}).get(),a=[],l=0;l<e.length;l++){var c=this._normalizeItem(e[l]);if(n.inArray(c.id,s)>=0){var u=o.filter(r(c)),d=this.item(u),p=n.extend(!0,{},c,d),h=this.option(p);u.replaceWith(h)}else{var f=this.option(c);if(c.children){var g=this.convertToOptions(c.children);t.appendMany(f,g)}a.push(f)}}return a},r}),t.define("select2/data/ajax",["./array","../utils","jquery"],function(e,t,n){function r(e,t){this.ajaxOptions=this._applyDefaults(t.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),r.__super__.constructor.call(this,e,t)}return t.Extend(r,e),r.prototype._applyDefaults=function(e){var t={data:function(e){return n.extend({},e,{q:e.term})},transport:function(e,t,r){var i=n.ajax(e);return i.then(t),i.fail(r),i}};return n.extend({},t,e,!0)},r.prototype.processResults=function(e){return e},r.prototype.query=function(e,t){function r(){var r=s.transport(s,function(r){var i=o.processResults(r,e);o.options.get("debug")&&window.console&&console.error&&(i&&i.results&&n.isArray(i.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),t(i)},function(){r.status&&"0"===r.status||o.trigger("results:message",{message:"errorLoading"})});o._request=r}var i=[],o=this;null!=this._request&&(n.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var s=n.extend({type:"GET"},this.ajaxOptions);"function"==typeof s.url&&(s.url=s.url.call(this.$element,e)),"function"==typeof s.data&&(s.data=s.data.call(this.$element,e)),this.ajaxOptions.delay&&null!=e.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(r,this.ajaxOptions.delay)):r()},r}),t.define("select2/data/tags",["jquery"],function(e){function t(t,n,r){var i=r.get("tags"),o=r.get("createTag");void 0!==o&&(this.createTag=o);var s=r.get("insertTag");if(void 0!==s&&(this.insertTag=s),t.call(this,n,r),e.isArray(i))for(var a=0;a<i.length;a++){var l=i[a],c=this._normalizeItem(l),u=this.option(c);this.$element.append(u)}}return t.prototype.query=function(e,t,n){function r(e,o){for(var s=e.results,a=0;a<s.length;a++){var l=s[a],c=null!=l.children&&!r({results:l.children},!0),u=l.text===t.term;if(u||c)return!o&&(e.data=s,void n(e))}if(o)return!0;var d=i.createTag(t);if(null!=d){var p=i.option(d);p.attr("data-select2-tag",!0),i.addOptions([p]),i.insertTag(s,d)}e.results=s,n(e)}var i=this;return this._removeOldTags(),null==t.term||null!=t.page?void e.call(this,t,n):void e.call(this,t,r)},t.prototype.createTag=function(t,n){var r=e.trim(n.term);return""===r?null:{id:r,text:r}},t.prototype.insertTag=function(e,t,n){t.unshift(n)},t.prototype._removeOldTags=function(t){var n=this._lastTag,r=this.$element.find("option[data-select2-tag]");r.each(function(){this.selected||e(this).remove()})},t}),t.define("select2/data/tokenizer",["jquery"],function(e){function t(e,t,n){var r=n.get("tokenizer");void 0!==r&&(this.tokenizer=r),e.call(this,t,n)}return t.prototype.bind=function(e,t,n){e.call(this,t,n),this.$search=t.dropdown.$search||t.selection.$search||n.find(".select2-search__field")},t.prototype.query=function(t,n,r){function i(t){var n=s._normalizeItem(t),r=s.$element.find("option").filter(function(){return e(this).val()===n.id});if(!r.length){var i=s.option(n);i.attr("data-select2-tag",!0),s._removeOldTags(),s.addOptions([i])}o(n)}function o(e){s.trigger("select",{data:e})}var s=this;n.term=n.term||"";var a=this.tokenizer(n,this.options,i);a.term!==n.term&&(this.$search.length&&(this.$search.val(a.term),this.$search.focus()),n.term=a.term),t.call(this,n,r)},t.prototype.tokenizer=function(t,n,r,i){for(var o=r.get("tokenSeparators")||[],s=n.term,a=0,l=this.createTag||function(e){return{id:e.term,text:e.term}};a<s.length;){var c=s[a];if(e.inArray(c,o)!==-1){var u=s.substr(0,a),d=e.extend({},n,{term:u}),p=l(d);null!=p?(i(p),s=s.substr(a+1)||"",a=0):a++}else a++}return{term:s}},t}),t.define("select2/data/minimumInputLength",[],function(){function e(e,t,n){this.minimumInputLength=n.get("minimumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){return t.term=t.term||"",t.term.length<this.minimumInputLength?void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:t.term,params:t}}):void e.call(this,t,n)},e}),t.define("select2/data/maximumInputLength",[],function(){function e(e,t,n){this.maximumInputLength=n.get("maximumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){return t.term=t.term||"",this.maximumInputLength>0&&t.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):void e.call(this,t,n)},e}),t.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){var r=this;this.current(function(i){var o=null!=i?i.length:0;return r.maximumSelectionLength>0&&o>=r.maximumSelectionLength?void r.trigger("results:message",{message:"maximumSelected",args:{maximum:r.maximumSelectionLength}}):void e.call(r,t,n)})},e}),t.define("select2/dropdown",["jquery","./utils"],function(e,t){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,t.Observable),n.prototype.render=function(){var t=e('<span class="select2-dropdown"><span class="select2-results"></span></span>');return t.attr("dir",this.options.get("dir")),this.$dropdown=t,t},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),t.define("select2/dropdown/search",["jquery","../utils"],function(e,t){function n(){}return n.prototype.render=function(t){var n=t.call(this),r=e('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=r,this.$search=r.find("input"),n.prepend(r),n},n.prototype.bind=function(t,n,r){var i=this;t.call(this,n,r),this.$search.on("keydown",function(e){i.trigger("keypress",e),i._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(t){e(this).off("keyup")}),this.$search.on("keyup input",function(e){i.handleSearch(e)}),n.on("open",function(){i.$search.attr("tabindex",0),i.$search.focus(),window.setTimeout(function(){i.$search.focus()},0)}),n.on("close",function(){i.$search.attr("tabindex",-1),i.$search.val("")}),n.on("focus",function(){n.isOpen()&&i.$search.focus()}),n.on("results:all",function(e){if(null==e.query.term||""===e.query.term){var t=i.showSearch(e);t?i.$searchContainer.removeClass("select2-search--hide"):i.$searchContainer.addClass("select2-search--hide")}})},n.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},n.prototype.showSearch=function(e,t){return!0},n}),t.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,r){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,r)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),r=t.length-1;r>=0;r--){var i=t[r];this.placeholder.id===i.id&&n.splice(r,1)}return n},e}),t.define("select2/dropdown/infiniteScroll",["jquery"],function(e){function t(e,t,n,r){this.lastParams={},e.call(this,t,n,r),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return t.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&this.$results.append(this.$loadingMore)},t.prototype.bind=function(t,n,r){var i=this;t.call(this,n,r),n.on("query",function(e){i.lastParams=e,i.loading=!0}),n.on("query:append",function(e){i.lastParams=e,i.loading=!0}),this.$results.on("scroll",function(){var t=e.contains(document.documentElement,i.$loadingMore[0]);if(!i.loading&&t){var n=i.$results.offset().top+i.$results.outerHeight(!1),r=i.$loadingMore.offset().top+i.$loadingMore.outerHeight(!1);n+50>=r&&i.loadMore()}})},t.prototype.loadMore=function(){this.loading=!0;var t=e.extend({},{page:1},this.lastParams);t.page++,this.trigger("query:append",t)},t.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},t.prototype.createLoadingMore=function(){var t=e('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),n=this.options.get("translations").get("loadingMore");return t.html(n(this.lastParams)),t},t}),t.define("select2/dropdown/attachBody",["jquery","../utils"],function(e,t){function n(t,n,r){this.$dropdownParent=r.get("dropdownParent")||e(document.body),t.call(this,n,r)}return n.prototype.bind=function(e,t,n){var r=this,i=!1;e.call(this,t,n),t.on("open",function(){r._showDropdown(),r._attachPositioningHandler(t),i||(i=!0,t.on("results:all",function(){r._positionDropdown(),r._resizeDropdown()}),t.on("results:append",function(){r._positionDropdown(),r._resizeDropdown()}))}),t.on("close",function(){r._hideDropdown(),r._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},n.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},n.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("select2"),t.addClass("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},n.prototype.render=function(t){var n=e("<span></span>"),r=t.call(this);return n.append(r),this.$dropdownContainer=n,n},n.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},n.prototype._attachPositioningHandler=function(n,r){var i=this,o="scroll.select2."+r.id,s="resize.select2."+r.id,a="orientationchange.select2."+r.id,l=this.$container.parents().filter(t.hasScroll);l.each(function(){e(this).data("select2-scroll-position",{x:e(this).scrollLeft(),y:e(this).scrollTop()})}),l.on(o,function(t){var n=e(this).data("select2-scroll-position");e(this).scrollTop(n.y)}),e(window).on(o+" "+s+" "+a,function(e){i._positionDropdown(),i._resizeDropdown()})},n.prototype._detachPositioningHandler=function(n,r){var i="scroll.select2."+r.id,o="resize.select2."+r.id,s="orientationchange.select2."+r.id,a=this.$container.parents().filter(t.hasScroll);a.off(i),e(window).off(i+" "+o+" "+s)},n.prototype._positionDropdown=function(){var t=e(window),n=this.$dropdown.hasClass("select2-dropdown--above"),r=this.$dropdown.hasClass("select2-dropdown--below"),i=null,o=this.$container.offset();o.bottom=o.top+this.$container.outerHeight(!1);var s={height:this.$container.outerHeight(!1)};s.top=o.top,s.bottom=o.top+s.height;var a={height:this.$dropdown.outerHeight(!1)},l={top:t.scrollTop(),bottom:t.scrollTop()+t.height()},c=l.top<o.top-a.height,u=l.bottom>o.bottom+a.height,d={left:o.left,top:s.bottom},p=this.$dropdownParent;"static"===p.css("position")&&(p=p.offsetParent());var h=p.offset();d.top-=h.top,d.left-=h.left,n||r||(i="below"),u||!c||n?!c&&u&&n&&(i="below"):i="above",("above"==i||n&&"below"!==i)&&(d.top=s.top-h.top-a.height),null!=i&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+i),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+i)),this.$dropdownContainer.css(d)},n.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},n.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},n}),t.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(t){for(var n=0,r=0;r<t.length;r++){var i=t[r];i.children?n+=e(i.children):n++}return n}function t(e,t,n,r){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,r)}return t.prototype.showSearch=function(t,n){return!(e(n.data.results)<this.minimumResultsForSearch)&&t.call(this,n)},t}),t.define("select2/dropdown/selectOnClose",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("close",function(e){r._handleSelectOnClose(e)})},e.prototype._handleSelectOnClose=function(e,t){if(t&&null!=t.originalSelect2Event){var n=t.originalSelect2Event;if("select"===n._type||"unselect"===n._type)return}var r=this.getHighlightedResults();if(!(r.length<1)){var i=r.data("data");null!=i.element&&i.element.selected||null==i.element&&i.selected||this.trigger("select",{data:i})}},e}),t.define("select2/dropdown/closeOnSelect",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("select",function(e){r._selectTriggered(e)}),t.on("unselect",function(e){r._selectTriggered(e)})},e.prototype._selectTriggered=function(e,t){var n=t.originalEvent;n&&n.ctrlKey||this.trigger("close",{originalEvent:n,originalSelect2Event:t})},e}),t.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return 1!=t&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Please enter "+t+" or more characters";return n},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return 1!=e.maximum&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),t.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(e,t,n,r,i,o,s,a,l,c,u,d,p,h,f,g,m,v,y,_,$,w,b,A,x,E,C,O,S){function T(){this.reset()}T.prototype.apply=function(d){if(d=e.extend(!0,{},this.defaults,d),null==d.dataAdapter){if(null!=d.ajax?d.dataAdapter=f:null!=d.data?d.dataAdapter=h:d.dataAdapter=p,d.minimumInputLength>0&&(d.dataAdapter=c.Decorate(d.dataAdapter,v)),d.maximumInputLength>0&&(d.dataAdapter=c.Decorate(d.dataAdapter,y)),d.maximumSelectionLength>0&&(d.dataAdapter=c.Decorate(d.dataAdapter,_)),d.tags&&(d.dataAdapter=c.Decorate(d.dataAdapter,g)),null==d.tokenSeparators&&null==d.tokenizer||(d.dataAdapter=c.Decorate(d.dataAdapter,m)),null!=d.query){var S=t(d.amdBase+"compat/query");d.dataAdapter=c.Decorate(d.dataAdapter,S)}if(null!=d.initSelection){var T=t(d.amdBase+"compat/initSelection");d.dataAdapter=c.Decorate(d.dataAdapter,T)}}if(null==d.resultsAdapter&&(d.resultsAdapter=n,null!=d.ajax&&(d.resultsAdapter=c.Decorate(d.resultsAdapter,A)),null!=d.placeholder&&(d.resultsAdapter=c.Decorate(d.resultsAdapter,b)),d.selectOnClose&&(d.resultsAdapter=c.Decorate(d.resultsAdapter,C))),null==d.dropdownAdapter){if(d.multiple)d.dropdownAdapter=$;else{var D=c.Decorate($,w);d.dropdownAdapter=D}if(0!==d.minimumResultsForSearch&&(d.dropdownAdapter=c.Decorate(d.dropdownAdapter,E)),d.closeOnSelect&&(d.dropdownAdapter=c.Decorate(d.dropdownAdapter,O)),null!=d.dropdownCssClass||null!=d.dropdownCss||null!=d.adaptDropdownCssClass){var q=t(d.amdBase+"compat/dropdownCss");d.dropdownAdapter=c.Decorate(d.dropdownAdapter,q)}d.dropdownAdapter=c.Decorate(d.dropdownAdapter,x)}if(null==d.selectionAdapter){if(d.multiple?d.selectionAdapter=i:d.selectionAdapter=r,null!=d.placeholder&&(d.selectionAdapter=c.Decorate(d.selectionAdapter,o)),d.allowClear&&(d.selectionAdapter=c.Decorate(d.selectionAdapter,s)),d.multiple&&(d.selectionAdapter=c.Decorate(d.selectionAdapter,a)),null!=d.containerCssClass||null!=d.containerCss||null!=d.adaptContainerCssClass){var L=t(d.amdBase+"compat/containerCss");d.selectionAdapter=c.Decorate(d.selectionAdapter,L)}d.selectionAdapter=c.Decorate(d.selectionAdapter,l)}if("string"==typeof d.language)if(d.language.indexOf("-")>0){var P=d.language.split("-"),j=P[0];d.language=[d.language,j]}else d.language=[d.language];if(e.isArray(d.language)){var k=new u;d.language.push("en");for(var I=d.language,R=0;R<I.length;R++){var M=I[R],U={};try{U=u.loadPath(M)}catch(e){try{M=this.defaults.amdLanguageBase+M,U=u.loadPath(M)}catch(e){d.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+M+'" could not be automatically loaded. A fallback will be used instead.');continue}}k.extend(U)}d.translations=k}else{var H=u.loadPath(this.defaults.amdLanguageBase+"en"),z=new u(d.language);z.extend(H),d.translations=z}return d},T.prototype.reset=function(){function t(e){function t(e){return d[e]||e}return e.replace(/[^\u0000-\u007E]/g,t)}function n(r,i){if(""===e.trim(r.term))return i;if(i.children&&i.children.length>0){for(var o=e.extend(!0,{},i),s=i.children.length-1;s>=0;s--){var a=i.children[s],l=n(r,a);null==l&&o.children.splice(s,1)}return o.children.length>0?o:n(r,o)}var c=t(i.text).toUpperCase(),u=t(r.term).toUpperCase();return c.indexOf(u)>-1?i:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:c.escapeMarkup,language:S,matcher:n,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(e){return e},templateResult:function(e){return e.text},templateSelection:function(e){return e.text},theme:"default",width:"resolve"}},T.prototype.set=function(t,n){var r=e.camelCase(t),i={};i[r]=n;var o=c._convertData(i);e.extend(this.defaults,o)};var D=new T;return D}),t.define("select2/options",["require","jquery","./defaults","./utils"],function(e,t,n,r){function i(t,i){if(this.options=t,null!=i&&this.fromElement(i),this.options=n.apply(this.options),i&&i.is("input")){var o=e(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=r.Decorate(this.options.dataAdapter,o)}}return i.prototype.fromElement=function(e){var n=["select2"];null==this.options.multiple&&(this.options.multiple=e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=e.prop("disabled")),null==this.options.language&&(e.prop("lang")?this.options.language=e.prop("lang").toLowerCase():e.closest("[lang]").prop("lang")&&(this.options.language=e.closest("[lang]").prop("lang"))),null==this.options.dir&&(e.prop("dir")?this.options.dir=e.prop("dir"):e.closest("[dir]").prop("dir")?this.options.dir=e.closest("[dir]").prop("dir"):this.options.dir="ltr"),e.prop("disabled",this.options.disabled),e.prop("multiple",this.options.multiple),e.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),e.data("data",e.data("select2Tags")),e.data("tags",!0)),e.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),e.attr("ajax--url",e.data("ajaxUrl")),e.data("ajax--url",e.data("ajaxUrl")));var i={};i=t.fn.jquery&&"1."==t.fn.jquery.substr(0,2)&&e[0].dataset?t.extend(!0,{},e[0].dataset,e.data()):e.data();var o=t.extend(!0,{},i);o=r._convertData(o);for(var s in o)t.inArray(s,n)>-1||(t.isPlainObject(this.options[s])?t.extend(this.options[s],o[s]):this.options[s]=o[s]);return this},i.prototype.get=function(e){return this.options[e]},i.prototype.set=function(e,t){this.options[e]=t},i}),t.define("select2/core",["jquery","./options","./utils","./keys"],function(e,t,n,r){var i=function(e,n){null!=e.data("select2")&&e.data("select2").destroy(),this.$element=e,this.id=this._generateId(e),n=n||{},this.options=new t(n,e),i.__super__.constructor.call(this);var r=e.attr("tabindex")||0;e.data("old-tabindex",r),e.attr("tabindex","-1");var o=this.options.get("dataAdapter");this.dataAdapter=new o(e,this.options);var s=this.render();this._placeContainer(s);var a=this.options.get("selectionAdapter");this.selection=new a(e,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,s);var l=this.options.get("dropdownAdapter");this.dropdown=new l(e,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,s);var c=this.options.get("resultsAdapter");this.results=new c(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var u=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(e){u.trigger("selection:update",{data:e})}),e.addClass("select2-hidden-accessible"),e.attr("aria-hidden","true"),this._syncAttributes(),e.data("select2",this)};return n.Extend(i,n.Observable),i.prototype._generateId=function(e){var t="";return t=null!=e.attr("id")?e.attr("id"):null!=e.attr("name")?e.attr("name")+"-"+n.generateChars(2):n.generateChars(4),t=t.replace(/(:|\.|\[|\]|,)/g,""),t="select2-"+t},i.prototype._placeContainer=function(e){e.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get("width"));null!=t&&e.css("width",t)},i.prototype._resolveWidth=function(e,t){var n=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==t){var r=this._resolveWidth(e,"style");return null!=r?r:this._resolveWidth(e,"element")}if("element"==t){var i=e.outerWidth(!1);return i<=0?"auto":i+"px"}if("style"==t){var o=e.attr("style");if("string"!=typeof o)return null;for(var s=o.split(";"),a=0,l=s.length;a<l;a+=1){var c=s[a].replace(/\s/g,""),u=c.match(n);if(null!==u&&u.length>=1)return u[1]}return null}return t},i.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},i.prototype._registerDomEvents=function(){var t=this;this.$element.on("change.select2",function(){t.dataAdapter.current(function(e){t.trigger("selection:update",{data:e})})}),this.$element.on("focus.select2",function(e){t.trigger("focus",e)}),this._syncA=n.bind(this._syncAttributes,this),this._syncS=n.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var r=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=r?(this._observer=new r(function(n){e.each(n,t._syncA),e.each(n,t._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",t._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",t._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",t._syncS,!1))},i.prototype._registerDataEvents=function(){var e=this;this.dataAdapter.on("*",function(t,n){e.trigger(t,n)})},i.prototype._registerSelectionEvents=function(){var t=this,n=["toggle","focus"];this.selection.on("toggle",function(){t.toggleDropdown()}),this.selection.on("focus",function(e){t.focus(e)}),this.selection.on("*",function(r,i){e.inArray(r,n)===-1&&t.trigger(r,i)})},i.prototype._registerDropdownEvents=function(){var e=this;this.dropdown.on("*",function(t,n){e.trigger(t,n)})},i.prototype._registerResultsEvents=function(){var e=this;this.results.on("*",function(t,n){e.trigger(t,n)})},i.prototype._registerEvents=function(){var e=this;this.on("open",function(){e.$container.addClass("select2-container--open")}),this.on("close",function(){e.$container.removeClass("select2-container--open")}),this.on("enable",function(){e.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){e.$container.addClass("select2-container--disabled")}),this.on("blur",function(){e.$container.removeClass("select2-container--focus")}),this.on("query",function(t){e.isOpen()||e.trigger("open",{}),this.dataAdapter.query(t,function(n){e.trigger("results:all",{data:n,query:t})})}),this.on("query:append",function(t){this.dataAdapter.query(t,function(n){e.trigger("results:append",{data:n,query:t})})}),this.on("keypress",function(t){var n=t.which;e.isOpen()?n===r.ESC||n===r.TAB||n===r.UP&&t.altKey?(e.close(),t.preventDefault()):n===r.ENTER?(e.trigger("results:select",{}),t.preventDefault()):n===r.SPACE&&t.ctrlKey?(e.trigger("results:toggle",{}),t.preventDefault()):n===r.UP?(e.trigger("results:previous",{}),t.preventDefault()):n===r.DOWN&&(e.trigger("results:next",{}),t.preventDefault()):(n===r.ENTER||n===r.SPACE||n===r.DOWN&&t.altKey)&&(e.open(),t.preventDefault())})},i.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},i.prototype._syncSubtree=function(e,t){var n=!1,r=this;if(!e||!e.target||"OPTION"===e.target.nodeName||"OPTGROUP"===e.target.nodeName){if(t)if(t.addedNodes&&t.addedNodes.length>0)for(var i=0;i<t.addedNodes.length;i++){var o=t.addedNodes[i];o.selected&&(n=!0)}else t.removedNodes&&t.removedNodes.length>0&&(n=!0);else n=!0;n&&this.dataAdapter.current(function(e){r.trigger("selection:update",{data:e})})}},i.prototype.trigger=function(e,t){var n=i.__super__.trigger,r={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===t&&(t={}),e in r){var o=r[e],s={prevented:!1,name:e,args:t};if(n.call(this,o,s),s.prevented)return void(t.prevented=!0)}n.call(this,e,t)},i.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},i.prototype.open=function(){this.isOpen()||this.trigger("query",{})},i.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},i.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},i.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},i.prototype.focus=function(e){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},i.prototype.enable=function(e){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=e&&0!==e.length||(e=[!0]);var t=!e[0];this.$element.prop("disabled",t)},i.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var e=[];return this.dataAdapter.current(function(t){e=t}),e},i.prototype.val=function(t){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==t||0===t.length)return this.$element.val();var n=t[0];e.isArray(n)&&(n=e.map(n,function(e){return e.toString()})),this.$element.val(n).trigger("change")},i.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),
this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},i.prototype.render=function(){var t=e('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return t.attr("dir",this.options.get("dir")),this.$container=t,this.$container.addClass("select2-container--"+this.options.get("theme")),t.data("element",this.$element),t},i}),t.define("jquery-mousewheel",["jquery"],function(e){return e}),t.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(e,t,n,r){if(null==e.fn.select2){var i=["open","close","destroy"];e.fn.select2=function(t){if(t=t||{},"object"==typeof t)return this.each(function(){var r=e.extend(!0,{},t),i=new n(e(this),r)}),this;if("string"==typeof t){var r,o=Array.prototype.slice.call(arguments,1);return this.each(function(){var n=e(this).data("select2");null==n&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2."),r=n[t].apply(n,o)}),e.inArray(t,i)>-1?this:r}throw new Error("Invalid arguments for Select2: "+t)}}return null==e.fn.select2.defaults&&(e.fn.select2.defaults=r),n}),{define:t.define,require:t.require}}(),n=t.require("jquery.select2");return e.fn.select2.amd=t,n}),"undefined"==typeof Package&&(Package={}),Package["natestrauser:select2"]={}}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,n=Package.meteor.meteorEnv,i=Package.tracker.Tracker,r=Package.tracker.Deps,o=Package.underscore._,a=Package.check.check,s=Package.check.Match,u=Package.random.Random,l,c,f,d,p,m,y;(function(){String.prototype.startsWith||(String.prototype.startsWith=function(e,t){return t=t||0,this.indexOf(e,t)===t}),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")})}).call(this),function(){function e(e){return e=e||"",e=e.trim(),e[0]&&(e=e[0].toUpperCase()+e.substr(1).toLowerCase()),e}function t(e){return e=e||"",e=e.toString(),e=e.trim(),e=e.replace(/([a-z\d])([A-Z]+)/g,"$1_$2"),e=e.replace(/[-\s]+/g,"_").toLowerCase()}function n(e){var t=e.lastIndexOf("."),n=e.substring(t,e.length);return t===-1?"":n}l=function i(r){return r=r||"",r=r.toString(),r=r.trim(),r=r.replace(n(r),""),r=t(r),r=r.replace(/[\W_]+/g," "),e(r)}}.call(this),function(){var e=function(e){return e===Object(e)};"function"!=typeof Object.getPrototypeOf&&("object"==typeof"".__proto__?Object.getPrototypeOf=function(e){return e.__proto__}:Object.getPrototypeOf=function(e){return e.constructor.prototype});var t=function(t){return e(t)&&Object.getPrototypeOf(t)===Object.prototype},n=function e(t){return"string"!=typeof t?null:t.replace(/\.[0-9]+\./g,".$.").replace(/\.[0-9]+$/g,".$")},i=function e(t,n){return"$each"===n?t:t?t+"."+n:n},r=function e(t){var n=t.slice(0,t.indexOf("["));return"$"===n.substring(0,1)?n:null};c=function(e,a){function s(e,r,u,c,f,d){!c&&u&&"$"===u.substring(0,1)&&(c=u,u=null);var p=!1,m,y=!1;u&&(f||("$push"===c||"$addToSet"===c||"$pop"===c?(t(e)&&"$each"in e?(e=e.$each,r+="[$each]"):u+=".0",f=!0):"$pull"===c&&(u+=".0",t(e)&&(y=!0),f=!0)),m=n(u),p=o.contains(a,m),r&&(l._affectedKeys[r]=u,l._genericAffectedKeys[r]=m,d&&l._positionsInsideArrays.push(r))),y||(o.isArray(e)&&!o.isEmpty(e)?(r&&l._parentPositions.push(r),o.each(e,function(e,t){s(e,r?r+"["+t+"]":t,u+"."+t,c,f,!0)})):(t(e)&&!p||!r)&&(r&&!o.isEmpty(e)&&(l._parentPositions.push(r),l._objectPositions.push(r)),o.each(e,function(t,n){void 0===t?delete e[n]:"$slice"!==n&&s(t,r?r+"["+n+"]":n,i(u,n),c,f,d)})))}function u(){l._affectedKeys={},l._genericAffectedKeys={},l._parentPositions=[],l._positionsInsideArrays=[],l._objectPositions=[],s(l._obj)}var l=this;l._obj=e,l._affectedKeys={},l._genericAffectedKeys={},l._parentPositions=[],l._positionsInsideArrays=[],l._objectPositions=[],s(l._obj),l.forEachNode=function(e,t){if("function"!=typeof e)throw new Error("filter requires a loop function");t=o.extend({endPointsOnly:!0},t);var n={};o.each(l._affectedKeys,function(i,a){t.endPointsOnly&&o.contains(l._parentPositions,a)||e.call({value:l.getValueForPosition(a),operator:r(a),position:a,key:i,genericKey:l._genericAffectedKeys[a],updateValue:function(e){n[a]=e},remove:function(){n[a]=void 0}})}),o.each(n,function(e,t){l.setValueForPosition(t,e)})},l.getValueForPosition=function(e){for(var n,i=e.split("["),r=l._obj,a=0,s=i.length;a<s;a++)if(n=i[a],"]"===n.slice(-1)&&(n=n.slice(0,-1)),r=r[n],!o.isArray(r)&&!t(r)&&a<s-1)return;return r},l.setValueForPosition=function(e,n){for(var i,r,a=e.split("["),s=l._obj,c=0,f=a.length;c<f;c++)if(r=a[c],"]"===r.slice(-1)&&(r=r.slice(0,-1)),c===f-1)s[r]=n,void 0===n&&delete s[r];else if(void 0===s[r]&&void 0!==n&&(i=a[c+1],i=parseInt(i,10),s[r]=isNaN(i)?{}:[]),s=s[r],!o.isArray(s)&&!t(s)&&c<f-1)return;u()},l.removeValueForPosition=function(e){l.setValueForPosition(e,void 0)},l.getKeyForPosition=function(e){return l._affectedKeys[e]},l.getGenericKeyForPosition=function(e){return l._genericAffectedKeys[e]},l.getInfoForKey=function(e){var t=l.getPositionForKey(e);if(t)return{value:l.getValueForPosition(t),operator:r(t)};for(var n=l.getPositionsForGenericKey(e+".$"),i,o,a=0,s=n.length;a<s;a++)if(i=n[a],o=l.getValueForPosition(i)||l.getValueForPosition(i.slice(0,i.lastIndexOf("["))))return{value:o,operator:r(i)}},l.getPositionForKey=function(e){for(var t in l._affectedKeys)if(l._affectedKeys.hasOwnProperty(t)&&l._affectedKeys[t]===e)return t},l.getPositionsForGenericKey=function(e){var t=[];for(var n in l._genericAffectedKeys)l._genericAffectedKeys.hasOwnProperty(n)&&l._genericAffectedKeys[n]===e&&t.push(n);return t},l.getValueForKey=function(e){var t=l.getPositionForKey(e);if(t)return l.getValueForPosition(t)},l.addKey=function(e,t,n){var i=n?n+"["+e+"]":c._keyToPosition(e);l.setValueForPosition(i,t)},l.removeGenericKeys=function(e){for(var t in l._genericAffectedKeys)l._genericAffectedKeys.hasOwnProperty(t)&&o.contains(e,l._genericAffectedKeys[t])&&l.removeValueForPosition(t)},l.removeGenericKey=function(e){for(var t in l._genericAffectedKeys)l._genericAffectedKeys.hasOwnProperty(t)&&l._genericAffectedKeys[t]===e&&l.removeValueForPosition(t)},l.removeKey=function(e){for(var t in l._affectedKeys)l._affectedKeys.hasOwnProperty(t)&&l._affectedKeys[t]===e&&l.removeValueForPosition(t)},l.removeKeys=function(e){for(var t=0,n=e.length;t<n;t++)l.removeKey(e[t])},l.filterGenericKeys=function(e){var t,n=[],i=[];for(var r in l._genericAffectedKeys)l._genericAffectedKeys.hasOwnProperty(r)&&(t=l._genericAffectedKeys[r],o.contains(n,t)||(n.push(t),t&&!e(t)&&i.push(t)));o.each(i,function(e){l.removeGenericKey(e)})},l.setValueForKey=function(e,t){for(var n in l._affectedKeys)l._affectedKeys.hasOwnProperty(n)&&l._affectedKeys[n]===e&&l.setValueForPosition(n,t)},l.setValueForGenericKey=function(e,t){for(var n in l._genericAffectedKeys)l._genericAffectedKeys.hasOwnProperty(n)&&l._genericAffectedKeys[n]===e&&l.setValueForPosition(n,t)},l.getObject=function(){return l._obj},l.getFlatObject=function(e){e=e||{};var t={};return o.each(l._affectedKeys,function(n,i){("string"!=typeof n||e.keepArrays!==!0||o.contains(l._positionsInsideArrays,i)||o.contains(l._objectPositions,i))&&(e.keepArrays||o.contains(l._parentPositions,i))||(t[n]=l.getValueForPosition(i))}),t},l.affectsKey=function(e){return!!l.getPositionForKey(e)},l.affectsGenericKey=function(e){for(var t in l._genericAffectedKeys)if(l._genericAffectedKeys.hasOwnProperty(t)&&l._genericAffectedKeys[t]===e)return!0;return!1},l.affectsGenericKeyImplicit=function(e){for(var t in l._genericAffectedKeys)if(l._genericAffectedKeys.hasOwnProperty(t)){var n=l._genericAffectedKeys[t];if(n===e)return!0;if(n.substring(0,e.length+1)===e+".")return!0;var i=e.slice(-2);if(".$"===i&&e.slice(0,-2)===n)return!0}return!1}},c.expandKey=function(e,t,n){for(var i,r,o=t.split("["),a=n,s=0,u=o.length;s<u;s++)r=o[s],"]"===r.slice(-1)&&(r=r.slice(0,-1)),s===u-1?(a[r]=e,void 0===e&&delete a[r]):(i=o[s+1],i=parseInt(i,10),a[r]||(a[r]=isNaN(i)?{}:[])),a=a[r]},c._keyToPosition=function e(t,n){var i="";return o.each(t.split("."),function(e,t){i+=0!==t||n?"["+e+"]":e}),i},c._positionToKey=function e(t){var n=new c({});n.setValueForPosition(t,1);var i=n.getKeyForPosition(t);return n=null,i}}.call(this),function(){f={appendAffectedKey:function e(t,n){return"$each"===n?t:t?t+"."+n:n},shouldCheck:function e(t){if("$pushAll"===t)throw new Error("$pushAll is not supported; use $push + $each");return!o.contains(["$pull","$pullAll","$pop","$slice"],t)},errorObject:function e(t,n,i){return{name:n,type:t,value:i}},isBasicObject:function e(t){return o.isObject(t)&&Object.getPrototypeOf(t)===Object.prototype},safariBugFix:function e(t){return"undefined"!=typeof Uint8Array&&t===Uint8Array||"undefined"!=typeof Uint16Array&&t===Uint16Array||"undefined"!=typeof Uint32Array&&t===Uint32Array||"undefined"!=typeof Uint8ClampedArray&&t===Uint8ClampedArray},isNotNullOrUndefined:function e(t){return void 0!==t&&null!==t},extractOp:function e(t){var n=t.slice(0,t.indexOf("["));return"$"===n.substring(0,1)?n:null},deleteIfPresent:function e(t,n){n in t&&delete t[n]},looksLikeModifier:function e(t){for(var n in t)if(t.hasOwnProperty(n)&&"$"===n.substring(0,1))return!0;return!1},dateToDateString:function e(t){var n=t.getUTCMonth()+1;n<10&&(n="0"+n);var i=t.getUTCDate();return i<10&&(i="0"+i),t.getUTCFullYear()+"-"+n+"-"+i}}}.call(this),function(){function t(t,n,i){function r(e){var r=this.key;if(!o.contains(s,r)){var a=r.lastIndexOf("."),u=a===-1?"":r.slice(0,a+1),l=!1,c=e.call(o.extend({isSet:void 0!==this.value,unset:function(){l=!0},value:this.value,operator:this.operator,field:function(e){var n=t.getInfoForKey(e)||{};return{isSet:void 0!==n.value,value:n.value,operator:n.operator||null}},siblingField:function(e){var n=t.getInfoForKey(u+e)||{};return{isSet:void 0!==n.value,value:n.value,operator:n.operator||null}}},i||{}),t.getObject());if(s.push(r),void 0===c)return void(l&&t.removeValueForPosition(this.position));var f,d;if(o.isObject(c))for(var p in c)if(c.hasOwnProperty(p)&&"$"===p.substring(0,1)){f=p,d=c[p];break}!f&&n&&"$"!==this.position.slice(0,1)&&(f="$set",d=c),f?(t.removeValueForPosition(this.position),t.setValueForPosition(f+"["+r+"]",d)):t.setValueForPosition(this.position,c)}}var a=this,s=[];e.isClient&&void 0===i.userId&&(i.userId=e.userId&&e.userId()||null),o.each(a._autoValues,function(e,i){var a,s,u,l;if(i.indexOf("$")!==-1){var d=i.slice(0,i.lastIndexOf("$")+1);u=i.slice(d.length+1),a=c._keyToPosition(u,!0),u="."+u,l=t.getPositionsForGenericKey(d)}else l=t.getPositionsForGenericKey(i),l.length?(s=i,u="",a=""):(s=i,u="",a="",l=n?["$set["+i+"]"]:[c._keyToPosition(i)]);o.each(l,function(n){r.call({key:(s||c._positionToKey(n))+u,value:t.getValueForPosition(n+a),operator:f.extractOp(n),position:n+a},e)})})}function n(t,n){e.startup(function(){r.autorun(function(){t.isValid()||console.log('SimpleSchema invalid keys for "'+n+'" context:',t.invalidKeys())})})}var i={type:s.Any,label:s.Optional(s.OneOf(String,Function)),optional:s.Optional(s.OneOf(Boolean,Function)),min:s.Optional(s.OneOf(Number,Date,Function)),max:s.Optional(s.OneOf(Number,Date,Function)),minCount:s.Optional(s.OneOf(Number,Function)),maxCount:s.Optional(s.OneOf(Number,Function)),allowedValues:s.Optional(s.OneOf([s.Any],Function)),decimal:s.Optional(Boolean),exclusiveMax:s.Optional(Boolean),exclusiveMin:s.Optional(Boolean),regEx:s.Optional(s.OneOf(RegExp,[RegExp])),custom:s.Optional(Function),blackbox:s.Optional(Boolean),autoValue:s.Optional(Function),defaultValue:s.Optional(s.Any),trim:s.Optional(Boolean)},u=function(e,t){var n;if(o.isArray(e)||o.isObject(e)&&!(e instanceof Date))return e;if(t===String)return"undefined"!=typeof e&&null!==e&&"string"!=typeof e?e.toString():e;if(t===Number){if("string"==typeof e&&!o.isEmpty(e)){var i=Number(e);return isNaN(i)?e:i}return e}if(t===Date){if("string"==typeof e&&(n=Date.parse(e),isNaN(n)===!1))return new Date(n);if("number"==typeof e)return new Date(e)}return e},p=function(e){return o.each(e,function(t,n){var i,r;if(t){if(s.test(t.type,d))i=".",r=t.type,t.type=Object;else{if(!s.test(t.type,[d]))return;i=".$.",r=t.type[0],t.type=[Object]}o.each(r._schema,function(t,r){var o=n+i+r;o in e||(e[o]=t)})}}),e},m=function(e){o.each(e,function(t,n){if(o.isArray(t.type)||t.type===Array){var i=n+".$";i in e||(e[i]={}),o.isArray(t.type)&&(e[i].type=t.type[0]),t.label&&(e[i].label=t.label),e[i].optional=!0,"undefined"!=typeof t.min&&(e[i].min=t.min),"undefined"!=typeof t.max&&(e[i].max=t.max),"undefined"!=typeof t.allowedValues&&(e[i].allowedValues=t.allowedValues),"undefined"!=typeof t.decimal&&(e[i].decimal=t.decimal),"undefined"!=typeof t.exclusiveMax&&(e[i].exclusiveMax=t.exclusiveMax),"undefined"!=typeof t.exclusiveMin&&(e[i].exclusiveMin=t.exclusiveMin),"undefined"!=typeof t.regEx&&(e[i].regEx=t.regEx),"undefined"!=typeof t.blackbox&&(e[i].blackbox=t.blackbox),t.type=Array,o.each(["min","max","allowedValues","decimal","exclusiveMax","exclusiveMin","regEx","blackbox"],function(e){f.deleteIfPresent(t,e)})}})},v=function(e){var t=[],n=[],i,r,a,s;for(o.each(e,function(e,r){for(var o=r.indexOf(".");o!==-1;)i=r.substring(0,o),".$"===i.substring(i.length-2)?o=-1:".$."===r.substring(o,o+3)?(t.push(i),o=r.indexOf(".",o+3)):(n.push(i),o=r.indexOf(".",o+1))}),a=0,s=t.length;a<s;a++)r=t[a],r in e||(e[r]={type:[Object],optional:!0});for(a=0,s=n.length;a<s;a++)r=n[a],r in e||(e[r]={type:Object,optional:!0});return m(e),e},h=function(e){var t={};return o.each(e,function(e){e=s.test(e,d)?e._schema:v(p(e)),o.each(e,function(e,n){t[n]=t[n]||{},o.extend(t[n],e)})}),e.length&&m(t),t},g=function(e,t){var n,i,r={},a;return o.each(e,function(e,s){e.type===Object&&(n=s+".",a=[],o.each(t,function(e){e.startsWith(n)&&(i=e.substring(n.length),i.indexOf(".")===-1&&a.push(i))}),r[n]=a)}),r},x=function(e){var t=e,n=t.lastIndexOf(".");if(n!==-1&&(t=t.substring(n+1),"$"===t)){var i=e.split(".");t=i[i.length-2]}return"_id"===t?"ID":l(t)};d=function(e,t){var n=this,a=[],u;t=t||{},e=e||{},o.isArray(e)||(e=[e]),n._schema=h(e),n._schemaKeys=[],n._autoValues={},n._blackboxKeys=[],n._validators=[],n._messages={},n._depsMessages=new r.Dependency,n._depsLabels={},o.each(n._schema,function(e,t){if(!s.test(e,i))throw new Error("Invalid definition for "+t+" field.");if(u=t.split(".")[0],n._schemaKeys.push(t),"defaultValue"in e)if("autoValue"in e)console.warn('SimpleSchema: Found both autoValue and defaultValue options for "'+t+'". Ignoring defaultValue.');else{if(".$"===t.slice(-2))throw new Error('An array item field (one that ends with ".$") cannot have defaultValue.');n._autoValues[t]=function e(t){return function(){if(null===this.operator&&!this.isSet)return t}}(e.defaultValue)}if("autoValue"in e){if(".$"===t.slice(-2))throw new Error('An array item field (one that ends with ".$") cannot have autoValue.');n._autoValues[t]=e.autoValue}n._depsLabels[t]=new r.Dependency,e.blackbox===!0&&n._blackboxKeys.push(t),o.contains(a,u)||a.push(u)}),n._firstLevelSchemaKeys=a,n._objectKeys=g(n._schema,n._schemaKeys),n._validationContexts={}},d.extendOptions=function(e){o.extend(i,e)};var b="(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z](?:[a-z-]*[a-z])?",_="(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.|$))+",K="(?:(?:[0-1]?\\d{1,2}|2[0-4]\\d|25[0-5])(?:\\.|$)){4}",O="(?:(?:[\\dA-Fa-f]{1,4}(?::|$)){8}|(?=(?:[^:\\s]|:[^:\\s])*::(?:[^:\\s]|:[^:\\s])*$)[\\dA-Fa-f]{0,4}(?:::?(?:[\\dA-Fa-f]{1,4}|$)){1,6})",$="(?:"+[_,K,O].join("|")+")";d.RegEx={Email:/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Domain:new RegExp("^"+b+"$"),WeakDomain:new RegExp("^"+$+"$"),IP:new RegExp("^(?:"+K+"|"+O+")$"),IPv4:new RegExp("^"+K+"$"),IPv6:new RegExp("^"+O+"$"),Url:/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/i,Id:/^[23456789ABCDEFGHJKLMNPQRSTWXYZabcdefghijkmnopqrstuvwxyz]{17}$/,ZipCode:/^\d{5}(?:[-\s]\d{4})?$/,Phone:/^[0-9-٠-٩۰-۹]{2}$|^[+]*(?:[-x-―−ー--  ­ ().\[\]\/~*]*[0-9-٠-٩۰-۹]){3,}[-x-―−ー--  ­ ().\[\]\/~0-9-٠-٩۰-۹]*(?:;ext=([0-9-٠-٩۰-۹]{1,7})|[  \t,]*(?:e?xt(?:ensi(?:ó?|ó))?n?|??|[,x#~]|int|anexo|)[:\.]?[  \t,-]*([0-9-٠-٩۰-۹]{1,7})#?|[- ]+([0-9-٠-٩۰-۹]{1,5})#)?$/i},d._makeGeneric=function(e){return"string"!=typeof e?null:e.replace(/\.[0-9]+(?=\.|$)/g,".$")},d._depsGlobalMessages=new r.Dependency,d.prototype=new s.Where,d.prototype.condition=function(t){var n=this,i,r;if(o.each(t,function(e,t){"$"===t.substring(0,1)?i=!0:r=!0}),i&&r)throw new s.Error("Object cannot contain modifier operators alongside other keys");var a=n.newContext();if(!a.validate(t,{modifier:i,filter:!1,autoConvert:!1})){var u=a.getErrorObject(),l=new s.Error(u.message);throw l.invalidKeys=u.invalidKeys,e.isServer&&(l.sanitizedError=u.sanitizedError),l}return!0},d.prototype.namedContext=function(t){var i=this;return"string"!=typeof t&&(t="default"),i._validationContexts[t]||(i._validationContexts[t]=new y(i),d.debug&&e.isClient&&r.nonreactive(function(){n(i._validationContexts[t],t)})),i._validationContexts[t]},d._validators=[],d.addValidator=function(e){d._validators.push(e)},d.prototype.addValidator=function(e){this._validators.push(e)},d.prototype.pick=function(){var e=this,t=o.toArray(arguments);t.unshift(e._schema);var n=o.pick.apply(null,t);return new d(n)},d.prototype.omit=function(){var e=this,t=o.toArray(arguments);t.unshift(e._schema);var n=o.omit.apply(null,t);return new d(n)},d.prototype.clean=function(e,n){var i=this;if(n=o.extend({filter:!0,autoConvert:!0,removeEmptyStrings:!0,trimStrings:!0,getAutoValues:!0,isModifier:!1,extendAutoValueContext:{}},n||{}),"$pushAll"in e){console.warn("SimpleSchema.clean: $pushAll is deprecated; converting to $push with $each"),e.$push=e.$push||{};for(var r in e.$pushAll){e.$push[r]=e.$push[r]||{},e.$push[r].$each=e.$push[r].$each||[];for(var a=0,s=e.$pushAll[r].length;a<s;a++)e.$push[r].$each.push(e.$pushAll[r][a]);delete e.$pushAll}}var l=new c(e,i._blackboxKeys);if((n.filter||n.autoConvert||n.removeEmptyStrings||n.trimStrings)&&l.forEachNode(function(){var e=this.genericKey,t,r,o;if(e){if(r=i._schema[e],o=this.value,n.filter&&"$unset"!==this.operator&&!i.allowsKey(e))return"[$each]"===this.position.slice(-7)?l.removeValueForPosition(this.position.slice(0,-7)):this.remove(),void(d.debug&&console.info('SimpleSchema.clean: filtered out value that would have affected key "'+e+'", which is not allowed by the schema'));if(void 0!==o){var a=!1;if(n.autoConvert&&"$unset"!==this.operator&&r){var s=u(o,r.type);n.trimStrings&&"string"==typeof s&&(s=s.trim()),void 0!==s&&s!==o&&(!n.removeEmptyStrings||this.operator&&"$set"!==this.operator||"string"!=typeof s||s.length||(s=void 0,"$set"===this.operator&&this.position.match(/\[.+?\]/g).length<2&&(t=this.position.replace("$set","$unset"),l.setValueForPosition(t,""))),d.debug&&console.info("SimpleSchema.clean: autoconverted value "+o+" from "+typeof o+" to "+typeof s+" for "+e),this.updateValue(s),a=!0)}a||(n.trimStrings&&"string"==typeof o&&(!r||r&&r.trim!==!1)&&this.updateValue(o.trim()),!n.removeEmptyStrings||this.operator&&"$set"!==this.operator||"string"!=typeof o||o.length||(this.remove(),"$set"===this.operator&&this.position.match(/\[.+?\]/g).length<2&&(t=this.position.replace("$set","$unset"),l.setValueForPosition(t,""))))}}},{endPointsOnly:!1}),n.getAutoValues&&t.call(i,l,n.isModifier,n.extendAutoValueContext),n.isModifier)for(var f in e)e.hasOwnProperty(f)&&o.isEmpty(e[f])&&delete e[f];return e},d.prototype.schema=function(e){var t=this;return null!==e&&void 0!==e?t._schema[d._makeGeneric(e)]:t._schema},d.prototype.getDefinition=function(e,t,n){var i=this,r=i.schema(e);if(r)return r=o.isArray(t)?o.pick(r,t):o.clone(r),o.each(["min","max","minCount","maxCount","allowedValues","optional","label"],function(e){o.isFunction(r[e])&&(r[e]=r[e].call(n||{}))}),r.label=r.label||x(e),r},d.prototype.keyIsInBlackBox=function(e){var t=this,n=d._makeGeneric(e),i,r;do i=n.lastIndexOf("."),i!==-1&&(n=n.slice(0,i),r=t.getDefinition(n));while(i!==-1&&!r);return!(!r||!r.blackbox)},d.prototype.labels=function(e){var t=this;o.each(e,function(e,n){(o.isString(e)||o.isFunction(e))&&n in t._schema&&(t._schema[n].label=e,t._depsLabels[n]&&t._depsLabels[n].changed())})},d.prototype.label=function(e){var t=this;if(null===e||void 0===e){var n={};return o.each(t.schema(),function(e,i){n[i]=t.label(i)}),n}var i=t.getDefinition(e);if(i){var r=d._makeGeneric(e);return t._depsLabels[r]&&t._depsLabels[r].depend(),i.label}return null},d._globalMessages={required:"[label] is required",minString:"[label] must be at least [min] characters",maxString:"[label] cannot exceed [max] characters",minNumber:"[label] must be at least [min]",maxNumber:"[label] cannot exceed [max]",minNumberExclusive:"[label] must be greater than [min]",maxNumberExclusive:"[label] must be less than [max]",minDate:"[label] must be on or after [min]",maxDate:"[label] cannot be after [max]",badDate:"[label] is not a valid date",minCount:"You must specify at least [minCount] values",maxCount:"You cannot specify more than [maxCount] values",noDecimal:"[label] must be an integer",notAllowed:"[value] is not an allowed value",expectedString:"[label] must be a string",expectedNumber:"[label] must be a number",expectedBoolean:"[label] must be a boolean",expectedArray:"[label] must be an array",expectedObject:"[label] must be an object",expectedConstructor:"[label] must be a [type]",regEx:[{msg:"[label] failed regular expression validation"},{exp:d.RegEx.Email,msg:"[label] must be a valid e-mail address"},{exp:d.RegEx.WeakEmail,msg:"[label] must be a valid e-mail address"},{exp:d.RegEx.Domain,msg:"[label] must be a valid domain"},{exp:d.RegEx.WeakDomain,msg:"[label] must be a valid domain"},{exp:d.RegEx.IP,msg:"[label] must be a valid IPv4 or IPv6 address"},{exp:d.RegEx.IPv4,msg:"[label] must be a valid IPv4 address"},{exp:d.RegEx.IPv6,msg:"[label] must be a valid IPv6 address"},{exp:d.RegEx.Url,msg:"[label] must be a valid URL"},{exp:d.RegEx.Id,msg:"[label] must be a valid alphanumeric ID"}],keyNotInSchema:"[key] is not allowed by the schema"},d.messages=function(e){o.extend(d._globalMessages,e),d._depsGlobalMessages.changed()},d.prototype.messages=function(e){var t=this;o.extend(t._messages,e),t._depsMessages.changed()},d.prototype.messageForError=function(e,t,n,i){function r(t){if("regEx"!==e||!o.isArray(t))return t;var n;return l&&(n=o.find(t,function(e){return e.exp&&e.exp.toString()===l})),n||(n=o.findWhere(t,{exp:null}),n||(n=o.findWhere(t,{exp:void 0}))),n?n.msg:null}var a=this;n=n||a.getDefinition(t,["regEx","label","minCount","maxCount","min","max","type"])||{};var s=e.indexOf("."),u=null;s!==-1&&(u=e.substring(s+1),u=parseInt(u,10),e=e.substring(0,s));var l;"regEx"===e&&(l=null===u||void 0===u||isNaN(u)?n.regEx:n.regEx[u],l&&(l=l.toString()));var c=e+" "+t,p=d._makeGeneric(t),m=e+" "+p;d._depsGlobalMessages.depend(),a._depsMessages.depend();var y=a._messages[c]||a._messages[m]||a._messages[e];if(y=r(y),y||(y=d._globalMessages[c]||d._globalMessages[m]||d._globalMessages[e],y=r(y)),!y)return"Unknown validation error";y=y.replace("[key]",t),y=y.replace("[label]",a.label(t)),"undefined"!=typeof n.minCount&&(y=y.replace("[minCount]",n.minCount)),"undefined"!=typeof n.maxCount&&(y=y.replace("[maxCount]",n.maxCount)),y=void 0!==i&&null!==i?y.replace("[value]",i.toString()):y.replace("[value]","null");var v=n.min,h=n.max;return n.type===Date||n.type===[Date]?("undefined"!=typeof v&&(y=y.replace("[min]",f.dateToDateString(v))),"undefined"!=typeof h&&(y=y.replace("[max]",f.dateToDateString(h)))):("undefined"!=typeof v&&(y=y.replace("[min]",v)),"undefined"!=typeof h&&(y=y.replace("[max]",h))),n.type instanceof Function&&(y=y.replace("[type]",n.type.name)),y},d.prototype.allowsKey=function(e){var t=this;return o.any(t._schemaKeys,function(n){if(n===e)return!0;if(t.schema(n).blackbox===!0){var i=n.length,r=e.slice(0,i+2),o=r.slice(0,-1);if(r===n+".$")return!1;if(o===n+".")return!0}return!1})},d.prototype.newContext=function(){return new y(this)},d.prototype.objectKeys=function(e){var t=this;return e?t._objectKeys[e+"."]||[]:t._firstLevelSchemaKeys},d.prototype.validate=function(e,t){if(Package.check&&Package["audit-argument-checks"])try{a(e)}catch(e){}var n=this.newContext(),i=n.validate(e,t);if(!i){var r=n.invalidKeys().map(function(e){return{name:e.name,type:e.type,details:{value:e.value}}}),o=n.keyErrorMessage(r[0].name);throw new Package["mdg:validation-error"].ValidationError(r,o)}},d.prototype.validator=function(e){var t=this;return e=e||{},function(n){e.clean===!0&&t.clean(n,e),t.validate(n)}}}.call(this),function(){function e(e,t,n){var i=e.type;if(i===String){if("string"!=typeof t)return"expectedString";if(null!==e.max&&e.max<t.length)return"maxString";if(null!==e.min&&e.min>t.length)return"minString";if(e.regEx instanceof RegExp&&!e.regEx.test(t))return"regEx";if(o.isArray(e.regEx)){var r;if(o.every(e.regEx,function(e,n){return!!e.test(t)||(r="regEx."+n,!1)}),r)return r}}else if(i===Number){if("number"!=typeof t||isNaN(t))return"expectedNumber";if("$inc"!==n&&null!==e.max&&(e.exclusiveMax?e.max<=t:e.max<t))return e.exclusiveMax?"maxNumberExclusive":"maxNumber";if("$inc"!==n&&null!==e.min&&(e.exclusiveMin?e.min>=t:e.min>t))return e.exclusiveMin?"minNumberExclusive":"minNumber";if(!e.decimal&&t.toString().indexOf(".")>-1)return"noDecimal"}else if(i===Boolean){if("boolean"!=typeof t)return"expectedBoolean"}else if(i===Object){if(!f.isBasicObject(t))return"expectedObject"}else if(i===Array){if(!o.isArray(t))return"expectedArray";if(null!==e.minCount&&t.length<e.minCount)return"minCount";if(null!==e.maxCount&&t.length>e.maxCount)return"maxCount"}else if(i instanceof Function||f.safariBugFix(i)){if(!(t instanceof i))return"expectedConstructor";if(i===Date){if(isNaN(t.getTime()))return"badDate";if(o.isDate(e.min)&&e.min.getTime()>t.getTime())return"minDate";if(o.isDate(e.max)&&e.max.getTime()<t.getTime())return"maxDate"}}}p=function t(n,i,r,a,s,u){function l(t,i,r,a,l,p,m,h){if(!a)return void y.push(f.errorObject("keyNotInSchema",i,t,a,s));if(!p&&!a.optional&&(null===t||"$unset"===l||"$rename"===l||void 0===t&&(m||h||!l||"$set"===l)))return void y.push(f.errorObject("required",i,null,a,s));if("$rename"===l&&"string"==typeof t&&!s.allowsKey(t))return void y.push(f.errorObject("keyNotInSchema",t,null,null,s));if("$unset"!==l&&"$rename"!==l&&f.isNotNullOrUndefined(t)){var g=e(a,t,l);if(g)return void y.push(f.errorObject(g,i,t,a,s));if(a.allowedValues&&!o.contains(a.allowedValues,t))return void y.push(f.errorObject("notAllowed",i,t,a,s))}var x=i.lastIndexOf("."),b=x===-1?"":i.slice(0,x+1),_=a.custom?[a.custom]:[];_=_.concat(s._validators).concat(d._validators),o.every(_,function(e){var d=e.call(o.extend({key:i,genericKey:r,definition:a,isSet:void 0!==t,value:t,operator:l,field:function(e){v=v||new c(n,s._blackboxKeys);var t=v.getInfoForKey(e)||{};return{isSet:void 0!==t.value,value:t.value,operator:t.operator}},siblingField:function(e){v=v||new c(n,s._blackboxKeys);var t=v.getInfoForKey(b+e)||{};return{isSet:void 0!==t.value,value:t.value,operator:t.operator}}},u||{}));return"string"!=typeof d||(y.push(f.errorObject(d,i,t,a,s)),!1)})}function p(e,t,n,i,r,u){var c,m;if(t){if(s.keyIsInBlackBox(t))return;if(c=d._makeGeneric(t),m=s.getDefinition(t),!a||a===t||a===c){var y=o.some(i,function(e){return e.slice(0,t.length+1)===t+"."});l(e,t,c,m,n,y,r,u)}}if(void 0!==e&&null!==e||m&&(m.type!==Object||m.optional)||(e={}),o.isArray(e))o.each(e,function(e,r){p(e,t+"."+r,n,i)});else if(f.isBasicObject(e)&&(!m||!m.blackbox)){var v=o.keys(e),h=o.union(v,s.objectKeys(c));r=c&&".$"===c.slice(-2),o.each(h,function(o){p(e[o],f.appendAffectedKey(t,o),n,i,r,!0)})}}function m(e){if(o.isEmpty(e))throw new Error("When the modifier option is true, validation object must have at least one operator");var t=o.keys(e.$set||{}).concat(o.keys(e.$setOnInsert||{}));"$setOnInsert"in e&&(r&&(e.$set=e.$set||{},e.$set=o.extend(e.$set,e.$setOnInsert)),delete e.$setOnInsert),o.each(e,function(e,n){if("$"!==n.slice(0,1))throw new Error("When the modifier option is true, all validation object keys must be operators. Did you forget `$set`?");if(f.shouldCheck(n)){if(r&&"$set"===n){var i=o.keys(e);o.each(s.objectKeys(),function(e){o.contains(i,e)||p(void 0,e,n,t)})}o.each(e,function(e,i){"$push"!==n&&"$addToSet"!==n||(f.isBasicObject(e)&&"$each"in e?e=e.$each:i+=".0"),p(e,i,n,t)})}})}if(!o.isObject(n))throw new Error("The first argument of validate() or validateOne() must be an object");if(!i&&f.looksLikeModifier(n))throw new Error("When the validation object contains mongo operators, you must set the modifier option to true");var y=[],v;i?m(n):p(n);var h=[];return y=o.filter(y,function(e){return!o.contains(h,e.name)&&(h.push(e.name),!0)})}}.call(this),function(){function t(e,t,n){var i=e.type;if(i===String){if("string"!=typeof t)return"expectedString";if(null!==e.max&&e.max<t.length)return"maxString";if(null!==e.min&&e.min>t.length)return"minString";if(e.regEx instanceof RegExp&&!e.regEx.test(t))return"regEx";if(o.isArray(e.regEx)){var r;if(o.every(e.regEx,function(e,n){return!!e.test(t)||(r="regEx."+n,!1)}),r)return r}}else if(i===Number){if("number"!=typeof t||isNaN(t))return"expectedNumber";if("$inc"!==n&&null!==e.max&&(e.exclusiveMax?e.max<=t:e.max<t))return e.exclusiveMax?"maxNumberExclusive":"maxNumber";if("$inc"!==n&&null!==e.min&&(e.exclusiveMin?e.min>=t:e.min>t))return e.exclusiveMin?"minNumberExclusive":"minNumber";if(!e.decimal&&t.toString().indexOf(".")>-1)return"noDecimal"}else if(i===Boolean){if("boolean"!=typeof t)return"expectedBoolean"}else if(i===Object){if(!f.isBasicObject(t))return"expectedObject"}else if(i===Array){if(!o.isArray(t))return"expectedArray";if(null!==e.minCount&&t.length<e.minCount)return"minCount";if(null!==e.maxCount&&t.length>e.maxCount)return"maxCount"}else if(i instanceof Function||f.safariBugFix(i)){if(!(t instanceof i))return"expectedConstructor";if(i===Date){if(isNaN(t.getTime()))return"badDate";if(o.isDate(e.min)&&e.min.getTime()>t.getTime())return"minDate";if(o.isDate(e.max)&&e.max.getTime()<t.getTime())return"maxDate"}}}function n(t,n,i){var r=new e.Collection(null),a;if(i)a=u.id(),r.upsert({_id:a},t);else{var s=new c(t),l=new c({});o.each(n,function(e,t){var n;if(e.type===Array&&s.affectsGenericKey(t)?n=[]:e.optional||(n=e.type===Boolean||(e.type===Number?e.min||0:e.type===Date?e.min||new Date:e.type===Array?[]:e.type===Object?{}:"0")),void 0!==n){var i=t.replace(/\.\$/g,".0"),r=c._keyToPosition(i,!1);l.setValueForPosition(r,n)}}),l=l.getObject(),a=r.insert(l),r.update(a,t)}var f=r.findOne(a);return r.remove(a),n._id||delete f._id,f}m=function e(i,r,a,s,u,l){function p(e,n,r,a,s,p,m){if(!a)return void v.push(f.errorObject("keyNotInSchema",n,e,a,u));if(!(p||a.optional||null!==e&&void 0!==e))return void v.push(f.errorObject("required",n,null,a,u));if(f.isNotNullOrUndefined(e)){var y=t(a,e,s);if(y)return void v.push(f.errorObject(y,n,e,a,u));if(a.allowedValues&&!o.contains(a.allowedValues,e))return void v.push(f.errorObject("notAllowed",n,e,a,u))}var g=n.lastIndexOf("."),x=g===-1?"":n.slice(0,g+1),b=a.custom?[a.custom]:[];b=b.concat(u._validators).concat(d._validators),o.every(b,function(t){var d=t.call(o.extend({key:n,genericKey:r,definition:a,isSet:void 0!==e,value:e,operator:s,field:function(e){h=h||new c(i,u._blackboxKeys);var t=h.getInfoForKey(e)||{};return{isSet:void 0!==t.value,value:t.value,operator:t.operator}},siblingField:function(e){h=h||new c(i,u._blackboxKeys);var t=h.getInfoForKey(x+e)||{};return{isSet:void 0!==t.value,value:t.value,operator:t.operator}}},l||{}));return"string"!=typeof d||(v.push(f.errorObject(d,n,e,a,u)),!1)})}function m(e,t,n,i){var r,a;if(t){if(u.keyIsInBlackBox(t))return;r=d._makeGeneric(t),a=u.getDefinition(t),s&&s!==t&&s!==r||p(e,t,r,a,null,n,i)}if(void 0!==e&&null!==e||a&&(a.type!==Object||a.optional)||(e={}),o.isArray(e))o.each(e,function(e,n){m(e,t+"."+n)});else if(f.isBasicObject(e)&&(!a||!a.blackbox)){var l=o.keys(e),c=o.union(l,u._schemaKeys);i=r&&".$"===r.slice(-2),o.each(c,function(r){f.shouldCheck(r)&&m(e[r],f.appendAffectedKey(t,r),n,i)})}}if(!o.isObject(i))throw new Error("The first argument of validate() or validateOne() must be an object");if(r){if(o.isEmpty(i))throw new Error("When the modifier option is true, validation object must have at least one operator");var y=o.every(i,function(e,t){return"$"===t.substring(0,1)});if(!y)throw new Error("When the modifier option is true, all validation object keys must be operators");i=n(i,u.schema(),a)}else if(f.looksLikeModifier(i))throw new Error("When the validation object contains mongo operators, you must set the modifier option to true");var v=[],h;m(i);var g=[];return v=o.filter(v,function(e){return!o.contains(g,e.name)&&(g.push(e.name),!0)})}}.call(this),function(){function t(e,t,n,i,r,o){var a=!0,s=a?p:m;return s(e,t,n,i,r,o)}y=function e(t){var n=this;
n._simpleSchema=t,n._schema=t.schema(),n._schemaKeys=o.keys(n._schema),n._invalidKeys=[],n._deps={},n._depsAny=new r.Dependency,o.each(n._schemaKeys,function(e){n._deps[e]=new r.Dependency})},y.prototype.validate=function n(i,r){var a=this;r=o.extend({modifier:!1,upsert:!1,extendedCustomContext:{}},r||{}),e.isClient&&void 0===r.extendedCustomContext.userId&&(r.extendedCustomContext.userId=e.userId&&e.userId()||null);var s=t(i,r.modifier,r.upsert,null,a._simpleSchema,r.extendedCustomContext),u=o.pluck(a._invalidKeys,"name");a._invalidKeys=s;var l=o.pluck(a._invalidKeys,"name"),c=o.union(l,u);return a._markKeysChanged(c),0===a._invalidKeys.length},y.prototype.validateOne=function n(i,r,a){var s=this,u,l,c;a=o.extend({modifier:!1,upsert:!1,extendedCustomContext:{}},a||{}),e.isClient&&void 0===a.extendedCustomContext.userId&&(a.extendedCustomContext.userId=e.userId&&e.userId()||null);var f=t(i,a.modifier,a.upsert,r,s._simpleSchema,a.extendedCustomContext),d=[];for(u=0,l=s._invalidKeys.length;u<l;u++)c=s._invalidKeys[u],c.name!==r&&d.push(c);for(s._invalidKeys=d,u=0,l=f.length;u<l;u++)c=f[u],s._invalidKeys.push(c);return s._markKeysChanged([r]),!s._keyIsInvalid(r)},y.prototype.resetValidation=function e(){var t=this,n=o.pluck(t._invalidKeys,"name");t._invalidKeys=[],t._markKeysChanged(n)},y.prototype.isValid=function e(){var t=this;return t._depsAny.depend(),!t._invalidKeys.length},y.prototype.invalidKeys=function e(){var t=this;return t._depsAny.depend(),t._invalidKeys},y.prototype.addInvalidKeys=function e(t){var n=this;if(t&&t.length){var i=[];o.each(t,function(e){i.push(e.name),n._invalidKeys.push(e)}),n._markKeysChanged(i)}},y.prototype._markKeysChanged=function e(t){var n=this;t&&t.length&&(o.each(t,function(e){var t=d._makeGeneric(e);t in n._deps&&n._deps[t].changed()}),n._depsAny.changed())},y.prototype._getInvalidKeyObject=function e(t,n){var i=this;n=n||d._makeGeneric(t);var r=o.findWhere(i._invalidKeys,{name:t});return r||(r=o.findWhere(i._invalidKeys,{name:n})),r},y.prototype._keyIsInvalid=function e(t,n){return!!this._getInvalidKeyObject(t,n)},y.prototype.keyIsInvalid=function e(t){var n=this,i=d._makeGeneric(t);return n._deps[i]&&n._deps[i].depend(),n._keyIsInvalid(t,i)},y.prototype.keyErrorMessage=function e(t){var n=this,i=d._makeGeneric(t);n._deps[i]&&n._deps[i].depend();var r=n._getInvalidKeyObject(t,i);return r?n._simpleSchema.messageForError(r.type,r.name,null,r.value):""},y.prototype.getErrorObject=function t(){var n=this,i,r=this._invalidKeys;r.length?(i=n.keyErrorMessage(r[0].name),r=o.map(r,function(e){return o.extend({message:n.keyErrorMessage(e.name)},e)})):i="Failed validation";var a=new Error(i);return a.invalidKeys=r,e.isServer&&(a.sanitizedError=new e.Error(400,i)),a}}.call(this),"undefined"==typeof Package&&(Package={}),function(e,t){for(var n in t)n in e||(e[n]=t[n])}(Package["aldeed:simple-schema"]={},{SimpleSchema:d,MongoObject:c,humanize:l})}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,n=Package.meteor.meteorEnv,a=Package.tracker.Tracker,r=Package.tracker.Deps,o=Package.retry.Retry,i=Package["ddp-client"].DDP,s=Package.mongo.Mongo,c=Package.underscore._,u,l;(function(){var t=__meteor_runtime_config__.autoupdateVersion||"unknown",n=__meteor_runtime_config__.autoupdateVersionRefreshable||"unknown";u=new s.Collection("meteor_autoupdate_clientVersions"),l={},l.newClientAvailable=function(){return!!u.findOne({_id:"version",version:{$ne:t}})||!!u.findOne({_id:"version-refreshable",version:{$ne:n}})},l._ClientVersions=u;var a=!1,r=new o({minCount:0,baseTimeout:3e4}),i=0;l._retrySubscription=function(){e.subscribe("meteor_autoupdate_clientVersions",{onError:function(t){e._debug("autoupdate subscription failed:",t),i++,r.retryLater(i,function(){l._retrySubscription()})},onReady:function(){if(Package.reload)var r=function(r){var i=this;if("version-refreshable"===r._id&&r.version!==n){n=r.version;var s=r.assets&&r.assets.allCss||[],u=[];c.each(document.getElementsByTagName("link"),function(e){"__meteor-css__"===e.className&&u.push(e)});var l=function(t,n){var r=c.once(n);if(t.onload=function(){a=!0,r()},!a)var o=e.setInterval(function(){t.sheet&&(r(),e.clearInterval(o))},50)},d=c.after(s.length,function(){c.each(u,function(e){e.parentNode.removeChild(e)})}),f=function(t){document.getElementsByTagName("head").item(0).appendChild(t),l(t,function(){e.setTimeout(d,200)})};0!==s.length?c.each(s,function(e){var t=document.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("type","text/css"),t.setAttribute("class","__meteor-css__"),t.setAttribute("href",e.url),f(t)}):d()}else"version"===r._id&&r.version!==t&&(o&&o.stop(),Package.reload&&Package.reload.Reload._reload())},o=u.find().observe({added:r,changed:r})}})},l._retrySubscription()}).call(this),"undefined"==typeof Package&&(Package={}),function(e,t){for(var n in t)n in e||(e[n]=t[n])}(Package.autoupdate={},{Autoupdate:l})}();
!function(){"undefined"==typeof Package&&(Package={}),Package["meteor-platform"]={}}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,a=Package.meteor.meteorEnv,n=Package.underscore._,o=Package.modules.meteorInstall,r=Package.modules.Buffer,s=Package.modules.process,c=Package["ecmascript-runtime"].Symbol,u=Package["ecmascript-runtime"].Map,m=Package["ecmascript-runtime"].Set,i=Package["babel-runtime"].meteorBabelHelpers,l=Package.promise.Promise,p,d=o({node_modules:{meteor:{webapp:{"webapp_client.js":function(){p={_isCssLoaded:function(){function e(){return 0===document.styleSheets.length||n.find(document.styleSheets,function(e){return e.cssText&&!e.cssRules?!e.cssText.match(/meteor-css-not-found-error/):!n.find(e.cssRules,function(e){return".meteor-css-not-found-error"===e.selectorText})})}return e}()}}}}}},{extensions:[".js",".json"]});d("./node_modules/meteor/webapp/webapp_client.js"),"undefined"==typeof Package&&(Package={}),function(e,t){for(var a in t)a in e||(e[a]=t[a])}(Package.webapp={},{WebApp:p})}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,n=Package.meteor.meteorEnv,r=Package.underscore._,i=Package.ejson.EJSON,a=Package.modules.meteorInstall,f=Package.modules.Buffer,o=Package.modules.process,c,l,s=a({node_modules:{meteor:{logging:{"logging.js":["cli-color",function(t){c=function(){return c.info.apply(this,arguments)};var n=0,a=[],f=0;c._intercept=function(e){n+=e},c._suppress=function(e){f+=e},c._intercepted=function(){var e=a;return a=[],n=0,e},c.outputFormat="json";var o={debug:"green",warn:"magenta",error:"red"},l="blue",s=["time","timeInexact","level","file","line","program","originApp","satellite","stderr"],u=s.concat(["app","message"]),d=function(t){var n=c.format(t),r=t.level;"undefined"!=typeof console&&console[r]?console[r](n):e._debug(n)};c._getCallerDetails=function(){var e=function(){var e=new Error,t=e.stack;return t},t=e();if(!t)return{};for(var n=t.split("\n"),r,i=1;i<n.length;++i){if(r=n[i],r.match(/^\s*at eval \(eval/))return{file:"eval"};if(!r.match(/packages\/(?:local-test[:_])?logging(?:\/|\.js)/))break}var a={},f=/(?:[@(]| at )([^(]+?):([0-9:]+)(?:\)|$)/.exec(r);return f?(a.line=f[2].split(":")[0],a.file=f[1].split("/").slice(-1)[0].split("?")[0],a):a},r.each(["debug","info","warn","error"],function(t){c[t]=function(o){if(f)return void f--;var l=!1;n&&(n--,l=!0);var u=!r.isObject(o)||r.isRegExp(o)||r.isDate(o)?{message:new String(o).toString()}:o;if(r.each(s,function(e){if(u[e])throw new Error("Can't set '"+e+"' in log message")}),r.has(u,"message")&&!r.isString(u.message))throw new Error("The 'message' field in log objects must be a string");if(u.omitCallerDetails||(u=r.extend(c._getCallerDetails(),u)),u.time=new Date,u.level=t,"debug"!==t)if(l)a.push(i.stringify(u));else if(e.isServer)if("colored-text"===c.outputFormat)console.log(c.format(u,{color:!0}));else{if("json"!==c.outputFormat)throw new Error("Unknown logging output format: "+c.outputFormat);console.log(i.stringify(u))}else d(u)}}),c.parse=function(e){var t=null;if(e&&"{"===e.charAt(0))try{t=i.parse(e)}catch(e){}return t&&t.time&&t.time instanceof Date?t:null},c.format=function(n,a){n=i.clone(n),a=a||{};var f=n.time;if(!(f instanceof Date))throw new Error("'time' must be a Date object");var c=n.timeInexact,s=n.level||"info",d=n.file,p=n.line,b=n.app||"",m=n.originApp,h=n.message||"",v=n.program||"",g=n.satellite,x=n.stderr||"";r.each(u,function(e){delete n[e]}),r.isEmpty(n)||(h&&(h+=" "),h+=i.stringify(n));var y=function(e){return e<10?"0"+e:e.toString()},j=function(e){return e<100?"0"+y(e):e.toString()},O=f.getFullYear().toString()+y(f.getMonth()+1)+y(f.getDate()),_=y(f.getHours())+":"+y(f.getMinutes())+":"+y(f.getSeconds())+"."+j(f.getMilliseconds()),w="("+-((new Date).getTimezoneOffset()/60)+")",A="";b&&(A+=b),m&&m!==b&&(A+=" via "+m),A&&(A="["+A+"] ");var N=[];v&&N.push(v),d&&N.push(d),p&&N.push(p);var S=r.isEmpty(N)?"":"("+N.join(":")+") ";g&&(S+=["[",g,"]"].join(""));var P=x?"(STDERR) ":"",z=[s.charAt(0).toUpperCase(),O,"-",_,w,c?"? ":" ",A,S,P].join(""),k=function(n,r){return a.color&&e.isServer&&r?t("cli-color")[r](n):n};return k(z,a.metaColor||l)+k(h,o[s])},c.objFromText=function(e,t){var n={message:e,level:"info",time:new Date,timeInexact:!0};return r.extend(n,t)}}],node_modules:{"cli-color":{"package.json":function(e,t){t.name="cli-color",t.version="0.2.3",t.main="lib"},lib:{"index.js":["es5-ext/lib/Object/descriptor","es5-ext/lib/Object/extend","es5-ext/lib/Object/map","es5-ext/lib/Object/reduce","es5-ext/lib/String/prototype/repeat","memoizee","tty","./_xterm-match",function(e,t,n){"use strict";var r=e("es5-ext/lib/Object/descriptor"),i=e("es5-ext/lib/Object/extend"),a=e("es5-ext/lib/Object/map"),f=e("es5-ext/lib/Object/reduce"),c=e("es5-ext/lib/String/prototype/repeat"),l=e("memoizee"),s=e("tty"),u=Array.prototype.join,d=Object.defineProperty,p=Object.defineProperties,b=Math.abs,m=Math.floor,h=Math.max,v=Math.min,g,x,y,j,O,_,w,A,N,S,P;g=i({bold:{_bold:[1,22]},italic:{_italic:[3,23]},underline:{_underline:[4,24]},blink:{_blink:[5,25]},inverse:{_inverse:[7,27]},strike:{_strike:[9,29]}},["black","red","green","yellow","blue","magenta","cyan","white"].reduce(function(e,t,n){return e[t]={_fg:[30+n,39]},e[t+"Bright"]={_fg:[90+n,39]},e["bg"+t[0].toUpperCase()+t.slice(1)]={_bg:[40+n,49]},e["bg"+t[0].toUpperCase()+t.slice(1)+"Bright"]={_bg:[100+n,49]},e},{})),P=l(function(e,t){return d(y(),"_cliColorData",r(i({},e._cliColorData,t)))}),x=Object.create(Function.prototype,i(a(g,function(e){return r.gs(function(){return P(this,e)})}),{xterm:r(l(function(e){return e=isNaN(e)?255:v(h(e,0),255),d(y(),"_cliColorData",r(i({},this._cliColorData,{_fg:[O?O[e]:"38;5;"+e,39]})))},{method:"xterm"})),bgXterm:r(l(function(e){return e=isNaN(e)?255:v(h(e,0),255),d(y(),"_cliColorData",r(i({},this._cliColorData,{_bg:[O?O[e]+10:"48;5;"+e,49]})))},{method:"bgXterm"}))})),"win32"===o.platform&&(O=e("./_xterm-match")),y=function(){var e=function(){var t=e._cliColorData,n="";return f(t,function(e,t){return n="["+t[1]+"m"+n,e+"["+t[0]+"m"},"",!0)+u.call(arguments," ")+n};return e.__proto__=x,e},j=function(e){return function(t){return t=isNaN(t)?0:h(m(t),0),t?"["+t+e:""}},n.exports=p(y(),{width:r.gs(o.stdout.getWindowSize?function(){return o.stdout.getWindowSize()[0]}:function(){return s.getWindowSize?s.getWindowSize()[1]:0}),height:r.gs(S=o.stdout.getWindowSize?function(){return o.stdout.getWindowSize()[1]}:function(){return s.getWindowSize?s.getWindowSize()[0]:0}),reset:r.gs(function(){return c.call("\n",S()-1)+"c"}),up:r(_=j("A")),down:r(w=j("B")),right:r(A=j("C")),left:r(N=j("D")),move:r(function(e,t){return e=isNaN(e)?0:m(e),t=isNaN(t)?0:m(t),(e>0?A(e):N(-e))+(t>0?w(t):_(-t))}),moveTo:r(function(e,t){return e=isNaN(e)?1:h(m(e),0)+1,t=isNaN(t)?1:h(m(t),0)+1,"["+t+";"+e+"H"}),bol:r(function(e){var t;return e=isNaN(e)?0:Number(e),t=e>=0?"E":"F",e=m(b(e)),arguments[1]?(e&&"F"!==t?"":"K")+c.call("[1"+t+"",e):"["+e+t}),beep:r(""),xtermSupported:r(!O),_cliColorData:r({})})}],"_xterm-match.js":["./_xterm-colors",function(e,t,n){"use strict";var r=Array.prototype.push,i=Array.prototype.reduce,a=Math.abs,f,o,c,l;for(f=e("./_xterm-colors").map(function(e){return{r:parseInt(e.slice(0,2),16),g:parseInt(e.slice(2,4),16),b:parseInt(e.slice(4),16)}}),o=f.slice(0,16),n.exports=c=[],l=0;l<8;)c.push(30+l++);for(l=0;l<8;)c.push(90+l++);r.apply(c,f.slice(16).map(function(e){var t,n=1/0;return o.every(function(r,f){var o=i.call("rgb",function(t,n){return t+=a(r[n]-e[n])},0);return o<n&&(t=f,n=o),o}),c[t]}))}],"_xterm-colors.js":function(e,t,n){"use strict";n.exports=["000000","800000","008000","808000","000080","800080","008080","c0c0c0","808080","ff0000","00ff00","ffff00","0000ff","ff00ff","00ffff","ffffff","000000","00005f","000087","0000af","0000d7","0000ff","005f00","005f5f","005f87","005faf","005fd7","005fff","008700","00875f","008787","0087af","0087d7","0087ff","00af00","00af5f","00af87","00afaf","00afd7","00afff","00d700","00d75f","00d787","00d7af","00d7d7","00d7ff","00ff00","00ff5f","00ff87","00ffaf","00ffd7","00ffff","5f0000","5f005f","5f0087","5f00af","5f00d7","5f00ff","5f5f00","5f5f5f","5f5f87","5f5faf","5f5fd7","5f5fff","5f8700","5f875f","5f8787","5f87af","5f87d7","5f87ff","5faf00","5faf5f","5faf87","5fafaf","5fafd7","5fafff","5fd700","5fd75f","5fd787","5fd7af","5fd7d7","5fd7ff","5fff00","5fff5f","5fff87","5fffaf","5fffd7","5fffff","870000","87005f","870087","8700af","8700d7","8700ff","875f00","875f5f","875f87","875faf","875fd7","875fff","878700","87875f","878787","8787af","8787d7","8787ff","87af00","87af5f","87af87","87afaf","87afd7","87afff","87d700","87d75f","87d787","87d7af","87d7d7","87d7ff","87ff00","87ff5f","87ff87","87ffaf","87ffd7","87ffff","af0000","af005f","af0087","af00af","af00d7","af00ff","af5f00","af5f5f","af5f87","af5faf","af5fd7","af5fff","af8700","af875f","af8787","af87af","af87d7","af87ff","afaf00","afaf5f","afaf87","afafaf","afafd7","afafff","afd700","afd75f","afd787","afd7af","afd7d7","afd7ff","afff00","afff5f","afff87","afffaf","afffd7","afffff","d70000","d7005f","d70087","d700af","d700d7","d700ff","d75f00","d75f5f","d75f87","d75faf","d75fd7","d75fff","d78700","d7875f","d78787","d787af","d787d7","d787ff","d7af00","d7af5f","d7af87","d7afaf","d7afd7","d7afff","d7d700","d7d75f","d7d787","d7d7af","d7d7d7","d7d7ff","d7ff00","d7ff5f","d7ff87","d7ffaf","d7ffd7","d7ffff","ff0000","ff005f","ff0087","ff00af","ff00d7","ff00ff","ff5f00","ff5f5f","ff5f87","ff5faf","ff5fd7","ff5fff","ff8700","ff875f","ff8787","ff87af","ff87d7","ff87ff","ffaf00","ffaf5f","ffaf87","ffafaf","ffafd7","ffafff","ffd700","ffd75f","ffd787","ffd7af","ffd7d7","ffd7ff","ffff00","ffff5f","ffff87","ffffaf","ffffd7","ffffff","080808","121212","1c1c1c","262626","303030","3a3a3a","444444","4e4e4e","585858","626262","6c6c6c","767676","808080","8a8a8a","949494","9e9e9e","a8a8a8","b2b2b2","bcbcbc","c6c6c6","d0d0d0","dadada","e4e4e4","eeeeee"]}},node_modules:{"es5-ext":{lib:{Object:{"descriptor.js":["./is-callable","./valid-callable","./valid-value","./copy","./map","../String/is-string","../String/prototype/contains",function(e,t,n){"use strict";var r=e("./is-callable"),i=e("./valid-callable"),a=e("./valid-value"),f=e("./copy"),o=e("./map"),c=e("../String/is-string"),l=e("../String/prototype/contains"),s=Function.prototype.bind,u=Object.defineProperty,d;d=n.exports=function(e,t){var n,r,i;return arguments.length<2&&(t=e,e=null),null==e?(n=i=!0,r=!1):(n=l.call(e,"c"),r=l.call(e,"e"),i=l.call(e,"w")),{value:t,configurable:n,enumerable:r,writable:i}},d.gs=function(e,t,n){var a,f;return r(e)?(n=null==t?void 0:i(t),t=e,e=null):(t=null==t?void 0:i(t),n=null==n?void 0:i(n)),null==e?(a=!0,f=!1):(a=l.call(e,"c"),f=l.call(e,"e")),{get:t,set:n,configurable:a,enumerable:f}},d.binder=function e(t,n){var r,l;return c(t)?(r=a(n)&&i(n.value),l=f(n),delete l.writable,delete l.value,l.get=function(){return n.value=s.call(r,this),u(this,t,n),this[t]},l):o(t,function(t,n){return e(n,t)})}}],"is-callable.js":function(e,t,n){"use strict";var r=Array.prototype.forEach.bind([]);n.exports=function(e){var t;if(!e)return!1;if(t=typeof e,"function"===t)return!0;if("object"!==t)return!1;try{return r(e),!0}catch(e){if(e instanceof TypeError)return!1;throw e}}},"valid-callable.js":["./is-callable",function(e,t,n){"use strict";var r=e("./is-callable");n.exports=function(e){if(!r(e))throw new TypeError(e+" is not a function");return e}}],"valid-value.js":function(e,t,n){"use strict";n.exports=function(e){if(null==e)throw new TypeError("Cannot use null or undefined");return e}},"copy.js":["./is-plain-object","./for-each","./extend","./valid-value",function(e,t,n){"use strict";var r=e("./is-plain-object"),i=e("./for-each"),a=e("./extend"),f=e("./valid-value"),o;o=function(e,t,n){i(t,function(t,i){var f;r(t)&&((f=n[0].indexOf(t))===-1?(n[0].push(t),n[1].push(e[i]=a({},t)),o(e[i],t,n)):e[i]=n[1][f])},t)},n.exports=function(e){var t;return(t=Object(f(e)))===e&&(t=a({},e),arguments[1]&&o(t,e,[[e],[t]])),t}}],"is-plain-object.js":function(e,t,n){"use strict";var r=Object.getPrototypeOf,i=Object.prototype,a=i.toString,f={}.toString();n.exports=function(e){var t;return!(!e||"object"!=typeof e||a.call(e)!==f)&&(t=r(e),t===i||null===r(t))}},"for-each.js":["./_iterate",function(e,t,n){"use strict";n.exports=e("./_iterate")("forEach")}],"_iterate.js":["./is-callable","./valid-callable","./valid-value",function(e,t,n){"use strict";var r=e("./is-callable"),i=e("./valid-callable"),a=e("./valid-value"),f=Function.prototype.call,o=Object.keys;n.exports=function(e){return function(t,n){var c,l=arguments[2],s=arguments[3];return t=Object(a(t)),i(n),c=o(t),s&&c.sort(r(s)?s.bind(t):void 0),c[e](function(e,r){return f.call(n,l,t[e],e,t,r)})}}}],"extend.js":["./valid-value",function(e,t,n){"use strict";var r=e("./valid-value"),i=Array.prototype.forEach,a=Array.prototype.slice,f=Object.keys,o;o=function(e){f(Object(e)).forEach(function(t){this[t]=e[t]},this)},n.exports=function(e){return i.call(arguments,r),a.call(arguments,1).forEach(o,e),e}}],"map.js":["./valid-callable","./for-each",function(e,t,n){"use strict";var r=e("./valid-callable"),i=e("./for-each"),a=Function.prototype.call;n.exports=function(e,t){var n={},f=arguments[2];return r(t),i(e,function(e,r,i,o){n[r]=a.call(t,f,e,r,i,o)}),n}}],"reduce.js":["./is-callable","./valid-callable","./valid-value",function(e,t,n){"use strict";var r=e("./is-callable"),i=e("./valid-callable"),a=e("./valid-value"),f=Function.prototype.call,o=Object.keys;n.exports=t=function e(t,n){var c,l,s,u,d;return a(t)&&i(n),t=Object(t),s=arguments[2],u=arguments[3],c=o(t),u&&c.sort(r(u)?u.bind(t):void 0),l=function(e,r,i){return d?f.call(n,void 0,e,t[r],r,t,i):(d=!0,f.call(n,void 0,t[e],t[r],r,t,i,e))},arguments.length<3||s===e.NO_INITIAL?c.reduce(l):(d=!0,c.reduce(l,s))},t.NO_INITIAL={}}],"is.js":function(e,t,n){"use strict";n.exports=function(e,t){return e===t?0!==e||1/e===1/t:e!==e&&t!==t}},"is-empty.js":["./valid-value",function(e,t,n){"use strict";var r=e("./valid-value");n.exports=function(e){var t;r(e);for(t in e)if(e.propertyIsEnumerable(t))return!1;return!0}}]},String:{"is-string.js":function(e,t,n){"use strict";var r=Object.prototype.toString,i=r.call("");n.exports=function(e){return"string"==typeof e||e&&"object"==typeof e&&(e instanceof String||r.call(e)===i)||!1}},prototype:{"contains.js":function(e,t,n){"use strict";var r=String.prototype.indexOf;n.exports=function(e){return r.call(this,e,arguments[1])>-1}},"repeat.js":["../../Object/valid-value","../../Number/to-uint",function(e,t,n){"use strict";var r=e("../../Object/valid-value"),i=e("../../Number/to-uint");n.exports=function(e){return new Array((isNaN(e)?1:i(e))+1).join(String(r(this)))}}]}},Number:{"to-uint.js":["./to-int",function(e,t,n){"use strict";var r=e("./to-int"),i=Math.max;n.exports=function(e){return i(0,r(e))}}],"to-int.js":["../Math/sign",function(e,t,n){"use strict";var r=e("../Math/sign"),i=Math.abs,a=Math.floor;n.exports=function(e){return isNaN(e)?0:(e=Number(e),0!==e&&isFinite(e)?r(e)*a(i(e)):e)}}],"is-nan.js":function(e,t,n){"use strict";n.exports=function(e){return e!==e}},"is-number.js":function(e,t,n){"use strict";var r=Object.prototype.toString,i=r.call(1);n.exports=function(e){return"number"==typeof e||e instanceof Number||"object"==typeof e&&r.call(e)===i}}},Math:{"sign.js":function(e,t,n){"use strict";n.exports=function(e){return e=Number(e),isNaN(e)||0===e?e:e>0?1:-1}}},Error:{"custom.js":["../Object/descriptor","../Object/extend",function(e,t,n){"use strict";var r=e("../Object/descriptor"),i=e("../Object/extend"),a=Error.captureStackTrace,f;f=n.exports=function e(t,n){var r=arguments[2];null!=r&&i(this,r),this.message=String(t),null!=n&&(this.code=String(n)),a&&a(this,e)},f.prototype=Object.create(Error.prototype,{constructor:r(f),name:r("CustomError")})}]},Array:{prototype:{"e-index-of.js":["../../Number/is-nan","../../Object/is","../../Object/valid-value",function(e,t,n){"use strict";var r=e("../../Number/is-nan"),i=e("../../Object/is"),a=e("../../Object/valid-value"),f=Array.prototype.indexOf;n.exports=function(e){var t;if(!r(e)&&0!==e)return f.apply(this,arguments);for(t=arguments[1]>>>0;t<a(this).length>>>0;++t)if(this.hasOwnProperty(t)&&i(e,this[t]))return t;return-1}}],"last.js":["./last-index",function(e,t,n){"use strict";var r=e("./last-index");n.exports=function(){var e;if(null!==(e=r.call(this)))return this[e]}}],"last-index.js":["../../Object/valid-value",function(e,t,n){"use strict";var r=e("../../Object/valid-value");n.exports=function(){var e,t;if(!(t=r(this).length>>>0))return null;for(e=t-1;!this.hasOwnProperty(e);)if(--e===-1)return null;return e}}]},"from.js":["../Function/is-arguments",function(e,t,n){"use strict";var r=e("../Function/is-arguments"),i=Array.isArray,a=Array.prototype.slice;n.exports=function(e){return i(e)?e:r(e)?1===e.length?[e[0]]:Array.apply(null,e):a.call(e)}}]},Function:{"is-arguments.js":function(e,t,n){"use strict";var r=Object.prototype.toString,i=r.call(function(){return arguments}());n.exports=function(e){return r.call(e)===i}}},"global.js":function(e,t,n){"use strict";n.exports=new Function("return this")()}}},memoizee:{"package.json":function(e,t){t.name="memoizee",t.version="0.2.5",t.main="lib"},lib:{"index.js":["./regular","./primitive","./ext/dispose","./ext/resolvers","./ext/async","./ext/ref-counter","./ext/method","./ext/max-age","./ext/max",function(e,t,n){"use strict";var r=e("./regular"),i=e("./primitive"),a=Function.prototype.call;e("./ext/dispose"),e("./ext/resolvers"),e("./ext/async"),e("./ext/ref-counter"),e("./ext/method"),e("./ext/max-age"),e("./ext/max"),n.exports=function(e){var t=Object(arguments[1]);return a.call(t.primitive?i:r,this,e,t)}}],"regular.js":["es5-ext/lib/Error/custom","es5-ext/lib/Array/prototype/e-index-of","event-emitter/lib/has-listeners","./_base",function(e,t,n){"use strict";var r=e("es5-ext/lib/Error/custom"),i=e("es5-ext/lib/Array/prototype/e-index-of"),a=e("event-emitter/lib/has-listeners"),f=Function.prototype.apply;n.exports=e("./_base")(function(e,t){var n,o,c,l,s,u,d,p,b,m,h,v=e.cache={},g;0===t?(n=null,l=e.get=function(){return n},s=function(){return n=1},u=function(){n=null},e.clearAll=function(){n=null,v=e.cache={}}):(d=0,1===t?(o=[],c=[],l=e.get=function(e){var t=i.call(o,e[0]);return t===-1?null:c[t]},s=function(e){return o.push(e[0]),c.push(++d),d},u=function(e){var t=i.call(c,e);t!==-1&&(o.splice(t,1),c.splice(t,1))},e.clearAll=function(){o=[],c=[],v=e.cache={}}):t===!1?(n=[],g={},l=e.get=function(e){var t=0,r=n,a,f=e.length;if(0===f)return r[f]||null;if(r=r[f]){for(;t<f-1;){if(a=i.call(r[0],e[t]),a===-1)return null;r=r[1][a],++t}return a=i.call(r[0],e[t]),a===-1?null:r[1][a]||null}return null},s=function(e){var t=0,r=n,a,f=e.length;if(0===f)r[f]=++d;else{for(r[f]||(r[f]=[[],[]]),r=r[f];t<f-1;)a=i.call(r[0],e[t]),a===-1&&(a=r[0].push(e[t])-1,r[1].push([[],[]])),r=r[1][a],++t;a=i.call(r[0],e[t]),a===-1&&(a=r[0].push(e[t])-1),r[1][a]=++d}return g[d]=e,d},u=function(e){var t=0,r=n,a,f=g[e],o=f.length,c=[];if(0===o)delete r[o];else if(r=r[o]){for(;t<o-1;){if(a=i.call(r[0],f[t]),a===-1)return;c.push(r,a),r=r[1][a],++t}if(a=i.call(r[0],f[t]),a===-1)return;for(e=r[1][a],r[0].splice(a,1),r[1].splice(a,1);!r[0].length&&c.length;)a=c.pop(),r=c.pop(),r[0].splice(a,1),r[1].splice(a,1)}delete g[e]},e.clearAll=function(){n=[],v=e.cache={},g={}}):(n=[[],[]],g={},l=e.get=function(e){for(var r=0,a=n,f;r<t-1;){if(f=i.call(a[0],e[r]),f===-1)return null;a=a[1][f],++r}return f=i.call(a[0],e[r]),f===-1?null:a[1][f]||null},s=function(e){for(var r=0,a=n,f;r<t-1;)f=i.call(a[0],e[r]),f===-1&&(f=a[0].push(e[r])-1,a[1].push([[],[]])),a=a[1][f],++r;return f=i.call(a[0],e[r]),f===-1&&(f=a[0].push(e[r])-1),a[1][f]=++d,g[d]=e,d},u=function(e){for(var r=0,a=n,f,o=[],c=g[e];r<t-1;){if(f=i.call(a[0],c[r]),f===-1)return;o.push(a,f),a=a[1][f],++r}if(f=i.call(a[0],c[r]),f!==-1){for(e=a[1][f],a[0].splice(f,1),a[1].splice(f,1);!a[0].length&&o.length;)f=o.pop(),a=o.pop(),a[0].splice(f,1),a[1].splice(f,1);delete g[e]}},e.clearAll=function(){n=[[],[]],v=e.cache={},g={}})),e.memoized=function(){var t=l(arguments),n;if(null!=t)return b&&e.emit("hit",t,arguments,this),v[t];if(n=f.call(p,this,arguments),t=l(arguments),null!=t)throw new r("Circular invocation","CIRCULAR_INVOCATION");return t=s(arguments),v[t]=n,m&&e.emit("init",t),n},e.clear=function(t){v.hasOwnProperty(t)&&(h&&e.emit("purge",t),u(t),delete v[t])},e.once("ready",function(){p=e.fn,b=a(e,"hit"),m=a(e,"init"),h=a(e,"purge")})})}],"_base.js":["es5-ext/lib/Object/valid-callable","es5-ext/lib/Object/for-each","event-emitter/lib/core",function(e,t,n){"use strict";var r=e("es5-ext/lib/Object/valid-callable"),i=e("es5-ext/lib/Object/for-each"),a=e("event-emitter/lib/core"),f;n.exports=t=function(e){return function t(n){var o,c,l,s,u;return r(n),n.memoized?n:(o=Object(arguments[1]),u=a({memoize:t,fn:n}),isNaN(o.length)?(c=n.length,o.async&&f.async&&--c):c=o.length!==!1&&o.length>>>0,e(u,c),i(f,function(e,t){e.force?e(u,o):o[t]&&e(o[t],u,o)}),n=u.fn,l=u.get,s=u.clear,u.memoized.clear=function(){s(l(arguments))},u.memoized.clearAll=function(){u.emit("purgeall"),u.clearAll()},u.memoized.memoized=!0,u.emit("ready"),u.memoized)}},f=t.ext={}}],"primitive.js":["es5-ext/lib/Error/custom","event-emitter/lib/has-listeners","./_base",function(e,t,n){"use strict";var r=e("es5-ext/lib/Error/custom"),i=e("event-emitter/lib/has-listeners"),a=function(){return""},f=function(e){return e[0]},o=Function.prototype.apply,c=Function.prototype.call;n.exports=e("./_base")(function(e,t){var n,l=e.cache={},s,u,d,p;n=1===t?e.get=f:t===!1?e.get=function(e){var t="",n,r=e.length;if(r)for(t+=e[n=0];--r;)t+=""+e[++n];else t="";return t}:t?e.get=function(e){for(var n=String(e[0]),r=0,i=t;--i;)n+=""+e[++r];return n}:e.get=a,e.memoized=1===t?function(t){var n;if(l.hasOwnProperty(t))return u&&e.emit("hit",t,arguments,this),l[t];if(n=1===arguments.length?c.call(s,this,t):o.call(s,this,arguments),l.hasOwnProperty(t))throw new r("Circular invocation","CIRCULAR_INVOCATION");return l[t]=n,d&&e.emit("init",t),n}:function(){var t=n(arguments),i;if(l.hasOwnProperty(t))return u&&e.emit("hit",t,arguments,this),l[t];if(i=o.call(e.fn,this,arguments),l.hasOwnProperty(t))throw new r("Circular invocation","CIRCULAR_INVOCATION");return l[t]=i,d&&e.emit("init",t),i},e.clear=function(t){l.hasOwnProperty(t)&&(p&&e.emit("purge",t),delete l[t])},e.clearAll=function(){l=e.cache={}},e.once("ready",function(){s=e.fn,u=i(e,"hit"),d=i(e,"init"),p=i(e,"purge")})})}],ext:{"dispose.js":["es5-ext/lib/Object/valid-callable","es5-ext/lib/Object/for-each","../_base",function(e){"use strict";var t=e("es5-ext/lib/Object/valid-callable"),n=e("es5-ext/lib/Object/for-each"),r=e("../_base").ext,i=Array.prototype.slice;r.dispose=function(e,a,f){var o,c;t(e),c=f.async&&r.async,a.on("purge"+(c?"async":""),o=c?function(t){var n=a.async[t];delete a.cache[t],e.apply(a.memoized["_memoize:context_"],i.call(n,1))}:function(t){var n=a.cache[t];delete a.cache[t],e.call(a.memoized["_memoize:context_"],n)}),c||a.on("purgeall",function(){n(a.cache,function(e,t){o(t)})})}}],"resolvers.js":["es5-ext/lib/Array/from","es5-ext/lib/Object/for-each","es5-ext/lib/Object/valid-callable","../_base",function(e){"use strict";var t=e("es5-ext/lib/Array/from"),n=e("es5-ext/lib/Object/for-each"),r=e("es5-ext/lib/Object/valid-callable"),i=Array.prototype.slice,a;a=function(e){return this.map(function(t,n){return t?t(e[n]):e[n]}).concat(i.call(e,this.length))},e("../_base").ext.resolvers=function(e,i){var f;f=t(e),f.forEach(function(e){null==e||r(e)}),f=a.bind(f),function(e){i.memoized=function(){var t;return i.memoized.args=arguments,t=e.apply(this,f(arguments)),delete i.memoized.args,t},n(e,function(t,n){i.memoized[n]=function(){return e[n].apply(this,f(arguments))}})}(i.memoized)}}],"async.js":["es5-ext/lib/Array/from","es5-ext/lib/Array/prototype/last","es5-ext/lib/Object/for-each","es5-ext/lib/Object/is-callable","next-tick","../_base",function(e){"use strict";var t=e("es5-ext/lib/Array/from"),n=e("es5-ext/lib/Array/prototype/last"),r=e("es5-ext/lib/Object/for-each"),i=e("es5-ext/lib/Object/is-callable"),a=e("next-tick"),f=Array.isArray,o=Array.prototype.slice,c=Function.prototype.apply;e("../_base").ext.async=function(e,l){var s,u;s=l.async={},function(e){var u,d,p,b,m,h;l.on("init",function(e){u.id=e,s[e]=d?[d]:[]}),l.on("hit",function(e,t,n){d&&(f(s[e])?s[e].push(d):(a(function(e,r,i,a){s[r]?(l.emit("hitasync",r,t,n),c.call(e,this.context,this)):m.apply(i,a)}.bind(s[e],d,e,p,b)),p=b=null))}),l.fn=function(){var n,r;return n=arguments,r=t(n),r.push(u=function e(t){var n,r,i,f;if(null==e.id)return void a(c.bind(e,this,arguments));for(i=s[e.id],l.cache.hasOwnProperty(e.id)?t?(delete s[e.id],l.clear(e.id)):(arguments.context=this,s[e.id]=arguments,l.emit("initasync",e.id,i.length)):delete s[e.id],n=0;r=i[n];++n)f=c.call(r,this,arguments);return f}),c.call(e,this,r)},m=l.memoized,h=function(e){return d=n.call(e),i(d)?o.call(e,0,-1):(d=null,e)},l.memoized=function(){return m.apply(p=this,b=h(arguments))},r(m,function(e,t){l.memoized[t]=function(){return m[t].apply(this,h(arguments))}})}(l.fn),l.on("purge",u=function(e){f(s[e])||(l.emit("purgeasync",e),delete s[e])}),l.on("purgeall",function(){r(l.async,function(e,t){u(t)})})}}],"ref-counter.js":["../_base",function(e){"use strict";var t=e("../_base").ext;t.refCounter=function(e,n,r){var i,a;i={},a=r.async&&t.async,n.on("init"+(a?"async":""),a?function(e,t){i[e]=t}:function(e){i[e]=1}),n.on("hit"+(a?"async":""),function(e){++i[e]}),n.on("purge"+(a?"async":""),function(e){delete i[e]}),a||n.on("purgeall",function(){i={}}),n.memoized.clearRef=function(){var e=n.get(arguments);return i.hasOwnProperty(e)?!--i[e]&&(n.clear(e),!0):null}}}],"method.js":["es5-ext/lib/Object/descriptor","es5-ext/lib/global","es5-ext/lib/Object/extend","es5-ext/lib/String/is-string","../_base",function(e){"use strict";var t=e("es5-ext/lib/Object/descriptor"),n=e("es5-ext/lib/global"),r=e("es5-ext/lib/Object/extend"),i=e("es5-ext/lib/String/is-string"),a=Object.create,f=Object.defineProperty;e("../_base").ext.method=function(e,o,c){i(c.method)?e={name:String(c.method),descriptor:{configurable:!0,writable:!0}}:(e=c.method,e.name=String(e.name),e.descriptor=null==e.descriptor?{configurable:!0,writable:!0}:Object(e.descriptor)),c=a(c),c.method=void 0,function(i){o.memoized=function(){var r;return this&&this!==n?(r=e.descriptor.value=o.memoize(o.fn.bind(this),c),f(this,e.name,e.descriptor),f(r,"_memoize:context_",t(this)),r.apply(this,arguments)):i.apply(this,arguments)},r(o.memoized,i)}(o.memoized)}}],"max-age.js":["es5-ext/lib/Number/is-number","es5-ext/lib/Object/for-each","next-tick","../_base",function(e){"use strict";var t=e("es5-ext/lib/Number/is-number"),n=e("es5-ext/lib/Object/for-each"),r=e("next-tick"),i=e("../_base").ext,a=Math.max,f=Math.min;i.maxAge=function(e,o,c){var l,s,u,d;e>>>=0,e&&(l={},s=c.async&&i.async,o.on("init"+(s?"async":""),function(t){l[t]=setTimeout(function(){o.clear(t)},e),d&&(d[t]=setTimeout(function(){delete d[t]},u))}),o.on("purge"+(s?"async":""),function(e){clearTimeout(l[e]),d&&d[e]&&(clearTimeout(d[e]),delete d[e]),delete l[e]}),c.preFetch&&(u=t(c.preFetch)?a(f(Number(c.preFetch),1),0):.333,u&&(d={},u=(1-u)*e,o.on("hit"+(s?"async":""),function(e,t,n){d[e]||(d[e]=!0,r(function(){d[e]===!0&&(delete d[e],o.clear(e),o.memoized.apply(n,t))}))}))),s||o.on("purgeall",function(){n(l,function(e){clearTimeout(e)}),l={},d&&(n(d,function(e){clearTimeout(e)}),d={})}))}}],"max.js":["../_base",function(e){"use strict";var t=e("../_base").ext;t.max=function(e,n,r){var i,a,f,o,c,l;e>>>=0,e&&(i=-1,a=f=0,o={},c={},l=r.async&&t.async,n.on("init"+(l?"async":""),function(t){o[++i]=t,c[t]=i,++f,f>e&&n.clear(o[a])}),n.on("hit"+(l?"async":""),function(e){var t=c[e];if(o[++i]=e,c[e]=i,delete o[t],a===t)for(;!o.hasOwnProperty(++a);)continue}),n.on("purge"+(l?"async":""),function(e){var t=c[e];if(delete o[t],--f,a===t)if(f)for(;!o.hasOwnProperty(++a);)continue;else i=-1,a=0}),l||n.on("purgeall",function(){i=-1,a=f=0,o={},c={}}))}}]}},node_modules:{"event-emitter":{lib:{"has-listeners.js":["es5-ext/lib/Object/is-empty","es5-ext/lib/Object/valid-value","./_id",function(e,t,n){"use strict";var r=e("es5-ext/lib/Object/is-empty"),i=e("es5-ext/lib/Object/valid-value"),a=e("./_id");n.exports=function(e){var t;return i(e),t=arguments[1],arguments.length>1?e.hasOwnProperty(a)&&e[a].hasOwnProperty(t):e.hasOwnProperty(a)&&!r(e[a])}}],"_id.js":function(e,t,n){"use strict";n.exports="_ee2_"},"core.js":["es5-ext/lib/Object/descriptor","es5-ext/lib/Object/valid-callable","./_id",function(e,t,n){"use strict";var r=e("es5-ext/lib/Object/descriptor"),i=e("es5-ext/lib/Object/valid-callable"),a=e("./_id"),f=Function.prototype.apply,o=Function.prototype.call,c=Object.create,l=Object.defineProperty,s=Object.defineProperties,u={configurable:!0,enumerable:!1,writable:!0},d,p,b,m,h,v,g,x;h=a+"l_",d=function(e,t){var n;return i(t),this.hasOwnProperty(a)?n=this[a]:(n=u.value={},l(this,a,u),u.value=null),n.hasOwnProperty(e)?n[e].hasOwnProperty(h)?n[e].push(t):(n[e]=[n[e],t])[h]=!0:n[e]=t,this},p=function(e,t){var n,r;return i(t),r=this,d.call(this,e,n=function(){b.call(r,e,n),f.call(t,this,arguments)}),n._listener=t,this},b=function(e,t){var n,r,f,o;if(i(t),!this.hasOwnProperty(a))return this;if(n=this[a],!n.hasOwnProperty(e))return this;if(r=n[e],r.hasOwnProperty(h))for(o=0;f=r[o];++o)f!==t&&f._listener!==t||(2===r.length?n[e]=r[o?0:1]:r.splice(o,1));else r!==t&&r._listener!==t||delete n[e];return this},m=function(e){var t,n,r,i,c,l;if(this.hasOwnProperty(a)&&(t=this[a],t.hasOwnProperty(e)))if(c=t[e],c.hasOwnProperty(h)){for(r=arguments.length,l=new Array(r-1),n=1;n<r;++n)l[n-1]=arguments[n];for(c=c.slice(),n=0;i=c[n];++n)f.call(i,this,l)}else switch(arguments.length){case 1:o.call(c,this);break;case 2:o.call(c,this,arguments[1]);break;case 3:o.call(c,this,arguments[1],arguments[2]);break;default:for(r=arguments.length,l=new Array(r-1),n=1;n<r;++n)l[n-1]=arguments[n];f.call(c,this,l)}},v={on:d,once:p,off:b,emit:m},g={on:r(d),once:r(p),off:r(b),emit:r(m)},x=s({},g),n.exports=t=function(e){return null==e?c(x):s(Object(e),g)},t.methods=v}]}},"next-tick":{"package.json":function(e,t){t.name="next-tick",t.version="0.1.0",t.main="lib/next-tick"},lib:{"next-tick.js":function(e,t,n){"use strict";"undefined"!=typeof o&&o&&"function"==typeof o.nextTick?n.exports=o.nextTick:"function"==typeof setImmediate?n.exports=function(e){setImmediate(e)}:n.exports=function(e){setTimeout(e,0)}}}}}}}}}}}}},{extensions:[".js",".json"]});s("./node_modules/meteor/logging/logging.js"),"undefined"==typeof Package&&(Package={}),function(e,t){for(var n in t)n in e||(e[n]=t[n])}(Package.logging={},{Log:c})}();
!function(){var e=Package.meteor.Meteor,a=Package.meteor.global,c=Package.meteor.meteorEnv,n=Package.underscore._,o=Package["reactive-dict"].ReactiveDict,i=Package.ejson.EJSON,t;(function(){t=new o("session")}).call(this),"undefined"==typeof Package&&(Package={}),function(e,a){for(var c in a)c in e||(e[c]=a[c])}(Package.session={},{Session:t})}();
!function(){var a=Package["ddp-client"].DDP,e;"undefined"==typeof Package&&(Package={}),function(a,e){for(var n in e)n in a||(a[n]=e[n])}(Package.livedata={},{DDP:a,LivedataTest:e})}();
!function(){var e=Package.meteor.Meteor,n=Package.meteor.global,a=Package.meteor.meteorEnv,r;(function(){var n=0,a=!1;r={hold:function(){if(!e.isCordova)return{release:function(){}};if(a)throw new Error("Can't show launch screen once it's hidden");n++;var r=!1,o=function(){e.isCordova&&(r||(r=!0,n--,0===n&&"undefined"!=typeof navigator&&navigator.splashscreen&&(a=!0,navigator.splashscreen.hide())))};return{release:o}}}}).call(this),function(){var n=r.hold(),a=Package.templating&&Package.templating.Template;e.startup(function(){a?Package["iron:router"]?Package["iron:router"].Router.onAfterAction(function(){n.release()}):(a.body.onRendered(function(){n.release()}),setTimeout(function(){n.release()},6e3)):n.release()})}.call(this),"undefined"==typeof Package&&(Package={}),function(e,n){for(var a in n)a in e||(e[a]=n[a])}(Package["launch-screen"]={},{LaunchScreen:r})}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,n=Package.meteor.meteorEnv,o=Package.jquery.$,r=Package.jquery.jQuery,i=Package.underscore._,a=Package["templating-runtime"].Template,u=Package["reactive-var"].ReactiveVar,l=Package["iron:router"].Router,c=Package["iron:router"].RouteController,s=Package["aldeed:simple-schema"].SimpleSchema,p=Package["aldeed:simple-schema"].MongoObject,m=Package.modules.meteorInstall,d=Package.modules.Buffer,f=Package.modules.process,h=Package["ecmascript-runtime"].Symbol,g=Package["ecmascript-runtime"].Map,v=Package["ecmascript-runtime"].Set,b=Package["babel-runtime"].meteorBabelHelpers,k=Package.promise.Promise,y=Package["iron:core"].Iron,w=Package.webapp.WebApp,x=Package.logging.Log,j=Package.deps.Tracker,T=Package.deps.Deps,C=Package.session.Session,I=Package["ddp-client"].DDP,_=Package.mongo.Mongo,M=Package.ui.Blaze,H=Package.ui.UI,O=Package.ui.Handlebars,P=Package.spacebars.Spacebars,F=Package.check.check,$=Package.check.Match,S=Package.random.Random,D=Package.ejson.EJSON,R=Package["launch-screen"].LaunchScreen,V=Package.htmljs.HTML,z=m({node_modules:{meteor:{"ohif:core":{"main.js":["meteor/meteor",function(e,t,n){n.export({OHIF:function(){return r}});var o;n.import("meteor/meteor",{Meteor:function(e){o=e}});var r={log:{},ui:{},utils:{},viewer:{},cornerstone:{}};o.isClient&&(window.OHIF=r)}],client:{"index.js":["./lib","./helpers","./components","./ui","./routes.js",function(e,t,n){n.import("./lib"),n.import("./helpers"),n.import("./components"),n.import("./ui"),n.import("./routes.js")}],"routes.js":["meteor/iron:router",function(e,t,n){var o;n.import("meteor/iron:router",{Router:function(e){o=e}}),o.route("/playground",function(){this.render("componentPlayground")})}],components:{"index.js":["./base","./bootstrap","./playground/playground.html","./playground/playground.styl","./playground/playground.js",function(e,t,n){n.import("./base"),n.import("./bootstrap"),n.import("./playground/playground.html"),n.import("./playground/playground.styl"),n.import("./playground/playground.js")}],base:{"component.js":["babel-runtime/helpers/classCallCheck","meteor/ohif:core",function(e,t,n){var o;n.import("babel-runtime/helpers/classCallCheck",{default:function(e){o=e}});var r;n.import("meteor/ohif:core",{OHIF:function(e){r=e}});var i=function(){function e(t){o(this,e),t.view._component=this,t.sections={},this.templateInstance=t,this.registeredItems=new v}return e.prototype.registerSelf=function(){function e(){var e=r.blaze.getParentComponent(this.templateInstance.view);e&&(this.parent=e,e.registeredItems.add(this))}return e}(),e.prototype.unregisterSelf=function(){function e(){var e=r.blaze.getParentComponent(this.templateInstance.view);e&&(delete this.parent,e.registeredItems.delete(this))}return e}(),e}();r.Component=i}],"index.js":["./component.js","./mixin.js","./template.js","./section/section.html","./section/section.js","./mixins/action.js","./mixins/button.js","./mixins/checkbox.js","./mixins/component.js","./mixins/dropdown.js","./mixins/form.js","./mixins/formItem.js","./mixins/group.js","./mixins/groupRadio.js","./mixins/input.js","./mixins/link.js","./mixins/popover.js","./mixins/schemaData.js","./mixins/select.js","./mixins/select2.js","./templates/button.html","./templates/custom.html","./templates/div.html","./templates/form.html","./templates/input.html","./templates/link.html","./templates/select.html","./templates/tr.html","./wrappers/label.html","./wrappers/labelContent.html",function(e,t,n){n.import("./component.js"),n.import("./mixin.js"),n.import("./template.js"),n.import("./section/section.html"),n.import("./section/section.js"),n.import("./mixins/action.js"),n.import("./mixins/button.js"),n.import("./mixins/checkbox.js"),n.import("./mixins/component.js"),n.import("./mixins/dropdown.js"),n.import("./mixins/form.js"),n.import("./mixins/formItem.js"),n.import("./mixins/group.js"),n.import("./mixins/groupRadio.js"),n.import("./mixins/input.js"),n.import("./mixins/link.js"),n.import("./mixins/popover.js"),n.import("./mixins/schemaData.js"),n.import("./mixins/select.js"),n.import("./mixins/select2.js"),n.import("./templates/button.html"),n.import("./templates/custom.html"),n.import("./templates/div.html"),n.import("./templates/form.html"),n.import("./templates/input.html"),n.import("./templates/link.html"),n.import("./templates/select.html"),n.import("./templates/tr.html"),n.import("./wrappers/label.html"),n.import("./wrappers/labelContent.html")}],"mixin.js":["babel-runtime/helpers/classCallCheck","meteor/ohif:core","meteor/underscore",function(e,t,n){var o;n.import("babel-runtime/helpers/classCallCheck",{default:function(e){o=e}});var r;n.import("meteor/ohif:core",{OHIF:function(e){r=e}});var i;n.import("meteor/underscore",{_:function(e){i=e}}),r.mixins={};var a=function(){function e(t){var n=t.dependencies,r=t.composition;o(this,e),this.dependencies=n||"",this.composition=r}return e.prototype.init=function(){function t(t,n,o,r){var a=this,u=this.dependencies.split(" ");i.each(u,function(i){if(i){var u=e.getMixin(i);if(u===a)throw new Error("Mixin "+i+" has a cyclic dependency.");u.init(t,n,o,r)}}),this.apply(t,n,o,r)}return t}(),e.prototype.apply=function(){function e(e,t,n,o){if(!i.contains(n,this)){var r=this.composition;i.each(o,function(n){var o=n;"onMixins"===o&&(o="onRendered"),"onData"===n&&r[n]?r[n](t):r[n]&&e[o](r[n])}),n.push(this)}}return e}(),e.initData=function(){function t(t){var n=t.mixins.split(" "),o=[];i.each(n,function(n){if(n){var r=e.getMixin(n);r.init(null,t,o,["onData"])}})}return t}(),e.initAll=function(){function t(t,n){var o=n.mixins.split(" "),r=[],a=[];i.each(o,function(o){if(o){var i=e.getMixin(o);i.init(t,n,r,["onCreated","onRendered","onDestroyed","events","helpers"]),i.init(t,n,a,["onMixins"])}})}return t}(),e.getMixin=function(){function e(e){var t=r.mixins[e];if(!t)throw new Error("Mixin "+e+" not found.");return t}return e}(),e}();r.Mixin=a}],"template.js":["meteor/templating","meteor/blaze","meteor/underscore","meteor/ohif:core",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}});var r;n.import("meteor/blaze",{Blaze:function(e){r=e}});var i;n.import("meteor/underscore",{_:function(e){i=e}});var a;n.import("meteor/ohif:core",{OHIF:function(e){a=e}}),o.baseComponent=new o("baseComponent",function(){}),o.baseComponent.constructView=function(e,t){var n=o.currentData();if(n){n.base||(n.base="baseCustom");var u=o[n.base];if(!u)throw new Error("Template "+n.base+" not found.");var l=a.blaze.cloneTemplate(u,n.base+"Component");l.renderFunction=u.renderFunction,a.Mixin.initData(n);var c=[];if(n.wrappers){var s=n.wrappers.split(" ");i.each(s,function(e){return e&&c.push(e)})}for(var p=[],m=function i(){var u=function n(){return l.constructView(e,t)};return l.onCreated(function(){var e=o.instance();e.component=new a.Component(e),e.wrapper=p[0]||e,p.forEach(function(t){t.component=e.component})}),a.Mixin.initAll(l,n),r.With(n,u)},d=void 0,f=function e(){var i=o[d];if(!i)throw new Error("Template "+d+" not found.");var u=a.blaze.cloneTemplate(i),l=m,c=function e(){return u.onCreated(function(){return p.push(o.instance())}),u.constructView(l,t)};m=function e(){return r.With(n,c)}};d=c.shift();)f();return m(e,t)}}}],mixins:{"action.js":["meteor/templating","meteor/jquery","meteor/ohif:core",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}});var r;n.import("meteor/jquery",{$:function(e){r=e}});var i;n.import("meteor/ohif:core",{OHIF:function(e){i=e}}),i.mixins.action=new i.Mixin({dependencies:"formItem",composition:{onRendered:function(){function e(){var e=o.instance(),t=e.component;t.$element.addClass("form-action")}return e}(),events:{"click .form-action":function(){function e(e,t){e.preventDefault();var n=t.component,o=t.data.action,i=t.data.params?t.data.params:e,a=r(":focus"),u=function(){function t(){a[0]&&e.currentTarget!==a[0]&&setTimeout(function(){return a.focus()})}return t}();if(!n.$element.hasClass("disabled")){var l=n.getApi();if("function"==typeof o)n.actionResult=o.call(e.currentTarget,i);else{if(!l||!o||"function"!=typeof l[o])return!0;n.actionResult=l[o].call(e.currentTarget,i)}n.actionResult instanceof k?!function(){var e=n.getForm();e.disable(!0);var t=r('<i class="fa fa-spin fa-circle-o-notch fa-fw m-r"></i>');n.$element.prepend(t);var o=function(){function n(){t.remove(),e.disable(!1),u()}return n}();n.actionResult.then(o).catch(o)}():u()}}return e}()}}})}],"button.js":["meteor/ohif:core","meteor/templating",function(e,t,n){var o;n.import("meteor/ohif:core",{OHIF:function(e){o=e}});var r;n.import("meteor/templating",{Template:function(e){r=e}}),o.mixins.button=new o.Mixin({dependencies:"formItem",composition:{onRendered:function(){function e(){var e=r.instance(),t=e.component;t.$element=e.$("button").first()}return e}()}})}],"checkbox.js":["meteor/ohif:core","meteor/templating","meteor/underscore",function(e,t,n){var o;n.import("meteor/ohif:core",{OHIF:function(e){o=e}});var r;n.import("meteor/templating",{Template:function(e){r=e}});var i;n.import("meteor/underscore",{_:function(e){i=e}}),o.mixins.checkbox=new o.Mixin({dependencies:"input",composition:{onCreated:function(){function e(){var e=r.instance(),t=e.component;t.value=function(e){var n=i.isUndefined(e);return n?t.parseData(t.$element.is(":checked")):void t.$element.prop("checked",e)}}return e}()}})}],"component.js":["meteor/ohif:core","meteor/templating",function(e,t,n){var o;n.import("meteor/ohif:core",{OHIF:function(e){o=e}});var r;n.import("meteor/templating",{Template:function(e){r=e}}),o.mixins.component=new o.Mixin({composition:{}})}],"dropdown.js":["meteor/meteor","meteor/templating","meteor/blaze","meteor/reactive-var","meteor/jquery","meteor/ohif:core",function(e,t,n){var o;n.import("meteor/meteor",{Meteor:function(e){o=e}});var r;n.import("meteor/templating",{Template:function(e){r=e}});var i;n.import("meteor/blaze",{Blaze:function(e){i=e}});var a;n.import("meteor/reactive-var",{ReactiveVar:function(e){a=e}});var u;n.import("meteor/jquery",{$:function(e){u=e}});var l;n.import("meteor/ohif:core",{OHIF:function(e){l=e}}),l.mixins.dropdown=new l.Mixin({dependencies:"form",composition:{onRendered:function(){function e(){var e=r.instance(),t=e.data.options,n=t.event,a=t.centered,c=t.marginTop,s=t.$parentLi,p=t.reactiveClose,m=e.$(".dropdown"),d=m[0],f=m.children(".dropdown-menu");if(e.opening=!0,e.destroyView=function(){var t=function(){function t(){"function"==typeof e.data.destroyView?e.data.destroyView():i.remove(e.view)}return t}(),n=setTimeout(t,500);f.one("transitionend",function(){t(),clearTimeout(n)}),m.removeClass("open")},e.data.promise.then(e.destroyView,e.destroyView),e.closeSubmenu=function(t){e.reactiveClose&&(t&&u(e.lastSubmenu).focus(),e.reactiveClose.set(!0),delete e.reactiveClose,delete e.lastSubmenu)},e.close=function(t,n){var o=e.data[t?"promiseResolve":"promiseReject"],r=n instanceof k?null:n;o(r),e.closeSubmenu(!1),e.closed=!0},p&&e.autorun(function(){var t=p.get();t&&e.close(!1)}),!e.data.items.length)return e.close(!1);d.oncontextmenu=function(){return!1};var h={};n&&(h.position="fixed",f.bounded()),c&&(h["margin-top"]=c),f.css(h),o.defer(function(){if(m.addClass("open").find("a:first").focus(),f.one("transitionend",function(t){e.opening=!1}),n){var t={left:n.clientX,top:n.clientY};if(a)t.left-=f.outerWidth()/2,t.top-=f.outerHeight()/2;else if(s){var o=s.closest(".dropdown-menu"),r=f.outerWidth(),i=o.outerWidth(),u=o.offset(),c=l.ui.getOffset(s[0]);Object.assign(t,{left:i+u.left,top:c.top});var p=!1;(t.left<u.left+i||t.left>document.body.clientWidth-r)&&(t.left-=i+f.outerWidth(),p=!0);var d=p?"origin-top-right":"origin-top-left";f.addClass(d)}f.css(t).trigger("spatialChanged");var h="fixed"===f.css("position");h&&f.outerHeight()>window.innerHeight&&f.css({"overflow-y":"scroll","max-height":window.innerHeight})}})}return e}(),events:{"click .form-action":function(){function e(e,t){var n=u(e.currentTarget),o=n.hasClass("disabled");if(o)t.close(!1);else{var r=n.data("component");t.close(!0,r.actionResult)}}return e}(),"mouseenter .form-action, openSubmenu .form-action":function(){function e(e,t){if(t.opening)return void t.$(".dropdown-menu").one("transitionend",function(e){u(e.currentTarget).trigger("openSubmenu")});if(!t.closed&&e.target===e.currentTarget&&(t.lastSubmenu&&t.lastSubmenu!==e.currentTarget&&t.closeSubmenu(!this.items),this.items&&t.lastSubmenu!==e.currentTarget)){t.closeSubmenu(!this.items);var n=new a((!1));t.reactiveClose=n,t.lastSubmenu=e.currentTarget;var o=u(e.currentTarget).closest("li");l.ui.showDropdown(this.items,{event:e,reactiveClose:t.reactiveClose,$parentLi:o,parentInstance:t}).then(t.data.promiseResolve).catch(function(){})}}return e}(),"keydown .form-action":function(){function e(e,t){e.stopPropagation();var n=e.which,o=u(e.currentTarget);if(38===n||40===n){var r=o.closest("li"),i=r.parent().children(),a=r.index(),l=void 0;return l=38===n?0===a?i.eq(i.length-1):r.prev():a===i.length-1?i.eq(0):r.next(),e.preventDefault(),void l.find("a:first").focus()}var c=t.data.options.parentInstance;return!c||37!==n&&8!==n&&27!==n?c||27!==n?void(this.items&&(39!==n&&13!==n&&32!==n||(o.trigger("openSubmenu"),e.preventDefault()))):t.close(!1):(e.preventDefault(),c.closeSubmenu(!0))}return e}(),"mousedown .dropdown":function(){function e(e){e.stopPropagation()}return e}(),"blur .dropdown":function(){function e(e,t){t.closed||t.reactiveClose&&!t.reactiveClose.get()||o.defer(function(){var e=u(":focus"),n=!1,o=t;do{if(u.contains(o.$(".dropdown")[0],e[0])){n=!0;break}if(!o.data.options.parentInstance)break;o=o.data.options.parentInstance,o.closeSubmenu(!1)}while(o);n||o.close(!1)})}return e}()}}})}],"form.js":["babel-runtime/helpers/typeof","meteor/ohif:core","meteor/templating","meteor/tracker","meteor/spacebars","meteor/underscore","meteor/jquery",function(e,t,n){var o;n.import("babel-runtime/helpers/typeof",{default:function(e){o=e}});var r;n.import("meteor/ohif:core",{OHIF:function(e){r=e}});var i;n.import("meteor/templating",{Template:function(e){i=e}});var a;n.import("meteor/tracker",{Tracker:function(e){a=e}});var u;n.import("meteor/spacebars",{Spacebars:function(e){u=e}});var l;n.import("meteor/underscore",{_:function(e){l=e}});var c;n.import("meteor/jquery",{$:function(e){c=e}}),r.mixins.form=new r.Mixin({dependencies:"group",composition:{onCreated:function(){function e(){var e=i.instance(),t=e.component;t.isForm=!0,t.isValidatedAlready=!1,t.validationObserver=new a.Dependency,e.data.pathKey="",t.validationRan=l.throttle(function(){t.validationObserver.changed()},200);var n=t.validate;t.validate=function(){var o=n();return t.isValidatedAlready=!0,t.schema&&t.schema._invalidKeys.length&&a.afterFlush(function(){return e.$(".state-error :input:first").focus()}),o}}return e}(),onRendered:function(){function e(){var e=i.instance(),t=e.component;t.$style=t.$element=e.$("form").first(),t.$element[0].onsubmit=function(){return!1}}return e}(),events:{"click .validation-error-container a":function(){function e(e,t){var n=c(e.currentTarget).attr("data-target");t.$('.state-error[data-key="'+n+'"]').find(":input:first").focus()}return e}()},helpers:{validationErrors:function(){function e(){var e=i.instance(),t=e.component;if(t.validationObserver.depend(),t.schema&&t.schema._invalidKeys.length){var n=function(){var e=[];return t.schema._invalidKeys.forEach(function(n){var o=t.schema._schema[n.name].label,r=t.schema.keyErrorMessage(n.name);r=r.replace(o,"<strong>"+o+"</strong>"),e.push({key:n.name,message:u.SafeString(r)})}),{v:e}}();if("object"===("undefined"==typeof n?"undefined":o(n)))return n.v}}return e}()}}})}],"formItem.js":["meteor/ohif:core","meteor/templating","meteor/tracker","meteor/meteor","meteor/underscore","meteor/jquery",function(e,t,n){var o;n.import("meteor/ohif:core",{OHIF:function(e){o=e}});var r;n.import("meteor/templating",{Template:function(e){r=e}});var i;n.import("meteor/tracker",{Tracker:function(e){i=e}});var a;n.import("meteor/meteor",{Meteor:function(e){a=e}});var u;n.import("meteor/underscore",{_:function(e){u=e}});var l;n.import("meteor/jquery",{$:function(e){l=e}}),o.mixins.formItem=new o.Mixin({dependencies:"schemaData",composition:{onCreated:function(){function e(){var e=r.instance(),t=e.component;t.changeObserver=new i.Dependency,t.registerSelf(),t.$element=l(),t.$style=l(),t.$wrapper=l(),t.value=function(e){var n=u.isUndefined(e);return n?t.parseData(t.$element.val()):void a.defer(function(){t.$element.val(e).trigger("change")})},t.disable=function(e){t.$element.prop("disabled",!!e)},t.readonly=function(e){t.$element.prop("readonly",!!e)},t.show=function(e){var n=e?"show":"hide";t.$wrapper[n]()},t.hasFocus=function(){var e=l(":focus")[0],n=l.contains(t.$wrapper[0],e),o=t.$wrapper[0]===e;return n||o},t.state=function(e,n){t.$wrapper.toggleClass("state-"+e,!!n)},t.error=function(e){t.state("error",!!e),e?t.$wrapper.attr("data-error",e):t.$wrapper.removeAttr("data-error",e)},t.toggleTooltip=function(e,n){if(e&&n){var o=t.$wrapper.attr("aria-describedby"),r=l(document.getElementById(o));r.length?r.find(".tooltip-inner").text(n):t.$wrapper.tooltip("destroy").tooltip({trigger:"manual",title:n}).tooltip("show")}else t.$wrapper.tooltip("destroy")},t.toggleMessage=function(e){if(!e)return void a.setTimeout(function(){t.hasFocus()||t.toggleTooltip(!1)},100);var n=t.$wrapper.attr("data-error");n&&t.toggleTooltip(!0,n)},t.getForm=function(){for(var e=t;e;)if(e=e.parent,e&&e.isForm)return e},t.getApi=function(){var n=e.data.api;if(!n){if(t.isForm)return;var o=t.getForm();if(!o)return;return o.getApi()}return n},t.validate=function(){var n,r=t.getForm(),i=r&&r.schema,a=e.data.pathKey;if(!a||!i||!t.$wrapper.is(":visible"))return!0;var u=o.object.getNestedObject((n={},n[a]=t.value(),n)),l=i.validateOne(u,a);return r.validationRan(),l?(t.error(!1),!0):(t.error(i.keyErrorMessage(a)),!1)},t.depend=function(){return t.changeObserver.depend()}}return e}(),onRendered:function(){function e(){var e=r.instance(),t=e.component;t.$element=e.$(":input").first(),t.$wrapper=e.wrapper.$("*").first(),t.$wrapper.attr("data-key",e.data.pathKey);var n=t.getForm();e.autorun(function(e){t.changeObserver.depend(),e.firstRun||n&&n.isValidatedAlready&&t.validate()})}return e}(),onDestroyed:function(){function e(){var e=r.instance(),t=e.component,n=t.getForm();t.unregisterSelf(),t.error(!1),t.toggleTooltip(!1),n&&n.isValidatedAlready&&n.validate()}return e}(),onMixins:function(){function e(){var e=r.instance(),t=e.component;t.$style.length||(t.$style=t.$element),t.$element.data("component",t),t.$wrapper.data("component",t)}return e}(),events:{change:function(){function e(e,t){var n=t.component;e.currentTarget===n.$element[0]&&n.changeObserver.changed()}return e}(),focus:function(){function e(e,t){var n=t.component,o=n.isGroup||n.isCustomFocus,r=e.target===e.currentTarget;!o&&r&&n.toggleMessage(!0)}return e}(),blur:function(){function e(e,t){var n=t.component,o=n.isGroup||n.isCustomFocus,r=e.target===e.currentTarget;!o&&r&&n.toggleMessage(!1)}return e}()}}})}],"group.js":["babel-runtime/helpers/typeof","meteor/ohif:core","meteor/templating","meteor/reactive-var","meteor/underscore",function(e,t,n){var o;n.import("babel-runtime/helpers/typeof",{default:function(e){o=e}});var r;n.import("meteor/ohif:core",{OHIF:function(e){r=e}});var i;n.import("meteor/templating",{Template:function(e){i=e}});var a;n.import("meteor/reactive-var",{ReactiveVar:function(e){a=e}});var u;n.import("meteor/underscore",{_:function(e){u=e}}),r.mixins.group=new r.Mixin({dependencies:"formItem",composition:{onCreated:function(){function e(){var e=i.instance(),t=e.component;t.isGroup=!0,e.autorun(function(){var n=e.data.schema;n instanceof a&&(n=n.get()),t.schema=n&&n.newContext()}),t.value=function(n){var r=u.isUndefined(n),i=e.data.arrayValues,a=i?[]:{};if(r)return t.registeredItems.forEach(function(e){if(i)a.push(e.value());else{var t=e.templateInstance.data.key;t&&(a[t]=e.value())}}),a;var l="object"===("undefined"==typeof n?"undefined":o(n))?n:a;if(l){var c=0;t.registeredItems.forEach(function(e){var t=i?c:e.templateInstance.data.key,n=u.isUndefined(l[t])?null:l[t];e.value(n),c++}),t.$element.trigger("change")}},t.item=function(e){var n=void 0;return t.registeredItems.forEach(function(t){var o=t.templateInstance.data.key;o===e&&(n=t)}),n};var n=t.validate;t.validate=function(){var o=!0;if(t.isForm&&!t.schema)return o;var r=t.isForm?t.schema:t.getForm().schema;return r.resetValidation(),e.data.pathKey&&!n()&&(o=!1),t.registeredItems.forEach(function(t){var n=t.templateInstance.data.key;!n&&!e.data.arrayValues||t.validate()||(o=!1)}),o},t.disable=function(e){t.registeredItems.forEach(function(t){return t.disable(e)})},t.readonly=function(e){t.registeredItems.forEach(function(t){return t.readonly(e)})}}return e}(),onRendered:function(){function e(){var e=i.instance(),t=e.component;t.$element=e.$(".component-group").first()}return e}()}})}],"groupRadio.js":["meteor/ohif:core","meteor/templating","meteor/underscore","meteor/jquery",function(e,t,n){var o;n.import("meteor/ohif:core",{OHIF:function(e){o=e}});var r;n.import("meteor/templating",{Template:function(e){r=e}});var i;n.import("meteor/underscore",{_:function(e){i=e}});var a;n.import("meteor/jquery",{$:function(e){a=e}}),o.mixins.groupRadio=new o.Mixin({dependencies:"group",composition:{onCreated:function(){function e(){var e=r.instance(),t=e.component;t.value=function(e){var n=i.isUndefined(e),o=[];t.registeredItems.forEach(function(e){return o.push(e.$element[0])});var r=a(o);return n?t.parseData(r.filter(":checked").val()):void r.filter("[value='"+e+"']").prop("checked",!0).trigger("change")}}return e}()}})}],"input.js":["meteor/ohif:core","meteor/templating",function(e,t,n){var o;n.import("meteor/ohif:core",{OHIF:function(e){o=e}});var r;n.import("meteor/templating",{Template:function(e){r=e}}),o.mixins.input=new o.Mixin({dependencies:"formItem",composition:{onRendered:function(){function e(){var e=r.instance(),t=e.component;t.$element=e.$("input").first()}return e}()}})}],"link.js":["meteor/templating","meteor/ohif:core",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}});var r;n.import("meteor/ohif:core",{OHIF:function(e){r=e}}),r.mixins.link=new r.Mixin({dependencies:"formItem",composition:{onRendered:function(){function e(){var e=o.instance(),t=e.component;t.$element=e.$("a").first()}return e}(),events:{"click a":function(){function e(e,t){t.data.action&&e.preventDefault()}return e}()}}})}],"popover.js":["meteor/meteor","meteor/templating","meteor/jquery","meteor/ohif:core",function(e,t,n){var o;n.import("meteor/meteor",{Meteor:function(e){o=e}});var r;n.import("meteor/templating",{Template:function(e){r=e}});var i;n.import("meteor/jquery",{$:function(e){i=e}});var a;n.import("meteor/ohif:core",{OHIF:function(e){a=e}}),a.mixins.popover=new a.Mixin({dependencies:"form",composition:{onRendered:function(){function e(){var e=r.instance();e.$form=e.$("form").first(),e.$form.find(":input:first").focus()}return e}(),events:{"blur form":function(){function e(e,t){o.defer(function(){var e=i(":focus");i.contains(t.$form[0],e[0])||t.data.promiseReject()})}return e}(),"click .btn-cancel":function(){function e(e,t){e.stopPropagation(),t.data.promiseReject()}return e}(),"click .btn-confirm":function(){function e(e,t){e.stopPropagation();var n=t.$("form").data("component");t.data.promiseResolve(n.value())}return e}()}}})}],"schemaData.js":["meteor/ohif:core","meteor/blaze","meteor/templating","meteor/reactive-var","meteor/tracker","meteor/underscore",function(e,t,n){var o;n.import("meteor/ohif:core",{OHIF:function(e){o=e}});var r;n.import("meteor/blaze",{Blaze:function(e){r=e}});var i;n.import("meteor/templating",{Template:function(e){i=e}});var a;n.import("meteor/reactive-var",{ReactiveVar:function(e){a=e}});var u;n.import("meteor/tracker",{Tracker:function(e){u=e}});var l;n.import("meteor/underscore",{_:function(e){l=e}});var c=function e(t,n){var o=t&&t.schema,r=t;if(t&&!o){var i=t.getForm();o=i&&i.schema,r=i}if(!n||!o)return{schemaComponentHolder:r};var a=l.clone(o._schema[n]);return a?(Array.isArray(a.type())&&l.extend(a,o._schema[n+".$"]),{currentSchema:a,schemaComponentHolder:r}):{schemaComponentHolder:r}};o.mixins.schemaData=new o.Mixin({dependencies:"component",composition:{onData:function(){function e(){var e=i.currentData(),t=o.blaze.getParentComponent(r.currentView),n=t&&t.templateInstance.data.pathKey,s=t&&t.templateInstance.data.arrayValues;if(e.pathKey=e.key||(s?"$":""),e.pathKey&&"string"==typeof n){var p=n?n+".":"";e.pathKey=""+p+e.pathKey}var m=c(t,e.pathKey),d=m.currentSchema;d&&(e.label||(e.label=new a(d.label)),l.isUndefined(e.min)&&d.min&&(e.min=d.min),l.isUndefined(e.max)&&d.max&&(e.max=d.max),d.emptyOption&&(e.emptyOption=d.emptyOption),!e.items&&Array.isArray(d.allowedValues)&&(e.items=e.items instanceof a?e.items:new a,u.autorun(function(){var n=c(t,e.pathKey),o=n.schemaComponentHolder;o.templateInstance.data.schema instanceof a&&o.templateInstance.data.schema.dep.depend();for(var r=n.currentSchema.allowedValues,i=n.currentSchema.valuesLabels||[],u=[],l=0;l<r.length;l++)u.push({value:r[l],label:i[l]||r[l]});e.items.set(u)})))}return e}(),onCreated:function(){function e(){var e=i.instance(),t=e.component;t.parseData=function(n){var o=c(t.parent,e.data.pathKey),r=o.currentSchema,i=e.data.dataType;if(!r&&!i)return n;var a=r&&r.type;return a===Number||"Number"===i?parseFloat(n):a===Boolean||"Boolean"===i?!!n:n}}return e}(),onMixins:function(){function e(){var e=i.instance(),t=e.component,n=c(t.parent,e.data.pathKey),o=n.currentSchema;o&&o.defaultValue&&t.value(o.defaultValue)}return e}()}})}],"select.js":["meteor/ohif:core","meteor/templating",function(e,t,n){var o;n.import("meteor/ohif:core",{OHIF:function(e){o=e}});var r;n.import("meteor/templating",{Template:function(e){r=e}}),o.mixins.select=new o.Mixin({dependencies:"formItem",composition:{onRendered:function(){function e(){var e=r.instance(),t=e.component;t.$element=e.$("select").first()}return e}()}})}],"select2.js":["meteor/templating","meteor/reactive-var","meteor/tracker","meteor/underscore","meteor/jquery","meteor/ohif:core",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}});var r;n.import("meteor/reactive-var",{ReactiveVar:function(e){r=e}});var i;n.import("meteor/tracker",{Tracker:function(e){i=e}});var a;n.import("meteor/underscore",{_:function(e){a=e}});var u;n.import("meteor/jquery",{$:function(e){u=e}});var l;n.import("meteor/ohif:core",{OHIF:function(e){l=e}}),l.mixins.select2=new l.Mixin({dependencies:"select",composition:{onCreated:function(){function e(){var e=o.instance();e.component.isCustomFocus=!0,e.getDropdownContainerElement=function(){var t=e.component.$element.nextAll(".select2:first"),n=t.find(".select2-selection").attr("aria-owns");return u("#"+n).closest(".select2-container")};var t=e.data.options&&e.data.options.placeholder;t&&e.autorun(function(){var n=e.data.items,o=n instanceof r;if(o&&(n=n.get()),!a.findWhere(n,{value:""})){var i=a.clone(n)||[];i.unshift({label:t,value:""}),o?e.data.items.set(i):e.data.items=i}})}return e}(),onRendered:function(){function e(){var e=o.instance(),t=e.component,n=function(){function n(){t.select2Instance&&t.select2Instance.destroy(),t.$element.select2(e.data.options),t.select2Instance=t.$element.data("select2");var n=[],o=t.$element.nextAll(".select2:first");n.push(t.$element[0]),n.push(o.find(".select2-selection")[0]),u(n).on("focus",function(e){e.target===e.currentTarget&&t.toggleMessage(!0)}).on("blur",function(e){e.target===e.currentTarget&&t.toggleMessage(!1)}),t.$element.on("keydown ",function(e){e.preventDefault(),o.find(".select2-selection").trigger(e)}),o.on("keydown ",function(t){27===t.which&&e.component.$element.focus()})}return n}();e.autorun(function(){var o=e.data.items instanceof r;o&&e.data.items.dep.depend(),o?!function(){var e=t.value();i.afterFlush(function(){n(),t.$element.val(e)})}():n()})}return e}(),events:{"select2:select":function(){function e(e,t){t.component.$element.focus()}return e}(),"select2:open":function(){function e(e,t){var n=t.data.options.minimumResultsForSearch;if(n!==1/0&&n!==-1){var o=t.getDropdownContainerElement(),r=o.find(".select2-search__field");r.on("keydown.focusOnEsc",function(e){27===e.which&&(r.off("keydown.focusOnEsc"),t.component.$element.focus())})}}return e}()},onDestroyed:function(){function e(){var e=o.instance(),t=e.component;t.select2Instance&&t.select2Instance.destroy()}return e}()}})}]},section:{"section.html":["./template.section.js",function(e,t,n){n.exports=e("./template.section.js")}],"template.section.js":function(){a.__checkName("section"),a.section=new a("Template.section",function(){var e=this;return M._TemplateWith(function(){return P.call(P.dot(e.lookup("instance"),"sectionData","get"))},function(){return P.include(function(){return P.call(P.dot(e.lookup("instance"),"renderFunction","get"))})})})},"section.js":["meteor/templating","meteor/tracker","meteor/reactive-var","meteor/ohif:core",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}});var r;n.import("meteor/tracker",{Tracker:function(e){r=e}});var i;n.import("meteor/reactive-var",{ReactiveVar:function(e){i=e}});var a;n.import("meteor/ohif:core",{OHIF:function(e){a=e}}),o.section.onCreated(function(){var e=o.instance();e.renderFunction=new i(null),e.sectionData=new i(null);var t=e.data;if(t){var n=e.view.templateContentBlock,u=a.blaze.getParentTemplateView(e.view);n?(u._sectionMap||(u._sectionMap=new g),u._sectionMap.set(t,{data:Object.assign({},u._templateInstance.data),renderFunction:n.renderFunction})):r.afterFlush(function(){var n=a.blaze.getSectionContent(u,t);n&&(e.sectionData.set(n.data),e.renderFunction.set(new o(n.renderFunction)))})}})}]},templates:{"button.html":["./template.button.js",function(e,t,n){n.exports=e("./template.button.js")}],"template.button.js":function(){a.__checkName("baseButton"),a.baseButton=new a("Template.baseButton",function(){var e=this;return V.BUTTON(V.Attrs({id:function(){return P.mustache(P.dot(e.lookup("."),"id"))},class:function(){return P.mustache(P.dot(e.lookup("."),"class"))},disabled:function(){return M.If(function(){return P.call(P.dot(e.lookup("."),"disabled"))},function(){return"disabled"})},title:function(){return P.mustache(P.dot(e.lookup("."),"title"))}},function(){return P.attrMustache(P.dot(e.lookup("."),"tagAttributes"))}),"\n ",M._InOuterTemplateScope(e,function(){return P.include(function(){return P.call(e.templateContentBlock)})}),"\n ")})},"custom.html":["./template.custom.js",function(e,t,n){n.exports=e("./template.custom.js")}],"template.custom.js":function(){a.__checkName("baseCustom"),a.baseCustom=new a("Template.baseCustom",function(){var e=this;return M._InOuterTemplateScope(e,function(){return P.include(function(){return P.call(e.templateContentBlock)})})})},"div.html":["./template.div.js",function(e,t,n){n.exports=e("./template.div.js")}],"template.div.js":function(){a.__checkName("baseDiv"),a.baseDiv=new a("Template.baseDiv",function(){var e=this;return V.DIV(V.Attrs({id:function(){return P.mustache(P.dot(e.lookup("."),"id"))},class:function(){return P.mustache(P.dot(e.lookup("."),"class"))}},function(){return P.attrMustache(P.dot(e.lookup("."),"tagAttributes"))}),"\n ",M._InOuterTemplateScope(e,function(){return P.include(function(){return P.call(e.templateContentBlock)})}),"\n ")})},"form.html":["./template.form.js",function(e,t,n){n.exports=e("./template.form.js")}],"template.form.js":function(){a.__checkName("baseForm"),a.baseForm=new a("Template.baseForm",function(){var e=this;return V.FORM(V.Attrs({id:function(){return P.mustache(P.dot(e.lookup("."),"id"))},class:function(){return P.mustache(P.dot(e.lookup("."),"class"))},name:function(){return P.mustache(P.dot(e.lookup("."),"name"))},action:function(){return P.mustache(P.dot(e.lookup("."),"action"))},method:function(){return P.mustache(P.dot(e.lookup("."),"method"));
},autocomplete:function(){return P.mustache(P.dot(e.lookup("."),"autocomplete"))},enctype:function(){return P.mustache(P.dot(e.lookup("."),"enctype"))},novalidate:function(){return P.mustache(P.dot(e.lookup("."),"novalidate"))},target:function(){return P.mustache(P.dot(e.lookup("."),"target"))}},function(){return P.attrMustache(P.dot(e.lookup("."),"tagAttributes"))}),"\n ",M.If(function(){return P.dataMustache(e.lookup("and"),e.lookup("validationErrors"),P.dataMustache(e.lookup("not"),P.dot(e.lookup("."),"hideValidationBox")))},function(){return["\n ",V.DIV({class:"validation-error-container alert alert-danger",role:"alert"},"\n ",M.Each(function(){return{_sequence:P.call(e.lookup("validationErrors")),_variable:"error"}},function(){return["\n ",V.P(V.A({href:"#",class:"text-danger","data-target":function(){return P.mustache(P.dot(e.lookup("error"),"key"))}},M.View("lookup:error.message",function(){return P.mustache(P.dot(e.lookup("error"),"message"))}))),"\n "]}),"\n "),"\n "]}),"\n ",M._InOuterTemplateScope(e,function(){return P.include(function(){return P.call(e.templateContentBlock)})}),"\n ")})},"input.html":["./template.input.js",function(e,t,n){n.exports=e("./template.input.js")}],"template.input.js":function(){a.__checkName("baseInput"),a.baseInput=new a("Template.baseInput",function(){var e=this;return[V.INPUT(V.Attrs({type:function(){return P.mustache(e.lookup("choose"),P.dot(e.lookup("."),"type"),"text")},id:function(){return P.mustache(P.dot(e.lookup("."),"id"))},class:function(){return P.mustache(P.dot(e.lookup("."),"class"))},name:function(){return P.mustache(P.dot(e.lookup("."),"name"))},value:function(){return P.mustache(e.lookup("reactive"),P.dot(e.lookup("."),"value"))},placeholder:function(){return P.mustache(P.dot(e.lookup("."),"placeholder"))},checked:function(){return M.If(function(){return P.call(P.dot(e.lookup("."),"checked"))},function(){return"checked"})},disabled:function(){return M.If(function(){return P.call(P.dot(e.lookup("."),"disabled"))},function(){return"disabled"})},min:function(){return P.mustache(P.dot(e.lookup("."),"min"))},max:function(){return P.mustache(P.dot(e.lookup("."),"max"))},maxlength:function(){return P.mustache(e.lookup("choose"),P.dot(e.lookup("."),"maxlength"),P.dot(e.lookup("."),"max"))}},function(){return P.attrMustache(P.dot(e.lookup("."),"tagAttributes"))})),"\n ",M._InOuterTemplateScope(e,function(){return P.include(function(){return P.call(e.templateContentBlock)})})]})},"link.html":["./template.link.js",function(e,t,n){n.exports=e("./template.link.js")}],"template.link.js":function(){a.__checkName("baseLink"),a.baseLink=new a("Template.baseLink",function(){var e=this;return V.A(V.Attrs({id:function(){return P.mustache(P.dot(e.lookup("."),"id"))},class:function(){return[P.mustache(P.dot(e.lookup("."),"class"))," ",M.If(function(){return P.call(P.dot(e.lookup("."),"disabled"))},function(){return"disabled"})]},href:function(){return P.mustache(e.lookup("choose"),P.dot(e.lookup("."),"href"),"#")},title:function(){return P.mustache(P.dot(e.lookup("."),"title"))}},function(){return P.attrMustache(P.dot(e.lookup("."),"tagAttributes"))}),"\n ",M._InOuterTemplateScope(e,function(){return P.include(function(){return P.call(e.templateContentBlock)})}),"\n ")})},"select.html":["./template.select.js",function(e,t,n){n.exports=e("./template.select.js")}],"template.select.js":function(){a.__checkName("baseSelect"),a.baseSelect=new a("Template.baseSelect",function(){var e=this;return V.SELECT(V.Attrs({id:function(){return P.mustache(P.dot(e.lookup("."),"id"))},class:function(){return P.mustache(P.dot(e.lookup("."),"class"))},name:function(){return P.mustache(P.dot(e.lookup("."),"name"))},multiple:function(){return M.If(function(){return P.call(P.dot(e.lookup("."),"multiple"))},function(){return"multiple"})},disabled:function(){return M.If(function(){return P.call(P.dot(e.lookup("."),"disabled"))},function(){return"disabled"})}},function(){return P.attrMustache(P.dot(e.lookup("."),"tagAttributes"))}),"\n ",M._InOuterTemplateScope(e,function(){return P.include(function(){return P.call(e.templateContentBlock)})}),"\n ",M.Each(function(){return{_sequence:P.dataMustache(e.lookup("reactive"),P.dot(e.lookup("."),"items")),_variable:"item"}},function(){return["\n ",V.OPTION({value:function(){return P.mustache(P.dot(e.lookup("item"),"value"))},selected:function(){return M.If(function(){return P.dataMustache(e.lookup("eq"),P.dot(e.lookup("item"),"value"),P.dataMustache(e.lookup("reactive"),P.dot(e.lookup("."),"value")))},function(){return"selected"})}},M.View("lookup:item.label",function(){return P.mustache(P.dot(e.lookup("item"),"label"))})),"\n "]}),"\n ")})},"tr.html":["./template.tr.js",function(e,t,n){n.exports=e("./template.tr.js")}],"template.tr.js":function(){a.__checkName("baseTr"),a.baseTr=new a("Template.baseTr",function(){var e=this;return V.TR(V.Attrs({id:function(){return P.mustache(P.dot(e.lookup("."),"id"))},class:function(){return P.mustache(P.dot(e.lookup("."),"class"))}},function(){return P.attrMustache(P.dot(e.lookup("."),"tagAttributes"))}),"\n ",M._InOuterTemplateScope(e,function(){return P.include(function(){return P.call(e.templateContentBlock)})}),"\n ")})}},wrappers:{"label.html":["./template.label.js",function(e,t,n){n.exports=e("./template.label.js")}],"template.label.js":function(){a.__checkName("wrapperLabel"),a.wrapperLabel=new a("Template.wrapperLabel",function(){var e=this;return M.Unless(function(){return P.call(P.dot(e.lookup("."),"labelAsDiv"))},function(){return["\n ",V.LABEL(V.Attrs({class:function(){return["wrapperLabel ",P.mustache(P.dot(e.lookup("."),"labelClass"))]}},function(){return P.attrMustache(e.lookup("clone"),P.dot(e.lookup("."),"labelTagAttributes"))}),"\n ",M._TemplateWith(function(){return P.dataMustache(e.lookup("extend"),e.lookup("."),P.kw({labelAfter:!0}))},function(){return P.include(e.lookupTemplate("wrapperLabelContent"),function(){return["\n ",M._InOuterTemplateScope(e,function(){return P.include(function(){return P.call(e.templateContentBlock)})}),"\n "]})}),"\n "),"\n "]},function(){return["\n ",V.DIV(V.Attrs({class:function(){return["wrapperLabel ",P.mustache(P.dot(e.lookup("."),"labelClass"))]}},function(){return P.attrMustache(e.lookup("clone"),P.dot(e.lookup("."),"labelTagAttributes"))}),"\n ",P.include(e.lookupTemplate("wrapperLabelContent"),function(){return["\n ",M._InOuterTemplateScope(e,function(){return P.include(function(){return P.call(e.templateContentBlock)})}),"\n "]}),"\n "),"\n "]})})},"labelContent.html":["./template.labelContent.js",function(e,t,n){n.exports=e("./template.labelContent.js")}],"template.labelContent.js":function(){a.__checkName("wrapperLabelContent"),a.wrapperLabelContent=new a("Template.wrapperLabelContent",function(){var e=this;return[M.If(function(){return P.call(P.dot(e.lookup("."),"labelAfter"))},function(){return["\n ",M._InOuterTemplateScope(e,function(){return P.include(function(){return P.call(e.templateContentBlock)})}),"\n "]}),"\n ",V.SPAN({class:"wrapperText"},M._TemplateWith(function(){return"labelBeforeText"},function(){return P.include(e.lookupTemplate("section"))}),M.View("lookup:reactive",function(){return P.mustache(e.lookup("reactive"),P.dot(e.lookup("."),"label"))}),M._TemplateWith(function(){return"labelAfterText"},function(){return P.include(e.lookupTemplate("section"))})),"\n ",M.Unless(function(){return P.call(P.dot(e.lookup("."),"labelAfter"))},function(){return["\n ",M._InOuterTemplateScope(e,function(){return P.include(function(){return P.call(e.templateContentBlock)})}),"\n "]})]})}}},bootstrap:{"index.js":["./dialog/confirm.html","./dialog/form.html","./dialog/form.js","./dialog/header.html","./dialog/info.html","./dialog/info.js","./dialog/loading.html","./dialog/loading.js","./dialog/login.html","./dialog/login.js","./dialog/progress.html","./dialog/progress.js","./dialog/simple.html","./dialog/simple.js","./dialog/unsavedChangesDialog.html","./dialog/unsavedChangesDialog.js","./dropdown/form.html","./dropdown/form.js","./form/button.html","./form/form.html","./form/group.html","./form/link.html","./input/checkbox.html","./input/hidden.html","./input/groupRadio.html","./input/password.html","./input/radio.html","./input/range.html","./input/select.html","./input/text.html","./popover/form.html",function(e,t,n){n.import("./dialog/confirm.html"),n.import("./dialog/form.html"),n.import("./dialog/form.js"),n.import("./dialog/header.html"),n.import("./dialog/info.html"),n.import("./dialog/info.js"),n.import("./dialog/loading.html"),n.import("./dialog/loading.js"),n.import("./dialog/login.html"),n.import("./dialog/login.js"),n.import("./dialog/progress.html"),n.import("./dialog/progress.js"),n.import("./dialog/simple.html"),n.import("./dialog/simple.js"),n.import("./dialog/unsavedChangesDialog.html"),n.import("./dialog/unsavedChangesDialog.js"),n.import("./dropdown/form.html"),n.import("./dropdown/form.js"),n.import("./form/button.html"),n.import("./form/form.html"),n.import("./form/group.html"),n.import("./form/link.html"),n.import("./input/checkbox.html"),n.import("./input/hidden.html"),n.import("./input/groupRadio.html"),n.import("./input/password.html"),n.import("./input/radio.html"),n.import("./input/range.html"),n.import("./input/select.html"),n.import("./input/text.html"),n.import("./popover/form.html")}],dialog:{"confirm.html":["./template.confirm.js",function(e,t,n){n.exports=e("./template.confirm.js")}],"template.confirm.js":function(){a.__checkName("dialogConfirm"),a.dialogConfirm=new a("Template.dialogConfirm",function(){var e=this;return M._TemplateWith(function(){return P.dataMustache(e.lookup("extend"),e.lookup("."),P.kw({dialogClass:"modal-sm",title:P.dataMustache(e.lookup("choose"),P.dot(e.lookup("."),"title"),"Confirmation")}))},function(){return P.include(e.lookupTemplate("dialogForm"),function(){return["\n ",V.P(M.View("lookup:choose",function(){return P.mustache(e.lookup("choose"),P.dot(e.lookup("."),"message"),"Are you sure you want to perform this action?")})),"\n "]})})})},"form.html":["./template.form.js",function(e,t,n){n.exports=e("./template.form.js")}],"template.form.js":function(){a.__checkName("dialogForm"),a.dialogForm=new a("Template.dialogForm",function(){var e=this;return V.DIV({id:function(){return P.mustache(P.dot(e.lookup("."),"id"))},class:function(){return["modal fade ",P.mustache(P.dot(e.lookup("."),"class"))]},tabindex:"-1",role:"dialog"},"\n ",V.DIV({class:function(){return["modal-dialog ",P.mustache(P.dot(e.lookup("."),"dialogClass"))]},role:"document"},"\n ",M._TemplateWith(function(){return{class:P.call("modal-content"),hideValidationBox:P.call(!0),api:P.call(P.dataMustache(e.lookup("extend"),P.dot(e.lookup("instance"),"api"),P.dot(e.lookup("instance"),"data","api"))),schema:P.call(P.dot(e.lookup("."),"schema"))}},function(){return P.include(e.lookupTemplate("form"),function(){return["\n ",M._TemplateWith(function(){return P.call(e.lookup("."))},function(){return P.include(e.lookupTemplate("dialogHeader"))}),"\n ",V.DIV({class:"modal-body"},"\n ",M.View("lookup:..bodyText",function(){return P.mustache(P.dot(e.lookup("."),"bodyText"))}),"\n ",M._InOuterTemplateScope(e,function(){return P.include(function(){return P.call(e.templateContentBlock)})}),"\n "),"\n ",V.DIV({class:"modal-footer"},"\n ",M._TemplateWith(function(){return"dialogFooter"},function(){return P.include(e.lookupTemplate("section"))}),"\n ",M.Unless(function(){return P.call(P.dot(e.lookup("."),"hideCancel"))},function(){return["\n ",M._TemplateWith(function(){return{action:P.call("cancel"),class:P.call(P.dataMustache(e.lookup("concat"),"btn btn-cancel ",P.dataMustache(e.lookup("choose"),P.dot(e.lookup("."),"cancelClass"),"btn-default"))),tagAttributes:P.call(P.dataMustache(e.lookup("extend"),P.dot(e.lookup("."),"tagAttributes"),P.kw({"data-dismiss":"modal"})))}},function(){return P.include(e.lookupTemplate("button"),function(){return M.View("lookup:choose",function(){return P.mustache(e.lookup("choose"),P.dot(e.lookup("."),"cancelLabel"),"Cancel")})})}),"\n "]}),"\n ",M.Unless(function(){return P.call(P.dot(e.lookup("."),"hideConfirm"))},function(){return["\n ",M._TemplateWith(function(){return{action:P.call("confirm"),class:P.call(P.dataMustache(e.lookup("concat"),"btn btn-confirm ",P.dataMustache(e.lookup("choose"),P.dot(e.lookup("."),"confirmClass"),"btn-primary")))}},function(){return P.include(e.lookupTemplate("button"),function(){return M.View("lookup:choose",function(){return P.mustache(e.lookup("choose"),P.dot(e.lookup("."),"confirmLabel"),"Confirm")})})}),"\n "]}),"\n "),"\n "]})}),"\n "),"\n ")})},"form.js":["meteor/templating","meteor/underscore","meteor/ohif:core",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}});var r;n.import("meteor/underscore",{_:function(e){r=e}});var i;n.import("meteor/ohif:core",{OHIF:function(e){i=e}}),o.dialogForm.onCreated(function(){var e=o.instance();e.api={confirm:function(){function t(){var t=e.$("form").data("component");t.validate()&&e.$(".modal").one("hidden.bs.modal",function(n){var o=t.value();r.isFunction(e.data.confirmCallback)?e.data.confirmCallback(o,e.data.promiseResolve):e.data.promiseResolve(o)}).modal("hide")}return t}(),cancel:function(){function t(){e.$(".modal").one("hidden.bs.modal",function(t){r.isFunction(e.data.cancelCallback)?e.data.cancelCallback(e.data.promiseReject):e.data.promiseReject()}).modal("hide")}return t}()}}),o.dialogForm.onRendered(function(){var e=o.instance(),t=r.extend({backdrop:"static",keyboard:!1},e.data.modalOptions),n=e.$(".modal");n.modal(t);var a=e.data.position,u=e.data.event;!a&&u&&u.clientX&&(a={x:u.clientX,y:u.clientY}),a&&i.ui.repositionDialog(n,a.x,a.y)}),o.dialogForm.events({keydown:function(){function e(e){var t=o.instance(),n=e.keyCode||e.which,r=!1;27===n?(t.$(".btn.btn-cancel").click(),r=!0):13===n&&(t.$(".btn.btn-confirm").click(),r=!0),r&&e.stopPropagation()}return e}()})}],"header.html":["./template.header.js",function(e,t,n){n.exports=e("./template.header.js")}],"template.header.js":function(){a.__checkName("dialogHeader"),a.dialogHeader=new a("Template.dialogHeader",function(){var e=this;return V.DIV({class:"modal-header"},"\n ",M._TemplateWith(function(){return"dialogHeader"},function(){return P.include(e.lookupTemplate("section"))}),"\n ",M.If(function(){return P.call(P.dot(e.lookup("."),"title"))},function(){return["\n ",M._TemplateWith(function(){return{class:P.call("close"),action:P.call("cancel"),tagAttributes:P.call(P.dataMustache(e.lookup("extend"),P.dot(e.lookup("."),"tagAttributes"),P.kw({"data-dismiss":"modal","aria-label":"Close"})))}},function(){return P.include(e.lookupTemplate("button"),function(){return V.SPAN({"aria-hidden":"true"},V.CharRef({html:"&times;",str:"×"}))})}),"\n ",V.H4({class:"modal-title"},"\n ",M.If(function(){return P.call(P.dot(e.lookup("."),"titleIcon"))},function(){return V.I({class:function(){return P.mustache(P.dot(e.lookup("."),"titleIcon"))}})}),"\n ",V.SPAN(M.View("lookup:..title",function(){return P.mustache(P.dot(e.lookup("."),"title"))})),"\n "),"\n "]}),"\n ")})},"info.html":["./template.info.js",function(e,t,n){n.exports=e("./template.info.js")}],"template.info.js":function(){a.__checkName("dialogInfo"),a.dialogInfo=new a("Template.dialogInfo",function(){var e=this;return M._TemplateWith(function(){return P.dataMustache(e.lookup("extend"),e.lookup("."),P.kw({title:P.dataMustache(e.lookup("choose"),P.dot(e.lookup("."),"title"),"Error")}))},function(){return P.include(e.lookupTemplate("dialogSimple"),function(){return["\n ",V.DIV({class:"messages"},"\n ",M.Each(function(){return{_sequence:P.call(P.dot(e.lookup("."),"messages")),_variable:"message"}},function(){return["\n ",V.DIV({class:"message"},M.View("lookup:message",function(){return P.makeRaw(P.mustache(e.lookup("message")))})),"\n "]},function(){return["\n ",M.Let({message:function(){return P.call(P.dataMustache(e.lookup("choose"),P.dot(e.lookup("."),"reason"),P.dot(e.lookup("."),"message"),"An error has ocurred."))}},function(){return["\n ",V.DIV({class:"message"},M.View("lookup:message",function(){return P.mustache(e.lookup("message"))})),"\n "]}),"\n "]}),"\n "),"\n "]})})})},"info.js":["meteor/templating",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}}),o.dialogInfo.onRendered(function(){var e=o.instance(),t=e.$(".modal");t.one("hidden.bs.modal",function(){return e.data.promiseResolve()})})}],"loading.html":["./template.loading.js",function(e,t,n){n.exports=e("./template.loading.js")}],"template.loading.js":function(){a.__checkName("dialogLoading"),a.dialogLoading=new a("Template.dialogLoading",function(){var e=this;return V.DIV({id:function(){return P.mustache(P.dot(e.lookup("."),"id"))},class:function(){return["modal fade ",P.mustache(P.dot(e.lookup("."),"class"))]},tabindex:"-1",role:"dialog"},"\n ",V.DIV({class:"loading-text noselect"},"\n ",M.View("lookup:choose",function(){return P.mustache(e.lookup("choose"),P.dot(e.lookup("."),"text"),"Loading...")})," ",V.Raw('<i class="fa fa-spin fa-circle-o-notch fa-fw"></i>'),"\n "),"\n ")})},"loading.js":["meteor/templating",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}}),o.dialogLoading.onRendered(function(){var e=o.instance(),t=e.$(".modal");t.modal({backdrop:"static",keyboard:!1,modal:!0})})}],"login.html":["./template.login.js",function(e,t,n){n.exports=e("./template.login.js")}],"template.login.js":function(){a.__checkName("dialogLogin"),a.dialogLogin=new a("Template.dialogLogin",function(){var e=this;return M._TemplateWith(function(){return P.dataMustache(e.lookup("extend"),e.lookup("."),P.kw({dialogClass:"modal-sm",schema:P.dataMustache(e.lookup("choose"),P.dot(e.lookup("."),"schema"),P.dot(e.lookup("instance"),"schema"))}))},function(){return P.include(e.lookupTemplate("dialogForm"),function(){return["\n ",M._TemplateWith(function(){return{labelClass:P.call("form-group"),key:P.call("username")}},function(){return P.include(e.lookupTemplate("inputText"))}),"\n ",M._TemplateWith(function(){return{labelClass:P.call("form-group"),key:P.call("password")}},function(){return P.include(e.lookupTemplate("inputPassword"))}),"\n "]})})})},"login.js":["meteor/templating","meteor/aldeed:simple-schema",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}});var r;n.import("meteor/aldeed:simple-schema",{SimpleSchema:function(e){r=e}}),o.dialogLogin.onCreated(function(){var e=o.instance();e.schema=new r({username:{type:String,label:"Username"},password:{type:String,label:"Password"}})})}],"progress.html":["./template.progress.js",function(e,t,n){n.exports=e("./template.progress.js")}],"template.progress.js":function(){a.__checkName("dialogProgress"),a.dialogProgress=new a("Template.dialogProgress",function(){var e=this;return M._TemplateWith(function(){return P.dataMustache(e.lookup("extend"),e.lookup("."),P.kw({dialogClass:"modal-sm modal-progress",title:P.dataMustache(e.lookup("choose"),P.dot(e.lookup("."),"title"),"Processing...")}))},function(){return P.include(e.lookupTemplate("dialogForm"),function(){return["\n ",V.DIV({class:"status"},"\n ",V.DIV({class:"progress-bar-container"},"\n ",V.DIV({class:"progress-bar progress-bar-striped active",role:"progressbar",style:function(){return["width: ",P.mustache(e.lookup("progress")),"%"]}},"\n ",V.DIV({class:"percentage"},M.View("lookup:formatNumberPrecision",function(){return P.mustache(e.lookup("formatNumberPrecision"),e.lookup("progress"),0)}),"%"),"\n "),"\n "),"\n "),"\n ",V.DIV({class:"message"},"\n ",M.View("lookup:message",function(){return P.makeRaw(P.mustache(e.lookup("message")))}),"\n "),"\n "]})})})},"progress.js":["meteor/templating","meteor/reactive-var","meteor/underscore",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}});var r;n.import("meteor/reactive-var",{ReactiveVar:function(e){r=e}});var i;n.import("meteor/underscore",{_:function(e){i=e}}),o.dialogProgress.onCreated(function(){var e=o.instance();e.state=new r({processed:0,total:e.data.total,message:e.data.message})}),o.dialogProgress.onRendered(function(){var e=o.instance(),t=e.data.task,n={promise:e.data.promise,done:function(){function t(t){e.$(".modal").on("hidden.bs.modal",function(n){e.data.promiseResolve(t)}).modal("hide")}return t}(),cancel:function(){function t(){e.$(".modal").on("hidden.bs.modal",function(t){e.data.promiseReject()}).modal("hide")}return t}(),update:i.throttle(function(t){var n=e.state.get();n.processed=Math.max(0,t),e.state.set(n)},100),setTotal:i.throttle(function(t){var n=e.state.get();n.total=t,e.state.set(n)},100),setMessage:i.throttle(function(t){var n=e.state.get();n.message=t,e.state.set(n)},100)};t.run(n)}),o.dialogProgress.helpers({progress:function(){function e(){var e=o.instance(),t=e.state.get();return t&&t.total?100*Math.min(1,t.processed/t.total):0}return e}(),message:function(){function e(){var e=o.instance(),t=e.state.get();if(t)return"function"==typeof t.message?t.message(t):t.message}return e}()})}],"simple.html":["./template.simple.js",function(e,t,n){n.exports=e("./template.simple.js")}],"template.simple.js":function(){a.__checkName("dialogSimple"),a.dialogSimple=new a("Template.dialogSimple",function(){var e=this;return V.DIV({id:function(){return P.mustache(P.dot(e.lookup("."),"id"))},class:function(){return["modal fade ",P.mustache(P.dot(e.lookup("."),"class"))]},tabindex:"-1",role:"dialog"},"\n ",V.DIV({class:function(){return["modal-dialog ",P.mustache(P.dot(e.lookup("."),"dialogClass"))]},role:"document"},"\n ",V.DIV({class:"modal-content"},"\n ",M._TemplateWith(function(){return P.call(e.lookup("."))},function(){return P.include(e.lookupTemplate("dialogHeader"))}),"\n ",V.DIV({class:"modal-body"},"\n ",M._InOuterTemplateScope(e,function(){return P.include(function(){return P.call(e.templateContentBlock)})}),"\n "),"\n ",V.DIV({class:"modal-footer"},M._TemplateWith(function(){return"dialogFooter"},function(){return P.include(e.lookupTemplate("section"))})),"\n "),"\n "),"\n ")})},"simple.js":["meteor/meteor","meteor/templating","meteor/underscore","meteor/ohif:core",function(e,t,n){var o;n.import("meteor/meteor",{Meteor:function(e){o=e}});var r;n.import("meteor/templating",{Template:function(e){r=e}});var i;n.import("meteor/underscore",{_:function(e){i=e}});var a;n.import("meteor/ohif:core",{OHIF:function(e){a=e}}),r.dialogSimple.onCreated(function(){var e=r.instance();e.close=function(){var t=e.$(".modal");t.on("hidden.bs.modal",function(){return e.data.promiseResolve()}).modal("hide")},e.data.timeout&&o.setTimeout(e.close,e.data.timeout)}),r.dialogSimple.onRendered(function(){var e=r.instance(),t=i.extend({backdrop:"static",keyboard:!1},e.data.modalOptions),n=e.$(".modal");n.modal(t);var o=e.data.position;o&&a.ui.repositionDialog(n,o.x,o.y)}),r.dialogSimple.events({keydown:function(){function e(e){var t=r.instance(),n=e.keyCode||e.which;27===n&&(t.close(),e.stopPropagation())}return e}()})}],"unsavedChangesDialog.html":["./template.unsavedChangesDialog.js",function(e,t,n){n.exports=e("./template.unsavedChangesDialog.js")}],"template.unsavedChangesDialog.js":function(){a.__checkName("unsavedChangesDialog"),a.unsavedChangesDialog=new a("Template.unsavedChangesDialog",function(){var e=this;return V.DIV({class:"modal unsavedChangesDialog fade",tabindex:"-1",role:"dialog"},"\n ",V.DIV({class:"modal-dialog",role:"document"},"\n ",V.DIV({class:"modal-content"},"\n ",V.Raw('<div class="modal-header">\n <button class="close" aria-label="Close" data-choice="abort-action" data-dismiss="modal">\n <span aria-hidden="true">&times;</span>\n </button>\n <h4 class="modal-title">You have unsaved changes!</h4>\n </div>'),"\n ",V.DIV({class:"modal-footer"},"\n\n ",M.Let({label:function(){return P.call("Stay")}},function(){return["\n ",V.BUTTON({class:"btn btn-default","aria-label":function(){return P.mustache(e.lookup("label"))},"data-choice":"abort-action","data-dismiss":"modal"},"\n ",M.View("lookup:label",function(){return P.mustache(e.lookup("label"))}),"\n "),"\n "]}),"\n\n ",M.Let({label:function(){return P.call("Leave without saving...")}},function(){return["\n ",V.BUTTON({class:"btn btn-danger","aria-label":function(){return P.mustache(e.lookup("label"))},"data-choice":"abandon-changes","data-dismiss":"modal"},"\n ",M.View("lookup:label",function(){return P.mustache(e.lookup("label"))}),"\n "),"\n "]}),"\n\n ",M.Let({label:function(){return P.call("Save and Exit!")}},function(){return["\n ",V.BUTTON({class:"btn btn-primary","aria-label":function(){return P.mustache(e.lookup("label"))},"data-choice":"save-changes","data-dismiss":"modal"},"\n ",M.View("lookup:label",function(){return P.mustache(e.lookup("label"))}),"\n "),"\n "]}),"\n\n "),"\n "),"\n "),"\n ")})},"unsavedChangesDialog.js":["meteor/blaze","meteor/templating","meteor/ohif:core","meteor/underscore","meteor/jquery",function(e,t,n){var o;n.import("meteor/blaze",{Blaze:function(e){o=e}});var r;n.import("meteor/templating",{Template:function(e){r=e}});var i;n.import("meteor/ohif:core",{OHIF:function(e){i=e}});var a;n.import("meteor/underscore",{_:function(e){a=e}});var u;n.import("meteor/jquery",{$:function(e){u=e}});var l=15,c=15;r.unsavedChangesDialog.onRendered(function(){var e=r.instance(),t=e.$(".modal.unsavedChangesDialog");e.displayModal=function(){var n=a.extend({backdrop:"static",keyboard:!1},e.data.modalOptions);t.on("hidden.bs.modal",function(){o.remove(e.view)}),t.modal(n)},e.displayModalWithPosition=function(n){var o={display:t.css("display"),visibility:t.css("visibility")};"none"===o.display&&t.css({visibility:"hidden",display:"block"}),setTimeout(function(){var r=void 0,i=t.find(".modal-dialog"),a={position:{x:parseInt(n.x)||0,y:parseInt(n.y)||0},size:{width:i.outerWidth(),height:i.outerHeight()}},u={width:t.width(),height:t.height()};r=a.position.x+a.size.width+l,r>u.width&&(a.position.x-=r-u.width),a.position.x<0&&(a.position.x=0),r=a.position.y+a.size.height+c,r>u.height&&(a.position.y-=r-u.height),a.position.y<0&&(a.position.y=0),t.css(o),i.css({position:"fixed",margin:0,left:a.position.x,top:a.position.y}),e.displayModal()},0)};var n=e.data.position;n&&"x"in n&&"y"in n?e.displayModalWithPosition(n):e.displayModal()}),r.unsavedChangesDialog.events({"click button[data-choice]":function(){function e(e){var t=r.instance(),n=t.data.callback,o=u(e.currentTarget).attr("data-choice")||"";"function"==typeof n&&n.call(t,o)}return e}()})}]},dropdown:{"form.html":["./template.form.js",function(e,t,n){n.exports=e("./template.form.js")}],"template.form.js":function(){a.__checkName("dropdownForm"),a.dropdownForm=new a("Template.dropdownForm",function(){var e=this;return M._TemplateWith(function(){return P.dataMustache(e.lookup("extend"),e.lookup("."),P.kw({mixins:"dropdown",class:"dropdown",hideValidationBox:!0}))},function(){return P.include(e.lookupTemplate("form"),function(){return["\n ",M._TemplateWith(function(){return{items:P.call(P.dot(e.lookup("."),"items")),classes:P.call(P.dot(e.lookup("."),"options","menuClasses"))}},function(){return P.include(e.lookupTemplate("dropdownFormMenu"))}),"\n "]})})}),a.__checkName("dropdownFormMenu"),a.dropdownFormMenu=new a("Template.dropdownFormMenu",function(){var e=this;return V.UL({class:function(){return["dropdown-menu ",P.mustache(P.dot(e.lookup("."),"classes"))]}},"\n ",M.If(function(){return P.call(e.templateContentBlock)},function(){return["\n ",M._InOuterTemplateScope(e,function(){return P.include(function(){return P.call(e.templateContentBlock)})}),"\n "]},function(){return["\n ",M.Each(function(){return{_sequence:P.call(P.dot(e.lookup("."),"items")),_variable:"item"}},function(){return["\n ",M.If(function(){return P.dataMustache(e.lookup("isVisible"),e.lookup("item"))},function(){return["\n ",M.If(function(){return P.call(P.dot(e.lookup("item"),"separatorBefore"))},function(){return["\n ",V.LI({role:"separator",class:"divider"}),"\n "]}),"\n ",V.LI({class:function(){return[M.If(function(){return P.call(P.dot(e.lookup("item"),"disabled"))},function(){return"disabled"})," ",M.If(function(){return P.call(P.dot(e.lookup("item"),"items"))},function(){return"dropdown-submenu"})]}},"\n ",M._TemplateWith(function(){return P.call(e.lookup("item"))},function(){return P.include(e.lookupTemplate("link"),function(){return["\n ",M.If(function(){return P.call(P.dot(e.lookup("item"),"icon"))},function(){return["\n ",V.I({class:function(){return[P.mustache(P.dot(e.lookup("item"),"icon"))," ",P.mustache(P.dot(e.lookup("item"),"iconClasses"))]}}),"\n "]}),"\n ",M.If(function(){return P.call(P.dot(e.lookup("item"),"iconSvgUse"))},function(){return["\n ",V.SVG({class:function(){return P.mustache(P.dot(e.lookup("item"),"iconClasses"))}},"\n ",V.USE({"xlink:href":function(){return P.mustache(e.lookup("absoluteUrl"),P.dot(e.lookup("item"),"iconSvgUse"))}}),"\n "),"\n "]}),"\n ",M.If(function(){return P.call(P.dot(e.lookup("item"),"text"))},function(){return["\n ",V.SPAN(M.View("lookup:item.text",function(){return P.mustache(P.dot(e.lookup("item"),"text"))})),"\n "]}),"\n "]})}),"\n "),"\n ",M.If(function(){return P.call(P.dot(e.lookup("item"),"separatorAfter"))},function(){return["\n ",V.LI({role:"separator",class:"divider"}),"\n "]}),"\n "]}),"\n "]}),"\n "]}),"\n ")})},"form.js":["meteor/templating",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}}),o.dropdownFormMenu.helpers({isVisible:function(){function e(e){var t=!0;return"function"==typeof e.visible?t=e.visible():"undefined"!=typeof e.visible&&(t=!!e.visible),t}return e}()})}]},form:{"button.html":["./template.button.js",function(e,t,n){n.exports=e("./template.button.js")}],"template.button.js":function(){a.__checkName("button"),a.button=new a("Template.button",function(){var e=this;return M._TemplateWith(function(){return P.dataMustache(e.lookup("extend"),e.lookup("."),P.kw({base:"baseButton",mixins:P.dataMustache(e.lookup("concat"),"button action ",P.dot(e.lookup("."),"mixins"))}))},function(){
return P.include(e.lookupTemplate("baseComponent"),function(){return["\n ",M._InOuterTemplateScope(e,function(){return P.include(function(){return P.call(e.templateContentBlock)})}),"\n "]})})})},"form.html":["./template.form.js",function(e,t,n){n.exports=e("./template.form.js")}],"template.form.js":function(){a.__checkName("form"),a.form=new a("Template.form",function(){var e=this;return M._TemplateWith(function(){return P.dataMustache(e.lookup("extend"),e.lookup("."),P.kw({base:"baseForm",mixins:P.dataMustache(e.lookup("concat"),"form ",P.dot(e.lookup("."),"mixins"))}))},function(){return P.include(e.lookupTemplate("baseComponent"),function(){return["\n ",M._InOuterTemplateScope(e,function(){return P.include(function(){return P.call(e.templateContentBlock)})}),"\n "]})})})},"group.html":["./template.group.js",function(e,t,n){n.exports=e("./template.group.js")}],"template.group.js":function(){a.__checkName("group"),a.group=new a("Template.group",function(){var e=this;return M._TemplateWith(function(){return P.dataMustache(e.lookup("extend"),e.lookup("."),P.kw({class:P.dataMustache(e.lookup("concat"),"component-group ",P.dot(e.lookup("."),"class")),base:P.dataMustache(e.lookup("choose"),P.dot(e.lookup("."),"base"),"baseDiv"),mixins:P.dataMustache(e.lookup("concat"),"group ",P.dot(e.lookup("."),"mixins"))}))},function(){return P.include(e.lookupTemplate("baseComponent"),function(){return["\n ",M._InOuterTemplateScope(e,function(){return P.include(function(){return P.call(e.templateContentBlock)})}),"\n "]})})})},"link.html":["./template.link.js",function(e,t,n){n.exports=e("./template.link.js")}],"template.link.js":function(){a.__checkName("link"),a.link=new a("Template.link",function(){var e=this;return M._TemplateWith(function(){return P.dataMustache(e.lookup("extend"),e.lookup("."),P.kw({base:"baseLink",mixins:P.dataMustache(e.lookup("concat"),"link action ",P.dot(e.lookup("."),"mixins"))}))},function(){return P.include(e.lookupTemplate("baseComponent"),function(){return["\n ",M._InOuterTemplateScope(e,function(){return P.include(function(){return P.call(e.templateContentBlock)})}),"\n "]})})})}},input:{"checkbox.html":["./template.checkbox.js",function(e,t,n){n.exports=e("./template.checkbox.js")}],"template.checkbox.js":function(){a.__checkName("inputCheckbox"),a.inputCheckbox=new a("Template.inputCheckbox",function(){var e=this;return M._TemplateWith(function(){return P.dataMustache(e.lookup("extend"),e.lookup("."),P.kw({base:"baseInput",type:"checkbox",mixins:P.dataMustache(e.lookup("concat"),"checkbox ",P.dot(e.lookup("."),"mixins")),labelAfter:P.dataMustache(e.lookup("valueIf"),P.dataMustache(e.lookup("isUndefined"),P.dot(e.lookup("."),"labelAfter")),!0,P.dot(e.lookup("."),"labelAfter")),labelClass:P.dataMustache(e.lookup("concat"),"checkboxLabel ",P.dot(e.lookup("."),"labelClass")),wrappers:P.dataMustache(e.lookup("concat"),"",P.dataMustache(e.lookup("valueIf"),e.lookup("reactive"),P.dot(e.lookup("."),"label"),"wrapperLabel ",""),P.dot(e.lookup("."),"wrappers"))}))},function(){return P.include(e.lookupTemplate("baseComponent"),function(){return["\n ",M._InOuterTemplateScope(e,function(){return P.include(function(){return P.call(e.templateContentBlock)})}),"\n "]})})})},"groupRadio.html":["./template.groupRadio.js",function(e,t,n){n.exports=e("./template.groupRadio.js")}],"template.groupRadio.js":function(){a.__checkName("groupRadio"),a.groupRadio=new a("Template.groupRadio",function(){var e=this;return M._TemplateWith(function(){return P.dataMustache(e.lookup("extend"),e.lookup("."),P.kw({class:P.dataMustache(e.lookup("concat"),"group-radio ",P.dot(e.lookup("."),"class")),mixins:P.dataMustache(e.lookup("concat"),"groupRadio ",P.dot(e.lookup("."),"mixins")),wrappers:P.dataMustache(e.lookup("concat"),"",P.dataMustache(e.lookup("valueIf"),e.lookup("reactive"),P.dot(e.lookup("."),"label"),"wrapperLabel ",""),P.dot(e.lookup("."),"wrappers")),labelAsDiv:!0}))},function(){return P.include(e.lookupTemplate("group"),function(){return["\n ",M._InOuterTemplateScope(e,function(){return P.include(function(){return P.call(e.templateContentBlock)})}),"\n ",M.Each(function(){return{_sequence:P.dataMustache(e.lookup("reactive"),P.dot(e.lookup("."),"items")),_variable:"item"}},function(){return["\n ",M._TemplateWith(function(){return{class:P.call(P.dot(e.lookup("."),"radioClass")),name:P.call(P.dot(e.lookup("."),"key")),value:P.call(P.dot(e.lookup("item"),"value")),label:P.call(P.dot(e.lookup("item"),"label")),checked:P.call(P.dataMustache(e.lookup("eq"),P.dot(e.lookup("item"),"value"),P.dataMustache(e.lookup("reactive"),P.dot(e.lookup("."),"value"))))}},function(){return P.include(e.lookupTemplate("inputRadio"))}),"\n "]}),"\n "]})})})},"hidden.html":["./template.hidden.js",function(e,t,n){n.exports=e("./template.hidden.js")}],"template.hidden.js":function(){a.__checkName("inputHidden"),a.inputHidden=new a("Template.inputHidden",function(){var e=this;return M._TemplateWith(function(){return P.dataMustache(e.lookup("extend"),e.lookup("."),P.kw({base:"baseInput",type:"hidden",mixins:P.dataMustache(e.lookup("concat"),"input ",P.dot(e.lookup("."),"mixins"))}))},function(){return P.include(e.lookupTemplate("baseComponent"))})})},"password.html":["./template.password.js",function(e,t,n){n.exports=e("./template.password.js")}],"template.password.js":function(){a.__checkName("inputPassword"),a.inputPassword=new a("Template.inputPassword",function(){var e=this;return M._TemplateWith(function(){return P.dataMustache(e.lookup("extend"),e.lookup("."),P.kw({type:"password"}))},function(){return P.include(e.lookupTemplate("inputText"),function(){return["\n ",M._InOuterTemplateScope(e,function(){return P.include(function(){return P.call(e.templateContentBlock)})}),"\n "]})})})},"radio.html":["./template.radio.js",function(e,t,n){n.exports=e("./template.radio.js")}],"template.radio.js":function(){a.__checkName("inputRadio"),a.inputRadio=new a("Template.inputRadio",function(){var e=this;return M._TemplateWith(function(){return P.dataMustache(e.lookup("extend"),e.lookup("."),P.kw({base:"baseInput",type:"radio",mixins:P.dataMustache(e.lookup("concat"),"input ",P.dot(e.lookup("."),"mixins")),labelAfter:P.dataMustache(e.lookup("valueIf"),P.dataMustache(e.lookup("isUndefined"),P.dot(e.lookup("."),"labelAfter")),!0,P.dot(e.lookup("."),"labelAfter")),labelClass:P.dataMustache(e.lookup("concat"),"radioLabel ",P.dot(e.lookup("."),"labelClass")),wrappers:P.dataMustache(e.lookup("concat"),"",P.dataMustache(e.lookup("valueIf"),e.lookup("reactive"),P.dot(e.lookup("."),"label"),"wrapperLabel ",""),P.dot(e.lookup("."),"wrappers"))}))},function(){return P.include(e.lookupTemplate("baseComponent"),function(){return["\n ",M._InOuterTemplateScope(e,function(){return P.include(function(){return P.call(e.templateContentBlock)})}),"\n "]})})})},"range.html":["./template.range.js",function(e,t,n){n.exports=e("./template.range.js")}],"template.range.js":function(){a.__checkName("inputRange"),a.inputRange=new a("Template.inputRange",function(){var e=this;return M._TemplateWith(function(){return P.dataMustache(e.lookup("extend"),e.lookup("."),P.kw({base:"baseInput",type:"range",class:P.dataMustache(e.lookup("concat"),"form-control ",P.dot(e.lookup("."),"class")),mixins:P.dataMustache(e.lookup("concat"),"input ",P.dot(e.lookup("."),"mixins")),wrappers:P.dataMustache(e.lookup("concat"),"",P.dataMustache(e.lookup("valueIf"),e.lookup("reactive"),P.dot(e.lookup("."),"label"),"wrapperLabel ",""),P.dot(e.lookup("."),"wrappers"))}))},function(){return P.include(e.lookupTemplate("baseComponent"),function(){return["\n ",M._InOuterTemplateScope(e,function(){return P.include(function(){return P.call(e.templateContentBlock)})}),"\n "]})})})},"select.html":["./template.select.js",function(e,t,n){n.exports=e("./template.select.js")}],"template.select.js":function(){a.__checkName("inputSelect"),a.inputSelect=new a("Template.inputSelect",function(){var e=this;return M._TemplateWith(function(){return P.dataMustache(e.lookup("extend"),e.lookup("."),P.kw({base:"baseSelect",mixins:P.dataMustache(e.lookup("concat"),"select2 ",P.dot(e.lookup("."),"mixins")),wrappers:P.dataMustache(e.lookup("concat"),"",P.dataMustache(e.lookup("valueIf"),e.lookup("reactive"),P.dot(e.lookup("."),"label"),"wrapperLabel ",""),P.dot(e.lookup("."),"wrappers")),options:P.dataMustache(e.lookup("clone"),P.dot(e.lookup("."),"options"),P.kw({multiple:P.dataMustache(e.lookup("choose"),P.dot(e.lookup("."),"options","multiple"),P.dot(e.lookup("."),"multiple"),!1),placeholder:P.dataMustache(e.lookup("choose"),P.dot(e.lookup("."),"options","placeholder"),P.dot(e.lookup("."),"placeholder")),minimumResultsForSearch:P.dataMustache(e.lookup("valueIf"),P.dot(e.lookup("."),"hideSearch"),-1,P.dot(e.lookup("."),"options","minimumResultsForSearch"))}))}))},function(){return P.include(e.lookupTemplate("baseComponent"),function(){return["\n ",M._InOuterTemplateScope(e,function(){return P.include(function(){return P.call(e.templateContentBlock)})}),"\n "]})})})},"text.html":["./template.text.js",function(e,t,n){n.exports=e("./template.text.js")}],"template.text.js":function(){a.__checkName("inputText"),a.inputText=new a("Template.inputText",function(){var e=this;return M._TemplateWith(function(){return P.dataMustache(e.lookup("extend"),e.lookup("."),P.kw({base:"baseInput",class:P.dataMustache(e.lookup("concat"),"form-control ",P.dot(e.lookup("."),"class")),mixins:P.dataMustache(e.lookup("concat"),"input ",P.dot(e.lookup("."),"mixins")),wrappers:P.dataMustache(e.lookup("concat"),"",P.dataMustache(e.lookup("valueIf"),e.lookup("reactive"),P.dot(e.lookup("."),"label"),"wrapperLabel ",""),P.dot(e.lookup("."),"wrappers"))}))},function(){return P.include(e.lookupTemplate("baseComponent"),function(){return["\n ",M._InOuterTemplateScope(e,function(){return P.include(function(){return P.call(e.templateContentBlock)})}),"\n "]})})})}},popover:{"form.html":["./template.form.js",function(e,t,n){n.exports=e("./template.form.js")}],"template.form.js":function(){a.__checkName("popoverForm"),a.popoverForm=new a("Template.popoverForm",function(){var e=this;return M._TemplateWith(function(){return P.dataMustache(e.lookup("extend"),e.lookup("."),P.kw({mixins:"popover",hideValidationBox:!0}))},function(){return P.include(e.lookupTemplate("form"),function(){return["\n ",M.If(function(){return P.call(P.dot(e.lookup("."),"message"))},function(){return["\n ",V.P(M.View("lookup:..message",function(){return P.mustache(P.dot(e.lookup("."),"message"))})),"\n "]}),"\n ",M._InOuterTemplateScope(e,function(){return P.include(function(){return P.call(e.templateContentBlock)})}),"\n ",V.DIV({class:function(){return["popover-form-buttons ",M.If(function(){return P.dataMustache(e.lookup("eq"),P.dot(e.lookup("."),"placement"),"left")},function(){return"text-right"})]}},"\n ",M._TemplateWith(function(){return{action:P.call("cancel"),class:P.call(P.dataMustache(e.lookup("concat"),"btn btn-cancel ",P.dataMustache(e.lookup("choose"),P.dot(e.lookup("."),"cancelClass"),"btn-secondary"))),tagAttributes:P.call(P.dataMustache(e.lookup("extend"),P.dot(e.lookup("."),"tagAttributes"),P.kw({"data-dismiss":"modal"})))}},function(){return P.include(e.lookupTemplate("button"),function(){return M.View("lookup:choose",function(){return P.mustache(e.lookup("choose"),P.dot(e.lookup("."),"cancelLabel"),"Cancel")})})}),"\n ",M._TemplateWith(function(){return{action:P.call("confirm"),class:P.call(P.dataMustache(e.lookup("concat"),"btn btn-confirm ",P.dataMustache(e.lookup("choose"),P.dot(e.lookup("."),"confirmClass"),"btn-primary")))}},function(){return P.include(e.lookupTemplate("button"),function(){return M.View("lookup:choose",function(){return P.mustache(e.lookup("choose"),P.dot(e.lookup("."),"confirmLabel"),"Confirm")})})}),"\n "),"\n "]})})})}}},playground:{"playground.html":["./template.playground.js",function(e,t,n){n.exports=e("./template.playground.js")}],"template.playground.js":function(){a.__checkName("componentPlayground"),a.componentPlayground=new a("Template.componentPlayground",function(){var e=this;return V.Raw('<div class="layout-container">\n <div class="layout-header">\n <div class="logo">LOGO</div>\n <div class="toolbar">\n <div class="toolbar-main">\n <button class="js-toggle-left">Toggle left</button>\n <button>Tool 1</button>\n <button>Tool 2</button>\n <button>Tool 3</button>\n <button class="js-tool-more">More...</button>\n <button class="js-toggle-right pull-right">Toggle right</button>\n </div>\n <div class="toolbar-drawer">\n <button>Tool 4</button>\n <button>Tool 5</button>\n <button>Tool 6</button>\n <button>Tool 7</button>\n </div>\n </div>\n </div>\n <div class="layout-body">\n <div class="layout-sidebar layout-sidebar-left">LEFT|LEFT|LEFT</div>\n <div class="layout-main">MAIN CONTENT</div>\n <div class="layout-sidebar layout-sidebar-right">RIGHT|RIGHT|RIGHT|RIGHT</div>\n </div>\n </div>')})},"playground.js":["meteor/templating","meteor/reactive-var","meteor/ohif:core",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}});var r;n.import("meteor/reactive-var",{ReactiveVar:function(e){r=e}});var i;n.import("meteor/ohif:core",{OHIF:function(e){i=e}}),i.ui.layoutState={leftSidebar:new r((!1)),rightSidebar:new r((!1)),toolsDrawer:new r((!1))},o.componentPlayground.onRendered(function(){var e=o.instance();e.$(".toolbar-drawer").adjustMax("height"),e.autorun(function(){var t=i.ui.layoutState.toolsDrawer.get();e.$(".toolbar-drawer").toggleClass("open",t)}),e.$(".layout-sidebar-left").adjustMax("width"),e.autorun(function(){var t=i.ui.layoutState.leftSidebar.get();e.$(".layout-sidebar-left").toggleClass("open",t)}),e.$(".layout-sidebar-right").adjustMax("width"),e.autorun(function(){var t=i.ui.layoutState.rightSidebar.get();e.$(".layout-sidebar-right").toggleClass("open",t)})}),o.componentPlayground.events({"click .js-tool-more":function(){function e(e,t){var n=i.ui.layoutState.toolsDrawer.get();i.ui.layoutState.toolsDrawer.set(!n)}return e}(),"click .js-toggle-left":function(){function e(e,t){var n=i.ui.layoutState.leftSidebar.get();i.ui.layoutState.leftSidebar.set(!n)}return e}(),"click .js-toggle-right":function(){function e(e,t){var n=i.ui.layoutState.rightSidebar.get();i.ui.layoutState.rightSidebar.set(!n)}return e}()})}],"playground.styl":["./playground.styl.css",function(e,t,n){n.exports=e("./playground.styl.css")}],"playground.styl.css":["meteor/modules",function(e,t,n){n.exports=e("meteor/modules").addStyles(".layout-container {\n align-items: stretch;\n display: flex;\n flex-flow: column nowrap;\n height: 100vh;\n}\n.layout-container .layout-header {\n background-color: #0ff;\n flex-grow: 0;\n}\n.layout-container .layout-body {\n align-items: stretch;\n display: flex;\n flex-grow: 1;\n}\n.layout-sidebar {\n background-color: #0f0;\n flex-grow: 0;\n}\n.layout-main {\n background-color: #fff;\n flex-grow: 1;\n}\n.toolbar-drawer {\n overflow: hidden;\n transition: max-height 0.3s ease;\n}\n.toolbar-drawer:not(.open) {\n max-height: 0 !important;\n}\n.layout-sidebar-left,\n.layout-sidebar-right {\n overflow: hidden;\n transition: max-width 0.3s ease;\n}\n.layout-sidebar-left:not(.open),\n.layout-sidebar-right:not(.open) {\n max-width: 0 !important;\n}\n")}]}},helpers:{"blaze.js":["meteor/templating","meteor/session","meteor/reactive-var","meteor/ohif:core",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}});var r;n.import("meteor/session",{Session:function(e){r=e}});var i;n.import("meteor/reactive-var",{ReactiveVar:function(e){i=e}});var a;n.import("meteor/ohif:core",{OHIF:function(e){a=e}}),o.registerHelper("absoluteUrl",function(e){return a.utils.absoluteUrl(e)}),o.registerHelper("instance",function(){return o.instance()}),o.registerHelper("session",function(e){return r.get(e)}),o.registerHelper("reactive",function(e){return e instanceof i?e.get():e})}],"data.js":["babel-runtime/helpers/toConsumableArray","babel-runtime/helpers/typeof","meteor/underscore","meteor/templating",function(e,t,n){var o;n.import("babel-runtime/helpers/toConsumableArray",{default:function(e){o=e}});var r;n.import("babel-runtime/helpers/typeof",{default:function(e){r=e}});var i;n.import("meteor/underscore",{_:function(e){i=e}});var a;n.import("meteor/templating",{Template:function(e){a=e}});var u=function e(){for(var t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];var a=n[0]||{},u=i.last(n),l=u?u.hash:null,c=i.initial(n);return i.each(c,function(e){"object"===("undefined"==typeof e?"undefined":r(e))&&i.extend(a,e)}),i.extend(a,l),a};a.registerHelper("extend",function(){return u.apply(void 0,arguments)}),a.registerHelper("clone",function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.slice();return r.unshift({}),u.apply(void 0,o(r))}),a.registerHelper("choose",function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var o=void 0;return i.each(i.initial(t,1),function(e){o||(o=e)}),o})}],"debug.js":["meteor/underscore","meteor/meteor","meteor/templating",function(e,t,n){var o;n.import("meteor/underscore",{_:function(e){o=e}});var r;n.import("meteor/meteor",{Meteor:function(e){r=e}});var i;n.import("meteor/templating",{Template:function(e){i=e}}),r.isDevelopment&&i.registerHelper("debug",function(){var e;(e=console).debug.apply(e,arguments)})}],"index.js":["./blaze.js","./data.js","./debug.js","./logical.js","./number.js","./string.js","./typing.js","./ui.js",function(e,t,n){n.import("./blaze.js"),n.import("./data.js"),n.import("./debug.js"),n.import("./logical.js"),n.import("./number.js"),n.import("./string.js"),n.import("./typing.js"),n.import("./ui.js")}],"logical.js":["meteor/underscore","meteor/templating",function(e,t,n){var o;n.import("meteor/underscore",{_:function(e){o=e}});var r;n.import("meteor/templating",{Template:function(e){r=e}}),r.registerHelper("bool",function(e){return!!e}),r.registerHelper("eq",function(e,t){return e===t}),r.registerHelper("ne",function(e,t){return e!==t}),r.registerHelper("gt",function(e,t){return e>t}),r.registerHelper("lt",function(e,t){return e<t}),r.registerHelper("gte",function(e,t){return e>=t}),r.registerHelper("lte",function(e,t){return e<=t}),r.registerHelper("not",function(e){return!e}),r.registerHelper("and",function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=!0;return o.each(o.initial(t,1),function(e){return!e&&(r=!1)}),r}),r.registerHelper("or",function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=!1;return o.each(o.initial(t,1),function(e){return e&&(r=!0)}),r}),r.registerHelper("valueIf",function(e,t,n){return e?t:n})}],"number.js":["meteor/underscore","meteor/templating",function(e,t,n){var o;n.import("meteor/underscore",{_:function(e){o=e}});var r;n.import("meteor/templating",{Template:function(e){r=e}}),r.registerHelper("sum",function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=0;return o.each(o.initial(t,1),function(e){return r+=0|e}),r}),r.registerHelper("isValidNumber",function(e){return"number"==typeof e&&!isNaN(e)}),r.registerHelper("filterNaN",function(e){return isNaN(e)?"":e})}],"string.js":["meteor/ohif:core","meteor/underscore","meteor/templating",function(e,t,n){var o;n.import("meteor/ohif:core",{OHIF:function(e){o=e}});var r;n.import("meteor/underscore",{_:function(e){r=e}});var i;n.import("meteor/templating",{Template:function(e){i=e}}),i.registerHelper("concat",function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var o=r.initial(t,1),i="";return r.each(o,function(e){i+="undefined"!=typeof e?e:""}),i}),i.registerHelper("encodeId",function(e){return o.string.encodeId(e)})}],"typing.js":["meteor/underscore","meteor/templating",function(e,t,n){var o;n.import("meteor/underscore",{_:function(e){o=e}});var r;n.import("meteor/templating",{Template:function(e){r=e}}),r.registerHelper("isUndefined",function(e){return o.isUndefined(e)}),r.registerHelper("isObject",function(e){return o.isObject(e)}),r.registerHelper("isArray",function(e){return o.isArray(e)})}],"ui.js":["meteor/ohif:core","meteor/templating",function(e,t,n){var o;n.import("meteor/ohif:core",{OHIF:function(e){o=e}});var r;n.import("meteor/templating",{Template:function(e){r=e}}),r.registerHelper("uiSettings",function(){return o.uiSettings})}]},lib:{"blaze.js":["meteor/templating","meteor/ohif:core",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}});var r;n.import("meteor/ohif:core",{OHIF:function(e){r=e}}),r.blaze={},r.blaze.cloneTemplate=function(e,t){if(e){var n=t||e.viewName,r=new o(n,e.renderFunction);return r.inheritsEventsFrom(e),r.inheritsHelpersFrom(e),r.inheritsHooksFrom(e),r}},r.blaze.getParentView=function(e,t){for(var n=e;n&&n.name!==t;)n=n.originalParentView||n.parentView;return n},r.blaze.getParentComponent=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"_component",n=e;n;)if(n=n.originalParentView||n.parentView,n&&n[t])return n[t]},r.blaze.getParentTemplateView=function(e){for(var t=e;t;){if(t=t.originalParentView||t.parentView,!t||!t.name)return;if(t.name.indexOf("Template.")>-1&&t.name.indexOf("Template.__dynamic")===-1)return t}},r.blaze.getSectionContent=function(e,t){for(var n=e;!n._sectionMap||!n._sectionMap.get(t);)if(n=r.blaze.getParentTemplateView(n),!n)return;return n._sectionMap.get(t)}}],"cornerstone.js":["babel-runtime/helpers/typeof","meteor/ohif:core","meteor/underscore",function(e,t,n){var r;n.import("babel-runtime/helpers/typeof",{default:function(e){r=e}});var i;n.import("meteor/ohif:core",{OHIF:function(e){i=e}});var a;n.import("meteor/underscore",{_:function(e){a=e}}),i.cornerstone={},i.cornerstone.pixelToPage=function(e,t){var n=cornerstone.getEnabledElement(e),i={x:0,y:0};if(!n||"object"!==("undefined"==typeof t?"undefined":r(t)))return i;var a=n.canvas,u=o(a).offset();i.x+=u.left,i.y+=u.top;var l=cornerstone.pixelToCanvas(e,t);return i.x+=l.x,i.y+=l.y,i},i.cornerstone.repositionTextBox=function(e,t,n){function r(e,t,n,o){e=e||{};var r=e.centering||{},i=!!r.x,a=!!r.y,u=o.x/2,l=o.y/2,c={x:[],y:[]};if("x"===t){var s=a?0:l;c.x[-1]=i?u:0,c.x[1]=i?-u:-o.x,c.y[-1]=s,c.y[1]=s}else{var p=i?0:u;c.x[-1]=p,c.x[1]=p,c.y[-1]=a?l:0,c.y[1]=a?-l:-o.y}return c}if(t.isCreating){var u=e.element,l=cornerstone.getEnabledElement(u),c=l.image,s=i.uiSettings.autoPositionMeasurementsTextCallOuts,p={T:!s||a.contains(s,"T"),R:!s||a.contains(s,"R"),B:!s||a.contains(s,"B"),L:!s||a.contains(s,"L")},m=function e(t,n,r){var i=t.element,a=t.canvas,u=t.image,l=cornerstone.pixelToCanvas(i,{x:0,y:0}),c=cornerstone.pixelToCanvas(i,{x:u.width,y:u.height}),s=o(a),m=s.outerWidth(),d=s.outerHeight(),f={};return f["x-1"]=p.L&&l.x>n,f["y-1"]=p.T&&l.y>r,f.x1=p.R&&m-c.x>n,f.y1=p.B&&d-c.y>r,f},d=function e(t,n){var o={};o.x=t.x/2,o.y=t.y/2;var r={};r.x=n.x<o.x?-1:1,r.y=n.y<o.y?-1:1;for(var i=r.x<0?n.x:t.x-n.x,a=r.y<0?n.y:t.y-n.y,u=a<i?"y":"x",l={"x-1":"L","y-1":"T",x1:"R",y1:"B"},c=0;c<4&&!p[l[u+r[u]]];)r[u]*=-1,u="x"===u?"y":"x",c++;return{directions:r,cornerAxis:u}},f=function e(t,n,o){var r=n[t],i=o[t],a=Math.min(r,i),u=Math.max(r,i);return a+(u-a)/2},h=function e(t,n){var o=cornerstone.pageToPixel(t,0,0),r=cornerstone.pageToPixel(t,n.x,n.y);return{x:r.x-o.x,y:r.y-o.y}},g=t.handles,v=g.textBox,b=o(l.canvas),k=b.outerWidth(),y=b.outerHeight(),w=b.offset(),x={x:k,y:y},j={};j.x=v.boundingBox.width,j.y=v.boundingBox.height;var T=function e(t){return a.pick(g[t],["x","y"])},C=T("start"),I=T("end"),_={};_.x=f("x",C,I),_.y=f("y",C,I);var M={};M.x=c.width,M.y=c.height;for(var H=d(M,_),O=H.directions,P=H.cornerAxis,F=m(l,j.x,j.y),$=a.clone(O),S=P,D=!1,R=0;R<4;){if(F[S+$[S]]){D=!0;break}$[S]*=-1,S="x"===S?"y":"x",R++}var V=void 0;if(D)a.extend(O,$),P=S,V=O[P]<0?0:M[P];else{a.extend(M,x);var z=cornerstone.pixelToCanvas(u,_),A=d(M,z);O=A.directions,P=A.cornerAxis;var B={x:O.x<0?w.left:w.left+k,y:O.y<0?w.top:w.top+y},E=cornerstone.pageToPixel(u,B.x,B.y);V=E[P]}var N="x"===P?"y":"x",W=h(u,j);v[P]=V,v[N]=_[N];var L=r(n,P,N,W);v[P]+=L[P][O[P]];var U=cornerstone.pixelToCanvas(u,v),q={x:U.x+j.x,y:U.y+j.y},Y={x0:w.left,y0:w.top,x1:w.left+k,y1:w.top+y};if(U[N]<0){var X=Y.x0,K=Y.y0,G=cornerstone.pageToPixel(u,X,K);v[N]=G[N]}else if(q[N]>x[N]){var J=Y.x1-j.x,Q=Y.y1-j.y,Z=cornerstone.pageToPixel(u,J,Q);v[N]=Z[N]}}}}],"index.js":["./blaze.js","./cornerstone.js","./object.js","./string.js","./ui.js","./utils.js","./viewer.js",function(e,t,n){n.import("./blaze.js"),n.import("./cornerstone.js"),n.import("./object.js"),n.import("./string.js"),n.import("./ui.js"),n.import("./utils.js"),n.import("./viewer.js")}],"object.js":["babel-runtime/helpers/typeof","meteor/ohif:core",function(e,t,n){var o;n.import("babel-runtime/helpers/typeof",{default:function(e){o=e}});var r;n.import("meteor/ohif:core",{OHIF:function(e){r=e}}),r.object={},r.object.getNestedObject=function(e){var t={};for(var n in b.sanitizeForInObject(e))for(var o=e[n],r=n.split("."),i=t;r.length;){var a=r.shift();r.length?(i[a]||(i[a]={}),i=i[a]):i[a]=o}return t},r.object.getShallowObject=function(e){var t={},n=function e(t,n,r){for(var i in b.sanitizeForInObject(n)){var a=t?t+"."+i:i,u=n[i];"object"===("undefined"==typeof u?"undefined":o(u))?(u instanceof Array&&(a+="[]"),e(a,u,r)):r[a]=u}};return n("",e,t),t}}],"string.js":["meteor/ohif:core","meteor/underscore","meteor/jquery",function(e,t,n){var o;n.import("meteor/ohif:core",{OHIF:function(e){o=e}});var r;n.import("meteor/underscore",{_:function(e){r=e}});var i;n.import("meteor/jquery",{$:function(e){i=e}}),o.string={},o.string.search=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],u=new RegExp(i.trim(t),"i");return r.each(e,function(e){if(e){var i=r.isString(n)?e[n]:e;r.isString(i)&&u.test(i)&&a.push(e),r.isObject(e)&&o.string.search(e,t,n,a)}}),a},o.string.encodeId=function(e){if(""===e||"string"!=typeof e)return"_";var t=function e(t){return"_"+t[0].charCodeAt(0).toString(16)+"_"};return e.replace(/[^a-zA-Z0-9-]/g,t)}}],"ui.js":["meteor/ohif:core","meteor/meteor",function(e,t,n){var o;n.import("meteor/ohif:core",{OHIF:function(e){o=e}});var r;n.import("meteor/meteor",{Meteor:function(e){r=e}});var i=r.settings&&r.settings.public&&r.settings.public.ui;o.uiSettings=i||{},o.ui.getOffset=function(e){var t=0,n=0;if(e.offsetParent)do n+=e.offsetLeft,t+=e.offsetTop;while(e=e.offsetParent);return{left:n,top:t}}}],"utils.js":["meteor/ohif:core",function(e,t,n){var o;n.import("meteor/ohif:core",{OHIF:function(e){o=e}}),o.utils.sortBy=function(){var e=[].slice.call(arguments),t=e.length;return function(n,o){var r,i,a,u,l,c,s,p;for(p=0;p<t&&(s=0,a=e[p],u="string"==typeof a?a:a.name,r=n[u],i=o[u],"undefined"!=typeof a.primer&&(r=a.primer(r),i=a.primer(i)),c=a.reverse?-1:1,r<i&&(s=c*-1),r>i&&(s=1*c),0===s);p++);return s}}}],"viewer.js":["meteor/ohif:core",function(e,t,n){var o;n.import("meteor/ohif:core",{OHIF:function(e){o=e}}),o.viewer={}}]},ui:{"index.js":["./bounded/bounded.js","./dimensional/dimensional.js","./dialog/display.js","./dialog/spatial.js","./dialog/unsavedChangesDialog.js","./draggable/draggable.js","./dropdown/class.js","./dropdown/display.js","./popover/display.js","./resizable/resizable.js","./unsavedChanges/unsavedChanges.js",function(e,t,n){n.import("./bounded/bounded.js"),n.import("./dimensional/dimensional.js"),n.import("./dialog/display.js"),n.import("./dialog/spatial.js"),n.import("./dialog/unsavedChangesDialog.js"),n.import("./draggable/draggable.js"),n.import("./dropdown/class.js"),n.import("./dropdown/display.js"),n.import("./popover/display.js"),n.import("./resizable/resizable.js"),n.import("./unsavedChanges/unsavedChanges.js")}],bounded:{"bounded.js":["babel-runtime/helpers/classCallCheck","meteor/jquery","meteor/underscore","meteor/ohif:core",function(e,t,n){var o;n.import("babel-runtime/helpers/classCallCheck",{default:function(e){o=e}});var r;n.import("meteor/jquery",{$:function(e){r=e}});var i;n.import("meteor/underscore",{_:function(e){i=e}});var a;n.import("meteor/ohif:core",{OHIF:function(e){a=e}}),r.fn.bounded=function(e){return i.each(this,function(t){var n=r(t).data("boundedInstance");"destroy"===e&&n?(r(t).removeData("boundedInstance"),n.destroy()):n?n.options(e):r(t).data("boundedInstance",new u(t,e))}),this};var u=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(this,e),this.element=t,this.$element=r(t),this.options(n),this.setBoundedFlag(!1)}return e.prototype.options=function(){function e(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.boundingElement,n=e.allowResizing;this.boundingElement=t,this.$boundingElement=r(this.boundingElement),this.allowResizing=n,"fixed"===this.$element.css("position")&&(this.boundingElement=window),this.destroy(),this.init()}return e}(),e.prototype.init=function(){function e(){var e=this;this.defineEventHandlers(),this.attachEventHandlers(),this.$element.addClass("bounded");var t=r(window),n=function(){function n(){e.$element.closest(document.documentElement).length||t.off("resize",n),e.$element.trigger("spatialChanged")}return n}();t.on("resize",n),setTimeout(function(){return e.$element.trigger("spatialChanged")})}return e}(),e.prototype.destroy=function(){function e(){this.detachEventHandlers(),this.$element.removeClass("bounded")}return e}(),e.spatialInfo=function(){function e(e){var t={};if(!e||e===window){var n=r(window),o=n.outerWidth(),i=n.outerHeight();return{width:o,height:i,x0:0,y0:0,x1:o,y1:i}}var a=r(e),u=e.style;u.width&&u.width.indexOf("px")>-1?t.width=parseInt(u.width):t.width=a.outerWidth(),u.height&&u.height.indexOf("px")>-1?t.height=parseInt(u.height):t.height=a.outerHeight();var l="fixed"===a.css("position")?"position":"offset",c=a[l]();return t.x0=c.left,t.y0=c.top,t.x1=t.x0+t.width,t.y1=t.y0+t.height,t}return e}(),e.prototype.defineEventHandlers=function(){function t(){var t=this;this.spatialChangedHandler=function(n){var o=e.spatialInfo(t.element),r=e.spatialInfo(t.boundingElement);t.allowResizing&&o.width>r.width?(t.$element.width(r.width),t.$element.css("left",r.x0),t.setBoundedFlag(!0)):o.x0<r.x0?(t.$element.css("left",r.x0),t.setBoundedFlag(!0)):o.x1>r.x1&&(t.$element.css("left",r.x1-o.width),t.setBoundedFlag(!0)),t.allowResizing&&o.height>r.height?(t.$element.height(r.height),t.$element.css("top",r.y0),t.setBoundedFlag(!0)):o.y0<r.y0?(t.$element.css("top",r.y0),t.setBoundedFlag(!0)):o.y1>r.y1&&(t.$element.css("top",r.y1-o.height),t.setBoundedFlag(!0))}}return t}(),e.prototype.attachEventHandlers=function(){function e(){this.$element.on("spatialChanged",this.spatialChangedHandler),this.$boundingElement.on("resize",this.spatialChangedHandler)}return e}(),e.prototype.detachEventHandlers=function(){function e(){this.$element.off("spatialChanged",this.spatialChangedHandler),this.$boundingElement.off("resize",this.spatialChangedHandler)}return e}(),e.prototype.setBoundedFlag=function(){function e(e){this.$element.data("wasBounded",e)}return e}(),e}();a.ui.Bounded=u}]},dialog:{"display.js":["meteor/templating","meteor/blaze","meteor/underscore","meteor/jquery","meteor/ohif:core",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}});var r;n.import("meteor/blaze",{Blaze:function(e){r=e}});var i;n.import("meteor/underscore",{_:function(e){i=e}});var a;n.import("meteor/jquery",{$:function(e){a=e}});var u;n.import("meteor/ohif:core",{OHIF:function(e){
u=e}}),u.ui.showDialog=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=o[e];if(!n)throw{name:"TEMPLATE_NOT_FOUND",message:"Template "+e+" not found."};var u=void 0,l=void 0;if(t&&t.promise instanceof k)u=t.promise,l=t;else{var c=void 0,s=void 0;u=new k(function(e,t){c=e,s=t}),l=i.extend({},t,{promise:u,promiseResolve:c,promiseReject:s})}var p=r.renderWithData(n,l,document.body),m=p.firstNode(),d=m&&a(m),f=void 0;d&&d.hasClass("modal")?f=d:d&&d.has(".modal")&&(f=d.find(".modal:first"));var h=function e(){t&&t.promise&&f?f.one("hidden.bs.modal",function(){return r.remove(p)}).modal("hide"):r.remove(p)};return u.then(h).catch(h),u}}],"spatial.js":["meteor/ohif:core",function(e,t,n){var o;n.import("meteor/ohif:core",{OHIF:function(e){o=e}}),o.ui.repositionDialog=function(e,t,n){var o=e.find(".modal-dialog");o.css({margin:0,position:"fixed"}).bounded();var r=e.is(":visible");e.show();var i=o.outerHeight(),a=o.outerWidth(),u=parseInt(t-a/2),l=parseInt(n-i/2);o.css({left:u,top:l}).trigger("spatialChanged").one("transitionend",function(){return o.trigger("spatialChanged")}),e.toggle(r)}}],"unsavedChangesDialog.js":["meteor/templating","meteor/blaze","meteor/underscore","meteor/ohif:core",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}});var r;n.import("meteor/blaze",{Blaze:function(e){r=e}});var i;n.import("meteor/underscore",{_:function(e){i=e}});var a;n.import("meteor/ohif:core",{OHIF:function(e){a=e}}),a.ui.unsavedChangesDialog=function(e,t){var n=i.extend({},t,{callback:e});r.renderWithData(o.unsavedChangesDialog,n,document.body)}}]},dimensional:{"dimensional.js":["meteor/jquery",function(e,t,n){var o;n.import("meteor/jquery",{$:function(e){o=e}}),o.fn.tempShow=function(e){for(var t=[],n=this;this.is(":hidden")&&n!==document.body;){var r=this.parentsUntil(":visible").last();if(!r.length)break;r.addClass("visible"),n=r[0],t.push(n)}return"function"==typeof e&&e(this),o(t).removeClass("visible"),this},o.fn.adjustMax=function(e){var t=o(this);t.tempShow(function(){var n="no-max-"+e;t.addClass(n);var o="outer"+e.charAt(0).toUpperCase()+e.slice(1),r=t[o](),i="max-"+e;t.removeClass(n).css(i,r)})}}]},draggable:{"draggable.js":function(){function e(e,t){function n(e){var t={x:e.clientX,y:e.clientY};return void 0===t.x&&(t.x=e.originalEvent.touches[0].pageX),void 0===t.y&&(t.y=e.originalEvent.touches[0].pageY),t}function r(t){if(!(t.target.type&&"range"===t.target.type||o(e).hasClass("resizing"))){var r=parseFloat(e.offset().top),p=parseFloat(e.offset().left),m=n(t);l=m.x-p,c=m.y-r,u.css("cursor","move"),e.css("cursor","move"),e.css({cursor:"move",left:p+"px",top:r+"px",bottom:"auto",right:"auto"}),o(document).on("mousemove",a),o(document).on("mouseup",i),o(document).on("touchmove",a),o(document).on("touchend",i),s&&(e.data("wasDragged",!0),s=!1)}}function i(){u.css("cursor","default"),e.css("cursor",t.defaultElementCursor),o(document).off("mousemove",a),o(document).off("touchmove",a)}function a(t){t.preventDefault();var o=parseFloat(e.outerWidth()),r=parseFloat(e.outerHeight()),i=parseFloat(u.width()),a=parseFloat(u.height()),s=n(t),p=s.x-l,m=s.y-c;p=Math.max(p,0),m=Math.max(m,0),p+o>i&&(p=i-o),m+r>a&&(m=a-r),e.css({left:p+"px",top:m+"px",bottom:"auto",right:"auto"})}var u=o(window),l,c,s=!0;t=t||{},t.defaultElementCursor=t.defaultElementCursor||"default",e.data("wasDragged",!1),e.on("mousedown",r),e.on("touchstart",r)}o.fn.draggable=function(t){return e(this,t),this}}},dropdown:{"class.js":["babel-runtime/helpers/classCallCheck","meteor/tracker","meteor/underscore","meteor/ohif:core",function(e,t,n){var o;n.import("babel-runtime/helpers/classCallCheck",{default:function(e){o=e}});var r;n.import("meteor/tracker",{Tracker:function(e){r=e}});var i;n.import("meteor/underscore",{_:function(e){i=e}});var a;n.import("meteor/ohif:core",{OHIF:function(e){a=e}});var u=function(){function e(){o(this,e),this.observer=new r.Dependency,this._items=[],this.observer.changed()}return e.prototype.clearItems=function(){function e(){this._items=[],this.observer.changed()}return e}(),e.prototype.setItems=function(){function e(e){this._items=e,this.observer.changed()}return e}(),e.prototype.addItem=function(){function e(e){this._items.push(e),this.observer.changed()}return e}(),e.prototype.removeItem=function(){function e(e){this._items=i.without(this._items,e),this.observer.changed()}return e}(),e.prototype.getItems=function(){function e(){return this.observer.depend(),this._items}return e}(),e}();a.ui.Dropdown=u}],"display.js":["meteor/templating","meteor/blaze","meteor/ohif:core",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}});var r;n.import("meteor/blaze",{Blaze:function(e){r=e}});var i;n.import("meteor/ohif:core",{OHIF:function(e){i=e}}),i.ui.showDropdown=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=void 0,i=void 0,a=new k(function(e,t){n=e,i=t}),u=void 0,l=function e(){return r.remove(u)},c={items:e,options:t,destroyView:l,promise:a,promiseResolve:n,promiseReject:i},s=t.parentElement||document.body;return u=r.renderWithData(o.dropdownForm,c,s),a}}]},popover:{"display.js":["meteor/templating","meteor/blaze","meteor/ohif:core",function(e,t,n){var r;n.import("meteor/templating",{Template:function(e){r=e}});var i;n.import("meteor/blaze",{Blaze:function(e){i=e}});var a;n.import("meteor/ohif:core",{OHIF:function(e){a=e}}),a.ui.showPopover=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=r[e];if(!a)throw{name:"TEMPLATE_NOT_FOUND",message:"Template "+e+" not found."};var u=void 0,l=void 0;if(t&&t.promise instanceof k)u=t.promise,l=t;else{var c=void 0,s=void 0;u=new k(function(e,t){c=e,s=t}),l=Object.assign({},t,{promise:u,promiseResolve:c,promiseReject:s})}var p=n.element,m=n.event,d=o(p||m.currentTarget),f={content:"",html:!0,trigger:"manual",placement:"auto",delay:{show:300,hide:300}},h=Object.assign({},f,n);return h.content=i.toHTMLWithData(a,t),d.popover(h),d.one("shown.bs.popover",function(e){var t=d.attr("aria-describedby"),n=document.getElementById(t),r=o(n),c=r.find(".popover-content"),s=function e(){return d.popover("hide")};c.html("");var p=i.renderWithData(a,l,c[0]);d.one("hidden.bs.popover",function(){i.remove(p),d.popover("destroy")}),u.then(s).catch(s)}),"manual"===h.trigger&&d.popover("show"),u}}]},resizable:{"resizable.js":["babel-runtime/helpers/classCallCheck","meteor/ohif:core",function(e,t,n){var r;n.import("babel-runtime/helpers/classCallCheck",{default:function(e){r=e}});var a;n.import("meteor/ohif:core",{OHIF:function(e){a=e}}),o.fn.resizable=function(e){return i.each(this,function(t){var n=o(t).data("resizableInstance");"destroy"===e&&n?(o(t).removeData("resizableInstance"),n.destroy()):n?n.options(e):o(t).data("resizableInstance",new u(t,e))}),this};var u=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(this,e),this.element=t,this.$element=o(t),this.options(n)}return e.prototype.options=function(){function e(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.boundSize,n=e.minWidth,o=e.minHeight;this.minWidth=n||this.$element.width()||16,this.minHeight=o||this.$element.height()||16,this.boundSize=t||8,this.destroy(),this.init()}return e}(),e.prototype.init=function(){function e(){this.defineEventHandlers();for(var e=-1;e<=1;e++)for(var t=-1;t<=1;t++)this.createBound(e,t);this.$element.addClass("resizable")}return e}(),e.prototype.destroy=function(){function e(){this.$element.removeClass("resizable resizing");var e=this.$element.find("resize-bound");e.remove(),this.detachEventHandlers(e)}return e}(),e.prototype.defineEventHandlers=function(){function e(){var e=this;this.initResizeHandler=function(t){var n=o(window);e.width=e.initialWidth=e.$element.width(),e.height=e.initialHeight=e.$element.height(),e.startWidth=e.width,e.startHeight=e.height,e.posX=parseInt(e.$element.css("left")),e.posY=parseInt(e.$element.css("top")),e.startPosX=e.posX,e.startPosY=e.posY,e.startX=t.clientX,e.startY=t.clientY,e.$element.addClass("resizing"),n.on("mousemove",t.data,e.resizeHandler),n.on("mouseup",t.data,e.endResizeHandler)},this.resizeHandler=function(t){var n=t.data,o=n.xDirection,r=n.yDirection,i=void 0,a=void 0;i=t.clientX<0?0:t.clientX,i=i>window.innerWidth?window.innerWidth:i,a=t.clientY<0?0:t.clientY,a=a>window.innerHeight?window.innerHeight:a;var u=(i-e.startX)*o,l=(a-e.startY)*r,c=u+e.startWidth,s=l+e.startHeight;e.width=c<e.minWidth?e.minWidth:c,e.height=s<e.minHeight?e.minHeight:s,e.$element.width(e.width),e.$element.height(e.height),o<0&&(e.posX=e.startPosX-u,c<e.minWidth&&(e.posX=e.startPosX+(e.startWidth-e.minWidth)),e.$element.css("left",e.posX+"px")),r<0&&(e.posY=e.startPosY-l,s<e.minHeight&&(e.posY=e.startPosY+(e.startHeight-e.minHeight)),e.$element.css("top",e.posY+"px"))},this.endResizeHandler=function(t){var n=o(window);n.off("mousemove",e.resizeHandler),n.off("mouseup",e.endResizeHandler),e.$element.removeClass("resizing"),e.$element.trigger("resize")}}return e}(),e.prototype.attachEventHandlers=function(){function e(e,t,n){var o={xDirection:t,yDirection:n};e.on("mousedown",o,this.initResizeHandler)}return e}(),e.prototype.detachEventHandlers=function(){function e(e){var t=o(window);e.off("mousedown",this.initResizeHandler),t.off("mousemove",this.resizeHandler),t.off("mouseup",this.endResizeHandler)}return e}(),e.prototype.createBound=function(){function e(e,t){if(0!==e||e!==t){var n=o('<div class="resize-bound"></div>');n[0].onselectstart=function(){return!1},n.css("font-size",this.boundSize+"px");var r=["left","center","right"],i=["top","middle","bottom"];n.addClass("bound-"+r[e+1]),n.addClass("bound-"+i[t+1]),n.appendTo(this.$element),this.attachEventHandlers(n,e,t)}}return e}(),e}();a.ui.Resizable=u}]},unsavedChanges:{"unsavedChanges.js":["babel-runtime/helpers/typeof","babel-runtime/helpers/classCallCheck","meteor/ohif:core","meteor/underscore",function(e,t,n){n.export({unsavedChanges:function(){return f}});var o;n.import("babel-runtime/helpers/typeof",{default:function(e){o=e}});var r;n.import("babel-runtime/helpers/classCallCheck",{default:function(e){r=e}});var i;n.import("meteor/ohif:core",{OHIF:function(e){i=e}});var a;n.import("meteor/underscore",{_:function(e){a=e}});var u="function",l="string",c="undefined",s="*",p=".",m=function(){function e(){r(this,e),this.value=0,this.children={},this.handlers={}}return e.prototype.getPathComponents=function(){function e(e){return("undefined"==typeof e?"undefined":o(e))===l?e.split(p):null}return e}(),e.prototype.getNodeUpToIndex=function(){function e(e,t){for(var n=this,o=0;o<t;++o){var r=e[o];if(!n.children.hasOwnProperty(r)){n=null;break}n=n.children[r]}return n}return e}(),e.prototype.append=function(){function t(t,n){var r=this.children,i=null;return r.hasOwnProperty(t)?i=r[t]:("undefined"==typeof t?"undefined":o(t))===l&&t!==s&&(i=new e,r[t]=i),null!==i&&(i.value+=n>0?parseInt(n):0),i}return t}(),e.prototype.probe=function(){function e(e){var t=this.value;if(e===!0){var n=this.children;for(var o in b.sanitizeForInObject(n))n.hasOwnProperty(o)&&(t+=n[o].probe(e))}return t}return e}(),e.prototype.clear=function(){function e(e){if(this.value=0,e===!0){var t=this.children;for(var n in b.sanitizeForInObject(t))t.hasOwnProperty(n)&&t[n].clear(e)}}return e}(),e.prototype.appendPath=function(){function e(e,t){if(e=this.getPathComponents(e),null!==e){for(var n=e.length-1,o=this,r=0;r<n;++r)if(o=o.append(e[r],0),null===o)return!1;return null!==o.append(e[n],t)}return!1}return e}(),e.prototype.clearPath=function(){function e(e,t){if(e=this.getPathComponents(e),null!==e){var n=e.length-1,o=this.getNodeUpToIndex(e,n);if(null!==o){var r=e[n];if(r===s){var i=o.children;for(r in b.sanitizeForInObject(i))i.hasOwnProperty(r)&&i[r].clear(t);return!0}if(o.children.hasOwnProperty(r))return o.children[r].clear(t),!0}}return!1}return e}(),e.prototype.probePath=function(){function e(e,t){if(e=this.getPathComponents(e),null!==e){var n=e.length-1,o=this.getNodeUpToIndex(e,n);if(null!==o){var r=e[n];if(r===s){var i=o.children,a=0;for(r in b.sanitizeForInObject(i))i.hasOwnProperty(r)&&(a+=i[r].probe(t));return a}if(o.children.hasOwnProperty(r))return o.children[r].probe(t)}}return 0}return e}(),e.prototype.attachHandler=function(){function e(e,t){var n=!1;if(("undefined"==typeof e?"undefined":o(e))===l&&("undefined"==typeof t?"undefined":o(t))===u){for(var r=this.handlers,i=r.hasOwnProperty(e)?r[e]:r[e]=[],a=i.length,c=!0,s=0;s<a;++s)if(t===i[s]){c=!1;break}c&&(i[a]=t,n=!0)}return n}return e}(),e.prototype.removeHandler=function(){function e(e,t){var n=!1;if(("undefined"==typeof e?"undefined":o(e))===l&&("undefined"==typeof t?"undefined":o(t))===u){var r=this.handlers;if(r.hasOwnProperty(e))for(var i=r[e],a=i.length,c=0;c<a;++c)if(t===i[c]){i.splice(c,1),n=!0;break}}return n}return e}(),e.prototype.trigger=function(){function e(e,t){if(("undefined"==typeof e?"undefined":o(e))===l){var n=this.handlers;if(n.hasOwnProperty(e))for(var r=n[e],i=r.length,a=0;a<i;++a)r[a].call(null);if(t!==!0){var u=this.children;for(var c in b.sanitizeForInObject(u))u.hasOwnProperty(c)&&u[c].trigger(e)}}}return e}(),e.prototype.attachHandlerForPath=function(){function e(e,t,n){if(e=this.getPathComponents(e),null!==e){var o=this.getNodeUpToIndex(e,e.length);if(null!==o)return o.attachHandler(t,n)}return!1}return e}(),e.prototype.removeHandlerForPath=function(){function e(e,t,n){if(e=this.getPathComponents(e),null!==e){var o=this.getNodeUpToIndex(e,e.length);if(null!==o)return o.removeHandler(t,n)}return!1}return e}(),e.prototype.triggerHandlersForPath=function(){function e(e,t,n){if(e=this.getPathComponents(e),null!==e){var o=this.getNodeUpToIndex(e,e.length);null!==o&&o.trigger(t,n)}}return e}(),e}(),d=new m,f={rootNode:d,set:function(){function e(e){return d.appendPath(e,1)}return e}(),clear:function(){function e(e,t){return d.clearPath(e,("undefined"==typeof t?"undefined":o(t))===c||t)}return e}(),probe:function(){function e(e,t){return d.probePath(e,("undefined"==typeof t?"undefined":o(t))===c||t)}return e}(),attachHandler:function(){function e(e,t,n){return d.appendPath(e,0)&&d.attachHandlerForPath(e,t,n)}return e}(),removeHandler:function(){function e(e,t,n){return d.removeHandlerForPath(e,t,n)}return e}(),trigger:function(){function e(e,t,n){d.triggerHandlersForPath(e,t,n)}return e}(),checkBeforeAction:function(){function e(e,t,n){var o=void 0,r=void 0,u=void 0;if("function"==typeof t)if(o=this.probe(e),o>0){r=!0;var l=a.extend({title:"You have unsaved changes!",message:"Your changes will be lost if you don't save them before leaving the current page... Are you sure you want to proceed?"},n);i.ui.showDialog("dialogConfirm",l).then(function(){u=!0,t.call(null,u,r)},function(){u=!1,t.call(null,u,r)})}else r=!1,u=!0,t.call(null,u,r)}return e}(),presentProactiveDialog:function(){function e(e,t,n){var o=void 0,r=void 0;"function"==typeof t&&(o=this.probe(e,!0),o>0?(r=!0,i.ui.unsavedChangesDialog(function(e){t.call(null,r,e)},n)):(r=!1,t.call(null,r,null)))}return e}()};i.ui.unsavedChanges=f}]}}},both:{"index.js":["./utils","./schema.js",function(e,t,n){n.import("./utils"),n.import("./schema.js")}],"schema.js":["meteor/aldeed:simple-schema",function(e,t,n){var o;n.import("meteor/aldeed:simple-schema",{SimpleSchema:function(e){o=e}}),o.extendOptions({valuesLabels:$.Optional([String]),textOptional:$.Optional(Boolean)}),o.addValidator(function(){if(this.definition.optional!==!0&&this.definition.textOptional!==!0&&""===this.value)return"required"}),o.messages({maxCount:"[label] can not have more than [maxCount] values",minCount:"[label] must have at least [minCount] values",notAllowed:'[label] has an invalid value: "[value]"'})}],utils:{"absoluteUrl.js":["meteor/ohif:core",function(t,n,o){var r;o.import("meteor/ohif:core",{OHIF:function(e){r=e}}),r.utils.absoluteUrl=function(t){return t&&(t=t.replace(/^\//,"")),e.absoluteUrl(t)}}],"index.js":["./absoluteUrl","./objectPath",function(e,t,n){n.import("./absoluteUrl"),n.import("./objectPath")}],"objectPath.js":["babel-runtime/helpers/typeof","babel-runtime/helpers/classCallCheck","meteor/ohif:core",function(e,t,n){var o;n.import("babel-runtime/helpers/typeof",{default:function(e){o=e}});var r;n.import("babel-runtime/helpers/classCallCheck",{default:function(e){r=e}});var i;n.import("meteor/ohif:core",{OHIF:function(e){i=e}});var a=function(){function e(){r(this,e)}return e.set=function(){function t(t,n,o){var r=e.getPathComponents(n),i=null!==r?r.length:0,a=!1;if(i>0&&e.isValidObject(t)){for(var u=0,l=i-1,c=t;u<l;){var s=r[u];if(s in c){if(!e.isValidObject(c[s]))break}else c[s]={};c=c[s],u++}u===l&&(c[r[l]]=o,a=!0)}return a}return t}(),e.get=function(){function t(t,n){var o=void 0,r=e.getPathComponents(n),i=null!==r?r.length:0;if(i>0&&e.isValidObject(t)){for(var a=0,u=i-1,l=t;a<u;){var c=r[a],s=e.isValidObject(l[c]);if(!(c in l&&s))break;l=l[c],a++}a===u&&r[u]in l&&(o=l[r[u]])}return o}return t}(),e.isValidObject=function(){function e(e){return"object"===("undefined"==typeof e?"undefined":o(e))&&null!==e&&e instanceof Object}return e}(),e.getPathComponents=function(){function e(e){return"string"==typeof e?e.split("."):null}return e}(),e}();i.utils.ObjectPath=a}]}}}}}},{extensions:[".js",".json",".styl",".html"]}),A=z("./node_modules/meteor/ohif:core/main.js");z("./node_modules/meteor/ohif:core/client/index.js"),z("./node_modules/meteor/ohif:core/both/index.js"),"undefined"==typeof Package&&(Package={}),Package["ohif:core"]=A}();
!function(){var e=Package.meteor.Meteor,n=Package.meteor.global,o=Package.meteor.meteorEnv,t=Package["templating-runtime"].Template,r=Package.underscore._,a=Package.modules.meteorInstall,d=Package.modules.Buffer,i=Package.modules.process,c=Package["ecmascript-runtime"].Symbol,h=Package["ecmascript-runtime"].Map,m=Package["ecmascript-runtime"].Set,l=Package["babel-runtime"].meteorBabelHelpers,s=Package.promise.Promise,u=Package.blaze.Blaze,p=Package.blaze.UI,b=Package.blaze.Handlebars,f=Package.spacebars.Spacebars,y=Package.htmljs.HTML,g=a({node_modules:{meteor:{"ohif:header":{"main.js":["meteor/ohif:core",function(e,n,o){o.export({header:function(){return a}});var t;o.import("meteor/ohif:core",{OHIF:function(e){t=e}});var r=new t.ui.Dropdown,a={dropdown:r};t.header=a}],client:{"index.js":["./components",function(e,n,o){o.import("./components")}],components:{"index.js":["./header/header.html","./header/header.js","./header/header.styl",function(e,n,o){o.import("./header/header.html"),o.import("./header/header.js"),o.import("./header/header.styl")}],header:{"header.html":["./template.header.js",function(e,n,o){o.exports=e("./template.header.js")}],"template.header.js":function(){t.__checkName("header"),t.header=new t("Template.header",function(){var e=this;return y.DIV({class:function(){return["header noselect ",f.mustache(e.lookup("reactive"),e.lookup("headerClasses"))]}},"\n ",y.DIV({class:"clearfix"},"\n ",y.A({target:"_blank",class:"brand pull-left",href:function(){return f.mustache(e.lookup("choose"),f.dot(e.lookup("."),"brandHref"),"/")}},"\n ",u._TemplateWith(function(){return"brand"},function(){return f.include(e.lookupTemplate("section"))}),"\n "),"\n ",u._TemplateWith(function(){return"headerAfterBrand"},function(){return f.include(e.lookupTemplate("section"))}),"\n ",y.A({href:"#",class:"header-menu pull-right"},u._TemplateWith(function(){return"headerMenu"},function(){return f.include(e.lookupTemplate("section"))})),"\n "),"\n ",u._InOuterTemplateScope(e,function(){return f.include(function(){return f.call(e.templateContentBlock)})}),"\n ")})},"header.js":["meteor/templating","meteor/jquery","meteor/ohif:core",function(e,n,o){var t;o.import("meteor/templating",{Template:function(e){t=e}});var r;o.import("meteor/jquery",{$:function(e){r=e}});var a;o.import("meteor/ohif:core",{OHIF:function(e){a=e}}),t.header.onCreated(function(){var e=t.instance();e.dropdownItems=[],e.autorun(function(){a.header.dropdown.observer.depend(),e.dropdownItems=a.header.dropdown.getItems()})}),t.header.events({"click .header-menu":function(){function e(e,n){e.preventDefault(),r(e.currentTarget).find(".dropdown").length||a.ui.showDropdown(n.dropdownItems,{parentElement:e.currentTarget,menuClasses:"dropdown-menu-right",marginTop:"25px"})}return e}()})}],"header.styl":["./header.styl.css",function(e,n,o){o.exports=e("./header.styl.css")}],"header.styl.css":["meteor/modules",function(e,n,o){o.exports=e("meteor/modules").addStyles('.theme-icon-crickets,\n.theme-icon-tide,\n.theme-icon-tigerlily,\n.theme-icon-quartz,\n.theme-icon-overcast,\n.theme-icon-mint,\n.theme-icon-honeycomb {\n display: inline-block;\n background: url("/packages/ohif_design/assets/theme-icons.png") no-repeat;\n overflow: hidden;\n text-indent: -9999px;\n text-align: left;\n}\n.theme-icon-crickets {\n background-position: 0px 0px;\n width: 64px;\n height: 56px;\n}\n.theme-icon-tide {\n background-position: 0px -56px;\n width: 64px;\n height: 54px;\n}\n.theme-icon-tigerlily {\n background-position: 0px -110px;\n width: 62px;\n height: 61px;\n}\n.theme-icon-quartz {\n background-position: 0px -171px;\n width: 59px;\n height: 64px;\n}\n.theme-icon-overcast {\n background-position: 0px -235px;\n width: 58px;\n height: 37px;\n}\n.theme-icon-mint {\n background-position: 0px -272px;\n width: 57px;\n height: 61px;\n}\n.theme-icon-honeycomb {\n background-position: 0px -333px;\n width: 50px;\n height: 58px;\n}\nbody>.header {\n height: 40px;\n padding: 10px 10px 0;\n -webkit-transition: all 0.5s ease;\n -moz-transition: all 0.5s ease;\n -ms-transition: all 0.5s ease;\n -o-transition: all 0.5s ease;\n transition: all 0.5s ease;\n}\nbody>.header {\n color: #fff;\n}\nbody.theme-tide body>.header {\n color: #fff;\n}\nbody.theme-tigerlily body>.header {\n color: #fff;\n}\nbody.theme-crickets body>.header {\n color: #fff;\n}\nbody.theme-honeycomb body>.header {\n color: #fff;\n}\nbody.theme-mint body>.header {\n color: #fff;\n}\nbody.theme-overcast body>.header {\n color: #fff;\n}\nbody.theme-quartz body>.header {\n color: #fff;\n}\nbody>.header {\n background-color: #000;\n}\nbody.theme-tide body>.header {\n background-color: #000;\n}\nbody.theme-tigerlily body>.header {\n background-color: #000;\n}\nbody.theme-crickets body>.header {\n background-color: #000;\n}\nbody.theme-honeycomb body>.header {\n background-color: #000;\n}\nbody.theme-mint body>.header {\n background-color: #000;\n}\nbody.theme-overcast body>.header {\n background-color: #000;\n}\nbody.theme-quartz body>.header {\n background-color: #000;\n}\nbody>.header>.clearfix {\n position: relative;\n}\nbody>.header .header-menu {\n padding: 4px 0;\n font-size: 13px;\n font-weight: 400;\n line-height: 18px;\n text-decoration: none;\n}\nbody>.header .header-menu {\n color: #9ccef9;\n}\nbody.theme-tide body>.header .header-menu {\n color: #9ccef9;\n}\nbody.theme-tigerlily body>.header .header-menu {\n color: #9acffd;\n}\nbody.theme-crickets body>.header .header-menu {\n color: #92c2da;\n}\nbody.theme-honeycomb body>.header .header-menu {\n color: #b5b5b5;\n}\nbody.theme-mint body>.header .header-menu {\n color: #a7e9b3;\n}\nbody.theme-overcast body>.header .header-menu {\n color: #9cbecf;\n}\nbody.theme-quartz body>.header .header-menu {\n color: #8ea2a4;\n}\nbody>.header .header-menu:empty {\n display: none;\n}\nbody>.header.header-big {\n height: 160px;\n background-color: rgba(21,25,30,0.7);\n}\n')}]}}}}}}},{extensions:[".js",".json",".html",".styl"]}),k=g("./node_modules/meteor/ohif:header/main.js");g("./node_modules/meteor/ohif:header/client/index.js"),"undefined"==typeof Package&&(Package={}),Package["ohif:header"]=k}();
!function(){"undefined"==typeof Package&&(Package={}),Package["ohif:themes-common"]={}}();
!function(){"undefined"==typeof Package&&(Package={}),Package["ohif:themes"]={}}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,n=Package.meteor.meteorEnv,o=Package.jquery.$,a=Package.jquery.jQuery,u=Package.modules.meteorInstall,r=Package.modules.Buffer,c=Package.modules.process,l=Package["ecmascript-runtime"].Symbol,s=Package["ecmascript-runtime"].Map,i=Package["ecmascript-runtime"].Set,d=Package["babel-runtime"].meteorBabelHelpers,p=Package.promise.Promise,m=Package.webapp.WebApp,k=Package.logging.Log,g=Package.deps.Tracker,f=Package.deps.Deps,P=Package.session.Session,h=Package["ddp-client"].DDP,b=Package.mongo.Mongo,v=Package.ui.Blaze,B=Package.ui.UI,G=Package.ui.Handlebars,V=Package.spacebars.Spacebars,j=Package["templating-runtime"].Template,I=Package.check.check,y=Package.check.Match,L=Package.underscore._,S=Package.random.Random,x=Package.ejson.EJSON,D=Package["launch-screen"].LaunchScreen,_=Package.htmljs.HTML,M=u({node_modules:{meteor:{"ohif:design":{components:{roundedButtonGroup:{"template.roundedButtonGroup.js":function(){j.__checkName("roundedButtonGroup"),j.roundedButtonGroup=new j("Template.roundedButtonGroup",function(){var e=this;return _.DIV({class:function(){return[V.mustache(e.lookup("class"))," roundedButtonGroup clearfix center-table"]}},"\n ",v.Each(function(){return{_sequence:V.call(V.dot(e.lookup("."),"options")),_variable:"item"}},function(){return["\n ",_.A({class:function(){return["roundedButtonWrapper noselect ",v.If(function(){return V.dataMustache(e.lookup("eq"),e.lookup("getValue"),V.dot(e.lookup("item"),"value"))},function(){return"active"})]},"data-value":function(){return V.mustache(V.dot(e.lookup("item"),"value"))}},"\n ",_.DIV({class:"roundedButton"},"\n ",v.If(function(){return V.call(V.dot(e.lookup("item"),"svgLink"))},function(){return["\n ",_.SVG({style:function(){return["width: ",V.mustache(V.dot(e.lookup("item"),"svgWidth")),"px; height: ",V.mustache(V.dot(e.lookup("item"),"svgHeight")),"px"]}},"\n ",_.USE({"xlink:href":function(){return V.mustache(e.lookup("absoluteUrl"),V.dot(e.lookup("item"),"svgLink"))}}),"\n "),"\n "]}),"\n ",v.If(function(){return V.call(V.dot(e.lookup("item"),"text"))},function(){return["\n ",_.SPAN(v.View("lookup:item.text",function(){return V.mustache(V.dot(e.lookup("item"),"text"))})),"\n "]}),"\n ",v.If(function(){return V.call(V.dot(e.lookup("item"),"iconClasses"))},function(){return["\n ",_.I({class:function(){return V.mustache(V.dot(e.lookup("item"),"iconClasses"))}}),"\n "]}),"\n "),"\n ",v.If(function(){return V.call(V.dot(e.lookup("item"),"bottomLabel"))},function(){return["\n ",_.DIV({class:"bottomLabel"},v.View("lookup:item.bottomLabel",function(){return V.mustache(V.dot(e.lookup("item"),"bottomLabel"))})),"\n "]}),"\n "),"\n "]}),"\n ")})},"roundedButtonGroup.js":function(){j.roundedButtonGroup.onCreated(function(){var e=j.instance(),t=e.data.value;e.getValue=function(){return t.get(e.data.key)},e.setValue=function(n){var o=[n];t instanceof ReactiveDict&&o.unshift(e.data.key),t.set.apply(t,o)},e.getValue()||e.data.toggleable||e.setValue(e.data.options[0].value)}),j.roundedButtonGroup.events({"click [data-value]":function(){function e(e,t){e.preventDefault();var n=o(e.currentTarget);if(!n.hasClass("disabled")){var a=n.hasClass("active")&&t.data.toggleable,u=a?null:n.attr("data-value");t.setValue(u)}}return e}()}),j.roundedButtonGroup.helpers({getValue:function(){function e(){return j.instance().getValue()}return e}()})}}}}}}},{extensions:[".js",".json",".styl",".html"]});M("./node_modules/meteor/ohif:design/components/roundedButtonGroup/template.roundedButtonGroup.js"),M("./node_modules/meteor/ohif:design/components/roundedButtonGroup/roundedButtonGroup.js"),"undefined"==typeof Package&&(Package={}),Package["ohif:design"]={}}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,n=Package.meteor.meteorEnv,o=Package.jquery.$,a=Package.jquery.jQuery,r=Package.modules.meteorInstall,i=Package.modules.Buffer,s=Package.modules.process,l=Package["ecmascript-runtime"].Symbol,u=Package["ecmascript-runtime"].Map,c=Package["ecmascript-runtime"].Set,d=Package["babel-runtime"].meteorBabelHelpers,f=Package.promise.Promise,m,h,g,p,v,y=r({node_modules:{meteor:{"ohif:cornerstone":{"main.js":["./namespace.js","./client/",function(e,t,n){n.export({OHIF:function(){return o},Cornerstone:function(){return a}});var o,a;n.import("./namespace.js",{OHIF:function(e){o=e},Cornerstone:function(e){a=e}}),n.import("./client/")}],"namespace.js":["babel-runtime/helpers/extends","meteor/ohif:core",function(e,t,n){n.export({OHIF:function(){return a},Cornerstone:function(){return r}});var o;n.import("babel-runtime/helpers/extends",{default:function(e){o=e}});var a;n.import("meteor/ohif:core",{OHIF:function(e){a=e}});var r=o({},a.cornerstone);a.cornerstone=r}],client:{"index.js":["../namespace","./lib/classes/MetadataProvider",function(e,t,n){var o;n.import("../namespace",{Cornerstone:function(e){o=e}});var a;n.import("./lib/classes/MetadataProvider",{MetadataProvider:function(e){a=e}}),o.metadataProvider=new a}],lib:{"parsingUtils.js":function(e,t,n){n.export({parsingUtils:function(){return o}});var o={isValidDataSet:function(){function e(e){return e instanceof g.DataSet}return e}(),attributeTag:function(){function e(e,t){if(this.isValidDataSet(e)&&t in e.elements){var n=e.elements[t];if(n&&4===n.length){var o=e.byteArrayParser.readUint16,a=e.byteArray,r=n.dataOffset;return"x"+("00000000"+(256*o(a,r)*256+o(a,r+2)).toString(16)).substr(-8)}}return null}return e}(),multiValue:function(){function e(e,t,n){if(this.isValidDataSet(e)&&t in e.elements){var o=e.elements[t];if(o&&o.length>0){var a=g.readFixedString(e.byteArray,o.dataOffset,o.length);if("string"==typeof a&&a.length>0)return"function"!=typeof n&&(n=null),a.split("\\").map(function(e){return e=e.trim(),null!==n?n(e):e})}}return null}return e}(),floatArray:function(){function e(e,t){return this.multiValue(e,t,parseFloat)}return e}()}},classes:{"MetadataProvider.js":["babel-runtime/helpers/typeof","babel-runtime/helpers/classCallCheck","../parsingUtils",function(e,t,n){n.export({MetadataProvider:function(){return s}});var o;n.import("babel-runtime/helpers/typeof",{default:function(e){o=e}});var a;n.import("babel-runtime/helpers/classCallCheck",{default:function(e){a=e}});var r;n.import("../parsingUtils",{parsingUtils:function(e){r=e}});var i="function",s=function(){function e(){a(this,e),Object.defineProperty(this,"metadataLookup",{configurable:!1,enumerable:!1,writable:!1,value:new u}),Object.defineProperty(this,"_provider",{configurable:!1,enumerable:!1,writable:!0,value:null})}return e.prototype.addMetadata=function(){function e(e,t){var n=t.instance,o=t.series,a=t.study,r=t.numImages,i={};i.study={accessionNumber:a.accessionNumber,patientId:a.patientId,studyInstanceUid:a.studyInstanceUid,studyDate:a.studyDate,studyTime:a.studyTime,studyDescription:a.studyDescription,institutionName:a.institutionName,patientHistory:a.patientHistory},i.series={seriesDescription:o.seriesDescription,seriesNumber:o.seriesNumber,seriesDate:o.seriesDate,seriesTime:o.seriesTime,modality:o.modality,seriesInstanceUid:o.seriesInstanceUid,numImages:r},i.instance=n,i.patient={name:a.patientName,id:a.patientId,birthDate:a.patientBirthDate,sex:a.patientSex,age:a.patientAge},i.imagePlane=this.getImagePlane(n),this.metadataLookup.set(e,i)}return e}(),e.prototype.getMetadata=function(){function e(e){return this.metadataLookup.get(e)}return e}(),e.prototype.addSpecificMetadata=function(){function e(e,t,n){var o={};o[t]=n;var a=this.metadataLookup.get(e);this.metadataLookup.set(e,Object.assign(a,o))}return e}(),e.prototype.getFromImage=function(){function e(e,t,n,o,a){var r=void 0;return r=e.data?this.getFromDataSet(e.data,t,n):e.instance[o],null==r?a:r}return e}(),e.prototype.getFromDataSet=function(){function e(e,t,n){if(e){var o=e[t];if(o)return o.call(e,n)}}return e}(),e.prototype.getFrameIncrementPointer=function(){function e(e){var t=e.data,n="";if(r.isValidDataSet(t)){var o={x00181063:"frameTime",x00181065:"frameTimeVector"},a=r.attributeTag(t,"x00280009");n=o[a]}else n=e.instance.frameIncrementPointer;return n||""}return e}(),e.prototype.getFrameTimeVector=function(){function e(e){var t=e.data;return r.isValidDataSet(t)?r.floatArray(t,"x00181065"):e.instance.frameTimeVector}return e}(),e.prototype.getFrameTime=function(){function e(e){var t=e.data;return r.isValidDataSet(t)?t.floatString("x00181063",-1):e.instance.frameTime}return e}(),e.prototype.updateMetadata=function(){function e(e){var t=this.metadataLookup.get(e.imageId);t&&(t.patient.age=t.patient.age||this.getFromDataSet(e.data,"string","x00101010"),t.instance.rows=t.instance.rows||e.rows,t.instance.columns=t.instance.columns||e.columns,t.instance.sopClassUid=t.instance.sopClassUid||this.getFromDataSet(e.data,"string","x00080016"),t.instance.sopInstanceUid=t.instance.sopInstanceUid||this.getFromDataSet(e.data,"string","x00080018"),t.instance.pixelSpacing=t.instance.pixelSpacing||this.getFromDataSet(e.data,"string","x00280030"),t.instance.frameOfReferenceUID=t.instance.frameOfReferenceUID||this.getFromDataSet(e.data,"string","x00200052"),t.instance.imageOrientationPatient=t.instance.imageOrientationPatient||this.getFromDataSet(e.data,"string","x00200037"),t.instance.imagePositionPatient=t.instance.imagePositionPatient||this.getFromDataSet(e.data,"string","x00200032"),t.instance.sliceThickness=t.instance.sliceThickness||this.getFromDataSet(e.data,"string","x00180050"),t.instance.sliceLocation=t.instance.sliceLocation||this.getFromDataSet(e.data,"string","x00201041"),t.instance.tablePosition=t.instance.tablePosition||this.getFromDataSet(e.data,"string","x00189327"),t.instance.spacingBetweenSlices=t.instance.spacingBetweenSlices||this.getFromDataSet(e.data,"string","x00180088"),t.instance.lossyImageCompression=t.instance.lossyImageCompression||this.getFromDataSet(e.data,"string","x00282110"),t.instance.lossyImageCompressionRatio=t.instance.lossyImageCompressionRatio||this.getFromDataSet(e.data,"string","x00282112"),t.instance.frameIncrementPointer=t.instance.frameIncrementPointer||this.getFromDataSet(e.data,"string","x00280009"),t.instance.frameTime=t.instance.frameTime||this.getFromDataSet(e.data,"string","x00181063"),t.instance.frameTimeVector=t.instance.frameTimeVector||this.getFromDataSet(e.data,"string","x00181065"),!e.data&&!e.instance||t.instance.multiframeMetadata||(t.instance.multiframeMetadata=this.getMultiframeModuleMetadata(e)),t.imagePlane=t.imagePlane||this.getImagePlane(t.instance))}return e}(),e.prototype.getImagePlane=function(){function e(e){if(e.rows&&e.columns&&e.pixelSpacing&&e.frameOfReferenceUID&&e.imageOrientationPatient&&e.imagePositionPatient){var t=e.imageOrientationPatient.split("\\"),n=e.imagePositionPatient.split("\\"),o=1,a=1;if(e.pixelSpacing){var r=e.pixelSpacing.split("\\");a=parseFloat(r[0]),o=parseFloat(r[1])}return{frameOfReferenceUID:e.frameOfReferenceUID,rows:e.rows,columns:e.columns,rowCosines:new h.Vector3(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2])),columnCosines:new h.Vector3(parseFloat(t[3]),parseFloat(t[4]),parseFloat(t[5])),imagePositionPatient:new h.Vector3(parseFloat(n[0]),parseFloat(n[1]),parseFloat(n[2])),rowPixelSpacing:a,columnPixelSpacing:o}}}return e}(),e.prototype.getMultiframeModuleMetadata=function(){function e(e){var t={isMultiframeImage:!1,frameIncrementPointer:null,numberOfFrames:0,frameTime:0,frameTimeVector:null,averageFrameRate:0},n=void 0,o=this.getFromImage(e,"intString","x00280008","numberOfFrames",-1);if(o>0){t.isMultiframeImage=!0,t.numberOfFrames=o;var a=this.getFrameIncrementPointer(e);if("frameTimeVector"===a){var r=this.getFrameTimeVector(e);r instanceof Array&&r.length>0&&(t.frameIncrementPointer=a,t.frameTimeVector=r,n=r.reduce(function(e,t){return e+t})/r.length,t.averageFrameRate=1e3/n)}else"frameTime"!==a&&""!==a||(n=this.getFrameTime(e),n>0&&(t.frameIncrementPointer=a,t.frameTime=n,t.averageFrameRate=1e3/n))}return t}return e}(),e.prototype.getProvider=function(){function e(){var e=this._provider;return o(this._provider)!==i&&(e=this.provider.bind(this),this._provider=e),e}return e}(),e.prototype.provider=function(){function e(e,t){var n=this.metadataLookup.get(t);if(n)return n.hasOwnProperty(e)?n[e]:void 0}return e}(),e}()}]}}}}}}},{extensions:[".js",".json"]});"undefined"==typeof m&&(m={internal:{},rendering:{},colors:{}}),function(e){"use strict";function t(t,n){var o=e.getEnabledElement(t),a=e.internal.getTransform(o);return a.invert(),a.transformPoint(n.x,n.y)}e.canvasToPixel=t}(m),function(e){function t(e,t,n){n=null==n?100:n;for(var o=(t-e)/(n-1),a=[];n-- >0;)a.push(e),e+=o;return a[a.length-1]=t,a}function n(e,t){for(var n=0,o=e.length-1;n<=o;){var a=n+Math.floor((o-n)/2),r=e[a];if(r===t)return a;t<r?o=a-1:n=a+1}return n}function o(e,t){var o,a=[],r=t.length;for(e.sort(function(e,t){return e-t}),o=0;o<r;o++)a[o]=n(e,t[o]);return a}function a(e,n,a){var r,i=[],s=[],l=[],u=[];for(a=null==a?1:a,r=0;r<n.length;r++){var c=n[r];i.push((e-1)*c[0]),s.push(c[1]),l.push(c[1])}var d=t(0,1,e);for(r=0;r<e;r++)d[r]=(e-1)*Math.pow(d[r],a);var f=o(i,d);for(r=1;r<e-1;r++){var m=f[r],h=(d[r]-i[m-1])/(i[m]-i[m-1]),g=s[m]-l[m-1];u[r]=h*g+l[m-1]}return u[0]=l[0],u[e-1]=s[n.length-1],u}function r(e,t,n){var o,r=[];t=null==t?256:t,n=null==n?1:n;var i=a(t,e.red,n),s=a(t,e.green,n),l=a(t,e.blue,n);for(o=0;o<t;o++){var u=Math.round(255*i[o]),c=Math.round(255*s[o]),d=Math.round(255*l[o]),f=[u,c,d,255];r.push(f)}return r}function i(){var e=[],t=Object.keys(u);return t.forEach(function(t){if(u.hasOwnProperty(t)){var n=u[t];e.push({id:t,name:n.name})}}),e.sort(function(e,t){var n=e.name.toLowerCase(),o=t.name.toLowerCase();return n===o?0:n<o?-1:1}),e}function s(t,n){var o=u[t];return o||(o=u[t]=n||{name:"",colors:[]}),!o.colors&&o.segmentedData&&(o.colors=r(o.segmentedData,o.numColors,o.gamma)),{getId:function(){return t},getColorSchemeName:function(e){return o.name},setColorSchemeName:function(e){o.name=e},getNumberOfColors:function(){return o.colors.length},setNumberOfColors:function(e){for(;o.colors.length<e;)o.colors.push(l);o.colors.length=e},getColor:function(e){return this.isValidIndex(e)?o.colors[e]:l},getColorRepeating:function(e){var t=o.colors.length;return e=t?e%t:0,this.getColor(e)},setColor:function(e,t){this.isValidIndex(e)&&(o.colors[e]=t)},addColor:function(e){o.colors.push(e)},insertColor:function(e,t){this.isValidIndex(e)&&o.colors.splice(e,1,t)},removeColor:function(e){this.isValidIndex(e)&&o.colors.splice(e,1)},clearColors:function(){o.colors=[]},buildLookupTable:function(e){if(e){var t,n=o.colors.length;for(e.setNumberOfTableValues(n),t=0;t<n;t++)e.setTableValue(t,o.colors[t])}},createLookupTable:function(){var t=new e.colors.LookupTable;return this.buildLookupTable(t),t},isValidIndex:function(e){return e>=0&&e<o.colors.length}}}var l=[0,0,0,255],u={hotIron:{name:"Hot Iron",numOfColors:256,colors:[[0,0,0,255],[2,0,0,255],[4,0,0,255],[6,0,0,255],[8,0,0,255],[10,0,0,255],[12,0,0,255],[14,0,0,255],[16,0,0,255],[18,0,0,255],[20,0,0,255],[22,0,0,255],[24,0,0,255],[26,0,0,255],[28,0,0,255],[30,0,0,255],[32,0,0,255],[34,0,0,255],[36,0,0,255],[38,0,0,255],[40,0,0,255],[42,0,0,255],[44,0,0,255],[46,0,0,255],[48,0,0,255],[50,0,0,255],[52,0,0,255],[54,0,0,255],[56,0,0,255],[58,0,0,255],[60,0,0,255],[62,0,0,255],[64,0,0,255],[66,0,0,255],[68,0,0,255],[70,0,0,255],[72,0,0,255],[74,0,0,255],[76,0,0,255],[78,0,0,255],[80,0,0,255],[82,0,0,255],[84,0,0,255],[86,0,0,255],[88,0,0,255],[90,0,0,255],[92,0,0,255],[94,0,0,255],[96,0,0,255],[98,0,0,255],[100,0,0,255],[102,0,0,255],[104,0,0,255],[106,0,0,255],[108,0,0,255],[110,0,0,255],[112,0,0,255],[114,0,0,255],[116,0,0,255],[118,0,0,255],[120,0,0,255],[122,0,0,255],[124,0,0,255],[126,0,0,255],[128,0,0,255],[130,0,0,255],[132,0,0,255],[134,0,0,255],[136,0,0,255],[138,0,0,255],[140,0,0,255],[142,0,0,255],[144,0,0,255],[146,0,0,255],[148,0,0,255],[150,0,0,255],[152,0,0,255],[154,0,0,255],[156,0,0,255],[158,0,0,255],[160,0,0,255],[162,0,0,255],[164,0,0,255],[166,0,0,255],[168,0,0,255],[170,0,0,255],[172,0,0,255],[174,0,0,255],[176,0,0,255],[178,0,0,255],[180,0,0,255],[182,0,0,255],[184,0,0,255],[186,0,0,255],[188,0,0,255],[190,0,0,255],[192,0,0,255],[194,0,0,255],[196,0,0,255],[198,0,0,255],[200,0,0,255],[202,0,0,255],[204,0,0,255],[206,0,0,255],[208,0,0,255],[210,0,0,255],[212,0,0,255],[214,0,0,255],[216,0,0,255],[218,0,0,255],[220,0,0,255],[222,0,0,255],[224,0,0,255],[226,0,0,255],[228,0,0,255],[230,0,0,255],[232,0,0,255],[234,0,0,255],[236,0,0,255],[238,0,0,255],[240,0,0,255],[242,0,0,255],[244,0,0,255],[246,0,0,255],[248,0,0,255],[250,0,0,255],[252,0,0,255],[254,0,0,255],[255,0,0,255],[255,2,0,255],[255,4,0,255],[255,6,0,255],[255,8,0,255],[255,10,0,255],[255,12,0,255],[255,14,0,255],[255,16,0,255],[255,18,0,255],[255,20,0,255],[255,22,0,255],[255,24,0,255],[255,26,0,255],[255,28,0,255],[255,30,0,255],[255,32,0,255],[255,34,0,255],[255,36,0,255],[255,38,0,255],[255,40,0,255],[255,42,0,255],[255,44,0,255],[255,46,0,255],[255,48,0,255],[255,50,0,255],[255,52,0,255],[255,54,0,255],[255,56,0,255],[255,58,0,255],[255,60,0,255],[255,62,0,255],[255,64,0,255],[255,66,0,255],[255,68,0,255],[255,70,0,255],[255,72,0,255],[255,74,0,255],[255,76,0,255],[255,78,0,255],[255,80,0,255],[255,82,0,255],[255,84,0,255],[255,86,0,255],[255,88,0,255],[255,90,0,255],[255,92,0,255],[255,94,0,255],[255,96,0,255],[255,98,0,255],[255,100,0,255],[255,102,0,255],[255,104,0,255],[255,106,0,255],[255,108,0,255],[255,110,0,255],[255,112,0,255],[255,114,0,255],[255,116,0,255],[255,118,0,255],[255,120,0,255],[255,122,0,255],[255,124,0,255],[255,126,0,255],[255,128,4,255],[255,130,8,255],[255,132,12,255],[255,134,16,255],[255,136,20,255],[255,138,24,255],[255,140,28,255],[255,142,32,255],[255,144,36,255],[255,146,40,255],[255,148,44,255],[255,150,48,255],[255,152,52,255],[255,154,56,255],[255,156,60,255],[255,158,64,255],[255,160,68,255],[255,162,72,255],[255,164,76,255],[255,166,80,255],[255,168,84,255],[255,170,88,255],[255,172,92,255],[255,174,96,255],[255,176,100,255],[255,178,104,255],[255,180,108,255],[255,182,112,255],[255,184,116,255],[255,186,120,255],[255,188,124,255],[255,190,128,255],[255,192,132,255],[255,194,136,255],[255,196,140,255],[255,198,144,255],[255,200,148,255],[255,202,152,255],[255,204,156,255],[255,206,160,255],[255,208,164,255],[255,210,168,255],[255,212,172,255],[255,214,176,255],[255,216,180,255],[255,218,184,255],[255,220,188,255],[255,222,192,255],[255,224,196,255],[255,226,200,255],[255,228,204,255],[255,230,208,255],[255,232,212,255],[255,234,216,255],[255,236,220,255],[255,238,224,255],[255,240,228,255],[255,242,232,255],[255,244,236,255],[255,246,240,255],[255,248,244,255],[255,250,248,255],[255,252,252,255],[255,255,255,255]]},pet:{name:"PET",numColors:256,colors:[[0,0,0,255],[0,2,1,255],[0,4,3,255],[0,6,5,255],[0,8,7,255],[0,10,9,255],[0,12,11,255],[0,14,13,255],[0,16,15,255],[0,18,17,255],[0,20,19,255],[0,22,21,255],[0,24,23,255],[0,26,25,255],[0,28,27,255],[0,30,29,255],[0,32,31,255],[0,34,33,255],[0,36,35,255],[0,38,37,255],[0,40,39,255],[0,42,41,255],[0,44,43,255],[0,46,45,255],[0,48,47,255],[0,50,49,255],[0,52,51,255],[0,54,53,255],[0,56,55,255],[0,58,57,255],[0,60,59,255],[0,62,61,255],[0,65,63,255],[0,67,65,255],[0,69,67,255],[0,71,69,255],[0,73,71,255],[0,75,73,255],[0,77,75,255],[0,79,77,255],[0,81,79,255],[0,83,81,255],[0,85,83,255],[0,87,85,255],[0,89,87,255],[0,91,89,255],[0,93,91,255],[0,95,93,255],[0,97,95,255],[0,99,97,255],[0,101,99,255],[0,103,101,255],[0,105,103,255],[0,107,105,255],[0,109,107,255],[0,111,109,255],[0,113,111,255],[0,115,113,255],[0,117,115,255],[0,119,117,255],[0,121,119,255],[0,123,121,255],[0,125,123,255],[0,128,125,255],[1,126,127,255],[3,124,129,255],[5,122,131,255],[7,120,133,255],[9,118,135,255],[11,116,137,255],[13,114,139,255],[15,112,141,255],[17,110,143,255],[19,108,145,255],[21,106,147,255],[23,104,149,255],[25,102,151,255],[27,100,153,255],[29,98,155,255],[31,96,157,255],[33,94,159,255],[35,92,161,255],[37,90,163,255],[39,88,165,255],[41,86,167,255],[43,84,169,255],[45,82,171,255],[47,80,173,255],[49,78,175,255],[51,76,177,255],[53,74,179,255],[55,72,181,255],[57,70,183,255],[59,68,185,255],[61,66,187,255],[63,64,189,255],[65,63,191,255],[67,61,193,255],[69,59,195,255],[71,57,197,255],[73,55,199,255],[75,53,201,255],[77,51,203,255],[79,49,205,255],[81,47,207,255],[83,45,209,255],[85,43,211,255],[86,41,213,255],[88,39,215,255],[90,37,217,255],[92,35,219,255],[94,33,221,255],[96,31,223,255],[98,29,225,255],[100,27,227,255],[102,25,229,255],[104,23,231,255],[106,21,233,255],[108,19,235,255],[110,17,237,255],[112,15,239,255],[114,13,241,255],[116,11,243,255],[118,9,245,255],[120,7,247,255],[122,5,249,255],[124,3,251,255],[126,1,253,255],[128,0,255,255],[130,2,252,255],[132,4,248,255],[134,6,244,255],[136,8,240,255],[138,10,236,255],[140,12,232,255],[142,14,228,255],[144,16,224,255],[146,18,220,255],[148,20,216,255],[150,22,212,255],[152,24,208,255],[154,26,204,255],[156,28,200,255],[158,30,196,255],[160,32,192,255],[162,34,188,255],[164,36,184,255],[166,38,180,255],[168,40,176,255],[170,42,172,255],[171,44,168,255],[173,46,164,255],[175,48,160,255],[177,50,156,255],[179,52,152,255],[181,54,148,255],[183,56,144,255],[185,58,140,255],[187,60,136,255],[189,62,132,255],[191,64,128,255],[193,66,124,255],[195,68,120,255],[197,70,116,255],[199,72,112,255],[201,74,108,255],[203,76,104,255],[205,78,100,255],[207,80,96,255],[209,82,92,255],[211,84,88,255],[213,86,84,255],[215,88,80,255],[217,90,76,255],[219,92,72,255],[221,94,68,255],[223,96,64,255],[225,98,60,255],[227,100,56,255],[229,102,52,255],[231,104,48,255],[233,106,44,255],[235,108,40,255],[237,110,36,255],[239,112,32,255],[241,114,28,255],[243,116,24,255],[245,118,20,255],[247,120,16,255],[249,122,12,255],[251,124,8,255],[253,126,4,255],[255,128,0,255],[255,130,4,255],[255,132,8,255],[255,134,12,255],[255,136,16,255],[255,138,20,255],[255,140,24,255],[255,142,28,255],[255,144,32,255],[255,146,36,255],[255,148,40,255],[255,150,44,255],[255,152,48,255],[255,154,52,255],[255,156,56,255],[255,158,60,255],[255,160,64,255],[255,162,68,255],[255,164,72,255],[255,166,76,255],[255,168,80,255],[255,170,85,255],[255,172,89,255],[255,174,93,255],[255,176,97,255],[255,178,101,255],[255,180,105,255],[255,182,109,255],[255,184,113,255],[255,186,117,255],[255,188,121,255],[255,190,125,255],[255,192,129,255],[255,194,133,255],[255,196,137,255],[255,198,141,255],[255,200,145,255],[255,202,149,255],[255,204,153,255],[255,206,157,255],[255,208,161,255],[255,210,165,255],[255,212,170,255],[255,214,174,255],[255,216,178,255],[255,218,182,255],[255,220,186,255],[255,222,190,255],[255,224,194,255],[255,226,198,255],[255,228,202,255],[255,230,206,255],[255,232,210,255],[255,234,214,255],[255,236,218,255],[255,238,222,255],[255,240,226,255],[255,242,230,255],[255,244,234,255],[255,246,238,255],[255,248,242,255],[255,250,246,255],[255,252,250,255],[255,255,255,255]]},hotMetalBlue:{name:"Hot Metal Blue",numColors:256,colors:[[0,0,0,255],[0,0,2,255],[0,0,4,255],[0,0,6,255],[0,0,8,255],[0,0,10,255],[0,0,12,255],[0,0,14,255],[0,0,16,255],[0,0,17,255],[0,0,19,255],[0,0,21,255],[0,0,23,255],[0,0,25,255],[0,0,27,255],[0,0,29,255],[0,0,31,255],[0,0,33,255],[0,0,35,255],[0,0,37,255],[0,0,39,255],[0,0,41,255],[0,0,43,255],[0,0,45,255],[0,0,47,255],[0,0,49,255],[0,0,51,255],[0,0,53,255],[0,0,55,255],[0,0,57,255],[0,0,59,255],[0,0,61,255],[0,0,63,255],[0,0,65,255],[0,0,67,255],[0,0,69,255],[0,0,71,255],[0,0,73,255],[0,0,75,255],[0,0,77,255],[0,0,79,255],[0,0,81,255],[0,0,83,255],[0,0,84,255],[0,0,86,255],[0,0,88,255],[0,0,90,255],[0,0,92,255],[0,0,94,255],[0,0,96,255],[0,0,98,255],[0,0,100,255],[0,0,102,255],[0,0,104,255],[0,0,106,255],[0,0,108,255],[0,0,110,255],[0,0,112,255],[0,0,114,255],[0,0,116,255],[0,0,117,255],[0,0,119,255],[0,0,121,255],[0,0,123,255],[0,0,125,255],[0,0,127,255],[0,0,129,255],[0,0,131,255],[0,0,133,255],[0,0,135,255],[0,0,137,255],[0,0,139,255],[0,0,141,255],[0,0,143,255],[0,0,145,255],[0,0,147,255],[0,0,149,255],[0,0,151,255],[0,0,153,255],[0,0,155,255],[0,0,157,255],[0,0,159,255],[0,0,161,255],[0,0,163,255],[0,0,165,255],[0,0,167,255],[3,0,169,255],[6,0,171,255],[9,0,173,255],[12,0,175,255],[15,0,177,255],[18,0,179,255],[21,0,181,255],[24,0,183,255],[26,0,184,255],[29,0,186,255],[32,0,188,255],[35,0,190,255],[38,0,192,255],[41,0,194,255],[44,0,196,255],[47,0,198,255],[50,0,200,255],[52,0,197,255],[55,0,194,255],[57,0,191,255],[59,0,188,255],[62,0,185,255],[64,0,182,255],[66,0,179,255],[69,0,176,255],[71,0,174,255],[74,0,171,255],[76,0,168,255],[78,0,165,255],[81,0,162,255],[83,0,159,255],[85,0,156,255],[88,0,153,255],[90,0,150,255],[93,2,144,255],[96,4,138,255],[99,6,132,255],[102,8,126,255],[105,9,121,255],[108,11,115,255],[111,13,109,255],[114,15,103,255],[116,17,97,255],[119,19,91,255],[122,21,85,255],[125,23,79,255],[128,24,74,255],[131,26,68,255],[134,28,62,255],[137,30,56,255],[140,32,50,255],[143,34,47,255],[146,36,44,255],[149,38,41,255],[152,40,38,255],[155,41,35,255],[158,43,32,255],[161,45,29,255],[164,47,26,255],[166,49,24,255],[169,51,21,255],[172,53,18,255],[175,55,15,255],[178,56,12,255],[181,58,9,255],[184,60,6,255],[187,62,3,255],[190,64,0,255],[194,66,0,255],[198,68,0,255],[201,70,0,255],[205,72,0,255],[209,73,0,255],[213,75,0,255],[217,77,0,255],[221,79,0,255],[224,81,0,255],[228,83,0,255],[232,85,0,255],[236,87,0,255],[240,88,0,255],[244,90,0,255],[247,92,0,255],[251,94,0,255],[255,96,0,255],[255,98,3,255],[255,100,6,255],[255,102,9,255],[255,104,12,255],[255,105,15,255],[255,107,18,255],[255,109,21,255],[255,111,24,255],[255,113,26,255],[255,115,29,255],[255,117,32,255],[255,119,35,255],[255,120,38,255],[255,122,41,255],[255,124,44,255],[255,126,47,255],[255,128,50,255],[255,130,53,255],[255,132,56,255],[255,134,59,255],[255,136,62,255],[255,137,65,255],[255,139,68,255],[255,141,71,255],[255,143,74,255],[255,145,76,255],[255,147,79,255],[255,149,82,255],[255,151,85,255],[255,152,88,255],[255,154,91,255],[255,156,94,255],[255,158,97,255],[255,160,100,255],[255,162,103,255],[255,164,106,255],[255,166,109,255],[255,168,112,255],[255,169,115,255],[255,171,118,255],[255,173,121,255],[255,175,124,255],[255,177,126,255],[255,179,129,255],[255,181,132,255],[255,183,135,255],[255,184,138,255],[255,186,141,255],[255,188,144,255],[255,190,147,255],[255,192,150,255],[255,194,153,255],[255,196,156,255],[255,198,159,255],[255,200,162,255],[255,201,165,255],[255,203,168,255],[255,205,171,255],[255,207,174,255],[255,209,176,255],[255,211,179,255],[255,213,182,255],[255,215,185,255],[255,216,188,255],[255,218,191,255],[255,220,194,255],[255,222,197,255],[255,224,200,255],[255,226,203,255],[255,228,206,255],[255,229,210,255],[255,231,213,255],[255,233,216,255],[255,235,219,255],[255,237,223,255],[255,239,226,255],[255,240,229,255],[255,242,232,255],[255,244,236,255],[255,246,239,255],[255,248,242,255],[255,250,245,255],[255,251,249,255],[255,253,252,255],[255,255,255,255]]},pet20Step:{name:"PET 20 Step",numColors:256,colors:[[0,0,0,255],[0,0,0,255],[0,0,0,255],[0,0,0,255],[0,0,0,255],[0,0,0,255],[0,0,0,255],[0,0,0,255],[0,0,0,255],[0,0,0,255],[0,0,0,255],[0,0,0,255],[0,0,0,255],[96,0,80,255],[96,0,80,255],[96,0,80,255],[96,0,80,255],[96,0,80,255],[96,0,80,255],[96,0,80,255],[96,0,80,255],[96,0,80,255],[96,0,80,255],[96,0,80,255],[96,0,80,255],[96,0,80,255],[48,48,80,255],[48,48,80,255],[48,48,80,255],[48,48,80,255],[48,48,80,255],[48,48,80,255],[48,48,80,255],[48,48,80,255],[48,48,80,255],[48,48,80,255],[48,48,80,255],[48,48,80,255],[48,48,80,255],[48,48,112,255],[48,48,112,255],[48,48,112,255],[48,48,112,255],[48,48,112,255],[48,48,112,255],[48,48,112,255],[48,48,112,255],[48,48,112,255],[48,48,112,255],[48,48,112,255],[48,48,112,255],[80,80,128,255],[80,80,128,255],[80,80,128,255],[80,80,128,255],[80,80,128,255],[80,80,128,255],[80,80,128,255],[80,80,128,255],[80,80,128,255],[80,80,128,255],[80,80,128,255],[80,80,128,255],[80,80,128,255],[96,96,176,255],[96,96,176,255],[96,96,176,255],[96,96,176,255],[96,96,176,255],[96,96,176,255],[96,96,176,255],[96,96,176,255],[96,96,176,255],[96,96,176,255],[96,96,176,255],[96,96,176,255],[96,96,176,255],[112,112,192,255],[112,112,192,255],[112,112,192,255],[112,112,192,255],[112,112,192,255],[112,112,192,255],[112,112,192,255],[112,112,192,255],[112,112,192,255],[112,112,192,255],[112,112,192,255],[112,112,192,255],[112,112,192,255],[128,128,224,255],[128,128,224,255],[128,128,224,255],[128,128,224,255],[128,128,224,255],[128,128,224,255],[128,128,224,255],[128,128,224,255],[128,128,224,255],[128,128,224,255],[128,128,224,255],[128,128,224,255],[48,96,48,255],[48,96,48,255],[48,96,48,255],[48,96,48,255],[48,96,48,255],[48,96,48,255],[48,96,48,255],[48,96,48,255],[48,96,48,255],[48,96,48,255],[48,96,48,255],[48,96,48,255],[48,96,48,255],[48,144,48,255],[48,144,48,255],[48,144,48,255],[48,144,48,255],[48,144,48,255],[48,144,48,255],[48,144,48,255],[48,144,48,255],[48,144,48,255],[48,144,48,255],[48,144,48,255],[48,144,48,255],[48,144,48,255],[80,192,80,255],[80,192,80,255],[80,192,80,255],[80,192,80,255],[80,192,80,255],[80,192,80,255],[80,192,80,255],[80,192,80,255],[80,192,80,255],[80,192,80,255],[80,192,80,255],[80,192,80,255],[80,192,80,255],[64,224,64,255],[64,224,64,255],[64,224,64,255],[64,224,64,255],[64,224,64,255],[64,224,64,255],[64,224,64,255],[64,224,64,255],[64,224,64,255],[64,224,64,255],[64,224,64,255],[64,224,64,255],[224,224,80,255],[224,224,80,255],[224,224,80,255],[224,224,80,255],[224,224,80,255],[224,224,80,255],[224,224,80,255],[224,224,80,255],[224,224,80,255],[224,224,80,255],[224,224,80,255],[224,224,80,255],[224,224,80,255],[208,208,96,255],[208,208,96,255],[208,208,96,255],[208,208,96,255],[208,208,96,255],[208,208,96,255],[208,208,96,255],[208,208,96,255],[208,208,96,255],[208,208,96,255],[208,208,96,255],[208,208,96,255],[208,208,96,255],[208,176,64,255],[208,176,64,255],[208,176,64,255],[208,176,64,255],[208,176,64,255],[208,176,64,255],[208,176,64,255],[208,176,64,255],[208,176,64,255],[208,176,64,255],[208,176,64,255],[208,176,64,255],[208,176,64,255],[208,144,0,255],[208,144,0,255],[208,144,0,255],[208,144,0,255],[208,144,0,255],[208,144,0,255],[208,144,0,255],[208,144,0,255],[208,144,0,255],[208,144,0,255],[208,144,0,255],[208,144,0,255],[192,96,0,255],[192,96,0,255],[192,96,0,255],[192,96,0,255],[192,96,0,255],[192,96,0,255],[192,96,0,255],[192,96,0,255],[192,96,0,255],[192,96,0,255],[192,96,0,255],[192,96,0,255],[192,96,0,255],[176,48,0,255],[176,48,0,255],[176,48,0,255],[176,48,0,255],[176,48,0,255],[176,48,0,255],[176,48,0,255],[176,48,0,255],[176,48,0,255],[176,48,0,255],[176,48,0,255],[176,48,0,255],[176,48,0,255],[255,0,0,255],[255,0,0,255],[255,0,0,255],[255,0,0,255],[255,0,0,255],[255,0,0,255],[255,0,0,255],[255,0,0,255],[255,0,0,255],[255,0,0,255],[255,0,0,255],[255,0,0,255],[255,0,0,255],[255,255,255,255],[255,255,255,255],[255,255,255,255],[255,255,255,255],[255,255,255,255],[255,255,255,255],[255,255,255,255],[255,255,255,255],[255,255,255,255],[255,255,255,255],[255,255,255,255],[255,255,255,255],[255,255,255,255]]},gray:{name:"Gray",numColors:256,gamma:1,segmentedData:{red:[[0,0,0],[1,1,1]],green:[[0,0,0],[1,1,1]],blue:[[0,0,0],[1,1,1]]}},jet:{name:"Jet",numColors:256,gamma:1,segmentedData:{red:[[0,0,0],[.35,0,0],[.66,1,1],[.89,1,1],[1,.5,.5]],green:[[0,0,0],[.125,0,0],[.375,1,1],[.64,1,1],[.91,0,0],[1,0,0]],blue:[[0,.5,.5],[.11,1,1],[.34,1,1],[.65,0,0],[1,0,0]]}},hsv:{name:"HSV",numColors:256,gamma:1,segmentedData:{red:[[0,1,1],[.15873,1,1],[.174603,.96875,.96875],[.333333,.03125,.03125],[.349206,0,0],[.666667,0,0],[.68254,.03125,.03125],[.84127,.96875,.96875],[.857143,1,1],[1,1,1]],green:[[0,0,0],[.15873,.9375,.9375],[.174603,1,1],[.507937,1,1],[.666667,.0625,.0625],[.68254,0,0],[1,0,0]],blue:[[0,0,0],[.333333,0,0],[.349206,.0625,.0625],[.507937,1,1],[.84127,1,1],[.857143,.9375,.9375],[1,.09375,.09375]]}},hot:{name:"Hot",numColors:256,gamma:1,segmentedData:{red:[[0,.0416,.0416],[.365079,1,1],[1,1,1]],green:[[0,0,0],[.365079,0,0],[.746032,1,1],[1,1,1]],blue:[[0,0,0],[.746032,0,0],[1,1,1]]}},cool:{name:"Cool",numColors:256,gamma:1,segmentedData:{red:[[0,0,0],[1,1,1]],green:[[0,1,1],[1,0,0]],blue:[[0,1,1],[1,1,1]]}},spring:{name:"Spring",numColors:256,gamma:1,segmentedData:{red:[[0,1,1],[1,1,1]],green:[[0,0,0],[1,1,1]],blue:[[0,1,1],[1,0,0]]}},summer:{name:"Summer",numColors:256,gamma:1,segmentedData:{red:[[0,0,0],[1,1,1]],green:[[0,.5,.5],[1,1,1]],blue:[[0,.4,.4],[1,.4,.4]]}},autumn:{name:"Autumn",numColors:256,gamma:1,segmentedData:{red:[[0,1,1],[1,1,1]],green:[[0,0,0],[1,1,1]],blue:[[0,0,0],[1,0,0]]}},winter:{name:"Winter",numColors:256,gamma:1,segmentedData:{red:[[0,0,0],[1,0,0]],green:[[0,0,0],[1,1,1]],blue:[[0,1,1],[1,.5,.5]]}},bone:{name:"Bone",numColors:256,gamma:1,segmentedData:{red:[[0,0,0],[.746032,.652778,.652778],[1,1,1]],green:[[0,0,0],[.365079,.319444,.319444],[.746032,.777778,.777778],[1,1,1]],blue:[[0,0,0],[.365079,.444444,.444444],[1,1,1]]}},copper:{name:"Copper",numColors:256,gamma:1,segmentedData:{red:[[0,0,0],[.809524,1,1],[1,1,1]],green:[[0,0,0],[1,.7812,.7812]],blue:[[0,0,0],[1,.4975,.4975]]}},spectral:{name:"Spectral",numColors:256,gamma:1,segmentedData:{red:[[0,0,0],[.05,.4667,.4667],[.1,.5333,.5333],[.15,0,0],[.2,0,0],[.25,0,0],[.3,0,0],[.35,0,0],[.4,0,0],[.45,0,0],[.5,0,0],[.55,0,0],[.6,0,0],[.65,.7333,.7333],[.7,.9333,.9333],[.75,1,1],[.8,1,1],[.85,1,1],[.9,.8667,.8667],[.95,.8,.8],[1,.8,.8]],green:[[0,0,0],[.05,0,0],[.1,0,0],[.15,0,0],[.2,0,0],[.25,.4667,.4667],[.3,.6,.6],[.35,.6667,.6667],[.4,.6667,.6667],[.45,.6,.6],[.5,.7333,.7333],[.55,.8667,.8667],[.6,1,1],[.65,1,1],[.7,.9333,.9333],[.75,.8,.8],[.8,.6,.6],[.85,0,0],[.9,0,0],[.95,0,0],[1,.8,.8]],blue:[[0,0,0],[.05,.5333,.5333],[.1,.6,.6],[.15,.6667,.6667],[.2,.8667,.8667],[.25,.8667,.8667],[.3,.8667,.8667],[.35,.6667,.6667],[.4,.5333,.5333],[.45,0,0],[.5,0,0],[.55,0,0],[.6,0,0],[.65,0,0],[.7,0,0],[.75,0,0],[.8,0,0],[.85,0,0],[.9,0,0],[.95,0,0],[1,.8,.8]]}},coolwarm:{name:"CoolWarm",numColors:256,gamma:1,segmentedData:{red:[[0,.2298057,.2298057],[.03125,.26623388,.26623388],[.0625,.30386891,.30386891],[.09375,.342804478,.342804478],[.125,.38301334,.38301334],[.15625,.424369608,.424369608],[.1875,.46666708,.46666708],[.21875,.509635204,.509635204],[.25,.552953156,.552953156],[.28125,.596262162,.596262162],[.3125,.639176211,.639176211],[.34375,.681291281,.681291281],[.375,.722193294,.722193294],[.40625,.761464949,.761464949],[.4375,.798691636,.798691636],[.46875,.833466556,.833466556],[.5,.865395197,.865395197],[.53125,.897787179,.897787179],[.5625,.924127593,.924127593],[.59375,.944468518,.944468518],[.625,.958852946,.958852946],[.65625,.96732803,.96732803],[.6875,.969954137,.969954137],[.71875,.966811177,.966811177],[.75,.958003065,.958003065],[.78125,.943660866,.943660866],[.8125,.923944917,.923944917],[.84375,.89904617,.89904617],[.875,.869186849,.869186849],[.90625,.834620542,.834620542],[.9375,.795631745,.795631745],[.96875,.752534934,.752534934],[1,.705673158,.705673158]],green:[[0,.298717966,.298717966],[.03125,.353094838,.353094838],[.0625,.406535296,.406535296],[.09375,.458757618,.458757618],[.125,.50941904,.50941904],[.15625,.558148092,.558148092],[.1875,.604562568,.604562568],[.21875,.648280772,.648280772],[.25,.688929332,.688929332],[.28125,.726149107,.726149107],[.3125,.759599947,.759599947],[.34375,.788964712,.788964712],[.375,.813952739,.813952739],[.40625,.834302879,.834302879],[.4375,.849786142,.849786142],[.46875,.860207984,.860207984],[.5,.86541021,.86541021],[.53125,.848937047,.848937047],[.5625,.827384882,.827384882],[.59375,.800927443,.800927443],[.625,.769767752,.769767752],[.65625,.734132809,.734132809],[.6875,.694266682,.694266682],[.71875,.650421156,.650421156],[.75,.602842431,.602842431],[.78125,.551750968,.551750968],[.8125,.49730856,.49730856],[.84375,.439559467,.439559467],[.875,.378313092,.378313092],[.90625,.312874446,.312874446],[.9375,.24128379,.24128379],[.96875,.157246067,.157246067],[1,.01555616,.01555616]],
blue:[[0,.753683153,.753683153],[.03125,.801466763,.801466763],[.0625,.84495867,.84495867],[.09375,.883725899,.883725899],[.125,.917387822,.917387822],[.15625,.945619588,.945619588],[.1875,.968154911,.968154911],[.21875,.98478814,.98478814],[.25,.995375608,.995375608],[.28125,.999836203,.999836203],[.3125,.998151185,.998151185],[.34375,.990363227,.990363227],[.375,.976574709,.976574709],[.40625,.956945269,.956945269],[.4375,.931688648,.931688648],[.46875,.901068838,.901068838],[.5,.865395561,.865395561],[.53125,.820880546,.820880546],[.5625,.774508472,.774508472],[.59375,.726736146,.726736146],[.625,.678007945,.678007945],[.65625,.628751763,.628751763],[.6875,.579375448,.579375448],[.71875,.530263762,.530263762],[.75,.481775914,.481775914],[.78125,.434243684,.434243684],[.8125,.387970225,.387970225],[.84375,.343229596,.343229596],[.875,.300267182,.300267182],[.90625,.259301199,.259301199],[.9375,.220525627,.220525627],[.96875,.184115123,.184115123],[1,.150232812,.150232812]]}},blues:{name:"Blues",numColors:256,gamma:1,segmentedData:{red:[[0,.9686274528503418,.9686274528503418],[.125,.8705882430076599,.8705882430076599],[.25,.7764706015586853,.7764706015586853],[.375,.6196078658103943,.6196078658103943],[.5,.41960784792900085,.41960784792900085],[.625,.25882354378700256,.25882354378700256],[.75,.12941177189350128,.12941177189350128],[.875,.0313725508749485,.0313725508749485],[1,.0313725508749485,.0313725508749485]],green:[[0,.9843137264251709,.9843137264251709],[.125,.9215686321258545,.9215686321258545],[.25,.8588235378265381,.8588235378265381],[.375,.7921568751335144,.7921568751335144],[.5,.6823529601097107,.6823529601097107],[.625,.572549045085907,.572549045085907],[.75,.4431372582912445,.4431372582912445],[.875,.3176470696926117,.3176470696926117],[1,.1882352977991104,.1882352977991104]],blue:[[0,1,1],[.125,.9686274528503418,.9686274528503418],[.25,.9372549057006836,.9372549057006836],[.375,.8823529481887817,.8823529481887817],[.5,.8392156958580017,.8392156958580017],[.625,.7764706015586853,.7764706015586853],[.75,.7098039388656616,.7098039388656616],[.875,.6117647290229797,.6117647290229797],[1,.41960784792900085,.41960784792900085]]}}};e.colors.getColormap=s,e.colors.getColormapsList=i}(m),function(e){"use strict";function t(){this.NumberOfColors=256,this.Ramp="linear",this.TableRange=[0,255],this.HueRange=[0,.66667],this.SaturationRange=[1,1],this.ValueRange=[1,1],this.AlphaRange=[1,1],this.NaNColor=[128,0,0,255],this.BelowRangeColor=[0,0,0,255],this.UseBelowRangeColor=!0,this.AboveRangeColor=[255,255,255,255],this.UseAboveRangeColor=!0,this.InputRange=[0,255],this.Table=[],this.setNumberOfTableValues=function(e){this.NumberOfColors=e},this.setRamp=function(e){this.Ramp=e},this.setTableRange=function(e,t){this.TableRange[0]=e,this.TableRange[1]=t},this.setHueRange=function(e,t){this.HueRange[0]=e,this.HueRange[1]=t},this.setSaturationRange=function(e,t){this.SaturationRange[0]=e,this.SaturationRange[1]=t},this.setValueRange=function(e,t){this.ValueRange[0]=e,this.ValueRange[1]=t},this.setRange=function(e,t){this.InputRange[0]=e,this.InputRange[1]=t},this.setAlphaRange=function(e,t){this.AlphaRange[0]=e,this.AlphaRange[1]=t},this.getColor=function(e){return this.mapValue(e)},this.getOpacity=function(){return opacity},this.HSVToRGB=function(e,t,n){if(e>1)throw"HSVToRGB expects hue < 1";var o=[];if(0===t)return o[0]=n,o[1]=n,o[2]=n,o;var a=Math.floor(6*e),r=6*e-a,i=n*(1-t),s=n*(1-t*r),l=n*(1-t*(1-r));switch(a){case 0:case 6:o[0]=n,o[1]=l,o[2]=i;break;case 1:o[0]=s,o[1]=n,o[2]=i;break;case 2:o[0]=i,o[1]=n,o[2]=l;break;case 3:o[0]=i,o[1]=s,o[2]=n;break;case 4:o[0]=l,o[1]=i,o[2]=n;break;case 5:o[0]=n,o[1]=i,o[2]=s}return o},this.build=function(e){if(!(this.Table.length>1)||e){this.Table=[];var t=this.NumberOfColors-1,n,o,a,r;t?(n=(this.HueRange[1]-this.HueRange[0])/t,o=(this.SaturationRange[1]-this.SaturationRange[0])/t,a=(this.ValueRange[1]-this.ValueRange[0])/t,r=(this.AlphaRange[1]-this.AlphaRange[0])/t):n=o=a=r=0;for(var i=0;i<=t;i++){var s=this.HueRange[0]+i*n,l=this.SaturationRange[0]+i*o,u=this.ValueRange[0]+i*a,c=this.AlphaRange[0]+i*r,d=this.HSVToRGB(s,l,u),f=[];switch(this.Ramp){case"scurve":f[0]=Math.floor(127.5*(1+Math.cos((1-d[0])*Math.PI))),f[1]=Math.floor(127.5*(1+Math.cos((1-d[1])*Math.PI))),f[2]=Math.floor(127.5*(1+Math.cos((1-d[2])*Math.PI))),f[3]=Math.floor(255*c);break;case"linear":f[0]=Math.floor(255*d[0]+.5),f[1]=Math.floor(255*d[1]+.5),f[2]=Math.floor(255*d[2]+.5),f[3]=Math.floor(255*c+.5);break;case"sqrt":f[0]=Math.floor(255*Math.sqrt(d[0])+.5),f[1]=Math.floor(255*Math.sqrt(d[1])+.5),f[2]=Math.floor(255*Math.sqrt(d[2])+.5),f[3]=Math.floor(255*Math.sqrt(c)+.5);break;default:throw new Error("Invalid Ramp value ("+this.Ramp+")")}this.Table.push(f)}this.buildSpecialColors()}},this.buildSpecialColors=function(){var e=this.NumberOfColors,t=e+n,r=e+o,i=e+a;this.UseBelowRangeColor||0===e?this.Table[t]=this.BelowRangeColor:this.Table[t]=this.Table[0],this.UseAboveRangeColor||0===e?this.Table[r]=this.AboveRangeColor:this.Table[r]=this.Table[e-1],this.Table[i]=this.NaNColor},this.mapValue=function(e){var t=this.getIndex(e);if(t<0)return this.NaNColor;if(0===t){if(this.UseBelowRangeColor&&e<this.TableRange[0])return this.BelowRangeColor}else if(t===this.NumberOfColors-1&&this.UseAboveRangeColor&&e>this.TableRange[1])return this.AboveRangeColor;return this.Table[t]},this.linearIndexLookupMain=function(e,t){var a;return a=e<t.Range[0]?t.MaxIndex+n+1.5:e>t.Range[1]?t.MaxIndex+o+1.5:(e+t.Shift)*t.Scale,Math.round(a)},this.getIndex=function(e){var t={};if(t.Range=[],t.MaxIndex=this.NumberOfColors-1,t.Shift=-this.TableRange[0],this.TableRange[1]<=this.TableRange[0]?t.Scale=Number.MAX_VALUE:t.Scale=t.MaxIndex/(this.TableRange[1]-this.TableRange[0]),t.Range[0]=this.TableRange[0],t.Range[1]=this.TableRange[1],isNaN(e))return-1;var a=this.linearIndexLookupMain(e,t);return a===this.NumberOfColors+n?a=0:a===this.NumberOfColors+o&&(a=this.NumberOfColors-1),a},this.setTableValue=function(e,t){if(5===arguments.length&&(t=Array.prototype.slice.call(arguments,1)),e<0)throw new Error("Can't set the table value for negative index ("+e+")");e>=this.NumberOfColors&&new Error("Index "+e+" is greater than the number of colors "+this.NumberOfColors),this.Table[e]=t,0!==e&&e!==this.NumberOfColors-1||this.buildSpecialColors()}}var n=0,o=1,a=2,r=a+1;e.colors.LookupTable=t}(m),function(e){"use strict";function t(t){if(void 0===t)throw"disable: element element must not be undefined";for(var n=e.getEnabledElements(),a=0;a<n.length;a++)if(n[a].element===t){var r={element:t};return o(t).trigger("CornerstoneElementDisabled",r),n[a].element.removeChild(n[a].canvas),n[a].canvas=void 0,void n.splice(a,1)}}e.disable=t}(m),function(e,t){"use strict";function n(n,o,a){if(void 0===n)throw"displayImage: parameter element cannot be undefined";if(void 0===o)throw"displayImage: parameter image cannot be undefined";var r=t.getEnabledElement(n);if(r.image=o,void 0===r.viewport&&(r.viewport=t.internal.getDefaultViewport(r.canvas,o)),a)for(var i in a)null!==a[i]&&(r.viewport[i]=a[i]);var s=new Date,l;if(void 0!==r.lastImageTimeStamp){var u=s.getTime()-r.lastImageTimeStamp;l=(1e3/u).toFixed()}r.lastImageTimeStamp=s.getTime();var c={viewport:r.viewport,element:r.element,image:r.image,enabledElement:r,frameRate:l};e(r.element).trigger("CornerstoneNewImage",c),t.updateImage(n)}t.displayImage=n}(o,m),function(e,t){"use strict";function n(e){var n=t.getEnabledElement(e);if(void 0===n.image)throw"draw: image has not been loaded yet";t.drawImage(n)}t.draw=n}(o,m),function(e,t){"use strict";function n(){for(var e=t.getEnabledElements(),n=0;n<e.length;n++){var o=e[n];o.invalid===!0&&t.drawImage(o,!0)}}t.drawInvalidated=n}(o,m),function(e){"use strict";function t(t,n){function a(){if(void 0!==i.canvas){if(i.needsRedraw&&void 0!==i.image){var t=new Date,n=i.image.render;n||(n=i.image.color?e.renderColorImage:e.renderGrayscaleImage),n(i,i.invalid);var r=i.canvas.getContext("2d"),s=new Date,l=s-t,u={viewport:i.viewport,element:i.element,image:i.image,enabledElement:i,canvasContext:r,renderTimeInMs:l};i.invalid=!1,i.needsRedraw=!1,o(i.element).trigger("CornerstoneImageRendered",u)}e.requestAnimationFrame(a)}}if(void 0===t)throw"enable: parameter element cannot be undefined";n&&n.renderer&&"webgl"===n.renderer.toLowerCase()&&(e.webGL.renderer.isWebGLAvailable()?(console.log("Using WebGL rendering path"),e.webGL.renderer.initRenderer(),n.renderer="webgl"):(console.error("WebGL not available, falling back to Canvas renderer"),delete n.renderer));var r=document.createElement("canvas");t.appendChild(r);var i={element:t,canvas:r,image:void 0,invalid:!1,needsRedraw:!0,options:n,data:{}};return e.addEnabledElement(i),e.resize(t,!0),a(),t}e.enable=t}(m),function(e){"use strict";function t(t,n){var o=e.getEnabledElement(t);return o.data.hasOwnProperty(n)===!1&&(o.data[n]={}),o.data[n]}function n(t,n){var o=e.getEnabledElement(t);delete o.data[n]}e.getElementData=t,e.removeElementData=n}(m),function(e){"use strict";function t(e){if(void 0===e)throw"getEnabledElement: parameter element must not be undefined";for(var t=0;t<r.length;t++)if(r[t].element==e)return r[t];throw"element not enabled"}function n(e){if(void 0===e)throw"getEnabledElement: enabledElement element must not be undefined";r.push(e)}function o(e){var t=[];return r.forEach(function(n){n.image&&n.image.imageId===e&&t.push(n)}),t}function a(){return r}var r=[];e.getEnabledElement=t,e.addEnabledElement=n,e.getEnabledElementsByImageId=o,e.getEnabledElements=a}(m),function(e){"use strict";function t(e){for(var t=Number.MAX_VALUE,n=Number.MIN_VALUE,o=e.length,a,r=0;r<o;r++)a=e[r],t=t<a?t:a,n=n>a?n:a;return{minPixelValue:t,maxPixelValue:n}}function n(e){if(e.restore)return e.restore;var t=e.color,n=e.rgba,o=e.lut,a=e.slope,r=e.windowWidth,i=e.windowCenter,s=e.minPixelValue,l=e.maxPixelValue;return function(){if(e.color=t,e.rgba=n,e.lut=o,e.slope=a,e.windowWidth=r,e.windowCenter=i,e.minPixelValue=s,e.maxPixelValue=l,e.origPixelData){var u=e.origPixelData;e.getPixelData=function(){return u}}delete e.origPixelData,delete e.colormapId,delete e.falseColor}}function o(t){return t&&"string"==typeof t&&(t=e.colors.getColormap(t)),t}function a(e){return!(!e.restore||"function"!=typeof e.restore)&&(e.restore(),!0)}function r(r,i){if(r.color&&!r.falseColor)throw"Color transforms are not implemented yet";i=o(i);var s=i.getId();if(r.colormapId===s)return!1;if(a(r),s){var l=r.minPixelValue||0,u=r.maxPixelValue||255,c;r.restore=n(r),c=i.createLookupTable(),c.setTableRange(l,u),e.pixelDataToFalseColorData(r,c);var d=t(r.getPixelData());r.minPixelValue=d.minPixelValue,r.maxPixelValue=d.maxPixelValue,r.colormapId=s}return!0}function i(t,n){var o=e.getEnabledElement(t),a=r(o.image,n);a&&e.updateImage(t,!0)}e.convertImageToFalseColorImage=r,e.convertToFalseColorImage=i,e.restoreImage=a}(m),function(e){"use strict";function t(e){return 0===e.viewport.rotation||180===e.viewport.rotation?{width:e.image.width,height:e.image.height}:{width:e.image.height,height:e.image.width}}function n(n){var o=e.getEnabledElement(n),a=t(o),r=o.canvas.height/a.height,i=o.canvas.width/a.width;i<r?o.viewport.scale=i:o.viewport.scale=r,o.viewport.translation.x=0,o.viewport.translation.y=0,e.updateImage(n)}e.fitToWindow=n}(m),function(e,t){"use strict";function n(e,n){var o=t.getEnabledElement(e),a=t.internal.getDefaultViewport(o.canvas,n);return a}t.getDefaultViewportForImage=n}(o,m),function(e,t){"use strict";function n(e){var n=t.getEnabledElement(e);return n.image}t.getImage=n}(o,m),function(e){"use strict";function t(t,n,o,a,r){var i=e.getStoredPixels(t,n,o,a,r),s=e.getEnabledElement(t),l=e.internal.getModalityLUT(s.image.slope,s.image.intercept,s.viewport.modalityLUT),u=i.map(l);return u}e.getPixels=t}(m),function(e){"use strict";function t(t,n,o,a,r){if(void 0===t)throw"getStoredPixels: parameter element must not be undefined";n=Math.round(n),o=Math.round(o);for(var i=e.getEnabledElement(t),s=[],l=0,u=i.image.getPixelData(),c=0;c<r;c++)for(var d=0;d<a;d++){var f=(c+o)*i.image.columns+(d+n);s[l++]=u[f]}return s}e.getStoredPixels=t}(m),function(e){"use strict";function t(t){var n=e.getEnabledElement(t),o=n.viewport;if(void 0!==o)return{scale:o.scale,translation:{x:o.translation.x,y:o.translation.y},voi:{windowWidth:o.voi.windowWidth,windowCenter:o.voi.windowCenter},invert:o.invert,pixelReplication:o.pixelReplication,rotation:o.rotation,hflip:o.hflip,vflip:o.vflip,modalityLUT:o.modalityLUT,voiLUT:o.voiLUT}}e.getViewport=t}(m),function(e){"use strict";function t(e){if(void 0===e)throw"setMaximumSizeBytes: parameter numBytes must not be undefined";if(void 0===e.toFixed)throw"setMaximumSizeBytes: parameter numBytes must be a number";m=e,n()}function n(){function t(e,t){return e.timeStamp>t.timeStamp?-1:e.timeStamp<t.timeStamp?1:0}if(!(h<=m)){for(f.sort(t);h>m;){var n=f[f.length-1],a=n.imageId;i(a),o(e).trigger("CornerstoneImageCachePromiseRemoved",{imageId:a})}var r=e.imageCache.getCacheInfo();o(e).trigger("CornerstoneImageCacheFull",r)}}function a(e,t){if(void 0===e)throw"getImagePromise: imageId must not be undefined";if(void 0===t)throw"getImagePromise: imagePromise must not be undefined";if(d.hasOwnProperty(e)===!0)throw"putImagePromise: imageId already in cache";var o={loaded:!1,imageId:e,sharedCacheKey:void 0,imagePromise:t,timeStamp:new Date,sizeInBytes:0};d[e]=o,f.push(o),t.then(function(e){if(o.loaded=!0,o.image=e,void 0===e.sizeInBytes)throw"putImagePromise: image does not have sizeInBytes property or";if(void 0===e.sizeInBytes.toFixed)throw"putImagePromise: image.sizeInBytes is not a number";o.sizeInBytes=e.sizeInBytes,h+=o.sizeInBytes,o.sharedCacheKey=e.sharedCacheKey,n()})}function r(e){if(void 0===e)throw"getImagePromise: imageId must not be undefined";var t=d[e];if(void 0!==t)return t.timeStamp=new Date,t.imagePromise}function i(e){if(void 0===e)throw"removeImagePromise: imageId must not be undefined";var t=d[e];if(void 0===t)throw"removeImagePromise: imageId must not be undefined";return t.imagePromise.reject(),f.splice(f.indexOf(t),1),h-=t.sizeInBytes,l(t.imagePromise,t.imageId),delete d[e],t.imagePromise}function s(){return{maximumSizeInBytes:m,cacheSizeInBytes:h,numberOfImagesCached:f.length}}function l(e,t){e.then(function(e){e.decache&&e.decache()}).always(function(){delete d[t]})}function u(){for(;f.length>0;){var e=f[0];i(e.imageId)}}function c(e,t){var n=d[e];n&&n.imagePromise.then(function(e){var n=t-e.sizeInBytes;e.sizeInBytes=t,h+=n})}var d={},f=[],m=1073741824,h=0;e.imageCache={putImagePromise:a,getImagePromise:r,removeImagePromise:i,setMaximumSizeBytes:t,getCacheInfo:s,purgeCache:u,cachedImages:f,imageCache:d,changeImageIdCacheSize:c}}(m),function(e,t){"use strict";function n(n,o){var a=n.indexOf(":"),r=n.substring(0,a),i=s[r],u;return void 0===i||null===i?void 0!==l?u=l(n):void 0:(u=i(n,o),u.then(function(n){e(t).trigger("CornerstoneImageLoaded",{image:n})}),u)}function o(e,o){if(void 0===e)throw"loadImage: parameter imageId must not be undefined";var a=t.imageCache.getImagePromise(e);if(void 0!==a)return a;if(a=n(e,o),void 0===a)throw"loadImage: no image loader for imageId";return a}function a(e,o){if(void 0===e)throw"loadAndCacheImage: parameter imageId must not be undefined";var a=t.imageCache.getImagePromise(e);if(void 0!==a)return a;if(a=n(e,o),void 0===a)throw"loadAndCacheImage: no image loader for imageId";return t.imageCache.putImagePromise(e,a),a}function r(e,t){s[e]=t}function i(e){var t=l;return l=e,t}var s={},l;t.loadImage=o,t.loadAndCacheImage=a,t.registerImageLoader=r,t.registerUnknownImageLoader=i}(o,m),function(e){"use strict";function t(t,n){var o=new e.internal.Transform;o.translate(t.canvas.width/2,t.canvas.height/2);var a=t.viewport.rotation;0!==a&&o.rotate(a*Math.PI/180);var r=t.viewport.scale,i=t.viewport.scale;return t.image.rowPixelSpacing<t.image.columnPixelSpacing?r*=t.image.columnPixelSpacing/t.image.rowPixelSpacing:t.image.columnPixelSpacing<t.image.rowPixelSpacing&&(i*=t.image.rowPixelSpacing/t.image.columnPixelSpacing),o.scale(r,i),0!==a&&o.rotate(-a*Math.PI/180),o.translate(t.viewport.translation.x,t.viewport.translation.y),0!==a&&o.rotate(a*Math.PI/180),void 0!==n&&o.scale(n,n),t.viewport.hflip&&o.scale(-1,1),t.viewport.vflip&&o.scale(1,-1),o.translate(-t.image.width/2,-t.image.height/2),o}e.internal.calculateTransform=t}(m),function(e,t){"use strict";function n(e,t){e.needsRedraw=!0,t&&(e.invalid=!0)}t.internal.drawImage=n,t.drawImage=n}(o,m),function(e){"use strict";function t(t,n,o,a,r,i){void 0===t.lut&&(t.lut=new Int16Array(t.maxPixelValue-Math.min(t.minPixelValue,0)+1));var s=t.lut,l=t.maxPixelValue,u=t.minPixelValue,c=e.internal.getModalityLUT(t.slope,t.intercept,r),d=e.internal.getVOILUT(n,o,i),f=0;u<0&&(f=u);var m,h,g,p;for(m=t.minPixelValue;m<=l;m++)h=c(m),g=d(h),p=Math.min(Math.max(g,0),255),a?s[m+-f]=Math.round(255-p):s[m+-f]=Math.round(p);return s}function n(e,n,o,a,r,i){if(r||i)return t(e,n,o,a,r,i);void 0===e.lut&&(e.lut=new Int16Array(e.maxPixelValue-Math.min(e.minPixelValue,0)+1));var s=e.lut,l=e.maxPixelValue,u=e.minPixelValue,c=e.slope,d=e.intercept,f=n,m=o,h,g,p,v,y=0;if(u<0&&(y=u),a===!0)for(v=e.minPixelValue;v<=l;v++)h=v*c+d,g=255*((h-m)/f+.5),p=Math.min(Math.max(g,0),255),s[v+-y]=Math.round(255-p);else for(v=e.minPixelValue;v<=l;v++)h=v*c+d,g=255*((h-m)/f+.5),p=Math.min(Math.max(g,0),255),s[v+-y]=Math.round(p)}e.internal.generateLutNew=t,e.internal.generateLut=n,e.generateLutNew=t,e.generateLut=n}(m),function(e){"use strict";function t(e,t){if(void 0===e)throw"getDefaultViewport: parameter canvas must not be undefined";if(void 0===t)throw"getDefaultViewport: parameter image must not be undefined";var n={scale:1,translation:{x:0,y:0},voi:{windowWidth:t.windowWidth,windowCenter:t.windowCenter},invert:t.invert,pixelReplication:!1,rotation:0,hflip:!1,vflip:!1,modalityLUT:t.modalityLUT,voiLUT:t.voiLUT},o=e.height/t.rows,a=e.width/t.columns;return a<o?n.scale=a:n.scale=o,n}e.internal.getDefaultViewport=t,e.getDefaultViewport=t}(m),function(e){"use strict";function t(t){var n=e.internal.calculateTransform(t);return n}e.internal.getTransform=t}(m),function(e,t){"use strict";t.drawImage=t.internal.drawImage,t.generateLut=t.internal.generateLut,t.storedPixelDataToCanvasImageData=t.internal.storedPixelDataToCanvasImageData,t.storedColorPixelDataToCanvasImageData=t.internal.storedColorPixelDataToCanvasImageData}(o,m),function(e){"use strict";function t(e,t){var n=e,o=t;return function(e){return e*n+o}}function n(e){var t=e.lut[0],n=e.lut[e.lut.length-1],o=e.firstValueMapped+e.lut.length;return function(a){return a<e.firstValueMapped?t:a>=o?n:e.lut[a]}}function o(e,o,a){return a?n(a):t(e,o)}e.internal.getModalityLUT=o}(m),function(e){"use strict";function t(e){window.setTimeout(e,1e3/60)}function n(e){return window.requestAnimationFrame(e)||window.webkitRequestAnimationFrame(e)||window.mozRequestAnimationFrame(e)||window.oRequestAnimationFrame(e)||window.msRequestAnimationFrame(e)||t(e)}e.requestAnimationFrame=n}(m),function(e){"use strict";function t(e,t,n){var o=e.minPixelValue,a=0,r=0,i=e.width*e.height*4,s=e.getPixelData(),l=t,u=n;if(o<0)for(;r<i;)u[a++]=l[s[r++]+-o],u[a++]=l[s[r++]+-o],u[a]=l[s[r]+-o],r+=2,a+=2;else for(;r<i;)u[a++]=l[s[r++]],u[a++]=l[s[r++]],u[a]=l[s[r]],r+=2,a+=2}e.internal.storedColorPixelDataToCanvasImageData=t,e.storedColorPixelDataToCanvasImageData=t}(m),function(e){"use strict";function t(e,t,n){var o=e.getPixelData(),a=e.minPixelValue,r=3,i=0,s=o.length,l=o,u=t,c=n;if(a<0)for(;i<s;)c[r]=u[l[i++]+-a],r+=4;else for(;i<s;)c[r]=u[l[i++]],r+=4}e.internal.storedPixelDataToCanvasImageData=t,e.storedPixelDataToCanvasImageData=t}(m),function(e){"use strict";function t(){this.reset()}t.prototype.reset=function(){this.m=[1,0,0,1,0,0]},t.prototype.clone=function(){var e=new t;return e.m[0]=this.m[0],e.m[1]=this.m[1],e.m[2]=this.m[2],e.m[3]=this.m[3],e.m[4]=this.m[4],e.m[5]=this.m[5],e},t.prototype.multiply=function(e){var t=this.m[0]*e.m[0]+this.m[2]*e.m[1],n=this.m[1]*e.m[0]+this.m[3]*e.m[1],o=this.m[0]*e.m[2]+this.m[2]*e.m[3],a=this.m[1]*e.m[2]+this.m[3]*e.m[3],r=this.m[0]*e.m[4]+this.m[2]*e.m[5]+this.m[4],i=this.m[1]*e.m[4]+this.m[3]*e.m[5]+this.m[5];this.m[0]=t,this.m[1]=n,this.m[2]=o,this.m[3]=a,this.m[4]=r,this.m[5]=i},t.prototype.invert=function(){var e=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),t=this.m[3]*e,n=-this.m[1]*e,o=-this.m[2]*e,a=this.m[0]*e,r=e*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),i=e*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);this.m[0]=t,this.m[1]=n,this.m[2]=o,this.m[3]=a,this.m[4]=r,this.m[5]=i},t.prototype.rotate=function(e){var t=Math.cos(e),n=Math.sin(e),o=this.m[0]*t+this.m[2]*n,a=this.m[1]*t+this.m[3]*n,r=this.m[0]*-n+this.m[2]*t,i=this.m[1]*-n+this.m[3]*t;this.m[0]=o,this.m[1]=a,this.m[2]=r,this.m[3]=i},t.prototype.translate=function(e,t){this.m[4]+=this.m[0]*e+this.m[2]*t,this.m[5]+=this.m[1]*e+this.m[3]*t},t.prototype.scale=function(e,t){this.m[0]*=e,this.m[1]*=e,this.m[2]*=t,this.m[3]*=t},t.prototype.transformPoint=function(e,t){var n=e,o=t;return e=n*this.m[0]+o*this.m[2]+this.m[4],t=n*this.m[1]+o*this.m[3]+this.m[5],{x:e,y:t}},e.internal.Transform=t}(m),function(e){"use strict";function t(e,t){return function(n){return 255*((n-t)/e+.5)}}function n(e){var t=e.numBitsPerEntry-8,n=e.lut[0]>>t,o=e.lut[e.lut.length-1]>>t,a=e.firstValueMapped+e.lut.length-1;return function(r){return r<e.firstValueMapped?n:r>=a?o:e.lut[r-e.firstValueMapped]>>t}}function o(e,o,a){return a?n(a):t(e,o)}e.internal.getVOILUT=o}(m),function(e){"use strict";function t(t){var n=e.getEnabledElement(t);n.invalid=!0,n.needsRedraw=!0;var a={element:t};o(n.element).trigger("CornerstoneInvalidated",a)}e.invalidate=t}(m),function(e){"use strict";function t(t){var n=e.getEnabledElementsByImageId(t);n.forEach(function(t){e.drawImage(t,!0)})}e.invalidateImageId=t}(m),function(e,t){"use strict";function n(e,t){t=t||0;for(var n=0;n<r.length&&!(r[n].priority<=t);n++);r.splice(n,0,{priority:t,provider:e})}function o(e){for(var t=0;t<r.length;t++)if(r[t].provider===e)return void r.splice(t,1)}function a(e,t){for(var n=0;n<r.length;n++){var o;if(o=r[n].provider(e,t),void 0!==o)return o}}var r=[];t.metaData={addProvider:n,removeProvider:o,get:a}}(o,m),function(e){"use strict";function t(t,n,o){var a=e.getEnabledElement(t);if(void 0===a.image)throw"image has not been loaded yet";var r=a.image,i=t.getBoundingClientRect(),s=n-i.left-window.pageXOffset,l=o-i.top-window.pageYOffset,u={x:s,y:l},c=e.internal.getTransform(a);return c.invert(),c.transformPoint(u.x,u.y)}e.pageToPixel=t}(m),function(e){"use strict";function t(t,n){if(t.color&&!t.falseColor)throw"Color transforms are not implemented yet";var o=t.minPixelValue,a=0,r=0,i=t.width*t.height,s=t.origPixelData||t.getPixelData(),l=new Uint8Array(4*i),u=n,c,d;if(t.color=!0,t.falseColor=!0,t.origPixelData=s,n instanceof e.colors.LookupTable)for(n.build();r<i;)c=s[r++],d=n.mapValue(c),l[a++]=d[0],l[a++]=d[1],l[a++]=d[2],l[a++]=d[3];else if(o<0)for(;r<i;)c=s[r++],l[a++]=u[c+-o][0],l[a++]=u[c+-o][1],l[a++]=u[c+-o][2],l[a++]=u[c+-o][3];else for(;r<i;)c=s[r++],l[a++]=u[c][0],l[a++]=u[c][1],l[a++]=u[c][2],l[a++]=u[c][3];t.rgba=!0,t.lut=void 0,t.slope=1,t.minPixelValue=0,t.maxPixelValue=255,t.windowWidth=255,t.windowCenter=128,t.getPixelData=function(){return l}}e.pixelDataToFalseColorData=t}(m),function(e){"use strict";function t(t,n){var o=e.getEnabledElement(t),a=e.internal.getTransform(o);return a.transformPoint(n.x,n.y)}e.pixelToCanvas=t}(m),function(e){"use strict";function t(e,t){var n=e.renderingTools.colorRenderCanvas;n.width=t.width,n.height=t.height;var o=n.getContext("2d");o.fillStyle="white",o.fillRect(0,0,n.width,n.height);var a=o.getImageData(0,0,t.width,t.height);e.renderingTools.colorRenderCanvasContext=o,e.renderingTools.colorRenderCanvasData=a}function n(t,n){return void 0!==t.lut&&t.lut.windowCenter===n.voi.windowCenter&&t.lut.windowWidth===n.voi.windowWidth&&t.lut.invert===n.invert?t.lut:(e.generateLut(t,n.voi.windowWidth,n.voi.windowCenter,n.invert),t.lut.windowWidth=n.voi.windowWidth,t.lut.windowCenter=n.voi.windowCenter,t.lut.invert=n.invert,t.lut)}function o(e,t){var n=e.renderingTools.lastRenderedImageId,o=e.renderingTools.lastRenderedViewport;return t.imageId!==n||o.windowCenter!==e.viewport.voi.windowCenter||o.windowWidth!==e.viewport.voi.windowWidth||o.invert!==e.viewport.invert||o.rotation!==e.viewport.rotation||o.hflip!==e.viewport.hflip||o.vflip!==e.viewport.vflip}function a(a,r,i){a.renderingTools.colorRenderCanvas||(a.renderingTools.colorRenderCanvas=document.createElement("canvas"));var s=a.renderingTools.colorRenderCanvas;if(255===a.viewport.voi.windowWidth&&128===a.viewport.voi.windowCenter&&a.viewport.invert===!1&&r.getCanvas&&r.getCanvas())return r.getCanvas();if(o(a,r)===!1&&i!==!0)return s;s.width===r.width&&s.height===r.height||t(a,r);var l=n(r,a.viewport),u=a.renderingTools.colorRenderCanvasData,c=a.renderingTools.colorRenderCanvasContext;return e.storedColorPixelDataToCanvasImageData(r,l,u.data),c.putImageData(u,0,0),s}function r(t,n){if(void 0===t)throw"drawImage: enabledElement parameter must not be undefined";var o=t.image;if(void 0===o)throw"drawImage: image must be loaded before it can be drawn";var r=t.canvas.getContext("2d");r.setTransform(1,0,0,1,0,0),r.fillStyle="black",r.fillRect(0,0,t.canvas.width,t.canvas.height),t.viewport.pixelReplication===!0?(r.imageSmoothingEnabled=!1,r.mozImageSmoothingEnabled=!1):(r.imageSmoothingEnabled=!0,r.mozImageSmoothingEnabled=!0),r.save(),e.setToPixelCoordinateSystem(t,r),t.renderingTools||(t.renderingTools={});var i;i=t.options&&t.options.renderer&&"webgl"===t.options.renderer.toLowerCase()?e.webGL.renderer.render(t):a(t,o,n),r.drawImage(i,0,0,o.width,o.height,0,0,o.width,o.height),r.restore(),t.renderingTools.lastRenderedImageId=o.imageId;var s={};s.windowCenter=t.viewport.voi.windowCenter,s.windowWidth=t.viewport.voi.windowWidth,s.invert=t.viewport.invert,s.rotation=t.viewport.rotation,s.hflip=t.viewport.hflip,s.vflip=t.viewport.vflip,t.renderingTools.lastRenderedViewport=s}e.rendering.colorImage=r,e.renderColorImage=r}(m),function(e){"use strict";function t(e,t){var n=e.renderingTools.grayscaleRenderCanvas;n.width=t.width,n.height=t.height;var o=n.getContext("2d");o.fillStyle="white",o.fillRect(0,0,n.width,n.height);var a=o.getImageData(0,0,t.width,t.height);e.renderingTools.grayscaleRenderCanvasContext=o,e.renderingTools.grayscaleRenderCanvasData=a}function n(e,t){return!e&&!t||!(!e||!t)&&e.id===t.id}function o(t,o,a){return void 0!==t.lut&&t.lut.windowCenter===o.voi.windowCenter&&t.lut.windowWidth===o.voi.windowWidth&&n(t.lut.modalityLUT,o.modalityLUT)&&n(t.lut.voiLUT,o.voiLUT)&&t.lut.invert===o.invert&&a!==!0?t.lut:(e.generateLut(t,o.voi.windowWidth,o.voi.windowCenter,o.invert,o.modalityLUT,o.voiLUT),t.lut.windowWidth=o.voi.windowWidth,t.lut.windowCenter=o.voi.windowCenter,t.lut.invert=o.invert,t.lut.voiLUT=o.voiLUT,t.lut.modalityLUT=o.modalityLUT,t.lut)}function a(e,t){var n=e.renderingTools.lastRenderedImageId,o=e.renderingTools.lastRenderedViewport;return t.imageId!==n||o.windowCenter!==e.viewport.voi.windowCenter||o.windowWidth!==e.viewport.voi.windowWidth||o.invert!==e.viewport.invert||o.rotation!==e.viewport.rotation||o.hflip!==e.viewport.hflip||o.vflip!==e.viewport.vflip||o.modalityLUT!==e.viewport.modalityLUT||o.voiLUT!==e.viewport.voiLUT}function r(n,r,i){n.renderingTools.grayscaleRenderCanvas||(n.renderingTools.grayscaleRenderCanvas=document.createElement("canvas"));var s=n.renderingTools.grayscaleRenderCanvas;if(a(n,r)===!1&&i!==!0)return s;s.width===r.width&&s.height===r.height||t(n,r);var l=o(r,n.viewport,i),u=n.renderingTools.grayscaleRenderCanvasData,c=n.renderingTools.grayscaleRenderCanvasContext;return e.storedPixelDataToCanvasImageData(r,l,u.data),c.putImageData(u,0,0),s}function i(t,n){if(void 0===t)throw"drawImage: enabledElement parameter must not be undefined";var o=t.image;if(void 0===o)throw"drawImage: image must be loaded before it can be drawn";var a=t.canvas.getContext("2d");a.setTransform(1,0,0,1,0,0),a.fillStyle="black",a.fillRect(0,0,t.canvas.width,t.canvas.height),t.viewport.pixelReplication===!0?(a.imageSmoothingEnabled=!1,a.mozImageSmoothingEnabled=!1):(a.imageSmoothingEnabled=!0,a.mozImageSmoothingEnabled=!0),e.setToPixelCoordinateSystem(t,a),t.renderingTools||(t.renderingTools={});var i;i=t.options&&t.options.renderer&&"webgl"===t.options.renderer.toLowerCase()?e.webGL.renderer.render(t):r(t,o,n),a.drawImage(i,0,0,o.width,o.height,0,0,o.width,o.height),t.renderingTools.lastRenderedImageId=o.imageId;var s={};s.windowCenter=t.viewport.voi.windowCenter,s.windowWidth=t.viewport.voi.windowWidth,s.invert=t.viewport.invert,s.rotation=t.viewport.rotation,s.hflip=t.viewport.hflip,s.vflip=t.viewport.vflip,s.modalityLUT=t.viewport.modalityLUT,s.voiLUT=t.viewport.voiLUT,t.renderingTools.lastRenderedViewport=s}e.rendering.grayscaleImage=i,e.renderGrayscaleImage=i}(m),function(e){"use strict";function t(t,n){if(void 0===t)throw"drawImage: enabledElement parameter must not be undefined";var o=t.image;if(void 0===o)throw"drawImage: image must be loaded before it can be drawn";var a=t.canvas.getContext("2d");a.setTransform(1,0,0,1,0,0),a.fillStyle="black",a.fillRect(0,0,t.canvas.width,t.canvas.height),t.viewport.pixelReplication===!0?(a.imageSmoothingEnabled=!1,a.mozImageSmoothingEnabled=!1):(a.imageSmoothingEnabled=!0,a.mozImageSmoothingEnabled=!0),e.setToPixelCoordinateSystem(t,a),t.viewport.voi.windowWidth===t.image.windowWidth&&t.viewport.voi.windowCenter===t.image.windowCenter&&t.viewport.invert===!1?a.drawImage(o.getImage(),0,0,o.width,o.height,0,0,o.width,o.height):e.renderColorImage(t,n)}e.rendering.webImage=t,e.renderWebImage=t}(m),function(e){"use strict";function t(t){var n=e.getEnabledElement(t),o=e.internal.getDefaultViewport(n.canvas,n.image);n.viewport=o,e.updateImage(t)}e.reset=t}(m),function(e){"use strict";function t(e,t){t.width=e.clientWidth,t.height=e.clientHeight,t.style.width=e.clientWidth+"px",t.style.height=e.clientHeight+"px"}function n(n,a){var r=e.getEnabledElement(n);t(n,r.canvas);var i={element:n};o(n).trigger("CornerstoneElementResized",i),void 0!==r.image&&(a===!0?e.fitToWindow(n):e.updateImage(n))}e.resize=n}(m),function(e){"use strict";function t(t,n,o){if(void 0===t)throw"setToPixelCoordinateSystem: parameter enabledElement must not be undefined";if(void 0===n)throw"setToPixelCoordinateSystem: parameter context must not be undefined";var a=e.internal.calculateTransform(t,o);n.setTransform(a.m[0],a.m[1],a.m[2],a.m[3],a.m[4],a.m[5])}e.setToPixelCoordinateSystem=t}(m),function(e){"use strict";function t(t,n){var o=e.getEnabledElement(t);o.viewport.scale=n.scale,o.viewport.translation.x=n.translation.x,o.viewport.translation.y=n.translation.y,o.viewport.voi.windowWidth=n.voi.windowWidth,o.viewport.voi.windowCenter=n.voi.windowCenter,o.viewport.invert=n.invert,o.viewport.pixelReplication=n.pixelReplication,o.viewport.rotation=n.rotation,o.viewport.hflip=n.hflip,o.viewport.vflip=n.vflip,o.viewport.modalityLUT=n.modalityLUT,o.viewport.voiLUT=n.voiLUT,o.viewport.voi.windowWidth<1e-6&&(o.viewport.voi.windowWidth=1e-6),o.viewport.scale<1e-4&&(o.viewport.scale=.25),360!==o.viewport.rotation&&o.viewport.rotation!==-360||(o.viewport.rotation=0),e.updateImage(t)}e.setViewport=t}(m),function(e){"use strict";function t(t,n){var o=e.getEnabledElement(t);if(void 0===o.image)throw"updateImage: image has not been loaded yet";e.drawImage(o,n)}e.updateImage=t}(m),function(e){"use strict";function t(e,t,n){var o=e.createShader(n);e.shaderSource(o,t),e.compileShader(o);var a=e.getShaderParameter(o,e.COMPILE_STATUS);if(!a&&!e.isContextLost()){var r=e.getShaderInfoLog(o);console.error("Could not compile shader:\n"+r)}return o}function n(e,t,n){var o=e.createProgram();e.attachShader(o,t),e.attachShader(o,n),e.linkProgram(o);var a=e.getProgramParameter(o,e.LINK_STATUS);if(!a&&!e.isContextLost()){var r=e.getProgramInfoLog(o);console.error("WebGL program filed to link:\n"+r)}return o}function o(e,o,a){
var r=t(e,o,e.VERTEX_SHADER),i=t(e,a,e.FRAGMENT_SHADER);return n(e,r,i)}e.webGL||(e.webGL={}),e.webGL.createProgramFromString=o}(m),function(e){"use strict";function t(){return p}function n(){for(var t in e.webGL.shaders){var n=e.webGL.shaders[t];n.attributes={},n.uniforms={},n.vert=e.webGL.vertexShader,n.program=e.webGL.createProgramFromString(T,n.vert,n.frag),n.attributes.texCoordLocation=T.getAttribLocation(n.program,"a_texCoord"),T.enableVertexAttribArray(n.attributes.texCoordLocation),n.attributes.positionLocation=T.getAttribLocation(n.program,"a_position"),T.enableVertexAttribArray(n.attributes.positionLocation),n.uniforms.resolutionLocation=T.getUniformLocation(n.program,"u_resolution")}}function o(){e.webGL.isWebGLInitialized!==!0&&s(p)&&(f(),n(),e.webGL.isWebGLInitialized=!0)}function a(e,t,n){e.bufferData(e.ARRAY_BUFFER,new Float32Array([t,n,0,n,t,0,0,0]),e.STATIC_DRAW)}function r(e){e.preventDefault(),console.warn("WebGL Context Lost!")}function i(t){t.preventDefault(),e.webGL.isWebGLInitialized=!1,e.webGL.textureCache.purgeCache(),o()}function s(t){T=null;try{var n={preserveDrawingBuffer:!0};e.webGL.debug===!0&&WebGLDebugUtils&&(p=WebGLDebugUtils.makeLostContextSimulatingCanvas(p)),T=t.getContext("webgl",n)||t.getContext("experimental-webgl",n),t.removeEventListener("webglcontextlost",r,!1),t.addEventListener("webglcontextlost",r,!1),t.removeEventListener("webglcontextrestored",i,!1),t.addEventListener("webglcontextrestored",i,!1)}catch(e){throw"Error creating WebGL context"}return T||(console.error("Unable to initialize WebGL. Your browser may not support it."),T=null),T}function l(e){if(e.color)return"rgb";var t="int";return e.minPixelValue>=0&&(t="u"+t),t+=e.maxPixelValue>255?"16":"8"}function u(t){var n=l(t);if(e.webGL.shaders.hasOwnProperty(n))return e.webGL.shaders[n];var o=e.webGL.shaders.rgb;return o}function c(t){var n=e.webGL.textureCache.getImageTexture(t.imageId);return n||(n=d(t),e.webGL.textureCache.putImageTexture(t,n)),n.texture}function d(t){var n={uint8:T.LUMINANCE,int8:T.LUMINANCE_ALPHA,uint16:T.LUMINANCE_ALPHA,int16:T.RGB,rgb:T.RGB},o={int8:1,uint16:2,int16:3,rgb:3},a=l(t),r=n[a],i=T.createTexture();T.bindTexture(T.TEXTURE_2D,i),T.texParameteri(T.TEXTURE_2D,T.TEXTURE_MIN_FILTER,T.NEAREST),T.texParameteri(T.TEXTURE_2D,T.TEXTURE_MAG_FILTER,T.NEAREST),T.texParameteri(T.TEXTURE_2D,T.TEXTURE_WRAP_S,T.CLAMP_TO_EDGE),T.texParameteri(T.TEXTURE_2D,T.TEXTURE_WRAP_T,T.CLAMP_TO_EDGE),T.pixelStorei(T.UNPACK_ALIGNMENT,1);var s=e.webGL.dataUtilities[a].storedPixelDataToImageData(t,t.width,t.height);T.texImage2D(T.TEXTURE_2D,0,r,t.width,t.height,0,r,T.UNSIGNED_BYTE,s);var u=t.width*t.height*o[a],c={texture:i,sizeInBytes:u};return c}function f(){b=T.createBuffer(),T.bindBuffer(T.ARRAY_BUFFER,b),T.bufferData(T.ARRAY_BUFFER,new Float32Array([1,1,0,1,1,0,0,0]),T.STATIC_DRAW),C=T.createBuffer(),T.bindBuffer(T.ARRAY_BUFFER,C),T.bufferData(T.ARRAY_BUFFER,new Float32Array([1,1,0,1,1,0,0,0]),T.STATIC_DRAW)}function m(e,t,n,o,r){T.clearColor(1,0,0,1),T.viewport(0,0,o,r),T.clear(T.COLOR_BUFFER_BIT|T.DEPTH_BUFFER_BIT),T.useProgram(e.program),T.bindBuffer(T.ARRAY_BUFFER,C),T.vertexAttribPointer(e.attributes.texCoordLocation,2,T.FLOAT,!1,0,0),T.bindBuffer(T.ARRAY_BUFFER,b),T.vertexAttribPointer(e.attributes.positionLocation,2,T.FLOAT,!1,0,0);for(var i in t){var s=T.getUniformLocation(e.program,i);if(!s)throw"Could not access location for uniform: "+i;var l=t[i],u=l.type,c=l.value;"i"==u?T.uniform1i(s,c):"f"==u?T.uniform1f(s,c):"2f"==u&&T.uniform2f(s,c[0],c[1])}a(T,o,r),T.activeTexture(T.TEXTURE0),T.bindTexture(T.TEXTURE_2D,n),T.drawArrays(T.TRIANGLE_STRIP,0,4)}function h(e){var t=e.image;p.width=t.width,p.height=t.height;var n=e.viewport,o=u(t),a=c(t),r={u_resolution:{type:"2f",value:[t.width,t.height]},wc:{type:"f",value:n.voi.windowCenter},ww:{type:"f",value:n.voi.windowWidth},slope:{type:"f",value:t.slope},intercept:{type:"f",value:t.intercept},invert:{type:"i",value:n.invert?1:0}};return m(o,r,a,t.width,t.height),p}function g(){var e={failIfMajorPerformanceCaveat:!0};try{var t=document.createElement("canvas");return!!window.WebGLRenderingContext&&(t.getContext("webgl",e)||t.getContext("experimental-webgl",e))}catch(e){return!1}}e.webGL||(e.webGL={});var p=document.createElement("canvas"),v,y,T,x,w,C,b;e.webGL.isWebGLInitialized=!1,e.webGL.renderer={render:h,initRenderer:o,getRenderCanvas:t,isWebGLAvailable:g}}(m),function(e){"use strict";function t(e){for(var t=e.getPixelData(),n=3,o=new Uint8Array(e.width*e.height*n),a=0,r=0;r<t.length;r++){var i=Math.abs(t[r]);o[a++]=parseInt(255&i,10),o[a++]=parseInt(i>>8,10),o[a++]=t[r]<0?0:1}return o}e.webGL||(e.webGL={}),e.webGL.shaders||(e.webGL.shaders={}),e.webGL.dataUtilities||(e.webGL.dataUtilities={});var n={};e.webGL.dataUtilities.int16={storedPixelDataToImageData:t},n.frag="precision mediump float;uniform sampler2D u_image;uniform float ww;uniform float wc;uniform float slope;uniform float intercept;uniform int invert;varying vec2 v_texCoord;void main() {vec4 color = texture2D(u_image, v_texCoord);float intensity = color.r*256.0 + color.g*65536.0;if (color.b == 0.0)intensity = -intensity;intensity = intensity * slope + intercept;float center0 = wc - 0.5;float width0 = max(ww, 1.0);intensity = (intensity - center0) / width0 + 0.5;intensity = clamp(intensity, 0.0, 1.0);gl_FragColor = vec4(intensity, intensity, intensity, 1.0);if (invert == 1)gl_FragColor.rgb = 1.0 - gl_FragColor.rgb;}",e.webGL.shaders.int16=n}(m),function(e){"use strict";function t(e){for(var t=e.getPixelData(),n=2,o=new Uint8Array(e.width*e.height*n),a=0,r=0;r<t.length;r++)o[a++]=parseInt(t[r],10),o[a++]=t[r]<0?0:1;return o}e.webGL||(e.webGL={}),e.webGL.shaders||(e.webGL.shaders={}),e.webGL.dataUtilities||(e.webGL.dataUtilities={});var n={};e.webGL.dataUtilities.int8={storedPixelDataToImageData:t},n.frag="precision mediump float;uniform sampler2D u_image;uniform float ww;uniform float wc;uniform float slope;uniform float intercept;uniform float minPixelValue;uniform int invert;varying vec2 v_texCoord;void main() {vec4 color = texture2D(u_image, v_texCoord);float intensity = color.r*256.;if (color.a == 0.0)intensity = -intensity;intensity = intensity * slope + intercept;float center0 = wc - 0.5;float width0 = max(ww, 1.0);intensity = (intensity - center0) / width0 + 0.5;intensity = clamp(intensity, 0.0, 1.0);gl_FragColor = vec4(intensity, intensity, intensity, 1.0);if (invert == 1)gl_FragColor.rgb = 1.0 - gl_FragColor.rgb;}",e.webGL.shaders.int8=n}(m),function(e){"use strict";function t(e){var t=e.minPixelValue,n=0,o=0,a=e.width*e.height*4,r=e.width*e.height*3,i=e.getPixelData(),s=new Uint8Array(r);if(t<0)for(;o<a;)s[n++]=i[o++]+-t,s[n++]=i[o++]+-t,s[n++]=i[o++]+-t,o+=1;else for(;o<a;)s[n++]=i[o++],s[n++]=i[o++],s[n++]=i[o++],o+=1;return s}e.webGL||(e.webGL={}),e.webGL.shaders||(e.webGL.shaders={}),e.webGL.dataUtilities||(e.webGL.dataUtilities={});var n={};e.webGL.dataUtilities.rgb={storedPixelDataToImageData:t},n.frag="precision mediump float;uniform sampler2D u_image;uniform float ww;uniform float wc;uniform float slope;uniform float intercept;uniform float minPixelValue;uniform int invert;varying vec2 v_texCoord;void main() {vec3 color = texture2D(u_image, v_texCoord).xyz;color = color * 256.0 * slope + intercept;float center0 = wc - 0.5 - minPixelValue;float width0 = max(ww, 1.0);color = (color - center0) / width0 + 0.5;gl_FragColor = vec4(color, 1);if (invert == 1)gl_FragColor.rgb = 1. - gl_FragColor.rgb;}",e.webGL.shaders.rgb=n}(m),function(e){"use strict";function t(e){for(var t=e.getPixelData(),n=2,o=new Uint8Array(e.width*e.height*n),a=0,r=0;r<t.length;r++){var i=t[r];o[a++]=parseInt(255&i,10),o[a++]=parseInt(i>>8,10)}return o}e.webGL||(e.webGL={}),e.webGL.shaders||(e.webGL.shaders={}),e.webGL.dataUtilities||(e.webGL.dataUtilities={});var n={};e.webGL.dataUtilities.uint16={storedPixelDataToImageData:t},n.frag="precision mediump float;uniform sampler2D u_image;uniform float ww;uniform float wc;uniform float slope;uniform float intercept;uniform int invert;varying vec2 v_texCoord;void main() {vec4 color = texture2D(u_image, v_texCoord);float intensity = color.r*256.0 + color.a*65536.0;intensity = intensity * slope + intercept;float center0 = wc - 0.5;float width0 = max(ww, 1.0);intensity = (intensity - center0) / width0 + 0.5;intensity = clamp(intensity, 0.0, 1.0);gl_FragColor = vec4(intensity, intensity, intensity, 1.0);if (invert == 1)gl_FragColor.rgb = 1.0 - gl_FragColor.rgb;}",e.webGL.shaders.uint16=n}(m),function(e){"use strict";function t(e){for(var t=e.getPixelData(),n=new Uint8Array(t.length),o=0;o<t.length;o++)n[o]=parseInt(t[o],10);return n}e.webGL||(e.webGL={}),e.webGL.shaders||(e.webGL.shaders={}),e.webGL.dataUtilities||(e.webGL.dataUtilities={});var n={};e.webGL.dataUtilities.uint8={storedPixelDataToImageData:t},n.frag="precision mediump float;uniform sampler2D u_image;uniform float ww;uniform float wc;uniform float slope;uniform float intercept;uniform int invert;varying vec2 v_texCoord;void main() {vec4 color = texture2D(u_image, v_texCoord);float intensity = color.r*256.0;intensity = intensity * slope + intercept;float center0 = wc - 0.5;float width0 = max(ww, 1.0);intensity = (intensity - center0) / width0 + 0.5;intensity = clamp(intensity, 0.0, 1.0);gl_FragColor = vec4(intensity, intensity, intensity, 1.0);if (invert == 1)gl_FragColor.rgb = 1.0 - gl_FragColor.rgb;}",e.webGL.shaders.uint8=n}(m),function(e){"use strict";function t(e){if(void 0===e)throw"setMaximumSizeBytes: parameter numBytes must not be undefined";if(void 0===e.toFixed)throw"setMaximumSizeBytes: parameter numBytes must be a number";d=e,n()}function n(){function t(e,t){return e.timeStamp>t.timeStamp?-1:e.timeStamp<t.timeStamp?1:0}if(!(f<=d)){for(c.sort(t);f>d;){var n=c[c.length-1];f-=n.sizeInBytes,delete u[n.imageId],c.pop(),o(e).trigger("CornerstoneWebGLTextureRemoved",{imageId:n.imageId})}var a=e.imageCache.getCacheInfo();console.log("CornerstoneWebGLTextureCacheFull"),o(e).trigger("CornerstoneWebGLTextureCacheFull",a)}}function a(e,t){var o=e.imageId;if(void 0===e)throw"putImageTexture: image must not be undefined";if(void 0===o)throw"putImageTexture: imageId must not be undefined";if(void 0===t)throw"putImageTexture: imageTexture must not be undefined";if(u.hasOwnProperty(o)===!0)throw"putImageTexture: imageId already in cache";var a={imageId:o,imageTexture:t,timeStamp:new Date,sizeInBytes:t.sizeInBytes};if(u[o]=a,c.push(a),void 0===t.sizeInBytes)throw"putImageTexture: imageTexture does not have sizeInBytes property or";if(void 0===t.sizeInBytes.toFixed)throw"putImageTexture: imageTexture.sizeInBytes is not a number";f+=a.sizeInBytes,n()}function r(e){if(void 0===e)throw"getImageTexture: imageId must not be undefined";var t=u[e];if(void 0!==t)return t.timeStamp=new Date,t.imageTexture}function i(e){if(void 0===e)throw"removeImageTexture: imageId must not be undefined";var t=u[e];if(void 0===t)throw"removeImageTexture: imageId must not be undefined";return c.splice(c.indexOf(t),1),f-=t.sizeInBytes,delete u[e],t.imageTexture}function s(){return{maximumSizeInBytes:d,cacheSizeInBytes:f,numberOfImagesCached:c.length}}function l(){for(;c.length>0;){var e=c.pop();delete u[e.imageId]}f=0}var u={},c=[],d=268435456,f=0;e.webGL.textureCache={putImageTexture:a,getImageTexture:r,removeImageTexture:i,setMaximumSizeBytes:t,getCacheInfo:s,purgeCache:l,cachedImages:c}}(m),function(e){"use strict";e.webGL||(e.webGL={}),e.webGL.vertexShader="attribute vec2 a_position;attribute vec2 a_texCoord;uniform vec2 u_resolution;varying vec2 v_texCoord;void main() {vec2 zeroToOne = a_position / u_resolution;vec2 zeroToTwo = zeroToOne * 2.0;vec2 clipSpace = zeroToTwo - 1.0;gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1);v_texCoord = a_texCoord;}"}(m);var h=function(e){"use strict";return void 0===e&&(e={}),e.Vector3=function(e,t,n){this.x=e||0,this.y=t||0,this.z=n||0},e.Vector3.prototype={constructor:e.Vector3,set:function(e,t,n){return this.x=e,this.y=t,this.z=n,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,t){return void 0!==t?(console.warn("DEPRECATED: Vector3's .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},sub:function(e,t){return void 0!==t?(console.warn("DEPRECATED: Vector3's .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply:function(e,t){return void 0!==t?(console.warn("DEPRECATED: Vector3's .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyAxisAngle:function(){var t;return function(n,o){return void 0===t&&(t=new e.Quaternion),this.applyQuaternion(t.setFromAxisAngle(n,o)),this}}(),applyMatrix3:function(e){var t=this.x,n=this.y,o=this.z,a=e.elements;return this.x=a[0]*t+a[3]*n+a[6]*o,this.y=a[1]*t+a[4]*n+a[7]*o,this.z=a[2]*t+a[5]*n+a[8]*o,this},applyMatrix4:function(e){var t=this.x,n=this.y,o=this.z,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*o+a[12],this.y=a[1]*t+a[5]*n+a[9]*o+a[13],this.z=a[2]*t+a[6]*n+a[10]*o+a[14],this},applyProjection:function(e){var t=this.x,n=this.y,o=this.z,a=e.elements,r=1/(a[3]*t+a[7]*n+a[11]*o+a[15]);return this.x=(a[0]*t+a[4]*n+a[8]*o+a[12])*r,this.y=(a[1]*t+a[5]*n+a[9]*o+a[13])*r,this.z=(a[2]*t+a[6]*n+a[10]*o+a[14])*r,this},applyQuaternion:function(e){var t=this.x,n=this.y,o=this.z,a=e.x,r=e.y,i=e.z,s=e.w,l=s*t+r*o-i*n,u=s*n+i*t-a*o,c=s*o+a*n-r*t,d=-a*t-r*n-i*o;return this.x=l*s+d*-a+u*-i-c*-r,this.y=u*s+d*-r+c*-a-l*-i,this.z=c*s+d*-i+l*-r-u*-a,this},transformDirection:function(e){var t=this.x,n=this.y,o=this.z,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*o,this.y=a[1]*t+a[5]*n+a[9]*o,this.z=a[2]*t+a[6]*n+a[10]*o,this.normalize(),this},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){if(0!==e){var t=1/e;this.x*=t,this.y*=t,this.z*=t}else this.x=0,this.y=0,this.z=0;return this},min:function(e){return this.x>e.x&&(this.x=e.x),this.y>e.y&&(this.y=e.y),this.z>e.z&&(this.z=e.z),this},max:function(e){return this.x<e.x&&(this.x=e.x),this.y<e.y&&(this.y=e.y),this.z<e.z&&(this.z=e.z),this},clamp:function(e,t){return this.x<e.x?this.x=e.x:this.x>t.x&&(this.x=t.x),this.y<e.y?this.y=e.y:this.y>t.y&&(this.y=t.y),this.z<e.z?this.z=e.z:this.z>t.z&&(this.z=t.z),this},clampScalar:function(){var t,n;return function(o,a){return void 0===t&&(t=new e.Vector3,n=new e.Vector3),t.set(o,o,o),n.set(a,a,a),this.clamp(t,n)}}(),floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.multiplyScalar(-1)},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(e){var t=this.length();return 0!==t&&e!==t&&this.multiplyScalar(e/t),this},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this},cross:function(e,t){if(void 0!==t)return console.warn("DEPRECATED: Vector3's .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t);var n=this.x,o=this.y,a=this.z;return this.x=o*e.z-a*e.y,this.y=a*e.x-n*e.z,this.z=n*e.y-o*e.x,this},crossVectors:function(e,t){var n=e.x,o=e.y,a=e.z,r=t.x,i=t.y,s=t.z;return this.x=o*s-a*i,this.y=a*r-n*s,this.z=n*i-o*r,this},projectOnVector:function(){var t,n;return function(o){return void 0===t&&(t=new e.Vector3),t.copy(o).normalize(),n=this.dot(t),this.copy(t).multiplyScalar(n)}}(),projectOnPlane:function(){var t;return function(n){return void 0===t&&(t=new e.Vector3),t.copy(this).projectOnVector(n),this.sub(t)}}(),reflect:function(){var t;return function(n){return void 0===t&&(t=new e.Vector3),this.sub(t.copy(n).multiplyScalar(2*this.dot(n)))}}(),angleTo:function(t){var n=this.dot(t)/(this.length()*t.length());return Math.acos(e.clamp(n,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y,o=this.z-e.z;return t*t+n*n+o*o},setEulerFromRotationMatrix:function(e,t){console.error("REMOVED: Vector3's setEulerFromRotationMatrix has been removed in favor of Euler.setFromRotationMatrix(), please update your code.")},setEulerFromQuaternion:function(e,t){console.error("REMOVED: Vector3's setEulerFromQuaternion: has been removed in favor of Euler.setFromQuaternion(), please update your code.")},getPositionFromMatrix:function(e){return console.warn("DEPRECATED: Vector3's .getPositionFromMatrix() has been renamed to .setFromMatrixPosition(). Please update your code."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return console.warn("DEPRECATED: Vector3's .getScaleFromMatrix() has been renamed to .setFromMatrixScale(). Please update your code."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return console.warn("DEPRECATED: Vector3's .getColumnFromMatrix() has been renamed to .setFromMatrixColumn(). Please update your code."),this.setFromMatrixColumn(e,t)},setFromMatrixPosition:function(e){return this.x=e.elements[12],this.y=e.elements[13],this.z=e.elements[14],this},setFromMatrixScale:function(e){var t=this.set(e.elements[0],e.elements[1],e.elements[2]).length(),n=this.set(e.elements[4],e.elements[5],e.elements[6]).length(),o=this.set(e.elements[8],e.elements[9],e.elements[10]).length();return this.x=t,this.y=n,this.z=o,this},setFromMatrixColumn:function(e,t){var n=4*e,o=t.elements;return this.x=o[n],this.y=o[n+1],this.z=o[n+2],this},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e){return this.x=e[0],this.y=e[1],this.z=e[2],this},toArray:function(){return[this.x,this.y,this.z]},clone:function(){return new e.Vector3(this.x,this.y,this.z)}},e}(h),h=function(e){"use strict";return void 0===e&&(e={}),e.Line3=function(t,n){this.start=void 0!==t?t:new e.Vector3,this.end=void 0!==n?n:new e.Vector3},e.Line3.prototype={constructor:e.Line3,set:function(e,t){return this.start.copy(e),this.end.copy(t),this},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},center:function(t){var n=t||new e.Vector3;return n.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){var n=t||new e.Vector3;return n.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,n){var o=n||new e.Vector3;return this.delta(o).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(){var t=new e.Vector3,n=new e.Vector3;return function(o,a){t.subVectors(o,this.start),n.subVectors(this.end,this.start);var r=n.dot(n),i=n.dot(t),s=i/r;return a&&(s=e.Math.clamp(s,0,1)),s}}(),closestPointToPoint:function(t,n,o){var a=this.closestPointToPointParameter(t,n),r=o||new e.Vector3;return this.delta(r).multiplyScalar(a).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)},clone:function(){return(new e.Line3).copy(this)},intersectLine:function(e){var t=this.end.clone().sub(this.start),n=e.end.clone().sub(e.start),o=e.start.clone().sub(this.start),a=t.clone().cross(n),r=o.clone().cross(n);if(0!==o.dot(t)){var i=r.dot(a)/a.lengthSq();if(!(i>1||isNaN(i))){var s=this.start.clone().add(t.clone().multiplyScalar(i)),l=s.clone().sub(e.start).lengthSq()+s.clone().sub(e.end).lengthSq();return l<=e.distanceSq()?s:void 0}}}},e}(h),h=function(e){"use strict";function t(e){return e*e}function n(e,n){return t(e.x-n.x)+t(e.y-n.y)}function o(e,t){var o=n(e.start,e.end);if(0===o)return n(t,e.start);var a=((t.x-e.start.x)*(e.end.x-e.start.x)+(t.y-e.start.y)*(e.end.y-e.start.y))/o;if(a<0)return n(t,e.start);if(a>1)return n(t,e.end);var r={x:e.start.x+a*(e.end.x-e.start.x),y:e.start.y+a*(e.end.y-e.start.y)};return n(t,r)}function a(e,t){return Math.sqrt(o(e,t))}function r(t,n){var o={},a=t.start.x,r=t.start.y,i=t.end.x,s=t.end.y,l=n.start.x,u=n.start.y,c=n.end.x,d=n.end.y,f,m,h,g,p,v,y,T,x,w,C,b;if(f=s-r,h=a-i,p=i*r-a*s,x=f*l+h*u+p,w=f*c+h*d+p,(0===x||0===w||e.sign(x)!==e.sign(w))&&(m=d-u,g=l-c,v=c*u-l*d,y=m*a+g*r+v,T=m*i+g*s+v,0===y||0===T||e.sign(y)!==e.sign(T))){C=f*g-m*h,b=h*v-g*p;var P=parseFloat(b/C);b=m*p-f*v;var I=parseFloat(b/C);return o.x=P,o.y=I,o}}return void 0===e&&(e={}),e.lineSegment={distanceToPoint:a,intersectLine:r},e}(h),h=function(e){"use strict";function t(e,t,n){return e<t?t:e>n?n:e}function n(e){var t=Math.PI/180;return e*t}function o(e){var t=180/Math.PI;return e*t}function a(e){return"number"==typeof e?e?e<0?-1:1:e===e?0:NaN:NaN}return void 0===e&&(e={}),e.clamp=t,e.degToRad=n,e.radToDeg=o,e.sign=a,e}(h),h=function(e){"use strict";return void 0===e&&(e={}),e.Matrix4=function e(t,n,o,a,r,i,s,l,u,c,d,f,m,h,g,p){this.elements=new Float32Array(16);var v=this.elements;v[0]=void 0!==t?t:1,v[4]=n||0,v[8]=o||0,v[12]=a||0,v[1]=r||0,v[5]=void 0!==i?i:1,v[9]=s||0,v[13]=l||0,v[2]=u||0,v[6]=c||0,v[10]=void 0!==d?d:1,v[14]=f||0,v[3]=m||0,v[7]=h||0,v[11]=g||0,v[15]=void 0!==p?p:1},e.Matrix4.prototype.makeRotationFromQuaternion=function(e){var t=this.elements,n=e.x,o=e.y,a=e.z,r=e.w,i=n+n,s=o+o,l=a+a,u=n*i,c=n*s,d=n*l,f=o*s,m=o*l,h=a*l,g=r*i,p=r*s,v=r*l;return t[0]=1-(f+h),t[4]=c-v,t[8]=d+p,t[1]=c+v,t[5]=1-(u+h),t[9]=m-g,t[2]=d-p,t[6]=m+g,t[10]=1-(u+f),t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},e.Matrix4.prototype.multiplyMatrices=function(e,t){var n=e.elements,o=t.elements,a=this.elements,r=n[0],i=n[4],s=n[8],l=n[12],u=n[1],c=n[5],d=n[9],f=n[13],m=n[2],h=n[6],g=n[10],p=n[14],v=n[3],y=n[7],T=n[11],x=n[15],w=o[0],C=o[4],b=o[8],P=o[12],I=o[1],M=o[5],S=o[9],D=o[13],k=o[2],E=o[6],A=o[10],R=o[14],L=o[3],B=o[7],O=o[11],F=o[15];return a[0]=r*w+i*I+s*k+l*L,a[4]=r*C+i*M+s*E+l*B,a[8]=r*b+i*S+s*A+l*O,a[12]=r*P+i*D+s*R+l*F,a[1]=u*w+c*I+d*k+f*L,a[5]=u*C+c*M+d*E+f*B,a[9]=u*b+c*S+d*A+f*O,a[13]=u*P+c*D+d*R+f*F,a[2]=m*w+h*I+g*k+p*L,a[6]=m*C+h*M+g*E+p*B,a[10]=m*b+h*S+g*A+p*O,a[14]=m*P+h*D+g*R+p*F,a[3]=v*w+y*I+T*k+x*L,a[7]=v*C+y*M+T*E+x*B,a[11]=v*b+y*S+T*A+x*O,a[15]=v*P+y*D+T*R+x*F,this},e.Matrix4.prototype.multiply=function(e,t){return void 0!==t?(console.warn("DEPRECATED: Matrix4's .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},e.Matrix4.prototype.getInverse=function(e,t){var n=this.elements,o=e.elements,a=o[0],r=o[4],i=o[8],s=o[12],l=o[1],u=o[5],c=o[9],d=o[13],f=o[2],m=o[6],h=o[10],g=o[14],p=o[3],v=o[7],y=o[11],T=o[15];n[0]=c*g*v-d*h*v+d*m*y-u*g*y-c*m*T+u*h*T,n[4]=s*h*v-i*g*v-s*m*y+r*g*y+i*m*T-r*h*T,n[8]=i*d*v-s*c*v+s*u*y-r*d*y-i*u*T+r*c*T,n[12]=s*c*m-i*d*m-s*u*h+r*d*h+i*u*g-r*c*g,n[1]=d*h*p-c*g*p-d*f*y+l*g*y+c*f*T-l*h*T,n[5]=i*g*p-s*h*p+s*f*y-a*g*y-i*f*T+a*h*T,n[9]=s*c*p-i*d*p-s*l*y+a*d*y+i*l*T-a*c*T,n[13]=i*d*f-s*c*f+s*l*h-a*d*h-i*l*g+a*c*g,n[2]=u*g*p-d*m*p+d*f*v-l*g*v-u*f*T+l*m*T,n[6]=s*m*p-r*g*p-s*f*v+a*g*v+r*f*T-a*m*T,n[10]=r*d*p-s*u*p+s*l*v-a*d*v-r*l*T+a*u*T,n[14]=s*u*f-r*d*f-s*l*m+a*d*m+r*l*g-a*u*g,n[3]=c*m*p-u*h*p-c*f*v+l*h*v+u*f*y-l*m*y,n[7]=r*h*p-i*m*p+i*f*v-a*h*v-r*f*y+a*m*y,n[11]=i*u*p-r*c*p-i*l*v+a*c*v+r*l*y-a*u*y,n[15]=r*c*f-i*u*f+i*l*m-a*c*m-r*l*h+a*u*h;var x=a*n[0]+l*n[4]+f*n[8]+p*n[12];if(0===x){var w="Matrix4.getInverse(): can't invert matrix, determinant is 0";if(t)throw new Error(w);return console.warn(w),this.identity(),this}return this.multiplyScalar(1/x),this},e.Matrix4.prototype.applyToVector3Array=function(){var t=new e.Vector3;return function(e,n,o){void 0===n&&(n=0),void 0===o&&(o=e.length);for(var a=0,r=n,i;a<o;a+=3,r+=3)t.x=e[r],t.y=e[r+1],t.z=e[r+2],t.applyMatrix4(this),e[r]=t.x,e[r+1]=t.y,e[r+2]=t.z;return e}},e.Matrix4.prototype.makeTranslation=function(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this},e.Matrix4.prototype.multiplyScalar=function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this},e.Matrix4.prototype.set=function(e,t,n,o,a,r,i,s,l,u,c,d,f,m,h,g){var p=this.elements;return p[0]=e,p[4]=t,p[8]=n,p[12]=o,p[1]=a,p[5]=r,p[9]=i,p[13]=s,p[2]=l,p[6]=u,p[10]=c,p[14]=d,p[3]=f,p[7]=m,p[11]=h,p[15]=g,this},e.Matrix4.prototype.makeScale=function(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this},e}(h),h=function(e){"use strict";return void 0===e&&(e={}),e.Plane=function(t,n){this.normal=void 0!==t?t:new e.Vector3(1,0,0),this.constant=void 0!==n?n:0},e.Plane.prototype={constructor:e.Plane,set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,n,o){return this.normal.set(e,t,n),this.constant=o,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(){var t=new e.Vector3,n=new e.Vector3;return function(e,o,a){var r=t.subVectors(a,o).cross(n.subVectors(e,o)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}}(),copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){return this.orthoPoint(e,t).sub(e).negate()},orthoPoint:function(t,n){var o=this.distanceToPoint(t),a=n||new e.Vector3;return a.copy(this.normal).multiplyScalar(o)},isIntersectionLine:function(e){var t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0},intersectLine:function(){var t=new e.Vector3;return function(n,o){var a=o||new e.Vector3,r=n.delta(t),i=this.normal.dot(r);if(0!==i){var s=-(n.start.dot(this.normal)+this.constant)/i;if(!(s<0||s>1))return a.copy(r).multiplyScalar(s).add(n.start)}else if(0===this.distanceToPoint(n.start))return a.copy(n.start)}}(),intersectPlane:function(t){var n=this.normal.clone().cross(t.normal),o=new e.Vector3,a={origin:o,direction:n};if(this.normal.clone().cross(t.normal).length<1e-10)return a.direction=new e.Vector3,a;var r=this.constant,i=t.constant,s=this.normal.clone().dot(t.normal),l=-(r-i*s)/(1-s*s),u=-(i-r*s)/(1-s*s);return a.origin=this.normal.clone().multiplyScalar(l).add(t.normal.clone().multiplyScalar(u)),a},coplanarPoint:function(t){var n=t||new e.Vector3;return n.copy(this.normal).multiplyScalar(-this.constant)},translate:function(e){return this.constant=this.constant-e.dot(this.normal),this},equals:function(e){return e.normal.equals(this.normal)&&e.constant==this.constant},clone:function(){return(new e.Plane).copy(this)}},e}(h),h=function(e){"use strict";function t(e){return{x:e.pageX,y:e.pageY}}function n(e,t){return{x:e.x-t.x,y:e.y-t.y}}function o(e){return{x:e.x,y:e.y}}function a(e,t){return Math.sqrt(r(e,t))}function r(e,t){var o=n(e,t);return o.x*o.x+o.y*o.y}function i(e,t){return!(e.x<t.left||e.x>t.left+t.width||e.y<t.top||e.y>t.top+t.height)}function s(t,n){var o=[],a;t.forEach(function(t,r){var i=e.point.distance(t,n);o.push(i),a=0===r?i:Math.min(i,a)});var r=o.indexOf(a);return t[r]}return void 0===e&&(e={}),e.point={subtract:n,copy:o,pageToPoint:t,distance:a,distanceSquared:r,insideRect:i,findClosestPoint:s},e}(h),h=function(e){"use strict";return void 0===e&&(e={}),e.Quaternion=function e(t,n,o,a){this.x=t||0,this.y=n||0,this.z=o||0,this.w=void 0!==a?a:1},e.Quaternion.prototype.setFromAxisAngle=function(e,t){var n=t/2,o=Math.sin(n);return this.x=e.x*o,this.y=e.y*o,this.z=e.z*o,this.w=Math.cos(n),this},e.Quaternion.prototype.multiplyQuaternions=function(e,t){var n=e.x,o=e.y,a=e.z,r=e.w,i=t.x,s=t.y,l=t.z,u=t.w;return this.x=n*u+r*i+o*l-a*s,this.y=o*u+r*s+a*i-n*l,this.z=a*u+r*l+n*s-o*i,this.w=r*u-n*i-o*s-a*l,this},e.Quaternion.prototype.setFromRotationMatrix=function(e){var t=e.elements,n=t[0],o=t[4],a=t[8],r=t[1],i=t[5],s=t[9],l=t[2],u=t[6],c=t[10],d=n+i+c,f;return d>0?(f=.5/Math.sqrt(d+1),this.w=.25/f,this.x=(u-s)*f,this.y=(a-l)*f,this.z=(r-o)*f):n>i&&n>c?(f=2*Math.sqrt(1+n-i-c),this.w=(u-s)/f,this.x=.25*f,this.y=(o+r)/f,this.z=(a+l)/f):i>c?(f=2*Math.sqrt(1+i-n-c),this.w=(a-l)/f,this.x=(o+r)/f,this.y=.25*f,this.z=(s+u)/f):(f=2*Math.sqrt(1+c-n-i),this.w=(r-o)/f,this.x=(a+l)/f,this.y=(s+u)/f,this.z=.25*f),this},e}(h),h=function(e){"use strict";function t(e){var t={start:{x:e.left,y:e.top},end:{x:e.left+e.width,y:e.top}},n={start:{x:e.left+e.width,y:e.top},end:{x:e.left+e.width,y:e.top+e.height}},o={start:{x:e.left+e.width,y:e.top+e.height},end:{x:e.left,y:e.top+e.height}},a={start:{x:e.left,y:e.top+e.height},end:{x:e.left,y:e.top}},r=[t,n,o,a];return r}function n(t,n,o){void 0===o&&(o=5);var a=e.lineSegment.distanceToPoint(n,t);return a<o}function o(n,o){var a=655535,r=t(n);return r.forEach(function(t){var n=e.lineSegment.distanceToPoint(t,o);n<a&&(a=n)}),a}function a(e){var t={topLeft:{x:e.left,y:e.top},bottomRight:{x:e.left+e.width,y:e.top+e.height}};return t}function r(e,t){var n,o,r=a(e),i=a(t);return n=e.width>=0?t.width>=0?!(r.bottomRight.x<=i.topLeft.x||i.bottomRight.x<=r.topLeft.x):!(r.bottomRight.x<=i.bottomRight.x||i.topLeft.x<=r.topLeft.x):t.width>=0?!(r.topLeft.x<=i.topLeft.x||i.bottomRight.x<=r.bottomRight.x):!(r.topLeft.x<=i.bottomRight.x||i.topLeft.x<=r.bottomRight.x),o=e.height>=0?t.height>=0?!(r.bottomRight.y<=i.topLeft.y||i.bottomRight.y<=r.topLeft.y):!(r.bottomRight.y<=i.bottomRight.y||i.topLeft.y<=r.topLeft.y):t.height>=0?!(r.topLeft.y<=i.topLeft.y||i.bottomRight.y<=r.bottomRight.y):!(r.topLeft.y<=i.bottomRight.y||i.top<=r.bottomRight.y),n&&o}function i(e,t){var n={topLeft:{},bottomRight:{}};if(r(e,t)){var o=a(e),i=a(t);return e.width>=0?t.width>=0?(n.topLeft.x=Math.max(o.topLeft.x,i.topLeft.x),n.bottomRight.x=Math.min(o.bottomRight.x,i.bottomRight.x)):(n.topLeft.x=Math.max(o.topLeft.x,i.bottomRight.x),n.bottomRight.x=Math.min(o.bottomRight.x,i.topLeft.x)):t.width>=0?(n.topLeft.x=Math.min(o.topLeft.x,i.bottomRight.x),n.bottomRight.x=Math.max(o.bottomRight.x,i.topLeft.x)):(n.topLeft.x=Math.min(o.topLeft.x,i.topLeft.x),n.bottomRight.x=Math.max(o.bottomRight.x,i.bottomRight.x)),e.height>=0?t.height>=0?(n.topLeft.y=Math.max(o.topLeft.y,i.topLeft.y),n.bottomRight.y=Math.min(o.bottomRight.y,i.bottomRight.y)):(n.topLeft.y=Math.max(o.topLeft.y,i.bottomRight.y),n.bottomRight.y=Math.min(o.bottomRight.y,i.topLeft.y)):t.height>=0?(n.topLeft.y=Math.min(o.topLeft.y,i.bottomRight.y),
n.bottomRight.y=Math.max(o.bottomRight.y,i.topLeft.y)):(n.topLeft.y=Math.min(o.topLeft.y,i.topLeft.y),n.bottomRight.y=Math.max(o.bottomRight.y,i.bottomRight.y)),n}}return void 0===e&&(e={}),e.rect={distanceToPoint:o,getIntersectionRect:i},e}(h);"undefined"==typeof m&&(m={}),"undefined"==typeof h&&(h={}),"undefined"==typeof g&&(g={}),"undefined"==typeof p&&(p={referenceLines:{},orientation:{}}),function(e,t,n){"use strict";function o(n){if(!("mousewheel"===n.originalEvent.type&&0===n.originalEvent.wheelDeltaY||"DOMMouseScroll"===n.originalEvent.type&&1===n.originalEvent.axis)){n.preventDefault();var o=n.currentTarget,a,r;void 0!==n.pageX&&void 0!==n.pageY?(a=n.pageX,r=n.pageY):n.originalEvent&&void 0!==n.originalEvent.pageX&&void 0!==n.originalEvent.pageY?(a=n.originalEvent.pageX,r=n.originalEvent.pageY):(a=n.x,r=n.y);var i=t.pageToPixel(o,a,r);n=window.event||n;var s;s=n.originalEvent&&n.originalEvent.wheelDelta?-n.originalEvent.wheelDelta:n.originalEvent&&n.originalEvent.deltaY?-n.originalEvent.deltaY:n.originalEvent&&n.originalEvent.detail?-n.originalEvent.detail:n.wheelDelta;var l=s<0?-1:1,u={element:o,viewport:t.getViewport(o),image:t.getEnabledElement(o).image,direction:l,pageX:a,pageY:r,imageX:i.x,imageY:i.y};e(o).trigger("CornerstoneToolsMouseWheel",u)}}function a(t){r(t),e(t).on(i,o)}function r(t){e(t).unbind(i,o)}var i="mousewheel DOMMouseScroll";n.mouseWheelInput={enable:a,disable:r}}(o,m,p),function(e,t,n,o){"use strict";function a(){d=!1}function r(t){e(t.element).trigger("CornerstoneToolsMouseDownActivate",t)}function i(a){var r=a.currentTarget,i="CornerstoneToolsMouseDoubleClick",s={page:n.point.pageToPoint(a),image:t.pageToPixel(r,a.pageX,a.pageY),client:{x:a.clientX,y:a.clientY}};s.canvas=t.pixelToCanvas(r,s.image);var l=o.copyPoints(s),u={event:a,which:a.which,viewport:t.getViewport(r),image:t.getEnabledElement(r).image,element:r,startPoints:s,lastPoints:l,currentPoints:s,deltaPoints:{x:0,y:0},type:i},c=e.Event(i,u);e(u.element).trigger(c,u)}function s(i){function s(a){var r="CornerstoneToolsMouseDrag",i={page:n.point.pageToPoint(a),image:t.pageToPixel(c,a.pageX,a.pageY),client:{x:a.clientX,y:a.clientY}};i.canvas=t.pixelToCanvas(c,i.image);var s={page:n.point.subtract(i.page,p.page),image:n.point.subtract(i.image,p.image),client:n.point.subtract(i.client,p.client),canvas:n.point.subtract(i.canvas,p.canvas)},l={which:T,viewport:t.getViewport(c),image:t.getEnabledElement(c).image,element:c,startPoints:g,lastPoints:p,currentPoints:i,deltaPoints:s,type:r};return e(l.element).trigger(r,l),p=o.copyPoints(i),o.pauseEvent(a)}function u(o){clearTimeout(f);var a="CornerstoneToolsMouseUp";d&&(a="CornerstoneToolsMouseClick");var r={page:n.point.pageToPoint(o),image:t.pageToPixel(c,o.pageX,o.pageY),client:{x:o.clientX,y:o.clientY}};r.canvas=t.pixelToCanvas(c,r.image);var i={page:n.point.subtract(r.page,p.page),image:n.point.subtract(r.image,p.image),client:n.point.subtract(r.client,p.client),canvas:n.point.subtract(r.canvas,p.canvas)},m={event:o,which:T,viewport:t.getViewport(c),image:t.getEnabledElement(c).image,element:c,startPoints:g,lastPoints:p,currentPoints:r,deltaPoints:i,type:a},h=e.Event(a,m);e(m.element).trigger(h,m),e(document).off("mousemove",s),e(document).off("mouseup",u),e(m.element).on("mousemove",l),d=!0}f=setTimeout(a,m);var c=i.currentTarget,h="CornerstoneToolsMouseDown";e(c).off("mousemove",l);var g={page:n.point.pageToPoint(i),image:t.pageToPixel(c,i.pageX,i.pageY),client:{x:i.clientX,y:i.clientY}};g.canvas=t.pixelToCanvas(c,g.image);var p=o.copyPoints(g),v={event:i,which:i.which,viewport:t.getViewport(c),image:t.getEnabledElement(c).image,element:c,startPoints:g,lastPoints:p,currentPoints:g,deltaPoints:{x:0,y:0},type:h},y=e.Event(h,v);if(e(v.element).trigger(y,v),y.isImmediatePropagationStopped()===!1&&r(v)===!0)return o.pauseEvent(i);var T=i.which;return e(document).on("mousemove",s),e(document).on("mouseup",u),o.pauseEvent(i)}function l(a){var r=a.currentTarget,i="CornerstoneToolsMouseMove",s={page:n.point.pageToPoint(a),image:t.pageToPixel(r,a.pageX,a.pageY),client:{x:a.clientX,y:a.clientY}};s.canvas=t.pixelToCanvas(r,s.image);var l=o.copyPoints(s),u=a.which,c={page:n.point.pageToPoint(a),image:t.pageToPixel(r,a.pageX,a.pageY),client:{x:a.clientX,y:a.clientY}};c.canvas=t.pixelToCanvas(r,c.image);var d={page:n.point.subtract(c.page,l.page),image:n.point.subtract(c.image,l.image),client:n.point.subtract(c.client,l.client),canvas:n.point.subtract(c.canvas,l.canvas)},f={which:u,viewport:t.getViewport(r),image:t.getEnabledElement(r).image,element:r,startPoints:s,lastPoints:l,currentPoints:c,deltaPoints:d,type:i};e(r).trigger(i,f),l=o.copyPoints(c)}function u(t){e(t).off("mousedown",s),e(t).off("mousemove",l),e(t).off("dblclick",i)}function c(t){u(t),e(t).on("mousedown",s),e(t).on("mousemove",l),e(t).on("dblclick",i)}var d=!0,f,m=200;o.mouseInput={enable:c,disable:u}}(o,m,h,p),function(e,t,n,o){"use strict";function a(a){var r=a.currentTarget||a.srcEvent.currentTarget,i,C;switch(a.preventDefault(),(a.pointers&&a.pointers.length>1||a.originalEvent&&a.originalEvent.touches&&a.originalEvent.touches.length>1)&&(v=!1,clearTimeout(p)),a.type){case"tap":v=!1,clearTimeout(p),c={page:n.point.pageToPoint(a.pointers[0]),image:t.pageToPixel(r,a.pointers[0].pageX,a.pointers[0].pageY),client:{x:a.pointers[0].clientX,y:a.pointers[0].clientY}},c.canvas=t.pixelToCanvas(r,c.image),C="CornerstoneToolsTap",m={event:a,viewport:t.getViewport(r),image:t.getEnabledElement(r).image,element:r,currentPoints:c,type:C,isTouchEvent:!0},i=e.Event(C,m),e(r).trigger(i,m);break;case"doubletap":v=!1,clearTimeout(p),c={page:n.point.pageToPoint(a.pointers[0]),image:t.pageToPixel(r,a.pointers[0].pageX,a.pointers[0].pageY),client:{x:a.pointers[0].clientX,y:a.pointers[0].clientY}},c.canvas=t.pixelToCanvas(r,c.image),C="CornerstoneToolsDoubleTap",m={event:a,viewport:t.getViewport(r),image:t.getEnabledElement(r).image,element:r,currentPoints:c,type:C,isTouchEvent:!0},i=e.Event(C,m),e(r).trigger(i,m);break;case"pinchstart":v=!1,clearTimeout(p),s=1;break;case"pinchmove":if(v=!1,clearTimeout(p),x===!0){s=a.scale,x=!1;break}var b=(a.scale-s)/s;u={page:a.center,image:t.pageToPixel(r,a.center.x,a.center.y)},u.canvas=t.pixelToCanvas(r,u.image),C="CornerstoneToolsTouchPinch",m={event:a,startPoints:u,viewport:t.getViewport(r),image:t.getEnabledElement(r).image,element:r,direction:a.scale<1?1:-1,scaleChange:b,type:C,isTouchEvent:!0},i=e.Event(C,m),e(r).trigger(i,m),s=a.scale;break;case"touchstart":s=1,clearTimeout(p),clearTimeout(h),h=setTimeout(function(){u={page:n.point.pageToPoint(a.originalEvent.touches[0]),image:t.pageToPixel(r,a.originalEvent.touches[0].pageX,a.originalEvent.touches[0].pageY),client:{x:a.originalEvent.touches[0].clientX,y:a.originalEvent.touches[0].clientY}},u.canvas=t.pixelToCanvas(r,u.image),C="CornerstoneToolsTouchStart",a.originalEvent.touches.length>1&&(C="CornerstoneToolsMultiTouchStart"),m={event:a,viewport:t.getViewport(r),image:t.getEnabledElement(r).image,element:r,startPoints:u,currentPoints:u,type:C,isTouchEvent:!0},i=e.Event(C,m),e(r).trigger(i,m),i.isImmediatePropagationStopped()===!1&&(C="CornerstoneToolsTouchStartActive",a.originalEvent.touches.length>1&&(C="CornerstoneToolsMultiTouchStartActive"),m.type=C,e(r).trigger(C,m)),d=o.copyPoints(u)},50),v=!0,T=0,p=setTimeout(function(){v&&(c={page:n.point.pageToPoint(a.originalEvent.touches[0]),image:t.pageToPixel(r,a.originalEvent.touches[0].pageX,a.originalEvent.touches[0].pageY),client:{x:a.originalEvent.touches[0].clientX,y:a.originalEvent.touches[0].clientY}},c.canvas=t.pixelToCanvas(r,u.image),C="CornerstoneToolsTouchPress",m={event:a,viewport:t.getViewport(r),image:t.getEnabledElement(r).image,element:r,currentPoints:c,type:C,isTouchEvent:!0},i=e.Event(C,m),e(r).trigger(i,m))},g);break;case"touchend":s=1,v=!1,clearTimeout(p),setTimeout(function(){u={page:n.point.pageToPoint(a.originalEvent.changedTouches[0]),image:t.pageToPixel(r,a.originalEvent.changedTouches[0].pageX,a.originalEvent.changedTouches[0].pageY),client:{x:a.originalEvent.changedTouches[0].clientX,y:a.originalEvent.changedTouches[0].clientY}},u.canvas=t.pixelToCanvas(r,u.image),C="CornerstoneToolsTouchEnd",m={event:a,viewport:t.getViewport(r),image:t.getEnabledElement(r).image,element:r,startPoints:u,currentPoints:u,type:C,isTouchEvent:!0},i=e.Event(C,m),e(r).trigger(i,m)},50);break;case"panmove":var P={x:a.deltaX-w.x,y:a.deltaY-w.y};w={x:a.deltaX,y:a.deltaY},c={page:{x:d.page.x+P.x,y:d.page.y+P.y},image:t.pageToPixel(r,d.page.x+P.x,d.page.y+P.y),client:{x:d.client.x+P.x,y:d.client.y+P.y}},c.canvas=t.pixelToCanvas(r,c.image),f={page:n.point.subtract(c.page,d.page),image:n.point.subtract(c.image,d.image),client:n.point.subtract(c.client,d.client),canvas:n.point.subtract(c.canvas,d.canvas)},T+=Math.sqrt(f.page.x*f.page.x+f.page.y*f.page.y),T>y&&(v=!1,clearTimeout(p)),C="CornerstoneToolsTouchDrag",a.pointers.length>1&&(C="CornerstoneToolsMultiTouchDrag"),m={viewport:t.getViewport(r),image:t.getEnabledElement(r).image,element:r,startPoints:u,lastPoints:d,currentPoints:c,deltaPoints:f,numPointers:a.pointers.length,type:C,isTouchEvent:!0},i=e.Event(C,m),e(r).trigger(i,m),d=o.copyPoints(c);break;case"panstart":w={x:a.deltaX,y:a.deltaY},c={page:n.point.pageToPoint(a.pointers[0]),image:t.pageToPixel(r,a.pointers[0].pageX,a.pointers[0].pageY),client:{x:a.pointers[0].clientX,y:a.pointers[0].clientY}},c.canvas=t.pixelToCanvas(r,c.image),d=o.copyPoints(c);break;case"panend":if(v=!1,clearTimeout(p),!d)return!1;c={page:n.point.pageToPoint(a.pointers[0]),image:t.pageToPixel(r,a.pointers[0].pageX,a.pointers[0].pageY),client:{x:a.pointers[0].clientX,y:a.pointers[0].clientY}},c.canvas=t.pixelToCanvas(r,c.image),f={page:n.point.subtract(c.page,d.page),image:n.point.subtract(c.image,d.image),client:n.point.subtract(c.client,d.client),canvas:n.point.subtract(c.canvas,d.canvas)},C="CornerstoneToolsDragEnd",m={event:a.srcEvent,viewport:t.getViewport(r),image:t.getEnabledElement(r).image,element:r,startPoints:u,lastPoints:d,currentPoints:c,deltaPoints:f,type:C,isTouchEvent:!0},i=e.Event(C,m),e(r).trigger(i,m);var I=a.pointers.length-a.changedPointers.length;return 2===I&&(x=!0),o.pauseEvent(a);case"rotatemove":v=!1,clearTimeout(p);var M=a.rotation-l;l=a.rotation,C="CornerstoneToolsTouchRotate",m={event:a.srcEvent,viewport:t.getViewport(r),image:t.getEnabledElement(r).image,element:r,rotation:M,type:C},i=e.Event(C,m),e(r).trigger(i,m)}return!1}function r(t){i(t);var n={inputClass:Hammer.SUPPORT_POINTER_EVENTS?Hammer.PointerEventInput:Hammer.TouchInput},r=new Hammer.Manager(t,n),s={pointers:0,direction:Hammer.DIRECTION_ALL,threshold:0},l=new Hammer.Pan(s),u=new Hammer.Pinch({threshold:0}),c=new Hammer.Rotate({threshold:0});u.recognizeWith(l),u.recognizeWith(c),c.recognizeWith(l);var d=new Hammer.Tap({event:"doubletap",taps:2,interval:1500,threshold:50,posThreshold:50});d.recognizeWith(l),r.add([d,l,c,u]),r.on("tap doubletap panstart panmove panend pinchstart pinchmove rotatemove",a),o.preventGhostClick.enable(t),e(t).on("touchstart touchend",a),e(t).data("hammer",r)}function i(t){o.preventGhostClick.disable(t),e(t).off("touchstart touchend",a);var n=e(t).data("hammer");n&&n.off("tap doubletap panstart panmove panend pinchmove rotatemove",a)}var s=1,l=0,u,c,d,f,m,h,g=700,p,v=!1,y=5,T,x=!1,w;o.touchInput={enable:r,disable:i}}(o,m,h,p),function(e,t,n){"use strict";function o(t){var n={},o={activate:function(n,o,a){e(n).off("CornerstoneToolsMouseDownActivate",t);var r={mouseButtonMask:o,options:a};e(n).on("CornerstoneToolsMouseDownActivate",r,t)},disable:function(n){e(n).off("CornerstoneToolsMouseDownActivate",t)},enable:function(n){e(n).off("CornerstoneToolsMouseDownActivate",t)},deactivate:function(n){e(n).off("CornerstoneToolsMouseDownActivate",t)},getConfiguration:function(){return n},setConfiguration:function(e){n=e}};return o}n.simpleMouseButtonTool=o}(o,m,p),function(e,t,n,o){"use strict";function a(n){function a(a){var l=a.element,u=n.createNewMeasurement(a);if(u){var c={mouseButtonMask:a.which};o.addToolState(a.element,n.toolType,u),e(l).off("CornerstoneToolsMouseMove",n.mouseMoveCallback||i),e(l).off("CornerstoneToolsMouseDown",n.mouseDownCallback||s),e(l).off("CornerstoneToolsMouseDownActivate",n.mouseDownActivateCallback||r),n.mouseDoubleClickCallback&&e(l).off("CornerstoneToolsMouseDoubleClick",n.mouseDoubleClickCallback),t.updateImage(l);var d;d=1===Object.keys(u.handles).length?o.moveHandle:o.moveNewHandle;var f;f=!(!n.options||void 0===n.options.preventHandleOutsideImage)&&n.options.preventHandleOutsideImage,d(a,n.toolType,u,u.handles.end,function(){u.active=!1,u.invalidated=!0,o.anyHandlesOutsideImage(a,u.handles)&&o.removeToolState(l,n.toolType,u),e(l).on("CornerstoneToolsMouseMove",c,n.mouseMoveCallback||i),e(l).on("CornerstoneToolsMouseDown",c,n.mouseDownCallback||s),e(l).on("CornerstoneToolsMouseDownActivate",c,n.mouseDownActivateCallback||r),n.mouseDoubleClickCallback&&e(l).on("CornerstoneToolsMouseDoubleClick",c,n.mouseDoubleClickCallback),t.updateImage(l)},f)}}function r(e,t){if(o.isMouseButtonEnabled(t.which,e.data.mouseButtonMask))return n.addNewMeasurement?n.addNewMeasurement(t):a(t),!1}function i(e,a){if(o.toolCoordinates.setCoords(a),0===a.which){var r=o.getToolState(a.element,n.toolType);if(r){for(var i=!1,s=0;s<r.data.length;s++){var l=a.currentPoints.canvas,u=r.data[s];o.handleActivator(a.element,u.handles,l)===!0&&(i=!0),(n.pointNearTool(a.element,u,l)&&!u.active||!n.pointNearTool(a.element,u,l)&&u.active)&&(u.active=!u.active,i=!0)}i===!0&&t.updateImage(a.element)}}}function s(a,r){function s(){l.invalidated=!0,o.anyHandlesOutsideImage(r,l.handles)&&o.removeToolState(u,n.toolType,l),t.updateImage(u),e(u).on("CornerstoneToolsMouseMove",r,n.mouseMoveCallback||i)}var l,u=r.element;if(o.isMouseButtonEnabled(r.which,a.data.mouseButtonMask)){var c=r.startPoints.canvas,d=o.getToolState(a.currentTarget,n.toolType);if(d){var f,m;for(m=!(!n.options||void 0===n.options.preventHandleOutsideImage)&&n.options.preventHandleOutsideImage,f=0;f<d.data.length;f++){l=d.data[f];var h=6,g=o.getHandleNearImagePoint(u,l.handles,c,h);if(g)return e(u).off("CornerstoneToolsMouseMove",n.mouseMoveCallback||i),l.active=!0,o.moveHandle(r,n.toolType,l,g,s,m),a.stopImmediatePropagation(),!1}if(n.pointNearTool){var p=n.options||{deleteIfHandleOutsideImage:!0,preventHandleOutsideImage:!1};for(f=0;f<d.data.length;f++)if(l=d.data[f],l.active=!1,n.pointNearTool(u,l,c))return l.active=!0,e(u).off("CornerstoneToolsMouseMove",n.mouseMoveCallback||i),o.moveAllHandles(a,l,d,n.toolType,p,s),a.stopImmediatePropagation(),!1}}}}function l(o){e(o).off("CornerstoneImageRendered",n.onImageRendered),e(o).off("CornerstoneToolsMouseMove",n.mouseMoveCallback||i),e(o).off("CornerstoneToolsMouseDown",n.mouseDownCallback||s),e(o).off("CornerstoneToolsMouseDownActivate",n.mouseDownActivateCallback||r),n.mouseDoubleClickCallback&&e(o).off("CornerstoneToolsMouseDoubleClick",n.mouseDoubleClickCallback),t.updateImage(o)}function u(o){e(o).off("CornerstoneImageRendered",n.onImageRendered),e(o).off("CornerstoneToolsMouseMove",n.mouseMoveCallback||i),e(o).off("CornerstoneToolsMouseDown",n.mouseDownCallback||s),e(o).off("CornerstoneToolsMouseDownActivate",n.mouseDownActivateCallback||r),n.mouseDoubleClickCallback&&e(o).off("CornerstoneToolsMouseDoubleClick",n.mouseDoubleClickCallback),e(o).on("CornerstoneImageRendered",n.onImageRendered),t.updateImage(o)}function c(o,a){var l={mouseButtonMask:a};e(o).off("CornerstoneImageRendered",n.onImageRendered),e(o).off("CornerstoneToolsMouseMove",n.mouseMoveCallback||i),e(o).off("CornerstoneToolsMouseDown",n.mouseDownCallback||s),e(o).off("CornerstoneToolsMouseDownActivate",n.mouseDownActivateCallback||r),e(o).on("CornerstoneImageRendered",n.onImageRendered),e(o).on("CornerstoneToolsMouseMove",l,n.mouseMoveCallback||i),e(o).on("CornerstoneToolsMouseDown",l,n.mouseDownCallback||s),e(o).on("CornerstoneToolsMouseDownActivate",l,n.mouseDownActivateCallback||r),n.mouseDoubleClickCallback&&(e(o).off("CornerstoneToolsMouseDoubleClick",n.mouseDoubleClickCallback),e(o).on("CornerstoneToolsMouseDoubleClick",l,n.mouseDoubleClickCallback)),t.updateImage(o)}function d(o,a){var l={mouseButtonMask:a},u="CornerstoneToolsToolDeactivated",c={mouseButtonMask:a,toolType:n.toolType,type:u},d=e.Event(u,c);e(o).trigger(d,c),e(o).off("CornerstoneImageRendered",n.onImageRendered),e(o).off("CornerstoneToolsMouseMove",n.mouseMoveCallback||i),e(o).off("CornerstoneToolsMouseDown",n.mouseDownCallback||s),e(o).off("CornerstoneToolsMouseDownActivate",n.mouseDownActivateCallback||r),e(o).on("CornerstoneImageRendered",n.onImageRendered),e(o).on("CornerstoneToolsMouseMove",l,n.mouseMoveCallback||i),e(o).on("CornerstoneToolsMouseDown",l,n.mouseDownCallback||s),n.mouseDoubleClickCallback&&(e(o).off("CornerstoneToolsMouseDoubleClick",n.mouseDoubleClickCallback),e(o).on("CornerstoneToolsMouseDoubleClick",l,n.mouseDoubleClickCallback)),t.updateImage(o)}function f(){return h}function m(e){h=e}var h={},g={enable:u,disable:l,activate:c,deactivate:d,getConfiguration:f,setConfiguration:m,mouseDownCallback:s,mouseMoveCallback:i,mouseDownActivateCallback:r};return n.pointNearTool&&(g.pointNearTool=n.pointNearTool),n.mouseDoubleClickCallback&&(g.mouseDoubleClickCallback=n.mouseDoubleClickCallback),n.addNewMeasurement&&(g.addNewMeasurement=n.addNewMeasurement),g}o.mouseButtonTool=a}(o,m,h,p),function(e,t,n,o){"use strict";function a(n,a){function r(t){var r=n.createNewMeasurement(t);r&&(o.addToolState(t.element,n.toolType,r),e(t.element).off("CornerstoneToolsMouseMove",s),o.moveHandle(t,n.toolType,r,r.handles.end,function(){r.active=!1,o.anyHandlesOutsideImage(t,r.handles)&&o.removeToolState(t.element,n.toolType,r),e(t.element).on("CornerstoneToolsMouseMove",s)},a))}function i(e,t){if(o.isMouseButtonEnabled(t.which,e.data.mouseButtonMask))return r(t),!1}function s(e,a){if(o.toolCoordinates.setCoords(a),0===a.which){var r=o.getToolState(a.element,n.toolType);if(void 0!==r){for(var i=!1,s=a.currentPoints.canvas,l=0;l<r.data.length;l++){var u=r.data[l];o.handleActivator(a.element,u.handles,s)===!0&&(i=!0),(n.pointInsideRect(a.element,u,s)&&!u.active||!n.pointInsideRect(a.element,u,s)&&u.active)&&(u.active=!u.active,i=!0)}i===!0&&t.updateImage(a.element)}}}function l(r,i){function l(){u.active=!1,o.anyHandlesOutsideImage(i,u.handles)&&o.removeToolState(i.element,n.toolType,u),t.updateImage(i.element),e(i.element).on("CornerstoneToolsMouseMove",s)}var u;if(o.isMouseButtonEnabled(i.which,r.data.mouseButtonMask)){var c=i.startPoints.canvas,d=o.getToolState(r.currentTarget,n.toolType),f,m=25;if(void 0!==d)for(f=0;f<d.data.length;f++){u=d.data[f];var h=o.getHandleNearImagePoint(i.element,u.handles,c,m);if(void 0!==h)return e(i.element).off("CornerstoneToolsMouseMove",s),u.active=!0,o.moveHandle(i,n.toolType,u,h,l,a),r.stopImmediatePropagation(),!1}var g={deleteIfHandleOutsideImage:!0,preventHandleOutsideImage:a};if(void 0!==d&&void 0!==n.pointInsideRect)for(f=0;f<d.data.length;f++)if(u=d.data[f],n.pointInsideRect(i.element,u,c))return e(i.element).off("CornerstoneToolsMouseMove",s),o.moveAllHandles(r,u,d,n.toolType,g,l),e(i.element).on("CornerstoneToolsMouseMove",s),r.stopImmediatePropagation(),!1}}function u(o){e(o).off("CornerstoneImageRendered",n.onImageRendered),e(o).off("CornerstoneToolsMouseMove",s),e(o).off("CornerstoneToolsMouseDown",l),e(o).off("CornerstoneToolsMouseDownActivate",i),t.updateImage(o)}function c(o){e(o).off("CornerstoneImageRendered",n.onImageRendered),e(o).off("CornerstoneToolsMouseMove",s),e(o).off("CornerstoneToolsMouseDown",l),e(o).off("CornerstoneToolsMouseDownActivate",i),e(o).on("CornerstoneImageRendered",n.onImageRendered),t.updateImage(o)}function d(o,a){var r={mouseButtonMask:a};e(o).off("CornerstoneImageRendered",n.onImageRendered),e(o).off("CornerstoneToolsMouseMove",s),e(o).off("CornerstoneToolsMouseDown",l),e(o).off("CornerstoneToolsMouseDownActivate",i),e(o).on("CornerstoneImageRendered",n.onImageRendered),e(o).on("CornerstoneToolsMouseMove",r,s),e(o).on("CornerstoneToolsMouseDown",r,l),e(o).on("CornerstoneToolsMouseDownActivate",r,i),t.updateImage(o)}function f(o,a){var r={mouseButtonMask:a};e(o).off("CornerstoneImageRendered",n.onImageRendered),e(o).off("CornerstoneToolsMouseMove",s),e(o).off("CornerstoneToolsMouseDown",l),e(o).off("CornerstoneToolsMouseDownActivate",i),e(o).on("CornerstoneImageRendered",n.onImageRendered),e(o).on("CornerstoneToolsMouseMove",r,s),e(o).on("CornerstoneToolsMouseDown",r,l),t.updateImage(o)}var m={enable:c,disable:u,activate:d,deactivate:f};return m}o.mouseButtonRectangleTool=a}(o,m,h,p),function(e,t,n){"use strict";function o(t){var n={activate:function(n){e(n).off("CornerstoneToolsMouseWheel",t);var o={};e(n).on("CornerstoneToolsMouseWheel",o,t)},disable:function(n){e(n).off("CornerstoneToolsMouseWheel",t)},enable:function(n){e(n).off("CornerstoneToolsMouseWheel",t)},deactivate:function(n){e(n).off("CornerstoneToolsMouseWheel",t)}};return n}n.mouseWheelTool=o}(o,m,p),function(e,t,n){"use strict";function o(t,n){var o="CornerstoneToolsTouchDrag";n&&n.fireOnTouchStart===!0&&(o+=" CornerstoneToolsTouchStart");var a={activate:function(a){e(a).off(o,t),n&&n.eventData?e(a).on(o,n.eventData,t):e(a).on(o,t),n&&n.activateCallback&&n.activateCallback(a)},disable:function(a){e(a).off(o,t),n&&n.disableCallback&&n.disableCallback(a)},enable:function(a){e(a).off(o,t),n&&n.enableCallback&&n.enableCallback(a)},deactivate:function(a){e(a).off(o,t),n&&n.deactivateCallback&&n.deactivateCallback(a)}};return a}n.touchDragTool=o}(o,m,p),function(e,t,n){"use strict";function o(t){var n={activate:function(n){e(n).off("CornerstoneToolsTouchPinch",t);var o={};e(n).on("CornerstoneToolsTouchPinch",o,t)},disable:function(n){e(n).off("CornerstoneToolsTouchPinch",t)},enable:function(n){e(n).off("CornerstoneToolsTouchPinch",t)},deactivate:function(n){e(n).off("CornerstoneToolsTouchPinch",t)}};return n}n.touchPinchTool=o}(o,m,p),function(e,t,n,o){"use strict";function a(e){Object.keys(e).forEach(function(t){var n=e[t];n.active=!1})}function r(e){if(e)for(var t=0;t<e.data.length;t++){var n=e.data[t];n.active=!1,n.handles&&a(n.handles)}}function i(n){function a(a){var r=a.element,u=n.createNewMeasurement(a);if(u){if(o.addToolState(r,n.toolType,u),1===Object.keys(u.handles).length&&"CornerstoneToolsTap"===a.type)return u.active=!1,u.handles.end.active=!1,u.handles.end.highlight=!1,u.invalidated=!0,o.anyHandlesOutsideImage(a,u.handles)&&o.removeToolState(r,n.toolType,u),void t.updateImage(r);e(r).off("CornerstoneToolsTouchStartActive",n.touchDownActivateCallback||i),e(r).off("CornerstoneToolsTap",n.tapCallback||s),e(r).off("CornerstoneToolsTouchStart",n.touchStartCallback||l),t.updateImage(r),o.moveNewHandleTouch(a,n.toolType,u,u.handles.end,function(){u.active=!1,u.invalidated=!0,o.anyHandlesOutsideImage(a,u.handles)&&o.removeToolState(r,n.toolType,u),e(r).on("CornerstoneToolsTouchStartActive",n.touchDownActivateCallback||i),e(r).on("CornerstoneToolsTap",n.tapCallback||s),e(r).on("CornerstoneToolsTouchStart",n.touchStartCallback||l),t.updateImage(r)})}}function i(e,t){return n.addNewMeasurement?n.addNewMeasurement(t):a(t),!1}function s(a,u){function c(){r(m),o.anyHandlesOutsideImage(u,h.handles)&&o.removeToolState(d,n.toolType,h),t.updateImage(d),e(d).on("CornerstoneToolsTouchStart",n.touchStartCallback||l),e(d).on("CornerstoneToolsTap",n.tapCallback||s)}var d=u.element,f=u.currentPoints.canvas,m=o.getToolState(a.currentTarget,n.toolType),h,g;if(r(m),m)for(g=0;g<m.data.length;g++){h=m.data[g];var p=25,v=o.getHandleNearImagePoint(d,h.handles,f,p);if(v)return e(d).off("CornerstoneToolsTouchStart",n.touchStartCallback||l),e(d).off("CornerstoneToolsTap",n.tapCallback||s),h.active=!0,v.active=!0,t.updateImage(d),o.touchMoveHandle(a,n.toolType,h,v,c),a.stopImmediatePropagation(),!1}if(m&&n.pointNearTool)for(g=0;g<m.data.length;g++)if(h=m.data[g],n.pointNearTool(d,h,f))return e(d).off("CornerstoneToolsTouchStart",n.touchStartCallback||l),e(d).off("CornerstoneToolsTap",n.tapCallback||s),h.active=!0,t.updateImage(d),o.touchMoveAllHandles(a,h,m,n.toolType,!0,c),a.stopImmediatePropagation(),!1;return n.touchDownActivateCallback?n.touchDownActivateCallback(a,u):i(a,u),!1}function l(a,r){function i(a,i){if(d.active=!1,d.invalidated=!0,o.anyHandlesOutsideImage(r,d.handles)&&o.removeToolState(r.element,n.toolType,d),t.updateImage(r.element),e(u).on("CornerstoneToolsTouchStart",n.touchStartCallback||l),e(u).on("CornerstoneToolsTap",n.tapCallback||s),n.pressCallback&&e(u).on("CornerstoneToolsTouchPress",n.pressCallback),a&&"CornerstoneToolsTouchPress"===a.type){var c=e.Event(a.type,i);e(u).trigger(c,i)}}var u=r.element,c=r.startPoints.canvas,d,f=o.getToolState(a.currentTarget,n.toolType),m,h=28;if(f){for(m=0;m<f.data.length;m++){d=f.data[m];var g=o.getHandleNearImagePoint(r.element,d.handles,c,h);if(g)return e(u).off("CornerstoneToolsTouchStart",n.touchStartCallback||l),e(u).off("CornerstoneToolsTap",n.tapCallback||s),n.pressCallback&&e(u).off("CornerstoneToolsTouchPress",n.pressCallback),d.active=!0,o.touchMoveHandle(a,n.toolType,d,g,i),a.stopImmediatePropagation(),!1}if(n.pointNearTool)for(m=0;m<f.data.length;m++)if(d=f.data[m],n.pointNearTool(r.element,d,c))return e(u).off("CornerstoneToolsTouchStart",n.touchStartCallback||l),e(u).off("CornerstoneToolsTap",n.tapCallback||s),n.pressCallback&&e(u).off("CornerstoneToolsTouchPress",n.pressCallback),o.touchMoveAllHandles(a,d,f,n.toolType,!0,i),a.stopImmediatePropagation(),!1}}function u(o){e(o).off("CornerstoneImageRendered",n.onImageRendered),e(o).off("CornerstoneToolsTouchStart",n.touchStartCallback||l),e(o).off("CornerstoneToolsTouchStartActive",n.touchDownActivateCallback||i),e(o).off("CornerstoneToolsTap",n.tapCallback||s),n.doubleTapCallback&&e(o).off("CornerstoneToolsDoubleTap",n.doubleTapCallback),n.pressCallback&&e(o).off("CornerstoneToolsTouchPress",n.pressCallback),t.updateImage(o)}function c(o){e(o).off("CornerstoneImageRendered",n.onImageRendered),e(o).off("CornerstoneToolsTouchStart",n.touchStartCallback||l),e(o).off("CornerstoneToolsTouchStartActive",n.touchDownActivateCallback||i),e(o).off("CornerstoneToolsTap",n.tapCallback||s),e(o).on("CornerstoneImageRendered",n.onImageRendered),n.doubleTapCallback&&e(o).off("CornerstoneToolsDoubleTap",n.doubleTapCallback),n.pressCallback&&e(o).off("CornerstoneToolsTouchPress",n.pressCallback),t.updateImage(o)}function d(o){e(o).off("CornerstoneImageRendered",n.onImageRendered),e(o).off("CornerstoneToolsTouchStart",n.touchStartCallback||l),e(o).off("CornerstoneToolsTouchStartActive",n.touchDownActivateCallback||i),e(o).off("CornerstoneToolsTap",n.tapCallback||s),e(o).on("CornerstoneImageRendered",n.onImageRendered),e(o).on("CornerstoneToolsTouchStart",n.touchStartCallback||l),e(o).on("CornerstoneToolsTouchStartActive",n.touchDownActivateCallback||i),e(o).on("CornerstoneToolsTap",n.tapCallback||s),n.doubleTapCallback&&(e(o).off("CornerstoneToolsDoubleTap",n.doubleTapCallback),e(o).on("CornerstoneToolsDoubleTap",n.doubleTapCallback)),n.pressCallback&&(e(o).off("CornerstoneToolsTouchPress",n.pressCallback),e(o).on("CornerstoneToolsTouchPress",n.pressCallback)),t.updateImage(o)}function f(o){var a="CornerstoneToolsToolDeactivated",r={toolType:n.toolType,type:a},u=e.Event(a,r);e(o).trigger(u,r),e(o).off("CornerstoneImageRendered",n.onImageRendered),e(o).off("CornerstoneToolsTouchStart",n.touchStartCallback||l),e(o).off("CornerstoneToolsTouchStartActive",n.touchDownActivateCallback||i),e(o).off("CornerstoneToolsTap",n.tapCallback||s),e(o).on("CornerstoneImageRendered",n.onImageRendered),e(o).on("CornerstoneToolsTouchStart",n.touchStartCallback||l),n.doubleTapCallback&&e(o).off("CornerstoneToolsDoubleTap",n.doubleTapCallback),n.pressCallback&&e(o).off("CornerstoneToolsTouchPress",n.pressCallback),t.updateImage(o)}var m={enable:c,disable:u,activate:d,deactivate:f,touchStartCallback:n.touchStartCallback||l,touchDownActivateCallback:n.touchDownActivateCallback||i,tapCallback:n.tapCallback||s};return n.pointNearTool&&(m.pointNearTool=n.pointNearTool),n.doubleTapCallback&&(m.doubleTapCallback=n.doubleTapCallback),n.pressCallback&&(m.pressCallback=n.pressCallback),n.addNewMeasurement&&(m.addNewMeasurement=n.addNewMeasurement),m}o.touchTool=i}(o,m,h,p),function(e,t,n,o){"use strict";function a(e){var t={visible:!0,active:!0,handles:{start:{x:e.currentPoints.image.x-20,y:e.currentPoints.image.y+10,highlight:!0,active:!1},end:{x:e.currentPoints.image.x,y:e.currentPoints.image.y,highlight:!0,active:!0},start2:{x:e.currentPoints.image.x-20,y:e.currentPoints.image.y+10,highlight:!0,active:!1},end2:{x:e.currentPoints.image.x,y:e.currentPoints.image.y+20,highlight:!0,active:!1}}};return t}function r(e,o,a){var r={start:t.pixelToCanvas(e,o.handles.start),end:t.pixelToCanvas(e,o.handles.end)},i=n.lineSegment.distanceToPoint(r,a);return i<5||(r.start=t.pixelToCanvas(e,o.handles.start2),r.end=t.pixelToCanvas(e,o.handles.end2),i=n.lineSegment.distanceToPoint(r,a),i<5)}function i(e,n){var a=o.getToolState(e.currentTarget,s);if(void 0!==a){var r=n.canvasContext.canvas.getContext("2d");r.setTransform(1,0,0,1,0,0);for(var i,l=o.toolStyle.getToolWidth(),u=o.textStyle.getFont(),c=o.angle.getConfiguration(),d=0;d<a.data.length;d++){r.save(),c&&c.shadow&&(r.shadowColor=c.shadowColor||"#000000",r.shadowOffsetX=c.shadowOffsetX||1,r.shadowOffsetY=c.shadowOffsetY||1);var f=a.data[d];i=f.active?o.toolColors.getActiveColor():o.toolColors.getToolColor(),r.beginPath(),r.strokeStyle=i,r.lineWidth=l;var m=t.pixelToCanvas(n.element,f.handles.start),h=t.pixelToCanvas(n.element,f.handles.end);r.moveTo(m.x,m.y),r.lineTo(h.x,h.y),m=t.pixelToCanvas(n.element,f.handles.start2),h=t.pixelToCanvas(n.element,f.handles.end2),r.moveTo(m.x,m.y),r.lineTo(h.x,h.y),r.stroke(),o.drawHandles(r,n,f.handles),r.fillStyle=i;var g=(Math.ceil(f.handles.start.x)-Math.ceil(f.handles.end.x))*n.image.columnPixelSpacing,p=(Math.ceil(f.handles.start.y)-Math.ceil(f.handles.end.y))*n.image.rowPixelSpacing,v=(Math.ceil(f.handles.start2.x)-Math.ceil(f.handles.end2.x))*n.image.columnPixelSpacing,y=(Math.ceil(f.handles.start2.y)-Math.ceil(f.handles.end2.y))*n.image.rowPixelSpacing,T=Math.acos(Math.abs((g*v+p*y)/(Math.sqrt(g*g+p*p)*Math.sqrt(v*v+y*y))));T*=180/Math.PI;var x=o.roundToDecimal(T,2),w="00B0",C=x.toString()+String.fromCharCode(parseInt(w,16)),b=(m.x+h.x)/2,P=(m.y+h.y)/2;r.font=u,o.drawTextBox(r,C,b,P,i),r.restore()}}}var s="angle";o.angle=o.mouseButtonTool({createNewMeasurement:a,onImageRendered:i,pointNearTool:r,toolType:s}),o.angleTouch=o.touchTool({createNewMeasurement:a,onImageRendered:i,pointNearTool:r,toolType:s})}(o,m,h,p),function(e,t,n,o){"use strict";function a(e){e(prompt("Enter your annotation:"))}function r(e,t,n){n(prompt("Change your annotation:"))}function i(n){function a(a){null!==a?r.text=a:o.removeToolState(n.element,m,r),r.active=!1,t.updateImage(n.element),e(n.element).on("CornerstoneToolsMouseMove",i,o.arrowAnnotate.mouseMoveCallback),e(n.element).on("CornerstoneToolsMouseDown",i,o.arrowAnnotate.mouseDownCallback),e(n.element).on("CornerstoneToolsMouseDownActivate",i,o.arrowAnnotate.mouseDownActivateCallback),e(n.element).on("CornerstoneToolsMouseDoubleClick",i,o.arrowAnnotate.mouseDoubleClickCallback)}var r=s(n),i={mouseButtonMask:n.which};o.addToolState(n.element,m,r),e(n.element).off("CornerstoneToolsMouseMove",o.arrowAnnotate.mouseMoveCallback),e(n.element).off("CornerstoneToolsMouseDown",o.arrowAnnotate.mouseDownCallback),e(n.element).off("CornerstoneToolsMouseDownActivate",o.arrowAnnotate.mouseDownActivateCallback),e(n.element).off("CornerstoneToolsMouseDoubleClick",o.arrowAnnotate.mouseDoubleClickCallback),t.updateImage(n.element),o.moveNewHandle(n,m,r,r.handles.end,function(){o.anyHandlesOutsideImage(n,r.handles)&&o.removeToolState(n.element,m,r);var e=o.arrowAnnotate.getConfiguration();void 0===r.text&&e.getTextCallback(a),t.updateImage(n.element)})}function s(e){var t={visible:!0,active:!0,handles:{start:{x:e.currentPoints.image.x,y:e.currentPoints.image.y,
highlight:!0,active:!1},end:{x:e.currentPoints.image.x,y:e.currentPoints.image.y,highlight:!0,active:!1},textBox:{active:!1,hasMoved:!1,movesIndependently:!1,drawnIndependently:!0,allowedOutsideImage:!0,hasBoundingBox:!0}}};return t}function l(e,o,a){var r={start:t.pixelToCanvas(e,o.handles.start),end:t.pixelToCanvas(e,o.handles.end)},i=n.lineSegment.distanceToPoint(r,a);return i<25}function u(e,a){var r=o.getToolState(e.currentTarget,m);if(r){var i=a.enabledElement,s=a.canvasContext.canvas.getContext("2d");s.setTransform(1,0,0,1,0,0);for(var l,u=o.toolStyle.getToolWidth(),c=o.textStyle.getFont(),d=o.arrowAnnotate.getConfiguration(),f=0;f<r.data.length;f++){s.save(),d&&d.shadow&&(s.shadowColor=d.shadowColor||"#000000",s.shadowOffsetX=d.shadowOffsetX||1,s.shadowOffsetY=d.shadowOffsetY||1);var h=r.data[f];l=h.active?o.toolColors.getActiveColor():o.toolColors.getToolColor();var g=t.pixelToCanvas(a.element,h.handles.start),p=t.pixelToCanvas(a.element,h.handles.end);d.arrowFirst?o.drawArrow(s,p,g,l,u):o.drawArrow(s,g,p,l,u);var v={drawHandlesIfActive:d&&d.drawHandlesOnHover};if(d.drawHandles&&o.drawHandles(s,a,h.handles,l,v),h.text&&""!==h.text){s.font=c;var y=s.measureText(h.text).width+10,T=o.textStyle.getFontSize()+10,x=Math.max(y,T)/2+5;p.x<g.x&&(x=-x);var w;if(!h.handles.textBox.hasMoved){w=d.arrowFirst?{x:p.x-y/2+x,y:p.y-T/2}:{x:g.x-y/2-x,y:g.y-T/2};var C=t.internal.getTransform(i);C.invert();var b=C.transformPoint(w.x,w.y);h.handles.textBox.x=b.x,h.handles.textBox.y=b.y}w=t.pixelToCanvas(a.element,h.handles.textBox);var P=o.drawTextBox(s,h.text,w.x,w.y,l);if(h.handles.textBox.boundingBox=P,h.handles.textBox.hasMoved){var I={start:{},end:{}},M={x:(g.x+p.x)/2,y:(g.y+p.y)/2},S=[g,p,M];I.end.x=w.x,I.end.y=w.y,I.start=n.point.findClosestPoint(S,I.end);var D=[{x:P.left+P.width/2,y:P.top},{x:P.left,y:P.top+P.height/2},{x:P.left+P.width/2,y:P.top+P.height},{x:P.left+P.width,y:P.top+P.height/2}];I.end=n.point.findClosestPoint(D,I.start),s.beginPath(),s.strokeStyle=l,s.lineWidth=u,s.setLineDash([2,3]),s.moveTo(I.start.x,I.start.y),s.lineTo(I.end.x,I.end.y),s.stroke()}}s.restore()}}}function c(n){function a(n){null!==n?i.text=n:o.removeToolState(r,m,i),i.active=!1,t.updateImage(r),e(r).on("CornerstoneToolsTouchPress",o.arrowAnnotateTouch.pressCallback),e(r).on("CornerstoneToolsTouchStartActive",o.arrowAnnotateTouch.touchDownActivateCallback),e(r).on("CornerstoneToolsTap",o.arrowAnnotateTouch.tapCallback)}var r=n.element,i=s(n);o.addToolState(r,m,i),e(r).off("CornerstoneToolsTouchPress",o.arrowAnnotateTouch.pressCallback),e(r).off("CornerstoneToolsTouchStartActive",o.arrowAnnotateTouch.touchDownActivateCallback),e(r).off("CornerstoneToolsTap",o.arrowAnnotateTouch.tapCallback),t.updateImage(r),o.moveNewHandleTouch(n,m,i,i.handles.end,function(){t.updateImage(r),o.anyHandlesOutsideImage(n,i.handles)&&o.removeToolState(r,m,i);var e=o.arrowAnnotate.getConfiguration();void 0===i.text&&e.getTextCallback(a)})}function d(e,n){function a(e,n,a){a===!0?o.removeToolState(r,m,e):e.text=n,e.active=!1,t.updateImage(r)}var r=n.element,i;if(!e.data||!e.data.mouseButtonMask||o.isMouseButtonEnabled(n.which,e.data.mouseButtonMask)){var s=o.arrowAnnotate.getConfiguration(),u=n.currentPoints.canvas,c=o.getToolState(r,m);if(c)for(var d=0;d<c.data.length;d++)if(i=c.data[d],l(r,i,u)||o.pointInsideBoundingBox(i.handles.textBox,u))return i.active=!0,t.updateImage(r),s.changeTextCallback(i,n,a),e.stopImmediatePropagation(),!1}}function f(n,a){function r(n,a,r){console.log("pressCallback doneChangingTextCallback"),r===!0?o.removeToolState(i,m,n):n.text=a,n.active=!1,t.updateImage(i),e(i).on("CornerstoneToolsTouchStart",o.arrowAnnotateTouch.touchStartCallback),e(i).on("CornerstoneToolsTouchStartActive",o.arrowAnnotateTouch.touchDownActivateCallback),e(i).on("CornerstoneToolsTap",o.arrowAnnotateTouch.tapCallback)}var i=a.element,s;if(!n.data||!n.data.mouseButtonMask||o.isMouseButtonEnabled(a.which,n.data.mouseButtonMask)){var u=o.arrowAnnotate.getConfiguration(),c=a.currentPoints.canvas,d=o.getToolState(i,m);if(d){if(a.handlePressed)return e(i).off("CornerstoneToolsTouchStart",o.arrowAnnotateTouch.touchStartCallback),e(i).off("CornerstoneToolsTouchStartActive",o.arrowAnnotateTouch.touchDownActivateCallback),e(i).off("CornerstoneToolsTap",o.arrowAnnotateTouch.tapCallback),u.changeTextCallback(a.handlePressed,a,r),n.stopImmediatePropagation(),!1;for(var f=0;f<d.data.length;f++)if(s=d.data[f],l(i,s,c)||o.pointInsideBoundingBox(s.handles.textBox,c))return s.active=!0,t.updateImage(i),e(i).off("CornerstoneToolsTouchStart",o.arrowAnnotateTouch.touchStartCallback),e(i).off("CornerstoneToolsTouchStartActive",o.arrowAnnotateTouch.touchDownActivateCallback),e(i).off("CornerstoneToolsTap",o.arrowAnnotateTouch.tapCallback),u.changeTextCallback(s,a,r),n.stopImmediatePropagation(),!1;return!1}}}var m="arrowAnnotate",h={getTextCallback:a,changeTextCallback:r,drawHandles:!1,drawHandlesOnHover:!0,arrowFirst:!0};o.arrowAnnotate=o.mouseButtonTool({addNewMeasurement:i,createNewMeasurement:s,onImageRendered:u,pointNearTool:l,toolType:m,mouseDoubleClickCallback:d}),o.arrowAnnotate.setConfiguration(h),o.arrowAnnotateTouch=o.touchTool({addNewMeasurement:c,createNewMeasurement:s,onImageRendered:u,pointNearTool:l,toolType:m,pressCallback:f})}(o,m,h,p),function(e,t,n){"use strict";function o(o,a){o.stopImmediatePropagation();var r=n.getToolState(o.currentTarget,h);if(r){var i=o.currentTarget,s=t.getEnabledElement(i),l=s.image.imageId,u=n.metaData.get("imagePlane",l),c=a.currentPoints.image,d=n.imagePointToPatientPoint(c,u),f=r.data[0].synchronizationContext,m=f.getSourceElements();e.each(m,function(o,a){if(a!==i){var r=Number.MAX_VALUE,s=-1,l=n.getToolState(a,"stack");if(void 0!==l){var u=l.data[0];if(e.each(u.imageIds,function(e,t){var o=n.metaData.get("imagePlane",t),a=o.imagePositionPatient,i=o.rowCosines.clone(),l=o.columnCosines.clone(),u=l.clone().cross(i.clone()),c=Math.abs(u.clone().dot(a)-u.clone().dot(d));c<r&&(r=c,s=e)}),s!==u.currentImageIdIndex&&s!==-1&&void 0!==u.imageIds[s]){var c=n.loadHandlerManager.getStartLoadHandler(),f=n.loadHandlerManager.getEndLoadHandler(),m=n.loadHandlerManager.getErrorLoadingHandler();c&&c(a);var h;h=u.preventCache===!0?t.loadImage(u.imageIds[s]):t.loadAndCacheImage(u.imageIds[s]),h.then(function(e){var n=t.getViewport(a);u.currentImageIdIndex=s,t.displayImage(a,e,n),f&&f(a,e)},function(e){var t=u.imageIds[s];m&&m(a,t,e)})}}}})}}function a(t,n){e(n.element).off("CornerstoneToolsMouseDrag",i),e(n.element).off("CornerstoneToolsMouseUp",a)}function r(t,r){if(n.isMouseButtonEnabled(r.which,t.data.mouseButtonMask))return e(r.element).on("CornerstoneToolsMouseDrag",i),e(r.element).on("CornerstoneToolsMouseUp",a),o(t,r),!1}function i(e,t){return o(e,t),!1}function s(t,o,a){var i={mouseButtonMask:o},s=n.getToolState(t,h);s=[],n.addToolState(t,h,{synchronizationContext:a}),e(t).off("CornerstoneToolsMouseDown",r),e(t).on("CornerstoneToolsMouseDown",i,r)}function l(t){e(t).off("CornerstoneToolsMouseDown",r)}function u(t,n){e(n.element).off("CornerstoneToolsTouchDrag",d),e(n.element).off("CornerstoneToolsDragEnd",u)}function c(t,n){return e(n.element).on("CornerstoneToolsTouchDrag",d),e(n.element).on("CornerstoneToolsDragEnd",u),o(t,n),!1}function d(e,t){return o(e,t),!1}function f(t,o){var a=n.getToolState(t,h);a=[],n.addToolState(t,h,{synchronizationContext:o}),e(t).off("CornerstoneToolsTouchStart",c),e(t).on("CornerstoneToolsTouchStart",c)}function m(t){e(t).off("CornerstoneToolsTouchStart",c)}var h="crosshairs";n.crosshairs={activate:s,deactivate:l,enable:s,disable:l},n.crosshairsTouch={activate:f,deactivate:m,enable:f,disable:m}}(o,m,p),function(e,t,n){"use strict";function o(n){var o={},a={disable:function(t){e(t).off("CornerstoneImageRendered",n)},enable:function(o){e(o).off("CornerstoneImageRendered",n),e(o).on("CornerstoneImageRendered",n),t.updateImage(o)},getConfiguration:function(){return o},setConfiguration:function(e){o=e}};return a}n.displayTool=o}(o,m,p),function(e,t,n){"use strict";function o(t){var n={activate:function(n){e(n).off("CornerstoneToolsDoubleTap",t);var o={};e(n).on("CornerstoneToolsDoubleTap",o,t)},disable:function(n){e(n).off("CornerstoneToolsDoubleTap",t)},enable:function(n){e(n).off("CornerstoneToolsDoubleTap",t)},deactivate:function(n){e(n).off("CornerstoneToolsDoubleTap",t)}};return n}n.doubleTapTool=o}(o,m,p),function(e,t,n){"use strict";function o(e){t.fitToWindow(e.element)}function a(e,t){return n.doubleTapZoom.strategy(t),!1}n.doubleTapZoom=n.doubleTapTool(a),n.doubleTapZoom.strategies={default:o},n.doubleTapZoom.strategy=o}(o,m,p),function(e,t,n){"use strict";function o(e){var o=t.getEnabledElement(e.element),a=o.canvas.getContext("2d");a.setTransform(1,0,0,1,0,0);var r=n.toolColors.getActiveColor(),i=n.textStyle.getFont(),s=n.textStyle.getFontSize(),l=n.dragProbe.getConfiguration();a.save(),l&&l.shadow&&(a.shadowColor=l.shadowColor||"#000000",a.shadowOffsetX=l.shadowOffsetX||1,a.shadowOffsetY=l.shadowOffsetY||1);var u=Math.round(e.currentPoints.image.x),c=Math.round(e.currentPoints.image.y),d,f,m;if(!(u<0||c<0||u>=e.image.columns||c>=e.image.rows)){if(e.image.color)d=n.getRGBPixels(e.element,u,c,1,1),f=""+u+", "+c,m="R: "+d[0]+" G: "+d[1]+" B: "+d[2]+" A: "+d[3];else{d=t.getStoredPixels(e.element,u,c,1,1);var h=d[0],g=h*e.image.slope+e.image.intercept,p=n.calculateSUV(e.image,h);f=""+u+", "+c,m="SP: "+h+" MO: "+parseFloat(g.toFixed(3)),p&&(m+=" SUV: "+parseFloat(p.toFixed(3)))}var v={x:e.currentPoints.image.x+3,y:e.currentPoints.image.y-3},y=t.pixelToCanvas(e.element,v);a.font=i,a.fillStyle=r,n.drawTextBox(a,m,y.x,y.y+s+5,r),n.drawTextBox(a,f,y.x,y.y,r),a.restore()}}function a(e){var o=e.element,a=t.getEnabledElement(o),r=a.image,i=a.canvas.getContext("2d");i.setTransform(1,0,0,1,0,0);var s=n.toolColors.getActiveColor(),l=n.textStyle.getFont(),u=n.dragProbe.getConfiguration();i.save(),u&&u.shadow&&(i.shadowColor=u.shadowColor||"#000000",i.shadowOffsetX=u.shadowOffsetX||1,i.shadowOffsetY=u.shadowOffsetY||1);var c=t.metaData.get("generalSeriesModule",r.imageId),d;c&&(d=c.modality);var f;f=e.isTouchEvent===!0?t.pageToPixel(o,e.currentPoints.page.x,e.currentPoints.page.y-4*n.textStyle.getFontSize()):t.pageToPixel(o,e.currentPoints.page.x,e.currentPoints.page.y-n.textStyle.getFontSize()/2);var m,h="";if(!(f.x<0||f.y<0||f.x>=r.columns||f.y>=r.rows)){if(r.color)m=n.getRGBPixels(o,f.x,f.y,1,1),h="R: "+m[0]+" G: "+m[1]+" B: "+m[2];else{m=t.getStoredPixels(o,f.x,f.y,1,1);var g=m[0],p=g*e.image.slope+e.image.intercept,v=parseFloat(p.toFixed(2));if("CT"===d)h+="HU: "+v;else if("PT"===d){h+=v;var y=n.calculateSUV(e.image,g);y&&(h+=" SUV: "+parseFloat(y.toFixed(2)))}else h+=v}var T=t.pixelToCanvas(o,f);i.font=l,i.fillStyle=s;var x,w=6,C=i.measureText(h).width;x=e.isTouchEvent===!0?{x:-C/2-5,y:-n.textStyle.getFontSize()-10-2*w}:{x:12,y:-(n.textStyle.getFontSize()+10)/2},i.beginPath(),i.strokeStyle=s,i.arc(T.x,T.y,w,0,2*Math.PI),i.stroke(),n.drawTextBox(i,h,T.x+x.x,T.y+x.y,s),i.restore()}}function r(n,o){e(o.element).off("CornerstoneImageRendered",s),e(o.element).off("CornerstoneToolsMouseDrag",l),e(o.element).off("CornerstoneToolsMouseUp",r),e(o.element).off("CornerstoneToolsMouseClick",r),t.updateImage(o.element)}function i(t,o){if(n.isMouseButtonEnabled(o.which,t.data.mouseButtonMask))return e(o.element).on("CornerstoneImageRendered",s),e(o.element).on("CornerstoneToolsMouseDrag",l),e(o.element).on("CornerstoneToolsMouseUp",r),e(o.element).on("CornerstoneToolsMouseClick",r),n.dragProbe.strategy(o),!1}function s(){u&&(n.dragProbe.strategy(u),u=null)}function l(e,n){var o=n.element;return u=n,t.updateImage(o),!1}var u;n.dragProbe=n.simpleMouseButtonTool(i),n.dragProbe.strategies={default:o,minimal:a},n.dragProbe.strategy=o;var c={fireOnTouchStart:!0};n.dragProbeTouch=n.touchDragTool(l,c)}(o,m,p),function(e,t,n,o){"use strict";function a(e){var t={visible:!0,active:!0,invalidated:!0,handles:{start:{x:e.currentPoints.image.x,y:e.currentPoints.image.y,highlight:!0,active:!1},end:{x:e.currentPoints.image.x,y:e.currentPoints.image.y,highlight:!0,active:!0},textBox:{active:!1,hasMoved:!1,movesIndependently:!1,drawnIndependently:!0,allowedOutsideImage:!0,hasBoundingBox:!0}}};return t}function r(e,n,a,r){var i=t.pixelToCanvas(e,n.handles.start),s=t.pixelToCanvas(e,n.handles.end),l={left:Math.min(i.x,s.x)+r/2,top:Math.min(i.y,s.y)+r/2,width:Math.abs(i.x-s.x)-r,height:Math.abs(i.y-s.y)-r},u={left:Math.min(i.x,s.x)-r/2,top:Math.min(i.y,s.y)-r/2,width:Math.abs(i.x-s.x)+r,height:Math.abs(i.y-s.y)+r},c=o.pointInEllipse(l,a),d=o.pointInEllipse(u,a);return!(!d||c)}function i(e,t,n){return r(e,t,n,15)}function s(e,t,n){return r(e,t,n,25)}function l(e){var t=e.toString().split(".");return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),t.join(".")}function u(e,a){var r=o.getToolState(e.currentTarget,c);if(r){var i=a.image,s=a.element,u=o.toolStyle.getToolWidth(),d=o.ellipticalRoi.getConfiguration(),f=a.canvasContext.canvas.getContext("2d"),m=t.metaData.get("generalSeriesModule",i.imageId),h;m&&(h=m.modality),f.setTransform(1,0,0,1,0,0);for(var g=0;g<r.data.length;g++){f.save();var p=r.data[g];d&&d.shadow&&(f.shadowColor=d.shadowColor||"#000000",f.shadowOffsetX=d.shadowOffsetX||1,f.shadowOffsetY=d.shadowOffsetY||1);var v=o.toolColors.getColorIfActive(p.active),y=t.pixelToCanvas(s,p.handles.start),T=t.pixelToCanvas(s,p.handles.end),x=Math.min(y.x,T.x),w=Math.min(y.y,T.y),C=Math.abs(y.x-T.x),b=Math.abs(y.y-T.y);if(f.beginPath(),f.strokeStyle=v,f.lineWidth=u,o.drawEllipse(f,x,w,C,b),f.closePath(),d&&d.drawHandlesOnHover)if(p.active===!0)o.drawHandles(f,a,p.handles,v);else{var P={drawHandlesIfActive:!0};o.drawHandles(f,a,p.handles,v,P)}else o.drawHandles(f,a,p.handles,v);var I,M,S;if(p.invalidated){var D={left:Math.round(Math.min(p.handles.start.x,p.handles.end.x)),top:Math.round(Math.min(p.handles.start.y,p.handles.end.y)),width:Math.round(Math.abs(p.handles.start.x-p.handles.end.x)),height:Math.round(Math.abs(p.handles.start.y-p.handles.end.y))};if(!i.color){var k=t.getPixels(s,D.left,D.top,D.width,D.height);M=o.calculateEllipseStatistics(k,D),"PT"===h&&(S={mean:o.calculateSUV(i,(M.mean-i.intercept)/i.slope),stdDev:o.calculateSUV(i,(M.stdDev-i.intercept)/i.slope)}),M&&!isNaN(M.mean)&&(p.meanStdDev=M,p.meanStdDevSUV=S)}var E=i.columnPixelSpacing||1,A=i.rowPixelSpacing||1;I=Math.PI*(D.width*E/2)*(D.height*A/2),isNaN(I)||(p.area=I),p.invalidated=!1}else M=p.meanStdDev,S=p.meanStdDevSUV,I=p.area;var R=[];if(M&&void 0!==M.mean){var L="";"CT"===h&&(L=" HU");var B="Mean: "+l(M.mean.toFixed(2))+L,O="StdDev: "+l(M.stdDev.toFixed(2))+L;if(S&&void 0!==S.mean){var F=" SUV: ";B+=F+l(S.mean.toFixed(2)),O+=F+l(S.stdDev.toFixed(2))}R.push(B),R.push(O)}if(I){var U=" mm"+String.fromCharCode(178);i.rowPixelSpacing&&i.columnPixelSpacing||(U=" pixels"+String.fromCharCode(178));var V="Area: "+l(I.toFixed(2))+U;R.push(V)}p.handles.textBox.hasMoved||(p.handles.textBox.x=Math.max(p.handles.start.x,p.handles.end.x),p.handles.textBox.y=(p.handles.start.y+p.handles.end.y)/2);var z=t.pixelToCanvas(s,p.handles.textBox),H={centering:{x:!1,y:!0}},N=o.drawTextBox(f,R,z.x,z.y,v,H);if(p.handles.textBox.boundingBox=N,p.handles.textBox.hasMoved){var _={start:{},end:{x:z.x,y:z.y}},W=[{x:x+C/2,y:w},{x:x,y:w+b/2},{x:x+C/2,y:w+b},{x:x+C,y:w+b/2}];_.start=n.point.findClosestPoint(W,_.end);var q=[{x:N.left+N.width/2,y:N.top},{x:N.left,y:N.top+N.height/2},{x:N.left+N.width/2,y:N.top+N.height},{x:N.left+N.width,y:N.top+N.height/2}];_.end=n.point.findClosestPoint(q,_.start),f.beginPath(),f.strokeStyle=v,f.lineWidth=u,f.setLineDash([2,3]),f.moveTo(_.start.x,_.start.y),f.lineTo(_.end.x,_.end.y),f.stroke()}f.restore()}}}var c="ellipticalRoi";o.ellipticalRoi=o.mouseButtonTool({createNewMeasurement:a,onImageRendered:u,pointNearTool:i,toolType:c}),o.ellipticalRoiTouch=o.touchTool({createNewMeasurement:a,onImageRendered:u,pointNearTool:s,toolType:c})}(o,m,h,p),function(e,t,n,o){"use strict";function a(e){var n=o.getToolState(e.element,T);if(void 0!==n){var a=o.freehand.getConfiguration(),r=n.data[a.currentTool],i={x:e.currentPoints.image.x,y:e.currentPoints.image.y,highlight:!0,active:!0,lines:[]};r.handles.length&&r.handles[a.currentHandle-1].lines.push(e.currentPoints.image),r.handles.push(i),a.currentHandle+=1,a.freehand=!1,t.updateImage(e.element)}}function r(e,a){var r=o.getToolState(e.element,T);if(void 0!==r){var i=r.data[a];if(void 0!==i.handles)for(var s=e.currentPoints.canvas,l=0;l<i.handles.length;l++){var u=t.pixelToCanvas(e.element,i.handles[l]);if(n.point.distance(u,s)<5)return l}}}function i(e){var t=o.getToolState(e.element,T);if(t)for(var n,a=0;a<t.data.length;a++)if(n=r(e,a),void 0!==n)return{handleNearby:n,toolIndex:a}}function s(n,a){e(a.element).off("CornerstoneToolsMouseUp",s);var r=o.getToolState(a.element,T);if(void 0!==r){var i=o.freehand.getConfiguration();a.event.shiftKey||(i.freehand=!1),t.updateImage(a.element)}}function l(e,n){var a=o.getToolState(n.element,T);if(a){var i=o.freehand.getConfiguration(),s=a.data[i.currentTool],l=Math.max(n.currentPoints.image.x,0);l=Math.min(l,n.image.width),i.mouseLocation.handles.start.x=l;var u=Math.max(n.currentPoints.image.y,0);u=Math.min(u,n.image.height),i.mouseLocation.handles.start.y=u;var c=i.currentHandle;if(i.modifying&&(s.active=!0,s.highlight=!0,s.handles[c].x=i.mouseLocation.handles.start.x,s.handles[c].y=i.mouseLocation.handles.start.y,c)){var d=s.handles[c-1].lines.length-1,f=s.handles[c-1].lines[d];f.x=i.mouseLocation.handles.start.x,f.y=i.mouseLocation.handles.start.y}if(i.freehand)s.handles[c-1].lines.push(n.currentPoints.image);else{var m=r(n,i.currentTool);void 0!==m&&m<s.handles.length-1&&(i.mouseLocation.handles.start.x=s.handles[m].x,i.mouseLocation.handles.start.y=s.handles[m].y)}t.updateImage(n.element)}}function u(t){e(t.element).on("CornerstoneToolsMouseMove",l),e(t.element).on("CornerstoneToolsMouseUp",s);var n={visible:!0,active:!0,handles:[]},a=o.freehand.getConfiguration();a.mouseLocation.handles.start.x=t.currentPoints.image.x,a.mouseLocation.handles.start.y=t.currentPoints.image.y,o.addToolState(t.element,T,n);var r=o.getToolState(t.element,T);a.currentTool=r.data.length-1}function c(n,a){var r=o.getToolState(n.element,T);if(r){var i=o.freehand.getConfiguration(),s=r.data[i.currentTool];s.active=!1,s.highlight=!1,void 0!==a&&s.handles[i.currentHandle-1].lines.push({x:s.handles[a].x,y:s.handles[a].y}),i.modifying&&(i.modifying=!1),i.currentHandle=0,i.currentTool=-1,e(n.element).off("CornerstoneToolsMouseMove",l),t.updateImage(n.element)}}function d(t,n){if(o.isMouseButtonEnabled(n.which,t.data.mouseButtonMask)){var d=o.getToolState(n.element,T),f,m,h=o.freehand.getConfiguration(),g=h.currentTool;if(h.modifying)return void c(n);if(g<0){var p=i(n);p?(f=p.handleNearby,m=p.toolIndex,void 0!==f&&(e(n.element).on("CornerstoneToolsMouseMove",l),e(n.element).on("CornerstoneToolsMouseUp",s),h.modifying=!0,h.currentHandle=f,h.currentTool=m)):(u(n),a(n))}else g>=0&&d.data[g].active&&(f=r(n,g),void 0!==f?c(n,f):n.event.shiftKey?h.freehand=!0:a(n));return!1}}function f(e,n){var a=o.getToolState(e.currentTarget,T);if(void 0!==a){var r=o.freehand.getConfiguration(),i=n.canvasContext.canvas.getContext("2d");i.setTransform(1,0,0,1,0,0);for(var s,l=o.toolStyle.getToolWidth(),u=o.toolColors.getFillColor(),c=0;c<a.data.length;c++){i.save();var d=a.data[c];d.active?(s=o.toolColors.getActiveColor(),u=o.toolColors.getFillColor()):(s=o.toolColors.getToolColor(),u=o.toolColors.getToolColor());var f;if(d.handles.length)for(var m=0;m<d.handles.length;m++){f=d.handles[m];var h=t.pixelToCanvas(n.element,f);i.beginPath(),i.strokeStyle=s,i.lineWidth=l,i.moveTo(h.x,h.y);for(var g=0;g<d.handles[m].lines.length;g++){var p=t.pixelToCanvas(n.element,d.handles[m].lines[g]);i.lineTo(p.x,p.y),i.stroke()}var v=t.pixelToCanvas(n.element,r.mouseLocation.handles.start);m===d.handles.length-1&&(!d.active||r.freehand||r.modifying||(i.lineTo(v.x,v.y),i.stroke()))}var y={fill:u};d.active&&o.drawHandles(i,n,r.mouseLocation.handles,s,y),o.drawHandles(i,n,d.handles,s,y),i.restore()}}}function m(n){e(n).off("CornerstoneToolsMouseDown",d),e(n).off("CornerstoneToolsMouseUp",s),e(n).off("CornerstoneToolsMouseMove",l),e(n).off("CornerstoneImageRendered",f),e(n).on("CornerstoneImageRendered",f),t.updateImage(n)}function h(n){e(n).off("CornerstoneToolsMouseDown",d),e(n).off("CornerstoneToolsMouseUp",s),e(n).off("CornerstoneToolsMouseMove",l),e(n).off("CornerstoneImageRendered",f),t.updateImage(n)}function g(n,o){var a={mouseButtonMask:o};e(n).off("CornerstoneToolsMouseDown",a,d),e(n).off("CornerstoneToolsMouseUp",s),e(n).off("CornerstoneToolsMouseMove",l),e(n).off("CornerstoneImageRendered",f),e(n).on("CornerstoneImageRendered",f),e(n).on("CornerstoneToolsMouseDown",a,d),t.updateImage(n)}function p(n){e(n).off("CornerstoneToolsMouseDown",d),e(n).off("CornerstoneToolsMouseUp",s),e(n).off("CornerstoneToolsMouseMove",l),e(n).off("CornerstoneImageRendered",f),e(n).on("CornerstoneImageRendered",f),t.updateImage(n)}function v(){return x}function y(e){x=e}var T="freehand",x={mouseLocation:{handles:{start:{highlight:!0,active:!0}}},freehand:!1,modifying:!1,currentHandle:0,currentTool:-1};o.freehand={enable:m,disable:h,activate:g,deactivate:p,getConfiguration:v,setConfiguration:y}}(o,m,h,p),function(e,t,n,o){"use strict";function a(e){var t=o.getToolState(e.event.currentTarget,l);if(!(t&&t.data&&t.data.length>0)){var n={visible:!0,active:!0,handles:{start:{x:e.currentPoints.image.x,y:e.currentPoints.image.y,highlight:!0,active:!1},end:{x:e.currentPoints.image.x,y:e.currentPoints.image.y,highlight:!0,active:!0}}};return n}}function r(e,n,o){var a=t.pixelToCanvas(e,n.handles.start),r=t.pixelToCanvas(e,n.handles.end),i={left:Math.min(a.x,r.x),top:Math.min(a.y,r.y),width:Math.abs(a.x-r.x),height:Math.abs(a.y-r.y)},s=!1;return o.x>=i.left&&o.x<=i.left+i.width&&o.y>=i.top&&o.y<=i.top+i.height&&(s=!0),s}function i(e,o,a){var r=t.pixelToCanvas(e,o.handles.start),i=t.pixelToCanvas(e,o.handles.end),s={left:Math.min(r.x,i.x),top:Math.min(r.y,i.y),width:Math.abs(r.x-i.x),height:Math.abs(r.y-i.y)},l=n.rect.distanceToPoint(s,a);return l<5}function s(e,n){var a=o.getToolState(e.currentTarget,l);if(void 0!==a){var r=n.canvasContext.canvas.getContext("2d");r.setTransform(1,0,0,1,0,0);var i,s=o.toolStyle.getToolWidth();r.save();var u=a.data[0];if(u){i=u.active?o.toolColors.getActiveColor():o.toolColors.getToolColor();var c=t.pixelToCanvas(n.element,u.handles.start),d=t.pixelToCanvas(n.element,u.handles.end),f={left:Math.min(c.x,d.x),top:Math.min(c.y,d.y),width:Math.abs(c.x-d.x),height:Math.abs(c.y-d.y)};r.beginPath(),r.strokeStyle="transparent",r.rect(0,0,r.canvas.clientWidth,r.canvas.clientHeight),r.rect(f.width+f.left,f.top,-f.width,f.height),r.stroke(),r.fillStyle="rgba(0,0,0,0.7)",r.fill(),r.closePath(),r.beginPath(),r.strokeStyle=i,r.lineWidth=s,r.setLineDash([4]),r.strokeRect(f.left,f.top,f.width,f.height),r.setLineDash([]),o.drawHandles(r,n,u.handles,i),r.restore()}}}var l="highlight",u=!0;o.highlight=o.mouseButtonRectangleTool({createNewMeasurement:a,onImageRendered:s,pointNearTool:i,pointInsideRect:r,toolType:l},u),o.highlightTouch=o.touchTool({createNewMeasurement:a,onImageRendered:s,pointNearTool:i,pointInsideRect:r,toolType:l},u)}(o,m,h,p),function(e,t,n){"use strict";function o(t){var n={},o={activate:function(n){e(n).off("CornerstoneToolsKeyDown",t),e(n).on("CornerstoneToolsKeyDown",t)},disable:function(n){e(n).off("CornerstoneToolsKeyDown",t)},enable:function(n){e(n).off("CornerstoneToolsKeyDown",t)},deactivate:function(n){e(n).off("CornerstoneToolsKeyDown",t)},getConfiguration:function(){return n},setConfiguration:function(e){n=e}};return o}n.keyboardTool=o}(o,m,p),function(e,t,n,o){"use strict";function a(e){var t={visible:!0,active:!0,handles:{start:{x:e.currentPoints.image.x,y:e.currentPoints.image.y,highlight:!0,active:!1},end:{x:e.currentPoints.image.x,y:e.currentPoints.image.y,highlight:!0,active:!0},textBox:{active:!1,hasMoved:!1,movesIndependently:!1,drawnIndependently:!0,allowedOutsideImage:!0,hasBoundingBox:!0}}};return t}function r(e,o,a){var r={start:t.pixelToCanvas(e,o.handles.start),end:t.pixelToCanvas(e,o.handles.end)},i=n.lineSegment.distanceToPoint(r,a);return i<25}function i(e,a){var r=o.getToolState(e.currentTarget,s);if(r){var i=a.canvasContext.canvas.getContext("2d");i.setTransform(1,0,0,1,0,0);for(var l=o.toolStyle.getToolWidth(),u=o.length.getConfiguration(),c=0;c<r.data.length;c++){i.save(),u&&u.shadow&&(i.shadowColor=u.shadowColor||"#000000",i.shadowOffsetX=u.shadowOffsetX||1,i.shadowOffsetY=u.shadowOffsetY||1);var d=r.data[c],f=o.toolColors.getColorIfActive(d.active),m=t.pixelToCanvas(a.element,d.handles.start),h=t.pixelToCanvas(a.element,d.handles.end);i.beginPath(),i.strokeStyle=f,i.lineWidth=l,i.moveTo(m.x,m.y),i.lineTo(h.x,h.y),i.stroke();var g={drawHandlesIfActive:u&&u.drawHandlesOnHover};o.drawHandles(i,a,d.handles,f,g),i.fillStyle=f;var p=(d.handles.end.x-d.handles.start.x)*(a.image.columnPixelSpacing||1),v=(d.handles.end.y-d.handles.start.y)*(a.image.rowPixelSpacing||1),y=Math.sqrt(p*p+v*v);d.length=y;var T=" mm";a.image.rowPixelSpacing&&a.image.columnPixelSpacing||(T=" pixels");var x=""+y.toFixed(2)+T;if(!d.handles.textBox.hasMoved){var w={x:Math.max(d.handles.start.x,d.handles.end.x)};w.x===d.handles.start.x?w.y=d.handles.start.y:w.y=d.handles.end.y,d.handles.textBox.x=w.x,d.handles.textBox.y=w.y}var C=t.pixelToCanvas(a.element,d.handles.textBox);C.x+=10;var b={centering:{x:!1,y:!0}},P=o.drawTextBox(i,x,C.x,C.y,f,b);if(d.handles.textBox.boundingBox=P,d.handles.textBox.hasMoved){var I={start:{},end:{}},M={x:(m.x+h.x)/2,y:(m.y+h.y)/2},S=[m,h,M];I.end.x=C.x,I.end.y=C.y,I.start=n.point.findClosestPoint(S,I.end);var D=[{x:P.left+P.width/2,y:P.top},{x:P.left,y:P.top+P.height/2},{x:P.left+P.width/2,y:P.top+P.height},{x:P.left+P.width,y:P.top+P.height/2}];I.end=n.point.findClosestPoint(D,I.start),i.beginPath(),i.strokeStyle=f,i.lineWidth=l,i.setLineDash([2,3]),i.moveTo(I.start.x,I.start.y),i.lineTo(I.end.x,I.end.y),i.stroke()}i.restore()}}}var s="length";o.length=o.mouseButtonTool({createNewMeasurement:a,onImageRendered:i,pointNearTool:r,toolType:s}),o.lengthTouch=o.touchTool({createNewMeasurement:a,onImageRendered:i,pointNearTool:r,toolType:s})}(o,m,h,p),function(e,t,n){"use strict";function o(t,n){e(n.element).off("CornerstoneToolsMouseDrag",l),e(n.element).off("CornerstoneToolsMouseUp",o),e(n.element).off("CornerstoneToolsMouseClick",o),e(n.element).off("CornerstoneNewImage",i),a(n)}function a(t){e(t.element).find(".magnifyTool").hide(),document.body.style.cursor="default"}function r(t,a){if(n.isMouseButtonEnabled(a.which,t.data.mouseButtonMask))return e(a.element).on("CornerstoneToolsMouseDrag",a,l),e(a.element).on("CornerstoneToolsMouseUp",a,o),e(a.element).on("CornerstoneToolsMouseClick",a,o),T=a.currentPoints,e(a.element).on("CornerstoneNewImage",a,i),u(a),!1}function i(e,t){t.currentPoints=T,u(t)}function s(t,n){e(n.element).off("CornerstoneToolsDragEnd",s),e(n.element).off("CornerstoneToolsTouchEnd",s),e(n.element).off("CornerstoneNewImage",i),a(n)}function l(t,n){return T=n.currentPoints,u(n),n.isTouchEvent===!0&&(e(n.element).on("CornerstoneToolsDragEnd",s),e(n.element).on("CornerstoneToolsTouchEnd",s)),!1}function u(o){var a=e(o.element).find(".magnifyTool").get(0);a||c(o.element);var r=n.magnify.getConfiguration(),i=r.magnifySize,s=r.magnificationLevel,l=e(o.element).find("canvas").not(".magnifyTool").get(0),u=l.getContext("2d");u.setTransform(1,0,0,1,0,0);var d=a.getContext("2d");d.setTransform(1,0,0,1,0,0);var f=i/s,m=t.pixelToCanvas(o.element,o.currentPoints.image);o.isTouchEvent===!0&&(m.y-=1.25*f),m.x=Math.max(m.x,0),m.x=Math.min(m.x,l.width),m.y=Math.max(m.y,0),m.y=Math.min(m.y,l.height),d.clearRect(0,0,i,i),d.fillStyle="transparent",d.fillRect(0,0,i,i);var h={x:m.x-.5*f,y:m.y-.5*f};"Safari"===y&&(h.x=Math.max(h.x,0),h.y=Math.max(h.y,0)),h.x=Math.min(h.x,l.width),h.y=Math.min(h.y,l.height);var g={x:(l.width-h.x)*s,y:(l.height-h.y)*s};d.drawImage(l,h.x,h.y,l.width-h.x,l.height-h.y,0,0,g.x,g.y),a.style.top=m.y-.5*i+"px",a.style.left=m.x-.5*i+"px",a.style.display="block",document.body.style.cursor="none"}function c(t){if(0===e(t).find(".magnifyTool").length){var o=document.createElement("canvas");o.classList.add("magnifyTool");var a=n.magnify.getConfiguration();o.width=a.magnifySize,o.height=a.magnifySize,o.style.position="absolute",t.appendChild(o)}}function d(t){e(t).find(".magnifyTool").remove()}function f(t){e(t).off("CornerstoneToolsMouseDown",r),d(t)}function m(e){var t=n.magnify.getConfiguration(t);if(!y){var o=n.getBrowserInfo(),a=o.split(" ");y=a[0]}c(e)}function h(t,n){var o={mouseButtonMask:n};e(t).off("CornerstoneToolsMouseDown",r),e(t).on("CornerstoneToolsMouseDown",o,r),c(t)}function g(){return v}function p(e){v=e}var v={magnifySize:100,magnificationLevel:2},y,T;n.magnify={enable:m,activate:h,deactivate:f,disable:f,getConfiguration:g,setConfiguration:p};var x={fireOnTouchStart:!0,activateCallback:c,disableCallback:d};n.magnifyTouchDrag=n.touchDragTool(l,x)}(o,m,p),function(e,t,n){"use strict";function o(t,n){var o={},a="CornerstoneToolsMultiTouchDrag";n&&n.fireOnTouchStart===!0&&(a+=" CornerstoneToolsMultiTouchStart");var r={activate:function(o){e(o).off(a,t),n&&n.eventData?e(o).on(a,n.eventData,t):e(o).on(a,t),n&&n.activateCallback&&n.activateCallback(o)},disable:function(o){e(o).off(a,t),n&&n.disableCallback&&n.disableCallback(o)},enable:function(o){e(o).off(a,t),n&&n.enableCallback&&n.enableCallback(o)},deactivate:function(o){e(o).off(a,t),n&&n.deactivateCallback&&n.deactivateCallback(o)},getConfiguration:function(){return o},setConfiguration:function(e){o=e}};return r}n.multiTouchDragTool=o}(o,m,p),function(e,t,n){"use strict";function o(e){var o=t.getEnabledElement(e),a=n.metaData.get("imagePlane",o.image.imageId);if(a&&a.rowCosines&&a.columnCosines){var r=n.orientation.getOrientationString(a.rowCosines),i=n.orientation.getOrientationString(a.columnCosines),s=n.orientation.invertOrientationString(r),l=n.orientation.invertOrientationString(i);return{top:l,bottom:i,left:s,right:r}}}function a(e){var n=t.getEnabledElement(e),o;o={x:n.image.width/2,y:5};var a=t.pixelToCanvas(e,o);o={x:n.image.width/2,y:n.image.height-5};var r=t.pixelToCanvas(e,o);o={x:5,y:n.image.height/2};var i=t.pixelToCanvas(e,o);o={x:n.image.width-10,y:n.image.height/2};var s=t.pixelToCanvas(e,o);return{top:a,bottom:r,left:i,right:s}}function r(e,t){var r=t.element,i=o(r);if(i){var s=a(r,i),l=t.canvasContext.canvas.getContext("2d");l.setTransform(1,0,0,1,0,0);var u=n.toolColors.getToolColor(),c={top:l.measureText(i.top).width,left:l.measureText(i.left).width,right:l.measureText(i.right).width,bottom:l.measureText(i.bottom).width};n.drawTextBox(l,i.top,s.top.x-c.top/2,s.top.y,u),n.drawTextBox(l,i.left,s.left.x-c.left/2,s.left.y,u);var d=n.orientationMarkers.getConfiguration();d&&d.drawAllMarkers&&(n.drawTextBox(l,i.right,s.right.x-c.right/2,s.right.y,u),n.drawTextBox(l,i.bottom,s.bottom.x-c.bottom/2,s.bottom.y,u))}}n.orientationMarkers=n.displayTool(r)}(o,m,p),function(e,t,n){"use strict";function o(t,n){e(n.element).off("CornerstoneToolsMouseDrag",r),e(n.element).off("CornerstoneToolsMouseUp",o),e(n.element).off("CornerstoneToolsMouseClick",o)}function a(t,a){if(n.isMouseButtonEnabled(a.which,t.data.mouseButtonMask))return e(a.element).on("CornerstoneToolsMouseDrag",r),e(a.element).on("CornerstoneToolsMouseUp",o),e(a.element).on("CornerstoneToolsMouseClick",o),!1}function r(e,n){var o=n.viewport.scale,a=n.viewport.scale;return n.image.rowPixelSpacing<n.image.columnPixelSpacing?o*=n.image.columnPixelSpacing/n.image.rowPixelSpacing:n.image.columnPixelSpacing<n.image.rowPixelSpacing&&(a*=n.image.rowPixelSpacing/n.image.columnPixelSpacing),n.viewport.translation.x+=n.deltaPoints.page.x/o,n.viewport.translation.y+=n.deltaPoints.page.y/a,t.setViewport(n.element,n.viewport),!1}n.pan=n.simpleMouseButtonTool(a),n.panTouchDrag=n.touchDragTool(r)}(o,m,p),function(e,t,n){"use strict";function o(e,o){var a=n.panMultiTouch.getConfiguration();
if(a&&a.testPointers(o))return o.viewport.translation.x+=o.deltaPoints.page.x/o.viewport.scale,o.viewport.translation.y+=o.deltaPoints.page.y/o.viewport.scale,t.setViewport(o.element,o.viewport),!1}var a={testPointers:function(e){return e.numPointers>=2}};n.panMultiTouch=n.multiTouchDragTool(o),n.panMultiTouch.setConfiguration(a)}(o,m,p),function(e,t,n){"use strict";function o(e){var t={visible:!0,active:!0,handles:{end:{x:e.currentPoints.image.x,y:e.currentPoints.image.y,highlight:!0,active:!0}}};return t}function a(e,n,o){var a=t.pixelToCanvas(e,n.handles.end);return h.point.distance(a,o)<5}function r(e,o){var a=n.getToolState(e.currentTarget,i);if(a){var r=o.canvasContext.canvas.getContext("2d");r.setTransform(1,0,0,1,0,0);for(var s,l=n.textStyle.getFont(),u=n.textStyle.getFontSize(),c=0;c<a.data.length;c++){r.save();var d=a.data[c];s=d.active?n.toolColors.getActiveColor():n.toolColors.getToolColor(),n.drawHandles(r,o,d.handles,s);var f=Math.round(d.handles.end.x),m=Math.round(d.handles.end.y),h,g,p;if(f<0||m<0||f>=o.image.columns||m>=o.image.rows)return;if(o.image.color)g=""+f+", "+m,h=n.getRGBPixels(o.element,f,m,1,1),p="R: "+h[0]+" G: "+h[1]+" B: "+h[2];else{h=t.getStoredPixels(o.element,f,m,1,1);var v=h[0],y=v*o.image.slope+o.image.intercept,T=n.calculateSUV(o.image,v);g=""+f+", "+m,p="SP: "+v+" MO: "+parseFloat(y.toFixed(3)),T&&(p+=" SUV: "+parseFloat(T.toFixed(3)))}var x={x:d.handles.end.x+3,y:d.handles.end.y-3},w=t.pixelToCanvas(o.element,x);r.font=l,r.fillStyle=s,n.drawTextBox(r,p,w.x,w.y+u+5,s),n.drawTextBox(r,g,w.x,w.y,s),r.restore()}}}var i="probe";n.probe=n.mouseButtonTool({createNewMeasurement:o,onImageRendered:r,pointNearTool:a,toolType:i}),n.probeTouch=n.touchTool({createNewMeasurement:o,onImageRendered:r,pointNearTool:a,toolType:i})}(o,m,p),function(e,t,n,o){"use strict";function a(e){var t={visible:!0,active:!0,invalidated:!0,handles:{start:{x:e.currentPoints.image.x,y:e.currentPoints.image.y,highlight:!0,active:!1},end:{x:e.currentPoints.image.x,y:e.currentPoints.image.y,highlight:!0,active:!0},textBox:{active:!1,hasMoved:!1,movesIndependently:!1,drawnIndependently:!0,allowedOutsideImage:!0,hasBoundingBox:!0}}};return t}function r(e,o,a){var r=t.pixelToCanvas(e,o.handles.start),i=t.pixelToCanvas(e,o.handles.end),s={left:Math.min(r.x,i.x),top:Math.min(r.y,i.y),width:Math.abs(r.x-i.x),height:Math.abs(r.y-i.y)},l=n.rect.distanceToPoint(s,a);return l<5}function i(e,t){for(var n=0,o=0,a=0,r=0,i=t.top;i<t.top+t.height;i++)for(var s=t.left;s<t.left+t.width;s++)n+=e[r],o+=e[r]*e[r],a++,r++;if(0===a)return{count:a,mean:0,variance:0,stdDev:0};var l=n/a,u=o/a-l*l;return{count:a,mean:l,variance:u,stdDev:Math.sqrt(u)}}function s(e){var t=e.toString().split(".");return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),t.join(".")}function l(e,a){var r=o.getToolState(e.currentTarget,u);if(r){var l=a.image,c=a.element,d=o.toolStyle.getToolWidth(),f=o.rectangleRoi.getConfiguration(),m=a.canvasContext.canvas.getContext("2d"),h=t.metaData.get("generalSeriesModule",l.imageId),g;h&&(g=h.modality),m.setTransform(1,0,0,1,0,0);for(var p=0;p<r.data.length;p++){m.save();var v=r.data[p];f&&f.shadow&&(m.shadowColor=f.shadowColor||"#000000",m.shadowOffsetX=f.shadowOffsetX||1,m.shadowOffsetY=f.shadowOffsetY||1);var y=o.toolColors.getColorIfActive(v.active),T=t.pixelToCanvas(c,v.handles.start),x=t.pixelToCanvas(c,v.handles.end),w=Math.min(T.x,x.x),C=Math.min(T.y,x.y),b=Math.abs(T.x-x.x),P=Math.abs(T.y-x.y);if(m.beginPath(),m.strokeStyle=y,m.lineWidth=d,m.rect(w,C,b,P),m.stroke(),f&&f.drawHandlesOnHover)if(v.active===!0)o.drawHandles(m,a,v.handles,y);else{var I={drawHandlesIfActive:!0};o.drawHandles(m,a,v.handles,y,I)}else o.drawHandles(m,a,v.handles,y);var M,S,D;if(v.invalidated){var k={left:Math.min(v.handles.start.x,v.handles.end.x),top:Math.min(v.handles.start.y,v.handles.end.y),width:Math.abs(v.handles.start.x-v.handles.end.x),height:Math.abs(v.handles.start.y-v.handles.end.y)};if(!l.color){var E=t.getPixels(c,k.left,k.top,k.width,k.height);S=i(E,k),"PT"===g&&(D={mean:o.calculateSUV(l,(S.mean-l.intercept)/l.slope),stdDev:o.calculateSUV(l,(S.stdDev-l.intercept)/l.slope)}),S&&!isNaN(S.mean)&&(v.meanStdDev=S,v.meanStdDevSUV=D)}var A=l.columnPixelSpacing||1,R=l.rowPixelSpacing||1;M=k.width*A*(k.height*R),isNaN(M)||(v.area=M),v.invalidated=!1}else S=v.meanStdDev,D=v.meanStdDevSUV,M=v.area;var L=[];if(S&&S.mean){var B="";"CT"===g&&(B=" HU");var O="Mean: "+s(S.mean.toFixed(2))+B,F="StdDev: "+s(S.stdDev.toFixed(2))+B;if(D&&void 0!==D.mean){var U=" SUV: ";O+=U+s(D.mean.toFixed(2)),F+=U+s(D.stdDev.toFixed(2))}L.push(O),L.push(F)}if(M){var V=" mm"+String.fromCharCode(178);l.rowPixelSpacing&&l.columnPixelSpacing||(V=" pixels"+String.fromCharCode(178));var z="Area: "+s(M.toFixed(2))+V;L.push(z)}v.handles.textBox.hasMoved||(v.handles.textBox.x=Math.max(v.handles.start.x,v.handles.end.x),v.handles.textBox.y=(v.handles.start.y+v.handles.end.y)/2);var H=t.pixelToCanvas(c,v.handles.textBox),N={centering:{x:!1,y:!0}},_=o.drawTextBox(m,L,H.x,H.y,y,N);if(v.handles.textBox.boundingBox=_,v.handles.textBox.hasMoved){var W={start:{},end:{x:H.x,y:H.y}},q=[{x:w+b/2,y:C},{x:w,y:C+P/2},{x:w+b/2,y:C+P},{x:w+b,y:C+P/2}];W.start=n.point.findClosestPoint(q,W.end);var G=[{x:_.left+_.width/2,y:_.top},{x:_.left,y:_.top+_.height/2},{x:_.left+_.width/2,y:_.top+_.height},{x:_.left+_.width,y:_.top+_.height/2}];W.end=n.point.findClosestPoint(G,W.start),m.beginPath(),m.strokeStyle=y,m.lineWidth=d,m.setLineDash([2,3]),m.moveTo(W.start.x,W.start.y),m.lineTo(W.end.x,W.end.y),m.stroke()}m.restore()}}}var u="rectangleRoi";o.rectangleRoi=o.mouseButtonTool({createNewMeasurement:a,onImageRendered:l,pointNearTool:r,toolType:u}),o.rectangleRoiTouch=o.touchTool({createNewMeasurement:a,onImageRendered:l,pointNearTool:r,toolType:u})}(o,m,h,p),function(e,t,n){"use strict";function o(e){var n=e.element.getBoundingClientRect(e.element),o={x:e.currentPoints.client.x,y:e.currentPoints.client.y},a=e.element.clientWidth,r=e.element.clientHeight,i={x:o.x-n.left-a/2,y:-1*(o.y-n.top-r/2)},s=Math.atan2(i.y,i.x),l=s*(180/Math.PI),u=-1*l+90;e.viewport.rotation=u,t.setViewport(e.element,e.viewport)}function a(e){e.viewport.rotation+=e.deltaPoints.page.x/e.viewport.scale,t.setViewport(e.element,e.viewport)}function r(e){e.viewport.rotation+=e.deltaPoints.page.y/e.viewport.scale,t.setViewport(e.element,e.viewport)}function i(t,n){e(n.element).off("CornerstoneToolsMouseDrag",l),e(n.element).off("CornerstoneToolsMouseUp",i),e(n.element).off("CornerstoneToolsMouseClick",i)}function s(t,o){if(n.isMouseButtonEnabled(o.which,t.data.mouseButtonMask))return e(o.element).on("CornerstoneToolsMouseDrag",l),e(o.element).on("CornerstoneToolsMouseUp",i),e(o.element).on("CornerstoneToolsMouseClick",i),!1}function l(e,o){return n.rotate.strategy(o),t.setViewport(o.element,o.viewport),!1}n.rotate=n.simpleMouseButtonTool(s),n.rotate.strategies={default:o,horizontal:a,vertical:r},n.rotate.strategy=o,n.rotateTouchDrag=n.touchDragTool(l)}(o,m,p),function(e,t,n){"use strict";function o(e,n){return n.viewport.rotation+=n.rotation,t.setViewport(n.element,n.viewport),!1}function a(t){e(t).off("CornerstoneToolsTouchRotate",o)}function r(t){e(t).off("CornerstoneToolsTouchRotate",o),e(t).on("CornerstoneToolsTouchRotate",o)}n.rotateTouch={activate:r,disable:a}}(o,m,p),function(e,t,n){"use strict";function o(t,n){var o=e(t).find("canvas").get(0),a=document.createElement("a");if(a.download=n,a.href=o.toDataURL(),document.createEvent){var r=document.createEvent("MouseEvents");r.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),a.dispatchEvent(r)}else a.fireEvent&&a.fireEvent("onclick")}n.saveAs=o}(o,m,p),function(e,t,n,o){"use strict";function a(e){e(prompt("Enter your annotation:"))}function r(e,t,n){n(prompt("Change your annotation:"))}function i(e){function n(e){null!==e?i.text=e:o.removeToolState(a,m,i),i.active=!1,t.updateImage(a)}var a=e.element,r=o.seedAnnotate.getConfiguration(),i=s(e);o.addToolState(a,m,i),t.updateImage(a),o.moveHandle(e,m,i,i.handles.end,function(){o.anyHandlesOutsideImage(e,i.handles)&&o.removeToolState(a,m,i),void 0===i.text&&r.getTextCallback(n),t.updateImage(a)})}function s(e){var t={visible:!0,active:!0,handles:{end:{x:e.currentPoints.image.x,y:e.currentPoints.image.y,highlight:!0,active:!1},textBox:{active:!1,hasMoved:!1,movesIndependently:!1,drawnIndependently:!0,allowedOutsideImage:!0,hasBoundingBox:!0}}};return t}function l(e,o,a){if(o.handles.end){var r=t.pixelToCanvas(e,o.handles.end),i=n.point.distance(r,a);return i<25}}function u(e,a){var r=o.getToolState(e.currentTarget,m);if(r){var i=a.enabledElement,s=a.canvasContext.canvas.getContext("2d");s.setTransform(1,0,0,1,0,0);for(var l=a.canvasContext.canvas.width,u,c=o.toolStyle.getToolWidth(),d=o.textStyle.getFont(),f=o.seedAnnotate.getConfiguration(),h=0;h<r.data.length;h++){s.save(),f&&f.shadow&&(s.shadowColor=f.shadowColor||"#000000",s.shadowOffsetX=f.shadowOffsetX||1,s.shadowOffsetY=f.shadowOffsetY||1);var g=r.data[h];u=g.active?o.toolColors.getActiveColor():o.toolColors.getToolColor();var p=t.pixelToCanvas(a.element,g.handles.end);o.drawCircle(s,p,u,c);var v={drawHandlesIfActive:f&&f.drawHandlesOnHover};if(f.drawHandles&&o.drawHandles(s,a,p,u,v),g.text&&""!==g.text){s.font=d;var y="";y=f.showCoordinates?g.text+" x: "+Math.round(g.handles.end.x)+" y: "+Math.round(g.handles.end.y):g.text;var T=s.measureText(y).width+10,x=o.textStyle.getFontSize()+10,w=Math.max(T,x)/2+5;p.x>l/2&&(w=-w);var C;if(!g.handles.textBox.hasMoved){C={x:p.x-T/2+w,y:p.y-x/2};var b=t.internal.getTransform(i);b.invert();var P=b.transformPoint(C.x,C.y);g.handles.textBox.x=P.x,g.handles.textBox.y=P.y}C=t.pixelToCanvas(a.element,g.handles.textBox);var I=o.drawTextBox(s,y,C.x,C.y,u);if(g.handles.textBox.boundingBox=I,g.handles.textBox.hasMoved){var M={start:{},end:{}};M.end.x=C.x,M.end.y=C.y,M.start=p;var S=[{x:I.left+I.width/2,y:I.top},{x:I.left,y:I.top+I.height/2},{x:I.left+I.width/2,y:I.top+I.height},{x:I.left+I.width,y:I.top+I.height/2}];M.end=n.point.findClosestPoint(S,M.start),s.beginPath(),s.strokeStyle=u,s.lineWidth=c,s.setLineDash([2,3]),s.moveTo(M.start.x,M.start.y),s.lineTo(M.end.x,M.end.y),s.stroke()}}s.restore()}}}function c(e){function n(e){null!==e?i.text=e:o.removeToolState(a,m,i),i.active=!1,t.updateImage(a)}var a=e.element,r=o.seedAnnotate.getConfiguration(),i=s(e);o.addToolState(a,m,i),t.updateImage(a),o.moveHandle(e,m,i,i.handles.end,function(){o.anyHandlesOutsideImage(e,i.handles)&&o.removeToolState(a,m,i),void 0===i.text&&r.getTextCallback(n),t.updateImage(a)})}function d(e,n){function a(e,n,a){a===!0?o.removeToolState(r,m,e):e.text=n,e.active=!1,t.updateImage(r)}var r=n.element,i;if(!e.data||!e.data.mouseButtonMask||o.isMouseButtonEnabled(n.which,e.data.mouseButtonMask)){var s=o.seedAnnotate.getConfiguration(),u=n.currentPoints.canvas,c=o.getToolState(r,m);if(c){for(var d=0;d<c.data.length;d++)if(i=c.data[d],l(r,i,u)||o.pointInsideBoundingBox(i.handles.textBox,u))return i.active=!0,t.updateImage(r),s.changeTextCallback(i,n,a),e.stopImmediatePropagation(),!1;return!1}}}function f(n,a){function r(n,a,r){console.log("pressCallback doneChangingTextCallback"),r===!0?o.removeToolState(i,m,n):n.text=a,n.active=!1,t.updateImage(i),e(i).on("CornerstoneToolsTouchStart",o.seedAnnotateTouch.touchStartCallback),e(i).on("CornerstoneToolsTouchStartActive",o.seedAnnotateTouch.touchDownActivateCallback),e(i).on("CornerstoneToolsTap",o.seedAnnotateTouch.tapCallback)}var i=a.element,s;if(n.data&&n.data.mouseButtonMask&&!o.isMouseButtonEnabled(a.which,n.data.mouseButtonMask))return!1;var u=o.seedAnnotate.getConfiguration(),c=a.currentPoints.canvas,d=o.getToolState(i,m);if(!d)return!1;if(a.handlePressed)return e(i).off("CornerstoneToolsTouchStart",o.seedAnnotateTouch.touchStartCallback),e(i).off("CornerstoneToolsTouchStartActive",o.seedAnnotateTouch.touchDownActivateCallback),e(i).off("CornerstoneToolsTap",o.seedAnnotateTouch.tapCallback),u.changeTextCallback(a.handlePressed,a,r),n.stopImmediatePropagation(),!1;for(var f=0;f<d.data.length;f++)if(s=d.data[f],l(i,s,c)||o.pointInsideBoundingBox(s.handles.textBox,c))return s.active=!0,t.updateImage(i),e(i).off("CornerstoneToolsTouchStart",o.seedAnnotateTouch.touchStartCallback),e(i).off("CornerstoneToolsTouchStartActive",o.seedAnnotateTouch.touchDownActivateCallback),e(i).off("CornerstoneToolsTap",o.seedAnnotateTouch.tapCallback),u.changeTextCallback(s,a,r),n.stopImmediatePropagation(),!1;return!1}var m="seedAnnotate",h={getTextCallback:a,changeTextCallback:r,drawHandles:!1,drawHandlesOnHover:!0,currentLetter:"A",currentNumber:0,showCoordinates:!0,countUp:!0};o.seedAnnotate=o.mouseButtonTool({addNewMeasurement:i,createNewMeasurement:s,onImageRendered:u,pointNearTool:l,toolType:m,mouseDoubleClickCallback:d}),o.seedAnnotate.setConfiguration(h),o.seedAnnotateTouch=o.touchTool({addNewMeasurement:c,createNewMeasurement:s,onImageRendered:u,pointNearTool:l,toolType:m,pressCallback:f})}(o,m,h,p),function(e,t,n,o){"use strict";function a(e){var t={visible:!0,active:!0,handles:{start:{x:e.currentPoints.image.x,y:e.currentPoints.image.y,highlight:!0,active:!1},middle:{x:e.currentPoints.image.x,y:e.currentPoints.image.y,highlight:!0,active:!0},end:{x:e.currentPoints.image.x,y:e.currentPoints.image.y,highlight:!0,active:!1},textBox:{active:!1,hasMoved:!1,movesIndependently:!1,drawnIndependently:!0,allowedOutsideImage:!0,hasBoundingBox:!0}}};return t}function r(e,o,a){var r={start:t.pixelToCanvas(e,o.handles.start),end:t.pixelToCanvas(e,o.handles.middle)},i=n.lineSegment.distanceToPoint(r,a);return i<25||(r.start=t.pixelToCanvas(e,o.handles.middle),r.end=t.pixelToCanvas(e,o.handles.end),i=n.lineSegment.distanceToPoint(r,a),i<25)}function i(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function s(e,a){var r=o.getToolState(e.currentTarget,c);if(r){var s=a.enabledElement,l=a.canvasContext.canvas.getContext("2d");l.setTransform(1,0,0,1,0,0);for(var u,d=o.toolStyle.getToolWidth(),f=o.textStyle.getFont(),m=o.simpleAngle.getConfiguration(),h=0;h<r.data.length;h++){l.save(),m&&m.shadow&&(l.shadowColor=m.shadowColor||"#000000",l.shadowOffsetX=m.shadowOffsetX||1,l.shadowOffsetY=m.shadowOffsetY||1);var g=r.data[h];u=g.active?o.toolColors.getActiveColor():o.toolColors.getToolColor();var p=t.pixelToCanvas(a.element,g.handles.start),v=t.pixelToCanvas(a.element,g.handles.middle),y=t.pixelToCanvas(a.element,g.handles.end);l.beginPath(),l.strokeStyle=u,l.lineWidth=d,l.moveTo(p.x,p.y),l.lineTo(v.x,v.y),l.lineTo(y.x,y.y),l.stroke();var T={drawHandlesIfActive:m&&m.drawHandlesOnHover};o.drawHandles(l,a,g.handles,u,T),l.fillStyle=u;var x=a.image.columnPixelSpacing||1,w=a.image.rowPixelSpacing||1,C="";a.image.rowPixelSpacing&&a.image.columnPixelSpacing||(C=" (isotropic)");var b={x:(Math.ceil(g.handles.middle.x)-Math.ceil(g.handles.start.x))*x,y:(Math.ceil(g.handles.middle.y)-Math.ceil(g.handles.start.y))*w},P={x:(Math.ceil(g.handles.end.x)-Math.ceil(g.handles.middle.x))*x,y:(Math.ceil(g.handles.end.y)-Math.ceil(g.handles.middle.y))*w},I={x:(Math.ceil(g.handles.end.x)-Math.ceil(g.handles.start.x))*x,y:(Math.ceil(g.handles.end.y)-Math.ceil(g.handles.start.y))*w},M=i(b),S=i(P),D=i(I),k=Math.acos((Math.pow(M,2)+Math.pow(S,2)-Math.pow(D,2))/(2*M*S));k*=180/Math.PI;var E=o.roundToDecimal(k,2);if(E){var A="00B0",R=E.toString()+String.fromCharCode(parseInt(A,16))+C,L=15,B;if(g.handles.textBox.hasMoved)B=t.pixelToCanvas(a.element,g.handles.textBox);else{B={x:v.x,y:v.y},l.font=f;var O=l.measureText(R).width;v.x<p.x?B.x-=L+O+10:B.x+=L;var F=t.internal.getTransform(s);F.invert();var U=F.transformPoint(B.x,B.y);g.handles.textBox.x=U.x,g.handles.textBox.y=U.y}var V={centering:{x:!1,y:!0}},z=o.drawTextBox(l,R,B.x,B.y,u,V);if(g.handles.textBox.boundingBox=z,g.handles.textBox.hasMoved){var H={start:{},end:{}},N=[p,y,v];H.end.x=B.x,H.end.y=B.y,H.start=n.point.findClosestPoint(N,H.end);var _=[{x:z.left+z.width/2,y:z.top},{x:z.left,y:z.top+z.height/2},{x:z.left+z.width/2,y:z.top+z.height},{x:z.left+z.width,y:z.top+z.height/2}];H.end=n.point.findClosestPoint(_,H.start),l.beginPath(),l.strokeStyle=u,l.lineWidth=d,l.setLineDash([2,3]),l.moveTo(H.start.x,H.start.y),l.lineTo(H.end.x,H.end.y),l.stroke()}}l.restore()}}}function l(n){var r=a(n),i=n.element,s={mouseButtonMask:n.which};o.addToolState(i,c,r),e(i).off("CornerstoneToolsMouseMove",o.simpleAngle.mouseMoveCallback),e(i).off("CornerstoneToolsMouseDrag",o.simpleAngle.mouseMoveCallback),e(i).off("CornerstoneToolsMouseDown",o.simpleAngle.mouseDownCallback),e(i).off("CornerstoneToolsMouseDownActivate",o.simpleAngle.mouseDownActivateCallback),t.updateImage(i),o.moveNewHandle(n,c,r,r.handles.middle,function(){return r.active=!1,o.anyHandlesOutsideImage(n,r.handles)?(o.removeToolState(i,c,r),e(i).on("CornerstoneToolsMouseMove",o.simpleAngle.mouseMoveCallback),e(i).on("CornerstoneToolsMouseDrag",o.simpleAngle.mouseMoveCallback),e(i).on("CornerstoneToolsMouseDown",s,o.simpleAngle.mouseDownCallback),e(i).on("CornerstoneToolsMouseDownActivate",s,o.simpleAngle.mouseDownActivateCallback),void t.updateImage(i)):(r.handles.end.active=!0,t.updateImage(i),void o.moveNewHandle(n,c,r,r.handles.end,function(){r.active=!1,o.anyHandlesOutsideImage(n,r.handles)&&o.removeToolState(i,c,r),e(i).on("CornerstoneToolsMouseMove",o.simpleAngle.mouseMoveCallback),e(i).on("CornerstoneToolsMouseDrag",o.simpleAngle.mouseMoveCallback),e(i).on("CornerstoneToolsMouseDown",s,o.simpleAngle.mouseDownCallback),e(i).on("CornerstoneToolsMouseDownActivate",s,o.simpleAngle.mouseDownActivateCallback),t.updateImage(i)}))})}function u(n){var r=a(n),i=n.element;o.addToolState(i,c,r),e(i).off("CornerstoneToolsTouchDrag",o.simpleAngleTouch.touchMoveCallback),e(i).off("CornerstoneToolsTouchStartActive",o.simpleAngleTouch.touchDownActivateCallback),e(i).off("CornerstoneToolsTouchStart",o.simpleAngleTouch.touchStartCallback),e(i).off("CornerstoneToolsTap",o.simpleAngleTouch.tapCallback),t.updateImage(i),o.moveNewHandleTouch(n,c,r,r.handles.middle,function(){return o.anyHandlesOutsideImage(n,r.handles)?(o.removeToolState(i,c,r),e(i).on("CornerstoneToolsTouchDrag",o.simpleAngleTouch.touchMoveCallback),e(i).on("CornerstoneToolsTouchStart",o.simpleAngleTouch.touchStartCallback),e(i).on("CornerstoneToolsTouchStartActive",o.simpleAngleTouch.touchDownActivateCallback),e(i).on("CornerstoneToolsTap",o.simpleAngleTouch.tapCallback),void t.updateImage(i)):void o.moveNewHandleTouch(n,c,r,r.handles.end,function(){o.anyHandlesOutsideImage(n,r.handles)&&(o.removeToolState(i,c,r),t.updateImage(i)),e(i).on("CornerstoneToolsTouchDrag",o.simpleAngleTouch.touchMoveCallback),e(i).on("CornerstoneToolsTouchStart",o.simpleAngleTouch.touchStartCallback),e(i).on("CornerstoneToolsTouchStartActive",o.simpleAngleTouch.touchDownActivateCallback),e(i).on("CornerstoneToolsTap",o.simpleAngleTouch.tapCallback)})})}var c="simpleAngle";o.simpleAngle=o.mouseButtonTool({createNewMeasurement:a,addNewMeasurement:l,onImageRendered:s,pointNearTool:r,toolType:c}),o.simpleAngleTouch=o.touchTool({createNewMeasurement:a,addNewMeasurement:u,onImageRendered:s,pointNearTool:r,toolType:c})}(o,m,h,p),function(e,t,n){"use strict";function o(e){var t=n.textMarker.getConfiguration();if(t.current){var o={visible:!0,active:!0,text:t.current,handles:{end:{x:e.currentPoints.image.x,y:e.currentPoints.image.y,highlight:!0,active:!0,hasBoundingBox:!0}}},a={left:0,top:0,width:e.image.width,height:e.image.height};if(h.point.insideRect(o.handles.end,a)){var r=t.markers.indexOf(t.current);return t.ascending?(r+=1,r>=t.markers.length&&(t.loop?r-=t.markers.length:r=-1)):(r-=1,r<0&&(t.loop?r+=t.markers.length:r=-1)),t.current=t.markers[r],o}}}function a(e,t,o){if(t.handles.end.boundingBox){var a=h.rect.distanceToPoint(t.handles.end.boundingBox,o),r=n.pointInsideBoundingBox(t.handles.end,o);return a<10||r}}function r(e,o){var a=n.getToolState(o.element,l);if(a){var r=o.canvasContext.canvas.getContext("2d");r.setTransform(1,0,0,1,0,0);for(var i=n.textMarker.getConfiguration(),s=0;s<a.data.length;s++){var u=a.data[s],c=n.toolColors.getToolColor();u.active&&(c=n.toolColors.getActiveColor()),r.save(),i&&i.shadow&&(r.shadowColor=i.shadowColor||"#000000",r.shadowOffsetX=i.shadowOffsetX||1,r.shadowOffsetY=i.shadowOffsetY||1),r.fillStyle=c;var d=r.measureText(u.text);u.textWidth=d.width+10;var f=t.pixelToCanvas(o.element,u.handles.end),m={centering:{x:!0,y:!0}},h=n.drawTextBox(r,u.text,f.x,f.y-10,c,m);u.handles.end.boundingBox=h,r.restore()}}}function i(o,r){function i(a,r,i){i===!0?n.removeToolState(s,l,a):a.text=r,a.active=!1,t.updateImage(s);var u={mouseButtonMask:o.data.mouseButtonMask};e(s).on("CornerstoneToolsMouseMove",u,n.textMarker.mouseMoveCallback),e(s).on("CornerstoneToolsMouseDown",u,n.textMarker.mouseDownCallback),e(s).on("CornerstoneToolsMouseDownActivate",u,n.textMarker.mouseDownActivateCallback),e(s).on("CornerstoneToolsMouseDoubleClick",u,n.textMarker.mouseDoubleClickCallback)}var s=r.element,u;if(!o.data||!o.data.mouseButtonMask||n.isMouseButtonEnabled(r.which,o.data.mouseButtonMask)){var c=n.textMarker.getConfiguration(),d=r.currentPoints.canvas,f=n.getToolState(s,l);if(f){for(var m=0;m<f.data.length;m++)if(u=f.data[m],a(s,u,d))return u.active=!0,t.updateImage(s),e(s).off("CornerstoneToolsMouseMove",n.textMarker.mouseMoveCallback),e(s).off("CornerstoneToolsMouseDown",n.textMarker.mouseDownCallback),e(s).off("CornerstoneToolsMouseDownActivate",n.textMarker.mouseDownActivateCallback),e(s).off("CornerstoneToolsMouseDoubleClick",n.textMarker.mouseDoubleClickCallback),c.changeTextCallback(u,r,i),o.stopImmediatePropagation(),!1;return!1}}}function s(o,r){function i(o,a,r){r===!0?n.removeToolState(s,l,o):o.text=a,o.active=!1,t.updateImage(s),e(s).on("CornerstoneToolsTouchDrag",n.textMarkerTouch.touchMoveCallback),e(s).on("CornerstoneToolsTouchStartActive",n.textMarkerTouch.touchDownActivateCallback),e(s).on("CornerstoneToolsTouchStart",n.textMarkerTouch.touchStartCallback),e(s).on("CornerstoneToolsTap",n.textMarkerTouch.tapCallback),e(s).on("CornerstoneToolsTouchPress",n.textMarkerTouch.pressCallback)}var s=r.element,u,c=n.textMarker.getConfiguration(),d=r.currentPoints.canvas,f=n.getToolState(s,l);if(!f)return!1;if(r.handlePressed)return r.handlePressed.active=!0,t.updateImage(s),e(s).off("CornerstoneToolsTouchDrag",n.textMarkerTouch.touchMoveCallback),e(s).off("CornerstoneToolsTouchStartActive",n.textMarkerTouch.touchDownActivateCallback),e(s).off("CornerstoneToolsTouchStart",n.textMarkerTouch.touchStartCallback),e(s).off("CornerstoneToolsTap",n.textMarkerTouch.tapCallback),e(s).off("CornerstoneToolsTouchPress",n.textMarkerTouch.pressCallback),c.changeTextCallback(r.handlePressed,r,i),o.stopImmediatePropagation(),!1;for(var m=0;m<f.data.length;m++)if(u=f.data[m],a(s,u,d))return u.active=!0,t.updateImage(s),e(s).off("CornerstoneToolsTouchDrag",n.textMarkerTouch.touchMoveCallback),e(s).off("CornerstoneToolsTouchStartActive",n.textMarkerTouch.touchDownActivateCallback),e(s).off("CornerstoneToolsTouchStart",n.textMarkerTouch.touchStartCallback),e(s).off("CornerstoneToolsTap",n.textMarkerTouch.tapCallback),e(s).off("CornerstoneToolsTouchPress",n.textMarkerTouch.pressCallback),c.changeTextCallback(u,r,i),o.stopImmediatePropagation(),!1;return!1}var l="textMarker";n.textMarker=n.mouseButtonTool({createNewMeasurement:o,onImageRendered:r,pointNearTool:a,toolType:l,mouseDoubleClickCallback:i}),n.textMarkerTouch=n.touchTool({createNewMeasurement:o,onImageRendered:r,pointNearTool:a,toolType:l,pressCallback:s})}(o,m,p),function(e,t,n){"use strict";function o(t,n){e(n.element).off("CornerstoneToolsMouseDrag",i),e(n.element).off("CornerstoneToolsMouseUp",o),e(n.element).off("CornerstoneToolsMouseClick",o)}function a(t,a){if(n.isMouseButtonEnabled(a.which,t.data.mouseButtonMask))return e(a.element).on("CornerstoneToolsMouseDrag",i),e(a.element).on("CornerstoneToolsMouseUp",o),e(a.element).on("CornerstoneToolsMouseClick",o),!1}function r(e){var t=e.image.maxPixelValue*e.image.slope+e.image.intercept,n=e.image.minPixelValue*e.image.slope+e.image.intercept,o=t-n,a=o/1024,r=e.deltaPoints.page.x*a,i=e.deltaPoints.page.y*a;e.viewport.voi.windowWidth+=r,e.viewport.voi.windowCenter+=i}function i(e,o){return n.wwwc.strategy(o),t.setViewport(o.element,o.viewport),!1}function s(e,o){e.stopImmediatePropagation();var a=o,r=a.image.maxPixelValue*a.image.slope+a.image.intercept,i=a.image.minPixelValue*a.image.slope+a.image.intercept,s=r-i,l=s/1024,u=a.deltaPoints.page.x*l,c=a.deltaPoints.page.y*l,d=n.wwwc.getConfiguration();d.orientation?0===d.orientation?(a.viewport.voi.windowWidth+=u,a.viewport.voi.windowCenter+=c):(a.viewport.voi.windowWidth+=c,a.viewport.voi.windowCenter+=u):(a.viewport.voi.windowWidth+=u,a.viewport.voi.windowCenter+=c),t.setViewport(a.element,a.viewport)}n.wwwc=n.simpleMouseButtonTool(a),n.wwwc.strategies={default:r},n.wwwc.strategy=r,n.wwwcTouchDrag=n.touchDragTool(s)}(o,m,p),function(e,t,n,o){"use strict";function a(e,t,n){var o=e.length;if(o<2)return{min:t,max:n,mean:(t+n)/2};for(var a=n,r=t,i=0,s=0;s<o;s++){var l=e[s];a=Math.min(a,l),r=Math.max(r,l),i+=l}return{min:a,max:r,mean:i/o}}function r(t,n){var a=o.getToolState(n.element,T);a&&a.data&&(a.data=[]),e(n.element).off("CornerstoneToolsMouseMove",d),e(n.element).off("CornerstoneToolsMouseDrag",d),e(n.element).off("CornerstoneToolsMouseUp",i),e(n.element).off("CornerstoneToolsMouseClick",i);var r={mouseButtonMask:w};e(n.element).on("CornerstoneToolsMouseDown",r,u)}function i(t,n){e(n.element).off("CornerstoneToolsMouseMove",d),e(n.element).off("CornerstoneToolsMouseDrag",d),e(n.element).off("CornerstoneToolsMouseUp",i),e(n.element).off("CornerstoneToolsMouseClick",i);var a={mouseButtonMask:w};e(n.element).on("CornerstoneToolsMouseDown",a,u);var r=o.getToolState(n.element,T);r&&r.data&&r.data.length&&(r.data[0].endPoint={x:n.currentPoints.image.x,y:n.currentPoints.image.y},s(n))}function s(e){var n=o.getToolState(e.element,T);if(n&&n.data&&n.data.length){var r=n.data[0].startPoint,i=n.data[0].endPoint,s=Math.abs(r.x-i.x),l=Math.abs(r.y-i.y),u=Math.min(r.x,i.x),c=Math.min(r.y,i.y);u=Math.max(u,0),u=Math.min(u,e.image.width),c=Math.max(c,0),c=Math.min(c,e.image.height),s=Math.floor(Math.min(s,Math.abs(e.image.width-u))),l=Math.floor(Math.min(l,Math.abs(e.image.height-c)));var d=o.getLuminance(e.element,u,c,s,l),f=a(d,e.image.minPixelValue,e.image.maxPixelValue),m=o.wwwcRegion.getConfiguration(),h=t.getViewport(e.element);void 0===m.minWindowWidth&&(m.minWindowWidth=10),h.voi.windowWidth=Math.max(Math.abs(f.max-f.min),m.minWindowWidth),h.voi.windowCenter=f.mean,t.setViewport(e.element,h),n.data=[],t.updateImage(e.element)}}function l(t,n){var o=n.element;e(o).off("CornerstoneToolsMouseMove"),e(o).off("CornerstoneToolsMouseDrag"),e(o).on("CornerstoneToolsMouseMove",d),e(o).on("CornerstoneToolsMouseDrag",d),e(o).on("CornerstoneToolsMouseClick",i),"CornerstoneToolsMouseDrag"===t.type&&e(o).on("CornerstoneToolsMouseUp",i)}function u(t,n){if(o.isMouseButtonEnabled(n.which,t.data.mouseButtonMask))return e(n.element).on("CornerstoneToolsMouseDrag",n,l),e(n.element).on("CornerstoneToolsMouseMove",n,l),e(n.element).off("CornerstoneToolsMouseDown",u),c(n),!1}function c(e){var t=o.getToolState(e.element,T);t&&t.data&&(t.data=[]);var n={startPoint:{x:e.currentPoints.image.x,y:e.currentPoints.image.y}};o.addToolState(e.element,T,n)}function d(e,n){var a=o.getToolState(n.element,T);if(a&&a.data&&a.data.length){var r={x:n.currentPoints.image.x,y:n.currentPoints.image.y};a.data[0].endPoint=r,t.updateImage(n.element)}}function f(n,a){var r=o.getToolState(a.element,T);if(r&&r.data&&r.data.length){var i=r.data[0].startPoint,s=r.data[0].endPoint;if(i&&s){var l=e(a.element).find("canvas").get(0),u=l.getContext("2d");u.setTransform(1,0,0,1,0,0);var c=o.toolColors.getActiveColor(),d=t.pixelToCanvas(a.element,i),f=t.pixelToCanvas(a.element,s),m=Math.min(d.x,f.x),h=Math.min(d.y,f.y),g=Math.abs(d.x-f.x),p=Math.abs(d.y-f.y),v=o.toolStyle.getToolWidth(),y=o.wwwcRegion.getConfiguration();u.save(),y&&y.shadow&&(u.shadowColor=y.shadowColor||"#000000",u.shadowOffsetX=y.shadowOffsetX||1,u.shadowOffsetY=y.shadowOffsetY||1),u.beginPath(),u.strokeStyle=c,u.lineWidth=v,u.rect(m,h,g,p),u.stroke(),u.restore()}}}function m(n){e(n).off("CornerstoneToolsMouseDown",u),e(n).off("CornerstoneToolsMouseUp",i),e(n).off("CornerstoneToolsMouseClick",i),e(n).off("CornerstoneToolsMouseDrag",d),e(n).off("CornerstoneToolsMouseMove",d),e(n).off("CornerstoneImageRendered",f),e(n).off("CornerstoneNewImage",r),t.updateImage(n)}function h(n,a){var s={mouseButtonMask:a};w=a;var l=o.getToolState(n,T);if(!l){var c=[];o.addToolState(n,T,c)}e(n).off("CornerstoneToolsMouseDown",u),e(n).off("CornerstoneToolsMouseUp",i),e(n).off("CornerstoneToolsMouseClick",i),e(n).off("CornerstoneToolsMouseDrag",d),e(n).off("CornerstoneToolsMouseMove",d),e(n).off("CornerstoneImageRendered",f),e(n).off("CornerstoneNewImage",r),e(n).on("CornerstoneToolsMouseDown",s,u),e(n).on("CornerstoneImageRendered",f),e(n).on("CornerstoneNewImage",r),t.updateImage(n)}function g(t){e(t).off("CornerstoneToolsTouchDrag",d),e(t).off("CornerstoneToolsTouchStart",c),e(t).off("CornerstoneToolsDragEnd",s),e(t).off("CornerstoneImageRendered",f)}function p(t){var n=o.getToolState(t,T);if(!n){var a=[];o.addToolState(t,T,a)}e(t).off("CornerstoneToolsTouchDrag",d),e(t).off("CornerstoneToolsTouchStart",c),e(t).off("CornerstoneToolsDragEnd",s),e(t).off("CornerstoneImageRendered",f),e(t).on("CornerstoneToolsTouchDrag",d),e(t).on("CornerstoneToolsTouchStart",c),e(t).on("CornerstoneToolsDragEnd",s),e(t).on("CornerstoneImageRendered",f)}function v(){return x}function y(e){x=e}var T="wwwcRegion",x={minWindowWidth:10},w;o.wwwcRegion={activate:h,deactivate:m,disable:m,setConfiguration:y,getConfiguration:v},o.wwwcRegionTouch={activate:p,deactivate:g,disable:g}}(o,m,h,p),function(e,t,n){"use strict";function o(e,t){var o=n.zoom.getConfiguration(),a=1.7,r=Math.log(e.scale)/Math.log(a),i=r+t,s=Math.pow(a,i);return o.maxScale&&s>o.maxScale?e.scale=o.maxScale:o.minScale&&s<o.minScale?e.scale=o.minScale:e.scale=s,e}function a(e,t,n){return e.x=Math.max(e.x,0),e.y=Math.max(e.y,0),e.x=Math.min(e.x,t),e.y=Math.min(e.y,n),e}function r(e,t){if(t.hflip&&(e.x*=-1),t.vflip&&(e.y*=-1),0!==t.rotation){var n=t.rotation*Math.PI/180,o=Math.cos(n),a=Math.sin(n),r=e.x*o-e.y*a,i=e.x*a+e.y*o;e.x=r,e.y=i}return e}function i(e,n){var a=e.element,i=o(e.viewport,n);t.setViewport(a,i);var s=t.pageToPixel(a,e.startPoints.page.x,e.startPoints.page.y),l={x:e.startPoints.image.x-s.x,y:e.startPoints.image.y-s.y};l=r(l,i),i.translation.x-=l.x,i.translation.y-=l.y,t.setViewport(a,i)}function s(e,i){var s=e.element,l=e.image,u=n.zoom.getConfiguration(),c=o(e.viewport,i),d={x:0,y:0},f=8,m=3,g=.01;if(i<0)c.scale<m&&(Math.abs(c.translation.x)<g?c.translation.x=0:d.x=c.translation.x/f,Math.abs(c.translation.y)<g?c.translation.y=0:d.y=c.translation.y/f);else{u&&u.preventZoomOutsideImage&&(h.image=a(h.image,l.width,l.height));var p={x:l.width/2-h.image.x,y:l.height/2-h.image.y};p=r(p,c);var v={x:c.translation.x-p.x,y:c.translation.y-p.y};Math.abs(v.x)<g?c.translation.x=p.x:d.x=v.x/f,Math.abs(v.y)<g?c.translation.y=p.y:d.y=v.y/f}c.translation.x-=d.x,c.translation.y-=d.y,t.setViewport(s,c)}function l(e,n){var a=e.element,r=o(e.viewport,n);t.setViewport(a,r)}function u(t,n){e(n.element).off("CornerstoneToolsMouseDrag",d),e(n.element).off("CornerstoneToolsMouseUp",u),e(n.element).off("CornerstoneToolsMouseClick",u)}function c(t,o){if(n.isMouseButtonEnabled(o.which,t.data.mouseButtonMask))return h=o.startPoints,e(o.element).on("CornerstoneToolsMouseDrag",d),e(o.element).on("CornerstoneToolsMouseUp",u),e(o.element).on("CornerstoneToolsMouseClick",u),!1}function d(e,t){if(!t.deltaPoints.page.y)return!1;var o=t.deltaPoints.page.y/100;return n.zoom.strategy(t,o),!1}function f(e,a){var r=-a.direction/4,i=n.zoom.getConfiguration();i&&i.invert&&(r*=-1);var s=o(a.viewport,r);t.setViewport(a.element,s)}function m(e,o){var a=n.zoom.getConfiguration(),i=o.viewport,s=o.element;i.scale+=o.scaleChange*i.scale,a.maxScale&&i.scale>a.maxScale?i.scale=a.maxScale:a.minScale&&i.scale<a.minScale&&(i.scale=a.minScale),
t.setViewport(s,i);var l=t.pageToPixel(s,o.startPoints.page.x,o.startPoints.page.y),u={x:o.startPoints.image.x-l.x,y:o.startPoints.image.y-l.y};u=r(u,i),i.translation.x-=u.x,i.translation.y-=u.y,t.setViewport(s,i)}var h;n.zoom=n.simpleMouseButtonTool(c),n.zoom.strategies={default:i,translate:s,zoomToCenter:l},n.zoom.strategy=i,n.zoomWheel=n.mouseWheelTool(f),n.zoomTouchPinch=n.touchPinchTool(m),n.zoomTouchDrag=n.touchDragTool(d)}(o,m,p),function(e,t,n){"use strict";function o(n){var o=n.currentTarget,a={event:window.event||n,element:o,viewport:t.getViewport(o),image:t.getEnabledElement(o).image,currentPoints:{page:{x:s,y:l},image:t.pageToPixel(o,s,l)},keyCode:n.keyCode,which:n.which};a.currentPoints.canvas=t.pixelToCanvas(o,a.currentPoints.image);var r={keydown:"CornerstoneToolsKeyDown",keypress:"CornerstoneToolsKeyPress",keyup:"CornerstoneToolsKeyUp"};e(o).trigger(r[n.type],a)}function a(e){s=e.pageX||e.originalEvent.pageX,l=e.pageY||e.originalEvent.pageY}function r(t){i(t),e(t).on(u,o),e(t).on("mousemove",a)}function i(t){e(t).off(u,o),e(t).off("mousemove",a)}var s,l,u="keydown keypress keyup";n.keyboardInput={enable:r,disable:i}}(o,m,p),function(e){"use strict";function t(e,t){var n=Date.now();if(e!==l){if(n-u<=i)return t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),!1;l=e}u=n}function n(e,t,n){var o=n?c:d;t.forEach(function(t){e.addEventListener(t,o,!0)})}function o(e,t,n){var o=n?c:d;t.forEach(function(t){e.removeEventListener(t,o,!0)})}function a(e){o(e,f,s.mouse),o(e,m,s.touch)}function r(e){a(e),n(e,f,s.mouse),n(e,m,s.touch)}var i=2e3,s={mouse:0,touch:1},l,u,c=t.bind(null,s.mouse),d=t.bind(null,s.touch),f=["mousedown","mouseup"],m=["touchstart","touchend"];e.preventGhostClick={enable:r,disable:a}}(p),function(e,t,n,o){"use strict";function a(e,t){var o=e.image,a={left:0,top:0,width:o.width,height:o.height},r=!1;return Object.keys(t).forEach(function(e){var o=t[e];o.allowedOutsideImage!==!0&&n.point.insideRect(o,a)===!1&&(r=!0)}),r}o.anyHandlesOutsideImage=a}(o,m,h,p),function(e,t){"use strict";function n(n,a,r,i,s){n.strokeStyle=i,Object.keys(r).forEach(function(i){var l=r[i];if(l.drawnIndependently!==!0&&(!s||s.drawHandlesIfActive!==!0||l.active)){n.beginPath(),l.active?n.lineWidth=t.toolStyle.getActiveWidth():n.lineWidth=t.toolStyle.getToolWidth();var u=e.pixelToCanvas(a.element,l);n.arc(u.x,u.y,o,0,2*Math.PI),s&&s.fill&&(n.fillStyle=s.fill,n.fill()),n.stroke()}})}var o=6;t.drawHandles=n}(m,p),function(e,t,n,o){"use strict";function a(e,a,r,i){var s;if(a)return Object.keys(a).forEach(function(l){var u=a[l];if(u.hasOwnProperty("pointNearHandle")){if(u.pointNearHandle(e,u,r))return void(s=u)}else if(u.hasBoundingBox===!0){if(o.pointInsideBoundingBox(u,r))return void(s=u)}else{var c=t.pixelToCanvas(e,u),d=n.point.distance(c,r);if(d<=i)return void(s=u)}}),s}o.getHandleNearImagePoint=a}(o,m,h,p),function(e,t,n,o){"use strict";function a(e){var t;return Object.keys(e).forEach(function(n){var o=e[n];if(o.active===!0)return void(t=o)}),t}function r(e,t,n,r){r||(r=6);var i=a(t),s=o.getHandleNearImagePoint(e,t,n,r);return i!==s&&(void 0!==s&&(s.active=!0),void 0!==i&&(i.active=!1),!0)}o.handleActivator=r}(o,m,h,p),function(e,t,n,o){"use strict";function a(n,a,r,i,s,l){function u(n,o){a.active=!0,Object.keys(a.handles).forEach(function(e){var t=a.handles[e];t.movesIndependently!==!0&&(t.x+=o.deltaPoints.image.x,t.y+=o.deltaPoints.image.y,s.preventHandleOutsideImage===!0&&(t.x=Math.max(t.x,0),t.x=Math.min(t.x,o.image.width),t.y=Math.max(t.y,0),t.y=Math.min(t.y,o.image.height)))}),t.updateImage(d);var r="CornerstoneToolsMeasurementModified",l={toolType:i,element:d,measurementData:a};return e(d).trigger(r,l),!1}function c(n,r){a.invalidated=!0,e(d).off("CornerstoneToolsMouseDrag",u),e(d).off("CornerstoneToolsMouseUp",c),e(d).off("CornerstoneToolsMouseClick",c),s.deleteIfHandleOutsideImage===!0&&o.anyHandlesOutsideImage(r,a.handles)&&o.removeToolState(d,i,a),t.updateImage(d),"function"==typeof l&&l()}var d=n.element;return e(d).on("CornerstoneToolsMouseDrag",u),e(d).on("CornerstoneToolsMouseUp",c),e(d).on("CornerstoneToolsMouseClick",c),!0}o.moveAllHandles=a}(o,m,h,p),function(e,t,n){"use strict";function o(n,o,a,r,i,s){function l(n,i){r.hasMoved===!1&&(r.hasMoved=!0),r.active=!0,r.x=i.currentPoints.image.x+d.x,r.y=i.currentPoints.image.y+d.y,s&&(r.x=Math.max(r.x,0),r.x=Math.min(r.x,i.image.width),r.y=Math.max(r.y,0),r.y=Math.min(r.y,i.image.height)),t.updateImage(c);var l="CornerstoneToolsMeasurementModified",u={toolType:o,element:c,measurementData:a};e(c).trigger(l,u)}function u(){r.active=!1,e(c).off("CornerstoneToolsMouseDrag",l),e(c).off("CornerstoneToolsMouseUp",u),e(c).off("CornerstoneToolsMouseClick",u),t.updateImage(c),"function"==typeof i&&i()}var c=n.element,d={x:r.x-n.currentPoints.image.x,y:r.y-n.currentPoints.image.y};e(c).on("CornerstoneToolsMouseDrag",l),e(c).on("CornerstoneToolsMouseUp",u),e(c).on("CornerstoneToolsMouseClick",u)}n.moveHandle=o}(o,m,p),function(e,t,n){"use strict";function o(n,o,a,r,i,s){function l(n,i){r.active=!0,r.x=i.currentPoints.image.x,r.y=i.currentPoints.image.y,s&&(r.x=Math.max(r.x,0),r.x=Math.min(r.x,i.image.width),r.y=Math.max(r.y,0),r.y=Math.min(r.y,i.image.height)),t.updateImage(m);var l="CornerstoneToolsMeasurementModified",u={toolType:o,element:m,measurementData:a};e(m).trigger(l,u)}function u(t){e(m).off("CornerstoneToolsMouseMove"),e(m).off("CornerstoneToolsMouseDrag"),e(m).on("CornerstoneToolsMouseMove",l),e(m).on("CornerstoneToolsMouseDrag",l),e(m).on("CornerstoneToolsMouseClick",f),"CornerstoneToolsMouseDrag"===t.type&&e(m).on("CornerstoneToolsMouseUp",f)}function c(e,t){t.measurementData===a&&f()}function d(n,a){a.toolType===o&&(e(m).off("CornerstoneToolsMouseMove",l),e(m).off("CornerstoneToolsMouseDrag",l),e(m).off("CornerstoneToolsMouseClick",f),e(m).off("CornerstoneToolsMouseUp",f),e(m).off("CornerstoneToolsMeasurementRemoved",c),e(m).off("CornerstoneToolsToolDeactivated",d),r.active=!1,t.updateImage(m))}function f(){e(m).off("CornerstoneToolsMouseMove",l),e(m).off("CornerstoneToolsMouseDrag",l),e(m).off("CornerstoneToolsMouseClick",f),e(m).off("CornerstoneToolsMouseUp",f),e(m).off("CornerstoneToolsMeasurementRemoved",c),e(m).off("CornerstoneToolsToolDeactivated",d),r.active=!1,t.updateImage(m),"function"==typeof i&&i()}var m=n.element;e(m).on("CornerstoneToolsMouseDrag",u),e(m).on("CornerstoneToolsMouseMove",u),e(m).on("CornerstoneToolsMeasurementRemoved",c),e(m).on("CornerstoneToolsToolDeactivated",d)}n.moveNewHandle=o}(o,m,p),function(e,t,n){"use strict";function o(n,o,a,r,i,s){function l(n,i){r.x=i.currentPoints.image.x+h.x,r.y=i.currentPoints.image.y+h.y,s&&(r.x=Math.max(r.x,0),r.x=Math.min(r.x,i.image.width),r.y=Math.max(r.y,0),r.y=Math.min(r.y,i.image.height)),t.updateImage(f);var l="CornerstoneToolsMeasurementModified",u={toolType:o,element:f,measurementData:a};e(f).trigger(l,u)}function u(n,o){return e(f).off("CornerstoneToolsTouchDrag",l),e(f).off("CornerstoneToolsTouchPinch",u),e(f).off("CornerstoneToolsTouchEnd",u),e(f).off("CornerstoneToolsTap",u),e(f).off("CornerstoneToolsTouchStart",c),e(f).off("CornerstoneToolsToolDeactivated",d),"CornerstoneToolsTouchPinch"===n.type||"CornerstoneToolsTouchPress"===n.type?(r.active=!1,t.updateImage(f),void i()):(r.active=!1,a.active=!1,r.x=o.currentPoints.image.x+h.x,r.y=o.currentPoints.image.y+h.y,s&&(r.x=Math.max(r.x,0),r.x=Math.min(r.x,o.image.width),r.y=Math.max(r.y,0),r.y=Math.min(r.y,o.image.height)),t.updateImage(f),void("function"==typeof i&&i()))}function c(e){return e.stopImmediatePropagation(),!1}function d(){e(f).off("CornerstoneToolsTouchDrag",l),e(f).off("CornerstoneToolsTouchPinch",u),e(f).off("CornerstoneToolsTouchEnd",u),e(f).off("CornerstoneToolsTap",u),e(f).off("CornerstoneToolsTouchStart",c),e(f).off("CornerstoneToolsToolDeactivated",d),r.active=!1,a.active=!1,r.x=n.currentPoints.image.x+h.x,r.y=n.currentPoints.image.y+h.y,s&&(r.x=Math.max(r.x,0),r.x=Math.min(r.x,n.image.width),r.y=Math.max(r.y,0),r.y=Math.min(r.y,n.image.height)),t.updateImage(f)}var f=n.element,m=t.pageToPixel(f,n.currentPoints.page.x,n.currentPoints.page.y+50),h={x:r.x-m.x,y:r.y-m.y};r.active=!0,a.active=!0,e(f).on("CornerstoneToolsTouchDrag",l),e(f).on("CornerstoneToolsTouchPinch",u),e(f).on("CornerstoneToolsTouchEnd",u),e(f).on("CornerstoneToolsTap",u),e(f).on("CornerstoneToolsTouchStart",c),e(f).on("CornerstoneToolsToolDeactivated",d)}n.moveNewHandleTouch=o}(o,m,p),function(e,t,n,o){"use strict";function a(n,a,r,i,s,l){function u(n,o){a.active=!0,Object.keys(a.handles).forEach(function(e){var t=a.handles[e];t.movesIndependently!==!0&&(t.x+=o.deltaPoints.image.x,t.y+=o.deltaPoints.image.y)}),t.updateImage(d);var r="CornerstoneToolsMeasurementModified",s={toolType:i,element:d,measurementData:a};return e(d).trigger(r,s),!1}function c(n,r){a.active=!1,a.invalidated=!1,e(d).off("CornerstoneToolsTouchDrag",u),e(d).off("CornerstoneToolsTouchPinch",c),e(d).off("CornerstoneToolsTouchPress",c),e(d).off("CornerstoneToolsTouchEnd",c),e(d).off("CornerstoneToolsDragEnd",c),e(d).off("CornerstoneToolsTap",c),s===!0&&o.anyHandlesOutsideImage(r,a.handles)&&o.toolState.removeToolState(d,i,a),t.updateImage(d),"function"==typeof l&&l(n,r)}var d=n.element;return e(d).on("CornerstoneToolsTouchDrag",u),e(d).on("CornerstoneToolsTouchPinch",c),e(d).on("CornerstoneToolsTouchPress",c),e(d).on("CornerstoneToolsTouchEnd",c),e(d).on("CornerstoneToolsDragEnd",c),e(d).on("CornerstoneToolsTap",c),!0}o.touchMoveAllHandles=a}(o,m,h,p),function(e,t,n){"use strict";function o(e,n,a,r,i){if(a.value){var s=(new Date).getTime(),l=Math.abs(n.y-i.y),u=l/10;if(console.log("distanceRemaining: "+l),l<1)return n.y=i.y,void(a.value=!1);n.y>i.y?n.y-=u:n.y<i.y&&(n.y+=u),t.updateImage(r.element),t.requestAnimationFrame(function(){o(s,n,a,r,i)})}}function a(n,a,s,l,u){function c(n,o){r.value=!1,l.hasMoved===!1&&(l.hasMoved=!0),l.active=!0;var i=o.currentPoints,u={x:i.page.x,y:i.page.y+g};v=t.pageToPixel(f,u.x,u.y),l.x=v.x,l.y=v.y,t.updateImage(f);var c="CornerstoneToolsMeasurementModified",d={toolType:a,element:f,measurementData:s};e(f).trigger(c,d)}function d(o,a){r.value=!1,l.active=!1,e(f).off("CornerstoneToolsTouchDrag",c),e(f).off(i,d),t.updateImage(f),"CornerstoneToolsTouchPress"===o.type&&(a.handlePressed=s,l.x=n.currentPoints.image.x,l.y=n.currentPoints.image.y),"function"==typeof u&&u(o,a)}r.value=!0;var f=n.element,m=t.getEnabledElement(f),h=(new Date).getTime(),g=-57,p={x:n.currentPoints.page.x,y:n.currentPoints.page.y+g},v=t.pageToPixel(f,p.x,p.y);e(f).on("CornerstoneToolsTouchDrag",c),e(f).on(i,d),o(h,l,r,m,v)}var r={value:!1},i=["CornerstoneToolsTouchEnd","CornerstoneToolsDragEnd","CornerstoneToolsTouchPinch","CornerstoneToolsTouchPress","CornerstoneToolsTap"].join(" ");n.touchMoveHandle=a}(o,m,p),function(e,t){"use strict";function n(){var t=this;t.samples=[],this.set=function(n){t.samples=n,e(t).trigger("CornerstoneLineSampleUpdated")}}t.LineSampleMeasurement=n}(o,p),function(e,t){"use strict";function n(){var t=this;t.measurements=[],this.add=function(n){var o=t.measurements.push(n),a={index:o,measurement:n};e(t).trigger("CornerstoneMeasurementAdded",a)},this.remove=function(n){var o=t.measurements[n];t.measurements.splice(n,1);var a={index:n,measurement:o};e(t).trigger("CornerstoneMeasurementRemoved",a)}}t.MeasurementManager=new n}(o,p),function(e,t,n){"use strict";n.metaData=t.metaData}(o,m,p),function(e,t){"use strict";function n(t){for(var n="",o=t.x<0?"R":"L",a=t.y<0?"A":"P",r=t.z<0?"F":"H",i=new e.Vector3(Math.abs(t.x),Math.abs(t.y),Math.abs(t.z)),s=0;s<3;s++)if(i.x>1e-4&&i.x>i.y&&i.x>i.z)n+=o,i.x=0;else if(i.y>1e-4&&i.y>i.x&&i.y>i.z)n+=a,i.y=0;else{if(!(i.z>1e-4&&i.z>i.x&&i.z>i.y))break;n+=r,i.z=0}return n}t.orientation.getOrientationString=n}(h,p),function(e){"use strict";function t(e){var t=e.replace("H","f");return t=t.replace("F","h"),t=t.replace("R","l"),t=t.replace("L","r"),t=t.replace("A","p"),t=t.replace("P","a"),t=t.toUpperCase()}e.orientation.invertOrientationString=t}(p),function(e){"use strict";function t(t,n){var o=e.planePlaneIntersection(t,n);if(o)return{start:e.projectPatientPointToImagePlane(o.start,t),end:e.projectPatientPointToImagePlane(o.end,t)}}e.referenceLines.calculateReferenceLine=t}(p),function(e,t,n){"use strict";function o(o,a){var r=n.getToolState(o.currentTarget,i);if(void 0!==r){var s=r.data[0].synchronizationContext,l=s.getSourceElements(),u=r.data[0].renderer,c=a.canvasContext.canvas.getContext("2d");t.setToPixelCoordinateSystem(a.enabledElement,c),e.each(l,function(e,t){t!==o.currentTarget&&u(c,a,o.currentTarget,t)})}}function a(a,r,s){s=s||n.referenceLines.renderActiveReferenceLine,n.addToolState(a,i,{synchronizationContext:r,renderer:s}),e(a).on("CornerstoneImageRendered",o),t.updateImage(a)}function r(n){e(n).off("CornerstoneImageRendered",o),t.updateImage(n)}var i="referenceLines";n.referenceLines.tool={enable:a,disable:r}}(o,m,p),function(e,t,n){"use strict";function o(e,o,a,r){var i=t.getEnabledElement(a).image,s=t.getEnabledElement(r).image;if(i&&s){var l=n.metaData.get("imagePlane",i.imageId),u=n.metaData.get("imagePlane",s.imageId);if(l&&u&&l.rowCosines&&l.columnCosines&&l.imagePositionPatient&&u.rowCosines&&u.columnCosines&&u.imagePositionPatient&&l.frameOfReferenceUID===u.frameOfReferenceUID){var c=l.rowCosines.clone().cross(l.columnCosines),d=u.rowCosines.clone().cross(u.columnCosines),f=c.angleTo(d);if(f=Math.abs(f),!(f<.5)){var m=n.referenceLines.calculateReferenceLine(l,u);if(m){var h=t.pixelToCanvas(o.element,m.start),g=t.pixelToCanvas(o.element,m.end),p=n.toolColors.getActiveColor(),v=n.toolStyle.getToolWidth();e.setTransform(1,0,0,1,0,0),e.save(),e.beginPath(),e.strokeStyle=p,e.lineWidth=v,e.moveTo(h.x,h.y),e.lineTo(g.x,g.y),e.stroke(),e.restore()}}}}}n.referenceLines.renderActiveReferenceLine=o}(o,m,p),function(e,t){"use strict";function n(){function n(t,n,a,r,s,l){if(!o.hasOwnProperty(a))throw"Request type must be one of interaction, thumbnail, or prefetch";if(t&&n){var u={type:a,imageId:n,preventCache:r,doneCallback:s,failCallback:l},c=e.imageCache.getImagePromise(n);if(c)return void c.then(function(e){s(e)},function(e){l(e)});o[a].push(u),"interaction"===a&&(i=t)}}function u(e){if(!o.hasOwnProperty(e))throw"Request type must be one of interaction, thumbnail, or prefetch";o[e]=[]}function c(){s&&setTimeout(function(){f()},l)}function d(t){function n(e){return"prefetch"===e.type?-5:"interactive"===e.type?0:"thumbnail"===e.type?5:void 0}var o=t.type;a[o]++,s=!0;var r=t.imageId,i=t.doneCallback,l=t.failCallback,u=e.imageCache.getImagePromise(r);if(u)return void u.then(function(e){a[o]--,i(e),c()},function(e){a[o]--,l(e),c()});var d=n(t),f;f=t.preventCache===!0?e.loadImage(r,{priority:d,type:t.type}):e.loadAndCacheImage(r,{priority:d,type:t.type}),f.then(function(e){a[o]--,i(e),c()},function(e){a[o]--,l(e),c()})}function f(){var e=t.getMaxSimultaneousRequests();r={interaction:Math.max(e,1),thumbnail:Math.max(e-2,1),prefetch:Math.max(e-1,1)};for(var n=a.interaction+a.thumbnail+a.prefetch,o=e-n,i=0;i<o;i++){var s=m();s&&d(s)}}function m(){return o.interaction.length&&a.interaction<r.interaction?o.interaction.shift():o.thumbnail.length&&a.thumbnail<r.thumbnail?o.thumbnail.shift():o.prefetch.length&&a.prefetch<r.prefetch?o.prefetch.shift():(o.interaction.length||o.thumbnail.length||o.prefetch.length||(s=!1),!1)}function h(){return o}var g={addRequest:n,clearRequestStack:u,startGrabbing:f,getRequestPool:h};return g}var o={interaction:[],thumbnail:[],prefetch:[]},a={interaction:0,thumbnail:0,prefetch:0},r={interaction:6,thumbnail:6,prefetch:5},i,s=!1,l=20;t.requestPoolManager=n()}(m,p),function(e,t,n){"use strict";function o(e,t){var n,o,a,r=0,i=e.length,s=[];for(s.isTimeVarying=!1,("number"!=typeof t||t<=0)&&(t=1),n=1;n<i;n++)a=+e[n]/t|0,s.push(a),1===n?o=a:a!==o&&(s.isTimeVarying=!0),r+=a;return s.length>0&&(a=s.isTimeVarying?r/s.length|0:s[0],s.push(a)),s}function a(e){var t=e.intervalId;"undefined"!=typeof t&&(e.intervalId=void 0,e.usingFrameTimeVector?clearTimeout(t):clearInterval(t))}function r(t){var n,o={element:t};n=e.Event("CornerstoneToolsClipStopped",o),e(t).trigger(n,o)}function i(e,i){var s,u,c,d,f,m;if(void 0===e)throw"playClip: element must not be undefined";s=n.getToolState(e,"stack"),s&&s.data&&s.data.length&&(u=s.data[0],c=n.getToolState(e,l),c&&c.data&&c.data.length?(d=c.data[0],a(d)):(d={intervalId:void 0,framesPerSecond:30,lastFrameTimeStamp:void 0,frameRate:0,frameTimeVector:void 0,ignoreFrameTimeVector:!1,usingFrameTimeVector:!1,speed:1,reverse:!1,loop:!0},n.addToolState(e,l,d)),(i<0||i>0)&&(d.framesPerSecond=+i,d.reverse=d.framesPerSecond<0,d.ignoreFrameTimeVector=!0),d.ignoreFrameTimeVector!==!0&&d.frameTimeVector&&d.frameTimeVector.length===u.imageIds.length&&(f=o(d.frameTimeVector,d.speed)),m=function o(){var i,s,l,c,f,m=u.currentImageIdIndex,h=u.imageIds.length;return d.reverse?m--:m++,!d.loop&&(m<0||m>=h)?(a(d),void r(e)):(m>=h&&(m=0),m<0&&(m=h-1),void(m!==u.currentImageIdIndex&&(l=n.loadHandlerManager.getStartLoadHandler(),c=n.loadHandlerManager.getEndLoadHandler(),f=n.loadHandlerManager.getErrorLoadingHandler(),l&&l(e),s=t.getViewport(e),i=u.preventCache===!0?t.loadImage(u.imageIds[m]):t.loadAndCacheImage(u.imageIds[m]),i.then(function(n){u.currentImageIdIndex=m,t.displayImage(e,n,s),c&&c(e,n)},function(t){var n=u.imageIds[m];f&&f(e,n,t)}))))},f&&f.length>0&&f.isTimeVarying?(d.usingFrameTimeVector=!0,d.intervalId=setTimeout(function e(){d.intervalId=setTimeout(e,f[u.currentImageIdIndex]),m()},0)):(d.usingFrameTimeVector=!1,d.intervalId=setInterval(m,1e3/Math.abs(d.framesPerSecond))))}function s(e){var t=n.getToolState(e,l);t&&t.data&&t.data.length&&a(t.data[0])}var l="playClip";n.playClip=i,n.stopClip=s}(o,m,p),function(e,t,n){"use strict";function o(e,t){var o=t.element,r=t.enabledElement.canvas.width,i=t.enabledElement.canvas.height;if(!r||!i)return!1;var s=t.enabledElement.canvas.getContext("2d");s.setTransform(1,0,0,1,0,0),s.save();var l=n.scrollIndicator.getConfiguration();s.fillStyle=l.backgroundColor,"horizontal"===l.orientation?s.fillRect(0,i-a,r,a):s.fillRect(0,0,a,i);var u=n.getToolState(o,"stack");if(u&&u.data&&u.data.length){var c=u.data[0].imageIds,d=u.data[0].currentImageIdIndex,f=r/c.length,m=i/c.length,h=f*d,g=m*d;s.fillStyle=l.fillColor,"horizontal"===l.orientation?s.fillRect(h,i-a,f,a):s.fillRect(0,g,a,m),s.restore()}}var a=6,r={backgroundColor:"rgb(19, 63, 141)",fillColor:"white",orientation:"horizontal"};n.scrollIndicator=n.displayTool(o),n.scrollIndicator.setConfiguration(r)}(o,m,p),function(e,t,n){"use strict";function o(e,t){return e-t}function a(e,t){e=Math.round(e)||0,t=Math.round(t)||0;var n=[],o=t-e+1;if(o<=0)return n;for(;o--;)n[o]=t--;return n}function r(e,t){var n=[],o=[];return e.forEach(function(e){e<t?n.push(e):e>t&&o.push(e)}),{low:e.indexOf(y(n)),high:e.indexOf(T(o))}}function i(e){function a(e){var t=d.indicesToRequest.indexOf(e);t>-1&&d.indicesToRequest.splice(t,1)}function i(e){var t=u.imageIds.indexOf(e.imageId);a(t)}function s(t){console.log("prefetch errored: "+t),x&&x(e,v,t,"stackPrefetch")}var l=n.getToolState(e,"stack");if(l&&l.data&&l.data.length){var u=l.data[0],c=n.getToolState(e,m);if(c){var d=c.data[0];if(d&&d.indicesToRequest&&d.indicesToRequest.length||(d.enabled=!1),d.enabled!==!1){c.data[0].indicesToRequest.sort(o);var f=d.indicesToRequest.slice();if(f.forEach(function(e){var n=u.imageIds[e];if(n){var o=t.imageCache.getImagePromise(n);o&&"resolved"===o.state()&&a(e)}}),d.indicesToRequest.length){var g=n.requestPoolManager;g.clearRequestStack(h);for(var p=r(d.indicesToRequest,u.currentImageIdIndex),v,y,T=!1,x=n.loadHandlerManager.getErrorLoadingHandler(),w=p.low,C=p.high;w>0||C<d.indicesToRequest.length;)w>=0&&(y=d.indicesToRequest[w--],v=u.imageIds[y],g.addRequest(e,v,h,T,i,s)),C<d.indicesToRequest.length&&(y=d.indicesToRequest[C++],v=u.imageIds[y],g.addRequest(e,v,h,T,i,s));g.startGrabbing()}}}}}function s(e,t){var o=e.data.element,a;try{a=n.getToolState(o,"stack")}catch(e){return}if(a&&a.data&&a.data.length){var r=a.data[0],i=r.imageIds.indexOf(t.imageId);if(!(i<0)){var s=n.getToolState(o,m);s&&s.data&&s.data.length&&s.data[0].indicesToRequest.push(i)}}}function l(e){clearTimeout(p),p=setTimeout(function(){var t=e.target;try{i(t)}catch(e){return}},v)}function u(o){var r=n.getToolState(o,m);r.data=[];var u=n.getToolState(o,"stack");if(u&&u.data&&u.data.length){var c=u.data[0];if(c.preventCache===!0)return void console.warn("A stack that should not be cached was given the stackPrefetch");var d={indicesToRequest:a(0,c.imageIds.length-1),enabled:!0,direction:1},f=d.indicesToRequest.indexOf(c.currentImageIdIndex);d.indicesToRequest.splice(f,1),n.addToolState(o,m,d),i(o),e(o).off("CornerstoneNewImage",l),e(o).on("CornerstoneNewImage",l),e(t).off("CornerstoneImageCachePromiseRemoved",s),e(t).on("CornerstoneImageCachePromiseRemoved",{element:o},s)}}function c(o){clearTimeout(p),e(o).off("CornerstoneNewImage",l),e(t).off("CornerstoneImageCachePromiseRemoved",s);var a=n.getToolState(o,m);a&&a.data.length&&(a.data[0].enabled=!1,n.requestPoolManager.clearRequestStack(h))}function d(){return g}function f(e){g=e}var m="stackPrefetch",h="prefetch",g={},p,v=300,y=function(e){return Math.max.apply(null,e)},T=function(e){return Math.min.apply(null,e)};n.stackPrefetch={enable:u,disable:c,getConfiguration:d,setConfiguration:f}}(o,m,p),function(e,t,n){"use strict";function o(t,n){e(n.element).off("CornerstoneToolsMouseDrag",i),e(n.element).off("CornerstoneToolsMouseUp",o),e(n.element).off("CornerstoneToolsMouseClick",o)}function a(t,a){if(n.isMouseButtonEnabled(a.which,t.data.mouseButtonMask)){var r={deltaY:0};return e(a.element).on("CornerstoneToolsMouseDrag",r,i),e(a.element).on("CornerstoneToolsMouseUp",o),e(a.element).on("CornerstoneToolsMouseClick",o),t.stopImmediatePropagation(),!1}}function r(e,t){var o=-t.direction;n.scroll(t.element,o)}function i(t,o){var a=o.element,r=n.getToolState(a,"stack");if(r&&r.data&&r.data.length){var i=r.data[0],s=n.stackScroll.getConfiguration(),l=e(a).height()/Math.max(i.imageIds.length,8);if(s&&s.stackScrollSpeed&&(l=s.stackScrollSpeed),t.data.deltaY=t.data.deltaY||0,t.data.deltaY+=o.deltaPoints.page.y,Math.abs(t.data.deltaY)>=l){var u=t.data.deltaY/l,c=Math.round(u),d=t.data.deltaY%l;t.data.deltaY=d,n.scroll(a,c)}return!1}}function s(e,t){var o=n.stackScrollMultiTouch.getConfiguration();o&&o.testPointers(t)&&i(e,t)}n.stackScroll=n.simpleMouseButtonTool(a),n.stackScrollWheel=n.mouseWheelTool(r);var l={eventData:{deltaY:0}};n.stackScrollTouchDrag=n.touchDragTool(i,l);var u={testPointers:function(e){return e.numPointers>=3}};n.stackScrollMultiTouch=n.multiTouchDragTool(s,l),n.stackScrollMultiTouch.setConfiguration(u)}(o,m,p),function(e){"use strict";function t(t,o){var a=o.keyCode;if(a===n.UP||a===n.DOWN){var r=1;a===n.DOWN&&(r=-1),e.scroll(o.element,r)}}var n={UP:38,DOWN:40};e.stackScrollKeyboard=e.keyboardTool(t)}(p),function(e,t,n){"use strict";function o(e){var o={imageIdToolState:n.globalImageIdSpecificToolStateManager.saveToolState(),elementToolState:{},elementViewport:{}};return e.forEach(function(e){var a=n.getElementToolStateManager(e);a!==n.globalImageIdSpecificToolStateManager&&(o.elementToolState[e.id]=a.saveToolState(),o.elementViewport[e.id]=t.getViewport(e))}),o}function a(e){if(e.hasOwnProperty("imageIdToolState")&&e.hasOwnProperty("elementToolState")&&e.hasOwnProperty("elementViewport"))return n.globalImageIdSpecificToolStateManager.restoreToolState(e.imageIdToolState),Object.keys(e.elementViewport).forEach(function(o){var a=document.getElementById(o);if(a&&e.elementToolState.hasOwnProperty(o)){var r=n.getElementToolStateManager(a);if(r!==n.globalImageIdSpecificToolStateManager){r.restoreToolState(e.elementToolState[o]);var i=e.elementViewport[o];t.setViewport(a,i),t.updateImage(a)}}}),e}n.appState={save:o,restore:a}}(o,m,p),function(e,t,n){"use strict";function o(){function e(e,t,n){o.hasOwnProperty(e)===!1&&(o[e]={});var a=o[e];a.hasOwnProperty(t)===!1&&(a[t]={data:[]});var r=a[t];r.data.push(n)}function t(e,t){if(o.hasOwnProperty(e)!==!1){var n=o[e];if(n.hasOwnProperty(t)!==!1){var a=n[t];return a}}}function n(e,t,n){if(o.hasOwnProperty(e)!==!1){var a=o[e];if(a.hasOwnProperty(t)!==!1){for(var r=a[t],i=-1,s=0;s<r.data.length;s++)r.data[s]===n&&(i=s);i!==-1&&r.data.splice(i,1)}}}var o={},a={get:t,add:e,remove:n};return a}var a=o();n.newFrameOfReferenceSpecificToolStateManager=o,n.globalFrameOfReferenceSpecificToolStateManager=a}(o,m,p),function(e,t){"use strict";function n(){function t(e){return l[e]}function n(e,t){l[e]=t}function o(){return l}function a(e){l=e}function r(t,n,o){var a=e.getEnabledElement(t);a.image&&l.hasOwnProperty(a.image.imageId)!==!1||(l[a.image.imageId]={});var r=l[a.image.imageId];r.hasOwnProperty(n)===!1&&(r[n]={data:[]});var i=r[n];i.data.push(o)}function i(t,n){var o=e.getEnabledElement(t);if(o.image&&l.hasOwnProperty(o.image.imageId)!==!1){var a=l[o.image.imageId];if(a.hasOwnProperty(n)!==!1){var r=a[n];return r}}}function s(t){var n=e.getEnabledElement(t);n.image&&l.hasOwnProperty(n.image.imageId)!==!1&&delete l[n.image.imageId]}var l={},u={get:i,add:r,clear:s,saveImageIdToolState:t,restoreImageIdToolState:n,saveToolState:o,restoreToolState:a,toolState:l};return u}var o=n();t.newImageIdSpecificToolStateManager=n,t.globalImageIdSpecificToolStateManager=o}(m,p),function(e){"use strict";function t(){function e(e){i=e}function t(){return i}function n(e){s=e}function o(){return s}function a(e){l=e}function r(){return l}var i,s,l,u={setStartLoadHandler:e,getStartLoadHandler:t,setEndLoadHandler:n,getEndLoadHandler:o,setErrorLoadingHandler:a,getErrorLoadingHandler:r};return u}e.loadHandlerManager=t()}(p),function(e,t){"use strict";function n(e,t){function n(){return i}function o(e){i=e}function a(n,o,a){if(!(e.indexOf(o)>=0))return t.add(n,o,a);i.hasOwnProperty(o)===!1&&(i[o]={data:[]});var r=i[o];r.data.push(a)}function r(n,o){if(e.indexOf(o)>=0){i.hasOwnProperty(o)===!1&&(i[o]={data:[]});var a=i[o];return a}return t.get(n,o)}var i={},s={get:r,add:a,saveToolState:n,restoreToolState:o,toolState:i};return s}function o(e,n){var o=t.getElementToolStateManager(e);o||(o=t.globalImageIdSpecificToolStateManager);var r=["stack","stackPrefetch","playClip","volume","slab","referenceLines","crosshairs"];n&&(r=r.concat(n));var i=t.newStackSpecificToolStateManager(r,o);a.push(i),t.setElementToolStateManager(e,i)}var a=[];t.newStackSpecificToolStateManager=n,t.addStackStateManager=o}(m,p),function(e){"use strict";function t(){function e(e){s=e}function t(){return s}function n(e){i=e}function o(){return i}function a(e){l=e}function r(){return l}var i=15,s=i+"px Arial",l="transparent",u={setFont:e,getFont:t,setFontSize:n,getFontSize:o,setBackgroundColor:a,getBackgroundColor:r};return u}e.textStyle=t()}(p),function(e,t){"use strict";function n(e,t){function n(n,o,r){if(!(e.indexOf(o)>=0))return t.add(n,o,r);a.hasOwnProperty(o)===!1&&(a[o]={data:[]});var i=a[o];i.data.push(r)}function o(n,o){if(e.indexOf(o)>=0){a.hasOwnProperty(o)===!1&&(a[o]={data:[]});var r=a[o];return r}return t.get(n,o)}var a={},r={get:o,add:n};return r}function o(e,n){n=n||["timeSeries"];var o=t.getElementToolStateManager(e);void 0===o&&(o=t.globalImageIdSpecificToolStateManager);var r=t.newTimeSeriesSpecificToolStateManager(n,o);a.push(r),t.setElementToolStateManager(e,r)}var a=[];t.newTimeSeriesSpecificToolStateManager=n,t.addTimeSeriesStateManager=o}(m,p),function(e){"use strict";function t(){function e(e){u=e}function t(){return u}function n(e){s=e}function o(){return s}function a(e){l=e}function r(){return l}function i(e){return e?l:s}var s="white",l="greenyellow",u="transparent",c={setFillColor:e,getFillColor:t,setToolColor:n,getToolColor:o,setActiveColor:a,getActiveColor:r,getColorIfActive:i};return c}e.toolColors=t()}(p),function(e){"use strict";function t(){function e(e){n=e.currentPoints.canvas}function t(){return n}var n="",o={setCoords:e,getCoords:t};return o}e.toolCoordinates=t()}(p),function(e,t){"use strict";function n(n){var o=e.getEnabledElement(n);return void 0===o.toolStateManager&&(o.toolStateManager=t.globalImageIdSpecificToolStateManager),o.toolStateManager}function a(e,t,a){var r=n(e);r.add(e,t,a);var i="CornerstoneToolsMeasurementAdded",s={toolType:t,element:e,measurementData:a};o(e).trigger(i,s)}function r(e,t){var o=n(e);return o.get(e,t)}function i(e,t,a){for(var r=n(e),i=r.get(e,t),s=-1,l=0;l<i.data.length;l++)i.data[l]===a&&(s=l);if(s!==-1){i.data.splice(s,1);var u="CornerstoneToolsMeasurementRemoved",c={toolType:t,element:e,measurementData:a};o(e).trigger(u,c)}}function s(e,t){var o=n(e),a=o.get(e,t);void 0!==a&&(a.data=[])}function l(t,n){var o=e.getEnabledElement(t);o.toolStateManager=n}t.addToolState=a,t.getToolState=r,t.removeToolState=i,t.clearToolState=s,t.setElementToolStateManager=l,t.getElementToolStateManager=n}(m,p),function(e){"use strict";function t(){function e(e){a=e}function t(){return a}function n(e){r=e}function o(){return r}var a=1,r=2,i={setToolWidth:e,getToolWidth:t,setActiveWidth:n,getActiveWidth:o};return i}e.toolStyle=t()}(p),function(e,t,n){"use strict";function o(e,n,o){if(o!==n){var a=t.getViewport(n),r=t.getViewport(o);r.scale===a.scale&&r.translation.x===a.translation.x&&r.translation.y===a.translation.y||(r.scale=a.scale,r.translation.x=a.translation.x,r.translation.y=a.translation.y,e.setViewport(o,r))}}n.panZoomSynchronizer=o}(o,m,p),function(e,t,n){"use strict";function o(e,o,a){if(a!==o){var r=n.getToolState(o,"stack"),i=r.data[0],s=n.getToolState(a,"stack"),l=s.data[0],u=i.currentImageIdIndex;if(u=Math.min(Math.max(u,0),l.imageIds.length-1),u!==l.currentImageIdIndex){var c=n.loadHandlerManager.getStartLoadHandler(),d=n.loadHandlerManager.getEndLoadHandler(),f=n.loadHandlerManager.getErrorLoadingHandler();c&&c(a);var m;m=l.preventCache===!0?t.loadImage(l.imageIds[u]):t.loadAndCacheImage(l.imageIds[u]),m.then(function(n){var o=t.getViewport(a);l.currentImageIdIndex=u,e.displayImage(a,n,o),d&&d(a,n)},function(e){var t=l.imageIds[u];f&&f(a,t,e)})}}}n.stackImageIndexSynchronizer=o}(o,m,p),function(e,t,n){"use strict";function o(e,o,a,r,i){if(a!==o){var s=t.getEnabledElement(o),l=n.metaData.get("imagePlane",s.image.imageId),u=l.imagePositionPatient,c=n.getToolState(a,"stack"),d=c.data[0],f=Number.MAX_VALUE,m=-1;if(i){var h=u.clone().add(i);if(d.imageIds.forEach(function(e,t){var o=n.metaData.get("imagePlane",e),a=o.imagePositionPatient,r=h.distanceToSquared(a);r<f&&(f=r,m=t)}),m!==d.currentImageIdIndex&&m!==-1){var g=n.loadHandlerManager.getStartLoadHandler(),p=n.loadHandlerManager.getEndLoadHandler(),v=n.loadHandlerManager.getErrorLoadingHandler();g&&g(a);var y;y=d.preventCache===!0?t.loadImage(d.imageIds[m]):t.loadAndCacheImage(d.imageIds[m]),y.then(function(n){var o=t.getViewport(a);d.currentImageIdIndex=m,e.displayImage(a,n,o),p&&p(a,n)},function(e){var t=d.imageIds[m];v&&v(a,t,e)})}}}}n.stackImagePositionOffsetSynchronizer=o}(o,m,p),function(e,t,n){"use strict";function o(o,a,r){if(r!==a){var i=t.getEnabledElement(a).image,s=n.metaData.get("imagePlane",i.imageId),l=s.imagePositionPatient,u=n.getToolState(r,"stack"),c=u.data[0],d=Number.MAX_VALUE,f=-1;if(e.each(c.imageIds,function(e,t){var o=n.metaData.get("imagePlane",t),a=o.imagePositionPatient,r=a.distanceToSquared(l);r<d&&(d=r,f=e)}),f!==c.currentImageIdIndex){var m=n.loadHandlerManager.getStartLoadHandler(),h=n.loadHandlerManager.getEndLoadHandler(),g=n.loadHandlerManager.getErrorLoadingHandler();if(m&&m(r),f!==-1){var p;p=c.preventCache===!0?t.loadImage(c.imageIds[f]):t.loadAndCacheImage(c.imageIds[f]),p.then(function(e){var n=t.getViewport(r);c.currentImageIdIndex=f,o.displayImage(r,e,n),h&&h(r,e)},function(e){var t=c.imageIds[f];g&&g(r,t,e)})}}}}n.stackImagePositionSynchronizer=o}(o,m,p),function(e,t,n){"use strict";function o(e,o,a,r){if(o!==a&&r&&r.direction){var i=n.getToolState(a,"stack"),s=i.data[0],l=s.currentImageIdIndex+r.direction;if(l=Math.min(Math.max(l,0),s.imageIds.length-1),s.currentImageIdIndex!==l){var u=n.loadHandlerManager.getStartLoadHandler(),c=n.loadHandlerManager.getEndLoadHandler(),d=n.loadHandlerManager.getErrorLoadingHandler();
u&&u(a);var f;f=s.preventCache===!0?t.loadImage(s.imageIds[l]):t.loadAndCacheImage(s.imageIds[l]),f.then(function(n){var o=t.getViewport(a);s.currentImageIdIndex=l,e.displayImage(a,n,o),c&&c(a,n)},function(e){var t=s.imageIds[l];d&&d(a,t,e)})}}}n.stackScrollSynchronizer=o}(o,m,p),function(e,t,n){"use strict";function o(o,a){function r(e,t){u.length&&c.length&&(d=!0,c.forEach(function(n){var o=c.indexOf(n);if(o!==-1){var a=f.imageIds.targetElements[o],r=u.indexOf(e);if(r!==-1){var i=f.imageIds.sourceElements[r],s;s=i===a?0:f.distances[i][a],m(l,e,n,t,s)}}}),d=!1)}function i(e,t){d!==!0&&r(e.currentTarget,t)}function s(e,t){var n=t.element;l.remove(n)}var l=this,u=[],c=[],d=!1,f={},m=a;this.setHandler=function(e){m=e},this.getHandler=function(){return m},this.getDistances=function(){u.length&&c.length&&(f.distances={},f.imageIds={sourceElements:[],targetElements:[]},u.forEach(function(e){var o=t.getEnabledElement(e);if(o&&o.image){var a=o.image.imageId,r=n.metaData.get("imagePlane",a);if(r&&r.imagePositionPatient){var i=r.imagePositionPatient;f.hasOwnProperty(o)||(f.distances[a]={},f.imageIds.sourceElements.push(a),c.forEach(function(o){var r=t.getEnabledElement(o);if(r&&r.image){var s=r.image.imageId;if(f.imageIds.targetElements.push(s),e!==o&&a!==s&&!f.distances[a].hasOwnProperty(s)){var l=n.metaData.get("imagePlane",s);if(l&&l.imagePositionPatient){var u=l.imagePositionPatient;f.distances[a][s]=u.clone().sub(i)}}}}),Object.keys(f.distances[a]).length||delete f.distances[a])}}}))},this.addSource=function(t){var n=u.indexOf(t);n===-1&&(u.push(t),e(t).on(o,i),l.getDistances(),l.updateDisableHandlers())},this.addTarget=function(e){var t=c.indexOf(e);t===-1&&(c.push(e),l.getDistances(),m(l,e,e,0),l.updateDisableHandlers())},this.add=function(e){l.addSource(e),l.addTarget(e)},this.removeSource=function(t){var n=u.indexOf(t);n!==-1&&(u.splice(n,1),e(t).off(o,i),l.getDistances(),r(t),l.updateDisableHandlers())},this.removeTarget=function(e){var t=c.indexOf(e);t!==-1&&(c.splice(t,1),l.getDistances(),m(l,e,e,0),l.updateDisableHandlers())},this.remove=function(e){l.removeTarget(e),l.removeSource(e)},this.getSourceElements=function(){return u},this.getTargetElements=function(){return c},this.displayImage=function(e,n,o){d=!0,t.displayImage(e,n,o),d=!1},this.setViewport=function(e,n){d=!0,t.setViewport(e,n),d=!1},this.updateDisableHandlers=function(){var t=e.unique(u.concat(c));t.forEach(function(t){e(t).off("CornerstoneElementDisabled",s),e(t).on("CornerstoneElementDisabled",s)})},this.destroy=function(){var t=e.unique(u.concat(c));t.forEach(function(e){l.remove(e)})}}n.Synchronizer=o}(o,m,p),function(e,t,n){"use strict";function o(e,n,o){o!==n&&t.updateImage(o)}n.updateImageSynchronizer=o}(o,m,p),function(e,t,n){"use strict";function o(e,n,o){if(o!==n){var a=t.getViewport(n),r=t.getViewport(o);r.voi.windowWidth===a.voi.windowWidth&&r.voi.windowCenter===a.voi.windowCenter&&r.invert===a.invert||(r.voi.windowWidth=a.voi.windowWidth,r.voi.windowCenter=a.voi.windowCenter,r.invert=a.invert,e.setViewport(o,r))}}n.wwwcSynchronizer=o}(o,m,p),function(e,t,n){"use strict";function o(e){var n=[];e.timeSeries.stacks.forEach(function(o){var a;a=o.preventCache===!0?t.loadImage(o.imageIds[e.imageIdIndex]):t.loadAndCacheImage(o.imageIds[e.imageIdIndex]),a.then(function(t){var o=Math.round(e.handles.end.x)+Math.round(e.handles.end.y)*t.width,a=t.getPixelData()[o];n.push(a)})}),e.lineSample.set(n)}function a(e){var t=n.getToolState(e.element,"timeSeries");if(void 0!==t&&void 0!==t.data&&0!==t.data.length){var a=t.data[0],r={timeSeries:a,lineSample:new n.LineSampleMeasurement,imageIdIndex:a.stacks[a.currentStackIndex].currentImageIdIndex,visible:!0,handles:{end:{x:e.currentPoints.image.x,y:e.currentPoints.image.y,highlight:!0,active:!0}}};return o(r),n.MeasurementManager.add(r),r}}function r(e,o){var a=n.getToolState(e.currentTarget,i);if(void 0!==a){var r=o.canvasContext.canvas.getContext("2d");t.setToPixelCoordinateSystem(o.enabledElement,r);for(var s="white",l=0;l<a.data.length;l++){r.save();var u=a.data[l];r.beginPath(),n.drawHandles(r,o,u.handles,s),r.stroke();var c=n.setContextToDisplayFontSize(o.enabledElement,o.canvasContext,15);r.font=""+c.fontSize+"px Arial";var d=Math.round(u.handles.end.x),f=Math.round(u.handles.end.y),m=u.handles.end.x+3,h=u.handles.end.y-3;r.fillStyle=s,r.fillText(""+d+","+f,m,h),r.restore()}}}var i="probe4D";n.probeTool4D=n.mouseButtonTool({createNewMeasurement:a,onImageRendered:r,toolType:i})}(o,m,p),function(e,t,n){"use strict";function o(e,o,a){var r=n.getToolState(e,"timeSeries");if(void 0!==r&&void 0!==r.data&&0!==r.data.length){var i=r.data[0],s=i.stacks[i.currentStackIndex],l=s.currentImageIdIndex,u=i.currentStackIndex+o;if(a?(u>=i.stacks.length&&(u=0),u<0&&(u=i.stacks.length-1)):(u=Math.min(i.stacks.length-1,u),u=Math.max(0,u)),u!==i.currentStackIndex){var c=t.getViewport(e),d=i.stacks[u],f=n.loadHandlerManager.getStartLoadHandler(),m=n.loadHandlerManager.getEndLoadHandler(),h=n.loadHandlerManager.getErrorLoadingHandler();f&&f(e);var g;g=d.preventCache===!0?t.loadImage(d.imageIds[l]):t.loadAndCacheImage(d.imageIds[l]),g.then(function(n){i.currentImageIdIndex!==l&&(d.currentImageIdIndex=l,i.currentStackIndex=u,t.displayImage(e,n,c),m&&m(e,n))},function(t){var n=d.imageIds[l];h&&h(e,n,t)})}}}n.incrementTimePoint=o}(o,m,p),function(e,t,n){"use strict";function o(e,t){if(void 0===e)throw"playClip: element must not be undefined";void 0===t&&(t=30);var o=n.getToolState(e,"timeSeries");if(void 0!==o&&void 0!==o.data&&0!==o.data.length){var a=n.getToolState(e,r),i;void 0===a||0===a.data.length?(i={intervalId:void 0,framesPerSecond:t,lastFrameTimeStamp:void 0,frameRate:0},n.addToolState(e,r,i)):(i=a.data[0],i.framesPerSecond=t),void 0===i.intervalId&&(i.intervalId=setInterval(function(){i.framesPerSecond>0?n.incrementTimePoint(e,1,!0):n.incrementTimePoint(e,-1,!0)},1e3/Math.abs(i.framesPerSecond)))}}function a(e){var t=n.getToolState(e,r),o;void 0!==t&&0!==t.data.length&&(o=t.data[0],clearInterval(o.intervalId),o.intervalId=void 0)}var r="timeSeriesPlayer";n.timeSeriesPlayer={start:o,stop:a}}(o,m,p),function(e,t,n){"use strict";function o(t,n){e(n.element).off("CornerstoneToolsMouseDrag",r),e(n.element).off("CornerstoneToolsMouseUp",o),e(n.element).off("CornerstoneToolsMouseClick",o)}function a(t,a){if(n.isMouseButtonEnabled(a.which,t.data.mouseButtonMask)){var i={deltaY:0,options:t.data.options};return e(a.element).on("CornerstoneToolsMouseDrag",i,r),e(a.element).on("CornerstoneToolsMouseUp",o),e(a.element).on("CornerstoneToolsMouseClick",o),t.stopImmediatePropagation(),!1}}function r(t,o){t.data.deltaY+=o.deltaPoints.page.y;var a=n.getToolState(o.element,"timeSeries");if(void 0!==a&&void 0!==a.data&&0!==a.data.length){var r=a.data[0],i=e(o.element).height()/r.stacks.length;if(void 0!==t.data.options&&void 0!==t.data.options.timeSeriesScrollSpeed&&(i=t.data.options.timeSeriesScrollSpeed),t.data.deltaY>=i||t.data.deltaY<=-i){var s=Math.round(t.data.deltaY/i),l=t.data.deltaY%i;n.incrementTimePoint(o.element,s),t.data.deltaY=l}return!1}}function i(e,t){var o=-t.direction;n.incrementTimePoint(t.element,o)}function s(e){var t=e.originalEvent.detail,o={deltaY:0};o.deltaY+=t.deltaPoints.page.y;var a=n.getToolState(t.element,"stack");if(void 0!==a&&void 0!==a.data&&0!==a.data.length){if(o.deltaY>=3||o.deltaY<=-3){var r=o.deltaY/3,i=o.deltaY%3;n.setTimePoint(o.element,r),o.deltaY=i}return!1}}n.timeSeriesScroll=n.simpleMouseButtonTool(a),n.timeSeriesScrollWheel=n.mouseWheelTool(i),n.timeSeriesScrollTouchDrag=n.touchDragTool(s)}(o,m,p),function(e,t,n){"use strict";function o(e,t){var n=Math.pow(10,t);return Math.round(e*n)/n}n.roundToDecimal=o}(o,m,p),function(e){"use strict";function t(t,n){for(var o=0,a=0,r=0,i=0,s=n.top;s<n.top+n.height;s++)for(var l=n.left;l<n.left+n.width;l++){var u={x:l,y:s};e.pointInEllipse(n,u)&&(o+=t[i],a+=t[i]*t[i],r++),i++}if(0===r)return{count:r,mean:0,variance:0,stdDev:0};var c=o/r,d=a/r-c*c;return{count:r,mean:c,variance:d,stdDev:Math.sqrt(d)}}e.calculateEllipseStatistics=t}(p),function(e){"use strict";function t(e){return parseFloat("."+e)}function n(e,n){if(g){var o=m.metaData.get("patientStudyModule",e.imageId),a=m.metaData.get("generalSeriesModule",e.imageId);if(o&&a){var r=a.modality;if("PT"===r){var i=n*e.slope+e.intercept,s=o.patientWeight;if(s){var l=m.metaData.get("petIsotopeModule",e.imageId);if(l){var u=l.radiopharmaceuticalInfo,c=u.radiopharmaceuticalStartTime,d=u.radionuclideTotalDose,f=u.radionuclideHalfLife,h=a.seriesTime;if(c&&d&&f&&h){var p=t(h.fractionalSeconds||0)+h.seconds+60*h.minutes+60*h.hours*60,v=t(c.fractionalSeconds)+c.seconds+60*c.minutes+60*c.hours*60,y=p-v,T=d*Math.exp(-y*Math.log(2)/f),x=i*s/T*1e3;return x}}}}}}}e.calculateSUV=n}(p),function(e,t,n,o){"use strict";function a(e){var t=n.point.copy(e.page),o=n.point.copy(e.image),a=n.point.copy(e.client),r=n.point.copy(e.canvas);return{page:t,image:o,client:a,canvas:r}}o.copyPoints=a}(o,m,h,p),function(e){"use strict";function t(e,t,n,o,a){var r=10,i=Math.atan2(n.y-t.y,n.x-t.x);e.beginPath(),e.moveTo(t.x,t.y),e.lineTo(n.x,n.y),e.strokeStyle=o,e.lineWidth=a,e.stroke(),e.beginPath(),e.moveTo(n.x,n.y),e.lineTo(n.x-r*Math.cos(i-Math.PI/7),n.y-r*Math.sin(i-Math.PI/7)),e.lineTo(n.x-r*Math.cos(i+Math.PI/7),n.y-r*Math.sin(i+Math.PI/7)),e.lineTo(n.x,n.y),e.lineTo(n.x-r*Math.cos(i-Math.PI/7),n.y-r*Math.sin(i-Math.PI/7)),e.strokeStyle=o,e.lineWidth=a,e.stroke(),e.fillStyle=o,e.fill()}e.drawArrow=t}(p),function(e){"use strict";function t(e,t,n,o){var a=6;e.beginPath(),e.strokeStyle=n,e.lineWidth=o,e.arc(t.x,t.y,a,0,2*Math.PI),e.stroke()}e.drawCircle=t}(p),function(e){"use strict";function t(e,t,n,o,a){var r=.5522848,i=o/2*r,s=a/2*r,l=t+o,u=n+a,c=t+o/2,d=n+a/2;e.beginPath(),e.moveTo(t,d),e.bezierCurveTo(t,d-s,c-i,n,c,n),e.bezierCurveTo(c+i,n,l,d-s,l,d),e.bezierCurveTo(l,d+s,c+i,u,c,u),e.bezierCurveTo(c-i,u,t,d+s,t,d),e.closePath(),e.stroke()}e.drawEllipse=t}(p),function(e){"use strict";function t(t,n,o,a,r,i){"[object Array]"!==Object.prototype.toString.call(n)&&(n=[n]);var s=5,l=e.textStyle.getFont(),u=e.textStyle.getFontSize(),c=e.textStyle.getBackgroundColor();t.save(),t.font=l,t.textBaseline="top",t.strokeStyle=r;var d=0;n.forEach(function(e){var n=t.measureText(e).width;d=Math.max(d,n)}),t.fillStyle=c;var f={width:d+2*s,height:s+n.length*(u+s)};return i&&i.centering&&i.centering.x===!0&&(o-=f.width/2),i&&i.centering&&i.centering.y===!0&&(a-=f.height/2),f.left=o,f.top=a,i&&i.debug===!0&&(t.fillStyle="#FF0000"),t.fillRect(f.left,f.top,f.width,f.height),n.forEach(function(e,n){t.fillStyle=r;var i;i=0===n?a+n*(u+s):a+n*(u+2*s),t.fillText(e,o+s,a+s+n*(u+s))}),t.restore(),f}e.drawTextBox=t}(p),function(e,t){"use strict";function n(t,n,o,a,r){if(!t)throw"getLuminance: parameter element must not be undefined";n=Math.round(n),o=Math.round(o);var i=e.getEnabledElement(t),s=i.image,l=[],u=0,c=s.getPixelData(),d,f,m;if(s.color)for(f=0;f<r;f++)for(m=0;m<a;m++){d=4*((f+o)*s.columns+(m+n));var h=c[d],g=c[d+1],p=c[d+2];l[u++]=.2126*h+.7152*g+.0722*p}else for(f=0;f<r;f++)for(m=0;m<a;m++)d=(f+o)*s.columns+(m+n),l[u++]=c[d]*s.slope+s.intercept;return l}t.getLuminance=n}(m,p),function(e,t){"use strict";function n(){var e=navigator.userAgent,t=e.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[],n;return/trident/i.test(t[1])?(n=/\brv[ :]+(\d+)/g.exec(e)||[],"IE "+(n[1]||"")):"Chrome"===t[1]&&(n=e.match(/\b(OPR|Edge)\/(\d+)/),null!==n)?n.slice(1).join(" ").replace("OPR","Opera"):(t=t[2]?[t[1],t[2]]:[navigator.appName,navigator.appVersion,"-?"],null!==(n=e.match(/version\/(\d+)/i))&&t.splice(1,1,n[1]),t.join(" "))}function o(){var e=t.stackPrefetch.getConfiguration();return e.maxSimultaneousRequests?e.maxSimultaneousRequests:a()}function a(){var e=n(),t=e.split(" "),o=t[0],a=t[1],r=i[o];return r?r[a]?r[a]:r.default:i.default}function r(){var e=new RegExp("Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini");return!!e.test(navigator.userAgent)}var i={default:6,IE:{9:6,10:8,default:8},Firefox:{default:6},Opera:{10:8,11:6,12:6,default:6},Chrome:{default:6},Safari:{default:6}};t.getDefaultSimultaneousRequests=a,t.getMaxSimultaneousRequests=o,t.getBrowserInfo=n,t.isMobileDevice=r}(m,p),function(e,t){"use strict";function n(t,n,o,a,r){if(!t)throw"getRGBPixels: parameter element must not be undefined";n=Math.round(n),o=Math.round(o);var i=e.getEnabledElement(t),s=[],l=0,u=i.image.getPixelData(),c,d,f;if(i.image.color)for(d=0;d<r;d++)for(f=0;f<a;f++){c=4*((d+o)*i.image.columns+(f+n));var m=u[c],h=u[c+1],g=u[c+2],p=u[c+3];s[l++]=m,s[l++]=h,s[l++]=g,s[l++]=p}return s}t.getRGBPixels=n}(m,p),function(e,t){"use strict";function n(e,t){var n=1<<e-1;return 0!==(t&n)}t.isMouseButtonEnabled=n}(m,p),function(e,t,n){"use strict";function o(e){return e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault(),e.cancelBubble=!0,e.returnValue=!1,!1}n.pauseEvent=o}(o,m,p),function(e){"use strict";function t(e,t){var n=e.width/2,o=e.height/2;if(n<=0||o<=0)return!1;var a={x:e.left+n,y:e.top+o},r={x:t.x-a.x,y:t.y-a.y},i=r.x*r.x/(n*n)+r.y*r.y/(o*o)<=1;return i}e.pointInEllipse=t}(p),function(e,t){"use strict";function n(t,n){if(t.boundingBox)return e.point.insideRect(n,t.boundingBox)}t.pointInsideBoundingBox=n}(h,p),function(e,t,n){"use strict";function o(e,t){var n=e.clone().sub(t.imagePositionPatient),o=t.rowCosines.dot(n)/t.columnPixelSpacing,a=t.columnCosines.dot(n)/t.rowPixelSpacing;return{x:o,y:a}}function a(e,t){var n=t.rowCosines.clone().multiplyScalar(e.x);n.multiplyScalar(t.columnPixelSpacing);var o=t.columnCosines.clone().multiplyScalar(e.y);o.multiplyScalar(t.rowPixelSpacing);var a=n.add(o);return a.add(t.imagePositionPatient),a}function r(e){var t=a({x:0,y:0},e),n=a({x:e.columns,y:0},e),o=a({x:0,y:e.rows},e),r=a({x:e.columns,y:e.rows},e),i={top:new h.Line3(t,n),left:new h.Line3(t,o),right:new h.Line3(n,r),bottom:new h.Line3(o,r)};return i}function i(e,t){var n=[];return Object.keys(t).forEach(function(o){var a=t[o],r=e.intersectLine(a);r&&n.push(r)}),n}function s(e,t){var n=e.rowCosines.clone().cross(e.columnCosines),o=new h.Plane;o.setFromNormalAndCoplanarPoint(n,e.imagePositionPatient);var s=t.rowCosines.clone().cross(t.columnCosines),l=new h.Plane;l.setFromNormalAndCoplanarPoint(s,t.imagePositionPatient);var u=l.clone().intersectPlane(o),c=u.origin,d=u.direction,f=a({x:t.columns,y:t.rows},t),m=t.imagePositionPatient.distanceTo(f),g=new h.Line3;g.start=c,g.end=c.clone().add(d.multiplyScalar(m));var p=r(t),v=i(g,p);if(2===v.length){var y={start:v[0],end:v[1]};return y}}n.projectPatientPointToImagePlane=o,n.imagePointToPatientPoint=a,n.planePlaneIntersection=s}(o,m,p),function(e,t){"use strict";function n(e,n){var o=t.getToolState(e,"stack");if(void 0!==o&&void 0!==o.data&&0!==o.data.length){var a=o.data[0],r=a.currentImageIdIndex+n;r=Math.min(a.imageIds.length-1,r),r=Math.max(0,r),t.scrollToIndex(e,r)}}t.scroll=n}(m,p),function(e,t){"use strict";function n(n,a){function r(t){if(l.currentImageIdIndex===a){try{e.getEnabledElement(n)}catch(e){return}e.displayImage(n,t,f),c&&c(n,t)}}function i(e){var t=l.imageIds[a];d&&d(n,t,e)}var s=t.getToolState(n,"stack");if(s&&s.data&&s.data.length){var l=s.data[0];a<0&&(a+=l.imageIds.length);var u=t.loadHandlerManager.getStartLoadHandler(),c=t.loadHandlerManager.getEndLoadHandler(),d=t.loadHandlerManager.getErrorLoadingHandler(),f=e.getViewport(n);if(a!==l.currentImageIdIndex){u&&u(n);var m={newImageIdIndex:a,direction:a-l.currentImageIdIndex};l.currentImageIdIndex=a;var h=l.imageIds[a],g=t.stackScroll.getConfiguration();if(g&&g.retryLoadOnScroll===!0){var p=e.imageCache.getImagePromise(h);p&&"rejected"===p.state()&&e.imageCache.removeImagePromise(h)}var v=!!l.preventCache,y;y=v?e.loadImage(h):e.loadAndCacheImage(h),y.then(r,i),t.requestPoolManager.startGrabbing(),o(n).trigger("CornerstoneStackScroll",m)}}}t.scrollToIndex=n,t.loadHandlers={}}(m,p),function(e,t){"use strict";function n(t,n,o){var a=.1;e.setToPixelCoordinateSystem(t,n,a);var r=o/t.viewport.scale/a,i=o/t.viewport.scale/a;return{fontSize:r,lineHeight:i,fontScale:a}}t.setContextToDisplayFontSize=n}(m,p),"undefined"==typeof m&&(m={}),"undefined"==typeof v&&(v={wadouri:{},wadors:{},internal:{options:{beforeSend:function(e){},imageCreated:function(e){}}}}),function(e,t,n){"use strict";function o(e){e.decache=function(){var t=n.wadouri.parseImageId(e.imageId);n.wadouri.dataSetCacheManager.unload(t.url)}}function a(e,t){var o=e.elements.x7fe00010;return o.encapsulatedPixelData?n.wadouri.getEncapsulatedImageFrame(e,t):n.wadouri.getUncompressedImageFrame(e,t)}function r(t,r,i,s,l){var u=(new Date).getTime();i=i||0;var c=e.Deferred();return t.then(function(e){var t=a(e,i),s=e.string("x00020010"),d=(new Date).getTime(),f=n.createImage(r,t,s,l);f.then(function(t){t.data=e;var n=(new Date).getTime();t.loadTimeInMS=d-u,t.totalTimeInMS=n-u,o(t),c.resolve(t)})},function(e){c.reject(e)}),c}function i(e){return"dicomweb"===e||"wadouri"===e?n.internal.xhrRequest:"dicomfile"===e?n.wadouri.loadFileRequest:void 0}function s(e,t){var o=n.wadouri.parseImageId(e),a=i(o.scheme);return n.wadouri.dataSetCacheManager.isLoaded(o.url)?r(n.wadouri.dataSetCacheManager.load(o.url,a,e),e,o.frame,o.url,t):r(n.wadouri.dataSetCacheManager.load(o.url,a,e),e,o.frame,o.url,t)}t.registerImageLoader("dicomweb",s),t.registerImageLoader("wadouri",s),t.registerImageLoader("dicomfile",s)}(o,m,v),function(e){"use strict";function t(e,t){var n=e.columns*e.rows,o=0,a=0,r=e.pixelData,i=e.redPaletteColorLookupTableDescriptor[1],s=e.redPaletteColorLookupTableData,l=e.greenPaletteColorLookupTableData,u=e.bluePaletteColorLookupTableData,c=8===e.redPaletteColorLookupTableDescriptor[2]?0:8,d=e.redPaletteColorLookupTableData.length;0===d&&(d=65535);for(var f=0;f<n;++f){var m=r[o++];m<i?m=0:m>i+d-1?m=d-1:m-=i,t[a++]=s[m]>>c,t[a++]=l[m]>>c,t[a++]=u[m]>>c,t[a++]=255}}e.convertPALETTECOLOR=t}(v),function(e){"use strict";function t(e,t){if(void 0===e)throw"decodeRGB: rgbBuffer must not be undefined";if(e.length%3!==0)throw"decodeRGB: rgbBuffer length must be divisible by 3";for(var n=e.length/3,o=0,a=0,r=0;r<n;r++)t[a++]=e[o++],t[a++]=e[o++],t[a++]=e[o++],t[a++]=255}e.convertRGBColorByPixel=t}(v),function(e){"use strict";function t(e,t){if(void 0===e)throw"decodeRGB: rgbBuffer must not be undefined";if(e.length%3!==0)throw"decodeRGB: rgbBuffer length must be divisible by 3";for(var n=e.length/3,o=0,a=0,r=n,i=2*n,s=0;s<n;s++)t[o++]=e[a++],t[o++]=e[r++],t[o++]=e[i++],t[o++]=255}e.convertRGBColorByPlane=t}(v),function(e){"use strict";function t(e,t){if(void 0===e)throw"decodeRGB: ybrBuffer must not be undefined";if(e.length%3!==0)throw"decodeRGB: ybrBuffer length must be divisble by 3";for(var n=e.length/3,o=0,a=0,r=0;r<n;r++){var i=e[o++],s=e[o++],l=e[o++];t[a++]=i+1.402*(l-128),t[a++]=i-.34414*(s-128)-.71414*(l-128),t[a++]=i+1.772*(s-128),t[a++]=255}}e.convertYBRFullByPixel=t}(v),function(e){"use strict";function t(e,t){if(void 0===e)throw"decodeRGB: ybrBuffer must not be undefined";if(e.length%3!==0)throw"decodeRGB: ybrBuffer length must be divisble by 3";for(var n=e.length/3,o=0,a=0,r=n,i=2*n,s=0;s<n;s++){var l=e[a++],u=e[r++],c=e[i++];t[o++]=l+1.402*(c-128),t[o++]=l-.34414*(u-128)-.71414*(c-128),t[o++]=l+1.772*(u-128),t[o++]=255}}e.convertYBRFullByPlane=t}(v),function(e){"use strict";function t(t){e.internal.options=t}e.configure=t}(v),function(e){"use strict";function t(t,n){0===t.planarConfiguration?e.convertRGBColorByPixel(t.pixelData,n):e.convertRGBColorByPlane(t.pixelData,n)}function n(t,n){0===t.planarConfiguration?e.convertYBRFullByPixel(t.pixelData,n):e.convertYBRFullByPlane(t.pixelData,n)}function o(o,a){var r=a.data;if(console.time("convertColorSpace"),"RGB"===o.photometricInterpretation)t(o,r);else if("YBR_RCT"===o.photometricInterpretation)t(o,r);else if("YBR_ICT"===o.photometricInterpretation)t(o,r);else if("PALETTE COLOR"===o.photometricInterpretation)e.convertPALETTECOLOR(o,r);else if("YBR_FULL_422"===o.photometricInterpretation)t(o,r);else{if("YBR_FULL"!==o.photometricInterpretation)throw"no color space conversion for photometric interpretation "+o.photometricInterpretation;n(o,r)}console.timeEnd("convertColorSpace")}e.convertColorSpace=o}(v),function(e,t,n){"use strict";function o(e){return"1.2.840.10008.5.1.4.1.1.12.1"!==e&&"1.2.840.10008.5.1.4.1.1.12.2.1\t"!==e}function a(e){16===e.bitsAllocated?0===e.pixelRepresentation?e.pixelData=new Uint16Array(e.pixelData):e.pixelData=new Int16Array(e.pixelData):e.pixelData=new Uint8Array(e.pixelData)}function r(r,l,u,c){var d=e.Deferred(),f=n.getImageFrame(r),m=n.decodeImageFrame(f,u,l,i,c);return m.then(function(e){var l=t.metaData.get("imagePlaneModule",r),c=t.metaData.get("voiLutModule",r),f=t.metaData.get("modalityLutModule",r),m=t.metaData.get("sopCommonModule",r),h=n.isColorImage(e.photometricInterpretation);if(!n.isJPEGBaseline8BitColor(e,u)&&(a(e),h)){i.height=e.rows,i.width=e.columns;var g=i.getContext("2d"),p=g.createImageData(e.columns,e.rows);n.convertColorSpace(e,p),e.imageData=p,e.pixelData=p.data}var v={imageId:r,color:h,columnPixelSpacing:l.pixelSpacing?l.pixelSpacing[1]:void 0,columns:e.columns,height:e.rows,intercept:f.rescaleIntercept?f.rescaleIntercept:0,invert:"MONOCHROME1"===e.photometricInterpretation,minPixelValue:e.smallestPixelValue,maxPixelValue:e.largestPixelValue,render:void 0,rowPixelSpacing:l.pixelSpacing?l.pixelSpacing[0]:void 0,rows:e.rows,sizeInBytes:e.pixelData.length,slope:f.rescaleSlope?f.rescaleSlope:1,width:e.columns,windowCenter:c.windowCenter?c.windowCenter[0]:void 0,windowWidth:c.windowWidth?c.windowWidth[0]:void 0,decodeTimeInMS:e.decodeTimeInMS,webWorkerTimeInMS:e.webWorkerTimeInMS};if(v.getPixelData=function(){return e.pixelData},v.color?(v.render=t.renderColorImage,v.getCanvas=function(){if(s===r)return i;i.height=v.rows,i.width=v.columns;var t=i.getContext("2d");return t.putImageData(e.imageData,0,0),s=r,i}):v.render=t.renderGrayscaleImage,void 0===v.minPixelValue||void 0===v.maxPixelValue){var y=n.getMinMax(e.pixelData);v.minPixelValue=y.min,v.maxPixelValue=y.max}if(f.modalityLUTSequence&&f.modalityLUTSequence.length>0&&o(m.sopClassUID)&&(v.modalityLUT=f.modalityLUTSequence[0]),c.voiLUTSequence&&c.voiLUTSequence.length>0&&(v.voiLUT=c.voiLUTSequence[0]),void 0===v.windowCenter||void 0===v.windowWidth)if(v.color)v.windowWidth=255,v.windowCenter=128;else{var T=v.maxPixelValue*v.slope+v.intercept,x=v.minPixelValue*v.slope+v.intercept;v.windowWidth=T-x,v.windowCenter=(T+x)/2}d.resolve(v)}),d.promise()}var i=document.createElement("canvas"),s="";n.createImage=r}(o,m,v),function(e,t,n){"use strict";function o(e,t,o,a){var r=a.priority||void 0,i=a.transferPixelData?[o.buffer]:void 0;return n.webWorkerManager.addTask("decodeTask",{imageFrame:e,transferSyntax:t,pixelData:o,options:a},r,i).promise}function a(e,t,a,r,i){if(i=i||{},"1.2.840.10008.1.2"===t)return o(e,t,a,i);if("1.2.840.10008.1.2.1"===t)return o(e,t,a,i);if("1.2.840.10008.1.2.2"===t)return o(e,t,a,i);if("1.2.840.10008.1.2.1.99"===t)return o(e,t,a,i);if("1.2.840.10008.1.2.5"===t)return o(e,t,a,i);if("1.2.840.10008.1.2.4.50"===t)return 8!==e.bitsAllocated||3!==e.samplesPerPixel&&4!==e.samplesPerPixel?o(e,t,a,i):n.decodeJPEGBaseline8BitColor(e,a,r);if("1.2.840.10008.1.2.4.51"===t)return o(e,t,a,i);if("1.2.840.10008.1.2.4.57"===t)return o(e,t,a,i);if("1.2.840.10008.1.2.4.70"===t)return o(e,t,a,i);if("1.2.840.10008.1.2.4.80"===t)return o(e,t,a,i);if("1.2.840.10008.1.2.4.81"===t)return o(e,t,a,i);if("1.2.840.10008.1.2.4.90"===t)return o(e,t,a,i);if("1.2.840.10008.1.2.4.91"===t)return o(e,t,a,i);throw console&&console.log&&console.log("Image cannot be decoded due to Unsupported transfer syntax "+t),"no decoder for transfer syntax "+t}n.decodeImageFrame=a}(o,m,v),function(e,t){"use strict";function n(e){return o(String.fromCharCode.apply(null,Array.prototype.slice.apply(new Uint8Array(e))))}function o(e){var t;try{return decodeURIComponent(escape(e))}catch(n){if(t=n,t instanceof URIError)return e;throw t}}function a(t,o,a){var r=(new Date).getTime(),i=e.Deferred(),s=new Blob([o],{type:"image/jpeg"}),l=new FileReader;return void 0===l.readAsBinaryString?l.readAsArrayBuffer(s):l.readAsBinaryString(s),l.onload=function(){var e=new Image;e.onload=function(){a.height=e.height,a.width=e.width,t.rows=e.height,t.columns=e.width;var n=a.getContext("2d");n.drawImage(this,0,0);var o=n.getImageData(0,0,e.width,e.height),s=(new Date).getTime();t.pixelData=o.data,t.imageData=o,t.decodeTimeInMS=s-r,i.resolve(t)},e.onerror=function(e){i.reject(e)},void 0===l.readAsBinaryString?e.src="data:image/jpeg;base64,"+window.btoa(n(l.result)):e.src="data:image/jpeg;base64,"+window.btoa(l.result)},i.promise()}function r(e,t){if(t=t||e.transferSyntax,8===e.bitsAllocated&&"1.2.840.10008.1.2.4.50"===t&&(3===e.samplesPerPixel||4===e.samplesPerPixel))return!0}t.decodeJPEGBaseline8BitColor=a,t.isJPEGBaseline8BitColor=r}(o,v),function(e,t,n){"use strict";function o(e){var n=t.metaData.get("imagePixelModule",e);return{samplesPerPixel:n.samplesPerPixel,photometricInterpretation:n.photometricInterpretation,planarConfiguration:n.planarConfiguration,rows:n.rows,columns:n.columns,bitsAllocated:n.bitsAllocated,pixelRepresentation:n.pixelRepresentation,smallestPixelValue:n.smallestPixelValue,largestPixelValue:n.largestPixelValue,redPaletteColorLookupTableDescriptor:n.redPaletteColorLookupTableDescriptor,greenPaletteColorLookupTableDescriptor:n.greenPaletteColorLookupTableDescriptor,bluePaletteColorLookupTableDescriptor:n.bluePaletteColorLookupTableDescriptor,redPaletteColorLookupTableData:n.redPaletteColorLookupTableData,greenPaletteColorLookupTableData:n.greenPaletteColorLookupTableData,bluePaletteColorLookupTableData:n.bluePaletteColorLookupTableData,pixelData:void 0}}n.getImageFrame=o}(o,m,v),function(e){"use strict";function t(e){for(var t=e[0],n=e[0],o,a=e.length,r=0;r<a;r++)o=e[r],t=Math.min(t,o),n=Math.max(n,o);return{min:t,max:n}}e.getMinMax=t}(v),function(e){"use strict";function t(e){return"RGB"===e||"PALETTE COLOR"===e||"YBR_FULL"===e||"YBR_FULL_422"===e||"YBR_PARTIAL_422"===e||"YBR_PARTIAL_420"===e||"YBR_RCT"===e||"YBR_ICT"===e}e.isColorImage=t}(v),function(e){"use strict";e.version="0.13.3"}(v),function(e){function t(e,t,n){if(n+e.length>t.length)return!1;for(var o=n,a=0;a<e.length;a++)if(e[a]!==t[o++])return!1;return!0}function n(e){for(var t=new Uint8Array(e.length),n=0,o=e.length;n<o;n++)t[n]=e.charCodeAt(n);return t}function o(e,o,a){a=a||0;for(var r=n(o),i=a;i<e.length;i++)if(r[0]===e[i]&&t(r,e,i))return i;return-1}e.wadors.findIndexOfString=o}(v),function(e){"use strict";function t(e){for(var t=0;t<e.length;t++)if("--"===e[t].substr(0,2))return e[t]}function n(e){for(var t=0;t<e.length;t++)if("Content-Type:"===e[t].substr(0,13))return e[t].substr(13).trim()}function a(e,t,n){t=t||0,n=n||e.length-t;for(var o="",a=t;a<t+n;a++)o+=String.fromCharCode(e[a]);return o}e.wadors.getPixelData=function(r,i,s){s=s||"application/octet-stream";var l={accept:s},u=o.Deferred(),c=e.internal.xhrRequest(r,i,l);return c.then(function(o){var r=new Uint8Array(o),i=e.wadors.findIndexOfString(r,"\r\n\r\n");i===-1&&u.reject("invalid response - no multipart mime header");var s=a(r,0,i),l=s.split("\r\n"),c=t(l);c||u.reject("invalid response - no boundary marker");var d=i+4,f=e.wadors.findIndexOfString(r,c,d);f===-1&&u.reject("invalid response - terminating boundary not found");var m=f-d-2;u.resolve({contentType:n(l),imageFrame:{pixelData:new Uint8Array(o,d,m)}})}),u.promise()}}(v),function(e,t,n){"use strict";function o(e){return"1.2.840.10008.1.2"}function a(t,a){var r=(new Date).getTime(),i=e.Deferred(),s=t.substring(7),l=n.wadors.metaDataManager.get(t);if(void 0===l)return i.reject("no metadata for imageId "+t),i.promise();var u='multipart/related; type="application/octet-stream"';return n.wadors.getPixelData(s,t,u).then(function(e){var s=o(e.contentType),l=e.imageFrame.pixelData,u=n.createImage(t,l,s,a);u.then(function(e){var t=(new Date).getTime();e.loadTimeInMS=t-r,i.resolve(e)})}).fail(function(e){i.reject(e)}),i}t.registerImageLoader("wadors",a)}(o,m,v),function(e,t,n){"use strict";function o(e,t,o){var a=n.wadors.getValue(e,t,o);if(void 0!==a)return parseFloat(a)}n.wadors.getNumberString=o}(o,m,v),function(e){"use strict";function t(t,n){var o=e.wadors.getValue(t,n);if(void 0!==o)return parseFloat(o)}e.wadors.getNumberValue=t}(v),function(e,t,n){"use strict";function o(e,t){if(e&&e.Value&&!(t&&e.Value.length<t)){for(var n=[],o=0;o<e.Value.length;o++)n.push(parseFloat(e.Value[o]));return n}}n.wadors.getNumberValues=o}(o,m,v),function(e,t,n){"use strict";function o(e,t,n){return t=t||0,e&&e.Value?e.Value.length<=t?n:e.Value[t]:n}n.wadors.getValue=o}(o,m,v),function(e,t){"use strict";function n(e,n){var i=t.wadors.metaDataManager.get(n);if(i){if("generalSeriesModule"===e)return{modality:a(i["00080060"]),seriesInstanceUID:a(i["0020000e"]),seriesNumber:r(i["00200011"]),studyInstanceUID:a(i["0020000d"]),seriesDate:g.parseDA(a(i["00080021"])),seriesTime:g.parseTM(a(i["00080031"],0,""))};if("patientStudyModule"===e)return{patientAge:r(i["00101010"]),patientSize:r(i["00101020"]),patientWeight:r(i["00101030"])};if("imagePlaneModule"===e)return{pixelSpacing:o(i["00280030"],2),imageOrientationPatient:o(i["00200037"],6),imagePositionPatient:o(i["00200032"],3),sliceThickness:r(i["00180050"]),sliceLocation:r(i["00201041"])};if("imagePixelModule"===e)return{samplesPerPixel:a(i["00280002"]),photometricInterpretation:a(i["00280004"]),rows:a(i["00280010"]),columns:a(i["00280011"]),bitsAllocated:a(i["00280100"]),bitsStored:a(i["00280101"]),highBit:a(i["00280102"]),pixelRepresentation:a(i["00280103"]),planarConfiguration:a(i["00280006"]),pixelAspectRatio:a(i["00280034"]),smallestPixelValue:a(i["00280106"]),largestPixelValue:a(i["00280107"]),redPaletteColorLookupTableDescriptor:o(i["00281101"]),greenPaletteColorLookupTableDescriptor:o(i["00281102"]),bluePaletteColorLookupTableDescriptor:o(i["00281103"]),redPaletteColorLookupTableData:o(i["00281201"]),greenPaletteColorLookupTableData:o(i["00281202"]),bluePaletteColorLookupTableData:o(i["00281203"])};if("voiLutModule"===e)return{windowCenter:o(i["00281050"],1),windowWidth:o(i["00281051"],1)};if("modalityLutModule"===e)return{rescaleIntercept:r(i["00281052"]),rescaleSlope:r(i["00281053"]),rescaleType:a(i["00281054"])};if("sopCommonModule"===e)return{sopClassUID:a(i["00080016"]),sopInstanceUID:a(i["00080018"])};if("petIsotopeModule"===e){var s=a(i["00540016"]);if(void 0===s)return;return{radiopharmaceuticalInfo:{radiopharmaceuticalStartTime:g.parseTM(a(s["00181072"],0,"")),radionuclideTotalDose:r(s["00181074"]),radionuclideHalfLife:r(s["00181075"])}}}}}var o=t.wadors.getNumberValues,a=t.wadors.getValue,r=t.wadors.getNumberValue;e.metaData.addProvider(n),t.wadors.metaDataProvider=n}(m,v),function(e){"use strict";function t(e,t){r[e]=t}function n(e){return r[e]}function o(e){r[e]=void 0}function a(){r=[]}var r=[];e.wadors.metaDataManager={add:t,get:n,remove:o,purge:a}}(v),function(e,t){"use strict";function n(e){return void 0!==s[e]}function o(e){if(s[e])return s[e].dataSet}function a(n,o,a){if(o=o||t.internal.xhrRequest,s[n]){var r=e.Deferred();return s[n].cacheCount++,r.resolve(s[n].dataSet),r}if(l[n])return l[n];var i=o(n,a),u=e.Deferred();return i.then(function(e){var t=new Uint8Array(e),o;try{o=g.parseDicom(t)}catch(e){return void u.reject(e)}s[n]={dataSet:o,cacheCount:1},u.resolve(o),delete l[n]},function(){}).always(function(){delete l[n]}),l[n]=u,u}function r(e){s[e]&&(s[e].cacheCount--,0===s[e].cacheCount&&delete s[e])}function i(){s={},l={}}var s={},l={};t.wadouri.dataSetCacheManager={isLoaded:n,load:a,unload:r,purge:i,get:o}}(o,v),function(e){"use strict";function t(e){var t=r.push(e);return"dicomfile:"+(t-1)}function n(e){return r[e]}function o(e){r[e]=void 0}function a(){r=[]}var r=[];e.wadouri.fileManager={add:t,get:n,remove:o,purge:a}}(v),function(e,t,n){"use strict";function o(e){var t=e.intString("x00280008"),n=e.elements.x7fe00010;if(t!=n.fragments.length)return!0}function a(e,t){if(!e.elements.x7fe00010.basicOffsetTable.length){
if(o(e)){var n=g.createJPEGBasicOffsetTable(e,e.elements.x7fe00010);return g.readEncapsulatedImageFrame(e,e.elements.x7fe00010,t,n)}return g.readEncapsulatedPixelDataFromFragments(e,e.elements.x7fe00010,t)}return g.readEncapsulatedImageFrame(e,e.elements.x7fe00010,t)}function r(e,t){return a(e,t)}n.wadouri.getEncapsulatedImageFrame=r}(o,m,v),function(e,t,n){"use strict";function o(e,t){var o=e.elements.x7fe00010,a=e.uint16("x00280100"),r=e.uint16("x00280010"),i=e.uint16("x00280011"),s=e.uint16("x00280002"),l=o.dataOffset,u=r*i*s,c;if(8===a){if(c=l+t*u,c>=e.byteArray.length)throw"frame exceeds size of pixelData";return new Uint8Array(e.byteArray.buffer,c,u)}if(16===a){if(c=l+t*u*2,c>=e.byteArray.length)throw"frame exceeds size of pixelData";return new Uint8Array(e.byteArray.buffer,c,2*u)}if(1===a){if(c=l+t*u*.125,c>=e.byteArray.length)throw"frame exceeds size of pixelData";return n.wadouri.unpackBinaryFrame(e.byteArray,c,u)}throw"unsupported pixel format"}n.wadouri.getUncompressedImageFrame=o}(o,m,v),function(e,t,n){"use strict";function o(t){var o=n.wadouri.parseImageId(t),a=parseInt(o.url),r=n.wadouri.fileManager.get(a),i=e.Deferred(),s=new FileReader;return s.onload=function(e){var t=e.target.result;i.resolve(t)},s.readAsArrayBuffer(r),i.promise()}n.wadouri.loadFileRequest=o}(o,m,v),function(e){"use strict";function t(e,t){if(e.elements[t]&&6==e.elements[t].length)return[e.uint16(t,0),e.uint16(t,1),e.uint16(t,2)]}function n(e,t,n){for(var o=[],a=e.elements[t],r=n[0],i=0;i<r;i++)16===n[2]?o[i]=e.uint16(t,i):o[i]=e.byteArray[i+a.dataOffset];return o}function o(e,o){e.elements.x00281101&&(o.redPaletteColorLookupTableDescriptor=t(e,"x00281101"),o.greenPaletteColorLookupTableDescriptor=t(e,"x00281102"),o.bluePaletteColorLookupTableDescriptor=t(e,"x00281103"),o.redPaletteColorLookupTableData=n(e,"x00281201",o.redPaletteColorLookupTableDescriptor),o.greenPaletteColorLookupTableData=n(e,"x00281202",o.greenPaletteColorLookupTableDescriptor),o.bluePaletteColorLookupTableData=n(e,"x00281203",o.bluePaletteColorLookupTableDescriptor))}function a(e,t){var n=e.uint16("x00280103");0===n?(t.smallestPixelValue=e.uint16("x00280106"),t.largestPixelValue=e.uint16("x00280107")):(t.smallestPixelValue=e.int16("x00280106"),t.largestPixelValue=e.int16("x00280107"))}function r(e){var t={samplesPerPixel:e.uint16("x00280002"),photometricInterpretation:e.string("x00280004"),rows:e.uint16("x00280010"),columns:e.uint16("x00280011"),bitsAllocated:e.uint16("x00280100"),bitsStored:e.uint16("x00280101"),highBit:e.uint16("x00280102"),pixelRepresentation:e.uint16("x00280103"),planarConfiguration:e.uint16("x00280006"),pixelAspectRatio:e.string("x00280034")};return a(e,t),o(e,t),t}e.wadouri.getImagePixelModule=r}(v),function(e){"use strict";function t(e,t){var n=t.uint16("x00283002",0);0===n&&(n=65535);var o=0;o=0===e?t.uint16("x00283002",1):t.int16("x00283002",1);for(var a=t.uint16("x00283002",2),r={id:"1",firstValueMapped:o,numBitsPerEntry:a,lut:[]},i=0;i<n;i++)0===e?r.lut[i]=t.uint16("x00283006",i):r.lut[i]=t.int16("x00283006",i);return r}function n(e,n){if(n&&n.items.length){for(var o=[],a=0;a<n.items.length;a++){var r=n.items[a].dataSet,i=t(e,r);i&&o.push(i)}return o}}e.wadouri.getLUTs=n}(v),function(e){"use strict";function t(e){var t=e.uint16("x00280103"),n=e.uint16("x00280101");return 0===t?0:-1<<n-1}function n(e){var n=e.string("x00080016");if("1.2.840.10008.5.1.4.1.1.2"===n||"1.2.840.10008.5.1.4.1.1.2.1"===n)return 1;var o=e.floatString("x00281052"),a=e.floatString("x00281053");if(void 0!==o&&void 0!==a){var r=t(e),i=r*a+o;return i<0?1:0}return e.elements.x00283000&&e.elements.x00283000.length>0?0:e.uint16("x00280103")}e.wadouri.getModalityLUTOutputPixelRepresentation=n}(v),function(e){"use strict";function t(e,t,n){var o=[],a=e.string(t);if(a){var r=a.split("\\");if(!(n&&r.length<n)){for(var i=0;i<r.length;i++)o.push(parseFloat(r[i]));return o}}}e.wadouri.getNumberValues=t}(v),function(e,t){"use strict";function n(e,n){var a=t.wadouri.parseImageId(n),r=t.wadouri.dataSetCacheManager.get(a.url);if(r){if("generalSeriesModule"===e)return{modality:r.string("x00080060"),seriesInstanceUID:r.string("x0020000e"),seriesNumber:r.intString("x00200011"),studyInstanceUID:r.string("x0020000d"),seriesDate:g.parseDA(r.string("x00080021")),seriesTime:g.parseTM(r.string("x00080031")||"")};if("patientStudyModule"===e)return{patientAge:r.intString("x00101010"),patientSize:r.floatString("x00101020"),patientWeight:r.floatString("x00101030")};if("imagePlaneModule"===e)return{pixelSpacing:o(r,"x00280030",2),imageOrientationPatient:o(r,"x00200037",6),imagePositionPatient:o(r,"x00200032",3),sliceThickness:r.floatString("x00180050"),sliceLocation:r.floatString("x00201041"),frameOfReferenceUID:r.string("x00200052")};if("imagePixelModule"===e)return t.wadouri.getImagePixelModule(r);if("modalityLutModule"===e)return{rescaleIntercept:r.floatString("x00281052"),rescaleSlope:r.floatString("x00281053"),rescaleType:r.string("x00281054"),modalityLUTSequence:t.wadouri.getLUTs(r.uint16("x00280103"),r.elements.x00283000)};if("voiLutModule"===e){var i=t.wadouri.getModalityLUTOutputPixelRepresentation(r);return{windowCenter:o(r,"x00281050",1),windowWidth:o(r,"x00281051",1),voiLUTSequence:t.wadouri.getLUTs(i,r.elements.x00283010)}}if("sopCommonModule"===e)return{sopClassUID:r.string("x00080016"),sopInstanceUID:r.string("x00080018")};if("petIsotopeModule"===e){var s=r.elements.x00540016;if(void 0===s)return;var l=s.items[0].dataSet;return{radiopharmaceuticalInfo:{radiopharmaceuticalStartTime:g.parseTM(l.string("x00181072")||""),radionuclideTotalDose:l.floatString("x00181074"),radionuclideHalfLife:l.floatString("x00181075")}}}}}var o=t.wadouri.getNumberValues;e.metaData.addProvider(n),t.wadouri.metaDataProvider=n}(m,v),function(e){"use strict";function t(e){var t=e.indexOf(":"),n=e.substring(t+1),o=n.indexOf("frame="),a;if(o!==-1){var r=n.substr(o+6);a=parseInt(r),n=n.substr(0,o-1)}return{scheme:e.substr(0,t),url:n,frame:a}}e.wadouri.parseImageId=t}(v),function(e,t,n){"use strict";function o(e,t){return e&1<<t}function a(e,t,n){for(var a=new Uint8Array(n),r=0;r<n;r++){var i=Math.floor(r/8),s=e[i+t],l=r%8;a[r]=o(s,l)?1:0}return a}n.wadouri.unpackBinaryFrame=a}(o,m,v),function(e,t){"use strict";function n(){if(f.length){for(var e=0;e<m.length;e++)if("ready"===m[e].status){m[e].status="busy";var t=f.shift();t.start=(new Date).getTime();var n=(new Date).getTime();return p.totalTimeDelayedInMS+=n-t.added,m[e].task=t,m[e].worker.postMessage({taskType:t.taskType,workerIndex:e,data:t.data},t.transferList),void p.numTasksExecuting++}m.length<g.maxWebWorkers&&a()}}function o(e){if("initialize"===e.data.taskType)m[e.data.workerIndex].status="ready",n();else{p.numTasksExecuting--,m[e.data.workerIndex].status="ready",p.numTasksCompleted++;var t=(new Date).getTime();p.totalTaskTimeInMS+=t-m[e.data.workerIndex].task.start,m[e.data.workerIndex].task.deferred.resolve(e.data.result),m[e.data.workerIndex].task=void 0,n()}}function a(){if(!(m.length>=g.maxWebWorkers)){var e=new Worker(g.webWorkerPath);m.push({worker:e,status:"initializing"}),e.addEventListener("message",o),e.postMessage({taskType:"initialize",workerIndex:m.length-1,config:g})}}function r(e){if(e=e||h,g)throw new Error("WebWorkerManager already initialized");if(g=e,g.maxWebWorkers=g.maxWebWorkers||navigator.hardwareConcurrency||1,!g.startWebWorkersOnDemand)for(var t=0;t<g.maxWebWorkers;t++)a()}function i(e,t){g.webWorkerTaskPaths.push(e),t&&(g.taskConfiguration=Object.assign(g.taskConfiguration,t));for(var n=0;n<m.length;n++)m[n].worker.postMessage({taskType:"loadWebWorkerTask",workerIndex:m.length-1,sourcePath:e,config:g})}function s(t,o,a,i){g||r(),a=a||0;for(var s=e.Deferred(),l=0;l<f.length&&!(f[l].priority<=a);l++);var u=d++;return f.splice(l,0,{taskId:u,taskType:t,status:"ready",added:(new Date).getTime(),data:o,deferred:s,priority:a,transferList:i}),n(),{taskId:u,promise:s.promise()}}function l(e,t){for(var n=0;n<f.length;n++)if(f[n].taskId===e){var o=f.splice(n,1)[0];for(o.priority=t,n=0;n<f.length&&!(f[n].priority<=t);n++);return f.splice(n,0,o),!0}return!1}function u(e,t){for(var n=0;n<f.length;n++)if(f[n].taskId===e){var o=f.splice(n,1);return o.promise.reject(t),!0}return!1}function c(){return p.maxWebWorkers=g.maxWebWorkers,p.numWebWorkers=m.length,p.numTasksQueued=f.length,p}var d=0,f=[],m=[],h={maxWebWorkers:navigator.hardwareConcurrency||1,startWebWorkersOnDemand:!0,webWorkerPath:"../../dist/cornerstoneWADOImageLoaderWebWorker.js",webWorkerTaskPaths:[],taskConfiguration:{decodeTask:{loadCodecsOnStartup:!0,initializeCodecsOnStartup:!1,codecsPath:"../dist/cornerstoneWADOImageLoaderCodecs.js",usePDFJS:!1}}},g,p={maxWebWorkers:0,numWebWorkers:0,numTasksQueued:0,numTasksExecuting:0,numTasksCompleted:0,totalTaskTimeInMS:0,totalTimeDelayedInMS:0};t.webWorkerManager={initialize:r,loadWebWorkerTask:i,addTask:s,getStatistics:c,setTaskPriority:l,cancelTask:u}}(o,v),function(e,t,n){"use strict";function o(o,a,r){r=r||{};var i=e.Deferred(),s=new XMLHttpRequest;return s.open("get",o,!0),s.responseType="arraybuffer",n.internal.options.beforeSend(s),Object.keys(r).forEach(function(e){s.setRequestHeader(e,r[e])}),s.onreadystatechange=function(){4===s.readyState&&(200===s.status?i.resolve(s.response,s):i.reject(s))},s.onprogress=function(n){if(n.lengthComputable){var o=n.loaded,r=n.total,i=Math.round(o/r*100);e(t).trigger("CornerstoneImageLoadProgress",{imageId:a,loaded:o,total:r,percentComplete:i})}},s.send(),i.promise()}n.internal.xhrRequest=o}(o,m,v),function(e,t){"undefined"!=typeof module&&module.exports?module.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"==typeof m&&(g={},"undefined"!=typeof Package&&(e.dicomParser=g)),g=t())}(this,function(){var e=function(e){return void 0===e&&(e={}),e.parseDicom=function(t,n){function o(n){if(void 0===n.elements.x00020010)throw"dicomParser.parseDicom: missing required meta header attribute 0002,0010";var o=n.elements.x00020010;return e.readFixedString(t,o.dataOffset,o.length)}function a(e){return"1.2.840.10008.1.2"!==e}function r(o,a){if("1.2.840.10008.1.2.1.99"===o){if(n&&n.inflater){var r=n.inflater(t,a);return new e.ByteStream(e.littleEndianByteArrayParser,r,0)}if("undefined"!=typeof module&&this.module!==module){var i=y("zlib"),s=e.sharedCopy(t,a,t.length-a),l=i.inflateRawSync(s),u=e.alloc(t,l.length+a);return t.copy(u,0,0,a),l.copy(u,a),new e.ByteStream(e.littleEndianByteArrayParser,u,0)}if("undefined"!=typeof pako){var c=t.slice(a),d=pako.inflateRaw(c),f=e.alloc(t,d.length+a);return f.set(t.slice(0,a),0),f.set(d,a),new e.ByteStream(e.littleEndianByteArrayParser,f,0)}throw"dicomParser.parseDicom: no inflater available to handle deflate transfer syntax"}return"1.2.840.10008.1.2.2"===o?new e.ByteStream(e.bigEndianByteArrayParser,t,a):new e.ByteStream(e.littleEndianByteArrayParser,t,a)}function i(e,t){for(var n in e.elements)e.elements.hasOwnProperty(n)&&(t.elements[n]=e.elements[n]);return void 0!==e.warnings&&(t.warnings=e.warnings.concat(t.warnings)),t}function s(t){var i=o(t),s=a(i),l=r(i,t.position),u={},c=new e.DataSet(l.byteArrayParser,l.byteArray,u);c.warnings=l.warnings;try{s?e.parseDicomDataSetExplicit(c,l,l.byteArray.length,n):e.parseDicomDataSetImplicit(c,l,l.byteArray.length,n)}catch(e){var d={exception:e,dataSet:c};throw d}return c}function l(){var o=e.readPart10Header(t,n),a=s(o);return i(o,a)}if(void 0===t)throw"dicomParser.parseDicom: missing required parameter 'byteArray'";return l()},e}(e),e=function(e){"use strict";function t(e,t){return 255===e.byteArray[t]&&217===e.byteArray[t+1]}function n(e,n,o){var a=n.fragments[o];return!(!t(e,a.position+a.length-2)&&!t(e,a.position+a.length-3))}function o(e,t,o){for(var a=o;a<t.fragments.length;a++)if(n(e,t,a))return a}return void 0===e&&(e={}),e.createJPEGBasicOffsetTable=function(e,t,n){if(void 0===e)throw"dicomParser.createJPEGBasicOffsetTable: missing required parameter dataSet";if(void 0===t)throw"dicomParser.createJPEGBasicOffsetTable: missing required parameter pixelDataElement";if("x7fe00010"!==t.tag)throw"dicomParser.createJPEGBasicOffsetTable: parameter 'pixelDataElement' refers to non pixel data tag (expected tag = x7fe00010'";if(t.encapsulatedPixelData!==!0)throw"dicomParser.createJPEGBasicOffsetTable: parameter 'pixelDataElement' refers to pixel data element that does not have encapsulated pixel data";if(t.hadUndefinedLength!==!0)throw"dicomParser.createJPEGBasicOffsetTable: parameter 'pixelDataElement' refers to pixel data element that does not have encapsulated pixel data";if(void 0===t.basicOffsetTable)throw"dicomParser.createJPEGBasicOffsetTable: parameter 'pixelDataElement' refers to pixel data element that does not have encapsulated pixel data";if(void 0===t.fragments)throw"dicomParser.createJPEGBasicOffsetTable: parameter 'pixelDataElement' refers to pixel data element that does not have encapsulated pixel data";if(t.fragments.length<=0)throw"dicomParser.createJPEGBasicOffsetTable: parameter 'pixelDataElement' refers to pixel data element that does not have encapsulated pixel data";if(n&&n.length<=0)throw"dicomParser.createJPEGBasicOffsetTable: parameter 'fragments' must not be zero length";n=n||t.fragments;for(var a=[],r=0;;){a.push(t.fragments[r].offset);var i=o(e,t,r);if(void 0===i||i===t.fragments.length-1)return a;r=i+1}},e}(e),e=function(e){"use strict";return void 0===e&&(e={}),e.explicitDataSetToJS=function(t,n){if(void 0===t)throw"dicomParser.explicitDataSetToJS: missing required parameter dataSet";n=n||{omitPrivateAttibutes:!0,maxElementLength:128};var o={};for(var a in t.elements){var r=t.elements[a];if(n.omitPrivateAttibutes!==!0||!e.isPrivateTag(a))if(r.items){for(var i=[],s=0;s<r.items.length;s++)i.push(e.explicitDataSetToJS(r.items[s].dataSet,n));o[a]=i}else{var l;l=void 0,r.length<n.maxElementLength&&(l=e.explicitElementToString(t,r)),void 0!==l?o[a]=l:o[a]={dataOffset:r.dataOffset,length:r.length}}}return o},e}(e),e=function(e){"use strict";return void 0===e&&(e={}),e.explicitElementToString=function(t,n){function o(e,n){for(var o="",a=0;a<e;a++)0!==a&&(o+="/"),o+=n.call(t,r,a).toString();return o}if(void 0===t||void 0===n)throw"dicomParser.explicitElementToString: missing required parameters";if(void 0===n.vr)throw"dicomParser.explicitElementToString: cannot convert implicit element to string";var a=n.vr,r=n.tag,i;if(e.isStringVr(a)===!0)i=t.string(r);else{if("AT"==a){var s=t.uint32(r);if(void 0===s)return;return s<0&&(s=4294967295+s+1),"x"+s.toString(16).toUpperCase()}"US"==a?i=o(n.length/2,t.uint16):"SS"===a?i=o(n.length/2,t.int16):"UL"==a?i=o(n.length/4,t.uint32):"SL"===a?i=o(n.length/4,t.int32):"FD"==a?i=o(n.length/8,t.double):"FL"==a&&(i=o(n.length/4,t.float))}return i},e}(e),e=function(e){"use strict";function t(e,t){switch(e){case 2:return t%4==0&&t%100||t%400==0?29:28;case 9:case 4:case 6:case 11:return 30;default:return 31}}function n(e,n,o){return!isNaN(o)&&(n>0&&n<=12&&e>0&&e<=t(n,o))}return void 0===e&&(e={}),e.parseDA=function(e,t){if(e&&8===e.length){var o=parseInt(e.substring(0,4),10),a=parseInt(e.substring(4,6),10),r=parseInt(e.substring(6,8),10);if(t&&n(r,a,o)!==!0)throw"invalid DA '"+e+"'";return{year:o,month:a,day:r}}if(t)throw"invalid DA '"+e+"'"},e}(e),e=function(e){"use strict";return void 0===e&&(e={}),e.parseTM=function(e,t){if(e.length>=2){var n=parseInt(e.substring(0,2),10),o=e.length>=4?parseInt(e.substring(2,4),10):void 0,a=e.length>=6?parseInt(e.substring(4,6),10):void 0,r=e.length>=8?parseInt(e.substring(7,13),10):void 0;if(t&&(isNaN(n)||void 0!==o&&isNaN(o)||void 0!==a&&isNaN(a)||void 0!==r&&isNaN(r)||n<0||n>23||o&&(o<0||o>59)||a&&(a<0||a>59)||r&&(r<0||r>999999)))throw"invalid TM '"+e+"'";return{hours:n,minutes:o,seconds:a,fractionalSeconds:r}}if(t)throw"invalid TM '"+e+"'"},e}(e),e=function(e){"use strict";void 0===e&&(e={});var t={AE:!0,AS:!0,AT:!1,CS:!0,DA:!0,DS:!0,DT:!0,FL:!1,FD:!1,IS:!0,LO:!0,LT:!0,OB:!1,OD:!1,OF:!1,OW:!1,PN:!0,SH:!0,SL:!1,SQ:!1,SS:!1,ST:!0,TM:!0,UI:!0,UL:!1,UN:void 0,UR:!0,US:!1,UT:!0};return e.isStringVr=function(e){return t[e]},e.isPrivateTag=function(e){var t=parseInt(e[4]),n=t%2===1;return n},e.parsePN=function(e){if(void 0!==e){var t=e.split("^");return{familyName:t[0],givenName:t[1],middleName:t[2],prefix:t[3],suffix:t[4]}}},e}(e),e=function(e){"use strict";void 0===e&&(e={});var t=!1;return e.readEncapsulatedPixelData=function(n,o,a){if(t||(t=!0,console&&console.log&&console.log("WARNING: dicomParser.readEncapsulatedPixelData() has been deprecated")),void 0===n)throw"dicomParser.readEncapsulatedPixelData: missing required parameter 'dataSet'";if(void 0===o)throw"dicomParser.readEncapsulatedPixelData: missing required parameter 'element'";if(void 0===a)throw"dicomParser.readEncapsulatedPixelData: missing required parameter 'frame'";if("x7fe00010"!==o.tag)throw"dicomParser.readEncapsulatedPixelData: parameter 'element' refers to non pixel data tag (expected tag = x7fe00010'";if(o.encapsulatedPixelData!==!0)throw"dicomParser.readEncapsulatedPixelData: parameter 'element' refers to pixel data element that does not have encapsulated pixel data";if(o.hadUndefinedLength!==!0)throw"dicomParser.readEncapsulatedPixelData: parameter 'element' refers to pixel data element that does not have encapsulated pixel data";if(void 0===o.basicOffsetTable)throw"dicomParser.readEncapsulatedPixelData: parameter 'element' refers to pixel data element that does not have encapsulated pixel data";if(void 0===o.fragments)throw"dicomParser.readEncapsulatedPixelData: parameter 'element' refers to pixel data element that does not have encapsulated pixel data";if(a<0)throw"dicomParser.readEncapsulatedPixelData: parameter 'frame' must be >= 0";return 0!==o.basicOffsetTable.length?e.readEncapsulatedImageFrame(n,o,a):e.readEncapsulatedPixelDataFromFragments(n,o,0,o.fragments.length)},e}(e),e=function(e){"use strict";return void 0===e&&(e={}),e.alloc=function(e,t){if("undefined"!=typeof i&&e instanceof i)return i.alloc(t);if(e instanceof Uint8Array)return new Uint8Array(t);throw"dicomParser.alloc: unknown type for byteArray"},e}(e),e=function(e){"use strict";return void 0===e&&(e={}),e.bigEndianByteArrayParser={readUint16:function(e,t){if(t<0)throw"bigEndianByteArrayParser.readUint16: position cannot be less than 0";if(t+2>e.length)throw"bigEndianByteArrayParser.readUint16: attempt to read past end of buffer";return(e[t]<<8)+e[t+1]},readInt16:function(e,t){if(t<0)throw"bigEndianByteArrayParser.readInt16: position cannot be less than 0";if(t+2>e.length)throw"bigEndianByteArrayParser.readInt16: attempt to read past end of buffer";var n=(e[t]<<8)+e[t+1];return 32768&n&&(n=n-65535-1),n},readUint32:function(e,t){if(t<0)throw"bigEndianByteArrayParser.readUint32: position cannot be less than 0";if(t+4>e.length)throw"bigEndianByteArrayParser.readUint32: attempt to read past end of buffer";var n=256*(256*(256*e[t]+e[t+1])+e[t+2])+e[t+3];return n},readInt32:function(e,t){if(t<0)throw"bigEndianByteArrayParser.readInt32: position cannot be less than 0";if(t+4>e.length)throw"bigEndianByteArrayParser.readInt32: attempt to read past end of buffer";var n=(e[t]<<24)+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];return n},readFloat:function(e,t){if(t<0)throw"bigEndianByteArrayParser.readFloat: position cannot be less than 0";if(t+4>e.length)throw"bigEndianByteArrayParser.readFloat: attempt to read past end of buffer";var n=new Uint8Array(4);n[3]=e[t],n[2]=e[t+1],n[1]=e[t+2],n[0]=e[t+3];var o=new Float32Array(n.buffer);return o[0]},readDouble:function(e,t){if(t<0)throw"bigEndianByteArrayParser.readDouble: position cannot be less than 0";if(t+8>e.length)throw"bigEndianByteArrayParser.readDouble: attempt to read past end of buffer";var n=new Uint8Array(8);n[7]=e[t],n[6]=e[t+1],n[5]=e[t+2],n[4]=e[t+3],n[3]=e[t+4],n[2]=e[t+5],n[1]=e[t+6],n[0]=e[t+7];var o=new Float64Array(n.buffer);return o[0]}},e}(e),e=function(e){"use strict";return void 0===e&&(e={}),e.readFixedString=function(e,t,n){if(n<0)throw"dicomParser.readFixedString - length cannot be less than 0";if(t+n>e.length)throw"dicomParser.readFixedString: attempt to read past end of buffer";for(var o="",a,r=0;r<n;r++){if(a=e[t+r],0===a)return t+=n,o;o+=String.fromCharCode(a)}return o},e}(e),e=function(e){"use strict";return void 0===e&&(e={}),e.ByteStream=function(e,t,n){if(void 0===e)throw"dicomParser.ByteStream: missing required parameter 'byteArrayParser'";if(void 0===t)throw"dicomParser.ByteStream: missing required parameter 'byteArray'";if(t instanceof Uint8Array==!1&&t instanceof i==!1)throw"dicomParser.ByteStream: parameter byteArray is not of type Uint8Array or Buffer";if(n<0)throw"dicomParser.ByteStream: parameter 'position' cannot be less than 0";if(n>=t.length)throw"dicomParser.ByteStream: parameter 'position' cannot be greater than or equal to 'byteArray' length";this.byteArrayParser=e,this.byteArray=t,this.position=n?n:0,this.warnings=[]},e.ByteStream.prototype.seek=function(e){if(this.position+e<0)throw"dicomParser.ByteStream.prototype.seek: cannot seek to position < 0";this.position+=e},e.ByteStream.prototype.readByteStream=function(t){if(this.position+t>this.byteArray.length)throw"dicomParser.ByteStream.prototype.readByteStream: readByteStream - buffer overread";var n=e.sharedCopy(this.byteArray,this.position,t);return this.position+=t,new e.ByteStream(this.byteArrayParser,n)},e.ByteStream.prototype.readUint16=function(){var e=this.byteArrayParser.readUint16(this.byteArray,this.position);return this.position+=2,e},e.ByteStream.prototype.readUint32=function(){var e=this.byteArrayParser.readUint32(this.byteArray,this.position);return this.position+=4,e},e.ByteStream.prototype.readFixedString=function(t){var n=e.readFixedString(this.byteArray,this.position,t);return this.position+=t,n},e}(e),e=function(e){"use strict";function t(e,t){return void 0!==e.parser?e.parser:t}return void 0===e&&(e={}),e.DataSet=function(e,t,n){this.byteArrayParser=e,this.byteArray=t,this.elements=n},e.DataSet.prototype.uint16=function(e,n){var o=this.elements[e];if(n=void 0!==n?n:0,o&&0!==o.length)return t(o,this.byteArrayParser).readUint16(this.byteArray,o.dataOffset+2*n)},e.DataSet.prototype.int16=function(e,n){var o=this.elements[e];if(n=void 0!==n?n:0,o&&0!==o.length)return t(o,this.byteArrayParser).readInt16(this.byteArray,o.dataOffset+2*n)},e.DataSet.prototype.uint32=function(e,n){var o=this.elements[e];if(n=void 0!==n?n:0,o&&0!==o.length)return t(o,this.byteArrayParser).readUint32(this.byteArray,o.dataOffset+4*n)},e.DataSet.prototype.int32=function(e,n){var o=this.elements[e];if(n=void 0!==n?n:0,o&&0!==o.length)return t(o,this.byteArrayParser).readInt32(this.byteArray,o.dataOffset+4*n)},e.DataSet.prototype.float=function(e,n){var o=this.elements[e];if(n=void 0!==n?n:0,o&&0!==o.length)return t(o,this.byteArrayParser).readFloat(this.byteArray,o.dataOffset+4*n)},e.DataSet.prototype.double=function(e,n){var o=this.elements[e];if(n=void 0!==n?n:0,o&&0!==o.length)return t(o,this.byteArrayParser).readDouble(this.byteArray,o.dataOffset+8*n)},e.DataSet.prototype.numStringValues=function(t){var n=this.elements[t];if(n&&n.length>0){var o=e.readFixedString(this.byteArray,n.dataOffset,n.length),a=o.match(/\\/g);return null===a?1:a.length+1}},e.DataSet.prototype.string=function(t,n){var o=this.elements[t];if(o&&o.length>0){var a=e.readFixedString(this.byteArray,o.dataOffset,o.length);if(n>=0){var r=a.split("\\");return r[n].trim()}return a.trim()}},e.DataSet.prototype.text=function(t,n){var o=this.elements[t];if(o&&o.length>0){var a=e.readFixedString(this.byteArray,o.dataOffset,o.length);if(n>=0){var r=a.split("\\");return r[n].replace(/ +$/,"")}return a.replace(/ +$/,"")}},e.DataSet.prototype.floatString=function(e,t){var n=this.elements[e];if(n&&n.length>0){t=void 0!==t?t:0;var o=this.string(e,t);if(void 0!==o)return parseFloat(o)}},e.DataSet.prototype.intString=function(e,t){var n=this.elements[e];if(n&&n.length>0){t=void 0!==t?t:0;var o=this.string(e,t);if(void 0!==o)return parseInt(o)}},e}(e),e=function(e){"use strict";return void 0===e&&(e={}),e.findAndSetUNElementLength=function(e,t){if(void 0===e)throw"dicomParser.findAndSetUNElementLength: missing required parameter 'byteStream'";for(var n=8,o=e.byteArray.length-n;e.position<=o;){var a;if(a=e.readUint16(),65534===a){var r;if(r=e.readUint16(),57565===r){var i;return i=e.readUint32(),0!==i&&e.warnings("encountered non zero length following item delimiter at position"+e.position-4+" while reading element of undefined length with tag ' + element.tag"),void(t.length=e.position-t.dataOffset)}}}t.length=e.byteArray.length-t.dataOffset,e.seek(e.byteArray.length-e.position)},e}(e),e=function(e){"use strict";return void 0===e&&(e={}),e.findEndOfEncapsulatedElement=function(t,n,o){if(void 0===t)throw"dicomParser.findEndOfEncapsulatedElement: missing required parameter 'byteStream'";if(void 0===n)throw"dicomParser.findEndOfEncapsulatedElement: missing required parameter 'element'";n.encapsulatedPixelData=!0,n.basicOffsetTable=[],n.fragments=[];var a=e.readTag(t);if("xfffee000"!==a)throw"dicomParser.findEndOfEncapsulatedElement: basic offset table not found";for(var r=t.readUint32(),i=r/4,s=0;s<i;s++){var l=t.readUint32();n.basicOffsetTable.push(l)}for(var u=t.position;t.position<t.byteArray.length;){var c=e.readTag(t),d=t.readUint32();if("xfffee0dd"===c)return t.seek(d),void(n.length=t.position-n.dataOffset);if("xfffee000"!==c)return o&&o.push("unexpected tag "+c+" while searching for end of pixel data element with undefined length"),d>t.byteArray.length-t.position&&(d=t.byteArray.length-t.position),n.fragments.push({offset:t.position-u-8,position:t.position,length:d}),t.seek(d),void(n.length=t.position-n.dataOffset);n.fragments.push({offset:t.position-u-8,position:t.position,length:d}),t.seek(d)}o&&o.push("pixel data element "+n.tag+" missing sequence delimiter tag xfffee0dd")},e}(e),e=function(e){"use strict";return void 0===e&&(e={}),e.findItemDelimitationItemAndSetElementLength=function(e,t){if(void 0===e)throw"dicomParser.readDicomElementImplicit: missing required parameter 'byteStream'";for(var n=8,o=e.byteArray.length-n;e.position<=o;){var a=e.readUint16();if(65534===a){var r=e.readUint16();if(57357===r){var i=e.readUint32();return 0!==i&&e.warnings("encountered non zero length following item delimiter at position"+e.position-4+" while reading element of undefined length with tag ' + element.tag"),void(t.length=e.position-t.dataOffset)}}}t.length=e.byteArray.length-t.dataOffset,e.seek(e.byteArray.length-e.position)},e}(e),e=function(e){"use strict";return void 0===e&&(e={}),e.littleEndianByteArrayParser={readUint16:function(e,t){if(t<0)throw"littleEndianByteArrayParser.readUint16: position cannot be less than 0";if(t+2>e.length)throw"littleEndianByteArrayParser.readUint16: attempt to read past end of buffer";return e[t]+256*e[t+1]},readInt16:function(e,t){if(t<0)throw"littleEndianByteArrayParser.readInt16: position cannot be less than 0";if(t+2>e.length)throw"littleEndianByteArrayParser.readInt16: attempt to read past end of buffer";var n=e[t]+(e[t+1]<<8);return 32768&n&&(n=n-65535-1),n},readUint32:function(e,t){if(t<0)throw"littleEndianByteArrayParser.readUint32: position cannot be less than 0";if(t+4>e.length)throw"littleEndianByteArrayParser.readUint32: attempt to read past end of buffer";var n=e[t]+256*e[t+1]+256*e[t+2]*256+256*e[t+3]*256*256;return n},readInt32:function(e,t){if(t<0)throw"littleEndianByteArrayParser.readInt32: position cannot be less than 0";if(t+4>e.length)throw"littleEndianByteArrayParser.readInt32: attempt to read past end of buffer";var n=e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24);return n},readFloat:function(e,t){if(t<0)throw"littleEndianByteArrayParser.readFloat: position cannot be less than 0";if(t+4>e.length)throw"littleEndianByteArrayParser.readFloat: attempt to read past end of buffer";var n=new Uint8Array(4);n[0]=e[t],n[1]=e[t+1],n[2]=e[t+2],n[3]=e[t+3];var o=new Float32Array(n.buffer);return o[0]},readDouble:function(e,t){if(t<0)throw"littleEndianByteArrayParser.readDouble: position cannot be less than 0";if(t+8>e.length)throw"littleEndianByteArrayParser.readDouble: attempt to read past end of buffer";var n=new Uint8Array(8);n[0]=e[t],n[1]=e[t+1],n[2]=e[t+2],n[3]=e[t+3],n[4]=e[t+4],n[5]=e[t+5],n[6]=e[t+6],n[7]=e[t+7];var o=new Float64Array(n.buffer);return o[0]}},e}(e),e=function(e){"use strict";return void 0===e&&(e={}),e.parseDicomDataSetExplicit=function(t,n,o,a){if(o=void 0===o?n.byteArray.length:o,a=a||{},void 0===n)throw"dicomParser.parseDicomDataSetExplicit: missing required parameter 'byteStream'";if(o<n.position||o>n.byteArray.length)throw"dicomParser.parseDicomDataSetExplicit: invalid value for parameter 'maxPosition'";for(var r=t.elements;n.position<o;){var i=e.readDicomElementExplicit(n,t.warnings,a.untilTag);if(r[i.tag]=i,i.tag===a.untilTag)return}if(n.position>o)throw"dicomParser:parseDicomDataSetExplicit: buffer overrun"},e.parseDicomDataSetImplicit=function(t,n,o,a){if(o=void 0===o?t.byteArray.length:o,a=a||{},void 0===n)throw"dicomParser.parseDicomDataSetImplicit: missing required parameter 'byteStream'";if(o<n.position||o>n.byteArray.length)throw"dicomParser.parseDicomDataSetImplicit: invalid value for parameter 'maxPosition'";for(var r=t.elements;n.position<o;){var i=e.readDicomElementImplicit(n,a.untilTag,a.vrCallback);if(r[i.tag]=i,i.tag===a.untilTag)return}},e}(e),e=function(e){"use strict";function t(e){return"OB"===e||"OW"===e||"SQ"===e||"OF"===e||"UT"===e||"UN"===e?4:2}return void 0===e&&(e={}),e.readDicomElementExplicit=function(n,o,a){if(void 0===n)throw"dicomParser.readDicomElementExplicit: missing required parameter 'byteStream'";var r={tag:e.readTag(n),vr:n.readFixedString(2)},i=t(r.vr);return 2===i?(r.length=n.readUint16(),r.dataOffset=n.position):(n.seek(2),r.length=n.readUint32(),r.dataOffset=n.position),4294967295===r.length&&(r.hadUndefinedLength=!0),r.tag===a?r:"SQ"===r.vr?(e.readSequenceItemsExplicit(n,r,o),r):4294967295===r.length?"x7fe00010"===r.tag?(e.findEndOfEncapsulatedElement(n,r,o),r):"UN"===r.vr?(e.findAndSetUNElementLength(n,r),r):(e.findItemDelimitationItemAndSetElementLength(n,r),r):(n.seek(r.length),r)},e}(e),e=function(e){"use strict";function t(t,n,o){if("undefined"!=typeof o)return"SQ"===o(t.tag);if(n.position+4<=n.byteArray.length){var a=e.readTag(n);return n.seek(-4),"xfffee000"===a||"xfffee0dd"===a}return n.warnings.push("eof encountered before finding sequence item tag or sequence delimiter tag in peeking to determine VR"),!1}return void 0===e&&(e={}),e.readDicomElementImplicit=function(n,o,a){if(void 0===n)throw"dicomParser.readDicomElementImplicit: missing required parameter 'byteStream'";var r={tag:e.readTag(n),length:n.readUint32(),dataOffset:n.position};return 4294967295===r.length&&(r.hadUndefinedLength=!0),r.tag===o?r:t(r,n,a)?(e.readSequenceItemsImplicit(n,r),r):r.hadUndefinedLength?(e.findItemDelimitationItemAndSetElementLength(n,r),r):(n.seek(r.length),r)},e}(e),e=function(e){"use strict";function t(e,t){for(var n=0;n<e.length;n++)if(e[n].offset===t)return n}function n(e,t,n,o){if(e===t.length-1)return n.length-o;for(var a=t[e+1],r=o+1;r<n.length;r++)if(n[r].offset===a)return r-o;throw"dicomParser.calculateNumberOfFragmentsForFrame: could not find fragment with offset matching basic offset table"}return void 0===e&&(e={}),e.readEncapsulatedImageFrame=function(o,a,r,i,s){if(i=i||a.basicOffsetTable,s=s||a.fragments,void 0===o)throw"dicomParser.readEncapsulatedImageFrame: missing required parameter 'dataSet'";if(void 0===a)throw"dicomParser.readEncapsulatedImageFrame: missing required parameter 'pixelDataElement'";if(void 0===r)throw"dicomParser.readEncapsulatedImageFrame: missing required parameter 'frameIndex'";if(void 0===i)throw"dicomParser.readEncapsulatedImageFrame: parameter 'pixelDataElement' does not have basicOffsetTable";if("x7fe00010"!==a.tag)throw"dicomParser.readEncapsulatedImageFrame: parameter 'pixelDataElement' refers to non pixel data tag (expected tag = x7fe00010'";if(a.encapsulatedPixelData!==!0)throw"dicomParser.readEncapsulatedImageFrame: parameter 'pixelDataElement' refers to pixel data element that does not have encapsulated pixel data";
if(a.hadUndefinedLength!==!0)throw"dicomParser.readEncapsulatedImageFrame: parameter 'pixelDataElement' refers to pixel data element that does not have undefined length";if(void 0===a.fragments)throw"dicomParser.readEncapsulatedImageFrame: parameter 'pixelDataElement' refers to pixel data element that does not have fragments";if(0===i.length)throw"dicomParser.readEncapsulatedImageFrame: basicOffsetTable has zero entries";if(r<0)throw"dicomParser.readEncapsulatedImageFrame: parameter 'frameIndex' must be >= 0";if(r>=i.length)throw"dicomParser.readEncapsulatedImageFrame: parameter 'frameIndex' must be < basicOffsetTable.length";var l=i[r],u=t(s,l);if(void 0===u)throw"dicomParser.readEncapsulatedImageFrame: unable to find fragment that matches basic offset table entry";var c=n(r,i,s,u);return e.readEncapsulatedPixelDataFromFragments(o,a,u,c,s)},e}(e),e=function(e){"use strict";function t(e,t,n){for(var o=0,a=t;a<t+n;a++)o+=e[a].length;return o}return void 0===e&&(e={}),e.readEncapsulatedPixelDataFromFragments=function(n,o,a,r,i){if(r=r||1,i=i||o.fragments,void 0===n)throw"dicomParser.readEncapsulatedPixelDataFromFragments: missing required parameter 'dataSet'";if(void 0===o)throw"dicomParser.readEncapsulatedPixelDataFromFragments: missing required parameter 'pixelDataElement'";if(void 0===a)throw"dicomParser.readEncapsulatedPixelDataFromFragments: missing required parameter 'startFragmentIndex'";if(void 0===r)throw"dicomParser.readEncapsulatedPixelDataFromFragments: missing required parameter 'numFragments'";if("x7fe00010"!==o.tag)throw"dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'pixelDataElement' refers to non pixel data tag (expected tag = x7fe00010'";if(o.encapsulatedPixelData!==!0)throw"dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'pixelDataElement' refers to pixel data element that does not have encapsulated pixel data";if(o.hadUndefinedLength!==!0)throw"dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'pixelDataElement' refers to pixel data element that does not have encapsulated pixel data";if(void 0===o.basicOffsetTable)throw"dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'pixelDataElement' refers to pixel data element that does not have encapsulated pixel data";if(void 0===o.fragments)throw"dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'pixelDataElement' refers to pixel data element that does not have encapsulated pixel data";if(o.fragments.length<=0)throw"dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'pixelDataElement' refers to pixel data element that does not have encapsulated pixel data";if(a<0)throw"dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'startFragmentIndex' must be >= 0";if(a>=o.fragments.length)throw"dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'startFragmentIndex' must be < number of fragments";if(r<1)throw"dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'numFragments' must be > 0";if(a+r>o.fragments.length)throw"dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'startFragment' + 'numFragments' < number of fragments";var s=new e.ByteStream(n.byteArrayParser,n.byteArray,o.dataOffset),l=e.readSequenceItem(s);if("xfffee000"!==l.tag)throw"dicomParser.readEncapsulatedPixelData: missing basic offset table xfffee000";s.seek(l.length);var u=s.position,c=8;if(1===r)return e.sharedCopy(s.byteArray,u+i[a].offset+c,i[a].length);for(var d=t(i,a,r),f=e.alloc(s.byteArray,d),m=0,h=a;h<a+r;h++)for(var g=u+i[h].offset+c,p=0;p<i[h].length;p++)f[m++]=s.byteArray[g++];return f},e}(e),e=function(e){return void 0===e&&(e={}),e.readPart10Header=function(t,n){function o(){r.seek(128);var e=r.readFixedString(4);if("DICM"!==e)throw"dicomParser.readPart10Header: DICM prefix not found at location 132 - this is not a valid DICOM P10 file."}function a(){o();for(var t=[],n={};r.position<r.byteArray.length;){var a=r.position,i=e.readDicomElementExplicit(r,t);if(i.tag>"x0002ffff"){r.position=a;break}i.parser=e.littleEndianByteArrayParser,n[i.tag]=i}var s=new e.DataSet(r.byteArrayParser,r.byteArray,n);return s.warnings=r.warnings,s.position=r.position,s}if(void 0===t)throw"dicomParser.readPart10Header: missing required parameter 'byteArray'";var r=new e.ByteStream(e.littleEndianByteArrayParser,t);return a()},e}(e),e=function(e){"use strict";function t(t,n){for(var o={};t.position<t.byteArray.length;){var a=e.readDicomElementExplicit(t,n);if(o[a.tag]=a,"xfffee00d"===a.tag)return new e.DataSet(t.byteArrayParser,t.byteArray,o)}return n.push("eof encountered before finding item delimiter tag while reading sequence item of undefined length"),new e.DataSet(t.byteArrayParser,t.byteArray,o)}function n(n,o){var a=e.readSequenceItem(n);return 4294967295===a.length?(a.hadUndefinedLength=!0,a.dataSet=t(n,o),a.length=n.position-a.dataOffset):(a.dataSet=new e.DataSet(n.byteArrayParser,n.byteArray,{}),e.parseDicomDataSetExplicit(a.dataSet,n,n.position+a.length)),a}function o(t,o,a){for(;t.position+4<=t.byteArray.length;){var r=e.readTag(t);if(t.seek(-4),"xfffee0dd"===r)return o.length=t.position-o.dataOffset,t.seek(8),o;var i=n(t,a);o.items.push(i)}a.push("eof encountered before finding sequence delimitation tag while reading sequence of undefined length"),o.length=t.position-o.dataOffset}function a(e,t,o){for(var a=t.dataOffset+t.length;e.position<a;){var r=n(e,o);t.items.push(r)}}return void 0===e&&(e={}),e.readSequenceItemsExplicit=function(e,t,n){if(void 0===e)throw"dicomParser.readSequenceItemsExplicit: missing required parameter 'byteStream'";if(void 0===t)throw"dicomParser.readSequenceItemsExplicit: missing required parameter 'element'";t.items=[],4294967295===t.length?o(e,t,n):a(e,t,n)},e}(e),e=function(e){"use strict";function t(t,n){for(var o={};t.position<t.byteArray.length;){var a=e.readDicomElementImplicit(t,void 0,n);if(o[a.tag]=a,"xfffee00d"===a.tag)return new e.DataSet(t.byteArrayParser,t.byteArray,o)}return t.warnings.push("eof encountered before finding sequence item delimiter in sequence item of undefined length"),new e.DataSet(t.byteArrayParser,t.byteArray,o)}function n(n,o){var a=e.readSequenceItem(n);return 4294967295===a.length?(a.hadUndefinedLength=!0,a.dataSet=t(n,o),a.length=n.position-a.dataOffset):(a.dataSet=new e.DataSet(n.byteArrayParser,n.byteArray,{}),e.parseDicomDataSetImplicit(a.dataSet,n,n.position+a.length,{vrCallback:o})),a}function o(t,o,a){for(;t.position+4<=t.byteArray.length;){var r=e.readTag(t);if(t.seek(-4),"xfffee0dd"===r)return o.length=t.position-o.dataOffset,t.seek(8),o;var i=n(t,a);o.items.push(i)}t.warnings.push("eof encountered before finding sequence delimiter in sequence of undefined length"),o.length=t.byteArray.length-o.dataOffset}function a(e,t,o){for(var a=t.dataOffset+t.length;e.position<a;){var r=n(e,o);t.items.push(r)}}return void 0===e&&(e={}),e.readSequenceItemsImplicit=function(e,t,n){if(void 0===e)throw"dicomParser.readSequenceItemsImplicit: missing required parameter 'byteStream'";if(void 0===t)throw"dicomParser.readSequenceItemsImplicit: missing required parameter 'element'";t.items=[],4294967295===t.length?o(e,t,n):a(e,t,n)},e}(e),e=function(e){"use strict";return void 0===e&&(e={}),e.readSequenceItem=function(t){if(void 0===t)throw"dicomParser.readSequenceItem: missing required parameter 'byteStream'";var n={tag:e.readTag(t),length:t.readUint32(),dataOffset:t.position};if("xfffee000"!==n.tag){var o=t.position;throw"dicomParser.readSequenceItem: item tag (FFFE,E000) not found at offset "+o}return n},e}(e),e=function(e){"use strict";return void 0===e&&(e={}),e.readTag=function(e){if(void 0===e)throw"dicomParser.readTag: missing required parameter 'byteStream'";var t=256*e.readUint16()*256,n=e.readUint16(),o="x"+("00000000"+(t+n).toString(16)).substr(-8);return o},e}(e),e=function(e){"use strict";return void 0===e&&(e={}),e.sharedCopy=function(e,t,n){if("undefined"!=typeof i&&e instanceof i)return e.slice(t,t+n);if(e instanceof Uint8Array)return new Uint8Array(e.buffer,e.byteOffset+t,n);throw"dicomParser.from: unknown type for byteArray"},e}(e),e=function(e){"use strict";return void 0===e&&(e={}),e.version="1.7.3",e}(e);return e}),function(e,t,n,o){"use strict";function a(e,t){return e===o?t:e}function r(e,t){for(var n=void 0,a=void 0,r=t[0].toUpperCase()+t.slice(1),i=0;i<Q.length;){if(n=Q[i],a=n?n+r:t,a in e)return a;i++}return o}function i(){if(!oe)return!1;var t={},n=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(o){return t[o]=!n||e.CSS.supports("touch-action",o)}),t}function s(){return We++}function u(e,t,n){var a=void 0;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==o)for(a=0;a<e.length;)t.call(n,e[a],a,e),a++;else for(a in e)e.hasOwnProperty(a)&&t.call(n,e[a],a,e)}function c(e,t,n){return!!Array.isArray(e)&&(u(e,n[t],n),!0)}function d(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var o=0;o<e.length;){if(n&&e[o][n]==t||!n&&e[o]===t)return o;o++}return-1}function m(e,t){return("undefined"==typeof e?"undefined":qe(e))===Z?e.apply(t?t[0]||o:o,t):e}function h(e,t){var n=t.manager;return n?n.get(e):e}function g(e){return e&ze?"cancel":e&Ue?"end":e&Fe?"move":e&Oe?"start":""}function p(e){return e===De?"down":e===Se?"up":e===Ie?"left":e===Me?"right":""}function v(e,t){return function n(){return e.apply(t,arguments)}}function y(e,t,n){return setTimeout(v(e,n),t)}function T(e,t,n){n||(n=Re);var o=t[n[0]]-e[n[0]],a=t[n[1]]-e[n[1]];return Math.sqrt(o*o+a*a)}function x(e,t){return e.indexOf(t)>-1}function w(e){if(x(e,se))return se;var t=x(e,le),n=x(e,ue);return t&&n?se:t||n?t?le:ue:x(e,ie)?ie:re}function C(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function b(e){var t=e.length;if(1===t)return{x:$(e[0].clientX),y:$(e[0].clientY)};for(var n=0,o=0,a=0;a<t;)n+=e[a].clientX,o+=e[a].clientY,a++;return{x:$(n/t),y:$(o/t)}}function P(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:$(e.pointers[n].clientX),clientY:$(e.pointers[n].clientY)},n++;return{timeStamp:te(),pointers:t,center:b(t),deltaX:e.deltaX,deltaY:e.deltaY}}function I(e,t,n){n||(n=Re);var o=t[n[0]]-e[n[0]],a=t[n[1]]-e[n[1]];return 180*Math.atan2(a,o)/Math.PI}function M(e,t){return e===t?Pe:ee(e)>=ee(t)?e<0?Ie:Me:t<0?Se:De}function S(e,t){var n=t.center,o=e.offsetDelta||{},a=e.prevDelta||{},r=e.prevInput||{};t.eventType!==xe&&r.eventType!==Ce||(a=e.prevDelta={x:r.deltaX||0,y:r.deltaY||0},o=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=a.x+(n.x-o.x),t.deltaY=a.y+(n.y-o.y)}function D(e,t,n){return{x:t/e||0,y:n/e||0}}function k(e,t){return T(t[0],t[1],Le)/T(e[0],e[1],Le)}function E(e,t){return I(t[1],t[0],Le)+I(e[1],e[0],Le)}function A(e,t){var n=e.lastInterval||t,a=t.timeStamp-n.timeStamp,r=void 0,i=void 0,s=void 0,l=void 0;if(t.eventType!==be&&(a>Te||n.velocity===o)){var u=t.deltaX-n.deltaX,c=t.deltaY-n.deltaY,d=D(a,u,c);i=d.x,s=d.y,r=ee(d.x)>ee(d.y)?d.x:d.y,l=M(u,c),e.lastInterval=t}else r=n.velocity,i=n.velocityX,s=n.velocityY,l=n.direction;t.velocity=r,t.velocityX=i,t.velocityY=s,t.direction=l}function R(e,t){var n=e.session,o=t.pointers,a=o.length;n.firstInput||(n.firstInput=P(t)),a>1&&!n.firstMultiple?n.firstMultiple=P(t):1===a&&(n.firstMultiple=!1);var r=n.firstInput,i=n.firstMultiple,s=i?i.center:r.center,l=t.center=b(o);t.timeStamp=te(),t.deltaTime=t.timeStamp-r.timeStamp,t.angle=I(s,l),t.distance=T(s,l),S(n,t),t.offsetDirection=M(t.deltaX,t.deltaY);var u=D(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=u.x,t.overallVelocityY=u.y,t.overallVelocity=ee(u.x)>ee(u.y)?u.x:u.y,t.scale=i?k(i.pointers,o):1,t.rotation=i?E(i.pointers,o):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,A(n,t);var c=e.element;C(t.srcEvent.target,c)&&(c=t.srcEvent.target),t.target=c}function L(e,t,n){var o=n.pointers.length,a=n.changedPointers.length,r=t&xe&&o-a===0,i=t&(Ce|be)&&o-a===0;n.isFirst=!!r,n.isFinal=!!i,r&&(e.session={}),n.eventType=t,R(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function B(e){return e.trim().split(/\s+/g)}function O(e,t,n){u(B(t),function(t){e.addEventListener(t,n,!1)})}function F(e,t,n){u(B(t),function(t){e.removeEventListener(t,n,!1)})}function U(t){var n=t.ownerDocument||t;return n.defaultView||n.parentWindow||e}function V(e){return Array.prototype.slice.call(e,0)}function z(e,t,n){for(var o=[],a=[],r=0;r<e.length;){var i=t?e[r][t]:e[r];d(a,i)<0&&o.push(e[r]),a[r]=i,r++}return n&&(o=t?o.sort(function(e,n){return e[t]>n[t]}):o.sort()),o}function H(e,t){var n=V(e.touches),o=this.targetIds;if(t&(xe|we)&&1===n.length)return o[n[0].identifier]=!0,[n,n];var a=void 0,r=void 0,i=V(e.changedTouches),s=[],l=this.target;if(r=n.filter(function(e){return C(e.target,l)}),t===xe)for(a=0;a<r.length;)o[r[a].identifier]=!0,a++;for(a=0;a<i.length;)o[i[a].identifier]&&s.push(i[a]),t&(Ce|be)&&delete o[i[a].identifier],a++;return s.length?[z(r.concat(s),"identifier",!0),s]:void 0}function N(e,t){e&xe?(this.primaryTouch=t.changedPointers[0].identifier,_.call(this,t)):e&(Ce|be)&&_.call(this,t)}function _(e){var t=this,n=Ke(e.changedPointers,1),o=n[0];o.identifier===this.primaryTouch&&!function(){var e={x:o.clientX,y:o.clientY};t.lastTouches.push(e);var n=t.lastTouches,a=function t(){var o=n.indexOf(e);o>-1&&n.splice(o,1)};setTimeout(a,xt)}()}function W(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,o=0;o<this.lastTouches.length;o++){var a=this.lastTouches[o],r=Math.abs(t-a.x),i=Math.abs(n-a.y);if(r<=wt&&i<=wt)return!0}return!1}function q(e){var t=void 0,n=e.options.inputClass;return new(t=n?n:me?ft:he?gt:fe?Ct:Tt)(e,L)}function G(e,t){var n=e.element;if(n.style){var o=void 0;u(e.options.cssProps,function(a,i){o=r(n.style,i),t?(e.oldCssProps[o]=n.style[o],n.style[o]=a):n.style[o]=e.oldCssProps[o]||""}),t||(e.oldCssProps={})}}function Y(e,n){var o=t.createEvent("Event");o.initEvent(e,!0,!0),o.gesture=n,n.target.dispatchEvent(o)}function X(e,t){var n=V(e.touches),o=V(e.changedTouches);return t&(Ce|be)&&(n=z(n.concat(o),"identifier",!0)),[n,o]}function j(t,n,o){var a="DEPRECATED METHOD: "+n+"\n"+o+" AT \n";return function(){var n=new Error("get-stack-trace"),o=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",r=e.console&&(e.console.warn||e.console.log);return r&&r.call(e.console,a,o),t.apply(this,arguments)}}function J(e,t,n){var o=t.prototype,a=void 0;a=e.prototype=Object.create(o),a.constructor=e,a._super=o,n&&_e(a,n)}var Q=["","webkit","Moz","MS","ms","o"],K=t.createElement("div"),Z="function",$=Math.round,ee=Math.abs,te=Date.now,ne=r(K.style,"touchAction"),oe=ne!==o,ae="compute",re="auto",ie="manipulation",se="none",le="pan-x",ue="pan-y",ce=i(),de=/mobile|tablet|ip(ad|hone|od)|android/i,fe="ontouchstart"in e,me=r(e,"PointerEvent")!==o,he=fe&&de.test(navigator.userAgent),ge="touch",pe="pen",ve="mouse",ye="kinect",Te=25,xe=1,we=2,Ce=4,be=8,Pe=1,Ie=2,Me=4,Se=8,De=16,ke=Ie|Me,Ee=Se|De,Ae=ke|Ee,Re=["x","y"],Le=["clientX","clientY"],Be=1,Oe=2,Fe=4,Ue=8,Ve=Ue,ze=16,He=32,Ne=void 0;Ne="function"!=typeof Object.assign?function e(t){if(t===o||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),a=1;a<arguments.length;a++){var r=arguments[a];if(r!==o&&null!==r)for(var i in r)r.hasOwnProperty(i)&&(n[i]=r[i])}return n}:Object.assign;var _e=Ne,We=1,qe="function"==typeof l&&"symbol"==typeof l.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof l&&e.constructor===l&&e!==l.prototype?"symbol":typeof e},Ge=function(){function e(e){this.value=e}function t(t){function n(e,t){return new f(function(n,o){var r={key:e,arg:t,resolve:n,reject:o,next:null};s?s=s.next=r:(i=s=r,a(e,t))})}function a(n,o){try{var i=t[n](o),s=i.value;s instanceof e?f.resolve(s.value).then(function(e){a("next",e)},function(e){a("throw",e)}):r(i.done?"return":"normal",i.value)}catch(e){r("throw",e)}}function r(e,t){switch(e){case"return":i.resolve({value:t,done:!0});break;case"throw":i.reject(t);break;default:i.resolve({value:t,done:!1})}i=i.next,i?a(i.key,i.arg):s=null}var i,s;this._invoke=n,"function"!=typeof t.return&&(this.return=o)}return"function"==typeof l&&l.asyncIterator&&(t.prototype[l.asyncIterator]=function(){return this}),t.prototype.next=function(e){return this._invoke("next",e)},t.prototype.throw=function(e){return this._invoke("throw",e)},t.prototype.return=function(e){return this._invoke("return",e)},{wrap:function(e){return function(){return new t(e.apply(this,arguments))}},await:function(t){return new e(t)}}}(),Ye=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Xe=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),je=function e(t,n,a){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(r===o){var i=Object.getPrototypeOf(t);return null===i?o:e(i,n,a)}if("value"in r)return r.value;var s=r.get;return s===o?o:s.call(a)},Je=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},Qe=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},Ke=function(){function e(e,t){var n=[],a=!0,r=!1,i=o;try{for(var s=e[l.iterator](),u;!(a=(u=s.next()).done)&&(n.push(u.value),!t||n.length!==t);a=!0);}catch(e){r=!0,i=e}finally{try{!a&&s.return&&s.return()}finally{if(r)throw i}}return n}return function(t,n){if(Array.isArray(t))return t;if(l.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),Ze=function(){function e(t){Ye(this,e),this.options=_e({},this.defaults,t||{}),this.id=s(),this.manager=null,this.options.enable=a(this.options.enable,!0),this.state=Be,this.simultaneous={},this.requireFail=[]}return Xe(e,[{key:"set",value:function e(t){return _e(this.options,t),this.manager&&this.manager.touchAction.update(),this}},{key:"recognizeWith",value:function e(t){if(c(t,"recognizeWith",this))return this;var n=this.simultaneous;return t=h(t,this),n[t.id]||(n[t.id]=t,t.recognizeWith(this)),this}},{key:"dropRecognizeWith",value:function e(t){return c(t,"dropRecognizeWith",this)?this:(t=h(t,this),delete this.simultaneous[t.id],this)}},{key:"requireFailure",value:function e(t){if(c(t,"requireFailure",this))return this;var n=this.requireFail;return t=h(t,this),d(n,t)===-1&&(n.push(t),t.requireFailure(this)),this}},{key:"dropRequireFailure",value:function e(t){if(c(t,"dropRequireFailure",this))return this;t=h(t,this);var n=d(this.requireFail,t);return n>-1&&this.requireFail.splice(n,1),this}},{key:"hasRequireFailures",value:function e(){return this.requireFail.length>0}},{key:"canRecognizeWith",value:function e(t){return!!this.simultaneous[t.id]}},{key:"emit",value:function e(t){function e(e){n.manager.emit(e,t)}var n=this,o=this.state;o<Ue&&e(n.options.event+g(o)),e(n.options.event),t.additionalEvent&&e(t.additionalEvent),o>=Ue&&e(n.options.event+g(o))}},{key:"tryEmit",value:function e(t){return this.canEmit()?this.emit(t):void(this.state=He)}},{key:"canEmit",value:function e(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(He|Be)))return!1;t++}return!0}},{key:"recognize",value:function e(t){var n=_e({},t);return m(this.options.enable,[this,n])?(this.state&(Ve|ze|He)&&(this.state=Be),this.state=this.process(n),void(this.state&(Oe|Fe|Ue|ze)&&this.tryEmit(n))):(this.reset(),void(this.state=He))}},{key:"process",value:function e(t){}},{key:"getTouchAction",value:function e(){}},{key:"reset",value:function e(){}}]),e}();Ze.prototype.defaults={};var $e=function(e){function t(){return Ye(this,t),Qe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return Je(t,e),Xe(t,[{key:"attrTest",value:function e(t){var n=this.options.pointers;return 0===n||t.pointers.length===n}},{key:"process",value:function e(t){var n=this.state,o=t.eventType,a=n&(Oe|Fe),r=this.attrTest(t);return a&&(o&be||!r)?n|ze:a||r?o&Ce?n|Ue:n&Oe?n|Fe:Oe:He}}]),t}(Ze);$e.prototype.defaults={pointers:1};var et=function(e){function t(){return Ye(this,t),Qe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return Je(t,e),Xe(t,[{key:"getTouchAction",value:function e(){return[se]}},{key:"attrTest",value:function e(n){return je(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"attrTest",this).call(this,n)&&(Math.abs(n.rotation)>this.options.threshold||this.state&Oe)}}]),t}($e);et.prototype.defaults={event:"rotate",threshold:0,pointers:2};var tt=function(e){function t(){return Ye(this,t),Qe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return Je(t,e),Xe(t,[{key:"getTouchAction",value:function e(){return[se]}},{key:"attrTest",value:function e(n){return je(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"attrTest",this).call(this,n)&&(Math.abs(n.scale-1)>this.options.threshold||this.state&Oe)}},{key:"emit",value:function e(n){if(1!==n.scale){var o=n.scale<1?"in":"out";n.additionalEvent=this.options.event+o}je(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"emit",this).call(this,n)}}]),t}($e);tt.prototype.defaults={event:"pinch",threshold:0,pointers:2};var nt=function(e){function t(){Ye(this,t);var e=Qe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.pX=null,e.pY=null,e}return Je(t,e),Xe(t,[{key:"getTouchAction",value:function e(){var t=this.options.direction,n=[];return t&ke&&n.push(ue),t&Ee&&n.push(le),n}},{key:"directionTest",value:function e(t){var n=this.options,o=!0,a=t.distance,r=t.direction,i=t.deltaX,s=t.deltaY;return r&n.direction||(n.direction&ke?(r=0===i?Pe:i<0?Ie:Me,o=i!==this.pX,a=Math.abs(t.deltaX)):(r=0===s?Pe:s<0?Se:De,o=s!==this.pY,a=Math.abs(t.deltaY))),t.direction=r,o&&a>n.threshold&&r&n.direction}},{key:"attrTest",value:function e(t){return $e.prototype.attrTest.call(this,t)&&(this.state&Oe||!(this.state&Oe)&&this.directionTest(t))}},{key:"emit",value:function e(n){this.pX=n.deltaX,this.pY=n.deltaY;var o=p(n.direction);o&&(n.additionalEvent=this.options.event+o),je(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"emit",this).call(this,n)}}]),t}($e);nt.prototype.defaults={event:"pan",threshold:10,pointers:1,direction:Ae};var ot=function(e){function t(){return Ye(this,t),Qe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return Je(t,e),Xe(t,[{key:"getTouchAction",value:function e(){return nt.prototype.getTouchAction.call(this)}},{key:"attrTest",value:function e(n){var o=this.options.direction,a=void 0;return o&(ke|Ee)?a=n.overallVelocity:o&ke?a=n.overallVelocityX:o&Ee&&(a=n.overallVelocityY),je(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"attrTest",this).call(this,n)&&o&n.offsetDirection&&n.distance>this.options.threshold&&n.maxPointers===this.options.pointers&&ee(a)>this.options.velocity&&n.eventType&Ce}},{key:"emit",value:function e(t){var n=p(t.offsetDirection);n&&this.manager.emit(this.options.event+n,t),this.manager.emit(this.options.event,t)}}]),t}($e);ot.prototype.defaults={event:"swipe",threshold:10,velocity:.3,direction:ke|Ee,pointers:1};var at=function(e){function t(){Ye(this,t);var e=Qe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.pTime=!1,e.pCenter=!1,e._timer=null,e._input=null,e.count=0,e}return Je(t,e),Xe(t,[{key:"getTouchAction",value:function e(){return[ie]}},{key:"process",value:function e(t){var n=this,o=this.options,a=t.pointers.length===o.pointers,r=t.distance<o.threshold,i=t.deltaTime<o.time;if(this.reset(),t.eventType&xe&&0===this.count)return this.failTimeout();if(r&&i&&a){if(t.eventType!==Ce)return this.failTimeout();var s=!this.pTime||t.timeStamp-this.pTime<o.interval,l=!this.pCenter||T(this.pCenter,t.center)<o.posThreshold;this.pTime=t.timeStamp,this.pCenter=t.center,l&&s?this.count+=1:this.count=1,this._input=t;var u=this.count%o.taps;if(0===u)return this.hasRequireFailures()?(this._timer=y(function(){n.state=Ve,n.tryEmit()},o.interval,this),Oe):Ve}return He}},{key:"failTimeout",value:function e(){var t=this;return this._timer=y(function(){t.state=He},this.options.interval,this),He}},{key:"reset",value:function e(){clearTimeout(this._timer)}},{key:"emit",value:function e(){this.state===Ve&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}]),t}(Ze);at.prototype.defaults={event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10};var rt=function(e){function t(){Ye(this,t);var e=Qe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e._timer=null,e._input=null,e}return Je(t,e),Xe(t,[{key:"getTouchAction",value:function e(){return[re]}},{key:"process",value:function e(t){var n=this,o=this.options,a=t.pointers.length===o.pointers,r=t.distance<o.threshold,i=t.deltaTime>o.time;if(this._input=t,!r||!a||t.eventType&(Ce|be)&&!i)this.reset();else if(t.eventType&xe)this.reset(),this._timer=y(function(){n.state=Ve,n.tryEmit()},o.time,this);else if(t.eventType&Ce)return Ve;return He}},{key:"reset",value:function e(){clearTimeout(this._timer)}},{key:"emit",value:function e(t){this.state===Ve&&(t&&t.eventType&Ce?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=te(),this.manager.emit(this.options.event,this._input)))}}]),t}(Ze);rt.prototype.defaults={event:"press",pointers:1,time:251,threshold:9};var it=function(){function e(t,n){Ye(this,e),this.manager=t,this.set(n)}return Xe(e,[{key:"set",value:function e(t){t===ae&&(t=this.compute()),oe&&this.manager.element.style&&ce[t]&&(this.manager.element.style[ne]=t),this.actions=t.toLowerCase().trim()}},{key:"update",value:function e(){this.set(this.manager.options.touchAction)}},{key:"compute",value:function e(){var t=[];return u(this.manager.recognizers,function(e){m(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),w(t.join(" "))}},{key:"preventDefaults",value:function e(t){var n=t.srcEvent,o=t.offsetDirection;if(this.manager.session.prevented)return void n.preventDefault();var a=this.actions,r=x(a,se)&&!ce[se],i=x(a,ue)&&!ce[ue],s=x(a,le)&&!ce[le];if(r){var l=1===t.pointers.length,u=t.distance<2,c=t.deltaTime<250;if(l&&u&&c)return}return s&&i?void 0:r||i&&o&ke||s&&o&Ee?this.preventSrc(n):void 0}},{key:"preventSrc",value:function e(t){this.manager.session.prevented=!0,t.preventDefault()}}]),e}(),st=function(){function e(t,n){Ye(this,e);var o=this;this.manager=t,this.callback=n,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){m(t.options.enable,[t])&&o.handler(e)},this.init()}return Xe(e,[{key:"handler",value:function e(){}},{key:"init",value:function e(){this.evEl&&O(this.element,this.evEl,this.domHandler),this.evTarget&&O(this.target,this.evTarget,this.domHandler),this.evWin&&O(U(this.element),this.evWin,this.domHandler)}},{key:"destroy",value:function e(){this.evEl&&F(this.element,this.evEl,this.domHandler),this.evTarget&&F(this.target,this.evTarget,this.domHandler),this.evWin&&F(U(this.element),this.evWin,this.domHandler)}}]),e}(),lt={pointerdown:xe,pointermove:we,pointerup:Ce,pointercancel:be,pointerout:be},ut={2:ge,3:pe,4:ve,5:ye},ct="pointerdown",dt="pointermove pointerup pointercancel";e.MSPointerEvent&&!e.PointerEvent&&(ct="MSPointerDown",dt="MSPointerMove MSPointerUp MSPointerCancel");var ft=function(e){function t(){Ye(this,t);var e=Qe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.evEl=ct,e.evWin=dt,e.store=e.manager.session.pointerEvents=[],e}return Je(t,e),Xe(t,[{key:"handler",value:function e(t){var n=this.store,o=!1,a=t.type.toLowerCase().replace("ms",""),r=lt[a],i=ut[t.pointerType]||t.pointerType,s=i===ge,l=d(n,t.pointerId,"pointerId");r&xe&&(0===t.button||s)?l<0&&(n.push(t),l=n.length-1):r&(Ce|be)&&(o=!0),l<0||(n[l]=t,this.callback(this.manager,r,{pointers:n,changedPointers:[t],pointerType:i,srcEvent:t}),o&&n.splice(l,1))}}]),t}(st),mt={touchstart:xe,touchmove:we,touchend:Ce,touchcancel:be},ht="touchstart touchmove touchend touchcancel",gt=function(e){function t(){Ye(this,t),t.prototype.evTarget=ht,t.prototype.targetIds={};var e=Qe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.evTarget=ht,e.targetIds={},e}return Je(t,e),Xe(t,[{key:"handler",value:function e(t){var n=mt[t.type],o=H.call(this,t,n);o&&this.callback(this.manager,n,{pointers:o[0],changedPointers:o[1],pointerType:ge,srcEvent:t})}}]),t}(st),pt={mousedown:xe,mousemove:we,mouseup:Ce},vt="mousedown",yt="mousemove mouseup",Tt=function(e){function t(){Ye(this,t);var e=Qe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.evEl=vt,e.evWin=yt,e.pressed=!1,e}return Je(t,e),Xe(t,[{key:"handler",value:function e(t){var n=pt[t.type];n&xe&&0===t.button&&(this.pressed=!0),n&we&&1!==t.which&&(n=Ce),this.pressed&&(n&Ce&&(this.pressed=!1),this.callback(this.manager,n,{pointers:[t],changedPointers:[t],pointerType:ve,srcEvent:t}))}}]),t}(st),xt=2500,wt=25,Ct=function(e){function t(){Ye(this,t);var e=Qe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments)),n=v(e.handler,e);return e.touch=new gt(e.manager,n),e.mouse=new Tt(e.manager,n),e.primaryTouch=null,e.lastTouches=[],e}return Je(t,e),Xe(t,[{key:"handler",value:function e(t,n,o){var a=o.pointerType===ge,r=o.pointerType===ve;if(!(r&&o.sourceCapabilities&&o.sourceCapabilities.firesTouchEvents)){if(a)N.call(this,n,o);else if(r&&W.call(this,o))return;this.callback(t,n,o)}}},{key:"destroy",value:function e(){this.touch.destroy(),this.mouse.destroy()}}]),t}(st),bt=1,Pt=2,It=function(){function e(t,n){var o=this;Ye(this,e),this.options=_e({},Mt.defaults,n||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=q(this),this.touchAction=new it(this,this.options.touchAction),G(this,!0),u(this.options.recognizers,function(e){var t=o.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])},this)}return Xe(e,[{key:"set",value:function e(t){return _e(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this}},{key:"stop",value:function e(t){this.session.stopped=t?Pt:bt}},{key:"recognize",value:function e(t){var n=this.session;if(!n.stopped){this.touchAction.preventDefaults(t);var o=void 0,a=this.recognizers,r=n.curRecognizer;(!r||r&&r.state&Ve)&&(r=n.curRecognizer=null);for(var i=0;i<a.length;)o=a[i],n.stopped===Pt||r&&o!==r&&!o.canRecognizeWith(r)?o.reset():o.recognize(t),!r&&o.state&(Oe|Fe|Ue)&&(r=n.curRecognizer=o),i++}}},{key:"get",value:function e(t){if(t instanceof Ze)return t;for(var n=this.recognizers,o=0;o<n.length;o++)if(n[o].options.event===t)return n[o];return null}},{key:"add",value:function e(t){if(c(t,"add",this))return this;var n=this.get(t.options.event);return n&&this.remove(n),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t}},{key:"remove",value:function e(t){if(c(t,"remove",this))return this;if(t=this.get(t)){var n=this.recognizers,o=d(n,t);o!==-1&&(n.splice(o,1),this.touchAction.update())}return this}},{key:"on",value:function e(t,n){if(t!==o&&n!==o){var a=this.handlers;return u(B(t),function(e){a[e]=a[e]||[],a[e].push(n)}),this}}},{key:"off",value:function e(t,n){if(t!==o){var a=this.handlers;return u(B(t),function(e){n?a[e]&&a[e].splice(d(a[e],n),1):delete a[e]}),this}}},{key:"emit",value:function e(t,n){this.options.domEvents&&Y(t,n);var o=this.handlers[t]&&this.handlers[t].slice();if(o&&o.length){n.type=t,n.preventDefault=function(){n.srcEvent.preventDefault()};for(var a=0;a<o.length;)o[a](n),
a++}}},{key:"destroy",value:function e(){this.element&&G(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}}]),e}(),Mt=function e(t,n){return Ye(this,e),n=n||{},n.recognizers=a(n.recognizers,e.defaults.preset),new It(t,n)};Mt.VERSION="2.0.8",Mt.defaults={domEvents:!1,touchAction:ae,enable:!0,inputTarget:null,inputClass:null,preset:[[et,{enable:!1}],[tt,{enable:!1},["rotate"]],[ot,{direction:ke}],[nt,{direction:ke},["swipe"]],[at],[at,{event:"doubletap",taps:2},["tap"]],[rt]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var St={touchstart:xe,touchmove:we,touchend:Ce,touchcancel:be},Dt="touchstart",kt="touchstart touchmove touchend touchcancel",Et=function(e){function t(){Ye(this,t);var e=Qe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.evTarget=Dt,e.evWin=kt,e.started=!1,st.apply(e,arguments),e}return Je(t,e),Xe(t,[{key:"handler",value:function e(t){var n=St[t.type];if(n===xe&&(this.started=!0),this.started){var o=X.call(this,t,n);n&(Ce|be)&&o[0].length-o[1].length===0&&(this.started=!1),this.callback(this.manager,n,{pointers:o[0],changedPointers:o[1],pointerType:ge,srcEvent:t})}}}]),t}(st),At=j(function(e,t,n){for(var a=Object.keys(t),r=0;r<a.length;)(!n||n&&e[a[r]]===o)&&(e[a[r]]=t[a[r]]),r++;return e},"extend","Use `assign`."),Rt=j(function(e,t){return At(e,t,!0)},"merge","Use `assign`.");_e(Mt,{INPUT_START:xe,INPUT_MOVE:we,INPUT_END:Ce,INPUT_CANCEL:be,STATE_POSSIBLE:Be,STATE_BEGAN:Oe,STATE_CHANGED:Fe,STATE_ENDED:Ue,STATE_RECOGNIZED:Ve,STATE_CANCELLED:ze,STATE_FAILED:He,DIRECTION_NONE:Pe,DIRECTION_LEFT:Ie,DIRECTION_RIGHT:Me,DIRECTION_UP:Se,DIRECTION_DOWN:De,DIRECTION_HORIZONTAL:ke,DIRECTION_VERTICAL:Ee,DIRECTION_ALL:Ae,Manager:It,Input:st,TouchAction:it,TouchInput:gt,MouseInput:Tt,PointerEventInput:ft,TouchMouseInput:Ct,SingleTouchInput:Et,Recognizer:Ze,AttrRecognizer:$e,Tap:at,Pan:nt,Swipe:ot,Pinch:tt,Rotate:et,Press:rt,on:O,off:F,each:u,merge:Rt,extend:At,assign:_e,inherit:J,bindFn:v,prefixed:r,toArray:V,inArray:d,uniqueArray:z,splitStr:B,boolOrFn:m,hasParent:C,addEventListeners:O,removeEventListeners:F}),"function"==typeof define&&define.amd?define(function(){return Mt}):"undefined"!=typeof module&&module.exports?module.exports=Mt:e[n]=Mt}(window,document,"Hammer"),function(e){"function"==typeof define&&define.amd?define(["jquery","hammerjs"],e):"object"==typeof T?e(y("jquery"),y("hammerjs")):e(a,Hammer)}(function(e,t){function n(n,o){var a=e(n);a.data("hammer")||a.data("hammer",new t(a[0],o))}e.fn.hammer=function(e){return this.each(function(){n(this,e)})},t.Manager.prototype.emit=function(t){return function(n,o){t.call(this,n,o),e(this.element).trigger({type:n,gesture:o})}}(t.Manager.prototype.emit)});var T=y("./node_modules/meteor/ohif:cornerstone/main.js");"undefined"==typeof Package&&(Package={}),function(e,t){for(var n in t)n in e||(e[n]=t[n])}(Package["ohif:cornerstone"]=T,{cornerstone:m,cornerstoneMath:h,cornerstoneTools:p,cornerstoneWADOImageLoader:v,dicomParser:g})}();
!function(){var e=Package.meteor.Meteor,n=Package.meteor.global,a=Package.meteor.meteorEnv,r=Package.underscore._,c,t;(function(){c={};var e=function(e){return encodeURIComponent(e).replace(/[!'()]/g,escape).replace(/\*/g,"%2A")};c._encodeParams=function(n){var a=[];return r.each(n,function(n,r){a.length&&a.push("&"),a.push(e(r),"=",e(n))}),a.join("").replace(/%20/g,"+")},t=function(e,n,a,r){var t=e,o=n?n.slice(1):null;if("string"==typeof a&&(o=String(a)),r){o=o||"";var u=c._encodeParams(r);o&&u&&(o+="&"),o+=u}var i=t;return null!==o&&(i+="?"+o),i}}).call(this),function(){c._constructUrl=function(e,n,a){var r=/^(.*?)(\?.*)?$/.exec(e);return t(r[1],r[2],n,a)}}.call(this),"undefined"==typeof Package&&(Package={}),function(e,n){for(var a in n)a in e||(e[a]=n[a])}(Package.url={},{URL:c})}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,n=Package.meteor.meteorEnv,a=Package.underscore._,r=Package.url.URL,o=Package.modules.meteorInstall,c=Package.modules.Buffer,s=Package.modules.process,i=Package["ecmascript-runtime"].Symbol,l=Package["ecmascript-runtime"].Map,p=Package["ecmascript-runtime"].Set,u=Package["babel-runtime"].meteorBabelHelpers,f=Package.promise.Promise,d,m,h,g=o({node_modules:{meteor:{http:{"httpcall_common.js":function(){function e(e,t){return e.length>t?e.slice(0,t)+"...":e}var t=500;d=function n(a,r){var o="failed ["+a+"]";if(r){var c="string"==typeof r?r:r.toString();o+=" "+e(c.replace(/\n/g," "),t)}return new Error(o)},m=function e(t){var n=(t.headers["content-type"]||";").split(";")[0];if(a.include(["application/json","text/javascript","application/javascript","application/x-javascript"],n))try{t.data=JSON.parse(t.content)}catch(e){t.data=null}else t.data=null},h={},h.get=function(){return h.call.apply(this,["GET"].concat(a.toArray(arguments)))},h.post=function(){return h.call.apply(this,["POST"].concat(a.toArray(arguments)))},h.put=function(){return h.call.apply(this,["PUT"].concat(a.toArray(arguments)))},h.del=function(){return h.call.apply(this,["DELETE"].concat(a.toArray(arguments)))},h.patch=function(){return h.call.apply(this,["PATCH"].concat(a.toArray(arguments)))}},"httpcall_client.js":function(t,n,o){h.call=function(t,n,o,c){if(c||"function"!=typeof o||(c=o,o=null),o=o||{},"function"!=typeof c)throw new Error("Can't make a blocking HTTP call from the client; callback required.");t=(t||"").toUpperCase();var s={},i=o.content;o.data&&(i=JSON.stringify(o.data),s["Content-Type"]="application/json");var l,p;if(i||"GET"===t||"HEAD"===t?l=o.params:p=o.params,n=r._constructUrl(n,o.query,l),o.followRedirects===!1)throw new Error("Option followRedirects:false not supported on client.");if(a.has(o,"npmRequestOptions"))throw new Error("Option npmRequestOptions not supported on client.");var f,h;if(o.auth){var g=o.auth.indexOf(":");if(g<0)throw new Error('auth option should be of the form "username:password"');f=o.auth.substring(0,g),h=o.auth.substring(g+1)}p&&(i=r._encodeParams(p)),a.extend(s,o.headers||{}),c=function(e){return function(t,n){t&&n&&(t.response=n),e(t,n)}}(c),c=a.once(c);try{var y;if("undefined"!=typeof XMLHttpRequest)y=new XMLHttpRequest;else{if("undefined"==typeof ActiveXObject)throw new Error("Can't create XMLHttpRequest");y=new ActiveXObject("Microsoft.XMLHttp")}y.open(t,n,!0,f,h);for(var v in u.sanitizeForInObject(s))y.setRequestHeader(v,s[v]);var P=!1,k;if(o.timeout&&(k=e.setTimeout(function(){P=!0,y.abort()},o.timeout)),y.onreadystatechange=function(t){if(4===y.readyState)if(k&&e.clearTimeout(k),P)c(new Error("timeout"));else if(y.status){var n={};n.statusCode=y.status,n.content=y.responseText,n.headers={};var r=y.getAllResponseHeaders();""===r&&y.getResponseHeader("content-type")&&(r="content-type: "+y.getResponseHeader("content-type"));var o=r.split(/\r?\n/);a.each(o,function(e){var t=/^(.*?):(?:\s+)(.*)$/.exec(e);t&&3===t.length&&(n.headers[t[1].toLowerCase()]=t[2])}),m(n);var s=null;n.statusCode>=400&&(s=d(n.statusCode,n.content)),c(s,n)}else c(new Error("network"))},o.beforeSend){var w=a.once(o.beforeSend);if(!1===w.call(null,y,o))return y.abort()}y.send(i)}catch(e){c(e)}}},"deprecated.js":function(){e.http=h}}}}},{extensions:[".js",".json"]});g("./node_modules/meteor/http/httpcall_common.js"),g("./node_modules/meteor/http/httpcall_client.js"),g("./node_modules/meteor/http/deprecated.js"),"undefined"==typeof Package&&(Package={}),function(e,t){for(var n in t)n in e||(e[n]=t[n])}(Package.http={},{HTTP:h})}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,n=Package.meteor.meteorEnv,s;(function(){!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";function e(){return _s.apply(null,arguments)}function t(e){_s=e}function n(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function s(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function i(e){var t;for(t in e)return!1;return!0}function r(e){return"number"==typeof value||"[object Number]"===Object.prototype.toString.call(e)}function a(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function o(e,t){var n=[],s;for(s=0;s<e.length;++s)n.push(t(e[s],s));return n}function u(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function l(e,t){for(var n in t)u(t,n)&&(e[n]=t[n]);return u(t,"toString")&&(e.toString=t.toString),u(t,"valueOf")&&(e.valueOf=t.valueOf),e}function d(e,t,n,s){return gt(e,t,n,s,!0).utc()}function h(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null}}function c(e){return null==e._pf&&(e._pf=h()),e._pf}function f(e){if(null==e._isValid){var t=c(e),n=gs.call(t.parsedDateParts,function(e){return null!=e}),s=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(s=s&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return s;e._isValid=s}return e._isValid}function m(e){var t=d(NaN);return null!=e?l(c(t),e):c(t).userInvalidated=!0,t}function _(e){return void 0===e}function y(e,t){var n,s,i;if(_(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),_(t._i)||(e._i=t._i),_(t._f)||(e._f=t._f),_(t._l)||(e._l=t._l),_(t._strict)||(e._strict=t._strict),_(t._tzm)||(e._tzm=t._tzm),_(t._isUTC)||(e._isUTC=t._isUTC),_(t._offset)||(e._offset=t._offset),_(t._pf)||(e._pf=c(t)),_(t._locale)||(e._locale=t._locale),ps.length>0)for(n in ps)s=ps[n],i=t[s],_(i)||(e[s]=i);return e}function g(t){y(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),vs===!1&&(vs=!0,e.updateOffset(this),vs=!1)}function p(e){return e instanceof g||null!=e&&null!=e._isAMomentObject}function v(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function w(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=v(t)),n}function k(e,t,n){var s=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),r=0,a;for(a=0;a<s;a++)(n&&e[a]!==t[a]||!n&&w(e[a])!==w(t[a]))&&r++;return r+i}function S(t){e.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function M(t,n){var s=!0;return l(function(){if(null!=e.deprecationHandler&&e.deprecationHandler(null,t),s){for(var i=[],r,a=0;a<arguments.length;a++){if(r="","object"==typeof arguments[a]){r+="\n["+a+"] ";for(var o in arguments[0])r+=o+": "+arguments[0][o]+", ";r=r.slice(0,-2)}else r=arguments[a];i.push(r)}S(t+"\nArguments: "+Array.prototype.slice.call(i).join("")+"\n"+(new Error).stack),s=!1}return n.apply(this,arguments)},n)}function D(t,n){null!=e.deprecationHandler&&e.deprecationHandler(t,n),ws[t]||(S(n),ws[t]=!0)}function Y(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function O(e){var t,n;for(n in e)t=e[n],Y(t)?this[n]=t:this["_"+n]=t;this._config=e,this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function x(e,t){var n=l({},e),i;for(i in t)u(t,i)&&(s(e[i])&&s(t[i])?(n[i]={},l(n[i],e[i]),l(n[i],t[i])):null!=t[i]?n[i]=t[i]:delete n[i]);for(i in e)u(e,i)&&!u(t,i)&&s(e[i])&&(n[i]=l({},n[i]));return n}function T(e){null!=e&&this.set(e)}function b(e,t,n){var s=this._calendar[e]||this._calendar.sameElse;return Y(s)?s.call(t,n):s}function P(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])}function W(){return this._invalidDate}function R(e){return this._ordinal.replace("%d",e)}function U(e,t,n,s){var i=this._relativeTime[n];return Y(i)?i(e,t,n,s):i.replace(/%d/i,e)}function C(e,t){var n=this._relativeTime[e>0?"future":"past"];return Y(n)?n(t):n.replace(/%s/i,t)}function F(e,t){var n=e.toLowerCase();bs[n]=bs[n+"s"]=bs[t]=e}function H(e){return"string"==typeof e?bs[e]||bs[e.toLowerCase()]:void 0}function L(e){var t={},n,s;for(s in e)u(e,s)&&(n=H(s),n&&(t[n]=e[s]));return t}function G(e,t){Ps[e]=t}function j(e){var t=[];for(var n in e)t.push({unit:n,priority:Ps[n]});return t.sort(function(e,t){return e.priority-t.priority}),t}function V(t,n){return function(s){return null!=s?(N(this,t,s),e.updateOffset(this,n),this):E(this,t)}}function E(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function N(e,t,n){e.isValid()&&e._d["set"+(e._isUTC?"UTC":"")+t](n)}function A(e){return e=H(e),Y(this[e])?this[e]():this}function I(e,t){if("object"==typeof e){e=L(e);for(var n=j(e),s=0;s<n.length;s++)this[n[s].unit](e[n[s].unit])}else if(e=H(e),Y(this[e]))return this[e](t);return this}function z(e,t,n){var s=""+Math.abs(e),i=t-s.length,r=e>=0;return(r?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+s}function Z(e,t,n,s){var i=s;"string"==typeof s&&(i=function(){return this[s]()}),e&&(Cs[e]=i),t&&(Cs[t[0]]=function(){return z(i.apply(this,arguments),t[1],t[2])}),n&&(Cs[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function $(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function q(e){var t=e.match(Ws),n,s;for(n=0,s=t.length;n<s;n++)Cs[t[n]]?t[n]=Cs[t[n]]:t[n]=$(t[n]);return function(n){var i="",r;for(r=0;r<s;r++)i+=t[r]instanceof Function?t[r].call(n,e):t[r];return i}}function B(e,t){return e.isValid()?(t=J(t,e.localeData()),Us[t]=Us[t]||q(t),Us[t](e)):e.localeData().invalidDate()}function J(e,t){function n(e){return t.longDateFormat(e)||e}var s=5;for(Rs.lastIndex=0;s>=0&&Rs.test(e);)e=e.replace(Rs,n),Rs.lastIndex=0,s-=1;return e}function Q(e,t,n){Xs[e]=Y(t)?t:function(e,s){return e&&n?n:t}}function X(e,t){return u(Xs,e)?Xs[e](t._strict,t._locale):new RegExp(K(e))}function K(e){return ee(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,s,i){return t||n||s||i}))}function ee(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function te(e,t){var n,s=t;for("string"==typeof e&&(e=[e]),r(t)&&(s=function(e,n){n[t]=w(e)}),n=0;n<e.length;n++)Ks[e[n]]=s}function ne(e,t){te(e,function(e,n,s,i){s._w=s._w||{},t(e,s._w,s,i)})}function se(e,t,n){null!=t&&u(Ks,e)&&Ks[e](t,n._a,n,e)}function ie(e,t){return new Date(Date.UTC(e,t+1,0)).getUTCDate()}function re(e,t){return e?n(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||hi).test(t)?"format":"standalone"][e.month()]:this._months}function ae(e,t){return e?n(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[hi.test(t)?"format":"standalone"][e.month()]:this._monthsShort}function oe(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)r=d([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(r,"").toLocaleLowerCase();return n?"MMM"===t?(i=di.call(this._shortMonthsParse,a),i!==-1?i:null):(i=di.call(this._longMonthsParse,a),i!==-1?i:null):"MMM"===t?(i=di.call(this._shortMonthsParse,a),i!==-1?i:(i=di.call(this._longMonthsParse,a),i!==-1?i:null)):(i=di.call(this._longMonthsParse,a),i!==-1?i:(i=di.call(this._shortMonthsParse,a),i!==-1?i:null))}function ue(e,t,n){var s,i,r;if(this._monthsParseExact)return oe.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(i=d([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[s]||(r="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[s]=new RegExp(r.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[s].test(e))return s;if(n&&"MMM"===t&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}}function le(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=w(t);else if(t=e.localeData().monthsParse(t),!r(t))return e;return n=Math.min(e.date(),ie(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function de(t){return null!=t?(le(this,t),e.updateOffset(this,!0),this):E(this,"Month")}function he(){return ie(this.year(),this.month())}function ce(e){return this._monthsParseExact?(u(this,"_monthsRegex")||me.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(u(this,"_monthsShortRegex")||(this._monthsShortRegex=mi),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function fe(e){return this._monthsParseExact?(u(this,"_monthsRegex")||me.call(this),e?this._monthsStrictRegex:this._monthsRegex):(u(this,"_monthsRegex")||(this._monthsRegex=_i),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function me(){function e(e,t){return t.length-e.length}var t=[],n=[],s=[],i,r;for(i=0;i<12;i++)r=d([2e3,i]),t.push(this.monthsShort(r,"")),n.push(this.months(r,"")),s.push(this.months(r,"")),s.push(this.monthsShort(r,""));for(t.sort(e),n.sort(e),s.sort(e),i=0;i<12;i++)t[i]=ee(t[i]),n[i]=ee(n[i]);for(i=0;i<24;i++)s[i]=ee(s[i]);this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}function _e(e){return ye(e)?366:365}function ye(e){return e%4===0&&e%100!==0||e%400===0}function ge(){return ye(this.year())}function pe(e,t,n,s,i,r,a){var o=new Date(e,t,n,s,i,r,a);return e<100&&e>=0&&isFinite(o.getFullYear())&&o.setFullYear(e),o}function ve(e){var t=new Date(Date.UTC.apply(null,arguments));return e<100&&e>=0&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function we(e,t,n){var s=7+t-n,i=(7+ve(e,0,s).getUTCDay()-t)%7;return-i+s-1}function ke(e,t,n,s,i){var r=(7+n-s)%7,a=we(e,s,i),o=1+7*(t-1)+r+a,u,l;return o<=0?(u=e-1,l=_e(u)+o):o>_e(e)?(u=e+1,l=o-_e(e)):(u=e,l=o),{year:u,dayOfYear:l}}function Se(e,t,n){var s=we(e.year(),t,n),i=Math.floor((e.dayOfYear()-s-1)/7)+1,r,a;return i<1?(a=e.year()-1,r=i+Me(a,t,n)):i>Me(e.year(),t,n)?(r=i-Me(e.year(),t,n),a=e.year()+1):(a=e.year(),r=i),{week:r,year:a}}function Me(e,t,n){var s=we(e,t,n),i=we(e+1,t,n);return(_e(e)-s+i)/7}function De(e){return Se(e,this._week.dow,this._week.doy).week}function Ye(){return this._week.dow}function Oe(){return this._week.doy}function xe(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function Te(e){var t=Se(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function be(e,t){return"string"!=typeof e?e:isNaN(e)?(e=t.weekdaysParse(e),"number"==typeof e?e:null):parseInt(e,10)}function Pe(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function We(e,t){return e?n(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(t)?"format":"standalone"][e.day()]:this._weekdays}function Re(e){return e?this._weekdaysShort[e.day()]:this._weekdaysShort}function Ue(e){return e?this._weekdaysMin[e.day()]:this._weekdaysMin}function Ce(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)r=d([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===t?(i=di.call(this._weekdaysParse,a),i!==-1?i:null):"ddd"===t?(i=di.call(this._shortWeekdaysParse,a),i!==-1?i:null):(i=di.call(this._minWeekdaysParse,a),i!==-1?i:null):"dddd"===t?(i=di.call(this._weekdaysParse,a),i!==-1?i:(i=di.call(this._shortWeekdaysParse,a),i!==-1?i:(i=di.call(this._minWeekdaysParse,a),i!==-1?i:null))):"ddd"===t?(i=di.call(this._shortWeekdaysParse,a),i!==-1?i:(i=di.call(this._weekdaysParse,a),i!==-1?i:(i=di.call(this._minWeekdaysParse,a),i!==-1?i:null))):(i=di.call(this._minWeekdaysParse,a),i!==-1?i:(i=di.call(this._weekdaysParse,a),i!==-1?i:(i=di.call(this._shortWeekdaysParse,a),i!==-1?i:null)))}function Fe(e,t,n){var s,i,r;if(this._weekdaysParseExact)return Ce.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(i=d([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(i,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(i,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(i,"").replace(".",".?")+"$","i")),this._weekdaysParse[s]||(r="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[s]=new RegExp(r.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[s].test(e))return s;if(n&&"ddd"===t&&this._shortWeekdaysParse[s].test(e))return s;if(n&&"dd"===t&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}}function He(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=be(e,this.localeData()),this.add(e-t,"d")):t}function Le(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function Ge(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=Pe(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7}function je(e){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||Ne.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(u(this,"_weekdaysRegex")||(this._weekdaysRegex=ki),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function Ve(e){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||Ne.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(u(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Si),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Ee(e){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||Ne.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(u(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Mi),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Ne(){function e(e,t){return t.length-e.length}var t=[],n=[],s=[],i=[],r,a,o,u,l;for(r=0;r<7;r++)a=d([2e3,1]).day(r),o=this.weekdaysMin(a,""),u=this.weekdaysShort(a,""),l=this.weekdays(a,""),t.push(o),n.push(u),s.push(l),i.push(o),i.push(u),i.push(l);for(t.sort(e),n.sort(e),s.sort(e),i.sort(e),r=0;r<7;r++)n[r]=ee(n[r]),s[r]=ee(s[r]),i[r]=ee(i[r]);this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function Ae(){return this.hours()%12||12}function Ie(){return this.hours()||24}function ze(e,t){Z(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function Ze(e,t){return t._meridiemParse}function $e(e){return"p"===(e+"").toLowerCase().charAt(0)}function qe(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}function Be(e){return e?e.toLowerCase().replace("_","-"):e}function Je(e){for(var t=0,n,s,i,r;t<e.length;){for(r=Be(e[t]).split("-"),n=r.length,s=Be(e[t+1]),s=s?s.split("-"):null;n>0;){if(i=Qe(r.slice(0,n).join("-")))return i;if(s&&s.length>=n&&k(r,s,!0)>=n-1)break;n--}t++}return null}function Qe(e){var t=null;if(!xi[e]&&"undefined"!=typeof module&&module&&module.exports)try{t=bi._abbr,require("./locale/"+e),Xe(t)}catch(e){}return xi[e]}function Xe(e,t){var n;return e&&(n=_(t)?tt(e):Ke(e,t),n&&(bi=n)),bi._abbr}function Ke(e,t){if(null!==t){var n=Oi;if(t.abbr=e,null!=xi[e])D("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=xi[e]._config;else if(null!=t.parentLocale){if(null==xi[t.parentLocale])return Ti[t.parentLocale]||(Ti[t.parentLocale]=[]),Ti[t.parentLocale].push({name:e,config:t}),null;n=xi[t.parentLocale]._config}return xi[e]=new T(x(n,t)),Ti[e]&&Ti[e].forEach(function(e){Ke(e.name,e.config)}),Xe(e),xi[e]}return delete xi[e],null}function et(e,t){if(null!=t){var n,s=Oi;null!=xi[e]&&(s=xi[e]._config),t=x(s,t),n=new T(t),n.parentLocale=xi[e],xi[e]=n,Xe(e)}else null!=xi[e]&&(null!=xi[e].parentLocale?xi[e]=xi[e].parentLocale:null!=xi[e]&&delete xi[e]);return xi[e]}function tt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return bi;if(!n(e)){if(t=Qe(e))return t;e=[e]}return Je(e)}function nt(){return Ss(xi)}function st(e){var t,n=e._a;return n&&c(e).overflow===-2&&(t=n[ti]<0||n[ti]>11?ti:n[ni]<1||n[ni]>ie(n[ei],n[ti])?ni:n[si]<0||n[si]>24||24===n[si]&&(0!==n[ii]||0!==n[ri]||0!==n[ai])?si:n[ii]<0||n[ii]>59?ii:n[ri]<0||n[ri]>59?ri:n[ai]<0||n[ai]>999?ai:-1,c(e)._overflowDayOfYear&&(t<ei||t>ni)&&(t=ni),c(e)._overflowWeeks&&t===-1&&(t=oi),c(e)._overflowWeekday&&t===-1&&(t=ui),c(e).overflow=t),e}function it(e){var t,n,s=e._i,i=Pi.exec(s)||Wi.exec(s),r,a,o,u;if(i){for(c(e).iso=!0,t=0,n=Ui.length;t<n;t++)if(Ui[t][1].exec(i[1])){a=Ui[t][0],r=Ui[t][2]!==!1;break}if(null==a)return void(e._isValid=!1);if(i[3]){for(t=0,n=Ci.length;t<n;t++)if(Ci[t][1].exec(i[3])){o=(i[2]||" ")+Ci[t][0];break}if(null==o)return void(e._isValid=!1)}if(!r&&null!=o)return void(e._isValid=!1);if(i[4]){if(!Ri.exec(i[4]))return void(e._isValid=!1);u="Z"}e._f=a+(o||"")+(u||""),dt(e)}else e._isValid=!1}function rt(t){var n=Fi.exec(t._i);return null!==n?void(t._d=new Date((+n[1]))):(it(t),void(t._isValid===!1&&(delete t._isValid,e.createFromInputFallback(t))))}function at(e,t,n){return null!=e?e:null!=t?t:n}function ot(t){var n=new Date(e.now());return t._useUTC?[n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()]:[n.getFullYear(),n.getMonth(),n.getDate()]}function ut(e){var t,n,s=[],i,r;if(!e._d){for(i=ot(e),e._w&&null==e._a[ni]&&null==e._a[ti]&&lt(e),e._dayOfYear&&(r=at(e._a[ei],i[ei]),e._dayOfYear>_e(r)&&(c(e)._overflowDayOfYear=!0),n=ve(r,0,e._dayOfYear),e._a[ti]=n.getUTCMonth(),e._a[ni]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=s[t]=i[t];for(;t<7;t++)e._a[t]=s[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[si]&&0===e._a[ii]&&0===e._a[ri]&&0===e._a[ai]&&(e._nextDay=!0,e._a[si]=0),e._d=(e._useUTC?ve:pe).apply(null,s),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[si]=24)}}function lt(e){var t,n,s,i,r,a,o,u;if(t=e._w,null!=t.GG||null!=t.W||null!=t.E)r=1,a=4,n=at(t.GG,e._a[ei],Se(pt(),1,4).year),s=at(t.W,1),i=at(t.E,1),(i<1||i>7)&&(u=!0);else{r=e._locale._week.dow,a=e._locale._week.doy;var l=Se(pt(),r,a);n=at(t.gg,e._a[ei],l.year),s=at(t.w,l.week),null!=t.d?(i=t.d,(i<0||i>6)&&(u=!0)):null!=t.e?(i=t.e+r,(t.e<0||t.e>6)&&(u=!0)):i=r}s<1||s>Me(n,r,a)?c(e)._overflowWeeks=!0:null!=u?c(e)._overflowWeekday=!0:(o=ke(n,s,i,r,a),e._a[ei]=o.year,e._dayOfYear=o.dayOfYear)}function dt(t){if(t._f===e.ISO_8601)return void it(t);t._a=[],c(t).empty=!0;var n=""+t._i,s,i,r,a,o,u=n.length,l=0;for(r=J(t._f,t._locale).match(Ws)||[],s=0;s<r.length;s++)a=r[s],i=(n.match(X(a,t))||[])[0],i&&(o=n.substr(0,n.indexOf(i)),o.length>0&&c(t).unusedInput.push(o),n=n.slice(n.indexOf(i)+i.length),l+=i.length),Cs[a]?(i?c(t).empty=!1:c(t).unusedTokens.push(a),se(a,i,t)):t._strict&&!i&&c(t).unusedTokens.push(a);c(t).charsLeftOver=u-l,n.length>0&&c(t).unusedInput.push(n),t._a[si]<=12&&c(t).bigHour===!0&&t._a[si]>0&&(c(t).bigHour=void 0),c(t).parsedDateParts=t._a.slice(0),c(t).meridiem=t._meridiem,t._a[si]=ht(t._locale,t._a[si],t._meridiem),ut(t),st(t)}function ht(e,t,n){var s;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?(s=e.isPM(n),s&&t<12&&(t+=12),s||12!==t||(t=0),t):t}function ct(e){var t,n,s,i,r;if(0===e._f.length)return c(e).invalidFormat=!0,void(e._d=new Date(NaN));for(i=0;i<e._f.length;i++)r=0,t=y({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[i],dt(t),f(t)&&(r+=c(t).charsLeftOver,r+=10*c(t).unusedTokens.length,c(t).score=r,(null==s||r<s)&&(s=r,n=t));l(e,n||t)}function ft(e){if(!e._d){var t=L(e._i);e._a=o([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),ut(e)}}function mt(e){var t=new g(st(_t(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function _t(e){var t=e._i,s=e._f;return e._locale=e._locale||tt(e._l),null===t||void 0===s&&""===t?m({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),p(t)?new g(st(t)):(a(t)?e._d=t:n(s)?ct(e):s?dt(e):yt(e),f(e)||(e._d=null),e))}function yt(t){var s=t._i;void 0===s?t._d=new Date(e.now()):a(s)?t._d=new Date(s.valueOf()):"string"==typeof s?rt(t):n(s)?(t._a=o(s.slice(0),function(e){return parseInt(e,10)}),ut(t)):"object"==typeof s?ft(t):r(s)?t._d=new Date(s):e.createFromInputFallback(t)}function gt(e,t,r,a,o){var u={};return r!==!0&&r!==!1||(a=r,r=void 0),(s(e)&&i(e)||n(e)&&0===e.length)&&(e=void 0),u._isAMomentObject=!0,u._useUTC=u._isUTC=o,u._l=r,u._i=e,u._f=t,u._strict=a,mt(u)}function pt(e,t,n,s){return gt(e,t,n,s,!1)}function vt(e,t){var s,i;if(1===t.length&&n(t[0])&&(t=t[0]),!t.length)return pt();for(s=t[0],i=1;i<t.length;++i)t[i].isValid()&&!t[i][e](s)||(s=t[i]);return s}function wt(){var e=[].slice.call(arguments,0);return vt("isBefore",e)}function kt(){var e=[].slice.call(arguments,0);return vt("isAfter",e)}function St(e){var t=L(e),n=t.year||0,s=t.quarter||0,i=t.month||0,r=t.week||0,a=t.day||0,o=t.hour||0,u=t.minute||0,l=t.second||0,d=t.millisecond||0;this._milliseconds=+d+1e3*l+6e4*u+1e3*o*60*60,this._days=+a+7*r,this._months=+i+3*s+12*n,this._data={},this._locale=tt(),this._bubble()}function Mt(e){return e instanceof St}function Dt(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function Yt(e,t){Z(e,0,0,function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+z(~~(e/60),2)+t+z(~~e%60,2)})}function Ot(e,t){var n=(t||"").match(e);if(null===n)return null;var s=n[n.length-1]||[],i=(s+"").match(ji)||["-",0,0],r=+(60*i[1])+w(i[2]);return 0===r?0:"+"===i[0]?r:-r}function xt(t,n){var s,i;return n._isUTC?(s=n.clone(),i=(p(t)||a(t)?t.valueOf():pt(t).valueOf())-s.valueOf(),s._d.setTime(s._d.valueOf()+i),e.updateOffset(s,!1),s):pt(t).local()}function Tt(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function bt(t,n){var s=this._offset||0,i;if(!this.isValid())return null!=t?this:NaN;if(null!=t){if("string"==typeof t){if(t=Ot(Bs,t),null===t)return this}else Math.abs(t)<16&&(t=60*t);return!this._isUTC&&n&&(i=Tt(this)),this._offset=t,this._isUTC=!0,null!=i&&this.add(i,"m"),s!==t&&(!n||this._changeInProgress?zt(this,Vt(t-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?s:Tt(this)}function Pt(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function Wt(e){return this.utcOffset(0,e)}function Rt(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Tt(this),"m")),this}function Ut(){if(null!=this._tzm)this.utcOffset(this._tzm);else if("string"==typeof this._i){var e=Ot(qs,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this}function Ct(e){return!!this.isValid()&&(e=e?pt(e).utcOffset():0,(this.utcOffset()-e)%60===0)}function Ft(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ht(){if(!_(this._isDSTShifted))return this._isDSTShifted;var e={};if(y(e,this),e=_t(e),e._a){var t=e._isUTC?d(e._a):pt(e._a);this._isDSTShifted=this.isValid()&&k(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Lt(){return!!this.isValid()&&!this._isUTC}function Gt(){return!!this.isValid()&&this._isUTC}function jt(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function Vt(e,t){var n=e,s=null,i,a,o;return Mt(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:r(e)?(n={},t?n[t]=e:n.milliseconds=e):(s=Vi.exec(e))?(i="-"===s[1]?-1:1,n={y:0,d:w(s[ni])*i,h:w(s[si])*i,m:w(s[ii])*i,s:w(s[ri])*i,ms:w(Dt(1e3*s[ai]))*i}):(s=Ei.exec(e))?(i="-"===s[1]?-1:1,n={y:Et(s[2],i),M:Et(s[3],i),w:Et(s[4],i),d:Et(s[5],i),h:Et(s[6],i),m:Et(s[7],i),s:Et(s[8],i)}):null==n?n={}:"object"==typeof n&&("from"in n||"to"in n)&&(o=At(pt(n.from),pt(n.to)),n={},n.ms=o.milliseconds,n.M=o.months),a=new St(n),Mt(e)&&u(e,"_locale")&&(a._locale=e._locale),a}function Et(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Nt(e,t){var n={milliseconds:0,months:0};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function At(e,t){var n;return e.isValid()&&t.isValid()?(t=xt(t,e),e.isBefore(t)?n=Nt(e,t):(n=Nt(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function It(e,t){return function(n,s){var i,r;return null===s||isNaN(+s)||(D(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),r=n,n=s,s=r),n="string"==typeof n?+n:n,i=Vt(n,s),zt(this,i,e),this}}function zt(t,n,s,i){var r=n._milliseconds,a=Dt(n._days),o=Dt(n._months);t.isValid()&&(i=null==i||i,r&&t._d.setTime(t._d.valueOf()+r*s),a&&N(t,"Date",E(t,"Date")+a*s),o&&le(t,E(t,"Month")+o*s),i&&e.updateOffset(t,a||o))}function Zt(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function $t(t,n){var s=t||pt(),i=xt(s,this).startOf("day"),r=e.calendarFormat(this,i)||"sameElse",a=n&&(Y(n[r])?n[r].call(this,s):n[r]);return this.format(a||this.localeData().calendar(r,this,pt(s)))}function qt(){return new g(this)}function Bt(e,t){var n=p(e)?e:pt(e);return!(!this.isValid()||!n.isValid())&&(t=H(_(t)?"millisecond":t),"millisecond"===t?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())}function Jt(e,t){var n=p(e)?e:pt(e);return!(!this.isValid()||!n.isValid())&&(t=H(_(t)?"millisecond":t),"millisecond"===t?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())}function Qt(e,t,n,s){return s=s||"()",("("===s[0]?this.isAfter(e,n):!this.isBefore(e,n))&&(")"===s[1]?this.isBefore(t,n):!this.isAfter(t,n))}function Xt(e,t){var n=p(e)?e:pt(e),s;return!(!this.isValid()||!n.isValid())&&(t=H(t||"millisecond"),"millisecond"===t?this.valueOf()===n.valueOf():(s=n.valueOf(),this.clone().startOf(t).valueOf()<=s&&s<=this.clone().endOf(t).valueOf()))}function Kt(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function en(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function tn(e,t,n){var s,i,r,a;return this.isValid()?(s=xt(e,this),s.isValid()?(i=6e4*(s.utcOffset()-this.utcOffset()),t=H(t),"year"===t||"month"===t||"quarter"===t?(a=nn(this,s),"quarter"===t?a/=3:"year"===t&&(a/=12)):(r=this-s,a="second"===t?r/1e3:"minute"===t?r/6e4:"hour"===t?r/36e5:"day"===t?(r-i)/864e5:"week"===t?(r-i)/6048e5:r),n?a:v(a)):NaN):NaN}function nn(e,t){var n=12*(t.year()-e.year())+(t.month()-e.month()),s=e.clone().add(n,"months"),i,r;return t-s<0?(i=e.clone().add(n-1,"months"),r=(t-s)/(s-i)):(i=e.clone().add(n+1,"months"),r=(t-s)/(i-s)),-(n+r)||0}function sn(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function rn(){var e=this.clone().utc();return 0<e.year()&&e.year()<=9999?Y(Date.prototype.toISOString)?this.toDate().toISOString():B(e,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):B(e,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function an(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");var n="["+e+'("]',s=0<this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",r=t+'[")]';return this.format(n+s+i+r)}function on(t){t||(t=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var n=B(this,t);return this.localeData().postformat(n)}function un(e,t){return this.isValid()&&(p(e)&&e.isValid()||pt(e).isValid())?Vt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function ln(e){return this.from(pt(),e)}function dn(e,t){return this.isValid()&&(p(e)&&e.isValid()||pt(e).isValid())?Vt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function hn(e){return this.to(pt(),e)}function cn(e){var t;return void 0===e?this._locale._abbr:(t=tt(e),null!=t&&(this._locale=t),this)}function fn(){return this._locale}function mn(e){switch(e=H(e)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===e&&this.weekday(0),"isoWeek"===e&&this.isoWeekday(1),"quarter"===e&&this.month(3*Math.floor(this.month()/3)),this}function _n(e){return e=H(e),void 0===e||"millisecond"===e?this:("date"===e&&(e="day"),this.startOf(e).add(1,"isoWeek"===e?"week":e).subtract(1,"ms"))}function yn(){return this._d.valueOf()-6e4*(this._offset||0)}function gn(){return Math.floor(this.valueOf()/1e3)}function pn(){return new Date(this.valueOf())}function vn(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function wn(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function kn(){return this.isValid()?this.toISOString():null}function Sn(){return f(this)}function Mn(){return l({},c(this))}function Dn(){return c(this).overflow}function Yn(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function On(e,t){Z(0,[e,e.length],0,t)}function xn(e){return Wn.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Tn(e){return Wn.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function bn(){return Me(this.year(),1,4)}function Pn(){var e=this.localeData()._week;return Me(this.year(),e.dow,e.doy)}function Wn(e,t,n,s,i){var r;return null==e?Se(this,s,i).year:(r=Me(e,s,i),t>r&&(t=r),Rn.call(this,e,t,n,s,i))}function Rn(e,t,n,s,i){var r=ke(e,t,n,s,i),a=ve(r.year,0,r.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function Un(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}function Cn(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}function Fn(e,t){t[ai]=w(1e3*("0."+e))}function Hn(){return this._isUTC?"UTC":""}function Ln(){return this._isUTC?"Coordinated Universal Time":""}function Gn(e){return pt(1e3*e)}function jn(){return pt.apply(null,arguments).parseZone()}function Vn(e){return e}function En(e,t,n,s){var i=tt(),r=d().set(s,t);return i[n](r,e)}function Nn(e,t,n){if(r(e)&&(t=e,e=void 0),e=e||"",null!=t)return En(e,t,n,"month");
var s,i=[];for(s=0;s<12;s++)i[s]=En(e,s,n,"month");return i}function An(e,t,n,s){"boolean"==typeof e?(r(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,r(t)&&(n=t,t=void 0),t=t||"");var i=tt(),a=e?i._week.dow:0;if(null!=n)return En(t,(n+a)%7,s,"day");var o,u=[];for(o=0;o<7;o++)u[o]=En(t,(o+a)%7,s,"day");return u}function In(e,t){return Nn(e,t,"months")}function zn(e,t){return Nn(e,t,"monthsShort")}function Zn(e,t,n){return An(e,t,n,"weekdays")}function $n(e,t,n){return An(e,t,n,"weekdaysShort")}function qn(e,t,n){return An(e,t,n,"weekdaysMin")}function Bn(){var e=this._data;return this._milliseconds=Xi(this._milliseconds),this._days=Xi(this._days),this._months=Xi(this._months),e.milliseconds=Xi(e.milliseconds),e.seconds=Xi(e.seconds),e.minutes=Xi(e.minutes),e.hours=Xi(e.hours),e.months=Xi(e.months),e.years=Xi(e.years),this}function Jn(e,t,n,s){var i=Vt(t,n);return e._milliseconds+=s*i._milliseconds,e._days+=s*i._days,e._months+=s*i._months,e._bubble()}function Qn(e,t){return Jn(this,e,t,1)}function Xn(e,t){return Jn(this,e,t,-1)}function Kn(e){return e<0?Math.floor(e):Math.ceil(e)}function es(){var e=this._milliseconds,t=this._days,n=this._months,s=this._data,i,r,a,o,u;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=864e5*Kn(ns(n)+t),t=0,n=0),s.milliseconds=e%1e3,i=v(e/1e3),s.seconds=i%60,r=v(i/60),s.minutes=r%60,a=v(r/60),s.hours=a%24,t+=v(a/24),u=v(ts(t)),n+=u,t-=Kn(ns(u)),o=v(n/12),n%=12,s.days=t,s.months=n,s.years=o,this}function ts(e){return 4800*e/146097}function ns(e){return 146097*e/4800}function ss(e){var t,n,s=this._milliseconds;if(e=H(e),"month"===e||"year"===e)return t=this._days+s/864e5,n=this._months+ts(t),"month"===e?n:n/12;switch(t=this._days+Math.round(ns(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return 24*t+s/36e5;case"minute":return 1440*t+s/6e4;case"second":return 86400*t+s/1e3;case"millisecond":return Math.floor(864e5*t)+s;default:throw new Error("Unknown unit "+e)}}function is(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*w(this._months/12)}function rs(e){return function(){return this.as(e)}}function as(e){return e=H(e),this[e+"s"]()}function os(e){return function(){return this._data[e]}}function us(){return v(this.days()/7)}function ls(e,t,n,s,i){return i.relativeTime(t||1,!!n,e,s)}function ds(e,t,n){var s=Vt(e).abs(),i=mr(s.as("s")),r=mr(s.as("m")),a=mr(s.as("h")),o=mr(s.as("d")),u=mr(s.as("M")),l=mr(s.as("y")),d=i<_r.s&&["s",i]||r<=1&&["m"]||r<_r.m&&["mm",r]||a<=1&&["h"]||a<_r.h&&["hh",a]||o<=1&&["d"]||o<_r.d&&["dd",o]||u<=1&&["M"]||u<_r.M&&["MM",u]||l<=1&&["y"]||["yy",l];return d[2]=t,d[3]=+e>0,d[4]=n,ls.apply(null,d)}function hs(e){return void 0===e?mr:"function"==typeof e&&(mr=e,!0)}function cs(e,t){return void 0!==_r[e]&&(void 0===t?_r[e]:(_r[e]=t,!0))}function fs(e){var t=this.localeData(),n=ds(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)}function ms(){var e=yr(this._milliseconds)/1e3,t=yr(this._days),n=yr(this._months),s,i,r;s=v(e/60),i=v(s/60),e%=60,s%=60,r=v(n/12),n%=12;var a=r,o=n,u=t,l=i,d=s,h=e,c=this.asSeconds();return c?(c<0?"-":"")+"P"+(a?a+"Y":"")+(o?o+"M":"")+(u?u+"D":"")+(l||d||h?"T":"")+(l?l+"H":"")+(d?d+"M":"")+(h?h+"S":""):"P0D"}var _s,ys;ys=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),n=t.length>>>0,s=0;s<n;s++)if(s in t&&e.call(this,t[s],s,t))return!0;return!1};var gs=ys,ps=e.momentProperties=[],vs=!1,ws={};e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;var ks;ks=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)u(e,t)&&n.push(t);return n};var Ss=ks,Ms={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Ds={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Ys="Invalid date",Os="%d",xs=/\d{1,2}/,Ts={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},bs={},Ps={},Ws=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Rs=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Us={},Cs={},Fs=/\d/,Hs=/\d\d/,Ls=/\d{3}/,Gs=/\d{4}/,js=/[+-]?\d{6}/,Vs=/\d\d?/,Es=/\d\d\d\d?/,Ns=/\d\d\d\d\d\d?/,As=/\d{1,3}/,Is=/\d{1,4}/,zs=/[+-]?\d{1,6}/,Zs=/\d+/,$s=/[+-]?\d+/,qs=/Z|[+-]\d\d:?\d\d/gi,Bs=/Z|[+-]\d\d(?::?\d\d)?/gi,Js=/[+-]?\d+(\.\d{1,3})?/,Qs=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Xs={},Ks={},ei=0,ti=1,ni=2,si=3,ii=4,ri=5,ai=6,oi=7,ui=8,li;li=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1};var di=li;Z("M",["MM",2],"Mo",function(){return this.month()+1}),Z("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),Z("MMMM",0,0,function(e){return this.localeData().months(this,e)}),F("month","M"),G("month",8),Q("M",Vs),Q("MM",Vs,Hs),Q("MMM",function(e,t){return t.monthsShortRegex(e)}),Q("MMMM",function(e,t){return t.monthsRegex(e)}),te(["M","MM"],function(e,t){t[ti]=w(e)-1}),te(["MMM","MMMM"],function(e,t,n,s){var i=n._locale.monthsParse(e,s,n._strict);null!=i?t[ti]=i:c(n).invalidMonth=e});var hi=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,ci="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),fi="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),mi=Qs,_i=Qs;Z("Y",0,0,function(){var e=this.year();return e<=9999?""+e:"+"+e}),Z(0,["YY",2],0,function(){return this.year()%100}),Z(0,["YYYY",4],0,"year"),Z(0,["YYYYY",5],0,"year"),Z(0,["YYYYYY",6,!0],0,"year"),F("year","y"),G("year",1),Q("Y",$s),Q("YY",Vs,Hs),Q("YYYY",Is,Gs),Q("YYYYY",zs,js),Q("YYYYYY",zs,js),te(["YYYYY","YYYYYY"],ei),te("YYYY",function(t,n){n[ei]=2===t.length?e.parseTwoDigitYear(t):w(t)}),te("YY",function(t,n){n[ei]=e.parseTwoDigitYear(t)}),te("Y",function(e,t){t[ei]=parseInt(e,10)}),e.parseTwoDigitYear=function(e){return w(e)+(w(e)>68?1900:2e3)};var yi=V("FullYear",!0);Z("w",["ww",2],"wo","week"),Z("W",["WW",2],"Wo","isoWeek"),F("week","w"),F("isoWeek","W"),G("week",5),G("isoWeek",5),Q("w",Vs),Q("ww",Vs,Hs),Q("W",Vs),Q("WW",Vs,Hs),ne(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=w(e)});var gi={dow:0,doy:6};Z("d",0,"do","day"),Z("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),Z("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),Z("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),Z("e",0,0,"weekday"),Z("E",0,0,"isoWeekday"),F("day","d"),F("weekday","e"),F("isoWeekday","E"),G("day",11),G("weekday",11),G("isoWeekday",11),Q("d",Vs),Q("e",Vs),Q("E",Vs),Q("dd",function(e,t){return t.weekdaysMinRegex(e)}),Q("ddd",function(e,t){return t.weekdaysShortRegex(e)}),Q("dddd",function(e,t){return t.weekdaysRegex(e)}),ne(["dd","ddd","dddd"],function(e,t,n,s){var i=n._locale.weekdaysParse(e,s,n._strict);null!=i?t.d=i:c(n).invalidWeekday=e}),ne(["d","e","E"],function(e,t,n,s){t[s]=w(e)});var pi="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),vi="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),wi="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ki=Qs,Si=Qs,Mi=Qs;Z("H",["HH",2],0,"hour"),Z("h",["hh",2],0,Ae),Z("k",["kk",2],0,Ie),Z("hmm",0,0,function(){return""+Ae.apply(this)+z(this.minutes(),2)}),Z("hmmss",0,0,function(){return""+Ae.apply(this)+z(this.minutes(),2)+z(this.seconds(),2)}),Z("Hmm",0,0,function(){return""+this.hours()+z(this.minutes(),2)}),Z("Hmmss",0,0,function(){return""+this.hours()+z(this.minutes(),2)+z(this.seconds(),2)}),ze("a",!0),ze("A",!1),F("hour","h"),G("hour",13),Q("a",Ze),Q("A",Ze),Q("H",Vs),Q("h",Vs),Q("HH",Vs,Hs),Q("hh",Vs,Hs),Q("hmm",Es),Q("hmmss",Ns),Q("Hmm",Es),Q("Hmmss",Ns),te(["H","HH"],si),te(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),te(["h","hh"],function(e,t,n){t[si]=w(e),c(n).bigHour=!0}),te("hmm",function(e,t,n){var s=e.length-2;t[si]=w(e.substr(0,s)),t[ii]=w(e.substr(s)),c(n).bigHour=!0}),te("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[si]=w(e.substr(0,s)),t[ii]=w(e.substr(s,2)),t[ri]=w(e.substr(i)),c(n).bigHour=!0}),te("Hmm",function(e,t,n){var s=e.length-2;t[si]=w(e.substr(0,s)),t[ii]=w(e.substr(s))}),te("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[si]=w(e.substr(0,s)),t[ii]=w(e.substr(s,2)),t[ri]=w(e.substr(i))});var Di=/[ap]\.?m?\.?/i,Yi=V("Hours",!0),Oi={calendar:Ms,longDateFormat:Ds,invalidDate:Ys,ordinal:Os,ordinalParse:xs,relativeTime:Ts,months:ci,monthsShort:fi,week:gi,weekdays:pi,weekdaysMin:wi,weekdaysShort:vi,meridiemParse:Di},xi={},Ti={},bi,Pi=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Wi=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ri=/Z|[+-]\d\d(?::?\d\d)?/,Ui=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Ci=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Fi=/^\/?Date\((\-?\d+)/i;e.createFromInputFallback=M("value provided is not in a recognized ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),e.ISO_8601=function(){};var Hi=M("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=pt.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:m()}),Li=M("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=pt.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:m()}),Gi=function(){return Date.now?Date.now():+new Date};Yt("Z",":"),Yt("ZZ",""),Q("Z",Bs),Q("ZZ",Bs),te(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Ot(Bs,e)});var ji=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var Vi=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Ei=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;Vt.fn=St.prototype;var Ni=It(1,"add"),Ai=It(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Ii=M("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});Z(0,["gg",2],0,function(){return this.weekYear()%100}),Z(0,["GG",2],0,function(){return this.isoWeekYear()%100}),On("gggg","weekYear"),On("ggggg","weekYear"),On("GGGG","isoWeekYear"),On("GGGGG","isoWeekYear"),F("weekYear","gg"),F("isoWeekYear","GG"),G("weekYear",1),G("isoWeekYear",1),Q("G",$s),Q("g",$s),Q("GG",Vs,Hs),Q("gg",Vs,Hs),Q("GGGG",Is,Gs),Q("gggg",Is,Gs),Q("GGGGG",zs,js),Q("ggggg",zs,js),ne(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,s){t[s.substr(0,2)]=w(e)}),ne(["gg","GG"],function(t,n,s,i){n[i]=e.parseTwoDigitYear(t)}),Z("Q",0,"Qo","quarter"),F("quarter","Q"),G("quarter",7),Q("Q",Fs),te("Q",function(e,t){t[ti]=3*(w(e)-1)}),Z("D",["DD",2],"Do","date"),F("date","D"),G("date",9),Q("D",Vs),Q("DD",Vs,Hs),Q("Do",function(e,t){return e?t._ordinalParse:t._ordinalParseLenient}),te(["D","DD"],ni),te("Do",function(e,t){t[ni]=w(e.match(Vs)[0],10)});var zi=V("Date",!0);Z("DDD",["DDDD",3],"DDDo","dayOfYear"),F("dayOfYear","DDD"),G("dayOfYear",4),Q("DDD",As),Q("DDDD",Ls),te(["DDD","DDDD"],function(e,t,n){n._dayOfYear=w(e)}),Z("m",["mm",2],0,"minute"),F("minute","m"),G("minute",14),Q("m",Vs),Q("mm",Vs,Hs),te(["m","mm"],ii);var Zi=V("Minutes",!1);Z("s",["ss",2],0,"second"),F("second","s"),G("second",15),Q("s",Vs),Q("ss",Vs,Hs),te(["s","ss"],ri);var $i=V("Seconds",!1);Z("S",0,0,function(){return~~(this.millisecond()/100)}),Z(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),Z(0,["SSS",3],0,"millisecond"),Z(0,["SSSS",4],0,function(){return 10*this.millisecond()}),Z(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),Z(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),Z(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),Z(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),Z(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),F("millisecond","ms"),G("millisecond",16),Q("S",As,Fs),Q("SS",As,Hs),Q("SSS",As,Ls);var qi;for(qi="SSSS";qi.length<=9;qi+="S")Q(qi,Zs);for(qi="S";qi.length<=9;qi+="S")te(qi,Fn);var Bi=V("Milliseconds",!1);Z("z",0,0,"zoneAbbr"),Z("zz",0,0,"zoneName");var Ji=g.prototype;Ji.add=Ni,Ji.calendar=$t,Ji.clone=qt,Ji.diff=tn,Ji.endOf=_n,Ji.format=on,Ji.from=un,Ji.fromNow=ln,Ji.to=dn,Ji.toNow=hn,Ji.get=A,Ji.invalidAt=Dn,Ji.isAfter=Bt,Ji.isBefore=Jt,Ji.isBetween=Qt,Ji.isSame=Xt,Ji.isSameOrAfter=Kt,Ji.isSameOrBefore=en,Ji.isValid=Sn,Ji.lang=Ii,Ji.locale=cn,Ji.localeData=fn,Ji.max=Li,Ji.min=Hi,Ji.parsingFlags=Mn,Ji.set=I,Ji.startOf=mn,Ji.subtract=Ai,Ji.toArray=vn,Ji.toObject=wn,Ji.toDate=pn,Ji.toISOString=rn,Ji.inspect=an,Ji.toJSON=kn,Ji.toString=sn,Ji.unix=gn,Ji.valueOf=yn,Ji.creationData=Yn,Ji.year=yi,Ji.isLeapYear=ge,Ji.weekYear=xn,Ji.isoWeekYear=Tn,Ji.quarter=Ji.quarters=Un,Ji.month=de,Ji.daysInMonth=he,Ji.week=Ji.weeks=xe,Ji.isoWeek=Ji.isoWeeks=Te,Ji.weeksInYear=Pn,Ji.isoWeeksInYear=bn,Ji.date=zi,Ji.day=Ji.days=He,Ji.weekday=Le,Ji.isoWeekday=Ge,Ji.dayOfYear=Cn,Ji.hour=Ji.hours=Yi,Ji.minute=Ji.minutes=Zi,Ji.second=Ji.seconds=$i,Ji.millisecond=Ji.milliseconds=Bi,Ji.utcOffset=bt,Ji.utc=Wt,Ji.local=Rt,Ji.parseZone=Ut,Ji.hasAlignedHourOffset=Ct,Ji.isDST=Ft,Ji.isLocal=Lt,Ji.isUtcOffset=Gt,Ji.isUtc=jt,Ji.isUTC=jt,Ji.zoneAbbr=Hn,Ji.zoneName=Ln,Ji.dates=M("dates accessor is deprecated. Use date instead.",zi),Ji.months=M("months accessor is deprecated. Use month instead",de),Ji.years=M("years accessor is deprecated. Use year instead",yi),Ji.zone=M("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Pt),Ji.isDSTShifted=M("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Ht);var Qi=T.prototype;Qi.calendar=b,Qi.longDateFormat=P,Qi.invalidDate=W,Qi.ordinal=R,Qi.preparse=Vn,Qi.postformat=Vn,Qi.relativeTime=U,Qi.pastFuture=C,Qi.set=O,Qi.months=re,Qi.monthsShort=ae,Qi.monthsParse=ue,Qi.monthsRegex=fe,Qi.monthsShortRegex=ce,Qi.week=De,Qi.firstDayOfYear=Oe,Qi.firstDayOfWeek=Ye,Qi.weekdays=We,Qi.weekdaysMin=Ue,Qi.weekdaysShort=Re,Qi.weekdaysParse=Fe,Qi.weekdaysRegex=je,Qi.weekdaysShortRegex=Ve,Qi.weekdaysMinRegex=Ee,Qi.isPM=$e,Qi.meridiem=qe,Xe("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=1===w(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n}}),e.lang=M("moment.lang is deprecated. Use moment.locale instead.",Xe),e.langData=M("moment.langData is deprecated. Use moment.localeData instead.",tt);var Xi=Math.abs,Ki=rs("ms"),er=rs("s"),tr=rs("m"),nr=rs("h"),sr=rs("d"),ir=rs("w"),rr=rs("M"),ar=rs("y"),or=os("milliseconds"),ur=os("seconds"),lr=os("minutes"),dr=os("hours"),hr=os("days"),cr=os("months"),fr=os("years"),mr=Math.round,_r={s:45,m:45,h:22,d:26,M:11},yr=Math.abs,gr=St.prototype;return gr.abs=Bn,gr.add=Qn,gr.subtract=Xn,gr.as=ss,gr.asMilliseconds=Ki,gr.asSeconds=er,gr.asMinutes=tr,gr.asHours=nr,gr.asDays=sr,gr.asWeeks=ir,gr.asMonths=rr,gr.asYears=ar,gr.valueOf=is,gr._bubble=es,gr.get=as,gr.milliseconds=or,gr.seconds=ur,gr.minutes=lr,gr.hours=dr,gr.days=hr,gr.weeks=us,gr.months=cr,gr.years=fr,gr.humanize=fs,gr.toISOString=ms,gr.toString=ms,gr.toJSON=ms,gr.locale=cn,gr.localeData=fn,gr.toIsoString=M("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ms),gr.lang=Ii,Z("X",0,0,"unix"),Z("x",0,0,"valueOf"),Q("x",$s),Q("X",Js),te("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),te("x",function(e,t,n){n._d=new Date(w(e))}),e.version="2.16.0",t(pt),e.fn=Ji,e.min=wt,e.max=kt,e.now=Gi,e.utc=d,e.unix=Gn,e.months=In,e.isDate=a,e.locale=Xe,e.invalid=m,e.duration=Vt,e.isMoment=p,e.weekdays=Zn,e.parseZone=jn,e.localeData=tt,e.isDuration=Mt,e.monthsShort=zn,e.weekdaysMin=qn,e.defineLocale=Ke,e.updateLocale=et,e.locales=nt,e.weekdaysShort=$n,e.normalizeUnits=H,e.relativeTimeRounding=hs,e.relativeTimeThreshold=cs,e.calendarFormat=Zt,e.prototype=Ji,e})}).call(this),function(){s=this.moment;try{delete this.moment}catch(e){}}.call(this),"undefined"==typeof Package&&(Package={}),function(e,t){for(var n in t)n in e||(e[n]=t[n])}(Package["momentjs:moment"]={},{moment:s})}();
!function(){var t=Package.meteor.Meteor,e=Package.meteor.global,n=Package.meteor.meteorEnv,r=Package.modules.meteorInstall,i=Package.modules.Buffer,o=Package.modules.process,u=Package["ecmascript-runtime"].Symbol,a=Package["ecmascript-runtime"].Map,s=Package["ecmascript-runtime"].Set,c=Package["babel-runtime"].meteorBabelHelpers,f=Package.promise.Promise,l,d=r({node_modules:{meteor:{validatejs:{lib:{"validate.js":["babel-runtime/helpers/typeof",function(t,e,n){var r;n.import("babel-runtime/helpers/typeof",{default:function(t){r=t}}),function(t,e,n){"use strict";var i=function t(e,n,r){r=o.extend({},o.options,r);var i=o.runValidations(e,n,r),u,a;for(u in c.sanitizeForInObject(i))for(a in c.sanitizeForInObject(i[u]))if(o.isPromise(i[u][a]))throw new Error("Use validate.async if you want support for promises");return t.processValidationResults(i,r)},o=i;o.extend=function(t){return[].slice.call(arguments,1).forEach(function(e){for(var n in c.sanitizeForInObject(e))t[n]=e[n]}),t},o.extend(i,{version:{major:0,minor:9,patch:0,metadata:"development",toString:function(){function t(){var t=o.format("%{major}.%{minor}.%{patch}",o.version);return o.isEmpty(o.version.metadata)||(t+="+"+o.version.metadata),t}return t}()},Promise:"undefined"!=typeof f?f:null,EMPTY_STRING_REGEXP:/^\s*$/,runValidations:function(){function t(t,e,n){var r=[],i,u,a,s,f,l,d;(o.isDomElement(t)||o.isJqueryElement(t))&&(t=o.collectFormValues(t));for(i in c.sanitizeForInObject(e)){a=o.getDeepObjectValue(t,i),s=o.result(e[i],a,t,i,n,e);for(u in c.sanitizeForInObject(s)){if(f=o.validators[u],!f)throw d=o.format("Unknown validator %{name}",{name:u}),new Error(d);l=s[u],l=o.result(l,a,t,i,n,e),l&&r.push({attribute:i,value:a,validator:u,globalOptions:n,attributes:t,options:l,error:f.call(f,a,l,i,t,n)})}}return r}return t}(),processValidationResults:function(){function t(t,e){var n;switch(t=o.pruneEmptyErrors(t,e),t=o.expandMultipleErrors(t,e),t=o.convertErrorMessages(t,e),e.format||"grouped"){case"detailed":break;case"flat":t=o.flattenErrorsToArray(t);break;case"grouped":t=o.groupErrorsByAttribute(t);for(n in c.sanitizeForInObject(t))t[n]=o.flattenErrorsToArray(t[n]);break;default:throw new Error(o.format("Unknown format %{format}",e))}return o.isEmpty(t)?void 0:t}return t}(),async:function(){function t(t,e,n){n=o.extend({},o.async.options,n);var r=n.wrapErrors||function(t){return t};n.cleanAttributes!==!1&&(t=o.cleanAttributes(t,e));var i=o.runValidations(t,e,n);return new o.Promise(function(u,a){o.waitForResults(i).then(function(){var s=o.processValidationResults(i,n);s?a(new r(s,n,t,e)):u(t)},function(t){a(t)})})}return t}(),single:function(){function t(t,e,n){return n=o.extend({},o.single.options,n,{format:"flat",fullMessages:!1}),o({single:t},{single:e},n)}return t}(),waitForResults:function(){function t(t){return t.reduce(function(t,e){return o.isPromise(e.error)?t.then(function(){return e.error.then(function(t){e.error=t||null},function(t){if(t instanceof Error)throw t;o.error("Rejecting promises with the result is deprecated. Please use the resolve callback instead."),e.error=t})}):t},new o.Promise(function(t){t()}))}return t}(),result:function(){function t(t){var e=[].slice.call(arguments,1);return"function"==typeof t&&(t=t.apply(null,e)),t}return t}(),isNumber:function(){function t(t){return"number"==typeof t&&!isNaN(t)}return t}(),isFunction:function(){function t(t){return"function"==typeof t}return t}(),isInteger:function(){function t(t){return o.isNumber(t)&&t%1===0}return t}(),isObject:function(){function t(t){return t===Object(t)}return t}(),isDate:function(){function t(t){return t instanceof Date}return t}(),isDefined:function(){function t(t){return null!==t&&void 0!==t}return t}(),isPromise:function(){function t(t){return!!t&&o.isFunction(t.then)}return t}(),isJqueryElement:function(){function t(t){return t&&o.isString(t.jquery)}return t}(),isDomElement:function(){function t(t){return!!t&&(!(!o.isFunction(t.querySelectorAll)||!o.isFunction(t.querySelector))&&(!(!o.isObject(document)||t!==document)||("object"===("undefined"==typeof HTMLElement?"undefined":r(HTMLElement))?t instanceof HTMLElement:t&&"object"===("undefined"==typeof t?"undefined":r(t))&&null!==t&&1===t.nodeType&&"string"==typeof t.nodeName)))}return t}(),isEmpty:function(){function t(t){var e;if(!o.isDefined(t))return!0;if(o.isFunction(t))return!1;if(o.isString(t))return o.EMPTY_STRING_REGEXP.test(t);if(o.isArray(t))return 0===t.length;if(o.isDate(t))return!1;if(o.isObject(t)){for(e in c.sanitizeForInObject(t))return!1;return!0}return!1}return t}(),format:o.extend(function(t,e){return o.isString(t)?t.replace(o.format.FORMAT_REGEXP,function(t,n,r){return"%"===n?"%{"+r+"}":String(e[r])}):t},{FORMAT_REGEXP:/(%?)%\{([^\}]+)\}/g}),prettify:function(){function t(t){return o.isNumber(t)?100*t%1===0?""+t:parseFloat(Math.round(100*t)/100).toFixed(2):o.isArray(t)?t.map(function(t){return o.prettify(t)}).join(", "):o.isObject(t)?t.toString():(t=""+t,t.replace(/([^\s])\.([^\s])/g,"$1 $2").replace(/\\+/g,"").replace(/[_-]/g," ").replace(/([a-z])([A-Z])/g,function(t,e,n){return""+e+" "+n.toLowerCase()}).toLowerCase())}return t}(),stringifyValue:function(){function t(t){return o.prettify(t)}return t}(),isString:function(){function t(t){return"string"==typeof t}return t}(),isArray:function(){function t(t){return"[object Array]"==={}.toString.call(t)}return t}(),contains:function(){function t(t,e){return!!o.isDefined(t)&&(o.isArray(t)?t.indexOf(e)!==-1:e in t)}return t}(),forEachKeyInKeypath:function(){function t(t,e,n){if(o.isString(e)){var r="",i,u=!1;for(i=0;i<e.length;++i)switch(e[i]){case".":u?(u=!1,r+="."):(t=n(t,r,!1),r="");break;case"\\":u?(u=!1,r+="\\"):u=!0;break;default:u=!1,r+=e[i]}return n(t,r,!0)}}return t}(),getDeepObjectValue:function(){function t(t,e){if(o.isObject(t))return o.forEachKeyInKeypath(t,e,function(t,e){if(o.isObject(t))return t[e]})}return t}(),collectFormValues:function(){function t(t,e){var n={},r,i,u,a;if(o.isJqueryElement(t)&&(t=t[0]),!t)return n;for(e=e||{},u=t.querySelectorAll("input[name], textarea[name]"),r=0;r<u.length;++r)i=u.item(r),o.isDefined(i.getAttribute("data-ignored"))||(a=o.sanitizeFormValue(i.value,e),"number"===i.type?a=a?+a:null:"checkbox"===i.type?i.attributes.value?i.checked||(a=n[i.name]||null):a=i.checked:"radio"===i.type&&(i.checked||(a=n[i.name]||null)),n[i.name]=a);for(u=t.querySelectorAll("select[name]"),r=0;r<u.length;++r)i=u.item(r),a=o.sanitizeFormValue(i.options[i.selectedIndex].value,e),n[i.name]=a;return n}return t}(),sanitizeFormValue:function(){function t(t,e){return e.trim&&o.isString(t)&&(t=t.trim()),e.nullify!==!1&&""===t?null:t}return t}(),capitalize:function(){function t(t){return o.isString(t)?t[0].toUpperCase()+t.slice(1):t}return t}(),pruneEmptyErrors:function(){function t(t){return t.filter(function(t){return!o.isEmpty(t.error)})}return t}(),expandMultipleErrors:function(){function t(t){var e=[];return t.forEach(function(t){o.isArray(t.error)?t.error.forEach(function(n){e.push(o.extend({},t,{error:n}))}):e.push(t)}),e}return t}(),convertErrorMessages:function(){function t(t,e){e=e||{};var n=[];return t.forEach(function(t){var r=o.result(t.error,t.value,t.attribute,t.options,t.attributes,t.globalOptions);return o.isString(r)?("^"===r[0]?r=r.slice(1):e.fullMessages!==!1&&(r=o.capitalize(o.prettify(t.attribute))+" "+r),r=r.replace(/\\\^/g,"^"),r=o.format(r,{value:o.stringifyValue(t.value)}),void n.push(o.extend({},t,{error:r}))):void n.push(t)}),n}return t}(),groupErrorsByAttribute:function(){function t(t){var e={};return t.forEach(function(t){var n=e[t.attribute];n?n.push(t):e[t.attribute]=[t]}),e}return t}(),flattenErrorsToArray:function(){function t(t){return t.map(function(t){return t.error})}return t}(),cleanAttributes:function(){function t(t,e){function n(t,e,n){return o.isObject(t[e])?t[e]:t[e]=!!n||{}}function r(t){var e={},r,i;for(i in c.sanitizeForInObject(t))t[i]&&o.forEachKeyInKeypath(e,i,n);return e}function i(t,e){if(!o.isObject(t))return t;var n=o.extend({},t),r,u;for(u in c.sanitizeForInObject(t))r=e[u],o.isObject(r)?n[u]=i(n[u],r):r||delete n[u];return n}return o.isObject(e)&&o.isObject(t)?(e=r(e),i(t,e)):{}}return t}(),exposeModule:function(){function t(t,e,n,r,i){n?(r&&r.exports&&(n=r.exports=t),n.validate=t):(e.validate=t,t.isFunction(i)&&i.amd&&i([],function(){return t}))}return t}(),warn:function(){function t(t){"undefined"!=typeof console&&console.warn&&console.warn("[validate.js] "+t)}return t}(),error:function(){function t(t){"undefined"!=typeof console&&console.error&&console.error("[validate.js] "+t)}return t}()}),i.validators={presence:function(){function t(t,e){if(e=o.extend({},this.options,e),o.isEmpty(t))return e.message||this.message||"can't be blank"}return t}(),length:function(){function t(t,e,n){if(!o.isEmpty(t)){e=o.extend({},this.options,e);var r=e.is,i=e.maximum,u=e.minimum,a=e.tokenizer||function(t){return t},s,c=[];t=a(t);var f=t.length;return o.isNumber(f)?(o.isNumber(r)&&f!==r&&(s=e.wrongLength||this.wrongLength||"is the wrong length (should be %{count} characters)",c.push(o.format(s,{count:r}))),o.isNumber(u)&&f<u&&(s=e.tooShort||this.tooShort||"is too short (minimum is %{count} characters)",c.push(o.format(s,{count:u}))),o.isNumber(i)&&f>i&&(s=e.tooLong||this.tooLong||"is too long (maximum is %{count} characters)",c.push(o.format(s,{count:i}))),c.length>0?e.message||c:void 0):(o.error(o.format("Attribute %{attr} has a non numeric value for `length`",{attr:n})),e.message||this.notValid||"has an incorrect length")}}return t}(),numericality:function(){function t(t,e){if(!o.isEmpty(t)){e=o.extend({},this.options,e);var n=[],r,i,u={greaterThan:function(){function t(t,e){return t>e}return t}(),greaterThanOrEqualTo:function(){function t(t,e){return t>=e}return t}(),equalTo:function(){function t(t,e){return t===e}return t}(),lessThan:function(){function t(t,e){return t<e}return t}(),lessThanOrEqualTo:function(){function t(t,e){return t<=e}return t}()};if(e.noStrings!==!0&&o.isString(t)&&(t=+t),!o.isNumber(t))return e.message||e.notValid||this.notValid||"is not a number";if(e.onlyInteger&&!o.isInteger(t))return e.message||e.notInteger||this.notInteger||"must be an integer";for(r in c.sanitizeForInObject(u))if(i=e[r],o.isNumber(i)&&!u[r](t,i)){var a="not"+o.capitalize(r),s=e[a]||this[a]||"must be %{type} %{count}";n.push(o.format(s,{count:i,type:o.prettify(r)}))}return e.odd&&t%2!==1&&n.push(e.notOdd||this.notOdd||"must be odd"),e.even&&t%2!==0&&n.push(e.notEven||this.notEven||"must be even"),n.length?e.message||n:void 0}}return t}(),datetime:o.extend(function(t,e){if(!o.isFunction(this.parse)||!o.isFunction(this.format))throw new Error("Both the parse and format functions needs to be set to use the datetime/date validator");if(!o.isEmpty(t)){e=o.extend({},this.options,e);var n,r=[],i=e.earliest?this.parse(e.earliest,e):NaN,u=e.latest?this.parse(e.latest,e):NaN;return t=this.parse(t,e),isNaN(t)||e.dateOnly&&t%864e5!==0?e.message||this.notValid||"must be a valid date":(!isNaN(i)&&t<i&&(n=this.tooEarly||"must be no earlier than %{date}",n=o.format(n,{date:this.format(i,e)}),r.push(n)),!isNaN(u)&&t>u&&(n=this.tooLate||"must be no later than %{date}",n=o.format(n,{date:this.format(u,e)}),r.push(n)),r.length?e.message||r:void 0)}},{parse:null,format:null}),date:function(){function t(t,e){return e=o.extend({},e,{dateOnly:!0}),o.validators.datetime.call(o.validators.datetime,t,e)}return t}(),format:function(){function t(t,e){(o.isString(e)||e instanceof RegExp)&&(e={pattern:e}),e=o.extend({},this.options,e);var n=e.message||this.message||"is invalid",r=e.pattern,i;if(!o.isEmpty(t))return o.isString(t)?(o.isString(r)&&(r=new RegExp(e.pattern,e.flags)),i=r.exec(t),i&&i[0].length==t.length?void 0:n):n}return t}(),inclusion:function(){function t(t,e){if(!o.isEmpty(t)&&(o.isArray(e)&&(e={within:e}),e=o.extend({},this.options,e),!o.contains(e.within,t))){var n=e.message||this.message||"^%{value} is not included in the list";return o.format(n,{value:t})}}return t}(),exclusion:function(){function t(t,e){if(!o.isEmpty(t)&&(o.isArray(e)&&(e={within:e}),e=o.extend({},this.options,e),o.contains(e.within,t))){var n=e.message||this.message||"^%{value} is restricted";return o.format(n,{value:t})}}return t}(),email:o.extend(function(t,e){e=o.extend({},this.options,e);var n=e.message||this.message||"is not a valid email";if(!o.isEmpty(t))return o.isString(t)&&this.PATTERN.exec(t)?void 0:n},{PATTERN:/^[a-z0-9\u007F-\uffff!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9\u007F-\uffff!#$%&'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z]{2,}$/i}),equality:function(){function t(t,e,n,r){if(!o.isEmpty(t)){o.isString(e)&&(e={attribute:e}),e=o.extend({},this.options,e);var i=e.message||this.message||"is not equal to %{attribute}";if(o.isEmpty(e.attribute)||!o.isString(e.attribute))throw new Error("The attribute must be a non empty string");var u=o.getDeepObjectValue(r,e.attribute),a=e.comparator||function(t,e){return t===e};return a(t,u,e,n,r)?void 0:o.format(i,{attribute:o.prettify(e.attribute)})}}return t}(),url:function(){function t(t,e){if(!o.isEmpty(t)){e=o.extend({},this.options,e);var n=e.message||this.message||"is not a valid url",r=e.schemes||this.schemes||["http","https"],i=e.allowLocal||this.allowLocal||!1;if(!o.isString(t))return n;var u="^(?:(?:"+r.join("|")+"):\\/\\/)(?:\\S+(?::\\S*)?@)?";u+="(?:";var a="(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))";i?a="(?:localhost|"+a+")":u+="(?!10(?:\\.\\d{1,3}){3})(?!127(?:\\.\\d{1,3}){3})(?!169\\.254(?:\\.\\d{1,3}){2})(?!192\\.168(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})",u+="(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|"+a+"(?::\\d{2,5})?(?:\\/[^\\s]*)?$";var s=new RegExp(u,"i");return s.exec(t)?void 0:n}}return t}()},i.exposeModule(i,this,t,e,n)}.call(this,"undefined"!=typeof e?e:null,"undefined"!=typeof n?n:null,"undefined"!=typeof define?define:null)}]},"load.js":["./lib/validate.js",function(t,e,n){var r;n.import("./lib/validate.js",{validate:function(t){r=t}}),r.validators.equals=function(t,e,n,r){if(e&&t!==e.value)return n+"must equal "+e.value},r.validators.doesNotEqual=function(t,e,n){if(e&&t===e.value)return n+"cannot equal "+e.value},r.validators.contains=function(t,e,n){if(e&&t.indexOf&&t.indexOf(e.value)===-1)return n+"must contain "+e.value},r.validators.doesNotContain=function(t,e,n){if(e&&t.indexOf&&t.indexOf(e.value)!==-1)return n+"cannot contain "+e.value},l=r}]}}}},{extensions:[".js",".json"]});d("./node_modules/meteor/validatejs/lib/validate.js"),d("./node_modules/meteor/validatejs/load.js"),"undefined"==typeof Package&&(Package={}),function(t,e){for(var n in e)n in t||(t[n]=e[n])}(Package.validatejs={},{validate:l})}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,r=Package.meteor.meteorEnv,s=Package.jquery.$,n=Package.jquery.jQuery;(function(){(function(){!function(e,t){var r=[].slice,s={},n=e.amplify={publish:function(e){if("string"!=typeof e)throw new Error("You must provide a valid topic to publish.");var t=r.call(arguments,1),n,a,o,u=0,i;if(!s[e])return!0;for(n=s[e].slice(),o=n.length;u<o&&(a=n[u],i=a.callback.apply(a.context,t),i!==!1);u++);return i!==!1},subscribe:function(e,t,r,n){if("string"!=typeof e)throw new Error("You must provide a valid topic to create a subscription.");3===arguments.length&&"number"==typeof r&&(n=r,r=t,t=null),2===arguments.length&&(r=t,t=null),n=n||10;for(var a=0,o=e.split(/\s/),u=o.length,i;a<u;a++){e=o[a],i=!1,s[e]||(s[e]=[]);for(var c=s[e].length-1,l={callback:r,context:t,priority:n};c>=0;c--)if(s[e][c].priority<=n){s[e].splice(c+1,0,l),i=!0;break}i||s[e].unshift(l)}return r},unsubscribe:function(e,t,r){if("string"!=typeof e)throw new Error("You must provide a valid topic to remove a subscription.");if(2===arguments.length&&(r=t,t=null),s[e])for(var n=s[e].length,a=0;a<n;a++)s[e][a].callback===r&&(t&&s[e][a].context!==t||(s[e].splice(a,1),a--,n--))}}}(this),function(e,t){function r(e,r){s.addType(e,function(a,o,u){var i,c,l,p,f=o,d=(new Date).getTime();if(!a){f={},p=[],l=0;try{for(a=r.length;a=r.key(l++);)n.test(a)&&(c=JSON.parse(r.getItem(a)),c.expires&&c.expires<=d?p.push(a):f[a.replace(n,"")]=c.data);for(;a=p.pop();)r.removeItem(a)}catch(e){}return f}if(a="__amplify__"+a,o===t){if(i=r.getItem(a),c=i?JSON.parse(i):{expires:-1},!(c.expires&&c.expires<=d))return c.data;r.removeItem(a)}else if(null===o)r.removeItem(a);else{c=JSON.stringify({data:o,expires:u.expires?d+u.expires:null});try{r.setItem(a,c)}catch(t){s[e]();try{r.setItem(a,c)}catch(e){throw s.error()}}}return f})}var s=e.store=function(e,t,r){var n=s.type;return r&&r.type&&r.type in s.types&&(n=r.type),s.types[n](e,t,r||{})};s.types={},s.type=null,s.addType=function(e,t){s.type||(s.type=e),s.types[e]=t,s[e]=function(t,r,n){return n=n||{},n.type=e,s(t,r,n)}},s.error=function(){return"amplify.store quota exceeded"};var n=/^__amplify__/;for(var a in{localStorage:1,sessionStorage:1})try{window[a].setItem("__amplify__","x"),window[a].removeItem("__amplify__"),r(a,window[a])}catch(e){}if(!s.types.localStorage&&window.globalStorage)try{r("globalStorage",window.globalStorage[window.location.hostname]),"sessionStorage"===s.type&&(s.type="globalStorage")}catch(e){}!function(){if(!s.types.localStorage){var e=document.createElement("div"),r="amplify";e.style.display="none",document.getElementsByTagName("head")[0].appendChild(e);try{e.addBehavior("#default#userdata"),e.load(r)}catch(t){return void e.parentNode.removeChild(e)}s.addType("userData",function(n,a,o){e.load(r);var u,i,c,l,p,f=a,d=(new Date).getTime();if(!n){for(f={},p=[],l=0;u=e.XMLDocument.documentElement.attributes[l++];)i=JSON.parse(u.value),i.expires&&i.expires<=d?p.push(u.name):f[u.name]=i.data;for(;n=p.pop();)e.removeAttribute(n);return e.save(r),f}if(n=n.replace(/[^\-._0-9A-Za-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c-\u200d\u203f\u2040\u2070-\u218f]/g,"-"),n=n.replace(/^-/,"_-"),a===t){if(u=e.getAttribute(n),i=u?JSON.parse(u):{expires:-1},!(i.expires&&i.expires<=d))return i.data;e.removeAttribute(n)}else null===a?e.removeAttribute(n):(c=e.getAttribute(n),i=JSON.stringify({data:a,expires:o.expires?d+o.expires:null}),e.setAttribute(n,i));try{e.save(r)}catch(t){null===c?e.removeAttribute(n):e.setAttribute(n,c),s.userData();try{e.setAttribute(n,i),e.save(r)}catch(t){throw null===c?e.removeAttribute(n):e.setAttribute(n,c),s.error()}}return f})}}(),function(){function e(e){return e===t?t:JSON.parse(JSON.stringify(e))}var r={},n={};s.addType("memory",function(s,a,o){return s?a===t?e(r[s]):(n[s]&&(clearTimeout(n[s]),delete n[s]),null===a?(delete r[s],null):(r[s]=a,o.expires&&(n[s]=setTimeout(function(){delete r[s],delete n[s]},o.expires)),a)):e(r)})}()}(this.amplify=this.amplify||{}),function(e,t){"use strict";function r(){}function s(e){return"[object Function]"==={}.toString.call(e)}function n(e){var t=!1;return setTimeout(function(){t=!0},1),function(){var r=this,s=arguments;t?e.apply(r,s):setTimeout(function(){e.apply(r,s)},1)}}e.request=function(t,a,o){var u=t||{};"string"==typeof u&&(s(a)&&(o=a,a={}),u={resourceId:t,data:a||{},success:o});var i={abort:r},c=e.request.resources[u.resourceId],l=u.success||r,p=u.error||r;if(u.success=n(function(t,r){r=r||"success",e.publish("request.success",u,t,r),e.publish("request.complete",u,t,r),l(t,r)}),u.error=n(function(t,r){r=r||"error",e.publish("request.error",u,t,r),e.publish("request.complete",u,t,r),p(t,r)}),!c){if(!u.resourceId)throw"amplify.request: no resourceId provided";throw"amplify.request: unknown resourceId: "+u.resourceId}return e.publish("request.before",u)?(e.request.resources[u.resourceId](u,i),i):void u.error(null,"abort")},e.request.types={},e.request.resources={},e.request.define=function(t,r,s){if("string"==typeof r){if(!(r in e.request.types))throw"amplify.request.define: unknown type: "+r;s.resourceId=t,e.request.resources[t]=e.request.types[r](s)}else e.request.resources[t]=r}}(amplify),function(e,t,r){"use strict";var s=["status","statusText","responseText","responseXML","readyState"],n=/\{([^\}]+)\}/g;e.request.types.ajax=function(n){return n=t.extend({type:"GET"},n),function(a,o){var u,i,c=n.url,l=o.abort,p=t.extend(!0,{},n,{data:a.data}),f=!1,d={readyState:0,setRequestHeader:function(e,t){return u.setRequestHeader(e,t)},getAllResponseHeaders:function(){return u.getAllResponseHeaders()},getResponseHeader:function(e){return u.getResponseHeader(e)},overrideMimeType:function(e){return u.overrideMimeType(e)},abort:function(){f=!0;try{u.abort()}catch(e){}i(null,"abort")},success:function(e,t){a.success(e,t)},error:function(e,t){a.error(e,t)}};i=function(e,n){t.each(s,function(e,t){try{d[t]=u[t]}catch(e){}}),/OK$/.test(d.statusText)&&(d.statusText="success"),e===r&&(e=null),f&&(n="abort"),/timeout|error|abort/.test(n)?d.error(e,n):d.success(e,n),i=t.noop},e.publish("request.ajax.preprocess",n,a,p,d),t.extend(p,{isJSONP:function(){return/jsonp/gi.test(this.dataType)},cacheURL:function(){if(!this.isJSONP())return this.url;var e="callback";this.hasOwnProperty("jsonp")&&(this.jsonp!==!1?e=this.jsonp:this.hasOwnProperty("jsonpCallback")&&(e=this.jsonpCallback));var t=new RegExp("&?"+e+"=[^&]*&?","gi");return this.url.replace(t,"")},success:function(e,t){i(e,t)},error:function(e,t){i(null,t)},beforeSend:function(t,r){u=t,p=r;var s=!n.beforeSend||n.beforeSend.call(this,d,p);return s&&e.publish("request.before.ajax",n,a,p,d)}}),p.cache&&p.isJSONP()&&t.extend(p,{cache:!0}),t.ajax(p),o.abort=function(){d.abort(),l.call(this)}}},e.subscribe("request.ajax.preprocess",function(e,r,s){var a=[],o=s.data;"string"!=typeof o&&(o=t.extend(!0,{},e.data,o),s.url=s.url.replace(n,function(e,t){if(t in o)return a.push(t),o[t]}),t.each(a,function(e,t){delete o[t]}),s.data=o)}),e.subscribe("request.ajax.preprocess",function(e,r,s){var n=s.data,a=e.dataMap;a&&"string"!=typeof n&&(t.isFunction(a)?s.data=a(n):(t.each(e.dataMap,function(e,t){e in n&&(n[t]=n[e],delete n[e])}),s.data=n))});var a=e.request.cache={_key:function(e,t,r){function s(){return r.charCodeAt(a++)<<24|r.charCodeAt(a++)<<16|r.charCodeAt(a++)<<8|r.charCodeAt(a++)<<0}r=t+r;for(var n=r.length,a=0,o=s();a<n;)o^=s();return"request-"+e+"-"+o},_default:function(){var e={};return function(t,r,s,n){var o=a._key(r.resourceId,s.cacheURL(),s.data),u=t.cache;if(o in e)return n.success(e[o]),!1;var i=n.success;n.success=function(t){e[o]=t,"number"==typeof u&&setTimeout(function(){delete e[o]},u),i.apply(this,arguments)}}}()};e.store&&(t.each(e.store.types,function(t){a[t]=function(r,s,n,o){var u=a._key(s.resourceId,n.cacheURL(),n.data),i=e.store[t](u);if(i)return n.success(i),!1;var c=o.success;o.success=function(s){e.store[t](u,s,{expires:r.cache.expires}),c.apply(this,arguments)}}}),a.persist=a[e.store.type]),e.subscribe("request.before.ajax",function(e){var t=e.cache;if(t)return t=t.type||t,a[t in a?t:"_default"].apply(this,arguments)}),e.request.decoders={jsend:function(e,t,r,s,n){"success"===e.status?s(e.data):"fail"===e.status?n(e.data,"fail"):"error"===e.status?(delete e.status,n(e,"error")):n(null,"error")}},e.subscribe("request.before.ajax",function(r,s,n,a){function o(e,t){i(e,t)}function u(e,t){c(e,t)}var i=a.success,c=a.error,l=t.isFunction(r.decoder)?r.decoder:r.decoder in e.request.decoders?e.request.decoders[r.decoder]:e.request.decoders._default;l&&(a.success=function(e,t){l(e,t,a,o,u)},a.error=function(e,t){l(e,t,a,o,u)})})}(amplify,n)}).call(this)}).call(this),"undefined"==typeof Package&&(Package={}),Package.amplify={}}();
!function(){"undefined"==typeof Package&&(Package={}),Package["ddp-rate-limiter"]={}}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,o=Package.meteor.meteorEnv,a=Package.random.Random;(function(){var t="_localstorage_test_"+a.id(),o;try{window.localStorage&&(window.localStorage.setItem(t,t),o=window.localStorage.getItem(t),window.localStorage.removeItem(t))}catch(e){}t===o&&(e._localStorage={getItem:function(e){return window.localStorage.getItem(e)},setItem:function(e,t){window.localStorage.setItem(e,t)},removeItem:function(e){window.localStorage.removeItem(e)}}),e._localStorage||(e._debug("You are running a browser with no localStorage or userData support. Logging in from one tab will not cause another tab to be logged in."),e._localStorage={_data:{},setItem:function(e,t){this._data[e]=t},removeItem:function(e){delete this._data[e]},getItem:function(e){var t=this._data[e];return void 0===t?null:t}})}).call(this),"undefined"==typeof Package&&(Package={}),Package.localstorage={}}();
!function(){var n=Package.meteor.Meteor,e=Package.meteor.global,t=Package.meteor.meteorEnv,a=Package.underscore._,r;(function(){r=function(n){var e=this;if(n=n||{},e.nextCallbackId=0,e.callbacks={},e.bindEnvironment=!0,n.bindEnvironment===!1&&(e.bindEnvironment=!1),n.exceptionHandler)e.exceptionHandler=n.exceptionHandler;else if(n.debugPrintExceptions){if(!a.isString(n.debugPrintExceptions))throw new Error("Hook option debugPrintExceptions should be a string");e.exceptionHandler=n.debugPrintExceptions}},a.extend(r.prototype,{register:function(t){var a=this,r=a.exceptionHandler||function(n){throw n};t=a.bindEnvironment?n.bindEnvironment(t,r):e(t,r);var i=a.nextCallbackId++;return a.callbacks[i]=t,{stop:function(){delete a.callbacks[i]}}},each:function(e){var t=this;n._nodeCodeMustBeInFiber();for(var r=a.keys(t.callbacks),i=0;i<r.length;++i){var o=r[i];if(a.has(t.callbacks,o)){var c=t.callbacks[o];if(!e(c))break}}}});var e=function(e,t,r){if(!t||"string"==typeof t){var i=t||"callback of async function";t=function(e){n._debug("Exception in "+i+":",e&&e.stack||e)}}return function(){var n=a.toArray(arguments),i=function(){try{var a=e.apply(r,n)}catch(n){t(n)}return a};return i()}}}).call(this),"undefined"==typeof Package&&(Package={}),function(n,e){for(var t in e)t in n||(n[t]=e[t])}(Package["callback-hook"]={},{Hook:r})}();
!function(){var n=Package.meteor.Meteor,e=Package.meteor.global,o=Package.meteor.meteorEnv,t=Package.underscore._,i=Package.tracker.Tracker,r=Package.tracker.Deps,c=Package.random.Random,a=Package["callback-hook"].Hook,s=Package["ddp-client"].DDP,u=Package.mongo.Mongo,l=Package.modules.meteorInstall,g=Package.modules.Buffer,_=Package.modules.process,p=Package["ecmascript-runtime"].Symbol,f=Package["ecmascript-runtime"].Map,h=Package["ecmascript-runtime"].Set,d=Package["babel-runtime"].meteorBabelHelpers,m=Package.promise.Promise,k,L,E,I=l({node_modules:{meteor:{"accounts-base":{"client_main.js":["./accounts_client.js","./url_client.js","./localstorage_token.js",function(e,o,t){t.export({AccountsClient:function(){return i},AccountsTest:function(){return r}});var i;t.import("./accounts_client.js",{AccountsClient:function(n){i=n}});var r;t.import("./url_client.js",{AccountsTest:function(n){r=n}}),t.import("./localstorage_token.js"),k=new i,n.users=k.users}],"accounts_client.js":["babel-runtime/helpers/classCallCheck","babel-runtime/helpers/possibleConstructorReturn","babel-runtime/helpers/inherits","./accounts_common.js",function(e,o,r){r.export({AccountsClient:function(){return l}});var c;r.import("babel-runtime/helpers/classCallCheck",{default:function(n){c=n}});var a;r.import("babel-runtime/helpers/possibleConstructorReturn",{default:function(n){a=n}});var s;r.import("babel-runtime/helpers/inherits",{default:function(n){s=n}});var u;r.import("./accounts_common.js",{AccountsCommon:function(n){u=n}});var l=function(n){function e(o){c(this,e);var t=a(this,n.call(this,o));return t._loggingIn=!1,t._loggingInDeps=new i.Dependency,t._loginServicesHandle=t.connection.subscribe("meteor.loginServiceConfiguration"),t._pageLoadLoginCallbacks=[],t._pageLoadLoginAttemptInfo=null,t._initUrlMatching(),t._initLocalStorage(),t}return s(e,n),e.prototype.userId=function(){function n(){return this.connection.userId()}return n}(),e.prototype._setLoggingIn=function(){function n(n){this._loggingIn!==n&&(this._loggingIn=n,this._loggingInDeps.changed())}return n}(),e.prototype.loggingIn=function(){function n(){return this._loggingInDeps.depend(),this._loggingIn}return n}(),e.prototype.logout=function(){function n(n){var e=this;e.connection.apply("logout",[],{wait:!0},function(o,t){o?n&&n(o):(e.makeClientLoggedOut(),n&&n())})}return n}(),e.prototype.logoutOtherClients=function(){function n(n){var e=this;e.connection.apply("getNewToken",[],{wait:!0},function(n,o){n||e._storeLoginToken(e.userId(),o.token,o.tokenExpires)}),e.connection.apply("removeOtherTokens",[],{wait:!0},function(e){n&&n(e)})}return n}(),e}(u),g=l.prototype;n.loggingIn=function(){return k.loggingIn()},g.callLoginMethod=function(n){var e=this;n=t.extend({methodName:"login",methodArguments:[{}],_suppressLoggingIn:!1},n),t.each(["validateResult","userCallback"],function(e){n[e]||(n[e]=function(){})});var o=t.once(function(o){o?e._onLoginFailureHook.each(function(n){return n({error:o}),!0}):e._onLoginHook.each(function(n){return n(),!0}),n.userCallback.apply(this,arguments)}),i=!1,r=function n(t,r){!t&&r&&r.token&&(e.connection.onReconnect=function(){i=!0;var n=e._storedLoginToken();n&&(r={token:n,tokenExpires:e._storedLoginTokenExpires()}),r.tokenExpires||(r.tokenExpires=e._tokenExpiration(new Date)),e._tokenExpiresSoon(r.tokenExpires)?e.makeClientLoggedOut():e.callLoginMethod({methodArguments:[{resume:r.token}],_suppressLoggingIn:!0,userCallback:function(){function n(n){var t=e._storedLoginToken();n&&t&&t===r.token&&e.makeClientLoggedOut(),o(n)}return n}()})})},c=function t(r,c){if(!i){if(e._setLoggingIn(!1),r||!c)return r=r||new Error("No result from call to "+n.methodName),void o(r);try{n.validateResult(c)}catch(n){return void o(n)}e.makeClientLoggedIn(c.id,c.token,c.tokenExpires),o()}};n._suppressLoggingIn||e._setLoggingIn(!0),e.connection.apply(n.methodName,n.methodArguments,{wait:!0,onResultReceived:r},c)},g.makeClientLoggedOut=function(){this.connection._userId&&this._onLogoutHook.each(function(n){return n(),!0}),this._unstoreLoginToken(),this.connection.setUserId(null),this.connection.onReconnect=null},g.makeClientLoggedIn=function(n,e,o){this._storeLoginToken(n,e,o),this.connection.setUserId(n)},n.logout=function(n){return k.logout(n)},n.logoutOtherClients=function(n){return k.logoutOtherClients(n)},g.loginServicesConfigured=function(){return this._loginServicesHandle.ready()},g.onPageLoadLogin=function(n){this._pageLoadLoginAttemptInfo?n(this._pageLoadLoginAttemptInfo):this._pageLoadLoginCallbacks.push(n)},g._pageLoadLogin=function(e){return this._pageLoadLoginAttemptInfo?void n._debug("Ignoring unexpected duplicate page load login attempt info"):(t.each(this._pageLoadLoginCallbacks,function(n){n(e)}),this._pageLoadLoginCallbacks=[],void(this._pageLoadLoginAttemptInfo=e))},Package.blaze&&(Package.blaze.Blaze.Template.registerHelper("currentUser",function(){return n.user()}),Package.blaze.Blaze.Template.registerHelper("loggingIn",function(){return n.loggingIn()}))}],"accounts_common.js":["babel-runtime/helpers/classCallCheck",function(e,o,i){i.export({AccountsCommon:function(){return c}});var r;i.import("babel-runtime/helpers/classCallCheck",{default:function(n){r=n}});var c=function(){function e(n){r(this,e),this._options={},this.connection=void 0,this._initConnection(n||{}),this.users=new u.Collection("users",{_preventAutopublish:!0,connection:this.connection}),this._onLoginHook=new a({bindEnvironment:!1,debugPrintExceptions:"onLogin callback"}),this._onLoginFailureHook=new a({bindEnvironment:!1,debugPrintExceptions:"onLoginFailure callback"}),this._onLogoutHook=new a({bindEnvironment:!1,debugPrintExceptions:"onLogout callback"})}return e.prototype.userId=function(){function n(){throw new Error("userId method not implemented")}return n}(),e.prototype.user=function(){function n(){var n=this.userId();return n?this.users.findOne(n):null}return n}(),e.prototype.config=function(){function e(e){var o=this;if(n.isServer?__meteor_runtime_config__.accountsConfigCalled=!0:__meteor_runtime_config__.accountsConfigCalled||n._debug("Accounts.config was called on the client but not on the server; some configuration options may not take effect."),t.has(e,"oauthSecretKey")){if(n.isClient)throw new Error("The oauthSecretKey option may only be specified on the server");if(!Package["oauth-encryption"])throw new Error("The oauth-encryption package must be loaded to set oauthSecretKey");Package["oauth-encryption"].OAuthEncryption.loadKey(e.oauthSecretKey),e=t.omit(e,"oauthSecretKey")}var i=["sendVerificationEmail","forbidClientAccountCreation","passwordEnrollTokenExpirationInDays","restrictCreationByEmailDomain","loginExpirationInDays","passwordResetTokenExpirationInDays"];t.each(t.keys(e),function(n){if(!t.contains(i,n))throw new Error("Accounts.config: Invalid key: "+n)}),t.each(i,function(n){if(n in e){if(n in o._options)throw new Error("Can't set `"+n+"` more than once");o._options[n]=e[n]}})}return e}(),e.prototype.onLogin=function(){function n(n){return this._onLoginHook.register(n)}return n}(),e.prototype.onLoginFailure=function(){function n(n){return this._onLoginFailureHook.register(n)}return n}(),e.prototype.onLogout=function(){function n(n){return this._onLogoutHook.register(n)}return n}(),e.prototype._initConnection=function(){function e(e){n.isClient&&(e.connection?this.connection=e.connection:e.ddpUrl?this.connection=s.connect(e.ddpUrl):"undefined"!=typeof __meteor_runtime_config__&&__meteor_runtime_config__.ACCOUNTS_CONNECTION_URL?this.connection=s.connect(__meteor_runtime_config__.ACCOUNTS_CONNECTION_URL):this.connection=n.connection)}return e}(),e.prototype._getTokenLifetimeMs=function(){function n(){return 24*(this._options.loginExpirationInDays||g)*60*60*1e3}return n}(),e.prototype._getPasswordResetTokenLifetimeMs=function(){function n(){return 24*(this._options.passwordResetTokenExpirationInDays||_)*60*60*1e3}return n}(),e.prototype._getPasswordEnrollTokenLifetimeMs=function(){function n(){return 24*(this._options.passwordEnrollTokenExpirationInDays||p)*60*60*1e3}return n}(),e.prototype._tokenExpiration=function(){function n(n){return new Date(new Date(n).getTime()+this._getTokenLifetimeMs())}return n}(),e.prototype._tokenExpiresSoon=function(){function n(n){var e=.1*this._getTokenLifetimeMs(),o=1e3*f;return e>o&&(e=o),new Date>new Date(n)-e}return n}(),e}(),l=c.prototype;n.userId=function(){return k.userId()},n.user=function(){return k.user()};var g=90,_=3,p=30,f=3600;L=6e5,E=1e4,n.startup(function(){var n=Package["service-configuration"].ServiceConfiguration;l.loginServiceConfiguration=n.configurations,l.ConfigError=n.ConfigError});var h="Accounts.LoginCancelledError";l.LoginCancelledError=n.makeErrorType(h,function(n){this.message=n}),l.LoginCancelledError.prototype.name=h,l.LoginCancelledError.numericError=145546287}],"localstorage_token.js":["./accounts_client.js",function(e,o,t){var i;t.import("./accounts_client.js",{AccountsClient:function(n){i=n}});var r=i.prototype;n.loginWithToken=function(n,e){return k.loginWithToken(n,e)},r.loginWithToken=function(n,e){this.callLoginMethod({methodArguments:[{resume:n}],userCallback:e})},r._enableAutoLogin=function(){this._autoLoginEnabled=!0,this._pollStoredLoginToken()},r._isolateLoginTokenForTest=function(){this.LOGIN_TOKEN_KEY=this.LOGIN_TOKEN_KEY+c.id(),this.USER_ID_KEY=this.USER_ID_KEY+c.id()},r._storeLoginToken=function(e,o,t){n._localStorage.setItem(this.USER_ID_KEY,e),n._localStorage.setItem(this.LOGIN_TOKEN_KEY,o),t||(t=this._tokenExpiration(new Date)),n._localStorage.setItem(this.LOGIN_TOKEN_EXPIRES_KEY,t),this._lastLoginTokenWhenPolled=o},r._unstoreLoginToken=function(){n._localStorage.removeItem(this.USER_ID_KEY),n._localStorage.removeItem(this.LOGIN_TOKEN_KEY),n._localStorage.removeItem(this.LOGIN_TOKEN_EXPIRES_KEY),this._lastLoginTokenWhenPolled=null},r._storedLoginToken=function(){return n._localStorage.getItem(this.LOGIN_TOKEN_KEY)},r._storedLoginTokenExpires=function(){return n._localStorage.getItem(this.LOGIN_TOKEN_EXPIRES_KEY)},r._storedUserId=function(){return n._localStorage.getItem(this.USER_ID_KEY)},r._unstoreLoginTokenIfExpiresSoon=function(){var n=this._storedLoginTokenExpires();n&&this._tokenExpiresSoon(new Date(n))&&this._unstoreLoginToken()},r._initLocalStorage=function(){var e=this;e.LOGIN_TOKEN_KEY="Meteor.loginToken",e.LOGIN_TOKEN_EXPIRES_KEY="Meteor.loginTokenExpires",e.USER_ID_KEY="Meteor.userId";var o=__meteor_runtime_config__.ROOT_URL_PATH_PREFIX;if(o||this.connection!==n.connection){var t=":"+this.connection._stream.rawUrl;o&&(t+=":"+o),e.LOGIN_TOKEN_KEY+=t,e.LOGIN_TOKEN_EXPIRES_KEY+=t,e.USER_ID_KEY+=t}if(e._autoLoginEnabled){e._unstoreLoginTokenIfExpiresSoon();var i=e._storedLoginToken();if(i){var r=e._storedUserId();r&&e.connection.setUserId(r),e.loginWithToken(i,function(o){o&&(n._debug("Error logging in with token: "+o),e.makeClientLoggedOut()),e._pageLoadLogin({type:"resume",allowed:!o,error:o,methodName:"login",methodArguments:[{resume:i}]})})}}e._lastLoginTokenWhenPolled=i,e._pollIntervalTimer&&clearInterval(e._pollIntervalTimer),e._pollIntervalTimer=setInterval(function(){e._pollStoredLoginToken()},3e3)},r._pollStoredLoginToken=function(){var n=this;if(n._autoLoginEnabled){var e=n._storedLoginToken();n._lastLoginTokenWhenPolled!=e&&(e?n.loginWithToken(e,function(e){e&&n.makeClientLoggedOut()}):n.logout()),n._lastLoginTokenWhenPolled=e}}}],"url_client.js":["./accounts_client.js",function(e,o,i){function r(n,e,o){t.each(u,function(t){var i,r=new RegExp("^\\#\\/"+t+"\\/(.*)$"),c=e.match(r);c&&(i=c[1],"reset-password"===t?n._resetPasswordToken=i:"verify-email"===t?n._verifyEmailToken=i:"enroll-account"===t&&(n._enrollAccountToken=i),window.location.hash="",o.call(n,i,t))})}function c(e,o){var t=this;t._autoLoginEnabled=!1,n.startup(function(){t._accountsCallbacks[o]&&t._accountsCallbacks[o](e,function(){t._enableAutoLogin()})})}i.export({AccountsTest:function(){return g}});var a;i.import("./accounts_client.js",{AccountsClient:function(n){a=n}});var s=a.prototype,u=["reset-password","verify-email","enroll-account"],l=window.location.hash;s._initUrlMatching=function(){this._autoLoginEnabled=!0,this._accountsCallbacks={},this._attemptToMatchHash()},s._attemptToMatchHash=function(){r(this,l,c)};var g={attemptToMatchHash:function(){function n(n,e){return r(k,n,e)}return n}()};s.onResetPasswordLink=function(e){this._accountsCallbacks["reset-password"]&&n._debug("Accounts.onResetPasswordLink was called more than once. Only one callback added will be executed."),this._accountsCallbacks["reset-password"]=e},s.onEmailVerificationLink=function(e){this._accountsCallbacks["verify-email"]&&n._debug("Accounts.onEmailVerificationLink was called more than once. Only one callback added will be executed."),this._accountsCallbacks["verify-email"]=e},s.onEnrollmentLink=function(e){this._accountsCallbacks["enroll-account"]&&n._debug("Accounts.onEnrollmentLink was called more than once. Only one callback added will be executed."),this._accountsCallbacks["enroll-account"]=e}}]}}}},{extensions:[".js",".json"]}),b=I("./node_modules/meteor/accounts-base/client_main.js");"undefined"==typeof Package&&(Package={}),function(n,e){for(var o in e)o in n||(n[o]=e[o])}(Package["accounts-base"]=b,{Accounts:k})}();
!function(){var t=Package.meteor.Meteor,e=Package.meteor.global,i=Package.meteor.meteorEnv,s=Package.jquery.$,a=Package.jquery.jQuery,o=Package.tracker.Tracker,n=Package.tracker.Deps,r=Package["reactive-dict"].ReactiveDict,c=Package.session.Session,p=Package.underscore._,u=Package.ejson.EJSON,d;(function(){var e=function(t){return void 0===t?"undefined":u.stringify(t)},i=function(t){if(void 0!==t&&"undefined"!==t)return u.parse(t)},s=function(t){t&&t.changed()};d=function(e){function i(){if(!(amplify.store("__PSDATAVERSION__"+c._dictName)>=1)){var t=amplify.store("__PSKEYS__"+c._dictName),e=amplify.store("__PSAKEYS__"+c._dictName);p.each([t,e],function(t){p.each(t,function(t){amplify.store(t,u.stringify(amplify.store(t)))})}),amplify.store("__PSDATAVERSION__"+c._dictName,2)}}function s(){if(!(amplify.store("__PSDATAVERSION__"+c._dictName)>=n)){var t=amplify.store("__PSKEYS__"+c._dictName),e=amplify.store("__PSAKEYS__"+c._dictName);p.each([t,e],function(t){p.each(t,function(t){var e=!1;try{u.parse(amplify.store(c._dictName+t))}catch(t){e=!0}if(!e){var i=u.parse(amplify.store(c._dictName+t)),s=u.toJSONValue(i);amplify.store(c._dictName+t,s)}})}),amplify.store("__PSDATAVERSION__"+c._dictName,4)}}if(!p.isString(e))throw new Error("dictName must be a string");this._dictName=e,"session"==e?(this._dictName="",this._dict=a):this._dict=new r(e);var n=4;this.psKeys={},this.psKeyList=[],this.psaKeys={},this.psaKeyList=[],this.default_method="temporary",t.settings&&t.settings.public&&t.settings.public.persistent_session&&(this.default_method=t.settings.public.persistent_session.default_method);var c=this;return t.isClient&&t.startup(function(){var t;i(),s();var e=amplify.store("__PSKEYS__"+c._dictName);if("object"==typeof e&&void 0!==e.length)for(var a=0;a<e.length;a++)p.has(c._dict.keys,e[a])||(t=c.get(e[a]),c.set(e[a],t,!0,!1));var o=amplify.store("__PSAKEYS__"+c._dictName);if("object"==typeof o&&void 0!==o.length)for(var a=0;a<o.length;a++)p.has(c._dict.keys,o[a])||(t=c.get(o[a]),c.setAuth(o[a],t,!0,!0))}),o.autorun(function(){if(t.userId){var e=t.userId();e||c.clearAuth()}}),this},d.prototype.store=function t(e,i,s){return this.psKeyList=amplify.store("__PSKEYS__"+this._dictName)||[],this.psaKeyList=amplify.store("__PSAKEYS__"+this._dictName)||[],"get"==e?amplify.store(this._dictName+i):(this.psKeyList=p.without(this.psKeyList,i),this.psaKeyList=p.without(this.psaKeyList,i),delete this.psKeys[i],delete this.psaKeys[i],void 0===s||null===s||"temporary"==e?s=null:"persistent"==e?(this.psKeys[i]=u.toJSONValue(s),this.psKeyList=p.union(this.psKeyList,[i])):"authenticated"==e&&(this.psaKeys[i]=u.toJSONValue(s),this.psaKeyList=p.union(this.psaKeyList,[i])),amplify.store("__PSKEYS__",this.psKeyList),amplify.store("__PSAKEYS__",this.psaKeyList),amplify.store(this._dictName+i,u.toJSONValue(s)),void 0)},d.prototype.old_get=function(){return this._dict.get.apply(this._dict,arguments)},d.prototype.get=function t(e){var i=this.old_get(e),s,a=this.store("get",e);return void 0!==a&&(s=u.fromJSONValue(this.store("get",e))),void 0===s||null===s?i:s},d.prototype.old_set=function(){return this._dict.set.apply(this._dict,arguments)},d.prototype.set=function t(e,i,s,a){if("object"==typeof e&&void 0===i)return void this._setObject(e,s,a);var o=e,n="temporary";(s||void 0===s&&("persistent"==this.default_method||"authenticated"==this.default_method))&&(n=a||void 0===s&&void 0===a&&"authenticated"==this.default_method?"authenticated":"persistent"),this.store(n,o,i),this.old_set(o,i)},d.prototype.all=function t(){this._dict.allDeps&&this._dict.allDeps.depend();var e={};return p.each(this._dict.keys,function(t,s){e[s]=i(t)}),e},d.prototype._setObject=function t(e,i,s){var a=this;p.each(e,function(t,e){a.set(e,t,i,s)})},d.prototype._ensureKey=function t(e){var i=this._dict;e in i.keyDeps||(i.keyDeps[e]=new o.Dependency,i.keyValueDeps[e]={})},d.prototype.equals=function t(i,s){var a=null;if(Package.mongo&&(a=Package.mongo.Mongo.ObjectID),!("string"==typeof s||"number"==typeof s||"boolean"==typeof s||"undefined"==typeof s||s instanceof Date||a&&s instanceof a||null===s))throw new Error("ReactiveDict.equals: value must be scalar");var n=e(s);if(o.active){this._ensureKey(i),p.has(this._dict.keyValueDeps[i],n)||(this._dict.keyValueDeps[i][n]=new o.Dependency);var r=this._dict.keyValueDeps[i][n].depend();if(r){var c=this;o.onInvalidate(function(){c._dict.keyValueDeps[i][n].hasDependents()||delete c._dict.keyValueDeps[i][n]})}}var d=this.get(i);return u.equals(d,s)},d.prototype.setTemporary=function t(e,i){this.set(e,i,!1,!1)},d.prototype.setTemp=function t(e,i){this.set(e,i,!1,!1)},d.prototype.setPersistent=function t(e,i){this.set(e,i,!0,!1)},d.prototype.setAuth=function t(e,i){this.set(e,i,!0,!0)},d.prototype.makeTemp=function t(e){this.store("temporary",e)},d.prototype.makePersistent=function t(e){var i=this.get(e);this.store("persistent",e,i)},d.prototype.makeAuth=function t(e){var i=this.get(e);this.store("authenticated",e,i)},d.prototype.old_clear=function(){return this._dict.clear.apply(this._dict,arguments)},d.prototype.clear=function t(e,i){var a=this,o=a._dict.keys;if(void 0===e&&void 0===i?i=o:void 0!==e&&(i=[e]),p.isArray(i)){var n=i,i={};p.each(n,function(t){i[t]=o[t]})}p.each(i,function(t,e){a.set(e,void 0,!1,!1),s(a._dict.keyDeps[e]),a._dict.keyValueDeps[e]&&(s(a._dict.keyValueDeps[e][t]),s(a._dict.keyValueDeps[e].undefined)),delete a._dict.keys[e]}),a._dict.allDeps&&a._dict.allDeps.changed()},d.prototype.clearTemp=function t(){this.clear(void 0,p.keys(p.omit(this._dict.keys,this.psKeys,this.psaKeys)))},d.prototype.clearPersistent=function t(){this.clear(void 0,this.psKeys)},d.prototype.clearAuth=function t(){this.clear(void 0,this.psaKeys)},d.prototype.update=function t(e,i){var s,a;p.indexOf(this.psaKeyList,e)>=0&&(a=!0),(a||p.indexOf(this.psKeyList,e)>=0)&&(s=!0),this.set(e,i,s,a)},d.prototype.old_setDefault=function(){return this._dict.setDefault.apply(this._dict,arguments)},d.prototype.setDefault=function t(e,i,s,a){var o=this;return p.isObject(e)?void p.each(e,function(t,e){o.setDefault(e,t,s,a)}):void(void 0===this.get(e)&&this.set(e,i,s,a))},d.prototype.setDefaultTemp=function t(e,i){p.isObject(e)&&(i=void 0),this.setDefault(e,i,!1,!1)},d.prototype.setDefaultPersistent=function t(e,i){p.isObject(e)&&(i=void 0),this.setDefault(e,i,!0,!1)},d.prototype.setDefaultAuth=function t(e,i){p.isObject(e)&&(i=void 0),this.setDefault(e,i,!0,!0)};var a=p.clone(c);p.extend(c,new d("session"))}).call(this),"undefined"==typeof Package&&(Package={}),function(t,e){for(var i in e)i in t||(t[i]=e[i])}(Package["u2622:persistent-session"]={},{PersistentSession:d})}();
!function(){"undefined"==typeof Package&&(Package={}),Package.coffeescript={}}();
!function(){var Meteor=Package.meteor.Meteor,global=Package.meteor.global,meteorEnv=Package.meteor.meteorEnv,Symbol=Package["ecmascript-runtime"].Symbol,Map=Package["ecmascript-runtime"].Map,Set=Package["ecmascript-runtime"].Set,meteorBabelHelpers=Package["babel-runtime"].meteorBabelHelpers,Promise=Package.promise.Promise,html,chai,__coffeescriptShare,assert,expect,should;(function(){(function(){!function(){function require(e){var t=require.modules[e];if(!t)throw new Error('failed to require "'+e+'"');return"exports"in t||"function"!=typeof t.definition||(t.client=t.component=!0,t.definition.call(this,t.exports={},t),delete t.definition),t.exports}require.loader="component",require.helper={},require.helper.semVerSort=function(e,t){for(var i=e.version.split("."),n=t.version.split("."),r=0;r<i.length;++r){var o=parseInt(i[r],10),s=parseInt(n[r],10);if(o!==s)return o>s?1:-1;var a=i[r].substr((""+o).length),c=n[r].substr((""+s).length);if(""===a&&""!==c)return 1;if(""!==a&&""===c)return-1;if(""!==a&&""!==c)return a>c?1:-1}return 0},require.latest=function(e,t){function i(e){throw new Error('failed to find latest module of "'+e+'"')}var n=/(.*)~(.*)@v?(\d+\.\d+\.\d+[^\/]*)$/,r=/(.*)~(.*)/;r.test(e)||i(e);for(var o=Object.keys(require.modules),s=[],a=[],c=0;c<o.length;c++){var h=o[c];if(new RegExp(e+"@").test(h)){var u=h.substr(e.length+1),l=n.exec(h);null!=l?s.push({version:u,name:h}):a.push({version:u,name:h})}}if(0===s.concat(a).length&&i(e),s.length>0){var f=s.sort(require.helper.semVerSort).pop().name;return t===!0?f:require(f)}var f=a.sort(function(e,t){return e.name>t.name})[0].name;return t===!0?f:require(f)},require.modules={},require.register=function(e,t){require.modules[e]={definition:t}},require.define=function(e,t){require.modules[e]={exports:t}},require.register("chaijs~assertion-error@1.0.0",function(e,t){function i(){function e(e,i){Object.keys(i).forEach(function(n){~t.indexOf(n)||(e[n]=i[n])})}var t=[].slice.call(arguments);return function t(){for(var i=[].slice.call(arguments),n=0,r={};n<i.length;n++)e(r,i[n]);return r}}function n(e,t,n){var r=i("name","message","stack","constructor","toJSON"),o=r(t||{});this.message=e||"Unspecified AssertionError",this.showDiff=!1;for(var s in o)this[s]=o[s];n=n||arguments.callee,n&&Error.captureStackTrace&&Error.captureStackTrace(this,n)}t.exports=n,n.prototype=Object.create(Error.prototype),n.prototype.name="AssertionError",n.prototype.constructor=n,n.prototype.toJSON=function(e){var t=i("constructor","toJSON","stack"),n=t({name:this.name},this);return!1!==e&&this.stack&&(n.stack=this.stack),n}}),require.register("chaijs~type-detect@0.1.1",function(e,t){function i(e){var t=Object.prototype.toString.call(e);return r[t]?r[t]:null===e?"null":void 0===e?"undefined":e===Object(e)?"object":typeof e}function n(){this.tests={}}var e=t.exports=i,r={"[object Array]":"array","[object RegExp]":"regexp","[object Function]":"function","[object Arguments]":"arguments","[object Date]":"date"};e.Library=n,n.prototype.of=i,n.prototype.define=function(e,t){return 1===arguments.length?this.tests[e]:(this.tests[e]=t,this)},n.prototype.test=function(e,t){if(t===i(e))return!0;var n=this.tests[t];if(n&&"regexp"===i(n))return n.test(e);if(n&&"function"===i(n))return n(e);throw new ReferenceError('Type test "'+t+'" not defined or invalid.')}}),require.register("chaijs~deep-eql@0.1.3",function(e,t){function i(e,t,i){return!!n(e,t)||("date"===p(e)?o(e,t):"regexp"===p(e)?s(e,t):d.isBuffer(e)?u(e,t):"arguments"===p(e)?a(e,t,i):!!r(e,t)&&("object"!==p(e)&&"object"!==p(t)&&"array"!==p(e)&&"array"!==p(t)?n(e,t):f(e,t,i)))}function n(e,t){return e===t?0!==e||1/e===1/t:e!==e&&t!==t}function r(e,t){return p(e)===p(t)}function o(e,t){return"date"===p(t)&&n(e.getTime(),t.getTime())}function s(e,t){return"regexp"===p(t)&&n(e.toString(),t.toString())}function a(e,t,n){return"arguments"===p(t)&&(e=[].slice.call(e),t=[].slice.call(t),i(e,t,n))}function c(e){var t=[];for(var i in e)t.push(i);return t}function h(e,t){if(e.length!==t.length)return!1;for(var i=0,n=!0;i<e.length;i++)if(e[i]!==t[i]){n=!1;break}return n}function u(e,t){return!!d.isBuffer(t)&&h(e,t)}function l(e){return null!==e&&void 0!==e}function f(e,t,n){if(!l(e)||!l(t))return!1;if(e.prototype!==t.prototype)return!1;var r;if(n){for(r=0;r<n.length;r++)if(n[r][0]===e&&n[r][1]===t||n[r][0]===t&&n[r][1]===e)return!0}else n=[];try{var o=c(e),s=c(t)}catch(e){return!1}if(o.sort(),s.sort(),!h(o,s))return!1;n.push([e,t]);var a;for(r=o.length-1;r>=0;r--)if(a=o[r],!i(e[a],t[a],n))return!1;return!0}var p=require("chaijs~type-detect@0.1.1"),d;try{d=require("buffer").Buffer}catch(e){d={},d.isBuffer=function(){return!1}}t.exports=i}),require.register("chai",function(e,t){t.exports=require("chai/lib/chai.js")}),require.register("chai/lib/chai.js",function(e,t){var i=[],e=t.exports={};e.version="2.1.0",e.AssertionError=require("chaijs~assertion-error@1.0.0");var n=require("chai/lib/chai/utils/index.js");e.use=function(e){return~i.indexOf(e)||(e(this,n),i.push(e)),this},e.util=n;var r=require("chai/lib/chai/config.js");e.config=r;var o=require("chai/lib/chai/assertion.js");e.use(o);var s=require("chai/lib/chai/core/assertions.js");e.use(s);var a=require("chai/lib/chai/interface/expect.js");e.use(a);var c=require("chai/lib/chai/interface/should.js");e.use(c);var h=require("chai/lib/chai/interface/assert.js");e.use(h)}),require.register("chai/lib/chai/assertion.js",function(e,t){var i=require("chai/lib/chai/config.js");t.exports=function(e,t){function n(e,t,i){o(this,"ssfi",i||arguments.callee),o(this,"object",e),o(this,"message",t)}var r=e.AssertionError,o=t.flag;e.Assertion=n,Object.defineProperty(n,"includeStack",{get:function(){return console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),i.includeStack},set:function(e){console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),i.includeStack=e}}),Object.defineProperty(n,"showDiff",{get:function(){return console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),i.showDiff},set:function(e){console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),i.showDiff=e}}),n.addProperty=function(e,i){t.addProperty(this.prototype,e,i)},n.addMethod=function(e,i){t.addMethod(this.prototype,e,i)},n.addChainableMethod=function(e,i,n){t.addChainableMethod(this.prototype,e,i,n)},n.overwriteProperty=function(e,i){t.overwriteProperty(this.prototype,e,i)},n.overwriteMethod=function(e,i){t.overwriteMethod(this.prototype,e,i)},n.overwriteChainableMethod=function(e,i,n){t.overwriteChainableMethod(this.prototype,e,i,n)},n.prototype.assert=function(e,n,s,a,c,h){var u=t.test(this,arguments);if(!0!==h&&(h=!1),!0!==i.showDiff&&(h=!1),!u){var n=t.getMessage(this,arguments),l=t.getActual(this,arguments);throw new r(n,{actual:l,expected:a,showDiff:h},i.includeStack?this.assert:o(this,"ssfi"))}},Object.defineProperty(n.prototype,"_obj",{get:function(){return o(this,"object")},set:function(e){o(this,"object",e)}})}}),require.register("chai/lib/chai/config.js",function(e,t){t.exports={includeStack:!1,showDiff:!0,truncateThreshold:40}}),require.register("chai/lib/chai/core/assertions.js",function(e,t){t.exports=function(e,t){function i(e,i){i&&A(this,"message",i),e=e.toLowerCase();var n=A(this,"object"),r=~["a","e","i","o","u"].indexOf(e.charAt(0))?"an ":"a ";this.assert(e===t.type(n),"expected #{this} to be "+r+e,"expected #{this} not to be "+r+e)}function n(){A(this,"contains",!0)}function r(e,i){i&&A(this,"message",i);var n=A(this,"object"),r=!1;if("array"===t.type(n)&&"object"===t.type(e)){for(var o in n)if(t.eql(n[o],e)){r=!0;break}}else if("object"===t.type(e)){if(!A(this,"negate")){for(var s in e)new m(n).property(s,e[s]);return}var a={};for(var s in e)a[s]=n[s];r=t.eql(a,e)}else r=n&&~n.indexOf(e);this.assert(r,"expected #{this} to include "+t.inspect(e),"expected #{this} to not include "+t.inspect(e))}function o(){var e=A(this,"object"),t=Object.prototype.toString.call(e);this.assert("[object Arguments]"===t,"expected #{this} to be arguments but got "+t,"expected #{this} to not be arguments")}function s(e,t){t&&A(this,"message",t);var i=A(this,"object");return A(this,"deep")?this.eql(e):void this.assert(e===i,"expected #{this} to equal #{exp}","expected #{this} to not equal #{exp}",e,this._obj,!0)}function a(e,i){i&&A(this,"message",i),this.assert(t.eql(e,A(this,"object")),"expected #{this} to deeply equal #{exp}","expected #{this} to not deeply equal #{exp}",e,this._obj,!0)}function c(e,t){t&&A(this,"message",t);var i=A(this,"object");if(A(this,"doLength")){new m(i,t).to.have.property("length");var n=i.length;this.assert(n>e,"expected #{this} to have a length above #{exp} but got #{act}","expected #{this} to not have a length above #{exp}",e,n)}else this.assert(i>e,"expected #{this} to be above "+e,"expected #{this} to be at most "+e)}function h(e,t){t&&A(this,"message",t);var i=A(this,"object");if(A(this,"doLength")){new m(i,t).to.have.property("length");var n=i.length;this.assert(n>=e,"expected #{this} to have a length at least #{exp} but got #{act}","expected #{this} to have a length below #{exp}",e,n)}else this.assert(i>=e,"expected #{this} to be at least "+e,"expected #{this} to be below "+e)}function u(e,t){t&&A(this,"message",t);var i=A(this,"object");if(A(this,"doLength")){new m(i,t).to.have.property("length");var n=i.length;this.assert(n<e,"expected #{this} to have a length below #{exp} but got #{act}","expected #{this} to not have a length below #{exp}",e,n)}else this.assert(i<e,"expected #{this} to be below "+e,"expected #{this} to be at least "+e)}function l(e,t){t&&A(this,"message",t);var i=A(this,"object");if(A(this,"doLength")){new m(i,t).to.have.property("length");var n=i.length;this.assert(n<=e,"expected #{this} to have a length at most #{exp} but got #{act}","expected #{this} to have a length above #{exp}",e,n)}else this.assert(i<=e,"expected #{this} to be at most "+e,"expected #{this} to be above "+e)}function f(e,i){i&&A(this,"message",i);var n=t.getName(e);this.assert(A(this,"object")instanceof e,"expected #{this} to be an instance of "+n,"expected #{this} to not be an instance of "+n)}function p(e,i){i&&A(this,"message",i);var n=A(this,"object");this.assert(n.hasOwnProperty(e),"expected #{this} to have own property "+t.inspect(e),"expected #{this} to not have own property "+t.inspect(e))}function d(){A(this,"doLength",!0)}function b(e,t){t&&A(this,"message",t);var i=A(this,"object");new m(i,t).to.have.property("length");var n=i.length;this.assert(n==e,"expected #{this} to have a length of #{exp} but got #{act}","expected #{this} to not have a length of #{act}",e,n)}function g(e){var i=A(this,"object"),n,r=!0,o="keys must be given single argument of Array|Object|String, or multiple String arguments";switch(t.type(e)){case"array":if(arguments.length>1)throw new Error(o);break;case"object":if(arguments.length>1)throw new Error(o);e=Object.keys(e);break;default:e=Array.prototype.slice.call(arguments)}if(!e.length)throw new Error("keys required");var s=Object.keys(i),a=e,c=e.length,h=A(this,"any"),u=A(this,"all");if(h||u||(u=!0),h){var l=a.filter(function(e){return~s.indexOf(e)});r=l.length>0}if(u&&(r=e.every(function(e){return~s.indexOf(e)}),A(this,"negate")||A(this,"contains")||(r=r&&e.length==s.length)),c>1){e=e.map(function(e){return t.inspect(e)});var f=e.pop();u&&(n=e.join(", ")+", and "+f),h&&(n=e.join(", ")+", or "+f)}else n=t.inspect(e[0]);n=(c>1?"keys ":"key ")+n,n=(A(this,"contains")?"contain ":"have ")+n,this.assert(r,"expected #{this} to "+n,"expected #{this} to not "+n,a.slice(0).sort(),s.sort(),!0)}function v(e,i,n){n&&A(this,"message",n);var r=A(this,"object");new m(r,n).is.a("function");var o=!1,s=null,a=null,c=null;0===arguments.length?(i=null,e=null):e&&(e instanceof RegExp||"string"==typeof e)?(i=e,e=null):e&&e instanceof Error?(s=e,e=null,i=null):"function"==typeof e?(a=e.prototype.name||e.name,"Error"===a&&e!==Error&&(a=(new e).name)):e=null;try{r()}catch(n){if(s)return this.assert(n===s,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}",s instanceof Error?s.toString():s,n instanceof Error?n.toString():n),A(this,"object",n),this;if(e&&(this.assert(n instanceof e,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp} but #{act} was thrown",a,n instanceof Error?n.toString():n),!i))return A(this,"object",n),this;var h="object"===t.type(n)&&"message"in n?n.message:""+n;if(null!=h&&i&&i instanceof RegExp)return this.assert(i.exec(h),"expected #{this} to throw error matching #{exp} but got #{act}","expected #{this} to throw error not matching #{exp}",i,h),A(this,"object",n),this;if(null!=h&&i&&"string"==typeof i)return this.assert(~h.indexOf(i),"expected #{this} to throw error including #{exp} but got #{act}","expected #{this} to throw error not including #{act}",i,h),A(this,"object",n),this;o=!0,c=n}var u="",l=null!==a?a:s?"#{exp}":"an error";o&&(u=" but #{act} was thrown"),this.assert(o===!0,"expected #{this} to throw "+l+u,"expected #{this} to not throw "+l+u,s instanceof Error?s.toString():s,c instanceof Error?c.toString():c),A(this,"object",c)}function y(e,t,i){return e.every(function(e){return i?t.some(function(t){return i(e,t)}):t.indexOf(e)!==-1})}function j(e,t,i){i&&A(this,"message",i);var n=A(this,"object");new m(e,i).to.have.property(t),new m(n).is.a("function");var r=e[t];n(),this.assert(r!==e[t],"expected ."+t+" to change","expected ."+t+" to not change")}function w(e,t,i){i&&A(this,"message",i);var n=A(this,"object");new m(e,i).to.have.property(t),new m(n).is.a("function");var r=e[t];n(),this.assert(e[t]-r>0,"expected ."+t+" to increase","expected ."+t+" to not increase")}function x(e,t,i){i&&A(this,"message",i);var n=A(this,"object");new m(e,i).to.have.property(t),new m(n).is.a("function");var r=e[t];n(),this.assert(e[t]-r<0,"expected ."+t+" to decrease","expected ."+t+" to not decrease")}var m=e.Assertion,q=Object.prototype.toString,A=t.flag;["to","be","been","is","and","has","have","with","that","which","at","of","same"].forEach(function(e){m.addProperty(e,function(){return this})}),m.addProperty("not",function(){A(this,"negate",!0)}),m.addProperty("deep",function(){A(this,"deep",!0)}),m.addProperty("any",function(){A(this,"any",!0),A(this,"all",!1)}),m.addProperty("all",function(){A(this,"all",!0),A(this,"any",!1)}),m.addChainableMethod("an",i),m.addChainableMethod("a",i),m.addChainableMethod("include",r,n),m.addChainableMethod("contain",r,n),m.addChainableMethod("contains",r,n),m.addChainableMethod("includes",r,n),m.addProperty("ok",function(){this.assert(A(this,"object"),"expected #{this} to be truthy","expected #{this} to be falsy")}),m.addProperty("true",function(){this.assert(!0===A(this,"object"),"expected #{this} to be true","expected #{this} to be false",!this.negate)}),m.addProperty("false",function(){this.assert(!1===A(this,"object"),"expected #{this} to be false","expected #{this} to be true",!!this.negate)}),m.addProperty("null",function(){this.assert(null===A(this,"object"),"expected #{this} to be null","expected #{this} not to be null")}),m.addProperty("undefined",function(){this.assert(void 0===A(this,"object"),"expected #{this} to be undefined","expected #{this} not to be undefined")}),m.addProperty("exist",function(){this.assert(null!=A(this,"object"),"expected #{this} to exist","expected #{this} to not exist")}),m.addProperty("empty",function(){var e=A(this,"object"),t=e;Array.isArray(e)||"string"==typeof object?t=e.length:"object"==typeof e&&(t=Object.keys(e).length),this.assert(!t,"expected #{this} to be empty","expected #{this} not to be empty")}),m.addProperty("arguments",o),m.addProperty("Arguments",o),m.addMethod("equal",s),m.addMethod("equals",s),m.addMethod("eq",s),m.addMethod("eql",a),m.addMethod("eqls",a),m.addMethod("above",c),m.addMethod("gt",c),m.addMethod("greaterThan",c),m.addMethod("least",h),m.addMethod("gte",h),m.addMethod("below",u),m.addMethod("lt",u),m.addMethod("lessThan",u),m.addMethod("most",l),m.addMethod("lte",l),m.addMethod("within",function(e,t,i){i&&A(this,"message",i);var n=A(this,"object"),r=e+".."+t;if(A(this,"doLength")){new m(n,i).to.have.property("length");var o=n.length;this.assert(o>=e&&o<=t,"expected #{this} to have a length within "+r,"expected #{this} to not have a length within "+r)}else this.assert(n>=e&&n<=t,"expected #{this} to be within "+r,"expected #{this} to not be within "+r)}),m.addMethod("instanceof",f),m.addMethod("instanceOf",f),m.addMethod("property",function(e,i,n){n&&A(this,"message",n);var r=!!A(this,"deep"),o=r?"deep property ":"property ",s=A(this,"negate"),a=A(this,"object"),c=r?t.getPathInfo(e,a):null,h=r?c.exists:t.hasProperty(e,a),u=r?c.value:a[e];if(s&&void 0!==i){if(void 0===u)throw n=null!=n?n+": ":"",new Error(n+t.inspect(a)+" has no "+o+t.inspect(e))}else this.assert(h,"expected #{this} to have a "+o+t.inspect(e),"expected #{this} to not have "+o+t.inspect(e));void 0!==i&&this.assert(i===u,"expected #{this} to have a "+o+t.inspect(e)+" of #{exp}, but got #{act}","expected #{this} to not have a "+o+t.inspect(e)+" of #{act}",i,u),A(this,"object",u)}),m.addMethod("ownProperty",p),m.addMethod("haveOwnProperty",p),m.addChainableMethod("length",b,d),m.addMethod("lengthOf",b),m.addMethod("match",function(e,t){t&&A(this,"message",t);var i=A(this,"object");this.assert(e.exec(i),"expected #{this} to match "+e,"expected #{this} not to match "+e)}),m.addMethod("string",function(e,i){i&&A(this,"message",i);var n=A(this,"object");new m(n,i).is.a("string"),this.assert(~n.indexOf(e),"expected #{this} to contain "+t.inspect(e),"expected #{this} to not contain "+t.inspect(e))}),m.addMethod("keys",g),m.addMethod("key",g),m.addMethod("throw",v),m.addMethod("throws",v),m.addMethod("Throw",v),m.addMethod("respondTo",function(e,i){i&&A(this,"message",i);var n=A(this,"object"),r=A(this,"itself"),o="function"!==t.type(n)||r?n[e]:n.prototype[e];this.assert("function"==typeof o,"expected #{this} to respond to "+t.inspect(e),"expected #{this} to not respond to "+t.inspect(e))}),m.addProperty("itself",function(){A(this,"itself",!0)}),m.addMethod("satisfy",function(e,i){i&&A(this,"message",i);var n=A(this,"object"),r=e(n);this.assert(r,"expected #{this} to satisfy "+t.objDisplay(e),"expected #{this} to not satisfy"+t.objDisplay(e),!this.negate,r)}),m.addMethod("closeTo",function(e,i,n){n&&A(this,"message",n);var r=A(this,"object");if(new m(r,n).is.a("number"),"number"!==t.type(e)||"number"!==t.type(i))throw new Error("the arguments to closeTo must be numbers");this.assert(Math.abs(r-e)<=i,"expected #{this} to be close to "+e+" +/- "+i,"expected #{this} not to be close to "+e+" +/- "+i)}),m.addMethod("members",function(e,i){i&&A(this,"message",i);var n=A(this,"object");new m(n).to.be.an("array"),new m(e).to.be.an("array");var r=A(this,"deep")?t.eql:void 0;return A(this,"contains")?this.assert(y(e,n,r),"expected #{this} to be a superset of #{act}","expected #{this} to not be a superset of #{act}",n,e):void this.assert(y(n,e,r)&&y(e,n,r),"expected #{this} to have the same members as #{act}","expected #{this} to not have the same members as #{act}",n,e)}),m.addChainableMethod("change",j),m.addChainableMethod("changes",j),m.addChainableMethod("increase",w),m.addChainableMethod("increases",w),m.addChainableMethod("decrease",x),m.addChainableMethod("decreases",x)}}),require.register("chai/lib/chai/interface/assert.js",function(exports,module){module.exports=function(chai,util){var Assertion=chai.Assertion,flag=util.flag,assert=chai.assert=function(e,t){var i=new Assertion(null,null,chai.assert);i.assert(e,t,"[ negation message unavailable ]")};assert.fail=function(e,t,i,n){throw i=i||"assert.fail()",new chai.AssertionError(i,{actual:e,expected:t,operator:n},assert.fail)},assert.ok=function(e,t){new Assertion(e,t).is.ok},assert.notOk=function(e,t){new Assertion(e,t).is.not.ok},assert.equal=function(e,t,i){var n=new Assertion(e,i,assert.equal);n.assert(t==flag(n,"object"),"expected #{this} to equal #{exp}","expected #{this} to not equal #{act}",t,e)},assert.notEqual=function(e,t,i){var n=new Assertion(e,i,assert.notEqual);n.assert(t!=flag(n,"object"),"expected #{this} to not equal #{exp}","expected #{this} to equal #{act}",t,e)},assert.strictEqual=function(e,t,i){new Assertion(e,i).to.equal(t)},assert.notStrictEqual=function(e,t,i){new Assertion(e,i).to.not.equal(t)},assert.deepEqual=function(e,t,i){new Assertion(e,i).to.eql(t)},assert.notDeepEqual=function(e,t,i){new Assertion(e,i).to.not.eql(t)},assert.isAbove=function(e,t,i){new Assertion(e,i).to.be.above(t)},assert.isBelow=function(e,t,i){new Assertion(e,i).to.be.below(t)},assert.isTrue=function(e,t){new Assertion(e,t).is.true},assert.isFalse=function(e,t){new Assertion(e,t).is.false},assert.isNull=function(e,t){new Assertion(e,t).to.equal(null)},assert.isNotNull=function(e,t){new Assertion(e,t).to.not.equal(null)},assert.isUndefined=function(e,t){new Assertion(e,t).to.equal(void 0)},assert.isDefined=function(e,t){new Assertion(e,t).to.not.equal(void 0)},assert.isFunction=function(e,t){new Assertion(e,t).to.be.a("function")},assert.isNotFunction=function(e,t){new Assertion(e,t).to.not.be.a("function")},assert.isObject=function(e,t){new Assertion(e,t).to.be.a("object")},assert.isNotObject=function(e,t){new Assertion(e,t).to.not.be.a("object")},assert.isArray=function(e,t){new Assertion(e,t).to.be.an("array")},assert.isNotArray=function(e,t){new Assertion(e,t).to.not.be.an("array")},assert.isString=function(e,t){new Assertion(e,t).to.be.a("string")},assert.isNotString=function(e,t){new Assertion(e,t).to.not.be.a("string")},assert.isNumber=function(e,t){new Assertion(e,t).to.be.a("number")},assert.isNotNumber=function(e,t){new Assertion(e,t).to.not.be.a("number")},assert.isBoolean=function(e,t){new Assertion(e,t).to.be.a("boolean")},assert.isNotBoolean=function(e,t){new Assertion(e,t).to.not.be.a("boolean")},assert.typeOf=function(e,t,i){new Assertion(e,i).to.be.a(t)},assert.notTypeOf=function(e,t,i){new Assertion(e,i).to.not.be.a(t)},assert.instanceOf=function(e,t,i){new Assertion(e,i).to.be.instanceOf(t)},assert.notInstanceOf=function(e,t,i){new Assertion(e,i).to.not.be.instanceOf(t)},assert.include=function(e,t,i){new Assertion(e,i,assert.include).include(t)},assert.notInclude=function(e,t,i){new Assertion(e,i,assert.notInclude).not.include(t)},assert.match=function(e,t,i){new Assertion(e,i).to.match(t)},assert.notMatch=function(e,t,i){new Assertion(e,i).to.not.match(t)},assert.property=function(e,t,i){new Assertion(e,i).to.have.property(t)},assert.notProperty=function(e,t,i){new Assertion(e,i).to.not.have.property(t)},assert.deepProperty=function(e,t,i){new Assertion(e,i).to.have.deep.property(t)},assert.notDeepProperty=function(e,t,i){new Assertion(e,i).to.not.have.deep.property(t)},assert.propertyVal=function(e,t,i,n){new Assertion(e,n).to.have.property(t,i)},assert.propertyNotVal=function(e,t,i,n){new Assertion(e,n).to.not.have.property(t,i)},assert.deepPropertyVal=function(e,t,i,n){new Assertion(e,n).to.have.deep.property(t,i)},assert.deepPropertyNotVal=function(e,t,i,n){new Assertion(e,n).to.not.have.deep.property(t,i)},assert.lengthOf=function(e,t,i){new Assertion(e,i).to.have.length(t)},assert.Throw=function(e,t,i,n){("string"==typeof t||t instanceof RegExp)&&(i=t,t=null);var r=new Assertion(e,n).to.Throw(t,i);return flag(r,"object")},assert.doesNotThrow=function(e,t,i){"string"==typeof t&&(i=t,t=null),new Assertion(e,i).to.not.Throw(t)},assert.operator=function(val,operator,val2,msg){if(!~["==","===",">",">=","<","<=","!=","!=="].indexOf(operator))throw new Error('Invalid operator "'+operator+'"');var test=new Assertion(eval(val+operator+val2),msg);test.assert(!0===flag(test,"object"),"expected "+util.inspect(val)+" to be "+operator+" "+util.inspect(val2),"expected "+util.inspect(val)+" to not be "+operator+" "+util.inspect(val2))},assert.closeTo=function(e,t,i,n){new Assertion(e,n).to.be.closeTo(t,i)},assert.sameMembers=function(e,t,i){new Assertion(e,i).to.have.same.members(t)},assert.sameDeepMembers=function(e,t,i){new Assertion(e,i).to.have.same.deep.members(t)},assert.includeMembers=function(e,t,i){new Assertion(e,i).to.include.members(t)},assert.changes=function(e,t,i){new Assertion(e).to.change(t,i)},assert.doesNotChange=function(e,t,i){new Assertion(e).to.not.change(t,i)},assert.increases=function(e,t,i){new Assertion(e).to.increase(t,i)},assert.doesNotIncrease=function(e,t,i){new Assertion(e).to.not.increase(t,i)},assert.decreases=function(e,t,i){new Assertion(e).to.decrease(t,i)},assert.doesNotDecrease=function(e,t,i){new Assertion(e).to.not.decrease(t,i)},assert.ifError=function(e,t){new Assertion(e,t).to.not.be.ok},function e(t,i){return assert[i]=assert[t],e}("Throw","throw")("Throw","throws")}}),require.register("chai/lib/chai/interface/expect.js",function(e,t){t.exports=function(e,t){e.expect=function(t,i){return new e.Assertion(t,i)},e.expect.fail=function(t,i,n,r){throw n=n||"expect.fail()",new e.AssertionError(n,{actual:t,expected:i,operator:r},e.expect.fail)}}}),require.register("chai/lib/chai/interface/should.js",function(e,t){t.exports=function(e,t){function i(){function t(){return this instanceof String||this instanceof Number?new n(this.constructor(this),null,t):this instanceof Boolean?new n(1==this,null,t):new n(this,null,t)}function i(e){Object.defineProperty(this,"should",{value:e,enumerable:!0,configurable:!0,writable:!0})}Object.defineProperty(Object.prototype,"should",{set:i,get:t,configurable:!0});var r={};return r.fail=function(t,i,n,o){throw n=n||"should.fail()",new e.AssertionError(n,{actual:t,expected:i,operator:o},r.fail)},r.equal=function(e,t,i){new n(e,i).to.equal(t)},r.Throw=function(e,t,i,r){new n(e,r).to.Throw(t,i)},r.exist=function(e,t){new n(e,t).to.exist},r.not={},r.not.equal=function(e,t,i){new n(e,i).to.not.equal(t)},r.not.Throw=function(e,t,i,r){new n(e,r).to.not.Throw(t,i)},r.not.exist=function(e,t){new n(e,t).to.not.exist},r.throw=r.Throw,r.not.throw=r.not.Throw,r}var n=e.Assertion;e.should=i,e.Should=i}}),require.register("chai/lib/chai/utils/addChainableMethod.js",function(e,t){var i=require("chai/lib/chai/utils/transferFlags.js"),n=require("chai/lib/chai/utils/flag.js"),r=require("chai/lib/chai/config.js"),o="__proto__"in Object,s=/^(?:length|name|arguments|caller)$/,a=Function.prototype.call,c=Function.prototype.apply;t.exports=function(e,t,h,u){"function"!=typeof u&&(u=function(){});var l={method:h,chainingBehavior:u};e.__methods||(e.__methods={}),e.__methods[t]=l,Object.defineProperty(e,t,{get:function(){l.chainingBehavior.call(this);var t=function e(){var t=n(this,"ssfi");t&&r.includeStack===!1&&n(this,"ssfi",e);var i=l.method.apply(this,arguments);return void 0===i?this:i};if(o){var h=t.__proto__=Object.create(this);h.call=a,h.apply=c}else{var u=Object.getOwnPropertyNames(e);u.forEach(function(i){if(!s.test(i)){var n=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,n)}})}return i(this,t),t},configurable:!0})}}),require.register("chai/lib/chai/utils/addMethod.js",function(e,t){var i=require("chai/lib/chai/config.js"),n=require("chai/lib/chai/utils/flag.js");t.exports=function(e,t,r){e[t]=function(){var o=n(this,"ssfi");o&&i.includeStack===!1&&n(this,"ssfi",e[t]);var s=r.apply(this,arguments);return void 0===s?this:s}}}),require.register("chai/lib/chai/utils/addProperty.js",function(e,t){t.exports=function(e,t,i){Object.defineProperty(e,t,{get:function(){var e=i.call(this);return void 0===e?this:e},configurable:!0})}}),require.register("chai/lib/chai/utils/flag.js",function(e,t){t.exports=function(e,t,i){var n=e.__flags||(e.__flags=Object.create(null));return 3!==arguments.length?n[t]:void(n[t]=i)}}),require.register("chai/lib/chai/utils/getActual.js",function(e,t){t.exports=function(e,t){return t.length>4?t[4]:e._obj}}),require.register("chai/lib/chai/utils/getEnumerableProperties.js",function(e,t){t.exports=function e(t){var i=[];for(var n in t)i.push(n);return i}}),require.register("chai/lib/chai/utils/getMessage.js",function(e,t){var i=require("chai/lib/chai/utils/flag.js"),n=require("chai/lib/chai/utils/getActual.js"),r=require("chai/lib/chai/utils/inspect.js"),o=require("chai/lib/chai/utils/objDisplay.js");t.exports=function(e,t){var r=i(e,"negate"),s=i(e,"object"),a=t[3],c=n(e,t),h=r?t[2]:t[1],u=i(e,"message");return"function"==typeof h&&(h=h()),h=h||"",h=h.replace(/#{this}/g,o(s)).replace(/#{act}/g,o(c)).replace(/#{exp}/g,o(a)),u?u+": "+h:h}}),require.register("chai/lib/chai/utils/getName.js",function(e,t){t.exports=function(e){if(e.name)return e.name;var t=/^\s?function ([^(]*)\(/.exec(e);return t&&t[1]?t[1]:""}}),require.register("chai/lib/chai/utils/getPathValue.js",function(e,t){var i=require("chai/lib/chai/utils/getPathInfo.js");t.exports=function(e,t){var n=i(e,t);return n.value}}),require.register("chai/lib/chai/utils/getPathInfo.js",function(e,t){function i(e){var t=e.replace(/\[/g,".["),i=t.match(/(\\\.|[^.]+?)+/g);return i.map(function(e){var t=/\[(\d+)\]$/,i=t.exec(e);return i?{i:parseFloat(i[1])}:{p:e}})}function n(e,t,i){var n=t,r;i=void 0===i?e.length:i;for(var o=0,s=i;o<s;o++){var a=e[o];n?("undefined"!=typeof a.p?n=n[a.p]:"undefined"!=typeof a.i&&(n=n[a.i]),o==s-1&&(r=n)):r=void 0}return r}var r=require("chai/lib/chai/utils/hasProperty.js");t.exports=function e(t,o){var s=i(t),a=s[s.length-1],c={parent:n(s,o,s.length-1),name:a.p||a.i,value:n(s,o)};return c.exists=r(c.name,c.parent),c}}),require.register("chai/lib/chai/utils/hasProperty.js",function(e,t){var i=require("chai/lib/chai/utils/type.js"),n={number:Number,string:String};t.exports=function e(t,r){var o=i(r);return"null"!==o&&"undefined"!==o&&(n[o]&&"object"!=typeof r&&(r=new n[o](r)),t in r)}}),require.register("chai/lib/chai/utils/getProperties.js",function(e,t){t.exports=function e(t){function i(e){n.indexOf(e)===-1&&n.push(e)}for(var n=Object.getOwnPropertyNames(subject),r=Object.getPrototypeOf(subject);null!==r;)Object.getOwnPropertyNames(r).forEach(i),r=Object.getPrototypeOf(r);return n}}),require.register("chai/lib/chai/utils/index.js",function(e,t){var e=t.exports={};e.test=require("chai/lib/chai/utils/test.js"),e.type=require("chai/lib/chai/utils/type.js"),e.getMessage=require("chai/lib/chai/utils/getMessage.js"),e.getActual=require("chai/lib/chai/utils/getActual.js"),e.inspect=require("chai/lib/chai/utils/inspect.js"),e.objDisplay=require("chai/lib/chai/utils/objDisplay.js"),e.flag=require("chai/lib/chai/utils/flag.js"),e.transferFlags=require("chai/lib/chai/utils/transferFlags.js"),e.eql=require("chaijs~deep-eql@0.1.3"),e.getPathValue=require("chai/lib/chai/utils/getPathValue.js"),e.getPathInfo=require("chai/lib/chai/utils/getPathInfo.js"),e.hasProperty=require("chai/lib/chai/utils/hasProperty.js"),e.getName=require("chai/lib/chai/utils/getName.js"),e.addProperty=require("chai/lib/chai/utils/addProperty.js"),e.addMethod=require("chai/lib/chai/utils/addMethod.js"),e.overwriteProperty=require("chai/lib/chai/utils/overwriteProperty.js"),e.overwriteMethod=require("chai/lib/chai/utils/overwriteMethod.js"),e.addChainableMethod=require("chai/lib/chai/utils/addChainableMethod.js"),e.overwriteChainableMethod=require("chai/lib/chai/utils/overwriteChainableMethod.js")}),require.register("chai/lib/chai/utils/inspect.js",function(e,t){function i(e,t,i,r){var o={showHidden:t,seen:[],stylize:function(e){return e}};return n(o,e,"undefined"==typeof i?2:i)}function n(t,i,p){if(i&&"function"==typeof i.inspect&&i.inspect!==e.inspect&&(!i.constructor||i.constructor.prototype!==i)){var y=i.inspect(p);return"string"!=typeof y&&(y=n(t,y,p)),y}var j=r(t,i);if(j)return j;if(v(i)){if("outerHTML"in i)return i.outerHTML;try{if(document.xmlVersion){var w=new XMLSerializer;return w.serializeToString(i)}var x="http://www.w3.org/1999/xhtml",m=document.createElementNS(x,"_");return m.appendChild(i.cloneNode(!1)),html=m.innerHTML.replace("><",">"+i.innerHTML+"<"),m.innerHTML="",html}catch(e){}}var q=g(i),A=t.showHidden?b(i):q;
if(0===A.length||f(i)&&(1===A.length&&"stack"===A[0]||2===A.length&&"description"===A[0]&&"stack"===A[1])){if("function"==typeof i){var M=d(i),O=M?": "+M:"";return t.stylize("[Function"+O+"]","special")}if(u(i))return t.stylize(RegExp.prototype.toString.call(i),"regexp");if(l(i))return t.stylize(Date.prototype.toUTCString.call(i),"date");if(f(i))return o(i)}var _="",P=!1,S=["{","}"];if(h(i)&&(P=!0,S=["[","]"]),"function"==typeof i){var M=d(i),O=M?": "+M:"";_=" [Function"+O+"]"}if(u(i)&&(_=" "+RegExp.prototype.toString.call(i)),l(i)&&(_=" "+Date.prototype.toUTCString.call(i)),f(i))return o(i);if(0===A.length&&(!P||0==i.length))return S[0]+_+S[1];if(p<0)return u(i)?t.stylize(RegExp.prototype.toString.call(i),"regexp"):t.stylize("[Object]","special");t.seen.push(i);var k;return k=P?s(t,i,p,q,A):A.map(function(e){return a(t,i,p,q,e,P)}),t.seen.pop(),c(k,_,S)}function r(e,t){switch(typeof t){case"undefined":return e.stylize("undefined","undefined");case"string":var i="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(i,"string");case"number":return 0===t&&1/t===-(1/0)?e.stylize("-0","number"):e.stylize(""+t,"number");case"boolean":return e.stylize(""+t,"boolean")}if(null===t)return e.stylize("null","null")}function o(e){return"["+Error.prototype.toString.call(e)+"]"}function s(e,t,i,n,r){for(var o=[],s=0,c=t.length;s<c;++s)Object.prototype.hasOwnProperty.call(t,String(s))?o.push(a(e,t,i,n,String(s),!0)):o.push("");return r.forEach(function(r){r.match(/^\d+$/)||o.push(a(e,t,i,n,r,!0))}),o}function a(e,t,i,r,o,s){var a,c;if(t.__lookupGetter__&&(t.__lookupGetter__(o)?c=t.__lookupSetter__(o)?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):t.__lookupSetter__(o)&&(c=e.stylize("[Setter]","special"))),r.indexOf(o)<0&&(a="["+o+"]"),c||(e.seen.indexOf(t[o])<0?(c=null===i?n(e,t[o],null):n(e,t[o],i-1),c.indexOf("\n")>-1&&(c=s?c.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+c.split("\n").map(function(e){return" "+e}).join("\n"))):c=e.stylize("[Circular]","special")),"undefined"==typeof a){if(s&&o.match(/^\d+$/))return c;a=JSON.stringify(""+o),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+c}function c(e,t,i){var n=0,r=e.reduce(function(e,t){return n++,t.indexOf("\n")>=0&&n++,e+t.length+1},0);return r>60?i[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+i[1]:i[0]+t+" "+e.join(", ")+" "+i[1]}function h(e){return Array.isArray(e)||"object"==typeof e&&"[object Array]"===p(e)}function u(e){return"object"==typeof e&&"[object RegExp]"===p(e)}function l(e){return"object"==typeof e&&"[object Date]"===p(e)}function f(e){return"object"==typeof e&&"[object Error]"===p(e)}function p(e){return Object.prototype.toString.call(e)}var d=require("chai/lib/chai/utils/getName.js"),b=require("chai/lib/chai/utils/getProperties.js"),g=require("chai/lib/chai/utils/getEnumerableProperties.js");t.exports=i;var v=function(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&1===e.nodeType&&"string"==typeof e.nodeName}}),require.register("chai/lib/chai/utils/objDisplay.js",function(e,t){var i=require("chai/lib/chai/utils/inspect.js"),n=require("chai/lib/chai/config.js");t.exports=function(e){var t=i(e),r=Object.prototype.toString.call(e);if(n.truncateThreshold&&t.length>=n.truncateThreshold){if("[object Function]"===r)return e.name&&""!==e.name?"[Function: "+e.name+"]":"[Function]";if("[object Array]"===r)return"[ Array("+e.length+") ]";if("[object Object]"===r){var o=Object.keys(e),s=o.length>2?o.splice(0,2).join(", ")+", ...":o.join(", ");return"{ Object ("+s+") }"}return t}return t}}),require.register("chai/lib/chai/utils/overwriteMethod.js",function(e,t){t.exports=function(e,t,i){var n=e[t],r=function(){return this};n&&"function"==typeof n&&(r=n),e[t]=function(){var e=i(r).apply(this,arguments);return void 0===e?this:e}}}),require.register("chai/lib/chai/utils/overwriteProperty.js",function(e,t){t.exports=function(e,t,i){var n=Object.getOwnPropertyDescriptor(e,t),r=function(){};n&&"function"==typeof n.get&&(r=n.get),Object.defineProperty(e,t,{get:function(){var e=i(r).call(this);return void 0===e?this:e},configurable:!0})}}),require.register("chai/lib/chai/utils/overwriteChainableMethod.js",function(e,t){t.exports=function(e,t,i,n){var r=e.__methods[t],o=r.chainingBehavior;r.chainingBehavior=function(){var e=n(o).call(this);return void 0===e?this:e};var s=r.method;r.method=function(){var e=i(s).apply(this,arguments);return void 0===e?this:e}}}),require.register("chai/lib/chai/utils/test.js",function(e,t){var i=require("chai/lib/chai/utils/flag.js");t.exports=function(e,t){var n=i(e,"negate"),r=t[0];return n?!r:r}}),require.register("chai/lib/chai/utils/transferFlags.js",function(e,t){t.exports=function(e,t,i){var n=e.__flags||(e.__flags=Object.create(null));t.__flags||(t.__flags=Object.create(null)),i=3!==arguments.length||i;for(var r in n)(i||"object"!==r&&"ssfi"!==r&&"message"!=r)&&(t.__flags[r]=n[r])}}),require.register("chai/lib/chai/utils/type.js",function(e,t){var i={"[object Arguments]":"arguments","[object Array]":"array","[object Date]":"date","[object Function]":"function","[object Number]":"number","[object RegExp]":"regexp","[object String]":"string"};t.exports=function(e){var t=Object.prototype.toString.call(e);return i[t]?i[t]:null===e?"null":void 0===e?"undefined":e===Object(e)?"object":typeof e}}),chai=require("chai")}()}).call(this),function(){!function(e){chai.use(e)}(function(e,t){e.string=e.string||{},e.string.startsWith=function(e,t){return 0===e.indexOf(t)},e.string.endsWith=function(e,t){return e.indexOf(t,e.length-t.length)!==-1},e.string.equalIgnoreCase=function(e,t){return e.toLowerCase()===t.toLowerCase()},e.string.singleLine=function(e){return e.trim().indexOf("\n")===-1},e.string.reverseOf=function(e,t){return e.split("").reverse().join("")===t},e.string.palindrome=function(e){for(var t=e.length,i=0;i<Math.floor(t/2);i++)if(e[i]!==e[t-1-i])return!1;return!0},e.string.entriesCount=function(e,t,i){for(var n=0,r=e.length,o=0;n<r;){var s=e.indexOf(t,n);if(s===-1)break;o++,n=s+1}return o===i};var i=function(t){var i=this._obj;return this.assert(e.string.startsWith(i,t),"expected "+this._obj+" to starts with "+t,"expected "+this._obj+" to not starts with "+t)};e.Assertion.addChainableMethod("startsWith",i),e.Assertion.addChainableMethod("startWith",i);var n=function(t){var i=this._obj;return this.assert(e.string.endsWith(i,t),"expected "+this._obj+" to ends with "+t,"expected "+this._obj+" to not ends with "+t)};e.Assertion.addChainableMethod("endsWith",n),e.Assertion.addChainableMethod("endWith",n),e.Assertion.addChainableMethod("equalIgnoreCase",function(t){var i=this._obj;return this.assert(e.string.equalIgnoreCase(i,t),"expected "+this._obj+" to be equal to "+t+" ignoring case","expected "+this._obj+" to be not equal to "+t+" ignoring case")}),e.Assertion.addChainableMethod("singleLine",function(){var t=this._obj;return this.assert(e.string.singleLine(t),"expected "+this._obj+" to be single line","expected "+this._obj+" to be not single line")}),e.Assertion.addChainableMethod("reverseOf",function(t){var i=this._obj;return this.assert(e.string.reverseOf(i,t),"expected "+this._obj+" to be reverse of "+t,"expected "+this._obj+" to be not reverse of "+t)}),e.Assertion.addChainableMethod("palindrome",function(){var t=this._obj;return this.assert(e.string.palindrome(t),"expected "+this._obj+" to be palindrome","expected "+this._obj+" to be not palindrome")}),e.Assertion.addChainableMethod("entriesCount",function(t,i){var n=this._obj;return this.assert(e.string.entriesCount(n,t,i),"expected "+this._obj+" to have "+t+" "+i+" time(s)","expected "+this._obj+" to not have "+t+" "+i+" time(s)")});var r=e.assert;r.startsWith=function(t,i,n){new e.Assertion(t,n).to.startsWith(i)},r.notStartsWith=function(t,i,n){new e.Assertion(t,n).to.not.startsWith(i)},r.endsWith=function(t,i,n){new e.Assertion(t,n).to.endsWith(i)},r.notEndsWith=function(t,i,n){new e.Assertion(t,n).to.not.endsWith(i)},r.equalIgnoreCase=function(t,i,n){new e.Assertion(t,n).to.be.equalIgnoreCase(i)},r.notEqualIgnoreCase=function(t,i,n){new e.Assertion(t,n).to.not.be.equalIgnoreCase(i)},r.singleLine=function(t,i,n){new e.Assertion(t,n).to.be.singleLine()},r.notSingleLine=function(t,i,n){new e.Assertion(t,n).to.not.be.singleLine()},r.reverseOf=function(t,i,n){new e.Assertion(t,n).to.be.reverseOf(i)},r.notReverseOf=function(t,i,n){new e.Assertion(t,n).to.not.be.reverseOf(i)},r.palindrome=function(t,i,n){new e.Assertion(t,n).to.be.palindrome()},r.notPalindrome=function(t,i,n){new e.Assertion(t,n).to.not.be.palindrome()},r.entriesCount=function(t,i,n,r){new e.Assertion(t,r).to.have.entriesCount(i,n)}})}.call(this),function(){__coffeescriptShare="object"==typeof __coffeescriptShare?__coffeescriptShare:{};var e=__coffeescriptShare,t,i,n,r,o;Meteor.isServer?chai.config.includeStack=(null!=(t=Meteor.settings)&&null!=(i=t.chai)?i.includeStack:void 0)||!0:chai.config.includeStack=(null!=(n=Meteor.settings)&&null!=(r=n.public)&&null!=(o=r.chai)?o.includeStack:void 0)||!0}.call(this),function(){assert=chai.assert,expect=chai.expect,should=chai.should}.call(this)}).call(this),"undefined"==typeof Package&&(Package={}),function(e,t){for(var i in t)i in e||(e[i]=t[i])}(Package["practicalmeteor:chai"]={},{chai:chai,assert:assert,expect:expect,should:should})}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,l=Package.meteor.meteorEnv,o=Package["practicalmeteor:chai"].chai,n=Package["practicalmeteor:chai"].assert,i=Package["practicalmeteor:chai"].expect,r=Package["practicalmeteor:chai"].should,a=Package["ecmascript-runtime"].Symbol,c=Package["ecmascript-runtime"].Map,s=Package["ecmascript-runtime"].Set,u=Package["babel-runtime"].meteorBabelHelpers,g=Package.promise.Promise,f,p,h,v,d;(function(){(function(){f=function(e){function t(e){return typeof console!==s&&(void 0!==console[e]?l(console,e):void 0!==console.log?l(console,"log"):c)}function l(e,t){var l=e[t];if("function"==typeof l.bind)return l.bind(e,a.prefix);try{return Function.prototype.bind.call(l,e,a.prefix)}catch(t){return function(){return Function.prototype.apply.apply(l,[e,arguments])}}}function o(e,t){return function(){typeof console!==s&&(n(t),a[e].apply(a,arguments))}}function n(e){for(var t=0;t<u.length;t++){var l=u[t];a[l]=t<e?c:a.methodFactory(l,e)}}function i(e){var t=(u[e]||"silent").toUpperCase();try{return void(window.localStorage.loglevel=t)}catch(e){}try{window.document.cookie="loglevel="+t+";"}catch(e){}}function r(){var e;try{e=window.localStorage.loglevel}catch(e){}if(typeof e===s)try{e=/loglevel=([^;]+)/.exec(window.document.cookie)[1]}catch(e){}void 0===a.levels[e]&&(e="WARN"),a.setLevel(a.levels[e])}var a={};e&&e.prefix?a.prefix=e.prefix:a.prefix="",e&&e.level?a.level=e.level:a.level="info";var c=function(){},s="undefined",u=["trace","fine","debug","info","warn","error"];a.levels={TRACE:0,FINE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5,SILENT:6},a.methodFactory=function(e,l){return t(e)||o(e,l)},a.setLevel=function(e){if("string"==typeof e&&void 0!==a.levels[e.toUpperCase()]&&(e=a.levels[e.toUpperCase()]),!("number"==typeof e&&e>=0&&e<=a.levels.SILENT))throw"log.setLevel() called with invalid level: "+e;if(a.level=e,n(e),typeof console===s&&e<a.levels.SILENT)return"No console available for logging"},a.enableAll=function(){a.setLevel(a.levels.TRACE)},a.disableAll=function(){a.setLevel(a.levels.SILENT)};var g=typeof window!==s?window.log:void 0;return a.noConflict=function(){return typeof window!==s&&window.log===a&&(window.log=g),a},a.setPrefix=function(e){typeof e!==s&&null!==e||(e=""),a.prefix=e,a.setLevel(a.level)},a.setLevel(a.level),a},p=f({prefix:"practicalmeteor:loglevel:"})}).call(this),function(){h="object"==typeof h?h:{};var t=h;null==this.practical&&(this.practical={}),practical.LoggerFactory=function(){function t(){}var l;return l=null,t.get=function(){return null!=l?l:l=new practical.LoggerFactory},t.prototype._getSettingsLoglevel=function(e,t){var l,o;return null==e&&(e=""),null==t&&(t="info"),i(e).to.be.a("string"),i(t).to.be.a("string").that.has.length.above(0),l=this._getNamespaceLoglevel("global"),null!=l?l:(e.length>0&&(o=this._getNamespaceLoglevel(e)),null==o&&(o=this._getNamespaceLoglevel("default")),null!=o?o:o=t)},t.prototype._getNamespaceLoglevel=function(t){var l,o,n,r,a,c,s;return i(t).to.be.a("string").that.has.length.above(0),l=null!=(n=e.settings)&&null!=(r=n.public)&&null!=(a=r.loglevel)?a[t]:void 0,e.isServer&&(o=null!=(c=e.settings)&&null!=(s=c.loglevel)?s[t]:void 0,null!=o&&(l=o)),l},t.prototype.createLogger=function(e,t){var l;return null==e&&(e=""),null==t&&(t="info"),p.debug("LoggerFactory.createLogger()",arguments),i(e).to.be.a("string"),i(t).to.be.a("string").that.has.length.above(0),i(f).to.be.a("function"),l={},e.length>0&&(l.prefix=e+":"),l.level=this._getSettingsLoglevel(e,t),f(l)},t.prototype.createPackageLogger=function(e,t){return null==t&&(t="info"),this.createLogger(e,t)},t.prototype.createAppLogger=function(e,t){return null==e&&(e="app"),null==t&&(t="info"),this.createLogger(e,t)},t}(),v=practical.LoggerFactory.get()}.call(this),function(){h="object"==typeof h?h:{};var e=h,t=[].slice;d=function(){function e(e,t){return this.className=e,this.defaultLevel=null!=t?t:"info",this.log=v.createLogger(this.className,this.defaultLevel),this.callStack=[],this.log.enter=this.bindMethod(this.enter,"debug"),this.log.fineEnter=this.bindMethod(this.enter,"fine"),this.log.return=this.bindMethod(this.return,"debug"),this.log.fineReturn=this.bindMethod(this.return,"fine"),this.log}return e.prototype.enter=function(){var e,l,o;if(l=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],0===e.length)throw new Error("ObjectLogger: No method name provided to enter");return o=e.shift(),this.callStack.unshift(o),this.log.setPrefix(""+this.className+"."+o+":"),e.unshift("ENTER"),this.log[l].apply(this.log,e)},e.prototype.return=function(e){var t;if(this.log[e].call(this.log,"RETURN"),this.callStack.shift(),this.callStack.length>0)return t=this.callStack[0],this.log.setPrefix(""+this.className+"."+t+":")},e.prototype.bindMethod=function(e,l){var o;if("function"==typeof e.bind)return e.bind(this,l);try{return Function.prototype.bind.call(e,this,l)}catch(n){return o=n,function(o){return function(){var n;return n=1<=arguments.length?t.call(arguments,0):[],n.unshift(l),Function.prototype.apply.apply(e,[o,n])}}(this)}},e}()}.call(this)}).call(this),"undefined"==typeof Package&&(Package={}),function(e,t){for(var l in t)l in e||(e[l]=t[l])}(Package["practicalmeteor:loglevel"]={},{loglevel:v,ObjectLogger:d})}();
!function(){var e=Package.meteor.Meteor,a=Package.meteor.global,c=Package.meteor.meteorEnv,o=Package["practicalmeteor:loglevel"].loglevel,r=Package["practicalmeteor:loglevel"].ObjectLogger,g=Package.modules.meteorInstall,t=Package.modules.Buffer,l=Package.modules.process,m=Package["ecmascript-runtime"].Symbol,k=Package["ecmascript-runtime"].Map,n=Package["ecmascript-runtime"].Set,P=Package["babel-runtime"].meteorBabelHelpers,i=Package.promise.Promise,s=Package.webapp.WebApp,p=Package.logging.Log,u=Package.deps.Tracker,d=Package.deps.Deps,f=Package.session.Session,h=Package["ddp-client"].DDP,b=Package.mongo.Mongo,v=Package.ui.Blaze,j=Package.ui.UI,S=Package.ui.Handlebars,y=Package.spacebars.Spacebars,L=Package["templating-runtime"].Template,M=Package.check.check,H=Package.check.Match,B=Package.underscore._,D=Package.jquery.$,I=Package.jquery.jQuery,O=Package.random.Random,T=Package.ejson.EJSON,_=Package["launch-screen"].LaunchScreen,q=Package.htmljs.HTML,E=g({node_modules:{meteor:{"ohif:log":{"main.js":["meteor/ohif:core","meteor/practicalmeteor:loglevel",function(a,c,o){var r;o.import("meteor/ohif:core",{OHIF:function(e){r=e}});var g;o.import("meteor/practicalmeteor:loglevel",{loglevel:function(e){g=e}});var t=e.isProduction?"error":"trace";r.log=g.createLogger("",t)}]}}}},{extensions:[".js",".json"]});E("./node_modules/meteor/ohif:log/main.js"),"undefined"==typeof Package&&(Package={}),Package["ohif:log"]={}}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,n=Package.meteor.meteorEnv,o=Package["reactive-var"].ReactiveVar,r=Package.modules.meteorInstall,i=Package.modules.Buffer,a=Package.modules.process,c=Package["ecmascript-runtime"].Symbol,s=Package["ecmascript-runtime"].Map,u=Package["ecmascript-runtime"].Set,f=Package["babel-runtime"].meteorBabelHelpers,m=Package.promise.Promise,d=r({node_modules:{meteor:{"ohif:commands":{"main.js":["meteor/reactive-var","meteor/ohif:core","meteor/ohif:commands/client/classes/CommandsManager",function(e,t,n){n.export({context:function(){return a},commands:function(){return c}});var o;n.import("meteor/reactive-var",{ReactiveVar:function(e){o=e}});var r;n.import("meteor/ohif:core",{OHIF:function(e){r=e}});var i;n.import("meteor/ohif:commands/client/classes/CommandsManager",{CommandsManager:function(e){i=e}});var a=new o(null);r.context=a;var c=new i(a);r.commands=c}],client:{classes:{"CommandsManager.js":["babel-runtime/helpers/typeof","babel-runtime/helpers/classCallCheck","meteor/reactive-var","meteor/underscore","meteor/ohif:core",function(e,t,n){n.export({CommandsManager:function(){return s}});var o;n.import("babel-runtime/helpers/typeof",{default:function(e){o=e}});var r;n.import("babel-runtime/helpers/classCallCheck",{default:function(e){r=e}});var i;n.import("meteor/reactive-var",{ReactiveVar:function(e){i=e}});var a;n.import("meteor/underscore",{_:function(e){a=e}});var c;n.import("meteor/ohif:core",{OHIF:function(e){c=e}});var s=function(){function e(){r(this,e),this.contexts={},this.last=new i("")}return e.prototype.getContext=function(){function e(e){var t=this.contexts[e];return t?t:c.log.warn('No context found with name "'+e+'"')}return e}(),e.prototype.getCurrentContext=function(){function e(){var e=c.context.get();return e?this.getContext(e):c.log.warn("There is no selected context")}return e}(),e.prototype.createContext=function(){function e(e){if(e)return this.contexts[e]?this.clear(e):void(this.contexts[e]={})}return e}(),e.prototype.set=function(){function e(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("object"===("undefined"==typeof t?"undefined":o(t))){var r=this.getContext(e);r&&(n||this.clear(e),Object.keys(t).forEach(function(e){return r[e]=t[e]}))}}return e}(),e.prototype.register=function(){function e(e,t,n){if("object"===("undefined"==typeof n?"undefined":o(n))){var r=this.getContext(e);r&&(r[t]=n)}}return e}(),e.prototype.setDisabledFunction=function(){function e(e,t,n){if(t&&"function"==typeof n){var o=this.getContext(e);if(o){var r=o[t];return r?void(r.disabled=n):c.log.warn('Trying to set a disabled function to a command "'+t+'" that was not yet defined')}}}return e}(),e.prototype.clear=function(){function e(e){e&&(this.contexts[e]={})}return e}(),e.prototype.getDefinition=function(){function e(e){var t=this.getCurrentContext();if(t)return t[e]}return e}(),e.prototype.isDisabled=function(){function e(e){var t=this.getDefinition(e);if(!t)return!1;var n=t.disabled;return!(!a.isFunction(n)||!n())||!(a.isFunction(n)||!n)}return e}(),e.prototype.run=function(){function e(e){var t=this.getDefinition(e);if(!t)return c.log.warn('Command "'+e+'" not found in current context');var n=t.action,o=t.params;if(!this.isDisabled(e)){if("function"!=typeof n)return c.log.warn('No action was defined for command "'+e+'"');var r=n(o);return this.last.get()===e?this.last.dep.changed():this.last.set(e),r}}return e}(),e}()}]}}}}}},{extensions:[".js",".json"]}),l=d("./node_modules/meteor/ohif:commands/main.js");"undefined"==typeof Package&&(Package={}),Package["ohif:commands"]=l}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,n=Package.meteor.meteorEnv,o=Package["templating-runtime"].Template,r=Package["reactive-var"].ReactiveVar,i=Package.session.Session,a=Package["iron:router"].Router,s=Package["iron:router"].RouteController,u=Package["u2622:persistent-session"].PersistentSession,c=Package.modules.meteorInstall,l=Package.modules.Buffer,f=Package.modules.process,m=Package["ecmascript-runtime"].Symbol,p=Package["ecmascript-runtime"].Map,h=Package["ecmascript-runtime"].Set,y=Package["babel-runtime"].meteorBabelHelpers,d=Package.promise.Promise,k=Package["iron:core"].Iron,g=Package.blaze.Blaze,v=Package.blaze.UI,b=Package.blaze.Handlebars,T=Package.spacebars.Spacebars,x=Package.htmljs.HTML,C=c({node_modules:{meteor:{"ohif:hotkeys":{"main.js":["meteor/ohif:core","meteor/ohif:hotkeys/client/classes/HotkeysManager","jquery.hotkeys",function(e,t,n){n.export({hotkeys:function(){return i}});var o;n.import("meteor/ohif:core",{OHIF:function(e){o=e}});var r;n.import("meteor/ohif:hotkeys/client/classes/HotkeysManager",{HotkeysManager:function(e){r=e}}),n.import("jquery.hotkeys");var i=new r;o.hotkeys=i}],client:{"index.js":["./components","./lib",function(e,t,n){n.import("./components"),n.import("./lib")}],classes:{"HotkeysContext.js":["babel-runtime/helpers/typeof","babel-runtime/helpers/classCallCheck","meteor/ohif:core",function(e,t,n){n.export({HotkeysContext:function(){return a}});var o;n.import("babel-runtime/helpers/typeof",{default:function(e){o=e}});var r;n.import("babel-runtime/helpers/classCallCheck",{default:function(e){r=e}});var i;n.import("meteor/ohif:core",{OHIF:function(e){i=e}});var a=function(){function e(t,n,o){r(this,e),this.name=t,this.definitions=Object.assign({},n),this.enabled=o}return e.prototype.extend=function(){function e(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"===("undefined"==typeof t?"undefined":o(t))&&(this.definitions=Object.assign({},t),Object.keys(t).forEach(function(n){var o=t[n];e.unregister(n),o&&e.register(n,o),e.definitions[n]=o}))}return e}(),e.prototype.register=function(){function e(e,t){var n=this;if(t){if(!e)return i.log.warn('No command was defined for hotkey "'+t+'"');var o="keydown.hotkey."+this.name+"."+e,r=function(){function t(t){return $(document).bind(o,t,function(t){n.enabled.get()&&i.commands.run(e)})}return t}();t instanceof Array?t.forEach(function(e){return r(e)}):r(t)}}return e}(),e.prototype.unregister=function(){function e(e){var t="keydown.hotkey."+this.name+"."+e;this.definitions[e]&&($(document).unbind(t),delete this.definitions[e])}return e}(),e.prototype.initialize=function(){function e(){var e=this;Object.keys(this.definitions).forEach(function(t){var n=e.definitions[t];e.register(t,n)})}return e}(),e.prototype.destroy=function(){function e(){$(document).unbind("keydown.hotkey."+this.name)}return e}(),e}()}],"HotkeysManager.js":["babel-runtime/helpers/classCallCheck","meteor/meteor","meteor/reactive-var","meteor/tracker","meteor/session","meteor/ohif:core","meteor/ohif:hotkeys/client/classes/HotkeysContext",function(e,t,n){n.export({HotkeysManager:function(){return l}});var o;n.import("babel-runtime/helpers/classCallCheck",{default:function(e){o=e}});var r;n.import("meteor/meteor",{Meteor:function(e){r=e}});var i;n.import("meteor/reactive-var",{ReactiveVar:function(e){i=e}});var a;n.import("meteor/tracker",{Tracker:function(e){a=e}});var s;n.import("meteor/session",{Session:function(e){s=e}});var u;n.import("meteor/ohif:core",{OHIF:function(e){u=e}});var c;n.import("meteor/ohif:hotkeys/client/classes/HotkeysContext",{HotkeysContext:function(e){c=e}});var l=function(){function e(){var t=this;o(this,e),this.contexts={},this.defaults={},this.currentContextName=null,this.enabled=new i((!0)),this.retrieveFunction=null,this.storeFunction=null,this.changeObserver=new a.Dependency,a.autorun(function(){var e=u.context.get();t.switchToContext(e)})}return e.prototype.setRetrieveFunction=function(){function e(e){this.retrieveFunction=e}return e}(),e.prototype.setStoreFunction=function(){function e(e){this.storeFunction=e}return e}(),e.prototype.store=function(){function e(e,t){var n=this,o="hotkeysDefinitions."+e;return new d(function(i,a){n.storeFunction?n.storeFunction(e,t).then(i).catch(a):r.userId()?u.user.setData(o,t).then(i).catch(a):(s.setPersistent(o,t),i())})}return e}(),e.prototype.retrieve=function(){function e(e){var t=this,n="hotkeysDefinitions."+e;return new d(function(o,r){if(t.retrieveFunction)t.retrieveFunction(e).then(o).catch(r);else if(u.user)try{o(u.user.getData(n))}catch(e){r(e)}else o(s.get(n))})}return e}(),e.prototype.disable=function(){function e(){this.enabled.set(!1)}return e}(),e.prototype.enable=function(){function e(){this.enabled.set(!0)}return e}(),e.prototype.getContext=function(){function e(e){return this.contexts[e]}return e}(),e.prototype.getCurrentContext=function(){function e(){return this.getContext(this.currentContextName)}return e}(),e.prototype.load=function(){function e(e){var t=this;return new d(function(n,o){var r=t.getContext(e);r&&t.retrieve(e).then(function(e){return e?(r.destroy(),r.definitions=e,r.initialize(),t.changeObserver.changed(),void n(e)):(t.changeObserver.changed(),o())}).catch(o)})}return e}(),e.prototype.set=function(){function e(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=this.enabled,r=new c(e,t,o),i=this.getCurrentContext();i&&i.name===e&&(i.destroy(),r.initialize()),this.contexts[e]=r,n&&(this.defaults[e]=t)}return e}(),e.prototype.register=function(){function e(e,t,n){if(t&&n){var o=this.getContext(e);o||this.set(e,{}),o.register(t,n)}}return e}(),e.prototype.unsetContext=function(){function e(e){e===this.currentContextName&&this.getCurrentContext().destroy(),delete this.contexts[e],delete this.defaults[e]}return e}(),e.prototype.resetDefauls=function(){function e(e){var t=this.getContext(e),n=this.defaults[e];if(t&&n)return t.extend(n),this.store(e,n).then(this.changeObserver.changed)}return e}(),e.prototype.switchToContext=function(){function e(e){var t=this.getCurrentContext();t&&t.destroy();var n=this.contexts[e];n&&(this.currentContextName=e,n.initialize(),this.load(e))}return e}(),e}()}]},components:{"confirmReplacementPopover.html":["./template.confirmReplacementPopover.js",function(e,t,n){n.exports=e("./template.confirmReplacementPopover.js")}],"template.confirmReplacementPopover.js":function(){o.__checkName("hotkeysConfirmReplacementPopover"),o.hotkeysConfirmReplacementPopover=new o("Template.hotkeysConfirmReplacementPopover",function(){var e=this;return g._TemplateWith(function(){return T.dataMustache(e.lookup("extend"),e.lookup("."),T.kw({confirmLabel:"Yes",cancelLabel:"No",confirmClass:"btn-danger"}))},function(){return T.include(e.lookupTemplate("popoverForm"),function(){return["\n ",x.P(x.B(g.View("lookup:..conflictedFunctionName",function(){return T.mustache(T.dot(e.lookup("."),"conflictedFunctionName"))}))," is already using the ",x.B(g.View("lookup:..hotkeyCombination",function(){return T.mustache(T.dot(e.lookup("."),"hotkeyCombination"))}))," shortcut."),"\n ",x.P("Do you want to use the shortcut to the ",x.B(g.View("lookup:..newFunctionName",function(){return T.mustache(T.dot(e.lookup("."),"newFunctionName"))}))," function instead?"),"\n "]})})})},"form.html":["./template.form.js",function(e,t,n){n.exports=e("./template.form.js")}],"template.form.js":function(){o.__checkName("hotkeysForm"),o.hotkeysForm=new o("Template.hotkeysForm",function(){var e=this;return g._TemplateWith(function(){return T.dataMustache(e.lookup("extend"),e.lookup("."),T.kw({api:T.dot(e.lookup("instance"),"api")}))},function(){return T.include(e.lookupTemplate("form"),function(){return["\n ",x.DIV({class:"form-content"},"\n ",g.Let({lists:function(){return T.call(e.lookup("getHotkeyInputInformationLists"))}},function(){return["\n ",x.DIV({class:"row"},"\n ",x.DIV({class:"col-lg-6 hotkeys-left"},"\n ",g._TemplateWith(function(){return{inputs:T.call(T.dot(e.lookup("lists"),"left"))}},function(){return T.include(e.lookupTemplate("hotkeysFormTable"))}),"\n "),"\n ",x.DIV({class:"col-lg-6 hotkeys-right"},"\n ",g._TemplateWith(function(){return{inputs:T.call(T.dot(e.lookup("lists"),"right"))}},function(){return T.include(e.lookupTemplate("hotkeysFormTable"))}),"\n "),"\n "),"\n "]}),"\n "),"\n ",x.DIV({class:"form-buttons clearfix"},"\n ",g._TemplateWith(function(){return{class:T.call("btn btn-danger pull-left"),action:T.call("resetDefaults")}},function(){return T.include(e.lookupTemplate("button"),function(){return"Reset to Defaults"})}),"\n ",g._TemplateWith(function(){return{class:T.call("btn btn-primary pull-right"),action:T.call("save")}},function(){return T.include(e.lookupTemplate("button"),function(){return"Save"})}),"\n "),"\n "]})})})},"form.js":["babel-runtime/helpers/typeof","meteor/templating","meteor/jquery","meteor/underscore","meteor/ohif:core",function(e,t,n){var o;n.import("babel-runtime/helpers/typeof",{default:function(e){o=e}});var r;n.import("meteor/templating",{Template:function(e){r=e}});var i;n.import("meteor/jquery",{$:function(e){i=e}});var a;n.import("meteor/underscore",{_:function(e){a=e}});var s;n.import("meteor/ohif:core",{OHIF:function(e){s=e}}),r.hotkeysForm.onCreated(function(){var e=r.instance();e.api={save:function(){function t(){var t=e.data.contextName,n=e.$("form").first().data("component"),o=n.value();return s.hotkeys.store(t,o)}return t}(),resetDefaults:function(){function t(){var t=e.data.contextName,n={title:"Reset Shortcuts to Default",message:"Are you sure you want to reset all the shortcuts to their defaults?"};return s.ui.showDialog("dialogConfirm",n).then(function(){return s.hotkeys.resetDefauls(t)})}return t}()};var t=function e(t,n){return a.range(t,n+1)};e.allowedKeys=a.union(t(32,40),t(48,57),t(65,90),t(112,121),[123]),e.updateInputText=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=i(t.currentTarget),r=e.getKeysPressedArray(t);if(n){var a=jQuery.hotkeys.specialKeys[t.which],s=a||t.key;r.push(s.toUpperCase())}o.val(r.join("+"))},e.getKeysPressedArray=function(e){var t=[];return e.ctrlKey&&!e.altKey&&t.push("CTRL"),e.shiftKey&&!e.altKey&&t.push("SHIFT"),e.altKey&&!e.ctrlKey&&t.push("ALT"),t},e.getConflictingCommand=function(t,n){var o=e.$("form").first().data("component"),r=o.value(),i="";return a.each(r,function(e,o){e&&e===n&&o!==t&&(i=o)}),i},e.disallowedCombinations={"":[],ALT:["SPACE"],SHIFT:[],CTRL:["F4","F5","F11","W","R","T","O","P","A","S","D","F","G","H","J","L","Z","X","C","V","B","N","PAGEDOWN","PAGEUP"],"CTRL+SHIFT":["Q","W","R","T","P","A","H","V","B","N"]}}),r.hotkeysForm.events({"keydown .hotkey":function(){function e(e,t){t.allowedKeys.indexOf(e.keyCode)>-1?(t.updateInputText(e,!0),i(e.currentTarget).trigger("hotkeyChange")):t.updateInputText(e),e.preventDefault()}return e}(),"hotkeyChange .hotkey":function(){function e(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=i(e.currentTarget),u=a.val(),c=u.split("+"),l=c.pop(),f=c.join("+"),m=["CTRL","ALT","SHIFT"].indexOf(l)>-1,p=a.data("component"),h=t.getConflictingCommand(this.key,u);if(m)p.error("It's not possible to define only modifier keys (CTRL, ALT and SHIFT) as a shortcut"),a.val("").focus();else if(t.disallowedCombinations[f].indexOf(l)>-1)p.error('The "'+u+'" shortcut combination is not allowed'),a.val("").focus();else if(h){var y=function(){if(r.blurTrigger)return{v:void 0};p.error(!1),p.toggleTooltip(!1);var o=a.closest(".hotkeys-left").length?"right":"left",i=s.commands.getContext(t.data.contextName),c={conflictedFunctionName:i[h].name,newFunctionName:i[n.key].name,hotkeyCombination:u},l={event:e,placement:o},f=t.$("form").first().data("component").item(h);p.state("error",!0),f.state("error",!0);var m=function(){function e(){t.popoverVisible=!1,p.state("error",!1),f.state("error",!1)}return e}(),y="hotkeysConfirmReplacementPopover";t.popoverVisible=!0,s.ui.showPopover(y,c,l).then(function(){m(),p.value(u),f.value(""),a.blur()}).catch(function(){m(),a.val("").focus()})}();if("object"===("undefined"==typeof y?"undefined":o(y)))return y.v}else p.error(!1),r.blurTrigger||a.blur()}return e}(),"blur .hotkey":function(){function e(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};i(e.currentTarget).trigger("hotkeyChange",{blurTrigger:!0})}return e}(),"keyup .hotkey":function(){function e(e,t){t.popoverVisible||t.updateInputText(e)}return e}()}),r.hotkeysForm.helpers({getHotkeyInputInformationLists:function(){function e(){s.hotkeys.changeObserver.depend();var e=r.instance(),t=e.data.contextName,n=s.hotkeys.getContext(t),o=s.commands.getContext(t);if(!n||!o)return{};var i=n.definitions,a=Object.keys(s.hotkeys.defaults[t]||{}),u=[];a.forEach(function(e){var t=o[e];t&&u.push({key:e,label:t.name,value:i[e]||""})});var c=u.splice(0,Math.ceil(u.length/2)),l=u;return{left:c,right:l}}return e}()})}],"formTable.html":["./template.formTable.js",function(e,t,n){n.exports=e("./template.formTable.js")}],"template.formTable.js":function(){o.__checkName("hotkeysFormTable"),o.hotkeysFormTable=new o("Template.hotkeysFormTable",function(){var e=this;return x.TABLE({class:"full-width"},"\n ",x.THEAD("\n ",x.TR("\n ",x.TH({class:"text-right p-r-1"},"Function"),"\n ",x.TH("Shortcut"),"\n "),"\n "),"\n ",x.TBODY("\n ",g.Each(function(){return{_sequence:T.call(T.dot(e.lookup("."),"inputs")),_variable:"input"}},function(){return["\n ",x.TR("\n ",x.TD({class:"text-right p-r-1"},g.View("lookup:getLabel",function(){return T.mustache(e.lookup("getLabel"),e.lookup("input"))})),"\n ",x.TD({width:"200"},g._TemplateWith(function(){return T.dataMustache(e.lookup("extend"),T.kw({class:"hotkey text-center",key:T.dot(e.lookup("input"),"key"),value:T.dot(e.lookup("input"),"value")}))},function(){return T.include(e.lookupTemplate("inputText"))})),"\n "),"\n "]}),"\n "),"\n ")})},"formTable.js":["meteor/templating","meteor/ohif:core",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}});var r;n.import("meteor/ohif:core",{OHIF:function(e){r=e}}),o.hotkeysFormTable.helpers({getLabel:function(){function e(e){var t=e.label;if(0===e.key.indexOf("WLPreset")){var n=parseInt(e.key.replace("WLPreset","")),o=r.viewer.wlPresets[n];o.id&&(t+=" ("+o.id+")")}return t}return e}()})}],"index.js":["./confirmReplacementPopover.html","./form.html","./form.js","./formTable.html","./formTable.js",function(e,t,n){n.import("./confirmReplacementPopover.html"),n.import("./form.html"),n.import("./form.js"),n.import("./formTable.html"),n.import("./formTable.js")}]},lib:{"index.js":["./routes",function(e,t,n){n.import("./routes")}],"routes.js":["meteor/iron:router","meteor/session","meteor/ohif:hotkeys",function(e,t,n){var o;n.import("meteor/iron:router",{Router:function(e){o=e}});var r;n.import("meteor/session",{Session:function(e){r=e}});var i;n.import("meteor/ohif:hotkeys",{hotkeys:function(e){i=e}}),o.onBeforeAction(function(){var e=r.get("lastRoute"),t=this.router.current().route.getName();t!==e&&(i.switchToContext(null),r.set("lastRoute",t)),this.next()})}]}},node_modules:{"jquery.hotkeys":{"package.json":function(e,t){t.name="jquery.hotkeys",t.version="0.1.0",t.main="jquery.hotkeys.js"},"jquery.hotkeys.js":function(){!function(e){function t(t){if("string"==typeof t.data&&(t.data={keys:t.data}),t.data&&t.data.keys&&"string"==typeof t.data.keys){var n=t.handler,o=t.data.keys.toLowerCase().split(" ");t.handler=function(t){if(this===t.target||!(e.hotkeys.options.filterInputAcceptingElements&&e.hotkeys.textInputTypes.test(t.target.nodeName)||e.hotkeys.options.filterContentEditable&&e(t.target).attr("contenteditable")||e.hotkeys.options.filterTextInputs&&e.inArray(t.target.type,e.hotkeys.textAcceptingInputTypes)>-1)){var r="keypress"!==t.type&&e.hotkeys.specialKeys[t.which],i=String.fromCharCode(t.which).toLowerCase(),a="",s={};e.each(["alt","ctrl","shift"],function(e,n){t[n+"Key"]&&r!==n&&(a+=n+"+")}),t.metaKey&&!t.ctrlKey&&"meta"!==r&&(a+="meta+"),t.metaKey&&"meta"!==r&&a.indexOf("alt+ctrl+shift+")>-1&&(a=a.replace("alt+ctrl+shift+","hyper+")),r?s[a+r]=!0:(s[a+i]=!0,s[a+e.hotkeys.shiftNums[i]]=!0,"shift+"===a&&(s[e.hotkeys.shiftNums[i]]=!0));for(var u=0,c=o.length;u<c;u++)if(s[o[u]])return n.apply(this,arguments)}}}}e.hotkeys={version:"0.2.0",specialKeys:{8:"backspace",9:"tab",10:"return",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",59:";",61:"=",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},shiftNums:{"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"},textAcceptingInputTypes:["text","password","number","email","url","range","date","month","week","time","datetime","datetime-local","search","color","tel"],textInputTypes:/textarea|input|select/i,options:{filterInputAcceptingElements:!0,filterTextInputs:!0,filterContentEditable:!0}},e.each(["keydown","keyup","keypress"],function(){e.event.special[this]={add:t}})}(jQuery||this.jQuery||window.jQuery)}}}}}}},{extensions:[".js",".json",".html"]}),w=C("./node_modules/meteor/ohif:hotkeys/main.js");C("./node_modules/meteor/ohif:hotkeys/client/index.js"),"undefined"==typeof Package&&(Package={}),Package["ohif:hotkeys"]=w}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,n=Package.meteor.meteorEnv,o=Package.http.HTTP,r=Package.jquery.$,i=Package.jquery.jQuery,a=Package["momentjs:moment"].moment,s=Package.validatejs.validate,c=Package["u2622:persistent-session"].PersistentSession,u=Package.modules.meteorInstall,l=Package.modules.Buffer,d=Package.modules.process,m=Package["ecmascript-runtime"].Symbol,p=Package["ecmascript-runtime"].Map,f=Package["ecmascript-runtime"].Set,g=Package["babel-runtime"].meteorBabelHelpers,x=Package.promise.Promise,h=Package.webapp.WebApp,v=Package.logging.Log,S=Package.deps.Tracker,y=Package.deps.Deps,I=Package.session.Session,T=Package["ddp-client"].DDP,b=Package.mongo.Mongo,D=Package.ui.Blaze,w=Package.ui.UI,C=Package.ui.Handlebars,P=Package.spacebars.Spacebars,k=Package["templating-runtime"].Template,R=Package.check.check,V=Package.check.Match,O=Package.underscore._,M=Package.random.Random,A=Package.ejson.EJSON,q=Package["launch-screen"].LaunchScreen,L=Package.htmljs.HTML,N,E,F,B=u({node_modules:{meteor:{"ohif:viewerbase":{client:{components:{basic:{layout:{"template.layout.js":function(){k.__checkName("layout"),k.layout=new k("Template.layout",function(){var e=this;return P.include(e.lookupTemplate("yield"))})}},loadingText:{"template.loadingText.js":function(){k.__checkName("loadingText"),k.loadingText=new k("Template.loadingText",function(){var e=this;return L.Raw('<div class="loadingTextDiv">\n Loading... <i class="fa fa-spin fa-circle-o-notch fa-fw"></i>\n </div>')})}},removableBackdrop:{"template.removableBackdrop.js":function(){k.__checkName("removableBackdrop"),k.removableBackdrop=new k("Template.removableBackdrop",function(){var e=this;return L.Raw('<div class="removableBackdrop noselect" oncontextmenu="return false;" unselectable="on" onselectstart="return false;">\n </div>')})}},aboutModal:{"template.aboutModal.js":function(){k.__checkName("aboutModal"),k.aboutModal=new k("Template.aboutModal",function(){var e=this;return D._TemplateWith(function(){return P.dataMustache(e.lookup("extend"),e.lookup("."),P.kw({id:"aboutModal",dialogClass:"modal-lg",title:"About"}))},function(){return P.include(e.lookupTemplate("dialogSimple"),function(){return["\n ",L.A({target:"_blank",class:"forkOnGithub",href:function(){return P.mustache(e.lookup("githubUrl"))}},"\n ",L.IMG({src:"https://camo.githubusercontent.com/365986a132ccd6a44c23a9169022c0b5c890c387/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67",alt:"Fork me on GitHub","data-canonical-src":"https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"}),"\n "),"\n ",L.DIV({class:"logo p-x-3 p-y-3 clearfix"},"\n ",L.SVG({class:"logoImage pull-left"},"\n ",L.USE({"xlink:href":function(){return P.mustache(e.lookup("absoluteUrl"),"packages/ohif_viewerbase/assets/icons.svg#icon-ohif-logo")}}),"\n "),"\n ",L.A({class:"logoText pull-left",target:"_blank",href:"http://ohif.org"},"\n Open Health Imaging Foundation DICOM Viewer\n "),"\n "),"\n ",L.DIV({class:"p-x-1 p-y-1 m-y-2"},"\n ",L.A({class:"btn btn-default inline",target:"_blank",href:"https://groups.google.com/forum/#!forum/cornerstone-platform"},"\n Visit the forum\n "),"\n ",L.A({class:"btn btn-default inline",target:"_blank",href:"https://github.com/OHIF/Viewers/issues"},"\n Report an issue\n "),"\n "),"\n ",L.DIV({class:"p-y-1 p-x-1"},"\n ",L.H3("Version Information"),"\n ",L.TABLE({class:"table table-responsive"},"\n ",L.THEAD("\n ",L.TR("\n ",L.TH("Name"),"\n ",L.TH("Value"),"\n "),"\n "),"\n ",L.TBODY("\n ",L.TR("\n ",L.TD("Repository URL"),"\n ",L.TD("\n ",L.A({target:"_blank",href:function(){return P.mustache(e.lookup("githubUrl"))}},D.View("lookup:githubUrl",function(){return P.mustache(e.lookup("githubUrl"))})),"\n "),"\n "),"\n ",L.TR("\n ",L.TD("Last Commit Hash"),"\n ",L.TD("\n ",L.A({target:"_blank",href:function(){return[P.mustache(e.lookup("githubUrl")),"/commit/",P.mustache(e.lookup("gitRev"),"long")]}},"\n ",D.View("lookup:gitRev",function(){return P.mustache(e.lookup("gitRev"),"long")}),"\n "),"\n "),"\n "),"\n ",L.TR("\n ",L.TD("Latest Tag"),"\n ",L.TD("\n ",L.A({target:"_blank",href:function(){return[P.mustache(e.lookup("githubUrl")),"/releases/tag/",P.mustache(e.lookup("gitRev"),"tag")]}},"\n ",D.View("lookup:gitRev",function(){return P.mustache(e.lookup("gitRev"),"tag")}),"\n "),"\n "),"\n "),"\n ",L.TR("\n ",L.TD("Branch"),"\n ",L.TD("\n ",L.A({target:"_blank",href:function(){return[P.mustache(e.lookup("githubUrl")),"/tree/",P.mustache(e.lookup("gitRev"),"branch")]}},"\n ",D.View("lookup:gitRev",function(){return P.mustache(e.lookup("gitRev"),"branch")}),"\n "),"\n "),"\n "),"\n "),"\n "),"\n "),"\n "]})})})},"aboutModal.js":function(){k.aboutModal.helpers({githubUrl:function(){function e(){return"https://github.com/OHIF/Viewers"}return e}()})}}},studyBrowser:{studyBrowser:{"template.studyBrowser.js":function(){k.__checkName("studyBrowser"),k.studyBrowser=new k("Template.studyBrowser",function(){var e=this;return L.DIV({class:"studyBrowser"},"\n ",L.DIV({class:"scrollableStudyThumbnails"},"\n ",D.Each(function(){return{_sequence:P.call(e.lookup("studies")),_variable:"study"}},function(){return["\n ",D.Each(function(){return{_sequence:P.dataMustache(e.lookup("sort"),P.dataMustache(e.lookup("studyThumbnails"),e.lookup("study")),e.lookup("thumbnailSortBy"),e.lookup("thumbnailSortType")),_variable:"thumbnail"}},function(){return["\n ",D._TemplateWith(function(){return{thumbnail:P.call(e.lookup("thumbnail"))}},function(){return P.include(e.lookupTemplate("thumbnailEntry"))}),"\n "]}),"\n "]}),"\n "),"\n ")})},"studyBrowser.js":["meteor/templating","meteor/ohif:core",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}});var r;n.import("meteor/ohif:core",{OHIF:function(e){r=e}}),o.studyBrowser.helpers({studies:function(){function e(){return r.viewer.Studies.findAllBy({selected:!0})}return e}()})}]},thumbnailEntry:{"template.thumbnailEntry.js":function(){k.__checkName("thumbnailEntry"),k.thumbnailEntry=new k("Template.thumbnailEntry",function(){var e=this;return D.Let({stack:function(){return P.call(P.dot(e.lookup("."),"thumbnail","stack"))}},function(){return["\n ",L.DIV({class:function(){return["thumbnailEntry noselect m-t-1 m-b-2 ",P.mustache(e.lookup("draggableClass"))," ",D.If(function(){return P.dataMustache(e.lookup("isDisplaySetActive"),P.dot(e.lookup("stack"),"displaySetInstanceUid"),e.lookup("viewportIndex"))},function(){return"active"})]}},"\n ",L.DIV({class:"p-x-1"},"\n ",D._TemplateWith(function(){return P.dataMustache(e.lookup("clone"),e.lookup("."))},function(){return P.include(e.lookupTemplate("imageThumbnail"))}),"\n "),"\n ",L.DIV({class:function(){return["seriesDetails clearfix m-x-1 ",D.Unless(function(){return P.call(P.dot(e.lookup("stack"),"seriesDescription"))},function(){return"info-only"})]}},"\n ",L.DIV({class:"seriesDescription"},"\n ",D.View("lookup:stack.seriesDescription",function(){return P.mustache(P.dot(e.lookup("stack"),"seriesDescription"))}),"\n "),"\n ",L.DIV({class:"seriesInformation"},"\n ",L.DIV({class:"item item-series clearfix"},"\n ",L.DIV({class:"icon"},"S:"),"\n ",L.DIV({class:"value"},D.View("lookup:stack.seriesNumber",function(){return P.mustache(P.dot(e.lookup("stack"),"seriesNumber"))})),"\n "),"\n ",D.Unless(function(){return P.dataMustache(e.lookup("isUndefined"),e.lookup("instanceNumber"))},function(){return["\n ",L.DIV({class:"item item-series clearfix"},"\n ",L.DIV({class:"icon"},"I:"),"\n ",L.DIV({class:"value"},D.View("lookup:instanceNumber",function(){return P.mustache(e.lookup("instanceNumber"))})),"\n "),"\n "]}),"\n ",L.DIV({class:"item item-frames clearfix"},"\n ",L.DIV({class:"icon"},L.DIV()),"\n ",L.DIV({class:"value"},D.View("lookup:stack.numImageFrames",function(){return P.mustache(P.dot(e.lookup("stack"),"numImageFrames"))})),"\n "),"\n "),"\n "),"\n "),"\n "]})})},"thumbnailEntry.js":["meteor/templating","meteor/underscore","meteor/session","meteor/ohif:core","../../../lib/thumbnailDragHandlers",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}});var r;n.import("meteor/underscore",{_:function(e){r=e}});var i;n.import("meteor/session",{Session:function(e){i=e}});var a;n.import("meteor/ohif:core",{OHIF:function(e){a=e}});var s;n.import("../../../lib/thumbnailDragHandlers",{thumbnailDragHandlers:function(e){s=e}}),o.thumbnailEntry.onCreated(function(){var e=o.instance();e.isDragAndDrop=r.isUndefined(e.data.viewportIndex)}),o.thumbnailEntry.events({"touchstart .thumbnailEntry, mousedown .thumbnailEntry":function(){function e(e,t){var n=t.data.thumbnail.stack;t.isDragAndDrop&&s.thumbnailDragStartHandler(e,n)}return e}(),"touchmove .thumbnailEntry":function(){function e(e,t){t.isDragAndDrop&&s.thumbnailDragHandler(e)}return e}(),"touchend .thumbnailEntry":function(){function e(e,t){var n=t.data.thumbnail.stack;t.isDragAndDrop&&s.thumbnailDragEndHandler(e,n)}return e}(),"click .thumbnailEntry":function(){function e(e,t){if(!t.isDragAndDrop){var n=t.data.thumbnail.stack;a.viewerbase.layoutManager.rerenderViewportWithNewDisplaySet(t.data.viewportIndex,n)}}return e}(),"dblclick .thumbnailEntry":function(){function e(e,t){if(t.isDragAndDrop){var n=a.viewerbase.layoutManager.getNumberOfViewports(),o=i.get("activeViewport")||0;o>=n&&(o=n>0?n-1:0);var r=t.data.thumbnail.stack;a.viewerbase.layoutManager.rerenderViewportWithNewDisplaySet(o,r)}}return e}()}),o.thumbnailEntry.helpers({draggableClass:function(){function e(){return o.instance().isDragAndDrop?"draggable":""}return e}(),instanceNumber:function(){function e(){var e=o.instance().data.thumbnail;if(e){var t=e.stack;if(t&&t.isMultiFrame){var n=t.images[0];if(n)return n.instanceNumber}}}return e}()})}]},imageThumbnail:{"template.imageThumbnail.js":function(){k.__checkName("imageThumbnail"),k.imageThumbnail=new k("Template.imageThumbnail",function(){var e=this;return L.DIV({class:"imageThumbnail"},L.Raw('\n <div class="imageThumbnailCanvas"></div>\n '),L.DIV({class:"imageThumbnailLoadingIndicator thumbnailLoadingIndicator"},"\n ",L.P("Loading ",D.View("lookup:percentComplete",function(){return P.mustache(e.lookup("percentComplete"))})),"\n "),L.Raw('\n <div class="imageThumbnailErrorLoadingIndicator thumbnailLoadingIndicator">\n <p>Error</p>\n </div>\n '),D.If(function(){return P.call(e.lookup("showStackLoadingProgressBar"))},function(){return["\n ",L.DIV({class:"imageThumbnailProgressBar"},"\n ",L.DIV({class:"imageThumbnailProgressBarInner",style:function(){return["width:",P.mustache(e.lookup("stackPercentComplete")),"%"]}}),"\n "),"\n "]}),"\n ")})},"imageThumbnail.js":["meteor/templating","meteor/tracker","meteor/session","meteor/ohif:core",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}});var r;n.import("meteor/tracker",{Tracker:function(e){r=e}});var i;n.import("meteor/session",{Session:function(e){i=e}});var a;n.import("meteor/ohif:core",{OHIF:function(e){a=e}}),o.imageThumbnail.onCreated(function(){var e=o.instance();e.getThumbnailImageId=function(){var t=e.data.thumbnail.stack,n=(t.numImageFrames||t.images.length||1)-1,o=Math.floor(n/2),r=void 0;return t.isMultiFrame?r=t.images[0]:(r=t.images[o],o=0),r.getImageId(o,!0)}}),o.imageThumbnail.onRendered(function(){var e=o.instance(),t=e.$(".imageThumbnail"),n=t.find(".imageThumbnailLoadingIndicator"),i=t.find(".imageThumbnailErrorLoadingIndicator"),a=t.find(".imageThumbnailCanvas"),s=a.get(0);e.refreshImage=function(){if(s){cornerstone.disable(s),n.css("display","block");var t=function e(t){cornerstone.enable(s),cornerstone.displayImage(s,t),n.css("display","none")},o=function e(){n.css("display","none"),i.css("display","block")},r=e.getThumbnailImageId();cornerstone.loadAndCacheImage(r).then(t,o)}},e.autorun(function(){e.data.currentStudy&&e.data.currentStudy.dep.depend(),o.currentData(),r.afterFlush(function(){return e.refreshImage()})})}),o.imageThumbnail.onDestroyed(function(){var e=o.instance(),t=e.$(".imageThumbnail"),n=t.find(".imageThumbnailCanvas"),r=n.get(0);r&&cornerstone.disable(r)}),o.imageThumbnail.helpers({percentComplete:function(){function e(){var e=o.instance(),t=a.string.encodeId(e.getThumbnailImageId()),n=i.get("CornerstoneThumbnailLoadProgress"+t);if(n&&100!==n)return n+"%"}return e}(),stackPercentComplete:function(){function e(){var e=o.instance(),t=e.data.thumbnail.stack,n=t.displaySetInstanceUid,r=i.get("StackProgress:"+n),a=r&&r.percentComplete;return a}return e}(),showStackLoadingProgressBar:function(){function e(){return a.uiSettings.showStackLoadingProgressBar}return e}()})}]}},viewer:{imageViewerViewport:{"template.imageViewerViewport.js":function(){k.__checkName("imageViewerViewport"),k.imageViewerViewport=new k("Template.imageViewerViewport",function(){var e=this;return[L.Raw('<div class="imageViewerViewport" oncontextmenu="return false;" unselectable="on" onselectstart="return false;" tabindex="0">\n </div>\n <div class="viewportInstructions">\n Please drag a stack here to view images.\n </div>\n '),P.include(e.lookupTemplate("viewportOverlay")),"\n ",P.include(e.lookupTemplate("loadingIndicator")),"\n ",P.include(e.lookupTemplate("viewportOrientationMarkers"))]})},"imageViewerViewport.js":["meteor/meteor","meteor/templating","meteor/tracker","meteor/session","meteor/random","meteor/jquery","meteor/ohif:core","../../../lib/StackManager","../../../lib/setActiveViewport","../../../lib/imageViewerViewportData","../../../lib/updateCrosshairsSynchronizer","../../../lib/toolManager","../../../lib/updateOrientationMarkers","../../../lib/instanceClassSpecificViewport","../../../lib/classes/OHIFError",function(e,t,n){var o;n.import("meteor/meteor",{Meteor:function(e){o=e}});var r;n.import("meteor/templating",{Template:function(e){r=e}});var i;n.import("meteor/tracker",{Tracker:function(e){i=e}});var a;n.import("meteor/session",{Session:function(e){a=e}});var s;n.import("meteor/random",{Random:function(e){s=e}});var c;n.import("meteor/jquery",{$:function(e){c=e}});var u;n.import("meteor/ohif:core",{OHIF:function(e){u=e}});var l;n.import("../../../lib/StackManager",{StackManager:function(e){l=e}});var d;n.import("../../../lib/setActiveViewport",{setActiveViewport:function(e){d=e}});var m;n.import("../../../lib/imageViewerViewportData",{imageViewerViewportData:function(e){m=e}});var p;n.import("../../../lib/updateCrosshairsSynchronizer",{updateCrosshairsSynchronizer:function(e){p=e}});var f;n.import("../../../lib/toolManager",{toolManager:function(e){f=e}});var g;n.import("../../../lib/updateOrientationMarkers",{updateOrientationMarkers:function(e){g=e}});var x;n.import("../../../lib/instanceClassSpecificViewport",{getInstanceClassDefaultViewport:function(e){x=e}});var h;n.import("../../../lib/classes/OHIFError",{OHIFError:function(e){h=e}});var v="click CornerstoneToolsMouseDown CornerstoneToolsMouseDownActivate CornerstoneToolsMouseClick CornerstoneToolsMouseDrag CornerstoneToolsMouseUp CornerstoneToolsMouseWheel CornerstoneToolsTap CornerstoneToolsTouchPress CornerstoneToolsTouchStart CornerstoneToolsTouchStartActive CornerstoneToolsMultiTouchDragStart",S=function e(t,n){if(u.log.info("imageViewerViewport loadDisplaySetIntoViewport"),!t.study||!t.displaySet||!t.element)return void u.log.warn("loadDisplaySetIntoViewport: No Study, Display Set, or Element provided");var o=t.element,r=c(".imageViewerViewport").index(o),i=u.viewerbase.layoutManager;if(i.viewportData=i.viewportData||{},i.viewportData[r]=i.viewportData[r]||{},i.viewportData[r].viewportIndex=r,u.viewer.data){u.viewer.data.loadedSeriesData[r]={};var h=t.displaySet,S=l.findOrCreateStack(t.study,h);S.isClip&&S.frameRate>0&&(u.viewer.cine.framesPerSecond=parseFloat(S.frameRate),a.set("UpdateCINE",s.id()));var y=S.imageIds;S={currentImageIdIndex:t.currentImageIdIndex>0&&t.currentImageIdIndex<y.length?t.currentImageIdIndex:0,imageIds:y,displaySetInstanceUid:t.displaySetInstanceUid};var I=y[S.currentImageIdIndex];n.imageId=I,window.ViewportLoading[r]=I;var T={renderer:"webgl"};cornerstone.enable(o,T);var b=cornerstoneTools.loadHandlerManager.getEndLoadHandler(),D=cornerstoneTools.loadHandlerManager.getErrorLoadingHandler(),w=cornerstone.getViewport(o),C=t.studyInstanceUid,P=t.seriesInstanceUid,k=t.displaySetInstanceUid,R=t.currentImageIdIndex;i.viewportData[r]={imageId:I,studyInstanceUid:C,seriesInstanceUid:P,displaySetInstanceUid:k,currentImageIdIndex:R,viewport:w||t.viewport,viewportIndex:r};var V=void 0;try{V=cornerstone.loadAndCacheImage(I)}catch(e){if(u.log.info(e),!V)return void D(o,I,e)}var O=u.viewer.metadataProvider,M=O&&"function"==typeof O.updateMetadata,A=m.callbacks;"function"==typeof A.before&&(u.log.info("imageViewerViewport before loadAndCacheImage callback"),A.before(V,n)),V.then(function(e){var l=void 0;try{l=cornerstone.getEnabledElement(o)}catch(e){return void u.log.warn("Viewport destroyed before loaded image could be displayed")}var m=c(o);if(l.image=e,l.viewport=cornerstone.getDefaultViewport(l.canvas,e),M&&O.updateMetadata(e),h.images&&h.images.length){var y=h.images[0],I=x(y,l,e.imageId);I?(cornerstone.displayImage(o,e,I),l.fitToWindow=!1,cornerstone.resize(o,!1)):t.viewport?(cornerstone.displayImage(o,e,t.viewport),cornerstone.resize(o,!0)):(cornerstone.displayImage(o,e),cornerstone.resize(o,!0)),delete window.ViewportLoading[r],b(o,e),o.classList.remove("empty"),m.siblings(".viewportInstructions").hide(),m.siblings(".imageViewerViewportOverlay").show(),cornerstoneTools.addStackStateManager(o,["stack","playClip","referenceLines"]),g(o),cornerstoneTools.clearToolState(o,"stack"),cornerstoneTools.addToolState(o,"stack",S);var T=y.getDataProperty("multiframeMetadata"),D=void 0;D=T&&T.averageFrameRate>0?T.averageFrameRate:u.viewer.cine.framesPerSecond;var w={loop:u.viewer.cine.loop,framesPerSecond:D};cornerstoneTools.addToolState(o,"playClip",w),T&&T.isMultiframeImage&&T.averageFrameRate>0&&cornerstoneTools.playClip(o),cornerstoneTools.mouseInput.enable(o),cornerstoneTools.touchInput.enable(o),cornerstoneTools.mouseWheelInput.enable(o),cornerstoneTools.keyboardInput.enable(o);var C=f.getActiveTool();f.setActiveTool(C,[o]);var P=function e(t,c){i.viewportData[r]||u.log.warn("onImageRendered: LayoutManager has no viewport data for this viewport index?: "+r),a.set("CornerstoneImageRendered"+r,s.id());var l=cornerstone.getViewport(o);i.viewportData[r].viewport=l,u.viewer.data.loadedSeriesData[r].viewport=l,"function"==typeof A.onImageRendered&&A.onImageRendered(t,c,r,n)};m.off("CornerstoneImageRendered",P),m.on("CornerstoneImageRendered",P),a.set("CornerstoneImageRendered"+r,s.id());var k=function e(t,o){M&&O.updateMetadata(o.enabledElement.image),n.imageId=o.enabledElement.image.imageId,a.set("CornerstoneNewImage"+r,s.id()),i.viewportData[r].imageId=o.enabledElement.image.imageId;var c=t.target,l=cornerstoneTools.getToolState(c,"stack");if(l&&l.data&&l.data.length){g(c);var d=cornerstoneTools.getToolState(c,"stack");if(d&&d.data.length&&d.data[0].imageIds.length>1){var m=d.data[0].imageIds.indexOf(n.imageId);i.viewportData[r].currentImageIdIndex=m,u.viewer.data.loadedSeriesData[r].currentImageIdIndex=m}"function"==typeof A.onNewImage&&A.onNewImage(t,o,r,n)}};m.off("CornerstoneNewImage",k),m.on("CornerstoneNewImage",k),a.set("CornerstoneNewImage"+r,s.id());var R=function e(t,n){a.set("CornerstoneNewImage"+r,s.id())};m.off("CornerstoneStackScroll",R),S.imageIds.length>1&&m.on("CornerstoneStackScroll",R);var V=function e(t,n){var o=a.get("activeViewport");if(r!==o){var i=n.element;c(i).focus(),u.log.info("imageViewerViewport sendActivationTrigger"),n.viewportIndex=r;var s=c.Event("OHIFActivateViewport",n);s.type="OHIFActivateViewport",c(t.target).trigger(s,n)}};m.off(v,V),m.on(v,V),u.viewer.data.loadedSeriesData=i.viewportData;var q=cornerstoneTools.metaData.get("imagePlane",e.imageId);q&&q.frameOfReferenceUID&&(u.viewer.updateImageSynchronizer.add(o),u.viewer.refLinesEnabled&&cornerstoneTools.referenceLines.tool.enable(o,u.viewer.updateImageSynchronizer),"crosshairs"===C&&p(q.frameOfReferenceUID)),r===a.get("activeViewport")&&d(o),t.renderedCallback&&"function"==typeof t.renderedCallback&&t.renderedCallback(o),i.updateSession(),"function"==typeof A.after&&(u.log.info("imageViewerViewport after callback"),A.after(e,n,o))}},function(e){D(o,I,e)})}},y=function e(t,n,o){var r=t.study;if(!r||!r.displaySets)throw new h("Study does not exist or has no display sets");r.displaySets.every(function(e){return e.displaySetInstanceUid!==n||(t.displaySet=e,!1)}),t.displaySet||(t.displaySet=r.displaySets[0]),S(t,o)};o.startup(function(){window.ViewportLoading=window.ViewportLoading||{},f.configureLoadProcess()}),r.imageViewerViewport.onRendered(function(){var e=r.currentData();u.log.info("imageViewerViewport onRendered");var t=this.find(".imageViewerViewport");this.element=t,c(t).siblings(".imageViewerLoadingIndicator").css("display","block");var n=a.get("activeViewport"),o=e.currentImageIdIndex,i=e.viewport,s=e.studyInstanceUid,l=e.seriesInstanceUid,d=e.renderedCallback,p=e.displaySetInstanceUid;o||(o=0),m.extendData(e);var f={element:t,viewport:i,currentImageIdIndex:o,displaySetInstanceUid:p,studyInstanceUid:s,seriesInstanceUid:l,renderedCallback:d,activeViewport:n};if(!p)return t.classList.add("empty"),c(t).siblings(".imageViewerLoadingIndicator").css("display","none"),void c(t).siblings(".viewportInstructions").show();var g=u.viewer.Studies.findBy({studyInstanceUid:s});f.study=g,y(f,p,e)}),r.imageViewerViewport.onDestroyed(function(){u.log.info("imageViewerViewport onDestroyed");var e=this.find(".imageViewerViewport"),t=c(e);if(e&&!t.hasClass("empty")&&t.find("canvas").length){cornerstoneTools.mouseInput.disable(e),cornerstoneTools.touchInput.disable(e),cornerstoneTools.mouseWheelInput.disable(e),u.viewer.updateImageSynchronizer.remove(e);var n=cornerstoneTools.getToolState(e,"stackPrefetch");n=[],cornerstoneTools.stackPrefetch.disable(e);try{var o=cornerstone.getEnabledElement(e);o&&cornerstoneTools.stopClip(e)}catch(e){u.log.warn(e)}t.trigger("OHIFDestroyedViewport"),cornerstone.disable(e)}}),r.imageViewerViewport.events({"OHIFActivateViewport .imageViewerViewport":function(){function e(e){u.log.info("imageViewerViewport OHIFActivateViewport"),d(e.currentTarget)}return e}(),"CornerstoneToolsMouseDoubleClick .imageViewerViewport, CornerstoneToolsDoubleTap .imageViewerViewport":function(){function e(e){var t=c(".imageViewerViewport").index(e.currentTarget),n=u.viewerbase.layoutManager;n.toggleEnlargement(t),i.afterFlush(function(){var e=void 0;e=n.isZoomed?0:n.zoomedViewportIndex||0;var t=c(".imageViewerViewport").get(e);d(t)})}return e}()})}]},gridLayout:{"template.gridLayout.js":function(){k.__checkName("gridLayout"),k.gridLayout=new k("Template.gridLayout",function(){var e=this;return L.DIV({id:"imageViewerViewports"},"\n ",D.Each(function(){return{_sequence:P.call(e.lookup("viewports")),_variable:"viewport"}},function(){return["\n ",L.DIV({class:function(){return["viewportContainer ",P.mustache(e.lookup("getClass"),e.lookup("@index"))]},style:function(){return["height:",P.mustache(e.lookup("height")),"%;width:",P.mustache(e.lookup("width")),"%;"]}},"\n ",L.DIV({class:"removable"},"\n ",D._TemplateWith(function(){return P.dataMustache(e.lookup("clone"),e.lookup("viewport"))},function(){return P.include(e.lookupTemplate("imageViewerViewport"))}),"\n "),"\n "),"\n "]}),"\n ")})},"gridLayout.js":["meteor/ohif:core","meteor/templating",function(e,t,n){var o;n.import("meteor/ohif:core",{OHIF:function(e){o=e}});var r;n.import("meteor/templating",{Template:function(e){r=e}});var i="top",a="bottom",s="middle";r.gridLayout.helpers({height:function(){function e(){var e=r.instance(),t=e.data.rows||1;return 100/t}return e}(),width:function(){function e(){var e=r.instance(),t=e.data.columns||1;return 100/t}return e}(),getClass:function(){function e(e){var t=this.rows,n=this.columns;if(1===t)return i+" "+a;var o=Math.floor(e/n);return 0===o?i:o+1===t?a:s}return e}(),viewports:function(){function e(){var e=r.instance(),t=e.data.rows,n=e.data.columns,o=t*n,i=e.data.viewportData,a=i.length;if(a<o)for(var s=o-a,c=0;c<s;c++)i.push({viewportIndex:a+c+1,rows:t,columns:n});else if(a>o)return i.slice(0,o);return i}return e}()})}]},loadingIndicator:{"template.loadingIndicator.js":function(){k.__checkName("loadingIndicator"),k.loadingIndicator=new k("Template.loadingIndicator",function(){var e=this;return[L.DIV({class:"imageViewerLoadingIndicator loadingIndicator"},"\n ",L.DIV({class:"indicatorContents"},"\n ",L.P("Loading... ",L.Raw('<i class="fa fa-spin fa-circle-o-notch fa-fw"></i>')," ",D.View("lookup:percentComplete",function(){return P.mustache(e.lookup("percentComplete"))})),"\n "),"\n "),L.Raw('\n <div class="imageViewerErrorLoadingIndicator loadingIndicator">\n <div class="indicatorContents">\n <h4>Error Loading Image</h4>\n <p class="description">An error has occurred.</p>\n <p class="details"></p>\n </div>\n </div>')]})},"loadingIndicator.js":["meteor/meteor","meteor/templating","meteor/jquery","meteor/ohif:core",function(e,t,n){var o;n.import("meteor/meteor",{Meteor:function(e){o=e}});var r;n.import("meteor/templating",{Template:function(e){r=e}});var i;n.import("meteor/jquery",{$:function(e){i=e}});var a;n.import("meteor/ohif:core",{OHIF:function(e){a=e}}),o.startup(function(){cornerstoneTools.loadHandlerManager&&(cornerstoneTools.loadHandlerManager.setStartLoadHandler(c),cornerstoneTools.loadHandlerManager.setEndLoadHandler(u),cornerstoneTools.loadHandlerManager.setErrorLoadingHandler(l))});var s=void 0,c=function e(t){clearTimeout(s),s=setTimeout(function(){console.log("startLoading");var e=i(t);e.siblings(".imageViewerErrorLoadingIndicator").css("display","none"),e.find("canvas").not(".magnifyTool").addClass("faded"),e.siblings(".imageViewerLoadingIndicator").css("display","block")},a.viewer.loadIndicatorDelay)},u=function e(t){clearTimeout(s);var n=i(t);n.siblings(".imageViewerErrorLoadingIndicator").css("display","none"),n.find("canvas").not(".magnifyTool").removeClass("faded"),n.siblings(".imageViewerLoadingIndicator").css("display","none")},l=function e(t,n,o,r){clearTimeout(s);var a=i(t);if(a.find("canvas").not(".magnifyTool").removeClass("faded"),a.siblings(".imageViewerLoadingIndicator").css("display","none"),"stackPrefetch"!==r){var c=a.siblings(".imageViewerErrorLoadingIndicator");c.css("display","block");var u={network:"A network error has occurred"};u.hasOwnProperty(o)&&(o=u[o]),c.find(".description").text("An error has occurred while loading image: "+n),o&&c.find(".details").text("Details: "+o)}};r.loadingIndicator.helpers({percentComplete:function(){function e(){var e=I.get("CornerstoneLoadProgress"+this.viewportIndex);if(e&&100!==e)return e+"%"}return e}()})}]},annotationDialogs:{"template.annotationDialogs.js":function(){k.__checkName("annotationDialogs"),k.annotationDialogs=new k("Template.annotationDialogs",function(){var e=this;return[L.getTag("dialog")({id:"annotationDialog",class:"annotationDialog noselect"},"\n ",L.H5("Enter your annotation"),"\n ",L.DIV({class:"annotationTextInputOptions"},"\n ",L.LABEL({for:"annotationTextInput"},"New label"),"\n ",L.INPUT({name:"annotationTextInput",class:"annotationTextInput",type:"text",tabindex:"-1",autocomplete:"off"}),"\n "),"\n ",L.A({class:"annotationDialogConfirm btn btn-sm btn-primary"},"OK"),"\n "),"\n\n ",L.getTag("dialog")({id:"relabelAnnotationDialog",class:"annotationDialog noselect",oncontextmenu:"return false"},"\n ",L.H5("Edit your annotation"),"\n ",L.DIV({class:"annotationTextInputOptions"},"\n ",L.LABEL({for:"annotationTextInput"},"New label"),"\n ",L.INPUT({name:"annotationTextInput",class:"annotationTextInput",type:"text",tabindex:"-1",autocomplete:"off"}),"\n "),"\n ",L.DIV("\n ",L.A({class:"relabelRemove btn btn-sm btn-secondary"},"Remove marker"),"\n ",L.A({class:"relabelConfirm btn btn-sm btn-primary"},"OK"),"\n "),"\n ")]})},"annotationDialogs.js":function(){k.annotationDialogs.onRendered(function(){var e=k.instance(),t=["annotationDialog","relabelAnnotationDialog"];t.forEach(function(t){var n=e.$("#"+t);n.draggable(),F.registerDialog(n.get(0))})})}},viewportOrientationMarkers:{"template.viewportOrientationMarkers.js":function(){k.__checkName("viewportOrientationMarkers"),k.viewportOrientationMarkers=new k("Template.viewportOrientationMarkers",function(){var e=this;return L.Raw('<div class="viewportOrientationMarkers noselect">\n <div class="topMid orientationMarker">\n </div>\n <div class="leftMid orientationMarker">\n </div>\n </div>')})}},viewportOverlay:{"template.viewportOverlay.js":function(){k.__checkName("viewportOverlay"),k.viewportOverlay=new k("Template.viewportOverlay",function(){var e=this;return L.DIV({class:function(){return["imageViewerViewportOverlay noselect ",D.If(function(){return P.dataMustache(e.lookup("gt"),e.lookup("numImages"),1)},function(){return"controlsVisible"})]}},"\n ",D.Unless(function(){return P.call(e.lookup("tagDisplaySpecified"))},function(){return["\n ",L.DIV({class:"topleft dicomTag"},"\n ",L.DIV(D.View("lookup:formatPN",function(){return P.mustache(e.lookup("formatPN"),e.lookup("patientName"))})),"\n ",L.DIV(D.View("lookup:patientId",function(){return P.mustache(e.lookup("patientId"))})),"\n ",L.DIV({class:"priorIndicator"},D.View("lookup:prior",function(){return P.mustache(e.lookup("prior"))})),"\n "),"\n ",L.DIV({class:"topright dicomTag"},"\n ",L.DIV(D.View("lookup:studyDescription",function(){return P.mustache(e.lookup("studyDescription"))})),"\n ",L.DIV(D.View("lookup:formatDA",function(){return P.mustache(e.lookup("formatDA"),e.lookup("studyDate"))})," ",D.View("lookup:formatTM",function(){return P.mustache(e.lookup("formatTM"),e.lookup("studyTime"))})),"\n "),"\n ",L.DIV({class:"bottomright dicomTag"
},"\n ",L.DIV(D.If(function(){return P.call(e.lookup("zoom"))},function(){return["Zoom: ",D.View("lookup:formatNumberPrecision",function(){return P.mustache(e.lookup("formatNumberPrecision"),e.lookup("zoom"),0)}),"%"]})),"\n ",L.DIV({class:"compressionIndicator"},D.View("lookup:compression",function(){return P.mustache(e.lookup("compression"))})),"\n ",L.DIV(D.View("lookup:wwwc",function(){return P.mustache(e.lookup("wwwc"))})),"\n "),"\n ",L.DIV({class:"bottomleft dicomTag"},"\n ",L.DIV(D.If(function(){return P.call(e.lookup("seriesNumber"))},function(){return["Ser: ",D.View("lookup:seriesNumber",function(){return P.mustache(e.lookup("seriesNumber"))})]})),"\n ",L.DIV(D.If(function(){return P.dataMustache(e.lookup("gt"),e.lookup("numImages"),1)},function(){return["Img: ",D.View("lookup:instanceNumber",function(){return P.mustache(e.lookup("instanceNumber"))})," (",D.View("lookup:imageIndex",function(){return P.mustache(e.lookup("imageIndex"))}),"/",D.View("lookup:numImages",function(){return P.mustache(e.lookup("numImages"))}),")"]})),"\n ",L.DIV(D.If(function(){return P.call(e.lookup("frameRate"))},function(){return[D.View("lookup:formatNumberPrecision",function(){return P.mustache(e.lookup("formatNumberPrecision"),e.lookup("frameRate"),2)})," FPS"]})),"\n ",L.DIV(D.View("lookup:imageDimensions",function(){return P.mustache(e.lookup("imageDimensions"))})),"\n ",L.DIV("\n ",L.SPAN(D.If(function(){return P.dataMustache(e.lookup("isValidNumber"),e.lookup("location"))},function(){return["Loc: ",D.View("lookup:formatNumberPrecision",function(){return P.mustache(e.lookup("formatNumberPrecision"),e.lookup("location"),2)})," mm"]})),"\n ",L.SPAN(D.If(function(){return P.call(e.lookup("thickness"))},function(){return["Thick: ",D.View("lookup:formatNumberPrecision",function(){return P.mustache(e.lookup("formatNumberPrecision"),e.lookup("thickness"),2)})," mm"]})),"\n ",L.SPAN(D.If(function(){return P.call(e.lookup("spacingBetweenSlices"))},function(){return["Spacing: ",D.View("lookup:formatNumberPrecision",function(){return P.mustache(e.lookup("formatNumberPrecision"),e.lookup("spacingBetweenSlices"),2)})," mm"]})),"\n "),"\n ",L.DIV(D.View("lookup:seriesDescription",function(){return P.mustache(e.lookup("seriesDescription"))})),"\n "),"\n "]}),"\n\n ",D.If(function(){return P.call(e.lookup("tagDisplayRightOnly"))},function(){return["\n ",L.DIV({class:"topright dicomTag"},"\n ",L.DIV(D.View("lookup:formatPN",function(){return P.mustache(e.lookup("formatPN"),e.lookup("patientName"))})),"\n ",L.DIV(D.View("lookup:patientId",function(){return P.mustache(e.lookup("patientId"))})),"\n ",L.DIV({class:"priorIndicator"},D.View("lookup:prior",function(){return P.mustache(e.lookup("prior"))})),"\n ",L.DIV(D.View("lookup:studyDescription",function(){return P.mustache(e.lookup("studyDescription"))})),"\n ",L.DIV(D.View("lookup:formatDA",function(){return P.mustache(e.lookup("formatDA"),e.lookup("studyDate"))})," ",D.View("lookup:formatTM",function(){return P.mustache(e.lookup("formatTM"),e.lookup("studyTime"))})),"\n "),"\n ",L.DIV({class:"bottomright dicomTag"},"\n ",L.DIV(D.If(function(){return P.call(e.lookup("seriesNumber"))},function(){return["Ser: ",D.View("lookup:seriesNumber",function(){return P.mustache(e.lookup("seriesNumber"))})]})),"\n ",L.DIV(D.If(function(){return P.dataMustache(e.lookup("gt"),e.lookup("numImages"),1)},function(){return["Img: ",D.View("lookup:instanceNumber",function(){return P.mustache(e.lookup("instanceNumber"))})," (",D.View("lookup:imageIndex",function(){return P.mustache(e.lookup("imageIndex"))}),"/",D.View("lookup:numImages",function(){return P.mustache(e.lookup("numImages"))}),")"]})),"\n ",L.DIV(D.If(function(){return P.call(e.lookup("frameRate"))},function(){return[D.View("lookup:formatNumberPrecision",function(){return P.mustache(e.lookup("formatNumberPrecision"),e.lookup("frameRate"),2)})," FPS"]})),"\n ",L.DIV(D.View("lookup:imageDimensions",function(){return P.mustache(e.lookup("imageDimensions"))})),"\n ",L.DIV(D.View("lookup:seriesDescription",function(){return P.mustache(e.lookup("seriesDescription"))})),"\n ",L.DIV(D.If(function(){return P.call(e.lookup("zoom"))},function(){return["Zoom: ",D.View("lookup:formatNumberPrecision",function(){return P.mustache(e.lookup("formatNumberPrecision"),e.lookup("zoom"),0)}),"%"]})),"\n ",L.DIV({class:"compressionIndicator"},D.View("lookup:compression",function(){return P.mustache(e.lookup("compression"))})),"\n ",L.DIV(D.View("lookup:wwwc",function(){return P.mustache(e.lookup("wwwc"))})),"\n "),"\n "]}),"\n\n ",D.If(function(){return P.call(e.lookup("tagDisplayLeftOnly"))},function(){return["\n ",L.DIV({class:"topleft dicomTag"},"\n ",L.DIV(D.View("lookup:formatPN",function(){return P.mustache(e.lookup("formatPN"),e.lookup("patientName"))})),"\n ",L.DIV(D.View("lookup:patientId",function(){return P.mustache(e.lookup("patientId"))})),"\n ",L.DIV({class:"priorIndicator"},D.View("lookup:prior",function(){return P.mustache(e.lookup("prior"))})),"\n ",L.DIV(D.View("lookup:studyDescription",function(){return P.mustache(e.lookup("studyDescription"))})),"\n ",L.DIV(D.View("lookup:formatDA",function(){return P.mustache(e.lookup("formatDA"),e.lookup("studyDate"))})," ",D.View("lookup:formatTM",function(){return P.mustache(e.lookup("formatTM"),e.lookup("studyTime"))})),"\n "),"\n ",L.DIV({class:"bottomleft dicomTag"},"\n ",L.DIV(D.If(function(){return P.call(e.lookup("seriesNumber"))},function(){return["Ser: ",D.View("lookup:seriesNumber",function(){return P.mustache(e.lookup("seriesNumber"))})]})),"\n ",L.DIV(D.If(function(){return P.dataMustache(e.lookup("gt"),e.lookup("numImages"),1)},function(){return["Img: ",D.View("lookup:instanceNumber",function(){return P.mustache(e.lookup("instanceNumber"))})," (",D.View("lookup:imageIndex",function(){return P.mustache(e.lookup("imageIndex"))}),"/",D.View("lookup:numImages",function(){return P.mustache(e.lookup("numImages"))}),")"]})),"\n ",L.DIV(D.If(function(){return P.call(e.lookup("frameRate"))},function(){return[D.View("lookup:formatNumberPrecision",function(){return P.mustache(e.lookup("formatNumberPrecision"),e.lookup("frameRate"),2)})," FPS"]})),"\n ",L.DIV(D.View("lookup:imageDimensions",function(){return P.mustache(e.lookup("imageDimensions"))})),"\n ",L.DIV(D.View("lookup:seriesDescription",function(){return P.mustache(e.lookup("seriesDescription"))})),"\n ",L.DIV(D.If(function(){return P.call(e.lookup("zoom"))},function(){return["Zoom: ",D.View("lookup:formatNumberPrecision",function(){return P.mustache(e.lookup("formatNumberPrecision"),e.lookup("zoom"),0)}),"%"]})),"\n ",L.DIV({class:"compressionIndicator"},D.View("lookup:compression",function(){return P.mustache(e.lookup("compression"))})),"\n ",L.DIV(D.View("lookup:wwwc",function(){return P.mustache(e.lookup("wwwc"))})),"\n "),"\n "]}),"\n\n ",D.If(function(){return P.dataMustache(e.lookup("gt"),e.lookup("numImages"),1)},function(){return["\n ",D._TemplateWith(function(){return{imageIndex:P.call(e.lookup("imageIndex")),numImages:P.call(e.lookup("numImages"))}},function(){return P.include(e.lookupTemplate("imageControls"))}),"\n "]}),"\n ")})},"viewportOverlay.js":["meteor/templating","meteor/session","meteor/ohif:core","../../../lib/viewportOverlayUtils","../../../lib/getElementIfNotEmpty","../../../lib/getStackDataIfNotEmpty",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}});var r;n.import("meteor/session",{Session:function(e){r=e}});var i;n.import("meteor/ohif:core",{OHIF:function(e){i=e}});var a;n.import("../../../lib/viewportOverlayUtils",{viewportOverlayUtils:function(e){a=e}});var s;n.import("../../../lib/getElementIfNotEmpty",{getElementIfNotEmpty:function(e){s=e}});var c;n.import("../../../lib/getStackDataIfNotEmpty",{getStackDataIfNotEmpty:function(e){c=e}}),o.viewportOverlay.helpers({wwwc:function(){function e(){r.get("CornerstoneImageRendered"+this.viewportIndex);var e=s(this.viewportIndex);if(!e)return"";var t=cornerstone.getViewport(e);return t?"W "+t.voi.windowWidth.toFixed(0)+" L "+t.voi.windowCenter.toFixed(0):""}return e}(),zoom:function(){function e(){r.get("CornerstoneImageRendered"+this.viewportIndex);var e=s(this.viewportIndex);if(e){var t=cornerstone.getViewport(e);if(t)return 100*t.scale}}return e}(),imageDimensions:function(){function e(){r.get("CornerstoneNewImage"+this.viewportIndex);var e=a.getImage(this.viewportIndex);return e?e.width+" x "+e.height:""}return e}(),patientName:function(){function e(){return r.get("CornerstoneNewImage"+this.viewportIndex),a.getPatient.call(this,"name")}return e}(),patientId:function(){function e(){return r.get("CornerstoneNewImage"+this.viewportIndex),a.getPatient.call(this,"id")}return e}(),patientBirthDate:function(){function e(){return r.get("CornerstoneNewImage"+this.viewportIndex),a.getPatient.call(this,"birthDate")}return e}(),patientSex:function(){function e(){return r.get("CornerstoneNewImage"+this.viewportIndex),a.getPatient.call(this,"sex")}return e}(),studyDate:function(){function e(){return r.get("CornerstoneNewImage"+this.viewportIndex),a.getStudy.call(this,"studyDate")}return e}(),studyTime:function(){function e(){return r.get("CornerstoneNewImage"+this.viewportIndex),a.getStudy.call(this,"studyTime")}return e}(),studyDescription:function(){function e(){return r.get("CornerstoneNewImage"+this.viewportIndex),a.getStudy.call(this,"studyDescription")}return e}(),seriesDescription:function(){function e(){return r.get("CornerstoneNewImage"+this.viewportIndex),a.getSeries.call(this,"seriesDescription")}return e}(),frameRate:function(){function e(){r.get("CornerstoneNewImage"+this.viewportIndex);var e=a.getInstance.call(this,"frameTime");if(e){var t=1e3/e;return t.toFixed(1)}}return e}(),seriesNumber:function(){function e(){return r.get("CornerstoneNewImage"+this.viewportIndex),a.getSeries.call(this,"seriesNumber")}return e}(),instanceNumber:function(){function e(){return r.get("CornerstoneNewImage"+this.viewportIndex),a.getInstance.call(this,"instanceNumber")}return e}(),thickness:function(){function e(){return r.get("CornerstoneNewImage"+this.viewportIndex),a.getInstance.call(this,"sliceThickness")}return e}(),location:function(){function e(){r.get("CornerstoneNewImage"+this.viewportIndex);var e=a.getInstance.call(this,"sliceLocation");if(""!==e)return e;var t=a.getInstance.call(this,"tablePosition");return""!==t?t:a.getInstance.call(this,"imagePositionPatient")}return e}(),spacingBetweenSlices:function(){function e(){return r.get("CornerstoneNewImage"+this.viewportIndex),a.getInstance.call(this,"spacingBetweenSlices")}return e}(),compression:function(){function e(){if(r.get("CornerstoneNewImage"+this.viewportIndex),!this.imageId)return!1;var e=cornerstoneTools.metaData.get("instance",this.imageId);if(!e)return"";if("01"===e.lossyImageCompression&&""!==e.lossyImageCompressionRatio){var t=e.lossyImageCompressionMethod||"Lossy: ",n=parseFloat(e.lossyImageCompressionRatio).toFixed(2);return t+n+" : 1"}return"Lossless / Uncompressed"}return e}(),tagDisplayLeftOnly:function(){function e(){return r.get("CornerstoneNewImage"+this.viewportIndex),"L"===a.getTagDisplay.call(this,"side")}return e}(),tagDisplayRightOnly:function(){function e(){return r.get("CornerstoneNewImage"+this.viewportIndex),"R"===a.getTagDisplay.call(this,"side")}return e}(),tagDisplaySpecified:function(){function e(){return r.get("CornerstoneNewImage"+this.viewportIndex),a.getTagDisplay.call(this,"side")}return e}(),imageNumber:function(){function e(){return r.get("CornerstoneNewImage"+this.viewportIndex),a.getInstance.call(this,"number")}return e}(),imageIndex:function(){function e(){r.get("CornerstoneNewImage"+this.viewportIndex);var e=c(this.viewportIndex);if(e&&void 0!==e.currentImageIdIndex)return e.currentImageIdIndex+1}return e}(),numImages:function(){function e(){r.get("CornerstoneNewImage"+this.viewportIndex);var e=c(this.viewportIndex);if(e&&e.imageIds)return e.imageIds.length}return e}(),prior:function(){function e(){if(r.get("CornerstoneNewImage"+this.viewportIndex),this.imageId){var e=i.viewer.Studies.all();if(!(e.length<2)){var t=O.sortBy(e,function(e){return a.formatDateTime(e.studyDate,e.studyTime)}),n=cornerstoneTools.metaData.get("study",this.imageId);if(n){var o=t[0];return a.formatDateTime(n.studyDate,n.studyTime)<=a.formatDateTime(o.studyDate,o.studyTime)?"Prior":void 0}}}}return e}()})}]},viewerMain:{"template.viewerMain.js":function(){k.__checkName("viewerMain"),k.viewerMain=new k("Template.viewerMain",function(){var e=this;return L.Raw('<div class="viewerMain">\n <div id="layoutManagerTarget">\n </div>\n </div>')})},"viewerMain.js":["meteor/meteor","meteor/templating","meteor/session","meteor/random","meteor/ohif:core","../../../lib/unloadHandlers","../../../lib/hotkeyUtils","../../../lib/classes/ResizeViewportManager","../../../lib/classes/LayoutManager","../../../lib/classes/StudyPrefetcher","../../../lib/classes/StudyLoadingListener",function(e,t,n){var o;n.import("meteor/meteor",{Meteor:function(e){o=e}});var r;n.import("meteor/templating",{Template:function(e){r=e}});var i;n.import("meteor/session",{Session:function(e){i=e}});var a;n.import("meteor/random",{Random:function(e){a=e}});var s;n.import("meteor/ohif:core",{OHIF:function(e){s=e}});var c;n.import("../../../lib/unloadHandlers",{unloadHandlers:function(e){c=e}});var u;n.import("../../../lib/hotkeyUtils",{hotkeyUtils:function(e){u=e}});var l;n.import("../../../lib/classes/ResizeViewportManager",{ResizeViewportManager:function(e){l=e}});var d;n.import("../../../lib/classes/LayoutManager",{LayoutManager:function(e){d=e}});var m;n.import("../../../lib/classes/StudyPrefetcher",{StudyPrefetcher:function(e){m=e}});var p;n.import("../../../lib/classes/StudyLoadingListener",{StudyLoadingListener:function(e){p=e}}),o.startup(function(){window.ResizeViewportManager=window.ResizeViewportManager||new l,i.set("OHIFViewerMainRendered",!1)}),r.viewerMain.onCreated(function(){window.addEventListener("resize",window.ResizeViewportManager.getResizeHandler()),window.addEventListener("beforeunload",c.beforeUnload)}),r.viewerMain.onRendered(function(){var e=r.instance(),t=e.data.studies,n=e.$("#layoutManagerTarget").get(0),o=m.getInstance();e.studyPrefetcher=o;var c=p.getInstance();c.clear(),c.addStudies(t),s.viewerbase.layoutManager=new d(n,t),o.setStudies(t),i.set("OHIFViewerMainRendered",a.id())}),r.viewerMain.onDestroyed(function(){var e=r.instance();s.log.info("viewerMain onDestroyed"),window.removeEventListener("resize",window.ResizeViewportManager.getResizeHandler()),window.removeEventListener("beforeunload",c.beforeUnload),s.viewer.updateImageSynchronizer.destroy(),delete s.viewerbase.layoutManager,N=null,i.set("OHIFViewerMainRendered",!1),e.studyPrefetcher.destroy()})}]},imageControls:{"template.imageControls.js":function(){k.__checkName("imageControls"),k.imageControls=new k("Template.imageControls",function(){var e=this;return L.DIV({class:"imageControls"},"\n ",L.DIV({class:"scrollbar"},"\n ",L.INPUT({class:"imageSlider",type:"range",min:"1",value:function(){return P.mustache(e.lookup("imageIndex"))},max:function(){return P.mustache(e.lookup("numImages"))}}),"\n "),"\n ")})},"imageControls.js":["meteor/templating","meteor/jquery","meteor/ohif:core","../../../lib/setActiveViewport","../../../lib/switchToImageByIndex",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}});var r;n.import("meteor/jquery",{$:function(e){r=e}});var i;n.import("meteor/ohif:core",{OHIF:function(e){i=e}});var a;n.import("../../../lib/setActiveViewport",{setActiveViewport:function(e){a=e}});var s;n.import("../../../lib/switchToImageByIndex",{switchToImageByIndex:function(e){s=e}});var c=40,u=void 0;o.imageControls.onRendered(function(){var e=o.instance(),t=e.$(".imageSlider"),n=t.parents().eq(2).siblings(".imageViewerViewport"),r=n.height();t.width(r-20)}),o.imageControls.events({"keydown input[type=range]":function(){function e(e){var t={DOWN:40,UP:38};e.which===t.DOWN?(i.commands.run("scrollDown"),e.preventDefault()):e.which===t.UP&&(i.commands.run("scrollUp"),e.preventDefault())}return e}(),"input input[type=range], change input[type=range]":function(){function e(e){return clearTimeout(u),u=setTimeout(function(){var t=r(e.currentTarget),n=t.parents(".viewportContainer").find(".imageViewerViewport");a(n);var o=parseInt(t.val(),10)-1;s(o)},c),!1}return e}()})}]},layoutButton:{"template.layoutButton.js":function(){k.__checkName("layoutButton"),k.layoutButton=new k("Template.layoutButton",function(){var e=this;return L.DIV({id:function(){return P.mustache(P.dot(e.lookup("."),"id"))},class:function(){return["toolbarSectionButton rp-x-1 ",P.mustache(P.dot(e.lookup("."),"classes"))," ",P.mustache(e.lookup("activeClass"))," js-dropdown-toggle"]},title:function(){return P.mustache(P.dot(e.lookup("."),"title"))},"data-target":"#layoutChooser"},"\n ",L.DIV({class:"svgContainer"},"\n ",D.If(function(){return P.call(P.dot(e.lookup("."),"svgLink"))},function(){return["\n ",L.SVG("\n ",L.USE({"xlink:href":function(){return P.mustache(e.lookup("absoluteUrl"),P.dot(e.lookup("."),"svgLink"))}}),"\n "),"\n "]},function(){return["\n ",L.I({class:function(){return P.mustache(e.lookup("iconClasses"))}}),"\n "]}),"\n "),"\n ",L.DIV({class:"buttonLabel"},"\n ",D.View("lookup:..title",function(){return P.mustache(P.dot(e.lookup("."),"title"))}),"\n "),"\n ")})},"layoutButton.js":["meteor/templating","meteor/jquery","../../../lib/viewportUtils",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}});var r;n.import("meteor/jquery",{$:function(e){r=e}});var i;n.import("../../../lib/viewportUtils",{viewportUtils:function(e){i=e}}),o.layoutButton.events({"mousedown .js-dropdown-toggle":function(){function e(e){var t=r(e.currentTarget),n=r(t.data("target"));n.css({top:t.offset().top+t.outerHeight()+"px",left:t.offset().left+"px"}),i.toggleDialog(n)}return e}()})}]},layoutChooser:{"template.layoutChooser.js":function(){k.__checkName("layoutChooser"),k.layoutChooser=new k("Template.layoutChooser",function(){var e=this;return L.DIV({id:"layoutChooser",class:"layoutChooser dialog-animated"},"\n ",L.TABLE("\n ",L.TR("\n ",L.TD(),"\n ",L.TD(),"\n ",L.TD(),"\n ",L.TD(),"\n "),"\n ",L.TR("\n ",L.TD(),"\n ",L.TD(),"\n ",L.TD(),"\n ",L.TD(),"\n "),"\n ",L.TR("\n ",L.TD(),"\n ",L.TD(),"\n ",L.TD(),"\n ",L.TD(),"\n "),"\n ",L.TR("\n ",L.TD(),"\n ",L.TD(),"\n ",L.TD(),"\n ",L.TD(),"\n "),"\n "),"\n ")})},"layoutChooser.js":["meteor/templating","meteor/session","meteor/ohif:core","meteor/ohif:viewerbase","../../../lib/viewportUtils",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}});var r;n.import("meteor/session",{Session:function(e){r=e}});var i;n.import("meteor/ohif:core",{OHIF:function(e){i=e}}),n.import("meteor/ohif:viewerbase");var a;n.import("../../../lib/viewportUtils",{viewportUtils:function(e){a=e}});var s=this;o.layoutChooser.onRendered(function(){var e=o.instance();e.highlightCells=function(e){var t=s.$(".layoutChooser table td");t.removeClass("hover"),e=s.$(e);for(var n=e.parents(".layoutChooser table").get(0),o=e.closest("tr").index(),r=e.index(),i=n.rows.length-1;i>=0;i--){var a=n.rows[i];if(i<=o)for(var c=a.cells.length-1;c>=0;c--)if(c<=r){var u=a.cells[c];u.classList.add("hover")}}},e.refreshHighlights=function(){if(i.viewerbase.layoutManager){var t=i.viewerbase.layoutManager.layoutProps,n=e.$("tr").eq(t.rows-1).children().eq(t.columns-1);e.highlightCells(n)}},e.autorun(function(){r.get("LayoutManagerUpdated"),e.refreshHighlights()})}),o.layoutChooser.events({"touchstart .layoutChooser table td, mouseenter .layoutChooser table td":function(){function e(e,t){t.highlightCells(e.currentTarget)}return e}(),"mouseleave .layoutChooser":function(){function e(e,t){t.refreshHighlights()}return e}(),"click .layoutChooser table td":function(){function e(e,t){var n=t.$(e.currentTarget),o=n.closest("tr").index(),r=n.index(),s={rows:o+1,columns:r+1};i.viewerbase.layoutManager.layoutTemplateName="gridLayout",i.viewerbase.layoutManager.layoutProps=s,i.viewerbase.layoutManager.updateViewports();var c=t.$(".layoutChooser");a.toggleDialog(c)}return e}()})}]},cineDialog:{"template.cineDialog.js":function(){k.__checkName("cineDialog"),k.cineDialog=new k("Template.cineDialog",function(){var e=this;return L.getTag("dialog")({id:"cineDialog"},"\n ",D._TemplateWith(function(){return{id:P.call("cineDialogForm"),class:P.call(P.dataMustache(e.lookup("getClassNames"),"dialog-animated noselect")),schema:P.call(P.dot(e.lookup("instance"),"schema")),api:P.call(P.dot(e.lookup("instance"),"api"))}},function(){return P.include(e.lookupTemplate("form"),function(){return["\n ",D._TemplateWith(function(){return{key:P.call("intervalId")}},function(){return P.include(e.lookupTemplate("inputHidden"))}),"\n ",L.DIV({class:"cine-navigation"},"\n ",L.DIV({class:"btn-group"},"\n ",D._TemplateWith(function(){return{class:P.call("btn"),disabled:P.call(P.dataMustache(e.lookup("displaySetDisabled"),!1)),action:P.call("displaySetPrevious"),title:P.call("Previous display set")}},function(){return P.include(e.lookupTemplate("button"),function(){return["\n ",L.I({class:"fa fa-toggle-up"}),"\n "]})}),"\n ",D._TemplateWith(function(){return{class:P.call("btn"),disabled:P.call(P.dataMustache(e.lookup("displaySetDisabled"),!0)),action:P.call("displaySetNext"),title:P.call("Next display set")}},function(){return P.include(e.lookupTemplate("button"),function(){return["\n ",L.I({class:"fa fa-toggle-down"}),"\n "]})}),"\n "),"\n "),"\n ",L.DIV({class:"cine-controls"},"\n ",L.DIV({class:"btn-group"},"\n ",D._TemplateWith(function(){return{class:P.call("btn"),action:P.call("cineFirst"),title:P.call("Skip to first image"),disabled:P.call(P.dataMustache(e.lookup("buttonDisabled")))}},function(){return P.include(e.lookupTemplate("button"),function(){return["\n ",L.I({class:"fa fa-fast-backward"}),"\n "]})}),"\n ",D._TemplateWith(function(){return{class:P.call("btn"),action:P.call("cinePrevious"),title:P.call("Previous image"),disabled:P.call(P.dataMustache(e.lookup("buttonDisabled")))}},function(){return P.include(e.lookupTemplate("button"),function(){return["\n ",L.I({class:"fa fa-step-backward"}),"\n "]})}),"\n ",D._TemplateWith(function(){return{class:P.call(P.dataMustache(e.lookup("concat"),"btn ",P.dataMustache(e.lookup("valueIf"),e.lookup("isPlaying"),"active",""))),action:P.call("cineToggle"),title:P.call("Play / Stop"),disabled:P.call(P.dataMustache(e.lookup("buttonDisabled")))}},function(){return P.include(e.lookupTemplate("button"),function(){return["\n ",D.If(function(){return P.call(e.lookup("isPlaying"))},function(){return["\n ",L.I({class:"fa fa-fw fa-stop"}),"\n "]},function(){return["\n ",L.I({class:"fa fa-fw fa-play"}),"\n "]}),"\n "]})}),"\n ",D._TemplateWith(function(){return{class:P.call("btn"),action:P.call("cineNext"),title:P.call("Next image"),disabled:P.call(P.dataMustache(e.lookup("buttonDisabled")))}},function(){return P.include(e.lookupTemplate("button"),function(){return["\n ",L.I({class:"fa fa-step-forward"}),"\n "]})}),"\n ",D._TemplateWith(function(){return{class:P.call("btn"),action:P.call("cineLast"),title:P.call("Skip to last image"),disabled:P.call(P.dataMustache(e.lookup("buttonDisabled")))}},function(){return P.include(e.lookupTemplate("button"),function(){return["\n ",L.I({class:"fa fa-fast-forward"}),"\n "]})}),"\n "),"\n "),"\n ",L.DIV({class:"cine-options"},"\n ",L.DIV({class:"fps-section"},"\n ",D._TemplateWith(function(){return{key:P.call("framesPerSecond"),class:P.call("p-a-0"),labelClass:P.call("form-group m-a-0"),labelAsDiv:P.call(!0)}},function(){return P.include(e.lookupTemplate("inputRange"),function(){return"\n "})}),"\n "),"\n ",L.SPAN({id:"fps"},D.View("lookup:framerate",function(){return P.mustache(e.lookup("framerate"))})," fps"),"\n "),"\n "]})}),"\n ")})},"cineDialog.js":["meteor/templating","meteor/aldeed:simple-schema","meteor/session","meteor/tracker","meteor/random","meteor/underscore","meteor/jquery","meteor/ohif:core","../../../lib/viewportUtils","../../../lib/switchToImageRelative","../../../lib/switchToImageByIndex",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}});var r;n.import("meteor/aldeed:simple-schema",{SimpleSchema:function(e){r=e}});var i;n.import("meteor/session",{Session:function(e){i=e}});var a;n.import("meteor/tracker",{Tracker:function(e){a=e}});var s;n.import("meteor/random",{Random:function(e){s=e}});var c;n.import("meteor/underscore",{_:function(e){c=e}});var u;n.import("meteor/jquery",{$:function(e){u=e}});var l;n.import("meteor/ohif:core",{OHIF:function(e){l=e}});var d;n.import("../../../lib/viewportUtils",{viewportUtils:function(e){d=e}});var m;n.import("../../../lib/switchToImageRelative",{switchToImageRelative:function(e){m=e}});var p;n.import("../../../lib/switchToImageByIndex",{switchToImageByIndex:function(e){p=e}}),o.cineDialog.onCreated(function(){var e=o.instance();e.schema=new r({intervalId:{type:Number,optional:!0},loop:{type:Boolean,label:"Loop",defaultValue:!0},framesPerSecond:{type:Number,label:"",defaultValue:24,min:1,max:90,optional:!0}}),e.updateFramerate=function(e){l.viewer.cine.framesPerSecond=e;var t=d.getActiveViewportElement();if(t){var n=cornerstoneTools.getToolState(t,"playClip");n&&n.data&&n.data.length&&(n=n.data[0],void 0!==n.intervalId?(cornerstoneTools.stopClip(t),cornerstoneTools.playClip(t,l.viewer.cine.framesPerSecond)):n.framesPerSecond=l.viewer.cine.framesPerSecond,i.set("UpdateCINE",s.id()))}},e.api={displaySetPrevious:function(){function e(){return l.viewerbase.layoutManager.moveDisplaySets(!1)}return e}(),displaySetNext:function(){function e(){return l.viewerbase.layoutManager.moveDisplaySets(!0)}return e}(),cineToggle:function(){function e(){return d.toggleCinePlay()}return e}(),cineFirst:function(){function e(){return p(0)}return e}(),cineLast:function(){function e(){return p(-1)}return e}(),cinePrevious:function(){function e(){return m(-1)}return e}(),cineNext:function(){function e(){return m(1)}return e}(),cineSlowDown:function(){function t(){var t=l.viewer.cine.framesPerSecond-1;t>0&&e.updateFramerate(t)}return t}(),cineSpeedUp:function(){function t(){var t=l.viewer.cine.framesPerSecond+1;t<=90&&e.updateFramerate(t)}return t}()},e.autorun(function(){i.get("activeViewport"),a.afterFlush(function(){var t=d.getActiveViewportElement();if(t){var n=cornerstoneTools.getToolState(t,"playClip");if(n){var o=n.data[0],r=l.viewer.cine;c.extend(r,o),r.framesPerSecond=r.framesPerSecond||24,r.loop=!!c.isUndefined(r.loop)||r.loop;var a=e.$("form:first").data("component");a&&a.value(r),i.set("UpdateCINE",s.id())}}})}),e.setResizeHandler=function(t){"function"==typeof t?!function(){var n=window.onresize;e.origWindowResizeHandler="function"==typeof n?n:null,window.onresize=function(e){"function"==typeof n&&n.call(window,e),t.call(window,e)}}():(window.onresize=e.origWindowResizeHandler||null,window.origWindowResizeHandler=null)},e.setOptimalPosition=function(t,n){var o=u("#viewer"),r=u(".toolbarSection .toolbarSectionTools:first"),i=u("#cineDialog");if(!(r.length<1||i.length<1)){if(i.data("wasDragged")||i.data("wasBounded"))return void e.setResizeHandler(null);var a={width:i.outerWidth()||0,height:i.outerHeight()||0},s={top:0,left:0},c={offset:r.offset()||s,width:r.outerWidth()||0,height:r.outerHeight()||0},l={left:c.offset.left+c.width+20,top:c.offset.top+c.height-a.height};n&&(n.left&&(l.left=n.left),n.top&&(l.top=n.top)),l.top<0?l.top=0:l.top+a.height>o.height()&&(l.top-=l.top+a.height-o.height()),l.left<0?l.left=0:l.left+a.width>o.width()&&(l.left-=l.left+a.width-o.width()),i.css(l)}}}),o.cineDialog.onRendered(function(){var e=o.instance(),t=e.$("#cineDialog"),n=l.uiSettings.displayEchoUltrasoundWorkflow;e.setOptimalPosition(null,{top:n?47:26}),e.setResizeHandler(e.setOptimalPosition),t.draggable({defaultElementCursor:"move"}),F.registerDialog(t.get(0));var r=t.find(".cine-navigation, .cine-controls, .cine-options");r.on("mousedown touchstart",function(e){return e.stopPropagation()})}),o.cineDialog.onDestroyed(function(){var e=o.instance();e.setResizeHandler(null)}),o.cineDialog.events({"change [data-key=loop] input":function(){function e(e,t){var n=d.getActiveViewportElement();l.viewer.cine.loop=u(e.currentTarget).is(":checked");var o=cornerstoneTools.getToolState(n,"playClip");o&&o.data&&o.data.length>0&&(o.data[0].loop=l.viewer.cine.loop)}return e}(),"input [data-key=framesPerSecond] input, change [data-key=framesPerSecond] input":function(){function e(e,t){var n=parseFloat(u(e.currentTarget).val());t.updateFramerate(n)}return e}()}),o.cineDialog.helpers({isPlaying:function(){function e(){return d.isPlaying()}return e}(),framerate:function(){function e(){return i.get("UpdateCINE"),l.viewer.cine.framesPerSecond.toFixed(1)}return e}(),displaySetDisabled:function(){function e(e){if(i.get("LayoutManagerUpdated"),l.viewerbase.layoutManager)return l.viewerbase.layoutManager.canMoveDisplaySets(e)?"":"disabled"}return e}(),buttonDisabled:function(){function e(){return d.hasMultipleFrames()}return e}(),getClassNames:function(){function e(e){var t=l.uiSettings.displayEchoUltrasoundWorkflow?"single":"double";return e+" "+t+"-row-style"}return e}()})}]},toolbarSectionButton:{"template.toolbarSectionButton.js":function(){k.__checkName("toolbarSectionButton"),k.toolbarSectionButton=new k("Template.toolbarSectionButton",function(){var e=this;return D.If(function(){return P.call(P.dot(e.lookup("."),"buttonTemplateName"))},function(){return["\n ",D._TemplateWith(function(){return{template:P.call(P.dot(e.lookup("."),"buttonTemplateName")),data:P.call(e.lookup("."))}},function(){return P.include(function(){return P.call(k.__dynamic)})}),"\n "]},function(){return["\n ",L.DIV({id:function(){return P.mustache(P.dot(e.lookup("."),"id"))},tabindex:"1",class:function(){return["toolbarSectionButton rp-x-1 ",P.mustache(P.dot(e.lookup("."),"classes"))," ",P.mustache(e.lookup("activeClass"))," ",D.If(function(){
return P.dataMustache(e.lookup("or"),P.dot(e.lookup("."),"disabled"),P.dataMustache(e.lookup("disableButton")))},function(){return"disabled"})," ",D.If(function(){return P.call(P.dot(e.lookup("."),"subTools"))},function(){return"expandable"})]},title:function(){return P.mustache(P.dot(e.lookup("."),"tooltipTitle"))}},"\n ",L.DIV({class:"svgContainer"},"\n ",D.Let({svg:function(){return P.call(e.lookup("svgLink"))},icon:function(){return P.call(e.lookup("iconClasses"))}},function(){return["\n ",D.If(function(){return P.call(e.lookup("svg"))},function(){return["\n ",L.SVG("\n ",L.USE({"xlink:href":function(){return P.mustache(e.lookup("absoluteUrl"),e.lookup("svg"))}}),"\n "),"\n "]},function(){return["\n ",L.I({class:function(){return P.mustache(e.lookup("icon"))}}),"\n "]}),"\n "]}),"\n "),"\n ",L.DIV({class:"buttonLabel"},"\n ",L.SPAN(D.View("lookup:..title",function(){return P.mustache(P.dot(e.lookup("."),"title"))})),"\n ",D.If(function(){return P.call(P.dot(e.lookup("."),"subTools"))},function(){return["\n ",L.I({class:"fa fa-caret-down expanded-status","aria-hidden":"true"}),"\n "]}),"\n "),"\n ",D.If(function(){return P.call(P.dot(e.lookup("."),"subTools"))},function(){return["\n ",L.DIV({class:"toolbarSectionDrawerContainer"},"\n ",L.DIV({class:"toolbarSectionDrawer"},"\n ",D.Each(function(){return{_sequence:P.call(P.dot(e.lookup("."),"subTools")),_variable:"subTool"}},function(){return["\n ",D._TemplateWith(function(){return P.call(e.lookup("subTool"))},function(){return P.include(e.lookupTemplate("toolbarSectionButton"))}),"\n "]}),"\n "),"\n "),"\n "]}),"\n "),"\n "]})})},"toolbarSectionButton.js":["meteor/ohif:core","meteor/templating","meteor/session","meteor/underscore",function(e,t,n){var o;n.import("meteor/ohif:core",{OHIF:function(e){o=e}});var i;n.import("meteor/templating",{Template:function(e){i=e}});var a;n.import("meteor/session",{Session:function(e){a=e}});var s;n.import("meteor/underscore",{_:function(e){s=e}}),i.toolbarSectionButton.onCreated(function(){var e=i.instance();e.isActive=function(e){o.commands.last.dep.depend();var t=i.instance(),n=t.data.subTools,r=t.data.id,c=r===e,u=n&&s.findWhere(n,{id:e}),l=a.get("ToolManagerActiveCommandButtons")||[],d=l.indexOf(t.data.id)!==-1,m="function"==typeof t.data.active&&t.data.active();return m||c||u||d},e.getActiveToolSubProperty=function(e,t){var n=i.instance(),o=n.data.subTools,r=n.data[e],a=n.data.id;if(o&&t!==a&&n.isActive(t)){var c=s.findWhere(o,{id:t});return c?c[e]:r}return r},e.autorun(function(t){var n=o.commands.last.get();if(!t.firstRun){var r=e.data.id,i=o.viewerbase.toolManager.getActiveTool();if(n===r&&!e.isActive(i)){var a=function e(t){t.addClass("active"),setTimeout(function(){t.hasClass("expandable")&&t.find(".toolbarSectionButton.active").length||t.removeClass("active")},100)},s=e.$(".toolbarSectionButton").first();a(s);var c=s.closest(".toolbarSectionButton.expandable");c.length&&a(c)}}})}),i.toolbarSectionButton.helpers({activeClass:function(){function e(){var e=i.instance(),t=a.get("ToolManagerActiveTool"),n=e.isActive(t);return n?"active":""}return e}(),svgLink:function(){function e(){var e=i.instance(),t=a.get("ToolManagerActiveTool"),n=e.getActiveToolSubProperty("svgLink",t);return s.isFunction(n)?n():n}return e}(),iconClasses:function(){function e(){var e=i.instance(),t=a.get("ToolManagerActiveTool"),n=e.getActiveToolSubProperty("iconClasses",t);return s.isFunction(n)?n():n}return e}(),disableButton:function(){function e(){a.get("activeViewport"),a.get("LayoutManagerUpdated");var e=i.instance(),t=o.commands.isDisabled(e.data.id),n=e.data.disableFunction&&e.data.disableFunction();return t||n}return e}()}),i.toolbarSectionButton.events({"click .toolbarSectionButton:not(.expandable)":function(){function e(e,t){e.stopPropagation(),r(e.currentTarget).hasClass("disabled")||o.commands.run(t.data.id)}return e}()})}]},toolbarSectionTools:{"template.toolbarSectionTools.js":function(){k.__checkName("toolbarSectionTools"),k.toolbarSectionTools=new k("Template.toolbarSectionTools",function(){var e=this;return L.DIV({class:"toolbarSectionTools pull-left m-t-1 rm-l-3"},"\n ",D.Each(function(){return{_sequence:P.call(e.lookup("toolbarButtons")),_variable:"toolbarButton"}},function(){return["\n ",D._TemplateWith(function(){return P.call(e.lookup("toolbarButton"))},function(){return P.include(e.lookupTemplate("toolbarSectionButton"))}),"\n "]}),"\n ")})},"toolbarSectionTools.js":["meteor/templating","meteor/meteor",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}});var i;n.import("meteor/meteor",{Meteor:function(e){i=e}}),o.toolbarSectionTools.events({"click .expandable":function(){function e(e,t){var n=r(e.currentTarget),o=n.hasClass("expanded");n.toggleClass("expanded",!o);var i=n.find(".toolbarSectionDrawerContainer:first");if(i.css("left",""),!o){var a=function(){function e(t){var o=t.originalEvent,a=o&&o.propertyName;if(a&&"transform"===a){n.off("transitionend",e);var s=i.outerWidth(),c=i.offset().left,u=r(document.body).outerWidth(),l=c+s;if(c<0)i.css("left","calc(50% - "+c+"px)");else if(l>u){var d=l-u;i.css("left","calc(50% - "+d+"px)")}}}return e}();n.on("transitionend",a)}}return e}(),"focusout .expandable":function(){function e(e,t){var n=e.target,o=e.currentTarget;i.defer(function(){var e=r(":focus"),t=r(o).closest(".expandable"),i=t.find(":focus").length;if(!e.length||!i){if(o!==n&&e[0]===o)return;t.removeClass("expanded")}})}return e}()})}]},confirmDeleteDialog:{"template.confirmDeleteDialog.js":function(){k.__checkName("confirmDeleteDialog"),k.confirmDeleteDialog=new k("Template.confirmDeleteDialog",function(){var e=this;return L.DIV({id:"confirmDeleteDialog",class:"dialog-animated",tabindex:"0"},"\n ",D.If(function(){return P.call(e.lookup("title"))},function(){return["\n ",L.H5(D.View("lookup:title",function(){return P.mustache(e.lookup("title"))})),"\n "]},function(){return["\n ",L.H5("Remove data from Timepoint?"),"\n "]}),"\n ",D.If(function(){return P.call(e.lookup("text"))},function(){return["\n ",L.P(D.View("lookup:text",function(){return P.mustache(e.lookup("text"))})),"\n "]},function(){return["\n ",L.P("Are you sure you would like to remove the measurement data at this timepoint?"),"\n "]}),L.Raw('\n <button id="cancel" class="btn btn-link" tabindex="1">Cancel</button>\n <button id="confirm" class="btn btn-primary" tabindex="0">OK</button>\n '))})},"confirmDeleteDialog.js":["meteor/templating","../../../lib/dialogUtils",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}});var r;n.import("../../../lib/dialogUtils",{dialogUtils:function(e){r=e}});var i={ESC:27,ENTER:13};o.confirmDeleteDialog.events({"click #cancel, click #close":function(){function e(){r.closeHandler(!1)}return e}(),"click #confirm":function(){function e(){r.closeHandler()}return e}(),"keydown #confirmDeleteDialog":function(){function e(e){return e.which===i.ESC?(r.closeHandler(!1),!1):void(this.keyPressAllowed!==!1&&e.which===i.ENTER&&r.closeHandler())}return e}()})}]},textMarkerDialogs:{"template.textMarkerDialogs.js":function(){k.__checkName("textMarkerDialogs"),k.textMarkerDialogs=new k("Template.textMarkerDialogs",function(){var e=this;return[L.getTag("dialog")({id:"textMarkerOptionsDialog",oncontextmenu:"return false",class:"textMarkerDialog noselect"},"\n ",L.H5("Spine Labels"),"\n ",L.A({class:"closeTextMarkerDialogs"},P.include(e.lookupTemplate("iconCrossCircle"))),"\n ",L.DIV({class:"optionsDiv"},"\n ",L.DIV({class:"select2-wrapper optionBox"},"\n ",L.LABEL({for:"startFrom"},"Label: "),"\n ",L.SELECT({name:"start",id:"startFrom",tabindex:"-1",class:"select2"},"\n ",L.Comment(" Cervical spine !"),"\n ",L.OPTION({value:"C1",selected:""},"C1"),"\n ",L.OPTION({value:"C2"},"C2"),"\n ",L.OPTION({value:"C3"},"C3"),"\n ",L.OPTION({value:"C4"},"C4"),"\n ",L.OPTION({value:"C5"},"C5"),"\n ",L.OPTION({value:"C6"},"C6"),"\n ",L.OPTION({value:"C7"},"C7"),"\n\n ",L.Comment(" Thoracic spine !"),"\n ",L.OPTION({value:"T1"},"T1"),"\n ",L.OPTION({value:"T2"},"T2"),"\n ",L.OPTION({value:"T3"},"T3"),"\n ",L.OPTION({value:"T4"},"T4"),"\n ",L.OPTION({value:"T5"},"T5"),"\n ",L.OPTION({value:"T6"},"T6"),"\n ",L.OPTION({value:"T7"},"T7"),"\n ",L.OPTION({value:"T8"},"T8"),"\n ",L.OPTION({value:"T9"},"T9"),"\n ",L.OPTION({value:"T10"},"T10"),"\n ",L.OPTION({value:"T11"},"T11"),"\n ",L.OPTION({value:"T12"},"T12"),"\n\n ",L.Comment(" Lumbar spine !"),"\n ",L.OPTION({value:"L1"},"L1"),"\n ",L.OPTION({value:"L2"},"L2"),"\n ",L.OPTION({value:"L3"},"L3"),"\n ",L.OPTION({value:"L4"},"L4"),"\n ",L.OPTION({value:"L5"},"L5"),"\n "),"\n "),"\n ",L.DIV({class:"optionBox"},"\n ",L.DIV({class:"btn-group iconSwitch","data-toggle":"buttons"},"\n ",L.LABEL({for:"ascending",class:"btn btn-link",title:"Add labels from head to feet (down) or feet to head (up)","data-toggle":"tooltip","data-container":"body"},"\n ",L.INPUT({type:"checkbox",id:"ascending"})," ",L.SPAN({class:"on"},L.I({class:"fa fa-long-arrow-up","aria-hidden":"true"}))," ",L.SPAN({class:"off"},L.I({class:"fa fa-long-arrow-down","aria-hidden":"true"})),"\n "),"\n "),"\n "),"\n ",L.BUTTON({id:"clearLabels",class:"btn viewerBtn btn-xs",type:"button"},"\n Clear Labels ",L.I({class:"viewerIcon-clear"}),"\n "),"\n ")," \n "),"\n\n ",L.getTag("dialog")({id:"textMarkerRelabelDialog",oncontextmenu:"return false",class:"textMarkerDialog noselect"},"\n ",L.H5("Change Spine Label"),"\n ",L.DIV({class:"relabelOptions"},"\n\n ",L.DIV({class:"select2-wrapper optionBox"},"\n ",L.LABEL({for:"relabelSelect"},"Label:"),"\n ",L.SELECT({name:"relabelSelect",class:"relabelSelect"},"\n ",L.Comment(" Cervical spine !"),"\n ",L.OPTION({value:"C1"},"C1"),"\n ",L.OPTION({value:"C2"},"C2"),"\n ",L.OPTION({value:"C3"},"C3"),"\n ",L.OPTION({value:"C4"},"C4"),"\n ",L.OPTION({value:"C5"},"C5"),"\n ",L.OPTION({value:"C6"},"C6"),"\n ",L.OPTION({value:"C7"},"C7"),"\n\n ",L.Comment(" Thoracic spine !"),"\n ",L.OPTION({value:"T1"},"T1"),"\n ",L.OPTION({value:"T2"},"T2"),"\n ",L.OPTION({value:"T3"},"T3"),"\n ",L.OPTION({value:"T4"},"T4"),"\n ",L.OPTION({value:"T5"},"T5"),"\n ",L.OPTION({value:"T6"},"T6"),"\n ",L.OPTION({value:"T7"},"T7"),"\n ",L.OPTION({value:"T8"},"T8"),"\n ",L.OPTION({value:"T9"},"T9"),"\n ",L.OPTION({value:"T10"},"T10"),"\n ",L.OPTION({value:"T11"},"T11"),"\n ",L.OPTION({value:"T12"},"T12"),"\n\n ",L.Comment(" Lumbar spine !"),"\n ",L.OPTION({value:"L1"},"L1"),"\n ",L.OPTION({value:"L2"},"L2"),"\n ",L.OPTION({value:"L3"},"L3"),"\n ",L.OPTION({value:"L4"},"L4"),"\n ",L.OPTION({value:"L5"},"L5"),"\n "),"\n "),"\n "),"\n ",L.DIV({class:"relabelButtons"},"\n ",L.BUTTON({class:"relabelRemove btn btn-xs btn-secondary viewerBtn"},"Delete"),"\n ",L.BUTTON({class:"relabelConfirm btn btn-xs viewerBtn"},"Save"),"\n "),"\n ",L.DIV({class:"dialog arrow"},"\n "),"\n ")]})},"textMarkerDialogs.js":["meteor/templating","meteor/jquery","../../../lib/toolManager","../../../lib/viewportUtils",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}});var r;n.import("meteor/jquery",{$:function(e){r=e}});var i;n.import("../../../lib/toolManager",{toolManager:function(e){i=e}});var a;n.import("../../../lib/viewportUtils",{viewportUtils:function(e){a=e}}),o.textMarkerDialogs.events({"change #startFrom":function(){function e(e){var t=cornerstoneTools.textMarker.getConfiguration();t.current=r(e.target).val()}return e}(),"change #ascending":function(){function e(e){var t=cornerstoneTools.textMarker.getConfiguration();t.ascending=r(e.target).is(":checked");var n=t.markers.indexOf(t.current);t.current=t.markers[n];var o=t.current;r("#startFrom").val(o).trigger("change")}return e}(),"click #clearLabels":function(){function e(){var e=a.getActiveViewportElement(),t="textMarker",n=cornerstoneTools.globalImageIdSpecificToolStateManager,o=n.toolState,r=cornerstoneTools.getToolState(e,"stack");if(r&&r.data.length&&r.data[0].imageIds.length){var i=r.data[0].imageIds;i.forEach(function(e){if(o.hasOwnProperty(e)){var n=o[e];n.hasOwnProperty(t)&&delete n[t]}})}cornerstone.updateImage(e)}return e}(),"click .closeTextMarkerDialogs":function(){function e(){var e=i.getDefaultTool();i.setActiveTool(e),document.getElementById("textMarkerOptionsDialog").close(),r("#spine").removeClass("active"),r("#"+e).addClass("active")}return e}()}),o.textMarkerDialogs.onRendered(function(){var e=r("#textMarkerOptionsDialog");e.draggable(),F.registerDialog(e.get(0));var t=r("#textMarkerRelabelDialog");t.draggable(),F.registerDialog(t.get(0)),r(document).on("click",function(e){r(e.target).closest(".select2-wrapper").length||setTimeout(function(){r("#startFrom, .relabelSelect").select2("close")},200)}),r(document).on("touchmove",function(e){r(e.target).closest(".select2-container").length||setTimeout(function(){r("#startFrom, .relabelSelect").select2("close")},200)}),r(function(){FastClick.attach(document.body);var e=r("#startFrom, .relabelSelect");e.select2({templateResult:function(){function e(e,t){return e.id?(t.className+=" needsclick",e.text):e.text}return e}(),placeholder:"C1",minimumResultsForSearch:-1,theme:"viewerDropdown"}),e.each(function(e,t){r(t).data("select2").$container.find("*").addClass("needsclick")})})})}]},studySeriesQuickSwitch:{"template.studySeriesQuickSwitch.js":function(){k.__checkName("studySeriesQuickSwitch"),k.studySeriesQuickSwitch=new k("Template.studySeriesQuickSwitch",function(){var e=this;return L.DIV({class:function(){return["quickSwitchWrapper ",P.mustache(e.lookup("side"))]}},"\n ",L.DIV({class:function(){return["quickSwitch js-quick-switch clearfix rp-t-1 ",D.If(function(){return P.dataMustache(e.lookup("eq"),e.lookup("side"),"right")},function(){return"rp-l-3"}),D.If(function(){return P.dataMustache(e.lookup("eq"),e.lookup("side"),"left")},function(){return"rp-r-3"})]}},"\n ",L.DIV({class:function(){return["switchSection switchSectionStudy rp-x-1 ",D.If(function(){return P.dataMustache(e.lookup("eq"),e.lookup("side"),"right")},function(){return"pull-left"},function(){return"pull-right"})]}},"\n ",L.Raw('<div class="label">Study</div>'),"\n ",L.DIV({class:"studySwitch"},"\n ",L.Raw('<div class="studyBox"></div>'),"\n ",L.DIV({class:"switchHover studyHover clearfix"},"\n ",L.DIV({class:function(){return["scrollArea ",D.If(function(){return P.dataMustache(e.lookup("isMac"))},function(){return"is-mac"})]}},"\n ",D._TemplateWith(function(){return P.dataMustache(e.lookup("clone"),e.lookup("."),P.kw({timepointViewType:"key"}))},function(){return P.include(e.lookupTemplate("studyTimepointBrowser"))}),"\n "),"\n "),"\n "),"\n "),"\n ",L.DIV({class:function(){return["switchSection switchSectionSeries rp-x-1 ",D.If(function(){return P.dataMustache(e.lookup("eq"),e.lookup("side"),"right")},function(){return"pull-left"},function(){return"pull-right"})]}},"\n ",D.Let({thumbnailsList:function(){return P.call(P.dataMustache(e.lookup("studyThumbnails"),e.lookup("currentStudy")))}},function(){return["\n ",L.DIV({class:"label"},"Series"),"\n ",L.DIV({class:"seriesSwitch clearfix"},"\n ",D.Each(function(){return{_sequence:P.call(e.lookup("thumbnailsList")),_variable:"thumbnail"}},function(){return["\n ",D.If(function(){return P.dataMustache(e.lookup("lt"),e.lookup("@index"),8)},function(){return["\n ",L.DIV({class:function(){return["seriesItem ",D.If(function(){return P.dataMustache(e.lookup("eq"),e.lookup("side"),"right")},function(){return"pull-left"},function(){return"pull-right"})," ",D.If(function(){return P.dataMustache(e.lookup("isDisplaySetActive"),P.dot(e.lookup("thumbnail"),"stack","displaySetInstanceUid"),e.lookup("viewportIndex"))},function(){return"active"})]}}),"\n "]},function(){return["\n ",D.If(function(){return P.dataMustache(e.lookup("eq"),e.lookup("@index"),8)},function(){return["\n ",L.DIV({class:function(){return["seriesItem count ",D.If(function(){return P.dataMustache(e.lookup("eq"),e.lookup("side"),"right")},function(){return"pull-left"},function(){return"pull-right"})]}},D.View("lookup:thumbnailsList.length",function(){return P.mustache(P.dot(e.lookup("thumbnailsList"),"length"))})),"\n "]}),"\n "]}),"\n "]}),"\n ",L.DIV({class:"switchHover seriesHover clearfix"},"\n ",L.DIV({class:function(){return["scrollArea ",D.If(function(){return P.dataMustache(e.lookup("isMac"))},function(){return"is-mac"})]}},"\n ",L.DIV({class:"thumbnailsWrapper"},"\n ",D.Each(function(){return{_sequence:P.call(e.lookup("thumbnailsList")),_variable:"thumbnail"}},function(){return["\n ",D._TemplateWith(function(){return P.dataMustache(e.lookup("clone"),e.lookup("."),P.kw({thumbnail:e.lookup("thumbnail")}))},function(){return P.include(e.lookupTemplate("thumbnailEntry"))}),"\n "]}),"\n "),"\n "),"\n "),"\n "),"\n "]}),"\n "),"\n "),"\n ")})},"studySeriesQuickSwitch.js":["meteor/templating","meteor/reactive-var","meteor/session","meteor/jquery","meteor/ohif:core",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}});var r;n.import("meteor/reactive-var",{ReactiveVar:function(e){r=e}});var i;n.import("meteor/session",{Session:function(e){i=e}});var a;n.import("meteor/jquery",{$:function(e){a=e}});var s;n.import("meteor/ohif:core",{OHIF:function(e){s=e}}),o.studySeriesQuickSwitch.onCreated(function(){var e=o.instance();e.data.currentStudy=new r,e.getViewportData=function(e){var t=s.viewerbase.layoutManager;return t&&t.viewportData&&t.viewportData[e]};var t=e.data.viewportIndex;e.study={},e.lastStudy={},e.autorun(function(){i.get("LayoutManagerUpdated");var n=e.getViewportData(t);n?e.study=s.viewer.Studies.findBy({studyInstanceUid:n.studyInstanceUid}):e.study=s.viewer.Studies.getElementByIndex(0),e.study&&e.study.studyInstanceUid!==e.lastStudy.studyInstanceUid&&(e.data.currentStudy.set(e.study),e.lastStudy=e.study)})});var c=function e(t){var n=t.scrollHeight,o=t.offsetHeight,r=t.scrollTop,i=a(t).find(".thumbnailsWrapper").css("transform"),s=0;i&&"none"!==i&&(s=parseInt(i.match(/-?[\d\.]+/g)[5])),n>o+r+s?t.classList.add("show-scroll-indicator-down"):t.classList.remove("show-scroll-indicator-down"),r>0?t.classList.add("show-scroll-indicator-up"):t.classList.remove("show-scroll-indicator-up")};o.studySeriesQuickSwitch.events({"mouseenter .js-quick-switch, mouseenter .js-quick-switch .switchSectionSeries":function(){function e(e,t){t.$(".quickSwitchWrapper").addClass("overlay"),a(e.currentTarget).addClass("hover"),t.$(".scrollArea").each(function(e,t){return c(t)})}return e}(),"mouseleave .js-quick-switch":function(){function e(e,t){t.$(".js-quick-switch, .switchSectionSeries").removeClass("hover"),t.$(".quickSwitchWrapper").removeClass("overlay")}return e}(),"click .thumbnailEntry":function(){function e(e,t){t.$(".js-quick-switch, .switchSectionSeries").removeClass("hover"),t.$(".quickSwitchWrapper").removeClass("overlay")}return e}(),"click .studyTimepointStudy":function(){function e(e,t){t.$(".switchSectionSeries").addClass("hover")}return e}(),"scroll .scrollArea":function(){function e(e){c(e.currentTarget)}return e}()}),o.studySeriesQuickSwitch.helpers({currentStudy:function(){function e(){return o.instance().data.currentStudy.get()}return e}(),isMac:function(){function e(){return window.navigator.appVersion.indexOf("Mac")}return e}()})}]},studyTimepointBrowser:{"template.studyTimepoint.js":function(){k.__checkName("studyTimepoint"),k.studyTimepoint=new k("Template.studyTimepoint",function(){var e=this;return L.DIV({class:"studyTimepointWrapper"},"\n ",L.DIV({class:"studyTimepoint"},"\n ",D.Each(function(){return{_sequence:P.call(e.lookup("studies")),_variable:"study"}},function(){return["\n ",D._TemplateWith(function(){return P.dataMustache(e.lookup("clone"),e.lookup("."),P.kw({study:e.lookup("study"),active:P.dataMustache(e.lookup("isActive"),e.lookup("study"))}))},function(){return P.include(e.lookupTemplate("studyTimepointStudy"))}),"\n "]}),"\n "),"\n ")})},"studyTimepoint.js":["meteor/templating","meteor/ohif:core",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}});var i;n.import("meteor/ohif:core",{OHIF:function(e){i=e}}),o.studyTimepoint.onCreated(function(){var e=o.instance(),t=e.data;e.isActive={},t.isUnassociatedStudy===!0&&1===t.studyInstanceUids.length&&(e.isActive[t.studyInstanceUids[0]]=!0)}),o.studyTimepoint.onRendered(function(){var e=o.instance(),t=e.$(".studyTimepoint"),n=t.closest(".studyTimepointWrapper"),r=n.closest(".timepointEntry"),i=t.is(":visible");i||r.addClass("active"),t.trigger("displayStateChanged"),i||r.removeClass("active")}),o.studyTimepoint.events({"selectionChanged .studyTimepoint":function(){function e(e,t,n){var o=r(n.selection),a=t.$(".studyTimepoint");if(n.isQuickSwitch){var s=i.viewer.Studies.findBy({studyInstanceUid:n.studyInstanceUid});t.data.currentStudy.set(s),a=a.closest(".studyTimepointBrowser")}a.find(".studyTimepointStudy").not(o).removeClass("active"),n.isQuickSwitch?(t.isActive={},o.addClass("active")):!function(){var e=t.$(".studyTimepoint");t.$(".studyTimepointWrapper").css("max-height","inherit"),o.removeClass("loading"),o.toggleClass("active");var n=o.find(".studyTimepointThumbnails");n.one("transitionend",function(){return e.trigger("displayStateChanged")})}(),t.isActive[n.studyInstanceUid]=o.hasClass("active")}return e}(),"displayStateChanged .studyTimepoint":function(){function e(e,t){var n=r(e.currentTarget),o=n.closest(".studyTimepointWrapper");o.css("max-height",n.height())}return e}()}),o.studyTimepoint.helpers({isActive:function(){function e(e){var t=o.instance();if(e.studyInstanceUid)return t.isActive[e.studyInstanceUid]}return e}()})}],"template.studyTimepointBrowser.js":function(){k.__checkName("studyTimepointBrowser"),k.studyTimepointBrowser=new k("Template.studyTimepointBrowser",function(){var e=this;return D.Let({timepointList:function(){return P.call(e.lookup("timepoints"))}},function(){return["\n ",L.DIV({class:function(){return["studyTimepointBrowser noselect ",D.If(function(){return P.dataMustache(e.lookup("shallShowViewType"),e.lookup("timepointList"))},function(){return"viewTypeVisible"})]}},"\n ",L.DIV({class:"timepointButtonContainer p-t-2"},"\n ",D._TemplateWith(function(){return P.call(e.lookup("viewTypeButtonGroupData"))},function(){return P.include(e.lookupTemplate("roundedButtonGroup"))}),"\n "),"\n ",L.DIV({class:"studyTimepointScrollArea"},"\n ",L.DIV({class:"p-x-1"},"\n ",D.If(function(){return P.call(P.dot(e.lookup("timepointList"),"length"))},function(){return["\n ",D.Each(function(){return{_sequence:P.call(e.lookup("timepointList")),_variable:"timepoint"}},function(){return["\n ",L.DIV({class:"timepointEntry p-y-2"},"\n ",L.DIV({class:"timepointHeader"},"\n ",L.DIV({class:"timepointDetails clearfix"},"\n ",L.DIV({class:"timepointFollowupTitle pull-left"},"\n ",D.View("lookup:timepointApi.title",function(){return P.mustache(P.dot(e.lookup("timepointApi"),"title"),e.lookup("timepoint"))}),"\n "),"\n ",L.DIV({class:"expandIcon pull-right"},"\n ",L.I({class:"fa fa-chevron-down"}),"\n "),"\n ",L.DIV({class:"timepointDate pull-right m-r-1"},D.View("lookup:formatDA",function(){return P.mustache(e.lookup("formatDA"),P.dot(e.lookup("timepoint"),"earliestDate"),"D-MMM-YYYY")})),"\n "),"\n ",L.DIV({class:"timepointModalities"},D.View("lookup:modalitiesSummary",function(){return P.mustache(e.lookup("modalitiesSummary"),e.lookup("timepoint"))})),"\n "),"\n ",D._TemplateWith(function(){return{studies:P.call(P.dataMustache(e.lookup("studies"),e.lookup("timepoint"))),index:P.call(e.lookup("@index")),viewportIndex:P.call(P.dot(e.lookup("."),"viewportIndex")),currentStudy:P.call(P.dot(e.lookup("."),"currentStudy"))}},function(){return P.include(e.lookupTemplate("studyTimepoint"))}),"\n "),"\n ",L.HR(),"\n "]}),"\n ",D.If(function(){return P.dataMustache(e.lookup("and"),P.dot(e.lookup("."),"currentStudy"),P.dataMustache(e.lookup("not"),e.lookup("showAdditionalTimepoints")))},function(){return["\n ",L.DIV({class:"studyModality additional"},"\n Show additional timepoints\n "),"\n "]}),"\n "]},function(){return["\n ",L.DIV({class:"p-t-2"},"\n ",D._TemplateWith(function(){return P.dataMustache(e.lookup("clone"),e.lookup("."),P.kw({studies:e.lookup("studies")}))},function(){return P.include(e.lookupTemplate("studyTimepoint"))}),"\n "),"\n "]}),"\n "),"\n "),"\n "),"\n "]})})},"studyTimepointBrowser.js":["meteor/templating","meteor/reactive-var","meteor/tracker","meteor/underscore","meteor/ohif:core","../../../lib/classes/OHIFError",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}});var i;n.import("meteor/reactive-var",{ReactiveVar:function(e){i=e}});var a;n.import("meteor/tracker",{Tracker:function(e){a=e}});var s;n.import("meteor/underscore",{_:function(e){s=e}});var c;n.import("meteor/ohif:core",{OHIF:function(e){c=e}});var u;n.import("../../../lib/classes/OHIFError",{OHIFError:function(e){u=e}}),o.studyTimepointBrowser.onCreated(function(){var e=o.instance();e.timepointViewType=new i(e.data.timepointViewType),e.showAdditionalTimepoints=new i((!0)),e.getCurrentStudy=function(){return e.data.currentStudy&&e.data.currentStudy.get()},e.getStudies=function(e){return e?e.studyInstanceUids.map(function(t){var n={patientId:e.patientId,studyInstanceUid:t},o=c.viewer.Studies.findBy(n);if(o)return o;var r=c.studylist.collections.Studies.findOne(n);if(!r)throw new u("No study data available for Study: "+t);return r}):c.viewer.Studies.all()}}),o.studyTimepointBrowser.onRendered(function(){var e=o.instance();e.autorun(function(){var t=e.timepointViewType.get();e.$(".timepointEntry, .studyTimepointStudy").removeClass("active"),"key"!==t||e.data.currentStudy||e.$(".timepointEntry:first").addClass("active")});var t=void 0,n=[];e.refreshActiveStudies=function(){return a.afterFlush(function(){s.each(n,function(t){e.$(".studyTimepointStudy[data-uid='"+t+"']").addClass("active")}),e.$(".timepointEntry:first").addClass("active")})},e.autorun(function(){var o=e.data.currentStudy&&e.data.currentStudy.get();o&&(o!==t&&(e.showAdditionalTimepoints.set(!1),t=o,n=[o.studyInstanceUid]),e.refreshActiveStudies())})}),o.studyTimepointBrowser.events({"click .timepointHeader":function(){function e(e,t){var n=r(e.currentTarget).closest(".timepointEntry");n.find(".studyTimepoint").trigger("displayStateChanged"),n.toggleClass("active")}return e}(),"click .studyModality.additional":function(){function e(e,t){t.showAdditionalTimepoints.set(!0)}return e}()}),o.studyTimepointBrowser.helpers({shallShowViewType:function(){function e(e){var t=o.instance();return e.length&&!t.data.timepointViewType}return e}(),viewTypeButtonGroupData:function(){function e(){return{value:o.instance().timepointViewType,options:[{value:"key",text:"Key Timepoints"},{value:"all",text:"All Timepoints"}]}}return e}(),showAdditionalTimepoints:function(){function e(){return o.instance().showAdditionalTimepoints.get()}return e}(),timepoints:function(){function e(){var e=o.instance(),t=e.getCurrentStudy(),n=e.data.timepointApi,r=void 0;return r=t&&!e.showAdditionalTimepoints.get()?n.study(t.studyInstanceUid):n?"all"===e.timepointViewType.get()?n.all():n.key():[]}return e}(),studies:function(){function e(e){return o.instance().getStudies(e)}return e}(),modalitiesSummary:function(){function e(e){var t=o.instance(),n=t.getStudies(e),r={};n.forEach(function(e){var t=e.modalities||"UN";r[t]=r[t]+1||1});var i=[];return s.each(r,function(e,t){i.push(e+" "+t)}),i.join(", ")}return e}()})}],"template.studyTimepointStudy.js":function(){k.__checkName("studyTimepointStudy"),k.studyTimepointStudy=new k("Template.studyTimepointStudy",function(){var e=this;return D.Let({isSidebar:function(){return P.call(P.dataMustache(e.lookup("isUndefined"),e.lookup("viewportIndex")))}},function(){return["\n ",L.DIV({class:function(){return["studyTimepointStudy ",D.If(function(){return P.call(e.lookup("isSidebar"))},function(){return"studySidebarTimepoint"},function(){return"studyQuickSwitchTimepoint"})," ",D.If(function(){return P.call(P.dot(e.lookup("."),"active"))},function(){return"active"})," ",D.If(function(){return P.call(e.lookup("isLoading"))},function(){return"loading"})]},"data-uid":function(){return P.mustache(P.dot(e.lookup("."),"study","studyInstanceUid"))}},"\n ",L.DIV({class:"studyItem"
},"\n ",P.include(e.lookupTemplate("loadingText")),"\n ",L.DIV({class:"studyModality"},"\n ",L.DIV({class:"studyModalityBox"},"\n ",L.DIV({class:"studyModalityText",style:function(){return P.mustache(e.lookup("modalityStyle"))}},"\n ",D.If(function(){return P.call(P.dot(e.lookup("."),"study","modalities"))},function(){return["\n ",D.View("lookup:modalities",function(){return P.mustache(e.lookup("modalities"))}),"\n "]},function(){return"\n UN\n "}),"\n "),"\n "),"\n ",L.DIV({class:"studyText"},"\n ",L.DIV({class:"studyDate"},D.View("lookup:formatDA",function(){return P.mustache(e.lookup("formatDA"),P.dot(e.lookup("."),"study","studyDate"),"D-MMM-YYYY")})),"\n ",L.DIV({class:"studyDescription"},D.View("lookup:..study.studyDescription",function(){return P.mustache(P.dot(e.lookup("."),"study","studyDescription"))})),"\n "),"\n "),"\n "),"\n ",D.If(function(){return P.call(e.lookup("isSidebar"))},function(){return["\n ",L.DIV({class:"studyTimepointThumbnails"},"\n ",D.Each(function(){return{_sequence:P.dataMustache(e.lookup("studyThumbnails"),P.dot(e.lookup("."),"study")),_variable:"thumbnail"}},function(){return["\n ",D._TemplateWith(function(){return P.dataMustache(e.lookup("clone"),e.lookup("."),P.kw({thumbnail:e.lookup("thumbnail")}))},function(){return P.include(e.lookupTemplate("thumbnailEntry"))}),"\n "]}),"\n "),"\n "]}),"\n "),"\n "]})})},"studyTimepointStudy.js":["meteor/meteor","meteor/templating","meteor/reactive-var","meteor/underscore","meteor/jquery","meteor/ohif:core","../../../lib/sortingManager",function(e,t,n){var o;n.import("meteor/meteor",{Meteor:function(e){o=e}});var r;n.import("meteor/templating",{Template:function(e){r=e}});var i;n.import("meteor/reactive-var",{ReactiveVar:function(e){i=e}});var a;n.import("meteor/underscore",{_:function(e){a=e}});var s;n.import("meteor/jquery",{$:function(e){s=e}});var c;n.import("meteor/ohif:core",{OHIF:function(e){c=e}});var u;n.import("../../../lib/sortingManager",{sortingManager:function(e){u=e}}),r.studyTimepointStudy.onCreated(function(){var e=r.instance();e.loading=new i((!1)),e.getStudyElement=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=e.data.study.studyInstanceUid,o=".studyTimepointStudy[data-uid='"+n+"']";return t?s(o):e.$browser.find(o)},e.isQuickSwitch=function(){return!a.isUndefined(e.data.viewportIndex)},e.select=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=e.data.study.studyInstanceUid,o=e.getStudyElement(),r=o.closest(".studyTimepoint"),i={selection:[o[0]],studyInstanceUid:n,isQuickSwitch:t};r.trigger("selectionChanged",i)},e.initializeStudyWrapper=function(){if(!e.isQuickSwitch()){var t=e.getStudyElement(),n=t.find(".studyTimepointThumbnails");t.addClass("active"),n.css("max-height",""),n.css("max-height",n.height()),t.removeClass("active"),e.data.active&&o.setTimeout(function(){return t.addClass("active")},1)}}}),r.studyTimepointStudy.onRendered(function(){var e=r.instance();e.$browser=e.$(".studyTimepointStudy").closest(".studyTimepointBrowser"),e.initializeStudyWrapper()}),r.studyTimepointStudy.events({"transitionend .studyTimepointThumbnails":function(){function e(e,t){e.target===e.currentTarget&&s(e.currentTarget).closest(".studyTimepoint").trigger("displayStateChanged")}return e}(),"click .studyQuickSwitchTimepoint .studyModality":function(){function e(e,t){t.select(!0)}return e}(),"loadStarted .studyTimepointStudy":function(){function e(e,t){t.loading.set(!0)}return e}(),"loadEnded .studyTimepointStudy":function(){function e(e,t){t.loading.set(!1),t.initializeStudyWrapper()}return e}(),"click .studyModality":function(){function e(e,t){var n=t.data.study,r=n.studyInstanceUid,i=n._id,a=t.isQuickSwitch();if(n.seriesList)t.select(a);else{var s=c.viewer.Studies.findBy({studyInstanceUid:r});s?n.seriesList=s.seriesList:!function(){var e=t.getStudyElement(!0);e.trigger("loadStarted"),c.studylist.retrieveStudyMetadata(r).then(function(n){t.data.study=n,c.viewer.Studies.insert(n),o.setTimeout(function(){e.trigger("loadEnded"),t.select(a)},1)})}()}}return e}()}),r.studyTimepointStudy.helpers({isLoading:function(){function e(){var e=r.instance(),t=e.data.study,n=c.viewer.Studies.findBy({studyInstanceUid:t.studyInstanceUid});return e.loading.get()&&!n}return e}(),modalities:function(){function e(){var e=r.instance(),t=e.data.study.modalities;return t.replace(/\\/g," ")}return e}(),modalityStyle:function(){function e(){var e=r.instance(),t=e.data.study.modalities||"UN",n=t.split(/\\/g).length;if(1===n)return"font-size: 1vw";if(2===n)return"font-size: 0.75vw";var o=1.2*Math.ceil(n/2);return"line-height: "+o+"vh"}return e}()})}]},windowLevelPresets:{"template.form.js":function(){k.__checkName("windowLevelPresetsForm"),k.windowLevelPresetsForm=new k("Template.windowLevelPresetsForm",function(){var e=this;return D._TemplateWith(function(){return P.dataMustache(e.lookup("extend"),e.lookup("."),P.kw({api:P.dot(e.lookup("instance"),"api")}))},function(){return P.include(e.lookupTemplate("form"),function(){return["\n ",L.DIV({class:"form-content"},"\n ",L.TABLE({class:"full-width"},"\n ",L.THEAD("\n ",L.TR("\n ",L.TH({class:"p-x-1 text-center"},"Preset"),"\n ",L.TH({class:"p-x-1"},"Description"),"\n ",L.TH({class:"p-x-1"},"Window Level (WL)"),"\n ",L.TH({class:"p-x-1"},"Window Width (WW)"),"\n "),"\n "),"\n ",L.TBODY("\n ",D.Each(function(){return{_sequence:P.call(e.lookup("getPresetsInputInformationList")),_variable:"presetInputInformation"}},function(){return["\n ",D._TemplateWith(function(){return{base:P.call("baseTr"),key:P.call(P.dataMustache(e.lookup("concat"),e.lookup("@index")))}},function(){return P.include(e.lookupTemplate("group"),function(){return["\n ",L.TD({class:"p-x-1 text-center"},D.View("lookup:sum",function(){return P.mustache(e.lookup("sum"),e.lookup("@index"),1)})),"\n ",L.TD({class:"p-x-1"},D._TemplateWith(function(){return{key:P.call("id"),value:P.call(P.dot(e.lookup("presetInputInformation"),"id"))}},function(){return P.include(e.lookupTemplate("inputText"))})),"\n ",L.TD({class:"p-x-1"},D._TemplateWith(function(){return{key:P.call("wc"),value:P.call(P.dataMustache(e.lookup("filterNaN"),P.dot(e.lookup("presetInputInformation"),"wc"))),dataType:P.call("Number")}},function(){return P.include(e.lookupTemplate("inputText"))})),"\n ",L.TD({class:"p-x-1"},D._TemplateWith(function(){return{key:P.call("ww"),value:P.call(P.dataMustache(e.lookup("filterNaN"),P.dot(e.lookup("presetInputInformation"),"ww"))),dataType:P.call("Number")}},function(){return P.include(e.lookupTemplate("inputText"))})),"\n "]})}),"\n "]}),"\n "),"\n "),"\n "),"\n ",L.DIV({class:"form-buttons clearfix"},"\n ",D._TemplateWith(function(){return{class:P.call("btn btn-danger pull-left"),action:P.call("resetDefaults")}},function(){return P.include(e.lookupTemplate("button"),function(){return"Reset to Defaults"})}),"\n ",D._TemplateWith(function(){return{class:P.call("btn btn-primary pull-right"),action:P.call("save")}},function(){return P.include(e.lookupTemplate("button"),function(){return"Save"})}),"\n "),"\n "]})})})},"form.js":["meteor/templating","meteor/underscore","meteor/ohif:core",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}});var r;n.import("meteor/underscore",{_:function(e){r=e}});var i;n.import("meteor/ohif:core",{OHIF:function(e){i=e}}),o.windowLevelPresetsForm.onCreated(function(){var e=o.instance(),t=i.viewerbase.wlPresets;e.api={save:function(){function n(){var n=e.$("form").first().data("component"),o=n.value();t.store(o)}return n}(),resetDefaults:function(){function e(){var e={title:"Reset Window Level Presets to Default",message:"Are you sure you want to reset all the window level presets to their defaults?"};return i.ui.showDialog("dialogConfirm",e).then(function(){return t.resetDefaults()})}return e}()}}),o.windowLevelPresetsForm.helpers({getPresetsInputInformationList:function(){function e(){return i.viewerbase.wlPresets.changeObserver.depend(),r.toArray(i.viewer.wlPresets)}return e}()})}]}}},"collections.js":["meteor/meteor","../namespace","./lib/classes/TypeSafeCollection",function(e,t,n){var o;n.import("meteor/meteor",{Meteor:function(e){o=e}});var r;n.import("../namespace",{OHIF:function(e){r=e}});var i;n.import("./lib/classes/TypeSafeCollection",{TypeSafeCollection:function(e){i=e}});var a=new i;r.viewer.Studies=a;var s=new i;r.viewer.StudyMetadataList=s,o.subscribe("studyImportStatus")}],"index.js":["../namespace","./collections","./lib/debugReactivity","./lib/getElementIfNotEmpty","./lib/getStackDataIfNotEmpty","./lib/switchToImageRelative","./lib/switchToImageByIndex","./lib/getFrameOfReferenceUID","./lib/updateCrosshairsSynchronizer","./lib/getImageId","./lib/setActiveViewport","./lib/setFocusToActiveViewport","./lib/getWADORSImageId","./lib/updateAllViewports","./lib/sortStudy","./lib/updateMetaDataManager","./lib/updateOrientationMarkers","./lib/isImage","./lib/instanceClassSpecificViewport","./lib/displayReferenceLines","./lib/imageViewerViewportData","./lib/panelNavigation","./lib/prepareViewerData","./lib/renderViewer","./lib/WLPresets","./lib/hotkeyUtils","./lib/viewportOverlayUtils","./lib/viewportUtils","./lib/thumbnailDragHandlers","./lib/dialogUtils","./lib/unloadHandlers","./lib/sortingManager","./lib/crosshairsSynchronizers","./lib/annotateTextUtils","./lib/textMarkerUtils","./lib/createStacks","./lib/StackManager","./lib/toolManager","./lib/helpers/","./lib/sopClassDictionary","./lib/DICOMTagDescriptions","./lib/classes/ImageSet","./lib/classes/LayoutManager","./lib/classes/StudyPrefetcher","./lib/classes/ResizeViewportManager","./lib/classes/StudyLoadingListener","./lib/classes/metadata/StudyMetadata","./lib/classes/metadata/SeriesMetadata","./lib/classes/metadata/InstanceMetadata","./lib/classes/metadata/StudySummary","./lib/classes/TypeSafeCollection","./lib/classes/OHIFError","./lib/classes/StackImagePositionOffsetSynchronizer","./lib/classes/StudyMetadataSource",function(e,t,n){var o;n.import("../namespace",{Viewerbase:function(e){o=e}}),n.import("./collections"),n.import("./lib/debugReactivity");var r;n.import("./lib/getElementIfNotEmpty",{getElementIfNotEmpty:function(e){r=e}});var i;n.import("./lib/getStackDataIfNotEmpty",{getStackDataIfNotEmpty:function(e){i=e}});var a;n.import("./lib/switchToImageRelative",{switchToImageRelative:function(e){a=e}});var s;n.import("./lib/switchToImageByIndex",{switchToImageByIndex:function(e){s=e}});var c;n.import("./lib/getFrameOfReferenceUID",{getFrameOfReferenceUID:function(e){c=e}});var u;n.import("./lib/updateCrosshairsSynchronizer",{updateCrosshairsSynchronizer:function(e){u=e}});var l;n.import("./lib/getImageId",{getImageId:function(e){l=e}});var d;n.import("./lib/setActiveViewport",{setActiveViewport:function(e){d=e}});var m;n.import("./lib/setFocusToActiveViewport",{setFocusToActiveViewport:function(e){m=e}});var p;n.import("./lib/getWADORSImageId",{getWADORSImageId:function(e){p=e}});var f;n.import("./lib/updateAllViewports",{updateAllViewports:function(e){f=e}});var g;n.import("./lib/sortStudy",{sortStudy:function(e){g=e}});var x;n.import("./lib/updateMetaDataManager",{updateMetaDataManager:function(e){x=e}});var h;n.import("./lib/updateOrientationMarkers",{updateOrientationMarkers:function(e){h=e}});var v;n.import("./lib/isImage",{isImage:function(e){v=e}});var S,y;n.import("./lib/instanceClassSpecificViewport",{getInstanceClassDefaultViewport:function(e){S=e},setInstanceClassDefaultViewportFunction:function(e){y=e}});var I;n.import("./lib/displayReferenceLines",{displayReferenceLines:function(e){I=e}});var T;n.import("./lib/imageViewerViewportData",{imageViewerViewportData:function(e){T=e}});var b;n.import("./lib/panelNavigation",{panelNavigation:function(e){b=e}});var D;n.import("./lib/prepareViewerData",{prepareViewerData:function(e){D=e}});var w;n.import("./lib/renderViewer",{renderViewer:function(e){w=e}});var C;n.import("./lib/WLPresets",{WLPresets:function(e){C=e}});var P;n.import("./lib/hotkeyUtils",{hotkeyUtils:function(e){P=e}});var k;n.import("./lib/viewportOverlayUtils",{viewportOverlayUtils:function(e){k=e}});var R;n.import("./lib/viewportUtils",{viewportUtils:function(e){R=e}});var V;n.import("./lib/thumbnailDragHandlers",{thumbnailDragHandlers:function(e){V=e}});var O;n.import("./lib/dialogUtils",{dialogUtils:function(e){O=e}});var M;n.import("./lib/unloadHandlers",{unloadHandlers:function(e){M=e}});var A;n.import("./lib/sortingManager",{sortingManager:function(e){A=e}});var q;n.import("./lib/crosshairsSynchronizers",{crosshairsSynchronizers:function(e){q=e}});var L;n.import("./lib/annotateTextUtils",{annotateTextUtils:function(e){L=e}});var N;n.import("./lib/textMarkerUtils",{textMarkerUtils:function(e){N=e}});var E;n.import("./lib/createStacks",{createStacks:function(e){E=e}});var F;n.import("./lib/StackManager",{StackManager:function(e){F=e}});var B;n.import("./lib/toolManager",{toolManager:function(e){B=e}});var U;n.import("./lib/helpers/",{helpers:function(e){U=e}});var _;n.import("./lib/sopClassDictionary",{sopClassDictionary:function(e){_=e}});var j;n.import("./lib/DICOMTagDescriptions",{DICOMTagDescriptions:function(e){j=e}});var H;n.import("./lib/classes/ImageSet",{ImageSet:function(e){H=e}});var W;n.import("./lib/classes/LayoutManager",{LayoutManager:function(e){W=e}});var z;n.import("./lib/classes/StudyPrefetcher",{StudyPrefetcher:function(e){z=e}});var G;n.import("./lib/classes/ResizeViewportManager",{ResizeViewportManager:function(e){G=e}});var X;n.import("./lib/classes/StudyLoadingListener",{StudyLoadingListener:function(e){X=e}});var $;n.import("./lib/classes/StudyLoadingListener",{StackLoadingListener:function(e){$=e}});var Y;n.import("./lib/classes/StudyLoadingListener",{DICOMFileLoadingListener:function(e){Y=e}});var Q;n.import("./lib/classes/metadata/StudyMetadata",{StudyMetadata:function(e){Q=e}});var K;n.import("./lib/classes/metadata/SeriesMetadata",{SeriesMetadata:function(e){K=e}});var Z;n.import("./lib/classes/metadata/InstanceMetadata",{InstanceMetadata:function(e){Z=e}});var J;n.import("./lib/classes/metadata/StudySummary",{StudySummary:function(e){J=e}});var ee;n.import("./lib/classes/TypeSafeCollection",{TypeSafeCollection:function(e){ee=e}});var te;n.import("./lib/classes/OHIFError",{OHIFError:function(e){te=e}});var ne;n.import("./lib/classes/StackImagePositionOffsetSynchronizer",{StackImagePositionOffsetSynchronizer:function(e){ne=e}});var oe;n.import("./lib/classes/StudyMetadataSource",{StudyMetadataSource:function(e){oe=e}}),o.getElementIfNotEmpty=r,o.getStackDataIfNotEmpty=i,o.switchToImageRelative=a,o.switchToImageByIndex=s,o.getFrameOfReferenceUID=c,o.updateCrosshairsSynchronizer=u,o.getImageId=l,o.setActiveViewport=d,o.setFocusToActiveViewport=m,o.getWADORSImageId=p,o.updateAllViewports=f,o.sortStudy=g,o.updateMetaDataManager=x,o.updateOrientationMarkers=h,o.isImage=v,o.getInstanceClassDefaultViewport=S,o.setInstanceClassDefaultViewportFunction=y,o.displayReferenceLines=I,o.imageViewerViewportData=T,o.panelNavigation=b,o.prepareViewerData=D,o.renderViewer=w,o.wlPresets=C,o.hotkeyUtils=P,o.viewportOverlayUtils=k,o.viewportUtils=R,o.thumbnailDragHandlers=V,o.dialogUtils=O,o.unloadHandlers=M,o.sortingManager=A,o.crosshairsSynchronizers=q,o.annotateTextUtils=L,o.textMarkerUtils=N,o.createStacks=E,o.stackManager=F,o.toolManager=B,o.helpers=U,o.sopClassDictionary=_,o.DICOMTagDescriptions=j,o.ImageSet=H,o.LayoutManager=W,o.StudyPrefetcher=z,o.ResizeViewportManager=G,o.StudyLoadingListener=X,o.StackLoadingListener=$,o.DICOMFileLoadingListener=Y,o.metadata={StudyMetadata:Q,SeriesMetadata:K,InstanceMetadata:Z,StudySummary:J},o.TypeSafeCollection=ee,o.OHIFError=te,o.StackImagePositionOffsetSynchronizer=ne,o.StudyMetadataSource=oe}],lib:{"DICOMTagDescriptions.js":["babel-runtime/helpers/typeof",function(e,t,n){n.export({DICOMTagDescriptions:function(){return s}});var o;n.import("babel-runtime/helpers/typeof",{default:function(e){o=e}});var r="number",i="string",a=/^x[0-9a-fx]{8}$/,s=Object.create(Object.prototype,{_descriptions:{configurable:!1,enumerable:!1,writable:!1,value:Object.create(null)},tagNumberToString:{configurable:!1,enumerable:!0,writable:!1,value:function(){function e(e){var t=void 0;return this.isValidTagNumber(e)&&(t="x"+("00000000"+e.toString(16)).substr(-8)),t}return e}()},isValidTagNumber:{configurable:!1,enumerable:!0,writable:!1,value:function(){function e(e){return("undefined"==typeof e?"undefined":o(e))===r&&e>=0&&e<=4294967295}return e}()},isValidTag:{configurable:!1,enumerable:!0,writable:!1,value:function(){function e(e){return("undefined"==typeof e?"undefined":o(e))===i?a.test(e):this.isValidTagNumber(e)}return e}()},find:{configurable:!1,enumerable:!0,writable:!1,value:function(){function e(e){var t=void 0;return("undefined"==typeof e?"undefined":o(e))!==i&&(e=this.tagNumberToString(e)),("undefined"==typeof e?"undefined":o(e))===i&&(t=this._descriptions[e]),t}return e}()},init:{configurable:!1,enumerable:!0,writable:!1,value:function(){function e(e){var t=Object.prototype.hasOwnProperty,n=this._descriptions;for(var o in g.sanitizeForInObject(e))if(t.call(e,o)){if(!this.isValidTag(o)){console.info('DICOMTagDescriptions: Invalid tag "'+o+'"...');continue}if(o in n){console.info('DICOMTagDescriptions: Duplicated tag "'+o+'"...');continue}var r=e[o],i=Object.create(null);if(i.tag=o,i.keyword=r,Object.freeze(i),n[o]=i,r in n){var a=n[r];console.info("DICOMTagDescriptions: Using <"+a.tag+","+a.keyword+"> instead of <"+i.tag+","+i.keyword+'> for keyword "'+r+'"...')}else n[r]=i}Object.freeze(n),Object.freeze(this)}return e}()}}),c={x00020000:"FileMetaInfoGroupLength",x00020001:"FileMetaInfoVersion",x00020002:"MediaStorageSOPClassUID",x00020003:"MediaStorageSOPInstanceUID",x00020010:"TransferSyntaxUID",x00020012:"ImplementationClassUID",x00020013:"ImplementationVersionName",x00020016:"SourceApplicationEntityTitle",x00020100:"PrivateInformationCreatorUID",x00020102:"PrivateInformation",x00041130:"FileSetID",x00041141:"FileSetDescriptorFileID",x00041142:"SpecificCharacterSetOfFile",x00041200:"FirstDirectoryRecordOffset",x00041202:"LastDirectoryRecordOffset",x00041212:"FileSetConsistencyFlag",x00041220:"DirectoryRecordSequence",x00041400:"OffsetOfNextDirectoryRecord",x00041410:"RecordInUseFlag",x00041420:"LowerLevelDirectoryEntityOffset",x00041430:"DirectoryRecordType",x00041432:"PrivateRecordUID",x00041500:"ReferencedFileID",x00041504:"MRDRDirectoryRecordOffset",x00041510:"ReferencedSOPClassUIDInFile",x00041511:"ReferencedSOPInstanceUIDInFile",x00041512:"ReferencedTransferSyntaxUIDInFile",x0004151a:"ReferencedRelatedSOPClassUIDInFile",x00041600:"NumberOfReferences",x00080000:"IdentifyingGroupLength",x00080001:"LengthToEnd",x00080005:"SpecificCharacterSet",x00080006:"LanguageCodeSequence",x00080008:"ImageType",x00080010:"RecognitionCode",x00080012:"InstanceCreationDate",x00080013:"InstanceCreationTime",x00080014:"InstanceCreatorUID",x00080016:"SOPClassUID",x00080018:"SOPInstanceUID",x0008001a:"RelatedGeneralSOPClassUID",x0008001b:"OriginalSpecializedSOPClassUID",x00080020:"StudyDate",x00080021:"SeriesDate",x00080022:"AcquisitionDate",x00080023:"ContentDate",x00080024:"OverlayDate",x00080025:"CurveDate",x0008002a:"AcquisitionDateTime",x00080030:"StudyTime",x00080031:"SeriesTime",x00080032:"AcquisitionTime",x00080033:"ContentTime",x00080034:"OverlayTime",x00080035:"CurveTime",x00080040:"DataSetType",x00080041:"DataSetSubtype",x00080042:"NuclearMedicineSeriesType",x00080050:"AccessionNumber",x00080052:"QueryRetrieveLevel",x00080054:"RetrieveAETitle",x00080056:"InstanceAvailability",x00080058:"FailedSOPInstanceUIDList",x00080060:"Modality",x00080061:"ModalitiesInStudy",x00080062:"SOPClassesInStudy",x00080064:"ConversionType",x00080068:"PresentationIntentType",x00080070:"Manufacturer",x00080080:"InstitutionName",x00080081:"InstitutionAddress",x00080082:"InstitutionCodeSequence",x00080090:"ReferringPhysicianName",x00080092:"ReferringPhysicianAddress",x00080094:"ReferringPhysicianTelephoneNumber",x00080096:"ReferringPhysicianIDSequence",x00080100:"CodeValue",x00080102:"CodingSchemeDesignator",x00080103:"CodingSchemeVersion",x00080104:"CodeMeaning",x00080105:"MappingResource",x00080106:"ContextGroupVersion",x00080107:"ContextGroupLocalVersion",x0008010b:"ContextGroupExtensionFlag",x0008010c:"CodingSchemeUID",x0008010d:"ContextGroupExtensionCreatorUID",x0008010f:"ContextIdentifier",x00080110:"CodingSchemeIDSequence",x00080112:"CodingSchemeRegistry",x00080114:"CodingSchemeExternalID",x00080115:"CodingSchemeName",x00080116:"CodingSchemeResponsibleOrganization",x00080117:"ContextUID",x00080201:"TimezoneOffsetFromUTC",x00081000:"NetworkID",x00081010:"StationName",x00081030:"StudyDescription",x00081032:"ProcedureCodeSequence",x0008103e:"SeriesDescription",x00081040:"InstitutionalDepartmentName",x00081048:"PhysiciansOfRecord",x00081049:"PhysiciansOfRecordIDSequence",x00081050:"PerformingPhysicianName",x00081052:"PerformingPhysicianIDSequence",x00081060:"NameOfPhysicianReadingStudy",x00081062:"PhysicianReadingStudyIDSequence",x00081070:"OperatorsName",x00081072:"OperatorIDSequence",x00081080:"AdmittingDiagnosesDescription",x00081084:"AdmittingDiagnosesCodeSequence",x00081090:"ManufacturersModelName",x00081100:"ReferencedResultsSequence",x00081110:"ReferencedStudySequence",x00081111:"ReferencedPerformedProcedureStepSequence",x00081115:"ReferencedSeriesSequence",x00081120:"ReferencedPatientSequence",x00081125:"ReferencedVisitSequence",x00081130:"ReferencedOverlaySequence",x0008113a:"ReferencedWaveformSequence",x00081140:"ReferencedImageSequence",x00081145:"ReferencedCurveSequence",x0008114a:"ReferencedInstanceSequence",x00081150:"ReferencedSOPClassUID",x00081155:"ReferencedSOPInstanceUID",x0008115a:"SOPClassesSupported",x00081160:"ReferencedFrameNumber",x00081161:"SimpleFrameList",x00081162:"CalculatedFrameList",x00081163:"TimeRange",x00081164:"FrameExtractionSequence",x00081195:"TransactionUID",x00081197:"FailureReason",x00081198:"FailedSOPSequence",x00081199:"ReferencedSOPSequence",x00081200:"OtherReferencedStudiesSequence",x00081250:"RelatedSeriesSequence",x00082110:"LossyImageCompressionRetired",x00082111:"DerivationDescription",x00082112:"SourceImageSequence",x00082120:"StageName",x00082122:"StageNumber",x00082124:"NumberOfStages",x00082127:"ViewName",x00082128:"ViewNumber",x00082129:"NumberOfEventTimers",x0008212a:"NumberOfViewsInStage",x00082130:"EventElapsedTimes",x00082132:"EventTimerNames",x00082133:"EventTimerSequence",x00082134:"EventTimeOffset",x00082135:"EventCodeSequence",x00082142:"StartTrim",x00082143:"StopTrim",x00082144:"RecommendedDisplayFrameRate",x00082200:"TransducerPosition",x00082204:"TransducerOrientation",x00082208:"AnatomicStructure",x00082218:"AnatomicRegionSequence",x00082220:"AnatomicRegionModifierSequence",x00082228:"PrimaryAnatomicStructureSequence",x00082229:"AnatomicStructureOrRegionSequence",x00082230:"AnatomicStructureModifierSequence",x00082240:"TransducerPositionSequence",x00082242:"TransducerPositionModifierSequence",x00082244:"TransducerOrientationSequence",x00082246:"TransducerOrientationModifierSeq",x00082253:"AnatomicEntrancePortalCodeSeqTrial",x00082255:"AnatomicApproachDirCodeSeqTrial",x00082256:"AnatomicPerspectiveDescrTrial",x00082257:"AnatomicPerspectiveCodeSeqTrial",x00083001:"AlternateRepresentationSequence",x00083010:"IrradiationEventUID",x00084000:"IdentifyingComments",x00089007:"FrameType",x00089092:"ReferencedImageEvidenceSequence",x00089121:"ReferencedRawDataSequence",x00089123:"CreatorVersionUID",x00089124:"DerivationImageSequence",x00089154:"SourceImageEvidenceSequence",x00089205:"PixelPresentation",x00089206:"VolumetricProperties",x00089207:"VolumeBasedCalculationTechnique",x00089208:"ComplexImageComponent",x00089209:"AcquisitionContrast",x00089215:"DerivationCodeSequence",x00089237:"GrayscalePresentationStateSequence",x00089410:"ReferencedOtherPlaneSequence",x00089458:"FrameDisplaySequence",x00089459:"RecommendedDisplayFrameRateInFloat",x00089460:"SkipFrameRangeFlag",x00100000:"PatientGroupLength",x00100010:"PatientName",x00100020:"PatientID",x00100021:"IssuerOfPatientID",x00100022:"TypeOfPatientID",x00100030:"PatientBirthDate",x00100032:"PatientBirthTime",x00100040:"PatientSex",x00100050:"PatientInsurancePlanCodeSequence",x00100101:"PatientPrimaryLanguageCodeSeq",x00100102:"PatientPrimaryLanguageCodeModSeq",x00101000:"OtherPatientIDs",x00101001:"OtherPatientNames",x00101002:"OtherPatientIDsSequence",x00101005:"PatientBirthName",x00101010:"PatientAge",x00101020:"PatientSize",x00101030:"PatientWeight",x00101040:"PatientAddress",x00101050:"InsurancePlanIdentification",x00101060:"PatientMotherBirthName",x00101080:"MilitaryRank",x00101081:"BranchOfService",x00101090:"MedicalRecordLocator",x00102000:"MedicalAlerts",x00102110:"Allergies",x00102150:"CountryOfResidence",x00102152:"RegionOfResidence",x00102154:"PatientTelephoneNumbers",x00102160:"EthnicGroup",x00102180:"Occupation",x001021a0:"SmokingStatus",x001021b0:"AdditionalPatientHistory",x001021c0:"PregnancyStatus",x001021d0:"LastMenstrualDate",x001021f0:"PatientReligiousPreference",x00102201:"PatientSpeciesDescription",x00102202:"PatientSpeciesCodeSequence",x00102203:"PatientSexNeutered",x00102210:"AnatomicalOrientationType",x00102292:"PatientBreedDescription",x00102293:"PatientBreedCodeSequence",x00102294:"BreedRegistrationSequence",x00102295:"BreedRegistrationNumber",x00102296:"BreedRegistryCodeSequence",x00102297:"ResponsiblePerson",x00102298:"ResponsiblePersonRole",x00102299:"ResponsibleOrganization",x00104000:"PatientComments",x00109431:"ExaminedBodyThickness",x00111010:"PatientStatus",x00120010:"ClinicalTrialSponsorName",x00120020:"ClinicalTrialProtocolID",x00120021:"ClinicalTrialProtocolName",x00120030:"ClinicalTrialSiteID",x00120031:"ClinicalTrialSiteName",x00120040:"ClinicalTrialSubjectID",x00120042:"ClinicalTrialSubjectReadingID",x00120050:"ClinicalTrialTimePointID",x00120051:"ClinicalTrialTimePointDescription",x00120060:"ClinicalTrialCoordinatingCenter",x00120062:"PatientIdentityRemoved",x00120063:"DeidentificationMethod",x00120064:"DeidentificationMethodCodeSequence",x00120071:"ClinicalTrialSeriesID",x00120072:"ClinicalTrialSeriesDescription",x00120084:"DistributionType",x00120085:"ConsentForDistributionFlag",x00180000:"AcquisitionGroupLength",x00180010:"ContrastBolusAgent",x00180012:"ContrastBolusAgentSequence",x00180014:"ContrastBolusAdministrationRoute",x00180015:"BodyPartExamined",x00180020:"ScanningSequence",x00180021:"SequenceVariant",x00180022:"ScanOptions",x00180023:"MRAcquisitionType",x00180024:"SequenceName",x00180025:"AngioFlag",x00180026:"InterventionDrugInformationSeq",x00180027:"InterventionDrugStopTime",x00180028:"InterventionDrugDose",x00180029:"InterventionDrugSequence",x0018002a:"AdditionalDrugSequence",x00180030:"Radionuclide",x00180031:"Radiopharmaceutical",x00180032:"EnergyWindowCenterline",x00180033:"EnergyWindowTotalWidth",x00180034:"InterventionDrugName",x00180035:"InterventionDrugStartTime",x00180036:"InterventionSequence",x00180037:"TherapyType",x00180038:"InterventionStatus",x00180039:"TherapyDescription",x0018003a:"InterventionDescription",x00180040:"CineRate",x00180042:"InitialCineRunState",x00180050:"SliceThickness",x00180060:"KVP",x00180070:"CountsAccumulated",x00180071:"AcquisitionTerminationCondition",x00180072:"EffectiveDuration",x00180073:"AcquisitionStartCondition",x00180074:"AcquisitionStartConditionData",x00180075:"AcquisitionEndConditionData",x00180080:"RepetitionTime",x00180081:"EchoTime",x00180082:"InversionTime",x00180083:"NumberOfAverages",x00180084:"ImagingFrequency",x00180085:"ImagedNucleus",x00180086:"EchoNumber",x00180087:"MagneticFieldStrength",x00180088:"SpacingBetweenSlices",x00180089:"NumberOfPhaseEncodingSteps",x00180090:"DataCollectionDiameter",x00180091:"EchoTrainLength",x00180093:"PercentSampling",x00180094:"PercentPhaseFieldOfView",x00180095:"PixelBandwidth",x00181000:"DeviceSerialNumber",x00181002:"DeviceUID",x00181003:"DeviceID",x00181004:"PlateID",x00181005:"GeneratorID",x00181006:"GridID",x00181007:"CassetteID",x00181008:"GantryID",x00181010:"SecondaryCaptureDeviceID",x00181011:"HardcopyCreationDeviceID",x00181012:"DateOfSecondaryCapture",x00181014:"TimeOfSecondaryCapture",x00181016:"SecondaryCaptureDeviceManufacturer",x00181017:"HardcopyDeviceManufacturer",x00181018:"SecondaryCaptureDeviceModelName",x00181019:"SecondaryCaptureDeviceSoftwareVers",x0018101a:"HardcopyDeviceSoftwareVersion",x0018101b:"HardcopyDeviceModelName",x00181020:"SoftwareVersion",x00181022:"VideoImageFormatAcquired",x00181023:"DigitalImageFormatAcquired",x00181030:"ProtocolName",x00181040:"ContrastBolusRoute",x00181041:"ContrastBolusVolume",x00181042:"ContrastBolusStartTime",x00181043:"ContrastBolusStopTime",x00181044:"ContrastBolusTotalDose",x00181045:"SyringeCounts",x00181046:"ContrastFlowRate",x00181047:"ContrastFlowDuration",x00181048:"ContrastBolusIngredient",x00181049:"ContrastBolusConcentration",x00181050:"SpatialResolution",x00181060:"TriggerTime",x00181061:"TriggerSourceOrType",x00181062:"NominalInterval",x00181063:"FrameTime",x00181064:"CardiacFramingType",x00181065:"FrameTimeVector",x00181066:"FrameDelay",x00181067:"ImageTriggerDelay",x00181068:"MultiplexGroupTimeOffset",x00181069:"TriggerTimeOffset",x0018106a:"SynchronizationTrigger",x0018106c:"SynchronizationChannel",x0018106e:"TriggerSamplePosition",x00181070:"RadiopharmaceuticalRoute",x00181071:"RadiopharmaceuticalVolume",x00181072:"RadiopharmaceuticalStartTime",x00181073:"RadiopharmaceuticalStopTime",x00181074:"RadionuclideTotalDose",x00181075:"RadionuclideHalfLife",x00181076:"RadionuclidePositronFraction",x00181077:"RadiopharmaceuticalSpecActivity",x00181078:"RadiopharmaceuticalStartDateTime",x00181079:"RadiopharmaceuticalStopDateTime",x00181080:"BeatRejectionFlag",x00181081:"LowRRValue",x00181082:"HighRRValue",x00181083:"IntervalsAcquired",x00181084:"IntervalsRejected",x00181085:"PVCRejection",x00181086:"SkipBeats",x00181088:"HeartRate",x00181090:"CardiacNumberOfImages",x00181094:"TriggerWindow",x00181100:"ReconstructionDiameter",x00181110:"DistanceSourceToDetector",x00181111:"DistanceSourceToPatient",x00181114:"EstimatedRadiographicMagnification",x00181120:"GantryDetectorTilt",x00181121:"GantryDetectorSlew",x00181130:"TableHeight",x00181131:"TableTraverse",x00181134:"TableMotion",x00181135:"TableVerticalIncrement",x00181136:"TableLateralIncrement",x00181137:"TableLongitudinalIncrement",x00181138:"TableAngle",x0018113a:"TableType",x00181140:"RotationDirection",x00181141:"AngularPosition",x00181142:"RadialPosition",x00181143:"ScanArc",x00181144:"AngularStep",x00181145:"CenterOfRotationOffset",x00181146:"RotationOffset",x00181147:"FieldOfViewShape",x00181149:"FieldOfViewDimensions",x00181150:"ExposureTime",x00181151:"XRayTubeCurrent",x00181152:"Exposure",x00181153:"ExposureInMicroAmpSec",x00181154:"AveragePulseWidth",x00181155:"RadiationSetting",x00181156:"RectificationType",x0018115a:"RadiationMode",x0018115e:"ImageAreaDoseProduct",x00181160:"FilterType",x00181161:"TypeOfFilters",x00181162:"IntensifierSize",x00181164:"ImagerPixelSpacing",x00181166:"Grid",x00181170:"GeneratorPower",
x00181180:"CollimatorGridName",x00181181:"CollimatorType",x00181182:"FocalDistance",x00181183:"XFocusCenter",x00181184:"YFocusCenter",x00181190:"FocalSpots",x00181191:"AnodeTargetMaterial",x001811a0:"BodyPartThickness",x001811a2:"CompressionForce",x00181200:"DateOfLastCalibration",x00181201:"TimeOfLastCalibration",x00181210:"ConvolutionKernel",x00181240:"UpperLowerPixelValues",x00181242:"ActualFrameDuration",x00181243:"CountRate",x00181244:"PreferredPlaybackSequencing",x00181250:"ReceiveCoilName",x00181251:"TransmitCoilName",x00181260:"PlateType",x00181261:"PhosphorType",x00181300:"ScanVelocity",x00181301:"WholeBodyTechnique",x00181302:"ScanLength",x00181310:"AcquisitionMatrix",x00181312:"InPlanePhaseEncodingDirection",x00181314:"FlipAngle",x00181315:"VariableFlipAngleFlag",x00181316:"SAR",x00181318:"DB-Dt",x00181400:"AcquisitionDeviceProcessingDescr",x00181401:"AcquisitionDeviceProcessingCode",x00181402:"CassetteOrientation",x00181403:"CassetteSize",x00181404:"ExposuresOnPlate",x00181405:"RelativeXRayExposure",x00181450:"ColumnAngulation",x00181460:"TomoLayerHeight",x00181470:"TomoAngle",x00181480:"TomoTime",x00181490:"TomoType",x00181491:"TomoClass",x00181495:"NumberOfTomosynthesisSourceImages",x00181500:"PositionerMotion",x00181508:"PositionerType",x00181510:"PositionerPrimaryAngle",x00181511:"PositionerSecondaryAngle",x00181520:"PositionerPrimaryAngleIncrement",x00181521:"PositionerSecondaryAngleIncrement",x00181530:"DetectorPrimaryAngle",x00181531:"DetectorSecondaryAngle",x00181600:"ShutterShape",x00181602:"ShutterLeftVerticalEdge",x00181604:"ShutterRightVerticalEdge",x00181606:"ShutterUpperHorizontalEdge",x00181608:"ShutterLowerHorizontalEdge",x00181610:"CenterOfCircularShutter",x00181612:"RadiusOfCircularShutter",x00181620:"VerticesOfPolygonalShutter",x00181622:"ShutterPresentationValue",x00181623:"ShutterOverlayGroup",x00181624:"ShutterPresentationColorCIELabVal",x00181700:"CollimatorShape",x00181702:"CollimatorLeftVerticalEdge",x00181704:"CollimatorRightVerticalEdge",x00181706:"CollimatorUpperHorizontalEdge",x00181708:"CollimatorLowerHorizontalEdge",x00181710:"CenterOfCircularCollimator",x00181712:"RadiusOfCircularCollimator",x00181720:"VerticesOfPolygonalCollimator",x00181800:"AcquisitionTimeSynchronized",x00181801:"TimeSource",x00181802:"TimeDistributionProtocol",x00181803:"NTPSourceAddress",x00182001:"PageNumberVector",x00182002:"FrameLabelVector",x00182003:"FramePrimaryAngleVector",x00182004:"FrameSecondaryAngleVector",x00182005:"SliceLocationVector",x00182006:"DisplayWindowLabelVector",x00182010:"NominalScannedPixelSpacing",x00182020:"DigitizingDeviceTransportDirection",x00182030:"RotationOfScannedFilm",x00183100:"IVUSAcquisition",x00183101:"IVUSPullbackRate",x00183102:"IVUSGatedRate",x00183103:"IVUSPullbackStartFrameNumber",x00183104:"IVUSPullbackStopFrameNumber",x00183105:"LesionNumber",x00184000:"AcquisitionComments",x00185000:"OutputPower",x00185010:"TransducerData",x00185012:"FocusDepth",x00185020:"ProcessingFunction",x00185021:"PostprocessingFunction",x00185022:"MechanicalIndex",x00185024:"BoneThermalIndex",x00185026:"CranialThermalIndex",x00185027:"SoftTissueThermalIndex",x00185028:"SoftTissueFocusThermalIndex",x00185029:"SoftTissueSurfaceThermalIndex",x00185030:"DynamicRange",x00185040:"TotalGain",x00185050:"DepthOfScanField",x00185100:"PatientPosition",x00185101:"ViewPosition",x00185104:"ProjectionEponymousNameCodeSeq",x00185210:"ImageTransformationMatrix",x00185212:"ImageTranslationVector",x00186000:"Sensitivity",x00186011:"SequenceOfUltrasoundRegions",x00186012:"RegionSpatialFormat",x00186014:"RegionDataType",x00186016:"RegionFlags",x00186018:"RegionLocationMinX0",x0018601a:"RegionLocationMinY0",x0018601c:"RegionLocationMaxX1",x0018601e:"RegionLocationMaxY1",x00186020:"ReferencePixelX0",x00186022:"ReferencePixelY0",x00186024:"PhysicalUnitsXDirection",x00186026:"PhysicalUnitsYDirection",x00186028:"ReferencePixelPhysicalValueX",x0018602a:"ReferencePixelPhysicalValueY",x0018602c:"PhysicalDeltaX",x0018602e:"PhysicalDeltaY",x00186030:"TransducerFrequency",x00186031:"TransducerType",x00186032:"PulseRepetitionFrequency",x00186034:"DopplerCorrectionAngle",x00186036:"SteeringAngle",x00186038:"DopplerSampleVolumeXPosRetired",x00186039:"DopplerSampleVolumeXPosition",x0018603a:"DopplerSampleVolumeYPosRetired",x0018603b:"DopplerSampleVolumeYPosition",x0018603c:"TMLinePositionX0Retired",x0018603d:"TMLinePositionX0",x0018603e:"TMLinePositionY0Retired",x0018603f:"TMLinePositionY0",x00186040:"TMLinePositionX1Retired",x00186041:"TMLinePositionX1",x00186042:"TMLinePositionY1Retired",x00186043:"TMLinePositionY1",x00186044:"PixelComponentOrganization",x00186046:"PixelComponentMask",x00186048:"PixelComponentRangeStart",x0018604a:"PixelComponentRangeStop",x0018604c:"PixelComponentPhysicalUnits",x0018604e:"PixelComponentDataType",x00186050:"NumberOfTableBreakPoints",x00186052:"TableOfXBreakPoints",x00186054:"TableOfYBreakPoints",x00186056:"NumberOfTableEntries",x00186058:"TableOfPixelValues",x0018605a:"TableOfParameterValues",x00186060:"RWaveTimeVector",x00187000:"DetectorConditionsNominalFlag",x00187001:"DetectorTemperature",x00187004:"DetectorType",x00187005:"DetectorConfiguration",x00187006:"DetectorDescription",x00187008:"DetectorMode",x0018700a:"DetectorID",x0018700c:"DateOfLastDetectorCalibration",x0018700e:"TimeOfLastDetectorCalibration",x00187010:"DetectorExposuresSinceCalibration",x00187011:"DetectorExposuresSinceManufactured",x00187012:"DetectorTimeSinceLastExposure",x00187014:"DetectorActiveTime",x00187016:"DetectorActiveOffsetFromExposure",x0018701a:"DetectorBinning",x00187020:"DetectorElementPhysicalSize",x00187022:"DetectorElementSpacing",x00187024:"DetectorActiveShape",x00187026:"DetectorActiveDimensions",x00187028:"DetectorActiveOrigin",x0018702a:"DetectorManufacturerName",x0018702b:"DetectorManufacturersModelName",x00187030:"FieldOfViewOrigin",x00187032:"FieldOfViewRotation",x00187034:"FieldOfViewHorizontalFlip",x00187040:"GridAbsorbingMaterial",x00187041:"GridSpacingMaterial",x00187042:"GridThickness",x00187044:"GridPitch",x00187046:"GridAspectRatio",x00187048:"GridPeriod",x0018704c:"GridFocalDistance",x00187050:"FilterMaterial",x00187052:"FilterThicknessMinimum",x00187054:"FilterThicknessMaximum",x00187060:"ExposureControlMode",x00187062:"ExposureControlModeDescription",x00187064:"ExposureStatus",x00187065:"PhototimerSetting",x00188150:"ExposureTimeInMicroSec",x00188151:"XRayTubeCurrentInMicroAmps",x00189004:"ContentQualification",x00189005:"PulseSequenceName",x00189006:"MRImagingModifierSequence",x00189008:"EchoPulseSequence",x00189009:"InversionRecovery",x00189010:"FlowCompensation",x00189011:"MultipleSpinEcho",x00189012:"MultiPlanarExcitation",x00189014:"PhaseContrast",x00189015:"TimeOfFlightContrast",x00189016:"Spoiling",x00189017:"SteadyStatePulseSequence",x00189018:"EchoPlanarPulseSequence",x00189019:"TagAngleFirstAxis",x00189020:"MagnetizationTransfer",x00189021:"T2Preparation",x00189022:"BloodSignalNulling",x00189024:"SaturationRecovery",x00189025:"SpectrallySelectedSuppression",x00189026:"SpectrallySelectedExcitation",x00189027:"SpatialPresaturation",x00189028:"Tagging",x00189029:"OversamplingPhase",x00189030:"TagSpacingFirstDimension",x00189032:"GeometryOfKSpaceTraversal",x00189033:"SegmentedKSpaceTraversal",x00189034:"RectilinearPhaseEncodeReordering",x00189035:"TagThickness",x00189036:"PartialFourierDirection",x00189037:"CardiacSynchronizationTechnique",x00189041:"ReceiveCoilManufacturerName",x00189042:"MRReceiveCoilSequence",x00189043:"ReceiveCoilType",x00189044:"QuadratureReceiveCoil",x00189045:"MultiCoilDefinitionSequence",x00189046:"MultiCoilConfiguration",x00189047:"MultiCoilElementName",x00189048:"MultiCoilElementUsed",x00189049:"MRTransmitCoilSequence",x00189050:"TransmitCoilManufacturerName",x00189051:"TransmitCoilType",x00189052:"SpectralWidth",x00189053:"ChemicalShiftReference",x00189054:"VolumeLocalizationTechnique",x00189058:"MRAcquisitionFrequencyEncodeSteps",x00189059:"Decoupling",x00189060:"DecoupledNucleus",x00189061:"DecouplingFrequency",x00189062:"DecouplingMethod",x00189063:"DecouplingChemicalShiftReference",x00189064:"KSpaceFiltering",x00189065:"TimeDomainFiltering",x00189066:"NumberOfZeroFills",x00189067:"BaselineCorrection",x00189069:"ParallelReductionFactorInPlane",x00189070:"CardiacRRIntervalSpecified",x00189073:"AcquisitionDuration",x00189074:"FrameAcquisitionDateTime",x00189075:"DiffusionDirectionality",x00189076:"DiffusionGradientDirectionSequence",x00189077:"ParallelAcquisition",x00189078:"ParallelAcquisitionTechnique",x00189079:"InversionTimes",x00189080:"MetaboliteMapDescription",x00189081:"PartialFourier",x00189082:"EffectiveEchoTime",x00189083:"MetaboliteMapCodeSequence",x00189084:"ChemicalShiftSequence",x00189085:"CardiacSignalSource",x00189087:"DiffusionBValue",x00189089:"DiffusionGradientOrientation",x00189090:"VelocityEncodingDirection",x00189091:"VelocityEncodingMinimumValue",x00189093:"NumberOfKSpaceTrajectories",x00189094:"CoverageOfKSpace",x00189095:"SpectroscopyAcquisitionPhaseRows",x00189096:"ParallelReductFactorInPlaneRetired",x00189098:"TransmitterFrequency",x00189100:"ResonantNucleus",x00189101:"FrequencyCorrection",x00189103:"MRSpectroscopyFOV-GeometrySequence",x00189104:"SlabThickness",x00189105:"SlabOrientation",x00189106:"MidSlabPosition",x00189107:"MRSpatialSaturationSequence",x00189112:"MRTimingAndRelatedParametersSeq",x00189114:"MREchoSequence",x00189115:"MRModifierSequence",x00189117:"MRDiffusionSequence",x00189118:"CardiacTriggerSequence",x00189119:"MRAveragesSequence",x00189125:"MRFOV-GeometrySequence",x00189126:"VolumeLocalizationSequence",x00189127:"SpectroscopyAcquisitionDataColumns",x00189147:"DiffusionAnisotropyType",x00189151:"FrameReferenceDateTime",x00189152:"MRMetaboliteMapSequence",x00189155:"ParallelReductionFactorOutOfPlane",x00189159:"SpectroscopyOutOfPlanePhaseSteps",x00189166:"BulkMotionStatus",x00189168:"ParallelReductionFactSecondInPlane",x00189169:"CardiacBeatRejectionTechnique",x00189170:"RespiratoryMotionCompTechnique",x00189171:"RespiratorySignalSource",x00189172:"BulkMotionCompensationTechnique",x00189173:"BulkMotionSignalSource",x00189174:"ApplicableSafetyStandardAgency",x00189175:"ApplicableSafetyStandardDescr",x00189176:"OperatingModeSequence",x00189177:"OperatingModeType",x00189178:"OperatingMode",x00189179:"SpecificAbsorptionRateDefinition",x00189180:"GradientOutputType",x00189181:"SpecificAbsorptionRateValue",x00189182:"GradientOutput",x00189183:"FlowCompensationDirection",x00189184:"TaggingDelay",x00189185:"RespiratoryMotionCompTechDescr",x00189186:"RespiratorySignalSourceID",x00189195:"ChemicalShiftsMinIntegrateLimitHz",x00189196:"ChemicalShiftsMaxIntegrateLimitHz",x00189197:"MRVelocityEncodingSequence",x00189198:"FirstOrderPhaseCorrection",x00189199:"WaterReferencedPhaseCorrection",x00189200:"MRSpectroscopyAcquisitionType",x00189214:"RespiratoryCyclePosition",x00189217:"VelocityEncodingMaximumValue",x00189218:"TagSpacingSecondDimension",x00189219:"TagAngleSecondAxis",x00189220:"FrameAcquisitionDuration",x00189226:"MRImageFrameTypeSequence",x00189227:"MRSpectroscopyFrameTypeSequence",x00189231:"MRAcqPhaseEncodingStepsInPlane",x00189232:"MRAcqPhaseEncodingStepsOutOfPlane",x00189234:"SpectroscopyAcqPhaseColumns",x00189236:"CardiacCyclePosition",x00189239:"SpecificAbsorptionRateSequence",x00189240:"RFEchoTrainLength",x00189241:"GradientEchoTrainLength",x00189295:"ChemicalShiftsMinIntegrateLimitPPM",x00189296:"ChemicalShiftsMaxIntegrateLimitPPM",x00189301:"CTAcquisitionTypeSequence",x00189302:"AcquisitionType",x00189303:"TubeAngle",x00189304:"CTAcquisitionDetailsSequence",x00189305:"RevolutionTime",x00189306:"SingleCollimationWidth",x00189307:"TotalCollimationWidth",x00189308:"CTTableDynamicsSequence",x00189309:"TableSpeed",x00189310:"TableFeedPerRotation",x00189311:"SpiralPitchFactor",x00189312:"CTGeometrySequence",x00189313:"DataCollectionCenterPatient",x00189314:"CTReconstructionSequence",x00189315:"ReconstructionAlgorithm",x00189316:"ConvolutionKernelGroup",x00189317:"ReconstructionFieldOfView",x00189318:"ReconstructionTargetCenterPatient",x00189319:"ReconstructionAngle",x00189320:"ImageFilter",x00189321:"CTExposureSequence",x00189322:"ReconstructionPixelSpacing",x00189323:"ExposureModulationType",x00189324:"EstimatedDoseSaving",x00189325:"CTXRayDetailsSequence",x00189326:"CTPositionSequence",x00189327:"TablePosition",x00189328:"ExposureTimeInMilliSec",x00189329:"CTImageFrameTypeSequence",x00189330:"XRayTubeCurrentInMilliAmps",x00189332:"ExposureInMilliAmpSec",x00189333:"ConstantVolumeFlag",x00189334:"FluoroscopyFlag",x00189335:"SourceToDataCollectionCenterDist",x00189337:"ContrastBolusAgentNumber",x00189338:"ContrastBolusIngredientCodeSeq",x00189340:"ContrastAdministrationProfileSeq",x00189341:"ContrastBolusUsageSequence",x00189342:"ContrastBolusAgentAdministered",x00189343:"ContrastBolusAgentDetected",x00189344:"ContrastBolusAgentPhase",x00189345:"CTDIvol",x00189346:"CTDIPhantomTypeCodeSequence",x00189351:"CalciumScoringMassFactorPatient",x00189352:"CalciumScoringMassFactorDevice",x00189353:"EnergyWeightingFactor",x00189360:"CTAdditionalXRaySourceSequence",x00189401:"ProjectionPixelCalibrationSequence",x00189402:"DistanceSourceToIsocenter",x00189403:"DistanceObjectToTableTop",x00189404:"ObjectPixelSpacingInCenterOfBeam",x00189405:"PositionerPositionSequence",x00189406:"TablePositionSequence",x00189407:"CollimatorShapeSequence",x00189412:"XA-XRFFrameCharacteristicsSequence",x00189417:"FrameAcquisitionSequence",x00189420:"XRayReceptorType",x00189423:"AcquisitionProtocolName",x00189424:"AcquisitionProtocolDescription",x00189425:"ContrastBolusIngredientOpaque",x00189426:"DistanceReceptorPlaneToDetHousing",x00189427:"IntensifierActiveShape",x00189428:"IntensifierActiveDimensions",x00189429:"PhysicalDetectorSize",x00189430:"PositionOfIsocenterProjection",x00189432:"FieldOfViewSequence",x00189433:"FieldOfViewDescription",x00189434:"ExposureControlSensingRegionsSeq",x00189435:"ExposureControlSensingRegionShape",x00189436:"ExposureControlSensRegionLeftEdge",x00189437:"ExposureControlSensRegionRightEdge",x00189440:"CenterOfCircExposControlSensRegion",x00189441:"RadiusOfCircExposControlSensRegion",x00189447:"ColumnAngulationPatient",x00189449:"BeamAngle",x00189451:"FrameDetectorParametersSequence",x00189452:"CalculatedAnatomyThickness",x00189455:"CalibrationSequence",x00189456:"ObjectThicknessSequence",x00189457:"PlaneIdentification",x00189461:"FieldOfViewDimensionsInFloat",x00189462:"IsocenterReferenceSystemSequence",x00189463:"PositionerIsocenterPrimaryAngle",x00189464:"PositionerIsocenterSecondaryAngle",x00189465:"PositionerIsocenterDetRotAngle",x00189466:"TableXPositionToIsocenter",x00189467:"TableYPositionToIsocenter",x00189468:"TableZPositionToIsocenter",x00189469:"TableHorizontalRotationAngle",x00189470:"TableHeadTiltAngle",x00189471:"TableCradleTiltAngle",x00189472:"FrameDisplayShutterSequence",x00189473:"AcquiredImageAreaDoseProduct",x00189474:"CArmPositionerTabletopRelationship",x00189476:"XRayGeometrySequence",x00189477:"IrradiationEventIDSequence",x00189504:"XRay3DFrameTypeSequence",x00189506:"ContributingSourcesSequence",x00189507:"XRay3DAcquisitionSequence",x00189508:"PrimaryPositionerScanArc",x00189509:"SecondaryPositionerScanArc",x00189510:"PrimaryPositionerScanStartAngle",x00189511:"SecondaryPositionerScanStartAngle",x00189514:"PrimaryPositionerIncrement",x00189515:"SecondaryPositionerIncrement",x00189516:"StartAcquisitionDateTime",x00189517:"EndAcquisitionDateTime",x00189524:"ApplicationName",x00189525:"ApplicationVersion",x00189526:"ApplicationManufacturer",x00189527:"AlgorithmType",x00189528:"AlgorithmDescription",x00189530:"XRay3DReconstructionSequence",x00189531:"ReconstructionDescription",x00189538:"PerProjectionAcquisitionSequence",x00189601:"DiffusionBMatrixSequence",x00189602:"DiffusionBValueXX",x00189603:"DiffusionBValueXY",x00189604:"DiffusionBValueXZ",x00189605:"DiffusionBValueYY",x00189606:"DiffusionBValueYZ",x00189607:"DiffusionBValueZZ",x00189701:"DecayCorrectionDateTime",x00189715:"StartDensityThreshold",x00189722:"TerminationTimeThreshold",x00189725:"DetectorGeometry",x00189727:"AxialDetectorDimension",x00189735:"PETPositionSequence",x00189739:"NumberOfIterations",x00189740:"NumberOfSubsets",x00189751:"PETFrameTypeSequence",x00189756:"ReconstructionType",x00189758:"DecayCorrected",x00189759:"AttenuationCorrected",x00189760:"ScatterCorrected",x00189761:"DeadTimeCorrected",x00189762:"GantryMotionCorrected",x00189763:"PatientMotionCorrected",x00189765:"RandomsCorrected",x00189767:"SensitivityCalibrated",x00189801:"DepthsOfFocus",x00189804:"ExclusionStartDatetime",x00189805:"ExclusionDuration",x00189807:"ImageDataTypeSequence",x00189808:"DataType",x0018980b:"AliasedDataType",x0018a001:"ContributingEquipmentSequence",x0018a002:"ContributionDateTime",x0018a003:"ContributionDescription",x00200000:"RelationshipGroupLength",x0020000d:"StudyInstanceUID",x0020000e:"SeriesInstanceUID",x00200010:"StudyID",x00200011:"SeriesNumber",x00200012:"AcquisitionNumber",x00200013:"InstanceNumber",x00200014:"IsotopeNumber",x00200015:"PhaseNumber",x00200016:"IntervalNumber",x00200017:"TimeSlotNumber",x00200018:"AngleNumber",x00200019:"ItemNumber",x00200020:"PatientOrientation",x00200022:"OverlayNumber",x00200024:"CurveNumber",x00200026:"LookupTableNumber",x00200030:"ImagePosition",x00200032:"ImagePositionPatient",x00200035:"ImageOrientation",x00200037:"ImageOrientationPatient",x00200050:"Location",x00200052:"FrameOfReferenceUID",x00200060:"Laterality",x00200062:"ImageLaterality",x00200070:"ImageGeometryType",x00200080:"MaskingImage",x00200100:"TemporalPositionIdentifier",x00200105:"NumberOfTemporalPositions",x00200110:"TemporalResolution",x00200200:"SynchronizationFrameOfReferenceUID",x00201000:"SeriesInStudy",x00201001:"AcquisitionsInSeries",x00201002:"ImagesInAcquisition",x00201003:"ImagesInSeries",x00201004:"AcquisitionsInStudy",x00201005:"ImagesInStudy",x00201020:"Reference",x00201040:"PositionReferenceIndicator",x00201041:"SliceLocation",x00201070:"OtherStudyNumbers",x00201200:"NumberOfPatientRelatedStudies",x00201202:"NumberOfPatientRelatedSeries",x00201204:"NumberOfPatientRelatedInstances",x00201206:"NumberOfStudyRelatedSeries",x00201208:"NumberOfStudyRelatedInstances",x00201209:"NumberOfSeriesRelatedInstances",x002031xx:"SourceImageIDs",x00203401:"ModifyingDeviceID",x00203402:"ModifiedImageID",x00203403:"ModifiedImageDate",x00203404:"ModifyingDeviceManufacturer",x00203405:"ModifiedImageTime",x00203406:"ModifiedImageDescription",x00204000:"ImageComments",x00205000:"OriginalImageIdentification",x00205002:"OriginalImageIdentNomenclature",x00209056:"StackID",x00209057:"InStackPositionNumber",x00209071:"FrameAnatomySequence",x00209072:"FrameLaterality",x00209111:"FrameContentSequence",x00209113:"PlanePositionSequence",x00209116:"PlaneOrientationSequence",x00209128:"TemporalPositionIndex",x00209153:"TriggerDelayTime",x00209156:"FrameAcquisitionNumber",x00209157:"DimensionIndexValues",x00209158:"FrameComments",x00209161:"ConcatenationUID",x00209162:"InConcatenationNumber",x00209163:"InConcatenationTotalNumber",x00209164:"DimensionOrganizationUID",x00209165:"DimensionIndexPointer",x00209167:"FunctionalGroupPointer",x00209213:"DimensionIndexPrivateCreator",x00209221:"DimensionOrganizationSequence",x00209222:"DimensionIndexSequence",x00209228:"ConcatenationFrameOffsetNumber",x00209238:"FunctionalGroupPrivateCreator",x00209241:"NominalPercentageOfCardiacPhase",x00209245:"NominalPercentOfRespiratoryPhase",x00209246:"StartingRespiratoryAmplitude",x00209247:"StartingRespiratoryPhase",x00209248:"EndingRespiratoryAmplitude",x00209249:"EndingRespiratoryPhase",x00209250:"RespiratoryTriggerType",x00209251:"RRIntervalTimeNominal",x00209252:"ActualCardiacTriggerDelayTime",x00209253:"RespiratorySynchronizationSequence",x00209254:"RespiratoryIntervalTime",x00209255:"NominalRespiratoryTriggerDelayTime",x00209256:"RespiratoryTriggerDelayThreshold",x00209257:"ActualRespiratoryTriggerDelayTime",x00209301:"ImagePositionVolume",x00209302:"ImageOrientationVolume",x00209308:"ApexPosition",x00209421:"DimensionDescriptionLabel",x00209450:"PatientOrientationInFrameSequence",x00209453:"FrameLabel",x00209518:"AcquisitionIndex",x00209529:"ContributingSOPInstancesRefSeq",x00209536:"ReconstructionIndex",x00220001:"LightPathFilterPassThroughWavelen",x00220002:"LightPathFilterPassBand",x00220003:"ImagePathFilterPassThroughWavelen",x00220004:"ImagePathFilterPassBand",x00220005:"PatientEyeMovementCommanded",x00220006:"PatientEyeMovementCommandCodeSeq",x00220007:"SphericalLensPower",x00220008:"CylinderLensPower",x00220009:"CylinderAxis",x0022000a:"EmmetropicMagnification",x0022000b:"IntraOcularPressure",x0022000c:"HorizontalFieldOfView",x0022000d:"PupilDilated",x0022000e:"DegreeOfDilation",x00220010:"StereoBaselineAngle",x00220011:"StereoBaselineDisplacement",x00220012:"StereoHorizontalPixelOffset",x00220013:"StereoVerticalPixelOffset",x00220014:"StereoRotation",x00220015:"AcquisitionDeviceTypeCodeSequence",x00220016:"IlluminationTypeCodeSequence",x00220017:"LightPathFilterTypeStackCodeSeq",x00220018:"ImagePathFilterTypeStackCodeSeq",x00220019:"LensesCodeSequence",x0022001a:"ChannelDescriptionCodeSequence",x0022001b:"RefractiveStateSequence",x0022001c:"MydriaticAgentCodeSequence",x0022001d:"RelativeImagePositionCodeSequence",x00220020:"StereoPairsSequence",x00220021:"LeftImageSequence",x00220022:"RightImageSequence",x00220030:"AxialLengthOfTheEye",x00220031:"OphthalmicFrameLocationSequence",x00220032:"ReferenceCoordinates",x00220035:"DepthSpatialResolution",x00220036:"MaximumDepthDistortion",x00220037:"AlongScanSpatialResolution",x00220038:"MaximumAlongScanDistortion",x00220039:"OphthalmicImageOrientation",x00220041:"DepthOfTransverseImage",x00220042:"MydriaticAgentConcUnitsSeq",x00220048:"AcrossScanSpatialResolution",x00220049:"MaximumAcrossScanDistortion",x0022004e:"MydriaticAgentConcentration",x00220055:"IlluminationWaveLength",x00220056:"IlluminationPower",x00220057:"IlluminationBandwidth",x00220058:"MydriaticAgentSequence",x00280000:"ImagePresentationGroupLength",x00280002:"SamplesPerPixel",x00280003:"SamplesPerPixelUsed",x00280004:"PhotometricInterpretation",x00280005:"ImageDimensions",x00280006:"PlanarConfiguration",x00280008:"NumberOfFrames",x00280009:"FrameIncrementPointer",x0028000a:"FrameDimensionPointer",x00280010:"Rows",x00280011:"Columns",x00280012:"Planes",x00280014:"UltrasoundColorDataPresent",x00280030:"PixelSpacing",x00280031:"ZoomFactor",x00280032:"ZoomCenter",x00280034:"PixelAspectRatio",x00280040:"ImageFormat",x00280050:"ManipulatedImage",x00280051:"CorrectedImage",x0028005f:"CompressionRecognitionCode",x00280060:"CompressionCode",x00280061:"CompressionOriginator",x00280062:"CompressionLabel",x00280063:"CompressionDescription",x00280065:"CompressionSequence",x00280066:"CompressionStepPointers",x00280068:"RepeatInterval",x00280069:"BitsGrouped",x00280070:"PerimeterTable",x00280071:"PerimeterValue",x00280080:"PredictorRows",x00280081:"PredictorColumns",x00280082:"PredictorConstants",x00280090:"BlockedPixels",x00280091:"BlockRows",x00280092:"BlockColumns",x00280093:"RowOverlap",x00280094:"ColumnOverlap",x00280100:"BitsAllocated",x00280101:"BitsStored",x00280102:"HighBit",x00280103:"PixelRepresentation",x00280104:"SmallestValidPixelValue",x00280105:"LargestValidPixelValue",x00280106:"SmallestImagePixelValue",x00280107:"LargestImagePixelValue",x00280108:"SmallestPixelValueInSeries",x00280109:"LargestPixelValueInSeries",x00280110:"SmallestImagePixelValueInPlane",x00280111:"LargestImagePixelValueInPlane",x00280120:"PixelPaddingValue",x00280121:"PixelPaddingRangeLimit",x00280200:"ImageLocation",x00280300:"QualityControlImage",x00280301:"BurnedInAnnotation",x00280400:"TransformLabel",x00280401:"TransformVersionNumber",x00280402:"NumberOfTransformSteps",x00280403:"SequenceOfCompressedData",x00280404:"DetailsOfCoefficients",x002804x2:"CoefficientCoding",x002804x3:"CoefficientCodingPointers",x00280700:"DCTLabel",x00280701:"DataBlockDescription",x00280702:"DataBlock",x00280710:"NormalizationFactorFormat",x00280720:"ZonalMapNumberFormat",x00280721:"ZonalMapLocation",x00280722:"ZonalMapFormat",x00280730:"AdaptiveMapFormat",x00280740:"CodeNumberFormat",x002808x0:"CodeLabel",x002808x2:"NumberOfTables",x002808x3:"CodeTableLocation",x002808x4:"BitsForCodeWord",x002808x8:"ImageDataLocation",x00280a02:"PixelSpacingCalibrationType",x00280a04:"PixelSpacingCalibrationDescription",x00281040:"PixelIntensityRelationship",x00281041:"PixelIntensityRelationshipSign",x00281050:"WindowCenter",x00281051:"WindowWidth",x00281052:"RescaleIntercept",x00281053:"RescaleSlope",x00281054:"RescaleType",x00281055:"WindowCenterAndWidthExplanation",x00281056:"VOI_LUTFunction",x00281080:"GrayScale",x00281090:"RecommendedViewingMode",x00281100:"GrayLookupTableDescriptor",x00281101:"RedPaletteColorTableDescriptor",x00281102:"GreenPaletteColorTableDescriptor",x00281103:"BluePaletteColorTableDescriptor",x00281111:"LargeRedPaletteColorTableDescr",x00281112:"LargeGreenPaletteColorTableDescr",x00281113:"LargeBluePaletteColorTableDescr",x00281199:"PaletteColorTableUID",x00281200:"GrayLookupTableData",x00281201:"RedPaletteColorTableData",x00281202:"GreenPaletteColorTableData",x00281203:"BluePaletteColorTableData",x00281211:"LargeRedPaletteColorTableData",x00281212:"LargeGreenPaletteColorTableData",x00281213:"LargeBluePaletteColorTableData",x00281214:"LargePaletteColorLookupTableUID",x00281221:"SegmentedRedColorTableData",x00281222:"SegmentedGreenColorTableData",x00281223:"SegmentedBlueColorTableData",x00281300:"BreastImplantPresent",x00281350:"PartialView",x00281351:"PartialViewDescription",x00281352:"PartialViewCodeSequence",x0028135a:"SpatialLocationsPreserved",x00281402:"DataPathAssignment",x00281404:"BlendingLUT1Sequence",x00281406:"BlendingWeightConstant",x00281408:"BlendingLookupTableData",x0028140c:"BlendingLUT2Sequence",x0028140e:"DataPathID",x0028140f:"RGBLUTTransferFunction",x00281410:"AlphaLUTTransferFunction",x00282000:"ICCProfile",x00282110:"LossyImageCompression",x00282112:"LossyImageCompressionRatio",x00282114:"LossyImageCompressionMethod",x00283000:"ModalityLUTSequence",x00283002:"LUTDescriptor",x00283003:"LUTExplanation",x00283004:"ModalityLUTType",x00283006:"LUTData",x00283010:"VOILUTSequence",x00283110:"SoftcopyVOILUTSequence",x00284000:"ImagePresentationComments",x00285000:"BiPlaneAcquisitionSequence",x00286010:"RepresentativeFrameNumber",x00286020:"FrameNumbersOfInterest",x00286022:"FrameOfInterestDescription",x00286023:"FrameOfInterestType",x00286030:"MaskPointers",x00286040:"RWavePointer",x00286100:"MaskSubtractionSequence",x00286101:"MaskOperation",x00286102:"ApplicableFrameRange",x00286110:"MaskFrameNumbers",x00286112:"ContrastFrameAveraging",x00286114:"MaskSubPixelShift",x00286120:"TIDOffset",x00286190:"MaskOperationExplanation",x00287fe0:"PixelDataProviderURL",x00289001:"DataPointRows",x00289002:"DataPointColumns",x00289003:"SignalDomainColumns",x00289099:"LargestMonochromePixelValue",x00289108:"DataRepresentation",x00289110:"PixelMeasuresSequence",x00289132:"FrameVOILUTSequence",x00289145:"PixelValueTransformationSequence",x00289235:"SignalDomainRows",x00289411:"DisplayFilterPercentage",x00289415:"FramePixelShiftSequence",x00289416:"SubtractionItemID",x00289422:"PixelIntensityRelationshipLUTSeq",x00289443:"FramePixelDataPropertiesSequence",x00289444:"GeometricalProperties",x00289445:"GeometricMaximumDistortion",x00289446:"ImageProcessingApplied",x00289454:"MaskSelectionMode",x00289474:"LUTFunction",x00289478:"MaskVisibilityPercentage",x00289501:"PixelShiftSequence",x00289502:"RegionPixelShiftSequence",x00289503:"VerticesOfTheRegion",x00289506:"PixelShiftFrameRange",x00289507:"LUTFrameRange",x00289520:"ImageToEquipmentMappingMatrix",x00289537:"EquipmentCoordinateSystemID",x00320000:"StudyGroupLength",x0032000a:"StudyStatusID",x0032000c:"StudyPriorityID",x00320012:"StudyIDIssuer",x00320032:"StudyVerifiedDate",x00320033:"StudyVerifiedTime",x00320034:"StudyReadDate",x00320035:"StudyReadTime",x00321000:"ScheduledStudyStartDate",x00321001:"ScheduledStudyStartTime",x00321010:"ScheduledStudyStopDate",x00321011:"ScheduledStudyStopTime",x00321020:"ScheduledStudyLocation",x00321021:"ScheduledStudyLocationAETitle",x00321030:"ReasonForStudy",x00321031:"RequestingPhysicianIDSequence",x00321032:"RequestingPhysician",x00321033:"RequestingService",x00321040:"StudyArrivalDate",x00321041:"StudyArrivalTime",x00321050:"StudyCompletionDate",x00321051:"StudyCompletionTime",x00321055:"StudyComponentStatusID",x00321060:"RequestedProcedureDescription",x00321064:"RequestedProcedureCodeSequence",x00321070:"RequestedContrastAgent",x00324000:"StudyComments",x00380004:"ReferencedPatientAliasSequence",x00380008:"VisitStatusID",x00380010:"AdmissionID",x00380011:"IssuerOfAdmissionID",x00380016:"RouteOfAdmissions",x0038001a:"ScheduledAdmissionDate",x0038001b:"ScheduledAdmissionTime",x0038001c:"ScheduledDischargeDate",x0038001d:"ScheduledDischargeTime",x0038001e:"ScheduledPatientInstitResidence",x00380020:"AdmittingDate",x00380021:"AdmittingTime",x00380030:"DischargeDate",x00380032:"DischargeTime",x00380040:"DischargeDiagnosisDescription",x00380044:"DischargeDiagnosisCodeSequence",x00380050:"SpecialNeeds",x00380060:"ServiceEpisodeID",x00380061:"IssuerOfServiceEpisodeID",x00380062:"ServiceEpisodeDescription",x00380100:"PertinentDocumentsSequence",x00380300:"CurrentPatientLocation",x00380400:"PatientInstitutionResidence",x00380500:"PatientState",x00380502:"PatientClinicalTrialParticipSeq",x00384000:"VisitComments",x003a0004:"WaveformOriginality",x003a0005:"NumberOfWaveformChannels",x003a0010:"NumberOfWaveformSamples",x003a001a:"SamplingFrequency",x003a0020:"MultiplexGroupLabel",x003a0200:"ChannelDefinitionSequence",x003a0202:"WaveformChannelNumber",x003a0203:"ChannelLabel",x003a0205:"ChannelStatus",x003a0208:"ChannelSourceSequence",x003a0209:"ChannelSourceModifiersSequence",x003a020a:"SourceWaveformSequence",x003a020c:"ChannelDerivationDescription",x003a0210:"ChannelSensitivity",x003a0211:"ChannelSensitivityUnitsSequence",x003a0212:"ChannelSensitivityCorrectionFactor",x003a0213:"ChannelBaseline",x003a0214:"ChannelTimeSkew",x003a0215:"ChannelSampleSkew",x003a0218:"ChannelOffset",x003a021a:"WaveformBitsStored",x003a0220:"FilterLowFrequency",x003a0221:"FilterHighFrequency",x003a0222:"NotchFilterFrequency",x003a0223:"NotchFilterBandwidth",x003a0230:"WaveformDataDisplayScale",x003a0231:"WaveformDisplayBkgCIELabValue",x003a0240:"WaveformPresentationGroupSequence",x003a0241:"PresentationGroupNumber",x003a0242:"ChannelDisplaySequence",x003a0244:"ChannelRecommendDisplayCIELabValue",x003a0245:"ChannelPosition",x003a0246:"DisplayShadingFlag",x003a0247:"FractionalChannelDisplayScale",x003a0248:"AbsoluteChannelDisplayScale",x003a0300:"MultiplexAudioChannelsDescrCodeSeq",x003a0301:"ChannelIdentificationCode",x003a0302:"ChannelMode",x00400001:"ScheduledStationAETitle",x00400002:"ScheduledProcedureStepStartDate",x00400003:"ScheduledProcedureStepStartTime",x00400004:"ScheduledProcedureStepEndDate",x00400005:"ScheduledProcedureStepEndTime",x00400006:"ScheduledPerformingPhysiciansName",x00400007:"ScheduledProcedureStepDescription",x00400008:"ScheduledProtocolCodeSequence",x00400009:"ScheduledProcedureStepID",x0040000a:"StageCodeSequence",x0040000b:"ScheduledPerformingPhysicianIDSeq",x00400010:"ScheduledStationName",x00400011:"ScheduledProcedureStepLocation",x00400012:"PreMedication",x00400020:"ScheduledProcedureStepStatus",x00400031:"LocalNamespaceEntityID",x00400032:"UniversalEntityID",x00400033:"UniversalEntityIDType",x00400035:"IdentifierTypeCode",x00400036:"AssigningFacilitySequence",x00400100:"ScheduledProcedureStepSequence",x00400220:"ReferencedNonImageCompositeSOPSeq",x00400241:"PerformedStationAETitle",x00400242:"PerformedStationName",x00400243:"PerformedLocation",x00400244:"PerformedProcedureStepStartDate",x00400245:"PerformedProcedureStepStartTime",x00400250:"PerformedProcedureStepEndDate",x00400251:"PerformedProcedureStepEndTime",x00400252:"PerformedProcedureStepStatus",
x00400253:"PerformedProcedureStepID",x00400254:"PerformedProcedureStepDescription",x00400255:"PerformedProcedureTypeDescription",x00400260:"PerformedProtocolCodeSequence",x00400261:"PerformedProtocolType",x00400270:"ScheduledStepAttributesSequence",x00400275:"RequestAttributesSequence",x00400280:"CommentsOnPerformedProcedureStep",x00400281:"ProcStepDiscontinueReasonCodeSeq",x00400293:"QuantitySequence",x00400294:"Quantity",x00400295:"MeasuringUnitsSequence",x00400296:"BillingItemSequence",x00400300:"TotalTimeOfFluoroscopy",x00400301:"TotalNumberOfExposures",x00400302:"EntranceDose",x00400303:"ExposedArea",x00400306:"DistanceSourceToEntrance",x00400307:"DistanceSourceToSupport",x0040030e:"ExposureDoseSequence",x00400310:"CommentsOnRadiationDose",x00400312:"XRayOutput",x00400314:"HalfValueLayer",x00400316:"OrganDose",x00400318:"OrganExposed",x00400320:"BillingProcedureStepSequence",x00400321:"FilmConsumptionSequence",x00400324:"BillingSuppliesAndDevicesSequence",x00400330:"ReferencedProcedureStepSequence",x00400340:"PerformedSeriesSequence",x00400400:"CommentsOnScheduledProcedureStep",x00400440:"ProtocolContextSequence",x00400441:"ContentItemModifierSequence",x0040050a:"SpecimenAccessionNumber",x00400512:"ContainerIdentifier",x0040051a:"ContainerDescription",x00400550:"SpecimenSequence",x00400551:"SpecimenIdentifier",x00400552:"SpecimenDescriptionSequenceTrial",x00400553:"SpecimenDescriptionTrial",x00400554:"SpecimenUID",x00400555:"AcquisitionContextSequence",x00400556:"AcquisitionContextDescription",x0040059a:"SpecimenTypeCodeSequence",x00400600:"SpecimenShortDescription",x004006fa:"SlideIdentifier",x0040071a:"ImageCenterPointCoordinatesSeq",x0040072a:"XOffsetInSlideCoordinateSystem",x0040073a:"YOffsetInSlideCoordinateSystem",x0040074a:"ZOffsetInSlideCoordinateSystem",x004008d8:"PixelSpacingSequence",x004008da:"CoordinateSystemAxisCodeSequence",x004008ea:"MeasurementUnitsCodeSequence",x004009f8:"VitalStainCodeSequenceTrial",x00401001:"RequestedProcedureID",x00401002:"ReasonForRequestedProcedure",x00401003:"RequestedProcedurePriority",x00401004:"PatientTransportArrangements",x00401005:"RequestedProcedureLocation",x00401006:"PlacerOrderNumber-Procedure",x00401007:"FillerOrderNumber-Procedure",x00401008:"ConfidentialityCode",x00401009:"ReportingPriority",x0040100a:"ReasonForRequestedProcedureCodeSeq",x00401010:"NamesOfIntendedRecipientsOfResults",x00401011:"IntendedRecipientsOfResultsIDSeq",x00401101:"PersonIdentificationCodeSequence",x00401102:"PersonAddress",x00401103:"PersonTelephoneNumbers",x00401400:"RequestedProcedureComments",x00402001:"ReasonForImagingServiceRequest",x00402004:"IssueDateOfImagingServiceRequest",x00402005:"IssueTimeOfImagingServiceRequest",x00402006:"PlacerOrderNumberImagingServiceRequestRetired",x00402007:"FillerOrderNumberImagingServiceRequestRetired",x00402008:"OrderEnteredBy",x00402009:"OrderEntererLocation",x00402010:"OrderCallbackPhoneNumber",x00402016:"PlacerOrderNum-ImagingServiceReq",x00402017:"FillerOrderNum-ImagingServiceReq",x00402400:"ImagingServiceRequestComments",x00403001:"ConfidentialityOnPatientDataDescr",x00404001:"GenPurposeScheduledProcStepStatus",x00404002:"GenPurposePerformedProcStepStatus",x00404003:"GenPurposeSchedProcStepPriority",x00404004:"SchedProcessingApplicationsCodeSeq",x00404005:"SchedProcedureStepStartDateAndTime",x00404006:"MultipleCopiesFlag",x00404007:"PerformedProcessingAppsCodeSeq",x00404009:"HumanPerformerCodeSequence",x00404010:"SchedProcStepModificationDateTime",x00404011:"ExpectedCompletionDateAndTime",x00404015:"ResultingGenPurposePerfProcStepSeq",x00404016:"RefGenPurposeSchedProcStepSeq",x00404018:"ScheduledWorkitemCodeSequence",x00404019:"PerformedWorkitemCodeSequence",x00404020:"InputAvailabilityFlag",x00404021:"InputInformationSequence",x00404022:"RelevantInformationSequence",x00404023:"RefGenPurSchedProcStepTransUID",x00404025:"ScheduledStationNameCodeSequence",x00404026:"ScheduledStationClassCodeSequence",x00404027:"SchedStationGeographicLocCodeSeq",x00404028:"PerformedStationNameCodeSequence",x00404029:"PerformedStationClassCodeSequence",x00404030:"PerformedStationGeogLocCodeSeq",x00404031:"RequestedSubsequentWorkItemCodeSeq",x00404032:"NonDICOMOutputCodeSequence",x00404033:"OutputInformationSequence",x00404034:"ScheduledHumanPerformersSequence",x00404035:"ActualHumanPerformersSequence",x00404036:"HumanPerformersOrganization",x00404037:"HumanPerformerName",x00404040:"RawDataHandling",x00408302:"EntranceDoseInMilliGy",x00409094:"RefImageRealWorldValueMappingSeq",x00409096:"RealWorldValueMappingSequence",x00409098:"PixelValueMappingCodeSequence",x00409210:"LUTLabel",x00409211:"RealWorldValueLastValueMapped",x00409212:"RealWorldValueLUTData",x00409216:"RealWorldValueFirstValueMapped",x00409224:"RealWorldValueIntercept",x00409225:"RealWorldValueSlope",x0040a010:"RelationshipType",x0040a027:"VerifyingOrganization",x0040a030:"VerificationDateTime",x0040a032:"ObservationDateTime",x0040a040:"ValueType",x0040a043:"ConceptNameCodeSequence",x0040a050:"ContinuityOfContent",x0040a073:"VerifyingObserverSequence",x0040a075:"VerifyingObserverName",x0040a078:"AuthorObserverSequence",x0040a07a:"ParticipantSequence",x0040a07c:"CustodialOrganizationSequence",x0040a080:"ParticipationType",x0040a082:"ParticipationDateTime",x0040a084:"ObserverType",x0040a088:"VerifyingObserverIdentCodeSequence",x0040a090:"EquivalentCDADocumentSequence",x0040a0b0:"ReferencedWaveformChannels",x0040a120:"DateTime",x0040a121:"Date",x0040a122:"Time",x0040a123:"PersonName",x0040a124:"UID",x0040a130:"TemporalRangeType",x0040a132:"ReferencedSamplePositions",x0040a136:"ReferencedFrameNumbers",x0040a138:"ReferencedTimeOffsets",x0040a13a:"ReferencedDateTime",x0040a160:"TextValue",x0040a168:"ConceptCodeSequence",x0040a170:"PurposeOfReferenceCodeSequence",x0040a180:"AnnotationGroupNumber",x0040a195:"ModifierCodeSequence",x0040a300:"MeasuredValueSequence",x0040a301:"NumericValueQualifierCodeSequence",x0040a30a:"NumericValue",x0040a353:"AddressTrial",x0040a354:"TelephoneNumberTrial",x0040a360:"PredecessorDocumentsSequence",x0040a370:"ReferencedRequestSequence",x0040a372:"PerformedProcedureCodeSequence",x0040a375:"CurrentRequestedProcEvidenceSeq",x0040a385:"PertinentOtherEvidenceSequence",x0040a390:"HL7StructuredDocumentRefSeq",x0040a491:"CompletionFlag",x0040a492:"CompletionFlagDescription",x0040a493:"VerificationFlag",x0040a494:"ArchiveRequested",x0040a496:"PreliminaryFlag",x0040a504:"ContentTemplateSequence",x0040a525:"IdenticalDocumentsSequence",x0040a730:"ContentSequence",x0040b020:"AnnotationSequence",x0040db00:"TemplateIdentifier",x0040db06:"TemplateVersion",x0040db07:"TemplateLocalVersion",x0040db0b:"TemplateExtensionFlag",x0040db0c:"TemplateExtensionOrganizationUID",x0040db0d:"TemplateExtensionCreatorUID",x0040db73:"ReferencedContentItemIdentifier",x0040e001:"HL7InstanceIdentifier",x0040e004:"HL7DocumentEffectiveTime",x0040e006:"HL7DocumentTypeCodeSequence",x0040e010:"RetrieveURI",x0040e011:"RetrieveLocationUID",x00420010:"DocumentTitle",x00420011:"EncapsulatedDocument",x00420012:"MIMETypeOfEncapsulatedDocument",x00420013:"SourceInstanceSequence",x00420014:"ListOfMIMETypes",x00440001:"ProductPackageIdentifier",x00440002:"SubstanceAdministrationApproval",x00440003:"ApprovalStatusFurtherDescription",x00440004:"ApprovalStatusDateTime",x00440007:"ProductTypeCodeSequence",x00440008:"ProductName",x00440009:"ProductDescription",x0044000a:"ProductLotIdentifier",x0044000b:"ProductExpirationDateTime",x00440010:"SubstanceAdministrationDateTime",x00440011:"SubstanceAdministrationNotes",x00440012:"SubstanceAdministrationDeviceID",x00440013:"ProductParameterSequence",x00440019:"SubstanceAdminParameterSeq",x00460012:"LensDescription",x00460014:"RightLensSequence",x00460015:"LeftLensSequence",x00460018:"CylinderSequence",x00460028:"PrismSequence",x00460030:"HorizontalPrismPower",x00460032:"HorizontalPrismBase",x00460034:"VerticalPrismPower",x00460036:"VerticalPrismBase",x00460038:"LensSegmentType",x00460040:"OpticalTransmittance",x00460042:"ChannelWidth",x00460044:"PupilSize",x00460046:"CornealSize",x00460060:"DistancePupillaryDistance",x00460062:"NearPupillaryDistance",x00460064:"OtherPupillaryDistance",x00460075:"RadiusOfCurvature",x00460076:"KeratometricPower",x00460077:"KeratometricAxis",x00460092:"BackgroundColor",x00460094:"Optotype",x00460095:"OptotypePresentation",x00460100:"AddNearSequence",x00460101:"AddIntermediateSequence",x00460102:"AddOtherSequence",x00460104:"AddPower",x00460106:"ViewingDistance",x00460125:"ViewingDistanceType",x00460135:"VisualAcuityModifiers",x00460137:"DecimalVisualAcuity",x00460139:"OptotypeDetailedDefinition",x00460146:"SpherePower",x00460147:"CylinderPower",x00500004:"CalibrationImage",x00500010:"DeviceSequence",x00500014:"DeviceLength",x00500015:"ContainerComponentWidth",x00500016:"DeviceDiameter",x00500017:"DeviceDiameterUnits",x00500018:"DeviceVolume",x00500019:"InterMarkerDistance",x0050001b:"ContainerComponentID",x00500020:"DeviceDescription",x00540010:"EnergyWindowVector",x00540011:"NumberOfEnergyWindows",x00540012:"EnergyWindowInformationSequence",x00540013:"EnergyWindowRangeSequence",x00540014:"EnergyWindowLowerLimit",x00540015:"EnergyWindowUpperLimit",x00540016:"RadiopharmaceuticalInformationSeq",x00540017:"ResidualSyringeCounts",x00540018:"EnergyWindowName",x00540020:"DetectorVector",x00540021:"NumberOfDetectors",x00540022:"DetectorInformationSequence",x00540030:"PhaseVector",x00540031:"NumberOfPhases",x00540032:"PhaseInformationSequence",x00540033:"NumberOfFramesInPhase",x00540036:"PhaseDelay",x00540038:"PauseBetweenFrames",x00540039:"PhaseDescription",x00540050:"RotationVector",x00540051:"NumberOfRotations",x00540052:"RotationInformationSequence",x00540053:"NumberOfFramesInRotation",x00540060:"RRIntervalVector",x00540061:"NumberOfRRIntervals",x00540062:"GatedInformationSequence",x00540063:"DataInformationSequence",x00540070:"TimeSlotVector",x00540071:"NumberOfTimeSlots",x00540072:"TimeSlotInformationSequence",x00540073:"TimeSlotTime",x00540080:"SliceVector",x00540081:"NumberOfSlices",x00540090:"AngularViewVector",x00540100:"TimeSliceVector",x00540101:"NumberOfTimeSlices",x00540200:"StartAngle",x00540202:"TypeOfDetectorMotion",x00540210:"TriggerVector",x00540211:"NumberOfTriggersInPhase",x00540220:"ViewCodeSequence",x00540222:"ViewModifierCodeSequence",x00540300:"RadionuclideCodeSequence",x00540302:"AdministrationRouteCodeSequence",x00540304:"RadiopharmaceuticalCodeSequence",x00540306:"CalibrationDataSequence",x00540308:"EnergyWindowNumber",x00540400:"ImageID",x00540410:"PatientOrientationCodeSequence",x00540412:"PatientOrientationModifierCodeSeq",x00540414:"PatientGantryRelationshipCodeSeq",x00540500:"SliceProgressionDirection",x00541000:"SeriesType",x00541001:"Units",x00541002:"CountsSource",x00541004:"ReprojectionMethod",x00541100:"RandomsCorrectionMethod",x00541101:"AttenuationCorrectionMethod",x00541102:"DecayCorrection",x00541103:"ReconstructionMethod",x00541104:"DetectorLinesOfResponseUsed",x00541105:"ScatterCorrectionMethod",x00541200:"AxialAcceptance",x00541201:"AxialMash",x00541202:"TransverseMash",x00541203:"DetectorElementSize",x00541210:"CoincidenceWindowWidth",x00541220:"SecondaryCountsType",x00541300:"FrameReferenceTime",x00541310:"PrimaryCountsAccumulated",x00541311:"SecondaryCountsAccumulated",x00541320:"SliceSensitivityFactor",x00541321:"DecayFactor",x00541322:"DoseCalibrationFactor",x00541323:"ScatterFractionFactor",x00541324:"DeadTimeFactor",x00541330:"ImageIndex",x00541400:"CountsIncluded",x00541401:"DeadTimeCorrectionFlag",x00603000:"HistogramSequence",x00603002:"HistogramNumberOfBins",x00603004:"HistogramFirstBinValue",x00603006:"HistogramLastBinValue",x00603008:"HistogramBinWidth",x00603010:"HistogramExplanation",x00603020:"HistogramData",x00620001:"SegmentationType",x00620002:"SegmentSequence",x00620003:"SegmentedPropertyCategoryCodeSeq",x00620004:"SegmentNumber",x00620005:"SegmentLabel",x00620006:"SegmentDescription",x00620008:"SegmentAlgorithmType",x00620009:"SegmentAlgorithmName",x0062000a:"SegmentIdentificationSequence",x0062000b:"ReferencedSegmentNumber",x0062000c:"RecommendedDisplayGrayscaleValue",x0062000d:"RecommendedDisplayCIELabValue",x0062000e:"MaximumFractionalValue",x0062000f:"SegmentedPropertyTypeCodeSequence",x00620010:"SegmentationFractionalType",x00640002:"DeformableRegistrationSequence",x00640003:"SourceFrameOfReferenceUID",x00640005:"DeformableRegistrationGridSequence",x00640007:"GridDimensions",x00640008:"GridResolution",x00640009:"VectorGridData",x0064000f:"PreDeformationMatrixRegistSeq",x00640010:"PostDeformationMatrixRegistSeq",x00660001:"NumberOfSurfaces",x00660002:"SurfaceSequence",x00660003:"SurfaceNumber",x00660004:"SurfaceComments",x00660009:"SurfaceProcessing",x0066000a:"SurfaceProcessingRatio",x0066000e:"FiniteVolume",x00660010:"Manifold",x00660011:"SurfacePointsSequence",x00660015:"NumberOfSurfacePoints",x00660016:"PointCoordinatesData",x00660017:"PointPositionAccuracy",x00660018:"MeanPointDistance",x00660019:"MaximumPointDistance",x0066001b:"AxisOfRotation",x0066001c:"CenterOfRotation",x0066001e:"NumberOfVectors",x0066001f:"VectorDimensionality",x00660020:"VectorAccuracy",x00660021:"VectorCoordinateData",x00660023:"TrianglePointIndexList",x00660024:"EdgePointIndexList",x00660025:"VertexPointIndexList",x00660026:"TriangleStripSequence",x00660027:"TriangleFanSequence",x00660028:"LineSequence",x00660029:"PrimitivePointIndexList",x0066002a:"SurfaceCount",x0066002f:"AlgorithmFamilyCodeSequ",x00660031:"AlgorithmVersion",x00660032:"AlgorithmParameters",x00660034:"FacetSequence",x00660036:"AlgorithmName",x00700001:"GraphicAnnotationSequence",x00700002:"GraphicLayer",x00700003:"BoundingBoxAnnotationUnits",x00700004:"AnchorPointAnnotationUnits",x00700005:"GraphicAnnotationUnits",x00700006:"UnformattedTextValue",x00700008:"TextObjectSequence",x00700009:"GraphicObjectSequence",x00700010:"BoundingBoxTopLeftHandCorner",x00700011:"BoundingBoxBottomRightHandCorner",x00700012:"BoundingBoxTextHorizJustification",x00700014:"AnchorPoint",x00700015:"AnchorPointVisibility",x00700020:"GraphicDimensions",x00700021:"NumberOfGraphicPoints",x00700022:"GraphicData",x00700023:"GraphicType",x00700024:"GraphicFilled",x00700040:"ImageRotationRetired",x00700041:"ImageHorizontalFlip",x00700042:"ImageRotation",x00700050:"DisplayedAreaTopLeftTrial",x00700051:"DisplayedAreaBottomRightTrial",x00700052:"DisplayedAreaTopLeft",x00700053:"DisplayedAreaBottomRight",x0070005a:"DisplayedAreaSelectionSequence",x00700060:"GraphicLayerSequence",x00700062:"GraphicLayerOrder",x00700066:"GraphicLayerRecDisplayGraysclValue",x00700067:"GraphicLayerRecDisplayRGBValue",x00700068:"GraphicLayerDescription",x00700080:"ContentLabel",x00700081:"ContentDescription",x00700082:"PresentationCreationDate",x00700083:"PresentationCreationTime",x00700084:"ContentCreatorName",x00700086:"ContentCreatorIDCodeSequence",x00700100:"PresentationSizeMode",x00700101:"PresentationPixelSpacing",x00700102:"PresentationPixelAspectRatio",x00700103:"PresentationPixelMagRatio",x00700306:"ShapeType",x00700308:"RegistrationSequence",x00700309:"MatrixRegistrationSequence",x0070030a:"MatrixSequence",x0070030c:"FrameOfRefTransformationMatrixType",x0070030d:"RegistrationTypeCodeSequence",x0070030f:"FiducialDescription",x00700310:"FiducialIdentifier",x00700311:"FiducialIdentifierCodeSequence",x00700312:"ContourUncertaintyRadius",x00700314:"UsedFiducialsSequence",x00700318:"GraphicCoordinatesDataSequence",x0070031a:"FiducialUID",x0070031c:"FiducialSetSequence",x0070031e:"FiducialSequence",x00700401:"GraphicLayerRecomDisplayCIELabVal",x00700402:"BlendingSequence",x00700403:"RelativeOpacity",x00700404:"ReferencedSpatialRegistrationSeq",x00700405:"BlendingPosition",x00720002:"HangingProtocolName",x00720004:"HangingProtocolDescription",x00720006:"HangingProtocolLevel",x00720008:"HangingProtocolCreator",x0072000a:"HangingProtocolCreationDateTime",x0072000c:"HangingProtocolDefinitionSequence",x0072000e:"HangingProtocolUserIDCodeSequence",x00720010:"HangingProtocolUserGroupName",x00720012:"SourceHangingProtocolSequence",x00720014:"NumberOfPriorsReferenced",x00720020:"ImageSetsSequence",x00720022:"ImageSetSelectorSequence",x00720024:"ImageSetSelectorUsageFlag",x00720026:"SelectorAttribute",x00720028:"SelectorValueNumber",x00720030:"TimeBasedImageSetsSequence",x00720032:"ImageSetNumber",x00720034:"ImageSetSelectorCategory",x00720038:"RelativeTime",x0072003a:"RelativeTimeUnits",x0072003c:"AbstractPriorValue",x0072003e:"AbstractPriorCodeSequence",x00720040:"ImageSetLabel",x00720050:"SelectorAttributeVR",x00720052:"SelectorSequencePointer",x00720054:"SelectorSeqPointerPrivateCreator",x00720056:"SelectorAttributePrivateCreator",x00720060:"SelectorATValue",x00720062:"SelectorCSValue",x00720064:"SelectorISValue",x00720066:"SelectorLOValue",x00720068:"SelectorLTValue",x0072006a:"SelectorPNValue",x0072006c:"SelectorSHValue",x0072006e:"SelectorSTValue",x00720070:"SelectorUTValue",x00720072:"SelectorDSValue",x00720074:"SelectorFDValue",x00720076:"SelectorFLValue",x00720078:"SelectorULValue",x0072007a:"SelectorUSValue",x0072007c:"SelectorSLValue",x0072007e:"SelectorSSValue",x00720080:"SelectorCodeSequenceValue",x00720100:"NumberOfScreens",x00720102:"NominalScreenDefinitionSequence",x00720104:"NumberOfVerticalPixels",x00720106:"NumberOfHorizontalPixels",x00720108:"DisplayEnvironmentSpatialPosition",x0072010a:"ScreenMinimumGrayscaleBitDepth",x0072010c:"ScreenMinimumColorBitDepth",x0072010e:"ApplicationMaximumRepaintTime",x00720200:"DisplaySetsSequence",x00720202:"DisplaySetNumber",x00720203:"DisplaySetLabel",x00720204:"DisplaySetPresentationGroup",x00720206:"DisplaySetPresentationGroupDescr",x00720208:"PartialDataDisplayHandling",x00720210:"SynchronizedScrollingSequence",x00720212:"DisplaySetScrollingGroup",x00720214:"NavigationIndicatorSequence",x00720216:"NavigationDisplaySet",x00720218:"ReferenceDisplaySets",x00720300:"ImageBoxesSequence",x00720302:"ImageBoxNumber",x00720304:"ImageBoxLayoutType",x00720306:"ImageBoxTileHorizontalDimension",x00720308:"ImageBoxTileVerticalDimension",x00720310:"ImageBoxScrollDirection",x00720312:"ImageBoxSmallScrollType",x00720314:"ImageBoxSmallScrollAmount",x00720316:"ImageBoxLargeScrollType",x00720318:"ImageBoxLargeScrollAmount",x00720320:"ImageBoxOverlapPriority",x00720330:"CineRelativeToRealTime",x00720400:"FilterOperationsSequence",x00720402:"FilterByCategory",x00720404:"FilterByAttributePresence",x00720406:"FilterByOperator",x00720432:"SynchronizedImageBoxList",x00720434:"TypeOfSynchronization",x00720500:"BlendingOperationType",x00720510:"ReformattingOperationType",x00720512:"ReformattingThickness",x00720514:"ReformattingInterval",x00720516:"ReformattingOpInitialViewDir",x00720520:"RenderingType3D",x00720600:"SortingOperationsSequence",x00720602:"SortByCategory",x00720604:"SortingDirection",x00720700:"DisplaySetPatientOrientation",x00720702:"VOIType",x00720704:"PseudoColorType",x00720706:"ShowGrayscaleInverted",x00720710:"ShowImageTrueSizeFlag",x00720712:"ShowGraphicAnnotationFlag",x00720714:"ShowPatientDemographicsFlag",x00720716:"ShowAcquisitionTechniquesFlag",x00720717:"DisplaySetHorizontalJustification",x00720718:"DisplaySetVerticalJustification",x00741000:"UnifiedProcedureStepState",x00741002:"UPSProgressInformationSequence",x00741004:"UnifiedProcedureStepProgress",x00741006:"UnifiedProcedureStepProgressDescr",x00741008:"UnifiedProcedureStepComURISeq",x0074100a:"ContactURI",x0074100c:"ContactDisplayName",x00741020:"BeamTaskSequence",x00741022:"BeamTaskType",x00741024:"BeamOrderIndex",x00741030:"DeliveryVerificationImageSequence",x00741032:"VerificationImageTiming",x00741034:"DoubleExposureFlag",x00741036:"DoubleExposureOrdering",x00741038:"DoubleExposureMeterset",x0074103a:"DoubleExposureFieldDelta",x00741040:"RelatedReferenceRTImageSequence",x00741042:"GeneralMachineVerificationSequence",x00741044:"ConventionalMachineVerificationSeq",x00741046:"IonMachineVerificationSequence",x00741048:"FailedAttributesSequence",x0074104a:"OverriddenAttributesSequence",x0074104c:"ConventionalControlPointVerifySeq",x0074104e:"IonControlPointVerificationSeq",x00741050:"AttributeOccurrenceSequence",x00741052:"AttributeOccurrencePointer",x00741054:"AttributeItemSelector",x00741056:"AttributeOccurrencePrivateCreator",x00741200:"ScheduledProcedureStepPriority",x00741202:"StudyListLabel",x00741204:"ProcedureStepLabel",x00741210:"ScheduledProcessingParametersSeq",x00741212:"PerformedProcessingParametersSeq",x00741216:"UPSPerformedProcedureSequence",x00741220:"RelatedProcedureStepSequence",x00741222:"ProcedureStepRelationshipType",x00741230:"DeletionLock",x00741234:"ReceivingAE",x00741236:"RequestingAE",x00741238:"ReasonForCancellation",x00741242:"SCPStatus",x00741244:"SubscriptionListStatus",x00741246:"UPSListStatus",x00880130:"StorageMediaFileSetID",x00880140:"StorageMediaFileSetUID",x00880200:"IconImageSequence",x00880904:"TopicTitle",x00880906:"TopicSubject",x00880910:"TopicAuthor",x00880912:"TopicKeywords",x01000410:"SOPInstanceStatus",x01000420:"SOPAuthorizationDateAndTime",x01000424:"SOPAuthorizationComment",x01000426:"AuthorizationEquipmentCertNumber",x04000005:"MACIDNumber",x04000010:"MACCalculationTransferSyntaxUID",x04000015:"MACAlgorithm",x04000020:"DataElementsSigned",x04000100:"DigitalSignatureUID",x04000105:"DigitalSignatureDateTime",x04000110:"CertificateType",x04000115:"CertificateOfSigner",x04000120:"Signature",x04000305:"CertifiedTimestampType",x04000310:"CertifiedTimestamp",x04000401:"DigitalSignaturePurposeCodeSeq",x04000402:"ReferencedDigitalSignatureSeq",x04000403:"ReferencedSOPInstanceMACSeq",x04000404:"MAC",x04000500:"EncryptedAttributesSequence",x04000510:"EncryptedContentTransferSyntaxUID",x04000520:"EncryptedContent",x04000550:"ModifiedAttributesSequence",x04000561:"OriginalAttributesSequence",x04000562:"AttributeModificationDateTime",x04000563:"ModifyingSystem",x04000564:"SourceOfPreviousValues",x04000565:"ReasonForTheAttributeModification",x1000xxx0:"EscapeTriplet",x1000xxx1:"RunLengthTriplet",x1000xxx2:"HuffmanTableSize",x1000xxx3:"HuffmanTableTriplet",x1000xxx4:"ShiftTableSize",x1000xxx5:"ShiftTableTriplet",x1010xxxx:"ZonalMap",x20000010:"NumberOfCopies",x2000001e:"PrinterConfigurationSequence",x20000020:"PrintPriority",x20000030:"MediumType",x20000040:"FilmDestination",x20000050:"FilmSessionLabel",x20000060:"MemoryAllocation",x20000061:"MaximumMemoryAllocation",x20000062:"ColorImagePrintingFlag",x20000063:"CollationFlag",x20000065:"AnnotationFlag",x20000067:"ImageOverlayFlag",x20000069:"PresentationLUTFlag",x2000006a:"ImageBoxPresentationLUTFlag",x200000a0:"MemoryBitDepth",x200000a1:"PrintingBitDepth",x200000a2:"MediaInstalledSequence",x200000a4:"OtherMediaAvailableSequence",x200000a8:"SupportedImageDisplayFormatSeq",x20000500:"ReferencedFilmBoxSequence",x20000510:"ReferencedStoredPrintSequence",x20100010:"ImageDisplayFormat",x20100030:"AnnotationDisplayFormatID",x20100040:"FilmOrientation",x20100050:"FilmSizeID",x20100052:"PrinterResolutionID",x20100054:"DefaultPrinterResolutionID",x20100060:"MagnificationType",x20100080:"SmoothingType",x201000a6:"DefaultMagnificationType",x201000a7:"OtherMagnificationTypesAvailable",x201000a8:"DefaultSmoothingType",x201000a9:"OtherSmoothingTypesAvailable",x20100100:"BorderDensity",x20100110:"EmptyImageDensity",x20100120:"MinDensity",x20100130:"MaxDensity",x20100140:"Trim",x20100150:"ConfigurationInformation",x20100152:"ConfigurationInformationDescr",x20100154:"MaximumCollatedFilms",x2010015e:"Illumination",x20100160:"ReflectedAmbientLight",x20100376:"PrinterPixelSpacing",x20100500:"ReferencedFilmSessionSequence",x20100510:"ReferencedImageBoxSequence",x20100520:"ReferencedBasicAnnotationBoxSeq",x20200010:"ImageBoxPosition",x20200020:"Polarity",x20200030:"RequestedImageSize",x20200040:"RequestedDecimate-CropBehavior",x20200050:"RequestedResolutionID",x202000a0:"RequestedImageSizeFlag",x202000a2:"DecimateCropResult",x20200110:"BasicGrayscaleImageSequence",x20200111:"BasicColorImageSequence",x20200130:"ReferencedImageOverlayBoxSequence",x20200140:"ReferencedVOILUTBoxSequence",x20300010:"AnnotationPosition",x20300020:"TextString",x20400010:"ReferencedOverlayPlaneSequence",x20400011:"ReferencedOverlayPlaneGroups",x20400020:"OverlayPixelDataSequence",x20400060:"OverlayMagnificationType",x20400070:"OverlaySmoothingType",x20400072:"OverlayOrImageMagnification",x20400074:"MagnifyToNumberOfColumns",x20400080:"OverlayForegroundDensity",x20400082:"OverlayBackgroundDensity",x20400090:"OverlayMode",x20400100:"ThresholdDensity",x20400500:"ReferencedImageBoxSequenceRetired",x20500010:"PresentationLUTSequence",x20500020:"PresentationLUTShape",x20500500:"ReferencedPresentationLUTSequence",x21000010:"PrintJobID",x21000020:"ExecutionStatus",x21000030:"ExecutionStatusInfo",x21000040:"CreationDate",x21000050:"CreationTime",x21000070:"Originator",x21000140:"DestinationAE",x21000160:"OwnerID",x21000170:"NumberOfFilms",x21000500:"ReferencedPrintJobSequencePullStoredPrint",x21100010:"PrinterStatus",x21100020:"PrinterStatusInfo",x21100030:"PrinterName",x21100099:"PrintQueueID",x21200010:"QueueStatus",x21200050:"PrintJobDescriptionSequence",x21200070:"ReferencedPrintJobSequence",x21300010:"PrintManagementCapabilitiesSeq",x21300015:"PrinterCharacteristicsSequence",x21300030:"FilmBoxContentSequence",x21300040:"ImageBoxContentSequence",x21300050:"AnnotationContentSequence",x21300060:"ImageOverlayBoxContentSequence",x21300080:"PresentationLUTContentSequence",x213000a0:"ProposedStudySequence",x213000c0:"OriginalImageSequence",x22000001:"LabelFromInfoExtractedFromInstance",x22000002:"LabelText",x22000003:"LabelStyleSelection",x22000004:"MediaDisposition",x22000005:"BarcodeValue",x22000006:"BarcodeSymbology",x22000007:"AllowMediaSplitting",x22000008:"IncludeNonDICOMObjects",x22000009:"IncludeDisplayApplication",x2200000a:"SaveCompInstancesAfterMediaCreate",x2200000b:"TotalNumberMediaPiecesCreated",x2200000c:"RequestedMediaApplicationProfile",x2200000d:"ReferencedStorageMediaSequence",x2200000e:"FailureAttributes",x2200000f:"AllowLossyCompression",x22000020:"RequestPriority",x30020002:"RTImageLabel",x30020003:"RTImageName",x30020004:"RTImageDescription",x3002000a:"ReportedValuesOrigin",x3002000c:"RTImagePlane",x3002000d:"XRayImageReceptorTranslation",x3002000e:"XRayImageReceptorAngle",x30020010:"RTImageOrientation",x30020011:"ImagePlanePixelSpacing",x30020012:"RTImagePosition",x30020020:"RadiationMachineName",x30020022:"RadiationMachineSAD",x30020024:"RadiationMachineSSD",x30020026:"RTImageSID",x30020028:"SourceToReferenceObjectDistance",x30020029:"FractionNumber",x30020030:"ExposureSequence",x30020032:"MetersetExposure",x30020034:"DiaphragmPosition",x30020040:"FluenceMapSequence",x30020041:"FluenceDataSource",x30020042:"FluenceDataScale",x30020051:"FluenceMode",x30020052:"FluenceModeID",x30040001:"DVHType",x30040002:"DoseUnits",x30040004:"DoseType",x30040006:"DoseComment",x30040008:"NormalizationPoint",x3004000a:"DoseSummationType",x3004000c:"GridFrameOffsetVector",x3004000e:"DoseGridScaling",x30040010:"RTDoseROISequence",x30040012:"DoseValue",x30040014:"TissueHeterogeneityCorrection",x30040040:"DVHNormalizationPoint",x30040042:"DVHNormalizationDoseValue",x30040050:"DVHSequence",x30040052:"DVHDoseScaling",x30040054:"DVHVolumeUnits",x30040056:"DVHNumberOfBins",x30040058:"DVHData",x30040060:"DVHReferencedROISequence",x30040062:"DVHROIContributionType",x30040070:"DVHMinimumDose",x30040072:"DVHMaximumDose",x30040074:"DVHMeanDose",x30060002:"StructureSetLabel",x30060004:"StructureSetName",x30060006:"StructureSetDescription",x30060008:"StructureSetDate",x30060009:"StructureSetTime",x30060010:"ReferencedFrameOfReferenceSequence",x30060012:"RTReferencedStudySequence",x30060014:"RTReferencedSeriesSequence",x30060016:"ContourImageSequence",x30060020:"StructureSetROISequence",x30060022:"ROINumber",x30060024:"ReferencedFrameOfReferenceUID",x30060026:"ROIName",x30060028:"ROIDescription",x3006002a:"ROIDisplayColor",x3006002c:"ROIVolume",x30060030:"RTRelatedROISequence",x30060033:"RTROIRelationship",x30060036:"ROIGenerationAlgorithm",x30060038:"ROIGenerationDescription",x30060039:"ROIContourSequence",x30060040:"ContourSequence",x30060042:"ContourGeometricType",x30060044:"ContourSlabThickness",x30060045:"ContourOffsetVector",x30060046:"NumberOfContourPoints",x30060048:"ContourNumber",x30060049:"AttachedContours",x30060050:"ContourData",x30060080:"RTROIObservationsSequence",x30060082:"ObservationNumber",x30060084:"ReferencedROINumber",x30060085:"ROIObservationLabel",x30060086:"RTROIIdentificationCodeSequence",x30060088:"ROIObservationDescription",x300600a0:"RelatedRTROIObservationsSequence",x300600a4:"RTROIInterpretedType",x300600a6:"ROIInterpreter",x300600b0:"ROIPhysicalPropertiesSequence",x300600b2:"ROIPhysicalProperty",x300600b4:"ROIPhysicalPropertyValue",x300600b6:"ROIElementalCompositionSequence",x300600b7:"ROIElementalCompAtomicNumber",x300600b8:"ROIElementalCompAtomicMassFraction",x300600c0:"FrameOfReferenceRelationshipSeq",x300600c2:"RelatedFrameOfReferenceUID",x300600c4:"FrameOfReferenceTransformType",x300600c6:"FrameOfReferenceTransformMatrix",x300600c8:"FrameOfReferenceTransformComment",x30080010:"MeasuredDoseReferenceSequence",x30080012:"MeasuredDoseDescription",x30080014:"MeasuredDoseType",x30080016:"MeasuredDoseValue",x30080020:"TreatmentSessionBeamSequence",x30080021:"TreatmentSessionIonBeamSequence",x30080022:"CurrentFractionNumber",x30080024:"TreatmentControlPointDate",x30080025:"TreatmentControlPointTime",x3008002a:"TreatmentTerminationStatus",x3008002b:"TreatmentTerminationCode",x3008002c:"TreatmentVerificationStatus",x30080030:"ReferencedTreatmentRecordSequence",x30080032:"SpecifiedPrimaryMeterset",x30080033:"SpecifiedSecondaryMeterset",x30080036:"DeliveredPrimaryMeterset",x30080037:"DeliveredSecondaryMeterset",x3008003a:"SpecifiedTreatmentTime",x3008003b:"DeliveredTreatmentTime",x30080040:"ControlPointDeliverySequence",x30080041:"IonControlPointDeliverySequence",x30080042:"SpecifiedMeterset",x30080044:"DeliveredMeterset",x30080045:"MetersetRateSet",x30080046:"MetersetRateDelivered",x30080047:"ScanSpotMetersetsDelivered",x30080048:"DoseRateDelivered",x30080050:"TreatmentSummaryCalcDoseRefSeq",x30080052:"CumulativeDoseToDoseReference",x30080054:"FirstTreatmentDate",x30080056:"MostRecentTreatmentDate",x3008005a:"NumberOfFractionsDelivered",x30080060:"OverrideSequence",x30080061:"ParameterSequencePointer",x30080062:"OverrideParameterPointer",x30080063:"ParameterItemIndex",x30080064:"MeasuredDoseReferenceNumber",x30080065:"ParameterPointer",x30080066:"OverrideReason",x30080068:"CorrectedParameterSequence",x3008006a:"CorrectionValue",x30080070:"CalculatedDoseReferenceSequence",x30080072:"CalculatedDoseReferenceNumber",x30080074:"CalculatedDoseReferenceDescription",x30080076:"CalculatedDoseReferenceDoseValue",x30080078:"StartMeterset",x3008007a:"EndMeterset",x30080080:"ReferencedMeasuredDoseReferenceSeq",x30080082:"ReferencedMeasuredDoseReferenceNum",x30080090:"ReferencedCalculatedDoseRefSeq",x30080092:"ReferencedCalculatedDoseRefNumber",x300800a0:"BeamLimitingDeviceLeafPairsSeq",x300800b0:"RecordedWedgeSequence",x300800c0:"RecordedCompensatorSequence",x300800d0:"RecordedBlockSequence",x300800e0:"TreatmentSummaryMeasuredDoseRefSeq",x300800f0:"RecordedSnoutSequence",x300800f2:"RecordedRangeShifterSequence",x300800f4:"RecordedLateralSpreadingDeviceSeq",x300800f6:"RecordedRangeModulatorSequence",x30080100:"RecordedSourceSequence",x30080105:"SourceSerialNumber",x30080110:"TreatmentSessionAppSetupSeq",x30080116:"ApplicationSetupCheck",x30080120:"RecordedBrachyAccessoryDeviceSeq",x30080122:"ReferencedBrachyAccessoryDeviceNum",x30080130:"RecordedChannelSequence",x30080132:"SpecifiedChannelTotalTime",x30080134:"DeliveredChannelTotalTime",x30080136:"SpecifiedNumberOfPulses",x30080138:"DeliveredNumberOfPulses",x3008013a:"SpecifiedPulseRepetitionInterval",x3008013c:"DeliveredPulseRepetitionInterval",x30080140:"RecordedSourceApplicatorSequence",x30080142:"ReferencedSourceApplicatorNumber",x30080150:"RecordedChannelShieldSequence",x30080152:"ReferencedChannelShieldNumber",
x30080160:"BrachyControlPointDeliveredSeq",x30080162:"SafePositionExitDate",x30080164:"SafePositionExitTime",x30080166:"SafePositionReturnDate",x30080168:"SafePositionReturnTime",x30080200:"CurrentTreatmentStatus",x30080202:"TreatmentStatusComment",x30080220:"FractionGroupSummarySequence",x30080223:"ReferencedFractionNumber",x30080224:"FractionGroupType",x30080230:"BeamStopperPosition",x30080240:"FractionStatusSummarySequence",x30080250:"TreatmentDate",x30080251:"TreatmentTime",x300a0002:"RTPlanLabel",x300a0003:"RTPlanName",x300a0004:"RTPlanDescription",x300a0006:"RTPlanDate",x300a0007:"RTPlanTime",x300a0009:"TreatmentProtocols",x300a000a:"PlanIntent",x300a000b:"TreatmentSites",x300a000c:"RTPlanGeometry",x300a000e:"PrescriptionDescription",x300a0010:"DoseReferenceSequence",x300a0012:"DoseReferenceNumber",x300a0013:"DoseReferenceUID",x300a0014:"DoseReferenceStructureType",x300a0015:"NominalBeamEnergyUnit",x300a0016:"DoseReferenceDescription",x300a0018:"DoseReferencePointCoordinates",x300a001a:"NominalPriorDose",x300a0020:"DoseReferenceType",x300a0021:"ConstraintWeight",x300a0022:"DeliveryWarningDose",x300a0023:"DeliveryMaximumDose",x300a0025:"TargetMinimumDose",x300a0026:"TargetPrescriptionDose",x300a0027:"TargetMaximumDose",x300a0028:"TargetUnderdoseVolumeFraction",x300a002a:"OrganAtRiskFullVolumeDose",x300a002b:"OrganAtRiskLimitDose",x300a002c:"OrganAtRiskMaximumDose",x300a002d:"OrganAtRiskOverdoseVolumeFraction",x300a0040:"ToleranceTableSequence",x300a0042:"ToleranceTableNumber",x300a0043:"ToleranceTableLabel",x300a0044:"GantryAngleTolerance",x300a0046:"BeamLimitingDeviceAngleTolerance",x300a0048:"BeamLimitingDeviceToleranceSeq",x300a004a:"BeamLimitingDevicePositionTol",x300a004b:"SnoutPositionTolerance",x300a004c:"PatientSupportAngleTolerance",x300a004e:"TableTopEccentricAngleTolerance",x300a004f:"TableTopPitchAngleTolerance",x300a0050:"TableTopRollAngleTolerance",x300a0051:"TableTopVerticalPositionTolerance",x300a0052:"TableTopLongitudinalPositionTol",x300a0053:"TableTopLateralPositionTolerance",x300a0055:"RTPlanRelationship",x300a0070:"FractionGroupSequence",x300a0071:"FractionGroupNumber",x300a0072:"FractionGroupDescription",x300a0078:"NumberOfFractionsPlanned",x300a0079:"NumberFractionPatternDigitsPerDay",x300a007a:"RepeatFractionCycleLength",x300a007b:"FractionPattern",x300a0080:"NumberOfBeams",x300a0082:"BeamDoseSpecificationPoint",x300a0084:"BeamDose",x300a0086:"BeamMeterset",x300a0088:"BeamDosePointDepth",x300a0089:"BeamDosePointEquivalentDepth",x300a008a:"BeamDosePointSSD",x300a00a0:"NumberOfBrachyApplicationSetups",x300a00a2:"BrachyAppSetupDoseSpecPoint",x300a00a4:"BrachyApplicationSetupDose",x300a00b0:"BeamSequence",x300a00b2:"TreatmentMachineName",x300a00b3:"PrimaryDosimeterUnit",x300a00b4:"SourceAxisDistance",x300a00b6:"BeamLimitingDeviceSequence",x300a00b8:"RTBeamLimitingDeviceType",x300a00ba:"SourceToBeamLimitingDeviceDistance",x300a00bb:"IsocenterToBeamLimitingDeviceDist",x300a00bc:"NumberOfLeafJawPairs",x300a00be:"LeafPositionBoundaries",x300a00c0:"BeamNumber",x300a00c2:"BeamName",x300a00c3:"BeamDescription",x300a00c4:"BeamType",x300a00c6:"RadiationType",x300a00c7:"HighDoseTechniqueType",x300a00c8:"ReferenceImageNumber",x300a00ca:"PlannedVerificationImageSequence",x300a00cc:"ImagingDeviceSpecificAcqParams",x300a00ce:"TreatmentDeliveryType",x300a00d0:"NumberOfWedges",x300a00d1:"WedgeSequence",x300a00d2:"WedgeNumber",x300a00d3:"WedgeType",x300a00d4:"WedgeID",x300a00d5:"WedgeAngle",x300a00d6:"WedgeFactor",x300a00d7:"TotalWedgeTrayWaterEquivThickness",x300a00d8:"WedgeOrientation",x300a00d9:"IsocenterToWedgeTrayDistance",x300a00da:"SourceToWedgeTrayDistance",x300a00db:"WedgeThinEdgePosition",x300a00dc:"BolusID",x300a00dd:"BolusDescription",x300a00e0:"NumberOfCompensators",x300a00e1:"MaterialID",x300a00e2:"TotalCompensatorTrayFactor",x300a00e3:"CompensatorSequence",x300a00e4:"CompensatorNumber",x300a00e5:"CompensatorID",x300a00e6:"SourceToCompensatorTrayDistance",x300a00e7:"CompensatorRows",x300a00e8:"CompensatorColumns",x300a00e9:"CompensatorPixelSpacing",x300a00ea:"CompensatorPosition",x300a00eb:"CompensatorTransmissionData",x300a00ec:"CompensatorThicknessData",x300a00ed:"NumberOfBoli",x300a00ee:"CompensatorType",x300a00f0:"NumberOfBlocks",x300a00f2:"TotalBlockTrayFactor",x300a00f3:"TotalBlockTrayWaterEquivThickness",x300a00f4:"BlockSequence",x300a00f5:"BlockTrayID",x300a00f6:"SourceToBlockTrayDistance",x300a00f7:"IsocenterToBlockTrayDistance",x300a00f8:"BlockType",x300a00f9:"AccessoryCode",x300a00fa:"BlockDivergence",x300a00fb:"BlockMountingPosition",x300a00fc:"BlockNumber",x300a00fe:"BlockName",x300a0100:"BlockThickness",x300a0102:"BlockTransmission",x300a0104:"BlockNumberOfPoints",x300a0106:"BlockData",x300a0107:"ApplicatorSequence",x300a0108:"ApplicatorID",x300a0109:"ApplicatorType",x300a010a:"ApplicatorDescription",x300a010c:"CumulativeDoseReferenceCoefficient",x300a010e:"FinalCumulativeMetersetWeight",x300a0110:"NumberOfControlPoints",x300a0111:"ControlPointSequence",x300a0112:"ControlPointIndex",x300a0114:"NominalBeamEnergy",x300a0115:"DoseRateSet",x300a0116:"WedgePositionSequence",x300a0118:"WedgePosition",x300a011a:"BeamLimitingDevicePositionSequence",x300a011c:"LeafJawPositions",x300a011e:"GantryAngle",x300a011f:"GantryRotationDirection",x300a0120:"BeamLimitingDeviceAngle",x300a0121:"BeamLimitingDeviceRotateDirection",x300a0122:"PatientSupportAngle",x300a0123:"PatientSupportRotationDirection",x300a0124:"TableTopEccentricAxisDistance",x300a0125:"TableTopEccentricAngle",x300a0126:"TableTopEccentricRotateDirection",x300a0128:"TableTopVerticalPosition",x300a0129:"TableTopLongitudinalPosition",x300a012a:"TableTopLateralPosition",x300a012c:"IsocenterPosition",x300a012e:"SurfaceEntryPoint",x300a0130:"SourceToSurfaceDistance",x300a0134:"CumulativeMetersetWeight",x300a0140:"TableTopPitchAngle",x300a0142:"TableTopPitchRotationDirection",x300a0144:"TableTopRollAngle",x300a0146:"TableTopRollRotationDirection",x300a0148:"HeadFixationAngle",x300a014a:"GantryPitchAngle",x300a014c:"GantryPitchRotationDirection",x300a014e:"GantryPitchAngleTolerance",x300a0180:"PatientSetupSequence",x300a0182:"PatientSetupNumber",x300a0183:"PatientSetupLabel",x300a0184:"PatientAdditionalPosition",x300a0190:"FixationDeviceSequence",x300a0192:"FixationDeviceType",x300a0194:"FixationDeviceLabel",x300a0196:"FixationDeviceDescription",x300a0198:"FixationDevicePosition",x300a0199:"FixationDevicePitchAngle",x300a019a:"FixationDeviceRollAngle",x300a01a0:"ShieldingDeviceSequence",x300a01a2:"ShieldingDeviceType",x300a01a4:"ShieldingDeviceLabel",x300a01a6:"ShieldingDeviceDescription",x300a01a8:"ShieldingDevicePosition",x300a01b0:"SetupTechnique",x300a01b2:"SetupTechniqueDescription",x300a01b4:"SetupDeviceSequence",x300a01b6:"SetupDeviceType",x300a01b8:"SetupDeviceLabel",x300a01ba:"SetupDeviceDescription",x300a01bc:"SetupDeviceParameter",x300a01d0:"SetupReferenceDescription",x300a01d2:"TableTopVerticalSetupDisplacement",x300a01d4:"TableTopLongitudinalSetupDisplace",x300a01d6:"TableTopLateralSetupDisplacement",x300a0200:"BrachyTreatmentTechnique",x300a0202:"BrachyTreatmentType",x300a0206:"TreatmentMachineSequence",x300a0210:"SourceSequence",x300a0212:"SourceNumber",x300a0214:"SourceType",x300a0216:"SourceManufacturer",x300a0218:"ActiveSourceDiameter",x300a021a:"ActiveSourceLength",x300a0222:"SourceEncapsulationNomThickness",x300a0224:"SourceEncapsulationNomTransmission",x300a0226:"SourceIsotopeName",x300a0228:"SourceIsotopeHalfLife",x300a0229:"SourceStrengthUnits",x300a022a:"ReferenceAirKermaRate",x300a022b:"SourceStrength",x300a022c:"SourceStrengthReferenceDate",x300a022e:"SourceStrengthReferenceTime",x300a0230:"ApplicationSetupSequence",x300a0232:"ApplicationSetupType",x300a0234:"ApplicationSetupNumber",x300a0236:"ApplicationSetupName",x300a0238:"ApplicationSetupManufacturer",x300a0240:"TemplateNumber",x300a0242:"TemplateType",x300a0244:"TemplateName",x300a0250:"TotalReferenceAirKerma",x300a0260:"BrachyAccessoryDeviceSequence",x300a0262:"BrachyAccessoryDeviceNumber",x300a0263:"BrachyAccessoryDeviceID",x300a0264:"BrachyAccessoryDeviceType",x300a0266:"BrachyAccessoryDeviceName",x300a026a:"BrachyAccessoryDeviceNomThickness",x300a026c:"BrachyAccessoryDevNomTransmission",x300a0280:"ChannelSequence",x300a0282:"ChannelNumber",x300a0284:"ChannelLength",x300a0286:"ChannelTotalTime",x300a0288:"SourceMovementType",x300a028a:"NumberOfPulses",x300a028c:"PulseRepetitionInterval",x300a0290:"SourceApplicatorNumber",x300a0291:"SourceApplicatorID",x300a0292:"SourceApplicatorType",x300a0294:"SourceApplicatorName",x300a0296:"SourceApplicatorLength",x300a0298:"SourceApplicatorManufacturer",x300a029c:"SourceApplicatorWallNomThickness",x300a029e:"SourceApplicatorWallNomTrans",x300a02a0:"SourceApplicatorStepSize",x300a02a2:"TransferTubeNumber",x300a02a4:"TransferTubeLength",x300a02b0:"ChannelShieldSequence",x300a02b2:"ChannelShieldNumber",x300a02b3:"ChannelShieldID",x300a02b4:"ChannelShieldName",x300a02b8:"ChannelShieldNominalThickness",x300a02ba:"ChannelShieldNominalTransmission",x300a02c8:"FinalCumulativeTimeWeight",x300a02d0:"BrachyControlPointSequence",x300a02d2:"ControlPointRelativePosition",x300a02d4:"ControlPoint3DPosition",x300a02d6:"CumulativeTimeWeight",x300a02e0:"CompensatorDivergence",x300a02e1:"CompensatorMountingPosition",x300a02e2:"SourceToCompensatorDistance",x300a02e3:"TotalCompTrayWaterEquivThickness",x300a02e4:"IsocenterToCompensatorTrayDistance",x300a02e5:"CompensatorColumnOffset",x300a02e6:"IsocenterToCompensatorDistances",x300a02e7:"CompensatorRelStoppingPowerRatio",x300a02e8:"CompensatorMillingToolDiameter",x300a02ea:"IonRangeCompensatorSequence",x300a02eb:"CompensatorDescription",x300a0302:"RadiationMassNumber",x300a0304:"RadiationAtomicNumber",x300a0306:"RadiationChargeState",x300a0308:"ScanMode",x300a030a:"VirtualSourceAxisDistances",x300a030c:"SnoutSequence",x300a030d:"SnoutPosition",x300a030f:"SnoutID",x300a0312:"NumberOfRangeShifters",x300a0314:"RangeShifterSequence",x300a0316:"RangeShifterNumber",x300a0318:"RangeShifterID",x300a0320:"RangeShifterType",x300a0322:"RangeShifterDescription",x300a0330:"NumberOfLateralSpreadingDevices",x300a0332:"LateralSpreadingDeviceSequence",x300a0334:"LateralSpreadingDeviceNumber",x300a0336:"LateralSpreadingDeviceID",x300a0338:"LateralSpreadingDeviceType",x300a033a:"LateralSpreadingDeviceDescription",x300a033c:"LateralSpreadingDevWaterEquivThick",x300a0340:"NumberOfRangeModulators",x300a0342:"RangeModulatorSequence",x300a0344:"RangeModulatorNumber",x300a0346:"RangeModulatorID",x300a0348:"RangeModulatorType",x300a034a:"RangeModulatorDescription",x300a034c:"BeamCurrentModulationID",x300a0350:"PatientSupportType",x300a0352:"PatientSupportID",x300a0354:"PatientSupportAccessoryCode",x300a0356:"FixationLightAzimuthalAngle",x300a0358:"FixationLightPolarAngle",x300a035a:"MetersetRate",x300a0360:"RangeShifterSettingsSequence",x300a0362:"RangeShifterSetting",x300a0364:"IsocenterToRangeShifterDistance",x300a0366:"RangeShifterWaterEquivThickness",x300a0370:"LateralSpreadingDeviceSettingsSeq",x300a0372:"LateralSpreadingDeviceSetting",x300a0374:"IsocenterToLateralSpreadingDevDist",x300a0380:"RangeModulatorSettingsSequence",x300a0382:"RangeModulatorGatingStartValue",x300a0384:"RangeModulatorGatingStopValue",x300a038a:"IsocenterToRangeModulatorDistance",x300a0390:"ScanSpotTuneID",x300a0392:"NumberOfScanSpotPositions",x300a0394:"ScanSpotPositionMap",x300a0396:"ScanSpotMetersetWeights",x300a0398:"ScanningSpotSize",x300a039a:"NumberOfPaintings",x300a03a0:"IonToleranceTableSequence",x300a03a2:"IonBeamSequence",x300a03a4:"IonBeamLimitingDeviceSequence",x300a03a6:"IonBlockSequence",x300a03a8:"IonControlPointSequence",x300a03aa:"IonWedgeSequence",x300a03ac:"IonWedgePositionSequence",x300a0401:"ReferencedSetupImageSequence",x300a0402:"SetupImageComment",x300a0410:"MotionSynchronizationSequence",x300a0412:"ControlPointOrientation",x300a0420:"GeneralAccessorySequence",x300a0421:"GeneralAccessoryID",x300a0422:"GeneralAccessoryDescription",x300a0423:"GeneralAccessoryType",x300a0424:"GeneralAccessoryNumber",x300c0002:"ReferencedRTPlanSequence",x300c0004:"ReferencedBeamSequence",x300c0006:"ReferencedBeamNumber",x300c0007:"ReferencedReferenceImageNumber",x300c0008:"StartCumulativeMetersetWeight",x300c0009:"EndCumulativeMetersetWeight",x300c000a:"ReferencedBrachyAppSetupSeq",x300c000c:"ReferencedBrachyAppSetupNumber",x300c000e:"ReferencedSourceNumber",x300c0020:"ReferencedFractionGroupSequence",x300c0022:"ReferencedFractionGroupNumber",x300c0040:"ReferencedVerificationImageSeq",x300c0042:"ReferencedReferenceImageSequence",x300c0050:"ReferencedDoseReferenceSequence",x300c0051:"ReferencedDoseReferenceNumber",x300c0055:"BrachyReferencedDoseReferenceSeq",x300c0060:"ReferencedStructureSetSequence",x300c006a:"ReferencedPatientSetupNumber",x300c0080:"ReferencedDoseSequence",x300c00a0:"ReferencedToleranceTableNumber",x300c00b0:"ReferencedBolusSequence",x300c00c0:"ReferencedWedgeNumber",x300c00d0:"ReferencedCompensatorNumber",x300c00e0:"ReferencedBlockNumber",x300c00f0:"ReferencedControlPointIndex",x300c00f2:"ReferencedControlPointSequence",x300c00f4:"ReferencedStartControlPointIndex",x300c00f6:"ReferencedStopControlPointIndex",x300c0100:"ReferencedRangeShifterNumber",x300c0102:"ReferencedLateralSpreadingDevNum",x300c0104:"ReferencedRangeModulatorNumber",x300e0002:"ApprovalStatus",x300e0004:"ReviewDate",x300e0005:"ReviewTime",x300e0008:"ReviewerName",x40000000:"TextGroupLength",x40000010:"Arbitrary",x40004000:"TextComments",x40080040:"ResultsID",x40080042:"ResultsIDIssuer",x40080050:"ReferencedInterpretationSequence",x40080100:"InterpretationRecordedDate",x40080101:"InterpretationRecordedTime",x40080102:"InterpretationRecorder",x40080103:"ReferenceToRecordedSound",x40080108:"InterpretationTranscriptionDate",x40080109:"InterpretationTranscriptionTime",x4008010a:"InterpretationTranscriber",x4008010b:"InterpretationText",x4008010c:"InterpretationAuthor",x40080111:"InterpretationApproverSequence",x40080112:"InterpretationApprovalDate",x40080113:"InterpretationApprovalTime",x40080114:"PhysicianApprovingInterpretation",x40080115:"InterpretationDiagnosisDescription",x40080117:"InterpretationDiagnosisCodeSeq",x40080118:"ResultsDistributionListSequence",x40080119:"DistributionName",x4008011a:"DistributionAddress",x40080200:"InterpretationID",x40080202:"InterpretationIDIssuer",x40080210:"InterpretationTypeID",x40080212:"InterpretationStatusID",x40080300:"Impressions",x40084000:"ResultsComments",x4ffe0001:"MACParametersSequence",x50xx0005:"CurveDimensions",x50xx0010:"NumberOfPoints",x50xx0020:"TypeOfData",x50xx0022:"CurveDescription",x50xx0030:"AxisUnits",x50xx0040:"AxisLabels",x50xx0103:"DataValueRepresentation",x50xx0104:"MinimumCoordinateValue",x50xx0105:"MaximumCoordinateValue",x50xx0106:"CurveRange",x50xx0110:"CurveDataDescriptor",x50xx0112:"CoordinateStartValue",x50xx0114:"CoordinateStepValue",x50xx1001:"CurveActivationLayer",x50xx2000:"AudioType",x50xx2002:"AudioSampleFormat",x50xx2004:"NumberOfChannels",x50xx2006:"NumberOfSamples",x50xx2008:"SampleRate",x50xx200a:"TotalTime",x50xx200c:"AudioSampleData",x50xx200e:"AudioComments",x50xx2500:"CurveLabel",x50xx2600:"CurveReferencedOverlaySequence",x50xx2610:"ReferencedOverlayGroup",x50xx3000:"CurveData",x52009229:"SharedFunctionalGroupsSequence",x52009230:"PerFrameFunctionalGroupsSequence",x54000100:"WaveformSequence",x54000110:"ChannelMinimumValue",x54000112:"ChannelMaximumValue",x54001004:"WaveformBitsAllocated",x54001006:"WaveformSampleInterpretation",x5400100a:"WaveformPaddingValue",x54001010:"WaveformData",x56000010:"FirstOrderPhaseCorrectionAngle",x56000020:"SpectroscopyData",x60000000:"OverlayGroupLength",x60xx0010:"OverlayRows",x60xx0011:"OverlayColumns",x60xx0012:"OverlayPlanes",x60xx0015:"NumberOfFramesInOverlay",x60xx0022:"OverlayDescription",x60xx0040:"OverlayType",x60xx0045:"OverlaySubtype",x60xx0050:"OverlayOrigin",x60xx0051:"ImageFrameOrigin",x60xx0052:"OverlayPlaneOrigin",x60xx0060:"OverlayCompressionCode",x60xx0061:"OverlayCompressionOriginator",x60xx0062:"OverlayCompressionLabel",x60xx0063:"OverlayCompressionDescription",x60xx0066:"OverlayCompressionStepPointers",x60xx0068:"OverlayRepeatInterval",x60xx0069:"OverlayBitsGrouped",x60xx0100:"OverlayBitsAllocated",x60xx0102:"OverlayBitPosition",x60xx0110:"OverlayFormat",x60xx0200:"OverlayLocation",x60xx0800:"OverlayCodeLabel",x60xx0802:"OverlayNumberOfTables",x60xx0803:"OverlayCodeTableLocation",x60xx0804:"OverlayBitsForCodeWord",x60xx1001:"OverlayActivationLayer",x60xx1100:"OverlayDescriptorGray",x60xx1101:"OverlayDescriptorRed",x60xx1102:"OverlayDescriptorGreen",x60xx1103:"OverlayDescriptorBlue",x60xx1200:"OverlaysGray",x60xx1201:"OverlaysRed",x60xx1202:"OverlaysGreen",x60xx1203:"OverlaysBlue",x60xx1301:"ROIArea",x60xx1302:"ROIMean",x60xx1303:"ROIStandardDeviation",x60xx1500:"OverlayLabel",x60xx3000:"OverlayData",x60xx4000:"OverlayComments",x7fxx0000:"PixelDataGroupLength",x7fxx0010:"PixelData",x7fxx0011:"VariableNextDataGroup",x7fxx0020:"VariableCoefficientsSDVN",x7fxx0030:"VariableCoefficientsSDHN",x7fxx0040:"VariableCoefficientsSDDN",xfffafffa:"DigitalSignaturesSequence",xfffcfffc:"DataSetTrailingPadding",xfffee000:"StartOfItem",xfffee00d:"EndOfItems",xfffee0dd:"EndOfSequence"};s.init(c),c=null}],"StackManager.js":["meteor/ohif:core","./getImageId","./classes/OHIFError",function(e,t,n){function o(e,t,n){var o=r.viewer.metadataProvider,a=n.images.length,s=[],c=void 0;n.images.forEach(function(e,u){var l=e.getData(),d={instance:l,series:n,study:t,numImages:a,imageIndex:u+1},m=l.numberOfFrames;if(m>1){r.log.info("Multiframe image detected");for(var p=0;p<m;p++)d.frame=p,c=i(l,p),s.push(c),o.addMetadata(c,d)}else c=i(l),s.push(c),o.addMetadata(c,d)});var u={displaySetInstanceUid:n.displaySetInstanceUid,imageIds:s,frameRate:n.frameRate,isClip:n.isClip};return e[n.displaySetInstanceUid]=u,u}n.export({StackManager:function(){return l}});var r;n.import("meteor/ohif:core",{OHIF:function(e){r=e}});var i;n.import("./getImageId",{getImageId:function(e){i=e}});var a;n.import("./classes/OHIFError",{OHIFError:function(e){a=e}});var s={},c={},u=[];c={createAndAddStack:o};var l={clearStacks:function(){function e(){s={}}return e}(),makeAndAddStack:function(){function e(e,t){return c.createAndAddStack(s,e,t,u)}return e}(),findStack:function(){function e(e){return s[e]}return e}(),findOrCreateStack:function(){function e(e,t){var n=this.findStack(t.displaySetInstanceUid);return n&&n.imageIds||(n=this.makeAndAddStack(e,t)),n}return e}(),getAllStacks:function(){function e(){return s}return e}(),addStackUpdatedCallback:function(){function e(e){if("function"!=typeof e)throw new a("callback must be provided as a function");u.push(e)}return e}(),getConfiguration:function(){function e(){return c}return e}(),setConfiguration:function(){function e(e){c=e}return e}()}}],"WLPresets.js":["babel-runtime/helpers/classCallCheck","meteor/meteor","meteor/session","meteor/tracker","meteor/underscore","meteor/ohif:core","./viewportUtils",function(e,t,n){n.export({WLPresets:function(){return f}});var o;n.import("babel-runtime/helpers/classCallCheck",{default:function(e){o=e}});var r;n.import("meteor/meteor",{Meteor:function(e){r=e}});var i;n.import("meteor/session",{Session:function(e){i=e}});var a;n.import("meteor/tracker",{Tracker:function(e){a=e}});var s;n.import("meteor/underscore",{_:function(e){s=e}});var c;n.import("meteor/ohif:core",{OHIF:function(e){c=e}});var u;n.import("./viewportUtils",{viewportUtils:function(e){u=e}});var l="Custom",d="Default",m="WindowLevelPresetsDefinitions";c.viewer.defaultWLPresets={0:{id:"SoftTissue",wc:40,ww:400},1:{id:"Lung",wc:-600,ww:1500},2:{id:"Liver",wc:90,ww:150},3:{id:"Bone",wc:480,ww:2500},4:{id:"Brain",wc:40,ww:80},5:{},6:{},7:{},8:{},9:{}};var p=function(){function e(){o(this,e),this.defaults={},this.retrieveFunction=null,this.storeFunction=null,this.changeObserver=new a.Dependency}return e.prototype.updateElementWLPresetData=function(){function e(e){var t=cornerstone.getElementData(e,"wlPreset"),n=cornerstone.getEnabledElement(e),o=n.viewport,r=n.image,i=o.voi,a=i.windowCenter,s=i.windowWidth,u=void 0,m=void 0;if(s===r.windowWidth&&a===r.windowCenter)m=d;else{var p=c.viewer.wlPresets;for(var f in g.sanitizeForInObject(p)){var x=p[f];if(a===x.wc&&s===x.ww){u=x,m=u.id;break}}}if(t.name=m||l,t.ww=s,t.wc=a,t.name===l){var h=t.custom||(t.custom=Object.create(null));h.ww=s,h.wc=a}}return e}(),e.prototype.applyWLPreset=function(){function e(e,t){var n=c.viewer.wlPresets,o=cornerstone.getElementData(t,"wlPreset"),r=cornerstone.getViewport(t),a=n[e]||s.findWhere(n,{id:e});if(e===l&&o.custom)r.voi.windowWidth=o.custom.ww,r.voi.windowCenter=o.custom.wc;else if(a&&!s.isEmpty(a)&&a.id)e=a.id,r.voi.windowWidth=a.ww,r.voi.windowCenter=a.wc;else{var u=cornerstone.getEnabledElement(t);r.voi.windowWidth=u.image.windowWidth,r.voi.windowCenter=u.image.windowCenter,e=d}o.name=e,o.ww=r.voi.windowWidth,o.wc=r.voi.windowCenter,cornerstone.setViewport(t,r),c.log.info("WLPresets::Applying WL Preset: "+e),i.set("OHIFWlPresetApplied",e)}return e}(),e.prototype.store=function(){function e(e){var t=this;return new x(function(n,o){t.storeFunction?t.storeFunction(e).then(n).catch(o):r.userId()?c.user.setData(m,e).then(n).catch(o):(i.setPersistent(m,e),n())}).then(function(){return t.setOHIFWLPresets(e)})}return e}(),e.prototype.retrieve=function(){function e(){var e=this;return new x(function(t,n){if(e.retrieveFunction)e.retrieveFunction().then(t).catch(n);else if(c.user)try{t(c.user.getData(m))}catch(e){n(e)}else t(i.get(m))})}return e}(),e.prototype.load=function(){function e(){var e=this;return new x(function(t,n){e.retrieve().then(function(t){t?e.setOHIFWLPresets(t):e.loadDefaults()}).catch(e.loadDefaults)})}return e}(),e.prototype.applyWLPresetToActiveElement=function(){function e(e){var t=u.getActiveViewportElement();t&&this.applyWLPreset(e,t)}return e}(),e.prototype.setOHIFWLPresets=function(){function e(e){var t=Object.prototype.hasOwnProperty,n=Object.create(null);for(var o in g.sanitizeForInObject(e))t.call(e,o)&&(n[o]=e[o]);c.viewer.wlPresets=n,this.changeObserver.changed()}return e}(),e.prototype.loadDefaults=function(){function e(){this.setOHIFWLPresets(c.viewer.defaultWLPresets)}return e}(),e.prototype.resetDefaults=function(){function e(){return this.store(c.viewer.defaultWLPresets)}return e}(),e}(),f=new p;r.startup(function(){f.load()})}],"annotateTextUtils.js":["./viewportUtils",function(e,t,n){n.export({annotateTextUtils:function(){return s}});var o;n.import("./viewportUtils",{viewportUtils:function(e){o=e}});var i=function e(t){var n=function e(t){13!==t.which&&27!==t.which||i()},i=function e(){a.get(0).close(),t(s.val()),s.val("");var n=o.getActiveViewportElement();r(n).focus()},a=r("#annotationDialog");if(a.get(0).open!==!0){var s=r(".annotationTextInput");s.focus(),a.get(0).showModal();var c=a.find(".annotationDialogConfirm");c.off("click"),c.on("click",function(){i()}),a.off("keydown"),a.on("keydown",n)}},a=function e(t,n,i){var a=r("#relabelAnnotationDialog");if(a.get(0).open!==!0){D._globalHelpers.isTouchDevice()?a.css({top:0,left:0,right:0,bottom:0,margin:"auto"}):a.css({top:n.currentPoints.page.y-a.outerHeight()-20,left:n.currentPoints.page.x-a.outerWidth()/2});var s=a.find(".annotationTextInput"),c=a.find(".relabelConfirm"),u=a.find(".relabelRemove");s.val(t.text),s.focus(),a.get(0).showModal(),c.off("click"),c.on("click",function(){a.get(0).close(),i(t,s.val())}),u.off("click"),u.on("click",function(){a.get(0).close(),i(t,void 0,!0)}),a.off("keydown"),a.on("keydown",l);var l=function e(t){13===t.which&&d()},d=function e(){a.get(0).close(),i(t,s.val()),s.val("");var n=o.getActiveViewportElement();r(n).focus()}}},s={getTextCallback:i,changeTextCallback:a}}],"createStacks.js":["./classes/ImageSet","./isImage",function(e,t,n){n.export({createStacks:function(){return c}});var o;n.import("./classes/ImageSet",{ImageSet:function(e){o=e}});var r;n.import("./isImage",{isImage:function(e){r=e}});var i=function e(t){return t.getRawValue("x00280008")>1},a=function e(t,n){var r=n[0],a=new o(n),s=t.getData();return a.setAttributes({displaySetInstanceUid:a.uid,seriesDate:s.seriesDate,seriesTime:s.seriesTime,seriesInstanceUid:t.getSeriesInstanceUID(),seriesNumber:r.getRawValue("x00200011"),seriesDescription:r.getRawValue("x0008103e"),numImageFrames:n.length,frameRate:r.getRawValue("x00181063"),modality:r.getRawValue("x00080060"),isMultiFrame:i(r)}),a.sortBy(function(e,t){return(parseInt(e.getRawValue("x00200013",0))||0)-(parseInt(t.getRawValue("x00200013",0))||0)}),a.setAttribute("instanceNumber",a.getImage(0).getRawValue("x00200013")),a},s=function e(t){return"CR"===t||"MG"===t||"DX"===t},c=function e(t){var n=[];return t&&t.getSeriesCount()?(t.forEachSeries(function(e){if(e.getInstanceCount()){var o=[];if(e.forEachInstance(function(c){if(r(c.getRawValue("x00080016"))||c.getRawValue("x00280010")){var u=void 0;i(c)?(u=a(e,[c]),u.setAttributes({isClip:!0,studyInstanceUid:t.getStudyInstanceUID(),numImageFrames:c.getRawValue("x00280008"),instanceNumber:c.getRawValue("x00200013"),acquisitionDatetime:c.getRawValue("x0008002a")}),n.push(u)):s(c.modality)?(u=a(e,[c]),u.setAttributes({studyInstanceUid:t.getStudyInstanceUID(),instanceNumber:c.getRawValue("x00200013"),acquisitionDatetime:c.getRawValue("x0008002a")}),n.push(u)):o.push(c)}}),o.length){var c=a(e,o);c.setAttribute("studyInstanceUid",t.getStudyInstanceUID()),n.push(c)}}}),n):n}}],"crosshairsSynchronizers.js":function(e,t,n){n.export({crosshairsSynchronizers:function(){return o}});var o={synchronizers:{}}},"debugReactivity.js":["meteor/meteor",function(e,t,n){var o;n.import("meteor/meteor",{Meteor:function(e){o=e}}),o.startup(function(){var e=!1;if(e===!0){var t=function e(){Object.keys(k).forEach(function(e){if(!(e.indexOf("_")>-1)){var t=k[e],n=t.rendered,o=0;t.rendered=function(){console.log(e,"render count: ",++o),n&&n.apply(this,arguments)}}})};o.autorun(function(e){e.onInvalidate(function(){console.trace()})});var n=o.Collection.prototype.find;o.Collection.prototype.find=function(){var e=n.apply(this,arguments),t=this._name||this._debugName;return e.observe({added:function(){function e(e){console.log(t,"added",e)}return e}(),changed:function(){function e(e){console.log(t,"changed",e)}return e}(),removed:function(){function e(e){console.log(t,"removed",e)}return e}()}),e},t()}})}],"dialogUtils.js":["meteor/blaze","meteor/templating","meteor/jquery","./setFocusToActiveViewport",function(e,t,n){n.export({dialogUtils:function(){return l}});var o;n.import("meteor/blaze",{Blaze:function(e){o=e}});var r;n.import("meteor/templating",{Template:function(e){r=e}});var i;n.import("meteor/jquery",{$:function(e){i=e}});var a;n.import("./setFocusToActiveViewport",{setFocusToActiveViewport:function(e){a=e}});var s=void 0,c=function e(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t&&"function"==typeof s&&s(),i("#confirmDeleteDialog").css("display","none"),i(".removableBackdrop").remove(),s=void 0,a()},u=function e(t,n){n=n||{},o.renderWithData(r.removableBackdrop,n,document.body);var a=i("#confirmDeleteDialog");a.remove();var u=document.getElementById("viewer");o.renderWithData(r.confirmDeleteDialog,n,u),i(".removableBackdrop").one("mousedown touchstart",function(){c(!1)}),a=i("#confirmDeleteDialog"),a.css("display","block"),a.focus(),t&&"function"==typeof t&&(s=t)},l={showConfirmDialog:u,closeHandler:c}}],"displayReferenceLines.js":["meteor/ohif:core",function(e,t,n){function o(e){var t=cornerstone.getEnabledElement(e);if(!t||!t.image)return void i.log.info("displayReferenceLines enabled element is undefined or it's image is not rendered");var n=t.image.imageId,o=cornerstoneTools.metaData.get("imagePlane",n);return cornerstoneTools.referenceLines.tool.disable(e),i.viewer.refLinesEnabled&&o&&o.frameOfReferenceUID?(i.log.info("displayReferenceLines for image with id: "+n),void r(".imageViewerViewport").not(e).each(function(e,t){var n=void 0;if(r(t).find("canvas").length){try{var o=cornerstone.getEnabledElement(t);n=o.image.imageId}catch(e){return}if(!n)return;cornerstoneTools.referenceLines.tool.enable(t,i.viewer.updateImageSynchronizer)}})):void i.log.info("displayReferenceLines refLinesEnabled is not enabled, no imagePlane or no frameOfReferenceUID")}n.export({displayReferenceLines:function(){return o}});var i;n.import("meteor/ohif:core",{OHIF:function(e){i=e}})}],"getElementIfNotEmpty.js":["meteor/jquery",function(e,t,n){function o(e){var t=r(".imageViewerViewport"),n=t.get(e),o=t.eq(e).find("canvas");if(n&&!r(n).hasClass("empty")&&0!==o.length){try{var i=cornerstone.getEnabledElement(n)}catch(e){return}return n}}n.export({getElementIfNotEmpty:function(){return o}});var r;n.import("meteor/jquery",{$:function(e){r=e}})}],"getFrameOfReferenceUID.js":function(e,t,n){function o(e){var t;try{t=cornerstone.getEnabledElement(e)}catch(e){return}if(t&&t.image){var n=t.image.imageId,o=cornerstoneTools.metaData.get("imagePlane",n);if(o&&o.frameOfReferenceUID)return o.frameOfReferenceUID}}n.export({getFrameOfReferenceUID:function(){return o}})},"getImageId.js":["./getWADORSImageId",function(e,t,n){function o(e,t,n){var o=new RegExp("([?&])"+t+"=.*?(&|$)","i"),r=e.indexOf("?")!==-1?"&":"?";return e.match(o)?e.replace(o,"$1"+t+"="+n+"$2"):e+r+t+"="+n}function r(e,t,n){if(e){if(e.url)return void 0!==t&&(e.url=o(e.url,"frame",t)),e.url;var r=n?"thumbnailRendering":"imageRendering";if(e[r]&&"wadouri"!==e[r]&&e.wadorsuri)return i(e,t,n);var a="dicomweb:"+e.wadouri;return void 0!==t&&(a+="&frame="+t),a}}n.export({getImageId:function(){return r}});var i;n.import("./getWADORSImageId",{getWADORSImageId:function(e){i=e}})}],"getStackDataIfNotEmpty.js":["./getElementIfNotEmpty.js",function(e,t,n){function o(e){var t=r(e);if(t){var n=cornerstoneTools.getToolState(t,"stack");if(n&&n.data&&n.data.length){var o=n.data[0];if(o)return o}}}n.export({getStackDataIfNotEmpty:function(){return o}});var r;n.import("./getElementIfNotEmpty.js",{getElementIfNotEmpty:function(e){r=e}})}],"getWADORSImageId.js":["meteor/ohif:core","./getWADORSImageUrl",function(e,t,n){function o(e,t){var n=i(e,t);if(n){var o="wadors:"+n;return r.log.info("WADO-RS ImageID: "+o),o}}n.export({getWADORSImageId:function(){return o}});var r;n.import("meteor/ohif:core",{OHIF:function(e){r=e}});var i;n.import("./getWADORSImageUrl",{getWADORSImageUrl:function(e){i=e}})}],"getWADORSImageUrl.js":function(e,t,n){function o(e,t){var n=e.wadorsuri;if(n)return t=(t||0)+1,n=n.replace(/(%2Fframes%2F)(\d+)/,"$1"+t)}n.export({getWADORSImageUrl:function(){return o}})},"hotkeyUtils.js":["meteor/meteor","meteor/session","meteor/jquery","meteor/underscore","meteor/ohif:core","./toolManager","./switchToImageRelative","./switchToImageByIndex","./viewportUtils","./panelNavigation","./WLPresets",function(e,t,n){function o(e){l.viewer.refLinesEnabled=e}function r(e){l.viewer.hotkeys=e}function i(e){var t=e||l.viewer.hotkeys;l.hotkeys.set("viewer",t,!0),l.context.set("viewer")}n.export({hotkeyUtils:function(){return h}});var a;n.import("meteor/meteor",{Meteor:function(e){a=e}});var s;n.import("meteor/session",{Session:function(e){s=e}});var c;n.import("meteor/jquery",{$:function(e){c=e}});var u;n.import("meteor/underscore",{_:function(e){u=e}});var l;n.import("meteor/ohif:core",{OHIF:function(e){l=e}});var d;n.import("./toolManager",{toolManager:function(e){d=e}});var m;n.import("./switchToImageRelative",{switchToImageRelative:function(e){m=e}});var p;n.import("./switchToImageByIndex",{switchToImageByIndex:function(e){p=e}});var f;n.import("./viewportUtils",{viewportUtils:function(e){f=e}});var g;n.import("./panelNavigation",{panelNavigation:function(e){g=e}});var x;n.import("./WLPresets",{WLPresets:function(e){x=e}}),a.startup(function(){l.viewer.loadIndicatorDelay=200,l.viewer.defaultTool="wwwc",l.viewer.refLinesEnabled=!0,l.viewer.isPlaying={},l.viewer.cine={framesPerSecond:24,loop:!0},l.viewer.defaultHotkeys={defaultTool:"ESC",zoom:"Z",wwwc:"W",pan:"P",angle:"A",stackScroll:"S",magnify:"M",length:"",annotate:"",dragProbe:"",
ellipticalRoi:"",rectangleRoi:"",spine:"",flipH:"H",flipV:"V",rotateR:"R",rotateL:"L",invert:"I",zoomIn:"",zoomOut:"",zoomToFit:"",resetViewport:"",clearTools:"",scrollDown:"DOWN",scrollUp:"UP",scrollLastImage:"",scrollFirstImage:"",previousDisplaySet:"PAGEUP",nextDisplaySet:"PAGEDOWN",nextPanel:"RIGHT",previousPanel:"LEFT",toggleOverlayTags:"SHIFT",toggleCinePlay:"SPACE",toggleCineDialog:"",WLPreset0:"1",WLPreset1:"2",WLPreset2:"3",WLPreset3:"4",WLPreset4:"5",WLPreset5:"6",WLPreset6:"7",WLPreset7:"8",WLPreset8:"9",WLPreset9:"0"},l.viewer.hotkeys=l.viewer.defaultHotkeys;var e="viewer";l.commands.createContext(e);var t=function e(){var t=s.get("activeViewport")||0;return c(".imageViewerViewport").eq(t).hasClass("empty")},n=function t(n){return u.each(n,function(t,n){l.commands.register(e,n,{name:t,action:d.setActiveTool,params:n})})};l.commands.register(e,"defaultTool",{name:"Default Tool",action:function(){function e(){return d.setActiveTool(d.getDefaultTool())}return e}()}),n({wwwc:"Window W/L",zoom:"Zoom",angle:"Angle Measurement",dragProbe:"Pixel Probe",ellipticalRoi:"Elliptical Probe",rectangleRoi:"Rectangle",magnify:"Magnify",annotate:"Annotate",stackScroll:"Scroll Stack",pan:"Pan",length:"Length Measurement",spine:"Spine Labels",wwwcRegion:"W/L by Region"});var o=function n(o){return u.each(o,function(n,o){l.commands.register(e,o,{name:n,action:f[o],disabled:t})})};o({zoomIn:"Zoom In",zoomOut:"Zoom Out",zoomToFit:"Zoom to Fit",invert:"Invert",flipH:"Flip Horizontally",flipV:"Flip Vertically",rotateR:"Rotate Right",rotateL:"Rotate Left",resetViewport:"Reset",clearTools:"Clear Tools"});for(var r=function e(t){return x.applyWLPresetToActiveElement(t)},i=0;i<10;i++)l.commands.register(e,"WLPreset"+i,{name:"W/L Preset "+(i+1),action:r,params:i});var a=function e(t){return!!l.viewerbase.layoutManager&&l.viewerbase.layoutManager.canMoveDisplaySets(t)};l.commands.set(e,{scrollDown:{name:"Scroll Down",action:function(){function e(){return!t()&&m(1)}return e}()},scrollUp:{name:"Scroll Up",action:function(){function e(){return!t()&&m(-1)}return e}()},scrollFirstImage:{name:"Scroll to First Image",action:function(){function e(){return!t()&&p(0)}return e}()},scrollLastImage:{name:"Scroll to Last Image",action:function(){function e(){return!t()&&p(-1)}return e}()},previousDisplaySet:{name:"Previous Series",action:function(){function e(){return l.viewerbase.layoutManager.moveDisplaySets(!1)}return e}(),disabled:function(){function e(){return!a(!1)}return e}()},nextDisplaySet:{name:"Next Series",action:function(){function e(){return l.viewerbase.layoutManager.moveDisplaySets(!0)}return e}(),disabled:function(){function e(){return!a(!0)}return e}()},nextPanel:{name:"Next Panel",action:function(){function e(){return g.loadNextActivePanel()}return e}()},previousPanel:{name:"Previous Panel",action:function(){function e(){return g.loadPreviousActivePanel()}return e}()}},!0),l.commands.set(e,{toggleOverlayTags:{name:"Toggle Image Annotations",action:function(){function e(){var e=c(".imageViewerViewportOverlay .dicomTag");e.toggle("none"===e.eq(0).css("display"))}return e}()},toggleCinePlay:{name:"Play/Pause Cine",action:f.toggleCinePlay,disabled:l.viewerbase.viewportUtils.hasMultipleFrames},toggleCineDialog:{name:"Show/Hide Cine Controls",action:f.toggleCineDialog,disabled:l.viewerbase.viewportUtils.hasMultipleFrames}},!0),l.viewer.hotkeyFunctions={},l.viewer.loadedSeriesData={},h.enableHotkeys()}),c.fn.reverse=[].reverse;var h={setOHIFRefLines:o,setOHIFHotkeys:r,enableHotkeys:i}}],"imageViewerViewportData.js":function(e,t,n){n.export({imageViewerViewportData:function(){return o}});var o={callbacks:{},extendData:function(){function e(){}return e}()}},"instanceClassSpecificViewport.js":function(e,t,n){n.export({getInstanceClassDefaultViewport:function(){return r},setInstanceClassDefaultViewportFunction:function(){return i}});var o={},r=function e(t,n,r){var i=t.sopClassUid;if(o[i])return o[i](t,n,r)},i=function e(t,n){o[t]=n}},"isImage.js":["./sopClassDictionary",function(e,t,n){function o(e){return e===r.ComputedRadiographyImageStorage||e===r.DigitalXRayImageStorageForPresentation||e===r.DigitalXRayImageStorageForProcessing||e===r.DigitalMammographyXRayImageStorageForPresentation||e===r.DigitalMammographyXRayImageStorageForProcessing||e===r.DigitalIntraOralXRayImageStorageForPresentation||e===r.DigitalIntraOralXRayImageStorageForProcessing||e===r.CTImageStorage||e===r.EnhancedCTImageStorage||e===r.LegacyConvertedEnhancedCTImageStorage||e===r.UltrasoundMultiframeImageStorage||e===r.MRImageStorage||e===r.EnhancedMRImageStorage||e===r.EnhancedMRColorImageStorage||e===r.LegacyConvertedEnhancedMRImageStorage||e===r.UltrasoundImageStorage||e===r.SecondaryCaptureImageStorage||e===r.MultiframeSingleBitSecondaryCaptureImageStorage||e===r.MultiframeGrayscaleByteSecondaryCaptureImageStorage||e===r.MultiframeGrayscaleWordSecondaryCaptureImageStorage||e===r.MultiframeTrueColorSecondaryCaptureImageStorage||e===r.XRayAngiographicImageStorage||e===r.EnhancedXAImageStorage||e===r.XRayRadiofluoroscopicImageStorage||e===r.EnhancedXRFImageStorage||e===r.XRay3DAngiographicImageStorage||e===r.XRay3DCraniofacialImageStorage||e===r.BreastTomosynthesisImageStorage||e===r.BreastProjectionXRayImageStorageForPresentation||e===r.BreastProjectionXRayImageStorageForProcessing||e===r.IntravascularOpticalCoherenceTomographyImageStorageForPresentation||e===r.IntravascularOpticalCoherenceTomographyImageStorageForProcessing||e===r.NuclearMedicineImageStorage||e===r.VLEndoscopicImageStorage||e===r.VideoEndoscopicImageStorage||e===r.VLMicroscopicImageStorage||e===r.VideoMicroscopicImageStorage||e===r.VLSlideCoordinatesMicroscopicImageStorage||e===r.VLPhotographicImageStorage||e===r.VideoPhotographicImageStorage||e===r.OphthalmicPhotography8BitImageStorage||e===r.OphthalmicPhotography16BitImageStorage||e===r.OphthalmicTomographyImageStorage||e===r.VLWholeSlideMicroscopyImageStorage||e===r.PositronEmissionTomographyImageStorage||e===r.EnhancedPETImageStorage||e===r.LegacyConvertedEnhancedPETImageStorage||e===r.RTImageStorage}n.export({isImage:function(){return o}});var r;n.import("./sopClassDictionary",{sopClassDictionary:function(e){r=e}})}],"panelNavigation.js":["meteor/session","meteor/jquery","meteor/ohif:core","./setActiveViewport",function(e,t,n){n.export({panelNavigation:function(){return u}});var o;n.import("meteor/session",{Session:function(e){o=e}});var r;n.import("meteor/jquery",{$:function(e){r=e}});var i;n.import("meteor/ohif:core",{OHIF:function(e){i=e}});var a;n.import("./setActiveViewport",{setActiveViewport:function(e){a=e}});var s=function e(){i.log.info("nextActivePanel");var t=o.get("activeViewport");t--;var n=r(".imageViewerViewport"),s=n.length;t<0&&(t=s-1);var c=n.get(t);c&&a(c)},c=function e(){i.log.info("nextActivePanel");var t=o.get("activeViewport");t++;var n=r(".imageViewerViewport"),s=n.length;t>=s&&(t=0);var c=n.get(t);c&&a(c)},u={loadPreviousActivePanel:s,loadNextActivePanel:c}}],"prepareViewerData.js":["meteor/ohif:core",function(e,t,n){n.export({prepareViewerData:function(){return r}});var o;n.import("meteor/ohif:core",{OHIF:function(e){o=e}});var r=function e(t){var n=t.studyInstanceUids,r=t.timepointId,a=t.timepointsFilter,s=void 0===a?{}:a;cornerstoneTools.globalImageIdSpecificToolStateManager=cornerstoneTools.newImageIdSpecificToolStateManager();var c=new x(function(e,t){var a=function n(r){o.studylist.retrieveStudiesMetadata(r.studyInstanceUids).then(function(t){t.forEach(function(e){var t=o.studylist.collections.Studies.findOne({studyInstanceUid:e.studyInstanceUid});t&&Object.assign(e,t)}),e({studies:t,viewerData:r})}).catch(t)};if(n&&n.length){var c={studyInstanceUids:n};a(c)}else o.studylist.timepointApi.retrieveTimepoints(s).then(function(){var e=i(r);a(e)}).catch(t)});return c},i=function e(t){var n=o.studylist.timepointApi.timepoints.findOne({timepointId:t});if(!n)throw new Error("Unable to find a time point with the given ID");var r=a(n);if(!r.studyInstanceUids)throw new Error("No studies found that are related to this timepoint");return Object.assign(r,{currentTimepointId:t})},a=function e(t){var n=t.studyInstanceUids;if(s(t))return{studyInstanceUids:n,timepointIds:[t.timepointId]};var r=o.studylist.timepointApi.timepoints,i=r.findOne({timepointType:"baseline",patientId:t.patientId,latestDate:{$lte:t.latestDate}}),a=[];return i?(n=n.concat(i.studyInstanceUids),a.push(i.timepointId)):o.log.warn("No Baseline found while opening a Follow-up Timepoint"),a.push(t.timepointId),{studyInstanceUids:n,timepointIds:a}},s=function e(t){return"baseline"===t.timepointType}}],"renderViewer.js":["meteor/ohif:core",function(e,t,n){n.export({renderViewer:function(){return r}});var o;n.import("meteor/ohif:core",{OHIF:function(e){o=e}});var r=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"app",i=o.viewerbase.prepareViewerData(n);o.ui.showDialog("dialogLoading",{promise:i}),i.then(function(e){var n=e.studies,i=e.viewerData;o.viewer.data=i,t.render(r,{data:{template:"viewer",studies:n}})})}}],"setActiveViewport.js":["meteor/session","meteor/jquery","meteor/random","meteor/ohif:core","./classes/StudyPrefetcher","./displayReferenceLines",function(e,t,n){function o(e){if(!e)return void s.log.info("setActiveViewport element does not exist");var t=i(".imageViewerViewport"),n=t.index(e),o=i(e);s.log.info("setActiveViewport setting viewport index: "+n),o.parents(".viewportContainer").hasClass("active")||o.trigger("OHIFBeforeActivateViewport"),r.set("activeViewport",n);var l=a.id();if(r.set("viewportActivated",l),r.set("LayoutManagerUpdated",l),i("#imageViewerViewports .viewportContainer").removeClass("active"),o.parents(".viewportContainer").addClass("active"),o.find("canvas").length){var d=o.get(0);u(d),c.getInstance().prefetch(),s.viewer.stackImagePositionOffsetSynchronizer&&s.viewer.stackImagePositionOffsetSynchronizer.update()}o.triggerHandler("focus"),o.trigger("OHIFAfterActivateViewport")}n.export({setActiveViewport:function(){return o}});var r;n.import("meteor/session",{Session:function(e){r=e}});var i;n.import("meteor/jquery",{$:function(e){i=e}});var a;n.import("meteor/random",{Random:function(e){a=e}});var s;n.import("meteor/ohif:core",{OHIF:function(e){s=e}});var c;n.import("./classes/StudyPrefetcher",{StudyPrefetcher:function(e){c=e}});var u;n.import("./displayReferenceLines",{displayReferenceLines:function(e){u=e}})}],"setFocusToActiveViewport.js":["meteor/session","meteor/jquery",function(e,t,n){n.export({setFocusToActiveViewport:function(){return i}});var o;n.import("meteor/session",{Session:function(e){o=e}});var r;n.import("meteor/jquery",{$:function(e){r=e}});var i=function e(){var t=r(".imageViewerViewport"),n=o.get("activeViewport"),i=t.eq(n);i.focus()}}],"sopClassDictionary.js":function(e,t,n){n.export({sopClassDictionary:function(){return o}});var o={ComputedRadiographyImageStorage:"1.2.840.10008.5.1.4.1.1.1",DigitalXRayImageStorageForPresentation:"1.2.840.10008.5.1.4.1.1.1.1",DigitalXRayImageStorageForProcessing:"1.2.840.10008.5.1.4.1.1.1.1.1",DigitalMammographyXRayImageStorageForPresentation:"1.2.840.10008.5.1.4.1.1.1.2",DigitalMammographyXRayImageStorageForProcessing:"1.2.840.10008.5.1.4.1.1.1.2.1",DigitalIntraOralXRayImageStorageForPresentation:"1.2.840.10008.5.1.4.1.1.1.3",DigitalIntraOralXRayImageStorageForProcessing:"1.2.840.10008.5.1.4.1.1.1.3.1",CTImageStorage:"1.2.840.10008.5.1.4.1.1.2",EnhancedCTImageStorage:"1.2.840.10008.5.1.4.1.1.2.1",LegacyConvertedEnhancedCTImageStorage:"1.2.840.10008.5.1.4.1.1.2.2",UltrasoundMultiframeImageStorage:"1.2.840.10008.5.1.4.1.1.3.1",MRImageStorage:"1.2.840.10008.5.1.4.1.1.4",EnhancedMRImageStorage:"1.2.840.10008.5.1.4.1.1.4.1",MRSpectroscopyStorage:"1.2.840.10008.5.1.4.1.1.4.2",EnhancedMRColorImageStorage:"1.2.840.10008.5.1.4.1.1.4.3",LegacyConvertedEnhancedMRImageStorage:"1.2.840.10008.5.1.4.1.1.4.4",UltrasoundImageStorage:"1.2.840.10008.5.1.4.1.1.6.1",EnhancedUSVolumeStorage:"1.2.840.10008.5.1.4.1.1.6.2",SecondaryCaptureImageStorage:"1.2.840.10008.5.1.4.1.1.7",MultiframeSingleBitSecondaryCaptureImageStorage:"1.2.840.10008.5.1.4.1.1.7.1",MultiframeGrayscaleByteSecondaryCaptureImageStorage:"1.2.840.10008.5.1.4.1.1.7.2",MultiframeGrayscaleWordSecondaryCaptureImageStorage:"1.2.840.10008.5.1.4.1.1.7.3",MultiframeTrueColorSecondaryCaptureImageStorage:"1.2.840.10008.5.1.4.1.1.7.4",Sop12LeadECGWaveformStorage:"1.2.840.10008.5.1.4.1.1.9.1.1",GeneralECGWaveformStorage:"1.2.840.10008.5.1.4.1.1.9.1.2",AmbulatoryECGWaveformStorage:"1.2.840.10008.5.1.4.1.1.9.1.3",HemodynamicWaveformStorage:"1.2.840.10008.5.1.4.1.1.9.2.1",CardiacElectrophysiologyWaveformStorage:"1.2.840.10008.5.1.4.1.1.9.3.1",BasicVoiceAudioWaveformStorage:"1.2.840.10008.5.1.4.1.1.9.4.1",GeneralAudioWaveformStorage:"1.2.840.10008.5.1.4.1.1.9.4.2",ArterialPulseWaveformStorage:"1.2.840.10008.5.1.4.1.1.9.5.1",RespiratoryWaveformStorage:"1.2.840.10008.5.1.4.1.1.9.6.1",GrayscaleSoftcopyPresentationStateStorage:"1.2.840.10008.5.1.4.1.1.11.1",ColorSoftcopyPresentationStateStorage:"1.2.840.10008.5.1.4.1.1.11.2",PseudoColorSoftcopyPresentationStateStorage:"1.2.840.10008.5.1.4.1.1.11.3",BlendingSoftcopyPresentationStateStorage:"1.2.840.10008.5.1.4.1.1.11.4",XAXRFGrayscaleSoftcopyPresentationStateStorage:"1.2.840.10008.5.1.4.1.1.11.5",XRayAngiographicImageStorage:"1.2.840.10008.5.1.4.1.1.12.1",EnhancedXAImageStorage:"1.2.840.10008.5.1.4.1.1.12.1.1",XRayRadiofluoroscopicImageStorage:"1.2.840.10008.5.1.4.1.1.12.2",EnhancedXRFImageStorage:"1.2.840.10008.5.1.4.1.1.12.2.1",XRay3DAngiographicImageStorage:"1.2.840.10008.5.1.4.1.1.13.1.1",XRay3DCraniofacialImageStorage:"1.2.840.10008.5.1.4.1.1.13.1.2",BreastTomosynthesisImageStorage:"1.2.840.10008.5.1.4.1.1.13.1.3",BreastProjectionXRayImageStorageForPresentation:"1.2.840.10008.5.1.4.1.1.13.1.4",BreastProjectionXRayImageStorageForProcessing:"1.2.840.10008.5.1.4.1.1.13.1.5",IntravascularOpticalCoherenceTomographyImageStorageForPresentation:"1.2.840.10008.5.1.4.1.1.14.1",IntravascularOpticalCoherenceTomographyImageStorageForProcessing:"1.2.840.10008.5.1.4.1.1.14.2",NuclearMedicineImageStorage:"1.2.840.10008.5.1.4.1.1.20",RawDataStorage:"1.2.840.10008.5.1.4.1.1.66",SpatialRegistrationStorage:"1.2.840.10008.5.1.4.1.1.66.1",SpatialFiducialsStorage:"1.2.840.10008.5.1.4.1.1.66.2",DeformableSpatialRegistrationStorage:"1.2.840.10008.5.1.4.1.1.66.3",SegmentationStorage:"1.2.840.10008.5.1.4.1.1.66.4",SurfaceSegmentationStorage:"1.2.840.10008.5.1.4.1.1.66.5",RealWorldValueMappingStorage:"1.2.840.10008.5.1.4.1.1.67",SurfaceScanMeshStorage:"1.2.840.10008.5.1.4.1.1.68.1",SurfaceScanPointCloudStorage:"1.2.840.10008.5.1.4.1.1.68.2",VLEndoscopicImageStorage:"1.2.840.10008.5.1.4.1.1.77.1.1",VideoEndoscopicImageStorage:"1.2.840.10008.5.1.4.1.1.77.1.1.1",VLMicroscopicImageStorage:"1.2.840.10008.5.1.4.1.1.77.1.2",VideoMicroscopicImageStorage:"1.2.840.10008.5.1.4.1.1.77.1.2.1",VLSlideCoordinatesMicroscopicImageStorage:"1.2.840.10008.5.1.4.1.1.77.1.3",VLPhotographicImageStorage:"1.2.840.10008.5.1.4.1.1.77.1.4",VideoPhotographicImageStorage:"1.2.840.10008.5.1.4.1.1.77.1.4.1",OphthalmicPhotography8BitImageStorage:"1.2.840.10008.5.1.4.1.1.77.1.5.1",OphthalmicPhotography16BitImageStorage:"1.2.840.10008.5.1.4.1.1.77.1.5.2",StereometricRelationshipStorage:"1.2.840.10008.5.1.4.1.1.77.1.5.3",OphthalmicTomographyImageStorage:"1.2.840.10008.5.1.4.1.1.77.1.5.4",VLWholeSlideMicroscopyImageStorage:"1.2.840.10008.5.1.4.1.1.77.1.6",LensometryMeasurementsStorage:"1.2.840.10008.5.1.4.1.1.78.1",AutorefractionMeasurementsStorage:"1.2.840.10008.5.1.4.1.1.78.2",KeratometryMeasurementsStorage:"1.2.840.10008.5.1.4.1.1.78.3",SubjectiveRefractionMeasurementsStorage:"1.2.840.10008.5.1.4.1.1.78.4",VisualAcuityMeasurementsStorage:"1.2.840.10008.5.1.4.1.1.78.5",SpectaclePrescriptionReportStorage:"1.2.840.10008.5.1.4.1.1.78.6",OphthalmicAxialMeasurementsStorage:"1.2.840.10008.5.1.4.1.1.78.7",IntraocularLensCalculationsStorage:"1.2.840.10008.5.1.4.1.1.78.8",MacularGridThicknessandVolumeReport:"1.2.840.10008.5.1.4.1.1.79.1",OphthalmicVisualFieldStaticPerimetryMeasurementsStorage:"1.2.840.10008.5.1.4.1.1.80.1",OphthalmicThicknessMapStorage:"1.2.840.10008.5.1.4.1.1.81.1",CornealTopographyMapStorage:"1.2.840.10008.5.1.4.1.1.82.1",BasicTextSR:"1.2.840.10008.5.1.4.1.1.88.11",EnhancedSR:"1.2.840.10008.5.1.4.1.1.88.22",ComprehensiveSR:"1.2.840.10008.5.1.4.1.1.88.33",Comprehensive3DSR:"1.2.840.10008.5.1.4.1.1.88.34",ProcedureLog:"1.2.840.10008.5.1.4.1.1.88.40",MammographyCADSR:"1.2.840.10008.5.1.4.1.1.88.50",KeyObjectSelection:"1.2.840.10008.5.1.4.1.1.88.59",ChestCADSR:"1.2.840.10008.5.1.4.1.1.88.65",XRayRadiationDoseSR:"1.2.840.10008.5.1.4.1.1.88.67",RadiopharmaceuticalRadiationDoseSR:"1.2.840.10008.5.1.4.1.1.88.68",ColonCADSR:"1.2.840.10008.5.1.4.1.1.88.69",ImplantationPlanSRDocumentStorage:"1.2.840.10008.5.1.4.1.1.88.70",EncapsulatedPDFStorage:"1.2.840.10008.5.1.4.1.1.104.1",EncapsulatedCDAStorage:"1.2.840.10008.5.1.4.1.1.104.2",PositronEmissionTomographyImageStorage:"1.2.840.10008.5.1.4.1.1.128",EnhancedPETImageStorage:"1.2.840.10008.5.1.4.1.1.130",LegacyConvertedEnhancedPETImageStorage:"1.2.840.10008.5.1.4.1.1.128.1",BasicStructuredDisplayStorage:"1.2.840.10008.5.1.4.1.1.131",RTImageStorage:"1.2.840.10008.5.1.4.1.1.481.1",RTDoseStorage:"1.2.840.10008.5.1.4.1.1.481.2",RTStructureSetStorage:"1.2.840.10008.5.1.4.1.1.481.3",RTBeamsTreatmentRecordStorage:"1.2.840.10008.5.1.4.1.1.481.4",RTPlanStorage:"1.2.840.10008.5.1.4.1.1.481.5",RTBrachyTreatmentRecordStorage:"1.2.840.10008.5.1.4.1.1.481.6",RTTreatmentSummaryRecordStorage:"1.2.840.10008.5.1.4.1.1.481.7",RTIonPlanStorage:"1.2.840.10008.5.1.4.1.1.481.8",RTIonBeamsTreatmentRecordStorage:"1.2.840.10008.5.1.4.1.1.481.9",RTBeamsDeliveryInstructionStorage:"1.2.840.10008.5.1.4.34.7",GenericImplantTemplateStorage:"1.2.840.10008.5.1.4.43.1",ImplantAssemblyTemplateStorage:"1.2.840.10008.5.1.4.44.1",ImplantTemplateGroupStorage:"1.2.840.10008.5.1.4.45.1"}},"sortStudy.js":["./classes/OHIFError",function(e,t,n){function o(e){if(!e||!e.seriesList)throw new r("Insufficient study data was provided to sortStudy");e.seriesList.sort(function(e,t){return e.seriesNumber-t.seriesNumber}),e.seriesList.forEach(function(e){e.instances.sort(function(e,t){return e.instanceNumber-t.instanceNumber})})}n.export({sortStudy:function(){return o}});var r;n.import("./classes/OHIFError",{OHIFError:function(e){r=e}})}],"sortingManager.js":["./createStacks",function(e,t,n){n.export({sortingManager:function(){return i}});var o;n.import("./createStacks",{createStacks:function(e){o=e}});var r=function e(t,n,r){var i="function"!=typeof r?o:r;return i(t,n)},i={getDisplaySets:r}}],"switchToImageByIndex.js":["./viewportUtils",function(e,t,n){function o(e){var t=r.getActiveViewportElement();cornerstoneTools.scrollToIndex(t,e)}n.export({switchToImageByIndex:function(){return o}});var r;n.import("./viewportUtils",{viewportUtils:function(e){r=e}})}],"switchToImageRelative.js":["./viewportUtils",function(e,t,n){function o(e){var t=r.getActiveViewportElement();cornerstoneTools.scroll(t,e)}n.export({switchToImageRelative:function(){return o}});var r;n.import("./viewportUtils",{viewportUtils:function(e){r=e}})}],"textMarkerUtils.js":["meteor/blaze","./toolManager","./viewportUtils",function(e,t,n){n.export({textMarkerUtils:function(){return c}});var o;n.import("meteor/blaze",{Blaze:function(e){o=e}});var i;n.import("./toolManager",{toolManager:function(e){i=e}});var a;n.import("./viewportUtils",{viewportUtils:function(e){a=e}});var s=function e(t,n,s){var c=function e(t){13!==t.which&&27!==t.which||l()},u=function e(){if("spine"!==i.getActiveTool()){var t=a.getActiveViewportElement();cornerstoneTools.textMarker.deactivate(t,1)}},l=function e(){d.get(0).close(),s(t,m.val()),u();var n=a.getActiveViewportElement();r(n).focus()},d=r("#textMarkerRelabelDialog");o._globalHelpers.isTouchDevice()?(d.css({top:0,left:0,right:0,bottom:0,margin:"auto"}),d.find(".dialog.arrow").hide()):(d.css({top:n.currentPoints.page.y-d.outerHeight()-20,left:n.currentPoints.page.x-d.outerWidth()/2}),d.find(".dialog.arrow").show());var m=d.find(".relabelSelect"),p=d.find(".relabelConfirm"),f=d.find(".relabelRemove");f.off("click"),f.on("click",function(){d.get(0).close(),s(t,void 0,!0),u()}),d.get(0).showModal(),r(".relabelSelect").val(t.text).trigger("change"),p.off("click"),p.on("click",function(){l()}),d.off("keydown"),d.on("keydown",c)},c={changeTextCallback:s}}],"thumbnailDragHandlers.js":["meteor/jquery","meteor/ohif:core",function(e,t,n){n.export({thumbnailDragHandlers:function(){return u}});var o;n.import("meteor/jquery",{$:function(e){o=e}});var r;n.import("meteor/ohif:core",{OHIF:function(e){r=e}});var i=function e(t,n){var r=t.cloneNode(!0),i=o(r).find("canvas");return i.each(function(e,n){var r=n.getContext("2d"),i=o(t).find("canvas").get(e);r.drawImage(i,0,0)}),r.id=n,r.style.visibility="hidden",r},a=function e(t,n){t.originalEvent.preventDefault();var r=t.currentTarget,a=o(r),u="DragClone",l=i(r,u),d=o(l);d.addClass("imageThumbnailClone"),l.style.pointerEvents="none",document.body.appendChild(l);var m=void 0,p=void 0;"touchstart"===t.type?(m=t.originalEvent.touches[0].pageX,p=t.originalEvent.touches[0].pageY):!function(){m=t.pageX,p=t.pageY;var e={};e.mousemove=function(e){return s(e)},e.mouseup=function(t){return c(t,n,e)},o(document).on("mousemove",e.mousemove),o(document).on("mouseup",e.mouseup)}();var f=a.offset(),g=f.left,x=f.top,h={x:m-g,y:p-x};d.data("diff",h),d.css({left:m-h.x,position:"fixed",top:p-h.y,visibility:"hidden","z-index":1e5})},s=function e(t){var n=void 0,r=void 0;"touchmove"===t.type?(n=t.originalEvent.changedTouches[0].pageX,r=t.originalEvent.changedTouches[0].pageY):(n=t.pageX,r=t.pageY);var i=o("#DragClone"),a=i.data("diff");i.css({left:n-a.x,position:"fixed",top:r-a.y,visibility:"visible","z-index":1e5});var s=document.elementFromPoint(n,r);if(s){o(".imageViewerViewport canvas").removeClass("faded");var c=o(s).parents(".imageViewerViewport");c.length?(c.find("canvas").not(".magnifyTool").addClass("faded"),document.body.style.cursor="copy"):s.classList.contains("imageViewerViewport")&&s.classList.contains("empty")?document.body.style.cursor="copy":document.body.style.cursor="no-drop"}},c=function e(t,n,i){i&&(o(document).off("mousemove",i.mousemove),o(document).off("mouseup",i.mouseup)),document.body.style.cursor="auto";var a=o("#DragClone");if(a.length){var s=a.offset(),c=s.top,u=s.left,l=a.data("diff"),d=document.elementFromPoint(u+l.x,c+l.y);if(o(".imageThumbnailClone").remove(),o(".imageViewerViewport canvas").removeClass("faded"),d){d.classList.remove("faded");var m=void 0,p=o(d).closest(".imageViewerViewport");if(p.length)m=p.get(0);else{if(!d.classList.contains("imageViewerViewport")||!d.classList.contains("empty"))return!1;m=d}if(!n)return!1;var f=o(".imageViewerViewport").index(m);return r.viewerbase.layoutManager.rerenderViewportWithNewDisplaySet(f,n),!1}}},u={thumbnailDragEndHandler:c,thumbnailDragStartHandler:a,thumbnailDragHandler:s}}],"toolManager.js":["meteor/session","meteor/jquery","meteor/ohif:core","./getFrameOfReferenceUID","./updateCrosshairsSynchronizer","./crosshairsSynchronizers","./annotateTextUtils","./textMarkerUtils",function(t,n,o){o.export({toolManager:function(){return S}});var r;o.import("meteor/session",{Session:function(e){r=e}});var i;o.import("meteor/jquery",{$:function(e){i=e}});var a;o.import("meteor/ohif:core",{OHIF:function(e){a=e}});var s;o.import("./getFrameOfReferenceUID",{getFrameOfReferenceUID:function(e){s=e}});var c;o.import("./updateCrosshairsSynchronizer",{updateCrosshairsSynchronizer:function(e){c=e}});var u;o.import("./crosshairsSynchronizers",{crosshairsSynchronizers:function(e){u=e}});var l;o.import("./annotateTextUtils",{annotateTextUtils:function(e){l=e}});var d;o.import("./textMarkerUtils",{textMarkerUtils:function(e){d=e}});var m="wwwc",p=void 0,f=void 0,g={},x={zoomTouchPinch:{enabled:!0},panMultiTouch:{enabled:!0},stackScrollMultiTouch:{enabled:!0},doubleTapZoom:{enabled:!0}},h={activate:[],deactivate:["length","angle","annotate","ellipticalRoi","rectangleRoi","spine"],enable:[],disable:[],disabledToolButtons:[],shadowConfig:{shadow:!1,shadowColor:"#000000",shadowOffsetX:0,shadowOffsetY:0},textBoxConfig:{centering:{x:!0,y:!0}}},v=!1,S={init:function(){function t(){S.addTool("wwwc",{mouse:cornerstoneTools.wwwc,touch:cornerstoneTools.wwwcTouchDrag}),S.addTool("zoom",{mouse:cornerstoneTools.zoom,touch:cornerstoneTools.zoomTouchDrag}),S.addTool("wwwcRegion",{mouse:cornerstoneTools.wwwcRegion,touch:cornerstoneTools.wwwcRegionTouch}),S.addTool("dragProbe",{mouse:cornerstoneTools.dragProbe,touch:cornerstoneTools.dragProbeTouch}),S.addTool("pan",{mouse:cornerstoneTools.pan,touch:cornerstoneTools.panTouchDrag}),S.addTool("stackScroll",{mouse:cornerstoneTools.stackScroll,touch:cornerstoneTools.stackScrollTouchDrag}),S.addTool("length",{mouse:cornerstoneTools.length,touch:cornerstoneTools.lengthTouch}),S.addTool("angle",{mouse:cornerstoneTools.simpleAngle,touch:cornerstoneTools.simpleAngleTouch}),S.addTool("magnify",{mouse:cornerstoneTools.magnify,touch:cornerstoneTools.magnifyTouchDrag}),S.addTool("ellipticalRoi",{mouse:cornerstoneTools.ellipticalRoi,touch:cornerstoneTools.ellipticalRoiTouch}),S.addTool("rectangleRoi",{mouse:cornerstoneTools.rectangleRoi,touch:cornerstoneTools.rectangleRoiTouch}),S.addTool("annotate",{mouse:cornerstoneTools.arrowAnnotate,touch:cornerstoneTools.arrowAnnotateTouch}),S.addTool("rotate",{mouse:cornerstoneTools.rotate,touch:cornerstoneTools.rotateTouchDrag}),S.addTool("spine",{mouse:cornerstoneTools.textMarker,touch:cornerstoneTools.textMarkerTouch}),S.addTool("crosshairs",{mouse:cornerstoneTools.crosshairs,touch:cornerstoneTools.crosshairsTouch}),a.viewer.defaultTool&&(m=a.viewer.defaultTool),f=e.settings&&e.settings.public&&e.settings.public.defaultMouseButtonTools,m=f&&f.left||"wwwc",this.configureTools(),v=!0}return t}(),configureTools:function(){function e(){var e=cornerstoneTools,t=e.panMultiTouch,n=e.textStyle,o=e.toolStyle,r=e.toolColors,a=e.length,s=e.arrowAnnotate,c=e.zoom,u=e.ellipticalRoi,m=e.textMarker,p=e.magnify,f={testPointers:function(){function e(e){return e.numPointers>=3}return e}()};t.setConfiguration(f),n.setBackgroundColor("transparent");var g="Roboto, OpenSans, HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif";n.setFont("15px "+g),o.setToolWidth(2),r.setToolColor("rgb(255, 255, 0)"),r.setActiveColor("rgb(0, 255, 0)");var x=S.getToolDefaultStates().shadowConfig,h=a.getConfiguration(),v=u.getConfiguration();a.setConfiguration(Object.assign({},h,x,{drawHandlesOnHover:!0})),u.setConfiguration(Object.assign({},v,x));var y=i("#startFrom"),I=i("#ascending"),T={markers:["L5","L4","L3","L2","L1","T12","T11","T10","T9","T8","T7","T6","T5","T4","T3","T2","T1","C7","C6","C5","C4","C3","C2","C1"],current:y.val(),ascending:I.is(":checked"),loop:!0,changeTextCallback:d.changeTextCallback,shadow:x.shadow,shadowColor:x.shadowColor,shadowOffsetX:x.shadowOffsetX,shadowOffsetY:x.shadowOffsetY};m.setConfiguration(T);var b={getTextCallback:l.getTextCallback,changeTextCallback:l.changeTextCallback,drawHandles:!1,arrowFirst:!0};s.setConfiguration(b);var D={minScale:.05,maxScale:10};c.setConfiguration(D);var w={magnifySize:300,magnificationLevel:3};p.setConfiguration(w)}return e}(),getKeysByValue:function(){function e(e,t){return Object.keys(e).filter(function(n){return e[n]===t})}return e}(),configureLoadProcess:function(){function e(){var e=this;i(cornerstone).on("CornerstoneImageLoadProgress",function(t,n){var o=e.getKeysByValue(window.ViewportLoading,n.imageId);o.forEach(function(e){r.set("CornerstoneLoadProgress"+e,n.percentComplete)});var i=a.string.encodeId(n.imageId);r.set("CornerstoneThumbnailLoadProgress"+i,n.percentComplete)})}return e}(),setGestures:function(){function e(e){x=e}return e}(),getGestures:function(){function e(){return x}return e}(),addTool:function(){function e(e,t){g[e]=t}return e}(),getTools:function(){function e(){return g}return e}(),setToolDefaultStates:function(){function e(e){h=e}return e}(),getToolDefaultStates:function(){function e(){return h}return e}(),setActiveToolForElement:function(){function e(e,t){var n=i(t).find("canvas");if(!t.classList.contains("empty")&&n.length){g[p].mouse.deactivate(t,1),g[p].touch&&g[p].touch.deactivate(t),Object.keys(h).forEach(function(e){var n=h[e];n&&n.length&&"disabledToolButtons"!==e&&n.forEach(function(n){"deactivate"===e&&n===p||(g[n].mouse[e](t,"activate"===e||"deactivate"===e?1:void 0),g[n].touch[e](t))})});var o=cornerstoneTools.getToolState(t,"stack");if(o&&o.data&&o.data.length){var r=o.data[0].imageIds,a=f&&f.middle||"pan",l=cornerstoneTools[a],d=f&&f.right||"zoom",m=cornerstoneTools[d];l.deactivate(t),m.deactivate(t),cornerstoneTools.zoomWheel.deactivate(t),cornerstoneTools.stackScrollWheel.deactivate(t),cornerstoneTools.panMultiTouch.disable(t),cornerstoneTools.zoomTouchPinch.disable(t),cornerstoneTools.stackScrollMultiTouch.disable(t),cornerstoneTools.doubleTapZoom.disable(t),m.activate(t,4);var v=void 0;if(r.length>1?(cornerstoneTools.stackScrollWheel.activate(t),x.stackScrollMultiTouch.enabled===!0&&cornerstoneTools.stackScrollMultiTouch.activate(t),v={testPointers:function(){function e(e){return 2===e.numPointers}return e}()},cornerstoneTools.panMultiTouch.setConfiguration(v)):(cornerstoneTools.zoomWheel.activate(t),v={testPointers:function(){function e(e){return e.numPointers>=2}return e}()},cornerstoneTools.panMultiTouch.setConfiguration(v)),e===a)l.activate(t,3);else if("crosshairs"===e){l.activate(t,2);var S=s(t);if(S){c(S);var y=u.synchronizers[S];g[e].mouse.activate(t,1,y)}}else e===d?(l.activate(t,2),m.activate(t,5)):(l.activate(t,2),g[e].mouse.activate(t,1));g[e].touch&&g[e].touch.activate(t),x.zoomTouchPinch.enabled===!0&&cornerstoneTools.zoomTouchPinch.activate(t),x.panMultiTouch.enabled===!0&&cornerstoneTools.panMultiTouch.activate(t),x.doubleTapZoom.enabled===!0&&cornerstoneTools.doubleTapZoom.activate(t)}}}return e}(),setActiveTool:function(){function e(e,t){v||S.init();var n=document.getElementById("textMarkerOptionsDialog");n&&("spine"===e&&"spine"!==p&&"open"!==n.getAttribute("open")?n.show():"spine"!==p&&"open"===n.getAttribute("open")&&n.close()),i(".imageViewerButton").removeClass("active");var o=document.getElementById(e);o&&o.classList.add("active"),e||(e=m);var a=void 0;a=i(t&&t.length?t:".imageViewerViewport"),a.each(function(t,n){S.setActiveToolForElement(e,n)}),p=e,r.set("ToolManagerActiveTool",e)}return e}(),getActiveTool:function(){function e(){return v||S.init(),p||(p=m),p}return e}(),setDefaultTool:function(){function e(e){m=e}return e}(),getDefaultTool:function(){function e(){return m}return e}(),setConfigureTools:function(){function e(e){"function"==typeof e&&(this.configureTools=e)}return e}(),activateCommandButton:function(){function e(e){var t=r.get("ToolManagerActiveCommandButtons")||[];t.indexOf(e)===-1&&(t.push(e),r.set("ToolManagerActiveCommandButtons",t))}return e}(),deactivateCommandButton:function(){function e(e){var t=r.get("ToolManagerActiveCommandButtons")||[],n=t.indexOf(e);n!==-1&&(t.splice(n,1),r.set("ToolManagerActiveCommandButtons",t))}return e}()}}],"unloadHandlers.js":["meteor/ohif:core",function(e,t,n){n.export({unloadHandlers:function(){return r}});var o;n.import("meteor/ohif:core",{OHIF:function(e){o=e}});var r={beforeUnload:function(){function e(e){if(o.ui.unsavedChanges.probe("viewer.*")>0){var t="You have unsaved changes!";return e.returnValue=t,t}}return e}()}}],"updateAllViewports.js":["meteor/jquery",function(e,t,n){function o(){var e=r(".imageViewerViewport").not(".empty");e.each(function(e,t){cornerstone.updateImage(t)})}n.export({updateAllViewports:function(){return o}});var r;n.import("meteor/jquery",{$:function(e){r=e}})}],"updateCrosshairsSynchronizer.js":["meteor/jquery","./getFrameOfReferenceUID","./crosshairsSynchronizers",function(e,t,n){function o(e){var t=a.synchronizers[e];t?t.destroy():(a.synchronizers[e]=new cornerstoneTools.Synchronizer("CornerstoneNewImage",cornerstoneTools.updateImageSynchronizer),
t=a.synchronizers[e]),r(".imageViewerViewport").each(function(n,o){var r=i(o);e===r&&t.add(o)})}n.export({updateCrosshairsSynchronizer:function(){return o}});var r;n.import("meteor/jquery",{$:function(e){r=e}});var i;n.import("./getFrameOfReferenceUID",{getFrameOfReferenceUID:function(e){i=e}});var a;n.import("./crosshairsSynchronizers",{crosshairsSynchronizers:function(e){a=e}})}],"updateMetaDataManager.js":["meteor/underscore","./getWADORSImageId","./classes/metadata/WadoRsMetaDataBuilder",function(e,t,n){function o(e){var t=e.radiopharmaceuticalInfo;if("PT"===e.modality&&t)return(new s).addTag("00181072",t.radiopharmaceuticalStartTime).addTag("00181074",t.radionuclideTotalDose).addTag("00181075",t.radionuclideHalfLife).toJSON()}function r(e){e.seriesList.forEach(function(t){t.instances.forEach(function(n){if("wadors"===n.imageRendering||"wadors"===n.thumbnailRendering)for(var o=c(e,t,n),r=n.numberOfFrames||1,i=0;i<r;i++){var s=a(n,i);cornerstoneWADOImageLoader.wadors.metaDataManager.add(s,o)}})})}n.export({updateMetaDataManager:function(){return r}});var i;n.import("meteor/underscore",{_:function(e){i=e}});var a;n.import("./getWADORSImageId",{getWADORSImageId:function(e){a=e}});var s;n.import("./classes/metadata/WadoRsMetaDataBuilder",{WadoRsMetaDataBuilder:function(e){s=e}});var c=function e(t,n,r){return(new s).addTag("00080016",r.sopClassUid).addTag("00080018",r.sopInstanceUid).addTag("00080021",n.seriesDate).addTag("00080031",n.seriesTime).addTag("00080060",r.modality).addTag("00101010",t.patientAge).addTag("00101020",t.patientSize).addTag("00101030",t.patientWeight).addTag("00180050",r.sliceThickness).addTag("0020000e",n.seriesInstanceUid).addTag("00200011",n.seriesNumber).addTag("0020000d",t.studyInstanceUid).addTag("00200013",r.instanceNumber).addTag("00200032",r.imagePositionPatient,!0).addTag("00200037",r.imageOrientationPatient,!0).addTag("00200052",r.frameOfReferenceUID).addTag("00201041",r.sliceLocation).addTag("00280002",r.samplesPerPixel).addTag("00280004",r.photometricInterpretation).addTag("00280006",r.planarConfiguration).addTag("00280010",r.rows).addTag("00280011",r.columns).addTag("00280030",r.pixelSpacing,!0).addTag("00280034",r.pixelAspectRatio,!0).addTag("00280100",r.bitsAllocated).addTag("00280101",r.bitsStored).addTag("00280102",r.highBit).addTag("00280103",r.pixelRepresentation).addTag("00280106",r.smallestPixelValue).addTag("00280107",r.largestPixelValue).addTag("00281050",r.windowCenter,!0).addTag("00281051",r.windowWidth,!0).addTag("00281052",r.rescaleIntercept).addTag("00281053",r.rescaleSlope).addTag("00281054",r.rescaleType).addTag("00281101",r.redPaletteColorLookupTableDescriptor).addTag("00281102",r.greenPaletteColorLookupTableDescriptor).addTag("00281103",r.bluePaletteColorLookupTableDescriptor).addTag("00281201",r.redPaletteColorLookupTableData).addTag("00281202",r.greenPaletteColorLookupTableData).addTag("00281203",r.bluePaletteColorLookupTableData).addTag("00540016",o(r)).toJSON()}}],"updateOrientationMarkers.js":["meteor/jquery",function(e,t,n){function o(e,t){t||(t=cornerstone.getViewport(e));var n=cornerstone.getEnabledElement(e),o=cornerstoneTools.metaData.get("imagePlane",n.image.imageId);if(o&&o.rowCosines&&o.columnCosines){var i=cornerstoneTools.orientation.getOrientationString(o.rowCosines),a=cornerstoneTools.orientation.getOrientationString(o.columnCosines),s=cornerstoneTools.orientation.invertOrientationString(i),c=cornerstoneTools.orientation.invertOrientationString(a),u={top:c,left:s};t.vflip&&(u.top=cornerstoneTools.orientation.invertOrientationString(u.top)),t.hflip&&(u.left=cornerstoneTools.orientation.invertOrientationString(u.left));var l=r(e).siblings(".viewportOrientationMarkers"),d=l.find(".topMid"),m=l.find(".leftMid");90===t.rotation||t.rotation===-270?(d.text(u.left),m.text(cornerstoneTools.orientation.invertOrientationString(u.top))):t.rotation===-90||270===t.rotation?(d.text(cornerstoneTools.orientation.invertOrientationString(u.left)),m.text(u.top)):180===t.rotation||t.rotation===-180?(d.text(cornerstoneTools.orientation.invertOrientationString(u.top)),m.text(cornerstoneTools.orientation.invertOrientationString(u.left))):(d.text(u.top),m.text(u.left))}}n.export({updateOrientationMarkers:function(){return o}});var r;n.import("meteor/jquery",{$:function(e){r=e}})}],"viewportOverlayUtils.js":["./getElementIfNotEmpty",function(e,t,n){n.export({viewportOverlayUtils:function(){return d}});var o;n.import("./getElementIfNotEmpty",{getElementIfNotEmpty:function(e){o=e}});var r=function e(t){if(!this.imageId)return!1;var n=cornerstoneTools.metaData.get("patient",this.imageId);return n?n[t]:""},i=function e(t){if(!this.imageId)return!1;var n=cornerstoneTools.metaData.get("study",this.imageId);return n?n[t]:""},a=function e(t){if(!this.imageId)return!1;var n=cornerstoneTools.metaData.get("series",this.imageId);return n?n[t]:""},s=function e(t){if(!this.imageId)return!1;var n=cornerstoneTools.metaData.get("instance",this.imageId);return n?n[t]:""},c=function e(t){if(!this.imageId)return!1;var n=cornerstoneTools.metaData.get("tagDisplay",this.imageId);return n?n[t]:""},u=function e(t){var n=o(t);if(!n)return!1;var r=void 0;try{r=cornerstone.getEnabledElement(n)}catch(e){return!1}return!(!r||!r.image)&&r.image},l=function e(t,n){return t+" "+n},d={getPatient:r,getStudy:i,getSeries:a,getInstance:s,getTagDisplay:c,getImage:u,formatDateTime:l}}],"viewportUtils.js":["meteor/session","meteor/random","meteor/jquery","meteor/underscore","meteor/ohif:core","./updateOrientationMarkers","./instanceClassSpecificViewport",function(e,t,n){n.export({viewportUtils:function(){return O}});var o;n.import("meteor/session",{Session:function(e){o=e}});var r;n.import("meteor/random",{Random:function(e){r=e}});var i;n.import("meteor/jquery",{$:function(e){i=e}});var a;n.import("meteor/underscore",{_:function(e){a=e}});var s;n.import("meteor/ohif:core",{OHIF:function(e){s=e}});var c;n.import("./updateOrientationMarkers",{updateOrientationMarkers:function(e){c=e}});var u;n.import("./instanceClassSpecificViewport",{getInstanceClassDefaultViewport:function(e){u=e}});var l=function e(t){var n=void 0;try{n=cornerstone.getEnabledElement(t)}catch(e){s.log.warn(e)}return n},d=function e(){var t=o.get("activeViewport")||0;return i(".imageViewerViewport").get(t)},m=function e(){var t=d(),n=l(t);return n},p=function e(){var t=d();if(t){var n=cornerstone.getViewport(t),o=.15,r=10;n.scale=Math.min(n.scale+o,r),cornerstone.setViewport(t,n)}},f=function e(){var t=d();if(t){var n=cornerstone.getViewport(t),o=.15,r=.05;n.scale=Math.max(n.scale-o,r),cornerstone.setViewport(t,n)}},g=function e(){var t=d();t&&cornerstone.fitToWindow(t)},x=function e(){var t=d();if(t){var n=cornerstone.getViewport(t);n.rotation-=90,cornerstone.setViewport(t,n),c(t,n)}},h=function e(){var t=d();if(t){var n=cornerstone.getViewport(t);n.rotation+=90,cornerstone.setViewport(t,n),c(t,n)}},v=function e(){var t=d();if(t){var n=cornerstone.getViewport(t);n.invert=n.invert===!1,cornerstone.setViewport(t,n)}},S=function e(){var t=d(),n=cornerstone.getViewport(t);n.vflip=n.vflip===!1,cornerstone.setViewport(t,n),c(t,n)},y=function e(){var t=d(),n=cornerstone.getViewport(t);n.hflip=n.hflip===!1,cornerstone.setViewport(t,n),c(t,n)},I=function e(){var t=d(),n=cornerstone.getEnabledElement(t);if(n.fitToWindow===!1){var o=n.image.imageId,r=cornerstoneTools.metaData.get("instance",o);n.viewport=cornerstone.getDefaultViewport(n.canvas,n.image);var i=u(r,n,o);cornerstone.setViewport(t,i)}else cornerstone.reset(t)},T=function e(){var t=d(),n=cornerstoneTools.globalImageIdSpecificToolStateManager;n.clear(t),cornerstone.updateImage(t)},b=function e(){var t=s.viewer.stackImagePositionOffsetSynchronizer;t&&(t.isActive()?t.deactivate():t.activate())},D=function e(t){var n=i(t);if(n.is("dialog"))t.hasAttribute("open")?(R(),t.close()):t.show();else{var a=n.hasClass("dialog-open");n.toggleClass("dialog-closed",a),n.toggleClass("dialog-open",!a)}o.set("UpdateCINE",r.id())},w=function e(){var t=d();P()?cornerstoneTools.stopClip(t):cornerstoneTools.playClip(t),o.set("UpdateCINE",r.id())},C=function e(){var t=document.getElementById("cineDialog");D(t)},P=function e(){o.get("UpdateCINE"),o.get("LayoutManagerUpdated");var t=d();if(t&&i(t).find("canvas").length){var n=cornerstoneTools.getToolState(t,"playClip");if(!n)return!1;var r=n.data[0];return!!r&&!a.isUndefined(r.intervalId)}},k=function e(){o.get("activeViewport"),o.get("LayoutManagerUpdated");var t=d();if(!t||!i(t).find("canvas").length)return!0;var n=cornerstoneTools.getToolState(t,"stack");if(!n||!n.data||!n.data.length)return!0;var r=n.data[0],a=r.imageIds&&r.imageIds.length?r.imageIds.length:1;return 1===a},R=function e(){var t=i(".imageViewerViewport").not(".empty");t.each(function(e,t){i(t).find("canvas").length&&cornerstoneTools.stopClip(t)})},V=function e(){var t=0;o.get("viewportActivated"),o.get("LayoutManagerUpdated");var n=s.viewer.stackImagePositionOffsetSynchronizer;if(n){var r=n.getLinkableViewports();t=r.length}return t<=1};i(window).on("CornerstoneToolsClipStopped",function(){return o.set("UpdateCINE",r.id())});var O={getEnabledElementForActiveElement:m,getEnabledElement:l,getActiveViewportElement:d,zoomIn:p,zoomOut:f,zoomToFit:g,rotateL:x,rotateR:h,invert:v,flipV:S,flipH:y,resetViewport:I,clearTools:T,linkStackScroll:b,toggleDialog:D,toggleCinePlay:w,toggleCineDialog:C,isPlaying:P,hasMultipleFrames:k,stopAllClips:R,isStackScrollLinkingDisabled:V}}],classes:{"ImageSet.js":["babel-runtime/helpers/typeof","babel-runtime/helpers/classCallCheck","meteor/random","./OHIFError",function(e,t,n){n.export({ImageSet:function(){return c}});var o;n.import("babel-runtime/helpers/typeof",{default:function(e){o=e}});var r;n.import("babel-runtime/helpers/classCallCheck",{default:function(e){r=e}});var i;n.import("meteor/random",{Random:function(e){i=e}});var a;n.import("./OHIFError",{OHIFError:function(e){a=e}});var s="object",c=function(){function e(t){if(r(this,e),Array.isArray(t)!==!0)throw new a("ImageSet expects an array of images");Object.defineProperty(this,"images",{enumerable:!1,configurable:!1,writable:!1,value:t}),Object.defineProperty(this,"uid",{enumerable:!1,configurable:!1,writable:!1,value:i.id()})}return e.prototype.getUID=function(){function e(){return this.uid}return e}(),e.prototype.setAttribute=function(){function e(e,t){this[e]=t}return e}(),e.prototype.getAttribute=function(){function e(e){return this[e]}return e}(),e.prototype.setAttributes=function(){function e(e){if(("undefined"==typeof e?"undefined":o(e))===s&&null!==e){var t=this,n=Object.prototype.hasOwnProperty;for(var r in g.sanitizeForInObject(e))n.call(e,r)&&(t[r]=e[r])}}return e}(),e.prototype.getImage=function(){function e(e){return this.images[e]}return e}(),e.prototype.sortBy=function(){function e(e){return this.images.sort(e)}return e}(),e}()}],"LayoutManager.js":["babel-runtime/helpers/classCallCheck","meteor/blaze","meteor/session","meteor/tracker","meteor/templating","meteor/random","meteor/underscore","meteor/jquery","meteor/ohif:core",function(e,t,n){n.export({LayoutManager:function(){return m}});var o;n.import("babel-runtime/helpers/classCallCheck",{default:function(e){o=e}});var r;n.import("meteor/blaze",{Blaze:function(e){r=e}});var i;n.import("meteor/session",{Session:function(e){i=e}});var a;n.import("meteor/tracker",{Tracker:function(e){a=e}});var s;n.import("meteor/templating",{Template:function(e){s=e}});var c;n.import("meteor/random",{Random:function(e){c=e}});var u;n.import("meteor/underscore",{_:function(e){u=e}});var l;n.import("meteor/jquery",{$:function(e){l=e}});var d;n.import("meteor/ohif:core",{OHIF:function(e){d=e}});var m=function(){function e(t,n){o(this,e),d.log.info("LayoutManager constructor"),this.parentNode=t,this.studies=n,this.viewportData=[],this.layoutTemplateName="gridLayout",this.layoutProps={rows:1,columns:1},this.layoutClassName=this.getLayoutClass(),this.isZoomed=!1;var r=function e(){return a.afterFlush(function(){return i.set("LayoutManagerUpdated",c.id())})};this.updateSession=u.throttle(r,300)}return e.prototype.getNumberOfViewports=function(){function e(){return this.layoutProps.rows*this.layoutProps.columns}return e}(),e.prototype.setDefaultViewportData=function(){function e(){d.log.info("LayoutManager setDefaultViewportData");var e=this,t=this.getNumberOfViewports(),n=e.viewportData,o=this.getDisplaySetSequenceMap(),r=this.isDisplaySetsSequenced(o),i=0;if(t>n.length&&n.length&&r)e.viewportData=n,i=n.length;else{if(t<=n.length)return void(e.viewportData=n.slice(0,t));e.viewportData=[]}var a=[];this.studies.forEach(function(e){e.displaySets.forEach(function(e){return e.images.length&&a.push(e)})});var s=void 0,c=e.viewportData.length;if(c){var u=o.values().next().value[0].displaySetIndex+c,l=u+(t-c);s=a.slice(u,l)}else s=a.slice(0,t);var m=[];for(s.forEach(function(e,t){var n=e.images,o=e.studyInstanceUid,r=e.seriesInstanceUid,a=e.displaySetInstanceUid,s=n[0]&&n[0].getSOPInstanceUID?n[0].getSOPInstanceUID():"",c=i+t,u={viewportIndex:c,studyInstanceUid:o,seriesInstanceUid:r,displaySetInstanceUid:a,sopInstanceUid:s};m.push(u)}),e.viewportData=e.viewportData.concat(m);e.viewportData.length<t;)e.viewportData.push({})}return e}(),e.prototype.getLayoutClass=function(){function e(){var e=this.layoutProps,t=e.rows,n=e.columns,o="layout-"+t+"-"+n;return o}return e}(),e.prototype.updateLayoutClass=function(){function e(){var e=this.getLayoutClass();this.layoutClassName!==e&&this.parentNode.classList.remove(this.layoutClassName),this.layoutClassName=e,this.parentNode.classList.add(e)}return e}(),e.prototype.updateViewports=function(){function e(){d.log.info("LayoutManager updateViewports"),this.viewportData&&this.viewportData.length&&this.viewportData.length===this.getNumberOfViewports()||this.setDefaultViewportData();var e=this.layoutProps,t=l.extend({viewportData:[]},e);this.viewportData.forEach(function(n){var o=l.extend(n,e);t.viewportData.push(o)});var n=s[this.layoutTemplateName],o=l(this.parentNode);o.html(""),this.updateLayoutClass(),r.renderWithData(n,t,this.parentNode),this.updateSession(),this.isZoomed=!1}return e}(),e.prototype.rerenderViewportWithNewDisplaySet=function(){function e(e,t){d.log.info("LayoutManager rerenderViewportWithNewDisplaySet: "+e);var n=l(".imageViewerViewport").eq(e),o=n.parents(".viewportContainer").get(0);t.viewportIndex=e,this.viewportData[e]={viewportIndex:e,displaySetInstanceUid:t.displaySetInstanceUid,seriesInstanceUid:t.seriesInstanceUid,studyInstanceUid:t.studyInstanceUid,renderedCallback:t.renderedCallback,currentImageIdIndex:t.currentImageIdIndex||0},n.find("canvas").not(".magnifyTool").removeClass("faded");var i=n.parents(".removable"),a=document.createElement("div");a.className="removable",i.remove(),o.appendChild(a),r.renderWithData(s.imageViewerViewport,t,a),this.updateSession()}return e}(),e.prototype.enlargeViewport=function(){function e(e){if(d.log.info("LayoutManager enlargeViewport: "+e),this.viewportData&&this.viewportData.length){this.previousViewportData=this.viewportData.slice(0);var t=l.extend({},this.viewportData[e]);t.rows=1,t.columns=1,t.viewportIndex=0;var n={viewportData:[t],rows:1,columns:1},o=s.gridLayout;l(this.parentNode).html(""),r.renderWithData(o,n,this.parentNode),this.isZoomed=!0,this.zoomedViewportIndex=e,this.viewportData=n.viewportData,this.updateSession()}}return e}(),e.prototype.resetPreviousLayout=function(){function e(){d.log.info("LayoutManager resetPreviousLayout"),this.isZoomed&&(this.previousViewportData[this.zoomedViewportIndex]=l.extend({},this.viewportData[0]),this.previousViewportData[this.zoomedViewportIndex].viewportIndex=this.zoomedViewportIndex,this.viewportData=this.previousViewportData,this.updateViewports())}return e}(),e.prototype.toggleEnlargement=function(){function e(e){d.log.info("LayoutManager toggleEnlargement: "+e),this.isZoomed?this.resetPreviousLayout():this.getNumberOfViewports()>1&&this.enlargeViewport(e)}return e}(),e.prototype.getDisplaySetSequenceMap=function(){function e(){var e=this;d.log.info("LayoutManager getDisplaySetSequenceMap");var t=this.viewportData,n=new p;return t.forEach(function(t,o){var r=u.findWhere(e.studies,{studyInstanceUid:t.studyInstanceUid})||e.studies[0],i=r.displaySets,a=u.findWhere(i,{displaySetInstanceUid:t.displaySetInstanceUid}),s=u.indexOf(i,a);s=s<0?9999:s;var c=n.get(r);c||(c=[],n.set(r,c)),c.push({viewportIndex:o,displaySetIndex:s})}),n}return e}(),e.prototype.isDisplaySetsSequenced=function(){function e(e){d.log.info("LayoutManager isDisplaySetsSequenced");var t=!0,n=e||this.getDisplaySetSequenceMap();return n.forEach(function(e,n){var o=null,r=null;e.forEach(function(e,n){var i=e.viewportIndex,a=e.displaySetIndex;9999===a||null===r||null===o||null===a||i-1===r&&a-1===o||(t=!1),r=i,o=a})}),t}return e}(),e.prototype.canMoveDisplaySets=function(){function e(e){d.log.info("LayoutManager canMoveDisplaySets");var t=d.uiSettings.displaySetNavigationMultipleViewports,n=d.uiSettings.displaySetNavigationLoopOverSeries,o=this.getDisplaySetSequenceMap(),r=this.isDisplaySetsSequenced(o),a=t?null:i.get("activeViewport");if(e&&!n){var s=!0;if(o.forEach(function(e,n){var o=e[null!==a?a:e.length-1];if(o){var r=o.displaySetIndex,i=e.length,c=n.displaySets.length,u=t?c%i||i:1,l=c-u;9999!==r&&r!==l&&(s=!1)}}),(!t||r)&&s)return!1}if(!e&&!n){var c=!0;if(a>=0&&o.forEach(function(e,t){var n=e[null!==a?a:0];if(n){var o=n.displaySetIndex,r=e.length;9999!==o&&o-r!==-r&&(c=!1)}}),(!t||r)&&c)return!1}return!0}return e}(),e.prototype.moveSingleViewportDisplaySets=function(){function e(e,t){d.log.info("LayoutManager moveSingleViewportDisplaySets: "+e);var n=d.uiSettings.displaySetNavigationLoopOverSeries,o=this.viewportData[e],r=u.findWhere(this.studies,{studyInstanceUid:o.studyInstanceUid})||this.studies[0],i=r.displaySets,a=u.findWhere(i,{displaySetInstanceUid:o.displaySetInstanceUid}),s=u.indexOf(i,a);if(t){if(s++,s>=i.length){if(!n)return;s=0}}else if(s--,s<0){if(!n)return;s=i.length-1}var c=i[s];this.rerenderViewportWithNewDisplaySet(e,c)}return e}(),e.prototype.moveMultipleViewportDisplaySets=function(){function e(e){var t=this;d.log.info("LayoutManager moveMultipleViewportDisplaySets");var n=d.uiSettings.displaySetNavigationLoopOverSeries,o=this.getDisplaySetSequenceMap(),r=this.isDisplaySetsSequenced(o),i=[];o.forEach(function(t,o){t.sort(function(e,t){return e.displaySetIndex>t.displaySetIndex});var a=o.displaySets,s=t[0].displaySetIndex,c=t.length,u=s%c,l=u?s-u:s,d=e?1:-1;l+=c*d;var m=a.length;if(l>=m){var p=m%c||c,f=m-p;if(s+c!==f+c)l=f;else{if(!n)return;l=0}}else if(l<0)if(s>0)l=0;else{if(!n)return;l=m-1-(m-1)%c}else r||(l=0);t.forEach(function(e,t){var n=e.viewportIndex,o=l+t,r=a[o]||{};i.push(r)})});var a=d.utils.sortBy({name:"studyInstanceUid"},{name:"instanceNumber"},{name:"seriesNumber"});i.sort(function(e,t){return a(e,t)}),i.forEach(function(e,n){t.rerenderViewportWithNewDisplaySet(n,e)})}return e}(),e.prototype.moveDisplaySets=function(){function e(e){if(d.log.info("LayoutManager moveDisplaySets"),d.uiSettings.displaySetNavigationMultipleViewports)this.moveMultipleViewportDisplaySets(e);else{var t=i.get("activeViewport");this.moveSingleViewportDisplaySets(t,e)}}return e}(),e.prototype.isStudyLoadedIntoViewport=function(){function e(e,t){return void 0!==this.viewportData.find(function(n){return n.studyInstanceUid===e&&n.viewportIndex===t})}return e}(),e.prototype.isMultipleLayout=function(){function e(){return 1!==this.layoutProps.row&&1!==this.layoutProps.columns}return e}(),e}()}],"OHIFError.js":["babel-runtime/helpers/classCallCheck","babel-runtime/helpers/possibleConstructorReturn","babel-runtime/helpers/inherits",function(e,t,n){n.export({OHIFError:function(){return a}});var o;n.import("babel-runtime/helpers/classCallCheck",{default:function(e){o=e}});var r;n.import("babel-runtime/helpers/possibleConstructorReturn",{default:function(e){r=e}});var i;n.import("babel-runtime/helpers/inherits",{default:function(e){i=e}});var a=function(e){function t(n){o(this,t);var i=r(this,e.call(this));return i.message=n,i.stack=(new Error).stack,i.name=i.constructor.name,i}return i(t,e),t}(Error)}],"ResizeViewportManager.js":["babel-runtime/helpers/classCallCheck","meteor/session","meteor/jquery","meteor/ohif:core","../instanceClassSpecificViewport",function(e,t,n){n.export({ResizeViewportManager:function(){return c}});var o;n.import("babel-runtime/helpers/classCallCheck",{default:function(e){o=e}});var r;n.import("meteor/session",{Session:function(e){r=e}});var i;n.import("meteor/jquery",{$:function(e){i=e}});var a;n.import("meteor/ohif:core",{OHIF:function(e){a=e}});var s;n.import("../instanceClassSpecificViewport",{getInstanceClassDefaultViewport:function(e){s=e}});var c=function(){function e(){o(this,e),this._resizeHandler=null,a.log.info("ResizeViewportManager")}return e.prototype.repositionStudySeriesQuickSwitch=function(){function e(){a.log.info("ResizeViewportManager repositionStudySeriesQuickSwitch");var e=r.get("ViewerOpened");if(e){var t=a.viewerbase.layoutManager.viewportData.length;if(t&&!(t<=1)){var n=i("#viewer"),o=n.find(".sidebar-left.sidebar-open"),s=n.find(".sidebar-right.sidebar-open"),c=i(".quickSwitchWrapper.left"),u=i(".quickSwitchWrapper.right"),l=o.length>0,d=s.length>0;u.removeClass("left-sidebar-only"),c.removeClass("right-sidebar-only");var m=0;l&&(m=o.width()/i(window).width()*100,d||u.addClass("left-sidebar-only")),d&&!l&&c.addClass("right-sidebar-only");var p=i("#imageViewerViewports").width()/t/i(window).width()*100+m,f=100-p;c.css("right",f+"%"),u.css("left",p+"%")}}}return e}(),e.prototype.relocateDialogs=function(){function e(){a.log.info("ResizeViewportManager relocateDialogs");var e=i("#annotationDialog, #textMarkerOptionsDialog");e.css({top:"",left:"",bottom:0,right:0});var t=i(".draggableDialog").not(e);t.css({top:0,left:0,bottom:0,right:0})}return e}(),e.prototype.resizeScrollbars=function(){function e(e){a.log.info("ResizeViewportManager resizeScrollbars");var t=i(e).siblings(".imageViewerViewportOverlay");t.find(".imageControls").height(i(e).height());var n=t.find("#scrollbar");n.height(n.parent().height()-20);var o=t.find("#imageSlider"),r=o.parent().height(),s=cornerstoneTools.getBrowserInfo();s.indexOf("IE")>-1?o.height(r):o.width(r)}return e}(),e.prototype.resizeViewportElement=function(){function e(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=void 0;try{n=cornerstone.getEnabledElement(e)}catch(e){return}if(cornerstone.resize(e,t),n.fitToWindow===!1){var o=n.image.imageId,r=cornerstoneTools.metaData.get("instance",o),i=s(r,n,o);cornerstone.setViewport(e,i)}}return e}(),e.prototype.resizeViewportElements=function(){function e(){var e=this;this.relocateDialogs(),setTimeout(function(){e.repositionStudySeriesQuickSwitch();var t=i(".imageViewerViewport").not(".empty");t.each(function(t,n){e.resizeViewportElement(n),e.resizeScrollbars(n)})},1)}return e}(),e.prototype.setResizeViewportElement=function(){function e(e){this.resizeViewportElements=e}return e}(),e.prototype.handleResize=function(){function e(){var e=this;clearTimeout(this.resizeTimer),this.resizeTimer=setTimeout(function(){a.log.info("ResizeViewportManager resizeViewportElements"),e.resizeViewportElements()},100)}return e}(),e.prototype.getResizeHandler=function(){function e(){var e=this._resizeHandler;return null===e&&(e=this.handleResize.bind(this),this._resizeHandler=e),e}return e}(),e}()}],"StackImagePositionOffsetSynchronizer.js":["babel-runtime/helpers/classCallCheck","babel-runtime/helpers/createClass","meteor/ohif:core","meteor/session","meteor/jquery","../toolManager",function(e,t,n){n.export({StackImagePositionOffsetSynchronizer:function(){return u}});var o;n.import("babel-runtime/helpers/classCallCheck",{default:function(e){o=e}});var r;n.import("babel-runtime/helpers/createClass",{default:function(e){r=e}});var i;n.import("meteor/ohif:core",{OHIF:function(e){i=e}});var a;n.import("meteor/session",{Session:function(e){a=e}});var s;n.import("meteor/jquery",{$:function(e){s=e}});var c;n.import("../toolManager",{toolManager:function(e){c=e}});var u=function(){function e(){o(this,e),this.active=!1,this.syncedViewports=[],this.synchronizer=new cornerstoneTools.Synchronizer("CornerstoneNewImage",cornerstoneTools.stackImagePositionOffsetSynchronizer)}return e.prototype.isActive=function(){function e(){return this.active}return e}(),e.prototype.activate=function(){function e(){var e=this.getLinkableViewports();this.syncViewports(e)}return e}(),e.prototype.activateByViewportIndexes=function(){function e(e){var t=this.getViewportByIndexes(e);this.syncViewports(t)}return e}(),e.prototype.deactivate=function(){function e(){if(this.isActive()){for(;this.syncedViewports.length;){var e=this.syncedViewports[0];this.removeViewport(e)}this.active=!1,c.deactivateCommandButton("linkStackScroll")}}return e}(),e.prototype.update=function(){function e(){if(this.isActive()){var e=this.getActiveViewportElement();this.isViewportSynced(e)||(this.deactivate(),this.activate())}}return e}(),e.prototype.syncViewports=function(){function t(t){var n=this,o=[];this.isActive()||t.length<=1||(t.forEach(function(t,r){n.synchronizer.add(t.element),n.syncedViewports.push(t),o.push(t.index),s(t.element).on(e.ELEMENT_DISABLED_EVENT,n.elementDisabledHandler(n))}),this.active=!0,c.activateCommandButton("linkStackScroll"),a.set("StackImagePositionOffsetSynchronizerLinkedViewports",o))}return t}(),e.prototype.isViewportSynced=function(){function e(e){return!!this.getViewportByElement(e)}return e}(),e.prototype.getActiveViewportElement=function(){function e(){var e=a.get("activeViewport")||0;return s(".imageViewerViewport").get(e)}return e}(),e.prototype.removeViewport=function(){function t(t){var n=this.syncedViewports.indexOf(t);n!==-1&&(this.syncedViewports.splice(n,1),this.synchronizer.remove(t.element),this.removeLinkedViewportFromSession(t),s(t.element).off(e.ELEMENT_DISABLED_EVENT))}return t}(),e.prototype.getViewportByElement=function(){function e(e){for(var t=this.syncedViewports.length,n=0;n<t;n++){var o=this.syncedViewports[n];if(o.element===e)return o}}return e}(),e.prototype.removeViewportByElement=function(){function e(e){var t=this.getViewportByElement(e);t&&this.removeViewport(t)}return e}(),e.prototype.removeLinkedViewportFromSession=function(){function e(e){var t=a.get("StackImagePositionOffsetSynchronizerLinkedViewports"),n=t.indexOf(e.index);n!==-1&&(t.splice(n,1),a.set("StackImagePositionOffsetSynchronizerLinkedViewports",t))}return e}(),e.prototype.elementDisabledHandler=function(){function e(e){return function(t,n){e.removeViewportByElement(n.element)}}return e}(),e.prototype.getViewportByIndexes=function(){function e(e){var t=[],n=s(".imageViewerViewport");return e.forEach(function(e){var o=n.get(e);o&&t.push({index:e,element:o})}),t}return e}(),e.prototype.getLinkableViewports=function(){function e(){var e=this,t=this.getActiveViewportElement(),n=this.getViewportImageNormal(t),o=[];return s(".imageViewerViewport").each(function(t,r){var i=e.getViewportImageNormal(r);if(n&&i){var a=i.angleTo(n);(a<Math.PI/12||a===Math.PI)&&o.push({index:t,element:r})}}),o}return e}(),e.prototype.getViewportImageNormal=function(){function e(e){if(e){e=s(e).get(0);try{var t=cornerstone.getEnabledElement(e);if(!t.image)return;var n=t.image.imageId,o=cornerstoneTools.metaData.get("imagePlane",n);if(!o||!o.rowCosines||!o.columnCosines)return;return o.rowCosines.clone().cross(o.columnCosines)}catch(e){var r=e.message||e;i.log.info("StackImagePositionOffsetSynchronizer getViewportImageNormal: "+r)}}}return e}(),r(e,null,[{key:"ELEMENT_DISABLED_EVENT",get:function(){function e(){return"CornerstoneElementDisabled.StackImagePositionOffsetSynchronizer"}return e}()}]),e}()}],"StudyLoadingListener.js":["babel-runtime/helpers/possibleConstructorReturn","babel-runtime/helpers/inherits","babel-runtime/helpers/classCallCheck","meteor/jquery","meteor/session",function(e,t,n){n.export({StudyLoadingListener:function(){return d},StackLoadingListener:function(){return l},DICOMFileLoadingListener:function(){return u}});var o;n.import("babel-runtime/helpers/possibleConstructorReturn",{default:function(e){o=e}});var r;n.import("babel-runtime/helpers/inherits",{default:function(e){r=e}});var i;n.import("babel-runtime/helpers/classCallCheck",{default:function(e){i=e}});var a;n.import("meteor/jquery",{$:function(e){a=e}});var s;n.import("meteor/session",{Session:function(e){s=e}});var c=function(){function e(t,n){i(this,e),n=n||{},this.id=e.getNewId(),this.stack=t,this.startListening(),this.statsItemsLimit=n.statsItemsLimit||2,this.stats={items:[],total:0,elapsedTime:0,speed:0},this._addStatsData(0),this._updateProgress()}return e.prototype._addStatsData=function(){function e(e){var t=new Date,n=this.stats,o=n.items,r={value:e,date:t};for(o.push(r),n.total+=r.value;o.length>this.statsItemsLimit;){var i=o.shift();n.total-=i.value}if(o.length>1){var a=o[0];n.elapsedTime=(r.date.getTime()-a.date.getTime())/1e3,n.speed=(n.total-a.value)/n.elapsedTime}}return e}(),e.prototype._getProgressSessionId=function(){function e(){var e=this.stack.displaySetInstanceUid;return"StackProgress:"+e}return e}(),e.prototype._clearSession=function(){function e(){var e=this._getProgressSessionId();s.set(e,void 0),delete s.keys.progressSessionId}return e}(),e.prototype.startListening=function(){function e(){throw new Error("`startListening` must be implemented by child clases")}return e}(),e.prototype.stopListening=function(){function e(){throw new Error("`stopListening` must be implemented by child clases")}return e}(),e.prototype.destroy=function(){function e(){this.stopListening(),this._clearSession()}return e}(),e.getNewId=function(){function e(){var e=(new Date).getTime().toString().slice(-8),t=parseInt(1e9*Math.random());return e.toString()+t.toString()}return e}(),e}(),u=function(e){function t(n){i(this,t);var r=o(this,e.call(this,n));return r._dataSetUrl=r._getDataSetUrl(n),r._lastLoaded=0,r._checkCachedData(),r}return r(t,e),t.prototype._checkCachedData=function(){function e(){var e=cornerstoneWADOImageLoader.wadouri.dataSetCacheManager.get(this._dataSetUrl);if(e){var t=e.byteArray.length;this._updateProgress({percentComplete:100,loaded:t,total:t})}}return e}(),t.prototype._getImageLoadProgressEventName=function(){function e(){return"CornerstoneImageLoadProgress."+this.id}return e}(),t.prototype.startListening=function(){function e(){var e=this._getImageLoadProgressEventName(),t=this._imageLoadProgressEventHandle.bind(this);this.stopListening(),a(cornerstone).on(e,t)}return e}(),t.prototype.stopListening=function(){function e(){var e=this._getImageLoadProgressEventName();a(cornerstone).off(e)}return e}(),t.prototype._imageLoadProgressEventHandle=function(){function e(e,t){var n=this._convertImageIdToDataSetUrl(t.imageId),o=t.loaded-this._lastLoaded;!this._dataSetUrl!==n&&(this._addStatsData(o),this._updateProgress(t),this._lastLoaded=t.loaded)}return e}(),t.prototype._updateProgress=function(){function e(e){var t=this._getProgressSessionId();e=e||{},s.set(t,{multiFrame:!1,percentComplete:e.percentComplete,bytesLoaded:e.loaded,bytesTotal:e.total,bytesPerSecond:this.stats.speed})}return e}(),t.prototype._convertImageIdToDataSetUrl=function(){function e(e){return e=e.replace(/^(dicomweb:|wadouri:)/i,""),e=e.replace(/frame=\d+&?/i,""),e=e.replace(/&$/,"")}return e}(),t.prototype._getDataSetUrl=function(){function e(e){var t=e.imageIds[0];return this._convertImageIdToDataSetUrl(t)}return e}(),t}(c),l=function(e){function t(n){i(this,t);var r=o(this,e.call(this,n,{statsItemsLimit:20}));return r.imageDataMap=r._convertImageIdsArrayToMap(n.imageIds),r.framesStatus=r._createArray(n.imageIds.length,!1),r.loadedCount=0,r._checkCachedData(),r}return r(t,e),t.prototype._convertImageIdsArrayToMap=function(){function e(e){for(var t=new p,n=0;n<e.length;n++)t.set(e[n],{index:n,loaded:!1});return t}return e}(),t.prototype._createArray=function(){function e(e,t){for(var n=new Array,o=0;o<e;o++)n[o]=t;
return n}return e}(),t.prototype._checkCachedData=function(){function e(){for(var e=this.stack.imageIds,t=0;t<e.length;t++){var n=e[t],o=cornerstone.imageCache.getImagePromise(n);o&&"resolved"===o.state()&&this._updateFrameStatus(n,!0)}}return e}(),t.prototype._getImageLoadedEventName=function(){function e(){return"CornerstoneImageLoaded."+this.id}return e}(),t.prototype._getImageCachePromiseRemoveEventName=function(){function e(){return"CornerstoneImageCachePromiseRemoved."+this.id}return e}(),t.prototype.startListening=function(){function e(){var e=this._getImageLoadedEventName(),t=this._getImageCachePromiseRemoveEventName(),n=this._imageLoadedEventHandle.bind(this),o=this._imageCachePromiseRemovedEventHandle.bind(this);this.stopListening(),a(cornerstone).on(e,n),a(cornerstone).on(t,o)}return e}(),t.prototype.stopListening=function(){function e(){var e=this._getImageLoadedEventName(),t=this._getImageCachePromiseRemoveEventName();a(cornerstone).off(e),a(cornerstone).off(t)}return e}(),t.prototype._updateFrameStatus=function(){function e(e,t){var n=this.imageDataMap.get(e);n&&n.loaded!==t&&(t&&this._addStatsData(1),n.loaded=t,this.framesStatus[n.index]=t,this.loadedCount+=t?1:-1,this._updateProgress())}return e}(),t.prototype._imageLoadedEventHandle=function(){function e(e,t){var n=t.image.imageId;this._updateFrameStatus(n,!0)}return e}(),t.prototype._imageCachePromiseRemovedEventHandle=function(){function e(e,t){var n=t.imageId;this._updateFrameStatus(n,!1)}return e}(),t.prototype._updateProgress=function(){function e(){var e=this.stack.imageIds.length,t=this.loadedCount,n=e-t,o=Math.round(t/e*100),r=this._getProgressSessionId();s.set(r,{multiFrame:!0,totalFramesCount:e,loadedFramesCount:t,loadingFramesCount:n,percentComplete:o,framesPerSecond:this.stats.speed,framesStatus:this.framesStatus})}return e}(),t.prototype._logProgress=function(){function e(){for(var e=this.stack.imageIds.length,t=this.stack.displaySetInstanceUid,n="[",o=0;o<e;o++){var r=this.framesStatus[o]?"|":".";n+=""+r}n+="]",console.log(t+": "+n)}return e}(),t}(c),d=function(){function e(){i(this,e),this.listeners={}}return e.prototype.addStack=function(){function e(e,t){var n=e.displaySetInstanceUid;this.listeners[n]||(E=this._createListener(e,t),E&&(this.listeners[n]=E))}return e}(),e.prototype.addStudy=function(){function e(e){var t=this;e.displaySets.forEach(function(n){var o=OHIF.viewerbase.stackManager.findOrCreateStack(e,n);t.addStack(o,{isMultiFrame:n.isMultiFrame})})}return e}(),e.prototype.addStudies=function(){function e(e){if(e&&e.length)for(var t=0;t<e.length;t++)this.addStudy(e[t])}return e}(),e.prototype.clear=function(){function e(){for(var e=Object.keys(this.listeners),t=e.length,n=0;n<t;n++){var o=e[n],r=this.listeners[o];r.destroy()}this.listeners={}}return e}(),e.prototype._createListener=function(){function e(e,t){var n=this._getSchema(e);return"wadors"!==n&&t.isMultiFrame?new u(e):new l(e)}return e}(),e.prototype._getSchema=function(){function e(e){var t=e.imageIds[0],n=t.indexOf(":");return t.substring(0,n)}return e}(),e.getInstance=function(){function t(){return e._instance||(e._instance=new e),e._instance}return t}(),e}()}],"StudyMetadataSource.js":["babel-runtime/helpers/classCallCheck","./OHIFError",function(e,t,n){n.export({StudyMetadataSource:function(){return i}});var o;n.import("babel-runtime/helpers/classCallCheck",{default:function(e){o=e}});var r;n.import("./OHIFError",{OHIFError:function(e){r=e}});var i=function(){function e(){o(this,e)}return e.prototype.getByInstanceUID=function(){function e(e){throw new r("StudyMetadataSource::getByInstanceUID is not overriden. Please, override it in a specialized class. See OHIFStudyMetadataSource for example")}return e}(),e.prototype.loadStudy=function(){function e(e){throw new r("StudyMetadataSource::loadStudy is not overriden. Please, override it in a specialized class. See OHIFStudyMetadataSource for example")}return e}(),e}()}],"StudyPrefetcher.js":["babel-runtime/helpers/classCallCheck","meteor/meteor","meteor/session","meteor/jquery","meteor/underscore","meteor/ohif:core","./OHIFError","../StackManager.js",function(e,t,n){n.export({StudyPrefetcher:function(){return d}});var o;n.import("babel-runtime/helpers/classCallCheck",{default:function(e){o=e}});var r;n.import("meteor/meteor",{Meteor:function(e){r=e}});var i;n.import("meteor/session",{Session:function(e){i=e}});var a;n.import("meteor/jquery",{$:function(e){a=e}});var s;n.import("meteor/underscore",{_:function(e){s=e}});var c;n.import("meteor/ohif:core",{OHIF:function(e){c=e}});var u;n.import("./OHIFError",{OHIFError:function(e){u=e}});var l;n.import("../StackManager.js",{StackManager:function(e){l=e}});var d=function(){function e(t){o(this,e),this.studies=[],this.prefetchDisplaySetsTimeout=300,this.lastActiveViewportElement=null,a(cornerstone).on("CornerstoneImageCacheFull.StudyPrefetcher",s.bind(this.cacheFullHandler,this))}return e.prototype.destroy=function(){function e(){this.stopPrefetching(),a(cornerstone).off("CornerstoneImageCacheFull.StudyPrefetcher")}return e}(),e.getInstance=function(){function t(){return e.instance||(e.instance=new e),e.instance}return t}(),e.prototype.setStudies=function(){function e(e){this.stopPrefetching(),this.studies=e}return e}(),e.prototype.prefetch=function(){function e(){this.studies&&this.studies.length&&(this.stopPrefetching(),this.prefetchActiveViewport(),this.prefetchDisplaySets())}return e}(),e.prototype.stopPrefetching=function(){function e(){this.disableViewportPrefetch(),cornerstoneTools.requestPoolManager.clearRequestStack("prefetch")}return e}(),e.prototype.prefetchActiveViewport=function(){function e(){var e=c.viewerbase.viewportUtils.getActiveViewportElement();this.enablePrefetchOnElement(e),this.attachActiveViewportListeners(e)}return e}(),e.prototype.disableViewportPrefetch=function(){function e(){a(".imageViewerViewport").each(function(){a(this).find("canvas").length&&cornerstoneTools.stackPrefetch.disable(this)})}return e}(),e.prototype.hasStack=function(){function e(e){var t=cornerstoneTools.getToolState(e,"stack");return t&&t.data.length&&t.data[0].imageIds.length>1}return e}(),e.prototype.enablePrefetchOnElement=function(){function e(e){if(a(e).find("canvas").length&&this.hasStack(e)){var t=i.get("activeViewport"),n=c.viewer.data.loadedSeriesData[t].displaySetInstanceUid,o=l.findStack(n);if(!o)throw new u("Requested stack "+n+" was not created");cornerstoneTools.stackPrefetch.enable(e)}}return e}(),e.prototype.attachActiveViewportListeners=function(){function e(e){var t=this,n=function(){function e(){t.prefetchDisplaySetsAsync()}return e}();a(this.lastActiveViewportElement).off("CornerstoneNewImage.StudyPrefetcher"),a(e).off("CornerstoneNewImage.StudyPrefetcher"),this.hasStack(e)&&a(e).on("CornerstoneNewImage.StudyPrefetcher",n),this.lastActiveViewportElement=e}return e}(),e.prototype.prefetchDisplaySetsAsync=function(){function e(e){var t=this;e=e||this.prefetchDisplaySetsTimeout,clearTimeout(this.prefetchDisplaySetsHandler),this.prefetchDisplaySetsHandler=setTimeout(function(){t.prefetchDisplaySets()},e)}return e}(),e.prototype.prefetchDisplaySets=function(){function e(){var e=r.settings.public.prefetch,t=this.getDisplaySetsToPrefetch(e),n=this.getImageIdsFromDisplaySets(t);this.prefetchImageIds(n)}return e}(),e.prototype.prefetchImageIds=function(){function e(e){var t=this.filterCachedImageIds(e),n=cornerstoneTools.requestPoolManager,o="prefetch",r=!1,i=function(){function e(){}return e}();t.forEach(function(e){n.addRequest({},e,o,r,i,i)}),n.startGrabbing()}return e}(),e.prototype.getActiveViewportImage=function(){function e(){var e=c.viewerbase.viewportUtils.getActiveViewportElement();if(e){var t=cornerstone.getEnabledElement(e),n=t.image;return n}}return e}(),e.prototype.getStudy=function(){function e(e){var t=cornerstoneTools.metaData.get("study",e.imageId);return s.find(this.studies,function(e){return e.studyInstanceUid===t.studyInstanceUid})}return e}(),e.prototype.getSeries=function(){function e(e,t){var n=cornerstoneTools.metaData.get("series",t.imageId);return s.find(e.seriesList,function(e){return e.seriesInstanceUid===n.seriesInstanceUid})}return e}(),e.prototype.getInstance=function(){function e(e,t){var n=cornerstoneTools.metaData.get("instance",t.imageId);return s.find(e.instances,function(e){return e.sopInstanceUid===n.sopInstanceUid})}return e}(),e.prototype.getActiveDisplaySet=function(){function e(e,t){return s.find(e,function(e){return s.some(e.images,function(e){return e.sopInstanceUid===t.sopInstanceUid})})}return e}(),e.prototype.getDisplaySetsToPrefetch=function(){function e(e){var t=this.getActiveViewportImage();if(!t||!e||!e.displaySetCount)return[];var n=this.getStudy(t),o=this.getSeries(n,t),r=this.getInstance(o,t),i=n.displaySets,a=this.getActiveDisplaySet(i,r),s={topdown:"getFirstDisplaySets",downward:"getNextDisplaySets",closest:"getClosestDisplaySets"},u=e.order,l=s[u],d=this[l];return d?d.call(this,i,a,e.displaySetCount):(u&&c.log.warn("Invalid prefetch order configuration ("+u+")"),[])}return e}(),e.prototype.getFirstDisplaySets=function(){function e(e,t,n){for(var o=e.length,r=[],i=0;i<o&&n;i++){var a=e[i];a!==t&&(r.push(a),n--)}return r}return e}(),e.prototype.getNextDisplaySets=function(){function e(e,t,n){var o=e.indexOf(t),r=o+1,i=Math.min(r+n,e.length);return e.slice(r,i)}return e}(),e.prototype.getClosestDisplaySets=function(){function e(e,t,n){for(var o=e.indexOf(t),r=e.length,i=[],a=o-1,s=o+1;(a>=0||s<r)&&n;)a>=0&&(i.push(e[a]),n--,a--),s<r&&n&&(i.push(e[s]),n--,s++);return i}return e}(),e.prototype.getImageIdsFromDisplaySets=function(){function e(e){var t=this,n=[];return e.forEach(function(e){n=n.concat(t.getImageIdsFromDisplaySet(e))}),n}return e}(),e.prototype.getImageIdsFromDisplaySet=function(){function e(e){var t=[];return e.images.forEach(function(e){var n=e.numFrames;if(n>1)for(var o=0;o<n;o++){var r=getImageId(e,o);t.push(r)}else{var i=getImageId(e);t.push(i)}}),t}return e}(),e.prototype.filterCachedImageIds=function(){function e(e){var t=this;return s.filter(e,function(e){return!t.isImageCached(e)})}return e}(),e.prototype.isImageCached=function(){function e(e){var t=cornerstone.imageCache.getImagePromise(e);return t&&"resolved"===t.state()}return e}(),e.prototype.cacheFullHandler=function(){function e(){c.log.warn("Cache full"),this.stopPrefetching()}return e}(),e}()}],"TypeSafeCollection.js":["babel-runtime/helpers/typeof","babel-runtime/helpers/classCallCheck","meteor/random","meteor/reactive-var",function(e,t,n){function o(e){return e instanceof Object||"object"===("undefined"==typeof e?"undefined":l(e))&&null!==e}function r(e){return"string"==typeof e}function i(e){return"function"==typeof e}function a(e,t){var n=void 0;if(o(e)&&r(t)){var i=t.split(f),s=i.length;if(s>0){var c=i[0],u=s>1?i.slice(1).join(f):null;n=e[c],null!==u&&(n=a(n,u))}}return n}function s(e,t){var n=!1;for(var o in g.sanitizeForInObject(e))if(I.call(e,o)){if(e[o]!==a(t,o)){n=!1;break}n!==!0&&(n=!0)}return n}function c(e){var t=!0;if(e instanceof Array&&e.length>0)for(var n=e.length-1;n>=0;n--){var o=e[n];if(o instanceof Array){var i=o[0],a=o[1];if(r(i)&&(a===x||a===h))continue}t=!1;break}return t}function u(e,t){if(!(e instanceof Array&&c(t)))throw new Error("Invalid Arguments");!function(){var n=t.length;e.sort(function(){function e(e,o){for(var r=0;r<n;){var i=t[r],s=i[0],c=i[1]===h?-1:1,u=a(e,s),l=a(o,s);if(u<l)return c*-1;if(u>l)return 1*c;if(++r>=n)return 0}}return e}())}()}n.export({TypeSafeCollection:function(){return y}});var l;n.import("babel-runtime/helpers/typeof",{default:function(e){l=e}});var d;n.import("babel-runtime/helpers/classCallCheck",{default:function(e){d=e}});var m;n.import("meteor/random",{Random:function(e){m=e}});var p;n.import("meteor/reactive-var",{ReactiveVar:function(e){p=e}});var f=".",x="asc",h="desc",v=0,S=2147483647,y=function(){function e(){d(this,e),this._operationCount=new p(v),this._elementList=[],this._handlers=Object.create(null)}return e.prototype._invalidate=function(){function e(){var e=this._operationCount.get();this._operationCount.set(e<S?e+1:v)}return e}(),e.prototype._elements=function(){function e(e){return e===!0||this._operationCount.get(),this._elementList}return e}(),e.prototype._elementWithPayload=function(){function e(e,t){return this._elements(t).find(function(t){return t.payload===e})}return e}(),e.prototype._elementWithId=function(){function e(e,t){return this._elements(t).find(function(t){return t.id===e})}return e}(),e.prototype._trigger=function(){function e(e,t){var n=this._handlers;if(e in n){if(n=n[e],!(n instanceof Array))return;for(var o=0,r=n.length;o<r;++o){var a=n[o];i(a)&&a.call(null,t)}}}return e}(),e.prototype.onInsert=function(){function e(e){if(i(e)){var t=this._handlers.insert;t instanceof Array||(t=[],this._handlers.insert=t),t.push(e)}}return e}(),e.prototype.updateById=function(){function e(e,t){var n=!1,o=this._elementWithPayload(t,!0);return o?o.id===e&&(n=!0,this._invalidate()):(o=this._elementWithId(e,!0),o&&(o.payload=t,n=!0,this._invalidate())),n}return e}(),e.prototype.update=function(){function e(e){var t=!1,n=this._elementWithPayload(e,!0);return n&&(t=!0,this._invalidate()),t}return e}(),e.prototype.insert=function(){function e(e){var t=null,n=this._elementWithPayload(e,!0);return n||(t=m.id(),this._elements(!0).push({id:t,payload:e}),this._invalidate(),this._trigger("insert",{id:t,data:e})),t}return e}(),e.prototype.removeAll=function(){function e(){for(var e=this._elements(!0),t=e.length,n=t-1;n>=0;n--){var o=e[n];delete o.id,delete o.payload,e[n]=null}e.splice(0,t),this._invalidate()}return e}(),e.prototype.remove=function(){function e(e){var t=this.findAllEntriesBy(e),n=t.length,o=[];if(n>0){for(var r=this._elements(!0),i=n-1;i>=0;i--){var a=t[i];r.splice(a[2],1),o.push(a[0])}this._invalidate()}return o}return e}(),e.prototype.getElementId=function(){function e(e){var t=this._elementWithPayload(e);return t&&t.id}return e}(),e.prototype.findById=function(){function e(e){var t=this._elementWithId(e);return t&&t.payload}return e}(),e.prototype.indexOfElement=function(){function e(e){return this._elements().indexOf(this._elementWithPayload(e,!0))}return e}(),e.prototype.indexOfId=function(){function e(e){return this._elements().indexOf(this._elementWithId(e,!0))}return e}(),e.prototype.getElementByIndex=function(){function e(e){var t=this._elements()[e>=0?e:-1];return t&&t.payload}return e}(),e.prototype.find=function(){function e(e){var t=this,n=void 0;return i(e)&&(n=this._elements().find(function(n,o){return e.call(t,n.payload,n.id,o)})),n&&n.payload}return e}(),e.prototype.findBy=function(){function e(e,t){var n=void 0;if(o(t)){var r=this.all(t);r.length>0&&(n=o(e)?r.find(function(t){return s(e,t)}):r[0])}else o(e)&&(n=this._elements().find(function(t){return s(e,t.payload)}),n&&(n=n.payload));return n}return e}(),e.prototype.findAllEntriesBy=function(){function e(e){var t=[];return o(e)&&this._elements().forEach(function(n,o){s(e,n.payload)&&t.push([n.payload,n.id,o])}),t}return e}(),e.prototype.findAllBy=function(){function e(e,t){var n=this.findAllEntriesBy(e).map(function(e){return e[0]});return o(t)&&"sort"in t&&u(n,t.sort),n}return e}(),e.prototype.forEach=function(){function e(e){var t=this;i(e)&&this._elements().forEach(function(n,o){e.call(t,n.payload,n.id,o)})}return e}(),e.prototype.count=function(){function e(){return this._elements().length}return e}(),e.prototype.all=function(){function e(e){var t=this._elements().map(function(e){return e.payload});return o(e)&&"sort"in e&&u(t,e.sort),t}return e}(),e}(),I=Object.prototype.hasOwnProperty}],metadata:{"InstanceMetadata.js":["babel-runtime/helpers/typeof","babel-runtime/helpers/classCallCheck","babel-runtime/helpers/possibleConstructorReturn","babel-runtime/helpers/inherits","./Metadata","../OHIFError",function(e,t,n){n.export({InstanceMetadata:function(){return f}});var o;n.import("babel-runtime/helpers/typeof",{default:function(e){o=e}});var r;n.import("babel-runtime/helpers/classCallCheck",{default:function(e){r=e}});var i;n.import("babel-runtime/helpers/possibleConstructorReturn",{default:function(e){i=e}});var a;n.import("babel-runtime/helpers/inherits",{default:function(e){a=e}});var s;n.import("./Metadata",{Metadata:function(e){s=e}});var c;n.import("../OHIFError",{OHIFError:function(e){c=e}});var u="undefined",l="number",d="string",m="x0020000d",p="x0020000e",f=function(e){function t(n,o){r(this,t);var a=i(this,e.call(this,n,o));return Object.defineProperties(a,{_sopInstanceUID:{configurable:!0,enumerable:!1,writable:!0,value:null},_imageId:{configurable:!0,enumerable:!1,writable:!0,value:null}}),a._definePublicProperties(),a}return a(t,e),t.prototype._definePublicProperties=function(){function e(){Object.defineProperty(this,"sopInstanceUID",{configurable:!1,enumerable:!1,get:function(){function e(){return this.getSOPInstanceUID()}return e}()})}return e}(),t.prototype.getStudyInstanceUID=function(){function e(){return this.getTagValue(m,null)}return e}(),t.prototype.getSeriesInstanceUID=function(){function e(){return this.getTagValue(p,null)}return e}(),t.prototype.getSOPInstanceUID=function(){function e(){return this._sopInstanceUID}return e}(),t.prototype.getStringValue=function(){function e(e,n,r){var i=this.getTagValue(e,r);return("undefined"==typeof i?"undefined":o(i))!==d&&("undefined"==typeof i?"undefined":o(i))!==u&&(i=i.toString()),t.getIndexedValue(i,n,r)}return e}(),t.prototype.getFloatValue=function(){function e(e,n,r){var i=this.getTagValue(e,r);return i=t.getIndexedValue(i,n,r),i instanceof Array?(i.forEach(function(e,t){i[t]=parseFloat(e)}),i):("undefined"==typeof i?"undefined":o(i))===d?parseFloat(i):i}return e}(),t.prototype.getIntValue=function(){function e(e,n,r){var i=this.getTagValue(e,r);return i=t.getIndexedValue(i,n,r),i instanceof Array?(i.forEach(function(e,t){i[t]=parseFloat(e)}),i):("undefined"==typeof i?"undefined":o(i))===d?parseInt(i):i}return e}(),t.prototype.getRawValue=function(){function e(e,t){return this.getTagValue(e,t)}return e}(),t.prototype.getTagValue=function(){function e(e,t){throw new c("InstanceMetadata::getTagValue is not overriden. Please, override it in a specialized class. See OHIFInstanceMetadata for example")}return e}(),t.prototype.equals=function(){function e(e){var n=this;return e===n||e instanceof t&&e.getSOPInstanceUID()===n.getSOPInstanceUID()}return e}(),t.prototype.tagExists=function(){function e(e){throw new c("InstanceMetadata::tagExists is not overriden. Please, override it in a specialized class. See OHIFInstanceMetadata for example")}return e}(),t.prototype.getImageId=function(){function e(e){throw new c("InstanceMetadata::getImageId is not overriden. Please, override it in a specialized class. See OHIFInstanceMetadata for example")}return e}(),t.getIndexedValue=function(){function e(e,t,n){var r=n;if(("undefined"==typeof e?"undefined":o(e))===d){var i=e.indexOf("\\")!==-1;if(r=e,i){var a=e.split("\\");if(s.isValidIndex(t)){var c=a[t];r=("undefined"==typeof c?"undefined":o(c))!==d?n:c}else r=a}}return r}return e}(),t}(s)}],"Metadata.js":["babel-runtime/helpers/typeof","babel-runtime/helpers/classCallCheck",function(e,t,n){n.export({Metadata:function(){return u}});var o;n.import("babel-runtime/helpers/typeof",{default:function(e){o=e}});var r;n.import("babel-runtime/helpers/classCallCheck",{default:function(e){r=e}});var i="string",a="number",s="function",c="object",u=function(){function e(t,n){r(this,e),Object.defineProperty(this,"_data",{configurable:!1,enumerable:!1,writable:!1,value:t}),Object.defineProperty(this,"_uid",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(this,"_custom",{configurable:!1,enumerable:!1,writable:!1,value:Object.create(null)})}return e.prototype.getData=function(){function e(){return this._data}return e}(),e.prototype.getDataProperty=function(){function e(e){var t=void 0,n=this._data;return(n instanceof Object||("undefined"==typeof n?"undefined":o(n))===c&&null!==n)&&(t=n[e]),t}return e}(),e.prototype.getObjectID=function(){function e(){return this._uid}return e}(),e.prototype.setCustomAttribute=function(){function e(e,t){this._custom[e]=t}return e}(),e.prototype.getCustomAttribute=function(){function e(e){return this._custom[e]}return e}(),e.prototype.customAttributeExists=function(){function e(e){return e in this._custom}return e}(),e.prototype.setCustomAttributes=function(){function e(e){var t=Object.prototype.hasOwnProperty,n=this._custom;for(var o in g.sanitizeForInObject(e))t.call(e,o)&&(n[o]=e[o])}return e}(),e.isValidUID=function(){function e(e){return("undefined"==typeof e?"undefined":o(e))===i&&e.length>0}return e}(),e.isValidIndex=function(){function e(e){return("undefined"==typeof e?"undefined":o(e))===a&&e>=0&&(0|e)===e}return e}(),e.isValidCallback=function(){function e(e){return("undefined"==typeof e?"undefined":o(e))===s}return e}(),e}()}],"SeriesMetadata.js":["babel-runtime/helpers/classCallCheck","babel-runtime/helpers/possibleConstructorReturn","babel-runtime/helpers/inherits","./Metadata","./InstanceMetadata",function(e,t,n){n.export({SeriesMetadata:function(){return c}});var o;n.import("babel-runtime/helpers/classCallCheck",{default:function(e){o=e}});var r;n.import("babel-runtime/helpers/possibleConstructorReturn",{default:function(e){r=e}});var i;n.import("babel-runtime/helpers/inherits",{default:function(e){i=e}});var a;n.import("./Metadata",{Metadata:function(e){a=e}});var s;n.import("./InstanceMetadata",{InstanceMetadata:function(e){s=e}});var c=function(e){function t(n,i){o(this,t);var a=r(this,e.call(this,n,i));return Object.defineProperties(a,{_seriesInstanceUID:{configurable:!0,enumerable:!1,writable:!0,value:null},_instances:{configurable:!1,enumerable:!1,writable:!1,value:[]},_firstInstance:{configurable:!1,enumerable:!1,writable:!0,value:null}}),a._definePublicProperties(),a}return i(t,e),t.prototype._definePublicProperties=function(){function e(){Object.defineProperty(this,"seriesInstanceUID",{configurable:!1,enumerable:!1,get:function(){function e(){return this.getSeriesInstanceUID()}return e}()})}return e}(),t.prototype.getSeriesInstanceUID=function(){function e(){return this._seriesInstanceUID}return e}(),t.prototype.addInstance=function(){function e(e){var t=!1;return e instanceof s&&void 0===this.getInstanceByUID(e.getSOPInstanceUID())&&(this._instances.push(e),t=!0),t}return e}(),t.prototype.getFirstInstance=function(){function e(){var e=this._firstInstance;if(!(e instanceof s)){e=null;var t=this.getInstanceByIndex(0);t instanceof s&&(this._firstInstance=t,e=t)}return e}return e}(),t.prototype.getInstanceByIndex=function(){function e(e){var t=void 0;return a.isValidIndex(e)&&(t=this._instances[e]),t}return e}(),t.prototype.getInstanceByUID=function(){function e(e){var t=void 0;return a.isValidUID(e)&&(t=this._instances.find(function(t){return t.getSOPInstanceUID()===e})),t}return e}(),t.prototype.getInstanceCount=function(){function e(){return this._instances.length}return e}(),t.prototype.forEachInstance=function(){function e(e){a.isValidCallback(e)&&this._instances.forEach(function(t,n){e.call(null,t,n)})}return e}(),t.prototype.indexOfInstance=function(){function e(e){return this._instances.indexOf(e)}return e}(),t.prototype.findInstance=function(){function e(e){if(a.isValidCallback(e))return this._instances.find(function(t,n){return e.call(null,t,n)})}return e}(),t.prototype.equals=function(){function e(e){var n=this;return e===n||e instanceof t&&e.getSeriesInstanceUID()===n.getSeriesInstanceUID()}return e}(),t}(a)}],"StudyMetadata.js":["babel-runtime/helpers/classCallCheck","babel-runtime/helpers/possibleConstructorReturn","babel-runtime/helpers/inherits","./Metadata","./SeriesMetadata","./InstanceMetadata","../ImageSet","../OHIFError",function(e,t,n){n.export({StudyMetadata:function(){return d}});var o;n.import("babel-runtime/helpers/classCallCheck",{default:function(e){o=e}});var r;n.import("babel-runtime/helpers/possibleConstructorReturn",{default:function(e){r=e}});var i;n.import("babel-runtime/helpers/inherits",{default:function(e){i=e}});var a;n.import("./Metadata",{Metadata:function(e){a=e}});var s;n.import("./SeriesMetadata",{SeriesMetadata:function(e){s=e}});var c;n.import("./InstanceMetadata",{InstanceMetadata:function(e){c=e}});var u;n.import("../ImageSet",{ImageSet:function(e){u=e}});var l;n.import("../OHIFError",{OHIFError:function(e){l=e}});var d=function(e){function t(n,i){o(this,t);var a=r(this,e.call(this,n,i));return Object.defineProperties(a,{_studyInstanceUID:{configurable:!0,enumerable:!1,writable:!0,value:null},_series:{configurable:!1,enumerable:!1,writable:!1,value:[]},_displaySets:{configurable:!1,enumerable:!1,writable:!1,value:[]},_firstSeries:{configurable:!1,enumerable:!1,writable:!0,value:null},_firstInstance:{configurable:!1,enumerable:!1,writable:!0,value:null}}),a._definePublicProperties(),a}return i(t,e),t.prototype._definePublicProperties=function(){function e(){Object.defineProperty(this,"studyInstanceUID",{configurable:!1,enumerable:!1,get:function(){function e(){return this.getStudyInstanceUID()}return e}()})}return e}(),t.prototype.getDisplaySets=function(){function e(){return this._displaySets.slice()}return e}(),t.prototype.setDisplaySets=function(){function e(e){var t=this;e.forEach(function(e){return t.addDisplaySet(e)})}return e}(),t.prototype.addDisplaySet=function(){function e(e){return e instanceof u&&(this._displaySets.push(e),!0)}return e}(),t.prototype.forEachDisplaySet=function(){function e(e){a.isValidCallback(e)&&this._displaySets.forEach(function(t,n){e.call(null,t,n)})}return e}(),t.prototype.findDisplaySet=function(){function e(e){if(a.isValidCallback(e))return this._displaySets.find(function(t,n){return e.call(null,t,n)})}return e}(),t.prototype.getDisplaySetCount=function(){function e(){return this._displaySets.length}return e}(),t.prototype.getStudyInstanceUID=function(){function e(){return this._studyInstanceUID}return e}(),t.prototype.getSeries=function(){function e(){return this._series.slice()}return e}(),t.prototype.addSeries=function(){function e(e){var t=!1;return e instanceof s&&void 0===this.getSeriesByUID(e.getSeriesInstanceUID())&&(this._series.push(e),t=!0),t}return e}(),t.prototype.getSeriesByIndex=function(){function e(e){var t=void 0;return a.isValidIndex(e)&&(t=this._series[e]),t}return e}(),t.prototype.getSeriesByUID=function(){function e(e){var t=void 0;return a.isValidUID(e)&&(t=this._series.find(function(t){return t.getSeriesInstanceUID()===e})),t}return e}(),t.prototype.getSeriesCount=function(){function e(){return this._series.length}return e}(),t.prototype.getInstanceCount=function(){function e(){return this._series.reduce(function(e,t){return e+t.getInstanceCount()},0)}return e}(),t.prototype.forEachSeries=function(){function e(e){a.isValidCallback(e)&&this._series.forEach(function(t,n){e.call(null,t,n)})}return e}(),t.prototype.indexOfSeries=function(){function e(e){return this._series.indexOf(e)}return e}(),t.prototype.sortSeriesByDisplaySets=function(){function e(){var e=this,t={};this.forEachDisplaySet(function(e,n){if(!(e instanceof u))throw new l("StudyMetadata::sortSeriesByDisplaySets display set at index "+n+" is not an instance of ImageSet");void 0===t[e.seriesInstanceUid]&&(t[e.seriesInstanceUid]=n)});var n=this.getSeries();n.forEach(function(n,o){if(!(n instanceof s))throw new l("StudyMetadata::sortSeriesByDisplaySets series at index "+o+" is not an instance of SeriesMetadata");var r=t[n.getSeriesInstanceUID()];e._series[r]=n})}return e}(),t.prototype.equals=function(){function e(e){var n=this;return e===n||e instanceof t&&e.getStudyInstanceUID()===n.getStudyInstanceUID()}return e}(),t.prototype.getFirstSeries=function(){function e(){var e=this._firstSeries;if(!(e instanceof s)){e=null;var t=this.getSeriesByIndex(0);t instanceof s&&(this._firstSeries=t,e=t)}return e}return e}(),t.prototype.getFirstInstance=function(){function e(){var e=this._firstInstance;if(!(e instanceof c)){e=null;var t=this.getFirstSeries();if(t instanceof s){var n=t.getFirstInstance();n instanceof c&&(this._firstInstance=n,e=n)}}return e}return e}(),t.prototype.findSeriesAndInstanceByInstance=function(){function e(e){var t=this,n=void 0;return a.isValidCallback(e)&&!function(){var o=void 0,r=t._series.find(function(t){return o=t.findInstance(e),o instanceof c});r instanceof s&&(n={series:r,instance:o})}(),n||{}}return e}(),t.prototype.findSeriesByInstance=function(){function e(e){var t=this.findSeriesAndInstanceByInstance(e);return t.series}return e}(),t.prototype.findInstance=function(){function e(e){var t=this.findSeriesAndInstanceByInstance(e);return t.instance}return e}(),t}(a)}],"StudySummary.js":["babel-runtime/helpers/classCallCheck","babel-runtime/helpers/possibleConstructorReturn","babel-runtime/helpers/inherits","./Metadata","../OHIFError","../../DICOMTagDescriptions",function(e,t,n){n.export({StudySummary:function(){return l}});var o;n.import("babel-runtime/helpers/classCallCheck",{default:function(e){o=e}});var r;n.import("babel-runtime/helpers/possibleConstructorReturn",{default:function(e){r=e}});var i;n.import("babel-runtime/helpers/inherits",{default:function(e){i=e}});var a;n.import("./Metadata",{Metadata:function(e){a=e}});var s;n.import("../OHIFError",{OHIFError:function(e){s=e}});var c;n.import("../../DICOMTagDescriptions",{DICOMTagDescriptions:function(e){c=e}});var u="x0020000d",l=function(e){function t(n,i,a){o(this,t);var s=Object.create(null),c=r(this,e.call(this,s,a));return void 0!==n&&c.addTags(n),void 0!==i&&c.setCustomAttributes(i),c}return i(t,e),t.prototype.getStudyInstanceUID=function(){function e(){return this.getTagValue(u)||null}return e}(),t.prototype.addTags=function(){function e(e){var t=Object.prototype.hasOwnProperty,n=this._data;for(var o in g.sanitizeForInObject(e))if(t.call(e,o)){var r=c.find(o);r?n[r.tag]=e[o]:n[o]=e[o]}}return e}(),t.prototype.tagExists=function(){function e(e){var t=this._data,n=c.find(e);return n?n.tag in t:e in t}return e}(),t.prototype.getTagValue=function(){function e(e){var t=this._data,n=c.find(e);return n?t[n.tag]:t[e]}return e}(),t}(a)}],"WadoRsMetaDataBuilder.js":["babel-runtime/helpers/classCallCheck",function(e,t,n){n.export({WadoRsMetaDataBuilder:function(){return r}});var o;n.import("babel-runtime/helpers/classCallCheck",{default:function(e){o=e}});var r=function(){function e(){o(this,e),this.tags={}}return e.prototype.addTag=function(){function e(e,t,n){return this.tags[e]={tag:e,value:t,multi:n},this}return e}(),e.prototype.toJSON=function(){function e(){var e=this,t={},n=Object.keys(this.tags);return n.forEach(function(n){if(e.tags.hasOwnProperty(n)){var o=e.tags[n],r=!!o.multi,i=o.value;null==i||1===i.length&&null==i[0]||("string"==typeof i&&r&&(i=i.split("\\")),O.isArray(i)||(i=[i]),t[n]={Value:i})}}),t}return e}(),e}()}]}},helpers:{"capitalizeFirstLetter.js":["meteor/blaze",function(e,t,n){var o;n.import("meteor/blaze",{Blaze:function(e){o=e}}),o.registerHelper("capitalizeFirstLetter",function(e){if(e)return e.charAt(0).toUpperCase()+e.slice(1)})}],"formatDA.js":["meteor/blaze","meteor/momentjs:moment",function(e,t,n){n.export({formatDA:function(){return i}});var o;n.import("meteor/blaze",{Blaze:function(e){o=e}});var r;n.import("meteor/momentjs:moment",{moment:function(e){r=e}});var i=function e(t,n,o){if(t){var i=r(t,"YYYYMMDD"),a="MMM D, YYYY";return o&&(a=n),i.format(a)}};o._getGlobalHelper("formatDA")||o.registerHelper("formatDA",i)}],"formatJSDate.js":["meteor/blaze","meteor/momentjs:moment",function(e,t,n){var o;n.import("meteor/blaze",{Blaze:function(e){o=e}});var r;n.import("meteor/momentjs:moment",{moment:function(e){r=e}}),o.registerHelper("formatJSDate",function(e,t,n){if(e){var o=r(new Date(e)),i="MMM D, YYYY";return n&&(i=t),o.format(i)}})}],"formatNumberPrecision.js":["meteor/blaze",function(e,t,n){var o;n.import("meteor/blaze",{Blaze:function(e){o=e}}),o.registerHelper("formatNumberPrecision",function(e,t){if(null!=e)return parseFloat(e).toFixed(t);
})}],"formatPN.js":["meteor/blaze",function(e,t,n){n.export({formatPN:function(){return r}});var o;n.import("meteor/blaze",{Blaze:function(e){o=e}});var r=function e(t){if(t)return t.replace("^",", ")};o._getGlobalHelper("formatPN")||o.registerHelper("formatPN",r)}],"formatTM.js":["meteor/blaze","meteor/momentjs:moment",function(e,t,n){n.export({formatTM:function(){return i}});var o;n.import("meteor/blaze",{Blaze:function(e){o=e}});var r;n.import("meteor/momentjs:moment",{moment:function(e){r=e}});var i=function e(t,n){if(t){var o=r(t,"HHmmss.SSS"),i="HH:mm:ss";return n&&n.format&&(i=n.format),o.format(i)}};o._getGlobalHelper("formatTM")||o.registerHelper("formatTM",i)}],"getUsername.js":["meteor/meteor","meteor/blaze",function(e,t,n){var o;n.import("meteor/meteor",{Meteor:function(e){o=e}});var r;n.import("meteor/blaze",{Blaze:function(e){r=e}}),r.registerHelper("getUsername",function(e){var t=o.users.findOne({userId:e});if(t&&t.name)return t.name})}],"ifTypeIs.js":["babel-runtime/helpers/typeof","meteor/blaze",function(e,t,n){var o;n.import("babel-runtime/helpers/typeof",{default:function(e){o=e}});var r;n.import("meteor/blaze",{Blaze:function(e){r=e}}),r.registerHelper("ifTypeIs",function(e,t,n){return("undefined"==typeof e?"undefined":o(e))===t?n:""})}],"inc.js":["meteor/blaze",function(e,t,n){var o;n.import("meteor/blaze",{Blaze:function(e){o=e}}),o.registerHelper("inc",function(e){return parseInt(e)+1})}],"index.js":["./isTouchDevice","./formatPN","./formatDA","./formatTM","./formatJSDate","./jsDateFromNow","./formatNumberPrecision","./inc","./isDisplaySetActive","./getUsername","./capitalizeFirstLetter","./objectToPairs","./objectEach","./ifTypeIs","./prettyPrintStringify","./sorting","./studyThumbnails",function(e,t,n){n.export({helpers:function(){return s}});var o;n.import("./isTouchDevice",{isTouchDevice:function(e){o=e}});var r;n.import("./formatPN",{formatPN:function(e){r=e}});var i;n.import("./formatDA",{formatDA:function(e){i=e}});var a;n.import("./formatTM",{formatTM:function(e){a=e}}),n.import("./formatJSDate"),n.import("./jsDateFromNow"),n.import("./formatNumberPrecision"),n.import("./inc"),n.import("./isDisplaySetActive"),n.import("./getUsername"),n.import("./capitalizeFirstLetter"),n.import("./objectToPairs"),n.import("./objectEach"),n.import("./ifTypeIs"),n.import("./prettyPrintStringify"),n.import("./sorting"),n.import("./studyThumbnails");var s={isTouchDevice:o,formatPN:r,formatDA:i,formatTM:a}}],"isDisplaySetActive.js":["meteor/templating","meteor/session","meteor/jquery","meteor/underscore","meteor/ohif:core","meteor/ohif:viewerbase",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}});var r;n.import("meteor/session",{Session:function(e){r=e}});var i;n.import("meteor/jquery",{$:function(e){i=e}});var a;n.import("meteor/underscore",{_:function(e){a=e}});var s;n.import("meteor/ohif:core",{OHIF:function(e){s=e}}),n.import("meteor/ohif:viewerbase"),o.registerHelper("isDisplaySetActive",function(e,t){if(r.get("LayoutManagerUpdated"),s.viewerbase.layoutManager){var n=!1;if(a.isUndefined(t))for(var o=s.viewerbase.layoutManager.getNumberOfViewports(),i=s.viewerbase.layoutManager.viewportData,c=0;c<o;c++){var u=i[c];if(u&&u.displaySetInstanceUid===e){n=!0;break}}else{var l=s.viewerbase.layoutManager.viewportData[t];l&&l.displaySetInstanceUid===e&&(n=!0)}return n}})}],"isTouchDevice.js":["meteor/blaze",function(e,t,n){n.export({isTouchDevice:function(){return r}});var o;n.import("meteor/blaze",{Blaze:function(e){o=e}});var r=function e(){return"ontouchstart"in window||navigator.MaxTouchPoints>0||navigator.msMaxTouchPoints>0};o.registerHelper("isTouchDevice",r)}],"jsDateFromNow.js":["meteor/blaze","meteor/session","meteor/momentjs:moment",function(e,t,n){var o;n.import("meteor/blaze",{Blaze:function(e){o=e}});var r;n.import("meteor/session",{Session:function(e){r=e}});var i;n.import("meteor/momentjs:moment",{moment:function(e){i=e}}),o.registerHelper("jsDateFromNow",function(e,t,n){if(e){r.get("timeAgoVariable");var o=i(new Date(e));return o.fromNow()}})}],"objectEach.js":["meteor/blaze","meteor/underscore",function(e,t,n){var o;n.import("meteor/blaze",{Blaze:function(e){o=e}});var r;n.import("meteor/underscore",{_:function(e){r=e}}),o.registerHelper("objectEach",function(e){return r.map(e,function(e,t){return r.extend({key:t},e)})})}],"objectToPairs.js":["meteor/blaze","meteor/underscore",function(e,t,n){var o;n.import("meteor/blaze",{Blaze:function(e){o=e}});var r;n.import("meteor/underscore",{_:function(e){r=e}}),o.registerHelper("objectToPairs",function(e){return r.map(e,function(e,t){return{key:t,value:e}})})}],"prettyPrintStringify.js":["meteor/blaze",function(e,t,n){var o;n.import("meteor/blaze",{Blaze:function(e){o=e}}),o.registerHelper("prettyPrintStringify",function(e){if(e){var t=JSON.stringify(e,null,2);return t=t.replace(/['"]+/g,""),t=t.replace("{",""),t=t.replace("}",""),t=t.replace(",","\n")}})}],"sorting.js":["meteor/templating","meteor/underscore",function(e,t,n){function o(e,t){t=t.split(".");for(var n=0;n<t.length;n++){if(!e||!i.has(e,t[n]))return;e=e[t[n]]}return e}var r;n.import("meteor/templating",{Template:function(e){r=e}});var i;n.import("meteor/underscore",{_:function(e){i=e}}),r.registerHelper("sort",function(e,t,n){if(!t)return e;var r=i.groupBy(e,function(e){if(t){var n=o(e,t);if(n)return n}return e}),a=i.sortBy(r,function(e){if(t){var n=o(e[0],t);if(n)return n}return e});return"desc"===n?i.flatten(a.reverse(),!0):i.flatten(a,!0)})}],"studyThumbnails.js":["meteor/templating","meteor/underscore",function(e,t,n){var o;n.import("meteor/templating",{Template:function(e){o=e}});var r;n.import("meteor/underscore",{_:function(e){r=e}}),o.registerHelper("studyThumbnails",function(e){if(e){var t=e.displaySets,n=[];return r.each(t,function(e,t){n.push({thumbnailIndex:t,stack:e})}),n}})}]}}},"main.js":["./namespace.js","./client/",function(e,t,n){n.export({OHIF:function(){return o},Viewerbase:function(){return r}});var o,r;n.import("./namespace.js",{OHIF:function(e){o=e},Viewerbase:function(e){r=e}}),n.import("./client/")}],"namespace.js":["meteor/ohif:core",function(e,t,n){n.export({OHIF:function(){return o},Viewerbase:function(){return r}});var o;n.import("meteor/ohif:core",{OHIF:function(e){o=e}});var r={};o.viewerbase=r}]}}}},{extensions:[".js",".json",".styl",".html"]}),F=function(){function e(e){for(;e;){if("DIALOG"==e.nodeName)return e;e=e.parentElement}return null}var t=window.CustomEvent;t&&"object"!=typeof t||(t=function e(t,n){n=n||{};var o=document.createEvent("CustomEvent");return o.initCustomEvent(t,!!n.bubbles,!!n.cancelable,n.detail||null),o},t.prototype=window.Event.prototype);var n={};n.reposition=function(e){var t=document.body.scrollTop||document.documentElement.scrollTop,n=t+(window.innerHeight-e.offsetHeight)/2;e.style.top=Math.max(0,n)+"px",e.dialogPolyfillInfo.isTopOverridden=!0},n.inNodeList=function(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return!0;return!1},n.isInlinePositionSetByStylesheet=function(e){for(var t=0;t<document.styleSheets.length;++t){var o=document.styleSheets[t],r=null;try{r=o.cssRules}catch(e){}if(r)for(var i=0;i<r.length;++i){var a=r[i],s=null;try{s=document.querySelectorAll(a.selectorText)}catch(e){}if(s&&n.inNodeList(s,e)){var c=a.style.getPropertyValue("top"),u=a.style.getPropertyValue("bottom");if(c&&"auto"!=c||u&&"auto"!=u)return!0}}}return!1},n.needsCentering=function(e){var t=window.getComputedStyle(e);return"absolute"==t.position&&(!("auto"!=e.style.top&&""!=e.style.top||"auto"!=e.style.bottom&&""!=e.style.bottom)&&!n.isInlinePositionSetByStylesheet(e))},n.showDialog=function(e){if(this.open)throw"InvalidStateError: showDialog called on open dialog";if(this.open=!0,this.setAttribute("open","open"),e){var t=null,o=null,r=function(e){if(e.children)for(var n=0;n<e.children.length;n++){var i=e.children[n];if(null!==t||i.disabled||"BUTTON"!=i.nodeName&&"INPUT"!=i.nodeName&&"KEYGEN"!=i.nodeName&&"SELECT"!=i.nodeName&&"TEXTAREA"!=i.nodeName||(t=i),i.autofocus)return void(o=i);if(r(i),null!==o)return}};r(this),null!==o?o.focus():null!==t&&t.focus()}n.needsCentering(this)&&n.reposition(this),e&&(this.dialogPolyfillInfo.modal=!0,n.dm.pushDialog(this));try{null!==o?o.focus():null!==t&&t.focus()}catch(e){}this.style.zoom=1},n.close=function(e){if(!this.open&&!window.HTMLDialogElement)throw"InvalidStateError: close called on closed dialog";this.open=!1,this.removeAttribute("open"),"undefined"!=typeof e&&(this.returnValue=e),this.dialogPolyfillInfo.isTopOverridden&&(this.style.top="auto"),this.dialogPolyfillInfo.modal&&n.dm.removeDialog(this);var t;return document.createEvent?(t=document.createEvent("HTMLEvents"),t.initEvent("close",!0,!0)):t=new Event("close"),this.dispatchEvent(t),this.returnValue},n.registerDialog=function(e){e.show,e.show=n.showDialog.bind(e,!1),e.showModal=n.showDialog.bind(e,!0),e.close=n.close.bind(e),e.dialogPolyfillInfo={},e.open=!1};var o=1e5,r=1e5;return n.DialogManager=function(){this.pendingDialogStack=[],this.overlay=document.createElement("div"),this.overlay.style.width="100%",this.overlay.style.height="100%",this.overlay.style.position="fixed",this.overlay.style.left="0px",this.overlay.style.top="0px",this.overlay.style.backgroundColor="rgba(0,0,0,0.0)",this.focusPageLast=this.createFocusable(),this.overlay.appendChild(this.focusPageLast),this.overlay.addEventListener("click",function(e){var t=document.createEvent("MouseEvents");t.initMouseEvent(e.type,e.bubbles,e.cancelable,window,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget),document.body.dispatchEvent(t)}),document.addEventListener("submit",function(t){var n=t.target.getAttribute("method");if(n=n?n.toLowerCase():"","dialog"==n){t.preventDefault();var o=e(t.target);if(o){var r,i=[document.activeElement,t.explicitOriginalTarget];i.some(function(e){if(e&&"INPUT"==e.nodeName&&e.form==t.target)return r=e.value,!0}),o.close(r)}}},!0)},n.DialogManager.prototype.createFocusable=function(e){var t=document.createElement("span");return t.tabIndex=e||0,t.style.opacity=0,t.style.position="static",t},n.DialogManager.prototype.blockDocument=function(){document.body.contains(this.overlay)||(document.body.appendChild(this.overlay),void 0===this.needsDocumentElementFocus&&(document.documentElement.focus(),this.needsDocumentElementFocus=document.activeElement!=document.documentElement),this.needsDocumentElementFocus&&(document.documentElement.tabIndex=1))},n.DialogManager.prototype.unblockDocument=function(){document.body.removeChild(this.overlay),this.needsDocumentElementFocus&&(document.documentElement.tabIndex="")},n.DialogManager.prototype.updateStacking=function(){if(0==this.pendingDialogStack.length)return void this.unblockDocument();this.blockDocument();for(var e=o,t=0;t<this.pendingDialogStack.length;t++){t==this.pendingDialogStack.length-1&&(this.overlay.style.zIndex=e++);var n=this.pendingDialogStack[t];n.dialogPolyfillInfo.backdrop.style.zIndex=e++,n.style.zIndex=e++}},n.DialogManager.prototype.handleKey=function(e){var n=this.pendingDialogStack.length;if(0!=n){var o=this.pendingDialogStack[n-1],r=o.dialogPolyfillInfo;switch(e.keyCode){case 9:var i=document.activeElement,a=!e.shiftKey;a?i==document.documentElement||i==document.body||i==r.backdrop?r.focusFirst.focus():i==r.focusLast&&r.focusFirst.focus():i==r.focusFirst?r.focusLast.focus():i==this.focusPageLast&&r.focusLast.focus();break;case 27:e.preventDefault(),e.stopPropagation();var s=new t("cancel",{bubbles:!1,cancelable:!0});o.dispatchEvent(s)&&o.close()}}},n.DialogManager.prototype.pushDialog=function(e){if(this.pendingDialogStack.length>=r)throw"Too many modal dialogs";var t=document.createElement("div");t.className="backdrop";var n=function(t){var n=document.createEvent("MouseEvents");n.initMouseEvent(t.type,t.bubbles,t.cancelable,window,t.detail,t.screenX,t.screenY,t.clientX,t.clientY,t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget),e.dispatchEvent(n)};t.addEventListener("click",n),e.parentNode.insertBefore(t,e.nextSibling),e.dialogPolyfillInfo.backdrop=t,e.dialogPolyfillInfo.clickEventListener=n,this.pendingDialogStack.push(e),this.updateStacking(),e.dialogPolyfillInfo.focusFirst=this.createFocusable(),e.dialogPolyfillInfo.focusLast=this.createFocusable(),e.appendChild(e.dialogPolyfillInfo.focusLast),e.insertBefore(e.dialogPolyfillInfo.focusFirst,e.firstChild)},n.DialogManager.prototype.removeDialog=function(e){var t=this.pendingDialogStack.indexOf(e);if(t!=-1){this.pendingDialogStack.splice(t,1);var n=e.dialogPolyfillInfo.backdrop,o=e.dialogPolyfillInfo.clickEventListener;n.removeEventListener("click",o),n.parentNode.removeChild(n),e.dialogPolyfillInfo.backdrop=null,e.dialogPolyfillInfo.clickEventListener=null,this.updateStacking(),e.removeChild(e.dialogPolyfillInfo.focusFirst),e.removeChild(e.dialogPolyfillInfo.focusLast),e.dialogPolyfillInfo.focusFirst=null,e.dialogPolyfillInfo.focusLast=null}},n.dm=new n.DialogManager,document.addEventListener("keydown",n.dm.handleKey.bind(n.dm)),n}();B("./node_modules/meteor/ohif:viewerbase/client/components/basic/layout/template.layout.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/basic/loadingText/template.loadingText.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/basic/removableBackdrop/template.removableBackdrop.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/basic/aboutModal/template.aboutModal.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/basic/aboutModal/aboutModal.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/studyBrowser/studyBrowser/template.studyBrowser.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/studyBrowser/studyBrowser/studyBrowser.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/studyBrowser/thumbnailEntry/template.thumbnailEntry.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/studyBrowser/thumbnailEntry/thumbnailEntry.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/studyBrowser/imageThumbnail/template.imageThumbnail.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/studyBrowser/imageThumbnail/imageThumbnail.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/imageViewerViewport/template.imageViewerViewport.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/imageViewerViewport/imageViewerViewport.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/gridLayout/template.gridLayout.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/gridLayout/gridLayout.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/loadingIndicator/template.loadingIndicator.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/loadingIndicator/loadingIndicator.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/annotationDialogs/template.annotationDialogs.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/annotationDialogs/annotationDialogs.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/viewportOrientationMarkers/template.viewportOrientationMarkers.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/viewportOverlay/template.viewportOverlay.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/viewportOverlay/viewportOverlay.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/viewerMain/template.viewerMain.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/viewerMain/viewerMain.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/imageControls/template.imageControls.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/imageControls/imageControls.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/layoutButton/template.layoutButton.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/layoutButton/layoutButton.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/layoutChooser/template.layoutChooser.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/layoutChooser/layoutChooser.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/cineDialog/template.cineDialog.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/cineDialog/cineDialog.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/toolbarSectionButton/template.toolbarSectionButton.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/toolbarSectionButton/toolbarSectionButton.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/toolbarSectionTools/template.toolbarSectionTools.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/toolbarSectionTools/toolbarSectionTools.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/confirmDeleteDialog/template.confirmDeleteDialog.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/confirmDeleteDialog/confirmDeleteDialog.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/textMarkerDialogs/template.textMarkerDialogs.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/textMarkerDialogs/textMarkerDialogs.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/studySeriesQuickSwitch/template.studySeriesQuickSwitch.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/studySeriesQuickSwitch/studySeriesQuickSwitch.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/studyTimepointBrowser/template.studyTimepoint.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/studyTimepointBrowser/studyTimepoint.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/studyTimepointBrowser/template.studyTimepointBrowser.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/studyTimepointBrowser/studyTimepointBrowser.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/studyTimepointBrowser/template.studyTimepointStudy.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/studyTimepointBrowser/studyTimepointStudy.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/windowLevelPresets/template.form.js"),B("./node_modules/meteor/ohif:viewerbase/client/components/viewer/windowLevelPresets/form.js");var U=B("./node_modules/meteor/ohif:viewerbase/main.js");"undefined"==typeof Package&&(Package={}),function(e,t){for(var n in t)n in e||(e[n]=t[n])}(Package["ohif:viewerbase"]=U,{dialogPolyfill:F})}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,a=Package.meteor.meteorEnv,n=Package["ohif:viewerbase"].dialogPolyfill,r=Package.modules.meteorInstall,i=Package.modules.Buffer,s=Package.modules.process,o=Package["ecmascript-runtime"].Symbol,u=Package["ecmascript-runtime"].Map,c=Package["ecmascript-runtime"].Set,l=Package["babel-runtime"].meteorBabelHelpers,m=Package.promise.Promise,f=r({node_modules:{meteor:{"ohif:metadata":{"main.js":["./namespace.js","./client/",function(e,t,a){a.export({OHIF:function(){return n},Metadata:function(){return r}});var n,r;a.import("./namespace.js",{OHIF:function(e){n=e},Metadata:function(e){r=e}}),a.import("./client/")}],"namespace.js":["meteor/ohif:core",function(e,t,a){a.export({OHIF:function(){return n},Metadata:function(){return r}});var n;a.import("meteor/ohif:core",{OHIF:function(e){n=e}});var r={};n.metadata=r}],client:{"OHIFInstanceMetadata.js":["babel-runtime/helpers/classCallCheck","babel-runtime/helpers/possibleConstructorReturn","babel-runtime/helpers/inherits","meteor/ohif:viewerbase",function(e,t,a){a.export({OHIFInstanceMetadata:function(){return c}});var n;a.import("babel-runtime/helpers/classCallCheck",{default:function(e){n=e}});var r;a.import("babel-runtime/helpers/possibleConstructorReturn",{default:function(e){r=e}});var i;a.import("babel-runtime/helpers/inherits",{default:function(e){i=e}});var s;a.import("meteor/ohif:viewerbase",{Viewerbase:function(e){s=e}});var o=s.metadata.InstanceMetadata,u=s.DICOMTagDescriptions,c=function(e){function t(a,i,s,o){n(this,t);var u=r(this,e.call(this,a,o));return u.init(i,s),u}return i(t,e),t.prototype.init=function(){function e(e,t){var a=this.getData();Object.defineProperties(this,{_sopInstanceUID:{configurable:!1,enumerable:!1,writable:!1,value:a.sopInstanceUid},_study:{configurable:!1,enumerable:!1,writable:!1,value:t},_series:{configurable:!1,enumerable:!1,writable:!1,value:e},_instance:{configurable:!1,enumerable:!1,writable:!1,value:a},_cache:{configurable:!1,enumerable:!1,writable:!1,value:Object.create(null)}})}return e}(),t.prototype.getTagValue=function(){function e(e,a,n){if(e in this._cache&&n!==!0)return this._cache[e];var r=t.getPropertyName(e),i=void 0;return r in this._instance?i=this._instance[r]:r in this._series?i=this._series[r]:r in this._study&&(i=this._study[r]),void 0!==i?(this._cache[e]=i,i):a}return e}(),t.prototype.tagExists=function(){function e(e){var a=t.getPropertyName(e);return a in this._instance||a in this._series||a in this._study}return e}(),t.prototype.getImageId=function(){function e(e,t){return null===this._imageId&&(this._imageId=s.getImageId(this.getData(),e,t)),this._imageId}return e}(),t.getPropertyName=function(){function e(e){var t=void 0,a=u.find(e);return void 0!==a&&(t=a.keyword.replace(/^SOP/,"sop").replace(/UID$/,"Uid").replace(/ID$/,"Id"),t=t.charAt(0).toLowerCase()+t.substr(1)),t}return e}(),t}(o)}],"OHIFSeriesMetadata.js":["babel-runtime/helpers/classCallCheck","babel-runtime/helpers/possibleConstructorReturn","babel-runtime/helpers/inherits","meteor/ohif:viewerbase","./OHIFInstanceMetadata",function(e,t,a){a.export({OHIFSeriesMetadata:function(){return u}});var n;a.import("babel-runtime/helpers/classCallCheck",{default:function(e){n=e}});var r;a.import("babel-runtime/helpers/possibleConstructorReturn",{default:function(e){r=e}});var i;a.import("babel-runtime/helpers/inherits",{default:function(e){i=e}});var s;a.import("meteor/ohif:viewerbase",{Viewerbase:function(e){s=e}});var o;a.import("./OHIFInstanceMetadata",{OHIFInstanceMetadata:function(e){o=e}});var u=function(e){function t(a,i,s){n(this,t);var o=r(this,e.call(this,a,s));return o.init(i),o}return i(t,e),t.prototype.init=function(){function e(e){var t=this,a=this.getData();Object.defineProperty(this,"_seriesInstanceUID",{configurable:!1,enumerable:!1,writable:!1,value:a.seriesInstanceUid}),a.instances.forEach(function(n){t.addInstance(new o(n,a,e))})}return e}(),t}(s.metadata.SeriesMetadata)}],"OHIFStudyMetadata.js":["babel-runtime/helpers/classCallCheck","babel-runtime/helpers/possibleConstructorReturn","babel-runtime/helpers/inherits","meteor/ohif:viewerbase","./OHIFSeriesMetadata",function(e,t,a){a.export({OHIFStudyMetadata:function(){return u}});var n;a.import("babel-runtime/helpers/classCallCheck",{default:function(e){n=e}});var r;a.import("babel-runtime/helpers/possibleConstructorReturn",{default:function(e){r=e}});var i;a.import("babel-runtime/helpers/inherits",{default:function(e){i=e}});var s;a.import("meteor/ohif:viewerbase",{Viewerbase:function(e){s=e}});var o;a.import("./OHIFSeriesMetadata",{OHIFSeriesMetadata:function(e){o=e}});var u=function(e){function t(a,i){n(this,t);var s=r(this,e.call(this,a,i));return s.init(),s}return i(t,e),t.prototype.init=function(){function e(){var e=this,t=this.getData();Object.defineProperty(this,"_studyInstanceUID",{configurable:!1,enumerable:!1,writable:!1,value:t.studyInstanceUid}),t.seriesList.forEach(function(a){e.addSeries(new o(a,t))})}return e}(),t}(s.metadata.StudyMetadata)}],"index.js":["../namespace","./OHIFStudyMetadata","./OHIFSeriesMetadata","./OHIFInstanceMetadata",function(e,t,a){var n;a.import("../namespace",{Metadata:function(e){n=e}});var r;a.import("./OHIFStudyMetadata",{OHIFStudyMetadata:function(e){r=e}});var i;a.import("./OHIFSeriesMetadata",{OHIFSeriesMetadata:function(e){i=e}});var s;a.import("./OHIFInstanceMetadata",{OHIFInstanceMetadata:function(e){s=e}}),n.StudyMetadata=r,n.SeriesMetadata=i,n.InstanceMetadata=s}]}}}}},{extensions:[".js",".json"]}),d=f("./node_modules/meteor/ohif:metadata/main.js");"undefined"==typeof Package&&(Package={}),Package["ohif:metadata"]=d}();
!function(){var t=Package.meteor.Meteor,e=Package.meteor.global,r=Package.meteor.meteorEnv,n;(function(){(function(){!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r;"undefined"!=typeof window?r=window:"undefined"!=typeof e?r=e:"undefined"!=typeof self&&(r=self),r.JSZip=t()}}(function(){var t,e,r;return function t(e,r,n){function i(s,o){if(!r[s]){if(!e[s]){var d="function"==typeof require&&require;if(!o&&d)return d(s,!0);if(a)return a(s,!0);throw new Error("Cannot find module '"+s+"'")}var l=r[s]={exports:{}};e[s][0].call(l.exports,function(t){var r=e[s][1][t];return i(r?r:t)},l,l.exports,t,e,r,n)}return r[s].exports}for(var a="function"==typeof require&&require,s=0;s<n.length;s++)i(n[s]);return i}({1:[function(t,e,r){"use strict";var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.encode=function(t,e){for(var r="",i,a,s,o,d,l,h,f=0;f<t.length;)i=t.charCodeAt(f++),a=t.charCodeAt(f++),s=t.charCodeAt(f++),o=i>>2,d=(3&i)<<4|a>>4,l=(15&a)<<2|s>>6,h=63&s,isNaN(a)?l=h=64:isNaN(s)&&(h=64),r=r+n.charAt(o)+n.charAt(d)+n.charAt(l)+n.charAt(h);return r},r.decode=function(t,e){var r="",i,a,s,o,d,l,h,f=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");f<t.length;)o=n.indexOf(t.charAt(f++)),d=n.indexOf(t.charAt(f++)),l=n.indexOf(t.charAt(f++)),h=n.indexOf(t.charAt(f++)),i=o<<2|d>>4,a=(15&d)<<4|l>>2,s=(3&l)<<6|h,r+=String.fromCharCode(i),64!=l&&(r+=String.fromCharCode(a)),64!=h&&(r+=String.fromCharCode(s));return r}},{}],2:[function(t,e,r){"use strict";function n(){this.compressedSize=0,this.uncompressedSize=0,this.crc32=0,this.compressionMethod=null,this.compressedContent=null}n.prototype={getContent:function(){return null},getCompressedContent:function(){return null}},e.exports=n},{}],3:[function(t,e,r){"use strict";r.STORE={magic:"\0\0",compress:function(t,e){return t},uncompress:function(t){return t},compressInputType:null,uncompressInputType:null},r.DEFLATE=t("./flate")},{"./flate":8}],4:[function(t,e,r){"use strict";var n=t("./utils"),i=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];e.exports=function t(e,r){if("undefined"==typeof e||!e.length)return 0;var a="string"!==n.getTypeOf(e);"undefined"==typeof r&&(r=0);var s=0,o=0,d=0;r^=-1;for(var l=0,h=e.length;l<h;l++)d=a?e[l]:e.charCodeAt(l),o=255&(r^d),s=i[o],r=r>>>8^s;return r^-1}},{"./utils":21}],5:[function(t,e,r){"use strict";function n(t){this.data=null,this.length=0,this.index=0}var i=t("./utils");n.prototype={checkOffset:function(t){this.checkIndex(this.index+t)},checkIndex:function(t){if(this.length<t||t<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+t+"). Corrupted zip ?")},setIndex:function(t){this.checkIndex(t),this.index=t},skip:function(t){this.setIndex(this.index+t)},byteAt:function(t){},readInt:function(t){var e=0,r;for(this.checkOffset(t),r=this.index+t-1;r>=this.index;r--)e=(e<<8)+this.byteAt(r);return this.index+=t,e},readString:function(t){return i.transformTo("string",this.readData(t))},readData:function(t){},lastIndexOfSignature:function(t){},readDate:function(){var t=this.readInt(4);return new Date((t>>25&127)+1980,(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1)}},e.exports=n},{"./utils":21}],6:[function(t,e,r){"use strict";r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!1,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],7:[function(t,e,r){"use strict";var n=t("./utils");r.string2binary=function(t){return n.string2binary(t)},r.string2Uint8Array=function(t){return n.transformTo("uint8array",t)},r.uint8Array2String=function(t){return n.transformTo("string",t)},r.string2Blob=function(t){var e=n.transformTo("arraybuffer",t);return n.arrayBuffer2Blob(e)},r.arrayBuffer2Blob=function(t){return n.arrayBuffer2Blob(t)},r.transformTo=function(t,e){return n.transformTo(t,e)},r.getTypeOf=function(t){return n.getTypeOf(t)},r.checkSupport=function(t){return n.checkSupport(t)},r.MAX_VALUE_16BITS=n.MAX_VALUE_16BITS,r.MAX_VALUE_32BITS=n.MAX_VALUE_32BITS,r.pretty=function(t){return n.pretty(t)},r.findCompression=function(t){return n.findCompression(t)},r.isRegExp=function(t){return n.isRegExp(t)}},{"./utils":21}],8:[function(t,e,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=t("pako");r.uncompressInputType=n?"uint8array":"array",r.compressInputType=n?"uint8array":"array",r.magic="\b\0",r.compress=function(t,e){return i.deflateRaw(t,{level:e.level||-1})},r.uncompress=function(t){return i.inflateRaw(t)}},{pako:24}],9:[function(t,e,r){"use strict";function n(t,e){return this instanceof n?(this.files={},this.comment=null,this.root="",t&&this.load(t,e),void(this.clone=function(){var t=new n;for(var e in this)"function"!=typeof this[e]&&(t[e]=this[e]);return t})):new n(t,e)}var i=t("./base64");n.prototype=t("./object"),n.prototype.load=t("./load"),n.support=t("./support"),n.defaults=t("./defaults"),n.utils=t("./deprecatedPublicUtils"),n.base64={encode:function(t){return i.encode(t)},decode:function(t){return i.decode(t)}},n.compressions=t("./compressions"),e.exports=n},{"./base64":1,"./compressions":3,"./defaults":6,"./deprecatedPublicUtils":7,"./load":10,"./object":13,"./support":17}],10:[function(t,e,r){"use strict";var n=t("./base64"),i=t("./zipEntries");e.exports=function(t,e){var r,a,s,o;for(e=e||{},e.base64&&(t=n.decode(t)),a=new i(t,e),r=a.files,s=0;s<r.length;s++)o=r[s],this.file(o.fileName,o.decompressed,{binary:!0,optimizedBinaryString:!0,date:o.date,dir:o.dir,comment:o.fileComment.length?o.fileComment:null,unixPermissions:o.unixPermissions,dosPermissions:o.dosPermissions,createFolders:e.createFolders});return a.zipComment.length&&(this.comment=a.zipComment),this}},{"./base64":1,"./zipEntries":22}],11:[function(t,e,r){(function(t){"use strict";e.exports=function(e,r){return new t(e,r)},e.exports.test=function(e){return t.isBuffer(e)}}).call(this,"undefined"!=typeof Buffer?Buffer:void 0)},{}],12:[function(t,e,r){"use strict";function n(t){this.data=t,this.length=this.data.length,this.index=0}var i=t("./uint8ArrayReader");n.prototype=new i,n.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.index,this.index+t);return this.index+=t,e},e.exports=n},{"./uint8ArrayReader":18}],13:[function(t,e,r){"use strict";var n=t("./support"),i=t("./utils"),a=t("./crc32"),s=t("./signature"),o=t("./defaults"),d=t("./base64"),l=t("./compressions"),h=t("./compressedObject"),f=t("./nodeBuffer"),u=t("./utf8"),c=t("./stringWriter"),p=t("./uint8ArrayWriter"),_=function(t){if(t._data instanceof h&&(t._data=t._data.getContent(),t.options.binary=!0,t.options.base64=!1,"uint8array"===i.getTypeOf(t._data))){var e=t._data;t._data=new Uint8Array(e.length),0!==e.length&&t._data.set(e,0)}return t._data},m=function(t){var e=_(t),r=i.getTypeOf(e);return"string"===r?!t.options.binary&&n.nodebuffer?f(e,"utf-8"):t.asBinary():e},g=function(t){var e=_(this);return null===e||"undefined"==typeof e?"":(this.options.base64&&(e=d.decode(e)),e=t&&this.options.binary?B.utf8decode(e):i.transformTo("string",e),t||this.options.binary||(e=i.transformTo("string",B.utf8encode(e))),e)},b=function(t,e,r){this.name=t,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=e,this.options=r,this._initialMetadata={dir:r.dir,date:r.date}};b.prototype={asText:function(){return g.call(this,!0)},asBinary:function(){return g.call(this,!1)},asNodeBuffer:function(){var t=m(this);return i.transformTo("nodebuffer",t)},asUint8Array:function(){var t=m(this);return i.transformTo("uint8array",t)},asArrayBuffer:function(){return this.asUint8Array().buffer}};var w=function(t,e){var r="",n;for(n=0;n<e;n++)r+=String.fromCharCode(255&t),t>>>=8;return r},v=function(){var t={},e,r;for(e=0;e<arguments.length;e++)for(r in arguments[e])arguments[e].hasOwnProperty(r)&&"undefined"==typeof t[r]&&(t[r]=arguments[e][r]);return t},y=function(t){return t=t||{},t.base64!==!0||null!==t.binary&&void 0!==t.binary||(t.binary=!0),t=v(t,o),t.date=t.date||new Date,null!==t.compression&&(t.compression=t.compression.toUpperCase()),t},k=function(t,e,r){var n=i.getTypeOf(e),a;if(r=y(r),"string"==typeof r.unixPermissions&&(r.unixPermissions=parseInt(r.unixPermissions,8)),r.unixPermissions&&16384&r.unixPermissions&&(r.dir=!0),r.dosPermissions&&16&r.dosPermissions&&(r.dir=!0),r.dir&&(t=z(t)),r.createFolders&&(a=x(t))&&A.call(this,a,!0),r.dir||null===e||"undefined"==typeof e)r.base64=!1,r.binary=!1,e=null,n=null;else if("string"===n)r.binary&&!r.base64&&r.optimizedBinaryString!==!0&&(e=i.string2binary(e));else{if(r.base64=!1,r.binary=!0,!(n||e instanceof h))throw new Error("The data of '"+t+"' is in an unsupported format !");"arraybuffer"===n&&(e=i.transformTo("uint8array",e))}var s=new b(t,e,r);return this.files[t]=s,s},x=function(t){"/"==t.slice(-1)&&(t=t.substring(0,t.length-1));var e=t.lastIndexOf("/");return e>0?t.substring(0,e):""},z=function(t){return"/"!=t.slice(-1)&&(t+="/"),t},A=function(t,e){return e="undefined"!=typeof e&&e,t=z(t),this.files[t]||k.call(this,t,null,{dir:!0,createFolders:e}),this.files[t]},E=function(t,e,r){var n=new h,s;return t._data instanceof h?(n.uncompressedSize=t._data.uncompressedSize,n.crc32=t._data.crc32,0===n.uncompressedSize||t.dir?(e=l.STORE,n.compressedContent="",n.crc32=0):t._data.compressionMethod===e.magic?n.compressedContent=t._data.getCompressedContent():(s=t._data.getContent(),n.compressedContent=e.compress(i.transformTo(e.compressInputType,s),r))):(s=m(t),s&&0!==s.length&&!t.dir||(e=l.STORE,s=""),n.uncompressedSize=s.length,n.crc32=a(s),n.compressedContent=e.compress(i.transformTo(e.compressInputType,s),r)),n.compressedSize=n.compressedContent.length,n.compressionMethod=e.magic,n},S=function(t,e){var r=t;return t||(r=e?16893:33204),(65535&r)<<16},C=function(t,e){return 63&(t||0)},I=function(t,e,r,n,o){var d=r.compressedContent,l=i.transformTo("string",u.utf8encode(e.name)),h=e.comment||"",f=i.transformTo("string",u.utf8encode(h)),c=l.length!==e.name.length,p=f.length!==h.length,_=e.options,m,g,b="",v="",y="",k,x;k=e._initialMetadata.dir!==e.dir?e.dir:_.dir,x=e._initialMetadata.date!==e.date?e.date:_.date;var z=0,A=0;k&&(z|=16),"UNIX"===o?(A=798,z|=S(e.unixPermissions,k)):(A=20,z|=C(e.dosPermissions,k)),m=x.getHours(),m<<=6,m|=x.getMinutes(),m<<=5,m|=x.getSeconds()/2,g=x.getFullYear()-1980,g<<=4,g|=x.getMonth()+1,g<<=5,g|=x.getDate(),c&&(v=w(1,1)+w(a(l),4)+l,b+="up"+w(v.length,2)+v),p&&(y=w(1,1)+w(this.crc32(f),4)+f,b+="uc"+w(y.length,2)+y);var E="";E+="\n\0",E+=c||p?"\0\b":"\0\0",E+=r.compressionMethod,E+=w(m,2),E+=w(g,2),E+=w(r.crc32,4),E+=w(r.compressedSize,4),E+=w(r.uncompressedSize,4),E+=w(l.length,2),E+=w(b.length,2);var I=s.LOCAL_FILE_HEADER+E+l+b,B=s.CENTRAL_FILE_HEADER+w(A,2)+E+w(f.length,2)+"\0\0\0\0"+w(z,4)+w(n,4)+l+b+f;return{fileRecord:I,dirRecord:B,compressedObject:r}},B={load:function(t,e){throw new Error("Load method is not defined. Is the file jszip-load.js included ?")},filter:function(t){var e=[],r,n,i,a;for(r in this.files)this.files.hasOwnProperty(r)&&(i=this.files[r],a=new b(i.name,i._data,v(i.options)),n=r.slice(this.root.length,r.length),r.slice(0,this.root.length)===this.root&&t(n,a)&&e.push(a));return e},file:function(t,e,r){if(1===arguments.length){if(i.isRegExp(t)){var n=t;return this.filter(function(t,e){return!e.dir&&n.test(t)})}return this.filter(function(e,r){return!r.dir&&e===t})[0]||null}return t=this.root+t,k.call(this,t,e,r),this},folder:function(t){if(!t)return this;if(i.isRegExp(t))return this.filter(function(e,r){return r.dir&&t.test(e)});var e=this.root+t,r=A.call(this,e),n=this.clone();return n.root=r.name,n},remove:function(t){t=this.root+t;var e=this.files[t];if(e||("/"!=t.slice(-1)&&(t+="/"),e=this.files[t]),e&&!e.dir)delete this.files[t];else for(var r=this.filter(function(e,r){return r.name.slice(0,t.length)===t}),n=0;n<r.length;n++)delete this.files[r[n].name];return this},generate:function(t){t=v(t||{},{base64:!0,compression:"STORE",compressionOptions:null,type:"base64",platform:"DOS",comment:null,mimeType:"application/zip"}),i.checkSupport(t.type),"darwin"!==t.platform&&"freebsd"!==t.platform&&"linux"!==t.platform&&"sunos"!==t.platform||(t.platform="UNIX"),"win32"===t.platform&&(t.platform="DOS");var e=[],r=0,n=0,a,o,h=i.transformTo("string",this.utf8encode(t.comment||this.comment||""));for(var f in this.files)if(this.files.hasOwnProperty(f)){var u=this.files[f],_=u.options.compression||t.compression.toUpperCase(),m=l[_];if(!m)throw new Error(_+" is not a valid compression method !");var g=u.options.compressionOptions||t.compressionOptions||{},b=E.call(this,u,m,g),y=I.call(this,f,u,b,r,t.platform);r+=y.fileRecord.length+b.compressedSize,n+=y.dirRecord.length,e.push(y)}var k="";k=s.CENTRAL_DIRECTORY_END+"\0\0\0\0"+w(e.length,2)+w(e.length,2)+w(n,4)+w(r,4)+w(h.length,2)+h;var x=t.type.toLowerCase();for(a="uint8array"===x||"arraybuffer"===x||"blob"===x||"nodebuffer"===x?new p(r+n+k.length):new c(r+n+k.length),o=0;o<e.length;o++)a.append(e[o].fileRecord),a.append(e[o].compressedObject.compressedContent);for(o=0;o<e.length;o++)a.append(e[o].dirRecord);a.append(k);var z=a.finalize();switch(t.type.toLowerCase()){case"uint8array":case"arraybuffer":case"nodebuffer":return i.transformTo(t.type.toLowerCase(),z);case"blob":return i.arrayBuffer2Blob(i.transformTo("arraybuffer",z),t.mimeType);case"base64":return t.base64?d.encode(z):z;default:return z}},crc32:function(t,e){return a(t,e)},utf8encode:function(t){return i.transformTo("string",u.utf8encode(t))},utf8decode:function(t){return u.utf8decode(t)}};e.exports=B},{"./base64":1,"./compressedObject":2,"./compressions":3,"./crc32":4,"./defaults":6,"./nodeBuffer":11,"./signature":14,"./stringWriter":16,"./support":17,"./uint8ArrayWriter":19,"./utf8":20,"./utils":21}],14:[function(t,e,r){"use strict";r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\b"},{}],15:[function(t,e,r){"use strict";function n(t,e){this.data=t,e||(this.data=a.string2binary(this.data)),this.length=this.data.length,this.index=0}var i=t("./dataReader"),a=t("./utils");n.prototype=new i,n.prototype.byteAt=function(t){return this.data.charCodeAt(t)},n.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)},n.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.index,this.index+t);return this.index+=t,e},e.exports=n},{"./dataReader":5,"./utils":21}],16:[function(t,e,r){"use strict";var n=t("./utils"),i=function(){this.data=[]};i.prototype={append:function(t){t=n.transformTo("string",t),this.data.push(t)},finalize:function(){return this.data.join("")}},e.exports=i},{"./utils":21}],17:[function(t,e,r){(function(t){"use strict";if(r.base64=!0,r.array=!0,r.string=!0,r.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,r.nodebuffer="undefined"!=typeof t,r.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)r.blob=!1;else{var e=new ArrayBuffer(0);try{r.blob=0===new Blob([e],{type:"application/zip"}).size}catch(t){try{var n=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,i=new n;i.append(e),r.blob=0===i.getBlob("application/zip").size}catch(t){r.blob=!1}}}}).call(this,"undefined"!=typeof Buffer?Buffer:void 0)},{}],18:[function(t,e,r){"use strict";function n(t){t&&(this.data=t,this.length=this.data.length,this.index=0)}var i=t("./dataReader");n.prototype=new i,n.prototype.byteAt=function(t){return this.data[t]},n.prototype.lastIndexOfSignature=function(t){for(var e=t.charCodeAt(0),r=t.charCodeAt(1),n=t.charCodeAt(2),i=t.charCodeAt(3),a=this.length-4;a>=0;--a)if(this.data[a]===e&&this.data[a+1]===r&&this.data[a+2]===n&&this.data[a+3]===i)return a;return-1},n.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.index,this.index+t);return this.index+=t,e},e.exports=n},{"./dataReader":5}],19:[function(t,e,r){"use strict";var n=t("./utils"),i=function(t){this.data=new Uint8Array(t),this.index=0};i.prototype={append:function(t){0!==t.length&&(t=n.transformTo("uint8array",t),this.data.set(t,this.index),this.index+=t.length)},finalize:function(){return this.data}},e.exports=i},{"./utils":21}],20:[function(t,e,r){"use strict";for(var n=t("./utils"),i=t("./support"),a=t("./nodeBuffer"),s=new Array(256),o=0;o<256;o++)s[o]=o>=252?6:o>=248?5:o>=240?4:o>=224?3:o>=192?2:1;s[254]=s[254]=1;var d=function(t){var e,r,n,a,s,o=t.length,d=0;for(a=0;a<o;a++)r=t.charCodeAt(a),55296===(64512&r)&&a+1<o&&(n=t.charCodeAt(a+1),56320===(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),a++)),d+=r<128?1:r<2048?2:r<65536?3:4;for(e=i.uint8array?new Uint8Array(d):new Array(d),s=0,a=0;s<d;a++)r=t.charCodeAt(a),55296===(64512&r)&&a+1<o&&(n=t.charCodeAt(a+1),56320===(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),a++)),r<128?e[s++]=r:r<2048?(e[s++]=192|r>>>6,e[s++]=128|63&r):r<65536?(e[s++]=224|r>>>12,e[s++]=128|r>>>6&63,e[s++]=128|63&r):(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63,e[s++]=128|r>>>6&63,e[s++]=128|63&r);return e},l=function(t,e){var r;for(e=e||t.length,e>t.length&&(e=t.length),r=e-1;r>=0&&128===(192&t[r]);)r--;return r<0?e:0===r?e:r+s[t[r]]>e?r:e},h=function(t){var e,r,i,a,o,d=t.length,l=new Array(2*d);for(i=0,r=0;r<d;)if(a=t[r++],a<128)l[i++]=a;else if(o=s[a],o>4)l[i++]=65533,r+=o-1;else{for(a&=2===o?31:3===o?15:7;o>1&&r<d;)a=a<<6|63&t[r++],o--;o>1?l[i++]=65533:a<65536?l[i++]=a:(a-=65536,l[i++]=55296|a>>10&1023,l[i++]=56320|1023&a)}return l.length!==i&&(l.subarray?l=l.subarray(0,i):l.length=i),n.applyFromCharCode(l)};r.utf8encode=function t(e){return i.nodebuffer?a(e,"utf-8"):d(e)},r.utf8decode=function t(e){if(i.nodebuffer)return n.transformTo("nodebuffer",e).toString("utf-8");e=n.transformTo(i.uint8array?"uint8array":"array",e);for(var r=[],a=0,s=e.length,o=65536;a<s;){var d=l(e,Math.min(a+o,s));i.uint8array?r.push(h(e.subarray(a,d))):r.push(h(e.slice(a,d))),a=d}return r.join("")}},{"./nodeBuffer":11,"./support":17,"./utils":21}],21:[function(t,e,r){"use strict";function n(t){return t}function i(t,e){for(var r=0;r<t.length;++r)e[r]=255&t.charCodeAt(r);return e}function a(t){var e=65536,n=[],i=t.length,a=r.getTypeOf(t),s=0,o=!0;try{switch(a){case"uint8array":String.fromCharCode.apply(null,new Uint8Array(0));break;case"nodebuffer":String.fromCharCode.apply(null,l(0))}}catch(t){o=!1}if(!o){for(var d="",h=0;h<t.length;h++)d+=String.fromCharCode(t[h]);return d}for(;s<i&&e>1;)try{"array"===a||"nodebuffer"===a?n.push(String.fromCharCode.apply(null,t.slice(s,Math.min(s+e,i)))):n.push(String.fromCharCode.apply(null,t.subarray(s,Math.min(s+e,i)))),s+=e}catch(t){e=Math.floor(e/2)}return n.join("")}function s(t,e){for(var r=0;r<t.length;r++)e[r]=t[r];return e}var o=t("./support"),d=t("./compressions"),l=t("./nodeBuffer");r.string2binary=function(t){for(var e="",r=0;r<t.length;r++)e+=String.fromCharCode(255&t.charCodeAt(r));return e},r.arrayBuffer2Blob=function(t,e){r.checkSupport("blob"),e=e||"application/zip";try{return new Blob([t],{type:e})}catch(r){try{var n=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,i=new n;return i.append(t),i.getBlob(e)}catch(t){throw new Error("Bug : can't construct the Blob.")}}},r.applyFromCharCode=a;var h={};h.string={string:n,array:function(t){return i(t,new Array(t.length))},arraybuffer:function(t){return h.string.uint8array(t).buffer},uint8array:function(t){return i(t,new Uint8Array(t.length))},nodebuffer:function(t){return i(t,l(t.length))}},h.array={string:a,array:n,arraybuffer:function(t){return new Uint8Array(t).buffer},uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return l(t)}},h.arraybuffer={string:function(t){return a(new Uint8Array(t))},array:function(t){return s(new Uint8Array(t),new Array(t.byteLength))},arraybuffer:n,uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return l(new Uint8Array(t))}},h.uint8array={string:a,array:function(t){return s(t,new Array(t.length))},arraybuffer:function(t){return t.buffer},uint8array:n,nodebuffer:function(t){return l(t)}},h.nodebuffer={string:a,array:function(t){return s(t,new Array(t.length))},arraybuffer:function(t){return h.nodebuffer.uint8array(t).buffer},uint8array:function(t){return s(t,new Uint8Array(t.length))},nodebuffer:n},r.transformTo=function(t,e){if(e||(e=""),!t)return e;r.checkSupport(t);var n=r.getTypeOf(e),i=h[n][t](e);return i},r.getTypeOf=function(t){return"string"==typeof t?"string":"[object Array]"===Object.prototype.toString.call(t)?"array":o.nodebuffer&&l.test(t)?"nodebuffer":o.uint8array&&t instanceof Uint8Array?"uint8array":o.arraybuffer&&t instanceof ArrayBuffer?"arraybuffer":void 0},r.checkSupport=function(t){var e=o[t.toLowerCase()];if(!e)throw new Error(t+" is not supported by this browser")},r.MAX_VALUE_16BITS=65535,r.MAX_VALUE_32BITS=-1,r.pretty=function(t){var e="",r,n;for(n=0;n<(t||"").length;n++)r=t.charCodeAt(n),e+="\\x"+(r<16?"0":"")+r.toString(16).toUpperCase();return e},r.findCompression=function(t){for(var e in d)if(d.hasOwnProperty(e)&&d[e].magic===t)return d[e];return null},r.isRegExp=function(t){return"[object RegExp]"===Object.prototype.toString.call(t)}},{"./compressions":3,"./nodeBuffer":11,"./support":17}],22:[function(t,e,r){"use strict";function n(t,e){this.files=[],this.loadOptions=e,t&&this.load(t)}var i=t("./stringReader"),a=t("./nodeBufferReader"),s=t("./uint8ArrayReader"),o=t("./utils"),d=t("./signature"),l=t("./zipEntry"),h=t("./support"),f=t("./object");n.prototype={checkSignature:function(t){var e=this.reader.readString(4);if(e!==t)throw new Error("Corrupted zip or bug : unexpected signature ("+o.pretty(e)+", expected "+o.pretty(t)+")")},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2),this.zipComment=this.reader.readString(this.zipCommentLength),this.zipComment=f.utf8decode(this.zipComment)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.versionMadeBy=this.reader.readString(2),this.versionNeeded=this.reader.readInt(2),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var t=this.zip64EndOfCentralSize-44,e=0,r,n,i;e<t;)r=this.reader.readInt(2),n=this.reader.readInt(4),i=this.reader.readString(n),this.zip64ExtensibleData[r]={id:r,length:n,value:i}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var t,e;for(t=0;t<this.files.length;t++)e=this.files[t],this.reader.setIndex(e.localHeaderOffset),this.checkSignature(d.LOCAL_FILE_HEADER),e.readLocalPart(this.reader),e.handleUTF8(),e.processAttributes()},readCentralDir:function(){var t;for(this.reader.setIndex(this.centralDirOffset);this.reader.readString(4)===d.CENTRAL_FILE_HEADER;)t=new l({zip64:this.zip64},this.loadOptions),t.readCentralPart(this.reader),this.files.push(t)},readEndOfCentral:function(){var t=this.reader.lastIndexOfSignature(d.CENTRAL_DIRECTORY_END);if(t===-1){var e=!0;try{this.reader.setIndex(0),this.checkSignature(d.LOCAL_FILE_HEADER),e=!1}catch(t){}throw e?new Error("Can't find end of central directory : is this a zip file ? If it is, see http://stuk.github.io/jszip/documentation/howto/read_zip.html"):new Error("Corrupted zip : can't find end of central directory")}if(this.reader.setIndex(t),this.checkSignature(d.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===o.MAX_VALUE_16BITS||this.diskWithCentralDirStart===o.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===o.MAX_VALUE_16BITS||this.centralDirRecords===o.MAX_VALUE_16BITS||this.centralDirSize===o.MAX_VALUE_32BITS||this.centralDirOffset===o.MAX_VALUE_32BITS){if(this.zip64=!0,t=this.reader.lastIndexOfSignature(d.ZIP64_CENTRAL_DIRECTORY_LOCATOR),t===-1)throw new Error("Corrupted zip : can't find the ZIP64 end of central directory locator");this.reader.setIndex(t),this.checkSignature(d.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(d.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}},prepareReader:function(t){var e=o.getTypeOf(t);"string"!==e||h.uint8array?"nodebuffer"===e?this.reader=new a(t):this.reader=new s(o.transformTo("uint8array",t)):this.reader=new i(t,this.loadOptions.optimizedBinaryString)},load:function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},e.exports=n},{"./nodeBufferReader":12,"./object":13,"./signature":14,"./stringReader":15,"./support":17,"./uint8ArrayReader":18,"./utils":21,"./zipEntry":23}],23:[function(t,e,r){"use strict";function n(t,e){this.options=t,this.loadOptions=e}var i=t("./stringReader"),a=t("./utils"),s=t("./compressedObject"),o=t("./object"),d=0,l=3;n.prototype={isEncrypted:function(){return 1===(1&this.bitFlag)},useUTF8:function(){return 2048===(2048&this.bitFlag)},prepareCompressedContent:function(t,e,r){return function(){var n=t.index;t.setIndex(e);var i=t.readData(r);return t.setIndex(n),i}},prepareContent:function(t,e,r,n,i){return function(){var t=a.transformTo(n.uncompressInputType,this.getCompressedContent()),e=n.uncompress(t);if(e.length!==i)throw new Error("Bug : uncompressed data size mismatch");return e}},readLocalPart:function(t){var e,r;if(t.skip(22),this.fileNameLength=t.readInt(2),r=t.readInt(2),this.fileName=t.readString(this.fileNameLength),t.skip(r),this.compressedSize==-1||this.uncompressedSize==-1)throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize == -1 || uncompressedSize == -1)");if(e=a.findCompression(this.compressionMethod),null===e)throw new Error("Corrupted zip : compression "+a.pretty(this.compressionMethod)+" unknown (inner file : "+this.fileName+")");if(this.decompressed=new s,this.decompressed.compressedSize=this.compressedSize,this.decompressed.uncompressedSize=this.uncompressedSize,this.decompressed.crc32=this.crc32,this.decompressed.compressionMethod=this.compressionMethod,this.decompressed.getCompressedContent=this.prepareCompressedContent(t,t.index,this.compressedSize,e),this.decompressed.getContent=this.prepareContent(t,t.index,this.compressedSize,e,this.uncompressedSize),this.loadOptions.checkCRC32&&(this.decompressed=a.transformTo("string",this.decompressed.getContent()),o.crc32(this.decompressed)!==this.crc32))throw new Error("Corrupted zip : CRC32 mismatch")},readCentralPart:function(t){if(this.versionMadeBy=t.readInt(2),this.versionNeeded=t.readInt(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4),this.fileNameLength=t.readInt(2),this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");this.fileName=t.readString(this.fileNameLength),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readString(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var t=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),t===d&&(this.dosPermissions=63&this.externalFileAttributes),t===l&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileName.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(t){if(this.extraFields[1]){var e=new i(this.extraFields[1].value);this.uncompressedSize===a.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===a.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===a.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===a.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(t){var e=t.index,r,n,i;for(this.extraFields=this.extraFields||{};t.index<e+this.extraFieldsLength;)r=t.readInt(2),n=t.readInt(2),i=t.readString(n),this.extraFields[r]={id:r,length:n,value:i}},handleUTF8:function(){if(this.useUTF8())this.fileName=o.utf8decode(this.fileName),this.fileComment=o.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();null!==t&&(this.fileName=t);var e=this.findExtraFieldUnicodeComment();
null!==e&&(this.fileComment=e)}},findExtraFieldUnicodePath:function(){var t=this.extraFields[28789];if(t){var e=new i(t.value);return 1!==e.readInt(1)?null:o.crc32(this.fileName)!==e.readInt(4)?null:o.utf8decode(e.readString(t.length-5))}return null},findExtraFieldUnicodeComment:function(){var t=this.extraFields[25461];if(t){var e=new i(t.value);return 1!==e.readInt(1)?null:o.crc32(this.fileComment)!==e.readInt(4)?null:o.utf8decode(e.readString(t.length-5))}return null}},e.exports=n},{"./compressedObject":2,"./object":13,"./stringReader":15,"./utils":21}],24:[function(t,e,r){"use strict";var n=t("./lib/utils/common").assign,i=t("./lib/deflate"),a=t("./lib/inflate"),s=t("./lib/zlib/constants"),o={};n(o,i,a,s),e.exports=o},{"./lib/deflate":25,"./lib/inflate":26,"./lib/utils/common":27,"./lib/zlib/constants":30}],25:[function(t,e,r){"use strict";function n(t,e){var r=new b(e);if(r.push(t,!0),r.err)throw r.msg;return r.result}function i(t,e){return e=e||{},e.raw=!0,n(t,e)}function a(t,e){return e=e||{},e.gzip=!0,n(t,e)}var s=t("./zlib/deflate.js"),o=t("./utils/common"),d=t("./utils/strings"),l=t("./zlib/messages"),h=t("./zlib/zstream"),f=0,u=4,c=0,p=1,_=-1,m=0,g=8,b=function(t){this.options=o.assign({level:_,method:g,chunkSize:16384,windowBits:15,memLevel:8,strategy:m,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var r=s.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==c)throw new Error(l[r]);e.header&&s.deflateSetHeader(this.strm,e.header)};b.prototype.push=function(t,e){var r=this.strm,n=this.options.chunkSize,i,a;if(this.ended)return!1;a=e===~~e?e:e===!0?u:f,"string"==typeof t?r.input=d.string2buf(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(0===r.avail_out&&(r.output=new o.Buf8(n),r.next_out=0,r.avail_out=n),i=s.deflate(r,a),i!==p&&i!==c)return this.onEnd(i),this.ended=!0,!1;(0===r.avail_out||0===r.avail_in&&a===u)&&("string"===this.options.to?this.onData(d.buf2binstring(o.shrinkBuf(r.output,r.next_out))):this.onData(o.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||0===r.avail_out)&&i!==p);return a!==u||(i=s.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===c)},b.prototype.onData=function(t){this.chunks.push(t)},b.prototype.onEnd=function(t){t===c&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},r.Deflate=b,r.deflate=n,r.deflateRaw=i,r.gzip=a},{"./utils/common":27,"./utils/strings":28,"./zlib/deflate.js":32,"./zlib/messages":37,"./zlib/zstream":39}],26:[function(t,e,r){"use strict";function n(t,e){var r=new u(e);if(r.push(t,!0),r.err)throw r.msg;return r.result}function i(t,e){return e=e||{},e.raw=!0,n(t,e)}var a=t("./zlib/inflate.js"),s=t("./utils/common"),o=t("./utils/strings"),d=t("./zlib/constants"),l=t("./zlib/messages"),h=t("./zlib/zstream"),f=t("./zlib/gzheader"),u=function(t){this.options=s.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0===(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var r=a.inflateInit2(this.strm,e.windowBits);if(r!==d.Z_OK)throw new Error(l[r]);this.header=new f,a.inflateGetHeader(this.strm,this.header)};u.prototype.push=function(t,e){var r=this.strm,n=this.options.chunkSize,i,l,h,f,u;if(this.ended)return!1;l=e===~~e?e:e===!0?d.Z_FINISH:d.Z_NO_FLUSH,"string"==typeof t?r.input=o.binstring2buf(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(0===r.avail_out&&(r.output=new s.Buf8(n),r.next_out=0,r.avail_out=n),i=a.inflate(r,d.Z_NO_FLUSH),i!==d.Z_STREAM_END&&i!==d.Z_OK)return this.onEnd(i),this.ended=!0,!1;r.next_out&&(0===r.avail_out||i===d.Z_STREAM_END||0===r.avail_in&&l===d.Z_FINISH)&&("string"===this.options.to?(h=o.utf8border(r.output,r.next_out),f=r.next_out-h,u=o.buf2string(r.output,h),r.next_out=f,r.avail_out=n-f,f&&s.arraySet(r.output,r.output,h,f,0),this.onData(u)):this.onData(s.shrinkBuf(r.output,r.next_out)))}while(r.avail_in>0&&i!==d.Z_STREAM_END);return i===d.Z_STREAM_END&&(l=d.Z_FINISH),l!==d.Z_FINISH||(i=a.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===d.Z_OK)},u.prototype.onData=function(t){this.chunks.push(t)},u.prototype.onEnd=function(t){t===d.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},r.Inflate=u,r.inflate=n,r.inflateRaw=i,r.ungzip=n},{"./utils/common":27,"./utils/strings":28,"./zlib/constants":30,"./zlib/gzheader":33,"./zlib/inflate.js":35,"./zlib/messages":37,"./zlib/zstream":39}],27:[function(t,e,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;r.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)r.hasOwnProperty(n)&&(t[n]=r[n])}}return t},r.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var i={arraySet:function(t,e,r,n,i){if(e.subarray&&t.subarray)return void t.set(e.subarray(r,r+n),i);for(var a=0;a<n;a++)t[i+a]=e[r+a]},flattenChunks:function(t){var e,r,n,i,a,s;for(n=0,e=0,r=t.length;e<r;e++)n+=t[e].length;for(s=new Uint8Array(n),i=0,e=0,r=t.length;e<r;e++)a=t[e],s.set(a,i),i+=a.length;return s}},a={arraySet:function(t,e,r,n,i){for(var a=0;a<n;a++)t[i+a]=e[r+a]},flattenChunks:function(t){return[].concat.apply([],t)}};r.setTyped=function(t){t?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,i)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,a))},r.setTyped(n)},{}],28:[function(t,e,r){"use strict";function n(t,e){if(e<65537&&(t.subarray&&s||!t.subarray&&a))return String.fromCharCode.apply(null,i.shrinkBuf(t,e));for(var r="",n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r}var i=t("./common"),a=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch(t){a=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){s=!1}for(var o=new i.Buf8(256),d=0;d<256;d++)o[d]=d>=252?6:d>=248?5:d>=240?4:d>=224?3:d>=192?2:1;o[254]=o[254]=1,r.string2buf=function(t){var e,r,n,a,s,o=t.length,d=0;for(a=0;a<o;a++)r=t.charCodeAt(a),55296===(64512&r)&&a+1<o&&(n=t.charCodeAt(a+1),56320===(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),a++)),d+=r<128?1:r<2048?2:r<65536?3:4;for(e=new i.Buf8(d),s=0,a=0;s<d;a++)r=t.charCodeAt(a),55296===(64512&r)&&a+1<o&&(n=t.charCodeAt(a+1),56320===(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),a++)),r<128?e[s++]=r:r<2048?(e[s++]=192|r>>>6,e[s++]=128|63&r):r<65536?(e[s++]=224|r>>>12,e[s++]=128|r>>>6&63,e[s++]=128|63&r):(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63,e[s++]=128|r>>>6&63,e[s++]=128|63&r);return e},r.buf2binstring=function(t){return n(t,t.length)},r.binstring2buf=function(t){for(var e=new i.Buf8(t.length),r=0,n=e.length;r<n;r++)e[r]=t.charCodeAt(r);return e},r.buf2string=function(t,e){var r,i,a,s,d=e||t.length,l=new Array(2*d);for(i=0,r=0;r<d;)if(a=t[r++],a<128)l[i++]=a;else if(s=o[a],s>4)l[i++]=65533,r+=s-1;else{for(a&=2===s?31:3===s?15:7;s>1&&r<d;)a=a<<6|63&t[r++],s--;s>1?l[i++]=65533:a<65536?l[i++]=a:(a-=65536,l[i++]=55296|a>>10&1023,l[i++]=56320|1023&a)}return n(l,i)},r.utf8border=function(t,e){var r;for(e=e||t.length,e>t.length&&(e=t.length),r=e-1;r>=0&&128===(192&t[r]);)r--;return r<0?e:0===r?e:r+o[t[r]]>e?r:e}},{"./common":27}],29:[function(t,e,r){"use strict";function n(t,e,r,n){for(var i=65535&t|0,a=t>>>16&65535|0,s=0;0!==r;){s=r>2e3?2e3:r,r-=s;do i=i+e[n++]|0,a=a+i|0;while(--s);i%=65521,a%=65521}return i|a<<16|0}e.exports=n},{}],30:[function(t,e,r){e.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}},{}],31:[function(t,e,r){"use strict";function n(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}function i(t,e,r,n){var i=a,s=n+r;t^=-1;for(var o=n;o<s;o++)t=t>>>8^i[255&(t^e[o])];return t^-1}var a=n();e.exports=i},{}],32:[function(t,e,r){"use strict";function n(t,e){return t.msg=O[e],e}function i(t){return(t<<1)-(t>4?9:0)}function a(t){for(var e=t.length;--e>=0;)t[e]=0}function s(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(S.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))}function o(t,e){C._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,s(t.strm)}function d(t,e){t.pending_buf[t.pending++]=e}function l(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function h(t,e,r,n){var i=t.avail_in;return i>n&&(i=n),0===i?0:(t.avail_in-=i,S.arraySet(e,t.input,t.next_in,i,r),1===t.state.wrap?t.adler=I(t.adler,e,i,r):2===t.state.wrap&&(t.adler=B(t.adler,e,i,r)),t.next_in+=i,t.total_in+=i,i)}function f(t,e){var r=t.max_chain_length,n=t.strstart,i,a,s=t.prev_length,o=t.nice_match,d=t.strstart>t.w_size-dt?t.strstart-(t.w_size-dt):0,l=t.window,h=t.w_mask,f=t.prev,u=t.strstart+ot,c=l[n+s-1],p=l[n+s];t.prev_length>=t.good_match&&(r>>=2),o>t.lookahead&&(o=t.lookahead);do if(i=e,l[i+s]===p&&l[i+s-1]===c&&l[i]===l[n]&&l[++i]===l[n+1]){n+=2,i++;do;while(l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&n<u);if(a=ot-(u-n),n=u-ot,a>s){if(t.match_start=e,s=a,a>=o)break;c=l[n+s-1],p=l[n+s]}}while((e=f[e&h])>d&&0!==--r);return s<=t.lookahead?s:t.lookahead}function u(t){var e=t.w_size,r,n,i,a,s;do{if(a=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-dt)){S.arraySet(t.window,t.window,e,e,0),t.match_start-=e,t.strstart-=e,t.block_start-=e,n=t.hash_size,r=n;do i=t.head[--r],t.head[r]=i>=e?i-e:0;while(--n);n=e,r=n;do i=t.prev[--r],t.prev[r]=i>=e?i-e:0;while(--n);a+=e}if(0===t.strm.avail_in)break;if(n=h(t.strm,t.window,t.strstart+t.lookahead,a),t.lookahead+=n,t.lookahead+t.insert>=st)for(s=t.strstart-t.insert,t.ins_h=t.window[s],t.ins_h=(t.ins_h<<t.hash_shift^t.window[s+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[s+st-1])&t.hash_mask,t.prev[s&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=s,s++,t.insert--,!(t.lookahead+t.insert<st)););}while(t.lookahead<dt&&0!==t.strm.avail_in)}function c(t,e){var r=65535;for(r>t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(u(t),0===t.lookahead&&e===R)return gt;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+r;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,o(t,!1),0===t.strm.avail_out))return gt;if(t.strstart-t.block_start>=t.w_size-dt&&(o(t,!1),0===t.strm.avail_out))return gt}return t.insert=0,e===L?(o(t,!0),0===t.strm.avail_out?wt:vt):t.strstart>t.block_start&&(o(t,!1),0===t.strm.avail_out)?gt:gt}function p(t,e){for(var r,n;;){if(t.lookahead<dt){if(u(t),t.lookahead<dt&&e===R)return gt;if(0===t.lookahead)break}if(r=0,t.lookahead>=st&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+st-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==r&&t.strstart-r<=t.w_size-dt&&(t.match_length=f(t,r)),t.match_length>=st)if(n=C._tr_tally(t,t.strstart-t.match_start,t.match_length-st),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=st){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+st-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else n=C._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(o(t,!1),0===t.strm.avail_out))return gt}return t.insert=t.strstart<st-1?t.strstart:st-1,e===L?(o(t,!0),0===t.strm.avail_out?wt:vt):t.last_lit&&(o(t,!1),0===t.strm.avail_out)?gt:bt}function _(t,e){for(var r,n,i;;){if(t.lookahead<dt){if(u(t),t.lookahead<dt&&e===R)return gt;if(0===t.lookahead)break}if(r=0,t.lookahead>=st&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+st-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=st-1,0!==r&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-dt&&(t.match_length=f(t,r),t.match_length<=5&&(t.strategy===H||t.match_length===st&&t.strstart-t.match_start>4096)&&(t.match_length=st-1)),t.prev_length>=st&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-st,n=C._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-st),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+st-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(0!==--t.prev_length);if(t.match_available=0,t.match_length=st-1,t.strstart++,n&&(o(t,!1),0===t.strm.avail_out))return gt}else if(t.match_available){if(n=C._tr_tally(t,0,t.window[t.strstart-1]),n&&o(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return gt}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=C._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<st-1?t.strstart:st-1,e===L?(o(t,!0),0===t.strm.avail_out?wt:vt):t.last_lit&&(o(t,!1),0===t.strm.avail_out)?gt:bt}function m(t,e){for(var r,n,i,a,s=t.window;;){if(t.lookahead<=ot){if(u(t),t.lookahead<=ot&&e===R)return gt;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=st&&t.strstart>0&&(i=t.strstart-1,n=s[i],n===s[++i]&&n===s[++i]&&n===s[++i])){a=t.strstart+ot;do;while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<a);t.match_length=ot-(a-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=st?(r=C._tr_tally(t,1,t.match_length-st),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=C._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(o(t,!1),0===t.strm.avail_out))return gt}return t.insert=0,e===L?(o(t,!0),0===t.strm.avail_out?wt:vt):t.last_lit&&(o(t,!1),0===t.strm.avail_out)?gt:bt}function g(t,e){for(var r;;){if(0===t.lookahead&&(u(t),0===t.lookahead)){if(e===R)return gt;break}if(t.match_length=0,r=C._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(o(t,!1),0===t.strm.avail_out))return gt}return t.insert=0,e===L?(o(t,!0),0===t.strm.avail_out?wt:vt):t.last_lit&&(o(t,!1),0===t.strm.avail_out)?gt:bt}function b(t){t.window_size=2*t.w_size,a(t.head),t.max_lazy_match=xt[t.level].max_lazy,t.good_match=xt[t.level].good_length,t.nice_match=xt[t.level].nice_length,t.max_chain_length=xt[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=st-1,t.match_available=0,t.ins_h=0}function w(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=q,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new S.Buf16(2*it),this.dyn_dtree=new S.Buf16(2*(2*rt+1)),this.bl_tree=new S.Buf16(2*(2*nt+1)),a(this.dyn_ltree),a(this.dyn_dtree),a(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new S.Buf16(at+1),this.heap=new S.Buf16(2*et+1),a(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new S.Buf16(2*et+1),a(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function v(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=W,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?ht:_t,t.adler=2===e.wrap?0:1,e.last_flush=R,C._tr_init(e),U):n(t,P)}function y(t){var e=v(t);return e===U&&b(t.state),e}function k(t,e){return t&&t.state?2!==t.state.wrap?P:(t.state.gzhead=e,U):P}function x(t,e,r,i,a,s){if(!t)return P;var o=1;if(e===j&&(e=6),i<0?(o=0,i=-i):i>15&&(o=2,i-=16),a<1||a>G||r!==q||i<8||i>15||e<0||e>9||s<0||s>V)return n(t,P);8===i&&(i=9);var d=new w;return t.state=d,d.strm=t,d.wrap=o,d.gzhead=null,d.w_bits=i,d.w_size=1<<d.w_bits,d.w_mask=d.w_size-1,d.hash_bits=a+7,d.hash_size=1<<d.hash_bits,d.hash_mask=d.hash_size-1,d.hash_shift=~~((d.hash_bits+st-1)/st),d.window=new S.Buf8(2*d.w_size),d.head=new S.Buf16(d.hash_size),d.prev=new S.Buf16(d.w_size),d.lit_bufsize=1<<a+6,d.pending_buf_size=4*d.lit_bufsize,d.pending_buf=new S.Buf8(d.pending_buf_size),d.d_buf=d.lit_bufsize>>1,d.l_buf=3*d.lit_bufsize,d.level=e,d.strategy=s,d.method=r,y(t)}function z(t,e){return x(t,e,q,J,Q,Y)}function A(t,e){var r,o,h,f;if(!t||!t.state||e>N||e<0)return t?n(t,P):P;if(o=t.state,!t.output||!t.input&&0!==t.avail_in||o.status===mt&&e!==L)return n(t,0===t.avail_out?M:P);if(o.strm=t,r=o.last_flush,o.last_flush=e,o.status===ht)if(2===o.wrap)t.adler=0,d(o,31),d(o,139),d(o,8),o.gzhead?(d(o,(o.gzhead.text?1:0)+(o.gzhead.hcrc?2:0)+(o.gzhead.extra?4:0)+(o.gzhead.name?8:0)+(o.gzhead.comment?16:0)),d(o,255&o.gzhead.time),d(o,o.gzhead.time>>8&255),d(o,o.gzhead.time>>16&255),d(o,o.gzhead.time>>24&255),d(o,9===o.level?2:o.strategy>=X||o.level<2?4:0),d(o,255&o.gzhead.os),o.gzhead.extra&&o.gzhead.extra.length&&(d(o,255&o.gzhead.extra.length),d(o,o.gzhead.extra.length>>8&255)),o.gzhead.hcrc&&(t.adler=B(t.adler,o.pending_buf,o.pending,0)),o.gzindex=0,o.status=ft):(d(o,0),d(o,0),d(o,0),d(o,0),d(o,0),d(o,9===o.level?2:o.strategy>=X||o.level<2?4:0),d(o,yt),o.status=_t);else{var u=q+(o.w_bits-8<<4)<<8,c=-1;c=o.strategy>=X||o.level<2?0:o.level<6?1:6===o.level?2:3,u|=c<<6,0!==o.strstart&&(u|=lt),u+=31-u%31,o.status=_t,l(o,u),0!==o.strstart&&(l(o,t.adler>>>16),l(o,65535&t.adler)),t.adler=1}if(o.status===ft)if(o.gzhead.extra){for(h=o.pending;o.gzindex<(65535&o.gzhead.extra.length)&&(o.pending!==o.pending_buf_size||(o.gzhead.hcrc&&o.pending>h&&(t.adler=B(t.adler,o.pending_buf,o.pending-h,h)),s(t),h=o.pending,o.pending!==o.pending_buf_size));)d(o,255&o.gzhead.extra[o.gzindex]),o.gzindex++;o.gzhead.hcrc&&o.pending>h&&(t.adler=B(t.adler,o.pending_buf,o.pending-h,h)),o.gzindex===o.gzhead.extra.length&&(o.gzindex=0,o.status=ut)}else o.status=ut;if(o.status===ut)if(o.gzhead.name){h=o.pending;do{if(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>h&&(t.adler=B(t.adler,o.pending_buf,o.pending-h,h)),s(t),h=o.pending,o.pending===o.pending_buf_size)){f=1;break}f=o.gzindex<o.gzhead.name.length?255&o.gzhead.name.charCodeAt(o.gzindex++):0,d(o,f)}while(0!==f);o.gzhead.hcrc&&o.pending>h&&(t.adler=B(t.adler,o.pending_buf,o.pending-h,h)),0===f&&(o.gzindex=0,o.status=ct)}else o.status=ct;if(o.status===ct)if(o.gzhead.comment){h=o.pending;do{if(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>h&&(t.adler=B(t.adler,o.pending_buf,o.pending-h,h)),s(t),h=o.pending,o.pending===o.pending_buf_size)){f=1;break}f=o.gzindex<o.gzhead.comment.length?255&o.gzhead.comment.charCodeAt(o.gzindex++):0,d(o,f)}while(0!==f);o.gzhead.hcrc&&o.pending>h&&(t.adler=B(t.adler,o.pending_buf,o.pending-h,h)),0===f&&(o.status=pt)}else o.status=pt;if(o.status===pt&&(o.gzhead.hcrc?(o.pending+2>o.pending_buf_size&&s(t),o.pending+2<=o.pending_buf_size&&(d(o,255&t.adler),d(o,t.adler>>8&255),t.adler=0,o.status=_t)):o.status=_t),0!==o.pending){if(s(t),0===t.avail_out)return o.last_flush=-1,U}else if(0===t.avail_in&&i(e)<=i(r)&&e!==L)return n(t,M);if(o.status===mt&&0!==t.avail_in)return n(t,M);if(0!==t.avail_in||0!==o.lookahead||e!==R&&o.status!==mt){var p=o.strategy===X?g(o,e):o.strategy===K?m(o,e):xt[o.level].func(o,e);if(p!==wt&&p!==vt||(o.status=mt),p===gt||p===wt)return 0===t.avail_out&&(o.last_flush=-1),U;if(p===bt&&(e===T?C._tr_align(o):e!==N&&(C._tr_stored_block(o,0,0,!1),e===D&&(a(o.head),0===o.lookahead&&(o.strstart=0,o.block_start=0,o.insert=0))),s(t),0===t.avail_out))return o.last_flush=-1,U}return e!==L?U:o.wrap<=0?F:(2===o.wrap?(d(o,255&t.adler),d(o,t.adler>>8&255),d(o,t.adler>>16&255),d(o,t.adler>>24&255),d(o,255&t.total_in),d(o,t.total_in>>8&255),d(o,t.total_in>>16&255),d(o,t.total_in>>24&255)):(l(o,t.adler>>>16),l(o,65535&t.adler)),s(t),o.wrap>0&&(o.wrap=-o.wrap),0!==o.pending?U:F)}function E(t){var e;return t&&t.state?(e=t.state.status,e!==ht&&e!==ft&&e!==ut&&e!==ct&&e!==pt&&e!==_t&&e!==mt?n(t,P):(t.state=null,e===_t?n(t,Z):U)):P}var S=t("../utils/common"),C=t("./trees"),I=t("./adler32"),B=t("./crc32"),O=t("./messages"),R=0,T=1,D=3,L=4,N=5,U=0,F=1,P=-2,Z=-3,M=-5,j=-1,H=1,X=2,K=3,V=4,Y=0,W=2,q=8,G=9,J=15,Q=8,$=29,tt=256,et=tt+1+$,rt=30,nt=19,it=2*et+1,at=15,st=3,ot=258,dt=ot+st+1,lt=32,ht=42,ft=69,ut=73,ct=91,pt=103,_t=113,mt=666,gt=1,bt=2,wt=3,vt=4,yt=3,kt=function(t,e,r,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=i},xt;xt=[new kt(0,0,0,0,c),new kt(4,4,8,4,p),new kt(4,5,16,8,p),new kt(4,6,32,32,p),new kt(4,4,16,16,_),new kt(8,16,32,32,_),new kt(8,16,128,128,_),new kt(8,32,128,256,_),new kt(32,128,258,1024,_),new kt(32,258,258,4096,_)],r.deflateInit=z,r.deflateInit2=x,r.deflateReset=y,r.deflateResetKeep=v,r.deflateSetHeader=k,r.deflate=A,r.deflateEnd=E,r.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":27,"./adler32":29,"./crc32":31,"./messages":37,"./trees":38}],33:[function(t,e,r){"use strict";function n(){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}e.exports=n},{}],34:[function(t,e,r){"use strict";var n=30,i=12;e.exports=function t(e,r){var a,s,o,d,l,h,f,u,c,p,_,m,g,b,w,v,y,k,x,z,A,E,S,C,I;a=e.state,s=e.next_in,C=e.input,o=s+(e.avail_in-5),d=e.next_out,I=e.output,l=d-(r-e.avail_out),h=d+(e.avail_out-257),f=a.dmax,u=a.wsize,c=a.whave,p=a.wnext,_=a.window,m=a.hold,g=a.bits,b=a.lencode,w=a.distcode,v=(1<<a.lenbits)-1,y=(1<<a.distbits)-1;t:do{g<15&&(m+=C[s++]<<g,g+=8,m+=C[s++]<<g,g+=8),k=b[m&v];e:for(;;){if(x=k>>>24,m>>>=x,g-=x,x=k>>>16&255,0===x)I[d++]=65535&k;else{if(!(16&x)){if(0===(64&x)){k=b[(65535&k)+(m&(1<<x)-1)];continue e}if(32&x){a.mode=i;break t}e.msg="invalid literal/length code",a.mode=n;break t}z=65535&k,x&=15,x&&(g<x&&(m+=C[s++]<<g,g+=8),z+=m&(1<<x)-1,m>>>=x,g-=x),g<15&&(m+=C[s++]<<g,g+=8,m+=C[s++]<<g,g+=8),k=w[m&y];r:for(;;){if(x=k>>>24,m>>>=x,g-=x,x=k>>>16&255,!(16&x)){if(0===(64&x)){k=w[(65535&k)+(m&(1<<x)-1)];continue r}e.msg="invalid distance code",a.mode=n;break t}if(A=65535&k,x&=15,g<x&&(m+=C[s++]<<g,g+=8,g<x&&(m+=C[s++]<<g,g+=8)),A+=m&(1<<x)-1,A>f){e.msg="invalid distance too far back",a.mode=n;break t}if(m>>>=x,g-=x,x=d-l,A>x){if(x=A-x,x>c&&a.sane){e.msg="invalid distance too far back",a.mode=n;break t}if(E=0,S=_,0===p){if(E+=u-x,x<z){z-=x;do I[d++]=_[E++];while(--x);E=d-A,S=I}}else if(p<x){if(E+=u+p-x,x-=p,x<z){z-=x;do I[d++]=_[E++];while(--x);if(E=0,p<z){x=p,z-=x;do I[d++]=_[E++];while(--x);E=d-A,S=I}}}else if(E+=p-x,x<z){z-=x;do I[d++]=_[E++];while(--x);E=d-A,S=I}for(;z>2;)I[d++]=S[E++],I[d++]=S[E++],I[d++]=S[E++],z-=3;z&&(I[d++]=S[E++],z>1&&(I[d++]=S[E++]))}else{E=d-A;do I[d++]=I[E++],I[d++]=I[E++],I[d++]=I[E++],z-=3;while(z>2);z&&(I[d++]=I[E++],z>1&&(I[d++]=I[E++]))}break}}break}}while(s<o&&d<h);z=g>>3,s-=z,g-=z<<3,m&=(1<<g)-1,e.next_in=s,e.next_out=d,e.avail_in=s<o?5+(o-s):5-(s-o),e.avail_out=d<h?257+(h-d):257-(d-h),a.hold=m,a.bits=g}},{}],35:[function(t,e,r){"use strict";function n(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function i(){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 _.Buf16(320),this.work=new _.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function a(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=D,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new _.Buf32(ut),e.distcode=e.distdyn=new _.Buf32(ct),e.sane=1,e.back=-1,E):I}function s(t){var e;return t&&t.state?(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,a(t)):I}function o(t,e){var r,n;return t&&t.state?(n=t.state,e<0?(r=0,e=-e):(r=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15)?I:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,s(t))):I}function d(t,e){var r,n;return t?(n=new i,t.state=n,n.window=null,r=o(t,e),r!==E&&(t.state=null),r):I}function l(t){return d(t,_t)}function h(t){if(mt){var e;for(gt=new _.Buf32(512),bt=new _.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(w(y,t.lens,0,288,gt,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;w(k,t.lens,0,32,bt,0,t.work,{bits:5}),mt=!1}t.lencode=gt,t.lenbits=9,t.distcode=bt,t.distbits=5}function f(t,e,r,n){var i,a=t.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new _.Buf8(a.wsize)),n>=a.wsize?(_.arraySet(a.window,e,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>n&&(i=n),_.arraySet(a.window,e,r-n,i,a.wnext),n-=i,n?(_.arraySet(a.window,e,r-n,n,0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0}function u(t,e){var r,i,a,s,o,d,l,u,c,p,ut,ct,pt,_t,mt=0,gt,bt,wt,vt,yt,kt,xt,zt,At=new _.Buf8(4),Et,St,Ct=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return I;r=t.state,r.mode===K&&(r.mode=V),o=t.next_out,a=t.output,l=t.avail_out,s=t.next_in,i=t.input,d=t.avail_in,u=r.hold,c=r.bits,p=d,ut=l,zt=E;t:for(;;)switch(r.mode){case D:if(0===r.wrap){r.mode=V;break}for(;c<16;){if(0===d)break t;d--,u+=i[s++]<<c,c+=8}if(2&r.wrap&&35615===u){r.check=0,At[0]=255&u,At[1]=u>>>8&255,r.check=g(r.check,At,2,0),u=0,c=0,r.mode=L;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){t.msg="incorrect header check",r.mode=lt;break}if((15&u)!==T){t.msg="unknown compression method",r.mode=lt;break}if(u>>>=4,c-=4,xt=(15&u)+8,0===r.wbits)r.wbits=xt;else if(xt>r.wbits){t.msg="invalid window size",r.mode=lt;break}r.dmax=1<<xt,t.adler=r.check=1,r.mode=512&u?H:K,u=0,c=0;break;case L:for(;c<16;){if(0===d)break t;d--,u+=i[s++]<<c,c+=8}if(r.flags=u,(255&r.flags)!==T){t.msg="unknown compression method",r.mode=lt;break}if(57344&r.flags){t.msg="unknown header flags set",r.mode=lt;break}r.head&&(r.head.text=u>>8&1),512&r.flags&&(At[0]=255&u,At[1]=u>>>8&255,r.check=g(r.check,At,2,0)),u=0,c=0,r.mode=N;case N:for(;c<32;){if(0===d)break t;d--,u+=i[s++]<<c,c+=8}r.head&&(r.head.time=u),512&r.flags&&(At[0]=255&u,At[1]=u>>>8&255,At[2]=u>>>16&255,At[3]=u>>>24&255,r.check=g(r.check,At,4,0)),u=0,c=0,r.mode=U;case U:for(;c<16;){if(0===d)break t;d--,u+=i[s++]<<c,c+=8}r.head&&(r.head.xflags=255&u,r.head.os=u>>8),512&r.flags&&(At[0]=255&u,At[1]=u>>>8&255,r.check=g(r.check,At,2,0)),u=0,c=0,r.mode=F;case F:if(1024&r.flags){for(;c<16;){if(0===d)break t;d--,u+=i[s++]<<c,c+=8}r.length=u,r.head&&(r.head.extra_len=u),512&r.flags&&(At[0]=255&u,At[1]=u>>>8&255,r.check=g(r.check,At,2,0)),u=0,c=0}else r.head&&(r.head.extra=null);r.mode=P;case P:if(1024&r.flags&&(ct=r.length,ct>d&&(ct=d),ct&&(r.head&&(xt=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),_.arraySet(r.head.extra,i,s,ct,xt)),512&r.flags&&(r.check=g(r.check,i,ct,s)),d-=ct,s+=ct,r.length-=ct),r.length))break t;r.length=0,r.mode=Z;case Z:if(2048&r.flags){if(0===d)break t;ct=0;do xt=i[s+ct++],r.head&&xt&&r.length<65536&&(r.head.name+=String.fromCharCode(xt));while(xt&&ct<d);if(512&r.flags&&(r.check=g(r.check,i,ct,s)),d-=ct,s+=ct,xt)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=M;case M:if(4096&r.flags){if(0===d)break t;ct=0;do xt=i[s+ct++],r.head&&xt&&r.length<65536&&(r.head.comment+=String.fromCharCode(xt));while(xt&&ct<d);if(512&r.flags&&(r.check=g(r.check,i,ct,s)),d-=ct,s+=ct,xt)break t}else r.head&&(r.head.comment=null);r.mode=j;case j:if(512&r.flags){for(;c<16;){if(0===d)break t;d--,u+=i[s++]<<c,c+=8}if(u!==(65535&r.check)){t.msg="header crc mismatch",r.mode=lt;break}u=0,c=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=K;break;case H:for(;c<32;){if(0===d)break t;d--,u+=i[s++]<<c,c+=8}t.adler=r.check=n(u),u=0,c=0,r.mode=X;case X:if(0===r.havedict)return t.next_out=o,t.avail_out=l,t.next_in=s,t.avail_in=d,r.hold=u,r.bits=c,C;t.adler=r.check=1,r.mode=K;case K:if(e===z||e===A)break t;case V:if(r.last){u>>>=7&c,c-=7&c,r.mode=st;break}for(;c<3;){if(0===d)break t;d--,u+=i[s++]<<c,c+=8}switch(r.last=1&u,u>>>=1,c-=1,3&u){case 0:r.mode=Y;break;case 1:if(h(r),r.mode=$,e===A){u>>>=2,c-=2;break t}break;case 2:r.mode=G;break;case 3:t.msg="invalid block type",r.mode=lt}u>>>=2,c-=2;break;case Y:for(u>>>=7&c,c-=7&c;c<32;){if(0===d)break t;d--,u+=i[s++]<<c,c+=8}if((65535&u)!==(u>>>16^65535)){t.msg="invalid stored block lengths",r.mode=lt;break}if(r.length=65535&u,u=0,c=0,r.mode=W,e===A)break t;case W:r.mode=q;case q:if(ct=r.length){if(ct>d&&(ct=d),ct>l&&(ct=l),0===ct)break t;_.arraySet(a,i,s,ct,o),d-=ct,s+=ct,l-=ct,o+=ct,r.length-=ct;break}r.mode=K;break;case G:for(;c<14;){if(0===d)break t;d--,u+=i[s++]<<c,c+=8}if(r.nlen=(31&u)+257,u>>>=5,c-=5,r.ndist=(31&u)+1,u>>>=5,c-=5,r.ncode=(15&u)+4,u>>>=4,c-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=lt;break}r.have=0,r.mode=J;case J:for(;r.have<r.ncode;){for(;c<3;){if(0===d)break t;d--,u+=i[s++]<<c,c+=8}r.lens[Ct[r.have++]]=7&u,u>>>=3,c-=3}for(;r.have<19;)r.lens[Ct[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,Et={bits:r.lenbits},zt=w(v,r.lens,0,19,r.lencode,0,r.work,Et),r.lenbits=Et.bits,zt){t.msg="invalid code lengths set",r.mode=lt;break}r.have=0,r.mode=Q;case Q:for(;r.have<r.nlen+r.ndist;){for(;mt=r.lencode[u&(1<<r.lenbits)-1],gt=mt>>>24,bt=mt>>>16&255,wt=65535&mt,!(gt<=c);){if(0===d)break t;d--,u+=i[s++]<<c,c+=8}if(wt<16)u>>>=gt,c-=gt,r.lens[r.have++]=wt;else{if(16===wt){for(St=gt+2;c<St;){if(0===d)break t;d--,u+=i[s++]<<c,c+=8}if(u>>>=gt,c-=gt,0===r.have){t.msg="invalid bit length repeat",r.mode=lt;break}xt=r.lens[r.have-1],ct=3+(3&u),u>>>=2,c-=2}else if(17===wt){for(St=gt+3;c<St;){if(0===d)break t;d--,u+=i[s++]<<c,c+=8}u>>>=gt,c-=gt,xt=0,ct=3+(7&u),u>>>=3,c-=3}else{for(St=gt+7;c<St;){if(0===d)break t;d--,u+=i[s++]<<c,c+=8}u>>>=gt,c-=gt,xt=0,ct=11+(127&u),u>>>=7,c-=7}if(r.have+ct>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=lt;break}for(;ct--;)r.lens[r.have++]=xt}}if(r.mode===lt)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=lt;break}if(r.lenbits=9,Et={bits:r.lenbits},zt=w(y,r.lens,0,r.nlen,r.lencode,0,r.work,Et),r.lenbits=Et.bits,zt){t.msg="invalid literal/lengths set",r.mode=lt;break}if(r.distbits=6,r.distcode=r.distdyn,Et={bits:r.distbits
},zt=w(k,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,Et),r.distbits=Et.bits,zt){t.msg="invalid distances set",r.mode=lt;break}if(r.mode=$,e===A)break t;case $:r.mode=tt;case tt:if(d>=6&&l>=258){t.next_out=o,t.avail_out=l,t.next_in=s,t.avail_in=d,r.hold=u,r.bits=c,b(t,ut),o=t.next_out,a=t.output,l=t.avail_out,s=t.next_in,i=t.input,d=t.avail_in,u=r.hold,c=r.bits,r.mode===K&&(r.back=-1);break}for(r.back=0;mt=r.lencode[u&(1<<r.lenbits)-1],gt=mt>>>24,bt=mt>>>16&255,wt=65535&mt,!(gt<=c);){if(0===d)break t;d--,u+=i[s++]<<c,c+=8}if(bt&&0===(240&bt)){for(vt=gt,yt=bt,kt=wt;mt=r.lencode[kt+((u&(1<<vt+yt)-1)>>vt)],gt=mt>>>24,bt=mt>>>16&255,wt=65535&mt,!(vt+gt<=c);){if(0===d)break t;d--,u+=i[s++]<<c,c+=8}u>>>=vt,c-=vt,r.back+=vt}if(u>>>=gt,c-=gt,r.back+=gt,r.length=wt,0===bt){r.mode=at;break}if(32&bt){r.back=-1,r.mode=K;break}if(64&bt){t.msg="invalid literal/length code",r.mode=lt;break}r.extra=15&bt,r.mode=et;case et:if(r.extra){for(St=r.extra;c<St;){if(0===d)break t;d--,u+=i[s++]<<c,c+=8}r.length+=u&(1<<r.extra)-1,u>>>=r.extra,c-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=rt;case rt:for(;mt=r.distcode[u&(1<<r.distbits)-1],gt=mt>>>24,bt=mt>>>16&255,wt=65535&mt,!(gt<=c);){if(0===d)break t;d--,u+=i[s++]<<c,c+=8}if(0===(240&bt)){for(vt=gt,yt=bt,kt=wt;mt=r.distcode[kt+((u&(1<<vt+yt)-1)>>vt)],gt=mt>>>24,bt=mt>>>16&255,wt=65535&mt,!(vt+gt<=c);){if(0===d)break t;d--,u+=i[s++]<<c,c+=8}u>>>=vt,c-=vt,r.back+=vt}if(u>>>=gt,c-=gt,r.back+=gt,64&bt){t.msg="invalid distance code",r.mode=lt;break}r.offset=wt,r.extra=15&bt,r.mode=nt;case nt:if(r.extra){for(St=r.extra;c<St;){if(0===d)break t;d--,u+=i[s++]<<c,c+=8}r.offset+=u&(1<<r.extra)-1,u>>>=r.extra,c-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=lt;break}r.mode=it;case it:if(0===l)break t;if(ct=ut-l,r.offset>ct){if(ct=r.offset-ct,ct>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=lt;break}ct>r.wnext?(ct-=r.wnext,pt=r.wsize-ct):pt=r.wnext-ct,ct>r.length&&(ct=r.length),_t=r.window}else _t=a,pt=o-r.offset,ct=r.length;ct>l&&(ct=l),l-=ct,r.length-=ct;do a[o++]=_t[pt++];while(--ct);0===r.length&&(r.mode=tt);break;case at:if(0===l)break t;a[o++]=r.length,l--,r.mode=tt;break;case st:if(r.wrap){for(;c<32;){if(0===d)break t;d--,u|=i[s++]<<c,c+=8}if(ut-=l,t.total_out+=ut,r.total+=ut,ut&&(t.adler=r.check=r.flags?g(r.check,a,ut,o-ut):m(r.check,a,ut,o-ut)),ut=l,(r.flags?u:n(u))!==r.check){t.msg="incorrect data check",r.mode=lt;break}u=0,c=0}r.mode=ot;case ot:if(r.wrap&&r.flags){for(;c<32;){if(0===d)break t;d--,u+=i[s++]<<c,c+=8}if(u!==(4294967295&r.total)){t.msg="incorrect length check",r.mode=lt;break}u=0,c=0}r.mode=dt;case dt:zt=S;break t;case lt:zt=B;break t;case ht:return O;case ft:default:return I}return t.next_out=o,t.avail_out=l,t.next_in=s,t.avail_in=d,r.hold=u,r.bits=c,(r.wsize||ut!==t.avail_out&&r.mode<lt&&(r.mode<st||e!==x))&&f(t,t.output,t.next_out,ut-t.avail_out)?(r.mode=ht,O):(p-=t.avail_in,ut-=t.avail_out,t.total_in+=p,t.total_out+=ut,r.total+=ut,r.wrap&&ut&&(t.adler=r.check=r.flags?g(r.check,a,ut,t.next_out-ut):m(r.check,a,ut,t.next_out-ut)),t.data_type=r.bits+(r.last?64:0)+(r.mode===K?128:0)+(r.mode===$||r.mode===W?256:0),(0===p&&0===ut||e===x)&&zt===E&&(zt=R),zt)}function c(t){if(!t||!t.state)return I;var e=t.state;return e.window&&(e.window=null),t.state=null,E}function p(t,e){var r;return t&&t.state?(r=t.state,0===(2&r.wrap)?I:(r.head=e,e.done=!1,E)):I}var _=t("../utils/common"),m=t("./adler32"),g=t("./crc32"),b=t("./inffast"),w=t("./inftrees"),v=0,y=1,k=2,x=4,z=5,A=6,E=0,S=1,C=2,I=-2,B=-3,O=-4,R=-5,T=8,D=1,L=2,N=3,U=4,F=5,P=6,Z=7,M=8,j=9,H=10,X=11,K=12,V=13,Y=14,W=15,q=16,G=17,J=18,Q=19,$=20,tt=21,et=22,rt=23,nt=24,it=25,at=26,st=27,ot=28,dt=29,lt=30,ht=31,ft=32,ut=852,ct=592,pt=15,_t=pt,mt=!0,gt,bt;r.inflateReset=s,r.inflateReset2=o,r.inflateResetKeep=a,r.inflateInit=l,r.inflateInit2=d,r.inflate=u,r.inflateEnd=c,r.inflateGetHeader=p,r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":27,"./adler32":29,"./crc32":31,"./inffast":34,"./inftrees":36}],36:[function(t,e,r){"use strict";var n=t("../utils/common"),i=15,a=852,s=592,o=0,d=1,l=2,h=[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],f=[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],u=[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],c=[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];e.exports=function t(e,r,p,_,m,g,b,w){var v=w.bits,y=0,k=0,x=0,z=0,A=0,E=0,S=0,C=0,I=0,B=0,O,R,T,D,L,N=null,U=0,F,P=new n.Buf16(i+1),Z=new n.Buf16(i+1),M=null,j=0,H,X,K;for(y=0;y<=i;y++)P[y]=0;for(k=0;k<_;k++)P[r[p+k]]++;for(A=v,z=i;z>=1&&0===P[z];z--);if(A>z&&(A=z),0===z)return m[g++]=20971520,m[g++]=20971520,w.bits=1,0;for(x=1;x<z&&0===P[x];x++);for(A<x&&(A=x),C=1,y=1;y<=i;y++)if(C<<=1,C-=P[y],C<0)return-1;if(C>0&&(e===o||1!==z))return-1;for(Z[1]=0,y=1;y<i;y++)Z[y+1]=Z[y]+P[y];for(k=0;k<_;k++)0!==r[p+k]&&(b[Z[r[p+k]]++]=k);if(e===o?(N=M=b,F=19):e===d?(N=h,U-=257,M=f,j-=257,F=256):(N=u,M=c,F=-1),B=0,k=0,y=x,L=g,E=A,S=0,T=-1,I=1<<A,D=I-1,e===d&&I>a||e===l&&I>s)return 1;for(var V=0;;){V++,H=y-S,b[k]<F?(X=0,K=b[k]):b[k]>F?(X=M[j+b[k]],K=N[U+b[k]]):(X=96,K=0),O=1<<y-S,R=1<<E,x=R;do R-=O,m[L+(B>>S)+R]=H<<24|X<<16|K|0;while(0!==R);for(O=1<<y-1;B&O;)O>>=1;if(0!==O?(B&=O-1,B+=O):B=0,k++,0===--P[y]){if(y===z)break;y=r[p+b[k]]}if(y>A&&(B&D)!==T){for(0===S&&(S=A),L+=x,E=y-S,C=1<<E;E+S<z&&(C-=P[E+S],!(C<=0));)E++,C<<=1;if(I+=1<<E,e===d&&I>a||e===l&&I>s)return 1;T=B&D,m[T]=A<<24|E<<16|L-g|0}}return 0!==B&&(m[L+B]=y-S<<24|64<<16|0),w.bits=A,0}},{"../utils/common":27}],37:[function(t,e,r){"use strict";e.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"}},{}],38:[function(t,e,r){"use strict";function n(t){for(var e=t.length;--e>=0;)t[e]=0}function i(t){return t<256?st[t]:st[256+(t>>>7)]}function a(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function s(t,e,r){t.bi_valid>Y-r?(t.bi_buf|=e<<t.bi_valid&65535,a(t,t.bi_buf),t.bi_buf=e>>Y-t.bi_valid,t.bi_valid+=r-Y):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)}function o(t,e,r){s(t,r[2*e],r[2*e+1])}function d(t,e){var r=0;do r|=1&t,t>>>=1,r<<=1;while(--e>0);return r>>>1}function l(t){16===t.bi_valid?(a(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}function h(t,e){var r=e.dyn_tree,n=e.max_code,i=e.stat_desc.static_tree,a=e.stat_desc.has_stree,s=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,d=e.stat_desc.max_length,l,h,f,u,c,p,_=0;for(u=0;u<=V;u++)t.bl_count[u]=0;for(r[2*t.heap[t.heap_max]+1]=0,l=t.heap_max+1;l<K;l++)h=t.heap[l],u=r[2*r[2*h+1]+1]+1,u>d&&(u=d,_++),r[2*h+1]=u,h>n||(t.bl_count[u]++,c=0,h>=o&&(c=s[h-o]),p=r[2*h],t.opt_len+=p*(u+c),a&&(t.static_len+=p*(i[2*h+1]+c)));if(0!==_){do{for(u=d-1;0===t.bl_count[u];)u--;t.bl_count[u]--,t.bl_count[u+1]+=2,t.bl_count[d]--,_-=2}while(_>0);for(u=d;0!==u;u--)for(h=t.bl_count[u];0!==h;)f=t.heap[--l],f>n||(r[2*f+1]!==u&&(t.opt_len+=(u-r[2*f+1])*r[2*f],r[2*f+1]=u),h--)}}function f(t,e,r){var n=new Array(V+1),i=0,a,s;for(a=1;a<=V;a++)n[a]=i=i+r[a-1]<<1;for(s=0;s<=e;s++){var o=t[2*s+1];0!==o&&(t[2*s]=d(n[o]++,o))}}function u(){var t,e,r,n,i,a=new Array(V+1);for(r=0,n=0;n<Z-1;n++)for(dt[n]=r,t=0;t<1<<$[n];t++)ot[r++]=n;for(ot[r-1]=n,i=0,n=0;n<16;n++)for(lt[n]=i,t=0;t<1<<tt[n];t++)st[i++]=n;for(i>>=7;n<H;n++)for(lt[n]=i<<7,t=0;t<1<<tt[n]-7;t++)st[256+i++]=n;for(e=0;e<=V;e++)a[e]=0;for(t=0;t<=143;)it[2*t+1]=8,t++,a[8]++;for(;t<=255;)it[2*t+1]=9,t++,a[9]++;for(;t<=279;)it[2*t+1]=7,t++,a[7]++;for(;t<=287;)it[2*t+1]=8,t++,a[8]++;for(f(it,j+1,a),t=0;t<H;t++)at[2*t+1]=5,at[2*t]=d(t,5);ft=new ht(it,$,M+1,j,V),ut=new ht(at,tt,0,H,V),ct=new ht(new Array(0),et,0,X,W)}function c(t){var e;for(e=0;e<j;e++)t.dyn_ltree[2*e]=0;for(e=0;e<H;e++)t.dyn_dtree[2*e]=0;for(e=0;e<X;e++)t.bl_tree[2*e]=0;t.dyn_ltree[2*q]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function p(t){t.bi_valid>8?a(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function _(t,e,r,n){p(t),n&&(a(t,r),a(t,~r)),B.arraySet(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}function m(t,e,r,n){var i=2*e,a=2*r;return t[i]<t[a]||t[i]===t[a]&&n[e]<=n[r]}function g(t,e,r){for(var n=t.heap[r],i=r<<1;i<=t.heap_len&&(i<t.heap_len&&m(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!m(e,n,t.heap[i],t.depth));)t.heap[r]=t.heap[i],r=i,i<<=1;t.heap[r]=n}function b(t,e,r){var n,a,d=0,l,h;if(0!==t.last_lit)do n=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],a=t.pending_buf[t.l_buf+d],d++,0===n?o(t,a,e):(l=ot[a],o(t,l+M+1,e),h=$[l],0!==h&&(a-=dt[l],s(t,a,h)),n--,l=i(n),o(t,l,r),h=tt[l],0!==h&&(n-=lt[l],s(t,n,h)));while(d<t.last_lit);o(t,q,e)}function w(t,e){var r=e.dyn_tree,n=e.stat_desc.static_tree,i=e.stat_desc.has_stree,a=e.stat_desc.elems,s,o,d=-1,l;for(t.heap_len=0,t.heap_max=K,s=0;s<a;s++)0!==r[2*s]?(t.heap[++t.heap_len]=d=s,t.depth[s]=0):r[2*s+1]=0;for(;t.heap_len<2;)l=t.heap[++t.heap_len]=d<2?++d:0,r[2*l]=1,t.depth[l]=0,t.opt_len--,i&&(t.static_len-=n[2*l+1]);for(e.max_code=d,s=t.heap_len>>1;s>=1;s--)g(t,r,s);l=a;do s=t.heap[1],t.heap[1]=t.heap[t.heap_len--],g(t,r,1),o=t.heap[1],t.heap[--t.heap_max]=s,t.heap[--t.heap_max]=o,r[2*l]=r[2*s]+r[2*o],t.depth[l]=(t.depth[s]>=t.depth[o]?t.depth[s]:t.depth[o])+1,r[2*s+1]=r[2*o+1]=l,t.heap[1]=l++,g(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],h(t,e),f(r,d,t.bl_count)}function v(t,e,r){var n,i=-1,a,s=e[1],o=0,d=7,l=4;for(0===s&&(d=138,l=3),e[2*(r+1)+1]=65535,n=0;n<=r;n++)a=s,s=e[2*(n+1)+1],++o<d&&a===s||(o<l?t.bl_tree[2*a]+=o:0!==a?(a!==i&&t.bl_tree[2*a]++,t.bl_tree[2*G]++):o<=10?t.bl_tree[2*J]++:t.bl_tree[2*Q]++,o=0,i=a,0===s?(d=138,l=3):a===s?(d=6,l=3):(d=7,l=4))}function y(t,e,r){var n,i=-1,a,d=e[1],l=0,h=7,f=4;for(0===d&&(h=138,f=3),n=0;n<=r;n++)if(a=d,d=e[2*(n+1)+1],!(++l<h&&a===d)){if(l<f){do o(t,a,t.bl_tree);while(0!==--l)}else 0!==a?(a!==i&&(o(t,a,t.bl_tree),l--),o(t,G,t.bl_tree),s(t,l-3,2)):l<=10?(o(t,J,t.bl_tree),s(t,l-3,3)):(o(t,Q,t.bl_tree),s(t,l-11,7));l=0,i=a,0===d?(h=138,f=3):a===d?(h=6,f=3):(h=7,f=4)}}function k(t){var e;for(v(t,t.dyn_ltree,t.l_desc.max_code),v(t,t.dyn_dtree,t.d_desc.max_code),w(t,t.bl_desc),e=X-1;e>=3&&0===t.bl_tree[2*rt[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}function x(t,e,r,n){var i;for(s(t,e-257,5),s(t,r-1,5),s(t,n-4,4),i=0;i<n;i++)s(t,t.bl_tree[2*rt[i]+1],3);y(t,t.dyn_ltree,e-1),y(t,t.dyn_dtree,r-1)}function z(t){var e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(1&e&&0!==t.dyn_ltree[2*r])return R;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return T;for(r=32;r<M;r++)if(0!==t.dyn_ltree[2*r])return T;return R}function A(t){_t||(u(),_t=!0),t.l_desc=new pt(t.dyn_ltree,ft),t.d_desc=new pt(t.dyn_dtree,ut),t.bl_desc=new pt(t.bl_tree,ct),t.bi_buf=0,t.bi_valid=0,c(t)}function E(t,e,r,n){s(t,(L<<1)+(n?1:0),3),_(t,e,r,!0)}function S(t){s(t,N<<1,3),o(t,q,it),l(t)}function C(t,e,r,n){var i,a,o=0;t.level>0?(t.strm.data_type===D&&(t.strm.data_type=z(t)),w(t,t.l_desc),w(t,t.d_desc),o=k(t),i=t.opt_len+3+7>>>3,a=t.static_len+3+7>>>3,a<=i&&(i=a)):i=a=r+5,r+4<=i&&e!==-1?E(t,e,r,n):t.strategy===O||a===i?(s(t,(N<<1)+(n?1:0),3),b(t,it,at)):(s(t,(U<<1)+(n?1:0),3),x(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),b(t,t.dyn_ltree,t.dyn_dtree)),c(t),n&&p(t)}function I(t,e,r){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(ot[r]+M+1)]++,t.dyn_dtree[2*i(e)]++),t.last_lit===t.lit_bufsize-1}var B=t("../utils/common"),O=4,R=0,T=1,D=2,L=0,N=1,U=2,F=3,P=258,Z=29,M=256,j=M+1+Z,H=30,X=19,K=2*j+1,V=15,Y=16,W=7,q=256,G=16,J=17,Q=18,$=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],tt=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],et=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],rt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],nt=512,it=new Array(2*(j+2));n(it);var at=new Array(2*H);n(at);var st=new Array(nt);n(st);var ot=new Array(P-F+1);n(ot);var dt=new Array(Z);n(dt);var lt=new Array(H);n(lt);var ht=function(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length},ft,ut,ct,pt=function(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e},_t=!1;r._tr_init=A,r._tr_stored_block=E,r._tr_flush_block=C,r._tr_tally=I,r._tr_align=S},{"../utils/common":27}],39:[function(t,e,r){"use strict";function n(){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}e.exports=n},{}]},{},[9])(9)})}).call(this),function(){var t=t=window.saveAs||function(t){"use strict";if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var e=t.document,r=function(){return t.URL||t.webkitURL||t},n=e.createElementNS("http://www.w3.org/1999/xhtml","a"),i="download"in n,a=function(r){var n=e.createEvent("MouseEvents");n.initMouseEvent("click",!0,!1,t,0,0,0,0,0,!1,!1,!1,!1,0,null),r.dispatchEvent(n)},s=t.webkitRequestFileSystem,o=t.requestFileSystem||s||t.mozRequestFileSystem,d=function(e){(t.setImmediate||t.setTimeout)(function(){throw e},0)},l="application/octet-stream",h=0,f=500,u=function(e){var n=function(){"string"==typeof e?r().revokeObjectURL(e):e.remove()};t.chrome?n():setTimeout(n,f)},c=function(t,e,r){e=[].concat(e);for(var n=e.length;n--;){var i=t["on"+e[n]];if("function"==typeof i)try{i.call(t,r||t)}catch(t){d(t)}}},p=function(t){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\ufeff",t],{type:t.type}):t},_=function(e,d){e=p(e);var f=this,_=e.type,m=!1,g,b,w=function(){c(f,"writestart progress write writeend".split(" "))},v=function(){if(!m&&g||(g=r().createObjectURL(e)),b)b.location.href=g;else{var n=t.open(g,"_blank");void 0==n&&"undefined"!=typeof safari&&(t.location.href=g)}f.readyState=f.DONE,w(),u(g)},y=function(t){return function(){if(f.readyState!==f.DONE)return t.apply(this,arguments)}},k={create:!0,exclusive:!1},x;return f.readyState=f.INIT,d||(d="download"),i?(g=r().createObjectURL(e),n.href=g,n.download=d,a(n),f.readyState=f.DONE,w(),void u(g)):(t.chrome&&_&&_!==l&&(x=e.slice||e.webkitSlice,e=x.call(e,0,e.size,l),m=!0),s&&"download"!==d&&(d+=".download"),(_===l||s)&&(b=t),o?(h+=e.size,void o(t.TEMPORARY,h,y(function(t){t.root.getDirectory("saved",k,y(function(t){var r=function(){t.getFile(d,k,y(function(t){t.createWriter(y(function(r){r.onwriteend=function(e){b.location.href=t.toURL(),f.readyState=f.DONE,c(f,"writeend",e),u(t)},r.onerror=function(){var t=r.error;t.code!==t.ABORT_ERR&&v()},"writestart progress write abort".split(" ").forEach(function(t){r["on"+t]=f["on"+t]}),r.write(e),f.abort=function(){r.abort(),f.readyState=f.DONE},f.readyState=f.WRITING}),v)}),v)};t.getFile(d,{create:!1},y(function(t){t.remove(),r()}),y(function(t){t.code===t.NOT_FOUND_ERR?r():v()}))}),v)}),v)):void v())},m=_.prototype,g=function(t,e){return new _(t,e)};return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(t,e){return navigator.msSaveOrOpenBlob(p(t),e)}:(m.abort=function(){var t=this;t.readyState=t.DONE,c(t,"abort")},m.readyState=m.INIT=0,m.WRITING=1,m.DONE=2,m.error=m.onwritestart=m.onprogress=m.onwrite=m.onabort=m.onerror=m.onwriteend=null,g)}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);"undefined"!=typeof module&&module.exports?module.exports.saveAs=t=window.saveAs:"undefined"!=typeof define&&null!==define&&null!=define.amd&&define([],function(){return t}),window.saveAs=t}.call(this),function(){"undefined"!=typeof window&&(n="undefined"!=typeof window.JSZip?window.JSZip:require("JSZip"))}.call(this)}).call(this),"undefined"==typeof Package&&(Package={}),function(t,e){for(var r in e)r in t||(t[r]=e[r])}(Package["silentcicero:jszip"]={},{JSZip:n})}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,n=Package.meteor.meteorEnv,r=Package.underscore._,i;(function(){(function(){i=function(e){var t=this;if(!(t instanceof i))throw new Error('use "new" to construct an EventEmitter');e=e||{},t._eventEmitter={onListeners:{},onceListeners:{},maxListeners:e.maxListeners||10}};var e=function(e,t){var n=this;if(n._eventEmitter.maxListeners&&t>n._eventEmitter.maxListeners)return"warning: possible EventEmitter memory leak detected. "+t+' listeners added on event "'+e+'". Use emitter.setMaxListeners() to increase limit. ('+n._eventEmitter.maxListeners+")"};i.prototype.setMaxListeners=function(e){this._eventEmitter.maxListeners=e};var t=function(t,n,r){return"undefined"==typeof t[n]&&(t[n]=[]),e.apply(this,[n,t[n].push(r)])};i.prototype.on=function(e,n){var r=t.apply(this,[this._eventEmitter.onListeners,e,n]);return r&&console.warn(new Error(r).stack),this},i.prototype.once=function(e,n){var r=t.apply(this,[this._eventEmitter.onceListeners,e,n]);return r&&console.warn(new Error(r).stack),this};var n=function(e,t){var n=this,i=0;return"undefined"!=typeof e&&r.each(e,function(e){i++,e.apply(n,t)}),i};i.prototype.emit=function(e){var t=this,i=r.rest(arguments),o=0,s=t._eventEmitter.onceListeners[e];return t._eventEmitter.onceListeners[e]=[],o+=n.call(t,t._eventEmitter.onListeners[e],i),o+=n.call(t,s,i),o>0};var o=function(e,t){for(var n=!1,r=[],i=0;i<e.length;i++)n||e[i]!==t?r.push(e[i]):n=!0;return r};i.prototype.off=function(e,t){var n=this;e?"function"==typeof t?("undefined"!=typeof n._eventEmitter.onListeners[e]&&(n._eventEmitter.onListeners[e]=o(n._eventEmitter.onListeners[e],t)),"undefined"!=typeof n._eventEmitter.onceListeners[e]&&(n._eventEmitter.onceListeners[e]=o(n._eventEmitter.onceListeners[e],t))):(n._eventEmitter.onListeners[e]=[],n._eventEmitter.onceListeners[e]=[]):(n._eventEmitter.onListeners={},n._eventEmitter.onceListeners={})},i.prototype.addListener=i.prototype.on,i.prototype.removeListener=i.prototype.off,i.prototype.removeAllListeners=i.prototype.off,i.prototype.one=i.prototype.once,i.prototype.trigger=i.prototype.emit}).call(this)}).call(this),"undefined"==typeof Package&&(Package={}),function(e,t){for(var n in t)n in e||(e[n]=t[n])}(Package["raix:eventemitter"]={},{EventEmitter:i})}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,n=Package.meteor.meteorEnv,i=Package["aldeed:simple-schema"].SimpleSchema,r=Package["aldeed:simple-schema"].MongoObject,o=Package.underscore._,a=Package.check.check,s=Package.check.Match,c=Package.mongo.Mongo,l=Package.minimongo.LocalCollection,u=Package.minimongo.Minimongo,m=Package.ejson.EJSON,d=Package["raix:eventemitter"].EventEmitter,f;(function(){function t(t,i,r,l,u){function m(e,n,i,r,a,s){E.clean(e,{mutate:!0,filter:i,autoConvert:r,getAutoValues:n,isModifier:"insert"!==t,removeEmptyStrings:a,trimStrings:s,extendAutoValueContext:o.extend({isInsert:"insert"===t,isUpdate:"update"===t&&_.upsert!==!0,isUpsert:v,userId:l,isFromTrustedCode:u,docId:I,isLocalCollection:k},_.extendAutoValueContext||{})})}var d=this,f,p,h,_,v,g,y,S;if(!i.length)throw new Error(t+" requires an argument");if("insert"===t)f=i[0],_=i[1],p=i[2],i="function"==typeof _?[f,_]:"function"==typeof p?[f,p]:[f];else{if("update"!==t)throw new Error("invalid type argument");g=i[0],f=i[1],_=i[2],p=i[3]}var C=o.isEmpty(f);p||"function"!=typeof _||(p=_,_={}),_=_||{},y=i.length-1,S="function"==typeof i[y],v="update"===t&&_.upsert===!0;var E=d.simpleSchema(f,_,g),k=null===d._connection;(e.isServer||k)&&_.getAutoValues===!1&&(r=!1);var w=_.validationContext;w?"string"==typeof w&&(w=E.namedContext(w)):w=E.namedContext(),e.isClient&&!p&&(p=function(n){n&&e._debug(t+" failed: "+(n.reason||n.stack))}),e.isClient&&S&&(p=i[y]=s(w,p));var x=E.allowsKey("_id");"insert"===t&&!f._id&&x&&(f._id=d._makeNewID());var I;"insert"===t?I=f._id:"update"===t&&g&&(I="string"==typeof g||g instanceof c.ObjectID?g:g._id);var P;f._id&&!x&&(P=f._id,delete f._id),m(f,r,_.filter!==!1,_.autoConvert!==!1,_.removeEmptyStrings!==!1,_.trimStrings!==!1);var A={};for(var M in f)f.hasOwnProperty(M)&&(A[M]=f[M]);if(e.isServer&&v&&o.isObject(g)){var O=A.$set||{};A.$set=o.clone(g),x||delete A.$set._id,o.extend(A.$set,O)}if(e.isClient&&!k&&m(A,!0,!1,!1,!1,!1),!C&&o.isEmpty(A))throw new Error("After filtering out keys not in the schema, your "+("update"===t?"modifier":"object")+" is now empty");var V;if(V=_.validate===!1||w.validate(A,{modifier:"update"===t||"upsert"===t,upsert:v,extendedCustomContext:o.extend({isInsert:"insert"===t,isUpdate:"update"===t&&_.upsert!==!0,isUpsert:v,userId:l,isFromTrustedCode:u,docId:I,isLocalCollection:k},_.extendedCustomContext||{})}))return P&&(f._id=P),"insert"===t?i[0]=f:i[1]=f,e.isServer&&S&&(i[y]=a(w,i[y])),i;if(h=n(w),!p)throw h;p(h,!1)}function n(t){var n,r=i.version>=2?t.validationErrors():t.invalidKeys();n=r.length?t.keyErrorMessage(r[0].name):"Failed validation";var o=new Error(n);return o.invalidKeys=r,o.validationContext=t,e.isServer&&(o.sanitizedError=new e.Error(400,n,m.stringify(o.invalidKeys))),o}function r(e,t){var n=t.split("c2_")[1].split(" ")[0],i=t.split("dup key:")[1].split('"')[1];e[h]([{name:n,type:"notUnique",value:i}])}function a(e,t){return function i(a){var s=o.toArray(arguments);return a&&("MongoError"===a.name&&11001===a.code||a.message.indexOf(!0))&&a.message.indexOf("c2_")!==-1&&(r(e,a.message),s[0]=n(e)),t.apply(this,s)}}function s(t,i){return function a(s){var c=o.toArray(arguments);if(s instanceof e.Error&&400===s.error&&"INVALID"===s.reason&&"string"==typeof s.details){var l=m.parse(s.details);t[h](l),c[0]=n(t)}else s instanceof e.Error&&409===s.error&&s.reason&&s.reason.indexOf("E11000")!==-1&&s.reason.indexOf("c2_")!==-1&&(r(t,s.reason),c[0]=n(t));return i.apply(this,c)}}function u(e){Package&&Package.insecure&&!_[e._name]&&(e.allow({insert:function(){return!0},update:function(){return!0},remove:function(){return!0},fetch:[],transform:null}),_[e._name]=!0)}function p(n,i){if(!v[n._name]){var r=null===n._connection;n.deny({insert:function(e,t){return n.simpleSchema(t).clean(t,{mutate:!0,isModifier:!1,filter:!1,autoConvert:!1,removeEmptyStrings:!1,trimStrings:!1,extendAutoValueContext:{isInsert:!0,isUpdate:!1,isUpsert:!1,userId:e,isFromTrustedCode:!1,docId:t._id,isLocalCollection:r}}),!1},update:function(e,t,i,o){return n.simpleSchema(o).clean(o,{mutate:!0,isModifier:!0,filter:!1,autoConvert:!1,removeEmptyStrings:!1,trimStrings:!1,extendAutoValueContext:{isInsert:!1,isUpdate:!0,isUpsert:!1,userId:e,isFromTrustedCode:!1,docId:t&&t._id,isLocalCollection:r}}),!1},fetch:["_id"],transform:null}),n.deny(o.extend({insert:function(i,r){return t.call(n,"insert",[r,{trimStrings:!1,removeEmptyStrings:!1,filter:!1,autoConvert:!1},function(t){if(t)throw new e.Error(400,"INVALID",m.stringify(t.invalidKeys))}],!1,i,!1),!1},update:function(i,r,o,a){return t.call(n,"update",[{_id:r&&r._id},a,{trimStrings:!1,removeEmptyStrings:!1,filter:!1,autoConvert:!1},function(t){if(t)throw new e.Error(400,"INVALID",m.stringify(t.invalidKeys))}],!1,i,!1),!1},fetch:["_id"]},i.transform===!0?{}:{transform:null})),v[n._name]=!0}}f=new d,"undefined"==typeof c&&(c={},c.Collection=e.Collection);var h=i.version>=2?"addValidationErrors":"addInvalidKeys";c.Collection.prototype.attachSchema=function e(t,n){function r(e){if("object"==typeof c){var r=-1;e._c2._simpleSchemas=e._c2._simpleSchemas||[],e._c2._simpleSchemas.forEach(function(e,t){o.isEqual(e.selector,c)&&(r=t)}),r===-1?e._c2._simpleSchemas.push({schema:new i(t),selector:c}):n.replace!==!0?e._c2._simpleSchemas[r].schema.version>=2?e._c2._simpleSchemas[r].schema.extend(t):e._c2._simpleSchemas[r].schema=new i([e._c2._simpleSchemas[r].schema,t]):e._c2._simpleSchemas[r].schema=t,delete e._c2._simpleSchema}else e._c2._simpleSchema=t,delete e._c2._simpleSchemas}var a=this;if(n=n||{},t instanceof i||(t=new i(t)),a._c2=a._c2||{},a._c2._simpleSchema&&n.replace!==!0)if(t.version>=2){var s=new i(a._c2._simpleSchema);s.extend(t),t=s}else t=new i([a._c2._simpleSchema,t]);var c=n.selector;r(a),a._collection instanceof l&&(a._collection._c2=a._collection._c2||{},r(a._collection)),p(a,n),u(a),f.emit("schema.attached",a,t,n)},o.each([c.Collection,l],function(e){e.prototype.simpleSchema=function(e,t,n){if(!this._c2)return null;if(this._c2._simpleSchema)return this._c2._simpleSchema;var i=this._c2._simpleSchemas;if(i&&i.length>0){if(!e)throw new Error("collection.simpleSchema() requires doc argument when there are multiple schemas");for(var r,o,a,s=0;s<i.length;s++)if(r=i[s],o=Object.keys(r.selector)[0],a=void 0,e.$set&&"undefined"!=typeof e.$set[o]?a=e.$set[o]:"undefined"!=typeof e[o]?a=e[o]:t&&t.selector?a=t.selector[o]:n&&n[o]&&(a=n[o]),void 0!==a&&a===r.selector[o])return r.schema}return null}}),o.each(["insert","update"],function(n){var i=c.Collection.prototype[n];c.Collection.prototype[n]=function(){var r=this,a,s=o.toArray(arguments);if(a="insert"===n?s[1]:s[2],a&&"function"!=typeof a||(a={}),r._c2&&a.bypassCollection2!==!0){var c=null;try{c=e.userId()}catch(e){}if(s=t.call(r,n,s,!0,c,e.isServer),!s)return"insert"===n?r._makeNewID():void 0}else"insert"===n&&"function"!=typeof s[1]&&s.splice(1,1);return i.apply(r,s)}});var _={},v={}}).call(this),"undefined"==typeof Package&&(Package={}),function(e,t){for(var n in t)n in e||(e[n]=t[n])}(Package["aldeed:collection2-core"]={},{Collection2:f})}();
!function(){var e=Package.meteor.Meteor,a=Package.meteor.global,n=Package.meteor.meteorEnv,o=Package["aldeed:collection2-core"].Collection2,c=Package.underscore._,i=Package.minimongo.LocalCollection,s=Package.minimongo.Minimongo,t=Package.check.check,m=Package.check.Match,r=Package.modules.meteorInstall,l=Package.modules.Buffer,u=Package.modules.process,g=Package["ecmascript-runtime"].Symbol,d=Package["ecmascript-runtime"].Map,k=Package["ecmascript-runtime"].Set,P=Package["babel-runtime"].meteorBabelHelpers,p=Package.promise.Promise,h=Package["aldeed:simple-schema"].SimpleSchema,b=Package["aldeed:simple-schema"].MongoObject,f=Package.mongo.Mongo,x=r({node_modules:{meteor:{"aldeed:schema-index":{lib:{"indexing.js":function(){h.extendOptions({index:m.Optional(m.OneOf(Number,String,Boolean)),unique:m.Optional(Boolean),sparse:m.Optional(Boolean)}),(!h.version||h.version<2)&&h.messages({notUnique:"[label] must be unique"}),e.isServer&&o.on("schema.attached",function(a,n){function o(n,o,c,i){e.startup(function(){a._collection._ensureIndex(n,{background:!0,name:o,unique:c,sparse:i})})}function i(n){e.startup(function(){try{a._collection._dropIndex(n)}catch(e){}})}n.version>=2&&n.messageBox.messages({notUnique:"{{label}} must be unique"});var s=2===n.version?"mergedSchema":"schema";c.each(n[s](),function(e,a){if("index"in e||e.unique===!0){var n={},c;"index"in e?(c=e.index,c===!0&&(c=1)):c=1;var s="c2_"+a,t=a.replace(/\.\$\./g,".");n[t]=c;var m=!!e.unique&&(1===c||c===-1),r=e.sparse||!1;!r&&m&&e.optional&&(r=!0),c===!1?i(s):o(n,s,m,r)}})})}}}}}},{extensions:[".js",".json"]});x("./node_modules/meteor/aldeed:schema-index/lib/indexing.js"),"undefined"==typeof Package&&(Package={}),Package["aldeed:schema-index"]={}}();
!function(){var e=Package.meteor.Meteor,a=Package.meteor.global,n=Package.meteor.meteorEnv,o=Package["aldeed:collection2-core"].Collection2,t=Package.underscore._,i=Package.minimongo.LocalCollection,c=Package.minimongo.Minimongo,l=Package.check.check,s=Package.check.Match,d=Package["aldeed:simple-schema"].SimpleSchema,g=Package["aldeed:simple-schema"].MongoObject,r=Package.mongo.Mongo;(function(){d.extendOptions({denyInsert:s.Optional(Boolean),denyUpdate:s.Optional(Boolean)}),(!d.version||d.version<2)&&d.messages({insertNotAllowed:"[label] cannot be set during an insert",updateNotAllowed:"[label] cannot be set during an update"}),o.on("schema.attached",function(e,a){a.version>=2&&a.messageBox.messages({insertNotAllowed:"{{label}} cannot be set during an insert",updateNotAllowed:"{{label}} cannot be set during an update"}),a.addValidator(function(){if(this.isSet){var e=this.definition;return e.denyInsert&&this.isInsert?"insertNotAllowed":e.denyUpdate&&(this.isUpdate||this.isUpsert)?"updateNotAllowed":void 0}})})}).call(this),"undefined"==typeof Package&&(Package={}),Package["aldeed:schema-deny"]={}}();
!function(){"undefined"==typeof Package&&(Package={}),Package["aldeed:collection2"]={}}();
!function(){var t=Package.meteor.Meteor,e=Package.meteor.global,i=Package.meteor.meteorEnv,o=Package.jquery.$,n=Package.jquery.jQuery;(function(){if("undefined"==typeof n)throw new Error("Bootstrap's JavaScript requires jQuery");+function(t){"use strict";var e=t.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1==e[0]&&9==e[1]&&e[2]<1||e[0]>2)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3")}(n),+function(t){"use strict";function e(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(void 0!==t.style[i])return{end:e[i]};return!1}t.fn.emulateTransitionEnd=function(e){var i=!1,o=this;t(this).one("bsTransitionEnd",function(){i=!0});var n=function(){i||t(o).trigger(t.support.transition.end)};return setTimeout(n,e),this},t(function(){t.support.transition=e(),t.support.transition&&(t.event.special.bsTransitionEnd={bindType:t.support.transition.end,delegateType:t.support.transition.end,handle:function(e){if(t(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}})})}(n),+function(t){"use strict";function e(e){return this.each(function(){var i=t(this),n=i.data("bs.alert");n||i.data("bs.alert",n=new o(this)),"string"==typeof e&&n[e].call(i)})}var i='[data-dismiss="alert"]',o=function(e){t(e).on("click",i,this.close)};o.VERSION="3.3.6",o.TRANSITION_DURATION=150,o.prototype.close=function(e){function i(){a.detach().trigger("closed.bs.alert").remove()}var n=t(this),s=n.attr("data-target");s||(s=n.attr("href"),s=s&&s.replace(/.*(?=#[^\s]*$)/,""));var a=t(s);e&&e.preventDefault(),a.length||(a=n.closest(".alert")),a.trigger(e=t.Event("close.bs.alert")),e.isDefaultPrevented()||(a.removeClass("in"),t.support.transition&&a.hasClass("fade")?a.one("bsTransitionEnd",i).emulateTransitionEnd(o.TRANSITION_DURATION):i())};var n=t.fn.alert;t.fn.alert=e,t.fn.alert.Constructor=o,t.fn.alert.noConflict=function(){return t.fn.alert=n,this},t(document).on("click.bs.alert.data-api",i,o.prototype.close)}(n),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.button"),s="object"==typeof e&&e;n||o.data("bs.button",n=new i(this,s)),"toggle"==e?n.toggle():e&&n.setState(e)})}var i=function(e,o){this.$element=t(e),this.options=t.extend({},i.DEFAULTS,o),this.isLoading=!1};i.VERSION="3.3.6",i.DEFAULTS={loadingText:"loading..."},i.prototype.setState=function(e){var i="disabled",o=this.$element,n=o.is("input")?"val":"html",s=o.data();e+="Text",null==s.resetText&&o.data("resetText",o[n]()),setTimeout(t.proxy(function(){o[n](null==s[e]?this.options[e]:s[e]),"loadingText"==e?(this.isLoading=!0,o.addClass(i).attr(i,i)):this.isLoading&&(this.isLoading=!1,o.removeClass(i).removeAttr(i))},this),0)},i.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var i=this.$element.find("input");"radio"==i.prop("type")?(i.prop("checked")&&(t=!1),e.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==i.prop("type")&&(i.prop("checked")!==this.$element.hasClass("active")&&(t=!1),this.$element.toggleClass("active")),i.prop("checked",this.$element.hasClass("active")),t&&i.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var o=t.fn.button;t.fn.button=e,t.fn.button.Constructor=i,t.fn.button.noConflict=function(){return t.fn.button=o,this},t(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(i){var o=t(i.target);o.hasClass("btn")||(o=o.closest(".btn")),e.call(o,"toggle"),t(i.target).is('input[type="radio"]')||t(i.target).is('input[type="checkbox"]')||i.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(e){t(e.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(e.type))})}(n),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.carousel"),s=t.extend({},i.DEFAULTS,o.data(),"object"==typeof e&&e),a="string"==typeof e?e:s.slide;n||o.data("bs.carousel",n=new i(this,s)),"number"==typeof e?n.to(e):a?n[a]():s.interval&&n.pause().cycle()})}var i=function(e,i){this.$element=t(e),this.$indicators=this.$element.find(".carousel-indicators"),this.options=i,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",t.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",t.proxy(this.pause,this)).on("mouseleave.bs.carousel",t.proxy(this.cycle,this))};i.VERSION="3.3.6",i.TRANSITION_DURATION=600,i.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},i.prototype.keydown=function(t){if(!/input|textarea/i.test(t.target.tagName)){switch(t.which){case 37:this.prev();break;case 39:this.next();break;default:return}t.preventDefault()}},i.prototype.cycle=function(e){return e||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(t.proxy(this.next,this),this.options.interval)),this},i.prototype.getItemIndex=function(t){return this.$items=t.parent().children(".item"),this.$items.index(t||this.$active)},i.prototype.getItemForDirection=function(t,e){var i=this.getItemIndex(e),o="prev"==t&&0===i||"next"==t&&i==this.$items.length-1;if(o&&!this.options.wrap)return e;var n="prev"==t?-1:1,s=(i+n)%this.$items.length;return this.$items.eq(s)},i.prototype.to=function(t){var e=this,i=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(t>this.$items.length-1||t<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){e.to(t)}):i==t?this.pause().cycle():this.slide(t>i?"next":"prev",this.$items.eq(t))},i.prototype.pause=function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&t.support.transition&&(this.$element.trigger(t.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},i.prototype.next=function(){if(!this.sliding)return this.slide("next")},i.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},i.prototype.slide=function(e,o){var n=this.$element.find(".item.active"),s=o||this.getItemForDirection(e,n),a=this.interval,r="next"==e?"left":"right",l=this;if(s.hasClass("active"))return this.sliding=!1;var h=s[0],d=t.Event("slide.bs.carousel",{relatedTarget:h,direction:r});if(this.$element.trigger(d),!d.isDefaultPrevented()){if(this.sliding=!0,a&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var p=t(this.$indicators.children()[this.getItemIndex(s)]);p&&p.addClass("active")}var c=t.Event("slid.bs.carousel",{relatedTarget:h,direction:r});return t.support.transition&&this.$element.hasClass("slide")?(s.addClass(e),s[0].offsetWidth,n.addClass(r),s.addClass(r),n.one("bsTransitionEnd",function(){s.removeClass([e,r].join(" ")).addClass("active"),n.removeClass(["active",r].join(" ")),l.sliding=!1,setTimeout(function(){l.$element.trigger(c)},0)}).emulateTransitionEnd(i.TRANSITION_DURATION)):(n.removeClass("active"),s.addClass("active"),this.sliding=!1,this.$element.trigger(c)),a&&this.cycle(),this}};var o=t.fn.carousel;t.fn.carousel=e,t.fn.carousel.Constructor=i,t.fn.carousel.noConflict=function(){return t.fn.carousel=o,this};var n=function(i){var o,n=t(this),s=t(n.attr("data-target")||(o=n.attr("href"))&&o.replace(/.*(?=#[^\s]+$)/,""));if(s.hasClass("carousel")){var a=t.extend({},s.data(),n.data()),r=n.attr("data-slide-to");r&&(a.interval=!1),e.call(s,a),r&&s.data("bs.carousel").to(r),i.preventDefault()}};t(document).on("click.bs.carousel.data-api","[data-slide]",n).on("click.bs.carousel.data-api","[data-slide-to]",n),t(window).on("load",function(){t('[data-ride="carousel"]').each(function(){var i=t(this);e.call(i,i.data())})})}(n),+function(t){"use strict";function e(e){var i,o=e.attr("data-target")||(i=e.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"");return t(o)}function i(e){return this.each(function(){var i=t(this),n=i.data("bs.collapse"),s=t.extend({},o.DEFAULTS,i.data(),"object"==typeof e&&e);!n&&s.toggle&&/show|hide/.test(e)&&(s.toggle=!1),n||i.data("bs.collapse",n=new o(this,s)),"string"==typeof e&&n[e]()})}var o=function(e,i){this.$element=t(e),this.options=t.extend({},o.DEFAULTS,i),this.$trigger=t('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};o.VERSION="3.3.6",o.TRANSITION_DURATION=350,o.DEFAULTS={toggle:!0},o.prototype.dimension=function(){var t=this.$element.hasClass("width");return t?"width":"height"},o.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var e,n=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(n&&n.length&&(e=n.data("bs.collapse"),e&&e.transitioning))){var s=t.Event("show.bs.collapse");if(this.$element.trigger(s),!s.isDefaultPrevented()){n&&n.length&&(i.call(n,"hide"),e||n.data("bs.collapse",null));var a=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[a](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var r=function(){this.$element.removeClass("collapsing").addClass("collapse in")[a](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!t.support.transition)return r.call(this);var l=t.camelCase(["scroll",a].join("-"));this.$element.one("bsTransitionEnd",t.proxy(r,this)).emulateTransitionEnd(o.TRANSITION_DURATION)[a](this.$element[0][l])}}}},o.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var e=t.Event("hide.bs.collapse");if(this.$element.trigger(e),!e.isDefaultPrevented()){var i=this.dimension();this.$element[i](this.$element[i]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var n=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return t.support.transition?void this.$element[i](0).one("bsTransitionEnd",t.proxy(n,this)).emulateTransitionEnd(o.TRANSITION_DURATION):n.call(this)}}},o.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},o.prototype.getParent=function(){return t(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(t.proxy(function(i,o){var n=t(o);this.addAriaAndCollapsedClass(e(n),n)},this)).end()},o.prototype.addAriaAndCollapsedClass=function(t,e){var i=t.hasClass("in");t.attr("aria-expanded",i),e.toggleClass("collapsed",!i).attr("aria-expanded",i)};var n=t.fn.collapse;t.fn.collapse=i,t.fn.collapse.Constructor=o,t.fn.collapse.noConflict=function(){return t.fn.collapse=n,this},t(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(o){var n=t(this);n.attr("data-target")||o.preventDefault();var s=e(n),a=s.data("bs.collapse"),r=a?"toggle":n.data();i.call(s,r)})}(n),+function(t){"use strict";function e(e){var i=e.attr("data-target");i||(i=e.attr("href"),i=i&&/#[A-Za-z]/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,""));var o=i&&t(i);return o&&o.length?o:e.parent()}function i(i){i&&3===i.which||(t(n).remove(),t(s).each(function(){var o=t(this),n=e(o),s={relatedTarget:this};n.hasClass("open")&&(i&&"click"==i.type&&/input|textarea/i.test(i.target.tagName)&&t.contains(n[0],i.target)||(n.trigger(i=t.Event("hide.bs.dropdown",s)),i.isDefaultPrevented()||(o.attr("aria-expanded","false"),n.removeClass("open").trigger(t.Event("hidden.bs.dropdown",s)))))}))}function o(e){return this.each(function(){var i=t(this),o=i.data("bs.dropdown");o||i.data("bs.dropdown",o=new a(this)),"string"==typeof e&&o[e].call(i)})}var n=".dropdown-backdrop",s='[data-toggle="dropdown"]',a=function(e){t(e).on("click.bs.dropdown",this.toggle)};a.VERSION="3.3.6",a.prototype.toggle=function(o){var n=t(this);if(!n.is(".disabled, :disabled")){var s=e(n),a=s.hasClass("open");if(i(),!a){"ontouchstart"in document.documentElement&&!s.closest(".navbar-nav").length&&t(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(t(this)).on("click",i);var r={relatedTarget:this};if(s.trigger(o=t.Event("show.bs.dropdown",r)),o.isDefaultPrevented())return;n.trigger("focus").attr("aria-expanded","true"),s.toggleClass("open").trigger(t.Event("shown.bs.dropdown",r))}return!1}},a.prototype.keydown=function(i){if(/(38|40|27|32)/.test(i.which)&&!/input|textarea/i.test(i.target.tagName)){var o=t(this);if(i.preventDefault(),i.stopPropagation(),!o.is(".disabled, :disabled")){var n=e(o),a=n.hasClass("open");if(!a&&27!=i.which||a&&27==i.which)return 27==i.which&&n.find(s).trigger("focus"),o.trigger("click");var r=" li:not(.disabled):visible a",l=n.find(".dropdown-menu"+r);if(l.length){var h=l.index(i.target);38==i.which&&h>0&&h--,40==i.which&&h<l.length-1&&h++,~h||(h=0),l.eq(h).trigger("focus")}}}};var r=t.fn.dropdown;t.fn.dropdown=o,t.fn.dropdown.Constructor=a,t.fn.dropdown.noConflict=function(){return t.fn.dropdown=r,this},t(document).on("click.bs.dropdown.data-api",i).on("click.bs.dropdown.data-api",".dropdown form",function(t){t.stopPropagation()}).on("click.bs.dropdown.data-api",s,a.prototype.toggle).on("keydown.bs.dropdown.data-api",s,a.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",a.prototype.keydown)}(n),+function(t){"use strict";function e(e,o){return this.each(function(){var n=t(this),s=n.data("bs.modal"),a=t.extend({},i.DEFAULTS,n.data(),"object"==typeof e&&e);s||n.data("bs.modal",s=new i(this,a)),"string"==typeof e?s[e](o):a.show&&s.show(o)})}var i=function(e,i){this.options=i,this.$body=t(document.body),this.$element=t(e),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,t.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};i.VERSION="3.3.6",i.TRANSITION_DURATION=300,i.BACKDROP_TRANSITION_DURATION=150,i.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},i.prototype.toggle=function(t){return this.isShown?this.hide():this.show(t)},i.prototype.show=function(e){var o=this,n=t.Event("show.bs.modal",{relatedTarget:e});this.$element.trigger(n),this.isShown||n.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',t.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){o.$element.one("mouseup.dismiss.bs.modal",function(e){t(e.target).is(o.$element)&&(o.ignoreBackdropClick=!0)})}),this.backdrop(function(){var n=t.support.transition&&o.$element.hasClass("fade");o.$element.parent().length||o.$element.appendTo(o.$body),o.$element.show().scrollTop(0),o.adjustDialog(),n&&o.$element[0].offsetWidth,o.$element.addClass("in"),o.enforceFocus();var s=t.Event("shown.bs.modal",{relatedTarget:e});n?o.$dialog.one("bsTransitionEnd",function(){o.$element.trigger("focus").trigger(s)}).emulateTransitionEnd(i.TRANSITION_DURATION):o.$element.trigger("focus").trigger(s)}))},i.prototype.hide=function(e){e&&e.preventDefault(),e=t.Event("hide.bs.modal"),this.$element.trigger(e),this.isShown&&!e.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),t(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),t.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",t.proxy(this.hideModal,this)).emulateTransitionEnd(i.TRANSITION_DURATION):this.hideModal())},i.prototype.enforceFocus=function(){t(document).off("focusin.bs.modal").on("focusin.bs.modal",t.proxy(function(t){this.$element[0]===t.target||this.$element.has(t.target).length||this.$element.trigger("focus")},this))},i.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",t.proxy(function(t){27==t.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},i.prototype.resize=function(){this.isShown?t(window).on("resize.bs.modal",t.proxy(this.handleUpdate,this)):t(window).off("resize.bs.modal")},i.prototype.hideModal=function(){var t=this;this.$element.hide(),this.backdrop(function(){t.$body.removeClass("modal-open"),t.resetAdjustments(),t.resetScrollbar(),t.$element.trigger("hidden.bs.modal")})},i.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},i.prototype.backdrop=function(e){var o=this,n=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var s=t.support.transition&&n;if(this.$backdrop=t(document.createElement("div")).addClass("modal-backdrop "+n).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",t.proxy(function(t){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(t.target===t.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),s&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!e)return;s?this.$backdrop.one("bsTransitionEnd",e).emulateTransitionEnd(i.BACKDROP_TRANSITION_DURATION):e()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var a=function(){o.removeBackdrop(),e&&e()};t.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",a).emulateTransitionEnd(i.BACKDROP_TRANSITION_DURATION):a()}else e&&e()},i.prototype.handleUpdate=function(){this.adjustDialog()},i.prototype.adjustDialog=function(){var t=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&t?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!t?this.scrollbarWidth:""})},i.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},i.prototype.checkScrollbar=function(){var t=window.innerWidth;if(!t){var e=document.documentElement.getBoundingClientRect();t=e.right-Math.abs(e.left)}this.bodyIsOverflowing=document.body.clientWidth<t,this.scrollbarWidth=this.measureScrollbar()},i.prototype.setScrollbar=function(){var t=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",t+this.scrollbarWidth)},i.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},i.prototype.measureScrollbar=function(){var t=document.createElement("div");t.className="modal-scrollbar-measure",this.$body.append(t);var e=t.offsetWidth-t.clientWidth;return this.$body[0].removeChild(t),e};var o=t.fn.modal;t.fn.modal=e,t.fn.modal.Constructor=i,t.fn.modal.noConflict=function(){return t.fn.modal=o,this},t(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(i){var o=t(this),n=o.attr("href"),s=t(o.attr("data-target")||n&&n.replace(/.*(?=#[^\s]+$)/,"")),a=s.data("bs.modal")?"toggle":t.extend({remote:!/#/.test(n)&&n},s.data(),o.data());o.is("a")&&i.preventDefault(),s.one("show.bs.modal",function(t){t.isDefaultPrevented()||s.one("hidden.bs.modal",function(){o.is(":visible")&&o.trigger("focus")})}),e.call(s,a,this)})}(n),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.tooltip"),s="object"==typeof e&&e;!n&&/destroy|hide/.test(e)||(n||o.data("bs.tooltip",n=new i(this,s)),"string"==typeof e&&n[e]())})}var i=function(t,e){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",t,e)};i.VERSION="3.3.6",i.TRANSITION_DURATION=150,i.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},i.prototype.init=function(e,i,o){if(this.enabled=!0,this.type=e,this.$element=t(i),this.options=this.getOptions(o),this.$viewport=this.options.viewport&&t(t.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var n=this.options.trigger.split(" "),s=n.length;s--;){var a=n[s];if("click"==a)this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this));else if("manual"!=a){var r="hover"==a?"mouseenter":"focusin",l="hover"==a?"mouseleave":"focusout";this.$element.on(r+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,t.proxy(this.leave,this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},i.prototype.getDefaults=function(){return i.DEFAULTS},i.prototype.getOptions=function(e){return e=t.extend({},this.getDefaults(),this.$element.data(),e),e.delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},i.prototype.getDelegateOptions=function(){var e={},i=this.getDefaults();return this._options&&t.each(this._options,function(t,o){i[t]!=o&&(e[t]=o)}),e},i.prototype.enter=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);return i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i)),e instanceof t.Event&&(i.inState["focusin"==e.type?"focus":"hover"]=!0),i.tip().hasClass("in")||"in"==i.hoverState?void(i.hoverState="in"):(clearTimeout(i.timeout),i.hoverState="in",i.options.delay&&i.options.delay.show?void(i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show)):i.show())},i.prototype.isInStateTrue=function(){for(var t in this.inState)if(this.inState[t])return!0;return!1},i.prototype.leave=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);if(i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i)),e instanceof t.Event&&(i.inState["focusout"==e.type?"focus":"hover"]=!1),!i.isInStateTrue())return clearTimeout(i.timeout),i.hoverState="out",i.options.delay&&i.options.delay.hide?void(i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide)):i.hide()},i.prototype.show=function(){var e=t.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(e);var o=t.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(e.isDefaultPrevented()||!o)return;var n=this,s=this.tip(),a=this.getUID(this.type);this.setContent(),s.attr("id",a),this.$element.attr("aria-describedby",a),this.options.animation&&s.addClass("fade");var r="function"==typeof this.options.placement?this.options.placement.call(this,s[0],this.$element[0]):this.options.placement,l=/\s?auto?\s?/i,h=l.test(r);h&&(r=r.replace(l,"")||"top"),s.detach().css({top:0,left:0,display:"block"}).addClass(r).data("bs."+this.type,this),this.options.container?s.appendTo(this.options.container):s.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var d=this.getPosition(),p=s[0].offsetWidth,c=s[0].offsetHeight;if(h){var f=r,u=this.getPosition(this.$viewport);r="bottom"==r&&d.bottom+c>u.bottom?"top":"top"==r&&d.top-c<u.top?"bottom":"right"==r&&d.right+p>u.width?"left":"left"==r&&d.left-p<u.left?"right":r,s.removeClass(f).addClass(r)}var g=this.getCalculatedOffset(r,d,p,c);this.applyPlacement(g,r);var m=function(){var t=n.hoverState;n.$element.trigger("shown.bs."+n.type),n.hoverState=null,"out"==t&&n.leave(n)};t.support.transition&&this.$tip.hasClass("fade")?s.one("bsTransitionEnd",m).emulateTransitionEnd(i.TRANSITION_DURATION):m()}},i.prototype.applyPlacement=function(e,i){var o=this.tip(),n=o[0].offsetWidth,s=o[0].offsetHeight,a=parseInt(o.css("margin-top"),10),r=parseInt(o.css("margin-left"),10);isNaN(a)&&(a=0),isNaN(r)&&(r=0),e.top+=a,e.left+=r,t.offset.setOffset(o[0],t.extend({using:function(t){o.css({top:Math.round(t.top),left:Math.round(t.left)})}},e),0),o.addClass("in");var l=o[0].offsetWidth,h=o[0].offsetHeight;"top"==i&&h!=s&&(e.top=e.top+s-h);var d=this.getViewportAdjustedDelta(i,e,l,h);d.left?e.left+=d.left:e.top+=d.top;var p=/top|bottom/.test(i),c=p?2*d.left-n+l:2*d.top-s+h,f=p?"offsetWidth":"offsetHeight";o.offset(e),this.replaceArrow(c,o[0][f],p)},i.prototype.replaceArrow=function(t,e,i){this.arrow().css(i?"left":"top",50*(1-t/e)+"%").css(i?"top":"left","")},i.prototype.setContent=function(){var t=this.tip(),e=this.getTitle();t.find(".tooltip-inner")[this.options.html?"html":"text"](e),t.removeClass("fade in top bottom left right")},i.prototype.hide=function(e){function o(){"in"!=n.hoverState&&s.detach(),n.$element.removeAttr("aria-describedby").trigger("hidden.bs."+n.type),e&&e()}var n=this,s=t(this.$tip),a=t.Event("hide.bs."+this.type);if(this.$element.trigger(a),!a.isDefaultPrevented())return s.removeClass("in"),t.support.transition&&s.hasClass("fade")?s.one("bsTransitionEnd",o).emulateTransitionEnd(i.TRANSITION_DURATION):o(),this.hoverState=null,this},i.prototype.fixTitle=function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("data-original-title"))&&t.attr("data-original-title",t.attr("title")||"").attr("title","")},i.prototype.hasContent=function(){return this.getTitle()},i.prototype.getPosition=function(e){e=e||this.$element;var i=e[0],o="BODY"==i.tagName,n=i.getBoundingClientRect();null==n.width&&(n=t.extend({},n,{width:n.right-n.left,height:n.bottom-n.top}));var s=o?{top:0,left:0}:e.offset(),a={scroll:o?document.documentElement.scrollTop||document.body.scrollTop:e.scrollTop()},r=o?{width:t(window).width(),height:t(window).height()}:null;return t.extend({},n,a,r,s)},i.prototype.getCalculatedOffset=function(t,e,i,o){return"bottom"==t?{top:e.top+e.height,left:e.left+e.width/2-i/2}:"top"==t?{top:e.top-o,left:e.left+e.width/2-i/2}:"left"==t?{top:e.top+e.height/2-o/2,left:e.left-i}:{top:e.top+e.height/2-o/2,left:e.left+e.width}},i.prototype.getViewportAdjustedDelta=function(t,e,i,o){var n={top:0,left:0};if(!this.$viewport)return n;var s=this.options.viewport&&this.options.viewport.padding||0,a=this.getPosition(this.$viewport);if(/right|left/.test(t)){var r=e.top-s-a.scroll,l=e.top+s-a.scroll+o;r<a.top?n.top=a.top-r:l>a.top+a.height&&(n.top=a.top+a.height-l)}else{var h=e.left-s,d=e.left+s+i;h<a.left?n.left=a.left-h:d>a.right&&(n.left=a.left+a.width-d)}return n},i.prototype.getTitle=function(){var t,e=this.$element,i=this.options;return t=e.attr("data-original-title")||("function"==typeof i.title?i.title.call(e[0]):i.title)},i.prototype.getUID=function(t){do t+=~~(1e6*Math.random());while(document.getElementById(t));return t},i.prototype.tip=function(){if(!this.$tip&&(this.$tip=t(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},i.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},i.prototype.enable=function(){this.enabled=!0},i.prototype.disable=function(){this.enabled=!1},i.prototype.toggleEnabled=function(){this.enabled=!this.enabled},i.prototype.toggle=function(e){var i=this;e&&(i=t(e.currentTarget).data("bs."+this.type),i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i))),e?(i.inState.click=!i.inState.click,i.isInStateTrue()?i.enter(i):i.leave(i)):i.tip().hasClass("in")?i.leave(i):i.enter(i)},i.prototype.destroy=function(){var t=this;clearTimeout(this.timeout),this.hide(function(){t.$element.off("."+t.type).removeData("bs."+t.type),t.$tip&&t.$tip.detach(),t.$tip=null,t.$arrow=null,t.$viewport=null})};var o=t.fn.tooltip;t.fn.tooltip=e,t.fn.tooltip.Constructor=i,t.fn.tooltip.noConflict=function(){return t.fn.tooltip=o,this}}(n),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.popover"),s="object"==typeof e&&e;!n&&/destroy|hide/.test(e)||(n||o.data("bs.popover",n=new i(this,s)),"string"==typeof e&&n[e]())})}var i=function(t,e){this.init("popover",t,e)};if(!t.fn.tooltip)throw new Error("Popover requires tooltip.js");i.VERSION="3.3.6",i.DEFAULTS=t.extend({},t.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),i.prototype=t.extend({},t.fn.tooltip.Constructor.prototype),i.prototype.constructor=i,i.prototype.getDefaults=function(){return i.DEFAULTS},i.prototype.setContent=function(){var t=this.tip(),e=this.getTitle(),i=this.getContent();t.find(".popover-title")[this.options.html?"html":"text"](e),t.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof i?"html":"append":"text"](i),t.removeClass("fade top bottom left right in"),t.find(".popover-title").html()||t.find(".popover-title").hide()},i.prototype.hasContent=function(){return this.getTitle()||this.getContent()},i.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},i.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var o=t.fn.popover;t.fn.popover=e,t.fn.popover.Constructor=i,t.fn.popover.noConflict=function(){return t.fn.popover=o,this}}(n),+function(t){"use strict";function e(i,o){this.$body=t(document.body),this.$scrollElement=t(t(i).is(document.body)?window:i),this.options=t.extend({},e.DEFAULTS,o),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",t.proxy(this.process,this)),this.refresh(),this.process()}function i(i){return this.each(function(){var o=t(this),n=o.data("bs.scrollspy"),s="object"==typeof i&&i;n||o.data("bs.scrollspy",n=new e(this,s)),"string"==typeof i&&n[i]()})}e.VERSION="3.3.6",e.DEFAULTS={offset:10},e.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},e.prototype.refresh=function(){var e=this,i="offset",o=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),t.isWindow(this.$scrollElement[0])||(i="position",o=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var e=t(this),n=e.data("target")||e.attr("href"),s=/^#./.test(n)&&t(n);return s&&s.length&&s.is(":visible")&&[[s[i]().top+o,n]]||null}).sort(function(t,e){return t[0]-e[0]}).each(function(){e.offsets.push(this[0]),e.targets.push(this[1])})},e.prototype.process=function(){var t=this.$scrollElement.scrollTop()+this.options.offset,e=this.getScrollHeight(),i=this.options.offset+e-this.$scrollElement.height(),o=this.offsets,n=this.targets,s=this.activeTarget,a;if(this.scrollHeight!=e&&this.refresh(),t>=i)return s!=(a=n[n.length-1])&&this.activate(a);if(s&&t<o[0])return this.activeTarget=null,this.clear();for(a=o.length;a--;)s!=n[a]&&t>=o[a]&&(void 0===o[a+1]||t<o[a+1])&&this.activate(n[a])},e.prototype.activate=function(e){this.activeTarget=e,this.clear();var i=this.selector+'[data-target="'+e+'"],'+this.selector+'[href="'+e+'"]',o=t(i).parents("li").addClass("active");
o.parent(".dropdown-menu").length&&(o=o.closest("li.dropdown").addClass("active")),o.trigger("activate.bs.scrollspy")},e.prototype.clear=function(){t(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var o=t.fn.scrollspy;t.fn.scrollspy=i,t.fn.scrollspy.Constructor=e,t.fn.scrollspy.noConflict=function(){return t.fn.scrollspy=o,this},t(window).on("load.bs.scrollspy.data-api",function(){t('[data-spy="scroll"]').each(function(){var e=t(this);i.call(e,e.data())})})}(n),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.tab");n||o.data("bs.tab",n=new i(this)),"string"==typeof e&&n[e]()})}var i=function(e){this.element=t(e)};i.VERSION="3.3.6",i.TRANSITION_DURATION=150,i.prototype.show=function(){var e=this.element,i=e.closest("ul:not(.dropdown-menu)"),o=e.data("target");if(o||(o=e.attr("href"),o=o&&o.replace(/.*(?=#[^\s]*$)/,"")),!e.parent("li").hasClass("active")){var n=i.find(".active:last a"),s=t.Event("hide.bs.tab",{relatedTarget:e[0]}),a=t.Event("show.bs.tab",{relatedTarget:n[0]});if(n.trigger(s),e.trigger(a),!a.isDefaultPrevented()&&!s.isDefaultPrevented()){var r=t(o);this.activate(e.closest("li"),i),this.activate(r,r.parent(),function(){n.trigger({type:"hidden.bs.tab",relatedTarget:e[0]}),e.trigger({type:"shown.bs.tab",relatedTarget:n[0]})})}}},i.prototype.activate=function(e,o,n){function s(){a.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),e.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),r?(e[0].offsetWidth,e.addClass("in")):e.removeClass("fade"),e.parent(".dropdown-menu").length&&e.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),n&&n()}var a=o.find("> .active"),r=n&&t.support.transition&&(a.length&&a.hasClass("fade")||!!o.find("> .fade").length);a.length&&r?a.one("bsTransitionEnd",s).emulateTransitionEnd(i.TRANSITION_DURATION):s(),a.removeClass("in")};var o=t.fn.tab;t.fn.tab=e,t.fn.tab.Constructor=i,t.fn.tab.noConflict=function(){return t.fn.tab=o,this};var n=function(i){i.preventDefault(),e.call(t(this),"show")};t(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',n).on("click.bs.tab.data-api",'[data-toggle="pill"]',n)}(n),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.affix"),s="object"==typeof e&&e;n||o.data("bs.affix",n=new i(this,s)),"string"==typeof e&&n[e]()})}var i=function(e,o){this.options=t.extend({},i.DEFAULTS,o),this.$target=t(this.options.target).on("scroll.bs.affix.data-api",t.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",t.proxy(this.checkPositionWithEventLoop,this)),this.$element=t(e),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};i.VERSION="3.3.6",i.RESET="affix affix-top affix-bottom",i.DEFAULTS={offset:0,target:window},i.prototype.getState=function(t,e,i,o){var n=this.$target.scrollTop(),s=this.$element.offset(),a=this.$target.height();if(null!=i&&"top"==this.affixed)return n<i&&"top";if("bottom"==this.affixed)return null!=i?!(n+this.unpin<=s.top)&&"bottom":!(n+a<=t-o)&&"bottom";var r=null==this.affixed,l=r?n:s.top,h=r?a:e;return null!=i&&n<=i?"top":null!=o&&l+h>=t-o&&"bottom"},i.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(i.RESET).addClass("affix");var t=this.$target.scrollTop(),e=this.$element.offset();return this.pinnedOffset=e.top-t},i.prototype.checkPositionWithEventLoop=function(){setTimeout(t.proxy(this.checkPosition,this),1)},i.prototype.checkPosition=function(){if(this.$element.is(":visible")){var e=this.$element.height(),o=this.options.offset,n=o.top,s=o.bottom,a=Math.max(t(document).height(),t(document.body).height());"object"!=typeof o&&(s=n=o),"function"==typeof n&&(n=o.top(this.$element)),"function"==typeof s&&(s=o.bottom(this.$element));var r=this.getState(a,e,n,s);if(this.affixed!=r){null!=this.unpin&&this.$element.css("top","");var l="affix"+(r?"-"+r:""),h=t.Event(l+".bs.affix");if(this.$element.trigger(h),h.isDefaultPrevented())return;this.affixed=r,this.unpin="bottom"==r?this.getPinnedOffset():null,this.$element.removeClass(i.RESET).addClass(l).trigger(l.replace("affix","affixed")+".bs.affix")}"bottom"==r&&this.$element.offset({top:a-e-s})}};var o=t.fn.affix;t.fn.affix=e,t.fn.affix.Constructor=i,t.fn.affix.noConflict=function(){return t.fn.affix=o,this},t(window).on("load",function(){t('[data-spy="affix"]').each(function(){var i=t(this),o=i.data();o.offset=o.offset||{},null!=o.offsetBottom&&(o.offset.bottom=o.offsetBottom),null!=o.offsetTop&&(o.offset.top=o.offsetTop),e.call(i,o)})})}(n)}).call(this),"undefined"==typeof Package&&(Package={}),Package["twbs:bootstrap"]={}}();
!function(){var t=Package.meteor.Meteor,e=Package.meteor.global,a=Package.meteor.meteorEnv,i=Package["momentjs:moment"].moment,s=Package.jquery.$,n=Package.jquery.jQuery;(function(){!function(t,e){if("function"==typeof define&&define.amd)define(["moment","jquery","exports"],function(a,i,s){t.daterangepicker=e(t,s,a,i)});else if("undefined"!=typeof exports){var a=require("moment"),s="undefined"!=typeof window?window.jQuery:void 0;if(!s)try{s=require("jquery"),s.fn||(s.fn={})}catch(t){if(!s)throw new Error("jQuery dependency not found")}e(t,exports,a,s)}else t.daterangepicker=e(t,{},t.moment||i,t.jQuery||t.Zepto||t.ender||t.$)}(this||{},function(t,e,a,i){var s=function(t,e,s){if(this.parentEl="body",this.element=i(t),this.startDate=a().startOf("day"),this.endDate=a().endOf("day"),this.minDate=!1,this.maxDate=!1,this.dateLimit=!1,this.autoApply=!1,this.singleDatePicker=!1,this.showDropdowns=!1,this.showWeekNumbers=!1,this.timePicker=!1,this.timePicker24Hour=!1,this.timePickerIncrement=1,this.timePickerSeconds=!1,this.linkedCalendars=!0,this.autoUpdateInput=!0,this.ranges={},this.opens="right",this.element.hasClass("pull-right")&&(this.opens="left"),this.drops="down",this.element.hasClass("dropup")&&(this.drops="up"),this.buttonClasses="btn btn-sm",this.applyClass="btn-success",this.cancelClass="btn-default",this.locale={format:"MM/DD/YYYY",separator:" - ",applyLabel:"Apply",cancelLabel:"Cancel",weekLabel:"W",customRangeLabel:"Custom Range",daysOfWeek:a.weekdaysMin(),monthNames:a.monthsShort(),firstDay:a.localeData().firstDayOfWeek()},this.callback=function(){},this.isShowing=!1,this.leftCalendar={},this.rightCalendar={},"object"==typeof e&&null!==e||(e={}),e=i.extend(this.element.data(),e),"string"!=typeof e.template&&(e.template='<div class="daterangepicker dropdown-menu"><div class="calendar left"><div class="daterangepicker_input"><input class="input-mini" type="text" name="daterangepicker_start" value="" /><i class="fa fa-calendar glyphicon glyphicon-calendar"></i><div class="calendar-time"><div></div><i class="fa fa-clock-o glyphicon glyphicon-time"></i></div></div><div class="calendar-table"></div></div><div class="calendar right"><div class="daterangepicker_input"><input class="input-mini" type="text" name="daterangepicker_end" value="" /><i class="fa fa-calendar glyphicon glyphicon-calendar"></i><div class="calendar-time"><div></div><i class="fa fa-clock-o glyphicon glyphicon-time"></i></div></div><div class="calendar-table"></div></div><div class="ranges"><div class="range_inputs"><button class="applyBtn" disabled="disabled" type="button"></button> <button class="cancelBtn" type="button"></button></div></div></div>'),this.parentEl=i(e.parentEl&&i(e.parentEl).length?e.parentEl:this.parentEl),this.container=i(e.template).appendTo(this.parentEl),"object"==typeof e.locale&&("string"==typeof e.locale.format&&(this.locale.format=e.locale.format),"string"==typeof e.locale.separator&&(this.locale.separator=e.locale.separator),"object"==typeof e.locale.daysOfWeek&&(this.locale.daysOfWeek=e.locale.daysOfWeek.slice()),"object"==typeof e.locale.monthNames&&(this.locale.monthNames=e.locale.monthNames.slice()),"number"==typeof e.locale.firstDay&&(this.locale.firstDay=e.locale.firstDay),"string"==typeof e.locale.applyLabel&&(this.locale.applyLabel=e.locale.applyLabel),"string"==typeof e.locale.cancelLabel&&(this.locale.cancelLabel=e.locale.cancelLabel),"string"==typeof e.locale.weekLabel&&(this.locale.weekLabel=e.locale.weekLabel),"string"==typeof e.locale.customRangeLabel&&(this.locale.customRangeLabel=e.locale.customRangeLabel)),"string"==typeof e.startDate&&(this.startDate=a(e.startDate,this.locale.format)),"string"==typeof e.endDate&&(this.endDate=a(e.endDate,this.locale.format)),"string"==typeof e.minDate&&(this.minDate=a(e.minDate,this.locale.format)),"string"==typeof e.maxDate&&(this.maxDate=a(e.maxDate,this.locale.format)),"object"==typeof e.startDate&&(this.startDate=a(e.startDate)),"object"==typeof e.endDate&&(this.endDate=a(e.endDate)),"object"==typeof e.minDate&&(this.minDate=a(e.minDate)),"object"==typeof e.maxDate&&(this.maxDate=a(e.maxDate)),this.minDate&&this.startDate.isBefore(this.minDate)&&(this.startDate=this.minDate.clone()),this.maxDate&&this.endDate.isAfter(this.maxDate)&&(this.endDate=this.maxDate.clone()),"string"==typeof e.applyClass&&(this.applyClass=e.applyClass),"string"==typeof e.cancelClass&&(this.cancelClass=e.cancelClass),"object"==typeof e.dateLimit&&(this.dateLimit=e.dateLimit),"string"==typeof e.opens&&(this.opens=e.opens),"string"==typeof e.drops&&(this.drops=e.drops),"boolean"==typeof e.showWeekNumbers&&(this.showWeekNumbers=e.showWeekNumbers),"string"==typeof e.buttonClasses&&(this.buttonClasses=e.buttonClasses),"object"==typeof e.buttonClasses&&(this.buttonClasses=e.buttonClasses.join(" ")),"boolean"==typeof e.showDropdowns&&(this.showDropdowns=e.showDropdowns),"boolean"==typeof e.singleDatePicker&&(this.singleDatePicker=e.singleDatePicker,this.singleDatePicker&&(this.endDate=this.startDate.clone())),"boolean"==typeof e.timePicker&&(this.timePicker=e.timePicker),"boolean"==typeof e.timePickerSeconds&&(this.timePickerSeconds=e.timePickerSeconds),"number"==typeof e.timePickerIncrement&&(this.timePickerIncrement=e.timePickerIncrement),"boolean"==typeof e.timePicker24Hour&&(this.timePicker24Hour=e.timePicker24Hour),"boolean"==typeof e.autoApply&&(this.autoApply=e.autoApply),"boolean"==typeof e.autoUpdateInput&&(this.autoUpdateInput=e.autoUpdateInput),"boolean"==typeof e.linkedCalendars&&(this.linkedCalendars=e.linkedCalendars),"function"==typeof e.isInvalidDate&&(this.isInvalidDate=e.isInvalidDate),0!=this.locale.firstDay)for(var n=this.locale.firstDay;n>0;)this.locale.daysOfWeek.push(this.locale.daysOfWeek.shift()),n--;var r,h,o;if("undefined"==typeof e.startDate&&"undefined"==typeof e.endDate&&i(this.element).is("input[type=text]")){var l=i(this.element).val(),c=l.split(this.locale.separator);r=h=null,2==c.length?(r=a(c[0],this.locale.format),h=a(c[1],this.locale.format)):this.singleDatePicker&&""!==l&&(r=a(l,this.locale.format),h=a(l,this.locale.format)),null!==r&&null!==h&&(this.setStartDate(r),this.setEndDate(h))}if("object"==typeof e.ranges){for(o in e.ranges){r="string"==typeof e.ranges[o][0]?a(e.ranges[o][0],this.locale.format):a(e.ranges[o][0]),h="string"==typeof e.ranges[o][1]?a(e.ranges[o][1],this.locale.format):a(e.ranges[o][1]),this.minDate&&r.isBefore(this.minDate)&&(r=this.minDate.clone());var d=this.maxDate;if(this.dateLimit&&r.clone().add(this.dateLimit).isAfter(d)&&(d=r.clone().add(this.dateLimit)),d&&h.isAfter(d)&&(h=d.clone()),!(this.minDate&&h.isBefore(this.minDate)||d&&r.isAfter(d))){var m=document.createElement("textarea");m.innerHTML=o;var f=m.value;this.ranges[f]=[r,h]}}var p="<ul>";for(o in this.ranges)p+="<li>"+o+"</li>";p+="<li>"+this.locale.customRangeLabel+"</li>",p+="</ul>",this.container.find(".ranges").prepend(p)}if("function"==typeof s&&(this.callback=s),this.timePicker||(this.startDate=this.startDate.startOf("day"),this.endDate=this.endDate.endOf("day"),this.container.find(".calendar-time").hide()),this.timePicker&&this.autoApply&&(this.autoApply=!1),this.autoApply&&"object"!=typeof e.ranges?this.container.find(".ranges").hide():this.autoApply&&this.container.find(".applyBtn, .cancelBtn").addClass("hide"),this.singleDatePicker&&(this.container.addClass("single"),this.container.find(".calendar.left").addClass("single"),this.container.find(".calendar.left").show(),this.container.find(".calendar.right").hide(),this.container.find(".daterangepicker_input input, .daterangepicker_input i").hide(),this.timePicker||this.container.find(".ranges").hide()),"undefined"!=typeof e.ranges||this.singleDatePicker||this.container.addClass("show-calendar"),this.container.addClass("opens"+this.opens),"undefined"!=typeof e.ranges&&"right"==this.opens){var u=this.container.find(".ranges"),g=u.clone();u.remove(),this.container.find(".calendar.left").parent().prepend(g)}this.container.find(".applyBtn, .cancelBtn").addClass(this.buttonClasses),this.applyClass.length&&this.container.find(".applyBtn").addClass(this.applyClass),this.cancelClass.length&&this.container.find(".cancelBtn").addClass(this.cancelClass),this.container.find(".applyBtn").html(this.locale.applyLabel),this.container.find(".cancelBtn").html(this.locale.cancelLabel),this.container.find(".calendar").on("click.daterangepicker",".prev",i.proxy(this.clickPrev,this)).on("click.daterangepicker",".next",i.proxy(this.clickNext,this)).on("click.daterangepicker","td.available",i.proxy(this.clickDate,this)).on("mouseenter.daterangepicker","td.available",i.proxy(this.hoverDate,this)).on("mouseleave.daterangepicker","td.available",i.proxy(this.updateFormInputs,this)).on("change.daterangepicker","select.yearselect",i.proxy(this.monthOrYearChanged,this)).on("change.daterangepicker","select.monthselect",i.proxy(this.monthOrYearChanged,this)).on("change.daterangepicker","select.hourselect,select.minuteselect,select.secondselect,select.ampmselect",i.proxy(this.timeChanged,this)).on("click.daterangepicker",".daterangepicker_input input",i.proxy(this.showCalendars,this)).on("change.daterangepicker",".daterangepicker_input input",i.proxy(this.formInputsChanged,this)),this.container.find(".ranges").on("click.daterangepicker","button.applyBtn",i.proxy(this.clickApply,this)).on("click.daterangepicker","button.cancelBtn",i.proxy(this.clickCancel,this)).on("click.daterangepicker","li",i.proxy(this.clickRange,this)).on("mouseenter.daterangepicker","li",i.proxy(this.hoverRange,this)).on("mouseleave.daterangepicker","li",i.proxy(this.updateFormInputs,this)),this.element.is("input")?this.element.on({"click.daterangepicker":i.proxy(this.show,this),"focus.daterangepicker":i.proxy(this.show,this),"keyup.daterangepicker":i.proxy(this.elementChanged,this),"keydown.daterangepicker":i.proxy(this.keydown,this)}):this.element.on("click.daterangepicker",i.proxy(this.toggle,this)),this.element.is("input")&&!this.singleDatePicker&&this.autoUpdateInput?(this.element.val(this.startDate.format(this.locale.format)+this.locale.separator+this.endDate.format(this.locale.format)),this.element.trigger("change")):this.element.is("input")&&this.autoUpdateInput&&(this.element.val(this.startDate.format(this.locale.format)),this.element.trigger("change"))};return s.prototype={constructor:s,setStartDate:function(t){"string"==typeof t&&(this.startDate=a(t,this.locale.format)),"object"==typeof t&&(this.startDate=a(t)),this.timePicker||(this.startDate=this.startDate.startOf("day")),this.timePicker&&this.timePickerIncrement&&this.startDate.minute(Math.round(this.startDate.minute()/this.timePickerIncrement)*this.timePickerIncrement),this.minDate&&this.startDate.isBefore(this.minDate)&&(this.startDate=this.minDate),this.maxDate&&this.startDate.isAfter(this.maxDate)&&(this.startDate=this.maxDate),this.isShowing||this.updateElement(),this.updateMonthsInView()},setEndDate:function(t){"string"==typeof t&&(this.endDate=a(t,this.locale.format)),"object"==typeof t&&(this.endDate=a(t)),this.timePicker||(this.endDate=this.endDate.endOf("day")),this.timePicker&&this.timePickerIncrement&&this.endDate.minute(Math.round(this.endDate.minute()/this.timePickerIncrement)*this.timePickerIncrement),this.endDate.isBefore(this.startDate)&&(this.endDate=this.startDate.clone()),this.maxDate&&this.endDate.isAfter(this.maxDate)&&(this.endDate=this.maxDate),this.dateLimit&&this.startDate.clone().add(this.dateLimit).isBefore(this.endDate)&&(this.endDate=this.startDate.clone().add(this.dateLimit)),this.isShowing||this.updateElement(),this.updateMonthsInView()},isInvalidDate:function(){return!1},updateView:function(){this.timePicker&&(this.renderTimePicker("left"),this.renderTimePicker("right"),this.endDate?this.container.find(".right .calendar-time select").removeAttr("disabled").removeClass("disabled"):this.container.find(".right .calendar-time select").attr("disabled","disabled").addClass("disabled")),this.endDate?(this.container.find('input[name="daterangepicker_end"]').removeClass("active"),this.container.find('input[name="daterangepicker_start"]').addClass("active")):(this.container.find('input[name="daterangepicker_end"]').addClass("active"),this.container.find('input[name="daterangepicker_start"]').removeClass("active")),this.updateMonthsInView(),this.updateCalendars(),this.updateFormInputs()},updateMonthsInView:function(){if(this.endDate){if(!this.singleDatePicker&&this.leftCalendar.month&&this.rightCalendar.month&&(this.startDate.format("YYYY-MM")==this.leftCalendar.month.format("YYYY-MM")||this.startDate.format("YYYY-MM")==this.rightCalendar.month.format("YYYY-MM"))&&(this.endDate.format("YYYY-MM")==this.leftCalendar.month.format("YYYY-MM")||this.endDate.format("YYYY-MM")==this.rightCalendar.month.format("YYYY-MM")))return;this.leftCalendar.month=this.startDate.clone().date(2),this.linkedCalendars||this.endDate.month()==this.startDate.month()&&this.endDate.year()==this.startDate.year()?this.rightCalendar.month=this.startDate.clone().date(2).add(1,"month"):this.rightCalendar.month=this.endDate.clone().date(2)}else this.leftCalendar.month.format("YYYY-MM")!=this.startDate.format("YYYY-MM")&&this.rightCalendar.month.format("YYYY-MM")!=this.startDate.format("YYYY-MM")&&(this.leftCalendar.month=this.startDate.clone().date(2),this.rightCalendar.month=this.startDate.clone().date(2).add(1,"month"))},updateCalendars:function(){if(this.timePicker){var t,e,a;if(this.endDate){if(t=parseInt(this.container.find(".left .hourselect").val(),10),e=parseInt(this.container.find(".left .minuteselect").val(),10),a=this.timePickerSeconds?parseInt(this.container.find(".left .secondselect").val(),10):0,!this.timePicker24Hour){var i=this.container.find(".left .ampmselect").val();"PM"===i&&t<12&&(t+=12),"AM"===i&&12===t&&(t=0)}}else if(t=parseInt(this.container.find(".right .hourselect").val(),10),e=parseInt(this.container.find(".right .minuteselect").val(),10),a=this.timePickerSeconds?parseInt(this.container.find(".right .secondselect").val(),10):0,!this.timePicker24Hour){var i=this.container.find(".right .ampmselect").val();"PM"===i&&t<12&&(t+=12),"AM"===i&&12===t&&(t=0)}this.leftCalendar.month.hour(t).minute(e).second(a),this.rightCalendar.month.hour(t).minute(e).second(a)}if(this.renderCalendar("left"),this.renderCalendar("right"),this.container.find(".ranges li").removeClass("active"),null!=this.endDate){var s=!0,n=0;for(var r in this.ranges){if(this.timePicker){if(this.startDate.isSame(this.ranges[r][0])&&this.endDate.isSame(this.ranges[r][1])){s=!1,this.chosenLabel=this.container.find(".ranges li:eq("+n+")").addClass("active").html();break}}else if(this.startDate.format("YYYY-MM-DD")==this.ranges[r][0].format("YYYY-MM-DD")&&this.endDate.format("YYYY-MM-DD")==this.ranges[r][1].format("YYYY-MM-DD")){s=!1,this.chosenLabel=this.container.find(".ranges li:eq("+n+")").addClass("active").html();break}n++}s&&(this.chosenLabel=this.container.find(".ranges li:last").addClass("active").html(),this.showCalendars())}},renderCalendar:function(t){var e="left"==t?this.leftCalendar:this.rightCalendar,s=e.month.month(),n=e.month.year(),r=e.month.hour(),h=e.month.minute(),o=e.month.second(),l=a([n,s]).daysInMonth(),c=a([n,s,1]),d=a([n,s,l]),m=a(c).subtract(1,"month").month(),f=a(c).subtract(1,"month").year(),p=a([f,m]).daysInMonth(),u=c.day(),e=[];e.firstDay=c,e.lastDay=d;for(var g=0;g<6;g++)e[g]=[];var D=p-u+this.locale.firstDay+1;D>p&&(D-=7),u==this.locale.firstDay&&(D=p-6);for(var k=a([f,m,D,12,h,o]),y,v,g=0,y=0,v=0;g<42;g++,y++,k=a(k).add(24,"hour"))g>0&&y%7===0&&(y=0,v++),e[v][y]=k.clone().hour(r).minute(h).second(o),k.hour(12),this.minDate&&e[v][y].format("YYYY-MM-DD")==this.minDate.format("YYYY-MM-DD")&&e[v][y].isBefore(this.minDate)&&"left"==t&&(e[v][y]=this.minDate.clone()),this.maxDate&&e[v][y].format("YYYY-MM-DD")==this.maxDate.format("YYYY-MM-DD")&&e[v][y].isAfter(this.maxDate)&&"right"==t&&(e[v][y]=this.maxDate.clone());"left"==t?this.leftCalendar.calendar=e:this.rightCalendar.calendar=e;var b="left"==t?this.minDate:this.startDate,C=this.maxDate,Y="left"==t?this.startDate:this.endDate,P='<table class="table-condensed">';P+="<thead>",P+="<tr>",this.showWeekNumbers&&(P+="<th></th>"),P+=b&&!b.isBefore(e.firstDay)||this.linkedCalendars&&"left"!=t?"<th></th>":'<th class="prev available"><i class="fa fa-chevron-left glyphicon glyphicon-chevron-left"></i></th>';var w=this.locale.monthNames[e[1][1].month()]+e[1][1].format(" YYYY");if(this.showDropdowns){for(var M=e[1][1].month(),x=e[1][1].year(),I=C&&C.year()||x+5,L=b&&b.year()||x-50,A=x==L,S=x==I,_='<select class="monthselect">',B=0;B<12;B++)_+=(!A||B>=b.month())&&(!S||B<=C.month())?"<option value='"+B+"'"+(B===M?" selected='selected'":"")+">"+this.locale.monthNames[B]+"</option>":"<option value='"+B+"'"+(B===M?" selected='selected'":"")+" disabled='disabled'>"+this.locale.monthNames[B]+"</option>";_+="</select>";for(var E='<select class="yearselect">',j=L;j<=I;j++)E+='<option value="'+j+'"'+(j===x?' selected="selected"':"")+">"+j+"</option>";E+="</select>",w=_+E}if(P+='<th colspan="5" class="month">'+w+"</th>",P+=C&&!C.isAfter(e.lastDay)||this.linkedCalendars&&"right"!=t&&!this.singleDatePicker?"<th></th>":'<th class="next available"><i class="fa fa-chevron-right glyphicon glyphicon-chevron-right"></i></th>',P+="</tr>",P+="<tr>",this.showWeekNumbers&&(P+='<th class="week">'+this.locale.weekLabel+"</th>"),i.each(this.locale.daysOfWeek,function(t,e){P+="<th>"+e+"</th>"}),P+="</tr>",P+="</thead>",P+="<tbody>",null==this.endDate&&this.dateLimit){var W=this.startDate.clone().add(this.dateLimit).endOf("day");C&&!W.isBefore(C)||(C=W)}for(var v=0;v<6;v++){P+="<tr>",this.showWeekNumbers&&(P+='<td class="week">'+e[v][0].week()+"</td>");for(var y=0;y<7;y++){var O=[];e[v][y].isSame(new Date,"day")&&O.push("today"),e[v][y].isoWeekday()>5&&O.push("weekend"),e[v][y].month()!=e[1][1].month()&&O.push("off"),this.minDate&&e[v][y].isBefore(this.minDate,"day")&&O.push("off","disabled"),C&&e[v][y].isAfter(C,"day")&&O.push("off","disabled"),this.isInvalidDate(e[v][y])&&O.push("off","disabled"),e[v][y].format("YYYY-MM-DD")==this.startDate.format("YYYY-MM-DD")&&O.push("active","start-date"),null!=this.endDate&&e[v][y].format("YYYY-MM-DD")==this.endDate.format("YYYY-MM-DD")&&O.push("active","end-date"),null!=this.endDate&&e[v][y]>this.startDate&&e[v][y]<this.endDate&&O.push("in-range");for(var H="",N=!1,g=0;g<O.length;g++)H+=O[g]+" ","disabled"==O[g]&&(N=!0);N||(H+="available"),P+='<td class="'+H.replace(/^\s+|\s+$/g,"")+'" data-title="r'+v+"c"+y+'">'+e[v][y].date()+"</td>"}P+="</tr>"}P+="</tbody>",P+="</table>",this.container.find(".calendar."+t+" .calendar-table").html(P)},renderTimePicker:function(t){var e,a,i,s=this.maxDate;!this.dateLimit||this.maxDate&&!this.startDate.clone().add(this.dateLimit).isAfter(this.maxDate)||(s=this.startDate.clone().add(this.dateLimit)),"left"==t?(a=this.startDate.clone(),i=this.minDate):"right"==t&&(a=this.endDate?this.endDate.clone():this.startDate.clone(),i=this.startDate),e='<select class="hourselect">';for(var n=this.timePicker24Hour?0:1,r=this.timePicker24Hour?23:12,h=n;h<=r;h++){var o=h;this.timePicker24Hour||(o=a.hour()>=12?12==h?12:h+12:12==h?0:h);var l=a.clone().hour(o),c=!1;i&&l.minute(59).isBefore(i)&&(c=!0),s&&l.minute(0).isAfter(s)&&(c=!0),e+=o!=a.hour()||c?c?'<option value="'+h+'" disabled="disabled" class="disabled">'+h+"</option>":'<option value="'+h+'">'+h+"</option>":'<option value="'+h+'" selected="selected">'+h+"</option>"}e+="</select> ",e+=': <select class="minuteselect">';for(var h=0;h<60;h+=this.timePickerIncrement){var d=h<10?"0"+h:h,l=a.clone().minute(h),c=!1;i&&l.second(59).isBefore(i)&&(c=!0),s&&l.second(0).isAfter(s)&&(c=!0),e+=a.minute()!=h||c?c?'<option value="'+h+'" disabled="disabled" class="disabled">'+d+"</option>":'<option value="'+h+'">'+d+"</option>":'<option value="'+h+'" selected="selected">'+d+"</option>"}if(e+="</select> ",this.timePickerSeconds){e+=': <select class="secondselect">';for(var h=0;h<60;h++){var d=h<10?"0"+h:h,l=a.clone().second(h),c=!1;i&&l.isBefore(i)&&(c=!0),s&&l.isAfter(s)&&(c=!0),e+=a.second()!=h||c?c?'<option value="'+h+'" disabled="disabled" class="disabled">'+d+"</option>":'<option value="'+h+'">'+d+"</option>":'<option value="'+h+'" selected="selected">'+d+"</option>"}e+="</select> "}if(!this.timePicker24Hour){e+='<select class="ampmselect">';var m="",f="";i&&a.clone().hour(12).minute(0).second(0).isBefore(i)&&(m=' disabled="disabled" class="disabled"'),s&&a.clone().hour(0).minute(0).second(0).isAfter(s)&&(f=' disabled="disabled" class="disabled"'),e+=a.hour()>=12?'<option value="AM"'+m+'>AM</option><option value="PM" selected="selected"'+f+">PM</option>":'<option value="AM" selected="selected"'+m+'>AM</option><option value="PM"'+f+">PM</option>",e+="</select>"}this.container.find(".calendar."+t+" .calendar-time div").html(e)},updateFormInputs:function(){this.container.find("input[name=daterangepicker_start]").is(":focus")||this.container.find("input[name=daterangepicker_end]").is(":focus")||(this.container.find("input[name=daterangepicker_start]").val(this.startDate.format(this.locale.format)),this.endDate&&this.container.find("input[name=daterangepicker_end]").val(this.endDate.format(this.locale.format)),this.singleDatePicker||this.endDate&&(this.startDate.isBefore(this.endDate)||this.startDate.isSame(this.endDate))?this.container.find("button.applyBtn").removeAttr("disabled"):this.container.find("button.applyBtn").attr("disabled","disabled"))},move:function(){var t={top:0,left:0},e,a=i(window).width();this.parentEl.is("body")||(t={top:this.parentEl.offset().top-this.parentEl.scrollTop(),left:this.parentEl.offset().left-this.parentEl.scrollLeft()},a=this.parentEl[0].clientWidth+this.parentEl.offset().left),e="up"==this.drops?this.element.offset().top-this.container.outerHeight()-t.top:this.element.offset().top+this.element.outerHeight()-t.top,this.container["up"==this.drops?"addClass":"removeClass"]("dropup"),"left"==this.opens?(this.container.css({top:e,right:a-this.element.offset().left-this.element.outerWidth(),left:"auto"}),this.container.offset().left<0&&this.container.css({right:"auto",left:9})):"center"==this.opens?(this.container.css({top:e,left:this.element.offset().left-t.left+this.element.outerWidth()/2-this.container.outerWidth()/2,right:"auto"}),this.container.offset().left<0&&this.container.css({right:"auto",left:9})):(this.container.css({top:e,left:this.element.offset().left-t.left,right:"auto"}),this.container.offset().left+this.container.outerWidth()>i(window).width()&&this.container.css({left:"auto",right:0}))},show:function(t){this.isShowing||(this._outsideClickProxy=i.proxy(function(t){this.outsideClick(t)},this),i(document).on("mousedown.daterangepicker",this._outsideClickProxy).on("touchend.daterangepicker",this._outsideClickProxy).on("click.daterangepicker","[data-toggle=dropdown]",this._outsideClickProxy).on("focusin.daterangepicker",this._outsideClickProxy),i(window).on("resize.daterangepicker",i.proxy(function(t){this.move(t)},this)),this.oldStartDate=this.startDate.clone(),this.oldEndDate=this.endDate.clone(),this.updateView(),this.container.show(),this.move(),this.element.trigger("show.daterangepicker",this),this.isShowing=!0)},hide:function(t){this.isShowing&&(this.endDate||(this.startDate=this.oldStartDate.clone(),this.endDate=this.oldEndDate.clone()),this.startDate.isSame(this.oldStartDate)&&this.endDate.isSame(this.oldEndDate)||this.callback(this.startDate,this.endDate,this.chosenLabel),this.updateElement(),i(document).off(".daterangepicker"),i(window).off(".daterangepicker"),this.container.hide(),this.element.trigger("hide.daterangepicker",this),this.isShowing=!1)},toggle:function(t){this.isShowing?this.hide():this.show()},outsideClick:function(t){var e=i(t.target);"focusin"==t.type||e.closest(this.element).length||e.closest(this.container).length||e.closest(".calendar-table").length||this.hide()},showCalendars:function(){this.container.addClass("show-calendar"),this.move(),this.element.trigger("showCalendar.daterangepicker",this)},hideCalendars:function(){this.container.removeClass("show-calendar"),this.element.trigger("hideCalendar.daterangepicker",this)},hoverRange:function(t){if(!this.container.find("input[name=daterangepicker_start]").is(":focus")&&!this.container.find("input[name=daterangepicker_end]").is(":focus")){var e=t.target.innerHTML;if(e==this.locale.customRangeLabel)this.updateView();else{var a=this.ranges[e];this.container.find("input[name=daterangepicker_start]").val(a[0].format(this.locale.format)),this.container.find("input[name=daterangepicker_end]").val(a[1].format(this.locale.format))}}},clickRange:function(t){var e=t.target.innerHTML;if(this.chosenLabel=e,e==this.locale.customRangeLabel)this.showCalendars();else{var a=this.ranges[e];this.startDate=a[0],this.endDate=a[1],this.timePicker||(this.startDate.startOf("day"),this.endDate.endOf("day")),this.hideCalendars(),this.clickApply()}},clickPrev:function(t){var e=i(t.target).parents(".calendar");e.hasClass("left")?(this.leftCalendar.month.subtract(1,"month"),this.linkedCalendars&&this.rightCalendar.month.subtract(1,"month")):this.rightCalendar.month.subtract(1,"month"),this.updateCalendars()},clickNext:function(t){var e=i(t.target).parents(".calendar");e.hasClass("left")?this.leftCalendar.month.add(1,"month"):(this.rightCalendar.month.add(1,"month"),this.linkedCalendars&&this.leftCalendar.month.add(1,"month")),this.updateCalendars()},hoverDate:function(t){if(!this.container.find("input[name=daterangepicker_start]").is(":focus")&&!this.container.find("input[name=daterangepicker_end]").is(":focus")&&i(t.target).hasClass("available")){var e=i(t.target).attr("data-title"),a=e.substr(1,1),s=e.substr(3,1),n=i(t.target).parents(".calendar"),r=n.hasClass("left")?this.leftCalendar.calendar[a][s]:this.rightCalendar.calendar[a][s];this.endDate?this.container.find("input[name=daterangepicker_start]").val(r.format(this.locale.format)):this.container.find("input[name=daterangepicker_end]").val(r.format(this.locale.format));var h=this.leftCalendar,o=this.rightCalendar,l=this.startDate;this.endDate||this.container.find(".calendar td").each(function(t,e){if(!i(e).hasClass("week")){var a=i(e).attr("data-title"),s=a.substr(1,1),n=a.substr(3,1),c=i(e).parents(".calendar"),d=c.hasClass("left")?h.calendar[s][n]:o.calendar[s][n];d.isAfter(l)&&d.isBefore(r)?i(e).addClass("in-range"):i(e).removeClass("in-range")}})}},clickDate:function(t){if(i(t.target).hasClass("available")){var e=i(t.target).attr("data-title"),a=e.substr(1,1),s=e.substr(3,1),n=i(t.target).parents(".calendar"),r=n.hasClass("left")?this.leftCalendar.calendar[a][s]:this.rightCalendar.calendar[a][s];if(this.endDate||r.isBefore(this.startDate)){if(this.timePicker){var h=parseInt(this.container.find(".left .hourselect").val(),10);if(!this.timePicker24Hour){var o=n.find(".ampmselect").val();"PM"===o&&h<12&&(h+=12),"AM"===o&&12===h&&(h=0)}var l=parseInt(this.container.find(".left .minuteselect").val(),10),c=this.timePickerSeconds?parseInt(this.container.find(".left .secondselect").val(),10):0;r=r.clone().hour(h).minute(l).second(c)}this.endDate=null,this.setStartDate(r.clone())}else{if(this.timePicker){var h=parseInt(this.container.find(".right .hourselect").val(),10);if(!this.timePicker24Hour){var o=this.container.find(".right .ampmselect").val();"PM"===o&&h<12&&(h+=12),"AM"===o&&12===h&&(h=0)}var l=parseInt(this.container.find(".right .minuteselect").val(),10),c=this.timePickerSeconds?parseInt(this.container.find(".right .secondselect").val(),10):0;r=r.clone().hour(h).minute(l).second(c)}this.setEndDate(r.clone()),this.autoApply&&this.clickApply()}this.singleDatePicker&&(this.setEndDate(this.startDate),this.timePicker||this.clickApply()),this.updateView()}},clickApply:function(t){this.hide(),this.element.trigger("apply.daterangepicker",this)},clickCancel:function(t){this.startDate=this.oldStartDate,this.endDate=this.oldEndDate,this.hide(),this.element.trigger("cancel.daterangepicker",this)},monthOrYearChanged:function(t){var e=i(t.target).closest(".calendar").hasClass("left"),a=e?"left":"right",s=this.container.find(".calendar."+a),n=parseInt(s.find(".monthselect").val(),10),r=s.find(".yearselect").val();e||(r<this.startDate.year()||r==this.startDate.year()&&n<this.startDate.month())&&(n=this.startDate.month(),r=this.startDate.year()),this.minDate&&(r<this.minDate.year()||r==this.minDate.year()&&n<this.minDate.month())&&(n=this.minDate.month(),r=this.minDate.year()),this.maxDate&&(r>this.maxDate.year()||r==this.maxDate.year()&&n>this.maxDate.month())&&(n=this.maxDate.month(),r=this.maxDate.year()),e?(this.leftCalendar.month.month(n).year(r),this.linkedCalendars&&(this.rightCalendar.month=this.leftCalendar.month.clone().add(1,"month"))):(this.rightCalendar.month.month(n).year(r),this.linkedCalendars&&(this.leftCalendar.month=this.rightCalendar.month.clone().subtract(1,"month"))),this.updateCalendars()},timeChanged:function(t){var e=i(t.target).closest(".calendar"),a=e.hasClass("left"),s=parseInt(e.find(".hourselect").val(),10),n=parseInt(e.find(".minuteselect").val(),10),r=this.timePickerSeconds?parseInt(e.find(".secondselect").val(),10):0;if(!this.timePicker24Hour){var h=e.find(".ampmselect").val();"PM"===h&&s<12&&(s+=12),"AM"===h&&12===s&&(s=0)}if(a){var o=this.startDate.clone();o.hour(s),o.minute(n),o.second(r),this.setStartDate(o),this.singleDatePicker?this.endDate=this.startDate.clone():this.endDate&&this.endDate.format("YYYY-MM-DD")==o.format("YYYY-MM-DD")&&this.endDate.isBefore(o)&&this.setEndDate(o.clone())}else if(this.endDate){var l=this.endDate.clone();l.hour(s),l.minute(n),l.second(r),this.setEndDate(l)}this.updateCalendars(),this.updateFormInputs(),this.renderTimePicker("left"),this.renderTimePicker("right")},formInputsChanged:function(t){var e=i(t.target).closest(".calendar").hasClass("right"),s=a(this.container.find('input[name="daterangepicker_start"]').val(),this.locale.format),n=a(this.container.find('input[name="daterangepicker_end"]').val(),this.locale.format);s.isValid()&&n.isValid()&&(e&&n.isBefore(s)&&(s=n.clone()),this.setStartDate(s),this.setEndDate(n),e?this.container.find('input[name="daterangepicker_start"]').val(this.startDate.format(this.locale.format)):this.container.find('input[name="daterangepicker_end"]').val(this.endDate.format(this.locale.format))),this.updateCalendars(),this.timePicker&&(this.renderTimePicker("left"),this.renderTimePicker("right"))},elementChanged:function(){if(this.element.is("input")&&this.element.val().length&&!(this.element.val().length<this.locale.format.length)){var t=this.element.val().split(this.locale.separator),e=null,i=null;2===t.length&&(e=a(t[0],this.locale.format),i=a(t[1],this.locale.format)),(this.singleDatePicker||null===e||null===i)&&(e=a(this.element.val(),this.locale.format),i=e),e.isValid()&&i.isValid()&&(this.setStartDate(e),this.setEndDate(i),this.updateView())}},keydown:function(t){9!==t.keyCode&&13!==t.keyCode||this.hide()},updateElement:function(){this.element.is("input")&&!this.singleDatePicker&&this.autoUpdateInput?(this.element.val(this.startDate.format(this.locale.format)+this.locale.separator+this.endDate.format(this.locale.format)),this.element.trigger("change")):this.element.is("input")&&this.autoUpdateInput&&(this.element.val(this.startDate.format(this.locale.format)),this.element.trigger("change"))},remove:function(){this.container.remove(),this.element.off(".daterangepicker"),this.element.removeData()}},i.fn.daterangepicker=function(t,e){return this.each(function(){var a=i(this);a.data("daterangepicker")&&a.data("daterangepicker").remove(),a.data("daterangepicker",new s(a,t,e))}),this},s})}).call(this),"undefined"==typeof Package&&(Package={}),Package["dangrossman:bootstrap-daterangepicker"]={}}();
!function(){"undefined"==typeof Package&&(Package={}),Package["ohif:dicom-services"]={}}();
!function(){var a;"undefined"==typeof Package&&(Package={}),function(a,n){for(var o in n)o in a||(a[o]=n[o])}(Package["ohif:wadoproxy"]={},{WADOProxy:a})}();
!function(){var t=Package.meteor.Meteor,e=Package.meteor.global,n=Package.meteor.meteorEnv,o=Package.jquery.$,i=Package.jquery.jQuery,r=Package.http.HTTP,a=Package.random.Random,s=Package["silentcicero:jszip"].JSZip,l=Package["aldeed:simple-schema"].SimpleSchema,u=Package["aldeed:simple-schema"].MongoObject,c=Package["accounts-base"].Accounts,d=Package["momentjs:moment"].moment,p=Package["ohif:viewerbase"].dialogPolyfill,m=Package["ohif:wadoproxy"].WADOProxy,h=Package.modules.meteorInstall,b=Package.modules.Buffer,f=Package.modules.process,y=Package["ecmascript-runtime"].Symbol,g=Package["ecmascript-runtime"].Map,v=Package["ecmascript-runtime"].Set,S=Package["babel-runtime"].meteorBabelHelpers,k=Package.promise.Promise,x=Package["aldeed:collection2-core"].Collection2,T=Package.webapp.WebApp,w=Package.logging.Log,I=Package.deps.Tracker,D=Package.deps.Deps,C=Package.session.Session,P=Package["ddp-client"].DDP,L=Package.mongo.Mongo,M=Package.ui.Blaze,j=Package.ui.UI,N=Package.ui.Handlebars,E=Package.spacebars.Spacebars,_=Package["templating-runtime"].Template,R=Package.check.check,O=Package.check.Match,V=Package.underscore._,z=Package.ejson.EJSON,F=Package["launch-screen"].LaunchScreen,A=Package.htmljs.HTML,q,W,H,B,U,$,Y=h({node_modules:{meteor:{"ohif:study-list":{both:{"index.js":["./base.js","./lib","./schema","./collections.js",function(t,e,n){n.import("./base.js"),n.import("./lib"),n.import("./schema"),n.import("./collections.js")}],"base.js":["meteor/ohif:core",function(t,e,n){var o;n.import("meteor/ohif:core",{OHIF:function(t){o=t}}),o.studylist={collections:{},actions:{}}}],"collections.js":["meteor/mongo","meteor/ohif:core","meteor/ohif:study-list/both/schema/servers.js",function(t,e,n){n.export({StudyImportStatus:function(){return a},Servers:function(){return q},CurrentServer:function(){return W}});var o;n.import("meteor/mongo",{Mongo:function(t){o=t}});var i;n.import("meteor/ohif:core",{OHIF:function(t){i=t}});var r;n.import("meteor/ohif:study-list/both/schema/servers.js",{Servers:function(t){r=t}});var a=new o.Collection("studyImportStatus");a._debugName="StudyImportStatus",i.studylist.collections.StudyImportStatus=a,n.runModuleSetters(q=new o.Collection("servers")),q._debugName="Servers",n.runModuleSetters(W=new o.Collection("currentServer")),W._debugName="CurrentServer"}],lib:{"getCurrentServer.js":function(){H=function t(){var e=W.findOne();if(e){var n=q.findOne({_id:e.serverId});return n}}},"index.js":["./getCurrentServer.js",function(t,e,n){n.import("./getCurrentServer.js")}]},schema:{"index.js":["./servers.js",function(t,e,n){n.import("./servers.js")}],"servers.js":["meteor/aldeed:simple-schema",function(t,e,n){n.export({DICOMWebRequestOptions:function(){return l},DICOMWebServer:function(){return u},DIMSEPeer:function(){return c},DIMSEServer:function(){return d},UISettings:function(){return p},PrefetchSchema:function(){return m},MouseButtonToolSchema:function(){return h},PublicServerConfig:function(){return b},Servers:function(){return f},ServerConfiguration:function(){return y}});var o;n.import("meteor/aldeed:simple-schema",{SimpleSchema:function(t){o=t}});var i={type:String,label:"Server Name",max:100},r={type:String,label:"Server Type",allowedValues:["dicomWeb","dimse"],valuesLabels:["DICOM Web","DIMSE"],optional:!0},a={type:String,label:"WADO URI root",max:1e3},s=["wwwc","zoom","pan","stackScroll"],l=new o({auth:{type:String,label:"Authentication",optional:!0},logRequests:{type:Boolean,defaultValue:!0,label:"Requests"},logResponses:{type:Boolean,defaultValue:!1,label:"Responses"},logTiming:{type:Boolean,defaultValue:!0,label:"Timing"}}),u=new o({name:i,type:r,wadoUriRoot:a,wadoRoot:{type:String,label:"WADO root",max:1e3},imageRendering:{type:String,label:"Image rendering",allowedValues:["wadouri","orthanc"],valuesLabels:["WADO URI","ORTHANC"]},qidoRoot:{type:String,label:"QIDO root",max:1e3},qidoSupportsIncludeField:{type:Boolean,label:"QIDO supports including fields",defaultValue:!1},requestOptions:{type:l,label:"Request Options"}}),c=new o({aeTitle:{type:String,label:"AE Title"},hostAE:{type:String,label:"AE Host",optional:!0},host:{type:String,label:"Host Domain/IP",regEx:o.RegEx.WeakDomain},port:{type:Number,label:"Port",min:1,defaultValue:11112,max:65535},default:{type:Boolean,label:"Default",defaultValue:!1},server:{type:Boolean,label:"Server",defaultValue:!1},supportsInstanceRetrievalByStudyUid:{type:Boolean,label:"Supports instance retrieval by StudyUid",defaultValue:!0}}),d=new o({name:i,type:r,wadoUriRoot:a,requestOptions:{type:l,label:"Request Options"},peers:{type:[c],label:"Peer List",minCount:1}}),p=new o({studyListFunctionsEnabled:{type:Boolean,label:"Study List Functions Enabled?",defaultValue:!0},leftSidebarOpen:{type:Boolean,label:"Left sidebar open by default?",defaultValue:!1},displaySetNavigationLoopOverSeries:{type:Boolean,label:"The UP/DOWN display set navigation buttons will start over when reach the last display set in viewport?",defaultValue:!0},displaySetNavigationMultipleViewports:{type:Boolean,label:"The UP/DOWN display set navigation buttons will iterate over all the viewports at once?",defaultValue:!1},displayEchoUltrasoundWorkflow:{type:Boolean,label:"Enable cine dialog enhancements for multiframe images.",defaultValue:!1},autoPositionMeasurementsTextCallOuts:{type:String,label:"Auto position text call-outs for measurements when creating them.",defaultValue:"TRBL"},studyListDateFilterNumDays:{type:Number,label:"Number of days to be used on Study List date filter",min:1},showStackLoadingProgressBar:{type:Boolean,label:"Show a progress bar closest to the thumbnail showing how much the stack has loaded",defaultValue:!0}}),m=new o({order:{type:String,label:"Prefetch Order",allowedValues:["topdown","downward","closest"],optional:!1},displaySetCount:{type:Number,label:"Display Set Count",min:1,defaultValue:1}}),h=new o({left:{type:String,label:"Left Mouse Button",allowedValues:s,optional:!0},right:{type:String,label:"Right Mouse Button",allowedValues:s,optional:!0},middle:{type:String,label:"Middle Mouse Button",allowedValues:s,optional:!0}}),b=new o({verifyEmail:{type:Boolean,label:"Verify Email",defaultValue:!1},demoUserEnabled:{type:Boolean,label:"Creates demo user on startup and show TestDrive button",defaultValue:!0},ui:{type:p,label:"UI Settings"},prefetch:{type:m,label:"Prefetch settings"},defaultMouseButtonTools:{type:h,label:"Default Mouse Button Tools"}}),f=new o({dicomWeb:{type:[u],label:"DICOMWeb Servers",optional:!0},dimse:{type:[d],label:"DIMSE Servers",optional:!0}}),y=new o({servers:{type:f,label:"Servers"},defaultServiceType:{type:String,label:"Default Service Type",defaultValue:"dicomWeb"},dropCollections:{type:Boolean,label:"Drop database collections",defaultValue:!1},public:{type:b,label:"Public Server Configuration"},origin:{type:String,label:"Origin",optional:!0}})}]}},client:{"index.js":["./base","./collections","./lib","./components","./dropdown",function(t,e,n){n.import("./base"),n.import("./collections"),n.import("./lib"),n.import("./components"),n.import("./dropdown")}],"base.js":["meteor/ohif:core",function(t,e,n){var o;n.import("meteor/ohif:core",{OHIF:function(t){o=t}}),Object.assign(o.studylist,{callbacks:{}})}],"dropdown.js":["meteor/meteor","meteor/ohif:core",function(t,e,n){var o;n.import("meteor/meteor",{Meteor:function(t){o=t}});var i;n.import("meteor/ohif:core",{OHIF:function(t){i=t}}),o.startup(function(){i.studylist.dropdown=new i.ui.Dropdown,i.studylist.dropdown.setItems([{action:i.studylist.viewSeriesDetails,text:"View Series Details"},{text:"Anonymize",disabled:!0},{text:"Send",disabled:!0,separatorAfter:!0},{text:"Delete",disabled:!0},{action:i.studylist.exportSelectedStudies,text:"Export",title:"Export Selected Studies"}])})}],collections:{"index.js":["./studies.js","./subscriptions.js",function(t,e,n){n.import("./studies.js"),n.import("./subscriptions.js")}],"studies.js":["meteor/meteor","meteor/ohif:core",function(t,e,n){var o;n.import("meteor/meteor",{Meteor:function(t){o=t}});var i;n.import("meteor/ohif:core",{OHIF:function(t){i=t}}),o.startup(function(){var t=new o.Collection(null);t._debugName="Studies",i.studylist.collections.Studies=t})}],"subscriptions.js":function(){t.subscribe("servers"),t.subscribe("currentServer")}},components:{"index.js":["./seriesDetailsModal","./serverInformation","./studylist","./themeSelector",function(t,e,n){n.import("./seriesDetailsModal"),n.import("./serverInformation"),n.import("./studylist"),n.import("./themeSelector")}],seriesDetailsModal:{"index.js":["./seriesDetailsModal.html","./seriesDetailsTable/seriesDetailsTable.html","./seriesDetailsTable/seriesDetailsTable.styl","./seriesDetailsTable/seriesDetailsTable.js",function(t,e,n){n.import("./seriesDetailsModal.html"),n.import("./seriesDetailsTable/seriesDetailsTable.html"),n.import("./seriesDetailsTable/seriesDetailsTable.styl"),n.import("./seriesDetailsTable/seriesDetailsTable.js")}],"seriesDetailsModal.html":["./template.seriesDetailsModal.js",function(t,e,n){n.exports=t("./template.seriesDetailsModal.js")}],"template.seriesDetailsModal.js":function(){_.__checkName("seriesDetailsModal"),_.seriesDetailsModal=new _("Template.seriesDetailsModal",function(){var t=this;return M._TemplateWith(function(){return E.dataMustache(t.lookup("extend"),t.lookup("."),E.kw({title:"Series Details"}))},function(){return E.include(t.lookupTemplate("dialogSimple"),function(){return["\n ",M._TemplateWith(function(){return{selectedStudies:E.call(E.dot(t.lookup("."),"selectedStudies"))}},function(){return E.include(t.lookupTemplate("seriesDetailsTable"))}),"\n "]})})})},seriesDetailsTable:{"seriesDetailsTable.html":["./template.seriesDetailsTable.js",function(t,e,n){n.exports=t("./template.seriesDetailsTable.js")}],"template.seriesDetailsTable.js":function(){_.__checkName("seriesDetailsTable"),_.seriesDetailsTable=new _("Template.seriesDetailsTable",function(){var t=this;return[M.Unless(function(){return E.call(E.dot(t.lookup("selectedStudies"),"length"))},function(){return["\n ",A.P({align:"center"},"Series details not found"),"\n "]}),"\n ",M.Each(function(){return E.call(t.lookup("selectedStudies"))},function(){return["\n ",A.DIV({class:"selectedStudyContainer"},"\n ",A.TABLE({class:"table table-responsive tblStudyDetails"},"\n ",A.TBODY("\n ",A.TR("\n ",A.TD({class:"center patientID"},"\n ",A.DIV("\n ",A.SPAN("Patient ID"),"\n "),"\n ",A.INPUT({type:"text",class:"form-control",id:"patientID",placeholder:"Patient ID",disabled:"disabled",value:function(){return E.mustache(t.lookup("patientId"))}}),"\n "),"\n ",A.TD({class:"patientName"},"\n ",A.DIV("\n ",A.SPAN("Patient Name"),"\n "),"\n ",A.INPUT({type:"text",class:"form-control",id:"patientName",placeholder:"Patient Name",disabled:"disabled",value:function(){return E.mustache(t.lookup("formatPN"),t.lookup("patientName"))}}),"\n "),"\n ",A.TD({class:"accessionNumber"},"\n ",A.DIV("\n ",A.SPAN("Accession Number"),"\n "),"\n ",A.INPUT({type:"text",class:"form-control",id:"accessionNumber",placeholder:"Accession Number",disabled:"disabled",value:function(){return E.mustache(t.lookup("accessionNumber"))}}),"\n "),"\n "),"\n ",A.TR("\n ",A.TD({class:"studyDescription"},"\n ",A.DIV("\n ",A.SPAN("Study Description"),"\n "),"\n ",A.INPUT({type:"text",class:"form-control",id:"studyDescription",placeholder:"Study Description",disabled:"disabled",value:function(){return E.mustache(t.lookup("studyDescription"))}}),"\n "),"\n ",A.TD({class:"studyDate"},"\n ",A.DIV("\n ",A.SPAN("Study Date"),"\n "),"\n ",A.INPUT({type:"text",class:"form-control",id:"studyDate",placeholder:"Study Date",disabled:"disabled",value:function(){return E.mustache(t.lookup("formatDA"),t.lookup("studyDate"))}}),"\n "),"\n\n ",A.TD(),"\n "),"\n "),"\n "),"\n\n ",A.TABLE({class:"table table-responsive tblSeriesDetails"},"\n ",A.THEAD("\n ",A.TR("\n ",A.TH({class:"header"},"Number"),"\n ",A.TH({class:"header"},"Modality"),"\n ",A.TH({class:"header"},"Description"),"\n ",A.TH({class:"header"},"Instances"),"\n "),"\n "),"\n\n ",A.TBODY("\n ",M.If(function(){return E.call(t.lookup("displaySeriesLoadingText"))},function(){return["\n ",A.TR("\n ",A.TD({colspan:"4",class:"center"},"\n ",E.include(t.lookupTemplate("loadingText")),"\n "),"\n "),"\n "]}),"\n\n ",M.Each(function(){return E.call(t.lookup("seriesList"))},function(){return["\n ",A.TR("\n ",A.TD({class:"center"},M.View("lookup:seriesNumber",function(){return E.mustache(t.lookup("seriesNumber"))})),"\n ",A.TD({class:"center"},M.View("lookup:modality",function(){return E.mustache(t.lookup("modality"))})),"\n ",A.TD({class:"center"},M.View("lookup:seriesDescription",function(){return E.mustache(t.lookup("seriesDescription"))})),"\n ",A.TD({class:"center"},M.View("lookup:instances.length",function(){return E.mustache(E.dot(t.lookup("instances"),"length"))})),"\n "),"\n "]}),"\n "),"\n "),"\n "),"\n "]})]})},"seriesDetailsTable.js":["meteor/templating","meteor/reactive-dict","meteor/underscore","meteor/ohif:core",function(t,e,n){var o;n.import("meteor/templating",{Template:function(t){o=t}});var i;n.import("meteor/reactive-dict",{ReactiveDict:function(t){i=t}});var r;n.import("meteor/underscore",{_:function(t){r=t}});var a;n.import("meteor/ohif:core",{OHIF:function(t){a=t}}),o.seriesDetailsTable.onCreated(function(){var t=o.instance();t.selectedStudies=new i;var e=t.data.selectedStudies;e&&(r.each(e,function(t){t.displaySeriesLoadingText=!0}),t.selectedStudies.set("studies",e))}),o.seriesDetailsTable.onRendered(function(){var t=o.instance(),e=t.selectedStudies.get("studies");e&&r.map(e,function(n,o){e[o].seriesList=[],a.studylist.retrieveStudyMetadata(function(n){e[o].seriesList=n.seriesList,e[o].displaySeriesLoadingText=!1,t.selectedStudies.set("studies",e)})})}),o.seriesDetailsTable.helpers({selectedStudies:function(){function t(){var t=o.instance();return t.selectedStudies.get("studies")}return t}()})}],"seriesDetailsTable.styl":["./seriesDetailsTable.styl.css",function(t,e,n){n.exports=t("./seriesDetailsTable.styl.css")}],"seriesDetailsTable.styl.css":["meteor/modules",function(t,e,n){n.exports=t("meteor/modules").addStyles('.theme-icon-crickets,\n.theme-icon-tide,\n.theme-icon-tigerlily,\n.theme-icon-quartz,\n.theme-icon-overcast,\n.theme-icon-mint,\n.theme-icon-honeycomb {\n display: inline-block;\n background: url("/packages/ohif_design/assets/theme-icons.png") no-repeat;\n overflow: hidden;\n text-indent: -9999px;\n text-align: left;\n}\n.theme-icon-crickets {\n background-position: 0px 0px;\n width: 64px;\n height: 56px;\n}\n.theme-icon-tide {\n background-position: 0px -56px;\n width: 64px;\n height: 54px;\n}\n.theme-icon-tigerlily {\n background-position: 0px -110px;\n width: 62px;\n height: 61px;\n}\n.theme-icon-quartz {\n background-position: 0px -171px;\n width: 59px;\n height: 64px;\n}\n.theme-icon-overcast {\n background-position: 0px -235px;\n width: 58px;\n height: 37px;\n}\n.theme-icon-mint {\n background-position: 0px -272px;\n width: 57px;\n height: 61px;\n}\n.theme-icon-honeycomb {\n background-position: 0px -333px;\n width: 50px;\n height: 58px;\n}\n.selectedStudyContainer {\n margin-bottom: 15px;\n}\n.selectedStudyContainer .tblStudyDetails tbody > tr > td > label {\n color: $textPrimaryColor;\n}\n.selectedStudyContainer .tblStudyDetails tbody > tr > td > input[type="text"] {\n height: 28px;\n background-color: $primaryBackgroundColor;\n color: $textPrimaryColor;\n width: calc(100% - 10px);\n -webkit-border-radius: 4px;\n -moz-border-radius: 4px;\n -ms-border-radius: 4px;\n -o-border-radius: 4px;\n border-radius: 4px;\n box-sizing: border-box;\n}\n.selectedStudyContainer .tblSeriesDetails thead > tr > th {\n text-align: center;\n}\n.selectedStudyContainer .tblSeriesDetails tbody > tr td {\n text-align: center;\n color: $textPrimaryColor;\n}\n.selectedStudyContainer .tblSeriesDetails .loadingTextDiv {\n font-size: 13px;\n color: $textSecondaryColor;\n}\n')}]}},serverInformation:{"index.js":["./serverInformationDicomWeb/serverInformationDicomWeb.html","./serverInformationDicomWeb/serverInformationDicomWeb.js","./serverInformationDimse/serverInformationDimse.html","./serverInformationDimse/serverInformationDimse.js","./serverInformationForm/serverInformationForm.html","./serverInformationForm/serverInformationForm.js","./serverInformationList/serverInformationList.html","./serverInformationList/serverInformationList.js","./serverInformationModal/serverInformationModal.html","./serverInformationModal/serverInformationModal.styl","./serverInformationModal/serverInformationModal.js",function(t,e,n){n.import("./serverInformationDicomWeb/serverInformationDicomWeb.html"),n.import("./serverInformationDicomWeb/serverInformationDicomWeb.js"),n.import("./serverInformationDimse/serverInformationDimse.html"),n.import("./serverInformationDimse/serverInformationDimse.js"),n.import("./serverInformationForm/serverInformationForm.html"),n.import("./serverInformationForm/serverInformationForm.js"),n.import("./serverInformationList/serverInformationList.html"),n.import("./serverInformationList/serverInformationList.js"),n.import("./serverInformationModal/serverInformationModal.html"),n.import("./serverInformationModal/serverInformationModal.styl"),n.import("./serverInformationModal/serverInformationModal.js")}],serverInformationDicomWeb:{"serverInformationDicomWeb.html":["./template.serverInformationDicomWeb.js",function(t,e,n){n.exports=t("./template.serverInformationDicomWeb.js")}],"template.serverInformationDicomWeb.js":function(){_.__checkName("serverInformationDicomWeb"),_.serverInformationDicomWeb=new _("Template.serverInformationDicomWeb",function(){var t=this;return[A.DIV({class:"row"},"\n ",A.DIV({class:"col-lg-6"},"\n ",M._TemplateWith(function(){return{labelClass:E.call("form-group"),key:E.call("wadoUriRoot")}},function(){return E.include(t.lookupTemplate("inputText"))}),"\n "),"\n ",A.DIV({class:"col-lg-6"},"\n ",M._TemplateWith(function(){return{labelClass:E.call("form-group"),key:E.call("wadoRoot")}},function(){return E.include(t.lookupTemplate("inputText"))}),"\n "),"\n ",A.DIV({class:"col-lg-6"},"\n ",M._TemplateWith(function(){return{labelClass:E.call("form-group"),key:E.call("imageRendering"),hideSearch:E.call(!0),options:E.call(E.dataMustache(t.lookup("clone"),E.kw({placeholder:"Select an option"})))}},function(){return E.include(t.lookupTemplate("inputSelect"))}),"\n "),"\n ",A.DIV({class:"col-lg-6"},"\n ",M._TemplateWith(function(){return{labelClass:E.call("form-group"),key:E.call("qidoRoot")}},function(){return E.include(t.lookupTemplate("inputText"))}),"\n "),"\n ",A.DIV({class:"col-lg-6"},"\n ",A.Raw("<strong>QIDO options</strong>"),"\n ",A.DIV({class:"form-group"},"\n ",A.DIV({class:"form-control"},"\n ",A.DIV({class:"checkbox"},"\n ",M._TemplateWith(function(){return{key:E.call("qidoSupportsIncludeField")}},function(){return E.include(t.lookupTemplate("inputCheckbox"))}),"\n "),"\n "),"\n "),"\n "),"\n "),A.Raw("\n <hr>\n <h4>Request options</h4>\n "),M._TemplateWith(function(){return{class:E.call("row"),key:E.call("requestOptions")}},function(){return E.include(t.lookupTemplate("group"),function(){return["\n ",A.DIV({class:"col-lg-6"},"\n ",M._TemplateWith(function(){return{labelClass:E.call("form-group"),key:E.call("auth")}},function(){return E.include(t.lookupTemplate("inputText"))}),"\n "),"\n ",A.DIV({class:"col-lg-6"},"\n ",A.STRONG("Logging options"),"\n ",A.DIV({class:"form-group"},"\n ",A.DIV({class:"form-control clearfix"},"\n ",A.DIV({class:"checkbox pull-left"},"\n ",M._TemplateWith(function(){return{key:E.call("logRequests")}},function(){return E.include(t.lookupTemplate("inputCheckbox"))}),"\n "),"\n ",A.DIV({class:"checkbox pull-left"},"\n ",M._TemplateWith(function(){return{key:E.call("logResponses")}},function(){return E.include(t.lookupTemplate("inputCheckbox"))}),"\n "),"\n ",A.DIV({class:"checkbox pull-left"},"\n ",M._TemplateWith(function(){return{key:E.call("logTiming")}},function(){return E.include(t.lookupTemplate("inputCheckbox"))}),"\n "),"\n "),"\n "),"\n "),"\n "]})})]})},"serverInformationDicomWeb.js":function(){_.serverInformationDicomWeb.onRendered(function(){var t=_.instance();t.autorun(function(){var e=t.data.mode.get();if("edit"===e){var n=t.data.currentItem.get();t.data.form.value(n)}})})}},serverInformationDimse:{"serverInformationDimse.html":["./template.serverInformationDimse.js",function(t,e,n){n.exports=t("./template.serverInformationDimse.js")}],"template.serverInformationDimse.js":function(){_.__checkName("serverInformationDimse"),_.serverInformationDimse=new _("Template.serverInformationDimse",function(){var t=this;return[A.DIV({class:"row"},"\n ",A.DIV({class:"col-lg-6"},"\n ",M._TemplateWith(function(){return{labelClass:E.call("form-group"),key:E.call("wadoUriRoot")}},function(){return E.include(t.lookupTemplate("inputText"))}),"\n "),"\n "),"\n ",A.DIV({class:"panel panel-default panel-body"},"\n ",A.DIV({class:"clearfix"},"\n ",A.Raw('<h4 class="pull-left">Peer List</h4>'),"\n ",M._TemplateWith(function(){return{class:E.call("btn btn-primary pull-right"),action:E.call("newPeer"),params:E.call(t.lookup("peer"))}},function(){return E.include(t.lookupTemplate("button"),function(){return"New peer"})}),"\n "),"\n ",A.Raw("<hr>"),"\n ",M._TemplateWith(function(){return{class:E.call("row"),key:E.call("peers"),arrayValues:E.call(!0)}},function(){return E.include(t.lookupTemplate("group"),function(){return["\n ",M.Each(function(){return{_sequence:E.call(E.dot(t.lookup("instance"),"peers","get")),_variable:"peer"}},function(){return["\n ",M._TemplateWith(function(){return{class:E.call("col-lg-6")}},function(){return E.include(t.lookupTemplate("group"),function(){return["\n ",A.DIV({class:"panel panel-default panel-body"},"\n ",A.DIV({class:"row"},"\n ",A.DIV({class:"col-lg-6"},"\n ",M._TemplateWith(function(){return{class:E.call("form-control"),key:E.call("aeTitle")}},function(){return E.include(t.lookupTemplate("inputText"))}),"\n "),"\n ",A.DIV({class:"col-lg-6"},"\n ",M._TemplateWith(function(){return{class:E.call("form-control"),key:E.call("hostAE")}},function(){return E.include(t.lookupTemplate("inputText"))}),"\n "),"\n ",A.DIV({class:"col-lg-6"},"\n ",M._TemplateWith(function(){return{class:E.call("form-control"),key:E.call("host")}},function(){return E.include(t.lookupTemplate("inputText"))}),"\n "),"\n ",A.DIV({class:"col-lg-6"},"\n ",M._TemplateWith(function(){return{class:E.call("form-control"),key:E.call("port")}},function(){return E.include(t.lookupTemplate("inputText"))}),"\n "),"\n ",A.DIV({class:"col-lg-12"},"\n ",A.STRONG("Settings"),"\n ",A.DIV({class:"form-group"},"\n ",A.DIV({class:"form-control height-auto clearfix"},"\n ",A.DIV({class:"checkbox pull-left"},"\n ",M._TemplateWith(function(){return{key:E.call("default")}},function(){return E.include(t.lookupTemplate("inputCheckbox"))}),"\n "),"\n ",A.DIV({class:"checkbox pull-left"},"\n ",M._TemplateWith(function(){return{key:E.call("server")}},function(){return E.include(t.lookupTemplate("inputCheckbox"))}),"\n "),"\n ",A.DIV({class:"checkbox pull-left"},"\n ",M._TemplateWith(function(){return{key:E.call("supportsInstanceRetrievalByStudyUid")}},function(){return E.include(t.lookupTemplate("inputCheckbox"))}),"\n "),"\n "),"\n "),"\n "),"\n ",A.DIV({class:"col-lg-12 text-right"},"\n ",M._TemplateWith(function(){return{class:E.call("btn btn-sm btn-danger"),action:E.call("removePeer"),params:E.call(t.lookup("@index"))}},function(){return E.include(t.lookupTemplate("button"),function(){return"Remove"})}),"\n "),"\n "),"\n "),"\n "]})}),"\n "]}),"\n "]})}),"\n "),A.Raw("\n <hr>")]})},"serverInformationDimse.js":function(){_.serverInformationDimse.onCreated(function(){var t=_.instance();t.peers=new ReactiveVar([]),t.autorun(function(){var e=t.data.currentItem.get();e&&t.peers.set(e.peers||[])});var e=t.data.api;V.extend(e,{newPeer:function(){function e(){var e=t.peers.get();e.push({}),t.peers.set(e)}return e}(),removePeer:function(){function e(e){var n=t.peers.get();n.splice(e,1),t.peers.set(n);var o=t.data.currentItem.get();o.peers=n,I.afterFlush(function(){return t.data.form.value(o)})}return e}()})}),_.serverInformationDimse.onRendered(function(){var t=_.instance();t.autorun(function(){var e=t.data.mode.get();if("edit"===e){var n=t.data.currentItem.get();t.data.form.value(n)}})})}},serverInformationForm:{"serverInformationForm.html":["./template.serverInformationForm.js",function(t,e,n){n.exports=t("./template.serverInformationForm.js")}],"template.serverInformationForm.js":function(){_.__checkName("serverInformationForm"),_.serverInformationForm=new _("Template.serverInformationForm",function(){var t=this;return M._TemplateWith(function(){return{class:E.call("server-information-form"),schema:E.call(E.dot(t.lookup("instance"),"currentSchema")),api:E.call(E.dot(t.lookup("."),"api"))}},function(){return E.include(t.lookupTemplate("form"),function(){return["\n ",M._TemplateWith(function(){return{key:E.call("_id")}},function(){return E.include(t.lookupTemplate("inputHidden"))}),"\n ",A.DIV({class:"row"},"\n ",A.DIV({class:"col-lg-6"},"\n ",M._TemplateWith(function(){return{labelClass:E.call("form-group"),key:E.call("name")}},function(){return E.include(t.lookupTemplate("inputText"))}),"\n "),"\n ",A.DIV({class:"col-lg-6"},"\n ",M._TemplateWith(function(){return{labelClass:E.call("form-group"),key:E.call("type"),hideSearch:E.call(!0),disabled:E.call(E.dataMustache(t.lookup("eq"),E.dot(t.lookup("."),"mode","get"),"edit")),options:E.call(E.dataMustache(t.lookup("clone"),E.kw({placeholder:"Choose a server type"})))}},function(){return E.include(t.lookupTemplate("inputSelect"))}),"\n "),"\n "),"\n ",A.HR(),"\n ",M.If(function(){return E.dataMustache(t.lookup("eq"),E.dot(t.lookup("."),"serverType","get"),"dicomWeb")},function(){return["\n ",M._TemplateWith(function(){return E.call(t.lookup("."))},function(){return E.include(t.lookupTemplate("serverInformationDicomWeb"))}),"\n "]}),"\n ",M.If(function(){return E.dataMustache(t.lookup("eq"),E.dot(t.lookup("."),"serverType","get"),"dimse")},function(){return["\n ",M._TemplateWith(function(){return E.call(t.lookup("."))},function(){return E.include(t.lookupTemplate("serverInformationDimse"))}),"\n "]}),"\n ",M.If(function(){return E.call(E.dot(t.lookup("."),"serverType","get"))},function(){return["\n ",A.DIV("\n ",M._TemplateWith(function(){return{class:E.call("btn btn-primary"),action:E.call("save")}},function(){return E.include(t.lookupTemplate("button"),function(){return"Save"})}),"\n "),"\n "]}),"\n "]})})})},"serverInformationForm.js":["meteor/meteor","meteor/templating","meteor/reactive-var","meteor/ohif:study-list/both/schema/servers.js",function(t,e,n){var o;n.import("meteor/meteor",{Meteor:function(t){o=t}});var i;n.import("meteor/templating",{Template:function(t){i=t}});var r;n.import("meteor/reactive-var",{ReactiveVar:function(t){r=t}});var a;n.import("meteor/ohif:study-list/both/schema/servers.js",{DICOMWebServer:function(t){a=t}});var s;n.import("meteor/ohif:study-list/both/schema/servers.js",{DIMSEServer:function(t){s=t}}),i.serverInformationForm.onCreated(function(){var t=i.instance();t.data.api={save:function(){function e(){if(t.data.form.validate()){var e=t.data.form.value();o.call("serverSave",e,function(e){t.data.resetState()})}}return e}()},t.currentSchema=new r(a)}),i.serverInformationForm.onRendered(function(){var t=i.instance();t.data.$form=t.$("form").first(),t.data.form=t.data.$form.data("component"),t.autorun(function(){var e=t.$("[data-key=type] :input").data("component");e.depend();var n=e.value();t.data.serverType.set(n),"dimse"===n?t.currentSchema.set(s):t.currentSchema.set(a)}),t.autorun(function(){var e=t.data.mode.get();if("edit"===e){var n=t.data.currentItem.get();t.data.form.value(n)}})})}]},serverInformationList:{"serverInformationList.html":["./template.serverInformationList.js",function(t,e,n){n.exports=t("./template.serverInformationList.js")}],"template.serverInformationList.js":function(){_.__checkName("serverInformationList"),_.serverInformationList=new _("Template.serverInformationList",function(){var t=this;return M._TemplateWith(function(){return{api:E.call(E.dot(t.lookup("instance"),"api"))}},function(){return E.include(t.lookupTemplate("form"),function(){return["\n ",A.TABLE({id:"tblServer",class:"table"},"\n ",A.THEAD("\n ",A.TR("\n ",A.TH("Name"),"\n ",A.TH("Type"),"\n ",A.TH({class:"text-right"},"Actions"),"\n "),"\n "),"\n ",A.TBODY("\n ",M.Each(function(){return{_sequence:E.call(t.lookup("servers")),_variable:"server"}},function(){
return["\n ",A.TR("\n ",A.TD(M.View("lookup:server.name",function(){return E.mustache(E.dot(t.lookup("server"),"name"))})),"\n ",A.TD(M.View("lookup:server.type",function(){return E.mustache(E.dot(t.lookup("server"),"type"))})),"\n ",A.TD({class:"text-right"},"\n ",A.DIV({class:"btn-group",role:"group","aria-label":"Actions"},"\n ",M._TemplateWith(function(){return{class:E.call("btn btn-sm btn-default"),action:E.call("use"),params:E.call(t.lookup("server")),title:E.call("Use this server"),disabled:E.call(E.dataMustache(t.lookup("isActive"),t.lookup("server")))}},function(){return E.include(t.lookupTemplate("button"),function(){return["\n ",M.If(function(){return E.dataMustache(t.lookup("isActive"),t.lookup("server"))},function(){return["\n ",A.I({class:"fa fa-check-square-o"}),"\n "]},function(){return["\n ",A.I({class:"fa fa-square-o"}),"\n "]}),"\n "]})}),"\n ",M._TemplateWith(function(){return{class:E.call("btn btn-sm btn-default"),action:E.call("edit"),params:E.call(t.lookup("server")),title:E.call("Edit"),disabled:E.call(E.dataMustache(t.lookup("eq"),E.dot(t.lookup("server"),"origin"),"json"))}},function(){return E.include(t.lookupTemplate("button"),function(){return["\n ",A.I({class:"fa fa-pencil"}),"\n "]})}),"\n ",M._TemplateWith(function(){return{class:E.call("btn btn-sm btn-danger"),action:E.call("delete"),params:E.call(t.lookup("server")),title:E.call("Remove"),disabled:E.call(E.dataMustache(t.lookup("eq"),E.dot(t.lookup("server"),"origin"),"json"))}},function(){return E.include(t.lookupTemplate("button"),function(){return["\n ",A.I({class:"fa fa-trash"}),"\n "]})}),"\n "),"\n "),"\n "),"\n "]},function(){return["\n ",A.TR("\n ",A.TD({class:"text-center",colspan:"3"},"No servers found"),"\n "),"\n "]}),"\n "),"\n "),"\n ",M._TemplateWith(function(){return{class:E.call("btn btn-sm btn-default"),action:E.call("add")}},function(){return E.include(t.lookupTemplate("button"),function(){return["\n ",A.I({class:"fa fa-plus"})," Add a new server\n "]})}),"\n "]})})})},"serverInformationList.js":function(){_.serverInformationList.onCreated(function(){var e=_.instance();e.api={add:function(){function t(){return e.data.mode.set("create")}return t}(),edit:function(){function t(t){e.data.currentItem.set(t),e.data.mode.set("edit")}return t}(),delete:function(){function e(e){confirm("Are you sure you want to remove this peer?")&&t.call("serverRemove",e._id,function(t){})}return e}(),use:function(){function e(e){t.call("serverSetActive",e._id,function(t){})}return e}()}}),_.serverInformationList.helpers({isActive:function(){function t(t){var e=W.findOne();if(e)return t._id===e.serverId}return t}(),servers:function(){function t(){var t={sort:{origin:-1,type:1,name:1}};return q.find({},t).fetch()}return t}()})}},serverInformationModal:{"serverInformationModal.html":["./template.serverInformationModal.js",function(t,e,n){n.exports=t("./template.serverInformationModal.js")}],"template.serverInformationModal.js":function(){_.__checkName("serverInformationModal"),_.serverInformationModal=new _("Template.serverInformationModal",function(){var t=this;return M._TemplateWith(function(){return E.dataMustache(t.lookup("extend"),t.lookup("."),E.kw({dialogClass:"modal-lg",title:"Server Information"}))},function(){return E.include(t.lookupTemplate("dialogSimple"),function(){return["\n ",M.If(function(){return E.dataMustache(t.lookup("eq"),E.dot(t.lookup("instance"),"container","mode","get"),"list")},function(){return["\n ",M._TemplateWith(function(){return E.call(E.dot(t.lookup("instance"),"container"))},function(){return E.include(t.lookupTemplate("serverInformationList"))}),"\n "]},function(){return["\n ",M._TemplateWith(function(){return E.call(E.dot(t.lookup("instance"),"container"))},function(){return E.include(t.lookupTemplate("serverInformationForm"))}),"\n "]}),"\n ",M._TemplateWith(function(){return"dialogFooter"},function(){return E.include(t.lookupTemplate("section"),function(){return M.Unless(function(){return E.dataMustache(t.lookup("eq"),E.dot(t.lookup("instance"),"container","mode","get"),"list")},function(){return A.BUTTON({type:"button",class:"btn btn-default js-back"},"Back")})})}),"\n "]})})})},"serverInformationModal.js":["meteor/templating","meteor/reactive-var",function(t,e,n){var o;n.import("meteor/templating",{Template:function(t){o=t}});var i;n.import("meteor/reactive-var",{ReactiveVar:function(t){i=t}}),o.serverInformationModal.onCreated(function(){var t=o.instance();t.container={mode:new i("list"),serverType:new i(null),currentItem:new i(null),$form:null,resetState:function(){function e(){t.container.mode.set("list"),t.container.serverType.set(null),t.container.currentItem.set(null)}return e}()}}),o.serverInformationModal.events({"click .js-back":function(){function t(t,e){e.container.resetState()}return t}()})}],"serverInformationModal.styl":["./serverInformationModal.styl.css",function(t,e,n){n.exports=t("./serverInformationModal.styl.css")}],"serverInformationModal.styl.css":["meteor/modules",function(t,e,n){n.exports=t("meteor/modules").addStyles(".server-information-form label.wrapper {\n display: block;\n}\n.server-information-form .checkbox {\n margin: 0 8px 0 0;\n}\n")}]}},studylist:{"index.js":["./studylist.html","./studylist.styl","./studylistStudy/studylistStudy.html","./studylistStudy/studylistStudy.js","./studylistStudy/studylistStudy.styl","./studylistResult/studylistResult.html","./studylistResult/studylistResult.js","./studylistResult/studylistResult.styl","./studylistToolbar/studylistToolbar.html","./studylistToolbar/studylistToolbar.js","./studylistToolbar/studylistToolbar.styl","./studylistPagination/studylistPagination.html","./studylistPagination/studylistPagination.styl","./studylistPagination/studylistPagination.js",function(t,e,n){n.import("./studylist.html"),n.import("./studylist.styl"),n.import("./studylistStudy/studylistStudy.html"),n.import("./studylistStudy/studylistStudy.js"),n.import("./studylistStudy/studylistStudy.styl"),n.import("./studylistResult/studylistResult.html"),n.import("./studylistResult/studylistResult.js"),n.import("./studylistResult/studylistResult.styl"),n.import("./studylistToolbar/studylistToolbar.html"),n.import("./studylistToolbar/studylistToolbar.js"),n.import("./studylistToolbar/studylistToolbar.styl"),n.import("./studylistPagination/studylistPagination.html"),n.import("./studylistPagination/studylistPagination.styl"),n.import("./studylistPagination/studylistPagination.js")}],"studylist.html":["./template.studylist.js",function(t,e,n){n.exports=t("./template.studylist.js")}],"template.studylist.js":function(){_.__checkName("studylist"),_.studylist=new _("Template.studylist",function(){var t=this;return A.DIV({class:"study-list-wrapper"},"\n ",M._TemplateWith(function(){return E.dataMustache(t.lookup("clone"),t.lookup("."))},function(){return E.include(t.lookupTemplate("studylistResult"))}),"\n ")})},"studylist.styl":["./studylist.styl.css",function(t,e,n){n.exports=t("./studylist.styl.css")}],"studylist.styl.css":["meteor/modules",function(t,e,n){n.exports=t("meteor/modules").addStyles('.theme-icon-crickets,\n.theme-icon-tide,\n.theme-icon-tigerlily,\n.theme-icon-quartz,\n.theme-icon-overcast,\n.theme-icon-mint,\n.theme-icon-honeycomb {\n display: inline-block;\n background: url("/packages/ohif_design/assets/theme-icons.png") no-repeat;\n overflow: hidden;\n text-indent: -9999px;\n text-align: left;\n}\n.theme-icon-crickets {\n background-position: 0px 0px;\n width: 64px;\n height: 56px;\n}\n.theme-icon-tide {\n background-position: 0px -56px;\n width: 64px;\n height: 54px;\n}\n.theme-icon-tigerlily {\n background-position: 0px -110px;\n width: 62px;\n height: 61px;\n}\n.theme-icon-quartz {\n background-position: 0px -171px;\n width: 59px;\n height: 64px;\n}\n.theme-icon-overcast {\n background-position: 0px -235px;\n width: 58px;\n height: 37px;\n}\n.theme-icon-mint {\n background-position: 0px -272px;\n width: 57px;\n height: 61px;\n}\n.theme-icon-honeycomb {\n background-position: 0px -333px;\n width: 50px;\n height: 58px;\n}\n.study-list-wrapper {\n color: #fff;\n margin: 2px auto 0;\n height: calc(100% - 91px);\n position: relative;\n width: 100%;\n}\n.study-list-wrapper {\n background-color: #000;\n}\nbody.theme-tide .study-list-wrapper {\n background-color: #000;\n}\nbody.theme-tigerlily .study-list-wrapper {\n background-color: #000;\n}\nbody.theme-crickets .study-list-wrapper {\n background-color: #000;\n}\nbody.theme-honeycomb .study-list-wrapper {\n background-color: #000;\n}\nbody.theme-mint .study-list-wrapper {\n background-color: #000;\n}\nbody.theme-overcast .study-list-wrapper {\n background-color: #000;\n}\nbody.theme-quartz .study-list-wrapper {\n background-color: #000;\n}\n.study-list-wrapper .loadingTextDiv {\n font-size: 30px;\n}\n.study-list-wrapper .loadingTextDiv {\n color: #91b9cd;\n}\nbody.theme-tide .study-list-wrapper .loadingTextDiv {\n color: #91b9cd;\n}\nbody.theme-tigerlily .study-list-wrapper .loadingTextDiv {\n color: #9ccdf8;\n}\nbody.theme-crickets .study-list-wrapper .loadingTextDiv {\n color: #8be7b5;\n}\nbody.theme-honeycomb .study-list-wrapper .loadingTextDiv {\n color: #fab797;\n}\nbody.theme-mint .study-list-wrapper .loadingTextDiv {\n color: #a7e9b3;\n}\nbody.theme-overcast .study-list-wrapper .loadingTextDiv {\n color: #73f2fc;\n}\nbody.theme-quartz .study-list-wrapper .loadingTextDiv {\n color: #d7e8fe;\n}\n')}],studylistPagination:{"studylistPagination.html":["./template.studylistPagination.js",function(t,e,n){n.exports=t("./template.studylistPagination.js")}],"template.studylistPagination.js":function(){_.__checkName("studylistPagination"),_.studylistPagination=new _("Template.studylistPagination",function(){var t=this;return M._TemplateWith(function(){return{class:E.call("studylistPagination"),schema:E.call(E.dot(t.lookup("instance"),"schema"))}},function(){return E.include(t.lookupTemplate("form"),function(){return["\n ",A.DIV({class:"row"},"\n ",A.DIV({class:"col-xs-4 col-sm-3 col-md-3"},"\n ",A.DIV({class:"form-inline form-group rows-per-page"},"\n ",A.SPAN("Show"),"\n ",M._TemplateWith(function(){return{class:E.call("select-small js-select-rows-per-page"),key:E.call("rowsPerPage"),hideSearch:E.call(!0)}},function(){return E.include(t.lookupTemplate("inputSelect"))}),"\n ",A.SPAN("rows per page"),"\n "),"\n "),"\n ",A.DIV({class:"col-xs-8 col-sm-9 col-md-9"},"\n ",A.DIV({class:"form-inline form-group page-number"},"\n ",A.LABEL("\n ",A.UL({class:"pagination-control no-margins"}),"\n "),"\n "),"\n "),"\n "),"\n "]})})})},"studylistPagination.js":["meteor/templating","meteor/aldeed:simple-schema","./studylistPagination.html",function(t,e,n){var i;n.import("meteor/templating",{Template:function(t){i=t}});var r;n.import("meteor/aldeed:simple-schema",{SimpleSchema:function(t){r=t}}),n.import("./studylistPagination.html");var a=10;i.studylistPagination.onCreated(function(){var t=i.instance();t.parent=this.parent(1),t.schema=new r({rowsPerPage:{type:Number,allowedValues:[25,50,100],defaultValue:25}})}),i.studylistPagination.onRendered(function(){var t=i.instance(),e=t.$(".pagination-control");t.autorun(function(){var n=t.parent.recordCount.get(),o=t.parent.rowsPerPage.get();if(e.data().twbsPagination&&e.twbsPagination("destroy"),n&&o){var i=Math.ceil(n/o);e.twbsPagination({totalPages:i,visiblePages:a,onPageClick:function(){function e(e,n){t.parent.currentPage.set(n-1)}return e}()})}})}),i.studylistPagination.helpers({recordCount:function(){function t(){var t=i.instance();return t.parent.recordCount.get()}return t}(),isRowsPerPageSelected:function(){function t(t){var e=i.instance();return t===e.parent.rowsPerPage.get()}return t}()}),i.studylistPagination.events({"change .js-select-rows-per-page":function(){function t(t,e){var n=o(t.currentTarget).val();e.parent.rowsPerPage.set(parseInt(n,10))}return t}()})}],"studylistPagination.styl":["./studylistPagination.styl.css",function(t,e,n){n.exports=t("./studylistPagination.styl.css")}],"studylistPagination.styl.css":["meteor/modules",function(t,e,n){n.exports=t("meteor/modules").addStyles('.theme-icon-crickets,\n.theme-icon-tide,\n.theme-icon-tigerlily,\n.theme-icon-quartz,\n.theme-icon-overcast,\n.theme-icon-mint,\n.theme-icon-honeycomb {\n display: inline-block;\n background: url("/packages/ohif_design/assets/theme-icons.png") no-repeat;\n overflow: hidden;\n text-indent: -9999px;\n text-align: left;\n}\n.theme-icon-crickets {\n background-position: 0px 0px;\n width: 64px;\n height: 56px;\n}\n.theme-icon-tide {\n background-position: 0px -56px;\n width: 64px;\n height: 54px;\n}\n.theme-icon-tigerlily {\n background-position: 0px -110px;\n width: 62px;\n height: 61px;\n}\n.theme-icon-quartz {\n background-position: 0px -171px;\n width: 59px;\n height: 64px;\n}\n.theme-icon-overcast {\n background-position: 0px -235px;\n width: 58px;\n height: 37px;\n}\n.theme-icon-mint {\n background-position: 0px -272px;\n width: 57px;\n height: 61px;\n}\n.theme-icon-honeycomb {\n background-position: 0px -333px;\n width: 50px;\n height: 58px;\n}\n.studylistPagination {\n font-size: 13px;\n font-weight: normal !important;\n}\n.studylistPagination label {\n font-weight: normal;\n}\n.studylistPagination select {\n color: #fff;\n}\n.studylistPagination select {\n background-color: #000;\n}\nbody.theme-tide .studylistPagination select {\n background-color: #000;\n}\nbody.theme-tigerlily .studylistPagination select {\n background-color: #000;\n}\nbody.theme-crickets .studylistPagination select {\n background-color: #000;\n}\nbody.theme-honeycomb .studylistPagination select {\n background-color: #000;\n}\nbody.theme-mint .studylistPagination select {\n background-color: #000;\n}\nbody.theme-overcast .studylistPagination select {\n background-color: #000;\n}\nbody.theme-quartz .studylistPagination select {\n background-color: #000;\n}\n.rows-per-page label.wrapperLabel {\n display: inline-table !important;\n margin: 0 4px;\n}\n.rows-per-page label.wrapperLabel select {\n width: 42px;\n}\n.page-number {\n margin: 0;\n text-align: right;\n}\n.page-number label {\n font-weight: normal;\n}\n.page-number label ul.pagination-control {\n margin: 0;\n}\n.page-number label ul.pagination-control li a {\n padding: 4px 8px;\n color: #fff;\n padding: 4px 8px;\n}\n.page-number label ul.pagination-control li a {\n background-color: #000;\n}\nbody.theme-tide .page-number label ul.pagination-control li a {\n background-color: #000;\n}\nbody.theme-tigerlily .page-number label ul.pagination-control li a {\n background-color: #000;\n}\nbody.theme-crickets .page-number label ul.pagination-control li a {\n background-color: #000;\n}\nbody.theme-honeycomb .page-number label ul.pagination-control li a {\n background-color: #000;\n}\nbody.theme-mint .page-number label ul.pagination-control li a {\n background-color: #000;\n}\nbody.theme-overcast .page-number label ul.pagination-control li a {\n background-color: #000;\n}\nbody.theme-quartz .page-number label ul.pagination-control li a {\n background-color: #000;\n}\n.page-number label ul.pagination-control li a {\n border-color: #263340;\n}\nbody.theme-tide .page-number label ul.pagination-control li a {\n border-color: #263340;\n}\nbody.theme-tigerlily .page-number label ul.pagination-control li a {\n border-color: #263340;\n}\nbody.theme-crickets .page-number label ul.pagination-control li a {\n border-color: #263340;\n}\nbody.theme-honeycomb .page-number label ul.pagination-control li a {\n border-color: #263340;\n}\nbody.theme-mint .page-number label ul.pagination-control li a {\n border-color: #263340;\n}\nbody.theme-overcast .page-number label ul.pagination-control li a {\n border-color: #263340;\n}\nbody.theme-quartz .page-number label ul.pagination-control li a {\n border-color: #263340;\n}\n.page-number label ul.pagination-control li a {\n background-color: #14191e;\n}\nbody.theme-tide .page-number label ul.pagination-control li a {\n background-color: #14191e;\n}\nbody.theme-tigerlily .page-number label ul.pagination-control li a {\n background-color: #14191e;\n}\nbody.theme-crickets .page-number label ul.pagination-control li a {\n background-color: #14191e;\n}\nbody.theme-honeycomb .page-number label ul.pagination-control li a {\n background-color: #14191e;\n}\nbody.theme-mint .page-number label ul.pagination-control li a {\n background-color: #14191e;\n}\nbody.theme-overcast .page-number label ul.pagination-control li a {\n background-color: #14191e;\n}\nbody.theme-quartz .page-number label ul.pagination-control li a {\n background-color: #14191e;\n}\n.page-number label ul.pagination-control li a:hover {\n color: #20a5d6;\n}\nbody.theme-tide .page-number label ul.pagination-control li a:hover {\n color: #20a5d6;\n}\nbody.theme-tigerlily .page-number label ul.pagination-control li a:hover {\n color: #fa8947;\n}\nbody.theme-crickets .page-number label ul.pagination-control li a:hover {\n color: #d4c3c1;\n}\nbody.theme-honeycomb .page-number label ul.pagination-control li a:hover {\n color: #cda56b;\n}\nbody.theme-mint .page-number label ul.pagination-control li a:hover {\n color: #31b166;\n}\nbody.theme-overcast .page-number label ul.pagination-control li a:hover {\n color: #507d80;\n}\nbody.theme-quartz .page-number label ul.pagination-control li a:hover {\n color: #7858ce;\n}\n.page-number label ul.pagination-control .active a {\n border-color: #ddd;\n color: #fff;\n}\n.page-number label ul.pagination-control .active a {\n background-color: #263340;\n}\nbody.theme-tide .page-number label ul.pagination-control .active a {\n background-color: #263340;\n}\nbody.theme-tigerlily .page-number label ul.pagination-control .active a {\n background-color: #263340;\n}\nbody.theme-crickets .page-number label ul.pagination-control .active a {\n background-color: #263340;\n}\nbody.theme-honeycomb .page-number label ul.pagination-control .active a {\n background-color: #263340;\n}\nbody.theme-mint .page-number label ul.pagination-control .active a {\n background-color: #263340;\n}\nbody.theme-overcast .page-number label ul.pagination-control .active a {\n background-color: #263340;\n}\nbody.theme-quartz .page-number label ul.pagination-control .active a {\n background-color: #263340;\n}\n.page-number label ul.pagination-control .disabled a,\n.page-number label ul.pagination-control .disabled a:hover,\n.page-number label ul.pagination-control .disabled a:focus,\n.page-number label ul.pagination-control .disabled a:active {\n background-color: #14191e;\n}\nbody.theme-tide .page-number label ul.pagination-control .disabled a {\n background-color: #14191e;\n}\nbody.theme-tide .page-number label ul.pagination-control .disabled a:hover {\n background-color: #14191e;\n}\nbody.theme-tide .page-number label ul.pagination-control .disabled a:focus {\n background-color: #14191e;\n}\nbody.theme-tide .page-number label ul.pagination-control .disabled a:active {\n background-color: #14191e;\n}\nbody.theme-tigerlily .page-number label ul.pagination-control .disabled a {\n background-color: #14191e;\n}\nbody.theme-tigerlily .page-number label ul.pagination-control .disabled a:hover {\n background-color: #14191e;\n}\nbody.theme-tigerlily .page-number label ul.pagination-control .disabled a:focus {\n background-color: #14191e;\n}\nbody.theme-tigerlily .page-number label ul.pagination-control .disabled a:active {\n background-color: #14191e;\n}\nbody.theme-crickets .page-number label ul.pagination-control .disabled a {\n background-color: #14191e;\n}\nbody.theme-crickets .page-number label ul.pagination-control .disabled a:hover {\n background-color: #14191e;\n}\nbody.theme-crickets .page-number label ul.pagination-control .disabled a:focus {\n background-color: #14191e;\n}\nbody.theme-crickets .page-number label ul.pagination-control .disabled a:active {\n background-color: #14191e;\n}\nbody.theme-honeycomb .page-number label ul.pagination-control .disabled a {\n background-color: #14191e;\n}\nbody.theme-honeycomb .page-number label ul.pagination-control .disabled a:hover {\n background-color: #14191e;\n}\nbody.theme-honeycomb .page-number label ul.pagination-control .disabled a:focus {\n background-color: #14191e;\n}\nbody.theme-honeycomb .page-number label ul.pagination-control .disabled a:active {\n background-color: #14191e;\n}\nbody.theme-mint .page-number label ul.pagination-control .disabled a {\n background-color: #14191e;\n}\nbody.theme-mint .page-number label ul.pagination-control .disabled a:hover {\n background-color: #14191e;\n}\nbody.theme-mint .page-number label ul.pagination-control .disabled a:focus {\n background-color: #14191e;\n}\nbody.theme-mint .page-number label ul.pagination-control .disabled a:active {\n background-color: #14191e;\n}\nbody.theme-overcast .page-number label ul.pagination-control .disabled a {\n background-color: #14191e;\n}\nbody.theme-overcast .page-number label ul.pagination-control .disabled a:hover {\n background-color: #14191e;\n}\nbody.theme-overcast .page-number label ul.pagination-control .disabled a:focus {\n background-color: #14191e;\n}\nbody.theme-overcast .page-number label ul.pagination-control .disabled a:active {\n background-color: #14191e;\n}\nbody.theme-quartz .page-number label ul.pagination-control .disabled a {\n background-color: #14191e;\n}\nbody.theme-quartz .page-number label ul.pagination-control .disabled a:hover {\n background-color: #14191e;\n}\nbody.theme-quartz .page-number label ul.pagination-control .disabled a:focus {\n background-color: #14191e;\n}\nbody.theme-quartz .page-number label ul.pagination-control .disabled a:active {\n background-color: #14191e;\n}\n.page-number label ul.pagination-control .disabled a,\n.page-number label ul.pagination-control .disabled a:hover,\n.page-number label ul.pagination-control .disabled a:focus,\n.page-number label ul.pagination-control .disabled a:active {\n border-color: #263340;\n}\nbody.theme-tide .page-number label ul.pagination-control .disabled a {\n border-color: #263340;\n}\nbody.theme-tide .page-number label ul.pagination-control .disabled a:hover {\n border-color: #263340;\n}\nbody.theme-tide .page-number label ul.pagination-control .disabled a:focus {\n border-color: #263340;\n}\nbody.theme-tide .page-number label ul.pagination-control .disabled a:active {\n border-color: #263340;\n}\nbody.theme-tigerlily .page-number label ul.pagination-control .disabled a {\n border-color: #263340;\n}\nbody.theme-tigerlily .page-number label ul.pagination-control .disabled a:hover {\n border-color: #263340;\n}\nbody.theme-tigerlily .page-number label ul.pagination-control .disabled a:focus {\n border-color: #263340;\n}\nbody.theme-tigerlily .page-number label ul.pagination-control .disabled a:active {\n border-color: #263340;\n}\nbody.theme-crickets .page-number label ul.pagination-control .disabled a {\n border-color: #263340;\n}\nbody.theme-crickets .page-number label ul.pagination-control .disabled a:hover {\n border-color: #263340;\n}\nbody.theme-crickets .page-number label ul.pagination-control .disabled a:focus {\n border-color: #263340;\n}\nbody.theme-crickets .page-number label ul.pagination-control .disabled a:active {\n border-color: #263340;\n}\nbody.theme-honeycomb .page-number label ul.pagination-control .disabled a {\n border-color: #263340;\n}\nbody.theme-honeycomb .page-number label ul.pagination-control .disabled a:hover {\n border-color: #263340;\n}\nbody.theme-honeycomb .page-number label ul.pagination-control .disabled a:focus {\n border-color: #263340;\n}\nbody.theme-honeycomb .page-number label ul.pagination-control .disabled a:active {\n border-color: #263340;\n}\nbody.theme-mint .page-number label ul.pagination-control .disabled a {\n border-color: #263340;\n}\nbody.theme-mint .page-number label ul.pagination-control .disabled a:hover {\n border-color: #263340;\n}\nbody.theme-mint .page-number label ul.pagination-control .disabled a:focus {\n border-color: #263340;\n}\nbody.theme-mint .page-number label ul.pagination-control .disabled a:active {\n border-color: #263340;\n}\nbody.theme-overcast .page-number label ul.pagination-control .disabled a {\n border-color: #263340;\n}\nbody.theme-overcast .page-number label ul.pagination-control .disabled a:hover {\n border-color: #263340;\n}\nbody.theme-overcast .page-number label ul.pagination-control .disabled a:focus {\n border-color: #263340;\n}\nbody.theme-overcast .page-number label ul.pagination-control .disabled a:active {\n border-color: #263340;\n}\nbody.theme-quartz .page-number label ul.pagination-control .disabled a {\n border-color: #263340;\n}\nbody.theme-quartz .page-number label ul.pagination-control .disabled a:hover {\n border-color: #263340;\n}\nbody.theme-quartz .page-number label ul.pagination-control .disabled a:focus {\n border-color: #263340;\n}\nbody.theme-quartz .page-number label ul.pagination-control .disabled a:active {\n border-color: #263340;\n}\n.page-number label ul.pagination-control .disabled a,\n.page-number label ul.pagination-control .disabled a:hover,\n.page-number label ul.pagination-control .disabled a:focus,\n.page-number label ul.pagination-control .disabled a:active {\n color: #516873;\n}\nbody.theme-tide .page-number label ul.pagination-control .disabled a {\n color: #516873;\n}\nbody.theme-tide .page-number label ul.pagination-control .disabled a:hover {\n color: #516873;\n}\nbody.theme-tide .page-number label ul.pagination-control .disabled a:focus {\n color: #516873;\n}\nbody.theme-tide .page-number label ul.pagination-control .disabled a:active {\n color: #516873;\n}\nbody.theme-tigerlily .page-number label ul.pagination-control .disabled a {\n color: #516873;\n}\nbody.theme-tigerlily .page-number label ul.pagination-control .disabled a:hover {\n color: #516873;\n}\nbody.theme-tigerlily .page-number label ul.pagination-control .disabled a:focus {\n color: #516873;\n}\nbody.theme-tigerlily .page-number label ul.pagination-control .disabled a:active {\n color: #516873;\n}\nbody.theme-crickets .page-number label ul.pagination-control .disabled a {\n color: #516873;\n}\nbody.theme-crickets .page-number label ul.pagination-control .disabled a:hover {\n color: #516873;\n}\nbody.theme-crickets .page-number label ul.pagination-control .disabled a:focus {\n color: #516873;\n}\nbody.theme-crickets .page-number label ul.pagination-control .disabled a:active {\n color: #516873;\n}\nbody.theme-honeycomb .page-number label ul.pagination-control .disabled a {\n color: #516873;\n}\nbody.theme-honeycomb .page-number label ul.pagination-control .disabled a:hover {\n color: #516873;\n}\nbody.theme-honeycomb .page-number label ul.pagination-control .disabled a:focus {\n color: #516873;\n}\nbody.theme-honeycomb .page-number label ul.pagination-control .disabled a:active {\n color: #516873;\n}\nbody.theme-mint .page-number label ul.pagination-control .disabled a {\n color: #516873;\n}\nbody.theme-mint .page-number label ul.pagination-control .disabled a:hover {\n color: #516873;\n}\nbody.theme-mint .page-number label ul.pagination-control .disabled a:focus {\n color: #516873;\n}\nbody.theme-mint .page-number label ul.pagination-control .disabled a:active {\n color: #516873;\n}\nbody.theme-overcast .page-number label ul.pagination-control .disabled a {\n color: #516873;\n}\nbody.theme-overcast .page-number label ul.pagination-control .disabled a:hover {\n color: #516873;\n}\nbody.theme-overcast .page-number label ul.pagination-control .disabled a:focus {\n color: #516873;\n}\nbody.theme-overcast .page-number label ul.pagination-control .disabled a:active {\n color: #516873;\n}\nbody.theme-quartz .page-number label ul.pagination-control .disabled a {\n color: #516873;\n}\nbody.theme-quartz .page-number label ul.pagination-control .disabled a:hover {\n color: #516873;\n}\nbody.theme-quartz .page-number label ul.pagination-control .disabled a:focus {\n color: #516873;\n}\nbody.theme-quartz .page-number label ul.pagination-control .disabled a:active {\n color: #516873;\n}\n.page-number label ul.pagination-control .disabled:not(.disabled):hover a {\n background-color: #16202b;\n}\nbody.theme-tide .page-number label ul.pagination-control .disabled:not(.disabled):hover a {\n background-color: #16202b;\n}\nbody.theme-tigerlily .page-number label ul.pagination-control .disabled:not(.disabled):hover a {\n background-color: #26333f;\n}\nbody.theme-crickets .page-number label ul.pagination-control .disabled:not(.disabled):hover a {\n background-color: #2b141b;\n}\nbody.theme-honeycomb .page-number label ul.pagination-control .disabled:not(.disabled):hover a {\n background-color: #252228;\n}\nbody.theme-mint .page-number label ul.pagination-control .disabled:not(.disabled):hover a {\n background-color: #1d232a;\n}\nbody.theme-overcast .page-number label ul.pagination-control .disabled:not(.disabled):hover a {\n background-color: #252228;\n}\nbody.theme-quartz .page-number label ul.pagination-control .disabled:not(.disabled):hover a {\n background-color: #2b2e3f;\n}\n.page-number label ul.pagination-control .disabled:not(.disabled):hover a {\n color: #20a5d6;\n}\nbody.theme-tide .page-number label ul.pagination-control .disabled:not(.disabled):hover a {\n color: #20a5d6;\n}\nbody.theme-tigerlily .page-number label ul.pagination-control .disabled:not(.disabled):hover a {\n color: #fa8947;\n}\nbody.theme-crickets .page-number label ul.pagination-control .disabled:not(.disabled):hover a {\n color: #d4c3c1;\n}\nbody.theme-honeycomb .page-number label ul.pagination-control .disabled:not(.disabled):hover a {\n color: #cda56b;\n}\nbody.theme-mint .page-number label ul.pagination-control .disabled:not(.disabled):hover a {\n color: #31b166;\n}\nbody.theme-overcast .page-number label ul.pagination-control .disabled:not(.disabled):hover a {\n color: #507d80;\n}\nbody.theme-quartz .page-number label ul.pagination-control .disabled:not(.disabled):hover a {\n color: #7858ce;\n}\n.page-number label ul.pagination-control .disabled.active a {\n background-color: #16202b;\n}\nbody.theme-tide .page-number label ul.pagination-control .disabled.active a {\n background-color: #16202b;\n}\nbody.theme-tigerlily .page-number label ul.pagination-control .disabled.active a {\n background-color: #26333f;\n}\nbody.theme-crickets .page-number label ul.pagination-control .disabled.active a {\n background-color: #2b141b;\n}\nbody.theme-honeycomb .page-number label ul.pagination-control .disabled.active a {\n background-color: #252228;\n}\nbody.theme-mint .page-number label ul.pagination-control .disabled.active a {\n background-color: #1d232a;\n}\nbody.theme-overcast .page-number label ul.pagination-control .disabled.active a {\n background-color: #252228;\n}\nbody.theme-quartz .page-number label ul.pagination-control .disabled.active a {\n background-color: #2b2e3f;\n}\n.page-number label ul.pagination-control .disabled.active a {\n color: #20a5d6;\n}\nbody.theme-tide .page-number label ul.pagination-control .disabled.active a {\n color: #20a5d6;\n}\nbody.theme-tigerlily .page-number label ul.pagination-control .disabled.active a {\n color: #fa8947;\n}\nbody.theme-crickets .page-number label ul.pagination-control .disabled.active a {\n color: #d4c3c1;\n}\nbody.theme-honeycomb .page-number label ul.pagination-control .disabled.active a {\n color: #cda56b;\n}\nbody.theme-mint .page-number label ul.pagination-control .disabled.active a {\n color: #31b166;\n}\nbody.theme-overcast .page-number label ul.pagination-control .disabled.active a {\n color: #507d80;\n}\nbody.theme-quartz .page-number label ul.pagination-control .disabled.active a {\n color: #7858ce;\n}\n@media only screen and (max-width: 1069px) {\n .studylistPagination > .row {\n margin-right: 0;\n }\n}\n');
}]},studylistResult:{"studylistResult.html":["./template.studylistResult.js",function(t,e,n){n.exports=t("./template.studylistResult.js")}],"template.studylistResult.js":function(){_.__checkName("studylistResult"),_.studylistResult=new _("Template.studylistResult",function(){var t=this;return[A.DIV({class:"studyListToolbar clearfix"},"\n ",A.Raw('<div class="header pull-left">Study List</div>'),"\n ",A.DIV({class:"studyCount pull-right"},M.View("lookup:numberOfStudies",function(){return E.mustache(t.lookup("numberOfStudies"))})),"\n ",A.DIV({class:"pull-right"},E.include(t.lookupTemplate("studylistToolbar"))),"\n "),A.Raw('\n <div class="theadBackground">\n </div>\n '),A.DIV({id:"studyListContainer"},"\n ",A.TABLE({id:"tblStudyList",class:"studylistResult table noselect"},"\n ",A.THEAD("\n ",A.TR("\n ",A.TH({class:"patientName"},"\n ",A.DIV({id:"_patientName",class:"sortingCell"},"\n ",A.SPAN("Patient Name"),"\n ",A.I({class:function(){return E.mustache(E.dot(t.lookup("sortingColumnsIcons"),"patientName"))}},A.CharRef({html:"&nbsp;",str:" "})),"\n "),"\n ",A.INPUT({type:"text",class:"form-control studylist-search",id:"patientName"}),"\n "),"\n ",A.TH({class:"patientId"},"\n ",A.DIV({id:"_patientId",class:"sortingCell"},"\n ",A.SPAN("MRN"),"\n ",A.I({class:function(){return E.mustache(E.dot(t.lookup("sortingColumnsIcons"),"patientId"))}},A.CharRef({html:"&nbsp;",str:" "})),"\n "),"\n ",A.INPUT({type:"text",class:"form-control studylist-search",id:"patientId"}),"\n "),"\n ",A.TH({class:"accessionNumber"},"\n ",A.DIV({id:"_accessionNumber",class:"sortingCell "},"\n ",A.SPAN("Accession #"),"\n ",A.I({class:function(){return E.mustache(E.dot(t.lookup("sortingColumnsIcons"),"accessionNumber"))}},A.CharRef({html:"&nbsp;",str:" "})),"\n "),"\n ",A.INPUT({type:"text",class:"form-control studylist-search",id:"accessionNumber"}),"\n "),"\n ",A.TH({class:"studyDate"},"\n ",A.DIV({id:"_studyDate",class:"sortingCell"},"\n ",A.SPAN("Study Date"),"\n ",A.I({class:function(){return E.mustache(E.dot(t.lookup("sortingColumnsIcons"),"studyDate"))}},A.CharRef({html:"&nbsp;",str:" "})),"\n "),"\n ",A.INPUT({type:"text",class:"form-control studylist-search",name:"daterange",id:"studyDate"}),"\n "),"\n ",A.TH({class:"modalities"},"\n ",A.DIV({id:"_modalities",class:"sortingCell"},"\n ",A.SPAN("Modality"),"\n ",A.I({class:function(){return E.mustache(E.dot(t.lookup("sortingColumnsIcons"),"modalities"))}},A.CharRef({html:"&nbsp;",str:" "})),"\n "),"\n ",A.INPUT({type:"text",class:"form-control studylist-search",id:"modality"}),"\n "),"\n ",A.TH({class:"studyDescription"},"\n ",A.DIV({id:"_studyDescription",class:"sortingCell"},"\n ",A.SPAN("Study Description"),"\n ",A.I({class:function(){return E.mustache(E.dot(t.lookup("sortingColumnsIcons"),"studyDescription"))}},A.CharRef({html:"&nbsp;",str:" "})),"\n "),"\n ",A.INPUT({type:"text",class:"form-control studylist-search",id:"studyDescription"}),"\n "),"\n "),"\n "),"\n ",A.TBODY({id:"studyListData"},"\n ",M.Each(function(){return{_sequence:E.call(t.lookup("studies")),_variable:"study"}},function(){return["\n ",M._TemplateWith(function(){return E.dataMustache(t.lookup("clone"),t.lookup("study"),t.lookup("."))},function(){return E.include(t.lookupTemplate("studylistStudy"))}),"\n "]}),"\n "),"\n "),"\n\n ",A.Raw("<!-- Pagination -->"),"\n ",E.include(t.lookupTemplate("studylistPagination")),"\n\n ",M.If(function(){return E.dataMustache(t.lookup("session"),"showLoadingText")},function(){return["\n ",E.include(t.lookupTemplate("loadingText")),"\n "]},function(){return["\n ",M.Unless(function(){return E.call(t.lookup("numberOfStudies"))},function(){return["\n ",A.DIV({class:"notFound"},"No matching results"),"\n "]}),"\n "]}),"\n ")]})},"studylistResult.js":["meteor/meteor","meteor/templating","meteor/session","meteor/reactive-var","meteor/reactive-dict","meteor/momentjs:moment","meteor/ohif:core",function(t,e,n){function i(t){return t&&t.length&&"*"!==t.substr(t.length-1)&&(t+="*"),t}function r(t,e){return void 0===t||""===t||t.indexOf(e)>-1}function a(t){return void 0===t||"undefined"===t?"":t.toUpperCase()}function s(t){var e=t.substring(0,4),n=t.substring(4,6),o=t.substring(6,8),i=n+"/"+o+"/"+e;return new Date(i)}function l(){f.log.info("search()"),p.set("showLoadingText",!0),v={patientName:i(o("input#patientName").val()),patientId:i(o("input#patientId").val()),accessionNumber:i(o("input#accessionNumber").val()),studyDescription:i(o("input#studyDescription").val()),studyDateFrom:y,studyDateTo:g,modalitiesInStudy:o("input#modality").val()?o("input#modality").val():""};var t=a(o("input#modality").val());f.studylist.collections.Studies.remove({}),c.call("StudyListSearch",v,function(e,n){return f.log.info("StudyListSearch"),e?void f.log.warn(e):(p.set("showLoadingText",!1),void(n&&n.forEach(function(e){r(e.modalities,t)&&(new Date(y).setHours(0,0,0,0)<=s(e.studyDate)||!y||""===y)&&(s(e.studyDate)<=new Date(g).setHours(0,0,0,0)||!g||""===g)&&(e.numberOfStudyRelatedInstances=isNaN(e.numberOfStudyRelatedInstances)?void 0:parseInt(e.numberOfStudyRelatedInstances),f.studylist.collections.Studies.insert(e))})))})}function u(t,e){Object.keys(t.sortingColumns.keys).forEach(function(n){n!==e&&t.sortingColumns.set(n,null)})}var c;n.import("meteor/meteor",{Meteor:function(t){c=t}});var d;n.import("meteor/templating",{Template:function(t){d=t}});var p;n.import("meteor/session",{Session:function(t){p=t}});var m;n.import("meteor/reactive-var",{ReactiveVar:function(t){m=t}});var h;n.import("meteor/reactive-dict",{ReactiveDict:function(t){h=t}});var b;n.import("meteor/momentjs:moment",{moment:function(t){b=t}});var f;n.import("meteor/ohif:core",{OHIF:function(t){f=t}}),p.setDefault("showLoadingText",!0),d.studylistResult.helpers({studies:function(){function t(){var t=d.instance(),e=void 0,n={patientName:1,studyDate:1};p.get("sortOption")&&(n=p.get("sortOption"));var o=t.rowsPerPage.get(),i=t.currentPage.get(),r=o*i,a=r+o;if(e=f.studylist.collections.Studies.find({},{sort:n}).fetch())return t.recordCount.set(e.length),e.slice(r,a)}return t}(),numberOfStudies:function(){function t(){return f.studylist.collections.Studies.find().count()}return t}(),sortingColumnsIcons:function(){function t(){var t=d.instance(),e={};return Object.keys(t.sortingColumns.keys).forEach(function(n){var o=t.sortingColumns.get(n);1===o?e[n]="fa fa-fw fa-sort-up":o===-1?e[n]="fa fa-fw fa-sort-down":e[n]="fa fa-fw"}),e}return t}()});var y=void 0,g=void 0,v=void 0,S=function t(){return sessionStorage.getItem("rowsPerPage")},k=function t(e,n){return sessionStorage.setItem("rowsPerPage",n),"function"==typeof m._isEqual?m._isEqual(e,n):e===n};d.studylistResult.onCreated(function(){var t=d.instance();t.sortOption=new m,t.sortingColumns=new h;var e=S();e||k(0,25);var n=S();t.rowsPerPage=new m(parseInt(n,10),k),t.currentPage=new m(0),t.recordCount=new m;var o=p.get("sortOption");o?t.sortingColumns.set(o):t.sortingColumns.set({patientName:1,studyDate:1,patientId:0,accessionNumber:0,studyDescription:0,modality:0})}),d.studylistResult.onRendered(function(){var t=d.instance(),e=b(),n=b().subtract(6,"days"),o=b().subtract(29,"days"),i=t.$("#studyDate"),r=f.uiSettings.studyListDateFilterNumDays,a=void 0,s=void 0;r&&(a=b().subtract(r-1,"days"),s=e),t.datePicker=i.daterangepicker({maxDate:e,autoUpdateInput:!0,startDate:a,endDate:s,ranges:{Today:[e,e],"Last 7 Days":[n,e],"Last 30 Days":[o,e]}}).data("daterangepicker"),a&&s?(t.datePicker.updateInputText(),i.trigger("change")):l()}),d.studylistResult.onDestroyed(function(){var t=d.instance();t.datePicker.remove()}),d.studylistResult.events({"keydown input":function(){function t(t){13===t.which&&l()}return t}(),"onsearch input":function(){function t(){l()}return t}(),"change #studyDate":function(){function t(t){var e=o(t.currentTarget).val();e=e.replace(/ /g,"");var n=e.split("-");y=n[0],g=n[1],""!==e&&l()}return t}(),"click div.sortingCell":function(){function t(t,e){var n=t.currentTarget.id,o=n.replace("_",""),i={};u(e,o);var r=e.sortingColumns.get(o);r?(e.sortingColumns.set(o,r*-1),i[o]=r*-1):(e.sortingColumns.set(o,1),i[o]=1),e.sortOption.set(i),p.set("sortOption",i)}return t}()})}],"studylistResult.styl":["./studylistResult.styl.css",function(t,e,n){n.exports=t("./studylistResult.styl.css")}],"studylistResult.styl.css":["meteor/modules",function(t,e,n){n.exports=t("meteor/modules").addStyles(".theme-icon-crickets,\n.theme-icon-tide,\n.theme-icon-tigerlily,\n.theme-icon-quartz,\n.theme-icon-overcast,\n.theme-icon-mint,\n.theme-icon-honeycomb {\n display: inline-block;\n background: url(\"/packages/ohif_design/assets/theme-icons.png\") no-repeat;\n overflow: hidden;\n text-indent: -9999px;\n text-align: left;\n}\n.theme-icon-crickets {\n background-position: 0px 0px;\n width: 64px;\n height: 56px;\n}\n.theme-icon-tide {\n background-position: 0px -56px;\n width: 64px;\n height: 54px;\n}\n.theme-icon-tigerlily {\n background-position: 0px -110px;\n width: 62px;\n height: 61px;\n}\n.theme-icon-quartz {\n background-position: 0px -171px;\n width: 59px;\n height: 64px;\n}\n.theme-icon-overcast {\n background-position: 0px -235px;\n width: 58px;\n height: 37px;\n}\n.theme-icon-mint {\n background-position: 0px -272px;\n width: 57px;\n height: 61px;\n}\n.theme-icon-honeycomb {\n background-position: 0px -333px;\n width: 50px;\n height: 58px;\n}\n.studyListToolbar {\n height: 75px;\n margin-bottom: 2px;\n padding: 0 8%;\n}\n.studyListToolbar {\n background: #151a1f;\n}\nbody.theme-tide .studyListToolbar {\n background: #151a1f;\n}\nbody.theme-tigerlily .studyListToolbar {\n background: #151a1f;\n}\nbody.theme-crickets .studyListToolbar {\n background: #231c1e;\n}\nbody.theme-honeycomb .studyListToolbar {\n background: #18161a;\n}\nbody.theme-mint .studyListToolbar {\n background: #15191e;\n}\nbody.theme-overcast .studyListToolbar {\n background: #15191e;\n}\nbody.theme-quartz .studyListToolbar {\n background: #151a1f;\n}\n.studyListToolbar>div {\n display: inline-block;\n}\n.studyListToolbar .header {\n font-size: 22px;\n font-weight: 300;\n color: #91b9cd;\n line-height: 75px;\n}\n.studyListToolbar .studylistToolbar {\n height: 75px;\n line-height: 75px;\n}\n.studyListToolbar .studyCount {\n font-size: 40px;\n font-weight: 100;\n line-height: 75px;\n}\n.studyListToolbar .studyCount {\n color: #6fbde2;\n}\nbody.theme-tide .studyListToolbar .studyCount {\n color: #6fbde2;\n}\nbody.theme-tigerlily .studyListToolbar .studyCount {\n color: #d47c66;\n}\nbody.theme-crickets .studyListToolbar .studyCount {\n color: #d47c66;\n}\nbody.theme-honeycomb .studyListToolbar .studyCount {\n color: #d47c66;\n}\nbody.theme-mint .studyListToolbar .studyCount {\n color: #76d27d;\n}\nbody.theme-overcast .studyListToolbar .studyCount {\n color: #74f1fa;\n}\nbody.theme-quartz .studyListToolbar .studyCount {\n color: #abcdf6;\n}\n.theadBackground {\n height: 121px;\n position: absolute;\n width: 100%;\n}\n.theadBackground:before,\n.theadBackground:after {\n content: '';\n display: block;\n left: 0;\n position: absolute;\n width: 100%;\n}\n.theadBackground:before {\n height: 100%;\n top: 0;\n z-index: 1;\n}\n.theadBackground:before {\n background-color: #151a1f;\n}\nbody.theme-tide .theadBackground:before {\n background-color: #151a1f;\n}\nbody.theme-tigerlily .theadBackground:before {\n background-color: #151a1f;\n}\nbody.theme-crickets .theadBackground:before {\n background-color: #231c1e;\n}\nbody.theme-honeycomb .theadBackground:before {\n background-color: #18161a;\n}\nbody.theme-mint .theadBackground:before {\n background-color: #15191e;\n}\nbody.theme-overcast .theadBackground:before {\n background-color: #15191e;\n}\nbody.theme-quartz .theadBackground:before {\n background-color: #151a1f;\n}\n.theadBackground:after {\n bottom: -1px;\n height: 1px;\n z-index: 3;\n}\n.theadBackground:after {\n background-color: #6fbde2;\n}\nbody.theme-tide .theadBackground:after {\n background-color: #6fbde2;\n}\nbody.theme-tigerlily .theadBackground:after {\n background-color: #d47c66;\n}\nbody.theme-crickets .theadBackground:after {\n background-color: #d47c66;\n}\nbody.theme-honeycomb .theadBackground:after {\n background-color: #d47c66;\n}\nbody.theme-mint .theadBackground:after {\n background-color: #76d27d;\n}\nbody.theme-overcast .theadBackground:after {\n background-color: #74f1fa;\n}\nbody.theme-quartz .theadBackground:after {\n background-color: #abcdf6;\n}\n#studyListContainer {\n width: 100%;\n padding: 0 8%;\n position: absolute;\n z-index: 2;\n}\n#studyListContainer .loadingTextDiv {\n color: #91b9cd;\n font-size: 30px;\n}\n#studyListContainer .notFound {\n color: #91b9cd;\n font-size: 30px;\n font-weight: 200;\n text-align: center;\n}\n#studyListContainer table#tblStudyList tr {\n height: 20px;\n}\n#studyListContainer table#tblStudyList thead {\n white-space: nowrap;\n}\n#studyListContainer table#tblStudyList thead tr th {\n padding: 0;\n border-bottom: solid 1px #6fbde2;\n width: 100%;\n}\n#studyListContainer table#tblStudyList thead tr th:first-child {\n padding-left: $tablePadding;\n}\n#studyListContainer table#tblStudyList thead tr th:last-child {\n padding-right: $tablePadding;\n}\n#studyListContainer table#tblStudyList thead tr th div.sortingCell {\n display: inline-block;\n cursor: pointer;\n width: 100%;\n min-width: 95px;\n margin: 0 auto;\n color: #fff;\n font-weight: 400;\n padding: 20px;\n}\n#studyListContainer table#tblStudyList thead tr th div.sortingCell span {\n font-size: 15px;\n float: left;\n}\n#studyListContainer table#tblStudyList thead tr th div.sortingCell i {\n margin: 0 5px;\n}\n#studyListContainer table#tblStudyList thead tr th div.sortingCell:hover {\n color: #20a5d6;\n}\nbody.theme-tide #studyListContainer table#tblStudyList thead tr th div.sortingCell:hover {\n color: #20a5d6;\n}\nbody.theme-tigerlily #studyListContainer table#tblStudyList thead tr th div.sortingCell:hover {\n color: #fa8947;\n}\nbody.theme-crickets #studyListContainer table#tblStudyList thead tr th div.sortingCell:hover {\n color: #d4c3c1;\n}\nbody.theme-honeycomb #studyListContainer table#tblStudyList thead tr th div.sortingCell:hover {\n color: #cda56b;\n}\nbody.theme-mint #studyListContainer table#tblStudyList thead tr th div.sortingCell:hover {\n color: #31b166;\n}\nbody.theme-overcast #studyListContainer table#tblStudyList thead tr th div.sortingCell:hover {\n color: #507d80;\n}\nbody.theme-quartz #studyListContainer table#tblStudyList thead tr th div.sortingCell:hover {\n color: #7858ce;\n}\n#studyListContainer table#tblStudyList thead tr th div.sortingCell.active,\n#studyListContainer table#tblStudyList thead tr th div.sortingCell:active {\n color: #20a5d6;\n}\nbody.theme-tide #studyListContainer table#tblStudyList thead tr th div.sortingCell.active {\n color: #20a5d6;\n}\nbody.theme-tide #studyListContainer table#tblStudyList thead tr th div.sortingCell:active {\n color: #20a5d6;\n}\nbody.theme-tigerlily #studyListContainer table#tblStudyList thead tr th div.sortingCell.active {\n color: #fa8947;\n}\nbody.theme-tigerlily #studyListContainer table#tblStudyList thead tr th div.sortingCell:active {\n color: #fa8947;\n}\nbody.theme-crickets #studyListContainer table#tblStudyList thead tr th div.sortingCell.active {\n color: #d4c3c1;\n}\nbody.theme-crickets #studyListContainer table#tblStudyList thead tr th div.sortingCell:active {\n color: #d4c3c1;\n}\nbody.theme-honeycomb #studyListContainer table#tblStudyList thead tr th div.sortingCell.active {\n color: #cda56b;\n}\nbody.theme-honeycomb #studyListContainer table#tblStudyList thead tr th div.sortingCell:active {\n color: #cda56b;\n}\nbody.theme-mint #studyListContainer table#tblStudyList thead tr th div.sortingCell.active {\n color: #31b166;\n}\nbody.theme-mint #studyListContainer table#tblStudyList thead tr th div.sortingCell:active {\n color: #31b166;\n}\nbody.theme-overcast #studyListContainer table#tblStudyList thead tr th div.sortingCell.active {\n color: #507d80;\n}\nbody.theme-overcast #studyListContainer table#tblStudyList thead tr th div.sortingCell:active {\n color: #507d80;\n}\nbody.theme-quartz #studyListContainer table#tblStudyList thead tr th div.sortingCell.active {\n color: #7858ce;\n}\nbody.theme-quartz #studyListContainer table#tblStudyList thead tr th div.sortingCell:active {\n color: #7858ce;\n}\n#studyListContainer table#tblStudyList thead tr th input.studylist-search {\n height: 40px;\n margin: 0 5px 20px 5px;\n padding: 0 20px;\n cursor: pointer;\n border: none;\n background-color: #2c363f;\n color: #d3d3d3;\n font-size: 10pt;\n font-weight: normal;\n width: calc(100% - 10px);\n -webkit-border-radius: 4px;\n -moz-border-radius: 4px;\n -ms-border-radius: 4px;\n -o-border-radius: 4px;\n border-radius: 4px;\n box-sizing: border-box;\n -webkit-transition: all 0.15s ease;\n -moz-transition: all 0.15s ease;\n -ms-transition: all 0.15s ease;\n -o-transition: all 0.15s ease;\n transition: all 0.15s ease;\n}\n#studyListContainer table#tblStudyList thead tr th input.studylist-search::-webkit-input-placeholder {\n color: #d3d3d3;\n}\n#studyListContainer table#tblStudyList thead tr th input.studylist-search:-moz-placeholder {\n color: #d3d3d3;\n}\n#studyListContainer table#tblStudyList thead tr th input.studylist-search::-moz-placeholder {\n color: #d3d3d3;\n}\n#studyListContainer table#tblStudyList thead tr th input.studylist-search:-ms-input-placeholder {\n color: #d3d3d3;\n}\n#studyListContainer table#tblStudyList thead tr th input.studylist-search.invisible {\n visibility: hidden;\n}\n#studyListContainer table#tblStudyList thead tr th input.studylist-search:active,\n#studyListContainer table#tblStudyList thead tr th input.studylist-search:hover {\n background-color: #2c363f;\n}\n#studyListContainer table#tblStudyList thead ::-webkit-datetime-edit-year-field:not([aria-valuenow]),\n#studyListContainer table#tblStudyList thead ::-webkit-datetime-edit-month-field:not([aria-valuenow]),\n#studyListContainer table#tblStudyList thead ::-webkit-datetime-edit-day-field:not([aria-valuenow]) {\n color: transparent;\n}\n#studyListContainer table#tblStudyList tbody tr {\n padding: 5px;\n background-color: #000;\n}\n#studyListContainer table#tblStudyList tbody tr:nth-child(even) {\n background-color: #151a1f;\n}\nbody.theme-tide #studyListContainer table#tblStudyList tbody tr:nth-child(even) {\n background-color: #151a1f;\n}\nbody.theme-tigerlily #studyListContainer table#tblStudyList tbody tr:nth-child(even) {\n background-color: #151a1f;\n}\nbody.theme-crickets #studyListContainer table#tblStudyList tbody tr:nth-child(even) {\n background-color: #231c1e;\n}\nbody.theme-honeycomb #studyListContainer table#tblStudyList tbody tr:nth-child(even) {\n background-color: #18161a;\n}\nbody.theme-mint #studyListContainer table#tblStudyList tbody tr:nth-child(even) {\n background-color: #15191e;\n}\nbody.theme-overcast #studyListContainer table#tblStudyList tbody tr:nth-child(even) {\n background-color: #15191e;\n}\nbody.theme-quartz #studyListContainer table#tblStudyList tbody tr:nth-child(even) {\n background-color: #151a1f;\n}\n#studyListContainer table#tblStudyList tbody tr td {\n height: 40px;\n line-height: 40px;\n color: #fff;\n font-weight: 300;\n border-top: 1px solid #436270;\n border-bottom: 1px solid #436270;\n white-space: nowrap;\n -webkit-transition: all 0.1s ease;\n -moz-transition: all 0.1s ease;\n -ms-transition: all 0.1s ease;\n -o-transition: all 0.1s ease;\n transition: all 0.1s ease;\n}\n#studyListContainer table#tblStudyList tbody tr:hover,\n#studyListContainer table#tblStudyList tbody tr:active,\n#studyListContainer table#tblStudyList tbody tr.active {\n background-color: #2c363f;\n color: #fff;\n}\n#studyListContainer table#tblStudyList tbody tr:hover td,\n#studyListContainer table#tblStudyList tbody tr:active td,\n#studyListContainer table#tblStudyList tbody tr.active td {\n border-top: 1px solid #436270;\n border-bottom: 1px solid #436270;\n background-color: #2c363f;\n}\n@media only screen and (max-width: 1362px) {\n #studyListContainer {\n padding: 0 5%;\n }\n #studyListContainer table#tblStudyList thead tr th:first-child,\n #studyListContainer table#tblStudyList tbody tr th:first-child,\n #studyListContainer table#tblStudyList thead tr td:first-child,\n #studyListContainer table#tblStudyList tbody tr td:first-child {\n padding-left: 5%;\n }\n #studyListContainer table#tblStudyList thead tr th:last-child,\n #studyListContainer table#tblStudyList tbody tr th:last-child,\n #studyListContainer table#tblStudyList thead tr td:last-child,\n #studyListContainer table#tblStudyList tbody tr td:last-child {\n padding-right: 5%;\n }\n}\n@media only screen and (max-width: 1161px) {\n #studyListContainer {\n padding: 0 3%;\n }\n #studyListContainer table#tblStudyList thead tr th:first-child,\n #studyListContainer table#tblStudyList tbody tr th:first-child,\n #studyListContainer table#tblStudyList thead tr td:first-child,\n #studyListContainer table#tblStudyList tbody tr td:first-child {\n padding-left: 3%;\n }\n #studyListContainer table#tblStudyList thead tr th:last-child,\n #studyListContainer table#tblStudyList tbody tr th:last-child,\n #studyListContainer table#tblStudyList thead tr td:last-child,\n #studyListContainer table#tblStudyList tbody tr td:last-child {\n padding-right: 3%;\n }\n}\n@media only screen and (max-width: 1069px) {\n .theadBackground {\n height: 101px;\n }\n .studyListToolbar {\n padding: 0 5px;\n }\n #studyListContainer {\n padding: 0;\n }\n #studyListContainer table#tblStudyList thead > tr > th:first-child {\n padding-left: 5px;\n }\n #studyListContainer table#tblStudyList thead > tr > th:last-child {\n padding-right: 5px;\n }\n #studyListContainer table#tblStudyList thead > tr > th input.worklist-search {\n padding: 10px;\n }\n #studyListContainer table#tblStudyList thead > tr > th div.sortingCell {\n padding: 10px 5px;\n }\n #studyListContainer table#tblStudyList thead > tr > th div.sortingCell i {\n width: auto;\n }\n #studyListContainer table#tblStudyList tbody > tr > td:first-child {\n padding-left: 5px;\n }\n #studyListContainer table#tblStudyList tbody > tr > td:last-child {\n padding-right: 5px;\n }\n #studyListContainer .worklistPagination .row {\n margin-left: 0;\n margin-right: 0;\n }\n}\n")}]},studylistStudy:{"studylistStudy.html":["./template.studylistStudy.js",function(t,e,n){n.exports=t("./template.studylistStudy.js")}],"template.studylistStudy.js":function(){_.__checkName("studylistStudy"),_.studylistStudy=new _("Template.studylistStudy",function(){var t=this;return A.TR({class:function(){return["studylistStudy noselect ",M.If(function(){return E.call(E.dot(t.lookup("."),"selected"))},function(){return"active"})]}},"\n ",A.TD({class:"patientName"},"\n ",M.View("lookup:formatPN",function(){return E.mustache(t.lookup("formatPN"),t.lookup("patientName"))}),"\n "),"\n ",A.TD({class:"patientId"},"\n ",M.View("lookup:patientId",function(){return E.mustache(t.lookup("patientId"))}),"\n "),"\n ",A.TD({class:"accessionNumber"},"\n ",M.View("lookup:accessionNumber",function(){return E.mustache(t.lookup("accessionNumber"))}),"\n "),"\n ",A.TD({class:"studyDate"},"\n ",M.View("lookup:formatDA",function(){return E.mustache(t.lookup("formatDA"),t.lookup("studyDate"))}),"\n "),"\n ",A.TD({class:"modalities"},"\n ",M.View("lookup:modalities",function(){return E.mustache(t.lookup("modalities"))}),"\n "),"\n ",A.TD({class:"studyDescription"},"\n ",M.View("lookup:studyDescription",function(){return E.mustache(t.lookup("studyDescription"))}),"\n "),"\n ")})},"studylistStudy.js":["meteor/templating","meteor/blaze","hammerjs","meteor/ohif:core",function(t,e,n){function i(){m.studylist.collections.Studies.update({},{$set:{selected:!1}},{multi:!0})}function r(t,e){if(!e.selected){var n={studyInstanceUid:e.studyInstanceUid},o={$set:{selected:!0}};m.studylist.collections.Studies.update(n,o)}m.studylist.$lastSelectedRow=t}function a(t,e){i(),r(t,e)}function s(t,e){var n={studyInstanceUid:e.studyInstanceUid},o={$set:{selected:!1}};m.studylist.collections.Studies.update(n,o)}function l(t,e){var n=void 0,i=m.studylist.$lastSelectedRow;if(i&&i.length>0&&(n=d.getData(i.get(0)),n.selected||(i=o(),m.studylist.$lastSelectedRow=i)),i.length){var s=void 0;if(i.index()<t.index())s=i.nextAll("tr");else{if(!(i.index()>t.index()))return;s=i.prevAll("tr")}s.each(function(e,n){var i=o(n),a=d.getData(n);if(!a.selected)return r(i,a),!i.is(t)})}else a(t,e)}function u(t,e){var n=e.selected?s:r;n(t,e)}var c;n.import("meteor/templating",{Template:function(t){c=t}});var d;n.import("meteor/blaze",{Blaze:function(t){d=t}});var p={};n.import("hammerjs",{"*":function(t,e){p[e]=t}});var m;n.import("meteor/ohif:core",{OHIF:function(t){m=t}}),c.studylistStudy.onRendered(function(){var t=c.instance(),e=t.data,n=t.$("tr.studylistStudy").first(),o=new p.Manager(n.get(0)),i=new p.Tap({event:"doubletap",taps:2,interval:500,threshold:30,posThreshold:30});o.add(i),e.selected&&r(n,e)}),c.studylistStudy.events({"click tr.studylistStudy":function(){function t(t,e){var n=o(t.currentTarget),i=e.data;delete i._id,t.shiftKey?l(n,i):t.ctrlKey||t.metaKey?u(n,i):a(n,i)}return t}(),"mousedown tr.studylistStudy":function(){function t(t,e){if(2===t.which){var n=m.studylist.callbacks.middleClickOnStudy;n&&"function"==typeof n&&n(e.data)}}return t}(),"dblclick tr.studylistStudy, doubletap tr.studylistStudy":function(){function t(t,e){if(void 0===t.which||1===t.which){var n=m.studylist.callbacks.dblClickOnStudy;n&&"function"==typeof n&&n(e.data)}}return t}(),"contextmenu tr.studylistStudy, press tr.studylistStudy":function(){function t(t,e){var n=o(t.currentTarget);return e.data.selected||a(n,e.data),t.preventDefault(),m.ui.showDropdown(m.studylist.dropdown.getItems(),{event:t,menuClasses:"dropdown-menu-left"}),!1}return t}()})}],"studylistStudy.styl":["./studylistStudy.styl.css",function(t,e,n){n.exports=t("./studylistStudy.styl.css")}],"studylistStudy.styl.css":["meteor/modules",function(t,e,n){n.exports=t("meteor/modules").addStyles(".studylistStudy {\n cursor: pointer;\n}\n")}]},studylistToolbar:{"studylistToolbar.html":["./template.studylistToolbar.js",function(t,e,n){n.exports=t("./template.studylistToolbar.js")}],"template.studylistToolbar.js":function(){_.__checkName("studylistToolbar"),_.studylistToolbar=new _("Template.studylistToolbar",function(){var t=this;return A.DIV({class:"studylistToolbar"},"\n ",M.If(function(){return E.call(t.lookup("importSupported"))},function(){return["\n ",A.DIV({class:"addNewStudy btn-file"},"\n ",A.LABEL({for:"btnImport"},"\n ",A.I({class:"fa fa-plus"})," Import study\n "),"\n ",A.INPUT({id:"btnImport",class:"js-import-files",type:"file",webkitdirectory:"",directory:"",multiple:""}),"\n "),"\n "]}),"\n ")})},"studylistToolbar.js":["meteor/ohif:core","meteor/templating","meteor/meteor","meteor/session","meteor/jquery",function(t,e,n){var o;n.import("meteor/ohif:core",{OHIF:function(t){o=t}});var i;n.import("meteor/templating",{Template:function(t){i=t}});var r;n.import("meteor/meteor",{Meteor:function(t){r=t}});var a;n.import("meteor/session",{Session:function(t){a=t}});var s;n.import("meteor/jquery",{$:function(t){s=t}}),i.studylistToolbar.onCreated(function(){r.call("importSupported",function(t,e){t||!e?a.set("importSupported",!1):a.set("importSupported",!0)})}),i.studylistToolbar.events({"change .js-import-files":function(){function t(t){var e=s.map(t.currentTarget.files,function(t){return t});o.studylist.importStudies(e)}return t}(),"click .js-import-files":function(){function t(t){s(t.currentTarget).val("")}return t}()}),i.studylistToolbar.helpers({importSupported:function(){function t(){var t=a.get("importSupported");return t&&o.uiSettings.studyListFunctionsEnabled}return t}()})}],"studylistToolbar.styl":["./studylistToolbar.styl.css",function(t,e,n){n.exports=t("./studylistToolbar.styl.css")}],"studylistToolbar.styl.css":["meteor/modules",function(t,e,n){n.exports=t("meteor/modules").addStyles('.theme-icon-crickets,\n.theme-icon-tide,\n.theme-icon-tigerlily,\n.theme-icon-quartz,\n.theme-icon-overcast,\n.theme-icon-mint,\n.theme-icon-honeycomb {\n display: inline-block;\n background: url("/packages/ohif_design/assets/theme-icons.png") no-repeat;\n overflow: hidden;\n text-indent: -9999px;\n text-align: left;\n}\n.theme-icon-crickets {\n background-position: 0px 0px;\n width: 64px;\n height: 56px;\n}\n.theme-icon-tide {\n background-position: 0px -56px;\n width: 64px;\n height: 54px;\n}\n.theme-icon-tigerlily {\n background-position: 0px -110px;\n width: 62px;\n height: 61px;\n}\n.theme-icon-quartz {\n background-position: 0px -171px;\n width: 59px;\n height: 64px;\n}\n.theme-icon-overcast {\n background-position: 0px -235px;\n width: 58px;\n height: 37px;\n}\n.theme-icon-mint {\n background-position: 0px -272px;\n width: 57px;\n height: 61px;\n}\n.theme-icon-honeycomb {\n background-position: 0px -333px;\n width: 50px;\n height: 58px;\n}\n.studylistToolbar .addNewStudy {\n margin: 0 10px;\n}\n.studylistToolbar .addNewStudy label {\n font-weight: 400;\n cursor: pointer;\n}\n.studylistToolbar .addNewStudy label {\n color: #91b9cd;\n}\nbody.theme-tide .studylistToolbar .addNewStudy label {\n color: #91b9cd;\n}\nbody.theme-tigerlily .studylistToolbar .addNewStudy label {\n color: #9ccdf8;\n}\nbody.theme-crickets .studylistToolbar .addNewStudy label {\n color: #8be7b5;\n}\nbody.theme-honeycomb .studylistToolbar .addNewStudy label {\n color: #fab797;\n}\nbody.theme-mint .studylistToolbar .addNewStudy label {\n color: #a7e9b3;\n}\nbody.theme-overcast .studylistToolbar .addNewStudy label {\n color: #73f2fc;\n}\nbody.theme-quartz .studylistToolbar .addNewStudy label {\n color: #d7e8fe;\n}\n.studylistToolbar .addNewStudy label * {\n pointer-events: none;\n}\n.studylistToolbar .addNewStudy label:hover {\n color: #fff;\n}\nbody.theme-tide .studylistToolbar .addNewStudy label:hover {\n color: #fff;\n}\nbody.theme-tigerlily .studylistToolbar .addNewStudy label:hover {\n color: #fff;\n}\nbody.theme-crickets .studylistToolbar .addNewStudy label:hover {\n color: #fff;\n}\nbody.theme-honeycomb .studylistToolbar .addNewStudy label:hover {\n color: #fff;\n}\nbody.theme-mint .studylistToolbar .addNewStudy label:hover {\n color: #fff;\n}\nbody.theme-overcast .studylistToolbar .addNewStudy label:hover {\n color: #fff;\n}\nbody.theme-quartz .studylistToolbar .addNewStudy label:hover {\n color: #fff;\n}\n.studylistToolbar .addNewStudy label:active {\n color: #20a5d6;\n}\nbody.theme-tide .studylistToolbar .addNewStudy label:active {\n color: #20a5d6;\n}\nbody.theme-tigerlily .studylistToolbar .addNewStudy label:active {\n color: #fa8947;\n}\nbody.theme-crickets .studylistToolbar .addNewStudy label:active {\n color: #d4c3c1;\n}\nbody.theme-honeycomb .studylistToolbar .addNewStudy label:active {\n color: #cda56b;\n}\nbody.theme-mint .studylistToolbar .addNewStudy label:active {\n color: #31b166;\n}\nbody.theme-overcast .studylistToolbar .addNewStudy label:active {\n color: #507d80;\n}\nbody.theme-quartz .studylistToolbar .addNewStudy label:active {\n color: #7858ce;\n}\n.studylistToolbar .addNewStudy input {\n width: 0.1px;\n height: 0.1px;\n opacity: 0;\n overflow: hidden;\n position: absolute;\n z-index: -1;\n}\n');
}]}},themeSelector:{"index.js":["./themeSelectorModal/themeSelectorModal.html","./themeSelectorModal/themeSelectorModal.styl","./themeSelectorModal/themeSelectorModal.js",function(t,e,n){n.import("./themeSelectorModal/themeSelectorModal.html"),n.import("./themeSelectorModal/themeSelectorModal.styl"),n.import("./themeSelectorModal/themeSelectorModal.js")}],themeSelectorModal:{"themeSelectorModal.html":["./template.themeSelectorModal.js",function(t,e,n){n.exports=t("./template.themeSelectorModal.js")}],"template.themeSelectorModal.js":function(){_.__checkName("themeSelectorModal"),_.themeSelectorModal=new _("Template.themeSelectorModal",function(){var t=this;return M._TemplateWith(function(){return E.dataMustache(t.lookup("extend"),t.lookup("."),E.kw({id:"themeSelectorModal",dialogClass:"modal-lg",confirmLabel:"Apply theme",title:"Themes",titleIcon:"fa fa-sliders"}))},function(){return E.include(t.lookupTemplate("dialogForm"),function(){return["\n ",A.UL({class:"theme-list text-center"},"\n ",M.Each(function(){return{_sequence:E.call(t.lookup("themes")),_variable:"theme"}},function(){return["\n ",A.LI({class:function(){return["text-center preview-theme ",E.mustache(t.lookup("printClassIfSelected"),t.lookup("theme"))]},"data-theme":function(){return E.mustache(t.lookup("theme"))}},"\n ",A.DIV({class:"icon-wrapper"},"\n ",A.SPAN({class:function(){return["theme-icon-",E.mustache(t.lookup("theme"))]}}),"\n "),"\n ",A.H4({class:"theme-title"},M.View("lookup:ucFirst",function(){return E.mustache(t.lookup("ucFirst"),t.lookup("theme"))})),"\n "),"\n "]}),"\n "),"\n "]})})})},"themeSelectorModal.js":["meteor/templating","meteor/reactive-dict",function(t,e,n){var o;n.import("meteor/templating",{Template:function(t){o=t}});var i;n.import("meteor/reactive-dict",{ReactiveDict:function(t){i=t}});var r="tide",a=function t(){return sessionStorage.getItem("theme")},s=function t(e){return sessionStorage.setItem("theme",e)},l=function t(e){return document.body.classList.add("theme-"+e)},u=function t(){for(var e=document.body.classList,n=e.length-1;n>=0;n--)e[n].search("theme-")!==-1&&document.body.classList.remove(e[n])};o.themeSelectorModal.onCreated(function(){var t=o.instance(),e=a();e||(e=r,s(e)),t.state=new i,t.state.set("selectedTheme",e),l(e),t.container={currentTheme:e,previewTheme:function(){function t(t,e){e.set("selectedTheme",t),u(),l(t)}return t}(),applyTheme:function(){function t(t){s(t.get("selectedTheme"))}return t}(),resetState:function(){function t(t){var e=a();t.set("selectedTheme",e),u(),l(e)}return t}()};var n=t.data.promise;n.then(function(){return t.container.applyTheme(t.state)}),n.catch(function(){return t.container.resetState(t.state)})}),o.themeSelectorModal.helpers({themes:["crickets","honeycomb","mint","overcast","quartz","tide","tigerlily"],ucFirst:function(){function t(t){return t.charAt(0).toUpperCase()+t.slice(1)}return t}(),printClassIfSelected:function(){function t(t){var e=o.instance();return t===e.state.get("selectedTheme")?"selected":""}return t}()}),o.themeSelectorModal.events({"click .preview-theme":function(){function t(t,e){e.container.previewTheme(t.currentTarget.dataset.theme,e.state)}return t}()})}],"themeSelectorModal.styl":["./themeSelectorModal.styl.css",function(t,e,n){n.exports=t("./themeSelectorModal.styl.css")}],"themeSelectorModal.styl.css":["meteor/modules",function(t,e,n){n.exports=t("meteor/modules").addStyles('.theme-icon-crickets,\n.theme-icon-tide,\n.theme-icon-tigerlily,\n.theme-icon-quartz,\n.theme-icon-overcast,\n.theme-icon-mint,\n.theme-icon-honeycomb {\n display: inline-block;\n background: url("/packages/ohif_design/assets/theme-icons.png") no-repeat;\n overflow: hidden;\n text-indent: -9999px;\n text-align: left;\n}\n.theme-icon-crickets {\n background-position: 0px 0px;\n width: 64px;\n height: 56px;\n}\n.theme-icon-tide {\n background-position: 0px -56px;\n width: 64px;\n height: 54px;\n}\n.theme-icon-tigerlily {\n background-position: 0px -110px;\n width: 62px;\n height: 61px;\n}\n.theme-icon-quartz {\n background-position: 0px -171px;\n width: 59px;\n height: 64px;\n}\n.theme-icon-overcast {\n background-position: 0px -235px;\n width: 58px;\n height: 37px;\n}\n.theme-icon-mint {\n background-position: 0px -272px;\n width: 57px;\n height: 61px;\n}\n.theme-icon-honeycomb {\n background-position: 0px -333px;\n width: 50px;\n height: 58px;\n}\n#themeSelectorModal .theme-list {\n list-style: none;\n padding: 0;\n}\n#themeSelectorModal .theme-list li {\n display: inline-block;\n cursor: pointer;\n margin-right: 10px;\n margin-bottom: 10px;\n padding: 10px;\n width: 110px;\n}\n#themeSelectorModal .theme-list li {\n border: 1px solid #3c5d80;\n}\nbody.theme-tide #themeSelectorModal .theme-list li {\n border: 1px solid #3c5d80;\n}\nbody.theme-tigerlily #themeSelectorModal .theme-list li {\n border: 1px solid #744b71;\n}\nbody.theme-crickets #themeSelectorModal .theme-list li {\n border: 1px solid #3c5d80;\n}\nbody.theme-honeycomb #themeSelectorModal .theme-list li {\n border: 1px solid #3c5d80;\n}\nbody.theme-mint #themeSelectorModal .theme-list li {\n border: 1px solid #3c5d80;\n}\nbody.theme-overcast #themeSelectorModal .theme-list li {\n border: 1px solid #3c5d80;\n}\nbody.theme-quartz #themeSelectorModal .theme-list li {\n border: 1px solid #3c5d80;\n}\n#themeSelectorModal .theme-list li:hover {\n background-color: rgba(21,25,30,0.7);\n}\n#themeSelectorModal .theme-list li:last-child {\n margin-right: 0;\n}\n#themeSelectorModal .theme-list li.selected {\n padding: 7px;\n}\n#themeSelectorModal .theme-list li.selected {\n border: 3px solid #00a4d9;\n}\nbody.theme-tide #themeSelectorModal .theme-list li.selected {\n border: 3px solid #00a4d9;\n}\nbody.theme-tigerlily #themeSelectorModal .theme-list li.selected {\n border: 3px solid #ff8a3d;\n}\nbody.theme-crickets #themeSelectorModal .theme-list li.selected {\n border: 3px solid #d4aaa5;\n}\nbody.theme-honeycomb #themeSelectorModal .theme-list li.selected {\n border: 3px solid #ce9e59;\n}\nbody.theme-mint #themeSelectorModal .theme-list li.selected {\n border: 3px solid #23b15d;\n}\nbody.theme-overcast #themeSelectorModal .theme-list li.selected {\n border: 3px solid #467c80;\n}\nbody.theme-quartz #themeSelectorModal .theme-list li.selected {\n border: 3px solid #6843cc;\n}\n#themeSelectorModal .theme-list li .icon-wrapper {\n height: 64px;\n width: 64px;\n margin: 0 auto;\n line-height: 6.5;\n}\n#themeSelectorModal .theme-list li .theme-title {\n font-weight: normal;\n font-size: 1.1em;\n margin-bottom: 0;\n}\n')}]}}},lib:{"OHIFStudyMetadataSource.js":["babel-runtime/helpers/classCallCheck","babel-runtime/helpers/possibleConstructorReturn","babel-runtime/helpers/inherits","meteor/ohif:core","meteor/ohif:viewerbase",function(t,e,n){n.export({OHIFStudyMetadataSource:function(){return p}});var o;n.import("babel-runtime/helpers/classCallCheck",{default:function(t){o=t}});var i;n.import("babel-runtime/helpers/possibleConstructorReturn",{default:function(t){i=t}});var r;n.import("babel-runtime/helpers/inherits",{default:function(t){r=t}});var a;n.import("meteor/ohif:core",{OHIF:function(t){a=t}}),n.import("meteor/ohif:viewerbase");var s=a.viewerbase,l=s.OHIFError,u=s.metadata,c=u.StudySummary,d=u.StudyMetadata,p=function(t){function e(){return o(this,e),i(this,t.apply(this,arguments))}return r(e,t),e.prototype.getByInstanceUID=function(){function t(t){return a.studylist.retrieveStudyMetadata(t)}return t}(),e.prototype.loadStudy=function(){function t(t){var n=this;if(!(t instanceof d||t instanceof c))throw new l("OHIFStudyMetadataSource::loadStudy study is not an instance of StudySummary or StudyMetadata");return new k(function(o,i){var r=t.getStudyInstanceUID();if(t instanceof d){var s=a.viewer.Studies.findBy({studyInstanceUid:r});return s||e._updateStudyCollections(t),void o(t)}n.getByInstanceUID(r).then(function(t){var n=new a.metadata.StudyMetadata(t,t.studyInstanceUid),i=a.viewerbase.sortingManager.getDisplaySets(n);n.setDisplaySets(i),e._updateStudyCollections(n),o(n)},i)})}return t}(),e._updateStudyCollections=function(){function t(t){var e=t.getData();e.selected=!0,e.displaySets=t.getDisplaySets(),a.viewer.Studies.insert(e),a.viewer.StudyMetadataList.insert(t)}return t}(),e}(a.viewerbase.StudyMetadataSource)}],"OHIFStudySummary.js":["babel-runtime/helpers/typeof","babel-runtime/helpers/classCallCheck","babel-runtime/helpers/possibleConstructorReturn","babel-runtime/helpers/inherits","meteor/ohif:core","meteor/ohif:viewerbase",function(t,e,n){n.export({OHIFStudySummary:function(){return c}});var o;n.import("babel-runtime/helpers/typeof",{default:function(t){o=t}});var i;n.import("babel-runtime/helpers/classCallCheck",{default:function(t){i=t}});var r;n.import("babel-runtime/helpers/possibleConstructorReturn",{default:function(t){r=t}});var a;n.import("babel-runtime/helpers/inherits",{default:function(t){a=t}});var s;n.import("meteor/ohif:core",{OHIF:function(t){s=t}}),n.import("meteor/ohif:viewerbase");var l="string",u={modalities:"ModalitiesInStudy",patientBirthdate:"PatientBirthDate"},c=function(t){function e(){return i(this,e),r(this,t.apply(this,arguments))}return a(e,t),e.prototype.addTags=function(){function n(n){var o=Object.prototype.hasOwnProperty,i=Object.create(null);for(var r in S.sanitizeForInObject(n))if(o.call(n,r)){var a=e.getStandardPropertyName(r);a&&(i[a]=n[r])}t.prototype.addTags.call(this,i)}return n}(),e.getStandardPropertyName=function(){function t(t){var e=void 0;return("undefined"==typeof t?"undefined":o(t))===l&&"_"!==t.charAt(0)&&(t in u?e=u[u]:(e=t.replace(/^sop/,"SOP").replace(/Uid$/,"UID").replace(/Id$/,"ID"),e=e.charAt(0).toUpperCase()+e.substr(1))),e}return t}(),e}(s.viewerbase.metadata.StudySummary)}],"exportSelectedStudies.js":["meteor/ohif:core",function(t,e,n){var o;n.import("meteor/ohif:core",{OHIF:function(t){o=t}}),o.studylist.exportSelectedStudies=function(t){var e=o.studylist.getSelectedStudies(),n=e.length,i=n>1?"Studies":"Study";o.ui.showDialog("dialogConfirm",{element:t.element,title:"Export "+i,message:"Would you like to export "+n+" "+i.toLowerCase()+"?"}).then(function(){o.studylist.exportStudies(e)})}}],"exportStudies.js":["meteor/silentcicero:jszip","meteor/ohif:core",function(t,e,n){var o;n.import("meteor/silentcicero:jszip",{JSZip:function(t){o=t}});var i;n.import("meteor/ohif:core",{OHIF:function(t){i=t}});var r=this,a=function t(e){var n=0;return e.forEach(function(t){n+=$(t)}),n},s=function t(e){for(var n=["B","KB","MB","GB"],o=e,i=0;o>1024;)o/=1024,i++;return o.toFixed(2)+" "+n[i]};i.studylist.exportStudies=function(t){t.length<1||U(t).then(l)};var l=function t(e){var n=a(e),o=void 0;return i.ui.showDialog("dialogProgress",{title:"Exporting Studies...",message:"Exported files: 0 / "+n,total:a(e),task:{run:function(){function t(t){o=u(e,{notify:function(){function e(e){var n=s(e.totalBytes);t.update(e.processed),t.setMessage("Exported files: "+e.processed+" / "+e.total+" ("+n+")")}return e}()}),o.promise.then(function(){t.done()},function(){t.setMessage("Failed to export studies")})}return t}()}}).then(null,function(t){o.cancel()})},u=function t(e,n){var r=new o,s=[],l=[],u=a(e),m=(n||{}).notify||function(){},h=function t(){for(;l.length;){var e=l.pop();e.cancel()}},b=0;return e.forEach(function(t){t.seriesList.forEach(function(e){e.instances.forEach(function(n){if(n.wadouri){var o=c(n);l.push(o);var a=o.promise.then(function(i){var a=l.indexOf(o);return b+=i&&i.size?i.size:0,a>-1&&l.splice(a,1),m({total:u,processed:u-l.length,totalBytes:b}),d(t,e,n,r,i)}).catch(function(t){throw t instanceof p||i.log.error("Failed to export studies",t),h(),t});s.push(a)}})})}),{cancel:h,promise:k.all(s).then(function(){var t=r.generate({type:"blob"});saveAs(t,"studies.zip")})}},c=function t(e){var n=void 0,o=void 0,i=new k(function(t,i){o=i,n=new XMLHttpRequest,n.open("GET",e.wadouri,!0),n.responseType="blob",n.onload=function(){return 4===n.readyState&&200!==n.status?i(new Error("File not downloaded: "+e.wadouri)):void t(n.response)},n.onerror=function(){i(new Error("File not downloaded: "+e.wadouri))},n.send()});return{promise:i,cancel:function(){function t(){n.abort(),o(new p("Download canceled"))}return t}()}},d=function t(e,n,o,i,r){var a=new FileReader,s=new Blob([r],{type:"application/dicom"}),l=i.folder(e.studyInstanceUid).folder(n.seriesInstanceUid),u=new k(function(t,e){a.onload=function(){try{l.file(o.sopInstanceUid+".dcm",a.result,{binary:!0}),t()}catch(t){e(t)}}});return a.readAsArrayBuffer(s),u},p=function t(e){r.name="ExportStudyDownloadCanceledError",r.message=e||"Download canceled",r.stack=(new Error).stack};p.prototype=Object.create(Error.prototype),p.prototype.constructor=p}],"getSelectedStudies.js":["meteor/ohif:core",function(t,e,n){var o;n.import("meteor/ohif:core",{OHIF:function(t){o=t}}),o.studylist.getSelectedStudies=function(){return o.studylist.collections.Studies.find({selected:!0},{sort:{studyDate:1}}).fetch()||[]}}],"getStudyPriors.js":["meteor/ohif:core","meteor/ohif:viewerbase","./OHIFStudySummary",function(t,e,n){n.export({getStudyPriors:function(){return c}});var o;n.import("meteor/ohif:core",{OHIF:function(t){o=t}}),n.import("meteor/ohif:viewerbase");var i;n.import("./OHIFStudySummary",{OHIFStudySummary:function(t){i=t}});var r=o.viewerbase.metadata,a=r.StudyMetadata,s=r.StudySummary,l="x00100020",u="x00080020",c=function t(e){if(!(e instanceof a||e instanceof s))throw new o.viewerbase.OHIFError("getStudyPriors study must be an instance of StudySummary or StudyMetadata");e instanceof a&&(e=e.getFirstInstance());var n=[],r=e.getTagValue(l),c=e.getTagValue(u),d=o.studylist.collections.Studies.find({patientId:r,studyDate:{$lt:c}},{sort:{studyDate:"desc"}});return d.forEach(function(t){var e=new i(t,null,t.studyInstanceUid);n.push(e)}),n}}],"getStudyPriorsMap.js":["meteor/ohif:core","meteor/ohif:viewerbase","./getStudyPriors",function(t,e,n){n.export({getStudyPriorsMap:function(){return l}});var o;n.import("meteor/ohif:core",{OHIF:function(t){o=t}}),n.import("meteor/ohif:viewerbase");var i;n.import("./getStudyPriors",{getStudyPriors:function(t){i=t}});var r=o.viewerbase.metadata,a=r.StudyMetadata,s=r.StudySummary,l=function t(e){var n=new g;return e instanceof Array&&e.forEach(function(t){if(t instanceof a||t instanceof s){var e=t.getObjectID();if(e){var o=i(t);n.set(e,o)}}}),n}}],"importStudies.js":["meteor/meteor","meteor/ohif:core",function(t,e,n){var o;n.import("meteor/meteor",{Meteor:function(t){o=t}});var i;n.import("meteor/ohif:core",{OHIF:function(t){i=t}}),i.studylist.importStudies=function(t){var e=t&&t.length;if(!e)return new k(function(t,e){return e("No files to upload")});var n=function t(e){var n=e.processed,o=e.total;return"Uploaded files: "+n+" / "+o},o=function e(n){var o=function t(e){var o=e.join("; ");n.setMessage("Failed to upload files: "+o)},i=function t(e){s(e,n).then(function(){n.done()}).catch(function(t){n.setMessage(t)})};r(t,n).then(i).catch(o)};return i.ui.showDialog("dialogProgress",{title:"Importing Studies...",message:n,total:e,task:{run:o}})};var r=function t(e,n){var o=0,i=new k(function(t,i){var r=[];e.forEach(function(t){var e=a(t,n);e.then(function(){return n.update(++o)}),r.push(e)}),k.all(r).then(t).catch(i)});return i},a=function t(e){return new k(function(t,n){var o=new XMLHttpRequest;o.open("POST","/uploadFilesToImport",!0),o.setRequestHeader("filename",e.name),o.onload=function(){4===o.readyState&&200!==o.status?n(e.name):t(o.responseText)},o.onerror=function(){return n(e.name)},o.send(e)})},s=function t(e,n){var r=e&&e.length;if(!r)return new k(function(t,e){return e("No studies to import")});var a=0;return n.update(a),n.setTotal(r),n.setMessage(function(t){var e=t.processed,n=t.total;return"Imported: "+e+" / "+n}),new k(function(t,a){o.call("createStudyImportStatus",function(s,l){return s?a(s.message):(i.studylist.collections.StudyImportStatus.find(l).observe({changed:function(){function e(e){var i=e.numberOfStudiesImported,s=e.numberOfStudiesFailed;if(n.update(i),i===r)if(o.call("removeStudyImportStatus",e._id),e.numberOfStudiesFailed>0){var l=s;a("Failed to import "+l+" of "+r+" studies")}else t()}return e}()}),void o.call("importStudies",e,l))})})}}],"index.js":["./third-party/jquery.twbsPagination.min.js","./exportSelectedStudies.js","./exportStudies.js","./getSelectedStudies.js","./importStudies.js","./queryStudies.js","./retrieveStudiesMetadata.js","./retrieveStudyMetadata.js","./studylist.js","./viewSeriesDetails.js","./viewStudies.js",function(t,e,n){n.import("./third-party/jquery.twbsPagination.min.js"),n.import("./exportSelectedStudies.js"),n.import("./exportStudies.js"),n.import("./getSelectedStudies.js"),n.import("./importStudies.js"),n.import("./queryStudies.js"),n.import("./retrieveStudiesMetadata.js"),n.import("./retrieveStudyMetadata.js"),n.import("./studylist.js"),n.import("./viewSeriesDetails.js"),n.import("./viewStudies.js")}],"queryStudies.js":["meteor/ohif:core",function(t,e,n){var o;n.import("meteor/ohif:core",{OHIF:function(t){o=t}}),B=function t(e,n){var i=0,r=e.length,a=(n||{}).notify||function(){},s=[];return e.forEach(function(t){var e=o.studylist.retrieveStudyMetadata(t.studyInstanceUid);e.then(function(t){i++,a({total:r,processed:i})}),s.push(e)}),k.all(s)},U=function t(e){return o.ui.showDialog("dialogProgress",{title:"Querying Studies...",message:"Queried: 0 / "+e.length,total:e.length,task:{run:function(){function t(t){B(e,{notify:function(){function e(e){t.update(e.processed),t.setMessage("Queried: "+e.processed+" / "+e.total)}return e}()}).then(function(e){t.done(e)},function(){t.cancel()})}return t}()}})},$=function t(e){var n=0;return e.seriesList.forEach(function(t){t.instances.forEach(function(t){t.wadouri&&n++})}),n}}],"retrieveStudiesMetadata.js":["meteor/ohif:core",function(t,e,n){var o;n.import("meteor/ohif:core",{OHIF:function(t){o=t}}),o.studylist.retrieveStudiesMetadata=function(t,e,n){if(!t||!t.length)return void(n&&"function"==typeof n&&n("No studyInstanceUids were input"));var i=[];t.forEach(function(t){var e=o.studylist.retrieveStudyMetadata(t);i.push(e)});var r=k.all(i);return r.catch(function(t){return o.log.warn(t)}),r}}],"retrieveStudyMetadata.js":["meteor/meteor","meteor/ohif:core","meteor/ohif:viewerbase",function(t,e,n){var o;n.import("meteor/meteor",{Meteor:function(t){o=t}});var i;n.import("meteor/ohif:core",{OHIF:function(t){i=t}}),n.import("meteor/ohif:viewerbase");var r=new g;i.studylist.retrieveStudyMetadata=function(t){if(r.has(t))return r.get(t);console.time("retrieveStudyMetadata");var e=new k(function(e,n){o.call("GetStudyMetadata",t,function(r,a){if(console.timeEnd("retrieveStudyMetadata"),window.HipaaLogger&&o.user&&o.user()&&window.HipaaLogger.logEvent({eventType:"viewed",userId:o.userId(),userName:o.user().profile.fullName,collectionName:"Study",recordId:t,patientId:a.patientId,patientName:a.patientName}),r)return i.log.warn(r),void n(r);if(!a)throw new o.Error("GetStudyMetadata","No study data returned from server");i.viewerbase.sortStudy(a),i.viewerbase.updateMetaDataManager(a);var s=i.studylist.collections.Studies.findOne({studyInstanceUid:a.studyInstanceUid});s&&Object.assign(a,s);var l=new i.metadata.StudyMetadata(a);a.displaySets=i.viewerbase.sortingManager.getDisplaySets(l),a.displaySets.forEach(function(t){i.viewerbase.stackManager.makeAndAddStack(a,t)}),e(a)})});return r.set(t,e),e}}],"studylist.js":["meteor/ohif:core","meteor/iron:router","./OHIFStudyMetadataSource","./OHIFStudySummary","./getStudyPriors","./getStudyPriorsMap",function(t,e,n){var o;n.import("meteor/ohif:core",{OHIF:function(t){o=t}});var i;n.import("meteor/iron:router",{Router:function(t){i=t}});var r;n.import("./OHIFStudyMetadataSource",{OHIFStudyMetadataSource:function(t){r=t}});var a;n.import("./OHIFStudySummary",{OHIFStudySummary:function(t){a=t}});var s;n.import("./getStudyPriors",{getStudyPriors:function(t){s=t}});var l;n.import("./getStudyPriorsMap",{getStudyPriorsMap:function(t){l=t}}),o.studylist.functions={getStudyPriors:s,getStudyPriorsMap:l},o.studylist.classes={OHIFStudyMetadataSource:r,OHIFStudySummary:a};var u=function t(e){i.go("viewerStudies",{studyInstanceUids:e.studyInstanceUid})};o.studylist.callbacks.dblClickOnStudy=u,o.studylist.callbacks.middleClickOnStudy=u}],"viewSeriesDetails.js":["meteor/ohif:core",function(t,e,n){var o;n.import("meteor/ohif:core",{OHIF:function(t){o=t}}),o.studylist.viewSeriesDetails=function(){var t=o.studylist.getSelectedStudies();t&&o.ui.showDialog("seriesDetailsModal",{selectedStudies:t})}}],"viewStudies.js":["meteor/ohif:core","meteor/iron:router",function(t,e,n){var o;n.import("meteor/ohif:core",{OHIF:function(t){o=t}});var i;n.import("meteor/iron:router",{Router:function(t){i=t}}),o.studylist.viewStudies=function(){o.log.info("viewStudies");var t=o.studylist.getSelectedStudies();if(t&&t.length){var e=t.map(function(t){return t.studyInstanceUid}).join(";");i.go("viewerStudies",{studyInstanceUids:e})}}}],"third-party":{"jquery.twbsPagination.min.js":function(){!function(t,e,n,o){"use strict";var i=t.fn.twbsPagination,r=function(n,o){if(this.$element=t(n),this.options=t.extend({},t.fn.twbsPagination.defaults,o),this.options.startPage<1||this.options.startPage>this.options.totalPages)throw new Error("Start page option is incorrect");if(this.options.totalPages=parseInt(this.options.totalPages),isNaN(this.options.totalPages))throw new Error("Total pages option is not correct!");if(this.options.visiblePages=parseInt(this.options.visiblePages),isNaN(this.options.visiblePages))throw new Error("Visible pages option is not correct!");if(this.options.totalPages<this.options.visiblePages&&(this.options.visiblePages=this.options.totalPages),this.options.onPageClick instanceof Function&&this.$element.first().on("page",this.options.onPageClick),this.options.href){var i,r=this.options.href.replace(/[-\/\\^$*+?.|[\]]/g,"\\$&");r=r.replace(this.options.hrefVariable,"(\\d+)"),null!=(i=new RegExp(r,"i").exec(e.location.href))&&(this.options.startPage=parseInt(i[1],10))}var a="function"==typeof this.$element.prop?this.$element.prop("tagName"):this.$element.attr("tagName");return"UL"===a?this.$listContainer=this.$element:this.$listContainer=t("<ul></ul>"),this.$listContainer.addClass(this.options.paginationClass),"UL"!==a&&this.$element.append(this.$listContainer),this.render(this.getPages(this.options.startPage)),this.setupEvents(),this.options.initiateStartPageClick&&this.$element.trigger("page",this.options.startPage),this};r.prototype={constructor:r,destroy:function(){return this.$element.empty(),this.$element.removeData("twbs-pagination"),this.$element.off("page"),this},show:function(t){if(1>t||t>this.options.totalPages)throw new Error("Page is incorrect.");return this.render(this.getPages(t)),this.setupEvents(),this.$element.trigger("page",t),this},buildListItems:function(t){var e=[];if(this.options.first&&e.push(this.buildItem("first",1)),this.options.prev){var n=t.currentPage>1?t.currentPage-1:this.options.loop?this.options.totalPages:1;e.push(this.buildItem("prev",n))}for(var o=0;o<t.numeric.length;o++)e.push(this.buildItem("page",t.numeric[o]));if(this.options.next){var i=t.currentPage<this.options.totalPages?t.currentPage+1:this.options.loop?1:this.options.totalPages;e.push(this.buildItem("next",i))}return this.options.last&&e.push(this.buildItem("last",this.options.totalPages)),e},buildItem:function(e,n){var o=t("<li></li>"),i=t("<a></a>"),r=null;switch(e){case"page":r=n,o.addClass(this.options.pageClass);break;case"first":r=this.options.first,o.addClass(this.options.firstClass);break;case"prev":r=this.options.prev,o.addClass(this.options.prevClass);break;case"next":r=this.options.next,o.addClass(this.options.nextClass);break;case"last":r=this.options.last,o.addClass(this.options.lastClass)}return o.data("page",n),o.data("page-type",e),o.append(i.attr("href",this.makeHref(n)).html(r)),o},getPages:function(t){var e=[],n=Math.floor(this.options.visiblePages/2),o=t-n+1-this.options.visiblePages%2,i=t+n;0>=o&&(o=1,i=this.options.visiblePages),i>this.options.totalPages&&(o=this.options.totalPages-this.options.visiblePages+1,i=this.options.totalPages);for(var r=o;i>=r;)e.push(r),r++;return{currentPage:t,numeric:e}},render:function(e){var n=this;this.$listContainer.children().remove(),this.$listContainer.append(this.buildListItems(e)),this.$listContainer.children().each(function(){var o=t(this),i=o.data("page-type");switch(i){case"page":o.data("page")===e.currentPage&&o.addClass(n.options.activeClass);break;case"first":o.toggleClass(n.options.disabledClass,1===e.currentPage);break;case"last":o.toggleClass(n.options.disabledClass,e.currentPage===n.options.totalPages);break;case"prev":o.toggleClass(n.options.disabledClass,!n.options.loop&&1===e.currentPage);break;case"next":o.toggleClass(n.options.disabledClass,!n.options.loop&&e.currentPage===n.options.totalPages)}})},setupEvents:function(){var e=this;this.$listContainer.find("li").each(function(){var n=t(this);return n.off(),n.hasClass(e.options.disabledClass)||n.hasClass(e.options.activeClass)?void n.on("click",!1):void n.click(function(t){!e.options.href&&t.preventDefault(),e.show(parseInt(n.data("page")))})})},makeHref:function(t){return this.options.href?this.options.href.replace(this.options.hrefVariable,t):"#"}},t.fn.twbsPagination=function(e){var n,i=Array.prototype.slice.call(arguments,1),a=t(this),s=a.data("twbs-pagination"),l="object"==typeof e&&e;return s||a.data("twbs-pagination",s=new r(this,l)),"string"==typeof e&&(n=s[e].apply(s,i)),n===o?a:n},t.fn.twbsPagination.defaults={totalPages:0,startPage:1,visiblePages:5,initiateStartPageClick:!0,href:!1,hrefVariable:"{{number}}",first:"First",prev:"Previous",next:"Next",last:"Last",loop:!1,onPageClick:null,paginationClass:"pagination",nextClass:"next",prevClass:"prev",lastClass:"last",firstClass:"first",pageClass:"page",activeClass:"active",disabledClass:"disabled"},t.fn.twbsPagination.Constructor=r,t.fn.twbsPagination.noConflict=function(){return t.fn.twbsPagination=i,this}}(window.jQuery,window,document)}}}},node_modules:{hammerjs:{"package.json":function(t,e){e.name="hammerjs",e.version="2.0.6",e.main="hammer.js"},"hammer.js":function(t,e,n){!function(t,e,o,i){"use strict";function r(t,e,n){return setTimeout(c(t,n),e)}function a(t,e,n){return!!Array.isArray(t)&&(s(t,n[e],n),!0)}function s(t,e,n){var o;if(t)if(t.forEach)t.forEach(e,n);else if(t.length!==i)for(o=0;o<t.length;)e.call(n,t[o],o,t),o++;else for(o in t)t.hasOwnProperty(o)&&e.call(n,t[o],o,t)}function l(e,n,o){var i="DEPRECATED METHOD: "+n+"\n"+o+" AT \n";return function(){var n=new Error("get-stack-trace"),o=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",r=t.console&&(t.console.warn||t.console.log);return r&&r.call(t.console,i,o),e.apply(this,arguments)}}function u(t,e,n){var o=e.prototype,i;i=t.prototype=Object.create(o),i.constructor=t,i._super=o,n&&ht(i,n)}function c(t,e){return function n(){return t.apply(e,arguments)}}function d(t,e){return typeof t==ct?t.apply(e?e[0]||i:i,e):t}function p(t,e){return t===i?e:t}function m(t,e,n){s(y(e),function(e){t.addEventListener(e,n,!1)})}function h(t,e,n){s(y(e),function(e){t.removeEventListener(e,n,!1)})}function b(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function f(t,e){return t.indexOf(e)>-1}function y(t){return t.trim().split(/\s+/g)}function g(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var o=0;o<t.length;){if(n&&t[o][n]==e||!n&&t[o]===e)return o;o++}return-1}function v(t){return Array.prototype.slice.call(t,0)}function S(t,e,n){for(var o=[],i=[],r=0;r<t.length;){var a=e?t[r][e]:t[r];g(i,a)<0&&o.push(t[r]),i[r]=a,r++}return n&&(o=e?o.sort(function t(n,o){return n[e]>o[e]}):o.sort()),o}function k(t,e){for(var n,o,r=e[0].toUpperCase()+e.slice(1),a=0;a<lt.length;){if(n=lt[a],o=n?n+r:e,o in t)return o;a++}return i}function x(){return yt++}function T(e){var n=e.ownerDocument||e;return n.defaultView||n.parentWindow||t}function w(t,e){var n=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){d(t.options.enable,[t])&&n.handler(e)},this.init()}function I(t){var e,n=t.options.inputClass;return new(e=n?n:St?F:kt?W:vt?B:z)(t,D)}function D(t,e,n){var o=n.pointers.length,i=n.changedPointers.length,r=e&Ct&&o-i===0,a=e&(Lt|Mt)&&o-i===0;n.isFirst=!!r,n.isFinal=!!a,r&&(t.session={}),n.eventType=e,C(t,n),t.emit("hammer.input",n),t.recognize(n),t.session.prevInput=n}function C(t,e){var n=t.session,o=e.pointers,i=o.length;n.firstInput||(n.firstInput=M(e)),i>1&&!n.firstMultiple?n.firstMultiple=M(e):1===i&&(n.firstMultiple=!1);var r=n.firstInput,a=n.firstMultiple,s=a?a.center:r.center,l=e.center=j(o);e.timeStamp=mt(),e.deltaTime=e.timeStamp-r.timeStamp,e.angle=R(s,l),e.distance=_(s,l),P(n,e),e.offsetDirection=E(e.deltaX,e.deltaY);var u=N(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=u.x,e.overallVelocityY=u.y,e.overallVelocity=pt(u.x)>pt(u.y)?u.x:u.y,e.scale=a?V(a.pointers,o):1,e.rotation=a?O(a.pointers,o):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length,L(n,e);var c=t.element;b(e.srcEvent.target,c)&&(c=e.srcEvent.target),e.target=c}function P(t,e){var n=e.center,o=t.offsetDelta||{},i=t.prevDelta||{},r=t.prevInput||{};e.eventType!==Ct&&r.eventType!==Lt||(i=t.prevDelta={x:r.deltaX||0,y:r.deltaY||0},o=t.offsetDelta={x:n.x,y:n.y}),e.deltaX=i.x+(n.x-o.x),e.deltaY=i.y+(n.y-o.y)}function L(t,e){var n=t.lastInterval||e,o=e.timeStamp-n.timeStamp,r,a,s,l;if(e.eventType!=Mt&&(o>Dt||n.velocity===i)){var u=e.deltaX-n.deltaX,c=e.deltaY-n.deltaY,d=N(o,u,c);a=d.x,s=d.y,r=pt(d.x)>pt(d.y)?d.x:d.y,l=E(u,c),t.lastInterval=e}else r=n.velocity,a=n.velocityX,s=n.velocityY,l=n.direction;e.velocity=r,e.velocityX=a,e.velocityY=s,e.direction=l}function M(t){for(var e=[],n=0;n<t.pointers.length;)e[n]={clientX:dt(t.pointers[n].clientX),clientY:dt(t.pointers[n].clientY)},n++;return{timeStamp:mt(),pointers:e,center:j(e),deltaX:t.deltaX,deltaY:t.deltaY}}function j(t){var e=t.length;if(1===e)return{x:dt(t[0].clientX),y:dt(t[0].clientY)};for(var n=0,o=0,i=0;i<e;)n+=t[i].clientX,o+=t[i].clientY,i++;return{x:dt(n/e),y:dt(o/e)}}function N(t,e,n){return{x:e/t||0,y:n/t||0}}function E(t,e){return t===e?jt:pt(t)>=pt(e)?t<0?Nt:Et:e<0?_t:Rt}function _(t,e,n){n||(n=Ft);var o=e[n[0]]-t[n[0]],i=e[n[1]]-t[n[1]];return Math.sqrt(o*o+i*i)}function R(t,e,n){n||(n=Ft);var o=e[n[0]]-t[n[0]],i=e[n[1]]-t[n[1]];return 180*Math.atan2(i,o)/Math.PI}function O(t,e){return R(e[1],e[0],At)+R(t[1],t[0],At)}function V(t,e){return _(e[0],e[1],At)/_(t[0],t[1],At)}function z(){this.evEl=Wt,this.evWin=Ht,this.allow=!0,this.pressed=!1,w.apply(this,arguments)}function F(){this.evEl=$t,this.evWin=Yt,w.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function A(){this.evTarget=Gt,this.evWin=Qt,this.started=!1,w.apply(this,arguments)}function q(t,e){var n=v(t.touches),o=v(t.changedTouches);return e&(Lt|Mt)&&(n=S(n.concat(o),"identifier",!0)),[n,o]}function W(){this.evTarget=Kt,this.targetIds={},w.apply(this,arguments)}function H(t,e){var n=v(t.touches),o=this.targetIds;if(e&(Ct|Pt)&&1===n.length)return o[n[0].identifier]=!0,[n,n];var i,r,a=v(t.changedTouches),s=[],l=this.target;if(r=n.filter(function(t){return b(t.target,l)}),e===Ct)for(i=0;i<r.length;)o[r[i].identifier]=!0,i++;for(i=0;i<a.length;)o[a[i].identifier]&&s.push(a[i]),e&(Lt|Mt)&&delete o[a[i].identifier],i++;return s.length?[S(r.concat(s),"identifier",!0),s]:void 0}function B(){w.apply(this,arguments);var t=c(this.handler,this);this.touch=new W(this.manager,t),this.mouse=new z(this.manager,t)}function U(t,e){this.manager=t,this.set(e)}function $(t){if(f(t,ie))return ie;var e=f(t,re),n=f(t,ae);return e&&n?ie:e||n?e?re:ae:f(t,oe)?oe:ne;
}function Y(t){this.options=ht({},this.defaults,t||{}),this.id=x(),this.manager=null,this.options.enable=p(this.options.enable,!0),this.state=se,this.simultaneous={},this.requireFail=[]}function X(t){return t&pe?"cancel":t&ce?"end":t&ue?"move":t&le?"start":""}function G(t){return t==Rt?"down":t==_t?"up":t==Nt?"left":t==Et?"right":""}function Q(t,e){var n=e.manager;return n?n.get(t):t}function Z(){Y.apply(this,arguments)}function K(){Z.apply(this,arguments),this.pX=null,this.pY=null}function J(){Z.apply(this,arguments)}function tt(){Y.apply(this,arguments),this._timer=null,this._input=null}function et(){Z.apply(this,arguments)}function nt(){Z.apply(this,arguments)}function ot(){Y.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function it(t,e){return e=e||{},e.recognizers=p(e.recognizers,it.defaults.preset),new rt(t,e)}function rt(t,e){this.options=ht({},it.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.element=t,this.input=I(this),this.touchAction=new U(this,this.options.touchAction),at(this,!0),s(this.options.recognizers,function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])},this)}function at(t,e){var n=t.element;n.style&&s(t.options.cssProps,function(t,o){n.style[k(n.style,o)]=e?t:""})}function st(t,n){var o=e.createEvent("Event");o.initEvent(t,!0,!0),o.gesture=n,n.target.dispatchEvent(o)}var lt=["","webkit","Moz","MS","ms","o"],ut=e.createElement("div"),ct="function",dt=Math.round,pt=Math.abs,mt=Date.now,ht;ht="function"!=typeof Object.assign?function t(e){if(e===i||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(e),o=1;o<arguments.length;o++){var r=arguments[o];if(r!==i&&null!==r)for(var a in r)r.hasOwnProperty(a)&&(n[a]=r[a])}return n}:Object.assign;var bt=l(function t(e,n,o){for(var r=Object.keys(n),a=0;a<r.length;)(!o||o&&e[r[a]]===i)&&(e[r[a]]=n[r[a]]),a++;return e},"extend","Use `assign`."),ft=l(function t(e,n){return bt(e,n,!0)},"merge","Use `assign`."),yt=1,gt=/mobile|tablet|ip(ad|hone|od)|android/i,vt="ontouchstart"in t,St=k(t,"PointerEvent")!==i,kt=vt&&gt.test(navigator.userAgent),xt="touch",Tt="pen",wt="mouse",It="kinect",Dt=25,Ct=1,Pt=2,Lt=4,Mt=8,jt=1,Nt=2,Et=4,_t=8,Rt=16,Ot=Nt|Et,Vt=_t|Rt,zt=Ot|Vt,Ft=["x","y"],At=["clientX","clientY"];w.prototype={handler:function(){},init:function(){this.evEl&&m(this.element,this.evEl,this.domHandler),this.evTarget&&m(this.target,this.evTarget,this.domHandler),this.evWin&&m(T(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&h(this.element,this.evEl,this.domHandler),this.evTarget&&h(this.target,this.evTarget,this.domHandler),this.evWin&&h(T(this.element),this.evWin,this.domHandler)}};var qt={mousedown:Ct,mousemove:Pt,mouseup:Lt},Wt="mousedown",Ht="mousemove mouseup";u(z,w,{handler:function t(e){var n=qt[e.type];n&Ct&&0===e.button&&(this.pressed=!0),n&Pt&&1!==e.which&&(n=Lt),this.pressed&&this.allow&&(n&Lt&&(this.pressed=!1),this.callback(this.manager,n,{pointers:[e],changedPointers:[e],pointerType:wt,srcEvent:e}))}});var Bt={pointerdown:Ct,pointermove:Pt,pointerup:Lt,pointercancel:Mt,pointerout:Mt},Ut={2:xt,3:Tt,4:wt,5:It},$t="pointerdown",Yt="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&($t="MSPointerDown",Yt="MSPointerMove MSPointerUp MSPointerCancel"),u(F,w,{handler:function t(e){var n=this.store,o=!1,i=e.type.toLowerCase().replace("ms",""),r=Bt[i],a=Ut[e.pointerType]||e.pointerType,s=a==xt,l=g(n,e.pointerId,"pointerId");r&Ct&&(0===e.button||s)?l<0&&(n.push(e),l=n.length-1):r&(Lt|Mt)&&(o=!0),l<0||(n[l]=e,this.callback(this.manager,r,{pointers:n,changedPointers:[e],pointerType:a,srcEvent:e}),o&&n.splice(l,1))}});var Xt={touchstart:Ct,touchmove:Pt,touchend:Lt,touchcancel:Mt},Gt="touchstart",Qt="touchstart touchmove touchend touchcancel";u(A,w,{handler:function t(e){var n=Xt[e.type];if(n===Ct&&(this.started=!0),this.started){var o=q.call(this,e,n);n&(Lt|Mt)&&o[0].length-o[1].length===0&&(this.started=!1),this.callback(this.manager,n,{pointers:o[0],changedPointers:o[1],pointerType:xt,srcEvent:e})}}});var Zt={touchstart:Ct,touchmove:Pt,touchend:Lt,touchcancel:Mt},Kt="touchstart touchmove touchend touchcancel";u(W,w,{handler:function t(e){var n=Zt[e.type],o=H.call(this,e,n);o&&this.callback(this.manager,n,{pointers:o[0],changedPointers:o[1],pointerType:xt,srcEvent:e})}}),u(B,w,{handler:function t(e,n,o){var i=o.pointerType==xt,r=o.pointerType==wt;if(i)this.mouse.allow=!1;else if(r&&!this.mouse.allow)return;n&(Lt|Mt)&&(this.mouse.allow=!0),this.callback(e,n,o)},destroy:function t(){this.touch.destroy(),this.mouse.destroy()}});var Jt=k(ut.style,"touchAction"),te=Jt!==i,ee="compute",ne="auto",oe="manipulation",ie="none",re="pan-x",ae="pan-y";U.prototype={set:function(t){t==ee&&(t=this.compute()),te&&this.manager.element.style&&(this.manager.element.style[Jt]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return s(this.manager.recognizers,function(e){d(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),$(t.join(" "))},preventDefaults:function(t){if(!te){var e=t.srcEvent,n=t.offsetDirection;if(this.manager.session.prevented)return void e.preventDefault();var o=this.actions,i=f(o,ie),r=f(o,ae),a=f(o,re);if(i){var s=1===t.pointers.length,l=t.distance<2,u=t.deltaTime<250;if(s&&l&&u)return}if(!a||!r)return i||r&&n&Ot||a&&n&Vt?this.preventSrc(e):void 0}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var se=1,le=2,ue=4,ce=8,de=ce,pe=16,me=32;Y.prototype={defaults:{},set:function(t){return ht(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(a(t,"recognizeWith",this))return this;var e=this.simultaneous;return t=Q(t,this),e[t.id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return a(t,"dropRecognizeWith",this)?this:(t=Q(t,this),delete this.simultaneous[t.id],this)},requireFailure:function(t){if(a(t,"requireFailure",this))return this;var e=this.requireFail;return t=Q(t,this),g(e,t)===-1&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(a(t,"dropRequireFailure",this))return this;t=Q(t,this);var e=g(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){function e(e){n.manager.emit(e,t)}var n=this,o=this.state;o<ce&&e(n.options.event+X(o)),e(n.options.event),t.additionalEvent&&e(t.additionalEvent),o>=ce&&e(n.options.event+X(o))},tryEmit:function(t){return this.canEmit()?this.emit(t):void(this.state=me)},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(me|se)))return!1;t++}return!0},recognize:function(t){var e=ht({},t);return d(this.options.enable,[this,e])?(this.state&(de|pe|me)&&(this.state=se),this.state=this.process(e),void(this.state&(le|ue|ce|pe)&&this.tryEmit(e))):(this.reset(),void(this.state=me))},process:function(t){},getTouchAction:function(){},reset:function(){}},u(Z,Y,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,n=t.eventType,o=e&(le|ue),i=this.attrTest(t);return o&&(n&Mt||!i)?e|pe:o||i?n&Lt?e|ce:e&le?e|ue:le:me}}),u(K,Z,{defaults:{event:"pan",threshold:10,pointers:1,direction:zt},getTouchAction:function(){var t=this.options.direction,e=[];return t&Ot&&e.push(ae),t&Vt&&e.push(re),e},directionTest:function(t){var e=this.options,n=!0,o=t.distance,i=t.direction,r=t.deltaX,a=t.deltaY;return i&e.direction||(e.direction&Ot?(i=0===r?jt:r<0?Nt:Et,n=r!=this.pX,o=Math.abs(t.deltaX)):(i=0===a?jt:a<0?_t:Rt,n=a!=this.pY,o=Math.abs(t.deltaY))),t.direction=i,n&&o>e.threshold&&i&e.direction},attrTest:function(t){return Z.prototype.attrTest.call(this,t)&&(this.state&le||!(this.state&le)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=G(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),u(J,Z,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ie]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&le)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),u(tt,Y,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ne]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,o=t.distance<e.threshold,i=t.deltaTime>e.time;if(this._input=t,!o||!n||t.eventType&(Lt|Mt)&&!i)this.reset();else if(t.eventType&Ct)this.reset(),this._timer=r(function(){this.state=de,this.tryEmit()},e.time,this);else if(t.eventType&Lt)return de;return me},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===de&&(t&&t.eventType&Lt?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=mt(),this.manager.emit(this.options.event,this._input)))}}),u(et,Z,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ie]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&le)}}),u(nt,Z,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Ot|Vt,pointers:1},getTouchAction:function(){return K.prototype.getTouchAction.call(this)},attrTest:function(t){var e=this.options.direction,n;return e&(Ot|Vt)?n=t.overallVelocity:e&Ot?n=t.overallVelocityX:e&Vt&&(n=t.overallVelocityY),this._super.attrTest.call(this,t)&&e&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&pt(n)>this.options.velocity&&t.eventType&Lt},emit:function(t){var e=G(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),u(ot,Y,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[oe]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,o=t.distance<e.threshold,i=t.deltaTime<e.time;if(this.reset(),t.eventType&Ct&&0===this.count)return this.failTimeout();if(o&&i&&n){if(t.eventType!=Lt)return this.failTimeout();var a=!this.pTime||t.timeStamp-this.pTime<e.interval,s=!this.pCenter||_(this.pCenter,t.center)<e.posThreshold;this.pTime=t.timeStamp,this.pCenter=t.center,s&&a?this.count+=1:this.count=1,this._input=t;var l=this.count%e.taps;if(0===l)return this.hasRequireFailures()?(this._timer=r(function(){this.state=de,this.tryEmit()},e.interval,this),le):de}return me},failTimeout:function(){return this._timer=r(function(){this.state=me},this.options.interval,this),me},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==de&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),it.VERSION="2.0.6",it.defaults={domEvents:!1,touchAction:ee,enable:!0,inputTarget:null,inputClass:null,preset:[[et,{enable:!1}],[J,{enable:!1},["rotate"]],[nt,{direction:Ot}],[K,{direction:Ot},["swipe"]],[ot],[ot,{event:"doubletap",taps:2},["tap"]],[tt]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var he=1,be=2;rt.prototype={set:function(t){return ht(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?be:he},recognize:function(t){var e=this.session;if(!e.stopped){this.touchAction.preventDefaults(t);var n,o=this.recognizers,i=e.curRecognizer;(!i||i&&i.state&de)&&(i=e.curRecognizer=null);for(var r=0;r<o.length;)n=o[r],e.stopped===be||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(t),!i&&n.state&(le|ue|ce)&&(i=e.curRecognizer=n),r++}},get:function(t){if(t instanceof Y)return t;for(var e=this.recognizers,n=0;n<e.length;n++)if(e[n].options.event==t)return e[n];return null},add:function(t){if(a(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},remove:function(t){if(a(t,"remove",this))return this;if(t=this.get(t)){var e=this.recognizers,n=g(e,t);n!==-1&&(e.splice(n,1),this.touchAction.update())}return this},on:function(t,e){var n=this.handlers;return s(y(t),function(t){n[t]=n[t]||[],n[t].push(e)}),this},off:function(t,e){var n=this.handlers;return s(y(t),function(t){e?n[t]&&n[t].splice(g(n[t],e),1):delete n[t]}),this},emit:function(t,e){this.options.domEvents&&st(t,e);var n=this.handlers[t]&&this.handlers[t].slice();if(n&&n.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var o=0;o<n.length;)n[o](e),o++}},destroy:function(){this.element&&at(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},ht(it,{INPUT_START:Ct,INPUT_MOVE:Pt,INPUT_END:Lt,INPUT_CANCEL:Mt,STATE_POSSIBLE:se,STATE_BEGAN:le,STATE_CHANGED:ue,STATE_ENDED:ce,STATE_RECOGNIZED:de,STATE_CANCELLED:pe,STATE_FAILED:me,DIRECTION_NONE:jt,DIRECTION_LEFT:Nt,DIRECTION_RIGHT:Et,DIRECTION_UP:_t,DIRECTION_DOWN:Rt,DIRECTION_HORIZONTAL:Ot,DIRECTION_VERTICAL:Vt,DIRECTION_ALL:zt,Manager:rt,Input:w,TouchAction:U,TouchInput:W,MouseInput:z,PointerEventInput:F,TouchMouseInput:B,SingleTouchInput:A,Recognizer:Y,AttrRecognizer:Z,Tap:ot,Pan:K,Swipe:nt,Pinch:J,Rotate:et,Press:tt,on:m,off:h,each:s,merge:ft,extend:bt,assign:ht,inherit:u,bindFn:c,prefixed:k});var fe="undefined"!=typeof t?t:"undefined"!=typeof self?self:{};fe.Hammer=it,"function"==typeof define&&define.amd?define(function(){return it}):"undefined"!=typeof n&&n.exports?n.exports=it:t[o]=it}(window,document,"Hammer")}}}}}}},{extensions:[".js",".json",".html",".styl"]});Y("./node_modules/meteor/ohif:study-list/both/index.js"),Y("./node_modules/meteor/ohif:study-list/client/index.js"),"undefined"==typeof Package&&(Package={}),function(t,e){for(var n in e)n in t||(t[n]=e[n])}(Package["ohif:study-list"]={},{Servers:q,CurrentServer:W,getCurrentServer:H})}();
!function(){var t=Package.meteor.Meteor,e=Package.meteor.global,n=Package.meteor.meteorEnv,o=Package.jquery.$,r=Package.jquery.jQuery,i=Package.random.Random,a=Package["templating-runtime"].Template,s=Package["iron:router"].Router,u=Package["iron:router"].RouteController,c=Package["momentjs:moment"].moment,l=Package.validatejs.validate,d=Package["ohif:viewerbase"].dialogPolyfill,g=Package.modules.meteorInstall,p=Package.modules.Buffer,f=Package.modules.process,m=Package["ecmascript-runtime"].Symbol,h=Package["ecmascript-runtime"].Map,v=Package["ecmascript-runtime"].Set,b=Package["babel-runtime"].meteorBabelHelpers,y=Package.promise.Promise,w=Package["iron:core"].Iron,P=Package.webapp.WebApp,S=Package.logging.Log,T=Package.deps.Tracker,R=Package.deps.Deps,M=Package.session.Session,k=Package["ddp-client"].DDP,D=Package.mongo.Mongo,x=Package.ui.Blaze,I=Package.ui.UI,C=Package.ui.Handlebars,E=Package.spacebars.Spacebars,V=Package.check.check,j=Package.check.Match,N=Package.underscore._,q=Package.ejson.EJSON,O=Package["launch-screen"].LaunchScreen,B=Package.htmljs.HTML,L,A,Z,z,U,_,H,F,W,X,G=g({node_modules:{meteor:{"ohif:hanging-protocols":{both:{"namespace.js":function(){L={}},"collections.js":function(){A=new t.Collection("hangingprotocols"),A._debugName="HangingProtocols",A.allow({insert:function(){function t(){return!0}return t}(),update:function(){function t(){return!0}return t}(),remove:function(){function t(){return!0}return t}()}),t.isDevelopment&&t.isServer&&t.startup(function(){A.remove({})})},"schema.js":["./classes/Protocol","./classes/Stage","./classes/Viewport","./classes/ViewportStructure","./classes/rules/ProtocolMatchingRule","./classes/rules/StudyMatchingRule","./classes/rules/SeriesMatchingRule","./classes/rules/ImageMatchingRule",function(t,e,n){n.import("./classes/Protocol"),n.import("./classes/Stage"),n.import("./classes/Viewport"),n.import("./classes/ViewportStructure"),n.import("./classes/rules/ProtocolMatchingRule"),n.import("./classes/rules/StudyMatchingRule"),n.import("./classes/rules/SeriesMatchingRule"),n.import("./classes/rules/ImageMatchingRule")}],"hardcodedData.js":function(){L.attributeDefaults={abstractPriorValue:0},L.displaySettings={invert:{id:"invert",text:"Show Grayscale Inverted",defaultValue:"NO",options:["YES","NO"]}},L.studyAttributes=[{id:"x00100020",text:"(x00100020) Patient ID"},{id:"x0020000d",text:"(x0020000d) Study Instance UID"},{id:"x00080020",text:"(x00080020) Study Date"},{id:"x00080030",text:"(x00080030) Study Time"},{id:"x00081030",text:"(x00081030) Study Description"},{id:"abstractPriorValue",text:"Abstract Prior Value"}],L.protocolAttributes=[{id:"x00100020",text:"(x00100020) Patient ID"},{id:"x0020000d",text:"(x0020000d) Study Instance UID"},{id:"x00080020",text:"(x00080020) Study Date"},{id:"x00080030",text:"(x00080030) Study Time"},{id:"x00081030",text:"(x00081030) Study Description"},{id:"anatomicRegion",text:"Anatomic Region"}],L.seriesAttributes=[{id:"x0020000e",text:"(x0020000e) Series Instance UID"},{id:"x00080060",text:"(x00080060) Modality"},{id:"x00200011",text:"(x00200011) Series Number"},{id:"x0008103e",text:"(x0008103e) Series Description"},{id:"numImages",text:"Number of Images"}],L.instanceAttributes=[{id:"x00080016",text:"(x00080016) SOP Class UID"},{id:"x00080018",text:"(x00080018) SOP Instance UID"},{id:"x00185101",text:"(x00185101) View Position"},{id:"x00200013",text:"(x00200013) Instance Number"},{id:"x00080008",text:"(x00080008) Image Type"},{id:"x00181063",text:"(x00181063) Frame Time"},{id:"x00200060",text:"(x00200060) Laterality"},{id:"x00541330",text:"(x00541330) Image Index"},{id:"x00280004",text:"(x00280004) Photometric Interpretation"},{id:"x00180050",text:"(x00180050) Slice Thickness"}]},"testData.js":function(){function t(){var t=new L.Protocol("Default");t.id="defaultProtocol",t.locked=!0;var e=new L.ViewportStructure("grid",{rows:1,columns:1}),n=new L.Viewport,o=new L.Stage(e,"oneByOne");return o.viewports.push(n),t.stages.push(o),L.defaultProtocol=t,L.defaultProtocol}function e(){var t=new L.Protocol("MR_TwoByTwo");t.id="MR_TwoByTwo",t.locked=!0;var e=new L.ProtocolMatchingRule("studyInstanceUid",{equals:{value:"1.2.840.113619.2.5.1762583153.215519.978957063.78"}},(!0));t.addProtocolMatchingRule(e);var n=new L.ViewportStructure("grid",{rows:1,columns:2}),o=new L.Viewport,r=new L.Viewport,i=new L.SeriesMatchingRule("seriesNumber",{equals:{value:1}}),a=new L.SeriesMatchingRule("seriesNumber",{equals:{value:2}}),s=new L.ImageMatchingRule("instanceNumber",{equals:{value:3}});o.seriesMatchingRules.push(i),o.imageMatchingRules.push(s),r.seriesMatchingRules.push(a),r.imageMatchingRules.push(s);var u=new L.Stage(n,"oneByTwo");u.viewports.push(o),u.viewports.push(r),t.stages.push(u);var c=new L.ViewportStructure("grid",{rows:2,columns:1}),l=new L.Viewport,d=new L.Viewport,g=new L.SeriesMatchingRule("seriesNumber",{equals:{value:4}}),p=new L.SeriesMatchingRule("seriesNumber",{equals:{value:5}});l.seriesMatchingRules.push(g),l.imageMatchingRules.push(s),d.seriesMatchingRules.push(p),d.imageMatchingRules.push(s);var f=new L.Stage(c,"twoByOne");return f.viewports.push(l),f.viewports.push(d),t.stages.push(f),L.testProtocol=t,L.testProtocol}function n(){L.demoProtocols=[],L.demoProtocols.push({id:"demoProtocol1",locked:!1,name:"DFCI-CT-CHEST-COMPARE",createdDate:"2017-02-14T16:07:09.033Z",modifiedDate:"2017-02-14T16:18:43.930Z",availableTo:{},editableBy:{},protocolMatchingRules:[{id:"7tmuq7KzDMCWFeapc",weight:2,required:!1,attribute:"x00081030",constraint:{contains:{value:"DFCI CT CHEST"}}}],stages:[{id:"v5PfGt9F6mffZPif5",name:"oneByOne",viewportStructure:{type:"grid",properties:{rows:1,columns:2},layoutTemplateName:"gridLayout"},viewports:[{viewportSettings:{},imageMatchingRules:[],seriesMatchingRules:[{id:"mXnsCcNzZL56z7mTZ",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"2.0"}}}],studyMatchingRules:[]},{viewportSettings:{},imageMatchingRules:[],seriesMatchingRules:[{id:"ygz4nb28iJZcJhnYa",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"2.0"}}}],studyMatchingRules:[{id:"uDoEgLTvnXTByWnPz",weight:1,required:!1,attribute:"abstractPriorValue",constraint:{equals:{value:1}}}]}],createdDate:"2017-02-14T16:07:09.033Z"},{id:"XTzu8HB3feep3HYKs",viewportStructure:{type:"grid",properties:{rows:1,columns:2},layoutTemplateName:"gridLayout"},viewports:[{viewportSettings:{},imageMatchingRules:[],seriesMatchingRules:[{id:"mXnsCcNzZL56z7mTZ",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"3.0"}}}],studyMatchingRules:[]},{viewportSettings:{},imageMatchingRules:[],seriesMatchingRules:[{id:"ygz4nb28iJZcJhnYa",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"3.0"}}}],studyMatchingRules:[{id:"uDoEgLTvnXTByWnPz",weight:1,required:!1,attribute:"abstractPriorValue",constraint:{equals:{value:1}}}]}],createdDate:"2017-02-14T16:07:12.085Z"},{id:"3yPYNaeFtr76Qz3jq",viewportStructure:{type:"grid",properties:{rows:2,columns:2},layoutTemplateName:"gridLayout"},viewports:[{viewportSettings:{},imageMatchingRules:[],seriesMatchingRules:[{id:"mXnsCcNzZL56z7mTZ",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"Body 3.0"}}}],studyMatchingRules:[]},{viewportSettings:{wlPreset:"Lung"},imageMatchingRules:[],seriesMatchingRules:[{id:"ygz4nb28iJZcJhnYa",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"Lung 3.0"}}}],studyMatchingRules:[]},{viewportSettings:{},imageMatchingRules:[],seriesMatchingRules:[{id:"6vdBRZYnqmmosipph",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"Body 3.0"}}}],studyMatchingRules:[{id:"SxfTyhGcMhr56PtPM",weight:1,required:!1,attribute:"abstractPriorValue",constraint:{equals:{value:1}}}]},{viewportSettings:{wlPreset:"Lung"},imageMatchingRules:[],seriesMatchingRules:[{id:"FTAyChZCPW68yJjXD",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"Lung 3.0"}}}],studyMatchingRules:[{id:"gMJjfrbsqYNbErPx5",weight:1,required:!1,attribute:"abstractPriorValue",constraint:{equals:{value:1}}}]}],createdDate:"2017-02-14T16:11:40.489Z"}],numberOfPriorsReferenced:4}),L.demoProtocols.push({id:"demoProtocol2",locked:!1,name:"DFCI-CT-CHEST-COMPARE-2",createdDate:"2017-02-14T16:07:09.033Z",modifiedDate:"2017-02-14T16:18:43.930Z",availableTo:{},editableBy:{},protocolMatchingRules:[{id:"7tmuq7KzDMCWFeapc",weight:2,required:!1,attribute:"x00081030",constraint:{contains:{value:"DFCI CT CHEST"}}}],stages:[{id:"v5PfGt9F6mffZPif5",name:"oneByOne",viewportStructure:{type:"grid",properties:{rows:1,columns:2},layoutTemplateName:"gridLayout"},viewports:[{viewportSettings:{},imageMatchingRules:[],seriesMatchingRules:[{id:"mXnsCcNzZL56z7mac",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"2.0"}}}],studyMatchingRules:[]},{viewportSettings:{},imageMatchingRules:[],seriesMatchingRules:[{id:"ygz4nb28iJZcJhnYc",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"2.0"}}}],studyMatchingRules:[{id:"uDoEgLTvnXTByWnPt",weight:1,required:!1,attribute:"abstractPriorValue",constraint:{equals:{value:1}}}]}],createdDate:"2017-02-14T16:07:09.033Z"},{id:"XTzu8HB3feep3HYKs",viewportStructure:{type:"grid",properties:{rows:1,columns:2},layoutTemplateName:"gridLayout"},viewports:[{viewportSettings:{},imageMatchingRules:[],seriesMatchingRules:[{id:"mXnsCcNzZL56z7mTZ",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"Body 3.0"}}},{id:"mYnsCcNwZL56z7mTZ",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"Body 5.0"}}}],studyMatchingRules:[]},{viewportSettings:{},imageMatchingRules:[],seriesMatchingRules:[{id:"ygz4nb28iJZcJhnYa",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"Body 3.0"}}},{id:"ygz4nb29iJZcJhnYa",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"Body 5.0"}}}],studyMatchingRules:[{id:"uDoEgLTvnXTByWnPz",weight:1,required:!1,attribute:"abstractPriorValue",constraint:{equals:{value:1}}}]}],createdDate:"2017-02-14T16:07:12.085Z"},{id:"3yPYNaeFtr76Qz3jq",viewportStructure:{type:"grid",properties:{rows:2,columns:2},layoutTemplateName:"gridLayout"},viewports:[{viewportSettings:{},imageMatchingRules:[],seriesMatchingRules:[{id:"mXnsCcNzZL56z7mtr",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"Body 3.0"}}},{id:"jXnsCcNzZL56z7mTZ",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"Body 5.0"}}}],studyMatchingRules:[]},{viewportSettings:{wlPreset:"Lung"},imageMatchingRules:[],seriesMatchingRules:[{id:"ygz4nb28iJZcJhnYb",weight:2,required:!1,attribute:"x0008103e",constraint:{contains:{value:"Lung 3.0"}}},{id:"ycz4nb28iJZcJhnYa",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"Lung 5.0"}}}],studyMatchingRules:[]},{viewportSettings:{},imageMatchingRules:[],seriesMatchingRules:[{id:"6vdBRZYnqmmosipph",weight:2,required:!1,attribute:"x0008103e",constraint:{contains:{value:"Body 3.0"}}},{id:"6vdBRFYnqmmosipph",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"Body 5.0"}}}],studyMatchingRules:[{id:"SxfTyhGcMhr56PtPM",weight:1,required:!1,attribute:"abstractPriorValue",constraint:{equals:{value:1}}}]},{viewportSettings:{wlPreset:"Lung"},imageMatchingRules:[],seriesMatchingRules:[{id:"FTAyChZCPW68yJjXD",weight:2,required:!1,attribute:"x0008103e",constraint:{contains:{value:"Lung 3.0"}}},{id:"DTAyChZCPW68yJjXD",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"Lung 5.0"}}}],studyMatchingRules:[{id:"gMJjfrbsqYNbErPx5",weight:1,required:!1,attribute:"abstractPriorValue",constraint:{equals:{value:1}}}]}],createdDate:"2017-02-14T16:11:40.489Z"}],numberOfPriorsReferenced:1}),L.demoProtocols.push({id:"screenCT",locked:!1,name:"DFCI-CT-CHEST-SCREEN",createdDate:"2017-02-14T16:07:09.033Z",modifiedDate:"2017-02-14T16:18:43.930Z",availableTo:{},editableBy:{},protocolMatchingRules:[{id:"7tmuq7KzDMCWFeapc",weight:2,required:!1,attribute:"x00081030",constraint:{contains:{value:"DFCI CT CHEST"}}}],stages:[{id:"v5PfGt9F6mffZPif5",name:"oneByOne",viewportStructure:{type:"grid",properties:{rows:1,columns:1},layoutTemplateName:"gridLayout"},viewports:[{viewportSettings:{},imageMatchingRules:[],seriesMatchingRules:[{id:"mXnsCcNzZL55z7mTZ",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"2.0"}}}],studyMatchingRules:[]}],createdDate:"2017-02-14T16:07:09.033Z"},{id:"v5PfGt9F4mffZPif5",name:"oneByOne",viewportStructure:{type:"grid",properties:{rows:2,columns:2},layoutTemplateName:"gridLayout"},viewports:[{viewportSettings:{},imageMatchingRules:[],seriesMatchingRules:[{id:"mXnsCcNzZL56z7nTZ",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"Body 5.0"}}},{id:"mXnsCcNzZL56z7rTZ",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"Body 3.0"}}}],studyMatchingRules:[]},{viewportSettings:{},imageMatchingRules:[],seriesMatchingRules:[{id:"mXnsCcNzZL56r7mTZ",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"Lung 5.0"}}},{id:"mXnsCcNzZL56a7mTZ",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"Lung 3.0"}}}],studyMatchingRules:[]},{viewportSettings:{},imageMatchingRules:[],seriesMatchingRules:[{id:"mXnsCcRzZL56z7mTZ",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"Body 4.0"}}},{id:"mXnsCcNzTL56z7mTZ",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"Coronal"}}}],studyMatchingRules:[]},{viewportSettings:{},imageMatchingRules:[],seriesMatchingRules:[{id:"mXnsCcMzZL56z7mTZ",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"Body 4.0"}}},{id:"mXnsCcAzZL56z7mTZ",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"Sagittal"}}}],studyMatchingRules:[]}],createdDate:"2017-02-14T16:07:09.033Z"}],numberOfPriorsReferenced:0}),L.demoProtocols.push({id:"PETCTSCREEN",locked:!1,name:"PETCT-SCREEN",createdDate:"2017-02-14T16:07:09.033Z",modifiedDate:"2017-02-14T16:18:43.930Z",availableTo:{},editableBy:{},protocolMatchingRules:[{id:"7tmuqgKzDMCWFeapc",weight:5,required:!1,attribute:"x00081030",constraint:{contains:{value:"PETCT"}}}],stages:[{id:"v5PfGt9F6mFgZPif5",name:"oneByOne",viewportStructure:{type:"grid",properties:{rows:1,columns:2},layoutTemplateName:"gridLayout"},viewports:[{viewportSettings:{},imageMatchingRules:[],seriesMatchingRules:[{id:"mXnsCcAzZL56z7mTZ",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"Topogram"}}}],studyMatchingRules:[]},{viewportSettings:{},imageMatchingRules:[],seriesMatchingRules:[{id:"mXnsCcNzZR56z7mTZ",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"Topogram"}}},{id:"mRnsCcNzZL56z7mTZ",weight:1,required:!1,attribute:"x00200011",constraint:{numericality:{greaterThanOrEqualTo:2}}}],studyMatchingRules:[]}],createdDate:"2017-02-14T16:07:09.033Z"},{id:"v5PfGt9F6mFgZPif5",name:"oneByOne",viewportStructure:{type:"grid",properties:{rows:1,columns:2},layoutTemplateName:"gridLayout"},viewports:[{viewportSettings:{},imageMatchingRules:[],seriesMatchingRules:[{id:"mXnsGcNzZL56z7mTZ",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"PET WB Corrected"}}}],studyMatchingRules:[]},{viewportSettings:{},imageMatchingRules:[],seriesMatchingRules:[{id:"mXnsHcNzZL56z7mTZ",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"CT WB"}}}],studyMatchingRules:[]}],createdDate:"2017-02-14T16:07:09.033Z"},{id:"v5PfGt9F6mFgZPif5",name:"oneByOne",viewportStructure:{type:"grid",properties:{rows:1,columns:2},layoutTemplateName:"gridLayout"},viewports:[{viewportSettings:{invert:"YES"},imageMatchingRules:[],seriesMatchingRules:[{id:"mXneCcNzZL56z7mTZ",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"PET WB Uncorrected"}}}],studyMatchingRules:[]},{viewportSettings:{},imageMatchingRules:[],seriesMatchingRules:[{id:"mXnsCuNzZL56z7mTZ",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"CT Nk"}}}],studyMatchingRules:[]}],createdDate:"2017-02-14T16:07:09.033Z"}],numberOfPriorsReferenced:0}),L.demoProtocols.push({id:"PETCTCOMPARE",locked:!1,name:"PETCT-COMPARE",createdDate:"2017-02-14T16:07:09.033Z",modifiedDate:"2017-02-14T16:18:43.930Z",availableTo:{},editableBy:{},protocolMatchingRules:[{id:"7tmuqgKzDMCWFeapc",weight:5,required:!1,attribute:"x00081030",constraint:{contains:{value:"PETCT"}}}],stages:[{id:"v5PfGt9F6mFgZPif5",name:"oneByOne",viewportStructure:{type:"grid",properties:{rows:1,columns:2},layoutTemplateName:"gridLayout"},viewports:[{viewportSettings:{},imageMatchingRules:[],seriesMatchingRules:[{id:"mXnsCcNzZL59z7mTZ",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"Topogram"}}}],studyMatchingRules:[]},{viewportSettings:{},imageMatchingRules:[],seriesMatchingRules:[{id:"mXnsCcNzZL56z7lTZ",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"Topogram"}}}],studyMatchingRules:[{id:"uDoEgLTbnXTByWnPz",weight:1,required:!1,attribute:"abstractPriorValue",constraint:{equals:{value:1}}}]}],createdDate:"2017-02-14T16:07:09.033Z"},{id:"v5PfGt9F6mFgZPif5",name:"oneByOne",viewportStructure:{type:"grid",properties:{rows:1,columns:2},layoutTemplateName:"gridLayout"},viewports:[{viewportSettings:{},imageMatchingRules:[],seriesMatchingRules:[{id:"mXnsCcNjZL56z7mTZ",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"Topogram"}}},{id:"mXnsCcNzZL56z7gTZ",weight:1,required:!1,attribute:"x00200011",constraint:{numericality:{greaterThanOrEqualTo:2}}}],studyMatchingRules:[]},{viewportSettings:{},imageMatchingRules:[],seriesMatchingRules:[{id:"mXnsCcCzZL56z7mTZ",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"Topogram"}}},{id:"mXnsCcNzZL56z7mTZ",weight:1,required:!1,attribute:"x00200011",constraint:{numericality:{greaterThanOrEqualTo:2}}}],studyMatchingRules:[{id:"uDoEgLTvn1TByWnPz",weight:1,required:!1,attribute:"abstractPriorValue",constraint:{equals:{value:1}}}]}],createdDate:"2017-02-14T16:07:09.033Z"},{id:"v5PfGt9F6mFgZPif5",name:"oneByOne",viewportStructure:{type:"grid",properties:{rows:2,columns:2},layoutTemplateName:"gridLayout"},viewports:[{viewportSettings:{},imageMatchingRules:[],seriesMatchingRules:[{id:"mXnsCcNzZL26z7mTZ",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"PET WB Corrected"}}}],studyMatchingRules:[]},{viewportSettings:{},imageMatchingRules:[],seriesMatchingRules:[{id:"mXnsCcNzZL46z7mTZ",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"CT WB"}}}],studyMatchingRules:[]},{viewportSettings:{},imageMatchingRules:[],seriesMatchingRules:[{id:"mXnsCcNzZL57z7mTZ",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"PET WB Corrected"}}}],studyMatchingRules:[{id:"uDoEgLTvnYTByWnPz",weight:1,required:!1,attribute:"abstractPriorValue",constraint:{equals:{value:1}}}]},{viewportSettings:{},imageMatchingRules:[],seriesMatchingRules:[{id:"mXnsCcNzZQ56z7mTZ",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"CT WB"}}}],studyMatchingRules:[{id:"uDoEgLTvnKTByWnPz",weight:1,required:!1,attribute:"abstractPriorValue",constraint:{equals:{value:1}}}]}],createdDate:"2017-02-14T16:07:09.033Z"},{id:"v5PfGt9F6mFgZPif5",name:"oneByOne",viewportStructure:{type:"grid",properties:{rows:2,columns:2},layoutTemplateName:"gridLayout"},viewports:[{viewportSettings:{invert:"YES"},imageMatchingRules:[],seriesMatchingRules:[{id:"mXnsCcNzZL56z7nTZ",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"PET WB Uncorrected"}}}],studyMatchingRules:[]},{viewportSettings:{},imageMatchingRules:[],seriesMatchingRules:[{id:"mXnsCcNxZL56z7mTZ",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"CT Nk"}}}],studyMatchingRules:[]},{viewportSettings:{invert:"YES"},imageMatchingRules:[],seriesMatchingRules:[{id:"mXnsCcNzZA56z7mTZ",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"PET WB Uncorrected"}}}],studyMatchingRules:[{id:"uDoEgHTvnXTByWnPz",weight:1,required:!1,attribute:"abstractPriorValue",constraint:{equals:{value:1}}}]},{viewportSettings:{},imageMatchingRules:[],seriesMatchingRules:[{id:"mXnsCcNzZP56z7mTZ",weight:1,required:!1,attribute:"x0008103e",constraint:{contains:{value:"CT Nk"}}}],studyMatchingRules:[{id:"uDoEgITvnXTByWnPz",weight:1,required:!1,attribute:"abstractPriorValue",constraint:{equals:{value:1}}}]}],createdDate:"2017-02-14T16:07:09.033Z"}],numberOfPriorsReferenced:1})}t()},classes:{"Protocol.js":["babel-runtime/helpers/classCallCheck","meteor/meteor","meteor/random","../lib/removeFromArray",function(t,e,n){var o;n.import("babel-runtime/helpers/classCallCheck",{default:function(t){o=t}});var r;n.import("meteor/meteor",{Meteor:function(t){r=t}});var i;n.import("meteor/random",{Random:function(t){i=t}});var a;n.import("../lib/removeFromArray",{removeFromArray:function(t){a=t}}),L.Protocol=function(){function t(e){o(this,t),this.id=i.id(),this.locked=!1,this.hasUpdatedPriorsInformation=!1,this.name=e,this.createdDate=new Date,this.modifiedDate=new Date,r.users&&r.userId&&(this.createdBy=r.userId,this.modifiedBy=r.userId),this.availableTo=new v,this.editableBy=new v,this.protocolMatchingRules=[],this.stages=[],this.numberOfPriorsReferenced=-1}return t.prototype.getNumberOfPriorsReferenced=function(){function t(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=t!==!0?this.numberOfPriorsReferenced:-1;return e>-1?e:(e=0,this.stages.forEach(function(t){t.viewports&&t.viewports.forEach(function(t){t.studyMatchingRules&&t.studyMatchingRules.forEach(function(t){var n=t.getNumberOfPriorsReferenced();n>e&&(e=n)})})}),this.numberOfPriorsReferenced=e,e)}return t}(),t.prototype.updateNumberOfPriorsReferenced=function(){function t(){this.getNumberOfPriorsReferenced(!0)}return t}(),t.prototype.protocolWasModified=function(){function t(){r.users&&r.userId&&(this.modifiedBy=r.userId),this.hasUpdatedPriorsInformation=!1,this.updateNumberOfPriorsReferenced(),this.modifiedDate=new Date}return t}(),t.prototype.fromObject=function(){function t(t){var e=this;this.id=t.id||i.id(),this.name=t.name,this.locked=!!t.locked,t.protocolMatchingRules&&t.protocolMatchingRules.forEach(function(t){var n=new L.ProtocolMatchingRule;n.fromObject(t),e.protocolMatchingRules.push(n)}),t.stages&&t.stages.forEach(function(t){var n=new L.Stage;n.fromObject(t),e.stages.push(n)})}return t}(),t.prototype.createClone=function(){function t(t){var e=Object.assign({},this),n=new L.Protocol;return e.id=n.id,n.fromObject(e),t&&(n.name=t),n.locked=!1,n}return t}(),t.prototype.addStage=function(){function t(t){this.stages.push(t),this.protocolWasModified()}return t}(),t.prototype.addProtocolMatchingRule=function(){function t(t){this.protocolMatchingRules.push(t),this.protocolWasModified()}return t}(),t.prototype.removeProtocolMatchingRule=function(){function t(t){var e=a(this.protocolMatchingRules,t);e&&this.protocolWasModified()}return t}(),t}()}],"Rule.js":["babel-runtime/helpers/classCallCheck","meteor/random","../lib/comparators",function(t,e,n){n.export({Rule:function(){return s}});var o;n.import("babel-runtime/helpers/classCallCheck",{default:function(t){o=t}});var r;n.import("meteor/random",{Random:function(t){r=t}});var i;n.import("../lib/comparators",{comparators:function(t){i=t}});var a=/^equals$/,s=function(){function t(e,n,i,a){o(this,t),this.id=r.id(),this.weight=a||1,e&&(this.attribute=e),n&&(this.constraint=n),void 0===i?this.required=!1:this.required=i,this._constraintInfo=void 0,this._validatorAndValue=void 0}return t.prototype.fromObject=function(){function t(t){this.id=t.id||r.id(),this.required=t.required,this.weight=t.weight,this.attribute=t.attribute,this.constraint=t.constraint}return t}(),t.prototype.getConstraintInfo=function(){function t(){var t=this._constraintInfo;if(void 0!==t)return t;var e=Object.keys(this.constraint)[0];return void 0!==e&&(t=i.find(function(t){return e===t.id})),this._constraintInfo=t,t}return t}(),t.prototype.isRuleForPrior=function(){function t(){return"abstractPriorValue"===this.attribute}return t}(),t.prototype.getNumberOfPriorsReferenced=function(){function t(){if(!this.isRuleForPrior())return-1;var t=this.getConstraintValidatorAndValue(),e=t.value,n=t.validator,o=parseInt(e,10)||0;return a.test(n)?o<0?1:o:0}return t}(),t.prototype.getConstraintValidatorAndValue=function(){function t(){var t=this._validatorAndValue;if(void 0!==t)return t;var e=this.getConstraintInfo();if(void 0!==e){var n=e.validator,o=this.constraint[n];if(o){var r=e.validatorOption,i=o[r];t={value:i,validator:e.id},this._validatorAndValue=t}}return t}return t}(),t}()}],"Stage.js":["babel-runtime/helpers/classCallCheck","meteor/random",function(t,e,n){var o;n.import("babel-runtime/helpers/classCallCheck",{default:function(t){o=t}});var r;n.import("meteor/random",{Random:function(t){r=t}}),L.Stage=function(){function t(e,n){o(this,t),this.id=r.id(),this.name=n,this.viewportStructure=e,this.viewports=[],this.createdDate=new Date}return t.prototype.createClone=function(){function t(t){var e=Object.assign({},this),n=new L.Stage;return e.id=n.id,n.fromObject(e),t&&(n.name=t),n}return t}(),t.prototype.fromObject=function(){function t(t){var e=this;this.id=t.id||r.id(),this.name=t.name,this.viewportStructure=new L.ViewportStructure,this.viewportStructure.fromObject(t.viewportStructure),t.viewports&&t.viewports.forEach(function(t){var n=new L.Viewport;n.fromObject(t),e.viewports.push(n)})}return t}(),t}()}],"Viewport.js":["babel-runtime/helpers/classCallCheck","../lib/removeFromArray",function(t,e,n){var o;n.import("babel-runtime/helpers/classCallCheck",{default:function(t){o=t}});var r;n.import("../lib/removeFromArray",{removeFromArray:function(t){r=t}}),L.Viewport=function(){function t(){o(this,t),this.viewportSettings={},this.imageMatchingRules=[],this.seriesMatchingRules=[],this.studyMatchingRules=[]}return t.prototype.fromObject=function(){function t(t){var e=this;t.imageMatchingRules&&t.imageMatchingRules.forEach(function(t){var n=new L.ImageMatchingRule;n.fromObject(t),e.imageMatchingRules.push(n)}),t.seriesMatchingRules&&t.seriesMatchingRules.forEach(function(t){var n=new L.SeriesMatchingRule;n.fromObject(t),e.seriesMatchingRules.push(n)}),t.studyMatchingRules&&t.studyMatchingRules.forEach(function(t){var n=new L.StudyMatchingRule;n.fromObject(t),e.studyMatchingRules.push(n)}),t.viewportSettings&&(this.viewportSettings=t.viewportSettings)}return t}(),t.prototype.removeRule=function(){function t(t){var e;t instanceof L.StudyMatchingRule?e=this.studyMatchingRules:t instanceof L.SeriesMatchingRule?e=this.seriesMatchingRules:t instanceof L.ImageMatchingRule&&(e=this.imageMatchingRules),r(e,t)}return t}(),t}()}],"ViewportStructure.js":["babel-runtime/helpers/classCallCheck",function(t,e,n){var o;n.import("babel-runtime/helpers/classCallCheck",{default:function(t){o=t}}),L.ViewportStructure=function(){function t(e,n){o(this,t),this.type=e,this.properties=n}return t.prototype.fromObject=function(){function t(t){this.type=t.type,this.properties=t.properties}return t}(),t.prototype.getLayoutTemplateName=function(){function t(){switch(this.type){case"grid":return"gridLayout"}}return t}(),t.prototype.getNumViewports=function(){function t(){switch(this.type){case"grid":return this.properties.rows*this.properties.columns}}return t}(),t}()}],rules:{"ImageMatchingRule.js":["babel-runtime/helpers/classCallCheck","babel-runtime/helpers/possibleConstructorReturn","babel-runtime/helpers/inherits","../Rule",function(t,e,n){var o;n.import("babel-runtime/helpers/classCallCheck",{default:function(t){o=t}});var r;n.import("babel-runtime/helpers/possibleConstructorReturn",{default:function(t){r=t}});var i;n.import("babel-runtime/helpers/inherits",{default:function(t){i=t}});var a;n.import("../Rule",{Rule:function(t){a=t}}),L.ImageMatchingRule=function(t){function e(){return o(this,e),r(this,t.apply(this,arguments))}return i(e,t),e}(a)}],"ProtocolMatchingRule.js":["babel-runtime/helpers/classCallCheck","babel-runtime/helpers/possibleConstructorReturn","babel-runtime/helpers/inherits","../Rule",function(t,e,n){var o;n.import("babel-runtime/helpers/classCallCheck",{default:function(t){o=t}});var r;n.import("babel-runtime/helpers/possibleConstructorReturn",{default:function(t){r=t}});var i;n.import("babel-runtime/helpers/inherits",{default:function(t){i=t}});var a;n.import("../Rule",{Rule:function(t){a=t}}),L.ProtocolMatchingRule=function(t){function e(){return o(this,e),r(this,t.apply(this,arguments))}return i(e,t),e}(a)}],"SeriesMatchingRule.js":["babel-runtime/helpers/classCallCheck","babel-runtime/helpers/possibleConstructorReturn","babel-runtime/helpers/inherits","../Rule",function(t,e,n){var o;n.import("babel-runtime/helpers/classCallCheck",{default:function(t){o=t}});var r;n.import("babel-runtime/helpers/possibleConstructorReturn",{default:function(t){r=t}});var i;n.import("babel-runtime/helpers/inherits",{default:function(t){i=t}});var a;n.import("../Rule",{Rule:function(t){a=t}}),L.SeriesMatchingRule=function(t){function e(){return o(this,e),r(this,t.apply(this,arguments))}return i(e,t),e}(a)}],"StudyMatchingRule.js":["babel-runtime/helpers/classCallCheck","babel-runtime/helpers/possibleConstructorReturn","babel-runtime/helpers/inherits","../Rule",function(t,e,n){var o;n.import("babel-runtime/helpers/classCallCheck",{default:function(t){o=t}});var r;n.import("babel-runtime/helpers/possibleConstructorReturn",{default:function(t){r=t}});var i;n.import("babel-runtime/helpers/inherits",{default:function(t){i=t}});var a;n.import("../Rule",{Rule:function(t){a=t}}),L.StudyMatchingRule=function(t){function e(){return o(this,e),r(this,t.apply(this,arguments))}return i(e,t),e}(a)}]}},lib:{"comparators.js":function(t,e,n){n.export({comparators:function(){return o}});var o=[{id:"equals",name:"= (Equals)",validator:"equals",validatorOption:"value",description:"The attribute must equal this value."},{id:"doesNotEqual",name:"!= (Does not equal)",validator:"doesNotEqual",validatorOption:"value",description:"The attribute must not equal this value."},{id:"contains",name:"Contains",validator:"contains",validatorOption:"value",description:"The attribute must contain this value."},{id:"doesNotContain",name:"Does not contain",validator:"doesNotContain",validatorOption:"value",description:"The attribute must not contain this value."},{id:"onlyInteger",name:"Only Integers",validator:"numericality",validatorOption:"onlyInteger",description:"Real numbers won't be allowed."},{id:"greaterThan",name:"> (Greater than)",validator:"numericality",validatorOption:"greaterThan",description:"The attribute has to be greater than this value."},{id:"greaterThanOrEqualTo",name:">= (Greater than or equal to)",validator:"numericality",validatorOption:"greaterThanOrEqualTo",description:"The attribute has to be at least this value."},{id:"lessThanOrEqualTo",name:"<= (Less than or equal to)",validator:"numericality",validatorOption:"lessThanOrEqualTo",description:"The attribute can be this value at the most."},{id:"lessThan",name:"< (Less than)",validator:"numericality",validatorOption:"lessThan",description:"The attribute has to be less than this value."},{id:"odd",name:"Odd",validator:"numericality",validatorOption:"odd",description:"The attribute has to be odd."},{id:"even",name:"Even",validator:"numericality",validatorOption:"even",description:"The attribute has to be even."}];Object.freeze(o)},"removeFromArray.js":["meteor/underscore",function(t,e,n){n.export({removeFromArray:function(){return r}});var o;n.import("meteor/underscore",{_:function(t){o=t}});var r=function t(e,n){return!(!e||!e.length)&&(e.forEach(function(t,e){if(o.isEqual(t,n))return X=e,!1}),void 0!==X&&(e.splice(X,1),!0))}}]}},client:{"collections.js":["meteor/meteor","../both/lib/comparators",function(t,e,n){var o;n.import("meteor/meteor",{Meteor:function(t){o=t}});var r;n.import("../both/lib/comparators",{comparators:function(t){r=t}}),Z=new o.Collection(null),Z._debugName="MatchedProtocols",z=new o.Collection(null),
z._debugName="Comparators",r.forEach(function(t){z.insert(t)})}],"protocolEngine.js":["babel-runtime/helpers/extends","babel-runtime/helpers/typeof","babel-runtime/helpers/classCallCheck","meteor/meteor","meteor/underscore","meteor/session","meteor/ohif:core","meteor/ohif:viewerbase","./matcher/HPMatcher","./lib/sortByScore","./customViewportSettings",function(t,e,n){var o;n.import("babel-runtime/helpers/extends",{default:function(t){o=t}});var r;n.import("babel-runtime/helpers/typeof",{default:function(t){r=t}});var i;n.import("babel-runtime/helpers/classCallCheck",{default:function(t){i=t}});var a;n.import("meteor/meteor",{Meteor:function(t){a=t}});var s;n.import("meteor/underscore",{_:function(t){s=t}});var u;n.import("meteor/session",{Session:function(t){u=t}});var c;n.import("meteor/ohif:core",{OHIF:function(t){c=t}}),n.import("meteor/ohif:viewerbase");var l;n.import("./matcher/HPMatcher",{HPMatcher:function(t){l=t}});var d;n.import("./lib/sortByScore",{sortByScore:function(t){d=t}}),n.import("./customViewportSettings");var g=c.viewerbase,p=g.OHIFError,f=g.metadata,m=f.StudyMetadata,v=f.SeriesMetadata,b=f.InstanceMetadata,y=f.StudySummary,w="abstractPriorValue";U=void 0,L.setEngine=function(t){U=t},a.startup(function(){L.addCustomViewportSetting("wlPreset","Window/Level Preset",Object.create(null),function(t,e){s.findWhere(c.viewer.wlPresets,{id:e})&&c.viewerbase.wlPresets.applyWLPreset(e,t)})}),L.ProtocolEngine=function(){function t(e,n,o,r){i(this,t);var a=c.viewerbase,s=a.LayoutManager,u=a.StudyMetadataSource;if(!(e instanceof s))throw new p("ProtocolEngine::constructor layoutManager is not an instance of LayoutManager");if(!(r instanceof u))throw new p("ProtocolEngine::constructor studyMetadataSource is not an instance of StudyMetadataSource");if(!(n instanceof Array||n.every(function(t){return t instanceof m})))throw new p("ProtocolEngine::constructor studies is not an array or it's items are not instances of StudyMetadata");this.LayoutManager=e,this.studies=n,this.priorStudies=o instanceof h?o:new h,this.studyMetadataSource=r,this.reset(),this.newStageIds=[]}return t.prototype.reset=function(){function t(){var t=this.getBestProtocolMatch();this.setHangingProtocol(t)}return t}(),t.prototype.getCurrentStageModel=function(){function t(){return this.protocol.stages[this.stage]}return t}(),t.prototype.findMatchByStudy=function(){function t(t){c.log.info("ProtocolEngine::findMatchByStudy");var e=[],n=t.getFirstInstance(),o=this.getNumberOfAvailablePriors(t.getObjectID());if(L.ProtocolStore.getProtocol().forEach(function(t){var r=t.protocolMatchingRules.slice();if(r){var i=t.getNumberOfPriorsReferenced();if(!(i>o)){var a=l.match(n,r),s=a.score;s>0&&e.push({score:s,protocol:t})}}}),!e.length){var r=L.ProtocolStore.getProtocol("defaultProtocol");return[{score:1,protocol:r}]}return d(e),c.log.info("ProtocolEngine::findMatchByStudy matched",e),e}return t}(),t.prototype.updateProtocolMatches=function(){function t(){var t=this;c.log.info("ProtocolEngine::updateProtocolMatches"),Z.remove({}),this.studies.forEach(function(e){var n=t.findMatchByStudy(e);n.forEach(function(t){var e=t.protocol;if(e){var n=Z.findOne({id:e.id});n||(c.log.info("ProtocolEngine::updateProtocolMatches inserting protocol match",t),Z.insert(t))}})})}return t}(),t.prototype.getBestProtocolMatch=function(){function t(){this.updateProtocolMatches();var t=Z.find({},{sort:{score:-1},limit:1}).fetch(),e=t[0].protocol;return c.log.info("ProtocolEngine::getBestProtocolMatch bestMatch",e),e}return t}(),t.prototype.getNumberOfAvailablePriors=function(){function t(t){var e=this.getAvailableStudyPriors(t);return e.length}return t}(),t.prototype.getAvailableStudyPriors=function(){function t(t){var e=this.priorStudies.get(t);return e instanceof Array?e:[]}return t}(),t.prototype.matchImages=function(){function t(t,e){var n=this;c.log.info("ProtocolEngine::matchImages");var o=t.studyMatchingRules,i=t.seriesMatchingRules,a=t.imageMatchingRules,s=[],u=this.studies[0],d=u.getFirstInstance(),g=0,f=0,h=0,v=void 0;u.setCustomAttribute(w,0),d instanceof b&&d.setCustomAttribute(w,0);var P=void 0;o.forEach(function(t){if(t.attribute===w){var o=function(){var o=Object.keys(t.constraint)[0],r=Object.keys(t.constraint[o])[0],i=t.constraint[o][r];i=parseInt(i,10),P||(P=n.getAvailableStudyPriors(u.getObjectID()));var a=void 0;if(i===-1)a=P[P.length-1];else{var s=Math.max(i-1,0);a=P[s]}if(!(a instanceof m||a instanceof y))return{v:void 0};var l=a.getObjectID();return n.studies.find(function(t){return t.getObjectID()===l})?{v:void 0}:void n.studyMetadataSource.loadStudy(a).then(function(t){t.setCustomAttribute(w,i);var o=t.getFirstInstance();o instanceof b&&o.setCustomAttribute(w,i),n.studies.push(t),n.updateViewports(e)},function(t){throw c.log.warn(t),new p("ProtocolEngine::matchImages could not get study metadata for the Study with the following ObjectID: "+l)})}();if("object"===("undefined"==typeof o?"undefined":r(o)))return o.v}}),this.studies.forEach(function(t){var e=l.match(t.getFirstInstance(),o);o.length&&!e.score||e.score<g||(g=e.score,t.forEachSeries(function(n){var o=l.match(n.getFirstInstance(),i);i.length&&!o.score||o.score<f||(f=o.score,n.forEachInstance(function(r,i){if(c.viewerbase.isImage(r.getTagValue("x00080016"))||r.getTagValue("x00280010")){var u=l.match(r,a),d={passed:[],failed:[]};d.passed=d.passed.concat(u.details.passed),d.passed=d.passed.concat(o.details.passed),d.passed=d.passed.concat(e.details.passed),d.failed=d.failed.concat(u.details.failed),d.failed=d.failed.concat(o.details.failed),d.failed=d.failed.concat(e.details.failed);var g=u.score+o.score+e.score,p=r.getSOPInstanceUID(),f={studyInstanceUid:t.getStudyInstanceUID(),seriesInstanceUid:n.getSeriesInstanceUID(),sopInstanceUid:p,currentImageIdIndex:i,matchingScore:g,matchDetails:d,sortingInfo:{score:g,study:r.getTagValue("x00080020")+r.getTagValue("x00080030"),series:parseInt(r.getTagValue("x00200011")),instance:parseInt(r.getTagValue("x00200013"))}},m=t.findDisplaySet(function(t){return t.images.find(function(t){return t.getSOPInstanceUID()===p})});m&&(f.displaySetInstanceUid=m.getUID(),f.imageId=r.getImageId()),(g>h||!v)&&(h=g,v=f),s.push(f)}}))}))});var S=c.utils.sortBy({name:"score",reverse:!0},{name:"study",reverse:!0},{name:"instance"},{name:"series"});return s.sort(function(t,e){return S(t.sortingInfo,e.sortingInfo)}),c.log.info("ProtocolEngine::matchImages bestMatch",v),{bestMatch:v,matchingScores:s}}return t}(),t.prototype.updateViewports=function(){function t(t){var e=this;if(c.log.info("ProtocolEngine::updateViewports viewportIndex: "+t),this.getNumProtocolStages()){var n=this.getCurrentStageModel();if(n&&n.viewportStructure&&n.viewports&&n.viewports.length){var r=n.viewportStructure.getLayoutTemplateName();if(r){var i=n.viewportStructure.properties;if(i){var a=[];this.matchDetails=[],n.viewports.forEach(function(t,n){var r=e.matchImages(t,n);e.matchDetails[n]=r;var u={},l=Object.keys(t.viewportSettings);l.forEach(function(e){var n=t.viewportSettings[e];"YES"===n?n=!0:"NO"===n&&(n=!1),u[e]=n});var d=o({viewportIndex:n,viewport:u},i),g=[];l.forEach(function(e){var n=L.CustomViewportSettings[e];n&&g.push({id:e,value:t.viewportSettings[e]})}),d.renderedCallback=function(t){g.forEach(function(e){c.log.info("ProtocolEngine::currentViewportData.renderedCallback Applying custom setting: "+e.id),c.log.info("ProtocolEngine::currentViewportData.renderedCallback with value: "+e.value);var n=L.CustomViewportSettings[e.id];n.callback(t,e.value)})};for(var p=r.bestMatch,f=1,m=r.matchingScores.length;f<m&&s.findWhere(a,{imageId:p.imageId});)p=r.matchingScores[f],f++;p&&p.imageId&&(d.studyInstanceUid=p.studyInstanceUid,d.seriesInstanceUid=p.seriesInstanceUid,d.sopInstanceUid=p.sopInstanceUid,d.currentImageIdIndex=p.currentImageIdIndex,d.displaySetInstanceUid=p.displaySetInstanceUid,d.imageId=p.imageId),a.push(d)}),this.LayoutManager.layoutTemplateName=r,this.LayoutManager.layoutProps=i,this.LayoutManager.viewportData=a,void 0!==t&&a[t]?this.LayoutManager.rerenderViewportWithNewDisplaySet(t,a[t]):this.LayoutManager.updateViewports()}}}}}return t}(),t.prototype.setHangingProtocol=function(){function t(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];c.log.info("ProtocolEngine::setHangingProtocol newProtocol",t),c.log.info("ProtocolEngine::setHangingProtocol updateViewports = "+e),this.newStageIds=[],L.Protocol.prototype.isPrototypeOf(t)?this.protocol=t:(this.protocol=new L.Protocol,this.protocol.fromObject(t)),this.stage=0,e&&this.updateViewports(),Z.update({},{$set:{selected:!1}},{multi:!0}),Z.update({id:this.protocol.id},{$set:{selected:!0}}),u.set("HangingProtocolName",this.protocol.name),u.set("HangingProtocolStage",this.stage)}return t}(),t.prototype.isNextStageAvailable=function(){function t(){var t=this.getNumProtocolStages();return this.stage+1<t}return t}(),t.prototype.isPreviousStageAvailable=function(){function t(){return this.stage-1>=0}return t}(),t.prototype.setCurrentProtocolStage=function(){function t(t){return!(t===-1&&!this.isPreviousStageAvailable())&&(!(1===t&&!this.isNextStageAvailable())&&(this.stage+=t,c.log.info("ProtocolEngine::setCurrentProtocolStage stage = "+this.stage),u.set("HangingProtocolStage",this.stage),this.updateViewports(),!0))}return t}(),t.prototype.getNumProtocolStages=function(){function t(){if(this.protocol&&this.protocol.stages&&this.protocol.stages.length)return this.protocol.stages.length}return t}(),t.prototype.nextProtocolStage=function(){function t(){c.log.info("ProtocolEngine::nextProtocolStage"),this.setCurrentProtocolStage(1)||c.log.info("ProtocolEngine::nextProtocolStage failed")}return t}(),t.prototype.previousProtocolStage=function(){function t(){c.log.info("ProtocolEngine::previousProtocolStage"),this.setCurrentProtocolStage(-1)||c.log.info("ProtocolEngine::previousProtocolStage failed")}return t}(),t}()}],helpers:{"displayConstraint.js":["meteor/blaze",function(t,e,n){var o;n.import("meteor/blaze",{Blaze:function(t){o=t}});var r=Object.create(null),i=/^\([x0-9a-f]+\)/,a=function t(e){var n=e.replace(/([A-Z])/g," $1");return n=n.replace(/^./,function(t){return t.toUpperCase()})},s=function t(e,n){if(e in r)return r[e];var o=n.find(function(t){return t.id===e}),a=void 0;return o&&(a=o.text.replace(i,""),r[e]=a),a||""};o.registerHelper("displayConstraint",function(t,e,n){if(e&&t){var o=Object.keys(e)[0];if(o){var r=Object.keys(e[o])[0];if(r){var i=e[o][r];if(void 0!==i){var u=r;"value"===r&&(u=o);var c=s(t,n),l=c+" "+a(u).toLowerCase()+" "+i;return l}}}}})}],"attributes.js":["meteor/blaze",function(t,e,n){var o;n.import("meteor/blaze",{Blaze:function(t){o=t}}),o.registerHelper("viewportSettingsTypes",function(){return L.viewportSettingsTypes}),o.registerHelper("toolSettingsTypes",function(){return L.toolSettingsTypes}),o.registerHelper("studyAttributes",function(){return L.studyAttributes}),o.registerHelper("seriesAttributes",function(){return L.seriesAttributes}),o.registerHelper("instanceAttributes",function(){return L.instanceAttributes})}]},protocolStore:{"protocolStore.js":function(t,e,n){L.ProtocolStore=function(){function t(t){s=t}function e(t){s.onReady(t)}function n(t){var e=new L.Protocol;return e.fromObject(t),e}function o(t){var e=s.getProtocol(t);return e instanceof Array?e.forEach(function(t,o){t instanceof L.Protocol||(e[o]=n(t))}):void 0===e||e instanceof L.Protocol||(e=n(e)),e}function r(t){s.addProtocol(t)}function i(t,e){s.updateProtocol(t,e)}function a(t){s.removeProtocol(t)}var s;return{setStrategy:t,onReady:e,getProtocol:o,addProtocol:r,updateProtocol:i,removeProtocol:a}}()},"defaultStrategy.js":function(){var e=function(){function e(){console.log("Inserting default protocols"),i(L.defaultProtocol)}function n(t){var e=A.findOne({id:t},{fields:{_id:!0}});if(e)return e._id}function o(n){u&&u.ready()?n():(u=t.subscribe("hangingprotocols"),T.autorun(function(t){u.ready()&&(t.stop(),e(),n())}))}function r(t){return t?A.findOne({id:t}):A.find().fetch()}function i(t){var e=n(t.id);return delete t._id,e?void A.update(e,{$set:t}):void A.insert(t)}function a(t,e){var o=n(t);o&&(delete e._id,A.update(o,{$set:e}))}function s(t){var e=n(t);e&&A.remove(e)}var u;return{onReady:o,getProtocol:r,addProtocol:i,updateProtocol:a,removeProtocol:s}}();L.ProtocolStore.setStrategy(e)}},components:{previousPresentationGroupButton:{"template.previousPresentationGroupButton.js":function(){a.__checkName("previousPresentationGroupButton"),a.previousPresentationGroupButton=new a("Template.previousPresentationGroupButton",function(){var t=this;return B.DIV({id:function(){return E.mustache(E.dot(t.lookup("."),"id"))},class:function(){return["toolbarSectionButton rp-x-1 ",E.mustache(E.dot(t.lookup("."),"classes"))," ",E.mustache(t.lookup("activeClass"))," ",x.If(function(){return E.call(t.lookup("previousNotAvailable"))},function(){return"disabled"})]},title:function(){return E.mustache(E.dot(t.lookup("."),"title"))},disabled:function(){return x.If(function(){return E.call(t.lookup("previousNotAvailable"))},function(){return"true"})}},"\n ",B.DIV({class:"svgContainer"},"\n ",x.If(function(){return E.call(E.dot(t.lookup("."),"svgLink"))},function(){return["\n ",B.SVG("\n ",B.USE({"xlink:href":function(){return E.mustache(t.lookup("absoluteUrl"),E.dot(t.lookup("."),"svgLink"))}}),"\n "),"\n "]},function(){return["\n ",B.I({class:function(){return E.mustache(t.lookup("iconClasses"))}}),"\n "]}),"\n "),"\n ",B.DIV({class:"buttonLabel"},"\n ",x.View("lookup:..title",function(){return E.mustache(E.dot(t.lookup("."),"title"))}),"\n "),"\n ")})},"previousPresentationGroupButton.js":function(){a.previousPresentationGroupButton.helpers({previousNotAvailable:function(){function t(){if(M.get("LayoutManagerUpdated"),U)return 0===U.stage}return t}()}),a.previousPresentationGroupButton.events({"click #previousPresentationGroup":function(){function t(t){U&&(o(t.currentTarget).hasClass("disabled")||(o(t.currentTarget).tooltip("hide"),U.previousProtocolStage()))}return t}()})}},nextPresentationGroupButton:{"template.nextPresentationGroupButton.js":function(){a.__checkName("nextPresentationGroupButton"),a.nextPresentationGroupButton=new a("Template.nextPresentationGroupButton",function(){var t=this;return B.DIV({id:function(){return E.mustache(E.dot(t.lookup("."),"id"))},class:function(){return["toolbarSectionButton rp-x-1 ",E.mustache(E.dot(t.lookup("."),"classes"))," ",E.mustache(t.lookup("activeClass"))," ",x.If(function(){return E.call(t.lookup("nextNotAvailable"))},function(){return"disabled"})]},title:function(){return E.mustache(E.dot(t.lookup("."),"title"))},disabled:function(){return x.If(function(){return E.call(t.lookup("nextNotAvailable"))},function(){return"true"})}},"\n ",B.DIV({class:"svgContainer"},"\n ",x.If(function(){return E.call(E.dot(t.lookup("."),"svgLink"))},function(){return["\n ",B.SVG("\n ",B.USE({"xlink:href":function(){return E.mustache(t.lookup("absoluteUrl"),E.dot(t.lookup("."),"svgLink"))}}),"\n "),"\n "]},function(){return["\n ",B.I({class:function(){return E.mustache(t.lookup("iconClasses"))}}),"\n "]}),"\n "),"\n ",B.DIV({class:"buttonLabel"},"\n ",x.View("lookup:..title",function(){return E.mustache(E.dot(t.lookup("."),"title"))}),"\n "),"\n ")})},"nextPresentationGroupButton.js":function(){a.nextPresentationGroupButton.helpers({nextNotAvailable:function(){function t(){if(M.get("LayoutManagerUpdated"),U)return U.stage===U.getNumProtocolStages()-1}return t}()}),a.nextPresentationGroupButton.events({"click #nextPresentationGroup":function(){function t(t){U&&(o(t.currentTarget).hasClass("disabled")||(o(t.currentTarget).tooltip("hide"),U.nextProtocolStage()))}return t}()})}},matchedProtocols:{"template.matchedProtocols.js":function(){a.__checkName("matchedProtocols"),a.matchedProtocols=new a("Template.matchedProtocols",function(){var t=this;return B.DIV({id:"matchedProtocols",class:"btn-group"},"\n ",x.If(function(){return E.call(t.lookup("matchedProtocols"))},function(){return["\n ",B.BUTTON({type:"button",class:"btn btn-sm dropdown-toggle","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",title:"Select Hanging Protocol"},"\n ",B.I({class:"fa fa-list-ol"}),"\n ",B.SPAN({class:"caret"}),"\n "),"\n ",B.UL({class:"dropdown-menu"},"\n ",B.LI("\n ",B.H5("Select a Hanging Protocol"),"\n "),"\n ",x.Each(function(){return E.call(t.lookup("matchedProtocols"))},function(){return["\n ",B.LI("\n ",B.A({class:function(){return["matchedProtocol ",x.If(function(){return E.call(t.lookup("active"))},function(){return"active"})]}},"\n ",x.View("lookup:name",function(){return E.mustache(t.lookup("name"))}),"\n "),"\n "),"\n "]}),"\n "),"\n "]}),"\n ")})},"matchedProtocols.js":["meteor/ohif:core",function(t,e,n){var o;n.import("meteor/ohif:core",{OHIF:function(t){o=t}}),a.matchedProtocols.helpers({matchedProtocols:function(){function t(){return Z.find()}return t}()}),a.matchedProtocols.events({"click .matchedProtocol":function(){function t(){var t=this;U.setHangingProtocol(t)}return t}()})}]},protocolEditor:{"template.protocolEditor.js":function(){a.__checkName("protocolEditor"),a.protocolEditor=new a("Template.protocolEditor",function(){var t=this;return B.DIV({id:"protocolEditor"},B.Raw('\n <div class="row navigationButtonsContainer">\n <div class="navigationButtons col-xs-12">\n <ul class="nav nav-pills">\n <li class="active">\n <a data-toggle="tab" href="#protocolRulePane">\n Protocol\n </a>\n </li>\n <li>\n <a data-toggle="tab" href="#activeViewportEditor">\n Active Viewport\n </a>\n </li>\n </ul>\n </div>\n </div>\n '),B.DIV({class:"tab-content"},"\n ",B.DIV({id:"protocolRulePane",class:"tab-pane active"},"\n ",E.With(function(){return E.call(t.lookup("activeProtocol"))},function(){return["\n ",B.DIV({id:"selectProtocol",class:"protocolEditorSection"},"\n ",B.SELECT({id:"protocolSelect",style:"width: 50%"},"\n "),"\n ",B.DIV({class:"dropdown protocolDropdown"},"\n ",B.BUTTON({type:"button",class:"btn btn-sm dropdown-toggle",id:"protocolDropdown","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"true"},"\n ",B.I({class:"fa fa-cog"})," ",B.SPAN({class:"caret"}),"\n "),"\n ",B.UL({class:"dropdown-menu dropdown-menu-right","aria-labelledby":"protocolDropdown"},"\n ",B.LI("\n ",B.A({id:"newProtocol"},"\n New ",B.I({class:"fa fa-file-text"}),"\n "),"\n "),"\n ",B.LI("\n ",B.A({id:"importProtocol",class:"btn-file"},"\n Import ",B.INPUT({type:"file"})," ",B.I({class:"fa fa-upload"}),"\n "),"\n "),"\n ",x.Unless(function(){return E.call(t.lookup("locked"))},function(){return["\n ",B.LI("\n ",B.A({id:"renameProtocol"},"\n Rename ",B.I({class:"fa fa-pencil"}),"\n "),"\n "),"\n "]}),"\n ",B.LI("\n ",B.A({id:"saveAsProtocol"},"\n Save As ",B.I({class:"fa fa-files-o"}),"\n "),"\n "),"\n ",B.LI("\n ",B.A({id:"exportJSON"},"\n Export ",B.I({class:"fa fa-download"}),"\n "),"\n "),"\n ",x.Unless(function(){return E.call(t.lookup("locked"))},function(){return["\n ",B.LI("\n ",B.A({id:"deleteProtocol"},"\n Delete ",B.I({class:"fa fa-trash-o"}),"\n "),"\n "),"\n "]}),"\n "),"\n "),"\n "),"\n ",B.DIV({id:"editProtocol",class:"protocolEditorSection"},"\n ",B.DIV({class:"row"},"\n ",B.DIV({class:"col-xs-12"},"\n ",B.P("Created: ",x.View("lookup:formatJSDate",function(){return E.mustache(t.lookup("formatJSDate"),t.lookup("createdDate"))}),x.If(function(){return E.call(t.lookup("createdBy"))},function(){return[" by ",x.View("lookup:getUsername",function(){return E.mustache(t.lookup("getUsername"),t.lookup("createdBy"))})]})),"\n ",B.P("Last modified: ",x.View("lookup:formatJSDate",function(){return E.mustache(t.lookup("formatJSDate"),t.lookup("modifiedDate"))}),x.If(function(){return E.call(t.lookup("createdBy"))},function(){return[" by ",x.View("lookup:getUsername",function(){return E.mustache(t.lookup("getUsername"),t.lookup("modifiedBy"))})]})),"\n ",B.P("Number of Priors Referenced: ",x.View("lookup:numberOfPriorsReferenced",function(){return E.mustache(t.lookup("numberOfPriorsReferenced"))})),"\n "),"\n "),"\n ",B.DIV({class:"row"},"\n ",B.H3("Protocol Applicability"),"\n ",B.HR(),"\n ",x._TemplateWith(function(){return{level:E.call("protocol"),rules:E.call(t.lookup("protocolMatchingRules")),attributes:E.call(t.lookup("studyAttributes"))}},function(){return E.include(t.lookupTemplate("ruleTable"))}),"\n "),"\n ",B.DIV({class:"row"},"\n ",B.H3("Stages"),"\n ",B.HR(),"\n ",x._TemplateWith(function(){return{stages:E.call(t.lookup("stages"))}},function(){return E.include(t.lookupTemplate("stageSortable"))}),"\n "),"\n "),"\n "]}),"\n "),"\n\n ",B.DIV({id:"activeViewportEditor",class:"tab-pane"},"\n ",x.If(function(){return E.call(t.lookup("activeViewportUndefined"))},function(){return["\n ",B.DIV({class:"noActiveViewport"},"\n ",B.H2("Select a Viewport"),"\n ",B.HR(),"\n ",B.P("\n Upon selecting a Viewport, this section will show a list of rules that can be used\n to determine which images will populate the specified Viewport. You can specify these\n rules to be evaluated at the study, series, or image level.\n "),"\n "),"\n "]}),"\n ",E.With(function(){return E.call(t.lookup("activeStage"))},function(){return["\n ",E.include(t.lookupTemplate("stageDetails")),"\n "]}),"\n "),"\n "),"\n\n ",E.With(function(){return E.call(t.lookup("activeProtocol"))},function(){return["\n ",B.DIV({id:"protocolOptions",class:"protocolEditorSection"},"\n ",x.If(function(){return E.call(t.lookup("locked"))},function(){return["\n ",B.BUTTON({id:"saveProtocol",type:"button",class:"btn btn-sm",disabled:""},"\n Locked ",B.I({class:"fa fa-lock","aria-hidden":"true"}),"\n "),"\n "]},function(){return["\n ",B.BUTTON({id:"saveProtocol",type:"button",class:"btn btn-sm"},"\n Save Changes ",B.I({class:"fa fa-floppy-o","aria-hidden":"true"}),"\n "),"\n "]}),"\n\n ",x.If(function(){return E.call(t.lookup("modifiedDate"))},function(){return["\n ",B.P({class:"lastSavedText"},"Last saved ",x.View("lookup:jsDateFromNow",function(){return E.mustache(t.lookup("jsDateFromNow"),t.lookup("modifiedDate"))})),"\n "]}),"\n "),"\n ",B.A({id:"downloadElement",style:"display:none;"}),"\n "]}),"\n ")})},"protocolEditor.js":["meteor/meteor","meteor/templating","meteor/session","meteor/random","meteor/jquery","meteor/ohif:core","meteor/ohif:viewerbase",function(t,e,n){function o(){if(U){var t=L.ProtocolStore.getProtocol().map(function(t){return{id:t.id,text:t.name}}),e=u("#protocolSelect");e.select2().empty(),e.select2({data:t}),e.select2().val(U.protocol.id).trigger("change")}}var r;n.import("meteor/meteor",{Meteor:function(t){r=t}});var i;n.import("meteor/templating",{Template:function(t){i=t}});var a;n.import("meteor/session",{Session:function(t){a=t}});var s;n.import("meteor/random",{Random:function(t){s=t}});var u;n.import("meteor/jquery",{$:function(t){u=t}});var l;n.import("meteor/ohif:core",{OHIF:function(t){l=t}}),n.import("meteor/ohif:viewerbase"),i.protocolEditor.onRendered(function(){var t=i.instance();t.timeAgoInterval=r.setInterval(function(){a.set("timeAgoVariable",new Date)},6e4),L.ProtocolStore.onReady(function(){o()})}),i.protocolEditor.onDestroyed(function(){var t=i.instance();r.clearInterval(t.timeAgoInterval)}),i.protocolEditor.helpers({activeProtocol:function(){function t(){if(a.get("LayoutManagerUpdated"),U&&U.protocol&&U.LayoutManager&&void 0!==U.stage)return o(),U.protocol.updateNumberOfPriorsReferenced(),U.protocol}return t}(),activeStage:function(){function t(){if(a.get("LayoutManagerUpdated"),U&&U.protocol&&U.LayoutManager&&void 0!==U.stage){var t=U.getCurrentStageModel();if(t){t.viewportStructure.layoutTemplateName=U.LayoutManager.layoutTemplateName,t.viewportStructure.properties=U.LayoutManager.layoutProps;var e=t.viewportStructure.getNumViewports()-t.viewports.length;if(e<0){var n=Math.abs(e),o=t.viewports.length-n;t.viewports.splice(o,n)}else if(e>0)for(var r=0;r<e;r++){var i=new L.Viewport;t.viewports.push(i)}return U.getCurrentStageModel()}}}return t}(),activeViewportUndefined:function(){function t(){var t=a.get("activeViewport");return void 0===t}return t}()}),i.protocolEditor.events({"click #newProtocol":function(){function t(){var t=L.defaultProtocol.createClone();t.name="New (created "+c().format("h:mm:ss a")+")",t.id=s.id(),L.ProtocolStore.addProtocol(t),U.setHangingProtocol(t),o()}return t}(),"click #renameProtocol":function(){function t(){var t=this;if(!t.locked){var e="Rename Protocol",n="Enter a new name",r=t.name;F(e,n,r,function(e){t.name=e,L.ProtocolStore.updateProtocol(t.id,t),o()})}}return t}(),"click #importProtocol":function(){function t(){u("#protocolDropdown").dropdown("toggle")}return t}(),"change .btn-file :file":function(){function t(t){var e=u(t.currentTarget),n=e.get(0).files?e.get(0).files.length:1,o=e.val().replace(/\\/g,"/").replace(/.*\//,"");e.trigger("fileselect",[n,o])}return t}(),"fileselect .btn-file :file":function(){function t(t){var e=t.target.files,n=new FileReader;n.onload=function(){var t=JSON.parse(n.result);L.ProtocolStore.addProtocol(t),o()},n.readAsText(e[0],"utf-8")}return t}(),"select2:select #protocolSelect":function(){function t(t){var e=t.params.data.id,n=L.ProtocolStore.getProtocol(e);n&&U.setHangingProtocol(n)}return t}(),"click .navigationButtons a":function(){function t(){u(this).addClass("active").siblings().removeClass("active")}return t}(),"click #saveProtocol":function(){function t(){var t=this;t.locked||(t.protocolWasModified(),L.ProtocolStore.updateProtocol(t.id,t))}return t}(),"click #saveAsProtocol":function(){function t(){var t=this,e=t.createClone(),n="Save Protocol As",r="Enter a new name",i=e.name;F(n,r,i,function(t){e.id=s.id(),e.name=t,e.locked=!1,e.protocolWasModified(),L.ProtocolStore.addProtocol(e),U.setHangingProtocol(e),o()})}return t}(),"click #exportJSON":function(){function t(){var t=this,e=JSON.stringify(t,null,2),n=new Date,o=t.name+"-"+n.getTime().toString()+".json",r=new Blob([e],{type:"application/json"}),i=document.getElementById("downloadElement");i.href=URL.createObjectURL(r),i.download=o,i.click()}return t}(),"click #deleteProtocol":function(){function t(){var t=this;if(!t.locked){var e={title:"Delete Protocol",text:"Are you sure you would like to remove this Protocol? This cannot be reversed."};l.viewerbase.dialogUtils.showConfirmDialog(function(){L.ProtocolStore.removeProtocol(t.id),U.reset(),o()},e)}}return t}()})}]},ruleTable:{"template.ruleTable.js":function(){a.__checkName("ruleTable"),a.ruleTable=new a("Template.ruleTable",function(){var t=this;return[B.TABLE({class:"ruleTable table"},"\n ",B.THEAD("\n ",B.TR("\n ",B.TH("Constraint"),"\n ",B.TH("Wt."),"\n ",B.TH("Req."),"\n "),"\n "),"\n ",B.TBODY("\n ",x.Each(function(){return E.call(t.lookup("rules"))},function(){return["\n ",x.If(function(){return E.call(t.lookup("constraint"))},function(){return["\n ",B.TR("\n ",B.TD("\n ",B.I({class:"fa fa-pencil editRule"}),"\n ",B.I({class:"fa fa-trash deleteRule"}),"\n ",x.View("lookup:displayConstraint",function(){return E.mustache(t.lookup("displayConstraint"),t.lookup("attribute"),t.lookup("constraint"),E.dot(t.lookup(".."),"attributes"))}),"\n ",x.Unless(function(){return E.call(t.lookup("rulePassed"))},function(){return B.SMALL({class:"failWarning"},"Fail")}),"\n "),"\n ",B.TD(B.INPUT({class:"ruleWeight",type:"number",value:function(){return E.mustache(t.lookup("weight"))},min:"1",step:"1",max:"1000"})),"\n ",B.TD(B.INPUT(B.Attrs({class:"ruleRequired",type:"checkbox"},function(){return E.attrMustache(t.lookup("valueIf"),t.lookup("required"),"checked","")}))),"\n "),"\n "]}),"\n "]}),"\n "),"\n "),B.Raw('\n <div class="addRuleContainer">\n <span class="addRule">\n Add New Constraint <i class="fa fa-plus-circle"></i>\n </span>\n </div>')]})},"ruleTable.js":function(){a.ruleTable.helpers({rulePassed:function(){function t(){var t=M.get("activeViewport"),e=U.matchDetails[t];if(e&&e.bestMatch){var n=e.bestMatch.matchDetails.failed,o=this,r=!0;return n.forEach(function(t){var e=t.rule;if(e.id===o.id)return r=!1,!1}),r}}return t}()}),a.ruleTable.events({"click .addRule":function(){function t(){var t=a.currentData(),e=t.attributes,n=t.level;_(e,n)}return t}(),"click .editRule":function(){function t(){var t=a.currentData(),e=t.attributes,n=t.level,o=this;_(e,n,o)}return t}(),"click .deleteRule":function(){function t(){var t=this;if(t instanceof L.ProtocolMatchingRule)U.protocol.removeProtocolMatchingRule(t);else{var e=W();e.removeRule(t)}var n=M.get("activeViewport");U.updateViewports(n)}return t}(),"change .ruleWeight":function(){function t(t){var e=this;e.weight=o(t.currentTarget).val();var n=M.get("activeViewport");U.updateViewports(n)}return t}(),"change .ruleRequired":function(){function t(t){var e=this;e.required=o(t.currentTarget).prop("checked");var n=M.get("activeViewport");U.updateViewports(n)}return t}()})}},ruleEntryDialog:{"template.ruleEntryDialog.js":function(){a.__checkName("ruleEntryDialog"),a.ruleEntryDialog=new a("Template.ruleEntryDialog",function(){var t=this;
return B.DIV({class:"ruleEntryDialog dialog-animated"},B.Raw('\n <div class="dialogHeader">\n <h5>Rule Editor</h5>\n </div>\n '),B.DIV({class:"dialogContent"},"\n ",B.Raw('<div class="row">\n <div class="col-xs-12">\n <select class="attributes" style="width: 95%;">\n </select>\n </div>\n </div>'),"\n ",B.DIV({class:"row"},"\n ",B.DIV({class:"col-xs-12"},"\n ",B.SELECT({class:"comparators",style:"width: 95%;"},"\n ",x.Each(function(){return E.call(t.lookup("comparators"))},function(){return["\n ",B.OPTION({value:function(){return E.mustache(t.lookup("id"))}},x.View("lookup:name",function(){return E.mustache(t.lookup("name"))})),"\n "]}),"\n "),"\n "),"\n "),"\n ",B.DIV({class:"row"},"\n ",B.DIV({class:"col-xs-12"},"\n ",x.If(function(){return E.dataMustache(t.lookup("ifTypeIs"),t.lookup("currentValue"),"string")},function(){return["\n ",B.INPUT({class:"currentValue",type:"text",value:function(){return E.mustache(t.lookup("currentValue"))}}),"\n "]}),"\n\n ",x.If(function(){return E.dataMustache(t.lookup("ifTypeIs"),t.lookup("currentValue"),"undefined")},function(){return["\n ",B.INPUT({class:"currentValue",type:"text",value:function(){return E.mustache(t.lookup("currentValue"))}}),"\n "]}),"\n\n ",x.If(function(){return E.dataMustache(t.lookup("ifTypeIs"),t.lookup("currentValue"),"number")},function(){return["\n ",B.INPUT({class:"currentValue",type:"number",value:function(){return E.mustache(t.lookup("currentValue"))}}),"\n "]}),"\n\n ",x.If(function(){return E.dataMustache(t.lookup("ifTypeIs"),t.lookup("currentValue"),"boolean")},function(){return["\n ",B.INPUT(B.Attrs({class:"currentValue",type:"checkbox"},function(){return E.attrMustache(t.lookup("valueIf"),t.lookup("currentValue"),"selected","")})),"\n "]}),"\n "),"\n "),"\n "),B.Raw('\n <div class="dialogFooter">\n <button id="cancel" class="btn btn-link" tabindex="1">Cancel</button>\n <button id="save" class="btn btn-primary" tabindex="0">OK</button>\n </div>\n '))})},"ruleEntryDialog.js":["meteor/jquery","meteor/session","meteor/reactive-var","meteor/templating","meteor/blaze","meteor/ohif:core","meteor/ohif:viewerbase",function(t,e,n){function o(t){a(t).css("display","none"),a(".removableBackdrop").remove(),g.setFocusToActiveViewport()}function r(){var t=g.viewportUtils.getEnabledElementForActiveElement();if(t)return t.image.imageId}function i(t){var e=d.viewer.Studies.findBy(null,{sort:[["studyDate","desc"]]});if(e){var n=cornerstoneTools.metaData.get("study",t);if(n){var o=d.studylist.collections.Studies.find({patientId:e.patientId,studyDate:{$lt:e.studyDate}},{sort:{studyDate:-1}}),r=0;return o.forEach(function(t,e){if(t.studyInstanceUid===n.studyInstanceUid)return r=e+1,!1}),r}}}var a;n.import("meteor/jquery",{$:function(t){a=t}});var s;n.import("meteor/session",{Session:function(t){s=t}});var u;n.import("meteor/reactive-var",{ReactiveVar:function(t){u=t}});var c;n.import("meteor/templating",{Template:function(t){c=t}});var l;n.import("meteor/blaze",{Blaze:function(t){l=t}});var d;n.import("meteor/ohif:core",{OHIF:function(t){d=t}});var g;n.import("meteor/ohif:viewerbase",{Viewerbase:function(t){g=t}});var p={ESC:27};_=function t(e,n,r){var i=a(".ruleEntryDialog"),s=i.find("input.currentValue");s.val(""),c.ruleEntryDialog.dialog=i,c.ruleEntryDialog.level=n,c.ruleEntryDialog.rule=r;var u=i.find(".attributes");u.html("").select2({data:e,placeholder:"Select an attribute",allowClear:!0}),r&&r.attribute&&u.val(r.attribute);var d=void 0;if(r&&r.constraint){var g=Object.keys(r.constraint)[0],p=Object.keys(r.constraint[g])[0],f=z.findOne({validator:g,validatorOption:p}),m=r.constraint[g][p];s.val(m),d=m,f&&i.find(".comparators").val(f.id).trigger("change")}u.trigger("change",d),i.css("display","block"),l.render(c.removableBackdrop,document.body),a(".removableBackdrop").one("mousedown touchstart",function(){o(i)})};var f=function t(e){var n=r();if(n){if("abstractPriorValue"===e)return i(n);var o=void 0;if(d.viewer.StudyMetadataList.find(function(t){return o=t.findInstance(function(t){return t.getImageId()===n}),!!o}),o){var a=o.getTagValue(e);return void 0===a?L.attributeDefaults[e]:a}}};c.ruleEntryDialog.onCreated(function(){var t=this;t.currentValue=new u(""),t.attribute=new u,t.comparatorId=new u}),c.ruleEntryDialog.onRendered(function(){var t=c.instance();t.$(".comparators").select2();var e=t.$(".comparators").val();t.comparatorId.set(e);var n=t.$(".ruleEntryDialog");n.draggable()}),c.ruleEntryDialog.helpers({comparators:function(){function t(){return z.find()}return t}(),currentValue:function(){function t(){return c.instance().currentValue.get()}return t}()}),c.ruleEntryDialog.events({"click #save":function(){function t(t,e){var n=c.ruleEntryDialog.dialog,r=c.ruleEntryDialog.level,i=e.attribute.get(),a=e.comparatorId.get(),u=e.currentValue.get();if(void 0!==u){var l;if(c.ruleEntryDialog.rule)l=c.ruleEntryDialog.rule;else{var d=W();switch(r){case"protocol":l=new L.ProtocolMatchingRule,U.protocol.addProtocolMatchingRule(l);break;case"study":l=new L.StudyMatchingRule,d.studyMatchingRules.push(l);break;case"series":l=new L.SeriesMatchingRule,d.seriesMatchingRules.push(l);break;case"instance":l=new L.ImageMatchingRule,d.imageMatchingRules.push(l)}}var g=z.findOne({id:a}),p={};p[g.validator]={},p[g.validator][g.validatorOption]=u,l.attribute=i,l.constraint=p;var f=s.get("activeViewport");U.updateViewports(f),o(n)}}return t}(),"click #cancel":function(){function t(){var t=c.ruleEntryDialog.dialog;o(t)}return t}(),"keydown .ruleEntryDialog":function(){function t(t){var e=c.ruleEntryDialog.dialog;if(t.which===p.ESC)return o(e),!1}return t}(),"change select.attributes":function(){function t(t,e,n){var o=a(t.currentTarget).val();e.attribute.set(o),c.ruleEntryDialog.selectedAttribute=o;var r=void 0;r=n?n:f(o),e.currentValue.set(r)}return t}(),"change input.currentValue":function(){function t(t,e){var n=a(t.currentTarget),o=n.val();"number"===n.attr("type")&&(o=parseFloat(o)),e.currentValue.set(o)}return t}(),"change select.comparators":function(){function t(t,e){var n=a(t.currentTarget).val();e.comparatorId.set(n)}return t}()})}]},settingEntryDialog:{"template.settingEntryDialog.js":function(){a.__checkName("settingEntryDialog"),a.settingEntryDialog=new a("Template.settingEntryDialog",function(){var t=this;return B.Raw('<div class="settingEntryDialog dialog-animated">\n <div class="dialogHeader">\n <h5>Viewport Setting Editor</h5>\n </div>\n <div class="dialogContent">\n <div class="row">\n <div class="col-xs-12">\n <select class="settings" style="width: 95%;">\n </select>\n </div>\n </div>\n <div class="row">\n <div class="col-xs-12">\n <select class="currentValue" style="width: 95%;">\n </select>\n </div>\n </div>\n </div>\n <div class="dialogFooter">\n <button id="cancel" class="btn btn-link" tabindex="1">Cancel</button>\n <button id="save" class="btn btn-primary" tabindex="0">OK</button>\n </div>\n </div>')})},"settingEntryDialog.js":["meteor/templating","meteor/session","meteor/reactive-var","meteor/blaze","meteor/jquery","meteor/ohif:viewerbase",function(t,e,n){function o(t){u(t).css("display","none"),u(".removableBackdrop").remove(),c.setFocusToActiveViewport()}var r;n.import("meteor/templating",{Template:function(t){r=t}});var i;n.import("meteor/session",{Session:function(t){i=t}});var a;n.import("meteor/reactive-var",{ReactiveVar:function(t){a=t}});var s;n.import("meteor/blaze",{Blaze:function(t){s=t}});var u;n.import("meteor/jquery",{$:function(t){u=t}});var c;n.import("meteor/ohif:viewerbase",{Viewerbase:function(t){c=t}});var l={ESC:27};H=function t(e){var n=u(".settingEntryDialog");r.settingEntryDialog.dialog=n,r.settingEntryDialog.settingObject=e;var i=Object.keys(L.displaySettings);i.concat(Object.keys(L.CustomViewportSettings));var a=Object.keys(L.displaySettings).map(function(t){return{id:t,text:L.displaySettings[t].text}}),c=Object.keys(L.CustomViewportSettings).map(function(t){return{id:t,text:L.CustomViewportSettings[t].text}}),l=a.concat(c),d=n.find(".settings");d.html("").select2({data:l,placeholder:"Select a setting",allowClear:!0});var g={options:[]};e&&L.displaySettings[e.id]?g=L.displaySettings[e.id]:e&&L.CustomViewportSettings[e.id]&&(g=L.CustomViewportSettings[e.id]);var p=n.find(".currentValue");p.html("").select2({data:g.options,placeholder:"Select a value",allowClear:!0}),e&&e.id&&d.val(e.id),d.trigger("change"),e&&void 0!==e.value&&p.val(e.value).trigger("change"),n.css("display","block"),s.render(r.removableBackdrop,document.body),u(".removableBackdrop").one("mousedown touchstart",function(){o(n)})},r.settingEntryDialog.onCreated(function(){var t=this;t.currentValue=new a(""),t.setting=new a}),r.settingEntryDialog.onRendered(function(){var t=this,e=t.$(".settingEntryDialog");e.draggable()}),r.settingEntryDialog.events({"click #save":function(){function t(t,e){var n=r.settingEntryDialog.dialog,a=e.setting.get(),s=e.currentValue.get();if(void 0!==s){var u={id:a,value:s},c=W(),l=r.settingEntryDialog.settingObject;l&&l.id&&delete c.viewportSettings[l.id],c.viewportSettings[u.id]=u.value;var d=i.get("activeViewport");U.updateViewports(d),o(n)}}return t}(),"click #cancel":function(){function t(){var t=r.settingEntryDialog.dialog;o(t)}return t}(),"keydown .settingEntryDialog":function(){function t(t){var e=r.settingEntryDialog.dialog;if(t.which===l.ESC)return o(e),!1}return t}(),"change select.settings":function(){function t(t,e){var n=u(t.currentTarget).val();e.setting.set(n);var o={options:[]};n&&L.displaySettings[n]?o=L.displaySettings[n]:n&&L.CustomViewportSettings[n]&&(o=L.CustomViewportSettings[n]);var i=r.settingEntryDialog.dialog,a=i.find(".currentValue");a.html("").select2({data:o.options,placeholder:"Select a value",allowClear:!0}),o&&o.defaultValue&&(e.currentValue.set(o.defaultValue),a.val(o.defaultValue).trigger("change"))}return t}(),"change select.currentValue":function(){function t(t,e){var n=u(t.currentTarget).val();e.currentValue.set(n)}return t}()})}]},textEntryDialog:{"template.textEntryDialog.js":function(){a.__checkName("textEntryDialog"),a.textEntryDialog=new a("Template.textEntryDialog",function(){var t=this;return B.DIV({class:"textEntryDialog dialog-animated"},"\n ",B.DIV({class:"dialogHeader"},"\n ",B.H4({class:"title"},x.View("lookup:title",function(){return E.mustache(t.lookup("title"))})),"\n "),"\n ",B.DIV({class:"dialogContent"},"\n ",B.DIV({class:"row"},"\n ",B.DIV({class:"col-xs-12"},"\n ",B.H5({class:"instructions"},x.View("lookup:instructions",function(){return E.mustache(t.lookup("instructions"))})),"\n "),"\n "),"\n ",B.DIV({class:"row"},"\n ",B.DIV({class:"col-xs-12"},"\n ",B.INPUT({class:"currentValue",type:"text",value:function(){return E.mustache(t.lookup("currentValue"))}}),"\n "),"\n "),"\n "),B.Raw('\n <div class="dialogFooter">\n <button class="cancel btn btn-link" tabindex="1">Cancel</button>\n <button class="save btn btn-primary" tabindex="0">OK</button>\n </div>\n '))})},"textEntryDialog.js":["meteor/blaze","meteor/jquery","meteor/templating","meteor/ohif:viewerbase",function(t,e,n){function o(t){i(t).css("display","none"),i(".removableBackdrop").remove(),s.setFocusToActiveViewport()}var r;n.import("meteor/blaze",{Blaze:function(t){r=t}});var i;n.import("meteor/jquery",{$:function(t){i=t}});var a;n.import("meteor/templating",{Template:function(t){a=t}});var s;n.import("meteor/ohif:viewerbase",{Viewerbase:function(t){s=t}});var u={ESC:27,ENTER:13};F=function t(e,n,r,s){var u=i(".textEntryDialog"),c=u.find("input.currentValue");c.val(r),a.textEntryDialog.dialog=u,a.textEntryDialog.title=e,a.textEntryDialog.instructions=n,a.textEntryDialog.doneCallback=s,u.find(".title").html(e),u.find(".instructions").html(n),u.css("display","block"),I.render(a.removableBackdrop,document.body),i(".removableBackdrop").one("mousedown touchstart",function(){o(u)})},a.textEntryDialog.onRendered(function(){var t=a.instance(),e=t.$(".settingEntryDialog");e.draggable()}),a.textEntryDialog.events({"click .save":function(){function t(){var t=a.textEntryDialog.dialog,e=t.find("input.currentValue").val();if(void 0!==e){var n=a.textEntryDialog.doneCallback;n&&n(e),o(a.textEntryDialog.dialog)}}return t}(),"click .cancel":function(){function t(){o(a.textEntryDialog.dialog)}return t}(),"keydown .textEntryDialog":function(){function t(t){var e=a.textEntryDialog.dialog;if(t.which===u.ESC)return o(e),!1;if(t.which===u.ENTER){var n=e.find("input.currentValue").val();if(void 0===n)return;var r=a.textEntryDialog.doneCallback;return r&&r(n),o(e),!1}}return t}(),"change input.currentValue":function(){function t(t,e){var n=i(t.currentTarget);a.textEntryDialog.currentValue=n.val()}return t}()})}]},settingsTable:{"template.settingsTable.js":function(){a.__checkName("settingsTable"),a.settingsTable=new a("Template.settingsTable",function(){var t=this;return[B.TABLE({class:"settingsTable table"},"\n ",B.THEAD("\n ",B.TR("\n ",B.TH("Setting"),"\n ",B.TH("Value"),"\n "),"\n "),"\n ",B.TBODY("\n ",x.Each(function(){return E.dataMustache(t.lookup("objectToPairs"),t.lookup("settings"))},function(){return["\n ",x.If(function(){return E.call(t.lookup("value"))},function(){return["\n ",B.TR("\n ",B.TD("\n ",B.I({class:"fa fa-pencil editSetting"}),"\n ",B.I({class:"fa fa-trash deleteSetting"}),"\n ",x.View("lookup:getSettingText",function(){return E.mustache(t.lookup("getSettingText"))}),"\n "),"\n ",B.TD("\n ",x.View("lookup:prettyPrintStringify",function(){return E.mustache(t.lookup("prettyPrintStringify"),t.lookup("value"))}),"\n "),"\n "),"\n "]}),"\n "]}),"\n "),"\n "),B.Raw('\n <div class="addSettingContainer">\n <span class="addSetting">\n Add Display Setting <i class="fa fa-plus-circle"></i>\n </span>\n </div>')]})},"settingsTable.js":function(){a.settingsTable.events({"click .addSetting":function(){function t(){H()}return t}(),"click .editSetting":function(){function t(){var t=this;H(t)}return t}(),"click .deleteSetting":function(){function t(){var t=this,e=W();delete e.viewportSettings[t.key];var n=M.get("activeViewport");U.updateViewports(n)}return t}()}),a.settingsTable.helpers({getSettingText:function(){function t(){var t=this;return L.CustomViewportSettings[t.key]?L.CustomViewportSettings[t.key].text:L.displaySettings[t.key]?L.displaySettings[t.key].text:x._globalHelpers.prettyPrintStringify(t.key)}return t}()})}},stageDetails:{"template.stageDetails.js":function(){a.__checkName("stageDetails"),a.stageDetails=new a("Template.stageDetails",function(){var t=this;return B.DIV({id:"stageDetails",class:"protocolEditorSection"},"\n ",B.DIV({class:"row"},"\n ",B.DIV({class:"col-xs-12"},"\n ",E.With(function(){return E.call(t.lookup("activeViewport"))},function(){return["\n ",B.DIV({class:"stageEditorSection"},"\n ",B.H3("Viewport Settings"),"\n ",B.HR(),"\n ",x._TemplateWith(function(){return{settings:E.call(t.lookup("viewportSettings"))}},function(){return E.include(t.lookupTemplate("settingsTable"))}),"\n "),"\n\n ",B.DIV({class:"stageEditorSection"},"\n ",B.H3("Study Matching Rules"),"\n ",B.HR(),"\n ",x._TemplateWith(function(){return{level:E.call("study"),rules:E.call(t.lookup("studyMatchingRules")),attributes:E.call(t.lookup("studyAttributes"))}},function(){return E.include(t.lookupTemplate("ruleTable"))}),"\n "),"\n\n ",B.DIV({class:"stageEditorSection"},"\n ",B.H3("Series Matching Rules"),"\n ",B.HR(),"\n ",x._TemplateWith(function(){return{level:E.call("series"),rules:E.call(t.lookup("seriesMatchingRules")),attributes:E.call(t.lookup("seriesAttributes"))}},function(){return E.include(t.lookupTemplate("ruleTable"))}),"\n "),"\n\n ",B.DIV({class:"stageEditorSection"},"\n ",B.H3("Image Matching Rules"),"\n ",B.HR(),"\n ",x._TemplateWith(function(){return{level:E.call("instance"),rules:E.call(t.lookup("imageMatchingRules")),attributes:E.call(t.lookup("instanceAttributes"))}},function(){return E.include(t.lookupTemplate("ruleTable"))}),"\n "),"\n "]}),"\n "),"\n "),"\n ")})},"stageDetails.js":function(){W=function t(){if(U&&U.protocol&&void 0!==U.stage){var e=U.getCurrentStageModel(),n=M.get("activeViewport");if(!(n>=e.viewports.length))return e.viewports[n]}},a.stageDetails.helpers({activeViewport:function(){function t(){return M.get("LayoutManagerUpdated"),W()}return t}()})}},stageSortable:{"template.stageSortable.js":function(){a.__checkName("stageSortable"),a.stageSortable=new a("Template.stageSortable",function(){var t=this;return B.DIV({id:"stageSortingContainer"},"\n ",B.DIV({class:"moveStageButtons"},"\n ",B.A({class:"moveStageUp noselect",disabled:function(){return x.Unless(function(){return E.call(t.lookup("isPreviousAvailable"))},function(){return"true"})}},"\n Move Stage Up ",B.Raw('<i class="fa fa-chevron-up"></i>'),"\n "),"\n ",B.A({class:"moveStageDown noselect",disabled:function(){return x.Unless(function(){return E.call(t.lookup("isNextAvailable"))},function(){return"true"})}},"\n Move Stage Down ",B.Raw('<i class="fa fa-chevron-down"></i>'),"\n "),"\n "),"\n ",B.DIV({id:"stageSortable",class:"sortable"},"\n ",x.Each(function(){return E.call(t.lookup("stages"))},function(){return["\n ",B.DIV({class:"sortable-item","data-id":function(){return E.mustache(t.lookup("id"))}},"\n ",B.SPAN("\n ",B.DIV({class:"sortable-handle pull-left"}),"\n ",B.I({class:"deleteStage fa fa-trash fa-lg pull-right"}),"\n ",B.SPAN({class:function(){return x.If(function(){return E.call(t.lookup("isActiveStage"))},function(){return"active"})}},"\n ",x.View("lookup:stageLabel",function(){return E.mustache(t.lookup("stageLabel"))}),"\n "),"\n "),"\n "),"\n "]}),"\n "),B.Raw('\n <div class="addStage">\n <span id="addStage">\n Create New Stage <i class="fa fa-plus-circle"></i>\n </span>\n </div>\n '))})},"stageSortable.js":["meteor/templating","meteor/session","meteor/random","meteor/ohif:core","meteor/ohif:viewerbase",function(t,e,n){function o(t,e){var n;if(t&&t.stages)return t.stages.forEach(function(t,o){if(t.id===e)return n=o,!1}),n}var r;n.import("meteor/templating",{Template:function(t){r=t}});var i;n.import("meteor/session",{Session:function(t){i=t}});var a;n.import("meteor/random",{Random:function(t){a=t}});var s;n.import("meteor/ohif:core",{OHIF:function(t){s=t}}),n.import("meteor/ohif:viewerbase"),Array.prototype.move=function(t,e){var n=this[t];return e=Math.max(0,e),e=Math.min(this.length,e),this.splice(t,1),this.splice(e,0,n),this},r.stageSortable.helpers({isActiveStage:function(){function t(){if(i.get("LayoutManagerUpdated"),U){var t=U.getCurrentStageModel();return!!t&&this.id===t.id}}return t}(),stageLabel:function(){function t(){var t=this;if(U){var e=L.ProtocolStore.getProtocol(U.protocol.id),n=o(e,t.id);if(void 0===n){i.get("timeAgoVariable");var r=U.newStageIds.indexOf(t.id)+1,a=c(t.createdDate).fromNow();return"New Stage "+r+" (created "+a+")"}return"Stage "+ ++n}}return t}(),isNextAvailable:function(){function t(){if(i.get("LayoutManagerUpdated"),U)return U.stage<U.getNumProtocolStages()-1}return t}(),isPreviousAvailable:function(){function t(){if(i.get("LayoutManagerUpdated"),U)return U.stage>0}return t}()}),r.stageSortable.events({"click .sortable-item span":function(){function t(){var t=o(U.protocol,this.id);U.setCurrentProtocolStage(t-U.stage)}return t}(),"click #addStage":function(){function t(){var t=U.getCurrentStageModel(),e=t.createClone();delete e.name,U.protocol.stages.push(e),U.newStageIds.push(e.id),U.setCurrentProtocolStage(1)}return t}(),"click .deleteStage":function(){function t(){if(1!==U.protocol.stages.length){var t=this.id,e={title:"Remove Protocol Stage",text:"Are you sure you would like to remove this Protocol Stage? This cannot be reversed."};s.viewerbase.dialogUtils.showConfirmDialog(function(){var e=o(U.protocol,t);U.protocol.stages.splice(e,1),U.stage===e&&U.setCurrentProtocolStage(-1),i.set("LayoutManagerUpdated",a.id())},e)}}return t}(),"click .moveStageUp":function(){function t(){var t=U.stage,e=Math.max(U.stage-1,0);t!==e&&(U.protocol.stages=U.protocol.stages.move(t,e),U.stage=e,i.set("LayoutManagerUpdated",a.id()))}return t}(),"click .moveStageDown":function(){function t(){var t=U.stage,e=Math.min(U.stage+1,U.protocol.stages.length-1);t!==e&&(U.protocol.stages=U.protocol.stages.move(t,e),U.stage=e,i.set("LayoutManagerUpdated",a.id()))}return t}()})}]}},customAttributes:{"index.js":function(){L.CustomAttributeRetrievalCallbacks={},L.addCustomAttribute=function(t,e,n){L.CustomAttributeRetrievalCallbacks[t]={name:e,callback:n}}}},customViewportSettings:{"index.js":function(){L.CustomViewportSettings={},L.addCustomViewportSetting=function(t,e,n,o){L.CustomViewportSettings[t]={id:t,text:e,options:n,callback:o}}}},lib:{"sortByScore.js":function(t,e,n){n.export({sortByScore:function(){return o}});var o=function t(e){e.sort(function(t,e){return e.score-t.score})}}},matcher:{"HPMatcher.js":["meteor/ohif:viewerbase","../customAttributes",function(t,e,n){n.export({HPMatcher:function(){return c}});var o;n.import("meteor/ohif:viewerbase",{Viewerbase:function(t){o=t}}),n.import("../customAttributes");var r=o.OHIFError,i=o.metadata,a=i.StudySummary,s=i.InstanceMetadata,u=function t(e,n){if(!(e instanceof a||e instanceof s))throw new r("HPMatcher::match metadataInstance must be an instance of StudySummary or InstanceMetadata");var o={format:"grouped"},i={passed:[],failed:[]},u=!1,c=0;return n.forEach(function(t){var n,r,a=t.attribute,s=e.customAttributeExists(a);if(!s&&L.CustomAttributeRetrievalCallbacks.hasOwnProperty(a)){var d=L.CustomAttributeRetrievalCallbacks[a];e.setCustomAttribute(a,d.callback(e)),s=!0}var g=(n={},n[a]=t.constraint,n),p=s?e.getCustomAttribute(a):e.getTagValue(a),f=(r={},r[a]=p,r),m=void 0;try{m=l(f,g,[o])}catch(t){m=["Something went wrong during validation.",t]}m?(t.required&&(u=!0),i.failed.push({rule:t,errorMessages:m})):(c+=parseInt(t.weight,10),i.passed.push({rule:t}))}),u&&(c=0),{score:c,details:i}},c={match:u}}]}}}}}},{extensions:[".js",".json",".html",".styl"]});G("./node_modules/meteor/ohif:hanging-protocols/both/namespace.js"),G("./node_modules/meteor/ohif:hanging-protocols/both/collections.js"),G("./node_modules/meteor/ohif:hanging-protocols/both/schema.js"),G("./node_modules/meteor/ohif:hanging-protocols/both/hardcodedData.js"),G("./node_modules/meteor/ohif:hanging-protocols/both/testData.js"),G("./node_modules/meteor/ohif:hanging-protocols/client/collections.js"),G("./node_modules/meteor/ohif:hanging-protocols/client/protocolEngine.js"),G("./node_modules/meteor/ohif:hanging-protocols/client/helpers/displayConstraint.js"),G("./node_modules/meteor/ohif:hanging-protocols/client/helpers/attributes.js"),G("./node_modules/meteor/ohif:hanging-protocols/client/protocolStore/protocolStore.js"),G("./node_modules/meteor/ohif:hanging-protocols/client/protocolStore/defaultStrategy.js"),G("./node_modules/meteor/ohif:hanging-protocols/client/components/previousPresentationGroupButton/template.previousPresentationGroupButton.js"),G("./node_modules/meteor/ohif:hanging-protocols/client/components/previousPresentationGroupButton/previousPresentationGroupButton.js"),G("./node_modules/meteor/ohif:hanging-protocols/client/components/nextPresentationGroupButton/template.nextPresentationGroupButton.js"),G("./node_modules/meteor/ohif:hanging-protocols/client/components/nextPresentationGroupButton/nextPresentationGroupButton.js"),G("./node_modules/meteor/ohif:hanging-protocols/client/components/matchedProtocols/template.matchedProtocols.js"),G("./node_modules/meteor/ohif:hanging-protocols/client/components/matchedProtocols/matchedProtocols.js"),G("./node_modules/meteor/ohif:hanging-protocols/client/components/protocolEditor/template.protocolEditor.js"),G("./node_modules/meteor/ohif:hanging-protocols/client/components/protocolEditor/protocolEditor.js"),G("./node_modules/meteor/ohif:hanging-protocols/client/components/ruleTable/template.ruleTable.js"),G("./node_modules/meteor/ohif:hanging-protocols/client/components/ruleTable/ruleTable.js"),G("./node_modules/meteor/ohif:hanging-protocols/client/components/ruleEntryDialog/template.ruleEntryDialog.js"),G("./node_modules/meteor/ohif:hanging-protocols/client/components/ruleEntryDialog/ruleEntryDialog.js"),G("./node_modules/meteor/ohif:hanging-protocols/client/components/settingEntryDialog/template.settingEntryDialog.js"),G("./node_modules/meteor/ohif:hanging-protocols/client/components/settingEntryDialog/settingEntryDialog.js"),G("./node_modules/meteor/ohif:hanging-protocols/client/components/textEntryDialog/template.textEntryDialog.js"),G("./node_modules/meteor/ohif:hanging-protocols/client/components/textEntryDialog/textEntryDialog.js"),G("./node_modules/meteor/ohif:hanging-protocols/client/components/settingsTable/template.settingsTable.js"),G("./node_modules/meteor/ohif:hanging-protocols/client/components/settingsTable/settingsTable.js"),G("./node_modules/meteor/ohif:hanging-protocols/client/components/stageDetails/template.stageDetails.js"),G("./node_modules/meteor/ohif:hanging-protocols/client/components/stageDetails/stageDetails.js"),G("./node_modules/meteor/ohif:hanging-protocols/client/components/stageSortable/template.stageSortable.js"),G("./node_modules/meteor/ohif:hanging-protocols/client/components/stageSortable/stageSortable.js"),"undefined"==typeof Package&&(Package={}),function(t,e){for(var n in e)n in t||(t[n]=e[n])}(Package["ohif:hanging-protocols"]={},{HP:L})}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,n=Package.meteor.meteorEnv,r=Package["templating-runtime"].Template,a=Package.blaze.Blaze,o=Package.blaze.UI,s=Package.blaze.Handlebars,i=Package.jquery.$,l=Package.jquery.jQuery,d=Package.underscore._,c=Package.tracker.Tracker,p=Package.tracker.Deps,u=Package.modules.meteorInstall,m=Package.modules.Buffer,f=Package.modules.process,h=Package["ecmascript-runtime"].Symbol,y=Package["ecmascript-runtime"].Map,b=Package["ecmascript-runtime"].Set,k=Package["babel-runtime"].meteorBabelHelpers,v=Package.promise.Promise,g=Package.htmljs.HTML,_=Package.spacebars.Spacebars,j,P=u({node_modules:{meteor:{"aldeed:template-extension":{lib:{"hooks.js":function(){j={global:{created:[],rendered:[],destroyed:[]},master:{created:function(){function e(){j.runGlobal("created",this,arguments)}return e}(),rendered:function(){function e(){j.runGlobal("rendered",this,arguments)}return e}(),destroyed:function(){function e(){j.runGlobal("destroyed",this,arguments)}return e}()}},j.addGlobal=function(e){e._hasTemplateExtensionMasterHooks||(e.onCreated(j.master.created),e.onRendered(j.master.rendered),e.onDestroyed(j.master.destroyed),e._hasTemplateExtensionMasterHooks=!0)},j.runGlobal=function(e,t,n){for(var r=j.global[e],a=Array.isArray(r),o=0,r=a?r:r[h.iterator]();;){var s;if(a){if(o>=r.length)break;s=r[o++]}else{if(o=r.next(),o.done)break;s=o.value}var i=s;i.apply(t,n)}}},"template-for-each.js":function(){r.forEach=function(e){var t=!1;for(var n in k.sanitizeForInObject(r))if(r.hasOwnProperty(n)){var o=r[n];if(a.isTemplate(o)){var s=o.viewName;"body"===s?t||(t=!0,e(o)):"Template.__dynamic"!==s&&"Template.__dynamicWithDataContext"!==s&&e(o)}}}},"template-hooks.js":["babel-runtime/helpers/typeof",function(e,t,n){var a;n.import("babel-runtime/helpers/typeof",{default:function(e){a=e}}),r.prototype.hooks=function(e){if(!e||"object"!==("undefined"==typeof e?"undefined":a(e)))throw new Error("hooks argument must be an object with created, rendered, and/or destroyed properties, each set to a function");"function"==typeof e.created&&this.onCreated(e.created),"function"==typeof e.rendered&&this.onRendered(e.rendered),"function"==typeof e.destroyed&&this.onDestroyed(e.destroyed)}}],"template-global-hooks.js":function(){e.startup(function(){r.forEach(function(e){j.addGlobal(e)})}),r.onCreated=function(e){j.global.created.push(e)},r.onRendered=function(e){j.global.rendered.push(e)},r.onDestroyed=function(e){j.global.destroyed.push(e)}},"template-for-each-instance.js":function(){r._renderedInstances=[],r.onRendered(function(){r._renderedInstances.push(this)}),r.onDestroyed(function(){var e=r._renderedInstances.indexOf(this);e>-1&&r._renderedInstances.splice(e,1)}),r.forEachCurrentlyRenderedInstance=function(e){r._renderedInstances.forEach(e)}},"template-inherits-events-from.js":function(){r.prototype.inheritsEventsFrom=function(){function e(e){function t(e){"string"==typeof e&&(e=r[e]),e&&(n.__eventMaps=n.__eventMaps.concat(e.__eventMaps))}var n=this;n.__eventMaps=n.__eventMaps||[],d.isArray(e)?d.each(e,t):t(e)}return e}()},"template-inherits-helpers-from.js":function(){r.prototype.inheritsHelpersFrom=function(){function e(e){function t(e){if("string"==typeof e&&(e=r[e]),e){var t={};d.each(e.__helpers,function(e,n){" "===n.charAt(0)&&(t[n.slice(1)]=e)}),n.helpers(t)}}var n=this;d.isArray(e)?d.each(e,t):t(e)}return e}()},"template-inherits-hooks-from.js":function(){r.prototype.inheritsHooksFrom=function(){function e(e){function t(e){if("string"==typeof e&&(e=r[e]),e){j.addGlobal(e);for(var t=e._callbacks.created,a=Array.isArray(t),o=0,t=a?t:t[h.iterator]();;){var s;if(a){if(o>=t.length)break;s=t[o++]}else{if(o=t.next(),o.done)break;s=o.value}var i=s;i!==j.master.created&&n.onCreated(i)}for(var l=e._callbacks.rendered,d=Array.isArray(l),c=0,l=d?l:l[h.iterator]();;){var p;if(d){if(c>=l.length)break;p=l[c++]}else{if(c=l.next(),c.done)break;p=c.value}var u=p;u!==j.master.rendered&&n.onRendered(u)}for(var m=e._callbacks.destroyed,f=Array.isArray(m),y=0,m=f?m:m[h.iterator]();;){var b;if(f){if(y>=m.length)break;b=m[y++]}else{if(y=m.next(),y.done)break;b=y.value}var k=b;k!==j.master.destroyed&&n.onDestroyed(k)}}}var n=this;d.isArray(e)?d.each(e,t):t(e)}return e}()},"template-register-helpers.js":function(){r.registerHelpers=function(e){if(e)for(var t in k.sanitizeForInObject(e))e.hasOwnProperty(t)&&r.registerHelper(t,e[t])}},"template-replaces.js":function(){r.prototype.replaces=function(){function e(e){function t(e){"string"==typeof e&&(e=r[e]),e&&(e.renderFunction=n.renderFunction)}var n=this;d.isArray(e)?d.each(e,t):t(e)}return e}()},"template-clear-event-maps.js":function(){r.prototype.clearEventMaps=function(){function e(){this.__eventMaps=[]}return e}()},"template-copy-as.js":function(){r.prototype.copyAs=function(){function e(e){function t(e){var t=r[e]=new r("Template."+e,n.renderFunction);return t.inheritsHelpersFrom(n),t.inheritsEventsFrom(n),t.inheritsHooksFrom(n),t}var n=this;if(d.isArray(e)){for(var a=[],o=e,s=Array.isArray(o),i=0,o=s?o:o[h.iterator]();;){var l;if(s){if(i>=o.length)break;l=o[i++]}else{if(i=o.next(),i.done)break;l=i.value}var c=l;a.push(t(c))}return a}return t(e)}return e}()},"template-instance-parent.js":function(){function e(e,t){return t?e.originalParentView||e.parentView:e.parentView}a.TemplateInstance.prototype.parent=function(){function t(t,n){null==t&&(t=1);for(var r=0,a=this;r<t&&a;){for(var o=e(a.view,n);o&&(!o.template||"(contentBlock)"===o.name||"(elseBlock)"===o.name);)o=e(o,n);if(!o)return null;a="function"==typeof o.templateInstance?o.templateInstance():null,r++}return a}return t}()},"template-instance-get.js":function(){a.TemplateInstance.prototype.get=function(){function e(e){for(var t=this;t;){if(e in t)return t[e];t=t.parent(1,!0)}}return e}()},"template-parent-data-function.js":function(){var e=a._parentData;a._parentData=function(t,n){if("function"!=typeof t)return e(t,n);for(var r=a.getView("with"),o=function e(){return t(r.dataVar.get())};r&&!c.nonreactive(o);)r=a.getView(r,"with");return r?r.dataVar.get():null},r.parentData=a._parentData}}}}}},{extensions:[".js",".json"]});P("./node_modules/meteor/aldeed:template-extension/lib/hooks.js"),P("./node_modules/meteor/aldeed:template-extension/lib/template-for-each.js"),P("./node_modules/meteor/aldeed:template-extension/lib/template-hooks.js"),P("./node_modules/meteor/aldeed:template-extension/lib/template-global-hooks.js"),P("./node_modules/meteor/aldeed:template-extension/lib/template-for-each-instance.js"),P("./node_modules/meteor/aldeed:template-extension/lib/template-inherits-events-from.js"),P("./node_modules/meteor/aldeed:template-extension/lib/template-inherits-helpers-from.js"),P("./node_modules/meteor/aldeed:template-extension/lib/template-inherits-hooks-from.js"),P("./node_modules/meteor/aldeed:template-extension/lib/template-register-helpers.js"),P("./node_modules/meteor/aldeed:template-extension/lib/template-replaces.js"),P("./node_modules/meteor/aldeed:template-extension/lib/template-clear-event-maps.js"),P("./node_modules/meteor/aldeed:template-extension/lib/template-copy-as.js"),P("./node_modules/meteor/aldeed:template-extension/lib/template-instance-parent.js"),P("./node_modules/meteor/aldeed:template-extension/lib/template-instance-get.js"),P("./node_modules/meteor/aldeed:template-extension/lib/template-parent-data-function.js"),"undefined"==typeof Package&&(Package={}),Package["aldeed:template-extension"]={}}();
!function(){"undefined"==typeof Package&&(Package={}),Package["fortawesome:fontawesome"]={}}();
!function(){var e=Package.meteor.Meteor,t=Package.meteor.global,n=Package.meteor.meteorEnv,a;(function(){(function(){(function(e){function n(e,t,n){switch(arguments.length){case 2:return null!=e?e:t;case 3:return null!=e?e:null!=t?t:n;default:throw new Error("Implement me")}}function a(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function s(e){De.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function r(e,t){var n=!0;return h(function(){return n&&(s(e),n=!1),t.apply(this,arguments)},t)}function i(e,t){mt[e]||(s(t),mt[e]=!0)}function o(e,t){return function(n){return m(e.call(this,n),t)}}function u(e,t){return function(n){return this.localeData().ordinal(e.call(this,n),t)}}function c(){}function l(e,t){t!==!1&&F(e),f(this,e),this._d=new Date((+e._d))}function d(e){var t=v(e),n=t.year||0,a=t.quarter||0,s=t.month||0,r=t.week||0,i=t.day||0,o=t.hour||0,u=t.minute||0,c=t.second||0,l=t.millisecond||0;this._milliseconds=+l+1e3*c+6e4*u+36e5*o,this._days=+i+7*r,this._months=+s+3*a+12*n,this._data={},this._locale=De.localeData(),this._bubble()}function h(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return t.hasOwnProperty("toString")&&(e.toString=t.toString),t.hasOwnProperty("valueOf")&&(e.valueOf=t.valueOf),e}function f(e,t){var n,a,s;if("undefined"!=typeof t._isAMomentObject&&(e._isAMomentObject=t._isAMomentObject),"undefined"!=typeof t._i&&(e._i=t._i),"undefined"!=typeof t._f&&(e._f=t._f),"undefined"!=typeof t._l&&(e._l=t._l),"undefined"!=typeof t._strict&&(e._strict=t._strict),"undefined"!=typeof t._tzm&&(e._tzm=t._tzm),"undefined"!=typeof t._isUTC&&(e._isUTC=t._isUTC),"undefined"!=typeof t._offset&&(e._offset=t._offset),"undefined"!=typeof t._pf&&(e._pf=t._pf),"undefined"!=typeof t._locale&&(e._locale=t._locale),Pe.length>0)for(n in Pe)a=Pe[n],s=t[a],"undefined"!=typeof s&&(e[a]=s);return e}function _(e){return e<0?Math.ceil(e):Math.floor(e)}function m(e,t,n){for(var a=""+Math.abs(e),s=e>=0;a.length<t;)a="0"+a;return(s?n?"+":"":"-")+a}function y(e,t){var n={milliseconds:0,months:0};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function p(e,t){var n;return t=L(t,e),e.isBefore(t)?n=y(e,t):(n=y(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n}function D(e,t){return function(n,a){var s,r;return null===a||isNaN(+a)||(i(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period)."),r=n,n=a,a=r),n="string"==typeof n?+n:n,s=De.duration(n,a),g(this,s,e),this}}function g(e,t,n,a){var s=t._milliseconds,r=t._days,i=t._months;a=null==a||a,s&&e._d.setTime(+e._d+s*n),r&&he(e,"Date",de(e,"Date")+r*n),i&&le(e,de(e,"Month")+i*n),a&&De.updateOffset(e,r||i)}function M(e){return"[object Array]"===Object.prototype.toString.call(e)}function w(e){return"[object Date]"===Object.prototype.toString.call(e)||e instanceof Date}function Y(e,t,n){var a=Math.min(e.length,t.length),s=Math.abs(e.length-t.length),r=0,i;for(i=0;i<a;i++)(n&&e[i]!==t[i]||!n&&S(e[i])!==S(t[i]))&&r++;return r+s}function k(e){if(e){var t=e.toLowerCase().replace(/(.)s$/,"$1");e=ut[e]||ct[t]||t}return e}function v(e){var t={},n,a;for(a in e)e.hasOwnProperty(a)&&(n=k(a),n&&(t[n]=e[a]));return t}function b(t){var n,a;if(0===t.indexOf("week"))n=7,a="day";else{if(0!==t.indexOf("month"))return;n=12,a="month"}De[t]=function(s,r){var i,o,u=De._locale[t],c=[];if("number"==typeof s&&(r=s,s=e),o=function(e){var t=De().utc().set(a,e);return u.call(De._locale,t,s||"")},null!=r)return o(r);for(i=0;i<n;i++)c.push(o(i));return c}}function S(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=t>=0?Math.floor(t):Math.ceil(t)),n}function T(e,t){return new Date(Date.UTC(e,t+1,0)).getUTCDate()}function O(e,t,n){return ie(De([e,11,31+t-n]),t,n).week}function W(e){return G(e)?366:365}function G(e){return e%4===0&&e%100!==0||e%400===0}function F(e){var t;e._a&&e._pf.overflow===-2&&(t=e._a[be]<0||e._a[be]>11?be:e._a[Se]<1||e._a[Se]>T(e._a[ve],e._a[be])?Se:e._a[Te]<0||e._a[Te]>23?Te:e._a[Oe]<0||e._a[Oe]>59?Oe:e._a[We]<0||e._a[We]>59?We:e._a[Ge]<0||e._a[Ge]>999?Ge:-1,e._pf._overflowDayOfYear&&(t<ve||t>Se)&&(t=Se),e._pf.overflow=t)}function P(e){return null==e._isValid&&(e._isValid=!isNaN(e._d.getTime())&&e._pf.overflow<0&&!e._pf.empty&&!e._pf.invalidMonth&&!e._pf.nullInput&&!e._pf.invalidFormat&&!e._pf.userInvalidated,e._strict&&(e._isValid=e._isValid&&0===e._pf.charsLeftOver&&0===e._pf.unusedTokens.length)),e._isValid}function U(e){return e?e.toLowerCase().replace("_","-"):e}function C(e){for(var t=0,n,a,s,r;t<e.length;){for(r=U(e[t]).split("-"),n=r.length,a=U(e[t+1]),a=a?a.split("-"):null;n>0;){if(s=z(r.slice(0,n).join("-")))return s;if(a&&a.length>=n&&Y(r,a,!0)>=n-1)break;n--}t++}return null}function z(e){var t=null;if(!Fe[e]&&Ue)try{t=De.locale(),require("./locale/"+e),De.locale(t)}catch(e){}return Fe[e]}function L(e,t){return t._isUTC?De(e).zone(t._offset||0):De(e).local()}function I(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function H(e){var t=e.match(Ie),n,a;for(n=0,a=t.length;n<a;n++)_t[t[n]]?t[n]=_t[t[n]]:t[n]=I(t[n]);return function(s){var r="";for(n=0;n<a;n++)r+=t[n]instanceof Function?t[n].call(s,e):t[n];return r}}function A(e,t){return e.isValid()?(t=x(t,e.localeData()),lt[t]||(lt[t]=H(t)),lt[t](e)):e.localeData().invalidDate()}function x(e,t){function n(e){return t.longDateFormat(e)||e}var a=5;for(He.lastIndex=0;a>=0&&He.test(e);)e=e.replace(He,n),He.lastIndex=0,a-=1;return e}function Z(e,t){var n,a=t._strict;switch(e){case"Q":return Qe;case"DDDD":return Be;case"YYYY":case"GGGG":case"gggg":return a?Re:Ze;case"Y":case"G":case"g":return et;case"YYYYYY":case"YYYYY":case"GGGGG":case"ggggg":return a?Ke:Ee;case"S":if(a)return Qe;case"SS":if(a)return Xe;case"SSS":if(a)return Be;case"DDD":return xe;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return je;case"a":case"A":return t._locale._meridiemParse;case"X":return $e;case"Z":case"ZZ":return Ve;case"T":return qe;case"SSSS":return Ne;case"MM":case"DD":case"YY":case"GG":case"gg":case"HH":case"hh":case"mm":case"ss":case"ww":case"WW":return a?Xe:Ae;case"M":case"D":case"d":case"H":case"h":case"m":case"s":case"w":case"W":case"e":case"E":return Ae;case"Do":return Je;default:return n=new RegExp(X(Q(e.replace("\\","")),"i"))}}function E(e){e=e||"";var t=e.match(Ve)||[],n=t[t.length-1]||[],a=(n+"").match(rt)||["-",0,0],s=+(60*a[1])+S(a[2]);return"+"===a[0]?-s:s}function N(e,t,n){var a,s=n._a;switch(e){case"Q":null!=t&&(s[be]=3*(S(t)-1));break;case"M":case"MM":null!=t&&(s[be]=S(t)-1);break;case"MMM":case"MMMM":a=n._locale.monthsParse(t),null!=a?s[be]=a:n._pf.invalidMonth=t;break;case"D":case"DD":null!=t&&(s[Se]=S(t));break;case"Do":null!=t&&(s[Se]=S(parseInt(t,10)));break;case"DDD":case"DDDD":null!=t&&(n._dayOfYear=S(t));break;case"YY":s[ve]=De.parseTwoDigitYear(t);break;case"YYYY":case"YYYYY":case"YYYYYY":s[ve]=S(t);break;case"a":case"A":n._isPm=n._locale.isPM(t);break;case"H":case"HH":case"h":case"hh":s[Te]=S(t);break;case"m":case"mm":s[Oe]=S(t);break;case"s":case"ss":s[We]=S(t);break;case"S":case"SS":case"SSS":case"SSSS":s[Ge]=S(1e3*("0."+t));break;case"X":n._d=new Date(1e3*parseFloat(t));break;case"Z":case"ZZ":n._useUTC=!0,n._tzm=E(t);break;case"dd":case"ddd":case"dddd":a=n._locale.weekdaysParse(t),null!=a?(n._w=n._w||{},n._w.d=a):n._pf.invalidWeekday=t;break;case"w":case"ww":case"W":case"WW":case"d":case"e":case"E":e=e.substr(0,1);case"gggg":case"GGGG":case"GGGGG":e=e.substr(0,2),t&&(n._w=n._w||{},n._w[e]=S(t));break;case"gg":case"GG":n._w=n._w||{},n._w[e]=De.parseTwoDigitYear(t)}}function j(e){var t,a,s,r,i,o,u;t=e._w,null!=t.GG||null!=t.W||null!=t.E?(i=1,o=4,a=n(t.GG,e._a[ve],ie(De(),1,4).year),s=n(t.W,1),r=n(t.E,1)):(i=e._locale._week.dow,o=e._locale._week.doy,a=n(t.gg,e._a[ve],ie(De(),i,o).year),s=n(t.w,1),null!=t.d?(r=t.d,r<i&&++s):r=null!=t.e?t.e+i:i),u=oe(a,s,r,o,i),e._a[ve]=u.year,e._dayOfYear=u.dayOfYear}function V(e){var t,a,s=[],r,i;if(!e._d){for(r=$(e),e._w&&null==e._a[Se]&&null==e._a[be]&&j(e),e._dayOfYear&&(i=n(e._a[ve],r[ve]),e._dayOfYear>W(i)&&(e._pf._overflowDayOfYear=!0),a=ne(i,0,e._dayOfYear),e._a[be]=a.getUTCMonth(),e._a[Se]=a.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=s[t]=r[t];for(;t<7;t++)e._a[t]=s[t]=null==e._a[t]?2===t?1:0:e._a[t];e._d=(e._useUTC?ne:te).apply(null,s),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()+e._tzm)}}function q(e){var t;e._d||(t=v(e._i),e._a=[t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond],V(e))}function $(e){var t=new Date;return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function J(e){if(e._f===De.ISO_8601)return void R(e);e._a=[],e._pf.empty=!0;var t=""+e._i,n,a,s,r,i,o=t.length,u=0;for(s=x(e._f,e._locale).match(Ie)||[],n=0;n<s.length;n++)r=s[n],a=(t.match(Z(r,e))||[])[0],a&&(i=t.substr(0,t.indexOf(a)),i.length>0&&e._pf.unusedInput.push(i),t=t.slice(t.indexOf(a)+a.length),u+=a.length),_t[r]?(a?e._pf.empty=!1:e._pf.unusedTokens.push(r),N(r,a,e)):e._strict&&!a&&e._pf.unusedTokens.push(r);e._pf.charsLeftOver=o-u,t.length>0&&e._pf.unusedInput.push(t),e._isPm&&e._a[Te]<12&&(e._a[Te]+=12),e._isPm===!1&&12===e._a[Te]&&(e._a[Te]=0),V(e),F(e)}function Q(e){return e.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,a,s){return t||n||a||s})}function X(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function B(e){var t,n,s,r,i;if(0===e._f.length)return e._pf.invalidFormat=!0,void(e._d=new Date(NaN));for(r=0;r<e._f.length;r++)i=0,t=f({},e),t._pf=a(),t._f=e._f[r],J(t),P(t)&&(i+=t._pf.charsLeftOver,i+=10*t._pf.unusedTokens.length,t._pf.score=i,(null==s||i<s)&&(s=i,n=t));h(e,n||t)}function R(e){var t,n,a=e._i,s=tt.exec(a);if(s){for(e._pf.iso=!0,t=0,n=at.length;t<n;t++)if(at[t][1].exec(a)){e._f=at[t][0]+(s[6]||" ");break}for(t=0,n=st.length;t<n;t++)if(st[t][1].exec(a)){e._f+=st[t][0];break}a.match(Ve)&&(e._f+="Z"),J(e)}else e._isValid=!1}function K(e){R(e),e._isValid===!1&&(delete e._isValid,De.createFromInputFallback(e))}function ee(t){var n=t._i,a;n===e?t._d=new Date:w(n)?t._d=new Date((+n)):null!==(a=Ce.exec(n))?t._d=new Date((+a[1])):"string"==typeof n?K(t):M(n)?(t._a=n.slice(0),V(t)):"object"==typeof n?q(t):"number"==typeof n?t._d=new Date(n):De.createFromInputFallback(t)}function te(e,t,n,a,s,r,i){var o=new Date(e,t,n,a,s,r,i);return e<1970&&o.setFullYear(e),o}function ne(e){var t=new Date(Date.UTC.apply(null,arguments));return e<1970&&t.setUTCFullYear(e),t}function ae(e,t){if("string"==typeof e)if(isNaN(e)){if(e=t.weekdaysParse(e),"number"!=typeof e)return null}else e=parseInt(e,10);return e}function se(e,t,n,a,s){return s.relativeTime(t||1,!!n,e,a)}function re(e,t,n){var a=De.duration(e).abs(),s=Ye(a.as("s")),r=Ye(a.as("m")),i=Ye(a.as("h")),o=Ye(a.as("d")),u=Ye(a.as("M")),c=Ye(a.as("y")),l=s<dt.s&&["s",s]||1===r&&["m"]||r<dt.m&&["mm",r]||1===i&&["h"]||i<dt.h&&["hh",i]||1===o&&["d"]||o<dt.d&&["dd",o]||1===u&&["M"]||u<dt.M&&["MM",u]||1===c&&["y"]||["yy",c];return l[2]=t,l[3]=+e>0,l[4]=n,se.apply({},l)}function ie(e,t,n){var a=n-t,s=n-e.day(),r;return s>a&&(s-=7),s<a-7&&(s+=7),r=De(e).add(s,"d"),{week:Math.ceil(r.dayOfYear()/7),year:r.year()}}function oe(e,t,n,a,s){var r=ne(e,0,1).getUTCDay(),i,o;return r=0===r?7:r,n=null!=n?n:s,i=s-r+(r>a?7:0)-(r<s?7:0),o=7*(t-1)+(n-s)+i+1,{year:o>0?e:e-1,dayOfYear:o>0?o:W(e-1)+o}}function ue(t){var n=t._i,a=t._f;return t._locale=t._locale||De.localeData(t._l),null===n||a===e&&""===n?De.invalid({nullInput:!0}):("string"==typeof n&&(t._i=n=t._locale.preparse(n)),De.isMoment(n)?new l(n,(!0)):(a?M(a)?B(t):J(t):ee(t),new l(t)))}function ce(e,t){var n,a;if(1===t.length&&M(t[0])&&(t=t[0]),!t.length)return De();for(n=t[0],a=1;a<t.length;++a)t[a][e](n)&&(n=t[a]);return n}function le(e,t){var n;return"string"==typeof t&&(t=e.localeData().monthsParse(t),"number"!=typeof t)?e:(n=Math.min(e.date(),T(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e)}function de(e,t){return e._d["get"+(e._isUTC?"UTC":"")+t]()}function he(e,t,n){return"Month"===t?le(e,n):e._d["set"+(e._isUTC?"UTC":"")+t](n)}function fe(e,t){return function(n){return null!=n?(he(this,e,n),De.updateOffset(this,t),this):de(this,e)}}function _e(e){return 400*e/146097}function me(e){return 146097*e/400}function ye(e){De.duration.fn[e]=function(){return this._data[e]}}function pe(e){"undefined"==typeof ender&&(we=Me.moment,e?Me.moment=r("Accessing Moment through the global scope is deprecated, and will be removed in an upcoming release.",De):Me.moment=De)}for(var De,ge="2.8.1",Me="undefined"!=typeof t?t:this,we,Ye=Math.round,ke,ve=0,be=1,Se=2,Te=3,Oe=4,We=5,Ge=6,Fe={},Pe=[],Ue="undefined"!=typeof module&&module.exports,Ce=/^\/?Date\((\-?\d+)/i,ze=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,Le=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,Ie=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|X|zz?|ZZ?|.)/g,He=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,Ae=/\d\d?/,xe=/\d{1,3}/,Ze=/\d{1,4}/,Ee=/[+\-]?\d{1,6}/,Ne=/\d+/,je=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Ve=/Z|[\+\-]\d\d:?\d\d/gi,qe=/T/i,$e=/[\+\-]?\d+(\.\d{1,3})?/,Je=/\d{1,2}/,Qe=/\d/,Xe=/\d\d/,Be=/\d{3}/,Re=/\d{4}/,Ke=/[+-]?\d{6}/,et=/[+-]?\d+/,tt=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,nt="YYYY-MM-DDTHH:mm:ssZ",at=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],st=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],rt=/([\+\-]|\d\d)/gi,it="Date|Hours|Minutes|Seconds|Milliseconds".split("|"),ot={Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6},ut={ms:"millisecond",s:"second",m:"minute",h:"hour",d:"day",D:"date",w:"week",W:"isoWeek",M:"month",Q:"quarter",y:"year",DDD:"dayOfYear",e:"weekday",E:"isoWeekday",gg:"weekYear",GG:"isoWeekYear"},ct={dayofyear:"dayOfYear",isoweekday:"isoWeekday",isoweek:"isoWeek",weekyear:"weekYear",isoweekyear:"isoWeekYear"},lt={},dt={s:45,m:45,h:22,d:26,M:11},ht="DDD w W M D d".split(" "),ft="M D H h m s w W".split(" "),_t={M:function(){return this.month()+1},MMM:function(e){return this.localeData().monthsShort(this,e)},MMMM:function(e){return this.localeData().months(this,e)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(e){return this.localeData().weekdaysMin(this,e)},ddd:function(e){return this.localeData().weekdaysShort(this,e)},dddd:function(e){return this.localeData().weekdays(this,e)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return m(this.year()%100,2)},YYYY:function(){return m(this.year(),4)},YYYYY:function(){return m(this.year(),5)},YYYYYY:function(){var e=this.year(),t=e>=0?"+":"-";return t+m(Math.abs(e),6)},gg:function(){return m(this.weekYear()%100,2)},gggg:function(){return m(this.weekYear(),4)},ggggg:function(){return m(this.weekYear(),5)},GG:function(){return m(this.isoWeekYear()%100,2)},GGGG:function(){return m(this.isoWeekYear(),4)},GGGGG:function(){return m(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return S(this.milliseconds()/100)},SS:function(){return m(S(this.milliseconds()/10),2)},SSS:function(){return m(this.milliseconds(),3)},SSSS:function(){return m(this.milliseconds(),3)},Z:function(){var e=-this.zone(),t="+";return e<0&&(e=-e,t="-"),t+m(S(e/60),2)+":"+m(S(e)%60,2)},ZZ:function(){var e=-this.zone(),t="+";return e<0&&(e=-e,t="-"),t+m(S(e/60),2)+m(S(e)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},X:function(){return this.unix()},Q:function(){return this.quarter()}},mt={},yt=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"];ht.length;)ke=ht.pop(),_t[ke+"o"]=u(_t[ke],ke);for(;ft.length;)ke=ft.pop(),_t[ke+ke]=o(_t[ke],2);_t.DDDD=o(_t.DDD,3),h(c.prototype,{set:function(e){var t,n;for(n in e)t=e[n],"function"==typeof t?this[n]=t:this["_"+n]=t},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(e){return this._months[e.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(e){return this._monthsShort[e.month()]},monthsParse:function(e){var t,n,a;for(this._monthsParse||(this._monthsParse=[]),t=0;t<12;t++)if(this._monthsParse[t]||(n=De.utc([2e3,t]),a="^"+this.months(n,"")+"|^"+this.monthsShort(n,""),this._monthsParse[t]=new RegExp(a.replace(".",""),"i")),this._monthsParse[t].test(e))return t},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:function(e){return this._weekdays[e.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(e){return this._weekdaysShort[e.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(e){return this._weekdaysMin[e.day()]},weekdaysParse:function(e){var t,n,a;for(this._weekdaysParse||(this._weekdaysParse=[]),t=0;t<7;t++)if(this._weekdaysParse[t]||(n=De([2e3,1]).day(t),a="^"+this.weekdays(n,"")+"|^"+this.weekdaysShort(n,"")+"|^"+this.weekdaysMin(n,""),this._weekdaysParse[t]=new RegExp(a.replace(".",""),"i")),this._weekdaysParse[t].test(e))return t},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY LT",LLLL:"dddd, MMMM D, YYYY LT"},longDateFormat:function(e){var t=this._longDateFormat[e];return!t&&this._longDateFormat[e.toUpperCase()]&&(t=this._longDateFormat[e.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e]=t),t},isPM:function(e){return"p"===(e+"").toLowerCase().charAt(0)},_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},calendar:function(e,t){var n=this._calendar[e];return"function"==typeof n?n.apply(t):n},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(e,t,n,a){var s=this._relativeTime[n];return"function"==typeof s?s(e,t,n,a):s.replace(/%d/i,e)},pastFuture:function(e,t){var n=this._relativeTime[e>0?"future":"past"];return"function"==typeof n?n(t):n.replace(/%s/i,t)},ordinal:function(e){return this._ordinal.replace("%d",e)},_ordinal:"%d",preparse:function(e){return e},postformat:function(e){return e},week:function(e){return ie(e,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6},_invalidDate:"Invalid date",invalidDate:function(){return this._invalidDate}}),De=function(t,n,s,r){var i;return"boolean"==typeof s&&(r=s,s=e),i={},i._isAMomentObject=!0,i._i=t,i._f=n,i._l=s,i._strict=r,i._isUTC=!1,i._pf=a(),ue(i)},De.suppressDeprecationWarnings=!1,De.createFromInputFallback=r("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(e){e._d=new Date(e._i)}),De.min=function(){var e=[].slice.call(arguments,0);return ce("isBefore",e)},De.max=function(){var e=[].slice.call(arguments,0);return ce("isAfter",e)},De.utc=function(t,n,s,r){var i;return"boolean"==typeof s&&(r=s,s=e),i={},i._isAMomentObject=!0,i._useUTC=!0,i._isUTC=!0,i._l=s,i._i=t,i._f=n,i._strict=r,i._pf=a(),ue(i).utc()},De.unix=function(e){return De(1e3*e)},De.duration=function(e,t){var n=e,a=null,s,r,i,o;return De.isDuration(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:"number"==typeof e?(n={},t?n[t]=e:n.milliseconds=e):(a=ze.exec(e))?(s="-"===a[1]?-1:1,n={y:0,d:S(a[Se])*s,h:S(a[Te])*s,m:S(a[Oe])*s,s:S(a[We])*s,ms:S(a[Ge])*s}):(a=Le.exec(e))?(s="-"===a[1]?-1:1,i=function(e){var t=e&&parseFloat(e.replace(",","."));return(isNaN(t)?0:t)*s},n={y:i(a[2]),M:i(a[3]),d:i(a[4]),h:i(a[5]),m:i(a[6]),s:i(a[7]),w:i(a[8])}):"object"==typeof n&&("from"in n||"to"in n)&&(o=p(De(n.from),De(n.to)),n={},n.ms=o.milliseconds,n.M=o.months),r=new d(n),De.isDuration(e)&&e.hasOwnProperty("_locale")&&(r._locale=e._locale),r},De.version=ge,De.defaultFormat=nt,De.ISO_8601=function(){},De.momentProperties=Pe,De.updateOffset=function(){},De.relativeTimeThreshold=function(t,n){return dt[t]!==e&&(n===e?dt[t]:(dt[t]=n,!0))},De.lang=r("moment.lang is deprecated. Use moment.locale instead.",function(e,t){return De.locale(e,t)}),De.locale=function(e,t){var n;return e&&(n="undefined"!=typeof t?De.defineLocale(e,t):De.localeData(e),n&&(De.duration._locale=De._locale=n)),De._locale._abbr},De.defineLocale=function(e,t){return null!==t?(t.abbr=e,Fe[e]||(Fe[e]=new c),Fe[e].set(t),De.locale(e),Fe[e]):(delete Fe[e],null)},De.langData=r("moment.langData is deprecated. Use moment.localeData instead.",function(e){return De.localeData(e)}),De.localeData=function(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return De._locale;if(!M(e)){if(t=z(e))return t;e=[e]}return C(e)},De.isMoment=function(e){return e instanceof l||null!=e&&e.hasOwnProperty("_isAMomentObject")},De.isDuration=function(e){return e instanceof d};for(ke=yt.length-1;ke>=0;--ke)b(yt[ke]);De.normalizeUnits=function(e){return k(e)},De.invalid=function(e){var t=De.utc(NaN);return null!=e?h(t._pf,e):t._pf.userInvalidated=!0,t},De.parseZone=function(){return De.apply(null,arguments).parseZone()},De.parseTwoDigitYear=function(e){return S(e)+(S(e)>68?1900:2e3)},h(De.fn=l.prototype,{clone:function(){return De(this)},valueOf:function(){return+this._d+6e4*(this._offset||0)},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date((+this)):this._d},toISOString:function(){var e=De(this).utc();return 0<e.year()&&e.year()<=9999?A(e,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):A(e,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){var e=this;return[e.year(),e.month(),e.date(),e.hours(),e.minutes(),e.seconds(),e.milliseconds()]},isValid:function(){return P(this)},isDSTShifted:function(){return!!this._a&&(this.isValid()&&Y(this._a,(this._isUTC?De.utc(this._a):De(this._a)).toArray())>0)},parsingFlags:function(){return h({},this._pf)},invalidAt:function(){return this._pf.overflow},utc:function(e){return this.zone(0,e)},local:function(e){return this._isUTC&&(this.zone(0,e),this._isUTC=!1,e&&this.add(this._d.getTimezoneOffset(),"m")),this},format:function(e){var t=A(this,e||De.defaultFormat);return this.localeData().postformat(t)},add:D(1,"add"),subtract:D(-1,"subtract"),diff:function(e,t,n){var a=L(e,this),s=6e4*(this.zone()-a.zone()),r,i;return t=k(t),"year"===t||"month"===t?(r=432e5*(this.daysInMonth()+a.daysInMonth()),i=12*(this.year()-a.year())+(this.month()-a.month()),i+=(this-De(this).startOf("month")-(a-De(a).startOf("month")))/r,i-=6e4*(this.zone()-De(this).startOf("month").zone()-(a.zone()-De(a).startOf("month").zone()))/r,"year"===t&&(i/=12)):(r=this-a,i="second"===t?r/1e3:"minute"===t?r/6e4:"hour"===t?r/36e5:"day"===t?(r-s)/864e5:"week"===t?(r-s)/6048e5:r),n?i:_(i)},from:function(e,t){return De.duration({to:this,from:e}).locale(this.locale()).humanize(!t)},fromNow:function(e){return this.from(De(),e)},calendar:function(e){var t=e||De(),n=L(t,this).startOf("day"),a=this.diff(n,"days",!0),s=a<-6?"sameElse":a<-1?"lastWeek":a<0?"lastDay":a<1?"sameDay":a<2?"nextDay":a<7?"nextWeek":"sameElse";return this.format(this.localeData().calendar(s,this))},isLeapYear:function(){return G(this.year())},isDST:function(){return this.zone()<this.clone().month(0).zone()||this.zone()<this.clone().month(5).zone()},day:function(e){var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=ae(e,this.localeData()),this.add(e-t,"d")):t},month:fe("Month",!0),startOf:function(e){switch(e=k(e)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===e?this.weekday(0):"isoWeek"===e&&this.isoWeekday(1),"quarter"===e&&this.month(3*Math.floor(this.month()/3)),this},endOf:function(e){return e=k(e),this.startOf(e).add(1,"isoWeek"===e?"week":e).subtract(1,"ms")},isAfter:function(e,t){return t="undefined"!=typeof t?t:"millisecond",+this.clone().startOf(t)>+De(e).startOf(t)},isBefore:function(e,t){return t="undefined"!=typeof t?t:"millisecond",+this.clone().startOf(t)<+De(e).startOf(t)},isSame:function(e,t){return t=t||"ms",+this.clone().startOf(t)===+L(e,this).startOf(t)},min:r("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(e){return e=De.apply(null,arguments),e<this?this:e}),max:r("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(e){return e=De.apply(null,arguments),e>this?this:e}),zone:function(e,t){var n=this._offset||0,a;return null==e?this._isUTC?n:this._d.getTimezoneOffset():("string"==typeof e&&(e=E(e)),Math.abs(e)<16&&(e=60*e),!this._isUTC&&t&&(a=this._d.getTimezoneOffset()),this._offset=e,this._isUTC=!0,null!=a&&this.subtract(a,"m"),n!==e&&(!t||this._changeInProgress?g(this,De.duration(n-e,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,De.updateOffset(this,!0),this._changeInProgress=null)),this)},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},parseZone:function(){return this._tzm?this.zone(this._tzm):"string"==typeof this._i&&this.zone(this._i),this},hasAlignedHourOffset:function(e){return e=e?De(e).zone():0,(this.zone()-e)%60===0},daysInMonth:function(){return T(this.year(),this.month())},dayOfYear:function(e){var t=Ye((De(this).startOf("day")-De(this).startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},quarter:function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},weekYear:function(e){var t=ie(this,this.localeData()._week.dow,this.localeData()._week.doy).year;return null==e?t:this.add(e-t,"y")},isoWeekYear:function(e){var t=ie(this,1,4).year;return null==e?t:this.add(e-t,"y")},week:function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},isoWeek:function(e){var t=ie(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},weekday:function(e){var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},isoWeekday:function(e){return null==e?this.day()||7:this.day(this.day()%7?e:e-7)},isoWeeksInYear:function(){return O(this.year(),1,4)},weeksInYear:function(){var e=this.localeData()._week;return O(this.year(),e.dow,e.doy)},get:function(e){return e=k(e),this[e]()},set:function(e,t){return e=k(e),"function"==typeof this[e]&&this[e](t),this},locale:function(t){return t===e?this._locale._abbr:(this._locale=De.localeData(t),this)},lang:r("moment().lang() is deprecated. Use moment().localeData() instead.",function(t){return t===e?this.localeData():(this._locale=De.localeData(t),this)}),localeData:function(){return this._locale}}),De.fn.millisecond=De.fn.milliseconds=fe("Milliseconds",!1),De.fn.second=De.fn.seconds=fe("Seconds",!1),De.fn.minute=De.fn.minutes=fe("Minutes",!1),De.fn.hour=De.fn.hours=fe("Hours",!0),De.fn.date=fe("Date",!0),De.fn.dates=r("dates accessor is deprecated. Use date instead.",fe("Date",!0)),De.fn.year=fe("FullYear",!0),De.fn.years=r("years accessor is deprecated. Use year instead.",fe("FullYear",!0)),De.fn.days=De.fn.day,De.fn.months=De.fn.month,De.fn.weeks=De.fn.week,De.fn.isoWeeks=De.fn.isoWeek,De.fn.quarters=De.fn.quarter,De.fn.toJSON=De.fn.toISOString,h(De.duration.fn=d.prototype,{_bubble:function(){var e=this._milliseconds,t=this._days,n=this._months,a=this._data,s,r,i,o=0;a.milliseconds=e%1e3,s=_(e/1e3),a.seconds=s%60,r=_(s/60),a.minutes=r%60,i=_(r/60),a.hours=i%24,t+=_(i/24),o=_(_e(t)),t-=_(me(o)),n+=_(t/30),t%=30,o+=_(n/12),n%=12,a.days=t,a.months=n,a.years=o},abs:function(){return this._milliseconds=Math.abs(this._milliseconds),this._days=Math.abs(this._days),this._months=Math.abs(this._months),this._data.milliseconds=Math.abs(this._data.milliseconds),this._data.seconds=Math.abs(this._data.seconds),this._data.minutes=Math.abs(this._data.minutes),this._data.hours=Math.abs(this._data.hours),this._data.months=Math.abs(this._data.months),this._data.years=Math.abs(this._data.years),this},weeks:function(){return _(this.days()/7)},valueOf:function(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*S(this._months/12)},humanize:function(e){var t=re(this,!e,this.localeData());return e&&(t=this.localeData().pastFuture(+this,t)),this.localeData().postformat(t)},add:function(e,t){var n=De.duration(e,t);return this._milliseconds+=n._milliseconds,this._days+=n._days,this._months+=n._months,this._bubble(),this},subtract:function(e,t){var n=De.duration(e,t);return this._milliseconds-=n._milliseconds,this._days-=n._days,this._months-=n._months,this._bubble(),this},get:function(e){return e=k(e),this[e.toLowerCase()+"s"]()},as:function(e){var t,n;if(e=k(e),t=this._days+this._milliseconds/864e5,"month"===e||"year"===e)return n=this._months+12*_e(t),"month"===e?n:n/12;switch(t+=me(this._months/12),e){case"week":return t/7;case"day":return t;case"hour":return 24*t;case"minute":return 24*t*60;case"second":return 24*t*60*60;case"millisecond":return 24*t*60*60*1e3;default:throw new Error("Unknown unit "+e)}},lang:De.fn.lang,locale:De.fn.locale,toIsoString:r("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",function(){return this.toISOString()}),toISOString:function(){var e=Math.abs(this.years()),t=Math.abs(this.months()),n=Math.abs(this.days()),a=Math.abs(this.hours()),s=Math.abs(this.minutes()),r=Math.abs(this.seconds()+this.milliseconds()/1e3);return this.asSeconds()?(this.asSeconds()<0?"-":"")+"P"+(e?e+"Y":"")+(t?t+"M":"")+(n?n+"D":"")+(a||s||r?"T":"")+(a?a+"H":"")+(s?s+"M":"")+(r?r+"S":""):"P0D"},localeData:function(){return this._locale}});for(ke in ot)ot.hasOwnProperty(ke)&&ye(ke.toLowerCase());De.duration.fn.asMilliseconds=function(){return this.as("ms")},De.duration.fn.asSeconds=function(){return this.as("s")},De.duration.fn.asMinutes=function(){return this.as("m")},De.duration.fn.asHours=function(){return this.as("h")},De.duration.fn.asDays=function(){return this.as("d")},De.duration.fn.asWeeks=function(){return this.as("weeks")},De.duration.fn.asMonths=function(){return this.as("M")},De.duration.fn.asYears=function(){return this.as("y")},De.locale("en",{ordinal:function(e){var t=e%10,n=1===S(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n}}),Ue?module.exports=De:"function"==typeof define&&define.amd?(define("moment",function(e,t,n){return n.config&&n.config()&&n.config().noGlobal===!0&&(Me.moment=we),De}),pe(!0)):pe()}).call(this)}).call(this),function(){"undefined"!=typeof Package&&(a=this.moment)}.call(this)}).call(this),"undefined"==typeof Package&&(Package={}),function(e,t){for(var n in t)n in e||(e[n]=t[n])}(Package["mrt:moment"]={},{moment:a})}();
!function(){var t=Package.meteor.Meteor,e=Package.meteor.global,n=Package.meteor.meteorEnv,o,i;(function(){o={exports:{}}}).call(this),function(){function t(e,o){"use strict";function i(t,e){return function(){return t.apply(e,arguments)}}var r;if(o=o||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=o.touchBoundary||10,this.layer=e,this.tapDelay=o.tapDelay||200,this.tapTimeout=o.tapTimeout||700,!t.notNeeded(e)){for(var a=["onMouse","onClick","onTouchStart","onTouchMove","onTouchEnd","onTouchCancel"],c=this,s=0,u=a.length;s<u;s++)c[a[s]]=i(c[a[s]],c);n&&(e.addEventListener("mouseover",this.onMouse,!0),e.addEventListener("mousedown",this.onMouse,!0),e.addEventListener("mouseup",this.onMouse,!0)),e.addEventListener("click",this.onClick,!0),e.addEventListener("touchstart",this.onTouchStart,!1),e.addEventListener("touchmove",this.onTouchMove,!1),e.addEventListener("touchend",this.onTouchEnd,!1),e.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(e.removeEventListener=function(t,n,o){var i=Node.prototype.removeEventListener;"click"===t?i.call(e,t,n.hijacked||n,o):i.call(e,t,n,o)},e.addEventListener=function(t,n,o){var i=Node.prototype.addEventListener;"click"===t?i.call(e,t,n.hijacked||(n.hijacked=function(t){t.propagationStopped||n(t)}),o):i.call(e,t,n,o)}),"function"==typeof e.onclick&&(r=e.onclick,e.addEventListener("click",function(t){r(t)},!1),e.onclick=null)}}var e=navigator.userAgent.indexOf("Windows Phone")>=0,n=navigator.userAgent.indexOf("Android")>0&&!e,i=/iP(ad|hone|od)/.test(navigator.userAgent)&&!e,r=i&&/OS 4_\d(_\d)?/.test(navigator.userAgent),a=i&&/OS [6-7]_\d/.test(navigator.userAgent),c=navigator.userAgent.indexOf("BB10")>0;t.prototype.needsClick=function(t){switch(t.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(t.disabled)return!0;break;case"input":if(i&&"file"===t.type||t.disabled)return!0;break;case"label":case"iframe":case"video":return!0}return/\bneedsclick\b/.test(t.className)},t.prototype.needsFocus=function(t){switch(t.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!n;case"input":switch(t.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!t.disabled&&!t.readOnly;default:return/\bneedsfocus\b/.test(t.className)}},t.prototype.sendClick=function(t,e){var n,o;document.activeElement&&document.activeElement!==t&&document.activeElement.blur(),o=e.changedTouches[0],n=document.createEvent("MouseEvents"),n.initMouseEvent(this.determineEventType(t),!0,!0,window,1,o.screenX,o.screenY,o.clientX,o.clientY,!1,!1,!1,!1,0,null),n.forwardedTouchEvent=!0,t.dispatchEvent(n)},t.prototype.determineEventType=function(t){return n&&"select"===t.tagName.toLowerCase()?"mousedown":"click"},t.prototype.focus=function(t){var e;i&&t.setSelectionRange&&0!==t.type.indexOf("date")&&"time"!==t.type&&"month"!==t.type?(e=t.value.length,t.setSelectionRange(e,e)):t.focus()},t.prototype.updateScrollParent=function(t){var e,n;if(e=t.fastClickScrollParent,!e||!e.contains(t)){n=t;do{if(n.scrollHeight>n.offsetHeight){e=n,t.fastClickScrollParent=n;break}n=n.parentElement}while(n)}e&&(e.fastClickLastScrollTop=e.scrollTop)},t.prototype.getTargetElementFromEventTarget=function(t){return t.nodeType===Node.TEXT_NODE?t.parentNode:t},t.prototype.onTouchStart=function(t){var e,n,o;if(t.targetTouches.length>1)return!0;if(e=this.getTargetElementFromEventTarget(t.target),n=t.targetTouches[0],i){if(o=window.getSelection(),o.rangeCount&&!o.isCollapsed)return!0;if(!r){if(n.identifier&&n.identifier===this.lastTouchIdentifier)return t.preventDefault(),!1;this.lastTouchIdentifier=n.identifier,this.updateScrollParent(e)}}return this.trackingClick=!0,this.trackingClickStart=t.timeStamp,this.targetElement=e,this.touchStartX=n.pageX,this.touchStartY=n.pageY,t.timeStamp-this.lastClickTime<this.tapDelay&&t.preventDefault(),!0},t.prototype.touchHasMoved=function(t){var e=t.changedTouches[0],n=this.touchBoundary;return Math.abs(e.pageX-this.touchStartX)>n||Math.abs(e.pageY-this.touchStartY)>n},t.prototype.onTouchMove=function(t){return!this.trackingClick||((this.targetElement!==this.getTargetElementFromEventTarget(t.target)||this.touchHasMoved(t))&&(this.trackingClick=!1,this.targetElement=null),!0)},t.prototype.findControl=function(t){return void 0!==t.control?t.control:t.htmlFor?document.getElementById(t.htmlFor):t.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},t.prototype.onTouchEnd=function(t){var e,o,c,s,u,l=this.targetElement;if(!this.trackingClick)return!0;if(t.timeStamp-this.lastClickTime<this.tapDelay)return this.cancelNextClick=!0,!0;if(t.timeStamp-this.trackingClickStart>this.tapTimeout)return!0;if(this.cancelNextClick=!1,this.lastClickTime=t.timeStamp,o=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,a&&(u=t.changedTouches[0],l=document.elementFromPoint(u.pageX-window.pageXOffset,u.pageY-window.pageYOffset)||l,l.fastClickScrollParent=this.targetElement.fastClickScrollParent),c=l.tagName.toLowerCase(),"label"===c){if(e=this.findControl(l)){if(this.focus(l),n)return!1;l=e}}else if(this.needsFocus(l))return t.timeStamp-o>100||i&&window.top!==window&&"input"===c?(this.targetElement=null,!1):(this.focus(l),this.sendClick(l,t),i&&"select"===c||(this.targetElement=null,t.preventDefault()),!1);return!(!i||r||(s=l.fastClickScrollParent,!s||s.fastClickLastScrollTop===s.scrollTop))||(this.needsClick(l)||(t.preventDefault(),this.sendClick(l,t)),!1)},t.prototype.onTouchCancel=function(){this.trackingClick=!1,this.targetElement=null},t.prototype.onMouse=function(t){return!this.targetElement||(!!t.forwardedTouchEvent||(!t.cancelable||(!(!this.needsClick(this.targetElement)||this.cancelNextClick)||(t.stopImmediatePropagation?t.stopImmediatePropagation():t.propagationStopped=!0,t.stopPropagation(),t.preventDefault(),!1))))},t.prototype.onClick=function(t){var e;return this.trackingClick?(this.targetElement=null,this.trackingClick=!1,!0):"submit"===t.target.type&&0===t.detail||(e=this.onMouse(t),e||(this.targetElement=null),e)},t.prototype.destroy=function(){var t=this.layer;n&&(t.removeEventListener("mouseover",this.onMouse,!0),t.removeEventListener("mousedown",this.onMouse,!0),t.removeEventListener("mouseup",this.onMouse,!0)),t.removeEventListener("click",this.onClick,!0),t.removeEventListener("touchstart",this.onTouchStart,!1),t.removeEventListener("touchmove",this.onTouchMove,!1),t.removeEventListener("touchend",this.onTouchEnd,!1),t.removeEventListener("touchcancel",this.onTouchCancel,!1)},t.notNeeded=function(t){var e,o,i,r;if("undefined"==typeof window.ontouchstart)return!0;if(o=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]){if(!n)return!0;if(e=document.querySelector("meta[name=viewport]")){if(e.content.indexOf("user-scalable=no")!==-1)return!0;if(o>31&&document.documentElement.scrollWidth<=window.outerWidth)return!0}}if(c&&(i=navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/),i[1]>=10&&i[2]>=3&&(e=document.querySelector("meta[name=viewport]")))){if(e.content.indexOf("user-scalable=no")!==-1)return!0;if(document.documentElement.scrollWidth<=window.outerWidth)return!0}return"none"===t.style.msTouchAction||"manipulation"===t.style.touchAction||(r=+(/Firefox\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1],!!(r>=27&&(e=document.querySelector("meta[name=viewport]"),e&&(e.content.indexOf("user-scalable=no")!==-1||document.documentElement.scrollWidth<=window.outerWidth)))||("none"===t.style.touchAction||"manipulation"===t.style.touchAction))},t.attach=function(e,n){return new t(e,n)},"function"==typeof define&&"object"==typeof define.amd&&define.amd?define(function(){return t}):"undefined"!=typeof o&&o.exports?(o.exports=t.attach,o.exports.FastClick=t):window.FastClick=t}.call(this),function(){i=o.exports.FastClick,t.startup(function(){i.attach(document.body)})}.call(this),"undefined"==typeof Package&&(Package={}),function(t,e){for(var n in e)n in t||(t[n]=e[n])}(Package.fastclick={},{FastClick:i})}();
!function(){var a=Package.meteor.Meteor,e=Package.meteor.global,o=Package.meteor.meteorEnv,l=Package["templating-runtime"].Template,n=Package.jquery.$,t=Package.jquery.jQuery,c=Package.blaze.Blaze,i=Package.blaze.UI,d=Package.blaze.Handlebars,r=Package.spacebars.Spacebars,u=Package.htmljs.HTML,m;(function(){var a=null;m={allowMultiple:!1,show:function(e,o,n){if(null==a||this.allowMultiple){var t=document.body,i=c.renderWithData(l[e],o,t),d=i._domrange,r=d.$(".modal");r.on("shown.bs.modal",function(a){r.find("[autofocus]").focus()}),r.on("hidden.bs.modal",function(e){c.remove(i),a=null}),a=r,r.modal(n?n:{})}},hide:function(e){e instanceof c.TemplateInstance?e.$(".modal").modal("hide"):null!=a&&a.modal("hide")}}}).call(this),"undefined"==typeof Package&&(Package={}),function(a,e){for(var o in e)o in a||(a[o]=e[o])}(Package["peppelg:bootstrap-3-modal"]={},{Modal:m})}();
!function(){"undefined"==typeof Package&&(Package={}),Package["hot-code-push"]={}}();
Mongo=Package.mongo.Mongo,ReactiveVar=Package["reactive-var"].ReactiveVar,$=Package.jquery.$,jQuery=Package.jquery.jQuery,Tracker=Package.tracker.Tracker,Deps=Package.tracker.Deps,cornerstone=Package["ohif:cornerstone"].cornerstone,cornerstoneMath=Package["ohif:cornerstone"].cornerstoneMath,cornerstoneTools=Package["ohif:cornerstone"].cornerstoneTools,cornerstoneWADOImageLoader=Package["ohif:cornerstone"].cornerstoneWADOImageLoader,dicomParser=Package["ohif:cornerstone"].dicomParser,dialogPolyfill=Package["ohif:viewerbase"].dialogPolyfill,Servers=Package["ohif:study-list"].Servers,CurrentServer=Package["ohif:study-list"].CurrentServer,getCurrentServer=Package["ohif:study-list"].getCurrentServer,HP=Package["ohif:hanging-protocols"].HP,SimpleSchema=Package["aldeed:simple-schema"].SimpleSchema,MongoObject=Package["aldeed:simple-schema"].MongoObject,Router=Package["iron:router"].Router,RouteController=Package["iron:router"].RouteController,Session=Package.session.Session,PersistentSession=Package["u2622:persistent-session"].PersistentSession,loglevel=Package["practicalmeteor:loglevel"].loglevel,ObjectLogger=Package["practicalmeteor:loglevel"].ObjectLogger,ReactiveDict=Package["reactive-dict"].ReactiveDict,moment=Package["mrt:moment"].moment,FastClick=Package.fastclick.FastClick,Modal=Package["peppelg:bootstrap-3-modal"].Modal,Random=Package.random.Random,Meteor=Package.meteor.Meteor,global=Package.meteor.global,meteorEnv=Package.meteor.meteorEnv,WebApp=Package.webapp.WebApp,_=Package.underscore._,DDP=Package["ddp-client"].DDP,LaunchScreen=Package["launch-screen"].LaunchScreen,Blaze=Package.ui.Blaze,UI=Package.ui.UI,Handlebars=Package.ui.Handlebars,Spacebars=Package.spacebars.Spacebars,Template=Package["templating-runtime"].Template,meteorInstall=Package.modules.meteorInstall,Buffer=Package.modules.Buffer,process=Package.modules.process,Symbol=Package["ecmascript-runtime"].Symbol,Map=Package["ecmascript-runtime"].Map,Set=Package["ecmascript-runtime"].Set,meteorBabelHelpers=Package["babel-runtime"].meteorBabelHelpers,Promise=Package.promise.Promise,Iron=Package["iron:core"].Iron,Autoupdate=Package.autoupdate.Autoupdate,Reload=Package.reload.Reload,HTML=Package.htmljs.HTML;
var require=meteorInstall({client:{components:{flexboxLayout:{"template.flexboxLayout.js":function(){Template.__checkName("flexboxLayout"),Template.flexboxLayout=new Template("Template.flexboxLayout",function(){var e=this;return HTML.DIV({class:"viewerSection"},"\n ",HTML.DIV({class:function(){return["sidebarMenu sidebar-left ",Blaze.If(function(){return Spacebars.call(e.lookup("leftSidebarOpen"))},function(){return"sidebar-open"})]}},"\n ",Blaze._TemplateWith(function(){return Spacebars.dataMustache(e.lookup("clone"),e.lookup("."))},function(){return Spacebars.include(e.lookupTemplate("studyBrowser"))}),"\n "),"\n ",HTML.DIV({class:function(){return["mainContent ",Blaze.If(function(){return Spacebars.call(e.lookup("leftSidebarOpen"))},function(){return"sidebar-left-open"})]}},"\n ",Blaze._TemplateWith(function(){return Spacebars.dataMustache(e.lookup("clone"),e.lookup("."))},function(){return Spacebars.include(e.lookupTemplate("standaloneViewerMain"))}),"\n "),"\n ")})},"flexboxLayout.js":["meteor/templating",function(e,t,a){var o;a.import("meteor/templating",{Template:function(e){o=e}}),o.flexboxLayout.events({"transitionend .sidebarMenu":function(){function e(e,t){e.target.classList.contains("sidebarMenu")&&window.ResizeViewportManager.handleResize()}return e}()}),o.flexboxLayout.helpers({leftSidebarOpen:function(){function e(){return o.instance().data.state.get("leftSidebar")}return e}()})}]},standaloneViewer:{"template.standaloneViewer.js":function(){Template.__checkName("standaloneViewer"),Template.standaloneViewer=new Template("Template.standaloneViewer",function(){var e=this;return[Spacebars.include(e.lookupTemplate("header"),function(){return["\n ",Blaze._TemplateWith(function(){return"brand"},function(){return Spacebars.include(e.lookupTemplate("section"),function(){return["\n ",HTML.SVG({class:"logo-image"},"\n ",HTML.USE({"xlink:href":function(){return Spacebars.mustache(e.lookup("absoluteUrl"),"packages/ohif_viewerbase/assets/icons.svg#icon-ohif-logo")}}),"\n "),"\n ",HTML.DIV({class:"logo-text"},"Open Health Imaging Foundation"),"\n "]})}),"\n "]}),"\n ",Spacebars.include(e.lookupTemplate("viewer"))]})}},standaloneViewerMain:{"template.standaloneViewerMain.js":function(){Template.__checkName("standaloneViewerMain"),Template.standaloneViewerMain=new Template("Template.standaloneViewerMain",function(){var e=this;return HTML.Raw('<div class="viewerMain">\n <div id="layoutManagerTarget"></div>\n </div>')})},"standaloneViewerMain.js":["meteor/meteor","meteor/templating","meteor/ohif:core","meteor/ohif:viewerbase",function(e,t,a){var o;a.import("meteor/meteor",{Meteor:function(e){o=e}});var n;a.import("meteor/templating",{Template:function(e){n=e}});var r;a.import("meteor/ohif:core",{OHIF:function(e){r=e}}),a.import("meteor/ohif:viewerbase"),o.startup(function(){window.ResizeViewportManager=window.ResizeViewportManager||new r.viewerbase.ResizeViewportManager}),n.standaloneViewerMain.onCreated(function(){window.addEventListener("resize",window.ResizeViewportManager.getResizeHandler()),r.viewer.updateImageSynchronizer=new cornerstoneTools.Synchronizer("CornerstoneNewImage",cornerstoneTools.updateImageSynchronizer),r.viewer.metadataProvider=r.cornerstone.metadataProvider;var e=r.viewer.metadataProvider;cornerstoneTools.metaData.addProvider(e.provider.bind(e))}),n.standaloneViewerMain.onRendered(function(){var e=n.instance(),t=e.data.studies,a=e.$("#layoutManagerTarget").get(0);r.viewerbase.layoutManager=new r.viewerbase.LayoutManager(a,t),r.viewerbase.layoutManager.updateViewports(),r.viewerbase.hotkeyUtils.enableHotkeys()}),n.standaloneViewerMain.onDestroyed(function(){window.removeEventListener("resize",window.ResizeViewportManager.getResizeHandler()),r.viewer.updateImageSynchronizer.destroy(),delete r.viewerbase.layoutManager})}]},toolbarSection:{"template.toolbarSection.js":function(){Template.__checkName("toolbarSection"),Template.toolbarSection=new Template("Template.toolbarSection",function(){var e=this;return HTML.DIV({class:"toolbarSection noselect p-x-2"},"\n ",HTML.DIV({class:"clearfix"},"\n ",HTML.DIV({class:"pull-left m-t-1"},"\n ",Blaze._TemplateWith(function(){return Spacebars.call(e.lookup("leftSidebarToggleButtonData"))},function(){return Spacebars.include(e.lookupTemplate("roundedButtonGroup"))}),"\n "),"\n ",Blaze._TemplateWith(function(){return{toolbarButtons:Spacebars.call(e.lookup("toolbarButtons"))}},function(){return Spacebars.include(e.lookupTemplate("toolbarSectionTools"))}),"\n "),"\n ")})},"toolbarSection.js":["meteor/templating","meteor/ohif:core","meteor/ohif:viewerbase",function(e,t,a){var o;a.import("meteor/templating",{Template:function(e){o=e}});var n;a.import("meteor/ohif:core",{OHIF:function(e){n=e}}),a.import("meteor/ohif:viewerbase"),o.toolbarSection.onCreated(function(){var e=o.instance();n.uiSettings.leftSidebarOpen&&e.data.state.set("leftSidebar","studies")}),o.toolbarSection.helpers({leftSidebarToggleButtonData:function(){function e(){var e=o.instance();return{toggleable:!0,key:"leftSidebar",value:e.data.state,options:[{value:"studies",svgLink:"packages/ohif_viewerbase/assets/icons.svg#icon-studies",svgWidth:15,svgHeight:13,bottomLabel:"Series"}]}}return e}(),toolbarButtons:function(){function e(){var e=[];e.push({id:"stackScroll",title:"Stack Scroll",classes:"imageViewerTool",iconClasses:"fa fa-bars"}),e.push({id:"magnify",title:"Magnify",classes:"imageViewerTool toolbarSectionButton",iconClasses:"fa fa-circle"}),e.push({id:"wwwcRegion",title:"ROI Window",classes:"imageViewerTool",iconClasses:"fa fa-square"}),e.push({id:"dragProbe",title:"Probe",classes:"imageViewerTool",iconClasses:"fa fa-dot-circle-o"}),e.push({id:"ellipticalRoi",title:"Ellipse",classes:"imageViewerTool",iconClasses:"fa fa-circle-o"}),e.push({id:"rectangleRoi",title:"Rectangle",classes:"imageViewerTool",iconClasses:"fa fa-square-o"}),e.push({id:"invert",title:"Invert",classes:"imageViewerCommand",iconClasses:"fa fa-adjust"}),e.push({id:"clearTools",title:"Clear",classes:"imageViewerCommand",iconClasses:"fa fa-trash"});var t=[];return t.push({id:"zoom",title:"Zoom",classes:"imageViewerTool",svgLink:"packages/ohif_viewerbase/assets/icons.svg#icon-tools-zoom"}),t.push({id:"wwwc",title:"Levels",classes:"imageViewerTool",svgLink:"packages/ohif_viewerbase/assets/icons.svg#icon-tools-levels"}),t.push({id:"pan",title:"Pan",classes:"imageViewerTool",svgLink:"packages/ohif_viewerbase/assets/icons.svg#icon-tools-pan"}),t.push({id:"length",title:"Length",classes:"imageViewerTool toolbarSectionButton",svgLink:"packages/ohif_viewerbase/assets/icons.svg#icon-tools-measure-temp"}),t.push({id:"annotate",title:"Annotate",classes:"imageViewerTool",svgLink:"packages/ohif_viewerbase/assets/icons.svg#icon-tools-measure-non-target"}),t.push({id:"angle",title:"Angle",classes:"imageViewerTool",iconClasses:"fa fa-angle-left"}),t.push({id:"resetViewport",title:"Reset",classes:"imageViewerCommand",iconClasses:"fa fa-undo"}),n.uiSettings.displayEchoUltrasoundWorkflow||!function(){t.push({id:"previousDisplaySet",title:"Previous",classes:"imageViewerCommand",iconClasses:"fa fa-toggle-up fa-fw"}),t.push({id:"nextDisplaySet",title:"Next",classes:"imageViewerCommand",iconClasses:"fa fa-toggle-down fa-fw"});var e=n.viewerbase.viewportUtils.isPlaying;t.push({id:"toggleCinePlay",title:function(){function t(){return e()?"Stop":"Play"}return t}(),classes:"imageViewerCommand",iconClasses:function(){function t(){return"fa fa-fw "+(e()?"fa-stop":"fa-play")}return t}(),active:e}),t.push({id:"toggleCineDialog",title:"CINE",classes:"imageViewerCommand",iconClasses:"fa fa-youtube-play",active:function(){function e(){return $("#cineDialog").is(":visible")}return e}()})}(),t.push({id:"layout",title:"Layout",iconClasses:"fa fa-th-large",buttonTemplateName:"layoutButton"}),t.push({id:"toggleMore",title:"More",classes:"rp-x-1 rm-l-3",svgLink:"packages/ohif_viewerbase/assets/icons.svg#icon-tools-more",subTools:e}),t}return e}(),hangingProtocolButtons:function(){function e(){var e=[];return e.push({id:"previousPresentationGroup",title:"Prev. Stage",iconClasses:"fa fa-step-backward",buttonTemplateName:"previousPresentationGroupButton"}),e.push({id:"nextPresentationGroup",title:"Next Stage",iconClasses:"fa fa-step-forward",buttonTemplateName:"nextPresentationGroupButton"}),e}return e}()}),o.toolbarSection.onRendered(function(){var e=o.instance();e.$("#layout").dropdown();var t=n.viewerbase.toolManager.getToolDefaultStates(),a=t.disabledToolButtons,r=$("#toolbar").find("button");if(a&&a.length>0)for(var i=0;i<r.length;i++){var s=r[i];$(s).prop("disabled",!1);var l=a.indexOf($(s).attr("id"));l!==-1&&$(s).prop("disabled",!0)}})}]},viewer:{"template.viewer.js":function(){Template.__checkName("viewer"),Template.viewer=new Template("Template.viewer",function(){var e=this;return Blaze.If(function(){return Spacebars.call(e.templateInstance().subscriptionsReady())},function(){return["\n ",HTML.DIV({class:"viewerDialogs"},"\n ",Spacebars.include(e.lookupTemplate("cineDialog")),"\n ",Spacebars.include(e.lookupTemplate("layoutChooser")),"\n ",Spacebars.include(e.lookupTemplate("annotationDialogs")),"\n "),"\n ",HTML.DIV({id:"viewer"},"\n ",Blaze._TemplateWith(function(){return Spacebars.dataMustache(e.lookup("clone"),e.lookup("."))},function(){return Spacebars.include(e.lookupTemplate("toolbarSection"))}),"\n ",Blaze._TemplateWith(function(){return Spacebars.dataMustache(e.lookup("clone"),e.lookup("."))},function(){return Spacebars.include(e.lookupTemplate("flexboxLayout"))}),"\n "),"\n "]},function(){return["\n ",Spacebars.include(e.lookupTemplate("loadingText")),"\n "]})})},"viewer.js":["meteor/templating","meteor/session","meteor/tracker","meteor/reactive-dict","meteor/ohif:core","meteor/ohif:viewerbase","meteor/ohif:metadata",function(e,t,a){var o;a.import("meteor/templating",{Template:function(e){o=e}});var n;a.import("meteor/session",{Session:function(e){n=e}});var r;a.import("meteor/tracker",{Tracker:function(e){r=e}});var i;a.import("meteor/reactive-dict",{ReactiveDict:function(e){i=e}});var s;a.import("meteor/ohif:core",{OHIF:function(e){s=e}}),a.import("meteor/ohif:viewerbase"),a.import("meteor/ohif:metadata");var l=s.viewerbase.viewportUtils;s.viewer.functionList={toggleCineDialog:l.toggleCineDialog,toggleCinePlay:l.toggleCinePlay,clearTools:l.clearTools,resetViewport:l.resetViewport,invert:l.invert},n.setDefault("activeViewport",!1),n.setDefault("leftSidebar",!1),n.setDefault("rightSidebar",!1);var c=function e(){HP.ProtocolStore.onReady(function(){var e=s.viewer.StudyMetadataList.all(),t=s.viewerbase.layoutManager,a=new s.studylist.classes.OHIFStudyMetadataSource,o=new HP.ProtocolEngine(t,e,[],a);HP.setEngine(o)})};o.viewer.onCreated(function(){var e=o.instance();e.data.state=new i,e.data.state.set("leftSidebar",n.get("leftSidebar")),e.data.state.set("rightSidebar",n.get("rightSidebar")),s.viewer.data&&s.viewer.data.loadedSeriesData?(s.log.info("Reloading previous loadedSeriesData"),s.viewer.loadedSeriesData=s.viewer.data.loadedSeriesData):(s.log.info("Setting default viewer data"),s.viewer.loadedSeriesData={},s.viewer.data={},s.viewer.data.loadedSeriesData=s.viewer.loadedSeriesData,s.viewer.data.viewportColumns=1,s.viewer.data.viewportRows=1,s.viewer.data.activeViewport=0),n.setPersistent("ViewerData",s.viewer.data),n.set("activeViewport",s.viewer.data.activeViewport||0),s.viewer.Studies.removeAll(),s.viewer.data.studyInstanceUids=[],e.data.studies.forEach(function(e){e.selected=!0;var t=new s.metadata.StudyMetadata(e);e.displaySets=s.viewerbase.sortingManager.getDisplaySets(t),s.viewer.Studies.insert(e),s.viewer.data.studyInstanceUids.push(e.studyInstanceUid)})}),o.viewer.onRendered(function(){this.autorun(function(){var e=n.get("OHIFViewerMainRendered");e&&r.nonreactive(c)})}),o.viewer.events({"click .js-toggle-studies":function(){function e(){var e=o.instance(),t=e.data.state.get("leftSidebar");e.data.state.set("leftSidebar",!t)}return e}()})}]}},"config.js":["meteor/meteor","meteor/ohif:core","meteor/ohif:cornerstone",function(e,t,a){var o;a.import("meteor/meteor",{Meteor:function(e){o=e}});var n;a.import("meteor/ohif:core",{OHIF:function(e){n=e}});var r;a.import("meteor/ohif:cornerstone",{cornerstoneWADOImageLoader:function(e){r=e}}),o.startup(function(){var e=Math.max(navigator.hardwareConcurrency-1,1),t={maxWebWorkers:e,startWebWorkersOnDemand:!0,webWorkerPath:n.utils.absoluteUrl("packages/ohif_cornerstone/public/js/cornerstoneWADOImageLoaderWebWorker.es5.js"),taskConfiguration:{decodeTask:{loadCodecsOnStartup:!0,initializeCodecsOnStartup:!1,codecsPath:n.utils.absoluteUrl("packages/ohif_cornerstone/public/js/cornerstoneWADOImageLoaderCodecs.es5.js"),usePDFJS:!1}}};r.webWorkerManager.initialize(t)})}],"cornerstoneWebImageLoader.js":function(){cornerstoneWebImageLoader={},function(e,t,a){"use strict";function o(e,a){function o(){for(var t=n(),a=t.data,o=e.naturalHeight*e.naturalWidth,r=new Uint8Array(4*o),i=0,s=0,l=0;l<o;l++)r[s++]=a[i++],r[s++]=a[i++],r[s++]=a[i++],r[s++]=255,i++;return r}function n(){var t;return s!==a?(i.height=e.naturalHeight,i.width=e.naturalWidth,t=i.getContext("2d"),t.drawImage(e,0,0),s=a):t=i.getContext("2d"),t.getImageData(0,0,e.naturalWidth,e.naturalHeight)}function r(){if(s===a)return i;i.height=e.naturalHeight,i.width=e.naturalWidth;var t=i.getContext("2d");return t.drawImage(e,0,0),s=a,i}function l(){return e}var c=e.naturalHeight,u=e.naturalWidth;return{imageId:a,minPixelValue:0,maxPixelValue:255,slope:1,intercept:0,windowCenter:128,windowWidth:255,render:t.renderColorImage,getPixelData:o,getImageData:n,getCanvas:r,getImage:l,rows:c,columns:u,height:c,width:u,color:!0,columnPixelSpacing:void 0,rowPixelSpacing:void 0,invert:!1,sizeInBytes:c*u*4}}function n(a){var n=e.Deferred(),r=new Image,i=new XMLHttpRequest;return i.open("GET",a,!0),i.responseType="arraybuffer",l.beforeSend(i),i.onload=function(){var e=new Uint8Array(this.response),t=new Blob([e],{type:"image/jpeg"}),i=window.URL||window.webkitURL,s=i.createObjectURL(t);r.src=s,r.onload=function(){var e=o(r,a);n.resolve(e),i.revokeObjectURL(s)},r.onerror=function(){i.revokeObjectURL(s),n.reject()}},i.onprogress=function(o){if(o.lengthComputable){var n=o.loaded,r=o.total,i=Math.round(n/r*100);e(t).trigger("CornerstoneImageLoadProgress",{imageId:a,loaded:n,total:r,percentComplete:i})}},i.send(),n.promise()}function r(e){l=e}var i=document.createElement("canvas"),s="",l={beforeSend:function(){function e(e){}return e}()};return t.registerImageLoader("http",n),t.registerImageLoader("https",n),a.configure=r,t}($,cornerstone,cornerstoneWebImageLoader)}},"routes.js":["meteor/meteor","meteor/iron:router","meteor/ohif:core",function(e,t,a){var o;a.import("meteor/meteor",{Meteor:function(e){o=e}});var n;a.import("meteor/iron:router",{Router:function(e){n=e}});var r;a.import("meteor/ohif:core",{OHIF:function(e){r=e}}),o.isClient&&(r.log.info("Disconnecting from the Meteor server"),o.disconnect(),n.configure({loadingTemplate:"loading"}),n.onBeforeAction("loading"),n.route("/:id",{action:function(){function e(){var e=this.params.id;e||(e="testId");var t=new XMLHttpRequest;t.addEventListener("error",function(){r.log.warn("An error occurred while retrieving the JSON data")});var a=this;t.addEventListener("load",function(){if(!this.responseText)return void r.log.warn("Response was undefined");r.log.info(JSON.stringify(this.responseText,null,2));var e=JSON.parse(this.responseText),t={studies:e.studies,contentId:"standalone"};a.render("standaloneViewer",{data:function(){function e(){return t}return e}()})}),r.log.info("Sending Request to: /api/"+e),t.open("GET","/api/"+e),t.send(),this.next()}return e}()})),o.isServer&&n.route("/api/:id",{where:"server"}).get(function(){var e=this.params.id,t=RequestStudies.findOne({transactionId:e});this.response.setHeader("Content-Type","application/json"),this.response.setHeader("Access-Control-Allow-Origin","*"),this.response.setHeader("Access-Control-Allow-Headers","Origin, X-Requested-With, Content-Type, Accept"),t?this.response.write(JSON.stringify(t)):this.response.write("No Data Found"),this.response.end()})}]},{extensions:[".js",".json",".html",".styl"]});require("./client/components/flexboxLayout/template.flexboxLayout.js"),require("./client/components/standaloneViewer/template.standaloneViewer.js"),require("./client/components/standaloneViewerMain/template.standaloneViewerMain.js"),require("./client/components/toolbarSection/template.toolbarSection.js"),require("./client/components/viewer/template.viewer.js"),require("./client/components/flexboxLayout/flexboxLayout.js"),require("./client/components/standaloneViewerMain/standaloneViewerMain.js"),require("./client/components/toolbarSection/toolbarSection.js"),require("./client/components/viewer/viewer.js"),require("./client/config.js"),require("./client/cornerstoneWebImageLoader.js"),require("./routes.js");
!function(){var e=Package.meteor.Meteor,r=Package.meteor.global,a=Package.meteor.meteorEnv,t=Package.check.check,n=Package.check.Match,i=Package.modules.meteorInstall,o=Package.modules.Buffer,c=Package.modules.process,l=Package["ecmascript-runtime"].Symbol,s=Package["ecmascript-runtime"].Map,u=Package["ecmascript-runtime"].Set,m=Package["babel-runtime"].meteorBabelHelpers,d=Package.promise.Promise,g,k=i({node_modules:{meteor:{"mdg:validation-error":{"validation-error.js":["babel-runtime/helpers/classCallCheck","babel-runtime/helpers/possibleConstructorReturn","babel-runtime/helpers/inherits",function(r,a,i){var o;i.import("babel-runtime/helpers/classCallCheck",{default:function(e){o=e}});var c;i.import("babel-runtime/helpers/possibleConstructorReturn",{default:function(e){c=e}});var l;i.import("babel-runtime/helpers/inherits",{default:function(e){l=e}});var s=[n.ObjectIncluding({name:String,type:String})];g=function(r){function a(e){var n,i,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.DEFAULT_MESSAGE;return o(this,a),t(e,s),t(l,String),i=n=c(this,r.call(this,g.ERROR_CODE,l,e)),c(n,i)}return l(a,r),a.is=function(){function r(r){return r instanceof e.Error&&r.error===g.ERROR_CODE}return r}(),a}(e.Error),g.ERROR_CODE="validation-error",g.DEFAULT_MESSAGE="Validation failed"}]}}}},{extensions:[".js",".json"]});k("./node_modules/meteor/mdg:validation-error/validation-error.js"),"undefined"==typeof Package&&(Package={}),function(e,r){for(var a in r)a in e||(e[a]=r[a])}(Package["mdg:validation-error"]={},{ValidationError:g})}();
!function(){var e=Package.meteor.Meteor,o=Package.meteor.global,n=Package.meteor.meteorEnv,i=Package["accounts-base"].Accounts,r=Package.mongo.Mongo,t;(function(){"undefined"==typeof t&&(t={}),t.configurations=new r.Collection("meteor_accounts_loginServiceConfiguration",{_preventAutopublish:!0,connection:e.isClient?i.connection:e.connection}),t.ConfigError=function(o){e.isClient&&!i.loginServicesConfigured()?this.message="Login service configuration not yet loaded":o?this.message="Service "+o+" not configured":this.message="Service not configured"},t.ConfigError.prototype=new Error,t.ConfigError.prototype.name="ServiceConfiguration.ConfigError"}).call(this),"undefined"==typeof Package&&(Package={}),function(e,o){for(var n in o)n in e||(e[n]=o[n])}(Package["service-configuration"]={},{ServiceConfiguration:t})}();