window.Modernizr=function(a,b,c){function z(a){j.cssText=a}function A(a,b){return z(m.join(a+";")+(b||""))}function B(a,b){return typeof a===b}function C(a,b){return!!~(""+a).indexOf(b)}function D(a,b){for(var d in a){var e=a[d];if(!C(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function E(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:B(f,"function")?f.bind(d||b):f}return!1}function F(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1);var e=(a+" "+o.join(d+" ")+d).split(" ");return B(b,
"string")||B(b,"undefined")?D(e,b):(e=(a+" "+p.join(d+" ")+d).split(" "),E(e,b,c))}var d="2.8.3";var e={};var f=!0;var g=b.documentElement;var h="modernizr";var i=b.createElement(h);var j=i.style;var k;var l={}.toString;var m=" -webkit- -moz- -o- -ms- ".split(" ");var n="Webkit Moz O ms";var o=n.split(" ");var p=n.toLowerCase().split(" ");var q={};var r={};var s={};var t=[];var u=t.slice;var v;var w=function(a,c,d,e){var f;var i;var j;var k;var l=b.createElement("div");var m=b.body;var n=m||b.createElement("body");
if(parseInt(d,10))for(;d--;)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["\x26#173;",'\x3cstyle id\x3d"s',h,'"\x3e',a,"\x3c/style\x3e"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i};var x={}.hasOwnProperty;var y;!B(x,"undefined")&&!B(x.call,"undefined")?y=function(a,
b){return x.call(a,b)}:y=function(a,b){return b in a&&B(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=u.call(arguments,1);var e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a;var g=c.apply(f,d.concat(u.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(u.call(arguments)))};return e}),q.touch=function(){var c;return"ontouchstart"in
a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:w(["@media (",m.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},q.backgroundsize=function(){return F("backgroundSize")},q.cssanimations=function(){return F("animationName")},q.csstransforms=function(){return!!F("transform")},q.csstransforms3d=function(){var a=!!F("perspective");return a&&"webkitPerspective"in g.style&&w("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",
function(b,c){a=b.offsetLeft===9&&b.offsetHeight===3}),a},q.csstransitions=function(){return F("transition")};for(var G in q)y(q,G)&&(v=G.toLowerCase(),e[v]=q[G](),t.push((e[v]?"":"no-")+v));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)y(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},z(""),i=k=null,function(a$$1,b$$0){function l(a,b){var c=a.createElement("p");
var d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x\x3cstyle\x3e"+b+"\x3c/style\x3e",d.insertBefore(c.lastChild,d.firstChild)}function m(){var a=s.elements;return typeof a=="string"?a.split(" "):a}function n(a){var b=j[a[h]];return b||(b={},i++,a[h]=i,j[i]=b),b}function o(a,c,d){c||(c=b$$0);if(k)return c.createElement(a);d||(d=n(c));var g;return d.cache[a]?g=d.cache[a].cloneNode():f$$0.test(a)?g=(d.cache[a]=d.createElem(a)).cloneNode():g=d.createElem(a),g.canHaveChildren&&
!e$$0.test(a)&&!g.tagUrn?d.frag.appendChild(g):g}function p(a,c){a||(a=b$$0);if(k)return a.createDocumentFragment();c=c||n(a);var d=c.frag.cloneNode();var e=0;var f=m();for(var g=f.length;e<g;e++)d.createElement(f[e]);return d}function q(a$$0,b){b.cache||(b.cache={},b.createElem=a$$0.createElement,b.createFrag=a$$0.createDocumentFragment,b.frag=b.createFrag()),a$$0.createElement=function(c){return s.shivMethods?o(c,a$$0,b):b.createElem(c)},a$$0.createDocumentFragment=Function("h,f","return function(){var n\x3df.cloneNode(),c\x3dn.createElement;h.shivMethods\x26\x26("+
m().join().replace(/[\w\-]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(s,b.frag)}function r(a){a||(a=b$$0);var c=n(a);return s.shivCSS&&!g$$0&&!c.hasCSS&&(c.hasCSS=!!l(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),k||q(a,c),a}var c$$0="3.7.0";var d$$0=a$$1.html5||{};var e$$0=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;var f$$0=
/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;var g$$0;var h="_html5shiv";var i=0;var j={};var k;(function(){try{var a$$0=b$$0.createElement("a");a$$0.innerHTML="\x3cxyz\x3e\x3c/xyz\x3e",g$$0="hidden"in a$$0,k=a$$0.childNodes.length==1||function(){b$$0.createElement("a");var a=b$$0.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){g$$0=
!0,k=!0}})();var s={elements:d$$0.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:c$$0,shivCSS:d$$0.shivCSS!==!1,supportsUnknownElements:k,shivMethods:d$$0.shivMethods!==!1,type:"default",shivDocument:r,createElement:o,createDocumentFragment:p};a$$1.html5=s,r(b$$0)}(this,b),e._version=d,e._prefixes=m,e._domPrefixes=p,e._cssomPrefixes=o,e.testProp=function(a){return D([a])},
e.testAllProps=F,e.testStyles=w,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+t.join(" "):""),e}(this,this.document),function(a$$3,b$$2,c$$2){function d$$1(a){return"[object Function]"==o$$0.call(a)}function e$$0(a){return"string"==typeof a}function f$$0(){}function g$$1(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h$$1(){var a=p.shift();q=1,a?a.t?m$$0(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h$$1()):q=0}function i$$1(a,
c,d$$0,e,f,i,j){function k(b){if(!o&&g$$1(l.readyState)&&(u.r=o=1,!q&&h$$1(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m$$0(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}j=j||B.errorTimeout;var l=b$$2.createElement(a);var o=0;var r=0;var u={t:d$$0,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||
2===y[c]?(t.insertBefore(l,s?null:n$$0),m$$0(k,j)):y[c].push(l))}function j$$1(a,b,c,d,f){return q=0,b=b||"j",e$$0(a)?i$$1("c"==b?v:u$$0,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h$$1()),this}function k$$0(){var a=B;return a.loader={load:j$$1,i:0},a}var l$$1=b$$2.documentElement;var m$$0=a$$3.setTimeout;var n$$0=b$$2.getElementsByTagName("script")[0];var o$$0={}.toString;var p=[];var q=0;var r$$0="MozAppearance"in l$$1.style;var s=r$$0&&!!b$$2.createRange().compareNode;var t=s?l$$1:
n$$0.parentNode;l$$1=a$$3.opera&&"[object Opera]"==o$$0.call(a$$3.opera);l$$1=!!b$$2.attachEvent&&!l$$1;var u$$0=r$$0?"object":l$$1?"script":"img";var v=l$$1?"script":u$$0;var w=Array.isArray||function(a){return"[object Array]"==o$$0.call(a)};var x=[];var y={};var z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}};var A;var B;B=function(a$$2){function b$$1(a){a=a.split("!");var b=x.length;var c=a.pop();var d=a.length;c={url:c,origUrl:c,prefixes:a};var e;var f;var g;for(f=0;f<d;f++)g=a[f].split("\x3d"),
(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g$$0(a,e,f,g,h){var i=b$$1(a);var j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d$$1(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c$$2,i.noexec,i.attrs,i.timeout),(d$$1(e)||d$$1(j))&&f.load(function(){k$$0(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,
h,g),y[i.url]=2})))}function h$$0(a$$1,b$$0){function c$$1(a$$0,c$$0){if(a$$0)if(e$$0(a$$0))c$$0||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g$$0(a$$0,j,b$$0,0,h);else{if(Object(a$$0)===a$$0)for(n in m=function(){var b=0;for(var c in a$$0)a$$0.hasOwnProperty(c)&&b++;return b}(),a$$0)a$$0.hasOwnProperty(n)&&(!c$$0&&!--m&&(d$$1(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,
b),l()}}(k[n])),g$$0(a$$0[n],j,b$$0,n,h))}else!c$$0&&l()}var h=!!a$$1.test;var i=a$$1.load||a$$1.both;var j=a$$1.callback||f$$0;var k=j;var l=a$$1.complete||f$$0;var m;var n;c$$1(h?a$$1.yep:a$$1.nope,!!i),i&&c$$1(i)}var i$$0;var j$$0;var l$$0=this.yepnope.loader;if(e$$0(a$$2))g$$0(a$$2,0,l$$0,0);else if(w(a$$2))for(i$$0=0;i$$0<a$$2.length;i$$0++)j$$0=a$$2[i$$0],e$$0(j$$0)?g$$0(j$$0,0,l$$0,0):w(j$$0)?B(j$$0):Object(j$$0)===j$$0&&h$$0(j$$0,l$$0);else Object(a$$2)===a$$2&&h$$0(a$$2,l$$0)},B.addPrefix=
function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1E4,null==b$$2.readyState&&b$$2.addEventListener&&(b$$2.readyState="loading",b$$2.addEventListener("DOMContentLoaded",A=function(){b$$2.removeEventListener("DOMContentLoaded",A,0),b$$2.readyState="complete"},0)),a$$3.yepnope=k$$0(),a$$3.yepnope.executeStack=h$$1,a$$3.yepnope.injectJs=function(a,c,d,e,i,j){var k=b$$2.createElement("script");var l;var o;e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h$$1:c||f$$0,
k.onreadystatechange=k.onload=function(){!l&&g$$1(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m$$0(function(){l||(l=1,c(1))},e),i?k.onload():n$$0.parentNode.insertBefore(k,n$$0)},a$$3.yepnope.injectCss=function(a,c,d,e,g,i){e=b$$2.createElement("link");var j;c=i?h$$1:c||f$$0;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n$$0.parentNode.insertBefore(e,n$$0),m$$0(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,
0))};
window.matchMedia||(window.matchMedia=function(){var styleMedia=window.styleMedia||window.media;if(!styleMedia){var style=document.createElement("style");var script=document.getElementsByTagName("script")[0];var info=null;style.type="text/css";style.id="matchmediajs-test";script.parentNode.insertBefore(style,script);info="getComputedStyle"in window&&window.getComputedStyle(style,null)||style.currentStyle;styleMedia={matchMedium:function(media){var text="@media "+media+"{ #matchmediajs-test { width: 1px; } }";
if(style.styleSheet)style.styleSheet.cssText=text;else style.textContent=text;return info.width==="1px"}}}return function(media){return{matches:styleMedia.matchMedium(media||"all"),media:media||"all"}}}());
(function(){if(window.matchMedia&&window.matchMedia("all").addListener)return false;var localMatchMedia=window.matchMedia;var hasMediaQueries=localMatchMedia("only all").matches;var isListening=false;var timeoutID=0;var queries=[];var handleChange=function(evt){clearTimeout(timeoutID);timeoutID=setTimeout(function(){var i=0;for(var il=queries.length;i<il;i++){var mql=queries[i].mql;var listeners=queries[i].listeners||[];var matches=localMatchMedia(mql.media).matches;if(matches!==mql.matches){mql.matches=
matches;var j=0;for(var jl=listeners.length;j<jl;j++)listeners[j].call(window,mql)}}},30)};window.matchMedia=function(media){var mql=localMatchMedia(media);var listeners=[];var index=0;mql.addListener=function(listener){if(!hasMediaQueries)return;if(!isListening){isListening=true;window.addEventListener("resize",handleChange,true)}if(index===0)index=queries.push({mql:mql,listeners:listeners});listeners.push(listener)};mql.removeListener=function(listener){var i=0;for(var il=listeners.length;i<il;i++)if(listeners[i]===
listener)listeners.splice(i,1)};return mql}})();
(function(root,factory){root.Handlebars3=factory()})(this,function(){var __module3__=function(){function escapeChar(chr){return escape[chr]}function extend(obj){for(var i=1;i<arguments.length;i++)for(var key in arguments[i])if(Object.prototype.hasOwnProperty.call(arguments[i],key))obj[key]=arguments[i][key];return obj}function indexOf(array,value){var i=0;for(var len=array.length;i<len;i++)if(array[i]===value)return i;return-1}function escapeExpression(string){if(string&&string.toHTML)return string.toHTML();
else if(string==null)return"";else if(!string)return string+"";string=""+string;if(!possible.test(string))return string;return string.replace(badChars,escapeChar)}function isEmpty(value){if(!value&&value!==0)return true;else if(isArray(value)&&value.length===0)return true;else return false}function blockParams(params,ids){params.path=ids;return params}function appendContextPath(contextPath,id){return(contextPath?contextPath+".":"")+id}var __exports__={};var escape={"\x26":"\x26amp;","\x3c":"\x26lt;",
"\x3e":"\x26gt;",'"':"\x26quot;","'":"\x26#x27;","`":"\x26#x60;"};var badChars=/[&<>"'`]/g;var possible=/[&<>"'`]/;__exports__.extend=extend;var toString=Object.prototype.toString;__exports__.toString=toString;var isFunction=function(value){return typeof value==="function"};if(isFunction(/x/))isFunction=function(value){return typeof value==="function"&&toString.call(value)==="[object Function]"};__exports__.isFunction=isFunction;var isArray=Array.isArray||function(value){return value&&typeof value===
"object"?toString.call(value)==="[object Array]":false};__exports__.isArray=isArray;__exports__.indexOf=indexOf;__exports__.escapeExpression=escapeExpression;__exports__.isEmpty=isEmpty;__exports__.blockParams=blockParams;__exports__.appendContextPath=appendContextPath;return __exports__}();var __module4__=function(){function Exception(message,node){var loc=node&&node.loc;var line;var column;if(loc){line=loc.start.line;column=loc.start.column;message+=" - "+line+":"+column}var tmp=Error.prototype.constructor.call(this,
message);for(var idx=0;idx<errorProps.length;idx++)this[errorProps[idx]]=tmp[errorProps[idx]];if(loc){this.lineNumber=line;this.column=column}}var __exports__;var errorProps=["description","fileName","lineNumber","message","name","number","stack"];Exception.prototype=new Error;__exports__=Exception;return __exports__}();var __module2__=function(__dependency1__,__dependency2__){function HandlebarsEnvironment(helpers,partials){this.helpers=helpers||{};this.partials=partials||{};registerDefaultHelpers(this)}
function registerDefaultHelpers(instance){instance.registerHelper("helperMissing",function(){if(arguments.length===1)return undefined;else throw new Exception("Missing helper: '"+arguments[arguments.length-1].name+"'");});instance.registerHelper("blockHelperMissing",function(context,options){var inverse=options.inverse;var fn=options.fn;if(context===true)return fn(this);else if(context===false||context==null)return inverse(this);else if(isArray(context))if(context.length>0){if(options.ids)options.ids=
[options.name];return instance.helpers.each(context,options)}else return inverse(this);else{if(options.data&&options.ids){var data=createFrame(options.data);data.contextPath=Utils.appendContextPath(options.data.contextPath,options.name);options={data:data}}return fn(context,options)}});instance.registerHelper("each",function(context,options){function execIteration(key,i,last){if(data){data.key=key;data.index=i;data.first=i===0;data.last=!!last;if(contextPath)data.contextPath=contextPath+key}ret=ret+
fn(context[key],{data:data,blockParams:Utils.blockParams([context[key],key],[contextPath+key,null])})}if(!options)throw new Exception("Must pass iterator to #each");var fn=options.fn;var inverse=options.inverse;var i$$0=0;var ret="";var data;var contextPath;if(options.data&&options.ids)contextPath=Utils.appendContextPath(options.data.contextPath,options.ids[0])+".";if(isFunction(context))context=context.call(this);if(options.data)data=createFrame(options.data);if(context&&typeof context==="object")if(isArray(context))for(var j=
context.length;i$$0<j;i$$0++)execIteration(i$$0,i$$0,i$$0===context.length-1);else{var priorKey;for(var key$$0 in context)if(context.hasOwnProperty(key$$0)){if(priorKey)execIteration(priorKey,i$$0-1);priorKey=key$$0;i$$0++}if(priorKey)execIteration(priorKey,i$$0-1,true)}if(i$$0===0)ret=inverse(this);return ret});instance.registerHelper("if",function(conditional,options){if(isFunction(conditional))conditional=conditional.call(this);if(!options.hash.includeZero&&!conditional||Utils.isEmpty(conditional))return options.inverse(this);
else return options.fn(this)});instance.registerHelper("unless",function(conditional,options){return instance.helpers["if"].call(this,conditional,{fn:options.inverse,inverse:options.fn,hash:options.hash})});instance.registerHelper("with",function(context,options){if(isFunction(context))context=context.call(this);var fn=options.fn;if(!Utils.isEmpty(context)){if(options.data&&options.ids){var data=createFrame(options.data);data.contextPath=Utils.appendContextPath(options.data.contextPath,options.ids[0]);
options={data:data}}return fn(context,options)}else return options.inverse(this)});instance.registerHelper("log",function(message,options){var level=options.data&&options.data.level!=null?parseInt(options.data.level,10):1;instance.log(level,message)});instance.registerHelper("lookup",function(obj,field){return obj&&obj[field]})}var __exports__={};var Utils=__dependency1__;var Exception=__dependency2__;var VERSION="3.0.0";__exports__.VERSION=VERSION;var COMPILER_REVISION=6;__exports__.COMPILER_REVISION=
COMPILER_REVISION;var REVISION_CHANGES={1:"\x3c\x3d 1.0.rc.2",2:"\x3d\x3d 1.0.0-rc.3",3:"\x3d\x3d 1.0.0-rc.4",4:"\x3d\x3d 1.x.x",5:"\x3d\x3d 2.0.0-alpha.x",6:"\x3e\x3d 2.0.0-beta.1"};__exports__.REVISION_CHANGES=REVISION_CHANGES;var isArray=Utils.isArray;var isFunction=Utils.isFunction;var toString=Utils.toString;var objectType="[object Object]";__exports__.HandlebarsEnvironment=HandlebarsEnvironment;HandlebarsEnvironment.prototype={constructor:HandlebarsEnvironment,logger:logger,log:log,registerHelper:function(name,
fn){if(toString.call(name)===objectType){if(fn)throw new Exception("Arg not supported with multiple helpers");Utils.extend(this.helpers,name)}else this.helpers[name]=fn},unregisterHelper:function(name){delete this.helpers[name]},registerPartial:function(name,partial){if(toString.call(name)===objectType)Utils.extend(this.partials,name);else{if(typeof partial==="undefined")throw new Exception("Attempting to register a partial as undefined");this.partials[name]=partial}},unregisterPartial:function(name){delete this.partials[name]}};
var logger={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:1,log:function(level,message){if(typeof console!=="undefined"&&logger.level<=level){var method=logger.methodMap[level];(console[method]||console.log).call(console,message)}}};__exports__.logger=logger;var log=logger.log;__exports__.log=log;var createFrame=function(object){var frame=Utils.extend({},object);frame._parent=object;return frame};__exports__.createFrame=createFrame;return __exports__}(__module3__,
__module4__);var __module5__=function(){function SafeString(string){this.string=string}var __exports__;SafeString.prototype.toString=SafeString.prototype.toHTML=function(){return""+this.string};__exports__=SafeString;return __exports__}();var __module6__=function(__dependency1__,__dependency2__,__dependency3__){function checkRevision(compilerInfo){var compilerRevision=compilerInfo&&compilerInfo[0]||1;var currentRevision=COMPILER_REVISION;if(compilerRevision!==currentRevision)if(compilerRevision<currentRevision){var runtimeVersions=
REVISION_CHANGES[currentRevision];var compilerVersions=REVISION_CHANGES[compilerRevision];throw new Exception("Template was precompiled with an older version of Handlebars than the current runtime. "+"Please update your precompiler to a newer version ("+runtimeVersions+") or downgrade your runtime to an older version ("+compilerVersions+").");}else throw new Exception("Template was precompiled with a newer version of Handlebars than the current runtime. "+"Please update your runtime to a newer version ("+
compilerInfo[1]+").");}function template(templateSpec,env){if(!env)throw new Exception("No environment passed to template");if(!templateSpec||!templateSpec.main)throw new Exception("Unknown template object: "+typeof templateSpec);env.VM.checkRevision(templateSpec.compiler);var invokePartialWrapper=function(partial,context,options){if(options.hash)context=Utils.extend({},context,options.hash);partial=env.VM.resolvePartial.call(this,partial,context,options);var result=env.VM.invokePartial.call(this,
partial,context,options);if(result==null&&env.compile){options.partials[options.name]=env.compile(partial,templateSpec.compilerOptions,env);result=options.partials[options.name](context,options)}if(result!=null){if(options.indent){var lines=result.split("\n");var i=0;for(var l=lines.length;i<l;i++){if(!lines[i]&&i+1===l)break;lines[i]=options.indent+lines[i]}result=lines.join("\n")}return result}else throw new Exception("The partial "+options.name+" could not be compiled when running in runtime-only mode");
};var container={strict:function(obj,name){if(!(name in obj))throw new Exception('"'+name+'" not defined in '+obj);return obj[name]},lookup:function(depths,name){var len=depths.length;for(var i=0;i<len;i++)if(depths[i]&&depths[i][name]!=null)return depths[i][name]},lambda:function(current,context){return typeof current==="function"?current.call(context):current},escapeExpression:Utils.escapeExpression,invokePartial:invokePartialWrapper,fn:function(i){return templateSpec[i]},programs:[],program:function(i,
data,declaredBlockParams,blockParams,depths){var programWrapper=this.programs[i];var fn=this.fn(i);if(data||depths||blockParams||declaredBlockParams)programWrapper=program(this,i,fn,data,declaredBlockParams,blockParams,depths);else if(!programWrapper)programWrapper=this.programs[i]=program(this,i,fn);return programWrapper},data:function(data,depth){for(;data&&depth--;)data=data._parent;return data},merge:function(param,common){var ret=param||common;if(param&&common&&param!==common)ret=Utils.extend({},
common,param);return ret},noop:env.VM.noop,compilerInfo:templateSpec.compiler};var ret$$0=function(context,options){options=options||{};var data=options.data;ret$$0._setup(options);if(!options.partial&&templateSpec.useData)data=initData(context,data);var depths;var blockParams=templateSpec.useBlockParams?[]:undefined;if(templateSpec.useDepths)depths=options.depths?[context].concat(options.depths):[context];return templateSpec.main.call(container,context,container.helpers,container.partials,data,blockParams,
depths)};ret$$0.isTop=true;ret$$0._setup=function(options){if(!options.partial){container.helpers=container.merge(options.helpers,env.helpers);if(templateSpec.usePartial)container.partials=container.merge(options.partials,env.partials)}else{container.helpers=options.helpers;container.partials=options.partials}};ret$$0._child=function(i,data,blockParams,depths){if(templateSpec.useBlockParams&&!blockParams)throw new Exception("must pass block params");if(templateSpec.useDepths&&!depths)throw new Exception("must pass parent depths");
return program(container,i,templateSpec[i],data,0,blockParams,depths)};return ret$$0}function program(container,i,fn,data,declaredBlockParams,blockParams,depths){var prog=function(context,options){options=options||{};return fn.call(container,context,container.helpers,container.partials,options.data||data,blockParams&&[options.blockParams].concat(blockParams),depths&&[context].concat(depths))};prog.program=i;prog.depth=depths?depths.length:0;prog.blockParams=declaredBlockParams||0;return prog}function resolvePartial(partial,
context,options){if(!partial)partial=options.partials[options.name];else if(!partial.call&&!options.name){options.name=partial;partial=options.partials[partial]}return partial}function invokePartial(partial,context,options){options.partial=true;if(partial===undefined)throw new Exception("The partial "+options.name+" could not be found");else if(partial instanceof Function)return partial(context,options)}function noop(){return""}function initData(context,data){if(!data||!("root"in data)){data=data?
createFrame(data):{};data.root=context}return data}var __exports__={};var Utils=__dependency1__;var Exception=__dependency2__;var COMPILER_REVISION=__dependency3__.COMPILER_REVISION;var REVISION_CHANGES=__dependency3__.REVISION_CHANGES;var createFrame=__dependency3__.createFrame;__exports__.checkRevision=checkRevision;__exports__.template=template;__exports__.program=program;__exports__.resolvePartial=resolvePartial;__exports__.invokePartial=invokePartial;__exports__.noop=noop;return __exports__}(__module3__,
__module4__,__module2__);var __module1__=function(__dependency1__,__dependency2__,__dependency3__,__dependency4__,__dependency5__){var __exports__;var base=__dependency1__;var SafeString=__dependency2__;var Exception=__dependency3__;var Utils=__dependency4__;var runtime=__dependency5__;var create=function(){var hb=new base.HandlebarsEnvironment;Utils.extend(hb,base);hb.SafeString=SafeString;hb.Exception=Exception;hb.Utils=Utils;hb.escapeExpression=Utils.escapeExpression;hb.VM=runtime;hb.template=
function(spec){return runtime.template(spec,hb)};return hb};var Handlebars=create();Handlebars.create=create;var root=typeof global!=="undefined"?global:window;var $Handlebars=root.Handlebars;Handlebars.noConflict=function(){if(root.Handlebars===Handlebars)root.Handlebars=$Handlebars};Handlebars["default"]=Handlebars;__exports__=Handlebars;return __exports__}(__module2__,__module5__,__module4__,__module3__,__module6__);var __module7__=function(){var __exports__;var AST={Program:function(statements,
blockParams,strip,locInfo){this.loc=locInfo;this.type="Program";this.body=statements;this.blockParams=blockParams;this.strip=strip},MustacheStatement:function(path,params,hash,escaped,strip,locInfo){this.loc=locInfo;this.type="MustacheStatement";this.path=path;this.params=params||[];this.hash=hash;this.escaped=escaped;this.strip=strip},BlockStatement:function(path,params,hash,program,inverse,openStrip,inverseStrip,closeStrip,locInfo){this.loc=locInfo;this.type="BlockStatement";this.path=path;this.params=
params||[];this.hash=hash;this.program=program;this.inverse=inverse;this.openStrip=openStrip;this.inverseStrip=inverseStrip;this.closeStrip=closeStrip},PartialStatement:function(name,params,hash,strip,locInfo){this.loc=locInfo;this.type="PartialStatement";this.name=name;this.params=params||[];this.hash=hash;this.indent="";this.strip=strip},ContentStatement:function(string,locInfo){this.loc=locInfo;this.type="ContentStatement";this.original=this.value=string},CommentStatement:function(comment,strip,
locInfo){this.loc=locInfo;this.type="CommentStatement";this.value=comment;this.strip=strip},SubExpression:function(path,params,hash,locInfo){this.loc=locInfo;this.type="SubExpression";this.path=path;this.params=params||[];this.hash=hash},PathExpression:function(data,depth,parts,original,locInfo){this.loc=locInfo;this.type="PathExpression";this.data=data;this.original=original;this.parts=parts;this.depth=depth},StringLiteral:function(string,locInfo){this.loc=locInfo;this.type="StringLiteral";this.original=
this.value=string},NumberLiteral:function(number,locInfo){this.loc=locInfo;this.type="NumberLiteral";this.original=this.value=Number(number)},BooleanLiteral:function(bool,locInfo){this.loc=locInfo;this.type="BooleanLiteral";this.original=this.value=bool==="true"},Hash:function(pairs,locInfo){this.loc=locInfo;this.type="Hash";this.pairs=pairs},HashPair:function(key,value,locInfo){this.loc=locInfo;this.type="HashPair";this.key=key;this.value=value},helpers:{helperExpression:function(node){return!!(node.type===
"SubExpression"||node.params.length||node.hash)},scopedId:function(path){return/^\.|this\b/.test(path.original)},simpleId:function(path){return path.parts.length===1&&!AST.helpers.scopedId(path)&&!path.depth}}};__exports__=AST;return __exports__}();var __module9__=function(){var __exports__;var handlebars=function(){function Parser(){this.yy={}}var parser={trace:function trace(){},yy:{},symbols_:{"error":2,"root":3,"program":4,"EOF":5,"program_repetition0":6,"statement":7,"mustache":8,"block":9,"rawBlock":10,
"partial":11,"content":12,"COMMENT":13,"CONTENT":14,"openRawBlock":15,"END_RAW_BLOCK":16,"OPEN_RAW_BLOCK":17,"helperName":18,"openRawBlock_repetition0":19,"openRawBlock_option0":20,"CLOSE_RAW_BLOCK":21,"openBlock":22,"block_option0":23,"closeBlock":24,"openInverse":25,"block_option1":26,"OPEN_BLOCK":27,"openBlock_repetition0":28,"openBlock_option0":29,"openBlock_option1":30,"CLOSE":31,"OPEN_INVERSE":32,"openInverse_repetition0":33,"openInverse_option0":34,"openInverse_option1":35,"openInverseChain":36,
"OPEN_INVERSE_CHAIN":37,"openInverseChain_repetition0":38,"openInverseChain_option0":39,"openInverseChain_option1":40,"inverseAndProgram":41,"INVERSE":42,"inverseChain":43,"inverseChain_option0":44,"OPEN_ENDBLOCK":45,"OPEN":46,"mustache_repetition0":47,"mustache_option0":48,"OPEN_UNESCAPED":49,"mustache_repetition1":50,"mustache_option1":51,"CLOSE_UNESCAPED":52,"OPEN_PARTIAL":53,"partialName":54,"partial_repetition0":55,"partial_option0":56,"param":57,"sexpr":58,"OPEN_SEXPR":59,"sexpr_repetition0":60,
"sexpr_option0":61,"CLOSE_SEXPR":62,"hash":63,"hash_repetition_plus0":64,"hashSegment":65,"ID":66,"EQUALS":67,"blockParams":68,"OPEN_BLOCK_PARAMS":69,"blockParams_repetition_plus0":70,"CLOSE_BLOCK_PARAMS":71,"path":72,"dataName":73,"STRING":74,"NUMBER":75,"BOOLEAN":76,"DATA":77,"pathSegments":78,"SEP":79,"$accept":0,"$end":1},terminals_:{2:"error",5:"EOF",13:"COMMENT",14:"CONTENT",16:"END_RAW_BLOCK",17:"OPEN_RAW_BLOCK",21:"CLOSE_RAW_BLOCK",27:"OPEN_BLOCK",31:"CLOSE",32:"OPEN_INVERSE",37:"OPEN_INVERSE_CHAIN",
42:"INVERSE",45:"OPEN_ENDBLOCK",46:"OPEN",49:"OPEN_UNESCAPED",52:"CLOSE_UNESCAPED",53:"OPEN_PARTIAL",59:"OPEN_SEXPR",62:"CLOSE_SEXPR",66:"ID",67:"EQUALS",69:"OPEN_BLOCK_PARAMS",71:"CLOSE_BLOCK_PARAMS",74:"STRING",75:"NUMBER",76:"BOOLEAN",77:"DATA",79:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[12,1],[10,3],[15,5],[9,4],[9,4],[22,6],[25,6],[36,6],[41,2],[43,3],[43,1],[24,3],[8,5],[8,5],[11,5],[57,1],[57,1],[58,5],[63,1],[65,3],[68,3],[18,1],[18,1],[18,1],[18,1],[18,1],[54,
1],[54,1],[73,2],[72,1],[78,3],[78,1],[6,0],[6,2],[19,0],[19,2],[20,0],[20,1],[23,0],[23,1],[26,0],[26,1],[28,0],[28,2],[29,0],[29,1],[30,0],[30,1],[33,0],[33,2],[34,0],[34,1],[35,0],[35,1],[38,0],[38,2],[39,0],[39,1],[40,0],[40,1],[44,0],[44,1],[47,0],[47,2],[48,0],[48,1],[50,0],[50,2],[51,0],[51,1],[55,0],[55,2],[56,0],[56,1],[60,0],[60,2],[61,0],[61,1],[64,1],[64,2],[70,1],[70,2]],performAction:function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$){var $0=$$.length-1;switch(yystate){case 1:return $$[$0-
1];break;case 2:this.$=new yy.Program($$[$0],null,{},yy.locInfo(this._$));break;case 3:this.$=$$[$0];break;case 4:this.$=$$[$0];break;case 5:this.$=$$[$0];break;case 6:this.$=$$[$0];break;case 7:this.$=$$[$0];break;case 8:this.$=new yy.CommentStatement(yy.stripComment($$[$0]),yy.stripFlags($$[$0],$$[$0]),yy.locInfo(this._$));break;case 9:this.$=new yy.ContentStatement($$[$0],yy.locInfo(this._$));break;case 10:this.$=yy.prepareRawBlock($$[$0-2],$$[$0-1],$$[$0],this._$);break;case 11:this.$={path:$$[$0-
3],params:$$[$0-2],hash:$$[$0-1]};break;case 12:this.$=yy.prepareBlock($$[$0-3],$$[$0-2],$$[$0-1],$$[$0],false,this._$);break;case 13:this.$=yy.prepareBlock($$[$0-3],$$[$0-2],$$[$0-1],$$[$0],true,this._$);break;case 14:this.$={path:$$[$0-4],params:$$[$0-3],hash:$$[$0-2],blockParams:$$[$0-1],strip:yy.stripFlags($$[$0-5],$$[$0])};break;case 15:this.$={path:$$[$0-4],params:$$[$0-3],hash:$$[$0-2],blockParams:$$[$0-1],strip:yy.stripFlags($$[$0-5],$$[$0])};break;case 16:this.$={path:$$[$0-4],params:$$[$0-
3],hash:$$[$0-2],blockParams:$$[$0-1],strip:yy.stripFlags($$[$0-5],$$[$0])};break;case 17:this.$={strip:yy.stripFlags($$[$0-1],$$[$0-1]),program:$$[$0]};break;case 18:var inverse=yy.prepareBlock($$[$0-2],$$[$0-1],$$[$0],$$[$0],false,this._$);var program=new yy.Program([inverse],null,{},yy.locInfo(this._$));program.chained=true;this.$={strip:$$[$0-2].strip,program:program,chain:true};break;case 19:this.$=$$[$0];break;case 20:this.$={path:$$[$0-1],strip:yy.stripFlags($$[$0-2],$$[$0])};break;case 21:this.$=
yy.prepareMustache($$[$0-3],$$[$0-2],$$[$0-1],$$[$0-4],yy.stripFlags($$[$0-4],$$[$0]),this._$);break;case 22:this.$=yy.prepareMustache($$[$0-3],$$[$0-2],$$[$0-1],$$[$0-4],yy.stripFlags($$[$0-4],$$[$0]),this._$);break;case 23:this.$=new yy.PartialStatement($$[$0-3],$$[$0-2],$$[$0-1],yy.stripFlags($$[$0-4],$$[$0]),yy.locInfo(this._$));break;case 24:this.$=$$[$0];break;case 25:this.$=$$[$0];break;case 26:this.$=new yy.SubExpression($$[$0-3],$$[$0-2],$$[$0-1],yy.locInfo(this._$));break;case 27:this.$=
new yy.Hash($$[$0],yy.locInfo(this._$));break;case 28:this.$=new yy.HashPair($$[$0-2],$$[$0],yy.locInfo(this._$));break;case 29:this.$=$$[$0-1];break;case 30:this.$=$$[$0];break;case 31:this.$=$$[$0];break;case 32:this.$=new yy.StringLiteral($$[$0],yy.locInfo(this._$));break;case 33:this.$=new yy.NumberLiteral($$[$0],yy.locInfo(this._$));break;case 34:this.$=new yy.BooleanLiteral($$[$0],yy.locInfo(this._$));break;case 35:this.$=$$[$0];break;case 36:this.$=$$[$0];break;case 37:this.$=yy.preparePath(true,
$$[$0],this._$);break;case 38:this.$=yy.preparePath(false,$$[$0],this._$);break;case 39:$$[$0-2].push({part:$$[$0],separator:$$[$0-1]});this.$=$$[$0-2];break;case 40:this.$=[{part:$$[$0]}];break;case 41:this.$=[];break;case 42:$$[$0-1].push($$[$0]);break;case 43:this.$=[];break;case 44:$$[$0-1].push($$[$0]);break;case 51:this.$=[];break;case 52:$$[$0-1].push($$[$0]);break;case 57:this.$=[];break;case 58:$$[$0-1].push($$[$0]);break;case 63:this.$=[];break;case 64:$$[$0-1].push($$[$0]);break;case 71:this.$=
[];break;case 72:$$[$0-1].push($$[$0]);break;case 75:this.$=[];break;case 76:$$[$0-1].push($$[$0]);break;case 79:this.$=[];break;case 80:$$[$0-1].push($$[$0]);break;case 83:this.$=[];break;case 84:$$[$0-1].push($$[$0]);break;case 87:this.$=[$$[$0]];break;case 88:$$[$0-1].push($$[$0]);break;case 89:this.$=[$$[$0]];break;case 90:$$[$0-1].push($$[$0]);break}},table:[{3:1,4:2,5:[2,41],6:3,13:[2,41],14:[2,41],17:[2,41],27:[2,41],32:[2,41],46:[2,41],49:[2,41],53:[2,41]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,
9:7,10:8,11:9,12:10,13:[1,11],14:[1,18],15:16,17:[1,21],22:14,25:15,27:[1,19],32:[1,20],37:[2,2],42:[2,2],45:[2,2],46:[1,12],49:[1,13],53:[1,17]},{1:[2,1]},{5:[2,42],13:[2,42],14:[2,42],17:[2,42],27:[2,42],32:[2,42],37:[2,42],42:[2,42],45:[2,42],46:[2,42],49:[2,42],53:[2,42]},{5:[2,3],13:[2,3],14:[2,3],17:[2,3],27:[2,3],32:[2,3],37:[2,3],42:[2,3],45:[2,3],46:[2,3],49:[2,3],53:[2,3]},{5:[2,4],13:[2,4],14:[2,4],17:[2,4],27:[2,4],32:[2,4],37:[2,4],42:[2,4],45:[2,4],46:[2,4],49:[2,4],53:[2,4]},{5:[2,
5],13:[2,5],14:[2,5],17:[2,5],27:[2,5],32:[2,5],37:[2,5],42:[2,5],45:[2,5],46:[2,5],49:[2,5],53:[2,5]},{5:[2,6],13:[2,6],14:[2,6],17:[2,6],27:[2,6],32:[2,6],37:[2,6],42:[2,6],45:[2,6],46:[2,6],49:[2,6],53:[2,6]},{5:[2,7],13:[2,7],14:[2,7],17:[2,7],27:[2,7],32:[2,7],37:[2,7],42:[2,7],45:[2,7],46:[2,7],49:[2,7],53:[2,7]},{5:[2,8],13:[2,8],14:[2,8],17:[2,8],27:[2,8],32:[2,8],37:[2,8],42:[2,8],45:[2,8],46:[2,8],49:[2,8],53:[2,8]},{18:22,66:[1,30],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,29],78:28},
{18:31,66:[1,30],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,29],78:28},{4:32,6:3,13:[2,41],14:[2,41],17:[2,41],27:[2,41],32:[2,41],37:[2,41],42:[2,41],45:[2,41],46:[2,41],49:[2,41],53:[2,41]},{4:33,6:3,13:[2,41],14:[2,41],17:[2,41],27:[2,41],32:[2,41],42:[2,41],45:[2,41],46:[2,41],49:[2,41],53:[2,41]},{12:34,14:[1,18]},{18:36,54:35,58:37,59:[1,38],66:[1,30],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,29],78:28},{5:[2,9],13:[2,9],14:[2,9],16:[2,9],17:[2,9],27:[2,9],32:[2,9],37:[2,9],42:[2,
9],45:[2,9],46:[2,9],49:[2,9],53:[2,9]},{18:39,66:[1,30],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,29],78:28},{18:40,66:[1,30],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,29],78:28},{18:41,66:[1,30],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,29],78:28},{31:[2,71],47:42,59:[2,71],66:[2,71],74:[2,71],75:[2,71],76:[2,71],77:[2,71]},{21:[2,30],31:[2,30],52:[2,30],59:[2,30],62:[2,30],66:[2,30],69:[2,30],74:[2,30],75:[2,30],76:[2,30],77:[2,30]},{21:[2,31],31:[2,31],52:[2,31],59:[2,31],62:[2,
31],66:[2,31],69:[2,31],74:[2,31],75:[2,31],76:[2,31],77:[2,31]},{21:[2,32],31:[2,32],52:[2,32],59:[2,32],62:[2,32],66:[2,32],69:[2,32],74:[2,32],75:[2,32],76:[2,32],77:[2,32]},{21:[2,33],31:[2,33],52:[2,33],59:[2,33],62:[2,33],66:[2,33],69:[2,33],74:[2,33],75:[2,33],76:[2,33],77:[2,33]},{21:[2,34],31:[2,34],52:[2,34],59:[2,34],62:[2,34],66:[2,34],69:[2,34],74:[2,34],75:[2,34],76:[2,34],77:[2,34]},{21:[2,38],31:[2,38],52:[2,38],59:[2,38],62:[2,38],66:[2,38],69:[2,38],74:[2,38],75:[2,38],76:[2,38],
77:[2,38],79:[1,43]},{66:[1,30],78:44},{21:[2,40],31:[2,40],52:[2,40],59:[2,40],62:[2,40],66:[2,40],69:[2,40],74:[2,40],75:[2,40],76:[2,40],77:[2,40],79:[2,40]},{50:45,52:[2,75],59:[2,75],66:[2,75],74:[2,75],75:[2,75],76:[2,75],77:[2,75]},{23:46,36:48,37:[1,50],41:49,42:[1,51],43:47,45:[2,47]},{26:52,41:53,42:[1,51],45:[2,49]},{16:[1,54]},{31:[2,79],55:55,59:[2,79],66:[2,79],74:[2,79],75:[2,79],76:[2,79],77:[2,79]},{31:[2,35],59:[2,35],66:[2,35],74:[2,35],75:[2,35],76:[2,35],77:[2,35]},{31:[2,36],
59:[2,36],66:[2,36],74:[2,36],75:[2,36],76:[2,36],77:[2,36]},{18:56,66:[1,30],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,29],78:28},{28:57,31:[2,51],59:[2,51],66:[2,51],69:[2,51],74:[2,51],75:[2,51],76:[2,51],77:[2,51]},{31:[2,57],33:58,59:[2,57],66:[2,57],69:[2,57],74:[2,57],75:[2,57],76:[2,57],77:[2,57]},{19:59,21:[2,43],59:[2,43],66:[2,43],74:[2,43],75:[2,43],76:[2,43],77:[2,43]},{18:63,31:[2,73],48:60,57:61,58:64,59:[1,38],63:62,64:65,65:66,66:[1,67],72:23,73:24,74:[1,25],75:[1,26],76:[1,
27],77:[1,29],78:28},{66:[1,68]},{21:[2,37],31:[2,37],52:[2,37],59:[2,37],62:[2,37],66:[2,37],69:[2,37],74:[2,37],75:[2,37],76:[2,37],77:[2,37],79:[1,43]},{18:63,51:69,52:[2,77],57:70,58:64,59:[1,38],63:71,64:65,65:66,66:[1,67],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,29],78:28},{24:72,45:[1,73]},{45:[2,48]},{4:74,6:3,13:[2,41],14:[2,41],17:[2,41],27:[2,41],32:[2,41],37:[2,41],42:[2,41],45:[2,41],46:[2,41],49:[2,41],53:[2,41]},{45:[2,19]},{18:75,66:[1,30],72:23,73:24,74:[1,25],75:[1,26],76:[1,
27],77:[1,29],78:28},{4:76,6:3,13:[2,41],14:[2,41],17:[2,41],27:[2,41],32:[2,41],45:[2,41],46:[2,41],49:[2,41],53:[2,41]},{24:77,45:[1,73]},{45:[2,50]},{5:[2,10],13:[2,10],14:[2,10],17:[2,10],27:[2,10],32:[2,10],37:[2,10],42:[2,10],45:[2,10],46:[2,10],49:[2,10],53:[2,10]},{18:63,31:[2,81],56:78,57:79,58:64,59:[1,38],63:80,64:65,65:66,66:[1,67],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,29],78:28},{59:[2,83],60:81,62:[2,83],66:[2,83],74:[2,83],75:[2,83],76:[2,83],77:[2,83]},{18:63,29:82,31:[2,
53],57:83,58:64,59:[1,38],63:84,64:65,65:66,66:[1,67],69:[2,53],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,29],78:28},{18:63,31:[2,59],34:85,57:86,58:64,59:[1,38],63:87,64:65,65:66,66:[1,67],69:[2,59],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,29],78:28},{18:63,20:88,21:[2,45],57:89,58:64,59:[1,38],63:90,64:65,65:66,66:[1,67],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,29],78:28},{31:[1,91]},{31:[2,72],59:[2,72],66:[2,72],74:[2,72],75:[2,72],76:[2,72],77:[2,72]},{31:[2,74]},{21:[2,24],
31:[2,24],52:[2,24],59:[2,24],62:[2,24],66:[2,24],69:[2,24],74:[2,24],75:[2,24],76:[2,24],77:[2,24]},{21:[2,25],31:[2,25],52:[2,25],59:[2,25],62:[2,25],66:[2,25],69:[2,25],74:[2,25],75:[2,25],76:[2,25],77:[2,25]},{21:[2,27],31:[2,27],52:[2,27],62:[2,27],65:92,66:[1,93],69:[2,27]},{21:[2,87],31:[2,87],52:[2,87],62:[2,87],66:[2,87],69:[2,87]},{21:[2,40],31:[2,40],52:[2,40],59:[2,40],62:[2,40],66:[2,40],67:[1,94],69:[2,40],74:[2,40],75:[2,40],76:[2,40],77:[2,40],79:[2,40]},{21:[2,39],31:[2,39],52:[2,
39],59:[2,39],62:[2,39],66:[2,39],69:[2,39],74:[2,39],75:[2,39],76:[2,39],77:[2,39],79:[2,39]},{52:[1,95]},{52:[2,76],59:[2,76],66:[2,76],74:[2,76],75:[2,76],76:[2,76],77:[2,76]},{52:[2,78]},{5:[2,12],13:[2,12],14:[2,12],17:[2,12],27:[2,12],32:[2,12],37:[2,12],42:[2,12],45:[2,12],46:[2,12],49:[2,12],53:[2,12]},{18:96,66:[1,30],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,29],78:28},{36:48,37:[1,50],41:49,42:[1,51],43:98,44:97,45:[2,69]},{31:[2,63],38:99,59:[2,63],66:[2,63],69:[2,63],74:[2,63],
75:[2,63],76:[2,63],77:[2,63]},{45:[2,17]},{5:[2,13],13:[2,13],14:[2,13],17:[2,13],27:[2,13],32:[2,13],37:[2,13],42:[2,13],45:[2,13],46:[2,13],49:[2,13],53:[2,13]},{31:[1,100]},{31:[2,80],59:[2,80],66:[2,80],74:[2,80],75:[2,80],76:[2,80],77:[2,80]},{31:[2,82]},{18:63,57:102,58:64,59:[1,38],61:101,62:[2,85],63:103,64:65,65:66,66:[1,67],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,29],78:28},{30:104,31:[2,55],68:105,69:[1,106]},{31:[2,52],59:[2,52],66:[2,52],69:[2,52],74:[2,52],75:[2,52],76:[2,52],
77:[2,52]},{31:[2,54],69:[2,54]},{31:[2,61],35:107,68:108,69:[1,106]},{31:[2,58],59:[2,58],66:[2,58],69:[2,58],74:[2,58],75:[2,58],76:[2,58],77:[2,58]},{31:[2,60],69:[2,60]},{21:[1,109]},{21:[2,44],59:[2,44],66:[2,44],74:[2,44],75:[2,44],76:[2,44],77:[2,44]},{21:[2,46]},{5:[2,21],13:[2,21],14:[2,21],17:[2,21],27:[2,21],32:[2,21],37:[2,21],42:[2,21],45:[2,21],46:[2,21],49:[2,21],53:[2,21]},{21:[2,88],31:[2,88],52:[2,88],62:[2,88],66:[2,88],69:[2,88]},{67:[1,94]},{18:63,57:110,58:64,59:[1,38],66:[1,
30],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,29],78:28},{5:[2,22],13:[2,22],14:[2,22],17:[2,22],27:[2,22],32:[2,22],37:[2,22],42:[2,22],45:[2,22],46:[2,22],49:[2,22],53:[2,22]},{31:[1,111]},{45:[2,18]},{45:[2,70]},{18:63,31:[2,65],39:112,57:113,58:64,59:[1,38],63:114,64:65,65:66,66:[1,67],69:[2,65],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,29],78:28},{5:[2,23],13:[2,23],14:[2,23],17:[2,23],27:[2,23],32:[2,23],37:[2,23],42:[2,23],45:[2,23],46:[2,23],49:[2,23],53:[2,23]},{62:[1,115]},{59:[2,
84],62:[2,84],66:[2,84],74:[2,84],75:[2,84],76:[2,84],77:[2,84]},{62:[2,86]},{31:[1,116]},{31:[2,56]},{66:[1,118],70:117},{31:[1,119]},{31:[2,62]},{14:[2,11]},{21:[2,28],31:[2,28],52:[2,28],62:[2,28],66:[2,28],69:[2,28]},{5:[2,20],13:[2,20],14:[2,20],17:[2,20],27:[2,20],32:[2,20],37:[2,20],42:[2,20],45:[2,20],46:[2,20],49:[2,20],53:[2,20]},{31:[2,67],40:120,68:121,69:[1,106]},{31:[2,64],59:[2,64],66:[2,64],69:[2,64],74:[2,64],75:[2,64],76:[2,64],77:[2,64]},{31:[2,66],69:[2,66]},{21:[2,26],31:[2,26],
52:[2,26],59:[2,26],62:[2,26],66:[2,26],69:[2,26],74:[2,26],75:[2,26],76:[2,26],77:[2,26]},{13:[2,14],14:[2,14],17:[2,14],27:[2,14],32:[2,14],37:[2,14],42:[2,14],45:[2,14],46:[2,14],49:[2,14],53:[2,14]},{66:[1,123],71:[1,122]},{66:[2,89],71:[2,89]},{13:[2,15],14:[2,15],17:[2,15],27:[2,15],32:[2,15],42:[2,15],45:[2,15],46:[2,15],49:[2,15],53:[2,15]},{31:[1,124]},{31:[2,68]},{31:[2,29]},{66:[2,90],71:[2,90]},{13:[2,16],14:[2,16],17:[2,16],27:[2,16],32:[2,16],37:[2,16],42:[2,16],45:[2,16],46:[2,16],
49:[2,16],53:[2,16]}],defaultActions:{4:[2,1],47:[2,48],49:[2,19],53:[2,50],62:[2,74],71:[2,78],76:[2,17],80:[2,82],90:[2,46],97:[2,18],98:[2,70],103:[2,86],105:[2,56],108:[2,62],109:[2,11],121:[2,68],122:[2,29]},parseError:function parseError(str,hash){throw new Error(str);},parse:function parse(input){function popStack(n){stack.length=stack.length-2*n;vstack.length=vstack.length-n;lstack.length=lstack.length-n}function lex(){var token;token=self.lexer.lex()||1;if(typeof token!=="number")token=self.symbols_[token]||
token;return token}var self=this;var stack=[0];var vstack=[null];var lstack=[];var table=this.table;var yytext="";var yylineno=0;var yyleng=0;var recovering=0;var TERROR=2;var EOF=1;this.lexer.setInput(input);this.lexer.yy=this.yy;this.yy.lexer=this.lexer;this.yy.parser=this;if(typeof this.lexer.yylloc=="undefined")this.lexer.yylloc={};var yyloc=this.lexer.yylloc;lstack.push(yyloc);var ranges=this.lexer.options&&this.lexer.options.ranges;if(typeof this.yy.parseError==="function")this.parseError=this.yy.parseError;
var symbol;var preErrorSymbol;var state;var action;var a;var r;var yyval={};var p;var len;var newState;for(var expected;true;){state=stack[stack.length-1];if(this.defaultActions[state])action=this.defaultActions[state];else{if(symbol===null||typeof symbol=="undefined")symbol=lex();action=table[state]&&table[state][symbol]}if(typeof action==="undefined"||!action.length||!action[0]){var errStr="";if(!recovering){expected=[];for(p in table[state])if(this.terminals_[p]&&p>2)expected.push("'"+this.terminals_[p]+
"'");if(this.lexer.showPosition)errStr="Parse error on line "+(yylineno+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+expected.join(", ")+", got '"+(this.terminals_[symbol]||symbol)+"'";else errStr="Parse error on line "+(yylineno+1)+": Unexpected "+(symbol==1?"end of input":"'"+(this.terminals_[symbol]||symbol)+"'");this.parseError(errStr,{text:this.lexer.match,token:this.terminals_[symbol]||symbol,line:this.lexer.yylineno,loc:yyloc,expected:expected})}}if(action[0]instanceof Array&&action.length>
1)throw new Error("Parse Error: multiple actions possible at state: "+state+", token: "+symbol);switch(action[0]){case 1:stack.push(symbol);vstack.push(this.lexer.yytext);lstack.push(this.lexer.yylloc);stack.push(action[1]);symbol=null;if(!preErrorSymbol){yyleng=this.lexer.yyleng;yytext=this.lexer.yytext;yylineno=this.lexer.yylineno;yyloc=this.lexer.yylloc;if(recovering>0)recovering--}else{symbol=preErrorSymbol;preErrorSymbol=null}break;case 2:len=this.productions_[action[1]][1];yyval.$=vstack[vstack.length-
len];yyval._$={first_line:lstack[lstack.length-(len||1)].first_line,last_line:lstack[lstack.length-1].last_line,first_column:lstack[lstack.length-(len||1)].first_column,last_column:lstack[lstack.length-1].last_column};if(ranges)yyval._$.range=[lstack[lstack.length-(len||1)].range[0],lstack[lstack.length-1].range[1]];r=this.performAction.call(yyval,yytext,yyleng,yylineno,this.yy,action[1],vstack,lstack);if(typeof r!=="undefined")return r;if(len){stack=stack.slice(0,-1*len*2);vstack=vstack.slice(0,
-1*len);lstack=lstack.slice(0,-1*len)}stack.push(this.productions_[action[1]][0]);vstack.push(yyval.$);lstack.push(yyval._$);newState=table[stack[stack.length-2]][stack[stack.length-1]];stack.push(newState);break;case 3:return true}}return true}};var lexer=function(){var lexer={EOF:1,parseError:function parseError(str,hash){if(this.yy.parser)this.yy.parser.parseError(str,hash);else throw new Error(str);},setInput:function(input){this._input=input;this._more=this._less=this.done=false;this.yylineno=
this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges)this.yylloc.range=[0,0];this.offset=0;return this},input:function(){var ch=this._input[0];this.yytext+=ch;this.yyleng++;this.offset++;this.match+=ch;this.matched+=ch;var lines=ch.match(/(?:\r\n?|\n).*/g);if(lines){this.yylineno++;this.yylloc.last_line++}else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;
this._input=this._input.slice(1);return ch},unput:function(ch){var len=ch.length;var lines=ch.split(/(?:\r\n?|\n)/g);this._input=ch+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-len-1);this.offset-=len;var oldLines=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(lines.length-1)this.yylineno-=lines.length-1;var r=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+
1,first_column:this.yylloc.first_column,last_column:lines?(lines.length===oldLines.length?this.yylloc.first_column:0)+oldLines[oldLines.length-lines.length].length-lines[0].length:this.yylloc.first_column-len};if(this.options.ranges)this.yylloc.range=[r[0],r[0]+this.yyleng-len];return this},more:function(){this._more=true;return this},less:function(n){this.unput(this.match.slice(n))},pastInput:function(){var past=this.matched.substr(0,this.matched.length-this.match.length);return(past.length>20?"...":
"")+past.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var next=this.match;if(next.length<20)next+=this._input.substr(0,20-next.length);return(next.substr(0,20)+(next.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var pre=this.pastInput();var c=(new Array(pre.length+1)).join("-");return pre+this.upcomingInput()+"\n"+c+"^"},next:function(){if(this.done)return this.EOF;if(!this._input)this.done=true;var token;var match;var tempMatch;var index;var col;var lines;if(!this._more){this.yytext=
"";this.match=""}var rules=this._currentRules();for(var i=0;i<rules.length;i++){tempMatch=this._input.match(this.rules[rules[i]]);if(tempMatch&&(!match||tempMatch[0].length>match[0].length)){match=tempMatch;index=i;if(!this.options.flex)break}}if(match){lines=match[0].match(/(?:\r\n?|\n).*/g);if(lines)this.yylineno+=lines.length;this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:lines?lines[lines.length-1].length-lines[lines.length-
1].match(/\r?\n?/)[0].length:this.yylloc.last_column+match[0].length};this.yytext+=match[0];this.match+=match[0];this.matches=match;this.yyleng=this.yytext.length;if(this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];this._more=false;this._input=this._input.slice(match[0].length);this.matched+=match[0];token=this.performAction.call(this,this.yy,this,rules[index],this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input)this.done=false;if(token)return token;
else return}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function lex(){var r=this.next();if(typeof r!=="undefined")return r;else return this.lex()},begin:function begin(condition){this.conditionStack.push(condition)},popState:function popState(){return this.conditionStack.pop()},_currentRules:function _currentRules(){return this.conditions[this.conditionStack[this.conditionStack.length-
1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function begin(condition){this.begin(condition)}};lexer.options={};lexer.performAction=function anonymous(yy,yy_,$avoiding_name_collisions,YY_START){function strip(start,end){return yy_.yytext=yy_.yytext.substr(start,yy_.yyleng-end)}var YYSTATE=YY_START;switch($avoiding_name_collisions){case 0:if(yy_.yytext.slice(-2)==="\\\\"){strip(0,1);this.begin("mu")}else if(yy_.yytext.slice(-1)==="\\"){strip(0,
1);this.begin("emu")}else this.begin("mu");if(yy_.yytext)return 14;break;case 1:return 14;break;case 2:this.popState();return 14;break;case 3:yy_.yytext=yy_.yytext.substr(5,yy_.yyleng-9);this.popState();return 16;break;case 4:return 14;break;case 5:this.popState();return 13;break;case 6:return 59;break;case 7:return 62;break;case 8:return 17;break;case 9:this.popState();this.begin("raw");return 21;break;case 10:return 53;break;case 11:return 27;break;case 12:return 45;break;case 13:this.popState();
return 42;break;case 14:this.popState();return 42;break;case 15:return 32;break;case 16:return 37;break;case 17:return 49;break;case 18:return 46;break;case 19:this.unput(yy_.yytext);this.popState();this.begin("com");break;case 20:this.popState();return 13;break;case 21:return 46;break;case 22:return 67;break;case 23:return 66;break;case 24:return 66;break;case 25:return 79;break;case 26:break;case 27:this.popState();return 52;break;case 28:this.popState();return 31;break;case 29:yy_.yytext=strip(1,
2).replace(/\\"/g,'"');return 74;break;case 30:yy_.yytext=strip(1,2).replace(/\\'/g,"'");return 74;break;case 31:return 77;break;case 32:return 76;break;case 33:return 76;break;case 34:return 75;break;case 35:return 69;break;case 36:return 71;break;case 37:return 66;break;case 38:yy_.yytext=strip(1,2);return 66;break;case 39:return"INVALID";break;case 40:return 5;break}};lexer.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,
/^(?:[^\x00]*?(?=(\{\{\{\{\/)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,
/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/];lexer.conditions={"mu":{"rules":[6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40],"inclusive":false},"emu":{"rules":[2],"inclusive":false},"com":{"rules":[5],"inclusive":false},"raw":{"rules":[3,4],"inclusive":false},"INITIAL":{"rules":[0,
1,40],"inclusive":true}};return lexer}();parser.lexer=lexer;Parser.prototype=parser;parser.Parser=Parser;return new Parser}();__exports__=handlebars;return __exports__}();var __module11__=function(__dependency1__,__dependency2__){function Visitor(){this.parents=[]}var __exports__;var Exception=__dependency1__;var AST=__dependency2__;Visitor.prototype={constructor:Visitor,mutating:false,acceptKey:function(node,name){var value=this.accept(node[name]);if(this.mutating){if(value&&(!value.type||!AST[value.type]))throw new Exception('Unexpected node type "'+
value.type+'" found when accepting '+name+" on "+node.type);node[name]=value}},acceptRequired:function(node,name){this.acceptKey(node,name);if(!node[name])throw new Exception(node.type+" requires "+name);},acceptArray:function(array){var i=0;for(var l=array.length;i<l;i++){this.acceptKey(array,i);if(!array[i]){array.splice(i,1);i--;l--}}},accept:function(object){if(!object)return;if(this.current)this.parents.unshift(this.current);this.current=object;var ret=this[object.type](object);this.current=
this.parents.shift();if(!this.mutating||ret)return ret;else if(ret!==false)return object},Program:function(program){this.acceptArray(program.body)},MustacheStatement:function(mustache){this.acceptRequired(mustache,"path");this.acceptArray(mustache.params);this.acceptKey(mustache,"hash")},BlockStatement:function(block){this.acceptRequired(block,"path");this.acceptArray(block.params);this.acceptKey(block,"hash");this.acceptKey(block,"program");this.acceptKey(block,"inverse")},PartialStatement:function(partial){this.acceptRequired(partial,
"name");this.acceptArray(partial.params);this.acceptKey(partial,"hash")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:function(sexpr){this.acceptRequired(sexpr,"path");this.acceptArray(sexpr.params);this.acceptKey(sexpr,"hash")},PartialExpression:function(partial){this.acceptRequired(partial,"name");this.acceptArray(partial.params);this.acceptKey(partial,"hash")},PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},
Hash:function(hash){this.acceptArray(hash.pairs)},HashPair:function(pair){this.acceptRequired(pair,"value")}};__exports__=Visitor;return __exports__}(__module4__,__module7__);var __module10__=function(__dependency1__){function WhitespaceControl(){}function isPrevWhitespace(body,i,isRoot){if(i===undefined)i=body.length;var prev=body[i-1];var sibling=body[i-2];if(!prev)return isRoot;if(prev.type==="ContentStatement")return(sibling||!isRoot?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(prev.original)}function isNextWhitespace(body,
i,isRoot){if(i===undefined)i=-1;var next=body[i+1];var sibling=body[i+2];if(!next)return isRoot;if(next.type==="ContentStatement")return(sibling||!isRoot?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(next.original)}function omitRight(body,i,multiple){var current=body[i==null?0:i+1];if(!current||current.type!=="ContentStatement"||!multiple&&current.rightStripped)return;var original=current.value;current.value=current.value.replace(multiple?/^\s+/:/^[ \t]*\r?\n?/,"");current.rightStripped=current.value!==original}
function omitLeft(body,i,multiple){var current=body[i==null?body.length-1:i-1];if(!current||current.type!=="ContentStatement"||!multiple&&current.leftStripped)return;var original=current.value;current.value=current.value.replace(multiple?/\s+$/:/[ \t]+$/,"");current.leftStripped=current.value!==original;return current.leftStripped}var __exports__;var Visitor=__dependency1__;WhitespaceControl.prototype=new Visitor;WhitespaceControl.prototype.Program=function(program){var isRoot=!this.isRootSeen;this.isRootSeen=
true;var body=program.body;var i=0;for(var l=body.length;i<l;i++){var current=body[i];var strip=this.accept(current);if(!strip)continue;var _isPrevWhitespace=isPrevWhitespace(body,i,isRoot);var _isNextWhitespace=isNextWhitespace(body,i,isRoot);var openStandalone=strip.openStandalone&&_isPrevWhitespace;var closeStandalone=strip.closeStandalone&&_isNextWhitespace;var inlineStandalone=strip.inlineStandalone&&_isPrevWhitespace&&_isNextWhitespace;if(strip.close)omitRight(body,i,true);if(strip.open)omitLeft(body,
i,true);if(inlineStandalone){omitRight(body,i);if(omitLeft(body,i))if(current.type==="PartialStatement")current.indent=/([ \t]+$)/.exec(body[i-1].original)[1]}if(openStandalone){omitRight((current.program||current.inverse).body);omitLeft(body,i)}if(closeStandalone){omitRight(body,i);omitLeft((current.inverse||current.program).body)}}return program};WhitespaceControl.prototype.BlockStatement=function(block){this.accept(block.program);this.accept(block.inverse);var program=block.program||block.inverse;
var inverse=block.program&&block.inverse;var firstInverse=inverse;var lastInverse=inverse;if(inverse&&inverse.chained)for(firstInverse=inverse.body[0].program;lastInverse.chained;)lastInverse=lastInverse.body[lastInverse.body.length-1].program;var strip={open:block.openStrip.open,close:block.closeStrip.close,openStandalone:isNextWhitespace(program.body),closeStandalone:isPrevWhitespace((firstInverse||program).body)};if(block.openStrip.close)omitRight(program.body,null,true);if(inverse){var inverseStrip=
block.inverseStrip;if(inverseStrip.open)omitLeft(program.body,null,true);if(inverseStrip.close)omitRight(firstInverse.body,null,true);if(block.closeStrip.open)omitLeft(lastInverse.body,null,true);if(isPrevWhitespace(program.body)&&isNextWhitespace(firstInverse.body)){omitLeft(program.body);omitRight(firstInverse.body)}}else if(block.closeStrip.open)omitLeft(program.body,null,true);return strip};WhitespaceControl.prototype.MustacheStatement=function(mustache){return mustache.strip};WhitespaceControl.prototype.PartialStatement=
WhitespaceControl.prototype.CommentStatement=function(node){var strip=node.strip||{};return{inlineStandalone:true,open:strip.open,close:strip.close}};__exports__=WhitespaceControl;return __exports__}(__module11__);var __module12__=function(__dependency1__){function SourceLocation(source,locInfo){this.source=source;this.start={line:locInfo.first_line,column:locInfo.first_column};this.end={line:locInfo.last_line,column:locInfo.last_column}}function stripFlags(open,close){return{open:open.charAt(2)===
"~",close:close.charAt(close.length-3)==="~"}}function stripComment(comment){return comment.replace(/^\{\{~?\!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function preparePath(data,parts,locInfo){locInfo=this.locInfo(locInfo);var original=data?"@":"";var dig=[];var depth=0;var depthString="";var i=0;for(var l=parts.length;i<l;i++){var part=parts[i].part;original+=(parts[i].separator||"")+part;if(part===".."||part==="."||part==="this")if(dig.length>0)throw new Exception("Invalid path: "+original,{loc:locInfo});
else{if(part===".."){depth++;depthString+="../"}}else dig.push(part)}return new this.PathExpression(data,depth,dig,original,locInfo)}function prepareMustache(path,params,hash,open,strip,locInfo){var escapeFlag=open.charAt(3)||open.charAt(2);var escaped=escapeFlag!=="{"&&escapeFlag!=="\x26";return new this.MustacheStatement(path,params,hash,escaped,strip,this.locInfo(locInfo))}function prepareRawBlock(openRawBlock,content,close,locInfo){if(openRawBlock.path.original!==close){var errorNode={loc:openRawBlock.path.loc};
throw new Exception(openRawBlock.path.original+" doesn't match "+close,errorNode);}locInfo=this.locInfo(locInfo);var program=new this.Program([content],null,{},locInfo);return new this.BlockStatement(openRawBlock.path,openRawBlock.params,openRawBlock.hash,program,undefined,{},{},{},locInfo)}function prepareBlock(openBlock,program,inverseAndProgram,close,inverted,locInfo){if(close&&close.path&&openBlock.path.original!==close.path.original){var errorNode={loc:openBlock.path.loc};throw new Exception(openBlock.path.original+
" doesn't match "+close.path.original,errorNode);}program.blockParams=openBlock.blockParams;var inverse;var inverseStrip;if(inverseAndProgram){if(inverseAndProgram.chain)inverseAndProgram.program.body[0].closeStrip=close.strip;inverseStrip=inverseAndProgram.strip;inverse=inverseAndProgram.program}if(inverted){inverted=inverse;inverse=program;program=inverted}return new this.BlockStatement(openBlock.path,openBlock.params,openBlock.hash,program,inverse,openBlock.strip,inverseStrip,close&&close.strip,
this.locInfo(locInfo))}var __exports__={};var Exception=__dependency1__;__exports__.SourceLocation=SourceLocation;__exports__.stripFlags=stripFlags;__exports__.stripComment=stripComment;__exports__.preparePath=preparePath;__exports__.prepareMustache=prepareMustache;__exports__.prepareRawBlock=prepareRawBlock;__exports__.prepareBlock=prepareBlock;return __exports__}(__module4__);var __module8__=function(__dependency1__,__dependency2__,__dependency3__,__dependency4__,__dependency5__){function parse(input,
options){if(input.type==="Program")return input;parser.yy=yy;yy.locInfo=function(locInfo){return new yy.SourceLocation(options&&options.srcName,locInfo)};var strip=new WhitespaceControl;return strip.accept(parser.parse(input))}var __exports__={};var parser=__dependency1__;var AST=__dependency2__;var WhitespaceControl=__dependency3__;var Helpers=__dependency4__;var extend=__dependency5__.extend;__exports__.parser=parser;var yy={};extend(yy,Helpers,AST);__exports__.parse=parse;return __exports__}(__module9__,
__module7__,__module10__,__module12__,__module3__);var __module13__=function(__dependency1__,__dependency2__,__dependency3__){function Compiler(){}function precompile(input,options,env){if(input==null||typeof input!=="string"&&input.type!=="Program")throw new Exception("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+input);options=options||{};if(!("data"in options))options.data=true;if(options.compat)options.useDepths=true;var ast=env.parse(input,options);var environment=
(new env.Compiler).compile(ast,options);return(new env.JavaScriptCompiler).compile(environment,options)}function compile(input,options$$0,env){function compileInput(){var ast=env.parse(input,options$$0);var environment=(new env.Compiler).compile(ast,options$$0);var templateSpec=(new env.JavaScriptCompiler).compile(environment,options$$0,undefined,true);return env.template(templateSpec)}if(input==null||typeof input!=="string"&&input.type!=="Program")throw new Exception("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+
input);options$$0=options$$0||{};if(!("data"in options$$0))options$$0.data=true;if(options$$0.compat)options$$0.useDepths=true;var compiled;var ret=function(context,options){if(!compiled)compiled=compileInput();return compiled.call(this,context,options)};ret._setup=function(options){if(!compiled)compiled=compileInput();return compiled._setup(options)};ret._child=function(i,data,blockParams,depths){if(!compiled)compiled=compileInput();return compiled._child(i,data,blockParams,depths)};return ret}function argEquals(a,
b){if(a===b)return true;if(isArray(a)&&isArray(b)&&a.length===b.length){for(var i=0;i<a.length;i++)if(!argEquals(a[i],b[i]))return false;return true}}function transformLiteralToPath(sexpr){if(!sexpr.path.parts){var literal=sexpr.path;sexpr.path=new AST.PathExpression(false,0,[literal.original+""],literal.original+"",literal.log)}}var __exports__={};var Exception=__dependency1__;var isArray=__dependency2__.isArray;var indexOf=__dependency2__.indexOf;var AST=__dependency3__;var slice=[].slice;__exports__.Compiler=
Compiler;Compiler.prototype={compiler:Compiler,equals:function(other){var len=this.opcodes.length;if(other.opcodes.length!==len)return false;for(var i=0;i<len;i++){var opcode=this.opcodes[i];var otherOpcode=other.opcodes[i];if(opcode.opcode!==otherOpcode.opcode||!argEquals(opcode.args,otherOpcode.args))return false}len=this.children.length;for(i=0;i<len;i++)if(!this.children[i].equals(other.children[i]))return false;return true},guid:0,compile:function(program,options){this.sourceNode=[];this.opcodes=
[];this.children=[];this.options=options;this.stringParams=options.stringParams;this.trackIds=options.trackIds;options.blockParams=options.blockParams||[];var knownHelpers=options.knownHelpers;options.knownHelpers={"helperMissing":true,"blockHelperMissing":true,"each":true,"if":true,"unless":true,"with":true,"log":true,"lookup":true};if(knownHelpers)for(var name in knownHelpers)options.knownHelpers[name]=knownHelpers[name];return this.accept(program)},compileProgram:function(program){var result=(new this.compiler).compile(program,
this.options);var guid=this.guid++;this.usePartial=this.usePartial||result.usePartial;this.children[guid]=result;this.useDepths=this.useDepths||result.useDepths;return guid},accept:function(node){this.sourceNode.unshift(node);var ret=this[node.type](node);this.sourceNode.shift();return ret},Program:function(program){this.options.blockParams.unshift(program.blockParams);var body=program.body;var i=0;for(var l=body.length;i<l;i++)this.accept(body[i]);this.options.blockParams.shift();this.isSimple=l===
1;this.blockParams=program.blockParams?program.blockParams.length:0;return this},BlockStatement:function(block){transformLiteralToPath(block);var program=block.program;var inverse=block.inverse;program=program&&this.compileProgram(program);inverse=inverse&&this.compileProgram(inverse);var type=this.classifySexpr(block);if(type==="helper")this.helperSexpr(block,program,inverse);else if(type==="simple"){this.simpleSexpr(block);this.opcode("pushProgram",program);this.opcode("pushProgram",inverse);this.opcode("emptyHash");
this.opcode("blockValue",block.path.original)}else{this.ambiguousSexpr(block,program,inverse);this.opcode("pushProgram",program);this.opcode("pushProgram",inverse);this.opcode("emptyHash");this.opcode("ambiguousBlockValue")}this.opcode("append")},PartialStatement:function(partial){this.usePartial=true;var params=partial.params;if(params.length>1)throw new Exception("Unsupported number of partial arguments: "+params.length,partial);else if(!params.length)params.push({type:"PathExpression",parts:[],
depth:0});var partialName=partial.name.original;var isDynamic=partial.name.type==="SubExpression";if(isDynamic)this.accept(partial.name);this.setupFullMustacheParams(partial,undefined,undefined,true);var indent=partial.indent||"";if(this.options.preventIndent&&indent){this.opcode("appendContent",indent);indent=""}this.opcode("invokePartial",isDynamic,partialName,indent);this.opcode("append")},MustacheStatement:function(mustache){this.SubExpression(mustache);if(mustache.escaped&&!this.options.noEscape)this.opcode("appendEscaped");
else this.opcode("append")},ContentStatement:function(content){if(content.value)this.opcode("appendContent",content.value)},CommentStatement:function(){},SubExpression:function(sexpr){transformLiteralToPath(sexpr);var type=this.classifySexpr(sexpr);if(type==="simple")this.simpleSexpr(sexpr);else if(type==="helper")this.helperSexpr(sexpr);else this.ambiguousSexpr(sexpr)},ambiguousSexpr:function(sexpr,program,inverse){var path=sexpr.path;var name=path.parts[0];var isBlock=program!=null||inverse!=null;
this.opcode("getContext",path.depth);this.opcode("pushProgram",program);this.opcode("pushProgram",inverse);this.accept(path);this.opcode("invokeAmbiguous",name,isBlock)},simpleSexpr:function(sexpr){this.accept(sexpr.path);this.opcode("resolvePossibleLambda")},helperSexpr:function(sexpr,program,inverse){var params=this.setupFullMustacheParams(sexpr,program,inverse);var path=sexpr.path;var name=path.parts[0];if(this.options.knownHelpers[name])this.opcode("invokeKnownHelper",params.length,name);else if(this.options.knownHelpersOnly)throw new Exception("You specified knownHelpersOnly, but used the unknown helper "+
name,sexpr);else{path.falsy=true;this.accept(path);this.opcode("invokeHelper",params.length,path.original,AST.helpers.simpleId(path))}},PathExpression:function(path){this.addDepth(path.depth);this.opcode("getContext",path.depth);var name=path.parts[0];var scoped=AST.helpers.scopedId(path);var blockParamId=!path.depth&&!scoped&&this.blockParamIndex(name);if(blockParamId)this.opcode("lookupBlockParam",blockParamId,path.parts);else if(!name)this.opcode("pushContext");else if(path.data){this.options.data=
true;this.opcode("lookupData",path.depth,path.parts)}else this.opcode("lookupOnContext",path.parts,path.falsy,scoped)},StringLiteral:function(string){this.opcode("pushString",string.value)},NumberLiteral:function(number){this.opcode("pushLiteral",number.value)},BooleanLiteral:function(bool){this.opcode("pushLiteral",bool.value)},Hash:function(hash){var pairs=hash.pairs;var i;var l;this.opcode("pushHash");for(i=0,l=pairs.length;i<l;i++)this.pushParam(pairs[i].value);for(;i--;)this.opcode("assignToHash",
pairs[i].key);this.opcode("popHash")},opcode:function(name){this.opcodes.push({opcode:name,args:slice.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(depth){if(!depth)return;this.useDepths=true},classifySexpr:function(sexpr){var isSimple=AST.helpers.simpleId(sexpr.path);var isBlockParam=isSimple&&!!this.blockParamIndex(sexpr.path.parts[0]);var isHelper=!isBlockParam&&AST.helpers.helperExpression(sexpr);var isEligible=!isBlockParam&&(isHelper||isSimple);var options=this.options;if(isEligible&&
!isHelper){var name=sexpr.path.parts[0];if(options.knownHelpers[name])isHelper=true;else if(options.knownHelpersOnly)isEligible=false}if(isHelper)return"helper";else if(isEligible)return"ambiguous";else return"simple"},pushParams:function(params){var i=0;for(var l=params.length;i<l;i++)this.pushParam(params[i])},pushParam:function(val){var value=val.value!=null?val.value:val.original||"";if(this.stringParams){if(value.replace)value=value.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".");if(val.depth)this.addDepth(val.depth);
this.opcode("getContext",val.depth||0);this.opcode("pushStringParam",value,val.type);if(val.type==="SubExpression")this.accept(val)}else{if(this.trackIds){var blockParamIndex;if(val.parts&&!AST.helpers.scopedId(val)&&!val.depth)blockParamIndex=this.blockParamIndex(val.parts[0]);if(blockParamIndex){var blockParamChild=val.parts.slice(1).join(".");this.opcode("pushId","BlockParam",blockParamIndex,blockParamChild)}else{value=val.original||value;if(value.replace)value=value.replace(/^\.\//g,"").replace(/^\.$/g,
"");this.opcode("pushId",val.type,value)}}this.accept(val)}},setupFullMustacheParams:function(sexpr,program,inverse,omitEmpty){var params=sexpr.params;this.pushParams(params);this.opcode("pushProgram",program);this.opcode("pushProgram",inverse);if(sexpr.hash)this.accept(sexpr.hash);else this.opcode("emptyHash",omitEmpty);return params},blockParamIndex:function(name){var depth=0;for(var len=this.options.blockParams.length;depth<len;depth++){var blockParams=this.options.blockParams[depth];var param=
blockParams&&indexOf(blockParams,name);if(blockParams&&param>=0)return[depth,param]}}};__exports__.precompile=precompile;__exports__.compile=compile;return __exports__}(__module4__,__module3__,__module7__);var __module15__=function(__dependency1__){function castChunk(chunk,codeGen,loc){if(isArray(chunk)){var ret=[];var i=0;for(var len=chunk.length;i<len;i++)ret.push(codeGen.wrap(chunk[i],loc));return ret}else if(typeof chunk==="boolean"||typeof chunk==="number")return chunk+"";return chunk}function CodeGen(srcFile){this.srcFile=
srcFile;this.source=[]}var __exports__;var isArray=__dependency1__.isArray;try{var SourceMap=require("source-map");var SourceNode=SourceMap.SourceNode}catch(err){SourceNode=function(line,column,srcFile,chunks){this.src="";if(chunks)this.add(chunks)};SourceNode.prototype={add:function(chunks){if(isArray(chunks))chunks=chunks.join("");this.src+=chunks},prepend:function(chunks){if(isArray(chunks))chunks=chunks.join("");this.src=chunks+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},
toString:function(){return this.src}}}CodeGen.prototype={prepend:function(source,loc){this.source.unshift(this.wrap(source,loc))},push:function(source,loc){this.source.push(this.wrap(source,loc))},merge:function(){var source=this.empty();this.each(function(line){source.add(["  ",line,"\n"])});return source},each:function(iter){var i=0;for(var len=this.source.length;i<len;i++)iter(this.source[i])},empty:function(loc){loc=loc||this.currentLocation||{start:{}};return new SourceNode(loc.start.line,loc.start.column,
this.srcFile)},wrap:function(chunk,loc){if(chunk instanceof SourceNode)return chunk;loc=loc||this.currentLocation||{start:{}};chunk=castChunk(chunk,this,loc);return new SourceNode(loc.start.line,loc.start.column,this.srcFile,chunk)},functionCall:function(fn,type,params){params=this.generateList(params);return this.wrap([fn,type?"."+type+"(":"(",params,")"])},quotedString:function(str){return'"'+(str+"").replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,
"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(obj){var pairs=[];for(var key in obj)if(obj.hasOwnProperty(key)){var value=castChunk(obj[key],this);if(value!=="undefined")pairs.push([this.quotedString(key),":",value])}var ret=this.generateList(pairs);ret.prepend("{");ret.add("}");return ret},generateList:function(entries,loc){var ret=this.empty(loc);var i=0;for(var len=entries.length;i<len;i++){if(i)ret.add(",");ret.add(castChunk(entries[i],this,loc))}return ret},generateArray:function(entries,
loc){var ret=this.generateList(entries,loc);ret.prepend("[");ret.add("]");return ret}};__exports__=CodeGen;return __exports__}(__module3__);var __module14__=function(__dependency1__,__dependency2__,__dependency3__,__dependency4__){function Literal(value){this.value=value}function JavaScriptCompiler(){}function strictLookup(requireTerminal,compiler,parts,type){var stack=compiler.popStack();var i=0;var len=parts.length;if(requireTerminal)len--;for(;i<len;i++)stack=compiler.nameLookup(stack,parts[i],
type);if(requireTerminal)return[compiler.aliasable("this.strict"),"(",stack,", ",compiler.quotedString(parts[i]),")"];else return stack}var __exports__;var COMPILER_REVISION=__dependency1__.COMPILER_REVISION;var REVISION_CHANGES=__dependency1__.REVISION_CHANGES;var Exception=__dependency2__;var isArray=__dependency3__.isArray;var CodeGen=__dependency4__;JavaScriptCompiler.prototype={nameLookup:function(parent,name){if(JavaScriptCompiler.isValidJavaScriptVariableName(name))return[parent,".",name];
else return[parent,"['",name,"']"]},depthedLookup:function(name){return[this.aliasable("this.lookup"),'(depths, "',name,'")']},compilerInfo:function(){var revision=COMPILER_REVISION;var versions=REVISION_CHANGES[revision];return[revision,versions]},appendToBuffer:function(source,location,explicit){if(!isArray(source))source=[source];source=this.source.wrap(source,location);if(this.environment.isSimple)return["return ",source,";"];else if(explicit)return["buffer +\x3d ",source,";"];else{source.appendToBuffer=
true;return source}},initializeBuffer:function(){return this.quotedString("")},compile:function(environment,options,context,asObject){this.environment=environment;this.options=options;this.stringParams=this.options.stringParams;this.trackIds=this.options.trackIds;this.precompile=!asObject;this.name=this.environment.name;this.isChild=!!context;this.context=context||{programs:[],environments:[]};this.preamble();this.stackSlot=0;this.stackVars=[];this.aliases={};this.registers={list:[]};this.hashes=
[];this.compileStack=[];this.inlineStack=[];this.blockParams=[];this.compileChildren(environment,options);this.useDepths=this.useDepths||environment.useDepths||this.options.compat;this.useBlockParams=this.useBlockParams||environment.useBlockParams;var opcodes=environment.opcodes;var opcode;var firstLoc;var i;var l;for(i=0,l=opcodes.length;i<l;i++){opcode=opcodes[i];this.source.currentLocation=opcode.loc;firstLoc=firstLoc||opcode.loc;this[opcode.opcode].apply(this,opcode.args)}this.source.currentLocation=
firstLoc;this.pushSource("");if(this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new Exception("Compile completed with content left on stack");var fn=this.createFunctionContext(asObject);if(!this.isChild){var ret={compiler:this.compilerInfo(),main:fn};var programs=this.context.programs;for(i=0,l=programs.length;i<l;i++)if(programs[i])ret[i]=programs[i];if(this.environment.usePartial)ret.usePartial=true;if(this.options.data)ret.useData=true;if(this.useDepths)ret.useDepths=true;
if(this.useBlockParams)ret.useBlockParams=true;if(this.options.compat)ret.compat=true;if(!asObject){ret.compiler=JSON.stringify(ret.compiler);this.source.currentLocation={start:{line:1,column:0}};ret=this.objectLiteral(ret);if(options.srcName){ret=ret.toStringWithSourceMap({file:options.destName});ret.map=ret.map&&ret.map.toString()}else ret=ret.toString()}else ret.compilerOptions=this.options;return ret}else return fn},preamble:function(){this.lastContext=0;this.source=new CodeGen(this.options.srcName)},
createFunctionContext:function(asObject){var varDeclarations="";var locals=this.stackVars.concat(this.registers.list);if(locals.length>0)varDeclarations+=", "+locals.join(", ");var aliasCount=0;for(var alias in this.aliases){var node=this.aliases[alias];if(this.aliases.hasOwnProperty(alias)&&node.children&&node.referenceCount>1){varDeclarations+=", alias"+ ++aliasCount+"\x3d"+alias;node.children[0]="alias"+aliasCount}}var params=["depth0","helpers","partials","data"];if(this.useBlockParams||this.useDepths)params.push("blockParams");
if(this.useDepths)params.push("depths");var source=this.mergeSource(varDeclarations);if(asObject){params.push(source);return Function.apply(this,params)}else return this.source.wrap(["function(",params.join(","),") {\n  ",source,"}"])},mergeSource:function(varDeclarations){var isSimple=this.environment.isSimple;var appendOnly=!this.forceBuffer;var appendFirst;var sourceSeen;var bufferStart;var bufferEnd;this.source.each(function(line){if(line.appendToBuffer){if(bufferStart)line.prepend("  + ");else bufferStart=
line;bufferEnd=line}else{if(bufferStart){if(!sourceSeen)appendFirst=true;else bufferStart.prepend("buffer +\x3d ");bufferEnd.add(";");bufferStart=bufferEnd=undefined}sourceSeen=true;if(!isSimple)appendOnly=false}});if(appendOnly)if(bufferStart){bufferStart.prepend("return ");bufferEnd.add(";")}else{if(!sourceSeen)this.source.push('return "";')}else{varDeclarations+=", buffer \x3d "+(appendFirst?"":this.initializeBuffer());if(bufferStart){bufferStart.prepend("return buffer + ");bufferEnd.add(";")}else this.source.push("return buffer;")}if(varDeclarations)this.source.prepend("var "+
varDeclarations.substring(2)+(appendFirst?"":";\n"));return this.source.merge()},blockValue:function(name){var blockHelperMissing=this.aliasable("helpers.blockHelperMissing");var params=[this.contextName(0)];this.setupHelperArgs(name,0,params);var blockName=this.popStack();params.splice(1,0,blockName);this.push(this.source.functionCall(blockHelperMissing,"call",params))},ambiguousBlockValue:function(){var blockHelperMissing=this.aliasable("helpers.blockHelperMissing");var params=[this.contextName(0)];
this.setupHelperArgs("",0,params,true);this.flushInline();var current=this.topStack();params.splice(1,0,current);this.pushSource(["if (!",this.lastHelper,") { ",current," \x3d ",this.source.functionCall(blockHelperMissing,"call",params),"}"])},appendContent:function(content){if(this.pendingContent)content=this.pendingContent+content;else this.pendingLocation=this.source.currentLocation;this.pendingContent=content},append:function(){if(this.isInline()){this.replaceStack(function(current){return[" !\x3d null ? ",
current,' : ""']});this.pushSource(this.appendToBuffer(this.popStack()))}else{var local=this.popStack();this.pushSource(["if (",local," !\x3d null) { ",this.appendToBuffer(local,undefined,true)," }"]);if(this.environment.isSimple)this.pushSource(["else { ",this.appendToBuffer("''",undefined,true)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("this.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(depth){this.lastContext=depth},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},
lookupOnContext:function(parts,falsy,scoped){var i=0;if(!scoped&&this.options.compat&&!this.lastContext)this.push(this.depthedLookup(parts[i++]));else this.pushContext();this.resolvePath("context",parts,i,falsy)},lookupBlockParam:function(blockParamId,parts){this.useBlockParams=true;this.push(["blockParams[",blockParamId[0],"][",blockParamId[1],"]"]);this.resolvePath("context",parts,1)},lookupData:function(depth,parts){if(!depth)this.pushStackLiteral("data");else this.pushStackLiteral("this.data(data, "+
depth+")");this.resolvePath("data",parts,0,true)},resolvePath:function(type,parts,i,falsy){if(this.options.strict||this.options.assumeObjects){this.push(strictLookup(this.options.strict,this,parts,type));return}for(var len=parts.length;i<len;i++)this.replaceStack(function(current){var lookup=this.nameLookup(current,parts[i],type);if(!falsy)return[" !\x3d null ? ",lookup," : ",current];else return[" \x26\x26 ",lookup]})},resolvePossibleLambda:function(){this.push([this.aliasable("this.lambda"),"(",
this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(string,type){this.pushContext();this.pushString(type);if(type!=="SubExpression")if(typeof string==="string")this.pushString(string);else this.pushStackLiteral(string)},emptyHash:function(omitEmpty){if(this.trackIds)this.push("{}");if(this.stringParams){this.push("{}");this.push("{}")}this.pushStackLiteral(omitEmpty?"undefined":"{}")},pushHash:function(){if(this.hash)this.hashes.push(this.hash);this.hash={values:[],types:[],contexts:[],
ids:[]}},popHash:function(){var hash=this.hash;this.hash=this.hashes.pop();if(this.trackIds)this.push(this.objectLiteral(hash.ids));if(this.stringParams){this.push(this.objectLiteral(hash.contexts));this.push(this.objectLiteral(hash.types))}this.push(this.objectLiteral(hash.values))},pushString:function(string){this.pushStackLiteral(this.quotedString(string))},pushLiteral:function(value){this.pushStackLiteral(value)},pushProgram:function(guid){if(guid!=null)this.pushStackLiteral(this.programExpression(guid));
else this.pushStackLiteral(null)},invokeHelper:function(paramSize,name,isSimple){var nonHelper=this.popStack();var helper=this.setupHelper(paramSize,name);var simple=isSimple?[helper.name," || "]:"";var lookup=["("].concat(simple,nonHelper);if(!this.options.strict)lookup.push(" || ",this.aliasable("helpers.helperMissing"));lookup.push(")");this.push(this.source.functionCall(lookup,"call",helper.callParams))},invokeKnownHelper:function(paramSize,name){var helper=this.setupHelper(paramSize,name);this.push(this.source.functionCall(helper.name,
"call",helper.callParams))},invokeAmbiguous:function(name,helperCall){this.useRegister("helper");var nonHelper=this.popStack();this.emptyHash();var helper=this.setupHelper(0,name,helperCall);var helperName=this.lastHelper=this.nameLookup("helpers",name,"helper");var lookup=["(","(helper \x3d ",helperName," || ",nonHelper,")"];if(!this.options.strict){lookup[0]="(helper \x3d ";lookup.push(" !\x3d null ? helper : ",this.aliasable("helpers.helperMissing"))}this.push(["(",lookup,helper.paramsInit?["),(",
helper.paramsInit]:[],"),","(typeof helper \x3d\x3d\x3d ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",helper.callParams)," : helper))"])},invokePartial:function(isDynamic,name,indent){var params=[];var options=this.setupParams(name,1,params,false);if(isDynamic){name=this.popStack();delete options.name}if(indent)options.indent=JSON.stringify(indent);options.helpers="helpers";options.partials="partials";if(!isDynamic)params.unshift(this.nameLookup("partials",name,"partial"));
else params.unshift(name);if(this.options.compat)options.depths="depths";options=this.objectLiteral(options);params.push(options);this.push(this.source.functionCall("this.invokePartial","",params))},assignToHash:function(key){var value=this.popStack();var context;var type;var id;if(this.trackIds)id=this.popStack();if(this.stringParams){type=this.popStack();context=this.popStack()}var hash=this.hash;if(context)hash.contexts[key]=context;if(type)hash.types[key]=type;if(id)hash.ids[key]=id;hash.values[key]=
value},pushId:function(type,name,child){if(type==="BlockParam")this.pushStackLiteral("blockParams["+name[0]+"].path["+name[1]+"]"+(child?" + "+JSON.stringify("."+child):""));else if(type==="PathExpression")this.pushString(name);else if(type==="SubExpression")this.pushStackLiteral("true");else this.pushStackLiteral("null")},compiler:JavaScriptCompiler,compileChildren:function(environment,options){var children=environment.children;var child;var compiler;var i=0;for(var l=children.length;i<l;i++){child=
children[i];compiler=new this.compiler;var index=this.matchExistingProgram(child);if(index==null){this.context.programs.push("");index=this.context.programs.length;child.index=index;child.name="program"+index;this.context.programs[index]=compiler.compile(child,options,this.context,!this.precompile);this.context.environments[index]=child;this.useDepths=this.useDepths||compiler.useDepths;this.useBlockParams=this.useBlockParams||compiler.useBlockParams}else{child.index=index;child.name="program"+index;
this.useDepths=this.useDepths||child.useDepths;this.useBlockParams=this.useBlockParams||child.useBlockParams}}},matchExistingProgram:function(child){var i=0;for(var len=this.context.environments.length;i<len;i++){var environment=this.context.environments[i];if(environment&&environment.equals(child))return i}},programExpression:function(guid){var child=this.environment.children[guid];var programParams=[child.index,"data",child.blockParams];if(this.useBlockParams||this.useDepths)programParams.push("blockParams");
if(this.useDepths)programParams.push("depths");return"this.program("+programParams.join(", ")+")"},useRegister:function(name){if(!this.registers[name]){this.registers[name]=true;this.registers.list.push(name)}},push:function(expr){if(!(expr instanceof Literal))expr=this.source.wrap(expr);this.inlineStack.push(expr);return expr},pushStackLiteral:function(item){this.push(new Literal(item))},pushSource:function(source){if(this.pendingContent){this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),
this.pendingLocation));this.pendingContent=undefined}if(source)this.source.push(source)},replaceStack:function(callback){var prefix=["("];var stack;var createdStack;var usedLiteral;if(!this.isInline())throw new Exception("replaceStack on non-inline");var top=this.popStack(true);if(top instanceof Literal){stack=[top.value];prefix=["(",stack];usedLiteral=true}else{createdStack=true;var name=this.incrStack();prefix=["((",this.push(name)," \x3d ",top,")"];stack=this.topStack()}var item=callback.call(this,
stack);if(!usedLiteral)this.popStack();if(createdStack)this.stackSlot--;this.push(prefix.concat(item,")"))},incrStack:function(){this.stackSlot++;if(this.stackSlot>this.stackVars.length)this.stackVars.push("stack"+this.stackSlot);return this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var inlineStack=this.inlineStack;this.inlineStack=[];var i=0;for(var len=inlineStack.length;i<len;i++){var entry=inlineStack[i];if(entry instanceof Literal)this.compileStack.push(entry);
else{var stack=this.incrStack();this.pushSource([stack," \x3d ",entry,";"]);this.compileStack.push(stack)}}},isInline:function(){return this.inlineStack.length},popStack:function(wrapped){var inline=this.isInline();var item=(inline?this.inlineStack:this.compileStack).pop();if(!wrapped&&item instanceof Literal)return item.value;else{if(!inline){if(!this.stackSlot)throw new Exception("Invalid stack pop");this.stackSlot--}return item}},topStack:function(){var stack=this.isInline()?this.inlineStack:this.compileStack;
var item=stack[stack.length-1];if(item instanceof Literal)return item.value;else return item},contextName:function(context){if(this.useDepths&&context)return"depths["+context+"]";else return"depth"+context},quotedString:function(str){return this.source.quotedString(str)},objectLiteral:function(obj){return this.source.objectLiteral(obj)},aliasable:function(name){var ret=this.aliases[name];if(ret){ret.referenceCount++;return ret}ret=this.aliases[name]=this.source.wrap(name);ret.aliasable=true;ret.referenceCount=
1;return ret},setupHelper:function(paramSize,name,blockHelper){var params=[];var paramsInit=this.setupHelperArgs(name,paramSize,params,blockHelper);var foundHelper=this.nameLookup("helpers",name,"helper");return{params:params,paramsInit:paramsInit,name:foundHelper,callParams:[this.contextName(0)].concat(params)}},setupParams:function(helper,paramSize,params){var options={};var contexts=[];var types=[];var ids=[];var param;options.name=this.quotedString(helper);options.hash=this.popStack();if(this.trackIds)options.hashIds=
this.popStack();if(this.stringParams){options.hashTypes=this.popStack();options.hashContexts=this.popStack()}var inverse=this.popStack();var program=this.popStack();if(program||inverse){options.fn=program||"this.noop";options.inverse=inverse||"this.noop"}for(var i=paramSize;i--;){param=this.popStack();params[i]=param;if(this.trackIds)ids[i]=this.popStack();if(this.stringParams){types[i]=this.popStack();contexts[i]=this.popStack()}}if(this.trackIds)options.ids=this.source.generateArray(ids);if(this.stringParams){options.types=
this.source.generateArray(types);options.contexts=this.source.generateArray(contexts)}if(this.options.data)options.data="data";if(this.useBlockParams)options.blockParams="blockParams";return options},setupHelperArgs:function(helper,paramSize,params,useRegister){var options=this.setupParams(helper,paramSize,params,true);options=this.objectLiteral(options);if(useRegister){this.useRegister("options");params.push("options");return["options\x3d",options]}else{params.push(options);return""}}};var reservedWords=
("break else new var"+" case finally return void"+" catch for switch while"+" continue function this with"+" default if throw"+" delete in try"+" do instanceof typeof"+" abstract enum int short"+" boolean export interface static"+" byte extends long super"+" char final native synchronized"+" class float package throws"+" const goto private transient"+" debugger implements protected volatile"+" double import public let yield await"+" null true false").split(" ");var compilerWords=JavaScriptCompiler.RESERVED_WORDS=
{};var i$$0=0;for(var l$$0=reservedWords.length;i$$0<l$$0;i$$0++)compilerWords[reservedWords[i$$0]]=true;JavaScriptCompiler.isValidJavaScriptVariableName=function(name){return!JavaScriptCompiler.RESERVED_WORDS[name]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name)};__exports__=JavaScriptCompiler;return __exports__}(__module2__,__module4__,__module3__,__module15__);var __module0__=function(__dependency1__,__dependency2__,__dependency3__,__dependency4__,__dependency5__){var __exports__;var Handlebars=__dependency1__;
var AST=__dependency2__;var Parser=__dependency3__.parser;var parse=__dependency3__.parse;var Compiler=__dependency4__.Compiler;var compile=__dependency4__.compile;var precompile=__dependency4__.precompile;var JavaScriptCompiler=__dependency5__;var _create=Handlebars.create;var create=function(){var hb=_create();hb.compile=function(input,options){return compile(input,options,hb)};hb.precompile=function(input,options){return precompile(input,options,hb)};hb.AST=AST;hb.Compiler=Compiler;hb.JavaScriptCompiler=
JavaScriptCompiler;hb.Parser=Parser;hb.parse=parse;return hb};Handlebars=create();Handlebars.create=create;var root=typeof global!=="undefined"?global:window;var $Handlebars=root.Handlebars;Handlebars.noConflict=function(){if(root.Handlebars===Handlebars)root.Handlebars=$Handlebars};Handlebars["default"]=Handlebars;__exports__=Handlebars;return __exports__}(__module1__,__module7__,__module8__,__module13__,__module14__);return __module0__});
(function($){var _=function(){return{isMsie:function(){return/(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]:false},isBlankString:function(str){return!str||/^\s*$/.test(str)},escapeRegExChars:function(str){return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^$\|]/g,"$\x26")},isString:function(obj){return typeof obj==="string"},isNumber:function(obj){return typeof obj==="number"},isArray:$.isArray,isFunction:$.isFunction,isObject:$.isPlainObject,isUndefined:function(obj){return typeof obj===
"undefined"},isElement:function(obj){return!!(obj&&obj.nodeType===1)},isJQuery:function(obj){return obj instanceof $},toStr:function toStr(s){return _.isUndefined(s)||s===null?"":s+""},bind:$.proxy,each:function(collection,cb){function reverseArgs(index,value){return cb(value,index)}$.each(collection,reverseArgs)},map:$.map,filter:$.grep,every:function(obj,test){var result=true;if(!obj)return result;$.each(obj,function(key,val){if(!(result=test.call(null,val,key,obj)))return false});return!!result},
some:function(obj,test){var result=false;if(!obj)return result;$.each(obj,function(key,val){if(result=test.call(null,val,key,obj))return false});return!!result},mixin:$.extend,identity:function(x){return x},clone:function(obj){return $.extend(true,{},obj)},getIdGenerator:function(){var counter=0;return function(){return counter++}},templatify:function templatify(obj){function template(){return String(obj)}return $.isFunction(obj)?obj:template},defer:function(fn){setTimeout(fn,0)},debounce:function(func,
wait,immediate){var timeout;var result;return function(){var context=this;var args=arguments;var later;var callNow;later=function(){timeout=null;if(!immediate)result=func.apply(context,args)};callNow=immediate&&!timeout;clearTimeout(timeout);timeout=setTimeout(later,wait);if(callNow)result=func.apply(context,args);return result}},throttle:function(func,wait){var context;var args;var timeout;var result;var previous;var later;previous=0;later=function(){previous=new Date;timeout=null;result=func.apply(context,
args)};return function(){var now=new Date;var remaining=wait-(now-previous);context=this;args=arguments;if(remaining<=0){clearTimeout(timeout);timeout=null;previous=now;result=func.apply(context,args)}else if(!timeout)timeout=setTimeout(later,remaining);return result}},stringify:function(val){return _.isString(val)?val:JSON.stringify(val)},noop:function(){}}}();var VERSION="0.11.1";var tokenizers=function(){function whitespace(str){str=_.toStr(str);return str?str.split(/\s+/):[]}function nonword(str){str=
_.toStr(str);return str?str.split(/\W+/):[]}function getObjTokenizer(tokenizer){return function setKey(keys){keys=_.isArray(keys)?keys:[].slice.call(arguments,0);return function tokenize(o){var tokens=[];_.each(keys,function(k){tokens=tokens.concat(tokenizer(_.toStr(o[k])))});return tokens}}}return{nonword:nonword,whitespace:whitespace,obj:{nonword:getObjTokenizer(nonword),whitespace:getObjTokenizer(whitespace)}}}();var LruCache=function(){function LruCache(maxSize){this.maxSize=_.isNumber(maxSize)?
maxSize:100;this.reset();if(this.maxSize<=0)this.set=this.get=$.noop}function List(){this.head=this.tail=null}function Node(key,val){this.key=key;this.val=val;this.prev=this.next=null}_.mixin(LruCache.prototype,{set:function set(key,val){var tailItem=this.list.tail;var node;if(this.size>=this.maxSize){this.list.remove(tailItem);delete this.hash[tailItem.key];this.size--}if(node=this.hash[key]){node.val=val;this.list.moveToFront(node)}else{node=new Node(key,val);this.list.add(node);this.hash[key]=
node;this.size++}},get:function get(key){var node=this.hash[key];if(node){this.list.moveToFront(node);return node.val}},reset:function reset(){this.size=0;this.hash={};this.list=new List}});_.mixin(List.prototype,{add:function add(node){if(this.head){node.next=this.head;this.head.prev=node}this.head=node;this.tail=this.tail||node},remove:function remove(node){node.prev?node.prev.next=node.next:this.head=node.next;node.next?node.next.prev=node.prev:this.tail=node.prev},moveToFront:function(node){this.remove(node);
this.add(node)}});return LruCache}();var PersistentStorage=function(){function PersistentStorage(namespace,override){this.prefix=["__",namespace,"__"].join("");this.ttlKey="__ttl__";this.keyMatcher=new RegExp("^"+_.escapeRegExChars(this.prefix));this.ls=override||LOCAL_STORAGE;!this.ls&&this._noop()}function now(){return(new Date).getTime()}function encode(val){return JSON.stringify(_.isUndefined(val)?null:val)}function decode(val){return $.parseJSON(val)}function gatherMatchingKeys(keyMatcher){var i;
var key;var keys=[];var len=LOCAL_STORAGE.length;for(i=0;i<len;i++)if((key=LOCAL_STORAGE.key(i)).match(keyMatcher))keys.push(key.replace(keyMatcher,""));return keys}var LOCAL_STORAGE;try{LOCAL_STORAGE=window.localStorage;LOCAL_STORAGE.setItem("~~~","!");LOCAL_STORAGE.removeItem("~~~")}catch(err){LOCAL_STORAGE=null}_.mixin(PersistentStorage.prototype,{_prefix:function(key){return this.prefix+key},_ttlKey:function(key){return this._prefix(key)+this.ttlKey},_noop:function(){this.get=this.set=this.remove=
this.clear=this.isExpired=_.noop},_safeSet:function(key,val){try{this.ls.setItem(key,val)}catch(err){if(err.name==="QuotaExceededError"){this.clear();this._noop()}}},get:function(key){if(this.isExpired(key))this.remove(key);return decode(this.ls.getItem(this._prefix(key)))},set:function(key,val,ttl){if(_.isNumber(ttl))this._safeSet(this._ttlKey(key),encode(now()+ttl));else this.ls.removeItem(this._ttlKey(key));return this._safeSet(this._prefix(key),encode(val))},remove:function(key){this.ls.removeItem(this._ttlKey(key));
this.ls.removeItem(this._prefix(key));return this},clear:function(){var i;var keys=gatherMatchingKeys(this.keyMatcher);for(i=keys.length;i--;)this.remove(keys[i]);return this},isExpired:function(key){var ttl=decode(this.ls.getItem(this._ttlKey(key)));return _.isNumber(ttl)&&now()>ttl?true:false}});return PersistentStorage}();var Transport=function(){function Transport(o){o=o||{};this.cancelled=false;this.lastReq=null;this._send=o.transport;this._get=o.limiter?o.limiter(this._get):this._get;this._cache=
o.cache===false?new LruCache(0):sharedCache}var pendingRequestsCount=0;var pendingRequests={};var maxPendingRequests=6;var sharedCache=new LruCache(10);Transport.setMaxPendingRequests=function setMaxPendingRequests(num){maxPendingRequests=num};Transport.resetCache=function resetCache(){sharedCache.reset()};_.mixin(Transport.prototype,{_fingerprint:function fingerprint(o){o=o||{};return o.url+o.type+$.param(o.data||{})},_get:function(o,cb){function done(resp){cb(null,resp);that._cache.set(fingerprint,
resp)}function fail(){cb(true)}function always(){pendingRequestsCount--;delete pendingRequests[fingerprint];if(that.onDeckRequestArgs){that._get.apply(that,that.onDeckRequestArgs);that.onDeckRequestArgs=null}}var that=this;var fingerprint;var jqXhr;fingerprint=this._fingerprint(o);if(this.cancelled||fingerprint!==this.lastReq)return;if(jqXhr=pendingRequests[fingerprint])jqXhr.done(done).fail(fail);else if(pendingRequestsCount<maxPendingRequests){pendingRequestsCount++;pendingRequests[fingerprint]=
this._send(o).done(done).fail(fail).always(always)}else this.onDeckRequestArgs=[].slice.call(arguments,0)},get:function(o,cb){var resp;var fingerprint;cb=cb||$.noop;o=_.isString(o)?{url:o}:o||{};fingerprint=this._fingerprint(o);this.cancelled=false;this.lastReq=fingerprint;if(resp=this._cache.get(fingerprint))cb(null,resp);else this._get(o,cb)},cancel:function(){this.cancelled=true}});return Transport}();var SearchIndex=window.SearchIndex=function(){function SearchIndex(o){o=o||{};if(!o.datumTokenizer||
!o.queryTokenizer)$.error("datumTokenizer and queryTokenizer are both required");this.identify=o.identify||_.stringify;this.datumTokenizer=o.datumTokenizer;this.queryTokenizer=o.queryTokenizer;this.reset()}function normalizeTokens(tokens){tokens=_.filter(tokens,function(token){return!!token});tokens=_.map(tokens,function(token){return token.toLowerCase()});return tokens}function newNode(){var node={};node[IDS]=[];node[CHILDREN]={};return node}function unique(array){var seen={};var uniques=[];var i=
0;for(var len=array.length;i<len;i++)if(!seen[array[i]]){seen[array[i]]=true;uniques.push(array[i])}return uniques}function getIntersection(arrayA,arrayB){var ai=0;var bi=0;var intersection=[];arrayA=arrayA.sort();arrayB=arrayB.sort();var lenArrayA=arrayA.length;for(var lenArrayB=arrayB.length;ai<lenArrayA&&bi<lenArrayB;)if(arrayA[ai]<arrayB[bi])ai++;else if(arrayA[ai]>arrayB[bi])bi++;else{intersection.push(arrayA[ai]);ai++;bi++}return intersection}var CHILDREN="c";var IDS="i";_.mixin(SearchIndex.prototype,
{bootstrap:function bootstrap(o){this.datums=o.datums;this.trie=o.trie},add:function(data){var that=this;data=_.isArray(data)?data:[data];_.each(data,function(datum){var id;var tokens;that.datums[id=that.identify(datum)]=datum;tokens=normalizeTokens(that.datumTokenizer(datum));_.each(tokens,function(token){var node;var chars;var ch;node=that.trie;for(chars=token.split("");ch=chars.shift();){node=node[CHILDREN][ch]||(node[CHILDREN][ch]=newNode());node[IDS].push(id)}})})},get:function get(ids){var that=
this;return _.map(ids,function(id){return that.datums[id]})},search:function search(query){var that=this;var tokens;var matches;tokens=normalizeTokens(this.queryTokenizer(query));_.each(tokens,function(token){var node;var chars;var ch;var ids;if(matches&&matches.length===0)return false;node=that.trie;for(chars=token.split("");node&&(ch=chars.shift());)node=node[CHILDREN][ch];if(node&&chars.length===0){ids=node[IDS].slice(0);matches=matches?getIntersection(matches,ids):ids}else{matches=[];return false}});
return matches?_.map(unique(matches),function(id){return that.datums[id]}):[]},all:function all(){var values=[];for(var key in this.datums)values.push(this.datums[key]);return values},reset:function reset(){this.datums={};this.trie=newNode()},serialize:function serialize(){return{datums:this.datums,trie:this.trie}}});return SearchIndex}();var Prefetch=function(){function Prefetch(o){this.url=o.url;this.ttl=o.ttl;this.cache=o.cache;this.prepare=o.prepare;this.transform=o.transform;this.transport=o.transport;
this.thumbprint=o.thumbprint;this.storage=new PersistentStorage(o.cacheKey)}var keys;keys={data:"data",protocol:"protocol",thumbprint:"thumbprint"};_.mixin(Prefetch.prototype,{_settings:function settings(){return{url:this.url,type:"GET",dataType:"json"}},store:function store(data){if(!this.cache)return;this.storage.set(keys.data,data,this.ttl);this.storage.set(keys.protocol,location.protocol,this.ttl);this.storage.set(keys.thumbprint,this.thumbprint,this.ttl)},fromCache:function fromCache(){var stored=
{};var isExpired;if(!this.cache)return null;stored.data=this.storage.get(keys.data);stored.protocol=this.storage.get(keys.protocol);stored.thumbprint=this.storage.get(keys.thumbprint);isExpired=stored.thumbprint!==this.thumbprint||stored.protocol!==location.protocol;return stored.data&&!isExpired?stored.data:null},fromNetwork:function(cb){function onError(){cb(true)}function onResponse(resp){cb(null,that.transform(resp))}var that=this;var settings;if(!cb)return;settings=this.prepare(this._settings());
this.transport(settings).fail(onError).done(onResponse)},clear:function clear(){this.storage.clear();return this}});return Prefetch}();var Remote=function(){function Remote(o){this.url=o.url;this.prepare=o.prepare;this.transform=o.transform;this.transport=new Transport({cache:o.cache,limiter:o.limiter,transport:o.transport})}_.mixin(Remote.prototype,{_settings:function settings(){return{url:this.url,type:"GET",dataType:"json"}},get:function get(query,cb){function onResponse(err,resp){err?cb([]):cb(that.transform(resp))}
var that=this;var settings;if(!cb)return;query=query||"";settings=this.prepare(query,this._settings());return this.transport.get(settings,onResponse)},cancelLastRequest:function cancelLastRequest(){this.transport.cancel()}});return Remote}();var oParser=function(){function parsePrefetch(o){var defaults;if(!o)return null;defaults={url:null,ttl:24*60*60*1E3,cache:true,cacheKey:null,thumbprint:"",prepare:_.identity,transform:_.identity,transport:null};o=_.isString(o)?{url:o}:o;o=_.mixin(defaults,o);
!o.url&&$.error("prefetch requires url to be set");o.transform=o.filter||o.transform;o.cacheKey=o.cacheKey||o.url;o.thumbprint=VERSION+o.thumbprint;o.transport=o.transport?callbackToDeferred(o.transport):$.ajax;return o}function parseRemote(o){var defaults;if(!o)return;defaults={url:null,cache:true,prepare:null,replace:null,wildcard:null,limiter:null,rateLimitBy:"debounce",rateLimitWait:300,transform:_.identity,transport:null};o=_.isString(o)?{url:o}:o;o=_.mixin(defaults,o);!o.url&&$.error("remote requires url to be set");
o.transform=o.filter||o.transform;o.prepare=toRemotePrepare(o);o.limiter=toLimiter(o);o.transport=o.transport?callbackToDeferred(o.transport):$.ajax;delete o.replace;delete o.wildcard;delete o.rateLimitBy;delete o.rateLimitWait;return o}function toRemotePrepare(o){function prepareByReplace(query,settings){settings.url=replace(settings.url,query);return settings}function prepareByWildcard(query,settings){settings.url=settings.url.replace(wildcard,encodeURIComponent(query));return settings}function idenityPrepare(query,
settings){return settings}var prepare;var replace;var wildcard;prepare=o.prepare;replace=o.replace;wildcard=o.wildcard;if(prepare)return prepare;if(replace)prepare=prepareByReplace;else if(o.wildcard)prepare=prepareByWildcard;else prepare=idenityPrepare;return prepare}function toLimiter(o){function debounce(wait){return function debounce(fn){return _.debounce(fn,wait)}}function throttle(wait){return function throttle(fn){return _.throttle(fn,wait)}}var limiter;var method;var wait$$0;limiter=o.limiter;
method=o.rateLimitBy;wait$$0=o.rateLimitWait;if(!limiter)limiter=/^throttle$/i.test(method)?throttle(wait$$0):debounce(wait$$0);return limiter}function callbackToDeferred(fn){return function wrapper(o){function onSuccess(resp){_.defer(function(){deferred.resolve(resp)})}function onError(err){_.defer(function(){deferred.reject(err)})}var deferred=$.Deferred();fn(o,onSuccess,onError);return deferred}}return function parse(o){var defaults;var sorter;defaults={initialize:true,identify:_.stringify,datumTokenizer:null,
queryTokenizer:null,sufficient:5,sorter:null,local:[],prefetch:null,remote:null};o=_.mixin(defaults,o||{});!o.datumTokenizer&&$.error("datumTokenizer is required");!o.queryTokenizer&&$.error("queryTokenizer is required");sorter=o.sorter;o.sorter=sorter?function(x){return x.sort(sorter)}:_.identity;o.local=_.isFunction(o.local)?o.local():o.local;o.prefetch=parsePrefetch(o.prefetch);o.remote=parseRemote(o.remote);return o}}();var Bloodhound=function(){function Bloodhound(o){o=oParser(o);this.sorter=
o.sorter;this.identify=o.identify;this.sufficient=o.sufficient;this.local=o.local;this.remote=o.remote?new Remote(o.remote):null;this.prefetch=o.prefetch?new Prefetch(o.prefetch):null;this.index=new SearchIndex({identify:this.identify,datumTokenizer:o.datumTokenizer,queryTokenizer:o.queryTokenizer});o.initialize!==false&&this.initialize()}var old;old=window&&window.Bloodhound;Bloodhound.noConflict=function noConflict(){window&&(window.Bloodhound=old);return Bloodhound};Bloodhound.tokenizers=tokenizers;
_.mixin(Bloodhound.prototype,{__ttAdapter:function ttAdapter(){function withAsync(query,sync,async){return that.search(query,sync,async)}function withoutAsync(query,sync){return that.search(query,sync)}var that=this;return this.remote?withAsync:withoutAsync},_loadPrefetch:function loadPrefetch(){function done(err,data){if(err)return deferred.reject();that.add(data);that.prefetch.store(that.index.serialize());deferred.resolve()}var that=this;var deferred;var serialized;deferred=$.Deferred();if(!this.prefetch)deferred.resolve();
else if(serialized=this.prefetch.fromCache()){this.index.bootstrap(serialized);deferred.resolve()}else this.prefetch.fromNetwork(done);return deferred.promise()},_initialize:function initialize(){function addLocalToIndex(){that.add(that.local)}var that=this;var deferred;this.clear();(this.initPromise=this._loadPrefetch()).done(addLocalToIndex);return this.initPromise},initialize:function initialize(force){return!this.initPromise||force?this._initialize():this.initPromise},add:function add(data){this.index.add(data);
return this},get:function get(ids){ids=_.isArray(ids)?ids:[].slice.call(arguments);return this.index.get(ids)},search:function search(query,sync,async){function processRemote(remote){var nonDuplicates=[];_.each(remote,function(r){!_.some(local,function(l){return that.identify(r)===that.identify(l)})&&nonDuplicates.push(r)});async&&async(nonDuplicates)}var that=this;var local;local=this.sorter(this.index.search(query));sync(this.remote?local.slice():local);if(this.remote&&local.length<this.sufficient)this.remote.get(query,
processRemote);else if(this.remote)this.remote.cancelLastRequest();return this},all:function all(){return this.index.all()},clear:function clear(){this.index.reset();return this},clearPrefetchCache:function clearPrefetchCache(){this.prefetch&&this.prefetch.clear();return this},clearRemoteCache:function clearRemoteCache(){Transport.resetCache();return this},ttAdapter:function ttAdapter(){return this.__ttAdapter()}});return Bloodhound}();window.Bloodhound=Bloodhound;return Bloodhound})(jQuery);
(function($){var _=function(){return{isMsie:function(){return/(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]:false},isBlankString:function(str){return!str||/^\s*$/.test(str)},escapeRegExChars:function(str){return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^$\|]/g,"$\x26")},isString:function(obj){return typeof obj==="string"},isNumber:function(obj){return typeof obj==="number"},isArray:$.isArray,isFunction:$.isFunction,isObject:$.isPlainObject,isUndefined:function(obj){return typeof obj===
"undefined"},isElement:function(obj){return!!(obj&&obj.nodeType===1)},isJQuery:function(obj){return obj instanceof $},toStr:function toStr(s){return _.isUndefined(s)||s===null?"":s+""},bind:$.proxy,each:function(collection,cb){function reverseArgs(index,value){return cb(value,index)}$.each(collection,reverseArgs)},map:$.map,filter:$.grep,every:function(obj,test){var result=true;if(!obj)return result;$.each(obj,function(key,val){if(!(result=test.call(null,val,key,obj)))return false});return!!result},
some:function(obj,test){var result=false;if(!obj)return result;$.each(obj,function(key,val){if(result=test.call(null,val,key,obj))return false});return!!result},mixin:$.extend,identity:function(x){return x},clone:function(obj){return $.extend(true,{},obj)},getIdGenerator:function(){var counter=0;return function(){return counter++}},templatify:function templatify(obj){function template(){return String(obj)}return $.isFunction(obj)?obj:template},defer:function(fn){setTimeout(fn,0)},debounce:function(func,
wait,immediate){var timeout;var result;return function(){var context=this;var args=arguments;var later;var callNow;later=function(){timeout=null;if(!immediate)result=func.apply(context,args)};callNow=immediate&&!timeout;clearTimeout(timeout);timeout=setTimeout(later,wait);if(callNow)result=func.apply(context,args);return result}},throttle:function(func,wait){var context;var args;var timeout;var result;var previous;var later;previous=0;later=function(){previous=new Date;timeout=null;result=func.apply(context,
args)};return function(){var now=new Date;var remaining=wait-(now-previous);context=this;args=arguments;if(remaining<=0){clearTimeout(timeout);timeout=null;previous=now;result=func.apply(context,args)}else if(!timeout)timeout=setTimeout(later,remaining);return result}},stringify:function(val){return _.isString(val)?val:JSON.stringify(val)},noop:function(){}}}();var WWW=function(){function build(o$$0){var www;var classes;classes=_.mixin({},defaultClassNames,o$$0);www={css:buildCss(),classes:classes,
html:buildHtml(classes),selectors:buildSelectors(classes)};return{css:www.css,html:www.html,classes:www.classes,selectors:www.selectors,mixin:function(o){_.mixin(o,www)}}}function buildHtml(c){return{wrapper:'\x3cspan class\x3d"'+c.wrapper+'"\x3e\x3c/span\x3e',menu:'\x3cdiv class\x3d"'+c.menu+'"\x3e\x3c/div\x3e'}}function buildSelectors(classes){var selectors={};_.each(classes,function(v,k){selectors[k]="."+v});return selectors}function buildCss(){var css={wrapper:{position:"relative",display:"inline-block"},
hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},menu:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};if(_.isMsie())_.mixin(css.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"});
return css}var defaultClassNames={wrapper:"twitter-typeahead",input:"tt-input",hint:"tt-hint",menu:"tt-menu",dataset:"tt-dataset",suggestion:"tt-suggestion",selectable:"tt-selectable",empty:"tt-empty",open:"tt-open",cursor:"tt-cursor",highlight:"tt-highlight"};return build}();var EventBus=function(){function EventBus(o){if(!o||!o.el)$.error("EventBus initialized without el");this.$el=$(o.el)}var namespace;var deprecationMap;namespace="typeahead:";deprecationMap={render:"rendered",cursorchange:"cursorchanged",
select:"selected",autocomplete:"autocompleted"};_.mixin(EventBus.prototype,{_trigger:function(type,args){var $e;$e=$.Event(namespace+type);(args=args||[]).unshift($e);this.$el.trigger.apply(this.$el,args);return $e},before:function(type){var args;var $e;args=[].slice.call(arguments,1);$e=this._trigger("before"+type,args);return $e.isDefaultPrevented()},trigger:function(type){var deprecatedType;this._trigger(type,[].slice.call(arguments,1));if(deprecatedType=deprecationMap[type])this._trigger(deprecatedType,
[].slice.call(arguments,1))}});return EventBus}();var EventEmitter=function(){function on(method,types,cb,context){var type;if(!cb)return this;types=types.split(splitter);cb=context?bindContext(cb,context):cb;for(this._callbacks=this._callbacks||{};type=types.shift();){this._callbacks[type]=this._callbacks[type]||{sync:[],async:[]};this._callbacks[type][method].push(cb)}return this}function onAsync(types,cb,context){return on.call(this,"async",types,cb,context)}function onSync(types,cb,context){return on.call(this,
"sync",types,cb,context)}function off(types){var type;if(!this._callbacks)return this;for(types=types.split(splitter);type=types.shift();)delete this._callbacks[type];return this}function trigger(types){var type;var callbacks;var args;var syncFlush;var asyncFlush;if(!this._callbacks)return this;types=types.split(splitter);for(args=[].slice.call(arguments,1);(type=types.shift())&&(callbacks=this._callbacks[type]);){syncFlush=getFlush(callbacks.sync,this,[type].concat(args));asyncFlush=getFlush(callbacks.async,
this,[type].concat(args));syncFlush()&&nextTick(asyncFlush)}return this}function getFlush(callbacks,context,args){function flush(){var cancelled;var i=0;for(var len=callbacks.length;!cancelled&&i<len;i+=1)cancelled=callbacks[i].apply(context,args)===false;return!cancelled}return flush}function getNextTick(){var nextTickFn;if(window.setImmediate)nextTickFn=function nextTickSetImmediate(fn){setImmediate(function(){fn()})};else nextTickFn=function nextTickSetTimeout(fn){setTimeout(function(){fn()},0)};
return nextTickFn}function bindContext(fn,context){return fn.bind?fn.bind(context):function(){fn.apply(context,[].slice.call(arguments,0))}}var splitter=/\s+/;var nextTick=getNextTick();return{onSync:onSync,onAsync:onAsync,off:off,trigger:trigger}}();var highlight=function(doc){function getRegex(patterns,caseSensitive,wordsOnly){var escapedPatterns=[];var regexStr;var i=0;for(var len=patterns.length;i<len;i++)escapedPatterns.push(_.escapeRegExChars(patterns[i]));regexStr=wordsOnly?"\\b("+escapedPatterns.join("|")+
")\\b":"("+escapedPatterns.join("|")+")";return caseSensitive?new RegExp(regexStr):new RegExp(regexStr,"i")}var defaults={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:false,caseSensitive:false};return function hightlight(o){function hightlightTextNode(textNode){var match;var patternNode;var wrapperNode;if(match=regex.exec(textNode.data)){wrapperNode=doc.createElement(o.tagName);o.className&&(wrapperNode.className=o.className);patternNode=textNode.splitText(match.index);patternNode.splitText(match[0].length);
wrapperNode.appendChild(patternNode.cloneNode(true));textNode.parentNode.replaceChild(wrapperNode,patternNode)}return!!match}function traverse(el,hightlightTextNode){var childNode;var TEXT_NODE_TYPE=3;for(var i=0;i<el.childNodes.length;i++){childNode=el.childNodes[i];if(childNode.nodeType===TEXT_NODE_TYPE)i+=hightlightTextNode(childNode)?1:0;else traverse(childNode,hightlightTextNode)}}var regex;o=_.mixin({},defaults,o);if(!o.node||!o.pattern)return;o.pattern=_.isArray(o.pattern)?o.pattern:[o.pattern];
regex=getRegex(o.pattern,o.caseSensitive,o.wordsOnly);traverse(o.node,hightlightTextNode)}}(window.document);var Input=function(){function Input(o,www){o=o||{};if(!o.input)$.error("input is missing");www.mixin(this);this.$hint=$(o.hint);this.$input=$(o.input);this.query=this.$input.val();this.queryWhenFocused=this.hasFocus()?this.query:null;this.$overflowHelper=buildOverflowHelper(this.$input);this._checkLanguageDirection();if(this.$hint.length===0)this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=
_.noop}function buildOverflowHelper($input){return $('\x3cpre aria-hidden\x3d"true"\x3e\x3c/pre\x3e').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:$input.css("font-family"),fontSize:$input.css("font-size"),fontStyle:$input.css("font-style"),fontVariant:$input.css("font-variant"),fontWeight:$input.css("font-weight"),wordSpacing:$input.css("word-spacing"),letterSpacing:$input.css("letter-spacing"),textIndent:$input.css("text-indent"),textRendering:$input.css("text-rendering"),
textTransform:$input.css("text-transform")}).insertAfter($input)}function areQueriesEquivalent(a,b){return Input.normalizeQuery(a)===Input.normalizeQuery(b)}function withModifier($e){return $e.altKey||$e.ctrlKey||$e.metaKey||$e.shiftKey}var specialKeyCodeMap;specialKeyCodeMap={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"};Input.normalizeQuery=function(str){return _.toStr(str).replace(/^\s*/g,"").replace(/\s{2,}/g," ")};_.mixin(Input.prototype,EventEmitter,{_onBlur:function onBlur(){this.resetInputValue();
this.trigger("blurred")},_onFocus:function onFocus(){this.queryWhenFocused=this.query;this.trigger("focused")},_onKeydown:function onKeydown($e){var keyName=specialKeyCodeMap[$e.which||$e.keyCode];this._managePreventDefault(keyName,$e);if(keyName&&this._shouldTrigger(keyName,$e))this.trigger(keyName+"Keyed",$e)},_onInput:function onInput(){this._setQuery(this.getInputValue());this.clearHintIfInvalid();this._checkLanguageDirection()},_managePreventDefault:function managePreventDefault(keyName,$e){var preventDefault;
switch(keyName){case "up":case "down":preventDefault=!withModifier($e);break;default:preventDefault=false}preventDefault&&$e.preventDefault()},_shouldTrigger:function shouldTrigger(keyName,$e){var trigger;switch(keyName){case "tab":trigger=!withModifier($e);break;default:trigger=true}return trigger},_checkLanguageDirection:function checkLanguageDirection(){var dir=(this.$input.css("direction")||"ltr").toLowerCase();if(this.dir!==dir){this.dir=dir;this.$hint.attr("dir",dir);this.trigger("langDirChanged",
dir)}},_setQuery:function setQuery(val,silent){var areEquivalent;var hasDifferentWhitespace;areEquivalent=areQueriesEquivalent(val,this.query);hasDifferentWhitespace=areEquivalent?this.query.length!==val.length:false;this.query=val;if(!silent&&!areEquivalent)this.trigger("queryChanged",this.query);else if(!silent&&hasDifferentWhitespace)this.trigger("whitespaceChanged",this.query)},bind:function(){var that=this;var onBlur;var onFocus;var onKeydown;var onInput;onBlur=_.bind(this._onBlur,this);onFocus=
_.bind(this._onFocus,this);onKeydown=_.bind(this._onKeydown,this);onInput=_.bind(this._onInput,this);this.$input.on("blur.tt",onBlur).on("focus.tt",onFocus).on("keydown.tt",onKeydown);if(!_.isMsie()||_.isMsie()>9)this.$input.on("input.tt",onInput);else this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function($e){if(specialKeyCodeMap[$e.which||$e.keyCode])return;_.defer(_.bind(that._onInput,that,$e))});return this},focus:function focus(){this.$input.focus()},blur:function blur(){this.$input.blur()},
getLangDir:function getLangDir(){return this.dir},getQuery:function getQuery(){return this.query||""},setQuery:function setQuery(val,silent){this.setInputValue(val);this._setQuery(val,silent)},hasQueryChangedSinceLastFocus:function hasQueryChangedSinceLastFocus(){return this.query!==this.queryWhenFocused},getInputValue:function getInputValue(){return this.$input.val()},setInputValue:function setInputValue(value){this.$input.val(value);this.clearHintIfInvalid();this._checkLanguageDirection()},resetInputValue:function resetInputValue(){this.setInputValue(this.query)},
getHint:function getHint(){return this.$hint.val()},setHint:function setHint(value){this.$hint.val(value)},clearHint:function clearHint(){this.setHint("")},clearHintIfInvalid:function clearHintIfInvalid(){var val;var hint;var valIsPrefixOfHint;var isValid;val=this.getInputValue();hint=this.getHint();valIsPrefixOfHint=val!==hint&&hint.indexOf(val)===0;isValid=val!==""&&valIsPrefixOfHint&&!this.hasOverflow();!isValid&&this.clearHint()},hasFocus:function hasFocus(){return this.$input.is(":focus")},hasOverflow:function hasOverflow(){var constraint=
this.$input.width()-2;this.$overflowHelper.text(this.getInputValue());return this.$overflowHelper.width()>=constraint},isCursorAtEnd:function(){var valueLength;var selectionStart;var range;valueLength=this.$input.val().length;selectionStart=this.$input[0].selectionStart;if(_.isNumber(selectionStart))return selectionStart===valueLength;else if(document.selection){range=document.selection.createRange();range.moveStart("character",-valueLength);return valueLength===range.text.length}return true},destroy:function destroy(){this.$hint.off(".tt");
this.$input.off(".tt");this.$overflowHelper.remove();this.$hint=this.$input=this.$overflowHelper=$("\x3cdiv\x3e")}});return Input}();var Dataset=function(){function Dataset(o,www){o=o||{};o.templates=o.templates||{};o.templates.notFound=o.templates.notFound||o.templates.empty;if(!o.source)$.error("missing source");if(!o.node)$.error("missing node");if(o.name&&!isValidName(o.name))$.error("invalid dataset name: "+o.name);www.mixin(this);this.highlight=!!o.highlight;this.name=o.name||nameGenerator();
this.limit=o.limit||5;this.displayFn=getDisplayFn(o.display||o.displayKey);this.templates=getTemplates(o.templates,this.displayFn);this.source=o.source.__ttAdapter?o.source.__ttAdapter():o.source;this.async=_.isUndefined(o.async)?this.source.length>2:!!o.async;this._resetLastSuggestion();this.$el=$(o.node).addClass(this.classes.dataset).addClass(this.classes.dataset+"-"+this.name)}function getDisplayFn(display){function displayFn(obj){return obj[display]}display=display||_.stringify;return _.isFunction(display)?
display:displayFn}function getTemplates(templates,displayFn){function suggestionTemplate(context){return $("\x3cdiv\x3e").text(displayFn(context))}return{notFound:templates.notFound&&_.templatify(templates.notFound),pending:templates.pending&&_.templatify(templates.pending),header:templates.header&&_.templatify(templates.header),footer:templates.footer&&_.templatify(templates.footer),suggestion:templates.suggestion||suggestionTemplate}}function isValidName(str){return/^[_a-zA-Z0-9-]+$/.test(str)}
var keys;var nameGenerator;keys={val:"tt-selectable-display",obj:"tt-selectable-object"};nameGenerator=_.getIdGenerator();Dataset.extractData=function extractData(el){var $el=$(el);if($el.data(keys.obj))return{val:$el.data(keys.val)||"",obj:$el.data(keys.obj)||null};return null};_.mixin(Dataset.prototype,EventEmitter,{_overwrite:function overwrite(query,suggestions){suggestions=suggestions||[];if(suggestions.length)this._renderSuggestions(query,suggestions);else if(this.async&&this.templates.pending)this._renderPending(query);
else if(!this.async&&this.templates.notFound)this._renderNotFound(query);else this._empty();this.trigger("rendered",this.name,suggestions,false)},_append:function append(query,suggestions){suggestions=suggestions||[];if(suggestions.length&&this.$lastSuggestion.length)this._appendSuggestions(query,suggestions);else if(suggestions.length)this._renderSuggestions(query,suggestions);else if(!this.$lastSuggestion.length&&this.templates.notFound)this._renderNotFound(query);this.trigger("rendered",this.name,
suggestions,true)},_renderSuggestions:function renderSuggestions(query,suggestions){var $fragment;$fragment=this._getSuggestionsFragment(query,suggestions);this.$lastSuggestion=$fragment.children().last();this.$el.html($fragment).prepend(this._getHeader(query,suggestions)).append(this._getFooter(query,suggestions))},_appendSuggestions:function appendSuggestions(query,suggestions){var $fragment;var $lastSuggestion;$fragment=this._getSuggestionsFragment(query,suggestions);$lastSuggestion=$fragment.children().last();
this.$lastSuggestion.after($fragment);this.$lastSuggestion=$lastSuggestion},_renderPending:function renderPending(query){var template=this.templates.pending;this._resetLastSuggestion();template&&this.$el.html(template({query:query,dataset:this.name}))},_renderNotFound:function renderNotFound(query){var template=this.templates.notFound;this._resetLastSuggestion();template&&this.$el.html(template({query:query,dataset:this.name}))},_empty:function empty(){this.$el.empty();this._resetLastSuggestion()},
_getSuggestionsFragment:function getSuggestionsFragment(query,suggestions){var that=this;var fragment;fragment=document.createDocumentFragment();_.each(suggestions,function getSuggestionNode(suggestion){var $el;var context;context=that._injectQuery(query,suggestion);$el=$(that.templates.suggestion(context)).data(keys.obj,suggestion).data(keys.val,that.displayFn(suggestion)).addClass(that.classes.suggestion+" "+that.classes.selectable);fragment.appendChild($el[0])});this.highlight&&highlight({className:this.classes.highlight,
node:fragment,pattern:query});return $(fragment)},_getFooter:function getFooter(query,suggestions){return this.templates.footer?this.templates.footer({query:query,suggestions:suggestions,dataset:this.name}):null},_getHeader:function getHeader(query,suggestions){return this.templates.header?this.templates.header({query:query,suggestions:suggestions,dataset:this.name}):null},_resetLastSuggestion:function resetLastSuggestion(){this.$lastSuggestion=$()},_injectQuery:function injectQuery(query,obj){return _.isObject(obj)?
_.mixin({_query:query},obj):obj},update:function update(query){function sync(suggestions){if(syncCalled)return;syncCalled=true;suggestions=(suggestions||[]).slice(0,that.limit);rendered=suggestions.length;that._overwrite(query,suggestions);if(rendered<that.limit&&that.async)that.trigger("asyncRequested",query)}function async(suggestions){suggestions=suggestions||[];if(!canceled&&rendered<that.limit){that.cancel=$.noop;rendered+=suggestions.length;that._append(query,suggestions.slice(0,that.limit-
rendered));that.async&&that.trigger("asyncReceived",query)}}var that=this;var canceled=false;var syncCalled=false;var rendered=0;this.cancel();this.cancel=function cancel(){canceled=true;that.cancel=$.noop;that.async&&that.trigger("asyncCanceled",query)};this.source(query,sync,async);!syncCalled&&sync([])},cancel:$.noop,clear:function clear(){this._empty();this.cancel();this.trigger("cleared")},isEmpty:function isEmpty(){return this.$el.is(":empty")},destroy:function destroy(){this.$el=$("\x3cdiv\x3e")}});
return Dataset}();var Menu=function(){function Menu(o,www){function initializeDataset(oDataset){var node=that.$node.find(oDataset.node).first();oDataset.node=node.length?node:$("\x3cdiv\x3e").appendTo(that.$node);return new Dataset(oDataset,www)}var that=this;o=o||{};if(!o.node)$.error("node is required");www.mixin(this);this.$node=$(o.node);this.query=null;this.datasets=_.map(o.datasets,initializeDataset)}_.mixin(Menu.prototype,EventEmitter,{_onSelectableClick:function onSelectableClick($e){this.trigger("selectableClicked",
$($e.currentTarget))},_onRendered:function onRendered(type,dataset,suggestions,async){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty());this.trigger("datasetRendered",dataset,suggestions,async)},_onCleared:function onCleared(){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty());this.trigger("datasetCleared")},_propagate:function propagate(){this.trigger.apply(this,arguments)},_allDatasetsEmpty:function allDatasetsEmpty(){function isDatasetEmpty(dataset){return dataset.isEmpty()}
return _.every(this.datasets,isDatasetEmpty)},_getSelectables:function getSelectables(){return this.$node.find(this.selectors.selectable)},_removeCursor:function _removeCursor(){var $selectable=this.getActiveSelectable();$selectable&&$selectable.removeClass(this.classes.cursor)},_ensureVisible:function ensureVisible($el){var elTop;var elBottom;var nodeScrollTop;var nodeHeight;elTop=$el.position().top;elBottom=elTop+$el.outerHeight(true);nodeScrollTop=this.$node.scrollTop();nodeHeight=this.$node.height()+
parseInt(this.$node.css("paddingTop"),10)+parseInt(this.$node.css("paddingBottom"),10);if(elTop<0)this.$node.scrollTop(nodeScrollTop+elTop);else if(nodeHeight<elBottom)this.$node.scrollTop(nodeScrollTop+(elBottom-nodeHeight))},bind:function(){var that=this;var onSelectableClick;onSelectableClick=_.bind(this._onSelectableClick,this);this.$node.on("click.tt",this.selectors.selectable,onSelectableClick);_.each(this.datasets,function(dataset){dataset.onSync("asyncRequested",that._propagate,that).onSync("asyncCanceled",
that._propagate,that).onSync("asyncReceived",that._propagate,that).onSync("rendered",that._onRendered,that).onSync("cleared",that._onCleared,that)});return this},isOpen:function isOpen(){return this.$node.hasClass(this.classes.open)},open:function open(){this.$node.addClass(this.classes.open)},close:function close(){this.$node.removeClass(this.classes.open);this._removeCursor()},setLanguageDirection:function setLanguageDirection(dir){this.$node.attr("dir",dir)},selectableRelativeToCursor:function selectableRelativeToCursor(delta){var $selectables;
var $oldCursor;var oldIndex;var newIndex;$oldCursor=this.getActiveSelectable();$selectables=this._getSelectables();oldIndex=$oldCursor?$selectables.index($oldCursor):-1;newIndex=oldIndex+delta;newIndex=(newIndex+1)%($selectables.length+1)-1;newIndex=newIndex<-1?$selectables.length-1:newIndex;return newIndex===-1?null:$selectables.eq(newIndex)},setCursor:function setCursor($selectable){this._removeCursor();if($selectable=$selectable&&$selectable.first()){$selectable.addClass(this.classes.cursor);this._ensureVisible($selectable)}},
getSelectableData:function getSelectableData($el){return $el&&$el.length?Dataset.extractData($el):null},getActiveSelectable:function getActiveSelectable(){var $selectable=this._getSelectables().filter(this.selectors.cursor).first();return $selectable.length?$selectable:null},getTopSelectable:function getTopSelectable(){var $selectable=this._getSelectables().first();return $selectable.length?$selectable:null},update:function update(query){function updateDataset(dataset){dataset.update(query)}var isValidUpdate=
query!==this.query;if(isValidUpdate){this.query=query;_.each(this.datasets,updateDataset)}return isValidUpdate},empty:function empty(){function clearDataset(dataset){dataset.clear()}_.each(this.datasets,clearDataset);this.query=null;this.$node.addClass(this.classes.empty)},destroy:function destroy(){function destroyDataset(dataset){dataset.destroy()}this.$node.off(".tt");this.$node=$("\x3cdiv\x3e");_.each(this.datasets,destroyDataset)}});return Menu}();var DefaultMenu=function(){function DefaultMenu(){Menu.apply(this,
[].slice.call(arguments,0))}var s=Menu.prototype;_.mixin(DefaultMenu.prototype,Menu.prototype,{open:function open(){!this._allDatasetsEmpty()&&this._show();return s.open.apply(this,[].slice.call(arguments,0))},close:function close(){this._hide();return s.close.apply(this,[].slice.call(arguments,0))},_onRendered:function onRendered(){if(this._allDatasetsEmpty())this._hide();else this.isOpen()&&this._show();return s._onRendered.apply(this,[].slice.call(arguments,0))},_onCleared:function onCleared(){if(this._allDatasetsEmpty())this._hide();
else this.isOpen()&&this._show();return s._onCleared.apply(this,[].slice.call(arguments,0))},setLanguageDirection:function setLanguageDirection(dir){this.$node.css(dir==="ltr"?this.css.ltr:this.css.rtl);return s.setLanguageDirection.apply(this,[].slice.call(arguments,0))},_hide:function hide(){this.$node.hide()},_show:function show(){this.$node.css("display","block")}});return DefaultMenu}();var Typeahead=function(){function Typeahead(o,www){var onFocused;var onBlurred;var onEnterKeyed;var onTabKeyed;
var onEscKeyed;var onUpKeyed;var onDownKeyed;var onLeftKeyed;var onRightKeyed;var onQueryChanged;var onWhitespaceChanged;o=o||{};if(!o.input)$.error("missing input");if(!o.menu)$.error("missing menu");if(!o.eventBus)$.error("missing event bus");www.mixin(this);this.eventBus=o.eventBus;this.minLength=_.isNumber(o.minLength)?o.minLength:1;this.input=o.input;this.menu=o.menu;this.enabled=true;this.active=false;this.input.hasFocus()&&this.activate();this.dir=this.input.getLangDir();this._hacks();this.menu.bind().onSync("selectableClicked",
this._onSelectableClicked,this).onSync("asyncRequested",this._onAsyncRequested,this).onSync("asyncCanceled",this._onAsyncCanceled,this).onSync("asyncReceived",this._onAsyncReceived,this).onSync("datasetRendered",this._onDatasetRendered,this).onSync("datasetCleared",this._onDatasetCleared,this);onFocused=c(this,"activate","open","_onFocused");onBlurred=c(this,"deactivate","_onBlurred");onEnterKeyed=c(this,"isActive","isOpen","_onEnterKeyed");onTabKeyed=c(this,"isActive","isOpen","_onTabKeyed");onEscKeyed=
c(this,"isActive","_onEscKeyed");onUpKeyed=c(this,"isActive","open","_onUpKeyed");onDownKeyed=c(this,"isActive","open","_onDownKeyed");onLeftKeyed=c(this,"isActive","isOpen","_onLeftKeyed");onRightKeyed=c(this,"isActive","isOpen","_onRightKeyed");onQueryChanged=c(this,"_openIfActive","_onQueryChanged");onWhitespaceChanged=c(this,"_openIfActive","_onWhitespaceChanged");this.input.bind().onSync("focused",onFocused,this).onSync("blurred",onBlurred,this).onSync("enterKeyed",onEnterKeyed,this).onSync("tabKeyed",
onTabKeyed,this).onSync("escKeyed",onEscKeyed,this).onSync("upKeyed",onUpKeyed,this).onSync("downKeyed",onDownKeyed,this).onSync("leftKeyed",onLeftKeyed,this).onSync("rightKeyed",onRightKeyed,this).onSync("queryChanged",onQueryChanged,this).onSync("whitespaceChanged",onWhitespaceChanged,this).onSync("langDirChanged",this._onLangDirChanged,this)}function c(ctx){var methods=[].slice.call(arguments,1);return function(){var args=[].slice.call(arguments);_.each(methods,function(method){return ctx[method].apply(ctx,
args)})}}_.mixin(Typeahead.prototype,{_hacks:function hacks(){var $input;var $menu;$input=this.input.$input||$("\x3cdiv\x3e");$menu=this.menu.$node||$("\x3cdiv\x3e");$input.on("blur.tt",function($e){var active;var isActive;var hasActive;active=document.activeElement;isActive=$menu.is(active);hasActive=$menu.has(active).length>0;if(_.isMsie()&&(isActive||hasActive)){$e.preventDefault();$e.stopImmediatePropagation();_.defer(function(){$input.focus()})}});$menu.on("mousedown.tt",function($e){$e.preventDefault()})},
_onSelectableClicked:function onSelectableClicked(type,$el){this.select($el)},_onDatasetCleared:function onDatasetCleared(){this._updateHint()},_onDatasetRendered:function onDatasetRendered(type,dataset,suggestions,async){this._updateHint();this.eventBus.trigger("render",suggestions,async,dataset)},_onAsyncRequested:function onAsyncRequested(type,dataset,query){this.eventBus.trigger("asyncrequest",query,dataset)},_onAsyncCanceled:function onAsyncCanceled(type,dataset,query){this.eventBus.trigger("asynccancel",
query,dataset)},_onAsyncReceived:function onAsyncReceived(type,dataset,query){this.eventBus.trigger("asyncreceive",query,dataset)},_onFocused:function onFocused(){this._minLengthMet()&&this.menu.update(this.input.getQuery())},_onBlurred:function onBlurred(){if(this.input.hasQueryChangedSinceLastFocus())this.eventBus.trigger("change",this.input.getQuery())},_onEnterKeyed:function onEnterKeyed(type,$e){var $selectable;if($selectable=this.menu.getActiveSelectable())this.select($selectable)&&$e.preventDefault()},
_onTabKeyed:function onTabKeyed(type,$e){var $selectable;if($selectable=this.menu.getActiveSelectable())this.select($selectable)&&$e.preventDefault();else if($selectable=this.menu.getTopSelectable())this.autocomplete($selectable)&&$e.preventDefault()},_onEscKeyed:function onEscKeyed(){this.close()},_onUpKeyed:function onUpKeyed(){this.moveCursor(-1)},_onDownKeyed:function onDownKeyed(){this.moveCursor(+1)},_onLeftKeyed:function onLeftKeyed(){if(this.dir==="rtl"&&this.input.isCursorAtEnd())this.autocomplete(this.menu.getTopSelectable())},
_onRightKeyed:function onRightKeyed(){if(this.dir==="ltr"&&this.input.isCursorAtEnd())this.autocomplete(this.menu.getTopSelectable())},_onQueryChanged:function onQueryChanged(e,query){this._minLengthMet(query)?this.menu.update(query):this.menu.empty()},_onWhitespaceChanged:function onWhitespaceChanged(){this._updateHint()},_onLangDirChanged:function onLangDirChanged(e,dir){if(this.dir!==dir){this.dir=dir;this.menu.setLanguageDirection(dir)}},_openIfActive:function openIfActive(){this.isActive()&&
this.open()},_minLengthMet:function minLengthMet(query){query=_.isString(query)?query:this.input.getQuery()||"";return query.length>=this.minLength},_updateHint:function updateHint(){var $selectable;var data;var val;var query;var escapedQuery;var frontMatchRegEx;var match;$selectable=this.menu.getTopSelectable();data=this.menu.getSelectableData($selectable);val=this.input.getInputValue();if(data&&!_.isBlankString(val)&&!this.input.hasOverflow()){query=Input.normalizeQuery(val);escapedQuery=_.escapeRegExChars(query);
frontMatchRegEx=new RegExp("^(?:"+escapedQuery+")(.+$)","i");match=frontMatchRegEx.exec(data.val);match&&this.input.setHint(val+match[1])}else this.input.clearHint()},isEnabled:function isEnabled(){return this.enabled},enable:function enable(){this.enabled=true},disable:function disable(){this.enabled=false},isActive:function isActive(){return this.active},activate:function activate(){if(this.isActive())return true;else if(!this.isEnabled()||this.eventBus.before("active"))return false;else{this.active=
true;this.eventBus.trigger("active");return true}},deactivate:function deactivate(){if(!this.isActive())return true;else if(this.eventBus.before("idle"))return false;else{this.active=false;this.close();this.eventBus.trigger("idle");return true}},isOpen:function isOpen(){return this.menu.isOpen()},open:function open(){if(!this.isOpen()&&!this.eventBus.before("open")){this.menu.open();this._updateHint();this.eventBus.trigger("open")}return this.isOpen()},close:function close(){if(this.isOpen()&&!this.eventBus.before("close")){this.menu.close();
this.input.clearHint();this.input.resetInputValue();this.eventBus.trigger("close")}return!this.isOpen()},setVal:function setVal(val){this.input.setQuery(_.toStr(val))},getVal:function getVal(){return this.input.getQuery()},select:function select($selectable){var data=this.menu.getSelectableData($selectable);if(data&&!this.eventBus.before("select",data.obj)){this.input.setQuery(data.val,true);this.eventBus.trigger("select",data.obj);this.close();return true}return false},autocomplete:function autocomplete($selectable){var query;
var data;var isValid;query=this.input.getQuery();data=this.menu.getSelectableData($selectable);isValid=data&&query!==data.val;if(isValid&&!this.eventBus.before("autocomplete",data.obj)){this.input.setQuery(data.val);this.eventBus.trigger("autocomplete",data.obj);return true}return false},moveCursor:function moveCursor(delta){var query;var $candidate;var data;var payload;var cancelMove;query=this.input.getQuery();$candidate=this.menu.selectableRelativeToCursor(delta);data=this.menu.getSelectableData($candidate);
payload=data?data.obj:null;cancelMove=this._minLengthMet()&&this.menu.update(query);if(!cancelMove&&!this.eventBus.before("cursorchange",payload)){this.menu.setCursor($candidate);if(data)this.input.setInputValue(data.val);else{this.input.resetInputValue();this._updateHint()}this.eventBus.trigger("cursorchange",payload);return true}return false},destroy:function destroy(){this.input.destroy();this.menu.destroy()}});return Typeahead}();(function(){function ttEach($els,fn){$els.each(function(){var $input=
$(this);var typeahead;(typeahead=$input.data(keys.typeahead))&&fn(typeahead,$input)})}function buildHintFromInput($input,www){return $input.clone().addClass(www.classes.hint).removeData().css(www.css.hint).css(getBackgroundStyles($input)).prop("readonly",true).removeAttr("id name placeholder required").attr({autocomplete:"off",spellcheck:"false",tabindex:-1})}function prepInput($input,www){$input.data(keys.attrs,{dir:$input.attr("dir"),autocomplete:$input.attr("autocomplete"),spellcheck:$input.attr("spellcheck"),
style:$input.attr("style")});$input.addClass(www.classes.input).attr({autocomplete:"off",spellcheck:false});try{!$input.attr("dir")&&$input.attr("dir","auto")}catch(e){}return $input}function getBackgroundStyles($el){return{backgroundAttachment:$el.css("background-attachment"),backgroundClip:$el.css("background-clip"),backgroundColor:$el.css("background-color"),backgroundImage:$el.css("background-image"),backgroundOrigin:$el.css("background-origin"),backgroundPosition:$el.css("background-position"),
backgroundRepeat:$el.css("background-repeat"),backgroundSize:$el.css("background-size")}}function revert($input){var www;var $wrapper;www=$input.data(keys.www);$wrapper=$input.parent().filter(www.selectors.wrapper);_.each($input.data(keys.attrs),function(val,key){_.isUndefined(val)?$input.removeAttr(key):$input.attr(key,val)});$input.removeData(keys.typeahead).removeData(keys.www).removeData(keys.attr).removeClass(www.classes.input);if($wrapper.length){$input.detach().insertAfter($wrapper);$wrapper.remove()}}
function $elOrNull(obj){var isValid;var $el;isValid=_.isJQuery(obj)||_.isElement(obj);$el=isValid?$(obj).first():[];return $el.length?$el:null}var old;var keys;var methods;old=$.fn.typeahead;keys={www:"tt-www",attrs:"tt-attrs",typeahead:"tt-typeahead"};methods={initialize:function initialize(o,datasets){function attach(){var $input;var $wrapper;var $hint;var $menu;var defaultHint;var defaultMenu;var eventBus;var input;var menu;var typeahead;var MenuConstructor;_.each(datasets,function(d){d.highlight=
!!o.highlight});$input=$(this);$wrapper=$(www.html.wrapper);$hint=$elOrNull(o.hint);$menu=$elOrNull(o.menu);defaultHint=o.hint!==false&&!$hint;defaultMenu=o.menu!==false&&!$menu;defaultHint&&($hint=buildHintFromInput($input,www));defaultMenu&&($menu=$(www.html.menu).css(www.css.menu));$hint&&$hint.val("");$input=prepInput($input,www);if(defaultHint||defaultMenu){$wrapper.css(www.css.wrapper);$input.css(defaultHint?www.css.input:www.css.inputWithNoHint);$input.wrap($wrapper).parent().prepend(defaultHint?
$hint:null).append(defaultMenu?$menu:null)}MenuConstructor=defaultMenu?DefaultMenu:Menu;eventBus=new EventBus({el:$input});input=new Input({hint:$hint,input:$input},www);menu=new MenuConstructor({node:$menu,datasets:datasets},www);typeahead=new Typeahead({input:input,menu:menu,eventBus:eventBus,minLength:o.minLength},www);$input.data(keys.www,www);$input.data(keys.typeahead,typeahead)}var www;datasets=_.isArray(datasets)?datasets:[].slice.call(arguments,1);o=o||{};www=WWW(o.classNames);return this.each(attach)},
isEnabled:function isEnabled(){var enabled;ttEach(this.first(),function(t){enabled=t.isEnabled()});return enabled},enable:function enable(){ttEach(this,function(t){t.enable()});return this},disable:function disable(){ttEach(this,function(t){t.disable()});return this},isActive:function isActive(){var active;ttEach(this.first(),function(t){active=t.isActive()});return active},activate:function activate(){ttEach(this,function(t){t.activate()});return this},deactivate:function deactivate(){ttEach(this,
function(t){t.deactivate()});return this},isOpen:function isOpen(){var open;ttEach(this.first(),function(t){open=t.isOpen()});return open},open:function open(){ttEach(this,function(t){t.open()});return this},close:function close(){ttEach(this,function(t){t.close()});return this},select:function select(el){var success=false;var $el=$(el);ttEach(this.first(),function(t){success=t.select($el)});return success},autocomplete:function autocomplete(el){var success=false;var $el=$(el);ttEach(this.first(),
function(t){success=t.autocomplete($el)});return success},moveCursor:function moveCursoe(delta){var success=false;ttEach(this.first(),function(t){success=t.moveCursor(delta)});return success},val:function val(newVal){var query;if(!arguments.length){ttEach(this.first(),function(t){query=t.getVal()});return query}else{ttEach(this,function(t){t.setVal(newVal)});return this}},destroy:function destroy(){ttEach(this,function(typeahead,$input){revert($input);typeahead.destroy()});return this}};$.fn.typeahead=
function(method){if(methods[method])return methods[method].apply(this,[].slice.call(arguments,1));else return methods.initialize.apply(this,arguments)};$.fn.typeahead.noConflict=function noConflict(){$.fn.typeahead=old;return this}})()})(jQuery);
/*
 almond 0.3.1 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved.
 Available via the MIT or new BSD license.
 see: http://github.com/jrburke/almond for details
*/
(function(jQuery){var S2=function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var S2=jQuery.fn.select2.amd;(function(){if(!S2||!S2.requirejs){if(!S2)S2={};else require=S2;var requirejs;var require;var define;(function(undef){function hasProp(obj,prop){return hasOwn.call(obj,prop)}function normalize(name,baseName){var nameParts;var nameSegment;var mapValue;var foundMap;var lastIndex;var foundI;var foundStarMap;var starI;var i;var j;var part;var baseParts=baseName&&baseName.split("/");
var map=config.map;var starMap=map&&map["*"]||{};if(name&&name.charAt(0)===".")if(baseName){name=name.split("/");lastIndex=name.length-1;if(config.nodeIdCompat&&jsSuffixRegExp.test(name[lastIndex]))name[lastIndex]=name[lastIndex].replace(jsSuffixRegExp,"");name=baseParts.slice(0,baseParts.length-1).concat(name);for(i=0;i<name.length;i+=1){part=name[i];if(part==="."){name.splice(i,1);i-=1}else if(part==="..")if(i===1&&(name[2]===".."||name[0]===".."))break;else if(i>0){name.splice(i-1,2);i-=2}}name=
name.join("/")}else if(name.indexOf("./")===0)name=name.substring(2);if((baseParts||starMap)&&map){nameParts=name.split("/");for(i=nameParts.length;i>0;i-=1){nameSegment=nameParts.slice(0,i).join("/");if(baseParts)for(j=baseParts.length;j>0;j-=1){mapValue=map[baseParts.slice(0,j).join("/")];if(mapValue){mapValue=mapValue[nameSegment];if(mapValue){foundMap=mapValue;foundI=i;break}}}if(foundMap)break;if(!foundStarMap&&starMap&&starMap[nameSegment]){foundStarMap=starMap[nameSegment];starI=i}}if(!foundMap&&
foundStarMap){foundMap=foundStarMap;foundI=starI}if(foundMap){nameParts.splice(0,foundI,foundMap);name=nameParts.join("/")}}return name}function makeRequire(relName,forceSync){return function(){var args=aps.call(arguments,0);if(typeof args[0]!=="string"&&args.length===1)args.push(null);return req.apply(undef,args.concat([relName,forceSync]))}}function makeNormalize(relName){return function(name){return normalize(name,relName)}}function makeLoad(depName){return function(value){defined[depName]=value}}
function callDep(name){if(hasProp(waiting,name)){var args=waiting[name];delete waiting[name];defining[name]=true;main.apply(undef,args)}if(!hasProp(defined,name)&&!hasProp(defining,name))throw new Error("No "+name);return defined[name]}function splitPrefix(name){var prefix;var index=name?name.indexOf("!"):-1;if(index>-1){prefix=name.substring(0,index);name=name.substring(index+1,name.length)}return[prefix,name]}function makeConfig(name){return function(){return config&&config.config&&config.config[name]||
{}}}var main;var req;var makeMap;var handlers;var defined={};var waiting={};var config={};var defining={};var hasOwn=Object.prototype.hasOwnProperty;var aps=[].slice;var jsSuffixRegExp=/\.js$/;makeMap=function(name,relName){var plugin;var parts=splitPrefix(name);var prefix=parts[0];name=parts[1];if(prefix){prefix=normalize(prefix,relName);plugin=callDep(prefix)}if(prefix)if(plugin&&plugin.normalize)name=plugin.normalize(name,makeNormalize(relName));else name=normalize(name,relName);else{name=normalize(name,
relName);parts=splitPrefix(name);prefix=parts[0];name=parts[1];if(prefix)plugin=callDep(prefix)}return{f:prefix?prefix+"!"+name:name,n:name,pr:prefix,p:plugin}};handlers={require:function(name){return makeRequire(name)},exports:function(name){var e=defined[name];if(typeof e!=="undefined")return e;else return defined[name]={}},module:function(name){return{id:name,uri:"",exports:defined[name],config:makeConfig(name)}}};main=function(name,deps,callback,relName){var cjsModule;var depName;var ret;var map;
var i;var args=[];var callbackType=typeof callback;var usingExports;relName=relName||name;if(callbackType==="undefined"||callbackType==="function"){deps=!deps.length&&callback.length?["require","exports","module"]:deps;for(i=0;i<deps.length;i+=1){map=makeMap(deps[i],relName);depName=map.f;if(depName==="require")args[i]=handlers.require(name);else if(depName==="exports"){args[i]=handlers.exports(name);usingExports=true}else if(depName==="module")cjsModule=args[i]=handlers.module(name);else if(hasProp(defined,
depName)||hasProp(waiting,depName)||hasProp(defining,depName))args[i]=callDep(depName);else if(map.p){map.p.load(map.n,makeRequire(relName,true),makeLoad(depName),{});args[i]=defined[depName]}else throw new Error(name+" missing "+depName);}ret=callback?callback.apply(defined[name],args):undefined;if(name)if(cjsModule&&cjsModule.exports!==undef&&cjsModule.exports!==defined[name])defined[name]=cjsModule.exports;else if(ret!==undef||!usingExports)defined[name]=ret}else if(name)defined[name]=callback};
requirejs=require=req=function(deps,callback,relName,forceSync,alt){if(typeof deps==="string"){if(handlers[deps])return handlers[deps](callback);return callDep(makeMap(deps,callback).f)}else if(!deps.splice){config=deps;if(config.deps)req(config.deps,config.callback);if(!callback)return;if(callback.splice){deps=callback;callback=relName;relName=null}else deps=undef}callback=callback||function(){};if(typeof relName==="function"){relName=forceSync;forceSync=alt}if(forceSync)main(undef,deps,callback,
relName);else setTimeout(function(){main(undef,deps,callback,relName)},4);return req};req.config=function(cfg){return req(cfg)};requirejs._defined=defined;define=function(name,deps,callback){if(typeof name!=="string")throw new Error("See almond README: incorrect module build, no module name");if(!deps.splice){callback=deps;deps=[]}if(!hasProp(defined,name)&&!hasProp(waiting,name))waiting[name]=[name,deps,callback]};define.amd={jQuery:true}})();S2.requirejs=requirejs;S2.require=require;S2.define=define}})();
S2.define("almond",function(){});S2.define("jquery",[],function(){var _$=jQuery||$;if(_$==null&&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.");return _$});S2.define("select2/utils",["jquery"],function($){function getMethods(theClass){var proto=theClass.prototype;var methods=[];for(var methodName in proto){var m=proto[methodName];if(typeof m!=="function")continue;
if(methodName==="constructor")continue;methods.push(methodName)}return methods}var Utils={};Utils.Extend=function(ChildClass,SuperClass){function BaseConstructor(){this.constructor=ChildClass}var __hasProp={}.hasOwnProperty;for(var key in SuperClass)if(__hasProp.call(SuperClass,key))ChildClass[key]=SuperClass[key];BaseConstructor.prototype=SuperClass.prototype;ChildClass.prototype=new BaseConstructor;ChildClass.__super__=SuperClass.prototype;return ChildClass};Utils.Decorate=function(SuperClass,DecoratorClass){function DecoratedClass(){var unshift=
Array.prototype.unshift;var argCount=DecoratorClass.prototype.constructor.length;var calledConstructor=SuperClass.prototype.constructor;if(argCount>0){unshift.call(arguments,SuperClass.prototype.constructor);calledConstructor=DecoratorClass.prototype.constructor}calledConstructor.apply(this,arguments)}function ctr(){this.constructor=DecoratedClass}var decoratedMethods=getMethods(DecoratorClass);var superMethods=getMethods(SuperClass);DecoratorClass.displayName=SuperClass.displayName;DecoratedClass.prototype=
new ctr;for(var m=0;m<superMethods.length;m++){var superMethod=superMethods[m];DecoratedClass.prototype[superMethod]=SuperClass.prototype[superMethod]}var calledMethod=function(methodName){var originalMethod=function(){};if(methodName in DecoratedClass.prototype)originalMethod=DecoratedClass.prototype[methodName];var decoratedMethod=DecoratorClass.prototype[methodName];return function(){var unshift=Array.prototype.unshift;unshift.call(arguments,originalMethod);return decoratedMethod.apply(this,arguments)}};
for(var d=0;d<decoratedMethods.length;d++){var decoratedMethod=decoratedMethods[d];DecoratedClass.prototype[decoratedMethod]=calledMethod(decoratedMethod)}return DecoratedClass};var Observable=function(){this.listeners={}};Observable.prototype.on=function(event,callback){this.listeners=this.listeners||{};if(event in this.listeners)this.listeners[event].push(callback);else this.listeners[event]=[callback]};Observable.prototype.trigger=function(event){var slice=Array.prototype.slice;this.listeners=
this.listeners||{};if(event in this.listeners)this.invoke(this.listeners[event],slice.call(arguments,1));if("*"in this.listeners)this.invoke(this.listeners["*"],arguments)};Observable.prototype.invoke=function(listeners,params){var i=0;for(var len=listeners.length;i<len;i++)listeners[i].apply(this,params)};Utils.Observable=Observable;Utils.generateChars=function(length){var chars="";for(var i=0;i<length;i++){var randomChar=Math.floor(Math.random()*36);chars+=randomChar.toString(36)}return chars};
Utils.bind=function(func,context){return function(){func.apply(context,arguments)}};Utils._convertData=function(data){for(var originalKey in data){var keys=originalKey.split("-");var dataLevel=data;if(keys.length===1)continue;for(var k=0;k<keys.length;k++){var key=keys[k];key=key.substring(0,1).toLowerCase()+key.substring(1);if(!(key in dataLevel))dataLevel[key]={};if(k==keys.length-1)dataLevel[key]=data[originalKey];dataLevel=dataLevel[key]}delete data[originalKey]}return data};Utils.hasScroll=function(index,
el){var $el=$(el);var overflowX=el.style.overflowX;var overflowY=el.style.overflowY;if(overflowX===overflowY&&(overflowY==="hidden"||overflowY==="visible"))return false;if(overflowX==="scroll"||overflowY==="scroll")return true;return $el.innerHeight()<el.scrollHeight||$el.innerWidth()<el.scrollWidth};Utils.escapeMarkup=function(markup){var replaceMap={"\\":"\x26#92;","\x26":"\x26amp;","\x3c":"\x26lt;","\x3e":"\x26gt;",'"':"\x26quot;","'":"\x26#39;","/":"\x26#47;"};if(typeof markup!=="string")return markup;
return String(markup).replace(/[&<>"'\/\\]/g,function(match){return replaceMap[match]})};Utils.appendMany=function($element,$nodes){if($.fn.jquery.substr(0,3)==="1.7"){var $jqNodes=$();$.map($nodes,function(node){$jqNodes=$jqNodes.add(node)});$nodes=$jqNodes}$element.append($nodes)};return Utils});S2.define("select2/results",["jquery","./utils"],function($,Utils){function Results($element,options,dataAdapter){this.$element=$element;this.data=dataAdapter;this.options=options;Results.__super__.constructor.call(this)}
Utils.Extend(Results,Utils.Observable);Results.prototype.render=function(){var $results=$('\x3cul class\x3d"select2-results__options" role\x3d"tree"\x3e\x3c/ul\x3e');if(this.options.get("multiple"))$results.attr("aria-multiselectable","true");this.$results=$results;return $results};Results.prototype.clear=function(){this.$results.empty()};Results.prototype.displayMessage=function(params){var escapeMarkup=this.options.get("escapeMarkup");this.clear();this.hideLoading();var $message=$('\x3cli role\x3d"treeitem" aria-live\x3d"assertive"'+
' class\x3d"select2-results__option"\x3e\x3c/li\x3e');var message=this.options.get("translations").get(params.message);$message.append(escapeMarkup(message(params.args)));$message[0].className+=" select2-results__message";this.$results.append($message)};Results.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()};Results.prototype.append=function(data){this.hideLoading();var $options=[];if(data.results==null||data.results.length===0){if(this.$results.children().length===
0)this.trigger("results:message",{message:"noResults"});return}data.results=this.sort(data.results);for(var d=0;d<data.results.length;d++){var item=data.results[d];var $option=this.option(item);$options.push($option)}this.$results.append($options)};Results.prototype.position=function($results,$dropdown){var $resultsContainer=$dropdown.find(".select2-results");$resultsContainer.append($results)};Results.prototype.sort=function(data){var sorter=this.options.get("sorter");return sorter(data)};Results.prototype.setClasses=
function(){var self=this;this.data.current(function(selected){var selectedIds=$.map(selected,function(s){return s.id.toString()});var $options=self.$results.find(".select2-results__option[aria-selected]");$options.each(function(){var $option=$(this);var item=$.data(this,"data");var id=""+item.id;if(item.element!=null&&item.element.selected||item.element==null&&$.inArray(id,selectedIds)>-1)$option.attr("aria-selected","true");else $option.attr("aria-selected","false")});var $selected=$options.filter("[aria-selected\x3dtrue]");
if($selected.length>0)$selected.first().trigger("mouseenter");else $options.first().trigger("mouseenter")})};Results.prototype.showLoading=function(params){this.hideLoading();var loadingMore=this.options.get("translations").get("searching");var loading={disabled:true,loading:true,text:loadingMore(params)};var $loading=this.option(loading);$loading.className+=" loading-results";this.$results.prepend($loading)};Results.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()};
Results.prototype.option=function(data){var option=document.createElement("li");option.className="select2-results__option";var attrs={"role":"treeitem","aria-selected":"false"};if(data.disabled){delete attrs["aria-selected"];attrs["aria-disabled"]="true"}if(data.id==null)delete attrs["aria-selected"];if(data._resultId!=null)option.id=data._resultId;if(data.title)option.title=data.title;if(data.children){attrs.role="group";attrs["aria-label"]=data.text;delete attrs["aria-selected"]}for(var attr in attrs){var val=
attrs[attr];option.setAttribute(attr,val)}if(data.children){var $option=$(option);var label=document.createElement("strong");label.className="select2-results__group";var $label=$(label);this.template(data,label);var $children=[];for(var c=0;c<data.children.length;c++){var child=data.children[c];var $child=this.option(child);$children.push($child)}var $childrenContainer=$("\x3cul\x3e\x3c/ul\x3e",{"class":"select2-results__options select2-results__options--nested"});$childrenContainer.append($children);
$option.append(label);$option.append($childrenContainer)}else this.template(data,option);$.data(option,"data",data);return option};Results.prototype.bind=function(container,$container){var self=this;var id=container.id+"-results";this.$results.attr("id",id);container.on("results:all",function(params){self.clear();self.append(params.data);if(container.isOpen())self.setClasses()});container.on("results:append",function(params){self.append(params.data);if(container.isOpen())self.setClasses()});container.on("query",
function(params){self.hideMessages();self.showLoading(params)});container.on("select",function(){if(!container.isOpen())return;self.setClasses()});container.on("unselect",function(){if(!container.isOpen())return;self.setClasses()});container.on("open",function(){self.$results.attr("aria-expanded","true");self.$results.attr("aria-hidden","false");self.setClasses();self.ensureHighlightVisible()});container.on("close",function(){self.$results.attr("aria-expanded","false");self.$results.attr("aria-hidden",
"true");self.$results.removeAttr("aria-activedescendant")});container.on("results:toggle",function(){var $highlighted=self.getHighlightedResults();if($highlighted.length===0)return;$highlighted.trigger("mouseup")});container.on("results:select",function(){var $highlighted=self.getHighlightedResults();if($highlighted.length===0)return;var data=$highlighted.data("data");if($highlighted.attr("aria-selected")=="true")self.trigger("close",{});else self.trigger("select",{data:data})});container.on("results:previous",
function(){var $highlighted=self.getHighlightedResults();var $options=self.$results.find("[aria-selected]");var currentIndex=$options.index($highlighted);if(currentIndex===0)return;var nextIndex=currentIndex-1;if($highlighted.length===0)nextIndex=0;var $next=$options.eq(nextIndex);$next.trigger("mouseenter");var currentOffset=self.$results.offset().top;var nextTop=$next.offset().top;var nextOffset=self.$results.scrollTop()+(nextTop-currentOffset);if(nextIndex===0)self.$results.scrollTop(0);else if(nextTop-
currentOffset<0)self.$results.scrollTop(nextOffset)});container.on("results:next",function(){var $highlighted=self.getHighlightedResults();var $options=self.$results.find("[aria-selected]");var currentIndex=$options.index($highlighted);var nextIndex=currentIndex+1;if(nextIndex>=$options.length)return;var $next=$options.eq(nextIndex);$next.trigger("mouseenter");var currentOffset=self.$results.offset().top+self.$results.outerHeight(false);var nextBottom=$next.offset().top+$next.outerHeight(false);var nextOffset=
self.$results.scrollTop()+nextBottom-currentOffset;if(nextIndex===0)self.$results.scrollTop(0);else if(nextBottom>currentOffset)self.$results.scrollTop(nextOffset)});container.on("results:focus",function(params){params.element.addClass("select2-results__option--highlighted")});container.on("results:message",function(params){self.displayMessage(params)});if($.fn.mousewheel)this.$results.on("mousewheel",function(e){var top=self.$results.scrollTop();var bottom=self.$results.get(0).scrollHeight-self.$results.scrollTop()+
e.deltaY;var isAtTop=e.deltaY>0&&top-e.deltaY<=0;var isAtBottom=e.deltaY<0&&bottom<=self.$results.height();if(isAtTop){self.$results.scrollTop(0);e.preventDefault();e.stopPropagation()}else if(isAtBottom){self.$results.scrollTop(self.$results.get(0).scrollHeight-self.$results.height());e.preventDefault();e.stopPropagation()}});this.$results.on("mouseup",".select2-results__option[aria-selected]",function(evt){var $this=$(this);var data=$this.data("data");if($this.attr("aria-selected")==="true"){if(self.options.get("multiple"))self.trigger("unselect",
{originalEvent:evt,data:data});else self.trigger("close",{});return}self.trigger("select",{originalEvent:evt,data:data})});this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(evt){var data=$(this).data("data");self.getHighlightedResults().removeClass("select2-results__option--highlighted");self.trigger("results:focus",{data:data,element:$(this)})})};Results.prototype.getHighlightedResults=function(){var $highlighted=this.$results.find(".select2-results__option--highlighted");
return $highlighted};Results.prototype.destroy=function(){this.$results.remove()};Results.prototype.ensureHighlightVisible=function(){var $highlighted=this.getHighlightedResults();if($highlighted.length===0)return;var $options=this.$results.find("[aria-selected]");var currentIndex=$options.index($highlighted);var currentOffset=this.$results.offset().top;var nextTop=$highlighted.offset().top;var nextOffset=this.$results.scrollTop()+(nextTop-currentOffset);var offsetDelta=nextTop-currentOffset;nextOffset-=
$highlighted.outerHeight(false)*2;if(currentIndex<=2)this.$results.scrollTop(0);else if(offsetDelta>this.$results.outerHeight()||offsetDelta<0)this.$results.scrollTop(nextOffset)};Results.prototype.template=function(result,container){var template=this.options.get("templateResult");var escapeMarkup=this.options.get("escapeMarkup");var content=template(result,container);if(content==null)container.style.display="none";else if(typeof content==="string")container.innerHTML=escapeMarkup(content);else $(container).append(content)};
return Results});S2.define("select2/keys",[],function(){var KEYS={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 KEYS});S2.define("select2/selection/base",["jquery","../utils","../keys"],function($,Utils,KEYS){function BaseSelection($element,options){this.$element=$element;this.options=options;BaseSelection.__super__.constructor.call(this)}Utils.Extend(BaseSelection,Utils.Observable);BaseSelection.prototype.render=
function(){var $selection=$('\x3cspan class\x3d"select2-selection" role\x3d"combobox" '+' aria-haspopup\x3d"true" aria-expanded\x3d"false"\x3e'+"\x3c/span\x3e");this._tabindex=0;if(this.$element.data("old-tabindex")!=null)this._tabindex=this.$element.data("old-tabindex");else if(this.$element.attr("tabindex")!=null)this._tabindex=this.$element.attr("tabindex");$selection.attr("title",this.$element.attr("title"));$selection.attr("tabindex",this._tabindex);this.$selection=$selection;return $selection};
BaseSelection.prototype.bind=function(container,$container){var self=this;var id=container.id+"-container";var resultsId=container.id+"-results";this.container=container;this.$selection.on("focus",function(evt){self.trigger("focus",evt)});this.$selection.on("blur",function(evt){self._handleBlur(evt)});this.$selection.on("keydown",function(evt){self.trigger("keypress",evt);if(evt.which===KEYS.SPACE)evt.preventDefault()});container.on("results:focus",function(params){self.$selection.attr("aria-activedescendant",
params.data._resultId)});container.on("selection:update",function(params){self.update(params.data)});container.on("open",function(){self.$selection.attr("aria-expanded","true");self.$selection.attr("aria-owns",resultsId);self._attachCloseHandler(container)});container.on("close",function(){self.$selection.attr("aria-expanded","false");self.$selection.removeAttr("aria-activedescendant");self.$selection.removeAttr("aria-owns");self.$selection.focus();self._detachCloseHandler(container)});container.on("enable",
function(){self.$selection.attr("tabindex",self._tabindex)});container.on("disable",function(){self.$selection.attr("tabindex","-1")})};BaseSelection.prototype._handleBlur=function(evt){var self=this;window.setTimeout(function(){if(document.activeElement==self.$selection[0]||$.contains(self.$selection[0],document.activeElement))return;self.trigger("blur",evt)},1)};BaseSelection.prototype._attachCloseHandler=function(container){var self=this;$(document.body).on("mousedown.select2."+container.id,function(e){var $target=
$(e.target);var $select=$target.closest(".select2");var $all=$(".select2.select2-container--open");$all.each(function(){var $this=$(this);if(this==$select[0])return;var $element=$this.data("element");$element.select2("close")})})};BaseSelection.prototype._detachCloseHandler=function(container){$(document.body).off("mousedown.select2."+container.id)};BaseSelection.prototype.position=function($selection,$container){var $selectionContainer=$container.find(".selection");$selectionContainer.append($selection)};
BaseSelection.prototype.destroy=function(){this._detachCloseHandler(this.container)};BaseSelection.prototype.update=function(data){throw new Error("The `update` method must be defined in child classes.");};return BaseSelection});S2.define("select2/selection/single",["jquery","./base","../utils","../keys"],function($,BaseSelection,Utils,KEYS){function SingleSelection(){SingleSelection.__super__.constructor.apply(this,arguments)}Utils.Extend(SingleSelection,BaseSelection);SingleSelection.prototype.render=
function(){var $selection=SingleSelection.__super__.render.call(this);$selection.addClass("select2-selection--single");$selection.html('\x3cspan class\x3d"select2-selection__rendered"\x3e\x3c/span\x3e'+'\x3cspan class\x3d"select2-selection__arrow" role\x3d"presentation"\x3e'+'\x3cb role\x3d"presentation"\x3e\x3c/b\x3e'+"\x3c/span\x3e");return $selection};SingleSelection.prototype.bind=function(container,$container){var self=this;SingleSelection.__super__.bind.apply(this,arguments);var id=container.id+
"-container";this.$selection.find(".select2-selection__rendered").attr("id",id);this.$selection.attr("aria-labelledby",id);this.$selection.on("mousedown",function(evt){if(evt.which!==1)return;self.trigger("toggle",{originalEvent:evt})});this.$selection.on("focus",function(evt){});this.$selection.on("blur",function(evt){});container.on("selection:update",function(params){self.update(params.data)})};SingleSelection.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()};
SingleSelection.prototype.display=function(data,container){var template=this.options.get("templateSelection");var escapeMarkup=this.options.get("escapeMarkup");return escapeMarkup(template(data,container))};SingleSelection.prototype.selectionContainer=function(){return $("\x3cspan\x3e\x3c/span\x3e")};SingleSelection.prototype.update=function(data){if(data.length===0){this.clear();return}var selection=data[0];var $rendered=this.$selection.find(".select2-selection__rendered");var formatted=this.display(selection,
$rendered);$rendered.empty().append(formatted);$rendered.prop("title",selection.title||selection.text)};return SingleSelection});S2.define("select2/selection/multiple",["jquery","./base","../utils"],function($,BaseSelection,Utils){function MultipleSelection($element,options){MultipleSelection.__super__.constructor.apply(this,arguments)}Utils.Extend(MultipleSelection,BaseSelection);MultipleSelection.prototype.render=function(){var $selection=MultipleSelection.__super__.render.call(this);$selection.addClass("select2-selection--multiple");
$selection.html('\x3cul class\x3d"select2-selection__rendered"\x3e\x3c/ul\x3e');return $selection};MultipleSelection.prototype.bind=function(container,$container){var self=this;MultipleSelection.__super__.bind.apply(this,arguments);this.$selection.on("click",function(evt){self.trigger("toggle",{originalEvent:evt})});this.$selection.on("click",".select2-selection__choice__remove",function(evt){if(self.options.get("disabled"))return;var $remove=$(this);var $selection=$remove.parent();var data=$selection.data("data");
self.trigger("unselect",{originalEvent:evt,data:data})})};MultipleSelection.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()};MultipleSelection.prototype.display=function(data,container){var template=this.options.get("templateSelection");var escapeMarkup=this.options.get("escapeMarkup");return escapeMarkup(template(data,container))};MultipleSelection.prototype.selectionContainer=function(){var $container=$('\x3cli class\x3d"select2-selection__choice"\x3e'+'\x3cspan class\x3d"select2-selection__choice__remove" role\x3d"presentation"\x3e'+
"\x26times;"+"\x3c/span\x3e"+"\x3c/li\x3e");return $container};MultipleSelection.prototype.update=function(data){this.clear();if(data.length===0)return;var $selections=[];for(var d=0;d<data.length;d++){var selection=data[d];var $selection=this.selectionContainer();var formatted=this.display(selection,$selection);$selection.append(formatted);$selection.prop("title",selection.title||selection.text);$selection.data("data",selection);$selections.push($selection)}var $rendered=this.$selection.find(".select2-selection__rendered");
Utils.appendMany($rendered,$selections)};return MultipleSelection});S2.define("select2/selection/placeholder",["../utils"],function(Utils){function Placeholder(decorated,$element,options){this.placeholder=this.normalizePlaceholder(options.get("placeholder"));decorated.call(this,$element,options)}Placeholder.prototype.normalizePlaceholder=function(_,placeholder){if(typeof placeholder==="string")placeholder={id:"",text:placeholder};return placeholder};Placeholder.prototype.createPlaceholder=function(decorated,
placeholder){var $placeholder=this.selectionContainer();$placeholder.html(this.display(placeholder));$placeholder.addClass("select2-selection__placeholder").removeClass("select2-selection__choice");return $placeholder};Placeholder.prototype.update=function(decorated,data){var singlePlaceholder=data.length==1&&data[0].id!=this.placeholder.id;var multipleSelections=data.length>1;if(multipleSelections||singlePlaceholder)return decorated.call(this,data);this.clear();var $placeholder=this.createPlaceholder(this.placeholder);
this.$selection.find(".select2-selection__rendered").append($placeholder)};return Placeholder});S2.define("select2/selection/allowClear",["jquery","../keys"],function($,KEYS){function AllowClear(){}AllowClear.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container);if(this.placeholder==null)if(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(evt){self._handleClear(evt)});container.on("keypress",function(evt){self._handleKeyboardClear(evt,container)})};AllowClear.prototype._handleClear=function(_,evt){if(this.options.get("disabled"))return;var $clear=this.$selection.find(".select2-selection__clear");if($clear.length===0)return;evt.stopPropagation();var data=$clear.data("data");for(var d=0;d<data.length;d++){var unselectData={data:data[d]};this.trigger("unselect",unselectData);
if(unselectData.prevented)return}this.$element.val(this.placeholder.id).trigger("change");this.trigger("toggle",{})};AllowClear.prototype._handleKeyboardClear=function(_,evt,container){if(container.isOpen())return;if(evt.which==KEYS.DELETE||evt.which==KEYS.BACKSPACE)this._handleClear(evt)};AllowClear.prototype.update=function(decorated,data){decorated.call(this,data);if(this.$selection.find(".select2-selection__placeholder").length>0||data.length===0)return;var $remove=$('\x3cspan class\x3d"select2-selection__clear"\x3e'+
"\x26times;"+"\x3c/span\x3e");$remove.data("data",data);this.$selection.find(".select2-selection__rendered").prepend($remove)};return AllowClear});S2.define("select2/selection/search",["jquery","../utils","../keys"],function($,Utils,KEYS){function Search(decorated,$element,options){decorated.call(this,$element,options)}Search.prototype.render=function(decorated){var $search=$('\x3cli class\x3d"select2-search select2-search--inline"\x3e'+'\x3cinput class\x3d"select2-search__field" type\x3d"search" tabindex\x3d"-1"'+
' autocomplete\x3d"off" autocorrect\x3d"off" autocapitalize\x3d"off"'+' spellcheck\x3d"false" role\x3d"textbox" aria-autocomplete\x3d"list" /\x3e'+"\x3c/li\x3e");this.$searchContainer=$search;this.$search=$search.find("input");var $rendered=decorated.call(this);this._transferTabIndex();return $rendered};Search.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container);container.on("open",function(){self.$search.trigger("focus")});container.on("close",
function(){self.$search.val("");self.$search.removeAttr("aria-activedescendant");self.$search.trigger("focus")});container.on("enable",function(){self.$search.prop("disabled",false);self._transferTabIndex()});container.on("disable",function(){self.$search.prop("disabled",true)});container.on("focus",function(evt){self.$search.trigger("focus")});container.on("results:focus",function(params){self.$search.attr("aria-activedescendant",params.id)});this.$selection.on("focusin",".select2-search--inline",
function(evt){self.trigger("focus",evt)});this.$selection.on("focusout",".select2-search--inline",function(evt){self._handleBlur(evt)});this.$selection.on("keydown",".select2-search--inline",function(evt){evt.stopPropagation();self.trigger("keypress",evt);self._keyUpPrevented=evt.isDefaultPrevented();var key=evt.which;if(key===KEYS.BACKSPACE&&self.$search.val()===""){var $previousChoice=self.$searchContainer.prev(".select2-selection__choice");if($previousChoice.length>0){var item=$previousChoice.data("data");
self.searchRemoveChoice(item);evt.preventDefault()}}});var msie=document.documentMode;var disableInputEvents=msie&&msie<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(evt){if(disableInputEvents){self.$selection.off("input.search input.searchcheck");return}self.$selection.off("keyup.search")});this.$selection.on("keyup.search input.search",".select2-search--inline",function(evt){if(disableInputEvents&&evt.type==="input"){self.$selection.off("input.search input.searchcheck");
return}var key=evt.which;if(key==KEYS.SHIFT||key==KEYS.CTRL||key==KEYS.ALT)return;if(key==KEYS.TAB)return;self.handleSearch(evt)})};Search.prototype._transferTabIndex=function(decorated){this.$search.attr("tabindex",this.$selection.attr("tabindex"));this.$selection.attr("tabindex","-1")};Search.prototype.createPlaceholder=function(decorated,placeholder){this.$search.attr("placeholder",placeholder.text)};Search.prototype.update=function(decorated,data){var searchHadFocus=this.$search[0]==document.activeElement;
this.$search.attr("placeholder","");decorated.call(this,data);this.$selection.find(".select2-selection__rendered").append(this.$searchContainer);this.resizeSearch();if(searchHadFocus)this.$search.focus()};Search.prototype.handleSearch=function(){this.resizeSearch();if(!this._keyUpPrevented){var input=this.$search.val();this.trigger("query",{term:input})}this._keyUpPrevented=false};Search.prototype.searchRemoveChoice=function(decorated,item){this.trigger("unselect",{data:item});this.$search.val(item.text);
this.handleSearch()};Search.prototype.resizeSearch=function(){this.$search.css("width","25px");var width="";if(this.$search.attr("placeholder")!=="")width=this.$selection.find(".select2-selection__rendered").innerWidth();else{var minimumWidth=this.$search.val().length+1;width=minimumWidth*.75+"em"}this.$search.css("width",width)};return Search});S2.define("select2/selection/eventRelay",["jquery"],function($){function EventRelay(){}EventRelay.prototype.bind=function(decorated,container,$container){var self=
this;var relayEvents=["open","opening","close","closing","select","selecting","unselect","unselecting"];var preventableEvents=["opening","closing","selecting","unselecting"];decorated.call(this,container,$container);container.on("*",function(name,params){if($.inArray(name,relayEvents)===-1)return;params=params||{};var evt=$.Event("select2:"+name,{params:params});self.$element.trigger(evt);if($.inArray(name,preventableEvents)===-1)return;params.prevented=evt.isDefaultPrevented()})};return EventRelay});
S2.define("select2/translation",["jquery","require"],function($,require){function Translation(dict){this.dict=dict||{}}Translation.prototype.all=function(){return this.dict};Translation.prototype.get=function(key){return this.dict[key]};Translation.prototype.extend=function(translation){this.dict=$.extend({},translation.all(),this.dict)};Translation._cache={};Translation.loadPath=function(path){if(!(path in Translation._cache)){var translations=require(path);Translation._cache[path]=translations}return new Translation(Translation._cache[path])};
return Translation});S2.define("select2/diacritics",[],function(){var diacritics={"\u24b6":"A","\uff21":"A","\u00c0":"A","\u00c1":"A","\u00c2":"A","\u1ea6":"A","\u1ea4":"A","\u1eaa":"A","\u1ea8":"A","\u00c3":"A","\u0100":"A","\u0102":"A","\u1eb0":"A","\u1eae":"A","\u1eb4":"A","\u1eb2":"A","\u0226":"A","\u01e0":"A","\u00c4":"A","\u01de":"A","\u1ea2":"A","\u00c5":"A","\u01fa":"A","\u01cd":"A","\u0200":"A","\u0202":"A","\u1ea0":"A","\u1eac":"A","\u1eb6":"A","\u1e00":"A","\u0104":"A","\u023a":"A","\u2c6f":"A",
"\ua732":"AA","\u00c6":"AE","\u01fc":"AE","\u01e2":"AE","\ua734":"AO","\ua736":"AU","\ua738":"AV","\ua73a":"AV","\ua73c":"AY","\u24b7":"B","\uff22":"B","\u1e02":"B","\u1e04":"B","\u1e06":"B","\u0243":"B","\u0182":"B","\u0181":"B","\u24b8":"C","\uff23":"C","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u00c7":"C","\u1e08":"C","\u0187":"C","\u023b":"C","\ua73e":"C","\u24b9":"D","\uff24":"D","\u1e0a":"D","\u010e":"D","\u1e0c":"D","\u1e10":"D","\u1e12":"D","\u1e0e":"D","\u0110":"D","\u018b":"D",
"\u018a":"D","\u0189":"D","\ua779":"D","\u01f1":"DZ","\u01c4":"DZ","\u01f2":"Dz","\u01c5":"Dz","\u24ba":"E","\uff25":"E","\u00c8":"E","\u00c9":"E","\u00ca":"E","\u1ec0":"E","\u1ebe":"E","\u1ec4":"E","\u1ec2":"E","\u1ebc":"E","\u0112":"E","\u1e14":"E","\u1e16":"E","\u0114":"E","\u0116":"E","\u00cb":"E","\u1eba":"E","\u011a":"E","\u0204":"E","\u0206":"E","\u1eb8":"E","\u1ec6":"E","\u0228":"E","\u1e1c":"E","\u0118":"E","\u1e18":"E","\u1e1a":"E","\u0190":"E","\u018e":"E","\u24bb":"F","\uff26":"F","\u1e1e":"F",
"\u0191":"F","\ua77b":"F","\u24bc":"G","\uff27":"G","\u01f4":"G","\u011c":"G","\u1e20":"G","\u011e":"G","\u0120":"G","\u01e6":"G","\u0122":"G","\u01e4":"G","\u0193":"G","\ua7a0":"G","\ua77d":"G","\ua77e":"G","\u24bd":"H","\uff28":"H","\u0124":"H","\u1e22":"H","\u1e26":"H","\u021e":"H","\u1e24":"H","\u1e28":"H","\u1e2a":"H","\u0126":"H","\u2c67":"H","\u2c75":"H","\ua78d":"H","\u24be":"I","\uff29":"I","\u00cc":"I","\u00cd":"I","\u00ce":"I","\u0128":"I","\u012a":"I","\u012c":"I","\u0130":"I","\u00cf":"I",
"\u1e2e":"I","\u1ec8":"I","\u01cf":"I","\u0208":"I","\u020a":"I","\u1eca":"I","\u012e":"I","\u1e2c":"I","\u0197":"I","\u24bf":"J","\uff2a":"J","\u0134":"J","\u0248":"J","\u24c0":"K","\uff2b":"K","\u1e30":"K","\u01e8":"K","\u1e32":"K","\u0136":"K","\u1e34":"K","\u0198":"K","\u2c69":"K","\ua740":"K","\ua742":"K","\ua744":"K","\ua7a2":"K","\u24c1":"L","\uff2c":"L","\u013f":"L","\u0139":"L","\u013d":"L","\u1e36":"L","\u1e38":"L","\u013b":"L","\u1e3c":"L","\u1e3a":"L","\u0141":"L","\u023d":"L","\u2c62":"L",
"\u2c60":"L","\ua748":"L","\ua746":"L","\ua780":"L","\u01c7":"LJ","\u01c8":"Lj","\u24c2":"M","\uff2d":"M","\u1e3e":"M","\u1e40":"M","\u1e42":"M","\u2c6e":"M","\u019c":"M","\u24c3":"N","\uff2e":"N","\u01f8":"N","\u0143":"N","\u00d1":"N","\u1e44":"N","\u0147":"N","\u1e46":"N","\u0145":"N","\u1e4a":"N","\u1e48":"N","\u0220":"N","\u019d":"N","\ua790":"N","\ua7a4":"N","\u01ca":"NJ","\u01cb":"Nj","\u24c4":"O","\uff2f":"O","\u00d2":"O","\u00d3":"O","\u00d4":"O","\u1ed2":"O","\u1ed0":"O","\u1ed6":"O","\u1ed4":"O",
"\u00d5":"O","\u1e4c":"O","\u022c":"O","\u1e4e":"O","\u014c":"O","\u1e50":"O","\u1e52":"O","\u014e":"O","\u022e":"O","\u0230":"O","\u00d6":"O","\u022a":"O","\u1ece":"O","\u0150":"O","\u01d1":"O","\u020c":"O","\u020e":"O","\u01a0":"O","\u1edc":"O","\u1eda":"O","\u1ee0":"O","\u1ede":"O","\u1ee2":"O","\u1ecc":"O","\u1ed8":"O","\u01ea":"O","\u01ec":"O","\u00d8":"O","\u01fe":"O","\u0186":"O","\u019f":"O","\ua74a":"O","\ua74c":"O","\u01a2":"OI","\ua74e":"OO","\u0222":"OU","\u24c5":"P","\uff30":"P","\u1e54":"P",
"\u1e56":"P","\u01a4":"P","\u2c63":"P","\ua750":"P","\ua752":"P","\ua754":"P","\u24c6":"Q","\uff31":"Q","\ua756":"Q","\ua758":"Q","\u024a":"Q","\u24c7":"R","\uff32":"R","\u0154":"R","\u1e58":"R","\u0158":"R","\u0210":"R","\u0212":"R","\u1e5a":"R","\u1e5c":"R","\u0156":"R","\u1e5e":"R","\u024c":"R","\u2c64":"R","\ua75a":"R","\ua7a6":"R","\ua782":"R","\u24c8":"S","\uff33":"S","\u1e9e":"S","\u015a":"S","\u1e64":"S","\u015c":"S","\u1e60":"S","\u0160":"S","\u1e66":"S","\u1e62":"S","\u1e68":"S","\u0218":"S",
"\u015e":"S","\u2c7e":"S","\ua7a8":"S","\ua784":"S","\u24c9":"T","\uff34":"T","\u1e6a":"T","\u0164":"T","\u1e6c":"T","\u021a":"T","\u0162":"T","\u1e70":"T","\u1e6e":"T","\u0166":"T","\u01ac":"T","\u01ae":"T","\u023e":"T","\ua786":"T","\ua728":"TZ","\u24ca":"U","\uff35":"U","\u00d9":"U","\u00da":"U","\u00db":"U","\u0168":"U","\u1e78":"U","\u016a":"U","\u1e7a":"U","\u016c":"U","\u00dc":"U","\u01db":"U","\u01d7":"U","\u01d5":"U","\u01d9":"U","\u1ee6":"U","\u016e":"U","\u0170":"U","\u01d3":"U","\u0214":"U",
"\u0216":"U","\u01af":"U","\u1eea":"U","\u1ee8":"U","\u1eee":"U","\u1eec":"U","\u1ef0":"U","\u1ee4":"U","\u1e72":"U","\u0172":"U","\u1e76":"U","\u1e74":"U","\u0244":"U","\u24cb":"V","\uff36":"V","\u1e7c":"V","\u1e7e":"V","\u01b2":"V","\ua75e":"V","\u0245":"V","\ua760":"VY","\u24cc":"W","\uff37":"W","\u1e80":"W","\u1e82":"W","\u0174":"W","\u1e86":"W","\u1e84":"W","\u1e88":"W","\u2c72":"W","\u24cd":"X","\uff38":"X","\u1e8a":"X","\u1e8c":"X","\u24ce":"Y","\uff39":"Y","\u1ef2":"Y","\u00dd":"Y","\u0176":"Y",
"\u1ef8":"Y","\u0232":"Y","\u1e8e":"Y","\u0178":"Y","\u1ef6":"Y","\u1ef4":"Y","\u01b3":"Y","\u024e":"Y","\u1efe":"Y","\u24cf":"Z","\uff3a":"Z","\u0179":"Z","\u1e90":"Z","\u017b":"Z","\u017d":"Z","\u1e92":"Z","\u1e94":"Z","\u01b5":"Z","\u0224":"Z","\u2c7f":"Z","\u2c6b":"Z","\ua762":"Z","\u24d0":"a","\uff41":"a","\u1e9a":"a","\u00e0":"a","\u00e1":"a","\u00e2":"a","\u1ea7":"a","\u1ea5":"a","\u1eab":"a","\u1ea9":"a","\u00e3":"a","\u0101":"a","\u0103":"a","\u1eb1":"a","\u1eaf":"a","\u1eb5":"a","\u1eb3":"a",
"\u0227":"a","\u01e1":"a","\u00e4":"a","\u01df":"a","\u1ea3":"a","\u00e5":"a","\u01fb":"a","\u01ce":"a","\u0201":"a","\u0203":"a","\u1ea1":"a","\u1ead":"a","\u1eb7":"a","\u1e01":"a","\u0105":"a","\u2c65":"a","\u0250":"a","\ua733":"aa","\u00e6":"ae","\u01fd":"ae","\u01e3":"ae","\ua735":"ao","\ua737":"au","\ua739":"av","\ua73b":"av","\ua73d":"ay","\u24d1":"b","\uff42":"b","\u1e03":"b","\u1e05":"b","\u1e07":"b","\u0180":"b","\u0183":"b","\u0253":"b","\u24d2":"c","\uff43":"c","\u0107":"c","\u0109":"c",
"\u010b":"c","\u010d":"c","\u00e7":"c","\u1e09":"c","\u0188":"c","\u023c":"c","\ua73f":"c","\u2184":"c","\u24d3":"d","\uff44":"d","\u1e0b":"d","\u010f":"d","\u1e0d":"d","\u1e11":"d","\u1e13":"d","\u1e0f":"d","\u0111":"d","\u018c":"d","\u0256":"d","\u0257":"d","\ua77a":"d","\u01f3":"dz","\u01c6":"dz","\u24d4":"e","\uff45":"e","\u00e8":"e","\u00e9":"e","\u00ea":"e","\u1ec1":"e","\u1ebf":"e","\u1ec5":"e","\u1ec3":"e","\u1ebd":"e","\u0113":"e","\u1e15":"e","\u1e17":"e","\u0115":"e","\u0117":"e","\u00eb":"e",
"\u1ebb":"e","\u011b":"e","\u0205":"e","\u0207":"e","\u1eb9":"e","\u1ec7":"e","\u0229":"e","\u1e1d":"e","\u0119":"e","\u1e19":"e","\u1e1b":"e","\u0247":"e","\u025b":"e","\u01dd":"e","\u24d5":"f","\uff46":"f","\u1e1f":"f","\u0192":"f","\ua77c":"f","\u24d6":"g","\uff47":"g","\u01f5":"g","\u011d":"g","\u1e21":"g","\u011f":"g","\u0121":"g","\u01e7":"g","\u0123":"g","\u01e5":"g","\u0260":"g","\ua7a1":"g","\u1d79":"g","\ua77f":"g","\u24d7":"h","\uff48":"h","\u0125":"h","\u1e23":"h","\u1e27":"h","\u021f":"h",
"\u1e25":"h","\u1e29":"h","\u1e2b":"h","\u1e96":"h","\u0127":"h","\u2c68":"h","\u2c76":"h","\u0265":"h","\u0195":"hv","\u24d8":"i","\uff49":"i","\u00ec":"i","\u00ed":"i","\u00ee":"i","\u0129":"i","\u012b":"i","\u012d":"i","\u00ef":"i","\u1e2f":"i","\u1ec9":"i","\u01d0":"i","\u0209":"i","\u020b":"i","\u1ecb":"i","\u012f":"i","\u1e2d":"i","\u0268":"i","\u0131":"i","\u24d9":"j","\uff4a":"j","\u0135":"j","\u01f0":"j","\u0249":"j","\u24da":"k","\uff4b":"k","\u1e31":"k","\u01e9":"k","\u1e33":"k","\u0137":"k",
"\u1e35":"k","\u0199":"k","\u2c6a":"k","\ua741":"k","\ua743":"k","\ua745":"k","\ua7a3":"k","\u24db":"l","\uff4c":"l","\u0140":"l","\u013a":"l","\u013e":"l","\u1e37":"l","\u1e39":"l","\u013c":"l","\u1e3d":"l","\u1e3b":"l","\u017f":"l","\u0142":"l","\u019a":"l","\u026b":"l","\u2c61":"l","\ua749":"l","\ua781":"l","\ua747":"l","\u01c9":"lj","\u24dc":"m","\uff4d":"m","\u1e3f":"m","\u1e41":"m","\u1e43":"m","\u0271":"m","\u026f":"m","\u24dd":"n","\uff4e":"n","\u01f9":"n","\u0144":"n","\u00f1":"n","\u1e45":"n",
"\u0148":"n","\u1e47":"n","\u0146":"n","\u1e4b":"n","\u1e49":"n","\u019e":"n","\u0272":"n","\u0149":"n","\ua791":"n","\ua7a5":"n","\u01cc":"nj","\u24de":"o","\uff4f":"o","\u00f2":"o","\u00f3":"o","\u00f4":"o","\u1ed3":"o","\u1ed1":"o","\u1ed7":"o","\u1ed5":"o","\u00f5":"o","\u1e4d":"o","\u022d":"o","\u1e4f":"o","\u014d":"o","\u1e51":"o","\u1e53":"o","\u014f":"o","\u022f":"o","\u0231":"o","\u00f6":"o","\u022b":"o","\u1ecf":"o","\u0151":"o","\u01d2":"o","\u020d":"o","\u020f":"o","\u01a1":"o","\u1edd":"o",
"\u1edb":"o","\u1ee1":"o","\u1edf":"o","\u1ee3":"o","\u1ecd":"o","\u1ed9":"o","\u01eb":"o","\u01ed":"o","\u00f8":"o","\u01ff":"o","\u0254":"o","\ua74b":"o","\ua74d":"o","\u0275":"o","\u01a3":"oi","\u0223":"ou","\ua74f":"oo","\u24df":"p","\uff50":"p","\u1e55":"p","\u1e57":"p","\u01a5":"p","\u1d7d":"p","\ua751":"p","\ua753":"p","\ua755":"p","\u24e0":"q","\uff51":"q","\u024b":"q","\ua757":"q","\ua759":"q","\u24e1":"r","\uff52":"r","\u0155":"r","\u1e59":"r","\u0159":"r","\u0211":"r","\u0213":"r","\u1e5b":"r",
"\u1e5d":"r","\u0157":"r","\u1e5f":"r","\u024d":"r","\u027d":"r","\ua75b":"r","\ua7a7":"r","\ua783":"r","\u24e2":"s","\uff53":"s","\u00df":"s","\u015b":"s","\u1e65":"s","\u015d":"s","\u1e61":"s","\u0161":"s","\u1e67":"s","\u1e63":"s","\u1e69":"s","\u0219":"s","\u015f":"s","\u023f":"s","\ua7a9":"s","\ua785":"s","\u1e9b":"s","\u24e3":"t","\uff54":"t","\u1e6b":"t","\u1e97":"t","\u0165":"t","\u1e6d":"t","\u021b":"t","\u0163":"t","\u1e71":"t","\u1e6f":"t","\u0167":"t","\u01ad":"t","\u0288":"t","\u2c66":"t",
"\ua787":"t","\ua729":"tz","\u24e4":"u","\uff55":"u","\u00f9":"u","\u00fa":"u","\u00fb":"u","\u0169":"u","\u1e79":"u","\u016b":"u","\u1e7b":"u","\u016d":"u","\u00fc":"u","\u01dc":"u","\u01d8":"u","\u01d6":"u","\u01da":"u","\u1ee7":"u","\u016f":"u","\u0171":"u","\u01d4":"u","\u0215":"u","\u0217":"u","\u01b0":"u","\u1eeb":"u","\u1ee9":"u","\u1eef":"u","\u1eed":"u","\u1ef1":"u","\u1ee5":"u","\u1e73":"u","\u0173":"u","\u1e77":"u","\u1e75":"u","\u0289":"u","\u24e5":"v","\uff56":"v","\u1e7d":"v","\u1e7f":"v",
"\u028b":"v","\ua75f":"v","\u028c":"v","\ua761":"vy","\u24e6":"w","\uff57":"w","\u1e81":"w","\u1e83":"w","\u0175":"w","\u1e87":"w","\u1e85":"w","\u1e98":"w","\u1e89":"w","\u2c73":"w","\u24e7":"x","\uff58":"x","\u1e8b":"x","\u1e8d":"x","\u24e8":"y","\uff59":"y","\u1ef3":"y","\u00fd":"y","\u0177":"y","\u1ef9":"y","\u0233":"y","\u1e8f":"y","\u00ff":"y","\u1ef7":"y","\u1e99":"y","\u1ef5":"y","\u01b4":"y","\u024f":"y","\u1eff":"y","\u24e9":"z","\uff5a":"z","\u017a":"z","\u1e91":"z","\u017c":"z","\u017e":"z",
"\u1e93":"z","\u1e95":"z","\u01b6":"z","\u0225":"z","\u0240":"z","\u2c6c":"z","\ua763":"z","\u0386":"\u0391","\u0388":"\u0395","\u0389":"\u0397","\u038a":"\u0399","\u03aa":"\u0399","\u038c":"\u039f","\u038e":"\u03a5","\u03ab":"\u03a5","\u038f":"\u03a9","\u03ac":"\u03b1","\u03ad":"\u03b5","\u03ae":"\u03b7","\u03af":"\u03b9","\u03ca":"\u03b9","\u0390":"\u03b9","\u03cc":"\u03bf","\u03cd":"\u03c5","\u03cb":"\u03c5","\u03b0":"\u03c5","\u03c9":"\u03c9","\u03c2":"\u03c3"};return diacritics});S2.define("select2/data/base",
["../utils"],function(Utils){function BaseAdapter($element,options){BaseAdapter.__super__.constructor.call(this)}Utils.Extend(BaseAdapter,Utils.Observable);BaseAdapter.prototype.current=function(callback){throw new Error("The `current` method must be defined in child classes.");};BaseAdapter.prototype.query=function(params,callback){throw new Error("The `query` method must be defined in child classes.");};BaseAdapter.prototype.bind=function(container,$container){};BaseAdapter.prototype.destroy=function(){};
BaseAdapter.prototype.generateResultId=function(container,data){var id=container.id+"-result-";id+=Utils.generateChars(4);if(data.id!=null)id+="-"+data.id.toString();else id+="-"+Utils.generateChars(4);return id};return BaseAdapter});S2.define("select2/data/select",["./base","../utils","jquery"],function(BaseAdapter,Utils,$){function SelectAdapter($element,options){this.$element=$element;this.options=options;SelectAdapter.__super__.constructor.call(this)}Utils.Extend(SelectAdapter,BaseAdapter);SelectAdapter.prototype.current=
function(callback){var data=[];var self=this;this.$element.find(":selected").each(function(){var $option=$(this);var option=self.item($option);data.push(option)});callback(data)};SelectAdapter.prototype.select=function(data){var self=this;data.selected=true;if($(data.element).is("option")){data.element.selected=true;this.$element.trigger("change");return}if(this.$element.prop("multiple"))this.current(function(currentData){var val=[];data=[data];data.push.apply(data,currentData);for(var d=0;d<data.length;d++){var id=
data[d].id;if($.inArray(id,val)===-1)val.push(id)}self.$element.val(val);self.$element.trigger("change")});else{var val$$0=data.id;this.$element.val(val$$0);this.$element.trigger("change")}};SelectAdapter.prototype.unselect=function(data){var self=this;if(!this.$element.prop("multiple"))return;data.selected=false;if($(data.element).is("option")){data.element.selected=false;this.$element.trigger("change");return}this.current(function(currentData){var val=[];for(var d=0;d<currentData.length;d++){var id=
currentData[d].id;if(id!==data.id&&$.inArray(id,val)===-1)val.push(id)}self.$element.val(val);self.$element.trigger("change")})};SelectAdapter.prototype.bind=function(container,$container){var self=this;this.container=container;container.on("select",function(params){self.select(params.data)});container.on("unselect",function(params){self.unselect(params.data)})};SelectAdapter.prototype.destroy=function(){this.$element.find("*").each(function(){$.removeData(this,"data")})};SelectAdapter.prototype.query=
function(params,callback){var data=[];var self=this;var $options=this.$element.children();$options.each(function(){var $option=$(this);if(!$option.is("option")&&!$option.is("optgroup"))return;var option=self.item($option);var matches=self.matches(params,option);if(matches!==null)data.push(matches)});callback({results:data})};SelectAdapter.prototype.addOptions=function($options){Utils.appendMany(this.$element,$options)};SelectAdapter.prototype.option=function(data){var option;if(data.children){option=
document.createElement("optgroup");option.label=data.text}else{option=document.createElement("option");if(option.textContent!==undefined)option.textContent=data.text;else option.innerText=data.text}if(data.id)option.value=data.id;if(data.disabled)option.disabled=true;if(data.selected)option.selected=true;if(data.title)option.title=data.title;var $option=$(option);var normalizedData=this._normalizeItem(data);normalizedData.element=option;$.data(option,"data",normalizedData);return $option};SelectAdapter.prototype.item=
function($option){var data={};data=$.data($option[0],"data");if(data!=null)return data;if($option.is("option"))data={id:$option.val(),text:$option.text(),disabled:$option.prop("disabled"),selected:$option.prop("selected"),title:$option.prop("title")};else if($option.is("optgroup")){data={text:$option.prop("label"),children:[],title:$option.prop("title")};var $children=$option.children("option");var children=[];for(var c=0;c<$children.length;c++){var $child=$($children[c]);var child=this.item($child);
children.push(child)}data.children=children}data=this._normalizeItem(data);data.element=$option[0];$.data($option[0],"data",data);return data};SelectAdapter.prototype._normalizeItem=function(item){if(!$.isPlainObject(item))item={id:item,text:item};item=$.extend({},{text:""},item);var defaults={selected:false,disabled:false};if(item.id!=null)item.id=item.id.toString();if(item.text!=null)item.text=item.text.toString();if(item._resultId==null&&item.id&&this.container!=null)item._resultId=this.generateResultId(this.container,
item);return $.extend({},defaults,item)};SelectAdapter.prototype.matches=function(params,data){var matcher=this.options.get("matcher");return matcher(params,data)};return SelectAdapter});S2.define("select2/data/array",["./select","../utils","jquery"],function(SelectAdapter,Utils,$){function ArrayAdapter($element,options){var data=options.get("data")||[];ArrayAdapter.__super__.constructor.call(this,$element,options);this.addOptions(this.convertToOptions(data))}Utils.Extend(ArrayAdapter,SelectAdapter);
ArrayAdapter.prototype.select=function(data){var $option=this.$element.find("option").filter(function(i,elm){return elm.value==data.id.toString()});if($option.length===0){$option=this.option(data);this.addOptions($option)}ArrayAdapter.__super__.select.call(this,data)};ArrayAdapter.prototype.convertToOptions=function(data){function onlyItem(item){return function(){return $(this).val()==item.id}}var self=this;var $existing=this.$element.find("option");var existingIds=$existing.map(function(){return self.item($(this)).id}).get();
var $options=[];for(var d=0;d<data.length;d++){var item$$0=this._normalizeItem(data[d]);if($.inArray(item$$0.id,existingIds)>=0){var $existingOption=$existing.filter(onlyItem(item$$0));var existingData=this.item($existingOption);var newData=$.extend(true,{},existingData,item$$0);var $newOption=this.option(newData);$existingOption.replaceWith($newOption);continue}var $option=this.option(item$$0);if(item$$0.children){var $children=this.convertToOptions(item$$0.children);Utils.appendMany($option,$children)}$options.push($option)}return $options};
return ArrayAdapter});S2.define("select2/data/ajax",["./array","../utils","jquery"],function(ArrayAdapter,Utils,$){function AjaxAdapter($element,options){this.ajaxOptions=this._applyDefaults(options.get("ajax"));if(this.ajaxOptions.processResults!=null)this.processResults=this.ajaxOptions.processResults;AjaxAdapter.__super__.constructor.call(this,$element,options)}Utils.Extend(AjaxAdapter,ArrayAdapter);AjaxAdapter.prototype._applyDefaults=function(options){var defaults={data:function(params){return $.extend({},
params,{q:params.term})},transport:function(params,success,failure){var $request=$.ajax(params);$request.then(success);$request.fail(failure);return $request}};return $.extend({},defaults,options,true)};AjaxAdapter.prototype.processResults=function(results){return results};AjaxAdapter.prototype.query=function(params,callback){function request(){var $request=options.transport(options,function(data){var results=self.processResults(data,params);if(self.options.get("debug")&&window.console&&console.error)if(!results||
!results.results||!$.isArray(results.results))console.error("Select2: The AJAX results did not return an array in the "+"`results` key of the response.");callback(results)},function(){});self._request=$request}var matches=[];var self=this;if(this._request!=null){if($.isFunction(this._request.abort))this._request.abort();this._request=null}var options=$.extend({type:"GET"},this.ajaxOptions);if(typeof options.url==="function")options.url=options.url.call(this.$element,params);if(typeof options.data===
"function")options.data=options.data.call(this.$element,params);if(this.ajaxOptions.delay&&params.term!==""){if(this._queryTimeout)window.clearTimeout(this._queryTimeout);this._queryTimeout=window.setTimeout(request,this.ajaxOptions.delay)}else request()};return AjaxAdapter});S2.define("select2/data/tags",["jquery"],function($){function Tags(decorated,$element,options){var tags=options.get("tags");var createTag=options.get("createTag");if(createTag!==undefined)this.createTag=createTag;decorated.call(this,
$element,options);if($.isArray(tags))for(var t=0;t<tags.length;t++){var tag=tags[t];var item=this._normalizeItem(tag);var $option=this.option(item);this.$element.append($option)}}Tags.prototype.query=function(decorated,params,callback){function wrapper(obj,child){var data=obj.results;for(var i=0;i<data.length;i++){var option=data[i];var checkChildren=option.children!=null&&!wrapper({results:option.children},true);var checkText=option.text===params.term;if(checkText||checkChildren){if(child)return false;
obj.data=data;callback(obj);return}}if(child)return true;var tag=self.createTag(params);if(tag!=null){var $option=self.option(tag);$option.attr("data-select2-tag",true);self.addOptions([$option]);self.insertTag(data,tag)}obj.results=data;callback(obj)}var self=this;this._removeOldTags();if(params.term==null||params.page!=null){decorated.call(this,params,callback);return}decorated.call(this,params,wrapper)};Tags.prototype.createTag=function(decorated,params){var term=$.trim(params.term);if(term===
"")return null;return{id:term,text:term}};Tags.prototype.insertTag=function(_,data,tag){data.unshift(tag)};Tags.prototype._removeOldTags=function(_){var tag=this._lastTag;var $options=this.$element.find("option[data-select2-tag]");$options.each(function(){if(this.selected)return;$(this).remove()})};return Tags});S2.define("select2/data/tokenizer",["jquery"],function($){function Tokenizer(decorated,$element,options){var tokenizer=options.get("tokenizer");if(tokenizer!==undefined)this.tokenizer=tokenizer;
decorated.call(this,$element,options)}Tokenizer.prototype.bind=function(decorated,container,$container){decorated.call(this,container,$container);this.$search=container.dropdown.$search||container.selection.$search||$container.find(".select2-search__field")};Tokenizer.prototype.query=function(decorated,params,callback){function select(data){self.trigger("select",{data:data})}var self=this;params.term=params.term||"";var tokenData=this.tokenizer(params,this.options,select);if(tokenData.term!==params.term){if(this.$search.length){this.$search.val(tokenData.term);
this.$search.focus()}params.term=tokenData.term}decorated.call(this,params,callback)};Tokenizer.prototype.tokenizer=function(_,params$$0,options,callback){var separators=options.get("tokenSeparators")||[];var term=params$$0.term;var i=0;for(var createTag=this.createTag||function(params){return{id:params.term,text:params.term}};i<term.length;){var termChar=term[i];if($.inArray(termChar,separators)===-1){i++;continue}var part=term.substr(0,i);var partParams=$.extend({},params$$0,{term:part});var data=
createTag(partParams);if(data==null){i++;continue}callback(data);term=term.substr(i+1)||"";i=0}return{term:term}};return Tokenizer});S2.define("select2/data/minimumInputLength",[],function(){function MinimumInputLength(decorated,$e,options){this.minimumInputLength=options.get("minimumInputLength");decorated.call(this,$e,options)}MinimumInputLength.prototype.query=function(decorated,params,callback){params.term=params.term||"";if(params.term.length<this.minimumInputLength){this.trigger("results:message",
{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:params.term,params:params}});return}decorated.call(this,params,callback)};return MinimumInputLength});S2.define("select2/data/maximumInputLength",[],function(){function MaximumInputLength(decorated,$e,options){this.maximumInputLength=options.get("maximumInputLength");decorated.call(this,$e,options)}MaximumInputLength.prototype.query=function(decorated,params,callback){params.term=params.term||"";if(this.maximumInputLength>0&&params.term.length>
this.maximumInputLength){this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:params.term,params:params}});return}decorated.call(this,params,callback)};return MaximumInputLength});S2.define("select2/data/maximumSelectionLength",[],function(){function MaximumSelectionLength(decorated,$e,options){this.maximumSelectionLength=options.get("maximumSelectionLength");decorated.call(this,$e,options)}MaximumSelectionLength.prototype.query=function(decorated,params,
callback){var self=this;this.current(function(currentData){var count=currentData!=null?currentData.length:0;if(self.maximumSelectionLength>0&&count>=self.maximumSelectionLength){self.trigger("results:message",{message:"maximumSelected",args:{maximum:self.maximumSelectionLength}});return}decorated.call(self,params,callback)})};return MaximumSelectionLength});S2.define("select2/dropdown",["jquery","./utils"],function($,Utils){function Dropdown($element,options){this.$element=$element;this.options=options;
Dropdown.__super__.constructor.call(this)}Utils.Extend(Dropdown,Utils.Observable);Dropdown.prototype.render=function(){var $dropdown=$('\x3cspan class\x3d"select2-dropdown"\x3e'+'\x3cspan class\x3d"select2-results"\x3e\x3c/span\x3e'+"\x3c/span\x3e");$dropdown.attr("dir",this.options.get("dir"));this.$dropdown=$dropdown;return $dropdown};Dropdown.prototype.bind=function(){};Dropdown.prototype.position=function($dropdown,$container){};Dropdown.prototype.destroy=function(){this.$dropdown.remove()};return Dropdown});
S2.define("select2/dropdown/search",["jquery","../utils"],function($,Utils){function Search(){}Search.prototype.render=function(decorated){var $rendered=decorated.call(this);var $search=$('\x3cspan class\x3d"select2-search select2-search--dropdown"\x3e'+'\x3cinput class\x3d"select2-search__field" type\x3d"search" tabindex\x3d"-1"'+' autocomplete\x3d"off" autocorrect\x3d"off" autocapitalize\x3d"off"'+' spellcheck\x3d"false" role\x3d"textbox" /\x3e'+"\x3c/span\x3e");this.$searchContainer=$search;this.$search=
$search.find("input");$rendered.prepend($search);return $rendered};Search.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container);this.$search.on("keydown",function(evt){self.trigger("keypress",evt);self._keyUpPrevented=evt.isDefaultPrevented()});this.$search.on("input",function(evt){$(this).off("keyup")});this.$search.on("keyup input",function(evt){self.handleSearch(evt)});container.on("open",function(){self.$search.attr("tabindex",0);self.$search.focus();
window.setTimeout(function(){self.$search.focus()},0)});container.on("close",function(){self.$search.attr("tabindex",-1);self.$search.val("")});container.on("results:all",function(params){if(params.query.term==null||params.query.term===""){var showSearch=self.showSearch(params);if(showSearch)self.$searchContainer.removeClass("select2-search--hide");else self.$searchContainer.addClass("select2-search--hide")}})};Search.prototype.handleSearch=function(evt){if(!this._keyUpPrevented){var input=this.$search.val();
this.trigger("query",{term:input})}this._keyUpPrevented=false};Search.prototype.showSearch=function(_,params){return true};return Search});S2.define("select2/dropdown/hidePlaceholder",[],function(){function HidePlaceholder(decorated,$element,options,dataAdapter){this.placeholder=this.normalizePlaceholder(options.get("placeholder"));decorated.call(this,$element,options,dataAdapter)}HidePlaceholder.prototype.append=function(decorated,data){data.results=this.removePlaceholder(data.results);decorated.call(this,
data)};HidePlaceholder.prototype.normalizePlaceholder=function(_,placeholder){if(typeof placeholder==="string")placeholder={id:"",text:placeholder};return placeholder};HidePlaceholder.prototype.removePlaceholder=function(_,data){var modifiedData=data.slice(0);for(var d=data.length-1;d>=0;d--){var item=data[d];if(this.placeholder.id===item.id)modifiedData.splice(d,1)}return modifiedData};return HidePlaceholder});S2.define("select2/dropdown/infiniteScroll",["jquery"],function($){function InfiniteScroll(decorated,
$element,options,dataAdapter){this.lastParams={};decorated.call(this,$element,options,dataAdapter);this.$loadingMore=this.createLoadingMore();this.loading=false}InfiniteScroll.prototype.append=function(decorated,data){this.$loadingMore.remove();this.loading=false;decorated.call(this,data);if(this.showLoadingMore(data))this.$results.append(this.$loadingMore)};InfiniteScroll.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container);container.on("query",
function(params){self.lastParams=params;self.loading=true});container.on("query:append",function(params){self.lastParams=params;self.loading=true});this.$results.on("scroll",function(){var isLoadMoreVisible=$.contains(document.documentElement,self.$loadingMore[0]);if(self.loading||!isLoadMoreVisible)return;var currentOffset=self.$results.offset().top+self.$results.outerHeight(false);var loadingMoreOffset=self.$loadingMore.offset().top+self.$loadingMore.outerHeight(false);if(currentOffset+50>=loadingMoreOffset)self.loadMore()})};
InfiniteScroll.prototype.loadMore=function(){this.loading=true;var params=$.extend({},{page:1},this.lastParams);params.page++;this.trigger("query:append",params)};InfiniteScroll.prototype.showLoadingMore=function(_,data){return data.pagination&&data.pagination.more};InfiniteScroll.prototype.createLoadingMore=function(){var $option=$("\x3cli "+'class\x3d"select2-results__option select2-results__option--load-more"'+'role\x3d"treeitem" aria-disabled\x3d"true"\x3e\x3c/li\x3e');var message=this.options.get("translations").get("loadingMore");
$option.html(message(this.lastParams));return $option};return InfiniteScroll});S2.define("select2/dropdown/attachBody",["jquery","../utils"],function($,Utils){function AttachBody(decorated,$element,options){this.$dropdownParent=options.get("dropdownParent")||$(document.body);decorated.call(this,$element,options)}AttachBody.prototype.bind=function(decorated,container,$container){var self=this;var setupResultsEvents=false;decorated.call(this,container,$container);container.on("open",function(){self._showDropdown();
self._attachPositioningHandler(container);if(!setupResultsEvents){setupResultsEvents=true;container.on("results:all",function(){self._positionDropdown();self._resizeDropdown()});container.on("results:append",function(){self._positionDropdown();self._resizeDropdown()})}});container.on("close",function(){self._hideDropdown();self._detachPositioningHandler(container)});this.$dropdownContainer.on("mousedown",function(evt){evt.stopPropagation()})};AttachBody.prototype.destroy=function(decorated){decorated.call(this);
this.$dropdownContainer.remove()};AttachBody.prototype.position=function(decorated,$dropdown,$container){$dropdown.attr("class",$container.attr("class"));$dropdown.removeClass("select2");$dropdown.addClass("select2-container--open");$dropdown.css({position:"absolute",top:-999999});this.$container=$container};AttachBody.prototype.render=function(decorated){var $container=$("\x3cspan\x3e\x3c/span\x3e");var $dropdown=decorated.call(this);$container.append($dropdown);this.$dropdownContainer=$container;
return $container};AttachBody.prototype._hideDropdown=function(decorated){this.$dropdownContainer.detach()};AttachBody.prototype._attachPositioningHandler=function(decorated,container){var self=this;var scrollEvent="scroll.select2."+container.id;var resizeEvent="resize.select2."+container.id;var orientationEvent="orientationchange.select2."+container.id;var $watchers=this.$container.parents().filter(Utils.hasScroll);$watchers.each(function(){$(this).data("select2-scroll-position",{x:$(this).scrollLeft(),
y:$(this).scrollTop()})});$watchers.on(scrollEvent,function(ev){var position=$(this).data("select2-scroll-position");$(this).scrollTop(position.y)});$(window).on(scrollEvent+" "+resizeEvent+" "+orientationEvent,function(e){self._positionDropdown();self._resizeDropdown()})};AttachBody.prototype._detachPositioningHandler=function(decorated,container){var scrollEvent="scroll.select2."+container.id;var resizeEvent="resize.select2."+container.id;var orientationEvent="orientationchange.select2."+container.id;
var $watchers=this.$container.parents().filter(Utils.hasScroll);$watchers.off(scrollEvent);$(window).off(scrollEvent+" "+resizeEvent+" "+orientationEvent)};AttachBody.prototype._positionDropdown=function(){var $window=$(window);var isCurrentlyAbove=this.$dropdown.hasClass("select2-dropdown--above");var isCurrentlyBelow=this.$dropdown.hasClass("select2-dropdown--below");var newDirection=null;var position=this.$container.position();var offset=this.$container.offset();offset.bottom=offset.top+this.$container.outerHeight(false);
var container={height:this.$container.outerHeight(false)};container.top=offset.top;container.bottom=offset.top+container.height;var dropdown={height:this.$dropdown.outerHeight(false)};var viewport={top:$window.scrollTop(),bottom:$window.scrollTop()+$window.height()};var enoughRoomAbove=viewport.top<offset.top-dropdown.height;var enoughRoomBelow=viewport.bottom>offset.bottom+dropdown.height;var css={left:offset.left,top:container.bottom};if(this.$dropdownParent[0].style.position!=="static"){var parentOffset=
this.$dropdownParent.offset();css.top-=parentOffset.top;css.left-=parentOffset.left}if(!isCurrentlyAbove&&!isCurrentlyBelow)newDirection="below";if(!enoughRoomBelow&&enoughRoomAbove&&!isCurrentlyAbove)newDirection="above";else if(!enoughRoomAbove&&enoughRoomBelow&&isCurrentlyAbove)newDirection="below";if(newDirection=="above"||isCurrentlyAbove&&newDirection!=="below")css.top=container.top-dropdown.height;if(newDirection!=null){this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+
newDirection);this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+newDirection)}this.$dropdownContainer.css(css)};AttachBody.prototype._resizeDropdown=function(){var css={width:this.$container.outerWidth(false)+"px"};if(this.options.get("dropdownAutoWidth")){css.minWidth=css.width;css.width="auto"}this.$dropdown.css(css)};AttachBody.prototype._showDropdown=function(decorated){this.$dropdownContainer.appendTo(this.$dropdownParent);this._positionDropdown();
this._resizeDropdown()};return AttachBody});S2.define("select2/dropdown/minimumResultsForSearch",[],function(){function countResults(data){var count=0;for(var d=0;d<data.length;d++){var item=data[d];if(item.children)count+=countResults(item.children);else count++}return count}function MinimumResultsForSearch(decorated,$element,options,dataAdapter){this.minimumResultsForSearch=options.get("minimumResultsForSearch");if(this.minimumResultsForSearch<0)this.minimumResultsForSearch=Infinity;decorated.call(this,
$element,options,dataAdapter)}MinimumResultsForSearch.prototype.showSearch=function(decorated,params){if(countResults(params.data.results)<this.minimumResultsForSearch)return false;return decorated.call(this,params)};return MinimumResultsForSearch});S2.define("select2/dropdown/selectOnClose",[],function(){function SelectOnClose(){}SelectOnClose.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container);container.on("close",function(){self._handleSelectOnClose()})};
SelectOnClose.prototype._handleSelectOnClose=function(){var $highlightedResults=this.getHighlightedResults();if($highlightedResults.length<1)return;var data=$highlightedResults.data("data");if(data.element!=null&&data.element.selected||data.element==null&&data.selected)return;this.trigger("select",{data:data})};return SelectOnClose});S2.define("select2/dropdown/closeOnSelect",[],function(){function CloseOnSelect(){}CloseOnSelect.prototype.bind=function(decorated,container,$container){var self=this;
decorated.call(this,container,$container);container.on("select",function(evt){self._selectTriggered(evt)});container.on("unselect",function(evt){self._selectTriggered(evt)})};CloseOnSelect.prototype._selectTriggered=function(_,evt){var originalEvent=evt.originalEvent;if(originalEvent&&originalEvent.ctrlKey)return;this.trigger("close",{})};return CloseOnSelect});S2.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(args){var overChars=
args.input.length-args.maximum;var message="Please delete "+overChars+" character";if(overChars!=1)message+="s";return message},inputTooShort:function(args){var remainingChars=args.minimum-args.input.length;var message="Please enter "+remainingChars+" or more characters";return message},loadingMore:function(){return"Loading more results\u00e2\u0080\u00a6"},maximumSelected:function(args){var message="You can only select "+args.maximum+" item";if(args.maximum!=1)message+="s";return message},noResults:function(){return"No results found"},
searching:function(){return"Searching\u00e2\u0080\u00a6"}}});S2.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($,require,ResultsList,SingleSelection,MultipleSelection,Placeholder,AllowClear,SelectionSearch,EventRelay,Utils,Translation,DIACRITICS,SelectData,ArrayData,AjaxData,Tags,Tokenizer,MinimumInputLength,MaximumInputLength,MaximumSelectionLength,Dropdown,DropdownSearch,HidePlaceholder,InfiniteScroll,AttachBody,
MinimumResultsForSearch,SelectOnClose,CloseOnSelect,EnglishTranslation){function Defaults(){this.reset()}Defaults.prototype.apply=function(options){options=$.extend({},this.defaults,options);if(options.dataAdapter==null){if(options.ajax!=null)options.dataAdapter=AjaxData;else if(options.data!=null)options.dataAdapter=ArrayData;else options.dataAdapter=SelectData;if(options.minimumInputLength>0)options.dataAdapter=Utils.Decorate(options.dataAdapter,MinimumInputLength);if(options.maximumInputLength>
0)options.dataAdapter=Utils.Decorate(options.dataAdapter,MaximumInputLength);if(options.maximumSelectionLength>0)options.dataAdapter=Utils.Decorate(options.dataAdapter,MaximumSelectionLength);if(options.tags)options.dataAdapter=Utils.Decorate(options.dataAdapter,Tags);if(options.tokenSeparators!=null||options.tokenizer!=null)options.dataAdapter=Utils.Decorate(options.dataAdapter,Tokenizer);if(options.query!=null){var Query=require(options.amdBase+"compat/query");options.dataAdapter=Utils.Decorate(options.dataAdapter,
Query)}if(options.initSelection!=null){var InitSelection=require(options.amdBase+"compat/initSelection");options.dataAdapter=Utils.Decorate(options.dataAdapter,InitSelection)}}if(options.resultsAdapter==null){options.resultsAdapter=ResultsList;if(options.ajax!=null)options.resultsAdapter=Utils.Decorate(options.resultsAdapter,InfiniteScroll);if(options.placeholder!=null)options.resultsAdapter=Utils.Decorate(options.resultsAdapter,HidePlaceholder);if(options.selectOnClose)options.resultsAdapter=Utils.Decorate(options.resultsAdapter,
SelectOnClose)}if(options.dropdownAdapter==null){if(options.multiple)options.dropdownAdapter=Dropdown;else{var SearchableDropdown=Utils.Decorate(Dropdown,DropdownSearch);options.dropdownAdapter=SearchableDropdown}if(options.minimumResultsForSearch!==0)options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,MinimumResultsForSearch);if(options.closeOnSelect)options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,CloseOnSelect);if(options.dropdownCssClass!=null||options.dropdownCss!=null||
options.adaptDropdownCssClass!=null){var DropdownCSS=require(options.amdBase+"compat/dropdownCss");options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,DropdownCSS)}options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,AttachBody)}if(options.selectionAdapter==null){if(options.multiple)options.selectionAdapter=MultipleSelection;else options.selectionAdapter=SingleSelection;if(options.placeholder!=null)options.selectionAdapter=Utils.Decorate(options.selectionAdapter,Placeholder);
if(options.allowClear)options.selectionAdapter=Utils.Decorate(options.selectionAdapter,AllowClear);if(options.multiple)options.selectionAdapter=Utils.Decorate(options.selectionAdapter,SelectionSearch);if(options.containerCssClass!=null||options.containerCss!=null||options.adaptContainerCssClass!=null){var ContainerCSS=require(options.amdBase+"compat/containerCss");options.selectionAdapter=Utils.Decorate(options.selectionAdapter,ContainerCSS)}options.selectionAdapter=Utils.Decorate(options.selectionAdapter,
EventRelay)}if(typeof options.language==="string")if(options.language.indexOf("-")>0){var languageParts=options.language.split("-");var baseLanguage=languageParts[0];options.language=[options.language,baseLanguage]}else options.language=[options.language];if($.isArray(options.language)){var languages=new Translation;options.language.push("en");var languageNames=options.language;for(var l=0;l<languageNames.length;l++){var name=languageNames[l];var language={};try{language=Translation.loadPath(name)}catch(e){try{name=
this.defaults.amdLanguageBase+name;language=Translation.loadPath(name)}catch(ex){if(options.debug&&window.console&&console.warn)console.warn('Select2: The language file for "'+name+'" could not be '+"automatically loaded. A fallback will be used instead.");continue}}languages.extend(language)}options.translations=languages}else{var baseTranslation=Translation.loadPath(this.defaults.amdLanguageBase+"en");var customTranslation=new Translation(options.language);customTranslation.extend(baseTranslation);
options.translations=customTranslation}return options};Defaults.prototype.reset=function(){function stripDiacritics(text){function match(a){return DIACRITICS[a]||a}return text.replace(/[^\u0000-\u007E]/g,match)}function matcher(params,data){if($.trim(params.term)==="")return data;if(data.children&&data.children.length>0){var match=$.extend(true,{},data);for(var c=data.children.length-1;c>=0;c--){var child=data.children[c];var matches=matcher(params,child);if(matches==null)match.children.splice(c,
1)}if(match.children.length>0)return match;return matcher(params,match)}var original=stripDiacritics(data.text).toUpperCase();var term=stripDiacritics(params.term).toUpperCase();if(original.indexOf(term)>-1)return data;return null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:true,debug:false,dropdownAutoWidth:false,escapeMarkup:Utils.escapeMarkup,language:EnglishTranslation,matcher:matcher,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,
selectOnClose:false,sorter:function(data){return data},templateResult:function(result){return result.text},templateSelection:function(selection){return selection.text},theme:"default",width:"resolve"}};Defaults.prototype.set=function(key,value){var camelKey=$.camelCase(key);var data={};data[camelKey]=value;var convertedData=Utils._convertData(data);$.extend(this.defaults,convertedData)};var defaults=new Defaults;return defaults});S2.define("select2/options",["require","jquery","./defaults","./utils"],
function(require,$,Defaults,Utils){function Options(options,$element){this.options=options;if($element!=null)this.fromElement($element);this.options=Defaults.apply(this.options);if($element&&$element.is("input")){var InputCompat=require(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=Utils.Decorate(this.options.dataAdapter,InputCompat)}}Options.prototype.fromElement=function($e){var excludedData=["select2"];if(this.options.multiple==null)this.options.multiple=$e.prop("multiple");
if(this.options.disabled==null)this.options.disabled=$e.prop("disabled");if(this.options.language==null)if($e.prop("lang"))this.options.language=$e.prop("lang").toLowerCase();else if($e.closest("[lang]").prop("lang"))this.options.language=$e.closest("[lang]").prop("lang");if(this.options.dir==null)if($e.prop("dir"))this.options.dir=$e.prop("dir");else if($e.closest("[dir]").prop("dir"))this.options.dir=$e.closest("[dir]").prop("dir");else this.options.dir="ltr";$e.prop("disabled",this.options.disabled);
$e.prop("multiple",this.options.multiple);if($e.data("select2Tags")){if(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\x3d"true"` attributes and will be '+"removed in future versions of Select2.");$e.data("data",$e.data("select2Tags"));$e.data("tags",true)}if($e.data("ajaxUrl")){if(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 dataset={};if($.fn.jquery&&$.fn.jquery.substr(0,2)=="1."&&$e[0].dataset)dataset=$.extend(true,{},$e[0].dataset,$e.data());else dataset=$e.data();var data=$.extend(true,{},dataset);data=Utils._convertData(data);for(var key in data){if($.inArray(key,excludedData)>-1)continue;if($.isPlainObject(this.options[key]))$.extend(this.options[key],
data[key]);else this.options[key]=data[key]}return this};Options.prototype.get=function(key){return this.options[key]};Options.prototype.set=function(key,val){this.options[key]=val};return Options});S2.define("select2/core",["jquery","./options","./utils","./keys"],function($,Options,Utils,KEYS){var Select2=function($element,options){if($element.data("select2")!=null)$element.data("select2").destroy();this.$element=$element;this.id=this._generateId($element);options=options||{};this.options=new Options(options,
$element);Select2.__super__.constructor.call(this);var tabindex=$element.attr("tabindex")||0;$element.data("old-tabindex",tabindex);$element.attr("tabindex","-1");var DataAdapter=this.options.get("dataAdapter");this.dataAdapter=new DataAdapter($element,this.options);var $container=this.render();this._placeContainer($container);var SelectionAdapter=this.options.get("selectionAdapter");this.selection=new SelectionAdapter($element,this.options);this.$selection=this.selection.render();this.selection.position(this.$selection,
$container);var DropdownAdapter=this.options.get("dropdownAdapter");this.dropdown=new DropdownAdapter($element,this.options);this.$dropdown=this.dropdown.render();this.dropdown.position(this.$dropdown,$container);var ResultsAdapter=this.options.get("resultsAdapter");this.results=new ResultsAdapter($element,this.options,this.dataAdapter);this.$results=this.results.render();this.results.position(this.$results,this.$dropdown);var self=this;this._bindAdapters();this._registerDomEvents();this._registerDataEvents();
this._registerSelectionEvents();this._registerDropdownEvents();this._registerResultsEvents();this._registerEvents();this.dataAdapter.current(function(initialData){self.trigger("selection:update",{data:initialData})});$element.addClass("select2-hidden-accessible");$element.attr("aria-hidden","true");this._syncAttributes();$element.data("select2",this)};Utils.Extend(Select2,Utils.Observable);Select2.prototype._generateId=function($element){var id="";if($element.attr("id")!=null)id=$element.attr("id");
else if($element.attr("name")!=null)id=$element.attr("name")+"-"+Utils.generateChars(2);else id=Utils.generateChars(4);id="select2-"+id;return id};Select2.prototype._placeContainer=function($container){$container.insertAfter(this.$element);var width=this._resolveWidth(this.$element,this.options.get("width"));if(width!=null)$container.css("width",width)};Select2.prototype._resolveWidth=function($element,method){var WIDTH=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if(method=="resolve"){var styleWidth=
this._resolveWidth($element,"style");if(styleWidth!=null)return styleWidth;return this._resolveWidth($element,"element")}if(method=="element"){var elementWidth=$element.outerWidth(false);if(elementWidth<=0)return"auto";return elementWidth+"px"}if(method=="style"){var style=$element.attr("style");if(typeof style!=="string")return null;var attrs=style.split(";");var i=0;for(var l=attrs.length;i<l;i=i+1){var attr=attrs[i].replace(/\s/g,"");var matches=attr.match(WIDTH);if(matches!==null&&matches.length>=
1)return matches[1]}return null}return method};Select2.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)};Select2.prototype._registerDomEvents=function(){var self=this;this.$element.on("change.select2",function(){self.dataAdapter.current(function(data){self.trigger("selection:update",{data:data})})});this._sync=Utils.bind(this._syncAttributes,this);
if(this.$element[0].attachEvent)this.$element[0].attachEvent("onpropertychange",this._sync);var observer=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(observer!=null){this._observer=new observer(function(mutations){$.each(mutations,self._sync)});this._observer.observe(this.$element[0],{attributes:true,subtree:false})}else if(this.$element[0].addEventListener)this.$element[0].addEventListener("DOMAttrModified",self._sync,false)};Select2.prototype._registerDataEvents=
function(){var self=this;this.dataAdapter.on("*",function(name,params){self.trigger(name,params)})};Select2.prototype._registerSelectionEvents=function(){var self=this;var nonRelayEvents=["toggle","focus"];this.selection.on("toggle",function(){self.toggleDropdown()});this.selection.on("focus",function(params){self.focus(params)});this.selection.on("*",function(name,params){if($.inArray(name,nonRelayEvents)!==-1)return;self.trigger(name,params)})};Select2.prototype._registerDropdownEvents=function(){var self=
this;this.dropdown.on("*",function(name,params){self.trigger(name,params)})};Select2.prototype._registerResultsEvents=function(){var self=this;this.results.on("*",function(name,params){self.trigger(name,params)})};Select2.prototype._registerEvents=function(){var self=this;this.on("open",function(){self.$container.addClass("select2-container--open")});this.on("close",function(){self.$container.removeClass("select2-container--open")});this.on("enable",function(){self.$container.removeClass("select2-container--disabled")});
this.on("disable",function(){self.$container.addClass("select2-container--disabled")});this.on("blur",function(){self.$container.removeClass("select2-container--focus")});this.on("query",function(params){if(!self.isOpen())self.trigger("open",{});this.dataAdapter.query(params,function(data){self.trigger("results:all",{data:data,query:params})})});this.on("query:append",function(params){this.dataAdapter.query(params,function(data){self.trigger("results:append",{data:data,query:params})})});this.on("keypress",
function(evt){var key=evt.which;if(self.isOpen())if(key===KEYS.ESC||key===KEYS.TAB||key===KEYS.UP&&evt.altKey){self.close();evt.preventDefault()}else if(key===KEYS.ENTER){self.trigger("results:select",{});evt.preventDefault()}else if(key===KEYS.SPACE&&evt.ctrlKey){self.trigger("results:toggle",{});evt.preventDefault()}else if(key===KEYS.UP){self.trigger("results:previous",{});evt.preventDefault()}else{if(key===KEYS.DOWN){self.trigger("results:next",{});evt.preventDefault()}}else if(key===KEYS.ENTER||
key===KEYS.SPACE||key===KEYS.DOWN&&evt.altKey){self.open();evt.preventDefault()}})};Select2.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled"));if(this.options.get("disabled")){if(this.isOpen())this.close();this.trigger("disable",{})}else this.trigger("enable",{})};Select2.prototype.trigger=function(name,args){var actualTrigger=Select2.__super__.trigger;var preTriggerMap={"open":"opening","close":"closing","select":"selecting","unselect":"unselecting"};
if(args===undefined)args={};if(name in preTriggerMap){var preTriggerName=preTriggerMap[name];var preTriggerArgs={prevented:false,name:name,args:args};actualTrigger.call(this,preTriggerName,preTriggerArgs);if(preTriggerArgs.prevented){args.prevented=true;return}}actualTrigger.call(this,name,args)};Select2.prototype.toggleDropdown=function(){if(this.options.get("disabled"))return;if(this.isOpen())this.close();else this.open()};Select2.prototype.open=function(){if(this.isOpen())return;this.trigger("query",
{})};Select2.prototype.close=function(){if(!this.isOpen())return;this.trigger("close",{})};Select2.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")};Select2.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")};Select2.prototype.focus=function(data){if(this.hasFocus())return;this.$container.addClass("select2-container--focus");this.trigger("focus",{})};Select2.prototype.enable=function(args){if(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.");if(args==null||args.length===0)args=[true];var disabled=!args[0];this.$element.prop("disabled",disabled)};Select2.prototype.data=function(){if(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 data=[];this.dataAdapter.current(function(currentData){data=currentData});return data};Select2.prototype.val=function(args){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.");if(args==null||args.length===0)return this.$element.val();var newVal=args[0];if($.isArray(newVal))newVal=$.map(newVal,function(obj){return obj.toString()});this.$element.val(newVal).trigger("change")};
Select2.prototype.destroy=function(){this.$container.remove();if(this.$element[0].detachEvent)this.$element[0].detachEvent("onpropertychange",this._sync);if(this._observer!=null){this._observer.disconnect();this._observer=null}else if(this.$element[0].removeEventListener)this.$element[0].removeEventListener("DOMAttrModified",this._sync,false);this._sync=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};Select2.prototype.render=function(){var $container=$('\x3cspan class\x3d"select2 select2-container"\x3e'+'\x3cspan class\x3d"selection"\x3e\x3c/span\x3e'+'\x3cspan class\x3d"dropdown-wrapper" aria-hidden\x3d"true"\x3e\x3c/span\x3e'+"\x3c/span\x3e");
$container.attr("dir",this.options.get("dir"));this.$container=$container;this.$container.addClass("select2-container--"+this.options.get("theme"));$container.data("element",this.$element);return $container};return Select2});S2.define("jquery-mousewheel",["jquery"],function($){return $});S2.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function($,_,Select2,Defaults){if($.fn.select2==null){var thisMethods=["open","close","destroy"];$.fn.select2=function(options){options=
options||{};if(typeof options==="object"){this.each(function(){var instanceOptions=$.extend(true,{},options);var instance=new Select2($(this),instanceOptions)});return this}else if(typeof options==="string"){var ret;this.each(function(){var instance=$(this).data("select2");if(instance==null&&window.console&&console.error)console.error("The select2('"+options+"') method was called on an "+"element that is not using Select2.");var args=Array.prototype.slice.call(arguments,1);ret=instance[options].apply(instance,
args)});if($.inArray(options,thisMethods)>-1)return this;return ret}else throw new Error("Invalid arguments for Select2: "+options);}}if($.fn.select2.defaults==null)$.fn.select2.defaults=Defaults;return Select2});return{define:S2.define,require:S2.require}}();var select2=S2.require("jquery.select2");jQuery.fn.select2.amd=S2;return select2})(jQuery);
if(!String.prototype.repeat)(function(){var defineProperty=function(){try{var object={};var $defineProperty=Object.defineProperty;var result=$defineProperty(object,object,object)&&$defineProperty}catch(error){}return result}();var repeat=function(count){if(this==null)throw TypeError();var string=String(this);var n=count?Number(count):0;if(n!=n)n=0;if(n<0||n==Infinity)throw RangeError();for(var result="";n;){if(n%2==1)result+=string;if(n>1)string+=string;n>>=1}return result};if(defineProperty)defineProperty(String.prototype,
"repeat",{"value":repeat,"configurable":true,"writable":true});else String.prototype.repeat=repeat})();
var selectDevice={};
$(document).ready(function(){var $win=$(window);isMobileView=function(){var winWidth=$win.width();if(winWidth<=767)return true;return false};isTouchView=function(){return!$("html").hasClass("no-touch")};var mobileView=-1;var devicesList=[];var devicesSelectPlatform=$(".native-select.-platform");var devicesSelectManufacturer=$(".native-select.-manufacturer");var devicesSelectDevice=$(".native-select.-device");var devicesSelectBtn=$(".devices-find-select_bl-btn");var devicesInputWrapper=$(".devices-find_bl-input-wrapper");
var getDevicesList=function(){_.each(devicesData,function(platformItem,platform){_.each(platformItem,function(manufacturerItem,manufacturer){_.each(manufacturerItem,function(deviceItem,device){devicesList.push({"name":device.indexOf(manufacturer)!==-1?device:manufacturer+" "+device,"platform":platform,"manufacturer":manufacturer,"device":device})})})})};var devicesSelectRender=function(select,items){var template=Handlebars3.compile($("#devices-find-select-tpl").html());select.html(template({items:items,
placeholder:select.attr("placeholder")}));select.attr("disabled",items&&items.length?null:"disabled");select.trigger("select2-update")};var devicesSelectPlatformRender=function(){var list=_.keys(devicesData);list=["iOS"].concat(_.without(list,"iOS"));devicesSelectRender(devicesSelectPlatform,list)};var devicesSelectManufacturerRender=function(platform){if(devicesData[platform]){var list=_.keys(devicesData[platform]);devicesSelectRender(devicesSelectManufacturer,list)}};var devicesSelectDeviceRender=
function(platform,manufacturer){if(devicesData[platform]&&devicesData[platform][manufacturer]){var list=_.keys(devicesData[platform][manufacturer]);devicesSelectRender(devicesSelectDevice,list)}};var selectsInit=function(){var nativeSelect=$(".native-select");nativeSelect.on("select2-update",function(event){var select=$(event.currentTarget);var selectWrapper=select.closest(".native-select-wrapper");var select2Container=selectWrapper.find(".select2-container");var value=select.val();var placeholder=
select.attr("placeholder");var hasPlaceholderShow=!(value&&value.length&&value!=placeholder);if(select2Container&&select2Container.length)select.select2("destroy");hasPlaceholderShow&&select.addClass("-placeholder");if(!isTouchView()){select.select2({minimumResultsForSearch:-1,placeholder:select.attr("placeholder")});select2Container=selectWrapper.find(".select2-container");select2Container.removeClass("select2");hasPlaceholderShow&&select2Container.addClass("-placeholder")}}).on("change",function(event){var select=
$(event.currentTarget);select.removeClass("-placeholder").parent().find(".select2-container").removeClass("-placeholder")}).trigger("select2-update");$(document).click(function(event){if(!isTouchView()){var selectContainer=$(event.target).closest(".native-select-wrapper");if(selectContainer&&selectContainer.length){var select=selectContainer.find(".native-select");select.addClass("-select2-current");nativeSelect.not(".-select2-current").select2("close");select.removeClass("-select2-current")}else nativeSelect.select2("close")}})};
var autocompleteSuggestMargin=function(){var menu=devicesInputWrapper.find(".tt-menu");if(isMobileView()&&menu.hasClass("tt-open"))devicesInputWrapper.css("margin-bottom",menu.height());else devicesInputWrapper.css("margin-bottom",0)};var autocompleteInit=function(){var devices=new Bloodhound({datumTokenizer:function(datum){return Bloodhound.tokenizers.whitespace(datum.name)},queryTokenizer:Bloodhound.tokenizers.whitespace,local:devicesList});$(".devices-find_bl-input").off("typeahead:select typeahead:render typeahead:open typeahead:close keyup.devices").typeahead("destroy").typeahead({hint:true,
highlight:true,minLength:1},{limit:isMobileView()?5:10,name:"devices",source:devices.ttAdapter(),displayKey:"name",templates:{suggestion:Handlebars3.compile($("#devices-find-suggestion-tpl").html()),empty:Handlebars3.compile($("#devices-find-empty-message-tpl").html())}}).on("typeahead:select",function(event,suggestion){autocompleteSuggestMargin();if(suggestion&&suggestion.name&&suggestion.name.length){selectDevice=suggestion;renderFeatureSection()}}).on("typeahead:render",function(event,suggestion){devicesInputWrapper.toggleClass("-empty-message",
!(arguments.length-1));autocompleteSuggestMargin()}).on("typeahead:open",function(){autocompleteSuggestMargin()}).on("typeahead:close",function(){autocompleteSuggestMargin()}).on("keyup.devices",function(event){if($(event.currentTarget).val()==""){autocompleteSuggestMargin();devicesInputWrapper.removeClass("-empty-message")}})};var switchFindSection=function(){selectDevice={};$win.trigger("switch-sections");devicesSelectPlatformRender();devicesSelectRender(devicesSelectManufacturer,[]);devicesSelectRender(devicesSelectDevice,
[]);devicesSelectBtn.addClass("-disabled");$(".devices-find_bl-input").typeahead("val","")};var devicesOnResize=function(){var mv=isMobileView();if(mobileView!=mv){mobileView=mv;autocompleteSuggestMargin();autocompleteInit()}_.debounce(function(){$(".native-select").trigger("select2-update")},100)()};var devicesInit=function(){getDevicesList();$win.on("resize",devicesOnResize);$win.on("switch-find-section",switchFindSection);$win.on("scroll",_.debounce(function(){var select=$(".select2-container");
if(select&&select.length)select.not(".select2-container--open").closest(".native-select-wrapper").find(".native-select").trigger("select2-update")},100));devicesOnResize();selectsInit();devicesSelectPlatformRender();devicesSelectRender(devicesSelectManufacturer,[]);devicesSelectRender(devicesSelectDevice,[]);devicesSelectPlatform.on("change",function(e){devicesSelectRender(devicesSelectManufacturer,[]);devicesSelectRender(devicesSelectDevice,[]);devicesSelectBtn.addClass("-disabled");selectDevice=
{platform:this.value};devicesSelectManufacturerRender(this.value);devicesSelectManufacturerOptions=devicesSelectManufacturer.find("option");if(devicesSelectManufacturerOptions.length==2){devicesSelectManufacturerOptions.eq(1).attr("selected","selected");devicesSelectManufacturer.trigger("change")}$(this).blur();e.preventDefault()});devicesSelectManufacturer.on("change",function(e){devicesSelectRender(devicesSelectDevice,[]);devicesSelectBtn.addClass("-disabled");selectDevice["manufacturer"]=this.value;
delete selectDevice["device"];devicesSelectDeviceRender(devicesSelectPlatform.find(":selected").val(),this.value);$(this).blur();e.preventDefault()});devicesSelectDevice.on("change",function(e){selectDevice["device"]=this.value;devicesSelectBtn.toggleClass("-disabled",!(this.value&&this.value.length));$(this).blur();e.preventDefault();if(isTouchView()&&isMobileView()&&this.value&&this.value.length)devicesSelectBtn.trigger("click")});devicesSelectBtn.on("click",function(){if(selectDevice["device"]&&
selectDevice["device"].length)renderFeatureSection()})};devicesInit()});
Handlebars3.registerHelper("grouped_each",function(every,context,options){var out="";var subcontext=[];var i;if(context&&context.length>0){for(i=0;i<context.length;i++){if(i>0&&i%every===0){out+=options.fn(subcontext);subcontext=[]}subcontext.push(context[i])}out+=options.fn(subcontext)}return out});
Handlebars3.registerHelper("getEnv",function(){var defaultCols=3;var tabletView=typeof window.matchMedia!=="undefined"&&window.matchMedia("(min-width: 768px) and (max-width: 1199px), (min-device-width: 767px) and (max-device-width: 1199px)").matches;if(tabletView)defaultCols=2;return defaultCols});function compileFeatures(){var template=Handlebars3.compile($("#device-features-tpl").html());$(".dfs-feature-wrapp").html(template(filterFeatures(productFeatures)))}
function compileNotes(notes){var template=Handlebars3.compile($("#device-notes-tpl").html());$(".dfs-notes-section").html(template({"notes":notes}))}function checkChildPropExist(obj){var args=Array.prototype.slice.call(arguments,1);for(var i=0;i<args.length;i++){if(!obj||!obj.hasOwnProperty(args[i]))return false;obj=obj[args[i]]}return true}
function filterFeatures(productFeatures){var os=selectDevice["platform"];var device=selectDevice["device"];var manufacturer=selectDevice["manufacturer"];var tracker=$("#dfs-select-fitbit-tracker").val();var filtredFeatures=[];if(tracker=="*")tracker="";if(typeof devicesData!=="undefined"&&typeof trackersData!=="undefined")if(os&&device&&manufacturer)if(checkChildPropExist(devicesData,os,manufacturer,device)){var currentDevice=devicesData[os][manufacturer][device];var currentTracker=trackersData[tracker];
var commonFeatures=findCommonFeatures(currentDevice,currentTracker);renderNotes(sortNotes(commonFeatures));for(var feature in productFeatures)if(productFeatures[feature].hasOwnProperty("id")&&commonFeatures.hasOwnProperty(productFeatures[feature].id)){var id=productFeatures[feature].id;var f=$.extend({},productFeatures[feature]);if(typeof commonFeatures[id]==="object")commonFeatures[id].forEach(function(el,i){if(typeof f.asterisk==="string")f.asterisk+="\x26nbsp;"+commonFeatures[id][i].asterisk;else f.asterisk=
commonFeatures[id][i].asterisk});filtredFeatures.push(f)}}return filtredFeatures}
function findCommonFeatures(device$$0,tracker$$0){function compareObjects(device,tracker){var type=tracker||device;commonFeatures=$.extend({},type);for(var feature in device)if(feature==="device-note")mergeNotes(feature,device[feature]);else if(commonFeatures.hasOwnProperty(feature))if(checkAvailable(commonFeatures[feature])&&checkAvailable(device[feature]))if(type===device)mergeNotes(feature,commonFeatures[feature]);else mergeNotes(feature,commonFeatures[feature],device[feature]);else delete commonFeatures[feature]}
function mergeNotes(featureName,deviceFeature,trackerFeature){var args=[].slice.call(arguments);args.forEach(function(i){if(typeof i==="object"){if(!$.isArray(commonFeatures[featureName]))commonFeatures[featureName]=[];commonFeatures[featureName].push(i)}})}function checkAvailable(feature){if(typeof feature==="object"&&feature.available||typeof feature==="boolean"&&feature)return true}var commonFeatures={};compareObjects(device$$0,tracker$$0);return commonFeatures}
function toggleOptionAsterisk(asterisk){var $this=$(this);if(!$this.data("defaultText")){$this.data("defaultText",$this.text());$this.data("asteriskText",$this.text()+"*")}$this.text(asterisk?$this.data("asteriskText"):$this.data("defaultText"))}
function sortNotes(notes){var notesList=[];for(var note in notes)if(typeof notes[note]==="object")notes[note].forEach(function(n,i){if(notes[note][i].hasOwnProperty("device")){notesList.unshift(notes[note][i].note);var $selectFitbitTracker=$("#dfs-select-fitbit-tracker");var $deviceOption=$selectFitbitTracker.find('option[value\x3d"'+notes[note][i].device+'"]');toggleOptionAsterisk.call($deviceOption,true);$deviceOption.attr("disabled",true);$selectFitbitTracker.trigger("select2-update");$(".dfs-filter-device-name").addClass("asterisk")}else if(notesList.indexOf(notes[note][i].note)===
-1)notesList.push(notes[note][i].note);else;});for(note in notes)if(typeof notes[note]==="object")notes[note].forEach(function(n,i){if(notesList.indexOf(notes[note][i].note)===-1)notes[note][i].asterisk="*".repeat(notesList.length);else notes[note][i].asterisk="*".repeat(notesList.indexOf(notes[note][i].note)+1)});notesList.forEach(function(note,i){notesList[i]="*".repeat(i+1)+notesList[i]});return notesList}function renderNotes(notes){compileNotes(notes)}
function setMenuFixed(){var $menu=$(".device-feature-section .dfs-menu");var offsetTop=60;return function(mobileView){var scrollTop=$(document).scrollTop();if(scrollTop>=offsetTop&&!mobileView)$menu.addClass("fixed").parent().css("padding-top",$menu.height());else $menu.removeClass("fixed").parent().css("padding-top",0)}}
var switchSections=function(){var $featureSection=$(".device-feature-section");var $findSection=$(".devices-find-section");if(selectDevice["device"]&&selectDevice["device"].length){$featureSection.show();$findSection.hide()}else{$featureSection.hide();$findSection.show()}};$(window).on("switch-sections",switchSections);
function renderFeatureSection(){switchSections();compileFeatures();$(".dfs-select-wrapp .native-select").trigger("select2-update");(function changeDeviceName(){var manufacturer=selectDevice.manufacturer||"";var device=selectDevice.device||"";var deviceFullName="";if(selectDevice.device.indexOf(selectDevice.manufacturer)===-1)deviceFullName=manufacturer+" "+device;else deviceFullName=device;$(".dfs-filter-device-name").text(deviceFullName)})();$("html, body").scrollTop(0)}
$(document).ready(function(){var mobileView=window.matchMedia("(max-width: 767px), (max-device-width: 767px)");var tabletView=window.matchMedia("(min-width: 768px) and (max-width: 1199px), (min-device-width: 767px) and (max-device-width: 1199px)");var fixedMenu=setMenuFixed();if(!mobileView.matches)fixedMenu(mobileView.matches);$(document).on("scroll",function(){fixedMenu(mobileView.matches)});tabletView.addListener(function(){compileFeatures()});mobileView.addListener(function(){fixedMenu(mobileView.matches)});
$(".dfs-menu-link-select").on("click",function(e){if(mobileView.matches)$(".dfs-select-wrapp").toggleClass("active");e.preventDefault()});$("#dfs-select-fitbit-tracker").on("change",function(e){var $this=$(this);var value=$this.val();text=$this.find("option:selected").text();$(".dfs-filter-tracker-name").text(value&&value!="*"?" + "+text:"");compileFeatures();e.preventDefault()});$(".dfs-menu-link-back").on("click",function(e){$(window).trigger("switch-find-section");$(".dfs-filter-device-name").removeClass("asterisk");
$(".dfs-select-wrapp").removeClass("active");var $selectFitbitTracker=$("#dfs-select-fitbit-tracker");var $deviceOption=$selectFitbitTracker.find("[disabled]");$selectFitbitTracker.val("*").trigger("change");$deviceOption.attr("disabled",false);toggleOptionAsterisk.call($deviceOption,false);$selectFitbitTracker.trigger("select2-update");e.preventDefault()})});
