
function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}var _slice=Array.prototype.slice,_slicedToArray=function(){function e(e,t){var i=[],n=!0,r=!1,s=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);n=!0);}catch(l){r=!0,s=l}finally{try{!n&&o["return"]&&o["return"]()}finally{if(r)throw s}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e};!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],t):e.parsley=t(e.jQuery)}(this,function(e){"use strict";function t(e,t){return e.parsleyAdaptedCallback||(e.parsleyAdaptedCallback=function(){var i=Array.prototype.slice.call(arguments,0);i.unshift(this),e.apply(t||T,i)}),e.parsleyAdaptedCallback}function i(e){return 0===e.lastIndexOf(D,0)?e.substr(D.length):e}function n(){var t=this,i=window||global;_extends(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(i){t.isNativeEvent(i)&&e(i.target).trigger("input")},misbehaves:function(i){t.isNativeEvent(i)&&(t.behavesOk(i),e(document).on("change.inputevent",i.data.selector,t.fakeInputEvent),t.fakeInputEvent(i))},behavesOk:function(i){t.isNativeEvent(i)&&e(document).off("input.inputevent",i.data.selector,t.behavesOk).off("change.inputevent",i.data.selector,t.misbehaves)},install:function(){if(!i.inputEventPatched){i.inputEventPatched="0.0.3";for(var n=["select",'input[type="checkbox"]','input[type="radio"]','input[type="file"]'],r=0;r<n.length;r++){var s=n[r];e(document).on("input.inputevent",s,{selector:s},t.behavesOk).on("change.inputevent",s,{selector:s},t.misbehaves)}}},uninstall:function(){delete i.inputEventPatched,e(document).off(".inputevent")}})}var r=1,s={},a={attr:function(e,t,i){var n,r,s,a=new RegExp("^"+t,"i");if("undefined"==typeof i)i={};else for(n in i)i.hasOwnProperty(n)&&delete i[n];if(!e)return i;for(s=e.attributes,n=s.length;n--;)r=s[n],r&&r.specified&&a.test(r.name)&&(i[this.camelize(r.name.slice(t.length))]=this.deserializeValue(r.value));return i},checkAttr:function(e,t,i){return e.hasAttribute(t+i)},setAttr:function(e,t,i,n){e.setAttribute(this.dasherize(t+i),String(n))},generateID:function(){return""+r++},deserializeValue:function(t){var i;try{return t?"true"==t||"false"!=t&&("null"==t?null:isNaN(i=Number(t))?/^[\[\{]/.test(t)?e.parseJSON(t):t:i):t}catch(n){return t}},camelize:function(e){return e.replace(/-+(.)?/g,function(e,t){return t?t.toUpperCase():""})},dasherize:function(e){return e.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()},warn:function(){var e;window.console&&"function"==typeof window.console.warn&&(e=window.console).warn.apply(e,arguments)},warnOnce:function(e){s[e]||(s[e]=!0,this.warn.apply(this,arguments))},_resetWarnings:function(){s={}},trimString:function(e){return e.replace(/^\s+|\s+$/g,"")},parse:{date:function S(e){var t=e.match(/^(\d{4,})-(\d\d)-(\d\d)$/);if(!t)return null;var i=t.map(function(e){return parseInt(e,10)}),n=_slicedToArray(i,4),r=(n[0],n[1]),s=n[2],a=n[3],S=new Date(r,s-1,a);return S.getFullYear()!==r||S.getMonth()+1!==s||S.getDate()!==a?null:S},string:function(e){return e},integer:function(e){return isNaN(e)?null:parseInt(e,10)},number:function(e){if(isNaN(e))throw null;return parseFloat(e)},"boolean":function(e){return!/^\s*false\s*$/i.test(e)},object:function(e){return a.deserializeValue(e)},regexp:function(e){var t="";return/^\/.*\/(?:[gimy]*)$/.test(e)?(t=e.replace(/.*\/([gimy]*)$/,"$1"),e=e.replace(new RegExp("^/(.*?)/"+t+"$"),"$1")):e="^"+e+"$",new RegExp(e,t)}},parseRequirement:function(e,t){var i=this.parse[e||"string"];if(!i)throw'Unknown requirement specification: "'+e+'"';var n=i(t);if(null===n)throw"Requirement is not a "+e+': "'+t+'"';return n},namespaceEvents:function(t,i){return t=this.trimString(t||"").split(/\s+/),t[0]?e.map(t,function(e){return e+"."+i}).join(" "):""},difference:function(t,i){var n=[];return e.each(t,function(e,t){i.indexOf(t)==-1&&n.push(t)}),n},all:function(t){return e.when.apply(e,_toConsumableArray(t).concat([42,42]))},objectCreate:Object.create||function(){var e=function(){};return function(t){if(arguments.length>1)throw Error("Second argument not supported");if("object"!=typeof t)throw TypeError("Argument must be an object");e.prototype=t;var i=new e;return e.prototype=null,i}}(),_SubmitSelector:'input[type="submit"], button:submit'},o={namespace:"data-parsley-",inputs:"input, textarea, select",excluded:"input[type=button], input[type=submit], input[type=reset], input[type=hidden]",priorityEnabled:!0,multiple:null,group:null,uiEnabled:!0,validationThreshold:3,focus:"first",trigger:!1,triggerAfterFailure:"input",errorClass:"parsley-error",successClass:"parsley-success",classHandler:function(e){},errorsContainer:function(e){},errorsWrapper:'<ul class="parsley-errors-list"></ul>',errorTemplate:"<li></li>"},l=function(){this.__id__=a.generateID()};l.prototype={asyncSupport:!0,_pipeAccordingToValidationResult:function(){var t=this,i=function(){var i=e.Deferred();return!0!==t.validationResult&&i.reject(),i.resolve().promise()};return[i,i]},actualizeOptions:function(){return a.attr(this.element,this.options.namespace,this.domOptions),this.parent&&this.parent.actualizeOptions&&this.parent.actualizeOptions(),this},_resetOptions:function(e){this.domOptions=a.objectCreate(this.parent.options),this.options=a.objectCreate(this.domOptions);for(var t in e)e.hasOwnProperty(t)&&(this.options[t]=e[t]);this.actualizeOptions()},_listeners:null,on:function(e,t){this._listeners=this._listeners||{};var i=this._listeners[e]=this._listeners[e]||[];return i.push(t),this},subscribe:function(t,i){e.listenTo(this,t.toLowerCase(),i)},off:function(e,t){var i=this._listeners&&this._listeners[e];if(i)if(t)for(var n=i.length;n--;)i[n]===t&&i.splice(n,1);else delete this._listeners[e];return this},unsubscribe:function(t,i){e.unsubscribeTo(this,t.toLowerCase())},trigger:function(e,t,i){t=t||this;var n,r=this._listeners&&this._listeners[e];if(r)for(var s=r.length;s--;)if(n=r[s].call(t,t,i),n===!1)return n;return!this.parent||this.parent.trigger(e,t,i)},asyncIsValid:function(e,t){return a.warnOnce("asyncIsValid is deprecated; please use whenValid instead"),this.whenValid({group:e,force:t})},_findRelated:function(){return this.options.multiple?e(this.parent.element.querySelectorAll("["+this.options.namespace+'multiple="'+this.options.multiple+'"]')):this.$element}};var u=function(e,t){var i=e.match(/^\s*\[(.*)\]\s*$/);if(!i)throw'Requirement is not an array: "'+e+'"';var n=i[1].split(",").map(a.trimString);if(n.length!==t)throw"Requirement has "+n.length+" values when "+t+" are needed";return n},d=function(e,t,i){var n=null,r={};for(var s in e)if(s){var o=i(s);"string"==typeof o&&(o=a.parseRequirement(e[s],o)),r[s]=o}else n=a.parseRequirement(e[s],t);return[n,r]},h=function(t){e.extend(!0,this,t)};h.prototype={validate:function(e,t){if(this.fn)return arguments.length>3&&(t=[].slice.call(arguments,1,-1)),this.fn(e,t);if(Array.isArray(e)){if(!this.validateMultiple)throw"Validator `"+this.name+"` does not handle multiple values";return this.validateMultiple.apply(this,arguments)}var i=arguments[arguments.length-1];if(this.validateDate&&i._isDateInput())return arguments[0]=a.parse.date(arguments[0]),null!==arguments[0]&&this.validateDate.apply(this,arguments);if(this.validateNumber)return!isNaN(e)&&(arguments[0]=parseFloat(arguments[0]),this.validateNumber.apply(this,arguments));if(this.validateString)return this.validateString.apply(this,arguments);throw"Validator `"+this.name+"` only handles multiple values"},parseRequirements:function(t,i){if("string"!=typeof t)return Array.isArray(t)?t:[t];var n=this.requirementType;if(Array.isArray(n)){for(var r=u(t,n.length),s=0;s<r.length;s++)r[s]=a.parseRequirement(n[s],r[s]);return r}return e.isPlainObject(n)?d(n,t,i):[a.parseRequirement(n,t)]},requirementType:"string",priority:2};var p=function(e,t){this.__class__="ValidatorRegistry",this.locale="en",this.init(e||{},t||{})},c={email:/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,number:/^-?(\d*\.)?\d+(e[-+]?\d+)?$/i,integer:/^-?\d+$/,digits:/^\d+$/,alphanum:/^\w+$/i,date:{test:function(e){return null!==a.parse.date(e)}},url:new RegExp("^(?:(?:https?|ftp)://)?(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:/\\S*)?$","i")};c.range=c.number;var f=function(e){var t=(""+e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0},m=function(e,t){return t.map(a.parse[e])},g=function(e,t){return function(i){for(var n=arguments.length,r=Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return r.pop(),t.apply(void 0,[i].concat(_toConsumableArray(m(e,r))))}},v=function(e){return{validateDate:g("date",e),validateNumber:g("number",e),requirementType:e.length<=2?"string":["string","string"],priority:30}};p.prototype={init:function(e,t){this.catalog=t,this.validators=_extends({},this.validators);for(var i in e)this.addValidator(i,e[i].fn,e[i].priority);window.Parsley.trigger("parsley:validator:init")},setLocale:function(e){if("undefined"==typeof this.catalog[e])throw new Error(e+" is not available in the catalog");return this.locale=e,this},addCatalog:function(e,t,i){return"object"==typeof t&&(this.catalog[e]=t),!0===i?this.setLocale(e):this},addMessage:function(e,t,i){return"undefined"==typeof this.catalog[e]&&(this.catalog[e]={}),this.catalog[e][t]=i,this},addMessages:function(e,t){for(var i in t)this.addMessage(e,i,t[i]);return this},addValidator:function(e,t,i){if(this.validators[e])a.warn('Validator "'+e+'" is already defined.');else if(o.hasOwnProperty(e))return void a.warn('"'+e+'" is a restricted keyword and is not a valid validator name.');return this._setValidator.apply(this,arguments)},updateValidator:function(e,t,i){return this.validators[e]?this._setValidator.apply(this,arguments):(a.warn('Validator "'+e+'" is not already defined.'),this.addValidator.apply(this,arguments))},removeValidator:function(e){return this.validators[e]||a.warn('Validator "'+e+'" is not defined.'),delete this.validators[e],this},_setValidator:function(e,t,i){"object"!=typeof t&&(t={fn:t,priority:i}),t.validate||(t=new h(t)),this.validators[e]=t;for(var n in t.messages||{})this.addMessage(n,e,t.messages[n]);return this},getErrorMessage:function(e){var t;if("type"===e.name){var i=this.catalog[this.locale][e.name]||{};t=i[e.requirements]}else t=this.formatMessage(this.catalog[this.locale][e.name],e.requirements);return t||this.catalog[this.locale].defaultMessage||this.catalog.en.defaultMessage},formatMessage:function(e,t){if("object"==typeof t){for(var i in t)e=this.formatMessage(e,t[i]);return e}return"string"==typeof e?e.replace(/%s/i,t):""},validators:{notblank:{validateString:function(e){return/\S/.test(e)},priority:2},required:{validateMultiple:function(e){return e.length>0},validateString:function(e){return/\S/.test(e)},priority:512},type:{validateString:function(e,t){var i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],n=i.step,r=void 0===n?"any":n,s=i.base,a=void 0===s?0:s,o=c[t];if(!o)throw new Error("validator type `"+t+"` is not supported");if(!o.test(e))return!1;if("number"===t&&!/^any$/i.test(r||"")){var l=Number(e),u=Math.max(f(r),f(a));if(f(l)>u)return!1;var d=function(e){return Math.round(e*Math.pow(10,u))};if((d(l)-d(a))%d(r)!=0)return!1}return!0},requirementType:{"":"string",step:"string",base:"number"},priority:256},pattern:{validateString:function(e,t){return t.test(e)},requirementType:"regexp",priority:64},minlength:{validateString:function(e,t){return e.length>=t},requirementType:"integer",priority:30},maxlength:{validateString:function(e,t){return e.length<=t},requirementType:"integer",priority:30},length:{validateString:function(e,t,i){return e.length>=t&&e.length<=i},requirementType:["integer","integer"],priority:30},mincheck:{validateMultiple:function(e,t){return e.length>=t},requirementType:"integer",priority:30},maxcheck:{validateMultiple:function(e,t){return e.length<=t},requirementType:"integer",priority:30},check:{validateMultiple:function(e,t,i){return e.length>=t&&e.length<=i},requirementType:["integer","integer"],priority:30},min:v(function(e,t){return e>=t}),max:v(function(e,t){return e<=t}),range:v(function(e,t,i){return e>=t&&e<=i}),equalto:{validateString:function(t,i){var n=e(i);return n.length?t===n.val():t===i},priority:256}}};var y={},_=function k(e,t,i){for(var n=[],r=[],s=0;s<e.length;s++){for(var a=!1,o=0;o<t.length;o++)if(e[s].assert.name===t[o].assert.name){a=!0;break}a?r.push(e[s]):n.push(e[s])}return{kept:r,added:n,removed:i?[]:k(t,e,!0).added}};y.Form={_actualizeTriggers:function(){var e=this;this.$element.on("submit.Parsley",function(t){e.onSubmitValidate(t)}),this.$element.on("click.Parsley",a._SubmitSelector,function(t){e.onSubmitButton(t)}),!1!==this.options.uiEnabled&&this.element.setAttribute("novalidate","")},focus:function(){if(this._focusedField=null,!0===this.validationResult||"none"===this.options.focus)return null;for(var e=0;e<this.fields.length;e++){var t=this.fields[e];if(!0!==t.validationResult&&t.validationResult.length>0&&"undefined"==typeof t.options.noFocus&&(this._focusedField=t.$element,"first"===this.options.focus))break}return null===this._focusedField?null:this._focusedField.focus()},_destroyUI:function(){this.$element.off(".Parsley")}},y.Field={_reflowUI:function(){if(this._buildUI(),this._ui){var e=_(this.validationResult,this._ui.lastValidationResult);this._ui.lastValidationResult=this.validationResult,this._manageStatusClass(),this._manageErrorsMessages(e),this._actualizeTriggers(),!e.kept.length&&!e.added.length||this._failedOnce||(this._failedOnce=!0,this._actualizeTriggers())}},getErrorsMessages:function(){if(!0===this.validationResult)return[];for(var e=[],t=0;t<this.validationResult.length;t++)e.push(this.validationResult[t].errorMessage||this._getErrorMessage(this.validationResult[t].assert));return e},addError:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=t.message,n=t.assert,r=t.updateClass,s=void 0===r||r;this._buildUI(),this._addError(e,{message:i,assert:n}),s&&this._errorClass()},updateError:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=t.message,n=t.assert,r=t.updateClass,s=void 0===r||r;this._buildUI(),this._updateError(e,{message:i,assert:n}),s&&this._errorClass()},removeError:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=t.updateClass,n=void 0===i||i;this._buildUI(),this._removeError(e),n&&this._manageStatusClass()},_manageStatusClass:function(){this.hasConstraints()&&this.needsValidation()&&!0===this.validationResult?this._successClass():this.validationResult.length>0?this._errorClass():this._resetClass()},_manageErrorsMessages:function(t){if("undefined"==typeof this.options.errorsMessagesDisabled){if("undefined"!=typeof this.options.errorMessage)return t.added.length||t.kept.length?(this._insertErrorWrapper(),0===this._ui.$errorsWrapper.find(".parsley-custom-error-message").length&&this._ui.$errorsWrapper.append(e(this.options.errorTemplate).addClass("parsley-custom-error-message")),this._ui.$errorsWrapper.addClass("filled").find(".parsley-custom-error-message").html(this.options.errorMessage)):this._ui.$errorsWrapper.removeClass("filled").find(".parsley-custom-error-message").remove();for(var i=0;i<t.removed.length;i++)this._removeError(t.removed[i].assert.name);for(i=0;i<t.added.length;i++)this._addError(t.added[i].assert.name,{message:t.added[i].errorMessage,assert:t.added[i].assert});for(i=0;i<t.kept.length;i++)this._updateError(t.kept[i].assert.name,{message:t.kept[i].errorMessage,assert:t.kept[i].assert})}},_addError:function(t,i){var n=i.message,r=i.assert;this._insertErrorWrapper(),this._ui.$errorsWrapper.addClass("filled").append(e(this.options.errorTemplate).addClass("parsley-"+t).html(n||this._getErrorMessage(r)))},_updateError:function(e,t){var i=t.message,n=t.assert;this._ui.$errorsWrapper.addClass("filled").find(".parsley-"+e).html(i||this._getErrorMessage(n))},_removeError:function(e){this._ui.$errorsWrapper.removeClass("filled").find(".parsley-"+e).remove()},_getErrorMessage:function(e){var t=e.name+"Message";return"undefined"!=typeof this.options[t]?window.Parsley.formatMessage(this.options[t],e.requirements):window.Parsley.getErrorMessage(e)},_buildUI:function(){if(!this._ui&&!1!==this.options.uiEnabled){var t={};this.element.setAttribute(this.options.namespace+"id",this.__id__),t.$errorClassHandler=this._manageClassHandler(),t.errorsWrapperId="parsley-id-"+(this.options.multiple?"multiple-"+this.options.multiple:this.__id__),t.$errorsWrapper=e(this.options.errorsWrapper).attr("id",t.errorsWrapperId),t.lastValidationResult=[],t.validationInformationVisible=!1,this._ui=t}},_manageClassHandler:function(){if("string"==typeof this.options.classHandler)return 0===e(this.options.classHandler).length&&ParsleyUtils.warn("No elements found that match the selector `"+this.options.classHandler+"` set in options.classHandler or data-parsley-class-handler"),e(this.options.classHandler);if("function"==typeof this.options.classHandler)var t=this.options.classHandler.call(this,this);return"undefined"!=typeof t&&t.length?t:this._inputHolder()},_inputHolder:function(){return this.options.multiple&&"SELECT"!==this.element.nodeName?this.$element.parent():this.$element},_insertErrorWrapper:function(){var t;if(0!==this._ui.$errorsWrapper.parent().length)return this._ui.$errorsWrapper.parent();if("string"==typeof this.options.errorsContainer){if(e(this.options.errorsContainer).length)return e(this.options.errorsContainer).append(this._ui.$errorsWrapper);a.warn("The errors container `"+this.options.errorsContainer+"` does not exist in DOM")}else"function"==typeof this.options.errorsContainer&&(t=this.options.errorsContainer.call(this,this));return"undefined"!=typeof t&&t.length?t.append(this._ui.$errorsWrapper):this._inputHolder().after(this._ui.$errorsWrapper)},_actualizeTriggers:function(){var e,t=this,i=this._findRelated();i.off(".Parsley"),this._failedOnce?i.on(a.namespaceEvents(this.options.triggerAfterFailure,"Parsley"),function(){t._validateIfNeeded()}):(e=a.namespaceEvents(this.options.trigger,"Parsley"))&&i.on(e,function(e){t._validateIfNeeded(e)})},_validateIfNeeded:function(e){var t=this;e&&/key|input/.test(e.type)&&(!this._ui||!this._ui.validationInformationVisible)&&this.getValue().length<=this.options.validationThreshold||(this.options.debounce?(window.clearTimeout(this._debounced),this._debounced=window.setTimeout(function(){return t.validate()},this.options.debounce)):this.validate())},_resetUI:function(){this._failedOnce=!1,this._actualizeTriggers(),"undefined"!=typeof this._ui&&(this._ui.$errorsWrapper.removeClass("filled").children().remove(),this._resetClass(),this._ui.lastValidationResult=[],this._ui.validationInformationVisible=!1)},_destroyUI:function(){this._resetUI(),"undefined"!=typeof this._ui&&this._ui.$errorsWrapper.remove(),delete this._ui},_successClass:function(){this._ui.validationInformationVisible=!0,this._ui.$errorClassHandler.removeClass(this.options.errorClass).addClass(this.options.successClass)},_errorClass:function(){this._ui.validationInformationVisible=!0,this._ui.$errorClassHandler.removeClass(this.options.successClass).addClass(this.options.errorClass)},_resetClass:function(){this._ui.$errorClassHandler.removeClass(this.options.successClass).removeClass(this.options.errorClass)}};var w=function(t,i,n){this.__class__="Form",this.element=t,this.$element=e(t),this.domOptions=i,this.options=n,this.parent=window.Parsley,this.fields=[],this.validationResult=null},b={pending:null,resolved:!0,rejected:!1};w.prototype={onSubmitValidate:function(e){var t=this;if(!0!==e.parsley){var i=this._submitSource||this.$element.find(a._SubmitSelector)[0];if(this._submitSource=null,this.$element.find(".parsley-synthetic-submit-button").prop("disabled",!0),!i||null===i.getAttribute("formnovalidate")){window.Parsley._remoteCache={};var n=this.whenValidate({event:e});"resolved"===n.state()&&!1!==this._trigger("submit")||(e.stopImmediatePropagation(),e.preventDefault(),"pending"===n.state()&&n.done(function(){t._submit(i)}))}}},onSubmitButton:function(e){this._submitSource=e.currentTarget},_submit:function(t){if(!1!==this._trigger("submit")){if(t){var i=this.$element.find(".parsley-synthetic-submit-button").prop("disabled",!1);0===i.length&&(i=e('<input class="parsley-synthetic-submit-button" type="hidden">').appendTo(this.$element)),i.attr({name:t.getAttribute("name"),value:t.getAttribute("value")})}this.$element.trigger(_extends(e.Event("submit"),{parsley:!0}))}},validate:function(t){if(arguments.length>=1&&!e.isPlainObject(t)){a.warnOnce("Calling validate on a parsley form without passing arguments as an object is deprecated.");var i=_slice.call(arguments),n=i[0],r=i[1],s=i[2];t={group:n,force:r,event:s}}return b[this.whenValidate(t).state()]},whenValidate:function(){var t,i=this,n=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],r=n.group,s=n.force,o=n.event;this.submitEvent=o,o&&(this.submitEvent=_extends({},o,{preventDefault:function(){a.warnOnce("Using `this.submitEvent.preventDefault()` is deprecated; instead, call `this.validationResult = false`"),i.validationResult=!1}})),this.validationResult=!0,this._trigger("validate"),this._refreshFields();var l=this._withoutReactualizingFormOptions(function(){return e.map(i.fields,function(e){return e.whenValidate({force:s,group:r})})});return(t=a.all(l).done(function(){i._trigger("success")}).fail(function(){i.validationResult=!1,i.focus(),i._trigger("error")}).always(function(){i._trigger("validated")})).pipe.apply(t,_toConsumableArray(this._pipeAccordingToValidationResult()))},isValid:function(t){if(arguments.length>=1&&!e.isPlainObject(t)){a.warnOnce("Calling isValid on a parsley form without passing arguments as an object is deprecated.");var i=_slice.call(arguments),n=i[0],r=i[1];t={group:n,force:r}}return b[this.whenValid(t).state()]},whenValid:function(){var t=this,i=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=i.group,r=i.force;this._refreshFields();var s=this._withoutReactualizingFormOptions(function(){return e.map(t.fields,function(e){return e.whenValid({group:n,force:r})})});return a.all(s)},reset:function(){for(var e=0;e<this.fields.length;e++)this.fields[e].reset();this._trigger("reset")},destroy:function(){this._destroyUI();for(var e=0;e<this.fields.length;e++)this.fields[e].destroy();this.$element.removeData("Parsley"),this._trigger("destroy")},_refreshFields:function(){return this.actualizeOptions()._bindFields()},_bindFields:function(){var t=this,i=this.fields;return this.fields=[],this.fieldsMappedById={},this._withoutReactualizingFormOptions(function(){t.$element.find(t.options.inputs).not(t.options.excluded).each(function(e,i){var n=new window.Parsley.Factory(i,{},t);if(("Field"===n.__class__||"FieldMultiple"===n.__class__)&&!0!==n.options.excluded){var r=n.__class__+"-"+n.__id__;"undefined"==typeof t.fieldsMappedById[r]&&(t.fieldsMappedById[r]=n,t.fields.push(n))}}),e.each(a.difference(i,t.fields),function(e,t){t.reset()})}),this},_withoutReactualizingFormOptions:function(e){var t=this.actualizeOptions;this.actualizeOptions=function(){return this};var i=e();return this.actualizeOptions=t,i},_trigger:function(e){return this.trigger("form:"+e)}};var F=function(e,t,i,n,r){var s=window.Parsley._validatorRegistry.validators[t],a=new h(s);n=n||e.options[t+"Priority"]||a.priority,r=!0===r,_extends(this,{validator:a,name:t,requirements:i,priority:n,isDomConstraint:r}),this._parseRequirements(e.options)},C=function(e){var t=e[0].toUpperCase();return t+e.slice(1)};F.prototype={validate:function(e,t){var i;return(i=this.validator).validate.apply(i,[e].concat(_toConsumableArray(this.requirementList),[t]))},_parseRequirements:function(e){var t=this;this.requirementList=this.validator.parseRequirements(this.requirements,function(i){return e[t.name+C(i)]})}};var E=function(t,i,n,r){this.__class__="Field",this.element=t,this.$element=e(t),"undefined"!=typeof r&&(this.parent=r),this.options=n,this.domOptions=i,this.constraints=[],this.constraintsByName={},this.validationResult=!0,this._bindConstraints()},A={pending:null,resolved:!0,rejected:!1};E.prototype={validate:function(t){arguments.length>=1&&!e.isPlainObject(t)&&(a.warnOnce("Calling validate on a parsley field without passing arguments as an object is deprecated."),t={options:t});var i=this.whenValidate(t);if(!i)return!0;switch(i.state()){case"pending":return null;case"resolved":return!0;case"rejected":return this.validationResult}},whenValidate:function(){var e,t=this,i=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=i.force,r=i.group;if(this.refreshConstraints(),!r||this._isInGroup(r))return this.value=this.getValue(),this._trigger("validate"),(e=this.whenValid({force:n,value:this.value,_refreshed:!0}).always(function(){t._reflowUI()}).done(function(){t._trigger("success")}).fail(function(){t._trigger("error")}).always(function(){t._trigger("validated")})).pipe.apply(e,_toConsumableArray(this._pipeAccordingToValidationResult()))},hasConstraints:function(){return 0!==this.constraints.length},needsValidation:function(e){return"undefined"==typeof e&&(e=this.getValue()),!(!e.length&&!this._isRequired()&&"undefined"==typeof this.options.validateIfEmpty)},_isInGroup:function(t){return Array.isArray(this.options.group)?-1!==e.inArray(t,this.options.group):this.options.group===t},isValid:function(t){if(arguments.length>=1&&!e.isPlainObject(t)){a.warnOnce("Calling isValid on a parsley field without passing arguments as an object is deprecated.");var i=_slice.call(arguments),n=i[0],r=i[1];t={force:n,value:r}}var s=this.whenValid(t);return!s||A[s.state()]},whenValid:function(){var t=this,i=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=i.force,r=void 0!==n&&n,s=i.value,o=i.group,l=i._refreshed;if(l||this.refreshConstraints(),!o||this._isInGroup(o)){if(this.validationResult=!0,!this.hasConstraints())return e.when();if("undefined"!=typeof s&&null!==s||(s=this.getValue()),!this.needsValidation(s)&&!0!==r)return e.when();var u=this._getGroupedConstraints(),d=[];return e.each(u,function(i,n){var r=a.all(e.map(n,function(e){return t._validateConstraint(s,e)}));if(d.push(r),"rejected"===r.state())return!1}),a.all(d)}},_validateConstraint:function(t,i){var n=this,r=i.validate(t,this);return!1===r&&(r=e.Deferred().reject()),a.all([r]).fail(function(e){n.validationResult instanceof Array||(n.validationResult=[]),n.validationResult.push({assert:i,errorMessage:"string"==typeof e&&e})})},getValue:function(){var e;return e="function"==typeof this.options.value?this.options.value(this):"undefined"!=typeof this.options.value?this.options.value:this.$element.val(),"undefined"==typeof e||null===e?"":this._handleWhitespace(e)},reset:function(){return this._resetUI(),this._trigger("reset")},destroy:function(){this._destroyUI(),this.$element.removeData("Parsley"),this.$element.removeData("FieldMultiple"),this._trigger("destroy")},refreshConstraints:function(){return this.actualizeOptions()._bindConstraints()},addConstraint:function(e,t,i,n){if(window.Parsley._validatorRegistry.validators[e]){var r=new F(this,e,t,i,n);"undefined"!==this.constraintsByName[r.name]&&this.removeConstraint(r.name),this.constraints.push(r),this.constraintsByName[r.name]=r}return this},removeConstraint:function(e){for(var t=0;t<this.constraints.length;t++)if(e===this.constraints[t].name){this.constraints.splice(t,1);break}return delete this.constraintsByName[e],this},updateConstraint:function(e,t,i){return this.removeConstraint(e).addConstraint(e,t,i)},_bindConstraints:function(){for(var e=[],t={},i=0;i<this.constraints.length;i++)!1===this.constraints[i].isDomConstraint&&(e.push(this.constraints[i]),t[this.constraints[i].name]=this.constraints[i]);this.constraints=e,this.constraintsByName=t;for(var n in this.options)this.addConstraint(n,this.options[n],void 0,!0);return this._bindHtml5Constraints()},_bindHtml5Constraints:function(){null!==this.element.getAttribute("required")&&this.addConstraint("required",!0,void 0,!0),null!==this.element.getAttribute("pattern")&&this.addConstraint("pattern",this.element.getAttribute("pattern"),void 0,!0);var e=this.element.getAttribute("min"),t=this.element.getAttribute("max");null!==e&&null!==t?this.addConstraint("range",[e,t],void 0,!0):null!==e?this.addConstraint("min",e,void 0,!0):null!==t&&this.addConstraint("max",t,void 0,!0),null!==this.element.getAttribute("minlength")&&null!==this.element.getAttribute("maxlength")?this.addConstraint("length",[this.element.getAttribute("minlength"),this.element.getAttribute("maxlength")],void 0,!0):null!==this.element.getAttribute("minlength")?this.addConstraint("minlength",this.element.getAttribute("minlength"),void 0,!0):null!==this.element.getAttribute("maxlength")&&this.addConstraint("maxlength",this.element.getAttribute("maxlength"),void 0,!0);var i=this.element.type;return"number"===i?this.addConstraint("type",["number",{step:this.element.getAttribute("step")||"1",base:e||this.element.getAttribute("value")}],void 0,!0):/^(email|url|range|date)$/i.test(i)?this.addConstraint("type",i,void 0,!0):this},_isRequired:function(){return"undefined"!=typeof this.constraintsByName.required&&!1!==this.constraintsByName.required.requirements},_trigger:function(e){return this.trigger("field:"+e)},_handleWhitespace:function(e){return!0===this.options.trimValue&&a.warnOnce('data-parsley-trim-value="true" is deprecated, please use data-parsley-whitespace="trim"'),"squish"===this.options.whitespace&&(e=e.replace(/\s{2,}/g," ")),"trim"!==this.options.whitespace&&"squish"!==this.options.whitespace&&!0!==this.options.trimValue||(e=a.trimString(e)),e},_isDateInput:function(){var e=this.constraintsByName.type;return e&&"date"===e.requirements},_getGroupedConstraints:function(){if(!1===this.options.priorityEnabled)return[this.constraints];for(var e=[],t={},i=0;i<this.constraints.length;i++){var n=this.constraints[i].priority;t[n]||e.push(t[n]=[]),t[n].push(this.constraints[i])}return e.sort(function(e,t){return t[0].priority-e[0].priority}),e}};var x=E,$=function(){this.__class__="FieldMultiple"};$.prototype={addElement:function(e){return this.$elements.push(e),this},refreshConstraints:function(){var t;if(this.constraints=[],"SELECT"===this.element.nodeName)return this.actualizeOptions()._bindConstraints(),
this;for(var i=0;i<this.$elements.length;i++)if(e("html").has(this.$elements[i]).length){t=this.$elements[i].data("FieldMultiple").refreshConstraints().constraints;for(var n=0;n<t.length;n++)this.addConstraint(t[n].name,t[n].requirements,t[n].priority,t[n].isDomConstraint)}else this.$elements.splice(i,1);return this},getValue:function(){if("function"==typeof this.options.value)return this.options.value(this);if("undefined"!=typeof this.options.value)return this.options.value;if("INPUT"===this.element.nodeName){if("radio"===this.element.type)return this._findRelated().filter(":checked").val()||"";if("checkbox"===this.element.type){var t=[];return this._findRelated().filter(":checked").each(function(){t.push(e(this).val())}),t}}return"SELECT"===this.element.nodeName&&null===this.$element.val()?[]:this.$element.val()},_init:function(){return this.$elements=[this.$element],this}};var P=function(t,i,n){this.element=t,this.$element=e(t);var r=this.$element.data("Parsley");if(r)return"undefined"!=typeof n&&r.parent===window.Parsley&&(r.parent=n,r._resetOptions(r.options)),"object"==typeof i&&_extends(r.options,i),r;if(!this.$element.length)throw new Error("You must bind Parsley on an existing element.");if("undefined"!=typeof n&&"Form"!==n.__class__)throw new Error("Parent instance must be a Form instance");return this.parent=n||window.Parsley,this.init(i)};P.prototype={init:function(e){return this.__class__="Parsley",this.__version__="2.7.2",this.__id__=a.generateID(),this._resetOptions(e),"FORM"===this.element.nodeName||a.checkAttr(this.element,this.options.namespace,"validate")&&!this.$element.is(this.options.inputs)?this.bind("parsleyForm"):this.isMultiple()?this.handleMultiple():this.bind("parsleyField")},isMultiple:function(){return"radio"===this.element.type||"checkbox"===this.element.type||"SELECT"===this.element.nodeName&&null!==this.element.getAttribute("multiple")},handleMultiple:function(){var t,i,n=this;if(this.options.multiple=this.options.multiple||(t=this.element.getAttribute("name"))||this.element.getAttribute("id"),"SELECT"===this.element.nodeName&&null!==this.element.getAttribute("multiple"))return this.options.multiple=this.options.multiple||this.__id__,this.bind("parsleyFieldMultiple");if(!this.options.multiple)return a.warn("To be bound by Parsley, a radio, a checkbox and a multiple select input must have either a name or a multiple option.",this.$element),this;this.options.multiple=this.options.multiple.replace(/(:|\.|\[|\]|\{|\}|\$)/g,""),t&&e('input[name="'+t+'"]').each(function(e,t){"radio"!==t.type&&"checkbox"!==t.type||t.setAttribute(n.options.namespace+"multiple",n.options.multiple)});for(var r=this._findRelated(),s=0;s<r.length;s++)if(i=e(r.get(s)).data("Parsley"),"undefined"!=typeof i){this.$element.data("FieldMultiple")||i.addElement(this.$element);break}return this.bind("parsleyField",!0),i||this.bind("parsleyFieldMultiple")},bind:function(t,i){var n;switch(t){case"parsleyForm":n=e.extend(new w(this.element,this.domOptions,this.options),new l,window.ParsleyExtend)._bindFields();break;case"parsleyField":n=e.extend(new x(this.element,this.domOptions,this.options,this.parent),new l,window.ParsleyExtend);break;case"parsleyFieldMultiple":n=e.extend(new x(this.element,this.domOptions,this.options,this.parent),new $,new l,window.ParsleyExtend)._init();break;default:throw new Error(t+"is not a supported Parsley type")}return this.options.multiple&&a.setAttr(this.element,this.options.namespace,"multiple",this.options.multiple),"undefined"!=typeof i?(this.$element.data("FieldMultiple",n),n):(this.$element.data("Parsley",n),n._actualizeTriggers(),n._trigger("init"),n)}};var V=e.fn.jquery.split(".");if(parseInt(V[0])<=1&&parseInt(V[1])<8)throw"The loaded version of jQuery is too old. Please upgrade to 1.8.x or better.";V.forEach||a.warn("Parsley requires ES5 to run properly. Please include https://github.com/es-shims/es5-shim");var O=_extends(new l,{element:document,$element:e(document),actualizeOptions:null,_resetOptions:null,Factory:P,version:"2.7.2"});_extends(x.prototype,y.Field,l.prototype),_extends(w.prototype,y.Form,l.prototype),_extends(P.prototype,l.prototype),e.fn.parsley=e.fn.psly=function(t){if(this.length>1){var i=[];return this.each(function(){i.push(e(this).parsley(t))}),i}return e(this).length?new P(this[0],t):void a.warn("You must bind Parsley on an existing element.")},"undefined"==typeof window.ParsleyExtend&&(window.ParsleyExtend={}),O.options=_extends(a.objectCreate(o),window.ParsleyConfig),window.ParsleyConfig=O.options,window.Parsley=window.psly=O,O.Utils=a,window.ParsleyUtils={},e.each(a,function(e,t){"function"==typeof t&&(window.ParsleyUtils[e]=function(){return a.warnOnce("Accessing `window.ParsleyUtils` is deprecated. Use `window.Parsley.Utils` instead."),a[e].apply(a,arguments)})});var M=window.Parsley._validatorRegistry=new p(window.ParsleyConfig.validators,window.ParsleyConfig.i18n);window.ParsleyValidator={},e.each("setLocale addCatalog addMessage addMessages getErrorMessage formatMessage addValidator updateValidator removeValidator".split(" "),function(e,t){window.Parsley[t]=function(){return M[t].apply(M,arguments)},window.ParsleyValidator[t]=function(){var e;return a.warnOnce("Accessing the method '"+t+"' through Validator is deprecated. Simply call 'window.Parsley."+t+"(...)'"),(e=window.Parsley)[t].apply(e,arguments)}}),window.Parsley.UI=y,window.ParsleyUI={removeError:function(e,t,i){var n=!0!==i;return a.warnOnce("Accessing UI is deprecated. Call 'removeError' on the instance directly. Please comment in issue 1073 as to your need to call this method."),e.removeError(t,{updateClass:n})},getErrorsMessages:function(e){return a.warnOnce("Accessing UI is deprecated. Call 'getErrorsMessages' on the instance directly."),e.getErrorsMessages()}},e.each("addError updateError".split(" "),function(e,t){window.ParsleyUI[t]=function(e,i,n,r,s){var o=!0!==s;return a.warnOnce("Accessing UI is deprecated. Call '"+t+"' on the instance directly. Please comment in issue 1073 as to your need to call this method."),e[t](i,{message:n,assert:r,updateClass:o})}}),!1!==window.ParsleyConfig.autoBind&&e(function(){e("[data-parsley-validate]").length&&e("[data-parsley-validate]").parsley()});var T=e({}),R=function(){a.warnOnce("Parsley's pubsub module is deprecated; use the 'on' and 'off' methods on parsley instances or window.Parsley")},D="parsley:";e.listen=function(e,n){var r;if(R(),"object"==typeof arguments[1]&&"function"==typeof arguments[2]&&(r=arguments[1],n=arguments[2]),"function"!=typeof n)throw new Error("Wrong parameters");window.Parsley.on(i(e),t(n,r))},e.listenTo=function(e,n,r){if(R(),!(e instanceof x||e instanceof w))throw new Error("Must give Parsley instance");if("string"!=typeof n||"function"!=typeof r)throw new Error("Wrong parameters");e.on(i(n),t(r))},e.unsubscribe=function(e,t){if(R(),"string"!=typeof e||"function"!=typeof t)throw new Error("Wrong arguments");window.Parsley.off(i(e),t.parsleyAdaptedCallback)},e.unsubscribeTo=function(e,t){if(R(),!(e instanceof x||e instanceof w))throw new Error("Must give Parsley instance");e.off(i(t))},e.unsubscribeAll=function(t){R(),window.Parsley.off(i(t)),e("form,input,textarea,select").each(function(){var n=e(this).data("Parsley");n&&n.off(i(t))})},e.emit=function(e,t){var n;R();var r=t instanceof x||t instanceof w,s=Array.prototype.slice.call(arguments,r?2:1);s.unshift(i(e)),r||(t=window.Parsley),(n=t).trigger.apply(n,_toConsumableArray(s))};e.extend(!0,O,{asyncValidators:{"default":{fn:function(e){return e.status>=200&&e.status<300},url:!1},reverse:{fn:function(e){return e.status<200||e.status>=300},url:!1}},addAsyncValidator:function(e,t,i,n){return O.asyncValidators[e]={fn:t,url:i||!1,options:n||{}},this}}),O.addValidator("remote",{requirementType:{"":"string",validator:"string",reverse:"boolean",options:"object"},validateString:function(t,i,n,r){var s,a,o={},l=n.validator||(!0===n.reverse?"reverse":"default");if("undefined"==typeof O.asyncValidators[l])throw new Error("Calling an undefined async validator: `"+l+"`");i=O.asyncValidators[l].url||i,i.indexOf("{value}")>-1?i=i.replace("{value}",encodeURIComponent(t)):o[r.element.getAttribute("name")||r.element.getAttribute("id")]=t;var u=e.extend(!0,n.options||{},O.asyncValidators[l].options);s=e.extend(!0,{},{url:i,data:o,type:"GET"},u),r.trigger("field:ajaxoptions",r,s),a=e.param(s),"undefined"==typeof O._remoteCache&&(O._remoteCache={});var d=O._remoteCache[a]=O._remoteCache[a]||e.ajax(s),h=function(){var t=O.asyncValidators[l].fn.call(r,d,i,n);return t||(t=e.Deferred().reject()),e.when(t)};return d.then(h,h)},priority:-1}),O.on("form:submit",function(){O._remoteCache={}}),l.prototype.addAsyncValidator=function(){return a.warnOnce("Accessing the method `addAsyncValidator` through an instance is deprecated. Simply call `Parsley.addAsyncValidator(...)`"),O.addAsyncValidator.apply(O,arguments)},O.addMessages("en",{defaultMessage:"This value seems to be invalid.",type:{email:"This value should be a valid email.",url:"This value should be a valid url.",number:"This value should be a valid number.",integer:"This value should be a valid integer.",digits:"This value should be digits.",alphanum:"This value should be alphanumeric."},notblank:"This value should not be blank.",required:"This value is required.",pattern:"This value seems to be invalid.",min:"This value should be greater than or equal to %s.",max:"This value should be lower than or equal to %s.",range:"This value should be between %s and %s.",minlength:"This value is too short. It should have %s characters or more.",maxlength:"This value is too long. It should have %s characters or fewer.",length:"This value length is invalid. It should be between %s and %s characters long.",mincheck:"You must select at least %s choices.",maxcheck:"You must select %s choices or fewer.",check:"You must select between %s and %s choices.",equalto:"This value should be the same."}),O.setLocale("en");var I=new n;I.install();var q=O;return q});
function PowermailForm(e){"use strict";this.initialize=function(){t(),a(),i(),r(),o(),n(),f(),l()};var t=function(){e.fn.powermailTabs&&e(".powermail_morestep").each(function(){e(this).powermailTabs()})},a=function(){e("form[data-powermail-ajax]").length&&p()},i=function(){if(e('*[data-powermail-location="prefill"]').length&&navigator.geolocation){e(this);navigator.geolocation.getCurrentPosition(function(t){var a=t.coords.latitude,i=t.coords.longitude,r=C()+"/index.php?eID=powermailEidGetLocation";jQuery.ajax({url:r,data:"lat="+a+"&lng="+i,cache:!1,success:function(t){t&&e('*[data-powermail-location="prefill"]').val(t)}})})}},r=function(){e.fn.datetimepicker&&e(".powermail_date").each(function(){var t=e(this);if("date"===t.prop("type")||"datetime-local"===t.prop("type")||"time"===t.prop("type")){if(!t.data("datepicker-force")){if(e(this).data("date-value")){var a=g(e(this).data("date-value"),e(this).data("datepicker-format"),t.prop("type"));null!==a&&e(this).val(a)}return}t.prop("type","text"),t.val(e(this).data("date-value"))}var i=!0,r=!0;"date"===t.data("datepicker-settings")?r=!1:"time"===t.data("datepicker-settings")&&(i=!1),t.datetimepicker({format:t.data("datepicker-format"),timepicker:r,datepicker:i,lang:"en",i18n:{en:{months:t.data("datepicker-months").split(","),dayOfWeek:t.data("datepicker-days").split(",")}}})})},o=function(){e(".powermail_all_type_password.powermail_all_value").html("********")},n=function(){e.fn.parsley&&e(".powermail_reset").on("click","",function(){e('form[data-parsley-validate="data-parsley-validate"]').parsley().reset()})},l=function(){window.Parsley&&(x(),b())},p=function(){var t,a=!1;e(document).on("submit","form[data-powermail-ajax]",function(i){var r=e(this),o=r.closest(".tx-powermail");r.data("powermail-ajax-uri")&&(t=r.data("powermail-ajax-uri"));var n=r.data("powermail-form");a||(e.ajax({type:"POST",url:r.prop("action"),data:new FormData(r.get(0)),contentType:!1,processData:!1,beforeSend:function(){s(r)},complete:function(){d(r),f(),c(o)},success:function(i){var o=e('*[data-powermail-form="'+n+'"]:first',i);o.length?(e('*[data-powermail-form="'+n+'"]:first').closest(".tx-powermail").html(o),e.fn.powermailTabs&&e(".powermail_morestep").powermailTabs(),e.fn.parsley&&e('form[data-parsley-validate="data-parsley-validate"]').parsley(),w()):(t?D(t):r.submit(),a=!0)}}),i.preventDefault())})},s=function(t){d(t),e(".powermail_submit",t).length?e(".powermail_submit",t).parent().append(y()):t.closest(".tx-powermail").append(y())},d=function(e){e.closest(".tx-powermail").find(".powermail_progressbar").remove()},c=function(t){var a=e.Event("submitted.powermail.form");t.trigger(a)},f=function(){e(".powermail_fieldwrap_file").find(".deleteAllFiles").each(function(){u(e(this).closest(".powermail_fieldwrap_file").find('input[type="file"]'))}),e(".deleteAllFiles").click(function(){m(e(this).closest(".powermail_fieldwrap_file").find('input[type="hidden"]')),e(this).closest("ul").fadeOut(function(){e(this).remove()})})},u=function(e){e.prop("disabled","disabled").addClass("hide").prop("type","hidden")},m=function(e){e.prop("disabled",!1).removeClass("hide").prop("type","file")},w=function(){e("img.powermail_captchaimage").each(function(){var t=h(e(this).prop("src"));e(this).prop("src",t+"?hash="+v(5))})},h=function(e){var t=e.split("?");return t[0]},v=function(e){for(var t="",a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=0;i<e;i++)t+=a.charAt(Math.floor(Math.random()*a.length));return t},g=function(e,t,a){var i=Date.parseDate(e,t);if(null===i)return null;var r=new Date(i),o=r.getFullYear()+"-";o+=("0"+(r.getMonth()+1)).slice(-2)+"-",o+=("0"+r.getDate()).slice(-2);var n=("0"+r.getHours()).slice(-2)+":"+("0"+r.getMinutes()).slice(-2),l=o+"T"+n;return"date"===a?o:"datetime-local"===a?l:"time"===a?n:null},y=function(){return e("<div />").addClass("powermail_progressbar").html(e("<div />").addClass("powermail_progress").html(e("<div />").addClass("powermail_progress_inner")))},_=function(e){for(var t=e.get(0),a=0,i=0;i<t.files.length;i++){var r=t.files[i];r.size>a&&(a=r.size)}return parseInt(a)},x=function(){window.Parsley.addValidator("powermailfilesize",function(t,a){if(a.indexOf(",")!==-1){var i=a.split(","),r=parseInt(i[0]),o=e('*[name="tx_powermail_pi1[field]['+i[1]+'][]"]');if(o.length&&_(o)>r)return!1}return!0},32).addMessage("en","powermailfilesize","Error")},b=function(){window.Parsley.addValidator("powermailfileextensions",function(t,a){var i=e('*[name="tx_powermail_pi1[field]['+a+'][]"]');return!i.length||k(j(t),i.prop("accept"))},32).addMessage("en","powermailfileextensions","Error")},k=function(e,t){return t.indexOf("."+e)!==-1},j=function(e){return e.split(".").pop().toLowerCase()},D=function(e){e.indexOf("http")!==-1?window.location=e:window.location.pathname=e},C=function(){var t;return t=e("base").length>0?jQuery("base").prop("href"):"https:"!=window.location.protocol?"http://"+window.location.hostname:"https://"+window.location.hostname}}jQuery(document).ready(function(e){"use strict";var t=new window.PowermailForm(e);t.initialize()});
function firstStepCheck(e){$(e).val().length>3?($(".step2").removeClass("inactive"),$(".locationfinderProgressbar").addClass("w33")):($(".step2").addClass("inactive"),$(".locationfinderProgressbar").removeClass("w33 w66 w100"))}function chooseCat(e){$(".step1").slideUp("400"),$(".step3").removeClass("hide").slideDown("400"),$(".step3 ."+e).show(),$(".locationfinderProgressbar").addClass("w66")}function chooseService(e){$(".locationfinderForm .serviceInput").val(e),$(".locationfinderForm").submit()}function backToCats(){$(".step1").slideDown("400"),$(".step3").addClass("hide").slideUp("400"),$(".step3 .services").hide(),$(".locationfinderProgressbar").removeClass("w66"),$("html, body").animate({scrollTop:$("#formAnchor").offset().top},600)}function checkForUrlArgs(){var e=getUrlParam("plz"),n=getUrlParam("cat"),i=getUrlParam("service");e>""&&($(".locationfinderForm .postalcodeInput").val(e),firstStepCheck(".locationfinderForm .postalcodeInput")),e>""&&n>""&&chooseCat(n),e>""&&n>""&&i>""&&chooseService(i)}function getUrlParam(e){var n=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(window.location.href);return n&&n[1]||void 0}$((function(){$(".locationfinderForm").length&&(firstStepCheck(".locationfinderForm .postalcodeInput"),checkForUrlArgs()),$(".locationfinderForm .postalcodeInput").on("input",(function(){firstStepCheck(this)})),$(document).on("keydown",".postalcodeInput",(function(e){return"Enter"!=e.key}))})),Parsley.addMessages("de",{defaultMessage:"Die Eingabe scheint nicht korrekt zu sein.",type:{email:"Die Eingabe muss eine gültige E-Mail-Adresse sein.",url:"Die Eingabe muss eine gültige URL sein.",number:"Die Eingabe muss eine Zahl sein.",integer:"Die Eingabe muss eine Zahl sein.",digits:"Die Eingabe darf nur Ziffern enthalten.",alphanum:"Die Eingabe muss alphanumerisch sein."},notblank:"Die Eingabe darf nicht leer sein.",required:"Dies ist ein Pflichtfeld.",pattern:"Die Eingabe scheint ungültig zu sein.",min:"Die Eingabe muss größer oder gleich %s sein.",max:"Die Eingabe muss kleiner oder gleich %s sein.",range:"Die Eingabe muss zwischen %s und %s liegen.",minlength:"Die Eingabe ist zu kurz. Es müssen mindestens %s Zeichen eingegeben werden.",maxlength:"Die Eingabe ist zu lang. Es dürfen höchstens %s Zeichen eingegeben werden.",length:"Die Länge der Eingabe ist ungültig. Es müssen zwischen %s und %s Zeichen eingegeben werden.",mincheck:"Wählen Sie mindestens %s Angaben aus.",maxcheck:"Wählen Sie maximal %s Angaben aus.",check:"Wählen Sie zwischen %s und %s Angaben.",equalto:"Dieses Feld muss dem anderen entsprechen.",dateiso:"Die Eingabe muss ein gültiges Datum sein (YYYY-MM-DD).",minwords:"Die Eingabe ist zu kurz. Sie muss aus %s oder mehr Wörtern bestehen.",maxwords:"Die Eingabe ist zu lang. Sie muss aus %s oder weniger Wörtern bestehen.",words:"Die Länge der Eingabe ist ungültig. Sie muss zwischen %s und %s Wörter enthalten.",gt:"Die Eingabe muss größer sein.",gte:"Die Eingabe muss größer oder gleich sein.",lt:"Die Eingabe muss kleiner sein.",lte:"Die Eingabe muss kleiner oder gleich sein."}),Parsley.setLocale("de"),$((function(){$("#c3142").length>0&&$(".result").length>0&&$(document).ready((function(){$("html, body").animate({scrollTop:$("#c3142").offset().top},1e3)}))}));
(function($) {
	$.fn.inputFilter = function(inputFilter) {
		return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
			if (inputFilter(this.value)) {
				this.oldValue = this.value;
				this.oldSelectionStart = this.selectionStart;
				this.oldSelectionEnd = this.selectionEnd;
			} else if (this.hasOwnProperty("oldValue")) {
				this.value = this.oldValue;
				this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
			}
		});
	};
}(jQuery));


var inputs = $('INPUT.categories');

inputs.inputFilter(function(value) {
	return /^\d*$/.test(value);
});

inputs.keyup(function(){
	var curVal = $(this).val();
	var curFactor = $(this).attr('data-factor');
	var curInput = $(this);
	if (curVal == 0) {
		// console.log('alle leeren');
		inputs.val('');
	} else {
		inputs.each(function(index, el) {					
			// console.log('weiter');
			var factorVal = $(this).attr('data-factor');
			var placeholderVal = $(this).attr('placeholder');
			if (factorVal == 1) {
				var sum = curVal / curFactor;
				// console.log('factorVal=1 '+sum);
				// console.log('factorVal=1 '+ curVal+'/'+curFactor +'='+sum);
			} else {
				var sum = curVal / curFactor * factorVal;
				// console.log(curVal+'/'+factorVal+'*'+curFactor +'='+sum);
			}
			$(this).not(curInput).val( Math.ceil(sum) );
		});
		// console.log('---');
	}



});
/*! rangeslider.js - v2.3.0 | (c) 2016 @andreruffert | MIT license | https://github.com/andreruffert/rangeslider.js */
function fillShareOfferForm(){var t=$(".product").find("input.amount70").val(),i=$(".product").find("input.amount240").val(),e=$(".product").find("input.amount350").val(),o=$(".product").find("input.amount500").val(),n=$(".product").find("input.amountfloorservice").val(),s=$(".product").find("select.intervalorder").val(),r=$(".product").find("select.contractperiod").val(),a=$(".product").find("select.contract").val(),l=$(".product").find(".servicetype").val();$(".offeramount70").val(t),$(".offeramount240").val(i),$(".offeramount350").val(e),$(".offeramount500").val(o),$(".offeramountfloorservice").val(n),$(".offerintervalorder").val(s),$(".offercontractperiod").val(r),$(".offercontract").val(a),$(".offerservicetype").val(l)}function roundNumber(t,i){if((""+t).includes("e")){var e=(""+t).split("e"),o="";return+e[1]+i>0&&(o="+"),+(Math.round(+e[0]+"e"+o+(+e[1]+i))+"e-"+i)}return+(Math.round(t+"e+"+i)+"e-"+i)}function quickPostalcodeCheck(){var t=$(".choosepostalcode .postalcode").val(),i=t.length;4==i?($(".hiddenpostalcode").val(t),$(".step2").removeClass("inactive"),$(".step1").addClass("inactive")):4!=i&&($(".step2").addClass("inactive"),$(".step1").removeClass("inactive"))}function checkDeliveryFeeCost(){$(".product").each((function(t,i){var e=parseInt($(this).find("input.amount70").val());if(isNaN(e))e=0;var o=parseInt($(this).find("input.amount240").val());if(isNaN(o))o=0;var n=parseInt($(this).find("input.amount350").val());if(isNaN(n))n=0;var s=parseInt($(this).find("input.amount500").val());if(isNaN(s))s=0;if(totalAmount=e+o+n+s,totalAmount<=5)var r=$(this).find(".deliveryfee").attr("data-deliveryfeecostupto5");else if(totalAmount<=10)r=$(this).find(".deliveryfee").attr("data-deliveryfeecostupto10");else if(totalAmount>10)r=$(this).find(".deliveryfee").attr("data-deliveryfeecostfrom11");$(this).find(".deliveryfeecostresult").text(r)}))}function setNewAmountfloorserviceMax(){$(".product").each((function(t,i){var e=parseInt($(this).find("input.amount70").val());if(isNaN(e))e=0;var o=parseInt($(this).find("input.amount240").val());if(isNaN(o))o=0;var n=parseInt($(this).find("input.amount350").val());if(isNaN(n))n=0;var s=parseInt($(this).find("input.amount500").val());if(isNaN(s))s=0;totalAmount=e+o,0==totalAmount?$(".amountfloorservice_wrap").addClass("notAvailable"):$(".amountfloorservice_wrap").removeClass("notAvailable"),$(".amountfloorservice").attr("max",totalAmount),$(".amountfloorservice").rangeslider("update",!0)}))}function valueOutput(){$('input[type="range"]').each((function(t,i){var e=$(this).val();$(this).next().find(".current_val").html(e)}))}function updateRangeSlider(t){var i=$(t).val(),e=$(t).attr("class");$(".product").each((function(t,o){$("."+e).val(i),$("."+e).rangeslider("update",!0),$("."+e+" .current_val").html(i)}))}function updateContractFee(t){1==t?$(".contractfee").hide():$(".contractfee").show()}function calcTotalRegularPrice(){$(".product").each((function(t,i){var e=$(i).attr("class").split(" ")[1],o=parseFloat($(i).data("servicetypeprice")),n=parseFloat($(i).data("pricerent")),s=parseFloat($(i).data("floorserviceprice")),r=parseFloat($(i).data("contractperiodpercent5years")),a=parseFloat($(i).data("contractperiodpercent1year")),l=parseInt($(i).find(".intervalorder").val()),c=parseInt($(i).find(".amountfloorservice").val()),_=parseInt($(i).find(".contractperiod").val()),p=$(".totalprice").html().toString().replace(",","."),d=$(".button.ordernow"),h=parseFloat($(i).data("price70"));if(isNaN(h))h=0;var u=parseFloat($(i).data("price240"));if(isNaN(u))u=0;var f=parseFloat($(i).data("price350"));if(isNaN(f))f=0;var g=parseFloat($(i).data("price500"));if(isNaN(g))g=0;var m=parseInt($(i).find(".amount70").val());if(isNaN(m))m=0;var v=parseInt($(i).find(".amount240").val());if(isNaN(v))v=0;var w=parseInt($(i).find(".amount350").val());if(isNaN(w))w=0;var y=parseInt($(i).find(".amount500").val());if(isNaN(y))y=0;var b=parseInt(m+v+w+y),C=1*h*m,I=1*u*v,O=1*f*w,T=1*g*y;if(b>5?$(this).find(".more5container").slideDown(400):$(this).find(".more5container").slideUp(400),1==l){var E=4*o,P=4;C=2*h*m}else if(2==l)E=2*o,P=4,C=2*h*m;else if(4==l)E=1*o,P=4;else if(8==l)E=1*o,P=8;else if(12==l)E=1*o,P=12;else if(16==l)E=1*o,P=16;var x=(E+C+I+O+T+c*s)/P*(52/12)+b*n;if(1==_)x=x+x/100*a;else if(5==_)x=x-x/100*r;if(0==b){d.attr("disabled","disabled").addClass("disabledBtn");x=roundNumber("0.00",2)}else{d.attr("disabled",!1).removeClass("disabledBtn");x=roundNumber(x,2)}$({numberValue:p}).animate({numberValue:x},{duration:500,easing:"linear",step:function(t){$(i).find(".totalprice").text(t.toFixed(2).toString().replace(".",","))}}),$(".offer"+e+"totalprice").val(x)}))}function updateDeliveryFee(t){1==t?$(".servicetype2").hide():$(".servicetype2").show()}function calcTotalSingularPrice(){$(".product").each((function(t,i){var e=$(i).attr("class").split(" ")[1],o=parseFloat($(i).data("driveprice14days")),n=parseFloat($(i).data("drivepricedirect")),s=parseFloat($(i).data("floorserviceprice")),r=parseFloat($(i).data("contractprice")),a=parseInt($(i).find(".amountfloorservice").val()),l=parseInt($(i).find(".servicetype").val()),c=$(".totalprice").html().toString().replace(",","."),_=$(".button.ordernow"),p=parseFloat($(i).data("price70"));if(isNaN(p))p=0;var d=parseFloat($(i).data("price240"));if(isNaN(d))d=0;var h=parseFloat($(i).data("price350"));if(isNaN(h))h=0;var u=parseFloat($(i).data("price500"));if(isNaN(u))u=0;var f=parseInt($(i).find(".amount70").val());if(isNaN(f))f=0;var g=parseInt($(i).find(".amount240").val());if(isNaN(g))g=0;var m=parseInt($(i).find(".amount350").val());if(isNaN(m))m=0;var v=parseInt($(i).find(".amount500").val());if(isNaN(v))v=0;var w=parseInt(f+g+m+v),y=0;if(w<=5)y=$(this).find(".deliveryfee").attr("data-deliveryfeecostupto5");else if(w<=10)y=$(this).find(".deliveryfee").attr("data-deliveryfeecostupto10");else if(w>10)y=$(this).find(".deliveryfee").attr("data-deliveryfeecostfrom11");y=(y=y.replace(" €","")).replace(",","."),y=parseFloat(y);if(1==l)var b=o;else if(2==l)b=n;w>5?$(this).find(".more5container").slideDown(400):$(this).find(".more5container").slideUp(400);var C=b+1*p*f+1*d*g+1*h*m+1*u*v+a*s+r+y;if(0==w){_.attr("disabled","disabled").addClass("disabledBtn");C=roundNumber("0.00",2)}else{_.attr("disabled",!1).removeClass("disabledBtn");C=roundNumber(C,2)}$({numberValue:c}).animate({numberValue:C},{duration:500,easing:"linear",step:function(t){$(i).find(".totalprice").text(t.toFixed(2).toString().replace(".",","))}}),$(".offer"+e+"totalprice").val(C)}))}function checkotherbilladdress(t){var i=$(".billdata_set");$(t).is(":checked")?($(t).addClass("showbilldata"),i.slideDown(),i.find("INPUT.required").attr("required","required")):($(t).removeClass("showbilldata"),i.slideUp(),i.find("INPUT.required").removeAttr("required"))}!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?module.exports=t(require("jquery")):t(jQuery)}((function($){"use strict";Number.isNaN=Number.isNaN||function(t){return"number"==typeof t&&t!=t};var t,i=0,e=((t=document.createElement("input")).setAttribute("type","range"),"text"!==t.type),o={polyfill:!0,orientation:"horizontal",rangeClass:"rangeslider",disabledClass:"rangeslider--disabled",activeClass:"rangeslider--active",horizontalClass:"rangeslider--horizontal",verticalClass:"rangeslider--vertical",fillClass:"rangeslider__fill",handleClass:"rangeslider__handle",startEvent:["mousedown","touchstart","pointerdown"],moveEvent:["mousemove","touchmove","pointermove"],endEvent:["mouseup","touchend","pointerup"]},n={orientation:{horizontal:{dimension:"width",direction:"left",directionStyle:"left",coordinate:"x"},vertical:{dimension:"height",direction:"top",directionStyle:"bottom",coordinate:"y"}}};function s(t){return t&&(0===t.offsetWidth||0===t.offsetHeight||!1===t.open)}function r(t,i){var e=function(t){for(var i=[],e=t.parentNode;s(e);)i.push(e),e=e.parentNode;return i}(t),o=e.length,n=[],r=t[i];function a(t){void 0!==t.open&&(t.open=!t.open)}if(o){for(var l=0;l<o;l++)n[l]=e[l].style.cssText,e[l].style.setProperty?e[l].style.setProperty("display","block","important"):e[l].style.cssText+=";display: block !important",e[l].style.height="0",e[l].style.overflow="hidden",e[l].style.visibility="hidden",a(e[l]);r=t[i];for(var c=0;c<o;c++)e[c].style.cssText=n[c],a(e[c])}return r}function a(t,i){var e=parseFloat(t);return Number.isNaN(e)?i:e}function l(t){return t.charAt(0).toUpperCase()+t.substr(1)}function c(t,s){if(this.$window=$(window),this.$document=$(document),this.$element=$(t),this.options=$.extend({},o,s),this.polyfill=this.options.polyfill,this.orientation=this.$element[0].getAttribute("data-orientation")||this.options.orientation,this.onInit=this.options.onInit,this.onSlide=this.options.onSlide,this.onSlideEnd=this.options.onSlideEnd,this.DIMENSION=n.orientation[this.orientation].dimension,this.DIRECTION=n.orientation[this.orientation].direction,this.DIRECTION_STYLE=n.orientation[this.orientation].directionStyle,this.COORDINATE=n.orientation[this.orientation].coordinate,this.polyfill&&e)return!1;this.identifier="js-rangeslider-"+i++,this.startEvent=this.options.startEvent.join("."+this.identifier+" ")+"."+this.identifier,this.moveEvent=this.options.moveEvent.join("."+this.identifier+" ")+"."+this.identifier,this.endEvent=this.options.endEvent.join("."+this.identifier+" ")+"."+this.identifier,this.toFixed=(this.step+"").replace(".","").length-1,this.$fill=$('<div class="'+this.options.fillClass+'" />'),this.$handle=$('<div class="'+this.options.handleClass+'" />'),this.$range=$('<div class="'+this.options.rangeClass+" "+this.options[this.orientation+"Class"]+'" id="'+this.identifier+'" />').insertAfter(this.$element).prepend(this.$fill,this.$handle),this.$element.css({position:"absolute",width:"1px",height:"1px",overflow:"hidden",opacity:"0"}),this.handleDown=$.proxy(this.handleDown,this),this.handleMove=$.proxy(this.handleMove,this),this.handleEnd=$.proxy(this.handleEnd,this),this.init();var r,a,l=this;this.$window.on("resize."+this.identifier,(r=function(){!function(t,i){var e=Array.prototype.slice.call(arguments,2);setTimeout((function(){return t.apply(null,e)}),i)}((function(){l.update(!1,!1)}),300)},a=(a=20)||100,function(){if(!r.debouncing){var t=Array.prototype.slice.apply(arguments);r.lastReturnVal=r.apply(window,t),r.debouncing=!0}return clearTimeout(r.debounceTimeout),r.debounceTimeout=setTimeout((function(){r.debouncing=!1}),a),r.lastReturnVal})),this.$document.on(this.startEvent,"#"+this.identifier+":not(."+this.options.disabledClass+")",this.handleDown),this.$element.on("change."+this.identifier,(function(t,i){if(!i||i.origin!==l.identifier){var e=t.target.value,o=l.getPositionFromValue(e);l.setPosition(o)}}))}return c.prototype.init=function(){this.update(!0,!1),this.onInit&&"function"==typeof this.onInit&&this.onInit()},c.prototype.update=function(t,i){(t=t||!1)&&(this.min=a(this.$element[0].getAttribute("min"),0),this.max=a(this.$element[0].getAttribute("max"),100),this.value=a(this.$element[0].value,Math.round(this.min+(this.max-this.min)/2)),this.step=a(this.$element[0].getAttribute("step"),1)),this.handleDimension=r(this.$handle[0],"offset"+l(this.DIMENSION)),this.rangeDimension=r(this.$range[0],"offset"+l(this.DIMENSION)),this.maxHandlePos=this.rangeDimension-this.handleDimension,this.grabPos=this.handleDimension/2,this.position=this.getPositionFromValue(this.value),this.$element[0].disabled?this.$range.addClass(this.options.disabledClass):this.$range.removeClass(this.options.disabledClass),this.setPosition(this.position,i)},c.prototype.handleDown=function(t){if(t.preventDefault(),this.$document.on(this.moveEvent,this.handleMove),this.$document.on(this.endEvent,this.handleEnd),this.$range.addClass(this.options.activeClass),!((" "+t.target.className+" ").replace(/[\n\t]/g," ").indexOf(this.options.handleClass)>-1)){var i=this.getRelativePosition(t),e=this.$range[0].getBoundingClientRect()[this.DIRECTION],o=this.getPositionFromNode(this.$handle[0])-e,n="vertical"===this.orientation?this.maxHandlePos-(i-this.grabPos):i-this.grabPos;this.setPosition(n),i>=o&&i<o+this.handleDimension&&(this.grabPos=i-o)}},c.prototype.handleMove=function(t){t.preventDefault();var i=this.getRelativePosition(t),e="vertical"===this.orientation?this.maxHandlePos-(i-this.grabPos):i-this.grabPos;this.setPosition(e)},c.prototype.handleEnd=function(t){t.preventDefault(),this.$document.off(this.moveEvent,this.handleMove),this.$document.off(this.endEvent,this.handleEnd),this.$range.removeClass(this.options.activeClass),this.$element.trigger("change",{origin:this.identifier}),this.onSlideEnd&&"function"==typeof this.onSlideEnd&&this.onSlideEnd(this.position,this.value)},c.prototype.cap=function(t,i,e){return t<i?i:t>e?e:t},c.prototype.setPosition=function(t,i){var e,o;void 0===i&&(i=!0),e=this.getValueFromPosition(this.cap(t,0,this.maxHandlePos)),o=this.getPositionFromValue(e),this.$fill[0].style[this.DIMENSION]=o+this.grabPos+"px",this.$handle[0].style[this.DIRECTION_STYLE]=o+"px",this.setValue(e),this.position=o,this.value=e,i&&this.onSlide&&"function"==typeof this.onSlide&&this.onSlide(o,e)},c.prototype.getPositionFromNode=function(t){for(var i=0;null!==t;)i+=t.offsetLeft,t=t.offsetParent;return i},c.prototype.getRelativePosition=function(t){var i=l(this.COORDINATE),e=this.$range[0].getBoundingClientRect()[this.DIRECTION],o=0;return void 0!==t.originalEvent["client"+i]?o=t.originalEvent["client"+i]:t.originalEvent.touches&&t.originalEvent.touches[0]&&void 0!==t.originalEvent.touches[0]["client"+i]?o=t.originalEvent.touches[0]["client"+i]:t.currentPoint&&void 0!==t.currentPoint[this.COORDINATE]&&(o=t.currentPoint[this.COORDINATE]),o-e},c.prototype.getPositionFromValue=function(t){var i;return i=(t-this.min)/(this.max-this.min),Number.isNaN(i)?0:i*this.maxHandlePos},c.prototype.getValueFromPosition=function(t){var i,e;return i=t/(this.maxHandlePos||1),e=this.step*Math.round(i*(this.max-this.min)/this.step)+this.min,Number(e.toFixed(this.toFixed))},c.prototype.setValue=function(t){t===this.value&&""!==this.$element[0].value||this.$element.val(t).trigger("input",{origin:this.identifier})},c.prototype.destroy=function(){this.$document.off("."+this.identifier),this.$window.off("."+this.identifier),this.$element.off("."+this.identifier).removeAttr("style").removeData("plugin_rangeslider"),this.$range&&this.$range.length&&this.$range[0].parentNode.removeChild(this.$range[0])},$.fn.rangeslider=function(t){var i=Array.prototype.slice.call(arguments,1);return this.each((function(){var e=$(this),o=e.data("plugin_rangeslider");o||e.data("plugin_rangeslider",o=new c(this,t)),"string"==typeof t&&o[t].apply(o,i)}))},"rangeslider.js is available in jQuery context e.g $(selector).rangeslider(options);"})),function(t,i){"function"==typeof define&&define.amd?define(["jquery"],(function(t){return i(t)})):"object"==typeof exports?module.exports=i(require("jquery")):i(jQuery)}(0,(function($){var t={animation:"fade",animationDuration:350,content:null,contentAsHTML:!1,contentCloning:!1,debug:!0,delay:300,delayTouch:[300,500],functionInit:null,functionBefore:null,functionReady:null,functionAfter:null,functionFormat:null,IEmin:6,interactive:!1,multiple:!1,parent:null,plugins:["sideTip"],repositionOnScroll:!1,restoration:"none",selfDestruction:!0,theme:[],timer:0,trackerInterval:500,trackOrigin:!1,trackTooltip:!1,trigger:"hover",triggerClose:{click:!1,mouseleave:!1,originClick:!1,scroll:!1,tap:!1,touchleave:!1},triggerOpen:{click:!1,mouseenter:!1,tap:!1,touchstart:!1},updateAnimation:"rotate",zIndex:9999999},i="undefined"!=typeof window?window:null,e={hasTouchCapability:!(!i||!("ontouchstart"in i||i.DocumentTouch&&i.document instanceof i.DocumentTouch||i.navigator.maxTouchPoints)),hasTransitions:function(){if(!i)return!1;var t=(i.document.body||i.document.documentElement).style,e="transition",o=["Moz","Webkit","Khtml","O","ms"];if("string"==typeof t[e])return!0;e=e.charAt(0).toUpperCase()+e.substr(1);for(var n=0;n<o.length;n++)if("string"==typeof t[o[n]+e])return!0;return!1}(),IE:!1,semVer:"4.2.7",window:i},o=function(){this.__$emitterPrivate=$({}),this.__$emitterPublic=$({}),this.__instancesLatestArr=[],this.__plugins={},this._env=e};function n(t){this.$container,this.constraints=null,this.__$tooltip,this.__init(t)}function s(t,i){var e=!0;return $.each(t,(function(o,n){if(void 0===i[o]||t[o]!==i[o])return e=!1,!1})),e}function r(t){var i=t.attr("id"),o=i?e.window.document.getElementById(i):null;return o?o===t[0]:$.contains(e.window.document.body,t[0])}o.prototype={__bridge:function(i,e,o){if(!e[o]){var n=function(){};n.prototype=i;var s=new n;s.__init&&s.__init(e),$.each(i,(function(i,n){0!=i.indexOf("__")&&(e[i]?t.debug&&console.log("The "+i+" method of the "+o+" plugin conflicts with another plugin or native methods"):(e[i]=function(){return s[i].apply(s,Array.prototype.slice.apply(arguments))},e[i].bridged=s))})),e[o]=s}return this},__setWindow:function(t){return e.window=t,this},_getRuler:function(t){return new n(t)},_off:function(){return this.__$emitterPrivate.off.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_on:function(){return this.__$emitterPrivate.on.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_one:function(){return this.__$emitterPrivate.one.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_plugin:function(t){var i=this;if("string"==typeof t){var e=t,o=null;return e.indexOf(".")>0?o=i.__plugins[e]:$.each(i.__plugins,(function(t,i){if(i.name.substring(i.name.length-e.length-1)=="."+e)return o=i,!1})),o}if(t.name.indexOf(".")<0)throw new Error("Plugins must be namespaced");return i.__plugins[t.name]=t,t.core&&i.__bridge(t.core,i,t.name),this},_trigger:function(){var t=Array.prototype.slice.apply(arguments);return"string"==typeof t[0]&&(t[0]={type:t[0]}),this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate,t),this.__$emitterPublic.trigger.apply(this.__$emitterPublic,t),this},instances:function(t){var i=[];return $(t||".tooltipstered").each((function(){var t=$(this),e=t.data("tooltipster-ns");e&&$.each(e,(function(e,o){i.push(t.data(o))}))})),i},instancesLatest:function(){return this.__instancesLatestArr},off:function(){return this.__$emitterPublic.off.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.__$emitterPublic.on.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.__$emitterPublic.one.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},origins:function(t){return $((t?t+" ":"")+".tooltipstered").toArray()},setDefaults:function(i){return $.extend(t,i),this},triggerHandler:function(){return this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this}},$.tooltipster=new o,$.Tooltipster=function(t,i){this.__callbacks={close:[],open:[]},this.__closingTime,this.__Content,this.__contentBcr,this.__destroyed=!1,this.__$emitterPrivate=$({}),this.__$emitterPublic=$({}),this.__enabled=!0,this.__garbageCollector,this.__Geometry,this.__lastPosition,this.__namespace="tooltipster-"+Math.round(1e6*Math.random()),this.__options,this.__$originParents,this.__pointerIsOverOrigin=!1,this.__previousThemes=[],this.__state="closed",this.__timeouts={close:[],open:null},this.__touchEvents=[],this.__tracker=null,this._$origin,this._$tooltip,this.__init(t,i)},$.Tooltipster.prototype={__init:function(i,o){var n=this;if(n._$origin=$(i),n.__options=$.extend(!0,{},t,o),n.__optionsFormat(),!e.IE||e.IE>=n.__options.IEmin){var s=null;if(void 0===n._$origin.data("tooltipster-initialTitle")&&(void 0===(s=n._$origin.attr("title"))&&(s=null),n._$origin.data("tooltipster-initialTitle",s)),null!==n.__options.content)n.__contentSet(n.__options.content);else{var r,a=n._$origin.attr("data-tooltip-content");a&&(r=$(a)),r&&r[0]?n.__contentSet(r.first()):n.__contentSet(s)}n._$origin.removeAttr("title").addClass("tooltipstered"),n.__prepareOrigin(),n.__prepareGC(),$.each(n.__options.plugins,(function(t,i){n._plug(i)})),e.hasTouchCapability&&$(e.window.document.body).on("touchmove."+n.__namespace+"-triggerOpen",(function(t){n._touchRecordEvent(t)})),n._on("created",(function(){n.__prepareTooltip()}))._on("repositioned",(function(t){n.__lastPosition=t.position}))}else n.__options.disabled=!0},__contentInsert:function(){var t=this,i=t._$tooltip.find(".tooltipster-content"),e=t.__Content;return t._trigger({type:"format",content:t.__Content,format:function(t){e=t}}),t.__options.functionFormat&&(e=t.__options.functionFormat.call(t,t,{origin:t._$origin[0]},t.__Content)),"string"!=typeof e||t.__options.contentAsHTML?i.empty().append(e):i.text(e),t},__contentSet:function(t){return t instanceof $&&this.__options.contentCloning&&(t=t.clone(!0)),this.__Content=t,this._trigger({type:"updated",content:t}),this},__destroyError:function(){throw new Error("This tooltip has been destroyed and cannot execute your method call.")},__geometry:function(){var t=this,i=t._$origin,o=t._$origin.is("area");if(o){var n=t._$origin.parent().attr("name");i=$('img[usemap="#'+n+'"]')}var s=i[0].getBoundingClientRect(),r=$(e.window.document),a=$(e.window),l=i,c={available:{document:null,window:null},document:{size:{height:r.height(),width:r.width()}},window:{scroll:{left:e.window.scrollX||e.window.document.documentElement.scrollLeft,top:e.window.scrollY||e.window.document.documentElement.scrollTop},size:{height:a.height(),width:a.width()}},origin:{fixedLineage:!1,offset:{},size:{height:s.bottom-s.top,width:s.right-s.left},usemapImage:o?i[0]:null,windowOffset:{bottom:s.bottom,left:s.left,right:s.right,top:s.top}}};if(o){var _=t._$origin.attr("shape"),p=t._$origin.attr("coords");if(p&&(p=p.split(","),$.map(p,(function(t,i){p[i]=parseInt(t)}))),"default"!=_)switch(_){case"circle":var d=p[0],h=p[1],u=p[2],f=h-u,g=d-u;c.origin.size.height=2*u,c.origin.size.width=c.origin.size.height,c.origin.windowOffset.left+=g,c.origin.windowOffset.top+=f;break;case"rect":var m=p[0],v=p[1],w=p[2],y=p[3];c.origin.size.height=y-v,c.origin.size.width=w-m,c.origin.windowOffset.left+=m,c.origin.windowOffset.top+=v;break;case"poly":for(var b=0,C=0,I=0,O=0,T="even",E=0;E<p.length;E++){var P=p[E];"even"==T?(P>I&&(I=P,0===E&&(b=I)),P<b&&(b=P),T="odd"):(P>O&&(O=P,1==E&&(C=O)),P<C&&(C=P),T="even")}c.origin.size.height=O-C,c.origin.size.width=I-b,c.origin.windowOffset.left+=b,c.origin.windowOffset.top+=C}}for(t._trigger({type:"geometry",edit:function(t){c.origin.size.height=t.height,c.origin.windowOffset.left=t.left,c.origin.windowOffset.top=t.top,c.origin.size.width=t.width},geometry:{height:c.origin.size.height,left:c.origin.windowOffset.left,top:c.origin.windowOffset.top,width:c.origin.size.width}}),c.origin.windowOffset.right=c.origin.windowOffset.left+c.origin.size.width,c.origin.windowOffset.bottom=c.origin.windowOffset.top+c.origin.size.height,c.origin.offset.left=c.origin.windowOffset.left+c.window.scroll.left,c.origin.offset.top=c.origin.windowOffset.top+c.window.scroll.top,c.origin.offset.bottom=c.origin.offset.top+c.origin.size.height,c.origin.offset.right=c.origin.offset.left+c.origin.size.width,c.available.document={bottom:{height:c.document.size.height-c.origin.offset.bottom,width:c.document.size.width},left:{height:c.document.size.height,width:c.origin.offset.left},right:{height:c.document.size.height,width:c.document.size.width-c.origin.offset.right},top:{height:c.origin.offset.top,width:c.document.size.width}},c.available.window={bottom:{height:Math.max(c.window.size.height-Math.max(c.origin.windowOffset.bottom,0),0),width:c.window.size.width},left:{height:c.window.size.height,width:Math.max(c.origin.windowOffset.left,0)},right:{height:c.window.size.height,width:Math.max(c.window.size.width-Math.max(c.origin.windowOffset.right,0),0)},top:{height:Math.max(c.origin.windowOffset.top,0),width:c.window.size.width}};"html"!=l[0].tagName.toLowerCase();){if("fixed"==l.css("position")){c.origin.fixedLineage=!0;break}l=l.parent()}return c},__optionsFormat:function(){return"number"==typeof this.__options.animationDuration&&(this.__options.animationDuration=[this.__options.animationDuration,this.__options.animationDuration]),"number"==typeof this.__options.delay&&(this.__options.delay=[this.__options.delay,this.__options.delay]),"number"==typeof this.__options.delayTouch&&(this.__options.delayTouch=[this.__options.delayTouch,this.__options.delayTouch]),"string"==typeof this.__options.theme&&(this.__options.theme=[this.__options.theme]),null===this.__options.parent?this.__options.parent=$(e.window.document.body):"string"==typeof this.__options.parent&&(this.__options.parent=$(this.__options.parent)),"hover"==this.__options.trigger?(this.__options.triggerOpen={mouseenter:!0,touchstart:!0},this.__options.triggerClose={mouseleave:!0,originClick:!0,touchleave:!0}):"click"==this.__options.trigger&&(this.__options.triggerOpen={click:!0,tap:!0},this.__options.triggerClose={click:!0,tap:!0}),this._trigger("options"),this},__prepareGC:function(){var t=this;return t.__options.selfDestruction?t.__garbageCollector=setInterval((function(){var i=(new Date).getTime();t.__touchEvents=$.grep(t.__touchEvents,(function(t,e){return i-t.time>6e4})),r(t._$origin)||t.close((function(){t.destroy()}))}),2e4):clearInterval(t.__garbageCollector),t},__prepareOrigin:function(){var t=this;if(t._$origin.off("."+t.__namespace+"-triggerOpen"),e.hasTouchCapability&&t._$origin.on("touchstart."+t.__namespace+"-triggerOpen touchend."+t.__namespace+"-triggerOpen touchcancel."+t.__namespace+"-triggerOpen",(function(i){t._touchRecordEvent(i)})),t.__options.triggerOpen.click||t.__options.triggerOpen.tap&&e.hasTouchCapability){var i="";t.__options.triggerOpen.click&&(i+="click."+t.__namespace+"-triggerOpen "),t.__options.triggerOpen.tap&&e.hasTouchCapability&&(i+="touchend."+t.__namespace+"-triggerOpen"),t._$origin.on(i,(function(i){t._touchIsMeaningfulEvent(i)&&t._open(i)}))}if(t.__options.triggerOpen.mouseenter||t.__options.triggerOpen.touchstart&&e.hasTouchCapability){i="";t.__options.triggerOpen.mouseenter&&(i+="mouseenter."+t.__namespace+"-triggerOpen "),t.__options.triggerOpen.touchstart&&e.hasTouchCapability&&(i+="touchstart."+t.__namespace+"-triggerOpen"),t._$origin.on(i,(function(i){!t._touchIsTouchEvent(i)&&t._touchIsEmulatedEvent(i)||(t.__pointerIsOverOrigin=!0,t._openShortly(i))}))}if(t.__options.triggerClose.mouseleave||t.__options.triggerClose.touchleave&&e.hasTouchCapability){i="";t.__options.triggerClose.mouseleave&&(i+="mouseleave."+t.__namespace+"-triggerOpen "),t.__options.triggerClose.touchleave&&e.hasTouchCapability&&(i+="touchend."+t.__namespace+"-triggerOpen touchcancel."+t.__namespace+"-triggerOpen"),t._$origin.on(i,(function(i){t._touchIsMeaningfulEvent(i)&&(t.__pointerIsOverOrigin=!1)}))}return t},__prepareTooltip:function(){var t=this,i=t.__options.interactive?"auto":"";return t._$tooltip.attr("id",t.__namespace).css({"pointer-events":i,zIndex:t.__options.zIndex}),$.each(t.__previousThemes,(function(i,e){t._$tooltip.removeClass(e)})),$.each(t.__options.theme,(function(i,e){t._$tooltip.addClass(e)})),t.__previousThemes=$.merge([],t.__options.theme),t},__scrollHandler:function(t){var i=this;if(i.__options.triggerClose.scroll)i._close(t);else if(r(i._$origin)&&r(i._$tooltip)){var o=null;if(t.target===e.window.document)i.__Geometry.origin.fixedLineage||i.__options.repositionOnScroll&&i.reposition(t);else{o=i.__geometry();var n=!1;if("fixed"!=i._$origin.css("position")&&i.__$originParents.each((function(t,i){var e=$(i),s=e.css("overflow-x"),r=e.css("overflow-y");if("visible"!=s||"visible"!=r){var a=i.getBoundingClientRect();if("visible"!=s&&(o.origin.windowOffset.left<a.left||o.origin.windowOffset.right>a.right))return n=!0,!1;if("visible"!=r&&(o.origin.windowOffset.top<a.top||o.origin.windowOffset.bottom>a.bottom))return n=!0,!1}if("fixed"==e.css("position"))return!1})),n)i._$tooltip.css("visibility","hidden");else if(i._$tooltip.css("visibility","visible"),i.__options.repositionOnScroll)i.reposition(t);else{var s=o.origin.offset.left-i.__Geometry.origin.offset.left,a=o.origin.offset.top-i.__Geometry.origin.offset.top;i._$tooltip.css({left:i.__lastPosition.coord.left+s,top:i.__lastPosition.coord.top+a})}}i._trigger({type:"scroll",event:t,geo:o})}return i},__stateSet:function(t){return this.__state=t,this._trigger({type:"state",state:t}),this},__timeoutsClear:function(){return clearTimeout(this.__timeouts.open),this.__timeouts.open=null,$.each(this.__timeouts.close,(function(t,i){clearTimeout(i)})),this.__timeouts.close=[],this},__trackerStart:function(){var t=this,i=t._$tooltip.find(".tooltipster-content");return t.__options.trackTooltip&&(t.__contentBcr=i[0].getBoundingClientRect()),t.__tracker=setInterval((function(){if(r(t._$origin)&&r(t._$tooltip)){if(t.__options.trackOrigin){var e=t.__geometry(),o=!1;s(e.origin.size,t.__Geometry.origin.size)&&(t.__Geometry.origin.fixedLineage?s(e.origin.windowOffset,t.__Geometry.origin.windowOffset)&&(o=!0):s(e.origin.offset,t.__Geometry.origin.offset)&&(o=!0)),o||(t.__options.triggerClose.mouseleave?t._close():t.reposition())}if(t.__options.trackTooltip){var n=i[0].getBoundingClientRect();n.height===t.__contentBcr.height&&n.width===t.__contentBcr.width||(t.reposition(),t.__contentBcr=n)}}else t._close()}),t.__options.trackerInterval),t},_close:function(t,i,o){var n=this,s=!0;if(n._trigger({type:"close",event:t,stop:function(){s=!1}}),s||o){i&&n.__callbacks.close.push(i),n.__callbacks.open=[],n.__timeoutsClear();var r=function(){$.each(n.__callbacks.close,(function(i,e){e.call(n,n,{event:t,origin:n._$origin[0]})})),n.__callbacks.close=[]};if("closed"!=n.__state){var a=!0,l=(new Date).getTime()+n.__options.animationDuration[1];if("disappearing"==n.__state&&l>n.__closingTime&&n.__options.animationDuration[1]>0&&(a=!1),a){n.__closingTime=l,"disappearing"!=n.__state&&n.__stateSet("disappearing");var c=function(){clearInterval(n.__tracker),n._trigger({type:"closing",event:t}),n._$tooltip.off("."+n.__namespace+"-triggerClose").removeClass("tooltipster-dying"),$(e.window).off("."+n.__namespace+"-triggerClose"),n.__$originParents.each((function(t,i){$(i).off("scroll."+n.__namespace+"-triggerClose")})),n.__$originParents=null,$(e.window.document.body).off("."+n.__namespace+"-triggerClose"),n._$origin.off("."+n.__namespace+"-triggerClose"),n._off("dismissable"),n.__stateSet("closed"),n._trigger({type:"after",event:t}),n.__options.functionAfter&&n.__options.functionAfter.call(n,n,{event:t,origin:n._$origin[0]}),r()};e.hasTransitions?(n._$tooltip.css({"-moz-animation-duration":n.__options.animationDuration[1]+"ms","-ms-animation-duration":n.__options.animationDuration[1]+"ms","-o-animation-duration":n.__options.animationDuration[1]+"ms","-webkit-animation-duration":n.__options.animationDuration[1]+"ms","animation-duration":n.__options.animationDuration[1]+"ms","transition-duration":n.__options.animationDuration[1]+"ms"}),n._$tooltip.clearQueue().removeClass("tooltipster-show").addClass("tooltipster-dying"),n.__options.animationDuration[1]>0&&n._$tooltip.delay(n.__options.animationDuration[1]),n._$tooltip.queue(c)):n._$tooltip.stop().fadeOut(n.__options.animationDuration[1],c)}}else r()}return n},_off:function(){return this.__$emitterPrivate.off.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_on:function(){return this.__$emitterPrivate.on.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_one:function(){return this.__$emitterPrivate.one.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_open:function(t,i){var o=this;if(!o.__destroying&&r(o._$origin)&&o.__enabled){var n=!0;if("closed"==o.__state&&(o._trigger({type:"before",event:t,stop:function(){n=!1}}),n&&o.__options.functionBefore&&(n=o.__options.functionBefore.call(o,o,{event:t,origin:o._$origin[0]}))),!1!==n&&null!==o.__Content){i&&o.__callbacks.open.push(i),o.__callbacks.close=[],
o.__timeoutsClear();var s,a=function(){"stable"!=o.__state&&o.__stateSet("stable"),$.each(o.__callbacks.open,(function(t,i){i.call(o,o,{origin:o._$origin[0],tooltip:o._$tooltip[0]})})),o.__callbacks.open=[]};if("closed"!==o.__state)s=0,"disappearing"===o.__state?(o.__stateSet("appearing"),e.hasTransitions?(o._$tooltip.clearQueue().removeClass("tooltipster-dying").addClass("tooltipster-show"),o.__options.animationDuration[0]>0&&o._$tooltip.delay(o.__options.animationDuration[0]),o._$tooltip.queue(a)):o._$tooltip.stop().fadeIn(a)):"stable"==o.__state&&a();else{if(o.__stateSet("appearing"),s=o.__options.animationDuration[0],o.__contentInsert(),o.reposition(t,!0),e.hasTransitions?(o._$tooltip.addClass("tooltipster-"+o.__options.animation).addClass("tooltipster-initial").css({"-moz-animation-duration":o.__options.animationDuration[0]+"ms","-ms-animation-duration":o.__options.animationDuration[0]+"ms","-o-animation-duration":o.__options.animationDuration[0]+"ms","-webkit-animation-duration":o.__options.animationDuration[0]+"ms","animation-duration":o.__options.animationDuration[0]+"ms","transition-duration":o.__options.animationDuration[0]+"ms"}),setTimeout((function(){"closed"!=o.__state&&(o._$tooltip.addClass("tooltipster-show").removeClass("tooltipster-initial"),o.__options.animationDuration[0]>0&&o._$tooltip.delay(o.__options.animationDuration[0]),o._$tooltip.queue(a))}),0)):o._$tooltip.css("display","none").fadeIn(o.__options.animationDuration[0],a),o.__trackerStart(),$(e.window).on("resize."+o.__namespace+"-triggerClose",(function(t){var i=$(document.activeElement);(i.is("input")||i.is("textarea"))&&$.contains(o._$tooltip[0],i[0])||o.reposition(t)})).on("scroll."+o.__namespace+"-triggerClose",(function(t){o.__scrollHandler(t)})),o.__$originParents=o._$origin.parents(),o.__$originParents.each((function(t,i){$(i).on("scroll."+o.__namespace+"-triggerClose",(function(t){o.__scrollHandler(t)}))})),o.__options.triggerClose.mouseleave||o.__options.triggerClose.touchleave&&e.hasTouchCapability){o._on("dismissable",(function(t){t.dismissable?t.delay?(p=setTimeout((function(){o._close(t.event)}),t.delay),o.__timeouts.close.push(p)):o._close(t):clearTimeout(p)}));var l=o._$origin,c="",_="",p=null;o.__options.interactive&&(l=l.add(o._$tooltip)),o.__options.triggerClose.mouseleave&&(c+="mouseenter."+o.__namespace+"-triggerClose ",_+="mouseleave."+o.__namespace+"-triggerClose "),o.__options.triggerClose.touchleave&&e.hasTouchCapability&&(c+="touchstart."+o.__namespace+"-triggerClose",_+="touchend."+o.__namespace+"-triggerClose touchcancel."+o.__namespace+"-triggerClose"),l.on(_,(function(t){if(o._touchIsTouchEvent(t)||!o._touchIsEmulatedEvent(t)){var i="mouseleave"==t.type?o.__options.delay:o.__options.delayTouch;o._trigger({delay:i[1],dismissable:!0,event:t,type:"dismissable"})}})).on(c,(function(t){!o._touchIsTouchEvent(t)&&o._touchIsEmulatedEvent(t)||o._trigger({dismissable:!1,event:t,type:"dismissable"})}))}o.__options.triggerClose.originClick&&o._$origin.on("click."+o.__namespace+"-triggerClose",(function(t){o._touchIsTouchEvent(t)||o._touchIsEmulatedEvent(t)||o._close(t)})),(o.__options.triggerClose.click||o.__options.triggerClose.tap&&e.hasTouchCapability)&&setTimeout((function(){if("closed"!=o.__state){var t="",i=$(e.window.document.body);o.__options.triggerClose.click&&(t+="click."+o.__namespace+"-triggerClose "),o.__options.triggerClose.tap&&e.hasTouchCapability&&(t+="touchend."+o.__namespace+"-triggerClose"),i.on(t,(function(t){o._touchIsMeaningfulEvent(t)&&(o._touchRecordEvent(t),o.__options.interactive&&$.contains(o._$tooltip[0],t.target)||o._close(t))})),o.__options.triggerClose.tap&&e.hasTouchCapability&&i.on("touchstart."+o.__namespace+"-triggerClose",(function(t){o._touchRecordEvent(t)}))}}),0),o._trigger("ready"),o.__options.functionReady&&o.__options.functionReady.call(o,o,{origin:o._$origin[0],tooltip:o._$tooltip[0]})}if(o.__options.timer>0){p=setTimeout((function(){o._close()}),o.__options.timer+s);o.__timeouts.close.push(p)}}}return o},_openShortly:function(t){var i=this,e=!0;if("stable"!=i.__state&&"appearing"!=i.__state&&!i.__timeouts.open&&(i._trigger({type:"start",event:t,stop:function(){e=!1}}),e)){var o=0==t.type.indexOf("touch")?i.__options.delayTouch:i.__options.delay;o[0]?i.__timeouts.open=setTimeout((function(){i.__timeouts.open=null,i.__pointerIsOverOrigin&&i._touchIsMeaningfulEvent(t)?(i._trigger("startend"),i._open(t)):i._trigger("startcancel")}),o[0]):(i._trigger("startend"),i._open(t))}return i},_optionsExtract:function(t,i){var e=this,o=$.extend(!0,{},i),n=e.__options[t];return n||(n={},$.each(i,(function(t,i){var o=e.__options[t];void 0!==o&&(n[t]=o)}))),$.each(o,(function(t,i){void 0!==n[t]&&("object"!=typeof i||i instanceof Array||null==i||"object"!=typeof n[t]||n[t]instanceof Array||null==n[t]?o[t]=n[t]:$.extend(o[t],n[t]))})),o},_plug:function(t){var i=$.tooltipster._plugin(t);if(!i)throw new Error('The "'+t+'" plugin is not defined');return i.instance&&$.tooltipster.__bridge(i.instance,this,i.name),this},_touchIsEmulatedEvent:function(t){for(var i=!1,e=(new Date).getTime(),o=this.__touchEvents.length-1;o>=0;o--){var n=this.__touchEvents[o];if(!(e-n.time<500))break;n.target===t.target&&(i=!0)}return i},_touchIsMeaningfulEvent:function(t){return this._touchIsTouchEvent(t)&&!this._touchSwiped(t.target)||!this._touchIsTouchEvent(t)&&!this._touchIsEmulatedEvent(t)},_touchIsTouchEvent:function(t){return 0==t.type.indexOf("touch")},_touchRecordEvent:function(t){return this._touchIsTouchEvent(t)&&(t.time=(new Date).getTime(),this.__touchEvents.push(t)),this},_touchSwiped:function(t){for(var i=!1,e=this.__touchEvents.length-1;e>=0;e--){var o=this.__touchEvents[e];if("touchmove"==o.type){i=!0;break}if("touchstart"==o.type&&t===o.target)break}return i},_trigger:function(){var t=Array.prototype.slice.apply(arguments);return"string"==typeof t[0]&&(t[0]={type:t[0]}),t[0].instance=this,t[0].origin=this._$origin?this._$origin[0]:null,t[0].tooltip=this._$tooltip?this._$tooltip[0]:null,this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate,t),$.tooltipster._trigger.apply($.tooltipster,t),this.__$emitterPublic.trigger.apply(this.__$emitterPublic,t),this},_unplug:function(t){var i=this;if(i[t]){var e=$.tooltipster._plugin(t);e.instance&&$.each(e.instance,(function(e,o){i[e]&&i[e].bridged===i[t]&&delete i[e]})),i[t].__destroy&&i[t].__destroy(),delete i[t]}return i},close:function(t){return this.__destroyed?this.__destroyError():this._close(null,t),this},content:function(t){var i=this;if(void 0===t)return i.__Content;if(i.__destroyed)i.__destroyError();else if(i.__contentSet(t),null!==i.__Content){if("closed"!==i.__state&&(i.__contentInsert(),i.reposition(),i.__options.updateAnimation))if(e.hasTransitions){var o=i.__options.updateAnimation;i._$tooltip.addClass("tooltipster-update-"+o),setTimeout((function(){"closed"!=i.__state&&i._$tooltip.removeClass("tooltipster-update-"+o)}),1e3)}else i._$tooltip.fadeTo(200,.5,(function(){"closed"!=i.__state&&i._$tooltip.fadeTo(200,1)}))}else i._close();return i},destroy:function(){var t=this;if(t.__destroyed)t.__destroyError();else{"closed"!=t.__state?t.option("animationDuration",0)._close(null,null,!0):t.__timeoutsClear(),t._trigger("destroy"),t.__destroyed=!0,t._$origin.removeData(t.__namespace).off("."+t.__namespace+"-triggerOpen"),$(e.window.document.body).off("."+t.__namespace+"-triggerOpen");var i=t._$origin.data("tooltipster-ns");if(i)if(1===i.length){var o=null;"previous"==t.__options.restoration?o=t._$origin.data("tooltipster-initialTitle"):"current"==t.__options.restoration&&(o="string"==typeof t.__Content?t.__Content:$("<div></div>").append(t.__Content).html()),o&&t._$origin.attr("title",o),t._$origin.removeClass("tooltipstered"),t._$origin.removeData("tooltipster-ns").removeData("tooltipster-initialTitle")}else i=$.grep(i,(function(i,e){return i!==t.__namespace})),t._$origin.data("tooltipster-ns",i);t._trigger("destroyed"),t._off(),t.off(),t.__Content=null,t.__$emitterPrivate=null,t.__$emitterPublic=null,t.__options.parent=null,t._$origin=null,t._$tooltip=null,$.tooltipster.__instancesLatestArr=$.grep($.tooltipster.__instancesLatestArr,(function(i,e){return t!==i})),clearInterval(t.__garbageCollector)}return t},disable:function(){return this.__destroyed?(this.__destroyError(),this):(this._close(),this.__enabled=!1,this)},elementOrigin:function(){if(!this.__destroyed)return this._$origin[0];this.__destroyError()},elementTooltip:function(){return this._$tooltip?this._$tooltip[0]:null},enable:function(){return this.__enabled=!0,this},hide:function(t){return this.close(t)},instance:function(){return this},off:function(){return this.__destroyed||this.__$emitterPublic.off.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.on.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.one.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},open:function(t){return this.__destroyed?this.__destroyError():this._open(null,t),this},option:function(t,i){return void 0===i?this.__options[t]:(this.__destroyed?this.__destroyError():(this.__options[t]=i,this.__optionsFormat(),$.inArray(t,["trigger","triggerClose","triggerOpen"])>=0&&this.__prepareOrigin(),"selfDestruction"===t&&this.__prepareGC()),this)},reposition:function(t,i){var e=this;return e.__destroyed?e.__destroyError():"closed"!=e.__state&&r(e._$origin)&&(i||r(e._$tooltip))&&(i||e._$tooltip.detach(),e.__Geometry=e.__geometry(),e._trigger({type:"reposition",event:t,helper:{geo:e.__Geometry}})),e},show:function(t){return this.open(t)},status:function(){return{destroyed:this.__destroyed,enabled:this.__enabled,open:"closed"!==this.__state,state:this.__state}},triggerHandler:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this}},$.fn.tooltipster=function(){var i=Array.prototype.slice.apply(arguments),e="You are using a single HTML element as content for several tooltips. You probably want to set the contentCloning option to TRUE.";if(0===this.length)return this;if("string"==typeof i[0]){var o="#*$~&";return this.each((function(){var t=$(this).data("tooltipster-ns"),n=t?$(this).data(t[0]):null;if(!n)throw new Error("You called Tooltipster's \""+i[0]+'" method on an uninitialized element');if("function"!=typeof n[i[0]])throw new Error('Unknown method "'+i[0]+'"');this.length>1&&"content"==i[0]&&(i[1]instanceof $||"object"==typeof i[1]&&null!=i[1]&&i[1].tagName)&&!n.__options.contentCloning&&n.__options.debug&&console.log(e);var s=n[i[0]](i[1],i[2]);if(s!==n||"instance"===i[0])return o=s,!1})),"#*$~&"!==o?o:this}$.tooltipster.__instancesLatestArr=[];var n=i[0]&&void 0!==i[0].multiple,s=n&&i[0].multiple||!n&&t.multiple,r=i[0]&&void 0!==i[0].content,a=r&&i[0].content||!r&&t.content,l=i[0]&&void 0!==i[0].contentCloning,c=l&&i[0].contentCloning||!l&&t.contentCloning,_=i[0]&&void 0!==i[0].debug,p=_&&i[0].debug||!_&&t.debug;return this.length>1&&(a instanceof $||"object"==typeof a&&null!=a&&a.tagName)&&!c&&p&&console.log(e),this.each((function(){var t=!1,e=$(this),o=e.data("tooltipster-ns"),n=null;o?s?t=!0:p&&(console.log("Tooltipster: one or more tooltips are already attached to the element below. Ignoring."),console.log(this)):t=!0,t&&(n=new $.Tooltipster(this,i[0]),o||(o=[]),o.push(n.__namespace),e.data("tooltipster-ns",o),e.data(n.__namespace,n),n.__options.functionInit&&n.__options.functionInit.call(n,n,{origin:this}),n._trigger("init")),$.tooltipster.__instancesLatestArr.push(n)})),this},n.prototype={__init:function(t){this.__$tooltip=t,this.__$tooltip.css({left:0,overflow:"hidden",position:"absolute",top:0}).find(".tooltipster-content").css("overflow","auto"),this.$container=$('<div class="tooltipster-ruler"></div>').append(this.__$tooltip).appendTo(e.window.document.body)},__forceRedraw:function(){var t=this.__$tooltip.parent();this.__$tooltip.detach(),this.__$tooltip.appendTo(t)},constrain:function(t,i){return this.constraints={width:t,height:i},this.__$tooltip.css({display:"block",height:"",overflow:"auto",width:t}),this},destroy:function(){this.__$tooltip.detach().find(".tooltipster-content").css({display:"",overflow:""}),this.$container.remove()},free:function(){return this.constraints=null,this.__$tooltip.css({display:"",height:"",overflow:"visible",width:""}),this},measure:function(){this.__forceRedraw();var t=this.__$tooltip[0].getBoundingClientRect(),i={size:{height:t.height||t.bottom-t.top,width:t.width||t.right-t.left}};if(this.constraints){var o=this.__$tooltip.find(".tooltipster-content"),n=this.__$tooltip.outerHeight(),s=o[0].getBoundingClientRect(),r={height:n<=this.constraints.height,width:t.width<=this.constraints.width&&s.width>=o[0].scrollWidth-1};i.fits=r.height&&r.width}return e.IE&&e.IE<=11&&i.size.width!==e.window.document.documentElement.clientWidth&&(i.size.width=Math.ceil(i.size.width)+1),i}};var a=navigator.userAgent.toLowerCase();-1!=a.indexOf("msie")?e.IE=parseInt(a.split("msie")[1]):-1!==a.toLowerCase().indexOf("trident")&&-1!==a.indexOf(" rv:11")?e.IE=11:-1!=a.toLowerCase().indexOf("edge/")&&(e.IE=parseInt(a.toLowerCase().split("edge/")[1]));var l="tooltipster.sideTip";return $.tooltipster._plugin({name:l,instance:{__defaults:function(){return{arrow:!0,distance:6,functionPosition:null,maxWidth:null,minIntersection:16,minWidth:0,position:null,side:"top",viewportAware:!0}},__init:function(t){var i=this;i.__instance=t,i.__namespace="tooltipster-sideTip-"+Math.round(1e6*Math.random()),i.__previousState="closed",i.__options,i.__optionsFormat(),i.__instance._on("state."+i.__namespace,(function(t){"closed"==t.state?i.__close():"appearing"==t.state&&"closed"==i.__previousState&&i.__create(),i.__previousState=t.state})),i.__instance._on("options."+i.__namespace,(function(){i.__optionsFormat()})),i.__instance._on("reposition."+i.__namespace,(function(t){i.__reposition(t.event,t.helper)}))},__close:function(){this.__instance.content()instanceof $&&this.__instance.content().detach(),this.__instance._$tooltip.remove(),this.__instance._$tooltip=null},__create:function(){var t=$('<div class="tooltipster-base tooltipster-sidetip"><div class="tooltipster-box"><div class="tooltipster-content"></div></div><div class="tooltipster-arrow"><div class="tooltipster-arrow-uncropped"><div class="tooltipster-arrow-border"></div><div class="tooltipster-arrow-background"></div></div></div></div>');this.__options.arrow||t.find(".tooltipster-box").css("margin",0).end().find(".tooltipster-arrow").hide(),this.__options.minWidth&&t.css("min-width",this.__options.minWidth+"px"),this.__options.maxWidth&&t.css("max-width",this.__options.maxWidth+"px"),this.__instance._$tooltip=t,this.__instance._trigger("created")},__destroy:function(){this.__instance._off("."+self.__namespace)},__optionsFormat:function(){var t=this;if(t.__options=t.__instance._optionsExtract(l,t.__defaults()),t.__options.position&&(t.__options.side=t.__options.position),"object"!=typeof t.__options.distance&&(t.__options.distance=[t.__options.distance]),t.__options.distance.length<4&&(void 0===t.__options.distance[1]&&(t.__options.distance[1]=t.__options.distance[0]),void 0===t.__options.distance[2]&&(t.__options.distance[2]=t.__options.distance[0]),void 0===t.__options.distance[3]&&(t.__options.distance[3]=t.__options.distance[1]),t.__options.distance={top:t.__options.distance[0],right:t.__options.distance[1],bottom:t.__options.distance[2],left:t.__options.distance[3]}),"string"==typeof t.__options.side){t.__options.side=[t.__options.side,{top:"bottom",right:"left",bottom:"top",left:"right"}[t.__options.side]],"left"==t.__options.side[0]||"right"==t.__options.side[0]?t.__options.side.push("top","bottom"):t.__options.side.push("right","left")}6===$.tooltipster._env.IE&&!0!==t.__options.arrow&&(t.__options.arrow=!1)},__reposition:function(t,i){var e,o=this,n=o.__targetFind(i),s=[];o.__instance._$tooltip.detach();var r=o.__instance._$tooltip.clone(),a=$.tooltipster._getRuler(r),l=!1,c=o.__instance.option("animation");switch(c&&r.removeClass("tooltipster-"+c),$.each(["window","document"],(function(e,c){var _=null;if(o.__instance._trigger({container:c,helper:i,satisfied:l,takeTest:function(t){_=t},results:s,type:"positionTest"}),1==_||0!=_&&0==l&&("window"!=c||o.__options.viewportAware))for(e=0;e<o.__options.side.length;e++){var p={horizontal:0,vertical:0},d=o.__options.side[e];"top"==d||"bottom"==d?p.vertical=o.__options.distance[d]:p.horizontal=o.__options.distance[d],o.__sideChange(r,d),$.each(["natural","constrained"],(function(e,r){if(_=null,o.__instance._trigger({container:c,event:t,helper:i,mode:r,results:s,satisfied:l,side:d,takeTest:function(t){_=t},type:"positionTest"}),1==_||0!=_&&0==l){var h={container:c,distance:p,fits:null,mode:r,outerSize:null,side:d,size:null,target:n[d],whole:null},u=("natural"==r?a.free():a.constrain(i.geo.available[c][d].width-p.horizontal,i.geo.available[c][d].height-p.vertical)).measure();if(h.size=u.size,h.outerSize={height:u.size.height+p.vertical,width:u.size.width+p.horizontal},"natural"==r?i.geo.available[c][d].width>=h.outerSize.width&&i.geo.available[c][d].height>=h.outerSize.height?h.fits=!0:h.fits=!1:h.fits=u.fits,"window"==c&&(h.fits?h.whole="top"==d||"bottom"==d?i.geo.origin.windowOffset.right>=o.__options.minIntersection&&i.geo.window.size.width-i.geo.origin.windowOffset.left>=o.__options.minIntersection:i.geo.origin.windowOffset.bottom>=o.__options.minIntersection&&i.geo.window.size.height-i.geo.origin.windowOffset.top>=o.__options.minIntersection:h.whole=!1),s.push(h),h.whole)l=!0;else if("natural"==h.mode&&(h.fits||h.size.width<=i.geo.available[c][d].width))return!1}}))}})),o.__instance._trigger({edit:function(t){s=t},event:t,helper:i,results:s,type:"positionTested"}),s.sort((function(t,i){return t.whole&&!i.whole?-1:!t.whole&&i.whole?1:t.whole&&i.whole?(e=o.__options.side.indexOf(t.side))<(n=o.__options.side.indexOf(i.side))?-1:e>n?1:"natural"==t.mode?-1:1:t.fits&&!i.fits?-1:!t.fits&&i.fits?1:t.fits&&i.fits?(e=o.__options.side.indexOf(t.side))<(n=o.__options.side.indexOf(i.side))?-1:e>n?1:"natural"==t.mode?-1:1:"document"==t.container&&"bottom"==t.side&&"natural"==t.mode?-1:1;var e,n})),(e=s[0]).coord={},e.side){case"left":case"right":e.coord.top=Math.floor(e.target-e.size.height/2);break;case"bottom":case"top":e.coord.left=Math.floor(e.target-e.size.width/2)}switch(e.side){case"left":e.coord.left=i.geo.origin.windowOffset.left-e.outerSize.width;break;case"right":e.coord.left=i.geo.origin.windowOffset.right+e.distance.horizontal;break;case"top":e.coord.top=i.geo.origin.windowOffset.top-e.outerSize.height;break;case"bottom":e.coord.top=i.geo.origin.windowOffset.bottom+e.distance.vertical}"window"==e.container?"top"==e.side||"bottom"==e.side?e.coord.left<0?i.geo.origin.windowOffset.right-this.__options.minIntersection>=0?e.coord.left=0:e.coord.left=i.geo.origin.windowOffset.right-this.__options.minIntersection-1:e.coord.left>i.geo.window.size.width-e.size.width&&(i.geo.origin.windowOffset.left+this.__options.minIntersection<=i.geo.window.size.width?e.coord.left=i.geo.window.size.width-e.size.width:e.coord.left=i.geo.origin.windowOffset.left+this.__options.minIntersection+1-e.size.width):e.coord.top<0?i.geo.origin.windowOffset.bottom-this.__options.minIntersection>=0?e.coord.top=0:e.coord.top=i.geo.origin.windowOffset.bottom-this.__options.minIntersection-1:e.coord.top>i.geo.window.size.height-e.size.height&&(i.geo.origin.windowOffset.top+this.__options.minIntersection<=i.geo.window.size.height?e.coord.top=i.geo.window.size.height-e.size.height:e.coord.top=i.geo.origin.windowOffset.top+this.__options.minIntersection+1-e.size.height):(e.coord.left>i.geo.window.size.width-e.size.width&&(e.coord.left=i.geo.window.size.width-e.size.width),e.coord.left<0&&(e.coord.left=0)),o.__sideChange(r,e.side),i.tooltipClone=r[0],i.tooltipParent=o.__instance.option("parent").parent[0],i.mode=e.mode,i.whole=e.whole,i.origin=o.__instance._$origin[0],i.tooltip=o.__instance._$tooltip[0],delete e.container,delete e.fits,delete e.mode,delete e.outerSize,delete e.whole,e.distance=e.distance.horizontal||e.distance.vertical;var _,p,d,h=$.extend(!0,{},e);if(o.__instance._trigger({edit:function(t){e=t},event:t,helper:i,position:h,type:"position"}),o.__options.functionPosition){var u=o.__options.functionPosition.call(o,o.__instance,i,h);u&&(e=u)}a.destroy(),"top"==e.side||"bottom"==e.side?(_={prop:"left",val:e.target-e.coord.left},p=e.size.width-this.__options.minIntersection):(_={prop:"top",val:e.target-e.coord.top},p=e.size.height-this.__options.minIntersection),_.val<this.__options.minIntersection?_.val=this.__options.minIntersection:_.val>p&&(_.val=p),d=i.geo.origin.fixedLineage?i.geo.origin.windowOffset:{left:i.geo.origin.windowOffset.left+i.geo.window.scroll.left,top:i.geo.origin.windowOffset.top+i.geo.window.scroll.top},e.coord={left:d.left+(e.coord.left-i.geo.origin.windowOffset.left),top:d.top+(e.coord.top-i.geo.origin.windowOffset.top)},o.__sideChange(o.__instance._$tooltip,e.side),i.geo.origin.fixedLineage?o.__instance._$tooltip.css("position","fixed"):o.__instance._$tooltip.css("position",""),o.__instance._$tooltip.css({left:e.coord.left,top:e.coord.top,height:e.size.height,width:e.size.width}).find(".tooltipster-arrow").css({left:"",top:""}).css(_.prop,_.val),o.__instance._$tooltip.appendTo(o.__instance.option("parent")),o.__instance._trigger({type:"repositioned",event:t,position:e})},__sideChange:function(t,i){t.removeClass("tooltipster-bottom").removeClass("tooltipster-left").removeClass("tooltipster-right").removeClass("tooltipster-top").addClass("tooltipster-"+i)},__targetFind:function(t){var i={},e=this.__instance._$origin[0].getClientRects();e.length>1&&(1==this.__instance._$origin.css("opacity")&&(this.__instance._$origin.css("opacity",.99),e=this.__instance._$origin[0].getClientRects(),this.__instance._$origin.css("opacity",1)));if(e.length<2)i.top=Math.floor(t.geo.origin.windowOffset.left+t.geo.origin.size.width/2),i.bottom=i.top,i.left=Math.floor(t.geo.origin.windowOffset.top+t.geo.origin.size.height/2),i.right=i.left;else{var o=e[0];i.top=Math.floor(o.left+(o.right-o.left)/2),o=e.length>2?e[Math.ceil(e.length/2)-1]:e[0],i.right=Math.floor(o.top+(o.bottom-o.top)/2),o=e[e.length-1],i.bottom=Math.floor(o.left+(o.right-o.left)/2),o=e.length>2?e[Math.ceil((e.length+1)/2)-1]:e[e.length-1],i.left=Math.floor(o.top+(o.bottom-o.top)/2)}return i}}}),$})),$.fn.equalHeights=function(){var t=0,i=$(this);return i.each((function(){var i=$(this).innerHeight();i>t&&(t=i)})),i.css("min-height",t)},$((function(){if($(".choosepostalcode").length){quickPostalcodeCheck();var t=$(".choosepostalcode .postalcode");t.inputFilter((function(t){return/^\d*$/.test(t)})),t.keyup((function(){quickPostalcodeCheck();var t=$(".choosepostalcode .postalcode").val();$(".hiddenpostalcode").val(t)})),$(".tx-order .choosepostalcode .grid3cols .col .shadowedge").click((function(t){$("html, body").animate({scrollTop:$(".col.col2.step2").offset().top},600)}))}})),$.fn.inputFilter=function(t){return this.on("input keydown keyup mousedown mouseup select contextmenu drop",(function(){t(this.value)?(this.oldValue=this.value,this.oldSelectionStart=this.selectionStart,this.oldSelectionEnd=this.selectionEnd):this.hasOwnProperty("oldValue")&&(this.value=this.oldValue,this.setSelectionRange(this.oldSelectionStart,this.oldSelectionEnd))}))},$((function(){if($(".orderregular_ordersingular").length){$(".employeeamount_inputwrap button").click((function(t){t.preventDefault()}));var t=$('input[type="range"]');t.rangeslider({polyfill:!1,onSlide:function(t,i){this.$range.find(".current_val").text(this.value)}}),$(".rangeslider__handle").append('<div class="current_val"></div>'),setNewAmountfloorserviceMax(),valueOutput(),checkDeliveryFeeCost(),t.change((function(){updateRangeSlider($(this)),setNewAmountfloorserviceMax(),checkDeliveryFeeCost()})),$(".producttop").equalHeights(),$(".shortdescription").equalHeights(),$(".open-popup-link").magnificPopup({type:"inline"}),$(".shareofferbtn").click((function(t){$(".hiddenshareofferform").show(),$(".hiddenshareofferform")[0].reset(),$(".shareoffersuccess").hide()})),$(".hiddenshareofferform").on("submit",(function(t){t.preventDefault(),$.ajax({type:"POST",cache:!1,url:$(this).attr("action"),data:$(this).serializeArray(),success:function(t){}})})),$(document).ajaxStart((function(){$(".hiddenshareofferform").hide(),$(".loadingajax").show()})).ajaxStop((function(){$(".loadingajax").hide(),$(".shareoffersuccess").fadeIn(400)}))}})),$((function(){$(".orderregular").length&&($(".intervalorder").change((function(){$(".intervalorder").val($(this).val())})),$(".contractperiod").change((function(){$(".contractperiod").val($(this).val())})),$(".contract").change((function(){var t=$(this).val();$(".contract").val(t),updateContractFee(t)})),$("INPUT, SELECT:not(.contract)").change((function(){calcTotalRegularPrice(),fillShareOfferForm()})),updateContractFee($(".contract").val()),calcTotalRegularPrice(),fillShareOfferForm())})),$((function(){$(".ordersingular").length&&($(".servicetype").change((function(){var t=$(this).val();$(".servicetype").val(t),updateDeliveryFee(t)})),$("INPUT, SELECT:not(.servicetype)").change((function(){calcTotalSingularPrice(),fillShareOfferForm()})),updateDeliveryFee($(".servicetype").val()),calcTotalSingularPrice(),fillShareOfferForm(),$(".categorieentry INPUT").keyup((function(){var t=$(".result INPUT.categorie1").val();$('.calculator[name="tx_order_order[calculator]"]').val(t),""!==t?$(".tx-order .orderregular_ordersingular.ordersingular .amount_calculator INPUT.button").removeClass("inactiv"):$(".tx-order .orderregular_ordersingular.ordersingular .amount_calculator INPUT.button").addClass("inactiv")})))})),$((function(){if($(".orderform").length){var t=$(".otherbilladdress");function i(t){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(t)}checkotherbilladdress(t),t.change((function(){checkotherbilladdress(this)})),$(".submitbtn").on("click",(function(){!function(){if($("INPUT.otherbilladdress").is(":checked")){var t=$("#billmail");if(!i(t.val()))return t.addClass("error"),t.focus(),!1;t.removeClass("error")}}(),$(".orderform").find("[required]:invalid").addClass("error");var t=$("#deliverymail");if(!i(t.val()))return t.addClass("error"),t.focus(),!1;t.removeClass("error")}))}})),$((function(){$(".ordercheck").length&&$(".orderform").submit((function(t){$(".orderform .submitbtn").addClass("loader")}))})),$((function(){$(".tx-order").length&&$(".ordertooltip").tooltipster({contentCloning:!0,trigger:"click",maxWidth:300,minWidth:100,side:["right","left"],theme:["tooltipster-customized"]})}));

var newOrder = {
	'customerType': 'business'
};

var allRelevantFields = $('.dpeOrderform INPUT:not(.switch-input,.otherRecipientsField,.orderButton), .dpeOrderform SELECT');

$(function(){

	// console.log('ordersteps js loading');

	allRelevantFields.on('change', function() {
		updateNewOrderObject(this);
	});

	$(document).on('change','.otherRecipientsField:not(.otherRecipientsXFirstName,.otherRecipientsXLastName)', function() {
		var recipientArray = newOrder.mailForwardingPersonArray ?? {};

		var otherRecipientEntry = $(this).parents('.otherRecipientEntry');

		var otherRecipientNum = otherRecipientEntry.attr('data-otherrecipientnum');

		recipientArray[otherRecipientNum] = {};
		$(this).parents('.otherRecipientEntry').find('INPUT').each(function(index, el) {
			var fieldVal = $(this).val();
			var fieldName = $(this).attr('id');
			recipientArray[otherRecipientNum][fieldName] = fieldVal;
		});

		newOrder['mailForwardingPersonArray'] = recipientArray;
	});

	$('.select-wrap:has(SELECT[readonly])').addClass('isReadonlySelect');

});
// ready end

function updateNewOrderObject(field) {
	var fieldVal = $(field).val();
	var fieldName = $(field).attr('id');
	newOrder[fieldName] = fieldVal;
}
function goToStep(targetStep,currentStep) {

	updateProgressbar(targetStep);

	if (targetStep > currentStep) {
		// go next - save
		// console.log('go next - save');
		if ($('.dpeOrderform').parsley().validate({group: 'step-' + currentStep})) {
			allRelevantFields.each(function(index, el) {
				updateNewOrderObject(this);
			});
			// console.log('section is valid moved to next');
			fadeToggleSteps(targetStep);

			if (typeof hj === "function") {
				var hjStep = 'dpe_step_' + targetStep;
				// console.log(hjStep);
				hj('event', hjStep);
			};
		} else {
			// console.log('section is not valid');
		}
		if (targetStep == 3) {
			updateContracts();
		}
		if (targetStep == 5) {
			fillOverviewData();
		} else {
			$('.step5 [class$="_overview"]').text('');
		}
	} else {

		// go prev
		// console.log('go prev');
		fadeToggleSteps(targetStep);
	}

	function fadeToggleSteps(targetStep) {
		$('.step').fadeOut('400').removeClass('current');
		$('.step.step'+targetStep).fadeIn('400').addClass('current');
		scrollTo('#stepAnchor');
	}
}
// goToStep END
function updateProgressbar(targetStep) {

	// $('.progressbar SPAN.progressbar_step').removeClass().addClass('progressbar_step'+targetStep);
	$('.progressbar SPAN[class^="progressbar_step"]').removeClass().addClass('progressbar_step'+targetStep);
	$('.progressbar UL LI[class^="step"]').removeClass('cur_step act_step');
	$('.progressbar UL LI.step'+targetStep).addClass('cur_step').prevAll().addClass('act_step');
}

function scrollTo(anchor) {
	if ($(anchor).length > 0) {
		var pos = $(anchor).offset();
		$("body, html").animate({
			scrollTop: pos.top
		}, 600);
	}
}



// only numbers Start
// https://jsfiddle.net/emkey08/tvx5e7q3
$.fn.inputFilter = function(inputFilter) {
	return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
		if (inputFilter(this.value)) {
			this.oldValue = this.value;
			this.oldSelectionStart = this.selectionStart;
			this.oldSelectionEnd = this.selectionEnd;
		} else if (this.hasOwnProperty("oldValue")) {
			this.value = this.oldValue;
			this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
		}
	});
};
// only numbers End




$(function(){

	// console.log('step1 js loading');
	$('.dpeOrderform .step1').show();


	if (newOrder.customerType == 'private') {
		checkCustomerType('private');
	}

	checkCustomerType('business');

	// $('.dpeOrderform .step1').show();

	$('.dpeOrderform .switch INPUT').on("change", function() {

		var customerType = $(this).val();

		// reset all data
		newOrder = [];

		// add to newOrder
		newOrder['customerType'] = customerType;

		checkCustomerType(customerType);

		allRelevantFields.each(function(index, el) {
			updateNewOrderObject(this);
		});
	});

});
// ready end

function checkCustomerType(customerType) {
	if (customerType == 'business') {
		$('.onlyPrivate INPUT.required:not(.otherRecipientsField), .onlyPrivate SELECT.required').removeAttr('required');
		$('.onlyPrivate INPUT, .onlyPrivate SELECT').val('');
		$('.onlyPrivate INPUT:not(.otherRecipientsField), .onlyPrivate SELECT').attr('disabled', 'disabled');
		$('.onlyPrivate').hide();
		$('.onlyBusiness').show();
		$('.onlyBusiness INPUT.required, .onlyBusiness SELECT.required').attr('required', 'required');
		$('.onlyBusiness INPUT, .onlyBusiness SELECT').removeAttr('disabled');
		// $('.tx-dpe-order .progressbar').removeClass('privateMode').addClass('businessMode');
	} else if (customerType == 'private') {
		$('.onlyBusiness INPUT.required, .onlyBusiness SELECT.required').removeAttr('required');
		$('.onlyBusiness INPUT, .onlyBusiness SELECT').val('');
		$('.onlyBusiness INPUT, .onlyBusiness SELECT').attr('disabled', 'disabled');
		$('.onlyBusiness').hide();
		$('.onlyPrivate').show();
		$('.onlyPrivate INPUT.required:not(.otherRecipientsField), .onlyPrivate SELECT.required').attr('required', 'required');
		$('.onlyPrivate INPUT:not(.otherRecipientsField), .onlyPrivate SELECT').removeAttr('disabled');
		// $('.tx-dpe-order .progressbar').removeClass('businessMode').addClass('privateMode');
	}
}
function removeRecipient(num) {
	$('.otherRecipientEntry[data-otherrecipientnum="'+num+'"]').remove();

	var count = $('.otherRecipients .otherRecipients_wrap .otherRecipientEntry').length;
	if (count <= 11) {
		$('.addOneRecipient').show();
	}

	// remove from newOrder Object
	delete newOrder.mailForwardingPersonArray[num];

}

var otherRecipientCounter = -1;
function addNewRecipient() {

	otherRecipientCounter = otherRecipientCounter + 1;
	var newRecipientHtml = $('.otherRecipients .otherRecipientEntryExample').html();
	var currentLength = $('.otherRecipients .otherRecipientEntry').length;


	var newRecipientHtml = newRecipientHtml.replaceAll('X',otherRecipientCounter);
	$('.otherRecipients_wrap').append(newRecipientHtml);
	$('.otherRecipients_wrap INPUT').removeAttr('disabled');

	// last new container
	if (currentLength >= 11) {
		$('.addOneRecipient').hide();
	} else {
		$('.addOneRecipient').show();
	}

	$('.otherRecipients .otherRecipientEntry INPUT.required:visible').attr('required', 'required');

}




$(function(){

	// console.log('step2 js loading');


});
// ready end


function transferDataToPostbox() {
	$('#postboxCompanyName').val(newOrder.paymentDataCompanyName);
	if ( newOrder.paymentDataCompanyName ) {
		$('#postboxCompanyName').parents('.field-wrapper').addClass('focus');
	}

	$('#postboxTitle').val(newOrder.paymentDataTitle);
	if ( newOrder.paymentDataTitle ) {
		$('#postboxTitle').parents('.field-wrapper').addClass('focus');
	}
	$('#postboxFirstName').val(newOrder.paymentDataFirstName);
	if ( newOrder.paymentDataFirstName ) {
		$('#postboxFirstName').parents('.field-wrapper').addClass('focus');
	}

	$('#postboxLastName').val(newOrder.paymentDataLastName);
	if ( newOrder.paymentDataLastName ) {
		$('#postboxLastName').parents('.field-wrapper').addClass('focus');
	}

	$('#postboxEmail').val(newOrder.paymentDataEmail);
	if ( newOrder.paymentDataEmail ) {
		$('#postboxEmail').parents('.field-wrapper').addClass('focus');
	}

	$('#postboxStreet').val(newOrder.paymentDataStreet);
	if ( newOrder.paymentDataStreet ) {
		$('#postboxStreet').parents('.field-wrapper').addClass('focus');
	}

	$('#postboxHouseNumber').val(newOrder.paymentDataHouseNumber);
	if ( newOrder.paymentDataHouseNumber ) {
		$('#postboxHouseNumber').parents('.field-wrapper').addClass('focus');
	}

	$('#postboxZip').val(newOrder.paymentDataZip);
	if ( newOrder.paymentDataZip ) {
		$('#postboxZip').parents('.field-wrapper').addClass('focus');
	}

	$('#postboxCity').val(newOrder.paymentDataCity);
	if ( newOrder.paymentDataCity ) {
		$('#postboxCity').parents('.field-wrapper').addClass('focus');
	}
}




$(function(){

	// console.log('step3 js loading');


});
// ready end

function updateContracts() {

	// add to newOrder

	var contractHolder = '';
	if (newOrder.customerType == 'business') {
		// nda pflicht
		contractHolder = newOrder.postboxCompanyName;
	} else {
		// kein nda pflicht
		// newOrder.agreeNda = '';
		// $('#agreeNda').prop('checked', false);
	}
	contractHolder = contractHolder+'<br>'+newOrder.postboxTitle+'<br>'+newOrder.postboxFirstName+' '+newOrder.postboxLastName+'<br>'+newOrder.postboxStreet+' '+newOrder.postboxHouseNumber+'<br>'+newOrder.postboxZip+' '+newOrder.postboxCity+'<br>'+newOrder.postboxCountry;
	$('.contract__holder').html(contractHolder);
}




$(function(){

	// console.log('step5 js loading');
	$('.dpeOrderform').submit(function(e) {
		$('.orderButton').addClass('loader');
	});

// console.log(newOrder.mailForwardingPersonArray);
// console.log('xxxx');
});
// ready end

function fillOverviewData() {
	for (var entry in newOrder) {
		if (!newOrder.hasOwnProperty(entry)) continue;

		var obj = newOrder[entry];
		if (obj) {
			$('.step5 .'+entry+'_overview').text(obj);
		}
	}
	if (newOrder.customerType = 'private') {

		// count persons to hide the headline "Weitere Empfänger"
		var mailForwardingPersonArrayCount = 0;
		for (const property in newOrder.mailForwardingPersonArray) {
			mailForwardingPersonArrayCount++;
		}

		if (newOrder.mailForwardingPersonArray && mailForwardingPersonArrayCount > 0) {
			// console.log(newOrder.mailForwardingPersonArray);
			$('.ifMailForwardingPersonArray').show();

			var html = '<ul>';
			for (var person in newOrder.mailForwardingPersonArray) {
				if (!newOrder.mailForwardingPersonArray.hasOwnProperty(person)) continue;
				html += '<li>';
				var fullName = '';
				for (var fieldName in newOrder.mailForwardingPersonArray[person]) {
					if (!newOrder.mailForwardingPersonArray[person].hasOwnProperty(fieldName)) continue;

					var value = newOrder.mailForwardingPersonArray[person][fieldName];

					if (value) {
						fullName += value+' ';
					}
				}
				html += fullName.trim();
				html += '</li>';
				
			}
			html += '</ul>';
			$('.mailForwardingPersonArray_overviewList').html(html);
		} else {
			// console.log('false');
			$('.ifMailForwardingPersonArray').hide();
		}
		
	}
}




// // load scripts

// // load modules
// @codekit-prepend 'modules/ordersteps.js';
// @codekit-prepend 'modules/step1.js';
// @codekit-prepend 'modules/step2.js';
// @codekit-prepend 'modules/step3.js';
// @codekit-prepend 'modules/step5.js';
// 'modules/fileuploader.js';



// tooltipster.main.js is required! at reisswolf.com is "order" installed with this js


$(function(){

	// console.log('main-dpe_order js loading');


	$('.dpeordertooltip').tooltipster({
		contentCloning: true,
		trigger: 'click',
		maxWidth: 300,
		minWidth: 100,
		side: ['right', 'left'],
		theme: ['tooltipster-customized'],

	});

});
