Site Reviews - Version 5.8.2

Version Description

(2021-04-03) =

  • Fixed javascript event system
  • Fixed the FAQ javascript example of hiding the form after a review submission
Download this release

Release Info

Developer geminilabs
Plugin Icon 128x128 Site Reviews
Version 5.8.2
Comparing to
See all releases

Code changes from version 5.8.1 to 5.8.2

assets/scripts/site-reviews.js CHANGED
@@ -1 +1 @@
1
- !function(){var t={4575:function(t){t.exports=function(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}},3913:function(t){function i(t,i){for(var n=0;n<i.length;n++){var e=i[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}t.exports=function(t,n,e){return n&&i(t.prototype,n),e&&i(t,e),t}},8:function(t){function i(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=i=function(t){return typeof t}:t.exports=i=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(n)}t.exports=i},7401:function(t,i,n){"use strict";var e=n(8),s=n.n(e),o=function(){};o.prototype={get:function(t,i,n){this.t(i),this.xhr.open("GET",t,!0),this.xhr.responseType="text",this.i(n),this.xhr.send()},u:function(t){return"json"===this.xhr.responseType||!0===this.xhr.json?t({message:this.xhr.statusText},!1):"text"===this.xhr.responseType?t(this.xhr.statusText):void 0},h:function(t){if(0===this.xhr.status||this.xhr.status>=200&&this.xhr.status<300||304===this.xhr.status){if("json"===this.xhr.responseType)return t(this.xhr.response.data,this.xhr.response.success);if("text"===this.xhr.responseType)return t(this.xhr.responseText);if(!0===this.xhr.json){var i=JSON.parse(this.xhr.response);return t(i.data,i.success)}}else this.u(t)},isFileSupported:function(){var t=document.createElement("INPUT");return t.type="file","files"in t},isFormDataSupported:function(){return!!window.FormData},isUploadSupported:function(){var t=new XMLHttpRequest;return!!(t&&"upload"in t&&"onprogress"in t.upload)},post:function(t,i,n){this.t(i),this.xhr.open("POST",GLSR.ajaxurl,!0),this.xhr.responseType="json",this.xhr.json=!0,this.i(n),this.xhr.send(this.l(t))},t:function(t){this.xhr=new XMLHttpRequest,this.xhr.onload=this.h.bind(this,t),this.xhr.onerror=this.u.bind(this,t)},v:function(t,i,n){return"object"!==s()(i)||i instanceof Date||i instanceof File?t.append(n,i||""):Object.keys(i).forEach(function(e){i.hasOwnProperty(e)&&(t=this.v(t,i[e],n?n[e]:e))}.bind(this)),t},l:function(t){var i=new FormData,n=Object.prototype.toString.call(t);return"[object FormData]"===n&&(i=t),"[object HTMLFormElement]"===n&&(i=new FormData(t)),"[object Object]"===n&&Object.keys(t).forEach((function(n){i.append(n,t[n])})),i.append("action",GLSR.action),i.append("_ajax_request",!0),i},i:function(t){for(var i in(t=t||{})["X-Requested-With"]="XMLHttpRequest",t)t.hasOwnProperty(i)&&this.xhr.setRequestHeader(i,t[i])}};var r=o,u=arguments,h={},a=function(t,i){var n=h[t]||[],e=[];i&&[].forEach.call(n,(function(t){i!==t.fn&&i!==t.fn.once&&e.push(t)})),e.length?h[t]=e:delete h[t]},c=function(t,i,n){(h[t]||(h[t]=[])).push({fn:i,context:n})},f=function(t,i,n){var e=function e(){a(t,e),i.apply(n,u)};e.once=i,c(t,e,n)},l=function(t){var i=[].slice.call(u,1),n=(h[t]||[]).slice();[].forEach.call(n,(function(t){return t.fn.apply(t.context,i)}))},d={events:h,trigger:l,off:a,on:c,once:f},v=n(4575),m=n.n(v),w=n(3913),p=n.n(w),g={hiddenClass:"glsr-hidden",hiddenTextSelector:".glsr-hidden-text",readMoreClass:"glsr-read-more",visibleClass:"glsr-visible"},y=function(){function t(i){var n=this;m()(this,t);var e=(i||document).querySelectorAll(g.hiddenTextSelector);[].forEach.call(e,(function(t){return n.init(t)})),GLSR.Event.trigger("site-reviews/excerpts/init",i)}return p()(t,[{key:"init",value:function(t){if(!t.parentNode.querySelector("."+g.readMoreClass)){var i=t.dataset.trigger,n=document.createElement("span"),e=document.createElement("a");e.setAttribute("href","#"),e.innerHTML=t.dataset.showMore,"excerpt"===i&&(e.addEventListener("click",this.onClick.bind(this)),e.setAttribute("data-text",t.dataset.showLess)),"modal"===i&&e.setAttribute("data-excerpt-trigger","glsr-modal"),n.setAttribute("class",g.readMoreClass),n.appendChild(e),t.parentNode.insertBefore(n,t.nextSibling)}}},{key:"onClick",value:function(t){t.preventDefault();var i=t.currentTarget,n=i.parentNode.previousSibling,e=i.dataset.text;n.classList.toggle(g.hiddenClass),n.classList.toggle(g.visibleClass),i.dataset.text=i.innerText,i.innerText=e}}]),t}(),b=y,k=function(t){this.Form=t,this.counter=0,this.id=-1,this.is_submitting=!1,this.recaptchaEl=t.form.querySelector(".glsr-recaptcha-holder"),this.observer=new MutationObserver(function(t){var i=t.pop();i.target&&"visible"!==i.target.style.visibility&&(this.observer.disconnect(),setTimeout(function(){this.is_submitting||this.Form.p()}.bind(this),250))}.bind(this))};k.prototype={g:function(){this.counter=0,this.id=-1,this.is_submitting=!1,this.recaptchaEl&&(this.recaptchaEl.innerHTML="")},k:function(){if(-1!==this.id)return this.counter=0,this.S(this.id),void grecaptcha.execute(this.id);setTimeout(function(){this.counter++,this.L.call(this.Form,this.counter)}.bind(this),1e3)},S:function(t){var i=window.___grecaptcha_cfg.clients[t];for(var n in i)if(i.hasOwnProperty(n)&&"[object String]"===Object.prototype.toString.call(i[n])){var e=document.querySelector("iframe[name=c-"+i[n]+"]");if(e){this.observer.observe(e.parentElement.parentElement,{attributeFilter:["style"],attributes:!0});break}}},R:function(){this.Form.form.onsubmit=null,this.g(),this._()},_:function(){this.recaptchaEl&&setTimeout(function(){if("undefined"==typeof grecaptcha||void 0===grecaptcha.render)return this._();this.id=grecaptcha.render(this.recaptchaEl,{callback:this.L.bind(this.Form,this.counter),"expired-callback":this.F.bind(this),isolated:!0},!0)}.bind(this),250)},F:function(){this.counter=0,this.is_submitting=!1,-1!==this.id&&grecaptcha.reset(this.id)},L:function(t){if(this.recaptcha.is_submitting=!0,!this.useAjax)return this.G(),void this.form.submit();this.L(t)}};var S=k,L=n(9449),R=n.n(L),_=function(t,i,n){t&&i.split(" ").forEach((function(i){t.classList[n?"add":"remove"](i)}))},x=function(t){return"."+t.trim().split(" ").join(".")},E=function(t){var i='input[name="'+t.getAttribute("name")+'"]:checked';return t.validation.form.querySelectorAll(i).length},F={email:{fn:function(t){return!t||/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)}},max:{fn:function(t,i){return!t||("checkbox"===this.type?E(this)<=parseInt(i):parseFloat(t)<=parseFloat(i))}},maxlength:{fn:function(t,i){return!t||t.length<=parseInt(i)}},min:{fn:function(t,i){return!t||("checkbox"===this.type?E(this)>=parseInt(i):parseFloat(t)>=parseFloat(i))}},minlength:{fn:function(t,i){return!t||t.length>=parseInt(i)}},number:{fn:function(t){return!t||!isNaN(parseFloat(t))},priority:2},required:{fn:function(t){return"radio"===this.type||"checkbox"===this.type?E(this):void 0!==t&&""!==t},priority:99,halt:!0}},G=function(t){this.config=GLSR.validationconfig,this.fields=[],this.form=t,this.form.setAttribute("novalidate",""),this.strings=GLSR.validationstrings,this.validateEvent=this.T.bind(this)};G.prototype={j:["required","max","maxlength","min","minlength","pattern"],O:"input:not([type^=hidden]):not([type^=submit]), select, textarea, [data-glsr-validate]",destroy:function(){for(this.F();this.fields.length;){var t=this.fields.shift();this.M(t.input),delete t.input.validation}},init:function(){var t=this;[].forEach.call(this.form.querySelectorAll(this.O),(function(i){t.fields.find((function(t){return t.input.name===i.name}))||"none"!==i.closest(x(t.config.field)).style.display&&t.fields.push(t.C(i))}))},A:function(t){t.addEventListener(this.D(t),this.validateEvent)},N:function(t,i,n){[].forEach.call(t,function(t){var e=t.name.replace("data-","");~this.j.indexOf(e)?this.q(i,n,e,t.value):"type"===t.name&&this.q(i,n,t.value)}.bind(this))},q:function(t,i,n,e){if(F[n]&&(F[n].name=n,t.push(F[n]),e)){var s=e.split(",");s.unshift(null),i[n]=s}},T:function(t){this.I(t.currentTarget)},M:function(t){t.removeEventListener(this.D(t),this.validateEvent)},F:function(){for(var t in this.fields)if(this.fields.hasOwnProperty(t)){this.fields[t].errorElements=null;var i=this.fields[t].input.closest(x(this.config.field));_(this.fields[t].input,this.config.input_error,!1),_(this.fields[t].input,this.config.input_valid,!1),_(i,this.config.field_error,!1),_(i,this.config.field_valid,!1)}},D:function(t){return~["radio","checkbox"].indexOf(t.getAttribute("type"))||"SELECT"===t.nodeName?"change":"input"},C:function(t){var i={},n=[];return null!==t.offsetParent&&(this.N(t.attributes,n,i),this.P(n),this.A(t)),t.validation={form:this.form,input:t,params:i,validators:n}},H:function(t,i){var n=t.input.closest(x(this.config.field));if(_(t.input,this.config.input_error,i),_(t.input,this.config.input_valid,!i),n){_(n,this.config.field_error,i),_(n,this.config.field_valid,!i);var e=n.querySelector(x(this.config.field_message));e.innerHTML=i?t.errors.join("<br>"):"",e.style.display=i?"":"none"}},B:function(t,i){t.hasOwnProperty("validation")&&this.C(t),t.validation.errors=i},P:function(t){t.sort((function(t,i){return(i.priority||1)-(t.priority||1)}))},I:function(t){var i=!0,n=this.fields;for(var e in t instanceof HTMLElement&&(n=[t.validation]),n)if(n.hasOwnProperty(e)){var s=n[e];this.V(s)?this.H(s,!1):(i=!1,this.H(s,!0))}return i},V:function(t){var i=[],n=!0;for(var e in t.validators)if(t.validators.hasOwnProperty(e)){var s=t.validators[e],o=t.params[s.name]?t.params[s.name]:[];if(o[0]=t.input.value,!s.fn.apply(t.input,o)){n=!1;var r=this.strings[s.name];if(i.push(r.replace(/(\%s)/g,o[1])),!0===s.halt)break}}return t.errors=i,n}};var T=G,j=function(t,i){this.button=i,this.config=GLSR.validationconfig,this.events={submit:this.W.bind(this)},this.form=t,this.isActive=!1,this.recaptcha=new S(this),this.stars=null,this.strings=GLSR.validationstrings,this.useAjax=this.J(),this.validation=new T(t)};j.prototype={destroy:function(){this.destroyForm(),this.destroyRecaptcha(),this.destroyStarRatings(),this.isActive=!1},destroyForm:function(){this.form.removeEventListener("submit",this.events.submit),this.U(),this.validation.destroy()},destroyRecaptcha:function(){this.recaptcha.g()},destroyStarRatings:function(){this.stars&&this.stars.destroy()},init:function(){this.isActive||(this.initForm(),this.initStarRatings(),this.initRecaptcha(),this.isActive=!0)},initForm:function(){this.destroyForm(),this.form.addEventListener("submit",this.events.submit),this.validation.init()},initRecaptcha:function(){this.recaptcha.R()},initStarRatings:function(){null!==this.stars?this.stars.rebuild():this.stars=new(R())(this.form.querySelectorAll(".glsr-field-rating select"),GLSR.stars)},G:function(){this.button.setAttribute("disabled","")},p:function(){this.button.removeAttribute("disabled")},X:function(t,i){var n=!0===i;"unset"!==t.recaptcha?("reset"===t.recaptcha&&this.recaptcha.F(),n&&(this.recaptcha.F(),this.form.reset()),this.K(t.errors),this.Y(t.message,n),this.p(),GLSR.Event.trigger("site-reviews/form/handle",t,this.form),t.form=this.form,document.dispatchEvent(new CustomEvent("site-reviews/after/submission",{detail:t})),n&&""!==t.redirect&&(window.location=t.redirect)):this.recaptcha.k()},J:function(){var t=!0;return[].forEach.call(this.form.elements,(function(i){"file"===i.type&&(t=GLSR.ajax.isFileSupported()&&GLSR.ajax.isUploadSupported())})),t&&!this.form.classList.contains("no-ajax")},W:function(t){if(!this.validation.I())return t.preventDefault(),void this.Y(this.strings.errors,!1);this.U(),(this.form["g-recaptcha-response"]&&""===this.form["g-recaptcha-response"].value||this.useAjax)&&(t.preventDefault(),this.L())},U:function(){_(this.form,this.config.form_error,!1),this.Y("",null),this.validation.F()},K:function(t){if(t)for(var i in t)if(t.hasOwnProperty(i)){var n=GLSR.nameprefix?GLSR.nameprefix+"["+i+"]":i,e=this.form.querySelector('[name="'+n+'"]');e&&(this.validation.B(e,t[i]),this.validation.H(e.validation,"add"))}},Y:function(t,i){var n=this.form.querySelector(x(this.config.form_message));null!==n&&(_(this.form,this.config.form_error,!1===i),_(n,this.config.form_message_failed,!1===i),_(n,this.config.form_message_success,!0===i),n.innerHTML=t)},L:function(t){GLSR.ajax.isFormDataSupported()?(this.G(),this.form[GLSR.nameprefix+"[_counter]"].value=t||0,GLSR.ajax.post(this.form,this.X.bind(this))):this.Y(this.strings.unsupported,!1)}};var O=function(){for(;GLSR.forms.length;){(t=GLSR.forms.shift()).destroy()}var t,i,n;i=document.querySelectorAll("form.glsr-review-form");for(var e=0;e<i.length;e++)(n=i[e].querySelector("[type=submit]"))&&((t=new j(i[e],n)).init(),GLSR.forms.push(t))},M=O;function C(t){if(Array.isArray(t)){for(var i=0,n=Array(t.length);i<t.length;i++)n[i]=t[i];return n}return Array.from(t)}var A=!1;if("undefined"!=typeof window){var D={get passive(){A=!0}};window.addEventListener("testPassive",null,D),window.removeEventListener("testPassive",null,D)}var N="undefined"!=typeof window&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||"MacIntel"===window.navigator.platform&&window.navigator.maxTouchPoints>1),q=[],I=!1,P=-1,H=void 0,B=void 0,V=function(t){return q.some((function(i){return!(!i.options.allowTouchMove||!i.options.allowTouchMove(t))}))},W=function(t){var i=t||window.event;return!!V(i.target)||(i.touches.length>1||(i.preventDefault&&i.preventDefault(),!1))},J=function(t){if(void 0===B){var i=!!t&&!0===t.reserveScrollBarGap,n=window.innerWidth-document.documentElement.clientWidth;i&&n>0&&(B=document.body.style.paddingRight,document.body.style.paddingRight=n+"px")}void 0===H&&(H=document.body.style.overflow,document.body.style.overflow="hidden")},U=function(){void 0!==B&&(document.body.style.paddingRight=B,B=void 0),void 0!==H&&(document.body.style.overflow=H,H=void 0)},X=function(t){return!!t&&t.scrollHeight-t.scrollTop<=t.clientHeight},K=function(t,i){var n=t.targetTouches[0].clientY-P;return!V(t.target)&&(i&&0===i.scrollTop&&n>0||X(i)&&n<0?W(t):(t.stopPropagation(),!0))},Y=function(t,i){if(t&&!q.some((function(i){return i.targetElement===t}))){var n={targetElement:t,options:i||{}};q=[].concat(C(q),[n]),N?(t.ontouchstart=function(t){1===t.targetTouches.length&&(P=t.targetTouches[0].clientY)},t.ontouchmove=function(i){1===i.targetTouches.length&&K(i,t)},I||(document.addEventListener("touchmove",W,A?{passive:!1}:void 0),I=!0)):J(i)}},$=function(){N?(q.forEach((function(t){t.targetElement.ontouchstart=null,t.targetElement.ontouchmove=null})),I&&(document.removeEventListener("touchmove",W,A?{passive:!1}:void 0),I=!1),P=-1):U(),q=[]},z=["[contenteditable]",'[tabindex]:not([tabindex^="-"])',"a[href]","button:not([disabled]):not([aria-hidden])",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])"],Q=function(){function t(i){var n=i.closeTrigger,e=void 0===n?"data-glsr-close":n,s=i.onClose,o=void 0===s?function(){}:s,r=i.onOpen,u=void 0===r?function(){}:r,h=i.openClass,a=void 0===h?"is-open":h,c=i.openTrigger,f=void 0===c?"data-glsr-trigger":c,l=i.targetModalId,d=void 0===l?"glsr-modal":l,v=i.triggers,w=void 0===v?[]:v;m()(this,t),this.modal=document.getElementById(d),this.config={openTrigger:f,closeTrigger:e,openClass:a,onOpen:u,onClose:o},this.events={mouseup:this.onClick.bind(this),keydown:this.onKeydown.bind(this),touchstart:this.onClick.bind(this)},w.length>0&&this.registerTriggers(w)}return p()(t,[{key:"addEventListeners",value:function(){this.eventListener(this.modal,"add",["mouseup","touchstart"]),this.eventListener(document,"add",["keydown"])}},{key:"closeModal",value:function(){var t=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;i&&(i.preventDefault(),i.stopPropagation()),this.modal.setAttribute("aria-hidden","true"),this.removeEventListeners(),$(),this.activeElement&&this.activeElement.focus&&this.activeElement.focus();var n=function n(){t.modal.classList.remove(t.config.openClass),t.modal.removeEventListener("animationend",n,!1),t.config.onClose(t.modal,t.activeElement,i)};this.modal.addEventListener("animationend",n,!1)}},{key:"closeModalById",value:function(t){this.modal=document.getElementById(t),this.modal&&this.closeModal()}},{key:"eventListener",value:function(t,i,n){var e=this;n.forEach((function(n){return t[i+"EventListener"](n,e.events[n])}))}},{key:"getFocusableNodes",value:function(){var t=this.modal.querySelectorAll(z);return Array.prototype.slice.call(t)}},{key:"onClick",value:function(t){t.target.hasAttribute(this.config.closeTrigger)&&this.closeModal(t)}},{key:"onKeydown",value:function(t){27===t.keyCode&&this.closeModal(t),9===t.keyCode&&this.retainFocus(t)}},{key:"openModal",value:function(){var t=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.activeElement=document.activeElement,i&&(i.preventDefault(),this.activeElement=i.currentTarget),this.config.onOpen(this.modal,this.activeElement,i),this.modal.setAttribute("aria-hidden","false"),this.modal.classList.add(this.config.openClass),Y(this.modal.querySelector("[data-glsr-modal]")),this.addEventListeners();var n=function i(){t.modal.removeEventListener("animationend",i,!1),t.setFocusToFirstNode()};this.modal.addEventListener("animationend",n,!1)}},{key:"registerTriggers",value:function(t){var i=this;t.filter(Boolean).forEach((function(t){t.triggerModal&&t.removeEventListener("click",t.triggerModal),t.triggerModal=i.openModal.bind(i),t.addEventListener("click",t.triggerModal)}))}},{key:"removeEventListeners",value:function(){this.eventListener(this.modal,"remove",["mouseup","touchstart"]),this.eventListener(document,"remove",["keydown"])}},{key:"retainFocus",value:function(t){var i=this.getFocusableNodes();if(0!==i.length)if(i=i.filter((function(t){return null!==t.offsetParent})),this.modal.contains(document.activeElement)){var n=i.indexOf(document.activeElement);t.shiftKey&&0===n&&(i[i.length-1].focus(),t.preventDefault()),!t.shiftKey&&i.length>0&&n===i.length-1&&(i[0].focus(),t.preventDefault())}else i[0].focus()}},{key:"setFocusToFirstNode",value:function(){var t=this,i=this.getFocusableNodes();if(0!==i.length){var n=i.filter((function(i){return!i.hasAttribute(t.config.closeTrigger)}));n.length>0&&n[0].focus(),0===n.length&&i[0].focus()}}}]),t}(),Z={},tt=function(t){if(t)Z[t].closeModalById(t);else for(var i in Z)Z[i].closeModal()},it=function(t,i){var n={};return t.forEach((function(t){var e=t.attributes[i].value;void 0===n[e]&&(n[e]=[]),n[e].push(t)})),n},nt=function(t){var i=Object.assign({},{openTrigger:"data-glsr-trigger"},t),n=Array.prototype.slice.call(document.querySelectorAll("[".concat(i.openTrigger,"]"))),e=it(n,i.openTrigger);return Object.keys(e).forEach((function(t){i.targetModalId=t,i.triggers=e[t],Z[t]=new Q(i)})),Z},et=function(t,i){var n=i||{};n.targetModalId=t,Z[t]&&Z[t].removeEventListeners(),Z[t]=new Q(n),Z[t].openModal()},st={init:nt,open:et,close:tt},ot={hideClass:"glsr-hide",linkSelector:"a.page-numbers",paginationSelector:".glsr-ajax-pagination",reviewsSelector:".glsr-reviews",scrollOffset:16,scrollTime:468},rt=function(){function t(i){m()(this,t),this.links=[],this.reviewsEl=i.querySelector(ot.reviewsSelector),this.wrapperEl=i,this.init()}return p()(t,[{key:"init",value:function(){var t=this;this.links=this.wrapperEl.querySelectorAll("".concat(ot.paginationSelector," ").concat(ot.linkSelector)),this.links.length&&[].forEach.call(this.links,(function(i){i.dataset.ready||(i.addEventListener("click",t.onClick.bind(t,i)),i.dataset.ready=!0)}))}},{key:"onClick",value:function(t,i){var n=t.closest(ot.paginationSelector);if(n){for(var e={},s=0,o=Object.keys(n.dataset);s<o.length;s++){var r=o[s],u=n.dataset[r];try{u=JSON.parse(u)}catch(t){}e["".concat(GLSR.nameprefix,"[atts][").concat(r,"]")]=u}e["".concat(GLSR.nameprefix,"[_action]")]="fetch-paged-reviews",e["".concat(GLSR.nameprefix,"[page]")]=i.currentTarget.dataset.page||"",e["".concat(GLSR.nameprefix,"[url]")]=i.currentTarget.href||"",this.wrapperEl.classList.add(ot.hideClass),i.preventDefault(),GLSR.ajax.post(e,this.handleResponse.bind(this,i.currentTarget.href))}}},{key:"handleResponse",value:function(t,i,n){n?([].forEach.call(this.wrapperEl.querySelectorAll(ot.paginationSelector),(function(t){t.innerHTML=i.pagination})),this.reviewsEl.innerHTML=i.reviews,this.scrollToTop(),this.init(),this.wrapperEl.classList.remove(ot.hideClass),GLSR.urlparameter&&window.history.pushState(null,"",t),new b(this.reviewsEl),GLSR.Event.trigger("site-reviews/pagination/handle",i,this)):window.location=t}},{key:"scrollToTop",value:function(){var t=ot.scrollOffset;[].forEach.call(GLSR.ajaxpagination,(function(i){var n=document.querySelector(i);n&&"fixed"===window.getComputedStyle(n).getPropertyValue("position")&&(t+=n.clientHeight)}));var i=this.reviewsEl.getBoundingClientRect().top-t;i>0||this.scrollStep({endY:i,offset:window.pageYOffset,startTime:window.performance.now(),startY:this.reviewsEl.scrollTop})}},{key:"scrollStep",value:function(t){var i=Math.min(1,(window.performance.now()-t.startTime)/ot.scrollTime),n=.5*(1-Math.cos(Math.PI*i)),e=t.startY+(t.endY-t.startY)*n;window.scroll(0,t.offset+e),e!==t.endY&&window.requestAnimationFrame(this.scrollStep.bind(this,t))}}]),t}(),ut=function(){[].forEach.call(document.querySelectorAll(ot.paginationSelector),(function(t){var i=t.closest(".glsr");i&&new rt(i)}))},ht=function(){var t="glsr-modal__content",i="glsr-modal__review";window.GLSR.Modal.init({onClose:function(n,e,s){n.querySelector("."+t).innerHTML="",n.classList.remove(i),GLSR.Event.trigger("site-reviews/modal/close",n,e,s)},onOpen:function(n,e,s){var o=e.closest(".glsr").cloneNode(!0),r=e.closest(".glsr-review").cloneNode(!0);o.innerHTML="",o.appendChild(r),n.querySelector("."+t).appendChild(o),n.classList.add(i),GLSR.Event.trigger("site-reviews/modal/open",n,e,s)},openTrigger:"data-excerpt-trigger"})},at=function(){[].forEach.call(document.querySelectorAll(".glsr"),(function(t){var i="glsr-"+window.getComputedStyle(t,null).getPropertyValue("direction");t.classList.add(i)})),new b,new M,ut()};window.hasOwnProperty("GLSR")||(window.GLSR={}),window.GLSR.ajax=new r,window.GLSR.forms=[],window.GLSR.Event=d,window.GLSR.Forms=M,window.GLSR.Modal=st,d.on("site-reviews/init",at),d.on("site-reviews/excerpts/init",ht),document.addEventListener("DOMContentLoaded",(function(){d.trigger("site-reviews/init")}))},113:function(){},4030:function(){},6966:function(){},83:function(){},7649:function(){},3408:function(){},529:function(){},2275:function(){},2872:function(){},8865:function(){},4835:function(){},6786:function(){},1045:function(){},3622:function(){},2688:function(){},8340:function(){},3961:function(){},853:function(){},1273:function(){},5651:function(){},7730:function(){},3382:function(){},4747:function(){},4605:function(){},3963:function(){},5406:function(){},6829:function(){},6273:function(){},4518:function(){},6963:function(){},9449:function(t){"use strict";function i(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function n(t,i){for(var n=0;n<i.length;n++){var e=i[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}function e(t,i,e){return i&&n(t.prototype,i),e&&n(t,e),t}var s={classNames:{active:"gl-active",base:"gl-star-rating",selected:"gl-selected"},clearable:!0,maxStars:10,prebuilt:!1,stars:null,tooltip:"Select a Rating"},o=function(t,i,n){t.classList[i?"add":"remove"](n)},r=function(t){var i=document.createElement("span");for(var n in t=t||{})i.setAttribute(n,t[n]);return i},u=function(t,i,n){var e=r(n);return t.parentNode.insertBefore(e,i?t.nextSibling:t),e},h=function t(){for(var i=arguments.length,n=new Array(i),e=0;e<i;e++)n[e]=arguments[e];var s={};return n.forEach((function(i){Object.keys(i||{}).forEach((function(e){if(void 0!==n[0][e]){var o=i[e];"Object"!==a(o)||"Object"!==a(s[e])?s[e]=o:s[e]=t(s[e],o)}}))})),s},a=function(t){return{}.toString.call(t).slice(8,-1)},c=function(){function t(n,e){var s,o;i(this,t),this.direction=window.getComputedStyle(n,null).getPropertyValue("direction"),this.el=n,this.events={change:this.onChange.bind(this),keydown:this.onKeyDown.bind(this),mousedown:this.onPointerDown.bind(this),mouseleave:this.onPointerLeave.bind(this),mousemove:this.onPointerMove.bind(this),reset:this.onReset.bind(this),touchend:this.onPointerDown.bind(this),touchmove:this.onPointerMove.bind(this)},this.indexActive=null,this.indexSelected=null,this.props=e,this.tick=null,this.ticking=!1,this.values=function(t){var i=[];return[].forEach.call(t.options,(function(t){var n=parseInt(t.value,10)||0;n>0&&i.push({index:t.index,text:t.text,value:n})})),i.sort((function(t,i){return t.value-i.value}))}(n),this.widgetEl=null,this.el.widget&&this.el.widget.destroy(),s=this.values.length,o=this.props.maxStars,/^\d+$/.test(s)&&1<=s&&s<=o?this.build():this.destroy()}return e(t,[{key:"build",value:function(){this.destroy(),this.buildWidget(),this.selectValue(this.indexSelected=this.selected(),!1),this.handleEvents("add"),this.el.widget=this}},{key:"buildWidget",value:function(){var t,i,n=this;this.props.prebuilt?(t=this.el.parentNode,i=t.querySelector("."+this.props.classNames.base+"--stars")):((t=u(this.el,!1,{class:this.props.classNames.base})).appendChild(this.el),i=u(this.el,!0,{class:this.props.classNames.base+"--stars"}),this.values.forEach((function(t,e){var s=r({"data-index":e,"data-value":t.value});"function"==typeof n.props.stars&&n.props.stars.call(n,s,t,e),[].forEach.call(s.children,(function(t){return t.style.pointerEvents="none"})),i.innerHTML+=s.outerHTML}))),t.dataset.starRating="",t.classList.add(this.props.classNames.base+"--"+this.direction),this.props.tooltip&&i.setAttribute("role","tooltip"),this.widgetEl=i}},{key:"changeIndexTo",value:function(t,i){var n=this;if(this.indexActive!==t||i){if([].forEach.call(this.widgetEl.children,(function(i,e){o(i,e<=t,n.props.classNames.active),o(i,e===n.indexSelected,n.props.classNames.selected)})),"function"==typeof this.props.stars||this.props.prebuilt||(this.widgetEl.classList.remove("s"+10*(this.indexActive+1)),this.widgetEl.classList.add("s"+10*(t+1))),this.props.tooltip){var e=t<0?this.props.tooltip:this.values[t].text;this.widgetEl.setAttribute("aria-label",e)}this.indexActive=t}this.ticking=!1}},{key:"destroy",value:function(){this.indexActive=null,this.indexSelected=this.selected();var t=this.el.parentNode;t.classList.contains(this.props.classNames.base)&&(this.props.prebuilt?(this.widgetEl=t.querySelector("."+this.props.classNames.base+"--stars"),t.classList.remove(this.props.classNames.base+"--"+this.direction),delete t.dataset.starRating):t.parentNode.replaceChild(this.el,t),this.handleEvents("remove")),delete this.el.widget}},{key:"eventListener",value:function(t,i,n,e){var s=this;n.forEach((function(n){return t[i+"EventListener"](n,s.events[n],e||!1)}))}},{key:"handleEvents",value:function(t){var i=this.el.closest("form");i&&"FORM"===i.tagName&&this.eventListener(i,t,["reset"]),this.eventListener(this.el,t,["change"]),"add"===t&&this.el.disabled||(this.eventListener(this.el,t,["keydown"]),this.eventListener(this.widgetEl,t,["mousedown","mouseleave","mousemove","touchend","touchmove"],!1))}},{key:"indexFromEvent",value:function(t){var i,n,e=(null===(i=t.touches)||void 0===i?void 0:i[0])||(null===(n=t.changedTouches)||void 0===n?void 0:n[0])||t,s=document.elementFromPoint(e.clientX,e.clientY);return[].slice.call(s.parentNode.children).indexOf(s)}},{key:"onChange",value:function(){this.changeIndexTo(this.selected(),!0)}},{key:"onKeyDown",value:function(t){var i=t.key.slice(5);if(~["Left","Right"].indexOf(i)){var n="Left"===i?-1:1;"rtl"===this.direction&&(n*=-1);var e=this.values.length-1,s=Math.min(Math.max(this.selected()+n,-1),e);this.selectValue(s,!0)}}},{key:"onPointerDown",value:function(t){t.preventDefault();var i=this.indexFromEvent(t);this.props.clearable&&i===this.indexSelected&&(i=-1),this.selectValue(i,!0)}},{key:"onPointerLeave",value:function(t){var i=this;t.preventDefault(),cancelAnimationFrame(this.tick),requestAnimationFrame((function(){return i.changeIndexTo(i.indexSelected)}))}},{key:"onPointerMove",value:function(t){var i=this;t.preventDefault(),this.ticking||(this.tick=requestAnimationFrame((function(){return i.changeIndexTo(i.indexFromEvent(t))})),this.ticking=!0)}},{key:"onReset",value:function(){var t;this.selectValue((null===(t=this.el.querySelector("[selected]"))||void 0===t?void 0:t.index)||-1,!1)}},{key:"selected",value:function(){var t=this;return this.values.findIndex((function(i){return i.value===+t.el.value}))}},{key:"selectValue",value:function(t,i){var n;this.el.value=(null===(n=this.values[t])||void 0===n?void 0:n.value)||"",this.indexSelected=this.selected(),!1===i?this.changeIndexTo(this.selected(),!0):this.el.dispatchEvent(new Event("change"))}}]),t}(),f=function(){function t(n,e){i(this,t),this.destroy=this.destroy.bind(this),this.rebuild=this.rebuild.bind(this),this.widgets=[],this.buildWidgets(n,e)}return e(t,[{key:"buildWidgets",value:function(t,i){var n=this;this.queryElements(t).forEach((function(t){var e=h(s,i,JSON.parse(t.getAttribute("data-options")));"SELECT"!==t.tagName||t.widget||(!e.prebuilt&&t.parentNode.classList.contains(e.classNames.base)&&n.unwrap(t),n.widgets.push(new c(t,e)))}))}},{key:"destroy",value:function(){this.widgets.forEach((function(t){return t.destroy()}))}},{key:"queryElements",value:function(t){return"HTMLSelectElement"===a(t)?[t]:"NodeList"===a(t)?[].slice.call(t):"String"===a(t)?[].slice.call(document.querySelectorAll(t)):[]}},{key:"rebuild",value:function(){this.widgets.forEach((function(t){return t.build()}))}},{key:"unwrap",value:function(t){var i=t.parentNode,n=i.parentNode;n.insertBefore(t,i),n.removeChild(i)}}]),t}();t.exports=f}},i={};function n(e){if(i[e])return i[e].exports;var s=i[e]={exports:{}};return t[e](s,s.exports,n),s.exports}n.m=t,n.x=function(){},n.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(i,{a:i}),i},n.d=function(t,i){for(var e in i)n.o(i,e)&&!n.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:i[e]})},n.o=function(t,i){return Object.prototype.hasOwnProperty.call(t,i)},function(){var t={341:0},i=[[7401],[5406],[6829],[6273],[4518],[6963],[113],[4030],[6966],[83],[7649],[3408],[529],[2275],[2872],[8865],[4835],[6786],[1045],[3622],[2688],[8340],[3961],[853],[1273],[5651],[7730],[3382],[4747],[4605],[3963]],e=function(){},s=function(s,o){for(var r,u,h=o[0],a=o[1],c=o[2],f=o[3],l=0,d=[];l<h.length;l++)u=h[l],n.o(t,u)&&t[u]&&d.push(t[u][0]),t[u]=0;for(r in a)n.o(a,r)&&(n.m[r]=a[r]);for(c&&c(n),s&&s(o);d.length;)d.shift()();return f&&i.push.apply(i,f),e()},o=self.webpackChunk=self.webpackChunk||[];function r(){for(var e,s=0;s<i.length;s++){for(var o=i[s],r=!0,u=1;u<o.length;u++){var h=o[u];0!==t[h]&&(r=!1)}r&&(i.splice(s--,1),e=n(n.s=o[0]))}return 0===i.length&&(n.x(),n.x=function(){}),e}o.forEach(s.bind(null,0)),o.push=s.bind(null,o.push.bind(o));var u=n.x;n.x=function(){return n.x=u||function(){},(e=r)()}}(),n.x()}();
1
+ !function(){var t={4575:function(t){t.exports=function(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}},3913:function(t){function i(t,i){for(var n=0;n<i.length;n++){var e=i[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}t.exports=function(t,n,e){return n&&i(t.prototype,n),e&&i(t,e),t}},8:function(t){function i(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=i=function(t){return typeof t}:t.exports=i=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(n)}t.exports=i},7401:function(t,i,n){"use strict";var e=n(8),s=n.n(e),o=function(){};o.prototype={get:function(t,i,n){this.t(i),this.xhr.open("GET",t,!0),this.xhr.responseType="text",this.i(n),this.xhr.send()},u:function(t){return"json"===this.xhr.responseType||!0===this.xhr.json?t({message:this.xhr.statusText},!1):"text"===this.xhr.responseType?t(this.xhr.statusText):void 0},h:function(t){if(0===this.xhr.status||this.xhr.status>=200&&this.xhr.status<300||304===this.xhr.status){if("json"===this.xhr.responseType)return t(this.xhr.response.data,this.xhr.response.success);if("text"===this.xhr.responseType)return t(this.xhr.responseText);if(!0===this.xhr.json){var i=JSON.parse(this.xhr.response);return t(i.data,i.success)}}else this.u(t)},isFileSupported:function(){var t=document.createElement("INPUT");return t.type="file","files"in t},isFormDataSupported:function(){return!!window.FormData},isUploadSupported:function(){var t=new XMLHttpRequest;return!!(t&&"upload"in t&&"onprogress"in t.upload)},post:function(t,i,n){this.t(i),this.xhr.open("POST",GLSR.ajaxurl,!0),this.xhr.responseType="json",this.xhr.json=!0,this.i(n),this.xhr.send(this.l(t))},t:function(t){this.xhr=new XMLHttpRequest,this.xhr.onload=this.h.bind(this,t),this.xhr.onerror=this.u.bind(this,t)},v:function(t,i,n){return"object"!==s()(i)||i instanceof Date||i instanceof File?t.append(n,i||""):Object.keys(i).forEach(function(e){i.hasOwnProperty(e)&&(t=this.v(t,i[e],n?n[e]:e))}.bind(this)),t},l:function(t){var i=new FormData,n=Object.prototype.toString.call(t);return"[object FormData]"===n&&(i=t),"[object HTMLFormElement]"===n&&(i=new FormData(t)),"[object Object]"===n&&Object.keys(t).forEach((function(n){i.append(n,t[n])})),i.append("action",GLSR.action),i.append("_ajax_request",!0),i},i:function(t){for(var i in(t=t||{})["X-Requested-With"]="XMLHttpRequest",t)t.hasOwnProperty(i)&&this.xhr.setRequestHeader(i,t[i])}};var r=o,u={},h=function(t,i){var n=u[t]||[],e=[];i&&[].forEach.call(n,(function(t){i!==t.fn&&i!==t.fn.once&&e.push(t)})),e.length?u[t]=e:delete u[t]},a=function(t,i,n){(u[t]||(u[t]=[])).push({fn:i,context:n})},c=function(t,i,n){var e=arguments,s=function s(){h(t,s),i.apply(n,e)};s.once=i,a(t,s,n)},f=function(t){var i=[].slice.call(arguments,1),n=(u[t]||[]).slice();[].forEach.call(n,(function(t){return t.fn.apply(t.context,i)}))},l={events:u,trigger:f,off:h,on:a,once:c},d=n(4575),v=n.n(d),m=n(3913),w=n.n(m),p={hiddenClass:"glsr-hidden",hiddenTextSelector:".glsr-hidden-text",readMoreClass:"glsr-read-more",visibleClass:"glsr-visible"},g=function(){function t(i){var n=this;v()(this,t);var e=(i||document).querySelectorAll(p.hiddenTextSelector);[].forEach.call(e,(function(t){return n.init(t)})),GLSR.Event.trigger("site-reviews/excerpts/init",i)}return w()(t,[{key:"init",value:function(t){if(!t.parentNode.querySelector("."+p.readMoreClass)){var i=t.dataset.trigger,n=document.createElement("span"),e=document.createElement("a");e.setAttribute("href","#"),e.innerHTML=t.dataset.showMore,"excerpt"===i&&(e.addEventListener("click",this.onClick.bind(this)),e.setAttribute("data-text",t.dataset.showLess)),"modal"===i&&e.setAttribute("data-excerpt-trigger","glsr-modal"),n.setAttribute("class",p.readMoreClass),n.appendChild(e),t.parentNode.insertBefore(n,t.nextSibling)}}},{key:"onClick",value:function(t){t.preventDefault();var i=t.currentTarget,n=i.parentNode.previousSibling,e=i.dataset.text;n.classList.toggle(p.hiddenClass),n.classList.toggle(p.visibleClass),i.dataset.text=i.innerText,i.innerText=e}}]),t}(),y=g,b=function(t){this.Form=t,this.counter=0,this.id=-1,this.is_submitting=!1,this.recaptchaEl=t.form.querySelector(".glsr-recaptcha-holder"),this.observer=new MutationObserver(function(t){var i=t.pop();i.target&&"visible"!==i.target.style.visibility&&(this.observer.disconnect(),setTimeout(function(){this.is_submitting||this.Form.p()}.bind(this),250))}.bind(this))};b.prototype={g:function(){this.counter=0,this.id=-1,this.is_submitting=!1,this.recaptchaEl&&(this.recaptchaEl.innerHTML="")},k:function(){if(-1!==this.id)return this.counter=0,this.S(this.id),void grecaptcha.execute(this.id);setTimeout(function(){this.counter++,this.L.call(this.Form,this.counter)}.bind(this),1e3)},S:function(t){var i=window.___grecaptcha_cfg.clients[t];for(var n in i)if(i.hasOwnProperty(n)&&"[object String]"===Object.prototype.toString.call(i[n])){var e=document.querySelector("iframe[name=c-"+i[n]+"]");if(e){this.observer.observe(e.parentElement.parentElement,{attributeFilter:["style"],attributes:!0});break}}},R:function(){this.Form.form.onsubmit=null,this.g(),this._()},_:function(){this.recaptchaEl&&setTimeout(function(){if("undefined"==typeof grecaptcha||void 0===grecaptcha.render)return this._();this.id=grecaptcha.render(this.recaptchaEl,{callback:this.L.bind(this.Form,this.counter),"expired-callback":this.F.bind(this),isolated:!0},!0)}.bind(this),250)},F:function(){this.counter=0,this.is_submitting=!1,-1!==this.id&&grecaptcha.reset(this.id)},L:function(t){if(this.recaptcha.is_submitting=!0,!this.useAjax)return this.G(),void this.form.submit();this.L(t)}};var k=b,S=n(9449),L=n.n(S),R=function(t,i,n){t&&i.split(" ").forEach((function(i){t.classList[n?"add":"remove"](i)}))},_=function(t){return"."+t.trim().split(" ").join(".")},x=function(t){var i='input[name="'+t.getAttribute("name")+'"]:checked';return t.validation.form.querySelectorAll(i).length},E={email:{fn:function(t){return!t||/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)}},max:{fn:function(t,i){return!t||("checkbox"===this.type?x(this)<=parseInt(i):parseFloat(t)<=parseFloat(i))}},maxlength:{fn:function(t,i){return!t||t.length<=parseInt(i)}},min:{fn:function(t,i){return!t||("checkbox"===this.type?x(this)>=parseInt(i):parseFloat(t)>=parseFloat(i))}},minlength:{fn:function(t,i){return!t||t.length>=parseInt(i)}},number:{fn:function(t){return!t||!isNaN(parseFloat(t))},priority:2},required:{fn:function(t){return"radio"===this.type||"checkbox"===this.type?x(this):void 0!==t&&""!==t},priority:99,halt:!0}},F=function(t){this.config=GLSR.validationconfig,this.fields=[],this.form=t,this.form.setAttribute("novalidate",""),this.strings=GLSR.validationstrings,this.validateEvent=this.T.bind(this)};F.prototype={j:["required","max","maxlength","min","minlength","pattern"],O:"input:not([type^=hidden]):not([type^=submit]), select, textarea, [data-glsr-validate]",destroy:function(){for(this.F();this.fields.length;){var t=this.fields.shift();this.M(t.input),delete t.input.validation}},init:function(){var t=this;[].forEach.call(this.form.querySelectorAll(this.O),(function(i){t.fields.find((function(t){return t.input.name===i.name}))||"none"!==i.closest(_(t.config.field)).style.display&&t.fields.push(t.C(i))}))},A:function(t){t.addEventListener(this.D(t),this.validateEvent)},N:function(t,i,n){[].forEach.call(t,function(t){var e=t.name.replace("data-","");~this.j.indexOf(e)?this.q(i,n,e,t.value):"type"===t.name&&this.q(i,n,t.value)}.bind(this))},q:function(t,i,n,e){if(E[n]&&(E[n].name=n,t.push(E[n]),e)){var s=e.split(",");s.unshift(null),i[n]=s}},T:function(t){this.I(t.currentTarget)},M:function(t){t.removeEventListener(this.D(t),this.validateEvent)},F:function(){for(var t in this.fields)if(this.fields.hasOwnProperty(t)){this.fields[t].errorElements=null;var i=this.fields[t].input.closest(_(this.config.field));R(this.fields[t].input,this.config.input_error,!1),R(this.fields[t].input,this.config.input_valid,!1),R(i,this.config.field_error,!1),R(i,this.config.field_valid,!1)}},D:function(t){return~["radio","checkbox"].indexOf(t.getAttribute("type"))||"SELECT"===t.nodeName?"change":"input"},C:function(t){var i={},n=[];return null!==t.offsetParent&&(this.N(t.attributes,n,i),this.P(n),this.A(t)),t.validation={form:this.form,input:t,params:i,validators:n}},H:function(t,i){var n=t.input.closest(_(this.config.field));if(R(t.input,this.config.input_error,i),R(t.input,this.config.input_valid,!i),n){R(n,this.config.field_error,i),R(n,this.config.field_valid,!i);var e=n.querySelector(_(this.config.field_message));e.innerHTML=i?t.errors.join("<br>"):"",e.style.display=i?"":"none"}},B:function(t,i){t.hasOwnProperty("validation")&&this.C(t),t.validation.errors=i},P:function(t){t.sort((function(t,i){return(i.priority||1)-(t.priority||1)}))},I:function(t){var i=!0,n=this.fields;for(var e in t instanceof HTMLElement&&(n=[t.validation]),n)if(n.hasOwnProperty(e)){var s=n[e];this.V(s)?this.H(s,!1):(i=!1,this.H(s,!0))}return i},V:function(t){var i=[],n=!0;for(var e in t.validators)if(t.validators.hasOwnProperty(e)){var s=t.validators[e],o=t.params[s.name]?t.params[s.name]:[];if(o[0]=t.input.value,!s.fn.apply(t.input,o)){n=!1;var r=this.strings[s.name];if(i.push(r.replace(/(\%s)/g,o[1])),!0===s.halt)break}}return t.errors=i,n}};var G=F,T=function(t,i){this.button=i,this.config=GLSR.validationconfig,this.events={submit:this.W.bind(this)},this.form=t,this.isActive=!1,this.recaptcha=new k(this),this.stars=null,this.strings=GLSR.validationstrings,this.useAjax=this.J(),this.validation=new G(t)};T.prototype={destroy:function(){this.destroyForm(),this.destroyRecaptcha(),this.destroyStarRatings(),this.isActive=!1},destroyForm:function(){this.form.removeEventListener("submit",this.events.submit),this.U(),this.validation.destroy()},destroyRecaptcha:function(){this.recaptcha.g()},destroyStarRatings:function(){this.stars&&this.stars.destroy()},init:function(){this.isActive||(this.initForm(),this.initStarRatings(),this.initRecaptcha(),this.isActive=!0)},initForm:function(){this.destroyForm(),this.form.addEventListener("submit",this.events.submit),this.validation.init()},initRecaptcha:function(){this.recaptcha.R()},initStarRatings:function(){null!==this.stars?this.stars.rebuild():this.stars=new(L())(this.form.querySelectorAll(".glsr-field-rating select"),GLSR.stars)},G:function(){this.button.setAttribute("disabled","")},p:function(){this.button.removeAttribute("disabled")},X:function(t,i){var n=!0===i;"unset"!==t.recaptcha?("reset"===t.recaptcha&&this.recaptcha.F(),n&&(this.recaptcha.F(),this.form.reset()),this.K(t.errors),this.Y(t.message,n),this.p(),GLSR.Event.trigger("site-reviews/form/handle",t,this.form),t.form=this.form,document.dispatchEvent(new CustomEvent("site-reviews/after/submission",{detail:t})),n&&""!==t.redirect&&(window.location=t.redirect)):this.recaptcha.k()},J:function(){var t=!0;return[].forEach.call(this.form.elements,(function(i){"file"===i.type&&(t=GLSR.ajax.isFileSupported()&&GLSR.ajax.isUploadSupported())})),t&&!this.form.classList.contains("no-ajax")},W:function(t){if(!this.validation.I())return t.preventDefault(),void this.Y(this.strings.errors,!1);this.U(),(this.form["g-recaptcha-response"]&&""===this.form["g-recaptcha-response"].value||this.useAjax)&&(t.preventDefault(),this.L())},U:function(){R(this.form,this.config.form_error,!1),this.Y("",null),this.validation.F()},K:function(t){if(t)for(var i in t)if(t.hasOwnProperty(i)){var n=GLSR.nameprefix?GLSR.nameprefix+"["+i+"]":i,e=this.form.querySelector('[name="'+n+'"]');e&&(this.validation.B(e,t[i]),this.validation.H(e.validation,"add"))}},Y:function(t,i){var n=this.form.querySelector(_(this.config.form_message));null!==n&&(R(this.form,this.config.form_error,!1===i),R(n,this.config.form_message_failed,!1===i),R(n,this.config.form_message_success,!0===i),n.innerHTML=t)},L:function(t){GLSR.ajax.isFormDataSupported()?(this.G(),this.form[GLSR.nameprefix+"[_counter]"].value=t||0,GLSR.ajax.post(this.form,this.X.bind(this))):this.Y(this.strings.unsupported,!1)}};var j=function(){for(;GLSR.forms.length;){(t=GLSR.forms.shift()).destroy()}var t,i,n;i=document.querySelectorAll("form.glsr-review-form");for(var e=0;e<i.length;e++)(n=i[e].querySelector("[type=submit]"))&&((t=new T(i[e],n)).init(),GLSR.forms.push(t))},O=j;function M(t){if(Array.isArray(t)){for(var i=0,n=Array(t.length);i<t.length;i++)n[i]=t[i];return n}return Array.from(t)}var C=!1;if("undefined"!=typeof window){var A={get passive(){C=!0}};window.addEventListener("testPassive",null,A),window.removeEventListener("testPassive",null,A)}var D="undefined"!=typeof window&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||"MacIntel"===window.navigator.platform&&window.navigator.maxTouchPoints>1),N=[],q=!1,I=-1,P=void 0,H=void 0,B=function(t){return N.some((function(i){return!(!i.options.allowTouchMove||!i.options.allowTouchMove(t))}))},V=function(t){var i=t||window.event;return!!B(i.target)||(i.touches.length>1||(i.preventDefault&&i.preventDefault(),!1))},W=function(t){if(void 0===H){var i=!!t&&!0===t.reserveScrollBarGap,n=window.innerWidth-document.documentElement.clientWidth;i&&n>0&&(H=document.body.style.paddingRight,document.body.style.paddingRight=n+"px")}void 0===P&&(P=document.body.style.overflow,document.body.style.overflow="hidden")},J=function(){void 0!==H&&(document.body.style.paddingRight=H,H=void 0),void 0!==P&&(document.body.style.overflow=P,P=void 0)},U=function(t){return!!t&&t.scrollHeight-t.scrollTop<=t.clientHeight},X=function(t,i){var n=t.targetTouches[0].clientY-I;return!B(t.target)&&(i&&0===i.scrollTop&&n>0||U(i)&&n<0?V(t):(t.stopPropagation(),!0))},K=function(t,i){if(t&&!N.some((function(i){return i.targetElement===t}))){var n={targetElement:t,options:i||{}};N=[].concat(M(N),[n]),D?(t.ontouchstart=function(t){1===t.targetTouches.length&&(I=t.targetTouches[0].clientY)},t.ontouchmove=function(i){1===i.targetTouches.length&&X(i,t)},q||(document.addEventListener("touchmove",V,C?{passive:!1}:void 0),q=!0)):W(i)}},Y=function(){D?(N.forEach((function(t){t.targetElement.ontouchstart=null,t.targetElement.ontouchmove=null})),q&&(document.removeEventListener("touchmove",V,C?{passive:!1}:void 0),q=!1),I=-1):J(),N=[]},$=["[contenteditable]",'[tabindex]:not([tabindex^="-"])',"a[href]","button:not([disabled]):not([aria-hidden])",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])"],z=function(){function t(i){var n=i.closeTrigger,e=void 0===n?"data-glsr-close":n,s=i.onClose,o=void 0===s?function(){}:s,r=i.onOpen,u=void 0===r?function(){}:r,h=i.openClass,a=void 0===h?"is-open":h,c=i.openTrigger,f=void 0===c?"data-glsr-trigger":c,l=i.targetModalId,d=void 0===l?"glsr-modal":l,m=i.triggers,w=void 0===m?[]:m;v()(this,t),this.modal=document.getElementById(d),this.config={openTrigger:f,closeTrigger:e,openClass:a,onOpen:u,onClose:o},this.events={mouseup:this.onClick.bind(this),keydown:this.onKeydown.bind(this),touchstart:this.onClick.bind(this)},w.length>0&&this.registerTriggers(w)}return w()(t,[{key:"addEventListeners",value:function(){this.eventListener(this.modal,"add",["mouseup","touchstart"]),this.eventListener(document,"add",["keydown"])}},{key:"closeModal",value:function(){var t=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;i&&(i.preventDefault(),i.stopPropagation()),this.modal.setAttribute("aria-hidden","true"),this.removeEventListeners(),Y(),this.activeElement&&this.activeElement.focus&&this.activeElement.focus();var n=function n(){t.modal.classList.remove(t.config.openClass),t.modal.removeEventListener("animationend",n,!1),t.config.onClose(t.modal,t.activeElement,i)};this.modal.addEventListener("animationend",n,!1)}},{key:"closeModalById",value:function(t){this.modal=document.getElementById(t),this.modal&&this.closeModal()}},{key:"eventListener",value:function(t,i,n){var e=this;n.forEach((function(n){return t[i+"EventListener"](n,e.events[n])}))}},{key:"getFocusableNodes",value:function(){var t=this.modal.querySelectorAll($);return Array.prototype.slice.call(t)}},{key:"onClick",value:function(t){t.target.hasAttribute(this.config.closeTrigger)&&this.closeModal(t)}},{key:"onKeydown",value:function(t){27===t.keyCode&&this.closeModal(t),9===t.keyCode&&this.retainFocus(t)}},{key:"openModal",value:function(){var t=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.activeElement=document.activeElement,i&&(i.preventDefault(),this.activeElement=i.currentTarget),this.config.onOpen(this.modal,this.activeElement,i),this.modal.setAttribute("aria-hidden","false"),this.modal.classList.add(this.config.openClass),K(this.modal.querySelector("[data-glsr-modal]")),this.addEventListeners();var n=function i(){t.modal.removeEventListener("animationend",i,!1),t.setFocusToFirstNode()};this.modal.addEventListener("animationend",n,!1)}},{key:"registerTriggers",value:function(t){var i=this;t.filter(Boolean).forEach((function(t){t.triggerModal&&t.removeEventListener("click",t.triggerModal),t.triggerModal=i.openModal.bind(i),t.addEventListener("click",t.triggerModal)}))}},{key:"removeEventListeners",value:function(){this.eventListener(this.modal,"remove",["mouseup","touchstart"]),this.eventListener(document,"remove",["keydown"])}},{key:"retainFocus",value:function(t){var i=this.getFocusableNodes();if(0!==i.length)if(i=i.filter((function(t){return null!==t.offsetParent})),this.modal.contains(document.activeElement)){var n=i.indexOf(document.activeElement);t.shiftKey&&0===n&&(i[i.length-1].focus(),t.preventDefault()),!t.shiftKey&&i.length>0&&n===i.length-1&&(i[0].focus(),t.preventDefault())}else i[0].focus()}},{key:"setFocusToFirstNode",value:function(){var t=this,i=this.getFocusableNodes();if(0!==i.length){var n=i.filter((function(i){return!i.hasAttribute(t.config.closeTrigger)}));n.length>0&&n[0].focus(),0===n.length&&i[0].focus()}}}]),t}(),Q={},Z=function(t){if(t)Q[t].closeModalById(t);else for(var i in Q)Q[i].closeModal()},tt=function(t,i){var n={};return t.forEach((function(t){var e=t.attributes[i].value;void 0===n[e]&&(n[e]=[]),n[e].push(t)})),n},it=function(t){var i=Object.assign({},{openTrigger:"data-glsr-trigger"},t),n=Array.prototype.slice.call(document.querySelectorAll("[".concat(i.openTrigger,"]"))),e=tt(n,i.openTrigger);return Object.keys(e).forEach((function(t){i.targetModalId=t,i.triggers=e[t],Q[t]=new z(i)})),Q},nt=function(t,i){var n=i||{};n.targetModalId=t,Q[t]&&Q[t].removeEventListeners(),Q[t]=new z(n),Q[t].openModal()},et={init:it,open:nt,close:Z},st={hideClass:"glsr-hide",linkSelector:"a.page-numbers",paginationSelector:".glsr-ajax-pagination",reviewsSelector:".glsr-reviews",scrollOffset:16,scrollTime:468},ot=function(){function t(i){v()(this,t),this.links=[],this.reviewsEl=i.querySelector(st.reviewsSelector),this.wrapperEl=i,this.init()}return w()(t,[{key:"init",value:function(){var t=this;this.links=this.wrapperEl.querySelectorAll("".concat(st.paginationSelector," ").concat(st.linkSelector)),this.links.length&&[].forEach.call(this.links,(function(i){i.dataset.ready||(i.addEventListener("click",t.onClick.bind(t,i)),i.dataset.ready=!0)}))}},{key:"onClick",value:function(t,i){var n=t.closest(st.paginationSelector);if(n){for(var e={},s=0,o=Object.keys(n.dataset);s<o.length;s++){var r=o[s],u=n.dataset[r];try{u=JSON.parse(u)}catch(t){}e["".concat(GLSR.nameprefix,"[atts][").concat(r,"]")]=u}e["".concat(GLSR.nameprefix,"[_action]")]="fetch-paged-reviews",e["".concat(GLSR.nameprefix,"[page]")]=i.currentTarget.dataset.page||"",e["".concat(GLSR.nameprefix,"[url]")]=i.currentTarget.href||"",this.wrapperEl.classList.add(st.hideClass),i.preventDefault(),GLSR.ajax.post(e,this.handleResponse.bind(this,i.currentTarget.href))}}},{key:"handleResponse",value:function(t,i,n){n?([].forEach.call(this.wrapperEl.querySelectorAll(st.paginationSelector),(function(t){t.innerHTML=i.pagination})),this.reviewsEl.innerHTML=i.reviews,this.scrollToTop(),this.init(),this.wrapperEl.classList.remove(st.hideClass),GLSR.urlparameter&&window.history.pushState(null,"",t),new y(this.reviewsEl),GLSR.Event.trigger("site-reviews/pagination/handle",i,this)):window.location=t}},{key:"scrollToTop",value:function(){var t=st.scrollOffset;[].forEach.call(GLSR.ajaxpagination,(function(i){var n=document.querySelector(i);n&&"fixed"===window.getComputedStyle(n).getPropertyValue("position")&&(t+=n.clientHeight)}));var i=this.reviewsEl.getBoundingClientRect().top-t;i>0||this.scrollStep({endY:i,offset:window.pageYOffset,startTime:window.performance.now(),startY:this.reviewsEl.scrollTop})}},{key:"scrollStep",value:function(t){var i=Math.min(1,(window.performance.now()-t.startTime)/st.scrollTime),n=.5*(1-Math.cos(Math.PI*i)),e=t.startY+(t.endY-t.startY)*n;window.scroll(0,t.offset+e),e!==t.endY&&window.requestAnimationFrame(this.scrollStep.bind(this,t))}}]),t}(),rt=function(){[].forEach.call(document.querySelectorAll(st.paginationSelector),(function(t){var i=t.closest(".glsr");i&&new ot(i)}))},ut=function(){var t="glsr-modal__content",i="glsr-modal__review";window.GLSR.Modal.init({onClose:function(n,e,s){n.querySelector("."+t).innerHTML="",n.classList.remove(i),GLSR.Event.trigger("site-reviews/modal/close",n,e,s)},onOpen:function(n,e,s){var o=e.closest(".glsr").cloneNode(!0),r=e.closest(".glsr-review").cloneNode(!0);o.innerHTML="",o.appendChild(r),n.querySelector("."+t).appendChild(o),n.classList.add(i),GLSR.Event.trigger("site-reviews/modal/open",n,e,s)},openTrigger:"data-excerpt-trigger"})},ht=function(){[].forEach.call(document.querySelectorAll(".glsr"),(function(t){var i="glsr-"+window.getComputedStyle(t,null).getPropertyValue("direction");t.classList.add(i)})),new y,new O,rt()};window.hasOwnProperty("GLSR")||(window.GLSR={}),window.GLSR.ajax=new r,window.GLSR.forms=[],window.GLSR.Event=l,window.GLSR.Forms=O,window.GLSR.Modal=et,l.on("site-reviews/init",ht),l.on("site-reviews/excerpts/init",ut),document.addEventListener("DOMContentLoaded",(function(){l.trigger("site-reviews/init")}))},113:function(){},4030:function(){},6966:function(){},83:function(){},7649:function(){},3408:function(){},529:function(){},2275:function(){},2872:function(){},8865:function(){},4835:function(){},6786:function(){},1045:function(){},3622:function(){},2688:function(){},8340:function(){},3961:function(){},853:function(){},1273:function(){},5651:function(){},7730:function(){},3382:function(){},4747:function(){},4605:function(){},3963:function(){},5406:function(){},6829:function(){},6273:function(){},4518:function(){},6963:function(){},9449:function(t){"use strict";function i(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function n(t,i){for(var n=0;n<i.length;n++){var e=i[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}function e(t,i,e){return i&&n(t.prototype,i),e&&n(t,e),t}var s={classNames:{active:"gl-active",base:"gl-star-rating",selected:"gl-selected"},clearable:!0,maxStars:10,prebuilt:!1,stars:null,tooltip:"Select a Rating"},o=function(t,i,n){t.classList[i?"add":"remove"](n)},r=function(t){var i=document.createElement("span");for(var n in t=t||{})i.setAttribute(n,t[n]);return i},u=function(t,i,n){var e=r(n);return t.parentNode.insertBefore(e,i?t.nextSibling:t),e},h=function t(){for(var i=arguments.length,n=new Array(i),e=0;e<i;e++)n[e]=arguments[e];var s={};return n.forEach((function(i){Object.keys(i||{}).forEach((function(e){if(void 0!==n[0][e]){var o=i[e];"Object"!==a(o)||"Object"!==a(s[e])?s[e]=o:s[e]=t(s[e],o)}}))})),s},a=function(t){return{}.toString.call(t).slice(8,-1)},c=function(){function t(n,e){var s,o;i(this,t),this.direction=window.getComputedStyle(n,null).getPropertyValue("direction"),this.el=n,this.events={change:this.onChange.bind(this),keydown:this.onKeyDown.bind(this),mousedown:this.onPointerDown.bind(this),mouseleave:this.onPointerLeave.bind(this),mousemove:this.onPointerMove.bind(this),reset:this.onReset.bind(this),touchend:this.onPointerDown.bind(this),touchmove:this.onPointerMove.bind(this)},this.indexActive=null,this.indexSelected=null,this.props=e,this.tick=null,this.ticking=!1,this.values=function(t){var i=[];return[].forEach.call(t.options,(function(t){var n=parseInt(t.value,10)||0;n>0&&i.push({index:t.index,text:t.text,value:n})})),i.sort((function(t,i){return t.value-i.value}))}(n),this.widgetEl=null,this.el.widget&&this.el.widget.destroy(),s=this.values.length,o=this.props.maxStars,/^\d+$/.test(s)&&1<=s&&s<=o?this.build():this.destroy()}return e(t,[{key:"build",value:function(){this.destroy(),this.buildWidget(),this.selectValue(this.indexSelected=this.selected(),!1),this.handleEvents("add"),this.el.widget=this}},{key:"buildWidget",value:function(){var t,i,n=this;this.props.prebuilt?(t=this.el.parentNode,i=t.querySelector("."+this.props.classNames.base+"--stars")):((t=u(this.el,!1,{class:this.props.classNames.base})).appendChild(this.el),i=u(this.el,!0,{class:this.props.classNames.base+"--stars"}),this.values.forEach((function(t,e){var s=r({"data-index":e,"data-value":t.value});"function"==typeof n.props.stars&&n.props.stars.call(n,s,t,e),[].forEach.call(s.children,(function(t){return t.style.pointerEvents="none"})),i.innerHTML+=s.outerHTML}))),t.dataset.starRating="",t.classList.add(this.props.classNames.base+"--"+this.direction),this.props.tooltip&&i.setAttribute("role","tooltip"),this.widgetEl=i}},{key:"changeIndexTo",value:function(t,i){var n=this;if(this.indexActive!==t||i){if([].forEach.call(this.widgetEl.children,(function(i,e){o(i,e<=t,n.props.classNames.active),o(i,e===n.indexSelected,n.props.classNames.selected)})),"function"==typeof this.props.stars||this.props.prebuilt||(this.widgetEl.classList.remove("s"+10*(this.indexActive+1)),this.widgetEl.classList.add("s"+10*(t+1))),this.props.tooltip){var e=t<0?this.props.tooltip:this.values[t].text;this.widgetEl.setAttribute("aria-label",e)}this.indexActive=t}this.ticking=!1}},{key:"destroy",value:function(){this.indexActive=null,this.indexSelected=this.selected();var t=this.el.parentNode;t.classList.contains(this.props.classNames.base)&&(this.props.prebuilt?(this.widgetEl=t.querySelector("."+this.props.classNames.base+"--stars"),t.classList.remove(this.props.classNames.base+"--"+this.direction),delete t.dataset.starRating):t.parentNode.replaceChild(this.el,t),this.handleEvents("remove")),delete this.el.widget}},{key:"eventListener",value:function(t,i,n,e){var s=this;n.forEach((function(n){return t[i+"EventListener"](n,s.events[n],e||!1)}))}},{key:"handleEvents",value:function(t){var i=this.el.closest("form");i&&"FORM"===i.tagName&&this.eventListener(i,t,["reset"]),this.eventListener(this.el,t,["change"]),"add"===t&&this.el.disabled||(this.eventListener(this.el,t,["keydown"]),this.eventListener(this.widgetEl,t,["mousedown","mouseleave","mousemove","touchend","touchmove"],!1))}},{key:"indexFromEvent",value:function(t){var i,n,e=(null===(i=t.touches)||void 0===i?void 0:i[0])||(null===(n=t.changedTouches)||void 0===n?void 0:n[0])||t,s=document.elementFromPoint(e.clientX,e.clientY);return[].slice.call(s.parentNode.children).indexOf(s)}},{key:"onChange",value:function(){this.changeIndexTo(this.selected(),!0)}},{key:"onKeyDown",value:function(t){var i=t.key.slice(5);if(~["Left","Right"].indexOf(i)){var n="Left"===i?-1:1;"rtl"===this.direction&&(n*=-1);var e=this.values.length-1,s=Math.min(Math.max(this.selected()+n,-1),e);this.selectValue(s,!0)}}},{key:"onPointerDown",value:function(t){t.preventDefault();var i=this.indexFromEvent(t);this.props.clearable&&i===this.indexSelected&&(i=-1),this.selectValue(i,!0)}},{key:"onPointerLeave",value:function(t){var i=this;t.preventDefault(),cancelAnimationFrame(this.tick),requestAnimationFrame((function(){return i.changeIndexTo(i.indexSelected)}))}},{key:"onPointerMove",value:function(t){var i=this;t.preventDefault(),this.ticking||(this.tick=requestAnimationFrame((function(){return i.changeIndexTo(i.indexFromEvent(t))})),this.ticking=!0)}},{key:"onReset",value:function(){var t;this.selectValue((null===(t=this.el.querySelector("[selected]"))||void 0===t?void 0:t.index)||-1,!1)}},{key:"selected",value:function(){var t=this;return this.values.findIndex((function(i){return i.value===+t.el.value}))}},{key:"selectValue",value:function(t,i){var n;this.el.value=(null===(n=this.values[t])||void 0===n?void 0:n.value)||"",this.indexSelected=this.selected(),!1===i?this.changeIndexTo(this.selected(),!0):this.el.dispatchEvent(new Event("change"))}}]),t}(),f=function(){function t(n,e){i(this,t),this.destroy=this.destroy.bind(this),this.rebuild=this.rebuild.bind(this),this.widgets=[],this.buildWidgets(n,e)}return e(t,[{key:"buildWidgets",value:function(t,i){var n=this;this.queryElements(t).forEach((function(t){var e=h(s,i,JSON.parse(t.getAttribute("data-options")));"SELECT"!==t.tagName||t.widget||(!e.prebuilt&&t.parentNode.classList.contains(e.classNames.base)&&n.unwrap(t),n.widgets.push(new c(t,e)))}))}},{key:"destroy",value:function(){this.widgets.forEach((function(t){return t.destroy()}))}},{key:"queryElements",value:function(t){return"HTMLSelectElement"===a(t)?[t]:"NodeList"===a(t)?[].slice.call(t):"String"===a(t)?[].slice.call(document.querySelectorAll(t)):[]}},{key:"rebuild",value:function(){this.widgets.forEach((function(t){return t.build()}))}},{key:"unwrap",value:function(t){var i=t.parentNode,n=i.parentNode;n.insertBefore(t,i),n.removeChild(i)}}]),t}();t.exports=f}},i={};function n(e){if(i[e])return i[e].exports;var s=i[e]={exports:{}};return t[e](s,s.exports,n),s.exports}n.m=t,n.x=function(){},n.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(i,{a:i}),i},n.d=function(t,i){for(var e in i)n.o(i,e)&&!n.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:i[e]})},n.o=function(t,i){return Object.prototype.hasOwnProperty.call(t,i)},function(){var t={341:0},i=[[7401],[5406],[6829],[6273],[4518],[6963],[113],[4030],[6966],[83],[7649],[3408],[529],[2275],[2872],[8865],[4835],[6786],[1045],[3622],[2688],[8340],[3961],[853],[1273],[5651],[7730],[3382],[4747],[4605],[3963]],e=function(){},s=function(s,o){for(var r,u,h=o[0],a=o[1],c=o[2],f=o[3],l=0,d=[];l<h.length;l++)u=h[l],n.o(t,u)&&t[u]&&d.push(t[u][0]),t[u]=0;for(r in a)n.o(a,r)&&(n.m[r]=a[r]);for(c&&c(n),s&&s(o);d.length;)d.shift()();return f&&i.push.apply(i,f),e()},o=self.webpackChunk=self.webpackChunk||[];function r(){for(var e,s=0;s<i.length;s++){for(var o=i[s],r=!0,u=1;u<o.length;u++){var h=o[u];0!==t[h]&&(r=!1)}r&&(i.splice(s--,1),e=n(n.s=o[0]))}return 0===i.length&&(n.x(),n.x=function(){}),e}o.forEach(s.bind(null,0)),o.push=s.bind(null,o.push.bind(o));var u=n.x;n.x=function(){return n.x=u||function(){},(e=r)()}}(),n.x()}();
compatibility.php CHANGED
@@ -226,6 +226,18 @@ add_filter('site-reviews/build/template/reviews-form', function ($template) {
226
  return $template;
227
  });
228
 
 
 
 
 
 
 
 
 
 
 
 
 
229
  /**
230
  * Remove the "Launch Thrive Architect" button from reviews
231
  * @return array
@@ -235,16 +247,3 @@ add_filter('tcb_post_types', function ($blacklist) {
235
  $blacklist[] = glsr()->post_type;
236
  return $blacklist;
237
  });
238
-
239
- /**
240
- * Fix Star Rating control when review form is used inside an Elementor Pro Popup
241
- * @return void
242
- * @see https://elementor.com/
243
- */
244
- add_action('wp_enqueue_scripts', function () {
245
- if (defined('ELEMENTOR_PRO_VERSION') && 0 > version_compare('2.7.0', ELEMENTOR_PRO_VERSION)) {
246
- wp_add_inline_script(glsr()->id,
247
- '"undefined"!==typeof jQuery&&jQuery(document).on("elementor/popup/show",function(){GLSR.Event.trigger("site-reviews/init")})'
248
- );
249
- }
250
- }, 1000);
226
  return $template;
227
  });
228
 
229
+ /**
230
+ * Fix Star Rating control when review form is used inside an Elementor Pro Popup
231
+ * @return string
232
+ * @see https://elementor.com/
233
+ */
234
+ add_filter('site-reviews/enqueue/public/inline-script/after', function ($javascript) {
235
+ if (defined('ELEMENTOR_PRO_VERSION') && 0 > version_compare('2.7.0', ELEMENTOR_PRO_VERSION)) {
236
+ $javascript .= '"undefined"!==typeof jQuery&&jQuery(document).on("elementor/popup/show",function(){GLSR.Event.trigger("site-reviews/init")});';
237
+ }
238
+ return $javascript;
239
+ }, 1);
240
+
241
  /**
242
  * Remove the "Launch Thrive Architect" button from reviews
243
  * @return array
247
  $blacklist[] = glsr()->post_type;
248
  return $blacklist;
249
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin/Commands/EnqueuePublicAssets.php CHANGED
@@ -109,6 +109,7 @@ class EnqueuePublicAssets implements Contract
109
  ];
110
  $variables = glsr()->filterArray('enqueue/public/localize', $variables);
111
  wp_add_inline_script(glsr()->id, $this->buildInlineScript($variables), 'before');
 
112
  }
113
 
114
  /**
109
  ];
110
  $variables = glsr()->filterArray('enqueue/public/localize', $variables);
111
  wp_add_inline_script(glsr()->id, $this->buildInlineScript($variables), 'before');
112
+ wp_add_inline_script(glsr()->id, glsr()->filterString('enqueue/public/inline-script/after', ''));
113
  }
114
 
115
  /**
plugin/Modules/Html/Tags/ReviewAssignedLinksTag.php CHANGED
@@ -26,7 +26,7 @@ class ReviewAssignedLinksTag extends ReviewTag
26
  'text' => get_the_title($postId),
27
  ]);
28
  $usedIds[] = $postId;
29
- $usedIds = Arr::reindex(Arr::unique($usedIds));
30
  }
31
  }
32
  return $links;
26
  'text' => get_the_title($postId),
27
  ]);
28
  $usedIds[] = $postId;
29
+ $usedIds = Arr::unique($usedIds);
30
  }
31
  }
32
  return $links;
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: reviews, ratings, testimonials, woocommerce, product reviews
5
  Tested up to: 5.7
6
  Requires at least: 5.5
7
  Requires PHP: 5.6
8
- Stable tag: 5.8.1
9
  License: GPLv3
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -133,6 +133,11 @@ All documentation can be found in the "Help" page of the plugin. If your questio
133
 
134
  ## Changelog
135
 
 
 
 
 
 
136
  = 5.8.1 (2021-03-28) =
137
 
138
  - Fixed database versioning
5
  Tested up to: 5.7
6
  Requires at least: 5.5
7
  Requires PHP: 5.6
8
+ Stable tag: 5.8.2
9
  License: GPLv3
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
133
 
134
  ## Changelog
135
 
136
+ = 5.8.2 (2021-04-03) =
137
+
138
+ - Fixed javascript event system
139
+ - Fixed the FAQ javascript example of hiding the form after a review submission
140
+
141
  = 5.8.1 (2021-03-28) =
142
 
143
  - Fixed database versioning
site-reviews.php CHANGED
@@ -7,7 +7,7 @@
7
  * Plugin Name: Site Reviews
8
  * Plugin URI: https://wordpress.org/plugins/site-reviews
9
  * Description: Receive and display reviews on your website
10
- * Version: 5.8.1
11
  * Author: Paul Ryley
12
  * Author URI: https://geminilabs.io
13
  * License: GPL2
7
  * Plugin Name: Site Reviews
8
  * Plugin URI: https://wordpress.org/plugins/site-reviews
9
  * Description: Receive and display reviews on your website
10
+ * Version: 5.8.2
11
  * Author: Paul Ryley
12
  * Author URI: https://geminilabs.io
13
  * License: GPL2
views/pages/documentation/faq/hide-form-after-submission.php CHANGED
@@ -14,9 +14,9 @@
14
  * @param string $script
15
  * @return string
16
  */
17
- add_filter('site-reviews/enqueue/public/inline-script', function ($script) {
18
- return $script."
19
- GLSR.on('site-reviews/form/handle', function (response, formEl) {
20
  if (false !== response.errors) return;
21
  formEl.classList.add('glsr-hide-form');
22
  formEl.insertAdjacentHTML('afterend', '&lt;p&gt;' + response.message + '&lt;/p&gt;');
14
  * @param string $script
15
  * @return string
16
  */
17
+ add_filter('site-reviews/enqueue/public/inline-script/after', function ($javascript) {
18
+ return $javascript."
19
+ GLSR.Event.on('site-reviews/form/handle', function (response, formEl) {
20
  if (false !== response.errors) return;
21
  formEl.classList.add('glsr-hide-form');
22
  formEl.insertAdjacentHTML('afterend', '&lt;p&gt;' + response.message + '&lt;/p&gt;');