text: /*! imgur 2.1.0 | (c) 2018 Pedro Rogério | MIT License */
  
  ! function (t, e) {
     "use strict";
     "function" == typeof define && define.amd ? define([], e) : "object" == typeof exports ? module.exports = e() : t.Imgur = e()
  }(this, function () {
     "use strict";
     var e = function (t) {
        if (!(this && this instanceof e)) return new e(t);
        if (t || (t = {}), !t.clientid) throw "Provide a valid Client Id here: https://apidocs.imgur.com/";
        this.clientid = t.clientid, this.endpoint = "https://api.imgur.com/3/image", this.callback = t.callback || void 0, this.dropzone = document.querySelectorAll(".dropzone"), this.run()
     };
     return e.prototype = {
        createEls: function (t, e, i) {
           var n, a = document.createElement(t);
           for (n in e) e.hasOwnProperty(n) && (a[n] = e[n]);
           return i && a.appendChild(document.createTextNode(i)), a
        },
        insertAfter: function (t, e) {
           t.parentNode.insertBefore(e, t.nextSibling)
        },
        post: function (t, e, i) {
           var n = new XMLHttpRequest;
           n.open("POST", t, !0), n.setRequestHeader("Authorization", "Client-ID " + this.clientid), n.onreadystatechange = function () {
              if (4 === this.readyState) {
                 if (!(200 <= this.status && this.status < 300)) throw new Error(this.status + " - " + this.statusText);
                 var e = "";
                 try {
                    e = JSON.parse(this.responseText)
                 } catch (t) {
                    e = this.responseText
                 }
                 i.call(window, e)
              }
           }, n.send(e), n = null
        },
        createDragZone: function () {
           var e, i;
           e = this.createEls("p", {}, "Drag your files here or click in this area."), i = this.createEls("input", {
              type: "file",
              multiple: "multiple",
              accept: "image/*"
           }), Array.prototype.forEach.call(this.dropzone, function (t) {
              t.appendChild(e), t.appendChild(i), this.status(t), this.upload(t)
           }.bind(this))
        },
        loading: function () {
           var t, e;
           t = this.createEls("div", {
              className: "loading-modal"
           }), e = this.createEls("img", {
              className: "loading-image",
              src: "../../imgur/svg/loading-spin.svg"
           }), t.appendChild(e), document.body.appendChild(t)
        },
        status: function (t) {
           var e = this.createEls("div", {
              className: "status"
           });
           this.insertAfter(t, e)
        },
        matchFiles: function (t, e) {
           var i = e.nextSibling;
           if (t.type.match(/image/) && "image/svg+xml" !== t.type) {
              document.body.classList.add("busy"), i.classList.remove("bg-success", "bg-danger"), i.innerHTML = "";
              var n = new FormData;
              n.append("image", t), this.post(this.endpoint, n, function (t) {
                 document.body.classList.remove("busy"), "function" == typeof this.callback && this.callback.call(this, t)
              }.bind(this))
           } else i.classList.remove("bg-success"), i.classList.add("bg-danger"), i.innerHTML = "Invalid archive"
        },
        upload: function (i) {
           var e, n, a, s;
           i.addEventListener("change", function (t) {
              if (t.target && "INPUT" === t.target.nodeName && "file" === t.target.type)
                 for (n = t.target.files, a = 0, s = n.length; a < s; a += 1) e = n[a], this.matchFiles(e, i)
           }.bind(this), !1), ["dragenter", "dragleave", "dragover", "drop"].map(function (e) {
              i.addEventListener(e, function (t) {
                 t.target && "INPUT" === t.target.nodeName && "file" === t.target.type && ("dragleave" === e || "drop" === e ? t.target.parentNode.classList.remove("dropzone-dragging") : t.target.parentNode.classList.add("dropzone-dragging"))
              }, !1)
           })
        },
        run: function () {
           document.querySelector(".loading-modal") || this.loading(), this.createDragZone()
        }
     }, e
  });