{"html":"<div id=\"{{uc_id}}\" class=\"uc_semi_circle_holder\">\n\t\n  \n   <div id=\"cc_{{uc_id}}\">\n     \n  <\/div>\n{% if show_label == \"true\" %}<div class=\"semi_circle_label\">{{title|raw}}<\/div>{% endif %}\t\n  \n<\/div>","css":"#{{uc_id}}.uc_semi_circle_holder{\n\tposition: relative;\n}\n\n#{{uc_id}} .semi_circle_label\n{\n  text-align:center;\n}\n\n#{{uc_id}}.uc_semi_circle_holder #cc_{{uc_id}} {\n    width: {{size}}px;\n    height: auto;\n  \tfloat: {{alignment}};\n\tmargin: 0 auto;\n}\n#{{uc_id}}.uc_semi_circle_holder #cc_{{uc_id}} span{\n    position: absolute;\n    left: 50%;\n    top: 105%;\n    transform: translateX(-50%);\n  \tdisplay: block;\n  \twidth: 80%;\n\ttext-align: center;\n}\n#{{uc_id}}.uc_semi_circle_holder #cc_{{uc_id}} .progressbar-text{\n    position: absolute;\n    left: 50%;\n    top: 50%;\n    transform: translate(-50%, 50%);\n}","js":"jQuery(document).ready(function(){\t\nfunction {{uc_id}}_start(){\n  \n  var objBar = jQuery(\"#{{uc_id}}\");  \n  var isVisible = isElementInViewport(objBar);\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\t  \n  \/**\n  * start\n  *\/\n  function startBar(){\n      \n      var bar = new ProgressBar.SemiCircle(cc_{{uc_id}}, {\n        strokeWidth: {{stroke_width}},\n        trailColor: '{{track_color}}',\n        trailWidth: {{track_width}},\n        easing: 'easeInOut',\n        duration: {{duration}},\n        svgStyle: null,\n        text: {\n          value: '',\n          alignToBottom: true\n        },                                           \n        \n\t    from: {color: '{{progress_color}}'},\n        to: {color: '{{progress_color}}'},\n\n        \/\/ Set default step function for all animate calls\n        step: (state, bar) => {\n          bar.path.setAttribute('stroke', state.color);\n          var value = Math.round(bar.value() * 100);\n          if (value === 0) {\n            bar.setText('');\n          } else {\n            bar.setText('{{symbol_before_value|raw}}' + value + '{{symbol_after_value|raw}}');\n          }\n\n          bar.text.style.color = state.color;\n        }\n      });\n      \n      bar.animate({{value}} \/ 100);  \/\/ Number from 0.0 to 1.0\n    }\n            \n  \/**\n  * checks if in viewport\n  *\/\n  function isElementInViewport(objElement) {\n\t\t  \n\t\t  var elementTop = objElement.offset().top;\n\t\t  var elementBottom = elementTop + objElement.outerHeight();\n\n\t\t  var viewportTop = jQuery(window).scrollTop();\n\t\t  var viewportBottom = viewportTop + jQuery(window).height();\n\n\t\t  return (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            objBar.data(\"inited\", true);         \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{\n    \n    \tjQuery(window).on(\"scroll\",function(){\n            var isInited = objBar.data(\"inited\");\n          \tif(isInited == true)\n              return(true);\n          \n           if(isInsideSimplePopup == true)\n      \t\treturn(true);\n          \n           var isVisible = isElementInViewport(objBar);\n           if(isVisible){\n               objBar.data(\"inited\", true);\n              startBar();\n           }\n            \n        });\n  }\n\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});"}