function chr4(){return Math.random().toString(16).slice(-4)}function getId(t){if(t===void 0){t=""}return t+"-"+chr4()+chr4()+"-"+chr4()+"-"+chr4()+chr4()+chr4()}function isEmpty(t){if(typeof t==="undefined"){return true}if(t==null){return true}if((t===null||t===void 0?void 0:t.length)===0){return true}if((t===null||t===void 0?void 0:t.length)>0){return false}for(var e in t){if(t.hasOwnProperty(e)){return false}}return JSON.stringify(t)===JSON.stringify({})}var bracketToDot=function(t){if(isEmpty(t)){return null}return"".concat(t).replace(/\[([^\]]+)\]/g,".$1")};function filterIcon(t){return(t||"").replace(/(\:).+?(\:)/g,(function(t){return'<i class="'.concat(t.replaceAll(":",""),'"></i>')}))}function filterBold(t){return(t||"").replace(/(\*).+?(\*)/g,(function(t){return"<strong>".concat(t.replaceAll("*",""),"</strong>")}))}function filterItalic(t){return(t||"").replace(/(\_).+?(\_)/g,(function(t){return"<em>".concat(t.replaceAll("_",""),"</em>")}))}function filterCode(t){return(t||"").replace(/(\`).+?(\`)/g,(function(t){return"<code>".concat(t.replaceAll("`",""),"</code>")}))}function tinyMDtoHTML(t){return filterIcon(filterBold(filterItalic(filterCode(t))))}function getLangFromDocument(){return document.querySelector("html").getAttribute("lang")||"es"}function getLangFromBrowser(){var t=navigator.language;return t.substring(0,1)}function getLang(){var t=getLangFromDocument()||getLangFromBrowser();return["en","es"].includes(t)?t:"es"}function alertCodeByStatus(t){switch(t){case 400:return"error";case 401:case 403:return"forbidden";case 402:return"payment";case 404:case 405:return"unknown";case 406:return"no-result";case 412:case 418:return"invalid";case 422:return"missing";case 500:return"exception";default:return"failure"}}function cls(){var t=[];for(var e=0;e<arguments.length;e++){t[e]=arguments[e]}return t.reduce((function(t,e){if(typeof e==="object"&&typeof e!=="string"){t=t.concat(Object.keys(e).filter((function(t){return e[t]})))}if(typeof e!=="object"&&typeof e==="string"){t.push(e)}return t}),[]).join(" ")}function getOverlayContainer(){if(!document.querySelector("body > x-overlay-container")){var t=document.createElement("x-overlay-container");document.querySelector("body").appendChild(t);return t}else{return document.querySelector("body > x-overlay-container")}}function getTooltipElement(){if(!getOverlayContainer().querySelector("x-tooltip-overlay")){var t=document.createElement("x-tooltip-overlay");var e=document.createElement("span");var n=document.createElement("div");t.setAttribute("role","tooltip");n.classList.add("tooltip-arrow");t.appendChild(e);t.appendChild(n);getOverlayContainer().appendChild(t);return t}else{return getOverlayContainer().querySelector("x-tooltip-overlay")}}function getNotificationContainerElement(t){if(t===void 0){t="top"}if(!getOverlayContainer().querySelector("x-notification-".concat(t))){var e=document.createElement("x-notification-".concat(t));getOverlayContainer().appendChild(e);return e}else{return getOverlayContainer().querySelector("x-notification-".concat(t))}}export{getLang as a,alertCodeByStatus as b,cls as c,getId as d,getOverlayContainer as e,getTooltipElement as f,getNotificationContainerElement as g,bracketToDot as h,isEmpty as i,tinyMDtoHTML as t};