").append(i.parseHTML(n)).find(u):n)}).complete(r&&function(n,t){f.each(r,o||[n.responseText,t,n])}),this},i.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(n,t){i.fn[t]=function(n){return this.on(t,n)}}),i.expr.filters.animated=function(n){return i.grep(i.timers,function(t){return n===t.elem}).length},tr=n.document.documentElement,i.offset={setOffset:function(n,t,r){var e,o,s,h,u,c,v,l=i.css(n,"position"),a=i(n),f={};"static"===l&&(n.style.position="relative");u=a.offset();s=i.css(n,"top");c=i.css(n,"left");v=("absolute"===l||"fixed"===l)&&i.inArray("auto",[s,c])>-1;v?(e=a.position(),h=e.top,o=e.left):(h=parseFloat(s)||0,o=parseFloat(c)||0);i.isFunction(t)&&(t=t.call(n,r,u));null!=t.top&&(f.top=t.top-u.top+h);null!=t.left&&(f.left=t.left-u.left+o);"using"in t?t.using.call(n,f):a.css(f)}},i.fn.extend({offset:function(n){if(arguments.length)return void 0===n?this:this.each(function(t){i.offset.setOffset(this,n,t)});var t,f,u={top:0,left:0},r=this[0],e=r&&r.ownerDocument;if(e)return t=e.documentElement,i.contains(t,r)?(typeof r.getBoundingClientRect!==o&&(u=r.getBoundingClientRect()),f=wf(e),{top:u.top+(f.pageYOffset||t.scrollTop)-(t.clientTop||0),left:u.left+(f.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}):u},position:function(){if(this[0]){var n,r,t={top:0,left:0},u=this[0];return"fixed"===i.css(u,"position")?r=u.getBoundingClientRect():(n=this.offsetParent(),r=this.offset(),i.nodeName(n[0],"html")||(t=n.offset()),t.top+=i.css(n[0],"borderTopWidth",!0),t.left+=i.css(n[0],"borderLeftWidth",!0)),{top:r.top-t.top-i.css(u,"marginTop",!0),left:r.left-t.left-i.css(u,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var n=this.offsetParent||tr;n&&!i.nodeName(n,"html")&&"static"===i.css(n,"position");)n=n.offsetParent;return n||tr})}}),i.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(n,t){var r=/Y/.test(t);i.fn[n]=function(u){return b(this,function(n,u,f){var e=wf(n);return void 0===f?e?t in e?e[t]:e.document.documentElement[u]:n[u]:void(e?e.scrollTo(r?i(e).scrollLeft():f,r?f:i(e).scrollTop()):n[u]=f)},n,u,arguments.length,null)}}),i.each(["top","left"],function(n,t){i.cssHooks[t]=au(r.pixelPosition,function(n,r){if(r)return(r=d(n,t),pt.test(r)?i(n).position()[t]+"px":r)})}),i.each({Height:"height",Width:"width"},function(n,t){i.each({padding:"inner"+n,content:t,"":"outer"+n},function(r,u){i.fn[u]=function(u,f){var e=arguments.length&&(r||"boolean"!=typeof u),o=r||(u===!0||f===!0?"margin":"border");return b(this,function(t,r,u){var f;return i.isWindow(t)?t.document.documentElement["client"+n]:9===t.nodeType?(f=t.documentElement,Math.max(t.body["scroll"+n],f["scroll"+n],t.body["offset"+n],f["offset"+n],f["client"+n])):void 0===u?i.css(t,r,o):i.style(t,r,u,o)},t,e?u:void 0,e,null)}})}),i.fn.size=function(){return this.length},i.fn.andSelf=i.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return i}),bf=n.jQuery,kf=n.$,i.noConflict=function(t){return n.$===i&&(n.$=kf),t&&n.jQuery===i&&(n.jQuery=bf),i},typeof t===o&&(n.jQuery=n.$=i),i});!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):n(jQuery)}(function(n){n.extend(n.fn,{validate:function(t){if(!this.length)return void(t&&t.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));var i=n.data(this[0],"validator");return i?i:(this.attr("novalidate","novalidate"),i=new n.validator(t,this[0]),n.data(this[0],"validator",i),i.settings.onsubmit&&(this.validateDelegate(":submit","click",function(t){i.settings.submitHandler&&(i.submitButton=t.target);n(t.target).hasClass("cancel")&&(i.cancelSubmit=!0);void 0!==n(t.target).attr("formnovalidate")&&(i.cancelSubmit=!0)}),this.submit(function(t){function r(){var u,r;return i.settings.submitHandler?(i.submitButton&&(u=n("
").attr("name",i.submitButton.name).val(n(i.submitButton).val()).appendTo(i.currentForm)),r=i.settings.submitHandler.call(i,i.currentForm,t),i.submitButton&&u.remove(),void 0!==r?r:!1):!0}return i.settings.debug&&t.preventDefault(),i.cancelSubmit?(i.cancelSubmit=!1,r()):i.form()?i.pendingRequest?(i.formSubmitted=!0,!1):r():(i.focusInvalid(),!1)})),i)},valid:function(){var t,i;return n(this[0]).is("form")?t=this.validate().form():(t=!0,i=n(this[0].form).validate(),this.each(function(){t=i.element(this)&&t})),t},removeAttrs:function(t){var i={},r=this;return n.each(t.split(/\s/),function(n,t){i[t]=r.attr(t);r.removeAttr(t)}),i},rules:function(t,i){var e,s,f,u,o,h,r=this[0];if(t)switch(e=n.data(r.form,"validator").settings,s=e.rules,f=n.validator.staticRules(r),t){case"add":n.extend(f,n.validator.normalizeRule(i));delete f.messages;s[r.name]=f;i.messages&&(e.messages[r.name]=n.extend(e.messages[r.name],i.messages));break;case"remove":return i?(h={},n.each(i.split(/\s/),function(t,i){h[i]=f[i];delete f[i];"required"===i&&n(r).removeAttr("aria-required")}),h):(delete s[r.name],f)}return u=n.validator.normalizeRules(n.extend({},n.validator.classRules(r),n.validator.attributeRules(r),n.validator.dataRules(r),n.validator.staticRules(r)),r),u.required&&(o=u.required,delete u.required,u=n.extend({required:o},u),n(r).attr("aria-required","true")),u.remote&&(o=u.remote,delete u.remote,u=n.extend(u,{remote:o})),u}});n.extend(n.expr[":"],{blank:function(t){return!n.trim(""+n(t).val())},filled:function(t){return!!n.trim(""+n(t).val())},unchecked:function(t){return!n(t).prop("checked")}});n.validator=function(t,i){this.settings=n.extend(!0,{},n.validator.defaults,t);this.currentForm=i;this.init()};n.validator.format=function(t,i){return 1===arguments.length?function(){var i=n.makeArray(arguments);return i.unshift(t),n.validator.format.apply(this,i)}:(arguments.length>2&&i.constructor!==Array&&(i=n.makeArray(arguments).slice(1)),i.constructor!==Array&&(i=[i]),n.each(i,function(n,i){t=t.replace(new RegExp("\\{"+n+"\\}","g"),function(){return i})}),t)};n.extend(n.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:n([]),errorLabelContainer:n([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(n){this.lastActive=n;this.settings.focusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,n,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(n)))},onfocusout:function(n){!this.checkable(n)&&(n.name in this.submitted||!this.optional(n))&&this.element(n)},onkeyup:function(n,t){(9!==t.which||""!==this.elementValue(n))&&(n.name in this.submitted||n===this.lastElement)&&this.element(n)},onclick:function(n){n.name in this.submitted?this.element(n):n.parentNode.name in this.submitted&&this.element(n.parentNode)},highlight:function(t,i,r){"radio"===t.type?this.findByName(t.name).addClass(i).removeClass(r):n(t).addClass(i).removeClass(r)},unhighlight:function(t,i,r){"radio"===t.type?this.findByName(t.name).removeClass(i).addClass(r):n(t).removeClass(i).addClass(r)}},setDefaults:function(t){n.extend(n.validator.defaults,t)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date ( ISO ).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:n.validator.format("Please enter no more than {0} characters."),minlength:n.validator.format("Please enter at least {0} characters."),rangelength:n.validator.format("Please enter a value between {0} and {1} characters long."),range:n.validator.format("Please enter a value between {0} and {1}."),max:n.validator.format("Please enter a value less than or equal to {0}."),min:n.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function i(t){var r=n.data(this[0].form,"validator"),u="on"+t.type.replace(/^validate/,""),i=r.settings;i[u]&&!this.is(i.ignore)&&i[u].call(r,this[0],t)}this.labelContainer=n(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||n(this.currentForm);this.containers=n(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var t,r=this.groups={};n.each(this.settings.groups,function(t,i){"string"==typeof i&&(i=i.split(/\s/));n.each(i,function(n,i){r[i]=t})});t=this.settings.rules;n.each(t,function(i,r){t[i]=n.validator.normalizeRule(r)});n(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox']","focusin focusout keyup",i).validateDelegate("select, option, [type='radio'], [type='checkbox']","click",i);this.settings.invalidHandler&&n(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler);n(this.currentForm).find("[required], [data-rule-required], .required").attr("aria-required","true")},form:function(){return this.checkForm(),n.extend(this.submitted,this.errorMap),this.invalid=n.extend({},this.errorMap),this.valid()||n(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var n=0,t=this.currentElements=this.elements();t[n];n++)this.check(t[n]);return this.valid()},element:function(t){var u=this.clean(t),i=this.validationTargetFor(u),r=!0;return this.lastElement=i,void 0===i?delete this.invalid[u.name]:(this.prepareElement(i),this.currentElements=n(i),r=this.check(i)!==!1,r?delete this.invalid[i.name]:this.invalid[i.name]=!0),n(t).attr("aria-invalid",!r),this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),r},showErrors:function(t){if(t){n.extend(this.errorMap,t);this.errorList=[];for(var i in t)this.errorList.push({message:t[i],element:this.findByName(i)[0]});this.successList=n.grep(this.successList,function(n){return!(n.name in t)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){n.fn.resetForm&&n(this.currentForm).resetForm();this.submitted={};this.lastElement=null;this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass).removeData("previousValue").removeAttr("aria-invalid")},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(n){var i,t=0;for(i in n)t++;return t},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(n){n.not(this.containers).text("");this.addWrapper(n).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{n(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(t){}},findLastActive:function(){var t=this.lastActive;return t&&1===n.grep(this.errorList,function(n){return n.element.name===t.name}).length&&t},elements:function(){var t=this,i={};return n(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled], [readonly]").not(this.settings.ignore).filter(function(){return!this.name&&t.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in i||!t.objectLength(n(this).rules())?!1:(i[this.name]=!0,!0)})},clean:function(t){return n(t)[0]},errors:function(){var t=this.settings.errorClass.split(" ").join(".");return n(this.settings.errorElement+"."+t,this.errorContext)},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=n([]);this.toHide=n([]);this.currentElements=n([])},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers)},prepareElement:function(n){this.reset();this.toHide=this.errorsFor(n)},elementValue:function(t){var i,u=n(t),r=t.type;return"radio"===r||"checkbox"===r?n("input[name='"+t.name+"']:checked").val():"number"===r&&"undefined"!=typeof t.validity?t.validity.badInput?!1:u.val():(i=u.val(),"string"==typeof i?i.replace(/\r/g,""):i)},check:function(t){t=this.validationTargetFor(this.clean(t));var i,r,u,f=n(t).rules(),s=n.map(f,function(n,t){return t}).length,e=!1,h=this.elementValue(t);for(r in f){u={method:r,parameters:f[r]};try{if(i=n.validator.methods[r].call(this,h,t,u.parameters),"dependency-mismatch"===i&&1===s){e=!0;continue}if(e=!1,"pending"===i)return void(this.toHide=this.toHide.not(this.errorsFor(t)));if(!i)return this.formatAndAdd(t,u),!1}catch(o){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+t.id+", check the '"+u.method+"' method.",o),o;}}if(!e)return this.objectLength(f)&&this.successList.push(t),!0},customDataMessage:function(t,i){return n(t).data("msg"+i.charAt(0).toUpperCase()+i.substring(1).toLowerCase())||n(t).data("msg")},customMessage:function(n,t){var i=this.settings.messages[n];return i&&(i.constructor===String?i:i[t])},findDefined:function(){for(var n=0;n
Warning: No message defined for "+t.name+"<\/strong>")},formatAndAdd:function(t,i){var r=this.defaultMessage(t,i.method),u=/\$?\{(\d+)\}/g;"function"==typeof r?r=r.call(this,i.parameters,t):u.test(r)&&(r=n.validator.format(r.replace(u,"{$1}"),i.parameters));this.errorList.push({message:r,element:t,method:i.method});this.errorMap[t.name]=r;this.submitted[t.name]=r},addWrapper:function(n){return this.settings.wrapper&&(n=n.add(n.parent(this.settings.wrapper))),n},defaultShowErrors:function(){for(var i,t,n=0;this.errorList[n];n++)t=this.errorList[n],this.settings.highlight&&this.settings.highlight.call(this,t.element,this.settings.errorClass,this.settings.validClass),this.showLabel(t.element,t.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(n=0;this.successList[n];n++)this.showLabel(this.successList[n]);if(this.settings.unhighlight)for(n=0,i=this.validElements();i[n];n++)this.settings.unhighlight.call(this,i[n],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return n(this.errorList).map(function(){return this.element})},showLabel:function(t,i){var u,o,e,r=this.errorsFor(t),s=this.idOrName(t),f=n(t).attr("aria-describedby");r.length?(r.removeClass(this.settings.validClass).addClass(this.settings.errorClass),r.html(i)):(r=n("<"+this.settings.errorElement+">").attr("id",s+"-error").addClass(this.settings.errorClass).html(i||""),u=r,this.settings.wrapper&&(u=r.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(u):this.settings.errorPlacement?this.settings.errorPlacement(u,n(t)):u.insertAfter(t),r.is("label")?r.attr("for",s):0===r.parents("label[for='"+s+"']").length&&(e=r.attr("id").replace(/(:|\.|\[|\])/g,"\\$1"),f?f.match(new RegExp("\\b"+e+"\\b"))||(f+=" "+e):f=e,n(t).attr("aria-describedby",f),o=this.groups[t.name],o&&n.each(this.groups,function(t,i){i===o&&n("[name='"+t+"']",this.currentForm).attr("aria-describedby",r.attr("id"))})));!i&&this.settings.success&&(r.text(""),"string"==typeof this.settings.success?r.addClass(this.settings.success):this.settings.success(r,t));this.toShow=this.toShow.add(r)},errorsFor:function(t){var r=this.idOrName(t),u=n(t).attr("aria-describedby"),i="label[for='"+r+"'], label[for='"+r+"'] *";return u&&(i=i+", #"+u.replace(/\s+/g,", #")),this.errors().filter(i)},idOrName:function(n){return this.groups[n.name]||(this.checkable(n)?n.name:n.id||n.name)},validationTargetFor:function(t){return this.checkable(t)&&(t=this.findByName(t.name)),n(t).not(this.settings.ignore)[0]},checkable:function(n){return/radio|checkbox/i.test(n.type)},findByName:function(t){return n(this.currentForm).find("[name='"+t+"']")},getLength:function(t,i){switch(i.nodeName.toLowerCase()){case"select":return n("option:selected",i).length;case"input":if(this.checkable(i))return this.findByName(i.name).filter(":checked").length}return t.length},depend:function(n,t){return this.dependTypes[typeof n]?this.dependTypes[typeof n](n,t):!0},dependTypes:{boolean:function(n){return n},string:function(t,i){return!!n(t,i.form).length},"function":function(n,t){return n(t)}},optional:function(t){var i=this.elementValue(t);return!n.validator.methods.required.call(this,i,t)&&"dependency-mismatch"},startRequest:function(n){this.pending[n.name]||(this.pendingRequest++,this.pending[n.name]=!0)},stopRequest:function(t,i){this.pendingRequest--;this.pendingRequest<0&&(this.pendingRequest=0);delete this.pending[t.name];i&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(n(this.currentForm).submit(),this.formSubmitted=!1):!i&&0===this.pendingRequest&&this.formSubmitted&&(n(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(t){return n.data(t,"previousValue")||n.data(t,"previousValue",{old:null,valid:!0,message:this.defaultMessage(t,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(t,i){t.constructor===String?this.classRuleSettings[t]=i:n.extend(this.classRuleSettings,t)},classRules:function(t){var i={},r=n(t).attr("class");return r&&n.each(r.split(" "),function(){this in n.validator.classRuleSettings&&n.extend(i,n.validator.classRuleSettings[this])}),i},attributeRules:function(t){var r,i,u={},e=n(t),f=t.getAttribute("type");for(r in n.validator.methods)"required"===r?(i=t.getAttribute(r),""===i&&(i=!0),i=!!i):i=e.attr(r),/min|max/.test(r)&&(null===f||/number|range|text/.test(f))&&(i=Number(i)),i||0===i?u[r]=i:f===r&&"range"!==f&&(u[r]=!0);return u.maxlength&&/-1|2147483647|524288/.test(u.maxlength)&&delete u.maxlength,u},dataRules:function(t){var i,r,u={},f=n(t);for(i in n.validator.methods)r=f.data("rule"+i.charAt(0).toUpperCase()+i.substring(1).toLowerCase()),void 0!==r&&(u[i]=r);return u},staticRules:function(t){var i={},r=n.data(t.form,"validator");return r.settings.rules&&(i=n.validator.normalizeRule(r.settings.rules[t.name])||{}),i},normalizeRules:function(t,i){return n.each(t,function(r,u){if(u===!1)return void delete t[r];if(u.param||u.depends){var f=!0;switch(typeof u.depends){case"string":f=!!n(u.depends,i.form).length;break;case"function":f=u.depends.call(i,i)}f?t[r]=void 0!==u.param?u.param:!0:delete t[r]}}),n.each(t,function(r,u){t[r]=n.isFunction(u)?u(i):u}),n.each(["minlength","maxlength"],function(){t[this]&&(t[this]=Number(t[this]))}),n.each(["rangelength","range"],function(){var i;t[this]&&(n.isArray(t[this])?t[this]=[Number(t[this][0]),Number(t[this][1])]:"string"==typeof t[this]&&(i=t[this].replace(/[\[\]]/g,"").split(/[\s,]+/),t[this]=[Number(i[0]),Number(i[1])]))}),n.validator.autoCreateRanges&&(null!=t.min&&null!=t.max&&(t.range=[t.min,t.max],delete t.min,delete t.max),null!=t.minlength&&null!=t.maxlength&&(t.rangelength=[t.minlength,t.maxlength],delete t.minlength,delete t.maxlength)),t},normalizeRule:function(t){if("string"==typeof t){var i={};n.each(t.split(/\s/),function(){i[this]=!0});t=i}return t},addMethod:function(t,i,r){n.validator.methods[t]=i;n.validator.messages[t]=void 0!==r?r:n.validator.messages[t];i.length<3&&n.validator.addClassRules(t,n.validator.normalizeRule(t))},methods:{required:function(t,i,r){if(!this.depend(r,i))return"dependency-mismatch";if("select"===i.nodeName.toLowerCase()){var u=n(i).val();return u&&u.length>0}return this.checkable(i)?this.getLength(t,i)>0:n.trim(t).length>0},email:function(n,t){return this.optional(t)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(n)},url:function(n,t){return this.optional(t)||/^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(n)},date:function(n,t){return this.optional(t)||!/Invalid|NaN/.test(new Date(n).toString())},dateISO:function(n,t){return this.optional(t)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(n)},number:function(n,t){return this.optional(t)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(n)},digits:function(n,t){return this.optional(t)||/^\d+$/.test(n)},creditcard:function(n,t){if(this.optional(t))return"dependency-mismatch";if(/[^0-9 \-]+/.test(n))return!1;var i,f,e=0,r=0,u=!1;if(n=n.replace(/\D/g,""),n.length<13||n.length>19)return!1;for(i=n.length-1;i>=0;i--)f=n.charAt(i),r=parseInt(f,10),u&&(r*=2)>9&&(r-=9),e+=r,u=!u;return e%10==0},minlength:function(t,i,r){var u=n.isArray(t)?t.length:this.getLength(t,i);return this.optional(i)||u>=r},maxlength:function(t,i,r){var u=n.isArray(t)?t.length:this.getLength(t,i);return this.optional(i)||r>=u},rangelength:function(t,i,r){var u=n.isArray(t)?t.length:this.getLength(t,i);return this.optional(i)||u>=r[0]&&u<=r[1]},min:function(n,t,i){return this.optional(t)||n>=i},max:function(n,t,i){return this.optional(t)||i>=n},range:function(n,t,i){return this.optional(t)||n>=i[0]&&n<=i[1]},equalTo:function(t,i,r){var u=n(r);return this.settings.onfocusout&&u.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){n(i).valid()}),t===u.val()},remote:function(t,i,r){if(this.optional(i))return"dependency-mismatch";var u,e,f=this.previousValue(i);return this.settings.messages[i.name]||(this.settings.messages[i.name]={}),f.originalMessage=this.settings.messages[i.name].remote,this.settings.messages[i.name].remote=f.message,r="string"==typeof r&&{url:r}||r,f.old===t?f.valid:(f.old=t,u=this,this.startRequest(i),e={},e[i.name]=t,n.ajax(n.extend(!0,{url:r,mode:"abort",port:"validate"+i.name,dataType:"json",data:e,context:u.currentForm,success:function(r){var o,e,h,s=r===!0||"true"===r;u.settings.messages[i.name].remote=f.originalMessage;s?(h=u.formSubmitted,u.prepareElement(i),u.formSubmitted=h,u.successList.push(i),delete u.invalid[i.name],u.showErrors()):(o={},e=r||u.defaultMessage(i,"remote"),o[i.name]=f.message=n.isFunction(e)?e(t):e,u.invalid[i.name]=!0,u.showErrors(o));f.valid=s;u.stopRequest(i,s)}},r)),"pending")}}});n.format=function(){throw"$.format has been deprecated. Please use $.validator.format instead.";};var i,t={};n.ajaxPrefilter?n.ajaxPrefilter(function(n,i,r){var u=n.port;"abort"===n.mode&&(t[u]&&t[u].abort(),t[u]=r)}):(i=n.ajax,n.ajax=function(r){var f=("mode"in r?r:n.ajaxSettings).mode,u=("port"in r?r:n.ajaxSettings).port;return"abort"===f?(t[u]&&t[u].abort(),t[u]=i.apply(this,arguments),t[u]):i.apply(this,arguments)});n.extend(n.fn,{validateDelegate:function(t,i,r){return this.bind(i,function(i){var u=n(i.target);if(u.is(t))return r.apply(u,arguments)})}})}),function(n){function i(n,t,i){n.rules[t]=i;n.message&&(n.messages[t]=n.message)}function h(n){return n.replace(/^\s+|\s+$/g,"").split(/\s*,\s*/g)}function f(n){return n.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g,"\\$1")}function e(n){return n.substr(0,n.lastIndexOf(".")+1)}function o(n,t){return n.indexOf("*.")===0&&(n=n.replace("*.",t)),n}function c(t,i){var r=n(this).find("[data-valmsg-for='"+f(i[0].name)+"']"),u=r.attr("data-valmsg-replace"),e=u?n.parseJSON(u)!==!1:null;r.removeClass("field-validation-valid").addClass("field-validation-error");t.data("unobtrusiveContainer",r);e?(r.empty(),t.removeClass("input-validation-error").appendTo(r)):t.hide()}function l(t,i){var u=n(this).find("[data-valmsg-summary=true]"),r=u.find("ul");r&&r.length&&i.errorList.length&&(r.empty(),u.addClass("validation-summary-errors").removeClass("validation-summary-valid"),n.each(i.errorList,function(){n("").html(this.message).appendTo(r)}))}function a(t){var i=t.data("unobtrusiveContainer"),r=i.attr("data-valmsg-replace"),u=r?n.parseJSON(r):null;i&&(i.addClass("field-validation-valid").removeClass("field-validation-error"),t.removeData("unobtrusiveContainer"),u&&i.empty())}function v(){var t=n(this),i="__jquery_unobtrusive_validation_form_reset";if(!t.data(i)){t.data(i,!0);try{t.data("validator").resetForm()}finally{t.removeData(i)}t.find(".validation-summary-errors").addClass("validation-summary-valid").removeClass("validation-summary-errors");t.find(".field-validation-error").addClass("field-validation-valid").removeClass("field-validation-error").removeData("unobtrusiveContainer").find(">*").removeData("unobtrusiveContainer")}}function s(t){var i=n(t),f=i.data(u),s=n.proxy(v,t),e=r.unobtrusive.options||{},o=function(i,r){var u=e[i];u&&n.isFunction(u)&&u.apply(t,r)};return f||(f={options:{errorClass:e.errorClass||"input-validation-error",errorElement:e.errorElement||"span",errorPlacement:function(){c.apply(t,arguments);o("errorPlacement",arguments)},invalidHandler:function(){l.apply(t,arguments);o("invalidHandler",arguments)},messages:{},rules:{},success:function(){a.apply(t,arguments);o("success",arguments)}},attachValidation:function(){i.off("reset."+u,s).on("reset."+u,s).validate(this.options)},validate:function(){return i.validate(),i.valid()}},i.data(u,f)),f}var r=n.validator,t,u="unobtrusiveValidation";r.unobtrusive={adapters:[],parseElement:function(t,i){var u=n(t),f=u.parents("form")[0],r,e,o;f&&(r=s(f),r.options.rules[t.name]=e={},r.options.messages[t.name]=o={},n.each(this.adapters,function(){var i="data-val-"+this.name,r=u.attr(i),s={};r!==undefined&&(i+="-",n.each(this.params,function(){s[this]=u.attr(i+this)}),this.adapt({element:t,form:f,message:r,params:s,rules:e,messages:o}))}),n.extend(e,{__dummy__:!0}),i||r.attachValidation())},parse:function(t){var i=n(t),u=i.parents().addBack().filter("form").add(i.find("form")).has("[data-val=true]");i.find("[data-val=true]").each(function(){r.unobtrusive.parseElement(this,!0)});u.each(function(){var n=s(this);n&&n.attachValidation()})}};t=r.unobtrusive.adapters;t.add=function(n,t,i){return i||(i=t,t=[]),this.push({name:n,params:t,adapt:i}),this};t.addBool=function(n,t){return this.add(n,function(r){i(r,t||n,!0)})};t.addMinMax=function(n,t,r,u,f,e){return this.add(n,[f||"min",e||"max"],function(n){var f=n.params.min,e=n.params.max;f&&e?i(n,u,[f,e]):f?i(n,t,f):e&&i(n,r,e)})};t.addSingleVal=function(n,t,r){return this.add(n,[t||"val"],function(u){i(u,r||n,u.params[t])})};r.addMethod("__dummy__",function(){return!0});r.addMethod("regex",function(n,t,i){var r;return this.optional(t)?!0:(r=new RegExp(i).exec(n),r&&r.index===0&&r[0].length===n.length)});r.addMethod("nonalphamin",function(n,t,i){var r;return i&&(r=n.match(/\W/g),r=r&&r.length>=i),r});r.methods.extension?(t.addSingleVal("accept","mimtype"),t.addSingleVal("extension","extension")):t.addSingleVal("extension","extension","accept");t.addSingleVal("regex","pattern");t.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url");t.addMinMax("length","minlength","maxlength","rangelength").addMinMax("range","min","max","range");t.addMinMax("minlength","minlength").addMinMax("maxlength","minlength","maxlength");t.add("equalto",["other"],function(t){var r=e(t.element.name),u=t.params.other,s=o(u,r),h=n(t.form).find(":input").filter("[name='"+f(s)+"']")[0];i(t,"equalTo",h)});t.add("required",function(n){(n.element.tagName.toUpperCase()!=="INPUT"||n.element.type.toUpperCase()!=="CHECKBOX")&&i(n,"required",!0)});t.add("remote",["url","type","additionalfields"],function(t){var r={url:t.params.url,type:t.params.type||"GET",data:{}},u=e(t.element.name);n.each(h(t.params.additionalfields||t.element.name),function(i,e){var s=o(e,u);r.data[s]=function(){var i=n(t.form).find(":input").filter("[name='"+f(s)+"']");return i.is(":checkbox")?i.filter(":checked").val()||i.filter(":hidden").val()||"":i.is(":radio")?i.filter(":checked").val()||"":i.val()}});i(t,"remote",r)});t.add("password",["min","nonalphamin","regex"],function(n){n.params.min&&i(n,"minlength",n.params.min);n.params.nonalphamin&&i(n,"nonalphamin",n.params.nonalphamin);n.params.regex&&i(n,"regex",n.params.regex)});n(function(){r.unobtrusive.parse(document)})}(jQuery);jQuery.validator.addMethod("mustbetrue",function(n,t){return t.checked});jQuery.validator.unobtrusive.adapters.addBool("mustbetrue");jQuery.validator.addMethod("mustbefalse",function(n,t){return!t.checked});jQuery.validator.unobtrusive.adapters.addBool("mustbefalse");jQuery.validator.addMethod("requiredif",function(n,t,i){var r=$('[name$="'+i.propertyname+'"]').val(),f=i.desiredvalue.toLowerCase().split(","),o=i.controltype.toLowerCase(),e=!1,u;for(o=="radio"&&(r=$('[name$="'+i.propertyname+'"]:checked').val(),(r===undefined||r==null)&&(r="")),u=0;u=i.minimum});jQuery.validator.unobtrusive.adapters.add("checkboxlistvalidator",["minimum"],function(n){n.rules.checkboxlistvalidator=n.params;n.messages.checkboxlistvalidator=n.message});jQuery.validator.addMethod("cc",function(n){var t,r,i,u;if(n.length===0)return!0;if((t=n.replace(/ /g,"").replace(/-/g,""),t.charAt(0)==="4"&&t.length!==13&&t.length!==16)||t.match("^(51|52|53|54|55)")&&t.length!==16||t.match("^(34|37)")&&t.length!==15||!t.match(/^\d+$/))return!1;for(r=0,i=0;i9?u-9:u;return r%10==0&&r>0});jQuery.validator.unobtrusive.adapters.add("cc",["cardtypes"],function(n){n.rules.cc=n.params;n.messages.cc=n.message});jQuery.validator.addMethod("ccexpiry",function(n,t,i){var r,u,f,e,o;return n.length===0?!0:(r=+n,u=(new Date).getFullYear(),ru+35)?!1:(f=$("#"+i.month),f.val().length===0)?!1:(e=+f.val(),o=(new Date).getMonth()+1,r===u&&ef&&u<=r):u>f}return!0});jQuery.validator.addMethod("jsonfragment",function(n){if(n&&jQuery.trim(n)!=="")try{var t=n.replace(/'/g,'"'),i='{ "test": '+t+" }";JSON.parse(i)}catch(r){return!1}return!0});jQuery.validator.unobtrusive.adapters.addBool("jsonfragment"),function(n){typeof define=="function"&&define.amd?define(["jquery"],n):typeof module=="object"&&typeof module.exports=="object"?n(require("jquery")):n(jQuery)}(function(n){function u(){var u=t.settings,r;return u.autoDispose&&!n.contains(document.documentElement,this)?(n(this).timeago("dispose"),this):(r=e(this),isNaN(r.datetime)||(u.cutoff===0||Math.abs(f(r.datetime))0&&n(this).text(n(this).attr("title"))),this)}function e(i){if(i=n(i),!i.data("timeago")){i.data("timeago",{datetime:t.datetime(i)});var r=n.trim(i.text());t.settings.localeTitle?i.attr("title",i.data("timeago").datetime.toLocaleString()):r.length>0&&!(t.isTime(i)&&i.attr("title"))&&i.attr("title",r)}return i.data("timeago")}function i(n){return t.inWords(f(n))}function f(n){return(new Date).getTime()-n.getTime()}var t,r;n.timeago=function(t){return t instanceof Date?i(t):typeof t=="string"?i(n.timeago.parse(t)):typeof t=="number"?i(new Date(t)):i(n.timeago.datetime(t))};t=n.timeago;n.extend(n.timeago,{settings:{refreshMillis:6e4,allowPast:!0,allowFuture:!1,localeTitle:!1,cutoff:0,autoDispose:!0,strings:{prefixAgo:null,prefixFromNow:null,suffixAgo:"ago",suffixFromNow:"from now",inPast:"any moment now",seconds:"less than a minute",minute:"about a minute",minutes:"%d minutes",hour:"about an hour",hours:"about %d hours",day:"a day",days:"%d days",month:"about a month",months:"%d months",year:"about a year",years:"%d years",wordSeparator:" ",numbers:[]}},inWords:function(t){function r(r,u){var f=n.isFunction(r)?r(u,t):r,e=i.numbers&&i.numbers[u]||u;return f.replace(/%d/i,e)}var a,s;if(!this.settings.allowPast&&!this.settings.allowFuture)throw"timeago allowPast and allowFuture settings can not both be set to false.";var i=this.settings.strings,h=i.prefixAgo,c=i.suffixAgo;if(this.settings.allowFuture&&t<0&&(h=i.prefixFromNow,c=i.suffixFromNow),!this.settings.allowPast&&t>=0)return this.settings.strings.inPast;var f=Math.abs(t)/1e3,e=f/60,o=e/60,u=o/24,l=u/365;return a=f<45&&r(i.seconds,Math.round(f))||f<90&&r(i.minute,1)||e<45&&r(i.minutes,Math.round(e))||e<90&&r(i.hour,1)||o<24&&r(i.hours,Math.round(o))||o<42&&r(i.day,1)||u<30&&r(i.days,Math.round(u))||u<45&&r(i.month,1)||u<365&&r(i.months,Math.round(u/30))||l<1.5&&r(i.year,1)||r(i.years,Math.round(l)),s=i.wordSeparator||"",i.wordSeparator===undefined&&(s=" "),n.trim([h,a,c].join(s))},parse:function(t){var i=n.trim(t);return i=i.replace(/\.\d+/,""),i=i.replace(/-/,"/").replace(/-/,"/"),i=i.replace(/T/," ").replace(/Z/," UTC"),i=i.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2"),i=i.replace(/([\+\-]\d\d)$/," $100"),new Date(i)},datetime:function(i){var r=t.isTime(i)?n(i).attr("datetime"):n(i).attr("title");return t.parse(r)},isTime:function(t){return n(t).get(0).tagName.toLowerCase()==="time"}});r={init:function(){var i,f;r.dispose.call(this);i=n.proxy(u,this);i();f=t.settings;f.refreshMillis>0&&(this._timeagoInterval=setInterval(i,f.refreshMillis))},update:function(i){var r=i instanceof Date?i:t.parse(i);n(this).data("timeago",{datetime:r});t.settings.localeTitle&&n(this).attr("title",r.toLocaleString());u.apply(this)},updateFromDOM:function(){n(this).data("timeago",{datetime:t.parse(t.isTime(this)?n(this).attr("datetime"):n(this).attr("title"))});u.apply(this)},dispose:function(){this._timeagoInterval&&(window.clearInterval(this._timeagoInterval),this._timeagoInterval=null)}};n.fn.timeago=function(n,t){var i=n?r[n]:r.init;if(!i)throw new Error("Unknown function name '"+n+"' for timeago");return this.each(function(){i.call(this,t)}),this};document.createElement("abbr");document.createElement("time")}),function(n){var i,t,u,r;n.fn.lazyloader=function(t){var r=new i;r.elements=[];this.each(function(){r.elements.push(this)});r.settings=n.extend({isAds:!1,renderMarginPixels:0,renderMarginPercent:0,mobileScaling:1,onLoaded:null},t);r.settings.renderMarginPercent>0&&(r.settings.renderMarginPixels=window.innerHeight*r.settings.renderMarginPercent/100,r.settings.mobileScaling>1&&Math.ceil(window.innerWidth,window.innerHeight)<728&&(r.settings.renderMarginPixels=r.settings.renderMarginPixels*r.settings.mobileScaling));r.settings.isAds?r.lazyAds():r.lazyImages();n(window).on("scroll resize",VM.Scroll.debounce(function(){r.settings.isAds?r.lazyAds():r.lazyImages()},10));return r};i=function(){};i.prototype.lazyAds=function(){for(var t,r,i=0;i=0&&i.right>=0&&i.top<=t+(window.innerHeight||document.documentElement.clientHeight)&&i.left<=t+(window.innerWidth||document.documentElement.clientWidth)}catch(r){return!1}};n.fn.socialCounter=function(i){if(this.length!==0){var r=new t(i);this.each(function(){var t=n(this),i=t.find(".sc-item-fb");t.css("display")!=="none"&&(i.length===0||i.css("display")!=="none")&&r.addUrl(t)});r.getFacebook()}};t=function(n){this.access_token=n.access_token;this.scrape_endpoint=n.scrape_endpoint;this.urls=[];this.$containers=[]};t.prototype.addUrl=function(t){var i=t.data("url")||t.data("href");this.$containers.push(t);n.inArray(i,this.urls)===-1&&this.urls.push(i)};t.prototype.processResult=function(n,i,r){for(var u,f=0;f0&&o.attr("title",i+" shares").text(t.countFormatter(i));s.length>0&&i===0?u.text(s):e.length&&i===1&&e.text(e.data("single"));h.length&&h.attr("title",r+" comments").text(t.countFormatter(r))}};t.countFormatter=function(n){if(n>999){var t=(n/1e3).toFixed(1);return t.length>3&&(t=t.split(".")[0]),t+"K"}return n};t.prototype.getFacebook=function(){var t,i,r;if(this.urls.length!==0){for(t=this,i="",r=0;r li > .navitem",this.onNavItemClick).on("click",".m-more",this.onNavMoreClick).on("mouseenter",".children",this.onNavParentMouseEnter).on("mouseleave",".children",this.onNavParentMouseLeave);this.$search=$("#search").on("click",".search-select input",this.onSearchCheck);this.$navToggles=$(".navbt-toggle").click(this.onNavToggle);$("#classifieds-search").click(this.onClassifiedsSearch);this.setupSwipe();$(".sc").socialCounter(VM.getFacebookApiSettings());$(".sci").commentCounts();$(".mc").trendingCounts();$("header").on("click",".hd-popup-trigger",this.onHeaderPopupClick);n=$("#weather-container");n.length&&(t=VM.Storage.getObj("VM-WeatherDefaultLocation"),t!==null&&(i="locationId="+t,r=n.data("endpoint")+"&"+i,n.data("endpoint",r),n.attr("href",n.attr("href")+"?"+i)),VM.Ajax.lazyload.call(n));this.repointSpacesLinks()};VM.setup=function(){var n,t;$(".lazyimg").lazyloader();$(".lazyad").lazyloader({isAds:!0,renderMarginPercent:$("body").data("ads-render")||0,mobileScaling:parseFloat($("body").data("ads-scale")||1),onLoaded:function(n){VM.Slots.buildSlotFromElement(n,function(n){VM.Slots.requestBids([n])})}});$(".timeago",this.$body).timeago();n=$(".sc-item-sms",this.$body);n.length&&(t=navigator.userAgent.toLowerCase(),(t.indexOf("iphone")>-1||t.indexOf("ipad")>-1)&&n.each(function(){$(this).attr("href",$(this).attr("href").replace("sms:?","sms:&"))}))};VM.registerServiceWorker=function(){"serviceWorker"in navigator&&(navigator.serviceWorker.register("/wp-sw.js",{scope:"/"}),window.addEventListener("appinstalled",function(){VM.Track.trackEvent("install",{category:"PWA",label:"success"})}))};VM.setupSwipe=function(){$(".tablist-widget",this.$body).not(".initialized").each(function(){var n=$(this).find(".tablist-items"),u=n.find(".lazyimg").lazyloader(),r=$('<\/div>'),t=$('
<\/div>'),i=new Carousel(this,{callback:function(n){u.lazyImages();t.toggleClass("hidden",n.index==n.max);r.toggleClass("hidden",n.index==0)}});r.appendTo(n).on("click",i.prev);t.appendTo(n).on("click",i.next);$(this).addClass("initialized");i.hidden()>0&&t.removeClass("hidden")})};VM.onToggleShare=function(n){n.preventDefault();var t=$(this),i=t.closest("div").find(".panel-overlay");t.hasClass("close")?(t.removeClass("close"),t.find("span").removeClass("hidden")):(t.addClass("close"),t.find("span").addClass("hidden"));i.toggleClass("hidden")};VM.onCopyLink=function(n){n.preventDefault();navigator.clipboard.writeText($(this).prop("href"));VM.Ajax.toast("Successfully copied link to the clipboard.","success",!0)};VM.onNavToggle=function(){$(this).toggleClass("hide").siblings().toggleClass("hide");$("html").toggleClass("overlay");VM.$nav.toggleClass("show")};VM.navtimers={};VM.onNavItemClick=function(n){VM.$navToggles.is(":visible")&&$(this).parent().hasClass("children")&&(n.preventDefault(),$(this).toggleClass("expanded").removeClass("m-expanded").next().find(".subnav").toggleClass("show"))};VM.onNavMoreClick=function(n){n.preventDefault();$(this).closest(".subnav-container").prev().click()};VM.onNavParentMouseEnter=function(){var n=$(this).addClass("open").siblings().removeClass("open");clearTimeout(VM.navtimers["nav-"+n.index()])};VM.onNavParentMouseLeave=function(){var n=$(this);VM.navtimers["nav-"+n.index()]=setTimeout(function(){n.removeClass("open")},750)};VM.loadNavContent=function(n){var i=n.children("a"),u,f,r,t,e;if(i.length&&!i.hasClass("widget-loaded")&&(u=i.data("widget"),u)){for(i.addClass("widget-loaded"),f={},r=i[0].attributes,t=0;t
'+t+"<\/div>")})}};VM.onSearchCheck=function(){var n=$(this),e="search "+n.data("placeholder"),i,r,t,u,f;if(VM.$search.removeAttr("target").find(".param").remove(),VM.$search.attr("action",n.data("action")),n.data("target")&&VM.$search.attr("target",n.data("target")),$("#q").attr("placeholder",e),VM.$search.find(".param").remove(),i=n.data("params"),i){for(r="",u=i.split("|"),t=0;t';VM.$search.append(r)}};VM.onPrint=function(n){n.preventDefault();VM.Track.onGaClick.call(this);window.print()};VM.onShowComments=function(){var n=$(this),i=n.next(),u=n.data("appid"),t,r;n.removeClass("ga").off("click",".ga");n.hasClass("loaded")?(i.toggleClass("hidden"),t=i.next(),t.is(":visible")?t.attr("style","display: none !important"):t.attr("style","")):(n.addClass("loading").prop("disabled",!0),r=window.setTimeout(function(){n.removeClass("loading").addClass("loaded").prop("disabled",!1)},7500),$.ajax({type:"GET",url:"https://connect.facebook.net/en_US/sdk.js",dataType:"script",cache:!0}).success(function(){FB.init({appId:u,xfbml:!0,version:"v2.11"});FB.Event.subscribe("xfbml.render",function(){n.removeClass("loading").addClass("loaded").prop("disabled",!1);i.removeClass("hidden");window.clearTimeout(r)})}).fail(function(){n.removeClass("loading").addClass("loaded").prop("disabled",!1);n.children(".sc-c").text("Failed to load");window.clearTimeout(r)}))};VM.onFormWidgetValidate=function(n){n.preventDefault();var t=$(this).closest("form");t.valid()?grecaptcha.execute():grecaptcha.reset()};VM.formWidgetSubmit=function(n){var t=$("#"+n),i=t.find("button").prop("disabled",!0).addClass("loading");$.ajax("/widgets/formsubmit",{method:"POST",data:t.serialize()}).done(function(n){t.html(n);VM.Track.trackPageview({page_path:(window.location.pathname+"/thankyou").replace("//thankyou","/thankyou"),page_title:t.find(".js-title").text()})}).fail(function(){alert("There was a problem submitting your information.")}).always(function(){i.removeClass("loading").prop("disabled",!1)})};VM.onClassifiedsSearch=function(n){var t=$("#qbt-classifieds"),i;t.length&&(n.preventDefault(),n.stopPropagation(),t.click(),$("#qbt").click(),i=VM.$navToggles.filter(":not(:visible)").click(),i.hasClass("navbt-close")?$("#q").focus():$("#q").blur())};VM.onScrollTo=function(n){n.preventDefault();var t=$(this).attr("href");VM.scrollTo($(t))};VM.scrollTo=function(n){$("html, body").animate({scrollTop:n.offset().top-$("header").height()-20},500)};VM.onHeaderPopupClick=function(n){n.preventDefault();var t=$(this),i=$("#"+t.attr("aria-controls"));i.hasClass("hidden")?(i.removeClass("hidden"),t.addClass("hd-popup-triggered").attr("aria-expanded",!0),VM.$popupTrigger&&(VM.$popupTrigger.click(),n.stopPropagation()),VM.$popupTrigger=t):(i.addClass("hidden"),t.removeClass("hd-popup-triggered").attr("aria-expanded",!1),VM.$popupTrigger=null)};VM.getFacebookApiSettings=function(){var n=$("meta[property='fb:app_id']");return{access_token:n.data("key")?n.attr("content")+"|"+n.data("key"):"253883948067202|97ed53738428ce974f5f6696babe8b34",scrape_endpoint:"https://vm-facebookscrape.azurewebsites.net/api/Scrape?code=wUUaWk7OI0d9DkcfD9QzSDXP7Bxr3JWso74qtYNg5287EM1/bLzLXg=="}};VM.onWeatherLoaded=function(n){if(n&&n.temperature){var t=''+n.temperature.toFixed(1)+" °"+n.units+'
forecast ><\/span><\/div>';n.alert&&(t+='!<\/span>');t+='';$(this).append(t);VM.Track.addTargeting("WeatherCondition",n.condition);VM.Track.addTargeting("WeatherTemperature",parseInt(n.temperature.toFixed(1),10));n.stationId&&VM.Track.addTargeting("StationId",n.stationId)}};VM.repointSpacesLinks=function(){VM.Me.getUser(function(n){n.id!==0&&document.querySelectorAll(".spaces-sso").forEach(n=>{const t="/account/spaces?returnUrl="+encodeURIComponent(n.href);n.href=t;n.target="_blank";n.rel="noopener nofollow"})})};VM.Ajax={$toast:null,init:function(){this.loadScripts();VM.$body.find(".lazyload").each(this.lazyload);VM.$body.find(".widget-lazy").each(this.lazyloadWidget);VM.$body.on("click",".ajaxtrigger",this.onAjaxTrigger);this.loadAdmin();window.onpopstate=this.onPopState},initialStateObjects:[],lazyload:function(){var n=$(this);if(n.length>0){var i=n.data("endpoint"),t=n.data("target"),r=n.data("data")||"",u=t?$(t):n;$.ajax(i,{method:"POST",data:r}).done(function(t){if(t){n.removeClass("hidden");u.append(t);var i=n[0];VM.Ajax.getFunction(i.getAttribute("data-success"),["data","status","xhr"]).apply(i,arguments)}})}},lazyloadWidget:function(){var n=$(this);$.ajax("/widgets/"+n.data("id"),{method:"GET"}).done(function(t){var i=$(t),u=i.data(),r;n.hasClass("widget-injected")&&i.addClass("widget-injected");n.attr("class",i.attr("class")).prepend(i.html());for(r in u)u.hasOwnProperty(r)&&n.attr("data-"+r,u[r]);n.hasClass("widget-inject")&&!n.hasClass("widget-injected")&&(VM.Widgets.detailsInjects(),VM.Widgets.categoryInjects());VM.setup();VM.Track.addExternalParams(n);i.hasClass("tablist")&&VM.setupSwipe()})},onAjaxTrigger:function(n){var o;n.preventDefault();var t=$(this),u="#"+this.id,i=t.data("target"),f=$(i),r=t.attr("href"),e=t.data("endpoint")||r;r&&(o=$.grep(VM.Ajax.initialStateObjects,function(n){return n.targetSelector==i}),o.length===0&&VM.Ajax.initialStateObjects.push({triggerSelector:u,targetSelector:i,endpoint:f.data("initial-endpoint")}),history.pushState({triggerSelector:u,targetSelector:i,endpoint:e},"",r));VM.Ajax.loadData(t,f,e)},loadData:function(n,t,i){n.addClass("ajaxtrigger-loading");t.addClass("ajaxtarget-loading");var r=n[0];$.ajax(i,{method:"GET"}).done(function(n){t.replaceWith(n);t.find(".lazyimg").lazyloader();VM.Ajax.getFunction(r.getAttribute("data-success"),["data","status","xhr"]).apply(r,arguments)}).fail(function(n,t,i){alert(i)}).always(function(){n.removeClass("ajaxtrigger-loading");t.removeClass("ajaxtarget-loading")})},onPopState:function(n){n.state?VM.Ajax.loadData($(n.state.triggerSelector),$(n.state.targetSelector),n.state.endpoint):$.each(VM.Ajax.initialStateObjects,function(){VM.Ajax.loadData($(this.triggerSelector),$(this.targetSelector),this.endpoint)})},getFunction:function(n,t){for(var i=window,r=(n||"").split(".");i&&r.length;)i=i[r.shift()];return typeof i=="function"?i:(t.push(n),Function.constructor.apply(null,t))},resetValidation:function(n){var t=n||$("form");$.validator.unobtrusive.parse(t.data("validator",null).data("unobtrusiveValidation",null));n.find(".field-validation-error, .input-validation-error").length&&(n.find(".field-validation-error").addClass("field-validation-valid").removeClass("field-validation-error").html(""),n.find(".input-validation-error").removeClass("input-validation-error"))},onBegin:function(){$(this).find(".btn-primary").addClass("loading").prop("disabled",!0)},onComplete:function(){$(this).find(".btn-primary").removeClass("loading").prop("disabled",!1)},getXhrError:function(n){var t=n.responseText;return n.status===500&&(t="Sorry, there was a problem processing your request."),t},toast:function(n,t,i){this.$toast&&(this.$toast.remove(),this.$toast=null);this.$toast=$(''+n+'