!function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("vue")):"function"===typeof define&&define.amd?define("$toast",["vue"],t):"object"===typeof exports?exports.$toast=t(require("vue")):e.$toast=t(e.Vue)}("undefined"!==typeof self?self:this,(function(e){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s="ux2C")}({Y0i2:function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(o){"object"===typeof window&&(n=window)}e.exports=n},g8md:function(e,t,n){"use strict";(function(e){t.a=function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",o=null;"undefined"!==typeof window?o=window.Vue:"undefined"!==typeof e&&(o=e.Vue),o&&("directive"===n?o.directive(t.name,t):o.use(t))}}).call(this,n("Y0i2"))},"i7/w":function(t,n){t.exports=e},ux2C:function(e,t,n){"use strict";n.r(t),n.d(t,"useToast",(function(){return w}));var o=n("i7/w"),i=n.n(o),s=n("g8md");const r=/(?:^\[object\s(.*?)\]$)/;var u=e=>Object.prototype.toString.call(e).replace(r,"$1").toLowerCase();function c(e,t){let n=Object.assign({},e);return"string"===u(t)?n.message="".concat(t):"object"===u(t)&&(n=Object.assign({},n,t)),n}const a={MIN:2e3,MAX:3500,DEFAULTS:2750},d={TOP:"top",BOTTOM:"bottom",CENTER:"center"},l={className:"",timeoutMs:a.DEFAULTS,message:"",position:d.BOTTOM,debug:!1};let p,f,m,h=l;function b(){return document.querySelector(".mdc-toast")}function v(e){return new i.a({el:document.createElement("div"),name:"Toast",data:()=>({open:!1,opening:!0,opened:!1,options:e}),computed:{positionClassName(){return["top","center"].includes(this.options.position)?"mdc-toast--".concat(this.options.position):""},className(){return["mdc-snackbar","mdc-toast",this.positionClassName,this.options.className,{"mdc-snackbar--opening":this.opening,"mdc-snackbar--open":this.opened}]}},watch:{open(e){e?setTimeout((()=>{this.opened=!0,setTimeout((()=>{this.opening=!1}),150)}),150):(this.opening=!0,this.opened=!1)}},mounted(){this.render(e)},methods:{hide(){this.open=!1,this.options.debug||(m=setTimeout((()=>{try{e=this.$el,document.body.removeChild(e),p=null}catch(t){}var e}),this.options.timeoutMs))},show(){this.open=!0,f=setTimeout((()=>{this.hide()}),this.options.timeoutMs)},render(e){if(!(e.timeoutMs<=a.MAX&&e.timeoutMs>=a.MIN))throw new Error("[$toast]: The 'timeoutMs' param must be between ".concat(a.MIN," and ").concat(a.MAX));var t;this.options=e,b()||(t=this.$el,document.body.appendChild(t)),this.show()}},template:'<div :class="className">\n  <div class="mdc-snackbar__surface">\n    <div class="mdc-snackbar__label">\n      {{ options.message }}\n    </div>\n  </div>\n</div>'})}function y(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=c(h,e);b()?(clearTimeout(f),clearTimeout(m),p.render(t)):p=v(t)}const g={install(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};h=Object.assign({},l,t),e.prototype.$toast=y}},w=()=>y;Object(s.a)(g);t.default=g}})}));