var DeepThought=function(){function n(n,t,i,r){var u=this,f;if(this.EVENTS_ENDPOINT="Usage/SendEvents",this.SETUP_ENDPOINT="Usage/Setup",this.SEND_EVENTS_INTERVAL=3e4,this.sendEventsCallback=function(){u.shouldSendEvents()&&(u.EventsXHttp=new XMLHttpRequest,u.sendHttpPost(u.EventsXHttp,u.EVENTS_ENDPOINT,u.getEventData(),u.sendEventsStateChange))},this.sendUnloadEvents=function(){var n,t,i;u.shouldSendEvents()&&(n="sendBeacon"in navigator,t=u.getEventData(n),n?navigator.sendBeacon(u.BaseURL+u.EVENTS_ENDPOINT,t):(i=new XMLHttpRequest,u.sendHttpPost(i,u.EVENTS_ENDPOINT,t,null,!1)),u.Events=[])},this.handleUnload=function(){var n=new DTEvent(DTEventCategory.Leave);u.add(n);u.sendUnloadEvents()},this.shouldSendEvents=function(){return u.IsInitialized==!0&&u.Events.length>0},this.getEventData=function(n){var t,i;for(n===void 0&&(n=!1),t=0;t<u.Events.length;t++)u.Events[t].SessionId=u.SessionId;return n?(i=new FormData,i.set("events",JSON.stringify(u.Events)),i):"events="+encodeURIComponent(JSON.stringify(u.Events))},this.buildSetupData=function(){var n="";return u.AccountId&&u.AccountId>0?n+="accountId="+u.AccountId:u.SfOrgId&&u.SfOrgId.length>0?n+="sfOrgId="+u.SfOrgId:u.VortexToken&&u.VortexToken.length>0&&(n+="vortexToken="+u.VortexToken),n+="&feature="+u.Feature,n+("&"+u.buildSetupMetadata())},this.buildSetupMetadata=function(){var n=new DTMetadata;return"metadata="+encodeURIComponent(JSON.stringify(n))},this.setupStateChange=function(){try{u.SetupXHttp.readyState==4&&(u.SetupXHttp.status==200?(u.SessionId=JSON.parse(u.SetupXHttp.responseText),u.IntervalToken=setInterval(u.sendEventsCallback,u.SEND_EVENTS_INTERVAL),window.addEventListener("unload",u.handleUnload),u.IsInitialized=!0):console.error(u.SetupXHttp.statusText))}catch(n){console.error(n)}},this.sendEventsStateChange=function(){u.EventsXHttp.readyState==2&&(u.Events=[])},this.sendHttpPost=function(n,t,i,r,f){f===void 0&&(f=!0);try{r&&(n.onreadystatechange=r);n.open("POST",u.BaseURL+t,f);n.setRequestHeader("Content-Type","application/x-www-form-urlencoded");n.send(i)}catch(e){console.error(e)}},this.IsInitialized=!1,(!t||t.length<1)&&(!i||i.length<1)&&(!r||r<1))throw new Error("Either token, sfOrgId or accountId must be supplied");this.AccountId=r;this.SfOrgId=i;this.VortexToken=t;this.Events=[];f=n;f.substring(f.length-1,f.length)!="/"&&(f+="/");this.BaseURL=f}return n.prototype.add=function(n){n&&this.Events.push(n)},n.prototype.sendEvents=function(){this.shouldSendEvents()&&(this.EventsXHttp=new XMLHttpRequest,this.sendHttpPost(this.EventsXHttp,this.EVENTS_ENDPOINT,this.getEventData(),this.sendEventsStateChange))},n.prototype.setup=function(n){this.Feature=n;this.SetupXHttp=new XMLHttpRequest;this.sendHttpPost(this.SetupXHttp,this.SETUP_ENDPOINT,this.buildSetupData(),this.setupStateChange)},n}(),DTEvent,DTMetadata,DTEventCategory,DTFeatures,DTBrowser;window.DeepThought=DeepThought;DTEvent=function(){function n(n,t){this.CreatedOn=new Date;this.Category=n;t&&(this.Data=JSON.stringify(t))}return n}();window.DTEvent=DTEvent;DTMetadata=function(){function n(){this.determineIsMobile=function(){var n=!1;return function(t){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(n=!0)}(navigator.userAgent||navigator.vendor),n};this.determineBrowser=function(){return(navigator.userAgent.indexOf("Opera")||navigator.userAgent.indexOf("OPR"))!=-1?DTBrowser.Opera:navigator.userAgent.indexOf("Edge")!=-1?DTBrowser.Edge:navigator.userAgent.indexOf("MSIE")!=-1?DTBrowser.InternetExplorer:navigator.userAgent.indexOf("Chrome")!=-1?DTBrowser.Chrome:navigator.userAgent.indexOf("Safari")!=-1?DTBrowser.Safari:navigator.userAgent.indexOf("Firefox")!=-1?DTBrowser.Firefox:void 0};this.CreatedOn=new Date;this.UserAgent=window.navigator.userAgent;this.Language=window.navigator.language;this.Href=window.location.href;this.IsMobile=this.determineIsMobile();this.Browser=this.determineBrowser()}return n}();window.DTMetadata=DTMetadata;DTEventCategory=function(){function n(){}return n.Undefined="Undefined",n.Load="Load",n.Leave="Leave",n.Submit="Submit",n.Collect="Collect",n.Error="Error",n}();window.DTEventCategory=DTEventCategory;DTFeatures=function(){function n(){}return n.Undefined=0,n.ImpactForms=1,n.PledgeManager=2,n.SingleDonation=3,n.RecurringDonation=4,n.RecurringGiftManagement=5,n.RecoverPayments=6,n.NewGift=7,n.EnhancedBatch=8,n.PostToFinance=9,n.HealthCheck=10,n}();window.DTFeatures=DTFeatures;DTBrowser=function(){function n(){}return n.Undefined=0,n.Chrome=1,n.Firefox=2,n.Safari=3,n.InternetExplorer=4,n.Edge=5,n.Opera=6,n}();window.DTBrowser=DTBrowser;
/*! jQuery v3.1.1 | (c) jQuery Foundation | jquery.org/license */
!function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.1.1",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null==a?f.call(this):a<0?this[a+this.length]:this[a]},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c<b?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:h,sort:c.sort,splice:c.splice},r.extend=r.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||r.isFunction(g)||(g={}),h===i&&(g=this,h--);h<i;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(r.isPlainObject(d)||(e=r.isArray(d)))?(e?(e=!1,f=c&&r.isArray(c)?c:[]):f=c&&r.isPlainObject(c)?c:{},g[b]=r.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},r.extend({expando:"jQuery"+(q+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===r.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=r.type(a);return("number"===b||"string"===b)&&!isNaN(a-parseFloat(a))},isPlainObject:function(a){var b,c;return!(!a||"[object Object]"!==k.call(a))&&(!(b=e(a))||(c=l.call(b,"constructor")&&b.constructor,"function"==typeof c&&m.call(c)===n))},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?j[k.call(a)]||"object":typeof a},globalEval:function(a){p(a)},camelCase:function(a){return a.replace(t,"ms-").replace(u,v)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(w(a)){for(c=a.length;d<c;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(s,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(w(Object(a))?r.merge(c,"string"==typeof a?[a]:a):h.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:i.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;d<c;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;f<g;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,f=0,h=[];if(w(a))for(d=a.length;f<d;f++)e=b(a[f],f,c),null!=e&&h.push(e);else for(f in a)e=b(a[f],f,c),null!=e&&h.push(e);return g.apply([],h)},guid:1,proxy:function(a,b){var c,d,e;if("string"==typeof b&&(c=a[b],b=a,a=c),r.isFunction(a))return d=f.call(arguments,2),e=function(){return a.apply(b||this,d.concat(f.call(arguments)))},e.guid=a.guid=a.guid||r.guid++,e},now:Date.now,support:o}),"function"==typeof Symbol&&(r.fn[Symbol.iterator]=c[Symbol.iterator]),r.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){j["[object "+b+"]"]=b.toLowerCase()});function w(a){var b=!!a&&"length"in a&&a.length,c=r.type(a);return"function"!==c&&!r.isWindow(a)&&("array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",M="\\["+K+"*("+L+")(?:"+K+"*([*^$|!~]?=)"+K+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+L+"))|)"+K+"*\\]",N=":("+L+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+M+")*)|.*)\\)|)",O=new RegExp(K+"+","g"),P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0&&("form"in a||"label"in a)},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"form"in b?b.parentNode&&b.disabled===!1?"label"in b?"label"in b.parentNode?b.parentNode.disabled===a:b.disabled===a:b.isDisabled===a||b.isDisabled!==!a&&ea(b)===a:b.disabled===a:"label"in b&&b.disabled===a}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}}):(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c,d,e,f=b.getElementById(a);if(f){if(c=f.getAttributeNode("id"),c&&c.value===a)return[f];e=b.getElementsByName(a),d=0;while(f=e[d++])if(c=f.getAttributeNode("id"),c&&c.value===a)return[f]}return[]}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c<b;c+=2)a.push(c);return a}),odd:pa(function(a,b){for(var c=1;c<b;c+=2)a.push(c);return a}),lt:pa(function(a,b,c){for(var d=c<0?c+b:c;--d>=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function ra(){}ra.prototype=d.filters=d.pseudos,d.setFilters=new ra,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){c&&!(e=Q.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=R.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(P," ")}),h=h.slice(c.length));for(g in d.filter)!(e=V[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function sa(a){for(var b=0,c=a.length,d="";b<c;b++)d+=a[b].value;return d}function ta(a,b,c){var d=b.dir,e=b.next,f=e||d,g=c&&"parentNode"===f,h=x++;return b.first?function(b,c,e){while(b=b[d])if(1===b.nodeType||g)return a(b,c,e);return!1}:function(b,c,i){var j,k,l,m=[w,h];if(i){while(b=b[d])if((1===b.nodeType||g)&&a(b,c,i))return!0}else while(b=b[d])if(1===b.nodeType||g)if(l=b[u]||(b[u]={}),k=l[b.uniqueID]||(l[b.uniqueID]={}),e&&e===b.nodeName.toLowerCase())b=b[d]||b;else{if((j=k[f])&&j[0]===w&&j[1]===h)return m[2]=j[2];if(k[f]=m,m[2]=a(b,c,i))return!0}return!1}}function ua(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d<e;d++)ga(a,b[d],c);return c}function wa(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;h<i;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function xa(a,b,c,d,e,f){return d&&!d[u]&&(d=xa(d)),e&&!e[u]&&(e=xa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||va(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:wa(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=wa(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i<f;i++)if(c=d.relative[a[i].type])m=[ta(ua(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;e<f;e++)if(d.relative[a[e].type])break;return xa(i>1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i<e&&ya(a.slice(i,e)),e<f&&ya(a=a.slice(e)),e<f&&sa(a))}m.push(c)}return ua(m)}function za(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,c,e){var f,i,j,k,l,m="function"==typeof a&&a,n=!e&&g(a=m.selector||a);if(c=c||[],1===n.length){if(i=n[0]=n[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&9===b.nodeType&&p&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(_,aa),b)||[])[0],!b)return c;m&&(b=b.parentNode),a=a.slice(i.shift().value.length)}f=V.needsContext.test(a)?0:i.length;while(f--){if(j=i[f],d.relative[k=j.type])break;if((l=d.find[k])&&(e=l(j.matches[0].replace(_,aa),$.test(i[0].type)&&qa(b.parentNode)||b))){if(i.splice(f,1),a=e.length&&sa(i),!a)return G.apply(c,e),c;break}}}return(m||h(a,n))(e,b,!p,c,!b||$.test(a)&&qa(b.parentNode)||b),c},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext,B=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,C=/^.[^:#\[\.,]*$/;function D(a,b,c){return r.isFunction(b)?r.grep(a,function(a,d){return!!b.call(a,d,a)!==c}):b.nodeType?r.grep(a,function(a){return a===b!==c}):"string"!=typeof b?r.grep(a,function(a){return i.call(b,a)>-1!==c}):C.test(b)?r.filter(b,a,c):(b=r.filter(b,a),r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType}))}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b<d;b++)if(r.contains(e[b],this))return!0}));for(c=this.pushStack([]),b=0;b<d;b++)r.find(a,e[b],c);return d>1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(D(this,a||[],!1))},not:function(a){return this.pushStack(D(this,a||[],!0))},is:function(a){return!!D(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var E,F=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,G=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||E,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:F.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),B.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};G.prototype=r.fn,E=r(d);var H=/^(?:parents|prev(?:Until|All))/,I={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a<c;a++)if(r.contains(this,b[a]))return!0})},closest:function(a,b){var c,d=0,e=this.length,f=[],g="string"!=typeof a&&r(a);if(!A.test(a))for(;d<e;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function J(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return J(a,"nextSibling")},prev:function(a){return J(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return a.contentDocument||r.merge([],a.childNodes)}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(I[a]||r.uniqueSort(e),H.test(a)&&e.reverse()),this.pushStack(e)}});var K=/[^\x20\t\r\n\f]+/g;function L(a){var b={};return r.each(a.match(K)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?L(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){r.each(b,function(b,c){r.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==r.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return r.each(arguments,function(a,b){var c;while((c=r.inArray(b,f,c))>-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function M(a){return a}function N(a){throw a}function O(a,b,c){var d;try{a&&r.isFunction(d=a.promise)?d.call(a).done(b).fail(c):a&&r.isFunction(d=a.then)?d.call(a,b,c):b.call(void 0,a)}catch(a){c.call(void 0,a)}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b<f)){if(a=d.apply(h,i),a===c.promise())throw new TypeError("Thenable self-resolution");j=a&&("object"==typeof a||"function"==typeof a)&&a.then,r.isFunction(j)?e?j.call(a,g(f,c,M,e),g(f,c,N,e)):(f++,j.call(a,g(f,c,M,e),g(f,c,N,e),g(f,c,M,c.notifyWith))):(d!==M&&(h=void 0,i=[a]),(e||c.resolveWith)(h,i))}},k=e?j:function(){try{j()}catch(a){r.Deferred.exceptionHook&&r.Deferred.exceptionHook(a,k.stackTrace),b+1>=f&&(d!==N&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:M,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:M)),c[2][3].add(g(0,a,r.isFunction(d)?d:N))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(O(a,g.done(h(c)).resolve,g.reject),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)O(e[c],h(c),g.reject);return g.promise()}});var P=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&P.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var Q=r.Deferred();r.fn.ready=function(a){return Q.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,holdReady:function(a){a?r.readyWait++:r.ready(!0)},ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||Q.resolveWith(d,[r]))}}),r.ready.then=Q.then;function R(){d.removeEventListener("DOMContentLoaded",R),
a.removeEventListener("load",R),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",R),a.addEventListener("load",R));var S=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)S(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h<i;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},T=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function U(){this.expando=r.expando+U.uid++}U.uid=1,U.prototype={cache:function(a){var b=a[this.expando];return b||(b={},T(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[r.camelCase(b)]=c;else for(d in b)e[r.camelCase(d)]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][r.camelCase(b)]},access:function(a,b,c){return void 0===b||b&&"string"==typeof b&&void 0===c?this.get(a,b):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d=a[this.expando];if(void 0!==d){if(void 0!==b){r.isArray(b)?b=b.map(r.camelCase):(b=r.camelCase(b),b=b in d?[b]:b.match(K)||[]),c=b.length;while(c--)delete d[b[c]]}(void 0===b||r.isEmptyObject(d))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!r.isEmptyObject(b)}};var V=new U,W=new U,X=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Y=/[A-Z]/g;function Z(a){return"true"===a||"false"!==a&&("null"===a?null:a===+a+""?+a:X.test(a)?JSON.parse(a):a)}function $(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Y,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c=Z(c)}catch(e){}W.set(a,b,c)}else c=void 0;return c}r.extend({hasData:function(a){return W.hasData(a)||V.hasData(a)},data:function(a,b,c){return W.access(a,b,c)},removeData:function(a,b){W.remove(a,b)},_data:function(a,b,c){return V.access(a,b,c)},_removeData:function(a,b){V.remove(a,b)}}),r.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=W.get(f),1===f.nodeType&&!V.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=r.camelCase(d.slice(5)),$(f,d,e[d])));V.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){W.set(this,a)}):S(this,function(b){var c;if(f&&void 0===b){if(c=W.get(f,a),void 0!==c)return c;if(c=$(f,a),void 0!==c)return c}else this.each(function(){W.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){W.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=V.get(a,b),c&&(!d||r.isArray(c)?d=V.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return V.get(a,c)||V.access(a,c,{empty:r.Callbacks("once memory").add(function(){V.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?r.queue(this[0],a):void 0===b?this:this.each(function(){var c=r.queue(this,a,b);r._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&r.dequeue(this,a)})},dequeue:function(a){return this.each(function(){r.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=r.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=V.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var _=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,aa=new RegExp("^(?:([+-])=|)("+_+")([a-z%]*)$","i"),ba=["Top","Right","Bottom","Left"],ca=function(a,b){return a=b||a,"none"===a.style.display||""===a.style.display&&r.contains(a.ownerDocument,a)&&"none"===r.css(a,"display")},da=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};function ea(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return r.css(a,b,"")},i=h(),j=c&&c[3]||(r.cssNumber[b]?"":"px"),k=(r.cssNumber[b]||"px"!==j&&+i)&&aa.exec(r.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,r.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var fa={};function ga(a){var b,c=a.ownerDocument,d=a.nodeName,e=fa[d];return e?e:(b=c.body.appendChild(c.createElement(d)),e=r.css(b,"display"),b.parentNode.removeChild(b),"none"===e&&(e="block"),fa[d]=e,e)}function ha(a,b){for(var c,d,e=[],f=0,g=a.length;f<g;f++)d=a[f],d.style&&(c=d.style.display,b?("none"===c&&(e[f]=V.get(d,"display")||null,e[f]||(d.style.display="")),""===d.style.display&&ca(d)&&(e[f]=ga(d))):"none"!==c&&(e[f]="none",V.set(d,"display",c)));for(f=0;f<g;f++)null!=e[f]&&(a[f].style.display=e[f]);return a}r.fn.extend({show:function(){return ha(this,!0)},hide:function(){return ha(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){ca(this)?r(this).show():r(this).hide()})}});var ia=/^(?:checkbox|radio)$/i,ja=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,ka=/^$|\/(?:java|ecma)script/i,la={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};la.optgroup=la.option,la.tbody=la.tfoot=la.colgroup=la.caption=la.thead,la.th=la.td;function ma(a,b){var c;return c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[],void 0===b||b&&r.nodeName(a,b)?r.merge([a],c):c}function na(a,b){for(var c=0,d=a.length;c<d;c++)V.set(a[c],"globalEval",!b||V.get(b[c],"globalEval"))}var oa=/<|&#?\w+;/;function pa(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],n=0,o=a.length;n<o;n++)if(f=a[n],f||0===f)if("object"===r.type(f))r.merge(m,f.nodeType?[f]:f);else if(oa.test(f)){g=g||l.appendChild(b.createElement("div")),h=(ja.exec(f)||["",""])[1].toLowerCase(),i=la[h]||la._default,g.innerHTML=i[1]+r.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;r.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",n=0;while(f=m[n++])if(d&&r.inArray(f,d)>-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=ma(l.appendChild(f),"script"),j&&na(g),c){k=0;while(f=g[k++])ka.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var qa=d.documentElement,ra=/^key/,sa=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ta=/^([^.]*)(?:\.(.+)|)/;function ua(){return!0}function va(){return!1}function wa(){try{return d.activeElement}catch(a){}}function xa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)xa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=va;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(qa,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(K)||[""],j=b.length;while(j--)h=ta.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.hasData(a)&&V.get(a);if(q&&(i=q.events)){b=(b||"").match(K)||[""],j=b.length;while(j--)if(h=ta.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&V.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(V.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c<arguments.length;c++)i[c]=arguments[c];if(b.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,b)!==!1){h=r.event.handlers.call(this,b,j),c=0;while((f=h[c++])&&!b.isPropagationStopped()){b.currentTarget=f.elem,d=0;while((g=f.handlers[d++])&&!b.isImmediatePropagationStopped())b.rnamespace&&!b.rnamespace.test(g.namespace)||(b.handleObj=g,b.data=g.data,e=((r.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(b.result=e)===!1&&(b.preventDefault(),b.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,b),b.result}},handlers:function(a,b){var c,d,e,f,g,h=[],i=b.delegateCount,j=a.target;if(i&&j.nodeType&&!("click"===a.type&&a.button>=1))for(;j!==this;j=j.parentNode||this)if(1===j.nodeType&&("click"!==a.type||j.disabled!==!0)){for(f=[],g={},c=0;c<i;c++)d=b[c],e=d.selector+" ",void 0===g[e]&&(g[e]=d.needsContext?r(e,this).index(j)>-1:r.find(e,this,null,[j]).length),g[e]&&f.push(d);f.length&&h.push({elem:j,handlers:f})}return j=this,i<b.length&&h.push({elem:j,handlers:b.slice(i)}),h},addProp:function(a,b){Object.defineProperty(r.Event.prototype,a,{enumerable:!0,configurable:!0,get:r.isFunction(b)?function(){if(this.originalEvent)return b(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[a]},set:function(b){Object.defineProperty(this,a,{enumerable:!0,configurable:!0,writable:!0,value:b})}})},fix:function(a){return a[r.expando]?a:new r.Event(a)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==wa()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===wa()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&r.nodeName(this,"input"))return this.click(),!1},_default:function(a){return r.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}}},r.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)},r.Event=function(a,b){return this instanceof r.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ua:va,this.target=a.target&&3===a.target.nodeType?a.target.parentNode:a.target,this.currentTarget=a.currentTarget,this.relatedTarget=a.relatedTarget):this.type=a,b&&r.extend(this,b),this.timeStamp=a&&a.timeStamp||r.now(),void(this[r.expando]=!0)):new r.Event(a,b)},r.Event.prototype={constructor:r.Event,isDefaultPrevented:va,isPropagationStopped:va,isImmediatePropagationStopped:va,isSimulated:!1,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ua,a&&!this.isSimulated&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ua,a&&!this.isSimulated&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ua,a&&!this.isSimulated&&a.stopImmediatePropagation(),this.stopPropagation()}},r.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(a){var b=a.button;return null==a.which&&ra.test(a.type)?null!=a.charCode?a.charCode:a.keyCode:!a.which&&void 0!==b&&sa.test(a.type)?1&b?1:2&b?3:4&b?2:0:a.which}},r.event.addProp),r.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){r.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||r.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),r.fn.extend({on:function(a,b,c,d){return xa(this,a,b,c,d)},one:function(a,b,c,d){return xa(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,r(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return b!==!1&&"function"!=typeof b||(c=b,b=void 0),c===!1&&(c=va),this.each(function(){r.event.remove(this,a,c,b)})}});var ya=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,za=/<script|<style|<link/i,Aa=/checked\s*(?:[^=]|=\s*.checked.)/i,Ba=/^true\/(.*)/,Ca=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Da(a,b){return r.nodeName(a,"table")&&r.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a:a}function Ea(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Fa(a){var b=Ba.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ga(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(V.hasData(a)&&(f=V.access(a),g=V.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c<d;c++)r.event.add(b,e,j[e][c])}W.hasData(a)&&(h=W.access(a),i=r.extend({},h),W.set(b,i))}}function Ha(a,b){var c=b.nodeName.toLowerCase();"input"===c&&ia.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function Ia(a,b,c,d){b=g.apply([],b);var e,f,h,i,j,k,l=0,m=a.length,n=m-1,q=b[0],s=r.isFunction(q);if(s||m>1&&"string"==typeof q&&!o.checkClone&&Aa.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ia(f,b,c,d)});if(m&&(e=pa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(ma(e,"script"),Ea),i=h.length;l<m;l++)j=e,l!==n&&(j=r.clone(j,!0,!0),i&&r.merge(h,ma(j,"script"))),c.call(a[l],j,l);if(i)for(k=h[h.length-1].ownerDocument,r.map(h,Fa),l=0;l<i;l++)j=h[l],ka.test(j.type||"")&&!V.access(j,"globalEval")&&r.contains(k,j)&&(j.src?r._evalUrl&&r._evalUrl(j.src):p(j.textContent.replace(Ca,""),k))}return a}function Ja(a,b,c){for(var d,e=b?r.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||r.cleanData(ma(d)),d.parentNode&&(c&&r.contains(d.ownerDocument,d)&&na(ma(d,"script")),d.parentNode.removeChild(d));return a}r.extend({htmlPrefilter:function(a){return a.replace(ya,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=ma(h),f=ma(a),d=0,e=f.length;d<e;d++)Ha(f[d],g[d]);if(b)if(c)for(f=f||ma(a),g=g||ma(h),d=0,e=f.length;d<e;d++)Ga(f[d],g[d]);else Ga(a,h);return g=ma(h,"script"),g.length>0&&na(g,!i&&ma(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(T(c)){if(b=c[V.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[V.expando]=void 0}c[W.expando]&&(c[W.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ja(this,a,!0)},remove:function(a){return Ja(this,a)},text:function(a){return S(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ia(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Da(this,a);b.appendChild(a)}})},prepend:function(){return Ia(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Da(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ia(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ia(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(ma(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return S(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!za.test(a)&&!la[(ja.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c<d;c++)b=this[c]||{},1===b.nodeType&&(r.cleanData(ma(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ia(this,arguments,function(b){var c=this.parentNode;r.inArray(this,a)<0&&(r.cleanData(ma(this)),c&&c.replaceChild(b,this))},a)}}),r.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){r.fn[a]=function(a){for(var c,d=[],e=r(a),f=e.length-1,g=0;g<=f;g++)c=g===f?this:this.clone(!0),r(e[g])[b](c),h.apply(d,c.get());return this.pushStack(d)}});var Ka=/^margin/,La=new RegExp("^("+_+")(?!px)[a-z%]+$","i"),Ma=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)};!function(){function b(){if(i){i.style.cssText="box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",i.innerHTML="",qa.appendChild(h);var b=a.getComputedStyle(i);c="1%"!==b.top,g="2px"===b.marginLeft,e="4px"===b.width,i.style.marginRight="50%",f="4px"===b.marginRight,qa.removeChild(h),i=null}}var c,e,f,g,h=d.createElement("div"),i=d.createElement("div");i.style&&(i.style.backgroundClip="content-box",i.cloneNode(!0).style.backgroundClip="",o.clearCloneStyle="content-box"===i.style.backgroundClip,h.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",h.appendChild(i),r.extend(o,{pixelPosition:function(){return b(),c},boxSizingReliable:function(){return b(),e},pixelMarginRight:function(){return b(),f},reliableMarginLeft:function(){return b(),g}}))}();function Na(a,b,c){var d,e,f,g,h=a.style;return c=c||Ma(a),c&&(g=c.getPropertyValue(b)||c[b],""!==g||r.contains(a.ownerDocument,a)||(g=r.style(a,b)),!o.pixelMarginRight()&&La.test(g)&&Ka.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function Oa(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Pa=/^(none|table(?!-c[ea]).+)/,Qa={position:"absolute",visibility:"hidden",display:"block"},Ra={letterSpacing:"0",fontWeight:"400"},Sa=["Webkit","Moz","ms"],Ta=d.createElement("div").style;function Ua(a){if(a in Ta)return a;var b=a[0].toUpperCase()+a.slice(1),c=Sa.length;while(c--)if(a=Sa[c]+b,a in Ta)return a}function Va(a,b,c){var d=aa.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Wa(a,b,c,d,e){var f,g=0;for(f=c===(d?"border":"content")?4:"width"===b?1:0;f<4;f+=2)"margin"===c&&(g+=r.css(a,c+ba[f],!0,e)),d?("content"===c&&(g-=r.css(a,"padding"+ba[f],!0,e)),"margin"!==c&&(g-=r.css(a,"border"+ba[f]+"Width",!0,e))):(g+=r.css(a,"padding"+ba[f],!0,e),"padding"!==c&&(g+=r.css(a,"border"+ba[f]+"Width",!0,e)));return g}function Xa(a,b,c){var d,e=!0,f=Ma(a),g="border-box"===r.css(a,"boxSizing",!1,f);if(a.getClientRects().length&&(d=a.getBoundingClientRect()[b]),d<=0||null==d){if(d=Na(a,b,f),(d<0||null==d)&&(d=a.style[b]),La.test(d))return d;e=g&&(o.boxSizingReliable()||d===a.style[b]),d=parseFloat(d)||0}return d+Wa(a,b,c||(g?"border":"content"),e,f)+"px"}r.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Na(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=r.camelCase(b),i=a.style;return b=r.cssProps[h]||(r.cssProps[h]=Ua(h)||h),g=r.cssHooks[b]||r.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=aa.exec(c))&&e[1]&&(c=ea(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(r.cssNumber[h]?"":"px")),o.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=r.camelCase(b);return b=r.cssProps[h]||(r.cssProps[h]=Ua(h)||h),g=r.cssHooks[b]||r.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Na(a,b,d)),"normal"===e&&b in Ra&&(e=Ra[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),r.each(["height","width"],function(a,b){r.cssHooks[b]={get:function(a,c,d){if(c)return!Pa.test(r.css(a,"display"))||a.getClientRects().length&&a.getBoundingClientRect().width?Xa(a,b,d):da(a,Qa,function(){return Xa(a,b,d)})},set:function(a,c,d){var e,f=d&&Ma(a),g=d&&Wa(a,b,d,"border-box"===r.css(a,"boxSizing",!1,f),f);return g&&(e=aa.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=r.css(a,b)),Va(a,c,g)}}}),r.cssHooks.marginLeft=Oa(o.reliableMarginLeft,function(a,b){if(b)return(parseFloat(Na(a,"marginLeft"))||a.getBoundingClientRect().left-da(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}))+"px"}),r.each({margin:"",padding:"",border:"Width"},function(a,b){r.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];d<4;d++)e[a+ba[d]+b]=f[d]||f[d-2]||f[0];return e}},Ka.test(a)||(r.cssHooks[a+b].set=Va)}),r.fn.extend({css:function(a,b){return S(this,function(a,b,c){var d,e,f={},g=0;if(r.isArray(b)){for(d=Ma(a),e=b.length;g<e;g++)f[b[g]]=r.css(a,b[g],!1,d);return f}return void 0!==c?r.style(a,b,c):r.css(a,b)},a,b,arguments.length>1)}});function Ya(a,b,c,d,e){return new Ya.prototype.init(a,b,c,d,e)}r.Tween=Ya,Ya.prototype={constructor:Ya,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=Ya.propHooks[this.prop];return a&&a.get?a.get(this):Ya.propHooks._default.get(this)},run:function(a){var b,c=Ya.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Ya.propHooks._default.set(this),this}},Ya.prototype.init.prototype=Ya.prototype,Ya.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},Ya.propHooks.scrollTop=Ya.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=Ya.prototype.init,r.fx.step={};var Za,$a,_a=/^(?:toggle|show|hide)$/,ab=/queueHooks$/;function bb(){$a&&(a.requestAnimationFrame(bb),r.fx.tick())}function cb(){return a.setTimeout(function(){Za=void 0}),Za=r.now()}function db(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=ba[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function eb(a,b,c){for(var d,e=(hb.tweeners[b]||[]).concat(hb.tweeners["*"]),f=0,g=e.length;f<g;f++)if(d=e[f].call(c,b,a))return d}function fb(a,b,c){var d,e,f,g,h,i,j,k,l="width"in b||"height"in b,m=this,n={},o=a.style,p=a.nodeType&&ca(a),q=V.get(a,"fxshow");c.queue||(g=r._queueHooks(a,"fx"),null==g.unqueued&&(g.unqueued=0,h=g.empty.fire,g.empty.fire=function(){g.unqueued||h()}),g.unqueued++,m.always(function(){m.always(function(){g.unqueued--,r.queue(a,"fx").length||g.empty.fire()})}));for(d in b)if(e=b[d],_a.test(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}n[d]=q&&q[d]||r.style(a,d)}if(i=!r.isEmptyObject(b),i||!r.isEmptyObject(n)){l&&1===a.nodeType&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=q&&q.display,null==j&&(j=V.get(a,"display")),k=r.css(a,"display"),"none"===k&&(j?k=j:(ha([a],!0),j=a.style.display||j,k=r.css(a,"display"),ha([a]))),("inline"===k||"inline-block"===k&&null!=j)&&"none"===r.css(a,"float")&&(i||(m.done(function(){o.display=j}),null==j&&(k=o.display,j="none"===k?"":k)),o.display="inline-block")),c.overflow&&(o.overflow="hidden",m.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]})),i=!1;for(d in n)i||(q?"hidden"in q&&(p=q.hidden):q=V.access(a,"fxshow",{display:j}),f&&(q.hidden=!p),p&&ha([a],!0),m.done(function(){p||ha([a]),V.remove(a,"fxshow");for(d in n)r.style(a,d,n[d])})),i=eb(p?q[d]:0,d,m),d in q||(q[d]=i.start,p&&(i.end=i.start,i.start=0))}}function gb(a,b){var c,d,e,f,g;for(c in a)if(d=r.camelCase(c),e=b[d],f=a[c],r.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=r.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function hb(a,b,c){var d,e,f=0,g=hb.prefilters.length,h=r.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Za||cb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;g<i;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),f<1&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:r.extend({},b),opts:r.extend(!0,{specialEasing:{},easing:r.easing._default},c),originalProperties:b,originalOptions:c,startTime:Za||cb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=r.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;c<d;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(gb(k,j.opts.specialEasing);f<g;f++)if(d=hb.prefilters[f].call(j,a,k,j.opts))return r.isFunction(d.stop)&&(r._queueHooks(j.elem,j.opts.queue).stop=r.proxy(d.stop,d)),d;return r.map(k,eb,j),r.isFunction(j.opts.start)&&j.opts.start.call(a,j),r.fx.timer(r.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}r.Animation=r.extend(hb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return ea(c.elem,a,aa.exec(b),c),c}]},tweener:function(a,b){r.isFunction(a)?(b=a,a=["*"]):a=a.match(K);for(var c,d=0,e=a.length;d<e;d++)c=a[d],hb.tweeners[c]=hb.tweeners[c]||[],hb.tweeners[c].unshift(b)},prefilters:[fb],prefilter:function(a,b){b?hb.prefilters.unshift(a):hb.prefilters.push(a)}}),r.speed=function(a,b,c){var e=a&&"object"==typeof a?r.extend({},a):{complete:c||!c&&b||r.isFunction(a)&&a,duration:a,easing:c&&b||b&&!r.isFunction(b)&&b};return r.fx.off||d.hidden?e.duration=0:"number"!=typeof e.duration&&(e.duration in r.fx.speeds?e.duration=r.fx.speeds[e.duration]:e.duration=r.fx.speeds._default),null!=e.queue&&e.queue!==!0||(e.queue="fx"),e.old=e.complete,e.complete=function(){r.isFunction(e.old)&&e.old.call(this),e.queue&&r.dequeue(this,e.queue)},e},r.fn.extend({fadeTo:function(a,b,c,d){return this.filter(ca).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=r.isEmptyObject(a),f=r.speed(b,c,d),g=function(){var b=hb(this,r.extend({},a),f);(e||V.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=r.timers,g=V.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&ab.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||r.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=V.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=r.timers,g=d?d.length:0;for(c.finish=!0,r.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;b<g;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),r.each(["toggle","show","hide"],function(a,b){var c=r.fn[b];r.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(db(b,!0),a,d,e)}}),r.each({slideDown:db("show"),slideUp:db("hide"),slideToggle:db("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){r.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),r.timers=[],r.fx.tick=function(){var a,b=0,c=r.timers;for(Za=r.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||r.fx.stop(),Za=void 0},r.fx.timer=function(a){r.timers.push(a),a()?r.fx.start():r.timers.pop()},r.fx.interval=13,r.fx.start=function(){$a||($a=a.requestAnimationFrame?a.requestAnimationFrame(bb):a.setInterval(r.fx.tick,r.fx.interval))},r.fx.stop=function(){a.cancelAnimationFrame?a.cancelAnimationFrame($a):a.clearInterval($a),$a=null},r.fx.speeds={slow:600,fast:200,_default:400},r.fn.delay=function(b,c){return b=r.fx?r.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a=d.createElement("input"),b=d.createElement("select"),c=b.appendChild(d.createElement("option"));a.type="checkbox",o.checkOn=""!==a.value,o.optSelected=c.selected,a=d.createElement("input"),a.value="t",a.type="radio",o.radioValue="t"===a.value}();var ib,jb=r.expr.attrHandle;r.fn.extend({attr:function(a,b){return S(this,r.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?ib:void 0)),
void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&r.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(K);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),ib={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=jb[b]||r.find.attr;jb[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=jb[g],jb[g]=e,e=null!=c(a,b,d)?g:null,jb[g]=f),e}});var kb=/^(?:input|select|textarea|button)$/i,lb=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return S(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):kb.test(a.nodeName)||lb.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});function mb(a){var b=a.match(K)||[];return b.join(" ")}function nb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,nb(this)))});if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=nb(c),d=1===c.nodeType&&" "+mb(e)+" "){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=mb(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,nb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=nb(c),d=1===c.nodeType&&" "+mb(e)+" "){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=mb(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,nb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(K)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=nb(this),b&&V.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":V.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+mb(nb(c))+" ").indexOf(b)>-1)return!0;return!1}});var ob=/\r/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":r.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(ob,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:mb(r.text(a))}},select:{get:function(a){var b,c,d,e=a.options,f=a.selectedIndex,g="select-one"===a.type,h=g?null:[],i=g?f+1:e.length;for(d=f<0?i:g?f:0;d<i;d++)if(c=e[d],(c.selected||d===f)&&!c.disabled&&(!c.parentNode.disabled||!r.nodeName(c.parentNode,"optgroup"))){if(b=r(c).val(),g)return b;h.push(b)}return h},set:function(a,b){var c,d,e=a.options,f=r.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=r.inArray(r.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(r.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var pb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!pb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,pb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(V.get(h,"events")||{})[b.type]&&V.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&T(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!T(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=V.access(d,b);e||d.addEventListener(a,c,!0),V.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=V.access(d,b)-1;e?V.access(d,b,e):(d.removeEventListener(a,c,!0),V.remove(d,b))}}});var qb=a.location,rb=r.now(),sb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var tb=/\[\]$/,ub=/\r?\n/g,vb=/^(?:submit|button|image|reset|file)$/i,wb=/^(?:input|select|textarea|keygen)/i;function xb(a,b,c,d){var e;if(r.isArray(b))r.each(b,function(b,e){c||tb.test(a)?d(a,e):xb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)xb(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(r.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)xb(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&wb.test(this.nodeName)&&!vb.test(a)&&(this.checked||!ia.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:r.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(ub,"\r\n")}}):{name:b.name,value:c.replace(ub,"\r\n")}}).get()}});var yb=/%20/g,zb=/#.*$/,Ab=/([?&])_=[^&]*/,Bb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Cb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Db=/^(?:GET|HEAD)$/,Eb=/^\/\//,Fb={},Gb={},Hb="*/".concat("*"),Ib=d.createElement("a");Ib.href=qb.href;function Jb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(K)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Kb(a,b,c,d){var e={},f=a===Gb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Lb(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Mb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Nb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:qb.href,type:"GET",isLocal:Cb.test(qb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Hb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Lb(Lb(a,r.ajaxSettings),b):Lb(r.ajaxSettings,a)},ajaxPrefilter:Jb(Fb),ajaxTransport:Jb(Gb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Bb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||qb.href)+"").replace(Eb,qb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(K)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Ib.protocol+"//"+Ib.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Kb(Fb,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Db.test(o.type),f=o.url.replace(zb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(yb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(sb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Ab,"$1"),n=(sb.test(f)?"&":"?")+"_="+rb++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Hb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Kb(Gb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(v=Mb(o,y,d)),v=Nb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",b<0&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Ob={0:200,1223:204},Pb=r.ajaxSettings.xhr();o.cors=!!Pb&&"withCredentials"in Pb,o.ajax=Pb=!!Pb,r.ajaxTransport(function(b){var c,d;if(o.cors||Pb&&!b.crossDomain)return{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Ob[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r("<script>").prop({charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&f("error"===a.type?404:200,a.type)}),d.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Qb=[],Rb=/(=)\?(?=&|$)|\?\?/;r.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Qb.pop()||r.expando+"_"+rb++;return this[a]=!0,a}}),r.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Rb.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Rb.test(b.data)&&"data");if(h||"jsonp"===b.dataTypes[0])return e=b.jsonpCallback=r.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Rb,"$1"+e):b.jsonp!==!1&&(b.url+=(sb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||r.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?r(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Qb.push(e)),g&&r.isFunction(f)&&f(g[0]),g=f=void 0}),"script"}),o.createHTMLDocument=function(){var a=d.implementation.createHTMLDocument("").body;return a.innerHTML="<form></form><form></form>",2===a.childNodes.length}(),r.parseHTML=function(a,b,c){if("string"!=typeof a)return[];"boolean"==typeof b&&(c=b,b=!1);var e,f,g;return b||(o.createHTMLDocument?(b=d.implementation.createHTMLDocument(""),e=b.createElement("base"),e.href=d.location.href,b.head.appendChild(e)):b=d),f=B.exec(a),g=!c&&[],f?[b.createElement(f[1])]:(f=pa([a],b,g),g&&g.length&&r(g).remove(),r.merge([],f.childNodes))},r.fn.load=function(a,b,c){var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=mb(a.slice(h)),a=a.slice(0,h)),r.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&r.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?r("<div>").append(r.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},r.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){r.fn[b]=function(a){return this.on(b,a)}}),r.expr.pseudos.animated=function(a){return r.grep(r.timers,function(b){return a===b.elem}).length};function Sb(a){return r.isWindow(a)?a:9===a.nodeType&&a.defaultView}r.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=r.css(a,"position"),l=r(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=r.css(a,"top"),i=r.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),r.isFunction(b)&&(b=b.call(a,c,r.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},r.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){r.offset.setOffset(this,a,b)});var b,c,d,e,f=this[0];if(f)return f.getClientRects().length?(d=f.getBoundingClientRect(),d.width||d.height?(e=f.ownerDocument,c=Sb(e),b=e.documentElement,{top:d.top+c.pageYOffset-b.clientTop,left:d.left+c.pageXOffset-b.clientLeft}):d):{top:0,left:0}},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===r.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),r.nodeName(a[0],"html")||(d=a.offset()),d={top:d.top+r.css(a[0],"borderTopWidth",!0),left:d.left+r.css(a[0],"borderLeftWidth",!0)}),{top:b.top-d.top-r.css(c,"marginTop",!0),left:b.left-d.left-r.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&"static"===r.css(a,"position"))a=a.offsetParent;return a||qa})}}),r.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;r.fn[a]=function(d){return S(this,function(a,d,e){var f=Sb(a);return void 0===e?f?f[b]:a[d]:void(f?f.scrollTo(c?f.pageXOffset:e,c?e:f.pageYOffset):a[d]=e)},a,d,arguments.length)}}),r.each(["top","left"],function(a,b){r.cssHooks[b]=Oa(o.pixelPosition,function(a,c){if(c)return c=Na(a,b),La.test(c)?r(a).position()[b]+"px":c})}),r.each({Height:"height",Width:"width"},function(a,b){r.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){r.fn[d]=function(e,f){var g=arguments.length&&(c||"boolean"!=typeof e),h=c||(e===!0||f===!0?"margin":"border");return S(this,function(b,c,e){var f;return r.isWindow(b)?0===d.indexOf("outer")?b["inner"+a]:b.document.documentElement["client"+a]:9===b.nodeType?(f=b.documentElement,Math.max(b.body["scroll"+a],f["scroll"+a],b.body["offset"+a],f["offset"+a],f["client"+a])):void 0===e?r.css(b,c,h):r.style(b,c,e,h)},b,g?e:void 0,g)}})}),r.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),r.parseJSON=JSON.parse,"function"==typeof define&&define.amd&&define("jquery",[],function(){return r});var Tb=a.jQuery,Ub=a.$;return r.noConflict=function(b){return a.$===r&&(a.$=Ub),b&&a.jQuery===r&&(a.jQuery=Tb),r},b||(a.jQuery=a.$=r),r});
$cvf = jQuery.noConflict(true);
(function () { var n, t, r, e = [].indexOf || function (n) { for (var t = 0, r = this.length; r > t; t++)if (t in this && this[t] === n) return t; return -1 }; r = function () { function n() { this.trie = {} } return n.prototype.push = function (n) { var t, r, e, i, a, l, u; for (n = n.toString(), a = this.trie, l = n.split(""), u = [], r = e = 0, i = l.length; i > e; r = ++e)t = l[r], null == a[t] && (r === n.length - 1 ? a[t] = null : a[t] = {}), u.push(a = a[t]); return u }, n.prototype.find = function (n) { var t, r, e, i, a, l; for (n = n.toString(), a = this.trie, l = n.split(""), r = e = 0, i = l.length; i > e; r = ++e) { if (t = l[r], !a.hasOwnProperty(t)) return !1; if (null === a[t]) return !0; a = a[t] } }, n }(), t = function () { function n(n) { if (this.trie = n, this.trie.constructor !== r) throw Error("Range constructor requires a Trie parameter") } return n.rangeWithString = function (t) { var e, i, a, l, u, o, c, h, f; if ("string" != typeof t) throw Error("rangeWithString requires a string parameter"); for (t = t.replace(/ /g, ""), t = t.split(","), f = new r, e = 0, a = t.length; a > e; e++)if (o = t[e], u = o.match(/^(\d+)-(\d+)$/)) for (l = i = c = u[1], h = u[2]; h >= c ? h >= i : i >= h; l = h >= c ? ++i : --i)f.push(l); else { if (!o.match(/^\d+$/)) throw Error("Invalid range '" + u + "'"); f.push(o) } return new n(f) }, n.prototype.match = function (n) { return this.trie.find(n) }, n }(), n = $cvf, n.fn.validateCreditCard = function (r, i) { var a, l, u, o, c, h, f, g, s, v, p, d, m; for (o = [{ name: "amex", range: "34,37", valid_length: [15] }, { name: "diners_club_carte_blanche", range: "300-305", valid_length: [14] }, { name: "diners_club_international", range: "36", valid_length: [14] }, { name: "jcb", range: "3528-3589", valid_length: [16] }, { name: "laser", range: "6304, 6706, 6709, 6771", valid_length: [16, 17, 18, 19] }, { name: "visa_electron", range: "4026, 417500, 4508, 4844, 4913, 4917", valid_length: [16] }, { name: "visa", range: "4", valid_length: [13, 14, 15, 16, 17, 18, 19] }, { name: "mastercard", range: "51-55,2221-2720", valid_length: [16] }, { name: "discover", range: "6011, 622126-622925, 644-649, 65", valid_length: [16] }, { name: "dankort", range: "5019", valid_length: [16] }, { name: "maestro", range: "50, 56-69", valid_length: [12, 13, 14, 15, 16, 17, 18, 19] }, { name: "uatp", range: "1", valid_length: [15] }], a = !1, r && ("object" == typeof r ? (i = r, a = !1, r = null) : "function" == typeof r && (a = !0)), null == i && (i = {}), null == i.accept && (i.accept = function () { var n, t, r; for (r = [], n = 0, t = o.length; t > n; n++)l = o[n], r.push(l.name); return r }()), p = i.accept, g = 0, s = p.length; s > g; g++)if (u = p[g], e.call(function () { var n, t, r; for (r = [], n = 0, t = o.length; t > n; n++)l = o[n], r.push(l.name); return r }(), u) < 0) throw Error("Credit card type '" + u + "' is not supported"); return c = function (n) { var r, a, c, h; for (h = function () { var n, t, r, a; for (a = [], n = 0, t = o.length; t > n; n++)l = o[n], r = l.name, e.call(i.accept, r) >= 0 && a.push(l); return a }(), r = 0, a = h.length; a > r; r++)if (u = h[r], c = t.rangeWithString(u.range), c.match(n)) return u; return null }, f = function (n) { var t, r, e, i, a, l; for (l = 0, a = n.split("").reverse(), i = r = 0, e = a.length; e > r; i = ++r)t = a[i], t = +t, i % 2 ? (t *= 2, l += 10 > t ? t : t - 9) : l += t; return l % 10 === 0 }, h = function (n, t) { var r; return r = n.length, e.call(t.valid_length, r) >= 0 }, m = function (n) { var t, r; return u = c(n), r = !1, t = !1, null != u && (r = f(n), t = h(n, u)), { card_type: u, valid: r && t, luhn_valid: r, length_valid: t } }, d = function (t) { return function () { var r; return r = v(n(t).val()), m(r) } }(this), v = function (n) { return n.replace(/[ -]/g, "") }, a ? (this.on("input.jccv", function (t) { return function () { return n(t).off("keyup.jccv"), r.call(t, d()) } }(this)), this.on("keyup.jccv", function (n) { return function () { return r.call(n, d()) } }(this)), this.on("blur.jccv", function (n) { return function () { return r.call(n, d()) } }(this)), r.call(this, d()), this) : d() } }).call(this);
/*!
 * Datepicker for Bootstrap v1.6.4 (https://github.com/eternicode/bootstrap-datepicker)
 *
 * Copyright 2012 Stefan Petre
 * Improvements by Andrew Rowls
 * Licensed under the Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0)
 */
(function(n){typeof define=="function"&&define.amd?define(["jquery"],n):typeof exports=="object"?n(require("jquery")):n($cvf)})(function(n,t){function u(){return new Date(Date.UTC.apply(Date,arguments))}function h(){var n=new Date;return u(n.getFullYear(),n.getMonth(),n.getDate())}function y(n,t){return n.getUTCFullYear()===t.getUTCFullYear()&&n.getUTCMonth()===t.getUTCMonth()&&n.getUTCDate()===t.getUTCDate()}function c(n){return function(){return this[n].apply(this,arguments)}}function p(n){return n&&!isNaN(n.getTime())}function w(t,i){function s(n,t){return t.toLowerCase()}var u=n(t).data(),f={},e,o=new RegExp("^"+i.toLowerCase()+"([A-Z])"),r;i=new RegExp("^"+i.toLowerCase());for(r in u)i.test(r)&&(e=r.replace(o,s),f[e]=u[r]);return f}function b(t){var u={},i;if(r[t]||(t=t.split("-")[0],r[t]))return i=r[t],n.each(v,function(n,t){t in i&&(u[t]=i[t])}),u}var l=function(){var t={get:function(n){return this.slice(n)[0]},contains:function(n){for(var i=n&&n.valueOf(),t=0,r=this.length;t<r;t++)if(this[t].valueOf()===i)return t;return-1},remove:function(n){this.splice(n,1)},replace:function(t){t&&(n.isArray(t)||(t=[t]),this.clear(),this.push.apply(this,t))},clear:function(){this.length=0},copy:function(){var n=new l;return n.replace(this),n}};return function(){var i=[];return i.push.apply(i,arguments),n.extend(i,t),i}}(),f=function(t,r){n(t).data("datepicker",this);this._process_options(r);this.dates=new l;this.viewDate=this.o.defaultViewDate;this.focusDate=null;this.element=n(t);this.isInput=this.element.is("input");this.inputField=this.isInput?this.element:this.element.find("input");this.component=this.element.hasClass("date")?this.element.find(".add-on, .input-group-addon, .btn"):!1;this.hasInput=this.component&&this.inputField.length;this.component&&this.component.length===0&&(this.component=!1);this.isInline=!this.component&&this.element.is("div");this.picker=n(i.template);this._check_template(this.o.templates.leftArrow)&&this.picker.find(".prev").html(this.o.templates.leftArrow);this._check_template(this.o.templates.rightArrow)&&this.picker.find(".next").html(this.o.templates.rightArrow);this._buildEvents();this._attachEvents();this.isInline?this.picker.addClass("datepicker-inline").appendTo(this.element):this.picker.addClass("datepicker-dropdown dropdown-menu");this.o.rtl&&this.picker.addClass("datepicker-rtl");this.viewMode=this.o.startView;this.o.calendarWeeks&&this.picker.find("thead .datepicker-title, tfoot .today, tfoot .clear").attr("colspan",function(n,t){return parseInt(t)+1});this._allow_update=!1;this.setStartDate(this._o.startDate);this.setEndDate(this._o.endDate);this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled);this.setDaysOfWeekHighlighted(this.o.daysOfWeekHighlighted);this.setDatesDisabled(this.o.datesDisabled);this.fillDow();this.fillMonths();this._allow_update=!0;this.update();this.showMode();this.isInline&&this.show()},o,a,e,s,v,r,i;f.prototype={constructor:f,_resolveViewName:function(n,i){return n===0||n==="days"||n==="month"?0:n===1||n==="months"||n==="year"?1:n===2||n==="years"||n==="decade"?2:n===3||n==="decades"||n==="century"?3:n===4||n==="centuries"||n==="millennium"?4:i===t?!1:i},_check_template:function(i){try{if(i===t||i==="")return!1;if((i.match(/[<>]/g)||[]).length<=0)return!0;var r=n(i);return r.length>0}catch(u){return!1}},_process_options:function(t){var f,o,l,e,c;if(this._o=n.extend({},this._o,t),f=this.o=n.extend({},this._o),o=f.language,r[o]||(o=o.split("-")[0],r[o]||(o=s.language)),f.language=o,f.startView=this._resolveViewName(f.startView,0),f.minViewMode=this._resolveViewName(f.minViewMode,0),f.maxViewMode=this._resolveViewName(f.maxViewMode,4),f.startView=Math.min(f.startView,f.maxViewMode),f.startView=Math.max(f.startView,f.minViewMode),f.multidate!==!0&&(f.multidate=Number(f.multidate)||!1,f.multidate!==!1&&(f.multidate=Math.max(0,f.multidate))),f.multidateSeparator=String(f.multidateSeparator),f.weekStart%=7,f.weekEnd=(f.weekStart+6)%7,l=i.parseFormat(f.format),f.startDate!==-Infinity&&(f.startDate=f.startDate?f.startDate instanceof Date?this._local_to_utc(this._zero_time(f.startDate)):i.parseDate(f.startDate,l,f.language,f.assumeNearbyYear):-Infinity),f.endDate!==Infinity&&(f.endDate=f.endDate?f.endDate instanceof Date?this._local_to_utc(this._zero_time(f.endDate)):i.parseDate(f.endDate,l,f.language,f.assumeNearbyYear):Infinity),f.daysOfWeekDisabled=f.daysOfWeekDisabled||[],n.isArray(f.daysOfWeekDisabled)||(f.daysOfWeekDisabled=f.daysOfWeekDisabled.split(/[,\s]*/)),f.daysOfWeekDisabled=n.map(f.daysOfWeekDisabled,function(n){return parseInt(n,10)}),f.daysOfWeekHighlighted=f.daysOfWeekHighlighted||[],n.isArray(f.daysOfWeekHighlighted)||(f.daysOfWeekHighlighted=f.daysOfWeekHighlighted.split(/[,\s]*/)),f.daysOfWeekHighlighted=n.map(f.daysOfWeekHighlighted,function(n){return parseInt(n,10)}),f.datesDisabled=f.datesDisabled||[],n.isArray(f.datesDisabled)||(f.datesDisabled=[f.datesDisabled]),f.datesDisabled=n.map(f.datesDisabled,function(n){return i.parseDate(n,l,f.language,f.assumeNearbyYear)}),e=String(f.orientation).toLowerCase().split(/\s+/g),c=f.orientation.toLowerCase(),e=n.grep(e,function(n){return/^auto|left|right|top|bottom$/.test(n)}),f.orientation={x:"auto",y:"auto"},c&&c!=="auto")if(e.length===1)switch(e[0]){case"top":case"bottom":f.orientation.y=e[0];break;case"left":case"right":f.orientation.x=e[0]}else c=n.grep(e,function(n){return/^left|right$/.test(n)}),f.orientation.x=c[0]||"auto",c=n.grep(e,function(n){return/^top|bottom$/.test(n)}),f.orientation.y=c[0]||"auto";if(f.defaultViewDate){var a=f.defaultViewDate.year||(new Date).getFullYear(),v=f.defaultViewDate.month||0,y=f.defaultViewDate.day||1;f.defaultViewDate=u(a,v,y)}else f.defaultViewDate=h()},_events:[],_secondaryEvents:[],_applyEvents:function(n){for(var i=0,f,r,u;i<n.length;i++){f=n[i][0];n[i].length===2?(r=t,u=n[i][1]):n[i].length===3&&(r=n[i][1],u=n[i][2]);f.on(u,r)}},_unapplyEvents:function(n){for(var i=0,f,r,u;i<n.length;i++)f=n[i][0],n[i].length===2?(u=t,r=n[i][1]):n[i].length===3&&(u=n[i][1],r=n[i][2]),f.off(r,u)},_buildEvents:function(){var t={keyup:n.proxy(function(t){n.inArray(t.keyCode,[27,37,39,38,40,32,13,9])===-1&&this.update()},this),keydown:n.proxy(this.keydown,this),paste:n.proxy(this.paste,this)};this.o.showOnFocus===!0&&(t.focus=n.proxy(this.show,this));this._events=this.isInput?[[this.element,t]]:this.component&&this.hasInput?[[this.inputField,t],[this.component,{click:n.proxy(this.show,this)}]]:[[this.element,{click:n.proxy(this.show,this),keydown:n.proxy(this.keydown,this)}]];this._events.push([this.element,"*",{blur:n.proxy(function(n){this._focused_from=n.target},this)}],[this.element,{blur:n.proxy(function(n){this._focused_from=n.target},this)}]);this.o.immediateUpdates&&this._events.push([this.element,{"changeYear changeMonth":n.proxy(function(n){this.update(n.date)},this)}]);this._secondaryEvents=[[this.picker,{click:n.proxy(this.click,this)}],[n(window),{resize:n.proxy(this.place,this)}],[n(document),{mousedown:n.proxy(function(n){this.element.is(n.target)||this.element.find(n.target).length||this.picker.is(n.target)||this.picker.find(n.target).length||this.isInline||this.hide()},this)}]]},_attachEvents:function(){this._detachEvents();this._applyEvents(this._events)},_detachEvents:function(){this._unapplyEvents(this._events)},_attachSecondaryEvents:function(){this._detachSecondaryEvents();this._applyEvents(this._secondaryEvents)},_detachSecondaryEvents:function(){this._unapplyEvents(this._secondaryEvents)},_trigger:function(t,r){var u=r||this.dates.get(-1),f=this._utc_to_local(u);this.element.trigger({type:t,date:f,dates:n.map(this.dates,this._utc_to_local),format:n.proxy(function(n,t){arguments.length===0?(n=this.dates.length-1,t=this.o.format):typeof n=="string"&&(t=n,n=this.dates.length-1);t=t||this.o.format;var r=this.dates.get(n);return i.formatDate(r,t,this.o.language)},this)})},show:function(){if(!this.inputField.prop("disabled")&&(!this.inputField.prop("readonly")||this.o.enableOnReadonly!==!1))return this.isInline||this.picker.appendTo(this.o.container),this.place(),this.picker.show(),this._attachSecondaryEvents(),this._trigger("show"),(window.navigator.msMaxTouchPoints||"ontouchstart"in document)&&this.o.disableTouchKeyboard&&n(this.element).blur(),this},hide:function(){return this.isInline||!this.picker.is(":visible")?this:(this.focusDate=null,this.picker.hide().detach(),this._detachSecondaryEvents(),this.viewMode=this.o.startView,this.showMode(),this.o.forceParse&&this.inputField.val()&&this.setValue(),this._trigger("hide"),this)},destroy:function(){return this.hide(),this._detachEvents(),this._detachSecondaryEvents(),this.picker.remove(),delete this.element.data().datepicker,this.isInput||delete this.element.data().date,this},paste:function(t){var i;if(t.originalEvent.clipboardData&&t.originalEvent.clipboardData.types&&n.inArray("text/plain",t.originalEvent.clipboardData.types)!==-1)i=t.originalEvent.clipboardData.getData("text/plain");else if(window.clipboardData)i=window.clipboardData.getData("Text");else return;this.setDate(i);this.update();t.preventDefault()},_utc_to_local:function(n){return n&&new Date(n.getTime()+n.getTimezoneOffset()*6e4)},_local_to_utc:function(n){return n&&new Date(n.getTime()-n.getTimezoneOffset()*6e4)},_zero_time:function(n){return n&&new Date(n.getFullYear(),n.getMonth(),n.getDate())},_zero_utc_time:function(n){return n&&new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()))},getDates:function(){return n.map(this.dates,this._utc_to_local)},getUTCDates:function(){return n.map(this.dates,function(n){return new Date(n)})},getDate:function(){return this._utc_to_local(this.getUTCDate())},getUTCDate:function(){var n=this.dates.get(-1);return typeof n!="undefined"?new Date(n):null},clearDates:function(){this.inputField&&this.inputField.val("");this.update();this._trigger("changeDate");this.o.autoclose&&this.hide()},setDates:function(){var t=n.isArray(arguments[0])?arguments[0]:arguments;return this.update.apply(this,t),this._trigger("changeDate"),this.setValue(),this},setUTCDates:function(){var t=n.isArray(arguments[0])?arguments[0]:arguments;return this.update.apply(this,n.map(t,this._utc_to_local)),this._trigger("changeDate"),this.setValue(),this},setDate:c("setDates"),setUTCDate:c("setUTCDates"),remove:c("destroy"),setValue:function(){var n=this.getFormattedDate();return this.inputField.val(n),this},getFormattedDate:function(r){r===t&&(r=this.o.format);var u=this.o.language;return n.map(this.dates,function(n){return i.formatDate(n,r,u)}).join(this.o.multidateSeparator)},getStartDate:function(){return this.o.startDate},setStartDate:function(n){return this._process_options({startDate:n}),this.update(),this.updateNavArrows(),this},getEndDate:function(){return this.o.endDate},setEndDate:function(n){return this._process_options({endDate:n}),this.update(),this.updateNavArrows(),this},setDaysOfWeekDisabled:function(n){return this._process_options({daysOfWeekDisabled:n}),this.update(),this.updateNavArrows(),this},setDaysOfWeekHighlighted:function(n){return this._process_options({daysOfWeekHighlighted:n}),this.update(),this},setDatesDisabled:function(n){this._process_options({datesDisabled:n});this.update();this.updateNavArrows()},place:function(){var r,y,p;if(this.isInline)return this;var f=this.picker.outerWidth(),s=this.picker.outerHeight(),e=n(this.o.container),h=e.width(),c=this.o.container==="body"?n(document).scrollTop():e.scrollTop(),l=e.offset(),a=[];this.element.parents().each(function(){var t=n(this).css("z-index");t!=="auto"&&t!==0&&a.push(parseInt(t))});var v=Math.max.apply(Math,a)+this.o.zIndexOffset,u=this.component?this.component.parent().offset():this.element.offset(),w=this.component?this.component.outerHeight(!0):this.element.outerHeight(!1),o=this.component?this.component.outerWidth(!0):this.element.outerWidth(!1),t=u.left-l.left,i=u.top-l.top;return this.o.container!=="body"&&(i+=c),this.picker.removeClass("datepicker-orient-top datepicker-orient-bottom datepicker-orient-right datepicker-orient-left"),this.o.orientation.x!=="auto"?(this.picker.addClass("datepicker-orient-"+this.o.orientation.x),this.o.orientation.x==="right"&&(t-=f-o)):u.left<0?(this.picker.addClass("datepicker-orient-left"),t-=u.left-10):t+f>h?(this.picker.addClass("datepicker-orient-right"),t+=o-f):this.picker.addClass("datepicker-orient-left"),r=this.o.orientation.y,r==="auto"&&(y=-c+i-s,r=y<0?"bottom":"top"),this.picker.addClass("datepicker-orient-"+r),r==="top"?i-=s+parseInt(this.picker.css("padding-top")):i+=w,this.o.rtl?(p=h-(t+o),this.picker.css({top:i,right:p,zIndex:v})):this.picker.css({top:i,left:t,zIndex:v}),this},_allow_update:!0,update:function(){if(!this._allow_update)return this;var r=this.dates.copy(),t=[],u=!1;return arguments.length?(n.each(arguments,n.proxy(function(n,i){i instanceof Date&&(i=this._local_to_utc(i));t.push(i)},this)),u=!0):(t=this.isInput?this.element.val():this.element.data("date")||this.inputField.val(),t=t&&this.o.multidate?t.split(this.o.multidateSeparator):[t],delete this.element.data().date),t=n.map(t,n.proxy(function(n){return i.parseDate(n,this.o.format,this.o.language,this.o.assumeNearbyYear)},this)),t=n.grep(t,n.proxy(function(n){return!this.dateWithinRange(n)||!n},this),!0),this.dates.replace(t),this.viewDate=this.dates.length?new Date(this.dates.get(-1)):this.viewDate<this.o.startDate?new Date(this.o.startDate):this.viewDate>this.o.endDate?new Date(this.o.endDate):this.o.defaultViewDate,u?this.setValue():t.length&&String(r)!==String(this.dates)&&this._trigger("changeDate"),!this.dates.length&&r.length&&this._trigger("clearDate"),this.fill(),this.element.change(),this},fillDow:function(){var i=this.o.weekStart,t="<tr>";for(this.o.calendarWeeks&&(this.picker.find(".datepicker-days .datepicker-switch").attr("colspan",function(n,t){return parseInt(t)+1}),t+='<th class="cw">&#160;<\/th>');i<this.o.weekStart+7;)t+='<th class="dow',n.inArray(i,this.o.daysOfWeekDisabled)>-1&&(t+=" disabled"),t+='">'+r[this.o.language].daysMin[i++%7]+"<\/th>";t+="<\/tr>";this.picker.find(".datepicker-days thead").append(t)},fillMonths:function(){for(var t=this._utc_to_local(this.viewDate),i="",n=0,u;n<12;)u=t&&t.getMonth()===n?" focused":"",i+='<span class="month'+u+'">'+r[this.o.language].monthsShort[n++]+"<\/span>";this.picker.find(".datepicker-months td").html(i)},setRange:function(t){t&&t.length?this.range=n.map(t,function(n){return n.valueOf()}):delete this.range;this.fill()},getClassNames:function(t){var i=[],r=this.viewDate.getUTCFullYear(),f=this.viewDate.getUTCMonth(),u=new Date;return t.getUTCFullYear()<r||t.getUTCFullYear()===r&&t.getUTCMonth()<f?i.push("old"):(t.getUTCFullYear()>r||t.getUTCFullYear()===r&&t.getUTCMonth()>f)&&i.push("new"),this.focusDate&&t.valueOf()===this.focusDate.valueOf()&&i.push("focused"),this.o.todayHighlight&&t.getUTCFullYear()===u.getFullYear()&&t.getUTCMonth()===u.getMonth()&&t.getUTCDate()===u.getDate()&&i.push("today"),this.dates.contains(t)!==-1&&i.push("active"),this.dateWithinRange(t)||i.push("disabled"),this.dateIsDisabled(t)&&i.push("disabled","disabled-date"),n.inArray(t.getUTCDay(),this.o.daysOfWeekHighlighted)!==-1&&i.push("highlighted"),this.range&&(t>this.range[0]&&t<this.range[this.range.length-1]&&i.push("range"),n.inArray(t.valueOf(),this.range)!==-1&&i.push("selected"),t.valueOf()===this.range[0]&&i.push("range-start"),t.valueOf()===this.range[this.range.length-1]&&i.push("range-end")),i},_fill_yearsView:function(i,r,u,f,e,o,s,h){var w,b,y,k,d,g,a,v,l,p,c;for(w="",b=this.picker.find(i),y=parseInt(e/u,10)*u,d=parseInt(o/f,10)*f,g=parseInt(s/f,10)*f,k=n.map(this.dates,function(n){return parseInt(n.getUTCFullYear()/f,10)*f}),b.find(".datepicker-switch").text(y+"-"+(y+f*9)),a=y-f,v=-1;v<11;v+=1)l=[r],p=null,v===-1?l.push("old"):v===10&&l.push("new"),n.inArray(a,k)!==-1&&l.push("active"),(a<d||a>g)&&l.push("disabled"),a===this.viewDate.getFullYear()&&l.push("focused"),h!==n.noop&&(c=h(new Date(a,0,1)),c===t?c={}:typeof c=="boolean"?c={enabled:c}:typeof c=="string"&&(c={classes:c}),c.enabled===!1&&l.push("disabled"),c.classes&&(l=l.concat(c.classes.split(/\s+/))),c.tooltip&&(p=c.tooltip)),w+='<span class="'+l.join(" ")+'"'+(p?' title="'+p+'"':"")+">"+a+"<\/span>",a+=f;b.find("td").html(w)},fill:function(){var p=new Date(this.viewDate),o=p.getUTCFullYear(),k=p.getUTCMonth(),a=this.o.startDate!==-Infinity?this.o.startDate.getUTCFullYear():-Infinity,it=this.o.startDate!==-Infinity?this.o.startDate.getUTCMonth():-Infinity,v=this.o.endDate!==Infinity?this.o.endDate.getUTCFullYear():Infinity,rt=this.o.endDate!==Infinity?this.o.endDate.getUTCMonth():Infinity,ut=r[this.o.language].today||r.en.today||"",ft=r[this.o.language].clear||r.en.clear||"",et=r[this.o.language].titleFormat||r.en.titleFormat,y,e,f,w,h,c,s,nt,l,tt;if(!isNaN(o)&&!isNaN(k)){for(this.picker.find(".datepicker-days .datepicker-switch").text(i.formatDate(p,et,this.o.language)),this.picker.find("tfoot .today").text(ut).toggle(this.o.todayBtn!==!1),this.picker.find("tfoot .clear").text(ft).toggle(this.o.clearBtn!==!1),this.picker.find("thead .datepicker-title").text(this.o.title).toggle(this.o.title!==""),this.updateNavArrows(),this.fillMonths(),f=u(o,k-1,28),w=i.getDaysInMonth(f.getUTCFullYear(),f.getUTCMonth()),f.setUTCDate(w),f.setUTCDate(w-(f.getUTCDay()-this.o.weekStart+7)%7),h=new Date(f),f.getUTCFullYear()<100&&h.setUTCFullYear(f.getUTCFullYear()),h.setUTCDate(h.getUTCDate()+42),h=h.valueOf(),c=[];f.valueOf()<h;){if(f.getUTCDay()===this.o.weekStart&&(c.push("<tr>"),this.o.calendarWeeks)){var d=new Date(+f+(this.o.weekStart-f.getUTCDay()-7)%7*864e5),g=new Date(Number(d)+(11-d.getUTCDay())%7*864e5),b=new Date(Number(b=u(g.getUTCFullYear(),0,1))+(11-b.getUTCDay())%7*864e5),ot=(g-b)/6048e5+1;c.push('<td class="cw">'+ot+"<\/td>")}s=this.getClassNames(f);s.push("day");this.o.beforeShowDay!==n.noop&&(e=this.o.beforeShowDay(this._utc_to_local(f)),e===t?e={}:typeof e=="boolean"?e={enabled:e}:typeof e=="string"&&(e={classes:e}),e.enabled===!1&&s.push("disabled"),e.classes&&(s=s.concat(e.classes.split(/\s+/))),e.tooltip&&(y=e.tooltip));s=n.isFunction(n.uniqueSort)?n.uniqueSort(s):n.unique(s);c.push('<td class="'+s.join(" ")+'"'+(y?' title="'+y+'"':"")+">"+f.getUTCDate()+"<\/td>");y=null;f.getUTCDay()===this.o.weekEnd&&c.push("<\/tr>");f.setUTCDate(f.getUTCDate()+1)}this.picker.find(".datepicker-days tbody").empty().append(c.join(""));nt=r[this.o.language].monthsTitle||r.en.monthsTitle||"Months";l=this.picker.find(".datepicker-months").find(".datepicker-switch").text(this.o.maxViewMode<2?nt:o).end().find("span").removeClass("active");n.each(this.dates,function(n,t){t.getUTCFullYear()===o&&l.eq(t.getUTCMonth()).addClass("active")});(o<a||o>v)&&l.addClass("disabled");o===a&&l.slice(0,it).addClass("disabled");o===v&&l.slice(rt+1).addClass("disabled");this.o.beforeShowMonth!==n.noop&&(tt=this,n.each(l,function(i,r){var f=new Date(o,i,1),u=tt.o.beforeShowMonth(f);u===t?u={}:typeof u=="boolean"?u={enabled:u}:typeof u=="string"&&(u={classes:u});u.enabled!==!1||n(r).hasClass("disabled")||n(r).addClass("disabled");u.classes&&n(r).addClass(u.classes);u.tooltip&&n(r).prop("title",u.tooltip)}));this._fill_yearsView(".datepicker-years","year",10,1,o,a,v,this.o.beforeShowYear);this._fill_yearsView(".datepicker-decades","decade",100,10,o,a,v,this.o.beforeShowDecade);this._fill_yearsView(".datepicker-centuries","century",1e3,100,o,a,v,this.o.beforeShowCentury)}},updateNavArrows:function(){if(this._allow_update){var t=new Date(this.viewDate),n=t.getUTCFullYear(),i=t.getUTCMonth();switch(this.viewMode){case 0:this.o.startDate!==-Infinity&&n<=this.o.startDate.getUTCFullYear()&&i<=this.o.startDate.getUTCMonth()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"});this.o.endDate!==Infinity&&n>=this.o.endDate.getUTCFullYear()&&i>=this.o.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:case 2:case 3:case 4:this.o.startDate!==-Infinity&&n<=this.o.startDate.getUTCFullYear()||this.o.maxViewMode<2?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"});this.o.endDate!==Infinity&&n>=this.o.endDate.getUTCFullYear()||this.o.maxViewMode<2?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}}},click:function(t){var r,c,o,e,f,s,l,a;t.preventDefault();t.stopPropagation();r=n(t.target);r.hasClass("datepicker-switch")&&this.showMode(1);a=r.closest(".prev, .next");a.length>0&&(c=i.modes[this.viewMode].navStep*(a.hasClass("prev")?-1:1),this.viewMode===0?(this.viewDate=this.moveMonth(this.viewDate,c),this._trigger("changeMonth",this.viewDate)):(this.viewDate=this.moveYear(this.viewDate,c),this.viewMode===1&&this._trigger("changeYear",this.viewDate)),this.fill());r.hasClass("today")&&!r.hasClass("day")&&(this.showMode(-2),this._setDate(h(),this.o.todayBtn==="linked"?null:"view"));r.hasClass("clear")&&this.clearDates();r.hasClass("disabled")||(r.hasClass("day")&&(o=parseInt(r.text(),10)||1,e=this.viewDate.getUTCFullYear(),f=this.viewDate.getUTCMonth(),r.hasClass("old")&&(f===0?(f=11,e=e-1,s=!0,l=!0):(f=f-1,s=!0)),r.hasClass("new")&&(f===11?(f=0,e=e+1,s=!0,l=!0):(f=f+1,s=!0)),this._setDate(u(e,f,o)),l&&this._trigger("changeYear",this.viewDate),s&&this._trigger("changeMonth",this.viewDate)),r.hasClass("month")&&(this.viewDate.setUTCDate(1),o=1,f=r.parent().find("span").index(r),e=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(f),this._trigger("changeMonth",this.viewDate),this.o.minViewMode===1?(this._setDate(u(e,f,o)),this.showMode()):this.showMode(-1),this.fill()),(r.hasClass("year")||r.hasClass("decade")||r.hasClass("century"))&&(this.viewDate.setUTCDate(1),o=1,f=0,e=parseInt(r.text(),10)||0,this.viewDate.setUTCFullYear(e),r.hasClass("year")&&(this._trigger("changeYear",this.viewDate),this.o.minViewMode===2&&this._setDate(u(e,f,o))),r.hasClass("decade")&&(this._trigger("changeDecade",this.viewDate),this.o.minViewMode===3&&this._setDate(u(e,f,o))),r.hasClass("century")&&(this._trigger("changeCentury",this.viewDate),this.o.minViewMode===4&&this._setDate(u(e,f,o))),this.showMode(-1),this.fill()));this.picker.is(":visible")&&this._focused_from&&n(this._focused_from).focus();delete this._focused_from},_toggle_multidate:function(n){var t=this.dates.contains(n);if(n||this.dates.clear(),t!==-1?(this.o.multidate===!0||this.o.multidate>1||this.o.toggleActive)&&this.dates.remove(t):this.o.multidate===!1?(this.dates.clear(),this.dates.push(n)):this.dates.push(n),typeof this.o.multidate=="number")while(this.dates.length>this.o.multidate)this.dates.remove(0)},_setDate:function(n,t){t&&t!=="date"||this._toggle_multidate(n&&new Date(n));t&&t!=="view"||(this.viewDate=n&&new Date(n));this.fill();this.setValue();t&&t==="view"||this._trigger("changeDate");this.inputField&&this.inputField.change();this.o.autoclose&&(!t||t==="date")&&this.hide()},moveDay:function(n,t){var i=new Date(n);return i.setUTCDate(n.getUTCDate()+t),i},moveWeek:function(n,t){return this.moveDay(n,t*7)},moveMonth:function(n,t){var f;if(!p(n))return this.o.defaultViewDate;if(!t)return n;var i=new Date(n.valueOf()),e=i.getUTCDate(),o=i.getUTCMonth(),s=Math.abs(t),r,u;if(t=t>0?1:-1,s===1)u=t===-1?function(){return i.getUTCMonth()===o}:function(){return i.getUTCMonth()!==r},r=o+t,i.setUTCMonth(r),(r<0||r>11)&&(r=(r+12)%12);else{for(f=0;f<s;f++)i=this.moveMonth(i,t);r=i.getUTCMonth();i.setUTCDate(e);u=function(){return r!==i.getUTCMonth()}}while(u())i.setUTCDate(--e),i.setUTCMonth(r);return i},moveYear:function(n,t){return this.moveMonth(n,t*12)},moveAvailableDate:function(n,t,i){do{if(n=this[i](n,t),!this.dateWithinRange(n))return!1;i="moveDay"}while(this.dateIsDisabled(n));return n},weekOfDateIsDisabled:function(t){return n.inArray(t.getUTCDay(),this.o.daysOfWeekDisabled)!==-1},dateIsDisabled:function(t){return this.weekOfDateIsDisabled(t)||n.grep(this.o.datesDisabled,function(n){return y(t,n)}).length>0},dateWithinRange:function(n){return n>=this.o.startDate&&n<=this.o.endDate},keydown:function(n){if(!this.picker.is(":visible")){(n.keyCode===40||n.keyCode===27)&&(this.show(),n.stopPropagation());return}var u=!1,t,i,r=this.focusDate||this.viewDate;switch(n.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide();n.preventDefault();n.stopPropagation();break;case 37:case 38:case 39:case 40:if(!this.o.keyboardNavigation||this.o.daysOfWeekDisabled.length===7)break;t=n.keyCode===37||n.keyCode===38?-1:1;this.viewMode===0?n.ctrlKey?(i=this.moveAvailableDate(r,t,"moveYear"),i&&this._trigger("changeYear",this.viewDate)):n.shiftKey?(i=this.moveAvailableDate(r,t,"moveMonth"),i&&this._trigger("changeMonth",this.viewDate)):n.keyCode===37||n.keyCode===39?i=this.moveAvailableDate(r,t,"moveDay"):this.weekOfDateIsDisabled(r)||(i=this.moveAvailableDate(r,t,"moveWeek")):this.viewMode===1?((n.keyCode===38||n.keyCode===40)&&(t=t*4),i=this.moveAvailableDate(r,t,"moveMonth")):this.viewMode===2&&((n.keyCode===38||n.keyCode===40)&&(t=t*4),i=this.moveAvailableDate(r,t,"moveYear"));i&&(this.focusDate=this.viewDate=i,this.setValue(),this.fill(),n.preventDefault());break;case 13:if(!this.o.forceParse)break;r=this.focusDate||this.dates.get(-1)||this.viewDate;this.o.keyboardNavigation&&(this._toggle_multidate(r),u=!0);this.focusDate=null;this.viewDate=this.dates.get(-1)||this.viewDate;this.setValue();this.fill();this.picker.is(":visible")&&(n.preventDefault(),n.stopPropagation(),this.o.autoclose&&this.hide());break;case 9:this.focusDate=null;this.viewDate=this.dates.get(-1)||this.viewDate;this.fill();this.hide()}u&&(this.dates.length?this._trigger("changeDate"):this._trigger("clearDate"),this.inputField&&this.inputField.change())},showMode:function(n){n&&(this.viewMode=Math.max(this.o.minViewMode,Math.min(this.o.maxViewMode,this.viewMode+n)));this.picker.children("div").hide().filter(".datepicker-"+i.modes[this.viewMode].clsName).show();this.updateNavArrows()}};o=function(t,i){n(t).data("datepicker",this);this.element=n(t);this.inputs=n.map(i.inputs,function(n){return n.jquery?n[0]:n});delete i.inputs;e.call(n(this.inputs),i).on("changeDate",n.proxy(this.dateUpdated,this));this.pickers=n.map(this.inputs,function(t){return n(t).data("datepicker")});this.updateDates()};o.prototype={updateDates:function(){this.dates=n.map(this.pickers,function(n){return n.getUTCDate()});this.updateRanges()},updateRanges:function(){var t=n.map(this.dates,function(n){return n.valueOf()});n.each(this.pickers,function(n,i){i.setRange(t)})},dateUpdated:function(t){var f;if(!this.updating&&(this.updating=!0,f=n(t.target).data("datepicker"),typeof f!="undefined")){var i=f.getUTCDate(),e=n.inArray(t.target,this.inputs),r=e-1,u=e+1,o=this.inputs.length;if(e!==-1){if(n.each(this.pickers,function(n,t){t.getUTCDate()||t.setUTCDate(i)}),i<this.dates[r])while(r>=0&&i<this.dates[r])this.pickers[r--].setUTCDate(i);else if(i>this.dates[u])while(u<o&&i>this.dates[u])this.pickers[u++].setUTCDate(i);this.updateDates();delete this.updating}}},remove:function(){n.map(this.pickers,function(n){n.remove()});delete this.element.data().datepicker}};a=n.fn.datepicker;e=function(i){var u=Array.apply(null,arguments),r;if(u.shift(),this.each(function(){var h=n(this),t=h.data("datepicker"),c=typeof i=="object"&&i;if(!t){var l=w(this,"date"),a=n.extend({},s,l,c),v=b(a.language),e=n.extend({},s,v,l,c);h.hasClass("input-daterange")||e.inputs?(n.extend(e,{inputs:e.inputs||h.find("input").toArray()}),t=new o(this,e)):t=new f(this,e);h.data("datepicker",t)}typeof i=="string"&&typeof t[i]=="function"&&(r=t[i].apply(t,u))}),r===t||r instanceof f||r instanceof o)return this;if(this.length>1)throw new Error("Using only allowed for the collection of a single element ("+i+" function)");else return r};n.fn.datepicker=e;s=n.fn.datepicker.defaults={assumeNearbyYear:!1,autoclose:!1,beforeShowDay:n.noop,beforeShowMonth:n.noop,beforeShowYear:n.noop,beforeShowDecade:n.noop,beforeShowCentury:n.noop,calendarWeeks:!1,clearBtn:!1,toggleActive:!1,daysOfWeekDisabled:[],daysOfWeekHighlighted:[],datesDisabled:[],endDate:Infinity,forceParse:!0,format:"mm/dd/yyyy",keyboardNavigation:!0,language:"en",minViewMode:0,maxViewMode:4,multidate:!1,multidateSeparator:",",orientation:"auto",rtl:!1,startDate:-Infinity,startView:0,todayBtn:!1,todayHighlight:!1,weekStart:0,disableTouchKeyboard:!1,enableOnReadonly:!0,showOnFocus:!0,zIndexOffset:10,container:"body",immediateUpdates:!1,title:"",templates:{leftArrow:"&laquo;",rightArrow:"&raquo;"}};v=n.fn.datepicker.locale_opts=["format","rtl","weekStart"];n.fn.datepicker.Constructor=f;r=n.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",titleFormat:"MM yyyy"}};i={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10},{clsName:"decades",navFnc:"FullDecade",navStep:100},{clsName:"centuries",navFnc:"FullCentury",navStep:1e3}],isLeapYear:function(n){return n%4==0&&n%100!=0||n%400==0},getDaysInMonth:function(n,t){return[31,i.isLeapYear(n)?29:28,31,30,31,30,31,31,30,31,30,31][t]},validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\u5e74\u6708\u65e5\[-`{-~\t\n\r]+/g,parseFormat:function(n){if(typeof n.toValue=="function"&&typeof n.toDisplay=="function")return n;var t=n.replace(this.validParts,'\0').split('\0'),i=n.match(this.validParts);if(!t||!t.length||!i||i.length===0)throw new Error("Invalid date format.");return{separators:t,parts:i}},parseDate:function(e,o,s,c){function et(n,t){return t===!0&&(t=10),n<100&&(n+=2e3,n>(new Date).getFullYear()+t&&(n-=100)),n}function ot(){var n=this.slice(0,a[l].length),t=a[l].slice(0,n.length);return n.toLowerCase()===t.toLowerCase()}var p,st,tt,b;if(!e)return t;if(e instanceof Date)return e;if(typeof o=="string"&&(o=i.parseFormat(o)),o.toValue)return o.toValue(e,o,s);var rt=/([\-+]\d+)([dmwy])/,a=e.match(/([\-+]\d+)([dmwy])/g),ut={d:"moveDay",m:"moveMonth",w:"moveWeek",y:"moveYear"},ft={yesterday:"-1d",today:"+0d",tomorrow:"+1d"},v,k,l,d;if(/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(e)){for(e=new Date,l=0;l<a.length;l++)v=rt.exec(a[l]),k=parseInt(v[1]),d=ut[v[2]],e=f.prototype[d](e,k);return u(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())}if(typeof ft[e]!="undefined"&&(e=ft[e],a=e.match(/([\-+]\d+)([dmwy])/g),/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(e))){for(e=new Date,l=0;l<a.length;l++)v=rt.exec(a[l]),k=parseInt(v[1]),d=ut[v[2]],e=f.prototype[d](e,k);return u(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())}a=e&&e.match(this.nonpunctuation)||[];e=new Date;var g={},it=["yyyy","yy","M","MM","m","mm","d","dd"],y={yyyy:function(n,t){return n.setUTCFullYear(c?et(t,c):t)},yy:function(n,t){return n.setUTCFullYear(c?et(t,c):t)},m:function(n,t){if(isNaN(n))return n;for(t-=1;t<0;)t+=12;for(t%=12,n.setUTCMonth(t);n.getUTCMonth()!==t;)n.setUTCDate(n.getUTCDate()-1);return n},d:function(n,t){return n.setUTCDate(t)}},w,nt;if(y.M=y.MM=y.mm=y.m,y.dd=y.d,e=h(),p=o.parts.slice(),a.length!==p.length&&(p=n(p).filter(function(t,i){return n.inArray(i,it)!==-1}).toArray()),a.length===p.length){for(l=0,st=p.length;l<st;l++){if(w=parseInt(a[l],10),v=p[l],isNaN(w))switch(v){case"MM":nt=n(r[s].months).filter(ot);w=n.inArray(nt[0],r[s].months)+1;break;case"M":nt=n(r[s].monthsShort).filter(ot);w=n.inArray(nt[0],r[s].monthsShort)+1}g[v]=w}for(l=0;l<it.length;l++)b=it[l],b in g&&!isNaN(g[b])&&(tt=new Date(e),y[b](tt,g[b]),isNaN(tt)||(e=tt))}return e},formatDate:function(t,u,f){var e,s,o,h;if(!t)return"";if(typeof u=="string"&&(u=i.parseFormat(u)),u.toDisplay)return u.toDisplay(t,u,f);for(e={d:t.getUTCDate(),D:r[f].daysShort[t.getUTCDay()],DD:r[f].days[t.getUTCDay()],m:t.getUTCMonth()+1,M:r[f].monthsShort[t.getUTCMonth()],MM:r[f].months[t.getUTCMonth()],yy:t.getUTCFullYear().toString().substring(2),yyyy:t.getUTCFullYear()},e.dd=(e.d<10?"0":"")+e.d,e.mm=(e.m<10?"0":"")+e.m,t=[],s=n.extend([],u.separators),o=0,h=u.parts.length;o<=h;o++)s.length&&t.push(s.shift()),t.push(e[u.parts[o]]);return t.join("")},headTemplate:'<thead><tr><th colspan="7" class="datepicker-title"><\/th><\/tr><tr><th class="prev">&laquo;<\/th><th colspan="5" class="datepicker-switch"><\/th><th class="next">&raquo;<\/th><\/tr><\/thead>',contTemplate:'<tbody><tr><td colspan="7"><\/td><\/tr><\/tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"><\/th><\/tr><tr><th colspan="7" class="clear"><\/th><\/tr><\/tfoot>'};i.template='<div class="cv_genform_dp datepicker"><div class="datepicker-days"><table class="table-condensed">'+i.headTemplate+"<tbody><\/tbody>"+i.footTemplate+'<\/table><\/div><div class="datepicker-months"><table class="table-condensed">'+i.headTemplate+i.contTemplate+i.footTemplate+'<\/table><\/div><div class="datepicker-years"><table class="table-condensed">'+i.headTemplate+i.contTemplate+i.footTemplate+'<\/table><\/div><div class="datepicker-decades"><table class="table-condensed">'+i.headTemplate+i.contTemplate+i.footTemplate+'<\/table><\/div><div class="datepicker-centuries"><table class="table-condensed">'+i.headTemplate+i.contTemplate+i.footTemplate+"<\/table><\/div><\/div>";n.fn.datepicker.DPGlobal=i;n.fn.datepicker.noConflict=function(){return n.fn.datepicker=a,this};n.fn.datepicker.version="1.6.4";n(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(t){var i=n(this);i.data("datepicker")||(t.preventDefault(),e.call(i,"show"))});n(function(){e.call(n('[data-provide="datepicker-inline"]'))})});
if(typeof $cvf=="undefined")throw new Error("Bootstrap's JavaScript requires jQuery");+function(n){"use strict";var t=n.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||t[0]==1&&t[1]==9&&t[2]<1||t[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4");}($cvf);+function(n){"use strict";function i(i,r){return this.each(function(){var f=n(this),u=f.data("bs.modal"),e=n.extend({},t.DEFAULTS,f.data(),typeof i=="object"&&i);u||f.data("bs.modal",u=new t(this,e));typeof i=="string"?u[i](r):e.show&&u.show(r)})}var t=function(t,i){this.options=i;this.$body=n(document.body);this.$element=n(t);this.$dialog=this.$element.find(".modal-dialog");this.$backdrop=null;this.isShown=null;this.originalBodyPad=null;this.scrollbarWidth=0;this.ignoreBackdropClick=!1;this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,n.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))},r;t.VERSION="3.3.7";t.TRANSITION_DURATION=300;t.BACKDROP_TRANSITION_DURATION=150;t.DEFAULTS={backdrop:!0,keyboard:!0,show:!0};t.prototype.toggle=function(n){return this.isShown?this.hide():this.show(n)};t.prototype.show=function(i){var r=this,u=n.Event("show.bs.modal",{relatedTarget:i});if(this.$element.trigger(u),!this.isShown&&!u.isDefaultPrevented()){this.isShown=!0;this.checkScrollbar();this.setScrollbar();this.$body.addClass("cv_genform_m modal-open");this.escape();this.resize();this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',n.proxy(this.hide,this));this.$dialog.on("mousedown.dismiss.bs.modal",function(){r.$element.one("mouseup.dismiss.bs.modal",function(t){n(t.target).is(r.$element)&&(r.ignoreBackdropClick=!0)})});this.backdrop(function(){var f=n.support.transition&&r.$element.hasClass("fade"),u;r.$element.parent().length||r.$element.appendTo(r.$body);r.$element.show().scrollTop(0);r.adjustDialog();f&&r.$element[0].offsetWidth;r.$element.addClass("in");r.enforceFocus();u=n.Event("shown.bs.modal",{relatedTarget:i});f?r.$dialog.one("bsTransitionEnd",function(){r.$element.trigger("focus").trigger(u)}).emulateTransitionEnd(t.TRANSITION_DURATION):r.$element.trigger("focus").trigger(u)})}};t.prototype.hide=function(i){(i&&i.preventDefault(),i=n.Event("hide.bs.modal"),this.$element.trigger(i),this.isShown&&!i.isDefaultPrevented())&&(this.isShown=!1,this.escape(),this.resize(),n(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),n.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",n.proxy(this.hideModal,this)).emulateTransitionEnd(t.TRANSITION_DURATION):this.hideModal())};t.prototype.enforceFocus=function(){n(document).off("focusin.bs.modal").on("focusin.bs.modal",n.proxy(function(n){document===n.target||this.$element[0]===n.target||this.$element.has(n.target).length||this.$element.trigger("focus")},this))};t.prototype.escape=function(){if(this.isShown&&this.options.keyboard)this.$element.on("keydown.dismiss.bs.modal",n.proxy(function(n){n.which==27&&this.hide()},this));else this.isShown||this.$element.off("keydown.dismiss.bs.modal")};t.prototype.resize=function(){if(this.isShown)n(window).on("resize.bs.modal",n.proxy(this.handleUpdate,this));else n(window).off("resize.bs.modal")};t.prototype.hideModal=function(){var n=this;this.$element.hide();this.backdrop(function(){n.$body.removeClass("modal-open");n.resetAdjustments();n.resetScrollbar();n.$element.trigger("hidden.bs.modal")})};t.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove();this.$backdrop=null};t.prototype.backdrop=function(i){var e=this,f=this.$element.hasClass("fade")?"fade":"",r,u;if(this.isShown&&this.options.backdrop){r=n.support.transition&&f;this.$backdrop=n(document.createElement("div")).addClass("cv_genform_mbd modal-backdrop "+f).appendTo(this.$body);this.$element.on("click.dismiss.bs.modal",n.proxy(function(n){if(this.ignoreBackdropClick){this.ignoreBackdropClick=!1;return}n.target===n.currentTarget&&(this.options.backdrop=="static"?this.$element[0].focus():this.hide())},this));if(r&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!i)return;r?this.$backdrop.one("bsTransitionEnd",i).emulateTransitionEnd(t.BACKDROP_TRANSITION_DURATION):i()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),u=function(){e.removeBackdrop();i&&i()},n.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",u).emulateTransitionEnd(t.BACKDROP_TRANSITION_DURATION):u()):i&&i()};t.prototype.handleUpdate=function(){this.adjustDialog()};t.prototype.adjustDialog=function(){var n=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&n?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!n?this.scrollbarWidth:""})};t.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})};t.prototype.checkScrollbar=function(){var n=window.innerWidth,t;n||(t=document.documentElement.getBoundingClientRect(),n=t.right-Math.abs(t.left));this.bodyIsOverflowing=document.body.clientWidth<n;this.scrollbarWidth=this.measureScrollbar()};t.prototype.setScrollbar=function(){var n=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"";this.bodyIsOverflowing&&this.$body.css("padding-right",n+this.scrollbarWidth)};t.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)};t.prototype.measureScrollbar=function(){var n=document.createElement("div"),t;return n.className="modal-scrollbar-measure",this.$body.append(n),t=n.offsetWidth-n.clientWidth,this.$body[0].removeChild(n),t};r=n.fn.modal;n.fn.modal=i;n.fn.modal.Constructor=t;n.fn.modal.noConflict=function(){return n.fn.modal=r,this};n(document).on("click.bs.modal.data-api",'.cv_genform_content [data-toggle="modal"]',function(t){var r=n(this),f=r.attr("href"),u=n(r.attr("data-target")||f&&f.replace(/.*(?=#[^\s]+$)/,"")),e=u.data("bs.modal")?"toggle":n.extend({remote:!/#/.test(f)&&f},u.data(),r.data());r.is("a")&&t.preventDefault();u.one("show.bs.modal",function(n){if(!n.isDefaultPrevented())u.one("hidden.bs.modal",function(){r.is(":visible")&&r.trigger("focus")})});i.call(u,e,this)})}($cvf);
if(typeof $cvf=="undefined")throw new Error("Bootstrap's JavaScript requires jQuery");+function(n){"use strict";var t=n.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||t[0]==1&&t[1]==9&&t[2]<1||t[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4");}($cvf);+function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.button"),f=typeof i=="object"&&i;r||u.data("bs.button",r=new t(this,f));i=="toggle"?r.toggle():i&&r.setState(i)})}var t=function(i,r){this.$element=n(i);this.options=n.extend({},t.DEFAULTS,r);this.isLoading=!1},r;t.VERSION="3.3.7";t.DEFAULTS={loadingText:"loading..."};t.prototype.setState=function(t){var i="disabled",r=this.$element,f=r.is("input")?"val":"html",u=r.data();t+="Text";u.resetText==null&&r.data("resetText",r[f]());setTimeout(n.proxy(function(){r[f](u[t]==null?this.options[t]:u[t]);t=="loadingText"?(this.isLoading=!0,r.addClass(i).attr(i,i).prop(i,!0)):this.isLoading&&(this.isLoading=!1,r.removeClass(i).removeAttr(i).prop(i,!1))},this),0)};t.prototype.toggle=function(){var t=!0,i=this.$element.closest('[data-toggle="buttons"]'),n;i.length?(n=this.$element.find("input"),n.prop("type")=="radio"?(n.prop("checked")&&(t=!1),i.find(".active").removeClass("active"),this.$element.addClass("active")):n.prop("type")=="checkbox"&&(n.prop("checked")!==this.$element.hasClass("active")&&(t=!1),this.$element.toggleClass("active")),n.prop("checked",this.$element.hasClass("active")),t&&n.trigger("change")):(this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active"))};r=n.fn.button;n.fn.button=i;n.fn.button.Constructor=t;n.fn.button.noConflict=function(){return n.fn.button=r,this};n(document).on("click.bs.button.data-api",'.cv_genform_content [data-toggle^="button"]',function(t){var r=n(t.target).closest(".btn");i.call(r,"toggle");n(t.target).is('input[type="radio"], input[type="checkbox"]')||(t.preventDefault(),r.is("input,button")?r.trigger("focus"):r.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'.cv_genform_content [data-toggle^="button"]',function(t){n(t.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(t.type))})}($cvf);
+function(n){"use strict";function r(i){return this.each(function(){var u=n(this),r=u.data("bs.tooltip"),f=typeof i=="object"&&i;(r||!/destroy|hide/.test(i))&&(r||u.data("bs.tooltip",r=new t(this,f)),typeof i=="string"&&r[i]())})}var t=function(n,t){this.type=null;this.options=null;this.enabled=null;this.timeout=null;this.hoverState=null;this.$element=null;this.inState=null;this.init("tooltip",n,t)},i;t.VERSION="3.3.7";t.TRANSITION_DURATION=150;t.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"><\/div><div class="tooltip-inner"><\/div><\/div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}};t.prototype.init=function(t,i,r){var f,e,u,o,s;if(this.enabled=!0,this.type=t,this.$element=n(i),this.options=this.getOptions(r),this.$viewport=this.options.viewport&&n(n.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(f=this.options.trigger.split(" "),e=f.length;e--;)if(u=f[e],u=="click")this.$element.on("click."+this.type,this.options.selector,n.proxy(this.toggle,this));else if(u!="manual"){o=u=="hover"?"mouseenter":"focusin";s=u=="hover"?"mouseleave":"focusout";this.$element.on(o+"."+this.type,this.options.selector,n.proxy(this.enter,this));this.$element.on(s+"."+this.type,this.options.selector,n.proxy(this.leave,this))}this.options.selector?this._options=n.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()};t.prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.getOptions=function(t){return t=n.extend({},this.getDefaults(),this.$element.data(),t),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t};t.prototype.getDelegateOptions=function(){var t={},i=this.getDefaults();return this._options&&n.each(this._options,function(n,r){i[n]!=r&&(t[n]=r)}),t};t.prototype.enter=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget).data("bs."+this.type);if(i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)),t instanceof n.Event&&(i.inState[t.type=="focusin"?"focus":"hover"]=!0),i.tip().hasClass("in")||i.hoverState=="in"){i.hoverState="in";return}if(clearTimeout(i.timeout),i.hoverState="in",!i.options.delay||!i.options.delay.show)return i.show();i.timeout=setTimeout(function(){i.hoverState=="in"&&i.show()},i.options.delay.show)};t.prototype.isInStateTrue=function(){for(var n in this.inState)if(this.inState[n])return!0;return!1};t.prototype.leave=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget).data("bs."+this.type);if(i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)),t instanceof n.Event&&(i.inState[t.type=="focusout"?"focus":"hover"]=!1),!i.isInStateTrue()){if(clearTimeout(i.timeout),i.hoverState="out",!i.options.delay||!i.options.delay.hide)return i.hide();i.timeout=setTimeout(function(){i.hoverState=="out"&&i.hide()},i.options.delay.hide)}};t.prototype.show=function(){var c=n.Event("show.bs."+this.type),l,p,e,w,h;if(this.hasContent()&&this.enabled){if(this.$element.trigger(c),l=n.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]),c.isDefaultPrevented()||!l)return;var u=this,r=this.tip(),a=this.getUID(this.type);this.setContent();r.attr("id",a);this.$element.attr("aria-describedby",a);this.options.animation&&r.addClass("fade");var i=typeof this.options.placement=="function"?this.options.placement.call(this,r[0],this.$element[0]):this.options.placement,v=/\s?auto?\s?/i,y=v.test(i);y&&(i=i.replace(v,"")||"top");r.detach().css({top:0,left:0,display:"block"}).addClass(i).data("bs."+this.type,this);this.options.container?r.appendTo(this.options.container):r.insertAfter(this.$element);this.$element.trigger("inserted.bs."+this.type);var f=this.getPosition(),o=r[0].offsetWidth,s=r[0].offsetHeight;y&&(p=i,e=this.getPosition(this.$viewport),i=i=="bottom"&&f.bottom+s>e.bottom?"top":i=="top"&&f.top-s<e.top?"bottom":i=="right"&&f.right+o>e.width?"left":i=="left"&&f.left-o<e.left?"right":i,r.removeClass(p).addClass(i));w=this.getCalculatedOffset(i,f,o,s);this.applyPlacement(w,i);h=function(){var n=u.hoverState;u.$element.trigger("shown.bs."+u.type);u.hoverState=null;n=="out"&&u.leave(u)};n.support.transition&&this.$tip.hasClass("fade")?r.one("bsTransitionEnd",h).emulateTransitionEnd(t.TRANSITION_DURATION):h()}};t.prototype.applyPlacement=function(t,i){var r=this.tip(),l=r[0].offsetWidth,e=r[0].offsetHeight,o=parseInt(r.css("margin-top"),10),s=parseInt(r.css("margin-left"),10),h,f,u;isNaN(o)&&(o=0);isNaN(s)&&(s=0);t.top+=o;t.left+=s;n.offset.setOffset(r[0],n.extend({using:function(n){r.css({top:Math.round(n.top),left:Math.round(n.left)})}},t),0);r.addClass("in");h=r[0].offsetWidth;f=r[0].offsetHeight;i=="top"&&f!=e&&(t.top=t.top+e-f);u=this.getViewportAdjustedDelta(i,t,h,f);u.left?t.left+=u.left:t.top+=u.top;var c=/top|bottom/.test(i),a=c?u.left*2-l+h:u.top*2-e+f,v=c?"offsetWidth":"offsetHeight";r.offset(t);this.replaceArrow(a,r[0][v],c)};t.prototype.replaceArrow=function(n,t,i){this.arrow().css(i?"left":"top",50*(1-n/t)+"%").css(i?"top":"left","")};t.prototype.setContent=function(){var n=this.tip(),t=this.getTitle();n.find(".tooltip-inner")[this.options.html?"html":"text"](t);n.removeClass("fade in top bottom left right")};t.prototype.hide=function(i){function e(){r.hoverState!="in"&&u.detach();r.$element&&r.$element.removeAttr("aria-describedby").trigger("hidden.bs."+r.type);i&&i()}var r=this,u=n(this.$tip),f=n.Event("hide.bs."+this.type);if(this.$element.trigger(f),!f.isDefaultPrevented())return u.removeClass("in"),n.support.transition&&u.hasClass("fade")?u.one("bsTransitionEnd",e).emulateTransitionEnd(t.TRANSITION_DURATION):e(),this.hoverState=null,this};t.prototype.fixTitle=function(){var n=this.$element;(n.attr("title")||typeof n.attr("data-original-title")!="string")&&n.attr("data-original-title",n.attr("title")||"").attr("title","")};t.prototype.hasContent=function(){return this.getTitle()};t.prototype.getPosition=function(t){t=t||this.$element;var r=t[0],u=r.tagName=="BODY",i=r.getBoundingClientRect();i.width==null&&(i=n.extend({},i,{width:i.right-i.left,height:i.bottom-i.top}));var f=window.SVGElement&&r instanceof window.SVGElement,e=u?{top:0,left:0}:f?null:t.offset(),o={scroll:u?document.documentElement.scrollTop||document.body.scrollTop:t.scrollTop()},s=u?{width:n(window).width(),height:n(window).height()}:null;return n.extend({},i,o,s,e)};t.prototype.getCalculatedOffset=function(n,t,i,r){return n=="bottom"?{top:t.top+t.height,left:t.left+t.width/2-i/2}:n=="top"?{top:t.top-r,left:t.left+t.width/2-i/2}:n=="left"?{top:t.top+t.height/2-r/2,left:t.left-i}:{top:t.top+t.height/2-r/2,left:t.left+t.width}};t.prototype.getViewportAdjustedDelta=function(n,t,i,r){var f={top:0,left:0},e,u,o,s,h,c;return this.$viewport?(e=this.options.viewport&&this.options.viewport.padding||0,u=this.getPosition(this.$viewport),/right|left/.test(n)?(o=t.top-e-u.scroll,s=t.top+e-u.scroll+r,o<u.top?f.top=u.top-o:s>u.top+u.height&&(f.top=u.top+u.height-s)):(h=t.left-e,c=t.left+e+i,h<u.left?f.left=u.left-h:c>u.right&&(f.left=u.left+u.width-c)),f):f};t.prototype.getTitle=function(){var t=this.$element,n=this.options;return t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title)};t.prototype.getUID=function(n){do n+=~~(Math.random()*1e6);while(document.getElementById(n));return n};t.prototype.tip=function(){if(!this.$tip&&(this.$tip=n(this.options.template),this.$tip.length!=1))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")};t.prototype.enable=function(){this.enabled=!0};t.prototype.disable=function(){this.enabled=!1};t.prototype.toggleEnabled=function(){this.enabled=!this.enabled};t.prototype.toggle=function(t){var i=this;t&&(i=n(t.currentTarget).data("bs."+this.type),i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)));t?(i.inState.click=!i.inState.click,i.isInStateTrue()?i.enter(i):i.leave(i)):i.tip().hasClass("in")?i.leave(i):i.enter(i)};t.prototype.destroy=function(){var n=this;clearTimeout(this.timeout);this.hide(function(){n.$element.off("."+n.type).removeData("bs."+n.type);n.$tip&&n.$tip.detach();n.$tip=null;n.$arrow=null;n.$viewport=null;n.$element=null})};i=n.fn.tooltip;n.fn.tooltip=r;n.fn.tooltip.Constructor=t;n.fn.tooltip.noConflict=function(){return n.fn.tooltip=i,this}}($cvf);
if(typeof $cvf=="undefined")throw new Error("Bootstrap's JavaScript requires jQuery");+function(n){"use strict";var t=n.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||t[0]==1&&t[1]==9&&t[2]<1||t[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4");}($cvf);+function(n){"use strict";function r(i){return this.each(function(){var u=n(this),r=u.data("bs.popover"),f=typeof i=="object"&&i;(r||!/destroy|hide/.test(i))&&(r||u.data("bs.popover",r=new t(this,f)),typeof i=="string"&&r[i]())})}var t=function(n,t){this.init("popover",n,t)},i;if(!n.fn.tooltip)throw new Error("Popover requires tooltip.js");t.VERSION="3.3.7";t.DEFAULTS=n.extend({},n.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="cv_genform_po popover" role="tooltip"><div class="arrow"><\/div><h3 class="popover-title"><\/h3><div class="popover-content"><\/div><\/div>'});t.prototype=n.extend({},n.fn.tooltip.Constructor.prototype);t.prototype.constructor=t;t.prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.setContent=function(){var n=this.tip(),i=this.getTitle(),t=this.getContent();n.find(".popover-title")[this.options.html?"html":"text"](i);n.find(".popover-content").children().detach().end()[this.options.html?typeof t=="string"?"html":"append":"text"](t);n.removeClass("fade top bottom left right in");n.find(".popover-title").html()||n.find(".popover-title").hide()};t.prototype.hasContent=function(){return this.getTitle()||this.getContent()};t.prototype.getContent=function(){var t=this.$element,n=this.options;return t.attr("data-content")||(typeof n.content=="function"?n.content.call(t[0]):n.content)};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};i=n.fn.popover;n.fn.popover=r;n.fn.popover.Constructor=t;n.fn.popover.noConflict=function(){return n.fn.popover=i,this}}($cvf);
function ReCaptchaCallback(){var n=$cvf($cvf("#"+CVF.Target+" div.g-recaptcha")[0]);grecaptcha.render(n.attr("id"),{sitekey:n.attr("data-sitekey"),callback:reCaptchaVerify,"expired-callback":reCaptchaExpired})}function reCaptchaVerify(n){var i=grecaptcha.getResponse(),t;n===i&&(t=$cvf($cvf("#"+CVF.Target+" div.g-recaptcha")[0]),t.attr("data-g-recaptcha-resp",i).attr("data-g-recaptcha-valid",!0),t.children().removeClass("has-error"),t.find(".error-message").remove())}function reCaptchaExpired(){$cvf($cvf("#"+CVF.Target+" div.g-recaptcha")[0]).attr("data-g-recaptcha-resp","").attr("data-g-recaptcha-valid",!1)}function initAutocomplete(){var n=$cvf("#"+CVF.Target+" [data-applyplugin='googleaddresslookup']"),t,u,i,f,r;if(n.length<1){CVFR.GoogleAutocomplete=null;return}for(CVFR.GoogleAutocomplete=[],t=0;t<n.length;t++)u=$cvf(n[t]).attr("id"),i=new google.maps.places.Autocomplete(document.getElementById(u)),i.targetId=u,i.addListener("place_changed",CVFR.GoogleFillInAddress),CVFR.GoogleAutocomplete.push(i);for(f=!1,r=0;r<n.length;r++)if($cvf(n[r]).attr("data-togglegeoloate")==="true"){f=!0;break}f&&CVFR.Geolocate()}var CVFR={VortexURI:"http://localhost:58754",IsDesignMode:!1,IsTestRun:!1,IsSubmitEnabled:!0,ProcessToGateway:!0,CurrentWizardStep:0,Tracker:null,IsDirectDebitVerification:!1,IsDirectDebitVerificationActive:null,MonthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],PopoverTimeout:null,AmplySearchTimer:null,GoogleAutocomplete:null,SkipPaymentStep:!1,EventDescriptionBreakLength:240,PayPalToken:null,IsPayPalRecurring:!1,PayPalDetail:null,HasPayPalAttribute:!1,Init:function(n){var t,i,r;CVFR.VortexURI=n;CVFR.SetupDeepthought();t="#"+CVF.Target;CVFR.AttachRadioButtonEvents(t);i=$cvf(t+" [data-VsTargetGroup]");$cvf.each(i,CVFR.ActVisibilityTrigger);i.change(CVFR.ActVisibilityTrigger);$cvf("#cvf_submit, #cvf_submit_confirm").click(CVFR.Submit);r=$cvf(t+" select[data-relatedcontrol]:not([data-relatedcontrol=''])");r.change(CVFR.RelatedDropdownChange);$cvf.each(r,CVFR.RelatedDropdownChange);$cvf(t+" input[type='text'][data-relatedcontrol]:not([data-applyplugin='expirydate'])").change(CVFR.RelatedInputTextChange);$cvf(t+" .actWizardSwitchStep").click(CVFR.OpenWizardStep);$cvf(t+" .wzstepsinfonpanel ul li").click(CVFR.OpenWizardStep).on("mouseover",function(){$cvf(this).addClass("hoveritem")}).on("mouseout",function(){$cvf(this).removeClass("hoveritem")});CVFR.ApplyPlugins(t);CVFR.ApplyDesignContext();CVFR.RuntimeValueOverride();CVFR.IsPayPalEnabled();$cvf(t+" .control-validate").change(CVFR.ValidateControl);$cvf(t+" [data-applyplugin='fundselect']").trigger("change");CVFR.TestModeNotify();CVFR.ShowForm(t)},ApplyPlugins:function(n){CVFR.InitDatepicker(n+" [data-applyplugin='datepicker']");CVFR.ApplyPopovers(n);CVFR.ApplyCreditCardPlugin(n);CVFR.ApplyExpiryDatePlugin(n);CVFR.ApplyAppealSelectPlugin(n);CVFR.ApplyFundSelectPlugin(n);CVFR.ApplyProcessingFeePlugin(n,!1);CVFR.ApplyDirectDebitPaymentTypePlugin(n);CVFR.ApplyDirectDebitStartDatePlugin(n);CVFR.ApplySortCodePlugin(n);CVFR.ApplyDataListSwapPlugin(n);CVFR.ApplyAmplyCompaniesSearchPlugin(n);CVFR.ApplyRecaptchaAmountThresholdPlugin(n);CVFR.ApplyMerchantAccountOverridePlugin(n);CVFR.ApplyGoogleAddressLookupPlugin(n);CVFR.DirectDebitPaymentTypeChange($cvf(n+" [data-applyplugin='directdebitselect']"));CVFR.SetupEventForm(n)},IsPayPalEnabled:function(){for(var t,n=0;n<CVF.Model.Attributes.Variables.length;n++)t=CVF.Model.Attributes.Variables[n],CVF.HasVal(t,"DataField")&&t.DataField==="PPENABLED"&&(CVFR.PayPalToken||(CVFR.HasPayPalAttribute=CVF.Model.Attributes.Variables[n].CValue==="true"))},IsPayPalDonation:function(){return CVFR.HasPayPalAttribute&&$cvf("[data-field='cv_paymentType']").val()==="4"&&CVFR.PayPalToken==null},HasPayPalToken:function(n){return CVF.HasVal(n,"payerid")&&CVF.HasVal(n,"token")||CVF.HasVal(n,"ba_token")},MapPayPalToken:function(n){CVF.HasVal(n,"ba_token")?(CVFR.PayPalToken=n.ba_token,CVFR.IsPayPalRecurring=!0):CVF.HasVal(n,"token")&&(CVFR.PayPalToken=n.token)},BuildPayPalPayload:function(n){if(n.cv_paypal_token=CVFR.PayPalToken,n.cv_isOrg=!1,CVFR.IsPayPalRecurring){n.cv_donationRecurring=!0;var t=CVFR.PayPalDetail.donation_profile,i=new Date(t.BD);n.cv_donationAmount=t.AMT;n.cv_donationStartDate=i.toISOString();n.cv_donationFrequency=t.FRQ;n.cv_donorAddress_addr_line1=CVFR.PayPalDetail.shipping_address.line1;n.cv_donorAddress_city=CVFR.PayPalDetail.shipping_address.city;n.cv_donorAddress_country=CVFR.PayPalDetail.shipping_address.country_code;n.cv_donorAddress_postal=CVFR.PayPalDetail.shipping_address.postal_code;n.cv_donorAddress_state=CVFR.PayPalDetail.shipping_address.state;n.cv_donorEmail=CVFR.PayPalDetail.payer.payer_info.email;n.cv_donorName_first=CVFR.PayPalDetail.payer.payer_info.first_name;n.cv_donorName_last=CVFR.PayPalDetail.payer.payer_info.last_name;CVFR.PayPalDetail.payer.payer_info.phone!=null&&(n.cv_donorPhone=CVFR.PayPalDetail.payer.payer_info.phone)}else n.cv_donationAmount=CVFR.PayPalDetail.purchase_units[0].amount.value,n.cv_donorAddress_addr_line1=CVFR.PayPalDetail.purchase_units[0].shipping.address.address_line_1,n.cv_donorAddress_city=CVFR.PayPalDetail.purchase_units[0].shipping.address.admin_area_2,n.cv_donorAddress_country=CVFR.PayPalDetail.purchase_units[0].shipping.address.country_code,n.cv_donorAddress_postal=CVFR.PayPalDetail.purchase_units[0].shipping.address.postal_code,n.cv_donorAddress_state=CVFR.PayPalDetail.purchase_units[0].shipping.address.admin_area_1,n.cv_donorEmail=CVFR.PayPalDetail.payer.email_address,n.cv_donorName_first=CVFR.PayPalDetail.payer.name.given_name,n.cv_donorName_last=CVFR.PayPalDetail.payer.name.surname,CVFR.PayPalDetail.payer.phone!=null&&(n.cv_donorPhone=CVFR.PayPalDetail.payer.phone.phone_number);return n},SetupDeepthought:function(){if(!CVF.IsInDesignMode()&&CVFR.Tracker===null&&typeof DeepThought!="undefined"){CVFR.Tracker=new DeepThought(CVFR.VortexURI,null,null,CVF.AccountID);CVFR.Tracker.setup(DTFeatures.ImpactForms);var n={formId:CVF.FormID,isWizardMode:CVF.IsWizardMode,isTestMode:CVFR.IsTestRun};CVFR.AddDTEvent(DTEventCategory.Load,n)}},AddDTEvent:function(n,t){if(CVFR.IsDTEnabled()){var i=new DTEvent(n,t);CVFR.Tracker.add(i)}},SendDTEvents:function(){CVFR.IsDTEnabled()&&CVFR.Tracker.sendEvents()},AttachRadioButtonEvents:function(n){$cvf(n+" .btn-group label input").change(CVFR.RadioGroupChange);$cvf(n+" .btn-group label").click(CVFR.RadioGroupChange)},ApplyCreditCardPlugin:function(n){var t=$cvf(n+" [data-applyplugin='ccnumbertxt']");t.on("keyup input",CVFR.FormatCreditCardNumber).addClass("ccnumbertxt");$cvf.each(t,function(n,t){var i=$cvf(t).parent();i.find("span.ccnumbertxt").remove();i.append("<span class='ccnumbertxt'><\/span>")})},ApplyExpiryDatePlugin:function(n){var t=$cvf(n+" [data-applyplugin='expirydate']");t.on("keyup input",CVFR.FormatExpiryDate).addClass("expirydate");$cvf.each(t,function(n,i){var r=$cvf(i),u=r.parent(),f="<input type='hidden' data-field='"+r.attr("data-field")+"'  data-cvcontrol='Hidden' data-refname='"+i.id+"' value='' autocomplete='off'>";t.removeAttr("data-field");t.attr("data-relatedcontrol",i.id);u.append(f)})},ApplyFundSelectPlugin:function(n){CVFR.ApplyDynamicAllocationChangePlugin(n,"fundselect","cv_alloc_fund")},ApplyAppealSelectPlugin:function(n){CVFR.ApplyDynamicAllocationChangePlugin(n,"appealselect","cv_alloc_campaign")},ApplyDynamicAllocationChangePlugin:function(n,t,i){var r=$cvf(n+" [data-applyplugin='"+t+"']");r.length>0&&(t=="appealselect"||t=="fundselect")&&$cvf("input[type='hidden'][data-field='cv_allocation'][data-fieldprop='"+i+"'][data-fieldindex='0']").val(r.val());r.change(function(){var n=$cvf(this).val();$cvf("input[type='hidden'][data-field='cv_allocation'][data-fieldprop='"+i+"'][data-fieldindex='0']").val(n)})},ApplyProcessingFeePlugin:function(n,t){var r,e,i;t===undefined&&(t=!1);var f=$cvf(n+" [data-applyplugin='processingfee']"),o=f.closest("div").prop("id"),u=CVF.FindControlInModel(o);if(CVFUTL.IsInitialized(u)&&CVF.HasVal(u,"PluginValue")&&!(u.PluginValue<=0)){if(f.off("click",CVFR.CalculateProcessingFee),f.on("click",CVFR.CalculateProcessingFee).attr("data-plugin-value",u.PluginValue),r=$cvf(n+" input[data-field='cv_donationAmount']"),r.attr("data-has-processing-fee",!0),e=r.attr("data-refname"),i=null,CVFUTL.HasContent(e)&&(i=$cvf("[data-relatedcontrol='"+e+"']")),i!==null&&i.length>0){i.off("change",CVFR.CalculateProcessingFee);i.on("change",CVFR.CalculateProcessingFee)}else{r.off("change",CVFR.CalculateProcessingFee);r.on("change",CVFR.CalculateProcessingFee)}t===!0&&CVFR.CalculateProcessingFee()}},ApplyPopovers:function(n){if(CVFR.IsDesignMode!==!0){$cvf("body").on("hidden.bs.popover",function(n){$cvf(n.target).data("bs.popover").inState.click=!1});$cvf(n+" [data-toggle='popover']").popover({container:"body",trigger:"click hover"}).click(function(){clearTimeout(CVFR.PopoverTimeout);var n=$cvf(this);CVFR.PopoverTimeout=setTimeout(function(){n.popover("hide")},3500)})}},ApplyDirectDebitPaymentTypePlugin:function(n){CVFR.HideDirectDebitPaymentType();var t=$cvf(n+" [data-applyplugin='directdebitselect']");$cvf("#cvf_submit").attr("data-originaltitle",$cvf("#cvf_submit").text());t.change(function(){CVFR.DirectDebitPaymentTypeChange(this)});CVFR.ResolveUKDirectDebitRecurringChange();$cvf("[data-field='cv_donationRecurring']").change(CVFR.ResolveUKDirectDebitRecurringChange)},DirectDebitPaymentTypeChange:function(n){!CVFUTL.IsInitialized(n)||n.length<1||(CVFR.IsDirectDebitVerification=$cvf(n).val()=="3",CVFR.SetUKDirectDebitSubmitTitle(),CVFR.AddUKDirectDebitHiddenFields())},ResolveUKDirectDebitRecurringChange:function(){var r=!1,u=$cvf("[data-field='cv_donationRecurring']"),t,n,i;u.attr("type")==="checkbox"?r=u.is(":checked"):(t=u.val(),CVFUTL.HasContent(t)&&(r=t.toLowerCase()==="true"||t==="1"));r?(n=$cvf("select[data-applyplugin='directdebitselect']"),i=CVF.FindControlInModel(n.attr("data-id")),CVFUTL.IsInitialized(i)&&(n.html(CVF.BuildOptionListFromDataList(i)),CVFUTL.HasContent(i.CValue)||CVFR.RuntimeValueChange("paymenttype","3"),CVFR.ActVisibilityTrigger(0,n),n.change())):CVFR.HideDirectDebitPaymentType()},AddUKDirectDebitHiddenFields:function(){if($cvf("#"+CVF.Target+" .directdebithiddenfields").remove(),CVFR.IsDirectDebitVerification!==!1){var n="<div class='directdebithiddenfields'><input type='hidden' data-field='cv_gatewayBureauProfileID' value=''>";n+="<input type='hidden' data-field='cv_bankName' value=''>";n+="<input type='hidden' data-field='cv_bankBranch' value=''>";n+="<input type='hidden' data-field='cv_bankAddress' value=''>";n+="<input type='hidden' data-field='cv_bankAddress_city' value=''>";n+="<input type='hidden' data-field='cv_bankAddress_postal' value=''>";n+="<input type='hidden' data-field='cv_bankAddress_state' value=''><\/div>";$cvf("#"+CVF.Target).append(n)}},SetUKDirectDebitSubmitTitle:function(){var n=$cvf("#cvf_submit"),t=n.attr("data-originaltitle");CVFR.IsDirectDebitVerification===!0?n.text("Verify"):n.text(t)},ApplyDirectDebitStartDatePlugin:function(n){$cvf(n+" [data-applyplugin='ukddstartdate']").each(function(n,t){CVFR.RebindDirectDebitStartDate(t)})},RebindDirectDebitStartDate:function(n){var i=new Date,f,e,t;n=$cvf(n);var r=n.attr("data-ukddstartoffset"),h=n.attr("data-ukddinclude"),c=n.attr("data-ukddexclude");r=CVFUTL.HasContent(r)?parseInt(r):12;i.setDate(i.getDate()+r);var o=CVFR.ParseStringToNumber(h),s=CVFR.ParseStringToNumber(c),u=new Date(i);for(u.setDate(u.getDate()-1),f={autoclose:!0,todayHighlight:!1,showButtonPanel:!1,disableTouchKeyboard:!0,startDate:u,endDate:"",format:{toDisplay:function(n){var t=new Date;return n.getUTCFullYear()===t.getFullYear()&&n.getUTCMonth()===t.getMonth()&&n.getUTCDate()===t.getDate()&&(n.setUTCHours(t.getHours()),n.setUTCMinutes(t.getMinutes()),n.setUTCSeconds(t.getSeconds()),n.setUTCMilliseconds(t.getMilliseconds())),CVFR.FormatDateForDisplay(n)},toValue:function(n){return n}},minDate:u,cvAvaliableDays:o,cvExcludeDays:s,beforeShowDay:CVFR.CheckUKDDStartDateAvailability},e=parseInt(n.attr("data-maxdateindays")),f.endDate=isNaN(e)?"":new Date((new Date).setDate((new Date).getDate()+e)),$cvf(n).datepicker(f),t=new Date(i);CVFR.IsDateAvailableForPattern(t,i,o,s)===!1;)t.setDate(t.getDate()+1);$cvf(n).datepicker("setDate",t).datepicker("option","defaultDate",t);$cvf("button.btn-datepicker[data-for='"+n.attr("id")+"']").off("click").click(function(){$cvf("#"+$cvf(this).attr("data-for")).datepicker("show")})},ParseStringToNumber:function(n){var u=[],i,t,r;if(CVFUTL.HasContent(n))for(i=n.split(","),t=0;t<i.length;t++)r=Number(i[t]),isNaN(r)||u.push(r);return u},IsDateAvailableForPattern:function(n,t,i,r){var f=n.getDate(),u;return n<t?!1:(u=!0,i.length>0&&(u=!1,$cvf.each(i,function(n,t){if(f==t)return u=!0,!1}),u===!1))?!1:($cvf.each(r,function(n,t){if(f==t)return u=!1,!1}),u)},CheckUKDDStartDateAvailability:function(n){var r=n||new Date,t=$cvf(this),i=t[0].minDate||i(),u=t[0].cvAvaliableDays||[],f=t[0].cvExcludeDays||[];return CVFR.IsDateAvailableForPattern(r,i,u,f)},HideDirectDebitPaymentType:function(){CVFR.IsDirectDebitVerificationActive=!1;var n=$cvf("select[data-applyplugin='directdebitselect'] option[value!='3']").first().attr("value");$cvf("select[data-applyplugin='directdebitselect']").val(n).change();$cvf("select[data-applyplugin='directdebitselect'] option[value='3']").remove();$cvf("#"+CVF.Target+" .directdebithiddenfields, #"+CVF.Target+" #directdebitcheck-result").remove()},ApplySortCodePlugin:function(n){var t=$cvf(n+" [data-applyplugin='ukdebitsortcode']");t.on("keyup input",CVFR.FormatUKDirectDebitSortCode)},ApplyDataListSwapPlugin:function(n){for(var t,r,u=$cvf(n+" [data-applyplugin='datalistswap']"),i=0;i<u.length;i++)t=$cvf(u[i]),r=$cvf("[data-refname='"+t.attr("data-ctrlrefname")+"']"),r.change(function(){CVFR.DataListSwapPluginChange(this,t.attr("data-togglegroupcid"),t.attr("data-swaponvalue"),t.attr("data-swaplistid"))}),r.trigger("change")},DataListSwapPluginChange:function(n,t,i,r){var f,e,s,u,o;(n=$cvf(n),f=CVF.FindDataList(r),!CVFUTL.IsInitialized(f)||f.Items.length<1)||(e=n.val(),n.attr("type")==="checkbox"&&(e=n.prop("checked").toString()),s=$cvf("#"+t),u=CVF.FindControlInModel(t),u.ItemListID=i==e?r:u.OrgItemListID,CVF.Render_ToggleButtonGroup(u),s.replaceWith(CVF.B),CVF.B="",o="#"+CVF.Target,CVFR.AttachRadioButtonEvents(o),CVFR.ApplyProcessingFeePlugin(o,!0))},ApplyAmplyCompaniesSearchPlugin:function(n){var f=$cvf(n+" [data-applyplugin='amplycompanies']"),r,o,s,h,a,i,t,c;if(!(f.length<1))for(r=0;r<f.length;r++){var u=$cvf(f[r]),l=$cvf(u.parent()),v=f[r].id,e="<input type='hidden' data-field='cv_amplyCompanyID'  data-cvcontrol='Hidden' data-refname='"+v+"' value='' autocomplete='off'>";for(e+="<input type='hidden' data-field='cv_amplyCompanyName'  data-cvcontrol='Hidden' value='' autocomplete='off'>",e+="<input type='hidden' data-field='cv_amplyMatchedAmount'  data-cvcontrol='Hidden' value='' autocomplete='off' data-ignore='true'>",e+="<ul class='srch-items'><li value='-1' class='placeholder'>Please enter a company to search...<\/li><\/ul>",o=[],s=0;s<CVF.Model.Attributes.Variables.length;s++)h=CVF.Model.Attributes.Variables[s],CVF.HasVal(h,"DataField")&&h.DataField==="cv_allocation"&&o.push(h);for(CVF.B="",a=0,i=0;i<o.length;i++)t=o[i],c={DataField:"cv_amply_allocation",DataFieldIndex:a,DataFieldProp:t.DataFieldProp.replace("cv_alloc","cv_amply_alloc")},CVF.HasVal(t,"CValue")&&(c.CValue=t.CValue),CVF.HasVal(t,"EvalFunction")&&(c.EvalFunction=t.EvalFunction==="AMOUNTPRC"?"AMPLYAMOUNTPRC":t.EvalFunction),CVF.Render_Hidden(c),i>0&&i%5==0&&a++;$cvf("#"+CVF.Target).append(CVF.B);CVF.B="";u.removeAttr("data-field");u.attr("data-relatedcontrol",v);u.parent().append(e);u.focus(function(){l.find("ul").addClass("active")}).focusout(function(n){n.stopPropagation();l.find("ul").removeClass("active")}).on("keyup",function(n){var t=this;clearTimeout(CVFR.AmplySearchTimer);CVFR.AmplySearchTimer=setTimeout(function(){CVFR.AmplyCompanySearchChange(n,l,t)},750)}).on("keydown",function(){clearTimeout(CVFR.AmplySearchTimer)})}},AmplyCompanySearchChange:function(n,t,i){var u,r,f;if(i=i||this,t=$cvf(t),u=$cvf(i).val(),r=t.find("ul"),u.length<3){CVFR.AmplyCompaniesPopulateList(t,r,[]);return}r.addClass("active");r.html("<li value='-1' class='placeholder'>Searching companies...<\/li>");f={name:u,aid:CVF.AccountID};$cvf.ajax({url:CVF.DataSourceURL+"Form/AmplySearchCompanies",type:"post",timeout:5e3,data:f,success:function(n){CVFR.AmplyCompaniesPopulateList(t,r,n)},error:function(n,i,u){console.error(u);CVFR.AddDTEvent(DTEventCategory.Error,u);CVFR.AmplyCompaniesPopulateList(t,r,[])}})},AmplyCompaniesPopulateList:function(n,t,i){var e=n.find("input[data-applyplugin='amplycompanies']"),o=n.find("input[data-field='cv_amplyCompanyName']"),s=e.attr("data-relatedcontrol"),f,r,u;if(i.length<1){t.html("<li value='-1' class='placeholder'>No companies found.<\/li>");CVFR.RuntimeValueChange(s,-1);$cvf(o).val("");return}for(f="",r=0;r<i.length;r++)u=i[r],f+="<li value='"+u.company_id+"' data-ratio='"+u.company.ratio+"'>"+u.name+"<\/li>";t.html(f);t.find("li").on("mousedown",function(n){n.preventDefault()}).click(function(){var n=$cvf(this)[0],u=$cvf(n).val(),f=parseFloat($cvf(n).attr("data-ratio")),i,r;e.val(CVF.UnEscapeContent(n.innerHTML)).blur();CVFR.RuntimeValueChange(s,u);$cvf(o).val(CVF.UnEscapeContent(n.innerHTML));t.removeClass("active");i=CVFR.GetDonationAmount();r=i*f;$cvf("input[data-field='cv_amplyMatchedAmount']").val(r)})},ApplyRecaptchaAmountThresholdPlugin:function(n){for(var t,r,u=$cvf(n+" [data-applyplugin='recaptchathreshold']"),i=0;i<u.length;i++)t=$cvf(u[i]),r=$cvf("[data-refname='"+t.attr("data-ctrlrefname")+"']"),r.change(function(){var i=parseFloat(t.attr("data-amountcutoff")),n=parseFloat($cvf(this).val());isNaN(n)||(n<i?t.parent().removeClass("hide"):t.parent().addClass("hide"))}),r.trigger("change")},ApplyMerchantAccountOverridePlugin:function(n){var i=$cvf(n+" [data-applyplugin='merchantaccountoverride']"),r,t,u;if(CVFUTL.HasValues(i))for(r=CVF.FindKeyInVariables("MRCACC"),r!==null&&CVF.SetKeyInVariables("ORGMRCACC",r.CValue),t=0;t<i.length;t++)u=$cvf(i[t]),u.change(function(){var t=$cvf(this),n=parseInt(t.val());if(isNaN(n)){console.error("Currency selection value: "+n+" was not a value integer");return}CVF.SetKeyInVariables("MRCACC",n);$cvf("input[type='hidden'][data-field='MRCACC']").val(n)}),u.trigger("change")},ApplyGoogleAddressLookupPlugin:function(n){if(CVF.IsOutlineRenderMode!==!0){var t=$cvf(n+" [data-applyplugin='googleaddresslookup']");t.length<1||(CVFR.GoogleAutocomplete=null,$cvf.get(CVF.DataSourceURL+"Google/LoadGoogleAddress",function(n){if(n.hasOwnProperty("ApiKey")&&CVFUTL.HasContent(n.ApiKey)){var t=$cvf("script[src*='maps.googleapis']");t.length>0?initAutocomplete():CVF.AttachScriptTag(n.Url+"?key="+n.ApiKey+"&libraries=places&callback=initAutocomplete",["async","defer"])}else console.error("Unable to load Google Address config: "+n)}))}},GoogleFillInAddress:function(){var u,r,n,f,t,i;if(CVFUTL.HasValues(CVFR.GoogleAutocomplete)&&(u=this.getPlace(),CVFUTL.IsInitialized(u))){for(r=$cvf("#"+this.targetId),n={subpremise:{ref:r.attr("data-subpremiserefname"),val:""},street:{ref:r.attr("data-addressrefname"),val:""},city:{ref:r.attr("data-cityrefname")},postalcode:{ref:r.attr("data-postalrefname")},country:{ref:r.attr("data-countryrefname")},state:{ref:r.attr("data-staterefname")},county:{ref:r.attr("data-countyrefname")}},f=0;f<u.address_components.length;f++)t=u.address_components[f],i=t.types[0],i==="subpremise"&&(n.subpremise.val=t.short_name),i==="street_number"&&(n.street.val+=t.short_name),i==="route"&&(n.street.val+=" "+t.long_name),i==="postal_town"&&(n.city.val=t.long_name),i==="administrative_area_level_2"&&(n.county.val=t.long_name),i==="locality"&&(n.city.val=t.long_name),i==="postal_code"&&(n.postalcode.val=t.short_name),i==="country"&&(n.country.val=t.short_name),i==="administrative_area_level_1"&&(n.state.val=t.short_name);$cvf.each(n,function(n,t){CVFR.RuntimeValueChange(t.ref,t.val)})}},Geolocate:function(){typeof google!="undefined"&&navigator.geolocation&&navigator.geolocation.getCurrentPosition(function(n){for(var i={lat:n.coords.latitude,lng:n.coords.longitude},r=new google.maps.Circle({center:i,radius:n.coords.accuracy}),t=0;t<CVFR.GoogleAutocomplete.length;t++)CVFR.GoogleAutocomplete[t].setBounds(r.getBounds())})},CalculateProcessingFee:function(){var t=$cvf("#"+CVF.Target+" [data-applyplugin='processingfee']"),u,n,e;if(CVFUTL.IsInitialized(t)&&!(t.length<1)){var r=$cvf("input[data-field='cv_donationAmount']"),o=parseFloat(t.attr("data-plugin-value")),i=parseFloat(r.val()),f=t.closest("div");(f.find("label.processing-amount").remove(),isNaN(i)||i<=0)||(u=0,n=0,t[0].checked===!0?(u=i,n=i*(1+o/100),e="<label class='control-label processing-amount'>Total: "+n.toFixed(2)+"<\/label>",f.append(e)):(n=parseFloat(r.attr("data-org-amount")),(isNaN(n)||n<=0)&&(n=i)),r.val(n.toFixed(2)).attr("data-org-amount",u))}},RelatedDropdownChange:function(){var i=$cvf(this).attr("data-relatedcontrol"),r=$cvf(this).val(),n,t;CVFUTL.HasContent(i)&&(n=$cvf("select[data-refname='"+i+"']"),CVFUTL.IsInitialized(n))&&(t=CVF.FindControlInModel(n.attr("data-id")),CVFUTL.IsInitialized(t)&&(n.html(CVF.BuildOptionListFromDataList(t,r)),n.change()))},RadioGroupChange:function(){var r=$cvf(this),u=r.val()||r.find("input").val(),e=r.closest(".btn-group").attr("data-toggleGroupCID"),i=$cvf("input[data-togglegroupcid='"+e+"']"),f=i.attr("data-refname"),n=$cvf("input[type='hidden'][data-refname='"+f+"']"),t=null;CVFUTL.HasContent(f)&&n.length>0?(t=n,n.val(u),n.change(),n.attr("data-has-processing-fee")=="true"&&CVFR.CalculateProcessingFee()):(t=i,i.val(u),i.change());t!=null&&CVFUTL.IsInitialized(t.attr("data-VsTargetGroup"))&&CVFR.ActVisibilityTrigger(0,t)},ActVisibilityTrigger:function(n,t){var i,r,u;CVF.IsOutlineRenderMode!==!0&&(i=$cvf(this),CVFUTL.IsInitialized(t)&&(i=$cvf(t)),r=i.attr("data-vsTargetGroup"),u=i.is("select")?i.find("option:selected").val():i.is("input")&&i.attr("type")=="checkbox"?i.prop("checked").toString():i.val(),$cvf("[data-vsGroup='"+r+"']").each(function(n,t){var f=$cvf(t),l=f.attr("data-VsShowOn").split(","),h=f.children(),c=$cvf.inArray(u,l)>-1,e,o,i,s;for(c===!0?f.show():f.hide(),e=0;e<h.length;e++)o=$cvf(h[e]),i=o.find("input, select"),i.length<1&&(i=o),s=o.attr("data-vsgroup"),CVFUTL.IsInitialized(s)&&s!=r||c!==!0?i.addClass("hidden").attr("data-vsGroupOn",!1):i.removeClass("hidden").attr("data-vsGroupOn",!0)}))},InitDatepicker:function(n){for(var u,f,i={autoclose:!0,todayBtn:"linked",todayHighlight:!0,disableTouchKeyboard:!0,startView:0,format:{toDisplay:function(n){var t=new Date;return n.getUTCFullYear()===t.getFullYear()&&n.getUTCMonth()===t.getMonth()&&n.getUTCDate()===t.getDate()&&(n.setUTCHours(t.getHours()),n.setUTCMinutes(t.getMinutes()),n.setUTCSeconds(t.getSeconds()),n.setUTCMilliseconds(t.getMilliseconds())),CVFR.FormatDateForDisplay(n)},toValue:function(n){return n}}},e=$cvf(n),r=0;r<e.length;r++){var t=$cvf(e[r]),s=t.attr("id"),o=t.attr("data-allowpastdates");CVFUTL.IsInitialized(o)&&o=="true"?(i.startDate=new Date(1900,0,1,0,0,0,0),t.addClass("no-default")):i.startDate=new Date;u=parseInt(t.attr("data-maxdateindays"));i.endDate=isNaN(u)?"":new Date((new Date).setDate((new Date).getDate()+u));f=t.attr("data-startview");CVFUTL.IsInitialized(f)&&(i.startView=parseInt(f));t.datepicker(i);$cvf("button.btn-datepicker[data-for='"+s+"']").off("click").click(function(){$cvf("#"+$cvf(this).attr("data-for")).datepicker("show")})}$cvf(n+":not(.no-default)").datepicker("setDate",new Date)},ValidatePage:function(){var n=$cvf(".control-validate");return(n.each(function(){CVFR.RemoveControlError($cvf(this))}),n.each(CVFR.ValidateControl),CVFR.ValidateEventControls(),$cvf(".error-message:visible").length>0)?(CVFR.ShowErrorSummary(),!1):!0},ValidateEventControls:function(){var t,i,n,r,u,f,e;if(!CVF.IsEventForm())return!0;for(t=0,i=$cvf("#"+CVF.Target+" select.event-package-quantity"),n=0;n<i.length;n++)r=$cvf(i[n]),CVFR.RemoveControlError(r),u=parseInt(r.val()),CVFUTL.IsPositiveNumber(u)&&(t+=u);return(f=$cvf("#"+CVF.Target+" [data-field='cv_event_packages']"),CVFR.RemoveControlError(f),t<1&&(!CVF.EventData.Event.HasOptionalDonation||CVF.EventData.OptionalDonation<=0))?(e="Please select a Package",CVF.EventData.Event.HasOptionalDonation&&(e+=" or enter an donation"),CVFR.AddControlError(f,e),!1):!0},ShowErrorSummary:function(n){$cvf("#cv_errorsummary").length||CVFR.BuildErrorSummary();var t="<ul>";CVFUTL.IsInitialized(n)&&n.length>0?$cvf.each(n,function(n,i){t+="<li>"+i+"<\/li>"}):$cvf.each($cvf(".error-message:visible"),function(){t+="<li>"+$cvf(this).html()+"<\/li>"});t+="<\/ul>";$cvf("#cv_errorsummary_body").empty().html(t);$cvf("#cv_errorsummary").appendTo("body").modal("show")},BuildErrorSummary:function(){var n="<div id='cv_errorsummary' class='cv_genform_m modal fade' tabindex='-1' role='dialog'>";n+="<div class='modal-dialog modal-sm' role='document'>";n+="<div class='modal-content'>";n+="<div class='modal-header'><h4 class='modal-title'>"+CVF.GetMessageFromModel("ErrorSummaryTitle","Error Summary")+"<\/h4><\/div>";n+="<div class='modal-body' id='cv_errorsummary_body'><\/div>";n+="<div class='modal-footer'><button type='button' class='btn btn-primary' data-dismiss='modal'>"+CVF.GetMessageFromModel("ErrorSummaryButton","Close")+"<\/button><\/div>";n+="<\/div><\/div><\/div>";$cvf("#"+CVF.Target).append(n)},ValidateControl:function(){var t=!1,n=$cvf(this),i;if(n.hasClass("hidden")===!1){i=n.attr("data-required");switch(n.attr("data-validate")){case"AnyValue":t=CVFR.Validate_Any(n,i);break;case"1":case"Number":t=CVFR.Validate_Number(n,i);break;case"2":case"NumberPositive":t=CVFR.Validate_NumberPositive(n,i);break;case"3":case"CCNumber":t=CVFR.Validate_CreditCardNumber(n,i);break;case"5":case"Email":t=CVFR.Validate_Email(n,i);break;case"4":case"CVV":t=CVFR.Validate_CVV(n,i);break;case"6":case"ExpiryDate":t=CVFR.Validate_ExpiryDate(n,i);break;case"7":case"NumberGreaterThanOrEqual":t=CVFR.Validate_GreaterThanOrEqualTo(n,i);break;case"8":case"Length":t=CVFR.Validate_Length(n,i);break;case"0":case"None":default:i&&(n.attr("type")=="checkbox"?t=CVFR.Validate_Checkbox(n):n.hasClass("g-recaptcha")===!1&&(t=CVFR.Validate_Any(n,i)))}}n.hasClass("g-recaptcha")===!0&&(t=CVFR.Validate_ReCaptcha());t===!0&&CVFR.RemoveControlError(n)},Validate_Checkbox:function(n){return n.prop("checked")===!0?!0:(CVFR.AddControlError(n,"Please select"),!1)},Validate_Any:function(n,t){if(n.val()!=""||!t)return!0;var i=n.is("select")===!0?"Please select a value":"Please enter a value";return CVFR.AddControlError(n,i),!1},Validate_Number:function(n,t){var i=parseFloat(n.val()),r=Number(n.val());return r===i&&isNaN(i)===!1?!0:!t&&n.val()==""?!0:(CVFR.AddControlError(n,"Please enter a valid number"),!1)},Validate_NumberZeroInclusive:function(n){var i=parseFloat(n.val()),t=parseInt(n.attr("max")),r;return!isNaN(i)&&i>=0&&(isNaN(t)||i<=t)?!0:(r="Please enter a valid number greater than or equal to 0",isNaN(t)||(r="Please enter a valid number between 0 and "+t),CVFR.AddControlError(n,r),!1)},Validate_NumberPositive:function(n,t){var i=parseFloat(n.val()),r=Number(n.val());return r===i&&!isNaN(i)&&i>0?!0:!t&&n.val()==""?!0:(CVFR.AddControlError(n,"Please enter a valid positive number"),!1)},Validate_CVV:function(n,t){return/^[0-9]{3,4}$/.test(n.val())?!0:!t&&n.val()==""?!0:(CVFR.AddControlError(n,"Please enter a CVV number"),!1)},Validate_CreditCardNumber:function(n){var t=$cvf(n).validateCreditCard(null,{accept:["visa","mastercard","amex","discover","maestro"]}),i=$cvf(n).next("span.ccnumbertxt"),r="0";return i.removeClass("valid visa discover mastercard maestro amex"),t.valid===!0?(i.addClass("valid"),n.addClass("valid"),i.addClass(t.card_type.name),r=CVFR.ResolveCreditCardType(t.card_type.name),CVFR.RemoveControlError(n)):CVFR.AddControlError(n,"Please enter a valid Credit Card Number"),$cvf("#"+CVF.Target+" [data-field='cv_ccType']").val(r),t.valid},Validate_ExpiryDate:function(n,t){var u=!1,s=12,f=n.val(),r=0,i=0,e,o,l;if(!t&&f=="")return!0;if(CVFUTL.HasContent(f)){e=f.split("/");i=e[0];r=e[1];var h=new Date,a=h.getMonth()+1,c=h.getFullYear();!isNaN(i)&&!isNaN(r)&&i.length>0&&r.length==4&&(r==c?i>=a&&i<=s&&(u=!0):r>c&&i<=s&&(u=!0))}return u===!0?(o=new Date(r,i,0),o.setUTCHours(0,0,0,0),l=n.attr("data-relatedcontrol"),CVFR.RuntimeValueChange(l,o.toISOString())):CVFR.AddControlError(n,"Please enter a valid expiry date"),u},Validate_Email:function(n,t){if(!t&&n.val()=="")return!0;return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(n.val())?!0:(CVFR.AddControlError(n,"Please enter a valid email address"),!1)},Validate_ReCaptcha:function(){var t=$cvf($cvf("#"+CVF.Target+" div.g-recaptcha")[0]),n=$cvf(t).attr("data-g-recaptcha-valid");if(n===null||n===undefined||n==="false"||n===!1)return CVFR.AddControlChildError(t,"Please verify with the Captcha"),!1},Validate_LessThanOrEqualTo:function(n,t){var i=CVF.FindControlInModel(n.prop("id")),r,u;return i==null||!CVF.HasVal(i,"ValidationValue")?!0:(r=n.val(),!t&&CVFUTL.HasContent(r)===!1)?!0:(u=Number(r),CVFUTL.HasContent(r)===!0&&u<=i.ValidationValue)?!0:(CVFR.AddControlError(n,"Please enter a number less than or equal to: "+i.ValidationValue),!1)},Validate_GreaterThanOrEqualTo:function(n,t){var i=CVF.FindControlInModel(n.prop("id")),r,f,u;return i==null||!CVF.HasVal(i,"ValidationValue")?!0:(r=n.val(),!t&&CVFUTL.HasContent(r)===!1)?!0:(f=Number(i.ValidationValue),u=Number(r),CVFUTL.HasContent(u)===!0&&u>=f)?!0:(CVFR.AddControlError(n,"Please enter a number greater than or equal to: "+i.ValidationValue),!1)},Validate_EqualTo:function(n,t){var i=CVF.FindControlInModel(n.prop("id")),r;return i==null||!CVF.HasVal(i,"ValidationValue")?!0:(r=n.val(),!t&&CVFUTL.HasContent(r)===!1)?!0:r==i.ValidationValue?!0:(CVFR.AddControlError(n,"Please enter a value that is equal to: "+i.ValidationValue),!1)},Validate_PhoneNumber:function(n,t){var i=CVF.FindControlInModel(n.prop("id")),r,u;if(!t&&(i==null||!CVF.HasVal(i,"ValidationValue"))||(r=n.val(),!t&&!CVFUTL.HasContent(r)))return!0;if(CVFUTL.HasContent(i.ValidationValue)){if(u=new RegExp(i.ValidationValue),u.test(r))return!0}else if(t&&CVFUTL.HasContent(r))return!0;return CVFR.AddControlError(n,"Please enter a valid phone number"),!1},Validate_Length:function(n,t){var i=CVF.FindControlInModel(n.prop("id")),r,u;return i==null||!CVF.HasVal(i,"ValidationValue")?!0:(r=n.val(),!t&&CVFUTL.HasContent(r)===!1)?!0:(u=Number(i.ValidationValue),r.length>0&&r.length<=u)?!0:(CVFR.AddControlError(n,"Please enter a value that is less than or equal to: "+i.ValidationValue+" characters"),!1)},Validate_UKDirectDebitSortCode:function(n,t){var i=n.val(),r,u;return!t&&CVFUTL.HasContent(i)===!1?!0:(r=i.split(" ").join(""),u=!isNaN(r),!u||i.length!=8)?!1:!0},Validate_Money:function(n,t){var i=n.val(),r,f,u;return!t&&i===""?!0:(r=parseFloat(i),!isNaN(r)&&r>0)?!0:(f=i.replace(/[^0-9.]/g,""),u=parseFloat(f),!isNaN(u)&&u>0)?!0:(CVFR.AddControlError(n,"Please enter a valid dollar amount"),!1)},ResolveCreditCardType:function(n){switch(n){case"visa":return 1;case"mastercard":return 2;case"amex":return 3;case"discover":return 4;default:return 0}},FormatCreditCardNumber:function(){var t=$cvf(this).val(),i,n,r;if(t!=""){for(i="",n=0;n<t.length;n++)(n==4||n==9||n==14||n==19)&&(i+=" "),t[n]!=" "&&(i+=t[n]);$cvf(this).val(i);r=CVFR.Validate_CreditCardNumber($cvf(this),!0);r===!0&&CVFR.RemoveControlError($cvf(this))}},FormatExpiryDate:function(){var t=$cvf(this).val(),i,n,r,u;if(CVFUTL.HasContent(t)){if(t.length>3){for(i="",n=0;n<t.length;n++)n==2&&(i+="/"),t[n]!="/"&&(i+=t[n]);$cvf(this).val(i)}r=CVFR.Validate_ExpiryDate($cvf(this),!0);r===!1?(u=$cvf(this).attr("data-relatedcontrol"),CVFR.RuntimeValueChange(u,"")):CVFR.RemoveControlError($cvf(this))}},FormatUKDirectDebitSortCode:function(){var t=$cvf(this).val(),i,n,r;if(t!=""){for(i="",n=0;n<t.length;n++){if(n>7)break;(n==2||n==5)&&(i+=" ");t[n]!=" "&&(i+=t[n])}$cvf(this).val(i);r=CVFR.Validate_UKDirectDebitSortCode($cvf(this),!0);r===!0?CVFR.RemoveControlError($cvf(this)):CVFR.AddControlError($cvf(this),"Please enter a valid Sort Code")}},AddControlChildError:function(n,t){var u=n.children(),i,r;($cvf(u[0]).addClass("has-error"),n.find(".error-message").length>0)||(i=n.attr("data-customError"),i!==null&&i!==undefined&&i!==""&&(t=i),r='<div class="error-message">'+t+"<\/div>",n.append(r))},AddControlError:function(n,t,i){var r,o,u,f,s,e;(t=t||"",i===undefined&&(i=!0),r=n.parent(),r.hasClass("input-group")&&(r=r.parent()),r.addClass("has-error"),n.attr("type")==="checkbox"&&n.closest("div").find(".error-message").length>0||r.find(".error-message").length>0)||(o=n.attr("data-field"),t.indexOf(o)>-1&&(u=CVF.FindControlInModel(n.attr("id")),f="",CVF.HasVal(u,"LabelText")?f=u.LabelText:CVF.HasVal(u,"Content")&&(f=u.Content),t=t.replace(o,f)),s=n.attr("data-customError"),CVFUTL.HasContent(s)&&i&&(t=s),e="<div class='error-message'>"+t+"<\/div>",n.attr("type")==="checkbox"?r.closest("div").append(e).addClass("has-error"):n.is("div")?n.append(e):$cvf(r).append(e))},RemoveControlError:function(n){if(n.attr("type")==="checkbox")n.closest("div").removeClass("has-error").find(".error-message").remove();else{var t=n.parent();t.hasClass("input-group")&&(t=t.parent());t.removeClass("has-error").find(".error-message").remove()}},AddControlFeedback:function(n,t){n.parent().addClass("has-feedback has-"+t);t==="success"&&$cvf("<span class='glyphicon glyphicon-ok form-control-feedback'><\/span>").insertAfter(n)},RemoveControlFeedback:function(n){var t=n.parent();t.removeClass("has-feedback has-success");t.find(".form-control-feedback").remove()},Submit:function(){if(CVFR.IsSubmitEnabled!==!1&&CVFR.ValidatePage()){if(CVFR.IsDirectDebitVerification===!0){CVFR.ValidateDirectDebit();return}if(CVFR.IsPayPalDonation()){CVFR.PayPalRedirect();return}if(CVFR.IsDesignMode===!1){CVFR.ShowLoadingBar();CVFR.SendGASubmit();CVFR.CollectDTSubmitEvents();var n=CVFR.BuildPayload();CVFR.SendData(n)}}},PayPalRedirect:function(){var n,t,i;CVFR.ShowLoadingBar();n={fid:CVF.FormID,aid:CVF.AccountID,amt:CVFR.GetDonationAmount(),istest:CVFR.IsTestRun};CVFR.GetDonationType()==="recurring"?(t=$cvf("[data-field='cv_donationStartDate']"),i=$cvf("[data-field='cv_donationFrequency']"),n.sDate=CVFR.GetPayloadDate(t),n.frq=CVF.CleanContent(i.val(),!0),$cvf.ajax({url:CVF.DataSourceURL+"form/createpaypalagreement",type:"post",timeout:5e3,data:n,success:function(n){if(n.success!=null&&n.success===!0)if(CVFR.IsTestRun)CVFR.UpdatePayPalTestResponse(n);else{var t=$cvf.grep(n.links,function(n){return n.rel==="approval_url"})[0];window.location=t.href}else CVFR.ParseVortexResponseError(null,null,n.errors)},error:CVFR.ParseVortexResponseError})):$cvf.ajax({url:CVF.DataSourceURL+"Form/CreatePayPalOrder",type:"post",timeout:5e3,data:n,success:function(n){if(n.status!=null&&n.status==="CREATED")if(CVFR.IsTestRun)CVFR.UpdatePayPalTestResponse(n);else{var t=$cvf.grep(n.links,function(n){return n.rel==="approve"})[0];window.location=t.href}else CVFR.ParseVortexResponseError(null,null,n.errors)},error:CVFR.ParseVortexResponseError})},UpdatePayPalTestResponse:function(n){CVFR.GetDonationType()==="recurring"&&(CVFR.IsPayPalRecurring=!0);CVFR.PayPalToken=n.id;CVFR.PayPalDetail=n;CVFR.Submit();CVFR.PayPalToken=null},BuildPayload:function(){var n={};return n.FID=CVF.FormID,n.FVID=CVF.VersionID,CVFUTL.HasContent(CVF.PageID)&&(n.PID=CVF.PageID),CVFR.IsDTEnabled()&&(n.DTSID=CVFR.Tracker.SessionId),n.TZOFF=-(new Date).getTimezoneOffset(),CVFR.AttachEventDataToPayload(n),$cvf("#"+CVF.Target+" [data-field]").each(function(){var t=$cvf(this),o;if(t.attr("data-vsGroupOn")!="false"&&t.attr("data-ignore")!="true"){var i=t.attr("data-field"),r=t.val(),f=t.attr("data-fieldProp"),u=t.attr("data-fieldIndex"),e=t.attr("data-evalFunc");if(e!=undefined&&(r=CVFR.EvalFunctionValue(e,r)),f!=undefined&&u!=undefined){for(o=n[i],o==undefined&&(n[i]=[]),u=Number(u);n[i].length<u+1;)n[i].push({});n[i][u][f]=CVF.CleanContent(r,!0)}else t.attr("type")==="checkbox"?n[i]=t.prop("checked")===!0:t.attr("type")==="hidden"?CVFUTL.IsInitialized(r)&&(n[i]=CVF.CleanContent(r,!0)):n[i]=t.attr("data-applyplugin")==="datepicker"||t.attr("data-applyplugin")==="ukddstartdate"?CVFR.GetPayloadDate(t):i==="recaptcha"?t.attr("data-g-recaptcha-resp"):r==undefined?"":CVF.CleanSubmissionContent(r,!0)}}),CVFR.PayPalToken&&(n=CVFR.BuildPayPalPayload(n)),CVFR.IsTestRun===!0&&(n.TSTR=!0),n},GetPayloadDate:function(n){var t=n.datepicker("getDate"),i,r;return t?(i=new Date,(t.getFullYear()!==i.getFullYear()||t.getMonth()!==i.getMonth()||t.getDate()!==i.getDate())&&(t=n.datepicker("getUTCDate")),r=null,CVFUTL.IsInitialized(t)&&(r=t.toISOString()),r):""},AttachEventDataToPayload:function(n){var i,r,t,u,f,e,o,s;if(CVF.IsEventForm()){for(CVF.EventData.HasPromoCodes===!0&&CVFUTL.HasValues(CVF.EventData.PromoCodes)&&(n.cv_event_promocode=CVF.EventData.PromoCodes[0].Code),CVF.EventData.Event.HasOptionalDonation===!0&&(n.cv_event_optionalDonation=CVF.CleanContent($cvf("#"+CVF.Target+" [data-refname='eventoptionaldonation']").val(),!0)),i=[],r=$cvf("#"+CVF.Target+" select.event-package-quantity"),t=0;t<r.length;t++)(u=$cvf(r[t]),f=parseInt(u.val()),CVFUTL.IsPositiveNumber(f))&&(e=parseInt(u.attr("data-id")),o=CVF.FindEventPackageById(e),o!==null)&&(s={cv_event_detail_package_ID:e,cv_event_detail_quantity:f},i.push(s));n.cv_event_detail=i}},SendData:function(n){try{var t={};t.CVF=JSON.stringify(n);$cvf.ajax({url:CVF.DataSourceURL+"Form/Submit",type:"post",data:t,timeout:12e4,dataType:"json",success:CVFR.ParseVortexResponse,error:CVFR.ParseVortexResponseError})}catch(i){CVFR.ParseVortexResponseError(null,null,i)}},ParseVortexResponseError:function(n,t,i){console.error(i);CVFR.AddDTEvent(DTEventCategory.Error,i);CVFR.SendDTEvents();CVFR.DisplaySystemFailureAlert()},ParseVortexResponse:function(n){var r,t,i,u;try{if(n.Success!==null&&n.Success!==undefined&&n.Success===!0)CVFR.DisplaySuccessPage(n),n.hasOwnProperty("TestTrace")&&n.TestTrace!=null&&CVF.IsInDesignMode()&&(CVFD.DisplayTestTraceData(n.TestTrace),CVFD.ErrorLogClearAll()),CVFR.SendGASubmitTrackingEvents(n);else if(n.Errors.length>=0){for(r=[],t=0;t<n.Errors.length;t++)n.Errors[t].ErrorType===2?CVFR.DisplaySystemFailureAlert():n.Errors[t].ErrorType===3?(i=$cvf("[data-field='"+n.Errors[t].FieldName+"']"),CVF.IsInDesignMode()?(!CVFUTL.IsInitialized(i)||i.length<1?CVFD.ErrorLogAdd("missingFields",n.Errors[t].Message,null,null):n.Errors[t].FieldName.startsWith("cv_alloc")?CVFD.ErrorLogAddMissingAllocation(!0):(CVFD.ErrorLogAdd("actionError",n.Errors[t].FieldName+": "+n.Errors[t].Message,null,null,n.Errors[t].FieldName),n.Errors[t].FieldName==="recaptcha"?r.push(n.Errors[t].Message):CVFR.AddControlError(i,n.Errors[t].Message)),CVFD.ToggleErrorLogView()):CVFUTL.IsInitialized(i)&&i.length>0&&(n.Errors[t].FieldName==="recaptcha"?r.push(n.Errors[t].Message):CVFR.AddControlError(i,n.Errors[t].Message))):n.Errors[t].ErrorType===4&&(n.Errors[t].FieldName!==""?(i=$cvf("[data-field='"+n.Errors[t].FieldName+"']"),CVFR.AddControlError(i,n.Errors[t].Message)):(u="The payment information you have entered is invalid",$cvf.inArray(u,r)===-1&&r.push(u),CVFR.AddControlError($cvf("div[data-vsgroup='paymentType']"))),r.push(n.Errors[t].Message));r.length>0&&($cvf("#directdebitcheck-result").hide(),$cvf("#donation-form").show(),CVFR.ShowErrorSummary(r));CVFR.DirectDebitPaymentTypeChange($cvf("#"+CVF.Target+" [data-applyplugin='directdebitselect']"));CVFR.ResetRecaptcha()}else console.error(n),CVFR.DisplaySystemFailureAlert(),CVFR.ResetRecaptcha()}catch(f){console.error(f);CVFR.DisplaySystemFailureAlert()}CVFR.HideLoadingBar()},SendGASubmitTrackingEvents:function(n){if(typeof gtag!="undefined"&&CVFR.ProcessToGateway){var t=CVFR.GetDonationType()?CVFR.GetDonationType():null,i=CVFR.GetDonationAmount()?CVFR.GetDonationAmount():null,r=n.GatewayResult&&n.GatewayResult.TransactionID?n.GatewayResult.TransactionID:null,u=$cvf("[data-field='cv_donationFrequency'] option:selected").text()?$cvf("[data-field='cv_donationFrequency'] option:selected").text():null;gtag("event","purchase",{transaction_id:r,value:i,currency:"CAD",items:[{item_name:CVF.FormName,item_category:u,item_category2:t}]})}},DisplaySystemFailureAlert:function(){alert(CVF.GetMessageFromModel("FailureAlert","There was an issue processing your request, please contact the non-profit organization for more information"));CVFR.HideLoadingBar()},DisplaySuccessPage:function(n){var i,t,r;if(CVF.IsEventForm()&&CVF.HasVal(n,"EventResult")){CVFR.DisplayEventSuccessPage(n);return}if(n=n.GatewayResult,i=CVF.Model.Attributes.Urls!==undefined&&CVF.Model.Attributes.Urls.Success!=="",i&&!CVF.IsInDesignMode()){CVFR.RedirectToSuccessUrl(n);return}CVFR.SendDTEvents();CVFUTL.IsInitialized(n)?(t="<div><strong>"+CVF.GetMessageFromModel("GatewayResultTitle","Transaction Details")+":<\/strong><\/div>",CVFUTL.HasContent(n.TransactionID)&&(t+="<div><strong>"+CVF.GetMessageFromModel("TransactionIdTitle","Transaction ID")+":<\/strong> "+n.TransactionID+"<\/div>"),CVFUTL.HasContent(n.Amount)&&n.Amount>0&&(t+="<div><strong>"+CVF.GetMessageFromModel("AmountIdTitle","Amount")+":<\/strong> "+n.Amount+"<\/div>"),CVFUTL.HasContent(n.ProfileID)&&(t+="<div><strong>"+CVF.GetMessageFromModel("ProfileIdTitle","Profile ID")+":<\/strong> "+n.ProfileID+"<\/div>"),CVFUTL.HasContent(n.BureauProfileId)&&(t+="<div><strong>"+CVF.GetMessageFromModel("BureauIdTitle","Reference Number")+":<\/strong> "+n.BureauProfileId+"<\/div>"),CVFUTL.HasContent(n.RegisterReferenceNumberResult)&&(t+="<div><strong>"+CVF.GetMessageFromModel("RegistrationResultTitle","Registration Result")+":<\/strong> "+n.RegisterReferenceNumberResult+"<\/div>"),CVFUTL.HasContent(n.AuthorizationResult)&&(t+="<div><strong>"+CVF.GetMessageFromModel("AuthorizationTitle","Authorization")+":<\/strong> "+n.AuthorizationResult+"<\/div>"),CVFUTL.HasContent(n.SettlementDate)&&(r=Date.parse(n.SettlementDate),r>0&&(t+="<div><strong>"+CVF.GetMessageFromModel("TransactionDateTitle","Transaction Date")+":<\/strong> "+CVFR.FormatDateForDisplay(new Date(r))+"<\/div>")),$cvf("#gateway-result-ids-container").empty().append(t)):$cvf("#gateway-result-ids-container").hide();$cvf("#gateway-result").show();$cvf("#donation-form").hide();i&&CVF.IsInDesignMode()&&$cvf("#gateway-result-success-url-container").empty().append("<div><a href='"+CVFR.BuildSuccessUrl(n)+"' target='_blank'><strong>Click to follow Success URL<\/strong><\/a><\/div>").show();CVFR.BringSuccessPageIntoView("gateway-result")},DisplayEventSuccessPage:function(n){var t,e,u,i,o,f,r,s,h;for(CVFR.SendDTEvents(),t="<div class='row sub-container'>",t+="<div class='row subitem'>",t+="<div class='col-xs-4'><div class='event-total-title'>Order #<\/div><\/div>",t+="<div class='col-xs-8'><div class='event-total'>"+n.EventResult.Purchaser.OrderId+"<\/div><\/div>",t+="<\/div>",t+="<\/div>",t+="<div class='row sub-container'>",e=0,u=0;u<n.EventResult.Packages.length;u++)i=n.EventResult.Packages[u],t+="<div class='row inner'>",t+="<div class='col-xs-7'>",t+="<div class='event-package-name'>"+i.Name+"<\/div>",o=CVFUTL.AppendPlural("Package",i.Quantity),t+="<div class='event-package-description'>"+i.Quantity+" "+o+" x "+CVFR.FormatCurrencyForDisplay(i.Cost)+"<\/div>",i.BenefitCost>0&&(t+="<div class='event-package-description'>"+i.Quantity+" x "+CVFR.FormatCurrencyForDisplay(i.BenefitCost)+" Benefit Amount<\/div>"),t+="<\/div>",t+="<div class='col-xs-5'>",t+="<div class='event-package-total-amount'>"+CVFR.FormatCurrencyForDisplay(i.Cost*i.Quantity)+"<\/div>",t+="<\/div>",t+="<\/div>",e+=i.Quantity;t+="<\/div>";t+="<div class='row sub-container'>";t+="<div class='row subitem'>";t+="<div class='col-xs-4'><div class='event-total-title'>Total<\/div><\/div>";t+="<div class='col-xs-8'><div class='event-total'>"+CVFR.FormatCurrencyForDisplay(n.EventResult.Total)+"<\/div><\/div>";t+="<\/div>";CVFUTL.IsInitialized(n.EventResult.PromoCode)&&(t+="<div class='row subitem'>",t+="<div class='col-xs-7'><div class='event-subitem-title'>Subtotal<\/div><\/div>",t+="<div class='col-xs-5'><div class='event-subitem'>"+CVFR.FormatCurrencyForDisplay(n.EventResult.Subtotal)+"<\/div><\/div>",t+="<\/div>");CVFUTL.IsPositiveNumber(n.EventResult.Donation)&&(t+="<div class='row subitem'>",t+="<div class='col-xs-7'><div class='event-subitem-title'>Donation<\/div><\/div>",t+="<div class='col-xs-5'><div class='event-subitem'>"+CVFR.FormatCurrencyForDisplay(n.EventResult.Donation)+"<\/div><\/div>",t+="<\/div>");CVFUTL.IsInitialized(n.EventResult.PromoCode)&&(t+="<div class='row subitem'>",t+="<div class='col-xs-7'><div class='event-subitem-title'>Promo Code<\/div><\/div>",f="",n.EventResult.PromoCode.Type===1?f+=CVFR.FormatCurrencyForDisplay(n.EventResult.PromoCode.Value):n.EventResult.PromoCode.Type===2&&(f+=n.EventResult.PromoCode.Value+"%"),t+="<div class='col-xs-5'><div class='event-subitem'>"+n.EventResult.PromoCode.Code+" : "+f+"<\/div><\/div>",t+="<\/div>");r=n.EventResult.Total;CVFUTL.IsPositiveNumber(n.EventResult.TotalBenefitAmount)&&(t+="<div class='row subitem'>",t+="<div class='col-xs-7'><div class='event-subitem-title'>Total Benefit<\/div><\/div>",t+="<div class='col-xs-5'><div class='event-subitem'>"+CVFR.FormatCurrencyForDisplay(n.EventResult.TotalBenefitAmount)+"<\/div><\/div>",t+="<\/div>",r=r-n.EventResult.TotalBenefitAmount);CVFUTL.IsPositiveNumber(r)&&(t+="<div class='row subitem'>",t+="<div class='col-xs-7'><div class='event-subitem-title'>Tax Receiptable Amount<\/div><\/div>",t+="<div class='col-xs-5'><div class='event-subitem'>"+CVFR.FormatCurrencyForDisplay(r)+"<\/div><\/div>",t+="<\/div>");t+="<\/div>";t+="<\/div>";t+="<div class='row sub-container'>";CVFUTL.IsInitialized(n.GatewayResult)&&(t+="<div class='row subitem'>",t+="<div class='col-xs-7'><div class='event-subitem-title'>"+CVF.GetMessageFromModel("TransactionIdTitle","Transaction ID")+"<\/div><\/div>",t+="<div class='col-xs-5'><div class='event-subitem'>"+n.GatewayResult.TransactionID+"<\/div><\/div>",t+="<\/div>",CVFUTL.HasContent(n.GatewayResult.Amount)&&n.GatewayResult.Amount>0&&(t+="<div class='row subitem'>",t+="<div class='col-xs-7'><div class='event-subitem-title'>"+CVF.GetMessageFromModel("AmountIdTitle","Amount")+"<\/div><\/div>",t+="<div class='col-xs-5'><div class='event-subitem'>"+n.GatewayResult.Amount+"<\/div><\/div>",t+="<\/div>"),t+="<div class='row subitem'>",t+="<div class='col-xs-7'><div class='event-subitem-title'>"+CVF.GetMessageFromModel("AuthorizationTitle","Authorization")+"<\/div><\/div>",t+="<div class='col-xs-5'><div class='event-subitem'>"+n.GatewayResult.AuthorizationResult+"<\/div><\/div>",t+="<\/div>");t+="<\/div>";t+="<\/div>";s=CVFUTL.AppendPlural("ticket",e);$cvf("#event-email-ticket-text").text(s);h="<span class='event-purchaser-name'>"+n.EventResult.Purchaser.FullName+"<\/span>, your registration for "+CVF.EventData.Event.Name+" is complete!";$cvf("#event-success-header").html(h);$cvf("#event-result-body").empty().append(t);$cvf("#donation-form").hide();$cvf("#event-result").show();CVF.IsInDesignMode()||$cvf("#btn-event-guest-registration").click(function(){window.open(CVF.DataSourceURL+"Order/"+n.EventResult.Purchaser.Secret,"_blank")});CVFR.BringSuccessPageIntoView("event-result")},BuildSuccessUrl:function(n){var t=CVF.Model.Attributes.Urls.Success+"?";return CVFUTL.IsInitialized(n)&&(CVFUTL.HasContent(n.TransactionID)&&(t+="TransactionID="+encodeURIComponent(n.TransactionID)+"&"),CVFUTL.HasContent(n.ProfileID)&&(t+="ProfileID="+encodeURIComponent(n.ProfileID)+"&"),t+="Authorization="+encodeURIComponent(n.AuthorizationResult)+"&",CVFUTL.HasContent(n.SettlementDate)&&(t+="TransactionDate="+encodeURIComponent(n.SettlementDate))),t},RedirectToSuccessUrl:function(n){var t=CVFR.BuildSuccessUrl(n);CVF.IsInDesignMode()||window.location.replace(t)},BringSuccessPageIntoView:function(n){if(window.location.hash=n,CVF.IsInDesignMode())window.scrollTo(0,0);else{var t=document.getElementById(n);t.scrollIntoView()}},EvalFunctionValue:function(n,t){var i=t,r,u,f,e,o;switch(n){case"TODAY":r=new Date;i=r.toISOString();break;case"VALUEOF":i=$cvf("[data-field='"+t+"']").val();break;case"AMOUNTPRC":u=CVFR.GetAmountForAllocation();f=Number(u);i=CVFR.RoundNumberTo(f*t/100,3);break;case"AMPLYAMOUNTPRC":e=$cvf("input[data-field='cv_amplyMatchedAmount']").val();o=Number(e);i=CVFR.RoundNumberTo(o*t/100,3);break;default:console.warn("Unable to evaluate runtime value for function: "+n)}return i},RoundNumberTo:function(n,t){return Number(Math.round(n+"e"+t)+"e-"+t)},FormatCurrencyForDisplay:function(n){return n=CVFR.RoundNumberTo(n,2),Number.prototype.toLocaleString?n.toLocaleString(undefined,{minimumFractionDigits:2,maximumFractionDigits:2}):n.toFixed(2)},FormatDateForDisplay:function(n){var t="";return n.getUTCDate()<10&&(t+="0"),t+=n.getUTCDate(),CVFR.MonthNames[n.getUTCMonth()]+" "+t+", "+n.getUTCFullYear()},ApplyDesignContext:function(){CVF.IsInDesignMode()!==!1&&CVFD.AttachUnsavedPrompt()},RemoveDesignContext:function(){$cvf("[data-cvcontrol]").off("contextmenu")},ResetRecaptcha:function(){if(typeof grecaptcha!="undefined")try{grecaptcha.reset()}catch(n){console.error(n)}},ShowLoadingBar:function(){$cvf("#form-backdrop, #form-loading-bar").fadeIn()},HideLoadingBar:function(){$cvf("#form-backdrop, #form-loading-bar").fadeOut()},RuntimeValueOverride:function(){CVF.IsDesignMode===!0||CVF.Setup==null||CVF.Setup.RuntimeOverrides.length<1||$cvf.each(CVF.Setup.RuntimeOverrides,function(n,t){if(!CVF.HasVal(t,"RN"))return!0;CVFR.RuntimeValueChange(t.RN,t.VL)})},RuntimeValueChange:function(n,t){var i=$cvf("[data-refname='"+n+"']"),r,u;i.length<1||(i.is("[data-togglegroupcid]")?(r=i.attr("[data-togglegroupcid]"),$cvf(".btn-group[data-togglegroupcid='"+r+"'] label.active").removeClass("active"),$cvf(".btn-group[data-togglegroupcid='"+r+"'] label").each(function(){$cvf(this).find("input[type='radio']").val()==t&&$cvf(this).addClass("active")}),i.val(t),i.change(),u=i.attr("data-relatedcontrol"),u!=""&&$cvf("[data-refname='"+u+"']").val(t)):i.is("select")?(i.find("option[value='"+t+"']").prop("selected",!0),i.change()):i.is("input")&&i.attr("type")==="checkbox"?(i.val(t),t=="true"?i.attr("checked","checked"):i.removeAttr("checked"),i.change()):i.attr("data-applyplugin")==="datepicker"||i.attr("data-applyplugin")==="ukddstartdate"?(/T\d{2}:\d{2}:\d{2}/.test(t)||(t+="T00:00:00"),i.datepicker("setDate",new Date(t))):(i.val(t),i.change()))},RelatedInputTextChange:function(){var n=$cvf(this).attr("data-relatedcontrol");n!=""&&CVFR.RuntimeValueChange(n,$cvf(this).val())},SendGASubmit:function(){if(CVF.IsInDesignMode()!==!0)try{CVF.Model.Attributes.Google!==undefined&&CVF.Model.Attributes.Google.AnalyticsLoaded===!0&&typeof ga!="undefined"&&ga("send","event","Form Submit","submit")}catch(n){console.error(n)}},CollectDTSubmitEvents:function(){var n,t,i;CVFR.IsDTEnabled()&&(n=$cvf("#"+CVF.Target+" input[data-applyplugin='processingfee']"),t=!1,n.length>0&&(t=n[0].checked),i={hasProcessingFee:t},CVFR.AddDTEvent(DTEventCategory.Collect,i),CVFR.AddDTEvent(DTEventCategory.Submit))},IsDTEnabled:function(){return!CVF.IsInDesignMode()&&CVFR.Tracker!=null&&typeof DeepThought!="undefined"},TestModeNotify:function(){if(CVFR.IsTestRun===!0){var n="<div class='testsubnotify'><span class='glyphicon glyphicon-exclamation-sign'><\/span> Test Submission Mode<\/div>";$cvf("#donation-form").append(n).prepend(n)}},ToggleMobileViewPort:function(n){var t=$cvf("#donation-form");CVFUTL.IsInitialized(n)?(n?t.addClass("formViewMobilePort"):t.removeClass("formViewMobilePort"),CVF.IsMobileView=n):t.toggleClass("formViewMobilePort")},ShowForm:function(n){CVFUTL.HasContent(n)||(n="#"+CVF.Target);var t=$cvf(n);CVFR.CheckTargetWidth(t);CVF.IsWizardMode===!0&&CVFR.ShowWizardStep(1,!1);window.addEventListener("resize",function(){CVFR.CheckTargetWidth($cvf(n))});CVFR.RemoveLoading(t)},RemoveLoading:function(n){n=n||$cvf("#"+CVF.Target);n.removeClass("loading loading-fullscreen").addClass("cv_genform_content");CVF.IsEventForm()&&n.addClass("events")},CheckTargetWidth:function(n){n=n||$cvf(this);var t=n.width()<768&&CVF.IsDesignMode===!1;CVFR.ToggleMobileViewPort(t)},OpenWizardStep:function(){var n=$cvf(this),t=n.attr("data-toStep"),i,r;t!=""&&(!n.is("li")||n.hasClass("stepenabled"))&&(i=Number(t)>Number(CVFR.CurrentWizardStep),r=CVFR.ValidateCurrentStep(i),r||!i)&&CVFR.ShowWizardStep(t)},ShowWizardStep:function(n,t){var i,u,r,f;t===undefined&&(t=!0);CVFR.IsDirectDebitVerificationActive===!0&&$cvf("#directdebitcheck-result").hide();i="#"+CVF.Target;$cvf(i+" [data-wzstep]").hide();u=$cvf(i+" [data-wzstep="+n+"]");u.show();r=u.find("[data-field='cv_paymentType']");r.length>0&&CVFR.IsDirectDebitVerificationActive===!0&&CVFR.CurrentWizardStep<n&&($cvf("#directdebitcheck-result").show(),r.closest("div.well").hide(),CVFR.SetUKDirectDebitSubmitTitle());CVFR.SkipPaymentStep===!0&&r.closest("div.well").hide();CVFR.CurrentWizardStep=n;$cvf(i+" .wzstepsinfonpanel ul li.stepcurrent").removeClass("stepcurrent active");$cvf(i+" .wzstepsinfonpanel ul li[data-tostep='"+n+"']").addClass("stepenabled stepcurrent active");f=CVF.WizardSteps[n-1];$cvf(i+" .wzstepdescription").hide().empty().append(f.Desc).show();t===!0&&document.getElementById(CVF.Target).scrollIntoView(!0)},ValidateCurrentStep:function(n){return($cvf("#"+CVF.Target+" [data-wzstep='"+CVFR.CurrentWizardStep+"'] .control-validate").each(CVFR.ValidateControl),CVFR.ValidateEventControls(),$cvf(".error-message:visible").length>0)?(n===!0&&CVFR.ShowErrorSummary(),!1):!0},ValidateDirectDebit:function(){var t,n;CVFR.ShowLoadingBar();t=CVFR.BuildPayload();try{n={};n.CVF=JSON.stringify(t);$cvf.ajax({url:CVF.DataSourceURL+"Form/DirectDebitVerify",type:"post",data:n,timeout:12e4,dataType:"json",success:CVFR.ParseVortexDirectDebitValidateResponse,error:CVFR.ParseVortexResponseError})}catch(i){CVFR.ParseVortexResponseError(null,null,i)}},ParseVortexDirectDebitValidateResponse:function(n){var i,t,r,u;try{if(CVFUTL.IsInitialized(n.Success)&&n.Success===!0)CVFR.IsDirectDebitVerification=!1,CVFR.IsDirectDebitVerificationActive=!0,CVFR.DisplayDirectDebitVerificationSummary(n);else if(n.Errors.length>=0){for(i=[],t=0;t<n.Errors.length;t++)n.Errors[t].ErrorType===2?CVFR.DisplaySystemFailureAlert():n.Errors[t].ErrorType===3?(r=$cvf("[data-field='"+n.Errors[t].FieldName+"']"),CVF.IsInDesignMode()?!CVFUTL.IsInitialized(r)||r.length<1?CVFD.ErrorLogAdd("missingFields",n.Errors[t].Message,null,null):n.Errors[t].FieldName.startsWith("cv_alloc")&&CVFD.ErrorLogAddMissingAllocation(!0):CVFUTL.IsInitialized(r)&&r.length>0&&CVFR.AddControlError(r,n.Errors[t].Message)):n.Errors[t].ErrorType===4&&(u="The payment information you have entered is invalid",$cvf.inArray(u,i)===-1&&i.push(u),CVFR.AddControlError($cvf("div[data-vsgroup='paymentType']")),i.push(n.Errors[t].Message));i.length>0&&CVFR.ShowErrorSummary(i);CVFR.ResetRecaptcha()}else console.error(n),CVFR.DisplaySystemFailureAlert(),CVFR.ResetRecaptcha()}catch(f){console.error(f);CVFR.DisplaySystemFailureAlert()}CVFR.HideLoadingBar()},DisplayDirectDebitVerificationSummary:function(n){var i,t,r;CVFR.RemoveControlError($cvf("div[data-vsgroup='paymentType']"));i=$cvf("[data-field='cv_paymentType']").closest("div.well");t="<div id='directdebitcheck-result' class='well'>";t+="<h2 class='hukdirectdebitverify text-center'>Payment Verification<\/h2>";t+="<h4 class='text-center'>Your banking information has been confirmed.<\/h4>";t+="<h5 class='text-center'>Confirmation of the Direct Debit set up will be sent by email within 3 working days or no later than 10 working days before first collection.<\/h5>";t+="<div id='directdebitcheck-result-msg-container'>";t+="<table>";t+="<tr><th>Amount:<\/th><td>£ "+$cvf("[data-field='cv_donationAmount']").val()+"<\/td><\/tr>";t+="<tr><th>Frequency:<\/th><td>"+$cvf("[data-field='cv_donationFrequency'] option:selected").text()+"<\/td><\/tr>";CVFUTL.HasContent(n.GatewayResult.BureauProfileID)&&(t+="<tr><th>Reference Number:<\/th><td>"+n.GatewayResult.BureauProfileID+"<\/td><\/tr>");CVFUTL.HasContent(n.GatewayResult.BankName)&&(t+="<tr><th><strong>Bank Name:<\/th><td>"+n.GatewayResult.BankName+"<\/td><\/tr>");t+="<tr><th><strong>Address:<\/th><td>";CVFUTL.HasContent(n.GatewayResult.BankAddress1)&&(t+=n.GatewayResult.BankAddress1);CVFUTL.HasContent(n.GatewayResult.BankCity)&&(t+="<br />"+n.GatewayResult.BankCity);CVFUTL.HasContent(n.GatewayResult.BankState)&&(t+="<br />"+n.GatewayResult.BankState);CVFUTL.HasContent(n.GatewayResult.BankPostalCode)&&(t+="<br />"+n.GatewayResult.BankPostalCode);t+="<\/td><\/tr>";CVFUTL.HasContent(n.GatewayResult.BankBranch)&&(t+="<tr><th>Branch:<\/th><td>"+n.GatewayResult.BankBranch+"<\/td><\/tr>");t+="<\/table>";t+="<\/div>";t+="<div class='text-center'>";t+="<button type='button' class='btn btn-default' id='cvf_submit_back'>Amend<\/button>";t+="<\/div><\/div>";r=$cvf("#cvf_submit");r.text(r.attr("data-originaltitle"));$cvf("#directdebitcheck-result").remove();$cvf(t).insertAfter(i);i.hide();$cvf("#cvf_submit_back").click(function(){CVFR.IsDirectDebitVerification=!0;CVFR.IsDirectDebitVerificationActive=!1;CVFR.SetUKDirectDebitSubmitTitle();$cvf("#directdebitcheck-result").remove();i.show()});CVFUTL.SafeValSet("[data-field='cv_gatewayBureauProfileID']",n.GatewayResult,"BureauProfileID");CVFUTL.SafeValSet("[data-field='cv_bankName']",n.GatewayResult,"BankName");CVFUTL.SafeValSet("[data-field='cv_bankAddress']",n.GatewayResult,"BankAddress1");CVFUTL.SafeValSet("[data-field='cv_bankAddress_city']",n.GatewayResult,"BankCity");CVFUTL.SafeValSet("[data-field='cv_bankAddress_state']",n.GatewayResult,"BankState");CVFUTL.SafeValSet("[data-field='cv_bankAddress_postal']",n.GatewayResult,"BankPostalCode");CVFUTL.SafeValSet("[data-field='cv_bankBranch']",n.GatewayResult,"BankBranch")},GetDonationAmount:function(){var n=$cvf("[data-field='cv_donationAmount']");return n.length>0?n.val().replace(/[^0-9.]/g,""):null},GetDonationType:function(){var n=$cvf("[data-field='cv_donationRecurring']");return n.length>0?n.is(":checked")?"recurring":"one-time gift":null},GetAmountForAllocation:function(){return CVF.IsEventForm()?CVF.EventData.TotalAmount:CVFR.GetDonationAmount()},ForceFundSelect:function(n){$cvf(n+" [data-applyplugin='fundselect']").trigger("change")},SetupEventForm:function(n){CVF.IsEventForm()&&(CVF.EventData.TotalAmount=0,CVF.EventData.OptionalDonation=0,CVFR.ApplyEventPromoCodePlugin(n),CVFR.ApplyEventWiring(n))},ApplyEventPromoCodePlugin:function(n){CVF.IsEventForm()&&CVF.EventData.HasPromoCodes===!0&&$cvf(n+" #event-promo-code-check").off("click").click(CVFR.PromoCodeCheck)},PromoCodeCheck:function(){var i="#"+CVF.Target,n=$cvf(i+" input[data-refname='eventpromocode']"),t,r;if(CVFR.RemoveControlError(n),CVFR.RemoveControlFeedback(n),t=n.val(),!CVFUTL.HasContent(t)){CVFR.AddControlError(n);return}r=CVF.DataSourceURL+"Event/ChallengePromoCode?eventId="+CVF.EventData.Event.Id+"&code="+encodeURI(t);$cvf.get(r,function(t){var u,r,f;t.HasFailed!==!0&&CVFUTL.IsInitialized(t.Data)?(u=!0,t.Data.SaleExpiry!==CVFUTL.MinDate&&(r=CVFUTL.NewUtcDate(t.Data.SaleExpiry),r.setDate(r.getDate()+1),f=new Date,u=!CVFR.IsDateExpired(f,r)),u?(CVFUTL.IsInitialized(CVF.EventData.PromoCodes)||(CVF.EventData.PromoCodes=[]),CVF.EventData.PromoCodes.push(t.Data),CVFR.AddControlFeedback(n,"success"),CVFR.ApplyPromoCodeButton("Remove","danger",CVFR.RemovePromoCode)):(CVFR.RemovePromoCode(),CVFR.AddControlError(n,"The promo code you have entered has expired",!1))):(CVFR.RemovePromoCode(),CVFR.AddControlError(n));CVFR.EventPackagesChange(i)})},IsDateExpired:function(n,t){return n.getFullYear()<t.getUTCFullYear()?!1:n.getFullYear()===t.getUTCFullYear()&&(n.getMonth()<t.getUTCMonth()||n.getMonth()===t.getUTCMonth()&&n.getDate()<t.getUTCDate())?!1:!0},RemovePromoCode:function(){var n="#"+CVF.Target,t=$cvf(n+" input[data-refname='eventpromocode']");CVFR.RemoveControlError(t);CVFR.RemoveControlFeedback(t);CVF.EventData.PromoCodes=[];CVFR.ApplyPromoCodeButton("Check","primary",CVFR.PromoCodeCheck);CVFR.EventPackagesChange(n)},ApplyPromoCodeButton:function(n,t,i){$cvf("#"+CVF.Target+" #event-promo-code-check").removeClass("btn-primary btn-warning btn-danger btn-default").addClass("btn-"+t).text(CVF.CleanContent(n)).off("click").click(i)},ApplyEventWiring:function(n){var t,i;CVF.IsEventForm()&&(t=$cvf(n+" select.event-package-quantity"),t.change(function(){CVFR.EventPackagesChange(n,t)}),$cvf(n+" button.event-quantity-btn").click(function(){var u=$cvf(this),f=parseInt(u.attr("data-value")),o=u.attr("data-id"),t=$cvf(n+" input.event-package-quantity[data-id='"+o+"']"),r=parseInt(t.val()),e=parseInt(t.attr("max")),i;isNaN(r)||!isNaN(e)&&r>=e&&f>0||(i=r+f,!isNaN(i)&&i>=0&&(t.val(i),t.trigger("change")))}),CVF.EventData.Event.Description.length>=CVFR.EventDescriptionBreakLength&&$cvf(n+" #event-description-toggle").click(function(){var u=$cvf(this),t=$cvf(n+" #event-description"),f=t.hasClass("in"),i="",r="";f?(i="Show more",r=CVFUTL.TruncateString(CVF.EventData.Event.Description,CVFR.EventDescriptionBreakLength)):(i="Show less",r=CVF.EventData.Event.Description);u.html(i);t.html(CVF.CleanContent(r));t.toggleClass("in")}),$cvf(n+" button.event-package-show-info").click(function(){var t=$cvf(this),u=t.attr("data-target-id"),i=$cvf(n+" div.event-description-container[data-package-id='"+u+"']"),f=i.hasClass("in"),r="Hide info";f&&(r="Show info");t.html(r);i.toggle().toggleClass("in")}),CVF.EventData.Event.HasOptionalDonation===!0)&&(i=$cvf(n+" input[data-refname='eventoptionaldonation']"),i.change(function(){CVFR.EventPackagesChange(n,t,i)}))},EventPackagesChange:function(n,t,i){var r,c,f,l,e,a,o,v,s,w,y,p,h,u,b;if(CVF.IsEventForm()){for(t=t||$cvf(n+" select.event-package-quantity"),CVF.EventData.Event.HasOptionalDonation===!0&&(i=i||$cvf(n+" input[data-refname='eventoptionaldonation']")),r=0,c=0,f=0;f<t.length;f++)(l=$cvf(t[f]),e=CVF.FindEventPackageById(l.attr("data-id")),e!==null&&e.IsExpired!==!0)&&(a=CVFR.RoundNumberTo(l.val()*e.Cost,2),c+=a,r+=a);o=CVFR.EventCalculateDiscount(r);CVFUTL.IsPositiveNumber(o)&&(o>r?r=0:(v=r-o,v>=0&&(r=v)));CVF.EventData.OptionalDonation=0;CVF.EventData.Event.HasOptionalDonation===!0&&i.parent().hasClass("has-error")===!1&&(s=i.val(),s!==undefined&&s!==null&&(w=s.replace(/[^0-9.]/g,""),y=parseFloat(w),CVFUTL.IsPositiveNumber(y)&&(p=CVFR.RoundNumberTo(y,2),r+=p,CVF.EventData.OptionalDonation=p)));CVF.EventData.TotalAmount=r;$cvf(n+" #event-amount-total").text(CVFR.FormatCurrencyForDisplay(r));$cvf("[data-field='cv_donationAmount']").val(parseFloat(c));h=$cvf("[data-field='cv_paymentType']").closest("div.well");u=$cvf(h).attr("data-wzstep");CVF.IsWizardMode===!0?CVFR.SkipPaymentStep=!1:h.show();b=CVFR.ValidateEventControls();b&&r<=0&&(CVF.IsWizardMode===!0?CVFR.SkipPaymentStep=!0:h.hide());r<=0?($cvf("[data-tostep='"+u+"']").hide(),$cvf(".submit-button-container").attr("data-wzstep",u-1)):($cvf("[data-tostep='"+u+"']").show(),$cvf(".submit-button-container").attr("data-wzstep",u))}},EventCalculateDiscount:function(n){var i,r,t;if(!CVFR.DoesEventHaveActivePromoCode())return 0;for(i=0,r=0;r<CVF.EventData.PromoCodes.length;r++)t=CVF.EventData.PromoCodes[r],t.Type===1?i=CVFR.RoundNumberTo(1*t.Value,2):t.Type===2&&(i=CVFR.RoundNumberTo(n*(t.Value/100),2));return i},DoesEventHaveActivePromoCode:function(){return CVF.IsEventForm()&&CVF.EventData.HasPromoCodes===!0&&CVFUTL.HasValues(CVF.EventData.PromoCodes)},BuildEventLocationLink:function(){return"<a class='event-location' href='https://www.google.com/maps?q="+CVF.EventData.Event.Location+"' target='_blank' rel='noopener noreferrer'>"+CVF.CleanContent(CVF.EventData.Event.Location)+"<\/a>"},GetPackageSummaryById:function(n){for(var i,r=null,t=0;t<CVF.EventData.PackageSummary.length;t++)if(i=CVF.EventData.PackageSummary[t],i.PackageId===n){r=i;break}return r}},CVF={Target:null,B:null,Model:null,OriginalModel:null,DataLists:null,ThemeID:0,FormID:null,PageID:null,AccountID:null,FormName:"",VersionID:null,DataSourceURL:"",VortexURI:"",AutoID:0,DataLoadCallback:null,MakeCallback:null,IsDesignMode:!1,CIDPrefix:"cvfctrl",Setup:null,IsWizardMode:!1,IsMobileView:!1,WizardSteps:[],WizardMaxSteps:0,IsOutlineRenderMode:!1,EventData:null,Init:function(n,t,i,r,u,f,e){CVF.VortexURI=CVF.BuildUrl(u);CVF.DataSourceURL=CVF.BuildUrl(r);CVF.FormID=n;CVF.Target=t;CVF.PageID=f||null;CVF.VersionID=e||null;$cvf("#"+CVF.Target).append("<div class='cv_loading_bar progress progress-loading'><div class='progress-bar progress-bar-striped active' role='progressbar' aria-valuenow='100' aria-valuemin='0' aria-valuemax='100' style='width:100%'><span>CV<\/span><\/div><\/div>");CVFUTL.IsFunction(i)&&(CVF.DataLoadCallback=i);CVF.Setup===null&&(CVF.Setup={Allocation:null,RuntimeOverrides:[]});CVF.LoadDataModel(!0)},BuildUrl:function(n){return n.substring(n.length-1,n.length)!=="/"&&(n+="/"),n},LoadDataModel:function(n){var i,r,t;try{i=CVF.DataSourceURL+"Form/GetModel/"+CVF.FormID;CVF.VersionID!==null&&(i+="/"+CVF.VersionID);r="";CVF.Setup!==null&&CVF.Setup.RuntimeOverrides.length>0&&(t=[],$cvf.each(CVF.Setup.RuntimeOverrides,function(n,i){CVF.HasVal(i,"RN")&&i.RN.indexOf("_lid")>-1&&t.push(i.VL);CVF.HasVal(i,"wz")&&(CVF.IsWizardMode=i.wz=="1");CVF.HasVal(i,"tr")&&(CVFR.IsTestRun=i.tr=="1");CVF.HasVal(i,"skpg")&&(CVFR.ProcessToGateway=i.skpg=="0")}),t.length>0&&(r="?exdls="+t.join(",")));CVF.ResolveQuery();$cvf.ajax({url:i+r}).done(function(t){CVF.OnDataLoadSuccess(t,n)}).fail(CVF.OnDataLoadFail)}catch(u){console.error(u);CVF.Render_MaintenanceSection()}},OnDataLoadSuccess:function(n,t){try{CVF.Model=JSON.parse(n.FormModel);CVF.AssignOriginalModel(CVF.Model);CVF.SetupModel()}catch(i){console.error(i);console.warn("Form Data Model appears to be invalid. Wrong Form ID or Account.");CVF.Render_MaintenanceSection();return}if(CVF.DataLists=n.DataLists,CVF.ThemeID=n.ThemeID,CVF.ValidToken=n.ValidToken,CVF.AccountID=n.AccountID,CVF.VersionID=n.VersionID,CVF.FormName=n.FormName,CVF.EventData=n.EventData,!CVF.ValidToken){console.warn("Account API token is invalid");CVF.Render_MaintenanceSection();return}t&&CVF.Make();CVF.DataLoadCallback!==null&&CVF.DataLoadCallback();CVFR.PayPalToken&&(CVFR.IsPayPalRecurring?CVF.GetPayPalAgreementDetailAndSubmit():CVF.GetPayPalOrderDetailAndSubmit())},AssignOriginalModel:function(n){CVF.IsDesignMode===!0&&(CVF.OriginalModel=$cvf.extend(!0,{},n))},OnDataLoadFail:function(n,t,i){console.error(i);CVF.Render_MaintenanceSection()},ResolveQuery:function(){var n=CVFUTL.ParseUrlParams(),t;n!==null&&(t={},$cvf.each(n,function(n,i){t[n.toLowerCase()]=i}),n=t,(CVF.HasVal(n,"cid")||CVF.HasVal(n,"fid"))&&(CVF.Setup.Allocation=CVF.CreateAllocationOverride(n.cid,n.fid)),CVF.HasVal(n,"wz")&&(CVF.IsWizardMode=n.wz==="1"),CVF.HasVal(n,"tr")&&(CVFR.IsTestRun=n.tr==="1"),CVF.HasVal(n,"skpg")&&(CVFR.ProcessToGateway=n.skpg==="0"),CVFR.HasPayPalToken(n)&&CVFR.MapPayPalToken(n),$cvf.each(n,function(n,t){if($cvf.inArray(n,["cid","fid","wz","tr"])>-1)return"break";CVF.Setup.RuntimeOverrides.push({RN:n,VL:t})}))},GetPayPalOrderDetailAndSubmit:function(){CVFR.ShowLoadingBar();var n={aid:CVF.AccountID,tkn:CVFR.PayPalToken};$cvf.ajax({url:CVF.DataSourceURL+"Form/GetPayPalOrderDetail",type:"post",timeout:5e3,data:n,success:function(n){CVFR.PayPalDetail=n;CVFR.Submit()},error:CVFR.ParseVortexResponseError})},GetPayPalAgreementDetailAndSubmit:function(){CVFR.ShowLoadingBar();var n={aid:CVF.AccountID,tkn:CVFR.PayPalToken};$cvf.ajax({url:CVF.DataSourceURL+"form/getpaypalagreementdetail",type:"post",timeout:5e3,data:n,success:function(n){CVFR.PayPalDetail=n;$cvf("input[data-field='cv_donationAmount']").val(CVFR.PayPalDetail.donation_profile.AMT);CVFR.Submit()},error:CVFR.ParseVortexResponseError})},SetupModel:function(){if(CVF.IsDesignMode!==!0&&CVF.Setup.Allocation!==null){var n=[];$cvf.each(CVF.Model.Attributes.Variables,function(t,i){CVF.HasVal(i,"DataField")&&i.DataField==="cv_allocation"||n.push(i)});$cvf.each(CVF.Setup.Allocation,function(t,i){n.push(i)});CVF.Model.Attributes.Variables=n}},Make:function(){if(CVF.LoadGoogleAnalytics(),CVF.AssignGatewayDetails(),CVF.B="",CVF.Add('<section id="donation-form"><div class="container-fluid">'),CVF.IsEventForm()){var n={ID:CVF.NewID(),DataField:"cv_event_ID",CValue:CVF.EventData.Event.Id};CVF.Render_Hidden(n);CVF.Render_Event_Header()}CVF.IsDesignMode===!0&&CVF.Model.Controls.length<1&&CVF.Render_DesignDropTarget(null,-1,null);CVF.InitWizardData();CVF.IsOutlineRenderMode===!0&&CVF.Add("<ul class='formoutlinecontainer'>");$cvf.each(CVF.Model.Controls,function(n,t){CVF.MakeFormControl(n,t,null)});CVF.IsOutlineRenderMode===!0&&CVF.Add("<\/ul>");$cvf.each(CVF.Model.Attributes.Variables,function(n,t){CVF.Render_Hidden(t)});CVF.Add("<\/div><\/section>");CVF.IsEventForm()&&CVF.Render_EventResult();CVF.Render_GatewayResult();CVF.Render_ProgressBar();CVF.Render_HtmlInTarget(CVF.B);CVF.Render_WizardStepBar();CVF.Render_WizardStepButtons();CVF.IsEventForm()&&CVF.IsZeroDollarPackageForm();CVFR.Init(CVF.VortexURI);CVF.MakeCallback!=null&&CVF.MakeCallback();CVF.CallCustomScript()},IsZeroDollarPackageForm:function(){for(var f,n,e,o="#"+CVF.Target,i=0,r=$cvf(o+" select.event-package-quantity"),u=$cvf("[data-field='cv_paymentType']").closest("div.well"),s=$cvf(u).attr("data-wzstep"),t=0;t<r.length;t++)(f=$cvf(r[t]),n=CVF.FindEventPackageById(f.attr("data-id")),n!==null&&n.IsExpired!==!0)&&(e=CVFR.RoundNumberTo(n.Cost,2),i+=e);i<=0&&($cvf("[data-tostep='"+s+"']").hide(),u.hide())},NewID:function(){return CVF.AutoID++,CVF.CIDPrefix+CVF.AutoID},AdjustMaxCID:function(n){if(n!=null)try{var t=Number(n.replace(CVF.CIDPrefix,""));t>CVF.AutoID&&(CVF.AutoID=t+1)}catch(i){console.log("AdjustMaxCID failed:");console.error(i)}},ResetAutoID:function(){CVF.AutoID=0},CallCustomScript:function(){try{CVF_Custom_Script()}catch(n){console.warn("Custom form script encountered an error:");console.error(n)}},CleanContent:function(n,t){return(t===undefined&&(t=!1),typeof n!="string")?n:CVFUTL.HasContent(n)?(n=n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),t||(n=n.replace(/'/g,"&#39;").replace(/"/g,"&#34;")),n):""},CleanSubmissionContent:function(n,t){return(t===undefined&&(t=!1),typeof n!="string")?n:CVFUTL.HasContent(n)?(t||(n=n.replace(/'/g,"&#39;").replace(/"/g,"&#34;")),n):""},UnEscapeContent:function(n){return typeof n!="string"?n:CVFUTL.HasContent(n)?n.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">"):""},PropertySafeValue:function(n){return CVFUTL.HasContent(n)?isNaN(n)?CVF.CleanContent(n).replace("'","&#39"):n:""},GetMessageFromModel:function(n,t){var r=t,i;return CVF.HasVal(CVF.Model.Attributes.Messages,n)&&(i=CVF.PropertySafeValue(CVF.Model.Attributes.Messages[n]),CVFUTL.HasContent(i)&&(r=i)),r},HasVal:function(n,t){return n==null?!1:n.hasOwnProperty(t)?n[t]==null||n[t]===""?!1:!0:!1},PushPropValToArray:function(n,t,i,r,u){if(CVF.HasVal(t,i)){r===undefined&&(r="");u===undefined&&(u="");var f=CVF.PropertySafeValue(t[i]);f!=null&&f!=""&&n.push(r+f+u)}},Add:function(n){CVF.B+=n},FindDataListItems:function(n){if(CVF.DataLists==null||CVF.DataLists.length<1)return[];var t=CVF.FindDataList(n);return t!=null?t.Items:[]},FindDataList:function(n){var i,t,r;if(CVF.DataLists==null||CVF.DataLists.length<1)return null;for(i=null,t=0;t<CVF.DataLists.length;t++)if(r=CVF.DataLists[t],r.ID==n){i=r;break}return i},SetDataList:function(n){for(var i,t=0;t<CVF.DataLists.length;t++)if(i=CVF.DataLists[t],i.ID==n.ID){i.Items=n.Items;break}},FindKeyInVariables:function(n){var r=null,t,i;if(CVFUTL.IsInitialized(CVF.Model))for(t=0;t<CVF.Model.Attributes.Variables.length;t++)if(i=CVF.Model.Attributes.Variables[t],i.hasOwnProperty("DataField")&&i.DataField===n){r=i;break}return r},SetKeyInVariables:function(n,t,i){var r=CVF.FindKeyInVariables(n);r!==null?r.CValue=t:(r={DataField:n,CValue:t},CVF.Model.Attributes.Variables.push(r));CVFUTL.IsInitialized(i)&&$cvf.isFunction(i)&&i()},FindControlInModel:function(n){return CVF.FindControlInCollection(n,CVF.Model.Controls)},FindControlInCollection:function(n,t){var i=null;return $cvf.each(t,function(t,r){if(r.ID==n)return i=r,"break";if(r.hasOwnProperty("Controls")&&r.Controls!=null&&r.Controls.length>0){var u=CVF.FindControlInCollection(n,r.Controls);if(u!=null)return i=u,"break"}}),i},FindEventPackageById:function(n){var r=null,t,i;if(CVF.IsEventForm())for(n=parseInt(n),t=0;t<CVF.EventData.Packages.length;t++)if(i=CVF.EventData.Packages[t],i.Id===n){r=i;break}return r},InitWizardData:function(){CVF.IsWizardMode===!0&&(CVF.WizardSteps=[],CVF.WizardMaxSteps=0,$cvf.each(CVF.Model.Controls,function(n,t){if(t.constructor===Array)return!0;t.CType=="WellFormGroup"&&(CVF.HasVal(t,"IsNotNewStep")&&t.IsNotNewStep!==!1||CVF.WizardMaxSteps++)}))},MakeFormControl:function(n,t,i){if(t.constructor===Array){for(var r=0;r<t.length;r++)CVF.MakeFormControl(n,t[r],null);return}CVF.IsDesignMode===!0&&n===0&&CVF.Render_DesignDropTarget(t,-1,i);CVF.RuntimeControlOverride(t);CVF.RenderOutlineWrapItemOpen(t);switch(t.CType){case"WellFormGroup":CVF.Render_WellForm(t);break;case"FormGroupLine":CVF.Render_FormGroupLine(t);break;case"Label":CVF.Render_Label(t);break;case"InputText":CVF.Render_InputText(t);break;case"Hidden":CVF.Render_Hidden(t);break;case"Dropdown":CVF.RuntimeListOverride(t);CVF.Render_DropDown(t);break;case"CVFormSubmit":CVF.Render_SubmitButton(t);break;case"CVFromTitle":CVF.Render_FormHeader(t);break;case"DivPanel":case"DivGroupPanel":console.error("Deprecated CType 'DivPanel' render is disabled!");break;case"Checkbox":CVF.Render_Checkbox(t);break;case"ToggleButtonGroup":CVF.RuntimeListOverride(t);CVF.Render_ToggleButtonGroup(t);break;case"ReCaptcha":CVF.Render_ReCaptcha(t);break;case"TextArea":CVF.Render_TextArea(t);break;case"Image":CVF.Render_Image(t);break;case"EventPackages":CVF.Render_Event_Packages(t);break;case"EventOptionalDonation":CVF.Render_Event_OptionalDonation(t);break;case"EventPromoCodes":CVF.Render_Event_PromoCodes(t);break;case"EventAmountTotal":CVF.Render_Event_AmountTotal(t);break;default:console.error("Make Form Control fails to find renderer for the following control:");console.error(t)}CVF.RenderOutlineWrapItemClose();CVF.IsDesignMode===!0&&CVF.Render_DesignDropTarget(t,n,i)},RenderOutlineWrapItemOpen:function(n){var t,i;CVF.IsOutlineRenderMode===!0&&(t=2,$cvf.inArray(n.CType,["CVFromTitle","WellFormGroup","CVFormSubmit"])>-1?t=0:n.CType=="FormGroupLine"&&(t=1),i=["outlineitemli"],CVF.PushPropValToArray(i,n,"HSize","col-sm-"),CVF.Add("<li "),CVF.AttachCss_WriteAttributes(i,null),CVF.Add(" data-ctype='"+n.CType+"' data-cid='"+n.ID+"' data-outlinelevel='"+t+"'"),CVF.AttachProp_VisibilityGroup(n),CVF.AttachProp_VisibilityTrigger(n),n.CType=="Hidden"&&CVF.Add(" data-outlinenoshow='1' "),CVF.Add(">"),CVF.Add("<em class='outlineDragHandle'><\/em>"))},RenderOutlineWrapItemClose:function(){CVF.IsOutlineRenderMode===!0&&CVF.Add("<\/li>")},RenderOutlineWrapCollectionOpen:function(n,t){CVF.IsOutlineRenderMode===!0&&CVF.Add("<ul class='outlinecollectionul form-group' data-ctype='"+n.CType+"' data-cid='"+n.ID+"' data-connectWith='"+t+"' >")},RenderOutlineWrapCollectionClose:function(){CVF.IsOutlineRenderMode===!0&&CVF.Add("<\/ul>")},Render_WellForm:function(n){CVF.Add("<div");CVF.AttachProp_Css(n,["well"]);CVF.AttachProp_CID(n);CVF.AttachWizardStep(n,!1);CVF.AttachProp_VisibilityGroup(n);CVF.AttachProp_ControlOutline(n);CVF.Add(">");CVF.Add('<form class="form-horizontal">');CVF.RenderOutlineWrapCollectionOpen(n,"sections");$cvf.each(n.Controls,function(t,i){CVF.MakeFormControl(t,i,n.ID)});CVF.RenderOutlineWrapCollectionClose();CVF.Add("<\/form>");CVF.Render_DesginDropTargetSection(n);CVF.Add("<\/div>")},Render_FormGroupLine:function(n){CVF.IsOutlineRenderMode?(CVF.AttachProp_CID_NoBuffer(n),CVF.RenderOutlineWrapCollectionOpen(n,"lines")):(CVF.Add("<div"),CVF.AttachProp_Css(n,["form-group"]),CVF.AttachProp_CID(n),CVF.AttachProp_VisibilityGroup(n),CVF.AttachProp_ControlOutline(n),CVF.Add(" >"));$cvf.each(n.Controls,function(t,i){CVF.MakeFormControl(t,i,n.ID)});CVF.IsOutlineRenderMode?CVF.RenderOutlineWrapCollectionClose():CVF.Add("<\/div>")},Render_DivPanel:function(){console.error("DivPanel CType is no longer supported!");return},Render_Label:function(n){CVF.Add("<label ");CVF.AttachProp_CID(n);CVF.AttachProp_ControlOutline(n);CVF.AttachProp_VisibilityGroup(n);CVF.AttachProp_DataFields(n);var t=["control-label"],i=CVF.HasVal(n,"FieldPlugin")&&n.FieldPlugin==="richtextlabel"&&CVF.HasVal(n,"PluginConfig");n.hasOwnProperty("IsRequired")&&n.IsRequired===!0&&t.push("required");i&&t.push("clear-style");CVF.AttachProp_Css(n,t,null,CVF.IsOutlineRenderMode);n.hasOwnProperty("ForID")&&CVF.Add(' for="'+n.ForID+'"');CVF.AttachProp_HelpText(n);CVF.Add(">");i?CVF.Add(decodeURI(n.PluginConfig.richtextcontent)):CVF.Add(CVF.CleanContent(n.Content));CVF.Add("<\/label>")},Render_AttachedLabel:function(n){if(CVF.HasVal(n,"LabelText")){CVF.Add("<label ");var t=["control-label"],i=!1;CVF.HasVal(n,"ShowLabel")&&(n.ShowLabel==1?(i=!0,t.push("interLabelAbove"),CVF.HasVal(n,"LabelStyleAlign")&&t.push("label-align")):n.ShowLabel==2?t.push("interLabelLeft"):n.ShowLabel==3&&t.push("interLabelRight"));n.hasOwnProperty("IsRequired")&&n.IsRequired===!0&&t.push("required");CVF.AttachProp_CssBindedLabel(n,t,null,i);CVF.Add(' for="'+n.ID+'"');CVF.AttachProp_HelpText(n);CVF.Add(">");CVF.Add(CVF.CleanContent(n.LabelText));CVF.Add("<\/label>")}},Render_InputText:function(n){var h=n.hasOwnProperty("HSize"),t=CVF.HasVal(n,"ShowLabel")&&n.ShowLabel>0,e=12,i="",s=!0,r=CVF.HasVal(n,"FieldPlugin")&&(n.FieldPlugin==="datepicker"||n.FieldPlugin==="ukddstartdate"),o,u,f;CVF.Add("<div ");(h||CVF.IsDesignMode===!0)&&!CVF.IsOutlineRenderMode&&CVF.HasVal(n,"HSize")&&CVF.Add(' class="col-sm-'+n.HSize+'"');CVF.AttachProp_ControlOutline(n);CVF.AttachProp_VisibilityGroup(n);CVF.Add(">");t&&(n.ShowLabel!=1?(CVF.HasVal(n,"LabelHSize")&&(e-=n.LabelHSize),CVF.HasVal(n,"InputHSize")&&(e=n.InputHSize)):s=!1,n.ShowLabel==1?(CVF.Render_AttachedLabel(n),i="interLabelAboveInput"):n.ShowLabel==2?(i="interLabelLeftInput",CVF.Render_AttachedLabel(n)):n.ShowLabel==3&&(i="interLabelRightInput"));t&&(s?CVF.Add('<div class="col-sm-'+e+" "+i+'">'):CVF.Add('<div class="'+i+'">'));r&&CVF.Add("<div class='input-group'>");o=CVF.HasVal(n,"FieldPlugin")&&n.FieldPlugin==="inputbutton";o&&CVF.Add("<div class='input-group'>");CVF.Add("<input ");CVF.AttachProp_CID(n);u="text";n.hasOwnProperty("InputType")&&(u=CVF.ResolveInputType(n.InputType));n.hasOwnProperty("ValidationRule")&&(n.ValidationRule=="PhoneNumber"||n.ValidationRule=="10")&&(u="tel");CVF.Add('type="'+u+'"');n.hasOwnProperty("AutoComp")&&(CVF.Add(' autocomplete="'+n.AutoComp+'"'),CVF.Add(' autocomplete-org-val="'+n.AutoComp+'"'));r&&CVF.Add(" readonly");CVF.AttachProp_Css(n,["form-control","control-validate"],[],t);CVF.AttachProp_DataFields(n);CVF.AttachProp_Placeholder(n);n.hasOwnProperty("CValue")&&CVF.Add(' value="'+n.CValue+'"');CVF.AttachProp_Validation(n);CVF.Add(" />");r&&(CVF.Add("<div class='input-group-btn'>"),f=["btn","btn-default","btn-datepicker"],CVF.HasVal(n,"CssClass")&&(n.CssClass.indexOf("hide")>-1?f.push("hide"):n.CssClass.indexOf("hidden")>-1&&f.push("hidden")),CVF.Add("<button type='button'"),CVF.AttachCss_WriteAttributes(f),CVF.Add(" data-for='"+n.ID+"'>"),CVF.Add("<span class='glyphicon glyphicon-calendar'><\/span>"),CVF.Add("<\/button><\/div>"));o&&(CVF.Add("<span class='input-group-btn'>"),CVF.Add("<button class='btn btn-primary' type='button' id='"+n.PluginConfig.buttonid+"'>"+n.PluginConfig.buttontext+"<\/button>"),CVF.Add("<\/span>"),CVF.Add("<\/div>"));t&&CVF.Add("<\/div>");r&&CVF.Add("<\/div>");t&&n.ShowLabel==3&&CVF.Render_AttachedLabel(n);CVF.Render_OutlineEventProtector();CVF.Add("<\/div>")},Render_Hidden:function(n){CVF.Add("<input type='hidden' class='control-validate'");CVF.AttachProp_DataFields(n);CVF.AttachProp_CID(n);var t="";CVFUTL.IsInitialized(n.CValue)&&(t=n.CValue);CVF.Add(' value="'+t+'" />')},Render_DropDown:function(n){var r=n.hasOwnProperty("HSize"),i=CVF.HasVal(n,"ShowLabel")&&n.ShowLabel!=0,u=12,t="",f=!0;(r||CVF.IsDesignMode===!0)&&(CVF.Add("<div "),CVF.HasVal(n,"HSize")&&!CVF.IsOutlineRenderMode&&CVF.Add(' class="col-sm-'+n.HSize+'"'),CVF.AttachProp_CID(n),CVF.AttachProp_ControlOutline(n),CVF.AttachProp_VisibilityGroup(n),CVF.Add(">"));n.ShowLabel==1?(f=!1,t="interLabelAboveInput",CVF.Render_AttachedLabel(n)):n.ShowLabel==2?(t="interLabelLeftInput",CVF.Render_AttachedLabel(n)):n.ShowLabel==3&&(t="interLabelRightInput");i&&(f==!0?(CVF.HasVal(n,"LabelHSize")&&(u-=n.LabelHSize),CVF.HasVal(n,"InputHSize")&&(u=n.InputHSize),CVF.Add('<div class="col-sm-'+u+" "+t+'">')):CVF.Add('<div class="'+t+'">'));CVF.Add("<select ");CVF.AttachProp_Css(n,["form-control","control-validate"],[],i);r||CVF.AttachProp_CID(n);CVF.Add(" data-id='"+n.ID+"'");CVF.AttachProp_Validation(n);CVF.AttachProp_DataFields(n);CVF.AttachProp_VisibilityTrigger(n);CVF.Add(">");CVF.Add(CVF.BuildOptionListFromDataList(n));CVF.Add("<\/select>");i&&CVF.Add("<\/div>");i&&n.ShowLabel==3&&CVF.Render_AttachedLabel(n);CVF.Render_OutlineEventProtector();(r||CVF.IsDesignMode===!0)&&CVF.Add("<\/div>")},Render_Checkbox:function(n){CVF.Add("<div ");CVF.AttachProp_Css(n,["checkbox"],null,CVF.IsOutlineRenderMode);CVF.AttachProp_CID(n);CVF.AttachProp_ControlOutline(n);CVF.AttachProp_VisibilityGroup(n);CVF.Add(">");CVF.Add('<label class="control-label">');CVF.Add('<input class="pointer control-validate" type="checkbox"');n.hasOwnProperty("CValue")&&n.CValue===!0&&CVF.Add(' checked="checked" ');CVF.AttachProp_Validation(n);CVF.AttachProp_VisibilityTrigger(n);CVF.AttachProp_DataFields(n);CVF.Add(" />");CVF.Add(CVF.CleanContent(n.Content));CVF.Add("<\/label>");CVF.Render_OutlineEventProtector();CVF.Add("<\/div>")},Render_ToggleButtonGroup:function(n){var h=CVF.HasVal(n,"ShowLabel")&&n.ShowLabel!=0,o=12,u="",s=!1,i,r,f,t,e;for(CVF.Add("<div "),CVF.HasVal(n,"HSize")&&!CVF.IsOutlineRenderMode&&CVF.Add(' class="col-sm-'+n.HSize+'"'),CVF.AttachProp_CID(n),CVF.AttachProp_ControlOutline(n),CVF.AttachProp_VisibilityGroup(n),CVF.Add(">"),n.ShowLabel==1?(u="interLabelAboveInput",CVF.Render_AttachedLabel(n)):n.ShowLabel==2?(u="interLabelLeftInput",CVF.Render_AttachedLabel(n),s=!0):n.ShowLabel==3&&(u="interLabelRightInput",s=!0),h&&s===!0&&(CVF.HasVal(n,"LabelHSize")&&(o-=n.LabelHSize),CVF.HasVal(n,"InputHSize")&&(o=n.InputHSize)),CVF.Add("<div "),CVF.AttachProp_Css(n,["btn-toolbar","col-sm-"+o,u],[],!0),CVF.Add(">"),CVF.Add('<div class="btn-group btn-group-responsive" data-toggle="buttons" data-toggleGroupCID="'+n.ID+'">'),i=n.CValue||"",r=CVF.FindDataListItems(n.ItemListID),CVFUTL.HasValues(r)||r.push({Label:"No Items",DataKey:"0",IsSelected:!0}),f=0;f<r.length;f++)t=r[f],e="",i==""&&t.IsSelected?(e=" active",i=t.DataKey):i==t.DataKey&&(e=" active"),CVF.Add('<label class="btn btn-primary'+e+'">'),CVF.Add('<input type="radio" name="radio_'+n.ID+'" value="'+t.DataKey+'" />'+t.Label),CVF.Add("<\/label>");CVF.Add("<\/div>");CVF.Add('<input type="hidden" class="control-validate"');CVF.HasVal(n,"OrgItemListID")||(n.OrgItemListID=n.ItemListID);CVF.AttachProp_Validation(n);CVF.AttachProp_DataFields(n);CVF.AttachProp_VisibilityTrigger(n);CVF.Add(' value="'+i+'" data-toggleGroupCID="'+n.ID+'" />');CVF.Add("<\/div>");h&&n.ShowLabel===3&&CVF.Render_AttachedLabel(n);CVF.Render_OutlineEventProtector();CVF.Add("<\/div>")},Render_FormHeader:function(n){CVF.Add("<div ");CVF.AttachProp_CID(n);CVF.AttachProp_Css(n,["page-header","form-section"]);CVF.AttachProp_ControlOutline(n);CVF.AttachProp_VisibilityGroup(n);CVF.Add(">");CVF.Add("<p>"+CVF.CleanContent(n.Content)+"<\/p>");CVF.Add("<\/div>");CVF.Render_OutlineEventProtector()},Render_DesignDropTarget:function(n,t,i){if(CVF.IsDesignMode!==!1){var r="div";CVF.IsOutlineRenderMode&&(r="li");n==null?CVF.Add("<"+r+" class='designerDropTargetMark designerDropTargetSection' data-insertat='-1' data-targetinsertid='null' data-addparentid='null'>Add Section Here<\/"+r+">"):$cvf.inArray(n.CType,["WellFormGroup","CVFormSubmit","CVFromTitle","DivGroupPanel"])>-1&&CVF.Add("<"+r+" class='designerDropTargetMark designerDropTargetSection' data-insertat='"+t+"' data-targetinsertid='"+n.ID+"' data-addparentid='"+i+"'>Add Section Here<\/"+r+">")}},Render_DesginDropTargetSection:function(n){CVF.IsDesignMode===!0&&CVF.Add("<div class='designerDropTargetMark designerDropTargetLine' data-insertat='-1' data-targetinsertid='null' data-addparentid='"+n.ID+"'>Add Here With A New Row<\/div>")},Render_SubmitButton:function(n){var t,i;CVF.Add("<form><div ");CVF.AttachProp_CID(n);CVF.AttachWizardStep(n,!0);CVF.Add(" class='form-group form-section submit-button-container");t=n.StyleAlign;CVF.HasVal(n,"StyleAlign")&&(CVF.Add(" text-align-"+t),n.StyleAlign=null);CVF.Add("'");CVF.AttachProp_ControlOutline(n);CVF.AttachProp_VisibilityGroup(n);CVF.Add(" >");CVF.Add('<button type="button" ');CVF.AttachProp_Css(n,["btn","btn-success","btn-lg"]);n.StyleAlign==null&&(n.StyleAlign=t);i=CVF.CleanContent(n.Content);CVF.Add(' data-originaltitle="'+i+'" id= "cvf_submit">'+i+"<\/button > ");CVF.Add("<\/div><\/form>");CVF.Render_OutlineEventProtector()},Render_GatewayResult:function(){CVF.Add('<section id="gateway-result" style="display:none;">');CVF.Add("<div class='container-fluid page-header'>");CVF.Add("<h2>"+CVF.GetMessageFromModel("Thankyou","Thank You!")+"<\/h2>");var n="Your donation has successfully been processed.";CVFR.ProcessToGateway===!1&&(n="Your submission has successfully been processed.");CVF.Add('<div class="alert alert-success alert-capped">'+CVF.GetMessageFromModel("OkMessage",n)+"<\/div>");CVF.Add("<div class='alert alert-info alert-capped' id='gateway-result-ids-container'><\/div>");CVF.Add("<div class='alert alert-success alert-capped' id='gateway-result-success-url-container' style='display:none;'><\/div>");CVF.Add("<\/div>");CVF.Add("<\/div><\/section>")},Render_EventResult:function(){var n,t;CVF.IsEventForm()&&(n=CVF.CleanContent(CVF.EventData.Event.Name),CVF.Add('<section id="event-result" style="display:none;">'),CVF.Add("<div class='container-fluid page-header'>"),CVF.Add("<h2 id='event-success-header' class='event-success-header'>your registration for "+n+" is complete!<\/h2>"),CVF.Add("<div id='event-result-container'>"),CVF.Add("<div id='event-result-header'>"),CVF.Add("<div class='row'>"),CVF.Add("<label class='col-xs-12 control label event-title no-pad'>"+n+"<\/label>"),CVF.Add("<\/div>"),CVF.Add("<div class='row'>"),CVF.Add("<div class='col-xs-6 event-item-label'>"+CVFR.FormatDateForDisplay(new Date(CVF.EventData.Event.StartDate))+"<\/div>"),CVF.Add("<div class='col-xs-6 event-item-label'>"+CVFR.BuildEventLocationLink()+"<\/div>"),CVF.Add("<\/div>"),CVF.Add("<div class='row'>"),CVF.Add("<div class='col-xs-12'>"),t=CVF.CleanContent(CVF.EventData.Event.Description),CVFUTL.HasContent(CVF.EventData.Event.EmailDescription)&&(t=decodeURI(CVF.EventData.Event.EmailDescription)),CVF.Add("<p class='event-item-label event-description'>"+t+"<\/p>"),CVF.Add("<\/div>"),CVF.Add("<\/div>"),CVF.Add("<\/div>"),CVF.Add("<div id='event-result-body'>"),CVF.Add("<\/div>"),CVF.Add("<\/div>"),CVF.IsInDesignMode()||(CVF.Add("<div id='event-result-guest-container'>"),CVF.Add("<div class='row'>"),CVF.EventData.Event.IsAttachTicket?CVF.Add("<label class='col-sm-12'>An email has been sent with your <span id='event-email-ticket-text'>ticket<\/span>, click below to enter your guest information and manage your order.<\/label>"):CVF.Add("<label class='col-sm-12'>An email purchase confirmation will be sent, click below to enter your guest information and manage your order.<\/label>"),CVF.Add("<\/div>"),CVF.Add("<div class='row'>"),CVF.Add("<div class='col-sm-12'><button type='button' id='btn-event-guest-registration' class='btn btn-primary'>Manage Attendance<\/button><\/div>"),CVF.Add("<\/div>"),CVF.Add("<\/div>")),CVF.Add("<div id='event-result-footer'>"),CVF.Add("<span><a class='link' href='https://www.causeview.com/event-management/' target='_blank' rel='noopener noreferrer'>Powered by Causeview Events<\/a><\/span>"),CVF.Add("<\/div>"),CVF.Add("<\/div><\/section>"))},Render_MaintenanceSection:function(){var n="<div class='container-fluid'>",t,i;n+="<div class='page-header'>";t="Form Maintenance";i="The form you have requested is currently not available or under maintenance, please check back in a while. Thank you.";CVFUTL.IsInitialized(CVF.Model)&&(i=CVF.GetMessageFromModel("FormMaintenance",i),t=CVF.GetMessageFromModel("FormMaintenanceTitle",t));n+="<h2>"+t+"<\/h2>";n+="<div class='alert alert-danger' style='max-width:400px;'><p>"+i+"<\/p>";n+="<\/div><\/div><\/div>";CVF.Render_HtmlInTarget(n);CVFR.RemoveLoading()},Render_ProgressBar:function(){CVF.Add('<div id="form-loading-bar" class="progress">');CVF.Add('<div class="progress-bar progress-bar-warning progress-bar-striped active" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style= "width:100%;">');CVF.Add(CVF.GetMessageFromModel("Processing","Processing..."));CVF.Add('<\/div><\/div><div id="form-backdrop"><\/div>')},Render_ReCaptcha:function(n){CVF.IsOutlineRenderMode===!1&&$cvf.get(CVF.DataSourceURL+"Google/LoadRecaptcha",function(t){var i,r;t.hasOwnProperty("SiteKey")&&t.SiteKey!==null&&t.SiteKey!==undefined&&t.SiteKey!==""?($cvf("#"+n.ID).attr("data-sitekey",t.SiteKey),i=$cvf("script[src*='recaptcha']"),i.length>0&&i.remove(),r="",n.Language&&(r="&hl="+n.Language),CVF.AttachScriptTag(t.Url+"?onload=ReCaptchaCallback&render=explicit"+r,["async","defer"])):console.error("Unable to load ReCaptcha config: "+t)});CVF.Add("<div ");n.IsRequired=!0;CVF.AttachProp_Css(n,["control-validate","g-recaptcha"]);CVF.AttachProp_Validation(n);CVF.AttachProp_DataFields(n);CVF.AttachProp_CID(n);CVF.IsOutlineRenderMode===!0?CVF.Add("><img class='recaptcha-placeholder' src='https://s3.amazonaws.com/cv-impact-static/recaptcha_placeholder.png'>"):CVF.Add(" data-sitekey='' data-field='recaptcha' data-g-recaptcha-resp='' data-g-recaptcha-valid='false'>");CVF.Add("<\/div>");CVF.Render_OutlineEventProtector()},Render_HtmlInTarget:function(n){$cvf("#"+CVF.Target).empty().append(n);CVF.B=""},Render_WizardStepBar:function(){if(CVF.IsWizardMode===!0){var n="<div class='wzstepsinfonpanel'><ul>";$cvf.each(CVF.WizardSteps,function(t,i){n+="<li data-toStep='"+(t+1)+"'><span class='glyphicon glyphicon-ok-circle'><\/span> "+i.Title+"<\/li>"});n+="<\/ul><\/div>";n+="<div class='wzstepdescription'><\/div>";$cvf("#"+CVF.Target+" .well[data-wzstep=1]").first().before(n)}},Render_WizardStepButtons:function(){if(CVF.IsWizardMode===!0){var n=0;$cvf("#"+CVF.Target+" .well[data-wzstep]").each(function(){var t=$cvf(this).attr("data-wzstep"),i;if(t===undefined||isNaN(t)||n==t)return!0;(n=Number(t),i=n-1,i<1)||$cvf(this).before(CVF.Render_WizardButtonPanel(i))});$cvf("#"+CVF.Target+" .well[data-wzstep]").last().after(CVF.Render_WizardButtonPanel(CVF.WizardMaxSteps))}},Render_WizardButtonPanel:function(n){var t="<div class='wzstepbuttonpanel' data-wzStep='"+n+"'>";return n>1&&(t+='<button type="button" data-toStep="'+(n-1)+'" class="btn btn-default actWizardSwitchStep actWizardSwitchStepBack left">',t+=CVF.GetMessageFromModel("WizardBackButton","Back")+"<\/button>"),n<CVF.WizardMaxSteps&&(t+='<button type="button" data-toStep="'+(n+1)+'" class="btn btn-default actWizardSwitchStep actWizardSwitchStepNext right">',t+=CVF.GetMessageFromModel("WizardNextButton","Next")+"<\/button>"),t+"<\/div>"},Render_TextArea:function(n){var f=n.hasOwnProperty("HSize"),t=CVF.HasVal(n,"ShowLabel")&&n.ShowLabel!=0,r=12,i="",u=!0;CVF.Add("<div ");(f||CVF.IsDesignMode===!0)&&!CVF.IsOutlineRenderMode&&CVF.HasVal(n,"HSize")&&CVF.Add(' class="col-sm-'+n.HSize+'"');CVF.AttachProp_ControlOutline(n);CVF.AttachProp_VisibilityGroup(n);CVF.Add(">");t&&(n.ShowLabel!=1?(CVF.HasVal(n,"LabelHSize")&&(r-=n.LabelHSize),CVF.HasVal(n,"InputHSize")&&(r=n.InputHSize)):u=!1,n.ShowLabel==1?(CVF.Render_AttachedLabel(n),i="interLabelAboveInput"):n.ShowLabel==2?(i="interLabelLeftInput",CVF.Render_AttachedLabel(n)):n.ShowLabel==3&&(i="interLabelRightInput"));t&&(u===!0?CVF.Add('<div class="col-sm-'+r+" "+i+'">'):CVF.Add('<div class="'+i+'">'));CVF.Add("<textarea ");CVF.AttachProp_CID(n);CVF.AttachProp_Css(n,["form-control","control-validate"],[],t);CVF.AttachProp_DataFields(n);CVF.AttachProp_Placeholder(n);CVF.AttachProp_Validation(n);CVF.Add(">");n.hasOwnProperty("CValue")&&CVF.Add(n.CValue);CVF.Add("<\/textarea>");t&&CVF.Add("<\/div>");t&&n.ShowLabel==3&&CVF.Render_AttachedLabel(n);CVF.Render_OutlineEventProtector();CVF.Add("<\/div>")},Render_Image:function(n){var t=[];t.push("min-width:"+n.Width+"px");t.push("min-height:"+n.Height+"px");t.push("height:"+n.Height+"px");n.ImgAlign==="Left"?t.push("float: left"):n.ImgAlign==="Right"?t.push("float: right"):(t.push("display: block"),t.push("margin-left: auto"),t.push("margin-right: auto"));CVF.Add('<div class="col-sm-'+n.HSize+'"><a');CVF.HasVal(n,"Href")&&CVF.Add(" href='"+CVFUTL.PrepareUrl(n.Href,!1)+"' target='_blank'");CVF.Add('><img src="'+n.ImgUrl+'"');CVF.AttachCss_WriteAttributes([],t);CVF.Add("><\/img><\/a><\/div>")},Render_Event_Header:function(){CVF.IsEventForm()&&(CVF.Add("<div class='event-container'>"),CVF.Add("<div class='row'>"),CVF.Add("<div class='col-md-7 col-sm-12 no-pad'>"),CVF.Add("<img id='event-image' src='"+CVF.DataSourceURL+"Page/Image/"+CVF.EventData.Event.ImageAssetId+"' class='img-responsive'>"),CVF.Add("<\/div>"),CVF.Add("<div class='col-md-5 col-sm-12 no-pad-md-l'>"),CVF.Add("<div class='row no-mar'>"),CVF.Add("<label class='col-xs-12 event-item-label event-date no-pad'>"+CVFR.FormatDateForDisplay(new Date(CVF.EventData.Event.StartDate))+"<\/label>"),CVF.Add("<\/div>"),CVF.Add("<div class='row no-mar no-pad-r'>"),CVF.Add("<label class='col-xs-12 control-label event-title no-pad'>"+CVF.CleanContent(CVF.EventData.Event.Name)+"<\/label>"),CVF.Add("<\/div>"),CVF.Add("<div class='row no-mar text-left'>"),CVF.Add("<label class='col-xs-12 event-item-label no-pad'>"+CVFR.BuildEventLocationLink()+"<\/label>"),CVF.Add("<\/div>"),CVF.Add("<div class='row no-mar text-left'>"),CVF.Add("<p class='col-xs-12 event-item-label no-pad event-description' id='event-description'>"+CVF.CleanContent(CVFUTL.TruncateString(CVF.EventData.Event.Description,CVFR.EventDescriptionBreakLength))+"<\/p>"),CVF.Add("<\/div>"),CVF.EventData.Event.Description.length>=CVFR.EventDescriptionBreakLength&&(CVF.Add("<div class='row no-mar no-pad-l'><button id='event-description-toggle'>Show More<\/button>"),CVF.Add("<\/div>")),CVF.Render_OutlineEventProtector(),CVF.Add("<\/div>"),CVF.Add("<\/div>"),CVF.Add("<\/div>"))},Render_Event_Packages:function(){var f,n,r,h,e,a,o,t,c,i,s,u,v,y,l;if(CVF.IsEventForm()){for(CVF.Add("<div class='col-xs-12 event-packages-container'>"),CVF.Add("<div data-field='cv_event_packages' data-ignore='true'>"),CVF.Add("<h3 class='event-packages-title text-xs-center'>"+CVF.GetMessageFromModel("EventPackagesTicketTitle","Choose a Ticket")+"<\/h3>"),f=0;f<CVF.EventData.Packages.length;f++)if(n=CVF.EventData.Packages[f],n.OnSale){if(r=!1,h=n.SaleExpiry!==CVFUTL.MinDate,h&&(e=CVFUTL.NewUtcDate(n.SaleExpiry),e.setDate(e.getDate()+1),a=new Date,r=CVFR.IsDateExpired(a,e)),o=!1,r||(t=CVFR.GetPackageSummaryById(n.Id),t!==null&&(o=t.Count>=t.NumberOfTickets)),c=n.Cost,c=n.Cost<=0?"Free":CVFR.FormatCurrencyForDisplay(n.Cost),CVF.Add("<div class='event-package'>"),CVF.Add("<div class='row'>"),CVF.Add("<div class='col-xs-8'>"),CVF.Add("<div>"),CVF.Add("<label class='package-title'>"+n.Name+"<\/label>"),CVF.Add("<\/div>"),CVF.Add("<label class='package-value'>"+c+"<\/label>"),CVF.Add("<\/div>"),CVF.Add("<div class='col-xs-4 event-quantity-container'>"),o)CVF.Add("<div class='package-sold-out'>SOLD OUT<\/div>");else if(!r){for(CVF.Add("<select class='event-package-quantity' data-id='"+n.Id+"'>"),i=t.NumberOfTickets-t.Count,s=50,i<s&&(s=i),u=0;u<=s;u++)CVF.Add("<option value='"+u+"'>"+u+"<\/option>");CVF.Add("<\/select>");i<11&&(CVF.Add("<div class='col-xs-12 no-pad text-center'>"),v=CVFUTL.AppendPlural("package",i),CVF.Add("<span class='pull-right packages-left'>"+i+" "+v+" left<\/span>"),CVF.Add("<\/div>"))}CVF.Add("<\/div>");CVF.Add("<\/div>");CVF.Add("<div class='row event-description-container' style='display:none;' data-package-id='"+n.Id+"'>");y=CVFUTL.AppendPlural("Ticket",n.NumberOfAttendees);CVF.Add("<span class='col-xs-12'>"+n.NumberOfAttendees+" "+y+" included in purchase<\/span>");CVF.Add("<span class='col-xs-12 event-description-content'>"+n.Description+"<\/span>");CVF.Add("<\/div>");CVF.Add("<div class='row'>");CVF.Add("<div class='col-xs-4 no-pad-l'>");CVF.Add("<button type='button' class='event-package-show-info pull-left' data-target-id='"+n.Id+"'>Show Info<\/button>");CVF.Add("<\/div>");h&&!o&&(CVF.Add("<div class='col-xs-8'>"),l="Expires",r&&(l="Expired"),CVF.Add("<span class='pull-right'>"+l+": "+CVFR.FormatDateForDisplay(new Date(n.SaleExpiry))+"<\/span>"),CVF.Add("<\/div>"));CVF.Add("<\/div>");CVF.Add("<\/div>")}CVF.Add("<\/div>");CVF.Render_OutlineEventProtector();CVF.Add("<\/div>")}},Render_Event_OptionalDonation:function(n){CVF.IsEventForm()&&CVF.EventData.Event.HasOptionalDonation===!0&&(CVF.IsOutlineRenderMode?CVF.AttachProp_CID_NoBuffer(n):(CVF.Add("<div"),CVF.AttachProp_Css(n,["event-optional-donation-container"]),CVF.AttachProp_CID(n),CVF.AttachProp_VisibilityGroup(n),CVF.AttachProp_ControlOutline(n),CVF.Add(" >")),$cvf.each(n.Controls,function(t,i){CVF.MakeFormControl(t,i,n.ID)}),CVF.IsOutlineRenderMode||CVF.Add("<\/div>"))},Render_Event_PromoCodes:function(n){CVF.IsEventForm()&&CVF.EventData.HasPromoCodes===!0&&(CVF.IsOutlineRenderMode?CVF.AttachProp_CID_NoBuffer(n):(CVF.Add("<div"),CVF.AttachProp_Css(n,["event-promo-codes-container"]),CVF.AttachProp_CID(n),CVF.AttachProp_VisibilityGroup(n),CVF.AttachProp_ControlOutline(n),CVF.Add(" >")),$cvf.each(n.Controls,function(t,i){CVF.MakeFormControl(t,i,n.ID)}),CVF.IsOutlineRenderMode||CVF.Add("<\/div>"))},Render_Event_AmountTotal:function(){CVF.IsEventForm()&&(CVF.Add("<div class='col-xs-12'>"),CVF.Add("<label class='event-total-title'>"+CVF.GetMessageFromModel("EventTotalTitle","Total")+": <span id='event-amount-total'>0<\/span><\/label>"),CVF.Add("<\/div>"))},AttachProp_CID:function(n){CVF.AttachProp_CID_NoBuffer(n);CVF.Add(' id="'+n.ID+'" ');CVF.IsDesignMode===!0&&CVF.Add(' data-cvcontrol="'+n.CType+'" ')},AttachProp_CID_NoBuffer:function(n){n.hasOwnProperty("ID")||(n.hasOwnProperty("CID")?(n.ID=n.CID,delete n.CID):n.ID=CVF.NewID());CVF.AdjustMaxCID(n.ID)},AttachProp_Css:function(n,t,i,r){t=t||[];i=i||[];CVFUTL.IsInitialized(r)||(r=!1);CVF.PushPropValToArray(t,n,"CssClass");CVF.PushPropValToArray(t,n,"StyleAlign","text-align-");r===!1&&CVF.PushPropValToArray(t,n,"HSize","col-sm-");CVF.PushPropValToArray(i,n,"Style");CVF.PushPropValToArray(i,n,"StyleAlign","text-align:");CVF.PushPropValToArray(i,n,"StyleFontSize","font-size:");CVF.PushPropValToArray(i,n,"StyleFontFamily","font-family:");CVF.PushPropValToArray(i,n,"StyleBackground","background-color:");CVF.PushPropValToArray(i,n,"StyleForeground","color:");CVF.AttachCss_WriteAttributes(t,i)},AttachProp_CssBindedLabel:function(n,t,i,r){t=t||[];i=i||[];CVF.PushPropValToArray(t,n,"LabelCssClass");r===!1&&CVF.PushPropValToArray(t,n,"LabelHSize","col-sm-");CVF.PushPropValToArray(i,n,"LabelStyle");CVF.PushPropValToArray(i,n,"LabelStyleAlign","text-align:");CVF.PushPropValToArray(i,n,"LabelStyleFontSize","font-size:");CVF.PushPropValToArray(i,n,"LabelStyleFontFamily","font-family:");CVF.PushPropValToArray(i,n,"LabelStyleBackground","background-color:");CVF.PushPropValToArray(i,n,"LabelStyleForeground","color:");CVF.AttachCss_WriteAttributes(t,i)},AttachProp_HelpText:function(n){n.hasOwnProperty("LabelHelpText")&&CVFUTL.HasContent(n.LabelHelpText)&&CVF.Add(' data-toggle="popover" data-content="'+CVF.CleanContent(n.LabelHelpText)+'"')},AttachCss_WriteAttributes:function(n,t){n.length>0&&CVF.Add(' class="'+n.join(" ")+'" ');CVFUTL.HasValues(t)?CVF.Add(' style="'+t.join(";")+'" '):CVF.Add(' style="" ')},AttachProp_DataFields:function(n){CVF.HasVal(n,"DataField")&&CVF.Add(' data-field="'+n.DataField+'" ');CVF.HasVal(n,"DataFieldProp")&&CVF.Add(' data-fieldProp="'+n.DataFieldProp+'" ');CVF.HasVal(n,"DataFieldIndex")&&CVF.Add(' data-fieldIndex="'+n.DataFieldIndex+'" ');CVF.HasVal(n,"EvalFunction")&&CVF.Add(' data-evalFunc="'+n.EvalFunction+'" ');CVF.HasVal(n,"FieldPlugin")&&CVF.Add(' data-applyplugin="'+n.FieldPlugin+'" ');CVF.HasVal(n,"PluginConfig")&&CVF.AttachProp_PluginConfig(n.PluginConfig);CVF.HasVal(n,"RefName")&&CVF.Add(' data-refName="'+n.RefName.toLowerCase()+'" ');CVF.HasVal(n,"RelatedControlID")&&CVF.Add(' data-relatedcontrol="'+n.RelatedControlID+'" ')},AttachProp_PluginConfig:function(n){$cvf.each(Object.keys(n),function(t,i){var r=null;r=$cvf.isArray(n[i])?n[i].join(","):n[i];CVF.Add(" data-"+i+'="'+r+'" ')})},AttachProp_VisibilityTrigger:function(n){n.hasOwnProperty("VsTriggerTargetGroup")&&CVF.Add(' data-vsTargetGroup="'+n.VsTriggerTargetGroup+'"')},AttachProp_VisibilityGroup:function(n){n.hasOwnProperty("VsGroup")&&n.VsGroup!=""&&n.VsShowOn!=""&&(CVF.Add(' data-vsGroup="'+n.VsGroup+'" '),CVF.Add(' data-vsShowOn="'+n.VsShowOn+'" '))},AttachProp_Validation:function(n){n.hasOwnProperty("IsRequired")&&n.IsRequired&&CVF.Add(' data-required="true" ');n.hasOwnProperty("ValidationRule")&&(CVF.Add(' data-validate="'+n.ValidationRule+'"'),(n.ValidationRule=="PhoneNumber"||n.ValidationRule=="10")&&CVF.Add(' pattern="'+n.ValidationValue+'"'));n.hasOwnProperty("ErrorMessage")&&CVF.Add(' data-customError="'+n.ErrorMessage+'"')},AttachProp_ControlOutline:function(n){CVF.IsDesignMode!==!0||CVF.IsOutlineRenderMode||(CVF.Add(" data-cvcontroloutline='true' data-cid='"+n.ID+"' "),$cvf.inArray(n.CType,["WellFormGroup","CVFormSubmit","CVFromTitle","DivGroupPanel","FormGroupLine"])<0&&CVF.Add(" data-cvcontroldirectfocus='true' "))},AttachProp_Placeholder:function(n){n.hasOwnProperty("Content")&&CVF.Add(' placeholder="'+CVF.CleanContent(n.Content)+'" ')},AttachWizardStep:function(n,t,i){var f,u,r;CVF.IsWizardMode===!0&&(f=!1,CVF.HasVal(n,"IsNotNewStep")&&n.IsNotNewStep===!0&&(f=!0),t!==!0&&f===!1&&(u={Title:"Step "+(CVF.WizardSteps.length+1),Desc:""},CVF.HasVal(n,"StepTitle")&&(u.Title=n.StepTitle),CVF.HasVal(n,"StepDesc")&&(u.Desc=n.StepDesc),CVF.WizardSteps.push(u)),r=CVF.WizardSteps.length,i===!0&&r++,r==0&&(r=1),CVF.Add(' data-wzStep="'+r+'" '))},BuildOptionListFromDataList:function(n,t){var r,f,u,e,i,c,s,h,o;if(t=t||"",r="",f=CVF.FindDataListItems(n.ItemListID),!CVFUTL.HasValues(f))return r;for(u=null,CVF.HasVal(n,"CValue")&&(u=n.CValue),e=0;e<f.length;e++){if(i=f[e],c=CVF.HasVal(i,"RelationshipKey")&&i.RelationshipKey!==null,CVFUTL.HasContent(t)&&c){for(s=i.RelationshipKey.split(","),h=!0,o=0;o<s.length;o++)if(t==s[o]){h=!1;break}if(h)continue}r+="<option";i.DataKey!==null&&(r+=' value="'+i.DataKey+'"');(i.IsSelected===!0&&u===null||u!==null&&i.DataKey==u)&&(r+=' selected="selected"');r+=">"+i.Label+"<\/option>"}return r},IsInDesignMode:function(){return CVF.IsDesignMode!==!0||typeof CVFD=="undefined"?!1:!0},ResolveInputType:function(n){switch(n){case"1":case"5":case"8":case"17":case"18":default:return"text";case"2":case"3":case"9":case"10":return"number";case"4":case"checkbox":return"checkbox"}},AttachScriptTag:function(n,t){var i=document.createElement("script");i.type="text/javascript";i.src=n;t&&$cvf.each(t,function(n,t){i.setAttribute(t,"")});$cvf("#"+CVF.Target).append(i)},RuntimeControlOverride:function(n){CVF.HasVal(n,"RefName")&&$cvf.each(CVF.Setup.RuntimeOverrides,function(t,i){return CVF.HasVal(i,"RN")?i.RN==n.RefName.toLowerCase()?(n.CValue=i.VL,!1):void 0:!0})},RuntimeListOverride:function(n){CVF.HasVal(n,"RefName")&&$cvf.each(CVF.Setup.RuntimeOverrides,function(t,i){return!CVF.HasVal(i,"RN")||i.RN.indexOf("_lid")<0?!0:i.RN.replace("_lid","")==n.RefName.toLowerCase()?(n.ItemListID=i.VL,!1):void 0})},CreateAllocationOverride:function(n,t){CVFUTL.IsInitialized(n)||(n="");CVFUTL.IsInitialized(t)||(t="");return[{DataFieldProp:"cv_alloc_campaign",DataFieldIndex:0,CValue:n,DataField:"cv_allocation"},{DataFieldProp:"cv_alloc_fund",DataFieldIndex:0,CValue:t,DataField:"cv_allocation"},{DataFieldProp:"cv_alloc_date",DataFieldIndex:0,EvalFunction:"TODAY",DataField:"cv_allocation"},{DataFieldProp:"cv_alloc_amount",DataFieldIndex:0,CValue:100,EvalFunction:"AMOUNTPRC",DataField:"cv_allocation"},{DataFieldProp:"cv_alloc_percentage",DataFieldIndex:0,CValue:100,DataField:"cv_allocation"}]},LoadGoogleAnalytics:function(){if(CVF.IsInDesignMode()!==!0&&CVF.Model.Attributes.Google!==undefined&&CVFUTL.HasContent(CVF.Model.Attributes.Google.AnalyticsTrackingId)!==!1&&CVF.Model.Attributes.Google.AnalyticsLoaded!==!1){var n=`<!-- Google tag (gtag.js) -->
            <script async src="https://www.googletagmanager.com/gtag/js?id=${CVF.Model.Attributes.Google.AnalyticsTrackingId}"></script>
            <script>
                window.dataLayer = window.dataLayer || [];
                function gtag(){dataLayer.push(arguments);}
                gtag('js', new Date());
                gtag('config', '${CVF.Model.Attributes.Google.AnalyticsTrackingId}');
            </script>`;$cvf("head").append(n);CVF.Model.Attributes.Google.AnalyticsLoaded=!0}},Render_OutlineEventProtector:function(){CVF.IsOutlineRenderMode===!0&&CVF.Add("<div class='outlineControlEventProtector'><\/div>")},AssignGatewayDetails:function(){CVF.Model.Attributes.Gateway!==undefined&&CVF.HasVal(CVF.Model.Attributes.Gateway,"IsEnabled")&&(CVFR.ProcessToGateway=CVF.Model.Attributes.Gateway.IsEnabled)},IsEventForm:function(){return CVFUTL.IsInitialized(CVF.EventData)}},CVFUTL={MinDate:"0001-01-01T00:00:00",ParseUrlParams:function(){var i,r,u,n,t;try{if(i=location.search.substring(1),i==="")return null;for(r={},u=i.split("&"),n=0;n<u.length;n++)t=u[n].split("="),t.length===2&&(r[decodeURIComponent(t[0])]=decodeURIComponent(t[1].replace(/\+/g,"%20")).replace(/"/g,'"'));return r}catch(f){return console.error("Failed to parse url params: "+f),null}},HasContent:function(n){return CVFUTL.IsInitialized(n)&&n!==""},IsInitialized:function(n){return n!==null&&n!==undefined&&n!=="undefined"},IsFunction:function(n){return CVFUTL.IsInitialized(n)&&typeof n=="function"},FormatDate:function(n){var t=new Date(n),i=t.getMinutes();return i<10&&(i="0"+i),t.getDate()+"/"+(t.getMonth()+1)+"/"+t.getFullYear()},HasValues:function(n){return CVFUTL.IsInitialized(n)&&n.length>0},SafeValSet:function(n,t,i){CVF.HasVal(t,i)&&$cvf(n).val(t[i])},PrepareUrl:function(n,t){var i=t===!0?"https://":"http://";return n.indexOf("://")===-1?i+n:n},IsPositiveNumber:function(n){return!isNaN(n)&&n>0},TruncateString:function(n,t){return n.length>=t?n.substring(0,t)+"...":n},AppendPlural:function(n,t){return t>1?n+"s":n},NewUtcDate:function(n){var t=n.substring(n.length-1,n.length)==="Z"?n:n+"Z";return new Date(t)}};
