Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hyperform

Package Overview
Dependencies
Maintainers
1
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hyperform - npm Package Compare versions

Comparing version 0.7.3 to 0.7.5

css/hyperform.css

3

dist/hyperform.amd.min.js

@@ -1,1 +0,2 @@

define(function(){"use strict";function e(e){return["object","function"].indexOf(typeof e)>-1&&(delete e.hyperform,Object.defineProperty(e,"hyperform",{value:!0})),e}function t(e,t){return function(n){var a=Object.getOwnPropertyDescriptor(n,e);a&&!(a.get&&a.get.hyperform||a.value&&a.value.hyperform)&&Object.defineProperty(n,"_original_"+e,a),delete n[e],Object.defineProperty(n,e,t)}}function n(e,t){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],a=n.bubbles,r=void 0===a?!0:a,i=n.cancelable,l=void 0===i?!1:i;if(!(t instanceof window.Event)){var o=document.createEvent("Event");o.initEvent(t,r,l),t=o}return e.dispatchEvent(t),t}function a(e,t){var n=[],a=!0,r=!1,i=void 0;try{for(var l,o=e[Symbol.iterator]();!(a=(l=o.next()).done)&&(n.push(l.value),!t||n.length!==t);a=!0);}catch(s){r=!0,i=s}finally{try{!a&&o["return"]&&o["return"]()}finally{if(r)throw i}}return n}function r(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return a(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}function i(e){for(var t=arguments.length,n=Array(t>1?t-1:0),a=1;t>a;a++)n[a-1]=arguments[a];var r=n.length,i=0;return e.replace(/%([0-9]+\$)?([sl])/g,function(e,t,a){var l=i;t&&(l=Number(t.replace(/\$$/,""))-1),i+=1;var o="";return r>l&&(o=n[l]),(o instanceof Date||"number"==typeof o||o instanceof Number)&&(o="l"===a?(o.toLocaleString||o.toString).call(o):o.toString()),o})}function l(e){e=new Date(+e),e.setUTCHours(0,0,0),e.setUTCDate(e.getUTCDate()+4-(e.getUTCDay()||7));var t=new Date(e.getUTCFullYear(),0,1),n=Math.ceil(((e-t)/864e5+1)/7);return[e.getUTCFullYear(),n]}function o(e){for(var t=arguments.length<=1||void 0===arguments[1]?2:arguments[1],n=e+"";n.length<t;)n="0"+n;return n}function s(e,t){if(!(e instanceof Date))return null;switch(t){case"datetime":return s(e,"date")+"T"+s(e,"time");case"datetime-local":return i("%s-%s-%sT%s:%s:%s.%s",e.getFullYear(),o(e.getMonth()+1),o(e.getDate()),o(e.getHours()),o(e.getMinutes()),o(e.getSeconds()),o(e.getMilliseconds(),3)).replace(/(:00)?\.000$/,"");case"date":return i("%s-%s-%s",e.getUTCFullYear(),o(e.getUTCMonth()+1),o(e.getUTCDate()));case"month":return i("%s-%s",e.getUTCFullYear(),o(e.getUTCMonth()+1));case"week":var n=l(e);return i.call(null,"%s-W%s",n[0],o(n[1]));case"time":return i("%s:%s:%s.%s",o(e.getUTCHours()),o(e.getUTCMinutes()),o(e.getUTCSeconds()),o(e.getUTCMilliseconds(),3)).replace(/(:00)?\.000$/,"")}return null}function u(e,t){var n=new Date(Date.UTC(t,0,1+7*(e-1)));return n.getUTCDay()<=4?n.setUTCDate(n.getUTCDate()-n.getUTCDay()+1):n.setUTCDate(n.getUTCDate()+8-n.getUTCDay()),n}function c(e,t){var n,a=new Date(0);switch(t){case"datetime":if(!/^([0-9]{4,})-([0-9]{2})-([0-9]{2})T([01][0-9]|2[0-3]):([0-5][0-9])(?::([0-5][0-9])(?:\.([0-9]{1,3}))?)?$/.test(e))return null;for(n=RegExp.$7||"000";n.length<3;)n+="0";return a.setUTCFullYear(Number(RegExp.$1)),a.setUTCMonth(Number(RegExp.$2)-1,Number(RegExp.$3)),a.setUTCHours(Number(RegExp.$4),Number(RegExp.$5),Number(RegExp.$6||0),Number(n)),a;case"date":return/^([0-9]{4,})-([0-9]{2})-([0-9]{2})$/.test(e)?(a.setUTCFullYear(Number(RegExp.$1)),a.setUTCMonth(Number(RegExp.$2)-1,Number(RegExp.$3)),a):null;case"month":return/^([0-9]{4,})-([0-9]{2})$/.test(e)?(a.setUTCFullYear(Number(RegExp.$1)),a.setUTCMonth(Number(RegExp.$2)-1,1),a):null;case"week":return/^([0-9]{4,})-W(0[1-9]|[1234][0-9]|5[0-3])$/.test(e)?u(Number(RegExp.$2),Number(RegExp.$1)):null;case"time":if(!/^([01][0-9]|2[0-3]):([0-5][0-9])(?::([0-5][0-9])(?:\.([0-9]{1,3}))?)?$/.test(e))return null;for(n=RegExp.$4||"000";n.length<3;)n+="0";return a.setUTCHours(Number(RegExp.$1),Number(RegExp.$2),Number(RegExp.$3||0),Number(n)),a}return null}function f(e,t){var n=c(e,t);return null!==n?+n:Number(e)}function d(e){if(e instanceof window.HTMLTextAreaElement)return"textarea";if(e instanceof window.HTMLSelectElement)return e.hasAttribute("multiple")?"select-multiple":"select-one";if(e instanceof window.HTMLButtonElement)return(e.getAttribute("type")||"submit").toLowerCase();if(e instanceof window.HTMLInputElement){var t=(e.getAttribute("type")||"").toLowerCase();return t&&Q.indexOf(t)>-1?t:e.type||"text"}return""}function v(e){te=e}function m(e,t){e in ee||(ee[e]={});var n=!0,a=!1,r=void 0;try{for(var i,l=Object.keys(t)[Symbol.iterator]();!(n=(i=l.next()).done);n=!0){var o=i.value;ee[e][o]=t[o]}}catch(s){a=!0,r=s}finally{try{!n&&l["return"]&&l["return"]()}finally{if(a)throw r}}}function g(e){return te in ee&&e in ee[te]?ee[te][e]:e in ee.en?ee.en[e]:e}function h(e){var t=arguments.length<=1||void 0===arguments[1]?1:arguments[1],n=d(e),a=e.getAttribute("min"),r=ie[n]||NaN;if(a){var i=f(a,n);isNaN(i)||(r=i)}var l=e.getAttribute("max"),o=le[n]||NaN;if(l){var u=f(l,n);isNaN(u)||(o=u)}var c=e.getAttribute("step"),v=ne[n]||1;if(c&&"any"===c.toLowerCase())return[g("any value"),g("any value")];if(c){var m=f(c,n);isNaN(m)||(v=m)}var h=f(e.getAttribute("value"),n),b=f(e.value||e.getAttribute("value"),n);if(isNaN(b))return[g("any valid value"),g("any valid value")];var w=isNaN(r)?isNaN(h)?re[n]||0:h:r,p=ae[n]||1,y=w+Math.floor((b-w)/(v*p))*(v*p)*t,N=w+(Math.floor((b-w)/(v*p))+1)*(v*p)*t;return r>y?y=null:y>o&&(y=o),N>o?N=null:r>N&&(N=r),W.indexOf(n)>-1&&(y=s(new Date(y),n),N=s(new Date(N),n)),[y,N]}function b(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function w(e,t,n){return t&&b(e.prototype,t),n&&b(e,n),e}function p(){var e=arguments.length<=0||void 0===arguments[0]?"hf_":arguments[0];return e+ce++ +Math.random().toString(36).substr(2)}function y(e){if(e instanceof window.HTMLFormElement)return Array.prototype.map.call(e.elements,y).every(function(e){return e});var t,a=Ne(e).valid;if(a){var r=L(e);r&&r.settings.valid_event&&(t=n(e,"valid",{cancelable:!0}))}else t=n(e,"invalid",{cancelable:!0});return t&&t.defaultPrevented||de.show_warning(e),a}function N(e){e.preventDefault();var t=n(e.target.form,"validate",{cancelable:!0});if(!t.defaultPrevented){var a,r=!0;if(Array.prototype.map.call(e.target.form.elements,function(e){y(e)||(r=!1,!a&&"focus"in e&&(a=e))}),r){var i=n(e.target.form,"submit",{cancelable:!0});i.defaultPrevented||e.target.form.submit()}else a&&a.focus()}}function T(e){e.addEventListener("click",function(e){e.defaultPrevented||"INPUT"!==e.target.nodeName&&"BUTTON"!==e.target.nodeName||"image"!==e.target.type&&"submit"!==e.target.type||e.target.hasAttribute("formnovalidate")||!e.target.form||e.target.form.hasAttribute("novalidate")||N(e)}),e.addEventListener("keypress",function(e){if(!e.defaultPrevented&&13===e.keyCode&&"INPUT"===e.target.nodeName&&J.indexOf(e.target.type)>-1&&e.target.form&&!e.target.form.hasAttribute("novalidate")){for(var t,n=e.target.form.elements.length,a=0;n>a;a++)if(["image","submit"].indexOf(e.target.form.elements[a].type)>-1){t=e.target.form.elements[a];break}t?(e.preventDefault(),t.click()):N(e)}})}function x(e){ue.set(this,e,!0)}function A(){var e=arguments.length<=0||void 0===arguments[0]?void 0:arguments[0],t=d(this);if(W.indexOf(t)>-1){if(void 0!==e){if(null===e)this.value="";else{if(!(e instanceof Date))throw new window.DOMException("valueAsDate setter encountered invalid value","TypeError");isNaN(e.getTime())?this.value="":this.value=s(e,t)}return}var n=c(this.value,t);return n instanceof Date?n:null}if(void 0!==e)throw new window.DOMException("valueAsDate setter cannot set date on this element","InvalidStateError");return null}function E(){var e=arguments.length<=0||void 0===arguments[0]?void 0:arguments[0],t=d(this);if(Z.indexOf(t)>-1){if("range"===t&&this.hasAttribute("multiple"))return NaN;if(void 0!==e){if(isNaN(e))this.value="";else{if("number"!=typeof e||!window.isFinite(e))throw new window.DOMException("valueAsNumber setter encountered invalid value","TypeError");try{A.call(this,new Date(e))}catch(n){if(!(n instanceof window.DOMException))throw n;this.value=e.toString()}}return}return f(this.value,t)}if(void 0!==e)throw new window.DOMException("valueAsNumber setter cannot set number on this element","InvalidStateError");return NaN}function M(e){var t=arguments.length<=1||void 0===arguments[1]?1:arguments[1];if(-1===Z.indexOf(d(e)))throw new window.DOMException("stepDown encountered invalid type","InvalidStateError");if("any"===(e.getAttribute("step")||"").toLowerCase())throw new window.DOMException('stepDown encountered step "any"',"InvalidStateError");var n=h(e,t),a=n.prev;n.next;null!==a&&E.call(e,a)}function C(e){var t=arguments.length<=1||void 0===arguments[1]?1:arguments[1];if(-1===Z.indexOf(d(e)))throw new window.DOMException("stepUp encountered invalid type","InvalidStateError");if("any"===(e.getAttribute("step")||"").toLowerCase())throw new window.DOMException('stepUp encountered step "any"',"InvalidStateError");var n=h(e,t),a=(n.prev,n.next);null!==a&&E.call(e,a)}function D(){var e=ue.get(this);return e?e.toString():""}function U(){return k(this)}function L(e){var t;for(e.form&&(t=ve.get(e.form));!t&&e;)t=ve.get(e),e=e.parentNode;return t||(t=ve.get(window)),t}function k(e){if(e instanceof window.HTMLSelectElement||e instanceof window.HTMLTextAreaElement||e instanceof window.HTMLButtonElement||e instanceof window.HTMLInputElement){var t=d(e);if((!t||X.indexOf(t)>-1||K.indexOf(t)>-1)&&!e.hasAttribute("disabled")&&!e.hasAttribute("readonly")){var n=L(e);if(n&&n.settings.strict||!e.hasAttribute("novalidate")||!e.noValidate){for(var a=e.parentNode;a&&1===a.nodeType;){if(a instanceof window.HTMLFieldSetElement&&a.hasAttribute("disabled"))return!1;if(a===e.form)break;a=a.parentNode}return!0}}}return!1}function O(e){return[].concat(ge(e)).length}function P(e){var t=d(e);if(!k(e)||!e.value||!e.hasAttribute("max"))return!0;var n=void 0,a=void 0;return W.indexOf(t)>-1?(n=1*c(e.value,t),a=1*(c(e.getAttribute("max"),t)||NaN)):(n=Number(e.value),a=Number(e.getAttribute("max"))),isNaN(a)||a>=n}function S(e){if(!(k(e)&&e.value&&-1!==J.indexOf(d(e))&&e.hasAttribute("maxlength")&&e.getAttribute("maxlength")))return!0;var t=parseInt(e.getAttribute("maxlength"),10);return isNaN(t)||0>t?!0:O(e.value)<=t}function R(e){var t=d(e);if(!k(e)||!e.value||!e.hasAttribute("min"))return!0;var n=void 0,a=void 0;return W.indexOf(t)>-1?(n=1*c(e.value,t),a=1*(c(e.getAttribute("min"),t)||NaN)):(n=Number(e.value),a=Number(e.getAttribute("min"))),isNaN(a)||n>=a}function $(e){if(!(k(e)&&e.value&&-1!==J.indexOf(d(e))&&e.hasAttribute("minlength")&&e.getAttribute("minlength")))return!0;var t=parseInt(e.getAttribute("minlength"),10);return isNaN(t)||0>t?!0:O(e.value)>=t}function _(e){return!k(e)||!e.value||!e.hasAttribute("pattern")||new RegExp("^(?:"+e.getAttribute("pattern")+")$").test(e.value)}function H(e){if(!k(e)||!e.hasAttribute("required"))return!0;switch(e.type){case"checkbox":return e.checked;case"radio":return!!(e.checked||e.form&&Array.prototype.filter.call(document.getElementsByName(e.name),function(t){return t.name===e.name&&t.form===e.form&&t.checked}).length>0);default:return!!e.value}}function F(e){var t=d(e);if(!k(e)||!e.value||-1===Z.indexOf(t)||"any"===(e.getAttribute("step")||"").toLowerCase())return!0;var n=e.getAttribute("step");if(n=n?f(n,t):ne[t]||1,0>=n||isNaN(n))return!0;var a=ae[t]||1,r=f(e.value,t),i=f(e.getAttribute("min")||e.getAttribute("value")||"",t);isNaN(i)&&(i=re[t]||0),"month"===t&&(i=12*new Date(i).getUTCFullYear()+new Date(i).getUTCMonth(),r=12*new Date(r).getUTCFullYear()+new Date(r).getUTCMonth());var l=Math.abs(i-r)%(n*a);return 1e-8>l||l>n*a-1e-8}function I(e){return e.split(",").map(function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}).filter(function(e){return e})}function V(e){var t=d(e);if(!k(e)||"file"!==t&&!e.value||"file"!==t&&-1===q.indexOf(t))return!0;var n=!0;switch(t){case"url":we.href=e.value,n=we.href===e.value||we.href===e.value+"/";break;case"email":n=e.hasAttribute("multiple")?I(e.value).every(function(e){return pe.test(e)}):pe.test(e.value);break;case"file":if("files"in e&&e.files.length&&e.hasAttribute("accept")){var a=I(e.getAttribute("accept")).map(function(e){return/^(audio|video|image)\/\*$/.test(e)&&(e=new RegExp("^"+RegExp.$1+"/.+$")),e});if(!a.length)break;e:for(var r=0;r<e.files.length;r++){var i=!1;t:for(var l=0;l<a.length;l++){var o=e.files[r],s=a[l],u=o.type;if("string"==typeof s&&"."===s.substr(0,1)){if(-1===o.name.search("."))continue t;u=o.name.substr(o.name.lastIndexOf("."))}if(0===u.search(s)){i=!0;break t}}if(!i){n=!1;break e}}}}return n}function j(e){var t=d(e);if(!k(e)||-1===G.indexOf(t))return!0;if(!e.value)return"_original_validity"in e?!e._original_validity.badInput:!0;var n=!0;switch(t){case"color":n=/^#[a-f0-9]{6}$/.test(e.value);break;case"number":case"range":n=!isNaN(Number(e.value));break;case"datetime":case"date":case"month":case"week":case"time":n=null!==c(e.value,t);break;case"datetime-local":n=/^([0-9]{4,})-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9])(?::([0-5][0-9])(?:\.([0-9]{1,3}))?)?$/.test(e.value);break;case"tel":break;case"email":}return n}function Y(e){if(e instanceof window.HTMLFormElement)return Array.prototype.map.call(e.elements,Y).every(function(e){return e});var t=Ne(e).valid;if(t){var a=L(e);a&&a.settings.valid_event&&n(e,"valid")}else n(e,"invalid",{cancelable:!0});return t}function B(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=t.strict,a=void 0===n?!1:n,r=t.revalidate,i=void 0===r?"oninput":r,l=t.valid_event,o=void 0===l?!0:l,s=t.classes,u=void 0===s?{}:s;return e instanceof window.NodeList||e instanceof window.HTMLCollection||e instanceof Array?Array.prototype.map.call(e,function(e){return B(e)}):new me(e,{strict:a,revalidate:i,valid_event:o,classes:u})}var W=["datetime","date","month","week","time"],z=["number","range"],Z=W.concat(z,"datetime-local"),q=["email","url"],G=["email","date","month","week","time","datetime","datetime-local","number","range","color"],J=["text","search","tel","password"].concat(q),K=["checkbox","color","file","image","radio","submit"].concat(Z,J),Q=["button","hidden","reset"].concat(K),X=["select-one","select-multiple","textarea"],ee={en:{TextTooLong:"Please shorten this text to %l characters or less (you are currently using %l characters).",ValueMissing:"Please fill out this field.",CheckboxMissing:"Please check this box if you want to proceed.",RadioMissing:"Please select one of these options.",FileMissing:"Please select a file.",SelectMissing:"Please select an item in the list.",InvalidEmail:"Please enter an email address.",InvalidURL:"Please enter a URL.",PatternMismatch:"Please match the requested format.",PatternMismatchWithTitle:"Please match the requested format: %l.",NumberRangeOverflow:"Please select a value that is no more than %l.",DateRangeOverflow:"Please select a value that is no later than %l.",TimeRangeOverflow:"Please select a value that is no later than %l.",NumberRangeUnderflow:"Please select a value that is no less than %l.",DateRangeUnderflow:"Please select a value that is no earlier than %l.",TimeRangeUnderflow:"Please select a value that is no earlier than %l.",StepMismatch:"Please select a valid value. The two nearest valid values are %l and %l.",StepMismatchOneValue:"Please select a valid value. The nearest valid value is %l.",BadInputNumber:"Please enter a number."}},te="en",ne={"datetime-local":60,datetime:60,time:60},ae={"datetime-local":1e3,datetime:1e3,date:864e5,week:6048e5,time:1e3},re={week:-2592e5},ie={range:0},le={range:100},oe=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},se=new WeakMap,ue={set:function(t,n){var a=arguments.length<=2||void 0===arguments[2]?!1:arguments[2];if(t instanceof window.HTMLFieldSetElement){var r=L(t);if(r&&r.settings.strict)return ue}return"string"==typeof n&&(n=new String(n)),a&&(n.is_custom=!0),e(n),se.set(t,n),"_original_setCustomValidity"in t&&t._original_setCustomValidity(n.toString()),ue},get:function(e){var t=se.get(e);return void 0===t&&"_original_validationMessage"in e&&(t=new String(e._original_validationMessage)),t?t:new String("")},"delete":function(e){return"_original_setCustomValidity"in e&&e._original_setCustomValidity(""),se["delete"](e)}},ce=0,fe=new WeakMap,de={attach_warning:function(e,t){t.parentNode.insertBefore(e,t.nextSibling)},detach_warning:function(e,t){e.parentNode.removeChild(e)},show_warning:function(e){var t=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],n=ue.get(e).toString(),a=fe.get(e);if(n){if(!a){var r=L(e);a=document.createElement("div"),a.className=r&&r.settings.classes.warning||"hf-warning",a.id=p(),fe.set(e,a)}e.setAttribute("aria-errormessage",a.id),a.textContent=n,de.attach_warning(a,e)}else a&&a.parentNode&&(e.removeAttribute("aria-errormessage"),de.detach_warning(a,e));!t&&"radio"===e.type&&e.form&&Array.prototype.filter.call(document.getElementsByName(e.name),function(t){return t.name===e.name&&t.form===e.form}).map(function(e){return de.show_warning(e,"sub_radio")})},set:function(e,t){de[e]=t}};y.install=t("reportValidity",{configurable:!0,enumerable:!0,value:function(){return y(this)},writable:!0}),e(y),x.install=t("setCustomValidity",{configurable:!0,enumerable:!0,value:x,writable:!0}),e(x),A.install=t("valueAsDate",{configurable:!0,enumerable:!0,get:A,set:A}),e(A),E.install=t("valueAsNumber",{configurable:!0,enumerable:!0,get:E,set:E}),e(E),M.install=t("stepDown",{configurable:!0,enumerable:!0,value:function(){var e=arguments.length<=0||void 0===arguments[0]?1:arguments[0];return M(this,e)},writable:!0}),e(M),C.install=t("stepUp",{configurable:!0,enumerable:!0,value:function(){var e=arguments.length<=0||void 0===arguments[0]?1:arguments[0];return C(this,e)},writable:!0}),e(C),D.install=t("validationMessage",{configurable:!0,enumerable:!0,get:D,set:void 0}),e(D),U.install=t("willValidate",{configurable:!0,enumerable:!0,get:U,set:void 0}),e(U);var ve=new WeakMap,me=function(){function e(t,n){oe(this,e),this.form=t,this.settings=n,ve.set(t,this),T(t),t===window||t instanceof window.HTMLDocument?this.install([window.HTMLButtonElement.prototype,window.HTMLInputElement.prototype,window.HTMLSelectElement.prototype,window.HTMLTextAreaElement.prototype,window.HTMLFieldSetElement.prototype]):(t instanceof window.HTMLFormElement||t instanceof window.HTMLFieldSetElement)&&this.install(t.elements),"oninput"===n.revalidate&&(t.addEventListener("keyup",this.revalidate.bind(this)),t.addEventListener("change",this.revalidate.bind(this)))}return w(e,[{key:"revalidate",value:function(e){(e.target instanceof window.HTMLButtonElement||e.target instanceof window.HTMLTextAreaElement||e.target instanceof window.HTMLSelectElement||e.target instanceof window.HTMLInputElement)&&y(e.target)}},{key:"install",value:function(e){e instanceof window.HTMLElement&&(e=[e]);for(var t=e.length,n=0;t>n;n++)Y.install(e[n]),y.install(e[n]),x.install(e[n]),M.install(e[n]),C.install(e[n]),D.install(e[n]),Ne.install(e[n]),A.install(e[n]),E.install(e[n]),U.install(e[n])}}]),e}(),ge=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)},he=new WeakMap,be={set:function(e,t){var n=he.get(e)||[];return n.push(t),he.set(e,n),be},get:function(e){return he.get(e)||[]},"delete":function(e){return he["delete"](e)}},we=document.createElement("a"),pe=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,ye={badInput:function(e){var t=!j(e);return t&&ue.set(e,g("Please match the requested type.")),t},customError:function(e){var t=be.get(e),n=!0;if(t.length){var a=!0,r=!1,i=void 0;try{for(var l,o=t[Symbol.iterator]();!(a=(l=o.next()).done);a=!0){var s=l.value,u=s(e);if(void 0!==u&&!u){n=!1;break}}}catch(c){r=!0,i=c}finally{try{!a&&o["return"]&&o["return"]()}finally{if(r)throw i}}}if(n){var f=ue.get(e);n=!(f.toString()&&"is_custom"in f)}return!n},patternMismatch:function(e){var t=!_(e);return t&&ue.set(e,e.title?i(g("PatternMismatchWithTitle"),e.title):g("PatternMismatch")),t},rangeOverflow:function(e){var t=!P(e),n=d(e);if(t){var a=void 0;switch(n){case"date":case"datetime":case"datetime-local":a=i(g("DateRangeOverflow"),c(e.getAttribute("max"),n));break;case"time":a=i(g("TimeRangeOverflow"),c(e.getAttribute("max"),n));break;default:a=i(g("NumberRangeOverflow"),f(e.getAttribute("max"),n))}ue.set(e,a)}return t},rangeUnderflow:function(e){var t=!R(e),n=d(e);if(t){var a=void 0;switch(n){case"date":case"datetime":case"datetime-local":a=i(g("DateRangeUnderflow"),c(e.getAttribute("max"),n));break;case"time":a=i(g("TimeRangeUnderflow"),c(e.getAttribute("max"),n));break;default:a=i(g("NumberRangeUnderflow"),f(e.getAttribute("max"),n))}ue.set(e,a)}return t},stepMismatch:function(e){var t=!F(e);if(t){var n=h(e),a=r(n,2),l=a[0],o=a[1],s=!1;null===l?s=o:null===o&&(s=l),s!==!1?ue.set(e,i(g("StepMismatchOneValue"),s)):ue.set(e,i(g("StepMismatch"),l,o))}return t},tooLong:function(e){var t=!S(e);return t&&ue.set(e,i(g("TextTooLong"),e.getAttribute("maxlength"),O(e.value))),t},tooShort:function(e){var t=!$(e);return t&&ue.set(e,i(g("Please lengthen this text to %l characters or more (you are currently using %l characters)."),e.getAttribute("maxlength"),O(e.value))),t},typeMismatch:function(e){var t=!V(e);if(t){var n=g("Please use the appropriate format."),a=d(e);"email"===a?n=g(e.hasAttribute("multiple")?"Please enter a comma separated list of email addresses.":"InvalidEmail"):"url"===a?n=g("InvalidURL"):"file"===a&&(n=g("Please select a file of the correct type.")),ue.set(e,n)}return t},valueMissing:function(e){var t=!H(e);if(t){var n=g("ValueMissing"),a=d(e);"checkbox"===a?n=g("CheckboxMissing"):"radio"===a?n=g("RadioMissing"):"file"===a?n=g(e.hasAttribute("multiple")?"Please select one or more files.":"FileMissing"):e instanceof window.HTMLSelectElement&&(n=g("SelectMissing")),ue.set(e,n)}return t}},Ne=function Ce(e){if(!(e instanceof window.HTMLElement))throw new Error("cannot create a ValidityState for a non-element");var t=Ce.cache.get(e);return t?t:this instanceof Ce?(this.element=e,void Ce.cache.set(e,this)):new Ce(e)},Te={};Ne.prototype=Te,Ne.cache=new WeakMap;for(var xe in ye)Object.defineProperty(Te,xe,{configurable:!0,enumerable:!0,get:function(e){return function(){return e(this.element)}}(ye[xe]),set:void 0});Object.defineProperty(Te,"valid",{configurable:!0,enumerable:!0,get:function(){var e=L(this.element),t=e&&e.settings.classes.valid||"hf-valid",n=e&&e.settings.classes.invalid||"hf-invalid",a=e&&e.settings.classes.validated||"hf-validated";if(this.element.classList.add(a),k(this.element))for(var r in ye)if(ye[r](this.element))return this.element.classList.add(n),this.element.classList.remove(t),this.element.setAttribute("aria-invalid","true"),!1;return ue["delete"](this.element),this.element.classList.remove(n),this.element.classList.add(t),this.element.setAttribute("aria-invalid","false"),!0},set:void 0}),e(Te),Ne.install=t("validity",{configurable:!0,enumerable:!0,get:function(){return Ne(this)}}),Y.install=t("checkValidity",{configurable:!0,enumerable:!0,value:function(){return Y(this)},writable:!0}),e(Y);var Ae="0.7.3",Ee=de.set,Me=be.set;return B.version=Ae,B.checkValidity=Y,B.reportValidity=y,B.setCustomValidity=x,B.stepDown=M,B.stepUp=C,B.validationMessage=D,B.ValidityState=Ne,B.valueAsDate=A,B.valueAsNumber=E,B.willValidate=U,B.set_language=v,B.add_translation=m,B.set_renderer=Ee,B.register=Me,B});
/*! hyperform.js.org */
define(function(){"use strict";function e(e,t){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],r=n.bubbles,i=void 0===r?!0:r,a=n.cancelable,o=void 0===a?!1:a;if(!(t instanceof window.Event)){var l=document.createEvent("Event");l.initEvent(t,i,o),t=l}return e.dispatchEvent(t),t}function t(e){return["object","function"].indexOf(typeof e)>-1&&(delete e.__hyperform,Object.defineProperty(e,"__hyperform",{configurable:!0,enumerable:!1,value:!0})),e}function n(){var e=arguments.length<=0||void 0===arguments[0]?"hf_":arguments[0];return e+he++ +Math.random().toString(36).substr(2)}function r(t){if(t instanceof window.HTMLFormElement)return Array.prototype.map.call(t.elements,r).every(function(e){return e});var n,i=Qe(t).valid;if(i){var a=V(t);a&&a.settings.valid_event&&(n=e(t,"valid",{cancelable:!0}))}else n=e(t,"invalid",{cancelable:!0});return n&&n.defaultPrevented||be.show_warning(t),i}function i(t){t.preventDefault();var n=e(t.target.form,"validate",{cancelable:!0});if(!n.defaultPrevented){var i,a=!0;if(Array.prototype.map.call(t.target.form.elements,function(e){r(e)||(a=!1,!i&&"focus"in e&&(i=e))}),a){var o=e(t.target.form,"submit",{cancelable:!0});o.defaultPrevented||t.target.form.submit()}else i&&i.focus()}}function a(e){return!("INPUT"!==e.nodeName&&"BUTTON"!==e.nodeName||"image"!==e.type&&"submit"!==e.type)}function o(e){return!e.defaultPrevented&&(!("button"in e)||e.button<2)&&a(e.target)&&!e.target.hasAttribute("formnovalidate")&&e.target.form&&!e.target.form.hasAttribute("novalidate")}function l(e){return!e.defaultPrevented&&(13===e.keyCode&&"INPUT"===e.target.nodeName&&ce.indexOf(e.target.type)>-1||(13===e.keyCode||32===e.keyCode)&&a(e.target))&&e.target.form&&!e.target.form.hasAttribute("novalidate")}function s(e){o(e)&&i(e)}function u(e){o(e)&&e.target.form.submit()}function c(e){if(l(e)){for(var t,n=e.target.form.elements.length,r=0;n>r;r++)if(["image","submit"].indexOf(e.target.form.elements[r].type)>-1){t=e.target.form.elements[r];break}t?(e.preventDefault(),t.click()):i(e)}}function f(e){if(l(e)){for(var t,n=e.target.form.elements.length,r=0;n>r;r++)if(["image","submit"].indexOf(e.target.form.elements[r].type)>-1){t=e.target.form.elements[r];break}t?(e.preventDefault(),t.click()):e.target.form.submit()}}function d(e){var t=arguments.length<=1||void 0===arguments[1]?!1:arguments[1];t?(e.addEventListener("click",u),e.addEventListener("keypress",f)):(e.addEventListener("click",s),e.addEventListener("keypress",c))}function m(e){e.removeEventListener("click",u),e.removeEventListener("keypress",f),e.removeEventListener("click",s),e.removeEventListener("keypress",c)}function v(e,t){delete e[t];var n=Object.getOwnPropertyDescriptor(e,"_original_"+t);n&&Object.defineProperty(e,t,n)}function g(e,t,n){n.configurable=!0,n.enumerable=!0,"value"in n&&(n.writable=!0);var r=Object.getOwnPropertyDescriptor(e,t);if(r){if(r.get&&r.get.__hyperform||r.value&&r.value.__hyperform)return;Object.defineProperty(e,"_original_"+t,r)}delete e[t],Object.defineProperty(e,t,n)}function h(e,t){ge.set(e,t,!0)}function w(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];var i=n.length,a=0;return e.replace(/%([0-9]+\$)?([sl])/g,function(e,t,r){var o=a;t&&(o=Number(t.replace(/\$$/,""))-1),a+=1;var l="";return i>o&&(l=n[o]),(l instanceof Date||"number"==typeof l||l instanceof Number)&&(l="l"===r?(l.toLocaleString||l.toString).call(l):l.toString()),l})}function p(e){e=new Date(+e),e.setUTCHours(0,0,0),e.setUTCDate(e.getUTCDate()+4-(e.getUTCDay()||7));var t=new Date(e.getUTCFullYear(),0,1),n=Math.ceil(((e-t)/864e5+1)/7);return[e.getUTCFullYear(),n]}function b(e){for(var t=arguments.length<=1||void 0===arguments[1]?2:arguments[1],n=e+"";n.length<t;)n="0"+n;return n}function y(e,t){if(!(e instanceof Date))return null;switch(t){case"datetime":return y(e,"date")+"T"+y(e,"time");case"datetime-local":return w("%s-%s-%sT%s:%s:%s.%s",e.getFullYear(),b(e.getMonth()+1),b(e.getDate()),b(e.getHours()),b(e.getMinutes()),b(e.getSeconds()),b(e.getMilliseconds(),3)).replace(/(:00)?\.000$/,"");case"date":return w("%s-%s-%s",e.getUTCFullYear(),b(e.getUTCMonth()+1),b(e.getUTCDate()));case"month":return w("%s-%s",e.getUTCFullYear(),b(e.getUTCMonth()+1));case"week":var n=p(e);return w.call(null,"%s-W%s",n[0],b(n[1]));case"time":return w("%s:%s:%s.%s",b(e.getUTCHours()),b(e.getUTCMinutes()),b(e.getUTCSeconds()),b(e.getUTCMilliseconds(),3)).replace(/(:00)?\.000$/,"")}return null}function T(e,t){var n=new Date(Date.UTC(t,0,1+7*(e-1)));return n.getUTCDay()<=4?n.setUTCDate(n.getUTCDate()-n.getUTCDay()+1):n.setUTCDate(n.getUTCDate()+8-n.getUTCDay()),n}function E(e,t){var n,r=new Date(0);switch(t){case"datetime":if(!/^([0-9]{4,})-([0-9]{2})-([0-9]{2})T([01][0-9]|2[0-3]):([0-5][0-9])(?::([0-5][0-9])(?:\.([0-9]{1,3}))?)?$/.test(e))return null;for(n=RegExp.$7||"000";n.length<3;)n+="0";return r.setUTCFullYear(Number(RegExp.$1)),r.setUTCMonth(Number(RegExp.$2)-1,Number(RegExp.$3)),r.setUTCHours(Number(RegExp.$4),Number(RegExp.$5),Number(RegExp.$6||0),Number(n)),r;case"date":return/^([0-9]{4,})-([0-9]{2})-([0-9]{2})$/.test(e)?(r.setUTCFullYear(Number(RegExp.$1)),r.setUTCMonth(Number(RegExp.$2)-1,Number(RegExp.$3)),r):null;case"month":return/^([0-9]{4,})-([0-9]{2})$/.test(e)?(r.setUTCFullYear(Number(RegExp.$1)),r.setUTCMonth(Number(RegExp.$2)-1,1),r):null;case"week":return/^([0-9]{4,})-W(0[1-9]|[1234][0-9]|5[0-3])$/.test(e)?T(Number(RegExp.$2),Number(RegExp.$1)):null;case"time":if(!/^([01][0-9]|2[0-3]):([0-5][0-9])(?::([0-5][0-9])(?:\.([0-9]{1,3}))?)?$/.test(e))return null;for(n=RegExp.$4||"000";n.length<3;)n+="0";return r.setUTCHours(Number(RegExp.$1),Number(RegExp.$2),Number(RegExp.$3||0),Number(n)),r}return null}function M(e,t){var n=E(e,t);return null!==n?+n:Number(e)}function A(e){if(e instanceof window.HTMLTextAreaElement)return"textarea";if(e instanceof window.HTMLSelectElement)return e.hasAttribute("multiple")?"select-multiple":"select-one";if(e instanceof window.HTMLButtonElement)return(e.getAttribute("type")||"submit").toLowerCase();if(e instanceof window.HTMLInputElement){var t=(e.getAttribute("type")||"").toLowerCase();return t&&de.indexOf(t)>-1?t:e.type||"text"}return""}function x(e){Te=e}function N(e,t){e in ye||(ye[e]={});for(var n in t)t.hasOwnProperty(n)&&(ye[e][n]=t[n])}function L(e){return Te in ye&&e in ye[Te]?ye[Te][e]:e in ye.en?ye.en[e]:e}function D(e){var t=arguments.length<=1||void 0===arguments[1]?1:arguments[1],n=A(e),r=e.getAttribute("min"),i=xe[n]||NaN;if(r){var a=M(r,n);isNaN(a)||(i=a)}var o=e.getAttribute("max"),l=Ne[n]||NaN;if(o){var s=M(o,n);isNaN(s)||(l=s)}var u=e.getAttribute("step"),c=Ee[n]||1;if(u&&"any"===u.toLowerCase())return[L("any value"),L("any value")];if(u){var f=M(u,n);isNaN(f)||(c=f)}var d=M(e.getAttribute("value"),n),m=M(e.value||e.getAttribute("value"),n);if(isNaN(m))return[L("any valid value"),L("any valid value")];var v=isNaN(i)?isNaN(d)?Ae[n]||0:d:i,g=Me[n]||1,h=v+Math.floor((m-v)/(c*g))*(c*g)*t,w=v+(Math.floor((m-v)/(c*g))+1)*(c*g)*t;return i>h?h=null:h>l&&(h=l),w>l?w=null:i>w&&(w=i),ae.indexOf(n)>-1&&(h=y(new Date(h),n),w=y(new Date(w),n)),[h,w]}function C(e){var t=arguments.length<=1||void 0===arguments[1]?void 0:arguments[1],n=A(e);if(ae.indexOf(n)>-1){if(void 0!==t){if(null===t)e.value="";else{if(!(t instanceof Date))throw new window.DOMException("valueAsDate setter encountered invalid value","TypeError");isNaN(t.getTime())?e.value="":e.value=y(t,n)}return}var r=E(e.value,n);return r instanceof Date?r:null}if(void 0!==t)throw new window.DOMException("valueAsDate setter cannot set date on this element","InvalidStateError");return null}function _(e){var t=arguments.length<=1||void 0===arguments[1]?void 0:arguments[1],n=A(e);if(le.indexOf(n)>-1){if("range"===n&&e.hasAttribute("multiple"))return NaN;if(void 0!==t){if(isNaN(t))e.value="";else{if("number"!=typeof t||!window.isFinite(t))throw new window.DOMException("valueAsNumber setter encountered invalid value","TypeError");try{C(e,new Date(t))}catch(r){if(!(r instanceof window.DOMException))throw r;e.value=t.toString()}}return}return M(e.value,n)}if(void 0!==t)throw new window.DOMException("valueAsNumber setter cannot set number on this element","InvalidStateError");return NaN}function k(e){var t=arguments.length<=1||void 0===arguments[1]?1:arguments[1];if(-1===le.indexOf(A(e)))throw new window.DOMException("stepDown encountered invalid type","InvalidStateError");if("any"===(e.getAttribute("step")||"").toLowerCase())throw new window.DOMException('stepDown encountered step "any"',"InvalidStateError");var n=D(e,t),r=n.prev;n.next;null!==r&&_(e,r)}function F(e){var t=arguments.length<=1||void 0===arguments[1]?1:arguments[1];if(-1===le.indexOf(A(e)))throw new window.DOMException("stepUp encountered invalid type","InvalidStateError");if("any"===(e.getAttribute("step")||"").toLowerCase())throw new window.DOMException('stepUp encountered step "any"',"InvalidStateError");var n=D(e,t),r=(n.prev,n.next);null!==r&&_(e,r)}function H(e){var t=ge.get(e);return t?t.toString():""}function U(e){return I(e)}function O(e){for(var t=["accept","max","min","pattern","placeholder","step"],n=0;n<t.length;n++){var r=t[n];g(e,r,{get:Le(r),set:De(r)})}for(var i=["multiple","required","readOnly"],a=0;a<i.length;a++){var o=i[a];g(e,o,{get:Ce(o.toLowerCase()),set:_e(o.toLowerCase())})}for(var l=["minLength","maxLength"],s=0;s<l.length;s++){var u=l[s];g(e,u,{get:ke(u.toLowerCase()),set:Fe(u.toLowerCase())})}}function S(e){for(var t=["accept","max","min","pattern","placeholder","step","multiple","required","readOnly","minLength","maxLength"],n=0;n<t.length;n++){var r=t[n];v(e,r)}}function P(e){if(e instanceof window.HTMLButtonElement||e instanceof window.HTMLInputElement||e instanceof window.HTMLSelectElement||e instanceof window.HTMLTextAreaElement||e instanceof window.HTMLFieldSetElement){for(var t in He)g(e,t,He[t]);O(e)}else e instanceof window.HTMLFormElement&&(g(e,"checkValidity",He.checkValidity),g(e,"reportValidity",He.reportValidity))}function $(e){e instanceof window.HTMLButtonElement||e instanceof window.HTMLInputElement||e instanceof window.HTMLSelectElement||e instanceof window.HTMLTextAreaElement||e instanceof window.HTMLFieldSetElement?(v(e,"checkValidity"),v(e,"reportValidity"),v(e,"setCustomValidity"),v(e,"stepDown"),v(e,"stepUp"),v(e,"validationMessage"),v(e,"validity"),v(e,"valueAsDate"),v(e,"valueAsNumber"),v(e,"willValidate"),S(e)):e instanceof window.HTMLFormElement&&(v(e,"checkValidity"),v(e,"reportValidity"))}function R(e,t){this.form=e,this.settings=t,this.revalidator=this.revalidate.bind(this),Ue.set(e,this),d(e,"never"===t.revalidate),e===window||e instanceof window.HTMLDocument?(this.install([window.HTMLButtonElement.prototype,window.HTMLInputElement.prototype,window.HTMLSelectElement.prototype,window.HTMLTextAreaElement.prototype,window.HTMLFieldSetElement.prototype]),P(window.HTMLFormElement)):(e instanceof window.HTMLFormElement||e instanceof window.HTMLFieldSetElement)&&(this.install(e.elements),e instanceof window.HTMLFormElement&&P(e)),"oninput"!==t.revalidate&&"hybrid"!==t.revalidate||(e.addEventListener("keyup",this.revalidator),e.addEventListener("change",this.revalidator)),"onblur"!==t.revalidate&&"hybrid"!==t.revalidate||e.addEventListener("blur",this.revalidator,!0)}function V(e){var t;for(e.form&&(t=Ue.get(e.form));!t&&e;)t=Ue.get(e),e=e.parentNode;return t||(t=Ue.get(window)),t}function I(e){if(e instanceof window.HTMLSelectElement||e instanceof window.HTMLTextAreaElement||e instanceof window.HTMLButtonElement||e instanceof window.HTMLInputElement){var t=A(e);if((!t||me.indexOf(t)>-1||fe.indexOf(t)>-1)&&!e.hasAttribute("disabled")&&!e.hasAttribute("readonly")){var n=V(e);if(n&&n.settings.novalidate_on_elements||!e.hasAttribute("novalidate")||!e.noValidate){for(var r=e.parentNode;r&&1===r.nodeType;){if(r instanceof window.HTMLFieldSetElement&&r.hasAttribute("disabled"))return!1;if("DATALIST"===r.nodeName.toUpperCase())return!1;if(r===e.form)break;r=r.parentNode}return!0}}}return!1}function B(e){return e.match(/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g).length}function W(e){var t=A(e);if(!I(e)||-1===ue.indexOf(t))return!0;if(!e.value)return"_original_validity"in e&&!e._original_validity.__hyperform?!e._original_validity.badInput:!0;var n=!0;switch(t){case"color":n=/^#[a-f0-9]{6}$/.test(e.value);break;case"number":case"range":n=!isNaN(Number(e.value));break;case"datetime":case"date":case"month":case"week":case"time":n=null!==E(e.value,t);break;case"datetime-local":n=/^([0-9]{4,})-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9])(?::([0-5][0-9])(?:\.([0-9]{1,3}))?)?$/.test(e.value);break;case"tel":break;case"email":}return n}function Y(e){var t=A(e);if(!I(e)||!e.value||!e.hasAttribute("max"))return!0;var n=void 0,r=void 0;return ae.indexOf(t)>-1?(n=1*E(e.value,t),r=1*(E(e.getAttribute("max"),t)||NaN)):(n=Number(e.value),r=Number(e.getAttribute("max"))),isNaN(r)||r>=n}function j(e){if(!(I(e)&&e.value&&-1!==ce.indexOf(A(e))&&e.hasAttribute("maxlength")&&e.getAttribute("maxlength")))return!0;var t=parseInt(e.getAttribute("maxlength"),10);return isNaN(t)||0>t?!0:B(e.value)<=t}function Z(e){var t=A(e);if(!I(e)||!e.value||!e.hasAttribute("min"))return!0;var n=void 0,r=void 0;return ae.indexOf(t)>-1?(n=1*E(e.value,t),r=1*(E(e.getAttribute("min"),t)||NaN)):(n=Number(e.value),r=Number(e.getAttribute("min"))),isNaN(r)||n>=r}function z(e){if(!(I(e)&&e.value&&-1!==ce.indexOf(A(e))&&e.hasAttribute("minlength")&&e.getAttribute("minlength")))return!0;var t=parseInt(e.getAttribute("minlength"),10);return isNaN(t)||0>t?!0:B(e.value)>=t}function q(e){return!I(e)||!e.value||!e.hasAttribute("pattern")||new RegExp("^(?:"+e.getAttribute("pattern")+")$").test(e.value)}function G(e){if(!I(e)||!e.hasAttribute("required"))return!0;switch(e.type){case"checkbox":return e.checked;case"radio":return!!(e.checked||e.form&&Array.prototype.filter.call(document.getElementsByName(e.name),function(t){return t.name===e.name&&t.form===e.form&&t.checked}).length>0);default:return!!e.value}}function J(e){var t=A(e);if(!I(e)||!e.value||-1===le.indexOf(t)||"any"===(e.getAttribute("step")||"").toLowerCase())return!0;var n=e.getAttribute("step");if(n=n?M(n,t):Ee[t]||1,0>=n||isNaN(n))return!0;var r=Me[t]||1,i=M(e.value,t),a=M(e.getAttribute("min")||e.getAttribute("value")||"",t);isNaN(a)&&(a=Ae[t]||0),"month"===t&&(a=12*new Date(a).getUTCFullYear()+new Date(a).getUTCMonth(),i=12*new Date(i).getUTCFullYear()+new Date(i).getUTCMonth());var o=Math.abs(a-i)%(n*r);return 1e-8>o||o>n*r-1e-8}function K(e){return e.replace(Ve,"")}function Q(e){return e.split(",").map(function(e){return K(e)}).filter(function(e){return e})}function X(e){var t=A(e);if(!I(e)||"file"!==t&&!e.value||"file"!==t&&-1===se.indexOf(t))return!0;var n=!0;switch(t){case"url":Oe||(Oe=document.createElement("a"));var r=K(e.value);Oe.href=r,n=Oe.href===r||Oe.href===r+"/";break;case"email":n=e.hasAttribute("multiple")?Q(e.value).every(function(e){return Ie.test(e)}):Ie.test(K(e.value));break;case"file":if("files"in e&&e.files.length&&e.hasAttribute("accept")){var i=Q(e.getAttribute("accept")).map(function(e){return/^(audio|video|image)\/\*$/.test(e)&&(e=new RegExp("^"+RegExp.$1+"/.+$")),e});if(!i.length)break;e:for(var a=0;a<e.files.length;a++){var o=!1;t:for(var l=0;l<i.length;l++){var s=e.files[a],u=i[l],c=s.type;if("string"==typeof u&&"."===u.substr(0,1)){if(-1===s.name.search("."))continue t;c=s.name.substr(s.name.lastIndexOf("."))}if(0===c.search(u)){o=!0;break t}}if(!o){n=!1;break e}}}}return n}function ee(e,t){return function(n){var r=!e(n);return r&&t(n),r}}function te(e,t,n){ge.set(e,Pe.get(e,t,n))}function ne(e){var t=Re.get(e),n=t.length,r=!0;if(n)for(var i=0;n>i;i++){var a=t[i](e);if(void 0!==a&&!a){r=!1;break}}if(r){var o=ge.get(e);r=!(o.toString()&&"is_custom"in o)}return!r}function re(t){if(t instanceof window.HTMLFormElement)return Array.prototype.map.call(t.elements,re).every(function(e){return e});var n=Qe(t).valid;if(n){var r=V(t);r&&r.settings.valid_event&&e(t,"valid")}else e(t,"invalid",{cancelable:!0});return n}function ie(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=t.strict,r=void 0===n?!1:n,i=t.revalidate,a=t.valid_event,o=t.extend_fieldset,l=t.novalidate_on_elements,s=t.classes;void 0===i&&(i=r?"onsubmit":"hybrid"),void 0===a&&(a=!r),void 0===o&&(o=!r),void 0===l&&(l=!r),s||(s={});var u={strict:r,revalidate:i,valid_event:a,extend_fieldset:o,classes:s};return e instanceof window.NodeList||e instanceof window.HTMLCollection||e instanceof Array?Array.prototype.map.call(e,function(e){return ie(e,u)}):new R(e,u)}var ae=["datetime","date","month","week","time"],oe=["number","range"],le=ae.concat(oe,"datetime-local"),se=["email","url"],ue=["email","date","month","week","time","datetime","datetime-local","number","range","color"],ce=["text","search","tel","password"].concat(se),fe=["checkbox","color","file","image","radio","submit"].concat(le,ce),de=["button","hidden","reset"].concat(fe),me=["select-one","select-multiple","textarea"],ve=new WeakMap,ge={set:function(e,n){var r=arguments.length<=2||void 0===arguments[2]?!1:arguments[2];if(e instanceof window.HTMLFieldSetElement){var i=V(e);if(i&&!i.settings.extend_fieldset)return ge}return"string"==typeof n&&(n=new String(n)),r&&(n.is_custom=!0),t(n),ve.set(e,n),"_original_setCustomValidity"in e&&e._original_setCustomValidity(n.toString()),ge},get:function(e){var t=ve.get(e);return void 0===t&&"_original_validationMessage"in e&&(t=new String(e._original_validationMessage)),t?t:new String("")},"delete":function(e){return"_original_setCustomValidity"in e&&e._original_setCustomValidity(""),ve["delete"](e)}},he=0,we=new WeakMap,pe={attach_warning:function(e,t){t.parentNode.insertBefore(e,t.nextSibling)},detach_warning:function(e,t){e.parentNode.removeChild(e)},show_warning:function(e){var t=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],r=ge.get(e).toString(),i=we.get(e);if(r){if(!i){var a=V(e);i=document.createElement("div"),i.className=a&&a.settings.classes.warning||"hf-warning",i.id=n(),i.setAttribute("aria-live","polite"),we.set(e,i)}e.setAttribute("aria-errormessage",i.id),i.textContent=r,be.attach_warning(i,e)}else i&&i.parentNode&&(e.removeAttribute("aria-errormessage"),be.detach_warning(i,e));!t&&"radio"===e.type&&e.form&&Array.prototype.filter.call(document.getElementsByName(e.name),function(t){return t.name===e.name&&t.form===e.form}).map(function(e){return be.show_warning(e,"sub_radio")})}},be={attach_warning:pe.attach_warning,detach_warning:pe.detach_warning,show_warning:pe.show_warning,set:function(e,t){t||(t=pe[e]),be[e]=t}},ye={en:{TextTooLong:"Please shorten this text to %l characters or less (you are currently using %l characters).",ValueMissing:"Please fill out this field.",CheckboxMissing:"Please check this box if you want to proceed.",RadioMissing:"Please select one of these options.",FileMissing:"Please select a file.",SelectMissing:"Please select an item in the list.",InvalidEmail:"Please enter an email address.",InvalidURL:"Please enter a URL.",PatternMismatch:"Please match the requested format.",PatternMismatchWithTitle:"Please match the requested format: %l.",NumberRangeOverflow:"Please select a value that is no more than %l.",DateRangeOverflow:"Please select a value that is no later than %l.",TimeRangeOverflow:"Please select a value that is no later than %l.",NumberRangeUnderflow:"Please select a value that is no less than %l.",DateRangeUnderflow:"Please select a value that is no earlier than %l.",TimeRangeUnderflow:"Please select a value that is no earlier than %l.",StepMismatch:"Please select a valid value. The two nearest valid values are %l and %l.",StepMismatchOneValue:"Please select a valid value. The nearest valid value is %l.",BadInputNumber:"Please enter a number."}},Te="en",Ee={"datetime-local":60,datetime:60,time:60},Me={"datetime-local":1e3,datetime:1e3,date:864e5,week:6048e5,time:1e3},Ae={week:-2592e5},xe={range:0},Ne={range:100},Le=function(e){return function(){return this.getAttribute(e)}},De=function(e){return function(t){this.setAttribute(e,t)}},Ce=function(e){return function(){return this.hasAttribute(e)}},_e=function(e){return function(t){t?this.setAttribute(e,e):this.removeAttribute(e)}},ke=function(e){return function(){return Math.max(0,Number(this.getAttribute(e)))}},Fe=function(e){return function(t){/^[0-9]+$/.test(t)&&this.setAttribute(e,t)}},He={checkValidity:{value:t(function(){return re(this)})},reportValidity:{value:t(function(){return r(this)})},setCustomValidity:{value:t(function(e){return h(this,e)})},stepDown:{value:t(function(){var e=arguments.length<=0||void 0===arguments[0]?1:arguments[0];return k(this,e)})},stepUp:{value:t(function(){var e=arguments.length<=0||void 0===arguments[0]?1:arguments[0];return F(this,e)})},validationMessage:{get:t(function(){return H(this)})},validity:{get:t(function(){return Qe(this)})},valueAsDate:{get:t(function(){return C(this)}),set:t(function(e){C(this,e)})},valueAsNumber:{get:t(function(){return _(this)}),set:t(function(e){_(this,e)})},willValidate:{get:t(function(){return U(this)})}},Ue=new WeakMap;R.prototype={destroy:function(){m(this.form),Ue["delete"](this.form),this.form.removeEventListener("keyup",this.revalidator),this.form.removeEventListener("change",this.revalidator),this.form.removeEventListener("blur",this.revalidator,!0),this.form===window||this.form instanceof window.HTMLDocument?(this.uninstall([window.HTMLButtonElement.prototype,window.HTMLInputElement.prototype,window.HTMLSelectElement.prototype,window.HTMLTextAreaElement.prototype,window.HTMLFieldSetElement.prototype]),$(window.HTMLFormElement)):(this.form instanceof window.HTMLFormElement||this.form instanceof window.HTMLFieldSetElement)&&(this.uninstall(this.form.elements),this.form instanceof window.HTMLFormElement&&$(this.form))},revalidate:function(e){(e.target instanceof window.HTMLButtonElement||e.target instanceof window.HTMLTextAreaElement||e.target instanceof window.HTMLSelectElement||e.target instanceof window.HTMLInputElement)&&("hybrid"===this.settings.revalidate?"blur"===e.type&&e.target.value!==e.target.defaultValue||e.target.validity.valid?r(e.target):"keyup"!==e.type&&"change"!==e.type||e.target.validity.valid&&r(e.target):r(e.target))},install:function(e){e instanceof window.Element&&(e=[e]);for(var t=e.length,n=0;t>n;n++)P(e[n])},uninstall:function(e){e instanceof window.Element&&(e=[e]);for(var t=e.length,n=0;t>n;n++)$(e[n])}};var Oe,Se=new WeakMap,Pe={set:function(e,t,n){var r=Se.get(e)||{};return r[t]=n,Se.set(e,r),Pe},get:function(e,t){var n=arguments.length<=2||void 0===arguments[2]?void 0:arguments[2],r=Se.get(e);if(void 0===r||!(t in r)){var i="data-"+t.replace(/[A-Z]/g,"-$&").toLowerCase();return e.hasAttribute(i)?e.getAttribute(i):n}return r[t]},"delete":function(e){var t=arguments.length<=1||void 0===arguments[1]?null:arguments[1];if(!t)return Se["delete"](e);var n=Se.get(e)||{};return t in n?(delete n[t],Se.set(e,n),!0):!1}},$e=new WeakMap,Re={set:function(e,t){var n=$e.get(e)||[];return n.push(t),$e.set(e,n),Re},get:function(e){return $e.get(e)||[]},"delete":function(e){return $e["delete"](e)}},Ve=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,Ie=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Be=ee(W,function(e){return te(e,"badInput",L("Please match the requested type."))}),We=ee(q,function(e){te(e,"patternMismatch",e.title?w(L("PatternMismatchWithTitle"),e.title):L("PatternMismatch"))}),Ye=ee(Y,function(e){var t=A(e),n=void 0;switch(t){case"date":case"datetime":case"datetime-local":n=w(L("DateRangeOverflow"),E(e.getAttribute("max"),t));break;case"time":n=w(L("TimeRangeOverflow"),E(e.getAttribute("max"),t));break;default:n=w(L("NumberRangeOverflow"),M(e.getAttribute("max"),t))}te(e,"rangeOverflow",n)}),je=ee(Z,function(e){var t=A(e),n=void 0;switch(t){case"date":case"datetime":case"datetime-local":n=w(L("DateRangeUnderflow"),E(e.getAttribute("min"),t));break;case"time":n=w(L("TimeRangeUnderflow"),E(e.getAttribute("min"),t));break;default:n=w(L("NumberRangeUnderflow"),M(e.getAttribute("min"),t))}te(e,"rangeUnderflow",n)}),Ze=ee(J,function(e){var t=D(e),n=t[0],r=t[1],i=!1,a=void 0;null===n?i=r:null===r&&(i=n),a=i!==!1?w(L("StepMismatchOneValue"),i):w(L("StepMismatch"),n,r),te(e,"stepMismatch",a)}),ze=ee(j,function(e){te(e,"tooLong",w(L("TextTooLong"),e.getAttribute("maxlength"),B(e.value)))}),qe=ee(z,function(e){te(e,"tooShort",w(L("Please lengthen this text to %l characters or more (you are currently using %l characters)."),e.getAttribute("maxlength"),B(e.value)))}),Ge=ee(X,function(e){var t=L("Please use the appropriate format."),n=A(e);"email"===n?t=L(e.hasAttribute("multiple")?"Please enter a comma separated list of email addresses.":"InvalidEmail"):"url"===n?t=L("InvalidURL"):"file"===n&&(t=L("Please select a file of the correct type.")),te(e,"typeMismatch",t)}),Je=ee(G,function(e){var t=L("ValueMissing"),n=A(e);"checkbox"===n?t=L("CheckboxMissing"):"radio"===n?t=L("RadioMissing"):"file"===n?t=L(e.hasAttribute("multiple")?"Please select one or more files.":"FileMissing"):e instanceof window.HTMLSelectElement&&(t=L("SelectMissing")),te(e,"valueMissing",t)}),Ke={badInput:Be,customError:ne,patternMismatch:We,rangeOverflow:Ye,rangeUnderflow:je,stepMismatch:Ze,tooLong:ze,tooShort:qe,typeMismatch:Ge,valueMissing:Je},Qe=function nt(e){if(!(e instanceof window.HTMLElement))throw new Error("cannot create a ValidityState for a non-element");var t=nt.cache.get(e);return t?t:this instanceof nt?(this.element=e,void nt.cache.set(e,this)):new nt(e)},Xe={};Qe.prototype=Xe,Qe.cache=new WeakMap;for(var et in Ke)Object.defineProperty(Xe,et,{configurable:!0,enumerable:!0,get:function(e){return function(){return e(this.element)}}(Ke[et]),set:void 0});Object.defineProperty(Xe,"valid",{configurable:!0,enumerable:!0,get:function(){var e=V(this.element),t=e&&e.settings.classes.valid||"hf-valid",n=e&&e.settings.classes.invalid||"hf-invalid",r=e&&e.settings.classes.validated||"hf-validated";if(this.element.classList.add(r),I(this.element))for(var i in Ke)if(Ke[i](this.element))return this.element.classList.add(n),this.element.classList.remove(t),this.element.setAttribute("aria-invalid","true"),!1;return ge["delete"](this.element),this.element.classList.remove(n),this.element.classList.add(t),this.element.setAttribute("aria-invalid","false"),!0},set:void 0}),t(Xe);var tt="0.7.5";return ie.version=tt,ie.checkValidity=re,ie.reportValidity=r,ie.setCustomValidity=h,ie.stepDown=k,ie.stepUp=F,ie.validationMessage=H,ie.ValidityState=Qe,ie.valueAsDate=C,ie.valueAsNumber=_,ie.willValidate=U,ie.set_language=function(e){return x(e),ie},ie.add_translation=function(e,t){return N(e,t),ie},ie.set_renderer=function(e,t){return be.set(e,t),ie},ie.register=function(e,t){return Re.set(e,t),ie},ie.set_message=function(e,t,n){return Pe.set(e,t,n),ie},ie});

@@ -1,1 +0,2 @@

"use strict";function mark(e){return["object","function"].indexOf(typeof e)>-1&&(delete e.hyperform,Object.defineProperty(e,"hyperform",{value:!0})),e}function installer(e,t){return function(a){var r=Object.getOwnPropertyDescriptor(a,e);r&&!(r.get&&r.get.hyperform||r.value&&r.value.hyperform)&&Object.defineProperty(a,"_original_"+e,r),delete a[e],Object.defineProperty(a,e,t)}}function trigger_event(e,t){var a=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],r=a.bubbles,n=void 0===r?!0:r,i=a.cancelable,s=void 0===i?!1:i;if(!(t instanceof window.Event)){var l=document.createEvent("Event");l.initEvent(t,n,s),t=l}return e.dispatchEvent(t),t}function sliceIterator(e,t){var a=[],r=!0,n=!1,i=void 0;try{for(var s,l=e[Symbol.iterator]();!(r=(s=l.next()).done)&&(a.push(s.value),!t||a.length!==t);r=!0);}catch(o){n=!0,i=o}finally{try{!r&&l["return"]&&l["return"]()}finally{if(n)throw i}}return a}function _slicedToArray(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return sliceIterator(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}function sprintf(e){for(var t=arguments.length,a=Array(t>1?t-1:0),r=1;t>r;r++)a[r-1]=arguments[r];var n=a.length,i=0;return e.replace(/%([0-9]+\$)?([sl])/g,function(e,t,r){var s=i;t&&(s=Number(t.replace(/\$$/,""))-1),i+=1;var l="";return n>s&&(l=a[s]),(l instanceof Date||"number"==typeof l||l instanceof Number)&&(l="l"===r?(l.toLocaleString||l.toString).call(l):l.toString()),l})}function get_week_of_year(e){e=new Date(+e),e.setUTCHours(0,0,0),e.setUTCDate(e.getUTCDate()+4-(e.getUTCDay()||7));var t=new Date(e.getUTCFullYear(),0,1),a=Math.ceil(((e-t)/864e5+1)/7);return[e.getUTCFullYear(),a]}function pad(e){for(var t=arguments.length<=1||void 0===arguments[1]?2:arguments[1],a=e+"";a.length<t;)a="0"+a;return a}function date_to_string(e,t){if(!(e instanceof Date))return null;switch(t){case"datetime":return date_to_string(e,"date")+"T"+date_to_string(e,"time");case"datetime-local":return sprintf("%s-%s-%sT%s:%s:%s.%s",e.getFullYear(),pad(e.getMonth()+1),pad(e.getDate()),pad(e.getHours()),pad(e.getMinutes()),pad(e.getSeconds()),pad(e.getMilliseconds(),3)).replace(/(:00)?\.000$/,"");case"date":return sprintf("%s-%s-%s",e.getUTCFullYear(),pad(e.getUTCMonth()+1),pad(e.getUTCDate()));case"month":return sprintf("%s-%s",e.getUTCFullYear(),pad(e.getUTCMonth()+1));case"week":var a=get_week_of_year(e);return sprintf.call(null,"%s-W%s",a[0],pad(a[1]));case"time":return sprintf("%s:%s:%s.%s",pad(e.getUTCHours()),pad(e.getUTCMinutes()),pad(e.getUTCSeconds()),pad(e.getUTCMilliseconds(),3)).replace(/(:00)?\.000$/,"")}return null}function get_date_from_week(e,t){var a=new Date(Date.UTC(t,0,1+7*(e-1)));return a.getUTCDay()<=4?a.setUTCDate(a.getUTCDate()-a.getUTCDay()+1):a.setUTCDate(a.getUTCDate()+8-a.getUTCDay()),a}function string_to_date(e,t){var a,r=new Date(0);switch(t){case"datetime":if(!/^([0-9]{4,})-([0-9]{2})-([0-9]{2})T([01][0-9]|2[0-3]):([0-5][0-9])(?::([0-5][0-9])(?:\.([0-9]{1,3}))?)?$/.test(e))return null;for(a=RegExp.$7||"000";a.length<3;)a+="0";return r.setUTCFullYear(Number(RegExp.$1)),r.setUTCMonth(Number(RegExp.$2)-1,Number(RegExp.$3)),r.setUTCHours(Number(RegExp.$4),Number(RegExp.$5),Number(RegExp.$6||0),Number(a)),r;case"date":return/^([0-9]{4,})-([0-9]{2})-([0-9]{2})$/.test(e)?(r.setUTCFullYear(Number(RegExp.$1)),r.setUTCMonth(Number(RegExp.$2)-1,Number(RegExp.$3)),r):null;case"month":return/^([0-9]{4,})-([0-9]{2})$/.test(e)?(r.setUTCFullYear(Number(RegExp.$1)),r.setUTCMonth(Number(RegExp.$2)-1,1),r):null;case"week":return/^([0-9]{4,})-W(0[1-9]|[1234][0-9]|5[0-3])$/.test(e)?get_date_from_week(Number(RegExp.$2),Number(RegExp.$1)):null;case"time":if(!/^([01][0-9]|2[0-3]):([0-5][0-9])(?::([0-5][0-9])(?:\.([0-9]{1,3}))?)?$/.test(e))return null;for(a=RegExp.$4||"000";a.length<3;)a+="0";return r.setUTCHours(Number(RegExp.$1),Number(RegExp.$2),Number(RegExp.$3||0),Number(a)),r}return null}function string_to_number(e,t){var a=string_to_date(e,t);return null!==a?+a:Number(e)}function get_type(e){if(e instanceof window.HTMLTextAreaElement)return"textarea";if(e instanceof window.HTMLSelectElement)return e.hasAttribute("multiple")?"select-multiple":"select-one";if(e instanceof window.HTMLButtonElement)return(e.getAttribute("type")||"submit").toLowerCase();if(e instanceof window.HTMLInputElement){var t=(e.getAttribute("type")||"").toLowerCase();return t&&inputs.indexOf(t)>-1?t:e.type||"text"}return""}function set_language(e){language=e}function add_translation(e,t){e in catalog||(catalog[e]={});var a=!0,r=!1,n=void 0;try{for(var i,s=Object.keys(t)[Symbol.iterator]();!(a=(i=s.next()).done);a=!0){var l=i.value;catalog[e][l]=t[l]}}catch(o){r=!0,n=o}finally{try{!a&&s["return"]&&s["return"]()}finally{if(r)throw n}}}function _(e){return language in catalog&&e in catalog[language]?catalog[language][e]:e in catalog.en?catalog.en[e]:e}function get_next_valid(e){var t=arguments.length<=1||void 0===arguments[1]?1:arguments[1],a=get_type(e),r=e.getAttribute("min"),n=default_min[a]||NaN;if(r){var i=string_to_number(r,a);isNaN(i)||(n=i)}var s=e.getAttribute("max"),l=default_max[a]||NaN;if(s){var o=string_to_number(s,a);isNaN(o)||(l=o)}var u=e.getAttribute("step"),d=default_step[a]||1;if(u&&"any"===u.toLowerCase())return[_("any value"),_("any value")];if(u){var c=string_to_number(u,a);isNaN(c)||(d=c)}var g=string_to_number(e.getAttribute("value"),a),f=string_to_number(e.value||e.getAttribute("value"),a);if(isNaN(f))return[_("any valid value"),_("any valid value")];var m=isNaN(n)?isNaN(g)?default_step_base[a]||0:g:n,v=step_scale_factor[a]||1,p=m+Math.floor((f-m)/(d*v))*(d*v)*t,h=m+(Math.floor((f-m)/(d*v))+1)*(d*v)*t;return n>p?p=null:p>l&&(p=l),h>l?h=null:n>h&&(h=n),dates.indexOf(a)>-1&&(p=date_to_string(new Date(p),a),h=date_to_string(new Date(h),a)),[p,h]}function defineProperties(e,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _createClass(e,t,a){return t&&defineProperties(e.prototype,t),a&&defineProperties(e,a),e}function generate_id(){var e=arguments.length<=0||void 0===arguments[0]?"hf_":arguments[0];return e+uid++ +Math.random().toString(36).substr(2)}function reportValidity(e){if(e instanceof window.HTMLFormElement)return Array.prototype.map.call(e.elements,reportValidity).every(function(e){return e});var t,a=ValidityState(e).valid;if(a){var r=get_wrapper(e);r&&r.settings.valid_event&&(t=trigger_event(e,"valid",{cancelable:!0}))}else t=trigger_event(e,"invalid",{cancelable:!0});return t&&t.defaultPrevented||Renderer.show_warning(e),a}function check(e){e.preventDefault();var t=trigger_event(e.target.form,"validate",{cancelable:!0});if(!t.defaultPrevented){var a,r=!0;if(Array.prototype.map.call(e.target.form.elements,function(e){reportValidity(e)||(r=!1,!a&&"focus"in e&&(a=e))}),r){var n=trigger_event(e.target.form,"submit",{cancelable:!0});n.defaultPrevented||e.target.form.submit()}else a&&a.focus()}}function catch_submit(e){e.addEventListener("click",function(e){e.defaultPrevented||"INPUT"!==e.target.nodeName&&"BUTTON"!==e.target.nodeName||"image"!==e.target.type&&"submit"!==e.target.type||e.target.hasAttribute("formnovalidate")||!e.target.form||e.target.form.hasAttribute("novalidate")||check(e)}),e.addEventListener("keypress",function(e){if(!e.defaultPrevented&&13===e.keyCode&&"INPUT"===e.target.nodeName&&text_types.indexOf(e.target.type)>-1&&e.target.form&&!e.target.form.hasAttribute("novalidate")){for(var t,a=e.target.form.elements.length,r=0;a>r;r++)if(["image","submit"].indexOf(e.target.form.elements[r].type)>-1){t=e.target.form.elements[r];break}t?(e.preventDefault(),t.click()):check(e)}})}function setCustomValidity(e){message_store.set(this,e,!0)}function valueAsDate(){var e=arguments.length<=0||void 0===arguments[0]?void 0:arguments[0],t=get_type(this);if(dates.indexOf(t)>-1){if(void 0!==e){if(null===e)this.value="";else{if(!(e instanceof Date))throw new window.DOMException("valueAsDate setter encountered invalid value","TypeError");isNaN(e.getTime())?this.value="":this.value=date_to_string(e,t)}return}var a=string_to_date(this.value,t);return a instanceof Date?a:null}if(void 0!==e)throw new window.DOMException("valueAsDate setter cannot set date on this element","InvalidStateError");return null}function valueAsNumber(){var e=arguments.length<=0||void 0===arguments[0]?void 0:arguments[0],t=get_type(this);if(numbers.indexOf(t)>-1){if("range"===t&&this.hasAttribute("multiple"))return NaN;if(void 0!==e){if(isNaN(e))this.value="";else{if("number"!=typeof e||!window.isFinite(e))throw new window.DOMException("valueAsNumber setter encountered invalid value","TypeError");try{valueAsDate.call(this,new Date(e))}catch(a){if(!(a instanceof window.DOMException))throw a;this.value=e.toString()}}return}return string_to_number(this.value,t)}if(void 0!==e)throw new window.DOMException("valueAsNumber setter cannot set number on this element","InvalidStateError");return NaN}function stepDown(e){var t=arguments.length<=1||void 0===arguments[1]?1:arguments[1];if(-1===numbers.indexOf(get_type(e)))throw new window.DOMException("stepDown encountered invalid type","InvalidStateError");if("any"===(e.getAttribute("step")||"").toLowerCase())throw new window.DOMException('stepDown encountered step "any"',"InvalidStateError");var a=get_next_valid(e,t),r=a.prev;a.next;null!==r&&valueAsNumber.call(e,r)}function stepUp(e){var t=arguments.length<=1||void 0===arguments[1]?1:arguments[1];if(-1===numbers.indexOf(get_type(e)))throw new window.DOMException("stepUp encountered invalid type","InvalidStateError");if("any"===(e.getAttribute("step")||"").toLowerCase())throw new window.DOMException('stepUp encountered step "any"',"InvalidStateError");var a=get_next_valid(e,t),r=(a.prev,a.next);null!==r&&valueAsNumber.call(e,r)}function validationMessage(){var e=message_store.get(this);return e?e.toString():""}function willValidate(){return is_validation_candidate(this)}function get_wrapper(e){var t;for(e.form&&(t=instances.get(e.form));!t&&e;)t=instances.get(e),e=e.parentNode;return t||(t=instances.get(window)),t}function is_validation_candidate(e){if(e instanceof window.HTMLSelectElement||e instanceof window.HTMLTextAreaElement||e instanceof window.HTMLButtonElement||e instanceof window.HTMLInputElement){var t=get_type(e);if((!t||non_inputs.indexOf(t)>-1||validation_candidates.indexOf(t)>-1)&&!e.hasAttribute("disabled")&&!e.hasAttribute("readonly")){var a=get_wrapper(e);if(a&&a.settings.strict||!e.hasAttribute("novalidate")||!e.noValidate){for(var r=e.parentNode;r&&1===r.nodeType;){if(r instanceof window.HTMLFieldSetElement&&r.hasAttribute("disabled"))return!1;if(r===e.form)break;r=r.parentNode}return!0}}}return!1}function unicode_string_length(e){return[].concat(_toConsumableArray(e)).length}function test_max(e){var t=get_type(e);if(!is_validation_candidate(e)||!e.value||!e.hasAttribute("max"))return!0;var a=void 0,r=void 0;return dates.indexOf(t)>-1?(a=1*string_to_date(e.value,t),r=1*(string_to_date(e.getAttribute("max"),t)||NaN)):(a=Number(e.value),r=Number(e.getAttribute("max"))),isNaN(r)||r>=a}function test_maxlength(e){if(!(is_validation_candidate(e)&&e.value&&-1!==text_types.indexOf(get_type(e))&&e.hasAttribute("maxlength")&&e.getAttribute("maxlength")))return!0;var t=parseInt(e.getAttribute("maxlength"),10);return isNaN(t)||0>t?!0:unicode_string_length(e.value)<=t}function test_min(e){var t=get_type(e);if(!is_validation_candidate(e)||!e.value||!e.hasAttribute("min"))return!0;var a=void 0,r=void 0;return dates.indexOf(t)>-1?(a=1*string_to_date(e.value,t),r=1*(string_to_date(e.getAttribute("min"),t)||NaN)):(a=Number(e.value),r=Number(e.getAttribute("min"))),isNaN(r)||a>=r}function test_minlength(e){if(!(is_validation_candidate(e)&&e.value&&-1!==text_types.indexOf(get_type(e))&&e.hasAttribute("minlength")&&e.getAttribute("minlength")))return!0;var t=parseInt(e.getAttribute("minlength"),10);return isNaN(t)||0>t?!0:unicode_string_length(e.value)>=t}function test_pattern(e){return!is_validation_candidate(e)||!e.value||!e.hasAttribute("pattern")||new RegExp("^(?:"+e.getAttribute("pattern")+")$").test(e.value)}function test_required(e){if(!is_validation_candidate(e)||!e.hasAttribute("required"))return!0;switch(e.type){case"checkbox":return e.checked;case"radio":return!!(e.checked||e.form&&Array.prototype.filter.call(document.getElementsByName(e.name),function(t){return t.name===e.name&&t.form===e.form&&t.checked}).length>0);default:return!!e.value}}function test_step(e){var t=get_type(e);if(!is_validation_candidate(e)||!e.value||-1===numbers.indexOf(t)||"any"===(e.getAttribute("step")||"").toLowerCase())return!0;var a=e.getAttribute("step");if(a=a?string_to_number(a,t):default_step[t]||1,0>=a||isNaN(a))return!0;var r=step_scale_factor[t]||1,n=string_to_number(e.value,t),i=string_to_number(e.getAttribute("min")||e.getAttribute("value")||"",t);isNaN(i)&&(i=default_step_base[t]||0),"month"===t&&(i=12*new Date(i).getUTCFullYear()+new Date(i).getUTCMonth(),n=12*new Date(n).getUTCFullYear()+new Date(n).getUTCMonth());var s=Math.abs(i-n)%(a*r);return 1e-8>s||s>a*r-1e-8}function comma_split(e){return e.split(",").map(function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}).filter(function(e){return e})}function test_type(e){var t=get_type(e);if(!is_validation_candidate(e)||"file"!==t&&!e.value||"file"!==t&&-1===type_checked.indexOf(t))return!0;var a=!0;switch(t){case"url":url_canary.href=e.value,a=url_canary.href===e.value||url_canary.href===e.value+"/";break;case"email":a=e.hasAttribute("multiple")?comma_split(e.value).every(function(e){return email_pattern.test(e)}):email_pattern.test(e.value);break;case"file":if("files"in e&&e.files.length&&e.hasAttribute("accept")){var r=comma_split(e.getAttribute("accept")).map(function(e){return/^(audio|video|image)\/\*$/.test(e)&&(e=new RegExp("^"+RegExp.$1+"/.+$")),e});if(!r.length)break;e:for(var n=0;n<e.files.length;n++){var i=!1;t:for(var s=0;s<r.length;s++){var l=e.files[n],o=r[s],u=l.type;if("string"==typeof o&&"."===o.substr(0,1)){if(-1===l.name.search("."))continue t;u=l.name.substr(l.name.lastIndexOf("."))}if(0===u.search(o)){i=!0;break t}}if(!i){a=!1;break e}}}}return a}function test_bad_input(e){var t=get_type(e);if(!is_validation_candidate(e)||-1===input_checked.indexOf(t))return!0;if(!e.value)return"_original_validity"in e?!e._original_validity.badInput:!0;var a=!0;switch(t){case"color":a=/^#[a-f0-9]{6}$/.test(e.value);break;case"number":case"range":a=!isNaN(Number(e.value));break;case"datetime":case"date":case"month":case"week":case"time":a=null!==string_to_date(e.value,t);break;case"datetime-local":a=/^([0-9]{4,})-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9])(?::([0-5][0-9])(?:\.([0-9]{1,3}))?)?$/.test(e.value);break;case"tel":break;case"email":}return a}function checkValidity(e){if(e instanceof window.HTMLFormElement)return Array.prototype.map.call(e.elements,checkValidity).every(function(e){return e});var t=ValidityState(e).valid;if(t){var a=get_wrapper(e);a&&a.settings.valid_event&&trigger_event(e,"valid")}else trigger_event(e,"invalid",{cancelable:!0});return t}function hyperform(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],a=t.strict,r=void 0===a?!1:a,n=t.revalidate,i=void 0===n?"oninput":n,s=t.valid_event,l=void 0===s?!0:s,o=t.classes,u=void 0===o?{}:o;return e instanceof window.NodeList||e instanceof window.HTMLCollection||e instanceof Array?Array.prototype.map.call(e,function(e){return hyperform(e)}):new Wrapper(e,{strict:r,revalidate:i,valid_event:l,classes:u})}var dates=["datetime","date","month","week","time"],plain_numbers=["number","range"],numbers=dates.concat(plain_numbers,"datetime-local"),type_checked=["email","url"],input_checked=["email","date","month","week","time","datetime","datetime-local","number","range","color"],text_types=["text","search","tel","password"].concat(type_checked),validation_candidates=["checkbox","color","file","image","radio","submit"].concat(numbers,text_types),inputs=["button","hidden","reset"].concat(validation_candidates),non_inputs=["select-one","select-multiple","textarea"],catalog={en:{TextTooLong:"Please shorten this text to %l characters or less (you are currently using %l characters).",ValueMissing:"Please fill out this field.",CheckboxMissing:"Please check this box if you want to proceed.",RadioMissing:"Please select one of these options.",FileMissing:"Please select a file.",SelectMissing:"Please select an item in the list.",InvalidEmail:"Please enter an email address.",InvalidURL:"Please enter a URL.",PatternMismatch:"Please match the requested format.",PatternMismatchWithTitle:"Please match the requested format: %l.",NumberRangeOverflow:"Please select a value that is no more than %l.",DateRangeOverflow:"Please select a value that is no later than %l.",TimeRangeOverflow:"Please select a value that is no later than %l.",NumberRangeUnderflow:"Please select a value that is no less than %l.",DateRangeUnderflow:"Please select a value that is no earlier than %l.",TimeRangeUnderflow:"Please select a value that is no earlier than %l.",StepMismatch:"Please select a valid value. The two nearest valid values are %l and %l.",StepMismatchOneValue:"Please select a valid value. The nearest valid value is %l.",BadInputNumber:"Please enter a number."}},language="en",default_step={"datetime-local":60,datetime:60,time:60},step_scale_factor={"datetime-local":1e3,datetime:1e3,date:864e5,week:6048e5,time:1e3},default_step_base={week:-2592e5},default_min={range:0},default_max={range:100},_classCallCheck=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},store=new WeakMap,message_store={set:function(e,t){var a=arguments.length<=2||void 0===arguments[2]?!1:arguments[2];if(e instanceof window.HTMLFieldSetElement){var r=get_wrapper(e);if(r&&r.settings.strict)return message_store}return"string"==typeof t&&(t=new String(t)),a&&(t.is_custom=!0),mark(t),store.set(e,t),"_original_setCustomValidity"in e&&e._original_setCustomValidity(t.toString()),message_store},get:function(e){var t=store.get(e);return void 0===t&&"_original_validationMessage"in e&&(t=new String(e._original_validationMessage)),t?t:new String("")},"delete":function(e){return"_original_setCustomValidity"in e&&e._original_setCustomValidity(""),store["delete"](e)}},uid=0,warnings_cache=new WeakMap,Renderer={attach_warning:function(e,t){t.parentNode.insertBefore(e,t.nextSibling)},detach_warning:function(e,t){e.parentNode.removeChild(e)},show_warning:function(e){var t=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],a=message_store.get(e).toString(),r=warnings_cache.get(e);if(a){if(!r){var n=get_wrapper(e);r=document.createElement("div"),r.className=n&&n.settings.classes.warning||"hf-warning",r.id=generate_id(),warnings_cache.set(e,r)}e.setAttribute("aria-errormessage",r.id),r.textContent=a,Renderer.attach_warning(r,e)}else r&&r.parentNode&&(e.removeAttribute("aria-errormessage"),Renderer.detach_warning(r,e));!t&&"radio"===e.type&&e.form&&Array.prototype.filter.call(document.getElementsByName(e.name),function(t){return t.name===e.name&&t.form===e.form}).map(function(e){return Renderer.show_warning(e,"sub_radio")})},set:function(e,t){Renderer[e]=t}};reportValidity.install=installer("reportValidity",{configurable:!0,enumerable:!0,value:function(){return reportValidity(this)},writable:!0}),mark(reportValidity),setCustomValidity.install=installer("setCustomValidity",{configurable:!0,enumerable:!0,value:setCustomValidity,writable:!0}),mark(setCustomValidity),valueAsDate.install=installer("valueAsDate",{configurable:!0,enumerable:!0,get:valueAsDate,set:valueAsDate}),mark(valueAsDate),valueAsNumber.install=installer("valueAsNumber",{configurable:!0,enumerable:!0,get:valueAsNumber,set:valueAsNumber}),mark(valueAsNumber),stepDown.install=installer("stepDown",{configurable:!0,enumerable:!0,value:function(){var e=arguments.length<=0||void 0===arguments[0]?1:arguments[0];return stepDown(this,e)},writable:!0}),mark(stepDown),stepUp.install=installer("stepUp",{configurable:!0,enumerable:!0,value:function(){var e=arguments.length<=0||void 0===arguments[0]?1:arguments[0];return stepUp(this,e)},writable:!0}),mark(stepUp),validationMessage.install=installer("validationMessage",{configurable:!0,enumerable:!0,get:validationMessage,set:void 0}),mark(validationMessage),willValidate.install=installer("willValidate",{configurable:!0,enumerable:!0,get:willValidate,set:void 0}),mark(willValidate);var instances=new WeakMap,Wrapper=function(){function e(t,a){_classCallCheck(this,e),this.form=t,this.settings=a,instances.set(t,this),catch_submit(t),t===window||t instanceof window.HTMLDocument?this.install([window.HTMLButtonElement.prototype,window.HTMLInputElement.prototype,window.HTMLSelectElement.prototype,window.HTMLTextAreaElement.prototype,window.HTMLFieldSetElement.prototype]):(t instanceof window.HTMLFormElement||t instanceof window.HTMLFieldSetElement)&&this.install(t.elements),"oninput"===a.revalidate&&(t.addEventListener("keyup",this.revalidate.bind(this)),t.addEventListener("change",this.revalidate.bind(this)))}return _createClass(e,[{key:"revalidate",value:function(e){(e.target instanceof window.HTMLButtonElement||e.target instanceof window.HTMLTextAreaElement||e.target instanceof window.HTMLSelectElement||e.target instanceof window.HTMLInputElement)&&reportValidity(e.target)}},{key:"install",value:function(e){e instanceof window.HTMLElement&&(e=[e]);for(var t=e.length,a=0;t>a;a++)checkValidity.install(e[a]),reportValidity.install(e[a]),setCustomValidity.install(e[a]),stepDown.install(e[a]),stepUp.install(e[a]),validationMessage.install(e[a]),ValidityState.install(e[a]),valueAsDate.install(e[a]),valueAsNumber.install(e[a]),willValidate.install(e[a])}}]),e}(),_toConsumableArray=function(e){if(Array.isArray(e)){for(var t=0,a=Array(e.length);t<e.length;t++)a[t]=e[t];return a}return Array.from(e)},internal_registry=new WeakMap,registry={set:function(e,t){var a=internal_registry.get(e)||[];return a.push(t),internal_registry.set(e,a),registry},get:function(e){return internal_registry.get(e)||[]},"delete":function(e){return internal_registry["delete"](e)}},url_canary=document.createElement("a"),email_pattern=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,validity_state_checkers={badInput:function(e){var t=!test_bad_input(e);return t&&message_store.set(e,_("Please match the requested type.")),t},customError:function(e){var t=registry.get(e),a=!0;if(t.length){var r=!0,n=!1,i=void 0;try{for(var s,l=t[Symbol.iterator]();!(r=(s=l.next()).done);r=!0){var o=s.value,u=o(e);if(void 0!==u&&!u){a=!1;break}}}catch(d){n=!0,i=d}finally{try{!r&&l["return"]&&l["return"]()}finally{if(n)throw i}}}if(a){var c=message_store.get(e);a=!(c.toString()&&"is_custom"in c)}return!a},patternMismatch:function(e){var t=!test_pattern(e);return t&&message_store.set(e,e.title?sprintf(_("PatternMismatchWithTitle"),e.title):_("PatternMismatch")),t},rangeOverflow:function(e){var t=!test_max(e),a=get_type(e);if(t){var r=void 0;switch(a){case"date":case"datetime":case"datetime-local":r=sprintf(_("DateRangeOverflow"),string_to_date(e.getAttribute("max"),a));break;case"time":r=sprintf(_("TimeRangeOverflow"),string_to_date(e.getAttribute("max"),a));break;default:r=sprintf(_("NumberRangeOverflow"),string_to_number(e.getAttribute("max"),a))}message_store.set(e,r)}return t},rangeUnderflow:function(e){var t=!test_min(e),a=get_type(e);if(t){var r=void 0;switch(a){case"date":case"datetime":case"datetime-local":r=sprintf(_("DateRangeUnderflow"),string_to_date(e.getAttribute("max"),a));break;case"time":r=sprintf(_("TimeRangeUnderflow"),string_to_date(e.getAttribute("max"),a));break;default:r=sprintf(_("NumberRangeUnderflow"),string_to_number(e.getAttribute("max"),a))}message_store.set(e,r)}return t},stepMismatch:function(e){var t=!test_step(e);if(t){var a=get_next_valid(e),r=_slicedToArray(a,2),n=r[0],i=r[1],s=!1;null===n?s=i:null===i&&(s=n),s!==!1?message_store.set(e,sprintf(_("StepMismatchOneValue"),s)):message_store.set(e,sprintf(_("StepMismatch"),n,i))}return t},tooLong:function(e){var t=!test_maxlength(e);return t&&message_store.set(e,sprintf(_("TextTooLong"),e.getAttribute("maxlength"),unicode_string_length(e.value))),t},tooShort:function(e){var t=!test_minlength(e);return t&&message_store.set(e,sprintf(_("Please lengthen this text to %l characters or more (you are currently using %l characters)."),e.getAttribute("maxlength"),unicode_string_length(e.value))),t},typeMismatch:function(e){var t=!test_type(e);if(t){var a=_("Please use the appropriate format."),r=get_type(e);"email"===r?a=_(e.hasAttribute("multiple")?"Please enter a comma separated list of email addresses.":"InvalidEmail"):"url"===r?a=_("InvalidURL"):"file"===r&&(a=_("Please select a file of the correct type.")),message_store.set(e,a)}return t},valueMissing:function(e){var t=!test_required(e);if(t){var a=_("ValueMissing"),r=get_type(e);"checkbox"===r?a=_("CheckboxMissing"):"radio"===r?a=_("RadioMissing"):"file"===r?a=_(e.hasAttribute("multiple")?"Please select one or more files.":"FileMissing"):e instanceof window.HTMLSelectElement&&(a=_("SelectMissing")),message_store.set(e,a)}return t}},ValidityState=function e(t){if(!(t instanceof window.HTMLElement))throw new Error("cannot create a ValidityState for a non-element");var a=e.cache.get(t);return a?a:this instanceof e?(this.element=t,void e.cache.set(t,this)):new e(t)},ValidityStatePrototype={};ValidityState.prototype=ValidityStatePrototype,ValidityState.cache=new WeakMap;for(var prop in validity_state_checkers)Object.defineProperty(ValidityStatePrototype,prop,{configurable:!0,enumerable:!0,get:function(e){return function(){return e(this.element)}}(validity_state_checkers[prop]),set:void 0});Object.defineProperty(ValidityStatePrototype,"valid",{configurable:!0,enumerable:!0,get:function(){var e=get_wrapper(this.element),t=e&&e.settings.classes.valid||"hf-valid",a=e&&e.settings.classes.invalid||"hf-invalid",r=e&&e.settings.classes.validated||"hf-validated";if(this.element.classList.add(r),is_validation_candidate(this.element))for(var n in validity_state_checkers)if(validity_state_checkers[n](this.element))return this.element.classList.add(a),this.element.classList.remove(t),this.element.setAttribute("aria-invalid","true"),!1;return message_store["delete"](this.element),this.element.classList.remove(a),this.element.classList.add(t),this.element.setAttribute("aria-invalid","false"),!0},set:void 0}),mark(ValidityStatePrototype),ValidityState.install=installer("validity",{configurable:!0,enumerable:!0,get:function(){return ValidityState(this)}}),checkValidity.install=installer("checkValidity",{configurable:!0,enumerable:!0,value:function(){return checkValidity(this)},writable:!0}),mark(checkValidity);var version="0.7.3",set_renderer=Renderer.set,register=registry.set;hyperform.version=version,hyperform.checkValidity=checkValidity,hyperform.reportValidity=reportValidity,hyperform.setCustomValidity=setCustomValidity,hyperform.stepDown=stepDown,hyperform.stepUp=stepUp,hyperform.validationMessage=validationMessage,hyperform.ValidityState=ValidityState,hyperform.valueAsDate=valueAsDate,hyperform.valueAsNumber=valueAsNumber,hyperform.willValidate=willValidate,hyperform.set_language=set_language,hyperform.add_translation=add_translation,hyperform.set_renderer=set_renderer,hyperform.register=register,module.exports=hyperform;
/*! hyperform.js.org */
"use strict";function trigger_event(e,t){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],r=n.bubbles,a=void 0===r?!0:r,i=n.cancelable,s=void 0===i?!1:i;if(!(t instanceof window.Event)){var o=document.createEvent("Event");o.initEvent(t,a,s),t=o}return e.dispatchEvent(t),t}function mark(e){return["object","function"].indexOf(typeof e)>-1&&(delete e.__hyperform,Object.defineProperty(e,"__hyperform",{configurable:!0,enumerable:!1,value:!0})),e}function generate_id(){var e=arguments.length<=0||void 0===arguments[0]?"hf_":arguments[0];return e+uid++ +Math.random().toString(36).substr(2)}function reportValidity(e){if(e instanceof window.HTMLFormElement)return Array.prototype.map.call(e.elements,reportValidity).every(function(e){return e});var t,n=ValidityState(e).valid;if(n){var r=get_wrapper(e);r&&r.settings.valid_event&&(t=trigger_event(e,"valid",{cancelable:!0}))}else t=trigger_event(e,"invalid",{cancelable:!0});return t&&t.defaultPrevented||Renderer.show_warning(e),n}function check(e){e.preventDefault();var t=trigger_event(e.target.form,"validate",{cancelable:!0});if(!t.defaultPrevented){var n,r=!0;if(Array.prototype.map.call(e.target.form.elements,function(e){reportValidity(e)||(r=!1,!n&&"focus"in e&&(n=e))}),r){var a=trigger_event(e.target.form,"submit",{cancelable:!0});a.defaultPrevented||e.target.form.submit()}else n&&n.focus()}}function is_submit_button(e){return!("INPUT"!==e.nodeName&&"BUTTON"!==e.nodeName||"image"!==e.type&&"submit"!==e.type)}function is_submitting_click(e){return!e.defaultPrevented&&(!("button"in e)||e.button<2)&&is_submit_button(e.target)&&!e.target.hasAttribute("formnovalidate")&&e.target.form&&!e.target.form.hasAttribute("novalidate")}function is_submitting_keypress(e){return!e.defaultPrevented&&(13===e.keyCode&&"INPUT"===e.target.nodeName&&text_types.indexOf(e.target.type)>-1||(13===e.keyCode||32===e.keyCode)&&is_submit_button(e.target))&&e.target.form&&!e.target.form.hasAttribute("novalidate")}function click_handler(e){is_submitting_click(e)&&check(e)}function ignored_click_handler(e){is_submitting_click(e)&&e.target.form.submit()}function keypress_handler(e){if(is_submitting_keypress(e)){for(var t,n=e.target.form.elements.length,r=0;n>r;r++)if(["image","submit"].indexOf(e.target.form.elements[r].type)>-1){t=e.target.form.elements[r];break}t?(e.preventDefault(),t.click()):check(e)}}function ignored_keypress_handler(e){if(is_submitting_keypress(e)){for(var t,n=e.target.form.elements.length,r=0;n>r;r++)if(["image","submit"].indexOf(e.target.form.elements[r].type)>-1){t=e.target.form.elements[r];break}t?(e.preventDefault(),t.click()):e.target.form.submit()}}function catch_submit(e){var t=arguments.length<=1||void 0===arguments[1]?!1:arguments[1];t?(e.addEventListener("click",ignored_click_handler),e.addEventListener("keypress",ignored_keypress_handler)):(e.addEventListener("click",click_handler),e.addEventListener("keypress",keypress_handler))}function uncatch_submit(e){e.removeEventListener("click",ignored_click_handler),e.removeEventListener("keypress",ignored_keypress_handler),e.removeEventListener("click",click_handler),e.removeEventListener("keypress",keypress_handler)}function uninstall_property(e,t){delete e[t];var n=Object.getOwnPropertyDescriptor(e,"_original_"+t);n&&Object.defineProperty(e,t,n)}function install_property(e,t,n){n.configurable=!0,n.enumerable=!0,"value"in n&&(n.writable=!0);var r=Object.getOwnPropertyDescriptor(e,t);if(r){if(r.get&&r.get.__hyperform||r.value&&r.value.__hyperform)return;Object.defineProperty(e,"_original_"+t,r)}delete e[t],Object.defineProperty(e,t,n)}function setCustomValidity(e,t){message_store.set(e,t,!0)}function sprintf(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];var a=n.length,i=0;return e.replace(/%([0-9]+\$)?([sl])/g,function(e,t,r){var s=i;t&&(s=Number(t.replace(/\$$/,""))-1),i+=1;var o="";return a>s&&(o=n[s]),(o instanceof Date||"number"==typeof o||o instanceof Number)&&(o="l"===r?(o.toLocaleString||o.toString).call(o):o.toString()),o})}function get_week_of_year(e){e=new Date(+e),e.setUTCHours(0,0,0),e.setUTCDate(e.getUTCDate()+4-(e.getUTCDay()||7));var t=new Date(e.getUTCFullYear(),0,1),n=Math.ceil(((e-t)/864e5+1)/7);return[e.getUTCFullYear(),n]}function pad(e){for(var t=arguments.length<=1||void 0===arguments[1]?2:arguments[1],n=e+"";n.length<t;)n="0"+n;return n}function date_to_string(e,t){if(!(e instanceof Date))return null;switch(t){case"datetime":return date_to_string(e,"date")+"T"+date_to_string(e,"time");case"datetime-local":return sprintf("%s-%s-%sT%s:%s:%s.%s",e.getFullYear(),pad(e.getMonth()+1),pad(e.getDate()),pad(e.getHours()),pad(e.getMinutes()),pad(e.getSeconds()),pad(e.getMilliseconds(),3)).replace(/(:00)?\.000$/,"");case"date":return sprintf("%s-%s-%s",e.getUTCFullYear(),pad(e.getUTCMonth()+1),pad(e.getUTCDate()));case"month":return sprintf("%s-%s",e.getUTCFullYear(),pad(e.getUTCMonth()+1));case"week":var n=get_week_of_year(e);return sprintf.call(null,"%s-W%s",n[0],pad(n[1]));case"time":return sprintf("%s:%s:%s.%s",pad(e.getUTCHours()),pad(e.getUTCMinutes()),pad(e.getUTCSeconds()),pad(e.getUTCMilliseconds(),3)).replace(/(:00)?\.000$/,"")}return null}function get_date_from_week(e,t){var n=new Date(Date.UTC(t,0,1+7*(e-1)));return n.getUTCDay()<=4?n.setUTCDate(n.getUTCDate()-n.getUTCDay()+1):n.setUTCDate(n.getUTCDate()+8-n.getUTCDay()),n}function string_to_date(e,t){var n,r=new Date(0);switch(t){case"datetime":if(!/^([0-9]{4,})-([0-9]{2})-([0-9]{2})T([01][0-9]|2[0-3]):([0-5][0-9])(?::([0-5][0-9])(?:\.([0-9]{1,3}))?)?$/.test(e))return null;for(n=RegExp.$7||"000";n.length<3;)n+="0";return r.setUTCFullYear(Number(RegExp.$1)),r.setUTCMonth(Number(RegExp.$2)-1,Number(RegExp.$3)),r.setUTCHours(Number(RegExp.$4),Number(RegExp.$5),Number(RegExp.$6||0),Number(n)),r;case"date":return/^([0-9]{4,})-([0-9]{2})-([0-9]{2})$/.test(e)?(r.setUTCFullYear(Number(RegExp.$1)),r.setUTCMonth(Number(RegExp.$2)-1,Number(RegExp.$3)),r):null;case"month":return/^([0-9]{4,})-([0-9]{2})$/.test(e)?(r.setUTCFullYear(Number(RegExp.$1)),r.setUTCMonth(Number(RegExp.$2)-1,1),r):null;case"week":return/^([0-9]{4,})-W(0[1-9]|[1234][0-9]|5[0-3])$/.test(e)?get_date_from_week(Number(RegExp.$2),Number(RegExp.$1)):null;case"time":if(!/^([01][0-9]|2[0-3]):([0-5][0-9])(?::([0-5][0-9])(?:\.([0-9]{1,3}))?)?$/.test(e))return null;for(n=RegExp.$4||"000";n.length<3;)n+="0";return r.setUTCHours(Number(RegExp.$1),Number(RegExp.$2),Number(RegExp.$3||0),Number(n)),r}return null}function string_to_number(e,t){var n=string_to_date(e,t);return null!==n?+n:Number(e)}function get_type(e){if(e instanceof window.HTMLTextAreaElement)return"textarea";if(e instanceof window.HTMLSelectElement)return e.hasAttribute("multiple")?"select-multiple":"select-one";if(e instanceof window.HTMLButtonElement)return(e.getAttribute("type")||"submit").toLowerCase();if(e instanceof window.HTMLInputElement){var t=(e.getAttribute("type")||"").toLowerCase();return t&&inputs.indexOf(t)>-1?t:e.type||"text"}return""}function set_language(e){language=e}function add_translation(e,t){e in catalog||(catalog[e]={});for(var n in t)t.hasOwnProperty(n)&&(catalog[e][n]=t[n])}function _(e){return language in catalog&&e in catalog[language]?catalog[language][e]:e in catalog.en?catalog.en[e]:e}function get_next_valid(e){var t=arguments.length<=1||void 0===arguments[1]?1:arguments[1],n=get_type(e),r=e.getAttribute("min"),a=default_min[n]||NaN;if(r){var i=string_to_number(r,n);isNaN(i)||(a=i)}var s=e.getAttribute("max"),o=default_max[n]||NaN;if(s){var l=string_to_number(s,n);isNaN(l)||(o=l)}var u=e.getAttribute("step"),d=default_step[n]||1;if(u&&"any"===u.toLowerCase())return[_("any value"),_("any value")];if(u){var c=string_to_number(u,n);isNaN(c)||(d=c)}var m=string_to_number(e.getAttribute("value"),n),f=string_to_number(e.value||e.getAttribute("value"),n);if(isNaN(f))return[_("any valid value"),_("any valid value")];var g=isNaN(a)?isNaN(m)?default_step_base[n]||0:m:a,p=step_scale_factor[n]||1,v=g+Math.floor((f-g)/(d*p))*(d*p)*t,h=g+(Math.floor((f-g)/(d*p))+1)*(d*p)*t;return a>v?v=null:v>o&&(v=o),h>o?h=null:a>h&&(h=a),dates.indexOf(n)>-1&&(v=date_to_string(new Date(v),n),h=date_to_string(new Date(h),n)),[v,h]}function valueAsDate(e){var t=arguments.length<=1||void 0===arguments[1]?void 0:arguments[1],n=get_type(e);if(dates.indexOf(n)>-1){if(void 0!==t){if(null===t)e.value="";else{if(!(t instanceof Date))throw new window.DOMException("valueAsDate setter encountered invalid value","TypeError");isNaN(t.getTime())?e.value="":e.value=date_to_string(t,n)}return}var r=string_to_date(e.value,n);return r instanceof Date?r:null}if(void 0!==t)throw new window.DOMException("valueAsDate setter cannot set date on this element","InvalidStateError");return null}function valueAsNumber(e){var t=arguments.length<=1||void 0===arguments[1]?void 0:arguments[1],n=get_type(e);if(numbers.indexOf(n)>-1){if("range"===n&&e.hasAttribute("multiple"))return NaN;if(void 0!==t){if(isNaN(t))e.value="";else{if("number"!=typeof t||!window.isFinite(t))throw new window.DOMException("valueAsNumber setter encountered invalid value","TypeError");try{valueAsDate(e,new Date(t))}catch(r){if(!(r instanceof window.DOMException))throw r;e.value=t.toString()}}return}return string_to_number(e.value,n)}if(void 0!==t)throw new window.DOMException("valueAsNumber setter cannot set number on this element","InvalidStateError");return NaN}function stepDown(e){var t=arguments.length<=1||void 0===arguments[1]?1:arguments[1];if(-1===numbers.indexOf(get_type(e)))throw new window.DOMException("stepDown encountered invalid type","InvalidStateError");if("any"===(e.getAttribute("step")||"").toLowerCase())throw new window.DOMException('stepDown encountered step "any"',"InvalidStateError");var n=get_next_valid(e,t),r=n.prev;n.next;null!==r&&valueAsNumber(e,r)}function stepUp(e){var t=arguments.length<=1||void 0===arguments[1]?1:arguments[1];if(-1===numbers.indexOf(get_type(e)))throw new window.DOMException("stepUp encountered invalid type","InvalidStateError");if("any"===(e.getAttribute("step")||"").toLowerCase())throw new window.DOMException('stepUp encountered step "any"',"InvalidStateError");var n=get_next_valid(e,t),r=(n.prev,n.next);null!==r&&valueAsNumber(e,r)}function validationMessage(e){var t=message_store.get(e);return t?t.toString():""}function willValidate(e){return is_validation_candidate(e)}function install_properties(e){for(var t=["accept","max","min","pattern","placeholder","step"],n=0;n<t.length;n++){var r=t[n];install_property(e,r,{get:gA(r),set:sA(r)})}for(var a=["multiple","required","readOnly"],i=0;i<a.length;i++){var s=a[i];install_property(e,s,{get:gAb(s.toLowerCase()),set:sAb(s.toLowerCase())})}for(var o=["minLength","maxLength"],l=0;l<o.length;l++){var u=o[l];install_property(e,u,{get:gAn(u.toLowerCase()),set:sAn(u.toLowerCase())})}}function uninstall_properties(e){for(var t=["accept","max","min","pattern","placeholder","step","multiple","required","readOnly","minLength","maxLength"],n=0;n<t.length;n++){var r=t[n];uninstall_property(e,r)}}function polyfill(e){if(e instanceof window.HTMLButtonElement||e instanceof window.HTMLInputElement||e instanceof window.HTMLSelectElement||e instanceof window.HTMLTextAreaElement||e instanceof window.HTMLFieldSetElement){for(var t in polyfills)install_property(e,t,polyfills[t]);install_properties(e)}else e instanceof window.HTMLFormElement&&(install_property(e,"checkValidity",polyfills.checkValidity),install_property(e,"reportValidity",polyfills.reportValidity))}function polyunfill(e){e instanceof window.HTMLButtonElement||e instanceof window.HTMLInputElement||e instanceof window.HTMLSelectElement||e instanceof window.HTMLTextAreaElement||e instanceof window.HTMLFieldSetElement?(uninstall_property(e,"checkValidity"),uninstall_property(e,"reportValidity"),uninstall_property(e,"setCustomValidity"),uninstall_property(e,"stepDown"),uninstall_property(e,"stepUp"),uninstall_property(e,"validationMessage"),uninstall_property(e,"validity"),uninstall_property(e,"valueAsDate"),uninstall_property(e,"valueAsNumber"),uninstall_property(e,"willValidate"),uninstall_properties(e)):e instanceof window.HTMLFormElement&&(uninstall_property(e,"checkValidity"),uninstall_property(e,"reportValidity"))}function Wrapper(e,t){this.form=e,this.settings=t,this.revalidator=this.revalidate.bind(this),instances.set(e,this),catch_submit(e,"never"===t.revalidate),e===window||e instanceof window.HTMLDocument?(this.install([window.HTMLButtonElement.prototype,window.HTMLInputElement.prototype,window.HTMLSelectElement.prototype,window.HTMLTextAreaElement.prototype,window.HTMLFieldSetElement.prototype]),polyfill(window.HTMLFormElement)):(e instanceof window.HTMLFormElement||e instanceof window.HTMLFieldSetElement)&&(this.install(e.elements),e instanceof window.HTMLFormElement&&polyfill(e)),"oninput"!==t.revalidate&&"hybrid"!==t.revalidate||(e.addEventListener("keyup",this.revalidator),e.addEventListener("change",this.revalidator)),"onblur"!==t.revalidate&&"hybrid"!==t.revalidate||e.addEventListener("blur",this.revalidator,!0)}function get_wrapper(e){var t;for(e.form&&(t=instances.get(e.form));!t&&e;)t=instances.get(e),e=e.parentNode;return t||(t=instances.get(window)),t}function is_validation_candidate(e){if(e instanceof window.HTMLSelectElement||e instanceof window.HTMLTextAreaElement||e instanceof window.HTMLButtonElement||e instanceof window.HTMLInputElement){var t=get_type(e);if((!t||non_inputs.indexOf(t)>-1||validation_candidates.indexOf(t)>-1)&&!e.hasAttribute("disabled")&&!e.hasAttribute("readonly")){var n=get_wrapper(e);if(n&&n.settings.novalidate_on_elements||!e.hasAttribute("novalidate")||!e.noValidate){for(var r=e.parentNode;r&&1===r.nodeType;){if(r instanceof window.HTMLFieldSetElement&&r.hasAttribute("disabled"))return!1;if("DATALIST"===r.nodeName.toUpperCase())return!1;if(r===e.form)break;r=r.parentNode}return!0}}}return!1}function unicode_string_length(e){return e.match(/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g).length}function test_bad_input(e){var t=get_type(e);if(!is_validation_candidate(e)||-1===input_checked.indexOf(t))return!0;if(!e.value)return"_original_validity"in e&&!e._original_validity.__hyperform?!e._original_validity.badInput:!0;var n=!0;switch(t){case"color":n=/^#[a-f0-9]{6}$/.test(e.value);break;case"number":case"range":n=!isNaN(Number(e.value));break;case"datetime":case"date":case"month":case"week":case"time":n=null!==string_to_date(e.value,t);break;case"datetime-local":n=/^([0-9]{4,})-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9])(?::([0-5][0-9])(?:\.([0-9]{1,3}))?)?$/.test(e.value);break;case"tel":break;case"email":}return n}function test_max(e){var t=get_type(e);if(!is_validation_candidate(e)||!e.value||!e.hasAttribute("max"))return!0;var n=void 0,r=void 0;return dates.indexOf(t)>-1?(n=1*string_to_date(e.value,t),r=1*(string_to_date(e.getAttribute("max"),t)||NaN)):(n=Number(e.value),r=Number(e.getAttribute("max"))),isNaN(r)||r>=n}function test_maxlength(e){if(!(is_validation_candidate(e)&&e.value&&-1!==text_types.indexOf(get_type(e))&&e.hasAttribute("maxlength")&&e.getAttribute("maxlength")))return!0;var t=parseInt(e.getAttribute("maxlength"),10);return isNaN(t)||0>t?!0:unicode_string_length(e.value)<=t}function test_min(e){var t=get_type(e);if(!is_validation_candidate(e)||!e.value||!e.hasAttribute("min"))return!0;var n=void 0,r=void 0;return dates.indexOf(t)>-1?(n=1*string_to_date(e.value,t),r=1*(string_to_date(e.getAttribute("min"),t)||NaN)):(n=Number(e.value),r=Number(e.getAttribute("min"))),isNaN(r)||n>=r}function test_minlength(e){if(!(is_validation_candidate(e)&&e.value&&-1!==text_types.indexOf(get_type(e))&&e.hasAttribute("minlength")&&e.getAttribute("minlength")))return!0;var t=parseInt(e.getAttribute("minlength"),10);return isNaN(t)||0>t?!0:unicode_string_length(e.value)>=t}function test_pattern(e){return!is_validation_candidate(e)||!e.value||!e.hasAttribute("pattern")||new RegExp("^(?:"+e.getAttribute("pattern")+")$").test(e.value)}function test_required(e){if(!is_validation_candidate(e)||!e.hasAttribute("required"))return!0;switch(e.type){case"checkbox":return e.checked;case"radio":return!!(e.checked||e.form&&Array.prototype.filter.call(document.getElementsByName(e.name),function(t){return t.name===e.name&&t.form===e.form&&t.checked}).length>0);default:return!!e.value}}function test_step(e){var t=get_type(e);if(!is_validation_candidate(e)||!e.value||-1===numbers.indexOf(t)||"any"===(e.getAttribute("step")||"").toLowerCase())return!0;var n=e.getAttribute("step");if(n=n?string_to_number(n,t):default_step[t]||1,0>=n||isNaN(n))return!0;var r=step_scale_factor[t]||1,a=string_to_number(e.value,t),i=string_to_number(e.getAttribute("min")||e.getAttribute("value")||"",t);isNaN(i)&&(i=default_step_base[t]||0),"month"===t&&(i=12*new Date(i).getUTCFullYear()+new Date(i).getUTCMonth(),a=12*new Date(a).getUTCFullYear()+new Date(a).getUTCMonth());var s=Math.abs(i-a)%(n*r);return 1e-8>s||s>n*r-1e-8}function trim(e){return e.replace(ws_on_start_or_end,"")}function comma_split(e){return e.split(",").map(function(e){return trim(e)}).filter(function(e){return e})}function test_type(e){var t=get_type(e);if(!is_validation_candidate(e)||"file"!==t&&!e.value||"file"!==t&&-1===type_checked.indexOf(t))return!0;var n=!0;switch(t){case"url":url_canary||(url_canary=document.createElement("a"));var r=trim(e.value);url_canary.href=r,n=url_canary.href===r||url_canary.href===r+"/";break;case"email":n=e.hasAttribute("multiple")?comma_split(e.value).every(function(e){return email_pattern.test(e)}):email_pattern.test(trim(e.value));break;case"file":if("files"in e&&e.files.length&&e.hasAttribute("accept")){var a=comma_split(e.getAttribute("accept")).map(function(e){return/^(audio|video|image)\/\*$/.test(e)&&(e=new RegExp("^"+RegExp.$1+"/.+$")),e});if(!a.length)break;e:for(var i=0;i<e.files.length;i++){var s=!1;t:for(var o=0;o<a.length;o++){var l=e.files[i],u=a[o],d=l.type;if("string"==typeof u&&"."===u.substr(0,1)){if(-1===l.name.search("."))continue t;d=l.name.substr(l.name.lastIndexOf("."))}if(0===d.search(u)){s=!0;break t}}if(!s){n=!1;break e}}}}return n}function check$1(e,t){return function(n){var r=!e(n);return r&&t(n),r}}function set_msg(e,t,n){message_store.set(e,custom_messages.get(e,t,n))}function customError(e){var t=custom_validator_registry.get(e),n=t.length,r=!0;if(n)for(var a=0;n>a;a++){var i=t[a](e);if(void 0!==i&&!i){r=!1;break}}if(r){var s=message_store.get(e);r=!(s.toString()&&"is_custom"in s)}return!r}function checkValidity(e){if(e instanceof window.HTMLFormElement)return Array.prototype.map.call(e.elements,checkValidity).every(function(e){return e});var t=ValidityState(e).valid;if(t){var n=get_wrapper(e);n&&n.settings.valid_event&&trigger_event(e,"valid")}else trigger_event(e,"invalid",{cancelable:!0});return t}function hyperform(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=t.strict,r=void 0===n?!1:n,a=t.revalidate,i=t.valid_event,s=t.extend_fieldset,o=t.novalidate_on_elements,l=t.classes;void 0===a&&(a=r?"onsubmit":"hybrid"),void 0===i&&(i=!r),void 0===s&&(s=!r),void 0===o&&(o=!r),l||(l={});var u={strict:r,revalidate:a,valid_event:i,extend_fieldset:s,classes:l};return e instanceof window.NodeList||e instanceof window.HTMLCollection||e instanceof Array?Array.prototype.map.call(e,function(e){return hyperform(e,u)}):new Wrapper(e,u)}var dates=["datetime","date","month","week","time"],plain_numbers=["number","range"],numbers=dates.concat(plain_numbers,"datetime-local"),type_checked=["email","url"],input_checked=["email","date","month","week","time","datetime","datetime-local","number","range","color"],text_types=["text","search","tel","password"].concat(type_checked),validation_candidates=["checkbox","color","file","image","radio","submit"].concat(numbers,text_types),inputs=["button","hidden","reset"].concat(validation_candidates),non_inputs=["select-one","select-multiple","textarea"],store=new WeakMap,message_store={set:function(e,t){var n=arguments.length<=2||void 0===arguments[2]?!1:arguments[2];if(e instanceof window.HTMLFieldSetElement){var r=get_wrapper(e);if(r&&!r.settings.extend_fieldset)return message_store}return"string"==typeof t&&(t=new String(t)),n&&(t.is_custom=!0),mark(t),store.set(e,t),"_original_setCustomValidity"in e&&e._original_setCustomValidity(t.toString()),message_store},get:function(e){var t=store.get(e);return void 0===t&&"_original_validationMessage"in e&&(t=new String(e._original_validationMessage)),t?t:new String("")},"delete":function(e){return"_original_setCustomValidity"in e&&e._original_setCustomValidity(""),store["delete"](e)}},uid=0,warnings_cache=new WeakMap,DefaultRenderer={attach_warning:function(e,t){t.parentNode.insertBefore(e,t.nextSibling)},detach_warning:function(e,t){e.parentNode.removeChild(e)},show_warning:function(e){var t=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],n=message_store.get(e).toString(),r=warnings_cache.get(e);if(n){if(!r){var a=get_wrapper(e);r=document.createElement("div"),r.className=a&&a.settings.classes.warning||"hf-warning",r.id=generate_id(),r.setAttribute("aria-live","polite"),warnings_cache.set(e,r)}e.setAttribute("aria-errormessage",r.id),r.textContent=n,Renderer.attach_warning(r,e)}else r&&r.parentNode&&(e.removeAttribute("aria-errormessage"),Renderer.detach_warning(r,e));!t&&"radio"===e.type&&e.form&&Array.prototype.filter.call(document.getElementsByName(e.name),function(t){return t.name===e.name&&t.form===e.form}).map(function(e){return Renderer.show_warning(e,"sub_radio")})}},Renderer={attach_warning:DefaultRenderer.attach_warning,detach_warning:DefaultRenderer.detach_warning,show_warning:DefaultRenderer.show_warning,set:function(e,t){t||(t=DefaultRenderer[e]),Renderer[e]=t}},catalog={en:{TextTooLong:"Please shorten this text to %l characters or less (you are currently using %l characters).",ValueMissing:"Please fill out this field.",CheckboxMissing:"Please check this box if you want to proceed.",RadioMissing:"Please select one of these options.",FileMissing:"Please select a file.",SelectMissing:"Please select an item in the list.",InvalidEmail:"Please enter an email address.",InvalidURL:"Please enter a URL.",PatternMismatch:"Please match the requested format.",PatternMismatchWithTitle:"Please match the requested format: %l.",NumberRangeOverflow:"Please select a value that is no more than %l.",DateRangeOverflow:"Please select a value that is no later than %l.",TimeRangeOverflow:"Please select a value that is no later than %l.",NumberRangeUnderflow:"Please select a value that is no less than %l.",DateRangeUnderflow:"Please select a value that is no earlier than %l.",TimeRangeUnderflow:"Please select a value that is no earlier than %l.",StepMismatch:"Please select a valid value. The two nearest valid values are %l and %l.",StepMismatchOneValue:"Please select a valid value. The nearest valid value is %l.",BadInputNumber:"Please enter a number."}},language="en",default_step={"datetime-local":60,datetime:60,time:60},step_scale_factor={"datetime-local":1e3,datetime:1e3,date:864e5,week:6048e5,time:1e3},default_step_base={week:-2592e5},default_min={range:0},default_max={range:100},gA=function(e){return function(){return this.getAttribute(e)}},sA=function(e){return function(t){this.setAttribute(e,t)}},gAb=function(e){return function(){return this.hasAttribute(e)}},sAb=function(e){return function(t){t?this.setAttribute(e,e):this.removeAttribute(e)}},gAn=function(e){return function(){return Math.max(0,Number(this.getAttribute(e)))}},sAn=function(e){return function(t){/^[0-9]+$/.test(t)&&this.setAttribute(e,t)}},polyfills={checkValidity:{value:mark(function(){return checkValidity(this)})},reportValidity:{value:mark(function(){return reportValidity(this)})},setCustomValidity:{value:mark(function(e){return setCustomValidity(this,e)})},stepDown:{value:mark(function(){var e=arguments.length<=0||void 0===arguments[0]?1:arguments[0];return stepDown(this,e)})},stepUp:{value:mark(function(){var e=arguments.length<=0||void 0===arguments[0]?1:arguments[0];return stepUp(this,e)})},validationMessage:{get:mark(function(){return validationMessage(this)})},validity:{get:mark(function(){return ValidityState(this)})},valueAsDate:{get:mark(function(){return valueAsDate(this)}),set:mark(function(e){valueAsDate(this,e)})},valueAsNumber:{get:mark(function(){return valueAsNumber(this)}),set:mark(function(e){valueAsNumber(this,e)})},willValidate:{get:mark(function(){return willValidate(this)})}},instances=new WeakMap;Wrapper.prototype={destroy:function(){uncatch_submit(this.form),instances["delete"](this.form),this.form.removeEventListener("keyup",this.revalidator),this.form.removeEventListener("change",this.revalidator),this.form.removeEventListener("blur",this.revalidator,!0),this.form===window||this.form instanceof window.HTMLDocument?(this.uninstall([window.HTMLButtonElement.prototype,window.HTMLInputElement.prototype,window.HTMLSelectElement.prototype,window.HTMLTextAreaElement.prototype,window.HTMLFieldSetElement.prototype]),polyunfill(window.HTMLFormElement)):(this.form instanceof window.HTMLFormElement||this.form instanceof window.HTMLFieldSetElement)&&(this.uninstall(this.form.elements),this.form instanceof window.HTMLFormElement&&polyunfill(this.form))},revalidate:function(e){(e.target instanceof window.HTMLButtonElement||e.target instanceof window.HTMLTextAreaElement||e.target instanceof window.HTMLSelectElement||e.target instanceof window.HTMLInputElement)&&("hybrid"===this.settings.revalidate?"blur"===e.type&&e.target.value!==e.target.defaultValue||e.target.validity.valid?reportValidity(e.target):"keyup"!==e.type&&"change"!==e.type||e.target.validity.valid&&reportValidity(e.target):reportValidity(e.target))},install:function(e){e instanceof window.Element&&(e=[e]);for(var t=e.length,n=0;t>n;n++)polyfill(e[n])},uninstall:function(e){e instanceof window.Element&&(e=[e]);for(var t=e.length,n=0;t>n;n++)polyunfill(e[n])}};var store$1=new WeakMap,custom_messages={set:function(e,t,n){var r=store$1.get(e)||{};return r[t]=n,store$1.set(e,r),custom_messages},get:function(e,t){var n=arguments.length<=2||void 0===arguments[2]?void 0:arguments[2],r=store$1.get(e);if(void 0===r||!(t in r)){var a="data-"+t.replace(/[A-Z]/g,"-$&").toLowerCase();return e.hasAttribute(a)?e.getAttribute(a):n}return r[t]},"delete":function(e){var t=arguments.length<=1||void 0===arguments[1]?null:arguments[1];if(!t)return store$1["delete"](e);var n=store$1.get(e)||{};return t in n?(delete n[t],store$1.set(e,n),!0):!1}},internal_registry=new WeakMap,custom_validator_registry={set:function(e,t){var n=internal_registry.get(e)||[];return n.push(t),internal_registry.set(e,n),custom_validator_registry},get:function(e){return internal_registry.get(e)||[]},"delete":function(e){return internal_registry["delete"](e)}},ws_on_start_or_end=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,url_canary,email_pattern=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,badInput=check$1(test_bad_input,function(e){return set_msg(e,"badInput",_("Please match the requested type."))}),patternMismatch=check$1(test_pattern,function(e){set_msg(e,"patternMismatch",e.title?sprintf(_("PatternMismatchWithTitle"),e.title):_("PatternMismatch"))}),rangeOverflow=check$1(test_max,function(e){var t=get_type(e),n=void 0;switch(t){case"date":case"datetime":case"datetime-local":n=sprintf(_("DateRangeOverflow"),string_to_date(e.getAttribute("max"),t));break;case"time":n=sprintf(_("TimeRangeOverflow"),string_to_date(e.getAttribute("max"),t));break;default:n=sprintf(_("NumberRangeOverflow"),string_to_number(e.getAttribute("max"),t))}set_msg(e,"rangeOverflow",n)}),rangeUnderflow=check$1(test_min,function(e){var t=get_type(e),n=void 0;switch(t){case"date":case"datetime":case"datetime-local":n=sprintf(_("DateRangeUnderflow"),string_to_date(e.getAttribute("min"),t));break;case"time":n=sprintf(_("TimeRangeUnderflow"),string_to_date(e.getAttribute("min"),t));break;default:n=sprintf(_("NumberRangeUnderflow"),string_to_number(e.getAttribute("min"),t))}set_msg(e,"rangeUnderflow",n)}),stepMismatch=check$1(test_step,function(e){var t=get_next_valid(e),n=t[0],r=t[1],a=!1,i=void 0;null===n?a=r:null===r&&(a=n),i=a!==!1?sprintf(_("StepMismatchOneValue"),a):sprintf(_("StepMismatch"),n,r),set_msg(e,"stepMismatch",i)}),tooLong=check$1(test_maxlength,function(e){set_msg(e,"tooLong",sprintf(_("TextTooLong"),e.getAttribute("maxlength"),unicode_string_length(e.value)))}),tooShort=check$1(test_minlength,function(e){set_msg(e,"tooShort",sprintf(_("Please lengthen this text to %l characters or more (you are currently using %l characters)."),e.getAttribute("maxlength"),unicode_string_length(e.value)))}),typeMismatch=check$1(test_type,function(e){var t=_("Please use the appropriate format."),n=get_type(e);"email"===n?t=_(e.hasAttribute("multiple")?"Please enter a comma separated list of email addresses.":"InvalidEmail"):"url"===n?t=_("InvalidURL"):"file"===n&&(t=_("Please select a file of the correct type.")),set_msg(e,"typeMismatch",t)}),valueMissing=check$1(test_required,function(e){var t=_("ValueMissing"),n=get_type(e);"checkbox"===n?t=_("CheckboxMissing"):"radio"===n?t=_("RadioMissing"):"file"===n?t=_(e.hasAttribute("multiple")?"Please select one or more files.":"FileMissing"):e instanceof window.HTMLSelectElement&&(t=_("SelectMissing")),set_msg(e,"valueMissing",t)}),validity_state_checkers={badInput:badInput,customError:customError,patternMismatch:patternMismatch,rangeOverflow:rangeOverflow,rangeUnderflow:rangeUnderflow,stepMismatch:stepMismatch,tooLong:tooLong,tooShort:tooShort,typeMismatch:typeMismatch,valueMissing:valueMissing},ValidityState=function e(t){if(!(t instanceof window.HTMLElement))throw new Error("cannot create a ValidityState for a non-element");var n=e.cache.get(t);return n?n:this instanceof e?(this.element=t,void e.cache.set(t,this)):new e(t)},ValidityStatePrototype={};ValidityState.prototype=ValidityStatePrototype,ValidityState.cache=new WeakMap;for(var prop in validity_state_checkers)Object.defineProperty(ValidityStatePrototype,prop,{configurable:!0,enumerable:!0,get:function(e){return function(){return e(this.element)}}(validity_state_checkers[prop]),set:void 0});Object.defineProperty(ValidityStatePrototype,"valid",{configurable:!0,enumerable:!0,get:function(){var e=get_wrapper(this.element),t=e&&e.settings.classes.valid||"hf-valid",n=e&&e.settings.classes.invalid||"hf-invalid",r=e&&e.settings.classes.validated||"hf-validated";if(this.element.classList.add(r),is_validation_candidate(this.element))for(var a in validity_state_checkers)if(validity_state_checkers[a](this.element))return this.element.classList.add(n),this.element.classList.remove(t),this.element.setAttribute("aria-invalid","true"),!1;return message_store["delete"](this.element),this.element.classList.remove(n),this.element.classList.add(t),this.element.setAttribute("aria-invalid","false"),!0},set:void 0}),mark(ValidityStatePrototype);var version="0.7.5";hyperform.version=version,hyperform.checkValidity=checkValidity,hyperform.reportValidity=reportValidity,hyperform.setCustomValidity=setCustomValidity,hyperform.stepDown=stepDown,hyperform.stepUp=stepUp,hyperform.validationMessage=validationMessage,hyperform.ValidityState=ValidityState,hyperform.valueAsDate=valueAsDate,hyperform.valueAsNumber=valueAsNumber,hyperform.willValidate=willValidate,hyperform.set_language=function(e){return set_language(e),hyperform},hyperform.add_translation=function(e,t){return add_translation(e,t),hyperform},hyperform.set_renderer=function(e,t){return Renderer.set(e,t),hyperform},hyperform.register=function(e,t){return custom_validator_registry.set(e,t),hyperform},hyperform.set_message=function(e,t,n){return custom_messages.set(e,t,n),hyperform},module.exports=hyperform;

@@ -1,1 +0,2 @@

var hyperform=function(){"use strict";function e(e){return["object","function"].indexOf(typeof e)>-1&&(delete e.hyperform,Object.defineProperty(e,"hyperform",{value:!0})),e}function t(e,t){return function(n){var a=Object.getOwnPropertyDescriptor(n,e);a&&!(a.get&&a.get.hyperform||a.value&&a.value.hyperform)&&Object.defineProperty(n,"_original_"+e,a),delete n[e],Object.defineProperty(n,e,t)}}function n(e,t){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],a=n.bubbles,r=void 0===a?!0:a,i=n.cancelable,l=void 0===i?!1:i;if(!(t instanceof window.Event)){var o=document.createEvent("Event");o.initEvent(t,r,l),t=o}return e.dispatchEvent(t),t}function a(e,t){var n=[],a=!0,r=!1,i=void 0;try{for(var l,o=e[Symbol.iterator]();!(a=(l=o.next()).done)&&(n.push(l.value),!t||n.length!==t);a=!0);}catch(s){r=!0,i=s}finally{try{!a&&o["return"]&&o["return"]()}finally{if(r)throw i}}return n}function r(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return a(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}function i(e){for(var t=arguments.length,n=Array(t>1?t-1:0),a=1;t>a;a++)n[a-1]=arguments[a];var r=n.length,i=0;return e.replace(/%([0-9]+\$)?([sl])/g,function(e,t,a){var l=i;t&&(l=Number(t.replace(/\$$/,""))-1),i+=1;var o="";return r>l&&(o=n[l]),(o instanceof Date||"number"==typeof o||o instanceof Number)&&(o="l"===a?(o.toLocaleString||o.toString).call(o):o.toString()),o})}function l(e){e=new Date(+e),e.setUTCHours(0,0,0),e.setUTCDate(e.getUTCDate()+4-(e.getUTCDay()||7));var t=new Date(e.getUTCFullYear(),0,1),n=Math.ceil(((e-t)/864e5+1)/7);return[e.getUTCFullYear(),n]}function o(e){for(var t=arguments.length<=1||void 0===arguments[1]?2:arguments[1],n=e+"";n.length<t;)n="0"+n;return n}function s(e,t){if(!(e instanceof Date))return null;switch(t){case"datetime":return s(e,"date")+"T"+s(e,"time");case"datetime-local":return i("%s-%s-%sT%s:%s:%s.%s",e.getFullYear(),o(e.getMonth()+1),o(e.getDate()),o(e.getHours()),o(e.getMinutes()),o(e.getSeconds()),o(e.getMilliseconds(),3)).replace(/(:00)?\.000$/,"");case"date":return i("%s-%s-%s",e.getUTCFullYear(),o(e.getUTCMonth()+1),o(e.getUTCDate()));case"month":return i("%s-%s",e.getUTCFullYear(),o(e.getUTCMonth()+1));case"week":var n=l(e);return i.call(null,"%s-W%s",n[0],o(n[1]));case"time":return i("%s:%s:%s.%s",o(e.getUTCHours()),o(e.getUTCMinutes()),o(e.getUTCSeconds()),o(e.getUTCMilliseconds(),3)).replace(/(:00)?\.000$/,"")}return null}function u(e,t){var n=new Date(Date.UTC(t,0,1+7*(e-1)));return n.getUTCDay()<=4?n.setUTCDate(n.getUTCDate()-n.getUTCDay()+1):n.setUTCDate(n.getUTCDate()+8-n.getUTCDay()),n}function c(e,t){var n,a=new Date(0);switch(t){case"datetime":if(!/^([0-9]{4,})-([0-9]{2})-([0-9]{2})T([01][0-9]|2[0-3]):([0-5][0-9])(?::([0-5][0-9])(?:\.([0-9]{1,3}))?)?$/.test(e))return null;for(n=RegExp.$7||"000";n.length<3;)n+="0";return a.setUTCFullYear(Number(RegExp.$1)),a.setUTCMonth(Number(RegExp.$2)-1,Number(RegExp.$3)),a.setUTCHours(Number(RegExp.$4),Number(RegExp.$5),Number(RegExp.$6||0),Number(n)),a;case"date":return/^([0-9]{4,})-([0-9]{2})-([0-9]{2})$/.test(e)?(a.setUTCFullYear(Number(RegExp.$1)),a.setUTCMonth(Number(RegExp.$2)-1,Number(RegExp.$3)),a):null;case"month":return/^([0-9]{4,})-([0-9]{2})$/.test(e)?(a.setUTCFullYear(Number(RegExp.$1)),a.setUTCMonth(Number(RegExp.$2)-1,1),a):null;case"week":return/^([0-9]{4,})-W(0[1-9]|[1234][0-9]|5[0-3])$/.test(e)?u(Number(RegExp.$2),Number(RegExp.$1)):null;case"time":if(!/^([01][0-9]|2[0-3]):([0-5][0-9])(?::([0-5][0-9])(?:\.([0-9]{1,3}))?)?$/.test(e))return null;for(n=RegExp.$4||"000";n.length<3;)n+="0";return a.setUTCHours(Number(RegExp.$1),Number(RegExp.$2),Number(RegExp.$3||0),Number(n)),a}return null}function f(e,t){var n=c(e,t);return null!==n?+n:Number(e)}function d(e){if(e instanceof window.HTMLTextAreaElement)return"textarea";if(e instanceof window.HTMLSelectElement)return e.hasAttribute("multiple")?"select-multiple":"select-one";if(e instanceof window.HTMLButtonElement)return(e.getAttribute("type")||"submit").toLowerCase();if(e instanceof window.HTMLInputElement){var t=(e.getAttribute("type")||"").toLowerCase();return t&&Q.indexOf(t)>-1?t:e.type||"text"}return""}function v(e){te=e}function m(e,t){e in ee||(ee[e]={});var n=!0,a=!1,r=void 0;try{for(var i,l=Object.keys(t)[Symbol.iterator]();!(n=(i=l.next()).done);n=!0){var o=i.value;ee[e][o]=t[o]}}catch(s){a=!0,r=s}finally{try{!n&&l["return"]&&l["return"]()}finally{if(a)throw r}}}function g(e){return te in ee&&e in ee[te]?ee[te][e]:e in ee.en?ee.en[e]:e}function h(e){var t=arguments.length<=1||void 0===arguments[1]?1:arguments[1],n=d(e),a=e.getAttribute("min"),r=ie[n]||NaN;if(a){var i=f(a,n);isNaN(i)||(r=i)}var l=e.getAttribute("max"),o=le[n]||NaN;if(l){var u=f(l,n);isNaN(u)||(o=u)}var c=e.getAttribute("step"),v=ne[n]||1;if(c&&"any"===c.toLowerCase())return[g("any value"),g("any value")];if(c){var m=f(c,n);isNaN(m)||(v=m)}var h=f(e.getAttribute("value"),n),b=f(e.value||e.getAttribute("value"),n);if(isNaN(b))return[g("any valid value"),g("any valid value")];var w=isNaN(r)?isNaN(h)?re[n]||0:h:r,p=ae[n]||1,y=w+Math.floor((b-w)/(v*p))*(v*p)*t,N=w+(Math.floor((b-w)/(v*p))+1)*(v*p)*t;return r>y?y=null:y>o&&(y=o),N>o?N=null:r>N&&(N=r),W.indexOf(n)>-1&&(y=s(new Date(y),n),N=s(new Date(N),n)),[y,N]}function b(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function w(e,t,n){return t&&b(e.prototype,t),n&&b(e,n),e}function p(){var e=arguments.length<=0||void 0===arguments[0]?"hf_":arguments[0];return e+ce++ +Math.random().toString(36).substr(2)}function y(e){if(e instanceof window.HTMLFormElement)return Array.prototype.map.call(e.elements,y).every(function(e){return e});var t,a=Ne(e).valid;if(a){var r=L(e);r&&r.settings.valid_event&&(t=n(e,"valid",{cancelable:!0}))}else t=n(e,"invalid",{cancelable:!0});return t&&t.defaultPrevented||de.show_warning(e),a}function N(e){e.preventDefault();var t=n(e.target.form,"validate",{cancelable:!0});if(!t.defaultPrevented){var a,r=!0;if(Array.prototype.map.call(e.target.form.elements,function(e){y(e)||(r=!1,!a&&"focus"in e&&(a=e))}),r){var i=n(e.target.form,"submit",{cancelable:!0});i.defaultPrevented||e.target.form.submit()}else a&&a.focus()}}function T(e){e.addEventListener("click",function(e){e.defaultPrevented||"INPUT"!==e.target.nodeName&&"BUTTON"!==e.target.nodeName||"image"!==e.target.type&&"submit"!==e.target.type||e.target.hasAttribute("formnovalidate")||!e.target.form||e.target.form.hasAttribute("novalidate")||N(e)}),e.addEventListener("keypress",function(e){if(!e.defaultPrevented&&13===e.keyCode&&"INPUT"===e.target.nodeName&&J.indexOf(e.target.type)>-1&&e.target.form&&!e.target.form.hasAttribute("novalidate")){for(var t,n=e.target.form.elements.length,a=0;n>a;a++)if(["image","submit"].indexOf(e.target.form.elements[a].type)>-1){t=e.target.form.elements[a];break}t?(e.preventDefault(),t.click()):N(e)}})}function x(e){ue.set(this,e,!0)}function A(){var e=arguments.length<=0||void 0===arguments[0]?void 0:arguments[0],t=d(this);if(W.indexOf(t)>-1){if(void 0!==e){if(null===e)this.value="";else{if(!(e instanceof Date))throw new window.DOMException("valueAsDate setter encountered invalid value","TypeError");isNaN(e.getTime())?this.value="":this.value=s(e,t)}return}var n=c(this.value,t);return n instanceof Date?n:null}if(void 0!==e)throw new window.DOMException("valueAsDate setter cannot set date on this element","InvalidStateError");return null}function E(){var e=arguments.length<=0||void 0===arguments[0]?void 0:arguments[0],t=d(this);if(Z.indexOf(t)>-1){if("range"===t&&this.hasAttribute("multiple"))return NaN;if(void 0!==e){if(isNaN(e))this.value="";else{if("number"!=typeof e||!window.isFinite(e))throw new window.DOMException("valueAsNumber setter encountered invalid value","TypeError");try{A.call(this,new Date(e))}catch(n){if(!(n instanceof window.DOMException))throw n;this.value=e.toString()}}return}return f(this.value,t)}if(void 0!==e)throw new window.DOMException("valueAsNumber setter cannot set number on this element","InvalidStateError");return NaN}function M(e){var t=arguments.length<=1||void 0===arguments[1]?1:arguments[1];if(-1===Z.indexOf(d(e)))throw new window.DOMException("stepDown encountered invalid type","InvalidStateError");if("any"===(e.getAttribute("step")||"").toLowerCase())throw new window.DOMException('stepDown encountered step "any"',"InvalidStateError");var n=h(e,t),a=n.prev;n.next;null!==a&&E.call(e,a)}function C(e){var t=arguments.length<=1||void 0===arguments[1]?1:arguments[1];if(-1===Z.indexOf(d(e)))throw new window.DOMException("stepUp encountered invalid type","InvalidStateError");if("any"===(e.getAttribute("step")||"").toLowerCase())throw new window.DOMException('stepUp encountered step "any"',"InvalidStateError");var n=h(e,t),a=(n.prev,n.next);null!==a&&E.call(e,a)}function D(){var e=ue.get(this);return e?e.toString():""}function U(){return k(this)}function L(e){var t;for(e.form&&(t=ve.get(e.form));!t&&e;)t=ve.get(e),e=e.parentNode;return t||(t=ve.get(window)),t}function k(e){if(e instanceof window.HTMLSelectElement||e instanceof window.HTMLTextAreaElement||e instanceof window.HTMLButtonElement||e instanceof window.HTMLInputElement){var t=d(e);if((!t||X.indexOf(t)>-1||K.indexOf(t)>-1)&&!e.hasAttribute("disabled")&&!e.hasAttribute("readonly")){var n=L(e);if(n&&n.settings.strict||!e.hasAttribute("novalidate")||!e.noValidate){for(var a=e.parentNode;a&&1===a.nodeType;){if(a instanceof window.HTMLFieldSetElement&&a.hasAttribute("disabled"))return!1;if(a===e.form)break;a=a.parentNode}return!0}}}return!1}function O(e){return[].concat(ge(e)).length}function P(e){var t=d(e);if(!k(e)||!e.value||!e.hasAttribute("max"))return!0;var n=void 0,a=void 0;return W.indexOf(t)>-1?(n=1*c(e.value,t),a=1*(c(e.getAttribute("max"),t)||NaN)):(n=Number(e.value),a=Number(e.getAttribute("max"))),isNaN(a)||a>=n}function S(e){if(!(k(e)&&e.value&&-1!==J.indexOf(d(e))&&e.hasAttribute("maxlength")&&e.getAttribute("maxlength")))return!0;var t=parseInt(e.getAttribute("maxlength"),10);return isNaN(t)||0>t?!0:O(e.value)<=t}function R(e){var t=d(e);if(!k(e)||!e.value||!e.hasAttribute("min"))return!0;var n=void 0,a=void 0;return W.indexOf(t)>-1?(n=1*c(e.value,t),a=1*(c(e.getAttribute("min"),t)||NaN)):(n=Number(e.value),a=Number(e.getAttribute("min"))),isNaN(a)||n>=a}function $(e){if(!(k(e)&&e.value&&-1!==J.indexOf(d(e))&&e.hasAttribute("minlength")&&e.getAttribute("minlength")))return!0;var t=parseInt(e.getAttribute("minlength"),10);return isNaN(t)||0>t?!0:O(e.value)>=t}function _(e){return!k(e)||!e.value||!e.hasAttribute("pattern")||new RegExp("^(?:"+e.getAttribute("pattern")+")$").test(e.value)}function H(e){if(!k(e)||!e.hasAttribute("required"))return!0;switch(e.type){case"checkbox":return e.checked;case"radio":return!!(e.checked||e.form&&Array.prototype.filter.call(document.getElementsByName(e.name),function(t){return t.name===e.name&&t.form===e.form&&t.checked}).length>0);default:return!!e.value}}function F(e){var t=d(e);if(!k(e)||!e.value||-1===Z.indexOf(t)||"any"===(e.getAttribute("step")||"").toLowerCase())return!0;var n=e.getAttribute("step");if(n=n?f(n,t):ne[t]||1,0>=n||isNaN(n))return!0;var a=ae[t]||1,r=f(e.value,t),i=f(e.getAttribute("min")||e.getAttribute("value")||"",t);isNaN(i)&&(i=re[t]||0),"month"===t&&(i=12*new Date(i).getUTCFullYear()+new Date(i).getUTCMonth(),r=12*new Date(r).getUTCFullYear()+new Date(r).getUTCMonth());var l=Math.abs(i-r)%(n*a);return 1e-8>l||l>n*a-1e-8}function I(e){return e.split(",").map(function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}).filter(function(e){return e})}function V(e){var t=d(e);if(!k(e)||"file"!==t&&!e.value||"file"!==t&&-1===q.indexOf(t))return!0;var n=!0;switch(t){case"url":we.href=e.value,n=we.href===e.value||we.href===e.value+"/";break;case"email":n=e.hasAttribute("multiple")?I(e.value).every(function(e){return pe.test(e)}):pe.test(e.value);break;case"file":if("files"in e&&e.files.length&&e.hasAttribute("accept")){var a=I(e.getAttribute("accept")).map(function(e){return/^(audio|video|image)\/\*$/.test(e)&&(e=new RegExp("^"+RegExp.$1+"/.+$")),e});if(!a.length)break;e:for(var r=0;r<e.files.length;r++){var i=!1;t:for(var l=0;l<a.length;l++){var o=e.files[r],s=a[l],u=o.type;if("string"==typeof s&&"."===s.substr(0,1)){if(-1===o.name.search("."))continue t;u=o.name.substr(o.name.lastIndexOf("."))}if(0===u.search(s)){i=!0;break t}}if(!i){n=!1;break e}}}}return n}function j(e){var t=d(e);if(!k(e)||-1===G.indexOf(t))return!0;if(!e.value)return"_original_validity"in e?!e._original_validity.badInput:!0;var n=!0;switch(t){case"color":n=/^#[a-f0-9]{6}$/.test(e.value);break;case"number":case"range":n=!isNaN(Number(e.value));break;case"datetime":case"date":case"month":case"week":case"time":n=null!==c(e.value,t);break;case"datetime-local":n=/^([0-9]{4,})-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9])(?::([0-5][0-9])(?:\.([0-9]{1,3}))?)?$/.test(e.value);break;case"tel":break;case"email":}return n}function Y(e){if(e instanceof window.HTMLFormElement)return Array.prototype.map.call(e.elements,Y).every(function(e){return e});var t=Ne(e).valid;if(t){var a=L(e);a&&a.settings.valid_event&&n(e,"valid")}else n(e,"invalid",{cancelable:!0});return t}function B(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=t.strict,a=void 0===n?!1:n,r=t.revalidate,i=void 0===r?"oninput":r,l=t.valid_event,o=void 0===l?!0:l,s=t.classes,u=void 0===s?{}:s;return e instanceof window.NodeList||e instanceof window.HTMLCollection||e instanceof Array?Array.prototype.map.call(e,function(e){return B(e)}):new me(e,{strict:a,revalidate:i,valid_event:o,classes:u})}var W=["datetime","date","month","week","time"],z=["number","range"],Z=W.concat(z,"datetime-local"),q=["email","url"],G=["email","date","month","week","time","datetime","datetime-local","number","range","color"],J=["text","search","tel","password"].concat(q),K=["checkbox","color","file","image","radio","submit"].concat(Z,J),Q=["button","hidden","reset"].concat(K),X=["select-one","select-multiple","textarea"],ee={en:{TextTooLong:"Please shorten this text to %l characters or less (you are currently using %l characters).",ValueMissing:"Please fill out this field.",CheckboxMissing:"Please check this box if you want to proceed.",RadioMissing:"Please select one of these options.",FileMissing:"Please select a file.",SelectMissing:"Please select an item in the list.",InvalidEmail:"Please enter an email address.",InvalidURL:"Please enter a URL.",PatternMismatch:"Please match the requested format.",PatternMismatchWithTitle:"Please match the requested format: %l.",NumberRangeOverflow:"Please select a value that is no more than %l.",DateRangeOverflow:"Please select a value that is no later than %l.",TimeRangeOverflow:"Please select a value that is no later than %l.",NumberRangeUnderflow:"Please select a value that is no less than %l.",DateRangeUnderflow:"Please select a value that is no earlier than %l.",TimeRangeUnderflow:"Please select a value that is no earlier than %l.",StepMismatch:"Please select a valid value. The two nearest valid values are %l and %l.",StepMismatchOneValue:"Please select a valid value. The nearest valid value is %l.",BadInputNumber:"Please enter a number."}},te="en",ne={"datetime-local":60,datetime:60,time:60},ae={"datetime-local":1e3,datetime:1e3,date:864e5,week:6048e5,time:1e3},re={week:-2592e5},ie={range:0},le={range:100},oe=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},se=new WeakMap,ue={set:function(t,n){var a=arguments.length<=2||void 0===arguments[2]?!1:arguments[2];if(t instanceof window.HTMLFieldSetElement){var r=L(t);if(r&&r.settings.strict)return ue}return"string"==typeof n&&(n=new String(n)),a&&(n.is_custom=!0),e(n),se.set(t,n),"_original_setCustomValidity"in t&&t._original_setCustomValidity(n.toString()),ue},get:function(e){var t=se.get(e);return void 0===t&&"_original_validationMessage"in e&&(t=new String(e._original_validationMessage)),t?t:new String("")},"delete":function(e){return"_original_setCustomValidity"in e&&e._original_setCustomValidity(""),se["delete"](e)}},ce=0,fe=new WeakMap,de={attach_warning:function(e,t){t.parentNode.insertBefore(e,t.nextSibling)},detach_warning:function(e,t){e.parentNode.removeChild(e)},show_warning:function(e){var t=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],n=ue.get(e).toString(),a=fe.get(e);if(n){if(!a){var r=L(e);a=document.createElement("div"),a.className=r&&r.settings.classes.warning||"hf-warning",a.id=p(),fe.set(e,a)}e.setAttribute("aria-errormessage",a.id),a.textContent=n,de.attach_warning(a,e)}else a&&a.parentNode&&(e.removeAttribute("aria-errormessage"),de.detach_warning(a,e));!t&&"radio"===e.type&&e.form&&Array.prototype.filter.call(document.getElementsByName(e.name),function(t){return t.name===e.name&&t.form===e.form}).map(function(e){return de.show_warning(e,"sub_radio")})},set:function(e,t){de[e]=t}};y.install=t("reportValidity",{configurable:!0,enumerable:!0,value:function(){return y(this)},writable:!0}),e(y),x.install=t("setCustomValidity",{configurable:!0,enumerable:!0,value:x,writable:!0}),e(x),A.install=t("valueAsDate",{configurable:!0,enumerable:!0,get:A,set:A}),e(A),E.install=t("valueAsNumber",{configurable:!0,enumerable:!0,get:E,set:E}),e(E),M.install=t("stepDown",{configurable:!0,enumerable:!0,value:function(){var e=arguments.length<=0||void 0===arguments[0]?1:arguments[0];return M(this,e)},writable:!0}),e(M),C.install=t("stepUp",{configurable:!0,enumerable:!0,value:function(){var e=arguments.length<=0||void 0===arguments[0]?1:arguments[0];return C(this,e)},writable:!0}),e(C),D.install=t("validationMessage",{configurable:!0,enumerable:!0,get:D,set:void 0}),e(D),U.install=t("willValidate",{configurable:!0,enumerable:!0,get:U,set:void 0}),e(U);var ve=new WeakMap,me=function(){function e(t,n){oe(this,e),this.form=t,this.settings=n,ve.set(t,this),T(t),t===window||t instanceof window.HTMLDocument?this.install([window.HTMLButtonElement.prototype,window.HTMLInputElement.prototype,window.HTMLSelectElement.prototype,window.HTMLTextAreaElement.prototype,window.HTMLFieldSetElement.prototype]):(t instanceof window.HTMLFormElement||t instanceof window.HTMLFieldSetElement)&&this.install(t.elements),"oninput"===n.revalidate&&(t.addEventListener("keyup",this.revalidate.bind(this)),t.addEventListener("change",this.revalidate.bind(this)))}return w(e,[{key:"revalidate",value:function(e){(e.target instanceof window.HTMLButtonElement||e.target instanceof window.HTMLTextAreaElement||e.target instanceof window.HTMLSelectElement||e.target instanceof window.HTMLInputElement)&&y(e.target)}},{key:"install",value:function(e){e instanceof window.HTMLElement&&(e=[e]);for(var t=e.length,n=0;t>n;n++)Y.install(e[n]),y.install(e[n]),x.install(e[n]),M.install(e[n]),C.install(e[n]),D.install(e[n]),Ne.install(e[n]),A.install(e[n]),E.install(e[n]),U.install(e[n])}}]),e}(),ge=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)},he=new WeakMap,be={set:function(e,t){var n=he.get(e)||[];return n.push(t),he.set(e,n),be},get:function(e){return he.get(e)||[]},"delete":function(e){return he["delete"](e)}},we=document.createElement("a"),pe=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,ye={badInput:function(e){var t=!j(e);return t&&ue.set(e,g("Please match the requested type.")),t},customError:function(e){var t=be.get(e),n=!0;if(t.length){var a=!0,r=!1,i=void 0;try{for(var l,o=t[Symbol.iterator]();!(a=(l=o.next()).done);a=!0){var s=l.value,u=s(e);if(void 0!==u&&!u){n=!1;break}}}catch(c){r=!0,i=c}finally{try{!a&&o["return"]&&o["return"]()}finally{if(r)throw i}}}if(n){var f=ue.get(e);n=!(f.toString()&&"is_custom"in f)}return!n},patternMismatch:function(e){var t=!_(e);return t&&ue.set(e,e.title?i(g("PatternMismatchWithTitle"),e.title):g("PatternMismatch")),t},rangeOverflow:function(e){var t=!P(e),n=d(e);if(t){var a=void 0;switch(n){case"date":case"datetime":case"datetime-local":a=i(g("DateRangeOverflow"),c(e.getAttribute("max"),n));break;case"time":a=i(g("TimeRangeOverflow"),c(e.getAttribute("max"),n));break;default:a=i(g("NumberRangeOverflow"),f(e.getAttribute("max"),n))}ue.set(e,a)}return t},rangeUnderflow:function(e){var t=!R(e),n=d(e);if(t){var a=void 0;switch(n){case"date":case"datetime":case"datetime-local":a=i(g("DateRangeUnderflow"),c(e.getAttribute("max"),n));break;case"time":a=i(g("TimeRangeUnderflow"),c(e.getAttribute("max"),n));break;default:a=i(g("NumberRangeUnderflow"),f(e.getAttribute("max"),n))}ue.set(e,a)}return t},stepMismatch:function(e){var t=!F(e);if(t){var n=h(e),a=r(n,2),l=a[0],o=a[1],s=!1;null===l?s=o:null===o&&(s=l),s!==!1?ue.set(e,i(g("StepMismatchOneValue"),s)):ue.set(e,i(g("StepMismatch"),l,o))}return t},tooLong:function(e){var t=!S(e);return t&&ue.set(e,i(g("TextTooLong"),e.getAttribute("maxlength"),O(e.value))),t},tooShort:function(e){var t=!$(e);return t&&ue.set(e,i(g("Please lengthen this text to %l characters or more (you are currently using %l characters)."),e.getAttribute("maxlength"),O(e.value))),t},typeMismatch:function(e){var t=!V(e);if(t){var n=g("Please use the appropriate format."),a=d(e);"email"===a?n=g(e.hasAttribute("multiple")?"Please enter a comma separated list of email addresses.":"InvalidEmail"):"url"===a?n=g("InvalidURL"):"file"===a&&(n=g("Please select a file of the correct type.")),ue.set(e,n)}return t},valueMissing:function(e){var t=!H(e);if(t){var n=g("ValueMissing"),a=d(e);"checkbox"===a?n=g("CheckboxMissing"):"radio"===a?n=g("RadioMissing"):"file"===a?n=g(e.hasAttribute("multiple")?"Please select one or more files.":"FileMissing"):e instanceof window.HTMLSelectElement&&(n=g("SelectMissing")),ue.set(e,n)}return t}},Ne=function Ce(e){if(!(e instanceof window.HTMLElement))throw new Error("cannot create a ValidityState for a non-element");var t=Ce.cache.get(e);return t?t:this instanceof Ce?(this.element=e,void Ce.cache.set(e,this)):new Ce(e)},Te={};Ne.prototype=Te,Ne.cache=new WeakMap;for(var xe in ye)Object.defineProperty(Te,xe,{configurable:!0,enumerable:!0,get:function(e){return function(){return e(this.element)}}(ye[xe]),set:void 0});Object.defineProperty(Te,"valid",{configurable:!0,enumerable:!0,get:function(){var e=L(this.element),t=e&&e.settings.classes.valid||"hf-valid",n=e&&e.settings.classes.invalid||"hf-invalid",a=e&&e.settings.classes.validated||"hf-validated";if(this.element.classList.add(a),k(this.element))for(var r in ye)if(ye[r](this.element))return this.element.classList.add(n),this.element.classList.remove(t),this.element.setAttribute("aria-invalid","true"),!1;return ue["delete"](this.element),this.element.classList.remove(n),this.element.classList.add(t),this.element.setAttribute("aria-invalid","false"),!0},set:void 0}),e(Te),Ne.install=t("validity",{configurable:!0,enumerable:!0,get:function(){return Ne(this)}}),Y.install=t("checkValidity",{configurable:!0,enumerable:!0,value:function(){return Y(this)},writable:!0}),e(Y);var Ae="0.7.3",Ee=de.set,Me=be.set;return B.version=Ae,B.checkValidity=Y,B.reportValidity=y,B.setCustomValidity=x,B.stepDown=M,B.stepUp=C,B.validationMessage=D,B.ValidityState=Ne,B.valueAsDate=A,B.valueAsNumber=E,B.willValidate=U,B.set_language=v,B.add_translation=m,B.set_renderer=Ee,B.register=Me,B}();
/*! hyperform.js.org */
var hyperform=function(){"use strict";function e(e,t){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],r=n.bubbles,i=void 0===r?!0:r,a=n.cancelable,o=void 0===a?!1:a;if(!(t instanceof window.Event)){var l=document.createEvent("Event");l.initEvent(t,i,o),t=l}return e.dispatchEvent(t),t}function t(e){return["object","function"].indexOf(typeof e)>-1&&(delete e.__hyperform,Object.defineProperty(e,"__hyperform",{configurable:!0,enumerable:!1,value:!0})),e}function n(){var e=arguments.length<=0||void 0===arguments[0]?"hf_":arguments[0];return e+he++ +Math.random().toString(36).substr(2)}function r(t){if(t instanceof window.HTMLFormElement)return Array.prototype.map.call(t.elements,r).every(function(e){return e});var n,i=Qe(t).valid;if(i){var a=V(t);a&&a.settings.valid_event&&(n=e(t,"valid",{cancelable:!0}))}else n=e(t,"invalid",{cancelable:!0});return n&&n.defaultPrevented||be.show_warning(t),i}function i(t){t.preventDefault();var n=e(t.target.form,"validate",{cancelable:!0});if(!n.defaultPrevented){var i,a=!0;if(Array.prototype.map.call(t.target.form.elements,function(e){r(e)||(a=!1,!i&&"focus"in e&&(i=e))}),a){var o=e(t.target.form,"submit",{cancelable:!0});o.defaultPrevented||t.target.form.submit()}else i&&i.focus()}}function a(e){return!("INPUT"!==e.nodeName&&"BUTTON"!==e.nodeName||"image"!==e.type&&"submit"!==e.type)}function o(e){return!e.defaultPrevented&&(!("button"in e)||e.button<2)&&a(e.target)&&!e.target.hasAttribute("formnovalidate")&&e.target.form&&!e.target.form.hasAttribute("novalidate")}function l(e){return!e.defaultPrevented&&(13===e.keyCode&&"INPUT"===e.target.nodeName&&ce.indexOf(e.target.type)>-1||(13===e.keyCode||32===e.keyCode)&&a(e.target))&&e.target.form&&!e.target.form.hasAttribute("novalidate")}function s(e){o(e)&&i(e)}function u(e){o(e)&&e.target.form.submit()}function c(e){if(l(e)){for(var t,n=e.target.form.elements.length,r=0;n>r;r++)if(["image","submit"].indexOf(e.target.form.elements[r].type)>-1){t=e.target.form.elements[r];break}t?(e.preventDefault(),t.click()):i(e)}}function f(e){if(l(e)){for(var t,n=e.target.form.elements.length,r=0;n>r;r++)if(["image","submit"].indexOf(e.target.form.elements[r].type)>-1){t=e.target.form.elements[r];break}t?(e.preventDefault(),t.click()):e.target.form.submit()}}function d(e){var t=arguments.length<=1||void 0===arguments[1]?!1:arguments[1];t?(e.addEventListener("click",u),e.addEventListener("keypress",f)):(e.addEventListener("click",s),e.addEventListener("keypress",c))}function m(e){e.removeEventListener("click",u),e.removeEventListener("keypress",f),e.removeEventListener("click",s),e.removeEventListener("keypress",c)}function v(e,t){delete e[t];var n=Object.getOwnPropertyDescriptor(e,"_original_"+t);n&&Object.defineProperty(e,t,n)}function g(e,t,n){n.configurable=!0,n.enumerable=!0,"value"in n&&(n.writable=!0);var r=Object.getOwnPropertyDescriptor(e,t);if(r){if(r.get&&r.get.__hyperform||r.value&&r.value.__hyperform)return;Object.defineProperty(e,"_original_"+t,r)}delete e[t],Object.defineProperty(e,t,n)}function h(e,t){ge.set(e,t,!0)}function w(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];var i=n.length,a=0;return e.replace(/%([0-9]+\$)?([sl])/g,function(e,t,r){var o=a;t&&(o=Number(t.replace(/\$$/,""))-1),a+=1;var l="";return i>o&&(l=n[o]),(l instanceof Date||"number"==typeof l||l instanceof Number)&&(l="l"===r?(l.toLocaleString||l.toString).call(l):l.toString()),l})}function p(e){e=new Date(+e),e.setUTCHours(0,0,0),e.setUTCDate(e.getUTCDate()+4-(e.getUTCDay()||7));var t=new Date(e.getUTCFullYear(),0,1),n=Math.ceil(((e-t)/864e5+1)/7);return[e.getUTCFullYear(),n]}function b(e){for(var t=arguments.length<=1||void 0===arguments[1]?2:arguments[1],n=e+"";n.length<t;)n="0"+n;return n}function y(e,t){if(!(e instanceof Date))return null;switch(t){case"datetime":return y(e,"date")+"T"+y(e,"time");case"datetime-local":return w("%s-%s-%sT%s:%s:%s.%s",e.getFullYear(),b(e.getMonth()+1),b(e.getDate()),b(e.getHours()),b(e.getMinutes()),b(e.getSeconds()),b(e.getMilliseconds(),3)).replace(/(:00)?\.000$/,"");case"date":return w("%s-%s-%s",e.getUTCFullYear(),b(e.getUTCMonth()+1),b(e.getUTCDate()));case"month":return w("%s-%s",e.getUTCFullYear(),b(e.getUTCMonth()+1));case"week":var n=p(e);return w.call(null,"%s-W%s",n[0],b(n[1]));case"time":return w("%s:%s:%s.%s",b(e.getUTCHours()),b(e.getUTCMinutes()),b(e.getUTCSeconds()),b(e.getUTCMilliseconds(),3)).replace(/(:00)?\.000$/,"")}return null}function T(e,t){var n=new Date(Date.UTC(t,0,1+7*(e-1)));return n.getUTCDay()<=4?n.setUTCDate(n.getUTCDate()-n.getUTCDay()+1):n.setUTCDate(n.getUTCDate()+8-n.getUTCDay()),n}function E(e,t){var n,r=new Date(0);switch(t){case"datetime":if(!/^([0-9]{4,})-([0-9]{2})-([0-9]{2})T([01][0-9]|2[0-3]):([0-5][0-9])(?::([0-5][0-9])(?:\.([0-9]{1,3}))?)?$/.test(e))return null;for(n=RegExp.$7||"000";n.length<3;)n+="0";return r.setUTCFullYear(Number(RegExp.$1)),r.setUTCMonth(Number(RegExp.$2)-1,Number(RegExp.$3)),r.setUTCHours(Number(RegExp.$4),Number(RegExp.$5),Number(RegExp.$6||0),Number(n)),r;case"date":return/^([0-9]{4,})-([0-9]{2})-([0-9]{2})$/.test(e)?(r.setUTCFullYear(Number(RegExp.$1)),r.setUTCMonth(Number(RegExp.$2)-1,Number(RegExp.$3)),r):null;case"month":return/^([0-9]{4,})-([0-9]{2})$/.test(e)?(r.setUTCFullYear(Number(RegExp.$1)),r.setUTCMonth(Number(RegExp.$2)-1,1),r):null;case"week":return/^([0-9]{4,})-W(0[1-9]|[1234][0-9]|5[0-3])$/.test(e)?T(Number(RegExp.$2),Number(RegExp.$1)):null;case"time":if(!/^([01][0-9]|2[0-3]):([0-5][0-9])(?::([0-5][0-9])(?:\.([0-9]{1,3}))?)?$/.test(e))return null;for(n=RegExp.$4||"000";n.length<3;)n+="0";return r.setUTCHours(Number(RegExp.$1),Number(RegExp.$2),Number(RegExp.$3||0),Number(n)),r}return null}function M(e,t){var n=E(e,t);return null!==n?+n:Number(e)}function A(e){if(e instanceof window.HTMLTextAreaElement)return"textarea";if(e instanceof window.HTMLSelectElement)return e.hasAttribute("multiple")?"select-multiple":"select-one";if(e instanceof window.HTMLButtonElement)return(e.getAttribute("type")||"submit").toLowerCase();if(e instanceof window.HTMLInputElement){var t=(e.getAttribute("type")||"").toLowerCase();return t&&de.indexOf(t)>-1?t:e.type||"text"}return""}function x(e){Te=e}function N(e,t){e in ye||(ye[e]={});for(var n in t)t.hasOwnProperty(n)&&(ye[e][n]=t[n])}function L(e){return Te in ye&&e in ye[Te]?ye[Te][e]:e in ye.en?ye.en[e]:e}function D(e){var t=arguments.length<=1||void 0===arguments[1]?1:arguments[1],n=A(e),r=e.getAttribute("min"),i=xe[n]||NaN;if(r){var a=M(r,n);isNaN(a)||(i=a)}var o=e.getAttribute("max"),l=Ne[n]||NaN;if(o){var s=M(o,n);isNaN(s)||(l=s)}var u=e.getAttribute("step"),c=Ee[n]||1;if(u&&"any"===u.toLowerCase())return[L("any value"),L("any value")];if(u){var f=M(u,n);isNaN(f)||(c=f)}var d=M(e.getAttribute("value"),n),m=M(e.value||e.getAttribute("value"),n);if(isNaN(m))return[L("any valid value"),L("any valid value")];var v=isNaN(i)?isNaN(d)?Ae[n]||0:d:i,g=Me[n]||1,h=v+Math.floor((m-v)/(c*g))*(c*g)*t,w=v+(Math.floor((m-v)/(c*g))+1)*(c*g)*t;return i>h?h=null:h>l&&(h=l),w>l?w=null:i>w&&(w=i),ae.indexOf(n)>-1&&(h=y(new Date(h),n),w=y(new Date(w),n)),[h,w]}function C(e){var t=arguments.length<=1||void 0===arguments[1]?void 0:arguments[1],n=A(e);if(ae.indexOf(n)>-1){if(void 0!==t){if(null===t)e.value="";else{if(!(t instanceof Date))throw new window.DOMException("valueAsDate setter encountered invalid value","TypeError");isNaN(t.getTime())?e.value="":e.value=y(t,n)}return}var r=E(e.value,n);return r instanceof Date?r:null}if(void 0!==t)throw new window.DOMException("valueAsDate setter cannot set date on this element","InvalidStateError");return null}function _(e){var t=arguments.length<=1||void 0===arguments[1]?void 0:arguments[1],n=A(e);if(le.indexOf(n)>-1){if("range"===n&&e.hasAttribute("multiple"))return NaN;if(void 0!==t){if(isNaN(t))e.value="";else{if("number"!=typeof t||!window.isFinite(t))throw new window.DOMException("valueAsNumber setter encountered invalid value","TypeError");try{C(e,new Date(t))}catch(r){if(!(r instanceof window.DOMException))throw r;e.value=t.toString()}}return}return M(e.value,n)}if(void 0!==t)throw new window.DOMException("valueAsNumber setter cannot set number on this element","InvalidStateError");return NaN}function k(e){var t=arguments.length<=1||void 0===arguments[1]?1:arguments[1];if(-1===le.indexOf(A(e)))throw new window.DOMException("stepDown encountered invalid type","InvalidStateError");if("any"===(e.getAttribute("step")||"").toLowerCase())throw new window.DOMException('stepDown encountered step "any"',"InvalidStateError");var n=D(e,t),r=n.prev;n.next;null!==r&&_(e,r)}function F(e){var t=arguments.length<=1||void 0===arguments[1]?1:arguments[1];if(-1===le.indexOf(A(e)))throw new window.DOMException("stepUp encountered invalid type","InvalidStateError");if("any"===(e.getAttribute("step")||"").toLowerCase())throw new window.DOMException('stepUp encountered step "any"',"InvalidStateError");var n=D(e,t),r=(n.prev,n.next);null!==r&&_(e,r)}function H(e){var t=ge.get(e);return t?t.toString():""}function U(e){return I(e)}function O(e){for(var t=["accept","max","min","pattern","placeholder","step"],n=0;n<t.length;n++){var r=t[n];g(e,r,{get:Le(r),set:De(r)})}for(var i=["multiple","required","readOnly"],a=0;a<i.length;a++){var o=i[a];g(e,o,{get:Ce(o.toLowerCase()),set:_e(o.toLowerCase())})}for(var l=["minLength","maxLength"],s=0;s<l.length;s++){var u=l[s];g(e,u,{get:ke(u.toLowerCase()),set:Fe(u.toLowerCase())})}}function S(e){for(var t=["accept","max","min","pattern","placeholder","step","multiple","required","readOnly","minLength","maxLength"],n=0;n<t.length;n++){var r=t[n];v(e,r)}}function P(e){if(e instanceof window.HTMLButtonElement||e instanceof window.HTMLInputElement||e instanceof window.HTMLSelectElement||e instanceof window.HTMLTextAreaElement||e instanceof window.HTMLFieldSetElement){for(var t in He)g(e,t,He[t]);O(e)}else e instanceof window.HTMLFormElement&&(g(e,"checkValidity",He.checkValidity),g(e,"reportValidity",He.reportValidity))}function $(e){e instanceof window.HTMLButtonElement||e instanceof window.HTMLInputElement||e instanceof window.HTMLSelectElement||e instanceof window.HTMLTextAreaElement||e instanceof window.HTMLFieldSetElement?(v(e,"checkValidity"),v(e,"reportValidity"),v(e,"setCustomValidity"),v(e,"stepDown"),v(e,"stepUp"),v(e,"validationMessage"),v(e,"validity"),v(e,"valueAsDate"),v(e,"valueAsNumber"),v(e,"willValidate"),S(e)):e instanceof window.HTMLFormElement&&(v(e,"checkValidity"),v(e,"reportValidity"))}function R(e,t){this.form=e,this.settings=t,this.revalidator=this.revalidate.bind(this),Ue.set(e,this),d(e,"never"===t.revalidate),e===window||e instanceof window.HTMLDocument?(this.install([window.HTMLButtonElement.prototype,window.HTMLInputElement.prototype,window.HTMLSelectElement.prototype,window.HTMLTextAreaElement.prototype,window.HTMLFieldSetElement.prototype]),P(window.HTMLFormElement)):(e instanceof window.HTMLFormElement||e instanceof window.HTMLFieldSetElement)&&(this.install(e.elements),e instanceof window.HTMLFormElement&&P(e)),"oninput"!==t.revalidate&&"hybrid"!==t.revalidate||(e.addEventListener("keyup",this.revalidator),e.addEventListener("change",this.revalidator)),"onblur"!==t.revalidate&&"hybrid"!==t.revalidate||e.addEventListener("blur",this.revalidator,!0)}function V(e){var t;for(e.form&&(t=Ue.get(e.form));!t&&e;)t=Ue.get(e),e=e.parentNode;return t||(t=Ue.get(window)),t}function I(e){if(e instanceof window.HTMLSelectElement||e instanceof window.HTMLTextAreaElement||e instanceof window.HTMLButtonElement||e instanceof window.HTMLInputElement){var t=A(e);if((!t||me.indexOf(t)>-1||fe.indexOf(t)>-1)&&!e.hasAttribute("disabled")&&!e.hasAttribute("readonly")){var n=V(e);if(n&&n.settings.novalidate_on_elements||!e.hasAttribute("novalidate")||!e.noValidate){for(var r=e.parentNode;r&&1===r.nodeType;){if(r instanceof window.HTMLFieldSetElement&&r.hasAttribute("disabled"))return!1;if("DATALIST"===r.nodeName.toUpperCase())return!1;if(r===e.form)break;r=r.parentNode}return!0}}}return!1}function B(e){return e.match(/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g).length}function W(e){var t=A(e);if(!I(e)||-1===ue.indexOf(t))return!0;if(!e.value)return"_original_validity"in e&&!e._original_validity.__hyperform?!e._original_validity.badInput:!0;var n=!0;switch(t){case"color":n=/^#[a-f0-9]{6}$/.test(e.value);break;case"number":case"range":n=!isNaN(Number(e.value));break;case"datetime":case"date":case"month":case"week":case"time":n=null!==E(e.value,t);break;case"datetime-local":n=/^([0-9]{4,})-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9])(?::([0-5][0-9])(?:\.([0-9]{1,3}))?)?$/.test(e.value);break;case"tel":break;case"email":}return n}function Y(e){var t=A(e);if(!I(e)||!e.value||!e.hasAttribute("max"))return!0;var n=void 0,r=void 0;return ae.indexOf(t)>-1?(n=1*E(e.value,t),r=1*(E(e.getAttribute("max"),t)||NaN)):(n=Number(e.value),r=Number(e.getAttribute("max"))),isNaN(r)||r>=n}function j(e){if(!(I(e)&&e.value&&-1!==ce.indexOf(A(e))&&e.hasAttribute("maxlength")&&e.getAttribute("maxlength")))return!0;var t=parseInt(e.getAttribute("maxlength"),10);return isNaN(t)||0>t?!0:B(e.value)<=t}function Z(e){var t=A(e);if(!I(e)||!e.value||!e.hasAttribute("min"))return!0;var n=void 0,r=void 0;return ae.indexOf(t)>-1?(n=1*E(e.value,t),r=1*(E(e.getAttribute("min"),t)||NaN)):(n=Number(e.value),r=Number(e.getAttribute("min"))),isNaN(r)||n>=r}function z(e){if(!(I(e)&&e.value&&-1!==ce.indexOf(A(e))&&e.hasAttribute("minlength")&&e.getAttribute("minlength")))return!0;var t=parseInt(e.getAttribute("minlength"),10);return isNaN(t)||0>t?!0:B(e.value)>=t}function q(e){return!I(e)||!e.value||!e.hasAttribute("pattern")||new RegExp("^(?:"+e.getAttribute("pattern")+")$").test(e.value)}function G(e){if(!I(e)||!e.hasAttribute("required"))return!0;switch(e.type){case"checkbox":return e.checked;case"radio":return!!(e.checked||e.form&&Array.prototype.filter.call(document.getElementsByName(e.name),function(t){return t.name===e.name&&t.form===e.form&&t.checked}).length>0);default:return!!e.value}}function J(e){var t=A(e);if(!I(e)||!e.value||-1===le.indexOf(t)||"any"===(e.getAttribute("step")||"").toLowerCase())return!0;var n=e.getAttribute("step");if(n=n?M(n,t):Ee[t]||1,0>=n||isNaN(n))return!0;var r=Me[t]||1,i=M(e.value,t),a=M(e.getAttribute("min")||e.getAttribute("value")||"",t);isNaN(a)&&(a=Ae[t]||0),"month"===t&&(a=12*new Date(a).getUTCFullYear()+new Date(a).getUTCMonth(),i=12*new Date(i).getUTCFullYear()+new Date(i).getUTCMonth());var o=Math.abs(a-i)%(n*r);return 1e-8>o||o>n*r-1e-8}function K(e){return e.replace(Ve,"")}function Q(e){return e.split(",").map(function(e){return K(e)}).filter(function(e){return e})}function X(e){var t=A(e);if(!I(e)||"file"!==t&&!e.value||"file"!==t&&-1===se.indexOf(t))return!0;var n=!0;switch(t){case"url":Oe||(Oe=document.createElement("a"));var r=K(e.value);Oe.href=r,n=Oe.href===r||Oe.href===r+"/";break;case"email":n=e.hasAttribute("multiple")?Q(e.value).every(function(e){return Ie.test(e)}):Ie.test(K(e.value));break;case"file":if("files"in e&&e.files.length&&e.hasAttribute("accept")){var i=Q(e.getAttribute("accept")).map(function(e){return/^(audio|video|image)\/\*$/.test(e)&&(e=new RegExp("^"+RegExp.$1+"/.+$")),e});if(!i.length)break;e:for(var a=0;a<e.files.length;a++){var o=!1;t:for(var l=0;l<i.length;l++){var s=e.files[a],u=i[l],c=s.type;if("string"==typeof u&&"."===u.substr(0,1)){if(-1===s.name.search("."))continue t;c=s.name.substr(s.name.lastIndexOf("."))}if(0===c.search(u)){o=!0;break t}}if(!o){n=!1;break e}}}}return n}function ee(e,t){return function(n){var r=!e(n);return r&&t(n),r}}function te(e,t,n){ge.set(e,Pe.get(e,t,n))}function ne(e){var t=Re.get(e),n=t.length,r=!0;if(n)for(var i=0;n>i;i++){var a=t[i](e);if(void 0!==a&&!a){r=!1;break}}if(r){var o=ge.get(e);r=!(o.toString()&&"is_custom"in o)}return!r}function re(t){if(t instanceof window.HTMLFormElement)return Array.prototype.map.call(t.elements,re).every(function(e){return e});var n=Qe(t).valid;if(n){var r=V(t);r&&r.settings.valid_event&&e(t,"valid")}else e(t,"invalid",{cancelable:!0});return n}function ie(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=t.strict,r=void 0===n?!1:n,i=t.revalidate,a=t.valid_event,o=t.extend_fieldset,l=t.novalidate_on_elements,s=t.classes;void 0===i&&(i=r?"onsubmit":"hybrid"),void 0===a&&(a=!r),void 0===o&&(o=!r),void 0===l&&(l=!r),s||(s={});var u={strict:r,revalidate:i,valid_event:a,extend_fieldset:o,classes:s};return e instanceof window.NodeList||e instanceof window.HTMLCollection||e instanceof Array?Array.prototype.map.call(e,function(e){return ie(e,u)}):new R(e,u)}var ae=["datetime","date","month","week","time"],oe=["number","range"],le=ae.concat(oe,"datetime-local"),se=["email","url"],ue=["email","date","month","week","time","datetime","datetime-local","number","range","color"],ce=["text","search","tel","password"].concat(se),fe=["checkbox","color","file","image","radio","submit"].concat(le,ce),de=["button","hidden","reset"].concat(fe),me=["select-one","select-multiple","textarea"],ve=new WeakMap,ge={set:function(e,n){var r=arguments.length<=2||void 0===arguments[2]?!1:arguments[2];if(e instanceof window.HTMLFieldSetElement){var i=V(e);if(i&&!i.settings.extend_fieldset)return ge}return"string"==typeof n&&(n=new String(n)),r&&(n.is_custom=!0),t(n),ve.set(e,n),"_original_setCustomValidity"in e&&e._original_setCustomValidity(n.toString()),ge},get:function(e){var t=ve.get(e);return void 0===t&&"_original_validationMessage"in e&&(t=new String(e._original_validationMessage)),t?t:new String("")},"delete":function(e){return"_original_setCustomValidity"in e&&e._original_setCustomValidity(""),ve["delete"](e)}},he=0,we=new WeakMap,pe={attach_warning:function(e,t){t.parentNode.insertBefore(e,t.nextSibling)},detach_warning:function(e,t){e.parentNode.removeChild(e)},show_warning:function(e){var t=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],r=ge.get(e).toString(),i=we.get(e);if(r){if(!i){var a=V(e);i=document.createElement("div"),i.className=a&&a.settings.classes.warning||"hf-warning",i.id=n(),i.setAttribute("aria-live","polite"),we.set(e,i)}e.setAttribute("aria-errormessage",i.id),i.textContent=r,be.attach_warning(i,e)}else i&&i.parentNode&&(e.removeAttribute("aria-errormessage"),be.detach_warning(i,e));!t&&"radio"===e.type&&e.form&&Array.prototype.filter.call(document.getElementsByName(e.name),function(t){return t.name===e.name&&t.form===e.form}).map(function(e){return be.show_warning(e,"sub_radio")})}},be={attach_warning:pe.attach_warning,detach_warning:pe.detach_warning,show_warning:pe.show_warning,set:function(e,t){t||(t=pe[e]),be[e]=t}},ye={en:{TextTooLong:"Please shorten this text to %l characters or less (you are currently using %l characters).",ValueMissing:"Please fill out this field.",CheckboxMissing:"Please check this box if you want to proceed.",RadioMissing:"Please select one of these options.",FileMissing:"Please select a file.",SelectMissing:"Please select an item in the list.",InvalidEmail:"Please enter an email address.",InvalidURL:"Please enter a URL.",PatternMismatch:"Please match the requested format.",PatternMismatchWithTitle:"Please match the requested format: %l.",NumberRangeOverflow:"Please select a value that is no more than %l.",DateRangeOverflow:"Please select a value that is no later than %l.",TimeRangeOverflow:"Please select a value that is no later than %l.",NumberRangeUnderflow:"Please select a value that is no less than %l.",DateRangeUnderflow:"Please select a value that is no earlier than %l.",TimeRangeUnderflow:"Please select a value that is no earlier than %l.",StepMismatch:"Please select a valid value. The two nearest valid values are %l and %l.",StepMismatchOneValue:"Please select a valid value. The nearest valid value is %l.",BadInputNumber:"Please enter a number."}},Te="en",Ee={"datetime-local":60,datetime:60,time:60},Me={"datetime-local":1e3,datetime:1e3,date:864e5,week:6048e5,time:1e3},Ae={week:-2592e5},xe={range:0},Ne={range:100},Le=function(e){return function(){return this.getAttribute(e)}},De=function(e){return function(t){this.setAttribute(e,t)}},Ce=function(e){return function(){return this.hasAttribute(e)}},_e=function(e){return function(t){t?this.setAttribute(e,e):this.removeAttribute(e)}},ke=function(e){return function(){return Math.max(0,Number(this.getAttribute(e)))}},Fe=function(e){return function(t){/^[0-9]+$/.test(t)&&this.setAttribute(e,t)}},He={checkValidity:{value:t(function(){return re(this)})},reportValidity:{value:t(function(){return r(this)})},setCustomValidity:{value:t(function(e){return h(this,e)})},stepDown:{value:t(function(){var e=arguments.length<=0||void 0===arguments[0]?1:arguments[0];return k(this,e)})},stepUp:{value:t(function(){var e=arguments.length<=0||void 0===arguments[0]?1:arguments[0];return F(this,e)})},validationMessage:{get:t(function(){return H(this)})},validity:{get:t(function(){return Qe(this)})},valueAsDate:{get:t(function(){return C(this)}),set:t(function(e){C(this,e)})},valueAsNumber:{get:t(function(){return _(this)}),set:t(function(e){_(this,e)})},willValidate:{get:t(function(){return U(this)})}},Ue=new WeakMap;R.prototype={destroy:function(){m(this.form),Ue["delete"](this.form),this.form.removeEventListener("keyup",this.revalidator),this.form.removeEventListener("change",this.revalidator),this.form.removeEventListener("blur",this.revalidator,!0),this.form===window||this.form instanceof window.HTMLDocument?(this.uninstall([window.HTMLButtonElement.prototype,window.HTMLInputElement.prototype,window.HTMLSelectElement.prototype,window.HTMLTextAreaElement.prototype,window.HTMLFieldSetElement.prototype]),$(window.HTMLFormElement)):(this.form instanceof window.HTMLFormElement||this.form instanceof window.HTMLFieldSetElement)&&(this.uninstall(this.form.elements),this.form instanceof window.HTMLFormElement&&$(this.form))},revalidate:function(e){(e.target instanceof window.HTMLButtonElement||e.target instanceof window.HTMLTextAreaElement||e.target instanceof window.HTMLSelectElement||e.target instanceof window.HTMLInputElement)&&("hybrid"===this.settings.revalidate?"blur"===e.type&&e.target.value!==e.target.defaultValue||e.target.validity.valid?r(e.target):"keyup"!==e.type&&"change"!==e.type||e.target.validity.valid&&r(e.target):r(e.target))},install:function(e){e instanceof window.Element&&(e=[e]);for(var t=e.length,n=0;t>n;n++)P(e[n])},uninstall:function(e){e instanceof window.Element&&(e=[e]);for(var t=e.length,n=0;t>n;n++)$(e[n])}};var Oe,Se=new WeakMap,Pe={set:function(e,t,n){var r=Se.get(e)||{};return r[t]=n,Se.set(e,r),Pe},get:function(e,t){var n=arguments.length<=2||void 0===arguments[2]?void 0:arguments[2],r=Se.get(e);if(void 0===r||!(t in r)){var i="data-"+t.replace(/[A-Z]/g,"-$&").toLowerCase();return e.hasAttribute(i)?e.getAttribute(i):n}return r[t]},"delete":function(e){var t=arguments.length<=1||void 0===arguments[1]?null:arguments[1];if(!t)return Se["delete"](e);var n=Se.get(e)||{};return t in n?(delete n[t],Se.set(e,n),!0):!1}},$e=new WeakMap,Re={set:function(e,t){var n=$e.get(e)||[];return n.push(t),$e.set(e,n),Re},get:function(e){return $e.get(e)||[]},"delete":function(e){return $e["delete"](e)}},Ve=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,Ie=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Be=ee(W,function(e){return te(e,"badInput",L("Please match the requested type."))}),We=ee(q,function(e){te(e,"patternMismatch",e.title?w(L("PatternMismatchWithTitle"),e.title):L("PatternMismatch"))}),Ye=ee(Y,function(e){var t=A(e),n=void 0;switch(t){case"date":case"datetime":case"datetime-local":n=w(L("DateRangeOverflow"),E(e.getAttribute("max"),t));break;case"time":n=w(L("TimeRangeOverflow"),E(e.getAttribute("max"),t));break;default:n=w(L("NumberRangeOverflow"),M(e.getAttribute("max"),t))}te(e,"rangeOverflow",n)}),je=ee(Z,function(e){var t=A(e),n=void 0;switch(t){case"date":case"datetime":case"datetime-local":n=w(L("DateRangeUnderflow"),E(e.getAttribute("min"),t));break;case"time":n=w(L("TimeRangeUnderflow"),E(e.getAttribute("min"),t));break;default:n=w(L("NumberRangeUnderflow"),M(e.getAttribute("min"),t))}te(e,"rangeUnderflow",n)}),Ze=ee(J,function(e){var t=D(e),n=t[0],r=t[1],i=!1,a=void 0;null===n?i=r:null===r&&(i=n),a=i!==!1?w(L("StepMismatchOneValue"),i):w(L("StepMismatch"),n,r),te(e,"stepMismatch",a)}),ze=ee(j,function(e){te(e,"tooLong",w(L("TextTooLong"),e.getAttribute("maxlength"),B(e.value)))}),qe=ee(z,function(e){te(e,"tooShort",w(L("Please lengthen this text to %l characters or more (you are currently using %l characters)."),e.getAttribute("maxlength"),B(e.value)))}),Ge=ee(X,function(e){var t=L("Please use the appropriate format."),n=A(e);"email"===n?t=L(e.hasAttribute("multiple")?"Please enter a comma separated list of email addresses.":"InvalidEmail"):"url"===n?t=L("InvalidURL"):"file"===n&&(t=L("Please select a file of the correct type.")),te(e,"typeMismatch",t)}),Je=ee(G,function(e){var t=L("ValueMissing"),n=A(e);"checkbox"===n?t=L("CheckboxMissing"):"radio"===n?t=L("RadioMissing"):"file"===n?t=L(e.hasAttribute("multiple")?"Please select one or more files.":"FileMissing"):e instanceof window.HTMLSelectElement&&(t=L("SelectMissing")),te(e,"valueMissing",t)}),Ke={badInput:Be,customError:ne,patternMismatch:We,rangeOverflow:Ye,rangeUnderflow:je,stepMismatch:Ze,tooLong:ze,tooShort:qe,typeMismatch:Ge,valueMissing:Je},Qe=function nt(e){if(!(e instanceof window.HTMLElement))throw new Error("cannot create a ValidityState for a non-element");var t=nt.cache.get(e);return t?t:this instanceof nt?(this.element=e,void nt.cache.set(e,this)):new nt(e)},Xe={};Qe.prototype=Xe,Qe.cache=new WeakMap;for(var et in Ke)Object.defineProperty(Xe,et,{configurable:!0,enumerable:!0,get:function(e){return function(){return e(this.element)}}(Ke[et]),set:void 0});Object.defineProperty(Xe,"valid",{configurable:!0,enumerable:!0,get:function(){var e=V(this.element),t=e&&e.settings.classes.valid||"hf-valid",n=e&&e.settings.classes.invalid||"hf-invalid",r=e&&e.settings.classes.validated||"hf-validated";if(this.element.classList.add(r),I(this.element))for(var i in Ke)if(Ke[i](this.element))return this.element.classList.add(n),this.element.classList.remove(t),this.element.setAttribute("aria-invalid","true"),!1;return ge["delete"](this.element),this.element.classList.remove(n),this.element.classList.add(t),this.element.setAttribute("aria-invalid","false"),!0},set:void 0}),t(Xe);var tt="0.7.5";return ie.version=tt,ie.checkValidity=re,ie.reportValidity=r,ie.setCustomValidity=h,ie.stepDown=k,ie.stepUp=F,ie.validationMessage=H,ie.ValidityState=Qe,ie.valueAsDate=C,ie.valueAsNumber=_,ie.willValidate=U,ie.set_language=function(e){return x(e),ie},ie.add_translation=function(e,t){return N(e,t),ie},ie.set_renderer=function(e,t){return be.set(e,t),ie},ie.register=function(e,t){return Re.set(e,t),ie},ie.set_message=function(e,t,n){return Pe.set(e,t,n),ie},ie}();
{
"name": "hyperform",
"version": "0.7.3",
"version": "0.7.5",
"description": "Capture form validation back from the browser",

@@ -34,3 +34,3 @@ "main": "dist/hyperform.cjs.js",

"devDependencies": {
"ava": "^0.14.0",
"ava": "^0.15.2",
"babel-register": "^6.7.2",

@@ -43,4 +43,5 @@ "jsdom": "^8.3.1",

"files": [
"src",
"dist"
"css",
"dist",
"src"
],

@@ -61,3 +62,4 @@ "jshintConfig": {

],
"babel": "inherit"
"babel": "inherit",
"concurrency": 5
},

@@ -64,0 +66,0 @@ "babel": {

@@ -71,4 +71,5 @@ # ![Text “Hyperform - Insert Form” in 80s arcade game style](stuff/header.png)

```js
hyperform.willValidate.call(form.elements[0]);
var is_valid = hyperform.validityState(form.elements[0]).valid;
if (hyperform.willValidate(form.elements[0])) {
var is_valid = hyperform.validityState(form.elements[0]).valid;
}
```

@@ -78,4 +79,3 @@

Check out the files in the [`examples`
folder](https://github.com/hyperform/hyperform/tree/master/examples).
[Check out the awesome examples!](https://hyperform.js.org/examples.html)

@@ -115,3 +115,3 @@ ## Status

* :full_moon: Trigger a `validate` event before validating a form:
* :full_moon: Trigger a `validate` event before validating a form:

@@ -125,5 +125,5 @@ ```js

* :new_moon: Trigger an event before validating individual elements.
* :new_moon: Trigger an event before validating individual elements.
* :full_moon: Trigger a `valid` event, when an input becomes valid, again:
* :full_moon: Trigger a `valid` event, when an input becomes valid, again:

@@ -134,7 +134,9 @@ ```js

* :new_moon: Allow functions to hook into the actual validations to accept or
* :new_moon: Allow functions to hook into the actual validations to accept or
reject inputs.
* :first_quarter_moon: Translate validation messages. We have some
partial translations ready: https://github.com/hyperform/hyperform-l10n
* :full_moon: Provide a registry for user defined validators, that are called
* :first_quarter_moon: Translate validation messages. We have some partial
translations ready: https://github.com/hyperform/hyperform-l10n
* :full_moon: Provide a registry for user defined validators, that are called
automatically in the `validity.customError` step:

@@ -148,13 +150,16 @@

* :full_moon: Catch form submissions _before_ the `submit` event to do our own
validation (`click`s on submit buttons and `enter` keys in text inputs in
forms w/o submit buttons).
* :full_moon: Add helper classes `hf-valid` and `hf-invalid` as well as proper
`aria-invalid` to elements to become independent of `:valid` / `:invalid`
pseudo-classes.
* :first_quarter_moon: Allow specifying settings to customize the behavior of Hyperform
(e. g., specifying a renderer for error messages).
* :full_moon: Take single `<input>` elements out of validation by supporting a
non-standard `novalidate` attribute and `noValidate` property for inputs:
* :full_moon: Catch form submissions _before_ the `submit` event to do our
own validation (`click`s on submit buttons and `enter` keys in text inputs
in forms w/o submit buttons).
* :full_moon: Add helper classes `hf-valid` and `hf-invalid` as well as
proper `aria-invalid` to elements to become independent of `:valid` /
`:invalid` pseudo-classes.
* :first_quarter_moon: Allow specifying settings to customize the behavior of
Hyperform (e. g., specifying a renderer for error messages).
* :full_moon: Take single `<input>` elements out of validation by supporting
a non-standard `novalidate` attribute and `noValidate` property for inputs:
```js

@@ -166,3 +171,3 @@ var element = document.querySelector('input[name="foo"]');

* :new_moon: Add support for declarative custom validation messages:
* :new_moon: Add support for declarative custom validation messages:

@@ -173,3 +178,3 @@ ```html

* :new_moon: Idea: Add a means of linking two `<input>`s together so they get
* :new_moon: Idea: Add a means of linking two `<input>`s together so they get
validated synchronously:

@@ -176,0 +181,0 @@

'use strict';
/**
* the following validation messages are from Firefox source,
* http://mxr.mozilla.org/mozilla-central/source/dom/locales/en-US/chrome/dom/dom.properties
* released under MPL license, http://mozilla.org/MPL/2.0/.
*/
const catalog = {
en: {
/**
* these validation messages are from Firefox source,
* http://mxr.mozilla.org/mozilla-central/source/dom/locales/en-US/chrome/dom/dom.properties
* released under MPL license, http://mozilla.org/MPL/2.0/.
*/
TextTooLong: 'Please shorten this text to %l characters or less (you are currently using %l characters).',

@@ -46,4 +46,6 @@ ValueMissing: 'Please fill out this field.',

}
for (let key of Object.keys(new_catalog)) {
catalog[lang][key] = new_catalog[key];
for (let key in new_catalog) {
if (new_catalog.hasOwnProperty(key)) {
catalog[lang][key] = new_catalog[key];
}
}

@@ -50,0 +52,0 @@ }

@@ -15,3 +15,3 @@ 'use strict';

/* jshint -W053 */
var message_store = {
const message_store = {

@@ -21,3 +21,3 @@ set(element, message, is_custom=false) {

const wrapped_form = get_wrapper(element);
if (wrapped_form && wrapped_form.settings.strict) {
if (wrapped_form && ! wrapped_form.settings.extend_fieldset) {
/* make this a no-op for <fieldset> in strict mode */

@@ -24,0 +24,0 @@ return message_store;

@@ -8,12 +8,14 @@ 'use strict';

/**
* A registry for custom validators
*
* slim wrapper around a WeakMap to ensure the values are arrays
* (hence allowing > 1 validators per element)
*/
var registry = {
const custom_validator_registry = {
set(element, validator) {
var current = internal_registry.get(element) || [];
const current = internal_registry.get(element) || [];
current.push(validator);
internal_registry.set(element, current);
return registry;
return custom_validator_registry;
},

@@ -31,2 +33,2 @@

export default registry;
export default custom_validator_registry;

@@ -12,4 +12,7 @@ 'use strict';

const Renderer = {
const DefaultRenderer = {
/**
* called when a warning should become visible
*/
attach_warning: function(warning, element) {

@@ -21,2 +24,5 @@ /* should also work, if element is last,

/**
* called when a warning should vanish
*/
detach_warning: function(warning, element) {

@@ -26,2 +32,7 @@ warning.parentNode.removeChild(warning);

/**
* called when feedback to an element's state should be handled
*
* i.e., showing and hiding warnings
*/
show_warning: function(element, sub_radio=false) {

@@ -37,2 +48,3 @@ const msg = message_store.get(element).toString();

warning.id = generate_id();
warning.setAttribute('aria-live', 'polite');
warnings_cache.set(element, warning);

@@ -62,3 +74,15 @@ }

};
const Renderer = {
attach_warning: DefaultRenderer.attach_warning,
detach_warning: DefaultRenderer.detach_warning,
show_warning: DefaultRenderer.show_warning,
set: function(renderer, action) {
if (! action) {
action = DefaultRenderer[renderer];
}
Renderer[renderer] = action;

@@ -65,0 +89,0 @@ },

'use strict';
import catch_submit from '../tools/catch_submit';
import checkValidity from '../polyfills/checkValidity';
import { catch_submit, uncatch_submit } from '../tools/catch_submit';
import reportValidity from '../polyfills/reportValidity';
import setCustomValidity from '../polyfills/setCustomValidity';
import stepDown from '../polyfills/stepDown';
import stepUp from '../polyfills/stepUp';
import validationMessage from '../polyfills/validationMessage';
import ValidityState from '../polyfills/validityState';
import valueAsDate from '../polyfills/valueAsDate';
import valueAsNumber from '../polyfills/valueAsNumber';
import willValidate from '../polyfills/willValidate';
import uninstall from '../tools/property_uninstaller';
import polyfill from '../tools/polyfill';
import polyunfill from '../tools/polyunfill';

@@ -24,15 +18,55 @@

*/
export default class Wrapper {
export default function Wrapper(form, settings) {
constructor(form, settings) {
this.form = form;
this.settings = settings;
this.form = form;
this.settings = settings;
this.revalidator = this.revalidate.bind(this);
instances.set(form, this);
instances.set(form, this);
catch_submit(form);
catch_submit(form, settings.revalidate === 'never');
if (form === window || form instanceof window.HTMLDocument) {
/* install on the prototypes, when called for the whole document */
this.install([
if (form === window || form instanceof window.HTMLDocument) {
/* install on the prototypes, when called for the whole document */
this.install([
window.HTMLButtonElement.prototype,
window.HTMLInputElement.prototype,
window.HTMLSelectElement.prototype,
window.HTMLTextAreaElement.prototype,
window.HTMLFieldSetElement.prototype,
]);
polyfill(window.HTMLFormElement);
} else if (form instanceof window.HTMLFormElement ||
form instanceof window.HTMLFieldSetElement) {
this.install(form.elements);
if (form instanceof window.HTMLFormElement) {
polyfill(form);
}
}
if (settings.revalidate === 'oninput' || settings.revalidate === 'hybrid') {
/* in a perfect world we'd just bind to "input", but support here is
* abysmal: http://caniuse.com/#feat=input-event */
form.addEventListener('keyup', this.revalidator);
form.addEventListener('change', this.revalidator);
}
if (settings.revalidate === 'onblur' || settings.revalidate === 'hybrid') {
/* useCapture=true, because `blur` doesn't bubble. See
* https://developer.mozilla.org/en-US/docs/Web/Events/blur#Event_delegation
* for a discussion */
form.addEventListener('blur', this.revalidator, true);
}
}
Wrapper.prototype = {
destroy() {
uncatch_submit(this.form);
instances.delete(this.form);
this.form.removeEventListener('keyup', this.revalidator);
this.form.removeEventListener('change', this.revalidator);
this.form.removeEventListener('blur', this.revalidator, true);
if (this.form === window || this.form instanceof window.HTMLDocument) {
this.uninstall([
window.HTMLButtonElement.prototype,

@@ -44,15 +78,12 @@ window.HTMLInputElement.prototype,

]);
} else if (form instanceof window.HTMLFormElement ||
form instanceof window.HTMLFieldSetElement) {
this.install(form.elements);
polyunfill(window.HTMLFormElement);
} else if (this.form instanceof window.HTMLFormElement ||
this.form instanceof window.HTMLFieldSetElement) {
this.uninstall(this.form.elements);
if (this.form instanceof window.HTMLFormElement) {
polyunfill(this.form);
}
}
},
if (settings.revalidate === 'oninput') {
/* in a perfect world we'd just bind to "input", but support here is
* abysmal: http://caniuse.com/#feat=input-event */
form.addEventListener('keyup', this.revalidate.bind(this));
form.addEventListener('change', this.revalidate.bind(this));
}
}
/**

@@ -66,5 +97,28 @@ * revalidate an input element

event.target instanceof window.HTMLInputElement) {
reportValidity(event.target);
if (this.settings.revalidate === 'hybrid') {
/* "hybrid" somewhat simulates what browsers do. See for example
* Firefox's :-moz-ui-invalid pseudo-class:
* https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-ui-invalid */
if (event.type === 'blur' &&
event.target.value !== event.target.defaultValue ||
event.target.validity.valid) {
/* on blur, update the report when the value has changed from the
* default or when the element is valid (possibly removing a still
* standing invalidity report). */
reportValidity(event.target);
} else if (event.type === 'keyup' || event.type === 'change') {
if (event.target.validity.valid) {
// report instantly, when an element becomes valid,
// postpone report to blur event, when an element is invalid
reportValidity(event.target);
}
}
} else {
reportValidity(event.target);
}
}
}
},

@@ -84,3 +138,3 @@ /**

install(els) {
if (els instanceof window.HTMLElement) {
if (els instanceof window.Element) {
els = [ els ];

@@ -92,17 +146,21 @@ }

for (let i = 0; i < els_length; i++) {
checkValidity.install(els[i]);
reportValidity.install(els[i]);
setCustomValidity.install(els[i]);
stepDown.install(els[i]);
stepUp.install(els[i]);
validationMessage.install(els[i]);
ValidityState.install(els[i]);
valueAsDate.install(els[i]);
valueAsNumber.install(els[i]);
willValidate.install(els[i]);
polyfill(els[i]);
}
}
},
}
uninstall(els) {
if (els instanceof window.Element) {
els = [ els ];
}
const els_length = els.length;
for (let i = 0; i < els_length; i++) {
polyunfill(els[i]);
}
},
};
/**

@@ -109,0 +167,0 @@ * try to get the appropriate wrapper for a specific element by looking up

@@ -14,4 +14,5 @@ 'use strict';

import willValidate from './polyfills/willValidate';
import custom_messages from './components/custom_messages';
import { set_language, add_translation } from './components/localization';
import Registry from './components/registry';
import CustomValidatorRegistry from './components/registry';
import Renderer from './components/renderer';

@@ -27,18 +28,38 @@ import Wrapper from './components/wrapper';

strict=false,
revalidate='oninput',
valid_event=true,
classes={},
revalidate,
valid_event,
extend_fieldset,
novalidate_on_elements,
classes,
}={}) {
if (revalidate === undefined) {
/* other recognized values: 'oninput', 'onblur', 'onsubmit' and 'never' */
revalidate = strict? 'onsubmit' : 'hybrid';
}
if (valid_event === undefined) {
valid_event = ! strict;
}
if (extend_fieldset === undefined) {
extend_fieldset = ! strict;
}
if (novalidate_on_elements === undefined) {
novalidate_on_elements = ! strict;
}
if (! classes) {
classes = {};
}
const settings = { strict, revalidate, valid_event, extend_fieldset, classes, };
if (form instanceof window.NodeList ||
form instanceof window.HTMLCollection ||
form instanceof Array) {
return Array.prototype.map.call(form, element => hyperform(element));
return Array.prototype.map.call(form,
element => hyperform(element, settings));
}
return new Wrapper(form, { strict, revalidate, valid_event, classes, });
return new Wrapper(form, settings);
}
let set_renderer = Renderer.set;
let register = Registry.set;
hyperform.version = version;

@@ -57,7 +78,8 @@

hyperform.set_language = set_language;
hyperform.add_translation = add_translation;
hyperform.set_renderer = set_renderer;
hyperform.register = register;
hyperform.set_language = lang => { set_language(lang); return hyperform; };
hyperform.add_translation = (lang, catalog) => { add_translation(lang, catalog); return hyperform; };
hyperform.set_renderer = (renderer, action) => { Renderer.set(renderer, action); return hyperform; };
hyperform.register = (element, validator) => { CustomValidatorRegistry.set(element, validator); return hyperform; };
hyperform.set_message = (element, validator, message) => { custom_messages.set(element, validator, message); return hyperform; };
export default hyperform;
'use strict';
import mark from '../tools/mark';
import installer from '../tools/property_installer';
import trigger_event from '../tools/trigger_event';

@@ -14,3 +12,3 @@ import ValidityState from './validityState';

*/
function checkValidity(element) {
export default function checkValidity(element) {
/* if this is a <form>, check validity of all child inputs */

@@ -24,3 +22,3 @@ if (element instanceof window.HTMLFormElement) {

/* default is true, also for elements that are no validation candidates */
var valid = ValidityState(element).valid;
const valid = ValidityState(element).valid;
if (valid) {

@@ -37,16 +35,1 @@ const wrapped_form = get_wrapper(element);

}
/**
* publish a convenience function to replace the native element.checkValidity
*/
checkValidity.install = installer('checkValidity', {
configurable: true,
enumerable: true,
value: function() { return checkValidity(this); },
writable: true,
});
mark(checkValidity);
export default checkValidity;
'use strict';
import mark from '../tools/mark';
import installer from '../tools/property_installer';
import trigger_event from '../tools/trigger_event';
import renderer from '../components/renderer';
import Renderer from '../components/renderer';
import ValidityState from './validityState';

@@ -15,3 +13,3 @@ import { get_wrapper } from '../components/wrapper';

*/
function reportValidity(element) {
export default function reportValidity(element) {
/* if this is a <form>, report validity of all child inputs */

@@ -26,3 +24,3 @@ if (element instanceof window.HTMLFormElement) {

* event was canceled. */
var valid = ValidityState(element).valid;
const valid = ValidityState(element).valid;
var event;

@@ -39,3 +37,3 @@ if (valid) {

if (! event || ! event.defaultPrevented) {
renderer.show_warning(element);
Renderer.show_warning(element);
}

@@ -45,16 +43,1 @@

}
/**
* publish a convenience function to replace the native element.reportValidity
*/
reportValidity.install = installer('reportValidity', {
configurable: true,
enumerable: true,
value: function() { return reportValidity(this); },
writable: true,
});
mark(reportValidity);
export default reportValidity;
'use strict';
import mark from '../tools/mark';
import installer from '../tools/property_installer';
import message_store from '../components/message_store';

@@ -10,23 +8,6 @@

/**
*
* set a custom validity message or delete it with an empty string
*/
function setCustomValidity(msg) {
/* jshint -W040 */
message_store.set(this, msg, true);
/* jshint +W040 */
export default function setCustomValidity(element, msg) {
message_store.set(element, msg, true);
}
/**
* publish a convenience function to replace the native element.setCustomValidity
*/
setCustomValidity.install = installer('setCustomValidity', {
configurable: true,
enumerable: true,
value: setCustomValidity,
writable: true,
});
mark(setCustomValidity);
export default setCustomValidity;

@@ -6,4 +6,2 @@ 'use strict';

import get_type from '../tools/get_type';
import mark from '../tools/mark';
import installer from '../tools/property_installer';
import { numbers } from '../components/types';

@@ -16,3 +14,3 @@ import valueAsNumber from './valueAsNumber';

*/
function stepDown(element, n=1) {
export default function stepDown(element, n=1) {
if (numbers.indexOf(get_type(element)) === -1) {

@@ -27,18 +25,7 @@ throw new window.DOMException('stepDown encountered invalid type',

var { prev, next } = get_next_valid(element, n);
const { prev, next } = get_next_valid(element, n);
if (prev !== null) {
valueAsNumber.call(element, prev);
valueAsNumber(element, prev);
}
}
stepDown.install = installer('stepDown', {
configurable: true,
enumerable: true,
value: function(n=1) { return stepDown(this, n); },
writable: true,
});
mark(stepDown);
export default stepDown;

@@ -6,4 +6,2 @@ 'use strict';

import get_type from '../tools/get_type';
import mark from '../tools/mark';
import installer from '../tools/property_installer';
import { numbers } from '../components/types';

@@ -16,3 +14,3 @@ import valueAsNumber from './valueAsNumber';

*/
function stepUp(element, n=1) {
export default function stepUp(element, n=1) {
if (numbers.indexOf(get_type(element)) === -1) {

@@ -27,18 +25,7 @@ throw new window.DOMException('stepUp encountered invalid type',

var { prev, next } = get_next_valid(element, n);
const { prev, next } = get_next_valid(element, n);
if (next !== null) {
valueAsNumber.call(element, next);
valueAsNumber(element, next);
}
}
stepUp.install = installer('stepUp', {
configurable: true,
enumerable: true,
value: function(n=1) { return stepUp(this, n); },
writable: true,
});
mark(stepUp);
export default stepUp;
'use strict';
import mark from '../tools/mark';
import installer from '../tools/property_installer';
import message_store from '../components/message_store';

@@ -13,6 +11,4 @@

*/
function validationMessage() {
/* jshint -W040 */
const msg = message_store.get(this);
/* jshint +W040 */
export default function validationMessage(element) {
const msg = message_store.get(element);
if (! msg) {

@@ -25,16 +21,1 @@ return '';

}
/**
* publish a convenience function to replace the native element.validationMessage
*/
validationMessage.install = installer('validationMessage', {
configurable: true,
enumerable: true,
get: validationMessage,
set: undefined,
});
mark(validationMessage);
export default validationMessage;
'use strict';
/**
* validation messages are from Firefox source,
* http://mxr.mozilla.org/mozilla-central/source/dom/locales/en-US/chrome/dom/dom.properties
* released under MPL license, http://mozilla.org/MPL/2.0/.
*/
import get_next_valid from '../tools/get_next_valid';
import get_type from '../tools/get_type';
import installer from '../tools/property_installer';
import is_validation_candidate from '../tools/is_validation_candidate';
import mark from '../tools/mark';
import sprintf from '../tools/sprintf';
import string_to_number from '../tools/string_to_number';
import string_to_date from '../tools/string_to_date';
import unicode_string_length from '../tools/unicode_string_length';
import _ from '../components/localization';
import message_store from '../components/message_store';
import Registry from '../components/registry';
import { get_wrapper } from '../components/wrapper';
import test_max from '../validators/max';
import test_maxlength from '../validators/maxlength';
import test_min from '../validators/min';
import test_minlength from '../validators/minlength';
import test_pattern from '../validators/pattern';
import test_required from '../validators/required';
import test_step from '../validators/step';
import test_type from '../validators/type';
import test_bad_input from '../validators/bad_input';
import validity_state_checkers from '../tools/validity_state_checkers';
/**
* Implement constraint checking functionality defined in the HTML5 standard
*
* @see https://html.spec.whatwg.org/multipage/forms.html#dom-cva-validity
* @return bool true if the test fails [!], false otherwise
*/
const validity_state_checkers = {
badInput: element => {
const invalid = ! test_bad_input(element);
if (invalid) {
message_store.set(element, _('Please match the requested type.'));
}
return invalid;
},
customError: element => {
/* check, if there are custom validators in the registry, and call
* them. */
const custom_validators = Registry.get(element);
var valid = true;
if (custom_validators.length) {
for (const validator of custom_validators) {
const result = validator(element);
if (result !== undefined && ! result) {
valid = false;
/* break on first invalid response */
break;
}
}
}
/* check, if there are other validity messages already */
if (valid) {
const msg = message_store.get(element);
valid = ! (msg.toString() && ('is_custom' in msg));
}
return ! valid;
},
patternMismatch: element => {
const invalid = ! test_pattern(element);
if (invalid) {
message_store.set(element,
element.title?
sprintf(_('PatternMismatchWithTitle'), element.title)
:
_('PatternMismatch')
);
}
return invalid;
},
rangeOverflow: element => {
const invalid = ! test_max(element);
const type = get_type(element);
if (invalid) {
let msg;
switch (type) {
case 'date':
case 'datetime':
case 'datetime-local':
msg = sprintf(_('DateRangeOverflow'),
string_to_date(element.getAttribute('max'), type));
break;
case 'time':
msg = sprintf(_('TimeRangeOverflow'),
string_to_date(element.getAttribute('max'), type));
break;
// case 'number':
default:
msg = sprintf(_('NumberRangeOverflow'),
string_to_number(element.getAttribute('max'), type));
break;
}
message_store.set(element, msg);
}
return invalid;
},
rangeUnderflow: element => {
const invalid = ! test_min(element);
const type = get_type(element);
if (invalid) {
let msg;
switch (type) {
case 'date':
case 'datetime':
case 'datetime-local':
msg = sprintf(_('DateRangeUnderflow'),
string_to_date(element.getAttribute('max'), type));
break;
case 'time':
msg = sprintf(_('TimeRangeUnderflow'),
string_to_date(element.getAttribute('max'), type));
break;
// case 'number':
default:
msg = sprintf(_('NumberRangeUnderflow'),
string_to_number(element.getAttribute('max'), type));
break;
}
message_store.set(element, msg);
}
return invalid;
},
stepMismatch: element => {
const invalid = ! test_step(element);
if (invalid) {
let [min, max] = get_next_valid(element);
let sole = false;
if (min === null) {
sole = max;
} else if (max === null) {
sole = min;
}
if (sole !== false) {
message_store.set(element, sprintf(_('StepMismatchOneValue'), sole));
} else {
message_store.set(element, sprintf(_('StepMismatch'), min, max));
}
}
return invalid;
},
tooLong: element => {
const invalid = ! test_maxlength(element);
if (invalid) {
message_store.set(element,
sprintf(_('TextTooLong'), element.getAttribute('maxlength'),
unicode_string_length(element.value)));
}
return invalid;
},
tooShort: element => {
const invalid = ! test_minlength(element);
if (invalid) {
message_store.set(element,
sprintf(_('Please lengthen this text to %l characters or more (you are currently using %l characters).'),
element.getAttribute('maxlength'),
unicode_string_length(element.value)));
}
return invalid;
},
typeMismatch: element => {
const invalid = ! test_type(element);
if (invalid) {
let msg = _('Please use the appropriate format.');
const type = get_type(element);
if (type === 'email') {
if (element.hasAttribute('multiple')) {
msg = _('Please enter a comma separated list of email addresses.');
} else {
msg = _('InvalidEmail');
}
} else if (type === 'url') {
msg = _('InvalidURL');
} else if (type === 'file') {
msg = _('Please select a file of the correct type.');
}
message_store.set(element, msg);
}
return invalid;
},
valueMissing: element => {
const invalid = ! test_required(element);
if (invalid) {
let msg = _('ValueMissing');
const type = get_type(element);
if (type === 'checkbox') {
msg = _('CheckboxMissing');
} else if (type === 'radio') {
msg = _('RadioMissing');
} else if (type === 'file') {
if (element.hasAttribute('multiple')) {
msg = _('Please select one or more files.');
} else {
msg = _('FileMissing');
}
} else if (element instanceof window.HTMLSelectElement) {
msg = _('SelectMissing');
}
message_store.set(element, msg);
}
return invalid;
},
};
/**
* the validity state constructor
*/
var ValidityState = function(element) {
const ValidityState = function(element) {
if (! (element instanceof window.HTMLElement)) {

@@ -273,3 +37,3 @@ throw new Error('cannot create a ValidityState for a non-element');

*/
var ValidityStatePrototype = {};
const ValidityStatePrototype = {};
ValidityState.prototype = ValidityStatePrototype;

@@ -332,15 +96,7 @@

/**
* mark the validity prototype, because that is what the client-facing
* code deals with mostly, not the property descriptor thing */
mark(ValidityStatePrototype);
/**
* publish a convenience function to replace the native element.validity
*/
ValidityState.install = installer('validity', {
configurable: true,
enumerable: true,
get: function() { return ValidityState(this); },
});
export default ValidityState;

@@ -5,4 +5,2 @@ 'use strict';

import get_type from '../tools/get_type';
import mark from '../tools/mark';
import installer from '../tools/property_installer';
import string_to_date from '../tools/string_to_date';

@@ -18,5 +16,4 @@ import date_to_string from '../tools/date_to_string';

*/
function valueAsDate(value=undefined) {
/* jshint -W040 */
const type = get_type(this);
export default function valueAsDate(element, value=undefined) {
const type = get_type(element);
if (dates.indexOf(type) > -1) {

@@ -26,8 +23,8 @@ if (value !== undefined) {

if (value === null) {
this.value = '';
element.value = '';
} else if (value instanceof Date) {
if (isNaN(value.getTime())) {
this.value = '';
element.value = '';
} else {
this.value = date_to_string(value, type);
element.value = date_to_string(value, type);
}

@@ -41,3 +38,3 @@ } else {

const value_date = string_to_date(this.value, type);
const value_date = string_to_date(element.value, type);
return value_date instanceof Date? value_date : null;

@@ -51,17 +48,4 @@

}
/* jshint +W040 */
return null;
}
valueAsDate.install = installer('valueAsDate', {
configurable: true,
enumerable: true,
get: valueAsDate,
set: valueAsDate,
});
mark(valueAsDate);
export default valueAsDate;

@@ -5,4 +5,2 @@ 'use strict';

import get_type from '../tools/get_type';
import mark from '../tools/mark';
import installer from '../tools/property_installer';
import string_to_number from '../tools/string_to_number';

@@ -18,7 +16,6 @@ import { numbers } from '../components/types';

*/
function valueAsNumber(value=undefined) {
/* jshint -W040 */
const type = get_type(this);
export default function valueAsNumber(element, value=undefined) {
const type = get_type(element);
if (numbers.indexOf(type) > -1) {
if (type === 'range' && this.hasAttribute('multiple')) {
if (type === 'range' && element.hasAttribute('multiple')) {
/* @see https://html.spec.whatwg.org/multipage/forms.html#do-not-apply */

@@ -31,7 +28,7 @@ return NaN;

if (isNaN(value)) {
this.value = '';
element.value = '';
} else if (typeof value === 'number' && window.isFinite(value)) {
try {
/* try setting as a date, but... */
valueAsDate.call(this, new Date(value));
valueAsDate(element, new Date(value));
} catch (e) {

@@ -43,3 +40,3 @@ /* ... when valueAsDate is not responsible, ... */

/* ... set it via Number.toString(). */
this.value = value.toString();
element.value = value.toString();
}

@@ -53,3 +50,3 @@ } else {

return string_to_number(this.value, type);
return string_to_number(element.value, type);

@@ -62,17 +59,4 @@ } else if (value !== undefined) {

}
/* jshint +W040 */
return NaN;
}
valueAsNumber.install = installer('valueAsNumber', {
configurable: true,
enumerable: true,
get: valueAsNumber,
set: valueAsNumber,
});
mark(valueAsNumber);
export default valueAsNumber;
'use strict';
import mark from '../tools/mark';
import installer from '../tools/property_installer';
import is_validation_candidate from '../tools/is_validation_candidate';

@@ -10,23 +8,6 @@

/**
* check, if an element will be subject to HTML5 validation
* check, if an element will be subject to HTML5 validation at all
*/
function willValidate() {
/* jshint -W040 */
return is_validation_candidate(this);
/* jshint +W040 */
export default function willValidate(element) {
return is_validation_candidate(element);
}
/**
* publish a convenience function to replace the native element.willValidate
*/
willValidate.install = installer('willValidate', {
configurable: true,
enumerable: true,
get: willValidate,
set: undefined,
});
mark(willValidate);
export default willValidate;

@@ -49,56 +49,177 @@ 'use strict';

/**
* catch all relevant events _prior_ to a form being submitted
* test if node is a submit button
*/
export default function(listening_node) {
/* catch explicit submission (click on button) */
listening_node.addEventListener('click', function(event) {
if (! event.defaultPrevented &&
function is_submit_button(node) {
return (
/* must be an input or button element... */
(node.nodeName === 'INPUT' ||
node.nodeName === 'BUTTON') &&
(event.target.nodeName === 'INPUT' ||
event.target.nodeName === 'BUTTON') &&
/* ...and have a submitting type */
(node.type === 'image' || node.type === 'submit')
);
}
(event.target.type === 'image' || event.target.type === 'submit') &&
! event.target.hasAttribute('formnovalidate') &&
/**
* test, if the click event would trigger a submit
*/
function is_submitting_click(event) {
return (
/* prevented default: won't trigger a submit */
! event.defaultPrevented &&
event.target.form &&
/* left button or middle button (submits in Chrome) */
(! ('button' in event) ||
event.button < 2) &&
! event.target.form.hasAttribute('novalidate')) {
/* must be a submit button... */
is_submit_button(event.target) &&
check(event);
}
});
/* if validation should be ignored, we're not interested anyhow */
! event.target.hasAttribute('formnovalidate') &&
/* catch implicit submission */
listening_node.addEventListener('keypress', function(event) {
if (! event.defaultPrevented &&
/* the button needs a form, that's going to be submitted */
event.target.form &&
/* again, if the form should not be validated, we're out of the game */
! event.target.form.hasAttribute('novalidate')
);
}
/**
* test, if the keypress event would trigger a submit
*/
function is_submitting_keypress(event) {
return (
/* prevented default: won't trigger a submit */
! event.defaultPrevented &&
(
(
/* <Enter> was pressed... */
event.keyCode === 13 &&
event.target.nodeName === 'INPUT' &&
/* ...on an <input> or <button> */
(event.target.nodeName === 'INPUT') &&
text_types.indexOf(event.target.type) > -1 &&
/* this is a standard text input field (not checkbox, ...) */
text_types.indexOf(event.target.type) > -1
) || (
/* or <Enter> or <Space> was pressed... */
(event.keyCode === 13 ||
event.keyCode === 32) &&
event.target.form &&
/* ...on a submit button */
is_submit_button(event.target)
)
) &&
! event.target.form.hasAttribute('novalidate')) {
/* there's a form... */
event.target.form &&
/* check, that there is no submit button in the form. Otherwise
* that should be clicked. */
var submit, el = event.target.form.elements.length;
for (let i = 0; i < el; i++) {
if (['image', 'submit'].indexOf(event.target.form.elements[i].type) > -1) {
submit = event.target.form.elements[i];
break;
}
/* ...and the form allows validation */
! event.target.form.hasAttribute('novalidate')
);
}
/**
* catch explicit submission by click on a button
*/
function click_handler(event) {
if (is_submitting_click(event)) {
check(event);
}
}
/**
* catch explicit submission by click on a button, but circumvent validation
*/
function ignored_click_handler(event) {
if (is_submitting_click(event)) {
event.target.form.submit();
}
}
/**
* catch implicit submission by pressing <Enter> in some situations
*/
function keypress_handler(event) {
if (is_submitting_keypress(event)) {
/* check, that there is no submit button in the form. Otherwise
* that should be clicked. */
const el = event.target.form.elements.length;
var submit;
for (let i = 0; i < el; i++) {
if (['image', 'submit'].indexOf(event.target.form.elements[i].type) > -1) {
submit = event.target.form.elements[i];
break;
}
}
if (submit) {
event.preventDefault();
submit.click();
} else {
check(event);
if (submit) {
event.preventDefault();
submit.click();
} else {
check(event);
}
}
}
/**
* catch implicit submission by pressing <Enter> in some situations, but circumvent validation
*/
function ignored_keypress_handler(event) {
if (is_submitting_keypress(event)) {
/* check, that there is no submit button in the form. Otherwise
* that should be clicked. */
const el = event.target.form.elements.length;
var submit;
for (let i = 0; i < el; i++) {
if (['image', 'submit'].indexOf(event.target.form.elements[i].type) > -1) {
submit = event.target.form.elements[i];
break;
}
}
});
if (submit) {
event.preventDefault();
submit.click();
} else {
event.target.form.submit();
}
}
}
/**
* catch all relevant events _prior_ to a form being submitted
*
* @param bool ignore bypass validation, when an attempt to submit the
* form is detected.
*/
export function catch_submit(listening_node, ignore=false) {
if (ignore) {
listening_node.addEventListener('click', ignored_click_handler);
listening_node.addEventListener('keypress', ignored_keypress_handler);
} else {
listening_node.addEventListener('click', click_handler);
listening_node.addEventListener('keypress', keypress_handler);
}
}
/**
* decommission the event listeners from catch_submit() again
*/
export function uncatch_submit(listening_node) {
listening_node.removeEventListener('click', ignored_click_handler);
listening_node.removeEventListener('keypress', ignored_keypress_handler);
listening_node.removeEventListener('click', click_handler);
listening_node.removeEventListener('keypress', keypress_handler);
}
'use strict';
import trim from './trim';
/**

@@ -10,11 +13,7 @@ * split a string on comma and trim the components

* plus removing empty entries.
*
* We don't use String.trim() to remove the need to polyfill it.
*/
export default function(str) {
return str.split(',')
.map(
item => item/*.trim()*/.replace(
/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''))
.map(item => trim(item))
.filter(b=>b);
}

@@ -52,3 +52,3 @@ 'use strict';

case 'week':
let params = get_week_of_year(date);
const params = get_week_of_year(date);
return sprintf.call(null, '%s-W%s', params[0], pad(params[1]));

@@ -55,0 +55,0 @@

@@ -10,3 +10,3 @@ 'use strict';

export default function(week, year) {
var date = new Date(Date.UTC(year, 0, 1 + (week - 1) * 7));
const date = new Date(Date.UTC(year, 0, 1 + (week - 1) * 7));

@@ -13,0 +13,0 @@ if (date.getUTCDay() <= 4/* thursday */) {

@@ -19,6 +19,6 @@ 'use strict';

let aMin = element.getAttribute('min');
const aMin = element.getAttribute('min');
let min = default_min[type] || NaN;
if (aMin) {
let pMin = string_to_number(aMin, type);
const pMin = string_to_number(aMin, type);
if (! isNaN(pMin)) {

@@ -29,6 +29,6 @@ min = pMin;

let aMax = element.getAttribute('max');
const aMax = element.getAttribute('max');
let max = default_max[type] || NaN;
if (aMax) {
let pMax = string_to_number(aMax, type);
const pMax = string_to_number(aMax, type);
if (! isNaN(pMax)) {

@@ -39,3 +39,3 @@ max = pMax;

let aStep = element.getAttribute('step');
const aStep = element.getAttribute('step');
let step = default_step[type] || 1;

@@ -46,3 +46,3 @@ if (aStep && aStep.toLowerCase() === 'any') {

} else if (aStep) {
let pStep = string_to_number(aStep, type);
const pStep = string_to_number(aStep, type);
if (! isNaN(pStep)) {

@@ -49,0 +49,0 @@ step = pStep;

@@ -30,7 +30,7 @@ 'use strict';

/* Get first day of year */
var yearStart = new Date(d.getUTCFullYear(),0,1);
const yearStart = new Date(d.getUTCFullYear(),0,1);
/* Calculate full weeks to nearest Thursday */
var weekNo = Math.ceil(( ( (d - yearStart) / 86400000) + 1)/7);
const weekNo = Math.ceil(( ( (d - yearStart) / 86400000) + 1)/7);
/* Return array of year and week number */
return [d.getUTCFullYear(), weekNo];
}

@@ -37,3 +37,3 @@ 'use strict';

* parent form has got the strict parameter */
if ((wrapped_form && wrapped_form.settings.strict) ||
if ((wrapped_form && wrapped_form.settings.novalidate_on_elements) ||
! element.hasAttribute('novalidate') ||

@@ -49,2 +49,9 @@ ! element.noValidate) {

return false;
} else if (p.nodeName.toUpperCase() === 'DATALIST') {
/* quick return, if it's a child of a datalist
* Do not use HTMLDataListElement to support older browsers,
* too.
* @see https://html.spec.whatwg.org/multipage/forms.html#the-datalist-element:barred-from-constraint-validation
*/
return false;
} else if (p === element.form) {

@@ -51,0 +58,0 @@ /* the outer boundary. We can stop looking for relevant

'use strict';
/**
* mark an object with a 'hyperform=true' property
* mark an object with a '__hyperform=true' property
*
* We use this to distinguish our properties from the native ones. Usage:
* js> mark(obj);
* js> assert(obj.hyperform === true)
* js> assert(obj.__hyperform === true)
*/
export default function(obj) {
if (['object', 'function'].indexOf(typeof obj) > -1) {
delete obj.hyperform;
Object.defineProperty(obj, 'hyperform', {
delete obj.__hyperform;
Object.defineProperty(obj, '__hyperform', {
configurable: true,
enumerable: false,
value: true,

@@ -15,0 +17,0 @@ });

@@ -5,24 +5,34 @@ 'use strict';

/**
* return a function, that adds property to an element
* add `property` to an element
*
* js> installer('foo', { value: 'bar' })(element);
* js> installer(element, 'foo', { value: 'bar' });
* js> assert(element.foo === 'bar');
*/
export default function(property, descriptor) {
return function(element) {
const original_descriptor = Object.getOwnPropertyDescriptor(element, property);
if (original_descriptor && ! (
(original_descriptor.get && original_descriptor.get.hyperform) ||
(original_descriptor.value && original_descriptor.value.hyperform)
)) {
/* publish existing property under new name, if it's not from us */
Object.defineProperty(
element,
'_original_'+property,
original_descriptor
);
export default function(element, property, descriptor) {
descriptor.configurable = true;
descriptor.enumerable = true;
if ('value' in descriptor) {
descriptor.writable = true;
}
const original_descriptor = Object.getOwnPropertyDescriptor(element, property);
if (original_descriptor) {
/* we already installed that property... */
if ((original_descriptor.get && original_descriptor.get.__hyperform) ||
(original_descriptor.value && original_descriptor.value.__hyperform)) {
return;
}
delete element[property];
Object.defineProperty(element, property, descriptor);
};
/* publish existing property under new name, if it's not from us */
Object.defineProperty(
element,
'_original_'+property,
original_descriptor
);
}
delete element[property];
Object.defineProperty(element, property, descriptor);
}

@@ -5,3 +5,3 @@ 'use strict';

export default function(str, ...args) {
var args_length = args.length;
const args_length = args.length;
var global_index = 0;

@@ -8,0 +8,0 @@

@@ -11,3 +11,3 @@ 'use strict';

export default function(string, element_type) {
var date = new Date(0);
const date = new Date(0);
var ms;

@@ -14,0 +14,0 @@ switch (element_type) {

@@ -11,3 +11,3 @@ 'use strict';

export default function(string, element_type) {
let rval = string_to_date(string, element_type);
const rval = string_to_date(string, element_type);
if (rval !== null) {

@@ -14,0 +14,0 @@ return +rval;

@@ -9,3 +9,3 @@ 'use strict';

if (! (event instanceof window.Event)) {
let _event = document.createEvent('Event');
const _event = document.createEvent('Event');
_event.initEvent(event, bubbles, cancelable);

@@ -12,0 +12,0 @@ event = _event;

@@ -8,5 +8,7 @@ 'use strict';

* @see https://mathiasbynens.be/notes/javascript-unicode
* We do not use the simple [...str].length, because it needs a ton of
* polyfills in older browsers.
*/
export default function(str) {
return [...str].length;
return str.match(/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g).length;
}

@@ -28,3 +28,4 @@ 'use strict';

if (! element.value) {
if ('_original_validity' in element) {
if ('_original_validity' in element &&
! element._original_validity.__hyperform) {
return ! element._original_validity.badInput;

@@ -31,0 +32,0 @@ }

@@ -7,7 +7,11 @@ 'use strict';

import is_validation_candidate from '../tools/is_validation_candidate';
import trim from '../tools/trim';
import { type_checked } from '../components/types';
/* we use a dummy <a> where we set the href to test URL validity */
const url_canary = document.createElement('a');
/* we use a dummy <a> where we set the href to test URL validity
* The definition is out of the "global" scope so that JSDOM can be instantiated
* after loading Hyperform for tests.
*/
var url_canary;

@@ -34,5 +38,9 @@ /* see https://html.spec.whatwg.org/multipage/forms.html#valid-e-mail-address */

case 'url':
url_canary.href = element.value;
is_valid = (url_canary.href === element.value ||
url_canary.href === element.value+'/');
if (! url_canary) {
url_canary = document.createElement('a');
}
const value = trim(element.value);
url_canary.href = value;
is_valid = (url_canary.href === value ||
url_canary.href === value+'/');
break;

@@ -44,3 +52,3 @@ case 'email':

} else {
is_valid = email_pattern.test(element.value);
is_valid = email_pattern.test(trim(element.value));
}

@@ -51,3 +59,3 @@ break;

element.hasAttribute('accept')) {
let patterns = comma_split(element.getAttribute('accept'))
const patterns = comma_split(element.getAttribute('accept'))
.map(pattern => {

@@ -71,4 +79,4 @@ if (/^(audio|video|image)\/\*$/.test(pattern)) {

for (let j = 0; j < patterns.length; j++) {
let file = element.files[i];
let pattern = patterns[j];
const file = element.files[i];
const pattern = patterns[j];

@@ -75,0 +83,0 @@ let fileprop = file.type;

'use strict';
export default '0.7.3';
export default '0.7.5';

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc