siam-ui-utils 3.0.31 → 3.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CustomBootstrap.js +9 -0
- package/dist/CustomBootstrap.js.map +1 -0
- package/dist/_virtual/_commonjsHelpers.js +7 -0
- package/dist/_virtual/_commonjsHelpers.js.map +1 -0
- package/dist/_virtual/events.js +6 -0
- package/dist/_virtual/events.js.map +1 -0
- package/dist/_virtual/events2.js +5 -0
- package/dist/_virtual/events2.js.map +1 -0
- package/dist/_virtual/index.js +8 -0
- package/dist/_virtual/index.js.map +1 -0
- package/dist/_virtual/index2.js +5 -0
- package/dist/_virtual/index2.js.map +1 -0
- package/dist/_virtual/react-dropzone.js +8 -0
- package/dist/_virtual/react-dropzone.js.map +1 -0
- package/dist/_virtual/react-dropzone2.js +5 -0
- package/dist/_virtual/react-dropzone2.js.map +1 -0
- package/dist/assets/img/copiar.png.js +5 -0
- package/dist/assets/img/copiar.png.js.map +1 -0
- package/dist/assets/img/take-photo.jpg.js +5 -0
- package/dist/assets/img/take-photo.jpg.js.map +1 -0
- package/dist/constants.js +9 -0
- package/dist/constants.js.map +1 -0
- package/dist/copy-link/index.js +60 -0
- package/dist/copy-link/index.js.map +1 -0
- package/dist/copy-link/styles.css +38 -0
- package/dist/custom-input/CustomInputCheckbox.js +35 -0
- package/dist/custom-input/CustomInputCheckbox.js.map +1 -0
- package/dist/custom-input/CustomInputCurrency.js +84 -0
- package/dist/custom-input/CustomInputCurrency.js.map +1 -0
- package/dist/custom-input/CustomInputFile.js +45 -0
- package/dist/custom-input/CustomInputFile.js.map +1 -0
- package/dist/custom-input/CustomInputRadio.js +66 -0
- package/dist/custom-input/CustomInputRadio.js.map +1 -0
- package/dist/custom-input/constant.js +5 -0
- package/dist/custom-input/constant.js.map +1 -0
- package/dist/custom-input/index.css +167 -0
- package/dist/custom-input/index.js +12 -0
- package/dist/custom-input/index.js.map +1 -0
- package/dist/drag-and-dropzone/config.js +59 -0
- package/dist/drag-and-dropzone/config.js.map +1 -0
- package/dist/drag-and-dropzone/index.css +276 -0
- package/dist/drag-and-dropzone/index.js +39 -0
- package/dist/drag-and-dropzone/index.js.map +1 -0
- package/dist/dropzone/Input.js +77 -0
- package/dist/dropzone/Input.js.map +1 -0
- package/dist/dropzone/Layout.js +50 -0
- package/dist/dropzone/Layout.js.map +1 -0
- package/dist/dropzone/Preview.js +117 -0
- package/dist/dropzone/Preview.js.map +1 -0
- package/dist/dropzone/SubmitButton.js +34 -0
- package/dist/dropzone/SubmitButton.js.map +1 -0
- package/dist/dropzone/assets/cancel.svg.js +5 -0
- package/dist/dropzone/assets/cancel.svg.js.map +1 -0
- package/dist/dropzone/assets/remove.svg.js +5 -0
- package/dist/dropzone/assets/remove.svg.js.map +1 -0
- package/dist/dropzone/assets/restart.svg.js +5 -0
- package/dist/dropzone/assets/restart.svg.js.map +1 -0
- package/dist/dropzone/index.js +514 -0
- package/dist/dropzone/index.js.map +1 -0
- package/dist/dropzone/utils.js +93 -0
- package/dist/dropzone/utils.js.map +1 -0
- package/dist/dropzone-uploader/base/index.css +207 -0
- package/dist/dropzone-uploader/base/index.js +135 -0
- package/dist/dropzone-uploader/base/index.js.map +1 -0
- package/dist/dropzone-uploader/index.js +7 -0
- package/dist/dropzone-uploader/index.js.map +1 -0
- package/dist/dropzone-uploader/styled/index.css +348 -0
- package/dist/dropzone-uploader/styled/index.js +148 -0
- package/dist/dropzone-uploader/styled/index.js.map +1 -0
- package/dist/iconos/constants-svg.js +666 -0
- package/dist/iconos/constants-svg.js.map +1 -0
- package/dist/iconos/icon-button-svg.js +50 -0
- package/dist/iconos/icon-button-svg.js.map +1 -0
- package/dist/iconos/index.js +24 -0
- package/dist/iconos/index.js.map +1 -0
- package/dist/iconos/styled-icon.js +26 -0
- package/dist/iconos/styled-icon.js.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/intl-messages/index.js +11 -0
- package/dist/intl-messages/index.js.map +1 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +8 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js.map +1 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/extends.js +13 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/extends.js.map +1 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +8 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js.map +1 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +13 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js.map +1 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +9 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js.map +1 -0
- package/dist/node_modules/classnames/index.js +62 -0
- package/dist/node_modules/classnames/index.js.map +1 -0
- package/dist/node_modules/dom-helpers/esm/addClass.js +10 -0
- package/dist/node_modules/dom-helpers/esm/addClass.js.map +1 -0
- package/dist/node_modules/dom-helpers/esm/hasClass.js +8 -0
- package/dist/node_modules/dom-helpers/esm/hasClass.js.map +1 -0
- package/dist/node_modules/dom-helpers/esm/removeClass.js +16 -0
- package/dist/node_modules/dom-helpers/esm/removeClass.js.map +1 -0
- package/dist/node_modules/events/events.js +372 -0
- package/dist/node_modules/events/events.js.map +1 -0
- package/dist/node_modules/react-dropzone-component/dist/react-dropzone.js +1023 -0
- package/dist/node_modules/react-dropzone-component/dist/react-dropzone.js.map +1 -0
- package/dist/node_modules/react-multi-select-component/dist/esm/index.js +178 -0
- package/dist/node_modules/react-multi-select-component/dist/esm/index.js.map +1 -0
- package/dist/node_modules/react-transition-group/esm/CSSTransition.js +275 -0
- package/dist/node_modules/react-transition-group/esm/CSSTransition.js.map +1 -0
- package/dist/node_modules/react-transition-group/esm/Transition.js +441 -0
- package/dist/node_modules/react-transition-group/esm/Transition.js.map +1 -0
- package/dist/node_modules/react-transition-group/esm/TransitionGroup.js +146 -0
- package/dist/node_modules/react-transition-group/esm/TransitionGroup.js.map +1 -0
- package/dist/node_modules/react-transition-group/esm/TransitionGroupContext.js +6 -0
- package/dist/node_modules/react-transition-group/esm/TransitionGroupContext.js.map +1 -0
- package/dist/node_modules/react-transition-group/esm/config.js +7 -0
- package/dist/node_modules/react-transition-group/esm/config.js.map +1 -0
- package/dist/node_modules/react-transition-group/esm/utils/ChildMapping.js +100 -0
- package/dist/node_modules/react-transition-group/esm/utils/ChildMapping.js.map +1 -0
- package/dist/node_modules/react-transition-group/esm/utils/PropTypes.js +24 -0
- package/dist/node_modules/react-transition-group/esm/utils/PropTypes.js.map +1 -0
- package/dist/node_modules/react-transition-group/esm/utils/reflow.js +7 -0
- package/dist/node_modules/react-transition-group/esm/utils/reflow.js.map +1 -0
- package/dist/react-notifications/Notification.js +73 -0
- package/dist/react-notifications/Notification.js.map +1 -0
- package/dist/react-notifications/NotificationContainer.js +59 -0
- package/dist/react-notifications/NotificationContainer.js.map +1 -0
- package/dist/react-notifications/NotificationManager.js +174 -0
- package/dist/react-notifications/NotificationManager.js.map +1 -0
- package/dist/react-notifications/Notifications.js +72 -0
- package/dist/react-notifications/Notifications.js.map +1 -0
- package/dist/react-notifications/constants.js +26 -0
- package/dist/react-notifications/constants.js.map +1 -0
- package/dist/react-notifications/index.js +11 -0
- package/dist/react-notifications/index.js.map +1 -0
- package/dist/react-notifications/notifications.css +213 -0
- package/dist/select/custom-select/constants.js +8 -0
- package/dist/select/custom-select/constants.js.map +1 -0
- package/dist/select/custom-select/index.js +90 -0
- package/dist/select/custom-select/index.js.map +1 -0
- package/dist/select/custom-select-input/index.js +12 -0
- package/dist/select/custom-select-input/index.js.map +1 -0
- package/dist/select/index.js +9 -0
- package/dist/select/index.js.map +1 -0
- package/dist/select/multi-select/badge-label-multi-select.js +29 -0
- package/dist/select/multi-select/badge-label-multi-select.js.map +1 -0
- package/dist/select/multi-select/index.css +24 -0
- package/dist/select/multi-select/index.js +62 -0
- package/dist/select/multi-select/index.js.map +1 -0
- package/dist/select/multi-select/styled-component.js +24 -0
- package/dist/select/multi-select/styled-component.js.map +1 -0
- package/dist/timer/index.js +60 -0
- package/dist/timer/index.js.map +1 -0
- package/dist/timer/styles.css +59 -0
- package/dist/tomar-foto/index.js +62 -0
- package/dist/tomar-foto/index.js.map +1 -0
- package/dist/view-layout/button-editor.js +14 -0
- package/dist/view-layout/button-editor.js.map +1 -0
- package/dist/view-layout/constants.js +11 -0
- package/dist/view-layout/constants.js.map +1 -0
- package/dist/view-layout/editor-layer.js +28 -0
- package/dist/view-layout/editor-layer.js.map +1 -0
- package/dist/view-layout/index.js +53 -0
- package/dist/view-layout/index.js.map +1 -0
- package/dist/view-layout/slot-wrapper.js +39 -0
- package/dist/view-layout/slot-wrapper.js.map +1 -0
- package/dist/view-layout/styles.css +127 -0
- package/dist/where-by-room/index.js +20 -0
- package/dist/where-by-room/index.js.map +1 -0
- package/dist/where-by-room/room.js +78 -0
- package/dist/where-by-room/room.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,1023 @@
|
|
|
1
|
+
import { __module as reactDropzone$1 } from "../../../_virtual/react-dropzone2.js";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import ReactDOM from "react-dom";
|
|
4
|
+
var reactDropzone = reactDropzone$1.exports;
|
|
5
|
+
var hasRequiredReactDropzone;
|
|
6
|
+
function requireReactDropzone() {
|
|
7
|
+
if (hasRequiredReactDropzone) return reactDropzone$1.exports;
|
|
8
|
+
hasRequiredReactDropzone = 1;
|
|
9
|
+
(function(module, exports$1) {
|
|
10
|
+
!(function(e, t) {
|
|
11
|
+
module.exports = t(React, ReactDOM);
|
|
12
|
+
})("undefined" != typeof self ? self : reactDropzone, function(e, t) {
|
|
13
|
+
return (function(e2) {
|
|
14
|
+
function t2(i) {
|
|
15
|
+
if (n[i]) return n[i].exports;
|
|
16
|
+
var r = n[i] = { i, l: false, exports: {} };
|
|
17
|
+
return e2[i].call(r.exports, r, r.exports, t2), r.l = true, r.exports;
|
|
18
|
+
}
|
|
19
|
+
var n = {};
|
|
20
|
+
return t2.m = e2, t2.c = n, t2.d = function(e3, n2, i) {
|
|
21
|
+
t2.o(e3, n2) || Object.defineProperty(e3, n2, { configurable: false, enumerable: true, get: i });
|
|
22
|
+
}, t2.n = function(e3) {
|
|
23
|
+
var n2 = e3 && e3.__esModule ? function() {
|
|
24
|
+
return e3.default;
|
|
25
|
+
} : function() {
|
|
26
|
+
return e3;
|
|
27
|
+
};
|
|
28
|
+
return t2.d(n2, "a", n2), n2;
|
|
29
|
+
}, t2.o = function(e3, t3) {
|
|
30
|
+
return Object.prototype.hasOwnProperty.call(e3, t3);
|
|
31
|
+
}, t2.p = "", t2(t2.s = 1);
|
|
32
|
+
})([function(t2, n) {
|
|
33
|
+
t2.exports = e;
|
|
34
|
+
}, function(e2, t2, n) {
|
|
35
|
+
function i(e3) {
|
|
36
|
+
return e3 && e3.__esModule ? e3 : { default: e3 };
|
|
37
|
+
}
|
|
38
|
+
Object.defineProperty(t2, "__esModule", { value: true }), t2.DropzoneComponent = void 0;
|
|
39
|
+
var r = /* @__PURE__ */ (function() {
|
|
40
|
+
function e3(e4, t3) {
|
|
41
|
+
for (var n2 = 0; n2 < t3.length; n2++) {
|
|
42
|
+
var i2 = t3[n2];
|
|
43
|
+
i2.enumerable = i2.enumerable || false, i2.configurable = true, "value" in i2 && (i2.writable = true), Object.defineProperty(e4, i2.key, i2);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return function(t3, n2, i2) {
|
|
47
|
+
return n2 && e3(t3.prototype, n2), i2 && e3(t3, i2), t3;
|
|
48
|
+
};
|
|
49
|
+
})(), o = i(n(0)), s = i(n(2)), a = i(n(3)), l = n(4), u = null, c = t2.DropzoneComponent = (function(e3) {
|
|
50
|
+
function t3(e4) {
|
|
51
|
+
!(function(e5, t4) {
|
|
52
|
+
if (!(e5 instanceof t4)) throw new TypeError("Cannot call a class as a function");
|
|
53
|
+
})(this, t3);
|
|
54
|
+
var n2 = (function(e5, t4) {
|
|
55
|
+
if (!e5) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
56
|
+
return !t4 || "object" != typeof t4 && "function" != typeof t4 ? e5 : t4;
|
|
57
|
+
})(this, (t3.__proto__ || Object.getPrototypeOf(t3)).call(this, e4));
|
|
58
|
+
return n2.state = { files: [] }, n2;
|
|
59
|
+
}
|
|
60
|
+
return (function(e4, t4) {
|
|
61
|
+
if ("function" != typeof t4 && null !== t4) throw new TypeError("Super expression must either be null or a function, not " + typeof t4);
|
|
62
|
+
e4.prototype = Object.create(t4 && t4.prototype, { constructor: { value: e4, enumerable: false, writable: true, configurable: true } }), t4 && (Object.setPrototypeOf ? Object.setPrototypeOf(e4, t4) : e4.__proto__ = t4);
|
|
63
|
+
})(t3, o.default.Component), r(t3, [{ key: "getDjsConfig", value: function() {
|
|
64
|
+
var e4 = { url: this.props.config.postUrl ? this.props.config.postUrl : null };
|
|
65
|
+
return this.props.djsConfig ? (0, a.default)(true, {}, e4, this.props.djsConfig) : e4;
|
|
66
|
+
} }, { key: "componentDidMount", value: function() {
|
|
67
|
+
var e4 = this.getDjsConfig();
|
|
68
|
+
(u = u || n(5)).autoDiscover = false, this.props.config.postUrl || this.props.eventHandlers.drop || console.info('Neither postUrl nor a "drop" eventHandler specified, the React-Dropzone component might misbehave.');
|
|
69
|
+
var t4 = this.props.config.dropzoneSelector || s.default.findDOMNode(this);
|
|
70
|
+
this.dropzone = new u(t4, e4), this.setupEvents();
|
|
71
|
+
} }, { key: "componentWillUnmount", value: function() {
|
|
72
|
+
var e4 = this;
|
|
73
|
+
if (this.dropzone) if (this.dropzone.getActiveFiles().length > 0) {
|
|
74
|
+
this.queueDestroy = true;
|
|
75
|
+
var t4 = window.setInterval(function() {
|
|
76
|
+
return false === e4.queueDestroy ? window.clearInterval(t4) : 0 === e4.dropzone.getActiveFiles().length ? (e4.dropzone = e4.destroy(e4.dropzone), window.clearInterval(t4)) : void 0;
|
|
77
|
+
}, 500);
|
|
78
|
+
} else this.dropzone = this.destroy(this.dropzone);
|
|
79
|
+
} }, { key: "componentDidUpdate", value: function() {
|
|
80
|
+
if (this.queueDestroy = false, !this.dropzone) {
|
|
81
|
+
var e4 = this.props.config.dropzoneSelector || s.default.findDOMNode(this);
|
|
82
|
+
this.dropzone = new u(e4, this.getDjsConfig());
|
|
83
|
+
}
|
|
84
|
+
} }, { key: "componentWillUpdate", value: function() {
|
|
85
|
+
var e4, t4 = void 0;
|
|
86
|
+
e4 = this.props.djsConfig ? this.props.djsConfig : {};
|
|
87
|
+
try {
|
|
88
|
+
t4 = this.props.config.postUrl ? { url: this.props.config.postUrl } : {};
|
|
89
|
+
} catch (e5) {
|
|
90
|
+
t4 = {};
|
|
91
|
+
}
|
|
92
|
+
this.dropzone.options = (0, a.default)(true, {}, this.dropzone.options, e4, t4);
|
|
93
|
+
} }, { key: "render", value: function() {
|
|
94
|
+
var e4 = [], t4 = this.state.files, n2 = this.props.config, i2 = this.props.className ? "filepicker dropzone " + this.props.className : "filepicker dropzone";
|
|
95
|
+
if (n2.showFiletypeIcon && n2.iconFiletypes && (!t4 || t4.length < 1)) for (var r2 = 0; r2 < this.props.config.iconFiletypes.length; r2 += 1) e4.push(o.default.createElement(l.Icon, { filetype: n2.iconFiletypes[r2], key: "icon-component" + r2 }));
|
|
96
|
+
return !this.props.config.postUrl && this.props.action ? o.default.createElement("form", { action: this.props.action, className: i2 }, e4, this.props.children) : o.default.createElement("div", { className: i2 }, " ", e4, " ", this.props.children, " ");
|
|
97
|
+
} }, { key: "setupEvents", value: function() {
|
|
98
|
+
var e4 = this, t4 = this.props.eventHandlers;
|
|
99
|
+
if (this.dropzone && t4) {
|
|
100
|
+
for (var n2 in t4) if (t4.hasOwnProperty(n2) && t4[n2]) if ("[object Array]" === Object.prototype.toString.call(t4[n2])) for (var i2 = 0; i2 < t4[n2].length; i2 += 1) "init" === n2 ? t4[n2][i2](this.dropzone) : this.dropzone.on(n2, t4[n2][i2]);
|
|
101
|
+
else "init" === n2 ? t4[n2](this.dropzone) : this.dropzone.on(n2, t4[n2]);
|
|
102
|
+
this.dropzone.on("addedfile", function(t5) {
|
|
103
|
+
if (t5) {
|
|
104
|
+
var n3 = e4.state.files || [];
|
|
105
|
+
n3.push(t5), e4.setState({ files: n3 });
|
|
106
|
+
}
|
|
107
|
+
}), this.dropzone.on("removedfile", function(t5) {
|
|
108
|
+
if (t5) {
|
|
109
|
+
var n3 = e4.state.files || [];
|
|
110
|
+
n3.forEach(function(e5, i3) {
|
|
111
|
+
e5.name === t5.name && e5.size === t5.size && n3.splice(i3, 1);
|
|
112
|
+
}), e4.setState({ files: n3 });
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
} }, { key: "destroy", value: function(e4) {
|
|
117
|
+
return e4.off(), e4.destroy();
|
|
118
|
+
} }]), t3;
|
|
119
|
+
})();
|
|
120
|
+
c.defaultProps = { djsConfig: {}, config: {}, eventHandlers: {} }, t2.default = c;
|
|
121
|
+
}, function(e2, n) {
|
|
122
|
+
e2.exports = t;
|
|
123
|
+
}, function(e2, t2, n) {
|
|
124
|
+
var i = Object.prototype.hasOwnProperty, r = Object.prototype.toString, o = function(e3) {
|
|
125
|
+
return "function" == typeof Array.isArray ? Array.isArray(e3) : "[object Array]" === r.call(e3);
|
|
126
|
+
}, s = function(e3) {
|
|
127
|
+
if (!e3 || "[object Object]" !== r.call(e3)) return false;
|
|
128
|
+
var t3, n2 = i.call(e3, "constructor"), o2 = e3.constructor && e3.constructor.prototype && i.call(e3.constructor.prototype, "isPrototypeOf");
|
|
129
|
+
if (e3.constructor && !n2 && !o2) return false;
|
|
130
|
+
for (t3 in e3) ;
|
|
131
|
+
return void 0 === t3 || i.call(e3, t3);
|
|
132
|
+
};
|
|
133
|
+
e2.exports = function e3() {
|
|
134
|
+
var t3, n2, i2, r2, a, l, u = arguments[0], c = 1, d = arguments.length, p = false;
|
|
135
|
+
for ("boolean" == typeof u && (p = u, u = arguments[1] || {}, c = 2), (null == u || "object" != typeof u && "function" != typeof u) && (u = {}); c < d; ++c) if (null != (t3 = arguments[c])) for (n2 in t3) i2 = u[n2], u !== (r2 = t3[n2]) && (p && r2 && (s(r2) || (a = o(r2))) ? (a ? (a = false, l = i2 && o(i2) ? i2 : []) : l = i2 && s(i2) ? i2 : {}, u[n2] = e3(p, l, r2)) : void 0 !== r2 && (u[n2] = r2));
|
|
136
|
+
return u;
|
|
137
|
+
};
|
|
138
|
+
}, function(e2, t2, n) {
|
|
139
|
+
Object.defineProperty(t2, "__esModule", { value: true }), t2.Icon = void 0;
|
|
140
|
+
var i, r = n(0), o = (i = r) && i.__esModule ? i : { default: i };
|
|
141
|
+
t2.Icon = function(e3) {
|
|
142
|
+
return o.default.createElement("div", { "data-filetype": e3.filetype, className: "filepicker-file-icon" });
|
|
143
|
+
};
|
|
144
|
+
}, function(e2, t2, n) {
|
|
145
|
+
(function(e3) {
|
|
146
|
+
function t3(e4, t4) {
|
|
147
|
+
if (!e4) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
148
|
+
return !t4 || "object" != typeof t4 && "function" != typeof t4 ? e4 : t4;
|
|
149
|
+
}
|
|
150
|
+
function n2(e4, t4) {
|
|
151
|
+
if (!(e4 instanceof t4)) throw new TypeError("Cannot call a class as a function");
|
|
152
|
+
}
|
|
153
|
+
var i = /* @__PURE__ */ (function() {
|
|
154
|
+
function e4(e5, t4) {
|
|
155
|
+
for (var n3 = 0; n3 < t4.length; n3++) {
|
|
156
|
+
var i2 = t4[n3];
|
|
157
|
+
i2.enumerable = i2.enumerable || false, i2.configurable = true, "value" in i2 && (i2.writable = true), Object.defineProperty(e5, i2.key, i2);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return function(t4, n3, i2) {
|
|
161
|
+
return n3 && e4(t4.prototype, n3), i2 && e4(t4, i2), t4;
|
|
162
|
+
};
|
|
163
|
+
})(), r = (function() {
|
|
164
|
+
function e4() {
|
|
165
|
+
n2(this, e4);
|
|
166
|
+
}
|
|
167
|
+
return i(e4, [{ key: "on", value: function(e5, t4) {
|
|
168
|
+
return this._callbacks = this._callbacks || {}, this._callbacks[e5] || (this._callbacks[e5] = []), this._callbacks[e5].push(t4), this;
|
|
169
|
+
} }, { key: "emit", value: function(e5) {
|
|
170
|
+
this._callbacks = this._callbacks || {};
|
|
171
|
+
var t4 = this._callbacks[e5];
|
|
172
|
+
if (t4) {
|
|
173
|
+
for (var n3 = arguments.length, i2 = Array(n3 > 1 ? n3 - 1 : 0), r2 = 1; r2 < n3; r2++) i2[r2 - 1] = arguments[r2];
|
|
174
|
+
for (var o2 = 0, s2 = s2 = t4; !(o2 >= s2.length); ) s2[o2++].apply(this, i2);
|
|
175
|
+
}
|
|
176
|
+
return this;
|
|
177
|
+
} }, { key: "off", value: function(e5, t4) {
|
|
178
|
+
if (!this._callbacks || 0 === arguments.length) return this._callbacks = {}, this;
|
|
179
|
+
var n3 = this._callbacks[e5];
|
|
180
|
+
if (!n3) return this;
|
|
181
|
+
if (1 === arguments.length) return delete this._callbacks[e5], this;
|
|
182
|
+
for (var i2 = 0; i2 < n3.length; i2++) if (n3[i2] === t4) {
|
|
183
|
+
n3.splice(i2, 1);
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
return this;
|
|
187
|
+
} }]), e4;
|
|
188
|
+
})(), o = (function(e4) {
|
|
189
|
+
function o2(e5, i2) {
|
|
190
|
+
n2(this, o2);
|
|
191
|
+
var r2, s2 = t3(this, (o2.__proto__ || Object.getPrototypeOf(o2)).call(this)), a2 = void 0;
|
|
192
|
+
if (s2.element = e5, s2.version = o2.version, s2.defaultOptions.previewTemplate = s2.defaultOptions.previewTemplate.replace(/\n*/g, ""), s2.clickableElements = [], s2.listeners = [], s2.files = [], "string" == typeof s2.element && (s2.element = document.querySelector(s2.element)), !s2.element || null == s2.element.nodeType) throw new Error("Invalid dropzone element.");
|
|
193
|
+
if (s2.element.dropzone) throw new Error("Dropzone already attached.");
|
|
194
|
+
o2.instances.push(s2), s2.element.dropzone = s2;
|
|
195
|
+
var l2, u2 = null != (r2 = o2.optionsForElement(s2.element)) ? r2 : {};
|
|
196
|
+
if (s2.options = o2.extend({}, s2.defaultOptions, u2, null != i2 ? i2 : {}), s2.options.forceFallback || !o2.isBrowserSupported()) return l2 = s2.options.fallback.call(s2), t3(s2, l2);
|
|
197
|
+
if (null == s2.options.url && (s2.options.url = s2.element.getAttribute("action")), !s2.options.url) throw new Error("No URL provided.");
|
|
198
|
+
if (s2.options.acceptedFiles && s2.options.acceptedMimeTypes) throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");
|
|
199
|
+
if (s2.options.uploadMultiple && s2.options.chunking) throw new Error("You cannot set both: uploadMultiple and chunking.");
|
|
200
|
+
return s2.options.acceptedMimeTypes && (s2.options.acceptedFiles = s2.options.acceptedMimeTypes, delete s2.options.acceptedMimeTypes), null != s2.options.renameFilename && (s2.options.renameFile = function(e6) {
|
|
201
|
+
return s2.options.renameFilename.call(s2, e6.name, e6);
|
|
202
|
+
}), s2.options.method = s2.options.method.toUpperCase(), (a2 = s2.getExistingFallback()) && a2.parentNode && a2.parentNode.removeChild(a2), false !== s2.options.previewsContainer && (s2.options.previewsContainer ? s2.previewsContainer = o2.getElement(s2.options.previewsContainer, "previewsContainer") : s2.previewsContainer = s2.element), s2.options.clickable && (true === s2.options.clickable ? s2.clickableElements = [s2.element] : s2.clickableElements = o2.getElements(s2.options.clickable, "clickable")), s2.init(), s2;
|
|
203
|
+
}
|
|
204
|
+
return (function(e5, t4) {
|
|
205
|
+
if ("function" != typeof t4 && null !== t4) throw new TypeError("Super expression must either be null or a function, not " + typeof t4);
|
|
206
|
+
e5.prototype = Object.create(t4 && t4.prototype, { constructor: { value: e5, enumerable: false, writable: true, configurable: true } }), t4 && (Object.setPrototypeOf ? Object.setPrototypeOf(e5, t4) : e5.__proto__ = t4);
|
|
207
|
+
})(o2, r), i(o2, null, [{ key: "initClass", value: function() {
|
|
208
|
+
this.prototype.Emitter = r, this.prototype.events = ["drop", "dragstart", "dragend", "dragenter", "dragover", "dragleave", "addedfile", "addedfiles", "removedfile", "thumbnail", "error", "errormultiple", "processing", "processingmultiple", "uploadprogress", "totaluploadprogress", "sending", "sendingmultiple", "success", "successmultiple", "canceled", "canceledmultiple", "complete", "completemultiple", "reset", "maxfilesexceeded", "maxfilesreached", "queuecomplete"], this.prototype.defaultOptions = { url: null, method: "post", withCredentials: false, timeout: 3e4, parallelUploads: 2, uploadMultiple: false, chunking: false, forceChunking: false, chunkSize: 2e6, parallelChunkUploads: false, retryChunks: false, retryChunksLimit: 3, maxFilesize: 256, paramName: "file", createImageThumbnails: true, maxThumbnailFilesize: 10, thumbnailWidth: 120, thumbnailHeight: 120, thumbnailMethod: "crop", resizeWidth: null, resizeHeight: null, resizeMimeType: null, resizeQuality: 0.8, resizeMethod: "contain", filesizeBase: 1e3, maxFiles: null, headers: null, clickable: true, ignoreHiddenFiles: true, acceptedFiles: null, acceptedMimeTypes: null, autoProcessQueue: true, autoQueue: true, addRemoveLinks: false, previewsContainer: null, hiddenInputContainer: "body", capture: null, renameFilename: null, renameFile: null, forceFallback: false, dictDefaultMessage: "Drop files here to upload", dictFallbackMessage: "Your browser does not support drag'n'drop file uploads.", dictFallbackText: "Please use the fallback form below to upload your files like in the olden days.", dictFileTooBig: "File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.", dictInvalidFileType: "You can't upload files of this type.", dictResponseError: "Server responded with {{statusCode}} code.", dictCancelUpload: "Cancel upload", dictUploadCanceled: "Upload canceled.", dictCancelUploadConfirmation: "Are you sure you want to cancel this upload?", dictRemoveFile: "Remove file", dictRemoveFileConfirmation: null, dictMaxFilesExceeded: "You can not upload any more files.", dictFileSizeUnits: { tb: "TB", gb: "GB", mb: "MB", kb: "KB", b: "b" }, init: function() {
|
|
209
|
+
}, params: function(e5, t4, n3) {
|
|
210
|
+
if (n3) return { dzuuid: n3.file.upload.uuid, dzchunkindex: n3.index, dztotalfilesize: n3.file.size, dzchunksize: this.options.chunkSize, dztotalchunkcount: n3.file.upload.totalChunkCount, dzchunkbyteoffset: n3.index * this.options.chunkSize };
|
|
211
|
+
}, accept: function(e5, t4) {
|
|
212
|
+
return t4();
|
|
213
|
+
}, chunksUploaded: function(e5, t4) {
|
|
214
|
+
t4();
|
|
215
|
+
}, fallback: function() {
|
|
216
|
+
var e5 = void 0;
|
|
217
|
+
this.element.className = this.element.className + " dz-browser-not-supported";
|
|
218
|
+
for (var t4 = 0, n3 = n3 = this.element.getElementsByTagName("div"); !(t4 >= n3.length); ) {
|
|
219
|
+
var i2 = n3[t4++];
|
|
220
|
+
if (/(^| )dz-message($| )/.test(i2.className)) {
|
|
221
|
+
e5 = i2, i2.className = "dz-message";
|
|
222
|
+
break;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
e5 || (e5 = o2.createElement('<div class="dz-message"><span></span></div>'), this.element.appendChild(e5));
|
|
226
|
+
var r2 = e5.getElementsByTagName("span")[0];
|
|
227
|
+
return r2 && (null != r2.textContent ? r2.textContent = this.options.dictFallbackMessage : null != r2.innerText && (r2.innerText = this.options.dictFallbackMessage)), this.element.appendChild(this.getFallbackForm());
|
|
228
|
+
}, resize: function(e5, t4, n3, i2) {
|
|
229
|
+
var r2 = { srcX: 0, srcY: 0, srcWidth: e5.width, srcHeight: e5.height }, o3 = e5.width / e5.height;
|
|
230
|
+
null == t4 && null == n3 ? (t4 = r2.srcWidth, n3 = r2.srcHeight) : null == t4 ? t4 = n3 * o3 : null == n3 && (n3 = t4 / o3);
|
|
231
|
+
var s2 = (t4 = Math.min(t4, r2.srcWidth)) / (n3 = Math.min(n3, r2.srcHeight));
|
|
232
|
+
if (r2.srcWidth > t4 || r2.srcHeight > n3) if ("crop" === i2) o3 > s2 ? (r2.srcHeight = e5.height, r2.srcWidth = r2.srcHeight * s2) : (r2.srcWidth = e5.width, r2.srcHeight = r2.srcWidth / s2);
|
|
233
|
+
else {
|
|
234
|
+
if ("contain" !== i2) throw new Error("Unknown resizeMethod '" + i2 + "'");
|
|
235
|
+
o3 > s2 ? n3 = t4 / o3 : t4 = n3 * o3;
|
|
236
|
+
}
|
|
237
|
+
return r2.srcX = (e5.width - r2.srcWidth) / 2, r2.srcY = (e5.height - r2.srcHeight) / 2, r2.trgWidth = t4, r2.trgHeight = n3, r2;
|
|
238
|
+
}, transformFile: function(e5, t4) {
|
|
239
|
+
return (this.options.resizeWidth || this.options.resizeHeight) && e5.type.match(/image.*/) ? this.resizeImage(e5, this.options.resizeWidth, this.options.resizeHeight, this.options.resizeMethod, t4) : t4(e5);
|
|
240
|
+
}, previewTemplate: '<div class="dz-preview dz-file-preview">\n <div class="dz-image"><img data-dz-thumbnail /></div>\n <div class="dz-details">\n <div class="dz-size"><span data-dz-size></span></div>\n <div class="dz-filename"><span data-dz-name></span></div>\n </div>\n <div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div>\n <div class="dz-error-message"><span data-dz-errormessage></span></div>\n <div class="dz-success-mark">\n <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">\n <title>Check</title>\n <defs></defs>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">\n <path d="M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" id="Oval-2" stroke-opacity="0.198794158" stroke="#747474" fill-opacity="0.816519475" fill="#FFFFFF" sketch:type="MSShapeGroup"></path>\n </g>\n </svg>\n </div>\n <div class="dz-error-mark">\n <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">\n <title>Error</title>\n <defs></defs>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">\n <g id="Check-+-Oval-2" sketch:type="MSLayerGroup" stroke="#747474" stroke-opacity="0.198794158" fill="#FFFFFF" fill-opacity="0.816519475">\n <path d="M32.6568542,29 L38.3106978,23.3461564 C39.8771021,21.7797521 39.8758057,19.2483887 38.3137085,17.6862915 C36.7547899,16.1273729 34.2176035,16.1255422 32.6538436,17.6893022 L27,23.3431458 L21.3461564,17.6893022 C19.7823965,16.1255422 17.2452101,16.1273729 15.6862915,17.6862915 C14.1241943,19.2483887 14.1228979,21.7797521 15.6893022,23.3461564 L21.3431458,29 L15.6893022,34.6538436 C14.1228979,36.2202479 14.1241943,38.7516113 15.6862915,40.3137085 C17.2452101,41.8726271 19.7823965,41.8744578 21.3461564,40.3106978 L27,34.6568542 L32.6538436,40.3106978 C34.2176035,41.8744578 36.7547899,41.8726271 38.3137085,40.3137085 C39.8758057,38.7516113 39.8771021,36.2202479 38.3106978,34.6538436 L32.6568542,29 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" id="Oval-2" sketch:type="MSShapeGroup"></path>\n </g>\n </g>\n </svg>\n </div>\n</div>', drop: function(e5) {
|
|
241
|
+
return this.element.classList.remove("dz-drag-hover");
|
|
242
|
+
}, dragstart: function(e5) {
|
|
243
|
+
}, dragend: function(e5) {
|
|
244
|
+
return this.element.classList.remove("dz-drag-hover");
|
|
245
|
+
}, dragenter: function(e5) {
|
|
246
|
+
return this.element.classList.add("dz-drag-hover");
|
|
247
|
+
}, dragover: function(e5) {
|
|
248
|
+
return this.element.classList.add("dz-drag-hover");
|
|
249
|
+
}, dragleave: function(e5) {
|
|
250
|
+
return this.element.classList.remove("dz-drag-hover");
|
|
251
|
+
}, paste: function(e5) {
|
|
252
|
+
}, reset: function() {
|
|
253
|
+
return this.element.classList.remove("dz-started");
|
|
254
|
+
}, addedfile: function(e5) {
|
|
255
|
+
var t4 = this;
|
|
256
|
+
if (this.element === this.previewsContainer && this.element.classList.add("dz-started"), this.previewsContainer) {
|
|
257
|
+
e5.previewElement = o2.createElement(this.options.previewTemplate.trim()), e5.previewTemplate = e5.previewElement, this.previewsContainer.appendChild(e5.previewElement);
|
|
258
|
+
for (var n3 = 0, i2 = i2 = e5.previewElement.querySelectorAll("[data-dz-name]"); !(n3 >= i2.length); ) {
|
|
259
|
+
var r2 = i2[n3++];
|
|
260
|
+
r2.textContent = e5.name;
|
|
261
|
+
}
|
|
262
|
+
for (var s2 = 0, a2 = a2 = e5.previewElement.querySelectorAll("[data-dz-size]"); !(s2 >= a2.length); ) (r2 = a2[s2++]).innerHTML = this.filesize(e5.size);
|
|
263
|
+
this.options.addRemoveLinks && (e5._removeLink = o2.createElement('<a class="dz-remove" href="javascript:undefined;" data-dz-remove>' + this.options.dictRemoveFile + "</a>"), e5.previewElement.appendChild(e5._removeLink));
|
|
264
|
+
for (var l2 = function(n4) {
|
|
265
|
+
return n4.preventDefault(), n4.stopPropagation(), e5.status === o2.UPLOADING ? o2.confirm(t4.options.dictCancelUploadConfirmation, function() {
|
|
266
|
+
return t4.removeFile(e5);
|
|
267
|
+
}) : t4.options.dictRemoveFileConfirmation ? o2.confirm(t4.options.dictRemoveFileConfirmation, function() {
|
|
268
|
+
return t4.removeFile(e5);
|
|
269
|
+
}) : t4.removeFile(e5);
|
|
270
|
+
}, u2 = 0, c = c = e5.previewElement.querySelectorAll("[data-dz-remove]"); !(u2 >= c.length); ) c[u2++].addEventListener("click", l2);
|
|
271
|
+
}
|
|
272
|
+
}, removedfile: function(e5) {
|
|
273
|
+
return null != e5.previewElement && null != e5.previewElement.parentNode && e5.previewElement.parentNode.removeChild(e5.previewElement), this._updateMaxFilesReachedClass();
|
|
274
|
+
}, thumbnail: function(e5, t4) {
|
|
275
|
+
if (e5.previewElement) {
|
|
276
|
+
e5.previewElement.classList.remove("dz-file-preview");
|
|
277
|
+
for (var n3 = 0, i2 = i2 = e5.previewElement.querySelectorAll("[data-dz-thumbnail]"); !(n3 >= i2.length); ) {
|
|
278
|
+
var r2 = i2[n3++];
|
|
279
|
+
r2.alt = e5.name, r2.src = t4;
|
|
280
|
+
}
|
|
281
|
+
return setTimeout(function() {
|
|
282
|
+
return e5.previewElement.classList.add("dz-image-preview");
|
|
283
|
+
}, 1);
|
|
284
|
+
}
|
|
285
|
+
}, error: function(e5, t4) {
|
|
286
|
+
if (e5.previewElement) {
|
|
287
|
+
e5.previewElement.classList.add("dz-error"), "String" != typeof t4 && t4.error && (t4 = t4.error);
|
|
288
|
+
for (var n3 = 0, i2 = i2 = e5.previewElement.querySelectorAll("[data-dz-errormessage]"); !(n3 >= i2.length); ) i2[n3++].textContent = t4;
|
|
289
|
+
}
|
|
290
|
+
}, errormultiple: function() {
|
|
291
|
+
}, processing: function(e5) {
|
|
292
|
+
if (e5.previewElement && (e5.previewElement.classList.add("dz-processing"), e5._removeLink)) return e5._removeLink.textContent = this.options.dictCancelUpload;
|
|
293
|
+
}, processingmultiple: function() {
|
|
294
|
+
}, uploadprogress: function(e5, t4, n3) {
|
|
295
|
+
if (e5.previewElement) for (var i2 = 0, r2 = r2 = e5.previewElement.querySelectorAll("[data-dz-uploadprogress]"); !(i2 >= r2.length); ) {
|
|
296
|
+
var o3 = r2[i2++];
|
|
297
|
+
"PROGRESS" === o3.nodeName ? o3.value = t4 : o3.style.width = t4 + "%";
|
|
298
|
+
}
|
|
299
|
+
}, totaluploadprogress: function() {
|
|
300
|
+
}, sending: function() {
|
|
301
|
+
}, sendingmultiple: function() {
|
|
302
|
+
}, success: function(e5) {
|
|
303
|
+
if (e5.previewElement) return e5.previewElement.classList.add("dz-success");
|
|
304
|
+
}, successmultiple: function() {
|
|
305
|
+
}, canceled: function(e5) {
|
|
306
|
+
return this.emit("error", e5, this.options.dictUploadCanceled);
|
|
307
|
+
}, canceledmultiple: function() {
|
|
308
|
+
}, complete: function(e5) {
|
|
309
|
+
if (e5._removeLink && (e5._removeLink.textContent = this.options.dictRemoveFile), e5.previewElement) return e5.previewElement.classList.add("dz-complete");
|
|
310
|
+
}, completemultiple: function() {
|
|
311
|
+
}, maxfilesexceeded: function() {
|
|
312
|
+
}, maxfilesreached: function() {
|
|
313
|
+
}, queuecomplete: function() {
|
|
314
|
+
}, addedfiles: function() {
|
|
315
|
+
} }, this.prototype._thumbnailQueue = [], this.prototype._processingThumbnail = false;
|
|
316
|
+
} }, { key: "extend", value: function(e5) {
|
|
317
|
+
for (var t4 = arguments.length, n3 = Array(t4 > 1 ? t4 - 1 : 0), i2 = 1; i2 < t4; i2++) n3[i2 - 1] = arguments[i2];
|
|
318
|
+
for (var r2 = 0, o3 = o3 = n3; !(r2 >= o3.length); ) {
|
|
319
|
+
var s2 = o3[r2++];
|
|
320
|
+
for (var a2 in s2) {
|
|
321
|
+
var l2 = s2[a2];
|
|
322
|
+
e5[a2] = l2;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
return e5;
|
|
326
|
+
} }]), i(o2, [{ key: "getAcceptedFiles", value: function() {
|
|
327
|
+
return this.files.filter(function(e5) {
|
|
328
|
+
return e5.accepted;
|
|
329
|
+
}).map(function(e5) {
|
|
330
|
+
return e5;
|
|
331
|
+
});
|
|
332
|
+
} }, { key: "getRejectedFiles", value: function() {
|
|
333
|
+
return this.files.filter(function(e5) {
|
|
334
|
+
return !e5.accepted;
|
|
335
|
+
}).map(function(e5) {
|
|
336
|
+
return e5;
|
|
337
|
+
});
|
|
338
|
+
} }, { key: "getFilesWithStatus", value: function(e5) {
|
|
339
|
+
return this.files.filter(function(t4) {
|
|
340
|
+
return t4.status === e5;
|
|
341
|
+
}).map(function(e6) {
|
|
342
|
+
return e6;
|
|
343
|
+
});
|
|
344
|
+
} }, { key: "getQueuedFiles", value: function() {
|
|
345
|
+
return this.getFilesWithStatus(o2.QUEUED);
|
|
346
|
+
} }, { key: "getUploadingFiles", value: function() {
|
|
347
|
+
return this.getFilesWithStatus(o2.UPLOADING);
|
|
348
|
+
} }, { key: "getAddedFiles", value: function() {
|
|
349
|
+
return this.getFilesWithStatus(o2.ADDED);
|
|
350
|
+
} }, { key: "getActiveFiles", value: function() {
|
|
351
|
+
return this.files.filter(function(e5) {
|
|
352
|
+
return e5.status === o2.UPLOADING || e5.status === o2.QUEUED;
|
|
353
|
+
}).map(function(e5) {
|
|
354
|
+
return e5;
|
|
355
|
+
});
|
|
356
|
+
} }, { key: "init", value: function() {
|
|
357
|
+
var e5 = this;
|
|
358
|
+
"form" === this.element.tagName && this.element.setAttribute("enctype", "multipart/form-data"), this.element.classList.contains("dropzone") && !this.element.querySelector(".dz-message") && this.element.appendChild(o2.createElement('<div class="dz-default dz-message"><span>' + this.options.dictDefaultMessage + "</span></div>")), this.clickableElements.length && (function t5() {
|
|
359
|
+
return e5.hiddenFileInput && e5.hiddenFileInput.parentNode.removeChild(e5.hiddenFileInput), e5.hiddenFileInput = document.createElement("input"), e5.hiddenFileInput.setAttribute("type", "file"), (null === e5.options.maxFiles || e5.options.maxFiles > 1) && e5.hiddenFileInput.setAttribute("multiple", "multiple"), e5.hiddenFileInput.className = "dz-hidden-input", null !== e5.options.acceptedFiles && e5.hiddenFileInput.setAttribute("accept", e5.options.acceptedFiles), null !== e5.options.capture && e5.hiddenFileInput.setAttribute("capture", e5.options.capture), e5.hiddenFileInput.style.visibility = "hidden", e5.hiddenFileInput.style.position = "absolute", e5.hiddenFileInput.style.top = "0", e5.hiddenFileInput.style.left = "0", e5.hiddenFileInput.style.height = "0", e5.hiddenFileInput.style.width = "0", document.querySelector(e5.options.hiddenInputContainer).appendChild(e5.hiddenFileInput), e5.hiddenFileInput.addEventListener("change", function() {
|
|
360
|
+
var n4 = e5.hiddenFileInput.files;
|
|
361
|
+
if (n4.length) for (var i3 = 0, r3 = r3 = n4; !(i3 >= r3.length); ) {
|
|
362
|
+
var o3 = r3[i3++];
|
|
363
|
+
e5.addFile(o3);
|
|
364
|
+
}
|
|
365
|
+
return e5.emit("addedfiles", n4), t5();
|
|
366
|
+
});
|
|
367
|
+
})(), this.URL = null !== window.URL ? window.URL : window.webkitURL;
|
|
368
|
+
for (var t4 = 0, n3 = n3 = this.events; !(t4 >= n3.length); ) {
|
|
369
|
+
var i2 = n3[t4++];
|
|
370
|
+
this.on(i2, this.options[i2]);
|
|
371
|
+
}
|
|
372
|
+
this.on("uploadprogress", function() {
|
|
373
|
+
return e5.updateTotalUploadProgress();
|
|
374
|
+
}), this.on("removedfile", function() {
|
|
375
|
+
return e5.updateTotalUploadProgress();
|
|
376
|
+
}), this.on("canceled", function(t5) {
|
|
377
|
+
return e5.emit("complete", t5);
|
|
378
|
+
}), this.on("complete", function(t5) {
|
|
379
|
+
if (0 === e5.getAddedFiles().length && 0 === e5.getUploadingFiles().length && 0 === e5.getQueuedFiles().length) return setTimeout(function() {
|
|
380
|
+
return e5.emit("queuecomplete");
|
|
381
|
+
}, 0);
|
|
382
|
+
});
|
|
383
|
+
var r2 = function(e6) {
|
|
384
|
+
return e6.stopPropagation(), e6.preventDefault ? e6.preventDefault() : e6.returnValue = false;
|
|
385
|
+
};
|
|
386
|
+
return this.listeners = [{ element: this.element, events: { dragstart: function(t5) {
|
|
387
|
+
return e5.emit("dragstart", t5);
|
|
388
|
+
}, dragenter: function(t5) {
|
|
389
|
+
return r2(t5), e5.emit("dragenter", t5);
|
|
390
|
+
}, dragover: function(t5) {
|
|
391
|
+
var n4 = void 0;
|
|
392
|
+
try {
|
|
393
|
+
n4 = t5.dataTransfer.effectAllowed;
|
|
394
|
+
} catch (e6) {
|
|
395
|
+
}
|
|
396
|
+
return t5.dataTransfer.dropEffect = "move" === n4 || "linkMove" === n4 ? "move" : "copy", r2(t5), e5.emit("dragover", t5);
|
|
397
|
+
}, dragleave: function(t5) {
|
|
398
|
+
return e5.emit("dragleave", t5);
|
|
399
|
+
}, drop: function(t5) {
|
|
400
|
+
return r2(t5), e5.drop(t5);
|
|
401
|
+
}, dragend: function(t5) {
|
|
402
|
+
return e5.emit("dragend", t5);
|
|
403
|
+
} } }], this.clickableElements.forEach(function(t5) {
|
|
404
|
+
return e5.listeners.push({ element: t5, events: { click: function(n4) {
|
|
405
|
+
return (t5 !== e5.element || n4.target === e5.element || o2.elementInside(n4.target, e5.element.querySelector(".dz-message"))) && e5.hiddenFileInput.click(), true;
|
|
406
|
+
} } });
|
|
407
|
+
}), this.enable(), this.options.init.call(this);
|
|
408
|
+
} }, { key: "destroy", value: function() {
|
|
409
|
+
return this.disable(), this.removeAllFiles(true), (null != this.hiddenFileInput ? this.hiddenFileInput.parentNode : void 0) && (this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput), this.hiddenFileInput = null), delete this.element.dropzone, o2.instances.splice(o2.instances.indexOf(this), 1);
|
|
410
|
+
} }, { key: "updateTotalUploadProgress", value: function() {
|
|
411
|
+
var e5 = void 0, t4 = 0, n3 = 0;
|
|
412
|
+
if (this.getActiveFiles().length) {
|
|
413
|
+
for (var i2 = 0, r2 = r2 = this.getActiveFiles(); !(i2 >= r2.length); ) {
|
|
414
|
+
var o3 = r2[i2++];
|
|
415
|
+
t4 += o3.upload.bytesSent, n3 += o3.upload.total;
|
|
416
|
+
}
|
|
417
|
+
e5 = 100 * t4 / n3;
|
|
418
|
+
} else e5 = 100;
|
|
419
|
+
return this.emit("totaluploadprogress", e5, n3, t4);
|
|
420
|
+
} }, { key: "_getParamName", value: function(e5) {
|
|
421
|
+
return "function" == typeof this.options.paramName ? this.options.paramName(e5) : this.options.paramName + (this.options.uploadMultiple ? "[" + e5 + "]" : "");
|
|
422
|
+
} }, { key: "_renameFile", value: function(e5) {
|
|
423
|
+
return "function" != typeof this.options.renameFile ? e5.name : this.options.renameFile(e5);
|
|
424
|
+
} }, { key: "getFallbackForm", value: function() {
|
|
425
|
+
var e5, t4 = void 0;
|
|
426
|
+
if (e5 = this.getExistingFallback()) return e5;
|
|
427
|
+
var n3 = '<div class="dz-fallback">';
|
|
428
|
+
this.options.dictFallbackText && (n3 += "<p>" + this.options.dictFallbackText + "</p>"), n3 += '<input type="file" name="' + this._getParamName(0) + '" ' + (this.options.uploadMultiple ? 'multiple="multiple"' : void 0) + ' /><input type="submit" value="Upload!"></div>';
|
|
429
|
+
var i2 = o2.createElement(n3);
|
|
430
|
+
return "FORM" !== this.element.tagName ? (t4 = o2.createElement('<form action="' + this.options.url + '" enctype="multipart/form-data" method="' + this.options.method + '"></form>')).appendChild(i2) : (this.element.setAttribute("enctype", "multipart/form-data"), this.element.setAttribute("method", this.options.method)), null != t4 ? t4 : i2;
|
|
431
|
+
} }, { key: "getExistingFallback", value: function() {
|
|
432
|
+
for (var e5 = ["div", "form"], t4 = 0; t4 < e5.length; t4++) {
|
|
433
|
+
var n3, i2 = e5[t4];
|
|
434
|
+
if (n3 = (function(e6) {
|
|
435
|
+
for (var t5 = 0, n4 = n4 = e6; !(t5 >= n4.length); ) {
|
|
436
|
+
var i3 = n4[t5++];
|
|
437
|
+
if (/(^| )fallback($| )/.test(i3.className)) return i3;
|
|
438
|
+
}
|
|
439
|
+
})(this.element.getElementsByTagName(i2))) return n3;
|
|
440
|
+
}
|
|
441
|
+
} }, { key: "setupEventListeners", value: function() {
|
|
442
|
+
return this.listeners.map(function(e5) {
|
|
443
|
+
return (function() {
|
|
444
|
+
var t4 = [];
|
|
445
|
+
for (var n3 in e5.events) {
|
|
446
|
+
var i2 = e5.events[n3];
|
|
447
|
+
t4.push(e5.element.addEventListener(n3, i2, false));
|
|
448
|
+
}
|
|
449
|
+
return t4;
|
|
450
|
+
})();
|
|
451
|
+
});
|
|
452
|
+
} }, { key: "removeEventListeners", value: function() {
|
|
453
|
+
return this.listeners.map(function(e5) {
|
|
454
|
+
return (function() {
|
|
455
|
+
var t4 = [];
|
|
456
|
+
for (var n3 in e5.events) {
|
|
457
|
+
var i2 = e5.events[n3];
|
|
458
|
+
t4.push(e5.element.removeEventListener(n3, i2, false));
|
|
459
|
+
}
|
|
460
|
+
return t4;
|
|
461
|
+
})();
|
|
462
|
+
});
|
|
463
|
+
} }, { key: "disable", value: function() {
|
|
464
|
+
var e5 = this;
|
|
465
|
+
return this.clickableElements.forEach(function(e6) {
|
|
466
|
+
return e6.classList.remove("dz-clickable");
|
|
467
|
+
}), this.removeEventListeners(), this.disabled = true, this.files.map(function(t4) {
|
|
468
|
+
return e5.cancelUpload(t4);
|
|
469
|
+
});
|
|
470
|
+
} }, { key: "enable", value: function() {
|
|
471
|
+
return delete this.disabled, this.clickableElements.forEach(function(e5) {
|
|
472
|
+
return e5.classList.add("dz-clickable");
|
|
473
|
+
}), this.setupEventListeners();
|
|
474
|
+
} }, { key: "filesize", value: function(e5) {
|
|
475
|
+
var t4 = 0, n3 = "b";
|
|
476
|
+
if (e5 > 0) {
|
|
477
|
+
for (var i2 = ["tb", "gb", "mb", "kb", "b"], r2 = 0; r2 < i2.length; r2++) {
|
|
478
|
+
var o3 = i2[r2];
|
|
479
|
+
if (e5 >= Math.pow(this.options.filesizeBase, 4 - r2) / 10) {
|
|
480
|
+
t4 = e5 / Math.pow(this.options.filesizeBase, 4 - r2), n3 = o3;
|
|
481
|
+
break;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
t4 = Math.round(10 * t4) / 10;
|
|
485
|
+
}
|
|
486
|
+
return "<strong>" + t4 + "</strong> " + this.options.dictFileSizeUnits[n3];
|
|
487
|
+
} }, { key: "_updateMaxFilesReachedClass", value: function() {
|
|
488
|
+
return null != this.options.maxFiles && this.getAcceptedFiles().length >= this.options.maxFiles ? (this.getAcceptedFiles().length === this.options.maxFiles && this.emit("maxfilesreached", this.files), this.element.classList.add("dz-max-files-reached")) : this.element.classList.remove("dz-max-files-reached");
|
|
489
|
+
} }, { key: "drop", value: function(e5) {
|
|
490
|
+
if (e5.dataTransfer) {
|
|
491
|
+
this.emit("drop", e5);
|
|
492
|
+
for (var t4 = [], n3 = 0; n3 < e5.dataTransfer.files.length; n3++) t4[n3] = e5.dataTransfer.files[n3];
|
|
493
|
+
if (this.emit("addedfiles", t4), t4.length) {
|
|
494
|
+
var i2 = e5.dataTransfer.items;
|
|
495
|
+
i2 && i2.length && null != i2[0].webkitGetAsEntry ? this._addFilesFromItems(i2) : this.handleFiles(t4);
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
} }, { key: "paste", value: function(e5) {
|
|
499
|
+
if (null != (void 0 !== (t4 = null != e5 ? e5.clipboardData : void 0) && null !== t4 ? (function(e6) {
|
|
500
|
+
return e6.items;
|
|
501
|
+
})(t4) : void 0)) {
|
|
502
|
+
var t4;
|
|
503
|
+
this.emit("paste", e5);
|
|
504
|
+
var n3 = e5.clipboardData.items;
|
|
505
|
+
return n3.length ? this._addFilesFromItems(n3) : void 0;
|
|
506
|
+
}
|
|
507
|
+
} }, { key: "handleFiles", value: function(e5) {
|
|
508
|
+
for (var t4 = 0, n3 = n3 = e5; !(t4 >= n3.length); ) {
|
|
509
|
+
var i2 = n3[t4++];
|
|
510
|
+
this.addFile(i2);
|
|
511
|
+
}
|
|
512
|
+
} }, { key: "_addFilesFromItems", value: function(e5) {
|
|
513
|
+
var t4 = this;
|
|
514
|
+
return (function() {
|
|
515
|
+
for (var n3 = [], i2 = 0, r2 = r2 = e5; !(i2 >= r2.length); ) {
|
|
516
|
+
var o3, s2 = r2[i2++];
|
|
517
|
+
null != s2.webkitGetAsEntry && (o3 = s2.webkitGetAsEntry()) ? o3.isFile ? n3.push(t4.addFile(s2.getAsFile())) : o3.isDirectory ? n3.push(t4._addFilesFromDirectory(o3, o3.name)) : n3.push(void 0) : null == s2.getAsFile || null != s2.kind && "file" !== s2.kind ? n3.push(void 0) : n3.push(t4.addFile(s2.getAsFile()));
|
|
518
|
+
}
|
|
519
|
+
return n3;
|
|
520
|
+
})();
|
|
521
|
+
} }, { key: "_addFilesFromDirectory", value: function(e5, t4) {
|
|
522
|
+
var n3 = this, i2 = e5.createReader(), r2 = function(e6) {
|
|
523
|
+
return t5 = console, n4 = "log", i3 = function(t6) {
|
|
524
|
+
return t6.log(e6);
|
|
525
|
+
}, void 0 !== t5 && null !== t5 && "function" == typeof t5[n4] ? i3(t5, n4) : void 0;
|
|
526
|
+
var t5, n4, i3;
|
|
527
|
+
};
|
|
528
|
+
return (function e6() {
|
|
529
|
+
return i2.readEntries(function(i3) {
|
|
530
|
+
if (i3.length > 0) {
|
|
531
|
+
for (var r3 = 0, o3 = o3 = i3; !(r3 >= o3.length); ) {
|
|
532
|
+
var s2 = o3[r3++];
|
|
533
|
+
s2.isFile ? s2.file(function(e7) {
|
|
534
|
+
if (!n3.options.ignoreHiddenFiles || "." !== e7.name.substring(0, 1)) return e7.fullPath = t4 + "/" + e7.name, n3.addFile(e7);
|
|
535
|
+
}) : s2.isDirectory && n3._addFilesFromDirectory(s2, t4 + "/" + s2.name);
|
|
536
|
+
}
|
|
537
|
+
e6();
|
|
538
|
+
}
|
|
539
|
+
return null;
|
|
540
|
+
}, r2);
|
|
541
|
+
})();
|
|
542
|
+
} }, { key: "accept", value: function(e5, t4) {
|
|
543
|
+
return e5.size > 1024 * this.options.maxFilesize * 1024 ? t4(this.options.dictFileTooBig.replace("{{filesize}}", Math.round(e5.size / 1024 / 10.24) / 100).replace("{{maxFilesize}}", this.options.maxFilesize)) : o2.isValidFile(e5, this.options.acceptedFiles) ? null != this.options.maxFiles && this.getAcceptedFiles().length >= this.options.maxFiles ? (t4(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}", this.options.maxFiles)), this.emit("maxfilesexceeded", e5)) : this.options.accept.call(this, e5, t4) : t4(this.options.dictInvalidFileType);
|
|
544
|
+
} }, { key: "addFile", value: function(e5) {
|
|
545
|
+
var t4 = this;
|
|
546
|
+
return e5.upload = { uuid: o2.uuidv4(), progress: 0, total: e5.size, bytesSent: 0, filename: this._renameFile(e5), chunked: this.options.chunking && (this.options.forceChunking || e5.size > this.options.chunkSize), totalChunkCount: Math.ceil(e5.size / this.options.chunkSize) }, this.files.push(e5), e5.status = o2.ADDED, this.emit("addedfile", e5), this._enqueueThumbnail(e5), this.accept(e5, function(n3) {
|
|
547
|
+
return n3 ? (e5.accepted = false, t4._errorProcessing([e5], n3)) : (e5.accepted = true, t4.options.autoQueue && t4.enqueueFile(e5)), t4._updateMaxFilesReachedClass();
|
|
548
|
+
});
|
|
549
|
+
} }, { key: "enqueueFiles", value: function(e5) {
|
|
550
|
+
for (var t4 = 0, n3 = n3 = e5; !(t4 >= n3.length); ) {
|
|
551
|
+
var i2 = n3[t4++];
|
|
552
|
+
this.enqueueFile(i2);
|
|
553
|
+
}
|
|
554
|
+
return null;
|
|
555
|
+
} }, { key: "enqueueFile", value: function(e5) {
|
|
556
|
+
var t4 = this;
|
|
557
|
+
if (e5.status !== o2.ADDED || true !== e5.accepted) throw new Error("This file can't be queued because it has already been processed or was rejected.");
|
|
558
|
+
if (e5.status = o2.QUEUED, this.options.autoProcessQueue) return setTimeout(function() {
|
|
559
|
+
return t4.processQueue();
|
|
560
|
+
}, 0);
|
|
561
|
+
} }, { key: "_enqueueThumbnail", value: function(e5) {
|
|
562
|
+
var t4 = this;
|
|
563
|
+
if (this.options.createImageThumbnails && e5.type.match(/image.*/) && e5.size <= 1024 * this.options.maxThumbnailFilesize * 1024) return this._thumbnailQueue.push(e5), setTimeout(function() {
|
|
564
|
+
return t4._processThumbnailQueue();
|
|
565
|
+
}, 0);
|
|
566
|
+
} }, { key: "_processThumbnailQueue", value: function() {
|
|
567
|
+
var e5 = this;
|
|
568
|
+
if (!this._processingThumbnail && 0 !== this._thumbnailQueue.length) {
|
|
569
|
+
this._processingThumbnail = true;
|
|
570
|
+
var t4 = this._thumbnailQueue.shift();
|
|
571
|
+
return this.createThumbnail(t4, this.options.thumbnailWidth, this.options.thumbnailHeight, this.options.thumbnailMethod, true, function(n3) {
|
|
572
|
+
return e5.emit("thumbnail", t4, n3), e5._processingThumbnail = false, e5._processThumbnailQueue();
|
|
573
|
+
});
|
|
574
|
+
}
|
|
575
|
+
} }, { key: "removeFile", value: function(e5) {
|
|
576
|
+
if (e5.status === o2.UPLOADING && this.cancelUpload(e5), this.files = s(this.files, e5), this.emit("removedfile", e5), 0 === this.files.length) return this.emit("reset");
|
|
577
|
+
} }, { key: "removeAllFiles", value: function(e5) {
|
|
578
|
+
null == e5 && (e5 = false);
|
|
579
|
+
for (var t4 = 0, n3 = n3 = this.files.slice(); !(t4 >= n3.length); ) {
|
|
580
|
+
var i2 = n3[t4++];
|
|
581
|
+
(i2.status !== o2.UPLOADING || e5) && this.removeFile(i2);
|
|
582
|
+
}
|
|
583
|
+
return null;
|
|
584
|
+
} }, { key: "resizeImage", value: function(e5, t4, n3, i2, r2) {
|
|
585
|
+
var s2 = this;
|
|
586
|
+
return this.createThumbnail(e5, t4, n3, i2, false, function(t5, n4) {
|
|
587
|
+
if (null == n4) return r2(e5);
|
|
588
|
+
var i3 = s2.options.resizeMimeType;
|
|
589
|
+
null == i3 && (i3 = e5.type);
|
|
590
|
+
var a2 = n4.toDataURL(i3, s2.options.resizeQuality);
|
|
591
|
+
return "image/jpeg" !== i3 && "image/jpg" !== i3 || (a2 = u.restore(e5.dataURL, a2)), r2(o2.dataURItoBlob(a2));
|
|
592
|
+
});
|
|
593
|
+
} }, { key: "createThumbnail", value: function(e5, t4, n3, i2, r2, o3) {
|
|
594
|
+
var s2 = this, a2 = new FileReader();
|
|
595
|
+
return a2.onload = function() {
|
|
596
|
+
if (e5.dataURL = a2.result, "image/svg+xml" !== e5.type) return s2.createThumbnailFromUrl(e5, t4, n3, i2, r2, o3);
|
|
597
|
+
null != o3 && o3(a2.result);
|
|
598
|
+
}, a2.readAsDataURL(e5);
|
|
599
|
+
} }, { key: "createThumbnailFromUrl", value: function(e5, t4, n3, i2, r2, o3, s2) {
|
|
600
|
+
var a2 = this, u2 = document.createElement("img");
|
|
601
|
+
return s2 && (u2.crossOrigin = s2), u2.onload = function() {
|
|
602
|
+
var s3 = function(e6) {
|
|
603
|
+
return e6(1);
|
|
604
|
+
};
|
|
605
|
+
return "undefined" != typeof EXIF && null !== EXIF && r2 && (s3 = function(e6) {
|
|
606
|
+
return EXIF.getData(u2, function() {
|
|
607
|
+
return e6(EXIF.getTag(this, "Orientation"));
|
|
608
|
+
});
|
|
609
|
+
}), s3(function(r3) {
|
|
610
|
+
e5.width = u2.width, e5.height = u2.height;
|
|
611
|
+
var s4 = a2.options.resize.call(a2, e5, t4, n3, i2), c = document.createElement("canvas"), d = c.getContext("2d");
|
|
612
|
+
switch (c.width = s4.trgWidth, c.height = s4.trgHeight, r3 > 4 && (c.width = s4.trgHeight, c.height = s4.trgWidth), r3) {
|
|
613
|
+
case 2:
|
|
614
|
+
d.translate(c.width, 0), d.scale(-1, 1);
|
|
615
|
+
break;
|
|
616
|
+
case 3:
|
|
617
|
+
d.translate(c.width, c.height), d.rotate(Math.PI);
|
|
618
|
+
break;
|
|
619
|
+
case 4:
|
|
620
|
+
d.translate(0, c.height), d.scale(1, -1);
|
|
621
|
+
break;
|
|
622
|
+
case 5:
|
|
623
|
+
d.rotate(0.5 * Math.PI), d.scale(1, -1);
|
|
624
|
+
break;
|
|
625
|
+
case 6:
|
|
626
|
+
d.rotate(0.5 * Math.PI), d.translate(0, -c.height);
|
|
627
|
+
break;
|
|
628
|
+
case 7:
|
|
629
|
+
d.rotate(0.5 * Math.PI), d.translate(c.width, -c.height), d.scale(-1, 1);
|
|
630
|
+
break;
|
|
631
|
+
case 8:
|
|
632
|
+
d.rotate(-0.5 * Math.PI), d.translate(-c.width, 0);
|
|
633
|
+
}
|
|
634
|
+
l(d, u2, null != s4.srcX ? s4.srcX : 0, null != s4.srcY ? s4.srcY : 0, s4.srcWidth, s4.srcHeight, null != s4.trgX ? s4.trgX : 0, null != s4.trgY ? s4.trgY : 0, s4.trgWidth, s4.trgHeight);
|
|
635
|
+
var p = c.toDataURL("image/png");
|
|
636
|
+
if (null != o3) return o3(p, c);
|
|
637
|
+
});
|
|
638
|
+
}, null != o3 && (u2.onerror = o3), u2.src = e5.dataURL;
|
|
639
|
+
} }, { key: "processQueue", value: function() {
|
|
640
|
+
var e5 = this.options.parallelUploads, t4 = this.getUploadingFiles().length, n3 = t4;
|
|
641
|
+
if (!(t4 >= e5)) {
|
|
642
|
+
var i2 = this.getQueuedFiles();
|
|
643
|
+
if (i2.length > 0) {
|
|
644
|
+
if (this.options.uploadMultiple) return this.processFiles(i2.slice(0, e5 - t4));
|
|
645
|
+
for (; n3 < e5; ) {
|
|
646
|
+
if (!i2.length) return;
|
|
647
|
+
this.processFile(i2.shift()), n3++;
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
} }, { key: "processFile", value: function(e5) {
|
|
652
|
+
return this.processFiles([e5]);
|
|
653
|
+
} }, { key: "processFiles", value: function(e5) {
|
|
654
|
+
for (var t4 = 0, n3 = n3 = e5; !(t4 >= n3.length); ) {
|
|
655
|
+
var i2 = n3[t4++];
|
|
656
|
+
i2.processing = true, i2.status = o2.UPLOADING, this.emit("processing", i2);
|
|
657
|
+
}
|
|
658
|
+
return this.options.uploadMultiple && this.emit("processingmultiple", e5), this.uploadFiles(e5);
|
|
659
|
+
} }, { key: "_getFilesWithXhr", value: function(e5) {
|
|
660
|
+
return this.files.filter(function(t4) {
|
|
661
|
+
return t4.xhr === e5;
|
|
662
|
+
}).map(function(e6) {
|
|
663
|
+
return e6;
|
|
664
|
+
});
|
|
665
|
+
} }, { key: "cancelUpload", value: function(e5) {
|
|
666
|
+
if (e5.status === o2.UPLOADING) {
|
|
667
|
+
for (var t4 = this._getFilesWithXhr(e5.xhr), n3 = 0, i2 = i2 = t4; !(n3 >= i2.length); ) i2[n3++].status = o2.CANCELED;
|
|
668
|
+
void 0 !== e5.xhr && e5.xhr.abort();
|
|
669
|
+
for (var r2 = 0, s2 = s2 = t4; !(r2 >= s2.length); ) {
|
|
670
|
+
var a2 = s2[r2++];
|
|
671
|
+
this.emit("canceled", a2);
|
|
672
|
+
}
|
|
673
|
+
this.options.uploadMultiple && this.emit("canceledmultiple", t4);
|
|
674
|
+
} else e5.status !== o2.ADDED && e5.status !== o2.QUEUED || (e5.status = o2.CANCELED, this.emit("canceled", e5), this.options.uploadMultiple && this.emit("canceledmultiple", [e5]));
|
|
675
|
+
if (this.options.autoProcessQueue) return this.processQueue();
|
|
676
|
+
} }, { key: "resolveOption", value: function(e5) {
|
|
677
|
+
if ("function" == typeof e5) {
|
|
678
|
+
for (var t4 = arguments.length, n3 = Array(t4 > 1 ? t4 - 1 : 0), i2 = 1; i2 < t4; i2++) n3[i2 - 1] = arguments[i2];
|
|
679
|
+
return e5.apply(this, n3);
|
|
680
|
+
}
|
|
681
|
+
return e5;
|
|
682
|
+
} }, { key: "uploadFile", value: function(e5) {
|
|
683
|
+
return this.uploadFiles([e5]);
|
|
684
|
+
} }, { key: "uploadFiles", value: function(e5) {
|
|
685
|
+
var t4 = this;
|
|
686
|
+
this._transformFiles(e5, function(n3) {
|
|
687
|
+
if (e5[0].upload.chunked) {
|
|
688
|
+
var i2 = e5[0], r2 = n3[0];
|
|
689
|
+
i2.upload.chunks = [];
|
|
690
|
+
var s2 = function() {
|
|
691
|
+
for (var n4 = 0; void 0 !== i2.upload.chunks[n4]; ) n4++;
|
|
692
|
+
if (!(n4 >= i2.upload.totalChunkCount)) {
|
|
693
|
+
var s3 = n4 * t4.options.chunkSize, a3 = Math.min(s3 + t4.options.chunkSize, i2.size), l3 = { name: t4._getParamName(0), data: r2.webkitSlice ? r2.webkitSlice(s3, a3) : r2.slice(s3, a3), filename: i2.upload.filename, chunkIndex: n4 };
|
|
694
|
+
i2.upload.chunks[n4] = { file: i2, index: n4, dataBlock: l3, status: o2.UPLOADING, progress: 0, retries: 0 }, t4._uploadData(e5, [l3]);
|
|
695
|
+
}
|
|
696
|
+
};
|
|
697
|
+
if (i2.upload.finishedChunkUpload = function(n4) {
|
|
698
|
+
var r3 = true;
|
|
699
|
+
n4.status = o2.SUCCESS, n4.dataBlock = null;
|
|
700
|
+
for (var a3 = 0; a3 < i2.upload.totalChunkCount; a3++) {
|
|
701
|
+
if (void 0 === i2.upload.chunks[a3]) return s2();
|
|
702
|
+
i2.upload.chunks[a3].status !== o2.SUCCESS && (r3 = false);
|
|
703
|
+
}
|
|
704
|
+
r3 && t4.options.chunksUploaded(i2, function() {
|
|
705
|
+
t4._finished(e5, "", null);
|
|
706
|
+
});
|
|
707
|
+
}, t4.options.parallelChunkUploads) for (var a2 = 0; a2 < i2.upload.totalChunkCount; a2++) s2();
|
|
708
|
+
else s2();
|
|
709
|
+
} else {
|
|
710
|
+
for (var l2 = [], u2 = 0; u2 < e5.length; u2++) l2[u2] = { name: t4._getParamName(u2), data: n3[u2], filename: e5[u2].upload.filename };
|
|
711
|
+
t4._uploadData(e5, l2);
|
|
712
|
+
}
|
|
713
|
+
});
|
|
714
|
+
} }, { key: "_getChunk", value: function(e5, t4) {
|
|
715
|
+
for (var n3 = 0; n3 < e5.upload.totalChunkCount; n3++) if (void 0 !== e5.upload.chunks[n3] && e5.upload.chunks[n3].xhr === t4) return e5.upload.chunks[n3];
|
|
716
|
+
} }, { key: "_uploadData", value: function(e5, t4) {
|
|
717
|
+
for (var n3 = this, i2 = new XMLHttpRequest(), r2 = 0, s2 = s2 = e5; !(r2 >= s2.length); ) s2[r2++].xhr = i2;
|
|
718
|
+
e5[0].upload.chunked && (e5[0].upload.chunks[t4[0].chunkIndex].xhr = i2);
|
|
719
|
+
var a2 = this.resolveOption(this.options.method, e5), l2 = this.resolveOption(this.options.url, e5);
|
|
720
|
+
i2.open(a2, l2, true), i2.timeout = this.resolveOption(this.options.timeout, e5), i2.withCredentials = !!this.options.withCredentials, i2.onload = function(t5) {
|
|
721
|
+
n3._finishedUploading(e5, i2, t5);
|
|
722
|
+
}, i2.onerror = function() {
|
|
723
|
+
n3._handleUploadError(e5, i2);
|
|
724
|
+
}, (null != i2.upload ? i2.upload : i2).onprogress = function(t5) {
|
|
725
|
+
return n3._updateFilesUploadProgress(e5, i2, t5);
|
|
726
|
+
};
|
|
727
|
+
var u2 = { Accept: "application/json", "Cache-Control": "no-cache", "X-Requested-With": "XMLHttpRequest" };
|
|
728
|
+
for (var c in this.options.headers && o2.extend(u2, this.options.headers), u2) {
|
|
729
|
+
var d = u2[c];
|
|
730
|
+
d && i2.setRequestHeader(c, d);
|
|
731
|
+
}
|
|
732
|
+
var p = new FormData();
|
|
733
|
+
if (this.options.params) {
|
|
734
|
+
var h = this.options.params;
|
|
735
|
+
for (var f in "function" == typeof h && (h = h.call(this, e5, i2, e5[0].upload.chunked ? this._getChunk(e5[0], i2) : null)), h) {
|
|
736
|
+
var m = h[f];
|
|
737
|
+
p.append(f, m);
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
for (var v = 0, g = g = e5; !(v >= g.length); ) {
|
|
741
|
+
var y = g[v++];
|
|
742
|
+
this.emit("sending", y, i2, p);
|
|
743
|
+
}
|
|
744
|
+
this.options.uploadMultiple && this.emit("sendingmultiple", e5, i2, p), this._addFormElementData(p);
|
|
745
|
+
for (var k = 0; k < t4.length; k++) {
|
|
746
|
+
var b = t4[k];
|
|
747
|
+
p.append(b.name, b.data, b.filename);
|
|
748
|
+
}
|
|
749
|
+
this.submitRequest(i2, p, e5);
|
|
750
|
+
} }, { key: "_transformFiles", value: function(e5, t4) {
|
|
751
|
+
for (var n3 = this, i2 = [], r2 = 0, o3 = 0; o3 < e5.length; o3++) !(function(o4) {
|
|
752
|
+
n3.options.transformFile.call(n3, e5[o4], function(n4) {
|
|
753
|
+
i2[o4] = n4, ++r2 === e5.length && t4(i2);
|
|
754
|
+
});
|
|
755
|
+
})(o3);
|
|
756
|
+
} }, { key: "_addFormElementData", value: function(e5) {
|
|
757
|
+
if ("FORM" === this.element.tagName) for (var t4 = 0, n3 = n3 = this.element.querySelectorAll("input, textarea, select, button"); !(t4 >= n3.length); ) {
|
|
758
|
+
var i2 = n3[t4++], r2 = i2.getAttribute("name"), o3 = i2.getAttribute("type");
|
|
759
|
+
if (o3 && (o3 = o3.toLowerCase()), void 0 !== r2 && null !== r2) if ("SELECT" === i2.tagName && i2.hasAttribute("multiple")) for (var s2 = 0, a2 = a2 = i2.options; !(s2 >= a2.length); ) {
|
|
760
|
+
var l2 = a2[s2++];
|
|
761
|
+
l2.selected && e5.append(r2, l2.value);
|
|
762
|
+
}
|
|
763
|
+
else (!o3 || "checkbox" !== o3 && "radio" !== o3 || i2.checked) && e5.append(r2, i2.value);
|
|
764
|
+
}
|
|
765
|
+
} }, { key: "_updateFilesUploadProgress", value: function(e5, t4, n3) {
|
|
766
|
+
var i2 = void 0;
|
|
767
|
+
if (void 0 !== n3) {
|
|
768
|
+
if (i2 = 100 * n3.loaded / n3.total, e5[0].upload.chunked) {
|
|
769
|
+
var r2 = e5[0], o3 = this._getChunk(r2, t4);
|
|
770
|
+
o3.progress = i2, o3.total = n3.total, o3.bytesSent = n3.loaded, r2.upload.progress = 0, r2.upload.total = 0, r2.upload.bytesSent = 0;
|
|
771
|
+
for (var s2 = 0; s2 < r2.upload.totalChunkCount; s2++) void 0 !== r2.upload.chunks[s2] && void 0 !== r2.upload.chunks[s2].progress && (r2.upload.progress += r2.upload.chunks[s2].progress, r2.upload.total += r2.upload.chunks[s2].total, r2.upload.bytesSent += r2.upload.chunks[s2].bytesSent);
|
|
772
|
+
r2.upload.progress = r2.upload.progress / r2.upload.totalChunkCount;
|
|
773
|
+
} else for (var a2 = 0, l2 = l2 = e5; !(a2 >= l2.length); ) {
|
|
774
|
+
var u2 = l2[a2++];
|
|
775
|
+
u2.upload.progress = i2, u2.upload.total = n3.total, u2.upload.bytesSent = n3.loaded;
|
|
776
|
+
}
|
|
777
|
+
for (var c = 0, d = d = e5; !(c >= d.length); ) {
|
|
778
|
+
var p = d[c++];
|
|
779
|
+
this.emit("uploadprogress", p, p.upload.progress, p.upload.bytesSent);
|
|
780
|
+
}
|
|
781
|
+
} else {
|
|
782
|
+
var h = true;
|
|
783
|
+
i2 = 100;
|
|
784
|
+
for (var f = 0, m = m = e5; !(f >= m.length); ) {
|
|
785
|
+
var v = m[f++];
|
|
786
|
+
100 === v.upload.progress && v.upload.bytesSent === v.upload.total || (h = false), v.upload.progress = i2, v.upload.bytesSent = v.upload.total;
|
|
787
|
+
}
|
|
788
|
+
if (h) return;
|
|
789
|
+
for (var g = 0, y = y = e5; !(g >= y.length); ) {
|
|
790
|
+
var k = y[g++];
|
|
791
|
+
this.emit("uploadprogress", k, i2, k.upload.bytesSent);
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
} }, { key: "_finishedUploading", value: function(e5, t4, n3) {
|
|
795
|
+
var i2 = void 0;
|
|
796
|
+
if (e5[0].status !== o2.CANCELED && 4 === t4.readyState) {
|
|
797
|
+
if ("arraybuffer" !== t4.responseType && "blob" !== t4.responseType && (i2 = t4.responseText, t4.getResponseHeader("content-type") && ~t4.getResponseHeader("content-type").indexOf("application/json"))) try {
|
|
798
|
+
i2 = JSON.parse(i2);
|
|
799
|
+
} catch (e6) {
|
|
800
|
+
n3 = e6, i2 = "Invalid JSON response from server.";
|
|
801
|
+
}
|
|
802
|
+
this._updateFilesUploadProgress(e5), 200 <= t4.status && t4.status < 300 ? e5[0].upload.chunked ? e5[0].upload.finishedChunkUpload(this._getChunk(e5[0], t4)) : this._finished(e5, i2, n3) : this._handleUploadError(e5, t4, i2);
|
|
803
|
+
}
|
|
804
|
+
} }, { key: "_handleUploadError", value: function(e5, t4, n3) {
|
|
805
|
+
if (e5[0].status !== o2.CANCELED) {
|
|
806
|
+
if (e5[0].upload.chunked && this.options.retryChunks) {
|
|
807
|
+
var i2 = this._getChunk(e5[0], t4);
|
|
808
|
+
if (i2.retries++ < this.options.retryChunksLimit) return void this._uploadData(e5, [i2.dataBlock]);
|
|
809
|
+
console.warn("Retried this chunk too often. Giving up.");
|
|
810
|
+
}
|
|
811
|
+
for (var r2 = 0, s2 = s2 = e5; !(r2 >= s2.length); ) s2[r2++], this._errorProcessing(e5, n3 || this.options.dictResponseError.replace("{{statusCode}}", t4.status), t4);
|
|
812
|
+
}
|
|
813
|
+
} }, { key: "submitRequest", value: function(e5, t4, n3) {
|
|
814
|
+
e5.send(t4);
|
|
815
|
+
} }, { key: "_finished", value: function(e5, t4, n3) {
|
|
816
|
+
for (var i2 = 0, r2 = r2 = e5; !(i2 >= r2.length); ) {
|
|
817
|
+
var s2 = r2[i2++];
|
|
818
|
+
s2.status = o2.SUCCESS, this.emit("success", s2, t4, n3), this.emit("complete", s2);
|
|
819
|
+
}
|
|
820
|
+
if (this.options.uploadMultiple && (this.emit("successmultiple", e5, t4, n3), this.emit("completemultiple", e5)), this.options.autoProcessQueue) return this.processQueue();
|
|
821
|
+
} }, { key: "_errorProcessing", value: function(e5, t4, n3) {
|
|
822
|
+
for (var i2 = 0, r2 = r2 = e5; !(i2 >= r2.length); ) {
|
|
823
|
+
var s2 = r2[i2++];
|
|
824
|
+
s2.status = o2.ERROR, this.emit("error", s2, t4, n3), this.emit("complete", s2);
|
|
825
|
+
}
|
|
826
|
+
if (this.options.uploadMultiple && (this.emit("errormultiple", e5, t4, n3), this.emit("completemultiple", e5)), this.options.autoProcessQueue) return this.processQueue();
|
|
827
|
+
} }], [{ key: "uuidv4", value: function() {
|
|
828
|
+
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e5) {
|
|
829
|
+
var t4 = 16 * Math.random() | 0;
|
|
830
|
+
return ("x" === e5 ? t4 : 3 & t4 | 8).toString(16);
|
|
831
|
+
});
|
|
832
|
+
} }]), o2;
|
|
833
|
+
})();
|
|
834
|
+
o.initClass(), o.version = "5.4.0", o.options = {}, o.optionsForElement = function(e4) {
|
|
835
|
+
return e4.getAttribute("id") ? o.options[a(e4.getAttribute("id"))] : void 0;
|
|
836
|
+
}, o.instances = [], o.forElement = function(e4) {
|
|
837
|
+
if ("string" == typeof e4 && (e4 = document.querySelector(e4)), null == (null != e4 ? e4.dropzone : void 0)) throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");
|
|
838
|
+
return e4.dropzone;
|
|
839
|
+
}, o.autoDiscover = true, o.discover = function() {
|
|
840
|
+
var e4 = void 0;
|
|
841
|
+
if (document.querySelectorAll) e4 = document.querySelectorAll(".dropzone");
|
|
842
|
+
else {
|
|
843
|
+
e4 = [];
|
|
844
|
+
var t4 = function(t5) {
|
|
845
|
+
return (function() {
|
|
846
|
+
for (var n3 = [], i2 = 0, r2 = r2 = t5; !(i2 >= r2.length); ) {
|
|
847
|
+
var o2 = r2[i2++];
|
|
848
|
+
/(^| )dropzone($| )/.test(o2.className) ? n3.push(e4.push(o2)) : n3.push(void 0);
|
|
849
|
+
}
|
|
850
|
+
return n3;
|
|
851
|
+
})();
|
|
852
|
+
};
|
|
853
|
+
t4(document.getElementsByTagName("div")), t4(document.getElementsByTagName("form"));
|
|
854
|
+
}
|
|
855
|
+
return (function() {
|
|
856
|
+
for (var t5 = [], n3 = 0, i2 = i2 = e4; !(n3 >= i2.length); ) {
|
|
857
|
+
var r2 = i2[n3++];
|
|
858
|
+
false !== o.optionsForElement(r2) ? t5.push(new o(r2)) : t5.push(void 0);
|
|
859
|
+
}
|
|
860
|
+
return t5;
|
|
861
|
+
})();
|
|
862
|
+
}, o.blacklistedBrowsers = [/opera.*(Macintosh|Windows Phone).*version\/12/i], o.isBrowserSupported = function() {
|
|
863
|
+
var e4 = true;
|
|
864
|
+
if (window.File && window.FileReader && window.FileList && window.Blob && window.FormData && document.querySelector) if ("classList" in document.createElement("a")) for (var t4 = 0, n3 = n3 = o.blacklistedBrowsers; !(t4 >= n3.length); ) n3[t4++].test(navigator.userAgent) && (e4 = false);
|
|
865
|
+
else e4 = false;
|
|
866
|
+
else e4 = false;
|
|
867
|
+
return e4;
|
|
868
|
+
}, o.dataURItoBlob = function(e4) {
|
|
869
|
+
for (var t4 = atob(e4.split(",")[1]), n3 = e4.split(",")[0].split(":")[1].split(";")[0], i2 = new ArrayBuffer(t4.length), r2 = new Uint8Array(i2), o2 = 0, s2 = t4.length, a2 = 0 <= s2; a2 ? o2 <= s2 : o2 >= s2; a2 ? o2++ : o2--) r2[o2] = t4.charCodeAt(o2);
|
|
870
|
+
return new Blob([i2], { type: n3 });
|
|
871
|
+
};
|
|
872
|
+
var s = function(e4, t4) {
|
|
873
|
+
return e4.filter(function(e5) {
|
|
874
|
+
return e5 !== t4;
|
|
875
|
+
}).map(function(e5) {
|
|
876
|
+
return e5;
|
|
877
|
+
});
|
|
878
|
+
}, a = function(e4) {
|
|
879
|
+
return e4.replace(/[\-_](\w)/g, function(e5) {
|
|
880
|
+
return e5.charAt(1).toUpperCase();
|
|
881
|
+
});
|
|
882
|
+
};
|
|
883
|
+
o.createElement = function(e4) {
|
|
884
|
+
var t4 = document.createElement("div");
|
|
885
|
+
return t4.innerHTML = e4, t4.childNodes[0];
|
|
886
|
+
}, o.elementInside = function(e4, t4) {
|
|
887
|
+
if (e4 === t4) return true;
|
|
888
|
+
for (; e4 = e4.parentNode; ) if (e4 === t4) return true;
|
|
889
|
+
return false;
|
|
890
|
+
}, o.getElement = function(e4, t4) {
|
|
891
|
+
var n3 = void 0;
|
|
892
|
+
if ("string" == typeof e4 ? n3 = document.querySelector(e4) : null != e4.nodeType && (n3 = e4), null == n3) throw new Error("Invalid `" + t4 + "` option provided. Please provide a CSS selector or a plain HTML element.");
|
|
893
|
+
return n3;
|
|
894
|
+
}, o.getElements = function(e4, t4) {
|
|
895
|
+
var n3 = void 0, i2 = void 0;
|
|
896
|
+
if (e4 instanceof Array) {
|
|
897
|
+
i2 = [];
|
|
898
|
+
try {
|
|
899
|
+
for (var r2 = 0, o2 = o2 = e4; !(r2 >= o2.length); ) n3 = o2[r2++], i2.push(this.getElement(n3, t4));
|
|
900
|
+
} catch (e5) {
|
|
901
|
+
i2 = null;
|
|
902
|
+
}
|
|
903
|
+
} else if ("string" == typeof e4) {
|
|
904
|
+
i2 = [];
|
|
905
|
+
for (var s2 = 0, a2 = a2 = document.querySelectorAll(e4); !(s2 >= a2.length); ) n3 = a2[s2++], i2.push(n3);
|
|
906
|
+
} else null != e4.nodeType && (i2 = [e4]);
|
|
907
|
+
if (null == i2 || !i2.length) throw new Error("Invalid `" + t4 + "` option provided. Please provide a CSS selector, a plain HTML element or a list of those.");
|
|
908
|
+
return i2;
|
|
909
|
+
}, o.confirm = function(e4, t4, n3) {
|
|
910
|
+
return window.confirm(e4) ? t4() : null != n3 ? n3() : void 0;
|
|
911
|
+
}, o.isValidFile = function(e4, t4) {
|
|
912
|
+
if (!t4) return true;
|
|
913
|
+
t4 = t4.split(",");
|
|
914
|
+
for (var n3 = e4.type, i2 = n3.replace(/\/.*$/, ""), r2 = 0, o2 = o2 = t4; !(r2 >= o2.length); ) {
|
|
915
|
+
var s2 = o2[r2++];
|
|
916
|
+
if ("." === (s2 = s2.trim()).charAt(0)) {
|
|
917
|
+
if (-1 !== e4.name.toLowerCase().indexOf(s2.toLowerCase(), e4.name.length - s2.length)) return true;
|
|
918
|
+
} else if (/\/\*$/.test(s2)) {
|
|
919
|
+
if (i2 === s2.replace(/\/.*$/, "")) return true;
|
|
920
|
+
} else if (n3 === s2) return true;
|
|
921
|
+
}
|
|
922
|
+
return false;
|
|
923
|
+
}, "undefined" != typeof jQuery && null !== jQuery && (jQuery.fn.dropzone = function(e4) {
|
|
924
|
+
return this.each(function() {
|
|
925
|
+
return new o(this, e4);
|
|
926
|
+
});
|
|
927
|
+
}), void 0 !== e3 && null !== e3 ? e3.exports = o : window.Dropzone = o, o.ADDED = "added", o.QUEUED = "queued", o.ACCEPTED = o.QUEUED, o.UPLOADING = "uploading", o.PROCESSING = o.UPLOADING, o.CANCELED = "canceled", o.ERROR = "error", o.SUCCESS = "success";
|
|
928
|
+
var l = function(e4, t4, n3, i2, r2, o2, s2, a2, l2, u2) {
|
|
929
|
+
var c = (function(e5) {
|
|
930
|
+
e5.naturalWidth;
|
|
931
|
+
var t5 = e5.naturalHeight, n4 = document.createElement("canvas");
|
|
932
|
+
n4.width = 1, n4.height = t5;
|
|
933
|
+
var i3 = n4.getContext("2d");
|
|
934
|
+
i3.drawImage(e5, 0, 0);
|
|
935
|
+
for (var r3 = i3.getImageData(1, 0, 1, t5).data, o3 = 0, s3 = t5, a3 = t5; a3 > o3; ) 0 === r3[4 * (a3 - 1) + 3] ? s3 = a3 : o3 = a3, a3 = s3 + o3 >> 1;
|
|
936
|
+
var l3 = a3 / t5;
|
|
937
|
+
return 0 === l3 ? 1 : l3;
|
|
938
|
+
})(t4);
|
|
939
|
+
return e4.drawImage(t4, n3, i2, r2, o2, s2, a2, l2, u2 / c);
|
|
940
|
+
}, u = (function() {
|
|
941
|
+
function e4() {
|
|
942
|
+
n2(this, e4);
|
|
943
|
+
}
|
|
944
|
+
return i(e4, null, [{ key: "initClass", value: function() {
|
|
945
|
+
this.KEY_STR = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
|
946
|
+
} }, { key: "encode64", value: function(e5) {
|
|
947
|
+
for (var t4 = "", n3 = void 0, i2 = void 0, r2 = "", o2 = void 0, s2 = void 0, a2 = void 0, l2 = "", u2 = 0; o2 = (n3 = e5[u2++]) >> 2, s2 = (3 & n3) << 4 | (i2 = e5[u2++]) >> 4, a2 = (15 & i2) << 2 | (r2 = e5[u2++]) >> 6, l2 = 63 & r2, isNaN(i2) ? a2 = l2 = 64 : isNaN(r2) && (l2 = 64), t4 = t4 + this.KEY_STR.charAt(o2) + this.KEY_STR.charAt(s2) + this.KEY_STR.charAt(a2) + this.KEY_STR.charAt(l2), n3 = i2 = r2 = "", o2 = s2 = a2 = l2 = "", u2 < e5.length; ) ;
|
|
948
|
+
return t4;
|
|
949
|
+
} }, { key: "restore", value: function(e5, t4) {
|
|
950
|
+
if (!e5.match("data:image/jpeg;base64,")) return t4;
|
|
951
|
+
var n3 = this.decode64(e5.replace("data:image/jpeg;base64,", "")), i2 = this.slice2Segments(n3), r2 = this.exifManipulation(t4, i2);
|
|
952
|
+
return "data:image/jpeg;base64," + this.encode64(r2);
|
|
953
|
+
} }, { key: "exifManipulation", value: function(e5, t4) {
|
|
954
|
+
var n3 = this.getExifArray(t4), i2 = this.insertExif(e5, n3);
|
|
955
|
+
return new Uint8Array(i2);
|
|
956
|
+
} }, { key: "getExifArray", value: function(e5) {
|
|
957
|
+
for (var t4 = void 0, n3 = 0; n3 < e5.length; ) {
|
|
958
|
+
if (255 === (t4 = e5[n3])[0] & 225 === t4[1]) return t4;
|
|
959
|
+
n3++;
|
|
960
|
+
}
|
|
961
|
+
return [];
|
|
962
|
+
} }, { key: "insertExif", value: function(e5, t4) {
|
|
963
|
+
var n3 = e5.replace("data:image/jpeg;base64,", ""), i2 = this.decode64(n3), r2 = i2.indexOf(255, 3), o2 = i2.slice(0, r2), s2 = i2.slice(r2), a2 = o2;
|
|
964
|
+
return a2 = (a2 = a2.concat(t4)).concat(s2);
|
|
965
|
+
} }, { key: "slice2Segments", value: function(e5) {
|
|
966
|
+
for (var t4 = 0, n3 = []; !(255 === e5[t4] & 218 === e5[t4 + 1]); ) {
|
|
967
|
+
if (255 === e5[t4] & 216 === e5[t4 + 1]) t4 += 2;
|
|
968
|
+
else {
|
|
969
|
+
var i2 = t4 + (256 * e5[t4 + 2] + e5[t4 + 3]) + 2, r2 = e5.slice(t4, i2);
|
|
970
|
+
n3.push(r2), t4 = i2;
|
|
971
|
+
}
|
|
972
|
+
if (t4 > e5.length) break;
|
|
973
|
+
}
|
|
974
|
+
return n3;
|
|
975
|
+
} }, { key: "decode64", value: function(e5) {
|
|
976
|
+
var t4 = void 0, n3 = void 0, i2 = "", r2 = void 0, o2 = void 0, s2 = "", a2 = 0, l2 = [];
|
|
977
|
+
for (/[^A-Za-z0-9\+\/\=]/g.exec(e5) && console.warn("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\nExpect errors in decoding."), e5 = e5.replace(/[^A-Za-z0-9\+\/\=]/g, ""); t4 = this.KEY_STR.indexOf(e5.charAt(a2++)) << 2 | (r2 = this.KEY_STR.indexOf(e5.charAt(a2++))) >> 4, n3 = (15 & r2) << 4 | (o2 = this.KEY_STR.indexOf(e5.charAt(a2++))) >> 2, i2 = (3 & o2) << 6 | (s2 = this.KEY_STR.indexOf(e5.charAt(a2++))), l2.push(t4), 64 !== o2 && l2.push(n3), 64 !== s2 && l2.push(i2), t4 = n3 = i2 = "", r2 = o2 = s2 = "", a2 < e5.length; ) ;
|
|
978
|
+
return l2;
|
|
979
|
+
} }]), e4;
|
|
980
|
+
})();
|
|
981
|
+
u.initClass(), o._autoDiscoverFunction = function() {
|
|
982
|
+
if (o.autoDiscover) return o.discover();
|
|
983
|
+
}, (function(e4, t4) {
|
|
984
|
+
var n3 = false, i2 = true, r2 = e4.document, o2 = r2.documentElement, s2 = r2.addEventListener ? "addEventListener" : "attachEvent", a2 = r2.addEventListener ? "removeEventListener" : "detachEvent", l2 = r2.addEventListener ? "" : "on", u2 = function i3(o3) {
|
|
985
|
+
if ("readystatechange" !== o3.type || "complete" === r2.readyState) return ("load" === o3.type ? e4 : r2)[a2](l2 + o3.type, i3, false), !n3 && (n3 = true) ? t4.call(e4, o3.type || o3) : void 0;
|
|
986
|
+
};
|
|
987
|
+
if ("complete" !== r2.readyState) {
|
|
988
|
+
if (r2.createEventObject && o2.doScroll) {
|
|
989
|
+
try {
|
|
990
|
+
i2 = !e4.frameElement;
|
|
991
|
+
} catch (e5) {
|
|
992
|
+
}
|
|
993
|
+
i2 && (function e5() {
|
|
994
|
+
try {
|
|
995
|
+
o2.doScroll("left");
|
|
996
|
+
} catch (t5) {
|
|
997
|
+
return void setTimeout(e5, 50);
|
|
998
|
+
}
|
|
999
|
+
return u2("poll");
|
|
1000
|
+
})();
|
|
1001
|
+
}
|
|
1002
|
+
r2[s2](l2 + "DOMContentLoaded", u2, false), r2[s2](l2 + "readystatechange", u2, false), e4[s2](l2 + "load", u2, false);
|
|
1003
|
+
}
|
|
1004
|
+
})(window, o._autoDiscoverFunction);
|
|
1005
|
+
}).call(t2, n(6)(e2));
|
|
1006
|
+
}, function(e2, t2) {
|
|
1007
|
+
e2.exports = function(e3) {
|
|
1008
|
+
return e3.webpackPolyfill || (e3.deprecate = function() {
|
|
1009
|
+
}, e3.paths = [], e3.children || (e3.children = []), Object.defineProperty(e3, "loaded", { enumerable: true, get: function() {
|
|
1010
|
+
return e3.l;
|
|
1011
|
+
} }), Object.defineProperty(e3, "id", { enumerable: true, get: function() {
|
|
1012
|
+
return e3.i;
|
|
1013
|
+
} }), e3.webpackPolyfill = 1), e3;
|
|
1014
|
+
};
|
|
1015
|
+
}]);
|
|
1016
|
+
});
|
|
1017
|
+
})(reactDropzone$1);
|
|
1018
|
+
return reactDropzone$1.exports;
|
|
1019
|
+
}
|
|
1020
|
+
export {
|
|
1021
|
+
requireReactDropzone as __require
|
|
1022
|
+
};
|
|
1023
|
+
//# sourceMappingURL=react-dropzone.js.map
|