| 1 |
(()=>{"use strict";const e={n:t=>{const n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{if(Array.isArray(n))for(var r=0;r<n.length;){var o=n[r++],i=n[r++];e.o(t,o)?0===i&&r++:0===i?Object.defineProperty(t,o,{enumerable:!0,value:n[r++]}):Object.defineProperty(t,o,{enumerable:!0,get:i})}else for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.hasOwn(e,t)},t=window.jQuery;var n=e.n(t);const r=".wp-block-getwid-progress-bar";function o(e,t){e.find(`${r}__progress`).css("width",`${t}%`),e.find(`${r}__percent`).text(`${t}%`)}function i(){const e=window.Waypoint;"function"==typeof e&&n()(".wp-block-getwid-progress-bar:not(.getwid-init)").each((t,i)=>{const a=n()(i),d=a.find(`${r}__wrapper`),s=d.get(0),c=Number.parseInt(String(d.data("fill-amount")||"0"),10),f=Boolean(d.data("is-animated"));if(!s)return;a.addClass("getwid-init");const u=new e({element:s,handler:()=>{f?function(e,t){const n=e.find(`${r}__progress`);n.animate({width:`${t}%`},{duration:2e3,progress:()=>{const t=n.parent().width()||1,o=Math.round((n.width()||0)/t*100);e.find(`${r}__percent`).text(o+"%")}})}(a,c):o(a,c),u.destroy()},offset:"100%"});n()(window).on("resize",()=>{o(a,c)})})}n()(document).ready(()=>{n()(document.body).on("post-load",()=>{i()}),i()})})(); |