var EasyDialogBox=function(){"use strict";var e="dlg|dlg-close|dlg-prompt|dlg-yes|dlg-no|dlg-yes-no|dlg-ok|dlg-cancel|dlg-ok-cancel|dlg-toast|dlg-disable-heading|dlg-disable-footer|dlg-disable-btns|dlg-disable-overlay|dlg-disable-drag|dlg-disable-esc|dlg-disable-clickout|dlg-nomodal|dlg-multi|dlg-fade|dlg-resize|dlg-info|dlg-question|dlg-error|dlg-success|dlg-exclamation|dlg-rounded|dlg-shadow|dlg-disable-mobile".split("|"),t=[],n=0,i=!1,l=function(){return document.querySelector("body")},o=function(){return document.querySelector("html")},d=function(e){var t=parseInt(e,10);return isFinite(t)||(t=0),t},s=function(e){return e.replace(/^\s+|\s+$/g,"")};Array.prototype.indexOf||(Array.prototype.indexOf=function(e){var t=this.length>>>0,n=Number(arguments[1])||0;for((n=n<0?Math.ceil(n):Math.floor(n))<0&&(n+=t);n=h()?(t.style.top="0",t.style.marginTop="0",t.style.marginBottom="0",t.style.borderTopWidth="0",t.style.borderBottomWidth="0",n.customPosY=0,(m(t.parentNode,"dlg-multi")||m(t.parentNode,"dlg-disable-overlay")||m(t.parentNode,"dlg-nomodal"))&&(C(),t.parentNode.style.overflow="auto",window.PointerEvent&&(t.parentNode.style.pointerEvents="auto"))):(n.customPosY?t.style.top=n.customPosY+"px":t.style.top=h()/2-t.offsetHeight/2+"px",n.customHeight&&(t.style.height=n.customHeight+"px"),t.style.borderTopWidth="",t.style.borderBottomWidth="",m(t.parentNode,"dlg-multi")||m(t.parentNode,"dlg-disable-overlay")||m(t.parentNode,"dlg-nomodal")?(E(),t.parentNode.style.overflow="hidden"):C()),d(t.offsetWidth+n.customPosX+30)>=g()?(t.style.left="0",t.style.marginLeft="0",t.style.marginRight="0",t.style.borderLeftWidth="0",t.style.borderRightWidth="0",n.customPosX=0):(n.customPosX?t.style.left=n.customPosX+"px":t.style.left=g()/2-t.offsetWidth/2+"px",n.customWidth&&(t.style.maxWidth=n.customWidth+"px"),t.style.borderLeftWidth="",t.style.borderRightWidth=""))},x=function(e,t){var n=document.getElementById(e+"_1");if(!t)return n;if(-1!==(t=s(t)).indexOf("#")&&null===t.match(/[\s+>,+:\[]/g))return n.querySelector(t);if(n){var i=n.querySelectorAll(t);if(i.length)return i}return null},w=function(e){for(var n=d(p(e,"zIndex")),i=0;i0&&d(n)}},E=function(e,i){if(e&&i&&(m(e,"dlg-multi")||m(e,"dlg-disable-overlay")||m(e,"dlg-nomodal"))){for(var l=0,s=0;s=10)&&(clearInterval(o),"function"==typeof n&&n())}),i||30)},k=function(e,t){var n=d(t.h);if(!m(e,"dlg-disable-heading")){var i=x(t.id,"#"+t.id+" .dlg-heading");i&&(n-=d(p(i=i[0],"height"))+d(p(i,"paddingTop"))+d(p(i,"paddingBottom"))+d(p(i,"borderTopWidth"))+d(p(i,"borderBottomWidth")))}if(!m(e,"dlg-disable-footer")){var l=x(t.id,"#"+t.id+" .dlg-footer");l&&(n-=d(p(l=l[0],"height"))+d(p(l,"paddingTop"))+d(p(l,"paddingBottom"))+d(p(l,"borderTopWidth"))+d(p(l,"borderBottomWidth")))}var o=x(t.id,".dlg-message");o&&(n-=d(p(o=o[0],"borderTopWidth"))+d(p(o,"paddingTop"))+d(p(o,"paddingBottom"))+d(p(o,"borderBottomWidth")),o.style.height=d(n)+"px",o.style.maxHeight=d(n)+"px")},N=function(e){if(i)return!1;var t=v(e);if(null!==t){var n=document.getElementById(t.id);m(n,"dlg-disable-overlay")||m(n,"dlg-nomodal")||m(n,"dlg-multi")||(C(),i=!0),m(n,"dlg-disable-drag")||B.init(t.id+"_1"),m(n,"dlg-disable-mobile")&&(m(o(),"dlg-hide-mobile")||f(o(),"dlg-hide-mobile")),n.classList.add("dialog-open"),n.style.zIndex=d(w(n)),t.bFade&&(n.style.opacity=0,T(n));var l=document.getElementById(t.id+"_1");return("number"==typeof t.x||"string"==typeof t.x)&&(l.style.left=d(t.x)+"px",t.customPosX=d(t.x)),("number"==typeof t.y||"string"==typeof t.y)&&(l.style.top=d(t.y)+"px",t.customPosY=d(t.y)),t.w&&(l.style.maxWidth=d(t.w)+"px",t.customWidth=d(t.w)),t.h&&(t.customHeight=d(t.h)),t.customHeight&&k(t.el,t),l.style.visibility="visible",t.bVisible=!0,t.onShow(),y(t.id+"_1"),t}return!1},W=function(e,t){var n=document.getElementById(e),l=document.getElementById(e+"_1");n.classList.add("dialog-remove-loadding");var o=v(e);return o.x&&o.xPos(o.x),o.y&&o.yPos(o.y),o.w&&o.width(o.w),o.h&&o.height(o.h),n&&l&&(!0===t||o.bFade?!0!==t&&o.bFade?T(n,!0,(function(){l.style.visibility="hidden",o.bVisible=!1,o.onHide()})):(!0!==t||o.bFade,l.style.visibility="hidden",o.bVisible=!1):(l.style.visibility="hidden",o.bVisible=!1,o.onHide())),E(n,o),A(),m(n,"dlg-disable-overlay")||m(n,"dlg-nomodal")||(i=!1),o},H=function(e){var n=!1,l=v(e),o=document.getElementById(e);if(o){E(o,l),A(),m(o,"dlg-disable-overlay")||m(o,"dlg-nomodal")||(i=!1),l.onDestroy();var d=o.querySelectorAll(".dlg-input-field");d.length>0&&(d[0].onkeyup=null,d[0].onchange=null),setTimeout((function(){o.parentNode.removeChild(o)}),400),l.bExistInDOM=!1,l.bVisible=!1;var s=t.indexOf(l);s>-1?setTimeout((function(){n=1===t.splice(s,1).length}),10):n=!1}return n},I=function(n,i,o,a,u,p,C,E,A){var T=v(n+"_0");if(T)return T;i=s(i=i.replace(/\s+/g," "));var I=function(e,t,n,i){var l=t;!0===n&&(void 0===i&&(i=" "),l=t.split(i));for(var o=0,d=0;d':m(_,"dlg-question")?R.innerHTML='
':m(_,"dlg-error")?R.innerHTML='
':m(_,"dlg-success")?R.innerHTML='
':m(_,"dlg-exclamation")&&(R.innerHTML='
'),q.appendChild(R),(V=document.createElement("div")).setAttribute("class","dlg-flexbox-right"),V.innerHTML=L.strMessage,q.appendChild(V)):(q.setAttribute("class","dlg-message"),q.innerHTML=L.strMessage),Y.appendChild(q),m(_,"dlg-prompt")){var z=document.createElement("div");z.setAttribute("class","dlg-input"),m(q,"dlg-flex-container")?V.appendChild(z):q.appendChild(z);var D=document.createElement("input");D.setAttribute("class","dlg-input-field"),D.setAttribute("type","text"),D.setAttribute("value",L.strInput),z.appendChild(D),m(_,"dlg-ok-cancel")||f(_,"dlg-ok-cancel")}if(!m(_,"dlg-disable-footer")){var O=document.createElement("div");if(O.setAttribute("class","dlg-footer"),Y.appendChild(O),!m(_,"dlg-disable-btns")){if(m(_,"dlg-yes")||m(_,"dlg-yes-no")){var F=document.createElement("button");F.setAttribute("class","dlg-yes-btn");var $=document.createTextNode("Yes");F.appendChild($),O.appendChild(F)}if(m(_,"dlg-no")||m(_,"dlg-yes-no")){var K=document.createElement("button");K.setAttribute("class","dlg-no-btn");var j=document.createTextNode("No");K.appendChild(j),O.appendChild(K)}if(m(_,"dlg-ok")||m(_,"dlg-ok-cancel")){var G=document.createElement("button");G.setAttribute("class","dlg-ok-btn");var J=document.createTextNode("OK");G.appendChild(J),O.appendChild(G)}if(m(_,"dlg-cancel")||m(_,"dlg-ok-cancel")){var Q=document.createElement("button");Q.setAttribute("class","dlg-cancel-btn");var U=document.createTextNode("Cancel");Q.appendChild(U),O.appendChild(Q)}if(m(_,"dlg-close")||m(_,"dlg")){var Z=document.createElement("button");Z.setAttribute("class","dlg-close-btn");var ee=document.createTextNode("Close");Z.appendChild(ee),O.appendChild(Z)}}}r(window,"resize",(function(){L.bVisible&&y(L.id+"_1")}));var te=_.querySelector(".dlg-close-x");te&&r(te,"click",(function(){L.hide(0,!0),L.callback(0),L.nRetCode=0,L.onClose(),document.body.classList.contains("login-popup-show")&&document.body.classList.remove("login-popup-show")}));var ne=_.querySelector(".dlg-close-btn");if(ne&&r(ne,"click",(function(){L.hide(0,!0),L.callback(0),L.nRetCode=0,L.onClose()})),m(_,"dlg-disable-clickout")||r(_,"click",(function(e){c(e=e||window.event)===_&&(L.hide(0,!0),L.callback(0),L.nRetCode=0,L.onClose(),document.body.classList.contains("login-popup-show")&&document.body.classList.remove("login-popup-show"))})),m(_,"dlg-disable-esc")||r(document,"keyup",(function(e){(27===(e=e||window.event).which||27===e.keyCode||"Escape"===e.key||"Escape"===e.code)&&L.bVisible&&(L.hide(0,!0),L.callback(0),L.nRetCode=0,L.onClose())})),m(_,"dlg-yes-no")||m(_,"dlg-yes")||m(_,"dlg-no")){var ie=_.querySelector(".dlg-yes-btn");ie&&r(ie,"click",(function(){L.hide(0,!0),L.callback(1),L.nRetCode=1,L.onClose()}));var le=_.querySelector(".dlg-no-btn");le&&r(le,"click",(function(){L.hide(0,!0),L.callback(2),L.nRetCode=2,L.onClose()}))}if(m(_,"dlg-ok-cancel")||m(_,"dlg-ok")||m(_,"dlg-cancel")){var oe=_.querySelector(".dlg-ok-btn");oe&&r(oe,"click",(function(){L.hide(0,!0),L.callback(3),L.nRetCode=3,L.onClose()}));var de=_.querySelector(".dlg-cancel-btn");de&&r(de,"click",(function(){L.hide(0,!0),L.callback(4),L.nRetCode=4,L.onClose()}))}if(m(_,"dlg-prompt")){var se=_.querySelector(".dlg-input-field");se&&(r(se,"keyup",(function(){L.strInput=se.value})),r(se,"change",(function(){L.strInput=se.value})))}if(m(_,"dlg-disable-drag")||(B.init(Y.id),r(Y,"mouseenter",(function(){B.init(Y.id)})),r(Y,"mousedown",(function(){_.style.zIndex=d(w(_))}))),m(_,"dlg-resize")){P.init(Y.id),L.bResize=!0;var re=x(L.id,"#"+L.id+" .dlg-footer");re&&f(re[0],"dlg-footer-extra-padding"),r(Y,"mouseenter",(function(){P.init(Y.id)}))}return m(_,"dlg-prompt")&&_.querySelector(".dlg-input-field").focus(),L.bExistInDOM=!0,L.el=document.getElementById(L.id+"_1"),setTimeout((function(){L.onCreate()}),10),L}I||L.strTypeClass}return null},L=function(){for(var e=document.querySelectorAll(".dlg-opener"),t=0;t

',r(t,"mousedown",P.start)}},start:function(e){return e=e||window.event,P.minWidth=d(p(P.el,"minWidth"))||100,P.minHeight=d(p(P.el,"minHeight"))||36,P.posX=e.clientX,P.posY=e.clientY,P.width=P.el.offsetWidth,P.height=P.el.offsetHeight,r(document,"mousemove",P.move),r(document,"mouseup",P.stop),P.bActive=!0,m(P.el.parentNode,"dlg-disable-heading")&&function(e){void 0!==e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}(e),u(e),!1},stop:function(){a(document,"mousemove",P.move),a(document,"mouseup",P.stop),P.bActive=!1},move:function(e){e=e||window.event;var t=v(P.el.id.split("_1")[0]);return P.width+e.clientX-P.posX>=P.minWidth&&(P.el.style.maxWidth=d(P.width+e.clientX-P.posX)+"px",t.width(P.el.style.maxWidth)),P.height+e.clientY-P.posY>=P.minHeight&&(P.el.style.height=d(P.height+e.clientY-P.posY)+"px",t.height(P.el.style.height)),u(e),!1}};return r(window,"load",(function(){L()})),{create:function(e,t,n,i,l,o,d,s,r){return I(e,t,n,i,l,o,d,s,r)},getAll:function(){return t},getById:function(e){return v(e)},init:function(){return L()}}}();