1 2 3/* ==== INCLUDE: /js/blocks.js ==== */ 4 5LazyLoad=function(a){function h(b,c){var e,d=a.createElement(b);for(e in c)c.hasOwnProperty(e)&&d.setAttribute(e,c[e]);return d}function i(a){var c,g,b=d[a];b&&(c=b.callback,g=b.urls,g.shift(),e=0,g.length||(c&&c.call(b.context,b.obj),d[a]=null,f[a].length&&k(a)))}function j(){var c=navigator.userAgent;b={async:a.createElement("script").async===!0},(b.webkit=/AppleWebKit\//.test(c))||(b.ie=/MSIE|Trident/.test(c))||(b.opera=/Opera/.test(c))||(b.gecko=/Gecko\//.test(c))||(b.unknown=!0)}function k(e,g,k,n,o){var s,t,u,v,w,x,p=function(){i(e)},q="css"===e,r=[];if(b||j(),g)if(g="string"==typeof g?[g]:g.concat(),q||b.async||b.gecko||b.opera)f[e].push({urls:g,callback:k,obj:n,context:o});else for(s=0,t=g.length;s<t;++s)f[e].push({urls:[g[s]],callback:s===t-1?k:null,obj:n,context:o});if(!d[e]&&(v=d[e]=f[e].shift())){for(c||(c=a.head||a.getElementsByTagName("head")[0]),w=v.urls.concat(),s=0,t=w.length;s<t;++s)x=w[s],q?u=b.gecko?h("style"):h("link",{href:x,rel:"stylesheet"}):(u=h("script",{src:x}),u.async=!1),u.className="lazyload",u.setAttribute("charset","utf-8"),b.ie&&!q&&"onreadystatechange"in u&&!("draggable"in u)?u.onreadystatechange=function(){/loaded|complete/.test(u.readyState)&&(u.onreadystatechange=null,p())}:q&&(b.gecko||b.webkit)?b.webkit?(v.urls[s]=u.href,m()):(u.innerHTML='@import "'+x+'";',l(u)):u.onload=u.onerror=p,r.push(u);for(s=0,t=r.length;s<t;++s)c.appendChild(r[s])}}function l(a){var b;try{b=!!a.sheet.cssRules}catch(c){return e+=1,void(e<200?setTimeout(function(){l(a)},50):b&&i("css"))}i("css")}function m(){var b,a=d.css;if(a){for(b=g.length;--b>=0;)if(g[b].href===a.urls[0]){i("css");break}e+=1,a&&(e<200?setTimeout(m,50):i("css"))}}var b,c,d={},e=0,f={css:[],js:[]},g=a.styleSheets;return{css:function(a,b,c,d){k("css",a,b,c,d)},js:function(a,b,c,d){k("js",a,b,c,d)}}}(this.document); 6 7window.nanoid=(t=21)=>{let e="",r=crypto.getRandomValues(new Uint8Array(t));for(;t--;){let n=63&r[t];e+=n<36?n.toString(36):n<62?(n-26).toString(36).toUpperCase():n<63?"_":"-"}return e}; 8 9!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(n=n||self).TypeIt=t()}(this,(function(){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(t)}var t={strings:[],speed:100,cursor:!0,cursorChar:"|",cursorSpeed:1e3,deleteSpeed:null,lifeLike:!0,breakLines:!0,startDelay:250,startDelete:!1,nextStringDelay:750,loop:!1,loopDelay:750,html:!0,waitUntilVisible:!1,beforeString:function(){},afterString:function(){},beforeStep:function(){},afterStep:function(){},afterComplete:function(){}},e=function(n){return n.map((function(n){return void 0===n[1]&&n.push(null),void 0===n[2]&&n.push({}),n}))},r=function(n,t){return Object.assign({},n,t)},i=function(n){return Array.isArray(n)},o=function(n,t){return n[2]=r(n[2],t)||t,n},u=function(n,t){return i(n[0])?n.map((function(n){return o(n,t)})):o(n,t)},c=function(n,t,e,r){r=r||!1,e=e||{};var o=!i(n),c=n.length;return(n=o?new Array(n).fill(0):n).map((function(n,i){if(o)return t;var a=[t,n,e];return r&&(0===i&&(a=u(a,{isFirst:!0})),i+1===c&&(a=u(a,{isLast:!0}))),a}))};function a(n){this.insert=function(n,e){t.splice(n,0,e)},this.add=function(n,u,a){return n=i(n)?n:[n,null],a=a||!1,u=u||1,i(n[0])||(n=c(u,n)),n=e(n).map((function(n){return n[2]=r(n[2],{id:o}),o++,n})),t=a?n.concat(t):t.concat(n),this},this.set=function(n,e){t[n]=e},this.reset=function(){t=t.map((function(n){return n[2].executed=!1,n}))},this.getItems=function(){return(t=e(t)).filter((function(n){return!n[2].executed}))},this.setMeta=function(n,e){var i=t.findIndex((function(t){return t[2].id===n}));t[i][2]=r(t[i][2],e)};var t=[],o=0;this.add(n)}var f=function(n){return Array.from(n)},s=function(n){var t=[];return t.concat.apply(t,n)},l=function(n){var t=document.implementation.createHTMLDocument("");return t.body.innerHTML=n,t.body},d=function n(t,e,r){e=e||null,r=void 0!==r&&r;var i=f(t.childNodes).map((function(t){return 3===(e=t).nodeType||"BR"===e.tagName?t:n(t);var e}));return i=s(i),e&&(i=i.filter((function(n){return!e.contains(n)}))),r?i.reverse():i},p=function(n){return"BODY"===n.tagName},h=function(n,t){t=t||null;var e=n instanceof HTMLElement;return{node:t,isTopLevelText:(!t||p(t.parentNode))&&!e,isHTMLElement:e,content:n}};function v(n){var t,e=l(n);return t=d(e).map((function(n){return n.nodeValue?f(n.nodeValue).map((function(t){return h(t,n)})):h(n)})),s(t)}function y(n,t){return(t=void 0===t||t)?v(n):f(n).map((function(n){return h(n)}))}var m=function(n){return document.createElement(n)},g=function(n,t){var e=m("style");e.id=t||"",e.appendChild(document.createTextNode(n)),document.head.appendChild(e)},b=function(n){return i(n)||(n=[n/2,n/2]),{before:n[0],after:n[1],total:n[0]+n[1]}},S=function(n,t){return Math.abs(Math.random()*(n+t-(n-t))+(n-t))};var N=function(n){return["textarea","input"].indexOf(n.tagName.toLowerCase())>-1},T=function(n,t){var e=t.querySelectorAll("*");return[t].concat(f(e).reverse()).find((function(t){return t.cloneNode().outerHTML===n.outerHTML}))},L=function(n,t,e,r){e=e||null;var i=t.isHTMLElement,o=i?t.content:document.createTextNode(t.content);if(N(n))n.value="".concat(n.value).concat(t.content);else{if(!t.isTopLevelText&&!i){var u=t.node.parentNode,c=T(u.cloneNode(),n);if(function(n,t){if(!n)return!1;var e=n.nextSibling;return!e||e.isEqualNode(t)}(c,e))n=c;else if((o=u.cloneNode()).innerText=t.content,!p(u.parentNode)){for(var a=u.parentNode,f=a.cloneNode(),s=T(f,n);!s&&!p(a);)f.innerHTML=o.outerHTML,o=f,f=a.parentNode.cloneNode(),a=a.parentNode,s=T(f,n);n=s||n}}var l=d(n,e,!0)[r-1],h=l?l.parentNode:n;h.insertBefore(o,h.contains(e)?e:null)}},M=function(n){var t;return null==n||null===(t=n.parentNode)||void 0===t?void 0:t.removeChild(n)};var x=function(n,t,e){var r,i="string"==typeof n,o=!1,u=-1*n;return i&&(u=(r="END"===n.toUpperCase())?-1:1,o=r?t+u>0:t+u<e.length),{isString:i,numberOfSteps:u,canKeepMoving:o}},w=function(n){var t,e=["font","lineHeight","color"],r=m("SPAN"),i=(t=n,window.getComputedStyle(t,null));for(var o in i)e.indexOf(o)>-1&&i[o]&&(r.style[o]=i[o]);return r.style.cssText};
9function D(n,t,e){return e?t?t(n):n:(n&&n.then||(n=Promise.resolve(n)),t?n.then(t):n)}function H(n){return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];try{return Promise.resolve(n.apply(this,t))}catch(n){return Promise.reject(n)}}}function E(){}function C(n,t){if(!t)return n&&n.then?n.then(E):Promise.resolve()}function A(n,t){var e=n();return e&&e.then?e.then(t):t(e)}function k(n,t,e){if(!n.s){if(e instanceof O){if(!e.s)return void(e.o=k.bind(null,n,t));1&t&&(t=e.s),e=e.v}if(e&&e.then)return void e.then(k.bind(null,n,t),k.bind(null,n,2));n.s=t,n.v=e;var r=n.o;r&&r(n)}}var O=function(){function n(){}return n.prototype.then=function(t,e){var r=new n,i=this.s;if(i){var o=1&i?t:e;if(o){try{k(r,1,o(this.v))}catch(n){k(r,2,n)}return r}return this}return this.o=function(n){try{var i=n.v;1&n.s?k(r,1,t?t(i):i):e?k(r,1,e(i)):k(r,2,i)}catch(n){k(r,2,n)}},r},n}();function P(n,t){return n&&n.then?n.then(t):t(n)}return function(e,o){var u=this,s=this;o=o||{};var p=function(n,t,e){return n=i(n[0])?n:[n],an.add(n,t),function(n){var t=(n=n||{}).delay;t&&an.add([U,t])}(e),s},T=function(t){return t="object"===n(t)?t:{},[[Q,t,{force:!0}],[Q,en,{force:!0}]]},z=function(){return X?f(W.value):d(W,fn,!0)},B=function(n,t){t=t||1;var e=en.nextStringDelay;an.insert(n,[U,e.before]),an.insert(n+t+1,[U,e.after])},I=H((function(){if(fn){var n="[data-typeit-id='".concat(cn,"'] .ti-cursor");g("@keyframes blink-".concat(cn," { 0% {opacity: 0} 49% {opacity: 0} 50% {opacity: 1} } ").concat(n," { animation: blink-").concat(cn," ").concat(en.cursorSpeed/1e3,"s infinite; } ").concat(n,".with-delay { animation-delay: 500ms; } ").concat(n,".disabled { animation: none; }"),cn),W.appendChild(fn);var t="loaded"===document.fonts.status;return D(t||document.fonts.ready,(function(n){var t=fn.getBoundingClientRect().width/2;fn.style.margin="0 -".concat(t+2,"px 0 -").concat(t-2,"px")}),t)}})),R=function(n){fn&&(fn.classList.toggle("disabled",n),fn.classList.toggle("with-delay",!n))},q=H((function(n,t){return $.push(setTimeout(n,t)),D()})),j=H((function(n){var t=_;return D(t&&F(_),(function(t){return an.reset(),an.set(0,[U,n.before]),C(G(!0))}),!t)})),V=H((function(){tn.started=!0;var n,t=an.getItems();return P(function(n,t){try{var e=n()}catch(n){return t(n)}return e&&e.then?e.then(void 0,t):e}((function(){return P(function(n,t,e){var r,i,o=-1;return function u(c){try{for(;++o<n.length&&(!e||!e());)if((c=t(o))&&c.then){if(!((a=c)instanceof O&&1&a.s))return void c.then(u,i||(i=k.bind(null,r=new O,2)));c=c.v}r?k(r,1,c):r=c}catch(n){k(r||(r=new O),2,n)}var a}(),r}(t,(function(e){if(tn.frozen||tn.destroyed)throw"";var r,i,o,c,a=t[e],f=a[2];return n=[a,u],f.freezeCursor&&R(!0),r=en.speed,i=en.deleteSpeed,o=en.lifeLike,c=(i=null!==i?i:r/3)/2,Z=o?[S(r,r/2),S(i,c)]:[r,i],A((function(){var t;if(null==f?void 0:f.isFirst)return C((t=en).beforeString.apply(t,n))}),(function(){var t;return D((t=en).beforeStep.apply(t,n),(function(){return D(a[0].call(u,a[1],f),(function(){return A((function(){var t,e;if(null===(t=a[2])||void 0===t?void 0:t.isLast)return C((e=en).afterString.apply(e,n))}),(function(){var t;return D((t=en).afterStep.apply(t,n),(function(){an.setMeta(f.id,{executed:!0}),R(!1)}))}))}))}))}))}),(function(){return!1})),(function(t){var e;return tn.completed=!0,D((e=en).afterComplete.apply(e,n),(function(){if(!en.loop)throw"";var n=en.loopDelay;q((function(){return D(j(n),(function(){V()}))}),n.after)}))}))}),E),(function(n){return u}))})),U=function(n){return new Promise((function(t){q((function(){return t()}),n||0)}))},F=function n(t){var e=z(),r=x(t,_,e);return _+=r.numberOfSteps,new Promise((function(t){q(H((function(){return function(n,t,e,r){if(e){var i=r,o=t[(i=i>t.length?t.length:i)-1];(n=o?o.parentNode:n).insertBefore(e,o||null)}}(W,z(),fn,_),A((function(){if(r.isString&&r.canKeepMoving)return C(n(r.numberOfSteps>0?"START":"END"))}),(function(){return t()}))})),Z[0])}))},K=function(n){return new Promise((function(t){q((function(){return L(W,n,fn,_),t()}),Z[0])}))},Q=H((function(n){en=r(en,n)})),Y=H((function(){X?W.value="":z().forEach((function(n){M(n)}))})),G=function n(t){return t=!0===t,new Promise((function(e){q(H((function(){var r=!1,i=z();return i.length&&(X?W.value=W.value.slice(0,-1):M(i[_])),f(W.querySelectorAll("*")).forEac
9h((function(n){if(!n.innerHTML&&"BR"!==n.tagName){for(var t=n;1===t.parentNode.childNodes.length&&t.parentNode.childNodes[0].isEqualNode(t);)t=t.parentNode;M(t)}})),A((function(){if(t&&i.length-1>0)return D(n(!0),(function(){return r=!0,e()}))}),(function(n){return r?n:e()}))})),Z[1])}))};this.break=function(n){return p([K,h(m("BR"))],1,n)},this.delete=function(n,t){var e=T(t);return p([e[0]].concat([].concat(Array(Math.abs(n)||1)).fill().map((function(){return[G,!n,nn]})),[e[1]]),1,t)},this.empty=function(){return p(Y,1,arguments)},this.exec=function(n,t){var e=T(t);return p([e[0],[n,null],e[1]],1,t)},this.move=function(n,t){var e=x(n,_,z()),r=T(t),i=e.isString?n:Math.sign(n);return p([r[0]].concat([].concat(Array(Math.abs(n)||1)).fill().map((function(){return[F,i,nn]})),[r[1]]),1,t)},this.options=function(n){return p([Q,n],1,n)},this.pause=function(n,t){return p([U,n],1,t)},this.type=function(n,t){var e=T(t),r=y(n,en.html),i=[e[0]].concat(c(r,K,nn,!0),[e[1]]);return p(i,1,t)},this.is=function(n){return tn[n]},this.destroy=function(n){n=void 0===n||n,$.forEach((function(n){clearTimeout(n)})),$=[],n&&M(fn),tn.destroyed=!0},this.freeze=function(){tn.frozen=!0},this.unfreeze=function(){tn.frozen=!1,V()},this.reset=function(){for(var n in!this.is("destroyed")&&this.destroy(),an.reset(),_=0,tn)tn[n]=!1;return X?W.value="":W.innerHTML="",this},this.go=function(){return tn.started?this:(I(),en.waitUntilVisible?(function(n,t){new IntersectionObserver((function(e,r){e.forEach((function(e){e.isIntersecting&&(t(),r.unobserve(n))}))}),{threshold:1}).observe(n)}(W,V.bind(this)),this):(V(),this))},this.getQueue=function(){return an},this.getOptions=function(){return en},this.getElement=function(){return W};var J,W="string"==typeof(J=e)?document.querySelector(J):J,X=N(W),Z=[],$=[],_=0,nn={freezeCursor:!0},tn={started:!1,completed:!1,frozen:!1,destroyed:!1},en=r(t,o);en=r(en,{html:!X&&en.html,nextStringDelay:b(en.nextStringDelay),loopDelay:b(en.loopDelay)});var rn,on,un,cn=Math.random().toString().substring(2,9),an=new a([U,en.startDelay]);W.setAttribute("data-typeit-id",cn),g("[data-typeit-id]:before {content: '.'; display: inline-block; width: 0; visibility: hidden;}[data-typeit-id]"),en.strings=(un=en.strings,rn=i(un)?un:[un],(on=function(n){return n.innerHTML.replace(/<\!--.*?-->/g,"").trim()}(W))?(W.innerHTML="",en.startDelete?(v(on).forEach((function(n){L(W,n,fn,_)})),an.add([G,!0]),B(1),rn):[on.trim()].concat(rn)):rn);var fn=function(){if(X||!en.cursor)return null;var n=m("span");return n.innerHTML=l(en.cursorChar).innerHTML,n.className="ti-cursor",n.style.cssText="display:inline;".concat(w(W)),n}();en.strings.length&&function(){var n=en.strings.filter((function(n){return!!n}));n.forEach((function(t,e){var r=y(t,en.html);an.add(c(r,K,nn,!0));var i=an.getItems().length;if(e+1!==n.length){if(en.breakLines){var o=h(m("BR"));return an.add([K,o,nn]),void B(i)}an.add(c(r,G,nn)),B(i,t.length)}}))}()}})); 10 11!function(){"use strict";function o(){var o=window,t=document;if(!("scrollBehavior"in t.documentElement.style&&!0!==o.__forceSmoothScrollPolyfill__)){var l,e=o.HTMLElement||o.Element,r=468,i={scroll:o.scroll||o.scrollTo,scrollBy:o.scrollBy,elementScroll:e.prototype.scroll||n,scrollIntoView:e.prototype.scrollIntoView},s=o.performance&&o.performance.now?o.performance.now.bind(o.performance):Date.now,c=(l=o.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(l)?1:0);o.scroll=o.scrollTo=function(){void 0!==arguments[0]&&(!0!==f(arguments[0])?h.call(o,t.body,void 0!==arguments[0].left?~~arguments[0].left:o.scrollX||o.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:o.scrollY||o.pageYOffset):i.scroll.call(o,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:o.scrollX||o.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:o.scrollY||o.pageYOffset))},o.scrollBy=function(){void 0!==arguments[0]&&(f(arguments[0])?i.scrollBy.call(o,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):h.call(o,t.body,~~arguments[0].left+(o.scrollX||o.pageXOffset),~~arguments[0].top+(o.scrollY||o.pageYOffset)))},e.prototype.scroll=e.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==f(arguments[0])){var o=arguments[0].left,t=arguments[0].top;h.call(this,this,void 0===o?this.scrollLeft:~~o,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},e.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==f(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},e.prototype.scrollIntoView=function(){if(!0!==f(arguments[0])){var l=function(o){for(;o!==t.body&&!1===(e=p(l=o,"Y")&&a(l,"Y"),r=p(l,"X")&&a(l,"X"),e||r);)o=o.parentNode||o.host;var l,e,r;return o}(this),e=l.getBoundingClientRect(),r=this.getBoundingClientRect();l!==t.body?(h.call(this,l,l.scrollLeft+r.left-e.left,l.scrollTop+r.top-e.top),"fixed"!==o.getComputedStyle(l).position&&o.scrollBy({left:e.left,top:e.top,behavior:"smooth"})):o.scrollBy({left:r.left,top:r.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function n(o,t){this.scrollLeft=o,this.scrollTop=t}function f(o){if(null===o||"object"!=typeof o||void 0===o.behavior||"auto"===o.behavior||"instant"===o.behavior)return!0;
11if("object"==typeof o&&"smooth"===o.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+o.behavior+" is not a valid value for enumeration ScrollBehavior.")}function p(o,t){return"Y"===t?o.clientHeight+c<o.scrollHeight:"X"===t?o.clientWidth+c<o.scrollWidth:void 0}function a(t,l){var e=o.getComputedStyle(t,null)["overflow"+l];return"auto"===e||"scroll"===e}function d(t){var l,e,i,c,n=(s()-t.startTime)/r;c=n=n>1?1:n,l=.5*(1-Math.cos(Math.PI*c)),e=t.startX+(t.x-t.startX)*l,i=t.startY+(t.y-t.startY)*l,t.method.call(t.scrollable,e,i),e===t.x&&i===t.y||o.requestAnimationFrame(d.bind(o,t))}function h(l,e,r){var c,f,p,a,h=s();l===t.body?(c=o,f=o.scrollX||o.pageXOffset,p=o.scrollY||o.pageYOffset,a=i.scroll):(c=l,f=l.scrollLeft,p=l.scrollTop,a=n),d({scrollable:c,method:a,startTime:h,startX:f,startY:p,x:e,y:r})}}"object"==typeof exports&&"undefined"!=typeof module?module.exports={polyfill:o}:o()}(); 12/** 13 * @popperjs/core v2.4.4 - MIT License 14 */ 15 16"use strict";!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).Popper={})}(this,(function(e){function t(e){return{width:(e=e.getBoundingClientRect()).width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left,x:e.left,y:e.top}}function n(e){return"[object Window]"!==e.toString()?(e=e.ownerDocument)?e.defaultView:window:e}function r(e){return{scrollLeft:(e=n(e)).pageXOffset,scrollTop:e.pageYOffset}}function o(e){return e instanceof n(e).Element||e instanceof Element}function i(e){return e instanceof n(e).HTMLElement||e instanceof HTMLElement}function a(e){return e?(e.nodeName||"").toLowerCase():null}function s(e){return(o(e)?e.ownerDocument:e.document).documentElement}function f(e){return t(s(e)).left+r(e).scrollLeft}function c(e){return n(e).getComputedStyle(e)}function p(e){return e=c(e),/auto|scroll|overlay|hidden/.test(e.overflow+e.overflowY+e.overflowX)}function l(e,o,c){void 0===c&&(c=!1);var l=s(o);e=t(e);var u=i(o),d={scrollLeft:0,scrollTop:0},m={x:0,y:0};return(u||!u&&!c)&&(("body"!==a(o)||p(l))&&(d=o!==n(o)&&i(o)?{scrollLeft:o.scrollLeft,scrollTop:o.scrollTop}:r(o)),i(o)?((m=t(o)).x+=o.clientLeft,m.y+=o.clientTop):l&&(m.x=f(l))),{x:e.left+d.scrollLeft-m.x,y:e.top+d.scrollTop-m.y,width:e.width,height:e.height}}function u(e){return{x:e.offsetLeft,y:e.offsetTop,width:e.offsetWidth,height:e.offsetHeight}}function d(e){return"html"===a(e)?e:e.assignedSlot||e.parentNode||e.host||s(e)}function m(e,t){void 0===t&&(t=[]);var r=function e(t){return 0<=["html","body","#document"].indexOf(a(t))?t.ownerDocument.body:i(t)&&p(t)?t:e(d(t))}(e);e="body"===a(r);var o=n(r);return r=e?[o].concat(o.visualViewport||[],p(r)?r:[]):r,t=t.concat(r),e?t:t.concat(m(d(r)))}function h(e){if(!i(e)||"fixed"===c(e).position)return null;if(e=e.offsetParent){var t=s(e);if("body"===a(e)&&"static"===c(e).position&&"static"!==c(t).position)return t}return e}function g(e){for(var t=n(e),r=h(e);r&&0<=["table","td","th"].indexOf(a(r))&&"static"===c(r).position;)r=h(r);if(r&&"body"===a(r)&&"static"===c(r).position)return t;if(!r)e:{for(e=d(e);i(e)&&0>["html","body"].indexOf(a(e));){if("none"!==(r=c(e)).transform||"none"!==r.perspective||r.willChange&&"auto"!==r.willChange){r=e;break e}e=e.parentNode}r=null}return r||t}function b(e){var t=new Map,n=new Set,r=[];return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||function e(o){n.add(o.name),[].concat(o.requires||[],o.requiresIfExists||[]).forEach((function(r){n.has(r)||(r=t.get(r))&&e(r)})),r.push(o)}(e)})),r}function v(e){var t;return function(){return t||(t=new Promise((function(n){Promise.resolve().then((function(){t=void 0,n(e())}))}))),t}}function y(e){return e.split("-")[0]}function O(e,t){var n=!(!t.getRootNode||!t.getRootNode().host);if(e.contains(t))return!0;if(n)do{if(t&&e.isSameNode(t))return!0;t=t.parentNode||t.host}while(t);return!1}function x(e){return Object.assign(Object.assign({},e),{},{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function w(e,o){if("viewport"===o){o=n(e);var a=s(e);
16o=o.visualViewport;var p=a.clientWidth;a=a.clientHeight;var l=0,u=0;o&&(p=o.width,a=o.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(l=o.offsetLeft,u=o.offsetTop)),e=x(e={width:p,height:a,x:l+f(e),y:u})}else i(o)?((e=t(o)).top+=o.clientTop,e.left+=o.clientLeft,e.bottom=e.top+o.clientHeight,e.right=e.left+o.clientWidth,e.width=o.clientWidth,e.height=o.clientHeight,e.x=e.left,e.y=e.top):(u=s(e),e=s(u),l=r(u),o=u.ownerDocument.body,p=Math.max(e.scrollWidth,e.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=Math.max(e.scrollHeight,e.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),u=-l.scrollLeft+f(u),l=-l.scrollTop,"rtl"===c(o||e).direction&&(u+=Math.max(e.clientWidth,o?o.clientWidth:0)-p),e=x({width:p,height:a,x:u,y:l}));return e}function j(e,t,n){return t="clippingParents"===t?function(e){var t=m(d(e)),n=0<=["absolute","fixed"].indexOf(c(e).position)&&i(e)?g(e):e;return o(n)?t.filter((function(e){return o(e)&&O(e,n)&&"body"!==a(e)})):[]}(e):[].concat(t),(n=(n=[].concat(t,[n])).reduce((function(t,n){return n=w(e,n),t.top=Math.max(n.top,t.top),t.right=Math.min(n.right,t.right),t.bottom=Math.min(n.bottom,t.bottom),t.left=Math.max(n.left,t.left),t}),w(e,n[0]))).width=n.right-n.left,n.height=n.bottom-n.top,n.x=n.left,n.y=n.top,n}function M(e){return 0<=["top","bottom"].indexOf(e)?"x":"y"}function E(e){var t=e.reference,n=e.element,r=(e=e.placement)?y(e):null;e=e?e.split("-")[1]:null;var o=t.x+t.width/2-n.width/2,i=t.y+t.height/2-n.height/2;switch(r){case"top":o={x:o,y:t.y-n.height};break;case"bottom":o={x:o,y:t.y+t.height};break;case"right":o={x:t.x+t.width,y:i};break;case"left":o={x:t.x-n.width,y:i};break;default:o={x:t.x,y:t.y}}if(null!=(r=r?M(r):null))switch(i="y"===r?"height":"width",e){case"start":o[r]=Math.floor(o[r])-Math.floor(t[i]/2-n[i]/2);break;case"end":o[r]=Math.floor(o[r])+Math.ceil(t[i]/2-n[i]/2)}return o}function D(e){return Object.assign(Object.assign({},{top:0,right:0,bottom:0,left:0}),e)}function P(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function k(e,n){void 0===n&&(n={});var r=n;n=void 0===(n=r.placement)?e.placement:n;var i=r.boundary,a=void 0===i?"clippingParents":i,f=void 0===(i=r.rootBoundary)?"viewport":i;i=void 0===(i=r.elementContext)?"popper":i;var c=r.altBoundary,p=void 0!==c&&c;r=D("number"!=typeof(r=void 0===(r=r.padding)?0:r)?r:P(r,q));var l=e.elements.reference;c=e.rects.popper,a=j(o(p=e.elements[p?"popper"===i?"reference":"popper":i])?p:p.contextElement||s(e.elements.popper),a,f),p=E({reference:f=t(l),element:c,strategy:"absolute",placement:n}),c=x(Object.assign(Object.assign({},c),p)),f="popper"===i?c:f;
16var u={top:a.top-f.top+r.top,bottom:f.bottom-a.bottom+r.bottom,left:a.left-f.left+r.left,right:f.right-a.right+r.right};if(e=e.modifiersData.offset,"popper"===i&&e){var d=e[n];Object.keys(u).forEach((function(e){var t=0<=["right","bottom"].indexOf(e)?1:-1,n=0<=["top","bottom"].indexOf(e)?"y":"x";u[e]+=d[n]*t}))}return u}function L(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function B(e){void 0===e&&(e={});var t=e.defaultModifiers,n=void 0===t?[]:t,r=void 0===(e=e.defaultOptions)?V:e;return function(e,t,i){function a(){f.forEach((function(e){return e()})),f=[]}void 0===i&&(i=r);var s={placement:"bottom",orderedModifiers:[],options:Object.assign(Object.assign({},V),r),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},f=[],c=!1,p={state:s,setOptions:function(i){return a(),s.options=Object.assign(Object.assign(Object.assign({},r),s.options),i),s.scrollParents={reference:o(e)?m(e):e.contextElement?m(e.contextElement):[],popper:m(t)},i=function(e){var t=b(e);return N.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign(Object.assign(Object.assign({},n),t),{},{options:Object.assign(Object.assign({},n.options),t.options),data:Object.assign(Object.assign({},n.data),t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(n,s.options.modifiers))),s.orderedModifiers=i.filter((function(e){return e.enabled})),s.orderedModifiers.forEach((function(e){var t=e.name,n=e.options;n=void 0===n?{}:n,"function"==typeof(e=e.effect)&&(t=e({state:s,name:t,instance:p,options:n}),f.push(t||function(){}))})),p.update()},forceUpdate:function(){if(!c){var e=s.elements,t=e.reference;if(L(t,e=e.popper))for(s.rects={reference:l(t,g(e),"fixed"===s.options.strategy),popper:u(e)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach((function(e){return s.modifiersData[e.name]=Object.assign({},e.data)})),t=0;t<s.orderedModifiers.length;t++)if(!0===s.reset)s.reset=!1,t=-1;else{var n=s.orderedModifiers[t];e=n.fn;var r=n.options;r=void 0===r?{}:r,n=n.name,"function"==typeof e&&(s=e({state:s,options:r,name:n,instance:p})||s)}}},update:v((function(){return new Promise((function(e){p.forceUpdate(),e(s)}))})),destroy:function(){a(),c=!0}};return L(e,t)?(p.setOptions(i).then((function(e){!c&&i.onFirstUpdate&&i.onFirstUpdate(e)})),p):p}}function W(e){var t,r=e.popper,o=e.popperRect,i=e.placement,a=e.offsets,f=e.position,c=e.gpuAcceleration,p=e.adaptive,l=window.devicePixelRatio||1;e=Math.round(a.x*l)/l||0,l=Math.round(a.y*l)/l||0;var u=a.hasOwnProperty("x");a=a.hasOwnProperty("y");var d,m="left",h="top",b=window;if(p){var v=g(r);v===n(r)&&(v=s(r)),"top"===i&&(h="bottom",l-=v.clientHeight-o.height,l*=c?1:-1),"left"===i&&(m="right",e-=v.clientWidth-o.width,e*=c?1:-1)}return r=Object.assign({position:f},p&&_),c?Object.assign(Object.assign({},r),{},((d={})[h]=a?"0":"",d[m]=u?"0":"",d.transform=2>(b.devicePixelRatio||1)?"translate("+e+"px, "+l+"px)":"translate3d("+e+"px, "+l+"px, 0)",d)):Object.assign(Object.assign({},r),{},((t={})[h]=a?l+"px":"",t[m]=u?e+"px":"",t.transform="",t))}function A(e){return e.replace(/left|right|bottom|top/g,(function(e){return U[e]}))}function H(e){return e.replace(/start|end/g,(function(e){return z[e]}))}function T(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function R(e){return["top","right","bottom","left"].some((function(t){return 0<=e[t]}))}var q=["top","bottom","right","left"],C=q.reduce((function(e,t){return e.concat([t+"-start",t+"-end"])}),[]),S=[].concat(q,["auto"]).reduce((function(e,t){return e.concat([t,t+"-start",t+"-end"])}),[]),N="beforeRead read afterRead beforeMain main afterMain beforeWrite write afterWrite".split(" "),V={placement:"bottom",modifiers:[],strategy:"absolute"},I={passive:!0},_={top:"auto",right:"auto",bottom:"auto",left:"auto"}
16,U={left:"right",right:"left",bottom:"top",top:"bottom"},z={start:"end",end:"start"},F=[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,r=e.instance,o=(e=e.options).scroll,i=void 0===o||o,a=void 0===(e=e.resize)||e,s=n(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&f.forEach((function(e){e.addEventListener("scroll",r.update,I)})),a&&s.addEventListener("resize",r.update,I),function(){i&&f.forEach((function(e){e.removeEventListener("scroll",r.update,I)})),a&&s.removeEventListener("resize",r.update,I)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state;t.modifiersData[e.name]=E({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options;e=void 0===(e=n.gpuAcceleration)||e,n=void 0===(n=n.adaptive)||n,e={placement:y(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:e},null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign(Object.assign({},t.styles.popper),W(Object.assign(Object.assign({},e),{},{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:n})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign(Object.assign({},t.styles.arrow),W(Object.assign(Object.assign({},e),{},{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1})))),t.attributes.popper=Object.assign(Object.assign({},t.attributes.popper),{},{"data-popper-placement":t.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];i(o)&&a(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],o=t.attributes[e]||{};e=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{}),i(r)&&a(r)&&(Object.assign(r.style,e),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.name,r=void 0===(e=e.options.offset)?[0,0]:e,o=(e=S.reduce((function(e,n){var o=t.rects,i=y(n),a=0<=["left","top"].indexOf(i)?-1:1,s="function"==typeof r?r(Object.assign(Object.assign({},o),{},{placement:n})):r;return o=(o=s[0])||0,s=((s=s[1])||0)*a,i=0<=["left","right"].indexOf(i)?{x:s,y:o}:{x:o,y:s},e[n]=i,e}),{}))[t.placement],i=o.x;o=o.y,null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=i,t.modifiersData.popperOffsets.y+=o),t.modifiersData[n]=e}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options;if(e=e.name,!t.modifiersData[e]._skip){var r=n.mainAxis;r=void 0===r||r;var o=n.altAxis;o=void 0===o||o;var i=n.fallbackPlacements,a=n.padding,s=n.boundary,f=n.rootBoundary,c=n.altBoundary,p=n.flipVariations,l=void 0===p||p,u=n.allowedAutoPlacements;p=y(n=t.options.placement),i=i||(p!==n&&l?function(e){if("auto"===y(e))return[];var t=A(e);return[H(e),t,H(t)]}(n):[A(n)]);var d=[n].concat(i).reduce((function(e,n){return e.concat("auto"===y(n)?function(e,t){void 0===t&&(t={});var n=t.boundary,r=t.rootBoundary,o=t.padding,i=t.flipVariations,a=t.allowedAutoPlacements,s=void 0===a?S:a,f=t.placement.split("-")[1];0===(i=(t=f?i?C:C.filter((function(e){return e.split("-")[1]===f})):q).filter((function(e){return 0<=s.indexOf(e)}))).length&&(i=t);var c=i.reduce((function(t,i){return t[i]=k(e,{placement:i,boundary:n,rootBoundary:r,padding:o})[y(i)],t}),{});return Object.keys(c).sort((function(e,t){return c[e]-c[t]}))}(t,{placement:n,boundary:s,rootBoundary:f,padding:a,flipVariations:l,allowedAutoPlacements:u}):n)}),[]);n=t.rects.reference,i=t.rects.popper;var m=new Map;p=!0;for(var h=d[0],g=0;g<d.length;g++){var b=d[g],v=y(b),O="start"===b.split("-")[1],x=0<=["top","bottom"].indexOf(v),w=x?"width":"height",j=k(t,{placement:b,boundary:s,rootBoundary:f,altBoundary:c,padding:a});if(O=x?O?"right":"left":O?"bottom":"top",n[w]>i[w]&&(O=A(O)),w=A(O),x=[],r&&x.push(0>=j[v]),o&&x.push(0>=j[O],0>=j[w]),x.every((function(e){return e}))){h=b,p=!1;break}m.set(b,x)}if(p)for(r=function(e){var t=d.find((function(t){if(t=m.get(t))return t.slice(0,e).every((function(e){return e}))}));if(t)return h=t,"break"},o=l?3:1;0<o&&"break"!==r(o);o--);t.placement!==h&&(t.modifiersData[e]._skip=!0,t.placement=h,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options;e=e.name;var r=n.mainAxis,o=void 0===r||r;r=void 0!==(r=n.altAxis)&&r;var i=n.tether;i=void 0===i||i;var a=n.tetherOffset,s=void 0===a?0:a;n=k(t,{boundary:n.boundary,rootBoundary:n.rootBoundary,padding:n.padding,altBoundary:n.altBoundary}),a=y(t.placement);var f=t.placement.split("-")[1],c=!f,p=M(a);a="x"===p?"y":"x";var l=t.modifiersData.popperOffsets,d=t.rects.reference,m=t.rects.popper,h="function"==typeof s?s(Object.assign(Object.assign({},t.rects),{},{placement:t.placement})):s;if(s={x:0,y:0}
16,l){if(o){var b="y"===p?"top":"left",v="y"===p?"bottom":"right",O="y"===p?"height":"width";o=l[p];var x=l[p]+n[b],w=l[p]-n[v],j=i?-m[O]/2:0,E="start"===f?d[O]:m[O];f="start"===f?-m[O]:-d[O],m=t.elements.arrow,m=i&&m?u(m):{width:0,height:0};var D=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0};b=D[b],v=D[v],m=Math.max(0,Math.min(d[O],m[O])),E=c?d[O]/2-j-m-b-h:E-m-b-h,c=c?-d[O]/2+j+m+v+h:f+m+v+h,h=t.elements.arrow&&g(t.elements.arrow),d=t.modifiersData.offset?t.modifiersData.offset[t.placement][p]:0,h=l[p]+E-d-(h?"y"===p?h.clientTop||0:h.clientLeft||0:0),c=l[p]+c-d,i=Math.max(i?Math.min(x,h):x,Math.min(o,i?Math.max(w,c):w)),l[p]=i,s[p]=i-o}r&&(r=l[a],i=Math.max(r+n["x"===p?"top":"left"],Math.min(r,r-n["x"===p?"bottom":"right"])),l[a]=i,s[a]=i-r),t.modifiersData[e]=s}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state;e=e.name;var r=n.elements.arrow,o=n.modifiersData.popperOffsets,i=y(n.placement),a=M(i);if(i=0<=["left","right"].indexOf(i)?"height":"width",r&&o){var s=n.modifiersData[e+"#persistent"].padding,f
16=u(r),c="y"===a?"top":"left",p="y"===a?"bottom":"right",l=n.rects.reference[i]+n.rects.reference[a]-o[a]-n.rects.popper[i];o=o[a]-n.rects.reference[a],l=(r=(r=g(r))?"y"===a?r.clientHeight||0:r.clientWidth||0:0)/2-f[i]/2+(l/2-o/2),i=Math.max(s[c],Math.min(l,r-f[i]-s[p])),n.modifiersData[e]=((t={})[a]=i,t.centerOffset=i-l,t)}},effect:function(e){var t=e.state,n=e.options;e=e.name;var r=n.element;if(r=void 0===r?"[data-popper-arrow]":r,n=void 0===(n=n.padding)?0:n,null!=r){if("string"==typeof r&&!(r=t.elements.popper.querySelector(r)))return;O(t.elements.popper,r)&&(t.elements.arrow=r,t.modifiersData[e+"#persistent"]={padding:D("number"!=typeof n?n:P(n,q))})}},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state;e=e.name;var n=t.rects.reference,r=t.rects.popper,o=t.modifiersData.preventOverflow,i=k(t,{elementContext:"reference"}),a=k(t,{altBoundary:!0});n=T(i,n),r=T(a,r,o),o=R(n),a=R(r),t.modifiersData[e]={referenceClippingOffsets:n,popperEscapeOffsets:r,isReferenceHidden:o,hasPopperEscaped:a},t.attributes.popper=Object.assign(Object.assign({},t.attributes.popper),{},{"data-popper-reference-hidden":o,"data-popper-escaped":a})}}],X=B({defaultModifiers:F});e.createPopper=X,e.defaultModifiers=F,e.detectOverflow=k,e.popperGenerator=B,Object.defineProperty(e,"__esModule",{value:!0})})); 17; 18 19window.mrp_open_new_window = function( url, width, height, name ) { 20 21 function optimalWindowHeight( desired ) 22 { 23 if( desired && desired < screen.availHeight ) { 24 return desired; 25 } 26 27 var h = 500; 28 if( screen.availHeight > 600 ) { 29 h = 700; 30 } 31 if( screen.availHeight > 800 ) { 32 h = 800; 33 } 34 return h; 35 } 36 37 if( !height ) { 38 height = optimalWindowHeight(); 39 } 40 41 var left = parseInt((screen.availWidth/2) - (width/2)); 42 var top = parseInt((screen.availHeight/2) - (height/2)); 43 44 if( !name ) { 45 name = "" + parseInt( ( Math.random() * 100000 ) ); 46 } 47 var w = window.open( url, name, "width=" + width + ",height=" + height + 48 ",scrollbars=1,location=1,left=" + left + ",top=" + top + ",screenX=" + left + ",screenY=" + top ); 49 50 if( w == null ) { 51 alert( "Please enable popups in your browser" ); 52 } 53 else { 54 w.focus(); 55 } 56 57 return w; 58}; 59 60// DOMParser patch for IOS Safari 61(function(DOMParser) { 62 "use strict"; 63 64 var proto = DOMParser.prototype, 65 nativeParse = proto.parseFromString; 66 67 // Firefox/Opera/IE throw errors on unsupported types 68 try { 69 // WebKit returns null on unsupported types 70 if ((new DOMParser()).parseFromString("", "text/html")) { 71 // text/html parsing is natively supported 72 return; 73 } 74 } catch (ex) {} 75 76 proto.parseFromString = function(markup, type) { 77 if (/^\s*text\/html\s*(?:;|$)/i.test(type)) { 78 var doc = document.implementation.createHTMLDocument(""); 79 if (markup.toLowerCase().indexOf('<!doctype') > -1) { 80 doc.documentElement.innerHTML = markup; 81 } else { 82 doc.body.innerHTML = markup; 83 } 84 return doc; 85 } else { 86 return nativeParse.apply(this, arguments); 87 } 88 }; 89}(DOMParser)); 90 91function get_if_exist(obj){ 92 if( !obj ) { 93 return undefined; 94 } 95 return arguments.length==1 || (obj[arguments[1]] && get_if_exist.apply(this,[obj[arguments[1]]].concat([].slice.call(arguments,2)))); 96} 97 98const _G = { 99 reinitHandlers: [], 100 isMobile: () => /iPhone|iPad|iPod|Android/i.test(navigator.userAgent), 101} 102 103;(function() { 104 _G.visibilityService = (function() { 105 106 const options = { 107 threshold: [0,0.1,0.2,0.4,0.6,0.8] 108 } 109 110 const observer = new IntersectionObserver( entries => { 111 (entries || []).forEach( entry => { 112 if( typeof entry.target.__visibility === 'function' ) { 113 114 const isLikelyMobile = window.innerWidth < window.innerHeight 115 const defaultVisibilityRatio = isLikelyMobile ? 0.01 : 0.2; 116 117 const ratio = getComputedStyle(entry.target) 118 .getPropertyValue('--visibility-ratio') || defaultVisibilityRatio; 119 120 if( entry.intersectionRatio >= ratio /* && !document.querySelector('html').classList.contains('editing') */ ) { 121 entry.target.__visibility(entry) 122 } 123 } 124 }) 125 }, options ) 126 127 const observe = ( el, callback ) => { 128 el.__visibility = callback 129 observer.observe(el) 130 } 131 132 const unobserve = ( el ) => { 133 observer.unobserve(el) 134 } 135 136 return { 137 observe, 138 unobserve, 139 } 140 })() 141})() 142 143 144function _initBlocks() { 145 for (let m of (window.block_code_modules || [])) { 146 try { 147 m && m.init && m.init(m.id, m) 148 } catch (err) { 149 console.log('Error initing module', m.id, err) 150 } 151 } 152} 153 154function _destroyBlocks() { 155 for (let m of (window.block_code_modules || [])) { 156 try { 157 m && m.destroy && m.destroy() 158 } catch (err) { 159 console.log('Error destroying module', m.id, err) 160 } 161 } 162} 163 164_G.parallaxService = (function () { 165 166 const BASE_SPEED = 0.7 167 168 let stopped = false 169 const elements = [] 170 const observer = new IntersectionObserver((entries) => {
171 entries.forEach(entry => { 172 entry.target._parallaxVisible = entry.isIntersecting 173 recalc(entry.target) 174 }) 175 }, { 176 // blank options 177 }) 178 179 window.addEventListener('scroll', (ev) => { 180 requestAnimationFrame(() => { 181 recalcAll() 182 }) 183 184 }, { passive: true }) 185 186 const calcShift = (elem) => { 187 /* 188 * calculates a number -1..0..1 where 0 is dead center of the element in viewport 189 * -1 is when the element touches with its top the top edge of the viewport 190 * 1 is when the element touches with its bottom the bottom edge of the viewport 191 * 192 * */ 193 const rect = elem.parentElement.getBoundingClientRect() 194 const bgRect = elem.getBoundingClientRect() 195 const elemFreeHeight = window.innerHeight - rect.height 196 const bgFreeHeight = window.innerHeight - bgRect.height 197 const shapeCenterY = rect.top + (rect.height / 2) 198 const viewportCenterY = window.innerHeight / 2 199 const delta = viewportCenterY - shapeCenterY 200 201 // adjusting speed is necessary for containers that are shorter than 202 // viewport height and have bg element with some spare space top and 203 // bottom to allow for differential scroll speeds. If these conditions 204 // are not met, we fall back to the base speed. Otherwise, we calculate the 205 // ideal speed based on the amount of spare image space and size of 206 // container. The idea is that the top of bg image reach the top 207 // of the viewport at exactly the same time as the container to avoid exposing 208 // any areas uncovered by the image. 209 const shouldAdjustSpeed = bgRect.height < window.innerHeight 210 && rect.height < window.innerHeight 211 && bgRect.height >= rect.height 212 213 const baseSpeed = shouldAdjustSpeed 214 ? bgFreeHeight / elemFreeHeight 215 : BASE_SPEED 216 217 const translateValue = ( 1 - baseSpeed ) * delta 218 219 // console.log( delta, acceleration, adjustedRatio, translateValue ) 220 221 return translateValue.toFixed(4) 222 } 223 224 const recalcAll = () => { 225 if( stopped ) { 226 return 227 } 228 elements.forEach(elem => { 229 recalc(elem) 230 }) 231 } 232 233 const recalc = (elem) => { 234 if( stopped ) { 235 return 236 } 237 if (elem._parallaxVisible) { 238 elem.style.transform = 'translate(0,' + calcShift(elem) + 'px)' + 239 (elem.classList.contains('blur') ? ' scale(1.1)' : '' ) 240 } 241 } 242 243 const add = (elem) => { 244 if (!elem) { 245 return 246 } 247 elem._parallaxVisible = false 248 elements.push(elem) 249 observer.observe(elem) 250 recalc(elem) 251 } 252 253 const remove = (elem) => { 254 const index = elements.indexOf(elem) 255 if (index !== -1) { 256 elements.splice(index, 1) 257 } 258 observer.unobserve(elem) 259 } 260 261 const setStopped = (flag) => { 262 stopped = flag 263 } 264 265 const refresh = () => { 266 recalcAll() 267 } 268 269 const cleanup = () => { 270 // cleanup potentially stale elements, i.e. detached from DOM 271 // may happen after a block was re-inserted in the editor 272 elements.slice().filter(elem => { 273 if (!document.body.contains(elem)) { 274 remove(elem) 275 } 276 }) 277 } 278 279 return { 280 setStopped, 281 refresh, 282 add, 283 remove, 284 cleanup, 285 } 286})() 287 288_G.fxService = (function() { 289 290 let queue = [] 291 let revealLaunched = null 292 293 function cleanupFastScrolled() { 294 // const snapshot = queue.map( el => { 295 // let rect = el.getBoundingClientRect() 296 // let top = rect.top 297 // let bottom = rect.bottom 298 // return { 299 // el, 300 // top, 301 // bottom, 302 // scrolledOutOfView: bottom < 0, 303 // } 304 // }) 305 // console.log( 'REVEAL', snapshot ) 306 while(queue.length > 0) { 307 let el = queue.at(0) 308 if( !el ) { 309 break; 310 } 311 let rect = el.getBoundingClientRect() 312 if( rect.bottom < 0 ) { 313 queue.shift().classList.remove('fx') 314 } 315 else { 316 break; 317 } 318 } 319 } 320 321 function revealStaggered() { 322 if( revealLaunched !== null ) { 323 return 324 } 325 if( queue.length === 0 ) { 326 return 327 } 328 revealLaunched = setInterval( () => { 329 if( queue.length === 0 ) { 330 clearInterval( revealLaunched ) 331 revealLaunched = null 332 return 333 } 334 cleanupFastScrolled() 335 queue.shift().classList.remove( 'fx' ) 336 }, 100 ) 337 } 338 339 function initElem( el ) { 340 if( !el || el.__fx_inited ) { 341 return 342 } 343 344 if( el.closest('.managed-fx')) { 345 return 346 } 347 348 el.__fx_inited = true 349 _G.visibilityService.observe( el, result => { 350 351 if( !el.classList.contains('fx')) { 352 return // probably already revealed 353 } 354 queue.push(el) 355 revealStaggered() 356 _G.visibilityService.unobserve(el) 357 }) 358 } 359
360 function init() { 361 document.querySelectorAll('.fx' ).forEach( initElem ) 362 } 363 364 return { 365 init, 366 initElem 367 } 368})() 369 370 371document.addEventListener('DOMContentLoaded', () => { 372 373 if( window.customOnLoads ) { 374 window.customOnLoads.forEach( f => { 375 try { 376 if( typeof f === 'function' ) { 377 f() 378 } 379 } 380 catch( ex ) { 381 console.error( 'ERROR: failed to run customOnLoad: ', ex ); 382 } 383 }) 384 } 385 386 function initVideo( v ) { 387 if( v.__videoInited ) { 388 return 389 } 390 v.__videoInited = true 391 v.addEventListener('pause', () => { 392 v.__paused = true 393 }) 394 _G.visibilityService.observe(v, result => { 395 if( result.isIntersecting ) { 396 if( v.__paused ) { 397 return 398 } 399 v.muted = true 400 v.play() 401 if(v.getAttribute("data-speed")) { 402 v.playbackRate = parseFloat(v.getAttribute("data-speed")) 403 } 404 // if( document.querySelector('html').classList.contains('editing') ) { 405 //v.pause() 406 // } 407 } 408 }) 409 } 410 411 _G.fxService.init() 412 _G.reinitHandlers.push( id => { 413 document.getElementById(id).querySelectorAll('.fx').forEach( el => { 414 _G.fxService.initElem(el) 415 }) 416 document.querySelectorAll('video[data-autoplay="true"]').forEach(initVideo ) 417 }) 418 419 420 document.querySelectorAll('.with-scroll-parallax').forEach(elem => { 421 _G.parallaxService.add(elem) 422 }) 423 document.querySelectorAll( '.with-smart-bg.with-bg-video video' ).forEach(( v => { 424 v.muted = true 425 v.play() 426 })) 427 428 document.querySelectorAll('video.video[data-autoplay="true"]').forEach(initVideo ) 429 430 document.addEventListener( 'editor.on', () => { 431 }) 432 433 _G.quickMessage = ( msg, options={} ) => { 434 const m = document.createElement('div') 435 m.classList.add('quick-message') 436 if( options.error ) { 437 m.classList.add( 'error' ) 438 } 439 m.style.opacity = '0' 440 m.innerText = msg 441 document.body.appendChild( m ) 442 setTimeout( () => { 443 m.style.opacity = '1' 444 }, 10 ) 445 setTimeout( () => { 446 m.style.opacity = '0' 447 m.addEventListener( 'transitionend', () => { 448 m.remove() 449 },{once:true}) 450 }, 3000 ) 451 m.addEventListener('click', ev => { 452 m.style.opacity = '0' 453 m.addEventListener( 'transitionend', () => { 454 m.remove() 455 },{once:true}) 456 }, {once: true}) 457 } 458 459 _G.applyRipple = function( event, button ) { 460 461 const circle = document.createElement("span") 462 const diameter = Math.max(button.clientWidth, button.clientHeight) 463 const radius = diameter / 2; 464 465 circle.style.width = circle.style.height = `${diameter}px` 466 const rect = button.getBoundingClientRect() 467 circle.style.left = `${event.clientX - (rect.left + radius)}px` 468 circle.style.top = `${event.clientY - (rect.top + radius)}px` 469 circle.classList.add("ripple") 470 471 const ripple = button.getElementsByClassName("ripple")[0] 472 if (ripple) { 473 ripple.remove() 474 } 475 476 button.appendChild(circle) 477 478 circle.addEventListener( 'animationend', () => { 479 circle.remove() 480 }, { once: true }) 481 } 482 483 _G.createFragment = htmlStr => { 484 var frag = document.createDocumentFragment(), temp = document.createElement('div'); 485 temp.innerHTML = htmlStr; 486 while (temp.firstChild) { 487 frag.appendChild(temp.firstChild); 488 } 489 return frag; 490 } 491 492 function scrollToBlock( id ) { 493 console.log( 'will scroll to ', id ) 494 const elem = document.querySelector(id) 495 if( elem ) { 496 elem.scrollIntoView({ 497 behavior: 'smooth', 498 block: 'start',
499 inline: 'nearest', 500 }) 501 history.pushState({}, '', id) 502 // window.location.hash = id 503 } 504 } 505 506 document.addEventListener( 'click', event => { 507 if( event.target && ( event.target.matches( '.block-layout .button' ) || event.target.matches( '.block-layout .button *' ))) { 508 const button = event.target.closest('.button') 509 if( button ) { 510 _G.applyRipple(event, button ) 511 if( button.tagName === 'BUTTON' ) { 512 const form = button.closest('form') 513 if( form && form.getAttribute('action') && 514 form.getAttribute('action').indexOf('#bid_') === 0 ) { 515 event.stopPropagation() 516 event.preventDefault() 517 scrollToBlock(form.getAttribute('action')) 518 } 519 } 520 } 521 } 522 if( event.target && ( event.target.matches( '.block-layout a' ) || event.target.matches('.block-layout a *'))) { 523 const link = event.target.closest('a') 524 if( link && link.getAttribute('href') && link.getAttribute('href').indexOf('#bid_') === 0 ) { 525 event.stopPropagation() 526 event.preventDefault() 527 scrollToBlock(link.getAttribute('href')) 528 } 529 } 530 }) 531}) 532 533function debounce(func, wait, immediate) { 534 var timeout; 535 return function() { 536 var context = this, args = arguments; 537 var later = function() { 538 timeout = null; 539 if (!immediate) func.apply(context, args); 540 }; 541 var callNow = immediate && !timeout; 542 clearTimeout(timeout); 543 timeout = setTimeout(later, wait); 544 if (callNow) func.apply(context, args); 545 }; 546} 547 548function openTranslate( toLang ) { 549 toLang = toLang || "en"; 550 window.open("https://" + window.location.hostname.replaceAll("-","--") 551 .replaceAll(".","-") + ".translate.goog" + window.location.pathname + 552 "?_x_tr_sl=auto&_x_tr_tl=" + toLang + "&_x_tr_hl=en&_x_tr_pto=wapp' target='_blank'>Translate Page") 553} 554 555function mrp_basic_auth_logout( safelocation ) { 556 const c = ''; 557 var a, b = "You should be logged out now."; 558 try { 559 a = document.execCommand("ClearAuthenticationCache", 'false') 560 } catch (d) { 561 } 562 a || ((a = window.XMLHttpRequest ? new window.XMLHttpRequest : window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : void 0) ? 563 (a.open("HEAD", c || location.href, !0, "logout", (new Date).getTime().toString()), a.send(""), a = 1) : a = void 0); 564 a || (b = "Your browser is too old or too weird to support log out functionality. Close all windows and restart the browser."); 565 // alert(b) 566 document.body.innerHTML = ''; 567 setTimeout(() => { 568 const url = window.location.href; 569 const fake = btoa('logout:logout') 570 // history.replaceState({}, '', url + '?t' + Date.now() ); 571 window.location = safelocation || 'https://private-office.myrealpage.com' 572 // fetch( url, { 573 // headers: { 574 // 'Authorization': 'Basic fake' 575 // } 576 // }) 577 // .finally( () => { 578 // 579 // }); 580 }, 1000 ) 581} 582 583/* ==== INCLUDE: /js/responsive-containers-mod.js ==== */ 584 585/* 586MIT Licensed. 587Copyright (c) 2011 Andy Hume (http://andyhume.net, [email protected]). 588 589Permission is hereby granted, free of charge, to any person obtaining a copy 590of this software and associated documentation files (the "Software"), to deal 591in the Software without restriction, including without limitation the rights 592to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 593copies of the Software, and to permit persons to whom the Software is 594furnished to do so, subject to the following conditions: 595 596The above copyright notice and this permission notice shall be included in 597all copies or substantial portions of the Software. 598 599THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 600IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 601FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 602AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 603LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 604OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 605THE SOFTWARE. 606*/ 607 608(function(win) { 609 610 if( window.responsiveContainersLoaded ) { 611 return; 612 } 613 614 window.responsiveContainersLoaded = true; 615 616 var doc = win.document, 617 els = [], 618 check_data_attributes = true, 619 loaded = false;
620 621 622 if( window.mrp_v2_ready ) { 623 window.mrp_v2_ready( function() { 624 _gmrp.$( document ).on( "mrp.responsify.containers mrp.popup.close", 625 function(e) { 626 //console.log( "mrp.ajax-idx.show" ); 627 for( var i=0; i<els.length; ++i ) { 628 delete els[i].cq_rules; 629 } 630 els = []; 631 //var b = new Date().getTime(); 632 findContainerQueries(); 633 applyRules(); 634 //console.log( ( new Date().getTime() - b ) + "ms" ); 635 } 636 ); 637 }); 638 } 639 640 function add(elements, query, value, class_name) { 641 var split_value = /([0-9]*)(px|em)/.exec(value); 642 for (var i = 0, j = elements.length; i<j; ++i) { 643 var el = elements[i]; 644 el.cq_rules = el.cq_rules || []; 645 el.cq_rules.push([null, query, split_value[1], split_value[2], class_name]); 646 els.push(el); 647 } 648 if (loaded) { // if we're not 'loaded' yet, domLoaded will run applyRules() for us. 649 applyRules(); 650 } 651 } 652 653 function ignoreDataAttributes() { 654 check_data_attributes = false; 655 } 656 657 function findContainerQueries() { 658 if (check_data_attributes) { 659 // Find data-squery attributes. 660 var nodes = []; 661 if (doc.querySelectorAll) { 662 var nodes = doc.querySelectorAll("[data-squery]"); 663 } else { 664 // If no query selectors. 665 var e = doc.getElementsByTagName("*"); 666 for (var i = 0, j = e.length; i<j; ++i) { 667 if (e[i].getAttribute("data-squery")) { 668 nodes.push(e[i]); 669 } 670 } 671 } 672 // Parse the data-squery attribute and store resulting rules on the element. 673 for (var i = 0, j = nodes.length; i<j; ++i) { 674 var el = nodes[i]; 675 if( el.cq_rules && el.cq_rules.length > 0 ) { 676 continue; 677 } 678 var cq_rules = []; 679 var raw_rules = el.getAttribute("data-squery").split(" "); 680 for (var k = 0, l = raw_rules.length; k<l; ++k) { 681 var rule = /(.*):([0-9]*)(px|em)=(.*)/.exec(raw_rules[k]); 682 if (rule) { 683 cq_rules.push(rule); 684 } 685 } 686 el.cq_rules = el.cq_rules || []; 687 el.cq_rules = el.cq_rules.concat(cq_rules); 688 els.push(el); 689 } 690 } 691 } 692 693 function applyRules() { 694 // For each element, apply the rules to the class name. 695 console.log( "els:", els.length ); 696 for (var i = 0, j = els.length; i<j; ++i) { 697 el = els[i]; 698 console.log( "els.cq_rules:",el.cq_rules.length ); 699 for (var k = 0, l = el.cq_rules.length; k<l; ++k) { 700 var rule = el.cq_rules[k]; 701 702 // Get a target width value in pixels. 703 var width = parseInt(rule[2]); 704 if (rule[3] === "em") { 705 width = emsToPixels(parseFloat(rule[2]), el); 706 } 707 708 // Calculate the width of the target without the class added. 709 var defaultWidth = getDefaultWidth(el, rule[4]); 710 // Test current width against target width and add/remove class values. 711 if ( compareFunction[rule[1]](defaultWidth, width) ) { 712 window._gmrp && _gmrp.$ && _gmrp.$( document ).trigger( "mrp.resp.container.change", "+" + rule[4] ); 713 if (el.className.indexOf(rule[4]) < 0) { 714 el.className += " " + rule[4]; 715 } 716 } else { 717 window._gmrp && _gmrp.$ && _gmrp.$( document ).trigger( "mrp.resp.container.change", "-" + rule[4] ); 718 var class_name = el.className.replace(new RegExp('(^| )'+rule[4]+'( |$)'), '$1'); 719 class_name = class_name.replace(/ $/, ''); 720 el.className = class_name; 721 } 722 } 723 } 724 } 725 726 var compareFunction = { 727 "min-width": function(a, b) { 728 return a > b; 729 }, 730 "max-width": function(a, b) { 731 return a < b; 732 } 733 } 734 735 function contentReady() { 736 if (loaded) { 737 return; 738 } 739 loaded = true; 740 findContainerQueries(); 741 applyRules(); 742 if (win.addEventListener) { 743 win.addEventListener("resize", applyRules, false); 744 745 } 746 // Allow for resizing text after the page has loaded. 747 var current_em = emsToPixels(1, doc.body); 748 win.setInterval(function() { 749 var new_em = emsToPixels(1, doc.body); 750 if (new_em !== current_em) { 751 applyRules(); 752 current_em = new_em; 753 } 754 }, 2000); 755 } 756 757 function memoize( f ) { 758 return function () { 759 var args = Array.prototype.slice.call(arguments); 760 f.memoize = f.memoize || {}; 761 return (args in f.memoize) ? f.memoize[args] : f.memoize[args] = f.apply(this, args); 762 }; 763 } 764 765 var emsToPixels = memoize(function(em, scope) { 766 var test = doc.createElement("div"); 767 test.style.fontSize = "1em"; 768 test.style.margin = "0"; 769 test.style.padding = "0"; 770 test.style.border = "none"; 771 test.style.width = "1em"; 772 scope.appendChild(test); 773 var val = test.offsetWidth; 774 scope.removeChild(test); 775 return Math.round(val * em); 776 }); 777 778 var getDefaultWidth = function(el, class_name) { 779 if( true ) { 780 // we don't need to be fancy, simple width is ok, all the resp containers are flexible 781 return el.offsetWidth; 782 } 783 //console.log( "hit width", el ); 784 var test = el.cloneNode(true); 785 test.className = (" " + test.className + " ").replace(" " + class_name + " ", " "); 786 test.style.height = 0; 787 test.style.visibility = "hidden"; 788 test.style.overflow = "hidden"; 789 test.style.clear = "both"; 790 var parent = el.parentNode; 791 parent.insertBefore(test, el); 792 var val = test.offsetWidth; 793 parent.removeChild(test); 794 return val; 795 } 796 797 if( window.addEventListener ) { 798 console.log( "installing mrpRescanResponsifyContainers listener" ); 799 window.addEventListener("mrpRescanResponsifyContainers", function() { 800 console.log( "mrpRescanResponsifyContainers" ); 801 findContainerQueries(); 802 applyRules(); 803 }, false); 804 } 805 else if (window.attachEvent) { 806 window.attachEvent("mrpRescanResponsifyContainers", function() { 807 findContainerQueries(); 808 applyRules(); 809 }); 810 } 811 812 if( /loaded|complete|interactive/.test(doc.readyState) ) { 813 contentReady(); 814 } 815 else if (doc.addEventListener) { 816 doc.addEventListener("DOMContentLoaded", contentReady, false); 817 // or 818 win.addEventListener("load", contentReady, false); 819 } 820 // If old IE 821 else if (doc.attachEvent) { 822 doc.attachEvent("onreadystatechange", contentReady); 823 // or 824 win.attachEvent("onload", contentReady); 825 } 826 827 828 win["SelectorQueries"] = { 829 "add": add, 830 "ignoreDataAttributes": ignoreDataAttributes 831 } 832 833})(this); 834 835 836 837/* ==== INCLUDE: /js/blocks/menu200c.js ==== */ 838 839document.addEventListener( 'DOMContentLoaded', ev => { 840 841 document.body.addEventListener( 'mouseover', ev => { 842 843 if( document.querySelector('html').classList.contains('editing')) { 844 return 845 } 846 if( !ev.target.matches( '.hmenu2 li.has-submenu, .hmenu2 li.has-submenu > *' ) ) { 847 return 848 } 849 const el = ev.target.closest( 'li' ) 850 ev.preventDefault() 851 ev.stopPropagation() 852 853 document.querySelectorAll( '.hmenu2 li.open' ).forEach( open => { 854 if( open.contains(el) ) { 855 return 856 } 857 open.classList.remove('open') 858 open.classList.remove('visible') 859 }) 860 if( el.classList.contains('open')) { 861 // toggle 862 el.classList.remove('open'); 863 el.classList.remove('visible'); 864 return; 865 } 866 // open -> does display: block which acquires dimension for popper 867 el.classList.add( 'open' ) 868 setTimeout( () => { 869 // then we fade it in 870 el.classList.add( 'visible' ) 871 }, 100 ) 872 873 if( el.__popper ) {
874 el.__popper.update() 875 return 876 } 877 878 console.log( 'placement', el.closest('ul' ).classList.contains('mrp-menu-level-0') ? 'bottom-start' : 'right-start' ) 879 880 el.__popper = Popper.createPopper( el, el.querySelector( 'ul'), { 881 placement: el.closest('ul' ).classList.contains('mrp-menu-level-0') ? 'bottom-start' : 'right-start', 882 }) 883 }) 884 885}) 886 887 888/*! 889 * Mmenu Light 890 * mmenujs.com/mmenu-light 891 * 892 * Copyright (c) Fred Heusschen 893 * www.frebsite.nl 894 * 895 * License: CC-BY-4.0 896 * http://creativecommons.org/licenses/by/4.0/ 897 * 898 * MODIFIED with new class names 899 */ 900 901!function(t){var e={};function n(i){if(e[i])return e[i].exports;var s=e[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)n.d(i,s,function(e){return t[e]}.bind(null,s));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";n.r(e);var i=function(){function t(t){var e=this;this.listener=function(t){(t.matches?e.matchFns:e.unmatchFns).forEac
901h((function(t){t()}))},this.toggler=window.matchMedia(t),this.toggler.addListener(this.listener),this.matchFns=[],this.unmatchFns=[]}return t.prototype.add=function(t,e){this.matchFns.push(t),this.unmatchFns.push(e),(this.toggler.matches?t:e)()},t}(),s=function(t){return Array.prototype.slice.call(t)},o=function(t,e){return s((e||document).querySelectorAll(t))},r=("ontouchstart"in window||navigator.msMaxTouchPoints,navigator.userAgent.indexOf("MSIE")>-1||navigator.appVersion.indexOf("Trident/")>-1),a="mm2-spn",c=function(){function t(t,e,n,i,s){this.node=t,this.title=e,this.slidingSubmenus=i,this.selectedClass=n,this.node.classList.add(a),r&&(this.slidingSubmenus=!1),this.node.classList.add(a+"--"+s),this.node.classList.add(a+"--"+(this.slidingSubmenus?"navbar":"vertical")),this._setSelectedl(),this._initAnchors()}return Object.defineProperty(t.prototype,"prefix",{get:function(){return a},enumerable:!1,configurable:!0}),t.prototype.openPanel=function(t){var e=t.parentElement;if(this.slidingSubmenus){var n=t.dataset.mmSpnTitle;e===this.node?this.node.classList.add(a+"--main"):(this.node.classList.remove(a+"--main"),n||s(e.children).forEach((function(t){t.matches("a, span")&&(n=t.textContent)}))),n||(n=this.title),this.node.dataset.mmSpnTitle=n,o(".mm2-spn--open",this.node).forEach((function(t){t.classList.remove(a+"--open"),t.classList.remove(a+"--parent")})),t.classList.add(a+"--open"),t.classList.remove(a+"--parent");for(var i=t.parentElement.closest("ul");i;)i.classList.add(a+"--open"),i.classList.add(a+"--parent"),i=i.parentElement.closest("ul")}else{var r=t.matches(".mm2-spn--open");r?e.classList.remove(a+"--open-parent"):e.classList.add(a+"--open-parent"),t.classList[r?"remove":"add"](a+"--open");for(var c=t.parentElement.closest("ul");c;)c.classList.add(a+"--open"),c=c.parentElement.closest("ul")}},t.prototype._setSelectedl=function(){var t=o("."+this.selectedClass,this.node),e=t[t.length-1],n=null;e&&(n=e.closest("ul")),n||(n=this.node.querySelector("ul")),this.openPanel(n)},t.prototype._initAnchors=function(){var t=this;this.node.addEventListener("click",(function(e){var n=e.target,i=!1;(i=(i=(i=i||function(t){return!!t.matches("a")}(n))||function(e){var n;return!!(n=e.closest("span")?e.parentElement:!!e.closest("li")&&e)&&(s(n.children).forEach((function(e){e.matches("ul")&&t.openPanel(e)})),!0)}(n))||function(e){var n=o(".mm2-spn--open",e),i=n[n.length-1];if(i){var s=i.parentElement.closest("ul");
901if(s)return t.openPanel(s),!0}return!1}(n))&&e.stopImmediatePropagation()}))},t}(),d=function(){function t(t,e){var n=this;void 0===t&&(t=null),this.wrapper=document.createElement("div"),this.wrapper.classList.add("mm2-ocd"),this.wrapper.classList.add("mm2-ocd--"+e),this.content=document.createElement("div"),this.content.classList.add("mm2-ocd__content"),this.wrapper.append(this.content),this.backdrop=document.createElement("div"),this.backdrop.classList.add("mm2-ocd__backdrop"),this.wrapper.append(this.backdrop),document.body.append(this.wrapper),t&&this.content.append(t);var i=function(t){n.close(),t.stopImmediatePropagation()};this.backdrop.addEventListener("touchstart",i,{passive:!0}),this.backdrop.addEventListener("mousedown",i,{passive:!0})}return Object.defineProperty(t.prototype,"prefix",{get:function(){return"mm2-ocd"},enumerable:!1,configurable:!0}),t.prototype.open=function(){this.wrapper.classList.add("mm2-ocd--open"),document.querySelector('html').classList.add("mm2-ocd-opened")},t.prototype.close=function(){this.wrapper.classList.remove("mm2-ocd--open"),document.querySelector('html').classList.remove("mm2-ocd-opened")},t}(),l=function(){function t(t,e){void 0===e&&(e="all"),this.menu=t,this.toggler=new i(e)}return t.prototype.navigation=function(t){var e=this;if(!this.navigator){var n=(t=t||{}).title,i=void 0===n?"Menu":n,s=t.selectedClass,o=void 0===s?"Selected":s,r=t.slidingSubmenus,a=void 0===r||r,d=t.theme,l=void 0===d?"light":d;this.navigator=new c(this.menu,i,o,a,l),this.toggler.add((function(){return e.menu.classList.add(e.navigator.prefix)}),(function(){return e.menu.classList.remove(e.navigator.prefix)}))}return this.navigator},t.prototype.offcanvas=function(t){var e=this;if(!this.drawer){var n=(t=t||{}).position,i=void 0===n?"left":n;this.drawer=new d(null,i);var s=document.createComment("original menu location");this.menu.after(s),this.toggler.add((function(){e.drawer.content.append(e.menu)}),(function(){e.drawer.close(),s.after(e.menu)}))}return this.drawer},t}();e.default=l;window.MmenuLight2=l}]); 902 903;(function () { 904 905 const menus = {} 906 907 const init = (id) => { 908 // re-entrant 909 910 if( id ) { 911 // re-init 912 // first destroy all existing (after apply in-place changes) constructs 913 document.querySelectorAll( '[data-rel="' + id + '"]').forEach( existing => { 914 // existing.remove() 915 }) 916 } 917 918 document.querySelectorAll( '.vmenu200c').forEach( (el, index) => { 919 if( el.classList.contains('inited')) { 920 return 921 } 922 el.classList.add('inited') 923 924 const blockId = el.closest( '.block-layout' ).getAttribute('id') 925 926 927 928 const menu = new MmenuLight2( el, 'all' ) 929 const navigation = menu.navigation({ 930 selected: 'selected', 931 slidingSubmenus: 'true' === el.getAttribute('data-slide'), 932 theme: 'true' === el.getAttribute('data-dark') ? 'dark' : 'light', 933 title: '' 934 }) 935 936 const drawer = menu.offcanvas({ 937 position: 'right' === el.getAttribute('data-position') ? 'right' : 'left', 938 }) 939 940 drawer.wrapper.setAttribute( 'data-rel', blockId ) 941 942 el.classList.remove('initial') 943 944 // if id was given to us in init(id), then we are reiniting 945 if( id && index === 0 ) { 946 menus[blockId] = [] 947 } 948 if( !menus[blockId] ) { 949 // array for potentially multiple per block 950 menus[blockId] = [] 951 } 952 menus[blockId].push({ navigation, drawer }) 953 }) 954 } 955 956 document.addEventListener('DOMContentLoaded', () => { 957 init() 958 _G.reinitHandlers.push(init) 959 960 document.addEventListener('editor.on', () => { 961 Reflect.ownKeys(menus).forEach( m => { 962 const handlers = menus[m] 963 handlers.forEach( h => { 964 try { 965 h.drawer.close() 966 } 967 catch( e ) {} 968 }) 969 }) 970 }) 971 972 document.addEventListener('keydown', ev => { 973 if( ev.key === 'Escape' ) {
974 Reflect.ownKeys(menus).forEach( m => { 975 const handlers = menus[m] 976 handlers.forEach( h => { 977 try { 978 h.drawer.close() 979 } 980 catch( e ) {} 981 }) 982 }) 983 } 984 }) 985 986 window.addEventListener('hashchange', ev => { 987 Reflect.ownKeys(menus).forEach( m => { 988 const handlers = menus[m] 989 handlers.forEach( h => { 990 try { 991 h.drawer.close() 992 } 993 catch( e ) {} 994 }) 995 }) 996 }) 997 998 document.addEventListener('click', ev => { 999 if( ev.target.className === 'close-button' ) { 1000 Reflect.ownKeys(menus).forEach( m => { 1001 const handlers = menus[m] 1002 handlers.forEach( h => { 1003 try { 1004 h.drawer.close() 1005 } 1006 catch( e ) {} 1007 }) 1008 }) 1009 } 1010 }) 1011 1012 document.addEventListener('click', ev => { 1013 if( ev.target && ev.target && 1014 ev.target.closest('.vmenu-opener2')) { 1015 1016 if( document.querySelector('html').classList.contains('editing')) { 1017 return 1018 } 1019 const blockId = ev.target.closest('.block-layout').getAttribute('id') 1020 const index = parseInt(ev.target.closest('.vmenu-opener2').getAttribute( 'data-index')) || 0 1021 const handlers = menus[blockId] 1022 if( Array.isArray(handlers) && handlers[index]) { 1023 handlers[index].drawer.open() 1024 if( handlers[index].navigation.slidingSubmenus ) { 1025 handlers[index].navigation.openPanel(handlers[index].navigation.node.querySelector('ul')) 1026 } 1027 handlers[index].drawer.content.querySelector('.vmenu200c').focus() 1028 } 1029 } 1030 }) 1031 }) 1032})() 1033 1034 1035 1036document.addEventListener( 'DOMContentLoaded', function() { 1037 1038 function initBlock(id) { 1039 const block = document.getElementById(id) 1040 if( block.querySelector('.fixed-menu')) { 1041 init( block.querySelector( '.fixed-menu' ) ) 1042 } 1043 } 1044 1045 function isMenuVisible (el) { 1046 var rect = el.getBoundingClientRect(); 1047 1048 if( rect.top < 0 ) { 1049 return false; 1050 } 1051 else { 1052 return true; 1053 } 1054 } 1055 1056 function floatMenu( el ) { 1057 // if( el.querySelector('.fixed' ).classList.contains( 'floating')) { 1058 // return 1059 // } 1060 if( document.querySelector('html').classList.contains('editing') ) { 1061 return unfloatMenu(el) 1062 } 1063 el.querySelector('.fixed' ).style.opacity = '1' 1064 // el.querySelector('.fixed' ).classList.add( 'floating' ) 1065 el.classList.add( 'fixed-on' ) 1066 } 1067 1068 function unfloatMenu( el ) { 1069 // if( !el.querySelector('.fixed' ).classList.contains( 'floating')) { 1070 // return 1071 // } 1072 // el.querySelector('.fixed' ).classList.remove( 'floating' ) 1073 el.classList.remove( 'fixed-on' ) 1074 } 1075 1076 function init( el ) { 1077 if( !el || !el.querySelector( '.fixed' )) { 1078 return 1079 } 1080 1081 window.addEventListener( 'scroll', function() { 1082 isMenuVisible( el ) ? unfloatMenu(el) : floatMenu(el) 1083 }, { passive: true }) 1084 1085 1086 if( !isMenuVisible(el) ) { 1087 floatMenu(el) 1088 } 1089 1090 document.addEventListener( 'editor.on', function() { 1091 unfloatMenu( el ) 1092 }) 1093 document.addEventListener( 'editor.off', function() { 1094 if( !isMenuVisible( el ) ) { 1095 floatMenu( el ) 1096 } 1097 }) 1098 } 1099 1100 document.querySelectorAll( '.fixed-menu' ).forEach( function(el) { 1101 init( el ) 1102 }) 1103 1104 _G.reinitHandlers.push(initBlock) 1105}) 1106 1107 1108/* ==== INCLUDE: /js/weblets/blog.js ==== */ 1109 1110 1111function toggle(divName){ 1112 1113 var row = document.getElementById(divName); 1114 var image = document.getElementById('img' + divName); 1115 1116 if(row.style.display == 'none'){ 1117 row.style.display = 'block'; 1118 image.src = '/img/collapseall.gif'; 1119 } 1120 else{ 1121 row.style.display = 'none'; 1122 image.src = '/img/expandall.gif'; 1123 } 1124 1125} 1126 1127function timestampToString(timestamp, skipTime) { 1128 if (timestamp) { 1129 var a = new Date(timestamp); 1130 var year = a.getFullYear();
1131 var month = ''; 1132 if (skipTime) { 1133 var months = ['January','February','March','April','May','June','July','August','September','October','November','December']; 1134 month = months[a.getMonth()]; 1135 } else { 1136 var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']; 1137 month = months[a.getMonth()]; 1138 } 1139 var date = a.getDate(); 1140 if (skipTime) 1141 return month+' '+date+', '+year; 1142 var hour = a.getHours(); 1143 var min = a.getMinutes(); 1144 var am = ''; 1145 if (hour==0) { 1146 hour = 12; 1147 am = 'PM'; 1148 } else if (hour<=12) { 1149 am = 'AM'; 1150 } else { 1151 hour -= 12; 1152 am = 'PM'; 1153 } 1154 if (min<10) { 1155 min = "0"+min; 1156 } 1157 return month+' '+date+', '+year+' '+hour+':'+min+' '+am; 1158 } 1159 return ""; 1160} 1161 1162function updateAllTimestamps() { 1163 var dates = document.querySelectorAll( '.weblet_blog-date-friendly' ); 1164 for (var i=0; i<dates.length; i++) { 1165 var timestamp = dates[i].getAttribute('timestamp'); 1166 if (timestamp) { 1167 dates[i].innerHTML = timestampToString( parseInt( timestamp ), true ); 1168 } 1169 } 1170 dates = document.querySelectorAll( '.weblet_blog-date-full, .weblet_blog-comment-date-full' ); 1171 for (var i=0; i<dates.length; i++) { 1172 var timestamp = dates[i].getAttribute('timestamp'); 1173 if (timestamp) { 1174 dates[i].innerHTML = 'on '+timestampToString( parseInt( timestamp ) ); 1175 } 1176 } 1177} 1178 1179function updateListingBanners() { 1180 var banners = document.querySelectorAll( ".weblet_blog-entry-text .listing-banner" ); 1181 for( var i=0; i<banners.length; ++i ) { 1182 var article = banners[i].closest( ".weblet_blog-blog-entry"); 1183 if( article ) { 1184 var imageLink = article.querySelector( "a.weblet_blog-main-image-link" ); 1185 if( imageLink ) { 1186 imageLink.appendChild( banners[i] ); 1187 banners[i].classList.add( "ready" ); 1188 } 1189 } 1190 } 1191} 1192 1193function createScrollParallaxForBlogImages() { 1194 var images = document.querySelectorAll( ".blog-post-full .blog-with-parallax .weblet_blog-entry-image-container" ); 1195 for (i = 0; i < images.length; i++) { 1196 var p = document.createElement("div"); 1197 p.classList.add( "weblet_blog-entry-image-container-parallax"); 1198 p.classList.add( "with-scroll-parallax" ); 1199 images[i].appendChild(p); 1200 _G.parallaxService.add(p); 1201 } 1202} 1203 1204 1205function mrp_shareBlogWindow(target) { 1206 var url = target.getAttribute( "data-url" ); 1207 mrp_open_new_window( url, 600, 400, "share-blog-post" ); 1208} 1209 1210window.customOnLoads = window.customOnLoads || []; 1211 1212window.customOnLoads.push( function() { 1213 var images = document.querySelectorAll( ".blog-entry-list .weblet_blog-entry-image-container" ); 1214 for (i = 0; i < images.length; i++) { 1215 if( images[i].parentElement && images[i].parentElement.nodeName === 'A' ) { 1216 continue; 1217 } 1218 images[i].style.cursor = "pointer"; 1219 images[i].addEventListener( "click", function(ev,elem) { 1220 var url = ev.target.getAttribute( "data-link" ); 1221 if( url ) { 1222 window.location = url; 1223 } 1224 }); 1225 } 1226}); 1227 1228window.customOnLoads.push( function() { 1229 updateAllTimestamps(); 1230 updateListingBanners(); 1231 createScrollParallaxForBlogImages(); 1232}); 1233 1234 1235 1236 1237/* ==== INCLUDE: /js/weblets/responsive/blog-resp.js ==== */ 1238 1239;(function() { 1240 1241 function launchLightbox( thumb ) { 1242 var index = Array.prototype.indexOf.call(thumb.parentNode.childNodes, thumb); 1243 var lightbox = new FsLightbox() 1244 var sources = [] 1245 var captions = [] 1246 thumb.parentElement.querySelectorAll('img' ).forEach( function(img) { 1247 sources.push( img.getAttribute('src')) 1248 captions.push( img.getAttribute( 'alt') || '') 1249 }) 1250 lightbox.props.captions = captions 1251 lightbox.props.sources = sources 1252 lightbox.props.disableThumbs = true 1253 lightbox.props.slideChangeAnimation = 'slide-change-animation' 1254 lightbox.open(index || 0) 1255 } 1256 1257 function initThumb( el ) { 1258 if( el.getAttribute("inited") ) { 1259 return 1260 } 1261 el.setAttribute('inited', true ) 1262 el.addEventListener( 'click', function(event) { 1263 if( document.querySelector("html.editing")) { 1264 return; 1265 } 1266 launchLightbox(el) 1267 }) 1268 } 1269 1270 document.addEventListener( 'DOMContentLoaded', function() { 1271 document.querySelectorAll( '[data-type="gallery"] > img' ).forEach( function(el) { 1272 initThumb(el) 1273 }) 1274 }) 1275})(); 1276 1277/* ==== INCLUDE: /js/blocks/forms.js ==== */ 1278 1279;(function() { 1280 1281 // --- WAF attestation token (alpha) -------------------------------------- 1282 // Active only when the server emits window._wafTokenEndpoint (blank 1283 // waf.token.url in wps-application.properties = never emitted = inert). 1284 // Contract: never block, never break a submission -- any failure means no 1285 // token, the form submits exactly as before and the server scores "missing". 1286 const wafToken = (function() { 1287 let cached = null // { token, exp } 1288 let inflight = null 1289 1290 const endpoint = () => window._wafTokenEndpoint 1291 const fresh = () => cached && (cached.exp - 30) > Math.floor(Date.now() / 1000) 1292 1293 function request() { 1294 if( !endpoint() || !window.fetch ) { 1295 return Promise.resolve(null) 1296 } 1297 if( inflight ) { 1298 return inflight 1299 } 1300 const ctrl = window.AbortController ? new AbortController() : null 1301 const timer = ctrl && setTimeout( () => ctrl.abort(), 3000 ) 1302 inflight = fetch( endpoint(), { mode: 'cors', credentials: 'omit', 1303 signal: ctrl ? ctrl.signal : undefined } ) 1304 .then( r => r.ok ? r.json() : null ) 1305 .then( j => { 1306 if( j && j.token ) { 1307 cached = j 1308 } 1309 return j && j.token 1310 }) 1311 .catch( () => null ) // unreachable/CORS/timeout -> no token 1312 .finally( () => { 1313 if( timer ) clearTimeout(timer) 1314 inflight = null 1315 }) 1316 return inflight 1317 } 1318 1319 // mint on first interaction with any dynamic form; re-mint when stale 1320 document.addEventListener( 'focusin', ev => { 1321 if( endpoint() && ev.target.closest 1322 && ev.target.closest('.mrp-dynamic-form') && !fresh() ) { 1323 request() 1324 } 1325 }) 1326 1327 return { get: () => fresh() ? cached.token : null, request } 1328 })() 1329 1330 1331 function processSubmitResponse( origForm, html ) { 1332 1333 const targetFormEl = origForm.querySelector('[name=__targetForm]') 1334 if( !targetFormEl ) { 1335 console.error( "Failed to find __targetForm" ) 1336 return 1337 } 1338 1339 const targetForm = targetFormEl.getAttribute('value') 1340 1341 const htmlFragment = _G.createFragment(html) 1342 1343 const newTargetFormEl = htmlFragment.querySelector('[name=__targetForm][value="' + targetForm + '"]') 1344
1345 if( !newTargetFormEl ) { 1346 console.error( "Failed to find targetForm in the returned response" ) 1347 return 1348 } 1349 const newForm = newTargetFormEl.closest('form') 1350 // const newForm = _G.createFragment( html ).querySelector('form') 1351 newForm.querySelectorAll('.form-error').forEach( el => { 1352 el.remove() 1353 }) 1354 origForm.parentElement.replaceChild( newForm, origForm ) 1355 1356 setTimeout(function() { 1357 const firstError = newForm.querySelector('.control-error') 1358 if( firstError ) { 1359 const top = firstError.getBoundingClientRect().top 1360 if( top < 0 ) { 1361 window.scrollTo( {top: window.scrollY + top - 100, behavior: 'smooth'}) 1362 } 1363 } 1364 }, 50) 1365 } 1366 1367 _G.onSubmitForm = ( form, customCallback ) => { 1368 1369 let submitting = true 1370 1371 function submitFeedback( form ) { 1372 setTimeout( () => { 1373 1374 if( !submitting ) { 1375 return 1376 } 1377 const submit = form.querySelector( '[type=submit]') 1378 if( submit ) { 1379 // const submitText = submit.innerText; 1380 // submit.setAttribute('data-submit-text', submitText ) 1381 // submit.innerText = 'Sending' 1382 submit.classList.add('submitting') 1383 submit.setAttribute('disabled', 'disabled') 1384 } 1385 }, 100 ) 1386 } 1387 1388 function undoSubmitFeedback( form ) { 1389 // note that we are passing our original form, not the new replaced form 1390 // so this will only fire if there was a network issue and no form 1391 // arrived back; otherwise, the new form would have had reset submit anyways 1392 const submit = form.querySelector( '[type=submit]') 1393 if( submit ) { 1394 // submit.innerText = submit.getAttribute('data-submit-text') 1395 submit.classList.remove('submitting') 1396 submit.removeAttribute('disabled') 1397 } 1398 } 1399 1400 let authTk = form.getAttribute('data-tk') 1401 if( !authTk ) { 1402 // try hidden 1403 const hidden = form.querySelector('input[name=__sh]') 1404 if( hidden ) { 1405 authTk = hidden.getAttribute('value') 1406 } 1407 if( !authTk ) { 1408 // bail 1409 console.error( 'auth token missing' ) 1410 return 1411 } 1412 } 1413 1414 const data = new URLSearchParams() 1415 for (const pair of new FormData(form)) { 1416 data.append(pair[0], pair[1].toString()) 1417 } 1418 data.append( '__src_url', window.location.href ) 1419 data.append( '__sh', authTk ) 1420 1421 if( !wafToken.get() ) { 1422 wafToken.request() // last-chance mint; races the submit delay below 1423 } 1424 1425 submitFeedback( form ) 1426 1427 setTimeout( () => { 1428 const wafTk = wafToken.get() 1429 if( wafTk ) { 1430 data.append( '__waf_tk', wafTk ) 1431 } 1432 fetch( window.location.href, { 1433 method: 'post', 1434 body: data, 1435 headers: { 1436 'X-Requested-With': 'fetch', 1437 'X-Form-Submit': 'true', 1438 'X-Form-Submit-From': window.location.href, 1439 } 1440 }).then( response => { 1441 if( customCallback ) { 1442 return customCallback(response) 1443 } 1444 const redir = response.headers.get('Location') 1445 if( redir ) { 1446 return window.location = redir 1447 } 1448 response.text().then( html => { 1449 // console.log( 'form html', html ) 1450 1451 const error = response.headers.get('X-Form-Error') 1452 const successURL = response.headers.get( 'X-Success-URL') 1453 const success = response.headers.get( 'X-Success-Message' ) 1454 1455 if( !error && success && successURL ) { 1456 window.location = successURL 1457 return 1458 } 1459 1460 processSubmitResponse( form, html ) 1461 1462 if( error ) { 1463 _G.quickMessage(error, { error: true } ); 1464 } 1465 else if( success ) { 1466 _G.quickMessage(success) 1467 1468 if( window.dataLayer ) { 1469 window.dataLayer.push( { 1470 event: 'formSubmitted', 1471 formURL: window.location.href, 1472 title: document.title, 1473 formName: data.get( '__formName') || '' 1474 }) 1475 } 1476 1477 window.dispatchEvent( new CustomEvent( "mrp.webFormSubmitted", { 1478 detail: { 1479 formURL: window.location.href, 1480 title: document.title, 1481 formName: data.get( '__formName') || '' 1482 } 1483 })); 1484 } 1485 }) 1486 }).catch( err => { 1487 console.error( "error occurred during form submission", err ) 1488 _G.quickMessage('Error occurred during form submission', { error: true } ); 1489 }).finally( () => { 1490 submitting = false 1491 undoSubmitFeedback(form) 1492 }) 1493 }, 1000 ) 1494 1495 1496 return false;
1497 } 1498 1499 1500 function processBlogCommentSubmitResponse( origForm, html ) { 1501 1502 const formID = origForm.getAttribute("id"); 1503 1504 const htmlFragment = _G.createFragment(html) 1505 1506 const newForm = htmlFragment.querySelector('#' + formID) 1507 1508 // const successEl = newForm.querySelector(".form-success"); 1509 // if( successEl && successEl.innerText ) { 1510 // const message = successEl.innerText; 1511 // setTimeout(() => { 1512 // _G.quickMessage( message, { 1513 // 1514 // }); 1515 // }, 100 ); 1516 // successEl.remove(); 1517 // } 1518 1519 // const newForm = _G.createFragment( html ).querySelector('form') 1520 newForm.querySelectorAll('.form-error').forEach( el => { 1521 el.remove() 1522 }) 1523 const authTk = newForm.getAttribute("data-tk"); 1524 if( authTk ) { 1525 const authTkEl = document.createElement("input"); 1526 authTkEl.setAttribute( "type", "hidden" ); 1527 authTkEl.setAttribute( "value", authTk ); 1528 newForm.appendChild( authTkEl ); 1529 } 1530 const srcUrlEl = document.createElement("input"); 1531 srcUrlEl.setAttribute( "type", "hidden" ); 1532 srcUrlEl.setAttribute( "value", window.location.href ); 1533 newForm.appendChild( srcUrlEl ); 1534 origForm.parentElement.replaceChild( newForm, origForm ); 1535 1536 1537 setTimeout(function() { 1538 const firstError = newForm.querySelector('.control-error') 1539 if( firstError ) { 1540 const top = firstError.getBoundingClientRect().top 1541 if( top < 0 ) { 1542 window.scrollTo( {top: window.scrollY + top - 100, behavior: 'smooth'}) 1543 } 1544 } 1545 }, 50) 1546 } 1547 1548 _G.onBlogCommentSubmitForm = ( form, customCallback ) => { 1549 1550 let submitting = true 1551 1552 function submitFeedback( form ) { 1553 setTimeout( () => { 1554 1555 if( !submitting ) { 1556 return 1557 } 1558 const submit = form.querySelector( '[type=submit]') 1559 if( submit ) { 1560 // const submitText = submit.innerText; 1561 // submit.setAttribute('data-submit-text', submitText ) 1562 // submit.innerText = 'Sending' 1563 submit.classList.add('submitting') 1564 submit.setAttribute('disabled', 'disabled') 1565 } 1566 }, 100 ) 1567 } 1568 1569 function undoSubmitFeedback( form ) { 1570 // note that we are passing our original form, not the new replaced form 1571 // so this will only fire if there was a network issue and no form 1572 // arrived back; otherwise, the new form would have had reset submit anyways 1573 const submit = form.querySelector( '[type=submit]') 1574 if( submit ) { 1575 // submit.innerText = submit.getAttribute('data-submit-text') 1576 submit.classList.remove('submitting') 1577 submit.removeAttribute('disabled') 1578 } 1579 } 1580 1581 let authTk = form.getAttribute('data-tk') 1582 if( !authTk ) { 1583 // try hidden 1584 const hidden = form.querySelector('input[name=__sh]') 1585 if( hidden ) { 1586 authTk = hidden.getAttribute('value') 1587 } 1588 if( !authTk ) { 1589 // bail 1590 console.error( 'auth token missing' ) 1591 return 1592 } 1593 } 1594 1595 const data = new URLSearchParams() 1596 for (const pair of new FormData(form)) { 1597 data.append(pair[0], pair[1].toString()) 1598 } 1599 data.append( '__src_url', window.location.href ) 1600 data.append( '__sh', authTk ) 1601 1602 submitFeedback( form ) 1603 1604 setTimeout( () => { 1605 fetch( window.location.href, { 1606 method: 'post', 1607 body: data, 1608 headers: { 1609 'X-Requested-With': 'fetch', 1610 'X-Form-Submit': 'true', 1611 'X-Form-Submit-From': window.location.href, 1612 } 1613 }).then( response => { 1614 if( customCallback ) { 1615 return customCallback(response) 1616 } 1617 const redir = response.headers.get('Location') 1618 if( redir ) { 1619 return window.location = redir 1620 } 1621 response.text().then( html => { 1622 // console.log( 'form html', html ) 1623 1624 const error = response.headers.get('X-Form-Error') 1625 const successURL = response.headers.get( 'X-Success-URL') 1626 const success = true; 1627 // const success = "Comment submitted. It will be reviewed and published shortly." 1628 1629 if( !error && success && successURL ) { 1630 window.location = successURL 1631 return 1632 } 1633 1634 processBlogCommentSubmitResponse( form, html ) 1635 1636 if( error ) { 1637 _G.quickMessage(error, { error: true } ); 1638 } 1639 else { 1640 // _G.quickMessage(success) 1641 1642 if( window.dataLayer ) { 1643 window.dataLayer.push( { 1644 event: 'formSubmitted', 1645 formURL: window.location.href, 1646 title: document.title, 1647 formName: data.get( '__formName') || '' 1648 }) 1649 } 1650 } 1651 }) 1652 }).catch( err => { 1653 console.error( "error occurred during form submission", err ) 1654 _G.quickMessage('Error occurred during form submission', { error: true } ); 1655 }).finally( () => { 1656 submitting = false 1657 undoSubmitFeedback(form) 1658 }) 1659 }, 1000 ) 1660 1661 1662 return false;
1663 } 1664})() 1665 1666/* ==== INCLUDE: /js/blocks/forms.js ==== */ 1667 1668;(function() { 1669 1670 // --- WAF attestation token (alpha) -------------------------------------- 1671 // Active only when the server emits window._wafTokenEndpoint (blank 1672 // waf.token.url in wps-application.properties = never emitted = inert). 1673 // Contract: never block, never break a submission -- any failure means no 1674 // token, the form submits exactly as before and the server scores "missing". 1675 const wafToken = (function() { 1676 let cached = null // { token, exp } 1677 let inflight = null 1678 1679 const endpoint = () => window._wafTokenEndpoint 1680 const fresh = () => cached && (cached.exp - 30) > Math.floor(Date.now() / 1000) 1681 1682 function request() { 1683 if( !endpoint() || !window.fetch ) { 1684 return Promise.resolve(null) 1685 } 1686 if( inflight ) { 1687 return inflight 1688 } 1689 const ctrl = window.AbortController ? new AbortController() : null 1690 const timer = ctrl && setTimeout( () => ctrl.abort(), 3000 ) 1691 inflight = fetch( endpoint(), { mode: 'cors', credentials: 'omit', 1692 signal: ctrl ? ctrl.signal : undefined } ) 1693 .then( r => r.ok ? r.json() : null ) 1694 .then( j => { 1695 if( j && j.token ) { 1696 cached = j 1697 } 1698 return j && j.token 1699 }) 1700 .catch( () => null ) // unreachable/CORS/timeout -> no token 1701 .finally( () => { 1702 if( timer ) clearTimeout(timer) 1703 inflight = null 1704 }) 1705 return inflight 1706 } 1707 1708 // mint on first interaction with any dynamic form; re-mint when stale 1709 document.addEventListener( 'focusin', ev => { 1710 if( endpoint() && ev.target.closest 1711 && ev.target.closest('.mrp-dynamic-form') && !fresh() ) { 1712 request() 1713 } 1714 }) 1715 1716 return { get: () => fresh() ? cached.token : null, request } 1717 })() 1718 1719 1720 function processSubmitResponse( origForm, html ) { 1721 1722 const targetFormEl = origForm.querySelector('[name=__targetForm]') 1723 if( !targetFormEl ) { 1724 console.error( "Failed to find __targetForm" ) 1725 return 1726 } 1727 1728 const targetForm = targetFormEl.getAttribute('value') 1729 1730 const htmlFragment = _G.createFragment(html) 1731 1732 const newTargetFormEl = htmlFragment.querySelector('[name=__targetForm][value="' + targetForm + '"]') 1733 1734 if( !newTargetFormEl ) { 1735 console.error( "Failed to find targetForm in the returned response" ) 1736 return 1737 } 1738 const newForm = newTargetFormEl.closest('form') 1739 // const newForm = _G.createFragment( html ).querySelector('form') 1740 newForm.querySelectorAll('.form-error').forEach( el => { 1741 el.remove() 1742 }) 1743 origForm.parentElement.replaceChild( newForm, origForm ) 1744 1745 setTimeout(function() { 1746 const firstError = newForm.querySelector('.control-error') 1747 if( firstError ) { 1748 const top = firstError.getBoundingClientRect().top 1749 if( top < 0 ) { 1750 window.scrollTo( {top: window.scrollY + top - 100, behavior: 'smooth'}) 1751 } 1752 } 1753 }, 50) 1754 } 1755 1756 _G.onSubmitForm = ( form, customCallback ) => { 1757 1758 let submitting = true 1759 1760 function submitFeedback( form ) { 1761 setTimeout( () => { 1762 1763 if( !submitting ) { 1764 return 1765 } 1766 const submit = form.querySelector( '[type=submit]') 1767 if( submit ) { 1768 // const submitText = submit.innerText; 1769 // submit.setAttribute('data-submit-text', submitText ) 1770 // submit.innerText = 'Sending' 1771 submit.classList.add('submitting') 1772 submit.setAttribute('disabled', 'disabled') 1773 } 1774 }, 100 ) 1775 } 1776 1777 function undoSubmitFeedback( form ) { 1778 // note that we are passing our original form, not the new replaced form 1779 // so this will only fire if there was a network issue and no form 1780 // arrived back; otherwise, the new form would have had reset submit anyways 1781 const submit = form.querySelector( '[type=submit]') 1782 if( submit ) { 1783 // submit.innerText = submit.getAttribute('data-submit-text') 1784 submit.classList.remove('submitting') 1785 submit.removeAttribute('disabled') 1786 } 1787 } 1788 1789 let authTk = form.getAttribute('data-tk') 1790 if( !authTk ) { 1791 // try hidden 1792 const hidden = form.querySelector('input[name=__sh]') 1793 if( hidden ) { 1794 authTk = hidden.getAttribute('value') 1795 } 1796 if( !authTk ) { 1797 // bail 1798 console.error( 'auth token missing' ) 1799 return 1800 } 1801 } 1802 1803 const data = new URLSearchParams() 1804 for (const pair of new FormData(form)) { 1805 data.append(pair[0], pair[1].toString()) 1806 } 1807 data.append( '__src_url', window.location.href ) 1808 data.append( '__sh', authTk ) 1809 1810 if( !wafToken.get() ) { 1811 wafToken.request() // last-chance mint; races the submit delay below 1812 } 1813 1814 submitFeedback( form ) 1815 1816 setTimeout( () => { 1817 const wafTk = wafToken.get() 1818 if( wafTk ) { 1819 data.append( '__waf_tk', wafTk ) 1820 } 1821 fetch( window.location.href, { 1822 method: 'post', 1823 body: data, 1824 headers: { 1825 'X-Requested-With': 'fetch', 1826 'X-Form-Submit': 'true', 1827 'X-Form-Submit-From': window.location.href, 1828 } 1829 }).then( response => { 1830 if( customCallback ) { 1831 return customCallback(response) 1832 } 1833 const redir = response.headers.get('Location') 1834 if( redir ) { 1835 return window.location = redir 1836 } 1837 response.text().then( html => { 1838 // console.log( 'form html', html ) 1839 1840 const error = response.headers.get('X-Form-Error') 1841 const successURL = response.headers.get( 'X-Success-URL') 1842 const success = response.headers.get( 'X-Success-Message' ) 1843 1844 if( !error && success && successURL ) { 1845 window.location = successURL 1846 return 1847 } 1848 1849 processSubmitResponse( form, html ) 1850 1851 if( error ) { 1852 _G.quickMessage(error, { error: true } ); 1853 } 1854 else if( success ) { 1855 _G.quickMessage(success) 1856 1857 if( window.dataLayer ) { 1858 window.dataLayer.push( { 1859 event: 'formSubmitted', 1860 formURL: window.location.href, 1861 title: document.title, 1862 formName: data.get( '__formName') || '' 1863 }) 1864 } 1865 1866 window.dispatchEvent( new CustomEvent( "mrp.webFormSubmitted", { 1867 detail: { 1868 formURL: window.location.href, 1869 title: document.title, 1870 formName: data.get( '__formName') || '' 1871 } 1872 })); 1873 } 1874 }) 1875 }).catch( err => { 1876 console.error( "error occurred during form submission", err ) 1877 _G.quickMessage('Error occurred during form submission', { error: true } ); 1878 }).finally( () => { 1879 submitting = false 1880 undoSubmitFeedback(form) 1881 }) 1882 }, 1000 ) 1883 1884 1885 return false;
1886 } 1887 1888 1889 function processBlogCommentSubmitResponse( origForm, html ) { 1890 1891 const formID = origForm.getAttribute("id"); 1892 1893 const htmlFragment = _G.createFragment(html) 1894 1895 const newForm = htmlFragment.querySelector('#' + formID) 1896 1897 // const successEl = newForm.querySelector(".form-success"); 1898 // if( successEl && successEl.innerText ) { 1899 // const message = successEl.innerText; 1900 // setTimeout(() => { 1901 // _G.quickMessage( message, { 1902 // 1903 // }); 1904 // }, 100 ); 1905 // successEl.remove(); 1906 // } 1907 1908 // const newForm = _G.createFragment( html ).querySelector('form') 1909 newForm.querySelectorAll('.form-error').forEach( el => { 1910 el.remove() 1911 }) 1912 const authTk = newForm.getAttribute("data-tk"); 1913 if( authTk ) { 1914 const authTkEl = document.createElement("input"); 1915 authTkEl.setAttribute( "type", "hidden" ); 1916 authTkEl.setAttribute( "value", authTk ); 1917 newForm.appendChild( authTkEl ); 1918 } 1919 const srcUrlEl = document.createElement("input"); 1920 srcUrlEl.setAttribute( "type", "hidden" ); 1921 srcUrlEl.setAttribute( "value", window.location.href ); 1922 newForm.appendChild( srcUrlEl ); 1923 origForm.parentElement.replaceChild( newForm, origForm ); 1924 1925 1926 setTimeout(function() { 1927 const firstError = newForm.querySelector('.control-error') 1928 if( firstError ) { 1929 const top = firstError.getBoundingClientRect().top 1930 if( top < 0 ) { 1931 window.scrollTo( {top: window.scrollY + top - 100, behavior: 'smooth'}) 1932 } 1933 } 1934 }, 50) 1935 } 1936 1937 _G.onBlogCommentSubmitForm = ( form, customCallback ) => { 1938 1939 let submitting = true 1940 1941 function submitFeedback( form ) { 1942 setTimeout( () => { 1943 1944 if( !submitting ) { 1945 return 1946 } 1947 const submit = form.querySelector( '[type=submit]') 1948 if( submit ) { 1949 // const submitText = submit.innerText; 1950 // submit.setAttribute('data-submit-text', submitText ) 1951 // submit.innerText = 'Sending' 1952 submit.classList.add('submitting') 1953 submit.setAttribute('disabled', 'disabled') 1954 } 1955 }, 100 ) 1956 } 1957 1958 function undoSubmitFeedback( form ) { 1959 // note that we are passing our original form, not the new replaced form 1960 // so this will only fire if there was a network issue and no form 1961 // arrived back; otherwise, the new form would have had reset submit anyways 1962 const submit = form.querySelector( '[type=submit]') 1963 if( submit ) { 1964 // submit.innerText = submit.getAttribute('data-submit-text') 1965 submit.classList.remove('submitting') 1966 submit.removeAttribute('disabled') 1967 } 1968 } 1969 1970 let authTk = form.getAttribute('data-tk') 1971 if( !authTk ) { 1972 // try hidden 1973 const hidden = form.querySelector('input[name=__sh]') 1974 if( hidden ) { 1975 authTk = hidden.getAttribute('value') 1976 } 1977 if( !authTk ) { 1978 // bail 1979 console.error( 'auth token missing' ) 1980 return 1981 } 1982 } 1983 1984 const data = new URLSearchParams() 1985 for (const pair of new FormData(form)) { 1986 data.append(pair[0], pair[1].toString()) 1987 } 1988 data.append( '__src_url', window.location.href ) 1989 data.append( '__sh', authTk ) 1990 1991 submitFeedback( form ) 1992 1993 setTimeout( () => { 1994 fetch( window.location.href, { 1995 method: 'post', 1996 body: data, 1997 headers: { 1998 'X-Requested-With': 'fetch', 1999 'X-Form-Submit': 'true', 2000 'X-Form-Submit-From': window.location.href, 2001 } 2002 }).then( response => { 2003 if( customCallback ) { 2004 return customCallback(response) 2005 } 2006 const redir = response.headers.get('Location') 2007 if( redir ) { 2008 return window.location = redir 2009 } 2010 response.text().then( html => { 2011 // console.log( 'form html', html ) 2012 2013 const error = response.headers.get('X-Form-Error') 2014 const successURL = response.headers.get( 'X-Success-URL') 2015 const success = true; 2016 // const success = "Comment submitted. It will be reviewed and published shortly." 2017 2018 if( !error && success && successURL ) { 2019 window.location = successURL 2020 return 2021 } 2022 2023 processBlogCommentSubmitResponse( form, html ) 2024 2025 if( error ) { 2026 _G.quickMessage(error, { error: true } ); 2027 } 2028 else { 2029 // _G.quickMessage(success) 2030 2031 if( window.dataLayer ) { 2032 window.dataLayer.push( { 2033 event: 'formSubmitted', 2034 formURL: window.location.href, 2035 title: document.title, 2036 formName: data.get( '__formName') || '' 2037 }) 2038 } 2039 } 2040 }) 2041 }).catch( err => { 2042 console.error( "error occurred during form submission", err ) 2043 _G.quickMessage('Error occurred during form submission', { error: true } ); 2044 }).finally( () => { 2045 submitting = false 2046 undoSubmitFeedback(form) 2047 }) 2048 }, 1000 ) 2049 2050 2051 return false;
2052 } 2053})() 2054 2055/* ==== INCLUDE: /js/blocks/brand-footer.js ==== */ 2056 2057;(function () { 2058 2059 function hideDelete() { 2060 const deleteElements = document.querySelectorAll('.myrealpage-footer [data-command="delete"]'); 2061 2062 deleteElements.forEach(function (element) { 2063 element.style.display = 'none'; 2064 }); 2065 2066 // const moveupElements = document.querySelectorAll('.myrealpage-footer [data-command="moveup"]'); 2067 // 2068 // moveupElements.forEach(function (element) { 2069 // element.style.display = 'none'; 2070 // }); 2071 // 2072 // const movedownElements = document.querySelectorAll('.myrealpage-footer [data-command="movedown"]'); 2073 // 2074 // movedownElements.forEach(function (element) { 2075 // element.style.display = 'none'; 2076 // }); 2077 2078 const cloneElements = document.querySelectorAll('.myrealpage-footer [data-command="clone"]'); 2079 2080 cloneElements.forEach(function (element) { 2081 element.style.display = 'none'; 2082 }); 2083 } 2084 2085 function addRef() { 2086 const links = document.querySelectorAll( ".myrealpage-footer a[href=\"https://myrealpage.com/\"]" ); 2087 const hostname = window.location.hostname; 2088 links.forEach( link => { 2089 link.setAttribute( "href", "https://myrealpage.com/?ref=" + encodeURIComponent(hostname)); 2090 }) 2091 } 2092 2093 document.addEventListener('DOMContentLoaded', function () { 2094 hideDelete(); 2095 addRef(); 2096 }); 2097})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.