"use strict";function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter)}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);ib.category)return 1;return 0});var categoryFilter=data[1].filter(function(item){return item.category!=="Uncategorized"});categoryFilter.forEach(function(eachData){_this8.categoryWrap.innerHTML+="
  • ").concat(eachData.category,"").concat(eachData.totalPost,"
  • ")})}}},{key:"createLatestWidget",value:function createLatestWidget(data){var _this9=this;var path=location.pathname.split("https://www.indonez.com/");path[path.length-1]="blog";if(document.querySelector(".widget-latest")!==null){data[0].latestPost.forEach(function(each){_this9.latestWrap.innerHTML+="\n
  • \n ").concat(_this9.trimLongTitle(each.title,55),"
    \n ").concat(each.date,"\n
  • \n ")})}}},{key:"createTagWidget",value:function createTagWidget(data){var _this10=this;if(document.querySelector(".widget-tag")!==null){data[0].tagLists.sort();var tagFilter=data[0].tagLists.filter(function(item){return item!=="untagged"});tagFilter.forEach(function(eachTag){if(eachTag.length!==0){_this10.tagWrap.innerHTML+="#").concat(eachTag,"")}else{_this10.tagWrap.innerHTML="No tags available yet"}})}}},{key:"createPagination",value:function createPagination(data){if(document.querySelector("[data-title=\"blog\"]")){var element=document.querySelector(".pagination");var totalPages=data[0].totalPages;var page=!this.currentPage.includes("blog-page")?1:parseInt(this.currentPage.substring(10).slice(0,-5));var liTag="";var active="";var beforePage=page-1;var afterPage=page+1;if(totalPages===1){element.remove()}if(page>3){liTag+="
  • «
  • ")}if(page==1){afterPage=afterPage+2}else if(page==2){afterPage=afterPage+1}else if(page!==totalPages&&pagetotalPages){continue}if(plength==0){plength=plength+1}if(page==plength){active="active"}else{active=""}liTag+="
  • ").concat(plength,"
  • ")}if(page»")}element.innerHTML=liTag}}},{key:"createFindPage",value:function createFindPage(data){var _this11=this;if(document.querySelector("[data-title=\"blog-find\"]")){var params=new URLSearchParams(window.location.search);var textEl=document.querySelector(".blog-find-text");var headingEl=document.querySelector(".blog-find-heading");if(params.has("category")){var categoryName=this.capitalizeText(params.get("category"));textEl.textContent="Post with category :";headingEl.innerHTML="".concat(categoryName);data[1].filter(function(post){if(post.category.toLowerCase()===categoryName.toLowerCase()){var postWrap=document.querySelector(".blog-find");var selectedPost=post.posts;setTimeout(function(){selectedPost.forEach(function(each){var articleDiv=document.createElement("div");articleDiv.innerHTML=_this11.postFormat(each);postWrap.appendChild(articleDiv)},0)})}})}if(params.has("tag")){var tagName=params.get("tag");textEl.textContent="Post with tag :";headingEl.innerHTML="".concat(tagName);data[2].filter(function(post){if(post.tag.toLowerCase()===tagName.toLowerCase()){var postWrap=document.querySelector(".blog-find");var selectedPost=post.posts;selectedPost.forEach(function(post){var articleDiv=document.createElement("div");articleDiv.innerHTML=_this11.postFormat(post);postWrap.appendChild(articleDiv)})}})}}}},{key:"searchForm",value:function searchForm(data){if(document.forms["blog-search"]!==undefined){var _ref;var inputSearch=document.forms["blog-search"];var category=data[1].map(function(item){item.posts.map(function(x){return x.category=item.category});return item}).map(function(arr){return arr.posts});var posts=(_ref=[]).concat.apply(_ref,_toConsumableArray(category));inputSearch.addEventListener("submit",function(e){e.preventDefault();if(!inputSearch.checkValidity()){e.preventDefault();e.stopPropagation();inputSearch.classList.add("was-validated")}else{var term=e.target[0].value.toLowerCase();var params=new URLSearchParams;params.append("result",term);location.href="blog-find.html?".concat(params.toString())}});this.searchProcess(posts)}}},{key:"searchProcess",value:function searchProcess(data){var _this12=this;var params=new URLSearchParams(window.location.search);var textEl=document.querySelector(".blog-find-text");var headingEl=document.querySelector(".blog-find-heading");var postWrap=document.querySelector(".blog-find");var notFoundArr=[];if(document.querySelector("[data-title=\"blog-find\"]")&¶ms.has("result")){data.forEach(function(post){var title=post.title.toLowerCase();var body=post.content.toLowerCase();textEl.textContent="Search result for :";headingEl.innerHTML="".concat(params.get("result"));notFoundArr.push(title.indexOf(params.get("result")));notFoundArr.push(body.indexOf(params.get("result")));if(title.indexOf(params.get("result"))>-1||body.indexOf(params.get("result"))>-1){var articleDiv=document.createElement("div");articleDiv.innerHTML=_this12.postFormat(post);postWrap.appendChild(articleDiv)}});if(this.checkDiff(notFoundArr)!==true){var notFoundDiv=document.createElement("div");notFoundDiv.innerHTML="
    \n
    \n

    Nothing Found

    \n

    Sorry, but nothing matched your search terms.

    \n
    \n
    ";postWrap.appendChild(notFoundDiv)}}}},{key:"postFormat",value:function postFormat(_ref2){var link=_ref2.link,title=_ref2.title,content=_ref2.content,author=_ref2.author,date=_ref2.date,category=_ref2.category;var path=location.pathname.split("https://www.indonez.com/");path[path.length-1]="blog";return"
    \n
    \n

    \n ").concat(title,"\n

    \n

    ").concat(content,"

    \n
    \n \"author\"\n \n ").concat(author.name,"\u2022").concat(date,"\n \n
    \n
    \n \n
    ")}},{key:"checkDiff",value:function checkDiff(a){return a.length!==0&&new Set(a).size!==1}},{key:"trimLatestWidget",value:function trimLatestWidget(){var _this13=this;if(document.querySelector(".widget-latest")!==null){var latestWrap=document.querySelector(".widget-latest");var titleList=latestWrap.querySelectorAll("a");titleList.forEach(function(title){return title.textContent=_this13.trimLongTitle(title.textContent,55)})}}},{key:"capitalizeText",value:function capitalizeText(string){var arr=string.split(" ");for(var i=0;i").concat(this.homeTitle,"");this.breadcrumbTitle.forEach(function(e){if(_this14.breadcrumbHome!==e.pathname){createLiElement=document.createElement("li");createLiElement.classList.add("breadcrumb-item");createLiElement.innerHTML="").concat(e.textContent,"");element.appendChild(createLiElement)}})}},{key:"createBreadcrumbLast",value:function createBreadcrumbLast(){var lastLiElement=this.breadcrumb.children[this.breadcrumb.childNodes.length-1];this.createLiElement=document.createElement("li");this.createLiElement.classList.add("breadcrumb-item","active");this.createLiElement.setAttribute("aria-current","page");if(lastLiElement){lastLiElement.remove();this.createLiElement.innerHTML=lastLiElement.textContent;this.breadcrumb.appendChild(this.createLiElement)}}},{key:"createBreadcrumbBlog",value:function createBreadcrumbBlog(pathParam,blogPath){if(document.querySelector("[data-title=\"blog-single\"]")||document.querySelector("[data-title=\"blog-find\"]")){var breadcrumbEl=this.breadcrumb;var articleEl=this.articleElement;var createLiArticle=document.createElement("li");var breadcrumbCurrent=this.navbar.querySelectorAll("li a");this.breadcrumb.innerHTML="
  • ").concat(this.homeTitle,"
  • ");breadcrumbCurrent.forEach(function(e){if(e.pathname.split("https://www.indonez.com/").at(-1)==blogPath){var urlParams=window.location.href.split("https://www.indonez.com/");var currentPage=urlParams.pop();var levelOne=document.createElement("li");var levelTwo=document.createElement("li");levelOne.classList.add("breadcrumb-item","active");levelOne.setAttribute("aria-current","page");levelOne.innerHTML=e.textContent;if(e.closest(".dropdown-menu")!==null){levelOne.innerHTML=e.textContent;levelTwo.innerHTML="").concat(e.closest(".dropdown-menu").previousElementSibling.textContent,"");levelTwo.classList.add("breadcrumb-item");levelTwo.setAttribute("aria-current","page");breadcrumbEl.appendChild(levelTwo)}if(!currentPage.includes("page")&&!currentPage.includes("find")){levelOne.classList.remove("active");levelOne.innerHTML="").concat(e.textContent,"")}breadcrumbEl.appendChild(levelOne)}});if(document.querySelector(".".concat(articleEl))!==null){var articleTitle=document.querySelector(".".concat(articleEl)).querySelector(this.titleElement).textContent;articleTitle=this.truncate?this.truncateBreadcrumb(articleTitle,this.truncateWords):articleTitle;createLiArticle.innerHTML=articleTitle;createLiArticle.classList.add("breadcrumb-item","active");createLiArticle.setAttribute("aria-current","page");breadcrumbEl.appendChild(createLiArticle)}}}},{key:"truncateBreadcrumb",value:function truncateBreadcrumb(string,number){var cut=string.indexOf(" ",number);if(cut==-1)return string;return string.substring(0,cut)+" ..."}}]);return Breadcrumb}();new Breadcrumb().init();var CarouselConfig=function(){function CarouselConfig(settings){_classCallCheck(this,CarouselConfig);this.element=settings.element;this.interval=settings.interval;this.control=settings.control;this.transition=settings.fadeTransition;this.height=settings.height}_createClass(CarouselConfig,[{key:"init",value:function init(){if(document.querySelector(this.element)!==null){var carouselWrap=document.querySelector(this.element);var carouselItem=carouselWrap.querySelectorAll(".carousel-item");var carouselId=carouselWrap.getAttribute("id");carouselItem[0].classList.add("active");if(this.transition){carouselWrap.classList.add("carousel-fade")}this.generatebutton(carouselWrap);this.generateIndicator(carouselWrap,carouselItem,carouselId);this.setHeight(carouselItem);new bootstrap.Carousel(carouselWrap,{interval:this.interval,keyboard:true,pause:"hover",ride:"carousel",touch:true,wrap:true})}}},{key:"generatebutton",value:function generatebutton(carouselWrap){if(this.control.type==="button"||this.control.type==="both"){var prevBtn=document.createElement("button");var nextBtn=document.createElement("button");prevBtn.setAttribute("class","carousel-control-prev");prevBtn.setAttribute("type","button");prevBtn.setAttribute("data-bs-target",this.element);prevBtn.setAttribute("data-bs-slide","prev");nextBtn.setAttribute("class","carousel-control-next");nextBtn.setAttribute("type","button");nextBtn.setAttribute("data-bs-target",this.element);nextBtn.setAttribute("data-bs-slide","next");carouselWrap.appendChild(prevBtn);carouselWrap.appendChild(nextBtn);if(this.control.onHover){carouselWrap.classList.add("control-hover")}}}},{key:"generateIndicator",value:function generateIndicator(carouselWrap,carouselItem,carouselId){if(this.control.type==="indicator"||this.control.type==="both"){var indicatorWrap=document.createElement("div");indicatorWrap.setAttribute("class","carousel-indicators");carouselItem.forEach(function(each,index){var btnIndicator=document.createElement("button");btnIndicator.setAttribute("type","button");btnIndicator.setAttribute("aria-label","carousel-button");btnIndicator.setAttribute("data-bs-target","#".concat(carouselId));btnIndicator.setAttribute("data-bs-slide-to",index);if(index==0){btnIndicator.classList.add("active");btnIndicator.setAttribute("aria-current",true)}indicatorWrap.appendChild(btnIndicator)});carouselWrap.appendChild(indicatorWrap);if(this.control.onHover){carouselWrap.classList.add("indicators-hover")}}}},{key:"setHeight",value:function setHeight(carouselItem){var _this15=this;if(window.matchMedia("(min-width: 992px)").matches){carouselItem.forEach(function(each){each.style.minHeight=_this15.height.desktop})}else if(window.matchMedia("(min-width: 768px)").matches){carouselItem.forEach(function(each){each.style.minHeight=_this15.height.tablet})}else{carouselItem.forEach(function(each){each.style.minHeight=_this15.height.phone})}}}]);return CarouselConfig}();var ContactForm=function(){function ContactForm(){_classCallCheck(this,ContactForm);this.contactForm=document.getElementById("contact-form");this.buttonSend=document.getElementById("sendemail")}_createClass(ContactForm,[{key:"init",value:function init(){var _this16=this;document.addEventListener("DOMContentLoaded",function(){if(typeof _this16.buttonSend!=="undefined"&&_this16.buttonSend!==null){_this16.buttonSend.addEventListener("click",function(event){event.preventDefault();var postdata=_this16.serialize(_this16.contactForm);if(!_this16.contactForm.checkValidity()){event.preventDefault();event.stopPropagation();_this16.setLoading(_this16.buttonSend);_this16.contactForm.classList.add("was-validated")}else{_this16.setLoading(_this16.buttonSend,"success")}_this16.ajaxRequest("POST","sendmail.html",postdata,function(success,response){if(success){var result=JSON.parse(response);if(result.isSuccess){var toast=new bootstrap.Toast(document.querySelector(".toast"));setTimeout(function(){_this16.setLoading(_this16.buttonSend);_this16.contactForm.reset();_this16.contactForm.classList.remove("was-validated");toast.show()},1200)}}})})}})}},{key:"setLoading",value:function setLoading(btnElem,status){if(status=="success"){btnElem.setAttribute("disabled","");btnElem.innerHTML=" Please wait..."}else{btnElem.removeAttribute("disabled");btnElem.textContent="Send message"}}},{key:"serialize",value:function serialize(form){return Array.from(new FormData(form),function(e){return e.map(encodeURIComponent).join("=")}).join("&")}},{key:"ajaxRequest",value:function ajaxRequest(method,url,data,functionResult){var xmlhttp=new XMLHttpRequest;xmlhttp.open(method,url,true);xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");xmlhttp.send(data);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4&&xmlhttp.status==200){functionResult(true,xmlhttp.responseText)}else{functionResult(false,"")}}}}]);return ContactForm}();new ContactForm().init();var CounterUp=function(){function CounterUp(_props){_classCallCheck(this,CounterUp);this.defaults={duration:2000,prepend:"",append:"",selector:".counter-up",start:0,end:100,intvalues:false,interval:100};var self=this;this.updating=false;this.intervalID=null;this.props={};for(var pna in this.defaults){if(typeof pna!=="undefined"){self.props[pna]=self.defaults[pna];if(_props.hasOwnProperty(pna)&&self.props.hasOwnProperty(pna))self.props[pna]=_props[pna]}}this.domelems=document.querySelectorAll(this.props.selector);this.elems=[];var cur={};this.domelems.forEach(function(el){cur.obj=el;var start=parseInt(el.getAttribute("data-counter-start"));isNaN(start)?cur.start=self.props.start:cur.start=start;var end=parseInt(el.getAttribute("data-counter-end"));isNaN(end)?cur.end=self.props.end:cur.end=end;var dur=parseInt(el.getAttribute("data-counter-duration"));isNaN(dur)?cur.duration=self.props.duration:cur.duration=dur;var prep=el.getAttribute("data-counter-prepend");prep==null?cur.prepend=self.props.prepend:cur.prepend=prep;var app=el.getAttribute("data-counter-append");app==null?cur.append=self.props.append:cur.append=app;var intval=el.getAttribute("data-counter-intval");intval==null?cur.intvalues=self.props.intvalues:cur.intvalues=intval;cur.step=(cur.end-cur.start)/(cur.duration/self.props.interval);cur.val=cur.start;self.elems.push(cur);cur={}})}_createClass(CounterUp,[{key:"start",value:function start(){var self=this;if(document.querySelector(self.props.selector)!=null){var observer=new IntersectionObserver(function(entries){if(entries[0].isIntersecting){this.intervalID=setInterval(function(){if(!self.updating)self.update()},self.props.interval)}},{threshold:[0]});observer.observe(document.querySelector(self.props.selector))}}},{key:"update",value:function update(){this.updating=true;var alldone=true;var self=this;this.elems.forEach(function(el){el.val+=el.step;if(el.val";var modalWrapper=document.createElement("div");modalWrapper.classList.add("modal","fade");modalWrapper.setAttribute("id","navbarModal");modalWrapper.setAttribute("tabindex","-1");modalWrapper.setAttribute("data-bs-backdrop","static");modalWrapper.setAttribute("aria-hidden","true");modalWrapper.innerHTML="\n
    \n
    \n
    \n
      \n ".concat(navbar.innerHTML,"\n
    \n ").concat(this.createAddonBtn(),"\n
    \n
    \n
    ");if(document.querySelector(".btn-mobile-navbar")!==null){document.querySelector(".btn-mobile-navbar").remove()}this.navbar.closest(".container").appendChild(btnOpen);this.navbar.closest(".container").appendChild(modalWrapper)}},{key:"createButtonListener",value:function createButtonListener(){var btnModal=document.querySelectorAll(".btn-mobile-navbar");btnModal.forEach(function(btn){btn.addEventListener("click",function(e){var parent=document.querySelector(".loaded");var sticky=document.querySelector(".sticky-nav");var toggle=parent.classList.toggle("show");if(toggle){btn.classList.add("show");btn.classList.remove("d-lg-none");btn.innerHTML="";sticky.children[0].classList.add("d-flex","justify-content-end");sticky.setAttribute("style","background-color: transparent; backdrop-filter: blur(0px); box-shadow: none;");sticky.querySelector(".navbar-brand").hidden=true}else{btn.classList.remove("show");btn.classList.add("d-lg-none");btn.innerHTML="";sticky.children[0].classList.remove("d-flex","justify-content-end");sticky.removeAttribute("style");sticky.querySelector(".navbar-brand").hidden=false}})})}},{key:"createAddonBtn",value:function createAddonBtn(){var optionalNav=this.optionalNav;var methodUrl=this.addonBtnUrl;var methodName=this.addonBtnName;var methodIcon=this.addonBtnIcon;var signinBtn="";if(this.addonButtons&&this.optionalNav!==null&&this.optionalNav.children.length>0){this.buttons.forEach(function(e){signinBtn+="").concat(methodName(e,optionalNav)).concat(methodIcon(e),"")})}return signinBtn}},{key:"addonBtnUrl",value:function addonBtnUrl(data,element){var urlValue;data.url.length>0?urlValue=data.url:urlValue=element.querySelector("a").href;return urlValue}},{key:"addonBtnName",value:function addonBtnName(data,element){var nameValue;data.name.length>0?nameValue=data.name:nameValue=element.querySelector("a").innerText;return nameValue}},{key:"addonBtnIcon",value:function addonBtnIcon(data){var iconValue;data.icon!==undefined&&data.icon.length>0?iconValue=""):iconValue="";return iconValue}}]);return MobileNavbar}();new MobileNavbar({addonButtons:true,buttons:[{name:"Sign in",url:"",type:"primary",icon:"right-to-bracket"}]}).init();var PageLoader=function(){function PageLoader(){_classCallCheck(this,PageLoader);this.animation=true;this.class="loaded"}_createClass(PageLoader,[{key:"init",value:function init(){var _this17=this;if(this.animation){window.addEventListener("load",function(){return document.querySelector("body").classList.add(_this17.class)})}}}]);return PageLoader}();new PageLoader().init();var ShufflePlugin=function(){function ShufflePlugin(){_classCallCheck(this,ShufflePlugin);this.element=document.querySelectorAll(".masonry-wrapper")}_createClass(ShufflePlugin,[{key:"init",value:function init(){var _this18=this;if(this.element.length!==0){this.element.forEach(function(each){var shuffleInstance=new window.Shuffle(each,{itemSelector:".masonry-item"});_this18.shuffleFilter(each,shuffleInstance)})}}},{key:"shuffleFilter",value:function shuffleFilter(element,instance){var filterList=element.parentElement.querySelector(".masonry-filter");if(filterList!==null){var filterButtons=Array.from(filterList.children);filterButtons.forEach(function(button){button.addEventListener("click",function(e){instance.filter(e.target.getAttribute("data-group"))})})}}}]);return ShufflePlugin}();new ShufflePlugin().init();var StickyMenu=function(){function StickyMenu(){_classCallCheck(this,StickyMenu);this.navbarName="navbar";this.paddingName="py-2";this.hideOther=true;this.showOnUp=true}_createClass(StickyMenu,[{key:"init",value:function init(){var _this19=this;if(document.querySelector(".".concat(this.navbarName))!==null){this.navbarEl=document.querySelector(".".concat(this.navbarName));this.clonedNav=this.navbarEl.children[0].cloneNode(true);this.parentNav=this.navbarEl.parentElement;this.stickyNav=document.createElement("nav");this.stickyNav.appendChild(this.clonedNav);this.parentNav.insertBefore(this.stickyNav,this.navbarEl.nextSibling);this.stickyNav.classList.add("sticky-nav","navbar","navbar-expand-xl","navbar-light");this.stickyNav.children[0].classList.remove(this.paddingName);this.stickyNav.children[0].children[1].removeAttribute("id");this.stickyNav.children[0].children[3].remove();if(this.hideOther&&this.stickyNav.querySelector(".navbar-nav").nextElementSibling!==null){this.stickyNav.querySelector(".navbar-nav").nextElementSibling.remove()}var oldValue=0;var newValue=0;window.addEventListener("scroll",function(){if(_this19.showOnUp){newValue=window.pageYOffset;if(oldValue>newValue)_this19.stickyNav.classList.add("active");if(oldValue350?_this19.stickyNav.classList.add("active"):_this19.stickyNav.classList.remove("active")}})}}}]);return StickyMenu}();new StickyMenu().init();var Timeline=function(){function Timeline(){_classCallCheck(this,Timeline);this.elementName="timeline-vertical"}_createClass(Timeline,[{key:"init",value:function init(){if(document.querySelector(".".concat(this.elementName))!==null){var timelineArray=Array.from(document.querySelector(".".concat(this.elementName)).children);var oddElement=timelineArray.filter(function(e,i){return i%2==1});oddElement.forEach(function(e){e.children[0].classList.add("float-end")})}}}]);return Timeline}();new Timeline().init();var ToTop=function(){function ToTop(){_classCallCheck(this,ToTop);this.elementName="to-top"}_createClass(ToTop,[{key:"init",value:function init(){if(document.querySelector(".".concat(this.elementName))!==null){var inTotop=document.querySelector(".".concat(this.elementName));window.addEventListener("scroll",function(){setTimeout(function(){window.scrollY>350?(inTotop.style.opacity=1,inTotop.classList.add("to-top-animation")):(inTotop.style.opacity-=.1,inTotop.classList.remove("to-top-animation"))},400)})}}}]);return ToTop}();new ToTop().init();