/*ONTRAFORM DRIVERS | Version 1.1.1675 | February 19, 2019, 02:21 PM*/
(function(){var OPF_VERSION='1.1.1675',OPF_BUILD_DATE='February 19, 2019, 02:21 PM',G=window.__OPF;void 0===G&&(G=function(){var w={},C={},G=+new Date,P=document.createElement("div"),U=!1,x=!1;try{U=localStorage&&localStorage.getItem("OPF_DEBUG"),x=localStorage&&localStorage.getItem("OPF_TEST_ONTRAPAGES")}catch(Z){console.log("Looks like localStorage is failing. Error: "+Z.message)}var I=x?"https://forms.ontrapages.com":"https://forms.ontraport.com",V=x?"/ONTRAFormPublic/render":"/v2.4/include/formEditor/genlightbootstrap.php",W="https://forms.ontrapages.com"===I,
y=window.isONTRAform,x=function(){var a=[],c=function(){for(var c;c=a.shift();)c()},b=function(a){switch(document.readyState){case "interactive":case "complete":c();break;default:a||setTimeout(function(){b(!0)},7)}};(function(a,c,b){c=document;b="addEventListener";c[b]?c[b]("DOMContentLoaded",a,!1):window.attachEvent("onload",a)})(c);return function(c){c&&a.push(c);b()}}(),p=function(a,c){U&&(2===arguments.length?console.log(a,c):console.log(a))},f=function(){var a=Object.prototype.hasOwnProperty,
c=Object.prototype.toString,b={parseGetVars:function(){var a=window.location.search.substring(1).replace(/\+/g," "),c=[],a=decodeURI(a).split(/\&/),b=/\=/,g=a.length;if(0<g)for(var l=0,q;l<g;l++)a[l]&&(q=a[l].split(b),c[q[0]]=q[1]);return c},guid:function(){var a=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return function(){return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}}(),trim:function(a){return(a||"").replace(/^\s+|\s+$/g,"")},getComputedStyle:function(a,
c){var b;a&&(b=a.currentStyle?a.currentStyle[c]:document.defaultView.getComputedStyle(a,null).getPropertyValue(c));return b},parseTimeframe:function(a,c){var b=a.toLowerCase().replace(/ /g,"").match(/[0-9]{1,}[a-z]{1}/gi),g=0;b&&0!==b.length||(b=[c||"0s"]);for(var l=0,q=b.length,u,J,e;l<q;++l){u=0;J=b[l];e=+J.slice(0,-1);J.slice(-1);switch(J.charAt(J.length-1)){case "d":u=864E5;break;case "h":u=36E5;break;case "m":u=6E4;break;case "s":u=1E3}g+=e*u}return g},sense:function(){var a,c,b={},g={transition:"transitionend",
OTransition:"otransitionend",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};"undefined"!==typeof InstallTrigger?(b.isFirefox=!0,a="fireFox"):(c=!!window.opera||0<=navigator.userAgent.indexOf(" OPR/"))?(b.isOpera=!0,a="opera"):window.chrome&&!c?(b.isChrome=!0,a="chrome"):0<Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")?(b.isSafari=!0,a="safari"):document.documentMode&&(b.isIE=!0,a="ie",c=navigator.userAgent.toLowerCase(),b.isIeVersion=-1!=c.indexOf("msie")?
parseInt(c.split("msie")[1]):!1);b.browser=a;b.isMobileDevice=function(a){var c=!1;if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,
4)))c=!0;return c}(navigator.userAgent||navigator.vendor||window.opera);b.isMobileDevice&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&(b.isiOSDevice=!0);b.supportedEvents={};for(var l in g)if(g.hasOwnProperty(l)&&void 0!==P.style[l]){b.supportedEvents.transitionEnd=g[l];break}b.supportedEvents.touch=!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch);var q=function(a){a||(a="");var c=document.createElement("div");c.style.cssText=a+"width: calc( 1px );";return!!c.style.length};
b.supportedCSS={calc:function(){var a=!1;q("-webkit-")?a="-webkit-calc":q("-moz-")?a="-moz-calc":q()&&(a="calc");return a}()};b.nativePromiseSupport="undefined"!==typeof Promise&&Promise.toString().indexOf("[native code]");return b}(),parseParamString:function(a){var c={};a&&a.replace&&a.replace(/([^=&]{1,})=([^&]{1,})/g,function(a,b,l,A,e){c[b]=l});return c},stringifyParamObject:function(a){var c=[],b,g;for(b in a)g=a[b],void 0!==g&&c.push(b+"="+g);return c.join("&")},actionParamsToObj:function(a,
c){var b;b=a.getAttribute("action").split(c);return this.parseParamString(b[1])},isSameNode:function(){var a=P.isSameNode?"isSameNode":"isEqualNode";return function(c,b){return c[a](b)}}(),invoke:function(a,c){for(var b=0,g=a.length,l;b<g;++b)l=a[b],c(l)},once:function(){var a=function(){};return function(c){var b=c;return function(){b.apply(this,Array.prototype.slice.call(arguments));b=a}}}(),createCookie:function(a,c,b){var g;b?(g=new Date,g.setTime(g.getTime()+864E5*b),b="; expires="+g.toGMTString()):
b="";document.cookie=a+"="+c+b+"; path=/"},readCookie:function(a){a+="=";var b=document.cookie.split(";"),c,g;for(c=0;c<b.length;++c){for(g=b[c];" "==g.charAt(0);)g=g.substring(1,g.length);if(0==g.indexOf(a))return g.substring(a.length,g.length)}return null},checkLocalStorage:function(a){var c=!1;try{c="session"===a&&"undefined"==typeof window.sessionStorage?!0:"local"===a&&"undefined"==typeof window.localStorage?!0:"undefined"==typeof window.localStorage||"undefined"==typeof window.sessionStorage?
!0:!1}catch(b){c=!1}return c}},d=function(){return function(){for(var c=arguments[0],b=1,e=arguments.length;b<e;++b){var g=arguments[b],l=c,q=void 0;for(q in g)a.call(g,q)&&(l[q]=g[q])}return c}}(),e=function(){return function(){for(var b=arguments[0]||{},d=1,m=arguments.length;d<m;++d){var g=arguments[d],l=b,q=void 0;for(q in g)a.call(g,q)&&("[object Object]"===c.call(g[q])?l[q]=e(l[q],g[q]):l[q]=g[q])}return b}}();d(b,{extend:function(){var a=Array.prototype.slice.call(arguments);return"boolean"===
typeof arguments[0]?e.apply(this,a.slice(1)):d.apply(this,a)}});d(b,{triggerCustomEvent:function(){var a={firefox:{scroll:"mousewheel"}};return function(c,b,g){g||(g={});var l;l=a[f.sense.browser];var q=void 0===g.bubbles?!0:g.bubbles,e=void 0===g.cancelable?!0:g.cancelable;l&&l[b]&&(b=l[b]);window.CustomEvent&&!f.sense.isIE?l=new CustomEvent(b,{bubbles:q,cancelable:e,detail:g}):(l=document.createEvent("Event"),l.initEvent(b,q,e));l.data=g;c.dispatchEvent(l);window.jQuery&&jQuery(c||document.body).trigger(b)}}(),
addListener:function(a,b,c,g){if(!a.addEventListener&&a.attachEvent){g=b+c;var l="e"+g;a[l]=c;a[g]=function(){a[l](window.event)};a.attachEvent("on"+b,a[g])}else g||(g=!1),a.addEventListener(b,c,g)},addListeners:function(a,c){for(var e in c)b.addListener(a,e,c[e])},removeListener:function(a,b,c,g){a.detachEvent?(c=b+c,a.detachEvent("on"+b,a[c]),a[c]=null):(g||(g=!1),a.removeEventListener(b,c,g))},removeListeners:function(a,c){for(var e in c)b.removeListener(a,e,c[e])}});d(b,{XD:function(){var a,c,
b=1,g=function(){},l=/^#!?\d+&/,q=this.postMessage,e=this;return{postMessage:function(a,c,g){c&&(g=g||parent,q?g.postMessage(a,c.replace(/([^:]+:\/\/[^\/]+).*/,"$1")):c&&(g.location=c.replace(/#!.*$/,"")+"#!"+ +new Date+b++ +"&"+a))},receiveMessage:function(b,d){q?(b&&(g=function(a){if("string"===typeof d&&a.origin!==d||"[object Function]"===Object.prototype.toString.call(d)&&!1===d(a.origin))return!1;b(a)}),f.addListener(e,"message",g)):(a&&clearInterval(a),a=null,b&&(a=setInterval(function(){var a=
document.location.hash;a!==c&&l.test(a)&&(c=a,b({data:a.replace(l,"")}))},100)))}}}()});d(b,{getObjectKeys:Object.keys||function(){var a=Object.prototype.hasOwnProperty,c=!{toString:null}.propertyIsEnumerable("toString"),b="toString toLocaleString valueOf hasOwnProperty isPrototypeOf propertyIsEnumerable constructor".split(" "),g=b.length;return function(l){if("object"!==typeof l&&("function"!==typeof l||null===l))throw new TypeError("Object.keys called on non-object");var q=[],e;for(e in l)a.call(l,
e)&&q.push(e);if(c)for(e=0;e<g;e++)a.call(l,b[e])&&q.push(b[e]);return q}}()});Array.prototype.indexOf||(Array.prototype.indexOf=function(a,c){var b=this.length>>>0,g=Number(c)||0,g=0>g?Math.ceil(g):Math.floor(g);for(0>g&&(g+=b);g<b;g++)if(g in this&&this[g]===a)return g;return-1});window.hasOwnProperty||(window.hasOwnProperty=function(a){var c=this.__proto__||this.constructor.prototype;return a in this&&(!(a in c)||this[a]!==c[a])});Function.prototype.bind||(Function.prototype.bind=function(a){if("function"!==
typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var c=Array.prototype.slice.call(arguments,1),b=this,g=function(){},l=function(){return b.apply(this instanceof g&&a?this:a,c.concat(Array.prototype.slice.call(arguments)))};g.prototype=this.prototype;l.prototype=new g;return l});(function(){var a=Object.prototype,c=a.__defineGetter__,b=a.__defineSetter__,g=a.__lookupGetter__,l=a.__lookupSetter__,q=a.hasOwnProperty;c&&b&&g&&l&&(Object.defineProperty||
(Object.defineProperty=function(a,e,d){if(3>arguments.length)throw new TypeError("Arguments not optional");e+="";if(q.call(d,"value")&&(g.call(a,e)||l.call(a,e)||(a[e]=d.value),q.call(d,"get")||q.call(d,"set")))throw new TypeError("Cannot specify an accessor and a value");if(!(d.writable&&d.enumerable&&d.configurable))throw new TypeError("This implementation of Object.defineProperty does not support false for configurable, enumerable, or writable.");d.get&&c.call(a,e,d.get);d.set&&b.call(a,e,d.set);
return a}),Object.getOwnPropertyDescriptor||(Object.getOwnPropertyDescriptor=function(a,c){if(2>arguments.length)throw new TypeError("Arguments not optional.");c+="";var b={configurable:!0,enumerable:!0,writable:!0},e=g.call(a,c),d=l.call(a,c);if(!q.call(a,c))return b;if(!e&&!d)return b.value=a[c],b;delete b.writable;b.get=b.set=void 0;e&&(b.get=e);d&&(b.set=d);return b}),Object.defineProperties||(Object.defineProperties=function(a,c){for(var b in c)q.call(c,b)&&Object.defineProperty(a,b,c[b])}))})();
if(!(document.documentElement.dataset||Object.getOwnPropertyDescriptor(Element.prototype,"dataset")&&Object.getOwnPropertyDescriptor(Element.prototype,"dataset").get)){var k={enumerable:!0,get:function(){var a,c,b,g,l,q=this.attributes,e=q.length,d=function(a){return a.charAt(1).toUpperCase()},m=function(){return this},k=function(a,c){return"undefined"!==typeof c?this.setAttribute(a,c):this.removeAttribute(a)};try{({}).__defineGetter__("test",function(){}),c={}}catch(h){c=document.createElement("div")}for(a=
0;a<e;a++)if((g=q[a])&&g.name&&/^data-\w[\w\-]*$/.test(g.name)){b=g.value;g=g.name;l=g.substr(5).replace(/-./g,d);try{Object.defineProperty(c,l,{enumerable:this.enumerable,get:m.bind(b||""),set:k.bind(this,g)})}catch(f){c[l]=b}}return c}};try{Object.defineProperty(Element.prototype,"dataset",k)}catch(m){k.enumerable=!1,Object.defineProperty(Element.prototype,"dataset",k)}}d(b,{isObject:function(a){var c=typeof a;return"function"===c||"object"===c&&!!a},isFunction:"function"!==typeof/./&&"object"!==
typeof Int8Array?function(a){return"function"===typeof a||!1}:function(a){return"[object Function"===Object.toString.call(a)},isPlainObject:function(a){return null==a?!0:0===b.getObjectKeys(a).length},isArray:Array.isArray||function(a){return"[object Array]"===Object.toString.call(a)},debounce:function(a,c,b){var g,l,q,e,d,m=function(){var k=+new Date-e;k<c&&0<=k?g=setTimeout(m,c-k):(g=null,b||(d=a.apply(q,l),g||(q=l=null)))};return function(){q=this;l=arguments;e=+new Date;var k=b&&!g;g||(g=setTimeout(m,
c));k&&(d=a.apply(q,l),q=l=null);return d}},throttle:function(a,c,b){var g,l,q,e=null,d=0;b||(b={});var m=function(){d=!1===b.leading?0:+new Date;e=null;q=a.apply(g,l);e||(g=l=null)};return function(){var k=+new Date;d||!1!==b.leading||(d=k);var h=c-(k-d);g=this;l=arguments;if(0>=h||h>c)e&&(clearTimeout(e),e=null),d=k,q=a.apply(g,l),e?e||!1===b.trailing||(e=setTimeout(m,h)):g=l=null;return q}}});d(b,{dynamicThrottle:function(a,c,b){var g,l,e,d=null,k=0;b||(b={});var m=function(){k=!1===b.leading?
0:+new Date;d=null;e=a.apply(g,l);d||(g=l=null)};return function(){var h=+new Date,f,n;k||!1!==b.leading||(k=h);f=c();null===f&&(d=null);n=f-(h-k);g=this;l=arguments;if(0>=n||n>f)d&&(clearTimeout(d),d=null),k=h,e=a.apply(g,l),d?d||!1===b.trailing||(d=setTimeout(m,n)):g=l=null;return e}}});b.sense.nativePromiseSupport||function(a){"object"===typeof b&&"undefined"!==typeof module?module.exports=a():"function"===typeof define&&define.amd?define([],a):("undefined"!==typeof window?window:"undefined"!==
typeof global?global:"undefined"!==typeof self?self:this).Promise=a()}(function(){return function r(a,c,b){function e(k,m){if(!c[k]){if(!a[k]){var h="function"==typeof require&&require;if(!m&&h)return h(k,!0);if(d)return d(k,!0);h=Error("Cannot find module '"+k+"'");throw h.code="MODULE_NOT_FOUND",h;}h=c[k]={exports:{}};a[k][0].call(h.exports,function(c){var b=a[k][1][c];return e(b?b:c)},h,h.exports,r,a,c,b)}return c[k].exports}for(var d="function"==typeof require&&require,k=0;k<b.length;k++)e(b[k]);
return e}({1:[function(a,c,b){function l(){}function e(a){if("function"!==typeof a)throw new TypeError("resolver must be a function");this.state=Y;this.queue=[];this.outcome=void 0;a!==l&&h(this,a)}function d(a,c,b){this.promise=a;"function"===typeof c&&(this.onFulfilled=c,this.callFulfilled=this.otherCallFulfilled);"function"===typeof b&&(this.onRejected=b,this.callRejected=this.otherCallRejected)}function k(a,c,b){n(function(){var g;try{g=c(b)}catch(e){return v.reject(a,e)}g===a?v.reject(a,new TypeError("Cannot resolve promise with itself")):
v.resolve(a,g)})}function m(a){var c=a&&a.then;if(a&&"object"===typeof a&&"function"===typeof c)return function(){c.apply(a,arguments)}}function h(a,c){function b(c){e||(e=!0,v.reject(a,c))}function g(c){e||(e=!0,v.resolve(a,c))}var e=!1,l=f(function(){c(g,b)});"error"===l.status&&b(l.value)}function f(a,c){var b={};try{b.value=a(c),b.status="success"}catch(g){b.status="error",b.value=g}return b}var n=a("immediate"),v={},p=["REJECTED"],T=["FULFILLED"],Y=["PENDING"];c.exports=b=e;e.prototype["catch"]=
function(a){return this.then(null,a)};e.prototype.then=function(a,c){if("function"!==typeof a&&this.state===T||"function"!==typeof c&&this.state===p)return this;var b=new this.constructor(l);this.state!==Y?k(b,this.state===T?a:c,this.outcome):this.queue.push(new d(b,a,c));return b};d.prototype.callFulfilled=function(a){v.resolve(this.promise,a)};d.prototype.otherCallFulfilled=function(a){k(this.promise,this.onFulfilled,a)};d.prototype.callRejected=function(a){v.reject(this.promise,a)};d.prototype.otherCallRejected=
function(a){k(this.promise,this.onRejected,a)};v.resolve=function(a,c){var b=f(m,c);if("error"===b.status)return v.reject(a,b.value);if(b=b.value)h(a,b);else{a.state=T;a.outcome=c;for(var b=-1,g=a.queue.length;++b<g;)a.queue[b].callFulfilled(c)}return a};v.reject=function(a,b){a.state=p;a.outcome=b;for(var c=-1,g=a.queue.length;++c<g;)a.queue[c].callRejected(b);return a};b.resolve=function(a){return a instanceof this?a:v.resolve(new this(l),a)};b.reject=function(a){var b=new this(l);return v.reject(b,
a)};b.all=function(a){function b(a,l){c.resolve(a).then(function(a){d[l]=a;++q!==g||e||(e=!0,v.resolve(m,d))},function(a){e||(e=!0,v.reject(m,a))})}var c=this;if("[object Array]"!==Object.prototype.toString.call(a))return this.reject(new TypeError("must be an array"));var g=a.length,e=!1;if(!g)return this.resolve([]);for(var d=Array(g),q=0,k=-1,m=new this(l);++k<g;)b(a[k],k);return m};b.race=function(a){function b(a){c.resolve(a).then(function(a){e||(e=!0,v.resolve(q,a))},function(a){e||(e=!0,v.reject(q,
a))})}var c=this;if("[object Array]"!==Object.prototype.toString.call(a))return this.reject(new TypeError("must be an array"));var g=a.length,e=!1;if(!g)return this.resolve([]);for(var d=-1,q=new this(l);++d<g;)b(a[d]);return q}},{immediate:2}],2:[function(a,b,c){(function(a){function c(){h=!0;for(var a,b,g=f.length;g;){b=f;f=[];for(a=-1;++a<g;)b[a]();g=f.length}h=!1}var g=a.MutationObserver||a.WebKitMutationObserver,e;if(g){var d=0,g=new g(c),k=a.document.createTextNode("");g.observe(k,{characterData:!0});
e=function(){k.data=d=++d%2}}else if(a.setImmediate||"undefined"===typeof a.MessageChannel)e="document"in a&&"onreadystatechange"in a.document.createElement("script")?function(){var b=a.document.createElement("script");b.onreadystatechange=function(){c();b.onreadystatechange=null;b.parentNode.removeChild(b);b=null};a.document.documentElement.appendChild(b)}:function(){setTimeout(c,0)};else{var m=new a.MessageChannel;m.port1.onmessage=c;e=function(){m.port2.postMessage(0)}}var h,f=[];b.exports=function(a){1!==
f.push(a)||h||e()}}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{}]},{},[1])(1)});return b}(),K=function(a){return{Runner:function(a){return function(a,c,e,d){var m=[],f={},r=function(g,d,k){k||(k={});var J=k.disableConverting?g:c(g);g=e(J);var X="mark"+g;k.preArrivalHandler&&(J-=c(k.padding),r(J,d,{arrivalHandler:k.preArrivalHandler,disableConverting:!0}));-1===m.indexOf(g)&&(m.push(g),f[X]=[]);f[X].push(function(a,b){return function(){b(a)}}(d,
k.arrivalHandler));a&&a(m,m.length)},n=function(a){var b="mark"+a,c=f[b];a=m.indexOf(a);-1!==a&&m.splice(a,1);if(c){a=0;for(var g=c.length;a<g;++a)c[a]()&&c.splice(a,1);0===c.length&&delete f[b]}},g=function(){return Math.min.apply(this,m)};return{goTo:function(a,b,c){if("["===a.charAt(0)){a=a.replace(/ /g,"");a=a.substring(1,a.length-1).split(",");for(var g=0,e=a.length;g<e;++g)r(a[g],b,c)}else r(a,b,c)},getETA:function(){var a=+new Date;return g()-a},trigger:n,check:function(a){var b=g();a(b,m.length)&&
n(b)}}}}(a),QuickStorage:function(a){function b(a,b){a||(a={});this._isNew=!0;this._isInternal=b;this._cache={};a.onUpdate&&(this.onUpdateCB=a.onUpdate);(b||void 0===b)&&a.syncKey&&this._setupSync(a,b)}a.checkLocalStorage()&&function(){var b=function(b){function e(g){g=JSON.stringify(g);"session"==b?window.name=g:a.createCookie("localStorage",g,365)}var d=function(){var g="session"==b?window.name:a.readCookie("localStorage");return g?JSON.parse(g):{}}();return{length:0,clear:function(){d={};this.length=
0;"session"==b?window.name="":a.createCookie("localStorage","",365)},getItem:function(a){return void 0===d[a]?null:d[a]},key:function(a){var b=0,c;for(c in d){if(b==a)return c;b++}return null},removeItem:function(a){delete d[a];this.length--;e(d)},setItem:function(a,b){d[a]=b+"";this.length++;e(d)}}};if(a.checkLocalStorage("local"))try{window.localStorage=new b("local")}catch(d){}if(a.checkLocalStorage("session"))try{window.sessionStorage=new b("session")}catch(m){}}();b.storageMap={};var d=function(a){var c=
b.storageMap[a.key];if(c&&(c.state(a.newValue),c.onUpdateCB))c.onUpdateCB(a)};window.addEventListener?window.addEventListener("storage",d):window.attachEvent&&window.attachEvent("onstorage",d);b.prototype.setItem=function(a,b){var c=b?JSON.stringify(b):b;this._cache[a]=c;this._changeHandler("set",a)};b.prototype.getItem=function(a,b){var c=this._cache[a],d;this._syncActive&&(d=localStorage[this._syncKey]||{},d!==this._lastSyncStorageValue&&(this.state(d),c=this._cache[a]));void 0===c&&(c=null);c=
c?JSON.parse(c):c;!0===b?(d=this._getHistory(a),d.value=c):d=c;return d};b.prototype._getHistory=function(a){return{created:+(this._history.getItem(a+"__CREATED")||-1),lastChange:+(this._history.getItem(a+"__UPDATED")||-1)}};b.prototype.removeItem=function(a){delete this._cache[a];this._changeHandler("remove",a)};b.prototype._empty=function(){delete this._cache;this._cache={}};b.prototype.empty=function(){this._empty();this._changeHandler("empty")};b.prototype._changeHandler=function(a,b){this._syncUpdate();
if(this._history)switch(a){case "remove":case "set":var c=+new Date;null===this._history.getItem(b+"__CREATED")&&this._history.setItem(b+"__CREATED",c);this._history.setItem(b+"__UPDATED",c);break;case "empty":this._history.empty()}};b.prototype.state=function(){var a=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},b=b||{extend:function(b,c){var d=Array.prototype.slice.call(arguments);c=a(d[0])?d[0]:d[1];for(var k=2,g=d.length,l;k<g;++k)for(prop in l=d[k],l)c[prop]=l[prop]}};return function(c){if(void 0===
c)return b.extend(!0,{},this._cache);var d={};if(a(c))d=c;else if("string"===typeof c)try{d=JSON.parse(c)}catch(h){p("Trying to set invalid JSON object in QuickStorage.")}delete this._cache;this._cache=d}}();b.prototype._updateSyncCount=function(){var a=this._isNew?0:+(this._history.getItem("SYNC_COUNT")||0);this._history.setItem("SYNC_COUNT",++a)};b.prototype._syncRefresh=function(){if(this._syncActive){var a=JSON.stringify(this._cache);this._lastSyncStorageValue=a;try{localStorage.setItem(this._syncKey,
a)}catch(b){}}};b.prototype._syncUpdate=function(){this._syncRefresh();this._syncActive&&this._history.setItem("LAST_SYNC",+new Date)};b.prototype.getLastSync=function(){return+(this._history.getItem("LAST_SYNC")||-1)};b.prototype.setExpiry=function(a){this._history.setItem("EXPIRY",a)};b.prototype.getExpiry=function(){return+(this._history.getItem("EXPIRY")||0)||!1};b.prototype.isExpired=function(){var a=+new Date,b=this.getExpiry();return this._neverExpires||!1===b?!1:a>=b};b.prototype._setupSync=
function(a,c){a||(a={});this._syncActive=!0;this._syncKey=a.syncKey;this.constructor.storageMap[this._syncKey]=this;this._history=new b({syncKey:"_"+this._syncKey,expiry:a.expiry},!c);if(a.expiry){var d=this.getExpiry();(!d||0<=d)&&this.setExpiry(a.expiry)}this.isExpired()?(this._empty(),this._syncRefresh()):this._isNew=!1;this._updateSyncCount();d=localStorage.getItem(this._syncKey);null!==d?this.state(d):this._history.empty();this._syncRefresh()};b.prototype.isEmpty=function(){var a=0,b;for(b in this._cache)++a;
return 0===a?!0:!1};b.prototype.destroy=function(){this.empty();localStorage.removeItem(this._syncKey);this._history&&this._history.destroy()};return function(a){return new b(a)}}(a)}}(f),n={getValue:function(a){return+a.replace(/[^-0-9]/gi,"")},valueIsGTOE100Percent:function(a){return(a=a&&/%/.test(a)&&n.getValue(a))&&100<=a?!0:!1},getSeconds:function(a){return parseFloat(a/1E3)},getSecondsUntil:function(a){return n.getSeconds(a-+new Date)},getAllForms:function(){return document.querySelectorAll("script[data-opf-uid]")},
makeGUID:function(){var a={};return function(c,b){var d=f.guid(),d=(c||"")+d+(b||"");return void 0===a[d]?(a[d]=!0,d):n.makeGUID(c,b)}}(),getOpfParams:function(a){var c=a&&a.dataset.opfParams;if(c)return f.parseParamString(c);p("OPform::getFormParams() -- Failed to split params from script.src:",a)},isElementVisible:function(a){var c=!0;0===+f.getComputedStyle(a,"opacity")?c=!1:"hidden"===f.getComputedStyle(a,"visibility")?c=!1:"none"===f.getComputedStyle(a,"display")&&(c=!1);return c},getWindowHeight:function(){return document.documentElement.clientHeight},
getWindowWidth:function(){return document.documentElement.clientWidth},getDocumentScrollTop:function(){return window.scrollY||document.documentElement.scrollTop},getDocumentScrollBottom:function(){return n.getWindowHeight()+n.getDocumentScrollTop()},getDocumentScrollHeight:function(){return document.body.scrollHeight},getCurrentScrollTopPercentage:function(){var a=Math.ceil((n.getDocumentScrollTop()+(n.getWindowHeight()-25))/document.body.clientHeight*100);return 100<a?100:a},getStyleStringAsParams:function(a){a=
(a||"").split(";");for(var c=[],b=0,d=a.length,e,k,m;b<d;++b)e=a[b],""!==e&&(k=e.indexOf(":"),m=f.trim(e.slice(0,k)),e=f.trim(e.substring(k+1)),""!==e&&c.push(m+"="+e));return c.join("&")},changeStyle:function(){return function(a,c){var b=f.parseParamString(n.getStyleStringAsParams(a.getAttribute("style"))),d=f.isObject(c)?c:n.getStyleStringAsParams(c),b=f.extend(b,d),d=[],e="",k;for(k in b)d.push(k+":"+b[k]);d.push("");e=d.join(";");a.setAttribute("style",e)}}(),updateAttrs:function(){return function(a,
c){var b=c.style;n.changeStyle(a,b);delete c.style;f.extend(a.dataset,c.data);delete c.data;for(var d in c)a.setAttribute(d,c[d]);c.style=b}}()},N={onScrollTo:function(){var a=n.getCurrentScrollTopPercentage(),c=K.Runner(void 0,function(a){return+a},function(a){return a},a),b=n.getCurrentScrollTopPercentage,h=function(){var a=function(d,f){if(+b()>=+d)return f&&setTimeout(function(){c.check(a);p("handlers.onScrollTo() :: Runner -- checking for more milestones")},0),!0};c.check(a)},a=f.throttle(h,
100);f.addListener(window,"scroll",a);f.sense.isMobileDevice&&f.addListener(window,"touchend",a);return function(a,b){c.goTo(b,a,{arrivalHandler:function(a){if(d.modal.isAnythingOpen())return!1;d.checkPopEligibility(a)&&d.popFormOncePerTimeframe(a);return!0},preArrivalHandler:function(a){d.checkPopEligibility(a)&&d.modal.preload(a)},padding:7});c.check(h)}}(),onVisitDuration:function(){var a=function(){var b=null;return function(d){clearTimeout(b);if(d.length){for(var e=+new Date,k=0,f=d.length,A;k<
f;++k)A=d[k],+e>+A&&c.trigger(A);e=c.getETA();Infinity!==e?(b=setTimeout(function(b){return function(){a.apply(b,[d])}}(this),e),p("handlers.onVisitDuration() :: Runner -- setting next check for %s seconds",n.getSeconds(e))):p("handlers.onVisitDuration() :: Runner -- taking a break")}}}(),c=K.Runner(a,function(a){a=/[a-z]{1,}/.test(a)?a:a+"s";return"string"===typeof a?f.parseTimeframe(a):a},function(a){return G+a},G);return function(a,f){c.goTo(f,a,{arrivalHandler:function(a){if(d.modal.isAnythingOpen())return!1;
d.popFormOncePerTimeframe(a);return!0},preArrivalHandler:function(a){d.checkPopEligibility(a)&&d.modal.preload(a)},padding:"2s"})}}(),onExitIntent:function(){var a=[];f.addListener(document,"mouseout",function(c){c=c||window.event;var b=c.relatedTarget||c.toElement,h=c.pageX;c=c.pageY;var e=n.getWindowWidth(),k=n.getWindowHeight(),m=!1;if(0>h||e<=h||0>c||k<=c)m=!0;b&&"HTML"!==b.nodeName||!m||(0===a.length?p("handlers.onExitIntent() :: Exit intended but there's nothing to open... %s",""):d.modal.isAnythingOpen()?
p("handlers.onExitIntent() :: Exit intended but something is already open... %s",""):f.invoke(a,d.popFormOncePerTimeframe))});return function(c,b){d.modal.preload(c);p("handlers.onExitIntent() :: Preloading exit intenders... %s","");b&&"false"!==b&&a.push(c)}}(),maxTriggers:function(a,c){d.setInstanceSetting(a,"maxTriggers",c)},timeframe:function(a,c){var b=f.parseTimeframe(c,"1h");d.setInstanceSetting(a,"timeframe",b)},embed:function(a,c){p("handlers.embed() :: Embedding %s immediately",a);var b=
d.getInstance(a),f=d.modal.make.embeddedForm(b),e=b.scriptElem;e.parentNode.insertBefore(f,e);d.syncTrackingData([b.uid]);d.checkPopEligibility(a);d.formOpened(b.uid);d.setInstanceSetting(a,"embeddedElem",f)},filloutRestrictions:function(a,c){d.setInstanceSetting(a,"filloutRestricted",!0)},popPosition:function(a,c){d.setInstanceSetting(a,"popPosition",c)},instance:function(a,c){var b=d.getFormUID(a);d.setInstanceSetting(a,"uidInstance",b+"__"+c);d.setInstanceSetting(a,"instance",c)},preview:function(a,
c){d.setInstanceSetting(a,"preview",!0)}},H=K.QuickStorage({syncKey:"OPF_FOREVER"}),F=function(){var a=f.sense.isMobileDevice?0:50,c=function(){var e={},h=[],A=99999,r=[],t=function(b,c){var d=n.getDocumentScrollTop(),g=n.getDocumentScrollBottom(),e;e=n.getDocumentScrollTop();for(var l=document.activeElement,q=l!==document.body,k=r.length,h=0,m,A,u,t,w,D,y;h<k;++h)if((m=r[h])&&(!m||"fixed"!==m.style.position)){A=m.querySelector(".OPF__modal-form__wrapper");if(q&&(u=A.querySelector(".OPF__modal-form__iframe"),
f.isSameNode(l,u)))continue;p("docScrollTop is ",d);u=n.getValue(A.style.top||"100px");y=g;w=0>=d-u;t=A.offsetHeight;D="mc"===m.dataset.popposition;m=!1;0===d&&0>=u&&(c=!0);c||w?(u=e,D&&(u+=a),m=!0):(D&&(y+=a),document.body.clientHeight<u+t?m=!1:u+t>y||(u=g-t,D&&(u-=a),m=!0));m&&n.changeStyle(A,{top:u+"px"})}},g=f.debounce(t,300),l=function(a){p("Calling resize method");if(w&&"object"==typeof w)for(var b in w){a=w[b];var c=q.isFormOpen(a.uid);p("Resizing instance GUID ",b);p("Resizing instance UI",
a.uid);if(c){p("Form is already open.");var c=q.getElementFromUID(a.uid),g=c.querySelector(".OPF__modal-form__wrapper"),e=g.querySelector(".OPF__modal-form__iframe"),l=d.getFormSettings(a.uid),k=n.getWindowHeight(),h=+l.borderActive,h=isNaN(h)?!1:h,l=2*(h?n.getValue(l.borderSize):0),m=g.style.position;k<=(h?e.clientHeight+l:e.clientHeight)?(p("Form is taller than the window."),"fixed"==m&&f.debounce(f.throttle(q.placeModal(a,a.uid,c,g,e),7),500)):(p("Form is not taller than the window."),"fixed"!=
m&&f.debounce(f.throttle(q.placeModal(a,a.uid,c,g,e),7),500))}else p("Form is not open yet. Do nothing.")}},q={startingZindex:A,getNextZindex:function(){return++A},_hideAllOpenedElements:function(a){for(var b in e)b!==a&&n.changeStyle(e[b],{display:"none"})},_setElementToTop:function(a,b,c){var d=q.getNextZindex();c||q._hideAllOpenedElements(a);n.changeStyle(b,{"z-index":d});g(void 0,!0)},_prepare:function(a,b,c){q._setElementToTop(a,b,c);document.body.appendChild(b);h.push(a);e[a]=b},prepare:function(a,
b){n.changeStyle(b,{opacity:"0",left:"-99999px"});q._prepare(a,b,!0)},sendUIDtoTop:function(a){var b=q.getElementFromUID(a);f.isSameNode(b,q.getTopmostElement())||q._setElementToTop(a,b);n.changeStyle(b,{display:"block"});g(void 0,!0)},setElementToTop:function(a,b){q.hasOpened(a)?q.sendUIDtoTop(a):q._prepare(a,b)},getTopmostElement:function(){var a=99999,b,c,d,g;for(c in e)b=e[c],g=+f.getComputedStyle(b,"z-index"),(isVisible=n.isElementVisible(b))&&g>a&&(a=g,d=c);return e[d]},isAnythingOpen:function(){return void 0===
q.getTopmostElement()?!1:!0},getElementFromUID:function(a){return e[a]},_removeElement:function(a){var b=q.getElementFromUID(a);n.changeStyle(b,{display:"none"});setTimeout(function(){d.messageCenter.sendMessage(a,{type:"closing"}).then(function(c){f.triggerCustomEvent(b,"OPF:closed",{formUID:a});d.messageCenter.sendMessage(a,{type:"resetVideo"})})},1)},removeElement:function(a){q._removeElement(a)},hasOpened:function(a){return h&&-1!==h.indexOf(a)?!0:!1},isFormOpen:function(a){return q.hasOpened(a)&&
n.isElementVisible(q.getElementFromUID(a))},closeTopmostElement:function(a){f.triggerCustomEvent(a.target,"OPF:close",{formInstance:q.getTopmostElement()})},openFormModal:function(a,b,c){var g,e,l=a.GUID,f=d.getInstanceSettings(l);f._locked?p("env.openFormModal() :: formInstance is locked. Aborting openingSequence."):c.dataset.initComplete?(g=c.querySelector(".OPF__modal-form__wrapper"),e=g.querySelector(".OPF__modal-form__iframe"),q.openingSequence(a,b,c,g,e),"hidden"===c.style.overflow&&n.changeStyle(c,
{overflow:""}),f.lockAfterOpen&&(d.setInstanceSetting(l,"_locked",!0),d.setInstanceSetting(l,"_lockedUntil",+new Date+f.timeframe),setTimeout(function(){d.setInstanceSetting(l,"_locked",!1);p("popFormOncePerTimeframe() :: Releasing lock on %o",l)},f.timeframe))):(p("env.openFormModal() :: formInstance is not ready.",""),setTimeout(function(){q.openFormModal(a,b,c)},77))},openingSequence:function(a,b,c,g,e){var l=Array.prototype.slice.call(arguments);q.setElementToTop(b,c);d.messageCenter.sendMessage(b,
{type:"resize"}).then(function(a){q.placeModal.apply(this,l.concat({trueFormHeight:a.formHeight}))})},placeModal:function(g,e,l,k,h,m){m||(m={});var A=Array.prototype.slice.call(arguments),u=d.getFormSettings(e),r=d.getInstanceSettings(g.GUID),p=r.popPosition||"mc",y=n.getWindowWidth(),w=n.getWindowHeight(),x=n.getDocumentScrollTop(),G=n.getDocumentScrollBottom(),D=+u.borderActive,C=isNaN(D)?!1:D,L=2*(C?n.getValue(u.borderSize):0),D=k.clientWidth,B=m&&m.trueFormHeight||h.clientHeight,H=C?D+L:D,L=
C?B+L:B,F=(C=f.sense.isMobileDevice)?"100%":u.formWidth,u=-1!==F.indexOf("%"),F="100%"===F?!0:!1,M=w<=L,E={position:"fixed",left:""},z={},K={},I={opacity:1},Q={opacity:1},N={opacity:1},P=!1,R=!1,S,O;if(C||F)p=p.charAt(0)||"m",p+="c";l.setAttribute("data-popPosition",p);(C||"mc"===p)&&B<=L&&(E.height=L+3*a+"px");S=p.charAt(0);O=p.charAt(1);M?(P=!0,q.verticallyCenter(l),"mc"!==p&&(E.width="inherit")):(q.stopVerticallyCentering(l),f.extend(E,{height:"0",position:"fixed",width:F?"inherit":"100%"}),R=
!0);if(!M)switch(S){case "t":R?f.extend(z,{top:"0px"}):f.extend(z,{top:x+"px"});break;case "m":f.extend(z,{top:Math.floor((w-L)/2)+"px"});break;case "b":R?f.extend(z,{top:"",bottom:"0px"}):f.extend(z,{top:G-L+"px"})}if(M)switch(O){case "l":f.extend(E,{left:"0px",right:""});break;case "c":"mc"!==p&&f.extend(z,{left:Math.floor((y-H)/2)+"px"});break;case "r":f.extend(E,{left:"",right:"0px"})}else switch(O){case "l":f.extend(z,{left:"0px",right:""});break;case "c":f.extend(z,{left:Math.floor((y-H)/2)+
"px"});break;case "r":f.extend(z,{left:"",right:"0px"})}if(P){E.position="absolute";z.position="absolute";switch(O){case "l":f.extend(E,{left:"0px",right:""});break;case "c":f.extend(z,{left:Math.floor((y-H)/2)+"px"});break;case "r":f.extend(E,{left:"",right:H+"px"})}z.top=x+"px"}R&&(z.position="fixed");f.extend(I,E);f.extend(Q,z);f.extend(N,K);E.opacity=0;K.opacity=0;if(M)switch(O){case "l":E.left=-D+"px";break;case "r":E.right=-D+"px"}else if(F)switch(S){case "t":z.top=-B+"px";break;case "b":z.bottom=
-B+"px"}else switch(O){case "l":z.left=-D+"px";break;case "c":switch(S){case "t":z.top=-B+"px";break;case "b":z.bottom=-B+"px"}break;case "r":z.right=-D+"px"}"mc"===p?(p={width:"100%",height:n.getDocumentScrollHeight()+"px"},f.extend(E,p),f.extend(I,p),p={},b.on(r),f.extend(z,p)):(M&&u&&(l.dataset.haltWidthResizing=!0,p={width:H+"px"},f.extend(E,p),f.extend(I,p)),p={width:D+"px",transition:"none"},f.extend(z,p),p.transition=k.dataset.originalTransition);f.extend(Q,p);C&&(p={left:0},f.extend(z,p),
f.extend(Q,p));setTimeout(function(){n.changeStyle(l,E);n.changeStyle(k,z);n.changeStyle(h,K);setTimeout(function(){n.changeStyle(l,I);n.changeStyle(k,Q);n.changeStyle(h,N);M&&t(void 0,!0);setTimeout(function(){d.messageCenter.sendMessage(e,{type:"opening"}).then(function(a){f.triggerCustomEvent(h,"OPF:opened",{formUID:e})})},1);c.afterPlaceModal.apply(this,A)},1)},1)},afterPlaceModal:function(a,b,c,g,e,l){b=d.getInstanceSettings(a.GUID);!f.sense.isMobileDevice&&b.includeAd&&(a="bottom","b"===(b.popPosition||
"mc").charAt(0)&&(a="top"),b=d.make.poweredByONTRAformsElement(b.referralGetParams,{type:"modal",displayPosition:a}),"top"===a?g.insertBefore(b,e):g.appendChild(b))},verticallyCenter:function(a){-1===r.indexOf(a)&&r.push(a);g(void 0,!0)},stopVerticallyCentering:function(a){a=r.indexOf(a);-1!==a&&r.splice(a,1)},hasModalOpenThatRequiresOverlay:function(){var a=!1,b,c;for(b in e)if(c=e[b],"mc"===c.dataset.popposition){a=!0;break}return a}};if(!window.isONTRAform){var u=!1;f.sense.isMobileDevice&&(u=
!0);u&&f.addListener(window,"touchend",g);f.addListener(window,"scroll",g);f.addListener(window,"resize",f.debounce(l,100))}return q}(),b=function(){var a=!1,b={element:document.createElement("div"),loadingElement:document.createElement("div"),overlayGUID:n.makeGUID("overlay__"),loadingOverlayGUID:n.makeGUID("overlay--loading__"),isActive:function(){return a},on:function(c){a||(c||(c={}),n.changeStyle(b.element,{display:"block",opacity:c.overlay||1}),a=!0)},off:function(){n.changeStyle(b.element,
{display:"none"});a=!1},setLoadingOverlay:function(a){}};n.updateAttrs(b.element,{id:b.overlayGUID,"class":"opf__overlay",style:{top:0,width:"100%",height:"100%",display:"none",position:"fixed",padding:0,margin:0,"z-index":c.startingZindex,"background-color":"rgba( 0, 0, 0, .5 )"}});f.addListener(b.element,"click",b.closeTopmostElement);document.body.appendChild(b.element);return b}(),h=function(){var a=[],b=function(a){return function(b){return d.getInstanceSetting(a,b)}},e={poweredByONTRAformsElement:function(a,
b){b||(b={});var c=document.createElement("a"),d=document.createElement("img"),e={href:"https://ontrapages.com"+(a?"?"+a:""),style:{"margin-top":"6px"}},h={src:"https://optassets.ontraport.com/opt_assets/drivers/ONTRAforms/powered-by-ontraforms.png",style:{display:"block !important"}};"modal"===b.type&&(f.extend(e.style,{position:"absolute"}),f.extend(h.style,{position:"relative",left:"-121px"}),"top"===b.displayPosition&&f.extend(h.style,{top:"-32px"}));n.updateAttrs(c,e);n.updateAttrs(d,h);c.appendChild(d);
return c},iframe:function(){f.parseGetVars();return function(a,b){var c=document.createElement("iframe"),e=a("uid"),h=a("GUID"),k=document.location.origin||document.location.href.slice(0,-1),k={uid:e,formType:b,formGUID:h,unique_visit:a("unique_visit"),referer:encodeURIComponent(k+document.location.pathname),formceptionID:d.getFormceptionID(),__opv:"v1"},h=d.getInstance(h);window.hasOwnProperty("_opt_lpid")&&(k.lpid=window._opt_lpid);h.preview&&(k.preview="true");h.opfDebug&&(k.opfDebug="true");k=
f.stringifyParamObject(k);n.updateAttrs(c,{frameborder:0,scrolling:"no",id:e,src:I+V+"?"+k,style:{display:"block",position:"relative",width:a("formWidth"),transition:"height .25s ease-in-out, width 1s ease-in-out",margin:0}});return c}}(),embeddedForm:function(a,c){d.getInstanceSetting(a.GUID,"uidInstance");var q=b(a.GUID),h=e.iframe(q,"embed"),f=q("formHeight")||200,q=q("formWidth");n.updateAttrs(h,{"class":"OPF__embedded-form",style:{width:q,height:f+"px"}});return h},modalForm:function(){var a=
{closeButton:function(){var a=document.createElement("div"),b=document.createTextNode("\u00d7"),c=document.createElement("span");n.changeStyle(c,{position:"relative",top:"8px","font-size":"20px","font-weight":"bold","font-family":"Arial, sans-serif"});c.appendChild(b);a.appendChild(c);n.updateAttrs(a,{"class":"OPF__modal-form__close-button",title:"Close",style:{opacity:0,"z-index":10,width:"16px",height:"16px","float":"right",cursor:"pointer","line-height":0,margin:0,padding:"4px",top:"-18px",right:"-18px",
"text-align":"center","box-shadow":"1px 1px 3px rgba( 77, 77, 77, .3 )","box-sizing":"initial",position:"absolute","border-radius":"100%","background-color":"#fff"}});a.dataset.originalStyles=a.getAttribute("style");f.addListener(a,"click",function(a){d.modal.closeAll();a.stopPropagation();return!1});return a},formWrapper:function(a,b){var c="opacity .5s ease-in-out, top .3s ease-in-out, bottom .3s ease-in-out, left .3s ease-in-out, right .3s ease-in-out";f.sense.isSafari||(c=a.style.transition+", "+
c);var d=document.createElement("div");n.updateAttrs(d,{"class":"OPF__modal-form__wrapper",style:{opacity:0,padding:0,margin:"0 auto",position:"relative",display:"inline-block","box-shadow":"0px 10px 60px 10px rgba( 0, 0, 0, 0.2 )","box-sizing":"content-box",transition:c}});return d},formModal:function(b,d,e){var h=document.createElement("div");e=a.formWrapper(d,e);var k=a.closeButton();e.appendChild(k);n.updateAttrs(d,{"class":"OPF__modal-form__iframe",style:{width:"100%",transition:d.style.transition+
", opacity .3s ease-in-out",margin:0}});e.appendChild(d);h.appendChild(e);n.updateAttrs(h,{id:b,"class":"OPF__modal-form",style:{top:0,margin:0,padding:0,width:"100%",display:"block","text-align":"center",position:"absolute",height:n.getDocumentScrollHeight()+"px",transition:"opacity .5s ease-in-out .15s, left .3s ease-in-out, right .3s ease-in-out"}});f.addListener(h,"click",c.closeTopmostElement);return h}};return function(c){c=c.GUID;d.getInstanceSetting(c,"uidInstance");var h=b(c),h=a.formModal(h("uidInstance"),
e.iframe(h,"modal"),h);h.dataset.guid=c;return h}}()},h=function(){var b={},l=[];return{getTopmostForm:function(){return c.getTopmostElement()},_createForm:function(c,d){var h=e.modalForm(d);a.push(c);return b[c]=h},_openForm:function(a){var d=a.uid,e,f;f=c.hasOpened(d)?b[d]:h.preloadForm(a);e=l.indexOf(d);-1!==e&&l.splice(e,1);c.openFormModal(a,d,f);h._changeHandler()},preloadForm:function(a){var b=a.uid,d;c.hasOpened(b)||(l.push(b),d=h._createForm(b,a),c.prepare(b,d),p("modal.preloadForm() :: Preloading %s",
b));return d},openForm:function(a,b){window.isONTRAform?p("modalDrivers.modal.openForm() :: FORMCEPTION!!"):(p("modalDrivers.modal.openForm() :: opening form"),h._openForm(a))},_closeFormByUID:function(a){c.removeElement(a);d.markFormFillout(void 0,a)},_closeForm:function(a){h._closeFormByUID(a.uid);h._changeHandler()},closeForm:function(a){p("modalDrivers.modal.closeForm() :: closing form");h._closeForm(a)},_changeHandler:function(){},closeAllForms:function(){for(var b,c=[],d=0,g=a.length;d<g;++d)b=
a[d],-1===l.indexOf(b)&&c.push(b);for(p("modalDrivers.modal.closeAllForms() :: Closing all forms %o",c);b=c.shift();)h._closeFormByUID(b);return l.slice()}}}(),t={init:function(a,b,c){a=f.sense.isMobileDevice;var h=d.getInstanceSettings(c.formGUID),k=0===+c.borderActive?!1:!0,m=k?n.getValue(c.borderSize):0,r=h.popPosition,t=a?"100%":c.formWidth,y=n.valueIsGTOE100Percent(t),v=+c.formHeight,w={width:t,border:""};if(!v||isNaN(v))v=0;else if(-1!==t.indexOf("%")||a)v=~~(v/2);if(60>v||a)v=60;+c.borderActive&&
(w.border=c.borderSize+" solid "+c.borderColor);a&&(w.border="none !important");if("embed"===c.formType)w.height=v+"px",n.changeStyle(b,w),h.includeAd&&b.parentNode.appendChild(e.poweredByONTRAformsElement(h.referralGetParams));else{var h=b.querySelector(".OPF__modal-form__wrapper"),C=h.querySelector(".OPF__modal-form__iframe"),B=h.querySelector(".OPF__modal-form__close-button"),t={width:t},x={opacity:1},F=n.getValue(B.style.top),H=n.getValue(B.style.right),m=m-5,G=!1,I=!1,D=!1,v=v+"px";n.changeStyle(h,
w);n.changeStyle(b,{overflow:"hidden"});n.changeStyle(C,{height:v});c.borderActive&&f.extend(x,{top:F-m,right:H-m});if(a||y)f.extend(t,{width:"100%","box-sizing":"border-box"}),G=D=!0;"mc"!==r&&(G=!0,y||(I=!0));G&&(I&&(k?(x.top+=B.clientHeight,x.right+=B.clientWidth):D=!0),D&&f.extend(x,{top:a?6:4,right:4}),f.extend(x,{"background-color":"rgba( 0, 0, 0, .3 )",border:"2px solid #fff",color:"#fff"}));n.changeStyle(h,t);x.top+="px";x.right+="px";n.changeStyle(B,x);h.dataset.originalTransition=h.style.transition;
C.dataset.originalTransition=C.style.transition}p("iframeAgentHandlers.init() :: Apply serverData %s",JSON.stringify(c))},domReady:function(a,b,c){p("iframeAgentHandlers.domReady() :: Fin","")},windowLoad:function(a,b,c){b.setAttribute("data-init-complete",!0)},resize:function(a,b,c){a=+c.formHeight+"px";var d={};c.embedded?(d=f.extend(d,{height:a}),n.changeStyle(b,d)):(b=b.querySelector(".OPF__modal-form__iframe"),c={},f.extend(c,{height:a,transition:b.dataset.originalTransition}),n.changeStyle(b,
c))},formProcessorHandler:function(a){var b=a.data.message,c=a.extra_data,e={contact_id:c&&c.cid};p("formProcessorHandler() :: with message "+b);d.trackingData(e);window.isONTRAform&&(c&&(p("formProcessorHandler() :: with extra_data "+c),d.formceptionRemember(c)),y.post({type:"syncTrackingDataParentToChild",data:e}));var c=function(a){var b=h(a),c=function(){d.openUID(b);$(document.body).children(".moonrayUILockerOverlay, .moonrayUILockerMessage ").fadeOut(200,function(){$(this).remove()})};b&&(d.openUID(b),
setTimeout(function(){try{c()}catch(a){}},1E3));return b},h=function(a){var b=document.querySelectorAll("form"),c=W?"forms.ontrapages.com?":"form_processor.php?",d=a&&a.extra_data&&a.extra_data.uid&&a.extra_data.uid.indexOf(".bid");if(null!=d&&-1!==d&&1<b.length)for(var d=a.extra_data.uid.substr(d+4),g=0,e=b.length;g<e;g++){if(a=b[g],f.actionParamsToObj(a,c).block_id===d){b=a;break}}else b=b[0];c=b.getAttribute("target");return(b=b.parentNode.querySelector("iframe[name='"+c+"']"))&&b.getAttribute("data-opf-success-trigger")};
switch(a.data.type){case "redirect":case "route":window.isONTRAform&&(d.markFormFillout(a),c(a)||(p("formProcessorHandler redirecting to "+b),y.post({type:"windowUnload",newLocation:b})));f.triggerCustomEvent(document.body,"moonray.uiLockerV2");!window.isONTRAform&&a.extra_data&&a.extra_data.force_redirect&&t.windowUnload(b);setTimeout(function(){$('input[value="'+a.extra_data.uid+'"]').closest("form").removeAttr("data-disabled")},500);break;case "submit":if(!window.isONTRAform){var k=h(a);k&&(p("formProcessorHandler() :: submitting with extra_data "+
JSON.stringify(a.extra_data)),d.messageCenter.sendMessage(k,{type:"updateFormceptionData",data:a.extra_data}).then(function(){d.openUID(k)}))}}},windowUnload:function(a){document.location.href=a},redirectIfVisible:function(a,b){var d=b.formUID;("embed"===b.formType||c.isFormOpen(d))&&t.windowUnload(a)},internalMessage:function(){d.messageCenter.fulfill.apply(this,Array.prototype.slice.call(arguments))}};f.XD.receiveMessage(function(a){a="string"===typeof a.data?JSON.parse(decodeURIComponent(a.data)):
a.data;if(!a||a.type){var b=a._serverData;if(b){var e="embed"===b.formType,h=b.formUID,k=b.formGUID,f=e?d.getInstanceSetting(k,"embeddedElem"):c.getElementFromUID(h),m={formWidth:b.formWidth,formHeight:b.formHeight,borderActive:b.borderActive,borderSize:b.borderSize,borderColor:b.borderColor,includeAd:"1"===b.includeAd,referralGetParams:b.referralGetParams};d.setInstanceSettings(k,m);d.setFormSettings(h,m);H.setItem(h,{formWidth:b.formWidth,formHeight:b.formHeight})}p("iframeAgent() :: Captured event type '%s'",
a.type);switch(a.type){case "init":t.init(h,f,b);break;case "domReady":t.domReady(h,f,{serverData:b,formWidth:b.formWidth,embedded:e});break;case "windowLoad":t.windowLoad(h,f,b);break;case "formProcessorMessage":t.formProcessorHandler(a);break;case "windowUnload":t.windowUnload(a.newLocation);break;case "redirectIfVisible":t.redirectIfVisible(a.newLocation,b);break;case "resize":t.resize(h,f,{embedded:e,formHeight:a.formHeight,formGUID:b.formGUID,borderActive:b.borderActive,borderSize:b.borderSize,
formWidth:b.formWidth});break;case "bubbleCookieData":t.bubbleCookieData(a.cookieData);break;case "inputFocus":t.inputFocus(f);break;case "inputBlur":t.inputBlur(f);break;case "preloadUID":d.preloadUID(a.formUID);break;case "formception":d.openUID(a.formceptionUID,!0);break;case "formFillout":d.markFormFillout(b);break;case "OPFlog":p(a.msg,a.data);break;case "internalMessage":t.internalMessage(a);break;case "closeAll":d.modal.closeAll();break;case "syncTrackingDataParentToChild":d.trackingData(a.data)}}},
I);return{openForm:h.openForm,closeForm:h.closeForm,closeAllForms:h.closeAllForms,preloadForm:h.preloadForm,make:e}}(),e=function(){var a=!1,e=[],f={isActive:function(){return a},nudge:function(){var a,d;e.length&&void 0===c.getTopmostElement()&&(a=e[e.length-1],(d=C[a].count)&&1===d&&c.sendUIDtoTop(a));c.hasModalOpenThatRequiresOverlay()||b.off()},_changeHandler:function(b,c){(a=0===e.length)?f.teardown():f.nudge()},teardown:function(){b.off()},_addInstance:function(a,b){d.getInstanceSetting(a.GUID,
"uidInstance")&&(-1===e.indexOf(a.uid)&&e.push(a.uid),h.openForm(a,b),f._changeHandler())},activateInstance:function(a){var b=a.data&&a.data.formInstance;b?f._addInstance(b,a.data):a.data.formUID&&d.openUID(a.data.formUID)},_removeInstance:function(a,b){var c=a.getAttribute("id"),c=d.getInstanceFromUIDinstance(c),k;c&&(k=e.indexOf(c.uid),-1!==k&&e.splice(k,1),h.closeForm(c),f._changeHandler())},deactivateInstance:function(a){if(a.data){var b=a.data.formInstance;a.data.closeAll?f._removeAllInstances():
f._removeInstance(b)}},_removeAllInstances:function(){0!==e.length&&(h.closeAllForms(),e=[],f._changeHandler())},removeAll:function(){f._removeAllInstances()},preloadGUID:function(a){a=d.getInstance(a);h.preloadForm(a)}};return{preload:f.preloadGUID,openForm:f.activateInstance,closeForm:f.deactivateInstance,closeAll:f.removeAll}}();f.addListeners(document.body,{"OPF:open":e.openForm,"OPF:close":e.closeForm});return{popForm:function(a,b,c){f.triggerCustomEvent(a.elem||document.body,"OPF:open",{formInstance:a,
forceOpen:b,closeOthers:c})},make:h.make,isFormOpen:c.isFormOpen,isAnythingOpen:c.isAnythingOpen,getOpenForm:c.getTopmostElement,lastOpenFormUID:null,preload:e.preload,closeAll:e.closeAll}}(),d={modal:F,make:F.make,setInstanceSetting:function(a,c,b){w[a].settings[c]=b},setInstanceSettings:function(a,c){f.extend(w[a].settings,c)},getInstanceSetting:function(a,c){return w[a].settings[c]},getInstanceSettings:function(a){return f.extend({},d.getInstance(a).settings)},getFormSettings:function(a){return f.extend({},
C[a])},setFormSetting:function(a,c,b){C[a][c]=b},setFormSettings:function(a,c){f.extend(C[a],c)},getInstance:function(a){return w[a]||{}},getFormUID:function(a){return w[a].uid},getScriptElemFromGUID:function(a){(a=w[a].scriptElem)||p("comp.getScriptElemFromGUID() :: No scriptElem... possibly preloaded via Click to Pop.","");return a},getInstanceFromUIDinstance:function(a){a=d.getFormGUIDfromUIDinstance(a);return d.getInstance(a)},getFormGUIDfromUIDinstance:function(a){for(var c in w)if(d.getInstanceSetting(c,
"uidInstance")===a)return c},getFirstFormGUIDfromUID:function(a){var c,b;for(c in w)if(b=w[c],b.uid===a)return c},getEmbeddedFormInstances:function(){for(var a=[],c=f.getObjectKeys(w),b=c.length,h=0,e;h<b;++h)e=c[h],(e=d.getInstanceSettings(e))&&e.embeddedElem&&a.push(e.uid);return a},checkPopEligibility:function(){var a=K.QuickStorage({syncKey:"OPF_HISTORY",expiry:(new Date).setHours(24,0,0,0)}),c=function(a){return d.getInstanceSetting(a,"uidInstance")+"__triggerCount"};return function(b,h){var e=
+new Date,f=d.getFormUID(b),m=c(b),A=a.getItem(m,!0),r=d.getInstanceSettings(b),t=r.timeframe,g=A.lastChange,l=r.maxTriggers,A=A.value,q=!1,u=g+t;-1!==g&&t?u&&e>u&&(q=!0,a.removeItem(m),p("checkPopEligibility() :: %s Eligible timeframe expired. TriggerCount reset.",b)):q=!0;null===A&&(q=!0,A=0);q&&d.setInstanceSetting(b,"unique_visit",!0);if(+A>=+l)return p("checkPopEligibility() :: '"+b+"' has reached the maxTriggers threshold."),!1;if(d.modal.isFormOpen(f))return p("checkPopEligibility() :: '"+
b+"' is already open."),!1;if(r.filloutRestricted&&(p("checkPopEligibility() :: %s fillout is restricted... checking if completed before.",b),f=r.uidInstance,e=!1,f&&(f=H.getItem(f))&&f.completed&&(e=!0),e))return p("checkPopEligibility() :: %s has been filled out. Aborting.",b),!1;if(r._locked)return p("checkPopEligibility() :: '"+b+"' is locked for another %s seconds.",n.getSecondsUntil(r._lockedUntil)),!1;h&&(r=A,a.setItem(c(b),++r));return!0}}(),popForm:function(a,c,b){if(c||d.checkPopEligibility(a,
!0)){p("popForm() :: Closing the UI locker",a);f.triggerCustomEvent(document.body,"moonray.uiLockerV2");p("popForm() :: Popping %s",a);var h=d.getInstance(a);f.readCookie("form_"+h.uid)?d.setInstanceSetting(a,"unique_visit",!1):(d.setInstanceSetting(a,"unique_visit",!0),f.createCookie("form_"+h.uid,"1"));d.modal.lastOpenFormUID=h.uid;d.modal.popForm(h,c,b);return!0}return!1},popFormOncePerTimeframe:function(a){d.popForm(a)&&d.setInstanceSetting(a,"lockAfterOpen",!0)},registerEvents:function(){var a=
[],c={filloutRestrictions:20,instance:10,formWidth:5,formHeight:5,popPosition:5,borderSize:1,borderActive:1,borderColor:1,timeframe:1,maxTriggers:1},b;for(b in c)a.push(b);a.sort(function(a,b){return c[a]<c[b]});return function(b,c,d){var m;d=f.extend(!0,{instance:"default",formWidth:"480px",formHeight:100,popPosition:"mc"},H.getItem(b),d);for(var p=0,n=a.length;p<n;++p){m=a[p];if(b=d[m]){var t=N[a[p]];t&&t(c,b)}delete d[m]}if(d.embed)N.embed(c,d);else for(m in d)b=d[m],(p=N[m])&&p(c,b)}}(),createFormInstanceGUID:function(){return n.makeGUID("OPF_")},
_registerInstance:function(a,c,b,h){C[a]||(C[a]={count:0});++C[a].count;w[c]=f.extend(!0,h,{uid:a,GUID:c,opfDebug:h&&h.scriptElem.dataset.opfDebug,preview:b&&b.preview,settings:{uid:a,GUID:c,overlay:b&&b.overlay}});d.registerEvents(a,c,b)},register:function(a,c){var b=d.createFormInstanceGUID();d._registerInstance(a,b,c);return b},registerScriptElem:function(){var a=1,c=function(a,c){if(void 0===c)return a.dataset._opfRegisterGuid;a.dataset._opfRegisterGuid=c};return function(b){if(!(!b||c(b)||5<
a)){++a;var h=b.dataset.opfUid,e=d.createFormInstanceGUID(),f=n.getOpfParams(b);c(b,e);d._registerInstance(h,e,f,{scriptElem:b})}}}(),openUID:function(a,c){if(window.isONTRAform)p("openUID() :: posting formception message with UID "+a),y.post({type:"formception",formceptionUID:a});else{var b=d.getFirstFormGUIDfromUID(a);p("openUID() :: got GUID "+b+" from UID "+a);b||(b=d.register(a));d.openGUID(b,c)}},openGUID:function(a,c){d.popForm(a,!0,c)},handleTriggerClick:function(a){if(a){var c=a.dataset.opfTriggerGuid;
c?d.openGUID(c):(c=a.dataset.opfTrigger)&&d.openUID(c)}},handleElemWindowUnload:function(){return function(a){if(window.isONTRAform)switch(a.nodeName){case "A":if("_self"===a.getAttribute("target"))return a=a.getAttribute("href"),y.post({type:"windowUnload",newLocation:a}),!0}return!1}}(),markFormFillout:function(a,c){if(window.isONTRAform)y.post({type:"formFillout"});else{var b="",h=!1;a?b=a.formGUID:c&&(b=d.getFirstFormGUIDfromUID(c));b&&(h=d.getInstanceSetting(b,"filloutRestricted"))&&(b=d.getInstanceSetting(b,
"uidInstance"),H.setItem(b,{completed:1}))}},preloadUID:function(a){if(window.isONTRAform)y.post({type:"preloadUID",formUID:a});else{var c=d.getFirstFormGUIDfromUID(a);c||(c=d.register(a));d.modal.preload(c);return c}},preloadFormTriggers:function(a,c){var b,h;void 0===c&&(c=0);if(a&&a.length){b=a[c];if(h=b.dataset.opfTrigger)h=d.preloadUID(h),b.dataset.opfTriggerGuid=h;a[++c]&&setTimeout(function(){d.preloadFormTriggers(a,c)},100)}},getFormceptionID:function(){var a=window.isONTRAform?y.formceptionID:
"formception-"+f.guid();return function(){return a.slice()}}(),rememberFields:function(){var a=["email","firstname","lastname"];return function(c){var b=H.getItem("rememberFields")||{},d=c||document.body.querySelector("form"),e=a.length,f=0,m,p,n;if(d&&d.length&&-1===window.location.href.indexOf("preview=true")){for(;f<e;++f)m=a[f],(n=(p=d.querySelector("input[name='"+m+"']"))&&p.value)?b[m]=n:p&&b&&b[m]&&p.setAttribute("value",b[m]);c&&H.setItem("rememberFields",b)}}}(),formSubmitHandler:function(a,
c,b){if(c.hasAttribute("data-disabled")||0==$(c).data("validator").checkValidity())return a.preventDefault(),!1;c.setAttribute("data-disabled","");(a=b.getAttribute("data-opf-success-trigger"))&&d.preloadUID(a);d.rememberFields(c)},formceptionRemember:function(a){a||(a={});a.hasOwnProperty("object_type_id")?d.FORMCEPTION_HISTORY_STORE.setItem("object_type_id_"+a.object_type_id,a):p("comp.formceptionRemember() :: extra_data.object_type_id must be supplied.",a)},syncFormAction:function(){var a=W?"forms.ontrapages.com?":
"form_processor.php?",c=d.FORMCEPTION_HISTORY_STORE.getItem("object_type_id_"+(y.object_type_id||0));if(c=c&&c.cid){p("syncFormAction syncing possibleCID "+c);var b=document.querySelectorAll("form[action*='"+a+"']"),h=b.length,e=0,k,m,n,r=encodeURIComponent(document.location.origin+document.location.pathname);for(p("syncFormAction there are this many formElems "+h);e<h;++e)m=(k=b[e])&&k.getAttribute("action"),n=m.split(a),m=f.parseParamString(n[1]),m.cid=c,m.referer=r,n[1]=f.stringifyParamObject(m),
m=n.join(a),p("syncFormAction the action is "+m),k.setAttribute("action",m)}else p("syncFormAction no possibleCID, so no syncing.")},formOpened:function(a){var c=d.getFirstFormGUIDfromUID(a),b=d.getInstance(c),c=1==d.getInstanceSetting(c,"unique_visit"),b={action:"log_visit",uid:a,uniqueVisit:c,sess_:f.readCookie("sess_"),preview:b.preview};return d.messageCenter.sendMessage(a,{type:"formOpened",data:b})},syncTrackingData:function(a){for(var c=d.trackingData(),b=0,f=a.length,e;b<f;++b)e=a[b],d.messageCenter.sendMessage(e,
{type:"updateTrackingData",data:c})},trackingData:function(a){var c={utm_source:"",utm_medium:"",utm_term:"",utm_content:"",utm_campaign:"",oprid:"",afft_:"",aff_:"",ref_:"",own_:"",sess_:"",referral_page:"",contact_id:""},b=f.getObjectKeys(c);if(void 0===a){for(var d=0,e=b.length,k;d<e;++d)a=b[d],k=f.readCookie(a),null!==k&&(c[a]=encodeURIComponent(k));c.referral_page=window.isONTRApage&&""!==document.referrer?encodeURIComponent(document.referrer):encodeURIComponent(document.location.origin+document.location.pathname);
f.createCookie("referral_page",c.referral_page);return c}for(var d=0,e=b.length,m;d<e;++d)c=b[d],a.hasOwnProperty(c)&&(m=void 0,k=a[c],""===k&&(m=-1),f.createCookie(c,k,m))},messageCenter:function(){var a={};return{waitFor:function(c,b,d,e,f){a[c]={success:b,fail:d,always:function(){e&&f&&e.contentWindow.location.replace(f)}}},fulfill:function(c){var b=a[c.receipt];b?(c.success?b.success(c.data):b.fail(c.data),b.always(c.data),delete a[c.receipt]):p("no soup for you :(","")},init:function(){window.isONTRAform&&
(d.messageCenter.handleMessage(),f.addListener(window,"hashchange",d.messageCenter.handleMessage))},sendMessage:function(a,b){var f=document.getElementById(a),e=f&&f.getAttribute("src"),k=n.makeGUID("opf-message"),m;m=encodeURIComponent(JSON.stringify({receipt:k,type:b.type,data:b.data}));if(e)setTimeout(function(a,b,c){a=a.replace(/#!+/,"");b.contentWindow.location.replace(a+"#!"+c)}.bind(this,e,f,m),1),m=new Promise(function(a,b){d.messageCenter.waitFor(k,a,b,f,e+"#!")});else return window.parent.postMessage(m,
"*"),new Promise(function(a){a()});return m},handleMessage:function(){var a=function(a){function c(a,b){k=!1;y.post({success:0===a,receipt:e,formUID:y.formUID,formGUID:y.formGUID,type:"internalMessage",data:b})}var e=a.receipt.slice(),k=!0;switch(a.type){case "resize":y.events.resize();c(0,{formHeight:y.utils.getDocumentHeight()});break;case "updateTrackingData":for(var m="contact_id afft_ aff_ ref_ own_ sess_ utm_source utm_medium utm_term utm_content utm_campaign referral_page oprid".split(" "),
n=0,r;m.length>n;n++)r=document.body.querySelectorAll('form input[name="'+m[n]+'"]'),r.length&&r[0].setAttribute("value",a.data[m[n]]);d.trackingData(a.data);break;case "updateFormceptionData":p("handleMessage::updateFormceptionData data "+a.data);d.formceptionRemember(a.data);d.syncFormAction();break;case "resetVideo":a=document.body.querySelectorAll("[opt-block-type-id='6'] iframe, [opt-block-type-id='6'] video,[opt-block-type-id='29'] iframe, [opt-block-type-id='29'] video");m=null;r="";for(var n=
0,t=a.length;n<t;n++)m=a[n],r="VIDEO"===m.tagName?m.currentSrc:m.src,m.src="",m.src=r;break;case "closing":f.triggerCustomEvent(document.body,"OPF:closing",{});break;case "opening":f.triggerCustomEvent(document.body,"OPF:opening",{});break;case "formOpened":f.createCookie("sess_",a.data.sess_),delete a.data.sess_,n=f.stringifyParamObject(a.data),a=new XMLHttpRequest,a.open("GET",I+V+"?"+n),a.send(null)}k&&c(0,{fin:!0})};return function(b){var d,e,f,m,n=document.location.hash;b&&b.newURL&&(n=b.newURL);
n&&(n=n.replace(/^.*#!+/,""));if(n&&0!==n.length)try{for(d=decodeURIComponent(n),e=d.split("}#!{").join("}{{SPLIT_ON_THIS}}{").split("{{SPLIT_ON_THIS}}"),f=0,m=e.length;f<m;++f)d=JSON.parse(e[f]),p("messageCenter.handleMessage.handle() the message "+e[f]),a(d)}catch(r){p("messageCenter.handleMessage.handle() :: originalMessage is not valid JSON.","")}else p("messageCenter.handleMessage.handle() no hash to process.")}}()}}()};window.isONTRAform&&(d.FORMCEPTION_HISTORY_STORE=K.QuickStorage({syncKey:d.getFormceptionID(),
onUpdate:d.syncFormAction}));f.addListener(document.body,"click",function(a){for(var c=a.target||a.srcElement,b,f,e=!1;void 0===b&&c!==this;)c&&"A"===c.nodeName&&(f=c),b=c&&c.dataset&&c.dataset.opfTrigger,void 0===b&&(c=c.parentNode);b?(d.handleTriggerClick(c),e=!0):f&&(e=d.handleElemWindowUnload(f));if(e)return a.preventDefault(),!1});x(function(){var a=document.querySelectorAll("form[data-opf-watch-submit]"),c,b,h,e,k,m,n,r=f.parseParamString(document.location.search);c=0;for(b=a.length;c<b;++c)n=
!1,h=a[c],k=h.getAttribute("action"),e=h.getAttribute("target"),e=h.parentNode.querySelector("iframe[name*='"+e+"']"),window.isONTRAform?(m=y.viaLPID,n=!0,m&&(k=k.replace("lpid=&","lpid="+m+"&"))):e&&null!==e.getAttribute("data-opf-success-trigger")&&(n=!0),n&&(k+="&_lightResponse=true",h.setAttribute("action",k)),r.referer&&(k+="&referer="+r.referer,h.setAttribute("action",k)),p("domReady the formAction "+k),e?(f.addListener(h,"submit",function(a,b,c){return function(d){a.formSubmitHandler(d,b,c)}}(d,
h,e)),f.addListener(h,"keyup",function(a){return function(b){13===b.keyCode&&"TEXTAREA"!==b.target.nodeName&&a.querySelector("input[type=submit]").click()}}(h))):p("form[data-opf-watch-submit] failed to find it's corresponding target elem... uh oh.","")});window.isONTRAform?f.addListener(document.body,"mouseover",function(a){a=a.target||a.srcElement;for(var c;void 0===c&&a!==this;)c=a&&a.dataset&&a.dataset.opfTrigger,c||(a=a.parentNode);c&&d.preloadUID(c)}):f.addListener(window,"load",function(){setTimeout(function(){var a=
document.querySelectorAll("[data-opf-trigger]");d.preloadFormTriggers(a)},100)});window.isONTRAform&&(d.syncFormAction(),f.addListener(window,"unload",function(){d.FORMCEPTION_HISTORY_STORE.destroy()}));window.isONTRAform&&d.rememberFields();d.messageCenter.init();window.isONTRAform||(x=f.once(function(){var a=d.getEmbeddedFormInstances();d.modal.lastOpenFormUID&&(a=a.concat([d.modal.lastOpenFormUID]));d.syncTrackingData(a)}),null!==document.body.getAttribute("data-op-tracked")?x():f.addListener(document.body,
"opTrackingComplete",x),f.addListener(document.body,"OPF:opened",function(a){p("received OPF:opened for "+(a.data&&a.data.formUID));var c=a.data&&a.data.formUID;c&&d.syncTrackingData([c]);setTimeout(function(){d.formOpened(a.data.formUID)},100)}));if(f.sense.isMobileDevice)for(var x=document.body.querySelectorAll("input[class~='opt-date-field']"),F=0,B;F<x.length;F++)B=x[F],B.type="date",B.setAttribute("onfocus",""),B.setAttribute("onblur",""),B.setAttribute("value",""),B.value="",f.addListener(B,
"change",function(a){a.target.setAttribute("value",a.target.value)});return{nudge:function(){for(var a=n.getAllForms(),c=0,b=a.length,f;c<b;++c)f=a[c],d.registerScriptElem(f)},open:d.openUID,register:function(a,c){d.register(a,c)},registerLogger:function(a){p=function(c,b){return function(c,d){a(c,d);b(c,d)}}(a,p)},startTime:G,sync:d.syncFormAction,messageCenter:d.messageCenter}}(),window.__OPF=G);G.nudge()})();
