(function(){var n=!1;(function(t){var u=this||eval("this"),i=u.document,e=u.navigator,r=u.jQuery,f=u.JSON;(function(n){typeof define=="function"&&define.amd?define(["exports","require"],n):typeof exports=="object"&&typeof module=="object"?n(module.exports||exports):n(u.ko={})})(function(o,s){function nt(n,t){var i=n===null||typeof n in ft;return i?n===t:!1}function et(n,i){var r;return function(){r||(r=h.utils.setTimeout(function(){r=t;n()},i))}}function ot(n,t){var i;return function(){clearTimeout(i);i=h.utils.setTimeout(n,t)}}function st(n){var t=this;return n&&h.utils.objectForEach(n,function(n,i){var r=h.extenders[n];typeof r=="function"&&(t=r(t,i)||t)}),t}function ht(n,t){t&&t!==y?t==="beforeChange"?this._limitBeforeChange(n):this._origNotifySubscribers(n,t):this._limitChange(n)}function ct(n,t){t!==null&&t.dispose&&t.dispose()}function lt(n,t){var i=this.computedObservable,r=i[c];r.isDisposed||(this.disposalCount&&this.disposalCandidates[t]?(i.addDependencyTracking(t,n,this.disposalCandidates[t]),this.disposalCandidates[t]=null,--this.disposalCount):r.dependencyTracking[t]||i.addDependencyTracking(t,n,r.isSleeping?{_target:n}:i.subscribeToDependency(n)),n._notificationIsPending&&n._notifyNextChangeIfValueIsDifferent())}function yt(n){h.bindingHandlers[n]={init:function(t,i,r,u,f){var e=function(){var t={};return t[n]=i(),t};return h.bindingHandlers.event.init.call(this,t,e,r,u,f)}}}function ut(n,t,i,r){h.bindingHandlers[n]={init:function(n,u,f,e,o){var c,s;return h.computed(function(){var l=u(),a=h.utils.unwrapObservable(l),f=!i!=!a,e=!s,v=e||t||f!==c;v&&(e&&h.computedContext.getDependenciesCount()&&(s=h.utils.cloneNodes(h.virtualElements.childNodes(n),!0)),f?(e||h.virtualElements.setDomNodeChildren(n,h.utils.cloneNodes(s)),h.applyBindingsToDescendants(r?r(o,l):o,n)):h.virtualElements.emptyNode(n),c=f)},null,{disposeWhenNodeIsRemoved:n}),{controlsDescendantBindings:!0}}};h.expressionRewriting.bindingRewriteValidators[n]=!1;h.virtualElements.allowedBindings[n]=!0}var h=typeof o!="undefined"?o:{},ft,y,a,p,v,w,b,c,tt,it,rt,k,d,g;h.exportSymbol=function(n,t){for(var i=n.split("."),r=h,u=0;u<i.length-1;u++)r=r[i[u]];r[i[i.length-1]]=t};h.exportProperty=function(n,t,i){n[t]=i};h.version="3.4.2";h.exportSymbol("version",h.version);h.options={deferUpdates:!1,useOnlyNativeEvents:!1};h.utils=function(){function c(n,t){for(var i in n)n.hasOwnProperty(i)&&t(i,n[i])}function a(n,t){if(t)for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);return n}function v(n,t){return n.__proto__=t,n}function tt(n,t){if(h.utils.tagNameLower(n)!=="input"||!n.type||t.toLowerCase()!="click")return!1;var i=n.type;return i=="checkbox"||i=="radio"}function it(n,t,i){var r;t&&(typeof n.classList=="object"?(r=n.classList[i?"add":"remove"],h.utils.arrayForEach(t.match(s),function(t){r.call(n.classList,t)})):typeof n.className.baseVal=="string"?w(n.className,"baseVal",t,i):w(n,"className",t,i))}function w(n,t,i,r){var u=n[t].match(s)||[];h.utils.arrayForEach(i.match(s),function(n){h.utils.addOrRemoveItem(u,n,r)});n[t]=u.join(" ")}var y={__proto__:[]}instanceof Array,b=!n&&typeof Symbol=="function",l={},p={},k=e&&/Firefox\/2/i.test(e.userAgent)?"KeyboardEvent":"UIEvents",s;l[k]=["keyup","keydown","keypress"];l.MouseEvents=["click","dblclick","mousedown","mouseup","mousemove","mouseover","mouseout","mouseenter","mouseleave"];c(l,function(n,t){if(t.length)for(var i=0,r=t.length;i<r;i++)p[t[i]]=n});var d={propertychange:!0},o=i&&function(){for(var n=3,r=i.createElement("div"),u=r.getElementsByTagName("i");r.innerHTML="<!--[if gt IE "+ ++n+"]><i><\/i><![endif]-->",u[0];);return n>4?n:t}(),g=o===6,nt=o===7;return s=/\S+/g,{fieldsIncludedWithJsonPost:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],arrayForEach:function(n,t){for(var i=0,r=n.length;i<r;i++)t(n[i],i)},arrayIndexOf:function(n,t){if(typeof Array.prototype.indexOf=="function")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},arrayFirst: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},arrayRemoveItem:function(n,t){var i=h.utils.arrayIndexOf(n,t);i>0?n.splice(i,1):i===0&&n.shift()},arrayGetDistinctValues:function(n){var i,t,r;for(n=n||[],i=[],t=0,r=n.length;t<r;t++)h.utils.arrayIndexOf(i,n[t])<0&&i.push(n[t]);return i},arrayMap:function(n,t){var r,i,u;for(n=n||[],r=[],i=0,u=n.length;i<u;i++)r.push(t(n[i],i));return r},arrayFilter:function(n,t){var r,i,u;for(n=n||[],r=[],i=0,u=n.length;i<u;i++)t(n[i],i)&&r.push(n[i]);return r},arrayPushAll: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},addOrRemoveItem:function(n,t,i){var r=h.utils.arrayIndexOf(h.utils.peekObservable(n),t);r<0?i&&n.push(t):i||n.splice(r,1)},canSetPrototype:y,extend:a,setPrototypeOf:v,setPrototypeOfOrExtend:y?v:a,objectForEach:c,objectMap:function(n,t){var r,i;if(!n)return n;r={};for(i in n)n.hasOwnProperty(i)&&(r[i]=t(n[i],i,n));return r},emptyDomNode:function(n){while(n.firstChild)h.removeNode(n.firstChild)},moveCleanedNodesToContainerElement:function(n){for(var t=h.utils.makeArray(n),f=t[0]&&t[0].ownerDocument||i,u=f.createElement("div"),r=0,e=t.length;r<e;r++)u.appendChild(h.cleanNode(t[r]));return u},cloneNodes:function(n,t){for(var r,i=0,f=n.length,u=[];i<f;i++)r=n[i].cloneNode(!0),u.push(t?h.cleanNode(r):r);return u},setDomNodeChildren:function(n,t){if(h.utils.emptyDomNode(n),t)for(var i=0,r=t.length;i<r;i++)n.appendChild(t[i])},replaceDomNodes:function(n,t){var r=n.nodeType?[n]:n,f,e,i,u;if(r.length>0){for(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++)h.removeNode(r[i])}},fixUpContinuousNodeArray:function(n,t){if(n.length){for(t=t.nodeType===8&&t.parentNode||t;n.length&&n[0].parentNode!==t;)n.splice(0,1);while(n.length>1&&n[n.length-1].parentNode!==t)n.length--;if(n.length>1){var i=n[0],r=n[n.length-1];for(n.length=0;i!==r;)n.push(i),i=i.nextSibling;n.push(r)}}return n},setOptionNodeSelectionState:function(n,t){o<7?n.setAttribute("selected",t):n.selected=t},stringTrim:function(n){return n===null||n===t?"":n.trim?n.trim():n.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},stringStartsWith:function(n,t){return(n=n||"",t.length>n.length)?!1:n.substring(0,t.length)===t},domNodeIsContainedBy:function(n,t){if(n===t)return!0;if(n.nodeType===11)return!1;if(t.contains)return t.contains(n.nodeType===3?n.parentNode:n);if(t.compareDocumentPosition)return(t.compareDocumentPosition(n)&16)==16;while(n&&n!=t)n=n.parentNode;return!!n},domNodeIsAttachedToDocument:function(n){return h.utils.domNodeIsContainedBy(n,n.ownerDocument.documentElement)},anyDomNodeIsAttachedToDocument:function(n){return!!h.utils.arrayFirst(n,h.utils.domNodeIsAttachedToDocument)},tagNameLower:function(n){return n&&n.tagName&&n.tagName.toLowerCase()},catchFunctionErrors:function(n){return h.onError?function(){try{return n.apply(this,arguments)}catch(t){h.onError&&h.onError(t);throw t;}}:n},setTimeout:function(n,t){return setTimeout(h.utils.catchFunctionErrors(n),t)},deferError:function(n){setTimeout(function(){h.onError&&h.onError(n);throw n;},0)},registerEventHandler:function(n,t,i){var u=h.utils.catchFunctionErrors(i),s=o&&d[t],f,e;if(h.options.useOnlyNativeEvents||s||!r)if(s||typeof n.addEventListener!="function")if(typeof n.attachEvent!="undefined")f=function(t){u.call(n,t)},e="on"+t,n.attachEvent(e,f),h.utils.domNodeDisposal.addDisposeCallback(n,function(){n.detachEvent(e,f)});else throw new Error("Browser doesn't support addEventListener or attachEvent");else n.addEventListener(t,u,!1);else r(n).bind(t,u)},triggerEvent:function(n,t){var f,o,e;if(!(n&&n.nodeType))throw new Error("element must be a DOM node when calling triggerEvent");if(f=tt(n,t),h.options.useOnlyNativeEvents||!r||f)if(typeof i.createEvent=="function")if(typeof n.dispatchEvent=="function")o=p[t]||"HTMLEvents",e=i.createEvent(o),e.initEvent(t,!0,!0,u,0,0,0,0,0,!1,!1,!1,!1,0,n),n.dispatchEvent(e);else throw new Error("The supplied element doesn't support dispatchEvent");else if(f&&n.click)n.click();else if(typeof n.fireEvent!="undefined")n.fireEvent("on"+t);else throw new Error("Browser doesn't support triggering events");else r(n).trigger(t)},unwrapObservable:function(n){return h.isObservable(n)?n():n},peekObservable:function(n){return h.isObservable(n)?n.peek():n},toggleDomNodeCssClass:it,setTextContent:function(n,i){var r=h.utils.unwrapObservable(i),u;(r===null||r===t)&&(r="");u=h.virtualElements.firstChild(n);!u||u.nodeType!=3||h.virtualElements.nextSibling(u)?h.virtualElements.setDomNodeChildren(n,[n.ownerDocument.createTextNode(r)]):u.data=r;h.utils.forceRefresh(n)},setElementName:function(n,t){if(n.name=t,o<=7)try{n.mergeAttributes(i.createElement("<input name='"+n.name+"'/>"),!1)}catch(r){}},forceRefresh:function(n){if(o>=9){var t=n.nodeType==1?n:n.parentNode;t.style&&(t.style.zoom=t.style.zoom)}},ensureSelectElementIsRenderedCorrectly:function(n){if(o){var t=n.style.width;n.style.width=0;n.style.width=t}},range:function(n,t){var r,i;for(n=h.utils.unwrapObservable(n),t=h.utils.unwrapObservable(t),r=[],i=n;i<=t;i++)r.push(i);return r},makeArray:function(n){for(var i=[],t=0,r=n.length;t<r;t++)i.push(n[t]);return i},createSymbolOrString:function(n){return b?Symbol(n):n},isIe6:g,isIe7:nt,ieVersion:o,getFormFields:function(n,t){for(var r=h.utils.makeArray(n.getElementsByTagName("input")).concat(h.utils.makeArray(n.getElementsByTagName("textarea"))),f=typeof t=="string"?function(n){return n.name===t}:function(n){return t.test(n.name)},u=[],i=r.length-1;i>=0;i--)f(r[i])&&u.push(r[i]);return u},parseJson:function(n){return typeof n=="string"&&(n=h.utils.stringTrim(n),n)?f&&f.parse?f.parse(n):new Function("return "+n)():null},stringifyJson:function(n,t,i){if(!f||!f.stringify)throw new 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 f.stringify(h.utils.unwrapObservable(n),t,i)},postJson:function(n,t,r){var l,o,s,f,u,a,e;r=r||{};var v=r.params||{},y=r.includeFields||this.fieldsIncludedWithJsonPost,p=n;if(typeof n=="object"&&h.utils.tagNameLower(n)==="form")for(l=n,p=l.action,o=y.length-1;o>=0;o--)for(s=h.utils.getFormFields(l,y[o]),f=s.length-1;f>=0;f--)v[s[f].name]=s[f].value;t=h.utils.unwrapObservable(t);u=i.createElement("form");u.style.display="none";u.action=p;u.method="post";for(a in t)e=i.createElement("input"),e.type="hidden",e.name=a,e.value=h.utils.stringifyJson(h.utils.unwrapObservable(t[a])),u.appendChild(e);c(v,function(n,t){var r=i.createElement("input");r.type="hidden";r.name=n;r.value=t;u.appendChild(r)});i.body.appendChild(u);r.submitter?r.submitter(u):u.submit();setTimeout(function(){u.parentNode.removeChild(u)},0)}}}();h.exportSymbol("utils",h.utils);h.exportSymbol("utils.arrayForEach",h.utils.arrayForEach);h.exportSymbol("utils.arrayFirst",h.utils.arrayFirst);h.exportSymbol("utils.arrayFilter",h.utils.arrayFilter);h.exportSymbol("utils.arrayGetDistinctValues",h.utils.arrayGetDistinctValues);h.exportSymbol("utils.arrayIndexOf",h.utils.arrayIndexOf);h.exportSymbol("utils.arrayMap",h.utils.arrayMap);h.exportSymbol("utils.arrayPushAll",h.utils.arrayPushAll);h.exportSymbol("utils.arrayRemoveItem",h.utils.arrayRemoveItem);h.exportSymbol("utils.extend",h.utils.extend);h.exportSymbol("utils.fieldsIncludedWithJsonPost",h.utils.fieldsIncludedWithJsonPost);h.exportSymbol("utils.getFormFields",h.utils.getFormFields);h.exportSymbol("utils.peekObservable",h.utils.peekObservable);h.exportSymbol("utils.postJson",h.utils.postJson);h.exportSymbol("utils.parseJson",h.utils.parseJson);h.exportSymbol("utils.registerEventHandler",h.utils.registerEventHandler);h.exportSymbol("utils.stringifyJson",h.utils.stringifyJson);h.exportSymbol("utils.range",h.utils.range);h.exportSymbol("utils.toggleDomNodeCssClass",h.utils.toggleDomNodeCssClass);h.exportSymbol("utils.triggerEvent",h.utils.triggerEvent);h.exportSymbol("utils.unwrapObservable",h.utils.unwrapObservable);h.exportSymbol("utils.objectForEach",h.utils.objectForEach);h.exportSymbol("utils.addOrRemoveItem",h.utils.addOrRemoveItem);h.exportSymbol("utils.setTextContent",h.utils.setTextContent);h.exportSymbol("unwrap",h.utils.unwrapObservable);Function.prototype.bind||(Function.prototype.bind=function(n){var t=this,i;return arguments.length===1?function(){return t.apply(n,arguments)}:(i=Array.prototype.slice.call(arguments,1),function(){var r=i.slice(0);return r.push.apply(r,arguments),t.apply(n,r)})});h.utils.domData=new function(){function r(r,f){var e=r[n],o=e&&e!=="null"&&i[e];if(!o){if(!f)return t;e=r[n]="ko"+u++;i[e]={}}return i[e]}var u=0,n="__ko__"+(new Date).getTime(),i={};return{get:function(n,i){var u=r(n,!1);return u===t?t:u[i]},set:function(n,i,u){if(u!==t||r(n,!1)!==t){var f=r(n,!0);f[i]=u}},clear:function(t){var r=t[n];return r?(delete i[r],t[n]=null,!0):!1},nextKey:function(){return u+++n}}};h.exportSymbol("utils.domData",h.utils.domData);h.exportSymbol("utils.domData.clear",h.utils.domData.clear);h.utils.domNodeDisposal=new function(){function i(i,r){var u=h.utils.domData.get(i,n);return u===t&&r&&(u=[],h.utils.domData.set(i,n,u)),u}function o(i){h.utils.domData.set(i,n,t)}function u(n){var t=i(n,!1),r;if(t)for(t=t.slice(0),r=0;r<t.length;r++)t[r](n);h.utils.domData.clear(n);h.utils.domNodeDisposal.cleanExternalData(n);f[n.nodeType]&&s(n)}function s(n){for(var t,i=n.firstChild;t=i;)i=t.nextSibling,t.nodeType===8&&u(t)}var n=h.utils.domData.nextKey(),e={1:!0,8:!0,9:!0},f={1:!0,9:!0};return{addDisposeCallback:function(n,t){if(typeof t!="function")throw new Error("Callback must be a function");i(n,!0).push(t)},removeDisposeCallback:function(n,t){var r=i(n,!1);r&&(h.utils.arrayRemoveItem(r,t),r.length==0&&o(n))},cleanNode:function(n){var t,i,r;if(e[n.nodeType]&&(u(n),f[n.nodeType]))for(t=[],h.utils.arrayPushAll(t,n.getElementsByTagName("*")),i=0,r=t.length;i<r;i++)u(t[i]);return n},removeNode:function(n){h.cleanNode(n);n.parentNode&&n.parentNode.removeChild(n)},cleanExternalData:function(n){r&&typeof r.cleanData=="function"&&r.cleanData([n])}}};h.cleanNode=h.utils.domNodeDisposal.cleanNode;h.removeNode=h.utils.domNodeDisposal.removeNode;h.exportSymbol("cleanNode",h.cleanNode);h.exportSymbol("removeNode",h.removeNode);h.exportSymbol("utils.domNodeDisposal",h.utils.domNodeDisposal);h.exportSymbol("utils.domNodeDisposal.addDisposeCallback",h.utils.domNodeDisposal.addDisposeCallback);h.exportSymbol("utils.domNodeDisposal.removeDisposeCallback",h.utils.domNodeDisposal.removeDisposeCallback),function(){function l(n){var t=n.match(/^<([a-z]+)[ >]/);return t&&c[t[1]]||s}function a(n,t){t||(t=i);var e=t.parentWindow||t.defaultView||u,c=h.utils.stringTrim(n).toLowerCase(),r=t.createElement("div"),f=l(c),a=f[0],s="ignored<div>"+f[1]+n+f[2]+"<\/div>";for(typeof e.innerShiv=="function"?r.appendChild(e.innerShiv(s)):(o&&t.appendChild(r),r.innerHTML=s,o&&r.parentNode.removeChild(r));a--;)r=r.lastChild;return h.utils.makeArray(r.lastChild.childNodes)}function v(n,t){var u,i;if(r.parseHTML)return r.parseHTML(n,t)||[];if(u=r.clean([n],t),u&&u[0]){for(i=u[0];i.parentNode&&i.parentNode.nodeType!==11;)i=i.parentNode;i.parentNode&&i.parentNode.removeChild(i)}return u}var s=[0,"",""],n=[1,"<table>","<\/table>"],f=[3,"<table><tbody><tr>","<\/tr><\/tbody><\/table>"],e=[1,"<select multiple='multiple'>","<\/select>"],c={thead:n,tbody:n,tfoot:n,tr:[2,"<table><tbody>","<\/tbody><\/table>"],td:f,th:f,option:e,optgroup:e},o=h.utils.ieVersion<=8;h.utils.parseHtmlFragment=function(n,t){return r?v(n,t):a(n,t)};h.utils.setHtml=function(n,i){var f,u;if(h.utils.emptyDomNode(n),i=h.utils.unwrapObservable(i),i!==null&&i!==t)if(typeof i!="string"&&(i=i.toString()),r)r(n).html(i);else for(f=h.utils.parseHtmlFragment(i,n.ownerDocument),u=0;u<f.length;u++)n.appendChild(f[u])}}();h.exportSymbol("utils.parseHtmlFragment",h.utils.parseHtmlFragment);h.exportSymbol("utils.setHtml",h.utils.setHtml);h.memoization=function(){function i(){return((1+Math.random())*4294967296|0).toString(16).substring(1)}function u(){return i()+i()}function r(n,t){var i;if(n)if(n.nodeType==8)i=h.memoization.parseMemoText(n.nodeValue),i!=null&&t.push({domNode:n,memoId:i});else if(n.nodeType==1)for(var u=0,f=n.childNodes,e=f.length;u<e;u++)r(f[u],t)}var n={};return{memoize:function(t){if(typeof t!="function")throw new Error("You can only pass a function to ko.memoization.memoize()");var i=u();return n[i]=t,"<!--[ko_memo:"+i+"]-->"},unmemoize:function(i,r){var u=n[i];if(u===t)throw new Error("Couldn't find any memo with ID "+i+". Perhaps it's already been unmemoized.");try{return u.apply(null,r||[]),!0}finally{delete n[i]}},unmemoizeDomNodeAndDescendants:function(n,t){var f=[],u,o,i,e;for(r(n,f),u=0,o=f.length;u<o;u++)i=f[u].domNode,e=[i],t&&h.utils.arrayPushAll(e,t),h.memoization.unmemoize(f[u].memoId,e),i.nodeValue="",i.parentNode&&i.parentNode.removeChild(i)},parseMemoText:function(n){var t=n.match(/^\[ko_memo\:(.*?)\]$/);return t?t[1]:null}}}();h.exportSymbol("memoization",h.memoization);h.exportSymbol("memoization.memoize",h.memoization.memoize);h.exportSymbol("memoization.unmemoize",h.memoization.unmemoize);h.exportSymbol("memoization.parseMemoText",h.memoization.parseMemoText);h.exportSymbol("memoization.unmemoizeDomNodeAndDescendants",h.memoization.unmemoizeDomNodeAndDescendants);h.tasks=function(){function o(){var i,u,f;if(n)for(i=n,u=0;t<n;)if(f=r[t++]){if(t>i){if(++u>=5e3){t=n;h.utils.deferError(Error("'Too much recursion' after processing "+u+" task groups."));break}i=n}try{f()}catch(e){h.utils.deferError(e)}}}function s(){o();t=n=r.length=0}function c(){h.tasks.scheduler(s)}var f,r=[],n=0,e=1,t=0;return f=u.MutationObserver?function(n){var t=i.createElement("div");return new MutationObserver(n).observe(t,{attributes:!0}),function(){t.classList.toggle("foo")}}(s):i&&"onreadystatechange"in i.createElement("script")?function(n){var t=i.createElement("script");t.onreadystatechange=function(){t.onreadystatechange=null;i.documentElement.removeChild(t);t=null;n()};i.documentElement.appendChild(t)}:function(n){setTimeout(n,0)},{scheduler:f,schedule:function(t){return n||c(),r[n++]=t,e++},cancel:function(i){var u=i-(e-n);u>=t&&u<n&&(r[u]=null)},resetForTesting:function(){var i=n-t;return t=n=r.length=0,i},runEarly:o}}();h.exportSymbol("tasks",h.tasks);h.exportSymbol("tasks.schedule",h.tasks.schedule);h.exportSymbol("tasks.runEarly",h.tasks.runEarly);h.extenders={throttle:function(n,t){n.throttleEvaluation=t;var i=null;return h.dependentObservable({read:n,write:function(r){clearTimeout(i);i=h.utils.setTimeout(function(){n(r)},t)}})},rateLimit:function(n,t){var i,r,u;typeof t=="number"?i=t:(i=t.timeout,r=t.method);n._deferUpdates=!1;u=r=="notifyWhenChangesStop"?ot:et;n.limit(function(n){return u(n,i)})},deferred:function(n,i){if(i!==!0)throw new Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");n._deferUpdates||(n._deferUpdates=!0,n.limit(function(i){var u,r=!1;return function(){if(!r){h.tasks.cancel(u);u=h.tasks.schedule(i);try{r=!0;n.notifySubscribers(t,"dirty")}finally{r=!1}}}}))},notify:function(n,t){n.equalityComparer=t=="always"?null:nt}};ft={undefined:1,boolean:1,number:1,string:1};h.exportSymbol("extenders",h.extenders);h.subscription=function(n,t,i){this._target=n;this.callback=t;this.disposeCallback=i;this.isDisposed=!1;h.exportProperty(this,"dispose",this.dispose)};h.subscription.prototype.dispose=function(){this.isDisposed=!0;this.disposeCallback()};h.subscribable=function(){h.utils.setPrototypeOfOrExtend(this,a);a.init(this)};y="change";a={init:function(n){n._subscriptions={change:[]};n._versionNumber=1},subscribe:function(n,t,i){var r=this,f,u;return i=i||y,f=t?n.bind(t):n,u=new h.subscription(r,f,function(){h.utils.arrayRemoveItem(r._subscriptions[i],u);r.afterSubscriptionRemove&&r.afterSubscriptionRemove(i)}),r.beforeSubscriptionAdd&&r.beforeSubscriptionAdd(i),r._subscriptions[i]||(r._subscriptions[i]=[]),r._subscriptions[i].push(u),u},notifySubscribers:function(n,t){var u,i,r;if(t=t||y,t===y&&this.updateVersion(),this.hasSubscriptionsForEvent(t)){u=t===y&&this._changeSubscriptions||this._subscriptions[t].slice(0);try{for(h.dependencyDetection.begin(),i=0;r=u[i];++i)r.isDisposed||r.callback(n)}finally{h.dependencyDetection.end()}}},getVersion:function(){return this._versionNumber},hasChanged:function(n){return this.getVersion()!==n},updateVersion:function(){++this._versionNumber},limit:function(n){var t=this,o=h.isObservable(t),u,f,r,i,s="beforeChange",e;t._origNotifySubscribers||(t._origNotifySubscribers=t.notifySubscribers,t.notifySubscribers=ht);e=n(function(){t._notificationIsPending=!1;o&&i===t&&(i=t._evalIfChanged?t._evalIfChanged():t());var n=f||t.isDifferent(r,i);f=u=!1;n&&t._origNotifySubscribers(r=i)});t._limitChange=function(n){t._changeSubscriptions=t._subscriptions[y].slice(0);t._notificationIsPending=u=!0;i=n;e()};t._limitBeforeChange=function(n){u||(r=n,t._origNotifySubscribers(n,s))};t._notifyNextChangeIfValueIsDifferent=function(){t.isDifferent(r,t.peek(!0))&&(f=!0)}},hasSubscriptionsForEvent:function(n){return this._subscriptions[n]&&this._subscriptions[n].length},getSubscriptionsCount:function(n){if(n)return this._subscriptions[n]&&this._subscriptions[n].length||0;var t=0;return h.utils.objectForEach(this._subscriptions,function(n,i){n!=="dirty"&&(t+=i.length)}),t},isDifferent:function(n,t){return!this.equalityComparer||!this.equalityComparer(n,t)},extend:st};h.exportProperty(a,"subscribe",a.subscribe);h.exportProperty(a,"extend",a.extend);h.exportProperty(a,"getSubscriptionsCount",a.getSubscriptionsCount);h.utils.canSetPrototype&&h.utils.setPrototypeOf(a,Function.prototype);h.subscribable.fn=a;h.isSubscribable=function(n){return n!=null&&typeof n.subscribe=="function"&&typeof n.notifySubscribers=="function"};h.exportSymbol("subscribable",h.subscribable);h.exportSymbol("isSubscribable",h.isSubscribable);h.computedContext=h.dependencyDetection=function(){function f(){return++u}function i(i){t.push(n);n=i}function r(){n=t.pop()}var t=[],n,u=0;return{begin:i,end:r,registerDependency:function(t){if(n){if(!h.isSubscribable(t))throw new Error("Only subscribable things can act as dependencies");n.callback.call(n.callbackTarget,t,t._id||(t._id=f()))}},ignore:function(n,t,u){try{return i(),n.apply(t,u||[])}finally{r()}},getDependenciesCount:function(){if(n)return n.computed.getDependenciesCount()},isInitial:function(){if(n)return n.isInitial}}}();h.exportSymbol("computedContext",h.computedContext);h.exportSymbol("computedContext.getDependenciesCount",h.computedContext.getDependenciesCount);h.exportSymbol("computedContext.isInitial",h.computedContext.isInitial);h.exportSymbol("ignoreDependencies",h.ignoreDependencies=h.dependencyDetection.ignore);p=h.utils.createSymbolOrString("_latestValue");h.observable=function(n){function t(){return arguments.length>0?(t.isDifferent(t[p],arguments[0])&&(t.valueWillMutate(),t[p]=arguments[0],t.valueHasMutated()),this):(h.dependencyDetection.registerDependency(t),t[p])}return t[p]=n,h.utils.canSetPrototype||h.utils.extend(t,h.subscribable.fn),h.subscribable.fn.init(t),h.utils.setPrototypeOfOrExtend(t,v),h.options.deferUpdates&&h.extenders.deferred(t,!0),t};v={equalityComparer:nt,peek:function(){return this[p]},valueHasMutated:function(){this.notifySubscribers(this[p])},valueWillMutate:function(){this.notifySubscribers(this[p],"beforeChange")}};h.utils.canSetPrototype&&h.utils.setPrototypeOf(v,h.subscribable.fn);w=h.observable.protoProperty="__ko_proto__";v[w]=h.observable;h.hasPrototype=function(n,i){return n===null||n===t||n[w]===t?!1:n[w]===i?!0:h.hasPrototype(n[w],i)};h.isObservable=function(n){return h.hasPrototype(n,h.observable)};h.isWriteableObservable=function(n){return typeof n=="function"&&n[w]===h.observable?!0:typeof n=="function"&&n[w]===h.dependentObservable&&n.hasWriteFunction?!0:!1};h.exportSymbol("observable",h.observable);h.exportSymbol("isObservable",h.isObservable);h.exportSymbol("isWriteableObservable",h.isWriteableObservable);h.exportSymbol("isWritableObservable",h.isWriteableObservable);h.exportSymbol("observable.fn",v);h.exportProperty(v,"peek",v.peek);h.exportProperty(v,"valueHasMutated",v.valueHasMutated);h.exportProperty(v,"valueWillMutate",v.valueWillMutate);h.observableArray=function(n){if(n=n||[],typeof n!="object"||!("length"in n))throw new Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");var t=h.observable(n);return h.utils.setPrototypeOfOrExtend(t,h.observableArray.fn),t.extend({trackArrayChanges:!0})};h.observableArray.fn={remove:function(n){for(var u,r=this.peek(),i=[],f=typeof n=="function"&&!h.isObservable(n)?n:function(t){return t===n},t=0;t<r.length;t++)u=r[t],f(u)&&(i.length===0&&this.valueWillMutate(),i.push(u),r.splice(t,1),t--);return i.length&&this.valueHasMutated(),i},removeAll:function(n){if(n===t){var i=this.peek(),r=i.slice(0);return this.valueWillMutate(),i.splice(0,i.length),this.valueHasMutated(),r}return n?this.remove(function(t){return h.utils.arrayIndexOf(n,t)>=0}):[]},destroy:function(n){var i=this.peek(),u=typeof n=="function"&&!h.isObservable(n)?n:function(t){return t===n},t,r;for(this.valueWillMutate(),t=i.length-1;t>=0;t--)r=i[t],u(r)&&(i[t]._destroy=!0);this.valueHasMutated()},destroyAll:function(n){return n===t?this.destroy(function(){return!0}):n?this.destroy(function(t){return h.utils.arrayIndexOf(n,t)>=0}):[]},indexOf:function(n){var t=this();return h.utils.arrayIndexOf(t,n)},replace:function(n,t){var i=this.indexOf(n);i>=0&&(this.valueWillMutate(),this.peek()[i]=t,this.valueHasMutated())}};h.utils.canSetPrototype&&h.utils.setPrototypeOf(h.observableArray.fn,h.observable.fn);h.utils.arrayForEach(["pop","push","reverse","shift","sort","splice","unshift"],function(n){h.observableArray.fn[n]=function(){var t=this.peek(),i;return this.valueWillMutate(),this.cacheDiffForKnownOperation(t,n,arguments),i=t[n].apply(t,arguments),this.valueHasMutated(),i===t?this:i}});h.utils.arrayForEach(["slice"],function(n){h.observableArray.fn[n]=function(){var t=this();return t[n].apply(t,arguments)}});h.exportSymbol("observableArray",h.observableArray);b="arrayChange";h.extenders.trackArrayChanges=function(n,i){function l(){if(!f){f=!0;u=n.notifySubscribers;n.notifySubscribers=function(n,t){return t&&t!==y||++e,u.apply(this,arguments)};var t=[].concat(n.peek()||[]);r=null;o=n.subscribe(function(i){if(i=[].concat(i||[]),n.hasSubscriptionsForEvent(b))var u=a(t,i);t=i;r=null;e=0;u&&u.length&&n.notifySubscribers(u,b)})}}function a(t,i){return(!r||e>1)&&(r=h.utils.compareArrays(t,i,n.compareArrayOptions)),r}if(n.compareArrayOptions={},i&&typeof i=="object"&&h.utils.extend(n.compareArrayOptions,i),n.compareArrayOptions.sparse=!0,!n.cacheDiffForKnownOperation){var f=!1,r=null,o,e=0,u,s=n.beforeSubscriptionAdd,c=n.afterSubscriptionRemove;n.beforeSubscriptionAdd=function(t){s&&s.call(n,t);t===b&&l()};n.afterSubscriptionRemove=function(i){c&&c.call(n,i);i!==b||n.hasSubscriptionsForEvent(b)||(u&&(n.notifySubscribers=u,u=t),o.dispose(),f=!1)};n.cacheDiffForKnownOperation=function(n,t,i){function c(n,t,i){return l[l.length]={status:n,value:t,index:i}}var u,y;if(f&&!e){var l=[],o=n.length,a=i.length,s=0;switch(t){case"push":s=o;case"unshift":for(u=0;u<a;u++)c("added",i[u],s+u);break;case"pop":s=o-1;case"shift":o&&c("deleted",n[s],s);break;case"splice":var v=Math.min(Math.max(0,i[0]<0?o+i[0]:i[0]),o),p=a===1?o:Math.min(v+(i[1]||0),o),w=v+a-2,d=Math.max(p,w),b=[],k=[];for(u=v,y=2;u<d;++u,++y)u<p&&k.push(c("deleted",n[u],u)),u<w&&b.push(c("added",i[y],u));h.utils.findMovesInArrayComparison(k,b);break;default:return}r=l}}}};c=h.utils.createSymbolOrString("_state");h.computed=h.dependentObservable=function(i,r,u){function f(){if(arguments.length>0){if(typeof o=="function")o.apply(e.evaluatorFunctionTarget,arguments);else throw new 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 h.dependencyDetection.registerDependency(f),(e.isDirty||e.isSleeping&&f.haveDependenciesChanged())&&f.evaluateImmediate(),e.latestValue}if(typeof i=="object"?u=i:(u=u||{},i&&(u.read=i)),typeof u.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var o=u.write,e={latestValue:t,isStale:!0,isDirty:!0,isBeingEvaluated:!1,suppressDisposalUntilDisposeWhenReturnsFalse:!1,isDisposed:!1,pure:!1,isSleeping:!1,readFunction:u.read,evaluatorFunctionTarget:r||u.owner,disposeWhenNodeIsRemoved:u.disposeWhenNodeIsRemoved||u.disposeWhenNodeIsRemoved||null,disposeWhen:u.disposeWhen||u.disposeWhen,domNodeDisposalCallback:null,dependencyTracking:{},dependenciesCount:0,evaluationTimeoutInstance:null};return f[c]=e,f.hasWriteFunction=typeof o=="function",h.utils.canSetPrototype||h.utils.extend(f,h.subscribable.fn),h.subscribable.fn.init(f),h.utils.setPrototypeOfOrExtend(f,l),u.pure?(e.pure=!0,e.isSleeping=!0,h.utils.extend(f,at)):u.deferEvaluation&&h.utils.extend(f,vt),h.options.deferUpdates&&h.extenders.deferred(f,!0),n&&(f._options=u),e.disposeWhenNodeIsRemoved&&(e.suppressDisposalUntilDisposeWhenReturnsFalse=!0,e.disposeWhenNodeIsRemoved.nodeType||(e.disposeWhenNodeIsRemoved=null)),e.isSleeping||u.deferEvaluation||f.evaluateImmediate(),e.disposeWhenNodeIsRemoved&&f.isActive()&&h.utils.domNodeDisposal.addDisposeCallback(e.disposeWhenNodeIsRemoved,e.domNodeDisposalCallback=function(){f.dispose()}),f};var l={equalityComparer:nt,getDependenciesCount:function(){return this[c].dependenciesCount},addDependencyTracking:function(n,t,i){if(this[c].pure&&t===this)throw Error("A 'pure' computed must not be called recursively");this[c].dependencyTracking[n]=i;i._order=this[c].dependenciesCount++;i._version=t.getVersion()},haveDependenciesChanged:function(){var t,n,i=this[c].dependencyTracking;for(t in i)if(i.hasOwnProperty(t)&&(n=i[t],this._evalDelayed&&n._target._notificationIsPending||n._target.hasChanged(n._version)))return!0},markDirty:function(){this._evalDelayed&&!this[c].isBeingEvaluated&&this._evalDelayed(!1)},isActive:function(){var n=this[c];return n.isDirty||n.dependenciesCount>0},respondToChange:function(){this._notificationIsPending?this[c].isDirty&&(this[c].isStale=!0):this.evaluatePossiblyAsync()},subscribeToDependency:function(n){if(n._deferUpdates&&!this[c].disposeWhenNodeIsRemoved){var t=n.subscribe(this.markDirty,this,"dirty"),i=n.subscribe(this.respondToChange,this);return{_target:n,dispose:function(){t.dispose();i.dispose()}}}return n.subscribe(this.evaluatePossiblyAsync,this)},evaluatePossiblyAsync:function(){var n=this,t=n.throttleEvaluation;t&&t>=0?(clearTimeout(this[c].evaluationTimeoutInstance),this[c].evaluationTimeoutInstance=h.utils.setTimeout(function(){n.evaluateImmediate(!0)},t)):n._evalDelayed?n._evalDelayed(!0):n.evaluateImmediate(!0)},evaluateImmediate:function(n){var i=this,t=i[c],r=t.disposeWhen,u=!1;if(!t.isBeingEvaluated&&!t.isDisposed){if(t.disposeWhenNodeIsRemoved&&!h.utils.domNodeIsAttachedToDocument(t.disposeWhenNodeIsRemoved)||r&&r()){if(!t.suppressDisposalUntilDisposeWhenReturnsFalse){i.dispose();return}}else t.suppressDisposalUntilDisposeWhenReturnsFalse=!1;t.isBeingEvaluated=!0;try{u=this.evaluateImmediate_CallReadWithDependencyDetection(n)}finally{t.isBeingEvaluated=!1}return t.dependenciesCount||i.dispose(),u}},evaluateImmediate_CallReadWithDependencyDetection:function(i){var u=this,r=u[c],e=!1,o=r.pure?t:!r.dependenciesCount,s={computedObservable:u,disposalCandidates:r.dependencyTracking,disposalCount:r.dependenciesCount},f;return h.dependencyDetection.begin({callbackTarget:s,callback:lt,computed:u,isInitial:o}),r.dependencyTracking={},r.dependenciesCount=0,f=this.evaluateImmediate_CallReadThenEndDependencyDetection(r,s),u.isDifferent(r.latestValue,f)&&(r.isSleeping||u.notifySubscribers(r.latestValue,"beforeChange"),r.latestValue=f,n&&(u._latestValue=f),r.isSleeping?u.updateVersion():i&&u.notifySubscribers(r.latestValue),e=!0),o&&u.notifySubscribers(r.latestValue,"awake"),e},evaluateImmediate_CallReadThenEndDependencyDetection:function(n,t){try{var i=n.readFunction;return n.evaluatorFunctionTarget?i.call(n.evaluatorFunctionTarget):i()}finally{h.dependencyDetection.end();t.disposalCount&&!n.isSleeping&&h.utils.objectForEach(t.disposalCandidates,ct);n.isStale=n.isDirty=!1}},peek:function(n){var t=this[c];return(t.isDirty&&(n||!t.dependenciesCount)||t.isSleeping&&this.haveDependenciesChanged())&&this.evaluateImmediate(),t.latestValue},limit:function(n){h.subscribable.fn.limit.call(this,n);this._evalIfChanged=function(){return this[c].isStale?this.evaluateImmediate():this[c].isDirty=!1,this[c].latestValue};this._evalDelayed=function(n){this._limitBeforeChange(this[c].latestValue);this[c].isDirty=!0;n&&(this[c].isStale=!0);this._limitChange(this)}},dispose:function(){var n=this[c];!n.isSleeping&&n.dependencyTracking&&h.utils.objectForEach(n.dependencyTracking,function(n,t){t.dispose&&t.dispose()});n.disposeWhenNodeIsRemoved&&n.domNodeDisposalCallback&&h.utils.domNodeDisposal.removeDisposeCallback(n.disposeWhenNodeIsRemoved,n.domNodeDisposalCallback);n.dependencyTracking=null;n.dependenciesCount=0;n.isDisposed=!0;n.isStale=!1;n.isDirty=!1;n.isSleeping=!1;n.disposeWhenNodeIsRemoved=null}},at={beforeSubscriptionAdd:function(n){var i=this,t=i[c],r;!t.isDisposed&&t.isSleeping&&n=="change"&&(t.isSleeping=!1,t.isStale||i.haveDependenciesChanged()?(t.dependencyTracking=null,t.dependenciesCount=0,i.evaluateImmediate()&&i.updateVersion()):(r=[],h.utils.objectForEach(t.dependencyTracking,function(n,t){r[t._order]=n}),h.utils.arrayForEach(r,function(n,r){var f=t.dependencyTracking[n],u=i.subscribeToDependency(f._target);u._order=r;u._version=f._version;t.dependencyTracking[n]=u})),t.isDisposed||i.notifySubscribers(t.latestValue,"awake"))},afterSubscriptionRemove:function(n){var i=this[c];i.isDisposed||n!="change"||this.hasSubscriptionsForEvent("change")||(h.utils.objectForEach(i.dependencyTracking,function(n,t){t.dispose&&(i.dependencyTracking[n]={_target:t._target,_order:t._order,_version:t._version},t.dispose())}),i.isSleeping=!0,this.notifySubscribers(t,"asleep"))},getVersion:function(){var n=this[c];return n.isSleeping&&(n.isStale||this.haveDependenciesChanged())&&this.evaluateImmediate(),h.subscribable.fn.getVersion.call(this)}},vt={beforeSubscriptionAdd:function(n){(n=="change"||n=="beforeChange")&&this.peek()}};h.utils.canSetPrototype&&h.utils.setPrototypeOf(l,h.subscribable.fn);tt=h.observable.protoProperty;h.computed[tt]=h.observable;l[tt]=h.computed;h.isComputed=function(n){return h.hasPrototype(n,h.computed)};h.isPureComputed=function(n){return h.hasPrototype(n,h.computed)&&n[c]&&n[c].pure};h.exportSymbol("computed",h.computed);h.exportSymbol("dependentObservable",h.computed);h.exportSymbol("isComputed",h.isComputed);h.exportSymbol("isPureComputed",h.isPureComputed);h.exportSymbol("computed.fn",l);h.exportProperty(l,"peek",l.peek);h.exportProperty(l,"dispose",l.dispose);h.exportProperty(l,"isActive",l.isActive);h.exportProperty(l,"getDependenciesCount",l.getDependenciesCount);h.pureComputed=function(n,t){return typeof n=="function"?h.computed(n,t,{pure:!0}):(n=h.utils.extend({},n),n.pure=!0,h.computed(n,t))};h.exportSymbol("pureComputed",h.pureComputed),function(){function i(r,f,e){var s,o;return(e=e||new n,r=f(r),s=typeof r=="object"&&r!==null&&r!==t&&!(r instanceof RegExp)&&!(r instanceof Date)&&!(r instanceof String)&&!(r instanceof Number)&&!(r instanceof Boolean),!s)?r:(o=r instanceof Array?[]:{},e.save(r,o),u(r,function(n){var u=f(r[n]),s;switch(typeof u){case"boolean":case"number":case"string":case"function":o[n]=u;break;case"object":case"undefined":s=e.get(u);o[n]=s!==t?s:i(u,f,e)}}),o)}function u(n,t){var i,r;if(n instanceof Array){for(i=0;i<n.length;i++)t(i);typeof n.toJSON=="function"&&t("toJSON")}else for(r in n)t(r)}function n(){this.keys=[];this.values=[]}var r=10;h.toJS=function(n){if(arguments.length==0)throw new Error("When calling ko.toJS, pass the object you want to convert.");return i(n,function(n){for(var t=0;h.isObservable(n)&&t<r;t++)n=n();return n})};h.toJSON=function(n,t,i){var r=h.toJS(n);return h.utils.stringifyJson(r,t,i)};n.prototype={constructor:n,save:function(n,t){var i=h.utils.arrayIndexOf(this.keys,n);i>=0?this.values[i]=t:(this.keys.push(n),this.values.push(t))},get:function(n){var i=h.utils.arrayIndexOf(this.keys,n);return i>=0?this.values[i]:t}}}();h.exportSymbol("toJS",h.toJS);h.exportSymbol("toJSON",h.toJSON),function(){var n="__ko__hasDomDataOptionValue__";h.selectExtensions={readValue:function(i){switch(h.utils.tagNameLower(i)){case"option":return i[n]===!0?h.utils.domData.get(i,h.bindingHandlers.options.optionValueDomDataKey):h.utils.ieVersion<=7?i.getAttributeNode("value")&&i.getAttributeNode("value").specified?i.value:i.text:i.value;case"select":return i.selectedIndex>=0?h.selectExtensions.readValue(i.options[i.selectedIndex]):t;default:return i.value}},writeValue:function(i,r,u){var e,f,s,o;switch(h.utils.tagNameLower(i)){case"option":switch(typeof r){case"string":h.utils.domData.set(i,h.bindingHandlers.options.optionValueDomDataKey,t);n in i&&delete i[n];i.value=r;break;default:h.utils.domData.set(i,h.bindingHandlers.options.optionValueDomDataKey,r);i[n]=!0;i.value=typeof r=="number"?r:""}break;case"select":for((r===""||r===null)&&(r=t),e=-1,f=0,s=i.options.length;f<s;++f)if(o=h.selectExtensions.readValue(i.options[f]),o==r||o==""&&r===t){e=f;break}(u||e>=0||r===t&&i.size>1)&&(i.selectedIndex=e);break;default:(r===null||r===t)&&(r="");i.value=r}}}}();h.exportSymbol("selectExtensions",h.selectExtensions);h.exportSymbol("selectExtensions.readValue",h.selectExtensions.readValue);h.exportSymbol("selectExtensions.writeValue",h.selectExtensions.writeValue);h.expressionRewriting=function(){function e(n){if(h.utils.arrayIndexOf(u,n)>=0)return!1;var t=n.match(f);return t===null?!1:t[1]?"Object("+t[1]+")"+t[2]:n}function i(n){var r=h.utils.stringTrim(n),l,f,i,v;r.charCodeAt(0)===123&&(r=r.slice(1,-1));var y=[],o=r.match(t),e,u=[],a=0;if(o)for(o.push(","),l=0;f=o[l];++l){if(i=f.charCodeAt(0),i===44){if(a<=0){y.push(e&&u.length?{key:e,value:u.join("")}:{unknown:e||u.join("")});e=a=0;u=[];continue}}else if(i===58){if(!a&&!e&&u.length===1){e=u.pop();continue}}else i===47&&l&&f.length>1?(v=o[l-1].match(s),v&&!c[v[0]]&&(r=r.substr(r.indexOf(f)+1),o=r.match(t),o.push(","),l=-1,f="/")):i===40||i===123||i===91?++a:i===41||i===125||i===93?--a:e||u.length||i!==34&&i!==39||(f=f.slice(1,-1));u.push(f)}return y}function l(n,t){function u(n,t){function l(i){return i&&i.preprocess?t=i.preprocess(t,n,u):!0}var i;if(!c){if(!l(h.getBindingHandler(n)))return;r[n]&&(i=e(t))&&f.push("'"+n+"':function(_z){"+i+"=_z}")}s&&(t="function(){return "+t+" }");o.push("'"+n+"':"+t)}t=t||{};var o=[],f=[],s=t.valueAccessors,c=t.bindingParams,l=typeof n=="string"?i(n):n;return h.utils.arrayForEach(l,function(n){u(n.key||n.unknown,n.value)}),f.length&&u("_ko_property_writers","{"+f.join(",")+" }"),o.join(",")}var u=["true","false","null","undefined"],f=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,n=",\"'{}()/:[\\]",o="[^\\s:,/][^"+n+"]*[^\\s"+n+"]",t=RegExp("\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'|/(?:[^/\\\\]|\\\\.)*/w*|"+o+"|[^\\s]","g"),s=/[\])"'A-Za-z0-9_$]+$/,c={"in":1,"return":1,"typeof":1},r={};return{bindingRewriteValidators:[],twoWayBindings:r,parseObjectLiteral:i,preProcessBindings:l,keyValueArrayContainsKey:function(n,t){for(var i=0;i<n.length;i++)if(n[i].key==t)return!0;return!1},writeValueToProperty:function(n,t,i,r,u){if(n&&h.isObservable(n))h.isWriteableObservable(n)&&(!u||n.peek()!==r)&&n(r);else{var f=t.get("_ko_property_writers");f&&f[i]&&f[i](r)}}}}();h.exportSymbol("expressionRewriting",h.expressionRewriting);h.exportSymbol("expressionRewriting.bindingRewriteValidators",h.expressionRewriting.bindingRewriteValidators);h.exportSymbol("expressionRewriting.parseObjectLiteral",h.expressionRewriting.parseObjectLiteral);h.exportSymbol("expressionRewriting.preProcessBindings",h.expressionRewriting.preProcessBindings);h.exportSymbol("expressionRewriting._twoWayBindings",h.expressionRewriting.twoWayBindings);h.exportSymbol("jsonExpressionRewriting",h.expressionRewriting);h.exportSymbol("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",h.expressionRewriting.preProcessBindings),function(){function n(n){return n.nodeType==8&&u.test(t?n.text:n.nodeValue)}function r(n){return n.nodeType==8&&o.test(t?n.text:n.nodeValue)}function f(t,i){for(var u=t,f=1,e=[];u=u.nextSibling;){if(r(u)&&(f--,f===0))return e;e.push(u);n(u)&&f++}if(!i)throw new Error("Cannot find closing comment tag to match: "+t.nodeValue);return null}function e(n,t){var i=f(n,t);return i?i.length>0?i[i.length-1].nextSibling:n.nextSibling:null}function c(t){var i=t.firstChild,u=null,f;if(i)do u?u.push(i):n(i)?(f=e(i,!0),f?i=f:u=[i]):r(i)&&(u=[i]);while(i=i.nextSibling);return u}var t=i&&i.createComment("test").text==="<!--test-->",u=t?/^<!--\s*ko(?:\s+([\s\S]+))?\s*-->$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,o=t?/^<!--\s*\/ko\s*-->$/:/^\s*\/ko\s*$/,s={ul:!0,ol:!0};h.virtualElements={allowedBindings:{},childNodes:function(t){return n(t)?f(t):t.childNodes},emptyNode:function(t){var r,i,u;if(n(t))for(r=h.virtualElements.childNodes(t),i=0,u=r.length;i<u;i++)h.removeNode(r[i]);else h.utils.emptyDomNode(t)},setDomNodeChildren:function(t,i){var u,r,f;if(n(t))for(h.virtualElements.emptyNode(t),u=t.nextSibling,r=0,f=i.length;r<f;r++)u.parentNode.insertBefore(i[r],u);else h.utils.setDomNodeChildren(t,i)},prepend:function(t,i){n(t)?t.parentNode.insertBefore(i,t.nextSibling):t.firstChild?t.insertBefore(i,t.firstChild):t.appendChild(i)},insertAfter:function(t,i,r){r?n(t)?t.parentNode.insertBefore(i,r.nextSibling):r.nextSibling?t.insertBefore(i,r.nextSibling):t.appendChild(i):h.virtualElements.prepend(t,i)},firstChild:function(t){return n(t)?!t.nextSibling||r(t.nextSibling)?null:t.nextSibling:t.firstChild},nextSibling:function(t){return(n(t)&&(t=e(t)),t.nextSibling&&r(t.nextSibling))?null:t.nextSibling},hasBindingValue:n,virtualNodeBindingValue:function(n){var i=(t?n.text:n.nodeValue).match(u);return i?i[1]:null},normaliseVirtualElementDomStructure:function(n){var t,i,u,r;if(s[h.utils.tagNameLower(n)]&&(t=n.firstChild,t))do if(t.nodeType===1&&(i=c(t),i))for(u=t.nextSibling,r=0;r<i.length;r++)u?n.insertBefore(i[r],u):n.appendChild(i[r]);while(t=t.nextSibling)}}}();h.exportSymbol("virtualElements",h.virtualElements);h.exportSymbol("virtualElements.allowedBindings",h.virtualElements.allowedBindings);h.exportSymbol("virtualElements.emptyNode",h.virtualElements.emptyNode);h.exportSymbol("virtualElements.insertAfter",h.virtualElements.insertAfter);h.exportSymbol("virtualElements.prepend",h.virtualElements.prepend);h.exportSymbol("virtualElements.setDomNodeChildren",h.virtualElements.setDomNodeChildren),function(){function t(n,t,r){var u=n+(r&&r.valueAccessors||"");return t[u]||(t[u]=i(n,r))}function i(n,t){var i=h.expressionRewriting.preProcessBindings(n,t),r="with($context){with($data||{}){return{"+i+"}}}";return new Function("$context","$element",r)}var n="data-bind";h.bindingProvider=function(){this.bindingCache={}};h.utils.extend(h.bindingProvider.prototype,{nodeHasBindings:function(t){switch(t.nodeType){case 1:return t.getAttribute(n)!=null||h.components.getComponentNameForNode(t);case 8:return h.virtualElements.hasBindingValue(t);default:return!1}},getBindings:function(n,t){var i=this.getBindingsString(n,t),r=i?this.parseBindingsString(i,t,n):null;return h.components.addBindingsForCustomElement(r,n,t,!1)},getBindingAccessors:function(n,t){var i=this.getBindingsString(n,t),r=i?this.parseBindingsString(i,t,n,{valueAccessors:!0}):null;return h.components.addBindingsForCustomElement(r,n,t,!0)},getBindingsString:function(t){switch(t.nodeType){case 1:return t.getAttribute(n);case 8:return h.virtualElements.virtualNodeBindingValue(t);default:return null}},parseBindingsString:function(n,i,r,u){try{var e=t(n,this.bindingCache,u);return e(i,r)}catch(f){f.message="Unable to parse bindings.\nBindings value: "+n+"\nMessage: "+f.message;throw f;}}});h.bindingProvider.instance=new h.bindingProvider}();h.exportSymbol("bindingProvider",h.bindingProvider),function(){function v(n){return function(){return n}}function i(n){return n()}function s(n){return h.utils.objectMap(h.dependencyDetection.ignore(n),function(t,i){return function(){return n()[i]}})}function y(n,t,i){return typeof n=="function"?s(n.bind(null,t,i)):h.utils.objectMap(n,v)}function p(n,t){return s(this.getBindings.bind(this,n,t))}function w(n){var t=h.virtualElements.allowedBindings[n];if(!t)throw new Error("The binding '"+n+"' cannot be used with virtual elements");}function c(n,t,i){var r,u=h.virtualElements.firstChild(t),f=h.bindingProvider.instance,e=f.preprocessNode;if(e){while(r=u)u=h.virtualElements.nextSibling(r),e.call(f,r);u=h.virtualElements.firstChild(t)}while(r=u)u=h.virtualElements.nextSibling(r),l(n,r,i)}function l(n,t,i){var u=!0,r=t.nodeType===1,f;r&&h.virtualElements.normaliseVirtualElementDomStructure(t);f=r&&i||h.bindingProvider.instance.nodeHasBindings(t);f&&(u=a(t,null,n,i).shouldBindDescendants);u&&!o[h.utils.tagNameLower(t)]&&c(n,t,!r)}function b(n){var i=[],r={},t=[];return h.utils.objectForEach(n,function u(f){if(!r[f]){var e=h.getBindingHandler(f);e&&(e.after&&(t.push(f),h.utils.arrayForEach(e.after,function(i){if(n[i])if(h.utils.arrayIndexOf(t,i)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+t.join(", "));else u(i)}),t.length--),i.push({key:f,handler:e}));r[f]=!0}}),i}function a(n,r,u,e){var v=h.utils.domData.get(n,f),o,c,l,k;if(!r){if(v)throw Error("You cannot apply bindings multiple times to the same element.");h.utils.domData.set(n,f,!0)}if(!v&&e&&h.storedBindingContextForNode(n,u),r&&typeof r!="function")o=r;else{var y=h.bindingProvider.instance,d=y.getBindingAccessors||p,s=h.dependentObservable(function(){return o=r?r(u,n):d.call(y,n,u),o&&u._subscribable&&u._subscribable(),o},null,{disposeWhenNodeIsRemoved:n});o&&s.isActive()||(s=null)}if(o){l=s?function(n){return function(){return i(s()[n])}}:function(n){return o[n]};function a(){return h.utils.objectMap(s?s():o,i)}a.get=function(n){return o[n]&&i(l(n))};a.has=function(n){return n in o};k=b(o);h.utils.arrayForEach(k,function(i){var e=i.handler.init,s=i.handler.update,r=i.key;n.nodeType===8&&w(r);try{typeof e=="function"&&h.dependencyDetection.ignore(function(){var i=e(n,l(r),a,u.$data,u);if(i&&i.controlsDescendantBindings){if(c!==t)throw new Error("Multiple bindings ("+c+" and "+r+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");c=r}});typeof s=="function"&&h.dependentObservable(function(){s(n,l(r),a,u.$data,u)},null,{disposeWhenNodeIsRemoved:n})}catch(f){f.message='Unable to process binding "'+r+": "+o[r]+'"\nMessage: '+f.message;throw f;}})}return{shouldBindDescendants:c===t}}function n(n){return n&&n instanceof h.bindingContext?n:new h.bindingContext(n)}var o,f,e;h.bindingHandlers={};o={script:!0,textarea:!0,template:!0};h.getBindingHandler=function(n){return h.bindingHandlers[n]};h.bindingContext=function(n,i,r,u,f){function c(){var f=a?n():n,t=h.utils.unwrapObservable(f);return i?(i._subscribable&&i._subscribable(),h.utils.extend(e,i),e._subscribable=o):(e.$parents=[],e.$root=t,e.ko=h),e.$rawData=f,e.$data=t,r&&(e[r]=t),u&&u(e,i,t),e.$data}function l(){return s&&!h.utils.anyDomNodeIsAttachedToDocument(s)}var e=this,a=typeof n=="function"&&!h.isObservable(n),s,o;f&&f.exportDependencies?c():(o=h.dependentObservable(c,null,{disposeWhen:l,disposeWhenNodeIsRemoved:!0}),o.isActive()&&(e._subscribable=o,o.equalityComparer=null,s=[],o._addNode=function(n){s.push(n);h.utils.domNodeDisposal.addDisposeCallback(n,function(n){h.utils.arrayRemoveItem(s,n);s.length||(o.dispose(),e._subscribable=o=t)})}))};h.bindingContext.prototype.createChildContext=function(n,t,i,r){return new h.bindingContext(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)},r)};h.bindingContext.prototype.extend=function(n){return new h.bindingContext(this._subscribable||this.$data,this,null,function(t,i){t.$rawData=i.$rawData;h.utils.extend(t,typeof n=="function"?n():n)})};h.bindingContext.prototype.createStaticChildContext=function(n,t){return this.createChildContext(n,t,null,{exportDependencies:!0})};f=h.utils.domData.nextKey();e=h.utils.domData.nextKey();h.storedBindingContextForNode=function(n,t){if(arguments.length==2)h.utils.domData.set(n,e,t),t._subscribable&&t._subscribable._addNode(n);else return h.utils.domData.get(n,e)};h.applyBindingAccessorsToNode=function(t,i,r){return t.nodeType===1&&h.virtualElements.normaliseVirtualElementDomStructure(t),a(t,i,n(r),!0)};h.applyBindingsToNode=function(t,i,r){var u=n(r);return h.applyBindingAccessorsToNode(t,y(i,u,t),u)};h.applyBindingsToDescendants=function(t,i){(i.nodeType===1||i.nodeType===8)&&c(n(t),i,!0)};h.applyBindings=function(t,i){if(!r&&u.jQuery&&(r=u.jQuery),i&&i.nodeType!==1&&i.nodeType!==8)throw new Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");i=i||u.document.body;l(n(t),i,!0)};h.contextFor=function(n){switch(n.nodeType){case 1:case 8:var i=h.storedBindingContextForNode(n);if(i)return i;if(n.parentNode)return h.contextFor(n.parentNode)}return t};h.dataFor=function(n){var i=h.contextFor(n);return i?i.$data:t};h.exportSymbol("bindingHandlers",h.bindingHandlers);h.exportSymbol("applyBindings",h.applyBindings);h.exportSymbol("applyBindingsToDescendants",h.applyBindingsToDescendants);h.exportSymbol("applyBindingAccessorsToNode",h.applyBindingAccessorsToNode);h.exportSymbol("applyBindingsToNode",h.applyBindingsToNode);h.exportSymbol("contextFor",h.contextFor);h.exportSymbol("dataFor",h.dataFor)}(),function(n){function u(t,i){return t.hasOwnProperty(i)?t[i]:n}function f(n,t){var f=u(i,n),o;f?f.subscribe(t):(f=i[n]=new h.subscribable,f.subscribe(t),e(n,function(t,u){var e=!!(u&&u.synchronous);r[n]={definition:t,isSynchronousComponent:e};delete i[n];o||e?f.notifySubscribers(t):h.tasks.schedule(function(){f.notifySubscribers(t)})}),o=!0)}function e(n,i){t("getConfig",[n],function(r){r?t("loadComponent",[n,r],function(n){i(n,r)}):i(null,null)})}function t(i,r,u,f){var e,o,s,c;if(f||(f=h.components.loaders.slice(0)),e=f.shift(),e)if(o=e[i],o){if(s=!1,c=o.apply(e,r.concat(function(n){s?u(null):n!==null?u(n):t(i,r,u,f)})),c!==n&&(s=!0,!e.suppressLoaderExceptions))throw new 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={};h.components={get:function(n,t){var i=u(r,n);i?i.isSynchronousComponent?h.dependencyDetection.ignore(function(){t(i.definition)}):h.tasks.schedule(function(){t(i.definition)}):f(n,t)},clearCachedDefinition:function(n){delete r[n]},_getFirstResultFromLoaders:t};h.components.loaders=[];h.exportSymbol("components",h.components);h.exportSymbol("components.get",h.components.get);h.exportSymbol("components.clearCachedDefinition",h.components.clearCachedDefinition)}(),function(){function l(n,i,u,f){var o={},l=2,e=function(){--l==0&&f(o)},s=u.template,c=u.viewModel;s?r(i,s,function(t){h.components._getFirstResultFromLoaders("loadTemplate",[n,t],function(n){o.template=n;e()})}):e();c?r(i,c,function(i){h.components._getFirstResultFromLoaders("loadViewModel",[n,i],function(n){o[t]=n;e()})}):e()}function a(n,t,r){var u,f;typeof t=="string"?r(h.utils.parseHtmlFragment(t)):t instanceof Array?r(t):c(t)?r(h.utils.makeArray(t.childNodes)):t.element?(u=t.element,v(u)?r(o(u)):typeof u=="string"?(f=i.getElementById(u),f?r(o(f)):n("Cannot find element with ID "+u)):n("Unknown element type: "+u)):n("Unknown template value: "+t)}function e(n,i,r){if(typeof i=="function")r(function(n){return new i(n)});else if(typeof i[t]=="function")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 o(n){switch(h.utils.tagNameLower(n)){case"script":return h.utils.parseHtmlFragment(n.text);case"textarea":return h.utils.parseHtmlFragment(n.value);case"template":if(c(n.content))return h.utils.cloneNodes(n.content.childNodes)}return h.utils.cloneNodes(n.childNodes)}function v(n){return u.HTMLElement?n instanceof HTMLElement:n&&n.tagName&&n.nodeType===1}function c(n){return u.DocumentFragment?n instanceof DocumentFragment:n&&n.nodeType===11}function r(n,t,i){typeof t.require=="string"?s||u.require?(s||u.require)([t.require],i):n("Uses require, but no AMD loader is present"):i(t)}function f(n){return function(t){throw new Error("Component '"+n+"': "+t);}}var n={},t;h.components.register=function(t,i){if(!i)throw new Error("Invalid configuration for "+t);if(h.components.isRegistered(t))throw new Error("Component "+t+" is already registered");n[t]=i};h.components.isRegistered=function(t){return n.hasOwnProperty(t)};h.components.unregister=function(t){delete n[t];h.components.clearCachedDefinition(t)};h.components.defaultLoader={getConfig:function(t,i){var r=n.hasOwnProperty(t)?n[t]:null;i(r)},loadComponent:function(n,t,i){var u=f(n);r(u,t,function(t){l(n,u,t,i)})},loadTemplate:function(n,t,i){a(f(n),t,i)},loadViewModel:function(n,t,i){e(f(n),t,i)}};t="createViewModel";h.exportSymbol("components.register",h.components.register);h.exportSymbol("components.isRegistered",h.components.isRegistered);h.exportSymbol("components.unregister",h.components.unregister);h.exportSymbol("components.defaultLoader",h.components.defaultLoader);h.components.loaders.push(h.components.defaultLoader);h.components._allRegisteredComponents=n}(),function(){function t(t,i){var u=t.getAttribute("params");if(u){var e=n.parseBindingsString(u,i,t,{valueAccessors:!0,bindingParams:!0}),f=h.utils.objectMap(e,function(n){return h.computed(n,null,{disposeWhenNodeIsRemoved:t})}),r=h.utils.objectMap(f,function(n){var i=n.peek();return n.isActive()?h.computed({read:function(){return h.utils.unwrapObservable(n())},write:h.isWriteableObservable(i)&&function(t){n()(t)},disposeWhenNodeIsRemoved:t}):i});return r.hasOwnProperty("$raw")||(r.$raw=f),r}return{$raw:{}}}h.components.getComponentNameForNode=function(n){var t=h.utils.tagNameLower(n);if(h.components.isRegistered(t)&&(t.indexOf("-")!=-1||""+n=="[object HTMLUnknownElement]"||h.utils.ieVersion<=8&&n.tagName===t))return t};h.components.addBindingsForCustomElement=function(n,i,r,u){var f,e;if(i.nodeType===1&&(f=h.components.getComponentNameForNode(i),f)){if(n=n||{},n.component)throw new Error('Cannot use the "component" binding on a custom element matching a component');e={name:f,params:t(i,r)};n.component=u?function(){return e}:e}return n};var n=new h.bindingProvider;h.utils.ieVersion<9&&(h.components.register=function(n){return function(t){return i.createElement(t),n.apply(this,arguments)}}(h.components.register),i.createDocumentFragment=function(n){return function(){var t=n(),i=h.components._allRegisteredComponents;for(var r in i)i.hasOwnProperty(r)&&t.createElement(r);return t}}(i.createDocumentFragment))}(),function(n){function i(n,t,i){var r=t.template,u;if(!r)throw new Error("Component '"+n+"' has no template");u=h.utils.cloneNodes(r);h.virtualElements.setDomNodeChildren(i,u)}function r(n,t,i,r){var u=n.createViewModel;return u?u.call(n,r,{element:t,templateNodes:i}):r}var t=0;h.bindingHandlers.component={init:function(u,f,e,o,s){var c,l,a=function(){var n=c&&c.dispose;typeof n=="function"&&n.call(c);c=null;l=null},v=h.utils.makeArray(h.virtualElements.childNodes(u));return h.utils.domNodeDisposal.addDisposeCallback(u,a),h.computed(function(){var o=h.utils.unwrapObservable(f()),e,y,p;if(typeof o=="string"?e=o:(e=h.utils.unwrapObservable(o.name),y=h.utils.unwrapObservable(o.params)),!e)throw new Error("No component name specified");p=l=++t;h.components.get(e,function(t){if(l===p){if(a(),!t)throw new Error("Unknown component '"+e+"'");i(e,t,u);var f=r(t,u,v,y),o=s.createChildContext(f,n,function(n){n.$component=f;n.$componentTemplateNodes=v});c=f;h.applyBindingsToDescendants(o,u)}})},null,{disposeWhenNodeIsRemoved:u}),{controlsDescendantBindings:!0}}};h.virtualElements.allowedBindings.component=!0}();it={"class":"className","for":"htmlFor"};h.bindingHandlers.attr={update:function(n,i){var r=h.utils.unwrapObservable(i())||{};h.utils.objectForEach(r,function(i,r){r=h.utils.unwrapObservable(r);var u=r===!1||r===null||r===t;u&&n.removeAttribute(i);h.utils.ieVersion<=8&&i in it?(i=it[i],u?n.removeAttribute(i):n[i]=r):u||n.setAttribute(i,r.toString());i==="name"&&h.utils.setElementName(n,u?"":r.toString())})}},function(){h.bindingHandlers.checked={after:["value","attr"],init:function(n,i,r){function l(){var l=n.checked,o=y?f():l,t,s;h.computedContext.isInitial()||(!e||l)&&(t=h.dependencyDetection.ignore(i),u?(s=a?t.peek():t,c!==o?(l&&(h.utils.addOrRemoveItem(s,o,!0),h.utils.addOrRemoveItem(s,c,!1)),c=o):h.utils.addOrRemoveItem(s,o,l),a&&h.isWriteableObservable(t)&&t(s)):h.expressionRewriting.writeValueToProperty(t,r,"checked",o,!0))}function v(){var t=h.utils.unwrapObservable(i());n.checked=u?h.utils.arrayIndexOf(t,f())>=0:s?t:f()===t}var f=h.pureComputed(function(){return r.has("checkedValue")?h.utils.unwrapObservable(r.get("checkedValue")):r.has("value")?h.utils.unwrapObservable(r.get("value")):n.value}),s=n.type=="checkbox",e=n.type=="radio";if(s||e){var o=i(),u=s&&h.utils.unwrapObservable(o)instanceof Array,a=!(u&&o.push&&o.splice),c=u?f():t,y=e||u;e&&!n.name&&h.bindingHandlers.uniqueName.init(n,function(){return!0});h.computed(l,null,{disposeWhenNodeIsRemoved:n});h.utils.registerEventHandler(n,"click",l);h.computed(v,null,{disposeWhenNodeIsRemoved:n});o=t}}};h.expressionRewriting.twoWayBindings.checked=!0;h.bindingHandlers.checkedValue={update:function(n,t){n.value=h.utils.unwrapObservable(t())}}}();rt="__ko__cssValue";h.bindingHandlers.css={update:function(n,t){var i=h.utils.unwrapObservable(t());i!==null&&typeof i=="object"?h.utils.objectForEach(i,function(t,i){i=h.utils.unwrapObservable(i);h.utils.toggleDomNodeCssClass(n,t,i)}):(i=h.utils.stringTrim(String(i||"")),h.utils.toggleDomNodeCssClass(n,n[rt],!1),n[rt]=i,h.utils.toggleDomNodeCssClass(n,i,!0))}};h.bindingHandlers.enable={update:function(n,t){var i=h.utils.unwrapObservable(t());i&&n.disabled?n.removeAttribute("disabled"):i||n.disabled||(n.disabled=!0)}};h.bindingHandlers.disable={update:function(n,t){h.bindingHandlers.enable.update(n,function(){return!h.utils.unwrapObservable(t())})}};h.bindingHandlers.event={init:function(n,t,i,r,u){var f=t()||{};h.utils.objectForEach(f,function(f){typeof f=="string"&&h.utils.registerEventHandler(n,f,function(n){var o,s=t()[f],e,c;if(s){try{e=h.utils.makeArray(arguments);r=u.$data;e.unshift(r);o=s.apply(r,e)}finally{o!==!0&&(n.preventDefault?n.preventDefault():n.returnValue=!1)}c=i.get(f+"Bubble")!==!1;c||(n.cancelBubble=!0,n.stopPropagation&&n.stopPropagation())}})})}};h.bindingHandlers.foreach={makeTemplateValueAccessor:function(n){return function(){var i=n(),t=h.utils.peekObservable(i);return!t||typeof t.length=="number"?{foreach:i,templateEngine:h.nativeTemplateEngine.instance}:(h.utils.unwrapObservable(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:h.nativeTemplateEngine.instance})}},init:function(n,t){return h.bindingHandlers.template.init(n,h.bindingHandlers.foreach.makeTemplateValueAccessor(t))},update:function(n,t,i,r,u){return h.bindingHandlers.template.update(n,h.bindingHandlers.foreach.makeTemplateValueAccessor(t),i,r,u)}};h.expressionRewriting.bindingRewriteValidators.foreach=!1;h.virtualElements.allowedBindings.foreach=!0;k="__ko_hasfocusUpdating";d="__ko_hasfocusLastValue";h.bindingHandlers.hasfocus={init:function(n,t,i){var r=function(r){var u,f,e;if(n[k]=!0,u=n.ownerDocument,"activeElement"in u){try{f=u.activeElement}catch(o){f=u.body}r=f===n}e=t();h.expressionRewriting.writeValueToProperty(e,i,"hasfocus",r,!0);n[d]=r;n[k]=!1},u=r.bind(null,!0),f=r.bind(null,!1);h.utils.registerEventHandler(n,"focus",u);h.utils.registerEventHandler(n,"focusin",u);h.utils.registerEventHandler(n,"blur",f);h.utils.registerEventHandler(n,"focusout",f)},update:function(n,t){var i=!!h.utils.unwrapObservable(t());n[k]||n[d]===i||(i?n.focus():n.blur(),!i&&n[d]&&n.ownerDocument.body.focus(),h.dependencyDetection.ignore(h.utils.triggerEvent,null,[n,i?"focusin":"focusout"]))}};h.expressionRewriting.twoWayBindings.hasfocus=!0;h.bindingHandlers.hasFocus=h.bindingHandlers.hasfocus;h.expressionRewriting.twoWayBindings.hasFocus=!0;h.bindingHandlers.html={init:function(){return{controlsDescendantBindings:!0}},update:function(n,t){h.utils.setHtml(n,t())}};ut("if");ut("ifnot",!1,!0);ut("with",!0,!1,function(n,t){return n.createStaticChildContext(t)});g={};h.bindingHandlers.options={init:function(n){if(h.utils.tagNameLower(n)!=="select")throw new Error("options binding applies only to SELECT elements");while(n.length>0)n.remove(0);return{controlsDescendantBindings:!0}},update:function(n,i,r){function y(){return h.utils.arrayFilter(n.options,function(n){return n.selected})}function w(n,t,i){var r=typeof t;return r=="function"?t(n):r=="string"?n[t]:i}function nt(i,f,s){var c,l,a;return s.length&&(u=!e&&s[0].selected?[h.selectExtensions.readValue(s[0])]:[],o=!0),c=n.ownerDocument.createElement("option"),i===g?(h.utils.setTextContent(c,r.get("optionsCaption")),h.selectExtensions.writeValue(c,t)):(l=w(i,r.get("optionsValue"),i),h.selectExtensions.writeValue(c,h.utils.unwrapObservable(l)),a=w(i,r.get("optionsText"),l),h.utils.setTextContent(c,a)),[c]}function b(t,i){if(o&&e)h.selectExtensions.writeValue(n,h.utils.unwrapObservable(r.get("value")),!0);else if(u.length){var f=h.utils.arrayIndexOf(u,h.selectExtensions.readValue(i[0]))>=0;h.utils.setOptionNodeSelectionState(i[0],f);o&&!f&&h.dependencyDetection.ignore(h.utils.triggerEvent,null,[n,"change"])}}var k=n.length==0,s=n.multiple,c=!k&&s?n.scrollTop:null,f=h.utils.unwrapObservable(i()),e=r.get("valueAllowUnset")&&r.has("value"),d=r.get("optionsIncludeDestroyed"),p={},l,a,u=[],o,v;e||(s?u=h.utils.arrayMap(y(),h.selectExtensions.readValue):n.selectedIndex>=0&&u.push(h.selectExtensions.readValue(n.options[n.selectedIndex])));f&&(typeof f.length=="undefined"&&(f=[f]),a=h.utils.arrayFilter(f,function(n){return d||n===t||n===null||!h.utils.unwrapObservable(n._destroy)}),r.has("optionsCaption")&&(l=h.utils.unwrapObservable(r.get("optionsCaption")),l!==null&&l!==t&&a.unshift(g)));o=!1;p.beforeRemove=function(t){n.removeChild(t)};v=b;r.has("optionsAfterRender")&&typeof r.get("optionsAfterRender")=="function"&&(v=function(n,i){b(n,i);h.dependencyDetection.ignore(r.get("optionsAfterRender"),null,[i[0],n!==g?n:t])});h.utils.setDomNodeChildrenFromArrayMapping(n,a,nt,p,v);h.dependencyDetection.ignore(function(){if(e)h.selectExtensions.writeValue(n,h.utils.unwrapObservable(r.get("value")),!0);else{var t;t=s?u.length&&y().length<u.length:u.length&&n.selectedIndex>=0?h.selectExtensions.readValue(n.options[n.selectedIndex])!==u[0]:u.length||n.selectedIndex>=0;t&&h.utils.triggerEvent(n,"change")}});h.utils.ensureSelectElementIsRenderedCorrectly(n);c&&Math.abs(c-n.scrollTop)>20&&(n.scrollTop=c)}};h.bindingHandlers.options.optionValueDomDataKey=h.utils.domData.nextKey();h.bindingHandlers.selectedOptions={after:["options","foreach"],init:function(n,t,i){h.utils.registerEventHandler(n,"change",function(){var u=t(),r=[];h.utils.arrayForEach(n.getElementsByTagName("option"),function(n){n.selected&&r.push(h.selectExtensions.readValue(n))});h.expressionRewriting.writeValueToProperty(u,i,"selectedOptions",r)})},update:function(n,t){if(h.utils.tagNameLower(n)!="select")throw new Error("values binding applies only to SELECT elements");var i=h.utils.unwrapObservable(t()),r=n.scrollTop;i&&typeof i.length=="number"&&h.utils.arrayForEach(n.getElementsByTagName("option"),function(n){var t=h.utils.arrayIndexOf(i,h.selectExtensions.readValue(n))>=0;n.selected!=t&&h.utils.setOptionNodeSelectionState(n,t)});n.scrollTop=r}};h.expressionRewriting.twoWayBindings.selectedOptions=!0;h.bindingHandlers.style={update:function(n,i){var r=h.utils.unwrapObservable(i()||{});h.utils.objectForEach(r,function(i,r){r=h.utils.unwrapObservable(r);(r===null||r===t||r===!1)&&(r="");n.style[i]=r})}};h.bindingHandlers.submit={init:function(n,t,i,r,u){if(typeof t()!="function")throw new Error("The value for a submit binding must be a function");h.utils.registerEventHandler(n,"submit",function(i){var r,f=t();try{r=f.call(u.$data,n)}finally{r!==!0&&(i.preventDefault?i.preventDefault():i.returnValue=!1)}})}};h.bindingHandlers.text={init:function(){return{controlsDescendantBindings:!0}},update:function(n,t){h.utils.setTextContent(n,t())}};h.virtualElements.allowedBindings.text=!0,function(){if(u&&u.navigator)var i=function(n){if(n)return parseFloat(n[1])},o=u.opera&&u.opera.version&&parseInt(u.opera.version()),r=u.navigator.userAgent,s=i(r.match(/^(?:(?!chrome).)*version\/([^ ]*) safari/i)),c=i(r.match(/Firefox\/([^ ]*)/));if(h.utils.ieVersion<10)var f=h.utils.domData.nextKey(),e=h.utils.domData.nextKey(),l=function(n){var t=this.activeElement,i=t&&h.utils.domData.get(t,e);i&&i(n)},a=function(n,t){var i=n.ownerDocument;h.utils.domData.get(i,f)||(h.utils.domData.set(i,f,!0),h.utils.registerEventHandler(i,"selectionchange",l));h.utils.domData.set(n,e,t)};h.bindingHandlers.textInput={init:function(i,r,u){var p=i.value,v,y,e=function(f){clearTimeout(v);y=v=t;var e=i.value;p!==e&&(n&&f&&(i._ko_textInputProcessedEvent=f.type),p=e,h.expressionRewriting.writeValueToProperty(r(),u,"textInput",e))},l=function(t){if(!v){y=i.value;var r=n?e.bind(i,{type:t.type}):e;v=h.utils.setTimeout(r,4)}},w=h.utils.ieVersion==9?l:e,b=function(){var n=h.utils.unwrapObservable(r());if((n===null||n===t)&&(n=""),y!==t&&n===y){h.utils.setTimeout(b,4);return}i.value!==n&&(p=n,i.value=n)},f=function(n,t){h.utils.registerEventHandler(i,n,t)};n&&h.bindingHandlers.textInput._forceUpdateOn?h.utils.arrayForEach(h.bindingHandlers.textInput._forceUpdateOn,function(n){n.slice(0,5)=="after"?f(n.slice(5),l):f(n,e)}):h.utils.ieVersion<10?(f("propertychange",function(n){n.propertyName==="value"&&w(n)}),h.utils.ieVersion==8&&(f("keyup",e),f("keydown",e)),h.utils.ieVersion>=8&&(a(i,w),f("dragend",l))):(f("input",e),s<5&&h.utils.tagNameLower(i)==="textarea"?(f("keydown",l),f("paste",l),f("cut",l)):o<11?f("keydown",l):c<4&&(f("DOMAutoComplete",e),f("dragdrop",e),f("drop",e)));f("change",e);h.computed(b,null,{disposeWhenNodeIsRemoved:i})}};h.expressionRewriting.twoWayBindings.textInput=!0;h.bindingHandlers.textinput={preprocess:function(n,t,i){i("textInput",n)}}}();h.bindingHandlers.uniqueName={init:function(n,t){if(t()){var i="ko_unique_"+ ++h.bindingHandlers.uniqueName.currentIndex;h.utils.setElementName(n,i)}}};h.bindingHandlers.uniqueName.currentIndex=0;h.bindingHandlers.value={after:["options","foreach"],init:function(n,t,i){var o,c,s;if(n.tagName.toLowerCase()=="input"&&(n.type=="checkbox"||n.type=="radio")){h.applyBindingAccessorsToNode(n,{checkedValue:t});return}var r=["change"],u=i.get("valueUpdate"),f=!1,e=null;u&&(typeof u=="string"&&(u=[u]),h.utils.arrayPushAll(r,u),r=h.utils.arrayGetDistinctValues(r));o=function(){e=null;f=!1;var r=t(),u=h.selectExtensions.readValue(n);h.expressionRewriting.writeValueToProperty(r,i,"value",u)};c=h.utils.ieVersion&&n.tagName.toLowerCase()=="input"&&n.type=="text"&&n.autocomplete!="off"&&(!n.form||n.form.autocomplete!="off");c&&h.utils.arrayIndexOf(r,"propertychange")==-1&&(h.utils.registerEventHandler(n,"propertychange",function(){f=!0}),h.utils.registerEventHandler(n,"focus",function(){f=!1}),h.utils.registerEventHandler(n,"blur",function(){f&&o()}));h.utils.arrayForEach(r,function(t){var i=o;h.utils.stringStartsWith(t,"after")&&(i=function(){e=h.selectExtensions.readValue(n);h.utils.setTimeout(o,0)},t=t.substring(5));h.utils.registerEventHandler(n,t,i)});s=function(){var r=h.utils.unwrapObservable(t()),c=h.selectExtensions.readValue(n),o,u,f;if(e!==null&&r===e){h.utils.setTimeout(s,0);return}o=r!==c;o&&(h.utils.tagNameLower(n)==="select"?(u=i.get("valueAllowUnset"),f=function(){h.selectExtensions.writeValue(n,r,u)},f(),u||r===h.selectExtensions.readValue(n)?h.utils.setTimeout(f,0):h.dependencyDetection.ignore(h.utils.triggerEvent,null,[n,"change"])):h.selectExtensions.writeValue(n,r))};h.computed(s,null,{disposeWhenNodeIsRemoved:n})},update:function(){}};h.expressionRewriting.twoWayBindings.value=!0;h.bindingHandlers.visible={update:function(n,t){var i=h.utils.unwrapObservable(t()),r=!(n.style.display=="none");i&&!r?n.style.display="":!i&&r&&(n.style.display="none")}};yt("click");h.templateEngine=function(){};h.templateEngine.prototype.renderTemplateSource=function(){throw new Error("Override renderTemplateSource");};h.templateEngine.prototype.createJavaScriptEvaluatorBlock=function(){throw new Error("Override createJavaScriptEvaluatorBlock");};h.templateEngine.prototype.makeTemplateSource=function(n,t){if(typeof n=="string"){t=t||i;var r=t.getElementById(n);if(!r)throw new Error("Cannot find template with ID "+n);return new h.templateSources.domElement(r)}if(n.nodeType==1||n.nodeType==8)return new h.templateSources.anonymousTemplate(n);throw new Error("Unknown template type: "+n);};h.templateEngine.prototype.renderTemplate=function(n,t,i,r){var u=this.makeTemplateSource(n,r);return this.renderTemplateSource(u,t,i,r)};h.templateEngine.prototype.isTemplateRewritten=function(n,t){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(n,t).data("isRewritten")};h.templateEngine.prototype.rewriteTemplate=function(n,t,i){var r=this.makeTemplateSource(n,i),u=t(r.text());r.text(u);r.data("isRewritten",!0)};h.exportSymbol("templateEngine",h.templateEngine);h.templateRewriting=function(){function r(n){for(var i,r,u,f=h.expressionRewriting.bindingRewriteValidators,t=0;t<n.length;t++)if(i=n[t].key,f.hasOwnProperty(i))if(r=f[i],typeof r=="function"){if(u=r(n[t].value),u)throw new Error(u);}else if(!r)throw new Error("This template engine does not support the '"+i+"' binding within its templates");}function n(n,t,i,u){var f=h.expressionRewriting.parseObjectLiteral(n),e,o;return r(f),e=h.expressionRewriting.preProcessBindings(f,{valueAccessors:!0}),o="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+e+" } })()},'"+i.toLowerCase()+"')",u.createJavaScriptEvaluatorBlock(o)+t}var t=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,i=/<!--\s*ko\b\s*([\s\S]*?)\s*-->/g;return{ensureTemplateIsRewritten:function(n,t,i){t.isTemplateRewritten(n,i)||t.rewriteTemplate(n,function(n){return h.templateRewriting.memoizeBindingAttributeSyntax(n,t)},i)},memoizeBindingAttributeSyntax:function(r,u){return r.replace(t,function(){return n(arguments[4],arguments[1],arguments[2],u)}).replace(i,function(){return n(arguments[1],"<!-- ko -->","#comment",u)})},applyMemoizedBindingsToNextSibling:function(n,t){return h.memoization.memoize(function(i,r){var u=i.nextSibling;u&&u.nodeName.toLowerCase()===t&&h.applyBindingAccessorsToNode(u,n,r)})}}}();h.exportSymbol("__tr_ambtns",h.templateRewriting.applyMemoizedBindingsToNextSibling),function(){function o(n){return h.utils.domData.get(n,i)||{}}function s(n,t){h.utils.domData.set(n,i,t)}var n,i;h.templateSources={};var r=1,u=2,f=3,e=4;h.templateSources.domElement=function(n){if(this.domElement=n,n){var t=h.utils.tagNameLower(n);this.templateType=t==="script"?r:t==="textarea"?u:t=="template"&&n.content&&n.content.nodeType===11?f:e}};h.templateSources.domElement.prototype.text=function(){var n=this.templateType===r?"text":this.templateType===u?"value":"innerHTML",t;if(arguments.length==0)return this.domElement[n];t=arguments[0];n==="innerHTML"?h.utils.setHtml(this.domElement,t):this.domElement[n]=t};n=h.utils.domData.nextKey()+"_";h.templateSources.domElement.prototype.data=function(t){if(arguments.length===1)return h.utils.domData.get(this.domElement,n+t);h.utils.domData.set(this.domElement,n+t,arguments[1])};i=h.utils.domData.nextKey();h.templateSources.domElement.prototype.nodes=function(){var n=this.domElement,i,r,u;if(arguments.length==0)return i=o(n),r=i.containerData,r||(this.templateType===f?n.content:this.templateType===e?n:t);u=arguments[0];s(n,{containerData:u})};h.templateSources.anonymousTemplate=function(n){this.domElement=n};h.templateSources.anonymousTemplate.prototype=new h.templateSources.domElement;h.templateSources.anonymousTemplate.prototype.constructor=h.templateSources.anonymousTemplate;h.templateSources.anonymousTemplate.prototype.text=function(){var n,i;if(arguments.length==0)return n=o(this.domElement),n.textData===t&&n.containerData&&(n.textData=n.containerData.innerHTML),n.textData;i=arguments[0];s(this.domElement,{textData:i})};h.exportSymbol("templateSources",h.templateSources);h.exportSymbol("templateSources.domElement",h.templateSources.domElement);h.exportSymbol("templateSources.anonymousTemplate",h.templateSources.anonymousTemplate)}(),function(){function i(n,t,i){for(var u,r=n,f=h.virtualElements.nextSibling(t);r&&(u=r)!==f;)r=h.virtualElements.nextSibling(u),i(u,r)}function f(n,t){if(n.length){var r=n[0],u=n[n.length-1],f=r.parentNode,e=h.bindingProvider.instance,o=e.preprocessNode;if(o){if(i(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),h.utils.fixUpContinuousNodeArray(n,f))}i(r,u,function(n){(n.nodeType===1||n.nodeType===8)&&h.applyBindings(t,n)});i(r,u,function(n){(n.nodeType===1||n.nodeType===8)&&h.memoization.unmemoizeDomNodeAndDescendants(n,[t])});h.utils.fixUpContinuousNodeArray(n,f)}}function r(n){return n.nodeType?n:n.length>0?n[0]:null}function e(t,i,u,e,o){var s,c;o=o||{};var v=t&&r(t),l=(v||u||{}).ownerDocument,a=o.templateEngine||n;if(h.templateRewriting.ensureTemplateIsRewritten(u,a,l),s=a.renderTemplate(u,e,o,l),typeof s.length!="number"||s.length>0&&typeof s[0].nodeType!="number")throw new Error("Template engine must return an array of DOM nodes");c=!1;switch(i){case"replaceChildren":h.virtualElements.setDomNodeChildren(t,s);c=!0;break;case"replaceNode":h.utils.replaceDomNodes(t,s);c=!0;break;case"ignoreTargetNode":break;default:throw new Error("Unknown renderMode: "+i);}return c&&(f(s,e),o.afterRender&&h.dependencyDetection.ignore(o.afterRender,null,[s,e.$data])),s}function o(n,t,i){return h.isObservable(n)?n():typeof n=="function"?n(t,i):n}function s(n,i){var r=h.utils.domData.get(n,u);r&&typeof r.dispose=="function"&&r.dispose();h.utils.domData.set(n,u,i&&i.isActive()?i:t)}var n,u;h.setTemplateEngine=function(i){if(i!=t&&!(i instanceof h.templateEngine))throw new Error("templateEngine must inherit from ko.templateEngine");n=i};h.renderTemplate=function(i,u,f,s,c){if(f=f||{},(f.templateEngine||n)==t)throw new Error("Set a template engine before calling renderTemplate");if(c=c||"replaceChildren",s){var l=r(s),a=function(){return!l||!h.utils.domNodeIsAttachedToDocument(l)},v=l&&c=="replaceNode"?l.parentNode:l;return h.dependentObservable(function(){var n=u&&u instanceof h.bindingContext?u:new h.bindingContext(u,null,null,null,{exportDependencies:!0}),t=o(i,n.$data,n),a=e(s,c,t,n,f);c=="replaceNode"&&(s=a,l=r(s))},null,{disposeWhen:a,disposeWhenNodeIsRemoved:v})}return h.memoization.memoize(function(n){h.renderTemplate(i,u,f,n,"replaceNode")})};h.renderTemplateForEach=function(n,i,r,u,s){var c,l=function(t,i){c=s.createChildContext(t,r.as,function(n){n.$index=i});var u=o(n,t,c);return e(null,"ignoreTargetNode",u,c,r)},a=function(n,t){f(t,c);r.afterRender&&r.afterRender(t,n);c=null};return h.dependentObservable(function(){var n=h.utils.unwrapObservable(i)||[],f;typeof n.length=="undefined"&&(n=[n]);f=h.utils.arrayFilter(n,function(n){return r.includeDestroyed||n===t||n===null||!h.utils.unwrapObservable(n._destroy)});h.dependencyDetection.ignore(h.utils.setDomNodeChildrenFromArrayMapping,null,[u,f,l,r,a])},null,{disposeWhenNodeIsRemoved:u})};u=h.utils.domData.nextKey();h.bindingHandlers.template={init:function(n,t){var i=h.utils.unwrapObservable(t()),u,f,r;if(typeof i=="string"||i.name)h.virtualElements.emptyNode(n);else if("nodes"in i){if(u=i.nodes||[],h.isObservable(u))throw new Error('The "nodes" option must be a plain, non-observable array.');r=h.utils.moveCleanedNodesToContainerElement(u);new h.templateSources.anonymousTemplate(n).nodes(r)}else f=h.virtualElements.childNodes(n),r=h.utils.moveCleanedNodesToContainerElement(f),new h.templateSources.anonymousTemplate(n).nodes(r);return{controlsDescendantBindings:!0}},update:function(n,t,i,r,u){var l=t(),f=h.utils.unwrapObservable(l),e=!0,c=null,o,a,v;typeof f=="string"?(o=l,f={}):(o=f.name,"if"in f&&(e=h.utils.unwrapObservable(f["if"])),e&&"ifnot"in f&&(e=!h.utils.unwrapObservable(f.ifnot)));"foreach"in f?(a=e&&f.foreach||[],c=h.renderTemplateForEach(o||n,a,f,n,u)):e?(v="data"in f?u.createStaticChildContext(f.data,f.as):u,c=h.renderTemplate(o||n,v,f,n)):h.virtualElements.emptyNode(n);s(n,c)}};h.expressionRewriting.bindingRewriteValidators.template=function(n){var t=h.expressionRewriting.parseObjectLiteral(n);return t.length==1&&t[0].unknown?null:h.expressionRewriting.keyValueArrayContainsKey(t,"name")?null:"This template engine does not support anonymous templates nested within its templates"};h.virtualElements.allowedBindings.template=!0}();h.exportSymbol("setTemplateEngine",h.setTemplateEngine);h.exportSymbol("renderTemplate",h.renderTemplate);h.utils.findMovesInArrayComparison=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}};h.utils.compareArrays=function(){function r(r,u,f){return f=typeof f=="boolean"?{dontLimitMoves:f}:f||{},r=r||[],u=u||[],r.length<u.length?i(r,u,n,t,f):i(u,r,t,n,f)}function i(n,t,i,r,u){for(var p=Math.min,it=Math.max,l=[],c=n.length,f,a=t.length,rt=a-c||1,w=c+a+1,o,v,b,k,d,g,e=0;e<=c;e++)for(v=o,l.push(o=[]),b=p(a,e+rt),k=it(0,e-1),f=k;f<=b;f++)f?e?n[e-1]===t[f-1]?o[f]=v[f-1]:(d=v[f]||w,g=o[f-1]||w,o[f]=p(d,g)+1):o[f]=f+1:o[f]=e+1;var s=[],y,nt=[],tt=[];for(e=c,f=a;e||f;)y=l[e][f]-1,f&&y===l[e][f-1]?nt.push(s[s.length]={status:i,value:t[--f],index:f}):e&&y===l[e-1][f]?tt.push(s[s.length]={status:r,value:n[--e],index:e}):(--f,--e,u.sparse||s.push({status:"retained",value:t[f]}));return h.utils.findMovesInArrayComparison(tt,nt,!u.dontLimitMoves&&c*10),s.reverse()}var n="added",t="deleted";return r}();h.exportSymbol("utils.compareArrays",h.utils.compareArrays),function(){function r(n,i,r,u,f){var e=[],o=h.dependentObservable(function(){var t=i(r,f,h.utils.fixUpContinuousNodeArray(e,n))||[];e.length>0&&(h.utils.replaceDomNodes(e,t),u&&h.dependencyDetection.ignore(u,null,[r,t,f]));e.length=0;h.utils.arrayPushAll(e,t)},null,{disposeWhenNodeIsRemoved:n,disposeWhen:function(){return!h.utils.anyDomNodeIsAttachedToDocument(e)}});return{mappedNodes:e,dependentObservable:o.isActive()?o:t}}var n=h.utils.domData.nextKey(),i=h.utils.domData.nextKey();h.utils.setDomNodeChildrenFromArrayMapping=function(u,f,e,o,s){function et(n,t){c=d[t];nt!==t&&(it[n]=c);c.indexObservable(nt++);h.utils.fixUpContinuousNodeArray(c.mappedNodes,u);y.push(c);p.push(c)}function w(n,t){if(n)for(var i=0,r=t.length;i<r;i++)t[i]&&h.utils.arrayForEach(t[i].mappedNodes,function(r){n(r,i,t[i].arrayEntry)})}var b,k,l,rt,ot,v,ut;f=f||[];o=o||{};var st=h.utils.domData.get(u,n)===t,d=h.utils.domData.get(u,n)||[],ht=h.utils.arrayMap(d,function(n){return n.arrayEntry}),ct=h.utils.compareArrays(ht,f,o.dontLimitMoves),y=[],g=0,nt=0,tt=[],p=[],a=[],it=[],ft=[],c;for(l=0;b=ct[l];l++){k=b.moved;switch(b.status){case"deleted":k===t&&(c=d[g],c.dependentObservable&&(c.dependentObservable.dispose(),c.dependentObservable=t),h.utils.fixUpContinuousNodeArray(c.mappedNodes,u).length&&(o.beforeRemove&&(y.push(c),p.push(c),c.arrayEntry===i?c=null:a[l]=c),c&&tt.push.apply(tt,c.mappedNodes)));g++;break;case"retained":et(l,g++);break;case"added":k!==t?et(l,k):(c={arrayEntry:b.value,indexObservable:h.observable(nt++)},y.push(c),p.push(c),st||(ft[l]=c))}}for(h.utils.domData.set(u,n,y),w(o.beforeMove,it),h.utils.arrayForEach(tt,o.beforeRemove?h.cleanNode:h.removeNode),l=0,rt=h.virtualElements.firstChild(u);c=p[l];l++){for(c.mappedNodes||h.utils.extend(c,r(u,e,c.arrayEntry,s,c.indexObservable)),ut=0;v=c.mappedNodes[ut];rt=v.nextSibling,ot=v,ut++)v!==rt&&h.virtualElements.insertAfter(u,v,ot);!c.initialized&&s&&(s(c.arrayEntry,c.mappedNodes,c.indexObservable),c.initialized=!0)}for(w(o.beforeRemove,a),l=0;l<a.length;++l)a[l]&&(a[l].arrayEntry=i);w(o.afterMove,it);w(o.afterAdd,ft)}}();h.exportSymbol("utils.setDomNodeChildrenFromArrayMapping",h.utils.setDomNodeChildrenFromArrayMapping);h.nativeTemplateEngine=function(){this.allowTemplateRewriting=!1};h.nativeTemplateEngine.prototype=new h.templateEngine;h.nativeTemplateEngine.prototype.constructor=h.nativeTemplateEngine;h.nativeTemplateEngine.prototype.renderTemplateSource=function(n,t,i,r){var e=!(h.utils.ieVersion<9),o=e?n.nodes:null,u=o?n.nodes():null,f;return u?h.utils.makeArray(u.cloneNode(!0).childNodes):(f=n.text(),h.utils.parseHtmlFragment(f,r))};h.nativeTemplateEngine.instance=new h.nativeTemplateEngine;h.setTemplateEngine(h.nativeTemplateEngine.instance);h.exportSymbol("nativeTemplateEngine",h.nativeTemplateEngine),function(){h.jqueryTmplTemplateEngine=function(){function t(){if(n<2)throw new Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");}function u(n,t,i){return r.tmpl(n,t,i)}var n=this.jQueryTmplVersion=function(){if(!r||!r.tmpl)return 0;try{if(r.tmpl.tag.tmpl.open.toString().indexOf("__")>=0)return 2}catch(n){}return 1}();this.renderTemplateSource=function(n,f,e,o){var s,h;o=o||i;e=e||{};t();s=n.data("precompiled");s||(h=n.text()||"",h="{{ko_with $item.koBindingContext}}"+h+"{{/ko_with}}",s=r.template(null,h),n.data("precompiled",s));var l=[f.$data],a=r.extend({koBindingContext:f},e.templateOptions),c=u(s,l,a);return c.appendTo(o.createElement("div")),r.fragments={},c};this.createJavaScriptEvaluatorBlock=function(n){return"{{ko_code ((function() { return "+n+" })()) }}"};this.addTemplate=function(n,t){i.write("<script type='text/html' id='"+n+"'>"+t+"<\/script>")};n>0&&(r.tmpl.tag.ko_code={open:"__.push($1 || '');"},r.tmpl.tag.ko_with={open:"with($1) {",close:"} "})};h.jqueryTmplTemplateEngine.prototype=new h.templateEngine;h.jqueryTmplTemplateEngine.prototype.constructor=h.jqueryTmplTemplateEngine;var n=new h.jqueryTmplTemplateEngine;n.jQueryTmplVersion>0&&h.setTemplateEngine(n);h.exportSymbol("jqueryTmplTemplateEngine",h.jqueryTmplTemplateEngine)}()})})()})();!function(n){"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?n(require("knockout"),exports):"function"==typeof define&&define.amd?define(["knockout","exports"],n):n(ko,ko.validation={})}(function(n,t){function c(n){var t="max"===n;return function(r,u){var o,h,s,f,e;if(i.utils.isEmptyVal(r))return!0;void 0===u.typeAttr?(h="text",o=u):(h=u.typeAttr,o=u.value);isNaN(o)||o instanceof Date||(h="number");switch(h.toLowerCase()){case"week":if(s=/^(\d{4})-W(\d{2})$/,f=r.match(s),null===f)throw new Error("Invalid value for "+n+" attribute for week input.  Should look like '2000-W33' http://www.w3.org/TR/html-markup/input.week.html#input.week.attrs.min");return e=o.match(s),e?t?f[1]<e[1]||f[1]===e[1]&&f[2]<=e[2]:f[1]>e[1]||f[1]===e[1]&&f[2]>=e[2]:!1;case"month":if(s=/^(\d{4})-(\d{2})$/,f=r.match(s),null===f)throw new Error("Invalid value for "+n+" attribute for month input.  Should look like '2000-03' http://www.w3.org/TR/html-markup/input.month.html#input.month.attrs.min");return e=o.match(s),e?t?f[1]<e[1]||f[1]===e[1]&&f[2]<=e[2]:f[1]>e[1]||f[1]===e[1]&&f[2]>=e[2]:!1;case"number":case"range":return t?!isNaN(r)&&parseFloat(r)<=parseFloat(o):!isNaN(r)&&parseFloat(r)>=parseFloat(o);default:return t?o>=r:r>=o}}}function y(n,t,r){return t.validator(n(),void 0===r.params?!0:f(r.params))?!0:(n.setError(i.formatMessage(r.message||t.message,f(r.params),n)),!1)}function p(n,t,r){n.isValidating(!0);var u=function(u){var e=!1,o="";return n.__valid__()?(u.message?(e=u.isValid,o=u.message):e=u,e||(n.error(i.formatMessage(o||r.message||t.message,f(r.params),n)),n.__valid__(e)),void n.isValidating(!1)):void n.isValidating(!1)};i.utils.async(function(){t.validator(n(),void 0===r.params?!0:f(r.params),u)})}var a,h,s,v;if("undefined"==typeof n)throw new Error("Knockout is required, please ensure it is loaded before loading this validation plug-in");n.validation=t;var i=n.validation,u=n.utils,f=u.unwrapObservable,e=u.arrayForEach,r=u.extend,l={registerExtenders:!0,messagesOnModified:!0,errorsAsTitle:!0,errorsAsTitleOnModified:!1,messageTemplate:null,insertMessages:!0,parseInputAttributes:!1,writeInputAttributes:!1,decorateInputElement:!1,decorateElementOnModified:!0,errorClass:null,errorElementClass:"validationElement",errorMessageClass:"validationMessage",allowHtmlMessages:!1,grouping:{deep:!1,observable:!0,live:!1},validate:{}},o=r({},l);o.html5Attributes=["required","pattern","min","max","step"];o.html5InputTypes=["email","number","date"];o.reset=function(){r(o,l)};i.configuration=o;i.utils=function(){var r=(new Date).getTime(),t={},n="__ko_validation__";return{isArray:function(n){return n.isArray||"[object Array]"===Object.prototype.toString.call(n)},isObject:function(n){return null!==n&&"object"==typeof n},isNumber:function(n){return!isNaN(n)},isObservableArray:function(n){return!!n&&"function"==typeof n.remove&&"function"==typeof n.removeAll&&"function"==typeof n.destroy&&"function"==typeof n.destroyAll&&"function"==typeof n.indexOf&&"function"==typeof n.replace},values:function(n){var t=[];for(var i in n)n.hasOwnProperty(i)&&t.push(n[i]);return t},getValue:function(n){return"function"==typeof n?n():n},hasAttribute:function(n,t){return null!==n.getAttribute(t)},getAttribute:function(n,t){return n.getAttribute(t)},setAttribute:function(n,t,i){return n.setAttribute(t,i)},isValidatable:function(n){return!!(n&&n.rules&&n.isValid&&n.isModified)},insertAfter:function(n,t){n.parentNode.insertBefore(t,n.nextSibling)},newId:function(){return r+=1},getConfigOptions:function(n){var t=i.utils.contextFor(n);return t||i.configuration},setDomData:function(r,u){var f=r[n];f||(r[n]=f=i.utils.newId());t[f]=u},getDomData:function(i){var r=i[n];if(r)return t[r]},contextFor:function(n){switch(n.nodeType){case 1:case 8:var t=i.utils.getDomData(n);if(t)return t;if(n.parentNode)return i.utils.contextFor(n.parentNode)}return void 0},isEmptyVal:function(n){return void 0===n?!0:null===n?!0:""===n?!0:void 0},getOriginalElementTitle:function(n){var t=i.utils.getAttribute(n,"data-orig-title"),r=n.title,u=i.utils.hasAttribute(n,"data-orig-title");return u?t:r},async:function(n){window.setImmediate?window.setImmediate(n):window.setTimeout(n,0)},forEach:function(n,t){if(i.utils.isArray(n))return e(n,t);for(var r in n)n.hasOwnProperty(r)&&t(n[r],r)}}}();a=function(){function c(n){e(n.subscriptions,function(n){n.dispose()});n.subscriptions=[]}function v(n){n.options.deep&&(e(n.flagged,function(n){delete n.__kv_traversed}),n.flagged.length=0);n.options.live||c(n)}function s(n,t){t.validatables=[];c(t);l(n,t);v(t)}function l(i,r,u){var e=[],f=i.peek?i.peek():i;i.__kv_traversed!==!0&&(r.options.deep&&(i.__kv_traversed=!0,r.flagged.push(i)),u=void 0!==u?u:r.options.deep?1:-1,n.isObservable(i)&&(i.errors||t.isValidatable(i)||i.extend({validatable:!0}),r.validatables.push(i),r.options.live&&t.isObservableArray(i)&&r.subscriptions.push(i.subscribe(function(){r.graphMonitor.valueHasMutated()}))),f&&!f._destroy&&(t.isArray(f)?e=f:t.isObject(f)&&(e=t.values(f))),0!==u&&t.forEach(e,function(t){!t||t.nodeType||n.isComputed(t)&&!t.rules||l(t,r,u+1)}))}function h(n){var i=[];return e(n,function(n){t.isValidatable(n)&&!n.isValid()&&i.push(n.error.peek())}),i}var a=0,o=i.configuration,t=i.utils;return{init:function(n,t){a>0&&!t||(n=n||{},n.errorElementClass=n.errorElementClass||n.errorClass||o.errorElementClass,n.errorMessageClass=n.errorMessageClass||n.errorClass||o.errorMessageClass,r(o,n),o.registerExtenders&&i.registerExtenders(),a=1)},reset:i.configuration.reset,group:function(i,f){f=r(r({},o.grouping),f);var l={options:f,graphMonitor:n.observable(),flagged:[],subscriptions:[],validatables:[]},c=null;return c=f.observable?n.computed(function(){return l.graphMonitor(),s(i,l),h(l.validatables)}):function(){return s(i,l),h(l.validatables)},c.showAllMessages=function(n){void 0===n&&(n=!0);c.forEach(function(i){t.isValidatable(i)&&i.isModified(n)})},c.isAnyMessageShown=function(){return!!c.find(function(n){return t.isValidatable(n)&&!n.isValid()&&n.isModified()})},c.filter=function(n){return n=n||function(){return!0},c(),u.arrayFilter(l.validatables,n)},c.find=function(n){return n=n||function(){return!0},c(),u.arrayFirst(l.validatables,n)},c.forEach=function(n){n=n||function(){};c();e(l.validatables,n)},c.map=function(n){return n=n||function(n){return n},c(),u.arrayMap(l.validatables,n)},c._updateState=function(n){if(!t.isObject(n))throw new Error("An object is required.");return i=n,f.observable?void l.graphMonitor.valueHasMutated():(s(n,l),h(l.validatables))},c},formatMessage:function(n,i,r){if(t.isObject(i)&&i.typeAttr&&(i=i.value),"function"==typeof n)return n(i,r);var u=f(i);return null==u&&(u=[]),t.isArray(u)||(u=[u]),n.replace(/{(\d+)}/gi,function(n,t){return"undefined"!=typeof u[t]?u[t]:n})},addRule:function(n,t){n.extend({validatable:!0});var i=!!u.arrayFirst(n.rules(),function(n){return n.rule&&n.rule===t.rule});return i||n.rules.push(t),n},addAnonymousRule:function(n,t){void 0===t.message&&(t.message="Error");t.onlyIf&&(t.condition=t.onlyIf);i.addRule(n,t)},addExtender:function(r){n.extenders[r]=function(n,u){return u&&(u.message||u.onlyIf)?i.addRule(n,{rule:r,message:u.message,params:t.isEmptyVal(u.params)?!0:u.params,condition:u.onlyIf}):i.addRule(n,{rule:r,params:u})}},registerExtenders:function(){if(o.registerExtenders)for(var t in i.rules)i.rules.hasOwnProperty(t)&&(n.extenders[t]||i.addExtender(t))},insertValidationMessage:function(n){var i=document.createElement("SPAN");return i.className=t.getConfigOptions(n).errorMessageClass,t.insertAfter(n,i),i},parseInputValidationAttributes:function(n,r){e(i.configuration.html5Attributes,function(u){var e,f;t.hasAttribute(n,u)&&(e=n.getAttribute(u)||!0,("min"===u||"max"===u)&&(f=n.getAttribute("type"),"undefined"!=typeof f&&f||(f="text"),e={typeAttr:f,value:e}),i.addRule(r(),{rule:u,params:e}))});var u=n.getAttribute("type");e(i.configuration.html5InputTypes,function(n){n===u&&i.addRule(r(),{rule:"date"===n?"dateISO":n,params:!0})})},writeInputValidationAttributes:function(t,r){var f=r(),o;f&&f.rules&&(o=f.rules(),e(i.configuration.html5Attributes,function(i){var r=u.arrayFirst(o,function(n){return n.rule&&n.rule.toLowerCase()===i.toLowerCase()});r&&n.computed({read:function(){var u=n.unwrap(r.params);"pattern"===r.rule&&u instanceof RegExp&&(u=u.source);t.setAttribute(i,u)},disposeWhenNodeIsRemoved:t})}),o=null)},makeBindingHandlerValidatable:function(t){var i=n.bindingHandlers[t].init;n.bindingHandlers[t].init=function(t,r,u,f,e){return i(t,r,u,f,e),n.bindingHandlers.validationCore.init(t,r,u,f,e)}},setRules:function(r,u){var e=function(r,u){var s,h,o,l;if(r&&u)for(s in u)if(u.hasOwnProperty(s)&&(h=u[s],r[s])){var a=r[s],c=f(a),y={},v={};for(o in h)h.hasOwnProperty(o)&&(i.rules[o]?y[o]=h[o]:v[o]=h[o]);if(n.isObservable(a)&&a.extend(y),c&&t.isArray(c))for(l=0;l<c.length;l++)e(c[l],v);else e(c,v)}};e(r,u)}}}();r(n.validation,a);i.rules={};i.rules.required={validator:function(n,t){var i;return void 0===n||null===n?!t:(i=n,"string"==typeof n&&(i=String.prototype.trim?n.trim():n.replace(/^\s+|\s+$/g,"")),t?(i+"").length>0:!0)},message:"This field is required."};i.rules.min={validator:c("min"),message:"Please enter a value greater than or equal to {0}."};i.rules.max={validator:c("max"),message:"Please enter a value less than or equal to {0}."};i.rules.minLength={validator:function(n,t){if(i.utils.isEmptyVal(n))return!0;var r=i.utils.isNumber(n)?""+n:n;return r.length>=t},message:"Please enter at least {0} characters."};i.rules.maxLength={validator:function(n,t){if(i.utils.isEmptyVal(n))return!0;var r=i.utils.isNumber(n)?""+n:n;return r.length<=t},message:"Please enter no more than {0} characters."};i.rules.pattern={validator:function(n,t){return i.utils.isEmptyVal(n)||null!==n.toString().match(t)},message:"Please check this value."};i.rules.step={validator:function(n,t){if(i.utils.isEmptyVal(n)||"any"===t)return!0;var r=100*n%(100*t);return Math.abs(r)<1e-5||Math.abs(1-r)<1e-5},message:"The value must increment by {0}."};i.rules.email={validator:function(n,t){return t?i.utils.isEmptyVal(n)||t&&/^((([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.test(n):!0},message:"Please enter a proper email address."};i.rules.date={validator:function(n,t){return t?i.utils.isEmptyVal(n)||t&&!/Invalid|NaN/.test(new Date(n)):!0},message:"Please enter a proper date."};i.rules.dateISO={validator:function(n,t){return t?i.utils.isEmptyVal(n)||t&&/^\d{4}[-/](?:0?[1-9]|1[012])[-/](?:0?[1-9]|[12][0-9]|3[01])$/.test(n):!0},message:"Please enter a proper date."};i.rules.number={validator:function(n,t){return t?i.utils.isEmptyVal(n)||t&&/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(n):!0},message:"Please enter a number."};i.rules.digit={validator:function(n,t){return t?i.utils.isEmptyVal(n)||t&&/^\d+$/.test(n):!0},message:"Please enter a digit."};i.rules.phoneUS={validator:function(n,t){return t?i.utils.isEmptyVal(n)?!0:"string"!=typeof n?!1:(n=n.replace(/\s+/g,""),t&&n.length>9&&n.match(/^(1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/)):!0},message:"Please specify a valid phone number."};i.rules.equal={validator:function(n,t){var r=t;return n===i.utils.getValue(r)},message:"Values must equal."};i.rules.notEqual={validator:function(n,t){var r=t;return n!==i.utils.getValue(r)},message:"Please choose another value."};i.rules.unique={validator:function(n,t){var r=i.utils.getValue(t.collection),e=i.utils.getValue(t.externalValue),f=0;return n&&r?(u.arrayFilter(r,function(i){n===(t.valueAccessor?t.valueAccessor(i):i)&&f++}),(e?1:2)>f):!0},message:"Please make sure the value is unique."},function(){i.registerExtenders()}();n.bindingHandlers.validationCore=function(){return{init:function(t,r){var u=i.utils.getConfigOptions(t),f=r(),e;(u.parseInputAttributes&&i.utils.async(function(){i.parseInputValidationAttributes(t,r)}),u.insertMessages&&i.utils.isValidatable(f))&&(e=i.insertValidationMessage(t),u.messageTemplate?n.renderTemplate(u.messageTemplate,{field:f},null,e,"replaceNode"):n.applyBindingsToNode(e,{validationMessage:f}));u.writeInputAttributes&&i.utils.isValidatable(f)&&i.writeInputValidationAttributes(t,r);u.decorateInputElement&&i.utils.isValidatable(f)&&n.applyBindingsToNode(t,{validationElement:f})}}}();i.makeBindingHandlerValidatable("value");i.makeBindingHandlerValidatable("checked");n.bindingHandlers.textInput&&i.makeBindingHandlerValidatable("textInput");i.makeBindingHandlerValidatable("selectedOptions");n.bindingHandlers.validationMessage={update:function(t,r){var e=r(),s=i.utils.getConfigOptions(t),h=(f(e),!1),c=!1,o,l,a;if(null===e||"undefined"==typeof e)throw new Error("Cannot bind validationMessage to undefined value. data-bind expression: "+t.getAttribute("data-bind"));h=e.isModified&&e.isModified();c=e.isValid&&e.isValid();o=null;(!s.messagesOnModified||h)&&(o=c?null:e.error);l=!s.messagesOnModified||h?!c:!1;a="none"!==t.style.display;s.allowHtmlMessages?u.setHtml(t,o):n.bindingHandlers.text.update(t,function(){return o});a&&!l?t.style.display="none":!a&&l&&(t.style.display="")}};n.bindingHandlers.validationElement={update:function(t,r,u){var e=r(),o=i.utils.getConfigOptions(t),h=(f(e),!1),s=!1,c;if(null===e||"undefined"==typeof e)throw new Error("Cannot bind validationElement to undefined value. data-bind expression: "+t.getAttribute("data-bind"));h=e.isModified&&e.isModified();s=e.isValid&&e.isValid();c=function(){var n={},t=!o.decorateElementOnModified||h?!s:!1;return n[o.errorElementClass]=t,n};n.bindingHandlers.css.update(t,c,u);o.errorsAsTitle&&n.bindingHandlers.attr.update(t,function(){var n=!o.errorsAsTitleOnModified||h,r=i.utils.getOriginalElementTitle(t);return n&&!s?{title:e.error,"data-orig-title":r}:!n||s?{title:r,"data-orig-title":null}:void 0})}};n.bindingHandlers.validationOptions=function(){return{init:function(n,t){var e=f(t()),u;e&&(u=r({},i.configuration),r(u,e),i.utils.setDomData(n,u))}}}();n.extenders.validation=function(n,t){return e(i.utils.isArray(t)?t:[t],function(t){i.addAnonymousRule(n,t)}),n};n.extenders.validatable=function(t,u){var o,f,s,e;return(i.utils.isObject(u)||(u={enable:u}),"enable"in u||(u.enable=!0),u.enable&&!i.utils.isValidatable(t))?(o=i.configuration.validate||{},f={throttleEvaluation:u.throttle||o.throttle},t.error=n.observable(null),t.rules=n.observableArray(),t.isValidating=n.observable(!1),t.__valid__=n.observable(!0),t.isModified=n.observable(!1),t.isValid=n.computed(t.__valid__),t.setError=function(n){var i=t.error.peek(),r=t.__valid__.peek();t.error(n);t.__valid__(!1);i===n||r||t.isValid.notifySubscribers()},t.clearError=function(){return t.error(null),t.__valid__(!0),t},s=t.subscribe(function(){t.isModified(!0)}),e=n.computed(r({read:function(){return t(),t.rules(),i.validateObservable(t),!0}},f)),r(e,f),t._disposeValidation=function(){t.isValid.dispose();t.rules.removeAll();s.dispose();e.dispose();delete t.rules;delete t.error;delete t.isValid;delete t.isValidating;delete t.__valid__;delete t.isModified;delete t.setError;delete t.clearError;delete t._disposeValidation}):u.enable===!1&&t._disposeValidation&&t._disposeValidation(),t};i.validateObservable=function(n){for(var r,t,u=0,f=n.rules(),e=f.length;e>u;u++)if(t=f[u],!t.condition||t.condition())if(r=t.rule?i.rules[t.rule]:t,r.async||t.async)p(n,r,t);else if(!y(n,r,t))return!1;return n.clearError(),!0};s={};i.defineLocale=function(n,t){return n&&t?(s[n.toLowerCase()]=t,t):null};i.locale=function(n){if(n){if(n=n.toLowerCase(),!s.hasOwnProperty(n))throw new Error("Localization "+n+" has not been loaded.");i.localize(s[n]);h=n}return h};i.localize=function(n){var r=i.rules;for(var t in n)r.hasOwnProperty(t)&&(r[t].message=n[t])},function(){var r={},n=i.rules;for(var t in n)n.hasOwnProperty(t)&&(r[t]=n[t].message);i.defineLocale("en-us",r)}();h="en-us";n.applyBindingsWithValidation=function(t,u,f){var e,o=document.body;u&&u.nodeType?(o=u,e=f):e=u;i.init();e&&(e=r(r({},i.configuration),e),i.utils.setDomData(o,e));n.applyBindings(t,o)};v=n.applyBindings;n.applyBindings=function(n,t){i.init();v(n,t)};n.validatedObservable=function(t,r){if(!r&&!i.utils.isObject(t))return n.observable(t).extend({validatable:!0});var u=n.observable(t);return u.errors=i.group(i.utils.isObject(t)?t:{},r),u.isValid=n.observable(0===u.errors().length),n.isObservable(u.errors)?u.errors.subscribe(function(n){u.isValid(0===n.length)}):n.computed(u.errors).subscribe(function(n){u.isValid(0===n.length)}),u.subscribe(function(n){i.utils.isObject(n)||(n={});u.errors._updateState(n);u.isValid(0===u.errors().length)}),u}}),function(n){"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?n(require("knockout"),exports):"function"==typeof define&&define.amd?define(["knockout","exports"],n):n(ko,ko.mapping={})}(function(n,t){function v(n,i){var o;for(var r in i)if(i.hasOwnProperty(r)&&i[r])if(o=t.getType(n[r]),r&&n[r]&&"array"!==o&&"string"!==o)v(n[r],i[r]);else if("array"===t.getType(n[r])&&"array"===t.getType(i[r])){o=n;for(var h=r,f=n[r],e=i[r],s={},u=f.length-1;0<=u;--u)s[f[u]]=f[u];for(u=e.length-1;0<=u;--u)s[e[u]]=e[u];f=[];e=void 0;for(e in s)f.push(s[e]);o[h]=f}else n[r]=i[r]}function e(n,t){var i={};return v(i,n),v(i,t),i}function y(n,t){for(var f,i=e({},n),o=nt.length-1;0<=o;o--)f=nt[o],i[f]&&(i[""]instanceof Object||(i[""]={}),i[""][f]=i[f],delete i[f]);return t&&(i.ignore=u(t.ignore,i.ignore),i.include=u(t.include,i.include),i.copy=u(t.copy,i.copy),i.observe=u(t.observe,i.observe)),i.ignore=u(i.ignore,r.ignore),i.include=u(i.include,r.include),i.copy=u(i.copy,r.copy),i.observe=u(i.observe,r.observe),i.mappedProperties=i.mappedProperties||{},i.copiedProperties=i.copiedProperties||{},i}function u(i,r){return"array"!==t.getType(i)&&(i="undefined"===t.getType(i)?[]:[i]),"array"!==t.getType(r)&&(r="undefined"===t.getType(r)?[]:[r]),n.utils.arrayGetDistinctValues(i.concat(r))}function o(r,u,a,v,y,p,b){var at="array"===t.getType(n.utils.unwrapObservable(u)),nt,it,rt,et,ht;p=p||"";t.isMapped(r)&&(nt=n.utils.unwrapObservable(r)[i],a=e(nt,a));var vt=b||y,ct=function(){return a[v]&&a[v].create instanceof Function},yt=function(t){var i=c,r=n.dependentObservable;return n.dependentObservable=function(t,r,u){var o,f,e;return u=u||{},t&&"object"==typeof t&&(u=t),e=u.deferEvaluation,o=!1,u.deferEvaluation=!0,t=new h(t,r,u),e||(f=t,e=n.dependentObservable,n.dependentObservable=h,t=n.isWriteableObservable(f),n.dependentObservable=e,t=h({read:function(){return o||(n.utils.arrayRemoveItem(i,f),o=!0),f.apply(f,arguments)},write:t&&function(n){return f(n)},deferEvaluation:!0}),i.push(t)),t},n.dependentObservable.fn=h.fn,n.computed=n.dependentObservable,t=n.utils.unwrapObservable(y)instanceof Array?a[v].create({data:t||u,parent:vt,skip:tt}):a[v].create({data:t||u,parent:vt}),n.dependentObservable=r,n.computed=n.dependentObservable,t},ft=function(){return a[v]&&a[v].update instanceof Function},ot=function(t,i){var r={data:i||u,parent:vt,target:n.utils.unwrapObservable(t)};return n.isWriteableObservable(t)&&(r.observable=t),a[v].update(r)};if(b=l.get(u))return b;if(v=v||"",at){var at=[],ut=!1,g=function(n){return n};a[v]&&a[v].key&&(g=a[v].key,ut=!0);n.isObservable(r)||(r=n.observableArray([]),r.mappedRemove=function(n){var t="function"==typeof n?n:function(t){return t===g(n)};return r.remove(function(n){return t(g(n))})},r.mappedRemoveAll=function(t){var i=f(t,g);return r.remove(function(t){return-1!=n.utils.arrayIndexOf(i,g(t))})},r.mappedDestroy=function(n){var t="function"==typeof n?n:function(t){return t===g(n)};return r.destroy(function(n){return t(g(n))})},r.mappedDestroyAll=function(t){var i=f(t,g);return r.destroy(function(t){return-1!=n.utils.arrayIndexOf(i,g(t))})},r.mappedIndexOf=function(t){var i=f(r(),g);return t=g(t),n.utils.arrayIndexOf(i,t)},r.mappedCreate=function(t){if(-1!==r.mappedIndexOf(t))throw Error("There already is an object with the key that you specified.");var i=ct()?yt(t):t;return ft()&&(t=ot(i,t),n.isWriteableObservable(i)?i(t):i=t),r.push(i),i});b=f(n.utils.unwrapObservable(r),g).sort();nt=f(u,g);ut&&nt.sort();ut=n.utils.compareArrays(b,nt);b={};for(var st=n.utils.unwrapObservable(u),pt={},wt=!0,nt=0,lt=st.length;nt<lt;nt++){if(it=g(st[nt]),void 0===it||it instanceof Object){wt=!1;break}pt[it]=st[nt]}var st=[],bt=0,nt=0;for(lt=ut.length;nt<lt;nt++){it=ut[nt];et=p+"["+nt+"]";switch(it.status){case"added":ht=wt?pt[it.value]:s(n.utils.unwrapObservable(u),it.value,g);rt=o(void 0,ht,a,v,r,et,y);ct()||(rt=n.utils.unwrapObservable(rt));et=w(n.utils.unwrapObservable(u),ht,b);rt===tt?bt++:st[et-bt]=rt;b[et]=!0;break;case"retained":ht=wt?pt[it.value]:s(n.utils.unwrapObservable(u),it.value,g);rt=s(r,it.value,g);o(rt,ht,a,v,r,et,y);et=w(n.utils.unwrapObservable(u),ht,b);st[et]=rt;b[et]=!0;break;case"deleted":rt=s(r,it.value,g)}at.push({event:it.status,item:rt})}r(st);a[v]&&a[v].arrayChanged&&n.utils.arrayForEach(at,function(n){a[v].arrayChanged(n.event,n.item)})}else if(d(u)){if(r=n.utils.unwrapObservable(r),!r){if(ct())return ut=yt(),ft()&&(ut=ot(ut)),ut;if(ft())return ot(ut);r={}}if(ft()&&(r=ot(r)),l.save(u,r),ft())return r;k(u,function(t){var i=p.length?p+"."+t:t;if(-1==n.utils.arrayIndexOf(a.ignore,i))if(-1!=n.utils.arrayIndexOf(a.copy,i))r[t]=u[t];else if("object"!=typeof u[t]&&"array"!=typeof u[t]&&0<a.observe.length&&-1==n.utils.arrayIndexOf(a.observe,i))r[t]=u[t],a.copiedProperties[i]=!0;else{var f=l.get(u[t]),e=o(r[t],u[t],a,t,r,i,r),f=f||e;0<a.observe.length&&-1==n.utils.arrayIndexOf(a.observe,i)?(r[t]=f(),a.copiedProperties[i]=!0):(n.isWriteableObservable(r[t])?r[t](n.utils.unwrapObservable(f)):(f=void 0===r[t]?f:n.utils.unwrapObservable(f),r[t]=f),a.mappedProperties[i]=!0)}})}else switch(t.getType(u)){case"function":ft()?n.isWriteableObservable(u)?(u(ot(u)),r=u):r=ot(u):r=u;break;default:if(n.isWriteableObservable(r))return rt=ft()?ot(r):n.utils.unwrapObservable(u),r(rt),rt;ct()||ft();r=ct()?yt():n.observable(n.utils.unwrapObservable(u));ft()&&r(ot(r))}return r}function w(n,t,i){for(var r=0,u=n.length;r<u;r++)if(!0!==i[r]&&n[r]===t)return r;return null}function b(i,r){var u;return r&&(u=r(i)),"undefined"===t.getType(u)&&(u=i),n.utils.unwrapObservable(u)}function s(t,i,r){var u,e,f;for(t=n.utils.unwrapObservable(t),u=0,e=t.length;u<e;u++)if(f=t[u],b(f,r)===i)return f;throw Error("When calling ko.update*, the key '"+i+"' was not found!");}function f(t,i){return n.utils.arrayMap(n.utils.unwrapObservable(t),function(n){return i?b(n,i):n})}function k(n,i){if("array"===t.getType(n))for(var r=0;r<n.length;r++)i(r);else for(r in n)i(r)}function d(n){var i=t.getType(n);return("object"===i||"array"===i)&&null!==n}function it(){var t=[],i=[];this.save=function(r,u){var f=n.utils.arrayIndexOf(t,r);0<=f?i[f]=u:(t.push(r),i.push(u))};this.get=function(r){return r=n.utils.arrayIndexOf(t,r),0<=r?i[r]:void 0}}function g(){var n={},t=function(t){var i;try{i=t}catch(r){i="$$$"}return t=n[i],void 0===t&&(t=new it,n[i]=t),t};this.save=function(n,i){t(n).save(n,i)};this.get=function(n){return t(n).get(n)}}var i="__ko_mapping__",h=n.dependentObservable,p=0,c,l,nt=["create","update","key","arrayChanged"],tt={},a={include:["_destroy"],ignore:[],copy:[],observe:[]},r=a;t.isMapped=function(t){return(t=n.utils.unwrapObservable(t))&&t[i]};t.fromJS=function(n){var t,r,u,f;if(0==arguments.length)throw Error("When calling ko.fromJS, pass the object you want to convert.");try{if(p++||(c=[],l=new g),2==arguments.length&&(arguments[1][i]?r=arguments[1]:t=arguments[1]),3==arguments.length&&(t=arguments[1],r=arguments[2]),r&&(t=e(t,r[i])),t=y(t),u=o(r,n,t),r&&(u=r),!--p)for(;c.length;)f=c.pop(),f&&f();return u[i]=e(u[i],t),u}catch(s){throw p=0,s;}};t.fromJSON=function(i){var r=n.utils.parseJson(i);return arguments[0]=r,t.fromJS.apply(this,arguments)};t.updateFromJS=function(){throw Error("ko.mapping.updateFromJS, use ko.mapping.fromJS instead. Please note that the order of parameters is different!");};t.updateFromJSON=function(){throw Error("ko.mapping.updateFromJSON, use ko.mapping.fromJSON instead. Please note that the order of parameters is different!");};t.toJS=function(u,f){if(r||t.resetDefaultOptions(),0==arguments.length)throw Error("When calling ko.mapping.toJS, pass the object you want to convert.");if("array"!==t.getType(r.ignore))throw Error("ko.mapping.defaultOptions().ignore should be an array.");if("array"!==t.getType(r.include))throw Error("ko.mapping.defaultOptions().include should be an array.");if("array"!==t.getType(r.copy))throw Error("ko.mapping.defaultOptions().copy should be an array.");return f=y(f,u[i]),t.visitModel(u,function(t){return n.utils.unwrapObservable(t)},f)};t.toJSON=function(i,r){var u=t.toJS(i,r);return n.utils.stringifyJson(u)};t.defaultOptions=function(){if(0<arguments.length)r=arguments[0];else return r};t.resetDefaultOptions=function(){r={include:a.include.slice(0),ignore:a.ignore.slice(0),copy:a.copy.slice(0)}};t.getType=function(n){if(n&&"object"==typeof n){if(n.constructor===Date)return"date";if(n.constructor===Array)return"array"}return typeof n};t.visitModel=function(r,u,f){var o,e,s;if(f=f||{},f.visitedObjects=f.visitedObjects||new g,e=n.utils.unwrapObservable(r),d(e))f=y(f,e[i]),u(r,f.parentName),o="array"===t.getType(e)?[]:{};else return u(r,f.parentName);return f.visitedObjects.save(r,o),s=f.parentName,k(e,function(r){if(!(f.ignore&&-1!=n.utils.arrayIndexOf(f.ignore,r))){var h=e[r],c=f,l=s||"";if("array"===t.getType(e)?s&&(l+="["+r+"]"):(s&&(l+="."),l+=r),c.parentName=l,!(-1===n.utils.arrayIndexOf(f.copy,r)&&-1===n.utils.arrayIndexOf(f.include,r)&&e[i]&&e[i].mappedProperties&&!e[i].mappedProperties[r]&&e[i].copiedProperties&&!e[i].copiedProperties[r]&&"array"!==t.getType(e)))switch(t.getType(n.utils.unwrapObservable(h))){case"object":case"array":case"undefined":c=f.visitedObjects.get(h);o[r]="undefined"!==t.getType(c)?c:t.visitModel(h,u,f);break;default:o[r]=u(h,f.parentName)}}}),o}});ko.bindingHandlers.autoComplete={init:function(n,t){var i=ko.unwrap(t())||{};i.data&&$(n).autocomplete({source:_.uniq(i.data)})}};ko.bindingHandlers.badge={init:function(n,t){var i=$.extend({},{"class":"badge-primary",text:"Badge"},ko.utils.unwrapObservable(t())||{}),r='<span class="badge '+i["class"]+'">'+i.text+"<\/span>";$(n).append(r)}};ko.bindingHandlers.bingMap={getMap:function(n){return ko.bindingHandlers.bingMap.maps||(ko.bindingHandlers.bingMap.maps=[]),ko.bindingHandlers.bingMap.maps[n.id]},setMap:function(n,t){ko.bindingHandlers.bingMap.maps||(ko.bindingHandlers.bingMap.maps=[]);ko.bindingHandlers.bingMap.maps[n.id]=t},init:function(n,t){var i=ko.utils.unwrapObservable(t())||{};i.apiKey.subscribe(function(t){var u=ko.utils.unwrapObservable(i.center),f=ko.utils.unwrapObservable(i.zoom),e,r;f=f?f:u?12:3;e=u?new Microsoft.Maps.Location(u.latitude,u.longitude):new Microsoft.Maps.Location(39.828127,-98.579404);r=new Microsoft.Maps.Map(n,{credentials:t,customizeOverlays:!0,enableSearchLogo:!1,showDashboard:!0,showScalebar:!1,showMapTypeSelector:!0,center:e,mapTypeId:Microsoft.Maps.MapTypeId.road,zoom:f,disableKeyboardInput:!0,disableStreetsideAutoCoverage:!0});ko.bindingHandlers.bingMap.setMap(n,r);i.viewChangeStart&&Microsoft.Maps.Events.addHandler(r,"viewchangestart",i.viewChangeStart);i.viewChangeEnd&&Microsoft.Maps.Events.addThrottledHandler(r,"viewchangeend",function(n){i.viewChangeEnd(n)},50);i.mapMouseUpHandleFunction&&Microsoft.Maps.Events.addHandler(r,"mouseup",i.mapMouseUpHandleFunction);i.mapMouseDownHandleFunction&&Microsoft.Maps.Events.addHandler(r,"mousedown",i.mapMouseDownHandleFunction);i.mapKeyPressHandleFunction&&n.addEventListener("keydown",i.mapKeyPressHandleFunction);i.mapKeyUpHandleFunction&&n.addEventListener("keyup",i.mapKeyUpHandleFunction);i.mapMouseMoveHandleFunction&&Microsoft.Maps.Events.addHandler(r,"mousemove",i.mapMouseMoveHandleFunction);i.mapImageryChangedHandler&&Microsoft.Maps.Events.addHandler(r,"maptypechanged",i.mapImageryChangedHandler);i.map(r);i.loadCanvas&&i.loadCanvas()});i.center.subscribe(function(t){var r=ko.bindingHandlers.bingMap.getMap(n),i,u;r&&(i=t,u=i?new Microsoft.Maps.Location(i.latitude,i.longitude):new Microsoft.Maps.Location(39.828127,-98.579404),r.setView({center:u,zoom:r.getZoom()}))});i.zoom.subscribe(function(t){var i=ko.bindingHandlers.bingMap.getMap(n);i&&i.setView({center:i.getCenter(),zoom:t})});i.apiKey()&&i.apiKey.valueHasMutated()},update:function(){}};ko.bindingHandlers.bingMapsLocationPicker={getMap:function(n){if(ko.bindingHandlers.bingMapsLocationPicker.maps||(ko.bindingHandlers.bingMapsLocationPicker.maps=[]),n)return ko.bindingHandlers.bingMapsLocationPicker.maps[n.id]},setMap:function(n,t){ko.bindingHandlers.bingMapsLocationPicker.maps||(ko.bindingHandlers.bingMapsLocationPicker.maps=[]);ko.bindingHandlers.bingMapsLocationPicker.maps[n.id]=t},setLocation:function(n,t){var i=ko.bindingHandlers.bingMapsLocationPicker.getMap(n),r,e,f,u;(i.entities.clear(),i&&t&&t.latitude&&t.longitude)&&(r=new window.Microsoft.Maps.Location(t.latitude,t.longitude),e=12,i.setView({center:r,zoom:e}),f=new window.Microsoft.Maps.Pushpin(r,{width:32,height:32,icon:"https://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=%E2%80%A2|00FF00|000000",anchor:new window.Microsoft.Maps.Point(13,32),zIndex:11,draggable:!1}),u=new window.Microsoft.Maps.Infobox(r,{title:r.latitude.toFixed(6)+", "+r.longitude.toFixed(6),visible:!0,typeName:"mini"}),u.setMap(i),window.Microsoft.Maps.Events.addHandler(f,"click",function(){u.setOptions({visible:!u.getOptions().visible})}),window.Microsoft.Maps.Events.addHandler(i,"viewchange",function(){u.setOptions({visible:!1})}),i.entities.clear(),i.entities.push(f))},init:function(n,t){var i=ko.utils.unwrapObservable(t())||{},r;i.apiKey.subscribe(function(t){var o,f;console.log(t);var e=ko.utils.unwrapObservable(i.center),s=e?new window.Microsoft.Maps.Location(e.Latitude,e.Longitude):new window.Microsoft.Maps.Location(39.828127,-98.579404),u=i.selectedLocation,h=e?12:3;r=new window.Microsoft.Maps.Map(n,{credentials:i.apiKey(),customizeOverlays:!0,enableSearchLogo:!1,showDashboard:!0,showScalebar:!1,showMapTypeSelector:!0,center:s,mapTypeId:window.Microsoft.Maps.MapTypeId.road,zoom:h,disableBirdseye:!0,disableStreetside:!0,disableMapTypeSelectorMouseOver:!0,disableKeyboardInput:!0,disableStreetsideAutoCoverage:!0});i.map&&i.map(r);i.eventListeners?(i.eventListeners.clickMap&&window.Microsoft.Maps.Events.addHandler(r,"click",i.eventListeners.clickMap),i.eventListeners.rightclickMap&&window.Microsoft.Maps.Events.addHandler(r,"rightclick",i.eventListeners.rightclickMap),i.eventListeners.navigate&&window.Microsoft.Maps.Events.addHandler(r,"viewchange",i.eventListeners.navigate),i.selectedLocations&&Microsoft.Maps.loadModule("Microsoft.Maps.Clustering",function(){var t=function(n){n.setOptions({icon:'<svg xmlns="http://www.w3.org/2000/svg" width="26" height="26"><circle cx="13" cy="13" r="10" stroke="white" stroke-width="2" fill="#4399fe" /><circle cx="13" cy="13" r="12" stroke-width="2" stroke="#4399fe" fill="none" /><\/svg>',textOffset:new Microsoft.Maps.Point(0,5)})},n=new Microsoft.Maps.ClusterLayer([],{gridSize:135,clusteredPinCallback:t});i.selectedLocations.subscribeAndFire(function(t){var u=_.filter(n.getPushpins(),function(n){var i=_.any(t,function(t){return t.latitude===n.geometry.y&&t.longitude===n.geometry.x});return i||n.infobox&&n.infobox.setOptions({visible:!1}),i});_.each(t,function(n){var e,t,f;n&&n.latitude&&n.longitude&&(e=new window.Microsoft.Maps.Location(n.latitude,n.longitude),t=_.find(u,function(t){return n.latitude===t.geometry.y&&n.longitude===t.geometry.x}),t||(t=new window.Microsoft.Maps.Pushpin(e,{width:32,height:32,icon:"https://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=%E2%80%A2|00FF00|000000",anchor:new window.Microsoft.Maps.Point(13,32),zIndex:11,draggable:!1}),f=new window.Microsoft.Maps.Infobox(e,{title:n.latitude+", "+n.longitude,visible:!1,typeName:"mini",maxWidth:512}),f.setMap(r),window.Microsoft.Maps.Events.addHandler(t,"click",function(t){var r=!1;i.eventListeners.clickLocation&&(r=i.eventListeners.clickLocation(n,t));r||f.setOptions({visible:!f.getOptions().visible})}),window.Microsoft.Maps.Events.addHandler(r,"viewchange",function(){f.setOptions({visible:!1})}),t.infobox=f,t.ll=n,u.push(t)))});n.setPushpins(u)});r.layers.insert(n)})):i.selectedLocations&&console.error("Multiselect currently only supported via external event handlers.");i.infoboxOverlay&&(o=new window.Microsoft.Maps.Infobox(r.getCenter(),{htmlContent:"",visible:!1}),f=function(){var n=i.infoboxOverlay.location(),t={visible:i.infoboxOverlay.show(),htmlContent:i.infoboxOverlay.content(),location:new window.Microsoft.Maps.Location(n.latitude,n.longitude)},r=o.getOptions();_.isEqual(t,r)||o.setOptions(t)},o.setMap(r),i.infoboxOverlay.location.subscribe(f),i.infoboxOverlay.content.subscribe(f),i.infoboxOverlay.show.subscribe(f),f());(typeof i.privateSet=="undefined"||i.privateSet===!1&&u)&&window.Microsoft.Maps.Events.addHandler(r,"dblclick",function(n){var e=new window.Microsoft.Maps.Point(n.getX(),n.getY()),i=n.target.tryPixelToLocation(e),f,t;u({latitude:i.latitude,longitude:i.longitude});f=new window.Microsoft.Maps.Pushpin(i,{width:32,height:32,icon:"https://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=%E2%80%A2|00FF00|000000",anchor:new window.Microsoft.Maps.Point(13,32),zIndex:11,draggable:!1});t=new window.Microsoft.Maps.Infobox(i,{title:u().latitude.toFixed(6)+", "+u().longitude.toFixed(6),visible:!0,typeName:"mini"});t.setMap(r);window.Microsoft.Maps.Events.addHandler(f,"click",function(){t.setOptions({visible:!t.getOptions().visible})});window.Microsoft.Maps.Events.addHandler(r,"viewchange",function(){t.setOptions({visible:!1})});r.entities.clear();r.entities.push(f);n.handled=!0});ko.bindingHandlers.bingMapsLocationPicker.setMap(n,r);ko.unwrap(u)&&ko.bindingHandlers.bingMapsLocationPicker.setLocation(n,ko.unwrap(u))});i.center&&i.center.subscribe(function(n){if(r){var t=n,i=t?new window.Microsoft.Maps.Location(t.Latitude,t.Longitude):new window.Microsoft.Maps.Location(39.828127,-98.579404),u=t?12:3;r.setView({center:i,zoom:u})}});i.selectedLocation&&i.selectedLocation.subscribe(function(t){ko.bindingHandlers.bingMapsLocationPicker.setLocation(n,t)});i.apiKey()&&i.apiKey.valueHasMutated()},update:function(){}};ko.bindingHandlers.bool={update:function(n,t,i){var f=t(),e=i(),r=ko.utils.unwrapObservable(f),u=e.nullValue||"--";r!==null&&r!==undefined&&(u=r?"Yes":"No");$(n).is("input")===!0?$(n).val(u):$(n).text(u)}};ko.bindingHandlers.bootstrapPopover={create:function(n,t){var u,i,r;if(t.content||$(n).is("[data-content]")||(u=$(n).prev().first(),u.length==1&&(t=$.extend({},t),t.content=u.hide().html(),(t.html===undefined||t.html===null)&&(t.html=!0))),i=$(n),t.onDisabled?(i.popoverOnDisabled(t),i=ko.bindingHandlers.bootstrapPopover.getElement(n)):i.popover(t),t.customCss&&$(n).popover(t).data("bs.popover").tip().addClass(t.customCss),t.events)for(r in t.events)if(t.events.hasOwnProperty(r))i.on(r,t.events[r]);ko.utils.domNodeDisposal.addDisposeCallback(i[0],function(){i.popover("destroy")})},getElement:function(n){var t=$(n);return t.hasOwnProperty("hasData")&&t.hasData("popoverContainer")&&(t=$(t.data("popoverContainer"))),t},init:function(n,t){var i=$.extend({placement:"bottom",trigger:"hover focus",container:"#routerWindow"},ko.unwrap(t())||{});i.recreate&&ko.isObservable(i.recreate)&&i.recreate.subscribe(function(t){var r=ko.bindingHandlers.bootstrapPopover.getElement(n);r.popover("destroy");t&&ko.bindingHandlers.bootstrapPopover.create(n,i)});ko.bindingHandlers.bootstrapPopover.create(n,i)},update:function(n,t){var i=$.extend({placement:"bottom",trigger:"hover focus",container:"#routerWindow"},ko.unwrap(t())||{}),r=ko.bindingHandlers.bootstrapPopover.getElement(n);r.popover("destroy");ko.bindingHandlers.bootstrapPopover.create(n,i)}};ko.bindingHandlers.bootstrapButton={init:function(n,t){var i=ko.unwrap(t())||{},r=!!ko.unwrap(i.loading);$(n).button();r&&$(n).button("loading");ko.isObservable(i.loading)&&i.loading.subscribe(function(t){$(n).button(t?"loading":"reset")})}};ko.bindingHandlers.clearButton={init:function(n,t){var r=t(),u=r.icon||"fas fa-times",f=r.css||"btn btn-xs text-default",e=r.click||function(){},i=$('<span class="input-button '+f+'"><i class="'+u+'"><\/i><\/span>');i.hide();i.css({position:"absolute","z-index":5,"font-size":"1.2em"});i.on("click",e);$(n).after(i)},update:function(n,t,i){var f=t(),u=ko.utils.unwrapObservable(i().value),r=$(n).next(".input-button");u&&u.length>0?($(r).css("left")==="auto"&&$(r).css({top:"3px",left:$(n).width()-15}),$(r).show()):$(r).hide()}};ko.bindingHandlers.data={update:function(n,t){var i=t();$.each(i,function(t,i){$(n).data(t,ko.utils.unwrapObservable(i))})}};ko.bindingHandlers.dataTable={init:function(n,t){var i=ko.unwrap(t()),r,f,u;if(i.options){if(i.hasOwnProperty("xhr"))$(n).on("xhr.dt",i.xhr);r=ko.unwrap(i.options);f=r.buttons?$.extend(!0,$.isArray(r.buttons)?[]:{},r.buttons):undefined;r.deferLoading=1;u=$(n).DataTable(r);ko.utils.domNodeDisposal.addDisposeCallback(n,function(){u.destroy();f&&(r.buttons=f)});u.on("draw",function(n,t){var i=t._iDisplayStart,r=Math.max(t.aoData.length,t._iRecordsDisplay);(r>0||i>0)&&i+1>r&&setTimeout(function(){u.page("first").draw()},1)});i.hasOwnProperty("apiAccessor")&&(ko.isObservable(i.apiAccessor)?i.apiAccessor(u):i.apiAccessor=u);$(u.table().container()).find(".dataTables_filter input").attr("maxlength",100)}if(i.hasOwnProperty("controlsDescendantBindings"))return{controlsDescendantBindings:ko.unwrap(i.controlsDescendantBindings)}},update:function(n,t){var u=ko.unwrap(t()),f=ko.unwrap(u.data),i,r;f?ko.unwrap(u.delayUpdate)||$(n).DataTable().clear().rows.add(f).draw(!1):(i="FACTRAX_throttleDraw",$(n).data(i)||$(n).data(i,_.debounce(function(){$(n).DataTable().draw(!1)},500)),$(n).data(i)(),r=ko.unwrap(u.options),r.ajax&&r.ajax.data&&r.ajax.data({}))}};ko.bindingHandlers.exportDataTableButton={init:function(n,t){var i=ko.unwrap(t()),r;i&&(r=$(n),r.click(function(n){var t,f,u;if(n.preventDefault(),r.button("loading"),t={},f=!0,typeof i.recordId!="undefined"&&(f=typeof i.dataTable=="string"&&$(i.dataTable).length>0),f){if(u=typeof i.dataTable=="string"?$(i.dataTable).DataTable():ko.unwrap(i.dataTable),t=$.extend(!0,t,u.ajax.params()),u.page.info().recordsDisplay>1e5){alert("You cannot export a list with more than 100,000 entries.");r.button("reset");return}FACTRAX.Tables.processColVis(u,t)}else t.recordId=i.recordId;t.iUserTimezoneOffset=moment().utcOffset();t.sUserIANATimezone=moment.tz.guess();t.sSavedFilterName=ko.unwrap(i.savedFilterName)||null;$.fileDownload(i.url,{successCallback:function(){r.button("reset");typeof i.callback!="undefined"&&i.callback(!0,r)},failCallback:function(){alert("An error occurred while exporting the data.");r.button("reset");typeof i.callback!="undefined"&&i.callback(!1,r)},httpMethod:"POST",data:t})}))}};ko.bindingHandlers.date={update:function(n,t,i){var e=t(),f=i(),r=ko.utils.unwrapObservable(e),o=f.format||"M/D/YYYY",u=f.nullValue||FACTRAX.Settings.defaultDisplayValue;r!==null&&r!==undefined&&r.length>0&&(u=moment.utc(r).format(o));f.fromNow&&(u=moment.utc(r).fromNow());f.calendar&&(u=moment.utc(r).local().calendar());$(n).is("input")===!0?$(n).val(u):$(n).text(u)}};ko.bindingHandlers.datepicker={init:function(n,t,i){var r=$.extend({assumeNearbyYear:!0,todayHighlight:!0,autoclose:!0,endDate:"+50y",format:"m/d/yyyy",zIndexOffset:2030},i().datepickerOptions||{});$(n).datepicker(r);$(n).next(".input-group-addon").click(function(){$(n).focus()});ko.utils.registerEventHandler(n,"hide",function(){var i=t(),r;ko.isWriteableObservable(i)&&(n.value?(r=moment.utc($(n).datepicker("getUTCDate")),i(r.format("YYYY-MM-DD"))):i(null))});ko.utils.domNodeDisposal.addDisposeCallback(n,function(){$(n).datepicker("destroy")});ko.bindingHandlers.validationCore.init(n,t,i)},update:function(n,t,i){var r=ko.unwrap(t()),u;r?typeof r=="string"&&(r=moment.utc(r).toDate()):r=null;var f=$(n).datepicker("getUTCDate"),e=f&&!isNaN(f),o=e&&!r||!e&&r,s=e&&r;(o||s&&f.getTime()!=r.getTime())&&$(n).datepicker("setUTCDate",r||"");u=i().datepickerOptions||{};u.startDate!==undefined&&$(n).datepicker("setStartDate",u.startDate);u.endDate!==undefined&&$(n).datepicker("setEndDate",u.endDate)}};ko.bindingHandlers.daterangepicker={init:function(n,t,i){var u=$.extend({assumeNearbyYear:!0,todayHighlight:!0,autoclose:!0,format:"m/d/yyyy",zIndexOffset:2030},i().datepickerOptions||{}),r;$(n).datepicker(u);r=[$(n).find(".input-daterange-start")[0],$(n).find(".input-daterange-end")[0]];$.each(r,function(n,t){$(t).next(".input-group-addon").click(function(){$(t).focus()})});$.each(r,function(n,i){ko.utils.registerEventHandler(i,"hide",function(){var r=t(),u;ko.isWriteableObservable(r[n])&&(i.value?(u=moment.utc(i.value,"MM/DD/YYYY"),r[n](u.format("YYYY-MM-DD"))):r[n](null))})});ko.utils.domNodeDisposal.addDisposeCallback(n,function(){$(n).datepicker("destroy")});ko.bindingHandlers.validationCore.init(n,t,i)},update:function(n,t,i){var u=t(),f=[ko.unwrap(u[0]),ko.unwrap(u[1])],r=[$(n).find(".input-daterange-start")[0],$(n).find(".input-daterange-end")[0]];$.each(f,function(n,t){var u;t?typeof t=="string"&&(t=moment.utc(t).toDate()):t=null;var f=$(r[n]).datepicker("getUTCDate"),e=f&&!isNaN(f),o=e&&!t||!e&&t,s=e&&t;(o||s&&f.getTime()!=t.getTime())&&$(r[n]).datepicker("setUTCDate",t||"");u=i().datepickerOptions||{};u.startDate!==undefined&&$(r[n]).datepicker("setStartDate",u.startDate);u.endDate!==undefined&&$(r[n]).datepicker("setEndDate",u.endDate)})}};ko.bindingHandlers.dateTimePicker={init:function(n,t,i){var r=$.extend({format:"MM/DD/YYYY hh:mm A",sideBySide:!0,stepping:15},i().dateTimePickerOptions||{});$(n).datetimepicker(r);$(n).next(".input-group-addon").click(function(){$(n).focus()});$(n).find("input").click(function(){$(n).data("DateTimePicker").show()});ko.utils.registerEventHandler(n,"dp.change",function(n){var i=t();ko.isWriteableObservable(i)&&i(n.date?n.date.utc().format("YYYY-MM-DD[T]HH:mm:ss"):null)});ko.utils.domNodeDisposal.addDisposeCallback(n,function(){var t=$(n).data("DateTimePicker");t&&t.destroy()})},update:function(n,t){var r=$(n).data("DateTimePicker"),i;r&&(i=ko.unwrap(t()),r.date(i?moment.utc(i).local():null))}};ko.bindingHandlers.dateTimePickerTz={init:function(n,t,i){var r=$.extend({format:"MM/DD/YYYY hh:mm A",sideBySide:!0,stepping:15},i().dateTimePickerOptions||{});$(n).datetimepicker(r);$(n).next(".input-group-addon").click(function(){$(n).focus()});$(n).find("input").click(function(){$(n).data("DateTimePicker").show()});$(n).data("DateTimePicker_OldTimezone",ko.unwrap(t().tz));ko.utils.registerEventHandler(n,"dp.change",function(n){var i=t(),r=null,u=null,f;n.date?(f=n.date.format("YYYY-MM-DD HH:mm"),r=moment.tz(f,"YYYY-MM-DD HH:mm",ko.unwrap(t().tz)||"Etc/UTC")):u=moment().tz(ko.unwrap(t().tz)||"Etc/UTC");ko.isWriteableObservable(i.utc)&&i.utc(r?r.clone().utc().format("YYYY-MM-DD[T]HH:mm:ssZ"):null);ko.isWriteableObservable(i.code)&&i.code((r||u).format("z"));ko.isWriteableObservable(i.offset)&&i.offset((r||u).utcOffset())});ko.utils.domNodeDisposal.addDisposeCallback(n,function(){var t=$(n).data("DateTimePicker");t&&t.destroy()})},update:function(n,t){var i=$(n).data("DateTimePicker"),r,u;i&&(r=ko.unwrap(t().utc),r?(u=moment.utc(r).tz(ko.unwrap(t().tz)||"Etc/UTC"),$(n).data("DateTimePicker_OldTimezone")!==ko.unwrap(t().tz)&&($(n).data("DateTimePicker_OldTimezone",ko.unwrap(t().tz)),i.date(null)),i.date(moment(u))):i.date(null))}};ko.dirtyFlag=function(n,t){var i=function(){},r=ko.observable(ko.toJSON(n)),u=ko.observable(t);return i.isDirty=ko.pureComputed(function(){return u()||r()!==ko.toJSON(n)}),i.reset=function(){r(ko.toJSON(n));u(!1)},i};ko.utils.addDirtyFlags=function(n){var i=[],t,r;for(t in n)n.hasOwnProperty(t)&&ko.isObservable(n[t])&&(r=new ko.dirtyFlag(n[t]),n[t].DirtyFlag=r,i.push(r));return $.extend(ko.pureComputed(function(){return!!ko.utils.arrayFirst(i,function(n){return n.isDirty()})}),{reset:function(){ko.utils.arrayForEach(i,function(n){n.reset()})}})};ko.extenders.addDirtyFlag=function(n,t){return t==="properties"?n.isDirty=ko.utils.addDirtyFlags(n()):n.DirtyFlag=new ko.dirtyFlag(n),n};ko.extenders.resetable=function(n,t){var f,i,r,u;if(t==="properties"){f=[];i=n();for(r in i)i.hasOwnProperty(r)&&ko.isWritableObservable(i[r])&&(i[r].extend({resetable:!0}),f.push(i[r]));n.reset=function(){ko.utils.arrayForEach(f,function(n){n.reset()})};n.resave=function(){ko.utils.arrayForEach(f,function(n){n.resave()})}}else u=n(),n.reset=function(){n(u)},n.resave=function(){u=n()},n.getInitialValue=function(){return u},n.isInitialValue=function(){return ko.toJSON(u)===ko.toJSON(n())};return n};ko.utils.getDirtyValues=function(n){var e={},i,u,r,t,o;for(var f in n)if(n.hasOwnProperty(f)){if(t=n[f],ko.isObservable(t))i=t,u=t.DirtyFlag?t.DirtyFlag.isDirty:undefined,r=null;else if($.isPlainObject(t)){if(!t.ko)continue;i=t.ko;u=t.isDirty||(i.DirtyFlag?i.DirtyFlag.isDirty:undefined);r=t.alt}else continue;r&&(o=i(),i(r()));(!u||u())&&(e[f]=i());r&&i(o)}return e};ko.bindingHandlers.disableWithPointerEvents={update:function(n,t){var i=ko.utils.unwrapObservable(t());i?($(n).addClass("disabled"),$(n).css("pointer-events","auto")):$(n).removeClass("disabled")}};ko.bindingHandlers.download={update:function(n,t){var i=this;i.options=t();i.downloadUrl=options.url;i.icon=options.icon||"fa-download";i.$element=$(n);i.$icon=$('<i class="fa '+i.icon+'"><\/i>');i.$loading=$('<i class="fa fa-spinner fa-pulse"><\/i>');i.download=function(){$td.empty();$.fileDownload(FACTRAX.getAddress()+downloadUrl,{successCallback:function(){FACTRAX.Toast.success("Your download was successful!")},failCallback:function(){FACTRAX.Toast.failure("Sorry, there was an error during your download.")},httpMethod:"POST",data:data});$icon.show()};i.$element.click(function(){return $icon.hide(),$td.append(loading),i.download(),!1})}};ko.bindingHandlers.downloadButton={update:function(n,t){var i=ko.unwrap(t()),r;i&&(r=$(n),typeof i=="string"&&(i={url:i}),i.post||!r.is("a")||r.attr("href")||r.attr("href",ko.unwrap(i.url)),r.off("click").click(function(){return r.button("loading"),$.fileDownload(ko.unwrap(i.url),{successCallback:function(){r.button("reset");i.callback&&i.callback(!0,r)},failCallback:function(){alert("An error occurred while downloading.");r.button("reset");i.callback&&i.callback(!1,r)},httpMethod:i.post?"POST":"GET",data:i.post||{cookie:!0,_:(new Date).getTime()}}),!1}))}};ko.bindingHandlers.downloadButtonForDocumentManager={update:function(n,t){var r=ko.unwrap(t()),i;r&&(i=$(n),i.is("a")&&!i.attr("href")&&i.attr("href",ko.unwrap(r.url)),i.off("click").click(function(){return i.addClass("file-download-loading"),$.fileDownload(ko.unwrap(r.url),{successCallback:function(){i.removeClass("file-download-loading")},failCallback:function(){alert("An error occurred while downloading.");i.removeClass("file-download-loading")},httpMethod:"GET",data:{cookie:!0,_:(new Date).getTime()}}),!1}))}};ko.bindingHandlers.editableHtml={init:function(n,t){var i=$(n),r=ko.utils.unwrapObservable(t());if(t().preventLineBreaks&&(r=ko.utils.unwrapObservable(t().html)),r!==""&&$("#headerEditor").removeAttr("unselectable","on").css("MozUserSelect","").off("selectstart.ui"),t().preventLineBreaks)i.on("keydown",function(n){(n.keyCode===10||n.keyCode===13)&&n.preventDefault()});i.html(r).css({"padding-left":"5px","padding-right":"5px"});i.on("keyup",function(){var n=t();if(t().preventLineBreaks&&(n=t().html),n(i.html()),i.html()==="")i.attr("unselectable","on").css("MozUserSelect","none").on("selectstart.ui",function(){return!1});else $("#headerEditor").removeAttr("unselectable","on").css("MozUserSelect","").off("selectstart.ui")})}};ko.bindingHandlers.fileupload={init:function(n,t){var r=ko.unwrap(t()),u=!1,e=null,i=ko.unwrap(r.settings),o=i.maxNumFiles||1,f=function(){var n=u?e||{}:null;ko.isObservable(r.progress)&&r.progress(n)};$(n).fileupload({url:i.url,autoUpload:i.autoUpload||!1,dataType:"json",always:function(){u=!1;f()},add:function(n,t){if(i.numFilesDropped&&i.numFilesDropped(t.originalFiles.length),t.files.length<=o){var u=t.files[t.files.length-1];ko.isObservable(r.file)&&(i.nosubmit?r.file(u):r.file($.extend({submit:t.submit.bind(t)},u)))}},submit:function(n,t){return u=!0,f(),t.formData=i.formData?ko.unwrap(i.formData):{},!0},progress:function(n,t){e=t;f()},maxNumberOfFiles:o,replaceFileInput:!1,dropZone:i.dropZone||null})}};ko.bindingHandlers.fileuploadProgressBar={init:function(n){$(n).addClass("progress progress-striped active");$(n).append('<div class="progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100"><\/div>');$(n).hide()},update:function(n,t){var i=ko.unwrap(t()),r,u;$(n).toggle(!!i);r=i&&i.total?Math.round(i.loaded/i.total*100):0;u=$(n).children(".progress-bar");u.attr("aria-valuenow",r);u.width(r+"%");u.text(r+"%")}};ko.bindingHandlers.formOptionsSelect2={init:function(n,t){var i=ko.unwrap(t())||{},u=$(n),o=!1,c=i.formOptionType,f=ko.isObservable(i.value)?i.value:ko.observable(i.value),h=ko.isObservable(i.text)?i.text:ko.observable(i.text),l=i.width?ko.utils.unwrapObservable(i.width).toString():"6.5em",a=i.placeholder?ko.utils.unwrapObservable(i.placeholder).toString():"Select...",r=null,s=null,e=i.additionalTextRequired?ko.isObservable(i.additionalTextRequired.value)?i.additionalTextRequired.value:ko.observable(i.additionalTextRequired.value):null;if(i.additionalTextRequired){r=i.additionalTextRequired.textArea?$('<textarea type="text" class="form-control '+(i.additionalTextRequired.inputCSS?i.additionalTextRequired.inputCSS:"")+'"><\/textarea>'):$('<input type="text" class="form-control '+(i.additionalTextRequired.inputCSS?i.additionalTextRequired.inputCSS:"")+'"><\/input>');s=$('<div class="clearfix form-group" style="margin-bottom:15px;" data-bind="validationElement: value"><span class="control-label col-xs-4">'+i.additionalTextRequired.caption+"<\/span><\/div>");s.append($('<div class="col-xs-4"><p data-bind="validationMessage: value"><\/p><\/div>').prepend(r));r.on("change",function(){e(r.val())});e&&e()&&r.val(e());f()&&f()!==FACTRAX.FormOptions.YesNoType.FalseValue||r.prop("disabled",!0)}FACTRAX.FormOptions.getFormOptionsForType(c).done(function(n){function y(){f()===undefined?c.val(null):c.val(f());o=!0;c.trigger("change");o=!1}var p=$.map(n,function(n){return n.id=n.id||n.Value,n.text=n.text||n.Name,n}),c=u.select2({data:p,allowClear:!0,placeholder:a,width:l,minimumResultsForSearch:-1}),t,v,w;i.additionalTextRequired&&(t=u.closest(".clearfix").after(s).next(),t&&t[0]&&ko.applyBindings({value:e},t[0]));y();v=f();u.on("change",function(){var n,t;o=!0;n=u.val();n===null?(h(null),f(null),r&&(r.val(null),e(null))):(f(n),h(u.select2("data")[0].Name));o=!1;n===FACTRAX.FormOptions.YesNoType.TrueValue&&r?r.prop("disabled",!1):r&&(r.prop("disabled",!0),r.val()&&r.val().length>0&&(t=confirm("Are you sure you would like to clear out the '"+i.additionalTextRequired.caption+"' data?"),t?r.val(null):f(v)));v=n});w=f.subscribe(function(){o||y()})});u.on("select2:opening",function(n){u.data("unselecting")&&(u.removeData("unselecting"),n.preventDefault())}).on("select2:unselecting",function(){u.data("unselecting",!0)})}};ko.fullCalendar={viewModel:function(n){this.allEvents=n.allEvents;this.filteredEvents=n.filteredEvents;this.eventCount=n.eventCount;this.teamCount=n.teamCount;this.header=n.header;this.editable=n.editable;this.viewDate=n.viewDate||ko.observable(new Date);this.lazyFetching=n.lazyFetching;this.monthStart=n.monthStart;this.monthEnd=n.monthEnd;this.month=n.month;this.year=n.year},eventModel:function(n){this.title=n.Name;this.start=n.Start_Date;this.end=n.End_Date;this.allDay=!1}};ko.bindingHandlers.fullCalendar13={init:function(n,t,i){var u=t(),e=i(),f=this,r;this.dialog=e.durandalDialog;r=$(n);this.calendarElement=r;n.innerHTML="";$("body :not(.fc-view-container)").on("click",function(){$(".menu-day").remove();$(".menu-event").remove()});var o=function(n,t){var r,i=n.objectName==="Team"?moment.aspDateTimeToEastern:moment.aspDateToMoment,u,f,e;r=n.actualEnd!=null?i(n.actualStart).format("MM/DD")+" to "+i(n.actualEnd).format("MM/DD"):i(n.actualStart).format("MM/DD");u=n.objectName!=="Event"?"":n.open?'<li><span class="badge calendar-status-open-tag"><i class="fa fa-fw fa-check"><\/i>Open<\/span><\/li>':'<li><span class="badge calendar-status-closed-tag"><i class="fa fa-fw fa-times"><\/i>Closed<\/span><\/li>';f=n.category!=null&&n.category!==""?n.type!=null&&n.type!==""?'<li><span class="badge calendar-'+n.category+'-tag">'+n.category+'<i class="fa fa-fw fa-chevron-right"><\/i>'+n.type+"<\/span><\/li>":'<li><span class="badge calendar-'+n.category+'-tag">'+n.category+"<\/span><\/li>":"";e=n.location!=null&&n.location!==""?'<li><span class="badge"><i class="fa fa-fw fa-map-marker"><\/i>'+n.location+"<\/span><\/li>":"";t.popover({content:"<h1>"+n.title+"<small><br/>"+r+'<\/small><\/h1> <hr/><ul class="calendar-popup-content">'+u+f+e+"<ul>",trigger:"hover",placement:"bottom",container:"body",html:!0}).on("show.bs.popover",function(){$(".menu-day").remove();$(".menu-event").remove()})},s=function(n,t){if(n.objectName==="Event"){$(".popover").remove();$(".menu-day").remove();$(".menu-event").remove();$("body").append('<ul class="dropdown-menu menu-event">'+(n.canEdit?'<li><a class="menu-event-edit" data-id="'+n.id+'"><i class="fa fa-fw fa-pencil"><\/i> Edit<\/a><\/li>'+(n.open?'<li><a class="menu-event-close" data-id="'+n.id+'" data-name="'+n.title+'"><i class="fa fa-fw fa-times"><\/i> Close<\/a><\/li>':"")+'<li><a class="menu-event-hide" data-id="'+n.id+'" data-name="'+n.title+'"><i class="fa fa-fw fa-times"><\/i> Hide<\/a><\/li>'+(n.open?'<li><a class="menu-event-closehide" data-id="'+n.id+'" data-name="'+n.title+'"><i class="fa fa-fw fa-times"><\/i> Close and Hide<\/a><\/li>':"")+"<hr/>":"")+'<li><a class="menu-event-outlook" data-id="'+n.id+'" data-name="'+n.title+'"><i class="fa fa-fw fa-download"><\/i> Export to Outlook<\/a><\/li><\/ul>');$(".menu-event").css({left:t.pageX,top:t.pageY});$(".menu-event-edit").on("click",function(){window.location="#event/edit/"+$(this).data("id");$(".menu-event").dropdown("toggle")});$(".menu-event-close").on("click",function(){var n=$(this).data("id"),t=$(this).data("name");f.dialog.showMessage("Are you sure you want to close this event?","You are about to close "+t+"!",["Close Event","Go Back"]).then(function(i){if(i=="Close Event"){$.post(ARMS.getAddress()+"Event/CloseEvent",{id:n},function(){ARMS.Gritter.success(t+" has been closed.")});var f=ko.utils.unwrapObservable(u.filteredEvents),e=_.find(f,function(t){return t.id==n});e.open=!1;r.fullCalendar("removeEvents");r.fullCalendar("addEventSource",f);r.fullCalendar("rerenderEvents")}$(".menu-event").remove()})});$(".menu-event-hide").on("click",function(){var n=$(this).data("id"),t=$(this).data("name");f.dialog.showMessage("Are you sure you want to hide this event? Hidden events are not visible or accessible to the average ARMS user.","You are about to hide "+t+"!",["Hide Event","Go Back"]).then(function(i){if(i=="Hide Event"){$.post(ARMS.getAddress()+"Event/DeactivateEvent",{id:n},function(){ARMS.Gritter.success(t+" has been hidden.")});var f=ko.utils.unwrapObservable(u.filteredEvents);f=_.reject(f,function(t){return t.id==n});r.fullCalendar("removeEvents");r.fullCalendar("addEventSource",f);r.fullCalendar("rerenderEvents")}$(".menu-event").remove()})});$(".menu-event-closehide").on("click",function(){var n=$(this).data("id"),t=$(this).data("name");f.dialog.showMessage("Are you sure you want to close and hide this event? Hidden events are not visible or accessible to the average ARMS user.","You are about to close and hide "+t+"!",["Close and Hide Event","Go Back"]).then(function(i){if(i=="Close and Hide Event"){$.post(ARMS.getAddress()+"Event/CloseAndDeactivateEvent",{id:n},function(){ARMS.Gritter.success(t+" has been closed and hidden.")});var f=ko.utils.unwrapObservable(u.filteredEvents);f=_.reject(f,function(t){return t.id==n});r.fullCalendar("removeEvents");r.fullCalendar("addEventSource",f);r.fullCalendar("rerenderEvents")}$(".menu-event").remove()})});$(".menu-event-outlook").on("click",function(){var t=$(this).data("id"),n=$(this).data("name");$.post(ARMS.getAddress()+"Calendar/CreateOutlookEvent",{id:t,name:n},function(t){window.location.replace("data:text/calendar;download='"+n+".ics';charset=utf8,"+escape(t))});$(".menu-event").remove()});$(".menu-event").dropdown("toggle");$(".menu-event").zIndex($(".menu-event").zIndex()+1)}return!1},h=function(n,t){$(".menu-event").remove();$(".menu-day").remove();$("body").append('<ul class="dropdown-menu menu-day"><li><a class="menu-day-add" data-start="'+n.format("MM-DD-YYYY")+'"><i class="fa fa-fw fa-plus"><\/i> Add Event<\/a><\/li><\/ul>');$(".menu-day-add").on("click",function(){window.location="#event/add/"+$(this).data("start")});return $(".menu-day").css({left:t.pageX,top:t.pageY}),$(".menu-day").dropdown("toggle"),$(".menu-day").zIndex($(".menu-day").zIndex()+1),!1};$(n).fullCalendar({eventSources:[{events:ko.utils.unwrapObservable(u.filteredEvents)}],timezone:"UTC",header:u.header,editable:u.editable,lazyFetching:u.lazyFetching,eventRender:o,dayRender:function(){},eventClick:function(){$(".menu-day").remove();$(".menu-event").remove()},dayClick:function(){$(".menu-day").remove();$(".menu-event").remove()},eventRightclick:s,dayRightclick:h})},update:function(n,t){var i=t(),r=ko.utils.unwrapObservable(i.filteredEvents);$(n).fullCalendar("removeEvents");$(n).fullCalendar("addEventSource",r);$(n).fullCalendar("rerenderEvents")}};ko.extenders.withPrevious=function(n){return n.previous=ko.observableArray([]),n.changed=ko.computed(function(){return n()!==n.previous()}),n.subscribe(function(t){n.previous(t)},null,"beforeChange"),n};ko.bindingHandlers.uniqueId={init:function(n,t){var i=t();i=i||ko.bindingHandlers.uniqueId.prefix+ ++ko.bindingHandlers.uniqueId.counter;n.id=i},counter:0,prefix:"unique"};ko.bindingHandlers.uniqueFor={init:function(n,t){var i=t();i=i||ko.bindingHandlers.uniqueId.prefix+ ++ko.bindingHandlers.uniqueId.counter;n.setAttribute("for",i)}};ko.bindingHandlers.gridster={update:function(n,t){var i=t()||{},f=FACTRAX.getAddress()+(i.isSystemBoardPreview?"api/v1/web/systemboard/update-tiles":"api/v1/web/dashboard/set"),r=$(n).gridster($.extend({widget_margins:[10,10],widget_base_dimensions:[200,200],min_cols:6,max_cols:100,autogrow_cols:!0,extra_rows:1,extra_cols:1,helper:"clone",draggable:{enabled:!0,start:function(n){FACTRAX.tileDragged=!0;var t=function(){$(n.target).trigger("mouseup")};$("body").mouseleave(t);$(n.target).data("gridsterCancelDrag",t)},stop:function(n){var t=$(n.target).data("gridsterCancelDrag");t&&($("body").off("mouseleave",t),$(n.target).removeData("gridsterCancelDrag"));$.ajax({type:"POST",contentType:"application/json",url:f,data:ko.mapping.toJSON(this.serialize())});i.isSystemBoardPreview?i.app.trigger("dashboardPreview:tileMoved"):i.app.trigger("dashboard:tileMoved")}},serialize_params:function(n,t){return{id:$(t.el[0]).data("tileid"),col:t.col,row:t.row,size_x:t.size_x,size_y:t.size_y}}},i.options)).data("gridster"),e=function(n){r.resize_widget(n.tile,n.size_x,n.size_y,function(){$.ajax({type:"POST",contentType:"application/json",url:f,data:ko.mapping.toJSON(this.serialize())});FACTRAX.textfill()})},o=function(n){r.remove_widget(n.tile);i.removeHandler&&i.removeHandler(n)},u=i.app,s=i.isSystemBoardPreview?[u.on("dashboardPreview:resizeTile").then(e),u.on("dashboardPreview:removeTile").then(o)]:[u.on("dashboard:resizeTile").then(e),u.on("dashboard:removeTile").then(o)];ko.utils.domNodeDisposal.addDisposeCallback(n,function(){$.each(s,function(n,t){t.off()});$(n).children().each(function(n,t){r.remove_widget(t,!0)});r.destroy()})}};ko.bindingHandlers.icheck={init:function(n,t,i){var s=_.find(n.className.split(/\s+/),function(n){return n.lastIndexOf("icheckbox_",0)===0})||"icheckbox_square-blue",u=$(n),r=i(),h=function(){if(ko.isWriteableObservable(r.enable)&&r.enable(u.is(":enabled")),ko.isWriteableObservable(r.disable)&&r.disable(u.is(":disabled")),ko.isWriteableObservable(r.checked))if(r.checked.push){var t=_.has(r,"checkedValue")?ko.unwrap(r.checkedValue):_.has(r,"value")?ko.unwrap(r.value):n.value;u.is(":checked")?_.contains(r.checked(),t)||r.checked.push(t):r.checked.remove(t)}else r.checked(u.is(":checked"));r.click&&r.click()},c=$.extend(!0,{checkboxClass:s,radioClass:s||"icheckbox_square-blue",increaseArea:"20%"},ko.unwrap(t())),o,f,e;u.iCheck(c).on("ifChanged",h);o=setTimeout.bind(window,u.iCheck.bind(u,"update"),0);f=[];_.chain(r).pick(["enable","disable","checked"]).filter(function(n){return n&&ko.isObservable(n)&&!n.push}).each(function(n){f.push(n.subscribe(o))});o();r.checked&&ko.isObservable(r.checked)&&r.checked.push&&(e=function(){var t=_.has(r,"checkedValue")?ko.unwrap(r.checkedValue):_.has(r,"value")?ko.unwrap(r.value):n.value,i=ko.unwrap(r.checked);_.contains(i,t)?u.iCheck("check"):u.iCheck("uncheck")},e=setTimeout.bind(window,e.bind(u),0),f.push(r.checked.subscribe(e)));ko.utils.domNodeDisposal.addDisposeCallback(n,function(){u.iCheck("destroy");_.each(f,function(n){n.dispose()});f.length=0;u.off(h)})}};ko.bindingHandlers.infoboxTemplateForMapCanvas={init:function(n,t,i,r,u){return ko.bindingHandlers.template.init(n,t,i,r,u)},update:function(n,t,i,r,u){function f(n,t,i){var f,h,c=!1,r,e,u,l,a,o,s;i.entity&&((t||(t=i.entity.map),i.entity.location&&!$.isArray(i.entity.location)&&i.entity.location.latitude&&i.entity.location.longitude?(r=new Microsoft.Maps.Location(i.entity.location.latitude,i.entity.location.longitude),e=t.tryLocationToPixel(r,Microsoft.Maps.PixelReference.page)):i.entity.clickedPixel&&i.entity.clickedPixel.x&&i.entity.clickedPixel.y?(e=i.entity.clickedPixel,r=t.tryPixelToLocation(new Microsoft.Maps.Point(i.entity.clickedPixel.x,i.entity.clickedPixel.y),Microsoft.Maps.PixelReference.page),c=!0):(r=new Microsoft.Maps.Location(i.entity.clicklatitude,i.entity.clicklongitude),e=t.tryLocationToPixel(r,Microsoft.Maps.PixelReference.page)),u=t.getBounds(),r.latitude>u.getNorth()||r.latitude<u.getSouth()||u.getWest()<u.getEast()&&(r.longitude>u.getEast()||r.longitude<u.getWest())||u.getWest()>=u.getEast()&&r.longitude>u.getEast()&&r.longitude<u.getWest())||(l=$('div[role="navigation"]'),a=$(n).height()+l.outerHeight(),h=e.y<a?0:-$(n).height(),f=e.x>t.getWidth()-$(n).width()?-$(n).width()+50:-25,o=$(n).find(".top-stalk"),s=$(n).find(".bottom-stalk"),f===-25&&h<0?(o.hide(),s.show(),s.css({"background-image":"url("+FACTRAX.getAddress()+"Content/images/map/infobox_stalk_br.png)","background-position":"left"})):f===-25&&h>=0?(o.show(),s.hide(),o.css({"background-image":"url("+FACTRAX.getAddress()+"Content/images/map/infobox_stalk_tr.png)","background-position":"left"})):f<-25&&h<0?(o.hide(),s.show(),s.css({"background-image":"url("+FACTRAX.getAddress()+"Content/images/map/infobox_stalk_bl.png)","background-position":"right"})):(o.show(),s.hide(),o.css({"background-image":"url("+FACTRAX.getAddress()+"Content/images/map/infobox_stalk_tl.png)","background-position":"right"})),c&&(e.y=e.y+10,f=f==-25?f+10:f),$(n).css({left:e.x+f,top:e.y+h})))}ko.bindingHandlers.template.update(n,t,i,r,u);f(n,r.map(),r.infoBox)}};ko.bindingHandlers.infoboxTemplate={init:function(n,t,i,r,u){return ko.bindingHandlers.template.init(n,t,i,r,u)},update:function(n,t,i,r,u){function f(n,t){var o=0,s=0,f,e;if(r.entity){var u=new Microsoft.Maps.Location(r.entity.latitude,r.entity.longitude),h=t.tryLocationToPixel(u,Microsoft.Maps.PixelReference.control),i=t.getBounds();u.latitude>i.getNorth()||u.latitude<i.getSouth()||i.getWest()<i.getEast()&&(u.longitude>i.getEast()||u.longitude<i.getWest())||i.getWest()>=i.getEast()&&u.longitude>i.getEast()&&u.longitude<i.getWest()||(f=$(n).find(".top-stalk"),e=$(n).find(".bottom-stalk"),o===-24&&s<0?(f.hide(),e.show(),e.css({"background-image":"url("+FACTRAX.getAddress()+"Content/images/map/infobox_stalk_br.png)","background-position":"left"})):o===-24&&s>=0?(f.show(),e.hide(),f.css({"background-image":"url("+FACTRAX.getAddress()+"Content/images/map/infobox_stalk_tr.png)","background-position":"left"})):o<-24&&s<0?(f.hide(),e.show(),e.css({"background-image":"url("+FACTRAX.getAddress()+"Content/images/map/infobox_stalk_bl.png)","background-position":"right"})):(f.show(),e.hide(),f.css({"background-image":"url("+FACTRAX.getAddress()+"Content/images/map/infobox_stalk_tl.png)","background-position":"right"})),$(n).css({left:h.x+40,top:h.y+120}))}}ko.bindingHandlers.template.update(n,t,i,r,u);f(n,ko.unwrap(r.map))}};ko.bindingHandlers.iradio={applyStyle:function(n,t){var i=$(n);t===!0&&(t={});t=$.extend(!0,{radioClass:"radio radio-square-blue"},t);i.uniform(t)},uniqueIndex:0,init:function(n,t,i){var e=$(n),o=i(),u,r,s,f;n.name&&n.name.substring(0,10)!=="ko_unique_"||(u=o.checked,ko.isObservable(u)&&(r=u._unique_radio_group_name_,r||(r="_unique_radio_group_name_"+ ++ko.bindingHandlers.iradio.uniqueIndex,u._unique_radio_group_name_=r),ko.utils.setElementName(n,r)));ko.bindingHandlers.iradio.applyStyle(n,ko.toJS(t()));s=function(){setTimeout(function(){$.uniform.update(e)},0)};f=[];_.chain(o).pick(["enable","disable","checked"]).filter(function(n){return n&&ko.isObservable(n)}).each(function(n){f.push(n.subscribe(s))});ko.utils.domNodeDisposal.addDisposeCallback(n,function(){$.uniform.restore(e);_.each(f,function(n){n.dispose()});f.length=0})}};ko.bindingHandlers.masked={init:function(n,t,i){var r=ko.unwrap(i().mask||{});$(n).mask(r);ko.utils.registerEventHandler(n,"change",function(){var i=t();i($(n).val())})},update:function(n,t){var i=ko.utils.unwrapObservable(t());$(n).val(i)}};ko.bindingHandlers.mask={update:function(n,t){var i=ko.unwrap(t());$(n).mask(i)}};ko.bindingHandlers.money={update:function(n,t,i){var r=ko.utils.unwrapObservable(t()),u=i().moneyOptions;$(n).html(accounting.formatMoney(r,u))}};ko.bindingHandlers.moneyInput={init:function(n,t,i){var u=$(n),r;ko.utils.registerEventHandler(n,"keydown",function(n){if(n.keyCode===8){var i=u.val(),t=i.indexOf("."),f=u[0].selectionStart;t>=0&&f<=t&&Math.abs(u.autoNumeric("get"))==0&&(n.preventDefault(),u.val(""));r()}});ko.utils.registerEventHandler(n,"keyup",function(n){n.keyCode===8&&r()});$(n).autoNumeric("init",$.extend({},$.fn.autoNumeric.defaults,{aSign:"$",mDec:"2",vMin:"-9999999999999.99",vMax:"9999999999999.99",lZero:"deny"},i().autoNumericOptions||{}));r=function(){var i=t(),u=$(n).autoNumeric("get"),r=parseFloat(u);isNaN(r)?i(null):i(r)};ko.utils.registerEventHandler(n,"focusout",r);ko.utils.registerEventHandler(n,"keypress",r)},update:function(n,t){var i=ko.utils.unwrapObservable(t());i!==null&&i!==undefined&&i!==""?((typeof i=="string"||i instanceof String)&&(i=parseFloat(i.replace(/[-^\d.]/g,""))),isNaN(i)&&(i=null),i!==parseFloat($(n).autoNumeric("get"))&&$(n).autoNumeric("set",i)):$(n).autoNumeric("set","")}},function(){var n=function(n){return n===null?null:"$"+n.toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g,"$1,")},t=function(t,i){var r=$(t),u,f=ko.unwrap(i());return u=r.is(":input")?"val":"text",r[u](n(f))};ko.bindingHandlers.money2={update:t}}();ko.bindingHandlers.moreInfo={init:function(n,t){var i=$.extend({},{placement:"bottom",trigger:"hover focus",title:"More Info",container:"#routerWindow","ftx-icon":"fa-info-circle","ftx-link":null},ko.utils.unwrapObservable(t())||{}),r=i["ftx-link"]?'<a title="More Info" class="popover-trigger" href="'+i["ftx-link"].href+'" target="'+(i["ftx-link"].target||"_self")+'"><i title="More Info" class="fas hover-moreinfo '+i["ftx-icon"]+'"><\/i><\/a>':'<span title="More Info" class="popover-trigger" tabindex="0"><i title="More Info" class="fas hover-moreinfo '+i["ftx-icon"]+'"><\/i><\/span>';$(n).append(r).addClass("moreinfo-wrapper").popover(i)}};ko.bindingHandlers.moreInfoCheckbox={init:function(n,t){var r={placement:"bottom",html:!0,trigger:"hover focus",title:ko.utils.unwrapObservable(t()).title||"More Info",container:"#routerWindow","ftx-icon":"fa-info-circle"},i=$.extend({},r,ko.utils.unwrapObservable(t())||{}),u=i["ftx-link"]?'<a class="popover-trigger" href="'+i["ftx-link"].href+'" target="'+(i["ftx-link"].target||"_self")+'"><i class="fas '+i["ftx-icon"]+' hover-moreinfo"><\/i><\/a>':'<span class="popover-trigger" tabindex="0"><i class="fas '+i["ftx-icon"]+' hover-moreinfo"><\/i><\/span>',f=$(u);$(n).append(f).popover(i)}};ko.bindingHandlers.moreInfoChecklist={init:function(n,t){var i=$.extend({},{placement:"bottom",trigger:"hover focus",title:"More Info",container:"#routerWindow"},ko.utils.unwrapObservable(t())||{}),r=i.iconColor?'<span class="popover-trigger" tabindex="0"><i class="fa fa-exclamation-triangle '+i.iconColor+' fa-lg hover-moreinfo"><\/i><\/span>':i.subordinateQuestion?'<span class="popover-trigger" tabindex="0"><i class="fa fa-question-circle fa-lg hover-moreinfo" style="top: 0px; padding-bottom: 0px;"><\/i><\/span>':'<span class="popover-trigger" tabindex="0"><i class="fa fa-question-circle fa-lg hover-moreinfo"><\/i><\/span>';$(n).append(r).addClass("moreinfo-wrapper").popover(i)}};ko.bindingHandlers.moreInfoShowMore={init:function(n,t){var i=$.extend({},{placement:"bottom",trigger:"hover focus",title:"More Info",container:"#routerWindow"},ko.utils.unwrapObservable(t())||{});$(n).append('<span class="popover-trigger"><a data-bind="click: showMoreFn" href="javascript:void(0);">(Show More)<\/a><\/span>').addClass("moreinfo-wrapper").popover(i)}};ko.bindingHandlers.numeric={init:function(n,t,i){$(n).autoNumeric("init",$.extend({},$.fn.autoNumeric.defaults,{aSep:"",vMax:"9999999999999.99"},i().autoNumericOptions||{}));var r=function(){var i=t(),u=$(n).autoNumeric("get"),r=parseFloat(u);isNaN(r)?i(null):i(r)},u=ko.unwrap(t());u&&$(n).autoNumeric("set",u);ko.utils.registerEventHandler(n,"focusout",r);ko.utils.registerEventHandler(n,"keypress",r)},update:function(n,t){var i=ko.utils.unwrapObservable(t());isNaN(i)&&(i=null);i!==parseFloat($(n).autoNumeric("get"))&&($(n).is("textarea")||$(n).is("input")?$(n).val(i):$(n).autoNumeric("set",i))}},function(){var n={};n.passwordConfig={};n.USERNAME_CLASS="pwstrength-username";n.INPUT_CLASS="pwstrength-input";n.PHONE_CLASS="pwstrength-phone";n.ZXCVBN_TERMS=["Grants","Portal","Grant","FEMA","Public","Assistance","Emergency","Declaration","Grantee","Recipient","Applicant","RPA","Request","Federal","Management","Agency","Password","Admin","Administrator","patraining123!","patraining"];n.getPasswordConf=function(t){return t in n.passwordConfig||(n.passwordConfig[t]={inputs:{},addInput:function(n,t){t=t||"Input";_.contains(this.inputs,n)||(t in this.inputs||(this.inputs[t]=[]),this.inputs[t].push(n))},passwordInput:null,options:{}}),n.passwordConfig[t]};ko.bindingHandlers.passwordMeter={init:function(t,i){var u=i(),r=n.getPasswordConf(u.password),f;r.passwordInput=$(t);f={};f.common={usernameField:"."+n.USERNAME_CLASS,zxcvbn:!0,zxcvbnTerms:$.merge([],n.ZXCVBN_TERMS),userInputs:["."+n.INPUT_CLASS],onScore:function(n,t,i){return i}};f.ui={progressExtraCssClasses:"pwstrength-progress",colorClasses:["weak","weak","weak","medium","strong","very-strong"]};r.options=f;$.post(FACTRAX.getAccountAPIAddress()+"/getbannedpasswords",{personnelId:u.personnelId,tempKey:u.tempKey,resetKey:u.resetKey}).done(function(n){n.BannedPasswords&&$.each(n.BannedPasswords,function(n,t){t.List&&t.List.length!=0&&(r.options.common.zxcvbnTerms=r.options.common.zxcvbnTerms.concat(t.List),u.password=u.password.extend({validation:[{validator:function(i){if(i===undefined||i===null)return!0;var u=[];return(n in r.inputs&&$.each(r.inputs[n],function(n,t){var i=$(t).val();i||(i=$(t).text());i&&u.push(i)}),t.List&&t.List.length>0&&(u=u.concat(t.List)),u.length==0)?!0:!_.contains(u,i.toString())},message:t.ErrorMessage.toString()}]}))});n.WeakPasswords&&$.each(n.WeakPasswords,function(n,t){r.options.common.zxcvbnTerms.push(t);var i=t.toString().toLowerCase().match(/\w+|\d+/g);$.each(i,function(n,t){r.options.common.zxcvbnTerms.push(t)})})}).always(function(){r.passwordInput.pwstrength(r.options);var n=u.password();(n==null||n.length==0)&&$(".pwstrength-progress").css({display:"none"});u.isValidationLoaded(!0)})},update:function(n,t){var r=t(),i=r.password();i!=null&&i.length>0?$(".pwstrength-progress").slideDown():$(".pwstrength-progress").slideUp()}};ko.bindingHandlers.passwordMeterInput={init:function(t,i){var r=i(),u=n.getPasswordConf(r);u.addInput(t);$(t).addClass(n.INPUT_CLASS);$(t).on("change",function(){if(u.passwordInput!==null){u.passwordInput.pwstrength("forceUpdate");var n=r();n&&(r(" "),r(n))}})},update:function(){}};ko.bindingHandlers.passwordMeterPhone={init:function(t,i){var r=i(),u=n.getPasswordConf(r);u.addInput(t);$(t).addClass(n.INPUT_CLASS);$(t).addClass(n.PHONE_CLASS);$(t).on("change",function(){if(u.passwordInput!==null){u.passwordInput.pwstrength("forceUpdate");var n=r();n&&(r(" "),r(n))}})},update:function(){}};ko.bindingHandlers.passwordMeterUsername={init:function(t,i){var r=i(),u=n.getPasswordConf(r);u.addInput(t,"Usernames");$(t).addClass(n.INPUT_CLASS);$(t).on("change",function(){if(u.passwordInput!==null){u.passwordInput.pwstrength("forceUpdate");var n=r();n&&(r(" "),r(n))}})},update:function(){}};ko.bindingHandlers.passwordMeterEmail={init:function(t,i){var r=i(),u=n.getPasswordConf(r);u.addInput(t,"Emails");$(t).addClass(n.INPUT_CLASS);$(t).on("change",function(){if(u.passwordInput!==null){u.passwordInput.pwstrength("forceUpdate");var n=r();n&&(r(" "),r(n))}})},update:function(){}};n.US_STATES=[{name:"Alabama",abbreviation:"AL"},{name:"Alaska",abbreviation:"AK"},{name:"American Samoa",abbreviation:"AS"},{name:"Arizona",abbreviation:"AZ"},{name:"Arkansas",abbreviation:"AR"},{name:"California",abbreviation:"CA"},{name:"Colorado",abbreviation:"CO"},{name:"Connecticut",abbreviation:"CT"},{name:"Delaware",abbreviation:"DE"},{name:"District Of Columbia",abbreviation:"DC"},{name:"Federated States Of Micronesia",abbreviation:"FM"},{name:"Florida",abbreviation:"FL"},{name:"Georgia",abbreviation:"GA"},{name:"Guam",abbreviation:"GU"},{name:"Hawaii",abbreviation:"HI"},{name:"Idaho",abbreviation:"ID"},{name:"Illinois",abbreviation:"IL"},{name:"Indiana",abbreviation:"IN"},{name:"Iowa",abbreviation:"IA"},{name:"Kansas",abbreviation:"KS"},{name:"Kentucky",abbreviation:"KY"},{name:"Louisiana",abbreviation:"LA"},{name:"Maine",abbreviation:"ME"},{name:"Marshall Islands",abbreviation:"MH"},{name:"Maryland",abbreviation:"MD"},{name:"Massachusetts",abbreviation:"MA"},{name:"Michigan",abbreviation:"MI"},{name:"Minnesota",abbreviation:"MN"},{name:"Mississippi",abbreviation:"MS"},{name:"Missouri",abbreviation:"MO"},{name:"Montana",abbreviation:"MT"},{name:"Nebraska",abbreviation:"NE"},{name:"Nevada",abbreviation:"NV"},{name:"New Hampshire",abbreviation:"NH"},{name:"New Jersey",abbreviation:"NJ"},{name:"New Mexico",abbreviation:"NM"},{name:"New York",abbreviation:"NY"},{name:"North Carolina",abbreviation:"NC"},{name:"North Dakota",abbreviation:"ND"},{name:"Northern Mariana Islands",abbreviation:"MP"},{name:"Ohio",abbreviation:"OH"},{name:"Oklahoma",abbreviation:"OK"},{name:"Oregon",abbreviation:"OR"},{name:"Palau",abbreviation:"PW"},{name:"Pennsylvania",abbreviation:"PA"},{name:"Puerto Rico",abbreviation:"PR"},{name:"Rhode Island",abbreviation:"RI"},{name:"South Carolina",abbreviation:"SC"},{name:"South Dakota",abbreviation:"SD"},{name:"Tennessee",abbreviation:"TN"},{name:"Texas",abbreviation:"TX"},{name:"Utah",abbreviation:"UT"},{name:"Vermont",abbreviation:"VT"},{name:"Virgin Islands",abbreviation:"VI"},{name:"Virginia",abbreviation:"VA"},{name:"Washington",abbreviation:"WA"},{name:"West Virginia",abbreviation:"WV"},{name:"Wisconsin",abbreviation:"WI"},{name:"Wyoming",abbreviation:"WY"}];$.each(n.US_STATES,function(t,i){n.ZXCVBN_TERMS.push(i.name);n.ZXCVBN_TERMS.push(i.abbreviation)})}(),function(){var n=function(n){return n===null?null:(n*100).toFixed(2)+"%"},t=function(t,i){var r=$(t),u,f=ko.unwrap(i());return u=r.is(":input")?"val":"text",r[u](n(f))};ko.bindingHandlers.percent={update:t}}();ko.extenders.persist=function(n,t){return t.manager.bindSettingToObservable(n,t.key),n};ko.bindingHandlers.plot={init:function(n,t){var i=ko.unwrap(t()),u=ko.unwrap(i.data)||[],f=ko.unwrap(i.options)||{},r=$.plot($(n),u,f);$(n).data("plot",r);ko.isObservable(i.plotAccessor)&&i.plotAccessor(r)},update:function(n,t){var i=ko.unwrap(t()),r=ko.unwrap(i.data)||[],u=ko.unwrap(i.options)||{};$.plot($(n),r,u)}};ko.bindingHandlers.popover={init:function(n,t){var i=ko.utils.unwrapObservable(t());i.customCss?$(n).popover(i).data("bs.popover").tip().addClass(i.customCss):$(n).popover(i);i.show&&$(n).popover("show")}};ko.bindingHandlers.showPopover={init:function(n,t){var i=t();i.trigger="manual";$(n).popover(i);i.isShown()&&$(n).popover("show");i.isShown.subscribe(function(t){$(n).popover(t?"show":"hide")})}};ko.bindingHandlers.processingIndicator={init:function(n,t){var i=ko.utils.unwrapObservable(t())},update:function(n,t){var u=ko.utils.unwrapObservable(t());if(u){$(n).addClass("processing-indicator");var i=$("<div />"),r=$("<h1 id='processing-indicator' />").text(" Loading..."),f=$('<i class="fa fa-refresh fa-spin"><\/i>');r.prepend(f);i.append(r);$(n).append(i);$(n).find(".icon-spin").addClass("active");$(n).animate({top:0},400,"swing")}else $(n).animate({top:"-80px"},400,"swing",function(){$(n).find(".icon-spin").addClass("active");$(n).empty()})}};ko.bindingHandlers.progressTrack={init:function(n,t){var s=t(),r,f=null,h,u,i,o,e,c,l;if(ko.isObservable(s)&&!_.has(s(),"currentStepIndex")?(r=s,f={currentStepIndex:r}):(f=ko.unwrap(s),r=f.currentStepIndex),!r||!ko.isObservable(r))throw"could not find observable currentStepIndex";if(h=$(n),u=h.find("ul, ol"),u.length!==1)throw"The element with the progressTrack binding must contain a single <ul> or <ol> element with <li> nodes for each step";u.addClass("progress-track text-center");i=u.find("li");o=i.length;i.addClass("col-sm-3");i.width(100/o+"%");e=h.find("div.progress");e.length<1?(e=$('<div class="progress progress-track-bar"><div class="progress-bar"><\/div><\/div>'),e.insertBefore(u)):e.addClass("progress-track-bar");c=function(n){e.find("div.progress-bar").width(50/o*(n+n+1)+"%");u.find("li").each(function(t,i){$(i).toggleClass("active",t===n);$(i).toggleClass("complete",t<n);$(i).find("a").toggleClass("disabled",t>n)})};l=function(){i=u.find("li");o=i.length;i.addClass("col-sm-3");i.width(100/o+"%");c(r())};_.delay(l,10);r.subscribe(c);_.has(f,"steps")&&ko.isObservable(f.steps)&&f.steps.subscribe(_.debounce(l,10))}},function(n){typeof define=="function"&&define.amd?define(["jquery","knockout","module"],n):n(jQuery,ko)}(function(n,t,i){"use strict";function l(i,r){var u=t.isObservable(r),f;u&&(f=r.equalityComparer,r.equalityComparer=function(){return!0});n(i).trigger("change");u&&(r.equalityComparer=f)}function y(i,r,y){var p=y(),st=n.extend({},v,{closeOnSelect:t.isWriteableObservable(p[e])?!1:undefined},t.unwrap(r())),k=!1,d=null,w=null,g=!1,b,tt,it,rt,ut,nt;n(i).on("select2:selecting select2:unselecting",function(){k=!0});n(i).on("select2:select select2:unselect",function(){k=!1});if(p[a]){b=[];n(i).on("select2:closing",function(){if(b.length===0){var t=n(window).height();_.each([".wrapper-scroll",".modal"],function(i){var r=n('<div aria-hidden="true"><\/div>').height(t);n(i).append(r);b.push(r)})}});n(i).on("select2:close",function(){b.length>0&&setTimeout(function(){_.each(b,function(n){n.remove()});b=[]},1)})}if(t.isObservable(p.value)?w=p.value.subscribe(function(){k||l(i,this._target||this.target)}):t.isObservable(p.selectedOptions)?w=p.selectedOptions.subscribe(function(){k||l(i,this._target||this.target)}):t.isObservable(p[u])?(tt=function(t){n(i).val(t).trigger("change")},tt(p[u]()),w=p[u].subscribe(tt)):t.isObservable(p[f])?(it=function(t){var r=g&&n(i).select2("data"),u=r&&r.length?_.map(r,function(n){return parseInt(n.id)}):[];(_.difference(t,u).length!==0||_.difference(u,t).length!==0)&&n(i).val(t).trigger("change")},it(p[f]()),w=p[f].subscribe(it)):t.isObservable(p[e])?(rt=function(t){var r=g&&n(i).select2("data"),u=r&&r.length?_.map(r,function(n){return parseInt(n.id)}):[];(_.difference(t,u).length!==0||_.difference(u,t).length!==0)&&n(i).val(t).trigger("change")},rt(p[e]()),w=p[e].subscribe(rt)):t.isObservable(p[o])&&(ut=function(t){var r=g&&n(i).select2("data")[0];r&&t&&r.text===t.text&&r.id===t.id||(n(i).empty(),t&&n(i).append(new Option(t.text,t.id,!0,!0)))},ut(p[o]()),w=p[o].subscribe(ut)),t.isWriteableObservable(p[s])||t.isWriteableObservable(p[h])||t.isWriteableObservable(p[u])||t.isWriteableObservable(p[f])||t.isWriteableObservable(p[c])||t.isWriteableObservable(p[o])){d=function(){var r,e,l;n(i).data("select2")&&(r=n(i).select2("data"),t.isWriteableObservable(p[s])&&(e=n(i).select2("data"),p[s](e)),t.isWriteableObservable(p[h])&&(e=r&&r.length?r[0].text:null,p[h](e)),t.isWriteableObservable(p[u])&&(l=r&&r.length?parseInt(r[0].id):null,e=isNaN(l)?null:l,p[u](e)),t.isWriteableObservable(p[f])&&(e=r&&r.length?_.map(r,function(n){return parseInt(n.id)}):[],p[f](e)),t.isWriteableObservable(p[c])&&(e=r&&r.length?r[0].id:null,p[c](e)),t.isWriteableObservable(p[o])&&(e=r.length?n.map(r,function(n){return{id:n.id,text:n.text}})[0]:null,p[o](e)))};n(i).on("change",d)}var ft=!1,et=!1,ot=function(){if(et&&n(i).data("select2")){var t=n(i).select2("data"),r=t&&t.length?_.map(t,function(n){return parseInt(n.id)}):[];p[e](r);et=!1}};if(t.isWriteableObservable(p[e])){n(i).on("change",function(){et=!0;ft||ot()});n(i).on("select2:open",function(){ft=!0;nt=n('<button class="btn btn-default select2-apply-btn">Apply Selection<\/button>');nt.click(function(){n(i).select2("close")});n(".select2-dropdown").append(nt)});n(i).on("select2:close",function(){nt.remove();ft=!1;ot()})}n(i).select2(st);g=!0;n(i).on("select2:opening",function(t){n(i).data("unselecting")&&(n(i).removeData("unselecting"),t.preventDefault());n(i).attr("disabled")&&t.preventDefault()}).on("select2:unselecting",function(){n(i).data("unselecting",!0)});t.utils.domNodeDisposal.addDisposeCallback(i,function(){n(i).select2("destroy");d!==null&&n(i).off("change",d);w!==null&&w.dispose()})}var r="select2";i&&i.config()&&i.config().name&&(r=i.config().name);var s=r+"Data",h=r+"Text",u=r+"UncheckedValue",f=r+"UncheckedSelectedOptions",e=r+"OnCloseSelectedOptions",c=r+"AjaxValue",o=r+"AjaxPair",a=r+"ScrollFix",v={width:"100%",minimumResultsForSearch:10};return t.bindingHandlers[r]={init:function(t){n(t).addClass("select2-binding");var i=arguments;setTimeout(function(){n(t).removeClass("select2-binding");y.apply(null,i)},0)}}});ko.bindingHandlers.option={update:function(n,t){var i=ko.utils.unwrapObservable(t());ko.selectExtensions.writeValue(n,i)}};ko.bindingHandlers.sharedStringText={init:function(n,t){var i=t(),r=i();typeof i=="function"&&FACTRAX.SharedStrings.getSharedStringForKey(r).done(function(t){var i=ko.observable(t);ko.bindingHandlers.text.update(n,i)})}};ko.bindingHandlers.sharedStringHtml={init:function(n,t){var i=t(),r=i();typeof i=="function"&&FACTRAX.SharedStrings.getSharedStringForKey(r).done(function(t){var i=ko.observable(t);ko.bindingHandlers.html.update(n,i)})}};ko.extenders.showIf=function(n,t){var i=n();return n.isShown=ko.isObservable(t)?t:ko.pureComputed(t,n),n.isShown.subscribe(function(t){t||n(i)}),n};ko.bindingHandlers.slickCarousel={init:function(n,t,i){var r,u;$(n).empty();r=ko.unwrap(t());r&&r.forEach(function(t){$outerDiv=$('<div class="slick-label">');$panelDiv=$('<div class="slick-panel">');$panelDiv.append(t.milestoneText);$outerDiv.append($panelDiv);$outerDiv.append(t.month);$(n).append($outerDiv)});u=i().slickCarouselOptions||{};_.delay(function(){$(n).slick(u)},200)},update:function(n,t){_.delay(function(){$(n).slick("slickRemove",null,null,!0);var i=ko.unwrap(t());i&&i.forEach(function(t){$outerDiv=$('<div class="slick-label">');$panelDiv=$('<div class="slick-panel">');$panelDiv.append(t.milestoneText);$outerDiv.append($panelDiv);$outerDiv.append(t.month);$(n).slick("slickAdd",$outerDiv)})},200)}};ko.bindingHandlers.slickCarouselMilestone={init:function(n,t,i){var r,u;$(n).empty();r=ko.unwrap(t());r&&r.forEach(function(t){$outerDiv=$('<div class="slick-label">');$panelDiv=$('<div class="slick-panel" style="background-color: #F3F3F4">');$timelineDiv=$('<div class="vertical-container light-timeline">');t.milestones.forEach(function(n){if($timelineBlockDiv=$('<div class="vertical-timeline-block"><\/div>'),n.Name){$timelineBlockContentDiv=$('<div class="vertical-timeline-content"><\/div>');$timelineBlockHeader=$("<h2>"+n.Name+"<\/h2>");$timelineBlockMilestoneText=$("<p>"+n.Description+"<\/p>");$timelineBlockDate=$('<span class="vertical-date"><small>'+FACTRAX.Tables.dateRenderer(n.Completion_Date)+"<\/small><\/span>");var t="primary",r="Event";(n.Event_Sector||n.Event_Branch)&&(t="success",r=n.Event_Sector?n.Event_Sector:n.Event_Branch);$timelineBlockSectorBranchBadge=$('<span style="margin-top: 3px" class="pull-right badge badge-'+t+'">'+r+"<\/span>");$timelineBlockContentDiv.append($timelineBlockHeader);n.Description&&$timelineBlockContentDiv.append($timelineBlockMilestoneText);$timelineBlockContentDiv.append($timelineBlockDate);$timelineBlockContentDiv.append($timelineBlockSectorBranchBadge)}else $timelineBlockContentDiv=$('<div class="alert alert-info"><p>No milestone data exists yet for this period.<\/p><p>Click <a href="#Event/milestones/'+i().slickCarouselEventId()+'">here<\/a> to add a new milestone to this event.<\/p><\/div>');$timelineBlockDiv.append($timelineBlockContentDiv);$timelineDiv.append($timelineBlockDiv)});$panelDiv.append($timelineDiv);$outerDiv.append($panelDiv);$outerDiv.append(t.month);$(n).append($outerDiv)});u=i().slickCarouselOptions||{};_.delay(function(){$(n).slick(u)},200)},update:function(n,t,i){var r=ko.unwrap(t());_.delay(function(){var u,t;$(n).slick("slickRemove",null,null,!0);r&&r.forEach(function(t){$outerDiv=$('<div class="slick-label">');$panelDiv=$('<div class="slick-panel" style="background-color: #F3F3F4">');$timelineDiv=$('<div class="vertical-container light-timeline">');t.milestones.forEach(function(n){if($timelineBlockDiv=$('<div class="vertical-timeline-block"><\/div>'),n.Name){$timelineBlockContentDiv=$('<div class="vertical-timeline-content"><\/div>');$timelineBlockHeader=$("<h2>"+n.Name+"<\/h2>");$timelineBlockMilestoneText=$("<p>"+n.Description+"<\/p>");$timelineBlockDate=$('<span class="vertical-date"><small>'+FACTRAX.Tables.dateRenderer(n.Completion_Date)+"<\/small><\/span>");var t="primary",i="Event";(n.Event_Sector||n.Event_Branch)&&(t="success",i=n.Event_Sector?n.Event_Sector:n.Event_Branch);$timelineBlockSectorBranchBadge=$('<span style="margin-top: 3px" class="pull-right badge badge-'+t+'">'+i+"<\/span>");$timelineBlockContentDiv.append($timelineBlockHeader);n.Description&&$timelineBlockContentDiv.append($timelineBlockMilestoneText);$timelineBlockContentDiv.append($timelineBlockDate);$timelineBlockContentDiv.append($timelineBlockSectorBranchBadge)}else $timelineBlockContentDiv=$('<div class="alert alert-info"><p>No milestone data exists yet for this period.<\/p><\/div>');$timelineBlockDiv.append($timelineBlockContentDiv);$timelineDiv.append($timelineBlockDiv)});$panelDiv.append($timelineDiv);$outerDiv.append($panelDiv);$outerDiv.append(t.month);$(n).slick("slickAdd",$outerDiv)});u=i().slickCarouselOptions||{};$(n).slick("slickSetOption",u,!0);t=ko.unwrap(i().milestoneSlickMaxPeriod)?_.indexOf(_.pluck(r,"month"),ko.unwrap(i().milestoneSlickMaxPeriod)):_.indexOf(_.pluck(r,"month"),moment().format("MMMM")+" "+moment().year());t>=2&&(t-=2);_.delay(function(){$(n).slick("slickGoTo",t,!0)},100)},200)}};ko.bindingHandlers.slimscroll={update:function(n,t){var i=ko.utils.unwrapObservable(t());$(n).addClass("slimScroll").slimscroll(i)}};ko.bindingHandlers.summernote={init:function(n,t){function s(n){var i=n.replace(/(\n|\r| class=(")?Mso[a-zA-Z]+(")?)/g," "),c=new RegExp("<!--(.*?)-->","g"),i=i.replace(c,""),u=new RegExp("<(/)*(meta|link|\\?xml:|st1:|o:|a)(.*?)>","gi"),r,f,o,s,e,t,h;for(i=i.replace(u,""),r=["style","script","applet","embed","noframes","noscript"],t=0;t<r.length;t++)u=new RegExp("<"+r[t]+".*?"+r[t]+"(.*?)>","gi"),i=i.replace(u,"");for(f=["start"],t=0;t<f.length;t++)o=new RegExp(" "+f[t]+'="(.*?)"',"gi"),i=i.replace(o,"");for(s=/<p\s+style="line-height:normal;tab-stops:65.55pt">\s*<br>\s*<\/p>/g,i=i.replace(s,""),e=["text-indent","mso-list"],t=0;t<e.length;t++)h=new RegExp(e[t]+':(.*?)(?=(;|"));?',"gi"),i=i.replace(h,"");return i}var e=t().options||{},i=t().content,r=t().saveEvent,o=t().saveButtonText,u=t().disableOnSave,f;self.SaveButton=function(n){var t=$.summernote.ui,i=function(){n.enable()},f=t.button({contents:'<i class="fa fa-fw fa-save"/>'+o,click:function(){function f(){this.disabled=!0}function e(){u?setTimeout(function(){r(i)},1e3):setTimeout(r,1e3)}function o(){this.disabled=!1}u&&n.disable();var t=$.Deferred();t.done(f()).done(e()).done(o())}});return f.render().removeClass("btn-default").addClass("btn-save")};f={toolbar:[["style",["style"]],["font",["bold","italic","underline","strikethrough","clear"]],["fontname",["fontname"]],["fontsize",["fontsize"]],["color",["color"]],["para",["ul","ol","paragraph"]],["hr",["hr"]],["custom",["save"]]],fontNames:["Arial","Arial Black","Calibri","Courier New","Helvetica","Impact","Roboto","Tahoma","Times New Roman","Verdana"],buttons:{save:self.SaveButton},height:300,disableDragAndDrop:!0,callbacks:{onInit:function(n){function r(){var t=$(n).summernote("code");return t==="<p><br><\/p>"||t===""}var t=$(n).next(),i=t.find(".note-placeholder");t.on("focusin focusout",".note-editable",function(n){r()&&i[n.type==="focusout"?"show":"hide"]()})}}};$(n).summernote($.extend(f,e));i()!==null&&$(n).summernote("code",i());$(n).on("summernote.change",function(){var t=$(n).summernote("code");i(t)});$(n).on("summernote.paste",function(){var n=$(this),t=function(n){var t=n.summernote("code"),i=s(t);n.summernote("code",i)};setTimeout(function(){t(n)},10)})}};ko.bindingHandlers.throttleClick={init:function(n,t,i,r,u){var f=ko.unwrap(i().throttleClickTicks)||600,e=function(){return{click:_.debounce(t(),f,!0)}};return ko.bindingHandlers.event.init.call(this,n,e,i,r,u)}},function(){function n(n){var u,r,t,f,i;if(!n||(n=n.replace(/\s/g,""),u=/^([0-9]{1,2}):?([0-9]{2})?(a|p|am|pm)?$/i,!u.test(n))||(r=u.exec(n),t=parseInt(r[1],10),t>23)||(f=r[2]?parseInt(r[2],10):0,f>59))return null;if(i=null,t>12||t==0){if(r[3])return null;i=t?"PM":"AM";t=Math.abs(t-12)}else r[3]?(i=r[3].toUpperCase(),i.length==1&&(i=i+"M")):i="AM";return("0"+t.toString()).substr(-2)+":"+("0"+f.toString()).substr(-2)+" "+i}ko.bindingHandlers.timepicker={init:function(t,i,r){ko.utils.registerEventHandler(t,"change",function(){var r=null,f=!1,u;t.value&&t.value.length>0&&(r=n(t.value),r||(f=!0));u=i();ko.isObservable(u)&&(f?t.value=u()||"":(u(r),t.value=r))});ko.bindingHandlers.validationCore.init(t,i,r)},update:function(t,i){var r=ko.utils.unwrapObservable(i());t.value=n(r)}}}();ko.bindingHandlers.tooltip={update:function(n,t){var i=ko.utils.unwrapObservable(t()),r;i.hasOwnProperty("title")&&i.title&&(r=!0,i.hasOwnProperty("enable")&&(r=ko.utils.unwrapObservable(i.enable)),$(n).tooltip("destroy"),r&&$(n).tooltip({placement:ko.utils.unwrapObservable(i.hasOwnProperty("placement")?i.placement:"bottom"),title:ko.utils.unwrapObservable(i.hasOwnProperty("title")?i.title:i),container:ko.utils.unwrapObservable(i.hasOwnProperty("container")?i.container:null)}))}};$(document).on("context_hide.vakata.jstree",function(n,t){t&&t.reference.focus()});ko.bindingHandlers.tree={init:function(n,t){var i=t(),o=ko.mapping.toJS(i.data),f=ko.unwrap(i.events)||{},r,u,e;for(key in f)if($.isFunction(f[key]))$(n).on(key+".jstree",f[key]);o&&(r=[],u={},i.contextmenu&&(r.push("contextmenu"),u.contextmenu=ko.mapping.toJS(i.contextmenu)),i.search&&(r.push("search"),u.search=ko.mapping.toJS(i.search)),r.length?(e={plugins:r},$.extend(e,u),$(n).jstree(e)):$(n).jstree())},update:function(n,t){var r=t(),i=ko.mapping.toJS(r.data);i&&($(n).jstree(!0).settings.core.data=i,$(n).jstree("refresh"))}},function(){function n(n,t){var i=ko.unwrap(t())||{},o=!1,u=$(n),c=i.formOptionType,f=ko.isObservable(i.value)?i.value:ko.observable(i.value),e=i.additionalTextRequired?ko.isObservable(i.additionalTextRequired.value)?i.additionalTextRequired.value:ko.observable(i.additionalTextRequired.value):null,l=i.placeholder?ko.utils.unwrapObservable(i.placeholder).toString():"Select...",s=i.trueOptions,a=i.width?ko.utils.unwrapObservable(i.width).toString():"6.5em",r=null,h=null;if(i.additionalTextRequired){r=i.additionalTextRequired.textArea?$('<textarea type="text" class="form-control '+(i.additionalTextRequired.inputCSS?i.additionalTextRequired.inputCSS:"")+'"><\/textarea>'):$('<input type="text" class="form-control '+(i.additionalTextRequired.inputCSS?i.additionalTextRequired.inputCSS:"")+'"><\/input>');h=$('<div class="clearfix form-group" style="margin-bottom:5px;" data-bind="validationElement: value"><span class="control-label col-xs-4">'+i.additionalTextRequired.caption+"<\/span><\/div>");h.append($('<div class="col-xs-4"><p data-bind="validationMessage: value"><\/p><\/div>').prepend(r));r.on("change",function(){e(r.val())});e&&e()&&r.val(e());f()==FACTRAX.FormOptions.UnsureTristateType.TrueValue||s&&_.contains(s,f())||r.prop("disabled",!0)}FACTRAX.FormOptions.getFormOptionsForType(c).done(function(t){function p(){f()==null?v.val(null):v.val(f());o=!0;v.trigger("change");o=!1}var b=$.map(t,function(n){return n.id=n.id||n.Value,n.text=n.text||n.Name,n}),v=u.select2({data:b,allowClear:!0,placeholder:l,width:a,minimumResultsForSearch:-1}),c,y,w;i.additionalTextRequired&&(c=u.closest(".clearfix").after(h).next(),c&&c[0]&&ko.applyBindings({value:e},c[0]));p();y=f;u.on("change",function(){var n,t;o=!0;n=u.val()?parseInt(u.val()):u.val();n==null?(f(null),r&&(r.val(null),e(null))):f(n);o=!1;(n===FACTRAX.FormOptions.UnsureTristateType.TrueValue||s&&_.contains(s,f()))&&r?r.prop("disabled",!1):r&&(r.prop("disabled",!0),r.val()&&r.val().length>0&&(t=confirm("Are you sure you would like to clear out the '"+i.additionalTextRequired.caption+"' data?"),t==!0?(r.val(null),i.additionalTextRequired.value(null)):f(y)));y=n});w=f.subscribe(function(){o||p()});u.on("select2:opening",function(n){u.data("unselecting")&&(u.removeData("unselecting"),n.preventDefault())}).on("select2:unselecting",function(){u.data("unselecting",!0)});ko.utils.domNodeDisposal.addDisposeCallback(n,function(){u.select2("destroy");w.dispose()})})}return ko.bindingHandlers.triState={init:n}}();ko.bindingHandlers.uniqueId={init:function(n,t){n.id=ko.bindingHandlers.uniqueId.applyId(t())},preprocess:function(n){return"{ data:"+n+", bindingText: '"+n+"' }"},applyId:function(n){var t;return ko.isObservable(n.data)?(t=n.data.id||ko.bindingHandlers.uniqueId.prefix+ ++ko.bindingHandlers.uniqueId.counter+"-"+n.bindingText.substring(n.bindingText.indexOf(".")+1).replace("_Id",""),n.data.id=t):(ko.bindingHandlers.uniqueId.readOnlyFields[n.bindingText]=ko.bindingHandlers.uniqueId.readOnlyFields[n.bindingText]||{},t=ko.bindingHandlers.uniqueId.readOnlyFields[n.bindingText].id||ko.bindingHandlers.uniqueId.prefix+ ++ko.bindingHandlers.uniqueId.counter+"-"+n.bindingText.substring(n.bindingText.indexOf(".")+1).replace("_Id",""),ko.bindingHandlers.uniqueId.readOnlyFields[n.bindingText].id=t),t},counter:0,readOnlyFields:[],prefix:"form-field-"};ko.bindingHandlers.uniqueFor={init:function(n,t){n.setAttribute("for",ko.bindingHandlers.uniqueId.applyId(t()))},preprocess:ko.bindingHandlers.uniqueId.preprocess};ko.bindingHandlers.units={update:function(n,t){var i=ko.utils.unwrapObservable(t()),r=$(n);i.hasOwnProperty("value")&&i.value&&i.hasOwnProperty("s")&&i.s&&i.hasOwnProperty("p")&&i.p||r.text("--");var u=ko.utils.unwrapObservable(i.value),e=ko.utils.unwrapObservable(i.s),o=ko.utils.unwrapObservable(i.p),s=ko.utils.unwrapObservable(i.unitOnly)||!1,f=s?"":u+" ";u===1?r.text(f+e):r.text(f+o)}};ko.observableArray.fn.findNameValue=function(n,t){return ko.utils.arrayFirst(this(),function(i){return i?i[t||"Value"]===n:!1})};ko.observableArray.fn.selectable=function(n,t,i){return this.selectedId=ko.observable(),this.selectedText=ko.observable(),this.selectedItem=ko.observable(),this.selectedId.subscribe(function(n){var u=parseInt(n),f=this.findNameValue(u,t||"Value"),r=ko.toJS(f);this.selectedItem(r);r?this.selectedText(r[i||"Name"]):this.selectedText(null)},this),this.selectedId(n),this};ko.subscribable.fn.subscribeAndFire=function(n,t){n.apply(t,[this()]);this.subscribe.apply(this,arguments)};ko.subscribable.fn.subscribeWithPreviousValue=function(n,t){var i;this.subscribe(function(n){i=n},null,"beforeChange");this.subscribe(function(r){n.call(t,r,i)})};ko.utils.copyInto=function(n,t){for(var i in n)n.hasOwnProperty(i)&&t.hasOwnProperty(i)&&ko.isWriteableObservable(n[i])&&n[i](ko.unwrap(t[i]))};ko.bindingHandlers.element={init:function(n,t){var i=t();i(n)}};ko.bindingHandlers.fadeVisible={init:function(n,t){var i=t();$(n).toggle(ko.unwrap(i))},update:function(n,t){var i=t();ko.unwrap(i)?$(n).fadeIn():$(n).fadeOut()}};ko.bindingHandlers.fadeinVisible={init:function(n,t){var i=t();$(n).toggle(ko.unwrap(i))},update:function(n,t){var i=t();ko.unwrap(i)?$(n).fadeIn():$(n).toggle(!1)}};ko.bindingHandlers.crossFade={init:function(n,t){var i=t();$(n).toggle(ko.unwrap(i));$(n).css("position","relative")},update:function(n,t){var r=t(),i;$(n).css("position","absolute");i=$(n).outerHeight();$(n).closest(".crossfade-area").height(i);ko.unwrap(r)?$(n).addClass("shown").fadeIn(400,function(){$(n).css("position","relative");$(n).closest(".crossfade-area").css("height","")}):$(n).removeClass("shown").fadeOut(400,function(){$(n).css("position","relative");$(n).closest(".crossfade-area").css("height","")})}};ko.utils.extendObservable=function(n,t,i){var o=function(n,t){var i=n&&typeof n=="object"?n:$.isArray(t)?[]:{};return ko.utils.extendObservable(i,t,!0)},u,r,f,s,e;for(u in t)if(t.hasOwnProperty(u)){if(f=!1,s=!1,ko.isObservable(t[u]))if(ko.isComputed(t[u]))continue;else t[u].destroyAll!==undefined?(f=!0,s=!0,r=t[u]()):(f=!0,r=t[u]());else if($.isFunction(t[u]))continue;else r=t[u];e=i&&r&&typeof r=="object";ko.isWriteableObservable(n[u])?(r=e?o(n[u](),r):r,n[u](r)):n[u]===undefined?(r=e?o(null,r):r,n[u]=f?s?ko.observableArray(r):ko.observable(r):r):$.isFunction(n[u])||(r=e?o(n[u],r):r,n[u]=r)}return n},function(){var n=ko.validation,t=ko.utils;ko.bindingHandlers.validationMessageGroup={update:function(i,r){var u=r(),e=n.utils.getConfigOptions(i);if(u===null||typeof u=="undefined")throw new Error("Cannot bind validationMessageGroup to undefined value. data-bind expression: "+i.getAttribute("data-bind"));var o=_.find(ko.unwrap(u),function(t){return!t||!n.utils.isValidatable(t)?!1:(ko.unwrap(t),e.messagesOnModified&&!t.isModified())?!1:!t.isValid()}),f=o?ko.unwrap(o.error):null,s=!!f,h=i.style.display!=="none";e.allowHtmlMessages?t.setHtml(i,f):t.setTextContent(i,f);h&&!s?i.style.display="none":!h&&s&&(i.style.display="")}};ko.bindingHandlers.validationElementGroup={update:function(t,i,r){var u=i(),f=n.utils.getConfigOptions(t),e,o;if(u===null||typeof u=="undefined")throw new Error("Cannot bind validationElementGroup to undefined value. data-bind expression: "+t.getAttribute("data-bind"));e=_.find(ko.unwrap(u),function(t){return!t||!n.utils.isValidatable(t)?!1:(ko.unwrap(t),f.decorateElementOnModified&&!t.isModified())?!1:!t.isValid()});o=function(){var n={};return n[f.errorElementClass]=!!e,n};ko.bindingHandlers.css.update(t,o,r)}}}();ko.bindingHandlers.verbose={update:function(n,t,i){var r=$(n),u=i().verbose,o=u.value,s=u.initWidth,e=u.icon,l=r.html(),a=r.height(),h=r.css("line-height"),f=$('<div class="trunc-wrapper"><\/div>'),c;f.html(o);e&&f.prepend('<i class="fa fa-fw '+e+'"><\/i>');r.addClass("trunc");r.html(f);c=parseInt(r.css("font-size"),10);r.on("mouseenter",function(){var t=$(this),n=$(this).find(".trunc-wrapper");n.addClass("trunc-hover");n.width(s);t.height(h)});r.on("mouseleave",function(){$(this).find(".trunc-wrapper").removeClass("trunc-hover")})}};ko.components.register("btn-dropdown",{viewModel:function(n){this.title=n.title;this.icon="fa fa-fw "+(n.icon||"fa-gear");this.text=n.text||"Manage";this.items=n.items;this.click=n.click;this.href=n.href&&n.href.replace("{id}",n.itemId);this.itemId="'"+n.itemId+"'";this.itemName="'"+n.itemName+"'"},template:'<div class="btn-group" role="group">            <button type="button" class="btn btn-create dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">                <i data-bind="attr: { class: icon }, text: text"><\/i>                <span class="caret"><\/span>            <\/button>            <ul class="dropdown-menu" data-bind="foreach: items">                <li>                <!-- ko if: click -->                    <a data-bind="click: click.bind($data, itemId), text: itemName"><\/a>                <!-- /ko -->                <!-- ko ifnot: click -->                    <a data-bind="attr { href: href }"><\/a>                <!-- /ko -->                <\/li>            <\/ul>        <\/div>'});ko.components.register("category-icon",{viewModel:function(n){this.value=ko.unwrap(n.value)},template:"<i data-bind=\"attr: { class: 'fa fa-fw fa-circle-o icon-category-' + value }\"><\/i>"});ko.components.register("ddd-damagecontent",{viewModel:function(n){this.value=ko.isObservable(n.value)?n.value:ko.observable(n.value)},template:'<li data-bind="attr: { class: value().Class }">             <!-- ko if: value().Children && value().Children.length -->                 <ul>                     <!-- ko foreach: value().Children -->                         <ftx-checklist-edit-outline-item params="value: $data"><\/ftx-checklist-edit-outline-item>                     <!-- /ko -->                 <\/ul>             <!-- /ko -->             <!-- ko ifnot: value().Children && value().Children.length -->                 <div class="alert alert-info">                     <p>This DDD is unfinished.<\/p>                 <\/div>             <!-- /ko -->         <\/li>'});ko.components.register("ddd-damageheader",{viewModel:function(n){this.value=ko.isObservable(n.value)?n.value:ko.observable(n.value)},template:'<div class="ddd">             <div data-bind="attr: { class: value().Class }">                 <h3 data-bind="text: value().Text"><\/h3>             <\/div>         <\/div>'});ko.components.register("ddd-preview-item",{viewModel:function(n){this.value=ko.isObservable(n.value)?n.value:ko.observable(n.value);this.header=n.header;this.footer=n.footer},template:'<li data-bind="attr: { class: value().Class }">             <h3 data-bind="text: value().Text"><\/h3>             <!-- ko if: header -->                 <div data-bind="html: header"><\/div>             <!-- /ko -->             <!-- ko if: value().Children && value().Children.length -->                 <ul>                     <!-- ko foreach: value().Children -->                         <ftx-checklist-edit-outline-item params="value: $data"><\/ftx-checklist-edit-outline-item>                     <!-- /ko -->                 <\/ul>             <!-- /ko -->             <!-- ko if: footer -->                 <div data-bind="html: footer"><\/div>             <!-- /ko -->         <\/li>'});ko.components.register("ddd-preview",{viewModel:function(n){this.title=n.title;this.name=n.name;this.value=ko.isObservable(n.value)?n.value:ko.observable(n.value);this.child=n.child;this.header=n.header;this.footer=n.footer},template:'<!-- ko if: title -->             <div style="height: 30px;">                 <div style="padding-top: 12px; font-size: 12pt; font-weight: bold; display: inline;" data-bind="text: title"><\/div>             <\/div>         <!-- /ko -->         <!-- ko if: value -->             <ul class="ddd">                 <ddd-preview-item params="value: value, header: header, footer: footer"><\/ddd-preview-item>             <\/ul>         <!-- /ko -->         <!-- ko ifnot: value -->             <h3 data-bind="text: name"><\/h3>             <div class="alert alert-info">                 <p>This DDD is unfinished.<\/p>             <\/div>         <!-- /ko -->'});ko.components.register("file-icon",{viewModel:function(n){var t=this;this.value=ko.unwrap(n.value);this.cssClass=ko.pureComputed(function(){var n="";switch(t.value&&t.value.toLowerCase()){case"jpg":case"jpeg":case"png":case"gif":case"bmp":case"tif":case"tiff":case"eps":case"ai":n="fa-file-image-o";break;case"zip":case"rar":case"tar":case"arj":case"tgz":case"7z":case"zipx":n="fa-file-archive-o";break;case"doc":case"docx":n="fa-file-word-o";break;case"pdf":n="fa-file-pdf-o";break;case"xls":case"xlsx":n="fa-file-excel-o";break;case"ppt":case"pptx":n="fa-file-powerpoint-o";break;case"txt":n="fa-file-text-o";break;case"avi":case"flv":case"wmv":case"mov":case"mp4":n="fa-file-video-o";break;case"wma":case"wav":case"mp3":case"ogg":n="fa-file-audio-o";break;default:n="fa-file-o"}return n})},template:"<i data-bind=\"attr: { class: 'icon-file fa fa-fw ' + cssClass() }\"><\/i>"});ko.components.register("filter-check-btn",{viewModel:function(n){var t=this;t.value=ko.unwrap(n.value);t.checked=ko.observable(ko.unwrap(n.checked));t.icon=ko.pureComputed(function(){return t.checked()?"fa-check-circle":"fa-circle-o"});t.btnClass=ko.pureComputed(function(){return t.checked()?"":"btn-outline"})},template:'<a data-bind="attr: { class: \'btn btn-rounded btn-primary btn-xs \' + btnClass() }"><i data-bind="attr: { class: \'fa fa-fw \' + icon() }"><\/i><span data-bind="text: value"><\/span><\/a>'});ko.components.register("ftx-address-editor",{viewModel:function(n){var t=n.hasOwnProperty("nullValue")?n.nullValue:"--";this.title=n.title===undefined||n.title===null?t:n.title;this.empty=n.hasOwnProperty("empty")?n.empty:!1;this.address=n.address===undefined||n.address===null?t:n.address;this.edit=n.edit},template:'<div class="contact-box no-padding" style="min-height:180px;">             <div class="p-xs">                 <!-- ko if: edit -->                 <div class="pull-right">                     <button class="btn btn-xs btn-primary" data-bind="click: edit"><i class="fa fa-pencil"><\/i><span data-bind="text: title"><\/span><\/button>                 <\/div>                 <!-- /ko -->             <\/div>                             <div class="p-lg">                 <!-- ko ifnot: empty -->                 <address data-bind="html: address">                 <\/address>                 <!-- /ko -->                 <!-- ko if: empty -->                 <label>No Location Chosen<\/label>                 <!-- /ko -->             <\/div>         <\/div>'});ko.components.register("ftx-alert-template",{viewModel:function(n){var t=this;t.title=ko.pureComputed(function(){return ko.unwrap(n.title)+"<span>.<\/span>"});t.dangerAlert=n.hasOwnProperty("dangerAlert")?n.dangerAlert:!1;t.infoAlert=n.hasOwnProperty("infoAlert")?n.infoAlert:!1;t.successAlert=n.hasOwnProperty("successAlert")?n.successAlert:!1;t.hasPermissions=n.hasOwnProperty("hasPermissions")?n.hasPermissions:!1;t.icon=n.hasOwnProperty("icon")?n.icon:"fa-exclamation-triangle";t.alertClass=ko.pureComputed(function(){return ko.unwrap(t.dangerAlert)?"alert-danger":ko.unwrap(t.infoAlert)?"alert-info":ko.unwrap(t.successAlert)?"alert-success":ko.unwrap(t.hasPermissions)?"alert-warning":"alert-info"});t.useGrid=n.hasOwnProperty("useGrid")?n.useGrid:!1},template:'<div class="alert" data-bind="css: alertClass">             <h2 class="has-icon" data-bind="css: (useGrid ? \'grid\' : \'\')">                 <i class="fas fa-fw" data-bind="css: icon"><\/i><span data-bind="html: title"/>            <\/h2>             <div>                 <!-- ko template: { nodes: $componentTemplateNodes, data: ko.pureComputed(function(){return ko.unwrap($data.with) || $parent;}) } --><!-- /ko -->             <\/div>         <\/div>'});ko.components.register("ftx-alert",{viewModel:function(n){switch(n.type){case"danger":this.style={"alert alert-danger":!0};this.icon={"fas fa-fw fa-exclamation-triangle":!0};break;case"info":this.style={"alert alert-info":!0};this.icon={"fas fa-fw fa-info-circle":!0};break;case"success":this.style={"alert alert-success":!0};this.icon={"fas fa-fw fa-check":!0};break;default:this.style={"alert alert-warning":!0};this.icon={"fas fa-fw fa-exclamation-triangle":!0}}n.hasOwnProperty("with")&&(this.with=n.with);this.visible=n.hasOwnProperty("visible")?n.visible:!0;this.ifSetting=n.hasOwnProperty("if")?n.if:!0;var t=ko.observable();this.hasHeader=t;this.getHeader=function(n){var i=_.find(n,function(n){return n.localName==="ftx-alert-header"});return i?(t(!0),i.childNodes):[]};this.getBody=function(n){var t=_.find(n,function(n){return n.localName==="ftx-alert-body"});return t?t.childNodes:[]}},template:'<!-- ko if: ifSetting -->         <div data-bind="css: style, visible: visible">             <i style="float:left;margin-top:5px;" data-bind="css: icon" class="h3"><\/i>             <h2 style="margin-left:45px;" data-bind="visible: hasHeader">                 <!-- ko template: { nodes: getHeader($componentTemplateNodes), data: $data.hasOwnProperty("with") ? $data.with : $parent } --><!-- /ko -->             <\/h2>             <p style="margin-left:45px;">                 <!-- ko template: { nodes: getBody($componentTemplateNodes), data: $data.hasOwnProperty("with") ? $data.with : $parent } --><!-- /ko -->             <\/p>         <\/div>         <!-- /ko -->'});ko.components.register("ftx-applicant-filter",{viewModel:function(n){this.selectedOptions=n.selectedOptions;this.loading=n.loading;this.eventApplicants=ko.pureComputed(function(){return _.filter(n.options(),function(n){return n.EventApplicant})})},template:'<!-- ko ifnot: loading -->         <select class="form-control" multiple style="max-height: 1px" data-bind="select2OnCloseSelectedOptions: selectedOptions, select2: { placeholder: \'Select...\'}">             <!-- ko if: eventApplicants().length -->             <optgroup data-bind="foreach: eventApplicants" label="Applicants Declared">                 <option data-bind="text: Name, option: Value, data: { item: $data }"><\/option>             <\/optgroup>             <!-- /ko -->         <\/select>         <!-- /ko -->         <!-- ko if: loading -->         <input class="form-control select2-loading" value="Loading..." disabled />         <!-- /ko -->'});ko.components.register("ftx-assignedto-filter",{viewModel:function(n){this.items=n.items;var t=ko.observable(!0);this.rebind=t;n.items.subscribe(function(){t(!1);_.defer(function(){t(!0)})})},template:'<!-- ko if: rebind -->         <select class="form-control" data-bind="select2UncheckedValue: items.selectedId, select2: { placeholder: \'Select...\' }">             <!-- ko foreach: (items() && items().top) || [] -->             <option data-bind="text: Name, option: Id"><\/option>             <!-- /ko -->             <!-- ko foreach: (items() && items().groups) || [] -->             <optgroup data-bind="foreach: $data, attr: { label: $data[0].Group }">                 <option data-bind="text: Name, option: Id"><\/option>             <\/optgroup>             <!-- /ko -->         <\/select>         <!-- /ko -->        <!-- ko ifnot: rebind -->         <input class="form-control" value="Loading..." disabled />         <!-- /ko -->'});ko.components.register("ftx-caption-checkbox",{viewModel:function(n){this.caption=n.caption;this.value=ko.isObservable(n.value)?n.value:ko.observable(n.value);this.required=n.hasOwnProperty("required")?n.required:!1;this.visible=n.hasOwnProperty("visible")?n.visible:!0;this.moreInfo=n.moreInfo;this.disable=n.hasOwnProperty("disable")?n.disable:!1},template:'<div class="form-group ftx-form-group" data-bind="visible: visible, validationElement: value, css: { required: required }">             <label class="control-label ftx-control-label">                 <!-- ko if: moreInfo --><span class="m-l" data-bind="moreInfo: moreInfo"><\/span><!-- /ko -->                 <span data-bind="text: caption"><\/span>             <\/label>             <div class="ftx-static-wrapper">                 <input type="checkbox" data-bind="checked: value, icheck:true, disable: disable" /><span class="lbl"><\/span>            <\/div>         <\/div>'});ko.components.register("ftx-caption-checktextbox",{viewModel:function(n){var t=this;this.caption=n.caption;this.value=ko.isObservable(n.value)?n.value:ko.observable(n.value);this.checked=ko.isObservable(n.checked)?n.checked:ko.observable(n.checked);this.enable=n.enable===undefined?!0:n.enable;this.moreInfo=n.moreInfo;this.uniqueId508=_.uniqueId(n.caption.replace(/\s+/g,"-").toLowerCase());this.checked.subscribe(function(n){n&&_.defer(function(){$("#"+t.uniqueId).focus()})});this.autoComplete=n.autoComplete;this.css=n.hasOwnProperty("css")?n.css:""},template:'<div class="form-group ftx-form-group ftx-caption-checktextbox" data-bind="validationElement: value">             <label class="control-label ftx-control-label" data-bind="attr: { \'for\': uniqueId508 }">                 <!-- ko if: moreInfo --><span class="m-l" data-bind="moreInfo: moreInfo"><\/span><!-- /ko -->                 <span data-bind="text: caption"><\/span>             <\/label>             <div class="ftx-static-wrapper">                 <div class="input-group">                     <span class="input-group-addon">                         <input type="checkbox" aria-label="Enable Text Box" data-bind="checked: checked, icheck: true">                     <\/span>                     <!-- ko ifnot: autoComplete -->                     <input type="text" class="form-control" data-bind="value: value, enable: enable, attr: { id: uniqueId508 }"/>                     <!-- /ko -->                     <!-- ko if: autoComplete -->                     <input type="text" class="form-control" data-bind="value: value, enable: enable, autoComplete: { data: autoComplete }, attr: { id: uniqueId508 }, css: css"/>                     <!-- /ko -->                 <\/div>             <\/div>         <\/div>'});ko.components.register("ftx-caption-datepicker",{viewModel:function(n){this.caption=n.caption;this.value=ko.isObservable(n.value)?n.value:ko.observable(n.value);this.required=n.hasOwnProperty("required")?n.required:!1;this.captionCss=n.hasOwnProperty("captionCss")?n.captionCss:"";this.options=n.hasOwnProperty("options")?n.options:{};n.hasOwnProperty("startDate")&&(this.options.startDate=n.startDate)},template:'<div class="form-group ftx-form-group" data-bind="validationElement: value, validationOptions: { insertMessages: false }, css: { required: required }">             <label class="control-label ftx-control-label" data-bind="text: caption, uniqueFor: value, css: captionCss"><\/label>             <div class="ftx-static-wrapper input-group">                 <div class="input-group">                     <input type="text" class="form-control" data-bind="datepicker: value, datepickerOptions: options, uniqueId: value"/>                     <span class="input-group-addon">                         <i class="fas fa-fw fa-calendar-alt"><\/i>                     <\/span>                 <\/div>                 <div class="validationMessage" data-bind="validationMessage: value"><\/div>             <\/div>         <\/div>'});ko.components.register("ftx-caption-daterangepicker",{viewModel:function(n){function e(){i.isModified()&&u.errors().length?t(u.errors()[0]):r.isModified()&&f.errors().length?t(f.errors()[0]):t(null)}function o(){t.isModified(i.isModified()||r.isModified());e()}var s=n.caption,i=ko.isObservable(n.startDate)?n.startDate:ko.observable(n.startDate),r=ko.isObservable(n.endDate)?n.endDate:ko.observable(n.endDate),h=n.hasOwnProperty("required")?n.required:!1,t=ko.observable().extend({validation:{validator:function(n){return!n},message:function(n,t){return t()}}}),u=ko.validatedObservable([i]),f=ko.validatedObservable([r]);ko.validatedObservable([t]);u.errors.subscribe(e);f.errors.subscribe(e);i.isModified.subscribe(o);r.isModified.subscribe(o);$.extend(this,{startDate:i,endDate:r,shim:t,caption:s,required:h})},template:'<div class="form-group ftx-form-group" data-bind="validationElement: shim, validationOptions: { insertMessages: false }, css: { required: required }">             <label class="control-label ftx-control-label" data-bind="text: caption, uniqueFor: startDate"><\/label>             <div class="ftx-static-wrapper input-group">                 <div class="input-group">                     <input type="text" class="form-control" data-bind="datepicker: startDate, uniqueId: startDate"/>                     <span class="input-group-addon"><i class="fas fa-calendar-alt"><\/i><\/span>                     <span class="input-group-addon" style="border: none; background: none;">TO<\/span>                     <input type="text" class="form-control" data-bind="datepicker: endDate, uniqueId: endDate" />                     <span class="input-group-addon"><i class="fas fa-calendar-alt"><\/i><\/span>                 <\/div>                 <div class="validationMessage" data-bind="validationMessage: shim"><\/div>             <\/div>         <\/div>'});ko.components.register("ftx-caption-dropdown-bool",{viewModel:function(n){this.caption=n.caption;this.visible=n.hasOwnProperty("visible")?n.visible:!0;this.required=n.hasOwnProperty("required")?n.required:!1;this.moreInfo=n.moreInfo;this.captionIsHtml=n.hasOwnProperty("captionIsHtml")?n.captionIsHtml:!1;var t=ko.unwrap(n.trueText)||"Yes",i=ko.unwrap(n.falseText)||"No";this.options=n.hasOwnProperty("order")&&ko.unwrap(n.order)=="asc"?[{Name:i,Value:0},{Name:t,Value:1}]:[{Name:t,Value:1},{Name:i,Value:0}];this.value=n.value;this.shim=ko.pureComputed({read:function(){return n.value()===!0?"1":n.value()===!1?"0":undefined},write:function(t){t==1?n.value(!0):t==0?n.value(!1):n.value(undefined)}})},template:'<div class="form-group ftx-form-group" data-bind="visible: visible, validationElement: value, css: { required: required }">             <label class="control-label ftx-control-label">                 <!-- ko if: moreInfo --><span class="m-l" data-bind="moreInfo: moreInfo"><\/span><!-- /ko -->                 <!-- ko if: captionIsHtml -->                 <span data-bind="html: caption"><\/span>                 <!-- /ko -->                 <!-- ko ifnot: captionIsHtml -->                 <span data-bind="text: caption"><\/span>                 <!-- /ko -->             <\/label>             <div class="ftx-static-wrapper">                 <select class="form-control" data-bind="options: options,                     optionsText: \'Name\',                     optionsValue: \'Value\',                     optionsCaption: \'\',                     value: shim,                     select2: { placeholder: \'Select...\', minimumResultsForSearch: -1 }">                <\/select>                 <span class="validationMessage" data-bind="validationMessage: value"><\/span>             <\/div>         <\/div>'});ko.components.register("ftx-caption-dropdown",{viewModel:function(n){this.caption=n.caption;this.visible=n.hasOwnProperty("visible")?n.visible:!0;this.settings=ko.unwrap(n.settings);this.other=n.other;this.required=n.hasOwnProperty("required")?n.required:!1;this.moreInfo=n.moreInfo;this.multiple=n.hasOwnProperty("multiple")?n.multiple:!1;this.uniqueId508=_.uniqueId(n.caption.replace(/\s+/g,"-").toLowerCase());this.uniqueIdOther=_.uniqueId("ftx-caption-dropdown-"+n.caption.replace(/\s+/g,"-").toLowerCase()+"-other")},template:'<div class="form-group ftx-form-group" data-bind="visible: visible, validationElement: settings.value, css: { required: required }">             <label data-bind="attr: { \'for\': uniqueId508 }" class="control-label ftx-control-label">                 <!-- ko if: moreInfo --><span class="m-l" data-bind="moreInfo: moreInfo"><\/span><!-- /ko -->                 <span data-bind="text: caption"><\/span>             <\/label>             <div class="ftx-static-wrapper">                 <!-- ko ifnot: multiple -->                <select class="form-control" data-bind="options: settings.options, attr: { id: uniqueId508 },                     optionsText: settings.optionsText,                     optionsValue: settings.optionsValue,                     optionsCaption: settings.optionsCaption,                     value: settings.value,                     select2Text: settings.select2Text,                     select2: settings.select2">                <\/select>                 <!-- /ko -->                <!-- ko if: multiple -->                <select class="form-control" multiple data-bind="options: settings.options, attr: { id: uniqueId508 },                     optionsText: settings.optionsText,                     optionsValue: settings.optionsValue,                     optionsCaption: settings.optionsCaption,                     select2OnCloseSelectedOptions: settings.value,                     select2Text: settings.select2Text,                     select2: settings.select2">                <\/select>                 <!-- /ko -->                <!-- ko if: settings.showValidation -->                    <span class="validationMessage text-danger" data-bind="validationMessage: settings.value"><\/span>                <!-- /ko -->            <\/div>         <\/div>        <!-- ko if: settings.select2Text && settings.select2Text() === \'Other\' && other !== null && other !== undefined -->            <div class="form-group ftx-form-group" data-bind="validationElement: other, css: { required: required }">                 <label class="control-label ftx-control-label" data-bind="text: \'Other \' + caption, attr: { \'for\': uniqueIdOther }">                 <\/label>                 <div class="ftx-static-wrapper">                     <input class="form-control" data-bind="value: other, attr: { id: uniqueIdOther }" />                 <\/div>             <\/div>         <!-- /ko -->'});ko.components.register("ftx-caption-password",{viewModel:function(n){this.caption=n.caption;this.value=ko.isObservable(n.value)?n.value:ko.observable(n.value);this.required=n.hasOwnProperty("required")?n.required:!1;this.visible=n.hasOwnProperty("visible")?n.visible:!0;this.moreInfo=n.moreInfo;this.uniqueId508=_.uniqueId(n.caption.replace(/\s+/g,"-").toLowerCase())},template:'<div class="form-group ftx-form-group" data-bind="visible: visible, validationElement: value, css: { required: required }">             <label data-bind="attr: { \'for\': uniqueId508 }" class="control-label ftx-control-label">                 <!-- ko if: moreInfo --><span class="m-l" data-bind="moreInfo: moreInfo"><\/span><!-- /ko -->                 <span data-bind="text: caption"><\/span>             <\/label>             <div class="ftx-static-wrapper">                 <input type="password" autocomplete="off" class="form-control" data-bind="value: value, attr: { id: uniqueId508 }"/>            <\/div>         <\/div>'});ko.components.register("ftx-caption-show-hide-partial-comment-text",{viewModel:function(n){var t=n.hasOwnProperty("nullValue")?n.nullValue:"--";this.value=n.value===undefined||n.value===null?t:n.value;this.caption=n.caption;this.visible=n.hasOwnProperty("visible")?n.visible:!0;this.stringDefaultLength=n.hasOwnProperty("stringDefaultLength")?n.stringDefaultLength:60;this.showComments=ko.observable(!1);this.showHideCommentCaption=ko.pureComputed(function(){return this.showComments()?"Show Less":"Show More"}.bind(this));this.showHideCommentsClick=function(){this.showComments(!this.showComments())}.bind(this);this.showCommentControls=ko.pureComputed(function(){return this.value&&this.value.length>0?!0:!1}.bind(this))},template:'<div class="form-group ftx-form-group" data-bind="visible: visible">                     <label class="control-label ftx-control-label" data-bind="uniqueFor: value, text: caption"><\/label>                     <div class="ftx-static-wrapper comment-blockquote-container">                         <p class="form-control-static">                             <!--ko if: showCommentControls && value.length > stringDefaultLength -->                            <!--ko if: !showComments() -->                            <span data-bind="uniqueId: value, text: value.substring(0, stringDefaultLength)" />                             <!-- /ko -->                            <!--ko if: showComments() -->                            <span data-bind="uniqueId: value, text: value, css: { collapse: !showComments() }" />                             <!-- /ko -->                            <span class="m-l-xs">                                (<a href="#" data-bind="text:showHideCommentCaption, click:showHideCommentsClick"/>)                             <\/span>                             <!-- /ko -->                            <!-- ko if: showCommentControls && value.length < stringDefaultLength -->                            <span data-bind="uniqueId: value, text: value" />                             <!-- /ko -->                        <\/p>                     <\/div>                 <\/div>'});ko.components.register("ftx-caption-template",{viewModel:function(n){this.with=n.with;this.caption=n.caption;this.validationElement=n.validationElement||ko.observable();this.required=n.hasOwnProperty("required")?n.required:!1},template:'<div class="form-group ftx-form-group" data-bind="validationElement: validationElement, css: { required: required }">             <label class="control-label ftx-control-label" data-bind="visible: caption, text: caption"><\/label>             <div class="ftx-static-wrapper">                 <p class="form-control-static">                     <!-- ko template: { nodes: $componentTemplateNodes, data: ko.pureComputed(function(){return ko.unwrap($data.with) || $parent;}) } --><!-- /ko -->                 <\/p>             <\/div>         <\/div>'});ko.components.register("ftx-caption-textarea",{viewModel:function(n){this.caption=n.caption;this.value=ko.isObservable(n.value)?n.value:ko.observable(n.value);this.rows=n.rows;this.required=n.hasOwnProperty("required")?n.required:!1},template:'<div class="form-group ftx-form-group" data-bind="validationElement: value, css: { required: required }">             <label class="control-label ftx-control-label" data-bind="visible: caption, text: caption"><\/label>             <div class="ftx-static-wrapper">                 <textarea type="text" class="form-control" data-bind="value: value, attr: { rows: rows }"><\/textarea>            <\/div>         <\/div>'});ko.components.register("ftx-caption-textbox-currency",{viewModel:function(n){var t=n.hasOwnProperty("nullValue")?n.nullValue:"$0.00";this.value=ko.isObservable(n.value)?n.value:ko.observable(n.value);this.formatedValue=this.value()===undefined||this.value()===null?t:"$"+this.value().toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g,",");this.caption=n.caption;this.visible=n.hasOwnProperty("visible")?n.visible:!0;this.required=n.hasOwnProperty("required")?n.required:!1;this.captionCss=n.hasOwnProperty("captionCss")?n.captionCss:"";this.disable=n.hasOwnProperty("disable")?n.disable:!1;this.moreInfo=n.moreInfo},template:'<div class="form-group ftx-form-group" data-bind="visible: visible, validationElement: value, css: { required: required }">             <label class="control-label ftx-control-label" data-bind="visible: caption, css: captionCss">                 <!-- ko if: moreInfo --><span class="m-l" data-bind="moreInfo: moreInfo"><\/span><!-- /ko -->                 <span data-bind="text: caption"><\/span>             <\/label>             <div class="ftx-static-wrapper input-group">                 <input type="text" class="form-control" data-bind="moneyInput: value, autoNumericOptions: { mDec: 2 }, valueUpdate: \'afterkeydown\', disable: disable"/>                 <div class="validationMessage" data-bind="validationMessage: value"><\/div>             <\/div>         <\/div>'});ko.components.register("ftx-caption-textbox-numeric",{viewModel:function(n){this.caption=n.caption;this.value=ko.isObservable(n.value)?n.value:ko.observable(n.value);this.required=n.hasOwnProperty("required")?n.required:!1;this.visible=n.hasOwnProperty("visible")?n.visible:!0;this.moreInfo=n.moreInfo;this.uniqueId508=_.uniqueId(n.caption.replace(/\s+/g,"-").toLowerCase());this.autoFocus=n.hasOwnProperty("autoFocus")?n.autoFocus:!1;this.autoNumericOptions=n.hasOwnProperty("autoNumericOptions")?n.autoNumericOptions:{mDec:0}},template:'<div class="form-group ftx-form-group" data-bind="visible: visible, validationElement: value, css: { required: required }">             <label data-bind="attr: { \'for\': uniqueId508 }" class="control-label ftx-control-label">                 <!-- ko if: moreInfo --><span class="m-l" data-bind="moreInfo: moreInfo"><\/span><!-- /ko -->                 <span data-bind="text: caption"><\/span>             <\/label>             <div class="ftx-static-wrapper">                 <input type="text" class="form-control" data-bind="value: value, numeric: value, autoNumericOptions: autoNumericOptions, valueUpdate: \'afterkeydown\', attr: { id: uniqueId508, autoFocus: autoFocus }"/>            <\/div>         <\/div>'});ko.components.register("ftx-caption-textbox",{viewModel:function(n){this.caption=n.caption;this.value=ko.isObservable(n.value)?n.value:ko.observable(n.value);this.required=n.hasOwnProperty("required")?n.required:!1;this.visible=n.hasOwnProperty("visible")?n.visible:!0;this.moreInfo=n.moreInfo;this.uniqueId508=_.uniqueId(n.caption.replace(/\s+/g,"-").toLowerCase());this.mask=n.hasOwnProperty("mask")?n.mask:null;this.autoFocus=n.hasOwnProperty("autoFocus")?n.autoFocus:!1;this.valueUpdate=n.hasOwnProperty("valueUpdate")?n.valueUpdate:null},template:'<div class="form-group ftx-form-group" data-bind="visible: visible, validationElement: value, css: { required: required }">             <label data-bind="attr: { \'for\': uniqueId508 }" class="control-label ftx-control-label">                 <!-- ko if: moreInfo --><span class="m-l" data-bind="moreInfo: moreInfo"><\/span><!-- /ko -->                 <span data-bind="text: caption"><\/span>             <\/label>             <div class="ftx-static-wrapper">                 <input type="text" class="form-control" data-bind="value: value, attr: { id: uniqueId508 }, mask: mask, valueUpdate: valueUpdate, attr: { autoFocus: autoFocus }"/>            <\/div>         <\/div>'});ko.components.register("ftx-caption-tnwd",{viewModel:function(n){var t=this;this.caption=n.caption;this.value=n.value;this.autoNumericOptions=n.autoNumericOptions||{mDec:0};this.units=n.units;this.selectedUnits=ko.observableArray();this.selectedUnitId=n.selectedUnitId;this.selectedUnitText=n.selectedUnitText;this.minimumResultsForSearch=n.minimumResultsForSearch||11;this.required=n.hasOwnProperty("required")?n.required:!1;this.visible=n.hasOwnProperty("visible")?n.visible:!0;this.dropdownVisible=n.hasOwnProperty("dropdownVisible")?n.dropdownVisible:!0;this.uniqueId508=_.uniqueId(n.caption.replace(/\s+/g,"-").toLowerCase());this.selectedUnits.subscribe(function(n){t.selectedUnitId(n[0].Value);t.selectedUnitText(n[0].Name)});this.validation=ko.pureComputed(function(){return t.value.isModified&&t.value.isModified()&&t.value.isValid&&!t.value.isValid()?{isValid:!1,message:t.value.error()||""}:t.selectedUnitId.isModified&&t.selectedUnitId.isModified()&&t.selectedUnitId.isValid&&!t.selectedUnitId.isValid()?{isValid:!1,message:t.selectedUnitId.error()||""}:{isValid:!0,message:""}}).extend({validation:{validator:function(n){return this.message=n.message,n.isValid}}});t.popoverTitle=ko.observable(ko.unwrap(n.popoverTitle));t.popoverBody=ko.observable(ko.unwrap(n.popoverBody))},template:'<div class="form-group ftx-form-group" data-bind="visible: visible, validationElement: validation, validationOptions: { insertMessages: false }, css: { required: required }">                 <!-- ko if: required --> \t\t\t\t<label class="control-label ftx-control-label required-field-indicator" data-bind="text: caption, attr: { \'for\': uniqueId508 }"><\/label>                <!-- /ko -->                 <!-- ko ifnot: required --> \t\t\t\t<label class="control-label ftx-control-label" data-bind="text: caption, attr: { \'for\': uniqueId508 }"><\/label>                <!-- /ko --> \t\t\t\t<div class="ftx-static-wrapper"> \t\t\t\t\t<div class="input-group" style="width:100%;" data-bind="attr: { id: uniqueId508 }">                         <!-- ko ifnot: dropdownVisible -->                             <input type="text" class="form-control col-xs-6" style="width: 50%;" data-bind="numeric: value, autoNumericOptions: autoNumericOptions, valueUpdate: \'afterkeydown\'"><br/><br/>                             <span data-bind="validationMessage: validation"><\/span>                         <!-- /ko -->                        <!-- ko if: dropdownVisible -->\t\t\t\t\t\t    <input type="text" class="form-control col-xs-6" style="float: left; width: 50%;" data-bind="numeric: value, autoNumericOptions: autoNumericOptions, valueUpdate: \'afterkeydown\'"> \t\t\t\t\t\t\t<select class="form-control col-xs-6" style="float: left;" data-bind="options: units, optionsText: \'Name\', optionsValue:\'Value\', optionsCaption: \'\', value: selectedUnitId, select2Text: selectedUnitText, select2: { placeholder: \'Select...\', minimumResultsForSearch: minimumResultsForSearch }"> \t\t\t\t\t\t\t<\/select>                             <span data-bind="validationMessage: validation"><\/span> \t\t\t\t\t\t<!-- /ko --> \t\t\t\t\t<\/div> \t\t\t\t<\/div> \t\t\t\t<!-- ko if: popoverBody() --> \t\t\t\t<span data-bind="moreInfoCheckbox: { title: popoverTitle, content: popoverBody, html: true, placement: \'right\'}"><\/span> \t\t\t\t<!-- /ko --> \t\t<\/div>'});ko.components.register("ftx-caption-tnwdc",{viewModel:function(n){function r(n,t){switch(t){case 116:return parseFloat(n)*12;case 145:return parseFloat(n);case 114:return parseFloat(n)*39370.08;case 149:return parseFloat(n)*12;case 121:return parseFloat(n)*39.37008;case 128:return parseFloat(n)*63360;case 144:return parseFloat(n)*36;default:return 0}}function i(n){switch(t.selectedUnitId()){case 102:return(n/1728).toFixed(4);case 124:return(n*16387064e-12).toFixed(4);case 103:return(n/46656).toFixed(4);case 113:return(n*.0001638706).toFixed(4);case 117:return(n*.01638706).toFixed(4);case 150:return(n*.5541143).toFixed(4);case 107:return(n*.004329).toFixed(4);case 126:return(n*4329e-9).toFixed(4);case 100:return(n/6272640).toFixed(4);case 110:return(n/15500016).toFixed(4);case 140:return(n/144).toFixed(4);case 122:return(n*.00064516).toFixed(4);case 151:return(n/4014489600).toFixed(4);case 141:return(n/1296).toFixed(4);default:return 0}}var t=this;this.caption=n.caption;this.value=n.value;this.autoNumericOptions=n.autoNumericOptions||{mDec:0};this.units=n.units;this.linearUnits=n.linearUnits;this.selectedUnits=ko.observableArray();this.selectedUnitId=n.selectedUnitId;this.selectedUnitText=n.selectedUnitText;this.selectedDimensionType=n.selectedDimensionType;this.record=n.record;this.minimumResultsForSearch=n.minimumResultsForSearch||11;this.required=n.hasOwnProperty("required")?n.required:!1;this.visible=n.hasOwnProperty("visible")?n.visible:!0;this.uniqueId508=_.uniqueId(n.caption.replace(/\s+/g,"-").toLowerCase());this.selectedUnits.subscribe(function(n){t.selectedUnitId(n[0].Value);t.selectedUnitText(n[0].Name)});this.validation=ko.pureComputed(function(){return t.value.isModified&&t.value.isModified()&&t.value.isValid&&!t.value.isValid()?{isValid:!1,message:t.value.error()||""}:t.selectedUnitId.isModified&&t.selectedUnitId.isModified()&&t.selectedUnitId.isValid&&!t.selectedUnitId.isValid()?{isValid:!1,message:t.selectedUnitId.error()||""}:{isValid:!0,message:""}}).extend({validation:{validator:function(n){return this.message=n.message,n.isValid}}});this.calcPopoverContent=ko.pureComputed(function(){return _.contains(["L x W x H","L x W x D","L x Diameter","L x W","L x H","L x D","L x H x T","L x W x T","W x H"],t.selectedDimensionType())?t.record.QuantityType()!=="Area"&&t.record.QuantityType()!=="Volume"?"Calculations can only be performed for a <strong>Quantity Type<\/strong> of <strong>Area<\/strong> or <strong>Volume<\/strong>.":t.selectedDimensionType()?_.contains(["L x W x H","L x W x D","L x Diameter","L x H x T","L x W x T"],t.selectedDimensionType())&&t.record.QuantityType()==="Area"?"The Area cannot be calculated with the selected <strong>Dimension Type<\/strong>.":_.contains(["L x W","L x H","L x D","W x H"],t.selectedDimensionType())&&t.record.QuantityType()==="Volume"?"The Volume cannot be calculated with the selected <strong>Dimension Type<\/strong>":t.record.Length()&&!t.record.Length_Unit_Id()?"Select a unit of measure for the <strong>Length<\/strong> field to enable calculation.":t.record.Width()&&!t.record.Width_Unit_Id()?"Select a unit of measure for the <strong>Width<\/strong> field to enable calculation.":t.record.Height()&&!t.record.Height_Unit_Id()?"Select a unit of measure for the <strong>Height<\/strong> field to enable calculation.":t.record.Depth()&&!t.record.Depth_Unit_Id()?"Select a unit of measure for the <strong>Depth<\/strong> field to enable calculation.":t.record.Diameter()&&!t.record.Diameter_Unit_Id()?"Select a unit of measure for the <strong>Diameter<\/strong> field to enable calculation.":t.record.Thickness()&&!t.record.Thickness_Unit_Id()?"Select a unit of measure for the <strong>Thickness<\/strong> field to enable calculation.":!t.record.Length()&&_.contains(["L x W x H","L x W x D","L x Diameter","L x W","L x H","L x D","L x H x T","L x W x T"],t.selectedDimensionType())?"Provide a value for the <strong>Length<\/strong> to enable calculation.":!t.record.Width()&&_.contains(["L x W x H","L x W x D","L x W","L x W x T"],t.selectedDimensionType())?"Provide a value for the <strong>Width<\/strong> to enable calculation.":!t.record.Height()&&_.contains(["L x W x H","L x H","W x H","L x H x T"],t.selectedDimensionType())?"Provide a value for the <strong>Height<\/strong> to enable calculation.":!t.record.Depth()&&_.contains(["L x W x D","L x D"],t.selectedDimensionType())?"Provide a value for the <strong>Depth<\/strong> to enable calculation.":!t.record.Diameter()&&_.contains(["L x Diameter"],t.selectedDimensionType())?"Provide a value for the <strong>Diameter<\/strong> to enable calculation.":!t.record.Thickness()&&_.contains(["L x H x T","L x W x T"],t.selectedDimensionType())?"Provide a value for the <strong>Thickness<\/strong> to enable calculation.":t.selectedUnitId()?null:"Select a Quantity unit of measure to enable mathematical calculation of the Quantity.":"Select a Dimension Type unit of measure to enable mathematical calculation of the Quantity.":"Calculations cannot be performed for the selected <strong>Dimension Type<\/strong>"});this.buttonContent=ko.observable('<i class="fas fa-fw fa-calculator" tabindex="0"><\/i>');this.buttonPopover={title:"Disabled",content:t.calcPopoverContent,html:!0,container:"body",position:"right",trigger:"hover focus"};this.calcValue=function(){if(!t.calcPopoverContent()){var n=t.getDimensions();switch(t.selectedDimensionType()){case"L x W x H":t.record.QuantityType()==="Volume"&&t.value(i(n.length*n.width*n.height));break;case"L x W x D":t.record.QuantityType()==="Volume"&&t.value(i(n.length*n.width*n.depth));break;case"L x Diameter":t.record.QuantityType()==="Volume"&&t.value(i(3.14159*Math.pow(n.diameter/2,2)*n.length));break;case"L x W x T":t.record.QuantityType()==="Volume"?t.value(i(n.length*n.width*n.thickness)):t.value(i(n.length*n.width));break;case"L x H x T":t.record.QuantityType()==="Volume"?t.value(i(n.length*n.height*n.thickness)):t.value(i(n.length*n.height));break;case"L x W":t.record.QuantityType()==="Area"&&t.value(i(n.length*n.width));break;case"L x H":t.record.QuantityType()==="Area"&&t.value(i(n.length*n.height));break;case"L x D":t.record.QuantityType()==="Area"&&t.value(i(n.length*n.depth));break;case"W x H":t.record.QuantityType()==="Area"&&t.value(i(n.width*n.height))}}};this.getDimensions=function(){return{length:r(t.record.Length(),t.record.Length_Unit_Id()),height:r(t.record.Height(),t.record.Height_Unit_Id()),width:r(t.record.Width(),t.record.Width_Unit_Id()),depth:r(t.record.Depth(),t.record.Depth_Unit_Id()),diameter:r(t.record.Diameter(),t.record.Diameter_Unit_Id()),thickness:r(t.record.Thickness(),t.record.Thickness_Unit_Id())}}},template:'<div class="form-group ftx-form-group" data-bind="visible: visible, validationElement: validation, validationOptions: { insertMessages: false }, css: { required: required }"> \t\t\t<label class="control-label ftx-control-label" data-bind="text: caption, attr: { \'for\': uniqueId508 }"><\/label>\t\t\t<div class="ftx-static-wrapper"> \t\t\t\t<div class="input-group" style="width:100%;" data-bind="attr: { id: uniqueId508 }"> \t\t\t\t\t<input type="text" class="form-control col-xs-5" style="float: left; width: 50%;" data-bind="numeric: value, autoNumericOptions: autoNumericOptions, valueUpdate: \'afterkeydown\'"> \t\t\t\t\t<select class="form-control col-xs-6" style="float: left;" data-bind="options: units, optionsText: \'Name\', optionsValue:\'Value\', optionsCaption: \'\', value: selectedUnitId, select2Text: selectedUnitText,                         select2: {                             placeholder: \'Select...\',                             minimumResultsForSearch: minimumResultsForSearch,                              }"> \t\t\t\t\t<\/select>                     <!-- ko if: calcPopoverContent() -->                     <span class="btn-default" tabindex="0" style="position:absolute;top:-1px;right:-42px;margin-left:6px;padding: 1px 3px 1px 4px;font-size:1.7em;border-radius:2px;cursor:not-allowed;text-align:center;" data-bind="bootstrapPopover: { title: \'Disabled\', content: calcPopoverContent, html: true, container: \'body\', position: \'right\', trigger: \'hover focus\' }">                        <i class="fas fa-fw fa-calculator"><\/i>                    <\/span>                    <!-- /ko -->                    <!-- ko ifnot: calcPopoverContent() -->                     <div class="btn-primary" tabindex="0" style="position:absolute;top:-1px;right:-42px;margin-left:6px;padding: 1px 3px 1px 4px;font-size:1.7em;border-radius:2px;cursor:pointer;text-align:center;" data-bind="click: calcValue">                        <i class="fas fa-fw fa-calculator"><\/i>                    <\/div>                    <!-- /ko --> \t\t\t\t<\/div>                 <span data-bind="validationMessage: validation" ><\/span > \t\t\t<\/div> \t<\/div>'});ko.components.register("ftx-caption-twd",{viewModel:function(n){this.caption=n.caption;this.value=n.value;this.units=n.units;this.selectedUnit=n.selectedUnit;this.visible=n.hasOwnProperty("visible")?n.visible:!0},template:'<div class="form-group ftx-form-group" data-bind="visible: visible, validationElement: value">             <label class="control-label ftx-control-label" data-bind="text: caption"><\/label>             <div class="ftx-static-wrapper">                 <textbox-with-dropdown params="value: value, units: units, selectedUnit: selectedUnit"><\/textbox-with-dropdown>            <\/div>         <\/div>'});ko.components.register("ftx-caption-value-badge",{viewModel:function(n){var t=n.hasOwnProperty("nullValue")?n.nullValue:"--";this.value=n.value===undefined||n.value===null?t:n.value;this.caption=n.caption;this.visible=n.hasOwnProperty("visible")?n.visible:!0;this.badgeClass=n.hasOwnProperty("badgeClass")?n.badgeClass:"badge-default"},template:'<div class="form-group ftx-form-group" data-bind="visible: visible">             <label class="control-label ftx-control-label" data-bind="uniqueFor: value, text: caption"><\/label>             <div class="ftx-static-wrapper comment-blockquote-container">                 <p class="form-control-static">                     <span class="badge" data-bind="css: badgeClass, visible: visible, text: value"><\/span>                 <\/p>             <\/div>         <\/div>'});ko.components.register("ftx-field-caption-bool",{viewModel:function(n){function t(n){this.value=n===undefined||n===null?e:n===ko.unwrap(f)?u:n?i:r}var i=n.hasOwnProperty("trueValue")?n.trueValue:"Yes",r=n.hasOwnProperty("falseValue")?n.falseValue:"No",u=n.hasOwnProperty("otherValueDescriptor")?n.otherValueDescriptor:"Unknown",f=n.hasOwnProperty("otherValue")?n.otherValue:-1,e=n.hasOwnProperty("nullValue")?n.nullValue:"--";this.moreInfo=n.moreInfo;t(ko.unwrap(n.value));ko.isObservable(n.value)&&n.value.subscribe(t);this.caption=n.caption},template:'<div class="form-group ftx-form-group">             <label class="control-label ftx-control-label" data-bind="uniqueFor: value">                 <!-- ko if: moreInfo -->                 <span data-bind="moreInfo: moreInfo"><\/span>                 <!-- /ko -->                 <span data-bind="text: caption"><\/span>             <\/label>             <div class="ftx-static-wrapper">                 <p class="form-control-static" data-bind="uniqueId: value, text: value"><\/p>             <\/div>         <\/div>'});ko.components.register("ftx-field-caption-coord",{viewModel:function(n){var t=n.hasOwnProperty("nullValue")?n.nullValue:"--";this.value=n.value===undefined||n.value===null?t:FACTRAX.formatGeoCoordinate(n.value);this.caption=n.caption;this.comment=n.hasOwnProperty("comment")?n.comment:""},template:'<div class="form-group ftx-form-group">             <label class="control-label ftx-control-label" data-bind="uniqueFor: value, text: caption"><\/label>             <div class="ftx-static-wrapper">                 <p class="form-control-static" data-bind="uniqueId: value, text: value"><\/p>             <\/div>         <\/div>'});ko.components.register("ftx-field-caption-currency",{viewModel:function(n){var t=n.hasOwnProperty("nullValue")?n.nullValue:"--";this.value=ko.pureComputed(function(){var i=ko.unwrap(n.value);return i===undefined||i===null?t:"$"+i.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g,",")});this.caption=n.caption},template:'<div class="form-group ftx-form-group">             <label class="control-label ftx-control-label" data-bind="uniqueFor: value, text: caption"><\/label>             <div class="ftx-static-wrapper">                 <p class="form-control-static" data-bind="uniqueId: value, text: value"><\/p>             <\/div>         <\/div>'});ko.components.register("ftx-field-caption-date",{viewModel:function(n){var i=n.hasOwnProperty("format")?n.format:"MMMM D, YYYY",r=n.hasOwnProperty("nullValue")?n.nullValue:"--",t=ko.isObservable(n.value)?n.value:ko.observable(n.value);this.value=ko.pureComputed(function(){return t()?moment.utc(t()).format(i):r});this.caption=n.caption;this.moreInfo=n.moreInfo;this.badge=n.badge},template:'<div class="form-group ftx-form-group">             <label class="control-label ftx-control-label" data-bind="uniqueFor: value">             <!-- ko if: moreInfo -->             <span data-bind="moreInfo: moreInfo"><\/span>             <!-- /ko -->            <span data-bind="uniqueFor: value, text: caption"/>             <\/label>             <div class="ftx-static-wrapper">                 <!-- ko ifnot: badge -->                 <p class="form-control-static" data-bind="uniqueId: value, text: value"><\/p>                 <!-- /ko -->                 <!-- ko if: badge -->                 <p class="form-control-static" data-bind="uniqueId: value, text: value, badge: badge"><\/p>                 <!-- /ko -->             <\/div>         <\/div>'});ko.components.register("ftx-field-caption-datetime",{viewModel:function(n){var t=n.hasOwnProperty("format")?n.format:FACTRAX.getDateTimeTzFormatString(),i=n.hasOwnProperty("nullValue")?n.nullValue:"--";this.value=ko.pureComputed(function(){var r=ko.unwrap(n.value);return r?moment.utc(r).tz(moment.tz.guess()).format(t):i});this.caption=n.caption;this.moreInfo=n.moreInfo;this.visible=n.visible?n.visible:!0},template:'<div class="form-group ftx-form-group" data-bind="visible: visible">             <label class="control-label ftx-control-label">                 <!-- ko if: moreInfo -->                 <span data-bind="moreInfo: moreInfo"><\/span>                 <!-- /ko -->                 <span data-bind="uniqueFor: value, text: caption"/>            <\/label>             <div class="ftx-static-wrapper">                 <p class="form-control-static" data-bind="uniqueId: value, text: value"><\/p>             <\/div>         <\/div>'});ko.components.register("ftx-field-caption-int",{viewModel:function(n){this.caption=n.caption;this.moreInfo=n.moreInfo;this.visible=n.hasOwnProperty("visible")?n.visible:!0;this.comment=n.hasOwnProperty("comment")?n.comment:"";this.requiredLength=n.hasOwnProperty("requiredLength")?n.requiredLength:0;this.lastActionDateFooter=n.lastActionDateFooter===undefined||n.lastActionDateFooter===null?null:"As of "+moment.utc(n.lastActionDateFooter).tz(moment.tz.guess()).format("MMMM Do, YYYY h:mm A z");this.showComments=ko.observable(!1);this.value=ko.computed(function(){var t=ko.unwrap(n.value),r,i;if(t===undefined||t===null?ko.unwrap(n.nullValue)||"--":t,n.requiredLength&&n.requiredLength>0&&t!=="--")for(r=t.toString().length,i=0;i<n.requiredLength-r;i++)t="0"+t;return t});this.showHideCommentCaption=ko.pureComputed(function(){return this.showComments()?"Hide Comments":"Show Comments"}.bind(this));this.showHideCommentsClick=function(){this.showComments(!this.showComments())}.bind(this);this.showCommentControls=ko.pureComputed(function(){return this.comment&&this.comment.length>0?!0:!1}.bind(this))},template:'<div class="form-group ftx-form-group" data-bind="visible: visible">             <label class="control-label ftx-control-label">             <!-- ko if: moreInfo -->             <span data-bind="moreInfo: moreInfo"><\/span>             <!-- /ko -->            <span data-bind="uniqueFor: value, text: caption"/>            <\/label>             <div class="ftx-static-wrapper comment-blockquote-container">                 <p class="form-control-static">                     <span data-bind="uniqueId: value, text: value" />                     <!--ko if: showCommentControls -->                    <span class="m-l-xs">                        (<a href="#" data-bind="text:showHideCommentCaption, click:showHideCommentsClick"/>)                     <\/span>                     <!-- /ko -->                <\/p>                 <!--ko if: lastActionDateFooter-->                <p class="form-control-static" style="font-style: italic; font-size: 8pt; margin-top: -15px">                     <span data-bind="text: lastActionDateFooter"><\/span>                 <\/p>                 <!-- /ko -->                 <!--ko if: showCommentControls-->                <blockquote data-bind="text:comment, css: { collapse: !showComments() }"><\/blockquote>                 <!-- /ko -->             <\/div>         <\/div>'});ko.components.register("ftx-field-caption-link-newtab",{viewModel:function(n){var t=n.hasOwnProperty("nullValue")?n.nullValue:"--";this.link=n.value!==undefined&&n.value!==null;this.value=this.link?n.value:t;this.caption=n.caption;this.href=n.href;this.title=n.title;this.icon=n.icon},template:'<div class="form-group ftx-form-group">             <label class="control-label ftx-control-label" data-bind="uniqueFor: value, text: caption"><\/label>             <div class="ftx-static-wrapper">                 <a target="_blank" data-bind="visible: link,                     attr: { href: href,                     title: title }">                     <i class="fa fa-lg" style="margin-right: 0px" data-bind="visible: icon, css: icon"><\/i>                     <p class="form-control-static" style="display:inline-block;" data-bind="uniqueId: value, text: value"><\/p>                 <\/a>                 <span data-bind="visible: !link">                     <p class="form-control-static" style="display:inline-block;" data-bind="uniqueId: value, text: value"><\/p>                 <\/span>             <\/div>         <\/div>'});ko.components.register("ftx-field-caption-link",{viewModel:function(n){var t=n.hasOwnProperty("nullValue")?n.nullValue:"--";this.link=n.value!==undefined&&n.value!==null;this.value=this.link?n.value:t;this.caption=n.caption;this.href=n.href;this.title=n.title;this.icon=n.icon;this.target=n.target?n.target:""},template:'<div class="form-group ftx-form-group">             <label class="control-label ftx-control-label" data-bind="uniqueFor: value, text: caption"><\/label>             <div class="ftx-static-wrapper">                 <a data-bind="visible: link,                     attr: { href: href,                     title: title,                     target: target }">                     <i class="fa fa-lg" style="margin-right: 0px" data-bind="visible: icon, css: icon"><\/i>                     <p class="form-control-static" style="display:inline-block;" data-bind="uniqueId: value, text: value"><\/p>                 <\/a>                 <span data-bind="visible: !link">                     <p class="form-control-static" style="display:inline-block;" data-bind="uniqueId: value, text: value"><\/p>                 <\/span>             <\/div>         <\/div>'});ko.components.register("ftx-field-caption-percent",{viewModel:function(n){var t=n.hasOwnProperty("nullValue")?n.nullValue:"--";this.value=ko.pureComputed(function(){var i=ko.unwrap(n.value||0)*100;return i=i.toFixed(n.decimalPlaces===undefined||n.decimalPlaces===null?0:n.decimalPlaces),ko.unwrap(n.value)===undefined||ko.unwrap(n.value)===null?t:i+"%"});this.caption=n.caption},template:'<div class="form-group ftx-form-group">             <label class="control-label ftx-control-label" data-bind="uniqueFor: value, text: caption"><\/label>             <div class="ftx-static-wrapper">                 <p class="form-control-static" data-bind="uniqueId: value, text: value"><\/p>             <\/div>         <\/div>'});ko.components.register("ftx-field-caption-text-show-more",{viewModel:function(n){var t=this;this.caption=n.caption;this.value=ko.computed(function(){var t=ko.unwrap(n.value);return t===undefined||t===null?ko.unwrap(n.nullValue)||"--":t});this.characterLimit=n.characterLimit||50;this.placement=n.placement||"bottom";this.title=n.showMoreTitle||"Show More";this.showMoreFn=n.showMoreFn||function(){FACTRAX.showMoreModal({title:n.showMoreTitle||"Show More",value:t.value()})};this.truncate="...";this.visible=n.hasOwnProperty("visible")?n.visible:!0;this.lastActionDateFooter=n.lastActionDateFooter===undefined||n.lastActionDateFooter===null?null:"As of "+moment.utc(n.lastActionDateFooter).tz(moment.tz.guess()).format("MMMM Do, YYYY h:mm A z")},template:'<div class="form-group ftx-form-group" data-bind="visible: visible">             <!-- ko if: caption -->             <label class="control-label ftx-control-label">             <span data-bind="uniqueFor: value, text: caption"/>             <\/label>             <!-- /ko -->             <div class="ftx-static-wrapper comment-blockquote-container">                 <p class="form-control-static">                     <!-- ko if: value().length > characterLimit -->                     <span data-bind="uniqueId: value, text: value().substring(0, characterLimit).trim() + truncate" />                     <span data-bind="moreInfoShowMore: { placement: placement, title: title, content: value, showMoreFn: showMoreFn }"><\/span>                     <!-- /ko -->                     <!-- ko ifnot: value().length > characterLimit -->                     <span data-bind="uniqueId: value, text: value" />                     <!-- /ko -->                 <\/p>                 <!--ko if: lastActionDateFooter-->                 <p class="form-control-static" style="font-style: italic; font-size: 8pt; margin-top: -15px">                     <span data-bind="text: lastActionDateFooter"><\/span>                 <\/p>                 <!-- /ko -->             <\/div>         <\/div>'});ko.components.register("ftx-field-caption-text",{viewModel:function(n){this.value=ko.pureComputed(function(){var t=ko.unwrap(n.value);return t===undefined||t===null?ko.unwrap(n.nullValue)||"--":t});this.appendedValueDateTime=n.value&&n.hasOwnProperty("appendedValueDateTime")?" on "+moment.utc(n.appendedValueDateTime).tz(moment.tz.guess()).format("MMMM Do, YYYY")+" at "+moment.utc(n.appendedValueDateTime).tz(moment.tz.guess()).format("h:mm A z"):null;this.html=n.html||!1;this.caption=n.caption;this.captionHtml=n.captionHtml||!1;this.moreInfo=n.moreInfo;this.visible=n.hasOwnProperty("visible")?n.visible:!0;this.comment=n.comment||"";this.lastActionDateFooter=n.lastActionDateFooter===undefined||n.lastActionDateFooter===null?null:"As of "+moment.utc(n.lastActionDateFooter).tz(moment.tz.guess()).format("MMMM Do, YYYY h:mm A z");this.showComments=ko.observable(!1);this.designatedByFooter=n.designatedOn===undefined||n.designatedOn===null||n.designatedBy===undefined||n.designatedBy===null?null:"Designated on "+moment.utc(n.designatedOn).tz(moment.tz.guess()).format("MMMM Do, YYYY h:mm A z")+" by "+n.designatedBy;this.customFooter=n.customFooter;this.popoverContent=n.popoverContent;this.showHideCommentCaption=ko.pureComputed(function(){return this.showComments()?"Hide Comments":"Show Comments"}.bind(this));this.accessibleCommentCaption=ko.pureComputed(function(){return n.hasOwnProperty("caption")&&n.caption.trim().length>0?" about "+n.caption.toLowerCase():""});this.showHideCommentsClick=function(){this.showComments(!this.showComments())}.bind(this);this.showCommentControls=ko.pureComputed(function(){var n=ko.unwrap(this.comment);return n&&n.length>0}.bind(this))},template:'<div class="form-group ftx-form-group" data-bind="visible: visible">             <label class="control-label ftx-control-label">             <!-- ko if: moreInfo -->             <span data-bind="moreInfo: moreInfo"><\/span>             <!-- /ko -->            <!-- ko if: captionHtml -->             <span data-bind="uniqueFor: value, html: captionHtml"/>            <!-- /ko -->            <!-- ko ifnot: captionHtml -->             <span data-bind="uniqueFor: value, text: caption"/>            <!-- /ko -->            <\/label>             <div class="ftx-static-wrapper comment-blockquote-container">                 <p class="form-control-static">                     <!-- ko if: html -->                     <span data-bind="uniqueId: value, html: value" />                     <!-- /ko -->                    <!-- ko ifnot: html -->                     <span data-bind="uniqueId: value, text: value" />                     <!-- ko if: popoverContent -->                     <i class="fa fa-info-circle" data-bind="bootstrapPopover: {                             title: caption,                             html: true,                             content: popoverContent,                             placement: \'right\',                             container: \'body\',                             trigger: \'focus hover\'                         }" tabindex="0" style="color:#31708f"><\/i>                     <!-- /ko -->                    <!-- /ko -->                    <span data-bind="uniqueId: appendedValueDateTime, text: appendedValueDateTime, visible: appendedValueDateTime" />                     <!--ko if: showCommentControls -->                    <span class="m-l-xs">                        (<a href="#" data-bind="click:showHideCommentsClick">                             <span data-bind="text: showHideCommentCaption"><\/span>                             <span class="sr-only" data-bind="text: accessibleCommentCaption" />                         <\/a>)                     <\/span>                     <!-- /ko -->                <\/p>                 <!-- ko if: designatedByFooter -->                <p class="form-control-static" style="font-style: italic; font-size: 8pt; margin-top: -15px">                     <span data-bind="text: designatedByFooter"><\/span>                 <\/p>                 <!-- /ko -->                 <!--ko if: lastActionDateFooter-->                <p class="form-control-static" style="font-style: italic; font-size: 8pt; margin-top: -15px">                     <span data-bind="text: lastActionDateFooter"><\/span>                 <\/p>                 <!-- /ko -->                 <!--ko if: customFooter-->                <p class="form-control-static" style="font-style: italic; font-size: 8pt; margin-top: -15px">                     <span data-bind="text: customFooter"><\/span>                 <\/p>                 <!-- /ko -->                 <!--ko if: showCommentControls-->                <blockquote data-bind="text:comment, css: { collapse: !showComments() }"><\/blockquote>                 <!-- /ko -->             <\/div>         <\/div>'});ko.components.register("ftx-caption-value-tristate",{viewModel:function(n){this.value=ko.computed(function(){return ko.unwrap(n.value)});this.caption=n.caption;this.htmlCaption=n.htmlCaption||!1;this.reason=n.hasOwnProperty("reason")?n.comment:!1},template:'<div class="form-group ftx-form-group">                   <!-- ko if: htmlCaption -->                   <label class="control-label ftx-control-label" data-bind="uniqueFor: value, html: caption"><\/label>                   <!-- /ko -->                   <!-- ko ifnot: htmlCaption -->                   <label class="control-label ftx-control-label" data-bind="uniqueFor: value, text: caption"><\/label>                   <!-- /ko -->                   <div class="ftx-static-wrapper">                        <div class="row">                            <div class="col-xs-3">                                <div class="form-control-static">                                   <!-- ko if: value() === true -->                                   <span class="badge badge-success" data-bind="uniqueId: value, text: \'Yes\'" />                                   <!-- /ko -->                                   <!-- ko if: value() === false -->                                   <span class="badge badge-default" data-bind="uniqueId: value, text: \'No\'" />                                   <!-- /ko -->                                   <!-- ko if: value() === undefined || value() === null -->                                   <span class="badge badge-danger" data-bind="uniqueId: value, text: \'Unanswered\'" />                                   <!-- /ko -->                                <\/div>                            <\/div>                            <div class="col-xs-9">                                <!-- ko if: reason -->                                    <label class="control-label ftx-control-label pull-left" data-bind="uniqueFor: reason">Reason: &nbsp;<\/label>                                    <div class="form-control-static pull-left" data-bind="text: reason"><\/div>                                <!-- /ko -->                            <\/div>                        <\/div>                    <\/div>               <\/div>'});ko.components.register("ftx-checklist-edit-bool-disabled",{viewModel:function(n){this.radioName=_.uniqueId("ftx-checklist-edit-bool-");this.value=n.value;this.caption=n.caption;this.moreInfoIf=n.moreInfoIf;this.moreInfoHtml=n.moreInfoHtml;this.css=ko.pureComputed(function(){return n.css?n.css:"pull-right"});this.bootstrapPopover=n.bootstrapPopover},template:'<div data-bind="validationElement: value, css: css, validationOptions: { insertMessages: false }, bootstrapPopover: bootstrapPopover" tabindex="0">             <label>&nbsp;&nbsp;<input type="radio" disabled data-bind="checkedValue: true, checked: value, iradio: true, attr: { name: radioName }"> <i><\/i> &nbsp;Yes <\/label>             &nbsp;             <label><input type="radio" disabled data-bind="checkedValue: false, checked: value, iradio: true, attr: { name: radioName }"> <i><\/i> &nbsp;No <\/label>         <\/div>         <span data-bind="text: caption"><\/span>'});ko.components.register("ftx-checklist-edit-bool",{viewModel:function(n){this.radioName=_.uniqueId("ftx-checklist-edit-bool-"+(n.caption?ko.unwrap(n.caption).replace(/\<[^>]*>/g,"").replace(/\s+/g,"-").toLowerCase():"custom"));this.radioName508=_.uniqueId(n.caption?ko.unwrap(n.caption).replace(/\<[^>]*>/g,"").replace(/\s+/g,"-").toLowerCase():"custom");this.value=n.value;this.caption=n.caption;this.moreInfo=n.moreInfo;this.useLabel=n.hasOwnProperty("useLabel")?n.useLabel:!1;this.html=n.hasOwnProperty("html")?n.html:!1;this.css=ko.pureComputed(function(){return n.css?ko.unwrap(n.css):"pull-right"});this.disableYes=n.disableYes;this.disableNo=n.disableNo;this.hideValidation=n.hideValidation;this.bootstrapPopover=n.bootstrapPopover;this.disabled508AttrFix=this.disableYes&&this.disableNo?{tabindex:0}:null;n.required&&this.caption(this.caption()+" *")},template:'<!-- ko ifnot: bootstrapPopover -->         <div role="radiogroup" data-bind="validationElement: value, css: css, validationOptions: { insertMessages: false }">             &nbsp;&nbsp;             <label data-bind="attr: { for: radioName508 + \'-yes\' }"><input type="radio" role="radio" data-bind="checkedValue: true, checked: value, iradio: true, attr: { name: radioName, disabled: disableYes, id: radioName508 + \'-yes\' }"> &nbsp;Yes <\/label>             &nbsp;             <label data-bind="attr: { for: radioName508 + \'-no\' }"><input type="radio" role="radio" data-bind="checkedValue: false, checked: value, iradio: true, attr: { name: radioName, disabled: disableNo, id: radioName508 + \'-no\' }"> &nbsp;No <\/label>         <\/div>         <!-- /ko -->         <!-- ko if: bootstrapPopover -->         <div role="radiogroup" data-bind="validationElement: value, css: css, validationOptions: { insertMessages: false }, attr: disabled508AttrFix, bootstrapPopover: bootstrapPopover">             &nbsp;&nbsp;             <label data-bind="attr: { for: radioName508 + \'-yes\' }"><input type="radio" role="radio" data-bind="checkedValue: true, checked: value, iradio: true, attr: { name: radioName, disabled: disableYes, id: radioName508 + \'-yes\' }"> &nbsp;Yes <\/label>             &nbsp;             <label data-bind="attr: { for: radioName508 + \'-no\' }"><input type="radio" role="radio" data-bind="checkedValue: false, checked: value, iradio: true, attr: { name: radioName, disabled: disableNo, id: radioName508 + \'-no\' }"> &nbsp;No <\/label>         <\/div>         <!-- /ko -->         <label data-bind="visible: useLabel, text: caption, attr: { \'for\': radioName508 }"><\/label>         <span data-bind="visible: !useLabel && !html, text: caption, attr: { \'for\': radioName508 }"><\/span>         <span data-bind="visible: !useLabel && html, html: caption, attr: { \'for\': radioName508 }"><\/span>         <!-- ko if: moreInfo -->         <span data-bind="moreInfo: moreInfo"><\/span>         <!-- /ko -->         <!-- ko ifnot: hideValidation -->         &nbsp<span data-bind="validationMessage: value" style="font-size: 10pt; color: red"><\/span>         <!-- /ko -->'});ko.components.register("ftx-checklist-edit-options",{viewModel:function(n){this.radioName=_.uniqueId("ftx-checklist-edit-options-");this.options=ko.unwrap(n.options);this.selected=n.selected;this.caption=n.caption;this.visible=n.hasOwnProperty("visible")?n.visible:!0;this.disableOptions=n.hasOwnProperty("disableOptions")?ko.unwrap(n.disableOptions):!1;this.required=n.hasOwnProperty("required")?n.required:!1;this.useLabel=n.hasOwnProperty("useLabel")?n.useLabel:!1;this.seperateLines=n.hasOwnProperty("seperateLines")?n.seperateLines:!1;this.pullRight=n.hasOwnProperty("pullRight")?n.pullRight:!0;this.moreInfo=n.moreInfo;this.css=ko.pureComputed(function(){return n.css?n.css:"pull-right"});this.parentCss=ko.pureComputed(function(){return n.parentCss?n.parentCss:"pull-right"})},template:'<div data-bind="css: parentCss">             <div data-bind="visible: visible, validationElement: selected, css: css, validationOptions: { insertMessages: false }">                 <div data-bind="foreach: options">                     <label style="display: inline-flex">&nbsp;&nbsp;<div><input type="radio" data-bind="checkedValue: Value, checked: $parent.selected, iradio: true, attr: { name: $parent.radioName, disabled: $parent.disableOptions }"><\/div> <i><\/i> &nbsp;<span data-bind="text: Name"><\/span><\/label>                     <!-- ko if: $parent.seperateLines --><br /><!-- /ko -->                <\/div>             <\/div>             <label data-bind="visible: useLabel && caption, html: caption"><\/label>             <span data-bind="visible: !useLabel && caption, html: caption"><\/span>             <!-- ko if: moreInfo -->                 <span data-bind="moreInfo: moreInfo"><\/span>             <!-- /ko -->         <\/div>'});ko.components.register("ftx-checklist-edit-outline-item",{viewModel:function(n){this.value=ko.isObservable(n.value)?n.value:ko.observable(n.value)},template:'<li data-bind="attr: { class: value().Class }">             <span data-bind="html: value().Text"><\/span>             <!-- ko if: value().Children && value().Children.length -->             <ul>                 <!-- ko foreach: value().Children -->                 <ftx-checklist-edit-outline-item params="value: $data"><\/ftx-checklist-edit-outline-item>                 <!-- /ko -->             <\/ul>             <!-- /ko -->         <\/li>'});ko.components.register("ftx-checklist-edit-outline",{viewModel:function(n){this.title=n.title;this.value=ko.isObservable(n.value)?n.value:ko.observable(n.value);this.child=n.child},template:'<!-- ko if: title -->         <div style="height: 30px;">             <div style="padding-top: 12px; font-size: 12pt; font-weight: bold; display: inline;" data-bind="text: title"><\/div>         <\/div>         <!-- /ko -->         <!-- ko if: value -->         <ul class="ddd">             <ftx-checklist-edit-outline-item params="value: value"><\/ftx-checklist-edit-outline-item>         <\/ul>         <!-- /ko -->'});ko.components.register("ftx-checklist-edit-table",{viewModel:function(n){var t=this;this.childTable=n.childTable;this.title=n.title;this.addButtonText=n.addButtonText;this.addButtonDropdown=n.addButtonDropdown;this.emptyTableMessage=n.emptyTableMessage;this.catE=t.title=="Building Damage"||t.title=="Vehicle or Equipment Damage"?!0:!1;this.add=function(){t.addButtonDropdown||t.childTable.add()};this.addFromDropdown=function(n){t.childTable.add(n.data)};this.apiAccessor=n.childTable.dataTableApiAccessor||ko.observable()},template:'<div style="height: 30px;">             <div class="ftx-checklist-edit-table-title" style="padding-top: 6px; font-size: 12pt; font-weight: bold; display: inline-block;" data-bind="text: title"><\/div>             <div class="pull-right btn-group" role="group">                 <button type="button" class="btn btn-create dropdown-toggle" data-bind="click: add" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> \t\t            <i class="fa fa-plus"><\/i>                     <span data-bind="text: catE ? addButtonText : \'Add\'"><\/span>                     <span class="caret" data-bind="visible: addButtonDropdown"><\/span> \t            <\/button> \t            <ul class="dropdown-menu" data-bind="foreach: addButtonDropdown">                     <li><a data-bind="text: text, click: $parent.addFromDropdown">Edit<\/a><\/li> \t            <\/ul>             <\/div>         <\/div>         <div class="table-responsive" data-bind="visible: childTable.data().length" style="padding-top: 6px; font-size: 10pt; width: 100%; padding-bottom: 25px">             <table class="table table-striped table-bordered" data-bind="dataTable: {options: childTable.dataTableOptions, data: childTable.data, apiAccessor: apiAccessor}"><\/table>         <\/div>         <div style="padding-top: 12px;" data-bind="ifnot: childTable.data().length">             <div class="alert alert-info" data-bind="text: emptyTableMessage"><\/div>         <\/div>'});ko.components.register("ftx-contact-box",{viewModel:function(n){var t=n.hasOwnProperty("nullValue")?n.nullValue:"--";this.Display_Name=n.Display_Name===undefined||n.Display_Name===null?t:n.Display_Name;this.Contact_Type=n.Contact_Type===undefined||n.Contact_Type===null?t:n.Contact_Type;this.Area_Code=n.Area_Code;this.Phone_Number=n.Phone_Number;this.Extension=n.Extension;this.Email=n.Email},template:'<div class="contact-box no-padding">                 <div class="p-xs">                     <div class="pull-right">                         <span class="label label-primary" data-bind="text: Contact_Type, attr: { class: \'label label-Contact\' + $data.Contact_Type }"><\/span>                     <\/div>                 <\/div>                                 <div class="p-lg">                     <h3 class="m-b-xs"><strong data-bind="text: Display_Name"><\/strong><\/h3>                     <div class="m-t-md">                         <abbr title="Phone" class="m-r-xs">P:<\/abbr><span data-bind="text: (Phone_Number ? FACTRAX.formatPhoneNumber(Area_Code, Phone_Number, Extension) : \'Phone number not provided\')"><\/span><br>                         <abbr title="Email" class="m-r-xs">E:<\/abbr><span data-bind="text: (Email || \'Email not provided\') "><\/span>                     <\/div>                 <\/div>                         <\/div>'});ko.components.register("ftx-contact-editor",{viewModel:function(n){var t=n.hasOwnProperty("nullValue")?n.nullValue:"--";this.type=n.type===undefined||n.type===null?t:n.type;this.empty=n.hasOwnProperty("empty")?n.empty:!1;this.name=n.name===undefined||n.name===null?t:n.name;this.title=n.title;this.phone=n.phone;this.email=n.email;this.edit=n.edit},template:'<div class="contact-box no-padding" style="min-height:180px;">             <div class="p-xs">                 <!-- ko if: edit -->                 <div class="pull-right">                     <button class="btn btn-xs btn-primary" data-bind="click: edit"><i class="fa fa-pencil"><\/i><span data-bind="text: type">Primary<span><\/button>                 <\/div>                 <!-- /ko -->             <\/div>                             <div class="p-lg">                 <!-- ko ifnot: empty -->                 <h3 class="m-b-xs"><strong data-bind="text: name"><\/strong><\/h3>                 <h5 class="m-b-xs"><i data-bind="text: title"><\/i><\/h5>                 <div class="m-t-md">                     <abbr title="Phone" class="m-r-xs">P:<\/abbr><span data-bind="text: phone || \'Phone number not provided\'"><\/span><br>                     <abbr title="email" class="m-r-xs">E:<\/abbr><span data-bind="text: email || \'Email not provided\'"><\/span>                 <\/div>                 <!-- /ko -->                 <!-- ko if: empty -->                 <label>No Contact Chosen<\/label>                 <!-- /ko -->             <\/div>         <\/div>'});ko.components.register("ftx-county-filter",{viewModel:function(n){this.selectedOptions=n.selectedOptions;this.loading=n.loading;this.eventCounties=ko.pureComputed(function(){return _.filter(n.options(),function(n){return n.EventCounty})});this.stateCounties=ko.pureComputed(function(){return _.filter(n.options(),function(n){return!n.EventCounty})})},template:'<!-- ko ifnot: loading -->         <select class="form-control" multiple style="max-height: 1px" data-bind="select2OnCloseSelectedOptions: selectedOptions, select2: { placeholder: \'Select...\'}">             <!-- ko if: eventCounties().length -->             <optgroup data-bind="foreach: eventCounties" label="Counties Declared">                 <option data-bind="text: Name, option: Value, data: { item: $data }"><\/option>             <\/optgroup>             <!-- /ko -->             <!-- ko if: stateCounties().length -->             <optgroup data-bind="foreach: stateCounties" label="Counties Not Declared">                 <option data-bind="text: Name, option: Value, data: { item: $data }"><\/option>             <\/optgroup>             <!-- /ko -->         <\/select>         <!-- /ko -->         <!-- ko if: loading -->         <input class="form-control select2-loading" value="Loading..." disabled />         <!-- /ko -->'});ko.components.register("ftx-documents-required",{viewModel:function(n){var i=this,t=ko.unwrap(n.requiredDocs);_.isArray(t)||(t=[t]);i.popover=ko.pureComputed(function(){if(t&&t.length>0){var n=$("<ul><\/ul>");return _.each(t,function(t){n.append("<li style='margin-left:5px'>"+t+"<\/li>")}),{title:"Documents Required",content:n.html(),html:!0,container:"#routerWindow",trigger:"hover focus",placement:"right"}}return null});i.docsRequiredText=ko.pureComputed(function(){return t&&t.length?t.length>1?t.length+" documents required":t.length+" document required":null});i.visible=n.visible||!0},template:'<span class="badge m-l-sm badge-success" style="cursor:help;color:white !important;" tabindex="0" data-bind="click:function(){ return false;}, text: docsRequiredText, bootstrapPopover: popover, visible: visible"><\/span>'});ko.components.register("ftx-eei-input-checkboxes",{viewModel:function(n){var t=this;t.value=n.value;var i=function(){var n=ko.unwrap(t.value);return n?JSON.parse(n):null},r=function(n){var t=i();return t&&t.answers&&t.answers[n]||null},u=function(n,r){var u=i()||{},f;u.answers||(u.answers={});u.answers[n]=r;u.incomplete=t.incomplete()?!0:undefined;f=_.find(_.values(u))?JSON.stringify(u):null;ko.isObservable(t.value)?t.value(f):t.value=f};t.options=n.options;t.readOnly=n.hasOwnProperty("readOnly")?n.readOnly:!1;t.showValidation=ko.pureComputed(function(){return n.hasOwnProperty("showValidation")?ko.unwrap(n.showValidation):!1});t.checkboxes=_.map(t.options.options,function(n){var e=r(n.name)||{},i=ko.observable(e.value),f=ko.observable(e.text),o=function(){_.defer(function(){u(n.name,i()?{value:i(),text:f()}:undefined)})},s;return i.subscribe(o),f.subscribe(o),s=function(){return i()&&n.textbox&&!f()},{name:n.name,textbox:n.textbox,value:i,text:f,readOnly:t.readOnly,showValidation:t.showValidation,error:ko.pureComputed(s)}});t.incompleteCheckboxes=ko.pureComputed(function(){return!_.find(t.checkboxes,function(n){return n.value()})});t.incomplete=ko.pureComputed(function(){var n=_.find(t.checkboxes,function(n){return n.error()});return n||t.incompleteCheckboxes()})},template:'<div data-bind="visible: options.caption, text: options.caption, css: { \'text-danger\': showValidation() && incomplete() }" class="m-b-xs"><\/div>          <div data-bind="foreach: checkboxes, css: { \'text-danger\': showValidation() && incompleteCheckboxes() }">             <div class="ftx-static-wrapper">                 <label style="font-weight: normal"><input type="checkbox" data-bind="checked: value, icheck: true, disable: readOnly" /><span class="lbl"><\/span> <span data-bind="text: name"><\/span><\/label>            <\/div>             <!-- ko if: textbox && value() -->             <div class="form-field" data-bind="css: { \'has-error\': showValidation() && error() }">                 <div data-bind="css: { \'text-danger\': showValidation() && error() }, text: textbox"><\/div>                 <textarea class="form-control" rows="3" data-bind="value: text, attr: { maxlength: 1000 }"><\/textarea>             <\/div>             <!-- /ko -->         <\/div>'});ko.components.register("ftx-eei-input-dimension",{viewModel:function(n){var t=this;t.value=n.value;var i=function(){var n=ko.unwrap(t.value);return n?JSON.parse(n):null},r=function(n){var t=i();return t&&t[n]||null},u=function(n,r){var u=i()||{},f;u[n]=r;f=_.find(_.values(u))?JSON.stringify(u):null;ko.isObservable(t.value)?t.value(f):t.value=f};t.number=ko.pureComputed({read:function(){return r("val")},write:function(n){u("val",n)}});t.selectedUnitId=ko.pureComputed({read:function(){return r("uom")},write:function(n){u("uom",n)}});t.units=n.units;t.selectedUnitText=ko.pureComputed(function(){var n=_.find(t.units(),function(n){return n.Unit_Of_Measure_Id===t.selectedUnitId()});return n&&n.Name});t.autoNumericOptions=n.autoNumericOptions||{mDec:4,vMin:"0",aPad:!1};t.readOnly=n.hasOwnProperty("readOnly")?n.readOnly:!1},template:'<div style="max-width: 500px;"> \t\t    <input type="text" class="form-control" style="width: 40%;" data-bind="numeric: number, autoNumericOptions: autoNumericOptions, valueUpdate: \'afterkeydown\', attr: { \'readonly\': readOnly }">             <!-- ko ifnot: readOnly --> \t\t\t<select class="form-control" style="width: 60%;" data-bind="options: units, optionsText: \'Name\', optionsValue:\'Unit_Of_Measure_Id\', optionsCaption: \'\', value: selectedUnitId, select2: { placeholder: \'Select...\', minimumResultsForSearch: 11 }"><\/select>             <!-- /ko -->             <!-- ko if: readOnly --> \t\t\t<input type="text" class="form-control" style="width: 60%;" data-bind="value: selectedUnitText" readonly>             <!-- /ko -->         <\/div>'});ko.components.register("ftx-eei-input-latlong",{viewModel:function(n){var t=this;t.value=n.value;var i=function(){var n=ko.unwrap(t.value);return n?JSON.parse(n):null},r=function(n){var t=i();return t&&t[n]||null},u=function(n,r){var u=i()||{},f;u[n]=r;f=_.find(_.values(u))?JSON.stringify(u):null;ko.isObservable(t.value)?t.value(f):t.value=f};t.latitude=ko.pureComputed({read:function(){return r("lat")},write:function(n){u("lat",n)}});t.longitude=ko.pureComputed({read:function(){return r("lon")},write:function(n){u("lon",n)}});t.latitudeAutoNumericOptions=n.autoNumericOptions||{mDec:5,vMin:"-90",vMax:"90",aPad:!1};t.longitudeAutoNumericOptions=n.autoNumericOptions||{mDec:5,vMin:"-180",vMax:"180",aPad:!1};t.readOnly=n.hasOwnProperty("readOnly")?n.readOnly:!1},template:'<div class="input-group" style="max-width: 500px;"> \t\t    <input type="text" class="form-control" placeholder="Latitude" title="Latitude" data-bind="numeric: latitude, autoNumericOptions: latitudeAutoNumericOptions, valueUpdate: \'afterkeydown\', attr: { \'readonly\': readOnly }">             <span class="input-group-addon" style="border: none;">,<\/span> \t\t    <input type="text" class="form-control" placeholder="Longitude" title="Longitude" data-bind="numeric: longitude, autoNumericOptions: longitudeAutoNumericOptions, valueUpdate: \'afterkeydown\', attr: { \'readonly\': readOnly }">         <\/div>'});ko.components.register("ftx-eei-input-text-dropdown",{viewModel:function(n){function o(){var n=ko.unwrap(i);return n?JSON.parse(n):null}function u(n){var t=o();return t&&t[n]||null}function f(n,t){var r=o()||{},u;r[n]=t;u=_.find(_.values(r))?JSON.stringify(r):null;ko.isObservable(i)?i(u):i=u}var t=ko.unwrap(n.options),h=1,r=_.map(t.options,function(n){return{Name:n,Value:h++}}),i=n.value,c=ko.pureComputed({read:function(){return u("text")},write:function(n){f("text",n)}}),l=ko.pureComputed({read:function(){return u("option")},write:function(n){f("option",n)}}),a=ko.pureComputed({read:function(){var t=u("option"),n=_.find(r,function(n){return n.Name===t});return n?n.Value:null},write:function(n){var t=_.find(r,function(t){return t.Value===n});f("option",t?t.Name:null)}}),v=t.numeric,e={},s;t.max&&(e.vMax=t.max==="thisYear"?(new Date).getFullYear():t.max);e.mDec=0;s=n.hasOwnProperty("readOnly")?n.readOnly:!1;$.extend(this,{text:c,option:l,optionById:a,numeric:v,autoNumericOptions:e,readOnly:s,selections:r})},template:'<div class="input-group" style="max-width: 500px;width:100%;">             <!-- ko if: numeric -->             <input type="text" class="form-control" style="float:left;width:50%;" data-bind="numeric: text, autoNumericOptions: autoNumericOptions, valueUpdate: \'afterkeydown\', attr: { \'readonly\': readOnly }">             <!-- /ko -->             <!-- ko ifnot: numeric -->             <input type="text" class="form-control" style="float:left;width:50%;" data-bind="value: text, valueUpdate: \'afterkeydown\', attr: { \'readonly\': readOnly }">             <!-- /ko -->             <!-- ko ifnot: readOnly -->             <select class="form-control" style="float:left;" data-bind="options: selections,                 optionsText: \'Name\',                 optionsValue: \'Value\',                 optionsCaption: \'\',                 value: optionById,                 select2: { placeholder: \'Select...\' }">            <\/select>             <!-- /ko -->             <!-- ko if: readOnly -->             <input type="text" style="float:left;width:50%;" class="form-control" data-bind="value: option" readonly>             <!-- /ko -->         <\/div>'});ko.components.register("ftx-eei-input-timespan",{viewModel:function(n){var t=this;t.value=n.value;var i=function(){var n=ko.unwrap(t.value);return n?JSON.parse(n):null},r=function(n){var t=i();return t&&t[n]||null},u=function(n,r){var u=i()||{},f;u[n]=r;f=_.find(_.values(u))?JSON.stringify(u):null;ko.isObservable(t.value)?t.value(f):t.value=f};_.each(["start","startTzCode","startTzOffset","end","endTzCode","endTzOffset"],function(n){t[n]=ko.pureComputed({read:function(){return r(n)},write:function(t){u(n,t)}})});t.options=n.options;t.tz=n.tz;t.readOnly=n.hasOwnProperty("readOnly")?n.readOnly:!1;t.minDateRebind=ko.observable(!0);t.minDate=ko.computed(function(){if(t.readOnly)return moment("0001-01-01").toDate();var n=t.start(),i=t.end();return n&&i&&moment(n).isAfter(moment(i))&&t.end(null),n?moment(n).toDate():moment("0001-01-01").toDate()});t.minDate.subscribe(function(n){t.minDateOld!==(n&&n.toString())&&(t.minDateOld=n&&n.toString(),t.minDateRebind(!1),t.minDateRebind(!0))});t.maxDate=ko.pureComputed(function(){return t.readOnly?null:new Date});t.tzCode=ko.pureComputed(function(){var i=t.startTzCode(),n;return i?i:(n=moment().tz(t.tz()),n)?n.format("z"):"UTC"});t.error=ko.pureComputed(function(){var i=t.start(),r=t.end(),n=i&&r&&moment.duration(moment(r).diff(moment(i)));return n&&t.options.maxDuration&&n.asSeconds()<0?"Start date is before end date.":n&&t.options.maxDuration&&n.asSeconds()>t.options.maxDuration?"This timespan is longer than "+moment.duration(t.options.maxDuration,"seconds").humanize()+".":null})},template:'<div class="input-group" style="max-width: 500px;">             <!-- ko ifnot: options.time -->             <span class="input-group-addon" style="border: none;">Start<\/span> \t\t    <input class="form-control" type="text" data-bind="datepicker: start, datepickerOptions: { endDate: maxDate() }, disable: readOnly" /><span class="input-group-addon"><i class="fa fa-calendar"><\/i><\/span>             <span class="input-group-addon" style="border: none;">End<\/span> \t\t    <input class="form-control" type="text" data-bind="datepicker: end, datepickerOptions: { startDate: minDate() }, disable: readOnly" /><span class="input-group-addon"><i class="fa fa-calendar"><\/i><\/span>             <!-- /ko -->             <!-- ko if: options.time -->             <span class="input-group-addon" style="border: none;">Start<\/span> \t\t    <input class="form-control" type="text" data-bind="dateTimePickerTz: { tz: tz, utc: start, offset: startTzOffset, code: startTzCode }, dateTimePickerOptions: { maxDate: maxDate(), useCurrent: false }, attr: { \'readonly\': readOnly }" /><span class="input-group-addon"><i class="fa fa-calendar"><\/i><\/span>             <span class="input-group-addon" style="border: none;">End<\/span> \t\t    <!-- ko if: minDateRebind --><input class="form-control" type="text" data-bind="dateTimePickerTz: { tz: tz, utc: end, offset: endTzOffset, code: endTzCode }, dateTimePickerOptions: { minDate: minDate(), useCurrent: false }, attr: { \'readonly\': readOnly }" /><span class="input-group-addon"><i class="fa fa-calendar"><\/i><\/span><!-- /ko -->             <!-- /ko -->         <\/div>         <!-- ko if: options.time --><small class="m-l-sm"><em>This time is specified in the timezone of the Applicant\'s primary location: <strong data-bind="text: tzCode"><\/strong><\/em><\/small><!-- /ko -->         <!-- ko if: error --><div class="m-l-sm text-danger" data-bind="text: error"><\/div><!-- /ko -->'});ko.components.register("ftx-export-comments-button",{viewModel:function(n){this.buttonId=ko.unwrap(n.buttonId);this.dataTableId=ko.unwrap(n.dataTableId);this.commentExportUrl=ko.unwrap(n.commentExportUrl);this.recordId=ko.unwrap(n.recordId);this.exportCommentsDt2=function(n,t){var r=$('[id="'+n+'"]'),u,i;if(r.button("loading"),u=$(t).DataTable(),i=$.extend(!0,{},u.ajax.params()),$(t).length){if(u.page.info().recordsDisplay>1e5){alert("You cannot export a list with more than 100,000 entries.");r.button("reset");return}FACTRAX.Tables.processColVis(u,i)}i.iUserTimezoneOffset=moment().utcOffset();i.sUserIANATimezone=moment.tz.guess();$.fileDownload(this.commentExportUrl+"/"+this.recordId,{successCallback:function(){r.button("reset")},failCallback:function(){alert("An error occurred while exporting the data.");r.button("reset")},httpMethod:"POST",data:i})}},template:'<button class="btn btn-sm btn-manage"             id="exportCommentsToCsvButton"             data-bind="click: exportCommentsDt2.bind($data, buttonId, dataTableId, commentExportUrl), attr:{\'id\':buttonId}">             <i class= "fas fa-download" ><\/i>Export to CSV<\/button>'});ko.components.register("ftx-field-caption-badge",{viewModel:function(n){var t=n.hasOwnProperty("nullValue")?n.nullValue:"--";this.value=n.value===undefined||n.value===null?t:n.value;this.caption=n.caption;this.visible=n.hasOwnProperty("visible")?n.visible:!0;this.isPNP=n.hasOwnProperty("isPNP")?n.isPNP:!1;this.moreInfo=n.moreInfo;this.modifyPnpType=n.hasOwnProperty("modifyPnpType")?n.modifyPnpType:null;this.showModifyPnp=n.hasOwnProperty("showModifyPnp")?n.showModifyPnp:null;this.isCritical=n.hasOwnProperty("isCritical")&&n.isCritical!=null?n.isCritical:!1;this.isNotCritical=n.hasOwnProperty("isCritical")&&n.isCritical!=null?!n.isCritical:!1},template:'<div class="form-group ftx-form-group" data-bind="visible: visible">             <label class="control-label ftx-control-label">             <!-- ko if: moreInfo -->             <span data-bind="moreInfo: moreInfo"><\/span>             <!-- /ko -->            <span data-bind="uniqueFor: value, text: caption"/>            <\/label>             <div class="ftx-static-wrapper comment-blockquote-container">                 <p class="form-control-static">                     <span class="form-control-static" data-bind="uniqueId: value, text: value"><\/span>                     <span class="badge" style="margin-left:5px;" data-bind="visible: isPNP">PNP<\/span>                     <span class="badge badge-danger" style="margin-left:5px;" data-bind="visible: isCritical">Critical<\/span>                     <span class="badge badge-default" style="margin-left:5px;" data-bind="visible: isNotCritical">Not Critical<\/span>                     <span class="form-control-static" data-bind= "visible: showModifyPnp"> &nbsp;&nbsp;&nbsp;(<a data-bind="click: modifyPnpType"><i class="fas fa-fw fa-pencil-alt"><\/i>Modify<\/a>)<\/span>                <\/p>             <\/div>         <\/div>'});ko.components.register("ftx-jstree-search",{viewModel:function(n){var t=n.treeSelector,r=ko.observable(),i=ko.observable(null),u=_.debounce(function(){var n=r();!n||/^\s*$/.test(n)?$(t).jstree("clear_search"):$(t).jstree("search",n,!1,!1,null,!1,!1)},200);r.subscribe(function(){u()});$(t).on("search.jstree",function(n,t){i(t.res.length)});$(t).on("clear_search.jstree",function(){i(null)});$(t).on("model.jstree",function(){u()});this.searchText=r;this.resultText=ko.pureComputed(function(){return i()==null?null:i()+(i()==1?" Result":" Results")})},template:'<div class="btn-group jstree-search-control">            <input type="search" class="form-control input-sm" placeholder="Search..." data-bind="value: searchText, valueUpdate: \'afterkeydown\'" />            <span class="fa fa-fw fa-times" data-bind="click: searchText.bind($data, null)"><\/span>            <i data-bind="visible: resultText, text: resultText"><\/i>        <\/div>'});ko.components.register("ftx-latlong-edit",{viewModel:function(n){var t=this,i=n.lat,r=n.long;this.inputsClass=_.uniqueId("ftx-latlong-edit-inputs-");this.lat=ko.observable(i());this.long=ko.observable(r());this.uniqueIdLat=_.uniqueId("latitude");this.uniqueIdLong=_.uniqueId("longitude");var f=i.subscribe(function(n){t.lat(n)}),e=r.subscribe(function(n){t.long(n)}),u=function(){var n=t.lat(),u=t.long();$("#"+t.inputsClass+":focus").length||(i()!==n&&i(n),r()!==u&&r(u))},o=this.lat.subscribe(u),s=this.long.subscribe(u);this.dispose=function(){f.dispose();e.dispose();o.dispose();s.dispose()}},template:'<div class="input-group">             <input class="form-control" type="text" data-bind="value: lat, css: inputsClass, attr: { id: uniqueIdLat }" placeholder="Latitude" />             <span class="input-group-addon" style="border: none; background: none;">,<\/span>             <input class="form-control" type="text" data-bind="value: long, css: inputsClass, attr: { id: uniqueIdLong }" placeholder="Longitude" />         <\/div>'});ko.components.register("ftx-manage-btn",{viewModel:function(n){this.click=n.click;this.href=n.href;this.title=n.title||n.text;this.icon="fas "+(n.icon||"fa-cog");this.text=n.text||"Manage";this.disableReason=n.disableReason||null},template:'<!-- ko ifnot: disableReason -->         <!-- ko if: click -->         <button type="button" class="btn btn-sm btn-manage" style="text-transform:uppercase;" data-bind="click: click, attr: { title: title }"><i data-bind="attr: { class: icon }"><\/i><span data-bind="text: text"><\/span><\/button>         <!-- /ko -->         <!-- ko ifnot: click -->         <a class="btn btn-sm btn-manage" data-bind="attr: { href: href, title: title }"><i data-bind="attr: { class: icon }"><\/i><span data-bind="text: text"><\/span><\/a>         <!-- /ko -->         <!-- /ko -->         <!-- ko if: disableReason -->         <button type="button" class="btn btn-sm btn-manage" style="text-transform:uppercase;" data-bind="disableWithPointerEvents: true,              bootstrapPopover: {                trigger: \'hover focus\',                placement: \'bottom\',                content: disableReason,                title: text + \' Disabled\'         }"><i data-bind="attr: { class: icon }"><\/i><span data-bind="text: text"><\/span><\/button>         <!-- /ko -->         <!-- /ko -->'});ko.components.register("ftx-more-info",{viewModel:{createViewModel:function(n,t){var i={};return i.innerContents="",_.each(t.templateNodes,function(n){i.innerContents+=$("<div>").append(n).html()}),i.bodyClass=ko.unwrap(n.bodyClass),i.body=ko.pureComputed(function(){var t=ko.unwrap(n.body),r=t===undefined||t===null?i.innerContents:t;return typeof i.bodyClass!="undefined"&&(r='<div class="'+i.bodyClass+'">'+r+"<\/div>"),r}),i.title=ko.unwrap(n.title)||"More Info",i.moreInfoFn=function(){FACTRAX.moreInfoModal({title:i.title,body:i.body()})},i.fontSize=n.fontSize||null,i.label=ko.unwrap(n.label)||"( More Info )",i}},template:'&nbsp;<span>              <a class="cursor-pointer" style="color: #005288; display: inline-block" data-bind="style: { \'font-size\': fontSize }, click: moreInfoFn, text: label" href="javascript:void(0);"><\/a>          <\/span>'});ko.components.register("ftx-outline-item",{viewModel:function(n){this.value=ko.isObservable(n.value)?n.value:ko.observable(n.value)},template:'<li data-bind="attr: { class: value().Class }">             <span data-bind="text: value().Text"><\/span>             <!-- ko if: value().Children && value().Children.length -->             <ul>                 <!-- ko foreach: value().Children -->                 <ftx-checklist-edit-outline-item params="value: $data"><\/ftx-checklist-edit-outline-item>                 <!-- /ko -->             <\/ul>             <!-- /ko -->         <\/li>'});ko.components.register("ftx-outline",{viewModel:function(n){this.value=ko.isObservable(n.value)?n.value:ko.observable(n.value);this.child=n.child},template:'<!-- ko if: value -->         <ul class="ddd">             <ftx-checklist-edit-outline-item params="value: value"><\/ftx-checklist-edit-outline-item>         <\/ul>         <!-- /ko -->'});ko.components.register("ftx-outlook-list-item-obligation",{viewModel:function(n){this.event=ko.pureComputed(function(){return ko.unwrap(n.event)});this.cursorStyle=this.event().Validation_Message?"not-allowed":"pointer"},template:'<button tabindex="-1" class="btn btn-xs btn-danger pull-right disabled" data-bind="visible: event().Validation_Message">Disabled<\/button>         <div class="form-horizontal ftx-form ftx-caption-sm-7 ftx-value-sm-5">             <span data-bind="text: event().Name" style="text-decoration: underline; font-size: 11pt"><\/span>             <div class="form-group ftx-form-group">                 <label class="ftx-control-label" style="text-align: right; padding-right: 0px; margin-bottom: 0px" data-bind="style: { cursor: cursorStyle }">                     <small>Awaiting Obligation Cost<\/small>                 <\/label>                 <div class="ftx-static-wrapper">                     <small class="form-control-static" data-bind="text: FACTRAX.Tables.currencyRenderer(event().Awaiting_Obligation_Cost)"><\/small>                 <\/div>             <\/div>             <div class="form-group ftx-form-group">                 <label class="ftx-control-label" style="text-align: right; padding-right: 0px; margin-bottom: 0px" data-bind="style: { cursor: cursorStyle }">                     <small># Awaiting Obligation<\/small>                 <\/label>                 <div class="ftx-static-wrapper">                     <small class="form-control-static" data-bind="text: event().Awaiting_Obligation_Count"><\/small>                 <\/div>             <\/div>             <div class="form-group ftx-form-group">                 <label class="ftx-control-label" style="text-align: right; padding-right: 0px; margin-bottom: 0px" data-bind="style: { cursor: cursorStyle }">                     <small>Awaiting Deobligation Cost<\/small>                 <\/label>                 <div class="ftx-static-wrapper">                     <small class="form-control-static" data-bind="text: FACTRAX.Tables.currencyRenderer(event().Awaiting_Deobligation_Cost)"><\/small>                 <\/div>             <\/div>             <div class="form-group ftx-form-group">                 <label class="ftx-control-label" style="text-align: right; padding-right: 0px; margin-bottom: 0px" data-bind="style: { cursor: cursorStyle }">                     <small># Awaiting Deobligation<\/small>                 <\/label>                 <div class="ftx-static-wrapper">                     <small class="form-control-static" data-bind="text: event().Awaiting_Deobligation_Count"><\/small>                 <\/div>             <\/div>             <div class="form-group ftx-form-group">                 <label class="ftx-control-label" style="text-align: right; padding-right: 0px; margin-bottom: 0px" data-bind="style: { cursor: cursorStyle }">                     <small>User Obligation Limit<\/small>                 <\/label>                 <div class="ftx-static-wrapper">                     <small class="form-control-static" data-bind="text: event().Obligation_Limit_Display"><\/small>                 <\/div>             <\/div>         <\/div>'});ko.components.register("ftx-question-answer-text",{viewModel:function(n){this.answer=ko.computed(function(){var t=ko.unwrap(n.answer);return t===undefined||t===null?"Unanswered":t===!0?"Yes":t===!1?"No":t});this.blockAnswer=n.blockAnswer;this.question=n.question;this.visible=n.hasOwnProperty("visible")?n.visible:!0;this.comment=n.hasOwnProperty("comment")?n.comment:"";this.showComments=ko.observable(!1);this.commentDescription=n.hasOwnProperty("commentDescription")?n.commentDescription:"";this.showHideCommentCaption=ko.pureComputed(function(){return this.showComments()?"Hide Additional Information":"Show Additional Information"}.bind(this));this.screenReaderComment=ko.pureComputed(function(){return this.showScreenReaderComment()?" about "+this.commentDescription:""}.bind(this));this.showScreenReaderComment=ko.pureComputed(function(){return this.commentDescription&&this.commentDescription.length>0?!0:!1}.bind(this));this.showHideCommentsClick=function(){this.showComments(!this.showComments())}.bind(this);this.showCommentControls=ko.pureComputed(function(){return this.comment&&this.comment.length>0?!0:!1}.bind(this));this.paddingBottom=n.hasOwnProperty("paddingBottom")?n.paddingBottom:"1em";this.paddingLeft=n.hasOwnProperty("paddingLeft")?n.paddingLeft:"0em";this.fontSize=n.hasOwnProperty("fontSize")?n.fontSize:"11pt"},template:'<div data-bind="visible: visible, style: { paddingBottom: paddingBottom, paddingLeft: paddingLeft, fontSize: fontSize }">             <span data-bind="text: question"><\/span>&nbsp;             <!-- ko ifnot: blockAnswer -->                 <strong data-bind="text: answer"><\/strong>             <!-- /ko -->             <!--ko if: showCommentControls -->             <span class="m-l-xs" style="font-size: 9pt">            (<a href="#" data-bind="click:showHideCommentsClick">             <span data-bind="text:showHideCommentCaption"/>             <!-- ko if: showScreenReaderComment -->             <span class="sr-only" data-bind="text:screenReaderComment"/>             <!-- /ko -->             <\/a>)             <\/span>             <!-- /ko -->             <!--ko if: showCommentControls-->            <blockquote data-bind="text:comment, css: { collapse: !showComments() }" style="font-size: 9pt; margin-bottom: 0px"><\/blockquote>             <!-- /ko -->             <!-- ko if: blockAnswer -->             <span style="font-size: 9pt" data-bind="html: answer"><\/span>             <!-- /ko -->         <\/div>'});ko.components.register("ftx-radio-button-group",{viewModel:function(n){var t=this,i=_.uniqueId("ftx-radio-button-group-"),r=n.defaultStyle||"btn-default";this.value=n.value;this.options=_.map(n.options,function(n){return $.extend({},n,{inputName:i,css:ko.pureComputed(function(){return(n.style||r)+(t.value()===n.value?" active":"")}),checked:ko.pureComputed(function(){return t.value()===n.value?"checked":null}),click:function(){t.value(n.value)},optionUniqueId:i+"-"+n.value})})},template:'<div class="btn-group" data-toggle="buttons" data-bind="foreach: options">             <label class="btn" data-bind="click: click, css: css, attr: { for: optionUniqueId }">                 <input type="radio" autocomplete="off" data-bind="attr: { name: inputName, checked: checked, id: optionUniqueId }"><i class="fa" data-bind="visible: $data.icon, css: $data.icon"><\/i><span data-bind="text: name"><\/span>             <\/label>         <\/div>'});ko.components.register("ftx-schedule-checkbox-multi-value",{viewModel:function(n){this.checked=n.checked;this.fields=n.fields;this.fieldWidth=n.fieldWidth||2;this.fieldStyle="col-xs-"+this.fieldWidth+" checkbox-cost-row cost-input";this.checkWidthStyle="col-xs-"+(12-this.fieldWidth*this.fields.length)+" checkbox-cost-row";this.checkBoxLabel=n.checkBoxLabel;this.checkBoxMoreInfoTitle=n.checkBoxMoreInfoTitle;this.checkBoxMoreInfoBody=n.checkBoxMoreInfoBody;this.whisperText=n.whisperText;this.whisperMoreInfoTitle=n.whisperMoreInfoTitle;this.whisperMoreInfoBody=n.whisperMoreInfoBody;this.radioQuestion=n.radioQuestion;this.radioOptions=n.radioOptions;this.radioValue=n.radioValue;this.radioWhisperText=n.radioWhisperText;this.subtext=n.subtext;this.checkedExplainTitle=n.checkedExplainTitle;this.checkedExplain=n.checkedExplain;this.checkedExplainSubtext=n.checkedExplainSubtext;this.afterCheckBoxLabel=n.afterCheckBoxLabel;this.disable=n.disable?ko.isObservable(n.disable)?n.disable:ko.observable(n.disable):ko.observable();var t=this;this.disableICheckFix=ko.pureComputed({read:function(){return t.disable()},write:function(){}});this.marginRight=window.chrome?"-26px":"-22px"},template:'<div data-bind="class: \'checkWidthStyle\'" >             <div class="checkbox">                 <label class="checkbox-cost-row-label" data-bind="bootstrapPopover: disable() ? {                trigger: \'hover focus\',                 placement: \'bottom\',                 content: disable,                 title: \'Disabled\',                 html: true,                 container: \'body\'             } : { trigger: \'manual\', content: \'--\' }">                     <input type="checkbox" data-bind="checked: checked, icheck: true, disable: disableICheckFix" />                     <span class="checkbox-cost-checkbox-label" data-bind="text: checkBoxLabel"><\/span><span data-bind="html: afterCheckBoxLabel"><\/span>                     <!-- ko if: checkBoxMoreInfoBody -->                     <ftx-more-info params="title: checkBoxMoreInfoTitle, fontSize: \'18px\',                         body: checkBoxMoreInfoBody                     "><\/ftx-more-info>                     <!-- /ko -->                 <\/label>             <\/div>         <\/div>         <div data-bind="foreach: fields">             <div data-bind="validationElement: validation, class: $parent.fieldStyle">                 <div class="input-group" style="margin-top: -25px">                     <!-- ko if: enabled -->                     <div>                         <label class="checkbox-cost-cost-label" data-bind="text: label"><\/label>                         <input type="text" class="form-control" data-bind="uniqueId: value, moneyInput: value, enable: true" />                         <span class="pull-right" style="font-size: 20px" data-bind="html: suffix, style: { \'margin-right\': marginRight }"><\/span>                     <\/div>                     <!-- /ko -->                     <!-- ko ifnot: enabled -->                     <div tabindex="0" data-bind="bootstrapPopover: disabledPopover">                         <label class="checkbox-cost-cost-label" data-bind="text: label"><\/label>                         <input type="text" class="form-control" data-bind="uniqueId: value, moneyInput: value, enable: false" />                         <span class="pull-right" style="font-size: 20px" data-bind="html: suffix, style: { \'margin-right\': marginRight }"><\/span>                     <\/div>                     <!-- /ko -->                     <div data-bind="validationMessage: validation"><\/div>                 <\/div>             <\/div>         <\/div>         <div class="col-xs-9">             <!-- ko if: whisperText -->             <div class="checkbox-cost-form-whispertext" data-bind="visible: checked">                 <span data-bind="html: whisperText"><\/span>                 <!-- ko if: whisperMoreInfoBody -->                 <ftx-more-info params="title: whisperMoreInfoTitle,                     body: whisperMoreInfoBody                 "><\/ftx-more-info>                 <!-- /ko -->             <\/div>             <!-- /ko -->             <!-- ko if: subtext -->             <div class="checkbox-cost-form-subtext" data-bind="visible: checked">                 <p data-bind="html: subtext"><\/p>             <\/div>             <!-- /ko -->             <!-- ko if: radioQuestion && checked -->             <div class="form-group" data-bind="validationElement: radioValue, validationOptions: { insertMessages: false }">                 <div class="checkbox-cost-form-text">                     <label class="subheader-first required-field-indicator">                         <span data-bind="html: radioQuestion"><\/span>                     <\/label>                     <div data-bind="foreach: radioOptions">                         <label class="radio-label" style="display: inline-flex">                         &nbsp;&nbsp;                             <input type="radio" data-bind="checkedValue: Value, checked: $parent.radioValue, iradio: true, attr: { name: \'pa-sa-legal\' }"> <i><\/i> &nbsp;<span data-bind="text: Name"><\/span><span data-bind="html: ($data.AfterName && $data.AfterName()) || null"><\/span>                         <\/label>                         <!-- ko if: $parent.radioWhisperText -->                         <div style="margin-left: 2.5em"><p data-bind="html: $parent.radioWhisperText, visible: $parent.radioValue() === Value && $parent.enableAmount()"><\/p><\/div>                         <!-- /ko -->                         <!-- ko ifnot: $parent.radioWhisperText -->                         <br />                         <!-- /ko -->                     <\/div>                     <div>                         <span class="has-error" data-bind="validationMessage: radioValue"><\/span>                     <\/div>                 <\/div>             <\/div>             <!-- /ko -->             <!-- ko if: checkedExplainTitle && checked -->             <div class="form-group" data-bind="validationElement: checkedExplain">                 <div class="checkbox-cost-form-text">                     <label class="subheader-first" data-bind="css: { \'required-field-indicator\': checkBoxLabel != \'Labor\' }">                         <span data-bind="html: checkedExplainTitle"><\/span>                     <\/label>                     <div>                         <textarea type="text" class="form-control" data-bind="value: checkedExplain, attr: { rows: 2 }"><\/textarea>                     <\/div>                 <\/div>             <\/div>             <!-- /ko -->             <!-- ko if: checkedExplainSubtext -->             <div class="checkbox-cost-form-subtext" data-bind="visible: checked">                 <span data-bind="html: checkedExplainSubtext"><\/span>             <\/div>             <!-- /ko -->         <\/div>'});ko.components.register("ftx-schedule-checkbox-sum-summary",{viewModel:function(n){this.checked=n.checked;this.answersEnableAmount=n.answersEnableAmount;this.enableAmount=ko.pureComputed(function(){return ko.unwrap(n.checked)&&ko.unwrap(n.answersEnableAmount)!==!1});this.checkBoxLabel=n.checkBoxLabel;this.checkBoxMoreInfoTitle=n.checkBoxMoreInfoTitle;this.checkBoxMoreInfoBody=n.checkBoxMoreInfoBody;this.amountLabel=n.amountLabel;this.completedAmount=n.completedAmount;this.futureAmount=n.futureAmount;this.calculatedAmount=ko.pureComputed(function(){return(n.completedAmount()||0)+(n.futureAmount()||0)||undefined});this.whisperText=n.whisperText;this.whisperMoreInfoTitle=n.whisperMoreInfoTitle;this.whisperMoreInfoBody=n.whisperMoreInfoBody;this.radioQuestion=n.radioQuestion;this.radioOptions=n.radioOptions;this.radioValue=n.radioValue;this.radioWhisperText=n.radioWhisperText;this.subtext=n.subtext;this.checkedExplainTitle=n.checkedExplainTitle;this.checkedExplain=n.checkedExplain;this.checkedExplainSubtext=n.checkedExplainSubtext;this.afterCheckBoxLabel=n.afterCheckBoxLabel;this.marginRight=window.chrome?"-26px":"-22px"},template:'<div class="col-xs-6 checkbox-cost-row" data-bind="visible: checked">             <div class="checkbox">                 <div class="checkbox-cost-row-label">                     <i class="fa-fw far fa-check-square fa-lg m-l-sm m-r-xs"><\/i><span class="checkbox-cost-checkbox-label" data-bind="text: checkBoxLabel"><\/span><span data-bind="html: afterCheckBoxLabel"><\/span>                     <!-- ko if: checkBoxMoreInfoBody -->                     <ftx-more-info params="title: checkBoxMoreInfoTitle, fontSize: \'18px\',                         body: checkBoxMoreInfoBody                     "><\/ftx-more-info>                     <!-- /ko -->                 <\/div>             <\/div>         <\/div>         <div class="col-xs-2 checkbox-cost-row cost-input" data-bind="visible: checked">             <div class="input-group" style="margin-top: -25px">                 <label class="checkbox-cost-cost-label" data-bind="text: \'Completed \' + amountLabel"><\/label>                 <input type="text" class="form-control" data-bind="uniqueId: completedAmount, moneyInput: completedAmount, enable: false" />                 <span class="pull-right" style="font-size: 20px" data-bind="style: { \'margin-right\': marginRight }"> + <\/span>             <\/div>         <\/div>         <div class="col-xs-2 checkbox-cost-row cost-input" data-bind="visible: checked">             <div class="input-group" style="margin-top: -25px">                 <label class="checkbox-cost-cost-label" data-bind="text: \'Future \' + amountLabel"><\/label>                 <input type="text" class="form-control" data-bind="uniqueId: futureAmount, moneyInput: futureAmount, enable: false" />                 <span class="pull-right" style="font-size: 20px" data-bind="style: { \'margin-right\': marginRight }"> = <\/span>             <\/div>         <\/div>         <div class="col-xs-2 checkbox-cost-row cost-input" data-bind="visible: checked">             <div class="input-group" style="margin-top: -25px">                 <label class="checkbox-cost-cost-label" data-bind="text: \'Total \' + amountLabel"><\/label>                 <input type="text" class="form-control" data-bind="uniqueId: calculatedAmount, moneyInput: calculatedAmount, enable: false" />             <\/div>         <\/div>         <div class="col-xs-9">             <!-- ko if: whisperText -->             <div class="checkbox-cost-form-whispertext" data-bind="visible: checked">                 <span data-bind="html: whisperText"><\/span>                 <!-- ko if: whisperMoreInfoBody -->                 <ftx-more-info params="title: whisperMoreInfoTitle,                     body: whisperMoreInfoBody                 "><\/ftx-more-info>                 <!-- /ko -->             <\/div>             <!-- /ko -->             <!-- ko if: subtext -->             <div class="checkbox-cost-form-subtext" data-bind="visible: checked">                 <p data-bind="html: subtext"><\/p>             <\/div>             <!-- /ko -->             <!-- ko if: radioQuestion && checked -->             <div class="form-group" data-bind="validationElement: radioValue">                 <div class="checkbox-cost-form-text">                     <label class="subheader-first">                         <span data-bind="html: radioQuestion"><\/span>                     <\/label>                     <div data-bind="foreach: radioOptions">                         <!-- ko if: $parent.radioValue() === Value -->                         <ul>                             <li data-bind="text: Name">                                 <span data-bind="html: ($data.AfterName && $data.AfterName()) || null"><\/span>                                 <!-- ko if: $parent.radioWhisperText -->                                 <div style="margin-left: 2.5em><p data-bind="html: $parent.radioWhisperText, visible: $parent.radioValue() === Value && $parent.enableAmount()"><\/p><\/div>                                 <!-- /ko -->                             <\/li>                         <\/ul>                         <br />                         <!-- /ko -->                     <\/div>                 <\/div>             <\/div>             <!-- /ko -->             <!-- ko if: checkedExplainTitle && checked -->             <div class="form-group" data-bind="validationElement: checkedExplain">                 <div class="checkbox-cost-form-text">                     <label class="subheader-first">                         <span data-bind="html: checkedExplainTitle"><\/span>                     <\/label>                     <div>                         <textarea type="text" class="form-control" data-bind="value: checkedExplain, attr: { rows: 2 }, enable: false"><\/textarea>                     <\/div>                 <\/div>             <\/div>             <!-- /ko -->             <!-- ko if: checkedExplainSubtext -->             <div class="checkbox-cost-form-subtext" data-bind="visible: checked">                 <span data-bind="html: checkedExplainSubtext"><\/span>             <\/div>             <!-- /ko -->         <\/div>'});ko.components.register("ftx-schedule-checkbox-sum",{viewModel:function(n){this.checked=n.checked;this.enableAmount=ko.pureComputed(function(){return ko.unwrap(n.checked)&&ko.unwrap(n.answersEnableAmount)!==!1});this.checkBoxLabel=n.checkBoxLabel;this.checkBoxMoreInfoTitle=n.checkBoxMoreInfoTitle;this.checkBoxMoreInfoBody=n.checkBoxMoreInfoBody;this.amountLabel=n.amountLabel||"Cost";this.completedAmount=n.completedAmount;this.futureAmount=n.futureAmount;this.calculatedAmount=ko.pureComputed(function(){return(n.completedAmount()||0)+(n.futureAmount()||0)||undefined});n.calculatedAmount=this.calculatedAmount;this.requiredDocs=ko.unwrap(n.requiredDocs);this.whisperText=n.whisperText;this.whisperMoreInfoTitle=n.whisperMoreInfoTitle;this.whisperMoreInfoBody=n.whisperMoreInfoBody;this.alwaysVisibleWhisperText=n.alwaysVisibleWhisperText;this.radioQuestion=n.radioQuestion;this.radioOptions=n.radioOptions;this.radioValue=n.radioValue;this.radioWhisperText=n.radioWhisperText;this.radioDisabled=n.radioDisabled?ko.isObservable(n.radioDisabled)?n.radioDisabled:ko.observable(n.radioDisabled):ko.observable();this.subtext=n.subtext;this.checkedExplainTitle=n.checkedExplainTitle;this.checkedExplain=n.checkedExplain;this.checkedExplainSubtext=n.checkedExplainSubtext;this.afterCheckBoxLabel=n.afterCheckBoxLabel;this.disable=n.disable?ko.isObservable(n.disable)?n.disable:ko.observable(n.disable):ko.observable();var t=this;this.disableICheckFix=ko.pureComputed({read:function(){return t.disable()},write:function(){}});this.marginRight=window.chrome?"-26px":"-22px";this.popoverLabel=this.checkBoxLabel+(this.checkBoxLabel.substr(this.checkBoxLabel.length-this.amountLabel.length)===this.amountLabel?"":" "+this.amountLabel);this.popoverContent=n.popoverContent||"To enter "+this.popoverLabel+", check the box to the left."},template:'<div class="col-xs-6 checkbox-cost-row">             <div class="checkbox">                 <label class="checkbox-cost-row-label" data-bind="bootstrapPopover: disable() ? {                trigger: \'hover focus\',                 placement: \'bottom\',                 content: disable,                 title: \'Disabled\',                 html: true,                 container: \'body\'             } : { trigger: \'manual\', content: \'--\' }">                     <input type="checkbox" data-bind="checked: checked, icheck: true, disable: disableICheckFix" />                     <span class="checkbox-cost-checkbox-label" data-bind="text: checkBoxLabel"><\/span><span data-bind="html: afterCheckBoxLabel"><\/span>                     <!-- ko if: checkBoxMoreInfoBody -->                     <ftx-more-info params="title: checkBoxMoreInfoTitle, fontSize: \'18px\',                         body: checkBoxMoreInfoBody                     "><\/ftx-more-info>                     <!-- /ko -->                 <\/label>                 <!-- ko if: requiredDocs && checked -->                 <ftx-documents-required params="requiredDocs: requiredDocs" style="margin-bottom:5px" ><\/ftx-documents-required>                 <!-- /ko -->             <\/div>         <\/div>         <div class="col-xs-2 checkbox-cost-row cost-input" data-bind="validationElement: completedAmount">             <div class="input-group" style="margin-top: -25px">                 <!-- ko if: enableAmount -->                 <div>                     <label class="checkbox-cost-cost-label" data-bind="text: \'Completed \' + amountLabel"><\/label>                     <input type="text" class="form-control" data-bind="uniqueId: completedAmount, moneyInput: completedAmount, enable: true" />                     <span class="pull-right" style="font-size: 20px" data-bind="style: { \'margin-right\': marginRight }"> + <\/span>                 <\/div>                 <!-- /ko -->                 <!-- ko ifnot: enableAmount -->                 <div tabindex="0" data-bind="bootstrapPopover: { title: \'Disabled\', content: popoverContent, container: \'body\', trigger: \'hover focus\', placement: \'top\' }">                     <label class="checkbox-cost-cost-label" data-bind="text: \'Completed \' + amountLabel"><\/label>                     <input type="text" class="form-control" data-bind="uniqueId: completedAmount, moneyInput: completedAmount, enable: false" />                     <span class="pull-right" style="font-size: 20px" data-bind="style: { \'margin-right\': marginRight }"> + <\/span>                 <\/div>                 <!-- /ko -->                 <div data-bind="validationMessage: completedAmount"><\/div>             <\/div>         <\/div>         <div class="col-xs-2 checkbox-cost-row cost-input" data-bind="validationElement: futureAmount">             <div class="input-group" style="margin-top: -25px">                 <!-- ko if: enableAmount -->                 <div>                     <label class="checkbox-cost-cost-label" data-bind="text: \'Future \' + amountLabel"><\/label>                     <input type="text" class="form-control" data-bind="uniqueId: futureAmount, moneyInput: futureAmount, enable: true" />                     <span class="pull-right" style="font-size: 20px" data-bind="style: { \'margin-right\': marginRight }"> = <\/span>                 <\/div>                 <!-- /ko -->                 <!-- ko ifnot: enableAmount -->                 <div tabindex="0" data-bind="bootstrapPopover: { title: \'Disabled\', content: popoverContent, container: \'body\', trigger: \'hover focus\', placement: \'top\' }">                     <label class="checkbox-cost-cost-label" data-bind="text: \'Future \' + amountLabel"><\/label>                     <input type="text" class="form-control" data-bind="uniqueId: futureAmount, moneyInput: futureAmount, enable: false" />                     <span class="pull-right" style="font-size: 20px" data-bind="style: { \'margin-right\': marginRight }"> = <\/span>                 <\/div>                 <!-- /ko -->                 <div data-bind="validationMessage: futureAmount"><\/div>             <\/div>         <\/div>         <div class="col-xs-2 checkbox-cost-row cost-input">             <div class="input-group" style="margin-top: -25px">                 <label class="checkbox-cost-cost-label" data-bind="text: \'Total \' + amountLabel"><\/label>                 <div tabindex="0" data-bind="bootstrapPopover: { title: \'Disabled\', content: \'The Total \' + amountLabel + \' for \' + popoverLabel + \' is automatically calculated by adding the Completed \' + amountLabel + \' and Future \' + amountLabel + \' together.\', container: \'body\', trigger: \'hover focus\', placement: \'top\' }">                     <input type="text" class="form-control" data-bind="uniqueId: calculatedAmount, moneyInput: calculatedAmount, enable: false" />                 <\/div>             <\/div>         <\/div>         <div class="col-xs-9">             <!-- ko if: alwaysVisibleWhisperText -->             <div class="checkbox-cost-form-whispertext">                 <span data-bind="html: alwaysVisibleWhisperText"><\/span>             <\/div>             <!-- /ko -->             <!-- ko if: whisperText -->             <div class="checkbox-cost-form-whispertext" data-bind="visible: checked">                 <span data-bind="html: whisperText"><\/span>                 <!-- ko if: whisperMoreInfoBody -->                 <ftx-more-info params="title: whisperMoreInfoTitle,                     body: whisperMoreInfoBody                 "><\/ftx-more-info>                 <!-- /ko -->             <\/div>             <!-- /ko -->             <!-- ko if: subtext -->             <div class="checkbox-cost-form-subtext" data-bind="visible: checked">                 <p data-bind="html: subtext"><\/p>             <\/div>             <!-- /ko -->             <!-- ko if: radioQuestion && checked -->             <div class="form-group" data-bind="validationElement: radioValue, validationOptions: { insertMessages: false }">                 <div class="checkbox-cost-form-text radio-container">                     <label class="subheader-first required-field-indicator">                         <span data-bind="html: radioQuestion"><\/span>                     <\/label>                     <div data-bind="foreach: radioOptions">                         <label class="radio-label" style="display: inline-flex" data-bind="bootstrapPopover: $parent.radioDisabled() ? {                        trigger: \'hover focus\',                         placement: \'bottom\',                         content: $parent.radioDisabled,                         title: \'Disabled\',                         html: true,                         container: \'body\'                     } : { trigger: \'manual\', content: \'--\' }">                         &nbsp;&nbsp;                             <input type="radio" data-bind="checkedValue: Value, checked: $parent.radioValue, iradio: true, attr: { name: \'pa-sa-legal\' }, disable: $parent.radioDisabled"> <i><\/i> &nbsp;<span data-bind="text: Name"><\/span><span data-bind="html: ($data.AfterName && $data.AfterName()) || null"><\/span>                         <\/label>                         <!-- ko if: $data.RequiredDocs && $parent.radioValue() === Value -->                         <ftx-documents-required params="requiredDocs: $data.RequiredDocs" style="margin-bottom:5px" ><\/ftx-documents-required>                         <!-- /ko -->                         <!-- ko if: $parent.radioWhisperText -->                         <div style="margin-left: 2.5em"><p data-bind="html: $parent.radioWhisperText, visible: $parent.radioValue() === Value && $parent.enableAmount()"><\/p><\/div>                         <!-- /ko -->                         <!-- ko ifnot: $parent.radioWhisperText -->                         <br />                         <!-- /ko -->                     <\/div>                     <div>                         <span class="has-error" data-bind="validationMessage: radioValue"><\/span>                     <\/div>                 <\/div>             <\/div>             <!-- /ko -->             <!-- ko if: checkedExplainTitle && checked -->             <div class="form-group" data-bind="validationElement: checkedExplain">                 <div class="checkbox-cost-form-text">                     <label class="subheader-first" data-bind="css: { \'required-field-indicator\': checkBoxLabel != \'Labor\' }">                         <span data-bind="html: checkedExplainTitle"><\/span>                     <\/label>                     <div>                         <textarea type="text" class="form-control" data-bind="value: checkedExplain, attr: { rows: 2 }"><\/textarea>                     <\/div>                 <\/div>             <\/div>             <!-- /ko -->             <!-- ko if: checkedExplainSubtext -->             <div class="checkbox-cost-form-subtext" data-bind="visible: checked">                 <span data-bind="html: checkedExplainSubtext"><\/span>             <\/div>             <!-- /ko -->         <\/div>'});ko.components.register("ftx-schedule-checkbox-value-summary",{viewModel:function(n){this.checked=n.checked;this.answersEnableAmount=n.answersEnableAmount;this.enableAmount=ko.pureComputed(function(){return ko.unwrap(n.checked)&&ko.unwrap(n.answersEnableAmount)!==!1});this.checkBoxLabel=n.checkBoxLabel;this.checkBoxMoreInfoTitle=n.checkBoxMoreInfoTitle;this.checkBoxMoreInfoBody=n.checkBoxMoreInfoBody;this.costLabel=n.costLabel;this.cost=n.cost;this.whisperText=n.whisperText;this.whisperMoreInfoTitle=n.whisperMoreInfoTitle;this.whisperMoreInfoBody=n.whisperMoreInfoBody;this.radioQuestion=n.radioQuestion;this.radioOptions=n.radioOptions;this.radioValue=n.radioValue;this.radioWhisperText=n.radioWhisperText;this.subtext=n.subtext;this.checkedExplainTitle=n.checkedExplainTitle;this.checkedExplain=n.checkedExplain;this.afterCheckBoxLabel=n.afterCheckBoxLabel},template:'<div class="col-xs-10 checkbox-cost-row" data-bind="visible: checked">             <div class="checkbox">                 <div class="checkbox-cost-row-label">                     <i class="fa-fw far fa-check-square fa-lg m-l-sm m-r-xs"><\/i>                     <span class="checkbox-cost-checkbox-label" data-bind="text: checkBoxLabel"><\/span><span data-bind="html: afterCheckBoxLabel"><\/span>                     <!-- ko if: checkBoxMoreInfoBody -->                     <ftx-more-info params="title: checkBoxMoreInfoTitle, fontSize: \'18px\',                         body: checkBoxMoreInfoBody                     "><\/ftx-more-info>                     <!-- /ko -->                 <\/div>             <\/div>         <\/div>         <div class="col-xs-2 checkbox-cost-row cost-input" data-bind="visible: checked">             <div class="input-group" style="margin-top: -25px">                 <label class="checkbox-cost-cost-label" data-bind="text: costLabel"><\/label>                 <input type="text" class="form-control" data-bind="uniqueId: cost, moneyInput: cost, enable: false" />             <\/div>         <\/div>         <div class="col-xs-10" data-bind="visible: checked">             <!-- ko if: whisperText -->             <div class="checkbox-cost-form-whispertext" data-bind="visible: checked">                 <span data-bind="html: whisperText"><\/span>                 <!-- ko if: whisperMoreInfoBody -->                 <ftx-more-info params="title: whisperMoreInfoTitle,                     body: whisperMoreInfoBody                 "><\/ftx-more-info>                 <!-- /ko -->             <\/div>             <!-- /ko -->             <!-- ko if: subtext -->             <div class="checkbox-cost-form-subtext" data-bind="visible: checked">                 <p data-bind="html: subtext"><\/p>             <\/div>             <!-- /ko -->             <!-- ko if: radioQuestion && checked -->             <div class="form-group" data-bind="validationElement: radioValue">                 <div class="checkbox-cost-form-text">                     <label class="subheader-first">                         <span data-bind="html: radioQuestion"><\/span>                     <\/label>                     <div data-bind="foreach: radioOptions">                         <!-- ko if: $parent.radioValue() === Value -->                         <ul>                             <li data-bind="text: Name">                                 <span data-bind="html: ($data.AfterName && $data.AfterName()) || null"><\/span>                                 <!-- ko if: $parent.radioWhisperText -->                                 <div style="margin-left: 2.5em><p data-bind="html: $parent.radioWhisperText, visible: $parent.radioValue() === Value && $parent.enableAmount()"><\/p><\/div>                                 <!-- /ko -->                             <\/li>                         <\/ul>                         <br />                         <!-- /ko -->                     <\/div>                 <\/div>             <\/div>             <!-- /ko -->             <!-- ko if: checkedExplainTitle && checked -->             <div class="form-group" data-bind="validationElement: checkedExplain">                 <div class="checkbox-cost-form-text">                     <label class="subheader-first">                         <span data-bind="html: checkedExplainTitle"><\/span>                     <\/label>                     <div>                         <textarea type="text" class="form-control" data-bind="value: checkedExplain, attr: { rows: 2 }, enable: false"><\/textarea>                     <\/div>                 <\/div>             <\/div>             <!-- /ko -->         <\/div>'});ko.components.register("ftx-schedule-checkbox-value",{viewModel:function(n){this.checked=n.checked;this.answersEnableAmount=n.answersEnableAmount;this.enableAmount=ko.pureComputed(function(){return ko.unwrap(n.checked)&&ko.unwrap(n.answersEnableAmount)!==!1});this.checkBoxLabel=n.checkBoxLabel;this.checkBoxMoreInfoTitle=n.checkBoxMoreInfoTitle;this.checkBoxMoreInfoBody=n.checkBoxMoreInfoBody;this.costLabel=n.costLabel;this.cost=n.cost;this.whisperText=n.whisperText;this.whisperMoreInfoTitle=n.whisperMoreInfoTitle;this.whisperMoreInfoBody=n.whisperMoreInfoBody;this.radioQuestion=n.radioQuestion;this.radioOptions=n.radioOptions;this.radioValue=n.radioValue;this.radioWhisperText=n.radioWhisperText;this.subtext=n.subtext;this.subtextMoreInfoTitle=n.subtextMoreInfoTitle;this.subtextMoreInfoBody=n.subtextMoreInfoBody;this.checkedExplainTitle=n.checkedExplainTitle;this.checkedExplain=n.checkedExplain;this.afterCheckBoxLabel=n.afterCheckBoxLabel;this.disable=n.disable?ko.isObservable(n.disable)?n.disable:ko.observable(n.disable):ko.observable();this.requiredDocs=ko.unwrap(n.requiredDocs);var t=this;this.disableICheckFix=ko.pureComputed({read:function(){return t.disable()},write:function(){}});this.popoverLabel=n.popoverLabel||this.checkBoxLabel+(this.checkBoxLabel.substr(this.checkBoxLabel.length-this.costLabel.length)===this.costLabel?"":" "+this.costLabel);this.popoverContent=n.popoverContent||"To enter "+this.popoverLabel+", check the box to the left."},template:'<div class="col-xs-10 checkbox-cost-row">             <div class="checkbox">                 <label class="checkbox-cost-row-label" data-bind="bootstrapPopover: disable() ? {                trigger: \'hover focus\',                 placement: \'bottom\',                 content: disable,                 title: \'Disabled\',                 html: true,                 container: \'body\'             } : { trigger: \'manual\', content: \'--\' }">                     <input type="checkbox" data-bind="checked: checked, icheck: true, disable: disableICheckFix" />                     <span class="checkbox-cost-checkbox-label" data-bind="text: checkBoxLabel"><\/span><span data-bind="html: afterCheckBoxLabel"><\/span>                     <!-- ko if: checkBoxMoreInfoBody -->                     <ftx-more-info params="title: checkBoxMoreInfoTitle, fontSize: \'18px\',                         body: checkBoxMoreInfoBody                     "><\/ftx-more-info>                     <!-- /ko -->                 <\/label>                 <!-- ko if: requiredDocs && checked -->                 <ftx-documents-required params="requiredDocs: requiredDocs"><\/ftx-documents-required>                 <!-- /ko -->             <\/div>         <\/div>         <div class="col-xs-2 checkbox-cost-row cost-input" data-bind="validationElement: cost">             <div class="input-group" style="margin-top: -25px">                 <label class="checkbox-cost-cost-label" data-bind="text: costLabel"><\/label>                 <!-- ko if: enableAmount -->                 <div>                 <input type="text" class="form-control" data-bind="uniqueId: cost, moneyInput: cost, enable: true" />                 <\/div>                 <!-- /ko -->                 <!-- ko ifnot: enableAmount -->                 <div tabindex="0" data-bind="bootstrapPopover: { title: \'Disabled\', content: popoverContent, container: \'body\', trigger: \'hover focus\', placement: \'left\' }">                 <input type="text" class="form-control" data-bind="uniqueId: cost, moneyInput: cost, enable: false" />                 <\/div>                 <!-- /ko -->                 <div data-bind="validationMessage: cost"><\/div>             <\/div>         <\/div>         <div class="col-xs-10">             <!-- ko if: whisperText -->             <div class="checkbox-cost-form-whispertext" data-bind="visible: checked">                 <span data-bind="html: whisperText"><\/span>                 <!-- ko if: whisperMoreInfoBody -->                 <ftx-more-info params="title: whisperMoreInfoTitle,                     body: whisperMoreInfoBody                 "><\/ftx-more-info>                 <!-- /ko -->             <\/div>             <!-- /ko -->             <!-- ko if: subtext -->             <div class="checkbox-cost-form-subtext" data-bind="visible: checked">                 <p>                     <span data-bind="html: subtext"><\/span>                     <!-- ko if: subtextMoreInfoBody -->                     <ftx-more-info params="title: subtextMoreInfoTitle,                         body: subtextMoreInfoBody                     "><\/ftx-more-info>                     <!-- /ko -->                 <\/p>             <\/div>             <!-- /ko -->             <!-- ko if: radioQuestion && checked -->             <div class="form-group" data-bind="validationElement: radioValue, validationOptions: { insertMessages: false }">                 <div class="checkbox-cost-form-text">                     <label class="subheader-first required-field-indicator">                         <span data-bind="html: radioQuestion"><\/span>                     <\/label>                     <div data-bind="foreach: radioOptions">                         <label class="radio-label" style="display: inline-flex">                         &nbsp;&nbsp;                             <input type="radio" data-bind="checkedValue: Value, checked: $parent.radioValue, iradio: true, attr: { name: \'pa-sa-legal\' }"> <i><\/i> &nbsp;<span data-bind="text: Name"><\/span><span data-bind="html: ($data.AfterName && $data.AfterName()) || null"><\/span>                         <\/label>                         <!-- ko if: $parent.radioWhisperText -->                         <div style="margin-left: 2.5em"><p data-bind="html: $parent.radioWhisperText, visible: $parent.radioValue() === Value && $parent.enableAmount()"><\/p><\/div>                         <!-- /ko -->                         <!-- ko ifnot: $parent.radioWhisperText -->                         <br />                         <!-- /ko -->                     <\/div>                     <div>                         <span class="has-error" data-bind="validationMessage: radioValue"><\/span>                     <\/div>                 <\/div>             <\/div>             <!-- /ko -->             <!-- ko if: checkedExplainTitle && checked -->             <div class="form-group" data-bind="validationElement: checkedExplain">                 <div class="checkbox-cost-form-text">                     <label class="subheader-first" data-bind="css: { \'required-field-indicator\': checkBoxLabel != \'Labor\' }">                         <span data-bind="html: checkedExplainTitle"><\/span>                     <\/label>                     <div>                         <textarea type="text" class="form-control" data-bind="value: checkedExplain, attr: { rows: 2 }"><\/textarea>                     <\/div>                 <\/div>             <\/div>             <!-- /ko -->         <\/div>'});ko.components.register("ftx-schedule-latlong-edit",{viewModel:function(n){this.lat=n.lat;this.long=n.long;this.LatLong_Validation=n.LatLong_Validation||ko.observable();this.isRequired=n.isRequired;this.isReadOnly=n.isReadOnly||!1;this.latText="Latitude"+(this.isRequired?" *":"");this.longText="Longitude"+(this.isRequired?" *":"")},template:'<div data-bind="validationElement: LatLong_Validation, css: { "required": !isReadOnly && isRequired }">             <div class="row" style="max-width: 300px;" data-bind="validationElement: lat">                 <div class="col-xs-6">                     <label class="pull-right m-t-xs" data-bind="uniqueFor: lat, text: latText, css: { "required-field-indicator": !isReadOnly && isRequired }"><\/label>                 <\/div>                 <div class="col-xs-6" style="margin-bottom: 10px">                     <input type="text" class="form-control" data-bind="uniqueId: lat, numeric: lat, autoNumericOptions: { mDec: 6 }, disable: isReadOnly" placeholder="Latitude" />                 <\/div>             <\/div>             <div class="row" style="max-width: 300px;" data-bind="validationElement: long">                 <div class="col-xs-6">                     <label class="pull-right m-t-xs" data-bind="uniqueFor: long, text: longText, css: { "required-field-indicator": !isReadOnly && isRequired }"><\/label>                 <\/div>                 <div class="col-xs-6">                     <input type="text" class="form-control" data-bind="uniqueId: long, numeric: long, autoNumericOptions: { mDec: 6 }, disable: isReadOnly" placeholder="Longitude" />                 <\/div>             <\/div>             <div class="row" style="max-width: 300px;" data-bind="if: !isReadOnly">                 <div class="col-xs-6"><\/div>                 <div class="col-xs-6">                     <div data-bind="validationMessage: LatLong_Validation"><\/div>                 <\/div>             <\/div>         <\/div>'});ko.components.register("ftx-schedule-value-net-cost",{viewModel:function(n){this.subtotal=n.subtotal;this.cost=n.cost;this.net=n.net},template:'<div class="col-xs-12" style="margin-top: 5em;"> <\/div>         <div class="col-xs-10 m-t-sm m-b-sm">             <div class= "pull-right m-r-sm" >                 <label class="checkbox-cost-cost-label">Project Cost<\/label>             <\/div>         <\/div>         <div class="col-xs-2 m-b-sm">             <div class="input-group">                 <input type="text" class="form-control" data-bind="uniqueId: cost, moneyInput:  cost, enable: false" />             <\/div>         <\/div>         <div class="col-xs-10 m-t-sm m-b-sm">             <div class="pull-right m-r-sm">                 <label class="checkbox-cost-cost-label">Total Deductions<\/label>             <\/div>         <\/div>         <div class="col-xs-2 m-b-md">             <div style="position: relative; left: -20px; top: 20px; width: 10px; height: 2px; background-color: #676a6c;"><\/div>             <div class="input-group">                 <input type="text" class="form-control" data-bind="uniqueId: subtotal, moneyInput:  subtotal, enable: false" />             <\/div>         <\/div>         <div class="col-xs-10 m-t-sm m-b-sm">             <div class="pull-right m-r-sm">                 <label class="checkbox-cost-cost-label">Net Cost<\/label>             <\/div>         <\/div>         <div class="col-xs-2 m-b-sm">             <div class="input-group">                 <div style="margin: -10px -10px 10px -150px; height: 2px; background-color: #676a6c;"><\/div>                 <input type="text" class="form-control" data-bind="uniqueId: net, moneyInput:  net, enable: false" />             <\/div>         <\/div>'});ko.components.register("ftx-schedule-value-sub-total",{viewModel:function(n){this.subtotal=n.subtotal;this.cost=n.cost},template:'<div class="col-xs-12" style="margin-top: 5em;"> <\/div>         <div class="col-xs-10 m-t-sm m-b-sm">             <div class= "pull-right m-r-sm" >                 <label class="checkbox-cost-cost-label">Project Cost<\/label>             <\/div>         <\/div>         <div class="col-xs-2 m-b-sm">             <div class="input-group">                 <input type="text" class="form-control" data-bind="uniqueId: cost, moneyInput:  cost, enable: false" />             <\/div>         <\/div>         <div class="col-xs-10 m-t-sm m-b-sm">             <div class="pull-right m-r-sm">                 <label class="checkbox-cost-cost-label">Total Deductions<\/label>             <\/div>         <\/div>         <div class="col-xs-2 m-b-md">             <div style="position: relative; left: -20px; top: 20px; width: 10px; height: 2px; background-color: #676a6c;"><\/div>             <div class="input-group">                 <input type="text" class="form-control" data-bind="uniqueId: subtotal, moneyInput:  subtotal, enable: false" />             <\/div>         <\/div>'});ko.components.register("ftx-schedule-value-subtotal-summary",{viewModel:function(n){this.subtotal=n.subtotal},template:'<div class="col-xs-12" style="margin-top: 5em;"> <\/div>         <div class="col-xs-10 m-t-sm">             <div class="pull-right m-r-sm">                 <label class="checkbox-cost-cost-label">Project Cost<\/label>             <\/div>         <\/div>         <div class="col-xs-2">             <div class="input-group">                 <div style="margin: -10px -10px 10px -150px; height: 2px; background-color: #676a6c;"><\/div>                 <input type="text" class="form-control" data-bind="uniqueId: subtotal, moneyInput:  subtotal, enable: false" />             <\/div>         <\/div>'});ko.components.register("ftx-schedule-value-subtotal",{viewModel:function(n){this.subtotal=n.subtotal},template:'<div class="col-xs-12" style="margin-top: 5em;"> <\/div>         <div data-bind="validationElement: subtotal">              <div class="col-xs-10 m-t-sm">                 <div class="pull-right m-r-sm">                     <label class="checkbox-cost-cost-label">Project Cost<\/label>                 <\/div>             <\/div>             <div class="col-xs-2">                 <div class="input-group">                     <div style="margin: -10px -10px 10px -150px; height: 2px; background-color: #676a6c;"><\/div>                     <input type="text" class="form-control" data-bind="uniqueId: subtotal, moneyInput:  subtotal, enable: false" />                 <\/div>                 <div data-bind="validationMessage: subtotal"><\/div>             <\/div>         <\/div>'});ko.components.register("ftx-show-more",{viewModel:function(n){var t=this;this.value=ko.pureComputed(function(){var t=ko.unwrap(n.value);return t===undefined||t===null?ko.unwrap(n.nullValue)||"--":t});this.characterLimit=n.characterLimit||50;this.showMoreFn=n.showMoreFn||function(){FACTRAX.showMoreModal({title:n.showMoreTitle||"Show More",value:t.value()})};this.truncate="..."},template:'<span>             <!-- ko if: value().length > characterLimit -->             <span data-bind="text: value().substring(0, characterLimit).trim() + truncate" />             <span class="m-l-xs">                <a style="color: #005288" data-bind="click: showMoreFn" href="javascript:void(0);">(Show More)<\/a>             <\/span>             <!-- /ko -->             <!-- ko ifnot: value().length > characterLimit -->             <span data-bind="text: value" />             <!-- /ko -->         <\/span>'});ko.components.register("ftx-streamline-checkbox-more-info-modal",{viewModel:function(n){var t=this;t.valueObs=n.value;t.title=ko.observable(ko.unwrap(n.title));t.describeTitle=ko.observable(ko.unwrap(n.describeTitle));t.moreInfoTitle=typeof n.moreInfoTitle!="undefined"?ko.unwrap(n.moreInfoTitle):"More Info";t.moreInfoBody=ko.unwrap(n.moreInfoBody);t.moreInfoFn=function(){FACTRAX.moreInfoModal({title:t.moreInfoTitle,body:t.moreInfoBody})};t.requiredDocs=ko.unwrap(n.requiredDocs);t.hasTextValue=ko.observable(typeof n.textValue!="undefined");t.textValueObs=n.textValue},template:'<div class="line"><div class="checkbox"><label class="ftx-streamline-checkbox-label" data-bind="uniqueFor: valueObs"><input type="checkbox" data-bind="uniqueId: valueObs, checked: valueObs, icheck: true" /><span class="m-r-md" data-bind="text: title"><\/span><\/label><a href="javascript:void(0);" class="cursor-pointer" style="color: #005288; display: inline-block" data-bind="click: moreInfoFn">( More Info )<\/a><!-- ko if: requiredDocs && valueObs --><ftx-documents-required params="requiredDocs: requiredDocs"><\/ftx-documents-required><!-- /ko --> <\/div><\/div><div data-bind="if: hasTextValue() && valueObs()"><div class="line" style="margin-left:28px;" data-bind="validationElement: textValueObs"><label class="required-field-indicator" data-bind="uniqueFor: textValueObs, text: describeTitle"><\/label><br/><input type="text" class="form-control" data-bind="uniqueId: textValueObs, value: textValueObs" /><\/div><\/div>'});ko.components.register("ftx-streamline-checkbox-more-info",{viewModel:function(n){var t=this;t.valueObs=n.value;t.title=ko.observable(ko.unwrap(n.title));t.describeTitle=ko.observable(ko.unwrap(n.describeTitle));t.moreInfoTitle=ko.observable(ko.unwrap(n.moreInfoTitle));t.moreInfoBody=ko.observable(ko.unwrap(n.moreInfoBody));t.hasTextValue=ko.observable(typeof n.textValue!="undefined");t.textValueObs=n.textValue},template:'<div class="line"><div class="checkbox"><label class="ftx-streamline-checkbox-label" data-bind="uniqueFor: valueObs"><input type="checkbox" data-bind="uniqueId: valueObs, checked: valueObs, icheck: true" /><span data-bind="text: title"><\/span><span data-bind="moreInfoCheckbox: { title: moreInfoTitle, content: moreInfoBody, html: true, placement: \'right\'}"><\/span><\/label><\/div><\/div><div data-bind="if: hasTextValue() && valueObs()"><div class="line" style="margin-left:28px;" data-bind="validationElement: textValueObs"><label class="required-field-indicator" data-bind="uniqueFor: textValueObs, text: describeTitle"><\/label><br/><input type="text" class="form-control" data-bind="uniqueId: textValueObs, value: textValueObs" /><\/div><\/div>'});ko.components.register("ftx-streamline-checkbox-section-checkexpanded",{viewModel:function(n){var t=this;t.showObs=n.hierarchy.show;t.title=ko.observable(ko.unwrap(n.title));t.subtitle=ko.observable(ko.unwrap(n.subtitle));t.url=ko.observable(ko.unwrap(n.url));t.moreInfoTitle=ko.observable(ko.unwrap(n.moreInfoTitle));t.moreInfoBody=ko.observable(ko.unwrap(n.moreInfoBody));t.moreInfoFn=function(){FACTRAX.moreInfoModal({title:t.moreInfoTitle(),body:t.moreInfoBody()})};t.popoverTitle=ko.observable(ko.unwrap(n.popoverTitle));t.popoverBody=ko.observable(ko.unwrap(n.popoverBody));t.children=[];_.each(n.checkRoot,function(n){ko.isObservable(n)&&t.children.push(n)});_.each(n.hierarchy,function(n){!ko.isObservable(n)&&n.show&&ko.isObservable(n.show)&&t.children.push(n.show)});t.anyChildrenSelected=ko.computed(function(){var n=_.any(t.children,function(n){return n()===!0});return n&&!t.showObs()&&t.showObs(!0),t.anyChildrenChanged=!0,t.showObs.isModified(!0),n});t.showObs.extend({validation:{validator:function(n){return!n||t.anyChildrenSelected()},message:"You must select at least one"}});t.anyChildrenChanged=!1;t.showObs.subscribe(function(){t.showObs.isModified(t.anyChildrenChanged)})},template:'<div class="line"><div class="checkbox" data-bind="validationOptions: { insertMessages: false }"><label class="ftx-streamline-checkbox-label" data-bind="ifnot: anyChildrenSelected, visible: !anyChildrenSelected()"><input class="ftx-streamline-checkbox-section-input" type="checkbox" data-bind="uniqueId: showObs, checked: showObs, icheck: true, disable: anyChildrenSelected" style="pointer-events: none;" /><span class="ftx-streamline-checkbox-section-span" data-bind="html: title"><\/span><!-- ko if: subtitle() --><span><small><i data-bind="text: \'(\' + subtitle() + \')\'"><\/i><\/small><\/span><!-- /ko --><!-- ko if: popoverBody() --><span data-bind="moreInfoCheckbox: { title: popoverTitle, content: popoverBody, html: true, placement: \'right\'}"><\/span><!-- /ko --><\/label><label tabindex="0" class="ftx-streamline-checkbox-label" data-bind="if: anyChildrenSelected, visible: anyChildrenSelected, bootstrapPopover: { trigger: \'hover focus\', placement: \'left\', content: \'This section cannot be unchecked because at least one subsidiary is checked.\', title: \'Disabled\', container: \'body\' }"><input class="ftx-streamline-checkbox-section-input" type="checkbox" data-bind="uniqueId: showObs, checked: true, icheck: true, disable: anyChildrenSelected" style="pointer-events: none;" /><span class="ftx-streamline-checkbox-section-span" data-bind="html: title"><\/span><!-- ko if: subtitle() --><span><small><i data-bind="text: \'(\' + subtitle() + \')\'"><\/i><\/small><\/span><!-- /ko --><!-- ko if: popoverBody() --><span data-bind="moreInfoCheckbox: { title: popoverTitle, content: popoverBody, html: true, placement: \'right\'}"><\/span><!-- /ko --><\/label><div style="display:inline-block" data-bind="if: typeof(moreInfoTitle()) !== \'undefined\'">&nbsp;&nbsp;<a href="javascript:void(0);" class="cursor-pointer" style="color: #005288;" data-bind="click: moreInfoFn">( More Info )<\/a><\/div><div style="display:inline-block" data-bind="if: typeof(url()) !== \'undefined\'">&nbsp;&nbsp;(<a target="_blank" data-bind="attr: { href: url }">View External Resource<\/a>)<\/div><\/div><\/div>'});ko.components.register("ftx-streamline-checkbox-section",{viewModel:function(n){function i(n,i){typeof i=="undefined"&&(i=!1);n!==!0&&(n!==!1||i)||t.checkValueCountObs(t.checkValueCountObs()+(n===!0?1:-1))}function r(n){_.each(n,function(n){ko.isObservable(n)?(i(n(),!0),n.subscribe(i)):r(n)})}var t=this;t.valueObs=n.value;t.checkValueCountObs=ko.observable(0);t.isChecked=ko.pureComputed(function(){return t.checkValueCountObs()>0});t.title=ko.observable(ko.unwrap(n.title));t.url=ko.observable(ko.unwrap(n.url));t.moreInfoTitle=ko.observable(ko.unwrap(n.moreInfoTitle));t.moreInfoBody=ko.observable(ko.unwrap(n.moreInfoBody));t.moreInfoStyle=ko.observable(ko.unwrap(n.moreInfoStyle));t.moreInfoFn=function(){FACTRAX.moreInfoModal({title:t.moreInfoTitle(),body:t.moreInfoBody()})};t.disableObs=ko.observable(!0);t.subheaderToggle=function(){t.valueObs(!t.valueObs())};r(n.checkRoot);t.valueObs()||t.subheaderToggle()},template:'<div class="line"><label tabindex="0" class="ftx-streamline-checkbox-label" data-bind="bootstrapPopover: { trigger: \'hover focus\', placement: \'bottom\', content: \'Please expand this section to see the available options.\', title: \'Disabled\', container: \'body\' }"><input class="ftx-streamline-checkbox-section-input" type="checkbox" data-bind="uniqueId: checkValueCountObs, checked: isChecked, icheck: true, disable: disableObs" style="pointer-events: none;" /><\/label><a href="javascript:void(0);" class="link-remove-default-style" data-bind="click: subheaderToggle"><span class="ftx-streamline-checkbox-section-span" data-bind="html: title"><\/span><i class="fas fa-fw" data-bind="css: { \'fa-angle-down\': valueObs(), \'fa-angle-right\' : !valueObs() }"><\/i><\/a><div style="display:inline-block" data-bind="if: typeof(moreInfoTitle()) !== \'undefined\' && typeof(moreInfoStyle()) === \'undefined\'">&nbsp;&nbsp;<a href="javascript:void(0);" class="cursor-pointer" style="color: #005288;" data-bind="click: moreInfoFn">( More Info )<\/a><\/div><div style="display:inline-block" data-bind="if: typeof(moreInfoStyle()) !== \'undefined\'"><label class="ftx-streamline-checkbox-label" data-bind="uniqueFor: valueObs"><span data-bind="moreInfoCheckbox: { title: moreInfoTitle, content: moreInfoBody, html: true, placement: \'right\'}"><\/span><\/label><\/div><div style="display:inline-block" data-bind="if: typeof(url()) !== \'undefined\'">&nbsp;&nbsp;(<a target="_blank" data-bind="attr: { href: url }">View External Resource<\/a>)<\/div><\/div>'});ko.components.register("ftx-streamline-checkbox-textarea",{viewModel:function(n){var t=this;t.valueObs=n.value;t.title=ko.observable(ko.unwrap(n.title));t.describeTitle=ko.observable(ko.unwrap(n.describeTitle));t.hasTextValue=ko.observable(typeof n.textValue!="undefined");t.textValueObs=n.textValue},template:'<div class="line"><div class="checkbox"><label class="ftx-streamline-checkbox-label" data-bind="uniqueFor: valueObs"><input type="checkbox" data-bind="uniqueId: valueObs, checked: valueObs, icheck: true" /><span data-bind="text: title"><\/span><\/label><\/div><\/div><div data-bind="if: hasTextValue() && valueObs()"><div class="line" style="margin-left:28px;" data-bind="validationElement: textValueObs"><label class="required-field-indicator label-force-bold" data-bind="uniqueFor: textValueObs, text: describeTitle"><\/label><br/><textarea class="form-control" rows="3" data-bind="uniqueId: textValueObs, textInput: textValueObs" /><\/div><\/div>'});ko.components.register("ftx-streamline-checkbox",{viewModel:function(n){var t=this;t.valueObs=n.value;t.title=ko.observable(ko.unwrap(n.title));t.describeTitle=ko.observable(ko.unwrap(n.describeTitle));t.hasTextValue=ko.observable(typeof n.textValue!="undefined");t.textValueObs=n.textValue;t.requiredDocs=ko.unwrap(n.requiredDocs);t.url=ko.observable(ko.unwrap(n.url));t.noLine=ko.observable(ko.unwrap(n.noLine))},template:'<div data-bind="css: { line: noLine() !== true }"><div class="checkbox"><label class="ftx-streamline-checkbox-label" data-bind="uniqueFor: valueObs"><input type="checkbox" data-bind="uniqueId: valueObs, checked: valueObs, icheck: true" /><span data-bind="html: title"><\/span><div style="display:inline-block" data-bind="if: typeof(url()) !== \'undefined\'">&nbsp;&nbsp;(<a target="_blank" data-bind="attr: { href: url }">View External Resource<\/a>)<\/div><\/label><!-- ko if: requiredDocs && valueObs --><ftx-documents-required params="requiredDocs: requiredDocs"><\/ftx-documents-required><!-- /ko --> <\/div><\/div><div data-bind="if: hasTextValue() && valueObs()"><div class="line" style="margin-left:28px;" data-bind="validationElement: textValueObs"><label class="required-field-indicator label-force-bold" data-bind="uniqueFor: textValueObs, text: describeTitle"><\/label><br/><input type="text" class="form-control" data-bind="uniqueId: textValueObs, value: textValueObs" /><\/div><\/div>'});ko.components.register("ftx-survey-edit-bool",{viewModel:function(n){this.radioName=_.uniqueId("ftx-checklist-edit-bool-");this.value=n.value;this.numSelected=n.numSelected;this.outlier=n.outlier;this.caption=n.caption;this.moreInfoIf=n.moreInfoIf;this.moreInfoHtml=n.moreInfoHtml;this.css=ko.pureComputed(function(){return n.css?n.css:"pull-right"})},template:'<div data-bind="validationElement: value, css: css, validationOptions: { insertMessages: false }">             <span data-bind="validationElement: numSelected, validationMessage: numSelected"><\/span>             <span data-bind="if: value() == outlier()"><span data-bind="if: numSelected() == 1"><span data-bind="text: \'(\' + numSelected() + \' damage selected)\'"><\/span><\/span><span data-bind="if: numSelected() > 1"><span data-bind="text: \'(\' + numSelected() + \' damages selected)\'"><\/span><\/span><\/span>             <label>&nbsp;&nbsp;<input type="radio" data-bind="checkedValue: true, checked: value, iradio: true, attr: { name: radioName }"> <i><\/i> &nbsp;Yes <\/label>             &nbsp;             <label><input type="radio" data-bind="checkedValue: false, checked: value, iradio: true, attr: { name: radioName }"> <i><\/i> &nbsp;No <\/label>         <\/div>         <span data-bind="text: caption"><\/span>'});ko.components.register("ftx-survey-show-hide-comment-text",{viewModel:function(n){var t=n.hasOwnProperty("nullValue")?n.nullValue:"--";this.value=n.value===undefined||n.value===null?t:n.value;this.visible=n.hasOwnProperty("visible")?n.visible:!0;this.comment=n.hasOwnProperty("comment")?n.comment:"";this.showComments=ko.observable(!1);this.commentSubject=n.hasOwnProperty("commentSubject")?n.commentSubject:"";this.showHideCommentCaption=ko.pureComputed(function(){return this.showComments()?"Hide Comments":"Show Comments"}.bind(this));this.showHideCommentsClick=function(){this.showComments(!this.showComments())}.bind(this);this.showCommentControls=ko.pureComputed(function(){return this.comment&&this.comment.length>0?!0:!1}.bind(this));this.accessibleCommentCaption=ko.pureComputed(function(){return n.hasOwnProperty("commentSubject")?" about "+n.commentSubject:""}).bind(this)},template:'<!--ko if: showCommentControls -->                <span class="m-l-xs">                    (<a href="#" data-bind="click:showHideCommentsClick">                         <span data-bind="text:showHideCommentCaption" />                         <span data-bind="text:accessibleCommentCaption" class="sr-only" />                     <\/a>)                <\/span>                 <!-- /ko -->                <\/p>                 <!--ko if: showCommentControls-->                <blockquote data-bind="text:comment, css: { collapse: !showComments() }"><\/blockquote>                 <!-- /ko -->'});ko.components.register("ftx-timezone-picker",{viewModel:function(n){var t=this;this.value=ko.observable();this.loaded=ko.observable(!1);FACTRAX.getActiveTimezones().then(function(i){t.timezones=i;var r=_.find(t.timezones,function(t){return t.Primary_IANA_Timezone===n.tz()});r&&t.value(r.Timezone_Id);t.loaded(!0)});this.value.subscribe(function(i){var r=_.find(t.timezones,function(n){return n.Timezone_Id===i});n.tz(r.Primary_IANA_Timezone);n.utc()||n.code(moment().tz(r.Primary_IANA_Timezone).format("z"))})},template:"<!-- ko if: loaded -->        <select class=\"form-control\" data-bind=\",             options: timezones,             optionsText: 'Display_Name',             optionsValue: 'Timezone_Id',             optionsCaption: '',             value: value,             select2: {                 placeholder: 'Select...',                 minimumResultsForSearch: -1,             }\"><\/select>         <!-- /ko -->"});ko.components.register("ftx-tree-node",{viewModel:function(n){var t,i;this.node=n.node;this.template=n.template;this.last=n.last;this.childNodesProperty=n.childNodesProperty;this.expandedProperty=n.expandedProperty;n.node&&n.childNodesProperty&&n.node.hasOwnProperty(n.childNodesProperty)?(t=n.node[n.childNodesProperty],this.children=ko.isObservable(t)?t:ko.observableArray(t)):this.children=ko.observableArray([]);n.node&&n.expandedProperty&&n.node.hasOwnProperty(n.expandedProperty)?(i=n.node[n.expandedProperty],this.expanded=ko.isObservable(i)?i:ko.observable(i)):this.expanded=ko.observable(!0);this.toggleExpanded=function(){this.expanded(!this.expanded())}},template:'<div class="ftx-tree-node" data-bind="css: { \'ftx-tree-last-node\': last }">             <div class="ftx-tree-content">                 <!-- ko template: { nodes: template, data: node } --><!-- /ko -->             <\/div>             <!-- ko if: children() && children().length -->             <a class="ftx-tree-button" data-bind="css: { \'ftx-tree-button-collapsed\': !expanded(), \'ftx-tree-button-expanded\': expanded }, click: toggleExpanded"><\/a>             <!-- /ko -->             <!-- ko if: children() && children().length && expanded() -->             <div class="ftx-tree-children">                 <!-- ko foreach: children --><ftx-tree-node params="node: $data, template: $parent.template, last: $index() == $parent.children().length - 1, childNodesProperty: $parent.childNodesProperty, expandedProperty: $parent.expandedProperty"><\/ftx-tree-node><!-- /ko -->             <\/div>             <!-- /ko -->         <\/div>'});ko.components.register("ftx-tree",{viewModel:function(n){this.nodes=n.nodes?ko.isObservable(n.nodes)?n.nodes:ko.observableArray(n.nodes):ko.observableArray([]);this.childNodesProperty=ko.unwrap(n.childNodesProperty);this.expandedProperty=ko.unwrap(n.expandedProperty)},template:'<!-- ko foreach: nodes -->         <ftx-tree-node params="node: $data, template: $componentTemplateNodes, last: $index() == $parent.nodes().length - 1, childNodesProperty: $parent.childNodesProperty, expandedProperty: $parent.expandedProperty"><\/ftx-tree-node>         <!-- /ko -->'});ko.components.register("input-group-date",{viewModel:function(n){this.value=ko.unwrap(n.value);this.focus=function(){$(this).prev().focus()}},template:'<div class="input-group date">             <input class="form-control" type="text" data-bind="datepicker: value" />             <span class="input-group-addon" data-bind="click: focus"><i class="fa fa-calendar"><\/i><\/span>         <\/div>'});ko.components.register("f",{viewModel:function(n){var t=this;this.value=ko.unwrap(n.value);this.cssClass=ko.pureComputed(function(){var n="";switch(t.value&&t.value.toLowerCase()){case"event":n="fa-fire module-event";break;case"applicant":n="fa-institution module-event";break;case"project":n="fa-briefcase module-event";break;case"damage":n="fa-road module-event"}return n})},template:"<i data-bind=\"attr: { class: 'icon-module fa fa-fw ' + cssClass() }\"><\/i>"});ko.components.register("radiobutton",{viewModel:function(n){this.radioName=_.uniqueId("radiobutton-");this.value=n.value;this.caption=n.caption;this.moreInfo=n.moreInfo;this.useLabel=n.hasOwnProperty("useLabel")?n.useLabel:!1;this.css=ko.pureComputed(function(){return n.css?n.css:"pull-right"});this.disable=n.disable},template:'<div data-bind="validationElement: value, css: css, validationOptions: { insertMessages: false }">             <label><input type="radio" data-bind="checkedValue: true, checked: value, iradio: true, attr: { name: radioName, disabled: disable }"> <i><\/i><\/label>         <\/div>         <label data-bind="visible: useLabel, text: caption"><\/label>         <span data-bind="visible: !useLabel, text: caption"><\/span>         <!-- ko if: moreInfo -->         <span data-bind="moreInfo: moreInfo"><\/span>         <!-- /ko -->'});ko.components.register("status-icon",{viewModel:function(n){var t=this;this.value=ko.unwrap(n.value);this.cssClass=ko.pureComputed(function(){var n="";switch(t.value){case"Complete":n="fa-check-circle";break;case"Permanent":n="fa-lock"}return n})},template:"<i data-bind=\"attr: { class: 'icon-status fa fa-fw ' + cssClass() + ' status-' + value }\"><\/i>"});ko.components.register("text-with-comment",{viewModel:function(n){var t=n.hasOwnProperty("nullValue")?n.nullValue:"--";this.text=n.text===undefined||n.text===null?t:n.text;this.comment=n.hasOwnProperty("comment")?ko.unwrap(n.comment):"";this.commentTypeText=n.hasOwnProperty("commentTypeText")?ko.unwrap(n.commentTypeText):"Comments";this.showComments=ko.observable(!1);this.showHideCommentCaption=ko.pureComputed(function(){return(this.showComments()?"Hide ":"Show ")+this.commentTypeText}.bind(this));this.showHideCommentsClick=function(){this.showComments(!this.showComments())}.bind(this);this.showCommentControls=ko.pureComputed(function(){return this.comment&&this.comment.length>0?!0:!1}.bind(this))},template:'<div class="comment-blockquote-container">                 <p>                     <strong><span data-bind="text: text" /><\/strong>                     <!--ko if: showCommentControls -->                    <span class="m-l-xs">                        (<a href="#" data-bind="text:showHideCommentCaption, click:showHideCommentsClick"/>)                     <\/span>                     <!-- /ko -->                <\/p>                 <!--ko if: showCommentControls-->                <blockquote data-bind="text:comment, css: { collapse: !showComments() }"><\/blockquote>                 <!-- /ko -->             <\/div>         <\/div>'});ko.components.register("textbox-numeric-with-dropdown",{viewModel:function(n){var t=this;t.value=ko.isObservable(n.value)?n.value:ko.observable(n.value);t.units=n.units;t.selectedUnits=ko.observableArray();t.selectedUnitId=n.selectedUnitId;t.selectedUnitText=n.selectedUnitText;t.selectedUnits.subscribe(function(n){t.selectedUnitId(n[0].Value);t.selectedUnitText(n[0].Name)})},template:'<div class="input-group">\t\t\t\t<input type="text" class="form-control" style="float: left; width: initial;" data-bind="numeric: value, autoNumericOptions: { mDec: 0 }, valueUpdate: \'afterkeydown\'">\t\t\t\t<select class="form-control" style="float: left; width: initial;" data-bind="options: units, optionsText: \'Name\', value: \'Value\', optionsCaption: \'Choose...\',selectedOptions: selectedUnits">\t\t\t\t<\/select>\t\t\t<\/div>'});ko.components.register("textbox-with-dropdown",{viewModel:function(n){var t=this;t.value=ko.isObservable(n.value)?n.value:ko.observable(n.value);t.units=n.units;t.selectedUnits=ko.observableArray();t.selectedUnitId=n.selectedUnitId;t.selectedUnitText=n.selectedUnitText;t.selectedUnits.subscribe(function(n){t.selectedUnitId(n[0].Value);t.selectedUnitText(n[0].Name)})},template:'<div class="input-group">\t\t\t\t<input type="text" class="form-control" style="float: left; width: initial;" data-bind="value: value">\t\t\t\t<select class="form-control" style="float: left; width: initial;" data-bind="options: units, optionsText: \'Name\', value:\'Value\', selectedOptions: selectedUnits">\t\t\t\t<\/select>\t\t\t<\/div>'});ko.validation.rules.integer={validator:function(n,t){return!n||t&&/^-?\d+$/.test(n)},message:"Please enter a whole number"};ko.validation.rules.dtsPhoneExtensionPattern={validator:function(n,t){return!t||ko.validation.utils.isEmptyVal(n)||n.match(/^(?:1[- \.]?)?(?:\d{3}|\(\d{3}\))[- \.]?\d{3}[- \.]?\d{4}( x\d{1,10})?$/)!=null},message:"Please enter a valid U.S. phone number with area code"};ko.validation.rules.notEqualOrEmpty=$.extend({},ko.validation.rules.notEqual,{validator:function(n){return n===null||n===undefined||n===""?!0:ko.validation.rules.notEqual.validator.apply(this,arguments)}});ko.validation.rules.minNumber={validator:function(n,t){return!n||n.toString().replace(",","")>=t},message:"Please enter a value greater than or equal to {0}."};ko.validation.rules.maxNumber={validator:function(n,t){return!n||n.toString().replace(",","")<=t},message:"Please enter a value less than or equal to {0}."};ko.validation.rules.latLong={validator:function(n,t){var i,r;if(n&&n[0]!==null&&n[0]!==undefined){if(isNaN(n[0]))return this.message="Latitude must be a number.",!1;if(parseInt(n[0])>90||parseInt(n[0])<-90)return this.message="Latitude must be between -90 and 90.",!1;if(!isNaN(parseInt(t))&&t>0&&(i=new RegExp("^\\-?\\d{1,2}\\.?\\d{0,"+t+"}$"),!i.test(n[0])))return/[^\d\.\-]/.test(n[0])||String(n[0]).lastIndexOf("-")>0||String(n[0]).split(".").length!==2?(this.message='Latitude must be in the format "##.'+"".padStart(t,"#")+'"',!1):(this.message="Latitude must be no more than "+t+" decimal places.",!1)}if(n&&n[1]!==null&&n[1]!==undefined){if(isNaN(n[1]))return this.message="Longitude must be a number.",!1;if(parseInt(n[1])>180||parseInt(n[1])<-180)return this.message="Longitude must be between -180 and 180.",!1;if(!isNaN(parseInt(t))&&t>0&&(i=new RegExp("^\\-?\\d{1,3}\\.?\\d{0,"+t+"}$"),!i.test(n[1])))return/[^\d\.\-]/.test(n[1])||String(n[1]).lastIndexOf("-")>0||String(n[1]).split(".").length!==2?(this.message='Longitude must be in the format "###.'+"".padStart(t,"#")+'"',!1):(this.message="Longitude must be no more than "+t+" decimal places.",!1)}return n&&n[0]!==null&&n[0]!==undefined&&n[1]!==null&&n[1]!==undefined&&(r=_.any(FACTRAX.US_Bounding_Boxes(),function(t){return n[0]>=t.Min_Latitude&&n[1]>=t.Min_Longitude&&n[0]<=t.Max_Latitude&&n[1]<=t.Max_Longitude}),!r&&FACTRAX.US_Bounding_Boxes().length)?(this.message="Coordinates are outside of the U.S. and U.S. Territories",!1):!0}};ko.validation.rules.latLongList={validator:function(n,t){var f;if(!n)return!0;t===!0&&(t=5);var e=new RegExp("^(-?(\\d{1,3})(\\.\\d{"+t+"})\\,\\s*-?(\\d{1,3})(\\.\\d{"+t+"}))$"),r=n.split(";"),u=!0,i=_.any(r,function(n){return(n=n.trim(),!n.length)?!1:(u=!1,!e.test(n))});return u||i?(this.message='This field is not a valid list of latitude, longitude values separated by semicolon "###.'+"".padStart(t,"#")+", ###."+"".padStart(t,"#")+';"',!1):(f=FACTRAX.US_Bounding_Boxes(),i=f.length>0&&_.any(r,function(n){if(n=n.trim(),!n.length)return!1;var t=n.split(","),i=parseFloat(t[0]),r=parseFloat(t[1]);return!_.any(FACTRAX.US_Bounding_Boxes(),function(n){return i>=n.Min_Latitude&&r>=n.Min_Longitude&&i<=n.Max_Latitude&&r<=n.Max_Longitude})}),i)?(this.message="One or more of these coordinates are outside of the U.S. and U.S. Territories",!1):!0}};ko.validation.rules.latLongListArray={validator:function(n){if(!n)return!0;FACTRAX.US_Bounding_Boxes().length||FACTRAX.isLoadingUSBoundingBoxes()||(FACTRAX.isLoadingUSBoundingBoxes(!0),$.ajax({url:FACTRAX.getAPIAddress("v1","lookup")+"/getallowedgeolocationbounds",type:"GET",success:function(n){FACTRAX.US_Bounding_Boxes(n);FACTRAX.isLoadingUSBoundingBoxes(!1)},async:!1}));var t=FACTRAX.US_Bounding_Boxes();return(misses=t.length>0&&_.any(n,function(n){if(!n)return!1;var t=n.latitude,i=n.longitude;return!_.any(FACTRAX.US_Bounding_Boxes(),function(n){return t>=n.Min_Latitude&&i>=n.Min_Longitude&&t<=n.Max_Latitude&&i<=n.Max_Longitude})}),misses)?(this.message="One or more of these coordinates are outside of the U.S. and U.S. Territories",!1):!0}};ko.validation.rules.zip={validator:function(n){if(!n)return!0;return/^\d{5}(\-\d{4})?$/.test(n)},message:"This is not a valid zip code"},function(){var t=function(n){var t=ko.unwrap(n);return moment.isMoment(t)?t:moment(t)},n=function(n){return function(i,r){return(i=t(i),r=t(r),!i||!r||!i.isValid()||!r.isValid())?!0:n(i,r)}};ko.validation.rules.dateIsBefore={validator:n(function(n,t){return n.isBefore(t)}),message:"Date must be before"};ko.validation.rules.dateIsNotBefore={validator:n(function(n,t){return!n.isBefore(t)}),message:"Date must not be before"};ko.validation.rules.dateIsAfter={validator:n(function(n,t){return n.isAfter(t)}),message:"Date must be after"};ko.validation.rules.dateIsNotAfter={validator:n(function(n,t){return!n.isAfter(t)}),message:"Date must not be after"};ko.validation.rules.dateIsSame={validator:n(function(n,t){return n.isSame(t)}),message:"Date must be same"};ko.validation.rules.dateIsNotSame={validator:n(function(n,t){return!n.isSame(t)}),message:"Date must not be same"};ko.validation.rules.dateIsBeforeUndefined={validator:function(n,t){return(n=ko.unwrap(n),t=ko.unwrap(t),!n||!t)?!0:(n=moment.isMoment(n)?n:moment(n),t=moment.isMoment(t)?t:moment(t),n.isBefore(t))},message:"Date must be before"};ko.validation.rules.dateIsAfterUndefined={validator:function(n,t){return(n=ko.unwrap(n),t=ko.unwrap(t),!n||!t)?!0:(n=moment.isMoment(n)?n:moment(n),t=moment.isMoment(t)?t:moment(t),n.isAfter(t))},message:"Date must be after"}}();ko.validation.registerExtenders()