!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.mailgo=t():e.mailgo=t()}(window,(function(){return function(e){var t={};function o(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=e,o.c=t,o.d=function(e,t,a){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(o.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(a,n,function(t){return e[t]}.bind(null,n));return a},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=1)}([function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,n,i,d,l,r,c,s,m,p,u,b,f,h,g,x,v,w,y,C="mailto:",k="tel:",L="callto:",z="javascript:void(0);",j="span",A="",E="",N="",S="",R="",_="",M="",U="",I="",T=function(){var e=Y();e.style.display="none",e.id="mailgo",e.classList.add("m-modal");var t=Y();t.className="m-modal-back",e.appendChild(t);var o=Y();o.className="m-modal-content",e.appendChild(o),(a=Y("strong")).id="m-title",a.className="m-title",o.appendChild(a);var C=Y();C.id="m-details",C.className="m-details",(i=Y("p")).id="m-cc";var k=Y(j);k.className="w-500",k.appendChild(ee("cc ")),(c=Y(j)).id="m-cc-value",i.appendChild(k),i.appendChild(c),C.appendChild(i),(d=Y("p")).id="m-bcc";var L=Y(j);L.className="w-500",L.appendChild(ee("bcc ")),(s=Y(j)).id="m-bcc-value",d.appendChild(L),d.appendChild(s),C.appendChild(d),(l=Y("p")).id="m-subject";var A=Y(j);A.className="w-500",A.appendChild(ee("subject ")),(m=Y(j)).id="m-subject-value",l.appendChild(A),l.appendChild(m),C.appendChild(l),(r=Y("p")).id="m-body";var E=Y(j);E.className="w-500",E.appendChild(ee("body ")),(p=Y(j)).id="m-body-value",r.appendChild(E),r.appendChild(p),C.appendChild(r),o.appendChild(C),(u=Y("a")).id="m-gmail",u.href=z,u.classList.add("m-open"),u.classList.add("m-gmail"),u.appendChild(ee("open in "));var N=Y(j);N.className="w-500",N.appendChild(ee("Gmail")),u.appendChild(N),o.appendChild(u),(b=Y("a")).id="m-outlook",b.href=z,b.classList.add("m-open"),b.classList.add("m-outlook"),b.appendChild(ee("open in "));var S=Y(j);S.className="w-500",S.appendChild(ee("Outlook")),b.appendChild(S),o.appendChild(b),(f=Y("a")).id="m-open",f.href=z,f.classList.add("m-open"),f.classList.add("m-default");var R=Y(j);R.className="w-500",R.appendChild(ee("open")),f.appendChild(R),f.appendChild(ee(" default")),o.appendChild(f),(w=Y("a")).id="m-copy",w.href=z,w.classList.add("m-copy"),w.classList.add("w-500"),w.appendChild(ee("copy")),o.appendChild(w),o.appendChild(X()),document.body.appendChild(e),t.addEventListener("click",Q);var _=Y();_.style.display="none",_.id="mailgo-tel",_.classList.add("m-modal");var M=Y();M.className="m-modal-back",_.appendChild(M);var U=Y();U.className="m-modal-content",_.appendChild(U),(n=Y("strong")).id="m-tel-title",n.className="m-title",U.appendChild(n),(h=Y("a")).id="m-tg",h.href=z,h.classList.add("m-open"),h.classList.add("m-tg"),h.style.display="none",h.appendChild(ee("open in "));var I=Y(j);I.className="w-500",I.appendChild(ee("Telegram")),h.appendChild(I),U.appendChild(h),(g=Y("a")).id="m-wa",g.href=z,g.classList.add("m-open"),g.classList.add("m-wa"),g.appendChild(ee("open in "));var T=Y(j);T.className="w-500",T.appendChild(ee("WhatsApp")),g.appendChild(T),U.appendChild(g),(x=Y("a")).id="m-skype",x.href=z,x.classList.add("m-open"),x.classList.add("m-skype"),x.appendChild(ee("open in "));var O=Y(j);O.className="w-500",O.appendChild(ee("Skype")),x.appendChild(O),U.appendChild(x),(v=Y("a")).id="m-call",v.href=z,v.classList.add("m-open"),v.classList.add("m-default");var P=Y(j);P.className="w-500",P.appendChild(ee("call")),v.appendChild(P),v.appendChild(ee(" as default")),U.appendChild(v),(y=Y("a")).id="m-tel-copy",y.href=z,y.classList.add("m-copy"),y.classList.add("w-500"),y.appendChild(ee("copy")),U.appendChild(y),U.appendChild(X()),document.body.appendChild(_),M.addEventListener("click",Q)},O=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"mail",t=arguments.length>1?arguments[1]:void 0;if("mail"===e){if(t.href&&t.href.toLowerCase().startsWith(C)){A=decodeURIComponent(t.href.split("?")[0].split(C)[1].trim());var o=new URL(t.href).searchParams;N=o.get("cc"),S=o.get("bcc"),R=o.get("subject"),_=o.get("body")}else A=t.getAttribute("data-address")+"@"+t.getAttribute("data-domain"),new URL(C+encodeURIComponent(A)),N=t.getAttribute("data-cc-address")+"@"+t.getAttribute("data-cc-domain"),S=t.getAttribute("data-bcc-address")+"@"+t.getAttribute("data-bcc-domain"),R=t.getAttribute("data-subject"),_=t.getAttribute("data-body");if(!re(A.split(",")))return;N&&!re(N.split(","))&&(N=""),S&&!re(S.split(","))&&(S=""),a.innerHTML=A.split(",").join("
"),N?(i.style.display="block",c.innerHTML=N.split(",").join("
")):i.style.display="none",S?(d.style.display="block",s.innerHTML=S.split(",").join("
")):d.style.display="none",R?(l.style.display="block",m.textContent=R):l.style.display="none",_?(r.style.display="block",p.textContent=_):r.style.display="none",u.addEventListener("click",P),b.addEventListener("click",W),E=oe(A),f.addEventListener("click",H),w.addEventListener("click",(function(){return G(A)}))}"tel"===e&&(t.href&&t.href.toLowerCase().startsWith(k)?M=decodeURIComponent(t.href.split("?")[0].split(k)[1].trim()):t.href&&t.href.toLowerCase().startsWith(L)?M=decodeURIComponent(t.href.split("?")[0].split(L)[1].trim()):t.hasAttribute("data-tel")&&(M=t.getAttribute("data-tel"),t.getAttribute("data-msg")),t.hasAttribute("data-telegram")&&(U=t.getAttribute("data-telegram")),t.hasAttribute("data-skype")&&(I=t.getAttribute("data-skype")),n.innerHTML=M,g.addEventListener("click",Z),U&&(ie("m-tg","block"),h.addEventListener("click",D)),x.addEventListener("click",B),v.addEventListener("click",F),y.addEventListener("click",(function(){return G(M)}))),K(e),document.addEventListener("keydown",J)},P=function(){var e="https://mail.google.com/mail/u/0/?view=cm&source=mailto&to="+encodeURIComponent(A);N&&(e=e.concat("&cc="+encodeURIComponent(N))),S&&(e=e.concat("&bcc="+encodeURIComponent(S))),R&&(e=e.concat("&subject="+R)),_&&(e=e.concat("&body="+_)),window.open(e,"_blank"),Q()},W=function(){var e="https://outlook.live.com/owa/?path=/mail/action/compose&to="+encodeURIComponent(A);R&&(e=e.concat("&subject="+R)),_&&(e=e.concat("&body="+_)),window.open(e,"_blank"),Q()},H=function(){te(E),Q()},D=function(){var e="https://t.me/"+U;window.open(e,"_blank"),Q()},B=function(){var e="skype:"+(""!==I?I:M);window.open(e,"_blank"),Q()},Z=function(){var e="https://wa.me/"+M;window.open(e,"_blank"),Q()},F=function(){var e="tel:"+M;window.open(e),Q()},G=function(e){var t;ce(e),(t=V("mail")?w:y).textContent="copied",setTimeout((function(){t.textContent="copy",Q()}),999)},$=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"mail",o=e.href;return"mail"===t?o&&o.toLowerCase().startsWith(C)&&!e.classList.contains("no-mailgo")||e.hasAttribute("data-address")&&(o&&"#mailgo"===e.getAttribute("href").toLowerCase()||e.classList&&e.classList.contains("mailgo")):"tel"===t&&(o&&(o.toLowerCase().startsWith(k)||o.toLowerCase().startsWith(L))&&!e.classList.contains("no-mailgo")||e.hasAttribute("data-tel")&&o&&"#mailgo"===e.getAttribute("href").toLowerCase()||e.classList&&e.classList.contains("mailgo"))},q=function(e){if(document.contains(ae("mailgo"))&&document.contains(ae("mailgo-tel"))){if(V("mail")||V("tel"))return!1;var t=e.composedPath&&e.composedPath()||de(e.target);return t&&t.forEach((function(t){return!(t instanceof HTMLDocument||t instanceof Window)&&($(t,"mail")?(e.preventDefault(),O("mail",t),!0):$(t,"tel")?(e.preventDefault(),O("tel",t),!0):void 0)})),!1}},J=function(e){if(V("mail"))switch(e.keyCode){case 27:Q();break;case 71:P();break;case 79:W();break;case 32:case 13:H();break;case 67:G(A);break;default:return}else if(V("tel"))switch(e.keyCode){case 27:Q();break;case 84:D();break;case 87:Z();break;case 32:case 13:F();break;case 67:G(M);break;default:return}},K=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"mail";return"mail"===e?(ie("mailgo","flex"),!0):"tel"===e&&(ie("mailgo-tel","flex"),!0)},Q=function(){ie("mailgo","none"),ie("mailgo-tel","none"),document.removeEventListener("keydown",J)},V=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"mail";return"mail"===e?"flex"===ne("mailgo"):"tel"===e&&"flex"===ne("mailgo-tel")},X=function(){var e=Y("a");return e.href="https://mailgo.js.org?ref=mailgo-modal",e.className="m-by",e.target="_blank",e.rel="noopener noreferrer",e.appendChild(ee("mailgo.js.org")),e},Y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div";return document.createElement(e)},ee=function(e){return document.createTextNode(e)},te=function(e){return window.location.href=C+atob(e)},oe=function(e){return btoa(e)},ae=function(e){return document.getElementById(e)},ne=function(e){return ae(e).style.display},ie=function(e,t){return ae(e).style.display=t},de=function(e){for(var t=[];e;){if(t.push(e),"HTML"===e.tagName)return t.push(document),t.push(window),t;e=e.parentElement}},le=function(e){return/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)},re=function(e){return e.every(le)},ce=function(e){var t=Y("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="absolute",t.style.left="-9999px",document.body.appendChild(t);var o=document.getSelection().rangeCount>0&&document.getSelection().getRangeAt(0);return t.select(),document.execCommand("copy"),document.body.removeChild(t),!!o&&(document.getSelection().removeAllRanges(),document.getSelection().addRange(o),!0)},se=function(e){var t;window&&"undefined"!=typeof window&&((t=Y("style")).id="mailgo-style",t.type="text/css",t.appendChild(ee('.m-modal{position:fixed;top:0;right:0;bottom:0;left:0;-webkit-box-pack:center;-webkit-justify-content:center;-moz-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-moz-box-orient:vertical;-moz-box-direction:normal;-ms-flex-direction:column;flex-direction:column;overflow:hidden;font-size:15px;z-index:10000}.m-modal a,.m-modal p,.m-modal span,.m-modal strong{margin:0;padding:0;font-size:100%;line-height:1;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";text-rendering:optimizeLegibility}.m-modal strong{font-weight:700}.m-modal .m-modal-back{position:absolute;z-index:10001;top:0;right:0;bottom:0;left:0;background-color:rgba(32,35,42,.75);opacity:.8}.m-modal .m-modal-content{position:relative;z-index:10002;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;text-align:center;min-width:200px;max-width:240px;background-color:#fff;opacity:.97;-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;-webkit-box-shadow:0 3px 20px rgba(32,35,42,.5);-moz-box-shadow:0 3px 20px rgba(32,35,42,.5);box-shadow:0 3px 20px rgba(32,35,42,.5);color:#4a4a4a;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-moz-box-orient:vertical;-moz-box-direction:normal;-ms-flex-direction:column;flex-direction:column;overflow:auto;padding:20px;-webkit-transition:.5s -webkit-box-shadow;transition:.5s -webkit-box-shadow;-o-transition:.5s box-shadow;-moz-transition:.5s box-shadow,.5s -moz-box-shadow;transition:.5s box-shadow;transition:.5s box-shadow,.5s -webkit-box-shadow,.5s -moz-box-shadow}.m-modal .m-modal-content:hover{opacity:1;-webkit-box-shadow:0 7px 20px rgba(32,35,42,.85);-moz-box-shadow:0 7px 20px rgba(32,35,42,.85);box-shadow:0 7px 20px rgba(32,35,42,.85)}.m-modal .m-modal-content .m-title{margin-bottom:8px;overflow:hidden;white-space:nowrap;-o-text-overflow:ellipsis;text-overflow:ellipsis}.m-modal .m-modal-content .m-details{margin-bottom:10px}.m-modal .m-modal-content .m-details p{font-size:12px;margin-top:3px;margin-bottom:3px}.m-modal .m-modal-content a{padding:10px;color:#4a4a4a;-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;text-decoration:none}.m-modal .m-modal-content a.m-gmail{color:#d44638}.m-modal .m-modal-content a.m-gmail:hover{background-color:rgba(212,70,56,.08);color:#d44638}.m-modal .m-modal-content a.m-outlook{color:#0072c6}.m-modal .m-modal-content a.m-outlook:hover{background-color:rgba(0,114,198,.08);color:#0072c6}.m-modal .m-modal-content a.m-tg{color:#08c}.m-modal .m-modal-content a.m-tg:hover{background-color:rgba(0,114,198,.08);color:#08c}.m-modal .m-modal-content a.m-wa{color:#00bfa5}.m-modal .m-modal-content a.m-wa:hover{background-color:rgba(0,191,165,.08);color:#00bfa5}.m-modal .m-modal-content a.m-skype{color:#00aff0}.m-modal .m-modal-content a.m-skype:hover{background-color:rgba(0,175,240,.08);color:#00aff0}.m-modal .m-modal-content a.m-copy{padding:16px 10px;font-size:16px}.m-modal .m-modal-content a.m-copy:hover,.m-modal .m-modal-content a.m-default:hover{background-color:rgba(0,0,0,.08);color:#4a4a4a}.m-modal .m-modal-content a.m-by{font-size:8px;margin-top:.8rem;padding:5px;color:#4a4a4a;opacity:.5}.m-modal .m-modal-content a.m-by:hover{opacity:1}.m-modal .m-modal-content .w-500{font-weight:500}')),document.head.appendChild(t),(null==e?void 0:e.initEvent)?document.addEventListener(e.initEvent,T):T(),document.addEventListener("click",q))};t.default=se},function(e,t,o){"use strict";o.r(t);var a=o(0);o.n(a)()({initEvent:"DOMContentLoaded"})}])}));