!function(){define("durandal/system",["require","jquery"],function(e,t){function n(e){var t="[object "+e+"]";r["is"+e]=function(e){return s.call(e)==t}}var r,a=!1,o=Object.keys,i=Object.prototype.hasOwnProperty,s=Object.prototype.toString,d=!1,l=Array.isArray,c=Array.prototype.slice;if(String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),Function.prototype.bind&&("object"==typeof console||"function"==typeof console)&&"object"==typeof console.log)try{["log","info","warn","error","assert","dir","clear","profile","profileEnd"].forEach(function(e){console[e]=this.call(console[e],console)},Function.prototype.bind)}catch(u){d=!0}e.on&&e.on("moduleLoaded",function(e,t){r.setModuleId(e,t)}),"undefined"!=typeof requirejs&&(requirejs.onResourceLoad=function(e,t){r.setModuleId(e.defined[t.id],t.id)});var p=function(){},m=function(){try{if("undefined"!=typeof console&&"function"==typeof console.log)if(window.opera)for(var e=0;e1||a?c.call(e,0):e[0])},1)},function(e){n.reject(e)})}).promise()},extend:function(e){for(var t=c.call(arguments,1),n=0;n1?t(n).wrapAll('
').parent().get(0):n[0]},tryGetViewFromCache:function(e){return this.cache[e]},putViewInCache:function(e,t){this.cache[e]=t},createView:function(t){var n=this,r=this.convertViewIdToRequirePath(t),a=this.tryGetViewFromCache(r);return a?e.defer(function(e){e.resolve(a.cloneNode(!0))}).promise():e.defer(function(a){e.acquire(r).then(function(e){var o=n.processMarkup(e);o.setAttribute("data-view",t),n.putViewInCache(r,o),a.resolve(o.cloneNode(!0))}).fail(function(e){n.createFallbackView(t,r,e).then(function(e){e.setAttribute("data-view",t),n.cache[r]=e,a.resolve(e.cloneNode(!0))})})}).promise()},createFallbackView:function(t,n){var r=this,a='View Not Found. Searched for "'+t+'" via path "'+n+'".';return e.defer(function(e){e.resolve(r.processMarkup('
'+a+"
"))}).promise()}}}),define("durandal/viewLocator",["durandal/system","durandal/viewEngine"],function(e,t){function n(e,t){for(var n=0;n\|\:])/g,"\\$1")}return{useConvention:function(e,t,n){e=e||"viewmodels",t=t||"views",n=n||t;var a=new RegExp(r(e),"gi");this.convertModuleIdToViewId=function(e){return e.replace(a,t)},this.translateViewIdToArea=function(e,t){return t&&"partial"!=t?n+"/"+t+"/"+e:n+"/"+e}},locateViewForObject:function(t,n,r){var a;if(t.getView&&(a=t.getView()))return this.locateView(a,n,r);if(t.viewUrl)return this.locateView(t.viewUrl,n,r);var o=e.getModuleId(t);return o?this.locateView(this.convertModuleIdToViewId(o),n,r):this.locateView(this.determineFallbackViewId(t),n,r)},convertModuleIdToViewId:function(e){return e},determineFallbackViewId:function(e){var t=/function (.{1,})\(/,n=t.exec(e.constructor.toString()),r=n&&n.length>1?n[1]:"";return r=r.trim(),"views/"+r},translateViewIdToArea:function(e){return e},locateView:function(r,a,o){if("string"==typeof r){var i;if(i=t.isViewUrl(r)?t.convertViewUrlToViewId(r):r,a&&(i=this.translateViewIdToArea(i,a)),o){var s=n(o,i);if(s)return e.defer(function(e){e.resolve(s)}).promise()}return t.createView(i)}return e.defer(function(e){e.resolve(r)}).promise()}}}),define("durandal/binder",["durandal/system","knockout"],function(e,t){function n(t){return void 0===t?{applyBindings:!0}:e.isBoolean(t)?{applyBindings:t}:(void 0===t.applyBindings&&(t.applyBindings=!0),t)}function r(r,l,c,u){if(!l||!c)return void(a.throwOnErrors?e.error(o):e.log(o,l,u));if(!l.getAttribute)return void(a.throwOnErrors?e.error(i):e.log(i,l,u));var p=l.getAttribute("data-view");try{var m;return r&&r.binding&&(m=r.binding(l)),m=n(m),a.binding(u,l,m),m.applyBindings?(e.log("Binding",p,u),t.applyBindings(c,l)):r&&t.utils.domData.set(l,d,{$data:r}),a.bindingComplete(u,l,m),r&&r.bindingComplete&&r.bindingComplete(l),t.utils.domData.set(l,s,m),m}catch(h){h.message=h.message+";\nView: "+p+";\nModuleId: "+e.getModuleId(u),a.throwOnErrors?e.error(h):e.log(h.message)}}var a,o="Insufficient Information to Bind",i="Unexpected View Type",s="durandal-binding-instruction",d="__ko_bindingContext__";return a={binding:e.noop,bindingComplete:e.noop,throwOnErrors:!1,getBindingInstruction:function(e){return t.utils.domData.get(e,s)},bindContext:function(e,t,n,a){return n&&e&&(e=e.createChildContext(n,"string"==typeof a?a:null)),r(n,t,e,n||(e?e.$data:null))},bind:function(e,t){return r(e,t,e,e)}}}),define("durandal/activator",["durandal/system","knockout"],function(e,t){function n(t){return void 0==t&&(t={}),e.isBoolean(t.closeOnDeactivate)||(t.closeOnDeactivate=l.defaults.closeOnDeactivate),t.beforeActivate||(t.beforeActivate=l.defaults.beforeActivate),t.afterDeactivate||(t.afterDeactivate=l.defaults.afterDeactivate),t.affirmations||(t.affirmations=l.defaults.affirmations),t.interpretResponse||(t.interpretResponse=l.defaults.interpretResponse),t.areSameItem||(t.areSameItem=l.defaults.areSameItem),t.findChildActivator||(t.findChildActivator=l.defaults.findChildActivator),t}function r(t,n,r){return e.isArray(r)?t[n].apply(t,r):t[n](r)}function a(t,n,r,a,o){if(t&&t.deactivate){e.log("Deactivating",t);var i;try{i=t.deactivate(n)}catch(s){return e.log("ERROR: "+s.message,s),void a.resolve(!1)}i&&i.then?i.then(function(){r.afterDeactivate(t,n,o),a.resolve(!0)},function(t){e.log(t),a.resolve(!1)}):(r.afterDeactivate(t,n,o),a.resolve(!0))}else t&&r.afterDeactivate(t,n,o),a.resolve(!0)}function o(t,n,a,o){var i;if(t&&t.activate){e.log("Activating",t);try{i=r(t,"activate",o)}catch(s){return e.log("ERROR: "+s.message,s),void a(!1)}}i&&i.then?i.then(function(){n(t),a(!0)},function(t){e.log("ERROR: "+t.message,t),a(!1)}):(n(t),a(!0))}function i(t,n,r,a){return a=e.extend({},c,a),r.lifecycleData=null,e.defer(function(o){function i(){if(t&&t.canDeactivate&&a.canDeactivate){var i;try{i=t.canDeactivate(n)}catch(s){return e.log("ERROR: "+s.message,s),void o.resolve(!1)}i.then?i.then(function(e){r.lifecycleData=e,o.resolve(r.interpretResponse(e))},function(t){e.log("ERROR: "+t.message,t),o.resolve(!1)}):(r.lifecycleData=i,o.resolve(r.interpretResponse(i)))}else o.resolve(!0)}var s=r.findChildActivator(t);s?s.canDeactivate().then(function(e){e?i():o.resolve(!1)}):i()}).promise()}function s(t,n,a,o,i){return a.lifecycleData=null,e.defer(function(s){if(a.areSameItem(n(),t,o,i))return void s.resolve(!0);if(t&&t.canActivate){var d;try{d=r(t,"canActivate",i)}catch(l){return e.log("ERROR: "+l.message,l),void s.resolve(!1)}d.then?d.then(function(e){a.lifecycleData=e,s.resolve(a.interpretResponse(e))},function(t){e.log("ERROR: "+t.message,t),s.resolve(!1)}):(a.lifecycleData=d,s.resolve(a.interpretResponse(d)))}else s.resolve(!0)}).promise()}function d(r,d){var l,c=t.observable(null);d=n(d);var u=t.computed({read:function(){return c()},write:function(e){u.viaSetter=!0,u.activateItem(e)}});return u.__activator__=!0,u.settings=d,d.activator=u,u.isActivating=t.observable(!1),u.forceActiveItem=function(e){c(e)},u.canDeactivateItem=function(e,t,n){return i(e,t,d,n)},u.deactivateItem=function(t,n){return e.defer(function(e){u.canDeactivateItem(t,n).then(function(r){r?a(t,n,d,e,c):(u.notifySubscribers(),e.resolve(!1))})}).promise()},u.canActivateItem=function(e,t){return s(e,c,d,l,t)},u.activateItem=function(t,n,r){var i=u.viaSetter;return u.viaSetter=!1,e.defer(function(s){if(u.isActivating())return void s.resolve(!1);u.isActivating(!0);var p=c();return d.areSameItem(p,t,l,n)?(u.isActivating(!1),void s.resolve(!0)):void u.canDeactivateItem(p,d.closeOnDeactivate,r).then(function(r){r?u.canActivateItem(t,n).then(function(r){r?e.defer(function(e){a(p,d.closeOnDeactivate,d,e)}).promise().then(function(){t=d.beforeActivate(t,n),o(t,c,function(e){l=n,u.isActivating(!1),s.resolve(e)},n)}):(i&&u.notifySubscribers(),u.isActivating(!1),s.resolve(!1))}):(i&&u.notifySubscribers(),u.isActivating(!1),s.resolve(!1))})}).promise()},u.canActivate=function(){var e;return r?(e=r,r=!1):e=u(),u.canActivateItem(e)},u.activate=function(){var e;return r?(e=r,r=!1):e=u(),u.activateItem(e)},u.canDeactivate=function(e){return u.canDeactivateItem(u(),e)},u.deactivate=function(e){return u.deactivateItem(u(),e)},u.includeIn=function(e){e.canActivate=function(){return u.canActivate()},e.activate=function(){return u.activate()},e.canDeactivate=function(e){return u.canDeactivate(e)},e.deactivate=function(e){return u.deactivate(e)}},d.includeIn?u.includeIn(d.includeIn):r&&u.activate(),u.forItems=function(t){d.closeOnDeactivate=!1,d.determineNextItemToActivate=function(e,t){var n=t-1;return-1==n&&e.length>1?e[1]:n>-1&&ns;s++)r(a[s])}).promise():r()},u},u}var l,c={canDeactivate:!0},u={closeOnDeactivate:!0,affirmations:["yes","ok","true"],interpretResponse:function(n){return e.isObject(n)&&(n=n.can||!1),e.isString(n)?-1!==t.utils.arrayIndexOf(this.affirmations,n.toLowerCase()):n},areSameItem:function(e,t){return e==t},beforeActivate:function(e){return e},afterDeactivate:function(e,t,n){t&&n&&n(null)},findChildActivator:function(){return null}};return l={defaults:u,create:d,isActivator:function(e){return e&&e.__activator__}}}),define("durandal/composition",["durandal/system","durandal/viewLocator","durandal/binder","durandal/viewEngine","durandal/activator","jquery","knockout"],function(e,t,n,r,a,o,i){function s(t,n,r){try{if(t.onError)try{t.onError(n,r)}catch(a){e.error(a)}else e.error(n)}finally{l(t,r,!0)}}function d(e){for(var t=[],n={childElements:t,activeView:null},r=i.virtualElements.firstChild(e);r;)1==r.nodeType&&(t.push(r),r.getAttribute(T)&&(n.activeView=r)),r=i.virtualElements.nextSibling(r);return n.activeView||(n.activeView=t[0]),n}function l(e,t,n){if(w--,0===w){var r=A;A=[],n||setTimeout(function(){for(var n=r.length;n--;)try{r[n]()}catch(a){s(e,a,t)}},1)}c(e)}function c(e){delete e.activeView,delete e.viewElements}function u(t,n,r,a){if(r)n();else if(t.activate&&t.model&&t.model.activate){var o;try{o=e.isArray(t.activationData)?t.model.activate.apply(t.model,t.activationData):t.model.activate(t.activationData),o&&o.then?o.then(n,function(e){s(t,e,a),n()}):o||void 0===o?n():l(t,a)}catch(i){s(t,i,a)}}else n()}function p(t,n){var t=this;if(t.activeView&&t.activeView.removeAttribute(T),t.child)try{t.model&&t.model.attached&&(t.composingNewView||t.alwaysTriggerAttach)&&t.model.attached(t.child,t.parent,t),t.attached&&t.attached(t.child,t.parent,t),t.child.setAttribute(T,!0),t.composingNewView&&t.model&&t.model.detached&&i.utils.domNodeDisposal.addDisposeCallback(t.child,function(){try{t.model.detached(t.child,t.parent,t)}catch(e){s(t,e,n)}})}catch(r){s(t,r,n)}t.triggerAttach=e.noop}function m(t){if(e.isString(t.transition)){if(t.activeView){if(t.activeView==t.child)return!1;if(!t.child)return!0;if(t.skipTransitionOnSameViewId){var n=t.activeView.getAttribute("data-view"),r=t.child.getAttribute("data-view");return n!=r}}return!0}return!1}function h(e){for(var t=0,n=e.length,r=[];n>t;t++){var a=e[t].cloneNode(!0);r.push(a)}return r}function f(t){var n=h(t.parts),r=V.getParts(n),a=V.getParts(t.child);for(var i in r){var s=a[i];s||(s=o('[data-part="'+i+'"]',t.child).get(0))?s.parentNode.replaceChild(r[i],s):e.log("Could not find part to override: "+i)}}function g(t){var n,r,a=i.virtualElements.childNodes(t.parent);if(!e.isArray(a)){var o=[];for(n=0,r=a.length;r>n;n++)o[n]=a[n];a=o}for(n=1,r=a.length;r>n;n++)i.removeNode(a[n])}function v(e){i.utils.domData.set(e,S,e.style.display),e.style.display="none"}function b(e){var t=i.utils.domData.get(e,S);e.style.display="none"===t?"block":t}function y(e){var t=e.getAttribute("data-bind");if(!t)return!1;for(var n=0,r=N.length;r>n;n++)if(t.indexOf(N[n])>-1)return!0;return!1}var V,_={},T="data-active-view",A=[],w=0,I="durandal-composition-data",E="data-part",D=["model","view","transition","area","strategy","activationData","onError"],S="durandal-visibility-data",N=["compose:"],C={complete:function(e){A.push(e)}};return V={composeBindings:N,convertTransitionToModuleId:function(e){return"transitions/"+e},defaultTransitionName:null,current:C,addBindingHandler:function(e,t,n){var r,a,o="composition-handler-"+e;t=t||i.bindingHandlers[e],n=n||function(){return void 0},a=i.bindingHandlers[e]={init:function(e,r,a,s,d){if(w>0){var l={trigger:i.observable(null)};V.current.complete(function(){t.init&&t.init(e,r,a,s,d),t.update&&(i.utils.domData.set(e,o,t),l.trigger("trigger"))}),i.utils.domData.set(e,o,l)}else i.utils.domData.set(e,o,t),t.init&&t.init(e,r,a,s,d);return n(e,r,a,s,d)},update:function(e,t,n,r,a){var s=i.utils.domData.get(e,o);return s.update?s.update(e,t,n,r,a):void(s.trigger&&s.trigger())}};for(r in t)"init"!==r&&"update"!==r&&(a[r]=t[r])},getParts:function(e,t){if(t=t||{},!e)return t;void 0===e.length&&(e=[e]);for(var n=0,r=e.length;r>n;n++){var a,o=e[n];o.getAttribute&&(a=o.getAttribute(E),a&&(t[a]=o),o.hasChildNodes()&&!y(o)&&V.getParts(o.childNodes,t))}return t},cloneNodes:h,finalize:function(t,r){if(void 0===t.transition&&(t.transition=this.defaultTransitionName),t.child||t.activeView)if(m(t)){var a=this.convertTransitionToModuleId(t.transition);e.acquire(a).then(function(e){t.transition=e,e(t).then(function(){if(t.cacheViews){if(t.activeView){var e=n.getBindingInstruction(t.activeView);e&&void 0!=e.cacheViews&&!e.cacheViews?i.removeNode(t.activeView):v(t.activeView)}}else t.child?g(t):i.virtualElements.emptyNode(t.parent);t.child&&b(t.child),t.triggerAttach(t,r),l(t,r)})}).fail(function(e){s(t,"Failed to load transition ("+a+"). Details: "+e.message,r)})}else{if(t.child!=t.activeView){if(t.cacheViews&&t.activeView){var o=n.getBindingInstruction(t.activeView);!o||void 0!=o.cacheViews&&!o.cacheViews?i.removeNode(t.activeView):v(t.activeView)}t.child?(t.cacheViews||g(t),b(t.child)):t.cacheViews||i.virtualElements.emptyNode(t.parent)}t.triggerAttach(t,r),l(t,r)}else t.cacheViews||i.virtualElements.emptyNode(t.parent),t.triggerAttach(t,r),l(t,r)},bindAndShow:function(e,t,a,o){a.child=e,a.parent.__composition_context=a,a.composingNewView=a.cacheViews?-1==i.utils.arrayIndexOf(a.viewElements,e):!0,u(a,function(){if(a.parent.__composition_context==a){if(delete a.parent.__composition_context,a.binding&&a.binding(a.child,a.parent,a),a.preserveContext&&a.bindingContext)a.composingNewView&&(a.parts&&f(a),v(e),i.virtualElements.prepend(a.parent,e),n.bindContext(a.bindingContext,e,a.model,a.as));else if(e){var o=a.model||_,s=i.dataFor(e);if(s!=o){if(!a.composingNewView)return i.removeNode(e),void r.createView(e.getAttribute("data-view")).then(function(e){V.bindAndShow(e,t,a,!0)});a.parts&&f(a),v(e),i.virtualElements.prepend(a.parent,e),n.bind(o,e)}}V.finalize(a,t)}else l(a,t)},o,t)},defaultStrategy:function(e){return t.locateViewForObject(e.model,e.area,e.viewElements)},getSettings:function(t){var n,o=t(),s=i.utils.unwrapObservable(o)||{},d=a.isActivator(o);if(e.isString(s))return s=r.isViewUrl(s)?{view:s}:{model:s,activate:!d};if(n=e.getModuleId(s))return s={model:s,activate:!d};!d&&s.model&&(d=a.isActivator(s.model));for(var l in s)s[l]=-1!=i.utils.arrayIndexOf(D,l)?i.utils.unwrapObservable(s[l]):s[l];return d?s.activate=!1:void 0===s.activate&&(s.activate=!0),s},executeStrategy:function(e,t){e.strategy(e).then(function(n){V.bindAndShow(n,t,e)})},inject:function(n,r){return n.model?n.view?void t.locateView(n.view,n.area,n.viewElements).then(function(e){V.bindAndShow(e,r,n)}):(n.strategy||(n.strategy=this.defaultStrategy),void(e.isString(n.strategy)?e.acquire(n.strategy).then(function(e){n.strategy=e,V.executeStrategy(n,r)}).fail(function(e){s(n,"Failed to load view strategy ("+n.strategy+"). Details: "+e.message,r)}):this.executeStrategy(n,r))):void this.bindAndShow(null,r,n)},compose:function(n,r,a,o){w++,o||(r=V.getSettings(function(){return r},n)),r.compositionComplete&&A.push(function(){r.compositionComplete(r.child,r.parent,r)}),A.push(function(){r.composingNewView&&r.model&&r.model.compositionComplete&&r.model.compositionComplete(r.child,r.parent,r)});var i=d(n);r.activeView=i.activeView,r.parent=n,r.triggerAttach=p,r.bindingContext=a,r.cacheViews&&!r.viewElements&&(r.viewElements=i.childElements),r.model?e.isString(r.model)?e.acquire(r.model).then(function(t){r.model=e.resolveObject(t),V.inject(r,n)}).fail(function(e){s(r,"Failed to load composed module ("+r.model+"). Details: "+e.message,n)}):V.inject(r,n):r.view?(r.area=r.area||"partial",r.preserveContext=!0,t.locateView(r.view,r.area,r.viewElements).then(function(e){V.bindAndShow(e,n,r)})):this.bindAndShow(null,n,r)}},i.bindingHandlers.compose={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t,n,a,o){var s=V.getSettings(t,e);if(s.mode){var d=i.utils.domData.get(e,I);if(!d){var l=i.virtualElements.childNodes(e);d={},"inline"===s.mode?d.view=r.ensureSingleElement(l):"templated"===s.mode&&(d.parts=h(l)),i.virtualElements.emptyNode(e),i.utils.domData.set(e,I,d)}"inline"===s.mode?s.view=d.view.cloneNode(!0):"templated"===s.mode&&(s.parts=d.parts),s.preserveContext=!0}V.compose(e,s,o,!0)}},i.virtualElements.allowedBindings.compose=!0,V}),define("durandal/events",["durandal/system"],function(e){var t=/\s+/,n=function(){},r=function(e,t){this.owner=e,this.events=t};return r.prototype.then=function(e,t){return this.callback=e||this.callback,this.context=t||this.context,this.callback?(this.owner.on(this.events,this.callback,this.context),this):this},r.prototype.on=r.prototype.then,r.prototype.off=function(){return this.owner.off(this.events,this.callback,this.context),this},n.prototype.on=function(e,n,a){var o,i,s;if(n){for(o=this.callbacks||(this.callbacks={}),e=e.split(t);i=e.shift();)s=o[i]||(o[i]=[]),s.push(n,a);return this}return new r(this,e)},n.prototype.off=function(n,r,a){var o,i,s,d;if(!(i=this.callbacks))return this;if(!(n||r||a))return delete this.callbacks,this;for(n=n?n.split(t):e.keys(i);o=n.shift();)if((s=i[o])&&(r||a))for(d=s.length-2;d>=0;d-=2)r&&s[d]!==r||a&&s[d+1]!==a||s.splice(d,2);else delete i[o];return this},n.prototype.trigger=function(e){var n,r,a,o,i,s,d,l;if(!(r=this.callbacks))return this;for(l=[],e=e.split(t),o=1,i=arguments.length;i>o;o++)l[o-1]=arguments[o];for(;n=e.shift();){if((d=r.all)&&(d=d.slice()),(a=r[n])&&(a=a.slice()),a)for(o=0,i=a.length;i>o;o+=2)a[o].apply(a[o+1]||this,l);if(d)for(s=[n].concat(l),o=0,i=d.length;i>o;o+=2)d[o].apply(d[o+1]||this,s)}return this},n.prototype.proxy=function(e){var t=this;return function(n){t.trigger(e,n)}},n.includeIn=function(e){e.on=n.prototype.on,e.off=n.prototype.off,e.trigger=n.prototype.trigger,e.proxy=n.prototype.proxy},n}),define("durandal/app",["durandal/system","durandal/viewEngine","durandal/composition","durandal/events","jquery"],function(e,t,n,r,a){function o(){return e.defer(function(t){return 0==s.length?void t.resolve():void e.acquire(s).then(function(n){for(var r=0;r=d);s.root=("/"+s.root+"/").replace(a,"/"),l&&s._wantsHashChange&&(s.iframe=t('