/*! For license information please see hidden.js.LICENSE.txt */
!function(){"use strict";function e(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)e[n]=i[n]}return e}var t=function t(i,n){function r(t,r,o){if("undefined"!=typeof document){"number"==typeof(o=e({},n,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var c="";for(var s in o)o[s]&&(c+="; "+s,!0!==o[s]&&(c+="="+o[s].split(";")[0]));return document.cookie=t+"="+i.write(r,t)+c}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],n={},r=0;r<t.length;r++){var o=t[r].split("="),c=o.slice(1).join("=");try{var s=decodeURIComponent(o[0]);if(n[s]=i.read(c,s),e===s)break}catch(e){}}return e?n[e]:n}},remove:function(t,i){r(t,"",e({},i,{expires:-1}))},withAttributes:function(i){return t(this.converter,e({},this.attributes,i))},withConverter:function(i){return t(e({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(i)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});window.FormieHidden=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.$form=e.$form,this.form=this.$form.form,this.$field=e.$field,this.$input=this.$field.querySelector("input"),this.cookieName=e.cookieName,this.$input?this.initHiddenField():console.error("Unable to find hidden input.")}initHiddenField(){const e=t.get(this.cookieName);e&&(this.$input.value=e),this.form.formTheme&&this.form.formTheme.updateFormHash()}}}();