!function(n,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=n.document?t(n,!0):function(n){if(!n.document)throw new Error("jQuery requires a window with a document");return t(n)}:t(n)}("undefined"!=typeof window?window:this,function(n,t){function ri(n){var t=n.length,r=i.type(n);return"function"===r||i.isWindow(n)?!1:1===n.nodeType&&t?!0:"array"===r||0===t||"number"==typeof t&&t>0&&t-1 in n}function ui(n,t,r){if(i.isFunction(t))return i.grep(n,function(n,i){return!!t.call(n,i,n)!==r});if(t.nodeType)return i.grep(n,function(n){return n===t!==r});if("string"==typeof t){if(ue.test(t))return i.filter(t,n,r);t=i.filter(t,n)}return i.grep(n,function(n){return i.inArray(n,t)>=0!==r})}function hr(n,t){do n=n[t];while(n&&1!==n.nodeType);return n}function oe(n){var t=fi[n]={};return i.each(n.match(h)||[],function(n,i){t[i]=!0}),t}function cr(){u.addEventListener?(u.removeEventListener("DOMContentLoaded",a,!1),n.removeEventListener("load",a,!1)):(u.detachEvent("onreadystatechange",a),n.detachEvent("onload",a))}function a(){(u.addEventListener||"load"===event.type||"complete"===u.readyState)&&(cr(),i.ready())}function yr(n,t,r){if(void 0===r&&1===n.nodeType){var u="data-"+t.replace(vr,"-$1").toLowerCase();if(r=n.getAttribute(u),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:ar.test(r)?i.parseJSON(r):r}catch(f){}i.data(n,t,r)}else r=void 0}return r}function ei(n){var t;for(t in n)if(("data"!==t||!i.isEmptyObject(n[t]))&&"toJSON"!==t)return!1;return!0}function pr(n,t,r,u){if(i.acceptData(n)){var s,e,h=i.expando,l=n.nodeType,o=l?i.cache:n,f=l?n[h]:n[h]&&h;if(f&&o[f]&&(u||o[f].data)||void 0!==r||"string"!=typeof t)return f||(f=l?n[h]=c.pop()||i.guid++:h),o[f]||(o[f]=l?{}:{toJSON:i.noop}),("object"==typeof t||"function"==typeof t)&&(u?o[f]=i.extend(o[f],t):o[f].data=i.extend(o[f].data,t)),e=o[f],u||(e.data||(e.data={}),e=e.data),void 0!==r&&(e[i.camelCase(t)]=r),"string"==typeof t?(s=e[t],null==s&&(s=e[i.camelCase(t)])):s=e,s}}function wr(n,t,u){if(i.acceptData(n)){var o,s,h=n.nodeType,f=h?i.cache:n,e=h?n[i.expando]:i.expando;if(f[e]){if(t&&(o=u?f[e]:f[e].data)){for(i.isArray(t)?t=t.concat(i.map(t,i.camelCase)):(t in o)?t=[t]:(t=i.camelCase(t),t=(t in o)?[t]:t.split(" ")),s=t.length;s--;)delete o[t[s]];if(u?!ei(o):!i.isEmptyObject(o))return}(u||(delete f[e].data,ei(f[e])))&&(h?i.cleanData([n],!0):r.deleteExpando||f!=f.window?delete f[e]:f[e]=null)}}}function vt(){return!0}function it(){return!1}function dr(){try{return u.activeElement}catch(n){}}function gr(n){var i=nu.split("|"),t=n.createDocumentFragment();if(t.createElement)while(i.length)t.createElement(i.pop());return t}function f(n,t){var e,u,s=0,r=typeof n.getElementsByTagName!==o?n.getElementsByTagName(t||"*"):typeof n.querySelectorAll!==o?n.querySelectorAll(t||"*"):void 0;if(!r)for(r=[],e=n.childNodes||n;null!=(u=e[s]);s++)!t||i.nodeName(u,t)?r.push(u):i.merge(r,f(u,t));return void 0===t||t&&i.nodeName(n,t)?i.merge([n],r):r}function be(n){oi.test(n.type)&&(n.defaultChecked=n.checked)}function eu(n,t){return i.nodeName(n,"table")&&i.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?n.getElementsByTagName("tbody")[0]||n.appendChild(n.ownerDocument.createElement("tbody")):n}function ou(n){return n.type=(null!==i.find.attr(n,"type"))+"/"+n.type,n}function su(n){var t=ye.exec(n.type);return t?n.type=t[1]:n.removeAttribute("type"),n}function li(n,t){for(var u,r=0;null!=(u=n[r]);r++)i._data(u,"globalEval",!t||i._data(t[r],"globalEval"))}function hu(n,t){if(1===t.nodeType&&i.hasData(n)){var u,f,o,s=i._data(n),r=i._data(t,s),e=s.events;if(e){delete r.handle;r.events={};for(u in e)for(f=0,o=e[u].length;o>f;f++)i.event.add(t,u,e[u][f])}r.data&&(r.data=i.extend({},r.data))}}function ke(n,t){var u,e,f;if(1===t.nodeType){if(u=t.nodeName.toLowerCase(),!r.noCloneEvent&&t[i.expando]){f=i._data(t);for(e in f.events)i.removeEvent(t,e,f.handle);t.removeAttribute(i.expando)}"script"===u&&t.text!==n.text?(ou(t).text=n.text,su(t)):"object"===u?(t.parentNode&&(t.outerHTML=n.outerHTML),r.html5Clone&&n.innerHTML&&!i.trim(t.innerHTML)&&(t.innerHTML=n.innerHTML)):"input"===u&&oi.test(n.type)?(t.defaultChecked=t.checked=n.checked,t.value!==n.value&&(t.value=n.value)):"option"===u?t.defaultSelected=t.selected=n.defaultSelected:("input"===u||"textarea"===u)&&(t.defaultValue=n.defaultValue)}}function cu(t,r){var u=i(r.createElement(t)).appendTo(r.body),f=n.getDefaultComputedStyle?n.getDefaultComputedStyle(u[0]).display:i.css(u[0],"display");return u.detach(),f}function lu(n){var r=u,t=ai[n];return t||(t=cu(n,r),"none"!==t&&t||(ot=(ot||i("<iframe frameborder='0' width='0' height='0'/>")).appendTo(r.documentElement),r=(ot[0].contentWindow||ot[0].contentDocument).document,r.write(),r.close(),t=cu(n,r),ot.detach()),ai[n]=t),t}function vu(n,t){return{get:function(){var i=n();if(null!=i)return i?void delete this.get:(this.get=t).apply(this,arguments)}}}function wu(n,t){if(t in n)return t;for(var r=t.charAt(0).toUpperCase()+t.slice(1),u=t,i=pu.length;i--;)if(t=pu[i]+r,t in n)return t;return u}function bu(n,t){for(var f,r,o,e=[],u=0,s=n.length;s>u;u++)r=n[u],r.style&&(e[u]=i._data(r,"olddisplay"),f=r.style.display,t?(e[u]||"none"!==f||(r.style.display=""),""===r.style.display&&et(r)&&(e[u]=i._data(r,"olddisplay",lu(r.nodeName)))):e[u]||(o=et(r),(f&&"none"!==f||!o)&&i._data(r,"olddisplay",o?f:i.css(r,"display"))));for(u=0;s>u;u++)r=n[u],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?e[u]||"":"none"));return n}function ku(n,t,i){var r=to.exec(t);return r?Math.max(0,r[1]-(i||0))+(r[2]||"px"):t}function du(n,t,r,u,f){for(var e=r===(u?"border":"content")?4:"width"===t?1:0,o=0;4>e;e+=2)"margin"===r&&(o+=i.css(n,r+w[e],!0,f)),u?("content"===r&&(o-=i.css(n,"padding"+w[e],!0,f)),"margin"!==r&&(o-=i.css(n,"border"+w[e]+"Width",!0,f))):(o+=i.css(n,"padding"+w[e],!0,f),"padding"!==r&&(o+=i.css(n,"border"+w[e]+"Width",!0,f)));return o}function gu(n,t,u){var o=!0,f="width"===t?n.offsetWidth:n.offsetHeight,e=k(n),s=r.boxSizing()&&"border-box"===i.css(n,"boxSizing",!1,e);if(0>=f||null==f){if(f=d(n,t,e),(0>f||null==f)&&(f=n.style[t]),yt.test(f))return f;o=s&&(r.boxSizingReliable()||f===n.style[t]);f=parseFloat(f)||0}return f+du(n,t,u||(s?"border":"content"),o,e)+"px"}function e(n,t,i,r,u){return new e.prototype.init(n,t,i,r,u)}function tf(){return setTimeout(function(){rt=void 0}),rt=i.now()}function bt(n,t){var r,i={height:n},u=0;for(t=t?1:0;4>u;u+=2-t)r=w[u],i["margin"+r]=i["padding"+r]=n;return t&&(i.opacity=i.width=n),i}function rf(n,t,i){for(var u,f=(st[t]||[]).concat(st["*"]),r=0,e=f.length;e>r;r++)if(u=f[r].call(i,t,n))return u}function eo(n,t,u){var f,l,p,a,o,b,y,w,c=this,v={},s=n.style,h=n.nodeType&&et(n),e=i._data(n,"fxshow");u.queue||(o=i._queueHooks(n,"fx"),null==o.unqueued&&(o.unqueued=0,b=o.empty.fire,o.empty.fire=function(){o.unqueued||b()}),o.unqueued++,c.always(function(){c.always(function(){o.unqueued--;i.queue(n,"fx").length||o.empty.fire()})}));1===n.nodeType&&("height"in t||"width"in t)&&(u.overflow=[s.overflow,s.overflowX,s.overflowY],y=i.css(n,"display"),w=lu(n.nodeName),"none"===y&&(y=w),"inline"===y&&"none"===i.css(n,"float")&&(r.inlineBlockNeedsLayout&&"inline"!==w?s.zoom=1:s.display="inline-block"));u.overflow&&(s.overflow="hidden",r.shrinkWrapBlocks()||c.always(function(){s.overflow=u.overflow[0];s.overflowX=u.overflow[1];s.overflowY=u.overflow[2]}));for(f in t)if(l=t[f],uo.exec(l)){if(delete t[f],p=p||"toggle"===l,l===(h?"hide":"show")){if("show"!==l||!e||void 0===e[f])continue;h=!0}v[f]=e&&e[f]||i.style(n,f)}if(!i.isEmptyObject(v)){e?"hidden"in e&&(h=e.hidden):e=i._data(n,"fxshow",{});p&&(e.hidden=!h);h?i(n).show():c.done(function(){i(n).hide()});c.done(function(){var t;i._removeData(n,"fxshow");for(t in v)i.style(n,t,v[t])});for(f in v)a=rf(h?e[f]:0,f,c),f in e||(e[f]=a.start,h&&(a.end=a.start,a.start="width"===f||"height"===f?1:0))}}function oo(n,t){var r,f,e,u,o;for(r in n)if(f=i.camelCase(r),e=t[f],u=n[r],i.isArray(u)&&(e=u[1],u=n[r]=u[0]),r!==f&&(n[f]=u,delete n[r]),o=i.cssHooks[f],o&&"expand"in o){u=o.expand(u);delete n[f];for(r in u)r in n||(n[r]=u[r],t[r]=e)}else t[f]=e}function uf(n,t,r){var h,e,o=0,l=wt.length,f=i.Deferred().always(function(){delete c.elem}),c=function(){if(e)return!1;for(var s=rt||tf(),t=Math.max(0,u.startTime+u.duration-s),h=t/u.duration||0,i=1-h,r=0,o=u.tweens.length;o>r;r++)u.tweens[r].run(i);return f.notifyWith(n,[u,i,t]),1>i&&o?t:(f.resolveWith(n,[u]),!1)},u=f.promise({elem:n,props:i.extend({},t),opts:i.extend(!0,{specialEasing:{}},r),originalProperties:t,originalOptions:r,startTime:rt||tf(),duration:r.duration,tweens:[],createTween:function(t,r){var f=i.Tween(n,u.opts,t,r,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(f),f},stop:function(t){var i=0,r=t?u.tweens.length:0;if(e)return this;for(e=!0;r>i;i++)u.tweens[i].run(1);return t?f.resolveWith(n,[u,t]):f.rejectWith(n,[u,t]),this}}),s=u.props;for(oo(s,u.opts.specialEasing);l>o;o++)if(h=wt[o].call(u,n,s,u.opts))return h;return i.map(s,rf,u),i.isFunction(u.opts.start)&&u.opts.start.call(n,u),i.fx.timer(i.extend(c,{elem:n,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function vf(n){return function(t,r){"string"!=typeof t&&(r=t,t="*");var u,f=0,e=t.toLowerCase().match(h)||[];if(i.isFunction(r))while(u=e[f++])"+"===u.charAt(0)?(u=u.slice(1)||"*",(n[u]=n[u]||[]).unshift(r)):(n[u]=n[u]||[]).push(r)}}function yf(n,t,r,u){function e(s){var h;return f[s]=!0,i.each(n[s]||[],function(n,i){var s=i(t,r,u);return"string"!=typeof s||o||f[s]?o?!(h=s):void 0:(t.dataTypes.unshift(s),e(s),!1)}),h}var f={},o=n===bi;return e(t.dataTypes[0])||!f["*"]&&e("*")}function ki(n,t){var u,r,f=i.ajaxSettings.flatOptions||{};for(r in t)void 0!==t[r]&&((f[r]?n:u||(u={}))[r]=t[r]);return u&&i.extend(!0,n,u),n}function vo(n,t,i){for(var o,e,u,f,s=n.contents,r=n.dataTypes;"*"===r[0];)r.shift(),void 0===e&&(e=n.mimeType||t.getResponseHeader("Content-Type"));if(e)for(f in s)if(s[f]&&s[f].test(e)){r.unshift(f);break}if(r[0]in i)u=r[0];else{for(f in i){if(!r[0]||n.converters[f+" "+r[0]]){u=f;break}o||(o=f)}u=u||o}if(u)return(u!==r[0]&&r.unshift(u),i[u])}function yo(n,t,i,r){var h,u,f,s,e,o={},c=n.dataTypes.slice();if(c[1])for(f in n.converters)o[f.toLowerCase()]=n.converters[f];for(u=c.shift();u;)if(n.responseFields[u]&&(i[n.responseFields[u]]=t),!e&&r&&n.dataFilter&&(t=n.dataFilter(t,n.dataType)),e=u,u=c.shift())if("*"===u)u=e;else if("*"!==e&&e!==u){if(f=o[e+" "+u]||o["* "+u],!f)for(h in o)if(s=h.split(" "),s[1]===u&&(f=o[e+" "+s[0]]||o["* "+s[0]])){f===!0?f=o[h]:o[h]!==!0&&(u=s[0],c.unshift(s[1]));break}if(f!==!0)if(f&&n.throws)t=f(t);else try{t=f(t)}catch(l){return{state:"parsererror",error:f?l:"No conversion from "+e+" to "+u}}}return{state:"success",data:t}}function di(n,t,r,u){var f;if(i.isArray(t))i.each(t,function(t,i){r||wo.test(n)?u(n,i):di(n+"["+("object"==typeof i?t:"")+"]",i,r,u)});else if(r||"object"!==i.type(t))u(n,t);else for(f in t)di(n+"["+f+"]",t[f],r,u)}function wf(){try{return new n.XMLHttpRequest}catch(t){}}function ns(){try{return new n.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function bf(n){return i.isWindow(n)?n:9===n.nodeType?n.defaultView||n.parentWindow:!1}var c=[],l=c.slice,ir=c.concat,ti=c.push,rr=c.indexOf,ct={},gf=ct.toString,tt=ct.hasOwnProperty,ii="".trim,r={},ur="1.11.0",i=function(n,t){return new i.fn.init(n,t)},ne=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,te=/^-ms-/,ie=/-([\da-z])/gi,re=function(n,t){return t.toUpperCase()},p,or,sr,h,fi,lt,o,lr,ar,vr,ot,ai,ff,of,sf,dt,gi,ni,nr,tr,kf,df;i.fn=i.prototype={jquery:ur,constructor:i,selector:"",length:0,toArray:function(){return l.call(this)},get:function(n){return null!=n?0>n?this[n+this.length]:this[n]:l.call(this)},pushStack:function(n){var t=i.merge(this.constructor(),n);return t.prevObject=this,t.context=this.context,t},each:function(n,t){return i.each(this,n,t)},map:function(n){return this.pushStack(i.map(this,function(t,i){return n.call(t,i,t)}))},slice:function(){return this.pushStack(l.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(n){var i=this.length,t=+n+(0>n?i:0);return this.pushStack(t>=0&&i>t?[this[t]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:ti,sort:c.sort,splice:c.splice};i.extend=i.fn.extend=function(){var r,e,t,f,o,s,n=arguments[0]||{},u=1,c=arguments.length,h=!1;for("boolean"==typeof n&&(h=n,n=arguments[u]||{},u++),"object"==typeof n||i.isFunction(n)||(n={}),u===c&&(n=this,u--);c>u;u++)if(null!=(o=arguments[u]))for(f in o)r=n[f],t=o[f],n!==t&&(h&&t&&(i.isPlainObject(t)||(e=i.isArray(t)))?(e?(e=!1,s=r&&i.isArray(r)?r:[]):s=r&&i.isPlainObject(r)?r:{},n[f]=i.extend(h,s,t)):void 0!==t&&(n[f]=t));return n};i.extend({expando:"jQuery"+(ur+Math.random()).replace(/\D/g,""),isReady:!0,error:function(n){throw new Error(n);},noop:function(){},isFunction:function(n){return"function"===i.type(n)},isArray:Array.isArray||function(n){return"array"===i.type(n)},isWindow:function(n){return null!=n&&n==n.window},isNumeric:function(n){return n-parseFloat(n)>=0},isEmptyObject:function(n){var t;for(t in n)return!1;return!0},isPlainObject:function(n){var t;if(!n||"object"!==i.type(n)||n.nodeType||i.isWindow(n))return!1;try{if(n.constructor&&!tt.call(n,"constructor")&&!tt.call(n.constructor.prototype,"isPrototypeOf"))return!1}catch(u){return!1}if(r.ownLast)for(t in n)return tt.call(n,t);for(t in n);return void 0===t||tt.call(n,t)},type:function(n){return null==n?n+"":"object"==typeof n||"function"==typeof n?ct[gf.call(n)]||"object":typeof n},globalEval:function(t){t&&i.trim(t)&&(n.execScript||function(t){n.eval.call(n,t)})(t)},camelCase:function(n){return n.replace(te,"ms-").replace(ie,re)},nodeName:function(n,t){return n.nodeName&&n.nodeName.toLowerCase()===t.toLowerCase()},each:function(n,t,i){var u,r=0,f=n.length,e=ri(n);if(i){if(e){for(;f>r;r++)if(u=t.apply(n[r],i),u===!1)break}else for(r in n)if(u=t.apply(n[r],i),u===!1)break}else if(e){for(;f>r;r++)if(u=t.call(n[r],r,n[r]),u===!1)break}else for(r in n)if(u=t.call(n[r],r,n[r]),u===!1)break;return n},trim:ii&&!ii.call("﻿ ")?function(n){return null==n?"":ii.call(n)}:function(n){return null==n?"":(n+"").replace(ne,"")},makeArray:function(n,t){var r=t||[];return null!=n&&(ri(Object(n))?i.merge(r,"string"==typeof n?[n]:n):ti.call(r,n)),r},inArray:function(n,t,i){var r;if(t){if(rr)return rr.call(t,n,i);for(r=t.length,i=i?0>i?Math.max(0,r+i):i:0;r>i;i++)if(i in t&&t[i]===n)return i}return-1},merge:function(n,t){for(var r=+t.length,i=0,u=n.length;r>i;)n[u++]=t[i++];if(r!==r)while(void 0!==t[i])n[u++]=t[i++];return n.length=u,n},grep:function(n,t,i){for(var u,f=[],r=0,e=n.length,o=!i;e>r;r++)u=!t(n[r],r),u!==o&&f.push(n[r]);return f},map:function(n,t,i){var u,r=0,e=n.length,o=ri(n),f=[];if(o)for(;e>r;r++)u=t(n[r],r,i),null!=u&&f.push(u);else for(r in n)u=t(n[r],r,i),null!=u&&f.push(u);return ir.apply([],f)},guid:1,proxy:function(n,t){var u,r,f;return"string"==typeof t&&(f=n[t],t=n,n=f),i.isFunction(n)?(u=l.call(arguments,2),r=function(){return n.apply(t||this,u.concat(l.call(arguments)))},r.guid=n.guid=n.guid||i.guid++,r):void 0},now:function(){return+new Date},support:r});i.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(n,t){ct["[object "+t+"]"]=t.toLowerCase()});p=function(n){function u(n,t,i,u){var w,h,c,v,k,y,d,a,nt,g;if((t?t.ownerDocument||t:s)!==e&&p(t),t=t||e,i=i||[],!n||"string"!=typeof n)return i;if(1!==(v=t.nodeType)&&9!==v)return[];if(l&&!u){if(w=or.exec(n))if(c=w[1]){if(9===v){if(h=t.getElementById(c),!h||!h.parentNode)return i;if(h.id===c)return i.push(h),i}else if(t.ownerDocument&&(h=t.ownerDocument.getElementById(c))&&et(t,h)&&h.id===c)return i.push(h),i}else{if(w[2])return b.apply(i,t.getElementsByTagName(n)),i;if((c=w[3])&&r.getElementsByClassName&&t.getElementsByClassName)return b.apply(i,t.getElementsByClassName(c)),i}if(r.qsa&&(!o||!o.test(n))){if(a=d=f,nt=t,g=9===v&&n,1===v&&"object"!==t.nodeName.toLowerCase()){for(y=vt(n),(d=t.getAttribute("id"))?a=d.replace(sr,"\\$&"):t.setAttribute("id",a),a="[id='"+a+"'] ",k=y.length;k--;)y[k]=a+yt(y[k]);nt=gt.test(n)&&ii(t.parentNode)||t;g=y.join(",")}if(g)try{return b.apply(i,nt.querySelectorAll(g)),i}catch(tt){}finally{d||t.removeAttribute("id")}}}return vr(n.replace(lt,"$1"),t,i,u)}function ni(){function n(r,u){return i.push(r+" ")>t.cacheLength&&delete n[i.shift()],n[r+" "]=u}var i=[];return n}function h(n){return n[f]=!0,n}function c(n){var t=e.createElement("div");try{return!!n(t)}catch(i){return!1}finally{t.parentNode&&t.parentNode.removeChild(t);t=null}}function ti(n,i){for(var u=n.split("|"),r=n.length;r--;)t.attrHandle[u[r]]=i}function pi(n,t){var i=t&&n,r=i&&1===n.nodeType&&1===t.nodeType&&(~t.sourceIndex||li)-(~n.sourceIndex||li);if(r)return r;if(i)while(i=i.nextSibling)if(i===t)return-1;return n?1:-1}function hr(n){return function(t){var i=t.nodeName.toLowerCase();return"input"===i&&t.type===n}}function cr(n){return function(t){var i=t.nodeName.toLowerCase();return("input"===i||"button"===i)&&t.type===n}}function tt(n){return h(function(t){return t=+t,h(function(i,r){for(var u,f=n([],i.length,t),e=f.length;e--;)i[u=f[e]]&&(i[u]=!(r[u]=i[u]))})})}function ii(n){return n&&typeof n.getElementsByTagName!==ut&&n}function wi(){}function vt(n,i){var e,f,s,o,r,h,c,l=hi[n+" "];if(l)return i?0:l.slice(0);for(r=n,h=[],c=t.preFilter;r;){(!e||(f=nr.exec(r)))&&(f&&(r=r.slice(f[0].length)||r),h.push(s=[]));e=!1;(f=tr.exec(r))&&(e=f.shift(),s.push({value:e,type:f[0].replace(lt," ")}),r=r.slice(e.length));for(o in t.filter)(f=at[o].exec(r))&&(!c[o]||(f=c[o](f)))&&(e=f.shift(),s.push({value:e,type:o,matches:f}),r=r.slice(e.length));if(!e)break}return i?r.length:r?u.error(n):hi(n,h).slice(0)}function yt(n){for(var t=0,r=n.length,i="";r>t;t++)i+=n[t].value;return i}function ri(n,t,i){var r=t.dir,u=i&&"parentNode"===r,e=bi++;return t.first?function(t,i,f){while(t=t[r])if(1===t.nodeType||u)return n(t,i,f)}:function(t,i,o){var s,h,c=[a,e];if(o){while(t=t[r])if((1===t.nodeType||u)&&n(t,i,o))return!0}else while(t=t[r])if(1===t.nodeType||u){if(h=t[f]||(t[f]={}),(s=h[r])&&s[0]===a&&s[1]===e)return c[2]=s[2];if(h[r]=c,c[2]=n(t,i,o))return!0}}}function ui(n){return n.length>1?function(t,i,r){for(var u=n.length;u--;)if(!n[u](t,i,r))return!1;return!0}:n[0]}function pt(n,t,i,r,u){for(var e,o=[],f=0,s=n.length,h=null!=t;s>f;f++)(e=n[f])&&(!i||i(e,r,u))&&(o.push(e),h&&t.push(f));return o}function fi(n,t,i,r,u,e){return r&&!r[f]&&(r=fi(r)),u&&!u[f]&&(u=fi(u,e)),h(function(f,e,o,s){var l,c,a,p=[],y=[],w=e.length,k=f||ar(t||"*",o.nodeType?[o]:o,[]),v=!n||!f&&t?k:pt(k,p,n,o,s),h=i?u||(f?n:w||r)?[]:e:v;if(i&&i(v,h,o,s),r)for(l=pt(h,y),r(l,[],o,s),c=l.length;c--;)(a=l[c])&&(h[y[c]]=!(v[y[c]]=a));if(f){if(u||n){if(u){for(l=[],c=h.length;c--;)(a=h[c])&&l.push(v[c]=a);u(null,h=[],l,s)}for(c=h.length;c--;)(a=h[c])&&(l=u?nt.call(f,a):p[c])>-1&&(f[l]=!(e[l]=a))}}else h=pt(h===e?h.splice(w,h.length):h),u?u(null,e,h,s):b.apply(e,h)})}function ei(n){for(var s,u,r,o=n.length,h=t.relative[n[0].type],c=h||t.relative[" "],i=h?1:0,l=ri(function(n){return n===s},c,!0),a=ri(function(n){return nt.call(s,n)>-1},c,!0),e=[function(n,t,i){return!h&&(i||t!==ht)||((s=t).nodeType?l(n,t,i):a(n,t,i))}];o>i;i++)if(u=t.relative[n[i].type])e=[ri(ui(e),u)];else{if(u=t.filter[n[i].type].apply(null,n[i].matches),u[f]){for(r=++i;o>r;r++)if(t.relative[n[r].type])break;return fi(i>1&&ui(e),i>1&&yt(n.slice(0,i-1).concat({value:" "===n[i-2].type?"*":""})).replace(lt,"$1"),u,r>i&&ei(n.slice(i,r)),o>r&&ei(n=n.slice(r)),o>r&&yt(n))}e.push(u)}return ui(e)}function lr(n,i){var r=i.length>0,f=n.length>0,o=function(o,s,h,c,l){var y,d,w,k=0,v="0",g=o&&[],p=[],nt=ht,tt=o||f&&t.find.TAG("*",l),it=a+=null==nt?1:Math.random()||.1,rt=tt.length;for(l&&(ht=s!==e&&s);v!==rt&&null!=(y=tt[v]);v++){if(f&&y){for(d=0;w=n[d++];)if(w(y,s,h)){c.push(y);break}l&&(a=it)}r&&((y=!w&&y)&&k--,o&&g.push(y))}if(k+=v,r&&v!==k){for(d=0;w=i[d++];)w(g,p,s,h);if(o){if(k>0)while(v--)g[v]||p[v]||(p[v]=di.call(c));p=pt(p)}b.apply(c,p);l&&!o&&p.length>0&&k+i.length>1&&u.uniqueSort(c)}return l&&(a=it,ht=nt),g};return r?h(o):o}function ar(n,t,i){for(var r=0,f=t.length;f>r;r++)u(n,t[r],i);return i}function vr(n,i,u,f){var s,e,o,c,a,h=vt(n);if(!f&&1===h.length){if(e=h[0]=h[0].slice(0),e.length>2&&"ID"===(o=e[0]).type&&r.getById&&9===i.nodeType&&l&&t.relative[e[1].type]){if(i=(t.find.ID(o.matches[0].replace(k,d),i)||[])[0],!i)return u;n=n.slice(e.shift().value.length)}for(s=at.needsContext.test(n)?0:e.length;s--;){if(o=e[s],t.relative[c=o.type])break;if((a=t.find[c])&&(f=a(o.matches[0].replace(k,d),gt.test(e[0].type)&&ii(i.parentNode)||i))){if(e.splice(s,1),n=f.length&&yt(e),!n)return b.apply(u,f),u;break}}}return wt(n,h)(f,i,!l,u,gt.test(n)&&ii(i.parentNode)||i),u}var it,r,t,st,oi,wt,ht,y,rt,p,e,v,l,o,g,ct,et,f="sizzle"+-new Date,s=n.document,a=0,bi=0,si=ni(),hi=ni(),ci=ni(),bt=function(n,t){return n===t&&(rt=!0),0},ut="undefined",li=-2147483648,ki={}.hasOwnProperty,w=[],di=w.pop,gi=w.push,b=w.push,ai=w.slice,nt=w.indexOf||function(n){for(var t=0,i=this.length;i>t;t++)if(this[t]===n)return t;return-1},kt="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",i="[\\x20\\t\\r\\n\\f]",ft="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",vi=ft.replace("w","w#"),yi="\\["+i+"*("+ft+")"+i+"*(?:([*^$|!~]?=)"+i+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+vi+")|)|)"+i+"*\\]",dt=":("+ft+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+yi.replace(3,8)+")*)|.*)\\)|)",lt=new RegExp("^"+i+"+|((?:^|[^\\\\])(?:\\\\.)*)"+i+"+$","g"),nr=new RegExp("^"+i+"*,"+i+"*"),tr=new RegExp("^"+i+"*([>+~]|"+i+")"+i+"*"),ir=new RegExp("="+i+"*([^\\]'\"]*?)"+i+"*\\]","g"),rr=new RegExp(dt),ur=new RegExp("^"+vi+"$"),at={ID:new RegExp("^#("+ft+")"),CLASS:new RegExp("^\\.("+ft+")"),TAG:new RegExp("^("+ft.replace("w","w*")+")"),ATTR:new RegExp("^"+yi),PSEUDO:new RegExp("^"+dt),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+i+"*(even|odd|(([+-]|)(\\d*)n|)"+i+"*(?:([+-]|)"+i+"*(\\d+)|))"+i+"*\\)|)","i"),bool:new RegExp("^(?:"+kt+")$","i"),needsContext:new RegExp("^"+i+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+i+"*((?:-\\d)?\\d*)"+i+"*\\)|)(?=[^-]|$)","i")},fr=/^(?:input|select|textarea|button)$/i,er=/^h\d$/i,ot=/^[^{]+\{\s*\[native \w/,or=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,gt=/[+~]/,sr=/'|\\/g,k=new RegExp("\\\\([\\da-f]{1,6}"+i+"?|("+i+")|.)","ig"),d=function(n,t,i){var r="0x"+t-65536;return r!==r||i?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{b.apply(w=ai.call(s.childNodes),s.childNodes);w[s.childNodes.length].nodeType}catch(yr){b={apply:w.length?function(n,t){gi.apply(n,ai.call(t))}:function(n,t){for(var i=n.length,r=0;n[i++]=t[r++];);n.length=i-1}}}r=u.support={};oi=u.isXML=function(n){var t=n&&(n.ownerDocument||n).documentElement;return t?"HTML"!==t.nodeName:!1};p=u.setDocument=function(n){var a,u=n?n.ownerDocument||n:s,h=u.defaultView;return u!==e&&9===u.nodeType&&u.documentElement?(e=u,v=u.documentElement,l=!oi(u),h&&h!==h.top&&(h.addEventListener?h.addEventListener("unload",function(){p()},!1):h.attachEvent&&h.attachEvent("onunload",function(){p()})),r.attributes=c(function(n){return n.className="i",!n.getAttribute("className")}),r.getElementsByTagName=c(function(n){return n.appendChild(u.createComment("")),!n.getElementsByTagName("*").length}),r.getElementsByClassName=ot.test(u.getElementsByClassName)&&c(function(n){return n.innerHTML="<div class='a'><\/div><div class='a i'><\/div>",n.firstChild.className="i",2===n.getElementsByClassName("i").length}),r.getById=c(function(n){return v.appendChild(n).id=f,!u.getElementsByName||!u.getElementsByName(f).length}),r.getById?(t.find.ID=function(n,t){if(typeof t.getElementById!==ut&&l){var i=t.getElementById(n);return i&&i.parentNode?[i]:[]}},t.filter.ID=function(n){var t=n.replace(k,d);return function(n){return n.getAttribute("id")===t}}):(delete t.find.ID,t.filter.ID=function(n){var t=n.replace(k,d);return function(n){var i=typeof n.getAttributeNode!==ut&&n.getAttributeNode("id");return i&&i.value===t}}),t.find.TAG=r.getElementsByTagName?function(n,t){if(typeof t.getElementsByTagName!==ut)return t.getElementsByTagName(n)}:function(n,t){var i,r=[],f=0,u=t.getElementsByTagName(n);if("*"===n){while(i=u[f++])1===i.nodeType&&r.push(i);return r}return u},t.find.CLASS=r.getElementsByClassName&&function(n,t){if(typeof t.getElementsByClassName!==ut&&l)return t.getElementsByClassName(n)},g=[],o=[],(r.qsa=ot.test(u.querySelectorAll))&&(c(function(n){n.innerHTML="<select t=''><option selected=''><\/option><\/select>";n.querySelectorAll("[t^='']").length&&o.push("[*^$]="+i+"*(?:''|\"\")");n.querySelectorAll("[selected]").length||o.push("\\["+i+"*(?:value|"+kt+")");n.querySelectorAll(":checked").length||o.push(":checked")}),c(function(n){var t=u.createElement("input");t.setAttribute("type","hidden");n.appendChild(t).setAttribute("name","D");n.querySelectorAll("[name=d]").length&&o.push("name"+i+"*[*^$|!~]?=");n.querySelectorAll(":enabled").length||o.push(":enabled",":disabled");n.querySelectorAll("*,:x");o.push(",.*:")})),(r.matchesSelector=ot.test(ct=v.webkitMatchesSelector||v.mozMatchesSelector||v.oMatchesSelector||v.msMatchesSelector))&&c(function(n){r.disconnectedMatch=ct.call(n,"div");ct.call(n,"[s!='']:x");g.push("!=",dt)}),o=o.length&&new RegExp(o.join("|")),g=g.length&&new RegExp(g.join("|")),a=ot.test(v.compareDocumentPosition),et=a||ot.test(v.contains)?function(n,t){var r=9===n.nodeType?n.documentElement:n,i=t&&t.parentNode;return n===i||!(!i||1!==i.nodeType||!(r.contains?r.contains(i):n.compareDocumentPosition&&16&n.compareDocumentPosition(i)))}:function(n,t){if(t)while(t=t.parentNode)if(t===n)return!0;return!1},bt=a?function(n,t){if(n===t)return rt=!0,0;var i=!n.compareDocumentPosition-!t.compareDocumentPosition;return i?i:(i=(n.ownerDocument||n)===(t.ownerDocument||t)?n.compareDocumentPosition(t):1,1&i||!r.sortDetached&&t.compareDocumentPosition(n)===i?n===u||n.ownerDocument===s&&et(s,n)?-1:t===u||t.ownerDocument===s&&et(s,t)?1:y?nt.call(y,n)-nt.call(y,t):0:4&i?-1:1)}:function(n,t){if(n===t)return rt=!0,0;var i,r=0,o=n.parentNode,h=t.parentNode,f=[n],e=[t];if(!o||!h)return n===u?-1:t===u?1:o?-1:h?1:y?nt.call(y,n)-nt.call(y,t):0;if(o===h)return pi(n,t);for(i=n;i=i.parentNode;)f.unshift(i);for(i=t;i=i.parentNode;)e.unshift(i);while(f[r]===e[r])r++;return r?pi(f[r],e[r]):f[r]===s?-1:e[r]===s?1:0},u):e};u.matches=function(n,t){return u(n,null,null,t)};u.matchesSelector=function(n,t){if((n.ownerDocument||n)!==e&&p(n),t=t.replace(ir,"='$1']"),!(!r.matchesSelector||!l||g&&g.test(t)||o&&o.test(t)))try{var i=ct.call(n,t);if(i||r.disconnectedMatch||n.document&&11!==n.document.nodeType)return i}catch(f){}return u(t,e,null,[n]).length>0};u.contains=function(n,t){return(n.ownerDocument||n)!==e&&p(n),et(n,t)};u.attr=function(n,i){(n.ownerDocument||n)!==e&&p(n);var f=t.attrHandle[i.toLowerCase()],u=f&&ki.call(t.attrHandle,i.toLowerCase())?f(n,i,!l):void 0;return void 0!==u?u:r.attributes||!l?n.getAttribute(i):(u=n.getAttributeNode(i))&&u.specified?u.value:null};u.error=function(n){throw new Error("Syntax error, unrecognized expression: "+n);};u.uniqueSort=function(n){var u,f=[],t=0,i=0;if(rt=!r.detectDuplicates,y=!r.sortStable&&n.slice(0),n.sort(bt),rt){while(u=n[i++])u===n[i]&&(t=f.push(i));while(t--)n.splice(f[t],1)}return y=null,n};st=u.getText=function(n){var r,i="",u=0,t=n.nodeType;if(t){if(1===t||9===t||11===t){if("string"==typeof n.textContent)return n.textContent;for(n=n.firstChild;n;n=n.nextSibling)i+=st(n)}else if(3===t||4===t)return n.nodeValue}else while(r=n[u++])i+=st(r);return i};t=u.selectors={cacheLength:50,createPseudo:h,match:at,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(n){return n[1]=n[1].replace(k,d),n[3]=(n[4]||n[5]||"").replace(k,d),"~="===n[2]&&(n[3]=" "+n[3]+" "),n.slice(0,4)},CHILD:function(n){return n[1]=n[1].toLowerCase(),"nth"===n[1].slice(0,3)?(n[3]||u.error(n[0]),n[4]=+(n[4]?n[5]+(n[6]||1):2*("even"===n[3]||"odd"===n[3])),n[5]=+(n[7]+n[8]||"odd"===n[3])):n[3]&&u.error(n[0]),n},PSEUDO:function(n){var i,t=!n[5]&&n[2];return at.CHILD.test(n[0])?null:(n[3]&&void 0!==n[4]?n[2]=n[4]:t&&rr.test(t)&&(i=vt(t,!0))&&(i=t.indexOf(")",t.length-i)-t.length)&&(n[0]=n[0].slice(0,i),n[2]=t.slice(0,i)),n.slice(0,3))}},filter:{TAG:function(n){var t=n.replace(k,d).toLowerCase();return"*"===n?function(){return!0}:function(n){return n.nodeName&&n.nodeName.toLowerCase()===t}},CLASS:function(n){var t=si[n+" "];return t||(t=new RegExp("(^|"+i+")"+n+"("+i+"|$)"))&&si(n,function(n){return t.test("string"==typeof n.className&&n.className||typeof n.getAttribute!==ut&&n.getAttribute("class")||"")})},ATTR:function(n,t,i){return function(r){var f=u.attr(r,n);return null==f?"!="===t:t?(f+="","="===t?f===i:"!="===t?f!==i:"^="===t?i&&0===f.indexOf(i):"*="===t?i&&f.indexOf(i)>-1:"$="===t?i&&f.slice(-i.length)===i:"~="===t?(" "+f+" ").indexOf(i)>-1:"|="===t?f===i||f.slice(0,i.length+1)===i+"-":!1):!0}},CHILD:function(n,t,i,r,u){var s="nth"!==n.slice(0,3),o="last"!==n.slice(-4),e="of-type"===t;return 1===r&&0===u?function(n){return!!n.parentNode}:function(t,i,h){var v,k,c,l,y,w,b=s!==o?"nextSibling":"previousSibling",p=t.parentNode,g=e&&t.nodeName.toLowerCase(),d=!h&&!e;if(p){if(s){while(b){for(c=t;c=c[b];)if(e?c.nodeName.toLowerCase()===g:1===c.nodeType)return!1;w=b="only"===n&&!w&&"nextSibling"}return!0}if(w=[o?p.firstChild:p.lastChild],o&&d){for(k=p[f]||(p[f]={}),v=k[n]||[],y=v[0]===a&&v[1],l=v[0]===a&&v[2],c=y&&p.childNodes[y];c=++y&&c&&c[b]||(l=y=0)||w.pop();)if(1===c.nodeType&&++l&&c===t){k[n]=[a,y,l];break}}else if(d&&(v=(t[f]||(t[f]={}))[n])&&v[0]===a)l=v[1];else while(c=++y&&c&&c[b]||(l=y=0)||w.pop())if((e?c.nodeName.toLowerCase()===g:1===c.nodeType)&&++l&&(d&&((c[f]||(c[f]={}))[n]=[a,l]),c===t))break;return l-=u,l===r||l%r==0&&l/r>=0}}},PSEUDO:function(n,i){var e,r=t.pseudos[n]||t.setFilters[n.toLowerCase()]||u.error("unsupported pseudo: "+n);return r[f]?r(i):r.length>1?(e=[n,n,"",i],t.setFilters.hasOwnProperty(n.toLowerCase())?h(function(n,t){for(var u,f=r(n,i),e=f.length;e--;)u=nt.call(n,f[e]),n[u]=!(t[u]=f[e])}):function(n){return r(n,0,e)}):r}},pseudos:{not:h(function(n){var i=[],r=[],t=wt(n.replace(lt,"$1"));return t[f]?h(function(n,i,r,u){for(var e,o=t(n,null,u,[]),f=n.length;f--;)(e=o[f])&&(n[f]=!(i[f]=e))}):function(n,u,f){return i[0]=n,t(i,null,f,r),!r.pop()}}),has:h(function(n){return function(t){return u(n,t).length>0}}),contains:h(function(n){return function(t){return(t.textContent||t.innerText||st(t)).indexOf(n)>-1}}),lang:h(function(n){return ur.test(n||"")||u.error("unsupported lang: "+n),n=n.replace(k,d).toLowerCase(),function(t){var i;do if(i=l?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return i=i.toLowerCase(),i===n||0===i.indexOf(n+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var i=n.location&&n.location.hash;return i&&i.slice(1)===t.id},root:function(n){return n===v},focus:function(n){return n===e.activeElement&&(!e.hasFocus||e.hasFocus())&&!!(n.type||n.href||~n.tabIndex)},enabled:function(n){return n.disabled===!1},disabled:function(n){return n.disabled===!0},checked:function(n){var t=n.nodeName.toLowerCase();return"input"===t&&!!n.checked||"option"===t&&!!n.selected},selected:function(n){return n.parentNode&&n.parentNode.selectedIndex,n.selected===!0},empty:function(n){for(n=n.firstChild;n;n=n.nextSibling)if(n.nodeType<6)return!1;return!0},parent:function(n){return!t.pseudos.empty(n)},header:function(n){return er.test(n.nodeName)},input:function(n){return fr.test(n.nodeName)},button:function(n){var t=n.nodeName.toLowerCase();return"input"===t&&"button"===n.type||"button"===t},text:function(n){var t;return"input"===n.nodeName.toLowerCase()&&"text"===n.type&&(null==(t=n.getAttribute("type"))||"text"===t.toLowerCase())},first:tt(function(){return[0]}),last:tt(function(n,t){return[t-1]}),eq:tt(function(n,t,i){return[0>i?i+t:i]}),even:tt(function(n,t){for(var i=0;t>i;i+=2)n.push(i);return n}),odd:tt(function(n,t){for(var i=1;t>i;i+=2)n.push(i);return n}),lt:tt(function(n,t,i){for(var r=0>i?i+t:i;--r>=0;)n.push(r);return n}),gt:tt(function(n,t,i){for(var r=0>i?i+t:i;++r<t;)n.push(r);return n})}};t.pseudos.nth=t.pseudos.eq;for(it in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})t.pseudos[it]=hr(it);for(it in{submit:!0,reset:!0})t.pseudos[it]=cr(it);return wi.prototype=t.filters=t.pseudos,t.setFilters=new wi,wt=u.compile=function(n,t){var r,u=[],e=[],i=ci[n+" "];if(!i){for(t||(t=vt(n)),r=t.length;r--;)i=ei(t[r]),i[f]?u.push(i):e.push(i);i=ci(n,lr(e,u))}return i},r.sortStable=f.split("").sort(bt).join("")===f,r.detectDuplicates=!!rt,p(),r.sortDetached=c(function(n){return 1&n.compareDocumentPosition(e.createElement("div"))}),c(function(n){return n.innerHTML="<a href='#'><\/a>","#"===n.firstChild.getAttribute("href")})||ti("type|href|height|width",function(n,t,i){if(!i)return n.getAttribute(t,"type"===t.toLowerCase()?1:2)}),r.attributes&&c(function(n){return n.innerHTML="<input/>",n.firstChild.setAttribute("value",""),""===n.firstChild.getAttribute("value")})||ti("value",function(n,t,i){if(!i&&"input"===n.nodeName.toLowerCase())return n.defaultValue}),c(function(n){return null==n.getAttribute("disabled")})||ti(kt,function(n,t,i){var r;if(!i)return n[t]===!0?t.toLowerCase():(r=n.getAttributeNode(t))&&r.specified?r.value:null}),u}(n);i.find=p;i.expr=p.selectors;i.expr[":"]=i.expr.pseudos;i.unique=p.uniqueSort;i.text=p.getText;i.isXMLDoc=p.isXML;i.contains=p.contains;var fr=i.expr.match.needsContext,er=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,ue=/^.[^:#\[\.,]*$/;i.filter=function(n,t,r){var u=t[0];return r&&(n=":not("+n+")"),1===t.length&&1===u.nodeType?i.find.matchesSelector(u,n)?[u]:[]:i.find.matches(n,i.grep(t,function(n){return 1===n.nodeType}))};i.fn.extend({find:function(n){var t,r=[],u=this,f=u.length;if("string"!=typeof n)return this.pushStack(i(n).filter(function(){for(t=0;f>t;t++)if(i.contains(u[t],this))return!0}));for(t=0;f>t;t++)i.find(n,u[t],r);return r=this.pushStack(f>1?i.unique(r):r),r.selector=this.selector?this.selector+" "+n:n,r},filter:function(n){return this.pushStack(ui(this,n||[],!1))},not:function(n){return this.pushStack(ui(this,n||[],!0))},is:function(n){return!!ui(this,"string"==typeof n&&fr.test(n)?i(n):n||[],!1).length}});var ft,u=n.document,fe=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,ee=i.fn.init=function(n,t){var r,f;if(!n)return this;if("string"==typeof n){if(r="<"===n.charAt(0)&&">"===n.charAt(n.length-1)&&n.length>=3?[null,n,null]:fe.exec(n),!r||!r[1]&&t)return!t||t.jquery?(t||ft).find(n):this.constructor(t).find(n);if(r[1]){if(t=t instanceof i?t[0]:t,i.merge(this,i.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:u,!0)),er.test(r[1])&&i.isPlainObject(t))for(r in t)i.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}if(f=u.getElementById(r[2]),f&&f.parentNode){if(f.id!==r[2])return ft.find(n);this.length=1;this[0]=f}return this.context=u,this.selector=n,this}return n.nodeType?(this.context=this[0]=n,this.length=1,this):i.isFunction(n)?"undefined"!=typeof ft.ready?ft.ready(n):n(i):(void 0!==n.selector&&(this.selector=n.selector,this.context=n.context),i.makeArray(n,this))};ee.prototype=i.fn;ft=i(u);or=/^(?:parents|prev(?:Until|All))/;sr={children:!0,contents:!0,next:!0,prev:!0};i.extend({dir:function(n,t,r){for(var f=[],u=n[t];u&&9!==u.nodeType&&(void 0===r||1!==u.nodeType||!i(u).is(r));)1===u.nodeType&&f.push(u),u=u[t];return f},sibling:function(n,t){for(var i=[];n;n=n.nextSibling)1===n.nodeType&&n!==t&&i.push(n);return i}});i.fn.extend({has:function(n){var t,r=i(n,this),u=r.length;return this.filter(function(){for(t=0;u>t;t++)if(i.contains(this,r[t]))return!0})},closest:function(n,t){for(var r,f=0,o=this.length,u=[],e=fr.test(n)||"string"!=typeof n?i(n,t||this.context):0;o>f;f++)for(r=this[f];r&&r!==t;r=r.parentNode)if(r.nodeType<11&&(e?e.index(r)>-1:1===r.nodeType&&i.find.matchesSelector(r,n))){u.push(r);break}return this.pushStack(u.length>1?i.unique(u):u)},index:function(n){return n?"string"==typeof n?i.inArray(this[0],i(n)):i.inArray(n.jquery?n[0]:n,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(n,t){return this.pushStack(i.unique(i.merge(this.get(),i(n,t))))},addBack:function(n){return this.add(null==n?this.prevObject:this.prevObject.filter(n))}});i.each({parent:function(n){var t=n.parentNode;return t&&11!==t.nodeType?t:null},parents:function(n){return i.dir(n,"parentNode")},parentsUntil:function(n,t,r){return i.dir(n,"parentNode",r)},next:function(n){return hr(n,"nextSibling")},prev:function(n){return hr(n,"previousSibling")},nextAll:function(n){return i.dir(n,"nextSibling")},prevAll:function(n){return i.dir(n,"previousSibling")},nextUntil:function(n,t,r){return i.dir(n,"nextSibling",r)},prevUntil:function(n,t,r){return i.dir(n,"previousSibling",r)},siblings:function(n){return i.sibling((n.parentNode||{}).firstChild,n)},children:function(n){return i.sibling(n.firstChild)},contents:function(n){return i.nodeName(n,"iframe")?n.contentDocument||n.contentWindow.document:i.merge([],n.childNodes)}},function(n,t){i.fn[n]=function(r,u){var f=i.map(this,t,r);return"Until"!==n.slice(-5)&&(u=r),u&&"string"==typeof u&&(f=i.filter(u,f)),this.length>1&&(sr[n]||(f=i.unique(f)),or.test(n)&&(f=f.reverse())),this.pushStack(f)}});h=/\S+/g;fi={};i.Callbacks=function(n){n="string"==typeof n?fi[n]||oe(n):i.extend({},n);var o,u,h,f,e,c,t=[],r=!n.once&&[],l=function(i){for(u=n.memory&&i,h=!0,e=c||0,c=0,f=t.length,o=!0;t&&f>e;e++)if(t[e].apply(i[0],i[1])===!1&&n.stopOnFalse){u=!1;break}o=!1;t&&(r?r.length&&l(r.shift()):u?t=[]:s.disable())},s={add:function(){if(t){var r=t.length;!function e(r){i.each(r,function(r,u){var f=i.type(u);"function"===f?n.unique&&s.has(u)||t.push(u):u&&u.length&&"string"!==f&&e(u)})}(arguments);o?f=t.length:u&&(c=r,l(u))}return this},remove:function(){return t&&i.each(arguments,function(n,r){for(var u;(u=i.inArray(r,t,u))>-1;)t.splice(u,1),o&&(f>=u&&f--,e>=u&&e--)}),this},has:function(n){return n?i.inArray(n,t)>-1:!(!t||!t.length)},empty:function(){return t=[],f=0,this},disable:function(){return t=r=u=void 0,this},disabled:function(){return!t},lock:function(){return r=void 0,u||s.disable(),this},locked:function(){return!r},fireWith:function(n,i){return!t||h&&!r||(i=i||[],i=[n,i.slice?i.slice():i],o?r.push(i):l(i)),this},fire:function(){return s.fireWith(this,arguments),this},fired:function(){return!!h}};return s};i.extend({Deferred:function(n){var u=[["resolve","done",i.Callbacks("once memory"),"resolved"],["reject","fail",i.Callbacks("once memory"),"rejected"],["notify","progress",i.Callbacks("memory")]],f="pending",r={state:function(){return f},always:function(){return t.done(arguments).fail(arguments),this},then:function(){var n=arguments;return i.Deferred(function(f){i.each(u,function(u,e){var o=i.isFunction(n[u])&&n[u];t[e[1]](function(){var n=o&&o.apply(this,arguments);n&&i.isFunction(n.promise)?n.promise().done(f.resolve).fail(f.reject).progress(f.notify):f[e[0]+"With"](this===r?f.promise():this,o?[n]:arguments)})});n=null}).promise()},promise:function(n){return null!=n?i.extend(n,r):r}},t={};return r.pipe=r.then,i.each(u,function(n,i){var e=i[2],o=i[3];r[i[1]]=e.add;o&&e.add(function(){f=o},u[1^n][2].disable,u[2][2].lock);t[i[0]]=function(){return t[i[0]+"With"](this===t?r:this,arguments),this};t[i[0]+"With"]=e.fireWith}),r.promise(t),n&&n.call(t,t),t},when:function(n){var t=0,u=l.call(arguments),r=u.length,e=1!==r||n&&i.isFunction(n.promise)?r:0,f=1===e?n:i.Deferred(),h=function(n,t,i){return function(r){t[n]=this;i[n]=arguments.length>1?l.call(arguments):r;i===o?f.notifyWith(t,i):--e||f.resolveWith(t,i)}},o,c,s;if(r>1)for(o=new Array(r),c=new Array(r),s=new Array(r);r>t;t++)u[t]&&i.isFunction(u[t].promise)?u[t].promise().done(h(t,s,u)).fail(f.reject).progress(h(t,c,o)):--e;return e||f.resolveWith(s,u),f.promise()}});i.fn.ready=function(n){return i.ready.promise().done(n),this};i.extend({isReady:!1,readyWait:1,holdReady:function(n){n?i.readyWait++:i.ready(!0)},ready:function(n){if(n===!0?!--i.readyWait:!i.isReady){if(!u.body)return setTimeout(i.ready);i.isReady=!0;n!==!0&&--i.readyWait>0||(lt.resolveWith(u,[i]),i.fn.trigger&&i(u).trigger("ready").off("ready"))}}});i.ready.promise=function(t){if(!lt)if(lt=i.Deferred(),"complete"===u.readyState)setTimeout(i.ready);else if(u.addEventListener)u.addEventListener("DOMContentLoaded",a,!1),n.addEventListener("load",a,!1);else{u.attachEvent("onreadystatechange",a);n.attachEvent("onload",a);var r=!1;try{r=null==n.frameElement&&u.documentElement}catch(e){}r&&r.doScroll&&!function f(){if(!i.isReady){try{r.doScroll("left")}catch(n){return setTimeout(f,50)}cr();i.ready()}}()}return lt.promise(t)};o="undefined";for(lr in i(r))break;r.ownLast="0"!==lr;r.inlineBlockNeedsLayout=!1;i(function(){var t,n,i=u.getElementsByTagName("body")[0];i&&(t=u.createElement("div"),t.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",n=u.createElement("div"),i.appendChild(t).appendChild(n),typeof n.style.zoom!==o&&(n.style.cssText="border:0;margin:0;width:1px;padding:1px;display:inline;zoom:1",(r.inlineBlockNeedsLayout=3===n.offsetWidth)&&(i.style.zoom=1)),i.removeChild(t),t=n=null)}),function(){var n=u.createElement("div");if(null==r.deleteExpando){r.deleteExpando=!0;try{delete n.test}catch(t){r.deleteExpando=!1}}n=null}();i.acceptData=function(n){var t=i.noData[(n.nodeName+" ").toLowerCase()],r=+n.nodeType||1;return 1!==r&&9!==r?!1:!t||t!==!0&&n.getAttribute("classid")===t};ar=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/;vr=/([A-Z])/g;i.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(n){return n=n.nodeType?i.cache[n[i.expando]]:n[i.expando],!!n&&!ei(n)},data:function(n,t,i){return pr(n,t,i)},removeData:function(n,t){return wr(n,t)},_data:function(n,t,i){return pr(n,t,i,!0)},_removeData:function(n,t){return wr(n,t,!0)}});i.fn.extend({data:function(n,t){var f,u,e,r=this[0],o=r&&r.attributes;if(void 0===n){if(this.length&&(e=i.data(r),1===r.nodeType&&!i._data(r,"parsedAttrs"))){for(f=o.length;f--;)u=o[f].name,0===u.indexOf("data-")&&(u=i.camelCase(u.slice(5)),yr(r,u,e[u]));i._data(r,"parsedAttrs",!0)}return e}return"object"==typeof n?this.each(function(){i.data(this,n)}):arguments.length>1?this.each(function(){i.data(this,n,t)}):r?yr(r,n,i.data(r,n)):void 0},removeData:function(n){return this.each(function(){i.removeData(this,n)})}});i.extend({queue:function(n,t,r){var u;if(n)return(t=(t||"fx")+"queue",u=i._data(n,t),r&&(!u||i.isArray(r)?u=i._data(n,t,i.makeArray(r)):u.push(r)),u||[])},dequeue:function(n,t){t=t||"fx";var r=i.queue(n,t),e=r.length,u=r.shift(),f=i._queueHooks(n,t),o=function(){i.dequeue(n,t)};"inprogress"===u&&(u=r.shift(),e--);u&&("fx"===t&&r.unshift("inprogress"),delete f.stop,u.call(n,o,f));!e&&f&&f.empty.fire()},_queueHooks:function(n,t){var r=t+"queueHooks";return i._data(n,r)||i._data(n,r,{empty:i.Callbacks("once memory").add(function(){i._removeData(n,t+"queue");i._removeData(n,r)})})}});i.fn.extend({queue:function(n,t){var r=2;return"string"!=typeof n&&(t=n,n="fx",r--),arguments.length<r?i.queue(this[0],n):void 0===t?this:this.each(function(){var r=i.queue(this,n,t);i._queueHooks(this,n);"fx"===n&&"inprogress"!==r[0]&&i.dequeue(this,n)})},dequeue:function(n){return this.each(function(){i.dequeue(this,n)})},clearQueue:function(n){return this.queue(n||"fx",[])},promise:function(n,t){var r,f=1,e=i.Deferred(),u=this,o=this.length,s=function(){--f||e.resolveWith(u,[u])};for("string"!=typeof n&&(t=n,n=void 0),n=n||"fx";o--;)r=i._data(u[o],n+"queueHooks"),r&&r.empty&&(f++,r.empty.add(s));return s(),e.promise(t)}});var at=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=["Top","Right","Bottom","Left"],et=function(n,t){return n=t||n,"none"===i.css(n,"display")||!i.contains(n.ownerDocument,n)},b=i.access=function(n,t,r,u,f,e,o){var s=0,c=n.length,h=null==r;if("object"===i.type(r)){f=!0;for(s in r)i.access(n,t,s,r[s],!0,e,o)}else if(void 0!==u&&(f=!0,i.isFunction(u)||(o=!0),h&&(o?(t.call(n,u),t=null):(h=t,t=function(n,t,r){return h.call(i(n),r)})),t))for(;c>s;s++)t(n[s],r,o?u:u.call(n[s],s,t(n[s],r)));return f?n:h?t.call(n):c?t(n[0],r):e},oi=/^(?:checkbox|radio)$/i;!function(){var i=u.createDocumentFragment(),n=u.createElement("div"),t=u.createElement("input");if(n.setAttribute("className","t"),n.innerHTML="  <link/><table><\/table><a href='/a'>a<\/a>",r.leadingWhitespace=3===n.firstChild.nodeType,r.tbody=!n.getElementsByTagName("tbody").length,r.htmlSerialize=!!n.getElementsByTagName("link").length,r.html5Clone="<:nav><\/:nav>"!==u.createElement("nav").cloneNode(!0).outerHTML,t.type="checkbox",t.checked=!0,i.appendChild(t),r.appendChecked=t.checked,n.innerHTML="<textarea>x<\/textarea>",r.noCloneChecked=!!n.cloneNode(!0).lastChild.defaultValue,i.appendChild(n),n.innerHTML="<input type='radio' checked='checked' name='t'/>",r.checkClone=n.cloneNode(!0).cloneNode(!0).lastChild.checked,r.noCloneEvent=!0,n.attachEvent&&(n.attachEvent("onclick",function(){r.noCloneEvent=!1}),n.cloneNode(!0).click()),null==r.deleteExpando){r.deleteExpando=!0;try{delete n.test}catch(f){r.deleteExpando=!1}}i=n=t=null}(),function(){var t,i,f=u.createElement("div");for(t in{submit:!0,change:!0,focusin:!0})i="on"+t,(r[t+"Bubbles"]=i in n)||(f.setAttribute(i,"t"),r[t+"Bubbles"]=f.attributes[i].expando===!1);f=null}();var si=/^(?:input|select|textarea)$/i,se=/^key/,he=/^(?:mouse|contextmenu)|click/,br=/^(?:focusinfocus|focusoutblur)$/,kr=/^([^.]*)(?:\.(.+)|)$/;i.event={global:{},add:function(n,t,r,u,f){var w,y,b,p,s,c,l,a,e,k,d,v=i._data(n);if(v){for(r.handler&&(p=r,r=p.handler,f=p.selector),r.guid||(r.guid=i.guid++),(y=v.events)||(y=v.events={}),(c=v.handle)||(c=v.handle=function(n){if(typeof i!==o&&(!n||i.event.triggered!==n.type))return i.event.dispatch.apply(c.elem,arguments)},c.elem=n),t=(t||"").match(h)||[""],b=t.length;b--;)w=kr.exec(t[b])||[],e=d=w[1],k=(w[2]||"").split(".").sort(),e&&(s=i.event.special[e]||{},e=(f?s.delegateType:s.bindType)||e,s=i.event.special[e]||{},l=i.extend({type:e,origType:d,data:u,handler:r,guid:r.guid,selector:f,needsContext:f&&i.expr.match.needsContext.test(f),namespace:k.join(".")},p),(a=y[e])||(a=y[e]=[],a.delegateCount=0,s.setup&&s.setup.call(n,u,k,c)!==!1||(n.addEventListener?n.addEventListener(e,c,!1):n.attachEvent&&n.attachEvent("on"+e,c))),s.add&&(s.add.call(n,l),l.handler.guid||(l.handler.guid=r.guid)),f?a.splice(a.delegateCount++,0,l):a.push(l),i.event.global[e]=!0);n=null}},remove:function(n,t,r,u,f){var y,o,s,b,p,a,c,l,e,w,k,v=i.hasData(n)&&i._data(n);if(v&&(a=v.events)){for(t=(t||"").match(h)||[""],p=t.length;p--;)if(s=kr.exec(t[p])||[],e=k=s[1],w=(s[2]||"").split(".").sort(),e){for(c=i.event.special[e]||{},e=(u?c.delegateType:c.bindType)||e,l=a[e]||[],s=s[2]&&new RegExp("(^|\\.)"+w.join("\\.(?:.*\\.|)")+"(\\.|$)"),b=y=l.length;y--;)o=l[y],!f&&k!==o.origType||r&&r.guid!==o.guid||s&&!s.test(o.namespace)||u&&u!==o.selector&&("**"!==u||!o.selector)||(l.splice(y,1),o.selector&&l.delegateCount--,c.remove&&c.remove.call(n,o));b&&!l.length&&(c.teardown&&c.teardown.call(n,w,v.handle)!==!1||i.removeEvent(n,e,v.handle),delete a[e])}else for(e in a)i.event.remove(n,e+t[p],r,u,!0);i.isEmptyObject(a)&&(delete v.handle,i._removeData(n,"events"))}},trigger:function(t,r,f,e){var l,a,o,p,c,h,w,y=[f||u],s=tt.call(t,"type")?t.type:t,v=tt.call(t,"namespace")?t.namespace.split("."):[];if(o=h=f=f||u,3!==f.nodeType&&8!==f.nodeType&&!br.test(s+i.event.triggered)&&(s.indexOf(".")>=0&&(v=s.split("."),s=v.shift(),v.sort()),a=s.indexOf(":")<0&&"on"+s,t=t[i.expando]?t:new i.Event(s,"object"==typeof t&&t),t.isTrigger=e?2:3,t.namespace=v.join("."),t.namespace_re=t.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=f),r=null==r?[t]:i.makeArray(r,[t]),c=i.event.special[s]||{},e||!c.trigger||c.trigger.apply(f,r)!==!1)){if(!e&&!c.noBubble&&!i.isWindow(f)){for(p=c.delegateType||s,br.test(p+s)||(o=o.parentNode);o;o=o.parentNode)y.push(o),h=o;h===(f.ownerDocument||u)&&y.push(h.defaultView||h.parentWindow||n)}for(w=0;(o=y[w++])&&!t.isPropagationStopped();)t.type=w>1?p:c.bindType||s,l=(i._data(o,"events")||{})[t.type]&&i._data(o,"handle"),l&&l.apply(o,r),l=a&&o[a],l&&l.apply&&i.acceptData(o)&&(t.result=l.apply(o,r),t.result===!1&&t.preventDefault());if(t.type=s,!e&&!t.isDefaultPrevented()&&(!c._default||c._default.apply(y.pop(),r)===!1)&&i.acceptData(f)&&a&&f[s]&&!i.isWindow(f)){h=f[a];h&&(f[a]=null);i.event.triggered=s;try{f[s]()}catch(b){}i.event.triggered=void 0;h&&(f[a]=h)}return t.result}},dispatch:function(n){n=i.event.fix(n);var e,f,t,r,o,s=[],h=l.call(arguments),c=(i._data(this,"events")||{})[n.type]||[],u=i.event.special[n.type]||{};if(h[0]=n,n.delegateTarget=this,!u.preDispatch||u.preDispatch.call(this,n)!==!1){for(s=i.event.handlers.call(this,n,c),e=0;(r=s[e++])&&!n.isPropagationStopped();)for(n.currentTarget=r.elem,o=0;(t=r.handlers[o++])&&!n.isImmediatePropagationStopped();)(!n.namespace_re||n.namespace_re.test(t.namespace))&&(n.handleObj=t,n.data=t.data,f=((i.event.special[t.origType]||{}).handle||t.handler).apply(r.elem,h),void 0!==f&&(n.result=f)===!1&&(n.preventDefault(),n.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,n),n.result}},handlers:function(n,t){var f,e,u,o,h=[],s=t.delegateCount,r=n.target;if(s&&r.nodeType&&(!n.button||"click"!==n.type))for(;r!=this;r=r.parentNode||this)if(1===r.nodeType&&(r.disabled!==!0||"click"!==n.type)){for(u=[],o=0;s>o;o++)e=t[o],f=e.selector+" ",void 0===u[f]&&(u[f]=e.needsContext?i(f,this).index(r)>=0:i.find(f,this,null,[r]).length),u[f]&&u.push(e);u.length&&h.push({elem:r,handlers:u})}return s<t.length&&h.push({elem:this,handlers:t.slice(s)}),h},fix:function(n){if(n[i.expando])return n;var e,o,s,r=n.type,f=n,t=this.fixHooks[r];for(t||(this.fixHooks[r]=t=he.test(r)?this.mouseHooks:se.test(r)?this.keyHooks:{}),s=t.props?this.props.concat(t.props):this.props,n=new i.Event(f),e=s.length;e--;)o=s[e],n[o]=f[o];return n.target||(n.target=f.srcElement||u),3===n.target.nodeType&&(n.target=n.target.parentNode),n.metaKey=!!n.metaKey,t.filter?t.filter(n,f):n},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(n,t){return null==n.which&&(n.which=null!=t.charCode?t.charCode:t.keyCode),n}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(n,t){var i,e,r,f=t.button,o=t.fromElement;return null==n.pageX&&null!=t.clientX&&(e=n.target.ownerDocument||u,r=e.documentElement,i=e.body,n.pageX=t.clientX+(r&&r.scrollLeft||i&&i.scrollLeft||0)-(r&&r.clientLeft||i&&i.clientLeft||0),n.pageY=t.clientY+(r&&r.scrollTop||i&&i.scrollTop||0)-(r&&r.clientTop||i&&i.clientTop||0)),!n.relatedTarget&&o&&(n.relatedTarget=o===n.target?t.toElement:o),n.which||void 0===f||(n.which=1&f?1:2&f?3:4&f?2:0),n}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==dr()&&this.focus)try{return this.focus(),!1}catch(n){}},delegateType:"focusin"},blur:{trigger:function(){if(this===dr()&&this.blur)return(this.blur(),!1)},delegateType:"focusout"},click:{trigger:function(){if(i.nodeName(this,"input")&&"checkbox"===this.type&&this.click)return(this.click(),!1)},_default:function(n){return i.nodeName(n.target,"a")}},beforeunload:{postDispatch:function(n){void 0!==n.result&&(n.originalEvent.returnValue=n.result)}}},simulate:function(n,t,r,u){var f=i.extend(new i.Event,r,{type:n,isSimulated:!0,originalEvent:{}});u?i.event.trigger(f,null,t):i.event.dispatch.call(t,f);f.isDefaultPrevented()&&r.preventDefault()}};i.removeEvent=u.removeEventListener?function(n,t,i){n.removeEventListener&&n.removeEventListener(t,i,!1)}:function(n,t,i){var r="on"+t;n.detachEvent&&(typeof n[r]===o&&(n[r]=null),n.detachEvent(r,i))};i.Event=function(n,t){return this instanceof i.Event?(n&&n.type?(this.originalEvent=n,this.type=n.type,this.isDefaultPrevented=n.defaultPrevented||void 0===n.defaultPrevented&&(n.returnValue===!1||n.getPreventDefault&&n.getPreventDefault())?vt:it):this.type=n,t&&i.extend(this,t),this.timeStamp=n&&n.timeStamp||i.now(),void(this[i.expando]=!0)):new i.Event(n,t)};i.Event.prototype={isDefaultPrevented:it,isPropagationStopped:it,isImmediatePropagationStopped:it,preventDefault:function(){var n=this.originalEvent;this.isDefaultPrevented=vt;n&&(n.preventDefault?n.preventDefault():n.returnValue=!1)},stopPropagation:function(){var n=this.originalEvent;this.isPropagationStopped=vt;n&&(n.stopPropagation&&n.stopPropagation(),n.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=vt;this.stopPropagation()}};i.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(n,t){i.event.special[n]={delegateType:t,bindType:t,handle:function(n){var u,f=this,r=n.relatedTarget,e=n.handleObj;return(!r||r!==f&&!i.contains(f,r))&&(n.type=e.origType,u=e.handler.apply(this,arguments),n.type=t),u}}});r.submitBubbles||(i.event.special.submit={setup:function(){return i.nodeName(this,"form")?!1:void i.event.add(this,"click._submit keypress._submit",function(n){var r=n.target,t=i.nodeName(r,"input")||i.nodeName(r,"button")?r.form:void 0;t&&!i._data(t,"submitBubbles")&&(i.event.add(t,"submit._submit",function(n){n._submit_bubble=!0}),i._data(t,"submitBubbles",!0))})},postDispatch:function(n){n._submit_bubble&&(delete n._submit_bubble,this.parentNode&&!n.isTrigger&&i.event.simulate("submit",this.parentNode,n,!0))},teardown:function(){return i.nodeName(this,"form")?!1:void i.event.remove(this,"._submit")}});r.changeBubbles||(i.event.special.change={setup:function(){return si.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(i.event.add(this,"propertychange._change",function(n){"checked"===n.originalEvent.propertyName&&(this._just_changed=!0)}),i.event.add(this,"click._change",function(n){this._just_changed&&!n.isTrigger&&(this._just_changed=!1);i.event.simulate("change",this,n,!0)})),!1):void i.event.add(this,"beforeactivate._change",function(n){var t=n.target;si.test(t.nodeName)&&!i._data(t,"changeBubbles")&&(i.event.add(t,"change._change",function(n){!this.parentNode||n.isSimulated||n.isTrigger||i.event.simulate("change",this.parentNode,n,!0)}),i._data(t,"changeBubbles",!0))})},handle:function(n){var t=n.target;if(this!==t||n.isSimulated||n.isTrigger||"radio"!==t.type&&"checkbox"!==t.type)return n.handleObj.handler.apply(this,arguments)},teardown:function(){return i.event.remove(this,"._change"),!si.test(this.nodeName)}});r.focusinBubbles||i.each({focus:"focusin",blur:"focusout"},function(n,t){var r=function(n){i.event.simulate(t,n.target,i.event.fix(n),!0)};i.event.special[t]={setup:function(){var u=this.ownerDocument||this,f=i._data(u,t);f||u.addEventListener(n,r,!0);i._data(u,t,(f||0)+1)},teardown:function(){var u=this.ownerDocument||this,f=i._data(u,t)-1;f?i._data(u,t,f):(u.removeEventListener(n,r,!0),i._removeData(u,t))}}});i.fn.extend({on:function(n,t,r,u,f){var o,e;if("object"==typeof n){"string"!=typeof t&&(r=r||t,t=void 0);for(o in n)this.on(o,t,r,n[o],f);return this}if(null==r&&null==u?(u=t,r=t=void 0):null==u&&("string"==typeof t?(u=r,r=void 0):(u=r,r=t,t=void 0)),u===!1)u=it;else if(!u)return this;return 1===f&&(e=u,u=function(n){return i().off(n),e.apply(this,arguments)},u.guid=e.guid||(e.guid=i.guid++)),this.each(function(){i.event.add(this,n,u,r,t)})},one:function(n,t,i,r){return this.on(n,t,i,r,1)},off:function(n,t,r){var u,f;if(n&&n.preventDefault&&n.handleObj)return u=n.handleObj,i(n.delegateTarget).off(u.namespace?u.origType+"."+u.namespace:u.origType,u.selector,u.handler),this;if("object"==typeof n){for(f in n)this.off(f,t,n[f]);return this}return(t===!1||"function"==typeof t)&&(r=t,t=void 0),r===!1&&(r=it),this.each(function(){i.event.remove(this,n,r,t)})},trigger:function(n,t){return this.each(function(){i.event.trigger(n,t,this)})},triggerHandler:function(n,t){var r=this[0];if(r)return i.event.trigger(n,t,r,!0)}});var nu="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ce=/ jQuery\d+="(?:null|\d+)"/g,tu=new RegExp("<(?:"+nu+")[\\s/>]","i"),hi=/^\s+/,iu=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ru=/<([\w:]+)/,uu=/<tbody/i,le=/<|&#?\w+;/,ae=/<(?:script|style|link)/i,ve=/checked\s*(?:[^=]|=\s*.checked.)/i,fu=/^$|\/(?:java|ecma)script/i,ye=/^true\/(.*)/,pe=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,s={option:[1,"<select multiple='multiple'>","<\/select>"],legend:[1,"<fieldset>","<\/fieldset>"],area:[1,"<map>","<\/map>"],param:[1,"<object>","<\/object>"],thead:[1,"<table>","<\/table>"],tr:[2,"<table><tbody>","<\/tbody><\/table>"],col:[2,"<table><tbody><\/tbody><colgroup>","<\/colgroup><\/table>"],td:[3,"<table><tbody><tr>","<\/tr><\/tbody><\/table>"],_default:r.htmlSerialize?[0,"",""]:[1,"X<div>","<\/div>"]},we=gr(u),ci=we.appendChild(u.createElement("div"));s.optgroup=s.option;s.tbody=s.tfoot=s.colgroup=s.caption=s.thead;s.th=s.td;i.extend({clone:function(n,t,u){var e,c,s,o,h,l=i.contains(n.ownerDocument,n);if(r.html5Clone||i.isXMLDoc(n)||!tu.test("<"+n.nodeName+">")?s=n.cloneNode(!0):(ci.innerHTML=n.outerHTML,ci.removeChild(s=ci.firstChild)),!(r.noCloneEvent&&r.noCloneChecked||1!==n.nodeType&&11!==n.nodeType||i.isXMLDoc(n)))for(e=f(s),h=f(n),o=0;null!=(c=h[o]);++o)e[o]&&ke(c,e[o]);if(t)if(u)for(h=h||f(n),e=e||f(s),o=0;null!=(c=h[o]);o++)hu(c,e[o]);else hu(n,s);return e=f(s,"script"),e.length>0&&li(e,!l&&f(n,"script")),e=h=c=null,s},buildFragment:function(n,t,u,e){for(var c,o,b,h,p,w,a,k=n.length,v=gr(t),l=[],y=0;k>y;y++)if(o=n[y],o||0===o)if("object"===i.type(o))i.merge(l,o.nodeType?[o]:o);else if(le.test(o)){for(h=h||v.appendChild(t.createElement("div")),p=(ru.exec(o)||["",""])[1].toLowerCase(),a=s[p]||s._default,h.innerHTML=a[1]+o.replace(iu,"<$1><\/$2>")+a[2],c=a[0];c--;)h=h.lastChild;if(!r.leadingWhitespace&&hi.test(o)&&l.push(t.createTextNode(hi.exec(o)[0])),!r.tbody)for(o="table"!==p||uu.test(o)?"<table>"!==a[1]||uu.test(o)?0:h:h.firstChild,c=o&&o.childNodes.length;c--;)i.nodeName(w=o.childNodes[c],"tbody")&&!w.childNodes.length&&o.removeChild(w);for(i.merge(l,h.childNodes),h.textContent="";h.firstChild;)h.removeChild(h.firstChild);h=v.lastChild}else l.push(t.createTextNode(o));for(h&&v.removeChild(h),r.appendChecked||i.grep(f(l,"input"),be),y=0;o=l[y++];)if((!e||-1===i.inArray(o,e))&&(b=i.contains(o.ownerDocument,o),h=f(v.appendChild(o),"script"),b&&li(h),u))for(c=0;o=h[c++];)fu.test(o.type||"")&&u.push(o);return h=null,v},cleanData:function(n,t){for(var u,e,f,s,a=0,h=i.expando,l=i.cache,v=r.deleteExpando,y=i.event.special;null!=(u=n[a]);a++)if((t||i.acceptData(u))&&(f=u[h],s=f&&l[f])){if(s.events)for(e in s.events)y[e]?i.event.remove(u,e):i.removeEvent(u,e,s.handle);l[f]&&(delete l[f],v?delete u[h]:typeof u.removeAttribute!==o?u.removeAttribute(h):u[h]=null,c.push(f))}}});i.fn.extend({text:function(n){return b(this,function(n){return void 0===n?i.text(this):this.empty().append((this[0]&&this[0].ownerDocument||u).createTextNode(n))},null,n,arguments.length)},append:function(){return this.domManip(arguments,function(n){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=eu(this,n);t.appendChild(n)}})},prepend:function(){return this.domManip(arguments,function(n){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=eu(this,n);t.insertBefore(n,t.firstChild)}})},before:function(){return this.domManip(arguments,function(n){this.parentNode&&this.parentNode.insertBefore(n,this)})},after:function(){return this.domManip(arguments,function(n){this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling)})},remove:function(n,t){for(var r,e=n?i.filter(n,this):this,u=0;null!=(r=e[u]);u++)t||1!==r.nodeType||i.cleanData(f(r)),r.parentNode&&(t&&i.contains(r.ownerDocument,r)&&li(f(r,"script")),r.parentNode.removeChild(r));return this},empty:function(){for(var n,t=0;null!=(n=this[t]);t++){for(1===n.nodeType&&i.cleanData(f(n,!1));n.firstChild;)n.removeChild(n.firstChild);n.options&&i.nodeName(n,"select")&&(n.options.length=0)}return this},clone:function(n,t){return n=null==n?!1:n,t=null==t?n:t,this.map(function(){return i.clone(this,n,t)})},html:function(n){return b(this,function(n){var t=this[0]||{},u=0,e=this.length;if(void 0===n)return 1===t.nodeType?t.innerHTML.replace(ce,""):void 0;if(!("string"!=typeof n||ae.test(n)||!r.htmlSerialize&&tu.test(n)||!r.leadingWhitespace&&hi.test(n)||s[(ru.exec(n)||["",""])[1].toLowerCase()])){n=n.replace(iu,"<$1><\/$2>");try{for(;e>u;u++)t=this[u]||{},1===t.nodeType&&(i.cleanData(f(t,!1)),t.innerHTML=n);t=0}catch(o){}}t&&this.empty().append(n)},null,n,arguments.length)},replaceWith:function(){var n=arguments[0];return this.domManip(arguments,function(t){n=this.parentNode;i.cleanData(f(this));n&&n.replaceChild(t,this)}),n&&(n.length||n.nodeType)?this:this.remove()},detach:function(n){return this.remove(n,!0)},domManip:function(n,t){n=ir.apply([],n);var h,u,c,o,v,s,e=0,l=this.length,p=this,w=l-1,a=n[0],y=i.isFunction(a);if(y||l>1&&"string"==typeof a&&!r.checkClone&&ve.test(a))return this.each(function(i){var r=p.eq(i);y&&(n[0]=a.call(this,i,r.html()));r.domManip(n,t)});if(l&&(s=i.buildFragment(n,this[0].ownerDocument,!1,this),h=s.firstChild,1===s.childNodes.length&&(s=h),h)){for(o=i.map(f(s,"script"),ou),c=o.length;l>e;e++)u=s,e!==w&&(u=i.clone(u,!0,!0),c&&i.merge(o,f(u,"script"))),t.call(this[e],u,e);if(c)for(v=o[o.length-1].ownerDocument,i.map(o,su),e=0;c>e;e++)u=o[e],fu.test(u.type||"")&&!i._data(u,"globalEval")&&i.contains(v,u)&&(u.src?i._evalUrl&&i._evalUrl(u.src):i.globalEval((u.text||u.textContent||u.innerHTML||"").replace(pe,"")));s=h=null}return this}});i.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(n,t){i.fn[n]=function(n){for(var u,r=0,f=[],e=i(n),o=e.length-1;o>=r;r++)u=r===o?this:this.clone(!0),i(e[r])[t](u),ti.apply(f,u.get());return this.pushStack(f)}});ai={};!function(){var t,i,n=u.createElement("div"),f="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;padding:0;margin:0;border:0";n.innerHTML="  <link/><table><\/table><a href='/a'>a<\/a><input type='checkbox'/>";t=n.getElementsByTagName("a")[0];t.style.cssText="float:left;opacity:.5";r.opacity=/^0.5/.test(t.style.opacity);r.cssFloat=!!t.style.cssFloat;n.style.backgroundClip="content-box";n.cloneNode(!0).style.backgroundClip="";r.clearCloneStyle="content-box"===n.style.backgroundClip;t=n=null;r.shrinkWrapBlocks=function(){var t,r,n,e;if(null==i){if(t=u.getElementsByTagName("body")[0],!t)return;e="border:0;width:0;height:0;position:absolute;top:0;left:-9999px";r=u.createElement("div");n=u.createElement("div");t.appendChild(r).appendChild(n);i=!1;typeof n.style.zoom!==o&&(n.style.cssText=f+";width:1px;padding:1px;zoom:1",n.innerHTML="<div><\/div>",n.firstChild.style.width="5px",i=3!==n.offsetWidth);t.removeChild(r);t=r=n=null}return i}}();var au=/^margin/,yt=new RegExp("^("+at+")(?!px)[a-z%]+$","i"),k,d,de=/^(top|right|bottom|left)$/;n.getComputedStyle?(k=function(n){return n.ownerDocument.defaultView.getComputedStyle(n,null)},d=function(n,t,r){var e,o,s,u,f=n.style;return r=r||k(n),u=r?r.getPropertyValue(t)||r[t]:void 0,r&&(""!==u||i.contains(n.ownerDocument,n)||(u=i.style(n,t)),yt.test(u)&&au.test(t)&&(e=f.width,o=f.minWidth,s=f.maxWidth,f.minWidth=f.maxWidth=f.width=u,u=r.width,f.width=e,f.minWidth=o,f.maxWidth=s)),void 0===u?u:u+""}):u.documentElement.currentStyle&&(k=function(n){return n.currentStyle},d=function(n,t,i){var o,f,e,r,u=n.style;return i=i||k(n),r=i?i[t]:void 0,null==r&&u&&u[t]&&(r=u[t]),yt.test(r)&&!de.test(t)&&(o=u.left,f=n.runtimeStyle,e=f&&f.left,e&&(f.left=n.currentStyle.left),u.left="fontSize"===t?"1em":r,r=u.pixelLeft+"px",u.left=o,e&&(f.left=e)),void 0===r?r:r+""||"auto"});!function(){function a(){var f,t,r=u.getElementsByTagName("body")[0];r&&(f=u.createElement("div"),t=u.createElement("div"),f.style.cssText=l,r.appendChild(f).appendChild(t),t.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;display:block;padding:1px;border:1px;width:4px;margin-top:1%;top:1%",i.swap(r,null!=r.style.zoom?{zoom:1}:{},function(){c=4===t.offsetWidth}),o=!0,s=!1,h=!0,n.getComputedStyle&&(s="1%"!==(n.getComputedStyle(t,null)||{}).top,o="4px"===(n.getComputedStyle(t,null)||{width:"4px"}).width),r.removeChild(f),t=r=null)}var f,e,c,o,s,h,t=u.createElement("div"),l="border:0;width:0;height:0;position:absolute;top:0;left:-9999px",v="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;padding:0;margin:0;border:0";t.innerHTML="  <link/><table><\/table><a href='/a'>a<\/a><input type='checkbox'/>";f=t.getElementsByTagName("a")[0];f.style.cssText="float:left;opacity:.5";r.opacity=/^0.5/.test(f.style.opacity);r.cssFloat=!!f.style.cssFloat;t.style.backgroundClip="content-box";t.cloneNode(!0).style.backgroundClip="";r.clearCloneStyle="content-box"===t.style.backgroundClip;f=t=null;i.extend(r,{reliableHiddenOffsets:function(){if(null!=e)return e;var i,n,f,t=u.createElement("div"),r=u.getElementsByTagName("body")[0];if(r)return t.setAttribute("className","t"),t.innerHTML="  <link/><table><\/table><a href='/a'>a<\/a><input type='checkbox'/>",i=u.createElement("div"),i.style.cssText=l,r.appendChild(i).appendChild(t),t.innerHTML="<table><tr><td><\/td><td>t<\/td><\/tr><\/table>",n=t.getElementsByTagName("td"),n[0].style.cssText="padding:0;margin:0;border:0;display:none",f=0===n[0].offsetHeight,n[0].style.display="",n[1].style.display="none",e=f&&0===n[0].offsetHeight,r.removeChild(i),t=r=null,e},boxSizing:function(){return null==c&&a(),c},boxSizingReliable:function(){return null==o&&a(),o},pixelPosition:function(){return null==s&&a(),s},reliableMarginRight:function(){var r,f,t,i;if(null==h&&n.getComputedStyle){if(r=u.getElementsByTagName("body")[0],!r)return;f=u.createElement("div");t=u.createElement("div");f.style.cssText=l;r.appendChild(f).appendChild(t);i=t.appendChild(u.createElement("div"));i.style.cssText=t.style.cssText=v;i.style.marginRight=i.style.width="0";t.style.width="1px";h=!parseFloat((n.getComputedStyle(i,null)||{}).marginRight);r.removeChild(f)}return h}})}();i.swap=function(n,t,i,r){var f,u,e={};for(u in t)e[u]=n.style[u],n.style[u]=t[u];f=i.apply(n,r||[]);for(u in t)n.style[u]=e[u];return f};var vi=/alpha\([^)]*\)/i,ge=/opacity\s*=\s*([^)]*)/,no=/^(none|table(?!-c[ea]).+)/,to=new RegExp("^("+at+")(.*)$","i"),io=new RegExp("^([+-])=("+at+")","i"),ro={position:"absolute",visibility:"hidden",display:"block"},yu={letterSpacing:0,fontWeight:400},pu=["Webkit","O","Moz","ms"];i.extend({cssHooks:{opacity:{get:function(n,t){if(t){var i=d(n,"opacity");return""===i?"1":i}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:r.cssFloat?"cssFloat":"styleFloat"},style:function(n,t,u,f){if(n&&3!==n.nodeType&&8!==n.nodeType&&n.style){var o,c,e,s=i.camelCase(t),h=n.style;if(t=i.cssProps[s]||(i.cssProps[s]=wu(h,s)),e=i.cssHooks[t]||i.cssHooks[s],void 0===u)return e&&"get"in e&&void 0!==(o=e.get(n,!1,f))?o:h[t];if(c=typeof u,"string"===c&&(o=io.exec(u))&&(u=(o[1]+1)*o[2]+parseFloat(i.css(n,t)),c="number"),null!=u&&u===u&&("number"!==c||i.cssNumber[s]||(u+="px"),r.clearCloneStyle||""!==u||0!==t.indexOf("background")||(h[t]="inherit"),!(e&&"set"in e&&void 0===(u=e.set(n,u,f)))))try{h[t]="";h[t]=u}catch(l){}}},css:function(n,t,r,u){var s,f,e,o=i.camelCase(t);return t=i.cssProps[o]||(i.cssProps[o]=wu(n.style,o)),e=i.cssHooks[t]||i.cssHooks[o],e&&"get"in e&&(f=e.get(n,!0,r)),void 0===f&&(f=d(n,t,u)),"normal"===f&&t in yu&&(f=yu[t]),""===r||r?(s=parseFloat(f),r===!0||i.isNumeric(s)?s||0:f):f}});i.each(["height","width"],function(n,t){i.cssHooks[t]={get:function(n,r,u){if(r)return 0===n.offsetWidth&&no.test(i.css(n,"display"))?i.swap(n,ro,function(){return gu(n,t,u)}):gu(n,t,u)},set:function(n,u,f){var e=f&&k(n);return ku(n,u,f?du(n,t,f,r.boxSizing()&&"border-box"===i.css(n,"boxSizing",!1,e),e):0)}}});r.opacity||(i.cssHooks.opacity={get:function(n,t){return ge.test((t&&n.currentStyle?n.currentStyle.filter:n.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(n,t){var r=n.style,u=n.currentStyle,e=i.isNumeric(t)?"alpha(opacity="+100*t+")":"",f=u&&u.filter||r.filter||"";r.zoom=1;(t>=1||""===t)&&""===i.trim(f.replace(vi,""))&&r.removeAttribute&&(r.removeAttribute("filter"),""===t||u&&!u.filter)||(r.filter=vi.test(f)?f.replace(vi,e):f+" "+e)}});i.cssHooks.marginRight=vu(r.reliableMarginRight,function(n,t){if(t)return i.swap(n,{display:"inline-block"},d,[n,"marginRight"])});i.each({margin:"",padding:"",border:"Width"},function(n,t){i.cssHooks[n+t]={expand:function(i){for(var r=0,f={},u="string"==typeof i?i.split(" "):[i];4>r;r++)f[n+w[r]+t]=u[r]||u[r-2]||u[0];return f}};au.test(n)||(i.cssHooks[n+t].set=ku)});i.fn.extend({css:function(n,t){return b(this,function(n,t,r){var f,e,o={},u=0;if(i.isArray(t)){for(f=k(n),e=t.length;e>u;u++)o[t[u]]=i.css(n,t[u],!1,f);return o}return void 0!==r?i.style(n,t,r):i.css(n,t)},n,t,arguments.length>1)},show:function(){return bu(this,!0)},hide:function(){return bu(this)},toggle:function(n){return"boolean"==typeof n?n?this.show():this.hide():this.each(function(){et(this)?i(this).show():i(this).hide()})}});i.Tween=e;e.prototype={constructor:e,init:function(n,t,r,u,f,e){this.elem=n;this.prop=r;this.easing=f||"swing";this.options=t;this.start=this.now=this.cur();this.end=u;this.unit=e||(i.cssNumber[r]?"":"px")},cur:function(){var n=e.propHooks[this.prop];return n&&n.get?n.get(this):e.propHooks._default.get(this)},run:function(n){var r,t=e.propHooks[this.prop];return this.pos=r=this.options.duration?i.easing[this.easing](n,this.options.duration*n,0,1,this.options.duration):n,this.now=(this.end-this.start)*r+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),t&&t.set?t.set(this):e.propHooks._default.set(this),this}};e.prototype.init.prototype=e.prototype;e.propHooks={_default:{get:function(n){var t;return null==n.elem[n.prop]||n.elem.style&&null!=n.elem.style[n.prop]?(t=i.css(n.elem,n.prop,""),t&&"auto"!==t?t:0):n.elem[n.prop]},set:function(n){i.fx.step[n.prop]?i.fx.step[n.prop](n):n.elem.style&&(null!=n.elem.style[i.cssProps[n.prop]]||i.cssHooks[n.prop])?i.style(n.elem,n.prop,n.now+n.unit):n.elem[n.prop]=n.now}}};e.propHooks.scrollTop=e.propHooks.scrollLeft={set:function(n){n.elem.nodeType&&n.elem.parentNode&&(n.elem[n.prop]=n.now)}};i.easing={linear:function(n){return n},swing:function(n){return.5-Math.cos(n*Math.PI)/2}};i.fx=e.prototype.init;i.fx.step={};var rt,pt,uo=/^(?:toggle|show|hide)$/,nf=new RegExp("^(?:([+-])=|)("+at+")([a-z%]*)$","i"),fo=/queueHooks$/,wt=[eo],st={"*":[function(n,t){var f=this.createTween(n,t),s=f.cur(),r=nf.exec(t),e=r&&r[3]||(i.cssNumber[n]?"":"px"),u=(i.cssNumber[n]||"px"!==e&&+s)&&nf.exec(i.css(f.elem,n)),o=1,h=20;if(u&&u[3]!==e){e=e||u[3];r=r||[];u=+s||1;do o=o||".5",u/=o,i.style(f.elem,n,u+e);while(o!==(o=f.cur()/s)&&1!==o&&--h)}return r&&(u=f.start=+u||+s||0,f.unit=e,f.end=r[1]?u+(r[1]+1)*r[2]:+r[2]),f}]};i.Animation=i.extend(uf,{tweener:function(n,t){i.isFunction(n)?(t=n,n=["*"]):n=n.split(" ");for(var r,u=0,f=n.length;f>u;u++)r=n[u],st[r]=st[r]||[],st[r].unshift(t)},prefilter:function(n,t){t?wt.unshift(n):wt.push(n)}});i.speed=function(n,t,r){var u=n&&"object"==typeof n?i.extend({},n):{complete:r||!r&&t||i.isFunction(n)&&n,duration:n,easing:r&&t||t&&!i.isFunction(t)&&t};return u.duration=i.fx.off?0:"number"==typeof u.duration?u.duration:u.duration in i.fx.speeds?i.fx.speeds[u.duration]:i.fx.speeds._default,(null==u.queue||u.queue===!0)&&(u.queue="fx"),u.old=u.complete,u.complete=function(){i.isFunction(u.old)&&u.old.call(this);u.queue&&i.dequeue(this,u.queue)},u};i.fn.extend({fadeTo:function(n,t,i,r){return this.filter(et).css("opacity",0).show().end().animate({opacity:t},n,i,r)},animate:function(n,t,r,u){var o=i.isEmptyObject(n),e=i.speed(t,r,u),f=function(){var t=uf(this,i.extend({},n),e);(o||i._data(this,"finish"))&&t.stop(!0)};return f.finish=f,o||e.queue===!1?this.each(f):this.queue(e.queue,f)},stop:function(n,t,r){var u=function(n){var t=n.stop;delete n.stop;t(r)};return"string"!=typeof n&&(r=t,t=n,n=void 0),t&&n!==!1&&this.queue(n||"fx",[]),this.each(function(){var o=!0,t=null!=n&&n+"queueHooks",e=i.timers,f=i._data(this);if(t)f[t]&&f[t].stop&&u(f[t]);else for(t in f)f[t]&&f[t].stop&&fo.test(t)&&u(f[t]);for(t=e.length;t--;)e[t].elem!==this||null!=n&&e[t].queue!==n||(e[t].anim.stop(r),o=!1,e.splice(t,1));(o||!r)&&i.dequeue(this,n)})},finish:function(n){return n!==!1&&(n=n||"fx"),this.each(function(){var t,f=i._data(this),r=f[n+"queue"],e=f[n+"queueHooks"],u=i.timers,o=r?r.length:0;for(f.finish=!0,i.queue(this,n,[]),e&&e.stop&&e.stop.call(this,!0),t=u.length;t--;)u[t].elem===this&&u[t].queue===n&&(u[t].anim.stop(!0),u.splice(t,1));for(t=0;o>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete f.finish})}});i.each(["toggle","show","hide"],function(n,t){var r=i.fn[t];i.fn[t]=function(n,i,u){return null==n||"boolean"==typeof n?r.apply(this,arguments):this.animate(bt(t,!0),n,i,u)}});i.each({slideDown:bt("show"),slideUp:bt("hide"),slideToggle:bt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(n,t){i.fn[n]=function(n,i,r){return this.animate(t,n,i,r)}});i.timers=[];i.fx.tick=function(){var r,n=i.timers,t=0;for(rt=i.now();t<n.length;t++)r=n[t],r()||n[t]!==r||n.splice(t--,1);n.length||i.fx.stop();rt=void 0};i.fx.timer=function(n){i.timers.push(n);n()?i.fx.start():i.timers.pop()};i.fx.interval=13;i.fx.start=function(){pt||(pt=setInterval(i.fx.tick,i.fx.interval))};i.fx.stop=function(){clearInterval(pt);pt=null};i.fx.speeds={slow:600,fast:200,_default:400};i.fn.delay=function(n,t){return n=i.fx?i.fx.speeds[n]||n:n,t=t||"fx",this.queue(t,function(t,i){var r=setTimeout(t,n);i.stop=function(){clearTimeout(r)}})},function(){var i,n,f,e,t=u.createElement("div");t.setAttribute("className","t");t.innerHTML="  <link/><table><\/table><a href='/a'>a<\/a><input type='checkbox'/>";i=t.getElementsByTagName("a")[0];f=u.createElement("select");e=f.appendChild(u.createElement("option"));n=t.getElementsByTagName("input")[0];i.style.cssText="top:1px";r.getSetAttribute="t"!==t.className;r.style=/top/.test(i.getAttribute("style"));r.hrefNormalized="/a"===i.getAttribute("href");r.checkOn=!!n.value;r.optSelected=e.selected;r.enctype=!!u.createElement("form").enctype;f.disabled=!0;r.optDisabled=!e.disabled;n=u.createElement("input");n.setAttribute("value","");r.input=""===n.getAttribute("value");n.value="t";n.setAttribute("type","radio");r.radioValue="t"===n.value;i=n=f=e=t=null}();ff=/\r/g;i.fn.extend({val:function(n){var t,r,f,u=this[0];return arguments.length?(f=i.isFunction(n),this.each(function(r){var u;1===this.nodeType&&(u=f?n.call(this,r,i(this).val()):n,null==u?u="":"number"==typeof u?u+="":i.isArray(u)&&(u=i.map(u,function(n){return null==n?"":n+""})),t=i.valHooks[this.type]||i.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,u,"value")||(this.value=u))})):u?(t=i.valHooks[u.type]||i.valHooks[u.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(r=t.get(u,"value"))?r:(r=u.value,"string"==typeof r?r.replace(ff,""):null==r?"":r)):void 0}});i.extend({valHooks:{option:{get:function(n){var t=i.find.attr(n,"value");return null!=t?t:i.text(n)}},select:{get:function(n){for(var o,t,s=n.options,u=n.selectedIndex,f="select-one"===n.type||0>u,h=f?null:[],c=f?u+1:s.length,e=0>u?c:f?u:0;c>e;e++)if(t=s[e],!(!t.selected&&e!==u||(r.optDisabled?t.disabled:null!==t.getAttribute("disabled"))||t.parentNode.disabled&&i.nodeName(t.parentNode,"optgroup"))){if(o=i(t).val(),f)return o;h.push(o)}return h},set:function(n,t){for(var f,r,u=n.options,o=i.makeArray(t),e=u.length;e--;)if(r=u[e],i.inArray(i.valHooks.option.get(r),o)>=0)try{r.selected=f=!0}catch(s){r.scrollHeight}else r.selected=!1;return f||(n.selectedIndex=-1),u}}}});i.each(["radio","checkbox"],function(){i.valHooks[this]={set:function(n,t){if(i.isArray(t))return n.checked=i.inArray(i(n).val(),t)>=0}};r.checkOn||(i.valHooks[this].get=function(n){return null===n.getAttribute("value")?"on":n.value})});var ut,ef,v=i.expr.attrHandle,yi=/^(?:checked|selected)$/i,g=r.getSetAttribute,kt=r.input;i.fn.extend({attr:function(n,t){return b(this,i.attr,n,t,arguments.length>1)},removeAttr:function(n){return this.each(function(){i.removeAttr(this,n)})}});i.extend({attr:function(n,t,r){var u,f,e=n.nodeType;if(n&&3!==e&&8!==e&&2!==e)return typeof n.getAttribute===o?i.prop(n,t,r):(1===e&&i.isXMLDoc(n)||(t=t.toLowerCase(),u=i.attrHooks[t]||(i.expr.match.bool.test(t)?ef:ut)),void 0===r?u&&"get"in u&&null!==(f=u.get(n,t))?f:(f=i.find.attr(n,t),null==f?void 0:f):null!==r?u&&"set"in u&&void 0!==(f=u.set(n,r,t))?f:(n.setAttribute(t,r+""),r):void i.removeAttr(n,t))},removeAttr:function(n,t){var r,u,e=0,f=t&&t.match(h);if(f&&1===n.nodeType)while(r=f[e++])u=i.propFix[r]||r,i.expr.match.bool.test(r)?kt&&g||!yi.test(r)?n[u]=!1:n[i.camelCase("default-"+r)]=n[u]=!1:i.attr(n,r,""),n.removeAttribute(g?r:u)},attrHooks:{type:{set:function(n,t){if(!r.radioValue&&"radio"===t&&i.nodeName(n,"input")){var u=n.value;return n.setAttribute("type",t),u&&(n.value=u),t}}}}});ef={set:function(n,t,r){return t===!1?i.removeAttr(n,r):kt&&g||!yi.test(r)?n.setAttribute(!g&&i.propFix[r]||r,r):n[i.camelCase("default-"+r)]=n[r]=!0,r}};i.each(i.expr.match.bool.source.match(/\w+/g),function(n,t){var r=v[t]||i.find.attr;v[t]=kt&&g||!yi.test(t)?function(n,t,i){var u,f;return i||(f=v[t],v[t]=u,u=null!=r(n,t,i)?t.toLowerCase():null,v[t]=f),u}:function(n,t,r){if(!r)return n[i.camelCase("default-"+t)]?t.toLowerCase():null}});kt&&g||(i.attrHooks.value={set:function(n,t,r){return i.nodeName(n,"input")?void(n.defaultValue=t):ut&&ut.set(n,t,r)}});g||(ut={set:function(n,t,i){var r=n.getAttributeNode(i);return r||n.setAttributeNode(r=n.ownerDocument.createAttribute(i)),r.value=t+="","value"===i||t===n.getAttribute(i)?t:void 0}},v.id=v.name=v.coords=function(n,t,i){var r;if(!i)return(r=n.getAttributeNode(t))&&""!==r.value?r.value:null},i.valHooks.button={get:function(n,t){var i=n.getAttributeNode(t);if(i&&i.specified)return i.value},set:ut.set},i.attrHooks.contenteditable={set:function(n,t,i){ut.set(n,""===t?!1:t,i)}},i.each(["width","height"],function(n,t){i.attrHooks[t]={set:function(n,i){if(""===i)return(n.setAttribute(t,"auto"),i)}}}));r.style||(i.attrHooks.style={get:function(n){return n.style.cssText||void 0},set:function(n,t){return n.style.cssText=t+""}});of=/^(?:input|select|textarea|button|object)$/i;sf=/^(?:a|area)$/i;i.fn.extend({prop:function(n,t){return b(this,i.prop,n,t,arguments.length>1)},removeProp:function(n){return n=i.propFix[n]||n,this.each(function(){try{this[n]=void 0;delete this[n]}catch(t){}})}});i.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(n,t,r){var f,u,o,e=n.nodeType;if(n&&3!==e&&8!==e&&2!==e)return o=1!==e||!i.isXMLDoc(n),o&&(t=i.propFix[t]||t,u=i.propHooks[t]),void 0!==r?u&&"set"in u&&void 0!==(f=u.set(n,r,t))?f:n[t]=r:u&&"get"in u&&null!==(f=u.get(n,t))?f:n[t]},propHooks:{tabIndex:{get:function(n){var t=i.find.attr(n,"tabindex");return t?parseInt(t,10):of.test(n.nodeName)||sf.test(n.nodeName)&&n.href?0:-1}}}});r.hrefNormalized||i.each(["href","src"],function(n,t){i.propHooks[t]={get:function(n){return n.getAttribute(t,4)}}});r.optSelected||(i.propHooks.selected={get:function(n){var t=n.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}});i.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){i.propFix[this.toLowerCase()]=this});r.enctype||(i.propFix.enctype="encoding");dt=/[\t\r\n\f]/g;i.fn.extend({addClass:function(n){var o,t,r,u,s,f,e=0,c=this.length,l="string"==typeof n&&n;if(i.isFunction(n))return this.each(function(t){i(this).addClass(n.call(this,t,this.className))});if(l)for(o=(n||"").match(h)||[];c>e;e++)if(t=this[e],r=1===t.nodeType&&(t.className?(" "+t.className+" ").replace(dt," "):" ")){for(s=0;u=o[s++];)r.indexOf(" "+u+" ")<0&&(r+=u+" ");f=i.trim(r);t.className!==f&&(t.className=f)}return this},removeClass:function(n){var o,t,r,u,s,f,e=0,c=this.length,l=0===arguments.length||"string"==typeof n&&n;if(i.isFunction(n))return this.each(function(t){i(this).removeClass(n.call(this,t,this.className))});if(l)for(o=(n||"").match(h)||[];c>e;e++)if(t=this[e],r=1===t.nodeType&&(t.className?(" "+t.className+" ").replace(dt," "):"")){for(s=0;u=o[s++];)while(r.indexOf(" "+u+" ")>=0)r=r.replace(" "+u+" "," ");f=n?i.trim(r):"";t.className!==f&&(t.className=f)}return this},toggleClass:function(n,t){var r=typeof n;return"boolean"==typeof t&&"string"===r?t?this.addClass(n):this.removeClass(n):this.each(i.isFunction(n)?function(r){i(this).toggleClass(n.call(this,r,this.className,t),t)}:function(){if("string"===r)for(var t,f=0,u=i(this),e=n.match(h)||[];t=e[f++];)u.hasClass(t)?u.removeClass(t):u.addClass(t);else(r===o||"boolean"===r)&&(this.className&&i._data(this,"__className__",this.className),this.className=this.className||n===!1?"":i._data(this,"__className__")||"")})},hasClass:function(n){for(var i=" "+n+" ",t=0,r=this.length;r>t;t++)if(1===this[t].nodeType&&(" "+this[t].className+" ").replace(dt," ").indexOf(i)>=0)return!0;return!1}});i.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(n,t){i.fn[t]=function(n,i){return arguments.length>0?this.on(t,null,n,i):this.trigger(t)}});i.fn.extend({hover:function(n,t){return this.mouseenter(n).mouseleave(t||n)},bind:function(n,t,i){return this.on(n,null,t,i)},unbind:function(n,t){return this.off(n,null,t)},delegate:function(n,t,i,r){return this.on(t,n,i,r)},undelegate:function(n,t,i){return 1===arguments.length?this.off(n,"**"):this.off(t,n||"**",i)}});var pi=i.now(),wi=/\?/,so=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;i.parseJSON=function(t){if(n.JSON&&n.JSON.parse)return n.JSON.parse(t+"");var f,r=null,u=i.trim(t+"");return u&&!i.trim(u.replace(so,function(n,t,i,u){return f&&t&&(r=0),0===r?n:(f=i||t,r+=!u-!i,"")}))?Function("return "+u)():i.error("Invalid JSON: "+t)};i.parseXML=function(t){var r,u;if(!t||"string"!=typeof t)return null;try{n.DOMParser?(u=new DOMParser,r=u.parseFromString(t,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(t))}catch(f){r=void 0}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||i.error("Invalid XML: "+t),r};var nt,y,ho=/#.*$/,hf=/([?&])_=[^&]*/,co=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,lo=/^(?:GET|HEAD)$/,ao=/^\/\//,cf=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,lf={},bi={},af="*/".concat("*");try{y=location.href}catch(ts){y=u.createElement("a");y.href="";y=y.href}nt=cf.exec(y.toLowerCase())||[];i.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:y,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(nt[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":af,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":i.parseJSON,"text xml":i.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(n,t){return t?ki(ki(n,i.ajaxSettings),t):ki(i.ajaxSettings,n)},ajaxPrefilter:vf(lf),ajaxTransport:vf(bi),ajax:function(n,t){function w(n,t,s,h){var v,it,nt,y,w,c=t;2!==e&&(e=2,k&&clearTimeout(k),a=void 0,b=h||"",u.readyState=n>0?4:0,v=n>=200&&300>n||304===n,s&&(y=vo(r,u,s)),y=yo(r,y,u,v),v?(r.ifModified&&(w=u.getResponseHeader("Last-Modified"),w&&(i.lastModified[f]=w),w=u.getResponseHeader("etag"),w&&(i.etag[f]=w)),204===n||"HEAD"===r.type?c="nocontent":304===n?c="notmodified":(c=y.state,it=y.data,nt=y.error,v=!nt)):(nt=c,(n||!c)&&(c="error",0>n&&(n=0))),u.status=n,u.statusText=(t||c)+"",v?g.resolveWith(o,[it,c,u]):g.rejectWith(o,[u,c,nt]),u.statusCode(p),p=void 0,l&&d.trigger(v?"ajaxSuccess":"ajaxError",[u,r,v?it:nt]),tt.fireWith(o,[u,c]),l&&(d.trigger("ajaxComplete",[u,r]),--i.active||i.event.trigger("ajaxStop")))}"object"==typeof n&&(t=n,n=void 0);t=t||{};var s,c,f,b,k,l,a,v,r=i.ajaxSetup({},t),o=r.context||r,d=r.context&&(o.nodeType||o.jquery)?i(o):i.event,g=i.Deferred(),tt=i.Callbacks("once memory"),p=r.statusCode||{},it={},rt={},e=0,ut="canceled",u={readyState:0,getResponseHeader:function(n){var t;if(2===e){if(!v)for(v={};t=co.exec(b);)v[t[1].toLowerCase()]=t[2];t=v[n.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===e?b:null},setRequestHeader:function(n,t){var i=n.toLowerCase();return e||(n=rt[i]=rt[i]||n,it[n]=t),this},overrideMimeType:function(n){return e||(r.mimeType=n),this},statusCode:function(n){var t;if(n)if(2>e)for(t in n)p[t]=[p[t],n[t]];else u.always(n[u.status]);return this},abort:function(n){var t=n||ut;return a&&a.abort(t),w(0,t),this}};if(g.promise(u).complete=tt.add,u.success=u.done,u.error=u.fail,r.url=((n||r.url||y)+"").replace(ho,"").replace(ao,nt[1]+"//"),r.type=t.method||t.type||r.method||r.type,r.dataTypes=i.trim(r.dataType||"*").toLowerCase().match(h)||[""],null==r.crossDomain&&(s=cf.exec(r.url.toLowerCase()),r.crossDomain=!(!s||s[1]===nt[1]&&s[2]===nt[2]&&(s[3]||("http:"===s[1]?"80":"443"))===(nt[3]||("http:"===nt[1]?"80":"443")))),r.data&&r.processData&&"string"!=typeof r.data&&(r.data=i.param(r.data,r.traditional)),yf(lf,r,t,u),2===e)return u;l=r.global;l&&0==i.active++&&i.event.trigger("ajaxStart");r.type=r.type.toUpperCase();r.hasContent=!lo.test(r.type);f=r.url;r.hasContent||(r.data&&(f=r.url+=(wi.test(f)?"&":"?")+r.data,delete r.data),r.cache===!1&&(r.url=hf.test(f)?f.replace(hf,"$1_="+pi++):f+(wi.test(f)?"&":"?")+"_="+pi++));r.ifModified&&(i.lastModified[f]&&u.setRequestHeader("If-Modified-Since",i.lastModified[f]),i.etag[f]&&u.setRequestHeader("If-None-Match",i.etag[f]));(r.data&&r.hasContent&&r.contentType!==!1||t.contentType)&&u.setRequestHeader("Content-Type",r.contentType);u.setRequestHeader("Accept",r.dataTypes[0]&&r.accepts[r.dataTypes[0]]?r.accepts[r.dataTypes[0]]+("*"!==r.dataTypes[0]?", "+af+"; q=0.01":""):r.accepts["*"]);for(c in r.headers)u.setRequestHeader(c,r.headers[c]);if(r.beforeSend&&(r.beforeSend.call(o,u,r)===!1||2===e))return u.abort();ut="abort";for(c in{success:1,error:1,complete:1})u[c](r[c]);if(a=yf(bi,r,t,u)){u.readyState=1;l&&d.trigger("ajaxSend",[u,r]);r.async&&r.timeout>0&&(k=setTimeout(function(){u.abort("timeout")},r.timeout));try{e=1;a.send(it,w)}catch(ft){if(!(2>e))throw ft;w(-1,ft)}}else w(-1,"No Transport");return u},getJSON:function(n,t,r){return i.get(n,t,r,"json")},getScript:function(n,t){return i.get(n,void 0,t,"script")}});i.each(["get","post"],function(n,t){i[t]=function(n,r,u,f){return i.isFunction(r)&&(f=f||u,u=r,r=void 0),i.ajax({url:n,type:t,dataType:f,data:r,success:u})}});i.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(n,t){i.fn[t]=function(n){return this.on(t,n)}});i._evalUrl=function(n){return i.ajax({url:n,type:"GET",dataType:"script",async:!1,global:!1,throws:!0})};i.fn.extend({wrapAll:function(n){if(i.isFunction(n))return this.each(function(t){i(this).wrapAll(n.call(this,t))});if(this[0]){var t=i(n,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]);t.map(function(){for(var n=this;n.firstChild&&1===n.firstChild.nodeType;)n=n.firstChild;return n}).append(this)}return this},wrapInner:function(n){return this.each(i.isFunction(n)?function(t){i(this).wrapInner(n.call(this,t))}:function(){var t=i(this),r=t.contents();r.length?r.wrapAll(n):t.append(n)})},wrap:function(n){var t=i.isFunction(n);return this.each(function(r){i(this).wrapAll(t?n.call(this,r):n)})},unwrap:function(){return this.parent().each(function(){i.nodeName(this,"body")||i(this).replaceWith(this.childNodes)}).end()}});i.expr.filters.hidden=function(n){return n.offsetWidth<=0&&n.offsetHeight<=0||!r.reliableHiddenOffsets()&&"none"===(n.style&&n.style.display||i.css(n,"display"))};i.expr.filters.visible=function(n){return!i.expr.filters.hidden(n)};var po=/%20/g,wo=/\[\]$/,pf=/\r?\n/g,bo=/^(?:submit|button|image|reset|file)$/i,ko=/^(?:input|select|textarea|keygen)/i;i.param=function(n,t){var r,u=[],f=function(n,t){t=i.isFunction(t)?t():null==t?"":t;u[u.length]=encodeURIComponent(n)+"="+encodeURIComponent(t)};if(void 0===t&&(t=i.ajaxSettings&&i.ajaxSettings.traditional),i.isArray(n)||n.jquery&&!i.isPlainObject(n))i.each(n,function(){f(this.name,this.value)});else for(r in n)di(r,n[r],t,f);return u.join("&").replace(po,"+")};i.fn.extend({serialize:function(){return i.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var n=i.prop(this,"elements");return n?i.makeArray(n):this}).filter(function(){var n=this.type;return this.name&&!i(this).is(":disabled")&&ko.test(this.nodeName)&&!bo.test(n)&&(this.checked||!oi.test(n))}).map(function(n,t){var r=i(this).val();return null==r?null:i.isArray(r)?i.map(r,function(n){return{name:t.name,value:n.replace(pf,"\r\n")}}):{name:t.name,value:r.replace(pf,"\r\n")}}).get()}});i.ajaxSettings.xhr=void 0!==n.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&wf()||ns()}:wf;var go=0,gt={},ht=i.ajaxSettings.xhr();return n.ActiveXObject&&i(n).on("unload",function(){for(var n in gt)gt[n](void 0,!0)}),r.cors=!!ht&&"withCredentials"in ht,ht=r.ajax=!!ht,ht&&i.ajaxTransport(function(n){if(!n.crossDomain||r.cors){var t;return{send:function(r,u){var e,f=n.xhr(),o=++go;if(f.open(n.type,n.url,n.async,n.username,n.password),n.xhrFields)for(e in n.xhrFields)f[e]=n.xhrFields[e];n.mimeType&&f.overrideMimeType&&f.overrideMimeType(n.mimeType);n.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest");for(e in r)void 0!==r[e]&&f.setRequestHeader(e,r[e]+"");f.send(n.hasContent&&n.data||null);t=function(r,e){var s,c,h;if(t&&(e||4===f.readyState))if(delete gt[o],t=void 0,f.onreadystatechange=i.noop,e)4!==f.readyState&&f.abort();else{h={};s=f.status;"string"==typeof f.responseText&&(h.text=f.responseText);try{c=f.statusText}catch(l){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=h.text?200:404}h&&u(s,c,h,f.getAllResponseHeaders())};n.async?4===f.readyState?setTimeout(t):f.onreadystatechange=gt[o]=t:t()},abort:function(){t&&t(void 0,!0)}}}}),i.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(n){return i.globalEval(n),n}}}),i.ajaxPrefilter("script",function(n){void 0===n.cache&&(n.cache=!1);n.crossDomain&&(n.type="GET",n.global=!1)}),i.ajaxTransport("script",function(n){if(n.crossDomain){var t,r=u.head||i("head")[0]||u.documentElement;return{send:function(i,f){t=u.createElement("script");t.async=!0;n.scriptCharset&&(t.charset=n.scriptCharset);t.src=n.url;t.onload=t.onreadystatechange=function(n,i){(i||!t.readyState||/loaded|complete/.test(t.readyState))&&(t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),t=null,i||f(200,"success"))};r.insertBefore(t,r.firstChild)},abort:function(){t&&t.onload(void 0,!0)}}}}),gi=[],ni=/(=)\?(?=&|$)|\?\?/,i.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var n=gi.pop()||i.expando+"_"+pi++;return this[n]=!0,n}}),i.ajaxPrefilter("json jsonp",function(t,r,u){var f,o,e,s=t.jsonp!==!1&&(ni.test(t.url)?"url":"string"==typeof t.data&&!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&ni.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return(f=t.jsonpCallback=i.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(ni,"$1"+f):t.jsonp!==!1&&(t.url+=(wi.test(t.url)?"&":"?")+t.jsonp+"="+f),t.converters["script json"]=function(){return e||i.error(f+" was not called"),e[0]},t.dataTypes[0]="json",o=n[f],n[f]=function(){e=arguments},u.always(function(){n[f]=o;t[f]&&(t.jsonpCallback=r.jsonpCallback,gi.push(f));e&&i.isFunction(o)&&o(e[0]);e=o=void 0}),"script")}),i.parseHTML=function(n,t,r){if(!n||"string"!=typeof n)return null;"boolean"==typeof t&&(r=t,t=!1);t=t||u;var f=er.exec(n),e=!r&&[];return f?[t.createElement(f[1])]:(f=i.buildFragment([n],t,e),e&&e.length&&i(e).remove(),i.merge([],f.childNodes))},nr=i.fn.load,i.fn.load=function(n,t,r){if("string"!=typeof n&&nr)return nr.apply(this,arguments);var u,o,s,f=this,e=n.indexOf(" ");return e>=0&&(u=n.slice(e,n.length),n=n.slice(0,e)),i.isFunction(t)?(r=t,t=void 0):t&&"object"==typeof t&&(s="POST"),f.length>0&&i.ajax({url:n,type:s,dataType:"html",data:t}).done(function(n){o=arguments;f.html(u?i("<div>").append(i.parseHTML(n)).find(u):n)}).complete(r&&function(n,t){f.each(r,o||[n.responseText,t,n])}),this},i.expr.filters.animated=function(n){return i.grep(i.timers,function(t){return n===t.elem}).length},tr=n.document.documentElement,i.offset={setOffset:function(n,t,r){var e,o,s,h,u,c,v,l=i.css(n,"position"),a=i(n),f={};"static"===l&&(n.style.position="relative");u=a.offset();s=i.css(n,"top");c=i.css(n,"left");v=("absolute"===l||"fixed"===l)&&i.inArray("auto",[s,c])>-1;v?(e=a.position(),h=e.top,o=e.left):(h=parseFloat(s)||0,o=parseFloat(c)||0);i.isFunction(t)&&(t=t.call(n,r,u));null!=t.top&&(f.top=t.top-u.top+h);null!=t.left&&(f.left=t.left-u.left+o);"using"in t?t.using.call(n,f):a.css(f)}},i.fn.extend({offset:function(n){if(arguments.length)return void 0===n?this:this.each(function(t){i.offset.setOffset(this,n,t)});var t,f,u={top:0,left:0},r=this[0],e=r&&r.ownerDocument;if(e)return t=e.documentElement,i.contains(t,r)?(typeof r.getBoundingClientRect!==o&&(u=r.getBoundingClientRect()),f=bf(e),{top:u.top+(f.pageYOffset||t.scrollTop)-(t.clientTop||0),left:u.left+(f.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}):u},position:function(){if(this[0]){var n,r,t={top:0,left:0},u=this[0];return"fixed"===i.css(u,"position")?r=u.getBoundingClientRect():(n=this.offsetParent(),r=this.offset(),i.nodeName(n[0],"html")||(t=n.offset()),t.top+=i.css(n[0],"borderTopWidth",!0),t.left+=i.css(n[0],"borderLeftWidth",!0)),{top:r.top-t.top-i.css(u,"marginTop",!0),left:r.left-t.left-i.css(u,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var n=this.offsetParent||tr;n&&!i.nodeName(n,"html")&&"static"===i.css(n,"position");)n=n.offsetParent;return n||tr})}}),i.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(n,t){var r=/Y/.test(t);i.fn[n]=function(u){return b(this,function(n,u,f){var e=bf(n);return void 0===f?e?t in e?e[t]:e.document.documentElement[u]:n[u]:void(e?e.scrollTo(r?i(e).scrollLeft():f,r?f:i(e).scrollTop()):n[u]=f)},n,u,arguments.length,null)}}),i.each(["top","left"],function(n,t){i.cssHooks[t]=vu(r.pixelPosition,function(n,r){if(r)return(r=d(n,t),yt.test(r)?i(n).position()[t]+"px":r)})}),i.each({Height:"height",Width:"width"},function(n,t){i.each({padding:"inner"+n,content:t,"":"outer"+n},function(r,u){i.fn[u]=function(u,f){var e=arguments.length&&(r||"boolean"!=typeof u),o=r||(u===!0||f===!0?"margin":"border");return b(this,function(t,r,u){var f;return i.isWindow(t)?t.document.documentElement["client"+n]:9===t.nodeType?(f=t.documentElement,Math.max(t.body["scroll"+n],f["scroll"+n],t.body["offset"+n],f["offset"+n],f["client"+n])):void 0===u?i.css(t,r,o):i.style(t,r,u,o)},t,e?u:void 0,e,null)}})}),i.fn.size=function(){return this.length},i.fn.andSelf=i.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return i}),kf=n.jQuery,df=n.$,i.noConflict=function(t){return n.$===i&&(n.$=df),t&&n.jQuery===i&&(n.jQuery=kf),i},typeof t===o&&(n.jQuery=n.$=i),i}),function(){(function(n){var i=this||eval("this"),r=i.document,f=i.navigator,t=i.jQuery,u=i.JSON;(function(n){"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?n(module.exports||exports,require):"function"==typeof define&&define.amd?define(["exports","require"],n):n(i.ko={})})(function(e,o){function y(n,t){return null===n||typeof n in b?n===t:!1}function k(t,i){var r;return function(){r||(r=setTimeout(function(){r=n;t()},i))}}function d(n,t){var i;return function(){clearTimeout(i);i=setTimeout(n,t)}}function p(n,t,i,r){s.d[n]={init:function(n,u,f,e,o){var c,h;return s.s(function(){var l=s.a.c(u()),f=!i!=!l,e=!h;(e||t||f!==c)&&(e&&s.Y.la()&&(h=s.a.ia(s.f.childNodes(n),!0)),f?(e||s.f.T(n,s.a.ia(h)),s.Ca(r?r(o,l):o,n)):s.f.ja(n),c=f)},null,{o:n}),{controlsDescendantBindings:!0}}};s.h.ha[n]=!1;s.f.Q[n]=!0}var s="undefined"!=typeof e?e:{},b,l,h,c,a,w,v;s.b=function(n,t){for(var i=n.split("."),r=s,u=0;u<i.length-1;u++)r=r[i[u]];r[i[i.length-1]]=t};s.A=function(n,t,i){n[t]=i};s.version="3.2.0";s.b("version",s.version);s.a=function(){function o(n,t){for(var i in n)n.hasOwnProperty(i)&&t(i,n[i])}function c(n,t){if(t)for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);return n}function l(n,t){return n.__proto__=t,n}var a={__proto__:[]}instanceof Array,h={},v={},y,e;return h[f&&/Firefox\/2/i.test(f.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],h.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),o(h,function(n,t){if(t.length)for(var i=0,r=t.length;i<r;i++)v[t[i]]=n}),y={propertychange:!0},e=r&&function(){for(var t=3,i=r.createElement("div"),u=i.getElementsByTagName("i");i.innerHTML="<!--[if gt IE "+ ++t+"]><i><\/i><![endif]-->",u[0];);return 4<t?t:n}(),{vb:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],u:function(n,t){for(var i=0,r=n.length;i<r;i++)t(n[i],i)},m:function(n,t){if("function"==typeof Array.prototype.indexOf)return Array.prototype.indexOf.call(n,t);for(var i=0,r=n.length;i<r;i++)if(n[i]===t)return i;return-1},qb:function(n,t,i){for(var r=0,u=n.length;r<u;r++)if(t.call(i,n[r],r))return n[r];return null},ua:function(n,t){var i=s.a.m(n,t);0<i?n.splice(i,1):0===i&&n.shift()},rb:function(n){n=n||[];for(var i=[],t=0,r=n.length;t<r;t++)0>s.a.m(i,n[t])&&i.push(n[t]);return i},Da:function(n,t){n=n||[];for(var r=[],i=0,u=n.length;i<u;i++)r.push(t(n[i],i));return r},ta:function(n,t){n=n||[];for(var r=[],i=0,u=n.length;i<u;i++)t(n[i],i)&&r.push(n[i]);return r},ga:function(n,t){if(t instanceof Array)n.push.apply(n,t);else for(var i=0,r=t.length;i<r;i++)n.push(t[i]);return n},ea:function(n,t,i){var r=s.a.m(s.a.Xa(n),t);0>r?i&&n.push(t):i||n.splice(r,1)},xa:a,extend:c,za:l,Aa:a?l:c,G:o,na:function(n,t){if(!n)return n;var r={},i;for(i in n)n.hasOwnProperty(i)&&(r[i]=t(n[i],i,n));return r},Ka:function(n){for(;n.firstChild;)s.removeNode(n.firstChild)},oc:function(n){n=s.a.S(n);for(var i=r.createElement("div"),t=0,u=n.length;t<u;t++)i.appendChild(s.R(n[t]));return i},ia:function(n,t){for(var r,i=0,f=n.length,u=[];i<f;i++)r=n[i].cloneNode(!0),u.push(t?s.R(r):r);return u},T:function(n,t){if(s.a.Ka(n),t)for(var i=0,r=t.length;i<r;i++)n.appendChild(t[i])},Lb:function(n,t){var r=n.nodeType?[n]:n;if(0<r.length){for(var f=r[0],e=f.parentNode,i=0,u=t.length;i<u;i++)e.insertBefore(t[i],f);for(i=0,u=r.length;i<u;i++)s.removeNode(r[i])}},ka:function(n,t){if(n.length){for(t=8===t.nodeType&&t.parentNode||t;n.length&&n[0].parentNode!==t;)n.shift();if(1<n.length){var i=n[0],r=n[n.length-1];for(n.length=0;i!==r;)if(n.push(i),i=i.nextSibling,!i)return;n.push(r)}}return n},Nb:function(n,t){7>e?n.setAttribute("selected",t):n.selected=t},cb:function(t){return null===t||t===n?"":t.trim?t.trim():t.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},vc:function(n,t){return n=n||"",t.length>n.length?!1:n.substring(0,t.length)===t},cc:function(n,t){if(n===t)return!0;if(11===n.nodeType)return!1;if(t.contains)return t.contains(3===n.nodeType?n.parentNode:n);if(t.compareDocumentPosition)return 16==(t.compareDocumentPosition(n)&16);for(;n&&n!=t;)n=n.parentNode;return!!n},Ja:function(n){return s.a.cc(n,n.ownerDocument.documentElement)},ob:function(n){return!!s.a.qb(n,s.a.Ja)},t:function(n){return n&&n.tagName&&n.tagName.toLowerCase()},n:function(n,i,r){var o=e&&y[i],u,f;if(!o&&t)t(n).bind(i,r);else if(o||"function"!=typeof n.addEventListener)if("undefined"!=typeof n.attachEvent)u=function(t){r.call(n,t)},f="on"+i,n.attachEvent(f,u),s.a.w.da(n,function(){n.detachEvent(f,u)});else throw Error("Browser doesn't support addEventListener or attachEvent");else n.addEventListener(i,r,!1)},oa:function(n,u){if(!n||!n.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var f;if("input"===s.a.t(n)&&n.type&&"click"==u.toLowerCase()?(f=n.type,f="checkbox"==f||"radio"==f):f=!1,t&&!f)t(n).trigger(u);else if("function"==typeof r.createEvent)if("function"==typeof n.dispatchEvent)f=r.createEvent(v[u]||"HTMLEvents"),f.initEvent(u,!0,!0,i,0,0,0,0,0,!1,!1,!1,!1,0,n),n.dispatchEvent(f);else throw Error("The supplied element doesn't support dispatchEvent");else if(f&&n.click)n.click();else if("undefined"!=typeof n.fireEvent)n.fireEvent("on"+u);else throw Error("Browser doesn't support triggering events");},c:function(n){return s.C(n)?n():n},Xa:function(n){return s.C(n)?n.v():n},Ba:function(n,t,i){if(t){var r=/\S+/g,u=n.className.match(r)||[];s.a.u(t.match(r),function(n){s.a.ea(u,n,i)});n.className=u.join(" ")}},bb:function(t,i){var r=s.a.c(i),u;(null===r||r===n)&&(r="");u=s.f.firstChild(t);!u||3!=u.nodeType||s.f.nextSibling(u)?s.f.T(t,[t.ownerDocument.createTextNode(r)]):u.data=r;s.a.fc(t)},Mb:function(n,t){if(n.name=t,7>=e)try{n.mergeAttributes(r.createElement("<input name='"+n.name+"'/>"),!1)}catch(i){}},fc:function(n){9<=e&&(n=1==n.nodeType?n:n.parentNode,n.style&&(n.style.zoom=n.style.zoom))},dc:function(n){if(e){var t=n.style.width;n.style.width=0;n.style.width=t}},sc:function(n,t){n=s.a.c(n);t=s.a.c(t);for(var r=[],i=n;i<=t;i++)r.push(i);return r},S:function(n){for(var i=[],t=0,r=n.length;t<r;t++)i.push(n[t]);return i},yc:6===e,zc:7===e,L:e,xb:function(n,t){for(var r=s.a.S(n.getElementsByTagName("input")).concat(s.a.S(n.getElementsByTagName("textarea"))),f="string"==typeof t?function(n){return n.name===t}:function(n){return t.test(n.name)},u=[],i=r.length-1;0<=i;i--)f(r[i])&&u.push(r[i]);return u},pc:function(n){return"string"==typeof n&&(n=s.a.cb(n))?u&&u.parse?u.parse(n):new Function("return "+n)():null},eb:function(n,t,i){if(!u||!u.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return u.stringify(s.a.c(n),t,i)},qc:function(n,t,i){var c,e,h,f,u,l;i=i||{};var a=i.params||{},v=i.includeFields||this.vb,c=n;if("object"==typeof n&&"form"===s.a.t(n))for(c=n.action,e=v.length-1;0<=e;e--)for(h=s.a.xb(n,v[e]),f=h.length-1;0<=f;f--)a[h[f].name]=h[f].value;t=s.a.c(t);u=r.createElement("form");u.style.display="none";u.action=c;u.method="post";for(l in t)n=r.createElement("input"),n.type="hidden",n.name=l,n.value=s.a.eb(s.a.c(t[l])),u.appendChild(n);o(a,function(n,t){var i=r.createElement("input");i.type="hidden";i.name=n;i.value=t;u.appendChild(i)});r.body.appendChild(u);i.submitter?i.submitter(u):u.submit();setTimeout(function(){u.parentNode.removeChild(u)},0)}}}();s.b("utils",s.a);s.b("utils.arrayForEach",s.a.u);s.b("utils.arrayFirst",s.a.qb);s.b("utils.arrayFilter",s.a.ta);s.b("utils.arrayGetDistinctValues",s.a.rb);s.b("utils.arrayIndexOf",s.a.m);s.b("utils.arrayMap",s.a.Da);s.b("utils.arrayPushAll",s.a.ga);s.b("utils.arrayRemoveItem",s.a.ua);s.b("utils.extend",s.a.extend);s.b("utils.fieldsIncludedWithJsonPost",s.a.vb);s.b("utils.getFormFields",s.a.xb);s.b("utils.peekObservable",s.a.Xa);s.b("utils.postJson",s.a.qc);s.b("utils.parseJson",s.a.pc);s.b("utils.registerEventHandler",s.a.n);s.b("utils.stringifyJson",s.a.eb);s.b("utils.range",s.a.sc);s.b("utils.toggleDomNodeCssClass",s.a.Ba);s.b("utils.triggerEvent",s.a.oa);s.b("utils.unwrapObservable",s.a.c);s.b("utils.objectForEach",s.a.G);s.b("utils.addOrRemoveItem",s.a.ea);s.b("unwrap",s.a.c);Function.prototype.bind||(Function.prototype.bind=function(n){var i=this,t=Array.prototype.slice.call(arguments);return n=t.shift(),function(){return i.apply(n,t.concat(Array.prototype.slice.call(arguments)))}});s.a.e=new function(){function r(r,f){var e=r[t];if(!e||"null"===e||!i[e]){if(!f)return n;e=r[t]="ko"+u++;i[e]={}}return i[e]}var u=0,t="__ko__"+(new Date).getTime(),i={};return{get:function(t,i){var u=r(t,!1);return u===n?n:u[i]},set:function(t,i,u){(u!==n||r(t,!1)!==n)&&(r(t,!0)[i]=u)},clear:function(n){var r=n[t];return r?(delete i[r],n[t]=null,!0):!1},F:function(){return u+++t}}};s.b("utils.domData",s.a.e);s.b("utils.domData.clear",s.a.e.clear);s.a.w=new function(){function i(t,i){var r=s.a.e.get(t,u);return r===n&&i&&(r=[],s.a.e.set(t,u,r)),r}function r(n){var t=i(n,!1),u;if(t)for(t=t.slice(0),u=0;u<t.length;u++)t[u](n);if(s.a.e.clear(n),s.a.w.cleanExternalData(n),f[n.nodeType])for(t=n.firstChild;n=t;)t=n.nextSibling,8===n.nodeType&&r(n)}var u=s.a.e.F(),e={1:!0,8:!0,9:!0},f={1:!0,9:!0};return{da:function(n,t){if("function"!=typeof t)throw Error("Callback must be a function");i(n,!0).push(t)},Kb:function(t,r){var f=i(t,!1);f&&(s.a.ua(f,r),0==f.length&&s.a.e.set(t,u,n))},R:function(n){var t,i,u;if(e[n.nodeType]&&(r(n),f[n.nodeType]))for(t=[],s.a.ga(t,n.getElementsByTagName("*")),i=0,u=t.length;i<u;i++)r(t[i]);return n},removeNode:function(n){s.R(n);n.parentNode&&n.parentNode.removeChild(n)},cleanExternalData:function(n){t&&"function"==typeof t.cleanData&&t.cleanData([n])}}};s.R=s.a.w.R;s.removeNode=s.a.w.removeNode;s.b("cleanNode",s.R);s.b("removeNode",s.removeNode);s.b("utils.domNodeDisposal",s.a.w);s.b("utils.domNodeDisposal.addDisposeCallback",s.a.w.da);s.b("utils.domNodeDisposal.removeDisposeCallback",s.a.w.Kb),function(){s.a.ba=function(n){var u,f;if(t){if(t.parseHTML)u=t.parseHTML(n)||[];else if((u=t.clean([n]))&&u[0]){for(n=u[0];n.parentNode&&11!==n.parentNode.nodeType;)n=n.parentNode;n.parentNode&&n.parentNode.removeChild(n)}}else{for(f=s.a.cb(n).toLowerCase(),u=r.createElement("div"),f=f.match(/^<(thead|tbody|tfoot)/)&&[1,"<table>","<\/table>"]||!f.indexOf("<tr")&&[2,"<table><tbody>","<\/tbody><\/table>"]||(!f.indexOf("<td")||!f.indexOf("<th"))&&[3,"<table><tbody><tr>","<\/tr><\/tbody><\/table>"]||[0,"",""],n="ignored<div>"+f[1]+n+f[2]+"<\/div>","function"==typeof i.innerShiv?u.appendChild(i.innerShiv(n)):u.innerHTML=n;f[0]--;)u=u.lastChild;u=s.a.S(u.lastChild.childNodes)}return u};s.a.$a=function(i,r){if(s.a.Ka(i),r=s.a.c(r),null!==r&&r!==n)if("string"!=typeof r&&(r=r.toString()),t)t(i).html(r);else for(var f=s.a.ba(r),u=0;u<f.length;u++)i.appendChild(f[u])}}();s.b("utils.parseHtmlFragment",s.a.ba);s.b("utils.setHtml",s.a.$a);s.D=function(){function i(n,t){var r;if(n)if(8==n.nodeType)r=s.D.Gb(n.nodeValue),null!=r&&t.push({bc:n,mc:r});else if(1==n.nodeType)for(var r=0,u=n.childNodes,f=u.length;r<f;r++)i(u[r],t)}var t={};return{Ua:function(n){if("function"!=typeof n)throw Error("You can only pass a function to ko.memoization.memoize()");var i=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return t[i]=n,"<!--[ko_memo:"+i+"]-->"},Rb:function(i,r){var u=t[i];if(u===n)throw Error("Couldn't find any memo with ID "+i+". Perhaps it's already been unmemoized.");try{return u.apply(null,r||[]),!0}finally{delete t[i]}},Sb:function(n,t){var f=[],u,o,r,e;for(i(n,f),u=0,o=f.length;u<o;u++)r=f[u].bc,e=[r],t&&s.a.ga(e,t),s.D.Rb(f[u].mc,e),r.nodeValue="",r.parentNode&&r.parentNode.removeChild(r)},Gb:function(n){return(n=n.match(/^\[ko_memo\:(.*?)\]$/))?n[1]:null}}}();s.b("memoization",s.D);s.b("memoization.memoize",s.D.Ua);s.b("memoization.unmemoize",s.D.Rb);s.b("memoization.parseMemoText",s.D.Gb);s.b("memoization.unmemoizeDomNodeAndDescendants",s.D.Sb);s.La={throttle:function(n,t){n.throttleEvaluation=t;var i=null;return s.j({read:n,write:function(r){clearTimeout(i);i=setTimeout(function(){n(r)},t)}})},rateLimit:function(n,t){var i,r,u;"number"==typeof t?i=t:(i=t.timeout,r=t.method);u="notifyWhenChangesStop"==r?d:k;n.Ta(function(n){return u(n,i)})},notify:function(n,t){n.equalityComparer="always"==t?null:y}};b={undefined:1,boolean:1,number:1,string:1};s.b("extenders",s.La);s.Pb=function(n,t,i){this.target=n;this.wa=t;this.ac=i;this.Cb=!1;s.A(this,"dispose",this.K)};s.Pb.prototype.K=function(){this.Cb=!0;this.ac()};s.P=function(){s.a.Aa(this,s.P.fn);this.M={}};l="change";h={U:function(n,t,i){var r=this,u;return i=i||l,u=new s.Pb(r,t?n.bind(t):n,function(){s.a.ua(r.M[i],u);r.nb&&r.nb()}),r.va&&r.va(i),r.M[i]||(r.M[i]=[]),r.M[i].push(u),u},notifySubscribers:function(n,t){if(t=t||l,this.Ab(t))try{s.k.Ea();for(var u=this.M[t].slice(0),r=0,i;i=u[r];++r)i.Cb||i.wa(n)}finally{s.k.end()}},Ta:function(n){var t=this,e=s.C(t),r,u,i,f;t.qa||(t.qa=t.notifySubscribers,t.notifySubscribers=function(n,i){i&&i!==l?"beforeChange"===i?t.kb(n):t.qa(n,i):t.lb(n)});f=n(function(){e&&i===t&&(i=t());r=!1;t.Pa(u,i)&&t.qa(u=i)});t.lb=function(n){r=!0;i=n;f()};t.kb=function(n){r||(u=n,t.qa(n,"beforeChange"))}},Ab:function(n){return this.M[n]&&this.M[n].length},yb:function(){var n=0;return s.a.G(this.M,function(t,i){n+=i.length}),n},Pa:function(n,t){return!this.equalityComparer||!this.equalityComparer(n,t)},extend:function(n){var t=this;return n&&s.a.G(n,function(n,i){var r=s.La[n];"function"==typeof r&&(t=r(t,i)||t)}),t}};s.A(h,"subscribe",h.U);s.A(h,"extend",h.extend);s.A(h,"getSubscriptionsCount",h.yb);s.a.xa&&s.a.za(h,Function.prototype);s.P.fn=h;s.Db=function(n){return null!=n&&"function"==typeof n.U&&"function"==typeof n.notifySubscribers};s.b("subscribable",s.P);s.b("isSubscribable",s.Db);s.Y=s.k=function(){function t(t){r.push(n);n=t}function i(){n=r.pop()}var r=[],n,u=0;return{Ea:t,end:i,Jb:function(t){if(n){if(!s.Db(t))throw Error("Only subscribable things can act as dependencies");n.wa(t,t.Vb||(t.Vb=++u))}},B:function(n,r,u){try{return t(),n.apply(r,u||[])}finally{i()}},la:function(){if(n)return n.s.la()},ma:function(){if(n)return n.ma}}}();s.b("computedContext",s.Y);s.b("computedContext.getDependenciesCount",s.Y.la);s.b("computedContext.isInitial",s.Y.ma);s.b("computedContext.isSleeping",s.Y.Ac);s.p=function(n){function t(){return 0<arguments.length?(t.Pa(i,arguments[0])&&(t.X(),i=arguments[0],t.W()),this):(s.k.Jb(t),i)}var i=n;return s.P.call(t),s.a.Aa(t,s.p.fn),t.v=function(){return i},t.W=function(){t.notifySubscribers(i)},t.X=function(){t.notifySubscribers(i,"beforeChange")},s.A(t,"peek",t.v),s.A(t,"valueHasMutated",t.W),s.A(t,"valueWillMutate",t.X),t};s.p.fn={equalityComparer:y};c=s.p.rc="__ko_proto__";s.p.fn[c]=s.p;s.a.xa&&s.a.za(s.p.fn,s.P.fn);s.Ma=function(t,i){return null===t||t===n||t[c]===n?!1:t[c]===i?!0:s.Ma(t[c],i)};s.C=function(n){return s.Ma(n,s.p)};s.Ra=function(n){return"function"==typeof n&&n[c]===s.p||"function"==typeof n&&n[c]===s.j&&n.hc?!0:!1};s.b("observable",s.p);s.b("isObservable",s.C);s.b("isWriteableObservable",s.Ra);s.b("isWritableObservable",s.Ra);s.aa=function(n){if(n=n||[],"object"!=typeof n||!("length"in n))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return n=s.p(n),s.a.Aa(n,s.aa.fn),n.extend({trackArrayChanges:!0})};s.aa.fn={remove:function(n){for(var u,r=this.v(),i=[],f="function"!=typeof n||s.C(n)?function(t){return t===n}:n,t=0;t<r.length;t++)u=r[t],f(u)&&(0===i.length&&this.X(),i.push(u),r.splice(t,1),t--);return i.length&&this.W(),i},removeAll:function(t){if(t===n){var i=this.v(),r=i.slice(0);return this.X(),i.splice(0,i.length),this.W(),r}return t?this.remove(function(n){return 0<=s.a.m(t,n)}):[]},destroy:function(n){var i=this.v(),r="function"!=typeof n||s.C(n)?function(t){return t===n}:n,t;for(this.X(),t=i.length-1;0<=t;t--)r(i[t])&&(i[t]._destroy=!0);this.W()},destroyAll:function(t){return t===n?this.destroy(function(){return!0}):t?this.destroy(function(n){return 0<=s.a.m(t,n)}):[]},indexOf:function(n){var t=this();return s.a.m(t,n)},replace:function(n,t){var i=this.indexOf(n);0<=i&&(this.X(),this.v()[i]=t,this.W())}};s.a.u("pop push reverse shift sort splice unshift".split(" "),function(n){s.aa.fn[n]=function(){var t=this.v();return this.X(),this.sb(t,n,arguments),t=t[n].apply(t,arguments),this.W(),t}});s.a.u(["slice"],function(n){s.aa.fn[n]=function(){var t=this();return t[n].apply(t,arguments)}});s.a.xa&&s.a.za(s.aa.fn,s.p.fn);s.b("observableArray",s.aa);a="arrayChange";s.La.trackArrayChanges=function(n){function u(){var f,u;r||(r=!0,f=n.notifySubscribers,n.notifySubscribers=function(n,t){return t&&t!==l||++i,f.apply(this,arguments)},u=[].concat(n.v()||[]),t=null,n.U(function(r){if(r=[].concat(r||[]),n.Ab(a)){var f;(!t||1<i)&&(t=s.a.Fa(u,r,{sparse:!0}));f=t;f.length&&n.notifySubscribers(f,a)}u=r;t=null;i=0}))}if(!n.sb){var r=!1,t=null,i=0,f=n.U;n.U=n.subscribe=function(n,t,i){return i===a&&u(),f.apply(this,arguments)};n.sb=function(n,u,f){function c(n,t,i){return l[l.length]={status:n,value:t,index:i}}if(r&&!i){var l=[],e=n.length,h=f.length,o=0;switch(u){case"push":o=e;case"unshift":for(u=0;u<h;u++)c("added",f[u],o+u);break;case"pop":o=e-1;case"shift":e&&c("deleted",n[o],o);break;case"splice":u=Math.min(Math.max(0,0>f[0]?e+f[0]:f[0]),e);for(var e=1===h?e:Math.min(u+(f[1]||0),e),h=u+h-2,o=Math.max(e,h),a=[],v=[],y=2;u<o;++u,++y)u<e&&v.push(c("deleted",n[u],u)),u<h&&a.push(c("added",f[y],u));s.a.wb(v,a);break;default:return}t=l}}}};s.s=s.j=function(t,i,r){function nt(){s.a.G(l,function(n,t){t.K()});l={}}function tt(){nt();f=0;b=!0;h=!1}function ot(){var n=u.throttleEvaluation;n&&0<=n?(clearTimeout(ft),ft=setTimeout(a,n)):u.ib?u.ib():a()}function a(t){var a,r,c,d;if(p){if(k)throw Error("A 'pure' computed must not be called recursively");}else if(!b){if(g&&g()){if(!w){y();return}}else w=!1;if(p=!0,v)try{a={};s.k.Ea({wa:function(n,t){a[t]||(a[t]=1,++f)},s:u,ma:n});f=0;o=e.call(i)}finally{s.k.end();p=!1}else try{r=l;c=f;s.k.Ea({wa:function(n,t){b||(c&&r[t]?(l[t]=r[t],++f,delete r[t],--c):l[t]||(l[t]=n.U(ot),++f))},s:u,ma:k?n:!f});l={};f=0;try{d=i?e.call(i):e()}finally{s.k.end();c&&s.a.G(r,function(n,t){t.K()});h=!1}u.Pa(o,d)&&(u.notifySubscribers(o,"beforeChange"),o=d,!0!==t&&u.notifySubscribers(o))}finally{p=!1}f||y()}}function u(){if(0<arguments.length){if("function"==typeof ut)ut.apply(i,arguments);else throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return this}return s.k.Jb(u),h&&a(!0),o}function it(){return h&&!f&&a(!0),o}function rt(){return h||0<f}var o,h=!0,p=!1,w=!1,b=!1,e=t,k=!1,v=!1,et;if(e&&"object"==typeof e?(r=e,e=r.read):(r=r||{},e||(e=r.read)),"function"!=typeof e)throw Error("Pass a function that returns the value of the ko.computed");var ut=r.write,c=r.disposeWhenNodeIsRemoved||r.o||null,d=r.disposeWhen||r.Ia,g=d,y=tt,l={},f=0,ft=null;return i||(i=r.owner),s.P.call(u),s.a.Aa(u,s.j.fn),u.v=it,u.la=function(){return f},u.hc="function"==typeof r.write,u.K=function(){y()},u.Z=rt,et=u.Ta,u.Ta=function(n){et.call(u,n);u.ib=function(){u.kb(o);h=!0;u.lb(u)}},r.pure?(v=k=!0,u.va=function(){v&&(v=!1,a(!0))},u.nb=function(){u.yb()||(nt(),v=h=!0)}):r.deferEvaluation&&(u.va=function(){it();delete u.va}),s.A(u,"peek",u.v),s.A(u,"dispose",u.K),s.A(u,"isActive",u.Z),s.A(u,"getDependenciesCount",u.la),c&&(w=!0,c.nodeType&&(g=function(){return!s.a.Ja(c)||d&&d()})),v||r.deferEvaluation||a(),c&&rt()&&c.nodeType&&(y=function(){s.a.w.Kb(c,y);tt()},s.a.w.da(c,y)),u};s.jc=function(n){return s.Ma(n,s.j)};h=s.p.rc;s.j[h]=s.p;s.j.fn={equalityComparer:y};s.j.fn[h]=s.j;s.a.xa&&s.a.za(s.j.fn,s.P.fn);s.b("dependentObservable",s.j);s.b("computed",s.j);s.b("isComputed",s.jc);s.Ib=function(n,t){return"function"==typeof n?s.s(n,t,{pure:!0}):(n=s.a.extend({},n),n.pure=!0,s.s(n,t))};s.b("pureComputed",s.Ib),function(){function t(u,f,e){if(e=e||new i,u=f(u),"object"!=typeof u||null===u||u===n||u instanceof Date||u instanceof String||u instanceof Number||u instanceof Boolean)return u;var o=u instanceof Array?[]:{};return e.save(u,o),r(u,function(i){var r=f(u[i]),s;switch(typeof r){case"boolean":case"number":case"string":case"function":o[i]=r;break;case"object":case"undefined":s=e.get(r);o[i]=s!==n?s:t(r,f,e)}}),o}function r(n,t){if(n instanceof Array){for(var i=0;i<n.length;i++)t(i);"function"==typeof n.toJSON&&t("toJSON")}else for(i in n)t(i)}function i(){this.keys=[];this.hb=[]}s.Qb=function(n){if(0==arguments.length)throw Error("When calling ko.toJS, pass the object you want to convert.");return t(n,function(n){for(var t=0;s.C(n)&&10>t;t++)n=n();return n})};s.toJSON=function(n,t,i){return n=s.Qb(n),s.a.eb(n,t,i)};i.prototype={save:function(n,t){var i=s.a.m(this.keys,n);0<=i?this.hb[i]=t:(this.keys.push(n),this.hb.push(t))},get:function(t){return t=s.a.m(this.keys,t),0<=t?this.hb[t]:n}}}();s.b("toJS",s.Qb);s.b("toJSON",s.toJSON),function(){s.i={q:function(t){switch(s.a.t(t)){case"option":return!0===t.__ko__hasDomDataOptionValue__?s.a.e.get(t,s.d.options.Va):7>=s.a.L?t.getAttributeNode("value")&&t.getAttributeNode("value").specified?t.value:t.text:t.value;case"select":return 0<=t.selectedIndex?s.i.q(t.options[t.selectedIndex]):n;default:return t.value}},ca:function(t,i,r){switch(s.a.t(t)){case"option":switch(typeof i){case"string":s.a.e.set(t,s.d.options.Va,n);"__ko__hasDomDataOptionValue__"in t&&delete t.__ko__hasDomDataOptionValue__;t.value=i;break;default:s.a.e.set(t,s.d.options.Va,i);t.__ko__hasDomDataOptionValue__=!0;t.value="number"==typeof i?i:""}break;case"select":(""===i||null===i)&&(i=n);for(var f=-1,u=0,o=t.options.length,e;u<o;++u)if(e=s.i.q(t.options[u]),e==i||""==e&&i===n){f=u;break}(r||0<=f||i===n&&1<t.size)&&(t.selectedIndex=f);break;default:(null===i||i===n)&&(i="");t.value=i}}}}();s.b("selectExtensions",s.i);s.b("selectExtensions.readValue",s.i.q);s.b("selectExtensions.writeValue",s.i.ca);s.h=function(){function n(n){var c,r,i;n=s.a.cb(n);123===n.charCodeAt(0)&&(n=n.slice(1,-1));var a=[],o=n.match(t),h,u,l=0;if(o)for(o.push(","),c=0;r=o[c];++c){if(i=r.charCodeAt(0),44===i){if(0>=l){h&&a.push(u?{key:h,value:u.join("")}:{unknown:h});h=u=l=0;continue}}else if(58===i){if(!u)continue}else if(47===i&&c&&1<r.length)(i=o[c-1].match(f))&&!e[i[0]]&&(n=n.substr(n.indexOf(r)+1),o=n.match(t),o.push(","),c=-1,r="/");else if(40===i||123===i||91===i)++l;else if(41===i||125===i||93===i)--l;else if(!h&&!u){h=34===i||39===i?r.slice(1,-1):r;continue}u?u.push(r):u=[r]}return a}var r=["true","false","null","undefined"],u=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,t=RegExp("\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'|/(?:[^/\\\\]|\\\\.)*/w*|[^\\s:,/][^,\"'{}()/:[\\]]*[^\\s,\"'{}()/:[\\]]|[^\\s]","g"),f=/[\])"'A-Za-z0-9_$]+$/,e={"in":1,"return":1,"typeof":1},i={};return{ha:[],V:i,Wa:n,ya:function(t,f){function e(n,t){var a,f;if(!l){if(f=s.getBindingHandler(n),f&&f.preprocess&&!(t=f.preprocess(t,n,e)))return;(f=i[n])&&(a=t,0<=s.a.m(r,a)?a=!1:(f=a.match(u),a=null===f?!1:f[1]?"Object("+f[1]+")"+f[2]:a),f=a);f&&o.push("'"+n+"':function(_z){"+a+"=_z}")}c&&(t="function(){return "+t+" }");h.push("'"+n+"':"+t)}f=f||{};var h=[],o=[],c=f.valueAccessors,l=f.bindingParams,a="string"==typeof t?n(t):t;return s.a.u(a,function(n){e(n.key||n.unknown,n.value)}),o.length&&e("_ko_property_writers","{"+o.join(",")+" }"),h.join(",")},lc:function(n,t){for(var i=0;i<n.length;i++)if(n[i].key==t)return!0;return!1},pa:function(n,t,i,r,u){n&&s.C(n)?!s.Ra(n)||u&&n.v()===r||n(r):(n=t.get("_ko_property_writers"))&&n[i]&&n[i](r)}}}();s.b("expressionRewriting",s.h);s.b("expressionRewriting.bindingRewriteValidators",s.h.ha);s.b("expressionRewriting.parseObjectLiteral",s.h.Wa);s.b("expressionRewriting.preProcessBindings",s.h.ya);s.b("expressionRewriting._twoWayBindings",s.h.V);s.b("jsonExpressionRewriting",s.h);s.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",s.h.ya),function(){function n(n){return 8==n.nodeType&&e.test(t?n.text:n.nodeValue)}function i(n){return 8==n.nodeType&&o.test(t?n.text:n.nodeValue)}function u(t,r){for(var u=t,f=1,e=[];u=u.nextSibling;){if(i(u)&&(f--,0===f))return e;e.push(u);n(u)&&f++}if(!r)throw Error("Cannot find closing comment tag to match: "+t.nodeValue);return null}function f(n,t){var i=u(n,t);return i?0<i.length?i[i.length-1].nextSibling:n.nextSibling:null}var t=r&&"<!--test-->"===r.createComment("test").text,e=t?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,o=t?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,h={ul:!0,ol:!0};s.f={Q:{},childNodes:function(t){return n(t)?u(t):t.childNodes},ja:function(t){if(n(t)){t=s.f.childNodes(t);for(var i=0,r=t.length;i<r;i++)s.removeNode(t[i])}else s.a.Ka(t)},T:function(t,i){if(n(t)){s.f.ja(t);for(var u=t.nextSibling,r=0,f=i.length;r<f;r++)u.parentNode.insertBefore(i[r],u)}else s.a.T(t,i)},Hb:function(t,i){n(t)?t.parentNode.insertBefore(i,t.nextSibling):t.firstChild?t.insertBefore(i,t.firstChild):t.appendChild(i)},Bb:function(t,i,r){r?n(t)?t.parentNode.insertBefore(i,r.nextSibling):r.nextSibling?t.insertBefore(i,r.nextSibling):t.appendChild(i):s.f.Hb(t,i)},firstChild:function(t){return n(t)?!t.nextSibling||i(t.nextSibling)?null:t.nextSibling:t.firstChild},nextSibling:function(t){return n(t)&&(t=f(t)),t.nextSibling&&i(t.nextSibling)?null:t.nextSibling},gc:n,xc:function(n){return(n=(t?n.text:n.nodeValue).match(e))?n[1]:null},Fb:function(t){var o,r,u,e;if(h[s.a.t(t)]&&(o=t.firstChild,o))do if(1===o.nodeType){if(r=o.firstChild,u=null,r)do u?u.push(r):n(r)?(e=f(r,!0),e?r=e:u=[r]):i(r)&&(u=[r]);while(r=r.nextSibling);if(r=u)for(u=o.nextSibling,e=0;e<r.length;e++)u?t.insertBefore(r[e],u):t.appendChild(r[e])}while(o=o.nextSibling)}}}();s.b("virtualElements",s.f);s.b("virtualElements.allowedBindings",s.f.Q);s.b("virtualElements.emptyNode",s.f.ja);s.b("virtualElements.insertAfter",s.f.Bb);s.b("virtualElements.prepend",s.f.Hb);s.b("virtualElements.setDomNodeChildren",s.f.T),function(){s.J=function(){this.Yb={}};s.a.extend(s.J.prototype,{nodeHasBindings:function(n){switch(n.nodeType){case 1:return null!=n.getAttribute("data-bind")||s.g.getComponentNameForNode(n);case 8:return s.f.gc(n);default:return!1}},getBindings:function(n,t){var i=this.getBindingsString(n,t),i=i?this.parseBindingsString(i,t,n):null;return s.g.mb(i,n,t,!1)},getBindingAccessors:function(n,t){var i=this.getBindingsString(n,t),i=i?this.parseBindingsString(i,t,n,{valueAccessors:!0}):null;return s.g.mb(i,n,t,!0)},getBindingsString:function(n){switch(n.nodeType){case 1:return n.getAttribute("data-bind");case 8:return s.f.xc(n);default:return null}},parseBindingsString:function(n,t,i,r){var u,f,e,h,c;try{return u=this.Yb,f=n+(r&&r.valueAccessors||""),(e=u[f])||(c="with($context){with($data||{}){return{"+s.h.ya(n,r)+"}}}",h=new Function("$context","$element",c),e=u[f]=h),e(t,i)}catch(o){throw o.message="Unable to parse bindings.\nBindings value: "+n+"\nMessage: "+o.message,o;}}});s.J.instance=new s.J}();s.b("bindingProvider",s.J),function(){function v(n){return function(){return n}}function u(n){return n()}function o(n){return s.a.na(s.k.B(n),function(t,i){return function(){return n()[i]}})}function y(n,t){return o(this.getBindings.bind(this,n,t))}function h(n,t,i){var r,u=s.f.firstChild(t),f=s.J.instance,e=f.preprocessNode;if(e){for(;r=u;)u=s.f.nextSibling(r),e.call(f,r);u=s.f.firstChild(t)}for(;r=u;)u=s.f.nextSibling(r),c(n,r,i)}function c(n,t,i){var u=!0,r=1===t.nodeType;r&&s.f.Fb(t);(r&&i||s.J.instance.nodeHasBindings(t))&&(u=l(t,null,n,i).shouldBindDescendants);u&&!a[s.a.t(t)]&&h(n,t,!r)}function p(n){var i=[],r={},t=[];return s.a.G(n,function u(f){if(!r[f]){var e=s.getBindingHandler(f);e&&(e.after&&(t.push(f),s.a.u(e.after,function(i){if(n[i]){if(-1!==s.a.m(t,i))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+t.join(", "));u(i)}}),t.length--),i.push({key:f,zb:e}));r[f]=!0}}),i}function l(t,i,r,e){var v=s.a.e.get(t,f),o,l,a,c;if(!i){if(v)throw Error("You cannot apply bindings multiple times to the same element.");s.a.e.set(t,f,!0)}if(!v&&e&&s.Ob(t,r),i&&"function"!=typeof i)o=i;else{var w=s.J.instance,b=w.getBindingAccessors||y,h=s.j(function(){return(o=i?i(r,t):b.call(w,t,r))&&r.I&&r.I(),o},null,{o:t});o&&h.Z()||(h=null)}return o&&(a=h?function(n){return function(){return u(h()[n])}}:function(n){return o[n]},c=function(){return s.a.na(h?h():o,u)},c.get=function(n){return o[n]&&u(a(n))},c.has=function(n){return n in o},e=p(o),s.a.u(e,function(i){var e=i.zb.init,h=i.zb.update,u=i.key;if(8===t.nodeType&&!s.f.Q[u])throw Error("The binding '"+u+"' cannot be used with virtual elements");try{"function"==typeof e&&s.k.B(function(){var i=e(t,a(u),c,r.$data,r);if(i&&i.controlsDescendantBindings){if(l!==n)throw Error("Multiple bindings ("+l+" and "+u+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");l=u}});"function"==typeof h&&s.j(function(){h(t,a(u),c,r.$data,r)},null,{o:t})}catch(f){throw f.message='Unable to process binding "'+u+": "+o[u]+'"\nMessage: '+f.message,f;}})),{shouldBindDescendants:l===n}}function r(n){return n&&n instanceof s.N?n:new s.N(n)}var a,f,e;s.d={};a={script:!0};s.getBindingHandler=function(n){return s.d[n]};s.N=function(t,i,r,u){var f=this,h="function"==typeof t&&!s.C(t),o,e=s.j(function(){var o=h?t():t,n=s.a.c(o);return i?(i.I&&i.I(),s.a.extend(f,i),e&&(f.I=e)):(f.$parents=[],f.$root=n,f.ko=s),f.$rawData=o,f.$data=n,r&&(f[r]=n),u&&u(f,i,n),f.$data},null,{Ia:function(){return o&&!s.a.ob(o)},o:!0});e.Z()&&(f.I=e,e.equalityComparer=null,o=[],e.Tb=function(t){o.push(t);s.a.w.da(t,function(t){s.a.ua(o,t);o.length||(e.K(),f.I=e=n)})})};s.N.prototype.createChildContext=function(n,t,i){return new s.N(n,this,t,function(n,t){n.$parentContext=t;n.$parent=t.$data;n.$parents=(t.$parents||[]).slice(0);n.$parents.unshift(n.$parent);i&&i(n)})};s.N.prototype.extend=function(n){return new s.N(this.I||this.$data,this,null,function(t,i){t.$rawData=i.$rawData;s.a.extend(t,"function"==typeof n?n():n)})};f=s.a.e.F();e=s.a.e.F();s.Ob=function(n,t){if(2==arguments.length)s.a.e.set(n,e,t),t.I&&t.I.Tb(n);else return s.a.e.get(n,e)};s.ra=function(n,t,i){return 1===n.nodeType&&s.f.Fb(n),l(n,t,r(i),!0)};s.Wb=function(n,t,i){return i=r(i),s.ra(n,"function"==typeof t?o(t.bind(null,i,n)):s.a.na(t,v),i)};s.Ca=function(n,t){1!==t.nodeType&&8!==t.nodeType||h(r(n),t,!0)};s.pb=function(n,u){if(!t&&i.jQuery&&(t=i.jQuery),u&&1!==u.nodeType&&8!==u.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");u=u||i.document.body;c(r(n),u,!0)};s.Ha=function(t){switch(t.nodeType){case 1:case 8:var i=s.Ob(t);if(i)return i;if(t.parentNode)return s.Ha(t.parentNode)}return n};s.$b=function(t){return(t=s.Ha(t))?t.$data:n};s.b("bindingHandlers",s.d);s.b("applyBindings",s.pb);s.b("applyBindingsToDescendants",s.Ca);s.b("applyBindingAccessorsToNode",s.ra);s.b("applyBindingsToNode",s.Wb);s.b("contextFor",s.Ha);s.b("dataFor",s.$b)}(),function(n){function u(t,u){var e=i.hasOwnProperty(t)?i[t]:n,o;e||(e=i[t]=new s.P,f(t,function(n){r[t]=n;delete i[t];o?e.notifySubscribers(n):setTimeout(function(){e.notifySubscribers(n)},0)}),o=!0);e.U(u)}function f(n,i){t("getConfig",[n],function(r){r?t("loadComponent",[n,r],function(n){i(n)}):i(null)})}function t(i,r,u,f){var e,o,h;if(f||(f=s.g.loaders.slice(0)),e=f.shift(),e)if(o=e[i],o){if(h=!1,o.apply(e,r.concat(function(n){h?u(null):null!==n?u(n):t(i,r,u,f)}))!==n&&(h=!0,!e.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.");}else t(i,r,u,f);else u(null)}var i={},r={};s.g={get:function(t,i){var f=r.hasOwnProperty(t)?r[t]:n;f?setTimeout(function(){i(f)},0):u(t,i)},tb:function(n){delete r[n]},jb:t};s.g.loaders=[];s.b("components",s.g);s.b("components.get",s.g.get);s.b("components.clearCachedDefinition",s.g.tb)}(),function(){function l(n,i,r,f){function e(){0==--c&&f(o)}var o={},c=2,h=r.template;r=r.viewModel;h?u(i,h,function(t){s.g.jb("loadTemplate",[n,t],function(n){o.template=n;e()})}):e();r?u(i,r,function(i){s.g.jb("loadViewModel",[n,i],function(n){o[t]=n;e()})}):e()}function e(n,i,r){if("function"==typeof i)r(function(n){return new i(n)});else if("function"==typeof i[t])r(i[t]);else if("instance"in i){var u=i.instance;r(function(){return u})}else"viewModel"in i?e(n,i.viewModel,r):n("Unknown viewModel value: "+i)}function h(n){switch(s.a.t(n)){case"script":return s.a.ba(n.text);case"textarea":return s.a.ba(n.value);case"template":if(c(n.content))return s.a.ia(n.content.childNodes)}return s.a.ia(n.childNodes)}function c(n){return i.DocumentFragment?n instanceof DocumentFragment:n&&11===n.nodeType}function u(n,t,r){"string"==typeof t.require?o||i.require?(o||i.require)([t.require],r):n("Uses require, but no AMD loader is present"):r(t)}function f(n){return function(t){throw Error("Component '"+n+"': "+t);}}var n={},t;s.g.tc=function(t,i){if(!i)throw Error("Invalid configuration for "+t);if(s.g.Qa(t))throw Error("Component "+t+" is already registered");n[t]=i};s.g.Qa=function(t){return t in n};s.g.wc=function(t){delete n[t];s.g.tb(t)};s.g.ub={getConfig:function(t,i){i(n.hasOwnProperty(t)?n[t]:null)},loadComponent:function(n,t,i){var r=f(n);u(r,t,function(t){l(n,r,t,i)})},loadTemplate:function(n,t,u){if(n=f(n),"string"==typeof t)u(s.a.ba(t));else if(t instanceof Array)u(t);else if(c(t))u(s.a.S(t.childNodes));else if(t.element)if(t=t.element,i.HTMLElement?t instanceof HTMLElement:t&&t.tagName&&1===t.nodeType)u(h(t));else if("string"==typeof t){var e=r.getElementById(t);e?u(h(e)):n("Cannot find element with ID "+t)}else n("Unknown element type: "+t);else n("Unknown template value: "+t)},loadViewModel:function(n,t,i){e(f(n),t,i)}};t="createViewModel";s.b("components.register",s.g.tc);s.b("components.isRegistered",s.g.Qa);s.b("components.unregister",s.g.wc);s.b("components.defaultLoader",s.g.ub);s.g.loaders.push(s.g.ub);s.g.Ub=n}(),function(){function n(n,i){var r=n.getAttribute("params");if(r){var r=t.parseBindingsString(r,i,n,{valueAccessors:!0,bindingParams:!0}),r=s.a.na(r,function(t){return s.s(t,null,{o:n})}),u=s.a.na(r,function(t){return t.Z()?s.s(function(){return s.a.c(t())},null,{o:n}):t.v()});return u.hasOwnProperty("$raw")||(u.$raw=r),u}return{$raw:{}}}s.g.getComponentNameForNode=function(n){return n=s.a.t(n),s.g.Qa(n)&&n};s.g.mb=function(t,i,r,u){var f,e;if(1===i.nodeType&&(f=s.g.getComponentNameForNode(i),f)){if(t=t||{},t.component)throw Error('Cannot use the "component" binding on a custom element matching a component');e={name:f,params:n(i,r)};t.component=u?function(){return e}:e}return t};var t=new s.J;9>s.a.L&&(s.g.register=function(n){return function(t){return r.createElement(t),n.apply(this,arguments)}}(s.g.register),r.createDocumentFragment=function(n){return function(){var i=n(),r=s.g.Ub,t;for(t in r)r.hasOwnProperty(t)&&i.createElement(t);return i}}(r.createDocumentFragment))}(),function(){var n=0;s.d.component={init:function(t,i,r,u,f){function h(){var n=e&&e.dispose;"function"==typeof n&&n.call(e);o=null}var e,o;return s.a.w.da(t,h),s.s(function(){var u=s.a.c(i()),r,c,l;if("string"==typeof u?r=u:(r=s.a.c(u.name),c=s.a.c(u.params)),!r)throw Error("No component name specified");l=o=++n;s.g.get(r,function(n){var i,u;if(o===l){if(h(),!n)throw Error("Unknown component '"+r+"'");if(i=n.template,!i)throw Error("Component '"+r+"' has no template");i=s.a.ia(i);s.f.T(t,i);i=c;u=n.createViewModel;n=u?u.call(n,i,{element:t}):i;i=f.createChildContext(n);e=n;s.Ca(i,t)}})},null,{o:t}),{controlsDescendantBindings:!0}}};s.f.Q.component=!0}();w={"class":"className","for":"htmlFor"};s.d.attr={update:function(t,i){var r=s.a.c(i())||{};s.a.G(r,function(i,r){r=s.a.c(r);var u=!1===r||null===r||r===n;u&&t.removeAttribute(i);8>=s.a.L&&i in w?(i=w[i],u?t.removeAttribute(i):t[i]=r):u||t.setAttribute(i,r.toString());"name"===i&&s.a.Mb(t,u?"":r.toString())})}},function(){s.d.checked={after:["value","attr"],init:function(t,i,r){function c(){var c=t.checked,n=a?u():c,o;s.Y.ma()||f&&!c||(o=s.k.B(i),e?h!==n?(c&&(s.a.ea(o,n,!0),s.a.ea(o,h,!1)),h=n):s.a.ea(o,n,c):s.h.pa(o,r,"checked",n,!0))}function l(){var n=s.a.c(i());t.checked=e?0<=s.a.m(n,u()):o?n:u()===n}var u=s.Ib(function(){return r.has("checkedValue")?s.a.c(r.get("checkedValue")):r.has("value")?s.a.c(r.get("value")):t.value}),o="checkbox"==t.type,f="radio"==t.type;if(o||f){var e=o&&s.a.c(i())instanceof Array,h=e?u():n,a=f||e;f&&!t.name&&s.d.uniqueName.init(t,function(){return!0});s.s(c,null,{o:t});s.a.n(t,"click",c);s.s(l,null,{o:t})}}};s.h.V.checked=!0;s.d.checkedValue={update:function(n,t){n.value=s.a.c(t())}}}();s.d.css={update:function(n,t){var i=s.a.c(t());"object"==typeof i?s.a.G(i,function(t,i){i=s.a.c(i);s.a.Ba(n,t,i)}):(i=String(i||""),s.a.Ba(n,n.__ko__cssValue,!1),n.__ko__cssValue=i,s.a.Ba(n,i,!0))}};s.d.enable={update:function(n,t){var i=s.a.c(t());i&&n.disabled?n.removeAttribute("disabled"):i||n.disabled||(n.disabled=!0)}};s.d.disable={update:function(n,t){s.d.enable.update(n,function(){return!s.a.c(t())})}};s.d.event={init:function(n,t,i,r,u){var f=t()||{};s.a.G(f,function(f){"string"==typeof f&&s.a.n(n,f,function(n){var o,h=t()[f],e;if(h){try{e=s.a.S(arguments);r=u.$data;e.unshift(r);o=h.apply(r,e)}finally{!0!==o&&(n.preventDefault?n.preventDefault():n.returnValue=!1)}!1===i.get(f+"Bubble")&&(n.cancelBubble=!0,n.stopPropagation&&n.stopPropagation())}})})}};s.d.foreach={Eb:function(n){return function(){var i=n(),t=s.a.Xa(i);return!t||"number"==typeof t.length?{foreach:i,templateEngine:s.O.Oa}:(s.a.c(i),{foreach:t.data,as:t.as,includeDestroyed:t.includeDestroyed,afterAdd:t.afterAdd,beforeRemove:t.beforeRemove,afterRender:t.afterRender,beforeMove:t.beforeMove,afterMove:t.afterMove,templateEngine:s.O.Oa})}},init:function(n,t){return s.d.template.init(n,s.d.foreach.Eb(t))},update:function(n,t,i,r,u){return s.d.template.update(n,s.d.foreach.Eb(t),i,r,u)}};s.h.ha.foreach=!1;s.f.Q.foreach=!0;s.d.hasfocus={init:function(n,t,i){function r(r){var u,f;if(n.__ko_hasfocusUpdating=!0,u=n.ownerDocument,"activeElement"in u){try{f=u.activeElement}catch(e){f=u.body}r=f===n}u=t();s.h.pa(u,i,"hasfocus",r,!0);n.__ko_hasfocusLastValue=r;n.__ko_hasfocusUpdating=!1}var u=r.bind(null,!0),f=r.bind(null,!1);s.a.n(n,"focus",u);s.a.n(n,"focusin",u);s.a.n(n,"blur",f);s.a.n(n,"focusout",f)},update:function(n,t){var i=!!s.a.c(t());n.__ko_hasfocusUpdating||n.__ko_hasfocusLastValue===i||(i?n.focus():n.blur(),s.k.B(s.a.oa,null,[n,i?"focusin":"focusout"]))}};s.h.V.hasfocus=!0;s.d.hasFocus=s.d.hasfocus;s.h.V.hasFocus=!0;s.d.html={init:function(){return{controlsDescendantBindings:!0}},update:function(n,t){s.a.$a(n,t())}};p("if");p("ifnot",!1,!0);p("with",!0,!1,function(n,t){return n.createChildContext(t)});v={};s.d.options={init:function(n){if("select"!==s.a.t(n))throw Error("options binding applies only to SELECT elements");for(;0<n.length;)n.remove(0);return{controlsDescendantBindings:!0}},update:function(t,i,r){function c(){return s.a.ta(t.options,function(n){return n.selected})}function l(n,t,i){var r=typeof t;return"function"==r?t(n):"string"==r?n[t]:i}function a(n,i){if(f.length){var r=0<=s.a.m(f,s.i.q(i[0]));s.a.Nb(i[0],r);h&&!r&&s.k.B(s.a.oa,null,[t,"change"])}}var e=0!=t.length&&t.multiple?t.scrollTop:null,u=s.a.c(i()),y=r.get("optionsIncludeDestroyed"),o,f,h;i={};f=t.multiple?s.a.Da(c(),s.i.q):0<=t.selectedIndex?[s.i.q(t.options[t.selectedIndex])]:[];u&&("undefined"==typeof u.length&&(u=[u]),o=s.a.ta(u,function(t){return y||t===n||null===t||!s.a.c(t._destroy)}),r.has("optionsCaption")&&(u=s.a.c(r.get("optionsCaption")),null!==u&&u!==n&&o.unshift(v)));h=!1;i.beforeRemove=function(n){t.removeChild(n)};u=a;r.has("optionsAfterRender")&&(u=function(t,i){a(0,i);s.k.B(r.get("optionsAfterRender"),null,[i[0],t!==v?t:n])});s.a.Za(t,o,function(i,u,e){return e.length&&(f=e[0].selected?[s.i.q(e[0])]:[],h=!0),u=t.ownerDocument.createElement("option"),i===v?(s.a.bb(u,r.get("optionsCaption")),s.i.ca(u,n)):(e=l(i,r.get("optionsValue"),i),s.i.ca(u,s.a.c(e)),i=l(i,r.get("optionsText"),e),s.a.bb(u,i)),[u]},i,u);s.k.B(function(){r.get("valueAllowUnset")&&r.has("value")?s.i.ca(t,s.a.c(r.get("value")),!0):(t.multiple?f.length&&c().length<f.length:f.length&&0<=t.selectedIndex?s.i.q(t.options[t.selectedIndex])!==f[0]:f.length||0<=t.selectedIndex)&&s.a.oa(t,"change")});s.a.dc(t);e&&20<Math.abs(e-t.scrollTop)&&(t.scrollTop=e)}};s.d.options.Va=s.a.e.F();s.d.selectedOptions={after:["options","foreach"],init:function(n,t,i){s.a.n(n,"change",function(){var u=t(),r=[];s.a.u(n.getElementsByTagName("option"),function(n){n.selected&&r.push(s.i.q(n))});s.h.pa(u,i,"selectedOptions",r)})},update:function(n,t){if("select"!=s.a.t(n))throw Error("values binding applies only to SELECT elements");var i=s.a.c(t());i&&"number"==typeof i.length&&s.a.u(n.getElementsByTagName("option"),function(n){var t=0<=s.a.m(i,s.i.q(n));s.a.Nb(n,t)})}};s.h.V.selectedOptions=!0;s.d.style={update:function(t,i){var r=s.a.c(i()||{});s.a.G(r,function(i,r){r=s.a.c(r);(null===r||r===n||!1===r)&&(r="");t.style[i]=r})}};s.d.submit={init:function(n,t,i,r,u){if("function"!=typeof t())throw Error("The value for a submit binding must be a function");s.a.n(n,"submit",function(i){var r,f=t();try{r=f.call(u.$data,n)}finally{!0!==r&&(i.preventDefault?i.preventDefault():i.returnValue=!1)}})}};s.d.text={init:function(){return{controlsDescendantBindings:!0}},update:function(n,t){s.a.bb(n,t())}};s.f.Q.text=!0,function(){if(i&&i.navigator)var t=function(n){if(n)return parseFloat(n[1])},e=i.opera&&i.opera.version&&parseInt(i.opera.version()),r=i.navigator.userAgent,o=t(r.match(/^(?:(?!chrome).)*version\/([^ ]*) safari/i)),h=t(r.match(/Firefox\/([^ ]*)/));if(10>s.a.L)var u=s.a.e.F(),f=s.a.e.F(),c=function(n){var t=this.activeElement;(t=t&&s.a.e.get(t,f))&&t(n)},l=function(n,t){var i=n.ownerDocument;s.a.e.get(i,u)||(s.a.e.set(i,u,!0),s.a.n(i,"selectionchange",c));s.a.e.set(n,f,t)};s.d.textInput={init:function(t,i,r){function u(n,i){s.a.n(t,n,i)}function p(){var r=s.a.c(i());(null===r||r===n)&&(r="");v!==n&&r===v?setTimeout(p,4):t.value!==r&&(y=r,t.value=r)}function c(){a||(v=t.value,a=setTimeout(f,4))}function f(){clearTimeout(a);v=a=n;var u=t.value;y!==u&&(y=u,s.h.pa(i(),r,"textInput",u))}var y=t.value,a,v;10>s.a.L?(u("propertychange",function(n){"value"===n.propertyName&&f()}),8==s.a.L&&(u("keyup",f),u("keydown",f)),8<=s.a.L&&(l(t,f),u("dragend",c))):(u("input",f),5>o&&"textarea"===s.a.t(t)?(u("keydown",c),u("paste",c),u("cut",c)):11>e?u("keydown",c):4>h&&(u("DOMAutoComplete",f),u("dragdrop",f),u("drop",f)));u("change",f);s.s(p,null,{o:t})}};s.h.V.textInput=!0;s.d.textinput={preprocess:function(n,t,i){i("textInput",n)}}}();s.d.uniqueName={init:function(n,t){if(t()){var i="ko_unique_"+ ++s.d.uniqueName.Zb;s.a.Mb(n,i)}}};s.d.uniqueName.Zb=0;s.d.value={after:["options","foreach"],init:function(n,t,i){var o,h;if("input"!=n.tagName.toLowerCase()||"checkbox"!=n.type&&"radio"!=n.type){var r=["change"],u=i.get("valueUpdate"),f=!1,e=null;u&&("string"==typeof u&&(u=[u]),s.a.ga(r,u),r=s.a.rb(r));o=function(){e=null;f=!1;var r=t(),u=s.i.q(n);s.h.pa(r,i,"value",u)};!s.a.L||"input"!=n.tagName.toLowerCase()||"text"!=n.type||"off"==n.autocomplete||n.form&&"off"==n.form.autocomplete||-1!=s.a.m(r,"propertychange")||(s.a.n(n,"propertychange",function(){f=!0}),s.a.n(n,"focus",function(){f=!1}),s.a.n(n,"blur",function(){f&&o()}));s.a.u(r,function(t){var i=o;s.a.vc(t,"after")&&(i=function(){e=s.i.q(n);setTimeout(o,0)},t=t.substring(5));s.a.n(n,t,i)});h=function(){var r=s.a.c(t()),u=s.i.q(n),f;null!==e&&r===e?setTimeout(h,0):r!==u&&("select"===s.a.t(n)?(f=i.get("valueAllowUnset"),u=function(){s.i.ca(n,r,f)},u(),f||r===s.i.q(n)?setTimeout(u,0):s.k.B(s.a.oa,null,[n,"change"])):s.i.ca(n,r))};s.s(h,null,{o:n})}else s.ra(n,{checkedValue:t})},update:function(){}};s.h.V.value=!0;s.d.visible={update:function(n,t){var i=s.a.c(t()),r="none"!=n.style.display;i&&!r?n.style.display="":!i&&r&&(n.style.display="none")}},function(n){s.d[n]={init:function(t,i,r,u,f){return s.d.event.init.call(this,t,function(){var t={};return t[n]=i(),t},r,u,f)}}}("click");s.H=function(){};s.H.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource");};s.H.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock");};s.H.prototype.makeTemplateSource=function(n,t){if("string"==typeof n){t=t||r;var i=t.getElementById(n);if(!i)throw Error("Cannot find template with ID "+n);return new s.r.l(i)}if(1==n.nodeType||8==n.nodeType)return new s.r.fa(n);throw Error("Unknown template type: "+n);};s.H.prototype.renderTemplate=function(n,t,i,r){return n=this.makeTemplateSource(n,r),this.renderTemplateSource(n,t,i)};s.H.prototype.isTemplateRewritten=function(n,t){return!1===this.allowTemplateRewriting?!0:this.makeTemplateSource(n,t).data("isRewritten")};s.H.prototype.rewriteTemplate=function(n,t,i){n=this.makeTemplateSource(n,i);t=t(n.text());n.text(t);n.data("isRewritten",!0)};s.b("templateEngine",s.H);s.fb=function(){function n(n,t,i,r){var o,f,u,e;for(n=s.h.Wa(n),o=s.h.ha,f=0;f<n.length;f++)if(u=n[f].key,o.hasOwnProperty(u))if(e=o[u],"function"==typeof e){if(u=e(n[f].value))throw Error(u);}else if(!e)throw Error("This template engine does not support the '"+u+"' binding within its templates");return i="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+s.h.ya(n,{valueAccessors:!0})+" } })()},'"+i.toLowerCase()+"')",r.createJavaScriptEvaluatorBlock(i)+t}var t=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,i=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{ec:function(n,t,i){t.isTemplateRewritten(n,i)||t.rewriteTemplate(n,function(n){return s.fb.nc(n,t)},i)},nc:function(r,u){return r.replace(t,function(t,i,r,f,e){return n(e,i,r,u)}).replace(i,function(t,i){return n(i,"<!-- ko -->","#comment",u)})},Xb:function(n,t){return s.D.Ua(function(i,r){var u=i.nextSibling;u&&u.nodeName.toLowerCase()===t&&s.ra(u,n,r)})}}}();s.b("__tr_ambtns",s.fb.Xb),function(){var i,t;s.r={};s.r.l=function(n){this.l=n};s.r.l.prototype.text=function(){var n=s.a.t(this.l),n="script"===n?"text":"textarea"===n?"value":"innerHTML",t;if(0==arguments.length)return this.l[n];t=arguments[0];"innerHTML"===n?s.a.$a(this.l,t):this.l[n]=t};i=s.a.e.F()+"_";s.r.l.prototype.data=function(n){if(1===arguments.length)return s.a.e.get(this.l,i+n);s.a.e.set(this.l,i+n,arguments[1])};t=s.a.e.F();s.r.fa=function(n){this.l=n};s.r.fa.prototype=new s.r.l;s.r.fa.prototype.text=function(){if(0==arguments.length){var i=s.a.e.get(this.l,t)||{};return i.gb===n&&i.Ga&&(i.gb=i.Ga.innerHTML),i.gb}s.a.e.set(this.l,t,{gb:arguments[0]})};s.r.l.prototype.nodes=function(){if(0==arguments.length)return(s.a.e.get(this.l,t)||{}).Ga;s.a.e.set(this.l,t,{Ga:arguments[0]})};s.b("templateSources",s.r);s.b("templateSources.domElement",s.r.l);s.b("templateSources.anonymousTemplate",s.r.fa)}(),function(){function t(n,t,i){var r;for(t=s.f.nextSibling(t);n&&(r=n)!==t;)n=s.f.nextSibling(r),i(r,n)}function f(n,i){if(n.length){var r=n[0],u=n[n.length-1],f=r.parentNode,e=s.J.instance,o=e.preprocessNode;if(o){if(t(r,u,function(n,t){var f=n.previousSibling,i=o.call(e,n);i&&(n===r&&(r=i[0]||t),n===u&&(u=i[i.length-1]||f))}),n.length=0,!r)return;r===u?n.push(r):(n.push(r,u),s.a.ka(n,f))}t(r,u,function(n){1!==n.nodeType&&8!==n.nodeType||s.pb(i,n)});t(r,u,function(n){1!==n.nodeType&&8!==n.nodeType||s.D.Sb(n,[i])});s.a.ka(n,f)}}function i(n){return n.nodeType?n:0<n.length?n[0]:null}function e(n,t,u,e,o){o=o||{};var h=n&&i(n),h=h&&h.ownerDocument,c=o.templateEngine||r;if(s.fb.ec(u,c,h),u=c.renderTemplate(u,e,o,h),"number"!=typeof u.length||0<u.length&&"number"!=typeof u[0].nodeType)throw Error("Template engine must return an array of DOM nodes");h=!1;switch(t){case"replaceChildren":s.f.T(n,u);h=!0;break;case"replaceNode":s.a.Lb(n,u);h=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+t);}return h&&(f(u,e),o.afterRender&&s.k.B(o.afterRender,null,[u,e.$data])),u}var r,u;s.ab=function(t){if(t!=n&&!(t instanceof s.H))throw Error("templateEngine must inherit from ko.templateEngine");r=t};s.Ya=function(t,u,f,o,h){if(f=f||{},(f.templateEngine||r)==n)throw Error("Set a template engine before calling renderTemplate");if(h=h||"replaceChildren",o){var c=i(o);return s.j(function(){var n=u&&u instanceof s.N?u:new s.N(s.a.c(u)),r=s.C(t)?t():"function"==typeof t?t(n.$data,n):t,n=e(o,h,r,n,f);"replaceNode"==h&&(o=n,c=i(o))},null,{Ia:function(){return!c||!s.a.Ja(c)},o:c&&"replaceNode"==h?c.parentNode:c})}return s.D.Ua(function(n){s.Ya(t,u,f,n,"replaceNode")})};s.uc=function(t,i,r,u,o){function c(n,t){f(t,h);r.afterRender&&r.afterRender(t,n)}function l(n,i){h=o.createChildContext(n,r.as,function(n){n.$index=i});var u=s.C(t)?t():"function"==typeof t?t(n,h):t;return e(null,"ignoreTargetNode",u,h,r)}var h;return s.j(function(){var t=s.a.c(i)||[];"undefined"==typeof t.length&&(t=[t]);t=s.a.ta(t,function(t){return r.includeDestroyed||t===n||null===t||!s.a.c(t._destroy)});s.k.B(s.a.Za,null,[u,t,l,r,c])},null,{o:u})};u=s.a.e.F();s.d.template={init:function(n,t){var i=s.a.c(t());return"string"==typeof i||i.name?s.f.ja(n):(i=s.f.childNodes(n),i=s.a.oc(i),new s.r.fa(n).nodes(i)),{controlsDescendantBindings:!0}},update:function(t,i,r,f,e){var h=i(),o;i=s.a.c(h);r=!0;f=null;"string"==typeof i?i={}:(h=i.name,"if"in i&&(r=s.a.c(i["if"])),r&&"ifnot"in i&&(r=!s.a.c(i.ifnot)),o=s.a.c(i.data));"foreach"in i?f=s.uc(h||t,r&&i.foreach||[],i,t,e):r?(e="data"in i?e.createChildContext(o,i.as):e,f=s.Ya(h||t,e,i,t)):s.f.ja(t);e=f;(o=s.a.e.get(t,u))&&"function"==typeof o.K&&o.K();s.a.e.set(t,u,e&&e.Z()?e:n)}};s.h.ha.template=function(n){return n=s.h.Wa(n),1==n.length&&n[0].unknown||s.h.lc(n,"name")?null:"This template engine does not support anonymous templates nested within its templates"};s.f.Q.template=!0}();s.b("setTemplateEngine",s.ab);s.b("renderTemplate",s.Ya);s.a.wb=function(n,t,i){if(n.length&&t.length)for(var o,r,f,e,u=o=0;(!i||u<i)&&(f=n[o]);++o){for(r=0;e=t[r];++r)if(f.value===e.value){f.moved=e.index;e.moved=f.index;t.splice(r,1);u=r=0;break}u+=r}};s.a.Fa=function(){function n(n,t,i,r,u){for(var o=Math.min,l=Math.max,a=[],c=n.length,f,h=t.length,v=h-c||1,w=c+h+1,y,p,b,e=0;e<=c;e++)for(p=y,a.push(y=[]),b=o(h,e+v),f=l(0,e-1);f<=b;f++)y[f]=f?e?n[e-1]===t[f-1]?p[f-1]:o(p[f]||w,y[f-1]||w)+1:f+1:e+1;for(o=[],l=[],v=[],e=c,f=h;e||f;)h=a[e][f]-1,f&&h===a[e][f-1]?l.push(o[o.length]={status:i,value:t[--f],index:f}):e&&h===a[e-1][f]?v.push(o[o.length]={status:r,value:n[--e],index:e}):(--f,--e,u.sparse||o.push({status:"retained",value:t[f]}));return s.a.wb(l,v,10*c),o.reverse()}return function(t,i,r){return r="boolean"==typeof r?{dontLimitMoves:r}:r||{},t=t||[],i=i||[],t.length<=i.length?n(t,i,"added","deleted",r):n(i,t,"deleted","added",r)}}();s.b("utils.compareArrays",s.a.Fa),function(){function i(t,i,r,u,f){var e=[],o=s.j(function(){var n=i(r,f,s.a.ka(e,t))||[];0<e.length&&(s.a.Lb(e,n),u&&s.k.B(u,null,[r,n,f]));e.length=0;s.a.ga(e,n)},null,{o:t,Ia:function(){return!s.a.ob(e)}});return{$:e,j:o.Z()?o:n}}var t=s.a.e.F();s.a.Za=function(r,u,f,e,o){function rt(n,t){h=d[t];nt!==t&&(it[n]=h);h.Na(nt++);s.a.ka(h.$,r);g.push(h);w.push(h)}function y(n,t){if(n)for(var i=0,r=t.length;i<r;i++)t[i]&&s.a.u(t[i].$,function(r){n(r,i,t[i].sa)})}var c,v,ut;u=u||[];e=e||{};var v=s.a.e.get(r,t)===n,d=s.a.e.get(r,t)||[],p=s.a.Da(d,function(n){return n.sa}),l=s.a.Fa(p,u,e.dontLimitMoves),g=[],a=0,nt=0,tt=[],w=[];u=[];for(var it=[],p=[],h,c=0,b,k;b=l[c];c++)switch(k=b.moved,b.status){case"deleted":k===n&&(h=d[a],h.j&&h.j.K(),tt.push.apply(tt,s.a.ka(h.$,r)),e.beforeRemove&&(u[c]=h,w.push(h)));a++;break;case"retained":rt(c,a++);break;case"added":k!==n?rt(c,k):(h={sa:b.value,Na:s.p(nt++)},g.push(h),w.push(h),v||(p[c]=h))}for(y(e.beforeMove,it),s.a.u(tt,e.beforeRemove?s.R:s.removeNode),c=0,v=s.f.firstChild(r);h=w[c];c++){for(h.$||s.a.extend(h,i(r,f,h.sa,o,h.Na)),a=0;l=h.$[a];v=l.nextSibling,ut=l,a++)l!==v&&s.f.Bb(r,l,ut);!h.ic&&o&&(o(h.sa,h.$,h.Na),h.ic=!0)}y(e.beforeRemove,u);y(e.afterMove,it);y(e.afterAdd,p);s.a.e.set(r,t,g)}}();s.b("utils.setDomNodeChildrenFromArrayMapping",s.a.Za);s.O=function(){this.allowTemplateRewriting=!1};s.O.prototype=new s.H;s.O.prototype.renderTemplateSource=function(n){var t=(9>s.a.L?0:n.nodes)?n.nodes():null;return t?s.a.S(t.cloneNode(!0).childNodes):(n=n.text(),s.a.ba(n))};s.O.Oa=new s.O;s.ab(s.O.Oa);s.b("nativeTemplateEngine",s.O),function(){s.Sa=function(){var n=this.kc=function(){if(!t||!t.tmpl)return 0;try{if(0<=t.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(n){}return 1}();this.renderTemplateSource=function(i,u,f){if(f=f||{},2>n)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var e=i.data("precompiled");return e||(e=i.text()||"",e=t.template(null,"{{ko_with $item.koBindingContext}}"+e+"{{/ko_with}}"),i.data("precompiled",e)),i=[u.$data],u=t.extend({koBindingContext:u},f.templateOptions),u=t.tmpl(e,i,u),u.appendTo(r.createElement("div")),t.fragments={},u};this.createJavaScriptEvaluatorBlock=function(n){return"{{ko_code ((function() { return "+n+" })()) }}"};this.addTemplate=function(n,t){r.write("<script type='text/html' id='"+n+"'>"+t+"<\/script>")};0<n&&(t.tmpl.tag.ko_code={open:"__.push($1 || '');"},t.tmpl.tag.ko_with={open:"with($1) {",close:"} "})};s.Sa.prototype=new s.H;var n=new s.Sa;0<n.kc&&s.ab(n);s.b("jqueryTmplTemplateEngine",s.Sa)}()})})()}();!function(n){"use strict";if("function"==typeof bootstrap)bootstrap("promise",n);else if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define(n);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeQ=n}else{if("undefined"==typeof window&&"undefined"==typeof self)throw new Error("This environment was not anticipated by Q. Please file a bug.");var t="undefined"!=typeof window?window:self,i=t.Q;t.Q=n();t.Q.noConflict=function(){return t.Q=i,this}}}(function(){"use strict";function s(n){return function(){return bi.apply(n,arguments)}}function wt(n){return n===Object(n)}function bt(n){return"[object StopIteration]"===gi(n)||n instanceof k}function rt(n,t){var r,i,u;if(y&&t.stack&&"object"==typeof n&&null!==n&&n.stack&&-1===n.stack.indexOf(tt)){for(r=[],i=t;i;i=i.source)i.stack&&r.unshift(i.stack);r.unshift(n.stack);u=r.join("\n"+tt+"\n");n.stack=kt(u)}}function kt(n){for(var t,r=n.split("\n"),u=[],i=0;i<r.length;++i)t=r[i],gt(t)||dt(t)||!t||u.push(t);return u.join("\n")}function dt(n){return-1!==n.indexOf("(module.js:")||-1!==n.indexOf("(node.js:")}function ut(n){var r=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(n),t,i;return r?[r[1],Number(r[2])]:(t=/at ([^ ]+):(\d+):(?:\d+)$/.exec(n),t)?[t[1],Number(t[2])]:(i=/.*@(.+):(\d+)$/.exec(n),i?[i[1],Number(i[2])]:void 0)}function gt(n){var t=ut(n),r,i;return t?(r=t[0],i=t[1],r===vt&&i>=wi&&pt>=i):!1}function ft(){if(y)try{throw new Error;}catch(i){var n=i.stack.split("\n"),r=n[0].indexOf("@")>0?n[1]:n[2],t=ut(r);return t?(vt=t[0],t[1]):void 0}}function ni(n,t,i){return function(){return"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(t+" is deprecated, use "+i+" instead.",new Error("").stack),n.apply(n,arguments)}}function n(n){return n instanceof t?n:st(n)?ei(n):b(n)}function r(){function l(t){f=t;e.source=t;c(h,function(i,r){n.nextTick(function(){t.promiseDispatch.apply(t,r)})},void 0);h=void 0;a=void 0}var f,h=[],a=[],s=nt(r.prototype),e=nt(t.prototype);if(e.promiseDispatch=function(t,r,u){var e=i(arguments);h?(h.push(e),"when"===r&&u[1]&&a.push(u[1])):n.nextTick(function(){f.promiseDispatch.apply(f,e)})},e.valueOf=function(){if(h)return e;var n=ot(f);return o(n)&&(f=n),n},e.inspect=function(){return f?f.inspect():{state:"pending"}},n.longStackSupport&&y)try{throw new Error;}catch(v){e.stack=v.stack.substring(v.stack.indexOf("\n")+1)}return s.promise=e,s.resolve=function(t){f||l(n(t))},s.fulfill=function(n){f||l(b(n))},s.reject=function(n){f||l(u(n))},s.notify=function(t){f||c(a,function(i,r){n.nextTick(function(){r(t)})},void 0)},s}function e(n){if("function"!=typeof n)throw new TypeError("resolver must be a function.");var t=r();try{n(t.resolve,t.reject,t.notify)}catch(i){t.reject(i)}return t.promise}function et(t){return e(function(i,r){for(var u=0,f=t.length;f>u;u++)n(t[u]).then(i,r)})}function t(n,i,r){var f,e;return void 0===i&&(i=function(n){return u(new Error("Promise does not support operation: "+n))}),void 0===r&&(r=function(){return{state:"unknown"}}),f=nt(t.prototype),(f.promiseDispatch=function(t,r,e){var o;try{o=n[r]?n[r].apply(f,e):i.call(f,r,e)}catch(s){o=u(s)}t&&t(o)},f.inspect=r,r)&&(e=r(),"rejected"===e.state&&(f.exception=e.reason),f.valueOf=function(){var n=r();return"pending"===n.state||"rejected"===n.state?f:n.value}),f}function f(t,i,r,u){return n(t).then(i,r,u)}function ot(n){if(o(n)){var t=n.inspect();if("fulfilled"===t.state)return t.value}return n}function o(n){return n instanceof t}function st(n){return wt(n)&&"function"==typeof n.then}function ti(n){return o(n)&&"pending"===n.inspect().state}function ii(n){return!o(n)||"fulfilled"===n.inspect().state}function ri(n){return o(n)&&"rejected"===n.inspect().state}function w(){l.length=0;a.length=0;v||(v=!0)}function ui(t,i){v&&("object"==typeof process&&"function"==typeof process.emit&&n.nextTick.runAfter(function(){-1!==d(a,t)&&(process.emit("unhandledRejection",i,t),it.push(t))}),a.push(t),l.push(i&&"undefined"!=typeof i.stack?i.stack:"(no stack) "+i))}function fi(t){if(v){var i=d(a,t);-1!==i&&("object"==typeof process&&"function"==typeof process.emit&&n.nextTick.runAfter(function(){var n=d(it,t);-1!==n&&(process.emit("rejectionHandled",l[i],t),it.splice(n,1))}),a.splice(i,1),l.splice(i,1))}}function u(n){var i=t({when:function(t){return t&&fi(this),t?t(n):this}},function(){return this},function(){return{state:"rejected",reason:n}});return ui(i,n),i}function b(n){return t({when:function(){return n},get:function(t){return n[t]},set:function(t,i){n[t]=i},"delete":function(t){delete n[t]},post:function(t,i){return null===t||void 0===t?n.apply(void 0,i):n[t].apply(n,i)},apply:function(t,i){return n.apply(t,i)},keys:function(){return di(n)}},void 0,function(){return{state:"fulfilled",value:n}})}function ei(t){var i=r();return n.nextTick(function(){try{t.then(i.resolve,i.reject,i.notify)}catch(n){i.reject(n)}}),i.promise}function oi(i){return t({isDef:function(){}},function(n,t){return ct(i,n,t)},function(){return n(i).inspect()})}function ht(t,i,r){return n(t).spread(i,r)}function si(t){return function(){function i(t,i){var s;if("undefined"==typeof StopIteration){try{s=e[t](i)}catch(h){return u(h)}return s.done?n(s.value):f(s.value,r,o)}try{s=e[t](i)}catch(h){return bt(h)?n(h.value):u(h)}return f(s,r,o)}var e=t.apply(this,arguments),r=i.bind(i,"next"),o=i.bind(i,"throw");return r()}}function hi(t){n.done(n.async(t)())}function ci(n){throw new k(n);}function li(n){return function(){return ht([this,h(arguments)],function(t,i){return n.apply(t,i)})}}function ct(t,i,r){return n(t).dispatch(i,r)}function h(n){return f(n,function(n){var i=0,t=r();return c(n,function(r,u,e){var s;o(u)&&"fulfilled"===(s=u.inspect()).state?n[e]=s.value:(++i,f(u,function(r){n[e]=r;0==--i&&t.resolve(n)},t.reject,function(n){t.notify({index:e,value:n})}))},void 0),0===i&&t.resolve(n),t.promise})}function lt(t){if(0===t.length)return n.resolve();var i=n.defer(),r=0;return c(t,function(n,u,e){function o(n){i.resolve(n)}function s(){r--;0===r&&i.reject(new Error("Can't get fulfillment value from any promise, all promises were rejected."))}function h(n){i.notify({index:e,value:n})}var c=t[e];r++;f(c,o,s,h)},void 0),i.promise}function at(t){return f(t,function(t){return t=g(t,n),f(h(g(t,function(n){return f(n,yt,yt)})),function(){return t})})}function ai(t){return n(t).allSettled()}function vi(t,i){return n(t).then(void 0,void 0,i)}function yi(t,i){return n(t).nodeify(i)}var y=!1,tt,pt;try{throw new Error;}catch(pi){y=!!pi.stack}var vt,k,wi=ft(),yt=function(){},p=function(){function n(){for(var n,i;t.next;)t=t.next,n=t.task,t.task=void 0,i=t.domain,i&&(t.domain=void 0,i.enter()),s(n,i);for(;e.length;)n=e.pop(),s(n);r=!1}function s(t,i){try{t()}catch(r){if(f)throw i&&i.exit(),setTimeout(n,0),i&&i.enter(),r;setTimeout(function(){throw r;},0)}i&&i.exit()}var t={task:void 0,next:null},h=t,r=!1,i=void 0,f=!1,e=[],u,o;return(p=function(n){h=h.next={task:n,domain:f&&process.domain,next:null};r||(r=!0,i())},"object"==typeof process&&"[object process]"===process.toString()&&process.nextTick)?(f=!0,i=function(){process.nextTick(n)}):"function"==typeof setImmediate?i="undefined"!=typeof window?setImmediate.bind(window,n):function(){setImmediate(n)}:"undefined"!=typeof MessageChannel?(u=new MessageChannel,u.port1.onmessage=function(){i=o;u.port1.onmessage=n;n()},o=function(){u.port2.postMessage(0)},i=function(){setTimeout(n,0);o()}):i=function(){setTimeout(n,0)},p.runAfter=function(n){e.push(n);r||(r=!0,i())},p}(),bi=Function.call,i=s(Array.prototype.slice),c=s(Array.prototype.reduce||function(n,t){var i=0,r=this.length;if(1===arguments.length)for(;;){if(i in this){t=this[i++];break}if(++i>=r)throw new TypeError;}for(;r>i;i++)i in this&&(t=n(t,this[i],i));return t}),d=s(Array.prototype.indexOf||function(n){for(var t=0;t<this.length;t++)if(this[t]===n)return t;return-1}),g=s(Array.prototype.map||function(n,t){var i=this,r=[];return c(i,function(u,f,e){r.push(n.call(t,f,e,i))},void 0),r}),nt=Object.create||function(n){function t(){}return t.prototype=n,new t},ki=s(Object.prototype.hasOwnProperty),di=Object.keys||function(n){var i=[],t;for(t in n)ki(n,t)&&i.push(t);return i},gi=s(Object.prototype.toString);k="undefined"!=typeof ReturnValue?ReturnValue:function(n){this.value=n};tt="From previous event:";n.resolve=n;n.nextTick=p;n.longStackSupport=!1;"object"==typeof process&&process&&process.env&&process.env.Q_DEBUG&&(n.longStackSupport=!0);n.defer=r;r.prototype.makeNodeResolver=function(){var n=this;return function(t,r){t?n.reject(t):n.resolve(arguments.length>2?i(arguments,1):r)}};n.Promise=e;n.promise=e;e.race=et;e.all=h;e.reject=u;e.resolve=n;n.passByCopy=function(n){return n};t.prototype.passByCopy=function(){return this};n.join=function(t,i){return n(t).join(i)};t.prototype.join=function(t){return n([this,t]).spread(function(n,t){if(n===t)return n;throw new Error("Can't join: not the same: "+n+" "+t);})};n.race=et;t.prototype.race=function(){return this.then(n.race)};n.makePromise=t;t.prototype.toString=function(){return"[object Promise]"};t.prototype.then=function(t,i,f){function h(n){try{return"function"==typeof t?t(n):n}catch(i){return u(i)}}function c(n){if("function"==typeof i){rt(n,s);try{return i(n)}catch(t){return u(t)}}return u(n)}function l(n){return"function"==typeof f?f(n):n}var s=this,e=r(),o=!1;return n.nextTick(function(){s.promiseDispatch(function(n){o||(o=!0,e.resolve(h(n)))},"when",[function(n){o||(o=!0,e.resolve(c(n)))}])}),s.promiseDispatch(void 0,"when",[void 0,function(t){var i,r=!1;try{i=l(t)}catch(u){if(r=!0,!n.onerror)throw u;n.onerror(u)}r||e.notify(i)}]),e.promise};n.tap=function(t,i){return n(t).tap(i)};t.prototype.tap=function(t){return t=n(t),this.then(function(n){return t.fcall(n).thenResolve(n)})};n.when=f;t.prototype.thenResolve=function(n){return this.then(function(){return n})};n.thenResolve=function(t,i){return n(t).thenResolve(i)};t.prototype.thenReject=function(n){return this.then(function(){throw n;})};n.thenReject=function(t,i){return n(t).thenReject(i)};n.nearer=ot;n.isPromise=o;n.isPromiseAlike=st;n.isPending=ti;t.prototype.isPending=function(){return"pending"===this.inspect().state};n.isFulfilled=ii;t.prototype.isFulfilled=function(){return"fulfilled"===this.inspect().state};n.isRejected=ri;t.prototype.isRejected=function(){return"rejected"===this.inspect().state};var l=[],a=[],it=[],v=!0;return n.resetUnhandledRejections=w,n.getUnhandledReasons=function(){return l.slice()},n.stopUnhandledRejectionTracking=function(){w();v=!1},w(),n.reject=u,n.fulfill=b,n.master=oi,n.spread=ht,t.prototype.spread=function(n,t){return this.all().then(function(t){return n.apply(void 0,t)},t)},n.async=si,n.spawn=hi,n["return"]=ci,n.promised=li,n.dispatch=ct,t.prototype.dispatch=function(t,i){var f=this,u=r();return n.nextTick(function(){f.promiseDispatch(u.resolve,t,i)}),u.promise},n.get=function(t,i){return n(t).dispatch("get",[i])},t.prototype.get=function(n){return this.dispatch("get",[n])},n.set=function(t,i,r){return n(t).dispatch("set",[i,r])},t.prototype.set=function(n,t){return this.dispatch("set",[n,t])},n.del=n["delete"]=function(t,i){return n(t).dispatch("delete",[i])},t.prototype.del=t.prototype["delete"]=function(n){return this.dispatch("delete",[n])},n.mapply=n.post=function(t,i,r){return n(t).dispatch("post",[i,r])},t.prototype.mapply=t.prototype.post=function(n,t){return this.dispatch("post",[n,t])},n.send=n.mcall=n.invoke=function(t,r){return n(t).dispatch("post",[r,i(arguments,2)])},t.prototype.send=t.prototype.mcall=t.prototype.invoke=function(n){return this.dispatch("post",[n,i(arguments,1)])},n.fapply=function(t,i){return n(t).dispatch("apply",[void 0,i])},t.prototype.fapply=function(n){return this.dispatch("apply",[void 0,n])},n["try"]=n.fcall=function(t){return n(t).dispatch("apply",[void 0,i(arguments,1)])},t.prototype.fcall=function(){return this.dispatch("apply",[void 0,i(arguments)])},n.fbind=function(t){var r=n(t),u=i(arguments,1);return function(){return r.dispatch("apply",[this,u.concat(i(arguments))])}},t.prototype.fbind=function(){var n=this,t=i(arguments);return function(){return n.dispatch("apply",[this,t.concat(i(arguments))])}},n.keys=function(t){return n(t).dispatch("keys",[])},t.prototype.keys=function(){return this.dispatch("keys",[])},n.all=h,t.prototype.all=function(){return h(this)},n.any=lt,t.prototype.any=function(){return lt(this)},n.allResolved=ni(at,"allResolved","allSettled"),t.prototype.allResolved=function(){return at(this)},n.allSettled=ai,t.prototype.allSettled=function(){return this.then(function(t){return h(g(t,function(t){function i(){return t.inspect()}return t=n(t),t.then(i,i)}))})},n.fail=n["catch"]=function(t,i){return n(t).then(void 0,i)},t.prototype.fail=t.prototype["catch"]=function(n){return this.then(void 0,n)},n.progress=vi,t.prototype.progress=function(n){return this.then(void 0,void 0,n)},n.fin=n["finally"]=function(t,i){return n(t)["finally"](i)},t.prototype.fin=t.prototype["finally"]=function(t){return t=n(t),this.then(function(n){return t.fcall().then(function(){return n})},function(n){return t.fcall().then(function(){throw n;})})},n.done=function(t,i,r,u){return n(t).done(i,r,u)},t.prototype.done=function(t,i,r){var u=function(t){n.nextTick(function(){if(rt(t,f),!n.onerror)throw t;n.onerror(t)})},f=t||i||r?this.then(t,i,r):this;"object"==typeof process&&process&&process.domain&&(u=process.domain.bind(u));f.then(void 0,u)},n.timeout=function(t,i,r){return n(t).timeout(i,r)},t.prototype.timeout=function(n,t){var i=r(),u=setTimeout(function(){t&&"string"!=typeof t||(t=new Error(t||"Timed out after "+n+" ms"),t.code="ETIMEDOUT");i.reject(t)},n);return this.then(function(n){clearTimeout(u);i.resolve(n)},function(n){clearTimeout(u);i.reject(n)},i.notify),i.promise},n.delay=function(t,i){return void 0===i&&(i=t,t=void 0),n(t).delay(i)},t.prototype.delay=function(n){return this.then(function(t){var i=r();return setTimeout(function(){i.resolve(t)},n),i.promise})},n.nfapply=function(t,i){return n(t).nfapply(i)},t.prototype.nfapply=function(n){var t=r(),u=i(n);return u.push(t.makeNodeResolver()),this.fapply(u).fail(t.reject),t.promise},n.nfcall=function(t){var r=i(arguments,1);return n(t).nfapply(r)},t.prototype.nfcall=function(){var t=i(arguments),n=r();return t.push(n.makeNodeResolver()),this.fapply(t).fail(n.reject),n.promise},n.nfbind=n.denodeify=function(t){var u=i(arguments,1);return function(){var e=u.concat(i(arguments)),f=r();return e.push(f.makeNodeResolver()),n(t).fapply(e).fail(f.reject),f.promise}},t.prototype.nfbind=t.prototype.denodeify=function(){var t=i(arguments);return t.unshift(this),n.denodeify.apply(void 0,t)},n.nbind=function(t,u){var f=i(arguments,2);return function(){function s(){return t.apply(u,arguments)}var o=f.concat(i(arguments)),e=r();return o.push(e.makeNodeResolver()),n(s).fapply(o).fail(e.reject),e.promise}},t.prototype.nbind=function(){var t=i(arguments,0);return t.unshift(this),n.nbind.apply(void 0,t)},n.nmapply=n.npost=function(t,i,r){return n(t).npost(i,r)},t.prototype.nmapply=t.prototype.npost=function(n,t){var f=i(t||[]),u=r();return f.push(u.makeNodeResolver()),this.dispatch("post",[n,f]).fail(u.reject),u.promise},n.nsend=n.nmcall=n.ninvoke=function(t,u){var e=i(arguments,2),f=r();return e.push(f.makeNodeResolver()),n(t).dispatch("post",[u,e]).fail(f.reject),f.promise},t.prototype.nsend=t.prototype.nmcall=t.prototype.ninvoke=function(n){var u=i(arguments,1),t=r();return u.push(t.makeNodeResolver()),this.dispatch("post",[n,u]).fail(t.reject),t.promise},n.nodeify=yi,t.prototype.nodeify=function(t){return t?void this.then(function(i){n.nextTick(function(){t(null,i)})},function(i){n.nextTick(function(){t(i)})}):this},n.noConflict=function(){throw new Error("Q.noConflict only works when Q is used as a global");},pt=ft(),n});!function(n,t){var i=function(){return t(n)};"object"==typeof exports&&"object"==typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):breeze=i()}(this,function(n){"use strict";function rt(n,t){for(var i in n)et(n,i)&&t(i,n[i])}function fi(n,t){var u=[],i,r;for(i in n)et(n,i)&&(r=t?t(i,n[i]):n[i],void 0!==r&&u.push(r));return u}function wr(n,t){var i,r;for(i in n)if(et(n,i)&&(r=n[i],t(i,r)))return{key:i,value:r};return null}function au(n,t){var i=er(n,t);return null==i?!0:!(!i.writable&&!i.set)}function er(n,t){if(!ou)return null;if(n.hasOwnProperty(t))return Object.getOwnPropertyDescriptor(n,t);var i=Object.getPrototypeOf(n);return null==i?null:er(i,t)}function ki(n,t){return function(i){return i[n]===t}}function ei(n){return function(t){return t[n]}}function br(n){var i=[],t;for(t in n)et(n,t)&&i.push(n[t]);return i}function s(n,t,i){if(!t)return n;if(i)i.forEach(function(i){n[i]=t[i]});else for(var r in t)et(t,r)&&(n[r]=t[r]);return n}function di(n,t){for(var i in t)void 0===n[i]&&(n[i]=t[i]);return n}function oi(n,t){return t.defaultInstance=di(new t(n),t.defaultInstance),n}function ht(n,t,i){var u,f,r;i=i||{};for(u in t)f=u.split(","),r=t[u],f.some(function(t){if(!(t in n))return!1;var u=n[t];return"function"==typeof u?!1:u==r?!0:Array.isArray(u)&&0===u.length?!0:("function"==typeof r?u=r(u):"object"==typeof u&&u&&u.parentEnum&&(u=u.name),void 0===u?!0:(i[f[0]]=u,!0))});return i}function bt(n,t){var r,u,f,i;if(n!==Object(n))return n;if(n._$visited)return void 0;if(n.toJSON){if(r=n.toJSON(),r!==Object(r))return r;if(r!==n)return bt(r);n=r}if(n._$visited=!0,n instanceof Array)u=n.map(function(n){return bt(n,t)});else if("function"==typeof n)u=void 0;else{u={};for(f in n)"_$visited"!==f&&(i=n[f],t&&(i=t(f,i),void 0===i)||(i=bt(i),void 0!==i&&(u[f]=i)))}return delete n._$visited,u}function kr(n,t){var i={},r=n.length;return t.forEach(function(t){for(var f,e,u=0;r>u;u++)if(f=n[u],f&&(e=f[t],void 0!==e)){i[t]=e;break}}),i}function p(n){return null==n?[]:Array.isArray(n)?n:[n]}function si(n,t,i){if(i=null==i?!0:i,null==n)return n;var r;return Array.isArray(n)?(r=[],n.forEach(function(n,u){var f=t(n,u);(null!=f||i)&&(r[u]=f)})):r=t(n),r}function tt(n,t){for(var i=0,r=n.length;r>i;i++)if(t(n[i]))return n[i];return null}function or(n,t){for(var i=0,r=n.length;r>i;i++)if(t(n[i]))return i;return-1}function kt(n,t){var i=n.indexOf(t);-1===i&&n.push(t)}function sr(n,t,i){for(var u=li(t)?t:void 0,e=n.length-1,f=!1,r=e;r>=0;r--)if((u?u(n[r]):n[r]===t)&&(n.splice(r,1),f=!0,!i))return!0;return f}function gi(n,t,i){for(var u=[],f=Math.min(n.length,t.length),r=0;f>r;++r)u.push(i(n[r],t[r]));return u}function hi(n,t,i){if(!n||!t||n.length!==t.length)return!1;for(var r=0;r<n.length;r++)if(Array.isArray(n[r])){if(!hi(n[r],t[r]))return!1}else if(i){if(!i(n[r],t[r]))return!1}else if(n[r]!==t[r])return!1;return!0}function nr(n,t){var i=n[t];return i||(i=[],n[t]=i),i}function vu(n,t){for(var r,u=n.split(";"),i=0,f=u.length;f>i;i++)if(r=hr(u[i]),r)return r;if(t)throw new Error("Unable to initialize "+n+".  "+t);}function hr(t){var r=n.window,u,i;if(r){if(u=r[t],u)return u;if(i=r.require,i){if(i.defined)return i.defined(t)?i(t):void 0;try{return i(t)}catch(f){return}}}}function vt(n,t,i,r){var u=n[t];if(i===u)return r();n[t]=i;try{return r()}finally{void 0===u?delete n[t]:n[t]=u}}function dr(n,t,i){var r;try{return r=n(),i()}catch(u){throw"object"==typeof r&&(r.error=u),u;}finally{t(r)}}function gr(n){return function(){for(var r=w(arguments),i="",u=r.length,t=null;u--;)t=r[u],i+=t===Object(t)?JSON.stringify(t):t,n.memoize||(n.memoize={});return i in n.memoize?n.memoize[i]:n.memoize[i]=n.apply(this,r)}}function ci(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var t=16*Math.random()|0,i="x"==n?t:3&t|8;return i.toString(16)})}function nu(n){var r,t;if("string"!=typeof n)throw new Error("Invalid ISO8601 duration '"+n+"'");if(r=/^P((\d+Y)?(\d+M)?(\d+D)?)?(T(\d+H)?(\d+M)?(\d+S)?)?$/.exec(n),!r)throw new Error("Invalid ISO8601 duration '"+n+"'");for(var f=[2,3,4,6,7,8],e=[31104e3,2592e3,86400,3600,60,1],u=0,i=0;6>i;i++)t=r[f[i]],t=t?+t.replace(/[A-Za-z]+/g,""):0,u+=t*e[i];return u}function tu(){}function yu(n){return n}function iu(n){return null===n?"null":void 0===n?"undefined":Object.prototype.toString.call(n).slice(8,-1).toLowerCase()}function ct(n){return"date"===iu(n)&&!isNaN(n.getTime())}function pu(n){return"string"==typeof n&&/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/.test(n)}function li(n){return"function"===iu(n)}function ai(n){return"string"==typeof n}function wu(n){return"object"==typeof n}function tr(n){return"string"==typeof n&&/[a-fA-F\d]{8}-(?:[a-fA-F\d]{4}-){3}[a-fA-F\d]{12}/.test(n)}function ir(n){return"string"==typeof n&&/^(-|)?P[T]?[\d\.,\-]+[YMDTHS]/.test(n)}function ut(n){if(null===n||void 0===n)return!0;for(var t in n)if(et(n,t))return!1;return!0}function bu(n){return!isNaN(parseFloat(n))&&isFinite(n)}function dt(n,t){return n?""==t||null==t?!0:0===n.indexOf(t,0):!1}function cr(n,t){return n?""==t||null==t?!0:-1!==n.indexOf(t,n.length-t.length):!1}function d(n){var t=arguments,i=RegExp("%([1-"+(arguments.length-1)+"])","g");return n.replace(i,function(n,i){return t[i]})}function ru(n){var t=Function.call;return function(){return t.apply(n,arguments)}}function ku(n,t,i){var f,r,h,u,o,s,e;if(void 0===t&&(t=null),f=i(),r=n.dataType,r&&r.parse&&(t=Array.isArray(t)&&!n.isScalar?t.map(function(n){return r.parse(n,typeof n)}):r.parse(t,typeof t)),!(t===f||r&&r.isDate&&t&&f&&t.valueOf()===f.valueOf())){if(u=this.entityAspect,u)h=n.name;else{if(o=this.complexAspect,!o)return void i(t);u=o.getEntityAspect();h=o.getPropertyPath(n.name)}if(s=u._inProcess=u._inProcess||[],!(s.indexOf(n)>=0)){s.push(n);try{e={parent:this,property:n,newValue:t,oldValue:f,propertyName:h,entityAspect:u};n.isComplexProperty?gu(e,i):n.isDataProperty?du(e,i):nf(e,i);tf(e)}finally{s.pop()}}}}function du(n,t){var i=n.parent,u=n.property,v=n.entityAspect,a=n.oldValue,o=n.newValue,r=v.entityManager,l=i.entityType,y,p,k,d,c,s,f,e,b,g;if(!u.isScalar)throw new Error("Nonscalar data properties are readonly - items may be added or removed but the collection may not be changed.");if(v.entityState.isUnchangedOrModified()&&(y=u.name,p=i.entityAspect||i.complexAspect,void 0===p.originalValues[y]&&(p.originalValues[y]=void 0!==a?a:u.defaultValue)),u.isPartOfKey&&r&&!r.isLoading){var nt=l.keyProperties,tt=nt.map(function(n){return n===u?o:i.getProperty(n.name)}),w=new h(l,tt);if(r.findEntityByKey(w))throw new Error("An entity with this key is already in the cache: "+w.toString());k=i.entityAspect.getKey();d=r._findEntityGroup(l);d._replaceKey(k,w)}c=u.relatedNavigationProperty;c&&r?null!=o?(s=new h(c.entityType,[o]),f=r.findEntityByKey(s),f?i.setProperty(c.name,f):(r._unattachedChildrenMap.addChild(s,c,i),i.setProperty(c.name,null))):i.setProperty(c.name,null):u.inverseNavigationProperty&&r&&!r._inKeyFixup&&(e=u.inverseNavigationProperty,null!=a&&(s=new h(e.parentType,[a]),f=r.findEntityByKey(s))&&(e.isScalar?f.setProperty(e.name,null):(b=f.getProperty(e.name),b.splice(b.indexOf(i),1))),null!=o&&(s=new h(e.parentType,[o]),f=r.findEntityByKey(s),f?e.isScalar?f.setProperty(e.name,i):f.getProperty(e.name).push(i):r._unattachedChildrenMap.addChild(s,e,i)));(t(o),uu(n),u.isPartOfKey)&&(g=l.keyProperties.indexOf(u),l.navigationProperties.forEach(function(n){var u=n.inverse,f=u?u.foreignKeyNames:n.invForeignKeyNames,t,r;0!==f.length&&(t=i.getProperty(n.name),t&&(r=f[g],n.isScalar?t.setProperty(r,o):t.forEach(function(n){n.setProperty(r,o)})))}),r&&l.inverseForeignKeyProperties.forEach(function(n){null==n.relatedNavigationProperty.inverse&&r._updateFkVal(n,a,o)}),v.getKey(!0))}function gu(n,t){var i=n.property,r=n.oldValue,u=n.newValue,f=i.dataType,e;if(!i.isScalar)throw new Error(d("You cannot set the non-scalar complex property: '%1' on the type: '%2'.Instead get the property and use array functions like 'push' or 'splice' to change its contents.",i.name,i.parentType.name));if(!u)throw new Error(d("You cannot set the '%1' property to null because it's datatype is the ComplexType: '%2'",i.name,i.dataType.name));r||(e=f.getCtor(),r=new e,t(r));f.dataProperties.forEach(function(n){var t=n.name,i=u.getProperty(t);r.setProperty(t,i)})}function nf(n,t){var h=n.parent,e=n.property,c=n.entityAspect,f=n.oldValue,i=n.newValue,r,o,s,l,a,p,v,w,y,b;if(!e.isScalar)throw new Error("Nonscalar navigation properties are readonly - entities can be added or removed but the collection may not be changed.");if(r=c.entityManager,o=e.inverse,null!=i)if(s=i.entityAspect,r){if(s.entityState.isDetached())r.isLoading||r.attachEntity(i,u.Added);else if(s.entityManager!==r)throw new Error("An Entity cannot be attached to an entity in another EntityManager. One of the two entities must be detached first.");}else s&&s.entityManager&&(r=s.entityManager,r.isLoading||r.attachEntity(c.entity,u.Added));if(o?o.isScalar?(null!=f&&f.setProperty(o.name,null),null!=i&&i.setProperty(o.name,h)):(null!=f&&(l=f.getProperty(o.name),a=l.indexOf(h),-1!==a&&l.splice(a,1)),null!=i&&(p=i.getProperty(o.name),p.push(h))):e.invForeignKeyNames&&r&&!r._inKeyFixup&&(v=e.invForeignKeyNames,null!=i?(w=h.entityAspect.getKey().values,v.forEach(function(n,t){i.setProperty(n,w[t])})):null!=f&&v.forEach(function(n){var t=f.entityType.getProperty(n);t.isPartOfKey||f.setProperty(n,null)})),t(i),uu(n),e.relatedDataProperties){if(y=c.entityState,null==i&&(y.isDetached()||f.entityAspect.entityState.isDetached()))return;if(y.isDeleted())return;b=e.entityType.keyProperties;b.forEach(function(n,t){var r=e.relatedDataProperties[t],u;(i||!r.isPartOfKey)&&(u=i?i.getProperty(n.name):r.defaultValue,h.setProperty(r.name,u))})}}function tf(n){var t=n.entityAspect,i=t.entityManager,u=t.entity,r={entity:u,parent:n.parent,property:n.property,propertyName:n.propertyName,oldValue:n.oldValue,newValue:n.newValue};i?i.isLoading||i.isRejectingChanges||(t.propertyChanged.publish(r),i.entityChanged.publish({entityAction:g.PropertyChange,entity:u,args:r})):t.propertyChanged.publish(r)}function uu(n){var t=n.entityAspect,i=t.entityManager,r;null==i||i.isLoading||(r=n.property,t.entityState.isUnchanged()&&!r.isUnmapped&&t.setModified(),i.validationOptions.validateOnPropertyChange&&t._validateProperty(n.newValue,{entity:t.entity,property:r,propertyName:n.propertyName,oldValue:n.oldValue}))}function fu(n){var i,r,t;if(!n)return null;if(t=n.split(":#"),t.length>1)return vi(t[0],t[1]);if(dt(n,ri.ANONTYPE_PREFIX))return i=vi(n),i.isAnonymous=!0,i;if(r=n.split(",")[0],t=r.split("."),t.length>1){var u=t[t.length-1],f=t.slice(0,t.length-1),e=f.join(".");return vi(u,e)}return vi(n)}function vi(n,t){return{shortTypeName:n,namespace:t,typeName:gt(n,t)}}function eu(n){return n.indexOf(":#")>=0}function gt(n,t){return t&&t.length>0?n+":#"+t:n}function lr(n,t,i){var r,u,f;if(t)if(Array.isArray(t))t.forEach(n._addPropertyCore.bind(n));else{if("object"!=typeof t)throw new Error("The 'dataProperties' or 'navigationProperties' values must be either an array of data/nav properties or an object where each property defines a data/nav property");for(r in t)et(t,r)&&(u=t[r],u.name=r,f=new i(u),n._addPropertyCore(f))}}function rr(n,t){var r=Array.isArray(t)?t:t.split("."),i;return 1===r.length?n.getProperty(t):(i=n,r.some(function(n){return i=i.getProperty(n),null==i}),i)}var i={version:"1.5.4",metadataVersion:"1.0.5"},et=ru(Object.prototype.hasOwnProperty),w=ru(Array.prototype.slice),ou=function(){try{return!(!Object.getPrototypeOf||!Object.defineProperty({},"x",{}))}catch(n){return!1}}(),f,ot,k,v,yt,ti,g,ii,ar,h,u,r,l,yi,e,vr,pi,wi,ft,cu,yr,pr,wt,lu;Object.create||(Object.create=function(n){var t=function(){};return t.prototype=n,new t});f={};f.__isES5Supported=ou;f.objectForEach=rt;f.extend=s;f.propEq=ki;f.pluck=ei;f.arrayEquals=hi;f.arrayFirst=tt;f.arrayIndexOf=or;f.arrayRemoveItem=sr;f.arrayZip=gi;f.requireLib=vu;f.using=vt;f.memoize=gr;f.getUuid=ci;f.durationToSeconds=nu;f.isDate=ct;f.isGuid=tr;f.isDuration=ir;f.isFunction=li;f.isEmpty=ut;f.isNumeric=bu;f.stringStartsWith=dt;f.stringEndsWith=cr;f.formatString=d;f.getPropertyDescriptor=er;f.toJSONSafe=bt;f.parent=i;i.core=f;var ur=function(){function f(n,t){return null==t?!1:"string"==typeof t&&t.length>0}function e(n,t){return null==t?!1:typeof t===n.typeName?!0:!1}function o(n,t){return null==t?!1:t instanceof n.type}function h(n,t){return null==t?!1:void 0!==t[n.propertyName]}function c(n,t){return null==t?!1:n.enumType.contains(t)}function l(n,t){return n.allowNull?void 0!==t:null!=t}function a(n,t){if(null==t)return!0;var i=n.prevContext;return i?i.fn(i,t):!0}function v(n,t){var r=n.prevContext,u=r?" or it "+i(r,t):"";return"is optional"+u}function y(n,t){if(!Array.isArray(t)||n.mustNotBeEmpty&&0===t.length)return!1;var i=n.prevContext;return i?t.every(function(n){return i.fn(i,n)}):!0}function p(n,t){var u=n.mustNotBeEmpty?"a nonEmpty array":"an array",r=n.prevContext,f=r?" where each element "+i(r,t):"";return" must be "+u+f}function i(n,t){var i=n.msg;return"function"==typeof i&&(i=i(n,t)),i}function t(n,t){if(n._context){for(var i=n._context;null!=i.prevContext;)i=i.prevContext;if(null===i.prevContext)return i.prevContext=t,n;if(null!=t.prevContext)throw new Error("Illegal construction - use 'or' to combine checks");t.prevContext=n._context}return w(n,t)}function w(n,t){return n._contexts[n._contexts.length-1]=t,n._context=t,n}function b(n){var t=n._contexts;return null==t[t.length-1]&&t.pop(),0===t.length?void 0:t.some(function(t){return t.fn(t,n.v)})}function r(n,t){throw new Error(d("Error configuring an instance of '%1'. %2",n&&n._$typeName||"object",t));}var u=function(n,t){this.v=n;this.name=t;this._contexts=[null]},n=u.prototype;return n.isObject=function(){return this.isTypeOf("object")},n.isBoolean=function(){return this.isTypeOf("boolean")},n.isString=function(){return this.isTypeOf("string")},n.isNonEmptyString=function(){return t(this,{fn:f,msg:"must be a nonEmpty string"})},n.isNumber=function(){return this.isTypeOf("number")},n.isFunction=function(){return this.isTypeOf("function")},n.isTypeOf=function(n){return t(this,{fn:e,typeName:n,msg:"must be a '"+n+"'"})},n.isInstanceOf=function(n,i){return i=i||n.prototype._$typeName,t(this,{fn:o,type:n,typeName:i,msg:"must be an instance of '"+i+"'"})},n.hasProperty=function(n){return t(this,{fn:h,propertyName:n,msg:"must have a '"+n+"' property"})},n.isEnumOf=function(n){return t(this,{fn:c,enumType:n,msg:"must be an instance of the '"+n.name+"' enumeration"})},n.isRequired=function(n){return t(this,{fn:l,allowNull:n,msg:"is required"})},n.isOptional=function(){var n={fn:a,prevContext:null,msg:v};return t(this,n)},n.isNonEmptyArray=function(){return this.isArray(!0)},n.isArray=function(n){var i={fn:y,mustNotBeEmpty:n,prevContext:null,msg:p};return t(this,i)},n.or=function(){return this._contexts.push(null),this._context=null,this},n.check=function(n){var t=b(this);if(void 0!==t){if(!t)throw new Error(this.getMessage());return void 0!==this.v?this.v:n}},n._addContext=function(n){return t(this,n)},n.getMessage=function(){var n=this,t=this._contexts.map(function(t){return i(t,n.v)}).join(", or it ");return d(this.MESSAGE_PREFIX,this.name)+" "+t},n.withDefault=function(n){return this.defaultValue=n,this},n.whereParam=function(n){return this.parent.whereParam(n)},n.applyAll=function(n,t){var f=n._$typeName,e=f&&this.parent.config._$typeName===f,i=s({},this.parent.config),u;if(this.parent.params.forEach(function(u){e||delete i[u.name];try{u.check()}catch(f){r(n,f.message)}t||u._applyOne(n)}),!e)for(u in i)void 0!==i[u]&&r(n,d("Unknown property: '%1'.",u))},n._applyOne=function(n){void 0!==this.v?n[this.name]=this.v:void 0!==this.defaultValue&&(n[this.name]=this.defaultValue)},n.MESSAGE_PREFIX="The '%1' parameter ",u}(),t=function(n,t){return new ur(n,t)},rf=function(){var n=function(n){if("object"!=typeof n)throw new Error("Configuration parameter should be an object, instead it is a: "+typeof n);this.config=n;this.params=[]},t=n.prototype;return t.whereParam=function(n){var t=new ur(this.config[n],n);return t.parent=this,this.params.push(t),t},n}(),c=function(n){return new rf(n)};f.Param=ur;f.assertParam=t;f.assertConfig=c;ot=function(){function n(){}var i=function(t,i){this.name=t;var r=new n(i);r.parentEnum=this;this._symbolPrototype=r;i&&Object.keys(i).forEach(function(n){r[n]=i[n]})},t=i.prototype;return i.isSymbol=function(t){return t instanceof n},t.fromName=function(n){return this[n]},t.addSymbol=function(n){var t=Object.create(this._symbolPrototype);return n&&Object.keys(n).forEach(function(i){t[i]=n[i]}),setTimeout(function(){t.getName()},0),t},t.resolveSymbols=function(){this.getSymbols().forEach(function(n){return n.getName()})},t.getSymbols=function(){return this.getNames().map(function(n){return this[n]},this)},t.getNames=function(){var t=[],n;for(n in this)this.hasOwnProperty(n)&&("name"===n||"_"===n.substr(0,1)||li(this[n])||t.push(n));return t},t.contains=function(t){return t instanceof n?this[t.getName()]===t:!1},n.prototype.getName=function(){if(!this.name){var n=this;this.name=tt(this.parentEnum.getNames(),function(t){return n.parentEnum[t]===n})}return this.name},n.prototype.toString=function(){return this.getName()},n.prototype.toJSON=function(){return{_$typeName:this.parentEnum.name,name:this.name}},i}();f.Enum=ot;k=function(){function r(n,t,i){var r=n._subscribers;return r?void r.forEach(function(r){try{r.callback(t)}catch(u){u.context="unable to publish on topic: "+n.name;i?i(u):n._defaultErrorCallback?n._defaultErrorCallback(u):f(u)}}):!0}function f(){}var e={},u=1,n=function(n,i,r){t(n,"eventName").isNonEmptyString().check();t(i,"publisher").isObject().check();this.name=n;e[n]=!0;this.publisher=i;r&&(this._defaultErrorCallback=r)},i=n.prototype;return i.publish=function(t,i,u){return n._isEnabled(this.name,this.publisher)?(i===!0?setTimeout(r,0,this,t,u):r(this,t,u),!0):!1},i.publishAsync=function(n,t){this.publish(n,!0,t)},i.subscribe=function(n){this._subscribers||(this._subscribers=[]);var t=u;return this._subscribers.push({unsubKey:t,callback:n}),++u,t},i.unsubscribe=function(n){if(!this._subscribers)return!1;var t=this._subscribers,i=or(t,function(t){return t.unsubKey===n});return-1!==i?(t.splice(i,1),0===t.length&&(this._subscribers=null),!0):!1},i.clear=function(){this._subscribers=null},n.bubbleEvent=function(n,t){n._getEventParent=t},n.enable=function(n,i,r){t(n,"eventName").isNonEmptyString().check();t(i,"obj").isObject().check();t(r,"isEnabled").isBoolean().isOptional().or().isFunction().check();i._$eventMap||(i._$eventMap={});i._$eventMap[n]=r},n.isEnabled=function(i,r){if(t(i,"eventName").isNonEmptyString().check(),t(r,"obj").isObject().check(),void 0===r._getEventParent)throw new Error("This object does not support event enabling/disabling");return n._isEnabled(i,r)},n._isEnabled=function(t,i){var r=null,f=i._$eventMap,u;return(f&&(r=f[t]),null!=r)?"function"==typeof r?r(i):!!r:(u=i._getEventParent&&i._getEventParent(),u?n._isEnabled(t,u):!0)},n}();f.Event=k;v=function(){function u(t,i,r){var u=i.defaultInstance;return u||(u=new i.ctor,i.defaultInstance=u,u._$impl=i),u.initialize(),r&&(t.defaultInstance=u),n.interfaceInitialized.publish({interfaceName:t.name,instance:u,isDefault:!0}),u.checkForRecomposition&&n.interfaceInitialized.subscribe(function(n){u.checkForRecomposition(n)}),u}function r(t){var r=t.toLowerCase(),i=wr(n.interfaceRegistry||{},function(n){return n.toLowerCase()===r});if(!i)throw new Error("Unknown interface name: "+t);return i.value}var n={},i;return n.functionRegistry={},n.typeRegistry={},n.objectRegistry={},n.interfaceInitialized=new k("interfaceInitialized",n),i=function(n){this.name=n;this.defaultInstance=null;this._implMap={}},i.prototype.registerCtor=function(n,t){this._implMap[n.toLowerCase()]={ctor:t,defaultInstance:null}},i.prototype.getImpl=function(n){return this._implMap[n.toLowerCase()]},i.prototype.getFirstImpl=function(){var n=wr(this._implMap,function(){return!0});return n?n.value:null},n.interfaceRegistry={ajax:new i("ajax"),modelLibrary:new i("modelLibrary"),dataService:new i("dataService"),uriBuilder:new i("uriBuilder")},n.interfaceRegistry.modelLibrary.getDefaultInstance=function(){if(!this.defaultInstance)throw new Error("Unable to locate the default implementation of the '"+this.name+"' interface.  Possible options are 'ko', 'backingStore' or 'backbone'. See the breeze.config.initializeAdapterInstances method.");return this.defaultInstance},n.setProperties=function(t){c(t).whereParam("remoteAccessImplementation").isOptional().whereParam("trackingImplementation").isOptional().whereParam("ajaxImplementation").isOptional().applyAll(t);t.remoteAccessImplementation&&n.initializeAdapterInstance("dataService",t.remoteAccessImplementation);t.trackingImplementation&&n.initializeAdapterInstance("modelLibrary",t.trackingImplementation);t.ajaxImplementation&&n.initializeAdapterInstance("ajax",t.ajaxImplementation)},n.registerAdapter=function(n,i){var f,u,e;if(t(n,"interfaceName").isNonEmptyString().check(),t(i,"adapterCtor").isFunction().check(),f=new i,u=f.name,!u)throw new Error("Unable to locate a 'name' property on the constructor passed into the 'registerAdapter' call.");e=r(n);e.registerCtor(u,i)},n.getAdapter=function(n,t){var i=r(n),u;return t?(u=i.getImpl(t),u?u.ctor:null):i.defaultInstance?i.defaultInstance._$impl.ctor:null},n.initializeAdapterInstances=function(t){return c(t).whereParam("dataService").isOptional().whereParam("modelLibrary").isOptional().whereParam("ajax").isOptional().whereParam("uriBuilder").isOptional().applyAll(this,!1),fi(t,n.initializeAdapterInstance)},n.initializeAdapterInstance=function(n,i,f){f=void 0===f?!0:f;t(n,"interfaceName").isNonEmptyString().check();t(i,"adapterName").isNonEmptyString().check();t(f,"isDefault").isBoolean().check();var e=r(n),o=e.getImpl(i);if(!o)throw new Error("Unregistered adapter.  Interface: "+n+" AdapterName: "+i);return u(e,o,f)},n.getAdapterInstance=function(n,t){var i,f=r(n),e=null==t||""==t;if(e){if(f.defaultInstance)return f.defaultInstance;i=f.getFirstImpl()}else i=f.getImpl(t);return i?i.defaultInstance?i.defaultInstance:u(f,i,e):null},n.registerFunction=function(i,r){t(i,"fn").isFunction().check();t(r,"fnName").isString().check();i.prototype._$fnName=r;n.functionRegistry[r]=i},n.getRegisteredFunction=function(t){return n.functionRegistry[t]},n._storeObject=function(t,i,r){var u=("string"==typeof i?i:i.prototype._$typeName)+"."+r;n.objectRegistry[u]=t},n._fetchObject=function(t,i){if(!i)return void 0;var r=("string"==typeof t?t:t.prototype._$typeName)+"."+i,u=n.objectRegistry[r];if(!u)throw new Error("Unable to locate a registered object by the name: "+r);return u},n.registerType=function(i,r){t(i,"ctor").isFunction().check();t(r,"typeName").isString().check();i.prototype._$typeName=r;n.typeRegistry[r]=i},n.stringifyPad="",n}();yt=v.interfaceRegistry.modelLibrary;f.config=v;i.config=v;var ni=function(){function u(n){var t=n.getEntityAspect();t.entityState.isUnchanged()&&t.setModified();t.entityState.isModified()&&!n._origValues&&(n._origValues=n.slice(0))}function t(n,t){n._processAdds(t);r(n,"arrayChanged",{array:n,added:t})}function i(n,t){n._processRemoves(t);r(n,"arrayChanged",{array:n,removed:t})}function r(n,t,i){var r=n._getPendingPubs();r?n._pendingArgs?f(n._pendingArgs,i):(n._pendingArgs=i,r.push(function(){n[t].publish(n._pendingArgs);n._pendingArgs=null})):n[t].publish(i)}function f(n,t){var i,u,r;for(i in t)if("array"!==i&&n.hasOwnProperty(i))if(u=t[i],r=n[i],r){if(!Array.isArray(r))throw new Error("Cannot combine non array args");Array.prototype.push.apply(r,u)}else n[i]=u}function e(n,t,i){n.parent=t;n.parentProperty=i}var n={};return n.push=function(){var n,i;return this._inProgress?-1:(n=this._getGoodAdds(w(arguments)),!n.length)?this.length:(this._beforeChange(),i=Array.prototype.push.apply(this,n),t(this,n),i)},n._push=function(){var n,i;return this._inProgress?-1:(n=w(arguments),this._beforeChange(),i=Array.prototype.push.apply(this,n),t(this,n),i)},n.unshift=function(){var n=this._getGoodAdds(w(arguments)),i;return n.length?(this._beforeChange(),i=Array.prototype.unshift.apply(this,n),t(this,w(n)),i):this.length},n.pop=function(){this._beforeChange();var n=Array.prototype.pop.apply(this);return i(this,[n]),n},n.shift=function(){this._beforeChange();var n=Array.prototype.shift.apply(this);return i(this,[n]),n},n.splice=function(){var n=this._getGoodAdds(w(arguments,2)),u=w(arguments,0,2).concat(n),r;return this._beforeChange(),r=Array.prototype.splice.apply(this,u),i(this,r),n.length&&t(this,n),r},n.getEntityAspect=function(){return this.parent.entityAspect||this.parent.complexAspect.getEntityAspect()},n._getEventParent=function(){return this.getEntityAspect()},n._getPendingPubs=function(){var n=this.getEntityAspect().entityManager;return n&&n._pendingPubs},n._beforeChange=function(){},{mixin:n,publish:r,updateEntityState:u,initializeParent:e}}(),o=function(){function u(n,t,i,r,u){for(r=+n[t=n.length-1],u=0;t--;)i=+n[t],r+=++u%2?2*i%10+(i>4):i;return!(r%10)}function t(t,i,r,u){r&&(n.messageTemplates[t]=r);var f="string"==typeof i?new RegExp(i):i,e=function(n){return null==n||""===n?!0:"string"!=typeof n?!1:f.test(n)};return new n(t,e,u)}function f(n,t,i){return t?n.replace(/%([^%]+)%/g,function(n,r){var u;return u=i?t.hasOwnProperty(r)?t[r]:"":t[r],null!=u?li(u)?u(t):u:""}):n}function r(t,i,r,u){u=u||{};void 0!==i&&(u.min=i);void 0!==r&&(u.max=r);var f=u.messageTemplate||n.messageTemplates[t];return f||(n.messageTemplates[t]=d("'%displayName%' must be an integer between the values of %1 and %2",i,r)),function(){var f=function(n,t){return null==n?!0:("string"==typeof n&&t&&t.allowString&&(n=parseInt(n,0)),"number"!=typeof n||isNaN(n)||Math.floor(n)!==n?!1:null!=i&&i>n?!1:null!=r&&n>r?!1:!0)};return new n(t,f,u)}}var e=-32768,o=32767,h=-2147483648,c=2147483647,l=0,a=255,y={displayName:function(n){return n.property?n.property.resolveProperty("displayName")||n.propertyName||n.property.name:"Value"}},n=function(t,i,r){this._baseContext=r||{};this._baseContext.name=t;r=s(Object.create(y),this._baseContext);r.messageTemplate=r.messageTemplate||n.messageTemplates[t];this.name=t;this.valFn=i;this.context=r},i=n.prototype;return i._$typeName="Validator",i.validate=function(n,t){var i;i=t?s(Object.create(this.context),t):this.context;this.currentContext=i;try{return this.valFn(n,i)?null:(i.value=n,new lt(this,i,this.getMessage()))}catch(r){return new lt(this,i,"Exception occured while executing this validator: "+this.name)}},i.getMessage=function(){try{var n=this.currentContext,t=n.message;return t?"function"==typeof t?t(n):t:n.messageTemplate?f(n.messageTemplate,n):"invalid value: "+(this.name||"{unnamed validator}")}catch(i){return"Unable to format error message"+i.toString()}},i.toJSON=function(){return this._baseContext},n.fromJSON=function(t){if(Array.isArray(t))return t.map(function(t){return n.fromJSON(t)});var r="Validator."+t.name,i=v.getRegisteredFunction(r);if(!i)throw new Error("Unable to locate a validator named:"+t.name);return i(t)},n.register=function(n){v.registerFunction(function(){return n},"Validator."+n.name)},n.registerFactory=function(n,t){v.registerFunction(n,"Validator."+t)},n.messageTemplates={bool:"'%displayName%' must be a 'true' or 'false' value",creditCard:"The %displayName% is not a valid credit card number",date:"'%displayName%' must be a date",duration:"'%displayName%' must be a ISO8601 duration string, such as 'P3H24M60S'",emailAddress:"The %displayName% '%value%' is not a valid email address",guid:"'%displayName%' must be a GUID",integer:"'%displayName%' must be an integer",integerRange:"'%displayName%' must be an integer between the values of %minValue% and %maxValue%",maxLength:"'%displayName%' must be a string with %maxLength% characters or less",number:"'%displayName%' must be a number",phone:"The %displayName% '%value%' is not a valid phone number",regularExpression:"The %displayName% '%value%' does not match '%expression%'",required:"'%displayName%' is required",string:"'%displayName%' must be a string",stringLength:"'%displayName%' must be a string with between %minLength% and %maxLength% characters",url:"The %displayName% '%value%' is not a valid url"},n.required=function(t){var i=function(n,t){return"string"==typeof n?t&&t.allowEmptyStrings?!0:n.length>0:null!=n};return new n("required",i,t)},n.maxLength=function(t){var i=function(n,t){return null==n?!0:"string"!=typeof n?!1:n.length<=t.maxLength};return new n("maxLength",i,t)},n.stringLength=function(t){var i=function(n,t){return null==n?!0:"string"!=typeof n?!1:null!=t.minLength&&n.length<t.minLength?!1:null!=t.maxLength&&n.length>t.maxLength?!1:!0};return new n("stringLength",i,t)},n.string=function(){var t=function(n){return null==n?!0:"string"==typeof n};return new n("string",t)},n.guid=function(){var t=function(n){return null==n?!0:tr(n)};return new n("guid",t)},n.duration=function(){var t=function(n){return null==n?!0:ir(n)};return new n("duration",t)},n.number=n.double=n.single=function(t){var i=function(n,t){return null==n?!0:("string"==typeof n&&t&&t.allowString&&(n=parseFloat(n,10)),"number"==typeof n&&!isNaN(n))};return new n("number",i,t)},n.integer=n.int64=function(t){var i=function(n,t){return null==n?!0:("string"==typeof n&&t&&t.allowString&&(n=parseInt(n,10)),"number"==typeof n&&!isNaN(n)&&Math.floor(n)===n)};return new n("integer",i,t)},n.int32=function(n){return r("int32",h,c,n)()},n.int16=function(n){return r("int16",e,o,n)()},n.byte=function(n){return r("byte",l,a,n)()},n.bool=function(){var t=function(n){return null==n?!0:n===!0||n===!1};return new n("bool",t)},n.none=function(){var t=function(){return!0};return new n("none",t)},n.date=function(){var t=function(n){if(null==n)return!0;if("string"!=typeof n)return ct(n);try{return!isNaN(Date.parse(n))}catch(t){return!1}};return new n("date",t)},n.creditCard=function(t){function i(n){return null==n||""===n?!0:"string"!=typeof n?!1:(n=n.replace(/(\-|\s)/g,""),!n||/\D/.test(n)?!1:u(n))}return new n("creditCard",i,t)},n.regularExpression=function(t){function i(n,t){if(null==n||""===n)return!0;if("string"!=typeof n)return!1;try{var i=new RegExp(t.expression)}catch(r){throw new Error("Missing or invalid expression parameter to regExp validator");}return i.test(n)}return new n("regularExpression",i,t)},n.emailAddress=function(n){return t("emailAddress",/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i,null,n)},n.phone=function(n){return t("phone",/^((\+|(0(\d+)?[-/.\s]?))[1-9]\d{0,2}[-/.\s]?)?((\(\d{1,6}\)|\d{1,6})[-/.\s]?)?(\d+[-/.\s]?)+\d+$/,null,n)},n.url=function(n){return t("url",/^(https?|ftp):\/\/(((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-fA-F]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|([a-zA-Z][\-a-zA-Z0-9]*)|((([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-fA-F]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-fA-F]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-fA-F]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-fA-F]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/,null,n)},n.makeRegExpValidator=t,rt(n,function(n,t){"function"==typeof t&&"fromJSON"!==n&&"register"!==n&&"registerFactory"!==n&&"makeRegExpValidator"!==n&&v.registerFunction(t,"Validator."+n)}),n}(),lt=function(){var n=function i(n,r,u,f){t(n,"validator").isOptional().isInstanceOf(o).check();t(u,"errorMessage").isNonEmptyString().check();t(f,"key").isOptional().isNonEmptyString().check();this.validator=n;r=r||{};this.context=r;this.errorMessage=u;this.property=r.property;this.propertyName=r.propertyName||r.property&&r.property.name;this.key=f?f:i.getKey(n||u,this.propertyName);this.isServerError=!1};return n.getKey=function(n,t){return(n.name||n)+(t?":"+t:"")},n}();i.Validator=o;i.ValidationError=lt;ti=function(){function i(n,t){return t&&c(t).whereParam("validateOnAttach").isBoolean().isOptional().whereParam("validateOnSave").isBoolean().isOptional().whereParam("validateOnQuery").isBoolean().isOptional().whereParam("validateOnPropertyChange").isBoolean().isOptional().applyAll(n),n}var n=function(n){i(this,n)},t=n.prototype;return t._$typeName="ValidationOptions",t.using=function(n){if(!n)return this;var t=new ti(this);return i(t,n),t},t.setAsDefault=function(){return oi(this,n)},n.defaultInstance=new n({validateOnAttach:!0,validateOnSave:!0,validateOnQuery:!1,validateOnPropertyChange:!0}),n}();i.ValidationOptions=ti;i.makeComplexArray=function(){function i(n,t){return t.filter(function(t){return t.parent!==n.parent})}function r(n,t){t.forEach(function(t){if(null!=t.parent)throw new Error("The complexObject is already attached. Either clone it or remove it from its current owner");f(t,n)})}function u(n,i){i.forEach(function(i){t(i,n)})}function t(n,t){var i=n.complexAspect;return i.parent!==t.parent?null:(i.parent=null,i.parentProperty=null,i)}function f(n,t){var i=n.complexAspect;return i.parent===t.parent?null:(i.parent=t.parent,i.parentProperty=t.parentProperty,i)}function e(t,i,r){return ni.initializeParent(t,i,r),t.arrayChanged=new k("arrayChanged",t),s(t,ni.mixin),s(t,n)}var n={};return n._getGoodAdds=function(n){return i(this,n)},n._beforeChange=function(){ni.updateEntityState(this)},n._processAdds=function(n){r(this,n)},n._processRemoves=function(n){u(this,n)},n._rejectChanges=function(){if(this._origValues){var n=this;this.forEach(function(i){t(i,n)});this.length=0;this._origValues.forEach(function(t){n.push(t)})}},n._acceptChanges=function(){this._origValues=null},e}();g=function(){var t={isAttach:function(){return!!this.isAttach},isDetach:function(){return!!this.isDetach},isModification:function(){return!!this.isModification}},n=new ot("EntityAction",t);return n.Attach=n.addSymbol({isAttach:!0}),n.AttachOnQuery=n.addSymbol({isAttach:!0}),n.AttachOnImport=n.addSymbol({isAttach:!0}),n.Detach=n.addSymbol({isDetach:!0}),n.MergeOnQuery=n.addSymbol({isModification:!0}),n.MergeOnImport=n.addSymbol({isModification:!0}),n.MergeOnSave=n.addSymbol({isModification:!0}),n.PropertyChange=n.addSymbol({isModification:!0}),n.EntityStateChange=n.addSymbol(),n.AcceptChanges=n.addSymbol(),n.RejectChanges=n.addSymbol({isModification:!0}),n.Clear=n.addSymbol({isDetach:!0}),n.resolveSymbols(),n}();i.EntityAction=g;ii=function(){function s(n){var r=n.entityAspect||n.complexAspect,u=n.entityType||n.complexType,i=r.originalValues,t;for(t in i)n.setProperty(t,i[t]);u.complexProperties.forEach(function(t){var i=n.getProperty(t.name);t.isScalar?s(i):(i._rejectChanges(),i.forEach(s))})}function i(n){var r=n.entityAspect||n.complexAspect,t;r.originalValues={};t=n.entityType||n.complexType;t.complexProperties.forEach(function(t){var r=n.getProperty(t.name);t.isScalar?i(r):(r._acceptChanges(),r.forEach(i))})}function r(n,t){var i=!0,e=n.entityType||n.complexType,o=n.entityAspect||n.complexAspect,f=n.entityAspect||n.complexAspect.getEntityAspect(),u={entity:f.entity};return void 0!==t&&(u.index=t),e.getProperties().forEach(function(t){var e=n.getProperty(t.name),s=t.getAllValidators();s.length>0&&(u.property=t,u.propertyName=o.getPropertyPath(t.name),i=f._validateProperty(e,u)&&i);t.isComplexProperty&&(i=t.isScalar?r(e)&&i:e.reduce(function(n,t,i){return r(t,i)&&n},i))}),e.getAllValidators().forEach(function(t){i=v(f,t,n)&&i}),i}function c(n,t){var i=t.isDeleted();i?l(n):vt(n.entityAspect.entityManager,"isLoading",!0,function(){l(n)})}function l(n){n.entityType.navigationProperties.forEach(function(t){var i=t.inverse,r=n.getProperty(t.name),u;t.isScalar?r&&(i&&(i.isScalar?r.setProperty(i.name,null):(u=r.getProperty(i.name),u.length&&sr(u,n))),n.setProperty(t.name,null)):(i&&r.slice(0).forEach(function(n){i.isScalar&&n.setProperty(i.name,null)}),r.length=0)})}function v(n,t,i,r){var u=t.validate(i,r),f;return u?(n._addValidationError(u),!1):(f=lt.getKey(t,r?r.propertyName:null),n._removeValidationError(f),!0)}var y=function f(n){var t,i,r,e;if(null===n){if(t=f._nullInstance,t)return t;f._nullInstance=this}else{if(void 0===n)throw new Error("The EntityAspect ctor requires an entity as its only argument.");if(n.entityAspect)return n.entityAspect}if(!(this instanceof f))return new f(n);if(this.entity=n,this.entityGroup=null,this.entityManager=null,this.entityState=u.Detached,this.isBeingSaved=!1,this.originalValues={},this.hasValidationErrors=!1,this._validationErrors={},this.validationErrorsChanged=new k("validationErrorsChanged",this),this.propertyChanged=new k("propertyChanged",this),null!=n){if(n.entityAspect=this,i=n.entityType||n._$entityType,!i){r=n.prototype._$typeName;throw new Error(r?"Metadata for this entityType has not yet been resolved: "+r:"This entity is not registered as a valid EntityType");}e=i.getEntityCtor();yt.getDefaultInstance().startTracking(n,e.prototype)}},n=y.prototype;return k.bubbleEvent(n,function(){return this.entityManager}),n.getKey=function(n){if(n=t(n,"forceRefresh").isBoolean().isOptional().check(!1),n||!this._entityKey){var i=this.entity.entityType,r=i.keyProperties,u=r.map(function(n){return this.entity.getProperty(n.name)},this);this._entityKey=new h(i,u)}return this._entityKey},n.acceptChanges=function(){this._checkOperation("acceptChanges");var n=this.entityManager;this.entityState.isDeleted()?n.detachEntity(this.entity):this.setUnchanged();n.entityChanged.publish({entityAction:g.AcceptChanges,entity:this.entity})},n.rejectChanges=function(){this._checkOperation("rejectChanges");var n=this.entity,t=this.entityManager;vt(t,"isRejectingChanges",!0,function(){s(n)});this.entityState.isAdded()?(t.detachEntity(n),t._notifyStateChange(n,!1)):(this.entityState.isDeleted()&&this.entityManager._linkRelatedEntities(n),this.setUnchanged(),this.propertyChanged.publish({entity:n,propertyName:null}),this.entityManager.entityChanged.publish({entityAction:g.RejectChanges,entity:n}))},n.getPropertyPath=function(n){return n},n.setAdded=function(){return this.setEntityState(u.Added)},n.setUnchanged=function(){return this.setEntityState(u.Unchanged)},n.setModified=function(){return this.setEntityState(u.Modified)},n.setDeleted=function(){return this.setEntityState(u.Deleted)},n.setDetached=function(){return this.setEntityState(u.Detached)},n.setEntityState=function(n){var f;if(this.entityState===n)return!1;if(this._checkOperation("setEntityState"),this.entityState.isDetached())throw new Error("You cannot set the 'entityState' of an entity when it is detached - except by first attaching it to an EntityManager");var t=this.entity,e=this.entityManager,r=!0;if(n===u.Unchanged)i(t),delete this.hasTempKey,r=!1;else if(n===u.Added)i(t);else if(n===u.Deleted){if(this.entityState.isAdded())return this.setEntityState(u.Detached),!0;this.entityState=u.Deleted;c(t,u.Deleted)}else if(n!==u.Modified&&n===u.Detached){if(f=this.entityGroup,!f)return!1;f.detachEntity(t);this.entityState=n;c(t,u.Detached);this._detach();e.entityChanged.publish({entityAction:g.Detach,entity:t});r=!1}return this.entityState=n,e._notifyStateChange(t,r),!0},n.loadNavigationProperty=function(n,t,i){var r=this.entity,u=r.entityType._checkNavProperty(n),f=it.fromEntityNavigation(r,u),o=r.entityAspect.entityManager.executeQuery(f),s=this;return o.then(function(n){return s._markAsLoaded(u.name),t&&t(n),e.resolve(n)},function(n){return i&&i(n),e.reject(n)})},n.markNavigationPropertyAsLoaded=function(n){var t=this.entity.entityType._checkNavProperty(n);this._markAsLoaded(t.name)},n.isNavigationPropertyLoaded=function(n){var t=this.entity.entityType._checkNavProperty(n);return t.isScalar&&null!=this.entity.getProperty(t.name)?!0:this._loadedNps&&this._loadedNps.indexOf(t.name)>=0},n._markAsLoaded=function(n){this._loadedNps=this._loadedNps||[];kt(this._loadedNps,n)},n.validateEntity=function(){var n=!0;return this._processValidationOpAndPublish(function(t){n=r(t.entity)}),n},n.validateProperty=function(n,t){var i=this.getPropertyValue(n);return i&&i.complexAspect?r(i):(t=t||{},t.entity=this.entity,"string"==typeof n?(t.property=this.entity.entityType.getProperty(n,!0),t.propertyName=n):(t.property=n,t.propertyName=n.name),this._validateProperty(i,t))},n.getValidationErrors=function(n){var i,r;return t(n,"property").isOptional().isEntityProperty().or().isString().check(),i=br(this._validationErrors),n&&(r="string"==typeof n?n:n.name,i=i.filter(function(n){return n.property&&(n.property.name===r||-1!=r.indexOf(".")&&n.propertyName==r)})),i},n.addValidationError=function(n){t(n,"validationError").isInstanceOf(lt).check();this._processValidationOpAndPublish(function(t){t._addValidationError(n)})},n.removeValidationError=function(n){t(n,"validationErrorOrKey").isString().or().isInstanceOf(lt).or().isInstanceOf(o).check();var i="string"==typeof n?n:n.key;this._processValidationOpAndPublish(function(n){n._removeValidationError(i)})},n.clearValidationErrors=function(){this._processValidationOpAndPublish(function(n){rt(n._validationErrors,function(t,i){i&&(delete n._validationErrors[t],n._pendingValidationResult.removed.push(i))});n.hasValidationErrors=!ut(n._validationErrors)})},n.getParentKey=function(n){var t=n.foreignKeyNames,i,r;return 0===t.length?null:(i=this,r=t.map(function(n){return i.entity.getProperty(n)}),new h(n.entityType,r))},n.getPropertyValue=function(n){var i,r,u;if(t(n,"property").isString().or().isEntityProperty().check(),"string"==typeof n)for(r=n.trim().split("."),u=r.shift(),i=this.entity,i=i.getProperty(u);r.length>0;)u=r.shift(),i=i.getProperty(u);else{if(!(n.parentType instanceof a))throw new Error("The validateProperty method does not accept a 'property' parameter whose parentType is a ComplexType; Pass a 'property path' string as the 'property' parameter instead ");i=this.entity.getProperty(n.name)}return i},n._checkOperation=function(n){if(this.isBeingSaved)throw new Error("Cannot perform a '"+n+"' on an entity that is in the process of being saved");return this},n._detach=function(){this.entityGroup=null;this.entityManager=null;this.entityState=u.Detached;this.originalValues={};this._validationErrors={};this.hasValidationErrors=!1;this.validationErrorsChanged.clear();this.propertyChanged.clear()},n._validateProperty=function(n,t){var i=!0;return this._processValidationOpAndPublish(function(r){t.property.getAllValidators().forEach(function(u){i=v(r,u,n,t)&&i})}),i},n._processValidationOpAndPublish=function(n){if(this._pendingValidationResult)n(this);else try{this._pendingValidationResult={entity:this.entity,added:[],removed:[]};n(this);(this._pendingValidationResult.added.length>0||this._pendingValidationResult.removed.length>0)&&(this.validationErrorsChanged.publish(this._pendingValidationResult),this.entityManager&&this.entityManager.validationErrorsChanged.publish(this._pendingValidationResult))}finally{this._pendingValidationResult=void 0}},n._addValidationError=function(n){this._validationErrors[n.key]=n;this.hasValidationErrors=!0;this._pendingValidationResult.added.push(n)},n._removeValidationError=function(n){var t=this._validationErrors[n];t&&(delete this._validationErrors[n],this.hasValidationErrors=!ut(this._validationErrors),this._pendingValidationResult.removed.push(t))},y}();ar=function(){var n=function t(n,i,r){var u,f,e;if(!n)throw new Error("The  ComplexAspect ctor requires an entity as its only argument.");if(n.complexAspect)return n.complexAspect;if(!(this instanceof t))return new t(n,i,r);if(this.complexObject=n,n.complexAspect=this,this.originalValues={},null!=i&&(this.parent=i,this.parentProperty=r),u=n.complexType,!u){f=n.prototype._$typeName;throw new Error(f?"Metadata for this complexType has not yet been resolved: "+f:"This entity is not registered as a valid ComplexType");}e=u.getCtor();yt.getDefaultInstance().startTracking(n,e.prototype)},i=n.prototype;return i.getEntityAspect=function(){var n=this.parent,t;if(!n)return new ii(null);for(t=n.entityAspect;n&&!t;)n=n.complexAspect&&n.complexAspect.parent,t=n&&n.entityAspect;return t||new ii(null)},i.getPropertyPath=function(n){var t=this.parent,i;return t?(i=t.complexAspect||t.entityAspect,i.getPropertyPath(this.parentProperty.name+"."+n)):null},n}();i.EntityAspect=ii;i.ComplexAspect=ar;h=function(){function u(n){return n.join(f)}var f=":::",n=function(n,i){t(n,"entityType").isInstanceOf(a).check();var f=n.getSelfAndSubtypes();f.length>1&&(this._subtypes=f.filter(function(n){return n.isAbstract===!1}));Array.isArray(i)||(i=w(arguments,1));this.entityType=n;n.keyProperties.forEach(function(n,t){n.dataType===r.Guid&&(i[t]=i[t]&&i[t].toLowerCase())});this.values=i;this._keyInGroup=u(i)},i;return n._$typeName="EntityKey",i=n.prototype,i.toJSON=function(){return{entityType:this.entityType.name,values:this.values}},n.fromJSON=function(n,t){var i=t._getEntityType(n.entityType,!0);return new h(i,n.values)},i.equals=function(n){return n instanceof h?this.entityType===n.entityType&&hi(this.values,n.values):!1},i.toString=function(n){return(n||this.entityType).name+"-"+this._keyInGroup},n.equals=function(n,t){return n instanceof h?n.equals(t):!1},i._isEmpty=function(){return 0===this.values.join("").length},n.createKeyString=u,n}();i.EntityKey=h;u=function(){var t={isUnchanged:function(){return this===n.Unchanged},isAdded:function(){return this===n.Added},isModified:function(){return this===n.Modified},isDeleted:function(){return this===n.Deleted},isDetached:function(){return this===n.Detached},isUnchangedOrModified:function(){return this===n.Unchanged||this===n.Modified},isAddedModifiedOrDeleted:function(){return this===n.Added||this===n.Modified||this===n.Deleted}},n=new ot("EntityState",t);return n.Unchanged=n.addSymbol(),n.Added=n.addSymbol(),n.Modified=n.addSymbol(),n.Deleted=n.addSymbol(),n.Detached=n.addSymbol(),n.resolveSymbols(),n}();i.EntityState=u;i.makePrimitiveArray=function(){function t(t,i,r){return ni.initializeParent(t,i,r),t.arrayChanged=new k("arrayChanged",t),s(t,ni.mixin),s(t,n)}var n={};return n._getGoodAdds=function(n){return n},n._beforeChange=function(){var n=this.getEntityAspect();n.entityState.isUnchanged()&&n.setModified();n.entityState.isModified()&&!this._origValues&&(this._origValues=this.slice(0))},n._processAdds=function(){},n._processRemoves=function(){},n._rejectChanges=function(){this._origValues&&(this.length=0,Array.prototype.push.apply(this,this._origValues))},n._acceptChanges=function(){this._origValues=null},t}();i.makeRelationArray=function(){function t(n,t){var i=f(n,t),e,r;return i.length?(e=n.parentEntity,r=e.entityAspect.entityManager,r&&!r.isLoading&&i.forEach(function(t){if(t.entityAspect.entityState.isDetached()){n._inProgress=!0;try{r.attachEntity(t,u.Added)}finally{n._inProgress=!1}}}),i):i}function i(n,t){var i=n.parentEntity,u=n.navigationProperty,r=n._addsInProcess,f=u.inverse,e=r.length;try{t.forEach(function(n){if(r.push(n),f)n.setProperty(f.name,i);else{var t=i.entityType.keyProperties;u.invForeignKeyNames.forEach(function(r,u){n.setProperty(r,i.getProperty(t[u].name))})}})}finally{r.splice(e,t.length)}}function r(n,t){var i=n.navigationProperty.inverse;i&&t.forEach(function(n){n.setProperty(i.name,null)})}function f(n,t){var i,r=n.parentEntity,u=n.navigationProperty,f=u.inverse,e,o;return f?i=t.filter(function(t){if(n._addsInProcess.indexOf(t)>=0)return!1;var i=t.getProperty(f.name);return i!==r}):(e=u.invForeignKeyNames,o=r.entityType.keyProperties,i=t.filter(function(t){return n._addsInProcess.indexOf(t)>=0?!1:e.some(function(n,i){var u=o[i].name,f=r.getProperty(u),e=t.getProperty(n);return f!==e})})),i}function e(t,i,r){return t.parentEntity=i,t.navigationProperty=r,t.arrayChanged=new k("arrayChanged",t),t._addsInProcess=[],s(t,ni.mixin),s(t,n)}var n={};return n.load=function(n,t){var i=this.parentEntity,r=it.fromEntityNavigation(this.parentEntity,this.navigationProperty),u=i.entityAspect.entityManager;return u.executeQuery(r,n,t)},n._getEventParent=function(){return this.parentEntity.entityAspect},n._getPendingPubs=function(){var n=this.parentEntity.entityAspect.entityManager;return n&&n._pendingPubs},n._getGoodAdds=function(n){return t(this,n)},n._processAdds=function(n){i(this,n)},n._processRemoves=function(n){r(this,n)},e}();r=function(){function r(n,t){throw n=d(n,t),new Error(n);}function v(t){switch(t){case n.String:return o.string;case n.Int64:return o.int64;case n.Int32:return o.int32;case n.Int16:return o.int16;case n.Decimal:return o.number;case n.Double:return o.number;case n.Single:return o.number;case n.DateTime:return o.date;case n.DateTimeOffset:return o.date;case n.Boolean:return o.bool;case n.Guid:return o.guid;case n.Byte:return o.byte;case n.Binary:return o.none;case n.Time:return o.duration;case n.Undefined:return o.none}}var i,h=function(){i={stringPrefix:"K_",nextNumber:-1,nextNumberIncrement:-1}},a;h();var y=function(){return i.stringPrefix+t().toString()},t=function(){var n=i.nextNumber;return i.nextNumber+=i.nextNumberIncrement,n},p=function(){return ci()},c=function(){return new Date},w=function(n){return null==n?n:n.toString()},b=function(n,t){return"string"===t?n.trim().toLowerCase():n},u=function(n,t){var i,r;return"string"===t?(i=n.trim(),""===i)?null:(r=parseInt(i,10),isNaN(r)?n:r):"number"===t?Math.round(n):n},e=function(n,t){var i,r;return"string"===t?(i=n.trim(),""===i)?null:(r=parseFloat(i),isNaN(r)?n:r):n},l=function(n,t){var i,r;return"string"===t?(r=n.trim(),""===r?null:(i=new Date(Date.parse(r)),ct(i)?i:n)):"number"===t?(i=new Date(n),ct(i)?i:n):n},k=function(n,t){if("string"===t){var i=n.trim().toLowerCase();return"false"===i||""===i?!1:"true"===i?!0:n}return n},g=function(n){return null==n?null:"'"+n.replace(/'/g,"''")+"'"},s=function(n){return null==n?null:"string"==typeof n?parseInt(n,10):n},f=function(n){return function(t){return null==t?null:("string"==typeof t&&(t=parseFloat(t)),t+n)}},nt=function(n){if(null==n)return null;try{return"datetime'"+n.toISOString()+"'"}catch(t){r("'%1' is not a valid dateTime",n)}},tt=function(n){if(null==n)return null;try{return"datetimeoffset'"+n.toISOString()+"'"}catch(t){r("'%1' is not a valid dateTime",n)}},it=function(n){return null==n?null:(ir(n)||r("'%1' is not a valid ISO 8601 duration",n),"time'"+n+"'")},rt=function(n){return null==n?null:(tr(n)||r("'%1' is not a valid guid",n),"guid'"+n+"'")},ut=function(n){return null==n?null:"string"==typeof n?"true"===n.trim().toLowerCase():!!n},ft=function(n){return null==n?n:"binary'"+n+"'"},et=function(n){return n},n=new ot("DataType",{});return n.String=n.addSymbol({defaultValue:"",parse:w,fmtOData:g,getNext:y}),n.Int64=n.addSymbol({defaultValue:0,isNumeric:!0,isInteger:!0,quoteJsonOData:!0,parse:u,fmtOData:f("L"),getNext:t}),n.Int32=n.addSymbol({defaultValue:0,isNumeric:!0,isInteger:!0,parse:u,fmtOData:s,getNext:t}),n.Int16=n.addSymbol({defaultValue:0,isNumeric:!0,isInteger:!0,parse:u,fmtOData:s,getNext:t}),n.Byte=n.addSymbol({defaultValue:0,isNumeric:!0,isInteger:!0,parse:u,fmtOData:s}),n.Decimal=n.addSymbol({defaultValue:0,isNumeric:!0,quoteJsonOData:!0,isFloat:!0,parse:e,fmtOData:f("m"),getNext:t}),n.Double=n.addSymbol({defaultValue:0,isNumeric:!0,isFloat:!0,parse:e,fmtOData:f("d"),getNext:t}),n.Single=n.addSymbol({defaultValue:0,isNumeric:!0,isFloat:!0,parse:e,fmtOData:f("f"),getNext:t}),n.DateTime=n.addSymbol({defaultValue:new Date(1900,0,1),isDate:!0,parse:l,fmtOData:nt,getNext:c}),n.DateTimeOffset=n.addSymbol({defaultValue:new Date(1900,0,1),isDate:!0,parse:l,fmtOData:tt,getNext:c}),n.Time=n.addSymbol({defaultValue:"PT0S",fmtOData:it}),n.Boolean=n.addSymbol({defaultValue:!1,parse:k,fmtOData:ut}),n.Guid=n.addSymbol({defaultValue:"00000000-0000-0000-0000-000000000000",parse:b,fmtOData:rt,getNext:p}),n.Binary=n.addSymbol({defaultValue:null,fmtOData:ft}),n.Undefined=n.addSymbol({defaultValue:void 0,fmtOData:et}),n.resolveSymbols(),n.getComparableFn=function(t){return t&&t.isDate?function(n){return n&&n.getTime()}:t===n.Time?function(n){return n&&nu(n)}:function(n){return n}},n.fromEdmDataType=function(t){var u=null,i=t.split("."),r;return i.length>1&&(r=i[1],u="image"===r?n.Byte:2===i.length?n.fromName(r)||n.Undefined:n.String),u},n.fromValue=function(t){if(ct(t))return n.DateTime;switch(typeof t){case"string":return tr(t)?n.Guid:ir(t)&&t.length>3?n.Time:pu(t)?n.DateTime:n.String;case"boolean":return n.Boolean;case"number":return n.Double}return n.Undefined},a=/.\d{3}$/,n.parseTimeFromServer=function(n){if("string"==typeof n)return n;if(n&&"Edm.Time"===n.__edmType){var t=Math.floor(n.ms/1e3);return"PT"+t+"S"}return n},n.parseDateAsUTC=function(n){if("string"==typeof n){var t=a.test(n);n=t?n+"Z":n}return new Date(Date.parse(n))},n.parseDateFromServer=n.parseDateAsUTC,n.parseRawValue=function(t,i){if(void 0!==t)return(i.isDate&&t?ct(t)||(t=n.parseDateFromServer(t)):i===n.Binary?t&&void 0!==t.$value&&(t=t.$value):i===n.Time?t=n.parseTimeFromServer(t):t&&i===n.Guid&&(t=t.toLowerCase()),t)},n.constants=i,n._resetConstants=h,n.getSymbols().forEach(function(n){n.validatorCtor=v(n)}),n}();i.DataType=r;l=function(){function i(n,t){return t&&(c(t).whereParam("serviceName").isOptional().whereParam("adapterName").isString().isOptional().whereParam("uriBuilderName").isString().isOptional().whereParam("hasServerMetadata").isBoolean().isOptional().whereParam("jsonResultsAdapter").isInstanceOf(yi).isOptional().whereParam("useJsonp").isBoolean().isOptional().applyAll(n),n.serviceName=n.serviceName&&l._normalizeServiceName(n.serviceName),n.adapterInstance=n.adapterName&&v.getAdapterInstance("dataService",n.adapterName),n.uriBuilder=n.uriBuilderName&&v.getAdapterInstance("uriBuilder",n.uriBuilderName)),n}var n=function(n){i(this,n)},t=n.prototype;return t._$typeName="DataService",t.using=function(n){if(!n)return this;var t=new l(this);return i(t,n)},n.resolve=function(n){n.push({hasServerMetadata:!0,useJsonp:!1});var t=new l(kr(n,["serviceName","adapterName","uriBuilderName","hasServerMetadata","jsonResultsAdapter","useJsonp"]));if(!t.serviceName)throw new Error("Unable to resolve a 'serviceName' for this dataService");return t.adapterInstance=t.adapterInstance||v.getAdapterInstance("dataService",t.adapterName),t.jsonResultsAdapter=t.jsonResultsAdapter||t.adapterInstance.jsonResultsAdapter,t.uriBuilder=t.uriBuilder||v.getAdapterInstance("uriBuilder",t.uriBuilderName),t},n._normalizeServiceName=function(n){return n=n.trim(),"/"!==n.substr(-1)?n+"/":n},t.toJSON=function(){return ht(this,{serviceName:null,adapterName:null,uriBuilderName:null,hasServerMetadata:null,jsonResultsAdapter:function(n){return n&&n.name},useJsonp:null})},n.fromJSON=function(n){return n.jsonResultsAdapter=v._fetchObject(yi,n.jsonResultsAdapter),new l(n)},t.qualifyUrl=function(n){var t=this.serviceName;return f.stringEndsWith(t,"/")&&(t=t.substr(0,t.length-1)),n="/"+n,f.stringEndsWith(t,n)||(t+=n),t},n}();yi=function(){function i(n){return n.results}var n=function(n){if(1!==arguments.length)throw new Error("The JsonResultsAdapter ctor should be called with a single argument that is a configuration object.");c(n).whereParam("name").isNonEmptyString().whereParam("extractResults").isFunction().isOptional().withDefault(i).whereParam("visitNode").isFunction().applyAll(this);v._storeObject(this,t._$typeName,this.name)},t=n.prototype;return t._$typeName="JsonResultsAdapter",n}();i.DataService=l;i.JsonResultsAdapter=yi;e=hr("Q");e||(e=function(){throw new Error("Q is undefined. Are you missing Q.js? See https://github.com/kriskowal/q");},e.defer=e.resolve=e.reject=e);i.config.setQ=function(n){i.Q=e=n};i.Q=e;var ri=function(){function y(n){var i=[],t,r;for(t in n)r=n[t],t===r.name&&i.push(n[t]);return i}function p(n,t,i){var o=gt(t.shortName,t.namespace),r=n._getEntityType(o,!0),f,e;return r?i?w(r,t):r:(f={shortName:t.shortName,namespace:t.namespace,isAbstract:t.isAbstract,autoGeneratedKeyType:st.fromName(t.autoGeneratedKeyType),defaultResourceName:t.defaultResourceName,custom:t.custom},(r=t.isComplexType?new pt(f):new a(f),t.baseTypeName)?(r.baseTypeName=t.baseTypeName,e=n._getEntityType(t.baseTypeName,!0),e?u(n,t,r,e):nr(n._deferredTypes,t.baseTypeName).push({json:t,stype:r})):u(n,t,r),r)}function w(n,t){return t.custom&&(n.custom=t.custom),h(n,t.dataProperties),h(n,t.navigationProperties),n}function h(n,t){t&&t.forEach(function(t){var i=t.name,r;if(!i){if(!t.nameOnServer)throw new Error("Unable to complete 'importMetadata' - cannot locate a 'name' or 'nameOnServer' for one of the imported property nodes");i=n.metadataStore.namingConvention.serverPropertyNameToClient(t.nameOnServer,{})}t.custom&&(r=n.getProperty(i,!0),r.custom=t.custom)})}function u(n,t,i){var e,r,f;t.validators&&(i.validators=t.validators.map(o.fromJSON));t.dataProperties.forEach(function(n){i._addPropertyCore(b.fromJSON(n))});e=!t.isComplexType;e&&t.navigationProperties&&t.navigationProperties.forEach(function(n){i._addPropertyCore(at.fromJSON(n))});n.addEntityType(i);r=n._deferredTypes;f=r[i.name];f&&(f.forEach(function(t){u(n,t.json,t.stype)}),delete r[i.name])}function f(n,t,i){if(eu(t))return t;var r=n._shortNameMap[t];if(!r&&i)throw new Error("Unable to locate 'entityTypeName' of: "+t);return r}var g=0,r=function(n){n=n||{};c(n).whereParam("namingConvention").isOptional().isInstanceOf(wi).withDefault(wi.defaultInstance).whereParam("localQueryComparisonOptions").isOptional().isInstanceOf(pi).withDefault(pi.defaultInstance).whereParam("serializerFn").isOptional().isFunction().applyAll(this);this.dataServices=[];this._resourceEntityTypeMap={};this._structuralTypeMap={};this._shortNameMap={};this._ctorRegistry={};this._incompleteTypeMap={};this._incompleteComplexTypeMap={};this._id=g++;this.metadataFetched=new k("metadataFetched",this)},n=r.prototype;return n._$typeName="MetadataStore",k.bubbleEvent(n,null),r.ANONTYPE_PREFIX="_IB_",r.normalizeTypeName=gr(function(n){return n&&fu(n).typeName}),n.setProperties=function(n){c(n).whereParam("name").isString().isOptional().whereParam("serializerFn").isFunction().isOptional().applyAll(this)},n.addDataService=function(n,i){t(n,"dataService").isInstanceOf(l).check();t(i,"shouldOverwrite").isBoolean().isOptional().check();var r=this._getDataServiceIndex(n.serviceName);if(r>=0){if(!i)throw new Error("A dataService with this name '"+n.serviceName+"' already exists in this MetadataStore");this.dataServices[r]=n}else this.dataServices.push(n)},n._getDataServiceIndex=function(n){return or(this.dataServices,function(t){return t.serviceName===n})},n.addEntityType=function(n){var i,t;if((n instanceof a||n instanceof pt||(n=n.isComplexType?new pt(n):new a(n)),!n.isComplexType)&&(n.baseTypeName&&!n.baseEntityType&&(i=this._getEntityType(n.baseTypeName,!0),n._updateFromBase(i)),0===n.keyProperties.length&&!n.isAbstract))throw new Error("Unable to add "+n.name+" to this MetadataStore.  An EntityType must have at least one property designated as a key property - See the 'DataProperty.isPartOfKey' property.");if(n.metadataStore=this,!n.isAnonymous){if(this._structuralTypeMap[n.name])throw new Error("Type "+n.name+" already exists in this MetadataStore.");this._structuralTypeMap[n.name]=n;this._shortNameMap[n.shortName]=n.name}(n.getProperties().forEach(function(t){n._updateNames(t);t.isUnmapped||n._mappedPropertiesCount++}),n._updateCps(),n.isComplexType)||(n._updateNps(),t=n.defaultResourceName||n.baseEntityType&&n.baseEntityType.defaultResourceName,t&&!this.getEntityTypeNameForResourceName(t)&&this.setEntityTypeForResourceName(t,n.name),n.defaultResourceName=t,n.getEntityCtor())},n.exportMetadata=function(){return JSON.stringify({metadataVersion:i.metadataVersion,name:this.name,namingConvention:this.namingConvention.name,localQueryComparisonOptions:this.localQueryComparisonOptions.name,dataServices:this.dataServices,structuralTypes:fi(this._structuralTypeMap),resourceEntityTypeMap:this._resourceEntityTypeMap},null,v.stringifyPad)},n.importMetadata=function(n,r){var u,h,f,e,o;if(t(r,"allowMerge").isOptional().isBoolean().check(),this._deferredTypes={},u="string"==typeof n?JSON.parse(n):n,u.schema)return uf.parse(this,u.schema,u.altMetadata);if(u.metadataVersion&&u.metadataVersion!==i.metadataVersion){h=d("Cannot import metadata with a different 'metadataVersion' (%1) than the current 'breeze.metadataVersion' (%2) ",u.metadataVersion,i.metadataVersion);throw new Error(h);}if(f=u.namingConvention,e=u.localQueryComparisonOptions,this.isEmpty())this.namingConvention=v._fetchObject(wi,f)||this.namingConvention,this.localQueryComparisonOptions=v._fetchObject(pi,e)||this.localQueryComparisonOptions;else{if(f&&this.namingConvention.name!==f)throw new Error("Cannot import metadata with a different 'namingConvention' from the current MetadataStore");if(e&&this.localQueryComparisonOptions.name!==e)throw new Error("Cannot import metadata with different 'localQueryComparisonOptions' from the current MetadataStore");}return o=this,u.dataServices&&u.dataServices.forEach(function(n){n=l.fromJSON(n);o.addDataService(n,!0)}),this._structuralTypeMap,u.structuralTypes&&u.structuralTypes.forEach(function(n){p(o,n,r)}),s(this._resourceEntityTypeMap,u.resourceEntityTypeMap),s(this._incompleteTypeMap,u.incompleteTypeMap),this},r.importMetadata=function(n){var t=new ri;return t.importMetadata(n),t},n.hasMetadataFor=function(n){return!!this.getDataService(n)},n.getDataService=function(n){return t(n,"serviceName").isString().check(),n=l._normalizeServiceName(n),tt(this.dataServices,function(t){return t.serviceName===n})},n.fetchMetadata=function(n,i,r){try{if(t(n,"dataService").isString().or().isInstanceOf(l).check(),t(i,"callback").isFunction().isOptional().check(),t(r,"errorCallback").isFunction().isOptional().check(),"string"==typeof n&&(n=this.getDataService(n)||new l({serviceName:n})),n=l.resolve([n]),this.hasMetadataFor(n.serviceName))throw new Error("Metadata for a specific serviceName may only be fetched once per MetadataStore. ServiceName: "+n.serviceName);var u=this;return n.adapterInstance.fetchMetadata(this,n).then(function(t){return u.metadataFetched.publish({metadataStore:u,dataService:n,rawMetadata:t}),i&&i(t),e.resolve(t)},function(n){return r&&r(n),e.reject(n)})}catch(f){return e.reject(f)}},n.trackUnmappedType=function(n,i){t(n,"entityCtor").isFunction().check();t(i,"interceptor").isFunction().isOptional().check();var r=new a(this);r._setCtor(n,i)},n.registerEntityTypeCtor=function(n,i,r,u){var e,s,o;t(n,"structuralTypeName").isString().check();t(i,"aCtor").isFunction().isOptional().check();t(r,"initFn").isOptional().isFunction().or().isString().check();t(u,"noTrackingFn").isOptional().isFunction().check();e=f(this,n,!1);s=e||n;(this._ctorRegistry[s]={ctor:i,initFn:r,noTrackingFn:u},e)&&(o=this._structuralTypeMap[e],o&&o.getCtor(!0))},n.isEmpty=function(){return ut(this._structuralTypeMap)},n.getEntityType=function(n,i){return t(n,"structuralTypeName").isString().check(),t(i,"okIfNotFound").isBoolean().isOptional().check(!1),this._getEntityType(n,i)},n._getEntityType=function(n,t){var e=f(this,n,!1),i=this._structuralTypeMap[e],r,u;if(!i){if(t)return null;r=d("Unable to locate a 'Type' by the name: '%1'. Be sure to execute a query or call fetchMetadata first.",n);throw new Error(r);}if(i.length){u=i.join(",");throw new Error("There are multiple types with this 'shortName': "+u);}return i},n.getEntityTypes=function(){return y(this._structuralTypeMap)},n.getIncompleteNavigationProperties=function(){return fi(this._incompleteTypeMap,function(n,t){return t})},n.getEntityTypeNameForResourceName=function(n){return t(n,"resourceName").isString().check(),this._resourceEntityTypeMap[n]},n.setEntityTypeForResourceName=function(n,i){var u,r;t(n,"resourceName").isString().check();t(i,"entityTypeOrName").isInstanceOf(a).or().isString().check();u=i instanceof a?i.name:f(this,i,!0);this._resourceEntityTypeMap[n]=u;r=this._getEntityType(u,!0);r&&!r.defaultResourceName&&(r.defaultResourceName=n)},n._checkEntityType=function(n){var t,i;if(!n.entityType){if(t=n.prototype._$typeName,!t)throw new Error("This entity has not been registered. See the MetadataStore.registerEntityTypeCtor method");i=this._getEntityType(t);i&&(n.entityType=i)}},r}(),uf=function(){function e(t,i,r){var u,f;if(t._entityTypeResourceMap={},p(i).forEach(function(i){if(i.cSpaceOSpaceMapping){var u=JSON.parse(i.cSpaceOSpaceMapping),r={};u.forEach(function(n){r[n[0]]=n[1]});i.cSpaceOSpaceMapping=r}i.entityContainer&&p(i.entityContainer).forEach(function(r){p(r.entitySet).forEach(function(r){var u=n(r.entityType,i).typeName;t.setEntityTypeForResourceName(r.name,u);t._entityTypeResourceMap[u]=r.name})});i.complexType&&p(i.complexType).forEach(function(n){h(n,i,t)});i.entityType&&p(i.entityType).forEach(function(n){s(n,i,t)})}),u=t.getIncompleteNavigationProperties(),u.length>0){f=u.map(function(n){return n.parentType.name+":"+n.name}).join(", ");throw new Error("Incomplete navigation properties: "+f);}return r&&t.importMetadata(r,!0),t}function s(r,u,f){var h=r.name,l=i(h,u),e=new a({shortName:h,namespace:l,isAbstract:r.abstract&&"true"===r.abstract}),o,c,s;return r.baseType?(o=n(r.baseType,u).typeName,e.baseTypeName=o,c=f._getEntityType(o,!0),c?t(e,r,u,f):(s=f._deferredTypes[o],s||(s=[],f._deferredTypes[o]=s),s.push({entityType:e,csdlEntityType:r}))):t(e,r,u,f),e}function t(n,i,r,f){var s=i.key?p(i.key.propertyRef).map(ei("name")):[],e,o;p(i.property).forEach(function(t){u(n,t,r,s)});p(i.navigationProperty).forEach(function(t){l(n,t,r)});f.addEntityType(n);n.defaultResourceName=f._entityTypeResourceMap[n.name];e=f._deferredTypes;o=e[n.name];o&&(o.forEach(function(n){t(n.entityType,n.csdlEntityType,r,f)}),delete e[n.name])}function h(n,t,r){var e=n.name,o=i(e,t),f=new pt({shortName:e,namespace:o});return p(n.property).forEach(function(n){u(f,n,t)}),r.addEntityType(f),f}function u(n,t,i,r){var u,e=t.type.split(".");return"Edm"===e[0]&&2===e.length?u=f(n,t,r):v(t,i)?(u=f(n,t,r),u&&(u.enumType=t.type)):u=c(n,t,i),u&&(n._addPropertyCore(u),k(u)),u}function f(n,t,i){var f=r.fromEdmDataType(t.type),s,e,u,o;return null==f?(n.warnings.push("Unable to recognize DataType for property: "+t.name+" DateType: "+t.type),null):(s="true"===t.nullable||null==t.nullable,e=null!=i&&i.indexOf(t.name)>=0,e&&n.autoGeneratedKeyType===st.None&&d(t)&&(n.autoGeneratedKeyType=st.Identity),u=t.maxLength,u=null==u||"Max"===u?null:parseInt(u,10),o=new b({nameOnServer:t.name,dataType:f,isNullable:s,isPartOfKey:e,maxLength:u,defaultValue:t.defaultValue,concurrencyMode:t.concurrencyMode}),f===r.Undefined&&(o.rawTypeName=t.type),o)}function c(t,i,r){var u=n(i.type,r).typeName;return new b({nameOnServer:i.name,complexTypeName:u,isNullable:!1})}function l(t,i,r){var u=g(i,r),s=tt(u.end,function(n){return n.role===i.toRole}),c="*"!==s.multiplicity,l=n(s.type,r).typeName,f=u.referentialConstraint,e,o;if(f||"*"!=u.end[0].multiplicity||"*"!=u.end[1].multiplicity){if(e={nameOnServer:i.name,entityTypeName:l,isScalar:c,associationName:u.name},f){var a=f.principal,v=f.dependent,y=p(v.propertyRef),h=y.map(ei("name"));i.fromRole===a.role?e.invForeignKeyNamesOnServer=h:e.foreignKeyNamesOnServer=h}return o=new at(e),t._addPropertyCore(o),o}}function v(n,t){return t.enumType?y(n,t):t.extensions?w(n,t):!1}function y(n,t){var r=p(t.enumType),i=n.type.split("."),u=i[i.length-1];return r.some(function(n){return n.name===u})}function w(n,t){var r=t.extensions.filter(function(n){return"EnumType"===n.name}),i=n.type.split("."),u=i[i.length-1];return r.some(function(n){return n.attributes.some(function(n){return"Name"===n.name&&n.value===u})})}function k(n){var t,i;(n.isNullable||n.validators.push(o.required()),n.isComplexProperty)||(n.dataType===r.String?n.maxLength?(i={maxLength:n.maxLength},t=o.maxLength(i)):t=o.string():t=n.dataType.validatorCtor(),n.validators.push(t))}function d(n){var i=tt(Object.keys(n),function(n){return n.indexOf("StoreGeneratedPattern")>=0}),t,r;return i?"Identity"===n[i]:(t=n.extensions,!t)?!1:(r=tt(t,function(n){return"StoreGeneratedPattern"===n.name&&"Identity"===n.value}),!!r)}function g(t,i){var u=n(t.relationship,i).shortTypeName,r=i.association;return r?(Array.isArray(r)||(r=[r]),tt(r,function(n){return n.name===u})):null}function n(n,t){var r=fu(n),u;return t&&(u=i(r.shortTypeName,t),u&&(r=vi(r.shortTypeName,u))),r}function i(n,t){var r,u=t.cSpaceOSpaceMapping,i;return u&&(i=u[t.namespace+"."+n],r=i&&i.substr(0,i.length-(n.length+1)))?r:t.entityType||"Default"!=t.namespace?t.namespace:null}return{parse:e}}(),a=function(){function y(n,t){return n.entityAspect||n.complexAspect?n.getProperty(t.name):n[t.name]}function w(n){var t=n.name.replace(/\W/g,"_");return Function("return function "+t+"(){}")()}function s(n,t){var i=n.complexAspect.parentProperty.dataType.dataProperties;return i.every(function(i){var r,u,f;return i.isSettable?(r=n.getProperty(i.name),u=t.getProperty(i.name),i.isComplexProperty)?s(r,u):(f=i.dataType,r===u||f&&f.isDate&&r&&u&&r.valueOf()===u.valueOf()):!0})}function l(n){return n.filter(function(n){return null==n.baseProperty})}function i(n,t,i){var o=i+"OnServer",u=t[i],f,r,e;if(u&&u.length)f=p(u).map(function(i){var r=n.clientPropertyNameToServer(i,t),u=n.serverPropertyNameToClient(r,t);if(i!==u)throw new Error("NamingConvention for this client property name does not roundtrip properly:"+i+"-->"+u);return r}),t[o]=Array.isArray(u)?f:f[0];else{if(r=t[o],!r||0===r.length)return;e=p(r).map(function(i){var r=n.serverPropertyNameToClient(i,t),u=n.clientPropertyNameToServer(r,t);if(i!==u)throw new Error("NamingConvention for this server property name does not roundtrip properly:"+i+"-->"+u);return r});t[i]=Array.isArray(r)?e:e[0]}}function v(n,t){var i=t._getEntityType(n.complexTypeName,!0);if(!i)return!1;if(!(i instanceof pt))throw new Error("Unable to resolve ComplexType with the name: "+n.complexTypeName+" for the property: "+property.name);return n.dataType=i,n.defaultValue=null,!0}function u(n,t){var i,r;return n.entityType?!0:(i=t._getEntityType(n.entityTypeName,!0),i?(n.entityType=i,n._resolveNp()):(r=nr(t._incompleteTypeMap,n.entityTypeName),kt(r,n)),!!i)}function k(n,t){var i=n.getPropertyNames(),u=yt.getDefaultInstance(),f=u.getTrackablePropertyNames(t);f.forEach(function(u){var f,o,e;if(-1===i.indexOf(u)){f=t[u];try{"function"==typeof f&&(f=f())}catch(s){}o=r.fromValue(f);e=new b({name:u,dataType:o,isNullable:!0,isUnmapped:!0});e.isSettable=au(t,u);n.subtypes?n.getSelfAndSubtypes().forEach(function(n){n._addPropertyCore(new b(e))}):n._addPropertyCore(e)}})}var g=0,f=function(n){if(arguments.length>1)throw new Error("The EntityType ctor has a single argument that is either a 'MetadataStore' or a configuration object.");"MetadataStore"===n._$typeName?(this.metadataStore=n,this.shortName="Anon_"+ ++g,this.namespace="",this.isAnonymous=!0):c(n).whereParam("shortName").isNonEmptyString().whereParam("namespace").isString().isOptional().withDefault("").whereParam("baseTypeName").isString().isOptional().whereParam("isAbstract").isBoolean().isOptional().withDefault(!1).whereParam("autoGeneratedKeyType").isEnumOf(st).isOptional().withDefault(st.None).whereParam("defaultResourceName").isNonEmptyString().isOptional().withDefault(null).whereParam("dataProperties").isOptional().whereParam("navigationProperties").isOptional().whereParam("serializerFn").isOptional().isFunction().whereParam("custom").isOptional().applyAll(this);this.name=gt(this.shortName,this.namespace);this.dataProperties=[];this.navigationProperties=[];this.complexProperties=[];this.keyProperties=[];this.foreignKeyProperties=[];this.inverseForeignKeyProperties=[];this.concurrencyProperties=[];this.unmappedProperties=[];this.validators=[];this.warnings=[];this._mappedPropertiesCount=0;this.subtypes=[];lr(this,n.dataProperties,b);lr(this,n.navigationProperties,at)},n=f.prototype,e=r.parseRawValue;return n._$typeName="EntityType",f.qualifyTypeName=gt,n.setProperties=function(n){c(n).whereParam("autoGeneratedKeyType").isEnumOf(st).isOptional().whereParam("defaultResourceName").isString().isOptional().whereParam("serializerFn").isFunction().isOptional().whereParam("custom").isOptional().applyAll(this);n.defaultResourceName&&(this.defaultResourceName=n.defaultResourceName)},n.isSubtypeOf=function(n){t(n,"entityType").isInstanceOf(a).check();var i=this;do{if(i===n)return!0;i=i.baseEntityType}while(i);return!1},n.getSelfAndSubtypes=function(){var n=[this];return this.subtypes.forEach(function(t){var i=t.getSelfAndSubtypes();n.push.apply(n,i)}),n},n.getAllValidators=function(){for(var t=this.validators.slice(0),n=this.baseEntityType;n;)t.push.apply(t,n.validators),n=n.baseEntityType;return t},n.addProperty=function(n){return t(n,"property").isInstanceOf(b).or().isInstanceOf(at).check(),this._addPropertyCore(n,!0)},n._updateFromBase=function(n){this.baseEntityType=n;this.autoGeneratedKeyType===st.None&&(this.autoGeneratedKeyType=n.autoGeneratedKeyType);n.dataProperties.forEach(function(n){var t=new b(n);t.validators=[];t.baseProperty=n;this._addPropertyCore(t)},this);n.navigationProperties.forEach(function(n){var t=new at(n);t.validators=[];t.baseProperty=n;this._addPropertyCore(t)},this);n.subtypes.push(this)},n._addPropertyCore=function(n,t){var f,r,e;if(this.isFrozen)throw new Error("The '"+this.name+"' EntityType/ComplexType has been frozen. You can only add properties to an EntityType/ComplexType before any instances of that type have been created and attached to an entityManager.");if(f=n.parentType,f){if(f!==this)throw new Error("This property: "+n.name+" has already been added to "+n.parentType.name);return this}return n.parentType=this,r=this.metadataStore,(n.isDataProperty?this._addDataProperty(n):(this._addNavigationProperty(n),t&&r&&u(n,r)),!r||n.name&&n.nameOnServer||i(r.namingConvention,n,"name"),r&&this._extra&&this._extra.alreadyWrappedProps)&&(e=this._ctor.prototype,yt.getDefaultInstance().initializeEntityPrototype(e)),this},n.createEntity=function(n){if(n&&n._$eref&&!n._$eref.entityAspect.entityManager)return n._$eref;var t=this._createInstanceCore();return n&&(this.keyProperties.every(function(t){return null!=n[t.name]})&&(n._$eref=t),this._updateTargetFromRaw(t,n,y),this.navigationProperties.forEach(function(i){var u,r=n[i.name],f,e;void 0!=r&&(f=i.entityType,i.isScalar?(u=r.entityAspect?r:f.createEntity(r),t.setProperty(i.name,u)):(e=t.getProperty(i.name),r.forEach(function(n){u=n.entityAspect?n:f.createEntity(n);e.push(u)})))})),this._initializeInstance(t),t},n._createInstanceCore=function(){var t=this.getEntityCtor(),n=new t;return new ii(n),n},n._initializeInstance=function(n){this.baseEntityType&&this.baseEntityType._initializeInstance(n);var t=this.initFn;t&&("string"==typeof t&&(t=n[t]),t(n));this.complexProperties&&this.complexProperties.forEach(function(t){var i=n.getProperty(t.name);Array.isArray(i)?i.forEach(function(n){t.dataType._initializeInstance(n)}):t.dataType._initializeInstance(i)});n.entityAspect&&(n.entityAspect._initialized=!0)},n.getCtor=n.getEntityCtor=function(n){var r;if(this._ctor&&!n)return this._ctor;var u=this.metadataStore._ctorRegistry,i=u[this.name]||u[this.shortName]||{},t=i.ctor||this._ctor,f=t&&t.prototype&&(t.prototype.entityType||t.prototype.complexType);if(f&&f.metadataStore!==this.metadataStore)throw new Error("Cannot register the same constructor for "+this.name+" in different metadata stores.  Please define a separate constructor for each metadata store.");return(i.ctor&&n&&(this._extra=void 0),t)||(r=yt.getDefaultInstance().createCtor,t=r?r(this):w(this)),this.initFn=i.initFn,this.noTrackingFn=i.noTrackingFn,t.prototype._$typeName=this.name,this._setCtor(t),t},n._setCtor=function(n,t){var i=n.prototype,r;this._extra=this._extra||{};r=new n;k(this,r);"EntityType"===this._$typeName?i.entityType=this:i.complexType=this;i._$interceptor=t||ku;yt.getDefaultInstance().initializeEntityPrototype(i);this._ctor=n},n.addValidator=function(n,i){t(n,"validator").isInstanceOf(o).check();t(i,"property").isOptional().isString().or().isEntityProperty().check();i?("string"==typeof i&&(i=this.getProperty(i,!0)),i.validators.push(n)):this.validators.push(n)},n.getProperties=function(){return this.dataProperties.concat(this.navigationProperties)},n.getPropertyNames=function(){return this.getProperties().map(ei("name"))},n.getDataProperty=function(n){return tt(this.dataProperties,ki("name",n))},n.getNavigationProperty=function(n){return tt(this.navigationProperties,ki("name",n))},n.getProperty=function(n,t){var i=this.getPropertiesOnPath(n,!1,t);return i?i[i.length-1]:null},n.getPropertiesOnPath=function(n,t,i){i=i||!1;var f=Array.isArray(n)?n:n.trim().split("."),u=!0,r=this,e=t?"nameOnServer":"name",o=f.map(function(n){var t=tt(r.getProperties(),ki(e,n));if(t)r=t.isNavigationProperty?t.entityType:t.dataType;else{if(i)throw new Error("unable to locate property: "+n+" on entityType: "+r.name);u=!1}return t});return u?o:null},n.clientPropertyPathToServer=function(n,t){var i,t=t||".",r;return this.isAnonymous?(r=this.metadataStore.namingConvention.clientPropertyNameToServer,i=n.split(".").map(function(n){return r(n)})):i=this.getPropertiesOnPath(n,!1,!0).map(function(n){return n.nameOnServer}),i.join(t)},n.getEntityKeyFromRawEntity=function(n,t){var i=this.keyProperties.map(function(i){var r=t(n,i);return e(r,i.dataType)});return new h(this,i)},n._updateTargetFromRaw=function(n,t,i){var r,u;this.dataProperties.forEach(function(r){var o,u,h,f;if(r.isSettable&&(o=i(t,r),void 0!==o))if(h=r.dataType,r.isComplexProperty){if(null===o)return;(u=n.getProperty(r.name),r.isScalar)?h._updateTargetFromRaw(u,o,i):Array.isArray(o)?(f=o.map(function(t){var u=h._createInstanceCore(n,r);return h._updateTargetFromRaw(u,t,i),h._initializeInstance(u),u}),hi(u,f,s)||(u.length=0,f.forEach(function(n){u.push(n)}))):u.length=0}else r.isScalar?(f=e(o,h),n.setProperty(r.name,f)):(u=n.getProperty(r.name),Array.isArray(o))?(f=o.map(function(n){return e(n,h)}),hi(u,f)||(u.length=0,f.forEach(function(n){u.push(n)}))):u.length=0});r=t.entityAspect||t.complexAspect;r&&(u=n.entityAspect||n.complexAspect,r.originalValuesMap&&(u.originalValues=r.originalValuesMap),r.extraMetadata&&(u.extraMetadata=r.extraMetadata))},n.toString=function(){return this.name},n.toJSON=function(){return ht(this,{shortName:null,namespace:null,baseTypeName:null,isAbstract:!1,autoGeneratedKeyType:null,defaultResourceName:null,dataProperties:l,navigationProperties:l,validators:null,custom:null})},n._updateNames=function(n){var t=this.metadataStore.namingConvention;i(t,n,"name");n.isNavigationProperty&&(i(t,n,"foreignKeyNames"),i(t,n,"invForeignKeyNames"))},n._checkNavProperty=function(n){if(n.isNavigationProperty){if(n.parentType!==this)throw new Error(d("The navigationProperty '%1' is not a property of entity type '%2'",n.name,this.name));return n}if("string"==typeof n){var t=this.getProperty(n);if(t&&t.isNavigationProperty)return t}throw new Error("The 'navigationProperty' parameter must either be a NavigationProperty or the name of a NavigationProperty");},n._addDataProperty=function(n){this.dataProperties.push(n);n.isPartOfKey&&this.keyProperties.push(n);n.isComplexProperty&&this.complexProperties.push(n);n.concurrencyMode&&"None"!==n.concurrencyMode&&this.concurrencyProperties.push(n);n.isUnmapped&&this.unmappedProperties.push(n)},n._addNavigationProperty=function(n){this.navigationProperties.push(n);eu(n.entityTypeName)||(n.entityTypeName=gt(n.entityTypeName,this.namespace))},n._updateCps=function(){var n=this.metadataStore,t=n._incompleteComplexTypeMap;this.complexProperties.forEach(function(i){i.complexType||v(i,n)||nr(t,i.complexTypeName).push(i)});this.isComplexType&&((t[this.name]||[]).forEach(function(t){v(t,n)}),delete t[this.name])},n._updateNps=function(){var n=this.metadataStore,t;this.navigationProperties.forEach(function(t){u(t,n)});t=n._incompleteTypeMap;(t[this.name]||[]).forEach(function(t){u(t,n)});delete t[this.name]},f}(),pt=function(){var i=function(n){if(arguments.length>1)throw new Error("The ComplexType ctor has a single argument that is a configuration object.");c(n).whereParam("shortName").isNonEmptyString().whereParam("namespace").isString().isOptional().withDefault("").whereParam("dataProperties").isOptional().whereParam("isComplexType").isOptional().isBoolean().whereParam("custom").isOptional().applyAll(this);this.name=gt(this.shortName,this.namespace);this.isComplexType=!0;this.dataProperties=[];this.complexProperties=[];this.validators=[];this.concurrencyProperties=[];this.unmappedProperties=[];this.navigationProperties=[];this.keyProperties=[];lr(this,n.dataProperties,b)},n=i.prototype;return n.setProperties=function(n){c(n).whereParam("custom").isOptional().applyAll(this)},n.getAllValidators=function(){return this.validators},n._createInstanceCore=function(n,t){var r=this.getCtor(),i=new r;return new ar(i,n,t),i},n.addProperty=function(n){return t(n,"dataProperty").isInstanceOf(b).check(),this._addPropertyCore(n)},n.getProperties=function(){return this.dataProperties},n=s(n,a.prototype,["addValidator","getProperty","getPropertiesOnPath","getPropertyNames","_addPropertyCore","_addDataProperty","_updateNames","_updateCps","_initializeInstance","_updateTargetFromRaw","_setCtor"]),n.createInstance=a.prototype.createEntity,n.getCtor=a.prototype.getEntityCtor,n.toJSON=function(){return ht(this,{shortName:null,namespace:null,isComplexType:null,dataProperties:null,validators:null,custom:null})},n._$typeName="ComplexType",i}(),b=function(){var t=function(n){var i,t;if(c(n).whereParam("name").isString().isOptional().whereParam("nameOnServer").isString().isOptional().whereParam("dataType").isEnumOf(r).isOptional().or().isString().or().isInstanceOf(pt).whereParam("complexTypeName").isOptional().whereParam("isNullable").isBoolean().isOptional().withDefault(!0).whereParam("isScalar").isOptional().withDefault(!0).whereParam("defaultValue").isOptional().whereParam("isPartOfKey").isBoolean().isOptional().whereParam("isUnmapped").isBoolean().isOptional().whereParam("isSettable").isBoolean().isOptional().withDefault(!0).whereParam("concurrencyMode").isString().isOptional().whereParam("maxLength").isNumber().isOptional().whereParam("validators").isInstanceOf(o).isArray().isOptional().withDefault([]).whereParam("displayName").isOptional().whereParam("enumType").isOptional().whereParam("rawTypeName").isOptional().whereParam("custom").isOptional().applyAll(this),i=!(!this.name&&!this.nameOnServer),!i)throw new Error("A DataProperty must be instantiated with either a 'name' or a 'nameOnServer' property");if(this.complexTypeName)this.isComplexProperty=!0,this.dataType=null;else if("string"==typeof this.dataType){if(t=r.fromName(this.dataType),!t)throw new Error("Unable to find a DataType enumeration by the name of: "+this.dataType);this.dataType=t}else this.dataType||(this.dataType=r.String);if(null==this.defaultValue){if(this.isNullable)this.defaultValue=null;else if(!this.isComplexProperty)if(this.dataType===r.Binary)this.defaultValue="AAAAAAAAJ3U=";else if(this.defaultValue=this.dataType.defaultValue,null==this.defaultValue)throw new Error("A nonnullable DataProperty cannot have a null defaultValue. Name: "+(this.name||this.nameOnServer));}else this.dataType.isNumeric&&"string"==typeof this.defaultValue&&(this.defaultValue=parseFloat(this.defaultValue));this.isComplexProperty&&(this.isScalar=null==this.isScalar||this.isScalar===!0)},n=t.prototype;return n._$typeName="DataProperty",t.getRawValueFromServer=function(n,t){if(t.isUnmapped)return n[t.nameOnServer||t.name];var i=n[t.nameOnServer];return void 0!==i?i:t.defaultValue},t.getRawValueFromClient=function(n,t){var i=n[t.name];return void 0!==i?i:t.defaultValue},n.isDataProperty=!0,n.isNavigationProperty=!1,n.resolveProperty=function(n){for(var i=this[n],t=this.baseProperty;void 0==i&&null!=t;)i=t[n],t=t.baseProperty;return i},n.formatName=function(){return this.parentType.name+"--"+this.name},n.setProperties=function(n){c(n).whereParam("displayName").isOptional().whereParam("custom").isOptional().applyAll(this)},n.getAllValidators=function(){for(var t=this.validators.slice(0),n=this.baseProperty;n;)t.push.apply(t,n.validators),n=n.baseProperty;return t},n.toJSON=function(){return ht(this,{name:null,dataType:function(n){if(n&&n.parentEnum)return n.name},complexTypeName:null,isNullable:!0,defaultValue:null,isPartOfKey:!1,isUnmapped:!1,isSettable:!0,concurrencyMode:null,maxLength:null,validators:null,displayName:null,enumType:null,rawTypeName:null,isScalar:!0,custom:null})},t.fromJSON=function(n){return n.dataType=r.fromName(n.dataType),n.defaultValue&&n.dataType&&n.dataType.isDate&&(n.defaultValue=new Date(Date.parse(n.defaultValue))),n.validators&&(n.validators=n.validators.map(o.fromJSON)),new b(n)},t}(),at=function(){function t(n,t){throw new Error("Cannot set the inverse property for: "+n.formatName()+". "+t);}function i(n,t){throw new Error("Cannot create inverse for: "+n.formatName()+". The entityType for this navigation property "+t);}function u(n){var t=n.foreignKeyNames;if(0!==t.length){var i=n.parentType,r=t.map(function(n){return i.getDataProperty(n)}),u=i.foreignKeyProperties;r.forEach(function(t){kt(u,t);t.relatedNavigationProperty=n;kt(n.entityType.inverseForeignKeyProperties,t);n.relatedDataProperties?kt(n.relatedDataProperties,t):n.relatedDataProperties=[t]})}}var r=function(n){c(n).whereParam("name").isString().isOptional().whereParam("nameOnServer").isString().isOptional().whereParam("entityTypeName").isString().whereParam("isScalar").isBoolean().isOptional().withDefault(!0).whereParam("associationName").isString().isOptional().whereParam("foreignKeyNames").isArray().isString().isOptional().withDefault([]).whereParam("foreignKeyNamesOnServer").isArray().isString().isOptional().withDefault([]).whereParam("invForeignKeyNames").isArray().isString().isOptional().withDefault([]).whereParam("invForeignKeyNamesOnServer").isArray().isString().isOptional().withDefault([]).whereParam("validators").isInstanceOf(o).isArray().isOptional().withDefault([]).whereParam("displayName").isOptional().whereParam("custom").isOptional().applyAll(this);var t=!(!this.name&&!this.nameOnServer);if(!t)throw new Error("A Navigation property must be instantiated with either a 'name' or a 'nameOnServer' property");},n=r.prototype;return n._$typeName="NavigationProperty",n.isDataProperty=!1,n.isNavigationProperty=!0,s(n,b.prototype,["formatName","getAllValidators","resolveProperty"]),n.setProperties=function(n){if(!this.parentType)throw new Error("Cannot call NavigationProperty.setProperties until the parent EntityType of the NavigationProperty has been set.");var t=n.inverse;t&&delete n.inverse;c(n).whereParam("displayName").isOptional().whereParam("foreignKeyNames").isArray().isString().isOptional().withDefault([]).whereParam("invForeignKeyNames").isArray().isString().isOptional().withDefault([]).whereParam("custom").isOptional().applyAll(this);this.parentType._updateNames(this);this._resolveNp();t&&this.setInverse(t)},n.setInverse=function(n){var i;if(i="string"==typeof n?this.entityType.getNavigationProperty(n):n,!i)throw t(this,"Unable to find inverse property: "+invNpName);(this.inverse||i.inverse)&&t(this,"It has already been set on one side or the other.");i.entityType!=this.parentType&&t(this,i.formatName+" is not a valid inverse property for this.");this.associationName?i.associationName=this.associationName:(i.associationName||(i.associationName=this.formatName()+"_"+i.formatName()),this.associationName=i.associationName);this._resolveNp();i._resolveNp()},n.createInverse=function(n){var r,t;return this.entityType||i(this,"has not yet been defined."),this.entityType.isFrozen&&i(this,"is frozen."),r=this.entityType.metadataStore,null==r&&i(this,"has not yet been added to the metadataStore."),n.entityTypeName=this.parentEntityType.name,n.associationName=this.associationName,t=new at(n),this.parentEntityType.addNavigationProperty(t),t},n.toJSON=function(){return ht(this,{name:null,entityTypeName:null,isScalar:null,associationName:null,validators:null,displayName:null,foreignKeyNames:null,invForeignKeyNames:null,custom:null})},r.fromJSON=function(n){return n.validators&&(n.validators=n.validators.map(o.fromJSON)),new at(n)},n._resolveNp=function(){var n=this,t=n.entityType,i=tt(t.navigationProperties,function(t){return t.associationName===n.associationName&&(t.name!==n.name||t.entityTypeName!==n.entityTypeName)});n.inverse=i;i||n.invForeignKeyNames.forEach(function(i){var r=t.getDataProperty(i),u;if(!r)throw new Error("EntityType '"+n.entityTypeName+"' has no foreign key matching '"+i+"'");u=n.parentType;r.inverseNavigationProperty=tt(u.navigationProperties,function(n){return n.invForeignKeyNames&&n.invForeignKeyNames.indexOf(r.name)>=0&&n.entityType===r.parentType});kt(t.foreignKeyProperties,r)});u(n)},r}(),st=function(){var n=new ot("AutoGeneratedKeyType");return n.None=n.addSymbol(),n.Identity=n.addSymbol(),n.KeyGenerator=n.addSymbol(),n.resolveSymbols(),n}();!function(){function t(n,t){return null==t?!1:void 0!==t.entityType}function i(n,t){return null==t?!1:t.isDataProperty||t.isNavigationProperty}var n=ur.prototype;n.isEntity=function(){return this._addContext({fn:t,msg:" must be an entity"})};n.isEntityProperty=function(){return this._addContext({fn:i,msg:" must be either a DataProperty or a NavigationProperty"})}}();i.MetadataStore=ri;i.EntityType=a;i.ComplexType=pt;i.DataProperty=b;i.NavigationProperty=at;i.AutoGeneratedKeyType=st;vr=function(){function i(n,t,i){var u=t.name+".."+t.parentType.name,r=n._tempIdMap[u];return r||i&&(r={entityType:t.parentType,propertyName:t.name,keyMap:{}},n._tempIdMap[u]=r),r}var n=function(){this._tempIdMap={}},t=n.prototype;return t.generateTempKeyValue=function(n,t){var o=n.keyProperties,r,e,f,u;if(o.length>1)throw new Error("Ids can not be autogenerated for entities with multipart keys");if(e=o[0],f=i(this,e,!0),null!=t&&(f.keyMap[t.toString()]||(r=t)),void 0===r){if(u=e.dataType,!u.getNext)throw new Error("Cannot use a property with a dataType of: "+u.toString()+" for id generation");for(r=u.getNext(this);null!=f.keyMap[r.toString()];)r=u.getNext(this)}return f.keyMap[r.toString()]=!0,r},t.getTempKeys=function(){var t=[],i,n,r,u;for(i in this._tempIdMap){n=this._tempIdMap[i];r=n.entityType;for(u in n.keyMap)t.push(new h(r,[u]))}return t},t.isTempKey=function(n){var r=n.entityType.keyProperties,u,t;return r.length>1?!1:(u=r[0],t=i(this,u),t?void 0!==t.keyMap[n.values[0].toString()]:!1)},v.registerType(n,"KeyGenerator"),n}();i.KeyGenerator=vr;pi=function(){var n=function(n){c(n||{}).whereParam("name").isOptional().isString().whereParam("isCaseSensitive").isOptional().isBoolean().whereParam("usesSql92CompliantStringComparison").isBoolean().applyAll(this);this.name||(this.name=ci());v._storeObject(this,t._$typeName,this.name)},t=n.prototype;return t._$typeName="LocalQueryComparisonOptions",n.caseInsensitiveSQL=new n({name:"caseInsensitiveSQL",isCaseSensitive:!1,usesSql92CompliantStringComparison:!0}),n.defaultInstance=new n(n.caseInsensitiveSQL),t.setAsDefault=function(){return oi(this,n)},n}();i.LocalQueryComparisonOptions=pi;wi=function(){var n=function(n){c(n||{}).whereParam("name").isOptional().isString().whereParam("serverPropertyNameToClient").isFunction().whereParam("clientPropertyNameToServer").isFunction().applyAll(this);this.name||(this.name=ci());v._storeObject(this,t._$typeName,this.name)},t=n.prototype;return t._$typeName="NamingConvention",n.none=new n({name:"noChange",serverPropertyNameToClient:function(n){return n},clientPropertyNameToServer:function(n){return n}}),n.camelCase=new n({name:"camelCase",serverPropertyNameToClient:function(n){return n.substr(0,1).toLowerCase()+n.substr(1)},clientPropertyNameToServer:function(n){return n.substr(0,1).toUpperCase()+n.substr(1)}}),n.defaultInstance=new n(n.none),t.setAsDefault=function(){return oi(this,n)},n}();i.NamingConvention=wi;ft=function(){function o(n,t){var r=t.entityType,u,h,f;if(Array.isArray(n)){if(!t.isRHS)throw new Error("Array expressions are only permitted on the right hand side of a BinaryPredicate");return new i(n,t.dataType)}if(!ai(n)){if(null!=n&&wu(n)&&!n.toISOString){if(void 0===n.value)throw new Error("Unable to resolve an expression for: "+n+" on entityType: "+r.name);return n.isProperty?new e(n.value):new i(n.value,n.dataType||t.dataType,!0)}return new i(n,t.dataType)}if(t.isRHS)return null==r||r.isAnonymous?new i(n,t.dataType):v(n,t);for(var o,s=[],c=0;o=/\([^()]*\)/.exec(n);)u=o[0],s.push(u),h=p+c++,n=n.replace(u,h);return f=l(n,s,t),f._validate(r,t.usesNameOnServer),f}function l(n,t,i){var r=n.split(p);return 1===r.length?v(r[0],i):b(n,r,t,i)}function v(n,t){var u,o,s,f,h;return(n=n.trim(),u=n.substr(0,1),o=("'"===u||'"'===u)&&n.length>1&&n.substr(n.length-1)===u,o)?(s=n.substr(1,n.length-2),new i(s,t.dataType||r.String)):(f=t.entityType,null==f||f.isAnonymous)?new e(n):(h=nt.test(n),h&&null!=f.getPropertiesOnPath(n,t.usesNameOnServer,!1)?new e(n):new i(n,t.dataType))}function b(n,t,i,u){var o,f,h;try{o=t[0].trim().toLowerCase();f=i[t[1]].trim();"("===f.substr(0,1)&&(f=f.substr(1,f.length-2));var c=n.indexOf("'")>=0?tt:it,a=f.match(c),e=s({},u);return e.dataType=r.Undefined,e.isFnArg=!0,h=a.map(function(n){return l(n,i,e)}),new g(o,h)}catch(v){return null}}var n=function(){function o(t,i){var r=i[0];return r instanceof n?r=w(i):Array.isArray(r)||(r=[n(w(i))]),[t].concat(r)}function s(n,t,i){var r=t.toLowerCase();i.key=r;n[r]=i;i.aliases&&i.aliases.forEach(function(t){n[t.toLowerCase()]=i})}function e(n){var i={},r={},t;return i[n[0]]=r,t=n[1],t=t.operator||t,r[t]=3==n.length?n[2]:e(n.splice(2)),c(i)}function c(i){if(i instanceof n)return i;if("object"!=typeof i)throw new Error("Unable to convert to a Predicate: "+i);var u=Object.keys(i),r=u.map(function(n){return l(n,i[n])});return 1===r.length?r[0]:new t("and",r)}function l(n,i){if(t.prototype._resolveOp(n,!0))return new t(n,i);if(h.prototype._resolveOp(n,!0))return new h(n,i);if("object"!=typeof i||null==i||ct(i)||et(i,"value"))return new u("eq",n,i);if(Array.isArray(i))throw new Error("Unable to resolve predicate after the phrase: "+n);var r=n,e=Object.keys(i),f=e.map(function(n){if(y.prototype._resolveOp(n,!0))return new y(n,r,i[n]);if(u.prototype._resolveOp(n,!0))return new u(n,r,i[n]);if(et(i[n],"value"))return new u("eq",r,i[n]);var t=d("Unable to resolve predicate after the phrase: '%1' for operator: '%2'  and value: '%3'",r,n,i[n]);throw new Error(t);});return 1===f.length?f[0]:new t("and",f)}var r=function(){if(0!==arguments.length){if(1===arguments.length){var t=arguments[0];return Array.isArray(t)?1===t.length?n(t[0]):e(t):t instanceof n?t:"string"==typeof t?new k(t):c(t)}return e(Array.prototype.slice.call(arguments,0))}},i=r.prototype;return r.create=r,r.and=function(){var n=new t("and",w(arguments));return n.op&&n},r.or=function(){var n=new t("or",w(arguments));return n.op&&n},r.not=function(n){return n.not()},r.extendBinaryPredicateFn=function(n,t){var e=f.binaryPredicate,i,r;for(i in n||{})r=n[i],r.visitorFn=t,s(u.prototype.aliasMap,i,n[i]);f.isExtended||(f.binaryPredicate=function(n,t,i){var r=this.aliasMap[this.op.key].visitorFn;return r?r(n,t,i):e(n,t,i)},f.isExtended=!0)},i.and=function(){return new t("and",o(this,arguments))},i.or=function(){return new t("or",o(this,arguments))},i.not=function(){return new h("not",this)},i.toJSON=function(){return this.toJSONExt({entityType:this._entityType})},i.toJSONExt=function(n){return this.visit(n,rt)},i.toFunction=function(n){return this.visit(n,f)},i.toString=function(){return JSON.stringify(this)},i.visit=function(n,t){var r,i;if(ut(n))n={entityType:null};else if(n instanceof a)n={entityType:n};else if(!et(n,"entityType"))throw new Error("All visitor methods must be called with a context object containing at least an 'entityType' property");if(t?n.visitor=t:t=n.visitor,r=t[this.visitorMethodName],null==r)throw new Error("Unable to locate method: "+this.visitorMethodName+" on visitor");return i=n.entityType,(this._validate&&null==i||this._entityType!==i)&&(this._validate(i,n.usesNameOnServer),this._entityType=i),Array.prototype.slice.call(arguments,1),r.call(this,n)},i._initialize=function(n,t){var r,i;this.visitorMethodName=n;r=this.aliasMap={};for(i in t||{})s(r,i,t[i])},i._resolveOp=function(n,t){n=n.operator||n;var i=this.aliasMap[n.toLowerCase()];if(!i&&!t)throw new Error("Unable to resolve operator: "+n);return i},r}(),k=function(){var t=function(n){this.value=n},i=t.prototype=new n;return i._initialize("passthruPredicate"),i._validate=tu,t}(),h=function(){var t=function(t,i){this.op=this._resolveOp(t);this.pred=n(i)},i=t.prototype=new n;return i._initialize("unaryPredicate",{not:{aliases:["!","~"]}}),i._validate=function(n,t){this.pred._validate(n,t)},t}(),u=function(){var t=function(n,t,i){this.op=this._resolveOp(n);this.expr1Source=t;this.expr2Source=i},r=t.prototype=new n;return r._initialize("binaryPredicate",{eq:{aliases:["==","equals"]},ne:{aliases:["!=","~=","notequals"]},lt:{aliases:["<","lessthan"]},le:{aliases:["<=","lessthanorequal"]},gt:{aliases:[">","greaterthan"]},ge:{aliases:[">=","greaterthanorequal"]},startswith:{isFunction:!0},endswith:{isFunction:!0},contains:{aliases:["substringof"],isFunction:!0},"in":{}}),r._validate=function(n,t){var r={entityType:n,usesNameOnServer:t},u;if(this.expr1=o(this.expr1Source,r),null==this.expr1)throw new Error("Unable to validate 1st expression: "+this.expr1Source);if(this.expr1 instanceof i)throw new Error("The left hand side of a binary predicate cannot be a literal expression, it must be a valid property or functional predicate expression: "+this.expr1Source);if("in"==this.op.key&&!Array.isArray(this.expr2Source))throw new Error("The 'in' operator requires that its right hand argument be an array");if(u=s(r,{isRHS:!0,dataType:this.expr1.dataType}),this.expr2=o(this.expr2Source,u),null==this.expr2)throw new Error("Unable to validate 2nd expression: "+this.expr2Source);null==this.expr1.dataType&&(this.expr1.dataType=this.expr2.dataType)},t}(),t=function(){var t=function(t,i){return this.op=this._resolveOp(t),1==i.length&&Array.isArray(i[0])&&(i=i[0]),this.preds=i.filter(function(n){return null!=n}).map(function(t){return n(t)}),0==this.preds.length&&(this.op=null),1==this.preds.length?this.preds[0]:void 0},i=t.prototype=new n;return i._initialize("andOrPredicate",{and:{aliases:["&&"]},or:{aliases:["||"]}}),i._validate=function(n,t){this.preds.every(function(i){i._validate(n,t)})},t}(),y=function(){var t=function(t,i,r){this.op=this._resolveOp(t);this.exprSource=i;this.pred=n(r)},i=t.prototype=new n;return i._initialize("anyAllPredicate",{any:{aliases:["some"]},all:{aliases:["every"]}}),i._validate=function(n,t){this.expr=o(this.exprSource,{entityType:n,usesNameOnServer:t});(null==n||n.isAnonymous)&&(this.expr.dataType=null);this.pred._validate(this.expr.dataType,t)},t}(),c=function(t){this.visitorMethodName=t;this.visit=n.prototype.visit;this._validate=tu},i=function(){function t(n){if(null==n||r.contains(n))return n;if(ai(n)){var t=r.fromName(n);if(t)return t;throw new Error("Unable to resolve a dataType named: "+n);}throw new Error("The dataType parameter passed into this literal expression is not a 'DataType'"+n);}var n=function(n,i,u){i=t(i);i=i||r.fromValue(n);this.value=i&&i.parse?Array.isArray(n)?n.map(function(n){return i.parse(n,typeof n)}):i.parse(n,typeof n):n;this.dataType=i;this.hasExplicitDataType=u},i=n.prototype=new c("litExpr");return i.toString=function(){return" LitExpr - value: "+this.value.toString()+" dataType: "+this.dataType.toString()},n}(),e=function(){var n=function(n){this.propertyPath=n},t=n.prototype=new c("propExpr");return t.toString=function(){return" PropExpr - "+this.propertyPath},t._validate=function(n,t){var i,u,r;if(null!=n&&!n.isAnonymous){if(i=n.getPropertiesOnPath(this.propertyPath,t,!1),!i){u=d("Unable to resolve propertyPath.  EntityType: '%1'   PropertyPath: '%2'",n.name,this.propertyPath);throw new Error(u);}r=i[i.length-1];this.dataType=r.isDataProperty?r.dataType:r.entityType}},n}(),g=function(){var n=function(n,t){this.fnName=n;this.exprs=t;var r=i[n];if(null==r)throw new Error("Unknown function: "+n);this.localFn=r.fn;this.dataType=r.dataType},t=n.prototype=new c("fnExpr"),i;return t.toString=function(){var n=this.exprs.map(function(n){n.toString()}).toString();return"FnExpr - "+this.fnName+"("+n+")"},t._validate=function(n,t){this.exprs.forEach(function(i){i._validate(n,t)})},i=n.funcMap={toupper:{fn:function(n){return n.toUpperCase()},dataType:r.String},tolower:{fn:function(n){return n.toLowerCase()},dataType:r.String},substring:{fn:function(n,t,i){return n.substring(t,i)},dataType:r.String},substringof:{fn:function(n,t){return t.indexOf(n)>=0},dataType:r.Boolean},length:{fn:function(n){return n.length},dataType:r.Int32},trim:{fn:function(n){return n.trim()},dataType:r.String},concat:{fn:function(n,t){return n.concat(t)},dataType:r.String},replace:{fn:function(n,t,i){return n.replace(t,i)},dataType:r.String},startswith:{fn:function(n,t){return dt(n,t)},dataType:r.Boolean},endswith:{fn:function(n,t){return cr(n,t)},dataType:r.Boolean},indexof:{fn:function(n,t){return n.indexOf(t)},dataType:r.Int32},round:{fn:function(n){return Math.round(n)},dataType:r.Int32},ceiling:{fn:function(n){return Math.ceil(n)},dataType:r.Int32},floor:{fn:function(n){return Math.floor(n)},dataType:r.Int32},second:{fn:function(n){return n.getSeconds()},dataType:r.Int32},minute:{fn:function(n){return n.getMinutes()},dataType:r.Int32},day:{fn:function(n){return n.getDate()},dataType:r.Int32},month:{fn:function(n){return n.getMonth()+1},dataType:r.Int32},year:{fn:function(n){return n.getFullYear()},dataType:r.Int32}},n}(),nt=/^[a-z_][\w.$]*$/i,tt=/('[^']*'|[^,]+)/g,it=/("[^"]*"|[^,]+)/g,p=String.fromCharCode(191),f=function(){function t(n){switch(n.key){case"any":return function(n,t){return n.some(function(n){return t(n)})};case"all":return function(n,t){return n.every(function(n){return t(n)})};default:throw new Error("Unknown operator: "+n.key);}}function i(t,i,o){var h,c=t.op,s=r.getComparableFn(i);switch(c.key){case"eq":h=function(t,i){return t&&"string"==typeof t?n(t,i,o):s(t)==s(i)};break;case"ne":h=function(t,i){return t&&"string"==typeof t?!n(t,i,o):s(t)!=s(i)};break;case"gt":h=function(n,t){return s(n)>s(t)};break;case"ge":h=function(n,t){return s(n)>=s(t)};break;case"lt":h=function(n,t){return s(n)<s(t)};break;case"le":h=function(n,t){return s(n)<=s(t)};break;case"startswith":h=function(n,t){return u(n,t,o)};break;case"endswith":h=function(n,t){return f(n,t,o)};break;case"contains":h=function(n,t){return e(n,t,o)};break;case"in":h=function(n,t){return n=s(n),t=t.map(function(n){return s(n)}),t.indexOf(n)>=0};break;default:return null}return h}function n(n,t,i){return null==t?!1:("string"!=typeof t&&(t=t.toString()),i.usesSql92CompliantStringComparison&&(n=(n||"").trim(),t=(t||"").trim()),i.isCaseSensitive||(n=(n||"").toLowerCase(),t=(t||"").toLowerCase()),n===t)}function u(n,t,i){return i.isCaseSensitive||(n=(n||"").toLowerCase(),t=(t||"").toLowerCase()),dt(n,t)}function f(n,t,i){return i.isCaseSensitive||(n=(n||"").toLowerCase(),t=(t||"").toLowerCase()),cr(n,t)}function e(n,t,i){return i.isCaseSensitive||(n=(n||"").toLowerCase(),t=(t||"").toLowerCase()),n.indexOf(t)>=0}return{passthruPredicate:function(){throw new Error("Cannot execute an PassthruPredicate expression against the local cache: "+this.value);},unaryPredicate:function(n){var t=this.pred.visit(n);switch(this.op.key){case"not":return function(n){return!t(n)};default:throw new Error("Invalid unary operator:"+this.op.key);}},binaryPredicate:function(n){var r=this.expr1.visit(n),u=this.expr2.visit(n),f=this.expr1.dataType||this.expr2.dataType,e=n.entityType.metadataStore.localQueryComparisonOptions,t=i(this,f,e);if(null==t)throw new Error("Invalid binaryPredicate operator:"+this.op.key);return function(n){return t(r(n),u(n))}},andOrPredicate:function(n){var t=this.preds.map(function(t){return t.visit(n)});switch(this.op.key){case"and":return function(n){return t.reduce(function(t,i){return t&&i(n)},!0)};case"or":return function(n){return t.reduce(function(t,i){return t||i(n)},!1)};default:throw new Error("Invalid boolean operator:"+op.key);}},anyAllPredicate:function(n){var f=this.expr.visit(n),i=s({},n),r,u;return i.entityType=this.expr.dataType,r=this.pred.visit(i),u=t(this.op),function(n){return u(f(n),r)}},litExpr:function(){var n=this.value;return function(){return n}},propExpr:function(){var n=this.propertyPath,t=n.split(".");return 1===t.length?function(t){return t.getProperty(n)}:function(n){return rr(n,t)}},fnExpr:function(n){var t=this.exprs.map(function(t){return t.visit(n)}),i=this;return function(n){var r=t.map(function(t){return t(n)});return i.localFn.apply(null,r)}}}}(),rt=function(){function n(t,i){var r=Object.keys(i).every(function(r){if(t.hasOwnProperty(r)){if("object"!=typeof i[r]||null==n(t[r],i[r]))return!1}else t[r]=i[r];return!0});return r?t:null}return{passthruPredicate:function(){return this.value},unaryPredicate:function(n){var i=this.pred.visit(n),t={};return t[this.op.key]=i,t},binaryPredicate:function(n){var u=this.expr1.visit(n),t=this.expr2.visit(n),i={},r;return(this.expr2 instanceof e&&(t={value:t,isProperty:!0}),"eq"===this.op.key)?i[u]=t:(r={},i[u]=r,r[this.op.key]=t),i},andOrPredicate:function(t){var i,r=this.preds.map(function(n){return n.visit(t)});return"and"!==this.op.key||2!==r.length||r.some(ai)||(i=r.reduce(n)),null==i&&(i={},i[this.op.key]=r),i},anyAllPredicate:function(n){var u=this.expr.visit(n),t=s({},n);t.entityType=this.expr.dataType;var f=this.pred.visit(t),i={},r={};return r[this.op.key]=f,i[u]=r,i},litExpr:function(n){return this.hasExplicitDataType||n.useExplicitDataType?{value:this.value,dataType:this.dataType.name}:this.value},propExpr:function(n){return n.toNameOnServer?n.entityType.clientPropertyPathToServer(this.propertyPath):this.propertyPath},fnExpr:function(n){var t=this.exprs.map(function(t){return t.visit(n)});return this.fnName+"("+t.join(",")+")"}}}();return n}();i.Predicate=ft;var it=function(){function o(n,t){return ht(t,{"resourceName,from":null,"resultEntityType,toType":null,"wherePredicate,where":function(n){if(n)return new ft(n)},"orderByClause,orderBy":function(n){if(n)return new bi(n)},"selectClause,select":function(n){if(n)return new su(n)},"expandClause,expand":function(n){if(n)return new hu(n)},"skipCount,skip":null,"takeCount,take":null,parameters:function(n){if(!ut(n))return n},"inlineCountEnabled,inlineCount":!1,"noTrackingEnabled,noTracking":!1,queryOptions:function(n){if(n)return nt.fromJSON(n)}},n),n}function i(n,t,i){if(t&&n[t]===i)return n;var r=s(new it,n,["resourceName","fromEntityType","wherePredicate","orderByClause","selectClause","skipCount","takeCount","expandClause","inlineCountEnabled","noTrackingEnabled","usesNameOnServer","queryOptions","entityManager","dataService","resultEntityType"]);return r.parameters=s({},n.parameters),t&&(r[t]=i),r}function f(n,t,i,r){var o=i._$typeName||i.parentEnum&&i.parentEnum.name,u=o&&o.substr(0,1).toLowerCase()+o.substr(1),e;if(r&&u!=r)throw new Error("Invalid value for property: "+r);if(u){if(e=t[u],void 0===e)throw new Error("Invalid config property: "+u);null===e?n[u]=i:e(n,i)}else rt(i,function(i,r){f(n,t,r,i)})}function u(n){return t(n,"propertyPaths").isOptional().isString().or().isArray().isString().check(),"string"==typeof n&&(n=n.split(",")),n=n.map(function(n){return n.trim()})}function c(n){var t=n.entityType,i=t.keyProperties.map(function(t){return ft.create(t.name,fr.Equals,n.getProperty(t.name))});return ft.and(i)}function e(n){var t=n.entityType.keyProperties,i=gi(t,n.values,function(n,t){return ft.create(n.name,fr.Equals,t)});return ft.and(i)}function v(n,t){var u,f,i,r,o,s;return t.isScalar?0===t.foreignKeyNames.length?null:(u=t.foreignKeyNames.map(function(t){return n.getProperty(t)}),f=new h(t.entityType,u),e(f)):(i=t.inverse,r=i?i.foreignKeyNames:t.invForeignKeyNames,0===r.length)?null:(o=n.entityAspect.getKey().values,s=gi(r,o,function(n,t){return ft.create(n,fr.Equals,t)}),ft.and(s))}var r=function(n){return null==n||ai(n)?(this.resourceName=n,this.fromEntityType=null,this.wherePredicate=null,this.orderByClause=null,this.selectClause=null,this.skipCount=null,this.takeCount=null,this.expandClause=null,this.parameters={},this.inlineCountEnabled=!1,this.noTrackingEnabled=!1,void(this.entityManager=null)):o(this,n)},n=r.prototype;return n._$typeName="EntityQuery",n.from=function(n){return t(n,"resourceName").isString().check(),i(this,"resourceName",n)},r.from=function(n){return t(n,"resourceName").isString().check(),new it(n)},n.toType=function(n){return t(n,"entityType").isString().or().isInstanceOf(a).check(),i(this,"resultEntityType",n)},n.where=function(n){return null!=n&&(n=ft.create(w(arguments)),this.fromEntityType&&n._validate(this.fromEntityType),this.wherePredicate&&(n=this.wherePredicate.and(n))),i(this,"wherePredicate",n)},n.orderBy=function(n,t){var r=null==n?null:new bi(u(n),t);return this.orderByClause&&r&&(r=new bi([this.orderByClause,r])),i(this,"orderByClause",r)},n.orderByDesc=function(n){return this.orderBy(n,!0)},n.select=function(n){var t=null==n?null:new su(u(n));return i(this,"selectClause",t)},n.skip=function(n){return t(n,"count").isOptional().isNumber().check(),i(this,"skipCount",null==n?null:n)},n.top=function(n){return this.take(n)},n.take=function(n){return t(n,"count").isOptional().isNumber().check(),i(this,"takeCount",null==n?null:n)},n.expand=function(n){var t=null==n?null:new hu(u(n));return i(this,"expandClause",t)},n.withParameters=function(n){return t(n,"parameters").isObject().check(),i(this,"parameters",n)},n.inlineCount=function(n){return t(n,"enabled").isBoolean().isOptional().check(),n=void 0===n?!0:!!n,i(this,"inlineCountEnabled",n)},n.useNameOnServer=function(n){return t(n,"usesNameOnServer").isBoolean().isOptional().check(),n=void 0===n?!0:!!n,i(this,"usesNameOnServer",n)},n.noTracking=function(n){return t(n,"enabled").isBoolean().isOptional().check(),n=void 0===n?!0:!!n,i(this,"noTrackingEnabled",n)},n.using=function(n){if(!n)return this;var t=i(this);return f(t,{entityManager:null,dataService:null,queryOptions:null,fetchStrategy:function(n,t){n.queryOptions=(n.queryOptions||new nt).using(t)},mergeStrategy:function(n,t){n.queryOptions=(n.queryOptions||new nt).using(t)},jsonResultsAdapter:function(n,t){n.dataService=(n.dataService||new l).using({jsonResultsAdapter:t})}},n),t},n.execute=function(n,t){if(!this.entityManager)throw new Error("An EntityQuery must have its EntityManager property set before calling 'execute'");return this.entityManager.executeQuery(this,n,t)},n.executeLocally=function(){if(!this.entityManager)throw new Error("An EntityQuery must have its EntityManager property set before calling 'executeLocally'");return this.entityManager.executeQueryLocally(this)},n.toJSON=function(){return this.toJSONExt()},n.toJSONExt=function(n){n=n||{};n.entityType=n.entityType||this.fromEntityType;n.propertyPathFn=n.toNameOnServer?n.entityType.clientPropertyPathToServer.bind(n.entityType):yu;var t=function(t){if(t)return t.toJSONExt(n)};return ht(this,{"from,resourceName":null,"toType,resultEntityType":function(n){if(n)return ai(n)?n:n.name},"where,wherePredicate":t,"orderBy,orderByClause":t,"select,selectClause":t,"expand,expandClause":t,"skip,skipCount":null,"take,takeCount":null,parameters:function(n){if(!ut(n))return n},"inlineCount,inlineCountEnabled":!1,"noTracking,noTrackingEnabled":!1,queryOptions:null})},r.fromEntities=function(n){var u,r,f;if(t(n,"entities").isEntity().or().isNonEmptyArray().isEntity().check(),Array.isArray(n)||(n=w(arguments)),u=n[0],r=u.entityType,n.some(function(n){return n.entityType!==r}))throw new Error("All 'fromEntities' must be the same type; at least one is not of type "+r.name);var i=new it(r.defaultResourceName),e=n.map(function(n){return c(n)}),o=ft.or(e);return i=i.where(o),f=u.entityAspect.entityManager,f&&(i=i.using(f)),i},r.fromEntityKey=function(n){t(n,"entityKey").isInstanceOf(h).check();var i=new it(n.entityType.defaultResourceName),r=e(n);return i.where(r).toType(n.entityType)},r.fromEntityNavigation=function(n,i){var u;t(n,"entity").isEntity().check();var f=n.entityType._checkNavProperty(i),r=new it(f.entityType.defaultResourceName),e=v(n,f);return r=r.where(e),u=n.entityAspect.entityManager,u?r.using(u):r},n._getFromEntityType=function(n,t){var i=this.fromEntityType,r,u;if(i)return i;if(r=this.resourceName,!r)throw new Error("There is no resourceName for this query");if(n.isEmpty()){if(t)throw new Error("There is no metadata available for this query. Are you querying the local cache before you've fetched metadata?");return null}if(u=n.getEntityTypeNameForResourceName(r),i=u?n._getEntityType(u):this._getToEntityType(n,!0),!i){if(t)throw new Error(d("Cannot find an entityType for resourceName: '%1'.  Consider adding an 'EntityQuery.toType' call to your query or calling the MetadataStore.setEntityTypeForResourceName method to register an entityType for this resourceName.",r));return null}return this.fromEntityType=i,i},n._getToEntityType=function(n,t){return this.resultEntityType instanceof a?this.resultEntityType:this.resultEntityType?(this.resultEntityType=n._getEntityType(this.resultEntityType,!1),this.resultEntityType):t?null:!this.selectClause&&this._getFromEntityType(n,!1)},n._toUri=function(n){var t=l.resolve([n.dataService]);return t.uriBuilder.buildUri(this,n.metadataStore)},r}(),fr=function(){var n=new ot("FilterQueryOp");return n.Equals=n.addSymbol({operator:"eq"}),n.NotEquals=n.addSymbol({operator:"ne"}),n.GreaterThan=n.addSymbol({operator:"gt"}),n.LessThan=n.addSymbol({operator:"lt"}),n.GreaterThanOrEqual=n.addSymbol({operator:"ge"}),n.LessThanOrEqual=n.addSymbol({operator:"le"}),n.Contains=n.addSymbol({operator:"contains"}),n.StartsWith=n.addSymbol({operator:"startswith"}),n.EndsWith=n.addSymbol({operator:"endswith"}),n.Any=n.addSymbol({operator:"any"}),n.All=n.addSymbol({operator:"all"}),n.IsTypeOf=n.addSymbol({operator:"isof"}),n.resolveSymbols(),n}(),bi=(function(){var n=new ot("BooleanQueryOp");return n.And=n.addSymbol({operator:"and"}),n.Or=n.addSymbol({operator:"or"}),n.Not=n.addSymbol({operator:"not"}),n.resolveSymbols(),n}(),function(){var u=function(t,i){var r;if(t.length>1){if(t[0]instanceof bi)return void(this.items=Array.prototype.concat.apply(t[0].items,t.slice(1).map(ei("items"))));r=t.map(function(t){return new n(t,i)})}else r=[new n(t[0],i)];this.items=r},t=u.prototype,n,i;return t.validate=function(n){null==n||n.isAnonymous||this.items.forEach(function(t){t.validate(n)})},t.getComparer=function(n){var t=this.items.map(function(t){return t.getComparer(n)});return function(n,i){for(var u,r=0;r<t.length;r++)if(u=t[r](n,i),0!==u)return u;return 0}},t.toJSONExt=function(n){return this.items.map(function(t){return n.propertyPathFn(t.propertyPath)+(t.isDesc?" desc":"")})},n=function(n,t){var i,r;if("string"!=typeof n)throw new Error("propertyPath is not a string");if(n=n.trim(),i=n.split(" "),i.length>1&&t!==!0&&t!==!1&&(t=dt(i[1].toLowerCase(),"desc"),!t)&&(r=dt(i[1].toLowerCase(),"asc"),!r))throw new Error("the second word in the propertyPath must begin with 'desc' or 'asc'");this.propertyPath=i[0];this.isDesc=t},i=n.prototype,i.validate=function(n){null==n||n.isAnonymous||(this.lastProperty=n.getProperty(this.propertyPath,!0))},i.getComparer=function(n){var u,f,t,i;return(this.lastProperty||this.validate(n),this.lastProperty)&&(u=this.lastProperty.dataType,f=this.lastProperty.parentType.metadataStore.localQueryComparisonOptions.isCaseSensitive),t=this.propertyPath,i=this.isDesc,function(n,e){var o=rr(n,t),s=rr(e,t),c=u||o&&r.fromValue(o)||r.fromValue(s),h;return c===r.String?f?(o=o||"",s=s||""):(o=(o||"").toLowerCase(),s=(s||"").toLowerCase()):(h=r.getComparableFn(c),o=h(o),s=h(s)),o===s?0:o>s||void 0===s?i?-1:1:i?1:-1}},u}()),su=function(){var t=function(n){this.propertyPaths=n;this._pathNames=n.map(function(n){return n.replace(".","_")})},n=t.prototype;return n.validate=function(n){null==n||n.isAnonymous||this.propertyPaths.forEach(function(t){n.getProperty(t,!0)})},n.toFunction=function(){var n=this;return function(t){var i={};return n.propertyPaths.forEach(function(r,u){i[n._pathNames[u]]=rr(t,r)}),i}},n.toJSONExt=function(n){return this.propertyPaths.map(function(t){return n.propertyPathFn(t)})},t}(),hu=function(){var n=function(n){this.propertyPaths=n},t=n.prototype;return t.toJSONExt=function(n){return this.propertyPaths.map(function(t){return n.propertyPathFn(t)})},n}();i.FilterQueryOp=fr;i.EntityQuery=it;i.OrderByClause=bi;var y=function(){var n=new ot("MergeStrategy");return n.PreserveChanges=n.addSymbol(),n.OverwriteChanges=n.addSymbol(),n.SkipMerge=n.addSymbol(),n.Disallowed=n.addSymbol(),n.resolveSymbols(),n}(),ui=function(){var n=new ot("FetchStrategy");return n.FromServer=n.addSymbol(),n.FromLocalCache=n.addSymbol(),n.resolveSymbols(),n}(),nt=function(){function i(n,t){return t&&c(t).whereParam("fetchStrategy").isEnumOf(ui).isOptional().whereParam("mergeStrategy").isEnumOf(y).isOptional().whereParam("includeDeleted").isBoolean().isOptional().applyAll(n),n}var n=function(n){i(this,n)},t=n.prototype;return t._$typeName="QueryOptions",n.resolve=function(n){return new nt(kr(n,["fetchStrategy","mergeStrategy","includeDeleted"]))},n.defaultInstance=new n({fetchStrategy:ui.FromServer,mergeStrategy:y.PreserveChanges,includeDeleted:!1}),t.using=function(n){if(!n)return this;var t=new nt(this);return y.contains(n)?n={mergeStrategy:n}:ui.contains(n)&&(n={fetchStrategy:n}),i(t,n)},t.setAsDefault=function(){return oi(this,n)},t.toJSON=function(){return ht(this,{fetchStrategy:null,mergeStrategy:null,includeDeleted:!1})},n.fromJSON=function(n){return new nt({fetchStrategy:ui.fromName(n.fetchStrategy),mergeStrategy:y.fromName(n.mergeStrategy),includeDeleted:n.includeDeleted===!0})},n}();return i.QueryOptions=nt,i.FetchStrategy=ui,i.MergeStrategy=y,cu=function(){function i(n){if(n){if(1===n.length){var t=n[0];return function(n){return!!n&&n.entityAspect.entityState===t}}return function(t){return!!t&&-1!==n.indexOf(t.entityAspect.entityState)}}return function(n){return!!n}}var t=function(n,t){this.entityManager=n;this.entityType=t;this.entityType.isFrozen=!0;this._indexMap={};this._entities=[];this._emptyIndexes=[]},n=t.prototype;return n.attachEntity=function(n,t,i){var r=n.entityAspect,e,u,o;if(r._initialized||this.entityType._initializeInstance(n),delete r._initialized,e=r.getKey()._keyInGroup,u=this._indexMap[e],u>=0){var f=this._entities[u],s=f.entityAspect.entityState,h=s.isUnchanged();if(f===n)r.entityState=t;else{if(i===y.Disallowed)throw new Error("A MergeStrategy of 'Disallowed' does not allow you to attach an entity when an entity with the same key is already attached: "+r.getKey());(i===y.OverwriteChanges||i===y.PreserveChanges&&h)&&(o=this.entityManager.helper.unwrapInstance(n),this.entityType._updateTargetFromRaw(f,o,b.getRawValueFromServer),f.entityAspect.setEntityState(t))}return f}return 0===this._emptyIndexes.length?u=this._entities.push(n)-1:(u=this._emptyIndexes.pop(),this._entities[u]=n),this._indexMap[e]=u,r.entityState=t,r.entityGroup=this,r.entityManager=this.entityManager,n},n.detachEntity=function(n){var r=n.entityAspect,i=r.getKey()._keyInGroup,t=this._indexMap[i];if(void 0===t)throw new Error("internal error - entity cannot be found in group");return delete this._indexMap[i],this._emptyIndexes.push(t),this._entities[t]=null,n},n.findEntityByKey=function(n){var i,t;return i=n instanceof h?n._keyInGroup:h.createKeyString(n),t=this._indexMap[i],void 0!==t?this._entities[t]:null},n.hasChanges=function(){for(var t,i=this._entities,r=u.Unchanged,n=0,f=i.length;f>n;n++)if(t=i[n],t&&t.entityAspect.entityState!==r)return!0;return!1},n.getChanges=function(){for(var n,i=this._entities,f=u.Unchanged,r=[],t=0,e=i.length;e>t;t++)n=i[t],n&&n.entityAspect.entityState!==f&&r.push(n);return r},n.getEntities=function(n){var t=i(n);return this._entities.filter(t)},n._checkOperation=function(n){return this._entities.forEach(function(t){t&&t.entityAspect._checkOperation(n)}),this},n._clear=function(){this._entities.forEach(function(n){null!=n&&n.entityAspect._detach()});this._entities=null;this._indexMap=null;this._emptyIndexes=null},n._updateFkVal=function(n,t,i){var r=n.name;this._entities.forEach(function(n){null!=n&&n.getProperty(r)==t&&n.setProperty(r,i)})},n._fixupKey=function(n,t){var r=this._indexMap[n],i,u;if(void 0===r)throw new Error("Internal Error in key fixup - unable to locate entity");i=this._entities[r];u=i.entityType.keyProperties[0].name;i.setProperty(u,t);delete i.entityAspect.hasTempKey;delete this._indexMap[n];this._indexMap[t]=r},n._replaceKey=function(n,t){var i=this._indexMap[n._keyInGroup];delete this._indexMap[n._keyInGroup];this._indexMap[t._keyInGroup]=i},t}(),yr=function(){function yt(n,t,i){var u=i?nt.defaultInstance:n.queryOptions,f=i?wt.defaultInstance:n.saveOptions,e=i?ti.defaultInstance:n.validationOptions,r=c(t).whereParam("serviceName").isOptional().isString().whereParam("dataService").isOptional().isInstanceOf(l).whereParam("queryOptions").isInstanceOf(nt).isOptional().withDefault(u).whereParam("saveOptions").isInstanceOf(wt).isOptional().withDefault(f).whereParam("validationOptions").isInstanceOf(ti).isOptional().withDefault(e).whereParam("keyGeneratorCtor").isFunction().isOptional();i&&(r=r.whereParam("metadataStore").isInstanceOf(ri).isOptional().withDefault(new ri));r.applyAll(n);di(n.queryOptions,u);di(n.saveOptions,f);di(n.validationOptions,e);t.serviceName&&(n.dataService=new l({serviceName:n.serviceName}));n.serviceName=n.dataService&&n.dataService.serviceName;n.keyGeneratorCtor=n.keyGeneratorCtor||vr;(i||t.keyGeneratorCtor)&&(n.keyGenerator=new n.keyGeneratorCtor)}function pt(n,i){var f,c,e,o,s,l;t(i,"query").isInstanceOf(it).check();var a=n.metadataStore,u=i._getFromEntityType(a,!0),v=wr(n,u),h=i.wherePredicate&&i.wherePredicate.toFunction({entityType:u}),y=nt.resolve([i.queryOptions,n.queryOptions,nt.defaultInstance]),p=y.includeDeleted===!0,w=function(n){return n&&(p||!n.entityAspect.entityState.isDeleted())&&(h?h(n):!0)},r=[];return v.forEach(function(n){r.push.apply(r,n._entities.filter(w))}),f=i.orderByClause&&i.orderByClause.getComparer(u),(f&&r.sort(f),i.inlineCountEnabled)&&(c=r.length),e=i.skipCount,e&&(r=r.slice(e)),o=i.takeCount,o&&(r=r.slice(0,o)),s=i.selectClause,s&&(l=s.toFunction(),r=r.map(l)),{results:r,inlineCount:c}}function yi(n){n.forEach(function(n){var t=[],i=n.entityAspect;rt(i._validationErrors,function(n,i){i.isServerError&&t.push(n)});0!==t.length&&i._processValidationOpAndPublish(function(){t.forEach(function(n){i._removeValidationError(n)})})})}function pi(n){var t=[];return n.forEach(function(n){rt(n.entityAspect._validationErrors,function(i,r){var u=s({entity:n,errorName:r.validator.name},r,["errorMessage","propertyName","isServerError"]);t.push(u)})}),t}function wi(n,t){var r=t.entityErrors,i,u;r&&(i=n.entityManager,u=i.metadataStore,t.entityErrors=r.map(function(n){var t=null,r,f;if(n.keyValues&&(r=u._getEntityType(n.entityTypeName),f=new h(r,n.keyValues),t=i.findEntityByKey(f)),t){var o=n.propertyName?{propertyName:n.propertyName,property:r.getProperty(n.propertyName)}:{},c=lt.getKey(n.errorName||n.errorMessage,n.propertyName),e=new lt(null,o,n.errorMessage,c);e.isServerError=!0;t.entityAspect.addValidationError(e)}return s({entity:t,isServerError:!0},n,["errorName","errorMessage","propertyName"])}))}function kt(n,t){var i,f=gt(n,t),r=f.entityKey,o=0===f.remainingArgs.length?!1:!!f.remainingArgs[0],u=!1;return o&&(i=n.getEntityByKey(r),u=!!i,u&&!n.queryOptions.includeDeleted&&i.entityAspect.entityState.isDeleted()&&(i=null,u=n.queryOptions.mergeStrategy!==y.OverwriteChanges)),u?e.resolve({entity:i,entityKey:r,fromCache:!0}):it.fromEntityKey(r).using(n).execute().then(function(n){return i=0===n.results.length?null:n.results[0],e.resolve({entity:i,entityKey:r,fromCache:!1})})}function o(n,i){return t(i,"entityTypes").isString().isOptional().or().isNonEmptyArray().isString().or().isInstanceOf(a).or().isNonEmptyArray().isInstanceOf(a).check(),"string"==typeof i?i=n.metadataStore._getEntityType(i,!1):Array.isArray(i)&&"string"==typeof i[0]&&(i=i.map(function(t){return n.metadataStore._getEntityType(t,!1)})),i}function dt(n,t){var i,r=et(n,t);return r.forEach(function(n){if(n){var t=n.getChanges();i?i.push.apply(i,t):i=t}}),i||[]}function bi(n,t,i){var r,u=et(n,t);return u.forEach(function(n){if(n){var t=n.getEntities(i);r?r.push.apply(r,t):r=t}}),r||[]}function gt(n,t){try{if(t[0]instanceof h)return{entityKey:t[0],remainingArgs:w(t,1)};if(t.length>=2){var i="string"==typeof t[0]?n.metadataStore._getEntityType(t[0],!1):t[0];return{entityKey:new h(i,t[1]),remainingArgs:w(t,2)}}}catch(r){}throw new Error("Must supply an EntityKey OR an EntityType name or EntityType followed by a key value or an array of key values.");}function ft(n,t){n.forEach(function(n){n.entityAspect.isBeingSaved=t})}function ki(n,t){var i,e=t&&t[0],s,r,f;return e?(i={},e.entityType)?t.forEach(function(n){if(n.entityAspect.entityState==u.Detached)throw new Error("Unable to export an entity with an EntityState of 'Detached'");var t=i[n.entityType.name];t||(t={},t.entityType=n.entityType,t._entities=[],i[n.entityType.name]=t);t._entities.push(n)}):(s=o(n,t),s.forEach(function(t){var r=n._entityGroupMap[t.name];r&&r._entities.length&&(i[t.name]=r)})):i=n._entityGroupMap,r=[],f={},rt(i,function(n,t){f[n]=tr(t,r)}),{entityGroupMap:f,tempKeys:r}}function tr(n,t){var i={},r=n.entityType,f=r.dataProperties,e=at(r),u=[];return n._entities.forEach(function(n){if(n){var i=ni(n,f,e,t);u.push(i)}}),i.entities=u,i}function ni(n,t,i,r){var e={},u,f,o;return t.forEach(function(t){var u=t.name,r=n.getProperty(u),f;(null!=r||null!=t.defaultValue)&&(r&&t.isComplexProperty?(f=t.dataType.dataProperties,r=si(r,function(n){return ni(n,f,i)})):(r=i?i(t,r):r,t.isUnmapped&&(r=bt(r))),void 0!==r&&(e[u]=r))}),n.entityAspect?(u=n.entityAspect,o=u.entityState,f={tempNavPropNames:ir(u,r),entityState:o.name},u.extraMetadata&&(f.extraMetadata=u.extraMetadata),(o.isModified()||o.isDeleted())&&(f.originalValuesMap=u.originalValues),e.entityAspect=f):(u=n.complexAspect,f={},u.originalValues&&!ut(u.originalValues)&&(f.originalValuesMap=u.originalValues),e.complexAspect=f),e}function ir(n,t){var r=n.entity,i;return n.hasTempKey&&t.push(n.getKey().toJSON()),r.entityType.navigationProperties.forEach(function(n){if(n.relatedDataProperties){var t=r.getProperty(n.name);t&&t.entityAspect.hasTempKey&&(i=i||[],i.push(n.name))}}),i}function rr(n,t,i){var s=i.tempKeyMap,f=n.entityType,e=i.mergeStrategy,r=null,c=n.entityManager,l=c.entityChanged,a=[],o=b.getRawValueFromClient;return t.entities.forEach(function(t){var p=t.entityAspect,w=f.getEntityKeyFromRawEntity(t,o),i=u.fromName(p.entityState),v,b,k;if(!i||i==u.Detached)throw new Error("Only entities with a non detached entity state may be imported.");if(v=i.isAdded()&&ei(s,w),r=v?null:n.findEntityByKey(w)){if(e!==y.SkipMerge){if(e===y.Disallowed)throw new Error("A MergeStrategy of 'Disallowed' prevents "+w.toString()+" from being merged");b=r.entityAspect.entityState;k=b.isUnchanged();(e===y.OverwriteChanges||k)&&(f._updateTargetFromRaw(r,t,o),r.entityAspect.setEntityState(i),l.publish({entityAction:g.MergeOnImport,entity:r}))}}else r=f._createInstanceCore(),f._updateTargetFromRaw(r,t,o),v&&(r.entityAspect.hasTempKey=!0,r.setProperty(f.keyProperties[0].name,v.values[0]),p.tempNavPropNames&&p.tempNavPropNames.forEach(function(n){var t=f.getNavigationProperty(n),i=t.relatedDataProperties[0].name,u=r.getProperty(i),e=new h(t.entityType,[u]),o=ei(s,e);r.setProperty(i,o.values[0])})),r=n.attachEntity(r,i),l.publish({entityAction:g.AttachOnImport,entity:r}),i.isUnchanged()||c._notifyStateChange(r,!0);a.push(r)}),a}function ei(n,t){var i=n[t.toString()],r,u,f;if(i)return i;if(r=t._subtypes,!r)return null;for(u=0,f=r.length;f>u;u++)if(i=n[t.toString(r[u])])return i;return null}function oi(n,t,i){return n.then(function(n){return t&&t(n),e.resolve(n)},function(n){return i&&i(n),e.reject(n)})}function ur(n,t){return t?t.filter(function(t){if(t.entityAspect.entityManager!==n)throw new Error("Only entities in this entityManager may be saved");return!t.entityAspect.entityState.isDetached()}):n.getChanges()}function fr(n,t){n._inKeyFixup=!0;t.forEach(function(t){var i=n._entityGroupMap[t.entityTypeName];if(!i)throw new Error("Unable to locate the following fully qualified EntityType name: "+t.entityTypeName);i._fixupKey(t.tempValue,t.realValue)});n._inKeyFixup=!1}function et(n,t){var i=n._entityGroupMap;return t?p(t).map(function(n){if(n instanceof a)return i[n.name];throw new Error("The EntityManager.getChanges() 'entityTypes' parameter must be either an entityType or an array of entityTypes or null");}):br(i)}function er(n,t){var i=t.entityAspect.getKey(),r=gi(t.entityType.keyProperties,i.values,function(n,t){return n.defaultValue===t?n:null}).filter(function(n){return null!==n});if(r.length)if(t.entityType.autoGeneratedKeyType!==st.None)n.generateTempKeyValue(t);else if(r.length===i.values.length)throw new Error("Cannot attach an object of type  ("+t.entityType.name+") to an EntityManager without first setting its key or setting its entityType 'AutoGeneratedKeyType' property to something other than 'None'");}function or(n,t){return t?(t=p(t),t.forEach(function(n){if(!u.contains(n))throw new Error("The EntityManager.getChanges() 'entityStates' parameter must either be null, an entityState or an array of entityStates");}),t):null}function hr(n,t,i,r){var u=t.entityType.navigationProperties;u.forEach(function(u){var f=t.getProperty(u.name);if(u.isScalar){if(!f)return;n.attachEntity(f,i,r)}else f.forEach(function(t){n.attachEntity(t,i,r)})})}function hi(n,t,i,r){var f,h,s,u,c;try{if(h=n.metadataStore,h.isEmpty()&&r.hasServerMetadata)throw new Error("cannot execute _executeQueryCore until metadataStore is populated.");if(i.fetchStrategy===ui.FromLocalCache)try{return s=pt(n,t),e.resolve({results:s.results,entityManager:n,inlineCount:s.inlineCount,query:t})}catch(o){return e.reject(o)}return u=new pr({query:t,entityManager:n,dataService:r,mergeOptions:{mergeStrategy:i.mergeStrategy,noTracking:!!t.noTrackingEnabled,includeDeleted:i.includeDeleted}}),c=n.validationOptions.validateOnQuery,r.adapterInstance.executeQuery(u).then(function(i){var o=dr(function(){var t={isLoading:n.isLoading};return n.isLoading=!0,n._pendingPubs=[],t},function(i){n.isLoading=i.isLoading;n._pendingPubs.forEach(function(n){n()});n._pendingPubs=null;n._hasChangesAction&&n._hasChangesAction();t=null;u=null;i.error&&e.reject(i.error)},function(){var e=r.jsonResultsAdapter.extractResults(i),o;return e=p(e),f=u.visitAndMerge(e,{nodeType:"root"}),c&&f.forEach(function(n){n.entityAspect&&n.entityAspect.validateEntity()}),u.processDeferred(),cr(f,t),o=fi(u.refMap),{results:f,query:t,entityManager:n,httpResponse:i.httpResponse,inlineCount:i.inlineCount,retrievedEntities:o}});return e.resolve(o)},function(i){return i&&(i.query=t,i.entityManager=n),e.reject(i)})}catch(o){return o&&(o.query=t),e.reject(o)}}function cr(n,t){if(!t.noTrackingEnabled){var i=t.expandClause;null!=i&&i.propertyPaths.forEach(function(t){var i=t.split(".");li(n,i)})}}function li(n,t){var i=t[0];n.forEach(function(n){var u=n.entityAspect,r;u&&(u._markAsLoaded(i),1!==t.length)&&(r=n.getProperty(i),r&&(r.arrayChanged||(r=[r]),li(r,t.slice(1))))})}function lr(n){var t=n.filter(function(n){return n.entityAspect.isBeingSaved=!0,n.entityAspect.entityState.isModified()&&n.entityType.concurrencyProperties.length>0});0!==t.length&&t.forEach(function(n){n.entityType.concurrencyProperties.forEach(function(t){ar(n,t)})})}function ar(n,t){var i,f,u;if(!n.entityAspect.originalValues[t.name])if(i=n.getProperty(t.name),i||(i=t.dataType.defaultValue),t.dataType.isNumeric)n.setProperty(t.name,i+1);else if(t.dataType.isDate){for(f=new Date,u=new Date;f.getTime()===u.getTime();)u=new Date;n.setProperty(t.name,u)}else{if(t.dataType!==r.Guid){if(t.dataType===r.Binary)return;throw new Error("Unable to update the value of concurrency property before saving: "+t.name);}n.setProperty(t.name,ci())}}function ot(n,t){var i=n._entityGroupMap[t.name];return i||(i=new cu(n,t),n._entityGroupMap[t.name]=i),i}function wr(n,t){var i=t.getSelfAndSubtypes();return i.map(function(t){return ot(n,t)})}function ht(n,t){var i={},u=n.entityType||n.complexType,f=at(u),r={};return u.dataProperties.forEach(function(u){if(u.isComplexProperty)i[u.nameOnServer]=si(n.getProperty(u.name),function(n){return ht(n,t)});else{var e=n.getProperty(u.name);if(e=t?t(u,e):e,void 0===e)return;e=f?f(u,e):e;void 0!==e&&(u.isUnmapped?r[u.nameOnServer]=bt(e):i[u.nameOnServer]=e)}}),ut(r)||(i.__unmapped=r),i}function ct(n,t,i){var f=n.entityType||n.complexType,e=n.entityAspect||n.complexAspect,u=t.namingConvention.clientPropertyNameToServer,r={};return rt(e.originalValues,function(n,t){var e=f.getProperty(n);t=i?i(e,t):t;void 0!==t&&(r[u(n,e)]=t)}),f.complexProperties.forEach(function(f){var o=n.getProperty(f.name),e,s;f.isScalar?(e=ct(o,t,i),ut(e)||(r[u(f.name,f)]=e)):(s=o.map(function(n){return ct(n,t,i)}),r[u(f.name,f)]=s)}),r}function kr(n,t,i){var r=n.entityType,f=at(r),e=t.namingConvention.clientPropertyNameToServer,u={};return rt(n.entityAspect.originalValues,function(t){var s=r.getProperty(t),o=n.getProperty(t);o=i?i(s,o):o;void 0!==o&&(o=f?f(s,o):o,void 0!==o&&(u[e(t,s)]=o))}),r.complexProperties.forEach(function(t){if(ai(n,t)){var r=n.getProperty(t.name);u[e(t.name,t)]=si(r,function(n){return ht(n,i)})}}),u}function ai(n,t){var i=n.getProperty(t.name);return t.isScalar?vi(i):i._origValues?!0:i.some(function(n){return vi(n)})}function vi(n){return ut(n.complexAspect.originalValues)?n.complexType.complexProperties.some(function(t){return ai(n,t)}):!0}function at(n){return n.serializerFn||n.metadataStore&&n.metadataStore.serializerFn}function f(){this.map={}}var d=function(n){if(arguments.length>1)throw new Error("The EntityManager ctor has a single optional argument that is either a 'serviceName' or a configuration object.");0===arguments.length?n={serviceName:""}:"string"==typeof n&&(n={serviceName:n});yt(this,n,!0);this.entityChanged=new k("entityChanged",this);this.validationErrorsChanged=new k("validationErrorsChanged",this);this.hasChangesChanged=new k("hasChangesChanged",this);this.clear()},n=d.prototype;return n._$typeName="EntityManager",k.bubbleEvent(n,null),n.setProperties=function(n){yt(this,n,!1)},n.createEntity=function(n,i,r,f){t(n,"entityType").isString().or().isInstanceOf(a).check();t(r,"entityState").isEnumOf(u).isOptional().check();t(f,"mergeStrategy").isEnumOf(y).isOptional().check();"string"==typeof n&&(n=this.metadataStore._getEntityType(n));r=r||u.Added;var e;return vt(this,"isLoading",!0,function(){e=n.createEntity(i)}),r!==u.Detached&&(e=this.attachEntity(e,r,f)),e},d.importEntities=function(n,t){var i=new yr;return i.importEntities(n,t),i},n.acceptChanges=function(){this.getChanges().map(function(n){return n.entityAspect._checkOperation("acceptChanges")}).forEach(function(n){n.acceptChanges()})},n.exportEntities=function(n,r){var f,u;return t(n,"entities").isArray().isEntity().or().isNonEmptyArray().isInstanceOf(a).or().isNonEmptyArray().isString().or().isOptional().check(),t(r,"config").isObject().or().isBoolean().or().isOptional().check(),null==r?r={includeMetadata:!0,asString:!0}:"boolean"==typeof r&&(r={includeMetadata:r,asString:!0}),c(r).whereParam("asString").isBoolean().isOptional().withDefault(!0).whereParam("includeMetadata").isBoolean().isOptional().withDefault(!0).applyAll(r),f=ki(this,n),u=s({},f,["tempKeys","entityGroupMap"]),r.includeMetadata?(u=s(u,this,["dataService","saveOptions","queryOptions","validationOptions"]),u.metadataStore=this.metadataStore.exportMetadata()):(u.metadataVersion=i.metadataVersion,u.metadataStoreName=this.metadataStore.name),r.asString?JSON.stringify(u,null,v.stringifyPad):u},n.importEntities=function(n,t){var r,i,u,f;return t=t||{},c(t).whereParam("mergeStrategy").isEnumOf(y).isOptional().withDefault(this.queryOptions.mergeStrategy).whereParam("metadataVersionFn").isFunction().isOptional().applyAll(t),r=this,i="string"==typeof n?JSON.parse(n):n,i.metadataStore?(this.metadataStore.importMetadata(i.metadataStore),this.dataService=i.dataService&&l.fromJSON(i.dataService)||new l({serviceName:i.serviceName}),this.saveOptions=new wt(i.saveOptions),this.queryOptions=nt.fromJSON(i.queryOptions),this.validationOptions=new ti(i.validationOptions)):t.metadataVersionFn&&t.metadataVersionFn({metadataVersion:i.metadataVersion,metadataStoreName:i.metadataStoreName}),u={},i.tempKeys.forEach(function(n){var t=h.fromJSON(n,r.metadataStore);u[t.toString()]=new h(t.entityType,r.keyGenerator.generateTempKeyValue(t.entityType,t.values[0]))}),f=[],t.tempKeyMap=u,dr(function(){r._pendingPubs=[]},function(){r._pendingPubs.forEach(function(n){n()});r._pendingPubs=null;r._hasChangesAction&&r._hasChangesAction()},function(){rt(i.entityGroupMap,function(n,i){var u=r.metadataStore._getEntityType(n,!0),e=ot(r,u),o=rr(e,i,t);Array.prototype.push.apply(f,o)});f.forEach(function(n){n.entityAspect.entityState.isDeleted()||r._linkRelatedEntities(n)})}),{entities:f,tempKeyMapping:u}},n.clear=function(){fi(this._entityGroupMap,function(n,t){return t._checkOperation()}).forEach(function(n){n._clear()});this._entityGroupMap={};this._unattachedChildrenMap=new f;this.keyGenerator=new this.keyGeneratorCtor;this.entityChanged.publish({entityAction:g.Clear});this._setHasChanges(!1)},n.createEmptyCopy=function(){return new d(s({},this,["dataService","metadataStore","queryOptions","saveOptions","validationOptions","keyGeneratorCtor"]))},n.addEntity=function(n){return this.attachEntity(n,u.Added)},n.attachEntity=function(n,i,r){var f,s,e,o;if(t(n,"entity").isRequired().check(),this.metadataStore._checkEntityType(n),i=t(i,"entityState").isEnumOf(u).isOptional().check(u.Unchanged),r=t(r,"mergeStrategy").isEnumOf(y).isOptional().check(y.Disallowed),n.entityType.metadataStore!==this.metadataStore)throw new Error("Cannot attach this entity because the EntityType ("+n.entityType.name+") and MetadataStore associated with this entity does not match this EntityManager's MetadataStore.");if(f=n.entityAspect,f){if(f._inProcessEntity)return f._inProcessEntity}else f=new ii(n);if(s=f.entityManager,s){if(s===this)return n;throw new Error("This entity already belongs to another EntityManager");}return o=this,vt(this,"isLoading",!0,function(){i.isAdded()&&er(o,n);e=o._attachEntityCore(n,i,r);f._inProcessEntity=e;try{hr(o,n,i,r)}finally{f._inProcessEntity=null}}),this.validationOptions.validateOnAttach&&e.entityAspect.validateEntity(),i.isUnchanged()||this._notifyStateChange(e,!0),this.entityChanged.publish({entityAction:g.Attach,entity:e}),e},n.detachEntity=function(n){t(n,"entity").isEntity().check();var i=n.entityAspect;if(!i)return!1;if(i.entityManager!==this)throw new Error("This entity does not belong to this EntityManager.");return i.setDetached()},n.fetchMetadata=function(n,i,r){"function"==typeof n?(r=i,i=n,n=null):(t(n,"dataService").isInstanceOf(l).isOptional().check(),t(i,"callback").isFunction().isOptional().check(),t(r,"errorCallback").isFunction().isOptional().check());var u=this.metadataStore.fetchMetadata(n||this.dataService);return oi(u,i,r)},n.executeQuery=function(n,i,r){var f,e,u,o;return t(n,"query").isInstanceOf(it).or().isString().check(),t(i,"callback").isFunction().isOptional().check(),t(r,"errorCallback").isFunction().isOptional().check(),e=nt.resolve([n.queryOptions,this.queryOptions,nt.defaultInstance]),u=l.resolve([n.dataService,this.dataService]),!u.hasServerMetadata||this.metadataStore.hasMetadataFor(u.serviceName)?f=hi(this,n,e,u):(o=this,f=this.fetchMetadata(u).then(function(){return hi(o,n,e,u)})),oi(f,i,r)},n.executeQueryLocally=function(n){return pt(this,n).results},n.saveChanges=function(n,i,r,u){function p(n){var t=s.entityManager;return ft(f,!1),n.entities=s.processSavedEntities(n),t._setHasChanges(null),r&&r(n),e.resolve(n)}function w(n){var t=n.entities,r,i;return 0===t.length?[]:(r=n.keyMappings,i=s.entityManager,fr(i,r),vt(i,"isLoading",!0,function(){var n=new pr({query:null,entityManager:i,mergeOptions:{mergeStrategy:y.OverwriteChanges},dataService:a});t=n.visitAndMerge(t,{nodeType:"root"})}),t)}function b(n){return ft(f,!1),wi(s,n),u&&u(n),e.reject(n)}var f,c,v,o,h;if(t(n,"entities").isOptional().isArray().isEntity().check(),t(i,"saveOptions").isInstanceOf(wt).isOptional().check(),t(r,"callback").isFunction().isOptional().check(),t(u,"errorCallback").isFunction().isOptional().check(),i=i||this.saveOptions||wt.defaultInstance,f=ur(this,n),0===f.length)return c={entities:[],keyMappings:[]},r&&r(c),e.resolve(c);if(!i.allowConcurrentSaves&&(v=f.some(function(n){return n.entityAspect.isBeingSaved}),v))return o=new Error("Concurrent saves not allowed - SaveOptions.allowConcurrentSaves is false"),u&&u(o),e.reject(o);if(yi(f),h=this.saveChangesValidateOnClient(f),h)return u&&u(h),e.reject(h);var a=l.resolve([i.dataService,this.dataService]),s={entityManager:this,dataService:a,processSavedEntities:w,resourceName:i.resourceName||this.saveOptions.resourceName||"SaveChanges"},k={entities:f,saveOptions:i};try{return lr(f),a.adapterInstance.saveChanges(s,k).then(p).then(null,b)}catch(o){return ft(f,!1),u&&u(o),e.reject(o)}},n.saveChangesValidateOnClient=function(n){var t,i;return this.validationOptions.validateOnSave&&(t=n.filter(function(n){var t=n.entityAspect,i=t.entityState.isDeleted()||t.validateEntity();return!i}),t.length>0)?(i=new Error("Client side validation errors encountered - see the entityErrors collection on this object for more detail"),i.entityErrors=pi(t),i):null},n._findEntityGroup=function(n){return this._entityGroupMap[n.name]},n.getEntityByKey=function(){var n=gt(this,arguments).entityKey,i=n._subtypes||[n.entityType],t=null;return i.some(function(i){var r=this._findEntityGroup(i);return t=r&&r.findEntityByKey(n)},this),t},n.fetchEntityByKey=function(){var n=l.resolve([this.dataService]),t,i;return!n.hasServerMetadata||this.metadataStore.hasMetadataFor(n.serviceName)?kt(this,arguments):(t=this,i=arguments,this.fetchMetadata(n).then(function(){return kt(t,i)}))},n.findEntityByKey=function(n){return this.getEntityByKey(n)},n.generateTempKeyValue=function(n){t(n,"entity").isEntity().check();var i=n.entityType,r=this.keyGenerator.generateTempKeyValue(i),u=i.keyProperties[0];return n.setProperty(u.name,r),n.entityAspect.hasTempKey=!0,r},n.hasChanges=function(n){return this._hasChanges?void 0===n?this._hasChanges:this._hasChangesCore(n):!1},n._hasChangesCore=function(n){n=o(this,n);var t=et(this,n);return t.some(function(n){return n&&n.hasChanges()})},n.getChanges=function(n){return n=o(this,n),dt(this,n)},n.rejectChanges=function(){if(!this._hasChanges)return[];var n=dt(this,null),t=n.map(function(n){return n.entityAspect._checkOperation("rejectChanges")});return this._hasChanges=!1,t.forEach(function(n){n.rejectChanges()}),this.hasChangesChanged.publish({entityManager:this,hasChanges:!1}),n},n.getEntities=function(n,i){return n=o(this,n),t(i,"entityStates").isOptional().isEnumOf(u).or().isNonEmptyArray().isEnumOf(u).check(),i=i&&or(this,i),bi(this,n,i)},n._notifyStateChange=function(n,t){var i={entityAction:g.EntityStateChange,entity:n};if(t)this._hasChanges||this._setHasChanges(!0);else if(this._hasChanges){if(this.isLoading)return void(this._hasChangesAction=this._hasChangesAction||function(){this._setHasChanges(null);this.entityChanged.publish(i)}.bind(this));this._setHasChanges(null)}this.entityChanged.publish(i)},n._setHasChanges=function(n){null==n&&(n=this._hasChangesCore());var t=this._hasChanges;this._hasChanges=n;n!=t&&this.hasChangesChanged.publish({entityManager:this,hasChanges:n});this._hasChangesAction=null},n._linkRelatedEntities=function(n){var t=this,i=n.entityAspect;vt(t,"isLoading",!0,function(){var r=t._unattachedChildrenMap,f=i.getKey(),e=r.getTuples(f);e&&e.slice(0).forEach(function(t){var i,e,h=t.children.filter(function(n){return n.entityAspect.entityState!==u.Detached}),o=t.navigationProperty,c,s;o.inverse?(i=o,e=o.inverse,e.isScalar)?(c=h[0],n.setProperty(e.name,c),c.setProperty(i.name,n)):(s=n.getProperty(e.name),h.forEach(function(t){s.push(t);t.setProperty(i.name,n)})):o.isScalar?(i=o,h.forEach(function(t){t.setProperty(i.name,n)})):(e=o,s=n.getProperty(e.name),h.forEach(function(n){s._push(n)}));r.removeChildren(f,i)});n.entityType.navigationProperties.forEach(function(u){var o,f,e;if((!u.isScalar||(o=n.getProperty(u.name),!o))&&(f=i.getParentKey(u),f)){if(f._isEmpty())return;e=t.findEntityByKey(f);e?n.setProperty(u.name,e):r.addChild(f,u,n)}});n.entityType.foreignKeyProperties.forEach(function(i){var u=i.inverseNavigationProperty;if(u){var o=n.getProperty(i.name),e=new h(u.parentType,[o]),f=t.findEntityByKey(e);f?u.isScalar?f.setProperty(u.name,n):t.isLoading?f.getProperty(u.name)._push(n):f.getProperty(u.name).push(n):r.addChild(e,u,n)}})})},n._attachEntityCore=function(n,t,i){var u=ot(this,n.entityType),r=u.attachEntity(n,t,i);return this._linkRelatedEntities(r),r},n._updateFkVal=function(n,t,i){var r=this._entityGroupMap[n.parentType.name];r&&r._updateFkVal(n,t,i)},n.helper={unwrapInstance:ht,unwrapOriginalValues:ct,unwrapChangedValues:kr},f.prototype.addChild=function(n,t,i){var r=this.getTuple(n,t);r||(r={navigationProperty:t,children:[]},nr(this.map,n.toString()).push(r));r.children.push(i)},f.prototype.removeChildren=function(n,t){var i=this.getTuples(n);i&&(sr(i,function(n){return n.navigationProperty===t}),i.length||delete this.map[n.toString()])},f.prototype.getChildren=function(n,t){var i=this.getTuple(n,t);return i?i.children.filter(function(n){return!n.entityAspect.entityState.isDetached()}):null},f.prototype.getTuple=function(n,t){var i=this.getTuples(n);return i?tt(i,function(n){return n.navigationProperty===t}):null},f.prototype.getTuples=function(n){for(var r,i=this.map[n.toString()],t=n.entityType;!i&&t.baseEntityType;)t=t.baseEntityType,r=n.toString(t),i=this.map[r];return i},d}(),i.EntityManager=yr,pr=function(){function t(n,t,r,u){var e,f;return r.ignore||null==t?null:r.nodeRefId?(e=k(n,r.nodeRefId),"function"==typeof e&&null!=u?void n.deferredFns.push(function(){u(e)}):e):r.entityType?(f=r.entityType,n.mergeOptions.noTracking?(t=i(n,f,t),f.noTrackingFn&&(t=f.noTrackingFn(t,f)),r.nodeId&&(n.refMap[r.nodeId]=t),t):f.isComplexType?i(n,f,t):d(n,t,r)):(r.passThru||"object"!=typeof t||ct(t)||(t=w(n,t)),r.nodeId&&(n.refMap[r.nodeId]=t),t)}function i(n,t,r){var u={};return t.dataProperties.forEach(function(t){u[t.name]=t.isComplexProperty?si(r[t.nameOnServer],function(r){return i(n,t.dataType,r)}):ut(r[t.nameOnServer],t.dataType)}),t.navigationProperties&&t.navigationProperties.forEach(function(t){var i={nodeType:"navProp",navigationProperty:t};f(r[t.nameOnServer],n,i,u,t.name)}),u}function w(n,t){var r=n.metadataStore.namingConvention.serverPropertyNameToClient,i={};return rt(t,function(t,u){var e=r(t),o={nodeType:"anonProp",propertyName:e};f(u,n,o,i,e)}),i}function f(n,i,r,u,f){var o=i.jsonResultsAdapter,e=o.visitNode(n,i,r)||{};return n=e.node||n,e.ignore?void 0:e.passThru?n:void(Array.isArray(n)?(r.nodeType=r.nodeType+"Item",u[f]=n.map(function(n,s){return e=o.visitNode(n,i,r)||{},n=e.node||n,t(i,n,e,function(n){u[f][s]=n()})})):u[f]=t(i,n,e,function(n){u[f]=n()}))}function k(n,t){var i=n.refMap[t];return void 0===i?function(){return n.refMap[t]}:i}function e(n,t,i){var r=i._$meta.nodeId;null!=r&&(n.refMap[r]=t)}function d(n,t,i){var f,e,c,v;t._$meta=i;f=n.entityManager;e=i.entityType;"string"==typeof e&&(e=n.metadataStore._getEntityType(e,!1));t.entityType=e;var s=n.mergeOptions.mergeStrategy,l=null==n.query,a=e.getEntityKeyFromRawEntity(t,n.rawValueFn),r=f.findEntityByKey(a);if(r){if(l&&r.entityAspect.entityState.isDeleted())return f.detachEntity(r),r;if(c=r.entityAspect.entityState,s===y.Disallowed)throw new Error("A MergeStrategy of 'Disallowed' prevents "+a.toString()+" from being merged");if(s===y.SkipMerge)o(n,r,t);else if(s===y.OverwriteChanges||c.isUnchanged())h(n,r,t),r.entityAspect.wasLoaded=!0,i.extraMetadata&&(r.entityAspect.extraMetadata=i.extraMetadata),r.entityAspect.entityState=u.Unchanged,r.entityAspect.originalValues={},r.entityAspect.propertyChanged.publish({entity:r,propertyName:null}),v=l?g.MergeOnSave:g.MergeOnQuery,f.entityChanged.publish({entityAction:v,entity:r}),c.isUnchanged()||f._notifyStateChange(r,!1);else{if(c==u.Deleted&&!n.mergeOptions.includeDeleted)return null;o(n,r,t)}}else r=e._createInstanceCore(),h(n,r,t),i.extraMetadata&&(r.entityAspect.extraMetadata=i.extraMetadata),f._attachEntityCore(r,u.Unchanged,s),r.entityAspect.wasLoaded=!0,f.entityChanged.publish({entityAction:g.AttachOnQuery,entity:r});return r}function o(n,t,i){e(n,t,i);i.entityType.navigationProperties.forEach(function(t){t.isScalar?c(n,i,t):l(n,i,t)})}function h(n,t,i){e(n,t,i);var r=t.entityType;r._updateTargetFromRaw(t,i,n.rawValueFn);r.navigationProperties.forEach(function(r){r.isScalar?nt(n,r,t,i):tt(n,r,t,i)})}function nt(n,t,i,r){var u=c(n,r,t);null!=u&&("function"==typeof u?n.deferredFns.push(function(){u=u();a(u,i,t)}):a(u,i,t))}function tt(n,t,i,r){var e=l(n,r,t),u,f;null!=e&&(u=t.inverse,u&&(f=i.getProperty(t.name),f.wasLoaded=!0,e.forEach(function(t){"function"==typeof t?n.deferredFns.push(function(){t=t();v(t,f,i,u)}):v(t,f,i,u)})))}function c(n,t,i){var r=t[i.nameOnServer];return r?n.visitAndMerge(r,{nodeType:"navProp",navigationProperty:i}):null}function l(n,t,i){var r=t[i.nameOnServer];return r?!Array.isArray(r)&&(r=r.results,!r)?null:n.visitAndMerge(r,{nodeType:"navPropItem",navigationProperty:i}):null}function a(n,t,i){var u,f,r,e;if(n&&(u=i.name,f=t.getProperty(u),f!==n)){if(t.setProperty(u,n),r=i.inverse,!r)return;r.isScalar?n.setProperty(r.name,t):(e=n.getProperty(r.name),e.push(t))}}function v(n,t,i,r){if(n){var u=n.getProperty(r.name);u!==i&&(t.push(n),n.setProperty(r.name,i))}}var p=function(n){s(this,n,["query","entityManager","dataService","mergeOptions"]);this.refMap={};this.deferredFns=[];this.jsonResultsAdapter=this.dataService.jsonResultsAdapter;this.metadataStore=this.entityManager.metadataStore;this.rawValueFn=b.getRawValueFromServer},n=p.prototype,ut=r.parseRawValue;return n._$typeName="MappingContext",n.getUrl=function(){var n=this.query,t;if(!n)throw new Error("query cannot be empty");if("string"==typeof n)t=n;else{if(!(n instanceof it))throw new Error("unable to recognize query parameter as either a string or an EntityQuery");t=this.dataService.uriBuilder.buildUri(n,this.metadataStore)}return this.dataService.qualifyUrl(t)},n.visitAndMerge=function(n,i){var u=this.query,f=this.jsonResultsAdapter,r;return i=i||{},r=this,si(n,function(n){if(null==u&&n.entityAspect)return n.entityAspect.entityState.isDeleted()?r.entityManager.detachEntity(n):n.entityAspect.acceptChanges(),n;var e=f.visitNode(n,r,i)||{};return n=e.node||n,u&&"root"===i.nodeType&&!e.entityType&&(e.entityType=u._getToEntityType&&u._getToEntityType(r.metadataStore)),t(r,n,e)},this.mergeOptions.includeDeleted)},n.processDeferred=function(){this.deferredFns.length>0&&this.deferredFns.forEach(function(n){n()})},p}(),wt=function(){function i(n,t){return t&&c(t).whereParam("resourceName").isOptional().isString().whereParam("dataService").isOptional().isInstanceOf(l).whereParam("allowConcurrentSaves").isBoolean().isOptional().whereParam("tag").isOptional().applyAll(n),n}var n=function(n){i(this,n)},t=n.prototype;return t._$typeName="SaveOptions",t.setAsDefault=function(){return oi(this,n)},t.using=function(n){return i(this,n)},n.defaultInstance=new n({allowConcurrentSaves:!1}),n}(),i.SaveOptions=wt,i.AbstractDataServiceAdapter=function(){function u(){this.getRequest=function(n){return n};this.done=function(){}}function t(t,i,r){var u=o(i);return n._catchNoConnectionError(u),r&&(u.message=r+"; "+u.message),t.reject(u)}function o(n){var i=new Error,t,u,o;if(i.httpResponse=n,i.status=n.status,t=n.data,!t)return i.message=n.error&&n.error.toString(),i;if("string"==typeof t)try{t=JSON.parse(t)}catch(h){return i.message=t,i}var f,r,e=n.saveContext,u=t.Message||t.ExceptionMessage||t.EntityErrors||t.Errors,s=!!u;if(s){u=t;do f=u.ExceptionMessage||u.Message,u=u.InnerException;while(u);r=t.Errors||t.EntityErrors;r=r&&r.map(function(n){return{errorName:n.ErrorName,entityTypeName:ri.normalizeTypeName(n.EntityTypeName),keyValues:n.KeyValues,propertyName:n.PropertyName,errorMessage:n.ErrorMessage}})}else f=t.message,r=t.errors||t.entityErrors;return e&&r&&(o=e.entityManager.metadataStore.namingConvention.serverPropertyNameToClient,r.forEach(function(n){n.propertyName=n.propertyName&&o(n.propertyName)}),i.entityErrors=r),i.message=f||"Server side errors encountered - see the entityErrors collection on this object for more detail",i}var r,f=function(){},n=f.prototype;return n.checkForRecomposition=function(n){"ajax"===n.interfaceName&&n.isDefault&&this.initialize()},n.initialize=function(){if(r=i.config.getAdapterInstance("ajax"),!r||!r.ajax)throw new Error("Unable to find ajax adapter for dataservice adapter '"+(this.name||"")+"'.");},n.fetchMetadata=function(n,i){var o=i.serviceName,f=i.qualifyUrl("Metadata"),u=e.defer();return r.ajax({type:"GET",url:f,dataType:"json",success:function(r){var e,s,h;if(n.hasMetadataFor(o))return u.resolve("already fetched");e=r.data;try{s="string"==typeof e?JSON.parse(e):e;n.importMetadata(s)}catch(c){return h="Unable to either parse or import metadata: "+c.message,t(u,r,"Metadata query failed for: "+f+". "+h)}return n.hasMetadataFor(o)||n.addDataService(i),u.resolve(s)},error:function(n){t(u,n,"Metadata query failed for: "+f)}}),u.promise},n.executeQuery=function(n){var i=(n.adapter=this,e.defer()),f=n.getUrl(),u={type:"GET",url:f,params:n.query.parameters,dataType:"json",success:function(n){var r=n.data,f,u;try{u=r&&(r.results||r.Results);f=u?{results:u,inlineCount:r.inlineCount||r.InlineCount,httpResponse:n}:{results:r,httpResponse:n};i.resolve(f)}catch(e){e instanceof Error?i.reject(e):t(i,n)}},error:function(n){t(i,n)}};return n.dataService.useJsonp&&(u.dataType="jsonp",u.crossDomain=!0),r.ajax(u),i.promise},n.saveChanges=function(n,i){var f=n.adapter=this,u=e.defer(),o,s;return i=f._prepareSaveBundle(n,i),o=JSON.stringify(i),s=n.dataService.qualifyUrl(n.resourceName),r.ajax({type:"POST",url:s,dataType:"json",contentType:"application/json",data:o,success:function(i){var r,e;i.saveContext=n;r=i.data;r.Errors||r.errors?t(u,i):(e=f._prepareSaveResult(n,r),e.httpResponse=i,u.resolve(e))},error:function(i){i.saveContext=n;t(u,i)}}),u.promise},n._prepareSaveBundle=function(){throw new Error("Need a concrete implementation of _prepareSaveBundle");},n.changeRequestInterceptor=u,n._createChangeRequestInterceptor=function(n,t){var f=n.adapter,e=f.changeRequestInterceptor,i=li;if(i(e)){var o=f.name+" DataServiceAdapter's ChangeRequestInterceptor",s=" is missing or not a function.",r=new e(n,t);if(!i(r.getRequest))throw new Error(o+".getRequest"+s);if(!i(r.done))throw new Error(o+".done"+s);return r}return new u(n,t)},n._prepareSaveResult=function(){throw new Error("Need a concrete implementation of _prepareSaveResult");},n.jsonResultsAdapter=new yi({name:"noop",visitNode:function(){return{}}}),n._catchNoConnectionError=function(n){0==n.status&&null==n.message&&(n.message="HTTP response status 0 and no message.  Likely did not or could not reach server. Is the server running?")},f}(),function(n){"object"==typeof i?n(i):"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?n(require("breeze")):"function"==typeof define&&define.amd&&define(["breeze"],n)}(function(n){function i(n){var o,f,s,r="",u,t,e,h;for(u in n)if(t=n[u],t instanceof Array)for(e=0;e<t.length;++e)o=t[e],s=u+"["+e+"]",f={},f[s]=o,r+=i(f)+"&";else if(t&&t.toISOString)r+=encodeURIComponent(u)+"="+encodeURIComponent(t.toISOString())+"&";else if(t instanceof Object)for(h in t)o=t[h],s=u+"["+h+"]",f={},f[s]=o,r+=i(f)+"&";else null===t?r+=encodeURIComponent(u)+"=&":void 0!==t&&(r+=encodeURIComponent(u)+"="+encodeURIComponent(t)+"&");return r.length?r.substr(0,r.length-1):r}var t=n.core,u=function(){this.name="angular";this.defaultSettings={};this.requestInterceptor=null},r=u.prototype;r.initialize=function(){var n=t.requireLib("angular"),i,r,u;n&&(u=n.injector(["ng"]),u.invoke(["$http","$rootScope",function(n,t){i=n;r=t}]),this.$http=i,this.$rootScope=r)};r.setHttp=function(n){this.$http=n;this.$rootScope=null};r.ajax=function(n){function s(t,i,r,u,f){"null"===t&&(t=null);var e={config:n,data:t,getHeaders:r,status:i,statusText:f};n.success(e)}function h(t,i,r,u,f){0===i&&null==t&&(t="timeout");var e={config:n,data:t,getHeaders:r,status:i,statusText:f};n.error(e)}var r,f,e,o,u;if(!this.$http)throw new Error("Unable to locate angular for ajax adapter");r={method:n.type,url:n.url,dataType:n.dataType,contentType:n.contentType,crossDomain:n.crossDomain,headers:n.headers||{}};n.params&&(f=r.url.indexOf("?")>=0?"&":"?",r.url=r.url+f+i(n.params));(n.data&&(r.data=n.data),t.isEmpty(this.defaultSettings))||(e=t.extend({},this.defaultSettings),r=t.extend(e,r),o=t.extend({},this.defaultSettings.headers),r.headers=t.extend(o,r.headers));u={adapter:this,config:r,dsaConfig:n,success:s,error:h};t.isFunction(this.requestInterceptor)&&(this.requestInterceptor(u),this.requestInterceptor.oneTime&&(this.requestInterceptor=null));u.config&&(this.$http(u.config).success(u.success).error(u.error),this.$rootScope&&this.$rootScope.$digest())};n.config.registerAdapter("ajax",u)}),function(n){"object"==typeof i?n(i):"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?n(require("breeze")):"function"==typeof define&&define.amd&&define(["breeze"],n)}(function(n){function r(n){return 0===n.status?function(n){return n&&n.length>0?"":{}}:function(t){return t&&t.length>0?n.getResponseHeader(t):n.getAllResponseHeaders()}}var i,t=n.core,u=function(){this.name="jQuery";this.defaultSettings={};this.requestInterceptor=null},f=u.prototype;f.initialize=function(){i=t.requireLib("jQuery")};f.ajax=function(n){function s(t,i,u){var f={config:n,data:t,getHeaders:r(u),status:u.status,statusText:i};n.success(f);u.onreadystatechange=null;u.abort=null}function h(t,i,u){var f={config:n,data:t.responseText,error:u,getHeaders:r(t),status:t.status,statusText:i};n.error(f);t.onreadystatechange=null;t.abort=null}var f,e,o,u;if(!i)throw new Error("Unable to locate jQuery");f={type:n.type,url:n.url,data:n.params||n.data,dataType:n.dataType,contentType:n.contentType,crossDomain:n.crossDomain,headers:n.headers||{}};t.isEmpty(this.defaultSettings)||(e=t.extend({},this.defaultSettings),f=t.extend(e,f),o=t.extend({},this.defaultSettings.headers),f.headers=t.extend(o,f.headers));u={adapter:this,config:f,dsaConfig:n,success:s,error:h};t.isFunction(this.requestInterceptor)&&(this.requestInterceptor(u),this.requestInterceptor.oneTime&&(this.requestInterceptor=null));u.config&&(u.jqXHR=i.ajax(u.config).done(u.success).fail(u.error))};n.config.registerAdapter("ajax",u)}),function(n){"object"==typeof i?n(i):"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?n(require("breeze")):"function"==typeof define&&define.amd&&define(["breeze"],n)}(function(n){function c(n,t){if(!n.isUnmapped)return(n.dataType===r.DateTimeOffset?t=t&&new Date(t.getTime()-6e4*t.getTimezoneOffset()):n.dataType.quoteJsonOData&&(t=null!=t?t.toString():t),t)}function y(n,t){var f=n.adapter._createChangeRequestInterceptor(n,t),r=[],e=[],o=[],s=n.entityManager,h=s.helper,i=0,u=n.routePrefix;return t.entities.forEach(function(n,t){var v=n.entityAspect,a;if(i+=1,a={headers:{"Content-ID":i,DataServiceVersion:"2.0"}},o[i]=n,v.entityState.isAdded())a.requestUri=u+n.entityType.defaultResourceName,a.method="POST",a.data=h.unwrapInstance(n,c),e[i]=v.getKey();else if(v.entityState.isModified())l(a,v,u),a.method="MERGE",a.data=h.unwrapChangedValues(n,s.metadataStore,c);else{if(!v.entityState.isDeleted())return;l(a,v,u);a.method="DELETE"}a=f.getRequest(a,n,t);r.push(a)}),n.contentKeys=o,n.tempKeys=e,f.done(r),{__batchRequests:[{__changeRequests:r}]}}function l(n,t,i){var r,u=t.extraMetadata;null==u?(r=p(t),t.extraMetadata={uriKey:r}):(r=u.uriKey,u.etag&&(n.headers["If-Match"]=u.etag));n.requestUri=r.indexOf("//")>0?r:i+r}function p(n){var u=n.entity.entityType,f=u.defaultResourceName,i=u.keyProperties,t=f+"(",r;return 1===i.length?t=t+a(i[0],n)+")":(r="",i.forEach(function(i){t=t+r+i.nameOnServer+"="+a(i,n);r=","}),t+=")"),t}function a(n,t){return n.dataType.fmtOData(t.getPropertyValue(n.name))}function o(n,i){var r=new Error,f=n&&n.response,e,u,o;if(!f)return r.message=n,r.statusText=n,r;if(r.message=f.statusText,r.statusText=f.statusText,r.status=f.statusCode,i&&(r.url=i),r.body=f.body,f.body)try{u=JSON.parse(f.body);r.body=u;u["odata.error"]&&(u=u["odata.error"]);o="";do e=u.error||u.innererror,e||(o+=w(u)),e=e||u.internalexception,u=e||u;while(e);o.length>0&&(r.message=o)}catch(s){}return t._catchNoConnectionError(r),r}function w(n){var t=n.message||"";return("string"==typeof t?t:t.value)+"; "}var i,h=n.core,b=n.MetadataStore,k=n.JsonResultsAdapter,d=n.DataProperty,v=function(){this.name="OData"},t=v.prototype,s,u,f;t.initialize=function(){i=h.requireLib("OData","Needed to support remote OData services");i.jsonHandler.recognizeDates=!0};s=n.AbstractDataServiceAdapter.prototype;t._catchNoConnectionError=s._catchNoConnectionError;t.changeRequestInterceptor=s.changeRequestInterceptor;t._createChangeRequestInterceptor=s._createChangeRequestInterceptor;t.headers={DataServiceVersion:"2.0"};t.executeQuery=function(n){var t=e.defer(),r=n.getUrl();return i.read({requestUri:r,headers:this.headers},function(n,i){var r;return n.__count&&(r=parseInt(n.__count,10)),t.resolve({results:n.results,inlineCount:r,httpResponse:i})},function(n){return t.reject(o(n,r))}),t.promise};t.fetchMetadata=function(n,t){var r=e.defer(),f=t.serviceName,u=t.qualifyUrl("$metadata");return i.read({requestUri:u,headers:{Accept:"application/json;odata.metadata=full"}},function(i){var o,e;if(!i||!i.dataServices)return o=new Error("Metadata query failed for: "+u),r.reject(o);if(e=i.dataServices,!n.hasMetadataFor(f)){try{n.importMetadata(e)}catch(s){return r.reject(new Error("Metadata query failed for "+u+"; Unable to process returned metadata: "+s.message))}n.addDataService(t)}return r.resolve(e)},function(n){var t=o(n,u);return t.message="Metadata query failed for: "+u+"; "+(t.message||""),r.reject(t)},i.metadataHandler),r.promise};t.getRoutePrefix=function(){return""};t.saveChanges=function(n,t){var f=n.adapter=this,r=e.defer();n.routePrefix=f.getRoutePrefix(n.dataService);var u=n.dataService.qualifyUrl("$batch"),s=y(n,t),h=n.tempKeys,c=n.contentKeys;return i.request({headers:{DataServiceVersion:"2.0"},requestUri:u,method:"POST",data:s},function(n){var t=[],i=[],f={entities:t,keyMappings:i};return n.__batchResponses.forEach(function(n){n.__changeResponses.forEach(function(n){var y=n.response||n,a=y.statusCode,l,f,e,s,v;if(!a||a>=400)return void r.reject(o(n,u));if(l=n.headers["Content-ID"],f=n.data,f){if(e=h[l],e&&(s=e.entityType,s.autoGeneratedKeyType!==st.None)){var p=e.values[0],w=s.getEntityKeyFromRawEntity(f,d.getRawValueFromServer),b={entityTypeName:s.name,tempValue:p,realValue:w.values[0]};i.push(b)}t.push(f)}else v=c[l],t.push(v)})}),r.resolve(f)},function(n){return r.reject(o(n,u))},i.batchHandler),r.promise};t.jsonResultsAdapter=new k({name:"OData_default",visitNode:function(n,t,i){var r={},u,o,e,f,c,s;return null==n?r:(u=n.__metadata,null!=u&&(o=b.normalizeTypeName(u.type),e=o&&t.entityManager.metadataStore.getEntityType(o,!0),e&&e._mappedPropertiesCount<=Object.keys(n).length-1&&(r.entityType=e,f=u.uri||u.id,f&&(c=new RegExp("^"+t.dataService.serviceName,"i"),f=f.replace(c,"")),r.extraMetadata={uriKey:f,etag:u.etag})),n.results&&(r.node=n.results),s=i.propertyName,r.ignore=null!=n.__deferred||"__metadata"===s||"EntityKey"===s&&n.$type&&h.stringStartsWith(n.$type,"System.Data"),r)}});n.config.registerAdapter("dataService",v);u=function(){this.name="webApiOData"};n.core.extend(u.prototype,t);u.prototype.getRoutePrefix=function(n){var i,t;return"object"==typeof document?(i=document.createElement("a"),i.href=n.serviceName):i=url.parse(n.serviceName),t=i.pathname,"/"===t[0]&&(t=t.substr(1)),"/"!==t.substr(-1)&&(t+="/"),t};n.config.registerAdapter("dataService",u);f=function(){this.name="webApiOData4"};n.core.extend(f.prototype,u.prototype);f.prototype.initialize=function(){var n=h.requireLib("datajs","Needed to support remote OData v4 services");i=n.V4.oData;i.json.jsonHandler.recognizeDates=!0};f.prototype.headers={"OData-Version":"4.0"};n.config.registerAdapter("dataService",f)}),function(n){"object"==typeof i?n(i):"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?n(require("breeze")):"function"==typeof define&&define.amd&&define(["breeze"],n)}(function(n){var i=n.MetadataStore,u=n.JsonResultsAdapter,f=n.AbstractDataServiceAdapter,r=function(){this.name="webApi"},t=r.prototype=new f;t._prepareSaveBundle=function(t,i){var r=this._createChangeRequestInterceptor(t,i),u=t.entityManager,e=u.metadataStore,f=u.helper;return i.entities=i.entities.map(function(t,i){var u=f.unwrapInstance(t),o=null,s;return t.entityType.autoGeneratedKeyType!==n.AutoGeneratedKeyType.None&&(o={propertyName:t.entityType.keyProperties[0].nameOnServer,autoGeneratedKeyType:t.entityType.autoGeneratedKeyType.name}),s=f.unwrapOriginalValues(t,e),u.entityAspect={entityTypeName:t.entityType.name,defaultResourceName:t.entityType.defaultResourceName,entityState:t.entityAspect.entityState.name,originalValuesMap:s,autoGeneratedKey:o},u=r.getRequest(u,t,i)}),i.saveOptions={tag:i.saveOptions.tag},r.done(i.entities),i};t._prepareSaveResult=function(n,t){if(t.entities)return t;var r=t.KeyMappings.map(function(n){var t=i.normalizeTypeName(n.EntityTypeName);return{entityTypeName:t,tempValue:n.TempValue,realValue:n.RealValue}});return{entities:t.Entities,keyMappings:r}};t.jsonResultsAdapter=new u({name:"webApi_default",visitNode:function(n,t,r){if(null==n)return{};var u=i.normalizeTypeName(n.$type),e=u&&t.entityManager.metadataStore._getEntityType(u,!0),f=r.propertyName,o=f&&"$"===f.substr(0,1);return{entityType:e,nodeId:n.$id,nodeRefId:n.$ref,ignore:o}}});n.config.registerAdapter("dataService",r)}),function(n){"object"==typeof i?n(i):"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?n(require("breeze")):"function"==typeof define&&define.amd&&define(["breeze"],n)}(function(n){function h(n){var i=n.entityType||n.complexType,u=i._extra,t=u.alreadyWrappedProps||{};i.getProperties().forEach(function(i){var u=i.name,e;t[u]||(e=u in n?f(n,i):r(n,i),null!=e&&Object.defineProperty(n,u,e),t[u]=!0)});u.alreadyWrappedProps=t}function c(n){var u=e(n),t=Object.getPrototypeOf(n),f=t.entityType||t.complexType;return f.getProperties().forEach(function(u){var f=u.name,e,o;u.isUnmapped&&!i.getPropertyDescriptor(t,f)&&(e=r(t,u),Object.defineProperty(t,f,e));n.hasOwnProperty(f)&&(o=n[f],delete n[f],n[f]=o)}),u}function r(n,t){var i=t.name,r=n._pendingBackingStores,f;return r||(r=[],n._pendingBackingStores=r),f={get:function(){var n=this._backingStore||e(this);return n[i]},set:function(n){var r=this._backingStore||o(this),f=u(r,i);this._$interceptor(t,n,f)},enumerable:!0,configurable:!0},f.set.rawSet=function(n){var t=this._backingStore||o(this),r=u(t,i);r(n)},f}function u(n,t){return function(){return 0===arguments.length?n[t]:void(n[t]=arguments[0])}}function f(n,t){var u,i,e,r;return n.hasOwnProperty(t.name)?(i=Object.getOwnPropertyDescriptor(n,t.name),!i.configurable)?void 0:i.value?void 0:i.set?(e=function(n){return function(){if(0===arguments.length)return i.get.bind(n)();var t=i.set,r=t.rawSet||t;return void r.bind(n)(arguments[0])}},r={get:function(){return i.get.bind(this)()},set:function(n){this._$interceptor(t,n,e(this))},enumerable:i.enumerable,configurable:!0},r.set.rawSet=i.set,r):void 0:(u=Object.getPrototypeOf(n),f(u,t))}function e(n){var i=Object.getPrototypeOf(n),t;return l(i),t=n._backingStore,t||(t={},n._backingStore=t),t}function o(n){var f=Object.getPrototypeOf(n),r=f._pendingBackingStores,u=i.arrayFirst(r,function(t){return t.entity===n}),t;return u?u.backingStore:(t={},r.push({entity:n,backingStore:t}),t)}function l(n){var t=n._pendingBackingStores;t&&(t.forEach(function(n){n.entity._backingStore=n.backingStore}),t.length=0)}var i=n.core,s=function(){this.name="backingStore"},t=s.prototype;t.initialize=function(){};t.getTrackablePropertyNames=function(n){var r=[],t,u;for(t in n)"entityType"!==t&&"_$typeName"!==t&&"_pendingSets"!==t&&"_backingStore"!==t&&(u=n[t],i.isFunction(u)||r.push(t));return r};t.initializeEntityPrototype=function(n){n.getProperty=function(n){return this[n]};n.setProperty=function(n,t){return this[n]=t,this};h(n)};t.startTracking=function(t){var i=c(t),r=t.entityType||t.complexType;r.getProperties().forEach(function(r){var f=r.name,u=t[f];if(r.isDataProperty)r.isComplexProperty?u=r.isScalar?r.dataType._createInstanceCore(t,r):n.makeComplexArray([],t,r):r.isScalar?void 0===u&&(u=r.defaultValue):u=n.makePrimitiveArray([],t,r);else{if(!r.isNavigationProperty)throw new Error("unknown property: "+f);if(void 0!==u)throw new Error("Cannot assign a navigation property in an entity ctor.: "+r.Name);u=r.isScalar?null:n.makeRelationArray([],t,r)}(r.isSettable||r.isNavigationProperty)&&(i[f]=u)})};n.config.registerAdapter("modelLibrary",s)}),function(n){"object"==typeof i?n(i):"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?n(require("breeze")):"function"==typeof define&&define.amd&&define(["breeze"],n)}(function(n){function o(n){var r=n.entityType||n.complexType,f={},e;(r.getProperties().forEach(function(t){var i=u(n,t.name);i&&(f[t.name]=i)}),i.isEmpty(f))||(e=r._extra,e.es5Descriptors=f,r._koDummy=t.observable(null))}function u(n,t){if(!f)return null;if(n.hasOwnProperty(t))return Object.getOwnPropertyDescriptor&&Object.getOwnPropertyDescriptor(n,t);var i=Object.getPrototypeOf(n);return i?u(i,t):null}function s(t,i,r){if(i.isDataProperty)i.isComplexProperty?r=i.isScalar?i.dataType._createInstanceCore(t,i):n.makeComplexArray([],t,i):i.isScalar?void 0===r&&(r=i.defaultValue):r=n.makePrimitiveArray([],t,i);else{if(!i.isNavigationProperty)throw new Error("unknown property: "+i.name);if(void 0!==r)throw new Error("Cannot assign a navigation property in an entity ctor.: "+i.name);r=i.isScalar?null:n.makeRelationArray([],t,i)}return r}function h(n){n._koObj._suppressBreeze=!0}function c(n){var t=n.array._koObj;t._suppressBreeze?t._suppressBreeze=!1:t.valueHasMutated()}var t,i=n.core,f=i.__isES5Supported,e=function(){this.name="ko"},r=e.prototype;r.initialize=function(){t=i.requireLib("ko","The Knockout library");t.extenders.intercept=function(n,i){var r=i.instance,u=i.property;return t.computed(n.splice?{read:n}:{read:n,write:function(t){return r._$interceptor(u,t,n),r}})}};r.getTrackablePropertyNames=function(n){var f=[],r,e,o;for(r in n)"entityType"!==r&&"_$typeName"!==r&&(e=u(n,r),e&&e.get?f.push(r):(o=n[r],t.isObservable(o)?f.push(r):i.isFunction(o)||f.push(r)));return f};r.initializeEntityPrototype=function(n){n.getProperty=function(n){return this[n]()};n.setProperty=function(n,t){return this[n](t),this};f&&o(n)};r.startTracking=function(n){var i=n.entityType||n.complexType,r=i._extra.es5Descriptors||{};i.getProperties().sort(function(n,t){var i=n.isUnmapped?1:0,r=t.isUnmapped?1:0;return i-r}).forEach(function(u){var f,o=u.name,e=n[o],l=r[o],a,v,y,p;if(l)a=l.get.bind(n),l.set?(v=l.set.bind(n),y=function(n){return 0===arguments.length?void a():void v(n)},f=t.computed({read:function(){return i._koDummy(),a()},write:function(t){return n._$interceptor(u,t,y),i._koDummy.valueHasMutated(),n}})):f=t.computed({read:a,write:function(){}});else if(t.isObservable(e)){if(u.isNavigationProperty)throw new Error("Cannot assign a navigation property in an entity ctor.: "+o);f=e}else e=s(n,u,e),f=u.isScalar?t.observable(e):t.observableArray(e);u.isScalar?l?Object.defineProperty(n,o,{enumerable:!0,configurable:!0,writable:!0,value:f}):(p=f.extend({intercept:{instance:n,property:u}}),n[o]=p):(e._koObj=f,f.subscribe(h,null,"beforeChange"),e.arrayChanged.subscribe(c),f.equalityComparer=function(){throw new Error("Collection navigation properties may NOT be set.");},n[o]=f)})};n.config.registerAdapter("modelLibrary",e)}),function(n){"object"==typeof i?n(i):"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?n(require("breeze")):"function"==typeof define&&define.amd&&define(["breeze"],n)}(function(n){var t=function(){this.name="json"},i=t.prototype;i.initialize=function(){};i.buildUri=function(n,t){var r=n._getFromEntityType(t,!1),i,u,f;return r||(r=new a(t)),i=n.toJSONExt({entityType:r,toNameOnServer:!0}),i.from=void 0,i.queryOptions=void 0,u=JSON.stringify(i),f=encodeURIComponent(u),n.resourceName+"?"+f};n.config.registerAdapter("uriBuilder",t)}),function(n){"object"==typeof i?n(i):"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?n(require("breeze")):"function"==typeof define&&define.amd&&define(["breeze"],n)}(function(n){var t,u=n.EntityType,i=function(){this.name="odata"},r=i.prototype;r.initialize=function(){};r.buildUri=function(n,i){function o(n){if(n)return n.visit({entityType:f},t)}function s(n){if(!n)return void 0;n.validate(f);var t=n.items.map(function(n){return f.clientPropertyPathToServer(n.propertyPath,"/")+(n.isDesc?" desc":"")});return t.join(",")}function h(n){if(!n)return void 0;n.validate(f);return n.propertyPaths.map(function(n){return f.clientPropertyPathToServer(n,"/")}).join(",")}function c(n){if(!n)return void 0;return n.propertyPaths.map(function(n){return f.clientPropertyPathToServer(n,"/")}).join(",")}function l(n){var i=[],r,t;for(r in n)t=n[r],void 0!==t&&(t instanceof Array?t.forEach(function(n){i.push(r+"="+encodeURIComponent(n))}):i.push(r+"="+encodeURIComponent(t)));return i.length>0?"?"+i.join("&"):""}var f=n._getFromEntityType(i,!1),r,e;return f||(f=new u(i)),r={},r.$filter=o(n.wherePredicate),r.$orderby=s(n.orderByClause),n.skipCount&&(r.$skip=n.skipCount),null!=n.takeCount&&(r.$top=n.takeCount),r.$expand=c(n.expandClause),r.$select=h(n.selectClause),n.inlineCountEnabled&&(r.$inlinecount="allpages"),e=l(r),n.resourceName+e};n.Predicate.prototype.toODataFragment=function(n){return this.visit(n,t)};t=function(){function t(n){var t=n.op.key,i=r[t];return i||t}var i={passthruPredicate:function(){return this.value},unaryPredicate:function(n){var i=this.pred.visit(n);return t(this)+" ("+i+")"},binaryPredicate:function(n){var i=this.expr1.visit(n),u=this.expr2.visit(n),f=n.prefix,r;return(f&&(i=f+"/"+i),r=t(this),"in"===this.op.key)?u.map(function(n){return"("+i+" eq "+n+")"}).join(" or "):this.op.isFunction?"substringof"===r?r+"("+u+","+i+") eq true":r+"("+i+","+u+") eq true":i+" "+r+" "+u},andOrPredicate:function(n){return this.preds.map(function(t){var i=t.visit(n);return"("+i+")"}).join(" "+t(this)+" ")},anyAllPredicate:function(i){var f=this.expr.visit(i),r=i.prefix,u,e;return r?(f=r+"/"+f,r="x"+(parseInt(r.substring(1))+1)):r="x1",u=n.core.extend({},i),u.entityType=this.expr.dataType,u.prefix=r,e=this.pred.visit(u),f+"/"+t(this)+"("+r+": "+e+")"},litExpr:function(){return Array.isArray(this.value)?this.value.map(function(n){return this.dataType.fmtOData(n)},this):this.dataType.fmtOData(this.value)},propExpr:function(n){var t=n.entityType;return t?t.clientPropertyPathToServer(this.propertyPath,"/"):this.propertyPath},fnExpr:function(n){var t=this.exprs.map(function(t){return t.visit(n)});return this.fnName+"("+t.join(",")+")"}},r={contains:"substringof"};return i}();n.config.registerAdapter("uriBuilder",i)}),i.config.initializeAdapterInstances({dataService:"webApi",ajax:"jQuery",uriBuilder:"odata"}),lu=hr("ko"),lu?i.config.initializeAdapterInstance("modelLibrary","ko"):i.config.initializeAdapterInstance("modelLibrary","backingStore"),i}),function(n){if(typeof breeze=="object")n(breeze);else if(typeof require=="function"&&typeof exports=="object"&&typeof module=="object"){var t=require("breeze");n(t)}else if(typeof define=="function"&&define.amd)define(["breeze"],n);else throw new Error("Can't find breeze");}(function(n){"use strict";function t(t){if(t||(t=n.config.getAdapterInstance("ajax")),!t.ajaxPostEnabled){var r=t.ajax;r&&(t.ajax=function(n){return i(n),r.call(t,n)},t.ajaxPostEnabled=!0)}}function i(n){var i=n&&n.params,t;return i?(n.type=i.$method||n.type,t=i.$data,t&&(i.$encoding==="JSON"?(n.processData=!1,n.contentType="application/json; charset=UTF-8",n.data=typeof t=="object"?JSON.stringify(t):t):n.data=t,n.params=null),n):n}n.ajaxpost=function(n){t(n)};n.ajaxpost()}),function(n){var i=[],r=[],f=function(){},u=0,t={splashVPos:"35%",loaderVPos:"75%",splashID:"#jpreContent",showSplash:!0,showPercentage:!0,autoClose:!0,closeBtnText:"Start!",onetimeLoad:!1,debugMode:!1,splashFunction:function(){}},s=function(){var i,n,r;if(t.onetimeLoad){for(i=document.cookie.split("; "),n=0;r=i[n]&&i[n].split("=");n++)if(r.shift()==="jpreLoader")return r.join("=");return!1}return!1},h=function(n){var i,r;t.onetimeLoad&&(i=new Date,i.setDate(i.getDate()+n),r=n==null?"":"expires="+i.toUTCString(),document.cookie="jpreLoader=loaded; "+r)},c=function(){var i,r;jOverlay=n("<div><\/div>").attr("id","jpreOverlay").css({position:"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:9999999}).appendTo("body");t.showSplash&&(jContent=n("<div><\/div>").attr("id","jpreSlide").appendTo(jOverlay),i=n(window).width()-n(jContent).width(),n(jContent).css({position:"absolute",top:t.splashVPos,left:Math.round(50/n(window).width()*i)+"%"}),n(jContent).html(n(t.splashID).wrap("<div/>").parent().html()),n(t.splashID).remove(),t.splashFunction());jLoader=n("<div><\/div>").attr("id","jpreLoader").appendTo(jOverlay);r=n(window).width()-n(jLoader).width();n(jLoader).css({position:"absolute",top:t.loaderVPos,left:Math.round(50/n(window).width()*r)+"%"});jBar=n("<div><\/div>").attr("id","jpreBar").css({width:"0%",height:"100%"}).appendTo(jLoader);t.showPercentage&&(jPer=n("<div><\/div>").attr("id","jprePercentage").css({position:"relative",height:"100%"}).appendTo(jLoader).html("..."));t.autoclose||(jButton=n("<div><\/div>").attr("id","jpreButton").on("click",function(){o()}).css({position:"relative",height:"100%"}).appendTo(jLoader).text(t.closeBtnText).hide())},l=function(t){n(t).find("*:not(script)").each(function(){var t="",r;n(this).css("background-image").indexOf("none")==-1&&n(this).css("background-image").indexOf("-gradient")==-1?(t=n(this).css("background-image"),t.indexOf("url")!=-1&&(r=t.match(/url\((.*?)\)/),t=r[1].replace(/\"/g,""))):n(this).get(0).nodeName.toLowerCase()=="img"&&typeof n(this).attr("src")!="undefined"&&(t=n(this).attr("src"));t.length>0&&i.push(t)})},a=function(){for(var n=0;n<i.length;n++)v(i[n])},v=function(t){var i=new Image;n(i).load(function(){e()}).error(function(){r.push(n(this).attr("src"));e()}).attr("src",t)},e=function(){var r,f;u++;r=Math.round(u/i.length*100);n(jBar).stop().animate({width:r+"%"},500,"linear");t.showPercentage&&n(jPer).text(r+"%");u>=i.length&&(u=i.length,h(),t.showPercentage&&n(jPer).text("100%"),t.debugMode&&(f=y()),n(jBar).stop().animate({width:"100%"},500,"linear",function(){t.autoClose?o():n(jButton).fadeIn(1e3)}))},o=function(){n(jOverlay).fadeOut(800,function(){n(jOverlay).remove();f()})},y=function(){var n,t;if(r.length>0){for(n="ERROR - IMAGE FILES MISSING!!!\n\r",n+=r.length+" image files cound not be found. \n\r",n+="Please check your image paths and filenames:\n\r",t=0;t<r.length;t++)n+="- "+r[t]+"\n\r";return!0}return!1};n.fn.jpreLoader=function(i,r){return i&&n.extend(t,i),typeof r=="function"&&(f=r),n("body").css({display:"block"}),this.each(function(){s()?(n(t.splashID).remove(),f()):(c(),l(this),a())})}}(jQuery);!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof exports?module.exports=n:n(jQuery)}(function(n){function u(r){var u=r||window.event,w=c.call(arguments,1),l=0,s=0,e=0,a=0,b=0,k=0,v,y,p;if(r=n.event.fix(u),r.type="mousewheel","detail"in u&&(e=-1*u.detail),"wheelDelta"in u&&(e=u.wheelDelta),"wheelDeltaY"in u&&(e=u.wheelDeltaY),"wheelDeltaX"in u&&(s=-1*u.wheelDeltaX),"axis"in u&&u.axis===u.HORIZONTAL_AXIS&&(s=-1*e,e=0),l=0===e?s:e,"deltaY"in u&&(e=-1*u.deltaY,l=e),"deltaX"in u&&(s=u.deltaX,0===e&&(l=-1*s)),0!==e||0!==s)return 1===u.deltaMode?(v=n.data(this,"mousewheel-line-height"),l*=v,e*=v,s*=v):2===u.deltaMode&&(y=n.data(this,"mousewheel-page-height"),l*=y,e*=y,s*=y),(a=Math.max(Math.abs(e),Math.abs(s)),(!t||t>a)&&(t=a,o(u,a)&&(t/=40)),o(u,a)&&(l/=40,s/=40,e/=40),l=Math[l>=1?"floor":"ceil"](l/t),s=Math[s>=1?"floor":"ceil"](s/t),e=Math[e>=1?"floor":"ceil"](e/t),i.settings.normalizeOffset&&this.getBoundingClientRect)&&(p=this.getBoundingClientRect(),b=r.clientX-p.left,k=r.clientY-p.top),r.deltaX=s,r.deltaY=e,r.deltaFactor=t,r.offsetX=b,r.offsetY=k,r.deltaMode=0,w.unshift(r,l,s,e),f&&clearTimeout(f),f=setTimeout(h,200),(n.event.dispatch||n.event.handle).apply(this,w)}function h(){t=null}function o(n,t){return i.settings.adjustOldDeltas&&"mousewheel"===n.type&&t%120==0}var f,t,s=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],r="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],c=Array.prototype.slice,e,i;if(n.event.fixHooks)for(e=s.length;e;)n.event.fixHooks[s[--e]]=n.event.mouseHooks;i=n.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var t=r.length;t;)this.addEventListener(r[--t],u,!1);else this.onmousewheel=u;n.data(this,"mousewheel-line-height",i.getLineHeight(this));n.data(this,"mousewheel-page-height",i.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var t=r.length;t;)this.removeEventListener(r[--t],u,!1);else this.onmousewheel=null;n.removeData(this,"mousewheel-line-height");n.removeData(this,"mousewheel-page-height")},getLineHeight:function(t){var r=n(t),i=r["offsetParent"in n.fn?"offsetParent":"parent"]();return i.length||(i=n("body")),parseInt(i.css("fontSize"),10)||parseInt(r.css("fontSize"),10)||16},getPageHeight:function(t){return n(t).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};n.fn.extend({mousewheel:function(n){return n?this.bind("mousewheel",n):this.trigger("mousewheel")},unmousewheel:function(n){return this.unbind("mousewheel",n)}})});+function(n){"use strict";var i='[data-dismiss="alert"]',t=function(t){n(t).on("click",i,this.close)},r;t.prototype.close=function(t){function f(){i.trigger("closed.bs.alert").remove()}var u=n(this),r=u.attr("data-target"),i;(r||(r=u.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),i=n(r),t&&t.preventDefault(),i.length||(i=u.hasClass("alert")?u:u.parent()),i.trigger(t=n.Event("close.bs.alert")),t.isDefaultPrevented())||(i.removeClass("in"),n.support.transition&&i.hasClass("fade")?i.one(n.support.transition.end,f).emulateTransitionEnd(150):f())};r=n.fn.alert;n.fn.alert=function(i){return this.each(function(){var r=n(this),u=r.data("bs.alert");u||r.data("bs.alert",u=new t(this));typeof i=="string"&&u[i].call(r)})};n.fn.alert.Constructor=t;n.fn.alert.noConflict=function(){return n.fn.alert=r,this};n(document).on("click.bs.alert.data-api",i,t.prototype.close)}(jQuery);+function(n){"use strict";var t=function(i,r){this.$element=n(i);this.options=n.extend({},t.DEFAULTS,r);this.isLoading=!1},i;t.DEFAULTS={loadingText:"loading..."};t.prototype.setState=function(t){var r="disabled",i=this.$element,u=i.is("input")?"val":"html",f=i.data();t+="Text";f.resetText||i.data("resetText",i[u]());i[u](f[t]||this.options[t]);setTimeout(n.proxy(function(){t=="loadingText"?(this.isLoading=!0,i.addClass(r).attr(r,r)):this.isLoading&&(this.isLoading=!1,i.removeClass(r).removeAttr(r))},this),0)};t.prototype.toggle=function(){var t=!0,i=this.$element.closest('[data-toggle="buttons"]'),n;i.length&&(n=this.$element.find("input"),n.prop("type")=="radio"&&(n.prop("checked")&&this.$element.hasClass("active")?t=!1:i.find(".active").removeClass("active")),t&&n.prop("checked",!this.$element.hasClass("active")).trigger("change"));t&&this.$element.toggleClass("active")};i=n.fn.button;n.fn.button=function(i){return this.each(function(){var u=n(this),r=u.data("bs.button"),f=typeof i=="object"&&i;r||u.data("bs.button",r=new t(this,f));i=="toggle"?r.toggle():i&&r.setState(i)})};n.fn.button.Constructor=t;n.fn.button.noConflict=function(){return n.fn.button=i,this};n(document).on("click.bs.button.data-api","[data-toggle^=button]",function(t){var i=n(t.target);i.hasClass("btn")||(i=i.closest(".btn"));i.button("toggle");t.preventDefault()})}(jQuery);+function(n){"use strict";var t=function(t,i){this.$element=n(t);this.$indicators=this.$element.find(".carousel-indicators");this.options=i;this.paused=this.sliding=this.interval=this.$active=this.$items=null;this.options.pause=="hover"&&this.$element.on("mouseenter",n.proxy(this.pause,this)).on("mouseleave",n.proxy(this.cycle,this))},i;t.DEFAULTS={interval:5e3,pause:"hover",wrap:!0};t.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(n.proxy(this.next,this),this.options.interval)),this};t.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)};t.prototype.to=function(t){var r=this,i=this.getActiveIndex();if(!(t>this.$items.length-1)&&!(t<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){r.to(t)}):i==t?this.pause().cycle():this.slide(t>i?"next":"prev",n(this.$items[t]))};t.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&n.support.transition&&(this.$element.trigger(n.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this};t.prototype.next=function(){if(!this.sliding)return this.slide("next")};t.prototype.prev=function(){if(!this.sliding)return this.slide("prev")};t.prototype.slide=function(t,i){var u=this.$element.find(".item.active"),r=i||u[t](),s=this.interval,f=t=="next"?"left":"right",h=t=="next"?"first":"last",e=this,o;if(!r.length){if(!this.options.wrap)return;r=this.$element.find(".item")[h]()}return r.hasClass("active")?this.sliding=!1:(o=n.Event("slide.bs.carousel",{relatedTarget:r[0],direction:f}),this.$element.trigger(o),o.isDefaultPrevented())?void 0:(this.sliding=!0,s&&this.pause(),this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid.bs.carousel",function(){var t=n(e.$indicators.children()[e.getActiveIndex()]);t&&t.addClass("active")})),n.support.transition&&this.$element.hasClass("slide")?(r.addClass(t),r[0].offsetWidth,u.addClass(f),r.addClass(f),u.one(n.support.transition.end,function(){r.removeClass([t,f].join(" ")).addClass("active");u.removeClass(["active",f].join(" "));e.sliding=!1;setTimeout(function(){e.$element.trigger("slid.bs.carousel")},0)}).emulateTransitionEnd(u.css("transition-duration").slice(0,-1)*1e3)):(u.removeClass("active"),r.addClass("active"),this.sliding=!1,this.$element.trigger("slid.bs.carousel")),s&&this.cycle(),this)};i=n.fn.carousel;n.fn.carousel=function(i){return this.each(function(){var u=n(this),r=u.data("bs.carousel"),f=n.extend({},t.DEFAULTS,u.data(),typeof i=="object"&&i),e=typeof i=="string"?i:f.slide;r||u.data("bs.carousel",r=new t(this,f));typeof i=="number"?r.to(i):e?r[e]():f.interval&&r.pause().cycle()})};n.fn.carousel.Constructor=t;n.fn.carousel.noConflict=function(){return n.fn.carousel=i,this};n(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(t){var i=n(this),f,r=n(i.attr("data-target")||(f=i.attr("href"))&&f.replace(/.*(?=#[^\s]+$)/,"")),e=n.extend({},r.data(),i.data()),u=i.attr("data-slide-to");u&&(e.interval=!1);r.carousel(e);(u=i.attr("data-slide-to"))&&r.data("bs.carousel").to(u);t.preventDefault()});n(window).on("load",function(){n('[data-ride="carousel"]').each(function(){var t=n(this);t.carousel(t.data())})})}(jQuery);+function(n){function r(t){n(e).remove();n(i).each(function(){var i=u(n(this)),r={relatedTarget:this};i.hasClass("open")&&((i.trigger(t=n.Event("hide.bs.dropdown",r)),t.isDefaultPrevented())||i.removeClass("open").trigger("hidden.bs.dropdown",r))})}function u(t){var i=t.attr("data-target"),r;return i||(i=t.attr("href"),i=i&&/#[A-Za-z]/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,"")),r=i&&n(i),r&&r.length?r:t.parent()}var f;"use strict";var e=".dropdown-backdrop",i="[data-toggle=dropdown]",t=function(t){n(t).on("click.bs.dropdown",this.toggle)};t.prototype.toggle=function(t){var f=n(this),i,o,e;if(!f.is(".disabled, :disabled")){if(i=u(f),o=i.hasClass("open"),r(),!o){if("ontouchstart"in document.documentElement&&!i.closest(".navbar-nav").length&&n('<div class="dropdown-backdrop"/>').insertAfter(n(this)).on("click",r),e={relatedTarget:this},i.trigger(t=n.Event("show.bs.dropdown",e)),t.isDefaultPrevented())return;i.toggleClass("open").trigger("shown.bs.dropdown",e);f.focus()}return!1}};t.prototype.keydown=function(t){var e,o,s,h,f,r;if(/(38|40|27)/.test(t.keyCode)&&(e=n(this),t.preventDefault(),t.stopPropagation(),!e.is(".disabled, :disabled"))){if(o=u(e),s=o.hasClass("open"),!s||s&&t.keyCode==27)return t.which==27&&o.find(i).focus(),e.click();(h=" li:not(.divider):visible a",f=o.find("[role=menu]"+h+", [role=listbox]"+h),f.length)&&(r=f.index(f.filter(":focus")),t.keyCode==38&&r>0&&r--,t.keyCode==40&&r<f.length-1&&r++,~r||(r=0),f.eq(r).focus())}};f=n.fn.dropdown;n.fn.dropdown=function(i){return this.each(function(){var r=n(this),u=r.data("bs.dropdown");u||r.data("bs.dropdown",u=new t(this));typeof i=="string"&&u[i].call(r)})};n.fn.dropdown.Constructor=t;n.fn.dropdown.noConflict=function(){return n.fn.dropdown=f,this};n(document).on("click.bs.dropdown.data-api",r).on("click.bs.dropdown.data-api",".dropdown form",function(n){n.stopPropagation()}).on("click.bs.dropdown.data-api",i,t.prototype.toggle).on("keydown.bs.dropdown.data-api",i+", [role=menu], [role=listbox]",t.prototype.keydown)}(jQuery);+function(n){"use strict";var t=function(t,i){this.options=i;this.$element=n(t);this.$backdrop=this.isShown=null;this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,n.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))},i;t.DEFAULTS={backdrop:!0,keyboard:!0,show:!0};t.prototype.toggle=function(n){return this[this.isShown?"hide":"show"](n)};t.prototype.show=function(t){var i=this,r=n.Event("show.bs.modal",{relatedTarget:t});(this.$element.trigger(r),this.isShown||r.isDefaultPrevented())||(this.isShown=!0,this.escape(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',n.proxy(this.hide,this)),this.backdrop(function(){var u=n.support.transition&&i.$element.hasClass("fade"),r;i.$element.parent().length||i.$element.appendTo(document.body);i.$element.show().scrollTop(0);u&&i.$element[0].offsetWidth;i.$element.addClass("in").attr("aria-hidden",!1);i.enforceFocus();r=n.Event("shown.bs.modal",{relatedTarget:t});u?i.$element.find(".modal-dialog").one(n.support.transition.end,function(){i.$element.focus().trigger(r)}).emulateTransitionEnd(300):i.$element.focus().trigger(r)}))};t.prototype.hide=function(t){(t&&t.preventDefault(),t=n.Event("hide.bs.modal"),this.$element.trigger(t),this.isShown&&!t.isDefaultPrevented())&&(this.isShown=!1,this.escape(),n(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal"),n.support.transition&&this.$element.hasClass("fade")?this.$element.one(n.support.transition.end,n.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal())};t.prototype.enforceFocus=function(){n(document).off("focusin.bs.modal").on("focusin.bs.modal",n.proxy(function(n){this.$element[0]===n.target||this.$element.has(n.target).length||this.$element.focus()},this))};t.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.bs.modal",n.proxy(function(n){n.which==27&&this.hide()},this)):this.isShown||this.$element.off("keyup.dismiss.bs.modal")};t.prototype.hideModal=function(){var n=this;this.$element.hide();this.backdrop(function(){n.removeBackdrop();n.$element.trigger("hidden.bs.modal")})};t.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove();this.$backdrop=null};t.prototype.backdrop=function(t){var r=this.$element.hasClass("fade")?"fade":"",i;if(this.isShown&&this.options.backdrop){if(i=n.support.transition&&r,this.$backdrop=n('<div class="modal-backdrop '+r+'" />').appendTo(document.body),this.$element.on("click.dismiss.bs.modal",n.proxy(function(n){n.target===n.currentTarget&&(this.options.backdrop=="static"?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!t)return;i?this.$backdrop.one(n.support.transition.end,t).emulateTransitionEnd(150):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),n.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(n.support.transition.end,t).emulateTransitionEnd(150):t()):t&&t()};i=n.fn.modal;n.fn.modal=function(i,r){return this.each(function(){var f=n(this),u=f.data("bs.modal"),e=n.extend({},t.DEFAULTS,f.data(),typeof i=="object"&&i);u||f.data("bs.modal",u=new t(this,e));typeof i=="string"?u[i](r):e.show&&u.show(r)})};n.fn.modal.Constructor=t;n.fn.modal.noConflict=function(){return n.fn.modal=i,this};n(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(t){var i=n(this),r=i.attr("href"),u=n(i.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),f=u.data("bs.modal")?"toggle":n.extend({remote:!/#/.test(r)&&r},u.data(),i.data());i.is("a")&&t.preventDefault();u.modal(f,this).one("hide",function(){i.is(":visible")&&i.focus()})});n(document).on("show.bs.modal",".modal",function(){n(document.body).addClass("modal-open")}).on("hidden.bs.modal",".modal",function(){n(document.body).removeClass("modal-open")})}(jQuery);+function(n){"use strict";var t=function(n,t){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null;this.init("tooltip",n,t)},i;t.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"><\/div><div class="tooltip-inner"><\/div><\/div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1};t.prototype.init=function(t,i,r){var f,e,u,o,s;for(this.enabled=!0,this.type=t,this.$element=n(i),this.options=this.getOptions(r),f=this.options.trigger.split(" "),e=f.length;e--;)if(u=f[e],u=="click")this.$element.on("click."+this.type,this.options.selector,n.proxy(this.toggle,this));else u!="manual"&&(o=u=="hover"?"mouseenter":"focusin",s=u=="hover"?"mouseleave":"focusout",this.$element.on(o+"."+this.type,this.options.selector,n.proxy(this.enter,this)),this.$element.on(s+"."+this.type,this.options.selector,n.proxy(this.leave,this)));this.options.selector?this._options=n.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()};t.prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.getOptions=function(t){return t=n.extend({},this.getDefaults(),this.$element.data(),t),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t};t.prototype.getDelegateOptions=function(){var t={},i=this.getDefaults();return this._options&&n.each(this._options,function(n,r){i[n]!=r&&(t[n]=r)}),t};t.prototype.enter=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);if(clearTimeout(i.timeout),i.hoverState="in",!i.options.delay||!i.options.delay.show)return i.show();i.timeout=setTimeout(function(){i.hoverState=="in"&&i.show()},i.options.delay.show)};t.prototype.leave=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);if(clearTimeout(i.timeout),i.hoverState="out",!i.options.delay||!i.options.delay.hide)return i.hide();i.timeout=setTimeout(function(){i.hoverState=="out"&&i.hide()},i.options.delay.hide)};t.prototype.show=function(){var h=n.Event("show.bs."+this.type),u,i,v,s;if(this.hasContent()&&this.enabled){if(this.$element.trigger(h),h.isDefaultPrevented())return;u=this;i=this.tip();this.setContent();this.options.animation&&i.addClass("fade");var t=typeof this.options.placement=="function"?this.options.placement.call(this,i[0],this.$element[0]):this.options.placement,c=/\s?auto?\s?/i,l=c.test(t);l&&(t=t.replace(c,"")||"top");i.detach().css({top:0,left:0,display:"block"}).addClass(t);this.options.container?i.appendTo(this.options.container):i.insertAfter(this.$element);var r=this.getPosition(),f=i[0].offsetWidth,e=i[0].offsetHeight;if(l){var o=this.$element.parent(),y=t,a=document.documentElement.scrollTop||document.body.scrollTop,p=this.options.container=="body"?window.innerWidth:o.outerWidth(),w=this.options.container=="body"?window.innerHeight:o.outerHeight(),b=this.options.container=="body"?0:o.offset().left;t=t=="bottom"&&r.top+r.height+e-a>w?"top":t=="top"&&r.top-a-e<0?"bottom":t=="right"&&r.right+f>p?"left":t=="left"&&r.left-f<b?"right":t;i.removeClass(y).addClass(t)}v=this.getCalculatedOffset(t,r,f,e);this.applyPlacement(v,t);this.hoverState=null;s=function(){u.$element.trigger("shown.bs."+u.type)};n.support.transition&&this.$tip.hasClass("fade")?i.one(n.support.transition.end,s).emulateTransitionEnd(150):s()}};t.prototype.applyPlacement=function(t,i){var c,r=this.tip(),l=r[0].offsetWidth,e=r[0].offsetHeight,o=parseInt(r.css("margin-top"),10),s=parseInt(r.css("margin-left"),10),f,u,h;isNaN(o)&&(o=0);isNaN(s)&&(s=0);t.top=t.top+o;t.left=t.left+s;n.offset.setOffset(r[0],n.extend({using:function(n){r.css({top:Math.round(n.top),left:Math.round(n.left)})}},t),0);r.addClass("in");f=r[0].offsetWidth;u=r[0].offsetHeight;i=="top"&&u!=e&&(c=!0,t.top=t.top+e-u);/bottom|top/.test(i)?(h=0,t.left<0&&(h=t.left*-2,t.left=0,r.offset(t),f=r[0].offsetWidth,u=r[0].offsetHeight),this.replaceArrow(h-l+f,f,"left")):this.replaceArrow(u-e,u,"top");c&&r.offset(t)};t.prototype.replaceArrow=function(n,t,i){this.arrow().css(i,n?50*(1-n/t)+"%":"")};t.prototype.setContent=function(){var n=this.tip(),t=this.getTitle();n.find(".tooltip-inner")[this.options.html?"html":"text"](t);n.removeClass("fade in top bottom left right")};t.prototype.hide=function(){function r(){t.hoverState!="in"&&i.detach();t.$element.trigger("hidden.bs."+t.type)}var t=this,i=this.tip(),u=n.Event("hide.bs."+this.type);if(this.$element.trigger(u),!u.isDefaultPrevented())return i.removeClass("in"),n.support.transition&&this.$tip.hasClass("fade")?i.one(n.support.transition.end,r).emulateTransitionEnd(150):r(),this.hoverState=null,this};t.prototype.fixTitle=function(){var n=this.$element;(n.attr("title")||typeof n.attr("data-original-title")!="string")&&n.attr("data-original-title",n.attr("title")||"").attr("title","")};t.prototype.hasContent=function(){return this.getTitle()};t.prototype.getPosition=function(){var t=this.$element[0];return n.extend({},typeof t.getBoundingClientRect=="function"?t.getBoundingClientRect():{width:t.offsetWidth,height:t.offsetHeight},this.$element.offset())};t.prototype.getCalculatedOffset=function(n,t,i,r){return n=="bottom"?{top:t.top+t.height,left:t.left+t.width/2-i/2}:n=="top"?{top:t.top-r,left:t.left+t.width/2-i/2}:n=="left"?{top:t.top+t.height/2-r/2,left:t.left-i}:{top:t.top+t.height/2-r/2,left:t.left+t.width}};t.prototype.getTitle=function(){var t,i=this.$element,n=this.options;return t=i.attr("data-original-title")||(typeof n.title=="function"?n.title.call(i[0]):n.title),t};t.prototype.tip=function(){return this.$tip=this.$tip||n(this.options.template)};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")};t.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)};t.prototype.enable=function(){this.enabled=!0};t.prototype.disable=function(){this.enabled=!1};t.prototype.toggleEnabled=function(){this.enabled=!this.enabled};t.prototype.toggle=function(t){var i=t?n(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type):this;i.tip().hasClass("in")?i.leave(i):i.enter(i)};t.prototype.destroy=function(){clearTimeout(this.timeout);this.hide().$element.off("."+this.type).removeData("bs."+this.type)};i=n.fn.tooltip;n.fn.tooltip=function(i){return this.each(function(){var u=n(this),r=u.data("bs.tooltip"),f=typeof i=="object"&&i;(r||i!="destroy")&&(r||u.data("bs.tooltip",r=new t(this,f)),typeof i=="string"&&r[i]())})};n.fn.tooltip.Constructor=t;n.fn.tooltip.noConflict=function(){return n.fn.tooltip=i,this}}(jQuery);+function(n){"use strict";var t=function(n,t){this.init("popover",n,t)},i;if(!n.fn.tooltip)throw new Error("Popover requires tooltip.js");t.DEFAULTS=n.extend({},n.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"><\/div><h3 class="popover-title"><\/h3><div class="popover-content"><\/div><\/div>'});t.prototype=n.extend({},n.fn.tooltip.Constructor.prototype);t.prototype.constructor=t;t.prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.setContent=function(){var n=this.tip(),i=this.getTitle(),t=this.getContent();n.find(".popover-title")[this.options.html?"html":"text"](i);n.find(".popover-content")[this.options.html?typeof t=="string"?"html":"append":"text"](t);n.removeClass("fade top bottom left right in");n.find(".popover-title").html()||n.find(".popover-title").hide()};t.prototype.hasContent=function(){return this.getTitle()||this.getContent()};t.prototype.getContent=function(){var t=this.$element,n=this.options;return t.attr("data-content")||(typeof n.content=="function"?n.content.call(t[0]):n.content)};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};t.prototype.tip=function(){return this.$tip||(this.$tip=n(this.options.template)),this.$tip};i=n.fn.popover;n.fn.popover=function(i){return this.each(function(){var u=n(this),r=u.data("bs.popover"),f=typeof i=="object"&&i;(r||i!="destroy")&&(r||u.data("bs.popover",r=new t(this,f)),typeof i=="string"&&r[i]())})};n.fn.popover.Constructor=t;n.fn.popover.noConflict=function(){return n.fn.popover=i,this}}(jQuery);+function(n){"use strict";var t=function(t){this.element=n(t)},i;t.prototype.show=function(){var t=this.element,e=t.closest("ul:not(.dropdown-menu)"),i=t.data("target"),r,u,f;(i||(i=t.attr("href"),i=i&&i.replace(/.*(?=#[^\s]*$)/,"")),t.parent("li").hasClass("active"))||(r=e.find(".active:last a")[0],u=n.Event("show.bs.tab",{relatedTarget:r}),t.trigger(u),u.isDefaultPrevented())||(f=n(i),this.activate(t.parent("li"),e),this.activate(f,f.parent(),function(){t.trigger({type:"shown.bs.tab",relatedTarget:r})}))};t.prototype.activate=function(t,i,r){function f(){u.removeClass("active").find("> .dropdown-menu > .active").removeClass("active");t.addClass("active");e?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade");t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active");r&&r()}var u=i.find("> .active"),e=r&&n.support.transition&&u.hasClass("fade");e?u.one(n.support.transition.end,f).emulateTransitionEnd(150):f();u.removeClass("in")};i=n.fn.tab;n.fn.tab=function(i){return this.each(function(){var u=n(this),r=u.data("bs.tab");r||u.data("bs.tab",r=new t(this));typeof i=="string"&&r[i]()})};n.fn.tab.Constructor=t;n.fn.tab.noConflict=function(){return n.fn.tab=i,this};n(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault();n(this).tab("show")})}(jQuery);+function(n){"use strict";var t=function(i,r){this.options=n.extend({},t.DEFAULTS,r);this.$window=n(window).on("scroll.bs.affix.data-api",n.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",n.proxy(this.checkPositionWithEventLoop,this));this.$element=n(i);this.affixed=this.unpin=this.pinnedOffset=null;this.checkPosition()},i;t.RESET="affix affix-top affix-bottom";t.DEFAULTS={offset:0};t.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(t.RESET).addClass("affix");var n=this.$window.scrollTop(),i=this.$element.offset();return this.pinnedOffset=i.top-n};t.prototype.checkPositionWithEventLoop=function(){setTimeout(n.proxy(this.checkPosition,this),1)};t.prototype.checkPosition=function(){var i,e,h;if(this.$element.is(":visible")){var c=n(document).height(),o=this.$window.scrollTop(),s=this.$element.offset(),r=this.options.offset,f=r.top,u=r.bottom;(this.affixed=="top"&&(s.top+=o),typeof r!="object"&&(u=f=r),typeof f=="function"&&(f=r.top(this.$element)),typeof u=="function"&&(u=r.bottom(this.$element)),i=this.unpin!=null&&o+this.unpin<=s.top?!1:u!=null&&s.top+this.$element.height()>=c-u?"bottom":f!=null&&o<=f?"top":!1,this.affixed!==i)&&((this.unpin&&this.$element.css("top",""),e="affix"+(i?"-"+i:""),h=n.Event(e+".bs.affix"),this.$element.trigger(h),h.isDefaultPrevented())||(this.affixed=i,this.unpin=i=="bottom"?this.getPinnedOffset():null,this.$element.removeClass(t.RESET).addClass(e).trigger(n.Event(e.replace("affix","affixed"))),i=="bottom"&&this.$element.offset({top:c-u-this.$element.height()})))}};i=n.fn.affix;n.fn.affix=function(i){return this.each(function(){var u=n(this),r=u.data("bs.affix"),f=typeof i=="object"&&i;r||u.data("bs.affix",r=new t(this,f));typeof i=="string"&&r[i]()})};n.fn.affix.Constructor=t;n.fn.affix.noConflict=function(){return n.fn.affix=i,this};n(window).on("load",function(){n('[data-spy="affix"]').each(function(){var i=n(this),t=i.data();t.offset=t.offset||{};t.offsetBottom&&(t.offset.bottom=t.offsetBottom);t.offsetTop&&(t.offset.top=t.offsetTop);i.affix(t)})})}(jQuery);+function(n){"use strict";var t=function(i,r){this.$element=n(i);this.options=n.extend({},t.DEFAULTS,r);this.transitioning=null;this.options.parent&&(this.$parent=n(this.options.parent));this.options.toggle&&this.toggle()},i;t.DEFAULTS={toggle:!0};t.prototype.dimension=function(){var n=this.$element.hasClass("width");return n?"width":"height"};t.prototype.show=function(){var u,t,r,i,f,e;if(!this.transitioning&&!this.$element.hasClass("in")&&(u=n.Event("show.bs.collapse"),this.$element.trigger(u),!u.isDefaultPrevented())){if(t=this.$parent&&this.$parent.find("> .panel > .in"),t&&t.length){if(r=t.data("bs.collapse"),r&&r.transitioning)return;t.collapse("hide");r||t.data("bs.collapse",null)}if(i=this.dimension(),this.$element.removeClass("collapse").addClass("collapsing")[i](0),this.transitioning=1,f=function(){this.$element.removeClass("collapsing").addClass("collapse in")[i]("auto");this.transitioning=0;this.$element.trigger("shown.bs.collapse")},!n.support.transition)return f.call(this);e=n.camelCase(["scroll",i].join("-"));this.$element.one(n.support.transition.end,n.proxy(f,this)).emulateTransitionEnd(350)[i](this.$element[0][e])}};t.prototype.hide=function(){var i,t,r;if(!this.transitioning&&this.$element.hasClass("in")&&(i=n.Event("hide.bs.collapse"),this.$element.trigger(i),!i.isDefaultPrevented())){if(t=this.dimension(),this.$element[t](this.$element[t]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1,r=function(){this.transitioning=0;this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")},!n.support.transition)return r.call(this);this.$element[t](0).one(n.support.transition.end,n.proxy(r,this)).emulateTransitionEnd(350)}};t.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};i=n.fn.collapse;n.fn.collapse=function(i){return this.each(function(){var u=n(this),r=u.data("bs.collapse"),f=n.extend({},t.DEFAULTS,u.data(),typeof i=="object"&&i);!r&&f.toggle&&i=="show"&&(i=!i);r||u.data("bs.collapse",r=new t(this,f));typeof i=="string"&&r[i]()})};n.fn.collapse.Constructor=t;n.fn.collapse.noConflict=function(){return n.fn.collapse=i,this};n(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(t){var i=n(this),e,s=i.attr("data-target")||t.preventDefault()||(e=i.attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,""),r=n(s),u=r.data("bs.collapse"),h=u?"toggle":i.data(),f=i.attr("data-parent"),o=f&&n(f);u&&u.transitioning||(o&&o.find('[data-toggle=collapse][data-parent="'+f+'"]').not(i).addClass("collapsed"),i[r.hasClass("in")?"addClass":"removeClass"]("collapsed"));r.collapse(h)})}(jQuery);+function(n){function t(i,r){var u,f=n.proxy(this.process,this);this.$element=n(i).is("body")?n(window):n(i);this.$body=n("body");this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f);this.options=n.extend({},t.DEFAULTS,r);this.selector=(this.options.target||(u=n(i).attr("href"))&&u.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a";this.offsets=n([]);this.targets=n([]);this.activeTarget=null;this.refresh();this.process()}t.DEFAULTS={offset:10};t.prototype.refresh=function(){var i=this.$element[0]==window?"offset":"position",t,r;this.offsets=n([]);this.targets=n([]);t=this;r=this.$body.find(this.selector).map(function(){var f=n(this),u=f.data("target")||f.attr("href"),r=/^#./.test(u)&&n(u);return r&&r.length&&r.is(":visible")&&[[r[i]().top+(!n.isWindow(t.$scrollElement.get(0))&&t.$scrollElement.scrollTop()),u]]||null}).sort(function(n,t){return n[0]-t[0]}).each(function(){t.offsets.push(this[0]);t.targets.push(this[1])})};t.prototype.process=function(){var i=this.$scrollElement.scrollTop()+this.options.offset,f=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,e=f-this.$scrollElement.height(),t=this.offsets,r=this.targets,u=this.activeTarget,n;if(i>=e)return u!=(n=r.last()[0])&&this.activate(n);if(u&&i<=t[0])return u!=(n=r[0])&&this.activate(n);for(n=t.length;n--;)u!=r[n]&&i>=t[n]&&(!t[n+1]||i<=t[n+1])&&this.activate(r[n])};t.prototype.activate=function(t){this.activeTarget=t;n(this.selector).parentsUntil(this.options.target,".active").removeClass("active");var r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',i=n(r).parents("li").addClass("active");i.parent(".dropdown-menu").length&&(i=i.closest("li.dropdown").addClass("active"));i.trigger("activate.bs.scrollspy")};var i=n.fn.scrollspy;n.fn.scrollspy=function(i){return this.each(function(){var u=n(this),r=u.data("bs.scrollspy"),f=typeof i=="object"&&i;r||u.data("bs.scrollspy",r=new t(this,f));typeof i=="string"&&r[i]()})};n.fn.scrollspy.Constructor=t;n.fn.scrollspy.noConflict=function(){return n.fn.scrollspy=i,this};n(window).on("load",function(){n('[data-spy="scroll"]').each(function(){var t=n(this);t.scrollspy(t.data())})})}(jQuery);+function(n){function t(){var i=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},n;for(n in t)if(i.style[n]!==undefined)return{end:t[n]};return!1}n.fn.emulateTransitionEnd=function(t){var i=!1,u=this,r;n(this).one(n.support.transition.end,function(){i=!0});return r=function(){i||n(u).trigger(n.support.transition.end)},setTimeout(r,t),this};n(function(){n.support.transition=t()})}(jQuery);$(document).ready(function(){eval(function(n,t,i,r,u,f){if(u=function(n){return(n<t?"":u(parseInt(n/t)))+((n=n%t)>35?String.fromCharCode(n+29):n.toString(36))},!"".replace(/^/,String)){while(i--)f[u(i)]=r[i]||u(i);r=[function(n){return f[n]}];u=function(){return"\\w+"};i=1}while(i--)r[i]&&(n=n.replace(new RegExp("\\b"+u(i)+"\\b","g"),r[i]));return n}("h.i['1a']=h.i['z'];h.O(h.i,{y:'D',z:9(x,t,b,c,d){6 h.i[h.i.y](x,t,b,c,d)},17:9(x,t,b,c,d){6 c*(t/=d)*t+b},D:9(x,t,b,c,d){6-c*(t/=d)*(t-2)+b},13:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t+b;6-c/2*((--t)*(t-2)-1)+b},X:9(x,t,b,c,d){6 c*(t/=d)*t*t+b},U:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t+1)+b},R:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t+b;6 c/2*((t-=2)*t*t+2)+b},N:9(x,t,b,c,d){6 c*(t/=d)*t*t*t+b},M:9(x,t,b,c,d){6-c*((t=t/d-1)*t*t*t-1)+b},L:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t+b;6-c/2*((t-=2)*t*t*t-2)+b},K:9(x,t,b,c,d){6 c*(t/=d)*t*t*t*t+b},J:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t*t*t+1)+b},I:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t*t+b;6 c/2*((t-=2)*t*t*t*t+2)+b},G:9(x,t,b,c,d){6-c*8.C(t/d*(8.g/2))+c+b},15:9(x,t,b,c,d){6 c*8.n(t/d*(8.g/2))+b},12:9(x,t,b,c,d){6-c/2*(8.C(8.g*t/d)-1)+b},Z:9(x,t,b,c,d){6(t==0)?b:c*8.j(2,10*(t/d-1))+b},Y:9(x,t,b,c,d){6(t==d)?b+c:c*(-8.j(2,-10*t/d)+1)+b},W:9(x,t,b,c,d){e(t==0)6 b;e(t==d)6 b+c;e((t/=d/2)<1)6 c/2*8.j(2,10*(t-1))+b;6 c/2*(-8.j(2,-10*--t)+2)+b},V:9(x,t,b,c,d){6-c*(8.o(1-(t/=d)*t)-1)+b},S:9(x,t,b,c,d){6 c*8.o(1-(t=t/d-1)*t)+b},Q:9(x,t,b,c,d){e((t/=d/2)<1)6-c/2*(8.o(1-t*t)-1)+b;6 c/2*(8.o(1-(t-=2)*t)+1)+b},P:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6-(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b},H:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6 a*8.j(2,-10*t)*8.n((t*d-s)*(2*8.g)/p)+c+b},T:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d/2)==2)6 b+c;e(!p)p=d*(.3*1.5);e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);e(t<1)6-.5*(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b;6 a*8.j(2,-10*(t-=1))*8.n((t*d-s)*(2*8.g)/p)*.5+c+b},F:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*(t/=d)*t*((s+1)*t-s)+b},E:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},16:9(x,t,b,c,d,s){e(s==u)s=1.l;e((t/=d/2)<1)6 c/2*(t*t*(((s*=(1.B))+1)*t-s))+b;6 c/2*((t-=2)*t*(((s*=(1.B))+1)*t+s)+2)+b},A:9(x,t,b,c,d){6 c-h.i.v(x,d-t,0,c,d)+b},v:9(x,t,b,c,d){e((t/=d)<(1/2.k)){6 c*(7.q*t*t)+b}m e(t<(2/2.k)){6 c*(7.q*(t-=(1.5/2.k))*t+.k)+b}m e(t<(2.5/2.k)){6 c*(7.q*(t-=(2.14/2.k))*t+.11)+b}m{6 c*(7.q*(t-=(2.18/2.k))*t+.19)+b}},1b:9(x,t,b,c,d){e(t<d/2)6 h.i.A(x,t*2,0,c,d)*.5+b;6 h.i.v(x,t*2-d,0,c,d)*.5+c*.5+b}});",62,74,"||||||return||Math|function|||||if|var|PI|jQuery|easing|pow|75|70158|else|sin|sqrt||5625|asin|||undefined|easeOutBounce|abs||def|swing|easeInBounce|525|cos|easeOutQuad|easeOutBack|easeInBack|easeInSine|easeOutElastic|easeInOutQuint|easeOutQuint|easeInQuint|easeInOutQuart|easeOutQuart|easeInQuart|extend|easeInElastic|easeInOutCirc|easeInOutCubic|easeOutCirc|easeInOutElastic|easeOutCubic|easeInCirc|easeInOutExpo|easeInCubic|easeOutExpo|easeInExpo||9375|easeInOutSine|easeInOutQuad|25|easeOutSine|easeInOutBack|easeInQuad|625|984375|jswing|easeInOutBounce".split("|"),0,{}))});!function(n,t,i,r){function f(t,i){this.element=t;this.options=n.extend({},h,i);this._defaults=h;this._name=u;this.init()}var u="stellar",h={scrollProperty:"scroll",positionProperty:"position",horizontalScrolling:!0,verticalScrolling:!0,horizontalOffset:0,verticalOffset:0,responsive:!1,parallaxBackgrounds:!0,parallaxElements:!0,hideDistantElements:!0,hideElement:function(n){n.hide()},showElement:function(n){n.show()}},e={scroll:{getLeft:function(n){return n.scrollLeft()},setLeft:function(n,t){n.scrollLeft(t)},getTop:function(n){return n.scrollTop()},setTop:function(n,t){n.scrollTop(t)}},position:{getLeft:function(n){return-1*parseInt(n.css("left"),10)},getTop:function(n){return-1*parseInt(n.css("top"),10)}},margin:{getLeft:function(n){return-1*parseInt(n.css("margin-left"),10)},getTop:function(n){return-1*parseInt(n.css("margin-top"),10)}},transform:{getLeft:function(n){var t=getComputedStyle(n[0])[o];return"none"!==t?-1*parseInt(t.match(/(-?[0-9]+)/g)[4],10):0},getTop:function(n){var t=getComputedStyle(n[0])[o];return"none"!==t?-1*parseInt(t.match(/(-?[0-9]+)/g)[5],10):0}}},c={position:{setLeft:function(n,t){n.css("left",t)},setTop:function(n,t){n.css("top",t)}},transform:{setPosition:function(n,t,i,r,u){n[0].style[o]="translate3d("+(t-i)+"px, "+(r-u)+"px, 0)"}}},v=function(){var i,u=/^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,r=n("script")[0].style,t="";for(i in r)if(u.test(i)){t=i.match(u)[0];break}return"WebkitOpacity"in r&&(t="Webkit"),"KhtmlOpacity"in r&&(t="Khtml"),function(n){return t+(t.length>0?n.charAt(0).toUpperCase()+n.slice(1):n)}}(),o=v("transform"),l=n("<div />",{style:"background:#fff"}).css("background-position-x")!==r,s=l?function(n,t,i){n.css({"background-position-x":t,"background-position-y":i})}:function(n,t,i){n.css("background-position",t+" "+i)},y=l?function(n){return[n.css("background-position-x"),n.css("background-position-y")]}:function(n){return n.css("background-position").split(" ")},a=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame||function(n){setTimeout(n,1e3/60)};f.prototype={init:function(){this.options.name=u+"_"+Math.floor(1e9*Math.random());this._defineElements();this._defineGetters();this._defineSetters();this._handleWindowLoadAndResize();this._detectViewport();this.refresh({firstLoad:!0});"scroll"===this.options.scrollProperty?this._handleScrollEvent():this._startAnimationLoop()},_defineElements:function(){this.element===i.body&&(this.element=t);this.$scrollElement=n(this.element);this.$element=this.element===t?n("body"):this.$scrollElement;this.$viewportElement=this.options.viewportElement!==r?n(this.options.viewportElement):this.$scrollElement[0]===t||"scroll"===this.options.scrollProperty?this.$scrollElement:this.$scrollElement.parent()},_defineGetters:function(){var n=this,t=e[n.options.scrollProperty];this._getScrollLeft=function(){return t.getLeft(n.$scrollElement)};this._getScrollTop=function(){return t.getTop(n.$scrollElement)}},_defineSetters:function(){var t=this,r=e[t.options.scrollProperty],i=c[t.options.positionProperty],u=r.setLeft,f=r.setTop;this._setScrollLeft="function"==typeof u?function(n){u(t.$scrollElement,n)}:n.noop;this._setScrollTop="function"==typeof f?function(n){f(t.$scrollElement,n)}:n.noop;this._setPosition=i.setPosition||function(n,r,u,f,e){t.options.horizontalScrolling&&i.setLeft(n,r,u);t.options.verticalScrolling&&i.setTop(n,f,e)}},_handleWindowLoadAndResize:function(){var i=this,r=n(t);i.options.responsive&&r.bind("load."+this.name,function(){i.refresh()});r.bind("resize."+this.name,function(){i._detectViewport();i.options.responsive&&i.refresh()})},refresh:function(i){var r=this,u=r._getScrollLeft(),f=r._getScrollTop();i&&i.firstLoad||this._reset();this._setScrollLeft(0);this._setScrollTop(0);this._setOffsets();this._findParticles();this._findBackgrounds();i&&i.firstLoad&&/WebKit/.test(navigator.userAgent)&&n(t).load(function(){var n=r._getScrollLeft(),t=r._getScrollTop();r._setScrollLeft(n+1);r._setScrollTop(t+1);r._setScrollLeft(n);r._setScrollTop(t)});this._setScrollLeft(u);this._setScrollTop(f)},_detectViewport:function(){var n=this.$viewportElement.offset(),t=null!==n&&n!==r;this.viewportWidth=this.$viewportElement.width();this.viewportHeight=this.$viewportElement.height();this.viewportOffsetTop=t?n.top:0;this.viewportOffsetLeft=t?n.left:0},_findParticles:function(){var t=this,i;if(this._getScrollLeft(),this._getScrollTop(),this.particles!==r)for(i=this.particles.length-1;i>=0;i--)this.particles[i].$element.data("stellar-elementIsActive",r);this.particles=[];this.options.parallaxElements&&this.$element.find("[data-stellar-ratio]").each(function(){var f,e,o,s,h,c,u,l,a,i=n(this),v=0,y=0,p=0,w=0;if(i.data("stellar-elementIsActive")){if(i.data("stellar-elementIsActive")!==this)return}else i.data("stellar-elementIsActive",this);t.options.showElement(i);i.data("stellar-startingLeft")?(i.css("left",i.data("stellar-startingLeft")),i.css("top",i.data("stellar-startingTop"))):(i.data("stellar-startingLeft",i.css("left")),i.data("stellar-startingTop",i.css("top")));o=i.position().left;s=i.position().top;h="auto"===i.css("margin-left")?0:parseInt(i.css("margin-left"),10);c="auto"===i.css("margin-top")?0:parseInt(i.css("margin-top"),10);l=i.offset().left-h;a=i.offset().top-c;i.parents().each(function(){var t=n(this);return t.data("stellar-offset-parent")===!0?(v=p,y=w,u=t,!1):(p+=t.position().left,void(w+=t.position().top))});f=i.data("stellar-horizontal-offset")!==r?i.data("stellar-horizontal-offset"):u!==r&&u.data("stellar-horizontal-offset")!==r?u.data("stellar-horizontal-offset"):t.horizontalOffset;e=i.data("stellar-vertical-offset")!==r?i.data("stellar-vertical-offset"):u!==r&&u.data("stellar-vertical-offset")!==r?u.data("stellar-vertical-offset"):t.verticalOffset;t.particles.push({$element:i,$offsetParent:u,isFixed:"fixed"===i.css("position"),horizontalOffset:f,verticalOffset:e,startingPositionLeft:o,startingPositionTop:s,startingOffsetLeft:l,startingOffsetTop:a,parentOffsetLeft:v,parentOffsetTop:y,stellarRatio:i.data("stellar-ratio")!==r?i.data("stellar-ratio"):1,width:i.outerWidth(!0),height:i.outerHeight(!0),isHidden:!1})})},_findBackgrounds:function(){var t,i=this,u=this._getScrollLeft(),f=this._getScrollTop();this.backgrounds=[];this.options.parallaxBackgrounds&&(t=this.$element.find("[data-stellar-background-ratio]"),this.$element.data("stellar-background-ratio")&&(t=t.add(this.$element)),t.each(function(){var h,c,l,a,v,p,e,t=n(this),o=y(t),w=0,b=0,k=0,d=0;if(t.data("stellar-backgroundIsActive")){if(t.data("stellar-backgroundIsActive")!==this)return}else t.data("stellar-backgroundIsActive",this);t.data("stellar-backgroundStartingLeft")?s(t,t.data("stellar-backgroundStartingLeft"),t.data("stellar-backgroundStartingTop")):(t.data("stellar-backgroundStartingLeft",o[0]),t.data("stellar-backgroundStartingTop",o[1]));l="auto"===t.css("margin-left")?0:parseInt(t.css("margin-left"),10);a="auto"===t.css("margin-top")?0:parseInt(t.css("margin-top"),10);v=t.offset().left-l-u;p=t.offset().top-a-f;t.parents().each(function(){var t=n(this);return t.data("stellar-offset-parent")===!0?(w=k,b=d,e=t,!1):(k+=t.position().left,void(d+=t.position().top))});h=t.data("stellar-horizontal-offset")!==r?t.data("stellar-horizontal-offset"):e!==r&&e.data("stellar-horizontal-offset")!==r?e.data("stellar-horizontal-offset"):i.horizontalOffset;c=t.data("stellar-vertical-offset")!==r?t.data("stellar-vertical-offset"):e!==r&&e.data("stellar-vertical-offset")!==r?e.data("stellar-vertical-offset"):i.verticalOffset;i.backgrounds.push({$element:t,$offsetParent:e,isFixed:"fixed"===t.css("background-attachment"),horizontalOffset:h,verticalOffset:c,startingValueLeft:o[0],startingValueTop:o[1],startingBackgroundPositionLeft:isNaN(parseInt(o[0],10))?0:parseInt(o[0],10),startingBackgroundPositionTop:isNaN(parseInt(o[1],10))?0:parseInt(o[1],10),startingPositionLeft:t.position().left,startingPositionTop:t.position().top,startingOffsetLeft:v,startingOffsetTop:p,parentOffsetLeft:w,parentOffsetTop:b,stellarRatio:t.data("stellar-background-ratio")===r?1:t.data("stellar-background-ratio")})}))},_reset:function(){for(var t,r,u,i,n=this.particles.length-1;n>=0;n--)t=this.particles[n],r=t.$element.data("stellar-startingLeft"),u=t.$element.data("stellar-startingTop"),this._setPosition(t.$element,r,r,u,u),this.options.showElement(t.$element),t.$element.data("stellar-startingLeft",null).data("stellar-elementIsActive",null).data("stellar-backgroundIsActive",null);for(n=this.backgrounds.length-1;n>=0;n--)i=this.backgrounds[n],i.$element.data("stellar-backgroundStartingLeft",null).data("stellar-backgroundStartingTop",null),s(i.$element,i.startingValueLeft,i.startingValueTop)},destroy:function(){this._reset();this.$scrollElement.unbind("resize."+this.name).unbind("scroll."+this.name);this._animationLoop=n.noop;n(t).unbind("load."+this.name).unbind("resize."+this.name)},_setOffsets:function(){var i=this,r=n(t);r.unbind("resize.horizontal-"+this.name).unbind("resize.vertical-"+this.name);"function"==typeof this.options.horizontalOffset?(this.horizontalOffset=this.options.horizontalOffset(),r.bind("resize.horizontal-"+this.name,function(){i.horizontalOffset=i.options.horizontalOffset()})):this.horizontalOffset=this.options.horizontalOffset;"function"==typeof this.options.verticalOffset?(this.verticalOffset=this.options.verticalOffset(),r.bind("resize.vertical-"+this.name,function(){i.verticalOffset=i.options.verticalOffset()})):this.verticalOffset=this.options.verticalOffset},_repositionElements:function(){var n,r,t,l,a,e,o,h,c,i,u=this._getScrollLeft(),f=this._getScrollTop(),v=!0,y=!0;if(this.currentScrollLeft!==u||this.currentScrollTop!==f||this.currentWidth!==this.viewportWidth||this.currentHeight!==this.viewportHeight){for(this.currentScrollLeft=u,this.currentScrollTop=f,this.currentWidth=this.viewportWidth,this.currentHeight=this.viewportHeight,i=this.particles.length-1;i>=0;i--)n=this.particles[i],r=n.isFixed?1:0,this.options.horizontalScrolling?(e=(u+n.horizontalOffset+this.viewportOffsetLeft+n.startingPositionLeft-n.startingOffsetLeft+n.parentOffsetLeft)*-(n.stellarRatio+r-1)+n.startingPositionLeft,h=e-n.startingPositionLeft+n.startingOffsetLeft):(e=n.startingPositionLeft,h=n.startingOffsetLeft),this.options.verticalScrolling?(o=(f+n.verticalOffset+this.viewportOffsetTop+n.startingPositionTop-n.startingOffsetTop+n.parentOffsetTop)*-(n.stellarRatio+r-1)+n.startingPositionTop,c=o-n.startingPositionTop+n.startingOffsetTop):(o=n.startingPositionTop,c=n.startingOffsetTop),this.options.hideDistantElements&&(y=!this.options.horizontalScrolling||h+n.width>(n.isFixed?0:u)&&h<(n.isFixed?0:u)+this.viewportWidth+this.viewportOffsetLeft,v=!this.options.verticalScrolling||c+n.height>(n.isFixed?0:f)&&c<(n.isFixed?0:f)+this.viewportHeight+this.viewportOffsetTop),y&&v?(n.isHidden&&(this.options.showElement(n.$element),n.isHidden=!1),this._setPosition(n.$element,e,n.startingPositionLeft,o,n.startingPositionTop)):n.isHidden||(this.options.hideElement(n.$element),n.isHidden=!0);for(i=this.backgrounds.length-1;i>=0;i--)t=this.backgrounds[i],r=t.isFixed?0:1,l=this.options.horizontalScrolling?(u+t.horizontalOffset-this.viewportOffsetLeft-t.startingOffsetLeft+t.parentOffsetLeft-t.startingBackgroundPositionLeft)*(r-t.stellarRatio)+"px":t.startingValueLeft,a=this.options.verticalScrolling?(f+t.verticalOffset-this.viewportOffsetTop-t.startingOffsetTop+t.parentOffsetTop-t.startingBackgroundPositionTop)*(r-t.stellarRatio)+"px":t.startingValueTop,s(t.$element,l,a)}},_handleScrollEvent:function(){var i=this,n=!1,r=function(){i._repositionElements();n=!1},t=function(){n||(a(r),n=!0)};this.$scrollElement.bind("scroll."+this.name,t);t()},_startAnimationLoop:function(){var n=this;this._animationLoop=function(){a(n._animationLoop);n._repositionElements()};this._animationLoop()}};n.fn[u]=function(t){var i=arguments;return t===r||"object"==typeof t?this.each(function(){n.data(this,"plugin_"+u)||n.data(this,"plugin_"+u,new f(this,t))}):"string"==typeof t&&"_"!==t[0]&&"init"!==t?this.each(function(){var r=n.data(this,"plugin_"+u);r instanceof f&&"function"==typeof r[t]&&r[t].apply(r,Array.prototype.slice.call(i,1));"destroy"===t&&n.data(this,"plugin_"+u,null)}):void 0};n[u]=function(){var i=n(t);return i.stellar.apply(i,Array.prototype.slice.call(arguments,0))};n[u].scrollProperty=e;n[u].positionProperty=c;t.Stellar=f}(jQuery,this,document);"function"!=typeof Object.create&&(Object.create=function(n){function t(){}return t.prototype=n,new t}),function(n,t,i){var r={init:function(t,i){this.$elem=n(i);this.options=n.extend({},n.fn.owlCarousel.options,this.$elem.data(),t);this.userOptions=t;this.loadContent()},loadContent:function(){function r(n){var i,r="";if("function"==typeof t.options.jsonSuccess)t.options.jsonSuccess.apply(this,[n]);else{for(i in n.owl)n.owl.hasOwnProperty(i)&&(r+=n.owl[i].item);t.$elem.html(r)}t.logIn()}var t=this,i;"function"==typeof t.options.beforeInit&&t.options.beforeInit.apply(this,[t.$elem]);"string"==typeof t.options.jsonPath?(i=t.options.jsonPath,n.getJSON(i,r)):t.logIn()},logIn:function(){this.$elem.data("owl-originalStyles",this.$elem.attr("style"));this.$elem.data("owl-originalClasses",this.$elem.attr("class"));this.$elem.css({opacity:0});this.orignalItems=this.options.items;this.checkBrowser();this.wrapperWidth=0;this.checkVisible=null;this.setVars()},setVars:function(){if(0===this.$elem.children().length)return!1;this.baseClass();this.eventTypes();this.$userItems=this.$elem.children();this.itemsAmount=this.$userItems.length;this.wrapItems();this.$owlItems=this.$elem.find(".owl-item");this.$owlWrapper=this.$elem.find(".owl-wrapper");this.playDirection="next";this.prevItem=0;this.prevArr=[0];this.currentItem=0;this.customEvents();this.onStartup()},onStartup:function(){this.updateItems();this.calculateAll();this.buildControls();this.updateControls();this.response();this.moveEvents();this.stopOnHover();this.owlStatus();!1!==this.options.transitionStyle&&this.transitionTypes(this.options.transitionStyle);!0===this.options.autoPlay&&(this.options.autoPlay=5e3);this.play();this.$elem.find(".owl-wrapper").css("display","block");this.$elem.is(":visible")?this.$elem.css("opacity",1):this.watchVisibility();this.onstartup=!1;this.eachMoveUpdate();"function"==typeof this.options.afterInit&&this.options.afterInit.apply(this,[this.$elem])},eachMoveUpdate:function(){!0===this.options.lazyLoad&&this.lazyLoad();!0===this.options.autoHeight&&this.autoHeight();this.onVisibleItems();"function"==typeof this.options.afterAction&&this.options.afterAction.apply(this,[this.$elem])},updateVars:function(){"function"==typeof this.options.beforeUpdate&&this.options.beforeUpdate.apply(this,[this.$elem]);this.watchVisibility();this.updateItems();this.calculateAll();this.updatePosition();this.updateControls();this.eachMoveUpdate();"function"==typeof this.options.afterUpdate&&this.options.afterUpdate.apply(this,[this.$elem])},reload:function(){var n=this;t.setTimeout(function(){n.updateVars()},0)},watchVisibility:function(){var n=this;if(!1===n.$elem.is(":visible"))n.$elem.css({opacity:0}),t.clearInterval(n.autoPlayInterval),t.clearInterval(n.checkVisible);else return!1;n.checkVisible=t.setInterval(function(){n.$elem.is(":visible")&&(n.reload(),n.$elem.animate({opacity:1},200),t.clearInterval(n.checkVisible))},500)},wrapItems:function(){this.$userItems.wrapAll('<div class="owl-wrapper">').wrap('<div class="owl-item"><\/div>');this.$elem.find(".owl-wrapper").wrap('<div class="owl-wrapper-outer">');this.wrapperOuter=this.$elem.find(".owl-wrapper-outer");this.$elem.css("display","block")},baseClass:function(){var n=this.$elem.hasClass(this.options.baseClass),t=this.$elem.hasClass(this.options.theme);n||this.$elem.addClass(this.options.baseClass);t||this.$elem.addClass(this.options.theme)},updateItems:function(){var t,i;if(!1===this.options.responsive)return!1;if(!0===this.options.singleItem)return this.options.items=this.orignalItems=1,this.options.itemsCustom=!1,this.options.itemsDesktop=!1,this.options.itemsDesktopSmall=!1,this.options.itemsTablet=!1,this.options.itemsTabletSmall=!1,this.options.itemsMobile=!1;if(t=n(this.options.responsiveBaseWidth).width(),t>(this.options.itemsDesktop[0]||this.orignalItems)&&(this.options.items=this.orignalItems),!1!==this.options.itemsCustom)for(this.options.itemsCustom.sort(function(n,t){return n[0]-t[0]}),i=0;i<this.options.itemsCustom.length;i+=1)this.options.itemsCustom[i][0]<=t&&(this.options.items=this.options.itemsCustom[i][1]);else t<=this.options.itemsDesktop[0]&&!1!==this.options.itemsDesktop&&(this.options.items=this.options.itemsDesktop[1]),t<=this.options.itemsDesktopSmall[0]&&!1!==this.options.itemsDesktopSmall&&(this.options.items=this.options.itemsDesktopSmall[1]),t<=this.options.itemsTablet[0]&&!1!==this.options.itemsTablet&&(this.options.items=this.options.itemsTablet[1]),t<=this.options.itemsTabletSmall[0]&&!1!==this.options.itemsTabletSmall&&(this.options.items=this.options.itemsTabletSmall[1]),t<=this.options.itemsMobile[0]&&!1!==this.options.itemsMobile&&(this.options.items=this.options.itemsMobile[1]);this.options.items>this.itemsAmount&&!0===this.options.itemsScaleUp&&(this.options.items=this.itemsAmount)},response:function(){var i=this,u,r;if(!0!==i.options.responsive)return!1;r=n(t).width();i.resizer=function(){n(t).width()!==r&&(!1!==i.options.autoPlay&&t.clearInterval(i.autoPlayInterval),t.clearTimeout(u),u=t.setTimeout(function(){r=n(t).width();i.updateVars()},i.options.responsiveRefreshRate))};n(t).resize(i.resizer)},updatePosition:function(){this.jumpTo(this.currentItem);!1!==this.options.autoPlay&&this.checkAp()},appendItemsSizes:function(){var t=this,i=0,r=t.itemsAmount-t.options.items;t.$owlItems.each(function(u){var f=n(this);f.css({width:t.itemWidth}).data("owl-item",Number(u));(0==u%t.options.items||u===r)&&(u>r||(i+=1));f.data("owl-roundPages",i)})},appendWrapperSizes:function(){this.$owlWrapper.css({width:this.$owlItems.length*this.itemWidth*2,left:0});this.appendItemsSizes()},calculateAll:function(){this.calculateWidth();this.appendWrapperSizes();this.loops();this.max()},calculateWidth:function(){this.itemWidth=Math.round(this.$elem.width()/this.options.items)},max:function(){var n=-1*(this.itemsAmount*this.itemWidth-this.options.items*this.itemWidth);return this.options.items>this.itemsAmount?this.maximumPixels=n=this.maximumItem=0:(this.maximumItem=this.itemsAmount-this.options.items,this.maximumPixels=n),n},min:function(){return 0},loops:function(){var r=0,u=0,t,i;for(this.positionsInArray=[0],this.pagesInArray=[],t=0;t<this.itemsAmount;t+=1)u+=this.itemWidth,this.positionsInArray.push(-u),!0===this.options.scrollPerPage&&(i=n(this.$owlItems[t]),i=i.data("owl-roundPages"),i!==r&&(this.pagesInArray[r]=this.positionsInArray[t],r=i))},buildControls:function(){(!0===this.options.navigation||!0===this.options.pagination)&&(this.owlControls=n('<div class="owl-controls"/>').toggleClass("clickable",!this.browser.isTouch).appendTo(this.$elem));!0===this.options.pagination&&this.buildPagination();!0===this.options.navigation&&this.buildButtons()},buildButtons:function(){var t=this,i=n('<div class="owl-buttons"/>');t.owlControls.append(i);t.buttonPrev=n("<div/>",{"class":"owl-prev",html:t.options.navigationText[0]||""});t.buttonNext=n("<div/>",{"class":"owl-next",html:t.options.navigationText[1]||""});i.append(t.buttonPrev).append(t.buttonNext);i.on("touchstart.owlControls mousedown.owlControls",'div[class^="owl"]',function(n){n.preventDefault()});i.on("touchend.owlControls mouseup.owlControls",'div[class^="owl"]',function(i){i.preventDefault();n(this).hasClass("owl-next")?t.next():t.prev()})},buildPagination:function(){var t=this;t.paginationWrapper=n('<div class="owl-pagination"/>');t.owlControls.append(t.paginationWrapper);t.paginationWrapper.on("touchend.owlControls mouseup.owlControls",".owl-page",function(i){i.preventDefault();Number(n(this).data("owl-page"))!==t.currentItem&&t.goTo(Number(n(this).data("owl-page")),!0)})},updatePagination:function(){var r,u,f,t,i,e;if(!1===this.options.pagination)return!1;for(this.paginationWrapper.html(""),r=0,u=this.itemsAmount-this.itemsAmount%this.options.items,t=0;t<this.itemsAmount;t+=1)0==t%this.options.items&&(r+=1,u===t&&(f=this.itemsAmount-this.options.items),i=n("<div/>",{"class":"owl-page"}),e=n("<span><\/span>",{text:!0===this.options.paginationNumbers?r:"","class":!0===this.options.paginationNumbers?"owl-numbers":""}),i.append(e),i.data("owl-page",u===t?f:t),i.data("owl-roundPages",r),this.paginationWrapper.append(i));this.checkPagination()},checkPagination:function(){var t=this;if(!1===t.options.pagination)return!1;t.paginationWrapper.find(".owl-page").each(function(){n(this).data("owl-roundPages")===n(t.$owlItems[t.currentItem]).data("owl-roundPages")&&(t.paginationWrapper.find(".owl-page").removeClass("active"),n(this).addClass("active"))})},checkNavigation:function(){if(!1===this.options.navigation)return!1;!1===this.options.rewindNav&&(0===this.currentItem&&0===this.maximumItem?(this.buttonPrev.addClass("disabled"),this.buttonNext.addClass("disabled")):0===this.currentItem&&0!==this.maximumItem?(this.buttonPrev.addClass("disabled"),this.buttonNext.removeClass("disabled")):this.currentItem===this.maximumItem?(this.buttonPrev.removeClass("disabled"),this.buttonNext.addClass("disabled")):0!==this.currentItem&&this.currentItem!==this.maximumItem&&(this.buttonPrev.removeClass("disabled"),this.buttonNext.removeClass("disabled")))},updateControls:function(){this.updatePagination();this.checkNavigation();this.owlControls&&(this.options.items>=this.itemsAmount?this.owlControls.hide():this.owlControls.show())},destroyControls:function(){this.owlControls&&this.owlControls.remove()},next:function(n){if(this.isTransition)return!1;if(this.currentItem+=!0===this.options.scrollPerPage?this.options.items:1,this.currentItem>this.maximumItem+(!0===this.options.scrollPerPage?this.options.items-1:0))if(!0===this.options.rewindNav)this.currentItem=0,n="rewind";else return this.currentItem=this.maximumItem,!1;this.goTo(this.currentItem,n)},prev:function(n){if(this.isTransition)return!1;if(this.currentItem=!0===this.options.scrollPerPage&&0<this.currentItem&&this.currentItem<this.options.items?0:this.currentItem-(!0===this.options.scrollPerPage?this.options.items:1),0>this.currentItem)if(!0===this.options.rewindNav)this.currentItem=this.maximumItem,n="rewind";else return this.currentItem=0,!1;this.goTo(this.currentItem,n)},goTo:function(n,i,r){var u=this;if(u.isTransition)return!1;if("function"==typeof u.options.beforeMove&&u.options.beforeMove.apply(this,[u.$elem]),n>=u.maximumItem?n=u.maximumItem:0>=n&&(n=0),u.currentItem=u.owl.currentItem=n,!1!==u.options.transitionStyle&&"drag"!==r&&1===u.options.items&&!0===u.browser.support3d)return u.swapSpeed(0),!0===u.browser.support3d?u.transition3d(u.positionsInArray[n]):u.css2slide(u.positionsInArray[n],1),u.afterGo(),u.singleItemTransition(),!1;n=u.positionsInArray[n];!0===u.browser.support3d?(u.isCss3Finish=!1,!0===i?(u.swapSpeed("paginationSpeed"),t.setTimeout(function(){u.isCss3Finish=!0},u.options.paginationSpeed)):"rewind"===i?(u.swapSpeed(u.options.rewindSpeed),t.setTimeout(function(){u.isCss3Finish=!0},u.options.rewindSpeed)):(u.swapSpeed("slideSpeed"),t.setTimeout(function(){u.isCss3Finish=!0},u.options.slideSpeed)),u.transition3d(n)):!0===i?u.css2slide(n,u.options.paginationSpeed):"rewind"===i?u.css2slide(n,u.options.rewindSpeed):u.css2slide(n,u.options.slideSpeed);u.afterGo()},jumpTo:function(n){"function"==typeof this.options.beforeMove&&this.options.beforeMove.apply(this,[this.$elem]);n>=this.maximumItem||-1===n?n=this.maximumItem:0>=n&&(n=0);this.swapSpeed(0);!0===this.browser.support3d?this.transition3d(this.positionsInArray[n]):this.css2slide(this.positionsInArray[n],1);this.currentItem=this.owl.currentItem=n;this.afterGo()},afterGo:function(){this.prevArr.push(this.currentItem);this.prevItem=this.owl.prevItem=this.prevArr[this.prevArr.length-2];this.prevArr.shift(0);this.prevItem!==this.currentItem&&(this.checkPagination(),this.checkNavigation(),this.eachMoveUpdate(),!1!==this.options.autoPlay&&this.checkAp());"function"==typeof this.options.afterMove&&this.prevItem!==this.currentItem&&this.options.afterMove.apply(this,[this.$elem])},stop:function(){this.apStatus="stop";t.clearInterval(this.autoPlayInterval)},checkAp:function(){"stop"!==this.apStatus&&this.play()},play:function(){var n=this;if(n.apStatus="play",!1===n.options.autoPlay)return!1;t.clearInterval(n.autoPlayInterval);n.autoPlayInterval=t.setInterval(function(){n.next(!0)},n.options.autoPlay)},swapSpeed:function(n){"slideSpeed"===n?this.$owlWrapper.css(this.addCssSpeed(this.options.slideSpeed)):"paginationSpeed"===n?this.$owlWrapper.css(this.addCssSpeed(this.options.paginationSpeed)):"string"!=typeof n&&this.$owlWrapper.css(this.addCssSpeed(n))},addCssSpeed:function(n){return{"-webkit-transition":"all "+n+"ms ease","-moz-transition":"all "+n+"ms ease","-o-transition":"all "+n+"ms ease",transition:"all "+n+"ms ease"}},removeTransition:function(){return{"-webkit-transition":"","-moz-transition":"","-o-transition":"",transition:""}},doTranslate:function(n){return{"-webkit-transform":"translate3d("+n+"px, 0px, 0px)","-moz-transform":"translate3d("+n+"px, 0px, 0px)","-o-transform":"translate3d("+n+"px, 0px, 0px)","-ms-transform":"translate3d("+n+"px, 0px, 0px)",transform:"translate3d("+n+"px, 0px,0px)"}},transition3d:function(n){this.$owlWrapper.css(this.doTranslate(n))},css2move:function(n){this.$owlWrapper.css({left:n})},css2slide:function(n,t){var i=this;i.isCssFinish=!1;i.$owlWrapper.stop(!0,!0).animate({left:n},{duration:t||i.options.slideSpeed,complete:function(){i.isCssFinish=!0}})},checkBrowser:function(){var n=i.createElement("div");n.style.cssText="  -moz-transform:translate3d(0px, 0px, 0px); -ms-transform:translate3d(0px, 0px, 0px); -o-transform:translate3d(0px, 0px, 0px); -webkit-transform:translate3d(0px, 0px, 0px); transform:translate3d(0px, 0px, 0px)";n=n.style.cssText.match(/translate3d\(0px, 0px, 0px\)/g);this.browser={support3d:null!==n&&1===n.length,isTouch:"ontouchstart"in t||t.navigator.msMaxTouchPoints}},moveEvents:function(){(!1!==this.options.mouseDrag||!1!==this.options.touchDrag)&&(this.gestures(),this.disabledEvents())},eventTypes:function(){var n=["s","e","x"];this.ev_types={};!0===this.options.mouseDrag&&!0===this.options.touchDrag?n=["touchstart.owl mousedown.owl","touchmove.owl mousemove.owl","touchend.owl touchcancel.owl mouseup.owl"]:!1===this.options.mouseDrag&&!0===this.options.touchDrag?n=["touchstart.owl","touchmove.owl","touchend.owl touchcancel.owl"]:!0===this.options.mouseDrag&&!1===this.options.touchDrag&&(n=["mousedown.owl","mousemove.owl","mouseup.owl"]);this.ev_types.start=n[0];this.ev_types.move=n[1];this.ev_types.end=n[2]},disabledEvents:function(){this.$elem.on("dragstart.owl",function(n){n.preventDefault()});this.$elem.on("mousedown.disableTextSelect",function(t){return n(t.target).is("input, textarea, select, option")})},gestures:function(){function f(n){if(void 0!==n.touches)return{x:n.touches[0].pageX,y:n.touches[0].pageY};if(void 0===n.touches){if(void 0!==n.pageX)return{x:n.pageX,y:n.pageY};if(void 0===n.pageX)return{x:n.clientX,y:n.clientY}}}function e(t){"on"===t?(n(i).on(r.ev_types.move,o),n(i).on(r.ev_types.end,s)):"off"===t&&(n(i).off(r.ev_types.move),n(i).off(r.ev_types.end))}function o(e){e=e.originalEvent||e||t.event;r.newPosX=f(e).x-u.offsetX;r.newPosY=f(e).y-u.offsetY;r.newRelativeX=r.newPosX-u.relativePos;"function"==typeof r.options.startDragging&&!0!==u.dragging&&0!==r.newRelativeX&&(u.dragging=!0,r.options.startDragging.apply(r,[r.$elem]));(8<r.newRelativeX||-8>r.newRelativeX)&&!0===r.browser.isTouch&&(void 0!==e.preventDefault?e.preventDefault():e.returnValue=!1,u.sliding=!0);(10<r.newPosY||-10>r.newPosY)&&!1===u.sliding&&n(i).off("touchmove.owl");r.newPosX=Math.max(Math.min(r.newPosX,r.newRelativeX/5),r.maximumPixels+r.newRelativeX/5);!0===r.browser.support3d?r.transition3d(r.newPosX):r.css2move(r.newPosX)}function s(i){i=i.originalEvent||i||t.event;var f;i.target=i.target||i.srcElement;u.dragging=!1;!0!==r.browser.isTouch&&r.$owlWrapper.removeClass("grabbing");r.dragDirection=r.owl.dragDirection=0>r.newRelativeX?"left":"right";0!==r.newRelativeX&&(f=r.getNewPosition(),r.goTo(f,!1,"drag"),u.targetElement===i.target&&!0!==r.browser.isTouch&&(n(i.target).on("click.disable",function(t){t.stopImmediatePropagation();t.stopPropagation();t.preventDefault();n(t.target).off("click.disable")}),i=n._data(i.target,"events").click,f=i.pop(),i.splice(0,0,f)));e("off")}var r=this,u={offsetX:0,offsetY:0,baseElWidth:0,relativePos:0,position:null,minSwipe:null,maxSwipe:null,sliding:null,dargging:null,targetElement:null};r.isCssFinish=!0;r.$elem.on(r.ev_types.start,".owl-wrapper",function(i){i=i.originalEvent||i||t.event;var o;if(3===i.which)return!1;if(!(r.itemsAmount<=r.options.items)){if(!1===r.isCssFinish&&!r.options.dragBeforeAnimFinish||!1===r.isCss3Finish&&!r.options.dragBeforeAnimFinish)return!1;!1!==r.options.autoPlay&&t.clearInterval(r.autoPlayInterval);!0===r.browser.isTouch||r.$owlWrapper.hasClass("grabbing")||r.$owlWrapper.addClass("grabbing");r.newPosX=0;r.newRelativeX=0;n(this).css(r.removeTransition());o=n(this).position();u.relativePos=o.left;u.offsetX=f(i).x-o.left;u.offsetY=f(i).y-o.top;e("on");u.sliding=!1;u.targetElement=i.target||i.srcElement}})},getNewPosition:function(){var n=this.closestItem();return n>this.maximumItem?n=this.currentItem=this.maximumItem:0<=this.newPosX&&(this.currentItem=n=0),n},closestItem:function(){var t=this,i=!0===t.options.scrollPerPage?t.pagesInArray:t.positionsInArray,u=t.newPosX,r=null;return n.each(i,function(f,e){u-t.itemWidth/20>i[f+1]&&u-t.itemWidth/20<e&&"left"===t.moveDirection()?(r=e,t.currentItem=!0===t.options.scrollPerPage?n.inArray(r,t.positionsInArray):f):u+t.itemWidth/20<e&&u+t.itemWidth/20>(i[f+1]||i[f]-t.itemWidth)&&"right"===t.moveDirection()&&(!0===t.options.scrollPerPage?(r=i[f+1]||i[i.length-1],t.currentItem=n.inArray(r,t.positionsInArray)):(r=i[f+1],t.currentItem=f+1))}),t.currentItem},moveDirection:function(){var n;return 0>this.newRelativeX?(n="right",this.playDirection="next"):(n="left",this.playDirection="prev"),n},customEvents:function(){var n=this;n.$elem.on("owl.next",function(){n.next()});n.$elem.on("owl.prev",function(){n.prev()});n.$elem.on("owl.play",function(t,i){n.options.autoPlay=i;n.play();n.hoverStatus="play"});n.$elem.on("owl.stop",function(){n.stop();n.hoverStatus="stop"});n.$elem.on("owl.goTo",function(t,i){n.goTo(i)});n.$elem.on("owl.jumpTo",function(t,i){n.jumpTo(i)})},stopOnHover:function(){var n=this;!0===n.options.stopOnHover&&!0!==n.browser.isTouch&&!1!==n.options.autoPlay&&(n.$elem.on("mouseover",function(){n.stop()}),n.$elem.on("mouseout",function(){"stop"!==n.hoverStatus&&n.play()}))},lazyLoad:function(){var r,t,u,i,f;if(!1===this.options.lazyLoad)return!1;for(r=0;r<this.itemsAmount;r+=1)t=n(this.$owlItems[r]),"loaded"!==t.data("owl-loaded")&&(u=t.data("owl-item"),i=t.find(".lazyOwl"),"string"!=typeof i.data("src")?t.data("owl-loaded","loaded"):(void 0===t.data("owl-loaded")&&(i.hide(),t.addClass("loading").data("owl-loaded","checked")),(f=!0===this.options.lazyFollow?u>=this.currentItem:!0)&&u<this.currentItem+this.options.items&&i.length&&this.lazyPreload(t,i)))},lazyPreload:function(n,i){function u(){n.data("owl-loaded","loaded").removeClass("loading");i.removeAttr("data-src");"fade"===r.options.lazyEffect?i.fadeIn(400):i.show();"function"==typeof r.options.afterLazyLoad&&r.options.afterLazyLoad.apply(this,[r.$elem])}function f(){e+=1;r.completeImg(i.get(0))||!0===o?u():100>=e?t.setTimeout(f,100):u()}var r=this,e=0,o;"DIV"===i.prop("tagName")?(i.css("background-image","url("+i.data("src")+")"),o=!0):i[0].src=i.data("src");f()},autoHeight:function(){function u(){var r=n(i.$owlItems[i.currentItem]).height();i.wrapperOuter.css("height",r+"px");i.wrapperOuter.hasClass("autoHeight")||t.setTimeout(function(){i.wrapperOuter.addClass("autoHeight")},0)}function f(){r+=1;i.completeImg(e.get(0))?u():100>=r?t.setTimeout(f,100):i.wrapperOuter.css("height","")}var i=this,e=n(i.$owlItems[i.currentItem]).find("img"),r;void 0!==e.get(0)?(r=0,f()):u()},completeImg:function(n){return!n.complete||"undefined"!=typeof n.naturalWidth&&0===n.naturalWidth?!1:!0},onVisibleItems:function(){var t;for(!0===this.options.addClassActive&&this.$owlItems.removeClass("active"),this.visibleItems=[],t=this.currentItem;t<this.currentItem+this.options.items;t+=1)this.visibleItems.push(t),!0===this.options.addClassActive&&n(this.$owlItems[t]).addClass("active");this.owl.visibleItems=this.visibleItems},transitionTypes:function(n){this.outClass="owl-"+n+"-out";this.inClass="owl-"+n+"-in"},singleItemTransition:function(){var n=this,u=n.outClass,f=n.inClass,t=n.$owlItems.eq(n.currentItem),i=n.$owlItems.eq(n.prevItem),e=Math.abs(n.positionsInArray[n.currentItem])+n.positionsInArray[n.prevItem],r=Math.abs(n.positionsInArray[n.currentItem])+n.itemWidth/2;n.isTransition=!0;n.$owlWrapper.addClass("owl-origin").css({"-webkit-transform-origin":r+"px","-moz-perspective-origin":r+"px","perspective-origin":r+"px"});i.css({position:"relative",left:e+"px"}).addClass(u).on("webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend",function(){n.endPrev=!0;i.off("webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend");n.clearTransStyle(i,u)});t.addClass(f).on("webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend",function(){n.endCurrent=!0;t.off("webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend");n.clearTransStyle(t,f)})},clearTransStyle:function(n,t){n.css({position:"",left:""}).removeClass(t);this.endPrev&&this.endCurrent&&(this.$owlWrapper.removeClass("owl-origin"),this.isTransition=this.endCurrent=this.endPrev=!1)},owlStatus:function(){this.owl={userOptions:this.userOptions,baseElement:this.$elem,userItems:this.$userItems,owlItems:this.$owlItems,currentItem:this.currentItem,prevItem:this.prevItem,visibleItems:this.visibleItems,isTouch:this.browser.isTouch,browser:this.browser,dragDirection:this.dragDirection}},clearEvents:function(){this.$elem.off(".owl owl mousedown.disableTextSelect");n(i).off(".owl owl");n(t).off("resize",this.resizer)},unWrap:function(){0!==this.$elem.children().length&&(this.$owlWrapper.unwrap(),this.$userItems.unwrap().unwrap(),this.owlControls&&this.owlControls.remove());this.clearEvents();this.$elem.attr("style",this.$elem.data("owl-originalStyles")||"").attr("class",this.$elem.data("owl-originalClasses"))},destroy:function(){this.stop();t.clearInterval(this.checkVisible);this.unWrap();this.$elem.removeData()},reinit:function(t){t=n.extend({},this.userOptions,t);this.unWrap();this.init(t,this.$elem)},addItem:function(n,t){var i;if(!n)return!1;if(0===this.$elem.children().length)return this.$elem.append(n),this.setVars(),!1;this.unWrap();i=void 0===t||-1===t?-1:t;i>=this.$userItems.length||-1===i?this.$userItems.eq(-1).after(n):this.$userItems.eq(i).before(n);this.setVars()},removeItem:function(n){if(0===this.$elem.children().length)return!1;n=void 0===n||-1===n?-1:n;this.unWrap();this.$userItems.eq(n).remove();this.setVars()}};n.fn.owlCarousel=function(t){return this.each(function(){if(!0===n(this).data("owl-init"))return!1;n(this).data("owl-init",!0);var i=Object.create(r);i.init(t,this);n.data(this,"owlCarousel",i)})};n.fn.owlCarousel.options={items:5,itemsCustom:!1,itemsDesktop:[1199,4],itemsDesktopSmall:[979,3],itemsTablet:[768,2],itemsTabletSmall:!1,itemsMobile:[479,1],singleItem:!1,itemsScaleUp:!1,slideSpeed:200,paginationSpeed:800,rewindSpeed:1e3,autoPlay:!1,stopOnHover:!1,navigation:!1,navigationText:["prev","next"],rewindNav:!0,scrollPerPage:!1,pagination:!0,paginationNumbers:!1,responsive:!0,responsiveRefreshRate:200,responsiveBaseWidth:t,baseClass:"owl-carousel",theme:"owl-theme",lazyLoad:!1,lazyFollow:!0,lazyEffect:"fade",autoHeight:!1,jsonPath:!1,jsonSuccess:!1,dragBeforeAnimFinish:!0,mouseDrag:!0,touchDrag:!0,addClassActive:!1,transitionStyle:!1,beforeUpdate:!1,afterUpdate:!1,beforeInit:!1,afterInit:!1,beforeMove:!1,afterMove:!1,afterAction:!1,startDragging:!1,afterLazyLoad:!1}}(jQuery,window,document),function(n){function ut(n,t,i){return"transition"==i.transition&&"swing"==t&&(t="ease"),{anims:[],duration:n,orgDuration:n,easing:t,startTime:p()}}function k(n,t){for(var i,r=0,u=n.anims.length;u>r;r++)i=n.anims[r],i&&i[0][t.transition](i[1],n.duration,n.easing,i[2])}function ft(n,t){var r,e,i;for(f(t)||(t=!0),s(n.pre)&&ft(n.pre,t),r=0,e=n.anims.length;e>r;r++)i=n.anims[r],i[0].stop(!0),t&&(i[0].css(i[1]),u(i[2])&&i[2]());s(n.post)&&ft(n.post,t)}function ui(n,t,i){switch(t&&t.remove(),i.fx){case"fade":case"crossfade":case"cover-fade":case"uncover-fade":n.css("opacity",1);n.css("filter","")}}function et(n,t,i,r,u){if(t[i]&&t[i].call(n,r),u[i].length)for(var f=0,e=u[i].length;e>f;f++)u[i][f].call(n,r);return[]}function fi(n,i,r){return i.length&&(n.trigger(t(i[0][0],r),i[0][1]),i.shift()),i}function ei(t){t.each(function(){var t=n(this);t.data("_cfs_isHidden",t.is(":hidden")).hide()})}function oi(t){t&&t.each(function(){var t=n(this);t.data("_cfs_isHidden")||t.show()})}function d(n){return n.auto&&clearTimeout(n.auto),n.progress&&clearInterval(n.progress),n}function si(n,t,i,r,u,f,e){return{width:e.width,height:e.height,items:{old:n,skipped:t,visible:i},scroll:{items:r,direction:u,duration:f}}}function hi(n,t,i,r){var u=n.duration;return"none"==n.fx?0:("auto"==u?u=t.scroll.duration/t.scroll.items*i:10>u&&(u=r/u),1>u?0:("fade"==n.fx&&(u/=2),Math.round(u)))}function vt(n,t,u){var s=i(n.items.minimum)?n.items.minimum:n.items.visible+1,f,e,o;"show"==t||"hide"==t?f=t:s>t?(r(u,"Not enough items ("+t+" total, "+s+" needed): Hiding navigation."),f="hide"):f="show";e="show"==f?"removeClass":"addClass";o=l("hidden",u);n.auto.button&&n.auto.button[f]()[e](o);n.prev.button&&n.prev.button[f]()[e](o);n.next.button&&n.next.button[f]()[e](o);n.pagination.container&&n.pagination.container[f]()[e](o)}function g(n,t,i){var r,f,u;n.circular||n.infinite||(r="removeClass"==t||"addClass"==t?t:!1,f=l("disabled",i),(n.auto.button&&r&&n.auto.button[r](f),n.prev.button)&&(u=r||0==t?"addClass":"removeClass",n.prev.button[u](f)),n.next.button&&(u=r||t==n.items.visible?"addClass":"removeClass",n.next.button[u](f)))}function ot(n,t){return u(t)?t=t.call(n):o(t)&&(t={}),t}function or(n,t){return t=ot(n,t),i(t)?t={visible:t}:"variable"==t?t={visible:t,width:t,height:t}:s(t)||(t={}),t}function sr(n,t){return t=ot(n,t),i(t)?t=50>=t?{items:t}:{duration:t}:e(t)?t={easing:t}:s(t)||(t={}),t}function yt(t,i){if(i=ot(t,i),e(i)){var r=ir(i);i=-1==r?n(i):r}return i}function hr(n,t){return t=yt(n,t),c(t)?t={button:t}:f(t)?t={play:t}:i(t)&&(t={timeoutDuration:t}),t.progress&&(e(t.progress)||c(t.progress))&&(t.progress={bar:t.progress}),t}function cr(t,r){return u(r.button)&&(r.button=r.button.call(t)),e(r.button)&&(r.button=n(r.button)),f(r.play)||(r.play=!0),i(r.delay)||(r.delay=0),o(r.pauseOnEvent)&&(r.pauseOnEvent=!0),f(r.pauseOnResize)||(r.pauseOnResize=!0),i(r.timeoutDuration)||(r.timeoutDuration=10>r.duration?2500:5*r.duration),r.progress&&(u(r.progress.bar)&&(r.progress.bar=r.progress.bar.call(t)),e(r.progress.bar)&&(r.progress.bar=n(r.progress.bar)),r.progress.bar?(u(r.progress.updater)||(r.progress.updater=n.fn.carouFredSel.progressbarUpdater),i(r.progress.interval)||(r.progress.interval=50)):r.progress=!1),r}function ci(n,t){return t=yt(n,t),c(t)?t={button:t}:i(t)&&(t={key:t}),t}function li(t,i){return u(i.button)&&(i.button=i.button.call(t)),e(i.button)&&(i.button=n(i.button)),e(i.key)&&(i.key=ir(i.key)),i}function lr(n,t){return t=yt(n,t),c(t)?t={container:t}:f(t)&&(t={keys:t}),t}function ar(t,r){return u(r.container)&&(r.container=r.container.call(t)),e(r.container)&&(r.container=n(r.container)),i(r.items)||(r.items=!1),f(r.keys)||(r.keys=!1),u(r.anchorBuilder)||ri(r.anchorBuilder)||(r.anchorBuilder=n.fn.carouFredSel.pageAnchorBuilder),i(r.deviation)||(r.deviation=0),r}function vr(n,t){return u(t)&&(t=t.call(n)),o(t)&&(t={onTouch:!1}),rt(t)?t={onTouch:t}:i(t)&&(t={items:t}),t}function yr(n,t){return f(t.onTouch)||(t.onTouch=!0),f(t.onMouse)||(t.onMouse=!1),s(t.options)||(t.options={}),f(t.options.triggerOnTouchEnd)||(t.options.triggerOnTouchEnd=!1),t}function pr(n,t){return u(t)&&(t=t.call(n)),rt(t)?t={}:i(t)?t={items:t}:o(t)&&(t=!1),t}function wr(n,t){return t}function nt(t,r,u,o,h){if(e(t)&&(t=n(t,h)),s(t)&&(t=n(t,h)),c(t)?(t=h.children().index(t),f(u)||(u=!1)):f(u)||(u=!0),i(t)||(t=0),i(r)||(r=0),u&&(t+=o.first),t+=r,o.total>0){for(;t>=o.total;)t-=o.total;for(;0>t;)t+=o.total}return t}function pt(n,t,i){for(var u,f=0,e=0,r=i;r>=0;r--){if(u=n.eq(r),f+=u.is(":visible")?u[t.d.outerWidth](!0):0,f>t.maxDimension)return e;0==r&&(r=n.length);e++}}function br(n,t,i){return ai(n,t.items.filter,t.items.visibleConf.org,i)}function kr(n,t,i,r){return ai(n,t.items.filter,r,i)}function ai(n,t,i,r){for(var s,e=0,f=0,u=r,o=n.length;u>=0;u--){if((f++,f==o)||(s=n.eq(u),s.is(t)&&(e++,e==i)))return f;0==u&&(u=o)}}function vi(n,t){return t.items.visibleConf.org||n.children().slice(0,t.items.visible).filter(t.items.filter).length}function w(n,t,i){for(var e,o=0,u=0,r=i,f=n.length-1;f>=r;r++){if((e=n.eq(r),o+=e.is(":visible")?e[t.d.outerWidth](!0):0,o>t.maxDimension)||(u++,u==f+1))return u;r==f&&(r=-1)}}function yi(n,t,i,r){var u=w(n,t,i);return t.circular||i+u>r&&(u=r-i),u}function st(n,t,i){return pi(n,t.items.filter,t.items.visibleConf.org,i,t.circular)}function dr(n,t,i,r){return pi(n,t.items.filter,r+1,i,t.circular)-1}function pi(n,t,i,r){for(var s,o=0,f=0,u=r,e=n.length-1;e>=u;u++){if((f++,f>=e)||(s=n.eq(u),s.is(t)&&(o++,o==i)))return f;u==e&&(u=-1)}}function tt(n,t){return n.slice(0,t.items.visible)}function gr(n,t,i){return n.slice(i,t.items.visibleConf.old+i)}function nu(n,t){return n.slice(0,t.items.visible)}function tu(n,t){return n.slice(0,t.items.visibleConf.old)}function iu(n,t,i){return n.slice(i,t.items.visible+i)}function wt(t,r,u){r.usePadding&&(e(u)||(u="_cfs_origCssMargin"),t.each(function(){var f=n(this),t=parseInt(f.css(r.d.marginRight),10);i(t)||(t=0);f.data(u,t)}))}function h(t,r,u){if(r.usePadding){var e=f(u)?u:!1;i(u)||(u=0);wt(t,r,"_cfs_tempCssMargin");t.each(function(){var t=n(this);t.css(r.d.marginRight,e?t.data("_cfs_tempCssMargin"):u+t.data("_cfs_origCssMargin"))})}}function ht(t){t.each(function(){var t=n(this);t.data("_cfs_origCss",t.attr("style")||"")})}function bt(t){t.each(function(){var t=n(this);t.attr("style",t.data("_cfs_origCss")||"")})}function wi(t,i){var u=(t.items.visible,t.items[t.d.width]),r=t[t.d.height],f=lt(r);i.each(function(){var i=n(this),e=u-ru(i,t,"Width");i[t.d.width](e);f&&i[t.d.height](gt(e,r))})}function kt(n,t){var s=n.parent(),u=n.children(),o=tt(u,t),f=ni(dt(o,t,!0),t,!1),i,r,e;return(s.css(f),t.usePadding)&&(i=t.padding,r=i[t.d[1]],t.align&&0>r&&(r=0),e=o.last(),e.css(t.d.marginRight,e.data("_cfs_origCssMargin")+r),n.css(t.d.top,i[t.d[0]]),n.css(t.d.left,i[t.d[3]])),n.css(t.d.width,f[t.d.width]+2*v(u,t,"width")),n.css(t.d.height,bi(u,t,"height")),f}function dt(n,t,i){return[v(n,t,"width",i),bi(n,t,"height",i)]}function bi(n,t,r,u){return f(u)||(u=!1),i(t[t.d[r]])&&u?t[t.d[r]]:i(t.items[t.d[r]])?t.items[t.d[r]]:(r=r.toLowerCase().indexOf("width")>-1?"outerWidth":"outerHeight",ct(n,t,r))}function ct(n,t,i){for(var f,e,r=0,u=0,o=n.length;o>u;u++)f=n.eq(u),e=f.is(":visible")?f[t.d[i]](!0):0,e>r&&(r=e);return r}function v(n,t,r,u){var o;if(f(u)||(u=!1),i(t[t.d[r]])&&u)return t[t.d[r]];if(i(t.items[t.d[r]]))return t.items[t.d[r]]*n.length;for(var h=r.toLowerCase().indexOf("width")>-1?"outerWidth":"outerHeight",s=0,e=0,c=n.length;c>e;e++)o=n.eq(e),s+=o.is(":visible")?o[t.d[h]](!0):0;return s}function ki(n,t,i){var r=n.is(":visible"),u;return r&&n.hide(),u=n.parent()[t.d[i]](),r&&n.show(),u}function di(n,t){return i(n[n.d.width])?n[n.d.width]:t}function gi(n,t,i){for(var e,o,r=!1,u=!1,f=0,s=n.length;s>f;f++)e=n.eq(f),o=e.is(":visible")?e[t.d[i]](!0):0,r===!1?r=o:r!=o&&(u=!0),0==r&&(u=!0);return u}function ru(n,t,i){return n[t.d["outer"+i]](!0)-n[t.d[i.toLowerCase()]]()}function gt(n,t){if(lt(t)){if(t=parseInt(t.slice(0,-1),10),!i(t))return n;n*=t/100}return n}function t(n,t,i,r,u){return f(i)||(i=!0),f(r)||(r=!0),f(u)||(u=!1),i&&(n=t.events.prefix+n),r&&(n=n+"."+t.events.namespace),r&&u&&(n+=t.serialNumber),n}function l(n,t){return e(t.classnames[n])?t.classnames[n]:n}function ni(n,t,i){f(i)||(i=!0);var r=t.usePadding&&i?t.padding:[0,0,0,0],u={};return u[t.d.width]=n[0]+r[1]+r[3],u[t.d.height]=n[1]+r[0]+r[2],u}function b(n,t){for(var i,f,u=[],r=0,e=n.length;e>r;r++)for(i=0,f=t.length;f>i;i++)if(t[i].indexOf(typeof n[r])>-1&&o(u[i])){u[i]=n[r];break}return u}function uu(n){if(o(n))return[0,0,0,0];if(i(n))return[n,n,n,n];if(e(n)&&(n=n.split("px").join("").split("em").join("").split(" ")),!y(n))return[0,0,0,0];for(var t=0;4>t;t++)n[t]=parseInt(n[t],10);switch(n.length){case 0:return[0,0,0,0];case 1:return[n[0],n[0],n[0],n[0]];case 2:return[n[0],n[1],n[0],n[1]];case 3:return[n[0],n[1],n[2],n[1]];default:return[n[0],n[1],n[2],n[3]]}}function ti(n,t){var r=i(t[t.d.width])?Math.ceil(t[t.d.width]-v(n,t,"width")):0;switch(t.align){case"left":return[0,r];case"right":return[r,0];case"center":default:return[Math.ceil(r/2),Math.floor(r/2)]}}function fu(n){for(var i=[["width","innerWidth","outerWidth","height","innerHeight","outerHeight","left","top","marginRight",0,1,2,3],["height","innerHeight","outerHeight","width","innerWidth","outerWidth","top","left","marginBottom",3,2,1,0]],u=i[0].length,f="right"==n.direction||"left"==n.direction?0:1,r={},t=0;u>t;t++)r[i[0][t]]=i[f][t];return r}function ii(n,t,r,f){var o=n,h,c;if(u(r))o=r.call(f,o);else if(e(r)){if(h=r.split("+"),c=r.split("-"),c.length>h.length)var l=!0,a=c[0],s=c[1];else var l=!1,a=h[0],s=h[1];switch(a){case"even":o=1==n%2?n-1:n;break;case"odd":o=0==n%2?n-1:n;break;default:o=n}s=parseInt(s,10);i(s)&&(l&&(s=-s),o+=s)}return(!i(o)||1>o)&&(o=1),o}function a(n,t,i,r){return nr(ii(n,t,i,r),t.items.visibleConf)}function nr(n,t){return i(t.min)&&t.min>n&&(n=t.min),i(t.max)&&n>t.max&&(n=t.max),1>n&&(n=1),n}function tr(t){y(t)||(t=[[t]]);y(t[0])||(t=[t]);for(var r=0,u=t.length;u>r;r++)e(t[r][0])&&(t[r][0]=n(t[r][0])),f(t[r][1])||(t[r][1]=!0),f(t[r][2])||(t[r][2]=!0),i(t[r][3])||(t[r][3]=0);return t}function ir(n){return"right"==n?39:"left"==n?37:"up"==n?38:"down"==n?40:-1}function rr(i,r,u){if(i){var f=r.triggerHandler(t("currentPosition",u));n.fn.carouFredSel.cookie.set(i,f)}}function eu(t){var i=n.fn.carouFredSel.cookie.get(t);return""==i?0:i}function ou(n,t){for(var r={},i=0,u=t.length;u>i;i++)r[t[i]]=n.css(t[i]);return r}function su(n,t,f,o){return s(n.visibleConf)||(n.visibleConf={}),s(n.sizesConf)||(n.sizesConf={}),0==n.start&&i(o)&&(n.start=o),s(n.visible)?(n.visibleConf.min=n.visible.min,n.visibleConf.max=n.visible.max,n.visible=!1):e(n.visible)?("variable"==n.visible?n.visibleConf.variable=!0:n.visibleConf.adjust=n.visible,n.visible=!1):u(n.visible)&&(n.visibleConf.adjust=n.visible,n.visible=!1),e(n.filter)||(n.filter=f.filter(":hidden").length>0?":visible":"*"),n[t.d.width]||(t.responsive?(r(!0,"Set a "+t.d.width+" for the items!"),n[t.d.width]=ct(f,t,"outerWidth")):n[t.d.width]=gi(f,t,"outerWidth")?"variable":f[t.d.outerWidth](!0)),n[t.d.height]||(n[t.d.height]=gi(f,t,"outerHeight")?"variable":f[t.d.outerHeight](!0)),n.sizesConf.width=n.width,n.sizesConf.height=n.height,n}function hu(n,t){return"variable"==n.items[n.d.width]&&(n.items.visibleConf.variable=!0),n.items.visibleConf.variable||(i(n[n.d.width])?n.items.visible=Math.floor(n[n.d.width]/n.items[n.d.width]):(n.items.visible=Math.floor(t/n.items[n.d.width]),n[n.d.width]=n.items.visible*n.items[n.d.width],n.items.visibleConf.adjust||(n.align=!1)),("Infinity"==n.items.visible||1>n.items.visible)&&(r(!0,'Not a valid number of visible items: Set to "variable".'),n.items.visibleConf.variable=!0)),n}function cu(n,t,i){return"auto"==n&&(n=ct(i,t,"outerWidth")),n}function lu(n,t,i){return"auto"==n&&(n=ct(i,t,"outerHeight")),n||(n=t.items[t.d.height]),n}function ur(n,t){var i=ti(tt(t,n),n);return n.padding[n.d[1]]=i[1],n.padding[n.d[3]]=i[0],n}function fr(n,t){var i=nr(Math.ceil(n[n.d.width]/n.items[n.d.width]),n.items.visibleConf),r;return i>t.length&&(i=t.length),r=Math.floor(n[n.d.width]/i),n.items.visible=i,n.items[n.d.width]=r,n[n.d.width]=i*r,n}function it(n){var i,t;return e(n)?(t=n.indexOf("immediate")>-1?!0:!1,i=n.indexOf("resume")>-1?!0:!1):t=i=!1,[t,i]}function er(n){return null===n}function o(n){return er(n)||n===void 0||""===n||"undefined"===n}function y(n){return n instanceof Array}function c(n){return n instanceof jQuery}function s(n){return(n instanceof Object||"object"==typeof n)&&!er(n)&&!c(n)&&!y(n)&&!u(n)}function i(n){return(n instanceof Number||"number"==typeof n)&&!isNaN(n)}function e(n){return(n instanceof String||"string"==typeof n)&&!o(n)&&!rt(n)&&!ri(n)}function u(n){return n instanceof Function||"function"==typeof n}function f(n){return n instanceof Boolean||"boolean"==typeof n||rt(n)||ri(n)}function rt(n){return n===!0||"true"===n}function ri(n){return n===!1||"false"===n}function lt(n){return e(n)&&"%"==n.slice(-1)}function p(){return(new Date).getTime()}function at(n,t){r(!0,n+" is DEPRECATED, support for it will be removed. Use "+t+" instead.")}function r(n,t){var i;if(!o(window.console)&&!o(window.console.log)){if(s(n)?(i=" ("+n.selector+")",n=n.debug):i="",!n)return!1;t=e(t)?"carouFredSel"+i+": "+t:["carouFredSel"+i+":",t];window.console.log(t)}return!1}n.fn.carouFredSel||(n.fn.caroufredsel=n.fn.carouFredSel=function(ct,yt){var au,pu,ku,nf,wu,du,tf;if(0==this.length)return r(!0,'No element found for "'+this.selector+'".'),this;if(this.length>1)return this.each(function(){n(this).carouFredSel(ct,yt)});var ai=this,nr=this[0],gu=!1;ai.data("_cfs_isCarousel")&&(gu=ai.triggerHandler("_cfs_triggerEvent","currentPosition"),ai.trigger("_cfs_triggerEvent",["destroy",!0]));au={};au._init=function(t,r,u){t=ot(nr,t);t.items=or(nr,t.items);t.scroll=sr(nr,t.scroll);t.auto=hr(nr,t.auto);t.prev=ci(nr,t.prev);t.next=ci(nr,t.next);t.pagination=lr(nr,t.pagination);t.swipe=vr(nr,t.swipe);t.mousewheel=pr(nr,t.mousewheel);r&&(bu=n.extend(!0,{},n.fn.carouFredSel.defaults,t));ri=n.extend(!0,{},n.fn.carouFredSel.defaults,t);ri.d=fu(ri);ir.direction="up"==ri.direction||"left"==ri.direction?"next":"prev";var f=ai.children(),e=ki(er,ri,"width");if(rt(ri.cookie)&&(ri.cookie="caroufredsel_cookie_"+pi.serialNumber),ri.maxDimension=di(ri,e),ri.items=su(ri.items,ri,f,u),ri[ri.d.width]=cu(ri[ri.d.width],ri,f),ri[ri.d.height]=lu(ri[ri.d.height],ri,f),ri.responsive&&(lt(ri[ri.d.width])||(ri[ri.d.width]="100%")),lt(ri[ri.d.width])&&(ir.upDateOnWindowResize=!0,ir.primarySizePercentage=ri[ri.d.width],ri[ri.d.width]=gt(e,ir.primarySizePercentage),ri.items.visible||(ri.items.visibleConf.variable=!0)),ri.responsive?(ri.usePadding=!1,ri.padding=[0,0,0,0],ri.align=!1,ri.items.visibleConf.variable=!1):(ri.items.visible||(ri=hu(ri,e)),ri[ri.d.width]||(!ri.items.visibleConf.variable&&i(ri.items[ri.d.width])&&"*"==ri.items.filter?(ri[ri.d.width]=ri.items.visible*ri.items[ri.d.width],ri.align=!1):ri[ri.d.width]="variable"),o(ri.align)&&(ri.align=i(ri[ri.d.width])?"center":!1),ri.items.visibleConf.variable&&(ri.items.visible=w(f,ri,0))),"*"==ri.items.filter||ri.items.visibleConf.variable||(ri.items.visibleConf.org=ri.items.visible,ri.items.visible=st(f,ri,0)),ri.items.visible=a(ri.items.visible,ri,ri.items.visibleConf.adjust,nr),ri.items.visibleConf.old=ri.items.visible,ri.responsive)ri.items.visibleConf.min||(ri.items.visibleConf.min=ri.items.visible),ri.items.visibleConf.max||(ri.items.visibleConf.max=ri.items.visible),ri=fr(ri,f,e);else switch(ri.padding=uu(ri.padding),"top"==ri.align?ri.align="left":"bottom"==ri.align&&(ri.align="right"),ri.align){case"center":case"left":case"right":"variable"!=ri[ri.d.width]&&(ri=ur(ri,f),ri.usePadding=!0);break;default:ri.align=!1;ri.usePadding=0==ri.padding[0]&&0==ri.padding[1]&&0==ri.padding[2]&&0==ri.padding[3]?!1:!0}i(ri.scroll.duration)||(ri.scroll.duration=500);o(ri.scroll.items)&&(ri.scroll.items=ri.responsive||ri.items.visibleConf.variable||"*"!=ri.items.filter?"visible":ri.items.visible);ri.auto=n.extend(!0,{},ri.scroll,ri.auto);ri.prev=n.extend(!0,{},ri.scroll,ri.prev);ri.next=n.extend(!0,{},ri.scroll,ri.next);ri.pagination=n.extend(!0,{},ri.scroll,ri.pagination);ri.auto=cr(nr,ri.auto);ri.prev=li(nr,ri.prev);ri.next=li(nr,ri.next);ri.pagination=ar(nr,ri.pagination);ri.swipe=yr(nr,ri.swipe);ri.mousewheel=wr(nr,ri.mousewheel);ri.synchronise&&(ri.synchronise=tr(ri.synchronise));ri.auto.onPauseStart&&(ri.auto.onTimeoutStart=ri.auto.onPauseStart,at("auto.onPauseStart","auto.onTimeoutStart"));ri.auto.onPausePause&&(ri.auto.onTimeoutPause=ri.auto.onPausePause,at("auto.onPausePause","auto.onTimeoutPause"));ri.auto.onPauseEnd&&(ri.auto.onTimeoutEnd=ri.auto.onPauseEnd,at("auto.onPauseEnd","auto.onTimeoutEnd"));ri.auto.pauseDuration&&(ri.auto.timeoutDuration=ri.auto.pauseDuration,at("auto.pauseDuration","auto.timeoutDuration"))};au._build=function(){ai.data("_cfs_isCarousel",!0);var t=ai.children(),n=ou(ai,["textAlign","float","position","top","right","bottom","left","zIndex","width","height","marginTop","marginRight","marginBottom","marginLeft"]),i="relative";switch(n.position){case"absolute":case"fixed":i=n.position}"parent"==pi.wrapper?ht(er):er.css(n);er.css({overflow:"hidden",position:i});ht(ai);ai.data("_cfs_origCssZindex",n.zIndex);ai.css({textAlign:"left",float:"none",position:"absolute",top:0,right:"auto",bottom:"auto",left:0,marginTop:0,marginRight:0,marginBottom:0,marginLeft:0});wt(t,ri);ht(t);ri.responsive&&wi(ri,t)};au._bind_events=function(){au._unbind_events();ai.bind(t("stop",pi),function(n,i){return n.stopPropagation(),ir.isStopped||ri.auto.button&&ri.auto.button.addClass(l("stopped",pi)),ir.isStopped=!0,ri.auto.play&&(ri.auto.play=!1,ai.trigger(t("pause",pi),i)),!0});ai.bind(t("finish",pi),function(n){return n.stopPropagation(),ir.isScrolling&&ft(gi),!0});ai.bind(t("pause",pi),function(n,t,i){var r,u,f;return(n.stopPropagation(),ru=d(ru),t&&ir.isScrolling)&&(gi.isStopped=!0,r=p()-gi.startTime,gi.duration-=r,gi.pre&&(gi.pre.duration-=r),gi.post&&(gi.post.duration-=r),ft(gi,!1)),(ir.isPaused||ir.isScrolling||i&&(ru.timePassed+=p()-ru.startTime),ir.isPaused||ri.auto.button&&ri.auto.button.addClass(l("paused",pi)),ir.isPaused=!0,ri.auto.onTimeoutPause)&&(u=ri.auto.timeoutDuration-ru.timePassed,f=100-Math.ceil(100*u/ri.auto.timeoutDuration),ri.auto.onTimeoutPause.call(nr,f,u)),!0});ai.bind(t("play",pi),function(n,u,e,o){var s;n.stopPropagation();ru=d(ru);var c=[u,e,o],h=b(c,["string","number","boolean"]);return(u=h[0],e=h[1],o=h[2],"prev"!=u&&"next"!=u&&(u=ir.direction),i(e)||(e=0),f(o)||(o=!1),o&&(ir.isStopped=!1,ri.auto.play=!0),!ri.auto.play)?(n.stopImmediatePropagation(),r(pi,"Carousel stopped: Not scrolling.")):(ir.isPaused&&ri.auto.button&&(ri.auto.button.removeClass(l("stopped",pi)),ri.auto.button.removeClass(l("paused",pi))),ir.isPaused=!1,ru.startTime=p(),s=ri.auto.timeoutDuration+e,dur2=s-ru.timePassed,perc=100-Math.ceil(100*dur2/s),ri.auto.progress&&(ru.progress=setInterval(function(){var n=p()-ru.startTime+ru.timePassed,t=Math.ceil(100*n/s);ri.auto.progress.updater.call(ri.auto.progress.bar[0],t)},ri.auto.progress.interval)),ru.auto=setTimeout(function(){ri.auto.progress&&ri.auto.progress.updater.call(ri.auto.progress.bar[0],100);ri.auto.onTimeoutEnd&&ri.auto.onTimeoutEnd.call(nr,perc,dur2);ir.isScrolling?ai.trigger(t("play",pi),u):ai.trigger(t(u,pi),ri.auto)},dur2),ri.auto.onTimeoutStart&&ri.auto.onTimeoutStart.call(nr,perc,dur2),!0)});ai.bind(t("resume",pi),function(n){return n.stopPropagation(),gi.isStopped?(gi.isStopped=!1,ir.isPaused=!1,ir.isScrolling=!0,gi.startTime=p(),k(gi,pi)):ai.trigger(t("play",pi)),!0});ai.bind(t("prev",pi)+" "+t("next",pi),function(e,o,h,c,l){var d,v,k;if(e.stopPropagation(),ir.isStopped||ai.is(":hidden"))return e.stopImmediatePropagation(),r(pi,"Carousel stopped or hidden: Not scrolling.");if(d=i(ri.items.minimum)?ri.items.minimum:ri.items.visible+1,d>bi.total)return e.stopImmediatePropagation(),r(pi,"Not enough items ("+bi.total+" total, "+d+" needed): Not scrolling.");var tt=[o,h,c,l],a=b(tt,["object","number/string","function","boolean"]);if(o=a[0],h=a[1],c=a[2],l=a[3],v=e.type.slice(pi.events.prefix.length),s(o)||(o={}),u(c)&&(o.onAfter=c),f(l)&&(o.queue=l),o=n.extend(!0,{},ri[v],o),o.conditions&&!o.conditions.call(nr,v))return e.stopImmediatePropagation(),r(pi,'Callback "conditions" returned false.');if(!i(h)){if("*"!=ri.items.filter)h="visible";else for(var w=[h,o.items,ri[v].items],a=0,g=w.length;g>a;a++)if(i(w[a])||"page"==w[a]||"visible"==w[a]){h=w[a];break}switch(h){case"page":return e.stopImmediatePropagation(),ai.triggerHandler(t(v+"Page",pi),[o,c]);case"visible":ri.items.visibleConf.variable||"*"!=ri.items.filter||(h=ri.items.visible)}}if(gi.isStopped)return ai.trigger(t("resume",pi)),ai.trigger(t("queue",pi),[v,[o,h,c]]),e.stopImmediatePropagation(),r(pi,"Carousel resumed scrolling.");if(o.duration>0&&ir.isScrolling)return o.queue&&("last"==o.queue&&(yu=[]),("first"!=o.queue||0==yu.length)&&ai.trigger(t("queue",pi),[v,[o,h,c]])),e.stopImmediatePropagation(),r(pi,"Carousel currently scrolling.");if(ru.timePassed=0,ai.trigger(t("slide_"+v,pi),[o,h]),ri.synchronise)for(var p=ri.synchronise,nt=[o,h],y=0,g=p.length;g>y;y++)k=v,p[y][2]||(k="prev"==k?"next":"prev"),p[y][1]||(nt[0]=p[y][0].triggerHandler("_cfs_triggerEvent",["configuration",k])),nt[1]=h+p[y][3],p[y][0].trigger("_cfs_triggerEvent",["slide_"+k,nt]);return!0});ai.bind(t("slide_prev",pi),function(u,f,e){var o,ur,tt,ot,lt,gt,or,bt,tr;if(u.stopPropagation(),o=ai.children(),!ri.circular&&0==bi.first)return ri.infinite&&ai.trigger(t("next",pi),bi.total-1),u.stopImmediatePropagation();if((h(o,ri),i(e))||(ri.items.visibleConf.variable?e=pt(o,ri,bi.total-1):"*"!=ri.items.filter?(ur=i(f.items)?f.items:vi(ai,ri),e=kr(o,ri,bi.total-1,ur)):e=ri.items.visible,e=ii(e,ri,f.items,nr)),(ri.circular||bi.total-e<bi.first&&(e=bi.total-bi.first),ri.items.visibleConf.old=ri.items.visible,ri.items.visibleConf.variable)?(tt=a(w(o,ri,bi.total-e),ri,ri.items.visibleConf.adjust,nr),tt>=ri.items.visible+e&&bi.total>e&&(e++,tt=a(w(o,ri,bi.total-e),ri,ri.items.visibleConf.adjust,nr)),ri.items.visible=tt):"*"!=ri.items.filter&&(tt=st(o,ri,bi.total-e),ri.items.visible=a(tt,ri,ri.items.visibleConf.adjust,nr)),h(o,ri,!0),0==e)return u.stopImmediatePropagation(),r(pi,"0 items to scroll: Not scrolling.");for(r(pi,"Scrolling "+e+" items backward."),bi.first+=e;bi.first>=bi.total;)bi.first-=bi.total;ri.circular||(0==bi.first&&f.onEnd&&f.onEnd.call(nr,"prev"),ri.infinite||g(ri,bi.first,pi));ai.children().slice(bi.total-e,bi.total).prependTo(ai);bi.total<ri.items.visible+e&&ai.children().slice(0,ri.items.visible+e-bi.total).clone(!0).appendTo(ai);var o=ai.children(),kt=gr(o,ri,e),yt=nu(o,ri),it=o.eq(e-1),ct=kt.last(),ft=yt.last();h(o,ri);ot=0;lt=0;ri.align&&(gt=ti(yt,ri),ot=gt[0],lt=gt[1]);var fr=0>ot?ri.padding[ri.d[3]]:0,wt=!1,ci=n();e>ri.items.visible&&(ci=o.slice(ri.items.visibleConf.old,e),"directscroll"==f.fx)&&(or=ri.items[ri.d.width],wt=ci,it=ft,ei(wt),ri.items[ri.d.width]="variable");var s=!1,sr=v(o.slice(0,e),ri,"width"),at=ni(dt(yt,ri,!0),ri,!ri.usePadding),hr=0,ht={},li={},vt={},yi={},wi={},cr={},lr={},ki=hi(f,ri,e,sr);switch(f.fx){case"cover":case"cover-fade":hr=v(o.slice(0,ri.items.visible),ri,"width")}wt&&(ri.items[ri.d.width]=or);h(o,ri,!0);lt>=0&&h(ct,ri,ri.padding[ri.d[1]]);ot>=0&&h(it,ri,ri.padding[ri.d[3]]);ri.align&&(ri.padding[ri.d[1]]=lt,ri.padding[ri.d[3]]=ot);cr[ri.d.left]=-(sr-fr);lr[ri.d.left]=-(hr-fr);li[ri.d.left]=at[ri.d.width];var di=function(){},rt=function(){},y=function(){},ar=function(){},p=function(){},vr=function(){},b=function(){},yr=function(){},c=function(){},l=function(){},nt=function(){};switch(f.fx){case"crossfade":case"cover":case"cover-fade":case"uncover":case"uncover-fade":s=ai.clone(!0).appendTo(er)}switch(f.fx){case"crossfade":case"uncover":case"uncover-fade":s.children().slice(0,e).remove();s.children().slice(ri.items.visibleConf.old).remove();break;case"cover":case"cover-fade":s.children().slice(ri.items.visible).remove();s.css(lr)}if(ai.css(cr),gi=ut(ki,f.easing,pi),ht[ri.d.left]=ri.usePadding?ri.padding[ri.d[3]]:0,("variable"==ri[ri.d.width]||"variable"==ri[ri.d.height])&&(di=function(){er.css(at)},rt=function(){gi.anims.push([er,at])}),ri.usePadding){switch(ft.not(it).length&&(vt[ri.d.marginRight]=it.data("_cfs_origCssMargin"),0>ot?it.css(vt):(b=function(){it.css(vt)},yr=function(){gi.anims.push([it,vt])})),f.fx){case"cover":case"cover-fade":s.children().eq(e-1).css(vt)}ft.not(ct).length&&(yi[ri.d.marginRight]=ct.data("_cfs_origCssMargin"),y=function(){ct.css(yi)},ar=function(){gi.anims.push([ct,yi])});lt>=0&&(wi[ri.d.marginRight]=ft.data("_cfs_origCssMargin")+ri.padding[ri.d[1]],p=function(){ft.css(wi)},vr=function(){gi.anims.push([ft,wi])})}nt=function(){ai.css(ht)};bt=ri.items.visible+e-bi.total;l=function(){if(bt>0&&(ai.children().slice(bi.total).remove(),kt=n(ai.children().slice(bi.total-(ri.items.visible-bt)).get().concat(ai.children().slice(0,bt).get()))),oi(wt),ri.usePadding){var t=ai.children().eq(ri.items.visible+e-1);t.css(ri.d.marginRight,t.data("_cfs_origCssMargin"))}};tr=si(kt,ci,yt,e,"prev",ki,at);switch(c=function(){ui(ai,s,f);ir.isScrolling=!1;vu.onAfter=et(nr,f,"onAfter",tr,vu);yu=fi(ai,yu,pi);ir.isPaused||ai.trigger(t("play",pi))},ir.isScrolling=!0,ru=d(ru),vu.onBefore=et(nr,f,"onBefore",tr,vu),f.fx){case"none":ai.css(ht);di();y();p();b();nt();l();c();break;case"fade":gi.anims.push([ai,{opacity:0},function(){di();y();p();b();nt();l();gi=ut(ki,f.easing,pi);gi.anims.push([ai,{opacity:1},c]);k(gi,pi)}]);break;case"crossfade":ai.css({opacity:0});gi.anims.push([s,{opacity:0}]);gi.anims.push([ai,{opacity:1},c]);rt();y();p();b();nt();l();break;case"cover":gi.anims.push([s,ht,function(){y();p();b();nt();l();c()}]);rt();break;case"cover-fade":gi.anims.push([ai,{opacity:0}]);gi.anims.push([s,ht,function(){y();p();b();nt();l();c()}]);rt();break;case"uncover":gi.anims.push([s,li,c]);rt();y();p();b();nt();l();break;case"uncover-fade":ai.css({opacity:0});gi.anims.push([ai,{opacity:1}]);gi.anims.push([s,li,c]);rt();y();p();b();nt();l();break;default:gi.anims.push([ai,ht,function(){l();c()}]);rt();ar();vr();yr()}return k(gi,pi),rr(ri.cookie,ai,pi),ai.trigger(t("updatePageStatus",pi),[!1,at]),!0});ai.bind(t("slide_next",pi),function(u,f,e){var o,ft,nt,s,ht,vt,gt,at,yt,cr,tr,ur,fr,or;if(u.stopPropagation(),o=ai.children(),!ri.circular&&bi.first==ri.items.visible)return ri.infinite&&ai.trigger(t("prev",pi),bi.total-1),u.stopImmediatePropagation();if((h(o,ri),i(e))||("*"!=ri.items.filter?(nt=i(f.items)?f.items:vi(ai,ri),e=dr(o,ri,0,nt)):e=ri.items.visible,e=ii(e,ri,f.items,nr)),ft=0==bi.first?bi.total:bi.first,ri.circular||(ri.items.visibleConf.variable?(s=w(o,ri,e),nt=pt(o,ri,ft-1)):(s=ri.items.visible,nt=ri.items.visible),e+s>ft&&(e=ft-nt)),ri.items.visibleConf.old=ri.items.visible,ri.items.visibleConf.variable){for(s=a(yi(o,ri,e,ft),ri,ri.items.visibleConf.adjust,nr);ri.items.visible-e>=s&&bi.total>e;)e++,s=a(yi(o,ri,e,ft),ri,ri.items.visibleConf.adjust,nr);ri.items.visible=s}else"*"!=ri.items.filter&&(s=st(o,ri,e),ri.items.visible=a(s,ri,ri.items.visibleConf.adjust,nr));if(h(o,ri,!0),0==e)return u.stopImmediatePropagation(),r(pi,"0 items to scroll: Not scrolling.");for(r(pi,"Scrolling "+e+" items forward."),bi.first-=e;0>bi.first;)bi.first+=bi.total;ri.circular||(bi.first==ri.items.visible&&f.onEnd&&f.onEnd.call(nr,"next"),ri.infinite||g(ri,bi.first,pi));bi.total<ri.items.visible+e&&ai.children().slice(0,ri.items.visible+e-bi.total).clone(!0).appendTo(ai);var o=ai.children(),sr=tu(o,ri),ct=iu(o,ri,e),lt=o.eq(e-1),ot=sr.last(),hr=ct.last();h(o,ri);ht=0;vt=0;ri.align&&(gt=ti(ct,ri),ht=gt[0],vt=gt[1]);at=!1;yt=n();e>ri.items.visibleConf.old&&(yt=o.slice(ri.items.visibleConf.old,e),"directscroll"==f.fx)&&(cr=ri.items[ri.d.width],at=yt,lt=ot,ei(at),ri.items[ri.d.width]="variable");var y=!1,lr=v(o.slice(0,e),ri,"width"),wt=ni(dt(ct,ri,!0),ri,!ri.usePadding),ar=0,bt={},ci={},li={},wi={},kt={},ki=hi(f,ri,e,lr);switch(f.fx){case"uncover":case"uncover-fade":ar=v(o.slice(0,ri.items.visibleConf.old),ri,"width")}at&&(ri.items[ri.d.width]=cr);ri.align&&0>ri.padding[ri.d[1]]&&(ri.padding[ri.d[1]]=0);h(o,ri,!0);h(ot,ri,ri.padding[ri.d[1]]);ri.align&&(ri.padding[ri.d[1]]=vt,ri.padding[ri.d[3]]=ht);kt[ri.d.left]=ri.usePadding?ri.padding[ri.d[3]]:0;var di=function(){},it=function(){},p=function(){},vr=function(){},b=function(){},yr=function(){},c=function(){},l=function(){},rt=function(){};switch(f.fx){case"crossfade":case"cover":case"cover-fade":case"uncover":case"uncover-fade":y=ai.clone(!0).appendTo(er);y.children().slice(ri.items.visibleConf.old).remove()}switch(f.fx){case"crossfade":case"cover":case"cover-fade":ai.css("zIndex",1);y.css("zIndex",0)}(gi=ut(ki,f.easing,pi),bt[ri.d.left]=-lr,ci[ri.d.left]=-ar,0>ht&&(bt[ri.d.left]+=ht),("variable"==ri[ri.d.width]||"variable"==ri[ri.d.height])&&(di=function(){er.css(wt)},it=function(){gi.anims.push([er,wt])}),ri.usePadding)&&(tr=hr.data("_cfs_origCssMargin"),vt>=0&&(tr+=ri.padding[ri.d[1]]),hr.css(ri.d.marginRight,tr),lt.not(ot).length&&(wi[ri.d.marginRight]=ot.data("_cfs_origCssMargin")),p=function(){ot.css(wi)},vr=function(){gi.anims.push([ot,wi])},ur=lt.data("_cfs_origCssMargin"),ht>0&&(ur+=ri.padding[ri.d[3]]),li[ri.d.marginRight]=ur,b=function(){lt.css(li)},yr=function(){gi.anims.push([lt,li])});rt=function(){ai.css(kt)};fr=ri.items.visible+e-bi.total;l=function(){var n,t;fr>0&&ai.children().slice(bi.total).remove();n=ai.children().slice(0,e).appendTo(ai).last();(fr>0&&(ct=tt(o,ri)),oi(at),ri.usePadding)&&(bi.total<ri.items.visible+e&&(t=ai.children().eq(ri.items.visible-1),t.css(ri.d.marginRight,t.data("_cfs_origCssMargin")+ri.padding[ri.d[1]])),n.css(ri.d.marginRight,n.data("_cfs_origCssMargin")))};or=si(sr,yt,ct,e,"next",ki,wt);switch(c=function(){ai.css("zIndex",ai.data("_cfs_origCssZindex"));ui(ai,y,f);ir.isScrolling=!1;vu.onAfter=et(nr,f,"onAfter",or,vu);yu=fi(ai,yu,pi);ir.isPaused||ai.trigger(t("play",pi))},ir.isScrolling=!0,ru=d(ru),vu.onBefore=et(nr,f,"onBefore",or,vu),f.fx){case"none":ai.css(bt);di();p();b();rt();l();c();break;case"fade":gi.anims.push([ai,{opacity:0},function(){di();p();b();rt();l();gi=ut(ki,f.easing,pi);gi.anims.push([ai,{opacity:1},c]);k(gi,pi)}]);break;case"crossfade":ai.css({opacity:0});gi.anims.push([y,{opacity:0}]);gi.anims.push([ai,{opacity:1},c]);it();p();b();rt();l();break;case"cover":ai.css(ri.d.left,er[ri.d.width]());gi.anims.push([ai,kt,c]);it();p();b();l();break;case"cover-fade":ai.css(ri.d.left,er[ri.d.width]());gi.anims.push([y,{opacity:0}]);gi.anims.push([ai,kt,c]);it();p();b();l();break;case"uncover":gi.anims.push([y,ci,c]);it();p();b();rt();l();break;case"uncover-fade":ai.css({opacity:0});gi.anims.push([ai,{opacity:1}]);gi.anims.push([y,ci,c]);it();p();b();rt();l();break;default:gi.anims.push([ai,bt,function(){rt();l();c()}]);it();vr();yr()}return k(gi,pi),rr(ri.cookie,ai,pi),ai.trigger(t("updatePageStatus",pi),[!1,wt]),!0});ai.bind(t("slideTo",pi),function(n,i,r,u,f,e,o){n.stopPropagation();var c=[i,r,u,f,e,o],h=b(c,["string/number/object","number","boolean","object","string","function"]);return f=h[3],e=h[4],o=h[5],i=nt(h[0],h[1],h[2],bi,ai),0==i?!1:(s(f)||(f=!1),"prev"!=e&&"next"!=e&&(e=ri.circular?bi.total/2>=i?"next":"prev":0==bi.first||bi.first>i?"next":"prev"),"prev"==e&&(i=bi.total-i),ai.trigger(t(e,pi),[f,i,o]),!0)});ai.bind(t("prevPage",pi),function(n,i,r){n.stopPropagation();var u=ai.triggerHandler(t("currentPage",pi));return ai.triggerHandler(t("slideToPage",pi),[u-1,i,"prev",r])});ai.bind(t("nextPage",pi),function(n,i,r){n.stopPropagation();var u=ai.triggerHandler(t("currentPage",pi));return ai.triggerHandler(t("slideToPage",pi),[u+1,i,"next",r])});ai.bind(t("slideToPage",pi),function(n,r,u,f,e){n.stopPropagation();i(r)||(r=ai.triggerHandler(t("currentPage",pi)));var o=ri.pagination.items||ri.items.visible,s=Math.ceil(bi.total/o)-1;return 0>r&&(r=s),r>s&&(r=0),ai.triggerHandler(t("slideTo",pi),[r*o,0,!0,u,f,e])});ai.bind(t("jumpToStart",pi),function(n,t){if(n.stopPropagation(),t=t?nt(t,0,!0,bi,ai):0,t+=bi.first,0!=t){if(bi.total>0)for(;t>bi.total;)t-=bi.total;ai.prepend(ai.children().slice(t,bi.total))}return!0});ai.bind(t("synchronise",pi),function(n,i){if(n.stopPropagation(),i)i=tr(i);else{if(!ri.synchronise)return r(pi,"No carousel to synchronise.");i=ri.synchronise}for(var e=ai.triggerHandler(t("currentPosition",pi)),f=!0,u=0,o=i.length;o>u;u++)i[u][0].triggerHandler(t("slideTo",pi),[e,i[u][3],!0])||(f=!1);return f});ai.bind(t("queue",pi),function(n,t,i){return n.stopPropagation(),u(t)?t.call(nr,yu):y(t)?yu=t:o(t)||yu.push([t,i]),yu});ai.bind(t("insertItem",pi),function(i,u,f,h,l){var p,v,y;i.stopPropagation();var w=[u,f,h,l],a=b(w,["string/object","string/number/object","boolean","number"]);return(u=a[0],f=a[1],h=a[2],l=a[3],s(u)&&!c(u)?u=n(u):e(u)&&(u=n(u)),!c(u)||0==u.length)?r(pi,"Not a valid object."):(o(f)&&(f="end"),wt(u,ri),ht(u),p=f,v="before","end"==f?h?(0==bi.first?(f=bi.total-1,v="after"):(f=bi.first,bi.first+=u.length),0>f&&(f=0)):(f=bi.total-1,v="after"):f=nt(f,l,h,bi,ai),y=ai.children().eq(f),y.length?y[v](u):(r(pi,"Correct insert-position not found! Appending item to the end."),ai.append(u)),"end"==p||h||bi.first>f&&(bi.first+=u.length),bi.total=ai.children().length,bi.first>=bi.total&&(bi.first-=bi.total),ai.trigger(t("updateSizes",pi)),ai.trigger(t("linkAnchors",pi)),!0)});ai.bind(t("removeItem",pi),function(i,r,u,f){var e;i.stopPropagation();var h=[r,u,f],s=b(h,["string/number/object","boolean","number"]);return(r=s[0],u=s[1],f=s[2],r instanceof n&&r.length>1)?(e=n(),r.each(function(){var i=ai.trigger(t("removeItem",pi),[n(this),u,f]);i&&(e=e.add(i))}),e):(o(r)||"end"==r?e=ai.children().last():(r=nt(r,f,u,bi,ai),e=ai.children().eq(r),e.length&&bi.first>r&&(bi.first-=e.length)),e&&e.length&&(e.detach(),bi.total=ai.children().length,ai.trigger(t("updateSizes",pi))),e)});ai.bind(t("onBefore",pi)+" "+t("onAfter",pi),function(n,t){n.stopPropagation();var i=n.type.slice(pi.events.prefix.length);return y(t)&&(vu[i]=t),u(t)&&vu[i].push(t),vu[i]});ai.bind(t("currentPosition",pi),function(n,t){var i;return i=(n.stopPropagation(),0==bi.first)?0:bi.total-bi.first,u(t)&&t.call(nr,i),i});ai.bind(t("currentPage",pi),function(n,t){n.stopPropagation();var i,r=ri.pagination.items||ri.items.visible,f=Math.ceil(bi.total/r-1);return i=0==bi.first?0:bi.first<bi.total%r?0:bi.first!=r||ri.circular?Math.round((bi.total-bi.first)/r):f,0>i&&(i=0),i>f&&(i=f),u(t)&&t.call(nr,i),i});ai.bind(t("currentVisible",pi),function(n,t){n.stopPropagation();var i=tt(ai.children(),ri);return u(t)&&t.call(nr,i),i});ai.bind(t("slice",pi),function(t,r,f,e){var h,s;if(t.stopPropagation(),0==bi.total)return!1;var c=[r,f,e],o=b(c,["number","number","function"]);if(r=i(o[0])?o[0]:0,f=i(o[1])?o[1]:bi.total,e=o[2],r+=bi.first,f+=bi.first,items.total>0){for(;r>bi.total;)r-=bi.total;for(;f>bi.total;)f-=bi.total;for(;0>r;)r+=bi.total;for(;0>f;)f+=bi.total}return s=ai.children(),h=f>r?s.slice(r,f):n(s.slice(r,bi.total).get().concat(s.slice(0,f).get())),u(e)&&e.call(nr,h),h});ai.bind(t("isPaused",pi)+" "+t("isStopped",pi)+" "+t("isScrolling",pi),function(n,t){n.stopPropagation();var r=n.type.slice(pi.events.prefix.length),i=ir[r];return u(t)&&t.call(nr,i),i});ai.bind(t("configuration",pi),function(e,a,b,c){var reInit,val,sz;if(e.stopPropagation(),reInit=!1,u(a))a.call(nr,ri);else if(s(a))bu=n.extend(!0,{},bu,a),b!==!1?reInit=!0:ri=n.extend(!0,{},ri,a);else if(!o(a))if(u(b))val=eval("opts."+a),o(val)&&(val=""),b.call(nr,val);else{if(o(b))return eval("opts."+a);"boolean"!=typeof c&&(c=!0);eval("opts_orig."+a+" = b");c!==!1?reInit=!0:eval("opts."+a+" = b")}return reInit&&(h(ai.children(),ri),au._init(bu),au._bind_buttons(),sz=kt(ai,ri),ai.trigger(t("updatePageStatus",pi),[!0,sz])),ri});ai.bind(t("linkAnchors",pi),function(i,u,f){return i.stopPropagation(),o(u)?u=n("body"):e(u)&&(u=n(u)),c(u)&&0!=u.length?(e(f)||(f="a.caroufredsel"),u.find(f).each(function(){var i=this.hash||"";i.length>0&&-1!=ai.children().index(n(i))&&n(this).unbind("click").click(function(n){n.preventDefault();ai.trigger(t("slideTo",pi),i)})}),!0):r(pi,"Not a valid object.")});ai.bind(t("updatePageStatus",pi),function(i,r){var f,e,u;if(i.stopPropagation(),ri.pagination.container)return f=ri.pagination.items||ri.items.visible,e=Math.ceil(bi.total/f),r&&(ri.pagination.anchorBuilder&&(ri.pagination.container.children().remove(),ri.pagination.container.each(function(){for(var i,t=0;e>t;t++)i=ai.children().eq(nt(t*f,0,!0,bi,ai)),n(this).append(ri.pagination.anchorBuilder.call(i[0],t+1))})),ri.pagination.container.each(function(){n(this).children().unbind(ri.pagination.event).each(function(i){n(this).bind(ri.pagination.event,function(n){n.preventDefault();ai.trigger(t("slideTo",pi),[i*f,-ri.pagination.deviation,!0,ri.pagination])})})})),u=ai.triggerHandler(t("currentPage",pi))+ri.pagination.deviation,u>=e&&(u=0),0>u&&(u=e-1),ri.pagination.container.each(function(){n(this).children().removeClass(l("selected",pi)).eq(u).addClass(l("selected",pi))}),!0});ai.bind(t("updateSizes",pi),function(){var i=ri.items.visible,n=ai.children(),f=ki(er,ri,"width"),u,e;return(bi.total=n.length,ir.primarySizePercentage?(ri.maxDimension=f,ri[ri.d.width]=gt(f,ir.primarySizePercentage)):ri.maxDimension=di(ri,f),ri.responsive?(ri.items.width=ri.items.sizesConf.width,ri.items.height=ri.items.sizesConf.height,ri=fr(ri,n,f),i=ri.items.visible,wi(ri,n)):ri.items.visibleConf.variable?i=w(n,ri,0):"*"!=ri.items.filter&&(i=st(n,ri,0)),!ri.circular&&0!=bi.first&&i>bi.first)&&(u=ri.items.visibleConf.variable?pt(n,ri,bi.first)-bi.first:"*"!=ri.items.filter?br(n,ri,bi.first)-bi.first:ri.items.visible-bi.first,r(pi,"Preventing non-circular: sliding "+u+" items backward."),ai.trigger(t("prev",pi),u)),ri.items.visible=a(i,ri,ri.items.visibleConf.adjust,nr),ri.items.visibleConf.old=ri.items.visible,ri=ur(ri,n),e=kt(ai,ri),ai.trigger(t("updatePageStatus",pi),[!0,e]),vt(ri,bi.total,pi),g(ri,bi.first,pi),e});ai.bind(t("destroy",pi),function(n,i){return n.stopPropagation(),ru=d(ru),ai.data("_cfs_isCarousel",!1),ai.trigger(t("finish",pi)),i&&ai.trigger(t("jumpToStart",pi)),bt(ai.children()),bt(ai),au._unbind_events(),au._unbind_buttons(),"parent"==pi.wrapper?bt(er):er.replaceWith(ai),!0});ai.bind(t("debug",pi),function(){return r(pi,"Carousel width: "+ri.width),r(pi,"Carousel height: "+ri.height),r(pi,"Item widths: "+ri.items.width),r(pi,"Item heights: "+ri.items.height),r(pi,"Number of items visible: "+ri.items.visible),ri.auto.play&&r(pi,"Number of items scrolled automatically: "+ri.auto.items),ri.prev.button&&r(pi,"Number of items scrolled backward: "+ri.prev.items),ri.next.button&&r(pi,"Number of items scrolled forward: "+ri.next.items),pi.debug});ai.bind("_cfs_triggerEvent",function(n,i,r){return n.stopPropagation(),ai.triggerHandler(t(i,pi),r)})};au._unbind_events=function(){ai.unbind(t("",pi));ai.unbind(t("",pi,!1));ai.unbind("_cfs_triggerEvent")};au._bind_buttons=function(){var i,u,a,v,o,s;if((au._unbind_buttons(),vt(ri,bi.total,pi),g(ri,bi.first,pi),ri.auto.pauseOnHover)&&(i=it(ri.auto.pauseOnHover),er.bind(t("mouseenter",pi,!1),function(){ai.trigger(t("pause",pi),i)}).bind(t("mouseleave",pi,!1),function(){ai.trigger(t("resume",pi))})),(ri.auto.button&&ri.auto.button.bind(t(ri.auto.event,pi,!1),function(n){n.preventDefault();var i=!1,r=null;ir.isPaused?i="play":ri.auto.pauseOnEvent&&(i="pause",r=it(ri.auto.pauseOnEvent));i&&ai.trigger(t(i,pi),r)}),ri.prev.button&&(ri.prev.button.bind(t(ri.prev.event,pi,!1),function(n){n.preventDefault();ai.trigger(t("prev",pi))}),ri.prev.pauseOnHover))&&(i=it(ri.prev.pauseOnHover),ri.prev.button.bind(t("mouseenter",pi,!1),function(){ai.trigger(t("pause",pi),i)}).bind(t("mouseleave",pi,!1),function(){ai.trigger(t("resume",pi))})),ri.next.button&&(ri.next.button.bind(t(ri.next.event,pi,!1),function(n){n.preventDefault();ai.trigger(t("next",pi))}),ri.next.pauseOnHover)&&(i=it(ri.next.pauseOnHover),ri.next.button.bind(t("mouseenter",pi,!1),function(){ai.trigger(t("pause",pi),i)}).bind(t("mouseleave",pi,!1),function(){ai.trigger(t("resume",pi))})),ri.pagination.container&&ri.pagination.pauseOnHover&&(i=it(ri.pagination.pauseOnHover),ri.pagination.container.bind(t("mouseenter",pi,!1),function(){ai.trigger(t("pause",pi),i)}).bind(t("mouseleave",pi,!1),function(){ai.trigger(t("resume",pi))})),((ri.prev.key||ri.next.key)&&n(document).bind(t("keyup",pi,!1,!0,!0),function(n){var i=n.keyCode;i==ri.next.key&&(n.preventDefault(),ai.trigger(t("next",pi)));i==ri.prev.key&&(n.preventDefault(),ai.trigger(t("prev",pi)))}),ri.pagination.keys&&n(document).bind(t("keyup",pi,!1,!0,!0),function(n){var i=n.keyCode;i>=49&&58>i&&(i=(i-49)*ri.items.visible,bi.total>=i&&(n.preventDefault(),ai.trigger(t("slideTo",pi),[i,0,!0,ri.pagination])))}),n.fn.swipe)&&(u="ontouchstart"in window,u&&ri.swipe.onTouch||!u&&ri.swipe.onMouse)){var y=n.extend(!0,{},ri.prev,ri.swipe),p=n.extend(!0,{},ri.next,ri.swipe),c=function(){ai.trigger(t("prev",pi),[y])},l=function(){ai.trigger(t("next",pi),[p])};switch(ri.direction){case"up":case"down":ri.swipe.options.swipeUp=l;ri.swipe.options.swipeDown=c;break;default:ri.swipe.options.swipeLeft=l;ri.swipe.options.swipeRight=c}ir.swipe&&ai.swipe("destroy");er.swipe(ri.swipe.options);er.css("cursor","move");ir.swipe=!0}if(n.fn.mousewheel&&ri.mousewheel&&(a=n.extend(!0,{},ri.prev,ri.mousewheel),v=n.extend(!0,{},ri.next,ri.mousewheel),ir.mousewheel&&er.unbind(t("mousewheel",pi,!1)),er.bind(t("mousewheel",pi,!1),function(n,i){n.preventDefault();i>0?ai.trigger(t("prev",pi),[a]):ai.trigger(t("next",pi),[v])}),ir.mousewheel=!0),ri.auto.play&&ai.trigger(t("play",pi),ri.auto.delay),ir.upDateOnWindowResize){var f=function(){ai.trigger(t("finish",pi));ri.auto.pauseOnResize&&!ir.isPaused&&ai.trigger(t("play",pi));h(ai.children(),ri);ai.trigger(t("updateSizes",pi))},e=n(window),r=null;n.debounce&&"debounce"==pi.onWindowResize?r=n.debounce(200,f):n.throttle&&"throttle"==pi.onWindowResize?r=n.throttle(300,f):(o=0,s=0,r=function(){var n=e.width(),t=e.height();(n!=o||t!=s)&&(f(),o=n,s=t)});e.bind(t("resize",pi,!1,!0,!0),r)}};au._unbind_buttons=function(){var i=(t("",pi),t("",pi,!1));ns3=t("",pi,!1,!0,!0);n(document).unbind(ns3);n(window).unbind(ns3);er.unbind(i);ri.auto.button&&ri.auto.button.unbind(i);ri.prev.button&&ri.prev.button.unbind(i);ri.next.button&&ri.next.button.unbind(i);ri.pagination.container&&(ri.pagination.container.unbind(i),ri.pagination.anchorBuilder&&ri.pagination.container.children().remove());ir.swipe&&(ai.swipe("destroy"),er.css("cursor","default"),ir.swipe=!1);ir.mousewheel&&(ir.mousewheel=!1);vt(ri,"hide",pi);g(ri,"removeClass",pi)};f(yt)&&(yt={debug:yt});var ir={direction:"next",isPaused:!0,isScrolling:!1,isStopped:!1,mousewheel:!1,swipe:!1},bi={total:ai.children().length,first:0},ru={auto:null,progress:null,startTime:p(),timePassed:0},gi={isStopped:!1,duration:0,startTime:0,easing:"",anims:[]},vu={onBefore:[],onAfter:[]},yu=[],pi=n.extend(!0,{},n.fn.carouFredSel.configs,yt),ri={},bu=n.extend(!0,{},ct),er="parent"==pi.wrapper?ai.parent():ai.wrap("<"+pi.wrapper.element+' class="'+pi.wrapper.classname+'" />').parent();if((pi.selector=ai.selector,pi.serialNumber=n.fn.carouFredSel.serialNumber++,pi.transition=pi.transition&&n.fn.transition?"transition":"animate",au._init(bu,!0,gu),au._build(),au._bind_events(),au._bind_buttons(),y(ri.items.start))?pu=ri.items.start:(pu=[],0!=ri.items.start&&pu.push(ri.items.start)),ri.cookie&&pu.unshift(parseInt(eu(ri.cookie),10)),pu.length>0)for(ku=0,nf=pu.length;nf>ku;ku++)if(wu=pu[ku],0!=wu){if(wu===!0){if(wu=window.location.hash,1>wu.length)continue}else"random"===wu&&(wu=Math.floor(Math.random()*bi.total));if(ai.triggerHandler(t("slideTo",pi),[wu,0,!0,{fx:"none"}]))break}return du=kt(ai,ri),tf=tt(ai.children(),ri),ri.onCreate&&ri.onCreate.call(nr,{width:du.width,height:du.height,items:tf}),ai.trigger(t("updatePageStatus",pi),[!0,du]),ai.trigger(t("linkAnchors",pi)),pi.debug&&ai.trigger(t("debug",pi)),ai},n.fn.carouFredSel.serialNumber=1,n.fn.carouFredSel.defaults={synchronise:!1,infinite:!0,circular:!0,responsive:!1,direction:"left",items:{start:0},scroll:{easing:"swing",duration:500,pauseOnHover:!1,event:"click",queue:!1}},n.fn.carouFredSel.configs={debug:!1,transition:!1,onWindowResize:"throttle",events:{prefix:"",namespace:"cfs"},wrapper:{element:"div",classname:"caroufredsel_wrapper"},classnames:{}},n.fn.carouFredSel.pageAnchorBuilder=function(n){return'<a href="#"><span>'+n+"<\/span><\/a>"},n.fn.carouFredSel.progressbarUpdater=function(t){n(this).css("width",t+"%")},n.fn.carouFredSel.cookie={get:function(n){var t;n+="=";for(var r=document.cookie.split(";"),i=0,u=r.length;u>i;i++){for(t=r[i];" "==t.charAt(0);)t=t.slice(1);if(0==t.indexOf(n))return t.slice(n.length)}return 0},set:function(n,t,i){var u="",r;i&&(r=new Date,r.setTime(r.getTime()+864e5*i),u="; expires="+r.toGMTString());document.cookie=n+"="+t+u+"; path=/"},remove:function(t){n.fn.carouFredSel.cookie.set(t,"",-1)}},n.extend(n.easing,{quadratic:function(n){var t=n*n;return n*(-t*n+4*t-6*n+4)},cubic:function(n){return n*(4*n*n-9*n+6)},elastic:function(n){var t=n*n;return n*(33*t*t-106*t*n+126*t-67*n+15)}}))}(jQuery),function(n){n.fn.twittie=function(t,i){var e="function"==typeof t?t:i,r=n.extend({username:null,list:null,hashtag:null,count:10,hideReplies:!1,dateFormat:"%b/%d/%Y",template:"{{date}} - {{tweet}}",apiPath:"api/tweet.php"},t instanceof Object?t:{}),u,o,f;r.list&&!r.username&&n.error("If you want to fetch tweets from a list, you must define the username of the list owner.");u=function(n){return n.replace(/(https?:\/\/([-\w\.]+)+(:\d+)?(\/([\w\/_\.]*(\?\S+)?)?)?)/ig,'<a href="$1" target="_blank" title="Visit this link">$1<\/a>').replace(/#([a-zA-Z0-9_]+)/g,'<a href="http://twitter.com/search?q=%23$1&amp;src=hash" target="_blank" title="Search for #$1">#$1<\/a>').replace(/@([a-zA-Z0-9_]+)/g,'<a href="http://twitter.com/$1" target="_blank" title="$1 on Twitter">@$1<\/a>')};o=function(n){for(var i=r.template,u="date tweet avatar url retweeted screen_name user_name".split(" "),t=0,f=u.length;t<f;t++)i=i.replace(new RegExp("{{"+u[t]+"}}","gi"),n[u[t]]);return i};this.html("<span>Loading...<\/span>");f=this;n.getJSON(r.apiPath,{username:r.username,list:r.list,hashtag:r.hashtag,count:r.count,exclude_replies:r.hideReplies},function(n){f.find("span").fadeOut("fast",function(){var s,t;for(f.html("<ul><\/ul>"),s=0;s<r.count;s++){if(t=!1,n[s])t=n[s];else if(void 0!==n.statuses&&n.statuses[s])t=n.statuses[s];else break;for(var a=t.user.name,i=t.created_at,i=i.split(" "),i=new Date(Date.parse(i[1]+" "+i[2]+", "+i[5]+" "+i[3]+" UTC")),h="January February March April May June July August September October November December".split(" "),i={"%d":i.getDate(),"%m":i.getMonth()+1,"%b":h[i.getMonth()].substr(0,3),"%B":h[i.getMonth()],"%y":String(i.getFullYear()).slice(-2),"%Y":i.getFullYear()},h=r.dateFormat,l=r.dateFormat.match(/%[dmbByY]/g),c=0,v=l.length;c<v;c++)h=h.replace(l[c],i[l[c]]);t={user_name:a,date:h,tweet:t.retweeted?u("RT @"+t.user.screen_name+": "+t.retweeted_status.text):u(t.text),avatar:'<img src="'+t.user.profile_image_url+'" />',url:"http://twitter.com/"+t.user.screen_name+"/status/"+t.id_str,retweeted:t.retweeted,screen_name:u("@"+t.user.screen_name)};f.find("ul").append("<li>"+o(t)+"<\/li>")}"function"==typeof e&&e()})})}}(jQuery),function(n){var e=Array.prototype.slice,h=Array.prototype.splice,u={topSpacing:0,bottomSpacing:0,className:"is-sticky",wrapperClassName:"sticky-wrapper",center:!1,getWidthFrom:"",widthFromWrapper:!0,responsiveWidth:!1},f=n(window),c=n(document),t=[],o=f.height(),r=function(){for(var e=f.scrollTop(),h=c.height(),l=h-o,a=e>l?l-e:0,r,u,s=0;s<t.length;s++){var i=t[s],v=i.stickyWrapper.offset().top,y=v-i.topSpacing-a;e<=y?i.currentTop!==null&&(i.stickyElement.css({width:"",position:"",top:""}),i.stickyElement.parent().removeClass(i.className),i.stickyElement.trigger("sticky-end",[i]),i.currentTop=null):(r=h-i.stickyElement.outerHeight()-i.topSpacing-i.bottomSpacing-e-a,r=r<0?r+i.topSpacing:i.topSpacing,i.currentTop!=r&&(i.getWidthFrom?u=n(i.getWidthFrom).width()||null:i.widthFromWrapper&&(u=i.stickyWrapper.width()),u==null&&(u=i.stickyElement.width()),i.stickyElement.css("width",u).css("position","fixed").css("top",r),i.stickyElement.parent().addClass(i.className),i.currentTop===null?i.stickyElement.trigger("sticky-start",[i]):i.stickyElement.trigger("sticky-update",[i]),i.currentTop===i.topSpacing&&i.currentTop>r||i.currentTop===null&&r<i.topSpacing?i.stickyElement.trigger("sticky-bottom-reached",[i]):i.currentTop!==null&&r===i.topSpacing&&i.currentTop<r&&i.stickyElement.trigger("sticky-bottom-unreached",[i]),i.currentTop=r))}},s=function(){var u,i,r;for(o=f.height(),u=0;u<t.length;u++)i=t[u],r=null,i.getWidthFrom?i.responsiveWidth===!0&&(r=n(i.getWidthFrom).width()):i.widthFromWrapper&&(r=i.stickyWrapper.width()),r!=null&&i.stickyElement.css("width",r)},i={init:function(i){var r=n.extend({},u,i);return this.each(function(){var i=n(this),e=i.attr("id"),o=i.outerHeight(),s=e?e+"-"+u.wrapperClassName:u.wrapperClassName,h=n("<div><\/div>").attr("id",s).addClass(r.wrapperClassName),f;i.wrapAll(h);f=i.parent();r.center&&f.css({width:i.outerWidth(),marginLeft:"auto",marginRight:"auto"});i.css("float")=="right"&&i.css({float:"none"}).parent().css({float:"right"});f.css("height",o);r.stickyElement=i;r.stickyWrapper=f;r.currentTop=null;t.push(r)})},update:r,unstick:function(){return this.each(function(){for(var r=this,u=n(r),f=-1,i=t.length;i-->0;)t[i].stickyElement.get(0)===r&&(h.call(t,i,1),f=i);f!=-1&&(u.unwrap(),u.css({width:"",position:"",top:"",float:""}))})}};window.addEventListener?(window.addEventListener("scroll",r,!1),window.addEventListener("resize",s,!1)):window.attachEvent&&(window.attachEvent("onscroll",r),window.attachEvent("onresize",s));n.fn.sticky=function(t){if(i[t])return i[t].apply(this,e.call(arguments,1));if(typeof t!="object"&&t)n.error("Method "+t+" does not exist on jQuery.sticky");else return i.init.apply(this,arguments)};n.fn.unstick=function(t){if(i[t])return i[t].apply(this,e.call(arguments,1));if(typeof t!="object"&&t)n.error("Method "+t+" does not exist on jQuery.sticky");else return i.unstick.apply(this,arguments)};n(function(){setTimeout(r,0)})}(jQuery);!function(n,t){"function"==typeof define&&define.amd?define(["jquery"],t):t("object"==typeof exports?require("jquery"):n.jQuery?n.jQuery:n.Zepto)}(this,function(n,t){var r,f,u,i,e;n.fn.jPlayer=function(i){var r="jPlayer",u="string"==typeof i,f=Array.prototype.slice.call(arguments,1),e=this;return i=!u&&f.length?n.extend.apply(null,[!0,i].concat(f)):i,u&&"_"===i.charAt(0)?e:(this.each(u?function(){var u=n(this).data(r),o=u&&n.isFunction(u[i])?u[i].apply(u,f):u;if(o!==u&&o!==t)return(e=o,!1)}:function(){var t=n(this).data(r);t?t.option(i||{}):n(this).data(r,new n.jPlayer(i,this))}),e)};n.jPlayer=function(t,i){if(arguments.length){this.element=n(i);this.options=n.extend(!0,{},this.options,t);var r=this;this.element.bind("remove.jPlayer",function(){r.destroy()});this._init()}};"function"!=typeof n.fn.stop&&(n.fn.stop=function(){});n.jPlayer.emulateMethods="load play pause";n.jPlayer.emulateStatus="src readyState networkState currentTime duration paused ended playbackRate";n.jPlayer.emulateOptions="muted volume";n.jPlayer.reservedEvent="ready flashreset resize repeat error warning";n.jPlayer.event={};n.each(["ready","setmedia","flashreset","resize","repeat","click","error","warning","loadstart","progress","suspend","abort","emptied","stalled","play","pause","loadedmetadata","loadeddata","waiting","playing","canplay","canplaythrough","seeking","seeked","timeupdate","ended","ratechange","durationchange","volumechange"],function(){n.jPlayer.event[this]="jPlayer_"+this});n.jPlayer.htmlEvent=["loadstart","abort","emptied","stalled","loadedmetadata","canplay","canplaythrough"];n.jPlayer.pause=function(){n.jPlayer.prototype.destroyRemoved();n.each(n.jPlayer.prototype.instances,function(n,t){t.data("jPlayer").status.srcSet&&t.jPlayer("pause")})};n.jPlayer.timeFormat={showHour:!1,showMin:!0,showSec:!0,padHour:!1,padMin:!0,padSec:!0,sepHour:":",sepMin:":",sepSec:""};r=function(){this.init()};r.prototype={init:function(){this.options={timeFormat:n.jPlayer.timeFormat}},time:function(n){n=n&&"number"==typeof n?n:0;var t=new Date(1e3*n),i=t.getUTCHours(),r=this.options.timeFormat.showHour?t.getUTCMinutes():t.getUTCMinutes()+60*i,u=this.options.timeFormat.showMin?t.getUTCSeconds():t.getUTCSeconds()+60*r,e=this.options.timeFormat.padHour&&10>i?"0"+i:i,o=this.options.timeFormat.padMin&&10>r?"0"+r:r,s=this.options.timeFormat.padSec&&10>u?"0"+u:u,f="";return f+=this.options.timeFormat.showHour?e+this.options.timeFormat.sepHour:"",f+=this.options.timeFormat.showMin?o+this.options.timeFormat.sepMin:"",f+(this.options.timeFormat.showSec?s+this.options.timeFormat.sepSec:"")}};f=new r;n.jPlayer.convertTime=function(n){return f.time(n)};n.jPlayer.uaBrowser=function(n){var t=n.toLowerCase(),i=/(webkit)[ \/]([\w.]+)/.exec(t)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(t)||/(msie) ([\w.]+)/.exec(t)||t.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(t)||[];return{browser:i[1]||"",version:i[2]||"0"}};n.jPlayer.uaPlatform=function(n){var t=n.toLowerCase(),i=/(ipad|iphone|ipod|android|blackberry|playbook|windows ce|webos)/.exec(t)||[],r=/(ipad|playbook)/.exec(t)||!/(mobile)/.exec(t)&&/(android)/.exec(t)||[];return i[1]&&(i[1]=i[1].replace(/\s/g,"_")),{platform:i[1]||"",tablet:r[1]||""}};n.jPlayer.browser={};n.jPlayer.platform={};u=n.jPlayer.uaBrowser(navigator.userAgent);u.browser&&(n.jPlayer.browser[u.browser]=!0,n.jPlayer.browser.version=u.version);i=n.jPlayer.uaPlatform(navigator.userAgent);i.platform&&(n.jPlayer.platform[i.platform]=!0,n.jPlayer.platform.mobile=!i.tablet,n.jPlayer.platform.tablet=!!i.tablet);n.jPlayer.getDocMode=function(){var t;return n.jPlayer.browser.msie&&(document.documentMode?t=document.documentMode:(t=5,document.compatMode&&"CSS1Compat"===document.compatMode&&(t=7))),t};n.jPlayer.browser.documentMode=n.jPlayer.getDocMode();n.jPlayer.nativeFeatures={init:function(){var n,u,e,t=document,o=t.createElement("video"),i={w3c:["fullscreenEnabled","fullscreenElement","requestFullscreen","exitFullscreen","fullscreenchange","fullscreenerror"],moz:["mozFullScreenEnabled","mozFullScreenElement","mozRequestFullScreen","mozCancelFullScreen","mozfullscreenchange","mozfullscreenerror"],webkit:["","webkitCurrentFullScreenElement","webkitRequestFullScreen","webkitCancelFullScreen","webkitfullscreenchange",""],webkitVideo:["webkitSupportsFullscreen","webkitDisplayingFullscreen","webkitEnterFullscreen","webkitExitFullscreen","",""],ms:["","msFullscreenElement","msRequestFullscreen","msExitFullscreen","MSFullscreenChange","MSFullscreenError"]},s=["w3c","moz","webkit","webkitVideo","ms"],f,r;for(this.fullscreen=n={support:{w3c:!!t[i.w3c[0]],moz:!!t[i.moz[0]],webkit:"function"==typeof t[i.webkit[3]],webkitVideo:"function"==typeof o[i.webkitVideo[2]],ms:"function"==typeof o[i.ms[2]]},used:{}},u=0,e=s.length;e>u;u++)if(f=s[u],n.support[f]){n.spec=f;n.used[f]=!0;break}n.spec?(r=i[n.spec],n.api={fullscreenEnabled:!0,fullscreenElement:function(n){return n=n?n:t,n[r[1]]},requestFullscreen:function(n){return n[r[2]]()},exitFullscreen:function(n){return n=n?n:t,n[r[3]]()}},n.event={fullscreenchange:r[4],fullscreenerror:r[5]}):(n.api={fullscreenEnabled:!1,fullscreenElement:function(){return null},requestFullscreen:function(){},exitFullscreen:function(){}},n.event={})}};n.jPlayer.nativeFeatures.init();n.jPlayer.focus=null;n.jPlayer.keyIgnoreElementNames="A INPUT TEXTAREA SELECT BUTTON";e=function(t){var r,i=n.jPlayer.focus;i&&(n.each(n.jPlayer.keyIgnoreElementNames.split(/\s+/g),function(n,i){if(t.target.nodeName.toUpperCase()===i.toUpperCase())return(r=!0,!1)}),r||n.each(i.options.keyBindings,function(r,u){if(u&&n.isFunction(u.fn)&&("number"==typeof u.key&&t.which===u.key||"string"==typeof u.key&&t.key===u.key))return(t.preventDefault(),u.fn(i),!1)}))};n.jPlayer.keys=function(t){var i="keydown.jPlayer";n(document.documentElement).unbind(i);t&&n(document.documentElement).bind(i,e)};n.jPlayer.keys(!0);n.jPlayer.prototype={count:0,version:{script:"2.9.2",needFlash:"2.9.0",flash:"unknown"},options:{swfPath:"js",solution:"html, flash",supplied:"mp3",auroraFormats:"wav",preload:"metadata",volume:.8,muted:!1,remainingDuration:!1,toggleDuration:!1,captureDuration:!0,playbackRate:1,defaultPlaybackRate:1,minPlaybackRate:.5,maxPlaybackRate:4,wmode:"opaque",backgroundColor:"#000000",cssSelectorAncestor:"#jp_container_1",cssSelector:{videoPlay:".jp-video-play",play:".jp-play",pause:".jp-pause",stop:".jp-stop",seekBar:".jp-seek-bar",playBar:".jp-play-bar",mute:".jp-mute",unmute:".jp-unmute",volumeBar:".jp-volume-bar",volumeBarValue:".jp-volume-bar-value",volumeMax:".jp-volume-max",playbackRateBar:".jp-playback-rate-bar",playbackRateBarValue:".jp-playback-rate-bar-value",currentTime:".jp-current-time",duration:".jp-duration",title:".jp-title",fullScreen:".jp-full-screen",restoreScreen:".jp-restore-screen",repeat:".jp-repeat",repeatOff:".jp-repeat-off",gui:".jp-gui",noSolution:".jp-no-solution"},stateClass:{playing:"jp-state-playing",seeking:"jp-state-seeking",muted:"jp-state-muted",looped:"jp-state-looped",fullScreen:"jp-state-full-screen",noVolume:"jp-state-no-volume"},useStateClassSkin:!1,autoBlur:!0,smoothPlayBar:!1,fullScreen:!1,fullWindow:!1,autohide:{restored:!1,full:!0,fadeIn:200,fadeOut:600,hold:1e3},loop:!1,repeat:function(t){t.jPlayer.options.loop?n(this).unbind(".jPlayerRepeat").bind(n.jPlayer.event.ended+".jPlayer.jPlayerRepeat",function(){n(this).jPlayer("play")}):n(this).unbind(".jPlayerRepeat")},nativeVideoControls:{},noFullWindow:{msie:/msie [0-6]\./,ipad:/ipad.*?os [0-4]\./,iphone:/iphone/,ipod:/ipod/,android_pad:/android [0-3]\.(?!.*?mobile)/,android_phone:/(?=.*android)(?!.*chrome)(?=.*mobile)/,blackberry:/blackberry/,windows_ce:/windows ce/,iemobile:/iemobile/,webos:/webos/},noVolume:{ipad:/ipad/,iphone:/iphone/,ipod:/ipod/,android_pad:/android(?!.*?mobile)/,android_phone:/android.*?mobile/,blackberry:/blackberry/,windows_ce:/windows ce/,iemobile:/iemobile/,webos:/webos/,playbook:/playbook/},timeFormat:{},keyEnabled:!1,audioFullScreen:!1,keyBindings:{play:{key:80,fn:function(n){n.status.paused?n.play():n.pause()}},fullScreen:{key:70,fn:function(n){(n.status.video||n.options.audioFullScreen)&&n._setOption("fullScreen",!n.options.fullScreen)}},muted:{key:77,fn:function(n){n._muted(!n.options.muted)}},volumeUp:{key:190,fn:function(n){n.volume(n.options.volume+.1)}},volumeDown:{key:188,fn:function(n){n.volume(n.options.volume-.1)}},loop:{key:76,fn:function(n){n._loop(!n.options.loop)}}},verticalVolume:!1,verticalPlaybackRate:!1,globalVolume:!1,idPrefix:"jp",noConflict:"jQuery",emulateHtml:!1,consoleAlerts:!0,errorAlerts:!1,warningAlerts:!1},optionsAudio:{size:{width:"0px",height:"0px",cssClass:""},sizeFull:{width:"0px",height:"0px",cssClass:""}},optionsVideo:{size:{width:"480px",height:"270px",cssClass:"jp-video-270p"},sizeFull:{width:"100%",height:"100%",cssClass:"jp-video-full"}},instances:{},status:{src:"",media:{},paused:!0,format:{},formatType:"",waitForPlay:!0,waitForLoad:!0,srcSet:!1,video:!1,seekPercent:0,currentPercentRelative:0,currentPercentAbsolute:0,currentTime:0,duration:0,remaining:0,videoWidth:0,videoHeight:0,readyState:0,networkState:0,playbackRate:1,ended:0},internal:{ready:!1},solution:{html:!0,aurora:!0,flash:!0},format:{mp3:{codec:"audio/mpeg",flashCanPlay:!0,media:"audio"},m4a:{codec:'audio/mp4; codecs="mp4a.40.2"',flashCanPlay:!0,media:"audio"},m3u8a:{codec:'application/vnd.apple.mpegurl; codecs="mp4a.40.2"',flashCanPlay:!1,media:"audio"},m3ua:{codec:"audio/mpegurl",flashCanPlay:!1,media:"audio"},oga:{codec:'audio/ogg; codecs="vorbis, opus"',flashCanPlay:!1,media:"audio"},flac:{codec:"audio/x-flac",flashCanPlay:!1,media:"audio"},wav:{codec:'audio/wav; codecs="1"',flashCanPlay:!1,media:"audio"},webma:{codec:'audio/webm; codecs="vorbis"',flashCanPlay:!1,media:"audio"},fla:{codec:"audio/x-flv",flashCanPlay:!0,media:"audio"},rtmpa:{codec:'audio/rtmp; codecs="rtmp"',flashCanPlay:!0,media:"audio"},m4v:{codec:'video/mp4; codecs="avc1.42E01E, mp4a.40.2"',flashCanPlay:!0,media:"video"},m3u8v:{codec:'application/vnd.apple.mpegurl; codecs="avc1.42E01E, mp4a.40.2"',flashCanPlay:!1,media:"video"},m3uv:{codec:"audio/mpegurl",flashCanPlay:!1,media:"video"},ogv:{codec:'video/ogg; codecs="theora, vorbis"',flashCanPlay:!1,media:"video"},webmv:{codec:'video/webm; codecs="vorbis, vp8"',flashCanPlay:!1,media:"video"},flv:{codec:"video/x-flv",flashCanPlay:!0,media:"video"},rtmpv:{codec:'video/rtmp; codecs="rtmp"',flashCanPlay:!0,media:"video"}},_init:function(){var i=this,r,e,s,o,f,u;if(this.element.empty(),this.status=n.extend({},this.status),this.internal=n.extend({},this.internal),this.options.timeFormat=n.extend({},n.jPlayer.timeFormat,this.options.timeFormat),this.internal.cmdsIgnored=n.jPlayer.platform.ipad||n.jPlayer.platform.iphone||n.jPlayer.platform.ipod,this.internal.domNode=this.element.get(0),this.options.keyEnabled&&!n.jPlayer.focus&&(n.jPlayer.focus=this),this.androidFix={setMedia:!1,play:!1,pause:!1,time:NaN},n.jPlayer.platform.android&&(this.options.preload="auto"!==this.options.preload?"metadata":"auto"),this.formats=[],this.solutions=[],this.require={},this.htmlElement={},this.html={},this.html.audio={},this.html.video={},this.aurora={},this.aurora.formats=[],this.aurora.properties=[],this.flash={},this.css={},this.css.cs={},this.css.jq={},this.ancestorJq=[],this.options.volume=this._limitValue(this.options.volume,0,1),n.each(this.options.supplied.toLowerCase().split(","),function(t,r){var u=r.replace(/^\s+|\s+$/g,""),f;i.format[u]&&(f=!1,n.each(i.formats,function(n,t){if(u===t)return(f=!0,!1)}),f||i.formats.push(u))}),n.each(this.options.solution.toLowerCase().split(","),function(t,r){var u=r.replace(/^\s+|\s+$/g,""),f;i.solution[u]&&(f=!1,n.each(i.solutions,function(n,t){if(u===t)return(f=!0,!1)}),f||i.solutions.push(u))}),n.each(this.options.auroraFormats.toLowerCase().split(","),function(t,r){var u=r.replace(/^\s+|\s+$/g,""),f;i.format[u]&&(f=!1,n.each(i.aurora.formats,function(n,t){if(u===t)return(f=!0,!1)}),f||i.aurora.formats.push(u))}),this.internal.instance="jp_"+this.count,this.instances[this.internal.instance]=this.element,this.element.attr("id")||this.element.attr("id",this.options.idPrefix+"_jplayer_"+this.count),this.internal.self=n.extend({},{id:this.element.attr("id"),jq:this.element}),this.internal.audio=n.extend({},{id:this.options.idPrefix+"_audio_"+this.count,jq:t}),this.internal.video=n.extend({},{id:this.options.idPrefix+"_video_"+this.count,jq:t}),this.internal.flash=n.extend({},{id:this.options.idPrefix+"_flash_"+this.count,jq:t,swf:this.options.swfPath+(".swf"!==this.options.swfPath.toLowerCase().slice(-4)?(this.options.swfPath&&"/"!==this.options.swfPath.slice(-1)?"/":"")+"jquery.jplayer.swf":"")}),this.internal.poster=n.extend({},{id:this.options.idPrefix+"_poster_"+this.count,jq:t}),n.each(n.jPlayer.event,function(n,r){i.options[n]!==t&&(i.element.bind(r+".jPlayer",i.options[n]),i.options[n]=t)}),this.require.audio=!1,this.require.video=!1,n.each(this.formats,function(n,t){i.require[i.format[t].media]=!0}),this.options=this.require.video?n.extend(!0,{},this.optionsVideo,this.options):n.extend(!0,{},this.optionsAudio,this.options),this._setSize(),this.status.nativeVideoControls=this._uaBlocklist(this.options.nativeVideoControls),this.status.noFullWindow=this._uaBlocklist(this.options.noFullWindow),this.status.noVolume=this._uaBlocklist(this.options.noVolume),n.jPlayer.nativeFeatures.fullscreen.api.fullscreenEnabled&&this._fullscreenAddEventListeners(),this._restrictNativeVideoControls(),this.htmlElement.poster=document.createElement("img"),this.htmlElement.poster.id=this.internal.poster.id,this.htmlElement.poster.onload=function(){(!i.status.video||i.status.waitForPlay)&&i.internal.poster.jq.show()},this.element.append(this.htmlElement.poster),this.internal.poster.jq=n("#"+this.internal.poster.id),this.internal.poster.jq.css({width:this.status.width,height:this.status.height}),this.internal.poster.jq.hide(),this.internal.poster.jq.bind("click.jPlayer",function(){i._trigger(n.jPlayer.event.click)}),this.html.audio.available=!1,this.require.audio&&(this.htmlElement.audio=document.createElement("audio"),this.htmlElement.audio.id=this.internal.audio.id,this.html.audio.available=!!this.htmlElement.audio.canPlayType&&this._testCanPlayType(this.htmlElement.audio)),this.html.video.available=!1,this.require.video&&(this.htmlElement.video=document.createElement("video"),this.htmlElement.video.id=this.internal.video.id,this.html.video.available=!!this.htmlElement.video.canPlayType&&this._testCanPlayType(this.htmlElement.video)),this.flash.available=this._checkForFlash(10.1),this.html.canPlay={},this.aurora.canPlay={},this.flash.canPlay={},n.each(this.formats,function(t,r){i.html.canPlay[r]=i.html[i.format[r].media].available&&""!==i.htmlElement[i.format[r].media].canPlayType(i.format[r].codec);i.aurora.canPlay[r]=n.inArray(r,i.aurora.formats)>-1;i.flash.canPlay[r]=i.format[r].flashCanPlay&&i.flash.available}),this.html.desired=!1,this.aurora.desired=!1,this.flash.desired=!1,n.each(this.solutions,function(t,r){if(0===t)i[r].desired=!0;else{var u=!1,f=!1;n.each(i.formats,function(n,t){i[i.solutions[0]].canPlay[t]&&("video"===i.format[t].media?f=!0:u=!0)});i[r].desired=i.require.audio&&!u||i.require.video&&!f}}),this.html.support={},this.aurora.support={},this.flash.support={},n.each(this.formats,function(n,t){i.html.support[t]=i.html.canPlay[t]&&i.html.desired;i.aurora.support[t]=i.aurora.canPlay[t]&&i.aurora.desired;i.flash.support[t]=i.flash.canPlay[t]&&i.flash.desired}),this.html.used=!1,this.aurora.used=!1,this.flash.used=!1,n.each(this.solutions,function(t,r){n.each(i.formats,function(n,t){if(i[r].support[t])return(i[r].used=!0,!1)})}),this._resetActive(),this._resetGate(),this._cssSelectorAncestor(this.options.cssSelectorAncestor),this.html.used||this.aurora.used||this.flash.used?this.css.jq.noSolution.length&&this.css.jq.noSolution.hide():(this._error({type:n.jPlayer.error.NO_SOLUTION,context:"{solution:'"+this.options.solution+"', supplied:'"+this.options.supplied+"'}",message:n.jPlayer.errorMsg.NO_SOLUTION,hint:n.jPlayer.errorHint.NO_SOLUTION}),this.css.jq.noSolution.length&&this.css.jq.noSolution.show()),this.flash.used){if(e="jQuery="+encodeURI(this.options.noConflict)+"&id="+encodeURI(this.internal.self.id)+"&vol="+this.options.volume+"&muted="+this.options.muted,n.jPlayer.browser.msie&&(Number(n.jPlayer.browser.version)<9||n.jPlayer.browser.documentMode<9))for(s='<object id="'+this.internal.flash.id+'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="0" height="0" tabindex="-1"><\/object>',o=['<param name="movie" value="'+this.internal.flash.swf+'" />','<param name="FlashVars" value="'+e+'" />','<param name="allowScriptAccess" value="always" />','<param name="bgcolor" value="'+this.options.backgroundColor+'" />','<param name="wmode" value="'+this.options.wmode+'" />'],r=document.createElement(s),f=0;f<o.length;f++)r.appendChild(document.createElement(o[f]));else u=function(n,t,i){var r=document.createElement("param");r.setAttribute("name",t);r.setAttribute("value",i);n.appendChild(r)},r=document.createElement("object"),r.setAttribute("id",this.internal.flash.id),r.setAttribute("name",this.internal.flash.id),r.setAttribute("data",this.internal.flash.swf),r.setAttribute("type","application/x-shockwave-flash"),r.setAttribute("width","1"),r.setAttribute("height","1"),r.setAttribute("tabindex","-1"),u(r,"flashvars",e),u(r,"allowscriptaccess","always"),u(r,"bgcolor",this.options.backgroundColor),u(r,"wmode",this.options.wmode);this.element.append(r);this.internal.flash.jq=n(r)}this.status.playbackRateEnabled=this.html.used&&!this.flash.used?this._testPlaybackRate("audio"):!1;this._updatePlaybackRate();this.html.used&&(this.html.audio.available&&(this._addHtmlEventListeners(this.htmlElement.audio,this.html.audio),this.element.append(this.htmlElement.audio),this.internal.audio.jq=n("#"+this.internal.audio.id)),this.html.video.available&&(this._addHtmlEventListeners(this.htmlElement.video,this.html.video),this.element.append(this.htmlElement.video),this.internal.video.jq=n("#"+this.internal.video.id),this.internal.video.jq.css(this.status.nativeVideoControls?{width:this.status.width,height:this.status.height}:{width:"0px",height:"0px"}),this.internal.video.jq.bind("click.jPlayer",function(){i._trigger(n.jPlayer.event.click)})));this.aurora.used;this.options.emulateHtml&&this._emulateHtmlBridge();!this.html.used&&!this.aurora.used||this.flash.used||setTimeout(function(){i.internal.ready=!0;i.version.flash="n/a";i._trigger(n.jPlayer.event.repeat);i._trigger(n.jPlayer.event.ready)},100);this._updateNativeVideoControls();this.css.jq.videoPlay.length&&this.css.jq.videoPlay.hide();n.jPlayer.prototype.count++},destroy:function(){this.clearMedia();this._removeUiClass();this.css.jq.currentTime.length&&this.css.jq.currentTime.text("");this.css.jq.duration.length&&this.css.jq.duration.text("");n.each(this.css.jq,function(n,t){t.length&&t.unbind(".jPlayer")});this.internal.poster.jq.unbind(".jPlayer");this.internal.video.jq&&this.internal.video.jq.unbind(".jPlayer");this._fullscreenRemoveEventListeners();this===n.jPlayer.focus&&(n.jPlayer.focus=null);this.options.emulateHtml&&this._destroyHtmlBridge();this.element.removeData("jPlayer");this.element.unbind(".jPlayer");this.element.empty();delete this.instances[this.internal.instance]},destroyRemoved:function(){var t=this;n.each(this.instances,function(n,i){t.element!==i&&(i.data("jPlayer")||(i.jPlayer("destroy"),delete t.instances[n]))})},enable:function(){},disable:function(){},_testCanPlayType:function(n){try{return n.canPlayType(this.format.mp3.codec),!0}catch(t){return!1}},_testPlaybackRate:function(n){var t,i=.5;n="string"==typeof n?n:"audio";t=document.createElement(n);try{return"playbackRate"in t?(t.playbackRate=i,t.playbackRate===i):!1}catch(r){return!1}},_uaBlocklist:function(t){var r=navigator.userAgent.toLowerCase(),i=!1;return n.each(t,function(n,t){if(t&&t.test(r))return(i=!0,!1)}),i},_restrictNativeVideoControls:function(){this.require.audio&&this.status.nativeVideoControls&&(this.status.nativeVideoControls=!1,this.status.noFullWindow=!0)},_updateNativeVideoControls:function(){this.html.video.available&&this.html.used&&(this.htmlElement.video.controls=this.status.nativeVideoControls,this._updateAutohide(),this.status.nativeVideoControls&&this.require.video?(this.internal.poster.jq.hide(),this.internal.video.jq.css({width:this.status.width,height:this.status.height})):this.status.waitForPlay&&this.status.video&&(this.internal.poster.jq.show(),this.internal.video.jq.css({width:"0px",height:"0px"})))},_addHtmlEventListeners:function(t,i){var r=this;t.preload=this.options.preload;t.muted=this.options.muted;t.volume=this.options.volume;this.status.playbackRateEnabled&&(t.defaultPlaybackRate=this.options.defaultPlaybackRate,t.playbackRate=this.options.playbackRate);t.addEventListener("progress",function(){i.gate&&(r.internal.cmdsIgnored&&this.readyState>0&&(r.internal.cmdsIgnored=!1),r._getHtmlStatus(t),r._updateInterface(),r._trigger(n.jPlayer.event.progress))},!1);t.addEventListener("loadeddata",function(){i.gate&&(r.androidFix.setMedia=!1,r.androidFix.play&&(r.androidFix.play=!1,r.play(r.androidFix.time)),r.androidFix.pause&&(r.androidFix.pause=!1,r.pause(r.androidFix.time)),r._trigger(n.jPlayer.event.loadeddata))},!1);t.addEventListener("timeupdate",function(){i.gate&&(r._getHtmlStatus(t),r._updateInterface(),r._trigger(n.jPlayer.event.timeupdate))},!1);t.addEventListener("durationchange",function(){i.gate&&(r._getHtmlStatus(t),r._updateInterface(),r._trigger(n.jPlayer.event.durationchange))},!1);t.addEventListener("play",function(){i.gate&&(r._updateButtons(!0),r._html_checkWaitForPlay(),r._trigger(n.jPlayer.event.play))},!1);t.addEventListener("playing",function(){i.gate&&(r._updateButtons(!0),r._seeked(),r._trigger(n.jPlayer.event.playing))},!1);t.addEventListener("pause",function(){i.gate&&(r._updateButtons(!1),r._trigger(n.jPlayer.event.pause))},!1);t.addEventListener("waiting",function(){i.gate&&(r._seeking(),r._trigger(n.jPlayer.event.waiting))},!1);t.addEventListener("seeking",function(){i.gate&&(r._seeking(),r._trigger(n.jPlayer.event.seeking))},!1);t.addEventListener("seeked",function(){i.gate&&(r._seeked(),r._trigger(n.jPlayer.event.seeked))},!1);t.addEventListener("volumechange",function(){i.gate&&(r.options.volume=t.volume,r.options.muted=t.muted,r._updateMute(),r._updateVolume(),r._trigger(n.jPlayer.event.volumechange))},!1);t.addEventListener("ratechange",function(){i.gate&&(r.options.defaultPlaybackRate=t.defaultPlaybackRate,r.options.playbackRate=t.playbackRate,r._updatePlaybackRate(),r._trigger(n.jPlayer.event.ratechange))},!1);t.addEventListener("suspend",function(){i.gate&&(r._seeked(),r._trigger(n.jPlayer.event.suspend))},!1);t.addEventListener("ended",function(){i.gate&&(n.jPlayer.browser.webkit||(r.htmlElement.media.currentTime=0),r.htmlElement.media.pause(),r._updateButtons(!1),r._getHtmlStatus(t,!0),r._updateInterface(),r._trigger(n.jPlayer.event.ended))},!1);t.addEventListener("error",function(){i.gate&&(r._updateButtons(!1),r._seeked(),r.status.srcSet&&(clearTimeout(r.internal.htmlDlyCmdId),r.status.waitForLoad=!0,r.status.waitForPlay=!0,r.status.video&&!r.status.nativeVideoControls&&r.internal.video.jq.css({width:"0px",height:"0px"}),r._validString(r.status.media.poster)&&!r.status.nativeVideoControls&&r.internal.poster.jq.show(),r.css.jq.videoPlay.length&&r.css.jq.videoPlay.show(),r._error({type:n.jPlayer.error.URL,context:r.status.src,message:n.jPlayer.errorMsg.URL,hint:n.jPlayer.errorHint.URL})))},!1);n.each(n.jPlayer.htmlEvent,function(u,f){t.addEventListener(this,function(){i.gate&&r._trigger(n.jPlayer.event[f])},!1)})},_addAuroraEventListeners:function(t,i){var r=this;t.volume=100*this.options.volume;t.on("progress",function(){i.gate&&(r.internal.cmdsIgnored&&this.readyState>0&&(r.internal.cmdsIgnored=!1),r._getAuroraStatus(t),r._updateInterface(),r._trigger(n.jPlayer.event.progress),t.duration>0&&r._trigger(n.jPlayer.event.timeupdate))},!1);t.on("ready",function(){i.gate&&r._trigger(n.jPlayer.event.loadeddata)},!1);t.on("duration",function(){i.gate&&(r._getAuroraStatus(t),r._updateInterface(),r._trigger(n.jPlayer.event.durationchange))},!1);t.on("end",function(){i.gate&&(r._updateButtons(!1),r._getAuroraStatus(t,!0),r._updateInterface(),r._trigger(n.jPlayer.event.ended))},!1);t.on("error",function(){i.gate&&(r._updateButtons(!1),r._seeked(),r.status.srcSet&&(r.status.waitForLoad=!0,r.status.waitForPlay=!0,r.status.video&&!r.status.nativeVideoControls&&r.internal.video.jq.css({width:"0px",height:"0px"}),r._validString(r.status.media.poster)&&!r.status.nativeVideoControls&&r.internal.poster.jq.show(),r.css.jq.videoPlay.length&&r.css.jq.videoPlay.show(),r._error({type:n.jPlayer.error.URL,context:r.status.src,message:n.jPlayer.errorMsg.URL,hint:n.jPlayer.errorHint.URL})))},!1)},_getHtmlStatus:function(n,t){var i=0,r=0,f=0,u=0;isFinite(n.duration)&&(this.status.duration=n.duration);i=n.currentTime;r=this.status.duration>0?100*i/this.status.duration:0;"object"==typeof n.seekable&&n.seekable.length>0?(f=this.status.duration>0?100*n.seekable.end(n.seekable.length-1)/this.status.duration:100,u=this.status.duration>0?100*n.currentTime/n.seekable.end(n.seekable.length-1):0):(f=100,u=r);t&&(i=0,u=0,r=0);this.status.seekPercent=f;this.status.currentPercentRelative=u;this.status.currentPercentAbsolute=r;this.status.currentTime=i;this.status.remaining=this.status.duration-this.status.currentTime;this.status.videoWidth=n.videoWidth;this.status.videoHeight=n.videoHeight;this.status.readyState=n.readyState;this.status.networkState=n.networkState;this.status.playbackRate=n.playbackRate;this.status.ended=n.ended},_getAuroraStatus:function(n,t){var i=0,r=0,f=0,u=0;this.status.duration=n.duration/1e3;i=n.currentTime/1e3;r=this.status.duration>0?100*i/this.status.duration:0;n.buffered>0?(f=this.status.duration>0?n.buffered*this.status.duration/this.status.duration:100,u=this.status.duration>0?i/(n.buffered*this.status.duration):0):(f=100,u=r);t&&(i=0,u=0,r=0);this.status.seekPercent=f;this.status.currentPercentRelative=u;this.status.currentPercentAbsolute=r;this.status.currentTime=i;this.status.remaining=this.status.duration-this.status.currentTime;this.status.readyState=4;this.status.networkState=0;this.status.playbackRate=1;this.status.ended=!1},_resetStatus:function(){this.status=n.extend({},this.status,n.jPlayer.prototype.status)},_trigger:function(t,i,r){var u=n.Event(t);u.jPlayer={};u.jPlayer.version=n.extend({},this.version);u.jPlayer.options=n.extend(!0,{},this.options);u.jPlayer.status=n.extend(!0,{},this.status);u.jPlayer.html=n.extend(!0,{},this.html);u.jPlayer.aurora=n.extend(!0,{},this.aurora);u.jPlayer.flash=n.extend(!0,{},this.flash);i&&(u.jPlayer.error=n.extend({},i));r&&(u.jPlayer.warning=n.extend({},r));this.element.trigger(u)},jPlayerFlashEvent:function(t,i){if(t===n.jPlayer.event.ready)if(this.internal.ready){if(this.flash.gate){if(this.status.srcSet){var r=this.status.currentTime,u=this.status.paused;this.setMedia(this.status.media);this.volumeWorker(this.options.volume);r>0&&(u?this.pause(r):this.play(r))}this._trigger(n.jPlayer.event.flashreset)}}else this.internal.ready=!0,this.internal.flash.jq.css({width:"0px",height:"0px"}),this.version.flash=i.version,this.version.needFlash!==this.version.flash&&this._error({type:n.jPlayer.error.VERSION,context:this.version.flash,message:n.jPlayer.errorMsg.VERSION+this.version.flash,hint:n.jPlayer.errorHint.VERSION}),this._trigger(n.jPlayer.event.repeat),this._trigger(t);if(this.flash.gate)switch(t){case n.jPlayer.event.progress:this._getFlashStatus(i);this._updateInterface();this._trigger(t);break;case n.jPlayer.event.timeupdate:this._getFlashStatus(i);this._updateInterface();this._trigger(t);break;case n.jPlayer.event.play:this._seeked();this._updateButtons(!0);this._trigger(t);break;case n.jPlayer.event.pause:this._updateButtons(!1);this._trigger(t);break;case n.jPlayer.event.ended:this._updateButtons(!1);this._trigger(t);break;case n.jPlayer.event.click:this._trigger(t);break;case n.jPlayer.event.error:this.status.waitForLoad=!0;this.status.waitForPlay=!0;this.status.video&&this.internal.flash.jq.css({width:"0px",height:"0px"});this._validString(this.status.media.poster)&&this.internal.poster.jq.show();this.css.jq.videoPlay.length&&this.status.video&&this.css.jq.videoPlay.show();this.status.video?this._flash_setVideo(this.status.media):this._flash_setAudio(this.status.media);this._updateButtons(!1);this._error({type:n.jPlayer.error.URL,context:i.src,message:n.jPlayer.errorMsg.URL,hint:n.jPlayer.errorHint.URL});break;case n.jPlayer.event.seeking:this._seeking();this._trigger(t);break;case n.jPlayer.event.seeked:this._seeked();this._trigger(t);break;case n.jPlayer.event.ready:break;default:this._trigger(t)}return!1},_getFlashStatus:function(n){this.status.seekPercent=n.seekPercent;this.status.currentPercentRelative=n.currentPercentRelative;this.status.currentPercentAbsolute=n.currentPercentAbsolute;this.status.currentTime=n.currentTime;this.status.duration=n.duration;this.status.remaining=n.duration-n.currentTime;this.status.videoWidth=n.videoWidth;this.status.videoHeight=n.videoHeight;this.status.readyState=4;this.status.networkState=0;this.status.playbackRate=1;this.status.ended=!1},_updateButtons:function(n){n===t?n=!this.status.paused:this.status.paused=!n;n?this.addStateClass("playing"):this.removeStateClass("playing");!this.status.noFullWindow&&this.options.fullWindow?this.addStateClass("fullScreen"):this.removeStateClass("fullScreen");this.options.loop?this.addStateClass("looped"):this.removeStateClass("looped");this.css.jq.play.length&&this.css.jq.pause.length&&(n?(this.css.jq.play.hide(),this.css.jq.pause.show()):(this.css.jq.play.show(),this.css.jq.pause.hide()));this.css.jq.restoreScreen.length&&this.css.jq.fullScreen.length&&(this.status.noFullWindow?(this.css.jq.fullScreen.hide(),this.css.jq.restoreScreen.hide()):this.options.fullWindow?(this.css.jq.fullScreen.hide(),this.css.jq.restoreScreen.show()):(this.css.jq.fullScreen.show(),this.css.jq.restoreScreen.hide()));this.css.jq.repeat.length&&this.css.jq.repeatOff.length&&(this.options.loop?(this.css.jq.repeat.hide(),this.css.jq.repeatOff.show()):(this.css.jq.repeat.show(),this.css.jq.repeatOff.hide()))},_updateInterface:function(){var t;this.css.jq.seekBar.length&&this.css.jq.seekBar.width(this.status.seekPercent+"%");this.css.jq.playBar.length&&(this.options.smoothPlayBar?this.css.jq.playBar.stop().animate({width:this.status.currentPercentAbsolute+"%"},250,"linear"):this.css.jq.playBar.width(this.status.currentPercentRelative+"%"));t="";this.css.jq.currentTime.length&&(t=this._convertTime(this.status.currentTime),t!==this.css.jq.currentTime.text()&&this.css.jq.currentTime.text(this._convertTime(this.status.currentTime)));var n="",i=this.status.duration,r=this.status.remaining;this.css.jq.duration.length&&("string"==typeof this.status.media.duration?n=this.status.media.duration:("number"==typeof this.status.media.duration&&(i=this.status.media.duration,r=i-this.status.currentTime),n=this.options.remainingDuration?(r>0?"-":"")+this._convertTime(r):this._convertTime(i)),n!==this.css.jq.duration.text()&&this.css.jq.duration.text(n))},_convertTime:r.prototype.time,_seeking:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.addClass("jp-seeking-bg");this.addStateClass("seeking")},_seeked:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.removeClass("jp-seeking-bg");this.removeStateClass("seeking")},_resetGate:function(){this.html.audio.gate=!1;this.html.video.gate=!1;this.aurora.gate=!1;this.flash.gate=!1},_resetActive:function(){this.html.active=!1;this.aurora.active=!1;this.flash.active=!1},_escapeHtml:function(n){return n.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;").split('"').join("&quot;")},_qualifyURL:function(n){var t=document.createElement("div");return t.innerHTML='<a href="'+this._escapeHtml(n)+'">x<\/a>',t.firstChild.href},_absoluteMediaUrls:function(t){var i=this;return n.each(t,function(n,r){r&&i.format[n]&&"data:"!==r.substr(0,5)&&(t[n]=i._qualifyURL(r))}),t},addStateClass:function(n){this.ancestorJq.length&&this.ancestorJq.addClass(this.options.stateClass[n])},removeStateClass:function(n){this.ancestorJq.length&&this.ancestorJq.removeClass(this.options.stateClass[n])},setMedia:function(t){var i=this,r=!1,u=this.status.media.poster!==t.poster;this._resetMedia();this._resetGate();this._resetActive();this.androidFix.setMedia=!1;this.androidFix.play=!1;this.androidFix.pause=!1;t=this._absoluteMediaUrls(t);n.each(this.formats,function(u,f){var e="video"===i.format[f].media;return n.each(i.solutions,function(u,o){if(i[o].support[f]&&i._validString(t[f])){var s="html"===o,h="aurora"===o;return e?(s?(i.html.video.gate=!0,i._html_setVideo(t),i.html.active=!0):(i.flash.gate=!0,i._flash_setVideo(t),i.flash.active=!0),i.css.jq.videoPlay.length&&i.css.jq.videoPlay.show(),i.status.video=!0):(s?(i.html.audio.gate=!0,i._html_setAudio(t),i.html.active=!0,n.jPlayer.platform.android&&(i.androidFix.setMedia=!0)):h?(i.aurora.gate=!0,i._aurora_setAudio(t),i.aurora.active=!0):(i.flash.gate=!0,i._flash_setAudio(t),i.flash.active=!0),i.css.jq.videoPlay.length&&i.css.jq.videoPlay.hide(),i.status.video=!1),r=!0,!1}}),r?!1:void 0});r?(this.status.nativeVideoControls&&this.html.video.gate||this._validString(t.poster)&&(u?this.htmlElement.poster.src=t.poster:this.internal.poster.jq.show()),"string"==typeof t.title&&(this.css.jq.title.length&&this.css.jq.title.html(t.title),this.htmlElement.audio&&this.htmlElement.audio.setAttribute("title",t.title),this.htmlElement.video&&this.htmlElement.video.setAttribute("title",t.title)),this.status.srcSet=!0,this.status.media=n.extend({},t),this._updateButtons(!1),this._updateInterface(),this._trigger(n.jPlayer.event.setmedia)):this._error({type:n.jPlayer.error.NO_SUPPORT,context:"{supplied:'"+this.options.supplied+"'}",message:n.jPlayer.errorMsg.NO_SUPPORT,hint:n.jPlayer.errorHint.NO_SUPPORT})},_resetMedia:function(){this._resetStatus();this._updateButtons(!1);this._updateInterface();this._seeked();this.internal.poster.jq.hide();clearTimeout(this.internal.htmlDlyCmdId);this.html.active?this._html_resetMedia():this.aurora.active?this._aurora_resetMedia():this.flash.active&&this._flash_resetMedia()},clearMedia:function(){this._resetMedia();this.html.active?this._html_clearMedia():this.aurora.active?this._aurora_clearMedia():this.flash.active&&this._flash_clearMedia();this._resetGate();this._resetActive()},load:function(){this.status.srcSet?this.html.active?this._html_load():this.aurora.active?this._aurora_load():this.flash.active&&this._flash_load():this._urlNotSetError("load")},focus:function(){this.options.keyEnabled&&(n.jPlayer.focus=this)},play:function(n){var t="object"==typeof n;t&&this.options.useStateClassSkin&&!this.status.paused?this.pause(n):(n="number"==typeof n?n:NaN,this.status.srcSet?(this.focus(),this.html.active?this._html_play(n):this.aurora.active?this._aurora_play(n):this.flash.active&&this._flash_play(n)):this._urlNotSetError("play"))},videoPlay:function(){this.play()},pause:function(n){n="number"==typeof n?n:NaN;this.status.srcSet?this.html.active?this._html_pause(n):this.aurora.active?this._aurora_pause(n):this.flash.active&&this._flash_pause(n):this._urlNotSetError("pause")},tellOthers:function(t,i){var r=this,u="function"==typeof i,f=Array.prototype.slice.call(arguments);"string"==typeof t&&(u&&f.splice(1,1),n.jPlayer.prototype.destroyRemoved(),n.each(this.instances,function(){r.element!==this&&(!u||i.call(this.data("jPlayer"),r))&&this.jPlayer.apply(this,f)}))},pauseOthers:function(n){this.tellOthers("pause",function(){return this.status.srcSet},n)},stop:function(){this.status.srcSet?this.html.active?this._html_pause(0):this.aurora.active?this._aurora_pause(0):this.flash.active&&this._flash_pause(0):this._urlNotSetError("stop")},playHead:function(n){n=this._limitValue(n,0,100);this.status.srcSet?this.html.active?this._html_playHead(n):this.aurora.active?this._aurora_playHead(n):this.flash.active&&this._flash_playHead(n):this._urlNotSetError("playHead")},_muted:function(n){this.mutedWorker(n);this.options.globalVolume&&this.tellOthers("mutedWorker",function(){return this.options.globalVolume},n)},mutedWorker:function(t){this.options.muted=t;this.html.used&&this._html_setProperty("muted",t);this.aurora.used&&this._aurora_mute(t);this.flash.used&&this._flash_mute(t);this.html.video.gate||this.html.audio.gate||(this._updateMute(t),this._updateVolume(this.options.volume),this._trigger(n.jPlayer.event.volumechange))},mute:function(n){var i="object"==typeof n;i&&this.options.useStateClassSkin&&this.options.muted?this._muted(!1):(n=n===t?!0:!!n,this._muted(n))},unmute:function(n){n=n===t?!0:!!n;this._muted(!n)},_updateMute:function(n){n===t&&(n=this.options.muted);n?this.addStateClass("muted"):this.removeStateClass("muted");this.css.jq.mute.length&&this.css.jq.unmute.length&&(this.status.noVolume?(this.css.jq.mute.hide(),this.css.jq.unmute.hide()):n?(this.css.jq.mute.hide(),this.css.jq.unmute.show()):(this.css.jq.mute.show(),this.css.jq.unmute.hide()))},volume:function(n){this.volumeWorker(n);this.options.globalVolume&&this.tellOthers("volumeWorker",function(){return this.options.globalVolume},n)},volumeWorker:function(t){t=this._limitValue(t,0,1);this.options.volume=t;this.html.used&&this._html_setProperty("volume",t);this.aurora.used&&this._aurora_volume(t);this.flash.used&&this._flash_volume(t);this.html.video.gate||this.html.audio.gate||(this._updateVolume(t),this._trigger(n.jPlayer.event.volumechange))},volumeBar:function(t){if(this.css.jq.volumeBar.length){var i=n(t.currentTarget),r=i.offset(),u=t.pageX-r.left,f=i.width(),e=i.height()-t.pageY+r.top,o=i.height();this.volume(this.options.verticalVolume?e/o:u/f)}this.options.muted&&this._muted(!1)},_updateVolume:function(n){n===t&&(n=this.options.volume);n=this.options.muted?0:n;this.status.noVolume?(this.addStateClass("noVolume"),this.css.jq.volumeBar.length&&this.css.jq.volumeBar.hide(),this.css.jq.volumeBarValue.length&&this.css.jq.volumeBarValue.hide(),this.css.jq.volumeMax.length&&this.css.jq.volumeMax.hide()):(this.removeStateClass("noVolume"),this.css.jq.volumeBar.length&&this.css.jq.volumeBar.show(),this.css.jq.volumeBarValue.length&&(this.css.jq.volumeBarValue.show(),this.css.jq.volumeBarValue[this.options.verticalVolume?"height":"width"](100*n+"%")),this.css.jq.volumeMax.length&&this.css.jq.volumeMax.show())},volumeMax:function(){this.volume(1);this.options.muted&&this._muted(!1)},_cssSelectorAncestor:function(t){var i=this;this.options.cssSelectorAncestor=t;this._removeUiClass();this.ancestorJq=t?n(t):[];t&&1!==this.ancestorJq.length&&this._warning({type:n.jPlayer.warning.CSS_SELECTOR_COUNT,context:t,message:n.jPlayer.warningMsg.CSS_SELECTOR_COUNT+this.ancestorJq.length+" found for cssSelectorAncestor.",hint:n.jPlayer.warningHint.CSS_SELECTOR_COUNT});this._addUiClass();n.each(this.options.cssSelector,function(n,t){i._cssSelector(n,t)});this._updateInterface();this._updateButtons();this._updateAutohide();this._updateVolume();this._updateMute()},_cssSelector:function(t,i){var r=this,u;"string"==typeof i?n.jPlayer.prototype.options.cssSelector[t]?((this.css.jq[t]&&this.css.jq[t].length&&this.css.jq[t].unbind(".jPlayer"),this.options.cssSelector[t]=i,this.css.cs[t]=this.options.cssSelectorAncestor+" "+i,this.css.jq[t]=i?n(this.css.cs[t]):[],this.css.jq[t].length&&this[t])&&(u=function(i){i.preventDefault();r[t](i);r.options.autoBlur?n(this).blur():n(this).focus()},this.css.jq[t].bind("click.jPlayer",u)),i&&1!==this.css.jq[t].length&&this._warning({type:n.jPlayer.warning.CSS_SELECTOR_COUNT,context:this.css.cs[t],message:n.jPlayer.warningMsg.CSS_SELECTOR_COUNT+this.css.jq[t].length+" found for "+t+" method.",hint:n.jPlayer.warningHint.CSS_SELECTOR_COUNT})):this._warning({type:n.jPlayer.warning.CSS_SELECTOR_METHOD,context:t,message:n.jPlayer.warningMsg.CSS_SELECTOR_METHOD,hint:n.jPlayer.warningHint.CSS_SELECTOR_METHOD}):this._warning({type:n.jPlayer.warning.CSS_SELECTOR_STRING,context:i,message:n.jPlayer.warningMsg.CSS_SELECTOR_STRING,hint:n.jPlayer.warningHint.CSS_SELECTOR_STRING})},duration:function(n){this.options.toggleDuration&&(this.options.captureDuration&&n.stopPropagation(),this._setOption("remainingDuration",!this.options.remainingDuration))},seekBar:function(t){if(this.css.jq.seekBar.length){var i=n(t.currentTarget),r=i.offset(),u=t.pageX-r.left,f=i.width(),e=100*u/f;this.playHead(e)}},playbackRate:function(n){this._setOption("playbackRate",n)},playbackRateBar:function(t){if(this.css.jq.playbackRateBar.length){var r,u,i=n(t.currentTarget),f=i.offset(),e=t.pageX-f.left,o=i.width(),s=i.height()-t.pageY+f.top,h=i.height();r=this.options.verticalPlaybackRate?s/h:e/o;u=r*(this.options.maxPlaybackRate-this.options.minPlaybackRate)+this.options.minPlaybackRate;this.playbackRate(u)}},_updatePlaybackRate:function(){var n=this.options.playbackRate,t=(n-this.options.minPlaybackRate)/(this.options.maxPlaybackRate-this.options.minPlaybackRate);this.status.playbackRateEnabled?(this.css.jq.playbackRateBar.length&&this.css.jq.playbackRateBar.show(),this.css.jq.playbackRateBarValue.length&&(this.css.jq.playbackRateBarValue.show(),this.css.jq.playbackRateBarValue[this.options.verticalPlaybackRate?"height":"width"](100*t+"%"))):(this.css.jq.playbackRateBar.length&&this.css.jq.playbackRateBar.hide(),this.css.jq.playbackRateBarValue.length&&this.css.jq.playbackRateBarValue.hide())},repeat:function(n){var t="object"==typeof n;this._loop(t&&this.options.useStateClassSkin&&this.options.loop?!1:!0)},repeatOff:function(){this._loop(!1)},_loop:function(t){this.options.loop!==t&&(this.options.loop=t,this._updateButtons(),this._trigger(n.jPlayer.event.repeat))},option:function(i,r){var h=i,u,e,o,s,f;if(0===arguments.length)return n.extend(!0,{},this.options);if("string"==typeof i){if(u=i.split("."),r===t){for(e=n.extend(!0,{},this.options),o=0;o<u.length;o++){if(e[u[o]]===t)return this._warning({type:n.jPlayer.warning.OPTION_KEY,context:i,message:n.jPlayer.warningMsg.OPTION_KEY,hint:n.jPlayer.warningHint.OPTION_KEY}),t;e=e[u[o]]}return e}for(h={},s=h,f=0;f<u.length;f++)f<u.length-1?(s[u[f]]={},s=s[u[f]]):s[u[f]]=r}return this._setOptions(h),this},_setOptions:function(t){var i=this;return n.each(t,function(n,t){i._setOption(n,t)}),this},_setOption:function(t,i){var u=this,r;switch(t){case"volume":this.volume(i);break;case"muted":this._muted(i);break;case"globalVolume":this.options[t]=i;break;case"cssSelectorAncestor":this._cssSelectorAncestor(i);break;case"cssSelector":n.each(i,function(n,t){u._cssSelector(n,t)});break;case"playbackRate":this.options[t]=i=this._limitValue(i,this.options.minPlaybackRate,this.options.maxPlaybackRate);this.html.used&&this._html_setProperty("playbackRate",i);this._updatePlaybackRate();break;case"defaultPlaybackRate":this.options[t]=i=this._limitValue(i,this.options.minPlaybackRate,this.options.maxPlaybackRate);this.html.used&&this._html_setProperty("defaultPlaybackRate",i);this._updatePlaybackRate();break;case"minPlaybackRate":this.options[t]=i=this._limitValue(i,.1,this.options.maxPlaybackRate-.1);this._updatePlaybackRate();break;case"maxPlaybackRate":this.options[t]=i=this._limitValue(i,this.options.minPlaybackRate+.1,16);this._updatePlaybackRate();break;case"fullScreen":this.options[t]!==i&&(r=n.jPlayer.nativeFeatures.fullscreen.used.webkitVideo,r&&(!r||this.status.waitForPlay)||(r||(this.options[t]=i),i?this._requestFullscreen():this._exitFullscreen(),r||this._setOption("fullWindow",i)));break;case"fullWindow":this.options[t]!==i&&(this._removeUiClass(),this.options[t]=i,this._refreshSize());break;case"size":this.options.fullWindow||this.options[t].cssClass===i.cssClass||this._removeUiClass();this.options[t]=n.extend({},this.options[t],i);this._refreshSize();break;case"sizeFull":this.options.fullWindow&&this.options[t].cssClass!==i.cssClass&&this._removeUiClass();this.options[t]=n.extend({},this.options[t],i);this._refreshSize();break;case"autohide":this.options[t]=n.extend({},this.options[t],i);this._updateAutohide();break;case"loop":this._loop(i);break;case"remainingDuration":this.options[t]=i;this._updateInterface();break;case"toggleDuration":this.options[t]=i;break;case"nativeVideoControls":this.options[t]=n.extend({},this.options[t],i);this.status.nativeVideoControls=this._uaBlocklist(this.options.nativeVideoControls);this._restrictNativeVideoControls();this._updateNativeVideoControls();break;case"noFullWindow":this.options[t]=n.extend({},this.options[t],i);this.status.nativeVideoControls=this._uaBlocklist(this.options.nativeVideoControls);this.status.noFullWindow=this._uaBlocklist(this.options.noFullWindow);this._restrictNativeVideoControls();this._updateButtons();break;case"noVolume":this.options[t]=n.extend({},this.options[t],i);this.status.noVolume=this._uaBlocklist(this.options.noVolume);this._updateVolume();this._updateMute();break;case"emulateHtml":this.options[t]!==i&&(this.options[t]=i,i?this._emulateHtmlBridge():this._destroyHtmlBridge());break;case"timeFormat":this.options[t]=n.extend({},this.options[t],i);break;case"keyEnabled":this.options[t]=i;i||this!==n.jPlayer.focus||(n.jPlayer.focus=null);break;case"keyBindings":this.options[t]=n.extend(!0,{},this.options[t],i);break;case"audioFullScreen":this.options[t]=i;break;case"autoBlur":this.options[t]=i}return this},_refreshSize:function(){this._setSize();this._addUiClass();this._updateSize();this._updateButtons();this._updateAutohide();this._trigger(n.jPlayer.event.resize)},_setSize:function(){this.options.fullWindow?(this.status.width=this.options.sizeFull.width,this.status.height=this.options.sizeFull.height,this.status.cssClass=this.options.sizeFull.cssClass):(this.status.width=this.options.size.width,this.status.height=this.options.size.height,this.status.cssClass=this.options.size.cssClass);this.element.css({width:this.status.width,height:this.status.height})},_addUiClass:function(){this.ancestorJq.length&&this.ancestorJq.addClass(this.status.cssClass)},_removeUiClass:function(){this.ancestorJq.length&&this.ancestorJq.removeClass(this.status.cssClass)},_updateSize:function(){this.internal.poster.jq.css({width:this.status.width,height:this.status.height});!this.status.waitForPlay&&this.html.active&&this.status.video||this.html.video.available&&this.html.used&&this.status.nativeVideoControls?this.internal.video.jq.css({width:this.status.width,height:this.status.height}):!this.status.waitForPlay&&this.flash.active&&this.status.video&&this.internal.flash.jq.css({width:this.status.width,height:this.status.height})},_updateAutohide:function(){var n=this,t=".jPlayerAutohide",i="mousemove.jPlayer"+t,r=function(t){var r,u,i=!1;"undefined"!=typeof n.internal.mouse?(r=n.internal.mouse.x-t.pageX,u=n.internal.mouse.y-t.pageY,i=Math.floor(r)>0||Math.floor(u)>0):i=!0;n.internal.mouse={x:t.pageX,y:t.pageY};i&&n.css.jq.gui.fadeIn(n.options.autohide.fadeIn,function(){clearTimeout(n.internal.autohideId);n.internal.autohideId=setTimeout(function(){n.css.jq.gui.fadeOut(n.options.autohide.fadeOut)},n.options.autohide.hold)})};this.css.jq.gui.length&&(this.css.jq.gui.stop(!0,!0),clearTimeout(this.internal.autohideId),delete this.internal.mouse,this.element.unbind(t),this.css.jq.gui.unbind(t),this.status.nativeVideoControls?this.css.jq.gui.hide():this.options.fullWindow&&this.options.autohide.full||!this.options.fullWindow&&this.options.autohide.restored?(this.element.bind(i,r),this.css.jq.gui.bind(i,r),this.css.jq.gui.hide()):this.css.jq.gui.show())},fullScreen:function(n){var t="object"==typeof n;t&&this.options.useStateClassSkin&&this.options.fullScreen?this._setOption("fullScreen",!1):this._setOption("fullScreen",!0)},restoreScreen:function(){this._setOption("fullScreen",!1)},_fullscreenAddEventListeners:function(){var i=this,t=n.jPlayer.nativeFeatures.fullscreen;t.api.fullscreenEnabled&&t.event.fullscreenchange&&("function"!=typeof this.internal.fullscreenchangeHandler&&(this.internal.fullscreenchangeHandler=function(){i._fullscreenchange()}),document.addEventListener(t.event.fullscreenchange,this.internal.fullscreenchangeHandler,!1))},_fullscreenRemoveEventListeners:function(){var t=n.jPlayer.nativeFeatures.fullscreen;this.internal.fullscreenchangeHandler&&document.removeEventListener(t.event.fullscreenchange,this.internal.fullscreenchangeHandler,!1)},_fullscreenchange:function(){this.options.fullScreen&&!n.jPlayer.nativeFeatures.fullscreen.api.fullscreenElement()&&this._setOption("fullScreen",!1)},_requestFullscreen:function(){var i=this.ancestorJq.length?this.ancestorJq[0]:this.element[0],t=n.jPlayer.nativeFeatures.fullscreen;t.used.webkitVideo&&(i=this.htmlElement.video);t.api.fullscreenEnabled&&t.api.requestFullscreen(i)},_exitFullscreen:function(){var i,t=n.jPlayer.nativeFeatures.fullscreen;t.used.webkitVideo&&(i=this.htmlElement.video);t.api.fullscreenEnabled&&t.api.exitFullscreen(i)},_html_initMedia:function(t){var i=n(this.htmlElement.media).empty();n.each(t.track||[],function(n,t){var r=document.createElement("track");r.setAttribute("kind",t.kind?t.kind:"");r.setAttribute("src",t.src?t.src:"");r.setAttribute("srclang",t.srclang?t.srclang:"");r.setAttribute("label",t.label?t.label:"");t.def&&r.setAttribute("default",t.def);i.append(r)});this.htmlElement.media.src=this.status.src;"none"!==this.options.preload&&this._html_load();this._trigger(n.jPlayer.event.timeupdate)},_html_setFormat:function(t){var i=this;n.each(this.formats,function(n,r){if(i.html.support[r]&&t[r])return(i.status.src=t[r],i.status.format[r]=!0,i.status.formatType=r,!1)})},_html_setAudio:function(n){this._html_setFormat(n);this.htmlElement.media=this.htmlElement.audio;this._html_initMedia(n)},_html_setVideo:function(n){this._html_setFormat(n);this.status.nativeVideoControls&&(this.htmlElement.video.poster=this._validString(n.poster)?n.poster:"");this.htmlElement.media=this.htmlElement.video;this._html_initMedia(n)},_html_resetMedia:function(){this.htmlElement.media&&(this.htmlElement.media.id!==this.internal.video.id||this.status.nativeVideoControls||this.internal.video.jq.css({width:"0px",height:"0px"}),this.htmlElement.media.pause())},_html_clearMedia:function(){this.htmlElement.media&&(this.htmlElement.media.src="about:blank",this.htmlElement.media.load())},_html_load:function(){this.status.waitForLoad&&(this.status.waitForLoad=!1,this.htmlElement.media.load());clearTimeout(this.internal.htmlDlyCmdId)},_html_play:function(n){var i=this,t=this.htmlElement.media;if(this.androidFix.pause=!1,this._html_load(),this.androidFix.setMedia)this.androidFix.play=!0,this.androidFix.time=n;else if(isNaN(n))t.play();else{this.internal.cmdsIgnored&&t.play();try{if(t.seekable&&!("object"==typeof t.seekable&&t.seekable.length>0))throw 1;t.currentTime=n;t.play()}catch(r){return void(this.internal.htmlDlyCmdId=setTimeout(function(){i.play(n)},250))}}this._html_checkWaitForPlay()},_html_pause:function(n){var i=this,t=this.htmlElement.media;if(this.androidFix.play=!1,n>0?this._html_load():clearTimeout(this.internal.htmlDlyCmdId),t.pause(),this.androidFix.setMedia)this.androidFix.pause=!0,this.androidFix.time=n;else if(!isNaN(n))try{if(t.seekable&&!("object"==typeof t.seekable&&t.seekable.length>0))throw 1;t.currentTime=n}catch(r){return void(this.internal.htmlDlyCmdId=setTimeout(function(){i.pause(n)},250))}n>0&&this._html_checkWaitForPlay()},_html_playHead:function(n){var i=this,t=this.htmlElement.media;this._html_load();try{if("object"==typeof t.seekable&&t.seekable.length>0)t.currentTime=n*t.seekable.end(t.seekable.length-1)/100;else{if(!(t.duration>0)||isNaN(t.duration))throw"e";t.currentTime=n*t.duration/100}}catch(r){return void(this.internal.htmlDlyCmdId=setTimeout(function(){i.playHead(n)},250))}this.status.waitForLoad||this._html_checkWaitForPlay()},_html_checkWaitForPlay:function(){this.status.waitForPlay&&(this.status.waitForPlay=!1,this.css.jq.videoPlay.length&&this.css.jq.videoPlay.hide(),this.status.video&&(this.internal.poster.jq.hide(),this.internal.video.jq.css({width:this.status.width,height:this.status.height})))},_html_setProperty:function(n,t){this.html.audio.available&&(this.htmlElement.audio[n]=t);this.html.video.available&&(this.htmlElement.video[n]=t)},_aurora_setAudio:function(t){var i=this;n.each(this.formats,function(n,r){if(i.aurora.support[r]&&t[r])return(i.status.src=t[r],i.status.format[r]=!0,i.status.formatType=r,!1)});this.aurora.player=new AV.Player.fromURL(this.status.src);this._addAuroraEventListeners(this.aurora.player,this.aurora);"auto"===this.options.preload&&(this._aurora_load(),this.status.waitForLoad=!1)},_aurora_resetMedia:function(){this.aurora.player&&this.aurora.player.stop()},_aurora_clearMedia:function(){},_aurora_load:function(){this.status.waitForLoad&&(this.status.waitForLoad=!1,this.aurora.player.preload())},_aurora_play:function(t){this.status.waitForLoad||isNaN(t)||this.aurora.player.seek(t);this.aurora.player.playing||this.aurora.player.play();this.status.waitForLoad=!1;this._aurora_checkWaitForPlay();this._updateButtons(!0);this._trigger(n.jPlayer.event.play)},_aurora_pause:function(t){isNaN(t)||this.aurora.player.seek(1e3*t);this.aurora.player.pause();t>0&&this._aurora_checkWaitForPlay();this._updateButtons(!1);this._trigger(n.jPlayer.event.pause)},_aurora_playHead:function(n){this.aurora.player.duration>0&&this.aurora.player.seek(n*this.aurora.player.duration/100);this.status.waitForLoad||this._aurora_checkWaitForPlay()},_aurora_checkWaitForPlay:function(){this.status.waitForPlay&&(this.status.waitForPlay=!1)},_aurora_volume:function(n){this.aurora.player.volume=100*n},_aurora_mute:function(n){n?(this.aurora.properties.lastvolume=this.aurora.player.volume,this.aurora.player.volume=0):this.aurora.player.volume=this.aurora.properties.lastvolume;this.aurora.properties.muted=n},_flash_setAudio:function(t){var i=this;try{n.each(this.formats,function(n,r){if(i.flash.support[r]&&t[r]){switch(r){case"m4a":case"fla":i._getMovie().fl_setAudio_m4a(t[r]);break;case"mp3":i._getMovie().fl_setAudio_mp3(t[r]);break;case"rtmpa":i._getMovie().fl_setAudio_rtmp(t[r])}return i.status.src=t[r],i.status.format[r]=!0,i.status.formatType=r,!1}});"auto"===this.options.preload&&(this._flash_load(),this.status.waitForLoad=!1)}catch(r){this._flashError(r)}},_flash_setVideo:function(t){var i=this;try{n.each(this.formats,function(n,r){if(i.flash.support[r]&&t[r]){switch(r){case"m4v":case"flv":i._getMovie().fl_setVideo_m4v(t[r]);break;case"rtmpv":i._getMovie().fl_setVideo_rtmp(t[r])}return i.status.src=t[r],i.status.format[r]=!0,i.status.formatType=r,!1}});"auto"===this.options.preload&&(this._flash_load(),this.status.waitForLoad=!1)}catch(r){this._flashError(r)}},_flash_resetMedia:function(){this.internal.flash.jq.css({width:"0px",height:"0px"});this._flash_pause(NaN)},_flash_clearMedia:function(){try{this._getMovie().fl_clearMedia()}catch(n){this._flashError(n)}},_flash_load:function(){try{this._getMovie().fl_load()}catch(n){this._flashError(n)}this.status.waitForLoad=!1},_flash_play:function(n){try{this._getMovie().fl_play(n)}catch(t){this._flashError(t)}this.status.waitForLoad=!1;this._flash_checkWaitForPlay()},_flash_pause:function(n){try{this._getMovie().fl_pause(n)}catch(t){this._flashError(t)}n>0&&(this.status.waitForLoad=!1,this._flash_checkWaitForPlay())},_flash_playHead:function(n){try{this._getMovie().fl_play_head(n)}catch(t){this._flashError(t)}this.status.waitForLoad||this._flash_checkWaitForPlay()},_flash_checkWaitForPlay:function(){this.status.waitForPlay&&(this.status.waitForPlay=!1,this.css.jq.videoPlay.length&&this.css.jq.videoPlay.hide(),this.status.video&&(this.internal.poster.jq.hide(),this.internal.flash.jq.css({width:this.status.width,height:this.status.height})))},_flash_volume:function(n){try{this._getMovie().fl_volume(n)}catch(t){this._flashError(t)}},_flash_mute:function(n){try{this._getMovie().fl_mute(n)}catch(t){this._flashError(t)}},_getMovie:function(){return document[this.internal.flash.id]},_getFlashPluginVersion:function(){var t,i=0,n;if(window.ActiveXObject)try{(t=new ActiveXObject("ShockwaveFlash.ShockwaveFlash"))&&(n=t.GetVariable("$version"),n&&(n=n.split(" ")[1].split(","),i=parseInt(n[0],10)+"."+parseInt(n[1],10)))}catch(r){}else navigator.plugins&&navigator.mimeTypes.length>0&&(t=navigator.plugins["Shockwave Flash"],t&&(i=navigator.plugins["Shockwave Flash"].description.replace(/.*\s(\d+\.\d+).*/,"$1")));return 1*i},_checkForFlash:function(n){var t=!1;return this._getFlashPluginVersion()>=n&&(t=!0),t},_validString:function(n){return n&&"string"==typeof n},_limitValue:function(n,t,i){return t>n?t:n>i?i:n},_urlNotSetError:function(t){this._error({type:n.jPlayer.error.URL_NOT_SET,context:t,message:n.jPlayer.errorMsg.URL_NOT_SET,hint:n.jPlayer.errorHint.URL_NOT_SET})},_flashError:function(t){var i;i=this.internal.ready?"FLASH_DISABLED":"FLASH";this._error({type:n.jPlayer.error[i],context:this.internal.flash.swf,message:n.jPlayer.errorMsg[i]+t.message,hint:n.jPlayer.errorHint[i]});this.internal.flash.jq.css({width:"1px",height:"1px"})},_error:function(t){this._trigger(n.jPlayer.event.error,t);this.options.errorAlerts&&this._alert("Error!"+(t.message?"\n"+t.message:"")+(t.hint?"\n"+t.hint:"")+"\nContext: "+t.context)},_warning:function(i){this._trigger(n.jPlayer.event.warning,t,i);this.options.warningAlerts&&this._alert("Warning!"+(i.message?"\n"+i.message:"")+(i.hint?"\n"+i.hint:"")+"\nContext: "+i.context)},_alert:function(n){var t="jPlayer "+this.version.script+" : id='"+this.internal.self.id+"' : "+n;this.options.consoleAlerts?window.console&&window.console.log&&window.console.log(t):alert(t)},_emulateHtmlBridge:function(){var t=this;n.each(n.jPlayer.emulateMethods.split(/\s+/g),function(n,i){t.internal.domNode[i]=function(n){t[i](n)}});n.each(n.jPlayer.event,function(i,r){var u=!0;n.each(n.jPlayer.reservedEvent.split(/\s+/g),function(n,t){if(t===i)return(u=!1,!1)});u&&t.element.bind(r+".jPlayer.jPlayerHtml",function(){t._emulateHtmlUpdate();var n=document.createEvent("Event");n.initEvent(i,!1,!0);t.internal.domNode.dispatchEvent(n)})})},_emulateHtmlUpdate:function(){var t=this;n.each(n.jPlayer.emulateStatus.split(/\s+/g),function(n,i){t.internal.domNode[i]=t.status[i]});n.each(n.jPlayer.emulateOptions.split(/\s+/g),function(n,i){t.internal.domNode[i]=t.options[i]})},_destroyHtmlBridge:function(){var i=this,t;this.element.unbind(".jPlayerHtml");t=n.jPlayer.emulateMethods+" "+n.jPlayer.emulateStatus+" "+n.jPlayer.emulateOptions;n.each(t.split(/\s+/g),function(n,t){delete i.internal.domNode[t]})}};n.jPlayer.error={FLASH:"e_flash",FLASH_DISABLED:"e_flash_disabled",NO_SOLUTION:"e_no_solution",NO_SUPPORT:"e_no_support",URL:"e_url",URL_NOT_SET:"e_url_not_set",VERSION:"e_version"};n.jPlayer.errorMsg={FLASH:"jPlayer's Flash fallback is not configured correctly, or a command was issued before the jPlayer Ready event. Details: ",FLASH_DISABLED:"jPlayer's Flash fallback has been disabled by the browser due to the CSS rules you have used. Details: ",NO_SOLUTION:"No solution can be found by jPlayer in this browser. Neither HTML nor Flash can be used.",NO_SUPPORT:"It is not possible to play any media format provided in setMedia() on this browser using your current options.",URL:"Media URL could not be loaded.",URL_NOT_SET:"Attempt to issue media playback commands, while no media url is set.",VERSION:"jPlayer "+n.jPlayer.prototype.version.script+" needs Jplayer.swf version "+n.jPlayer.prototype.version.needFlash+" but found "};n.jPlayer.errorHint={FLASH:"Check your swfPath option and that Jplayer.swf is there.",FLASH_DISABLED:"Check that you have not display:none; the jPlayer entity or any ancestor.",NO_SOLUTION:"Review the jPlayer options: support and supplied.",NO_SUPPORT:"Video or audio formats defined in the supplied option are missing.",URL:"Check media URL is valid.",URL_NOT_SET:"Use setMedia() to set the media URL.",VERSION:"Update jPlayer files."};n.jPlayer.warning={CSS_SELECTOR_COUNT:"e_css_selector_count",CSS_SELECTOR_METHOD:"e_css_selector_method",CSS_SELECTOR_STRING:"e_css_selector_string",OPTION_KEY:"e_option_key"};n.jPlayer.warningMsg={CSS_SELECTOR_COUNT:"The number of css selectors found did not equal one: ",CSS_SELECTOR_METHOD:"The methodName given in jPlayer('cssSelector') is not a valid jPlayer method.",CSS_SELECTOR_STRING:"The methodCssSelector given in jPlayer('cssSelector') is not a String or is empty.",OPTION_KEY:"The option requested in jPlayer('option') is undefined."};n.jPlayer.warningHint={CSS_SELECTOR_COUNT:"Check your css selector and the ancestor.",CSS_SELECTOR_METHOD:"Check your method name.",CSS_SELECTOR_STRING:"Check your css selector is a string.",OPTION_KEY:"Check your option name."}}),function(n,t){jPlayerPlaylist=function(t,i,r){var u=this;this.current=0;this.removing=this.shuffled=this.loop=!1;this.cssSelector=n.extend({},this._cssSelector,t);this.options=n.extend(!0,{keyBindings:{next:{key:39,fn:function(){u.next()}},previous:{key:37,fn:function(){u.previous()}}}},this._options,r);this.playlist=[];this.original=[];this._initPlaylist(i);this.cssSelector.title=this.cssSelector.cssSelectorAncestor+" .jp-title";this.cssSelector.playlist=this.cssSelector.cssSelectorAncestor+" .jp-playlist";this.cssSelector.next=this.cssSelector.cssSelectorAncestor+" .jp-next";this.cssSelector.previous=this.cssSelector.cssSelectorAncestor+" .jp-previous";this.cssSelector.shuffle=this.cssSelector.cssSelectorAncestor+" .jp-shuffle";this.cssSelector.shuffleOff=this.cssSelector.cssSelectorAncestor+" .jp-shuffle-off";this.options.cssSelectorAncestor=this.cssSelector.cssSelectorAncestor;this.options.repeat=function(n){u.loop=n.jPlayer.options.loop};n(this.cssSelector.jPlayer).bind(n.jPlayer.event.ready,function(){u._init()});n(this.cssSelector.jPlayer).bind(n.jPlayer.event.ended,function(){u.next()});n(this.cssSelector.jPlayer).bind(n.jPlayer.event.play,function(){n(this).jPlayer("pauseOthers")});n(this.cssSelector.jPlayer).bind(n.jPlayer.event.resize,function(t){t.jPlayer.options.fullScreen?n(u.cssSelector.title).show():n(u.cssSelector.title).hide()});n(this.cssSelector.previous).click(function(){return u.previous(),n(this).blur(),!1});n(this.cssSelector.next).click(function(){return u.next(),n(this).blur(),!1});n(this.cssSelector.shuffle).click(function(){return u.shuffle(!0),!1});n(this.cssSelector.shuffleOff).click(function(){return u.shuffle(!1),!1}).hide();this.options.fullScreen||n(this.cssSelector.title).hide();n(this.cssSelector.playlist+" ul").empty();this._createItemHandlers();n(this.cssSelector.jPlayer).jPlayer(this.options)};jPlayerPlaylist.prototype={_cssSelector:{jPlayer:"#jquery_jplayer_1",cssSelectorAncestor:"#jp_container_1"},_options:{playlistOptions:{autoPlay:!1,loopOnPrevious:!1,shuffleOnLoop:!0,enableRemoveControls:!1,displayTime:"slow",addTime:"fast",removeTime:"fast",shuffleTime:"slow",itemClass:"jp-playlist-item",freeGroupClass:"jp-free-media",freeItemClass:"jp-playlist-item-free",removeItemClass:"jp-playlist-item-remove"}},option:function(n,i){if(i===t)return this.options.playlistOptions[n];this.options.playlistOptions[n]=i;switch(n){case"enableRemoveControls":this._updateControls();break;case"itemClass":case"freeGroupClass":case"freeItemClass":case"removeItemClass":this._refresh(!0);this._createItemHandlers()}return this},_init:function(){var n=this;this._refresh(function(){n.options.playlistOptions.autoPlay?n.play(n.current):n.select(n.current)})},_initPlaylist:function(t){this.current=0;this.removing=this.shuffled=!1;this.original=n.extend(!0,[],t);this._originalPlaylist()},_originalPlaylist:function(){var t=this;this.playlist=[];n.each(this.original,function(n){t.playlist[n]=t.original[n]})},_refresh:function(t){var i=this,r;t&&!n.isFunction(t)?(n(this.cssSelector.playlist+" ul").empty(),n.each(this.playlist,function(t){n(i.cssSelector.playlist+" ul").append(i._createListItem(i.playlist[t]))}),this._updateControls()):(r=n(this.cssSelector.playlist+" ul").children().length?this.options.playlistOptions.displayTime:0,n(this.cssSelector.playlist+" ul").slideUp(r,function(){var r=n(this);n(this).empty();n.each(i.playlist,function(n){r.append(i._createListItem(i.playlist[n]))});i._updateControls();n.isFunction(t)&&t();i.playlist.length?n(this).slideDown(i.options.playlistOptions.displayTime):n(this).show()}))},_createListItem:function(t){var u=this,i="<li><div>",i=i+("<a href='javascript:;' class='"+this.options.playlistOptions.removeItemClass+"'>&times;<\/a>"),r;return t.free&&(r=!0,i=i+("<span class='"+this.options.playlistOptions.freeGroupClass+"'>("),n.each(t,function(t,f){n.jPlayer.prototype.format[t]&&(r?r=!1:i+=" | ",i+="<a class='"+u.options.playlistOptions.freeItemClass+"' href='"+f+"' tabindex='1'>"+t+"<\/a>")}),i+=")<\/span>"),i+="<a href='javascript:;' class='"+this.options.playlistOptions.itemClass+"' tabindex='1'>"+t.title+(t.artist?" <span class='jp-artist'>by "+t.artist+"<\/span>":"")+"<\/a>",i+="<\/div><\/li>"},_createItemHandlers:function(){var t=this;n(this.cssSelector.playlist).off("click","a."+this.options.playlistOptions.itemClass).on("click","a."+this.options.playlistOptions.itemClass,function(){var i=n(this).parent().parent().index();return t.current!==i?t.play(i):n(t.cssSelector.jPlayer).jPlayer("play"),n(this).blur(),!1});n(this.cssSelector.playlist).off("click","a."+this.options.playlistOptions.freeItemClass).on("click","a."+this.options.playlistOptions.freeItemClass,function(){return n(this).parent().parent().find("."+t.options.playlistOptions.itemClass).click(),n(this).blur(),!1});n(this.cssSelector.playlist).off("click","a."+this.options.playlistOptions.removeItemClass).on("click","a."+this.options.playlistOptions.removeItemClass,function(){var i=n(this).parent().parent().index();return t.remove(i),n(this).blur(),!1})},_updateControls:function(){this.options.playlistOptions.enableRemoveControls?n(this.cssSelector.playlist+" ."+this.options.playlistOptions.removeItemClass).show():n(this.cssSelector.playlist+" ."+this.options.playlistOptions.removeItemClass).hide();this.shuffled?(n(this.cssSelector.shuffleOff).show(),n(this.cssSelector.shuffle).hide()):(n(this.cssSelector.shuffleOff).hide(),n(this.cssSelector.shuffle).show())},_highlight:function(i){this.playlist.length&&i!==t&&(n(this.cssSelector.playlist+" .jp-playlist-current").removeClass("jp-playlist-current"),n(this.cssSelector.playlist+" li:nth-child("+(i+1)+")").addClass("jp-playlist-current").find(".jp-playlist-item").addClass("jp-playlist-current"),n(this.cssSelector.title+" li").html(this.playlist[i].title+(this.playlist[i].artist?" <span class='jp-artist'>by "+this.playlist[i].artist+"<\/span>":"")))},setPlaylist:function(n){this._initPlaylist(n);this._init()},add:function(t,i){n(this.cssSelector.playlist+" ul").append(this._createListItem(t)).find("li:last-child").hide().slideDown(this.options.playlistOptions.addTime);this._updateControls();this.original.push(t);this.playlist.push(t);i?this.play(this.playlist.length-1):1===this.original.length&&this.select(0)},remove:function(i){var r=this;return i===t?(this._initPlaylist([]),this._refresh(function(){n(r.cssSelector.jPlayer).jPlayer("clearMedia")}),!0):this.removing?!1:(i=0>i?r.original.length+i:i,0<=i&&i<this.playlist.length&&(this.removing=!0,n(this.cssSelector.playlist+" li:nth-child("+(i+1)+")").slideUp(this.options.playlistOptions.removeTime,function(){if(n(this).remove(),r.shuffled){var t=r.playlist[i];n.each(r.original,function(n){if(r.original[n]===t)return r.original.splice(n,1),!1})}else r.original.splice(i,1);r.playlist.splice(i,1);r.original.length?i===r.current?(r.current=i<r.original.length?r.current:r.original.length-1,r.select(r.current)):i<r.current&&r.current--:(n(r.cssSelector.jPlayer).jPlayer("clearMedia"),r.current=0,r.shuffled=!1,r._updateControls());r.removing=!1})),!0)},select:function(t){t=0>t?this.original.length+t:t;0<=t&&t<this.playlist.length?(this.current=t,this._highlight(t),n(this.cssSelector.jPlayer).jPlayer("setMedia",this.playlist[this.current])):this.current=0},play:function(i){i=0>i?this.original.length+i:i;0<=i&&i<this.playlist.length?this.playlist.length&&(this.select(i),n(this.cssSelector.jPlayer).jPlayer("play")):i===t&&n(this.cssSelector.jPlayer).jPlayer("play")},pause:function(){n(this.cssSelector.jPlayer).jPlayer("pause")},next:function(){var n=this.current+1<this.playlist.length?this.current+1:0;this.loop?0===n&&this.shuffled&&this.options.playlistOptions.shuffleOnLoop&&1<this.playlist.length?this.shuffle(!0,!0):this.play(n):0<n&&this.play(n)},previous:function(){var n=0<=this.current-1?this.current-1:this.playlist.length-1;(this.loop&&this.options.playlistOptions.loopOnPrevious||n<this.playlist.length-1)&&this.play(n)},shuffle:function(i,r){var u=this;i===t&&(i=!this.shuffled);(i||i!==this.shuffled)&&n(this.cssSelector.playlist+" ul").slideUp(this.options.playlistOptions.shuffleTime,function(){(u.shuffled=i)?u.playlist.sort(function(){return.5-Math.random()}):u._originalPlaylist();u._refresh(!0);r||!n(u.cssSelector.jPlayer).data("jPlayer").status.paused?u.play(0):u.select(0);n(this).slideDown(u.options.playlistOptions.shuffleTime)})}}}(jQuery),function(n){"use strict";var t={slide:0,delay:5e3,preload:!1,preloadImage:!1,preloadVideo:!1,timer:!0,overlay:!1,autoplay:!0,shuffle:!1,cover:!0,color:null,align:"center",valign:"center",transition:"fade",transitionDuration:1e3,transitionRegister:[],animation:null,animationDuration:"auto",animationRegister:[],init:function(){},play:function(){},pause:function(){},walk:function(){},slides:[]},i={},r=function(i,r){this.elmt=i;this.settings=n.extend({},t,n.vegas.defaults,r);this.slide=this.settings.slide;this.total=this.settings.slides.length;this.noshow=this.total<2;this.paused=!this.settings.autoplay||this.noshow;this.$elmt=n(i);this.$timer=null;this.$overlay=null;this.$slide=null;this.timeout=null;this.transitions=["fade","fade2","blur","blur2","flash","flash2","negative","negative2","burn","burn2","slideLeft","slideLeft2","slideRight","slideRight2","slideUp","slideUp2","slideDown","slideDown2","zoomIn","zoomIn2","zoomOut","zoomOut2","swirlLeft","swirlLeft2","swirlRight","swirlRight2"];this.animations=["kenburns","kenburnsLeft","kenburnsRight","kenburnsUp","kenburnsUpLeft","kenburnsUpRight","kenburnsDown","kenburnsDownLeft","kenburnsDownRight"];this.settings.transitionRegister instanceof Array==!1&&(this.settings.transitionRegister=[this.settings.transitionRegister]);this.settings.animationRegister instanceof Array==!1&&(this.settings.animationRegister=[this.settings.animationRegister]);this.transitions=this.transitions.concat(this.settings.transitionRegister);this.animations=this.animations.concat(this.settings.animationRegister);this.support={objectFit:"objectFit"in document.body.style,transition:"transition"in document.body.style||"WebkitTransition"in document.body.style,video:n.vegas.isVideoCompatible()};this.settings.shuffle===!0&&this.shuffle();this._init()};r.prototype={_init:function(){var i,r,u,e=this.elmt.tagName==="BODY",o=this.settings.timer,f=this.settings.overlay,t=this;this._preload();e||(this.$elmt.css("height",this.$elmt.css("height")),i=n('<div class="vegas-wrapper">').css("overflow",this.$elmt.css("overflow")).css("padding",this.$elmt.css("padding")),this.$elmt.css("padding")||i.css("padding-top",this.$elmt.css("padding-top")).css("padding-bottom",this.$elmt.css("padding-bottom")).css("padding-left",this.$elmt.css("padding-left")).css("padding-right",this.$elmt.css("padding-right")),this.$elmt.clone(!0).children().appendTo(i),this.elmt.innerHTML="");o&&this.support.transition&&(u=n('<div class="vegas-timer"><div class="vegas-timer-progress">'),this.$timer=u,this.$elmt.prepend(u));f&&(r=n('<div class="vegas-overlay">'),typeof f=="string"&&r.css("background-image","url("+f+")"),this.$overlay=r,this.$elmt.prepend(r));this.$elmt.addClass("vegas-container");e||this.$elmt.append(i);setTimeout(function(){t.trigger("init");t._goto(t.slide);t.settings.autoplay&&t.trigger("play")},1)},_preload:function(){for(var i,t,n=0;n<this.settings.slides.length;n++)(this.settings.preload||this.settings.preloadImages)&&this.settings.slides[n].src&&(t=new Image,t.src=this.settings.slides[n].src),(this.settings.preload||this.settings.preloadVideos)&&this.support.video&&this.settings.slides[n].video&&(i=this.settings.slides[n].video instanceof Array?this._video(this.settings.slides[n].video):this._video(this.settings.slides[n].video.src))},_random:function(n){return n[Math.floor(Math.random()*(n.length-1))]},_slideShow:function(){var n=this;this.total>1&&!this.paused&&!this.noshow&&(this.timeout=setTimeout(function(){n.next()},this._options("delay")))},_timer:function(n){var t=this;(clearTimeout(this.timeout),this.$timer)&&((this.$timer.removeClass("vegas-timer-running").find("div").css("transition-duration","0ms"),this.paused||this.noshow)||n&&setTimeout(function(){t.$timer.addClass("vegas-timer-running").find("div").css("transition-duration",t._options("delay")-100+"ms")},100))},_video:function(n){var t,r,u=n.toString();return i[u]?i[u]:(n instanceof Array==!1&&(n=[n]),t=document.createElement("video"),t.preload=!0,n.forEach(function(n){r=document.createElement("source");r.src=n;t.appendChild(r)}),i[u]=t,t)},_fadeOutSound:function(n,t){var r=this,u=t/10,i=n.volume-.09;i>0?(n.volume=i,setTimeout(function(){r._fadeOutSound(n,t)},u)):n.pause()},_fadeInSound:function(n,t){var r=this,u=t/10,i=n.volume+.09;i<1&&(n.volume=i,setTimeout(function(){r._fadeInSound(n,t)},u))},_options:function(n,t){return(t===undefined&&(t=this.slide),this.settings.slides[t][n]!==undefined)?this.settings.slides[t][n]:this.settings[n]},_goto:function(t){function nt(){h._timer(!0);setTimeout(function(){r&&(h.support.transition?(o.css("transition","all "+e+"ms").addClass("vegas-transition-"+r+"-out"),o.each(function(){var n=o.find("video").get(0);n&&(n.volume=1,h._fadeOutSound(n,e))}),u.css("transition","all "+e+"ms").addClass("vegas-transition-"+r+"-in")):u.fadeIn(e));for(var n=0;n<o.length-4;n++)o.eq(n).remove();h.trigger("walk");h._slideShow()},100)}typeof this.settings.slides[t]=="undefined"&&(t=0);this.slide=t;var u,l,c,o=this.$elmt.children(".vegas-slide"),w=this.settings.slides[t].src,f=this.settings.slides[t].video,a=this._options("delay"),b=this._options("align"),k=this._options("valign"),d=this._options("color")||this.$elmt.css("background-color"),v=this._options("cover")?"cover":"contain",h=this,g=o.length,i,y,r=this._options("transition"),e=this._options("transitionDuration"),s=this._options("animation"),p=this._options("animationDuration");(r==="random"||r instanceof Array)&&(r=r instanceof Array?this._random(r):this._random(this.transitions));(s==="random"||s instanceof Array)&&(s=s instanceof Array?this._random(s):this._random(this.animations));(e==="auto"||e>a)&&(e=a);p==="auto"&&(p=a);u=n('<div class="vegas-slide"><\/div>');this.support.transition&&r&&u.addClass("vegas-transition-"+r);this.support.video&&f?(i=f instanceof Array?this._video(f):this._video(f.src),i.loop=f.loop!==undefined?f.loop:!0,i.muted=f.mute!==undefined?f.mute:!0,i.muted===!1?(i.volume=0,this._fadeInSound(i,e)):i.pause(),c=n(i).addClass("vegas-video").css("background-color",d),this.support.objectFit?c.css("object-position",b+" "+k).css("object-fit",v).css("width","100%").css("height","100%"):v==="contain"&&c.css("width","100%").css("height","100%"),u.append(c)):(y=new Image,l=n('<div class="vegas-slide-inner"><\/div>').css("background-image","url("+w+")").css("background-color",d).css("background-position",b+" "+k).css("background-size",v),this.support.transition&&s&&l.addClass("vegas-animation-"+s).css("animation-duration",p+"ms"),u.append(l));this.support.transition||u.css("display","none");g?o.eq(g-1).after(u):this.$elmt.prepend(u);h._timer(!1);i?(i.readyState===4&&(i.currentTime=0),i.play(),nt()):(y.src=w,y.onload=nt)},shuffle:function(){for(var i,t,n=this.total-1;n>0;n--)t=Math.floor(Math.random()*(n+1)),i=this.settings.slides[n],this.settings.slides[n]=this.settings.slides[t],this.settings.slides[t]=i},play:function(){this.paused&&(this.paused=!1,this.next(),this.trigger("play"))},pause:function(){this._timer(!1);this.paused=!0;this.trigger("pause")},toggle:function(){this.paused?this.play():this.pause()},playing:function(){return!this.paused&&!this.noshow},current:function(n){return n?{slide:this.slide,data:this.settings.slides[this.slide]}:this.slide},jump:function(n){n<0||n>this.total-1||n===this.slide||(this.slide=n,this._goto(this.slide))},next:function(){this.slide++;this.slide>=this.total&&(this.slide=0);this._goto(this.slide)},previous:function(){this.slide--;this.slide<0&&(this.slide=this.total-1);this._goto(this.slide)},trigger:function(n){var t=[];t=n==="init"?[this.settings]:[this.slide,this.settings.slides[this.slide]];this.$elmt.trigger("vegas"+n,t);typeof this.settings[n]=="function"&&this.settings[n].apply(this.$elmt,t)},options:function(i,r){var u=this.settings.slides.slice();if(typeof i=="object")this.settings=n.extend({},t,n.vegas.defaults,i);else if(typeof i=="string"){if(r===undefined)return this.settings[i];this.settings[i]=r}else return this.settings;this.settings.slides!==u&&(this.total=this.settings.slides.length,this.noshow=this.total<2,this._preload())},destroy:function(){clearTimeout(this.timeout);this.$elmt.removeClass("vegas-container");this.$elmt.find("> .vegas-slide").remove();this.$elmt.find("> .vegas-wrapper").clone(!0).children().appendTo(this.$elmt);this.$elmt.find("> .vegas-wrapper").remove();this.settings.timer&&this.$timer.remove();this.settings.overlay&&this.$overlay.remove();this.elmt._vegas=null}};n.fn.vegas=function(n){var u=arguments,i=!1,t;if(n===undefined||typeof n=="object")return this.each(function(){this._vegas||(this._vegas=new r(this,n))});if(typeof n=="string"){if(this.each(function(){var r=this._vegas;if(!r)throw new Error("No Vegas applied to this element.");typeof r[n]=="function"&&n[0]!=="_"?t=r[n].apply(r,[].slice.call(u,1)):i=!0}),i)throw new Error('No method "'+n+'" in Vegas.');return t!==undefined?t:this}};n.vegas={};n.vegas.defaults=t;n.vegas.isVideoCompatible=function(){return!/(Android|webOS|Phone|iPad|iPod|BlackBerry|Windows Phone)/i.test(navigator.userAgent)}}(window.jQuery||window.Zepto),function(n){function i(){var i,t,u;for(f=!1,i=0;i<r.length;i++)t=n(r[i]).filter(function(){return n(this).is(":appeared")}),t.trigger("appear",[t]),e&&(u=e.not(t),u.trigger("disappear",[u])),e=t}var r=[],u=!1,f=!1,o={interval:250,force_process:!1},t=n(window),e;n.expr[":"].appeared=function(i){var r=n(i);if(!r.is(":visible"))return!1;var u=t.scrollLeft(),f=t.scrollTop(),e=r.offset(),o=e.left,s=e.top;return s+r.height()>=f&&s-(r.data("appear-top-offset")||0)<=f+t.height()&&o+r.width()>=u&&o-(r.data("appear-left-offset")||0)<=u+t.width()?!0:!1};n.fn.extend({appear:function(t){var e=n.extend({},o,t||{}),h=this.selector||this,s;return u||(s=function(){f||(f=!0,setTimeout(i,e.interval))},n(window).scroll(s).resize(s),u=!0),e.force_process&&setTimeout(i,e.interval),r.push(h),n(h)}});n.extend({force_appear:function(){return u?(i(),!0):!1}})}(jQuery),function(n){function u(i){function c(){i?s.removeData(i):f&&delete t[f]}function l(){u.id=setTimeout(function(){u.fn()},h)}var a=this,s,u={},y=i?n.fn:n,e=arguments,v=4,f=e[1],h=e[2],o=e[3];if(typeof f!="string"&&(v--,f=i=0,h=e[1],o=e[2]),i?(s=a.eq(0),s.data(i,u=s.data(i)||{})):f&&(u=t[f]||(t[f]={})),u.id&&clearTimeout(u.id),delete u.id,o){u.fn=function(n){typeof o=="string"&&(o=y[o]);o.apply(a,r.call(e,v))===!0&&!n?l():c()},l()}else{if(u.fn){return h===undefined?c():u.fn(h===!1),!0}c()}}var t={},i="doTimeout",r=Array.prototype.slice;n[i]=function(){return u.apply(window,[0].concat(r.call(arguments)))};n.fn[i]=function(){var n=r.call(arguments),t=u.apply(this,[i+n[0]].concat(n));return typeof n[0]=="number"||typeof n[1]=="number"?this:t}}(jQuery);$(".animatedParent").appear();$(".animatedClick").click(function(){var n=$(this).attr("data-target");if($(this).attr("data-sequence")!=undefined){var r=$("."+n+":first").attr("data-id"),i=$("."+n+":last").attr("data-id"),t=r;$("."+n+"[data-id="+t+"]").hasClass("go")?($("."+n+"[data-id="+t+"]").addClass("goAway"),$("."+n+"[data-id="+t+"]").removeClass("go")):($("."+n+"[data-id="+t+"]").addClass("go"),$("."+n+"[data-id="+t+"]").removeClass("goAway"));t++;delay=Number($(this).attr("data-sequence"));$.doTimeout(delay,function(){return console.log(i),$("."+n+"[data-id="+t+"]").hasClass("go")?($("."+n+"[data-id="+t+"]").addClass("goAway"),$("."+n+"[data-id="+t+"]").removeClass("go")):($("."+n+"[data-id="+t+"]").addClass("go"),$("."+n+"[data-id="+t+"]").removeClass("goAway")),++t,t<=i?!0:void 0})}else $("."+n).hasClass("go")?($("."+n).addClass("goAway"),$("."+n).removeClass("go")):($("."+n).addClass("go"),$("."+n).removeClass("goAway"))});$(document.body).on("appear",".animatedParent",function(){var i=$(this).find(".animated"),t=$(this);if(t.attr("data-sequence")!=undefined){var r=$(this).find(".animated:first").attr("data-id"),n=r,u=$(this).find(".animated:last").attr("data-id");$(t).find(".animated[data-id="+n+"]").addClass("go");n++;delay=Number(t.attr("data-sequence"));$.doTimeout(delay,function(){return $(t).find(".animated[data-id="+n+"]").addClass("go"),++n,n<=u?!0:void 0})}else i.addClass("go")});$(document.body).on("disappear",".animatedParent",function(){$(this).hasClass("animateLoop")&&$(this).find(".animated").removeClass("go")});$(window).load(function(){$.force_appear()});!function(n){"undefined"!=typeof module&&module.exports?module.exports=n:n(jQuery,window,document)}(function(n){!function(t){var i="function"==typeof define&&define.amd,r="undefined"!=typeof module&&module.exports,u="https:"==document.location.protocol?"https:":"http:";i||(r?require("jquery-mousewheel")(n):n.event.special.mousewheel||n("head").append(decodeURI("%3Cscript src="+u+"//cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js%3E%3C/script%3E")));t()}(function(){var h,c="mCustomScrollbar",t="mCS",it=".mCustomScrollbar",et={setTop:0,setLeft:0,axis:"y",scrollbarPosition:"inside",scrollInertia:950,autoDraggerLength:!0,alwaysShowScrollbar:0,snapOffset:0,mouseWheel:{enable:!0,scrollAmount:"auto",axis:"y",deltaFactor:"auto",disableOver:["select","option","keygen","datalist","textarea"]},scrollButtons:{scrollType:"stepless",scrollAmount:"auto"},keyboard:{enable:!0,scrollType:"stepless",scrollAmount:"auto"},contentTouchScroll:25,documentTouchScroll:!0,advanced:{autoScrollOnFocus:"input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']",updateOnContentResize:!0,updateOnImageLoad:"auto",autoUpdateTimeout:60},theme:"light",callbacks:{onTotalScrollOffset:0,onTotalScrollBackOffset:0,alwaysTriggerOffsets:!0}},vt=0,b={},p=window.attachEvent&&!window.addEventListener?1:0,f=!1,i=["mCSB_dragger_onDrag","mCSB_scrollTools_onDrag","mCS_img_loaded","mCS_disabled","mCS_destroyed","mCS_no_scrollbar","mCS-autoHide","mCS-dir-rtl","mCS_no_scrollbar_y","mCS_no_scrollbar_x","mCS_y_hidden","mCS_x_hidden","mCSB_draggerContainer","mCSB_buttonUp","mCSB_buttonDown","mCSB_buttonLeft","mCSB_buttonRight"],s={init:function(r){var r=n.extend(!0,{},et,r),e=v.call(this),u,f;if(r.live){if(u=r.liveSelector||this.selector||it,f=n(u),"off"===r.live)return void k(u);b[u]=setTimeout(function(){f.mCustomScrollbar(r);"once"===r.live&&f.length&&k(u)},500)}else k(u);return r.setWidth=r.set_width?r.set_width:r.setWidth,r.setHeight=r.set_height?r.set_height:r.setHeight,r.axis=r.horizontalScroll?"x":yt(r.axis),r.scrollInertia=r.scrollInertia>0&&r.scrollInertia<17?17:r.scrollInertia,"object"!=typeof r.mouseWheel&&1==r.mouseWheel&&(r.mouseWheel={enable:!0,scrollAmount:"auto",axis:"y",preventDefault:!1,deltaFactor:"auto",normalizeDelta:!1,invert:!1}),r.mouseWheel.scrollAmount=r.mouseWheelPixels?r.mouseWheelPixels:r.mouseWheel.scrollAmount,r.mouseWheel.normalizeDelta=r.advanced.normalizeMouseWheelDelta?r.advanced.normalizeMouseWheelDelta:r.mouseWheel.normalizeDelta,r.scrollButtons.scrollType=pt(r.scrollButtons.scrollType),ot(r),n(e).each(function(){var u=n(this);if(!u.data(t)){u.data(t,{idx:++vt,opt:r,scrollRatio:{y:null,x:null},overflowed:null,contentReset:{y:null,x:null},bindEvents:!1,tweenRunning:!1,sequential:{},langDir:u.css("direction"),cbOffsets:null,trigger:null,poll:{size:{o:0,n:0},img:{o:0,n:0},change:{o:0,n:0}}});var e=u.data(t),f=e.opt,o=u.data("mcs-axis"),h=u.data("mcs-scrollbar-position"),c=u.data("mcs-theme");o&&(f.axis=o);h&&(f.scrollbarPosition=h);c&&(f.theme=c,ot(f));wt.call(this);e&&f.callbacks.onCreate&&"function"==typeof f.callbacks.onCreate&&f.callbacks.onCreate.call(this);n("#mCSB_"+e.idx+"_container img:not(."+i[2]+")").addClass(i[2]);s.update.call(null,u)}})},update:function(r,f){var e=r||v.call(this);return n(e).each(function(){var s=n(this),c;if(s.data(t)){var e=s.data(t),r=e.opt,h=n("#mCSB_"+e.idx+"_container"),a=n("#mCSB_"+e.idx),l=[n("#mCSB_"+e.idx+"_dragger_vertical"),n("#mCSB_"+e.idx+"_dragger_horizontal")];if(!h.length)return;e.tweenRunning&&o(s);f&&e&&r.callbacks.onBeforeUpdate&&"function"==typeof r.callbacks.onBeforeUpdate&&r.callbacks.onBeforeUpdate.call(this);s.hasClass(i[3])&&s.removeClass(i[3]);s.hasClass(i[4])&&s.removeClass(i[4]);a.css("max-height","none");a.height()!==s.height()&&a.css("max-height",s.height());bt.call(this);"y"===r.axis||r.advanced.autoExpandHorizontalScroll||h.css("width",st(h));e.overflowed=ni.call(this);ht.call(this);r.autoDraggerLength&&dt.call(this);gt.call(this);ti.call(this);c=[Math.abs(h[0].offsetTop),Math.abs(h[0].offsetLeft)];"x"!==r.axis&&(e.overflowed[0]?l[0].height()>l[0].parent().height()?y.call(this):(u(s,c[0].toString(),{dir:"y",dur:0,overwrite:"none"}),e.contentReset.y=null):(y.call(this),"y"===r.axis?g.call(this):"yx"===r.axis&&e.overflowed[1]&&u(s,c[1].toString(),{dir:"x",dur:0,overwrite:"none"})));"y"!==r.axis&&(e.overflowed[1]?l[1].width()>l[1].parent().width()?y.call(this):(u(s,c[1].toString(),{dir:"x",dur:0,overwrite:"none"}),e.contentReset.x=null):(y.call(this),"x"===r.axis?g.call(this):"yx"===r.axis&&e.overflowed[0]&&u(s,c[0].toString(),{dir:"y",dur:0,overwrite:"none"})));f&&e&&(2===f&&r.callbacks.onImageLoad&&"function"==typeof r.callbacks.onImageLoad?r.callbacks.onImageLoad.call(this):3===f&&r.callbacks.onSelectorChange&&"function"==typeof r.callbacks.onSelectorChange?r.callbacks.onSelectorChange.call(this):r.callbacks.onUpdate&&"function"==typeof r.callbacks.onUpdate&&r.callbacks.onUpdate.call(this));ft.call(this)}})},scrollTo:function(i,r){if("undefined"!=typeof i&&null!=i){var f=v.call(this);return n(f).each(function(){var s=n(this);if(s.data(t)){var o=s.data(t),h=o.opt,c={trigger:"external",scrollInertia:h.scrollInertia,scrollEasing:"mcsEaseInOut",moveDragger:!1,timeout:60,callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},f=n.extend(!0,{},c,r),e=ut.call(this,i),l=f.scrollInertia>0&&f.scrollInertia<17?17:f.scrollInertia;e[0]=ct.call(this,e[0],"y");e[1]=ct.call(this,e[1],"x");f.moveDragger&&(e[0]*=o.scrollRatio.y,e[1]*=o.scrollRatio.x);f.dur=yi()?0:l;setTimeout(function(){null!==e[0]&&"undefined"!=typeof e[0]&&"x"!==h.axis&&o.overflowed[0]&&(f.dir="y",f.overwrite="all",u(s,e[0].toString(),f));null!==e[1]&&"undefined"!=typeof e[1]&&"y"!==h.axis&&o.overflowed[1]&&(f.dir="x",f.overwrite="none",u(s,e[1].toString(),f))},f.timeout)}})}},stop:function(){var i=v.call(this);return n(i).each(function(){var i=n(this);i.data(t)&&o(i)})},disable:function(r){var u=v.call(this);return n(u).each(function(){var u=n(this);u.data(t)&&(u.data(t),ft.call(this,"remove"),g.call(this),r&&y.call(this),ht.call(this,!0),u.addClass(i[3]))})},destroy:function(){var r=v.call(this);return n(r).each(function(){var f=n(this);if(f.data(t)){var u=f.data(t),e=u.opt,s=n("#mCSB_"+u.idx),o=n("#mCSB_"+u.idx+"_container"),h=n(".mCSB_"+u.idx+"_scrollbar");e.live&&k(e.liveSelector||n(r).selector);ft.call(this,"remove");g.call(this);y.call(this);f.removeData(t);a(this,"mcs");h.remove();o.find("img."+i[2]).removeClass(i[2]);s.replaceWith(o.contents());f.removeClass(c+" _"+t+"_"+u.idx+" "+i[6]+" "+i[7]+" "+i[5]+" "+i[3]).addClass(i[4])}})}},v=function(){return"object"!=typeof n(this)||n(this).length<1?it:this},ot=function(t){t.autoDraggerLength=n.inArray(t.theme,["rounded","rounded-dark","rounded-dots","rounded-dots-dark"])>-1?!1:t.autoDraggerLength;t.autoExpandScrollbar=n.inArray(t.theme,["rounded-dots","rounded-dots-dark","3d","3d-dark","3d-thick","3d-thick-dark","inset","inset-dark","inset-2","inset-2-dark","inset-3","inset-3-dark"])>-1?!1:t.autoExpandScrollbar;t.scrollButtons.enable=n.inArray(t.theme,["minimal","minimal-dark"])>-1?!1:t.scrollButtons.enable;t.autoHideScrollbar=n.inArray(t.theme,["minimal","minimal-dark"])>-1?!0:t.autoHideScrollbar;t.scrollbarPosition=n.inArray(t.theme,["minimal","minimal-dark"])>-1?"outside":t.scrollbarPosition},k=function(n){b[n]&&(clearTimeout(b[n]),a(b,n))},yt=function(n){return"yx"===n||"xy"===n||"auto"===n?"yx":"x"===n||"horizontal"===n?"x":"y"},pt=function(n){return"stepped"===n||"pixels"===n||"step"===n||"click"===n?"stepped":"stepless"},wt=function(){var f=n(this),u=f.data(t),r=u.opt,l=r.autoExpandScrollbar?" "+i[1]+"_expand":"",o=["<div id='mCSB_"+u.idx+"_scrollbar_vertical' class='mCSB_scrollTools mCSB_"+u.idx+"_scrollbar mCS-"+r.theme+" mCSB_scrollTools_vertical"+l+"'><div class='"+i[12]+"'><div id='mCSB_"+u.idx+"_dragger_vertical' class='mCSB_dragger' style='position:absolute;' oncontextmenu='return false;'><div class='mCSB_dragger_bar' /><\/div><div class='mCSB_draggerRail' /><\/div><\/div>","<div id='mCSB_"+u.idx+"_scrollbar_horizontal' class='mCSB_scrollTools mCSB_"+u.idx+"_scrollbar mCS-"+r.theme+" mCSB_scrollTools_horizontal"+l+"'><div class='"+i[12]+"'><div id='mCSB_"+u.idx+"_dragger_horizontal' class='mCSB_dragger' style='position:absolute;' oncontextmenu='return false;'><div class='mCSB_dragger_bar' /><\/div><div class='mCSB_draggerRail' /><\/div><\/div>"],v="yx"===r.axis?"mCSB_vertical_horizontal":"x"===r.axis?"mCSB_horizontal":"mCSB_vertical",a="yx"===r.axis?o[0]+o[1]:"x"===r.axis?o[1]:o[0],y="yx"===r.axis?"<div id='mCSB_"+u.idx+"_container_wrapper' class='mCSB_container_wrapper' />":"",p=r.autoHideScrollbar?" "+i[6]:"",w="x"!==r.axis&&"rtl"===u.langDir?" "+i[7]:"",h,s,e;r.setWidth&&f.css("width",r.setWidth);r.setHeight&&f.css("height",r.setHeight);r.setLeft="y"!==r.axis&&"rtl"===u.langDir?"989999px":r.setLeft;f.addClass(c+" _"+t+"_"+u.idx+p+w).wrapInner("<div id='mCSB_"+u.idx+"' class='mCustomScrollBox mCS-"+r.theme+" "+v+"'><div id='mCSB_"+u.idx+"_container' class='mCSB_container' style='position:relative; top:"+r.setTop+"; left:"+r.setLeft+";' dir="+u.langDir+" /><\/div>");h=n("#mCSB_"+u.idx);s=n("#mCSB_"+u.idx+"_container");"y"===r.axis||r.advanced.autoExpandHorizontalScroll||s.css("width",st(s));"outside"===r.scrollbarPosition?("static"===f.css("position")&&f.css("position","relative"),f.css("overflow","visible"),h.addClass("mCSB_outside").after(a)):(h.addClass("mCSB_inside").append(a),s.wrap(y));kt.call(this);e=[n("#mCSB_"+u.idx+"_dragger_vertical"),n("#mCSB_"+u.idx+"_dragger_horizontal")];e[0].css("min-height",e[0].height());e[1].css("min-width",e[1].width())},st=function(t){var i=[t[0].scrollWidth,Math.max.apply(Math,t.children().map(function(){return n(this).outerWidth(!0)}).get())],r=t.parent().width();return i[0]>r?i[0]:i[1]>r?i[1]:"100%"},bt=function(){var e=n(this),f=e.data(t),r=f.opt,i=n("#mCSB_"+f.idx+"_container"),u;r.advanced.autoExpandHorizontalScroll&&"y"!==r.axis&&(i.css({width:"auto","min-width":0,"overflow-x":"scroll"}),u=Math.ceil(i[0].scrollWidth),3===r.advanced.autoExpandHorizontalScroll||2!==r.advanced.autoExpandHorizontalScroll&&u>i.parent().width()?i.css({width:u,"min-width":"100%","overflow-x":"inherit"}):i.css({"overflow-x":"inherit",position:"absolute"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({width:Math.ceil(i[0].getBoundingClientRect().right+.4)-Math.floor(i[0].getBoundingClientRect().left),"min-width":"100%",position:"relative"}).unwrap())},kt=function(){var s=n(this),o=s.data(t),u=o.opt,h=n(".mCSB_"+o.idx+"_scrollbar:first"),f=tt(u.scrollButtons.tabindex)?"tabindex='"+u.scrollButtons.tabindex+"'":"",r=["<a href='#' class='"+i[13]+"' oncontextmenu='return false;' "+f+" />","<a href='#' class='"+i[14]+"' oncontextmenu='return false;' "+f+" />","<a href='#' class='"+i[15]+"' oncontextmenu='return false;' "+f+" />","<a href='#' class='"+i[16]+"' oncontextmenu='return false;' "+f+" />"],e=["x"===u.axis?r[2]:r[0],"x"===u.axis?r[3]:r[1],r[2],r[3]];u.scrollButtons.enable&&h.prepend(e[0]).append(e[1]).next(".mCSB_scrollTools").prepend(e[2]).append(e[3])},dt=function(){var s=n(this),u=s.data(t),f=n("#mCSB_"+u.idx),e=n("#mCSB_"+u.idx+"_container"),r=[n("#mCSB_"+u.idx+"_dragger_vertical"),n("#mCSB_"+u.idx+"_dragger_horizontal")],o=[f.height()/e.outerHeight(!1),f.width()/e.outerWidth(!1)],i=[parseInt(r[0].css("min-height")),Math.round(o[0]*r[0].parent().height()),parseInt(r[1].css("min-width")),Math.round(o[1]*r[1].parent().width())],h=p&&i[1]<i[0]?i[0]:i[1],c=p&&i[3]<i[2]?i[2]:i[3];r[0].css({height:h,"max-height":r[0].parent().height()-10}).find(".mCSB_dragger_bar").css({"line-height":i[0]+"px"});r[1].css({width:c,"max-width":r[1].parent().width()-10})},gt=function(){var s=n(this),i=s.data(t),u=n("#mCSB_"+i.idx),f=n("#mCSB_"+i.idx+"_container"),r=[n("#mCSB_"+i.idx+"_dragger_vertical"),n("#mCSB_"+i.idx+"_dragger_horizontal")],e=[f.outerHeight(!1)-u.height(),f.outerWidth(!1)-u.width()],o=[e[0]/(r[0].parent().height()-r[0].height()),e[1]/(r[1].parent().width()-r[1].width())];i.scrollRatio={y:o[0],x:o[1]}},d=function(n,t,r){var f=r?i[0]+"_expanded":"",u=n.closest(".mCSB_scrollTools");"active"===t?(n.toggleClass(i[0]+" "+f),u.toggleClass(i[1]),n[0]._draggable=n[0]._draggable?0:1):n[0]._draggable||("hide"===t?(n.removeClass(i[0]),u.removeClass(i[1])):(n.addClass(i[0]),u.addClass(i[1])))},ni=function(){var h=n(this),r=h.data(t),e=n("#mCSB_"+r.idx),i=n("#mCSB_"+r.idx+"_container"),u=null==r.overflowed?i.height():i.outerHeight(!1),f=null==r.overflowed?i.width():i.outerWidth(!1),o=i[0].scrollHeight,s=i[0].scrollWidth;return o>u&&(u=o),s>f&&(f=s),[u>e.height(),f>e.width()]},y=function(){var r=n(this),i=r.data(t),f=i.opt,c=n("#mCSB_"+i.idx),s=n("#mCSB_"+i.idx+"_container"),h=[n("#mCSB_"+i.idx+"_dragger_vertical"),n("#mCSB_"+i.idx+"_dragger_horizontal")],e;(o(r),("x"!==f.axis&&!i.overflowed[0]||"y"===f.axis&&i.overflowed[0])&&(h[0].add(s).css("top",0),u(r,"_resetY")),"y"!==f.axis&&!i.overflowed[1]||"x"===f.axis&&i.overflowed[1])&&(e=dx=0,"rtl"===i.langDir&&(e=c.width()-s.outerWidth(!1),dx=Math.abs(e/i.scrollRatio.x)),s.css("left",e),h[1].css("left",dx),u(r,"_resetX"))},ti=function(){function u(){e=setTimeout(function(){n.event.special.mousewheel?(clearTimeout(e),fi.call(f[0])):u()},100)}var f=n(this),r=f.data(t),i=r.opt,e;r.bindEvents||((ii.call(this),i.contentTouchScroll&&ri.call(this),ui.call(this),i.mouseWheel.enable)&&u(),oi.call(this),hi.call(this),i.advanced.autoScrollOnFocus&&si.call(this),i.scrollButtons.enable&&ci.call(this),i.keyboard.enable&&li.call(this),r.bindEvents=!0)},g=function(){var f=n(this),r=f.data(t),u=r.opt,o=t+"_"+r.idx,s=".mCSB_"+r.idx+"_scrollbar",e=n("#mCSB_"+r.idx+",#mCSB_"+r.idx+"_container,#mCSB_"+r.idx+"_container_wrapper,"+s+" ."+i[12]+",#mCSB_"+r.idx+"_dragger_vertical,#mCSB_"+r.idx+"_dragger_horizontal,"+s+">a"),h=n("#mCSB_"+r.idx+"_container");u.advanced.releaseDraggableSelectors&&e.add(n(u.advanced.releaseDraggableSelectors));u.advanced.extraDraggableSelectors&&e.add(n(u.advanced.extraDraggableSelectors));r.bindEvents&&(n(document).add(n(!l()||top.document)).unbind("."+o),e.each(function(){n(this).unbind("."+o)}),clearTimeout(f[0]._focusTimeout),a(f[0],"_focusTimeout"),clearTimeout(r.sequential.step),a(r.sequential,"step"),clearTimeout(h[0].onCompleteTimeout),a(h[0],"onCompleteTimeout"),r.bindEvents=!1)},ht=function(r){var h=n(this),u=h.data(t),o=u.opt,c=n("#mCSB_"+u.idx+"_container_wrapper"),f=c.length?c:n("#mCSB_"+u.idx+"_container"),e=[n("#mCSB_"+u.idx+"_scrollbar_vertical"),n("#mCSB_"+u.idx+"_scrollbar_horizontal")],s=[e[0].find(".mCSB_dragger"),e[1].find(".mCSB_dragger")];"x"!==o.axis&&(u.overflowed[0]&&!r?(e[0].add(s[0]).add(e[0].children("a")).css("display","block"),f.removeClass(i[8]+" "+i[10])):(o.alwaysShowScrollbar?(2!==o.alwaysShowScrollbar&&s[0].css("display","none"),f.removeClass(i[10])):(e[0].css("display","none"),f.addClass(i[10])),f.addClass(i[8])));"y"!==o.axis&&(u.overflowed[1]&&!r?(e[1].add(s[1]).add(e[1].children("a")).css("display","block"),f.removeClass(i[9]+" "+i[11])):(o.alwaysShowScrollbar?(2!==o.alwaysShowScrollbar&&s[1].css("display","none"),f.removeClass(i[11])):(e[1].css("display","none"),f.addClass(i[11])),f.addClass(i[9])));u.overflowed[0]||u.overflowed[1]?h.removeClass(i[5]):h.addClass(i[5])},r=function(t){var e=t.type,i=t.target.ownerDocument!==document?[n(frameElement).offset().top,n(frameElement).offset().left]:null,u=l()&&t.target.ownerDocument!==top.document?[n(t.view.frameElement).offset().top,n(t.view.frameElement).offset().left]:[0,0],r,f;switch(e){case"pointerdown":case"MSPointerDown":case"pointermove":case"MSPointerMove":case"pointerup":case"MSPointerUp":return i?[t.originalEvent.pageY-i[0]+u[0],t.originalEvent.pageX-i[1]+u[1],!1]:[t.originalEvent.pageY,t.originalEvent.pageX,!1];case"touchstart":case"touchmove":case"touchend":return r=t.originalEvent.touches[0]||t.originalEvent.changedTouches[0],f=t.originalEvent.touches.length||t.originalEvent.changedTouches.length,t.target.ownerDocument!==document?[r.screenY,r.screenX,f>1]:[r.pageY,r.pageX,f>1];default:return i?[t.pageY-i[0]+u[0],t.pageX-i[1]+u[1],!1]:[t.pageY,t.pageX,!1]}},ii=function(){function b(n){var t=g.find("iframe"),i;t.length&&(i=n?"auto":"none",t.css("pointer-events",i))}function k(n,t,r,f){var e,o;(g[0].idleTimer=h.scrollInertia<233?250:0,i.attr("id")===y[1])?(e="x",o=(i[0].offsetLeft-t+f)*s.scrollRatio.x):(e="y",o=(i[0].offsetTop-n+r)*s.scrollRatio.y);u(v,o.toString(),{dir:e,drag:!0})}var i,c,a,v=n(this),s=v.data(t),h=s.opt,e=t+"_"+s.idx,y=["mCSB_"+s.idx+"_dragger_vertical","mCSB_"+s.idx+"_dragger_horizontal"],g=n("#mCSB_"+s.idx+"_container"),w=n("#"+y[0]+",#"+y[1]),nt=h.advanced.releaseDraggableSelectors?w.add(n(h.advanced.releaseDraggableSelectors)):w,tt=h.advanced.extraDraggableSelectors?n(!l()||top.document).add(n(h.advanced.extraDraggableSelectors)):n(!l()||top.document);w.bind("mousedown."+e+" touchstart."+e+" pointerdown."+e+" MSPointerDown."+e,function(t){if(t.stopImmediatePropagation(),t.preventDefault(),at(t)){f=!0;p&&(document.onselectstart=function(){return!1});b(!1);o(v);i=n(this);var u=i.offset(),e=r(t)[0]-u.top,s=r(t)[1]-u.left,l=i.height()+u.top,y=i.width()+u.left;l>e&&e>0&&y>s&&s>0&&(c=e,a=s);d(i,"active",h.autoExpandScrollbar)}}).bind("touchmove."+e,function(n){n.stopImmediatePropagation();n.preventDefault();var t=i.offset(),u=r(n)[0]-t.top,f=r(n)[1]-t.left;k(c,a,u,f)});n(document).add(tt).bind("mousemove."+e+" pointermove."+e+" MSPointerMove."+e,function(n){if(i){var t=i.offset(),u=r(n)[0]-t.top,f=r(n)[1]-t.left;if(c===u&&a===f)return;k(c,a,u,f)}}).add(nt).bind("mouseup."+e+" touchend."+e+" pointerup."+e+" MSPointerUp."+e,function(){i&&(d(i,"active",h.autoExpandScrollbar),i=null);f=!1;p&&(document.onselectstart=null);b(!0)})},ri=function(){function at(n){if(!nt(n)||f||r(n)[2])return void(h=0);h=1;it=0;rt=0;st=1;g.removeClass("mCS_touch_action");var t=b.offset();k=r(n)[0]-t.top;d=r(n)[1]-t.left;v=[r(n)[0],r(n)[1]]}function vt(n){var c,l,a,y;if(nt(n)&&!f&&!r(n)[2]&&(e.documentTouchScroll||n.preventDefault(),n.stopImmediatePropagation(),(!rt||it)&&st)){gt=w();var o=ut.offset(),t=r(n)[0]-o.top,u=r(n)[1]-o.left,h="mcsLinearOut";(et.push(t),ot.push(u),v[2]=Math.abs(r(n)[0]-v[0]),v[3]=Math.abs(r(n)[1]-v[1]),i.overflowed[0])&&(c=ft[0].parent().height()-ft[0].height(),l=k-t>0&&t-k>-(c*i.scrollRatio.y)&&(2*v[3]<v[2]||"yx"===e.axis));i.overflowed[1]&&(a=ft[1].parent().width()-ft[1].width(),y=d-u>0&&u-d>-(a*i.scrollRatio.x)&&(2*v[2]<v[3]||"yx"===e.axis));l||y?(ii||n.preventDefault(),it=1):(rt=1,g.addClass("mCS_touch_action"));ii&&n.preventDefault();s="yx"===e.axis?[k-t,d-u]:"x"===e.axis?[null,d-u]:[k-t,null];b[0].idleTimer=250;i.overflowed[0]&&tt(s[0],ni,h,"y","all",!0);i.overflowed[1]&&tt(s[1],ni,h,"x",lt,!0)}}function yt(n){if(!nt(n)||f||r(n)[2])return void(h=0);h=1;n.stopImmediatePropagation();o(g);dt=w();var t=ut.offset();bt=r(n)[0]-t.top;kt=r(n)[1]-t.left;et=[];ot=[]}function pt(n){var t,u,h;if(nt(n)&&!f&&!r(n)[2]){st=0;n.stopImmediatePropagation();it=0;rt=0;ht=w();var l=ut.offset(),a=r(n)[0]-l.top,v=r(n)[1]-l.left;if(!(ht-gt>30)){c=1e3/(ht-dt);var p="mcsEaseOut",o=2.5>c,k=o?[et[et.length-2],ot[ot.length-2]]:[0,0];y=o?[a-k[0],v-k[1]]:[a-bt,v-kt];t=[Math.abs(y[0]),Math.abs(y[1])];c=o?[Math.abs(y[0]/4),Math.abs(y[1]/4)]:[c,c];u=[Math.abs(b[0].offsetTop)-y[0]*wt(t[0]/c[0],c[0]),Math.abs(b[0].offsetLeft)-y[1]*wt(t[1]/c[1],c[1])];s="yx"===e.axis?[u[0],u[1]]:"x"===e.axis?[null,u[1]]:[u[0],null];ct=[4*t[0]+e.scrollInertia,4*t[1]+e.scrollInertia];h=parseInt(e.contentTouchScroll)||0;s[0]=t[0]>h?s[0]:0;s[1]=t[1]>h?s[1]:0;i.overflowed[0]&&tt(s[0],ct[0],p,"y",lt,!1);i.overflowed[1]&&tt(s[1],ct[1],p,"x",lt,!1)}}}function wt(n,t){var i=[1.5*t,2*t,t/1.5,t/2];return n>90?t>4?i[0]:i[3]:n>60?t>3?i[3]:i[2]:n>30?t>8?i[1]:t>6?i[0]:t>4?t:i[2]:t>8?t:i[3]}function tt(n,t,i,r,f,e){n&&u(g,n.toString(),{dur:t,scrollEasing:i,dir:r,overwrite:f,drag:e})}var st,k,d,bt,kt,dt,gt,ht,y,c,s,ct,it,rt,g=n(this),i=g.data(t),e=i.opt,a=t+"_"+i.idx,ut=n("#mCSB_"+i.idx),b=n("#mCSB_"+i.idx+"_container"),ft=[n("#mCSB_"+i.idx+"_dragger_vertical"),n("#mCSB_"+i.idx+"_dragger_horizontal")],et=[],ot=[],ni=0,lt="yx"===e.axis?"none":"all",v=[],ti=b.find("iframe"),p=["touchstart."+a+" pointerdown."+a+" MSPointerDown."+a,"touchmove."+a+" pointermove."+a+" MSPointerMove."+a,"touchend."+a+" pointerup."+a+" MSPointerUp."+a],ii=void 0!==document.body.style.touchAction;b.bind(p[0],function(n){at(n)}).bind(p[1],function(n){vt(n)});ut.bind(p[0],function(n){yt(n)}).bind(p[2],function(n){pt(n)});ti.length&&ti.each(function(){n(this).load(function(){l(this)&&n(this.contentDocument||this.contentWindow.document).bind(p[0],function(n){at(n);yt(n)}).bind(p[1],function(n){vt(n)}).bind(p[2],function(n){pt(n)})})})},ui=function(){function y(){return window.getSelection?window.getSelection().toString():document.selection&&"Control"!=document.selection.type?document.selection.createRange().text:0}function i(n,t,i){l.type=i&&u?"stepped":"stepless";l.scrollAmount=10;rt(a,n,t,"mcsLinearOut",i?60:null)}var u,a=n(this),e=a.data(t),v=e.opt,l=e.sequential,s=t+"_"+e.idx,o=n("#mCSB_"+e.idx+"_container"),c=o.parent();o.bind("mousedown."+s,function(){h||u||(u=1,f=!0)}).add(document).bind("mousemove."+s,function(n){if(!h&&u&&y()){var s=o.offset(),t=r(n)[0]-s.top+o[0].offsetTop,f=r(n)[1]-s.left+o[0].offsetLeft;t>0&&t<c.height()&&f>0&&f<c.width()?l.step&&i("off",null,"stepped"):("x"!==v.axis&&e.overflowed[0]&&(0>t?i("on",38):t>c.height()&&i("on",40)),"y"!==v.axis&&e.overflowed[1]&&(0>f?i("on",37):f>c.width()&&i("on",39)))}}).bind("mouseup."+s+" dragend."+s,function(){h||(u&&(u=0,i("off",null)),f=!1)})},fi=function(){function h(t,h){var v,y;if(o(s),!ei(s,t.target)){if(v="auto"!==i.mouseWheel.deltaFactor?parseInt(i.mouseWheel.deltaFactor):p&&t.deltaFactor<100?100:t.deltaFactor||100,y=i.scrollInertia,"x"===i.axis||"x"===i.mouseWheel.axis)var a="x",l=[Math.round(v*r.scrollRatio.x),parseInt(i.mouseWheel.scrollAmount)],w="auto"!==i.mouseWheel.scrollAmount?l[1]:l[0]>=e.width()?.9*e.width():l[0],k=Math.abs(n("#mCSB_"+r.idx+"_container")[0].offsetLeft),b=f[1][0].offsetLeft,d=f[1].parent().width()-f[1].width(),c=t.deltaX||t.deltaY||h;else var a="y",l=[Math.round(v*r.scrollRatio.y),parseInt(i.mouseWheel.scrollAmount)],w="auto"!==i.mouseWheel.scrollAmount?l[1]:l[0]>=e.height()?.9*e.height():l[0],k=Math.abs(n("#mCSB_"+r.idx+"_container")[0].offsetTop),b=f[0][0].offsetTop,d=f[0].parent().height()-f[0].height(),c=t.deltaY||h;("y"!==a||r.overflowed[0])&&("x"!==a||r.overflowed[1])&&((i.mouseWheel.invert||t.webkitDirectionInvertedFromDevice)&&(c=-c),i.mouseWheel.normalizeDelta&&(c=0>c?-1:1),(c>0&&0!==b||0>c&&b!==d||i.mouseWheel.preventDefault)&&(t.stopImmediatePropagation(),t.preventDefault()),t.deltaFactor<2&&!i.mouseWheel.normalizeDelta&&(w=t.deltaFactor,y=17),u(s,(k-c*w).toString(),{dir:a,dur:y}))}}if(n(this).data(t)){var s=n(this),r=s.data(t),i=r.opt,c=t+"_"+r.idx,e=n("#mCSB_"+r.idx),f=[n("#mCSB_"+r.idx+"_dragger_vertical"),n("#mCSB_"+r.idx+"_dragger_horizontal")],a=n("#mCSB_"+r.idx+"_container").find("iframe");a.length&&a.each(function(){n(this).load(function(){l(this)&&n(this.contentDocument||this.contentWindow.document).bind("mousewheel."+c,function(n,t){h(n,t)})})});e.bind("mousewheel."+c,function(n,t){h(n,t)})}},l=function(n){var i=null,t;if(n){try{t=n.contentDocument||n.contentWindow.document;i=t.body.innerHTML}catch(r){}return null!==i}try{t=top.document;i=t.body.innerHTML}catch(r){}return null!==i},ei=function(i,r){var u=r.nodeName.toLowerCase(),f=i.data(t).opt.mouseWheel.disableOver;return n.inArray(u,f)>-1&&!(n.inArray(u,["select","textarea"])>-1&&!n(r).is(":focus"))},oi=function(){var s,h=n(this),e=h.data(t),r=t+"_"+e.idx,c=n("#mCSB_"+e.idx+"_container"),l=c.parent(),a=n(".mCSB_"+e.idx+"_scrollbar ."+i[12]);a.bind("mousedown."+r+" touchstart."+r+" pointerdown."+r+" MSPointerDown."+r,function(t){f=!0;n(t.target).hasClass("mCSB_dragger")||(s=1)}).bind("touchend."+r+" pointerup."+r+" MSPointerUp."+r,function(){f=!1}).bind("click."+r,function(t){var r,f;if(s&&(s=0,n(t.target).hasClass(i[12])||n(t.target).hasClass("mCSB_draggerRail"))){if(o(h),r=n(this),f=r.find(".mCSB_dragger"),r.parent(".mCSB_scrollTools_horizontal").length>0){if(!e.overflowed[1])return;var v="x",a=t.pageX>f.offset().left?-1:1,y=Math.abs(c[0].offsetLeft)-.9*a*l.width()}else{if(!e.overflowed[0])return;var v="y",a=t.pageY>f.offset().top?-1:1,y=Math.abs(c[0].offsetTop)-.9*a*l.height()}u(h,y.toString(),{dir:v,scrollEasing:"mcsEaseInOut"})}})},si=function(){var i=n(this),s=i.data(t),f=s.opt,c=t+"_"+s.idx,r=n("#mCSB_"+s.idx+"_container"),h=r.parent();r.bind("focusin."+c,function(){var t=n(document.activeElement),c=r.find(".mCustomScrollBox").length,s=0;t.is(f.advanced.autoScrollOnFocus)&&(o(i),clearTimeout(i[0]._focusTimeout),i[0]._focusTimer=c?(s+17)*c:0,i[0]._focusTimeout=setTimeout(function(){var n=[e(t)[0],e(t)[1]],o=[r[0].offsetTop,r[0].offsetLeft],c=[o[0]+n[0]>=0&&o[0]+n[0]<h.height()-t.outerHeight(!1),o[1]+n[1]>=0&&o[0]+n[1]<h.width()-t.outerWidth(!1)],l="yx"!==f.axis||c[0]||c[1]?"all":"none";"x"===f.axis||c[0]||u(i,n[0].toString(),{dir:"y",scrollEasing:"mcsEaseInOut",overwrite:l,dur:s});"y"===f.axis||c[1]||u(i,n[1].toString(),{dir:"x",scrollEasing:"mcsEaseInOut",overwrite:l,dur:s})},i[0]._focusTimer))})},hi=function(){var u=n(this),i=u.data(t),f=t+"_"+i.idx,r=n("#mCSB_"+i.idx+"_container").parent();r.bind("scroll."+f,function(){(0!==r.scrollTop()||0!==r.scrollLeft())&&n(".mCSB_"+i.idx+"_scrollbar").css("visibility","hidden")})},ci=function(){var e=n(this),r=e.data(t),o=r.opt,u=r.sequential,i=t+"_"+r.idx,s=".mCSB_"+r.idx+"_scrollbar",h=n(s+">a");h.bind("mousedown."+i+" touchstart."+i+" pointerdown."+i+" MSPointerDown."+i+" mouseup."+i+" touchend."+i+" pointerup."+i+" MSPointerUp."+i+" mouseout."+i+" pointerout."+i+" MSPointerOut."+i+" click."+i,function(t){function i(n,t){u.scrollAmount=o.scrollButtons.scrollAmount;rt(e,n,t)}if(t.preventDefault(),at(t)){var s=n(this).attr("class");switch(u.type=o.scrollButtons.scrollType,t.type){case"mousedown":case"touchstart":case"pointerdown":case"MSPointerDown":if("stepped"===u.type)return;f=!0;r.tweenRunning=!1;i("on",s);break;case"mouseup":case"touchend":case"pointerup":case"MSPointerUp":case"mouseout":case"pointerout":case"MSPointerOut":if("stepped"===u.type)return;f=!1;u.dir&&i("off",s);break;case"click":if("stepped"!==u.type||r.tweenRunning)return;i("on",s)}}})},li=function(){function a(t){function w(n,t){s.type=r.keyboard.scrollType;s.scrollAmount=r.keyboard.scrollAmount;"stepped"===s.type&&i.tweenRunning||rt(e,n,t)}var c,y,p,l,a;switch(t.type){case"blur":i.tweenRunning&&s.dir&&w("off",null);break;case"keydown":case"keyup":if(c=t.keyCode?t.keyCode:t.which,y="on","x"!==r.axis&&(38===c||40===c)||"y"!==r.axis&&(37===c||39===c)){if((38===c||40===c)&&!i.overflowed[0]||(37===c||39===c)&&!i.overflowed[1])return;"keyup"===t.type&&(y="off");n(document.activeElement).is(v)||(t.preventDefault(),t.stopImmediatePropagation(),w(y,c))}else 33===c||34===c?((i.overflowed[0]||i.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type)&&(o(e),p=34===c?-1:1,"x"===r.axis||"yx"===r.axis&&i.overflowed[1]&&!i.overflowed[0]?(l="x",a=Math.abs(f[0].offsetLeft)-.9*p*h.width()):(l="y",a=Math.abs(f[0].offsetTop)-.9*p*h.height()),u(e,a.toString(),{dir:l,scrollEasing:"mcsEaseInOut"})):35!==c&&36!==c||n(document.activeElement).is(v)||((i.overflowed[0]||i.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"!==t.type)||("x"===r.axis||"yx"===r.axis&&i.overflowed[1]&&!i.overflowed[0]?(l="x",a=35===c?Math.abs(h.width()-f.outerWidth(!1)):0):(l="y",a=35===c?Math.abs(h.height()-f.outerHeight(!1)):0),u(e,a.toString(),{dir:l,scrollEasing:"mcsEaseInOut"}))}}var e=n(this),i=e.data(t),r=i.opt,s=i.sequential,c=t+"_"+i.idx,w=n("#mCSB_"+i.idx),f=n("#mCSB_"+i.idx+"_container"),h=f.parent(),v="input,textarea,select,datalist,keygen,[contenteditable='true']",y=f.find("iframe"),p=["blur."+c+" keydown."+c+" keyup."+c];y.length&&y.each(function(){n(this).load(function(){l(this)&&n(this.contentDocument||this.contentWindow.document).bind(p[0],function(n){a(n)})})});w.attr("tabindex","0").bind(p[0],function(n){a(n)})},rt=function(r,f,e,s,h){function y(n){l.snapAmount&&(c.scrollAmount=l.snapAmount instanceof Array?"x"===c.dir[0]?l.snapAmount[1]:l.snapAmount[0]:l.snapAmount);var i="stepped"!==c.type,f=h?h:n?i?k/1.5:d:1e3/60,e=n?i?7.5:40:2.5,t=[Math.abs(p[0].offsetTop),Math.abs(p[0].offsetLeft)],o=[v.scrollRatio.y>10?10:v.scrollRatio.y,v.scrollRatio.x>10?10:v.scrollRatio.x],w="x"===c.dir[0]?t[1]+c.dir[1]*o[1]*e:t[0]+c.dir[1]*o[0]*e,b="x"===c.dir[0]?t[1]+c.dir[1]*parseInt(c.scrollAmount):t[0]+c.dir[1]*parseInt(c.scrollAmount),a="auto"!==c.scrollAmount?b:w,g=s?s:n?i?"mcsLinearOut":"mcsEaseInOut":"mcsLinear",nt=n?!0:!1;return n&&17>f&&(a="x"===c.dir[0]?t[1]:t[0]),u(r,a.toString(),{dir:c.dir[0],scrollEasing:g,dur:f,onComplete:nt}),n?void(c.dir=!1):(clearTimeout(c.step),void(c.step=setTimeout(function(){y()},f)))}function b(){clearTimeout(c.step);a(c,"step");o(r)}var v=r.data(t),l=v.opt,c=v.sequential,p=n("#mCSB_"+v.idx+"_container"),w="stepped"===c.type?!0:!1,k=l.scrollInertia<26?26:l.scrollInertia,d=l.scrollInertia<1?17:l.scrollInertia;switch(f){case"on":if(c.dir=[e===i[16]||e===i[15]||39===e||37===e?"x":"y",e===i[13]||e===i[15]||38===e||37===e?-1:1],o(r),tt(e)&&"stepped"===c.type)return;y(w);break;case"off":b();(w||v.tweenRunning&&c.dir)&&y(!0)}},ut=function(i){var u=n(this).data(t).opt,r=[];return"function"==typeof i&&(i=i()),i instanceof Array?r=i.length>1?[i[0],i[1]]:"x"===u.axis?[null,i[0]]:[i[0],null]:(r[0]=i.y?i.y:i.x||"x"===u.axis?null:i,r[1]=i.x?i.x:i.y||"y"===u.axis?null:i),"function"==typeof r[0]&&(r[0]=r[0]()),"function"==typeof r[1]&&(r[1]=r[1]()),r},ct=function(i,r){var o,f;if(null!=i&&"undefined"!=typeof i){var h=n(this),c=h.data(t),v=c.opt,u=n("#mCSB_"+c.idx+"_container"),l=u.parent(),y=typeof i;r||(r="x"===v.axis?"x":"y");var p="x"===r?u.outerWidth(!1):u.outerHeight(!1),a="x"===r?u[0].offsetLeft:u[0].offsetTop,w="x"===r?"left":"top";switch(y){case"function":return i();case"object":return(f=i.jquery?i:n(i),!f.length)?void 0:"x"===r?e(f)[1]:e(f)[0];case"string":case"number":return tt(i)?Math.abs(i):-1!==i.indexOf("%")?Math.abs(p*parseInt(i)/100):-1!==i.indexOf("-=")?Math.abs(a-parseInt(i.split("-=")[1])):-1!==i.indexOf("+=")?(o=a+parseInt(i.split("+=")[1]),o>=0?0:Math.abs(o)):-1!==i.indexOf("px")&&tt(i.split("px")[0])?Math.abs(i.split("px")[0]):"top"===i||"left"===i?0:"bottom"===i?Math.abs(l.height()-u.outerHeight(!1)):"right"===i?Math.abs(l.width()-u.outerWidth(!1)):"first"===i||"last"===i?(f=u.find(":"+i),"x"===r?e(f)[1]:e(f)[0]):n(i).length?"x"===r?e(n(i))[1]:e(n(i))[0]:(u.css(w,i),void s.update.call(null,h[0]))}}},ft=function(r){function c(){return clearTimeout(e[0].autoUpdate),0===o.parents("html").length?void(o=null):void(e[0].autoUpdate=setTimeout(function(){return f.advanced.updateOnSelectorChange&&(u.poll.change.n=v(),u.poll.change.n!==u.poll.change.o)?(u.poll.change.o=u.poll.change.n,void h(3)):f.advanced.updateOnContentResize&&(u.poll.size.n=o[0].scrollHeight+o[0].scrollWidth+e[0].offsetHeight+o[0].offsetHeight+o[0].offsetWidth,u.poll.size.n!==u.poll.size.o)?(u.poll.size.o=u.poll.size.n,void h(1)):!f.advanced.updateOnImageLoad||"auto"===f.advanced.updateOnImageLoad&&"y"===f.axis||(u.poll.img.n=e.find("img").length,u.poll.img.n===u.poll.img.o)?void((f.advanced.updateOnSelectorChange||f.advanced.updateOnContentResize||f.advanced.updateOnImageLoad)&&c()):(u.poll.img.o=u.poll.img.n,void e.find("img").each(function(){l(this)}))},f.advanced.autoUpdateTimeout))}function l(t){function u(n,t){return function(){return t.apply(n,arguments)}}function f(){this.onload=null;n(t).addClass(i[2]);h(2)}if(n(t).hasClass(i[2]))return void h();var r=new Image;r.onload=u(r,f);r.src=t.src}function v(){f.advanced.updateOnSelectorChange===!0&&(f.advanced.updateOnSelectorChange="*");var n=0,t=e.find(f.advanced.updateOnSelectorChange);return f.advanced.updateOnSelectorChange&&t.length>0&&t.each(function(){n+=this.offsetHeight+this.offsetWidth}),n}function h(n){clearTimeout(e[0].autoUpdate);s.update.call(null,o[0],n)}var o=n(this),u=o.data(t),f=u.opt,e=n("#mCSB_"+u.idx+"_container");return r?(clearTimeout(e[0].autoUpdate),void a(e[0],"autoUpdate")):void c()},ai=function(n,t,i){return Math.round(n/t)*t-i},o=function(i){var r=i.data(t),u=n("#mCSB_"+r.idx+"_container,#mCSB_"+r.idx+"_container_wrapper,#mCSB_"+r.idx+"_dragger_vertical,#mCSB_"+r.idx+"_dragger_horizontal");u.each(function(){vi.call(this)})},u=function(i,r,u){function h(n){return f&&e.callbacks[n]&&"function"==typeof e.callbacks[n]}function et(){return[e.callbacks.alwaysTriggerOffsets||p>=l[0]+v,e.callbacks.alwaysTriggerOffsets||-y>=p]}function a(){var n=[o[0].offsetTop,o[0].offsetLeft],t=[c[0].offsetTop,c[0].offsetLeft],r=[o.outerHeight(!1),o.outerWidth(!1)],f=[w.height(),w.width()];i[0].mcs={content:o,top:n[0],left:n[1],draggerTop:t[0],draggerLeft:t[1],topPct:Math.round(100*Math.abs(n[0])/(Math.abs(r[0])-f[0])),leftPct:Math.round(100*Math.abs(n[1])/(Math.abs(r[1])-f[1])),direction:u.dir}}var f=i.data(t),e=f.opt,ot={trigger:"internal",dir:"y",scrollEasing:"mcsEaseOut",drag:!1,dur:e.scrollInertia,overwrite:"all",callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},u=n.extend(ot,u),g=[u.dur,u.drag?0:u.dur],w=n("#mCSB_"+f.idx),o=n("#mCSB_"+f.idx+"_container"),b=o.parent(),nt=e.callbacks.onTotalScrollOffset?ut.call(i,e.callbacks.onTotalScrollOffset):[0,0],tt=e.callbacks.onTotalScrollBackOffset?ut.call(i,e.callbacks.onTotalScrollBackOffset):[0,0],it;if(f.trigger=u.trigger,(0!==b.scrollTop()||0!==b.scrollLeft())&&(n(".mCSB_"+f.idx+"_scrollbar").css("visibility","visible"),b.scrollTop(0).scrollLeft(0)),"_resetY"!==r||f.contentReset.y||(h("onOverflowYNone")&&e.callbacks.onOverflowYNone.call(i[0]),f.contentReset.y=1),"_resetX"!==r||f.contentReset.x||(h("onOverflowXNone")&&e.callbacks.onOverflowXNone.call(i[0]),f.contentReset.x=1),"_resetY"!==r&&"_resetX"!==r){(!f.contentReset.y&&i[0].mcs||!f.overflowed[0]||(h("onOverflowY")&&e.callbacks.onOverflowY.call(i[0]),f.contentReset.x=null),!f.contentReset.x&&i[0].mcs||!f.overflowed[1]||(h("onOverflowX")&&e.callbacks.onOverflowX.call(i[0]),f.contentReset.x=null),e.snapAmount)&&(it=e.snapAmount instanceof Array?"x"===u.dir?e.snapAmount[1]:e.snapAmount[0]:e.snapAmount,r=ai(r,it,e.snapOffset));switch(u.dir){case"x":var c=n("#mCSB_"+f.idx+"_dragger_horizontal"),k="left",p=o[0].offsetLeft,l=[w.width()-o.outerWidth(!1),c.parent().width()-c.width()],s=[r,0===r?0:r/f.scrollRatio.x],v=nt[1],y=tt[1],rt=v>0?v/f.scrollRatio.x:0,ft=y>0?y/f.scrollRatio.x:0;break;case"y":var c=n("#mCSB_"+f.idx+"_dragger_vertical"),k="top",p=o[0].offsetTop,l=[w.height()-o.outerHeight(!1),c.parent().height()-c.height()],s=[r,0===r?0:r/f.scrollRatio.y],v=nt[0],y=tt[0],rt=v>0?v/f.scrollRatio.y:0,ft=y>0?y/f.scrollRatio.y:0}s[1]<0||0===s[0]&&0===s[1]?s=[0,0]:s[1]>=l[1]?s=[l[0],l[1]]:s[0]=-s[0];i[0].mcs||(a(),h("onInit")&&e.callbacks.onInit.call(i[0]));clearTimeout(o[0].onCompleteTimeout);lt(c[0],k,Math.round(s[1]),g[1],u.scrollEasing);(f.tweenRunning||!(0===p&&s[0]>=0||p===l[0]&&s[0]<=l[0]))&&lt(o[0],k,Math.round(s[0]),g[0],u.scrollEasing,u.overwrite,{onStart:function(){u.callbacks&&u.onStart&&!f.tweenRunning&&(h("onScrollStart")&&(a(),e.callbacks.onScrollStart.call(i[0])),f.tweenRunning=!0,d(c),f.cbOffsets=et())},onUpdate:function(){u.callbacks&&u.onUpdate&&h("whileScrolling")&&(a(),e.callbacks.whileScrolling.call(i[0]))},onComplete:function(){if(u.callbacks&&u.onComplete){"yx"===e.axis&&clearTimeout(o[0].onCompleteTimeout);var n=o[0].idleTimer||0;o[0].onCompleteTimeout=setTimeout(function(){h("onScroll")&&(a(),e.callbacks.onScroll.call(i[0]));h("onTotalScroll")&&s[1]>=l[1]-rt&&f.cbOffsets[0]&&(a(),e.callbacks.onTotalScroll.call(i[0]));h("onTotalScrollBack")&&s[1]<=ft&&f.cbOffsets[1]&&(a(),e.callbacks.onTotalScrollBack.call(i[0]));f.tweenRunning=!1;o[0].idleTimer=0;d(c,"hide")},n)}}})}},lt=function(n,t,i,r,u,f,e){function a(){o.stop||(s||g.call(),s=w()-it,v(),s>=o.time&&(o.time=s>o.time?s+h-(s-o.time):s+h-1,o.time<s+1&&(o.time=s+1)),o.time<r?o.id=c(a):tt.call())}function v(){r>0?(o.currVal=d(o.time,l,p,r,u),y[t]=Math.round(o.currVal)+"px"):y[t]=i+"px";nt.call()}function b(){h=1e3/60;o.time=s+h;c=window.requestAnimationFrame?window.requestAnimationFrame:function(n){return v(),setTimeout(n,.01)};o.id=c(a)}function k(){null!=o.id&&(window.requestAnimationFrame?window.cancelAnimationFrame(o.id):clearTimeout(o.id),o.id=null)}function d(n,t,i,r,u){switch(u){case"linear":case"mcsLinear":return i*n/r+t;case"mcsLinearOut":return n/=r,n--,i*Math.sqrt(1-n*n)+t;case"easeInOutSmooth":return n/=r/2,1>n?i/2*n*n+t:(n--,-i/2*(n*(n-2)-1)+t);case"easeInOutStrong":return n/=r/2,1>n?i/2*Math.pow(2,10*(n-1))+t:(n--,i/2*(-Math.pow(2,-10*n)+2)+t);case"easeInOut":case"mcsEaseInOut":return n/=r/2,1>n?i/2*n*n*n+t:(n-=2,i/2*(n*n*n+2)+t);case"easeOutSmooth":return n/=r,n--,-i*(n*n*n*n-1)+t;case"easeOutStrong":return i*(-Math.pow(2,-10*n/r)+1)+t;case"easeOut":case"mcsEaseOut":default:var f=(n/=r)*n,e=f*n;return t+i*(.499999999999997*e*f+-2.5*f*f+5.5*e+-6.5*f+4*n)}}var p;n._mTween||(n._mTween={top:{},left:{}});var h,c,e=e||{},g=e.onStart||function(){},nt=e.onUpdate||function(){},tt=e.onComplete||function(){},it=w(),s=0,l=n.offsetTop,y=n.style,o=n._mTween[t];"left"===t&&(l=n.offsetLeft);p=i-l;o.stop=0;"none"!==f&&k();b()},w=function(){return window.performance&&window.performance.now?window.performance.now():window.performance&&window.performance.webkitNow?window.performance.webkitNow():Date.now?Date.now():(new Date).getTime()},vi=function(){var n=this,r,i,t;for(n._mTween||(n._mTween={top:{},left:{}}),r=["top","left"],i=0;i<r.length;i++)t=r[i],n._mTween[t].id&&(window.requestAnimationFrame?window.cancelAnimationFrame(n._mTween[t].id):clearTimeout(n._mTween[t].id),n._mTween[t].id=null,n._mTween[t].stop=1)},a=function(n,t){try{delete n[t]}catch(i){n[t]=null}},at=function(n){return!(n.which&&1!==n.which)},nt=function(n){var t=n.originalEvent.pointerType;return!(t&&"touch"!==t&&2!==t)},tt=function(n){return!isNaN(parseFloat(n))&&isFinite(n)},e=function(n){var t=n.parents(".mCSB_container");return[n.offset().top-t.offset().top,n.offset().left-t.offset().left]},yi=function(){function t(){var t=["webkit","moz","ms","o"],n;if("hidden"in document)return"hidden";for(n=0;n<t.length;n++)if(t[n]+"Hidden"in document)return t[n]+"Hidden";return null}var n=t();return n?document[n]:!1};n.fn[c]=function(t){return s[t]?s[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void n.error("Method "+t+" does not exist"):s.init.apply(this,arguments)};n[c]=function(t){return s[t]?s[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void n.error("Method "+t+" does not exist"):s.init.apply(this,arguments)};n[c].defaults=et;window[c]=!0;n(window).load(function(){n(it)[c]();n.extend(n.expr[":"],{mcsInView:n.expr[":"].mcsInView||function(t){var f,r,i=n(t),u=i.parents(".mCSB_container");if(u.length)return f=u.parent(),r=[u[0].offsetTop,u[0].offsetLeft],r[0]+e(i)[0]>=0&&r[0]+e(i)[0]<f.height()-i.outerHeight(!1)&&r[1]+e(i)[1]>=0&&r[1]+e(i)[1]<f.width()-i.outerWidth(!1)},mcsOverflow:n.expr[":"].mcsOverflow||function(i){var r=n(i).data(t);if(r)return r.overflowed[0]||r.overflowed[1]}})})})});jQuery(function(n){function c(){n(".ScrollTo > i").animate({top:0},1e3).animate({top:20},1e3,function(){setTimeout(c,100)})}var f=n(".sticky_player").attr("data-sticky"),r=n("#sticktop").attr("data-sticky"),e=n("#sticktop").height(),o=n(".sticky_player").height(),s=0,t=0,h=n(window).height(),u=n(window).width(),l,a;if(n(window).on("resize",function(){h=n(window).height();u=n(window).width();n(".hero_section").css("height",h+"px");var i=n(".hero_section").height(),t=n(".hero_content").height();i<t&&n(".hero_section").css("height",t+70+"px");n(".hero_section").css("padding-top",i/2-t/2+"px")}).resize(),r!="false"&&(t=e+10),f!="false"&&(t=o+10),r!="false"&&f!="false"&&(t=e+o+10),n("body").attr("data-offset",t+10),n(".navbar-nav a[href^='#'],.ScrollTo,.btn-scroll").click(function(i){i.preventDefault();n("html, body").stop().animate({scrollTop:n(n.attr(this,"href")).offset().top-t},1e3,"swing")}),n("#footer-rss").click(function(n){n.preventDefault();com.dotnetrocks.showviewModel.openRSSModal(!1)}),n("#footer-contact").click(function(t){t.preventDefault();n("#show_pop").modal("hide");n("#contact_pop").modal("show")}),n("#footer-apps").click(function(t){t.preventDefault();n("#show_pop").modal("hide");n("#apps_pop").modal("show")}),n("#footer-stream").click(function(t){t.preventDefault();n("#show_pop").modal("hide");n("#stream_pop").modal("show")}),u>700){n(".sticky_player").attr("data-sticky")!="false"&&(s=67);r!="false"&&n("#sticktop").sticky({topSpacing:s});n(".sticky_player").attr("data-sticky")!="false"&&(n(".sticky_player").height(67),n(".sticky_player").sticky({topSpacing:0}));n("#sticktop").on("sticky-start",function(){n(".sticky_player").attr("data-sticky")!="false"&&n(".rock_player").removeClass("pre_sticky")});n("#sticktop").on("sticky-end",function(){n(".sticky_player").attr("data-sticky")!="false"&&n(".rock_player").addClass("pre_sticky")})}n("body").on("hidden.bs.modal",".modal",function(){n(this).removeData("bs.modal");console.log("Removing displayedShowNumber: "+com.dotnetrocks.showviewModel.displayedShowNumber());com.dotnetrocks.showviewModel.displayedShowNumber("")});n(document).ajaxStart(function(){n(".spinner").show()});n(document).ajaxStop(function(){n(".spinner").hide()});n("body").vegas({slides:[{src:"../Content/img/BG/dnr-duo-reframed.jpg"},{src:"../Content/img/BG/bg-outside2.jpg"}],align:"20%"});u<760&&n("body").vegas("pause");c();n(".tweet").length!=0&&n(".tweet").twittie({username:"dotnetrocksshow",dateFormat:"%b. %d, %Y",template:'{{tweet}} <time class="date">{{date}}<\/time>',count:3,apiPath:"assets/php/tweet_api/tweet.php"},function(){n(".tweet ul").addClass("tweet_slider owl-carousel owl-theme");n(".tweet_slider").owlCarousel({slideSpeed:1e3,paginationSpeed:500,singleItem:!0,navigation:!1,autoHeight:!0})});n(".playlist_expander").click(function(t){t.preventDefault();n(".play_list").slideToggle()});n("#player-instance").jPlayer({cssSelectorAncestor:""});l=[];a=new jPlayerPlaylist({jPlayer:"#player-instance",cssSelectorAncestor:""},l,{playlistOptions:{autoPlay:!1}},{swfPath:"assets/jPlayer/Jplayer.swf",supplied:"mp3"});com.dotnetrocks.vars.werock=a;com.dotnetrocks.vars.playaPlay=function(t,i,r){var u=n("#player-instance"),f=u.data("jPlayer");console.log("Currently playing show number: "+f.status.media.artist);parseInt(f.status.media.artist)===parseInt(r)?u.jPlayer("play"):n("#player-instance").jPlayer("setMedia",{title:t,mp3:i,artist:r}).jPlayer("play")};com.dotnetrocks.vars.playaPause=function(){n("#player-instance").jPlayer("pause")};com.dotnetrocks.vars.pulsatePlaylist=function(){var t=n(".playlist_expander"),r=t.css("backgroundColor"),u="#cc1313",f=[u,r,u,r];window.setInterval(function(){i=i==f.length?0:i;t.animate({backgroundColor:f[i]},3e3);i++},1e3)};com.dotnetrocks.vars.setModalPlayButtonBasedOnPlayerStatus=function(t){var r=n("#player-instance"),i=r.data("jPlayer");console.log("Currently playing show number: "+i.status.media.artist);parseInt(i.status.media.artist)===parseInt(t)&&(console.log("Player paused: "+i.status.paused),i.status.paused?(n(".show_details_modal .latest_shows_play_track").show(),n(".show_details_modal .latest_shows_pause_track").hide()):(n(".show_details_modal .latest_shows_play_track").hide(),n(".show_details_modal .latest_shows_pause_track").show()))};n("#player-instance").bind(n.jPlayer.event.play,function(t){com.dotnetrocks.vars.markiwi();com.dotnetrocks.showviewModel.playingShowNumber(t.jPlayer.status.media.artist);com.dotnetrocks.showviewModel.trackPaused(!1);console.log("Playing "+t.jPlayer.status.media.title+". Show Number: "+t.jPlayer.status.media.artist);parseInt(t.jPlayer.status.media.artist)!=parseInt(com.dotnetrocks.showviewModel.displayedShowNumber())?com.dotnetrocks.showviewModel.showDetailsFromId(t.jPlayer.status.media.artist):(n(".show_details_modal .latest_shows_play_track").hide(),n(".show_details_modal .latest_shows_pause_track").show())});com.dotnetrocks.vars.markiwi=function(){n(".audio-title").marquee("destroy");n(".audio-title").marquee({gap:50,delayBeforeStart:0,direction:"left",pauseOnHover:!1,duplicated:!0})};n("#player-instance").bind(n.jPlayer.event.pause,function(t){n(".audio-title").marquee("pause");com.dotnetrocks.showviewModel.trackPaused(!0);parseInt(t.jPlayer.status.media.artist)===parseInt(com.dotnetrocks.showviewModel.displayedShowNumber())&&(n(".show_details_modal .latest_shows_play_track").show(),n(".show_details_modal .latest_shows_pause_track").hide())});n("#player-instance").jPlayer("volume","0.8");n(".jp-volume li a").click(function(t){t.preventDefault();n(".jp-volume li").removeClass("active");n("#player-instance").jPlayer("volume",(n(this).parent().index()+1)/5);for(var i=0;i<=n(this).parent().index();i++)n(".jp-volume li").eq(i).addClass("active")});n("#player-instance").bind(n.jPlayer.event.stalled,function(){console.log("Audio player is stalled")});n("#player-instance").bind(n.jPlayer.event.waiting,function(){console.log("Audio player is waiting");n("#audio-spinner").removeClass("hider")});n("#player-instance").bind(n.jPlayer.event.canplay,function(){console.log("Audio player can play");n("#audio-spinner").addClass("hider")});n("#player-instance").bind(n.jPlayer.event.error+".dotnetrocks",function(t){alert("Error Event: type = "+t.jPlayer.error.type);switch(t.jPlayer.error.type){case n.jPlayer.error.URL:Raygun.send(t.jPlayer.error,{issue:"Unable to play show",ShowNumber:t.jPlayer.status.media.artist})}})});jQuery.usingSafari=function(n){return n=n!=undefined?n:!0,n?/iPhone|iPad|iPod|Safari/i.test(navigator.userAgent)&&navigator.userAgent.indexOf("Chrome")==-1:/iPhone|iPad|iPod|Safari/i.test(navigator.userAgent)&&navigator.userAgent.indexOf("Chrome")==-1&&navigator.userAgent.indexOf("iPhone")==-1&&navigator.userAgent.indexOf("iPad")==-1&&navigator.userAgent.indexOf("iPod")==-1},function(n){n.fn.marquee=function(t){return this.each(function(){var i=n.extend({},n.fn.marquee.defaults,t),r=n(this),u,s,a,v,e,h=3,g="animation-play-state",f=!1,ft=function(n,t,i){for(var u=["webkit","moz","MS","o",""],r=0;r<u.length;r++)u[r]||(t=t.toLowerCase()),n.addEventListener(u[r]+t,i,!1)},ht=function(n){var i=[],t;for(t in n)n.hasOwnProperty(t)&&i.push(t+":"+n[t]);return i.push(),"{"+i.join(",")+"}"},et=function(){r.timer=setTimeout(d,i.delayBeforeStart)},y={pause:function(){f&&i.allowCss3Support?u.css(g,"paused"):n.fn.pause&&u.pause();r.data("runningStatus","paused");r.trigger("paused")},resume:function(){f&&i.allowCss3Support?u.css(g,"running"):n.fn.resume&&u.resume();r.data("runningStatus","resumed");r.trigger("resumed")},toggle:function(){y[r.data("runningStatus")=="resumed"?"pause":"resume"]()},destroy:function(){clearTimeout(r.timer);r.find("*").andSelf().unbind();r.html(r.find(".js-marquee:first").html())}},ct,p,ot,o,c,k,nt,rt,ut,d;if(typeof t=="string"){n.isFunction(y[t])&&(u||(u=r.find(".js-marquee-wrapper")),r.data("css3AnimationIsSupported")===!0&&(f=!0),y[t]());return}if(ct={},n.each(i,function(n){if(p=r.attr("data-"+n),typeof p!="undefined"){switch(p){case"true":p=!0;break;case"false":p=!1}i[n]=p}}),i.duration=i.speed||i.duration,v=i.direction=="up"||i.direction=="down",i.gap=i.duplicated?i.gap:0,r.wrapInner('<div class="js-marquee"><\/div>'),ot=r.find(".js-marquee").css({"margin-right":i.gap,float:"left"}),i.duplicated&&ot.clone(!0).appendTo(r),r.wrapInner('<div style="width:100000px" class="js-marquee-wrapper"><\/div>'),u=r.find(".js-marquee-wrapper"),v?(o=r.height(),u.removeAttr("style"),r.height(o),r.find(".js-marquee").css({float:"none","margin-bottom":i.gap,"margin-right":0}),i.duplicated&&r.find(".js-marquee:last").css({"margin-bottom":0}),c=r.find(".js-marquee:first").height()+i.gap,i.duration=(parseInt(c,10)+parseInt(o,10))/parseInt(o,10)*i.duration):(e=r.find(".js-marquee:first").width()+i.gap,s=r.width(),i.duration=(parseInt(e,10)+parseInt(s,10))/parseInt(s,10)*i.duration),i.duplicated&&(i.duration=i.duration/2),i.allowCss3Support){var st=document.body||document.createElement("div"),l="marqueeAnimation-"+Math.floor(Math.random()*1e7),tt="Webkit Moz O ms Khtml".split(" "),it="animation",w="",b="";if(st.style.animation&&(b="@keyframes "+l+" ",f=!0),f===!1)for(k=0;k<tt.length;k++)if(st.style[tt[k]+"AnimationName"]!==undefined){nt="-"+tt[k].toLowerCase()+"-";it=nt+it;g=nt+g;b="@"+nt+"keyframes "+l+" ";f=!0;break}f&&(w=l+" "+i.duration/1e3+"s "+i.delayBeforeStart/1e3+"s infinite "+i.css3easing,r.data("css3AnimationIsSupported",!0))}rt=function(){u.css("margin-top",i.direction=="up"?o+"px":"-"+c+"px")};ut=function(){u.css("margin-left",i.direction=="left"?s+"px":"-"+e+"px")};i.duplicated?(v?u.css("margin-top",i.direction=="up"?o:"-"+(c*2-i.gap)+"px"):u.css("margin-left",i.direction=="left"?s+"px":"-"+(e*2-i.gap)+"px"),h=1):v?rt():ut();d=function(){if(i.duplicated&&(h===1?(i._originalDuration=i.duration,i.duration=v?i.direction=="up"?i.duration+o/(c/i.duration):i.duration*2:i.direction=="left"?i.duration+s/(e/i.duration):i.duration*2,w&&(w=l+" "+i.duration/1e3+"s "+i.delayBeforeStart/1e3+"s "+i.css3easing),h++):h===2&&(i.duration=i._originalDuration,w&&(l=l+"0",b=n.trim(b)+"0 ",w=l+" "+i.duration/1e3+"s 0s infinite "+i.css3easing),h++)),v?i.duplicated?(h>2&&u.css("margin-top",i.direction=="up"?0:"-"+c+"px"),a={"margin-top":i.direction=="up"?"-"+c+"px":0}):(rt(),a={"margin-top":i.direction=="up"?"-"+u.height()+"px":o+"px"}):i.duplicated?(h>2&&u.css("margin-left",i.direction=="left"?0:"-"+e+"px"),a={"margin-left":i.direction=="left"?"-"+e+"px":0}):(ut(),a={"margin-left":i.direction=="left"?"-"+e+"px":s+"px"}),r.trigger("beforeStarting"),f){u.css(it,w);var t=b+" { 100%  "+ht(a)+"}",y=n("style");y.length!==0?y.filter(":last").append(t):n("head").append("<style>"+t+"<\/style>");ft(u[0],"AnimationIteration",function(){r.trigger("finished")});ft(u[0],"AnimationEnd",function(){d();r.trigger("finished")})}else u.animate(a,i.duration,i.easing,function(){r.trigger("finished");i.pauseOnCycle?et():d()});r.data("runningStatus","resumed")};r.bind("pause",y.pause);r.bind("resume",y.resume);i.pauseOnHover&&r.bind("mouseenter mouseleave",y.toggle);f&&i.allowCss3Support?d():et()})};n.fn.marquee.defaults={allowCss3Support:!0,css3easing:"linear",easing:"linear",delayBeforeStart:1e3,direction:"left",duplicated:!1,duration:5e3,gap:20,pauseOnCycle:!1,pauseOnHover:!1}}(jQuery);!function(n){n(["jquery"],function(n){return function(){function v(n,t,r){return u({type:f.error,iconClass:i().iconClasses.error,message:n,optionsOverride:r,title:t})}function r(r,u){return r||(r=i()),t=n("#"+r.containerId),t.length?t:(u&&(t=nt(r)),t)}function y(n,t,r){return u({type:f.info,iconClass:i().iconClasses.info,message:n,optionsOverride:r,title:t})}function p(n){o=n}function w(n,t,r){return u({type:f.success,iconClass:i().iconClasses.success,message:n,optionsOverride:r,title:t})}function b(n,t,r){return u({type:f.warning,iconClass:i().iconClasses.warning,message:n,optionsOverride:r,title:t})}function k(n){var u=i();t||r(u);s(n,u)||g(u)}function d(u){var f=i();return t||r(f),u&&0===n(":focus",u).length?void e(u):void(t.children().length&&t.remove())}function g(i){for(var u=t.children(),r=u.length-1;r>=0;r--)s(n(u[r]),i)}function s(t,i){return t&&0===n(":focus",t).length?(t[i.hideMethod]({duration:i.hideDuration,easing:i.hideEasing,complete:function(){e(t)}}),!0):!1}function nt(i){return t=n("<div/>").attr("id",i.containerId).addClass(i.positionClass).attr("aria-live","polite").attr("role","alert"),t.appendTo(n(i.target)),t}function tt(){return{tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:void 0,extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"toast-top-right",timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",target:"body",closeHtml:"<button>&times;<\/button>",newestOnTop:!0,preventDuplicates:!1,progressBar:!1}}function h(n){o&&o(n)}function u(u){function v(t){if(!n(":focus",o).length||t)return(clearTimeout(s.intervalId),o[f.hideMethod]({duration:f.hideDuration,easing:f.hideEasing,complete:function(){e(o);f.onHidden&&"hidden"!==a.state&&f.onHidden();a.state="hidden";a.endTime=new Date;h(a)}}))}function g(){(f.timeOut>0||f.extendedTimeOut>0)&&(w=setTimeout(v,f.extendedTimeOut),s.maxHideTime=parseFloat(f.extendedTimeOut),s.hideEta=(new Date).getTime()+s.maxHideTime)}function nt(){clearTimeout(w);s.hideEta=0;o.stop(!0,!0)[f.showMethod]({duration:f.showDuration,easing:f.showEasing})}function tt(){var n=(s.hideEta-(new Date).getTime())/s.maxHideTime*100;b.width(n+"%")}var f=i(),p=u.iconClass||f.iconClass;if(f.preventDuplicates){if(u.message===c)return;c=u.message}"undefined"!=typeof u.optionsOverride&&(f=n.extend(f,u.optionsOverride),p=u.optionsOverride.iconClass||p);l++;t=r(f,!0);var w=null,o=n("<div/>"),k=n("<div/>"),d=n("<div/>"),b=n("<div/>"),y=n(f.closeHtml),s={intervalId:null,hideEta:null,maxHideTime:null},a={toastId:l,state:"visible",startTime:new Date,options:f,map:u};return u.iconClass&&o.addClass(f.toastClass).addClass(p),u.title&&(k.append(u.title).addClass(f.titleClass),o.append(k)),u.message&&(d.append(u.message).addClass(f.messageClass),o.append(d)),f.closeButton&&(y.addClass("toast-close-button").attr("role","button"),o.prepend(y)),f.progressBar&&(b.addClass("toast-progress"),o.prepend(b)),o.hide(),f.newestOnTop?t.prepend(o):t.append(o),o[f.showMethod]({duration:f.showDuration,easing:f.showEasing,complete:f.onShown}),f.timeOut>0&&(w=setTimeout(v,f.timeOut),s.maxHideTime=parseFloat(f.timeOut),s.hideEta=(new Date).getTime()+s.maxHideTime,f.progressBar&&(s.intervalId=setInterval(tt,10))),o.hover(nt,g),!f.onclick&&f.tapToDismiss&&o.click(v),f.closeButton&&y&&y.click(function(n){n.stopPropagation?n.stopPropagation():void 0!==n.cancelBubble&&n.cancelBubble!==!0&&(n.cancelBubble=!0);v(!0)}),f.onclick&&o.click(function(){f.onclick();v()}),h(a),f.debug&&console&&console.log(a),o}function i(){return n.extend({},tt(),a.options)}function e(n){t||(t=r());n.is(":visible")||(n.remove(),n=null,0===t.children().length&&t.remove())}var t,o,c,l=0,f={error:"error",info:"info",success:"success",warning:"warning"},a={clear:k,remove:d,error:v,getContainer:r,info:y,options:{},subscribe:p,success:w,version:"2.1.0",warning:b};return a}()})}("function"==typeof define&&define.amd?define:function(n,t){"undefined"!=typeof module&&module.exports?module.exports=t(require("jquery")):window.toastr=t(window.jQuery)}),function(n){function it(n,t,i){switch(arguments.length){case 2:return null!=n?n:t;case 3:return null!=n?n:null!=t?t:i;default:throw new Error("Implement me");}}function p(n,t){return uf.call(n,t)}function ot(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function ri(n){t.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+n)}function o(n,t){var i=!0;return w(function(){return i&&(ri(n),i=!1),t.apply(this,arguments)},t)}function dr(n,t){br[n]||(ri(t),br[n]=!0)}function ui(n,t){return function(i){return r(n.call(this,i),t)}}function gr(n,t){return function(i){return this.localeData().ordinal(n.call(this,i),t)}}function nu(n,t){var r,f,u=12*(t.year()-n.year())+(t.month()-n.month()),i=n.clone().add(u,"months");return 0>t-i?(r=n.clone().add(u-1,"months"),f=(t-i)/(i-r)):(r=n.clone().add(u+1,"months"),f=(t-i)/(r-i)),-(u+f)}function tu(n,t,i){var r;return null==i?t:null!=n.meridiemHour?n.meridiemHour(t,i):null!=n.isPM?(r=n.isPM(i),r&&12>t&&(t+=12),r||12!==t||(t=0),t):t}function fi(){}function rt(n,i){i!==!1&&pi(n);ei(this,n);this._d=new Date(+n._d);ii===!1&&(ii=!0,t.updateOffset(this),ii=!1)}function st(n){var i=li(n),r=i.year||0,u=i.quarter||0,f=i.month||0,e=i.week||0,o=i.day||0,s=i.hour||0,h=i.minute||0,c=i.second||0,l=i.millisecond||0;this._milliseconds=+l+1e3*c+6e4*h+36e5*s;this._days=+o+7*e;this._months=+f+3*u+12*r;this._data={};this._locale=t.localeData();this._bubble()}function w(n,t){for(var i in t)p(t,i)&&(n[i]=t[i]);return p(t,"toString")&&(n.toString=t.toString),p(t,"valueOf")&&(n.valueOf=t.valueOf),n}function ei(n,t){var u,i,r;if("undefined"!=typeof t._isAMomentObject&&(n._isAMomentObject=t._isAMomentObject),"undefined"!=typeof t._i&&(n._i=t._i),"undefined"!=typeof t._f&&(n._f=t._f),"undefined"!=typeof t._l&&(n._l=t._l),"undefined"!=typeof t._strict&&(n._strict=t._strict),"undefined"!=typeof t._tzm&&(n._tzm=t._tzm),"undefined"!=typeof t._isUTC&&(n._isUTC=t._isUTC),"undefined"!=typeof t._offset&&(n._offset=t._offset),"undefined"!=typeof t._pf&&(n._pf=t._pf),"undefined"!=typeof t._locale&&(n._locale=t._locale),ft.length>0)for(u in ft)i=ft[u],r=t[i],"undefined"!=typeof r&&(n[i]=r);return n}function s(n){return 0>n?Math.ceil(n):Math.floor(n)}function r(n,t,i){for(var r=""+Math.abs(n),u=n>=0;r.length<t;)r="0"+r;return(u?i?"+":"":"-")+r}function oi(n,t){var i={milliseconds:0,months:0};return i.months=t.month()-n.month()+12*(t.year()-n.year()),n.clone().add(i.months,"M").isAfter(t)&&--i.months,i.milliseconds=+t-+n.clone().add(i.months,"M"),i}function iu(n,t){var i;return t=lt(t,n),n.isBefore(t)?i=oi(n,t):(i=oi(t,n),i.milliseconds=-i.milliseconds,i.months=-i.months),i}function si(n,i){return function(r,u){var f,e;return null===u||isNaN(+u)||(dr(i,"moment()."+i+"(period, number) is deprecated. Please use moment()."+i+"(number, period)."),e=r,r=u,u=e),r="string"==typeof r?+r:r,f=t.duration(r,u),hi(this,f,n),this}}function hi(n,i,r,u){var o=i._milliseconds,f=i._days,e=i._months;u=null==u?!0:u;o&&n._d.setTime(+n._d+o*r);f&&rr(n,"Date",bt(n,"Date")+f*r);e&&ir(n,bt(n,"Month")+e*r);u&&t.updateOffset(n,f||e)}function ut(n){return"[object Array]"===Object.prototype.toString.call(n)}function ht(n){return"[object Date]"===Object.prototype.toString.call(n)||n instanceof Date}function ci(n,t,r){for(var e=Math.min(n.length,t.length),o=Math.abs(n.length-t.length),f=0,u=0;e>u;u++)(r&&n[u]!==t[u]||!r&&i(n[u])!==i(t[u]))&&f++;return f+o}function f(n){if(n){var t=n.toLowerCase().replace(/(.)s$/,"$1");n=ne[n]||te[t]||t}return n}function li(n){var i,t,r={};for(t in n)p(n,t)&&(i=f(t),i&&(r[i]=n[t]));return r}function ru(i){var r,u;if(0===i.indexOf("week"))r=7,u="day";else{if(0!==i.indexOf("month"))return;r=12;u="month"}t[i]=function(f,e){var o,s,c=t._locale[i],h=[];if("number"==typeof f&&(e=f,f=n),s=function(n){var i=t().utc().set(u,n);return c.call(t._locale,i,f||"")},null!=e)return s(e);for(o=0;r>o;o++)h.push(s(o));return h}}function i(n){var t=+n,i=0;return 0!==t&&isFinite(t)&&(i=t>=0?Math.floor(t):Math.ceil(t)),i}function ct(n,t){return new Date(Date.UTC(n,t+1,0)).getUTCDate()}function ai(n,i,r){return b(t([n,11,31+i-r]),i,r).week}function vi(n){return yi(n)?366:365}function yi(n){return n%4==0&&n%100!=0||n%400==0}function pi(n){var t;n._a&&-2===n._pf.overflow&&(t=n._a[a]<0||n._a[a]>11?a:n._a[h]<1||n._a[h]>ct(n._a[l],n._a[a])?h:n._a[e]<0||n._a[e]>24||24===n._a[e]&&(0!==n._a[d]||0!==n._a[g]||0!==n._a[nt])?e:n._a[d]<0||n._a[d]>59?d:n._a[g]<0||n._a[g]>59?g:n._a[nt]<0||n._a[nt]>999?nt:-1,n._pf._overflowDayOfYear&&(l>t||t>h)&&(t=h),n._pf.overflow=t)}function wi(t){return null==t._isValid&&(t._isValid=!isNaN(t._d.getTime())&&t._pf.overflow<0&&!t._pf.empty&&!t._pf.invalidMonth&&!t._pf.nullInput&&!t._pf.invalidFormat&&!t._pf.userInvalidated,t._strict&&(t._isValid=t._isValid&&0===t._pf.charsLeftOver&&0===t._pf.unusedTokens.length&&t._pf.bigHour===n)),t._isValid}function bi(n){return n?n.toLowerCase().replace("_","-"):n}function uu(n){for(var i,t,f,r,u=0;u<n.length;){for(r=bi(n[u]).split("-"),i=r.length,t=bi(n[u+1]),t=t?t.split("-"):null;i>0;){if(f=ki(r.slice(0,i).join("-")))return f;if(t&&t.length>=i&&ci(r,t,!0)>=i-1)break;i--}u++}return null}function ki(n){var i=null;if(!tt[n]&&sr)try{i=t.locale();require("./locale/"+n);t.locale(i)}catch(r){}return tt[n]}function lt(n,i){var r,u;return i._isUTC?(r=i.clone(),u=(t.isMoment(n)||ht(n)?+n:+t(n))-+r,r._d.setTime(+r._d+u),t.updateOffset(r,!1),r):t(n).local()}function fu(n){return n.match(/\[[\s\S]/)?n.replace(/^\[|\]$/g,""):n.replace(/\\/g,"")}function eu(n){for(var i=n.match(hr),t=0,r=i.length;r>t;t++)i[t]=v[i[t]]?v[i[t]]:fu(i[t]);return function(u){var f="";for(t=0;r>t;t++)f+=i[t]instanceof Function?i[t].call(u,n):i[t];return f}}function at(n,t){return n.isValid()?(t=di(t,n.localeData()),ti[t]||(ti[t]=eu(t)),ti[t](n)):n.localeData().invalidDate()}function di(n,t){function r(n){return t.longDateFormat(n)||n}var i=5;for(et.lastIndex=0;i>=0&&et.test(n);)n=n.replace(et,r),et.lastIndex=0,i-=1;return n}function ou(n,t){var i=t._strict;switch(n){case"Q":return lr;case"DDDD":return vr;case"YYYY":case"GGGG":case"gggg":return i?wf:hf;case"Y":case"G":case"g":return kf;case"YYYYYY":case"YYYYY":case"GGGGG":case"ggggg":return i?bf:cf;case"S":if(i)return lr;case"SS":if(i)return ar;case"SSS":if(i)return vr;case"DDD":return sf;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return af;case"a":case"A":return t._locale._meridiemParse;case"x":return yf;case"X":return pf;case"Z":case"ZZ":return dt;case"T":return vf;case"SSSS":return lf;case"MM":case"DD":case"YY":case"GG":case"gg":case"HH":case"hh":case"mm":case"ss":case"ww":case"WW":return i?ar:cr;case"M":case"D":case"d":case"H":case"h":case"m":case"s":case"w":case"W":case"e":case"E":return cr;case"Do":return i?t._locale._ordinalParse:t._locale._ordinalParseLenient;default:return new RegExp(vu(au(n.replace("\\","")),"i"))}}function vt(n){n=n||"";var r=n.match(dt)||[],f=r[r.length-1]||[],t=(f+"").match(gf)||["-",0,0],u=+(60*t[1])+i(t[2]);return"+"===t[0]?u:-u}function su(n,r,u){var o,f=u._a;switch(n){case"Q":null!=r&&(f[a]=3*(i(r)-1));break;case"M":case"MM":null!=r&&(f[a]=i(r)-1);break;case"MMM":case"MMMM":o=u._locale.monthsParse(r,n,u._strict);null!=o?f[a]=o:u._pf.invalidMonth=r;break;case"D":case"DD":null!=r&&(f[h]=i(r));break;case"Do":null!=r&&(f[h]=i(parseInt(r.match(/\d{1,2}/)[0],10)));break;case"DDD":case"DDDD":null!=r&&(u._dayOfYear=i(r));break;case"YY":f[l]=t.parseTwoDigitYear(r);break;case"YYYY":case"YYYYY":case"YYYYYY":f[l]=i(r);break;case"a":case"A":u._meridiem=r;break;case"h":case"hh":u._pf.bigHour=!0;case"H":case"HH":f[e]=i(r);break;case"m":case"mm":f[d]=i(r);break;case"s":case"ss":f[g]=i(r);break;case"S":case"SS":case"SSS":case"SSSS":f[nt]=i(1e3*("0."+r));break;case"x":u._d=new Date(i(r));break;case"X":u._d=new Date(1e3*parseFloat(r));break;case"Z":case"ZZ":u._useUTC=!0;u._tzm=vt(r);break;case"dd":case"ddd":case"dddd":o=u._locale.weekdaysParse(r);null!=o?(u._w=u._w||{},u._w.d=o):u._pf.invalidWeekday=r;break;case"w":case"ww":case"W":case"WW":case"d":case"e":case"E":n=n.substr(0,1);case"gggg":case"GGGG":case"GGGGG":n=n.substr(0,2);r&&(u._w=u._w||{},u._w[n]=i(r));break;case"gg":case"GG":u._w=u._w||{};u._w[n]=t.parseTwoDigitYear(r)}}function hu(n){var i,o,f,u,r,e,s;i=n._w;null!=i.GG||null!=i.W||null!=i.E?(r=1,e=4,o=it(i.GG,n._a[l],b(t(),1,4).year),f=it(i.W,1),u=it(i.E,1)):(r=n._locale._week.dow,e=n._locale._week.doy,o=it(i.gg,n._a[l],b(t(),r,e).year),f=it(i.w,1),null!=i.d?(u=i.d,r>u&&++f):u=null!=i.e?i.e+r:r);s=tf(o,f,u,e,r);n._a[l]=s.year;n._dayOfYear=s.dayOfYear}function yt(n){var t,i,r,u,f=[];if(!n._d){for(r=lu(n),n._w&&null==n._a[h]&&null==n._a[a]&&hu(n),n._dayOfYear&&(u=it(n._a[l],r[l]),n._dayOfYear>vi(u)&&(n._pf._overflowDayOfYear=!0),i=wt(u,0,n._dayOfYear),n._a[a]=i.getUTCMonth(),n._a[h]=i.getUTCDate()),t=0;3>t&&null==n._a[t];++t)n._a[t]=f[t]=r[t];for(;7>t;t++)n._a[t]=f[t]=null==n._a[t]?2===t?1:0:n._a[t];24===n._a[e]&&0===n._a[d]&&0===n._a[g]&&0===n._a[nt]&&(n._nextDay=!0,n._a[e]=0);n._d=(n._useUTC?wt:ku).apply(null,f);null!=n._tzm&&n._d.setUTCMinutes(n._d.getUTCMinutes()-n._tzm);n._nextDay&&(n._a[e]=24)}}function cu(n){var t;n._d||(t=li(n._i),n._a=[t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],yt(n))}function lu(n){var t=new Date;return n._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function pt(i){if(i._f===t.ISO_8601)return void gi(i);i._a=[];i._pf.empty=!0;for(var r,f,h,u=""+i._i,l=u.length,c=0,s=di(i._f,i._locale).match(hr)||[],o=0;o<s.length;o++)f=s[o],r=(u.match(ou(f,i))||[])[0],r&&(h=u.substr(0,u.indexOf(r)),h.length>0&&i._pf.unusedInput.push(h),u=u.slice(u.indexOf(r)+r.length),c+=r.length),v[f]?(r?i._pf.empty=!1:i._pf.unusedTokens.push(f),su(f,r,i)):i._strict&&!r&&i._pf.unusedTokens.push(f);i._pf.charsLeftOver=l-c;u.length>0&&i._pf.unusedInput.push(u);i._pf.bigHour===!0&&i._a[e]<=12&&(i._pf.bigHour=n);i._a[e]=tu(i._locale,i._a[e],i._meridiem);yt(i);pi(i)}function au(n){return n.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(n,t,i,r,u){return t||i||r||u})}function vu(n){return n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function yu(n){var t,f,u,r,i;if(0===n._f.length)return n._pf.invalidFormat=!0,void(n._d=new Date(NaN));for(r=0;r<n._f.length;r++)i=0,t=ei({},n),null!=n._useUTC&&(t._useUTC=n._useUTC),t._pf=ot(),t._f=n._f[r],pt(t),wi(t)&&(i+=t._pf.charsLeftOver,i+=10*t._pf.unusedTokens.length,t._pf.score=i,(null==u||u>i)&&(u=i,f=t));w(n,f||t)}function gi(n){var t,i,r=n._i,u=df.exec(r);if(u){for(n._pf.iso=!0,t=0,i=gt.length;i>t;t++)if(gt[t][1].exec(r)){n._f=gt[t][0]+(u[6]||" ");break}for(t=0,i=ni.length;i>t;t++)if(ni[t][1].exec(r)){n._f+=ni[t][0];break}r.match(dt)&&(n._f+="Z");pt(n)}else n._isValid=!1}function pu(n){gi(n);n._isValid===!1&&(delete n._isValid,t.createFromInputFallback(n))}function wu(n,t){for(var r=[],i=0;i<n.length;++i)r.push(t(n[i],i));return r}function bu(i){var u,r=i._i;r===n?i._d=new Date:ht(r)?i._d=new Date(+r):null!==(u=ff.exec(r))?i._d=new Date(+u[1]):"string"==typeof r?pu(i):ut(r)?(i._a=wu(r.slice(0),function(n){return parseInt(n,10)}),yt(i)):"object"==typeof r?cu(i):"number"==typeof r?i._d=new Date(r):t.createFromInputFallback(i)}function ku(n,t,i,r,u,f,e){var o=new Date(n,t,i,r,u,f,e);return 1970>n&&o.setFullYear(n),o}function wt(n){var t=new Date(Date.UTC.apply(null,arguments));return 1970>n&&t.setUTCFullYear(n),t}function du(n,t){if("string"==typeof n)if(isNaN(n)){if(n=t.weekdaysParse(n),"number"!=typeof n)return null}else n=parseInt(n,10);return n}function gu(n,t,i,r,u){return u.relativeTime(t||1,!!i,n,r)}function nf(n,i,r){var u=t.duration(n).abs(),c=k(u.as("s")),e=k(u.as("m")),o=k(u.as("h")),s=k(u.as("d")),h=k(u.as("M")),l=k(u.as("y")),f=c<y.s&&["s",c]||1===e&&["m"]||e<y.m&&["mm",e]||1===o&&["h"]||o<y.h&&["hh",o]||1===s&&["d"]||s<y.d&&["dd",s]||1===h&&["M"]||h<y.M&&["MM",h]||1===l&&["y"]||["yy",l];return f[2]=i,f[3]=+n>0,f[4]=r,gu.apply({},f)}function b(n,i,r){var f,e=r-i,u=r-n.day();return u>e&&(u-=7),e-7>u&&(u+=7),f=t(n).add(u,"d"),{week:Math.ceil(f.dayOfYear()/7),year:f.year()}}function tf(n,t,i,r,u){var o,e,f=wt(n,0,1).getUTCDay();return f=0===f?7:f,i=null!=i?i:u,o=u-f+(f>r?7:0)-(u>f?7:0),e=7*(t-1)+(i-u)+o+1,{year:e>0?n:n-1,dayOfYear:e>0?e:vi(n-1)+e}}function nr(i){var u,r=i._i,f=i._f;return i._locale=i._locale||t.localeData(i._l),null===r||f===n&&""===r?t.invalid({nullInput:!0}):("string"==typeof r&&(i._i=r=i._locale.preparse(r)),t.isMoment(r)?new rt(r,!0):(f?ut(f)?yu(i):pt(i):bu(i),u=new rt(i),u._nextDay&&(u.add(1,"d"),u._nextDay=n),u))}function tr(n,i){var u,r;if(1===i.length&&ut(i[0])&&(i=i[0]),!i.length)return t();for(u=i[0],r=1;r<i.length;++r)i[r][n](u)&&(u=i[r]);return u}function ir(n,t){var i;return"string"==typeof t&&(t=n.localeData().monthsParse(t),"number"!=typeof t)?n:(i=Math.min(n.date(),ct(n.year(),t)),n._d["set"+(n._isUTC?"UTC":"")+"Month"](t,i),n)}function bt(n,t){return n._d["get"+(n._isUTC?"UTC":"")+t]()}function rr(n,t,i){return"Month"===t?ir(n,i):n._d["set"+(n._isUTC?"UTC":"")+t](i)}function c(n,i){return function(r){return null!=r?(rr(this,n,r),t.updateOffset(this,i),this):bt(this,n)}}function ur(n){return 400*n/146097}function fr(n){return 146097*n/400}function rf(n){t.duration.fn[n]=function(){return this._data[n]}}function er(n){"undefined"==typeof ender&&(or=kt.moment,kt.moment=n?o("Accessing Moment through the global scope is deprecated, and will be removed in an upcoming release.",t):t)}for(var t,or,u,kt="undefined"==typeof global||"undefined"!=typeof window&&window!==global.window?this:global,k=Math.round,uf=Object.prototype.hasOwnProperty,l=0,a=1,h=2,e=3,d=4,g=5,nt=6,tt={},ft=[],sr="undefined"!=typeof module&&module&&module.exports,ff=/^\/?Date\((\-?\d+)/i,ef=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,of=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,hr=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|x|X|zz?|ZZ?|.)/g,et=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,cr=/\d\d?/,sf=/\d{1,3}/,hf=/\d{1,4}/,cf=/[+\-]?\d{1,6}/,lf=/\d+/,af=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,dt=/Z|[\+\-]\d\d:?\d\d/gi,vf=/T/i,yf=/[\+\-]?\d+/,pf=/[\+\-]?\d+(\.\d{1,3})?/,lr=/\d/,ar=/\d\d/,vr=/\d{3}/,wf=/\d{4}/,bf=/[+-]?\d{6}/,kf=/[+-]?\d+/,df=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,gt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],ni=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],gf=/([\+\-]|\d\d)/gi,yr=("Date|Hours|Minutes|Seconds|Milliseconds".split("|"),{Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6}),ne={ms:"millisecond",s:"second",m:"minute",h:"hour",d:"day",D:"date",w:"week",W:"isoWeek",M:"month",Q:"quarter",y:"year",DDD:"dayOfYear",e:"weekday",E:"isoWeekday",gg:"weekYear",GG:"isoWeekYear"},te={dayofyear:"dayOfYear",isoweekday:"isoWeekday",isoweek:"isoWeek",weekyear:"weekYear",isoweekyear:"isoWeekYear"},ti={},y={s:45,m:45,h:22,d:26,M:11},pr="DDD w W M D d".split(" "),wr="M D H h m s w W".split(" "),v={M:function(){return this.month()+1},MMM:function(n){return this.localeData().monthsShort(this,n)},MMMM:function(n){return this.localeData().months(this,n)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(n){return this.localeData().weekdaysMin(this,n)},ddd:function(n){return this.localeData().weekdaysShort(this,n)},dddd:function(n){return this.localeData().weekdays(this,n)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return r(this.year()%100,2)},YYYY:function(){return r(this.year(),4)},YYYYY:function(){return r(this.year(),5)},YYYYYY:function(){var n=this.year(),t=n>=0?"+":"-";return t+r(Math.abs(n),6)},gg:function(){return r(this.weekYear()%100,2)},gggg:function(){return r(this.weekYear(),4)},ggggg:function(){return r(this.weekYear(),5)},GG:function(){return r(this.isoWeekYear()%100,2)},GGGG:function(){return r(this.isoWeekYear(),4)},GGGGG:function(){return r(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return i(this.milliseconds()/100)},SS:function(){return r(i(this.milliseconds()/10),2)},SSS:function(){return r(this.milliseconds(),3)},SSSS:function(){return r(this.milliseconds(),3)},Z:function(){var n=this.utcOffset(),t="+";return 0>n&&(n=-n,t="-"),t+r(i(n/60),2)+":"+r(i(n)%60,2)},ZZ:function(){var n=this.utcOffset(),t="+";return 0>n&&(n=-n,t="-"),t+r(i(n/60),2)+r(i(n)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},x:function(){return this.valueOf()},X:function(){return this.unix()},Q:function(){return this.quarter()}},br={},kr=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"],ii=!1;pr.length;)u=pr.pop(),v[u+"o"]=gr(v[u],u);for(;wr.length;)u=wr.pop(),v[u+u]=ui(v[u],2);for(v.DDDD=ui(v.DDD,3),w(fi.prototype,{set:function(n){var t,i;for(i in n)t=n[i],"function"==typeof t?this[i]=t:this["_"+i]=t;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(n){return this._months[n.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(n){return this._monthsShort[n.month()]},monthsParse:function(n,i,r){var u,f,e;for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),u=0;12>u;u++)if((f=t.utc([2e3,u]),r&&!this._longMonthsParse[u]&&(this._longMonthsParse[u]=new RegExp("^"+this.months(f,"").replace(".","")+"$","i"),this._shortMonthsParse[u]=new RegExp("^"+this.monthsShort(f,"").replace(".","")+"$","i")),r||this._monthsParse[u]||(e="^"+this.months(f,"")+"|^"+this.monthsShort(f,""),this._monthsParse[u]=new RegExp(e.replace(".",""),"i")),r&&"MMMM"===i&&this._longMonthsParse[u].test(n))||r&&"MMM"===i&&this._shortMonthsParse[u].test(n)||!r&&this._monthsParse[u].test(n))return u},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:function(n){return this._weekdays[n.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(n){return this._weekdaysShort[n.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(n){return this._weekdaysMin[n.day()]},weekdaysParse:function(n){var i,r,u;for(this._weekdaysParse||(this._weekdaysParse=[]),i=0;7>i;i++)if(this._weekdaysParse[i]||(r=t([2e3,1]).day(i),u="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[i]=new RegExp(u.replace(".",""),"i")),this._weekdaysParse[i].test(n))return i},_longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY LT",LLLL:"dddd, MMMM D, YYYY LT"},longDateFormat:function(n){var t=this._longDateFormat[n];return!t&&this._longDateFormat[n.toUpperCase()]&&(t=this._longDateFormat[n.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(n){return n.slice(1)}),this._longDateFormat[n]=t),t},isPM:function(n){return"p"===(n+"").toLowerCase().charAt(0)},_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(n,t,i){return n>11?i?"pm":"PM":i?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},calendar:function(n,t,i){var r=this._calendar[n];return"function"==typeof r?r.apply(t,[i]):r},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(n,t,i,r){var u=this._relativeTime[i];return"function"==typeof u?u(n,t,i,r):u.replace(/%d/i,n)},pastFuture:function(n,t){var i=this._relativeTime[n>0?"future":"past"];return"function"==typeof i?i(t):i.replace(/%s/i,t)},ordinal:function(n){return this._ordinal.replace("%d",n)},_ordinal:"%d",_ordinalParse:/\d{1,2}/,preparse:function(n){return n},postformat:function(n){return n},week:function(n){return b(n,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6},firstDayOfWeek:function(){return this._week.dow},firstDayOfYear:function(){return this._week.doy},_invalidDate:"Invalid date",invalidDate:function(){return this._invalidDate}}),t=function(t,i,r,u){var f;return"boolean"==typeof r&&(u=r,r=n),f={},f._isAMomentObject=!0,f._i=t,f._f=i,f._l=r,f._strict=u,f._isUTC=!1,f._pf=ot(),nr(f)},t.suppressDeprecationWarnings=!1,t.createFromInputFallback=o("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(n){n._d=new Date(n._i+(n._useUTC?" UTC":""))}),t.min=function(){var n=[].slice.call(arguments,0);return tr("isBefore",n)},t.max=function(){var n=[].slice.call(arguments,0);return tr("isAfter",n)},t.utc=function(t,i,r,u){var f;return"boolean"==typeof r&&(u=r,r=n),f={},f._isAMomentObject=!0,f._useUTC=!0,f._isUTC=!0,f._l=r,f._i=t,f._f=i,f._strict=u,f._pf=ot(),nr(f).utc()},t.unix=function(n){return t(1e3*n)},t.duration=function(n,r){var o,c,s,l,u=n,f=null;return t.isDuration(n)?u={ms:n._milliseconds,d:n._days,M:n._months}:"number"==typeof n?(u={},r?u[r]=n:u.milliseconds=n):(f=ef.exec(n))?(o="-"===f[1]?-1:1,u={y:0,d:i(f[h])*o,h:i(f[e])*o,m:i(f[d])*o,s:i(f[g])*o,ms:i(f[nt])*o}):(f=of.exec(n))?(o="-"===f[1]?-1:1,s=function(n){var t=n&&parseFloat(n.replace(",","."));return(isNaN(t)?0:t)*o},u={y:s(f[2]),M:s(f[3]),d:s(f[4]),h:s(f[5]),m:s(f[6]),s:s(f[7]),w:s(f[8])}):null==u?u={}:"object"==typeof u&&("from"in u||"to"in u)&&(l=iu(t(u.from),t(u.to)),u={},u.ms=l.milliseconds,u.M=l.months),c=new st(u),t.isDuration(n)&&p(n,"_locale")&&(c._locale=n._locale),c},t.version="2.9.0",t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",t.ISO_8601=function(){},t.momentProperties=ft,t.updateOffset=function(){},t.relativeTimeThreshold=function(t,i){return y[t]===n?!1:i===n?y[t]:(y[t]=i,!0)},t.lang=o("moment.lang is deprecated. Use moment.locale instead.",function(n,i){return t.locale(n,i)}),t.locale=function(n,i){var r;return n&&(r="undefined"!=typeof i?t.defineLocale(n,i):t.localeData(n),r&&(t.duration._locale=t._locale=r)),t._locale._abbr},t.defineLocale=function(n,i){return null!==i?(i.abbr=n,tt[n]||(tt[n]=new fi),tt[n].set(i),t.locale(n),tt[n]):(delete tt[n],null)},t.langData=o("moment.langData is deprecated. Use moment.localeData instead.",function(n){return t.localeData(n)}),t.localeData=function(n){var i;if(n&&n._locale&&n._locale._abbr&&(n=n._locale._abbr),!n)return t._locale;if(!ut(n)){if(i=ki(n))return i;n=[n]}return uu(n)},t.isMoment=function(n){return n instanceof rt||null!=n&&p(n,"_isAMomentObject")},t.isDuration=function(n){return n instanceof st},u=kr.length-1;u>=0;--u)ru(kr[u]);t.normalizeUnits=function(n){return f(n)};t.invalid=function(n){var i=t.utc(NaN);return null!=n?w(i._pf,n):i._pf.userInvalidated=!0,i};t.parseZone=function(){return t.apply(null,arguments).parseZone()};t.parseTwoDigitYear=function(n){return i(n)+(i(n)>68?1900:2e3)};t.isDate=ht;w(t.fn=rt.prototype,{clone:function(){return t(this)},valueOf:function(){return+this._d-6e4*(this._offset||0)},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var n=t(this).utc();return 0<n.year()&&n.year()<=9999?"function"==typeof Date.prototype.toISOString?this.toDate().toISOString():at(n,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):at(n,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){var n=this;return[n.year(),n.month(),n.date(),n.hours(),n.minutes(),n.seconds(),n.milliseconds()]},isValid:function(){return wi(this)},isDSTShifted:function(){return this._a?this.isValid()&&ci(this._a,(this._isUTC?t.utc(this._a):t(this._a)).toArray())>0:!1},parsingFlags:function(){return w({},this._pf)},invalidAt:function(){return this._pf.overflow},utc:function(n){return this.utcOffset(0,n)},local:function(n){return this._isUTC&&(this.utcOffset(0,n),this._isUTC=!1,n&&this.subtract(this._dateUtcOffset(),"m")),this},format:function(n){var i=at(this,n||t.defaultFormat);return this.localeData().postformat(i)},add:si(1,"add"),subtract:si(-1,"subtract"),diff:function(n,t,i){var r,u,e=lt(n,this),o=6e4*(e.utcOffset()-this.utcOffset());return t=f(t),"year"===t||"month"===t||"quarter"===t?(u=nu(this,e),"quarter"===t?u/=3:"year"===t&&(u/=12)):(r=this-e,u="second"===t?r/1e3:"minute"===t?r/6e4:"hour"===t?r/36e5:"day"===t?(r-o)/864e5:"week"===t?(r-o)/6048e5:r),i?u:s(u)},from:function(n,i){return t.duration({to:this,from:n}).locale(this.locale()).humanize(!i)},fromNow:function(n){return this.from(t(),n)},calendar:function(n){var r=n||t(),u=lt(r,this).startOf("day"),i=this.diff(u,"days",!0),f=-6>i?"sameElse":-1>i?"lastWeek":0>i?"lastDay":1>i?"sameDay":2>i?"nextDay":7>i?"nextWeek":"sameElse";return this.format(this.localeData().calendar(f,this,t(r)))},isLeapYear:function(){return yi(this.year())},isDST:function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},day:function(n){var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=n?(n=du(n,this.localeData()),this.add(n-t,"d")):t},month:c("Month",!0),startOf:function(n){switch(n=f(n)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===n?this.weekday(0):"isoWeek"===n&&this.isoWeekday(1),"quarter"===n&&this.month(3*Math.floor(this.month()/3)),this},endOf:function(t){return t=f(t),t===n||"millisecond"===t?this:this.startOf(t).add(1,"isoWeek"===t?"week":t).subtract(1,"ms")},isAfter:function(n,i){var r;return i=f("undefined"!=typeof i?i:"millisecond"),"millisecond"===i?(n=t.isMoment(n)?n:t(n),+this>+n):(r=t.isMoment(n)?+n:+t(n),r<+this.clone().startOf(i))},isBefore:function(n,i){var r;return i=f("undefined"!=typeof i?i:"millisecond"),"millisecond"===i?(n=t.isMoment(n)?n:t(n),+n>+this):(r=t.isMoment(n)?+n:+t(n),+this.clone().endOf(i)<r)},isBetween:function(n,t,i){return this.isAfter(n,i)&&this.isBefore(t,i)},isSame:function(n,i){var r;return i=f(i||"millisecond"),"millisecond"===i?(n=t.isMoment(n)?n:t(n),+this==+n):(r=+t(n),+this.clone().startOf(i)<=r&&r<=+this.clone().endOf(i))},min:o("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(n){return n=t.apply(null,arguments),this>n?this:n}),max:o("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(n){return n=t.apply(null,arguments),n>this?this:n}),zone:o("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",function(n,t){return null!=n?("string"!=typeof n&&(n=-n),this.utcOffset(n,t),this):-this.utcOffset()}),utcOffset:function(n,i){var r,u=this._offset||0;return null!=n?("string"==typeof n&&(n=vt(n)),Math.abs(n)<16&&(n=60*n),!this._isUTC&&i&&(r=this._dateUtcOffset()),this._offset=n,this._isUTC=!0,null!=r&&this.add(r,"m"),u!==n&&(!i||this._changeInProgress?hi(this,t.duration(n-u,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,t.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?u:this._dateUtcOffset()},isLocal:function(){return!this._isUTC},isUtcOffset:function(){return this._isUTC},isUtc:function(){return this._isUTC&&0===this._offset},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},parseZone:function(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(vt(this._i)),this},hasAlignedHourOffset:function(n){return n=n?t(n).utcOffset():0,(this.utcOffset()-n)%60==0},daysInMonth:function(){return ct(this.year(),this.month())},dayOfYear:function(n){var i=k((t(this).startOf("day")-t(this).startOf("year"))/864e5)+1;return null==n?i:this.add(n-i,"d")},quarter:function(n){return null==n?Math.ceil((this.month()+1)/3):this.month(3*(n-1)+this.month()%3)},weekYear:function(n){var t=b(this,this.localeData()._week.dow,this.localeData()._week.doy).year;return null==n?t:this.add(n-t,"y")},isoWeekYear:function(n){var t=b(this,1,4).year;return null==n?t:this.add(n-t,"y")},week:function(n){var t=this.localeData().week(this);return null==n?t:this.add(7*(n-t),"d")},isoWeek:function(n){var t=b(this,1,4).week;return null==n?t:this.add(7*(n-t),"d")},weekday:function(n){var t=(this.day()+7-this.localeData()._week.dow)%7;return null==n?t:this.add(n-t,"d")},isoWeekday:function(n){return null==n?this.day()||7:this.day(this.day()%7?n:n-7)},isoWeeksInYear:function(){return ai(this.year(),1,4)},weeksInYear:function(){var n=this.localeData()._week;return ai(this.year(),n.dow,n.doy)},get:function(n){return n=f(n),this[n]()},set:function(n,t){var i;if("object"==typeof n)for(i in n)this.set(i,n[i]);else n=f(n),"function"==typeof this[n]&&this[n](t);return this},locale:function(i){var r;return i===n?this._locale._abbr:(r=t.localeData(i),null!=r&&(this._locale=r),this)},lang:o("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return t===n?this.localeData():this.locale(t)}),localeData:function(){return this._locale},_dateUtcOffset:function(){return 15*-Math.round(this._d.getTimezoneOffset()/15)}});t.fn.millisecond=t.fn.milliseconds=c("Milliseconds",!1);t.fn.second=t.fn.seconds=c("Seconds",!1);t.fn.minute=t.fn.minutes=c("Minutes",!1);t.fn.hour=t.fn.hours=c("Hours",!0);t.fn.date=c("Date",!0);t.fn.dates=o("dates accessor is deprecated. Use date instead.",c("Date",!0));t.fn.year=c("FullYear",!0);t.fn.years=o("years accessor is deprecated. Use year instead.",c("FullYear",!0));t.fn.days=t.fn.day;t.fn.months=t.fn.month;t.fn.weeks=t.fn.week;t.fn.isoWeeks=t.fn.isoWeek;t.fn.quarters=t.fn.quarter;t.fn.toJSON=t.fn.toISOString;t.fn.isUTC=t.fn.isUtc;w(t.duration.fn=st.prototype,{_bubble:function(){var u,f,e,o=this._milliseconds,t=this._days,i=this._months,n=this._data,r=0;n.milliseconds=o%1e3;u=s(o/1e3);n.seconds=u%60;f=s(u/60);n.minutes=f%60;e=s(f/60);n.hours=e%24;t+=s(e/24);r=s(ur(t));t-=s(fr(r));i+=s(t/30);t%=30;r+=s(i/12);i%=12;n.days=t;n.months=i;n.years=r},abs:function(){return this._milliseconds=Math.abs(this._milliseconds),this._days=Math.abs(this._days),this._months=Math.abs(this._months),this._data.milliseconds=Math.abs(this._data.milliseconds),this._data.seconds=Math.abs(this._data.seconds),this._data.minutes=Math.abs(this._data.minutes),this._data.hours=Math.abs(this._data.hours),this._data.months=Math.abs(this._data.months),this._data.years=Math.abs(this._data.years),this},weeks:function(){return s(this.days()/7)},valueOf:function(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*i(this._months/12)},humanize:function(n){var t=nf(this,!n,this.localeData());return n&&(t=this.localeData().pastFuture(+this,t)),this.localeData().postformat(t)},add:function(n,i){var r=t.duration(n,i);return this._milliseconds+=r._milliseconds,this._days+=r._days,this._months+=r._months,this._bubble(),this},subtract:function(n,i){var r=t.duration(n,i);return this._milliseconds-=r._milliseconds,this._days-=r._days,this._months-=r._months,this._bubble(),this},get:function(n){return n=f(n),this[n.toLowerCase()+"s"]()},as:function(n){var t,i;if(n=f(n),"month"===n||"year"===n)return t=this._days+this._milliseconds/864e5,i=this._months+12*ur(t),"month"===n?i:i/12;switch(t=this._days+Math.round(fr(this._months/12)),n){case"week":return t/7+this._milliseconds/6048e5;case"day":return t+this._milliseconds/864e5;case"hour":return 24*t+this._milliseconds/36e5;case"minute":return 1440*t+this._milliseconds/6e4;case"second":return 86400*t+this._milliseconds/1e3;case"millisecond":return Math.floor(864e5*t)+this._milliseconds;default:throw new Error("Unknown unit "+n);}},lang:t.fn.lang,locale:t.fn.locale,toIsoString:o("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",function(){return this.toISOString()}),toISOString:function(){var r=Math.abs(this.years()),u=Math.abs(this.months()),f=Math.abs(this.days()),n=Math.abs(this.hours()),t=Math.abs(this.minutes()),i=Math.abs(this.seconds()+this.milliseconds()/1e3);return this.asSeconds()?(this.asSeconds()<0?"-":"")+"P"+(r?r+"Y":"")+(u?u+"M":"")+(f?f+"D":"")+(n||t||i?"T":"")+(n?n+"H":"")+(t?t+"M":"")+(i?i+"S":""):"P0D"},localeData:function(){return this._locale},toJSON:function(){return this.toISOString()}});t.duration.fn.toString=t.duration.fn.toISOString;for(u in yr)p(yr,u)&&rf(u.toLowerCase());t.duration.fn.asMilliseconds=function(){return this.as("ms")};t.duration.fn.asSeconds=function(){return this.as("s")};t.duration.fn.asMinutes=function(){return this.as("m")};t.duration.fn.asHours=function(){return this.as("h")};t.duration.fn.asDays=function(){return this.as("d")};t.duration.fn.asWeeks=function(){return this.as("weeks")};t.duration.fn.asMonths=function(){return this.as("M")};t.duration.fn.asYears=function(){return this.as("y")};t.locale("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(n){var t=n%10,r=1===i(n%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return n+r}});sr?module.exports=t:"function"==typeof define&&define.amd?(define(function(n,i,r){return r.config&&r.config()&&r.config().noGlobal===!0&&(kt.moment=or),t}),er(!0)):er()}.call(this)