{"html":"<div class=\"blox-mega-bar-counter-number-inside\" id=\"{{uc_id}}\">\n  \t\n  <div class=\"blox-bar-row progresseight\" role=\"progressbar\" data-goal=\"{{value}}\" data-speed=\"{{speed}}\" data-reveal-on-scroll=\"{{start_animation_when_in_viewport}}\">\n        <div class=\"blox-border-bar\">\n            <div class=\"blox-border-progress-bar progress-eight__bar\" ><\/div>\n            \n        <\/div>\n      <div class=\"blox-bar-heading\">\n         {% if (show_graphic_element == \"true\") %}\n             <div class=\"uepb_graphic_el_wrapper\">\n               <div class=\"uepb_graphic_el\">\n                 {% if graphic_element_source == \"icon\" %} {{icon_html|raw}} {% endif %}\n                 {% if graphic_element_source == \"image\" %} <img src=\"{{graphic_image}}\" {{graphic_image_attributes|raw}}> {% endif %}\n                 {% if graphic_element_source == \"text\" %} <span>{{graphic_el_text|raw}}<\/span> {% endif %}\n               <\/div>\n             <\/div>\n            {% endif %}\n        \n          <div class=\"blox-border-bar-percentage progress-eight__label\"> <\/div>\n          <span class=\"ue-symbol\">{{symbol|raw}}<\/span>\n          <div class=\"blox-bar-title\">{{title|raw}}<\/div>\n          \n         \n        \n        \n      <\/div>\n\t<\/div>\n  \t\n<\/div>","css":".blox-mega-bar-counter-number-inside .blox-border-bar {\n   \n  \tmargin: 0 auto;\n}\n\n\n{% if show_graphic_element == \"true\" %}\n#{{uc_id}} .uepb_graphic_el_wrapper{\n  display: block;\n}\n#{{uc_id}} .uepb_graphic_el {\n  display:inline-flex;\n  align-items: center;\n  justify-content: center;\n  overflow:hidden;\n}\n{% endif %}","js":"jQuery(document).ready(function(){\t\nfunction {{uc_id}}_start(){\n  \n  var objBar = jQuery(\"#{{uc_id}}\");\n  var objProgress = objBar.find('.progresseight');\n  var isVisible = isElementInViewport(objBar);\n  var dataRevealOnScroll = objProgress.data('reveal-on-scroll');\n  var objParentTempalteSwitcher = objBar.parents(\".uc-template-holder\");\n  var isInsideTemplateSwitcher = objParentTempalteSwitcher && objParentTempalteSwitcher.length > 0;\n  var objParentSimplePopup = objBar.parents(\".ue-simple-popup\");\n  var isInsideSimplePopup = objParentSimplePopup && objParentSimplePopup.length > 0;\n  \n  \/**\n  * start function\n  *\/\n  function startBar(){    \n  \tvar waypoints = objBar.waypoint({\n      \n        handler: function(direction) {\n          objProgress.asProgress({'namespace': 'progress-eight'});\n          objProgress.asProgress('start');\n        },\n    \toffset: \"100%\"\n    });\n  }\n\n  \/**\n  * checks if in viewport\n  *\/\n  function isElementInViewport(objElement) {\t\t  \n\tvar elementTop = objElement.offset().top;\n\tvar elementBottom = elementTop + objElement.outerHeight();\n\n\tvar viewportTop = jQuery(window).scrollTop();\n\tvar viewportBottom = viewportTop + jQuery(window).height();\n\n  \treturn (elementBottom > viewportTop && elementTop < viewportBottom);    \n  }  \n    \n  \/**\n  * init for simple popup\n  *\/\n  function initForSimplePopup(){\n    if(isInsideSimplePopup == false)\n      return(false);\n    \n    var objSimplePopupBtn = objParentSimplePopup.find(\".ue-simple-popup-trigger\");\n    \n    objSimplePopupBtn.on(\"click\", function(){\n           var isInited = objBar.data(\"inited\");\n          \tif(isInited == true)\n              return(true);\n       \n            startBar();\n    });\n  }\n  \n  \/\/do not init if in Simple Popup, or is not in viewport\n  if(isVisible && isInsideSimplePopup == false || isInsideTemplateSwitcher == true && isInsideSimplePopup == false){\n      startBar();\n  \t\n  }else if(isVisible == false && dataRevealOnScroll == true){    \n    \tjQuery(window).on(\"scroll\",function(){          \n          var isInited = objBar.data(\"inited\");\n     \n          if(isInited == true)\n          \treturn(true);\n          \n          if(isInsideSimplePopup == true)\n      \t\treturn(true);\n            \n          var isVisible = isElementInViewport(objBar);\n              \n          if(isVisible){            \n            setTimeout(function(){              \n             \tstartBar();\n          \t\tobjBar.data(\"inited\", true);              \n            },{{delay_before_animation}});\n          } \n        });\n  }\n  \n  \/\/init simple popup function\n  initForSimplePopup();\n  \n}if(jQuery(\"#{{uc_id}}\").length) {{uc_id}}_start(); else\n\tjQuery( document ).on( 'elementor\/popup\/show', () => { if(jQuery(\"#{{uc_id}}\").length) {{uc_id}}_start();});\n});"}