/*! * mdui 1.0.1 (https://mdui.org) * Copyright 2016-2020 zdhxiong * Licensed under MIT */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).mdui=e()}(this,function(){"use strict";function t(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n}function e(e){var n=this.constructor;return this.then(function(t){return n.resolve(e()).then(function(){return t})},function(t){return n.resolve(e()).then(function(){return n.reject(t)})})}function n(n){return new this(function(i,t){if(!n||void 0===n.length)return t(new TypeError(typeof n+" "+n+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var o=Array.prototype.slice.call(n);if(0===o.length)return i([]);var s=o.length;function r(e,t){if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void n.call(t,function(t){r(e,t)},function(t){o[e]={status:"rejected",reason:t},0==--s&&i(o)})}o[e]={status:"fulfilled",value:t},0==--s&&i(o)}for(var e=0;e"===n[n.length-1]){var i="div";return D({li:"ul",tr:"tbody",td:"tr",th:"tr",tbody:"table",option:"select"},function(t,e){if(0===n.indexOf("<"+t))return i=e,!1}),new R(j(n,i))}if(!("#"===t[0]&&!t.match(/[ .<>:~]/)))return new R(document.querySelectorAll(t));var e=document.getElementById(t.slice(1));return e?new R([e]):new R}return!x(t)||t instanceof Node?new R([t]):new R(t)}).fn=R.prototype,H);setTimeout(function(){return L("body").addClass("mdui-loaded")});var B={$:L};function P(t,e){return t!==e&&w(t).contains(e)}function N(n,t){return D(t,function(t,e){n.push(e)}),n}L.fn.each=function(t){return D(this,t)},L.fn.get=function(t){return void 0===t?[].slice.call(this):this[0<=t?t:t+this.length]},L.fn.find=function(n){var i=[];return this.each(function(t,e){N(i,L(e.querySelectorAll(n)).get())}),new R(i)};var z={},F=1;function q(t){var e="_mduiEventId";return t[e]||(t[e]=++F),t[e]}function W(t){var e=t.split(".");return{type:e[0],ns:e.slice(1).sort().join(" ")}}function Y(t){return new RegExp("(?:^| )"+t.replace(" "," .* ?")+"(?: |$)")}function U(s,t,r,a){function u(t){delete e[t.id],s.removeEventListener(t.type,t.proxy,!1)}var e=z[q(s)]||[];t?t.split(" ").forEach(function(t){var e,n,i,o;t&&(e=s,n=r,i=a,o=W(t),(z[q(e)]||[]).filter(function(t){return t&&(!o.type||t.type===o.type)&&(!o.ns||Y(o.ns).test(t.ns))&&(!n||q(t.func)===q(n))&&(!i||t.selector===i)})).forEach(function(t){return u(t)})}):e.forEach(function(t){return u(t)})}function X(n,t){for(var e=[],i=arguments.length-2;0"===n[n.length-1]?i&&b(e)?L(e.cloneNode(!0)):L(e):L(j(e,"div")))[s?"insertAfter":"insertBefore"](o)})})}}),L.fn.off=function(t,n,e){var i=this;return C(t)?(D(t,function(t,e){i.off(t,n,e)}),this):(!1!==n&&!p(n)||(e=n,n=void 0),!1===e&&(e=M),this.each(function(){U(this,t,e,n)}))},L.fn.on=function(t,n,i,e,o){var s=this;if(C(t))return E(n)||(i=i||n,n=void 0),D(t,function(t,e){s.on(t,n,i,e,o)}),this;if(null==i&&null==e?(e=n,i=n=void 0):null==e&&(E(n)?(e=i,i=void 0):(e=i,i=n,n=void 0)),!1===e)e=M;else if(!e)return this;if(o){var r=this,a=e;e=function(t){return r.off(t.type,n,e),a.apply(this,arguments)}}return this.each(function(){!function(s,t,r,a,u){var c=q(s);z[c]||(z[c]=[]);var l=!1;C(a)&&a.useCapture&&(l=!0),t.split(" ").forEach(function(t){if(t){var n=W(t),e={type:n.type,ns:n.ns,func:r,selector:u,id:z[c].length,proxy:o};z[c].push(e),s.addEventListener(e.type,o,l)}function i(t,e){!1===r.apply(e,void 0===t._detail?[t]:[t].concat(t._detail))&&(t.preventDefault(),t.stopPropagation())}function o(e){e._ns&&!Y(e._ns).test(n.ns)||(e._data=a,u?L(s).find(u).get().reverse().forEach(function(t){t!==e.target&&!P(t,e.target)||i(e,t)}):i(e,s))}})}(this,t,e,i,n)})},D(K,function(t,e){L.fn[t]=function(n){return this.on(e,function(t,e){n(t,e.xhr,e.options,e.data)})}}),L.fn.map=function(n){return new R(nt(this,function(t,e){return n.call(t,e,t)}))},L.fn.clone=function(){return this.map(function(){return this.cloneNode(!0)})},L.fn.is=function(n){var i=!1;if(p(n))return this.each(function(t,e){n.call(e,t,e)&&(i=!0)}),i;if(E(n))return this.each(function(t,e){y(e)||g(e)||(e.matches||e.msMatchesSelector).call(e,n)&&(i=!0)}),i;var e=L(n);return this.each(function(t,n){e.each(function(t,e){n===e&&(i=!0)})}),i},L.fn.remove=function(n){return this.each(function(t,e){!e.parentNode||n&&!L(e).is(n)||e.parentNode.removeChild(e)})},D(["prepend","append"],function(u,t){L.fn[t]=function(){for(var a=[],t=arguments.length;t--;)a[t]=arguments[t];return this.each(function(t,e){var n,i=e.childNodes,o=i.length,s=o?i[u?o-1:0]:document.createElement("div");o||e.appendChild(s);var r=p(a[0])?[a[0].call(e,t,e.innerHTML)]:a;t&&(r=r.map(function(t){return E(t)?t:L(t).clone()})),(n=L(s))[u?"after":"before"].apply(n,r),o||e.removeChild(s)})}}),D(["appendTo","prependTo"],function(r,t){L.fn[t]=function(t){var s=[],e=L(t).map(function(t,e){var n=e.childNodes,i=n.length;if(i)return n[r?0:i-1];var o=document.createElement("div");return e.appendChild(o),s.push(o),o}),n=this[r?"insertBefore":"insertAfter"](e);return L(s).remove(),n}}),D(["attr","prop","css"],function(s,r){function a(t,e){switch(s){case 0:var n=t.getAttribute(e);return v(n)?void 0:n;case 1:return t[e];default:return S(t,e)}}L.fn[r]=function(n,i){var o=this;if(C(n))return D(n,function(t,e){o[r](t,e)}),this;if(1!==arguments.length)return this.each(function(t,e){!function(t,e,n){if(!O(n))switch(s){case 0:v(n)?t.removeAttribute(e):t.setAttribute(e,n);break;case 1:t[e]=n;break;default:e=$(e),t.style[e]=m(n)?n+(-1').appendTo(document.body).reflow().css("z-index",t));var n=e.data("_overlay_level")||0;return e.data("_overlay_level",++n).addClass("mdui-overlay-show")},L.hideOverlay=function(t){void 0===t&&(t=!1);var e=L(".mdui-overlay");if(e.length){var n=t?1:e.data("_overlay_level");1i.lastScrollY?"down":"up",n=i.options.tolerance[e]<=Math.abs(t-i.lastScrollY);t>i.lastScrollY&&t>=i.options.offset&&n?i.unpin():(t"},It.prototype.updateThCheckboxStatus=function(){var t=this.$thCheckbox[0],e=this.selectedRow,n=this.$tdRows.length;t.checked=e===n,t.indeterminate=!!e&&e!==n},It.prototype.updateTdCheckbox=function(){var o=this,s="mdui-table-row-selected";this.$tdRows.each(function(t,e){var n=L(e);if(n.find(".mdui-table-cell-checkbox").remove(),o.selectable){var i=L(o.createCheckboxHTML("td")).prependTo(n).find('input[type="checkbox"]');n.hasClass(s)&&(i[0].checked=!0,o.selectedRow++),o.updateThCheckboxStatus(),i.on("change",function(){i[0].checked?(n.addClass(s),o.selectedRow++):(n.removeClass(s),o.selectedRow--),o.updateThCheckboxStatus()}),o.$tdCheckboxs=o.$tdCheckboxs.add(i)}})},It.prototype.updateThCheckbox=function(){var t=this;this.$thRow.find(".mdui-table-cell-checkbox").remove(),this.selectable&&(this.$thCheckbox=L(this.createCheckboxHTML("th")).prependTo(this.$thRow).find('input[type="checkbox"]').on("change",function(){var n=t.$thCheckbox[0].checked;t.selectedRow=n?t.$tdRows.length:0,t.$tdCheckboxs.each(function(t,e){e.checked=n}),t.$tdRows.each(function(t,e){n?L(e).addClass("mdui-table-row-selected"):L(e).removeClass("mdui-table-row-selected")})}))},It.prototype.updateNumericCol=function(){var e=this,s="mdui-table-col-numeric";this.$thRow.find("th").each(function(i,t){var o=L(t).hasClass(s);e.$tdRows.each(function(t,e){var n=L(e).find("td").eq(i);o?n.addClass(s):n.removeClass(s)})})};var St="_mdui_table";L(function(){B.mutation(".mdui-table",function(){var t=L(this);t.data(St)||t.data(St,new It(t))})}),B.updateTables=function(t){(O(t)?L(".mdui-table"):L(t)).each(function(t,e){var n=L(e),i=n.data(St);i?i.init():n.data(St,new It(n))})};var jt="touchstart mousedown",Mt="touchmove mousemove",At="touchend mouseup",Dt="touchcancel mouseleave",Rt="touchend touchmove touchcancel",Ht=0;function Lt(t){return!(Ht&&-1<["mousedown","mouseup","mousemove","click","mouseover","mouseout","mouseenter","mouseleave"].indexOf(t.type))}function Bt(t){"touchstart"===t.type?Ht+=1:-1<["touchmove","touchend","touchcancel"].indexOf(t.type)&&setTimeout(function(){Ht&&--Ht},500)}function Pt(t,e){if(!(t instanceof MouseEvent&&2===t.button)){var n="undefined"!=typeof TouchEvent&&t instanceof TouchEvent&&t.touches.length?t.touches[0]:t,i=n.pageX,o=n.pageY,s=e.offset(),r=e.innerHeight(),a=e.innerWidth(),u=i-s.left,c=o-s.top,l=Math.max(Math.pow(Math.pow(r,2)+Math.pow(a,2),.5),48),d="translate3d("+(a/2-u)+"px,"+(r/2-c)+"px, 0) scale(1)";L('
').data("_ripple_wave_translate",d).prependTo(e).reflow().transform(d)}}function Nt(){var t=L(this);t.children(".mdui-ripple-wave").each(function(t,e){!function(t){if(t.length&&!t.data("_ripple_wave_removed")){t.data("_ripple_wave_removed",!0);var e=setTimeout(function(){return t.remove()},400),n=t.data("_ripple_wave_translate");t.addClass("mdui-ripple-wave-fill").transform(n.replace("scale(1)","scale(1.01)")).transitionEnd(function(){clearTimeout(e),t.addClass("mdui-ripple-wave-out").transform(n.replace("scale(1)","scale(1.01)")),e=setTimeout(function(){return t.remove()},700),setTimeout(function(){t.transitionEnd(function(){clearTimeout(e),t.remove()})},0)})}}(L(e))}),t.off(Mt+" "+At+" "+Dt,Nt)}function zt(t){if(Lt(t)&&(Bt(t),t.target!==document)){var e=L(t.target),n=e.hasClass("mdui-ripple")?e:e.parents(".mdui-ripple").first();if(n.length&&!n.prop("disabled")&&O(n.attr("disabled")))if("touchstart"===t.type){var i=!1,o=setTimeout(function(){o=0,Pt(t,n)},200),s=function(){o&&(clearTimeout(o),o=0,Pt(t,n)),i||(i=!0,Nt.call(n))};n.on("touchmove",function(){o&&(clearTimeout(o),o=0),s()}).on("touchend touchcancel",s)}else Pt(t,n),n.on(Mt+" "+At+" "+Dt,Nt)}}L(function(){yt.on(jt,zt).on(Rt,Bt)});var Ft={reInit:!1,domLoadedEvent:!1};function qt(t,e){void 0===e&&(e={}),e=X({},Ft,e);var n=t.target,i=L(n),o=t.type,s=i.val(),r=i.attr("type")||"";if(!(-1<["checkbox","button","submit","range","radio","image"].indexOf(r))){var a=i.parent(".mdui-textfield");if("focus"===o&&a.addClass("mdui-textfield-focus"),"blur"===o&&a.removeClass("mdui-textfield-focus"),"blur"!==o&&"input"!==o||(s?a.addClass("mdui-textfield-not-empty"):a.removeClass("mdui-textfield-not-empty")),n.disabled?a.addClass("mdui-textfield-disabled"):a.removeClass("mdui-textfield-disabled"),"input"!==o&&"blur"!==o||e.domLoadedEvent||!n.validity||(n.validity.valid?a.removeClass("mdui-textfield-invalid-html5"):a.addClass("mdui-textfield-invalid-html5")),i.is("textarea")){var u=s,c=!1;""===u.replace(/[\r\n]/g,"")&&(i.val(" "+u),c=!0),i.outerHeight("");var l=i.outerHeight(),d=n.scrollHeight;l / '+h+"").appendTo(a),a.find(".mdui-textfield-counter-inputed").text(s.length.toString())),(a.find(".mdui-textfield-helper").length||a.find(".mdui-textfield-error").length||h)&&a.addClass("mdui-textfield-has-bottom")}}function Wt(t){var e=t.data(),n=e._slider_$track,i=e._slider_$fill,o=e._slider_$thumb,s=e._slider_$input,r=e._slider_min,a=e._slider_max,u=e._slider_disabled,c=e._slider_discrete,l=e._slider_$thumbText,d=s.val(),h=(d-r)/(a-r)*100;i.width(h+"%"),n.width(100-h+"%"),u&&(i.css("padding-right","6px"),n.css("padding-left","6px")),o.css("left",h+"%"),c&&l.text(d),0==h?t.addClass("mdui-slider-zero"):t.removeClass("mdui-slider-zero")}function Yt(t){var e=L('
'),n=L('
'),i=L('
'),o=t.find('input[type="range"]'),s=o[0].disabled,r=t.hasClass("mdui-slider-discrete");s?t.addClass("mdui-slider-disabled"):t.removeClass("mdui-slider-disabled"),t.find(".mdui-slider-track").remove(),t.find(".mdui-slider-fill").remove(),t.find(".mdui-slider-thumb").remove(),t.append(e).append(n).append(i);var a=L();r&&(a=L(""),i.empty().append(a)),t.data("_slider_$track",e),t.data("_slider_$fill",n),t.data("_slider_$thumb",i),t.data("_slider_$input",o),t.data("_slider_min",o.attr("min")),t.data("_slider_max",o.attr("max")),t.data("_slider_disabled",s),t.data("_slider_discrete",r),t.data("_slider_$thumbText",a),Wt(t)}L(function(){yt.on("input focus blur",".mdui-textfield-input",{useCapture:!0},qt),yt.on("click",".mdui-textfield-expandable .mdui-textfield-icon",function(){L(this).parents(".mdui-textfield").addClass("mdui-textfield-expanded").find(".mdui-textfield-input")[0].focus()}),yt.on("click",".mdui-textfield-expanded .mdui-textfield-close",function(){L(this).parents(".mdui-textfield").removeClass("mdui-textfield-expanded").find(".mdui-textfield-input").val("")}),B.mutation(".mdui-textfield",function(){L(this).find(".mdui-textfield-input").trigger("input",{domLoadedEvent:!0})})}),B.updateTextFields=function(t){(O(t)?L(".mdui-textfield"):L(t)).each(function(t,e){L(e).find(".mdui-textfield-input").trigger("input",{reInit:!0})})};var Ut='.mdui-slider input[type="range"]';L(function(){yt.on("input change",Ut,function(){Wt(L(this).parent())}),yt.on(jt,Ut,function(t){Lt(t)&&(Bt(t),this.disabled||L(this).parent().addClass("mdui-slider-focus"))}),yt.on(At,Ut,function(t){Lt(t)&&(this.disabled||L(this).parent().removeClass("mdui-slider-focus"))}),yt.on(Rt,Ut,Bt),B.mutation(".mdui-slider",function(){Yt(L(this))})}),B.updateSliders=function(t){(O(t)?L(".mdui-slider"):L(t)).each(function(t,e){Yt(L(e))})};function Xt(t,e){var n=this;void 0===e&&(e={}),this.options=X({},Vt),this.state="closed",this.$element=L(t).first(),X(this.options,e),this.$btn=this.$element.find(".mdui-fab"),this.$dial=this.$element.find(".mdui-fab-dial"),this.$dialBtns=this.$dial.find(".mdui-fab"),"hover"===this.options.trigger&&(this.$btn.on("touchstart mouseenter",function(){return n.open()}),this.$element.on("mouseleave",function(){return n.close()})),"click"===this.options.trigger&&this.$btn.on(jt,function(){return n.open()}),yt.on(jt,function(t){L(t.target).parents(".mdui-fab-wrapper").length||n.close()})}var Vt={trigger:"hover"};Xt.prototype.triggerEvent=function(t){vt(t,"fab",this.$element,this)},Xt.prototype.isOpen=function(){return"opening"===this.state||"opened"===this.state},Xt.prototype.open=function(){var i=this;this.isOpen()||(this.$dialBtns.each(function(t,e){var n=15*(i.$dialBtns.length-t)+"ms";e.style.transitionDelay=n,e.style.webkitTransitionDelay=n}),this.$dial.css("height","auto").addClass("mdui-fab-dial-show"),this.$btn.find(".mdui-fab-opened").length&&this.$btn.addClass("mdui-fab-opened"),this.state="opening",this.triggerEvent("open"),this.$dialBtns.first().transitionEnd(function(){i.$btn.hasClass("mdui-fab-opened")&&(i.state="opened",i.triggerEvent("opened"))}))},Xt.prototype.close=function(){var t=this;this.isOpen()&&(this.$dialBtns.each(function(t,e){var n=15*t+"ms";e.style.transitionDelay=n,e.style.webkitTransitionDelay=n}),this.$dial.removeClass("mdui-fab-dial-show"),this.$btn.removeClass("mdui-fab-opened"),this.state="closing",this.triggerEvent("close"),this.$dialBtns.last().transitionEnd(function(){t.$btn.hasClass("mdui-fab-opened")||(t.state="closed",t.triggerEvent("closed"),t.$dial.css("height",0))}))},Xt.prototype.toggle=function(){this.isOpen()?this.close():this.open()},Xt.prototype.show=function(){this.$element.removeClass("mdui-fab-hide")},Xt.prototype.hide=function(){this.$element.addClass("mdui-fab-hide")},Xt.prototype.getState=function(){return this.state},B.Fab=Xt;var Jt="mdui-fab";L(function(){yt.on("touchstart mousedown mouseover","["+Jt+"]",function(){new B.Fab(this,Ct(this,Jt))})});function Kt(t,e){var n=this;void 0===e&&(e={}),this.$element=L(),this.options=X({},Gt),this.size=0,this.$selected=L(),this.$menu=L(),this.$items=L(),this.selectedIndex=0,this.selectedText="",this.selectedValue="",this.state="closed",this.$native=L(t).first(),this.$native.hide(),X(this.options,e),this.uniqueID=L.guid(),this.handleUpdate(),yt.on("click touchstart",function(t){var e=L(t.target);!n.isOpen()||e.is(n.$element)||P(n.$element[0],e[0])||n.close()})}var Gt={position:"auto",gutter:16};Kt.prototype.readjustMenu=function(){var t,e,n=bt.height(),i=this.$element.height(),o=this.$items.first(),s=o.height(),r=parseInt(o.css("margin-top")),a=this.$element.innerWidth()+.01,u=s*this.size+2*r,c=this.$element[0].getBoundingClientRect().top;if("bottom"===this.options.position)e=i,t="0px";else if("top"===this.options.position)e=-u-1,t="100%";else{var l=n-2*this.options.gutter;ln&&(e=-(c+u+this.options.gutter-n)),t=this.selectedIndex*s+s/2+r+"px"}this.$element.innerWidth(a),this.$menu.innerWidth(a).height(u).css({"margin-top":e+"px","transform-origin":"center "+t+" 0"})},Kt.prototype.isOpen=function(){return"opening"===this.state||"opened"===this.state},Kt.prototype.handleUpdate=function(){var r=this;this.isOpen()&&this.close(),this.selectedValue=this.$native.val();var a=[];this.$items=L(),this.$native.find("option").each(function(t,e){var n=e.textContent||"",i=e.value,o=e.disabled,s=r.selectedValue===i;a.push({value:i,text:n,disabled:o,selected:s,index:t}),s&&(r.selectedText=n,r.selectedIndex=t),r.$items=r.$items.add('
"+n+"
")}),this.$selected=L(''+this.selectedText+""),this.$element=L('
').show().append(this.$selected),this.$menu=L('
').appendTo(this.$element).append(this.$items),L("#"+this.uniqueID).remove(),this.$native.after(this.$element),this.size=parseInt(this.$native.attr("size")||"0"),this.size<=0&&(this.size=this.$items.length,8').appendTo(this.$element);var i=window.location.hash;i&&this.$tabs.each(function(t,e){return L(e).attr("href")!==i||(n.activeIndex=t,!1)}),-1===this.activeIndex&&this.$tabs.each(function(t,e){return!L(e).hasClass("mdui-tab-active")||(n.activeIndex=t,!1)}),this.$tabs.length&&-1===this.activeIndex&&(this.activeIndex=0),this.setActive(),bt.on("resize",L.throttle(function(){return n.setIndicatorPosition()},100)),this.$tabs.each(function(t,e){n.bindTabEvent(e)})}var te={trigger:"click",loop:!1};Zt.prototype.isDisabled=function(t){return void 0!==t.attr("disabled")},Zt.prototype.bindTabEvent=function(t){function e(){if(n.isDisabled(i))return!1;n.activeIndex=n.$tabs.index(t),n.setActive()}var n=this,i=L(t);i.on("click",e),"hover"===this.options.trigger&&i.on("mouseenter",e),i.on("click",function(){if(0===(i.attr("href")||"").indexOf("#"))return!1})},Zt.prototype.triggerEvent=function(t,e,n){void 0===n&&(n={}),vt(t,"tab",e,this,n)},Zt.prototype.setActive=function(){var o=this;this.$tabs.each(function(t,e){var n=L(e),i=n.attr("href")||"";t!==o.activeIndex||o.isDisabled(n)?(n.removeClass("mdui-tab-active"),L(i).hide()):(n.hasClass("mdui-tab-active")||(o.triggerEvent("change",o.$element,{index:o.activeIndex,id:i.substr(1)}),o.triggerEvent("show",n),n.addClass("mdui-tab-active")),L(i).show(),o.setIndicatorPosition())})},Zt.prototype.setIndicatorPosition=function(){if(-1!==this.activeIndex){var t=this.$tabs.eq(this.activeIndex);if(!this.isDisabled(t)){var e=t.offset();this.$indicator.css({left:e.left+this.$element[0].scrollLeft-this.$element[0].getBoundingClientRect().left+"px",width:t.innerWidth()+"px"})}}else this.$indicator.css({left:0,width:0})},Zt.prototype.next=function(){-1!==this.activeIndex&&(this.$tabs.length>this.activeIndex+1?this.activeIndex++:this.options.loop&&(this.activeIndex=0),this.setActive())},Zt.prototype.prev=function(){-1!==this.activeIndex&&(0',D(n.buttons,function(t,e){i+=''+e.text+""}),i+="");var o='
'+(n.title?'
'+n.title+"
":"")+(n.content?'
'+n.content+"
":"")+i+"
",s=new B.Dialog(o,{history:n.history,overlay:n.overlay,modal:n.modal,closeOnEsc:n.closeOnEsc,destroyOnClosed:n.destroyOnClosed});return null!==(e=n.buttons)&&void 0!==e&&e.length&&s.$element.find(".mdui-dialog-actions .mdui-btn").each(function(t,e){L(e).on("click",function(){n.buttons[t].onClick(s),n.buttons[t].close&&s.close()})}),s.$element.on("open.mdui.dialog",function(){n.onOpen(s)}).on("opened.mdui.dialog",function(){n.onOpened(s)}).on("close.mdui.dialog",function(){n.onClose(s)}).on("closed.mdui.dialog",function(){n.onClosed(s)}),s.open(),s}),closeOnEsc:!0,closeOnConfirm:!0},be={confirmText:"ok",cancelText:"cancel",history:!0,modal:!(B.alert=function(t,e,n,i){return p(e)&&(i=n,n=e,e=""),O(n)&&(n=function(){}),O(i)&&(i={}),i=X({},ye,i),B.dialog({title:e,content:t,buttons:[{text:i.confirmText,bold:!1,close:i.closeOnConfirm,onClick:n}],cssClass:"mdui-dialog-alert",history:i.history,modal:i.modal,closeOnEsc:i.closeOnEsc})}),closeOnEsc:!0,closeOnCancel:!0,closeOnConfirm:!0},xe={confirmText:"ok",cancelText:"cancel",history:!0,modal:!(B.confirm=function(t,e,n,i,o){return p(e)&&(o=i,i=n,n=e,e=""),O(n)&&(n=function(){}),O(i)&&(i=function(){}),O(o)&&(o={}),o=X({},be,o),B.dialog({title:e,content:t,buttons:[{text:o.cancelText,bold:!1,close:o.closeOnCancel,onClick:i},{text:o.confirmText,bold:!1,close:o.closeOnConfirm,onClick:n}],cssClass:"mdui-dialog-confirm",history:o.history,modal:o.modal,closeOnEsc:o.closeOnEsc})}),closeOnEsc:!0,closeOnCancel:!0,closeOnConfirm:!0,type:"text",maxlength:0,defaultValue:"",confirmOnEnter:!1};B.prompt=function(t,e,i,n,o){p(e)&&(o=n,n=i,i=e,e=""),O(i)&&(i=function(){}),O(n)&&(n=function(){}),O(o)&&(o={});var s='
'+(t?'":"")+("text"===(o=X({},xe,o)).type?'":"")+("textarea"===o.type?'":"")+"
";return B.dialog({title:e,content:s,buttons:[{text:o.cancelText,bold:!1,close:o.closeOnCancel,onClick:function(t){var e=t.$element.find(".mdui-textfield-input").val();n(e,t)}},{text:o.confirmText,bold:!1,close:o.closeOnConfirm,onClick:function(t){var e=t.$element.find(".mdui-textfield-input").val();i(e,t)}}],cssClass:"mdui-dialog-prompt",history:o.history,modal:o.modal,closeOnEsc:o.closeOnEsc,onOpen:function(n){var t=n.$element.find(".mdui-textfield-input");B.updateTextFields(t),t[0].focus(),"textarea"!==o.type&&!0===o.confirmOnEnter&&t.on("keydown",function(t){if(13===t.keyCode){var e=n.$element.find(".mdui-textfield-input").val();return i(e,n),o.closeOnConfirm&&n.close(),!1}}),"textarea"===o.type&&t.on("input",function(){return n.handleUpdate()}),o.maxlength&&n.handleUpdate()}})};function Ce(t,e){void 0===e&&(e={}),this.options=X({},we),this.state="closed",this.timeoutId=null,this.$target=L(t).first(),X(this.options,e),this.$element=L('
'+this.options.content+"
").appendTo(document.body);var n=this;this.$target.on("touchstart mouseenter",function(t){n.isDisabled(this)||Lt(t)&&(Bt(t),n.open())}).on("touchend mouseleave",function(t){n.isDisabled(this)||Lt(t)&&n.close()}).on(Rt,function(t){n.isDisabled(this)||Bt(t)})}var we={position:"auto",delay:0,content:""};Ce.prototype.isDisabled=function(t){return t.disabled||void 0!==L(t).attr("disabled")},Ce.prototype.isDesktop=function(){return 1024
'+this.options.message+"
"+(this.options.buttonText?'"+this.options.buttonText+"":"")+"").appendTo(document.body),this.setPosition("close"),this.$element.reflow().addClass("mdui-snackbar-"+this.options.position)}var ke={message:"",timeout:4e3,position:"bottom",buttonText:"",buttonColor:"",closeOnButtonClick:!0,closeOnOutsideClick:!0,onClick:function(){},onButtonClick:function(){},onOpen:function(){},onOpened:function(){},onClose:function(){},onClosed:function(){}},_e=null,Te="_mdui_snackbar";function Ie(t){return void 0===t&&(t=!1),'
'}function Se(t){var e=L(t),n=e.hasClass("mdui-spinner-colorful")?Ie(1)+Ie(2)+Ie(3)+Ie(4):Ie();e.html(n)}Oe.prototype.closeOnOutsideClick=function(t){var e=L(t.target);e.hasClass("mdui-snackbar")||e.parents(".mdui-snackbar").length||_e.close()},Oe.prototype.setPosition=function(t){var e,n,i=this.$element[0].clientHeight,o=this.options.position;e="bottom"===o||"top"===o?"-50%":"0","open"===t?n="0":("bottom"===o&&(n=i),"top"===o&&(n=-i),"left-top"!==o&&"right-top"!==o||(n=-i-24),"left-bottom"!==o&&"right-bottom"!==o||(n=i+24)),this.$element.transform("translate("+e+","+n+"px")},Oe.prototype.open=function(){var e=this;"opening"!==this.state&&"opened"!==this.state&&(_e?re(Te,function(){return e.open()}):((_e=this).state="opening",this.options.onOpen(this),this.setPosition("open"),this.$element.transitionEnd(function(){"opening"===e.state&&(e.state="opened",e.options.onOpened(e),e.options.buttonText&&e.$element.find(".mdui-snackbar-action").on("click",function(){e.options.onButtonClick(e),e.options.closeOnButtonClick&&e.close()}),e.$element.on("click",function(t){L(t.target).hasClass("mdui-snackbar-action")||e.options.onClick(e)}),e.options.closeOnOutsideClick&&yt.on(jt,e.closeOnOutsideClick),e.options.timeout&&(e.timeoutId=setTimeout(function(){return e.close()},e.options.timeout)))})))},Oe.prototype.close=function(){var t=this;"closing"!==this.state&&"closed"!==this.state&&(this.timeoutId&&clearTimeout(this.timeoutId),this.options.closeOnOutsideClick&&yt.off(jt,this.closeOnOutsideClick),this.state="closing",this.options.onClose(this),this.setPosition("close"),this.$element.transitionEnd(function(){"closing"===t.state&&(_e=null,t.state="closed",t.options.onClosed(t),t.$element.remove(),ae(Te))}))},B.snackbar=function(t,e){void 0===e&&(e={}),E(t)?e.message=t:e=t;var n=new Oe(e);return n.open(),n},L(function(){yt.on("click",".mdui-bottom-nav>a",function(){var i=L(this),o=i.parent();o.children("a").each(function(t,e){var n=i.is(e);n&&vt("change","bottomNav",o[0],void 0,{index:t}),n?L(e).addClass("mdui-bottom-nav-active"):L(e).removeClass("mdui-bottom-nav-active")})}),B.mutation(".mdui-bottom-nav-scroll-hide",function(){new B.Headroom(this,{pinnedClass:"mdui-headroom-pinned-down",unpinnedClass:"mdui-headroom-unpinned-down"})})}),L(function(){B.mutation(".mdui-spinner",function(){Se(this)})});function je(t,e,n){var i=this;if(void 0===n&&(n={}),this.options=X({},Me),this.state="closed",this.$anchor=L(t).first(),this.$element=L(e).first(),!this.$anchor.parent().is(this.$element.parent()))throw new Error("anchorSelector and menuSelector must be siblings");X(this.options,n),this.isCascade=this.$element.hasClass("mdui-menu-cascade"),this.isCovered="auto"===this.options.covered?!this.isCascade:this.options.covered,this.$anchor.on("click",function(){return i.toggle()}),yt.on("click touchstart",function(t){var e=L(t.target);!i.isOpen()||e.is(i.$element)||P(i.$element[0],e[0])||e.is(i.$anchor)||P(i.$anchor[0],e[0])||i.close()});var o=this;yt.on("click",".mdui-menu-item",function(){var t=L(this);t.find(".mdui-menu").length||void 0!==t.attr("disabled")||o.close()}),this.bindSubMenuEvent(),bt.on("resize",L.throttle(function(){return i.readjust()},100))}var Me={position:"auto",align:"auto",gutter:16,fixed:!(B.updateSpinners=function(t){(O(t)?L(".mdui-spinner"):L(t)).each(function(){Se(this)})}),covered:"auto",subMenuTrigger:"hover",subMenuDelay:200};je.prototype.isOpen=function(){return"opening"===this.state||"opened"===this.state},je.prototype.triggerEvent=function(t){vt(t,"menu",this.$element,this)},je.prototype.readjust=function(){var t,e,n,i,o,s,r=bt.height(),a=bt.width(),u=this.options.gutter,c=this.isCovered,l=this.options.fixed,d=this.$element.width(),h=this.$element.height(),f=this.$anchor[0].getBoundingClientRect(),p=f.top,m=f.left,v=f.height,g=f.width,y=r-p-v,b=a-m-g,x=this.$anchor[0].offsetTop,C=this.$anchor[0].offsetLeft;if(n="auto"===this.options.position?h+u