var rpi=rpi||{}; rpi.Time={getFormatTime:function(a,e,c){a=new Date(this._ms(a));var m=c||"en";c=function(p){return 10>p?"0"+p:""+p};var g=a.getHours(),h=((new Intl.DateTimeFormat(m,{day:"numeric",month:"short"})).formatToParts(a).find(function(p){return"month"===p.type})||{}).value;m=(new Intl.DateTimeFormat(m,{day:"numeric",month:"long"})).formatToParts(a).find(function(p){return"month"===p.type}).value;var n=a.getFullYear(),l=String(n).slice(-2),f={yyyy:n,Y:n,yy:l,y:l,MMMM:m,MMM:h,M:h,MM:c(a.getMonth()+1),m:c(a.getMonth()+ 1),dd:c(a.getDate()),d:c(a.getDate()),HH:c(g),H:g,hh:c(g%12||12),h:g%12||12,mm:c(a.getMinutes()),i:c(a.getMinutes()),ss:c(a.getSeconds()),s:c(a.getSeconds()),a:12<=g?"pm":"am",A:12<=g?"PM":"AM"};return e.replace(/(MMMM|MMM|yyyy|HH|hh|MM|mm|dd|ss|yy|H|h|M|m|d|Y|y|i|s|a|A)/g,p=>null!=f[p]?f[p]:p)},getTimeAgo:function(a,e){a=(this._ms(a)-Date.now())/1E3;var c=Math.abs(a);e=new Intl.RelativeTimeFormat(e||"en",{numeric:"auto"});return 60>c?e.format(Math.round(a),"second"):3600>c?e.format(Math.round(a/ 60),"minute"):86400>c?e.format(Math.round(a/3600),"hour"):2592E3>c?e.format(Math.round(a/86400),"day"):31536E3>c?e.format(Math.round(a/2592E3),"month"):e.format(Math.round(a/31536E3),"year")},_ms:function(a){a=parseInt(a,10);return 1E10>a?1E3*a:a}};rpi=rpi||{}; rpi.Utils={__:function(a,e){return e&&e[a]||a},isVisible:function(a){let e=window.getComputedStyle(a);return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)&&"hidden"!==e.visibility&&"none"!==e.display},isInViewport:function(a,e=0){a=a.getBoundingClientRect();return a.top-window.innerHeight*e&&a.left-window.innerWidth*e},isRTL:function(){return"rtl"==(window.getComputedStyle?window.getComputedStyle(document.body,null).getPropertyValue("direction"): document.body.currentStyle.direction)},getParent:function(a,e="rplg"){e=Array.isArray(e)?e:[e];return a?a.closest("."+e.join(",.")):null},lang:function(){const a=navigator;return String((a.languages&&a.languages.length?a.languages[0]:null)||a.language||a.systemLanguage||a.userLanguage||"en").replace("_","-")},popup:function(a,e,c){var m=document.documentElement;a=window.open(a,"","scrollbars=yes, width="+e+", height="+c+", top="+((window.innerHeight?window.innerHeight:m.clientHeight?m.clientHeight: screen.height)/2-c/2+(void 0!=window.screenTop?window.screenTop:window.screenY))+", left="+((window.innerWidth?window.innerWidth:m.clientWidth?m.clientWidth:screen.width)/2-e/2+(void 0!=window.screenLeft?window.screenLeft:window.screenX)));window.focus&&a.focus();return a},ajax:function(a,e,c,m){const g=new XMLHttpRequest;g.open(e,a,!0);g.setRequestHeader("Content-Type","application/json");g.onreadystatechange=function(){if((g.readyState===XMLHttpRequest.DONE||g.readyState===g.DONE)&&200===g.status){const h= JSON.parse(g.responseText);"function"===typeof m?m(h):"function"===typeof c&&c(h)}};g.send(c&&"function"!==typeof c?JSON.stringify(c):null)},anchor:function(a,e,c,m,g){const h=[];c.open_link&&h.push("noopener");c.nofollow_link&&h.push("nofollow");return'"+e+""},rm:function(a){a&&a.parentNode&&a.parentNode.removeChild(a)},capit:function(a){return a.charAt(0).toUpperCase()+ a.slice(1)},url:function(a){try{return(new URL(a,window.location.origin)).href}catch(e){return""}},clear:function(){this.rm(document.getElementById("rpi-style"));if(rpi.Instances)for(;rpi.Instances.length;)rpi.Instances.pop().clear()}};rpi=rpi||{}; rpi.Column=function(a,e,c){const m=a.getAttribute("data-id"),g=new RegExp(c.col+"-[xsml]+"),h=new RegExp((m?'\\[data-id="'+m+'"\\]\\s+':"")+"\\."+c.card+"\\{--col:\\d+!important;--gap:\\d+!important\\}"),n=a.getElementsByClassName(c.cnt)[0];var l=null;return l={init:function(f,p){rpi.Utils.isVisible(n)?(f&&f(),l.resize(),window.addEventListener("resize",l.resize),p&&p(),rpi.Instances=rpi.Instances||[],rpi.Instances.push(l)):setTimeout(l.init,300)},resize:function(){let f=l.getSize();n.className=n.className.replace(g, c.col+"-"+f);if(e.breakpoints){let p=n.offsetWidth,r=e.breakpoints.split(",");r.sort(l.brsort);for(let t=0;tf?"xs":750>f?"x":1050>f?"s":1450>f?"m":1800>f?"l":"xl"},setCol:function(f){const p=this.getStyle();f=(m?'[data-id="'+m+'"] ':"")+"."+c.card+"{--col:"+f+"!important;--gap:"+(f-1)+"!important}";h.test(p.innerHTML)?p.innerHTML=p.innerHTML.replace(h,f):p.innerHTML+= f},getCol:function(){let f=this.getStyle().innerHTML.match(/--col:\s*(\d+)/);return f&&1parseInt(p.split(":")[0])?1:-1},clear:function(){window.removeEventListener("resize",l.resize)}}};rpi=rpi||{};rpi.AVA="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"; rpi.Common=function(a,e,c){let m=null;const g=rpi.Utils.lang();return m={init(){let h=a.getElementsByClassName(c.time),n=a.getElementsByClassName(c.text);for(const l of h)m.setTime(l);for(const l of n)m.setText(l)},initOnce(h){let n=h.getElementsByClassName(c.time)[0];h=h.getElementsByClassName(c.text)[0];m.setTime(n);m.setText(h)},setText(h){if(h&&h.textContent){var n=m.trimtext(h.textContent);h.textContent=n[0];n[1]&&(h.appendChild(rpi.el({tag:"span",cl:"rpi-s",text:"... "})),h.appendChild(rpi.el({tag:"span", cl:c.readmore,text:rpi.Utils.__("read more",e.trans),data:{hidden:n[1]}})),h.lastChild.onclick=m.opentext)}},trimtext(h){const n=parseInt(e.text_size,10);if(!h||!n||h.length<=n)return[h||"",""];h=Array.from(h);let l=h.slice(0,n).join("").lastIndexOf(" ");l=-1===l?n:l;return[h.slice(0,l).join("").trimEnd(),h.slice(l).join("")]},opentext(){let h=this.parentNode,n=this.dataset.hidden||"";rpi.Utils.rm(this.previousElementSibling);rpi.Utils.rm(this);h.appendChild(document.createTextNode(n))},setTime(h){h&& (h.textContent=m.time(h.dataset.time,h.dataset.lang))},time(h,n){return e.time_format?rpi.Time.getFormatTime(h,e.time_format,n||g):rpi.Time.getTimeAgo(h,n||g)}}}; rpi.el=function(a={},...e){const c=document.createElement("string"===typeof a?a:a.tag||"div");"string"!==typeof a&&(a.id&&(c.id=a.id),a.cl&&c.classList.add(...[].concat(a.cl).join(" ").split(/\s+/).filter(Boolean)),null!=a.text&&(c.textContent=a.text),a.data&&Object.assign(c.dataset,Object.fromEntries(Object.entries(a.data).filter(([,m])=>void 0!==m&&null!==m))),a.style&&(c.style.cssText=a.style),a.atts&&Object.keys(a.atts).forEach(m=>{const g=a.atts[m];null!==g&&void 0!==g&&!1!==g&&c.setAttribute(m, g)}),a.html&&(c.innerHTML=a.html),e=a.children?[].concat(a.children).concat(e):e);e.flat().forEach(m=>{m&&c.appendChild(m instanceof Node?m:document.createTextNode(String(m)))});return c};rpi=rpi||{}; rpi.Media=function(a,e={},{root:c="rpi",card:m="rpi-card"}={}){let g,h=null,n=null;return n={init:function(){h=a.getElementsByClassName("rpi-thumb");for(let l=0;lf||f>=h.length)){var p=l.src.replace(/=s[0-9]{1,3}/g,"=s500");l=(l=rpi.Utils.getParent(l,[m,"rpi-review"]))?l.outerHTML:"";if(g){let r=g.querySelector(".rpi-lightbox-media img"),t=g.querySelector(".rpi-lightbox-review"),v=g.querySelector(".rpi-lightbox-prev"), d=g.querySelector(".rpi-lightbox-next");r.src=p;t.innerHTML!==l&&(t.innerHTML=l,n.clicks(t));v.onclick=function(u){n.show(h[f-1],f-1)};d.onclick=function(u){n.show(h[f+1],f+1)}}else g=document.createElement("div"),g.className="rpi-lightbox",g.innerHTML='
'+l+"
",p=g.querySelector(".rpi-x"),l=g.querySelector(".rpi-lightbox-prev"),next=g.querySelector(".rpi-lightbox-next"),p.onclick=function(){g.style.display="none"},g.onclick=function(r){g==r.target&&(g.style.display="none")},l.onclick=function(r){n.show(h[f-1],f-1)},next.onclick=function(r){n.show(h[f+1],f+1)},n.clicks(g),document.body.appendChild(g);g.style.display="flex"}}}};rpi=rpi||{}; rpi.Slider=function(a,e,c,m){a.getAttribute("data-id");const g=a.getElementsByClassName(c.cnt)[0],h=a.getElementsByClassName(c.content)[0],n=h?h.getElementsByClassName(c.cards)[0]:null,l=h?h.getElementsByClassName(c.dotsWrap)[0]:null,f=h?h.getElementsByClassName(c.dots)[0]:null,p=n?parseInt(n.getAttribute("data-count")):0,{autoplay:r=!0,speed:t=5,mousestop:v=!0}=e;var d=null,u=h?h.getElementsByClassName(c.card):null,E="",F="",A=null,y=null,x=null,B=null,C=!1,z=!1,D=0,G=0;return d={init:function(b, k){rpi.Utils.isVisible(g)?(b&&b(),d.resize(),d.actions(),u.length&&d.swipeAutoStart(),k&&k(),rpi.Instances=rpi.Instances||[],rpi.Instances.push(d)):setTimeout(d.init,300)},resize:function(b){let k=m.column.resize(),q=m.column.getCol();b&&n.scrollLeft!=b*d.reviewWidth()&&n.scrollTo(u[b].offsetLeft,0);!u.length||E==k&&F==q||(d.hasDots()&&(d.dotsInit(),d.dotSwipe(b,!0)),E=k,F=q)},actions:function(){v&&d.addMouseEvents();window.addEventListener("resize",d.resizeListener);n&&(n.addEventListener("scroll", d.scrollListener,!1),e.wheelscroll&&h.addEventListener("wheel",d.wheelListener,!1));var b=g.getElementsByClassName(c.btnPrev)[0];b&&(b.onclick=function(k){k.preventDefault();k.stopPropagation();d.btnClick(-1)});if(b=g.getElementsByClassName(c.btnNext)[0])b.onclick=function(k){k.preventDefault();k.stopPropagation();d.btnClick(1)}},resizeListener:function(){var b=G;clearTimeout(A);A=setTimeout(d.resize,150,b)},scrollListener:function(){clearTimeout(y);clearTimeout(x);x=setTimeout(d.scrollEnd,150)}, wheelListener:function(b){var k=b.target;if((k=-1k.clientHeight)return!0;b.preventDefault();D++;clearTimeout(B);B=setTimeout(d.wheelEnd,150,b)},addMouseEvents:function(){g.addEventListener("mouseover",d.mouseOver,!1);g.addEventListener("mouseleave",d.mouseLeave,!1)},delMouseEvents:function(){g.removeEventListener("mouseover",d.mouseOver);g.removeEventListener("mouseleave",d.mouseLeave)},mouseOver:function(){C= 1;d.swipeAutoStop()},mouseLeave:function(){C=0;d.swipeAutoStart()},btnClick:function(b){d.swipeManual(b*d.swipePerBtn())},wheelEnd:function(b){d.swipeManual(Math.sign(b.wheelDelta)*D*d.swipeStep());D=0},scrollEnd:function(){G=d.reviewsIdx();z?z=!1:d.loadNextReviews();(!v||C)&&v||(!e.clickstop||z)&&e.clickstop||d.swipeAutoStart();d.hasDots()&&d.dotSwipe(void 0,!0)},loadNextReviews:function(b){b=b?d.reviewsIdx()+parseInt(b):d.hasDots()?(b=f.getElementsByClassName("active")[0])?parseInt(b.getAttribute("data-index"))* d.swipePerDot():d.reviewsIdx():d.reviewsIdx();b=d.getAjaxSize(b);0q){let H=b-q;Math.abs(H)<3*d.swipePerDot()?k=w:H&&(k=Math.ceil(b/w)*w-q)}b=q+k-p;return 0b?0:b>=f.childNodes.length?f.childNodes.length-1:b;b=f.querySelector("."+c.dot+'[data-index="'+b+'"]');let q=f.getElementsByClassName("active")[0];d.dotActivate(q,b);d.dotScroll(b,k)},dotScroll:function(b,k){let q=Math.round(f.scrollWidth/f.childNodes.length),w=Math.floor(Math.round(f.offsetWidth/q)/2);k?f.scrollTo(b.offsetLeft-w*q,0):f.scrollTo({left:b.offsetLeft-w*q,behavior:"smooth"})},dotActivate:function(b,k){b&&(b.classList.remove("active"),b.classList.remove("s1"),b.previousSibling&& (b.previousSibling.classList.remove("s2"),b.previousSibling.previousSibling&&b.previousSibling.previousSibling.classList.remove("s3")),b.nextSibling&&(b.nextSibling.classList.remove("s2"),b.nextSibling.nextSibling&&b.nextSibling.nextSibling.classList.remove("s3")));k&&(k.classList.add("active"),k.classList.add("s1"),k.previousSibling&&(k.previousSibling.classList.add("s2"),k.previousSibling.previousSibling&&k.previousSibling.previousSibling.classList.add("s3")),k.nextSibling&&(k.nextSibling.classList.add("s2"), k.nextSibling.nextSibling&&k.nextSibling.nextSibling.classList.add("s3")))},swipeManual:function(b){z=!0;d.loadNextReviews(b);d.scroll(b);e.clickstop&&(d.swipeAutoStop(),d.delMouseEvents())},swipeAuto:function(){if(rpi.Utils.isInViewport(g))if(d.isScrollEnd())d.scroll(-(p-d.reviewsPerView()));else{let b=d.swipeStep()k? 0:k>=u.length?u.length-1:k;-1Math.abs(b.left-k.left)||b.left<=k.left)&&k.leftMath.abs(b.right- k.right)||b.right>=k.right)&&k.right>b.left},swipeStep:function(){return e.swipe_step||d.reviewsPerView()},swipePerBtn:function(){return e.swipe_per_btn||d.reviewsPerView()},swipePerDot:function(){return e.swipe_per_dot||d.reviewsPerView()},reviewWidth:function(){return Math.round(n.scrollWidth/u.length)},reviewHeight:function(){return u[0].offsetHeight},reviewsPerView:function(){return Math.round(n.offsetWidth/d.reviewWidth())},reviewsIdx:function(){let b=rpi.Utils.isRTL()?-n.scrollLeft:n.scrollLeft; return Math.round(b/d.reviewWidth())},reviewsAhead:function(){return u.length-(d.reviewsIdx()+d.reviewsPerView())},hasDots:function(){return f&&!e.hide_dots&&0reviews.length&&c.removeChild(this);return!1}function rplg_leave_review_window(){rpi.Utils.popup(this.getAttribute("href"),620,500);return!1} function grw_init(a,e){a=rpi.Utils.getParent(a,"wp-gr");if("true"!=a.getAttribute("data-exec")){a.setAttribute("data-exec","true");var c=JSON.parse(a.getAttribute("data-options"));rpi.Common(a,c,{time:"wp-google-time",text:"wp-google-text",readmore:"wp-more-toggle"}).init();rpi.Media(a,{},{root:"wp-gr",card:"grw-review"}).init();!a.getElementsByClassName("grw-review")[0]||"slider"!=e&&"grid"!=e||(e=a.getElementsByClassName("grw-row")[0],e=JSON.parse(e.getAttribute("data-options")),c=rpi.Column(a, e,{cnt:"grw-row",col:"grw-row",card:"grw-review"}),rpi.Slider(a,e,{cnt:"grw-row",col:"grw-row",content:"grw-content",cards:"grw-reviews",card:"grw-review",text:"wp-google-text",btnPrev:"grw-prev",btnNext:"grw-next",dotsWrap:"rpi-dots-wrap",dots:"rpi-dots",dot:"rpi-dot"},{column:c}).init())}}function grw_boot(){const a=document.querySelectorAll('.wp-gr[data-exec="false"]');for(let c=0;c