\n"):e,setAttributes(e,t){for(var n in t)e.setAttribute(n,t[n])},inputToggle(e){if(e.target.classList.contains("input-toggle")){let t=e.target.parentElement.lastElementChild;!0===e.target.checked?(t.style.height=t.scrollHeight+"px",t.classList.remove("hidden")):(t.firstChild.value="",t.style.height=null,t.classList.add("hidden"))}},addInput(e){let t=e.parent,n=e.elm;var l=e.placeholder,r=e.type;e=(e=e.max||6)||6;let a=document.createElement("div");a.setAttribute("class","new-input");let i=document.createElement("input");i.setAttribute("type",r),i.setAttribute("placeholder",l);let u=document.createElement("button");u.setAttribute("class","remove"),u.setAttribute("type","button"),a.appendChild(i),a.appendChild(u),n.appendChild(a),n.childNodes.length>=e&&(n.nextElementSibling.disabled=!0,n.nextElementSibling.style.cssText="opacity:.3;cursor:not-allowed"),t.style.height=t.scrollHeight+"px"},removeInput(e){let t=e.elm,n=e.target;var l=e.max||6;if("remove"===n.className){--l;let r=n.parentElement.parentNode;e=n.parentElement.getBoundingClientRect().height,n.parentElement.remove(),t.style.height=t.getBoundingClientRect().height-e+"px",r.childNodes.length<=l&&(r.nextElementSibling.disabled=!1,r.nextElementSibling.style.cssText="opacity:1;cursor:pointer;")}}};function n(n,l){var r=e.createElement("input");t.setAttributes(r,{type:"url",name:"url"+l,placeholder:"URL (pakai https://)",class:"url"+l});var a=e.createElement("input");t.setAttributes(a,{type:"text",name:l+"name",placeholder:"nama "+l,class:l+"name"});let i=e.createElement("button");i.setAttribute("class","remove"+l),i.setAttribute("type","button"),n.appendChild(r),n.appendChild(a),n.appendChild(i)}function l(t,n){let l=e.createElement("label"),r=e.createElement("input"),a=e.createElement("span");return n=e.createTextNode(n),r.setAttribute("type","checkbox"),r.setAttribute("class",t),a.appendChild(n),l.appendChild(r),l.appendChild(a),l}function r(){let t=e.createElement("div");t.classList.add("link-attr");var n=l("rel small-checkbox","NoFollow"),r=l("target small-checkbox","Open in New Tab");return t.appendChild(n),t.appendChild(r),t}e.getElementById("addfield").addEventListener("click",function(){let l=e.getElementById("menu-input-field"),a=e.createElement("div"),i=e.createElement("div");var u=r();a.setAttribute("class","parrent-menu-outer"),i.setAttribute("class","parrent-menu"),n(i,"menu");var s=e.createElement("input");t.setAttributes(s,{class:"addsubmenu",type:"button",name:"submenu",value:"+ tambah submenu"}),a.appendChild(i),l.appendChild(a),a.appendChild(u),a.appendChild(s)}),e.getElementById("menu-input-field").addEventListener("click",function(t){let l=e.createElement("div");var a=r();if(l.setAttribute("class","submenu-menu"),n(l,"submenu"),"addsubmenu"==(t=t.target).className){let e=t.parentElement;e.insertBefore(l,t),e.insertBefore(a,t)}}),e.getElementById("menu-input-field").addEventListener("click",function(e){let t=e.target;"removemenu"==t.className?t.parentElement.parentElement.remove():"removesubmenu"==t.className&&(t.parentElement.nextElementSibling.remove(),t.parentElement.remove())}),e.getElementById("submit").addEventListener("click",function(){let t=e.getElementById("menu-input-field").querySelectorAll(".parrent-menu-outer"),n="";for(let e=0;e':"",r=""!=r.value?r.value:"#",a=""!=a.value?a.value:"Menu",r.replace(/\s/g,"%20"),a=a.replace(/(<([^>]+)>)/gi,""),t+'"+a+""}(l=t[e].querySelector(".parrent-menu"),r=t[e].querySelectorAll(".submenu-menu")),r=function(e){if(0]+)>)/gi,""),t=t.checked?' rel="nofollow"':"",n=n.checked?' target="_blank"':"",l+='\n\t"+i+""}return l+"\n\t\n"}return""}(r);n+=l+r+"\n"}e.getElementById("htmloutput").value=n})}(document),function(e){var t="darkmode"===localStorage.getItem("stylemode");let n=e.getElementById("darkmode-button").querySelector(".darkmode");n.checked=t,n.addEventListener("change",function(){"darkmode"===localStorage.getItem("stylemode")?(localStorage.setItem("stylemode","lightmode"),e.querySelector("body").classList.remove("dark")):(localStorage.setItem("stylemode","darkmode"),e.querySelector("body").classList.add("dark"))})}(document);