/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/sloth-css@1.5.1/src/sloth-extension.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
/*!
Sloth CSS lightweight framework
v1.5.1
Last Updated: July 6, 2020 (UTC)
Author: Ka2 - https://ka2.org/
*/
const init=function(){if(!document.body.classList.contains("sloth"))return!1;if(/iP(hone|(o|a)d)/.test(navigator.userAgent)){let e=e=>{let t=parseInt(window.getComputedStyle(e).fontSize),a=parseInt(window.getComputedStyle(e).paddingTop),l=parseInt(window.getComputedStyle(e).paddingRight),o=parseInt(window.getComputedStyle(e).paddingBottom),r=parseInt(window.getComputedStyle(e).paddingLeft);t<16&&(e.style.fontSize="16px",e.style.paddingTop=a-(16-t)/2+"px",e.style.paddingRight=l-(16-t)/2+"px",e.style.paddingBottom=o-(16-t)/2+"px",e.style.paddingLeft=r-(16-t)/2+"px")};Array.prototype.forEach.call(document.querySelectorAll("input"),(t=>{let a=t.type;/(hidden|checkbox|radio|file|button|submit|cancel|reset)/i.test(a)||e(t)})),Array.prototype.forEach.call(document.querySelectorAll("select"),(t=>{e(t)})),Array.prototype.forEach.call(document.querySelectorAll("textarea"),(t=>{e(t)}))}Array.prototype.forEach.call(document.querySelectorAll("[data-standby]"),(e=>{let t;"shown"===e.dataset.standby&&(t=window.setTimeout((()=>{e.removeAttribute("data-standby"),window.clearTimeout(t)}),500))})),Array.prototype.forEach.call(document.querySelectorAll("[data-size]"),(e=>{let t=e.dataset.size.split(","),a=/^(a|abbr|b|bdi|bdo|big|button|cite|code|data|datalist|del|dfn|em|i|img|input|ins|kbd|label|mark|q|ruby|s|samp|select|small|span|strong|sub|sup|textarea|time|u|tt|var)$/i.test(e.nodeName);t.forEach((t=>{let l=t.split(":"),o=l[0]?l[0].trim():null,r=l[1]?l[1].trim().replace(";",""):null;if(o&&r){switch(!0){case/^w(|idth)$/i.test(o):o="width";break;case/^h(|eight)$/i.test(o):o="height";break;case/^m(|ax)-?w(|idth)$/i.test(o):o="max-width";break;case/^m(|ax)-?h(|eight)$/i.test(o):o="max-height";break;case/^min-?w(|idth)$/i.test(o):o="min-width";break;case/^min-?h(|eight)$/i.test(o):o="min-height"}switch(!0){case/^\d+.*$/i.test(r):break;case/^\(.*\)$/i.test(r):r=`calc${r}`}a&&!e.style.display&&(e.style.display="inline-block"),e.style[o]=r}})),t.length>0&&e.removeAttribute("data-size")})),Array.prototype.forEach.call(document.querySelectorAll('[data-map*="..."]'),(e=>{let t=e.dataset.map.split("...");for(let a=parseInt(t[0],10);a<=parseInt(t[1],10);a++){let t=document.createElement("option");t.setAttribute("value",a),t.textContent=a,e.parentNode.append(t)}t.length>0&&e.removeAttribute("data-map")})),Array.prototype.forEach.call(document.querySelectorAll('[data-map*=","]'),(e=>{let t=e.dataset.map.split(",");t.forEach(((t,a)=>{let l=t.split(":"),o=l[1]?l[1]:l[0]?l[0]:null,r=l[1]?l[0]:o?a+1:null;if(r&&o){let t=document.createElement("option");t.setAttribute("value",r),t.textContent=o,e.parentNode.append(t)}})),t.length>0&&e.removeAttribute("data-map")})),Array.prototype.forEach.call(document.getElementsByTagName("select"),(e=>{e.addEventListener("change",(e=>{""===e.target.value?e.target.classList.add("txt-fog"):e.target.classList.remove("txt-fog")}),!1)})),Array.prototype.forEach.call(document.querySelectorAll(".tgl-view span"),(e=>{e.addEventListener("click",(e=>{let t=e.target,a=t.classList,l=t.offsetParent.children[0];a.contains("active")?(t.classList.remove("active"),l.setAttribute("type","password")):(t.classList.add("active"),l.setAttribute("type","text"))}),!1)})),Array.prototype.forEach.call(document.getElementsByClassName("upload"),(e=>{let t=document.createElement("input"),a=document.createElement("div"),l=e.parentNode.querySelectorAll(".note"),o=e.parentNode,r=0;e.dataset.uploadable||(Array.prototype.forEach.call(l,(e=>{e.remove()})),t.setAttribute("type","text"),t.classList.add("upload-files"),t.setAttribute("placeholder","No chosen file"),t.setAttribute("data-switch-class","sm:hidden"),t.setAttribute("readonly",!0),t.style.width="auto",t.addEventListener("keyup",(()=>!1),!1),t.addEventListener("keydown",(()=>!1),!1),t.addEventListener("keypress",(()=>!1),!1),a.classList.add("preview-image"),a.addEventListener("click",(e=>{let a=e.target;if(a.classList.contains("active")){let e=a.cloneNode(!1);e.removeAttribute("class"),e.classList.add("expand-image"),showDialog(t.value,e,null,1,null,!1)}}),!1),e.style.marginBottom=0,e.parentNode.append(a),e.parentNode.append(t),Array.prototype.forEach.call(l,(t=>{e.parentNode.append(t)})),e.setAttribute("data-uploadable",!0),Array.prototype.forEach.call(o.children,(e=>{e.classList.contains("upload-files")||e.classList.contains("note")||(r+=e.clientWidth+(e.style.marginLeft||0)+(e.style.marginRight||0))})),t.style.width=`calc(100% - (${r}px + 5em))`,t.style.marginRight=0,e.querySelector("[type=file]").addEventListener("change",(e=>{let l=e.target,o=l.value.replace(/\\/g,"/"),r=o.lastIndexOf("/"),i=l.files[0],n=new FileReader;t.value=-1!==r?o.substring(r+1):o,n.onload=function(){a.style.backgroundImage=`url(${n.result})`,a.classList.add("active")},i?n.readAsDataURL(i):(a.style.backgroundImage="none",a.classList.remove("active"))}),!1))})),Array.prototype.forEach.call(document.getElementsByTagName("form"),(e=>{e.classList.contains("sloth-validation")&&(e.hasAttribute("novalidate")||e.setAttribute("novalidate",!0),e.addEventListener("submit",(e=>{let t=e.target,a=t.querySelectorAll("[type=submit]"),l=t.dataset.callback||void 0;if(e.preventDefault(),!slothValidator(t))return!1;{Array.prototype.forEach.call(a,(e=>{e.setAttribute("disabled",!0)}));let e=!0;if(l&&(/\(.*\)$/g.test(l)||l.endsWith(")")||(l+="()"),e=Function.call(this,`return ${l}`)(),null==e&&(e=!0)),l&&!e)return!1;t.method=t.getAttribute("method")||"post",t.submit()}}),!1),Array.prototype.forEach.call(e.querySelectorAll("[name]"),(t=>{t.addEventListener("blur",(t=>{let a=t.target,l=new FormData(e);singleFieldValidator(a,l)}),!1)})))})),Array.prototype.forEach.call(document.querySelectorAll("[data-toggle=dialog]"),(e=>{e.addEventListener("click",(e=>{let t=e.target,a=t.dataset.title||null,l=t.dataset.content||null,o=t.dataset.foot||null,r=t.dataset.effect||document.body.dataset.dialogEffect||1,i=t.dataset.dialogSize||null,n=t.dataset.reinit||!0;showDialog(a,l,o,r,i,n)}),!1)})),Array.prototype.forEach.call(document.querySelectorAll(".navi-menu .toggle input[type=checkbox]"),(e=>{e.addEventListener("change",(e=>{fixedBackdrop(e.target.checked)}),!1)})),Array.prototype.forEach.call(document.querySelectorAll(".navi-menu .toggle .menu"),(e=>{e.addEventListener("click",(e=>{e.preventDefault()}),!1)})),Array.prototype.forEach.call(document.querySelectorAll(".sticky-footer.pullup"),(e=>{if(0==e.querySelectorAll(".toggle-switch").length){let t=document.createElement("div");t.classList.add("toggle-switch"),t.innerHTML="<span></span>",t.setAttribute("data-toggle-open",e.classList.contains("default-show")),e.prepend(t)}e.addEventListener("click",(t=>{Array.prototype.forEach.call(e.querySelectorAll(".toggle-switch"),(e=>{Object.prototype.hasOwnProperty.call(e.dataset,"toggleOpen")||e.setAttribute("data-toggle-open",!1);let a=!!/^true$/i.test(e.dataset.toggleOpen),l=new MutationObserver((e=>{e.forEach((e=>{"data-toggle-open"===e.attributeName&&window.slothStackTimer.push(setTimeout((()=>{pullupContent(),l.disconnect()}),200))}))}));l.observe(e,{attributes:!0,attributeOldValue:!0}),a&&t.target.closest(".pullup-content")||e.setAttribute("data-toggle-open",!a);let o,r=window.slothStackTimer.length-1;for(o=0;o<r;o++)clearTimeout(window.slothStackTimer.shift())}))}),!1)})),Array.prototype.forEach.call(document.querySelectorAll("[data-toc]"),(e=>{let t=e.dataset.toc,a=e.dataset.tocCascade||!1,l=document.querySelectorAll(t);if(l.length>0){let t=l[0].querySelectorAll("h1, h2, h3, h4, h5, h6"),o=document.createElement("ul"),r=[],i=6;Array.prototype.forEach.call(t,(e=>{let t=e.id,a=parseInt(e.tagName.replace("H",""),10),l=document.createElement("li"),o=document.createElement("a");""===t&&(t=makeId(e.textContent),e.id=t,e.insertAdjacentHTML("afterbegin",`<a name="${t}"></a>`)),i=a<i?a:i,o.innerHTML=e.textContent,o.href=`#${t}`,l.appendChild(o),l.setAttribute("data-indent",a),r.push(l)})),r.forEach((e=>{let t=parseInt(e.dataset.indent,10)-i;a&&t>0&&e.classList.add(`idt-${t}`),e.removeAttribute("data-indent"),o.appendChild(e)})),o.classList.add("toc"),e.appendChild(o),Array.prototype.forEach.call(e.querySelectorAll('a[href*="#"]'),(e=>{e.addEventListener("click",(e=>{let t=e.target.getAttribute("href").split("#")[1],a=document.getElementById(t);if(!a)return!1;smoothScroll(a)}),!1)}))}})),Array.prototype.forEach.call(document.querySelectorAll("[data-follow-color]"),(e=>{let t=e.querySelector("input"),a=e=>{let t=e.dataset.followColor,a=e.classList,l=!(!e.querySelector("input")||!e.querySelector("input").checked),o=!1;"inherit"===t?(a.forEach((t=>{if(!o)switch(!0){case/^clr-.*$/i.test(t):l?e.classList.add(t.replace("clr","txt")):e.classList.remove(t.replace("clr","txt")),o=!0;break;case/^muted/i.test(t):o=!0;case/^txt-.*$/i.test(t):}})),o||(l&&!e.classList.contains("txt-prim")?e.classList.add("txt-prim"):e.classList.remove("txt-prim"))):""!==t&&(l&&e.style.color!==t?e.style.color=t:e.style.color="unset")};null!=t&&(t.addEventListener("change",(e=>{"radio"===e.target.type&&null!=e.target.name&&""!=e.target.name?Array.prototype.forEach.call(document.querySelectorAll(`input[name=${e.target.name}]`),(e=>{a(e.closest("label"))})):a(e.target.closest("label"))}),!1),a(e))})),window.showDialog=showDialog,window.strLength=strLength,window.toggleFooter=toggleFooter,window.initializeStickyFooter=initializeStickyFooter,window.addEventListener("resize",resize_throttle,{passive:!0},!1),window.addEventListener("scroll",scroll_throttle,{passive:!0},!1),optimizeDropdown(),adjustNotes(),adjustColumnsInRow(),switchElementClass(),adjustTogglePasswd(),initializeLazyLoading(),initializeStickyFooter()},optimizeDropdown=()=>{Array.prototype.forEach.call(document.getElementsByTagName("select"),(e=>{if(e.parentNode.classList.contains("dropdown")){let t,a=[];e.childNodes.forEach((e=>{"OPTION"===e.nodeName&&e.textContent&&a.push(strLength(e.textContent))})),t=Math.max.apply(null,a),e.style.width=`${t+3*parseInt(window.getComputedStyle(e).fontSize)}px`}}))},adjustNotes=()=>{Array.prototype.forEach.call(document.querySelectorAll("form .note"),(e=>{let t=e.parentNode.firstElementChild,a=parseInt(window.getComputedStyle(e).paddingLeft)/1.4;"LABEL"===t.nodeName&&(a+=t.clientWidth||0),e.style.width=a?`calc(100% - ${a}px)`:"100%",e.style.marginLeft=a?`${a}px`:0,e.style.marginTop="0.3rem"}))},adjustTogglePasswd=()=>{Array.prototype.forEach.call(document.querySelectorAll(".tgl-view"),(e=>{let t=e.parentNode.clientWidth,a=e.lastElementChild,l=t-(a.clientWidth+(a.style.marginLeft||0)+(a.style.marginRight||0))-2*parseInt(window.getComputedStyle(document.body).fontSize);e.parentNode.classList.contains("inline")&&"LABEL"===e.previousElementSibling.nodeName&&(l-=e.previousElementSibling.clientWidth),e.firstElementChild.style.maxWidth=`${l}px`}))},fixedBackdrop=e=>{let t=/iP(hone|(o|a)d)/.test(navigator.userAgent);Array.prototype.forEach.call(document.querySelectorAll("[data-onmenu-fixed]"),(a=>{let l=window.pageYOffset,o=window.pageXOffset,r=a.getBoundingClientRect(),i=r.left+o,n=r.top+l;/^(true|1)$/i.test(a.dataset.onmenuFixed)&&!t&&(e?(a.classList.add("fixed-backdrop"),a.style.top=-1*l+"px",a.style.left=-1*o+"px"):(a.classList.remove("fixed-backdrop"),a.removeAttribute("style"),window.scrollTo(-1*i,-1*n)))}))},adjustColumnsInRow=()=>{Array.prototype.forEach.call(document.querySelectorAll("form .flx-row, form .inline"),(e=>{let t=Array.prototype.slice.call(e.children);if(t.forEach(((e,a)=>{e.classList.contains("note")?t.splice(a,1):(e.style.marginRight=0,e.style.marginLeft=0)})),2==t.length){let a=t[0].clientWidth||null,l=parseInt(window.getComputedStyle(document.body).fontSize),o=t[1];/^label$/i.test(t[0].nodeName)&&(t[0].style.marginRight=`${l}px`,a+=l),/^(div|textarea)$/i.test(o.nodeName)&&a&&(o.style.width=e.clientWidth-a+"px")}else t.forEach(((e,a)=>{/^(input|select|textarea|label)$/i.test(e.nodeName)&&!e.classList.contains("dropdown")&&a+1!=t.length&&(e.style.marginRight="1rem")}))}))},switchElementClass=()=>{Array.prototype.forEach.call(document.querySelectorAll("[data-switch-class]"),(e=>{let t=e.dataset.switchClass.split(","),a=window.innerWidth,l=[[],[],[]],o=[],r=0;t.length>0&&(t.forEach((e=>{let t=e.split(":"),i=t[1]?t[1].split(" "):void 0,n=i&&/^(sm|md|lg)$/i.test(t[0])?t[0].toLowerCase():void 0;n&&i&&(a<481?(r=0,"sm"===n&&(l[0]=[...i])):a>768?(r=1,"lg"===n&&(l[1]=[...i])):(r=2,"md"===n&&(l[2]=[...i])),o=[...o,...i])})),e.classList.remove(...o),l[r].length>0&&e.classList.add(...l[r]))}))},resizeHandler=()=>{optimizeDropdown(),adjustNotes(),adjustColumnsInRow(),switchElementClass(),adjustTogglePasswd(),lazyLoading()};window.resize_ticking=!1;const resize_throttle=()=>{window.resize_ticking||(requestAnimationFrame((()=>{window.resize_ticking=!1,resizeHandler()})),window.resize_ticking=!0)},scrollHandler=()=>{lazyLoading()};window.scroll_ticking=!1;const scroll_throttle=()=>{window.scroll_ticking||(requestAnimationFrame((()=>{window.scroll_ticking=!1,scrollHandler()})),window.scroll_ticking=!0)},parseObject=function(e){let t,a={};try{a=JSON.parse(e)}catch(l){t=e.trim().replace(/^(\{|\[)+|(\]|\})+$/g,"").split(","),t=t.map((e=>{let t=e.match(/^[^:]*:/);return t?[t[0].replace(":",""),e.replace(t[0],"")]:[e]})).map((e=>e||e.trim())),t=t.reduce(((e,t,a)=>{if(t[0]&&t[1]){let a=t[0].trim().replace(/^('|")+|("|')+$/g,""),l=t[1].trim().replace(/^('|")+|("|')+$/g,"");/^callback$/i.test(a)?e[a]=Function.call(this,`return ${l}`)():e[a]=l}else if(1==t.length&&t[0]){let l=t[0].trim().replace(/^('|")+|("|')+$/g,"");e[a]=l}else e=null;return e}),{}),a=t?Object.assign(a,t):a}return a},generateDialog=function(e,t,a,l,o){return new Promise((r=>{let i=document.getElementsByClassName("sloth-notify"),n=document.getElementsByClassName("dialog-backdrop");i.length>0&&Array.prototype.forEach.call(i,(e=>{e.remove()})),n.length>0&&Array.prototype.forEach.call(n,(e=>{e.remove()}));let s=document.createElement("div"),d=document.createElement("div"),c=document.createElement("div"),p=window.innerWidth,u=new MutationObserver(((l,o)=>{l.forEach((l=>{if("childList"===l.type)Array.prototype.forEach.call(l.addedNodes,(l=>{l.classList.contains("dialog-content")&&((()=>{if(e=e?e.toString():null){let t=document.createElement("h3");t.classList.add("dialog-header"),t.innerHTML=e,d.append(t)}})(),(()=>{if(t=t?"string"==typeof t&&/^\{+.*\}$/.test(t)?parseObject(t):t:null){let e=document.createElement("div");e.classList.add("dialog-body"),"string"==typeof t?e.innerHTML=t.replace(/\\(.)/gm,"$1"):"object"==typeof t?t instanceof HTMLElement?e.append(t):0!=Object.keys(t).length&&(t.remote&&t.url?(t.loader?e.innerHTML=t.loader.replace(/\\(.)/gm,"$1"):e.innerHTML='<div class="txt-center txt-fog">Now Loading...</div>',fetch(t.url,{method:t.remote,mode:t.mode||"cors",headers:{"X-Requested-With":"XMLHttpRequest"}}).then((e=>e.json())).then((t=>{e.innerHTML=t.content})).catch((e=>{console.error("Error:",e)}))):t[0]?e.innerHTML=t[0]:e.innerHTML=Object.values(t).join("")):e.textContent=t,d.append(e)}})(),(()=>{a=!a||("string"==typeof a&&/^\{+.*\}$/.test(a)?parseObject(a):a);let e=document.createElement("div"),t=document.createElement("button"),l=function(){return!0},o=document.body.dataset.dialogButton||void 0,r=!1,i=!1;if(a){if(e.classList.add("dialog-footer"),t.setAttribute("type","button"),o&&t.classList.add(...o.split(" ")),"string"==typeof a)switch(!0){case/^none$/i.test(a):r=!0;break;case/^dismiss-outside$/i.test(a):i=!0,t.classList.add(a),t.innerHTML='<span title="Close"></span>';break;default:t.innerHTML=a.replace(/\\(.)/gm,"$1")}else if("object"==typeof a){if(a instanceof HTMLElement)t=a;else if(0!=Object.keys(a).length&&(Object.prototype.hasOwnProperty.call(a,"class")&&(t.removeAttribute("class"),t.classList.add(...a.class.split(" "))),Object.prototype.hasOwnProperty.call(a,"label")&&(t.innerHTML=a.label.replace(/\\(.)/gm,"$1")),Object.prototype.hasOwnProperty.call(a,"callback")&&(l=a.callback),Object.prototype.hasOwnProperty.call(a,"0")))switch(!0){case/^none$/i.test(a[0]):r=!0;break;case/^dismiss-outside$/i.test(a[0]):i=!0,t.classList.add(a[0]),t.innerHTML='<span title="Close"></span>';break;default:t.innerHTML=a[0].replace(/\\(.)/gm,"$1")}}else t.textContent="Close";r||(t.addEventListener("click",(()=>{l(),s.classList.remove("show"),fixedBackdrop(!1)}),!1),i?d.append(t):(e.append(t),d.append(e)))}})(),r(s))}))})),o.disconnect()}));switch(!0){case/^(2|slide-?in-right)$/i.test(l):l="effect-2";break;case/^(3|slide-?in-bottom)$/i.test(l):l="effect-3";break;case/^(4|sticky-?up)$/i.test(l):l="effect-4";break;case/^(5|full-?wide)$/i.test(l):l="effect-5";break;default:l="effect-1"}switch(!0){case/^(xl|xlarge)$/i.test(o):o="size-xl";break;case/^(lg|large)$/i.test(o):o="size-lg";break;case/^(md|medium)$/i.test(o):o="size-md";break;case/^(sm|small)$/i.test(o):o="size-sm";break;case/^auto$/i.test(o):default:o=p<481?"size-xl":p>768?"":"size-lg"}u.observe(s,{childList:!0,subtree:!0}),s.classList.add("sloth-notify",l),""!==o&&s.classList.add(o),d.classList.add("dialog-content"),c.classList.add("dialog-backdrop"),s.append(d),document.body.append(s),document.body.append(c),c.addEventListener("click",(()=>{if(!s.classList.contains("show"))return!1;s.classList.remove("show"),fixedBackdrop(!1)}),!1)}))},slothNotify=async(e,t,a,l,o)=>await generateDialog(e,t,a,l,o);window.slothStackTimer=[];const showDialog=(e,t,a,l,o,r)=>{slothNotify(e,t,a,l,o).then((e=>setTimeout((()=>{null!=r&&!0!==r||(document.removeEventListener("DOMContentLoaded",init,!1),init()),e.classList.add("show"),fixedBackdrop(!0)}),300))).then((e=>{window.slothStackTimer.push(e);let t,a=window.slothStackTimer.length-1;for(t=0;t<a;t++)clearTimeout(window.slothStackTimer.shift())}))},strLength=(e,t=!0,a="1rem")=>{let l,o={width:0,height:0};return document.getElementById("sloth-ruler")?l=document.getElementById("sloth-ruler"):(l=document.createElement("span"),l.setAttribute("id","sloth-ruler"),document.body.append(l)),l.style.fontSize=a,l.textContent=e.toString(),o.width=l.clientWidth,o.height=l.clientHeight,l.parentElement.removeChild(l),t?o.width:o},slothValidator=e=>{let t=!1,a=e.dataset.invalidTitle||"Incomplete Submissions!",l={},o=e.dataset.dialogFooter||!0,r=e.dataset.dialogEffect||1,i=new FormData(e);if(Array.prototype.forEach.call(e.querySelectorAll("[name]"),(e=>{l=Object.assign(l,singleFieldValidator(e,i))})),Object.keys(l).length>0){let e=document.createElement("ul");Object.keys(l).forEach((t=>{let a=document.createElement("li");a.innerHTML=`<label>${t}:</label><span>${l[t]}</span>`,e.append(a)})),e.classList.add("error-messages"),showDialog(a,e,o,r)}else t=!0;return t},singleFieldValidator=(e,t)=>{let a=e.hasAttribute("required"),l=e.getAttribute("name"),o=e.hasAttribute("pattern")?e.getAttribute("pattern"):void 0,r=t.get(l)||"",i=e.dataset.dispname||l,n=!1,s={};switch(e.nodeName.toLowerCase()){case"input":if(e.hasAttribute("type"))switch(e.getAttribute("type")){case"file":a?""!==r.name&&r.size>0?n=!0:s[i]="Not chosen":n=null;break;case"radio":case"checkbox":a?""!==r?n=!0:s[i]="Not chosen":n=null;break;case"hidden":n=null;break;default:e.classList.remove("value-ok","value-ng"),a?""!==r?o?new RegExp(o).test(r)?n=!0:s[i]="Invalid value":n=!0:s[i]="Not exists value":o&&""!==r?new RegExp(o).test(r)?n=!0:s[i]="Invalid value":n=null,null!=n&&(e.classList.add(n?"value-ok":"value-ng"),"password"===e.getAttribute("type")&&e.parentNode.classList.contains("tgl-view")&&(e.parentNode.style.borderColor=n?"#00a968":"#e8383d"))}break;case"select":e.classList.remove("value-ok","value-ng"),a?""!==r?n=!0:s[i]="Not chosen":n=null,null!=n&&e.classList.add(n?"value-ok":"value-ng");break;case"textarea":e.classList.remove("value-ok","value-ng"),a?""!==r?o?new RegExp(o).test(r.replace(/\r?\n/g,""))?n=!0:s[i]="Invalid value":n=!0:s[i]="Not exists value":o&&""!==r?new RegExp(o).test(r.replace(/\r?\n/g,""))?n=!0:s[i]="Invalid value":n=null,null!=n&&e.classList.add(n?"value-ok":"value-ng")}return s},initializeLazyLoading=()=>{let e,t=0,a=0;Array.prototype.forEach.call(document.querySelectorAll("[data-src]"),(l=>{if(/^(img)$/i.test(l.nodeName)&&"null"!==l.dataset.src&&!l.getAttribute("src")&&(!/^span$/i.test(l.parentNode.nodeName)||!l.parentNode.classList.contains("img-wrap"))){let o=`llimg-${((e,t)=>{let a,l,o=t||0,r=e.length;if(0===e.length)return o;for(a=0;a<r;a++)l=e.charCodeAt(a),o=(o<<5)-o+l,o|=0;return o.toString(16).replace(/^-/,"")})(l.outerHTML,t)}`;l.outerHTML=`<span id="${o}" class="img-wrap">${l.outerHTML}</span>`;let r=document.getElementById(o).closest(".lazy-load, .dialog-body");r&&(a++,e=r.classList.contains("dialog-body")?".dialog-body":".lazy-load"),t++}})),t>0&&(0==a?lazyLoading():(Array.prototype.forEach.call(document.querySelectorAll(e),(t=>{t.addEventListener("resize",(()=>{lazyLoading(e)}),!1),t.addEventListener("scroll",(()=>{lazyLoading(e)}),!1)})),lazyLoading(e)))},loadImage=e=>new Promise(((t,a)=>{let l=new Image;l.onload=()=>t(l),l.onerror=e=>a(e),l.src=e})),lazyLoading=e=>{let t=e?`${e} [data-src]`:"[data-src]";Array.prototype.forEach.call(document.querySelectorAll(t),(async t=>{if(/^(img)$/i.test(t.nodeName)&&"null"!==t.dataset.src&&!t.getAttribute("src")){let a=t.dataset.src||"",l=t.parentNode.dataset.loaded||!1,o=t.getBoundingClientRect(),r=window.innerHeight,i=window.innerWidth,n=Math.ceil(o.top),s=Math.floor(o.bottom),d=Math.ceil(o.left),c=Math.floor(o.right),p=t.dataset.buffer?parseInt(t.dataset.buffer,10):0;if(e){let a=t.closest(e);r=a.clientHeight,i=a.clientWidth}""===a||l||(n+p>=0||s-p>=0)&&(n+p<=r||s-p<=r)&&(d+p>=0||c-p>=0)&&(d+p<=i||c-p<=i)&&await loadImage(a).then((e=>{t.setAttribute("src",e.src),t.removeAttribute("data-src"),t.removeAttribute("data-buffer"),t.removeAttribute("data-loadersize"),t.parentNode.setAttribute("data-loaded",!0)})).catch((e=>{console.error("Error:",e)}))}}))},pullupContent=()=>{Array.prototype.forEach.call(document.querySelectorAll(".sticky-footer.pullup"),(e=>{let t=e.getBoundingClientRect();e.previousElementSibling.style.paddingBottom=`${t.height}px`,e.style.position="sticky"}))},toggleFooter=()=>{Array.prototype.forEach.call(document.querySelectorAll(".toggle-switch"),(e=>{let t=document.createEvent("HTMLEvents");return t.initEvent("click",!0,!0),e.dispatchEvent(t)}))},initializeStickyFooter=()=>{Array.prototype.forEach.call(document.querySelectorAll(".sticky-footer"),(e=>{let t=e.parentNode.classList;t.contains("of-s")||t.contains("of-a")||t.contains("of-ys")||t.contains("of-ya")||(e.parentNode.style.overflowY="auto",e.parentNode.style.height="100vh")}))},makeId=e=>{let t=e.split("").reduce(((e,t)=>(e<<5)-e+t.charCodeAt(0)|0),0);return`note-${Math.abs(t)}`},smoothScroll=e=>{let t,a=window.pageYOffset,l=0;Array.prototype.forEach.call(document.querySelectorAll(".navi-menu"),(e=>{l+=e.getBoundingClientRect().height}));const o=e.getBoundingClientRect().top+a-l,r=()=>{t=a+Math.round((o-a)/8),window.scrollTo(0,t),a=t,document.body.clientHeight-window.innerHeight<t?window.scrollTo(0,document.body.clientHeight):t>=o+5||t<=o-5?window.setTimeout(r,10):window.scrollTo(0,o)};r()};"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?init():document.addEventListener?document.addEventListener("DOMContentLoaded",init,!1):window.onload=init;
//# sourceMappingURL=/sm/31af30ac2a1f1c867884a937f5f21c364489d42284b16c5b94e07ed58db7356d.map