Skip to content

Instantly share code, notes, and snippets.

@stevenhao
Created July 30, 2018 19:13
Show Gist options
  • Save stevenhao/7e7df3d5efede14eaa16494b0cb6c8a6 to your computer and use it in GitHub Desktop.
Save stevenhao/7e7df3d5efede14eaa16494b0cb6c8a6 to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
// bad
module.exports = __NEXT_REGISTER_PAGE("/scalers/tasks", function() {
var e = webpackJsonp([6], {
100: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var r in n)
Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
}
return e
}
;
var a = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var i = n(1);
var o = u(i);
var s = n(0);
var l = u(s);
function u(e) {
return e && e.__esModule ? e : {
default: e
}
}
function c(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function d(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function f(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var p = function(e) {
f(t, e);
function t() {
c(this, t);
return d(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments))
}
a(t, [{
key: "render",
value: function e() {
return l.default.createElement("div", {
className: "jsx-324089764"
}, l.default.createElement("select", r({}, this.props, {
className: "jsx-324089764 " + (null != this.props.className && this.props.className || "")
}), this.props.children), l.default.createElement(o.default, {
styleId: "324089764",
css: ["select.jsx-324089764{background:white;border-radius:8px;font-size:14px;height:30px;padding:0 10px;font-family:var(--font-family);-webkit-appearance:none;-moz-appearance:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:0;padding-right:28px;}", "div.jsx-324089764{border:1px solid #f1f1f1;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.06);box-shadow:0 1px 3px rgba(0,0,0,.06);display:inline-block;border-radius:8px;position:relative;}", 'div.jsx-324089764::before{position:absolute;border:4px solid transparent;border-bottom:4px solid #222;content:" ";right:10px;top:4px;display:block;z-index:1000;}', 'div.jsx-324089764::after{position:absolute;border:4px solid transparent;border-top:4px solid #222;content:" ";right:10px;bottom:4px;display:block;z-index:1000;}']
}))
}
}]);
return t
}(l.default.Component);
t.default = p
},
101: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var r in n)
Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
}
return e
}
;
var a = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var i = n(1);
var o = p(i);
var s = n(0);
var l = p(s);
var u = n(2);
var c = p(u);
var d = n(5);
var f = p(d);
function p(e) {
return e && e.__esModule ? e : {
default: e
}
}
function h(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function m(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function v(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var b = function(e) {
v(t, e);
function t() {
h(this, t);
return m(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments))
}
a(t, [{
key: "render",
value: function e() {
var t = false;
"right" === this.props.align && (t = true);
var n = (0,
c.default)({
left: !t,
right: t
});
return l.default.createElement("label", r({}, this.props, {
className: "jsx-287821094 " + (null != this.props.className && this.props.className || n || "")
}), this.props.children, l.default.createElement(o.default, {
styleId: "287821094",
css: ["label.jsx-287821094{font-weight:normal;font-size:.9rem;line-height:2.2;display:block;}", "label.left.jsx-287821094{text-align:left;}", "label.right.jsx-287821094{text-align:right;}"]
}))
}
}]);
return t
}(l.default.Component);
t.default = b;
b.docPropTypes = {
align: f.default.string
};
b.defaultProps = {
align: "left"
}
},
102: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var r in n)
Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
}
return e
}
;
var a = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var i = n(1);
var o = u(i);
var s = n(0);
var l = u(s);
function u(e) {
return e && e.__esModule ? e : {
default: e
}
}
function c(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function d(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function f(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var p = function(e) {
f(t, e);
function t() {
c(this, t);
return d(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments))
}
a(t, [{
key: "render",
value: function e() {
return l.default.createElement("span", {
className: "jsx-3658962152"
}, l.default.createElement("input", r({
type: "checkbox"
}, this.props, {
className: "jsx-3658962152 " + (null != this.props.className && this.props.className || "option-input")
})), l.default.createElement(o.default, {
styleId: "3658962152",
css: ["@-webkit-keyframes click-wave{0%.jsx-3658962152{height:14px;width:14px;opacity:0.35;position:relative;}100%.jsx-3658962152{height:26px;width:26px;margin-left:-8px;margin-top:-8px;opacity:0;}}", "@-webkit-keyframes click-wave-jsx-3658962152{0%{height:14px;width:14px;opacity:0.35;position:relative;}100%{height:26px;width:26px;margin-left:-8px;margin-top:-8px;opacity:0;}}", "@keyframes click-wave-jsx-3658962152{0%{height:14px;width:14px;opacity:0.35;position:relative;}100%{height:26px;width:26px;margin-left:-8px;margin-top:-8px;opacity:0;}}", ".option-input.jsx-3658962152{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;-o-appearance:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative;right:0;bottom:0;left:0;height:14px;width:14px;-webkit-transition:all 0.15s ease-out 0s;-webkit-transition:all 0.15s ease-out 0s;transition:all 0.15s ease-out 0s;background:#fff;border:none;color:#fff;cursor:pointer;display:inline-block;margin-right:0.5rem;outline:none;position:relative;z-index:1000;margin:0;margin-bottom:-2px;margin-right:4px;border-radius:3px;border:1px solid #f1f1f1;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.1);box-shadow:0 1px 2px rgba(0,0,0,.1);}", ".option-input.jsx-3658962152:hover{background:#f9f9f9;border-color:transparent;}", ".option-input.jsx-3658962152:checked{background:var(--link-color);-webkit-box-shadow:0 0px 4px 0 var(--link-color);box-shadow:0 0px 4px 0 var(--link-color);border-color:transparent;}", ".option-input.jsx-3658962152:checked.jsx-3658962152::before{height:10px;width:10px;position:absolute;left:1px;content:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA4MSA2MiI+ICA8cGF0aCBmaWxsPSIjRkZGRkZGIiBkPSJNMjguNzQgMzguMzVjLTMuOS0zLjYtMTAuMjEtMTAuMi0xNC40Mi0xNC40LTQuMi0zLjkxLTYuOS0uNjEtMTIgNC44LTUuNzEgNS43IDAgOC43IDguMSAxNi44MWwxNC43MiAxNC43MmM1LjQgNC44IDkuOS0yLjQgMTcuMTEtOS4zMWwyOS40My0yOS43M2M5LjMxLTkuMDEgMTEuNDEtOS4wMSAzLjktMTYuMjItNi42LTYuOS02LjMtNi45LTE2LjgxIDMuOS00LjggNC41LTI4LjUzIDI4LjUzLTMwLjAzIDI5LjQ0eiIvPjwvc3ZnPg==);display:inline-block;font-size:10px;text-align:center;line-height:12px;}", ".option-input.jsx-3658962152:checked.jsx-3658962152::after{-webkit-animation:click-wave 1s;-webkit-animation:click-wave-jsx-3658962152 1s;animation:click-wave-jsx-3658962152 1s;background:var(--link-color);border-radius:100px;content:'';display:block;position:relative;z-index:100;}"]
}))
}
}]);
return t
}(l.default.Component);
t.default = p
},
103: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var r in n)
Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
}
return e
}
;
var a = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var i = n(1);
var o = u(i);
var s = n(0);
var l = u(s);
function u(e) {
return e && e.__esModule ? e : {
default: e
}
}
function c(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function d(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function f(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var p = function(e) {
f(t, e);
function t() {
c(this, t);
return d(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments))
}
a(t, [{
key: "render",
value: function e() {
return l.default.createElement("label", {
className: "jsx-2876804428 checkbox-label"
}, l.default.createElement("input", r({
type: "radio"
}, this.props, {
className: "jsx-2876804428 " + (null != this.props.className && this.props.className || "option-input radio")
})), l.default.createElement(o.default, {
styleId: "2876804428",
css: ["@-webkit-keyframes click-wave{0%.jsx-2876804428{height:14px;width:14px;opacity:0.35;position:relative;}100%.jsx-2876804428{height:26px;width:26px;margin-left:-8px;margin-top:-8px;opacity:0;}}", "@-webkit-keyframes click-wave-jsx-2876804428{0%{height:14px;width:14px;opacity:0.35;position:relative;}100%{height:26px;width:26px;margin-left:-8px;margin-top:-8px;opacity:0;}}", "@keyframes click-wave-jsx-2876804428{0%{height:14px;width:14px;opacity:0.35;position:relative;}100%{height:26px;width:26px;margin-left:-8px;margin-top:-8px;opacity:0;}}", ".option-input.jsx-2876804428{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;-o-appearance:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative;right:0;bottom:0;left:0;height:14px;width:14px;-webkit-transition:all 0.15s ease-out 0s;-webkit-transition:all 0.15s ease-out 0s;transition:all 0.15s ease-out 0s;background:#fff;border:none;color:#fff;cursor:pointer;display:inline-block;margin-right:0.5rem;outline:none;position:relative;z-index:1000;margin:0;margin-bottom:-2px;margin-right:4px;border-radius:4px;border:1px solid #f1f1f1;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.1);box-shadow:0 1px 2px rgba(0,0,0,.1);}", ".option-input.jsx-2876804428:hover{background:#f9f9f9;border-color:transparent;}", ".option-input.jsx-2876804428:checked{background:var(--link-color);-webkit-box-shadow:0 0px 4px 0 var(--link-color);box-shadow:0 0px 4px 0 var(--link-color);border-color:transparent;}", '.option-input.jsx-2876804428:checked.jsx-2876804428::before{height:6px;width:6px;border-radius:100px;position:absolute;left:3px;top:3px;content:"";background:white;display:inline-block;text-align:center;line-height:16px;}', ".option-input.jsx-2876804428:checked.jsx-2876804428::after{-webkit-animation:click-wave 0.3s;-webkit-animation:click-wave-jsx-2876804428 0.3s;animation:click-wave-jsx-2876804428 0.3s;background:var(--link-color);border-radius:8px;content:'';display:block;position:relative;z-index:100;}", ".option-input.radio.jsx-2876804428{border-radius:50%;}", ".option-input.radio.jsx-2876804428::after{border-radius:50%;}"]
}))
}
}]);
return t
}(l.default.Component);
t.default = p
},
109: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = n(129);
var a = g(r);
var i = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var r in n)
Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
}
return e
}
;
var o = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var s = n(1);
var l = g(s);
var u = n(0);
var c = g(u);
var d = n(119);
var f = g(d);
var p = n(173);
var h = g(p);
var m = n(155);
var v = g(m);
var b = n(11);
function g(e) {
return e && e.__esModule ? e : {
default: e
}
}
function y(e) {
if (Array.isArray(e)) {
for (var t = 0, n = Array(e.length); t < e.length; t++)
n[t] = e[t];
return n
}
return Array.from(e)
}
function x(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function w(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function k(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
function j(e) {
if ((0,
a.default)(e.vertices, function(e) {
return !e.description
})) {
var t = true;
var n = false;
var r = void 0;
try {
for (var i = e.vertices[Symbol.iterator](), o; !(t = (o = i.next()).done); t = true) {
var s = o.value;
s.type = "vertex"
}
} catch (e) {
n = true;
r = e
} finally {
try {
!t && i.return && i.return()
} finally {
if (n)
throw r
}
}
e.vertices[0].description = "face-topleft";
e.vertices[1].description = "face-bottomleft";
e.vertices[2].description = "face-topright";
e.vertices[3].description = "face-bottomright";
e.vertices[4].description = "side-topcorner";
e.vertices[5].description = "side-bottomcorner"
}
return e
}
var E = function(e) {
k(t, e);
function t() {
x(this, t);
return w(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments))
}
o(t, [{
key: "renderLines",
value: function e() {
var t = this;
if (!this.props.layers.lines)
return null;
return this.props.layers.lines.map(function(e, n) {
return c.default.createElement(f.default, {
key: n,
stroke: t.props.color || "white",
strokeWidth: t.props.strokeWidth,
curve: e.spline ? "curveCardinal" : "curveLinear",
points: e.vertices.map(function(e) {
var n = e.x
, r = e.y;
return {
x: n * t.props.zoomLevel,
y: r * t.props.zoomLevel
}
})
})
})
}
}, {
key: "renderPolygons",
value: function e() {
var t = this;
if (!this.props.layers.polygons)
return null;
return this.props.layers.polygons.map(function(e, n) {
return c.default.createElement(f.default, {
key: n,
stroke: t.props.color || "white",
strokeWidth: t.props.strokeWidth,
fill: "rgba(255,255,255,0.15)",
curve: "curveLinear",
points: [].concat(y(e.vertices), [e.vertices[0]]).map(function(e) {
var n = e.x
, r = e.y;
return {
x: n * t.props.zoomLevel,
y: r * t.props.zoomLevel
}
})
})
})
}
}, {
key: "renderBoxes",
value: function e() {
var t = this;
if (!this.props.layers.boxes)
return null;
return this.props.layers.boxes.map(function(e, n) {
return c.default.createElement(f.default, {
key: n,
stroke: t.props.color || "white",
fill: "rgba(255,255,255,0.15)",
strokeWidth: t.props.strokeWidth,
curve: "curveLinear",
points: (0,
b.getBoxPoints)(e).map(function(e) {
var n = e.x
, r = e.y;
return {
x: n * t.props.zoomLevel,
y: r * t.props.zoomLevel
}
})
})
})
}
}, {
key: "renderCuboids",
value: function e() {
var t = this;
if (!this.props.layers.cuboids)
return null;
return this.props.layers.cuboids.map(function(e, n) {
return c.default.createElement(h.default, i({
key: n,
still: true,
color: t.props.color || "white",
readOnly: true,
scale: t.props.zoomLevel,
topOffset: 0,
leftOffset: 0
}, v.default.annotationToCuboid(j(e))))
})
}
}, {
key: "render",
value: function e() {
return c.default.createElement("svg", {
id: "graftingContainer",
className: "jsx-608100292"
}, c.default.createElement("g", {
className: "jsx-608100292"
}, this.renderLines(), this.renderPolygons(), this.renderBoxes(), this.renderCuboids()), c.default.createElement(l.default, {
styleId: "608100292",
css: ["#graftingContainer.jsx-608100292{position:absolute;top:0;left:0;width:100%;height:100%;overflow:visible;pointer-events:none;}"]
}))
}
}]);
return t
}(c.default.Component);
E.defaultProps = {
zoomLevel: 1,
strokeWidth: 1
};
t.default = E
},
11: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
t.CRUISE_EV_PROJECTS = t.NUM_DISTINCT_COLORS = void 0;
var r = n(178);
var a = c(r);
var i = n(183);
var o = c(i);
t.validateAttribute = f;
t.isAnnotationDone = p;
t.requiredAttributesForAnnotation = h;
t.getDefaultAnnotationBreakdown = m;
t.getBreakdownColors = v;
t.getAllChoiceDescendants = b;
t.getBoxPoints = g;
var s = n(9);
var l = c(s);
var u = n(78);
function c(e) {
return e && e.__esModule ? e : {
default: e
}
}
var d = t.NUM_DISTINCT_COLORS = 128;
function f(e, t) {
if ("number" === t.type) {
if (e % 1 !== 0)
return false;
if (e % (t.step || 5) !== 0)
return false;
if (void 0 !== t.min && e < t.min || void 0 !== t.max && e > t.max)
return false
}
return void 0 !== e
}
function p(e, t) {
var n = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2];
if (n && !e.label)
return false;
var r = h(e, t);
if (l.default.isEmpty(r))
return true;
if (l.default.isEmpty(e.attributes))
return false;
return l.default.every(r, function(n, r) {
return f(e.attributes[r], t[r])
})
}
function h(e, t) {
return l.default.pickBy(t, function(t) {
if (t.derived)
return false;
if (!t.conditions)
return true;
if (t.conditions.label_condition && !l.default.includes(t.conditions.label_condition.label, e.label))
return false;
if (t.conditions.attribute_conditions)
return l.default.every(t.conditions.attribute_conditions, function(t) {
if (!e.attributes)
return false;
var n = l.default.keys(t)[0];
var r = l.default.values(t)[0];
return l.default.includes(r, e.attributes[n])
});
return true
})
}
function m(e, t) {
if ((!e || e.length < 2) && l.default.keys(t).length)
return l.default.keys(t)[0];
return "label"
}
function v(e, t, n) {
if ("id" === n) {
var r = [];
for (var a = 0; a < d; a++) {
var i = (65793 * (2050 * a & 139536 | 32800 * a & 558144) >> 16 & 255) / 256;
var s = (0,
u.hslToRgb)(i, 1, .5)
, c = (0,
o.default)(s, 3)
, f = c[0]
, p = c[1]
, h = c[2];
r.push("rgb(" + f + ", " + p + ", " + h + ")")
}
return r
}
var m = t;
var v = void 0;
var g = {};
"label" === n ? v = b(e) : m && m[n] && (v = b(m[n].choices));
l.default.map(v, function(e, t) {
g[e] = u.MaterialA400HexStringOrdered[t]
});
return g
}
function b(e) {
if (!e)
return [];
var t = [];
for (var n = 0; n < e.length; n++) {
var r = e[n];
"object" === ("undefined" === typeof r ? "undefined" : (0,
a.default)(r)) ? r.subchoices ? t = t.concat(b(r.subchoices)) : t.push(r.choice) : t.push(r)
}
return t
}
function g(e) {
return [{
x: Number(e.left),
y: Number(e.top)
}, {
x: Number(e.left) + Number(e.width),
y: Number(e.top)
}, {
x: Number(e.left) + Number(e.width),
y: Number(e.top) + Number(e.height)
}, {
x: Number(e.left),
y: Number(e.top) + Number(e.height)
}, {
x: Number(e.left),
y: Number(e.top)
}]
}
var y = t.CRUISE_EV_PROJECTS = {
standard: "5a6519303e294d4135869402",
bot: "5a7a2a8afb6ce4630a7ce065"
}
},
119: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var a = n(0);
var i = c(a);
var o = n(418);
var s = u(o);
var l = n(78);
function u(e) {
if (e && e.__esModule)
return e;
var t = {};
if (null != e)
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]);
t.default = e;
return t
}
function c(e) {
return e && e.__esModule ? e : {
default: e
}
}
function d(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function f(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function p(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var h = function(e) {
p(t, e);
function t() {
d(this, t);
return f(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments))
}
r(t, [{
key: "curveFunction",
value: function e(t) {
var e = s.line().x(function(e) {
return e.x
}).y(function(e) {
return e.y
}).curve(s[this.props.curve]);
return e(t)
}
}, {
key: "componentDidMount",
value: function e() {
this.lineGraph = s.select(this.path).insert("path").attr("d", this.curveFunction(this.props.points)).attr("stroke", this.props.stroke).attr("stroke-width", this.props.strokeWidth).attr("fill", this.props.fill).attr("fill-opacity", this.props.fillOpacity).attr("class", "LabeledPath__labeled-polygon")
}
}, {
key: "componentDidUpdate",
value: function e() {
if (this.lineGraph) {
this.lineGraph.attr("d", this.curveFunction(this.props.points));
this.lineGraph.attr("stroke", this.props.stroke);
this.lineGraph.attr("stroke-width", this.props.strokeWidth);
this.lineGraph.attr("fill", this.props.fill);
this.lineGraph.attr("fill-opacity", this.props.fillOpacity)
}
}
}, {
key: "render",
value: function e() {
var t = this;
return i.default.createElement("g", {
ref: function e(n) {
t.path = n
}
})
}
}]);
return t
}(a.Component);
h.defaultProps = {
curve: "curveLinear",
fill: "none",
fillOpacity: 1,
stroke: l.MaterialA400HexString.lightblue,
strokeWidth: 2
};
t.default = h
},
121: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var a = n(1);
var i = c(a);
var o = n(0);
var s = c(o);
var l = n(2);
var u = c(l);
function c(e) {
return e && e.__esModule ? e : {
default: e
}
}
function d(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function f(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function p(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var h = function(e) {
p(t, e);
function t() {
d(this, t);
return f(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments))
}
r(t, [{
key: "render",
value: function e() {
var t = this;
return s.default.createElement("div", {
className: "jsx-2086084777"
}, s.default.createElement("div", {
style: this.props.style,
className: "jsx-2086084777 toggle-button"
}, this.props.options.map(function(e) {
return s.default.createElement("div", {
style: t.props.itemStyle,
key: e.value,
onClick: function n() {
return !t.props.disabled && t.props.onChange(e.value)
},
className: "jsx-2086084777 " + ((0,
u.default)("item", {
active: t.props.selected === e.value,
disabled: t.props.disabled,
blue: t.props.blue
}) || "")
}, e.title)
})), s.default.createElement(i.default, {
styleId: "2086084777",
css: [".toggle-button.jsx-2086084777{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;text-align:center;-webkit-box-shadow:0 2px 12px rgba(0,0,0,.1);box-shadow:0 2px 12px rgba(0,0,0,.1);font-size:14px;font-weight:bold;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border-radius:8px;overflow:hidden;}", ".toggle-button.jsx-2086084777 .item.jsx-2086084777{text-align:center;padding:8px 12px;background:rgba(0,0,0,0.05);color:rgba(0,0,0,0.3);height:100%;-webkit-box-flex:1;-ms-flex-positive:1;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-transition:all 0.1s;-webkit-transition:all 0.1s;transition:all 0.1s;}", ".toggle-button.jsx-2086084777 .active.item.jsx-2086084777{background:white;color:#333;cursor:default;}", ".toggle-button.jsx-2086084777 .active.item.blue.jsx-2086084777{background:#30c2fe;color:#fff;}", ".toggle-button.jsx-2086084777 .item.disabled.jsx-2086084777{pointer-events:none;opacity:0.7;}", ".toggle-button.jsx-2086084777 .item.jsx-2086084777:not(.active){cursor:pointer;}", ".toggle-button.jsx-2086084777 .item.jsx-2086084777:not(.active) .blue.jsx-2086084777{color:#000;}", ".toggle-button.jsx-2086084777 .item.jsx-2086084777:not(.active):hover{background:rgba(0,0,0,0.04);}"]
}))
}
}]);
return t
}(s.default.Component);
t.default = h
},
122: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = n(7);
var a = g(r);
var i = n(32);
var o = g(i);
var s = n(24);
var l = g(s);
var u = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var c = n(1);
var d = g(c);
var f = n(0);
var p = g(f);
var h = n(2);
var m = g(h);
var v = n(20);
var b = g(v);
function g(e) {
return e && e.__esModule ? e : {
default: e
}
}
function y(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function x(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function w(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var k = function(e) {
w(t, e);
function t() {
y(this, t);
return x(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments))
}
u(t, [{
key: "render",
value: function e() {
var t = this;
if ((0,
l.default)(this.props.attrDefinitions))
return null;
var n = ["label"];
n = n.concat((0,
o.default)(this.props.attrDefinitions));
return p.default.createElement("div", {
className: "jsx-3019062785 breakdown-selector"
}, p.default.createElement("div", {
className: "jsx-3019062785 breakdown-selector__header"
}, p.default.createElement("strong", {
className: "jsx-3019062785"
}, "Show details by"), p.default.createElement("em", {
className: "jsx-3019062785"
}, p.default.createElement(b.default, null, "c"), " to cycle")), p.default.createElement("div", {
className: "jsx-3019062785 breakdown-selector__options"
}, (0,
a.default)(n, function(e) {
return p.default.createElement("span", {
key: e,
onClick: function n() {
return t.props.handleBreakdownSelect(e)
},
className: "jsx-3019062785 " + ((0,
m.default)("breakdown-selector__option", {
selected: t.props.selectedBreakdown === e
}) || "")
}, e)
})), p.default.createElement(d.default, {
styleId: "3019062785",
css: [".breakdown-selector.jsx-3019062785{background:var(--bg-gray-light-1);padding:12px 24px;}", ".breakdown-selector__header.jsx-3019062785{margin-bottom:12px;display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;font-size:13px;font-weight:bold;text-transform:uppercase;-webkit-letter-spacing:1px;-moz-letter-spacing:1px;-ms-letter-spacing:1px;letter-spacing:1px;}", ".breakdown-selector__header.jsx-3019062785 strong.jsx-3019062785{color:black;}", ".breakdown-selector__header.jsx-3019062785 em.jsx-3019062785{font-style:normal;opacity:0.4;}", ".breakdown-selector__options.jsx-3019062785{display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;}", ".breakdown-selector__option.jsx-3019062785{margin-right:8px;margin-bottom:8px;padding:4px 12px;background:white;border-radius:var(--border-radius);border:1px solid rgba(0,0,0,0.1);-webkit-box-shadow:0px 2px 6px rgba(0,0,0,0.05);box-shadow:0px 2px 6px rgba(0,0,0,0.05);font-size:13px;font-weight:bold;-webkit-transition:all 0.2s;-webkit-transition:all 0.2s;transition:all 0.2s;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}", ".breakdown-selector__option.jsx-3019062785:hover{background:rgba(0,0,0,0.05);}", ".breakdown-selector__option.selected.jsx-3019062785{background:rgba(0,0,0,0.7);border:1px solid rgba(0,0,0,0.7);color:white;}", ".breakdown-selector__option.selected.jsx-3019062785:hover{background:rgba(0,0,0,0.7);}"]
}))
}
}]);
return t
}(p.default.Component);
k.defaultProps = {
attrDefinitions: {},
selectedBreakdown: null,
handleBreakdownSelect: function e() {}
};
t.default = k
},
125: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
t.Slider = void 0;
var r = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var a = n(1);
var i = f(a);
var o = n(0);
var s = f(o);
var l = n(2);
var u = f(l);
var c = n(4);
var d = f(c);
function f(e) {
return e && e.__esModule ? e : {
default: e
}
}
function p(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function h(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function m(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var v = t.Slider = function(e) {
m(t, e);
function t(e) {
p(this, t);
var n = h(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
n.state = {
isAdjusting: false
};
(0,
d.default)(n, "handleMouseDown", "handleMouseMove", "handleMouseUp");
return n
}
r(t, [{
key: "componentDidMount",
value: function e() {
window.addEventListener("mousemove", this.handleMouseMove);
window.addEventListener("mouseup", this.handleMouseUp)
}
}, {
key: "componentWillUnmount",
value: function e() {
window.removeEventListener("mousemove", this.handleMouseMove);
window.removeEventListener("mouseup", this.handleMouseUp)
}
}, {
key: "getSliderPosition",
value: function e(t) {
var n = void 0;
if (this.props.vertical) {
var r = Math.max(t.clientY - this.slider.getBoundingClientRect().top, 0);
n = Math.min(r / this.slider.getBoundingClientRect().height, 1)
} else {
var a = Math.max(t.clientX - this.slider.getBoundingClientRect().left, 0);
n = Math.min(a / this.slider.getBoundingClientRect().width, 1)
}
this.props.step && (n = Math.round(n / this.props.step) * this.props.step);
return n
}
}, {
key: "handleMouseDown",
value: function e() {
this.setState({
isAdjusting: true
})
}
}, {
key: "handleMouseMove",
value: function e(t) {
if (!this.state.isAdjusting)
return;
this.props.onAdjust(this.getSliderPosition(t), "mousemove")
}
}, {
key: "handleMouseUp",
value: function e(t) {
if (!this.state.isAdjusting)
return;
this.props.onAdjust(this.getSliderPosition(t), "mouseup");
this.setState({
isAdjusting: false
})
}
}, {
key: "renderVertical",
value: function e() {
var t = this;
var n = (0,
u.default)("slider__track", {
"slider__track--minimal": "minimal" === this.props.theme
});
return s.default.createElement("div", {
ref: function e(n) {
t.slider = n
},
onMouseDown: this.handleMouseDown,
className: "jsx-283219880 " + (n || "")
}, s.default.createElement("div", {
style: {
height: 100 * this.props.position + "%"
},
className: "jsx-283219880 slider__progress"
}, s.default.createElement("div", {
className: "jsx-283219880 slider__thumb"
})), s.default.createElement(i.default, {
styleId: "283219880",
css: [".slider__track.jsx-283219880{-webkit-box-flex:1;-ms-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border-radius:6px;cursor:pointer;height:100%;margin:0 auto;}", ".slider__progress.jsx-283219880{position:relative;border-radius:6px;}", ".slider__thumb.jsx-283219880{position:absolute;}", ".slider__track--minimal.jsx-283219880{width:8px;background-color:rgba(0,0,0,0.1);-webkit-box-shadow:0 0px 2px rgba(0,0,0,0.1),0 2px 4px rgba(0,0,0,0.05);box-shadow:0 0px 2px rgba(0,0,0,0.1),0 2px 4px rgba(0,0,0,0.05);}", ".slider__track--minimal.jsx-283219880 .slider__progress.jsx-283219880{background-color:rgba(255,255,255,1);width:100%;}", ".slider__track--minimal.jsx-283219880 .slider__thumb.jsx-283219880{width:20px;height:20px;border-radius:10px;bottom:0;-webkit-transform-origin:top left;-webkit-transform-origin:top left;-ms-transform-origin:top left;transform-origin:top left;-webkit-transform:translate(-50%,50%);-webkit-transform:translate(-50%,50%);-ms-transform:translate(-50%,50%);transform:translate(-50%,50%);margin-left:4px;background:rgba(0,0,0,0.7);-webkit-box-shadow:0px 2px 4px rgba(0,0,0,0.1);box-shadow:0px 2px 4px rgba(0,0,0,0.1);border:3px solid rgba(255,255,255,1);}"]
}))
}
}, {
key: "render",
value: function e() {
var t = this;
var n = (0,
u.default)("slider__track", {
"slider__track--dark": !this.props.theme,
"slider__track--light": "light" === this.props.theme,
"slider__track--minimal": "minimal" === this.props.theme,
"slider__track--tinywhite": "tinywhite" === this.props.theme
});
if (this.props.vertical)
return this.renderVertical();
return s.default.createElement("div", {
ref: function e(n) {
t.slider = n
},
onMouseDown: this.handleMouseDown,
className: "jsx-2037401711 " + (n || "")
}, s.default.createElement("div", {
style: {
width: 100 * this.props.position + "%"
},
className: "jsx-2037401711 slider__progress"
}, s.default.createElement("div", {
className: "jsx-2037401711 slider__thumb"
})), s.default.createElement(i.default, {
styleId: "2037401711",
css: [".slider__track.jsx-2037401711{-webkit-box-flex:1;-ms-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border-radius:6px;cursor:pointer;}", ".slider__progress.jsx-2037401711{position:relative;border-radius:6px;}", ".slider__thumb.jsx-2037401711{position:absolute;}", ".slider__track--dark.jsx-2037401711{height:12px;background-color:rgba(0,0,0,0.3);-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.3);box-shadow:inset 0 2px 4px rgba(0,0,0,0.3);}", ".slider__track--dark.jsx-2037401711 .slider__progress.jsx-2037401711{background-color:#78bac9;-webkit-box-shadow:0 1px rgba(0,0,0,.2);box-shadow:0 1px rgba(0,0,0,.2);}", ".slider__track--dark.jsx-2037401711 .slider__thumb.jsx-2037401711{width:18px;height:18px;border-radius:9px;right:-9px;margin:-3px 0 0 -3px;background-color:#637c8a;-webkit-box-shadow:0 2px 4px rgba(0,0,0,.3),0 0 4px rgba(0,0,0,.3),inset 0 1px 0 rgba(255,255,255,.2);box-shadow:0 2px 4px rgba(0,0,0,.3),0 0 4px rgba(0,0,0,.3),inset 0 1px 0 rgba(255,255,255,.2);}", ".slider__track--light.jsx-2037401711{height:12px;background-color:#ddd;-webkit-box-shadow:none;box-shadow:none;}", ".slider__track--light.jsx-2037401711 .slider__progress.jsx-2037401711{background-color:#bbb;-webkit-box-shadow:none;box-shadow:none;}", ".slider__track--light.jsx-2037401711 .slider__thumb.jsx-2037401711{width:18px;height:18px;border-radius:9px;right:-9px;margin:-3px 0 0 -3px;background-color:#637c8a;-webkit-box-shadow:0 2px 4px rgba(0,0,0,.1),0 0 4px rgba(0,0,0,.1);box-shadow:0 2px 4px rgba(0,0,0,.1),0 0 4px rgba(0,0,0,.1);}", ".slider__track--minimal.jsx-2037401711{height:8px;background-color:rgba(0,0,0,0.1);-webkit-box-shadow:0 0px 2px rgba(0,0,0,0.1),0 2px 4px rgba(0,0,0,0.05);box-shadow:0 0px 2px rgba(0,0,0,0.1),0 2px 4px rgba(0,0,0,0.05);}", ".slider__track--minimal.jsx-2037401711 .slider__progress.jsx-2037401711{background-color:rgba(255,255,255,1);height:100%;}", ".slider__track--minimal.jsx-2037401711 .slider__thumb.jsx-2037401711{width:20px;height:20px;border-radius:10px;right:0;-webkit-transform-origin:top left;-webkit-transform-origin:top left;-ms-transform-origin:top left;transform-origin:top left;-webkit-transform:translate(50%,-50%);-webkit-transform:translate(50%,-50%);-ms-transform:translate(50%,-50%);transform:translate(50%,-50%);margin-top:3px;background:rgba(0,0,0,0.7);-webkit-box-shadow:0px 2px 4px rgba(0,0,0,0.1);box-shadow:0px 2px 4px rgba(0,0,0,0.1);border:3px solid rgba(255,255,255,1);}", ".slider__track--tinywhite.jsx-2037401711{height:4px;background-color:rgba(255,255,255,0.5);}", ".slider__track--tinywhite.jsx-2037401711 .slider__progress.jsx-2037401711{background-color:rgba(255,255,255,1);height:100%;}", ".slider__track--tinywhite.jsx-2037401711 .slider__thumb.jsx-2037401711{width:10px;height:10px;border-radius:10px;right:0;-webkit-transform-origin:top left;-webkit-transform-origin:top left;-ms-transform-origin:top left;transform-origin:top left;-webkit-transform:translate(50%,-50%);-webkit-transform:translate(50%,-50%);-ms-transform:translate(50%,-50%);transform:translate(50%,-50%);margin-top:1px;background:white;border:2px solid rgba(255,255,255,0.7);}"]
}))
}
}]);
return t
}(s.default.Component);
v.defaultProps = {
step: null
};
t.default = v
},
132: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
t.getDistance = t.getCenter = t.DRAGGING_PATH = t.GROUPING = t.LABELING = t.DRAWING = t.STARTING = t.OFF_OPACITY = t.DISTANCE_THRESHOLD = void 0;
var r = n(268);
var a = $(r);
var i = n(14);
var o = $(i);
var s = n(22);
var l = $(s);
var u = n(24);
var c = $(u);
var d = n(7);
var f = $(d);
var p = n(34);
var h = $(p);
var m = n(18);
var v = $(m);
var b = n(222);
var g = $(b);
var y = n(198);
var x = $(y);
var w = n(131);
var k = $(w);
var j = n(193);
var E = $(j);
var _ = n(235);
var S = $(_);
var C = n(360);
var P = $(C);
var O = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var r in n)
Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
}
return e
}
;
var A = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
t.ImagePathLabelerStyles = pe;
var M = n(1);
var I = $(M);
var L = n(0);
var T = $(L);
var R = n(2);
var F = $(R);
var N = n(8);
var D = $(N);
var z = n(4);
var B = $(z);
var V = n(50);
var W = $(V);
var U = n(11);
var H = n(78);
var G = n(88);
var Y = n(149);
var K = $(Y);
var Q = n(201);
var q = $(Q);
var Z = n(119);
var X = $(Z);
var J = n(25);
function $(e) {
return e && e.__esModule ? e : {
default: e
}
}
function ee(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function te(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function ne(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var re = t.DISTANCE_THRESHOLD = 5;
var ae = t.OFF_OPACITY = .4;
var ie = t.STARTING = 1;
var oe = t.DRAWING = 2;
var se = t.LABELING = 3;
var le = t.GROUPING = 4;
var ue = t.DRAGGING_PATH = 6;
var ce = function e(t) {
return (0,
P.default)(t, "Closed") ? t.substring(0, t.length - "Closed".length) : t
};
var de = t.getCenter = function e(t, n) {
var r = (0,
S.default)(n.map(function(e) {
return e.x
}));
var a = (0,
S.default)(n.map(function(e) {
return e.y
}));
var i = (0,
E.default)(n.map(function(e) {
return e.x
}));
var o = (0,
E.default)(n.map(function(e) {
return e.y
}));
return {
x: (r + i) / 2 * t,
y: (a + o) / 2 * t
}
}
;
var fe = t.getDistance = function e(t, n) {
return Math.sqrt(Math.pow(t.x - n.x, 2) + Math.pow(t.y - n.y, 2))
}
;
function pe() {
return T.default.createElement(I.default, {
styleId: "4125544170",
css: [".ImagePathLabeler{position:relative;margin:0 auto;}", ".ImagePathLabeler img{max-width:none;}", ".ImagePathLabeler__canvas{position:absolute;top:0;left:0;}", ".ImagePathLabeler__canvas.is-dragging{cursor:move;}", ".ImagePathLabeler__positioned-label{white-space:nowrap;}", ".ImagePathLabeler__paths,.ImagePathLabeler__label-container{position:absolute;top:0;right:0;bottom:0;left:0;}", ".ImagePathLabeler__label-container.is-dragging .ImagePathLabeler__label{cursor:move;}", ".ImagePathLabeler__label-selector{position:absolute;}", ".ImagePathLabeler__label{z-index:20;margin:4px;padding:4px 12px;border-radius:2px;background-color:#202020;color:white;font-size:14px;font-weight:600;text-align:center;cursor:pointer;-ms-user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;-webkit-transition:all 0.2s;-webkit-transition:all 0.2s;transition:all 0.2s;}", ".ImagePathLabeler__label.unselectable{cursor:default;}", ".ImagePathLabeler__label.focused{background:white;color:black;}", ".ImagePathLabeler__label.selected{background:var(--color-primary);color:white;}", ".ImagePathLabeler__save-link,.ImagePathLabeler__delete-link{z-index:20;margin-left:2px;margin:4px;padding:4px 12px;border-radius:2px;background-color:#202020;color:white;cursor:pointer;-webkit-transition:all 0.2s;-webkit-transition:all 0.2s;transition:all 0.2s;}", ".ImagePathLabeler__save-link:hover{background:var(--color-accept);}", ".ImagePathLabeler__delete-link:hover{background:var(--color-reject);}", ".ImagePathLabeler__delete-link:hover{background:var(--color-reject);}"]
})
}
var he = function(e) {
ne(t, e);
function t(e, n) {
ee(this, t);
var r = te(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n));
if (!e.src)
throw new Error("No image source was defined.");
r.state = {
paths: e.paths,
drawState: ie,
currentPathPoints: [],
currentNextPoint: null,
hoveredPath: null,
pathDragStart: null,
pathToDrag: null,
currentPoint: null
};
(0,
B.default)(r, "mouseEventToPoint", "updateImage", "finishPolygon", "finishPath", "reset", "onKeyDown", "onCanvasMouseMove", "onCanvasMouseDown", "onCanvasMouseUp", "onCanvasClick", "onPathClick", "handleChange", "handleImageLoad", "handlePathUpdate", "handleAnnotationUpdate", "handlePointAdd", "handlePointSelect", "handleLabelMouseDown", "handleLabelMouseUp", "handleLabelMouseMove", "setSelectedPathId", "renderAnnotationDetails");
r.END_POINT = "first";
r.PATH_TYPE = "polygon";
r.elements = {};
return r
}
A(t, [{
key: "componentDidMount",
value: function e() {
window.addEventListener("keydown", this.onKeyDown)
}
}, {
key: "componentWillUnmount",
value: function e() {
window.removeEventListener("keydown", this.onKeyDown)
}
}, {
key: "componentWillReceiveProps",
value: function e(t) {
t.paths !== this.props.paths && this.setState({
paths: t.paths
});
if (t.readOnly !== this.props.readOnly) {
this.reset();
this.props.handleAnnotationSelect(null)
}
}
}, {
key: "componentDidUpdate",
value: function e(t) {
var n = this.props.selectedAnnotationId || this.props.focusedAnnotationId;
var r = t.selectedAnnotationId || t.focusedAnnotationId;
n && n !== r && this.elements[n] && (0,
G.scrollIntoViewIfNeeded)(this.elements[n])
}
}, {
key: "setStateAsync",
value: function e(t) {
var n = this;
return new Promise(function(e) {
return n.setState(t, e)
}
)
}
}, {
key: "mouseEventToPoint",
value: function e(t) {
var n = this.sourceImage;
var r = n.getBoundingClientRect();
return {
x: (t.nativeEvent.clientX - r.left) / this.props.zoomLevel,
y: (t.nativeEvent.clientY - r.top) / this.props.zoomLevel
}
}
}, {
key: "isDuplicatePoint",
value: function e() {
return fe(this.state.currentPathPoints[0], (0,
k.default)(this.state.currentPathPoints)) < re
}
}, {
key: "updateImage",
value: function e() {
var t = this.sourceImage;
this.setState({
imageWidth: t.naturalWidth,
imageHeight: t.naturalHeight
})
}
}, {
key: "reset",
value: function e() {
this.setState({
currentPoint: null,
currentPathPoints: [],
currentNextPoint: null,
drawState: ie
})
}
}, {
key: "finishPath",
value: function e() {
this.props.isGroupingEnabled && this.props.selectedGroup ? this.finishPathFragment() : this.props.labels && this.props.labels.length > 2 && this.props.labels.length < 6 ? this.setState({
drawState: se,
currentNextPoint: null
}) : this.props.labels && 1 === this.props.labels.length ? this.finishPathWithLabel(this.state.currentPathPoints, (0,
x.default)(this.props.labels)) : this.finishPathWithLabel(this.state.currentPathPoints, null)
}
}, {
key: "finishPathWithLabel",
value: function e(t, n) {
var r = this;
var a = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
var i = arguments[3];
var o = {
key: W.default.v4(),
vertices: t,
label: n,
attributes: a,
parent: i
};
var s = void 0;
i ? s = i : (0,
U.isAnnotationDone)(o, this.props.attributeDefinitions) || (s = o.key);
this.setState({
paths: this.state.paths.concat([o])
}, function() {
r.reset();
r.handleChange();
r.handlePathFinish && r.handlePathFinish();
r.setSelectedPathId(s);
r.props.resetAnnotationVisibility()
})
}
}, {
key: "finishPathFragment",
value: function e() {
this.finishPathWithLabel(this.state.currentPathPoints, null, null, this.props.selectedGroup)
}
}, {
key: "finishPolygon",
value: function e() {
var t = this;
if (this.state.drawState === oe) {
var n = (0,
g.default)(this.state.currentPathPoints);
this.setState({
currentPathPoints: n
}, function() {
return t.finishPath()
})
}
}
}, {
key: "closePolygon",
value: function e() {
var t = this;
if (this.state.drawState === oe) {
if (this.state.currentPathPoints.length < this.props.minPoints)
return;
var n = this.state.currentPathPoints;
this.setState({
currentPathPoints: n
}, function() {
return t.finishPath()
})
}
}
}, {
key: "deleteCurrentPoint",
value: function e() {
if (!this.state.currentPoint)
return;
var t = this.state.currentPoint
, n = t.pathKey
, r = t.pointIndex;
var a = (0,
v.default)(this.state.paths, function(e) {
return e.key === n
}).vertices;
if (a.length === this.props.minPoints)
return;
a.splice(r, 1);
this.setState({
currentPoint: null
});
this.handlePathUpdate(n, a)
}
}, {
key: "deletePath",
value: function e(t) {
t === this.props.selectedGroup && this.props.handleGroupingCancel();
this.setState({
paths: this.state.paths.filter(function(e) {
return e.key !== t && e.parent !== t
})
}, this.handleChange)
}
}, {
key: "setSelectedPathId",
value: function e(t) {
this.setState({
pathToDrag: null,
currentPoint: null
});
this.props.handleAnnotationSelect(t)
}
}, {
key: "handleImageLoad",
value: function e(t) {
this.props.onLoad && this.props.onLoad(t);
this.updateImage()
}
}, {
key: "handleChange",
value: function e() {
this.props.onChange && this.props.onChange(this.state.paths)
}
}, {
key: "handlePathUpdate",
value: function e(t, n) {
var r = this.state.paths.map(function(e, r) {
return r === t || e.key === t ? {
key: e.key,
vertices: n,
label: e.label,
attributes: e.attributes,
parent: e.parent
} : e
});
this.setState({
paths: r
}, this.handleChange)
}
}, {
key: "handleAnnotationUpdate",
value: function e(t, n, r) {
n && (t.label = n);
r && (t.attributes = r);
this.handleChange()
}
}, {
key: "handleSelectLabel",
value: function e(t) {
this.state.drawState === se && this.finishPathWithLabel(this.state.currentPathPoints, t)
}
}, {
key: "onKeyDown",
value: function e(t) {
if (this.state.drawState === ie) {
if ("Enter" === t.key)
this.setSelectedPathId(null);
else if ("Backspace" === t.key)
this.deleteCurrentPoint();
else if ("Escape" === t.key) {
this.setSelectedPathId(null);
this.setState({
currentPoint: null
})
}
} else if (this.state.drawState === oe)
if ("Enter" === t.key)
this.closePolygon();
else if ("Backspace" === t.key) {
var n = (0,
g.default)(this.state.currentPathPoints);
n.length ? this.setState({
currentPathPoints: n
}) : this.reset()
} else
"Escape" === t.key && this.reset();
else
this.state.drawState === se && "Escape" === t.key && this.reset()
}
}, {
key: "onCanvasMouseMove",
value: function e(t) {
this.state.drawState === oe ? this.setState({
currentNextPoint: this.mouseEventToPoint(t)
}) : this.state.drawState === ue && this.handleLabelMouseMove(t)
}
}, {
key: "onCanvasMouseDown",
value: function e(t) {
var n = this;
var r = this.mouseEventToPoint(t);
if (this.state.drawState === ie) {
this.props.selectedAnnotationId && !this.props.selectedGroup ? this.setSelectedPathId(null) : this.props.canAddPath && this.setState({
drawState: oe,
currentPathPoints: [r],
currentPoint: null
});
return
}
if (this.state.drawState === oe) {
if ("last" !== this.END_POINT && (0,
h.default)(r, (0,
k.default)(this.state.currentPathPoints)))
return;
this.setState({
currentPathPoints: this.state.currentPathPoints.concat([r])
}, function() {
n.isDuplicatePoint() ? n.state.currentPathPoints.length >= n.props.minPoints + 1 ? n.finishPolygon() : n.setState({
currentPathPoints: (0,
g.default)(n.state.currentPathPoints)
}) : n.state.currentPathPoints.length === n.props.maxPoints && n.closePolygon()
});
return
}
}
}, {
key: "onCanvasMouseUp",
value: function e() {
this.state.drawState === ue && this.setState({
drawState: ie,
pathToDrag: null
})
}
}, {
key: "onCanvasClick",
value: function e(t) {
t.preventDefault();
t.stopPropagation()
}
}, {
key: "onPathClick",
value: function e(t) {
t.preventDefault();
t.stopPropagation()
}
}, {
key: "handlePointAdd",
value: function e(t, n, r) {
var a = (0,
v.default)(this.state.paths, function(e) {
return e.key === n
}).vertices;
a.splice(r, 0, this.mouseEventToPoint(t));
this.handlePathUpdate(n, a);
this.setState({
currentPoint: {
pathKey: n,
pointIndex: r
}
})
}
}, {
key: "handlePointSelect",
value: function e(t, n, r) {
t.stopPropagation();
if (this.props.readOnly)
return;
if (this.state.drawState !== ie)
return;
this.setState({
currentPoint: {
pathKey: n,
pointIndex: r
}
})
}
}, {
key: "handleLabelMouseDown",
value: function e(t, n) {
var r = n.parent ? (0,
v.default)(this.state.paths, function(e) {
return e.key === n.parent
}) : n;
if (!this.props.readOnly) {
this.setSelectedPathId(r.key);
this.state.drawState === ie && this.setState({
drawState: ue,
pathDragStart: {
x: t.clientX,
y: t.clientY
},
pathToDrag: n.key
})
}
}
}, {
key: "handleLabelMouseUp",
value: function e() {
this.state.drawState === ue && this.setState({
drawState: ie
})
}
}, {
key: "handleLabelMouseMove",
value: function e(t) {
var n = this;
if (this.state.drawState === ue) {
t.preventDefault();
t.stopPropagation();
var r = (0,
v.default)(this.state.paths, function(e) {
return e.key === n.state.pathToDrag
});
var a = (0,
f.default)(r.vertices, function(e) {
return {
x: e.x + (t.clientX - n.state.pathDragStart.x) / n.props.zoomLevel,
y: e.y + (t.clientY - n.state.pathDragStart.y) / n.props.zoomLevel
}
});
this.setState({
pathDragStart: {
x: t.clientX,
y: t.clientY
}
});
this.handlePathUpdate(r.key, a)
}
}
}, {
key: "renderStyles",
value: function e() {
return T.default.createElement(pe, null)
}
}, {
key: "renderImage",
value: function e() {
var t = this;
var n = {
maxWidth: "none",
width: this.imageWidth ? this.imageWidth : "auto",
height: this.imageHeight ? this.imageHeight : "auto",
filter: "brightness(" + 100 * this.props.imageBrightness + "%) contrast(" + 100 * this.props.imageContrast + "%)"
};
return T.default.createElement("img", {
ref: function e(n) {
t.sourceImage = n
},
src: this.props.src,
style: n,
onLoad: function e() {
return t.handleImageLoad(true)
},
onError: function e() {
return t.handleImageLoad(false)
}
})
}
}, {
key: "renderAnnotationPicker",
value: function e(t, n, r, a) {
var i = this;
return T.default.createElement("div", {
style: {
position: "absolute",
top: 32,
left: 0
}
}, T.default.createElement(K.default, {
enableAutoPositioning: !this.props.failedTask,
key: n,
labels: this.props.labels,
labelSelection: t.label,
updateLabelSelection: function e(n) {
return i.handleAnnotationUpdate(t, n, void 0)
},
attributes: this.props.attributeDefinitions,
attributeSelections: t.attributes || {},
updateAttributeSelections: function e(n) {
return i.handleAnnotationUpdate(t, void 0, n)
},
showConfirmButton: true,
confirmLabelAndAttributes: function e() {
return i.setSelectedPathId(null)
},
readOnly: this.props.readOnly || a && !r
}))
}
}, {
key: "renderAnnotationLabel",
value: function e(t, n, r) {
var a = this;
var i = (0,
F.default)("ImagePathLabeler__label", {
unselectable: this.props.readOnly,
focused: n,
selected: r
});
var o = t.parent ? (0,
v.default)(this.state.paths, function(e) {
return e.key === t.parent
}) : t;
var s = (0,
J.getAnnotationText)(o, this.props.selectedBreakdown, "polygon");
t.parent && (s = T.default.createElement("span", null, s, " ", T.default.createElement("span", {
style: {
opacity: .35
}
}, "fragment")));
return T.default.createElement("div", {
className: "ImagePathLabeler__label-group"
}, s && T.default.createElement("span", {
onMouseDown: function e(n) {
return a.handleLabelMouseDown(n, t)
},
onMouseUp: function e(t) {
return a.handleLabelMouseUp(t, o)
},
onMouseMove: function e(t) {
return a.handleLabelMouseMove(t)
},
onMouseEnter: function e() {
return a.props.handleAnnotationFocus(o.key)
},
onMouseLeave: function e() {
return a.props.handleAnnotationFocus(null)
},
className: i
}, s), !this.props.readOnly && this.props.canDeletePath && T.default.createElement("a", {
className: "ImagePathLabeler__delete-link",
onClick: function e() {
return a.deletePath(t.key)
}
}, T.default.createElement(D.default, {
name: "trash"
})))
}
}, {
key: "renderAnnotationDetails",
value: function e(t, n) {
var r = this;
var a = t.parent ? (0,
v.default)(this.state.paths, function(e) {
return e.key === t.parent
}) : t;
var i = this.props.selectedAnnotationId && this.props.selectedAnnotationId === a.key;
var o = this.props.focusedAnnotationId && this.props.focusedAnnotationId === a.key;
var s = this.props.showLabelBox && o && a.attributes;
var l = 0;
this.state.drawState === ie && (l += 20);
(i || o) && (l += 10);
return T.default.createElement("div", {
ref: function e(n) {
r.elements[t.key] = n
},
key: this.props.readOnly ? n : t.key,
className: "ImagePathLabeler__positioned-label",
style: {
position: "absolute",
top: de(this.props.zoomLevel, t.vertices).y,
left: de(this.props.zoomLevel, t.vertices).x,
zIndex: l
}
}, this.renderAnnotationLabel(t, o, i), s && this.renderAnnotationPicker(t, n, i, o))
}
}, {
key: "renderLabels",
value: function e(t) {
if (this.props.annotationVisibility < J.AnnotationVisibility.SHOW_LABELS)
return null;
if ((0,
c.default)(this.state.paths))
return null;
var n = (0,
F.default)("ImagePathLabeler__label-container", {
"is-dragging": this.state.drawState === ue
});
return T.default.createElement("div", {
className: n,
style: {
opacity: (0,
l.default)([ie, ue], this.state.drawState) ? 1 : ae
}
}, t.map(this.renderAnnotationDetails))
}
}, {
key: "renderCurrentPath",
value: function e() {
var t = this;
var n = this.state.drawState === oe ? ce(this.props.curve) : this.props.curve;
var r = this.state.currentPathPoints;
var a = r.concat(this.state.currentNextPoint ? [this.state.currentNextPoint] : []);
a = a.map(function(e) {
return {
x: e.x * t.props.zoomLevel,
y: e.y * t.props.zoomLevel
}
});
var i = this.state.drawState === oe && this.state.currentNextPoint && r.length > 2 && fe(r[0], this.state.currentNextPoint) < re;
var o = "rgba(0, 255, 0, 0.8)";
var s = H.MaterialA400HexString.lightblue;
var l = this.props.pointFill;
if (this.props.isGroupingEnabled && this.props.selectedGroup) {
var u = (0,
v.default)(this.state.paths, function(e) {
return e.key === t.props.selectedGroup
});
var c = (0,
J.getAnnotationColor)(u, this.props.selectedBreakdown, this.props.breakdownColors);
s = c;
l = c;
o = c
}
return T.default.createElement("g", null, T.default.createElement(X.default, {
curve: n,
points: a,
stroke: s,
fill: o,
fillOpacity: .4
}), r.map(function(e, n) {
var r = e.x * t.props.zoomLevel;
var a = e.y * t.props.zoomLevel;
return T.default.createElement("g", {
key: n
}, T.default.createElement("circle", {
key: r + "," + a + "#" + n,
cx: r,
cy: a,
r: 0 === n && i ? 4 : 3,
stroke: "black",
strokeWidth: t.props.lineWidth,
fill: 0 === n && i ? t.props.pointFillHighlight : l
}), t.props.shouldDisplayOrdering && T.default.createElement("g", null, T.default.createElement("circle", {
cx: r + 10,
cy: a - 10 - 6,
r: 12,
style: {
fill: "rgba(0, 0, 0, 0.6)"
}
}), T.default.createElement("text", {
x: r + 10,
y: a - 10,
style: {
fontWeight: "bold",
fill: "white"
},
textAnchor: "middle"
}, n + 1)))
}))
}
}, {
key: "renderPath",
value: function e(t, n, r) {
var a = this;
var i = r ? 1 : ae;
var o = !r || this.props.readOnly;
var s = t.parent ? (0,
v.default)(this.state.paths, function(e) {
return e.key === t.parent
}) : t;
var l = (0,
J.getAnnotationColor)(s, this.props.selectedBreakdown, this.props.breakdownColors);
return T.default.createElement("g", {
key: t.key || n,
opacity: i
}, T.default.createElement(q.default, {
keyName: t.key,
readOnly: o,
isWrong: this.props.failedTask && !t.correct,
curve: this.props.curve,
points: t.vertices,
currentPoint: this.state.currentPoint,
showLabels: this.props.annotationVisibility >= J.AnnotationVisibility.SHOW_LABELS && this.state.drawState === ie,
shouldDisplayOrdering: this.props.shouldDisplayOrdering,
stroke: l || this.props.stroke,
fill: this.dontFill ? "none" : l || this.props.pathFill,
fillWrong: this.dontFill ? "none" : this.props.pathFillWrong,
pointFill: l || this.props.pointFill,
pointFillHighlight: this.props.pointFillHighlight,
lineWidth: this.props.lineWidth,
onUpdate: function e(n) {
return a.handlePathUpdate(t.key, n)
},
onPointAdd: this.handlePointAdd,
onPointSelect: this.handlePointSelect,
onClick: this.onPathClick,
sourceImage: this.sourceImage,
imageBoundingRect: this.sourceImage && this.sourceImage.getBoundingClientRect(),
zoomLevel: this.props.zoomLevel
}))
}
}, {
key: "renderPaths",
value: function e(t, n) {
var r = this;
if (this.props.annotationVisibility < J.AnnotationVisibility.SHOW_PATHS)
return this.props.selectedAnnotationId ? T.default.createElement("g", {
className: "ImagePathLabeler__paths"
}, t.map(function(e, t) {
return r.renderPath(e, t, true)
})) : null;
return T.default.createElement("g", {
className: "ImagePathLabeler__paths"
}, n.map(function(e, t) {
return r.renderPath(e, t, false)
}), t.map(function(e, t) {
return r.renderPath(e, t, true)
}))
}
}, {
key: "renderCanvas",
value: function e(t, n) {
var r = this.props.readOnly ? {} : {
onMouseDown: this.onCanvasMouseDown,
onMouseMove: this.onCanvasMouseMove,
onMouseUp: this.onCanvasMouseUp,
onClick: this.onCanvasClick
};
var a = (0,
F.default)("ImagePathLabeler__canvas", {
"is-dragging": this.state.drawState === ue
});
return T.default.createElement("svg", O({
id: "image-path-container",
tabIndex: "1",
className: a,
width: this.imageWidth,
height: this.imageHeight
}, r), this.renderPaths(t, n), this.renderCurrentPath())
}
}, {
key: "renderLabelSelector",
value: function e() {
var t = this;
if (this.props.readOnly || this.state.drawState !== se)
return null;
var n = de(this.props.zoomLevel, this.state.currentPathPoints);
return T.default.createElement("div", {
className: "ImagePathLabeler__label-selector",
style: {
top: n.y,
left: n.x
}
}, this.props.labels.map(function(e) {
return T.default.createElement("div", {
key: e,
onClick: function n() {
return t.handleSelectLabel(e)
},
className: "ImagePathLabeler__label selectable"
}, e)
}))
}
}, {
key: "render",
value: function e() {
var t = this;
var n = {
width: this.imageWidth || "auto",
height: this.imageHeight || "auto"
};
var r = void 0;
var i = this.props.selectedAnnotationId || this.props.focusedAnnotationId;
i && (r = (0,
v.default)(this.state.paths, function(e) {
return e.key === i
}));
if (this.state.pathToDrag) {
var s = (0,
v.default)(this.state.paths, function(e) {
return e.key === t.state.pathToDrag
});
var u = s.parent ? (0,
v.default)(this.state.paths, function(e) {
return e.key === s.parent
}) : s;
r = u
}
var c = [];
var d = [];
if ((0,
l.default)([ie, ue], this.state.drawState))
if (r) {
c = [r];
c = c.concat((0,
o.default)(this.state.paths, function(e) {
return e.parent === i
}));
d = (0,
a.default)(this.state.paths, c)
} else
c = this.state.paths;
else
d = this.state.paths;
return T.default.createElement("div", {
className: "ImagePathLabeler",
style: n
}, this.renderStyles(), this.renderImage(), this.props.graftedPaths, this.renderLabels(c, d), this.renderCanvas(c, d), this.renderLabelSelector())
}
}, {
key: "imageWidth",
get: function e() {
return (this.state.imageWidth || 0) * this.props.zoomLevel
}
}, {
key: "imageHeight",
get: function e() {
return (this.state.imageHeight || 0) * this.props.zoomLevel
}
}]);
return t
}(L.Component);
he.defaultProps = {
readOnly: false,
canAddPath: true,
canDeletePath: true,
failedTask: false,
shouldDisplayOrdering: false,
src: null,
zoomLevel: 1,
style: {},
curve: "curveLinearClosed",
stroke: H.MaterialA400HexString.lightblue,
pathFill: "rgba(0, 256, 0, 1)",
pointFill: H.MaterialA400HexString.lightblue,
pointFillHighlight: H.MaterialA400HexString.red,
lineWidth: 1.5,
paths: [],
labels: null,
breakdownColors: {},
showLabelBox: false,
handleAnnotationFocus: function e() {},
handleAnnotationSelect: function e() {},
minPoints: 3,
maxPoints: Math.MAX_SAFE_INTEGER,
onChange: null
};
t.default = he
},
134: function(e, t, n) {
"use strict";
Object["defineProperty"](t, "__esModule", {
value: !![]
});
var r = {
car: 16711680,
cars: 16711680,
truck: 16711935,
semi_truck: 16711935,
bus: 11656587,
pedestrian: 255,
torso_width_pedestrian: 255,
cyclist: 28160,
motorcyclist: 16776960,
two_wheeler: 16776960,
otherpedestrian: 14317566,
pedestrian_with_object: 14317566,
"pedestrian with object": 14317566,
standalone_bicycle: 16777215,
standalone_motorcycle: 16744192,
other_vehicle: 30071,
"other vehicle": 30071,
othervehicle: 30071,
large_other_vehicle: 30071,
small_other_vehicle: 16777215,
"golf-cart": 16711935,
animal: 6893056,
pets: 6893056,
car_with_trailer: 6893056,
construction_cone_or_pole: 16748933,
"cones and short poles": 16748933,
construction_sign_or_board: 8355711,
"construction zone signs and construction sign boards": 8355711,
temporary_construction_barrier: 8355711,
other_static_object_in_road: 16744192,
vehicle: 16711680,
other: 16744192,
othercyclist: 16744192,
"no label": 4791486,
"garbage bins and dumpsters": 16744192,
"vehicle towing": 16777215,
vehicletowing: 16777215,
towedobject: 4838313,
"towed object": 4838313,
pickup_truck: 9096371,
front_of_semi_truck: 13696957,
bendy_bus: 16732281,
rigid_bus: 16333884,
construction_vehicle: 18700,
motorcycle: 39551,
bicycle: 4789760,
trailer: 6487940,
police_vehicle: 16751591,
firetruck: 5111758,
ambulance: 8690130,
train: 4066093,
adult_pedestrian: 12843487,
child_pedestrian: 12817891,
construction_worker: 3287151,
stroller: 11000792,
wheelchair: 15959600,
portable_personal_mobility_vehicle: 16410880,
traffic_police: 15380545,
other_police: 5669083,
small_animal: 9325767,
large_animal: 5223376,
vehicle_traffic_light_box: 12637924,
bike_pedestrian_traffic_light_box: 16488082,
traffic_cone: 16429719,
temporary_traffic_barrier: 11524020,
pushable_pullable_object: 8827471,
movable_obstacle_in_road: 16164704
};
var a = 16727296;
var i = t["getLabelColor"] = function e(t) {
return r[t["toLowerCase"]()] || a
}
;
var o = t["POINT_COLORS"] = ["#000000", "#111111", "#222222", "#333333", "#444444", "#555555", "#666666", "#777777", "#888888", "#999999", "#AAAAAA", "#BBBBBB", "#CCCCCC", "#DDDDDD", "#EEEEEE", "#FFFFFF"];
var s = t["GROUND_POINT_COLORS"] = ["#000000", "#060f06", "#0b1e0b", "#122d12", "#183c18", "#1e4b1e", "#245a24", "#2a692a", "#307830", "#368736", "#3bA63b", "#42B542", "#48C448", "#4eD34e", "#54E254", "#5aF15a"];
var l = t["RADAR_POINT_COLORS"] = ["#000000", "#100c00", "#211800", "#322500", "#433100", "#543e00", "#543e00", "#765701", "#977001", "#B98901", "#DBA201", "#FDBA01", "#FEC422", "#FECD44", "#FEC422", "#FECD44"];
var u = t["toColorString"] = function e(t) {
var n = {
ijNEj: function(e, t) {
return e > t
},
OlzAo: function(e, t) {
return e >> t
},
SQoSn: function(e, t) {
return e & t
},
VUdEs: function(e, t) {
return e + t
},
AVePF: function(e, t) {
return e + t
},
xEFNd: function(e, t) {
return e + t
},
nJQyN: function(e, t) {
return e + t
},
AsGWv: function(e, t) {
return e + t
}
};
var r = n["ijNEj"](arguments["length"], 1) && void 0 !== arguments[1] ? arguments[1] : 1;
var a = t >> 16 & 255;
var i = 255 & n["OlzAo"](t, 8);
var o = n["SQoSn"](t, 255);
return n["VUdEs"](n["AVePF"](n["xEFNd"](n["nJQyN"](n["AsGWv"]("rgba(", a), ",") + i, ","), o) + ",", r) + ")"
}
},
135: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = n(7);
var a = T(r);
var i = n(14);
var o = T(i);
var s = n(24);
var l = T(s);
var u = n(48);
var c = T(u);
var d = n(174);
var f = T(d);
var p = n(138);
var h = T(p);
var m = n(33);
var v = T(m);
var b = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var g = n(1);
var y = T(g);
var x = n(2);
var w = T(x);
var k = n(0);
var j = T(k);
var E = n(5);
var _ = T(E);
var S = n(4);
var C = T(S);
var P = n(8);
var O = T(P);
var A = n(11);
var M = n(25);
var I = n(192);
var L = T(I);
function T(e) {
return e && e.__esModule ? e : {
default: e
}
}
function R(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function F(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function N(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var D = function(e) {
N(t, e);
function t(e) {
R(this, t);
var n = F(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
(0,
C.default)(n, "handleChange", "renderAnnotation");
n.elements = {};
return n
}
b(t, [{
key: "onClickHandler",
value: function e(t, n) {
var r = this;
return function(e) {
r.props.handleSelect(n ? null : (0,
M.getAnnotationId)(t));
e.stopPropagation()
}
}
}, {
key: "handleChange",
value: function e(t, n) {
var r = (0,
v.default)(this.props.annotationObjects, function(e) {
return t === (0,
M.getAnnotationId)(e)
});
var a = this.props.annotationObjects[r];
void 0 !== n.labelVal && (0,
h.default)(a, ["label"], n.labelVal);
void 0 !== n.attrKey && (0,
h.default)(a, ["attributes", n.attrKey], n.attrVal);
var i = (0,
A.requiredAttributesForAnnotation)({
label: a.label,
attributes: a.attributes
}, this.props.attrDefinitions);
var o = (0,
f.default)(a.attributes, function(e, t) {
return t in i
});
a.attributes = o;
var s = (0,
h.default)((0,
c.default)(this.props.annotationObjects), r, a);
this.props.handleChange(s)
}
}, {
key: "renderAnnotation",
value: function e(t) {
var n = this;
var r = (0,
A.isAnnotationDone)(t, this.props.attrDefinitions, this.props.isLabelRequired);
var a = (0,
M.getAnnotationId)(t) === this.props.focusedAnnotationId;
var i = (0,
M.getAnnotationId)(t) === this.props.selectedAnnotationId;
var o = !this.props.selectedAnnotationId && a || i;
var s = (0,
w.default)("annotation-object", {
expanded: i || a,
"collapsed-unfocused": this.props.focusedAnnotationId && !a || this.props.selectedAnnotationId && !i,
collapsed: !i && !a
});
var u = this.props.isLabelRequired || !!this.props.labelChoices.length;
var c = !(0,
l.default)(this.props.attrDefinitions);
var d = (0,
M.getAnnotationText)(t, this.props.selectedBreakdown, this.props.defaultLabel);
var f = (0,
M.getAnnotationColor)(t, this.props.selectedBreakdown, this.props.breakdownColors, "#333");
var p = {
backgroundColor: f
};
return j.default.createElement("div", {
key: (0,
M.getAnnotationId)(t),
className: "annotation-object__wrapper",
onClick: this.onClickHandler(t, false)
}, j.default.createElement("div", {
ref: function e(r) {
n.elements[(0,
M.getAnnotationId)(t)] = r
},
className: "jsx-4075464199 " + (s || "")
}, j.default.createElement("div", {
style: p,
onClick: this.onClickHandler(t, i),
className: "jsx-4075464199 annotation__header"
}, j.default.createElement("span", {
className: "jsx-4075464199 annotation__header__label"
}, d, !r && j.default.createElement("span", {
style: {
color: "rgba(255, 255, 255, 0.6)",
marginLeft: "4px"
},
className: "jsx-4075464199"
}, "(incomplete)")), (u || c) && j.default.createElement("span", {
className: "jsx-4075464199 annotation__header__icon"
}, !o && j.default.createElement(O.default, {
name: "caret-down"
}), o && j.default.createElement(O.default, {
name: "caret-up"
}))), (u || c) && o && j.default.createElement(L.default, {
defaultLabel: this.props.defaultLabel,
isReadOnly: this.props.isReadOnly,
handleChange: this.handleChange,
annotationId: (0,
M.getAnnotationId)(t),
isGroupingEnabled: this.props.isGroupingEnabled,
selectedGroup: this.props.selectedGroup,
handleGroupingStart: this.props.handleGroupingStart,
handleGroupingCancel: this.props.handleGroupingCancel,
isLabelRequired: u,
labelChoices: this.props.labelChoices,
labelSelection: t.label,
attrDefinitions: this.props.attrDefinitions,
attrSelections: t.attributes || {},
annotationColor: f
}), o && t.width && t.height && j.default.createElement("div", {
style: {
backgroundColor: "rgba(248,248,248,1)",
fontSize: "75%",
padding: 16
},
className: "jsx-4075464199"
}, t.width + " x " + t.height), j.default.createElement(y.default, {
styleId: "4075464199",
css: [".annotation-object.jsx-4075464199{margin:12px 0;border-radius:var(--border-radius);-webkit-transition:all 0.2s;-webkit-transition:all 0.2s;transition:all 0.2s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}", ".annotation-object.collapsed-unfocused.jsx-4075464199{opacity:0.5;}", ".annotation-object.collapsed.jsx-4075464199:hover{-webkit-box-shadow:0px 2px 8px rgba(0,0,0,0.1);box-shadow:0px 2px 8px rgba(0,0,0,0.1);}", ".annotation-object.expanded.jsx-4075464199{opacity:1;}", ".annotation__header.jsx-4075464199{border-radius:var(--border-radius);padding:8px 16px;color:white;font-size:14px;font-weight:bold;position:relative;z-index:2;display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;cursor:pointer;-webkit-transition:border-radius 0.3s;-webkit-transition:border-radius 0.3s;transition:border-radius 0.3s;}", ".annotation-object.expanded.jsx-4075464199 .annotation__header.jsx-4075464199{border-bottom-left-radius:0px;border-bottom-right-radius:0px;}", ".annotation__header__label.jsx-4075464199{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;margin-right:8px;}", ".annotation__header__icon.jsx-4075464199{font-size:16px;-ms-flex-negative:0;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;}"]
})))
}
}, {
key: "render",
value: function e() {
var t = this;
var n = (0,
o.default)(this.props.annotationObjects, function(e) {
return !e.parent
});
return j.default.createElement("div", {
ref: function e(n) {
n && (t.elements.parent = n.parentNode)
},
className: "jsx-1168238812 annotation-sidebar"
}, j.default.createElement("div", {
className: "jsx-1168238812 annotation-sidebar__labels"
}, j.default.createElement("strong", {
className: "jsx-1168238812"
}, "Label all"), " ", (0,
a.default)((0,
A.getAllChoiceDescendants)(this.props.labelChoices), function(e, t) {
return j.default.createElement("span", {
key: t,
className: "jsx-1168238812"
}, e)
})), (0,
a.default)(n, this.renderAnnotation), j.default.createElement(y.default, {
styleId: "1168238812",
css: [".annotation-sidebar.jsx-1168238812{overflow:auto;padding:24px;}", ".annotation-sidebar__labels.jsx-1168238812{margin-bottom:24px;color:black;font-weight:bold;line-height:1.5;}", ".annotation-sidebar__labels.jsx-1168238812 strong.jsx-1168238812{margin-right:4px;font-size:13px;text-transform:uppercase;-webkit-letter-spacing:1px;-moz-letter-spacing:1px;-ms-letter-spacing:1px;letter-spacing:1px;}", ".annotation-sidebar__labels.jsx-1168238812 span.jsx-1168238812{display:inline-block;font-size:15px;cursor:default;color:rgba(0,0,0,0.3);}", ".annotation-sidebar__labels.jsx-1168238812 span.jsx-1168238812:not(:last-child)::after{content:',';color:rgba(0,0,0,0.6);margin-right:8px;}"]
}))
}
}]);
return t
}(j.default.Component);
D.defaultProps = {
defaultLabel: "shape",
breakdownColors: {}
};
t.default = D
},
136: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var a = n(1);
var i = c(a);
var o = n(0);
var s = c(o);
var l = n(77);
var u = c(l);
function c(e) {
return e && e.__esModule ? e : {
default: e
}
}
function d(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function f(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function p(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var h = function(e) {
p(t, e);
function t() {
d(this, t);
return f(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments))
}
r(t, [{
key: "componentWillMount",
value: function e() {
this.setState({
instructionsHTML: {
__html: u.default.render(this.props.instructions)
}
})
}
}, {
key: "componentWillUpdate",
value: function e(t, n) {
n.instructionsHTML = {
__html: u.default.render(t.instructions)
}
}
}, {
key: "render",
value: function e() {
return s.default.createElement("div", {
style: {
backgroundColor: this.props.backgroundColor
},
className: "jsx-856904814 instructions-container"
}, s.default.createElement("div", {
dangerouslySetInnerHTML: this.state.instructionsHTML,
className: "jsx-856904814 instructions--markdown"
}), s.default.createElement(i.default, {
styleId: "856904814",
css: [".instructions-container{padding:0 32px;display:block;}", ".instructions--markdown{max-width:740px;height:-webkit-min-content;height:-moz-min-content;height:min-content;margin:0 auto;text-align:left;}", ".instructions--markdown img{max-width:600px;}", ".instructions--markdown h1{font-weight:700;font-style:normal;font-size:40px;margin-left:-2.5px;line-height:45px;-webkit-letter-spacing:-.028em;-moz-letter-spacing:-.028em;-ms-letter-spacing:-.028em;letter-spacing:-.028em;}", ".instructions--markdown h2{font-weight:700;font-style:normal;font-size:36px;margin-left:-2.5px;line-height:38px;-webkit-letter-spacing:-.028em;-moz-letter-spacing:-.028em;-ms-letter-spacing:-.028em;letter-spacing:-.028em;}", ".instructions--markdown h3{font-weight:700;font-style:normal;font-size:28px;margin-left:-2.5px;line-height:33px;-webkit-letter-spacing:-.028em;-moz-letter-spacing:-.028em;-ms-letter-spacing:-.028em;letter-spacing:-.028em;}", ".instructions--markdown h4{font-weight:700;font-style:normal;font-size:24px;margin-left:-2.5px;line-height:26px;-webkit-letter-spacing:-.028em;-moz-letter-spacing:-.028em;-ms-letter-spacing:-.028em;letter-spacing:-.028em;}", ".instructions--markdown h5{font-weight:700;font-style:normal;font-size:18px;margin-left:-2.5px;line-height:22px;-webkit-letter-spacing:-.028em;-moz-letter-spacing:-.028em;-ms-letter-spacing:-.028em;letter-spacing:-.028em;}", ".instructions--markdown h6{font-weight:700;font-style:normal;font-size:18px;margin-left:-2.5px;line-height:20px;-webkit-letter-spacing:-.028em;-moz-letter-spacing:-.028em;-ms-letter-spacing:-.028em;letter-spacing:-.028em;}", ".instructions--markdown blockquote{background-color:#efefef;margin:0;padding:10px 30px;}", ".instructions--markdown pre{background-color:#efefef;border:1px solid #ccc;padding:10px 40px;border-radius:4px;}", ".instructions--markdown p{font-weight:400;font-style:normal;font-size:15px;line-height:1.6;-webkit-letter-spacing:0;-moz-letter-spacing:0;-ms-letter-spacing:0;letter-spacing:0;}"]
}))
}
}]);
return t
}(o.Component);
h.defaultProps = {
backgroundColor: "#fff"
};
t.default = h
},
137: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var a = n(1);
var i = x(a);
var o = n(0);
var s = x(o);
var l = n(311);
var u = x(l);
var c = n(312);
var d = x(c);
var f = n(313);
var p = x(f);
var h = n(314);
var m = x(h);
var v = n(315);
var b = x(v);
var g = n(316);
var y = x(g);
function x(e) {
return e && e.__esModule ? e : {
default: e
}
}
function w(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function k(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function j(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var E = function e(t) {
return -1 === (t || "").indexOf("://") ? "http://" + t : t
};
var _ = function(e) {
j(t, e);
function t() {
w(this, t);
return k(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments))
}
r(t, [{
key: "render",
value: function e() {
var t = this.props.attachmentType;
var n = "text" === t ? this.props.attachment : E(this.props.attachment);
var r = {
image: s.default.createElement(u.default, {
keepOriginalDimensions: this.props.keepOriginalDimensions,
imageDesc: this.props.attachmentDesc,
key: n,
imageUrl: n,
onLoadOrError: this.props.onLoadOrError
}, this.props.children),
text: s.default.createElement(d.default, {
key: n,
text: n,
onLoadOrError: this.props.onLoadOrError
}),
video: s.default.createElement(p.default, {
key: n,
videoUrl: n,
onLoadOrError: this.props.onLoadOrError
}),
audio: s.default.createElement(m.default, {
key: n,
audioUrl: n,
onLoadOrError: this.props.onLoadOrError
}),
website: s.default.createElement(b.default, {
key: n,
startingUrl: n
}),
pdf: s.default.createElement(y.default, {
key: n,
pdfUrl: n,
onLoadOrError: this.props.onLoadOrError
})
}[t];
if (!r)
return s.default.createElement("div", null, "Attachment type ", t, " not supported!");
var a = null;
"text" !== t && "website" !== t && (a = s.default.createElement("div", {
className: "task-attachment__header"
}, s.default.createElement("a", {
target: "_blank",
href: n
}, "Open attachment link in new window")));
return s.default.createElement("div", {
className: "jsx-1562000747 task-attachment"
}, s.default.createElement(i.default, {
styleId: "1562000747",
css: [".task-attachment__item{width:100%;}", ".task-attachment{margin:24px;max-width:800px;min-width:200px;-webkit-box-flex:1;-ms-flex-positive:1;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".task-attachment__item--embed{min-height:600px;}", ".task-attachment__header{padding:12px 0;}"]
}), r, a)
}
}]);
return t
}(s.default.Component);
t.default = _
},
139: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = n(18);
var a = l(r);
var i = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var r in n)
Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
}
return e
}
;
t.normalizeAssignment = p;
t.normalizeAssignments = h;
var o = n(88);
var s = n(185);
function l(e) {
return e && e.__esModule ? e : {
default: e
}
}
var u = ["57fbc670e27e100600947ed7", "59433d40d6760806007bab39", "59ed5966bcac700007ec923a", "5a033b521ca16d0007974c2b", "5a2dd71ad8302000095d3066", "5a0380c5b5b4a0000772fd78", "5a43d75e48597300335d0fc9", "59c409466989a20007b2ab99", "5a74d68c4f2d42002edd7c5d", "5903a10a0d45da060039556e", "5a723403456ed8003c67be86", "5a67e568c823b50020dafd42", "5b22ef78809a83009290038d", "5b311bdb8ccfa5003c7b7405", "5b2809b5f4f3650043b7a0aa"];
function c(e, t) {
var n = void 0;
var r = t.params.attachment && -1 !== u.indexOf(t.user);
if (r) {
var a = {
user: t.user,
attachment: t.params.attachment
};
var i = Object.keys(a).map(function(e) {
return encodeURIComponent(e) + "=" + encodeURIComponent(a[e])
}).join("&");
n = e.API_URL + "/internal/cruise_proxy_attachment?" + i
} else
n = t.params.attachment;
return n
}
function d(e, t) {
var n = Object.assign({}, t);
function r(t) {
if (-1 !== t.search(/cloudfront\.net|cruise_proxy_attachment/))
return t;
var r = (0,
a.default)(n.attachmentS3Downloads, function(e) {
return e.attachmentURL === t
});
return r ? r.s3URL : c(e, n) || t
}
n.params.fallbackAttachment = c(e, n);
n.params.attachment ? n.params.attachment = r(n.params.attachment) : n.params.attachments && (n.params.attachments = n.params.attachments.map(r));
return n
}
function f(e) {
return i({}, e.subtask, {
attemptId: e._id,
attemptVersion: e.attemptVersion,
fixResponse: e.response,
timeSpentSecs: e.timeSpentSecs,
attemptedBy: e.attemptedBy,
audioAlignment: e.audioAlignment,
isReviewFix: e.isReviewFix,
reviewLevel: e.reviewLevel,
reviewers: e.reviewers,
isGoldenReview: e.benchmark && e.benchmark.isGoldenReview,
instruction: e.benchmark && e.benchmark.instruction || e.subtask.instruction,
goldenReviewPayoutMultiplier: e.benchmark && e.benchmark.payoutMultiplier,
useBinaryResponse: e.benchmark && e.benchmark.useBinaryResponse,
skippable: !e.benchmark || e.benchmark.skippable,
batchSkippable: e.batchSkippable,
batchSkipText: e.batchSkipText,
batch: e.batchId
})
}
function p(e) {
var t = (0,
o.isReviewAssignment)(e);
var n = t ? f(e) : e;
var r = (0,
s.getConfig)();
return i({}, n, d(r, n), {
isReviewMode: t
})
}
function h(e) {
return e.map(function(e) {
return p(e)
})
}
},
140: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = n(22);
var a = S(r);
var i = "function" === typeof Symbol && "symbol" === typeof Symbol.iterator ? function(e) {
return typeof e
}
: function(e) {
return e && "function" === typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}
;
var o = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var s = n(1);
var l = S(s);
var u = n(0);
var c = S(u);
var d = n(10);
var f = S(d);
var p = n(5);
var h = S(p);
var m = n(2);
var v = S(m);
var b = n(8);
var g = S(b);
var y = n(4);
var x = S(y);
var w = n(213);
var k = S(w);
var j = n(20);
var E = S(j);
var _ = n(11);
function S(e) {
return e && e.__esModule ? e : {
default: e
}
}
function C(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function P(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function O(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var A = function(e) {
O(t, e);
function t() {
C(this, t);
return P(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments))
}
o(t, [{
key: "render",
value: function e() {
var t = this;
var n = this.props.choice;
if ("object" === ("undefined" === typeof n ? "undefined" : i(n)))
return c.default.createElement(M, {
tree: n
});
var r = (0,
v.default)("radio-selector__choice", {
"is-selected": this.props.selectedChoice === n,
"is-readonly": this.props.isReadOnly
});
return c.default.createElement("div", {
key: n,
onClick: function e() {
return t.props.handleSelect(n)
},
className: "jsx-1282879467 " + (r || "")
}, c.default.createElement("div", {
className: "jsx-1282879467 radio-selector__icon"
}, c.default.createElement("div", {
className: "jsx-1282879467"
})), c.default.createElement("div", {
className: "jsx-1282879467 radio-selector__label"
}, n), c.default.createElement(l.default, {
styleId: "1282879467",
css: [".radio-selector__choice.jsx-1282879467{padding:4px;margin:0 0 4px;border-radius:2px;display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;opacity:0.8;-webkit-transition:all 0.2s;-webkit-transition:all 0.2s;transition:all 0.2s;cursor:pointer !important;}", ".radio-selector__choice.jsx-1282879467:hover{opacity:1;background:rgba(0,0,0,0.05);}", ".radio-selector__icon.jsx-1282879467{background:white;height:16px;width:16px;border-radius:16px;border:1px solid rgba(0,0,0,0.1);-webkit-box-shadow:0px 0px 1px rgba(0,0,0,0.05);box-shadow:0px 0px 1px rgba(0,0,0,0.05);margin-right:8px;display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;}", ".is-readonly.jsx-1282879467 .radio-selector__icon.jsx-1282879467{background:rgba(0,0,0,0.1);}", ".radio-selector__choice.jsx-1282879467:hover .radio-selector__icon.jsx-1282879467>div.jsx-1282879467{content:' ';height:10px;width:10px;border-radius:10px;background:rgba(0,0,0,0.1);}", ".radio-selector__choice.is-selected.jsx-1282879467 .radio-selector__icon.jsx-1282879467>div.jsx-1282879467{content:' ';height:10px;width:10px;border-radius:10px;background:var(--color-primary);}", ".radio-selector__label.jsx-1282879467{color:rgba(0,0,0,0.7);}"]
}))
}
}]);
return t
}(c.default.Component);
var M = function(e) {
O(t, e);
function t(e) {
C(this, t);
var n = P(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
n.state = {
expanded: false
};
(0,
x.default)(n, "handleExpand", "handleToggleExpanded");
return n
}
o(t, [{
key: "componentDidMount",
value: function e() {
this.expandToSelectedDescendant()
}
}, {
key: "componentWillReceiveProps",
value: function e(t) {
this.expandToSelectedDescendant(t)
}
}, {
key: "expandToSelectedDescendant",
value: function e() {
var t = (0,
_.getAllChoiceDescendants)(this.props.tree.subchoices);
(0,
a.default)(t, this.props.selectedChoice) && this.handleExpand()
}
}, {
key: "handleExpand",
value: function e() {
this.setState({
expanded: true
})
}
}, {
key: "handleToggleExpanded",
value: function e() {
this.setState(function(e) {
return {
expanded: !e.expanded
}
})
}
}, {
key: "render",
value: function e() {
var n = this;
if ("string" === typeof this.props.tree)
return c.default.createElement(A, {
choice: this.props.tree,
selectedChoice: this.props.selectedChoice,
isReadOnly: this.props.isReadOnly,
handleSelect: this.props.handleSelect
});
var r = this.props.tree.choice;
var a = this.props.tree.subchoices;
return c.default.createElement("div", {
className: "jsx-2544447270 radio-selector__tree"
}, c.default.createElement("div", {
onClick: this.handleToggleExpanded,
className: "jsx-2544447270 radio-selector__heading"
}, !this.state.expanded && c.default.createElement(g.default, {
name: "chevron-right",
style: {
marginRight: "10px",
fontSize: "14px"
}
}), this.state.expanded && c.default.createElement(g.default, {
name: "chevron-down",
style: {
marginRight: "10px",
fontSize: "14px"
}
}), r), c.default.createElement("div", {
className: "jsx-2544447270 radio-selector__leaves"
}, this.state.expanded && a.map(function(e) {
return c.default.createElement(t, {
key: e,
tree: e,
selectedChoice: n.props.selectedChoice,
isReadOnly: n.props.isReadOnly,
handleSelect: n.props.handleSelect
})
})), c.default.createElement(l.default, {
styleId: "2544447270",
css: [".radio-selector__tree.jsx-2544447270{padding-left:8px;margin-bottom:4px;}", ".radio-selector__heading.jsx-2544447270{padding:4px 0;margin-bottom:4px;font-weight:bold;cursor:pointer;color:rgba(0,0,0,0.7);-webkit-transition:color 0.3s;-webkit-transition:color 0.3s;transition:color 0.3s;}", ".radio-selector__heading.jsx-2544447270:hover{color:rgba(0,0,0,1);}", ".radio-selector__leaves.jsx-2544447270{padding-left:8px;}"]
}))
}
}]);
return t
}(c.default.Component);
var I = function(e) {
O(t, e);
function t(e) {
C(this, t);
var n = P(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
(0,
x.default)(n, "handleKeyDown");
n.inputRef = c.default.createRef();
return n
}
o(t, [{
key: "handleKeyDown",
value: function e(t) {
if ((0,
a.default)(["Enter", "Escape"], t.key)) {
document.body.tabIndex = 1;
document.body.focus()
}
"[" === t.key && t.preventDefault()
}
}, {
key: "render",
value: function e() {
var t = this;
var n = (0,
_.validateAttribute)(this.props.selectedChoice, this.props.attrParams) ? "valid" : "invalid";
return c.default.createElement("div", {
className: "jsx-4210274275 number-input"
}, c.default.createElement("input", {
ref: function e(n) {
t.inputRef = n
},
type: "number",
max: this.props.attrParams.max,
min: this.props.attrParams.min,
step: this.props.attrParams.step || 5,
onChange: function e(n) {
return t.props.handleUpdateSelection(t.props.attrKey, t.constructor.convertNumberInput(n.target.value))
},
onKeyDown: this.handleKeyDown,
defaultValue: this.props.selectedChoice,
"data-tip": true,
"data-for": "number-input",
className: "jsx-4210274275 " + (n || "")
}), c.default.createElement("div", {
className: "jsx-4210274275"
}, c.default.createElement(E.default, null, "Enter"), " ", c.default.createElement("strong", {
className: "jsx-4210274275"
}, "to confirm")), c.default.createElement(f.default, {
id: "number-input"
}, c.default.createElement(E.default, null, "Tab"), " to focus with keyboard"), c.default.createElement(l.default, {
styleId: "4210274275",
css: [".number-input.jsx-4210274275{margin-bottom:12px;display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".number-input.jsx-4210274275 input.jsx-4210274275{margin:8px 12px 8px 0px;height:36px;outline:0;-webkit-box-shadow:none;box-shadow:none;border-radius:4px;border:1px solid #ccc;padding:2px 8px;font-weight:bold;width:70px;}", ".number-input.jsx-4210274275 input.jsx-4210274275+div.jsx-4210274275{opacity:0;-webkit-transition:0.2s;-webkit-transition:0.2s;transition:0.2s;}", ".number-input.jsx-4210274275 input.jsx-4210274275:focus{-webkit-box-shadow:0px 2px 4px rgba(0,0,0,0.1);box-shadow:0px 2px 4px rgba(0,0,0,0.1);border:1px solid var(--color-primary);}", ".number-input.jsx-4210274275 input.jsx-4210274275:focus+div.jsx-4210274275{opacity:1;}", ".number-input.jsx-4210274275 input.valid.jsx-4210274275{color:var(--color-primary);}"]
}))
}
}], [{
key: "convertNumberInput",
value: function e(t) {
if ("0" === t)
return 0;
if (!Number(t))
return;
return Number(t)
}
}]);
return t
}(c.default.Component);
var L = function(e) {
O(t, e);
function t(e) {
C(this, t);
var n = P(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
(0,
x.default)(n, "handleRadioSelect");
return n
}
o(t, [{
key: "handleRadioSelect",
value: function e(t) {
this.props.handleUpdateSelection(this.props.attrKey, t)
}
}, {
key: "renderRadioInput",
value: function e() {
var t = this;
return c.default.createElement("div", {
key: this.props.attrKey
}, this.props.attrParams.choices.map(function(e) {
return c.default.createElement(M, {
key: e.choice || e,
tree: e,
selectedChoice: t.props.selectedChoice,
isReadOnly: t.props.isReadOnly,
handleSelect: t.handleRadioSelect
})
}))
}
}, {
key: "renderAngleInput",
value: function e() {
var t = this;
return c.default.createElement("div", {
className: "jsx-4193506697 angle-input"
}, c.default.createElement(k.default, {
value: this.props.selectedChoice,
onChange: function e(n) {
return t.props.handleUpdateSelection(t.props.attrKey, t.constructor.convertNumberInput(n))
},
min: 0,
max: 360,
fgColor: "#222222",
thickness: .3,
width: 100,
height: 100,
cursor: true,
displayInput: false
}), c.default.createElement(l.default, {
styleId: "4193506697",
css: [".angle-input.jsx-4193506697{margin-bottom:12px;}"]
}))
}
}, {
key: "renderAttributeDesc",
value: function e() {
var t = this.props.attrParams.description;
return c.default.createElement("div", {
className: "jsx-2765369307 attribute-selector__desc"
}, t, c.default.createElement(l.default, {
styleId: "2765369307",
css: [".attribute-selector__desc.jsx-2765369307{margin-bottom:8px;font-weight:bold;}"]
}))
}
}, {
key: "render",
value: function e() {
var t = void 0;
t = "number" === this.props.attrParams.type ? c.default.createElement(I, {
attrParams: this.props.attrParams,
attrKey: this.props.attrKey,
selectedChoice: this.props.selectedChoice,
handleUpdateSelection: this.props.handleUpdateSelection
}) : "angle" === this.props.attrParams.type ? this.renderAngleInput() : this.renderRadioInput();
var n = (0,
v.default)("attribute-input", {
"is-readonly": this.props.isReadOnly
});
return c.default.createElement("div", {
className: "jsx-774677913 " + (n || "")
}, this.renderAttributeDesc(), t, c.default.createElement(l.default, {
styleId: "774677913",
css: [".attribute-input.jsx-774677913{margin-bottom:12px;font-size:14px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}", ".attribute-input.is-readonly.jsx-774677913{pointer-events:none;}"]
}))
}
}]);
return t
}(c.default.Component);
t.default = L
},
147: function(e, t, n) {
"use strict";
Object["defineProperty"](t, "__esModule", {
value: !![]
});
t["cuboidsOverlap"] = c;
t["getCorners"] = d;
t["transformPoint"] = f;
var r = n(39);
var a = o(r);
var i = n(52);
function o(e) {
var t = {
XOhTT: function(e, t) {
return e != t
}
};
if (e && e["__esModule"])
return e;
var n = {};
if (t["XOhTT"](e, null))
for (var r in e)
Object["prototype"]["hasOwnProperty"]["call"](e, r) && (n[r] = e[r]);
n["default"] = e;
return n
}
function s(e, t) {
return t["map"](function(t) {
return t["sub"](new a["Vector3"](e["position"]["x"],e["position"]["y"],e["position"]["z"]))
})
}
function l(e) {
var t = "1|2|3|4|0"["split"]("|")
, n = 0;
while (!![]) {
switch (t[n++]) {
case "0":
return {
xVector3: i,
yVector3: o,
zVector3: s
};
case "1":
var r = new a["Euler"](0,0,e["yaw"],"ZYX");
continue;
case "2":
var i = new a["Vector3"](1,0,0)["applyEuler"](r);
continue;
case "3":
var o = new a["Vector3"](0,1,0)["applyEuler"](r);
continue;
case "4":
var s = new a["Vector3"](0,0,1)["applyEuler"](r);
continue
}
break
}
}
function u(e, t) {
var n = {
eWoqa: function(e, t) {
return e / t
},
Rpnju: function(e, t) {
return e < t
},
tahJD: function(e, t, n) {
return e(t, n)
}
};
var r = "1|0|4|2|3|5|6|7"["split"]("|")
, a = 0;
while (!![]) {
switch (r[a++]) {
case "0":
var i = n["eWoqa"](e["dimensions"]["x"], 2);
continue;
case "1":
var o = {
IQafG: function(e, t) {
return n["Rpnju"](e, t)
}
};
continue;
case "2":
var u = e["dimensions"]["z"];
continue;
case "3":
var c = n["tahJD"](s, e, t);
continue;
case "4":
var d = e["dimensions"]["y"] / 2;
continue;
case "5":
var f = l(e)
, p = f["xVector3"]
, h = f["yVector3"];
continue;
case "6":
var m = c["filter"](function(e) {
var t = Math["abs"](p["dot"](e));
var n = Math["abs"](h["dot"](e));
return o["IQafG"](n, d) && t < i && e["z"] < u
});
continue;
case "7":
return m
}
break
}
}
function c(e, t) {
var n = {
YKgpN: function(e, t, n) {
return e(t, n)
},
mEqTY: function(e, t) {
return e > t
}
};
return n["YKgpN"](u, e["cuboidProps"], d(t["cuboidProps"]))["length"] > 0 || n["mEqTY"](u(t["cuboidProps"], d(e["cuboidProps"]))["length"], 0)
}
function d(e) {
var t = {
pLIop: function(e, t) {
return e(t)
},
sECDb: function(e, t) {
return e / t
}
};
var n = (0,
i["parseVector3"])(e["position"]);
var r = t["pLIop"](l, e)
, a = r["xVector3"]
, o = r["yVector3"]
, s = r["zVector3"];
var u = a["multiplyScalar"](e["dimensions"]["x"] / 2);
var c = o["multiplyScalar"](e["dimensions"]["y"] / 2);
var d = s["multiplyScalar"](t["sECDb"](e["dimensions"]["z"], 2));
var f = n["clone"]();
var p = n["clone"]();
var h = n["clone"]();
var m = n["clone"]();
var v = n["clone"]();
var b = n["clone"]();
var g = n["clone"]();
var y = n["clone"]();
f["add"](u)["add"](c)["add"](d);
p["sub"](u)["add"](c)["add"](d);
h["add"](u)["sub"](c)["add"](d);
m["sub"](u)["sub"](c)["add"](d);
v["add"](u)["add"](c)["sub"](d);
b["sub"](u)["add"](c)["sub"](d);
g["add"](u)["sub"](c)["sub"](d);
y["sub"](u)["sub"](c)["sub"](d);
return [f, p, h, m, v, b, g, y]
}
function f(e, t) {
var n = "6|0|2|3|5|4|1"["split"]("|")
, r = 0;
while (!![]) {
switch (n[r++]) {
case "0":
var o = (0,
i["parseVector3"])(t);
continue;
case "1":
return new a["Vector3"](s,c,u);
case "2":
o["sub"]((0,
i["parseVector3"])(e["position"]));
continue;
case "3":
var s = f["dot"](o);
continue;
case "4":
var u = o["z"];
continue;
case "5":
var c = p["dot"](o);
continue;
case "6":
var d = l(e)
, f = d["xVector3"]
, p = d["yVector3"];
continue
}
break
}
}
},
149: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = n(34);
var a = g(r);
var i = n(32);
var o = g(i);
var s = n(7);
var l = g(s);
var u = n(174);
var c = g(u);
var d = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var f = n(1);
var p = g(f);
var h = n(0);
var m = g(h);
var v = n(5);
var b = g(v);
function g(e) {
return e && e.__esModule ? e : {
default: e
}
}
function y(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function x(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function w(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var k = function(e) {
w(t, e);
function t() {
y(this, t);
return x(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments))
}
d(t, [{
key: "render",
value: function e() {
var t = this;
var n = (0,
c.default)(this.props.attrDefinitions, function(e, n) {
return !!(t.props.attrSelections && t.props.attrSelections[n])
});
return m.default.createElement("div", {
className: "jsx-3668732261 attributes-display"
}, this.props.labelSelection && m.default.createElement("div", {
className: "jsx-3668732261 attributes-display__label"
}, m.default.createElement("div", {
className: "jsx-3668732261 desc"
}, "Label"), m.default.createElement("div", {
className: "jsx-3668732261 val"
}, this.props.labelSelection)), (0,
l.default)((0,
o.default)(n), function(e, n) {
return m.default.createElement("div", {
key: n,
className: "jsx-3668732261 attributes-display__attr"
}, m.default.createElement("div", {
className: "jsx-3668732261 desc"
}, t.props.attrDefinitions[e].description), m.default.createElement("div", {
className: "jsx-3668732261 val"
}, t.props.attrSelections[e]))
}), m.default.createElement(p.default, {
styleId: "3668732261",
css: [".attributes-display.jsx-3668732261 .desc.jsx-3668732261{margin-bottom:4px;color:rgba(0,0,0,0.5);font-size:12px;font-weight:bold;text-transform:uppercase;-webkit-letter-spacing:0.5px;-moz-letter-spacing:0.5px;-ms-letter-spacing:0.5px;letter-spacing:0.5px;line-height:1.5em;}", ".attributes-display.jsx-3668732261 .val.jsx-3668732261{font-weight:bold;color:black;font-size:15px;}", ".attributes-display__label.jsx-3668732261{margin-bottom:12px;}", ".attributes-display__attr.jsx-3668732261+.attributes-display__attr.jsx-3668732261{margin-top:12px;}"]
}))
}
}]);
return t
}(h.Component);
var j = function(e) {
w(t, e);
function t(e) {
y(this, t);
var n = x(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
n.state = {
heightCorrection: 0
};
return n
}
d(t, [{
key: "componentDidMount",
value: function e() {
this.refreshBoxPosition()
}
}, {
key: "componentDidUpdate",
value: function e(t) {
if ((0,
a.default)(this.props.labelSelection, t.labelSelection) && (0,
a.default)(this.props.attributeSelections, t.attributeSelections))
return;
this.refreshBoxPosition()
}
}, {
key: "refreshBoxPosition",
value: function e() {
if (!this.boxDiv || !this.props.enableAutoPositioning)
return;
var t = this.boxDiv.getBoundingClientRect()
, n = t.y
, r = t.height;
var a = n + r - this.state.heightCorrection;
var i = n - this.state.heightCorrection - (r + 58);
var o = 80;
var s = window.innerHeight - 90;
var l = a > s;
var u = i >= o;
l && u ? this.setState({
heightCorrection: -(r + 58)
}) : this.setState({
heightCorrection: 0
})
}
}, {
key: "render",
value: function e() {
var t = this;
var n = null;
if (this.props.annotationFace && this.props.annotationScale) {
var r = (this.props.annotationFace.x1 + this.props.annotationFace.x2) / 2 * this.props.annotationScale;
var a = (this.props.annotationFace.y2 + 10) * this.props.annotationScale;
n = {
position: "absolute",
left: r,
top: a
}
} else
this.state.heightCorrection && (n = {
position: "absolute",
top: this.state.heightCorrection + "px"
});
return m.default.createElement("div", {
ref: function e(n) {
t.boxDiv = n
},
style: n,
className: "jsx-1419082890 annotation-label-box"
}, m.default.createElement(k, {
attrDefinitions: this.props.attributes,
labelSelection: this.props.labelSelection,
attrSelections: this.props.attributeSelections
}), m.default.createElement(p.default, {
styleId: "1419082890",
css: [".annotation-label-box.jsx-1419082890{width:240px;margin-top:4px;padding:12px;background:rgba(255,255,255,0.9);border-radius:var(--border-radius);white-space:initial;}"]
}))
}
}]);
return t
}(h.Component);
t.default = j
},
152: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
t.UPDATE_CLAIMS = t.FORCE_FIX_ASSIGNMENT = t.CLOSE_FEEDBACK_MODAL = t.SHOW_FEEDBACK_MODAL = t.TIME_SPENT_STATS_LOADED = t.SET_LAST_INSTRUCTION_HASH = t.SKIP_ASSIGNMENT = t.COMPLETE_ASSIGNMENT = t.FILTER_BATCH = t.EXTEND_BATCH = t.SET_CURRENT_USER = t.SET_CAPTCHA = void 0;
var r = n(3);
var a = L(r);
var i = n(128);
var o = L(i);
var s = n(301);
var l = L(s);
var u = n(154);
var c = L(u);
var d = n(81);
var f = L(d);
var p = n(164);
var h = L(p);
var m = n(7);
var v = L(m);
var b = function() {
var e = T(a.default.mark(function e(t) {
return a.default.wrap(function e(n) {
while (1)
switch (n.prev = n.next) {
case 0:
if (t.ok) {
n.next = 7;
break
}
n.t0 = P.default;
n.t1 = t.statusText;
n.next = 5;
return (0,
A.tryParseErrorResponse)(t);
case 5:
n.t2 = n.sent;
throw new n.t0(n.t1,n.t2);
case 7:
return n.abrupt("return", t.json());
case 8:
case "end":
return n.stop()
}
}, e, this)
}));
return function t(n) {
return e.apply(this, arguments)
}
}();
var g = function() {
var e = T(a.default.mark(function e(t, n) {
var r, i, o;
return a.default.wrap(function e(a) {
while (1)
switch (a.prev = a.next) {
case 0:
a.prev = 0;
a.next = 3;
return t();
case 3:
return a.abrupt("return", a.sent);
case 6:
a.prev = 6;
a.t0 = a["catch"](0);
if (!(a.t0.response && 400 === a.t0.response.status && a.t0.response.needsCaptcha)) {
a.next = 25;
break
}
r = new Promise(function(e) {
n.onCaptchaComplete = e
}
);
n.reset();
n.execute();
a.next = 14;
return r;
case 14:
i = a.sent;
a.next = 17;
return $("/user/captcha_refresh", {
method: "POST",
body: {
"g-recaptcha-response": i
}
});
case 17:
o = a.sent;
if (o.ok) {
a.next = 20;
break
}
throw new Error("Captcha validation failed");
case 20:
a.next = 22;
return t();
case 22:
return a.abrupt("return", a.sent);
case 25:
throw a.t0;
case 26:
case "end":
return a.stop()
}
}, e, this, [[0, 6]])
}));
return function t(n, r) {
return e.apply(this, arguments)
}
}();
t.fetchCorp = J;
t.fetchApi = $;
t.fetchCurrentUser = ee;
t.setCaptcha = re;
t.filterAssignments = ae;
t.fetchNextAssignments = ie;
t.fetchTimeSpentStats = oe;
t.setLastInstructionHash = se;
t.skipBatch = le;
t.skipTask = ue;
t.updatePayment = ce;
t.updateProfile = de;
t.checkAssignmentClaim = pe;
t.refreshAssignmentClaims = he;
t.completeAttempt = me;
t.completeInternalReview = ve;
t.completeReviewAssignment = be;
t.completeGoldenReviewAssignment = ge;
t.closeGoldenReviewFeedback = ye;
var y = n(23);
var x = L(y);
var w = n(202);
var k = I(w);
var j = n(15);
var E = L(j);
var _ = n(97);
var S = L(_);
var C = n(237);
var P = L(C);
var O = n(139);
var A = n(146);
var M = n(88);
function I(e) {
if (e && e.__esModule)
return e;
var t = {};
if (null != e)
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]);
t.default = e;
return t
}
function L(e) {
return e && e.__esModule ? e : {
default: e
}
}
function T(e) {
return function() {
var t = e.apply(this, arguments);
return new Promise(function(e, n) {
function r(a, i) {
try {
var o = t[a](i);
var s = o.value
} catch (e) {
n(e);
return
}
if (!o.done)
return Promise.resolve(s).then(function(e) {
r("next", e)
}, function(e) {
r("throw", e)
});
e(s)
}
return r("next")
}
)
}
}
var R = t.SET_CAPTCHA = "SET_CAPTCHA";
var F = t.SET_CURRENT_USER = "SET_CURRENT_USER";
var N = t.EXTEND_BATCH = "EXTEND_BATCH";
var D = t.FILTER_BATCH = "FILTER_BATCH";
var z = t.COMPLETE_ASSIGNMENT = "COMPLETE_ASSIGNMENT";
var B = t.SKIP_ASSIGNMENT = "SKIP_ASSIGNMENT";
var V = t.SET_LAST_INSTRUCTION_HASH = "SET_LAST_INSTRUCTION_HASH";
var W = t.TIME_SPENT_STATS_LOADED = "TIME_SPENT_STATS_LOADED";
var U = t.SHOW_FEEDBACK_MODAL = "SHOW_FEEDBACK_MODAL";
var H = t.CLOSE_FEEDBACK_MODAL = "CLOSE_FEEDBACK_MODAL";
var G = t.FORCE_FIX_ASSIGNMENT = "FORCE_FIX_ASSIGNMENT";
var Y = t.UPDATE_CLAIMS = "UPDATE_CLAIMS";
var K = "/v2/tasks/pending_combined";
var Q = "/v2/tasks/internal_review";
var q = "internal";
var Z = "corp-api";
function X(e, t) {
var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
var r = e.slice();
n.loginUrl = "/scalers/login";
n.returnRawResponse = !n.parseAndHandle;
delete n.parseAndHandle;
if (n.body) {
n.body = JSON.stringify(n.body);
n.headers || (n.headers = {
"Content-Type": "application/json"
})
}
n.query && (r = r + "?" + k.stringify(n.query));
delete n.query;
return (0,
E.default)(null, "" + t + r, n)
}
function J(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
return X(e, Z, t)
}
function $(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
return X(e, q, t)
}
function ee(e) {
var t = this;
return function() {
var n = T(a.default.mark(function n(r) {
return a.default.wrap(function t(n) {
while (1)
switch (n.prev = n.next) {
case 0:
n.t0 = e;
if (n.t0) {
n.next = 5;
break
}
n.next = 4;
return $("/logged_in_user").then(b);
case 4:
n.t0 = n.sent;
case 5:
e = n.t0;
r({
type: F,
user: e
});
case 7:
case "end":
return n.stop()
}
}, n, t)
}));
return function(e) {
return n.apply(this, arguments)
}
}()
}
function te(e) {
if ("0" === e)
return "task";
if ("1" === e)
return "review";
return
}
function ne(e) {
return (0,
v.default)(e, function(e, t) {
return e ? "&" + t + "=" + e : ""
}).join("")
}
function re(e) {
return function(t) {
t({
type: R,
captcharef: e
})
}
}
function ae(e, t) {
return function(n) {
n({
type: D,
tasks: e,
attempts: t
})
}
}
function ie(e) {
var t = this;
var n = (0,
h.default)(e, "review_mode", "limit", "internal_review_mode");
n.kind = te(e.review_mode);
var r = ne(n);
var i = !!e.internal_review_mode;
return function() {
var n = T(a.default.mark(function n(o, s) {
var l, u, c, d;
return a.default.wrap(function t(n) {
while (1)
switch (n.prev = n.next) {
case 0:
l = s();
if (!((0,
f.default)(l, "batch.assignments.length", 0) > 2)) {
n.next = 3;
break
}
return n.abrupt("return");
case 3:
u = i ? Q : K;
c = i ? 10 : 2;
d = void 0;
n.prev = 6;
n.next = 9;
return g(function() {
return $(u + "?limit=" + c + r).then(b)
}, l.batch.captcharef);
case 9:
d = n.sent;
n.next = 15;
break;
case 12:
n.prev = 12;
n.t0 = n["catch"](6);
if (n.t0.response && 403 === n.t0.response.status)
window.location = "/forbidden";
else {
n.t0.logToSentry && n.t0.logToSentry("fetching next assignments");
x.default.error(n.t0.message, {
timeout: 3e3
})
}
case 15:
if (d) {
o({
type: N,
assignments: (0,
O.normalizeAssignments)(d)
});
(0,
S.default)("Extend Batch of Assignments", {
type: e.type || "any"
})
}
case 16:
case "end":
return n.stop()
}
}, n, t, [[6, 12]])
}));
return function(e, t) {
return n.apply(this, arguments)
}
}()
}
function oe(e, t) {
var n = this;
var r = arguments.length > 2 && void 0 !== arguments[2] && arguments[2];
return function() {
var i = T(a.default.mark(function i(o) {
var s;
return a.default.wrap(function n(a) {
while (1)
switch (a.prev = a.next) {
case 0:
a.next = 2;
return $("/scaler/tasks/timeSpent?taskType=" + e + "&taskCustomer=" + t + (r ? "&forReview=1" : "")).then(b);
case 2:
s = a.sent;
o({
type: W,
timeSpentStats: s
});
case 4:
case "end":
return a.stop()
}
}, i, n)
}));
return function(e) {
return i.apply(this, arguments)
}
}()
}
function se(e) {
return {
type: V,
lastInstructionHash: e
}
}
function le(e, t, n, r) {
var i = this;
return function() {
var o = T(a.default.mark(function o(s, l) {
var u;
return a.default.wrap(function a(i) {
while (1)
switch (i.prev = i.next) {
case 0:
i.next = 2;
return $("/batch/skip", {
method: "POST",
body: {
batchId: t,
info: {
skipReason: n,
skipExplanation: r
}
}
}).then(b);
case 2:
u = i.sent;
if (u.tooManySkips)
alert("You have already reached the limit on skips for the day.");
else {
ie(e)(s, l);
s({
type: B,
response: u
})
}
case 4:
case "end":
return i.stop()
}
}, o, i)
}));
return function(e, t) {
return o.apply(this, arguments)
}
}()
}
function ue(e, t, n, r, i) {
var o = this;
n = n || false;
var s = {};
n && (s = {
skipReason: r,
skipExplanation: i
});
var l = void 0;
var u = void 0;
var c = void 0;
if ((0,
M.isReviewAssignment)(t)) {
u = [t.attemptId];
c = "/attempts/unassign"
} else {
l = [t._id];
c = "/tasks/unassign"
}
return function() {
var t = T(a.default.mark(function t(r, i) {
var d;
return a.default.wrap(function t(a) {
while (1)
switch (a.prev = a.next) {
case 0:
a.next = 2;
return $(c, {
method: "POST",
body: {
taskIds: l,
attemptIds: u,
isSkippedTask: true,
isSkipUserInitiated: n,
info: s
}
}).then(b);
case 2:
d = a.sent;
if (d.tooManySkips)
alert("You have already reached the limit on skips for the day.");
else {
ie(e)(r, i);
r({
type: B,
response: d
})
}
case 4:
case "end":
return a.stop()
}
}, t, o)
}));
return function(e, n) {
return t.apply(this, arguments)
}
}()
}
function ce(e) {
var t = this;
var n = e.paypalEmail
, r = e.countryCode;
return function() {
var e = T(a.default.mark(function e(i) {
var o, s;
return a.default.wrap(function e(t) {
while (1)
switch (t.prev = t.next) {
case 0:
o = {
body: {
paypalEmail: n,
countryCode: r
},
method: "POST"
};
t.next = 3;
return $("/worker/update", o).then(b);
case 3:
s = t.sent;
i({
type: F,
user: s
});
case 5:
case "end":
return t.stop()
}
}, e, t)
}));
return function(t) {
return e.apply(this, arguments)
}
}()
}
function de(e) {
var t = this;
var n = e.firstName
, r = e.lastName
, i = e.phoneNumber;
return function() {
var e = T(a.default.mark(function e(o) {
var s, l;
return a.default.wrap(function e(t) {
while (1)
switch (t.prev = t.next) {
case 0:
s = {
body: {
firstName: n,
lastName: r,
phoneNumber: i
},
method: "POST"
};
t.next = 3;
return $("/user/update", s).then(b);
case 3:
l = t.sent;
o({
type: F,
user: l
});
case 5:
case "end":
return t.stop()
}
}, e, t)
}));
return function(t) {
return e.apply(this, arguments)
}
}()
}
var fe = function e(t) {
var n = ["task_id", "timeSpentSecs", "timeSpentLoadingSecs"];
var r = {
annotation: [].concat(n, ["annotations"]),
audiotranscription: n,
fixannotation: [].concat(n, ["annotation"]),
polygonannotation: [].concat(n, ["annotations"]),
lineannotation: [].concat(n, ["annotations"]),
laneannotation: [].concat(n, ["annotations"]),
pointannotation: [].concat(n, ["annotations"])
}[t] || [];
return function(e) {
(0,
c.default)(r, function(t) {
if (!(0,
l.default)(e, t))
throw Error(t + " is required in `completeAttempt`")
})
}
};
function pe(e) {
var t = this;
var n = e.task
, r = e.attempt;
return function() {
var e = T(a.default.mark(function e(i) {
var s, l, u;
return a.default.wrap(function e(t) {
while (1)
switch (t.prev = t.next) {
case 0:
s = {
task: n,
attempt: r
};
t.next = 3;
return $("/tasks/check_claim", {
method: "POST",
body: s
}).then(b);
case 3:
l = t.sent;
u = {};
(0,
c.default)((0,
o.default)(l.tasks, l.attempts), function(e) {
u[e.id] = {
claimed: e.claimed,
claimedUntil: e.claimedUntil,
checkedAt: e.checkedAt,
checkedAtClientTime: new Date
}
});
i({
type: Y,
claims: u
});
case 7:
case "end":
return t.stop()
}
}, e, t)
}));
return function(t) {
return e.apply(this, arguments)
}
}()
}
function he(e) {
var t = this;
var n = e.tasks
, r = e.attempts;
return function() {
var e = T(a.default.mark(function e(i) {
var s, l, u;
return a.default.wrap(function e(t) {
while (1)
switch (t.prev = t.next) {
case 0:
s = {
reclaim: {
tasks: n,
attempts: r
}
};
t.next = 3;
return $("/tasks/check_claim", {
method: "POST",
body: s
}).then(b);
case 3:
l = t.sent;
u = {};
(0,
c.default)((0,
o.default)(l.tasks, l.attempts), function(e) {
u[e.id] = {
claimed: e.claimed,
claimedUntil: e.claimedUntil,
checkedAt: e.checkedAt,
checkedAtClientTime: new Date
}
});
i({
type: Y,
claims: u
});
case 7:
case "end":
return t.stop()
}
}, e, t)
}));
return function(t) {
return e.apply(this, arguments)
}
}()
}
function me(e, t) {
var n = this;
var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
r.timeSpentLoadingSecs || (r.timeSpentLoadingSecs = -1);
fe(t)(r);
return function() {
var i = T(a.default.mark(function i(o, s) {
var l, u, c, d;
return a.default.wrap(function n(a) {
while (1)
switch (a.prev = a.next) {
case 0:
l = s();
u = function e() {
var n = {
body: r,
method: "POST"
};
return $("/complete/" + t, n).then(b)
}
;
c = l.batch.assignments[0];
a.next = 5;
return g(u, l.batch.captcharef);
case 5:
d = a.sent;
if (d) {
a.next = 8;
break
}
return a.abrupt("return");
case 8:
ie(e)(o, s);
o({
type: z,
assignment: c
});
(0,
S.default)("Completed Task", {
time_elapsed_in_seconds: r.timeSpentSecs,
task_id: r.task_id,
num_annotations: r.annotations && r.annotations.length,
type: t
});
case 11:
case "end":
return a.stop()
}
}, i, n)
}));
return function(e, t) {
return i.apply(this, arguments)
}
}()
}
function ve(e, t) {
var n = this;
return function() {
var r = T(a.default.mark(function r(i, o) {
var s, l, u, c, d;
return a.default.wrap(function n(r) {
while (1)
switch (r.prev = r.next) {
case 0:
s = o();
l = s.batch.assignments[0];
u = Object.assign({}, {
attemptId: l.attemptId,
reviewTimeSecs: t.timeSpentSecs,
reviewTimeLoadingSecs: t.timeSpentLoadingSecs,
attemptVersion: l.attemptVersion,
reviewResult: t.isCorrect ? "correct" : "incorrect",
benchmark: t.benchmark,
comments: t.comments
});
c = {
body: u,
method: "POST"
};
r.next = 6;
return J("/tasks/" + l._id + "/internal_reviews", c).then(b);
case 6:
d = r.sent;
if (d) {
r.next = 9;
break
}
return r.abrupt("return");
case 9:
i({
type: z,
assignment: l
});
ie(e)(i, o);
return r.abrupt("return", d);
case 12:
case "end":
return r.stop()
}
}, r, n)
}));
return function(e, t) {
return r.apply(this, arguments)
}
}()
}
function be(e, t) {
var n = this;
var r = t.isCorrect
, i = t.timeSpentSecs
, o = t.timeSpentLoadingSecs
, s = t.reviewChanges
, l = t.benchmark
, u = t.comments
, c = t.extra;
return function() {
var t = T(a.default.mark(function t(d, f) {
var p, h, m, v, y;
return a.default.wrap(function t(n) {
while (1)
switch (n.prev = n.next) {
case 0:
p = f();
h = p.batch.assignments[0];
m = Object.assign({}, {
attemptId: h.attemptId,
reviewTimeSecs: i,
reviewTimeLoadingSecs: o,
attemptVersion: h.attemptVersion,
reviewResult: r ? "correct" : "incorrect",
reviewChanges: s,
benchmark: l,
comments: u,
extra: c
});
v = function e() {
var t = {
body: m,
method: "POST"
};
return $("/attempts/review_pending", t).then(b)
}
;
n.next = 6;
return g(v, p.batch.captcharef);
case 6:
y = n.sent;
if (y) {
n.next = 9;
break
}
return n.abrupt("return");
case 9:
d({
type: z,
assignment: h
});
ie(e)(d, f);
(0,
S.default)("Completed Task", {
time_elapsed_in_seconds: m.reviewTimeSecs,
type: h.type
});
return n.abrupt("return", y);
case 13:
case "end":
return n.stop()
}
}, t, n)
}));
return function(e, n) {
return t.apply(this, arguments)
}
}()
}
function ge(e, t) {
var n = this;
var r = t.isCorrect
, i = t.timeSpentSecs
, o = t.timeSpentLoadingSecs
, s = t.reviewChanges
, l = t.benchmark
, u = t.comments;
return function() {
var e = T(a.default.mark(function e(t, c) {
var d, f, p, h, m, v, y, x;
return a.default.wrap(function e(n) {
while (1)
switch (n.prev = n.next) {
case 0:
d = c();
f = d.batch.assignments[0];
p = d.batch.forceFixAssignment === f.id;
h = Object.assign({}, {
attemptId: f.attemptId,
reviewTimeSecs: i,
reviewTimeLoadingSecs: o,
attemptVersion: f.attemptVersion,
reviewResult: r ? "correct" : "incorrect",
reviewChanges: s,
benchmark: l,
comments: u,
answerAlreadyShown: p
});
m = void 0;
p || (m = function e() {
var t = {
body: h,
method: "POST"
};
return $("/attempts/review_pending", t).then(b)
}
);
v = function e() {
var t = {
body: h,
method: "POST"
};
return $("/attempts/golden_review", t).then(b)
}
;
y = void 0;
if (p) {
n.next = 14;
break
}
n.next = 11;
return g(m, d.batch.captcharef);
case 11:
y = n.sent;
if (y) {
n.next = 14;
break
}
return n.abrupt("return");
case 14:
n.next = 16;
return g(v, d.batch.captcharef);
case 16:
x = n.sent;
if (x) {
n.next = 19;
break
}
return n.abrupt("return");
case 19:
t({
type: U,
goldenReviewFeedback: x,
response: y
});
(0,
S.default)("Completed Task", {
time_elapsed_in_seconds: h.reviewTimeSecs,
type: f.type
});
return n.abrupt("return", x);
case 22:
case "end":
return n.stop()
}
}, e, n)
}));
return function(t, n) {
return e.apply(this, arguments)
}
}()
}
function ye(e) {
var t = this;
return function() {
var n = T(a.default.mark(function n(r, i) {
var o, s, l, u;
return a.default.wrap(function t(n) {
while (1)
switch (n.prev = n.next) {
case 0:
o = i();
s = o.batch.assignments[0];
l = o.batch.response;
u = o.batch.goldenReviewFeedback;
r({
type: H
});
if (!u.forceFix) {
n.next = 9;
break
}
r({
type: G,
assignment: s
});
n.next = 12;
break;
case 9:
n.next = 11;
return ie(e)(r, i);
case 11:
r({
type: z,
assignment: s
});
case 12:
return n.abrupt("return", l);
case 13:
case "end":
return n.stop()
}
}, n, t)
}));
return function(e, t) {
return n.apply(this, arguments)
}
}()
}
},
155: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = n(167);
var a = c(r);
var i = n(14);
var o = c(i);
var s = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var l = n(50);
var u = c(l);
function c(e) {
return e && e.__esModule ? e : {
default: e
}
}
function d(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
var f = function() {
function e() {
d(this, e)
}
s(e, null, [{
key: "isDuplicate",
value: function e(t, n) {
var r = this;
return n.filter(function(e) {
return 6 === r.getMatchingVertices(r.cuboidToAPIValue(e), r.cuboidToAPIValue(t), 6).length
}).length > 1
}
}, {
key: "vertexRoughEquals",
value: function e(t, n, r) {
return Math.abs(t.x - n.x) <= r && Math.abs(t.y - n.y) <= r
}
}, {
key: "getMatchingVertices",
value: function e(t, n, r) {
var a = this;
return (0,
o.default)(t.vertices, function(e) {
var t = n.vertices.filter(function(t) {
return t.description === e.description
});
var i = t.length ? t[0] : null;
return i && a.vertexRoughEquals(e, i, r)
})
}
}, {
key: "getCorrectVertices",
value: function e(t, n) {
var r = this;
var i = n.filter(function(e) {
return e.label === t.label
});
var o = i.map(function(e) {
return r.getMatchingVertices(t, e, 3)
});
var s = (0,
a.default)(o, "length") || [];
return s.map(function(e) {
return e.description
})
}
}, {
key: "edge",
value: function e(t, n, r) {
return {
type: "edge",
x1: t.x,
y1: t.y,
x2: n.x,
y2: n.y,
description: r
}
}
}, {
key: "annotationToCuboid",
value: function e(t) {
var n = function e(n) {
var r = t.vertices.filter(function(e) {
return e.description === n
});
return r.length > 0 ? r[0] : null
};
var r = n("face-topleft");
var a = n("face-bottomright");
var i = [r.x, r.y]
, o = i[0]
, s = i[1];
var l = [a.x, a.y]
, c = l[0]
, d = l[1];
var f = null;
var p = n("side-topcorner");
var h = n("side-bottomcorner");
if (p && h) {
var m = p.x;
var v = [p.y, h.y]
, b = v[0]
, g = v[1];
f = {
ex: m,
ey1: b,
ey2: g
}
}
var y = {
keyName: u.default.v4(),
face: {
x1: o,
y1: s,
x2: c,
y2: d
},
edge: f,
label: t.label,
attributes: t.attributes
};
return y
}
}, {
key: "cuboidToAPIValue",
value: function e(t) {
if (!t || !t.face)
return null;
var n = t.label;
var r = t.attributes;
var a = t.face
, i = a.x1
, o = a.y1
, s = a.x2
, l = a.y2;
var u = [Math.min(i, s), Math.max(i, s)];
i = u[0];
s = u[1];
var c = [Math.min(o, l), Math.max(o, l)];
o = c[0];
l = c[1];
var d = {
type: "vertex",
x: i,
y: o,
description: "face-topleft"
};
var f = {
type: "vertex",
x: i,
y: l,
description: "face-bottomleft"
};
var p = {
type: "vertex",
x: s,
y: o,
description: "face-topright"
};
var h = {
type: "vertex",
x: s,
y: l,
description: "face-bottomright"
};
var m = [d, f, p, h];
var v = [this.edge(d, p, "face-top"), this.edge(p, h, "face-right"), this.edge(h, f, "face-bottom"), this.edge(f, d, "face-left")];
var b = v;
var g = [];
if (t.edge) {
var y = t.edge
, x = y.ex
, w = y.ey1
, k = y.ey2;
var j = [Math.min(w, k), Math.max(w, k)];
w = j[0];
k = j[1];
var E = {
type: "vertex",
x: x,
y: w,
description: "side-topcorner"
};
var _ = {
type: "vertex",
x: x,
y: k,
description: "side-bottomcorner"
};
var S = (i + s) / 2;
g = x < S ? [this.edge(d, E, "side-top"), this.edge(E, _, "side-back"), this.edge(_, f, "side-bottom"), this.edge(f, d)] : [this.edge(p, E, "side-top"), this.edge(E, _, "side-back"), this.edge(_, h, "side-bottom"), this.edge(h, p)];
m = m.concat([E, _]);
b = b.concat(g.slice(0, 3))
}
return {
label: n,
attributes: r,
vertices: m,
edges: b,
extra: {
face: v,
side: g
}
}
}
}]);
return e
}();
t.default = f
},
156: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = n(1);
var a = s(r);
var i = n(0);
var o = s(i);
function s(e) {
return e && e.__esModule ? e : {
default: e
}
}
t.default = function() {
return o.default.createElement("div", {
className: "jsx-2463773633"
}, o.default.createElement(a.default, {
styleId: "773441134",
css: [".ReactCrop{position:relative;display:inline-block;cursor:crosshair;}", ".ReactCrop.ReactCrop--disabled{cursor:inherit;}", ".ReactCrop:focus{outline:none;}", ".ReactCrop--image{display:block;max-width:100%;}", ".ReactCrop--image-copy{position:absolute;top:0;left:0;max-width:100%;}", ".ReactCrop--crop-wrapper{position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgba(0,0,0,0.6);}", ".ReactCrop--crop-selection{position:absolute;top:0;left:0;-webkit-transform:translate3d(0,0,0);-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0);-webkit-box-sizing:border-box;box-sizing:border-box;cursor:move;background-image:-webkit-gradient(linear,left top,right top,color-stop(50%,rgba(255,255,255,0.7)),color-stop(50%,rgba(0,0,0,0.7))),-webkit-gradient(linear,left top,right top,color-stop(50%,rgba(255,255,255,0.7)),color-stop(50%,rgba(0,0,0,0.7))),-webkit-gradient(linear,left top,left bottom,color-stop(50%,rgba(255,255,255,0.7)),color-stop(50%,rgba(0,0,0,0.7))),-webkit-gradient(linear,left top,left bottom,color-stop(50%,rgba(255,255,255,0.7)),color-stop(50%,rgba(0,0,0,0.7)));background-image:linear-gradient(to right,rgba(255,255,255,0.7) 50%,rgba(0,0,0,0.7) 50%),linear-gradient(to right,rgba(255,255,255,0.7) 50%,rgba(0,0,0,0.7) 50%),linear-gradient(to bottom,rgba(255,255,255,0.7) 50%,rgba(0,0,0,0.7) 50%),linear-gradient(to bottom,rgba(255,255,255,0.7) 50%,rgba(0,0,0,0.7) 50%);padding:1px;background-size:10px 1px,10px 1px,1px 10px,1px 10px;background-position:0 0,0 100%,0 0,100% 0;background-repeat:repeat-x,repeat-x,repeat-y,repeat-y;-webkit-animation:marching-ants 2s;-webkit-animation:marching-ants 2s;animation:marching-ants 2s;-webkit-animation-timing-function:linear;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:infinite;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-play-state:running;-webkit-animation-play-state:running;animation-play-state:running;}", ".ReactCrop--disabled .ReactCrop--crop-selection{cursor:inherit;}", "@-webkit-keyframes marching-ants{0%{background-position:0 0,0 100%,0 0,100% 0;}100%{background-position:40px 0,-40px 100%,0 -40px,100% 40px;}}", "@-webkit-keyframes marching-ants{0%{background-position:0 0,0 100%,0 0,100% 0;}100%{background-position:40px 0,-40px 100%,0 -40px,100% 40px;}}", "@keyframes marching-ants{0%{background-position:0 0,0 100%,0 0,100% 0;}100%{background-position:40px 0,-40px 100%,0 -40px,100% 40px;}}", ".ReactCrop--drag-handle{position:absolute;width:9px;height:9px;background-color:rgba(0,0,0,0.2);border:1px solid rgba(255,255,255,0.7);-webkit-box-sizing:border-box;box-sizing:border-box;outline:1px solid transparent;}", ".ReactCrop .ord-nw{top:0;left:0;margin-top:-4px;margin-left:-4px;cursor:nw-resize;}", ".ReactCrop .ord-n{top:0;left:50%;margin-top:-4px;margin-left:-4px;cursor:n-resize;}", ".ReactCrop .ord-ne{top:0;right:0;margin-top:-4px;margin-right:-4px;cursor:ne-resize;}", ".ReactCrop .ord-e{top:50%;right:0;margin-top:-4px;margin-right:-4px;cursor:e-resize;}", ".ReactCrop .ord-se{bottom:0;right:0;margin-bottom:-4px;margin-right:-4px;cursor:se-resize;}", ".ReactCrop .ord-s{bottom:0;left:50%;margin-bottom:-4px;margin-left:-4px;cursor:s-resize;}", ".ReactCrop .ord-sw{bottom:0;left:0;margin-bottom:-4px;margin-left:-4px;cursor:sw-resize;}", ".ReactCrop .ord-w{top:50%;left:0;margin-top:-4px;margin-left:-4px;cursor:w-resize;}", ".ReactCrop--disabled .ReactCrop--drag-handle{cursor:inherit;}", ".ReactCrop--drag-bar{position:absolute;}", ".ReactCrop--drag-bar.ord-n{top:0;left:0;width:100%;height:6px;margin-top:-4px;}", ".ReactCrop--drag-bar.ord-e{right:0;top:0;width:6px;height:100%;margin-right:-4px;}", ".ReactCrop--drag-bar.ord-s{bottom:0;left:0;width:100%;height:6px;margin-bottom:-4px;}", ".ReactCrop--drag-bar.ord-w{top:0;left:0;width:6px;height:100%;margin-left:-4px;}", ".ReactCrop-new-crop .ReactCrop--drag-bar,.ReactCrop-new-crop .ReactCrop--drag-handle,.ReactCrop-fixed-aspect .ReactCrop--drag-bar{display:none;}", "@media (max-width:768px){.ReactCrop--drag-handle{width:17px;height:17px;}.ReactCrop .ord-nw{margin-top:-8px;margin-left:-8px;}.ReactCrop .ord-n{margin-top:-8px;margin-left:-8px;}.ReactCrop .ord-ne{margin-top:-8px;margin-right:-8px;}.ReactCrop .ord-e{margin-top:-8px;margin-right:-8px;}.ReactCrop .ord-se{margin-bottom:-8px;margin-right:-8px;}.ReactCrop .ord-s{margin-bottom:-8px;margin-left:-8px;}.ReactCrop .ord-sw{margin-bottom:-8px;margin-left:-8px;}.ReactCrop .ord-w{margin-top:-8px;margin-left:-8px;}.ReactCrop--drag-bar.ord-n{height:14px;margin-top:-12px;}.ReactCrop--drag-bar.ord-e{width:14px;margin-right:-12px;}.ReactCrop--drag-bar.ord-s{height:14px;margin-bottom:-12px;}.ReactCrop--drag-bar.ord-w{width:14px;margin-left:-12px;}}"]
}), o.default.createElement(a.default, {
styleId: "3347896646",
css: [".ReactCrop,.ReactCrop svg,.ReactCrop--image,.ReactCrop--image-copy{max-width:initial !important;max-height:initial !important;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}", ".ReactCrop .ReactCrop--crop-selection{background-image:-webkit-gradient(linear,left top,right top,from(#00FF07),color-stop(50%),color-stop(50%,rgba(0,0,0,0))),-webkit-gradient(linear,left top,right top,color-stop(50%,#00FF07),color-stop(50%,rgba(0,0,0,0))),-webkit-gradient(linear,left top,left bottom,color-stop(50%,#00FF07),color-stop(50%,rgba(0,0,0,0))),-webkit-gradient(linear,left top,left bottom,color-stop(50%,#00FF07),color-stop(50%,rgba(0,0,0,0)));background-image:linear-gradient(to right,#00FF07,50%,rgba(0,0,0,0) 50%),linear-gradient(to right,#00FF07 50%,rgba(0,0,0,0) 50%),linear-gradient(to bottom,#00FF07 50%,rgba(0,0,0,0) 50%),linear-gradient(to bottom,#00FF07 50%,rgba(0,0,0,0) 50%);background-size:10px 1px,10px 1px,1px 10px,1px 10px;}", ".ReactCrop .ReactCrop--crop-wrapper--sel-n .ReactCrop--crop-selection{background-image:-webkit-gradient(linear,left top,right top,from(#FF0000),color-stop(50%),color-stop(50%,rgba(0,0,0,0))),-webkit-gradient(linear,left top,right top,color-stop(50%,#00FF07),color-stop(50%,rgba(0,0,0,0))),-webkit-gradient(linear,left top,left bottom,color-stop(50%,#00FF07),color-stop(50%,rgba(0,0,0,0))),-webkit-gradient(linear,left top,left bottom,color-stop(50%,#00FF07),color-stop(50%,rgba(0,0,0,0)));background-image:linear-gradient(to right,#FF0000,50%,rgba(0,0,0,0) 50%),linear-gradient(to right,#00FF07 50%,rgba(0,0,0,0) 50%),linear-gradient(to bottom,#00FF07 50%,rgba(0,0,0,0) 50%),linear-gradient(to bottom,#00FF07 50%,rgba(0,0,0,0) 50%);}", ".ReactCrop .ReactCrop--crop-wrapper--sel-s .ReactCrop--crop-selection{background-image:-webkit-gradient(linear,left top,right top,from(#00FF07),color-stop(50%),color-stop(50%,rgba(0,0,0,0))),-webkit-gradient(linear,left top,right top,color-stop(50%,#FF0000),color-stop(50%,rgba(0,0,0,0))),-webkit-gradient(linear,left top,left bottom,color-stop(50%,#00FF07),color-stop(50%,rgba(0,0,0,0))),-webkit-gradient(linear,left top,left bottom,color-stop(50%,#00FF07),color-stop(50%,rgba(0,0,0,0)));background-image:linear-gradient(to right,#00FF07,50%,rgba(0,0,0,0) 50%),linear-gradient(to right,#FF0000 50%,rgba(0,0,0,0) 50%),linear-gradient(to bottom,#00FF07 50%,rgba(0,0,0,0) 50%),linear-gradient(to bottom,#00FF07 50%,rgba(0,0,0,0) 50%);}", ".ReactCrop .ReactCrop--crop-wrapper--sel-w .ReactCrop--crop-selection{background-image:-webkit-gradient(linear,left top,right top,from(#00FF07),color-stop(50%),color-stop(50%,rgba(0,0,0,0))),-webkit-gradient(linear,left top,right top,color-stop(50%,#00FF07),color-stop(50%,rgba(0,0,0,0))),-webkit-gradient(linear,left top,left bottom,color-stop(50%,#FF0000),color-stop(50%,rgba(0,0,0,0))),-webkit-gradient(linear,left top,left bottom,color-stop(50%,#00FF07),color-stop(50%,rgba(0,0,0,0)));background-image:linear-gradient(to right,#00FF07,50%,rgba(0,0,0,0) 50%),linear-gradient(to right,#00FF07 50%,rgba(0,0,0,0) 50%),linear-gradient(to bottom,#FF0000 50%,rgba(0,0,0,0) 50%),linear-gradient(to bottom,#00FF07 50%,rgba(0,0,0,0) 50%);}", ".ReactCrop .ReactCrop--crop-wrapper--sel-e .ReactCrop--crop-selection{background-image:-webkit-gradient(linear,left top,right top,from(#00FF07),color-stop(50%),color-stop(50%,rgba(0,0,0,0))),-webkit-gradient(linear,left top,right top,color-stop(50%,#00FF07),color-stop(50%,rgba(0,0,0,0))),-webkit-gradient(linear,left top,left bottom,color-stop(50%,#00FF07),color-stop(50%,rgba(0,0,0,0))),-webkit-gradient(linear,left top,left bottom,color-stop(50%,#FF0000),color-stop(50%,rgba(0,0,0,0)));background-image:linear-gradient(to right,#00FF07,50%,rgba(0,0,0,0) 50%),linear-gradient(to right,#00FF07 50%,rgba(0,0,0,0) 50%),linear-gradient(to bottom,#00FF07 50%,rgba(0,0,0,0) 50%),linear-gradient(to bottom,#FF0000 50%,rgba(0,0,0,0) 50%);}", ".ReactCrop .ReactCrop--crop-selection{-webkit-box-sizing:border-box;box-sizing:border-box;}", ".ReactCrop .ReactCrop--crop-wrapper{background-color:rgba(0,0,0,0.3);}", ".ReactCrop .ReactCrop--drag-handle{background-color:transparent !important;border-color:transparent;width:6px;height:6px;}", ".ReactCrop .ord-ne,.ReactCrop .ord-e{margin-top:-3px;margin-right:-3px;}", ".ReactCrop .ord-w,.ReactCrop .ord-nw,.ReactCrop .ord-n{margin-top:-3px;margin-left:-3px;}", ".ReactCrop .ord-s,.ReactCrop .ord-sw{margin-bottom:-3px;margin-left:-3px;}", ".red-close-icon{display:none;top:-6px;right:-6px;pointer-events:all;}", '.red-close-icon{background-color:#C70D0D;background-image:url("/static/internal/images/icons/white-close.png");background-size:6px 6px;background-repeat:no-repeat;background-position:center;border-radius:50%;width:12px;height:12px;position:absolute;z-index:5;}', ".ReactCrop:hover .red-close-icon{display:block;}", ".red-close-icon:hover{cursor:pointer;background-color:rgb(179,12,12);}", ".ReactCrop--crop-wrapper--too-small .ReactCrop--crop-selection .ReactCrop--drag-handle{background-color:rgba(255,0,0,0.8) !important;}", ".ReactCrop--crop-wrapper--too-small .ReactCrop--crop-selection{background-color:rgba(255,0,0,0.2) !important;background-image:-webkit-gradient(linear,left top,right top,from(rgba(255,0,0,0.4)),color-stop(50%),color-stop(50%,rgba(0,0,0,0))),-webkit-gradient(linear,left top,right top,color-stop(50%,rgba(255,0,0,0.4)),color-stop(50%,rgba(0,0,0,0))),-webkit-gradient(linear,left top,left bottom,color-stop(50%,rgba(255,0,0,0.4)),color-stop(50%,rgba(0,0,0,0))),-webkit-gradient(linear,left top,left bottom,color-stop(50%,rgba(255,0,0,0.4)),color-stop(50%,rgba(0,0,0,0))) !important;background-image:linear-gradient(to right,rgba(255,0,0,0.4),50%,rgba(0,0,0,0) 50%),linear-gradient(to right,rgba(255,0,0,0.4) 50%,rgba(0,0,0,0) 50%),linear-gradient(to bottom,rgba(255,0,0,0.4) 50%,rgba(0,0,0,0) 50%),linear-gradient(to bottom,rgba(255,0,0,0.4) 50%,rgba(0,0,0,0) 50%) !important;}"]
}))
}
},
157: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = n(24);
var a = h(r);
var i = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var o = n(1);
var s = h(o);
var l = n(0);
var u = h(l);
var c = n(470);
var d = h(c);
var f = n(2);
var p = h(f);
function h(e) {
return e && e.__esModule ? e : {
default: e
}
}
function m(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function v(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function b(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var g = function(e) {
b(t, e);
function t(e) {
m(this, t);
var n = v(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
n.setField = n.setField.bind(n);
n.renderField = n.renderField.bind(n);
return n
}
i(t, [{
key: "componentWillMount",
value: function e() {
if (this.props.fields) {
var t = Object.assign({}, this.props.fields);
Object.keys(t).forEach(function(e) {
t[e] = false
});
this.setState({
disabledFields: t
});
this.props.setDisabledFields && this.props.setDisabledFields(t)
}
}
}, {
key: "componentWillReceiveProps",
value: function e(t) {
var n = this;
if (t.taskId !== this.props.taskId) {
var r = Object.assign({}, t.fields);
Object.keys(r).forEach(function(e) {
r[e] = false
});
return this.setState({
disabledFields: r
}, function() {
n.props.setDisabledFields && n.props.setDisabledFields(r)
})
}
}
}, {
key: "setField",
value: function e(t, n) {
if (this.props.readOnly)
return;
var r = Object.assign({}, this.props.fieldValues);
r[t] = n;
this.props.setFieldValues(r)
}
}, {
key: "toggleFieldDisabled",
value: function e(t) {
var n = this;
if (this.props.readOnly)
return;
var r = Object.assign({}, this.state.disabledFields);
r[t] = !r[t];
this.state.disabledFields[t] ? this.setState({
disabledFields: r
}, function() {
n.props.setDisabledFields && n.props.setDisabledFields(r)
}) : this.setState({
disabledFields: r
}, function() {
n.setField(t, "");
n.props.setDisabledFields && n.props.setDisabledFields(r)
})
}
}, {
key: "renderField",
value: function e(t) {
var n = this;
return u.default.createElement("div", {
key: t.key,
className: "jsx-3787261894 field"
}, u.default.createElement("div", {
className: "jsx-3787261894 field__label"
}, t.label), u.default.createElement(d.default, {
disabled: t.disabled || this.props.readOnly,
minRows: 1,
className: "field__value",
value: t.value,
onChange: function e(r) {
return n.setField(t.key, r.target.value)
}
}), u.default.createElement("fieldset", {
onClick: function e() {
return n.toggleFieldDisabled(t.key)
},
style: {
border: 0,
outline: 0,
margin: 0
},
className: "jsx-3787261894 " + ((0,
p.default)("field__empty", {
readonly: this.props.readOnly
}) || "")
}, u.default.createElement("input", {
type: "checkbox",
name: "empty",
checked: t.disabled || this.props.readOnly && (0,
a.default)(t.value),
onChange: function e() {
return n.toggleFieldDisabled(t.key)
},
disabled: this.props.readOnly,
className: "jsx-3787261894 empty__input--target"
}), u.default.createElement("div", {
className: "jsx-3787261894 empty__label"
}, u.default.createElement("input", {
type: "checkbox",
checked: t.disabled || this.props.readOnly && (0,
a.default)(t.value),
onChange: function e() {
return n.toggleFieldDisabled(t.key)
},
disabled: this.props.readOnly,
tabIndex: -1,
className: "jsx-3787261894 empty__input--display"
}), u.default.createElement("label", {
className: "jsx-3787261894"
}, "Empty or not found"))), u.default.createElement(s.default, {
styleId: "3787261894",
css: [".field__label{font-size:14px;font-weight:bold;margin-bottom:4px;}", ".field__value{width:100%;background:white;border:1px solid #eee;border-radius:var(--border-radius);-webkit-appearance:none;-moz-appearance:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:8px;font-size:16px;font-weight:bold;-webkit-transition:all 0.2s;-webkit-transition:all 0.2s;transition:all 0.2s;}", ".field__value:focus{-webkit-box-shadow:0px 2px 4px rgba(0,0,0,0.1);box-shadow:0px 2px 4px rgba(0,0,0,0.1);outline:0;}", ".field__value[disabled]{background:rgba(0,0,0,0.1);border-color:rgba(0,0,0,0.2);-webkit-backface-visibility:visible;-webkit-backface-visibility:visible;backface-visibility:visible;}", ".field__empty{display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;cursor:pointer;'' -webkit-user-select:none;'' -moz-user-select:none;'' -ms-user-select:none;'' user-select:none;color:rgba(0,0,0,0.5);}", ".field__empty .empty__input--target{width:0px;height:0px;-webkit-appearance:none;-moz-appearance:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;}", ".field__empty .empty__label{padding:4px;background-color:rgba(0,0,0,0);-webkit-transition:0.3s all;-webkit-transition:0.3s all;transition:0.3s all;}", ".field__empty .empty__label input,.field__empty .empty__label label{cursor:pointer;font-size:14px;font-weight:bold;}", ".field__empty:hover .empty__label,.field__empty .empty__input--target:focus+.empty__label{background-color:rgba(0,0,0,0.05);}", ".field__empty.readonly{pointer-events:none;}"]
}))
}
}, {
key: "renderChoices",
value: function e() {
var t = this;
if (!this.props.choices || !this.props.choices.length)
return;
var n = (0,
p.default)("choices", {
"is-readonly": this.props.readOnly
});
return u.default.createElement("div", {
className: "jsx-91508942 " + (n || "")
}, u.default.createElement("div", {
className: "jsx-91508942 choices__title"
}, "Please select one of the following options"), u.default.createElement("div", {
className: "jsx-91508942 choices__group"
}, this.props.choices.map(function(e) {
var n = (0,
p.default)("choice", {
"is-selected": t.props.choice === e,
disabled: t.props.readOnly
});
return u.default.createElement("div", {
onClick: function n() {
return t.props.setChoice(e)
},
key: e,
className: "jsx-91508942 " + (n || "")
}, e)
})), u.default.createElement(s.default, {
styleId: "91508942",
css: [".choices__title{font-size:16px;font-weight:bold;margin-bottom:16px;}", ".choice{display:inline-block;border:1px solid rgba(0,0,0,0.1);border-radius:var(--border-radius);padding:8px 12px;margin-right:12px;margin-bottom:8px;color:rgba(0,0,0,0.7);font-weight:bold;font-size:13px;cursor:pointer;-webkit-transition:0.1s all;-webkit-transition:0.1s all;transition:0.1s all;}", ".choice:hover{color:rgba(0,0,0,1);-webkit-box-shadow:0px 2px 6px rgba(0,0,0,0.1);box-shadow:0px 2px 6px rgba(0,0,0,0.1);}", ".choice.is-selected{background:var(--main-color);color:white;}", ".choice.is-disabled{cursor:default;pointer-events:none;}", ".is-readonly .choice{pointer-events:none;}", ".is-readonly .choice.is-selected{background:rgba(0,0,0,0.3);}"]
}))
}
}, {
key: "render",
value: function e() {
var t = (0,
p.default)("fields", {
"fields--vertical": !this.props.horizontal,
"fields--horizontal": !!this.props.horizontal
});
return u.default.createElement("div", {
className: "jsx-4139981316"
}, u.default.createElement("form", {
className: "jsx-4139981316 " + (t || "")
}, this.fields.map(this.renderField), this.renderChoices(), this.props.children), u.default.createElement(s.default, {
styleId: "4139981316",
css: [".fields{height:100%;padding:24px 16px;-ms-flex-negative:0;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;-webkit-box-flex:1;-ms-flex-positive:1;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;overflow:auto;}", ".fields--vertical .field{margin-bottom:24px;}", ".fields--horizontal{width:100%;display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;border-top:1px solid #ccc;}", ".fields--horizontal .field{margin-right:48px;width:300px;}", ".fields__title{margin:16px 0 32px;font-size:14px;font-weight:bold;}"]
}))
}
}, {
key: "choices",
get: function e() {
if (!this.props.choices)
return [];
return this.props.choices
}
}, {
key: "fields",
get: function e() {
var t = this;
if (!this.props.fields)
return [];
return Object.keys(this.props.fields).map(function(e) {
return {
key: e,
label: t.props.fields[e],
value: t.props.fieldValues[e] || "",
disabled: t.state.disabledFields[e]
}
})
}
}]);
return t
}(l.Component);
t.default = g
},
158: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = n(58);
var a = f(r);
var i = n(85);
var o = f(i);
var s = n(22);
var l = f(s);
var u = n(24);
var c = f(u);
var d = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
function f(e) {
return e && e.__esModule ? e : {
default: e
}
}
function p(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
var h = function() {
function e() {
p(this, e)
}
d(e, null, [{
key: "isChoiceValid",
value: function e(t, n) {
if ((0,
c.default)(t))
return true;
return (0,
l.default)(t, n)
}
}, {
key: "isFieldsValid",
value: function e(t, n) {
if (!t || !n)
return true;
var r = Object.keys(t).filter(function(e) {
return "" === t[e] || !t[e]
});
return (0,
o.default)(r, function(e) {
return true === n[e]
})
}
}, {
key: "areRowsValid",
value: function e(t) {
var n = t.filter(function(e) {
return (0,
o.default)((0,
a.default)(e), function(e) {
return "" === e
})
});
return 0 === n.length
}
}]);
return e
}();
t.default = h
},
159: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
t.default = {
createImageData: function e(t, n) {
var r = document.createElement("canvas").getContext("2d");
return r.createImageData(t, n)
}
}
},
166: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
t.VIDEO_ANNOTATION_PATH_PUBLIC_PROPERTIES = void 0;
var r = n(148);
var a = w(r);
var i = n(91);
var o = w(i);
var s = n(127);
var l = w(s);
var u = n(144);
var c = w(u);
var d = n(145);
var f = w(d);
var p = n(196);
var h = w(p);
var m = n(452);
var v = w(m);
t.convertAnnotationPathsFromS3 = j;
var b = n(184);
var g = w(b);
var y = n(9);
var x = w(y);
function w(e) {
return e && e.__esModule ? e : {
default: e
}
}
var k = t.VIDEO_ANNOTATION_PATH_PUBLIC_PROPERTIES = ["scene", "annotationId", "numFrames", "type", "props", "version"];
function j(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
var n = {};
var r = [];
e.forEach(function(e, a) {
var i = e.annotations;
i.forEach(function(e) {
var i;
var o = e.uuid
, s = e.label;
if (!(o in n)) {
n[o] = r.length;
r.push({
id: o,
label: s,
frames: [],
attributes: []
})
}
var l = n[o];
r[l].frames[a] = (i = {
id: o
},
(0,
v.default)(i, t ? "left" : "x", e.left),
(0,
v.default)(i, t ? "top" : "y", e.top),
(0,
v.default)(i, "width", e.width),
(0,
v.default)(i, "height", e.height),
(0,
v.default)(i, "attributes", e.attributes),
i);
r[l].attributes[a] = (0,
h.default)({}, e.attributes)
})
});
return r
}
var E = function(e) {
(0,
f.default)(t, e);
function t(e) {
(0,
o.default)(this, t);
return (0,
c.default)(this, (t.__proto__ || (0,
a.default)(t)).call(this, e, k))
}
(0,
l.default)(t, [{
key: "existsAtFrame",
value: function e(t) {
var n = this;
return x.default.every(["width", "height", "left", "top"].map(function(e) {
return n.hasPropAtFrame(e, t)
}))
}
}], [{
key: "fromJSON",
value: function e(n) {
return new t(n)
}
}]);
return t
}(g.default);
t.default = E
},
173: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = n(3);
var a = S(r);
var i = n(403);
var o = S(i);
var s = n(177);
var l = S(s);
var u = n(74);
var c = S(u);
var d = n(22);
var f = S(d);
var p = n(165);
var h = S(p);
var m = n(34);
var v = S(m);
var b = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var r in n)
Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
}
return e
}
;
var g = function() {
function e(e, t) {
var n = [];
var r = true;
var a = false;
var i = void 0;
try {
for (var o = e[Symbol.iterator](), s; !(r = (s = o.next()).done); r = true) {
n.push(s.value);
if (t && n.length === t)
break
}
} catch (e) {
a = true;
i = e
} finally {
try {
!r && o["return"] && o["return"]()
} finally {
if (a)
throw i
}
}
return n
}
return function(t, n) {
if (Array.isArray(t))
return t;
if (Symbol.iterator in Object(t))
return e(t, n);
throw new TypeError("Invalid attempt to destructure non-iterable instance")
}
}();
var y = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var x = n(0);
var w = S(x);
var k = n(36);
var j = S(k);
var E = n(4);
var _ = S(E);
function S(e) {
return e && e.__esModule ? e : {
default: e
}
}
function C(e) {
return function() {
var t = e.apply(this, arguments);
return new Promise(function(e, n) {
function r(a, i) {
try {
var o = t[a](i);
var s = o.value
} catch (e) {
n(e);
return
}
if (!o.done)
return Promise.resolve(s).then(function(e) {
r("next", e)
}, function(e) {
r("throw", e)
});
e(s)
}
return r("next")
}
)
}
}
function P(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function O(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function A(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var M = {
face: "rgba(101, 31, 255, 1)",
faceIncomplete: "rgba(101, 31, 255, 1)",
faceInvalid: "rgba(255, 0, 0, 1)",
line: "rgba(101, 31, 255, 1)",
lineIncomplete: "rgba(101, 31, 255, 1)",
dragHandleColor: "rgba(30, 30, 255, 1)",
highlight: "rgba(0, 255, 0, 0.5)",
selected: "green",
correct: "green"
};
var I = "-webkit-image-set(\n url('/static/img/components/labeler/[email protected]') 1x,\n url('/static/img/components/labeler/[email protected]') 2x\n), move";
var L = function(e) {
A(t, e);
function t(e, n) {
P(this, t);
var r = O(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n));
var a = Math.min(e.face.x1, e.face.x2);
var i = Math.max(e.face.x1, e.face.x2);
var o = Math.min(e.face.y1, e.face.y2);
var s = Math.max(e.face.y1, e.face.y2);
r.state = {
face: {
x1: a,
x2: i,
y1: o,
y2: s
},
edge: e.edge,
pointOffsets: {},
hoveredTarget: null,
selected: null,
draggingTarget: null,
dragStart: null,
dashOffset: 0
};
(0,
_.default)(r, "getHoverProps", "handleDelete", "handleMovement", "updateDashes", "onKeyDown", "onMouseOut", "onMouseDown", "onMouseUp", "onMouseMove", "areVerticesCorrect", "handleCuboidMouseOver");
return r
}
y(t, [{
key: "componentDidMount",
value: function e() {
this.dashUpdateInterval = setInterval(this.updateDashes, 100);
window.addEventListener("keydown", this.onKeyDown);
window.addEventListener("mousedown", this.onMouseDown);
window.addEventListener("mouseup", this.onMouseUp);
window.addEventListener("mousemove", this.onMouseMove);
this.emitUpdate()
}
}, {
key: "componentDidUpdate",
value: function e(t) {
if (!(0,
v.default)(this.props.horizon, t.horizon) && this.props.horizon && this.state.edge) {
var n = this.estimateEdgeFromHorizon(this.state.edge.ex);
if (n) {
var r = n.ey1
, a = n.ey2;
this.setState({
edge: (0,
h.default)(this.state.edge, {
ey1: r,
ey2: a
})
})
} else
this.setState({
edge: null
})
}
}
}, {
key: "componentWillUnmount",
value: function e() {
this.dashUpdateInterval && clearInterval(this.dashUpdateInterval);
window.removeEventListener("keydown", this.onKeyDown);
window.removeEventListener("mousedown", this.onMouseDown);
window.removeEventListener("mouseup", this.onMouseUp);
window.removeEventListener("mousemove", this.onMouseMove)
}
}, {
key: "getDimensions",
value: function e() {
var t = this.faceWithOffsets()
, n = t.x1
, r = t.x2
, a = t.y1
, i = t.y2;
var o = Math.abs(a - i);
var s = Math.abs(n - r);
return {
actualHeight: o,
actualWidth: s,
height: o * this.props.scale,
width: s * this.props.scale
}
}
}, {
key: "getLineColor",
value: function e() {
if (!this.props.isFullyAnnotated)
return M.lineIncomplete;
return this.props.cuboidColor || M.line
}
}, {
key: "getLineDashArray",
value: function e() {
if (this.props.readOnly)
return null;
if (!this.props.isSelected)
return null;
return null
}
}, {
key: "getLineDashOffset",
value: function e() {
if (this.props.readOnly)
return null;
return this.state.dashOffset
}
}, {
key: "areVerticesCorrect",
value: function e(t, n) {
return this.props.correctVertices && (0,
f.default)(this.props.correctVertices, t) && (0,
f.default)(this.props.correctVertices, n)
}
}, {
key: "estimateEdgeFromHorizon",
value: function e(t) {
var n = this.props.horizon;
var r = this.faceWithOffsets()
, a = r.x1
, i = r.x2
, o = r.y1
, s = r.y2;
var l = (0,
c.default)([a, i, n.x])[1];
var u = t < l ? Math.min(a, i) : Math.max(a, i);
var d = [t, 0, t, 1e3];
var f = [u, o, n.x, n.y];
var p = [u, s, n.x, n.y];
var h = j.default.lineIntersection.apply(j.default, f.concat(d));
var m = j.default.lineIntersection.apply(j.default, p.concat(d));
if (!h || !m || h.y < n.y || m.y < n.y || h.y > o && h.y > s || m.y > o && m.y > s)
return null;
return {
ex: t,
ey1: h.y,
ey2: m.y
}
}
}, {
key: "faceWithOffsets",
value: function e() {
return this.pointsWithOffsets(this.state.face)
}
}, {
key: "edgeWithOffsets",
value: function e() {
if (this.state.edge) {
var t = this.pointsWithOffsets(this.state.edge)
, n = t.ex
, r = t.ey1
, a = t.ey2;
var i = Math.min(r, a);
var o = Math.max(r, a);
return {
ex: n,
ey1: i,
ey2: o
}
}
return null
}
}, {
key: "pointsWithOffsets",
value: function e(t) {
var n = {};
var r = this.state.pointOffsets;
for (var a in t) {
var i = r[a] || 0;
n[a] = t[a] + i
}
return n
}
}, {
key: "pointsScaled",
value: function e(t) {
var n = this;
return (0,
l.default)(t, function(e, t) {
switch (t) {
case "x":
case "x1":
case "x2":
case "ex":
e += n.props.leftOffset;
break;
case "y":
case "y1":
case "y2":
case "ey1":
case "ey2":
e += n.props.topOffset;
break
}
return e * n.props.scale
})
}
}, {
key: "isHighlighted",
value: function e() {
var t = this;
for (var n = arguments.length, r = Array(n), a = 0; a < n; a++)
r[a] = arguments[a];
return r.filter(function(e) {
return (0,
v.default)(t.state.selected, e) || (0,
v.default)(t.state.hoveredTarget, e) || (0,
v.default)(t.state.draggingTarget, e)
}).length > 0
}
}, {
key: "getHoverProps",
value: function e(t) {
var n = this;
var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "pointer";
if (this.props.readOnly)
return {};
return {
onMouseOver: function e(r) {
return n.onMouseOver(r, t)
},
onMouseOut: this.onMouseOut,
style: {
cursor: r
}
}
}
}, {
key: "emitUpdate",
value: function e() {
this.props.onUpdate && this.props.onUpdate({
keyName: this.props.keyName,
face: this.faceWithOffsets(),
edge: this.edgeWithOffsets()
})
}
}, {
key: "createEdge",
value: function e(t) {
var n = this;
return new Promise(function(e) {
var r = void 0;
var a = n.state.face;
"west" === t ? r = {
ex: a.x1,
ey1: a.y1,
ey2: a.y2
} : "east" === t && (r = {
ex: a.x2,
ey1: a.y1,
ey2: a.y2
});
n.setState({
edge: r,
hoveredTarget: ["dupedge"]
}, e)
}
)
}
}, {
key: "adjustSelectionByOffset",
value: function e(t, n) {
var r = this;
var a = g(t, 2)
, i = a[0]
, s = a[1];
var l = {};
if ("face" === i)
l = {
x1: n.x,
x2: n.x,
y1: n.y,
y2: n.y,
ex: n.x,
ey1: n.y,
ey2: n.y
};
else if ("edge" === i)
switch (s) {
case "east":
l = {
x2: n.x
};
break;
case "west":
l = {
x1: n.x
};
break;
case "north":
l = {
y1: n.y
};
break;
case "south":
l = {
y2: n.y
};
break;
default:
break
}
else if ("point" === i) {
var u = g(s, 2)
, c = u[0]
, d = u[1];
l = (0,
o.default)([[c, n.x], [d, n.y]])
} else
"dupedge" === i && (l = {
ex: n.x,
ey1: n.y,
ey2: n.y
});
if (this.props.horizon && this.state.edge) {
var f = this.state.edge.ex + (l.ex || 0);
var p = this.estimateEdgeFromHorizon(f);
if (p) {
l.ey1 = p.ey1 - this.state.edge.ey1;
l.ey2 = p.ey2 - this.state.edge.ey2
}
}
return new Promise(function(e) {
r.setState({
pointOffsets: l
}, e)
}
)
}
}, {
key: "updateDashes",
value: function e() {
!this.props.still && this.setState({
dashOffset: (this.state.dashOffset + 1) % 8
})
}
}, {
key: "handleCuboidMouseOver",
value: function e() {
if (!this.props.readOnly)
return;
this.props.onMouseOver()
}
}, {
key: "handleMovement",
value: function() {
var e = C(a.default.mark(function e(t) {
var n, r;
return a.default.wrap(function e(a) {
while (1)
switch (a.prev = a.next) {
case 0:
if (this.state.selected) {
a.next = 2;
break
}
return a.abrupt("return");
case 2:
n = {
x: 0,
y: 0
};
r = t.shiftKey ? 10 : 1;
a.t0 = t.key;
a.next = "ArrowUp" === a.t0 ? 7 : "ArrowDown" === a.t0 ? 9 : "ArrowLeft" === a.t0 ? 11 : "ArrowRight" === a.t0 ? 13 : 15;
break;
case 7:
n = {
x: 0,
y: -r
};
return a.abrupt("break", 16);
case 9:
n = {
x: 0,
y: r
};
return a.abrupt("break", 16);
case 11:
n = {
x: -r,
y: 0
};
return a.abrupt("break", 16);
case 13:
n = {
x: r,
y: 0
};
return a.abrupt("break", 16);
case 15:
return a.abrupt("break", 16);
case 16:
a.next = 18;
return this.adjustSelectionByOffset(this.state.selected, n);
case 18:
this.setState({
pointOffsets: {},
face: this.faceWithOffsets(),
edge: this.edgeWithOffsets()
}, this.emitUpdate);
case 19:
case "end":
return a.stop()
}
}, e, this)
}));
function t(t) {
return e.apply(this, arguments)
}
return t
}()
}, {
key: "handleDelete",
value: function e() {
this.state.selected && this.props.onDelete && this.props.onDelete()
}
}, {
key: "onMouseOver",
value: function e(t, n) {
this.setState({
hoveredTarget: n
})
}
}, {
key: "onMouseOut",
value: function e() {
this.setState({
hoveredTarget: null
})
}
}, {
key: "onMouseMove",
value: function e(t) {
if (this.props.readOnly)
return;
if (this.state.draggingTarget) {
t.stopPropagation();
var n = {
x: Math.round((t.pageX - this.state.dragStart.pageX) / this.props.scale),
y: Math.round((t.pageY - this.state.dragStart.pageY) / this.props.scale)
};
this.adjustSelectionByOffset(this.state.draggingTarget, n)
}
}
}, {
key: "onMouseUp",
value: function e(t) {
if (this.props.readOnly)
return;
if (this.state.draggingTarget) {
t.stopPropagation();
this.setState({
dragStart: null,
draggingTarget: null,
selected: this.state.hoveredTarget,
hoveredTarget: null,
pointOffsets: {},
face: this.faceWithOffsets(),
edge: this.edgeWithOffsets()
}, this.emitUpdate)
} else
this.state.hoveredTarget && this.setState({
hoveredTarget: null
})
}
}, {
key: "onMouseDown",
value: function() {
var e = C(a.default.mark(function e(t) {
var n, r, i;
return a.default.wrap(function e(a) {
while (1)
switch (a.prev = a.next) {
case 0:
if (!this.props.readOnly) {
a.next = 2;
break
}
return a.abrupt("return");
case 2:
if (!(null === this.state.draggingTarget && this.state.hoveredTarget)) {
a.next = 11;
break
}
t.stopPropagation();
n = g(this.state.hoveredTarget, 2),
r = n[0],
i = n[1];
if (!("duplicate" === r)) {
a.next = 8;
break
}
a.next = 8;
return this.createEdge(i);
case 8:
this.setState({
dragStart: {
pageX: t.pageX,
pageY: t.pageY,
t: new Date
},
draggingTarget: this.state.hoveredTarget
});
a.next = 12;
break;
case 11:
(this.state.selected || this.state.hoveredTarget) && this.setState({
selected: null,
hoveredTarget: null
});
case 12:
case "end":
return a.stop()
}
}, e, this)
}));
function t(t) {
return e.apply(this, arguments)
}
return t
}()
}, {
key: "onKeyDown",
value: function e(t) {
if (this.props.readOnly)
return;
switch (t.key) {
case "Backspace":
t.preventDefault();
this.handleDelete();
break;
case "ArrowUp":
case "ArrowDown":
case "ArrowRight":
case "ArrowLeft":
t.preventDefault();
this.handleMovement(t);
break;
default:
break
}
}
}, {
key: "renderFace",
value: function e(t, n, r, a, i, o, s) {
var l = Math.min(t, n);
var u = Math.min(r, a);
var c = {
x: l,
y: u,
height: i,
width: o
};
var d = void 0;
var f = 1;
if (s)
d = M.faceInvalid;
else if (this.props.isSelected && !this.props.isFullyAnnotated) {
d = M.faceIncomplete;
f = .7
} else if (this.props.isSelected) {
d = this.props.cuboidColor || M.face;
f = .5
} else if (this.props.isFocused) {
d = this.props.cuboidColor || M.face;
f = .5
} else if (this.props.isFullyAnnotated) {
d = this.props.cuboidColor || M.face;
f = .3
} else {
d = M.faceIncomplete;
f = .3
}
return w.default.createElement("rect", b({}, c, this.getHoverProps(["face"], I), {
stroke: this.props.color || this.getLineColor(),
fill: d,
fillOpacity: f,
strokeDasharray: this.getLineDashArray(),
strokeDashoffset: this.getLineDashOffset()
}))
}
}, {
key: "renderEdge",
value: function e(t, n, r, a, i) {
var o = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : "pointer";
var s = void 0;
"west" === t ? s = this.areVerticesCorrect("face-topleft", "face-bottomleft") : "east" === t ? s = this.areVerticesCorrect("face-topright", "face-bottomright") : "north" === t ? s = this.areVerticesCorrect("face-topright", "face-topleft") : "south" === t && (s = this.areVerticesCorrect("face-bottomright", "face-bottomleft"));
return w.default.createElement("g", null, w.default.createElement("line", {
x1: n,
y1: r,
x2: a,
y2: i,
stroke: this.isHighlighted(["edge", t], ["face"]) ? M.highlight : "transparent",
strokeWidth: 4
}), w.default.createElement("line", b({}, this.getHoverProps(["edge", t], o), {
x1: n,
y1: r,
x2: a,
y2: i,
stroke: "transparent",
strokeWidth: 6
})), s ? w.default.createElement("line", {
x1: n,
y1: r,
x2: a,
y2: i,
stroke: M.correct,
strokeWidth: 3
}) : null)
}
}, {
key: "renderPoint",
value: function e(t, n) {
if (this.props.readOnly)
return null;
var r = this.pointsScaled(this.pointsWithOffsets(b({}, this.state.face, this.state.edge)));
var a = r[t];
var i = r[n];
var o = ["point", [t, n]];
return w.default.createElement("g", null, w.default.createElement("circle", {
cx: a,
cy: i,
r: 5,
fill: this.isHighlighted(o) ? M.highlight : "transparent"
}), w.default.createElement("circle", b({}, this.getHoverProps(o, I), {
cx: a,
cy: i,
r: 3,
fill: this.isHighlighted(o) ? M.selected : this.props.color || this.getLineColor()
})))
}
}, {
key: "renderDragHandles",
value: function e(t, n, r, a, i) {
if (this.props.readOnly || this.state.edge)
return null;
var o = Math.max(4, Math.min(12, i / 8));
var s = M.dragHandleColor;
var l = this.state.selected || this.state.hoveredTarget ? .5 : .3;
return w.default.createElement("g", null, w.default.createElement("circle", b({}, this.getHoverProps(["duplicate", "west"], "copy"), {
cx: t,
cy: (r + a) / 2,
r: o,
fill: s,
fillOpacity: this.isHighlighted(["duplicate", "west"]) ? .7 : l
})), w.default.createElement("circle", b({}, this.getHoverProps(["duplicate", "east"], "copy"), {
cx: n,
cy: (r + a) / 2,
r: o,
fill: s,
fillOpacity: this.isHighlighted(["duplicate", "east"]) ? .7 : l
})))
}
}, {
key: "renderTopFace",
value: function e() {
if (!this.state.edge)
return null;
var t = this.faceWithOffsets()
, n = t.x1
, r = t.x2
, a = t.y1
, i = t.y2;
var o = this.pointsWithOffsets(this.state.edge)
, s = o.ex
, l = o.ey1
, u = o.ey2;
var c = Math.abs(a - i);
var d = Math.abs(n - r);
var f = Math.abs(l - u);
var p = f / c;
var h = p * d;
if (f > c)
return null;
if (s > n && s < r)
return null;
if (l > a)
return null;
var m = {
x: s,
y: l
};
var v = void 0;
var g = void 0;
if (s <= n) {
v = {
x: r,
y: a
};
g = {
x: s + h,
y: l
}
} else {
v = {
x: n,
y: a
};
g = {
x: s - h,
y: l
}
}
var y = {
strokeDasharray: this.getLineDashArray(),
strokeDashoffset: this.getLineDashOffset(),
stroke: this.getLineColor(),
strokeOpacity: .5
};
var x = this.pointsScaled(m);
var k = this.pointsScaled(v);
var j = this.pointsScaled(g);
return w.default.createElement("g", null, w.default.createElement("line", b({
x1: x.x,
y1: x.y,
x2: j.x,
y2: j.y
}, y)), w.default.createElement("line", b({
x1: k.x,
y1: k.y,
x2: j.x,
y2: j.y
}, y)))
}
}, {
key: "renderHorizonLines",
value: function e() {
if (this.props.horizon) {
var t = {
strokeDasharray: "1,1",
stroke: this.getLineColor(),
strokeOpacity: .5
};
var n = this.pointsScaled(this.faceWithOffsets())
, r = n.x1
, a = n.x2
, i = n.y1
, o = n.y2;
var s = this.pointsScaled(this.props.horizon);
var l = [{
x: r,
y: i
}, {
x: r,
y: o
}, {
x: a,
y: i
}, {
x: a,
y: o
}];
return w.default.createElement("g", null, l.map(function(e) {
return w.default.createElement("line", b({
key: "horizon" + e.x + e.y,
x1: e.x,
y1: e.y,
x2: s.x,
y2: s.y
}, t))
}))
}
}
}, {
key: "renderDupEdge",
value: function e() {
if (!this.state.edge)
return null;
var t = this.pointsScaled(this.faceWithOffsets())
, n = t.x1
, r = t.x2
, a = t.y1
, i = t.y2;
var o = this.pointsScaled(this.edgeWithOffsets())
, s = o.ex
, l = o.ey1
, u = o.ey2;
var d = (n + r) / 2;
this.props.horizon && (d = (0,
c.default)([n, r, this.props.horizon.x])[1]);
var f = s <= d ? n : r;
var p = this.areVerticesCorrect("side-topcorner", "side-bottomcorner");
var h = s <= d ? this.areVerticesCorrect("face-topleft", "face-bottomleft") : this.areVerticesCorrect("face-topright", "face-bottomright");
var m = p && h;
var v = {
strokeDasharray: m ? void 0 : this.getLineDashArray(),
strokeDashoffset: m ? void 0 : this.getLineDashOffset(),
stroke: m ? M.correct : this.props.color || this.getLineColor(),
strokeWidth: m ? 3 : 1
};
return w.default.createElement("g", null, w.default.createElement("line", b({
x1: f,
y1: a,
x2: s,
y2: l
}, v)), w.default.createElement("line", b({
x1: s,
y1: l,
x2: s,
y2: u
}, v)), w.default.createElement("line", {
x1: s,
y1: l,
x2: s,
y2: u,
stroke: this.isHighlighted(["dupedge"]) ? M.highlight : "transparent",
strokeWidth: 4
}), w.default.createElement("line", b({}, this.getHoverProps(["dupedge"], I), {
x1: s,
y1: l,
x2: s,
y2: u,
stroke: "transparent",
strokeWidth: 6
})), w.default.createElement("line", b({
x1: s,
y1: u,
x2: f,
y2: i
}, v)), this.renderPoint("ex", "ey1"), this.renderPoint("ex", "ey2"))
}
}, {
key: "renderExtendedSideEdges",
value: function e() {
if (!this.state.edge)
return null;
if (!this.props.isSelected)
return null;
var t = this.pointsScaled(this.faceWithOffsets())
, n = t.x1
, r = t.x2
, a = t.y1
, i = t.y2;
var o = this.pointsScaled(this.edgeWithOffsets())
, s = o.ex
, l = o.ey1
, u = o.ey2;
var c = {
strokeOpacity: .7,
strokeDasharray: "2,2",
stroke: this.getLineColor(),
strokeWidth: 1
};
var d = Math.abs(s - n) < Math.abs(s - r) ? n : r;
var f = 100;
var p = d
, h = s + f * (s - d)
, m = a
, v = l + f * (l - a)
, g = i
, y = u + f * (u - i);
return w.default.createElement("g", null, w.default.createElement("line", b({
x1: p,
y1: m,
x2: h,
y2: v
}, c)), w.default.createElement("line", b({
x1: p,
y1: g,
x2: h,
y2: y
}, c)))
}
}, {
key: "render",
value: function e() {
if (this.props.hidden)
return null;
var t = this.getDimensions()
, n = t.actualHeight
, r = t.actualWidth
, a = t.height
, i = t.width;
var o = this.pointsScaled(this.faceWithOffsets())
, s = o.x1
, l = o.x2
, u = o.y1
, c = o.y2;
var d = n < this.props.minHeight || r < this.props.minWidth;
return w.default.createElement("g", {
onMouseOver: this.handleCuboidMouseOver
}, this.renderFace(s, l, u, c, a, i, d), d ? w.default.createElement("g", null, w.default.createElement("line", {
x1: s,
y1: u,
x2: l,
y2: c,
stroke: this.getLineColor(),
strokeDasharray: this.getLineDashArray()
}), w.default.createElement("line", {
x1: l,
y1: u,
x2: s,
y2: c,
stroke: this.getLineColor(),
strokeDasharray: this.getLineDashArray()
})) : null, this.renderEdge("west", s, u, s, c, "ew-resize"), this.renderEdge("east", l, u, l, c, "ew-resize"), this.renderEdge("north", s, u, l, u, "ns-resize"), this.renderEdge("south", s, c, l, c, "ns-resize"), this.renderDupEdge(), this.renderDragHandles(s, l, u, c, a), this.renderTopFace(), this.renderHorizonLines(), this.renderExtendedSideEdges(), this.renderPoint("x1", "y1", "nwse-resize"), this.renderPoint("x1", "y2", "nesw-resize"), this.renderPoint("x2", "y1", "nesw-resize"), this.renderPoint("x2", "y2", "nwse-resize"))
}
}]);
return t
}(x.Component);
L.defaultProps = {
labels: [],
readOnly: false,
scale: 1,
horizon: null
};
t.default = L
},
175: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = {
random: function e(t) {
var n = [];
for (var r = 0; r < t.size; ++r)
n.push([Math.floor(256 * Math.random()), Math.floor(256 * Math.random()), Math.floor(256 * Math.random())]);
return n
},
gray: function e(t) {
var n = [];
for (var r = 0; r < t.size; ++r) {
var a = Math.round(255 * r / t.size);
n.push([a, a, a])
}
return n
},
fixed: function e() {
return [[255, 0, 0], [255, 255, 0], [0, 255, 0], [0, 255, 255], [255, 180, 60], [100, 130, 60], [0, 0, 255], [255, 0, 255], [150, 23, 161], [116, 247, 31], [111, 175, 120], [126, 191, 43], [189, 74, 37], [85, 125, 206], [78, 158, 117], [166, 50, 59], [117, 28, 168], [4, 194, 221], [218, 51, 19], [205, 81, 226], [174, 87, 235], [38, 231, 59], [204, 162, 103], [163, 72, 104], [11, 85, 146], [178, 116, 135], [251, 101, 14], [200, 230, 209], [20, 11, 107], [234, 62, 249], [149, 132, 136], [222, 251, 210], [87, 31, 33], [63, 30, 25], [150, 20, 61], [77, 195, 149], [206, 255, 100], [136, 11, 179], [50, 236, 27], [128, 203, 50], [175, 32, 193], [71, 200, 48], [5, 141, 110], [189, 17, 163], [186, 76, 44], [47, 32, 132], [104, 201, 152], [217, 251, 62], [33, 149, 176], [34, 153, 199], [171, 15, 110], [157, 121, 204], [122, 127, 162], [62, 1, 74], [114, 140, 194], [252, 220, 83], [249, 191, 228], [169, 109, 52], [75, 112, 238], [22, 50, 10], [154, 4, 194], [8, 175, 119], [164, 237, 14], [61, 155, 199], [81, 143, 129], [174, 64, 68], [65, 166, 182], [143, 22, 115], [78, 30, 118], [159, 128, 82], [233, 117, 73], [131, 54, 123], [98, 49, 243], [49, 237, 33], [249, 203, 50], [61, 229, 88], [167, 239, 197], [99, 211, 255], [205, 30, 27], [31, 244, 135], [105, 40, 161], [128, 115, 226], [6, 238, 211], [78, 127, 10], [132, 30, 15], [166, 249, 129], [172, 45, 101], [130, 107, 206], [180, 158, 4], [31, 147, 46], [77, 199, 25], [96, 139, 81], [79, 155, 169], [67, 50, 206], [130, 16, 134], [139, 179, 43], [180, 207, 132], [232, 239, 253], [72, 235, 147], [227, 196, 161], [66, 160, 204], [172, 94, 96], [109, 29, 101], [76, 135, 10], [146, 211, 177], [244, 39, 102], [172, 182, 129], [7, 120, 169], [14, 81, 242], [100, 240, 6], [123, 173, 144], [237, 33, 70], [190, 136, 37], [238, 230, 120], [196, 39, 84], [206, 17, 236], [190, 205, 14], [68, 44, 39], [141, 5, 219], [17, 125, 72], [46, 248, 195], [24, 235, 125], [116, 206, 87], [46, 109, 90], [88, 81, 115], [150, 227, 239], [159, 215, 212], [218, 92, 87], [22, 12, 60], [43, 34, 128], [68, 178, 179], [18, 207, 150], [41, 99, 118], [108, 70, 176], [170, 214, 177], [43, 221, 162], [188, 161, 176], [105, 15, 135], [231, 177, 55], [183, 53, 133], [5, 170, 229], [49, 196, 82], [203, 60, 26], [238, 127, 46], [251, 253, 81], [14, 102, 235], [2, 225, 162], [83, 124, 190], [31, 234, 213], [87, 200, 19], [58, 127, 5], [243, 151, 247], [92, 109, 161], [119, 47, 207], [22, 126, 200], [238, 186, 238], [137, 197, 184], [88, 83, 60], [68, 245, 146], [130, 210, 54], [220, 0, 200], [245, 61, 160], [81, 125, 133], [242, 224, 87], [10, 75, 200], [206, 98, 107], [253, 14, 113], [188, 100, 78], [169, 163, 6], [135, 242, 37], [48, 164, 117], [188, 178, 97], [87, 169, 149], [23, 219, 57], [175, 103, 86], [160, 11, 195], [122, 127, 232], [87, 81, 66], [54, 147, 230], [50, 173, 208], [233, 98, 157], [240, 238, 193], [97, 116, 74], [241, 5, 91], [51, 100, 199], [56, 63, 219], [207, 96, 105], [244, 121, 76], [248, 139, 56], [153, 194, 238], [157, 235, 198], [27, 23, 215], [253, 176, 96], [61, 229, 153], [205, 46, 210], [7, 255, 46], [177, 254, 88], [112, 226, 102], [211, 96, 180], [193, 56, 30], [162, 132, 175], [78, 203, 238], [245, 96, 54], [27, 30, 104], [0, 101, 180], [248, 52, 196], [201, 235, 222], [127, 107, 136], [191, 109, 32], [241, 139, 197], [109, 240, 3], [69, 11, 214], [165, 176, 95], [139, 59, 32], [4, 177, 74], [154, 166, 222], [150, 12, 27], [18, 3, 152], [157, 96, 125], [155, 124, 162], [101, 74, 223], [97, 220, 183], [184, 160, 7], [13, 71, 127], [16, 135, 145], [204, 169, 121], [190, 16, 95], [183, 111, 213], [156, 134, 184], [102, 219, 174], [239, 46, 146], [242, 227, 112], [243, 129, 85], [14, 47, 45], [194, 35, 121], [32, 8, 62], [10, 8, 203], [93, 50, 134], [149, 80, 195], [120, 220, 238], [34, 55, 253], [134, 189, 0], [206, 48, 221], [236, 176, 171], [165, 255, 214], [22, 30, 53], [70, 229, 77], [90, 234, 218], [104, 229, 103], [36, 246, 236], [213, 199, 119], [176, 74, 13], [120, 51, 199], [56, 216, 99]]
},
hsv: function e(t) {
var n = []
, r = void 0 === t.saturation ? 1 : t.saturation;
for (var i = 0; i < t.size; ++i)
n.push(a(i / t.size, r, 1));
return n
},
hhsv: function e(t) {
var n = [];
var a = t.depth || 2
, i = [];
for (var o = 0; o < a; ++o)
i[o] = 0;
for (var s = 0; s < t.size; ++s)
i[Math.floor(a * s / t.size)] += 1;
for (var l = 0; l < a; ++l)
n = n.concat(r.hsv({
size: i[l],
saturation: 1 - l / a
}));
return n
},
single: function e(t) {
var n = [];
for (var r = 0; r < t.size; ++r)
r === t.index ? n.push(t.foreground || [255, 0, 0]) : n.push(t.background || [255, 255, 255]);
return n
}
};
function a(e, t, n) {
var r = Math.floor(6 * e)
, a = 6 * e - r
, i = n * (1 - t)
, o = n * (1 - a * t)
, s = n * (1 - (1 - a) * t);
var l = void 0
, u = void 0
, c = void 0;
switch (r % 6) {
case 0:
l = n;
u = s;
c = i;
break;
case 1:
l = o;
u = n;
c = i;
break;
case 2:
l = i;
u = n;
c = s;
break;
case 3:
l = i;
u = o;
c = n;
break;
case 4:
l = s;
u = i;
c = n;
break;
case 5:
l = n;
u = i;
c = o;
break
}
return [l, u, c].map(function(e) {
return Math.round(255 * e)
})
}
function i(e, t) {
"undefined" === typeof e && (e = "random");
"undefined" === typeof t && (t = {});
t.size = t.size || 8;
return r[e](t)
}
function o(e, t) {
o[e] = t
}
t.default = {
create: i,
register: o
}
},
179: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = n(99);
var a = S(r);
var i = n(14);
var o = S(i);
var s = n(48);
var l = S(s);
var u = n(18);
var c = S(u);
var d = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var r in n)
Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
}
return e
}
;
var f = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var p = n(2);
var h = S(p);
var m = n(0);
var v = S(m);
var b = n(5);
var g = S(b);
var y = n(4);
var x = S(y);
var w = n(25);
var k = n(156);
var j = S(k);
var E = n(308);
var _ = S(E);
function S(e) {
return e && e.__esModule ? e : {
default: e
}
}
function C(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function P(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
function O(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
var A = function() {
function e() {
O(this, e)
}
f(e, null, [{
key: "arrayDividedBy100",
value: function e(t) {
var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : " ";
return t.map(function(e) {
return e / 100
}).join(n)
}
}, {
key: "arrayToPercent",
value: function e(t) {
var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : " ";
return t.map(function(e) {
return e + "%"
}).join(n)
}
}, {
key: "getRandomInt",
value: function e(t, n) {
return Math.floor(Math.random() * (n - t + 1)) + t
}
}, {
key: "getInverseOrd",
value: function e(t) {
var n = void 0;
"n" === t ? n = "s" : "ne" === t ? n = "sw" : "e" === t ? n = "w" : "se" === t ? n = "nw" : "s" === t ? n = "n" : "sw" === t ? n = "ne" : "w" === t ? n = "e" : "nw" === t && (n = "se");
return n
}
}, {
key: "clamp",
value: function e(t, n, r) {
return Math.min(Math.max(t, n), r)
}
}, {
key: "getMouseClientPos",
value: function e(t) {
var n = void 0;
var r = void 0;
if (t.touches) {
n = t.touches[0].pageX;
r = t.touches[0].pageY
} else {
n = t.pageX;
r = t.pageY
}
return {
x: n,
y: r
}
}
}]);
return e
}();
A.ORIENTATION = {
left: "vertical",
right: "vertical",
up: "horizontal",
down: "horizontal"
};
A.ORD_TO_EDGE = {
n: "up",
e: "right",
w: "left",
s: "down",
ne: "up",
se: "right",
sw: "down",
nw: "left"
};
A.SWAP_EDGE_X = {
up: "up",
down: "down",
left: "right",
right: "left"
};
A.SWAP_EDGE_Y = {
up: "down",
down: "up",
left: "left",
right: "right"
};
A.xOrds = ["e", "w"];
A.yOrds = ["n", "s"];
A.xyOrds = ["nw", "ne", "se", "sw"];
A.arrowKey = {
left: 37,
up: 38,
right: 39,
down: 40
};
A.nudgeStep = .2;
A.defaultCrop = {
x: 0,
y: 0,
width: 0,
height: 0
};
var M = function(e) {
P(t, e);
function t(e) {
O(this, t);
var n = C(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
(0,
x.default)(n, "onDocMouseTouchMove", "onDocMouseTouchEnd", "onComponentMouseTouchDown", "onComponentKeyDown", "onCropMouseTouchDown", "handleBoundingBoxClick", "handleBoundingBoxSelect", "handleMouseDown");
n.state = {
crop: n.getNextCropState(e.crop),
polygonId: A.getRandomInt(1, 9e5),
selectedEdge: "left"
};
return n
}
f(t, [{
key: "componentWillMount",
value: function e() {
this.setState({
boundingBoxes: this.props.boundingBoxes,
imageSrc: this.props.src
})
}
}, {
key: "componentDidMount",
value: function e() {
document.addEventListener("mousemove", this.onDocMouseTouchMove);
document.addEventListener("touchmove", this.onDocMouseTouchMove);
document.addEventListener("mouseup", this.onDocMouseTouchEnd);
document.addEventListener("touchend", this.onDocMouseTouchEnd);
document.addEventListener("touchcancel", this.onDocMouseTouchEnd);
if ((this.sourceImage.complete || this.sourceImage.readyState) && 0 === this.sourceImage.naturalWidth) {
var t = this.sourceImage.src;
var n = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";
this.sourceImage.src = n;
this.sourceImage.src = t
}
}
}, {
key: "componentWillReceiveProps",
value: function e(t) {
t.src !== this.props.src && this.setState({
imageSrc: t.src
})
}
}, {
key: "componentWillUpdate",
value: function e(t, n) {
t.boundingBoxes !== this.props.boundingBoxes && (n.boundingBoxes = t.boundingBoxes)
}
}, {
key: "componentDidUpdate",
value: function e(t) {
var n = this;
this.props.selectedAnnotationId === t.selectedAnnotationId && this.props.frame === t.frame || this.handleBoundingBoxSelect(this.props.selectedAnnotationId);
this.props.zoomLevel !== t.zoomLevel && this.props.updateScroll && this.props.updateScroll(function(e) {
var r = e.width
, a = e.height
, i = e.left
, o = e.top;
var s = (i + r / 2) / t.zoomLevel;
var l = (o + a / 2) / t.zoomLevel;
return {
left: s * n.props.zoomLevel - r / 2,
top: l * n.props.zoomLevel - a / 2
}
})
}
}, {
key: "componentWillUnmount",
value: function e() {
document.removeEventListener("mousemove", this.onDocMouseTouchMove);
document.removeEventListener("touchmove", this.onDocMouseTouchMove);
document.removeEventListener("mouseup", this.onDocMouseTouchEnd);
document.removeEventListener("touchend", this.onDocMouseTouchEnd);
document.removeEventListener("touchcancel", this.onDocMouseTouchEnd)
}
}, {
key: "crossOverCheck",
value: function e() {
var t = this.evData;
(!t.xCrossOver && -Math.abs(t.cropStartWidth) - t.xDiffPc >= 0 || t.xCrossOver && -Math.abs(t.cropStartWidth) - t.xDiffPc <= 0) && (t.xCrossOver = !t.xCrossOver);
(!t.yCrossOver && -Math.abs(t.cropStartHeight) - t.yDiffPc >= 0 || t.yCrossOver && -Math.abs(t.cropStartHeight) - t.yDiffPc <= 0) && (t.yCrossOver = !t.yCrossOver);
var n = t.xCrossOver !== t.startXCrossOver;
var r = t.yCrossOver !== t.startYCrossOver;
t.inversedXOrd = !!n && A.getInverseOrd(t.ord);
t.inversedYOrd = !!r && A.getInverseOrd(t.ord)
}
}, {
key: "pixelCropToPercentageCrop",
value: function e(t) {
if (this.isCropInvalid(t) || !this.state.imageWidth || !this.state.imageHeight)
return {
key: t.key,
x: 45,
y: 45,
width: 10,
height: 10
};
return {
key: t.key,
x: 100 * t.x / this.state.imageWidth,
y: 100 * t.y / this.state.imageHeight,
width: 100 * t.width / this.state.imageWidth,
height: 100 * t.height / this.state.imageHeight
}
}
}, {
key: "boundingBoxById",
value: function e(t) {
return (0,
c.default)(this.state.boundingBoxes, function(e) {
return e.key === t
})
}
}, {
key: "isCropInvalid",
value: function e(t) {
return !t.width || !t.height
}
}, {
key: "isCropTooSmall",
value: function e() {
if (!this.props.minimumWidth || !this.props.minimumHeight || !this.state.crop)
return false;
if (!this.state.crop.width || !this.state.crop.height)
return false;
var t = this.getPixelCrop(this.state.crop);
var n = this.props.minimumWidth && this.props.minimumWidth > t.width;
var r = this.props.minimumHeight && this.props.minimumHeight > t.height;
if (this.props.isMinDimensionsAnd)
return n || r;
return n && r
}
}, {
key: "getNextCropState",
value: function e(t) {
var n = Object.assign({}, A.defaultCrop, t);
this.cropInvalid = this.isCropInvalid(n);
return n
}
}, {
key: "getPolygonValues",
value: function e(t) {
var n = this.state.crop;
n = n || {
x: 0,
y: 0,
width: 10,
height: 10
};
var r = [n.x, n.y];
var a = [n.x + n.width, n.y];
var i = [n.x, n.y + n.height];
var o = [n.x + n.width, n.y + n.height];
if (t) {
r = A.arrayDividedBy100(r);
a = A.arrayDividedBy100(a);
i = A.arrayDividedBy100(i);
o = A.arrayDividedBy100(o)
} else {
r = A.arrayToPercent(r);
a = A.arrayToPercent(a);
i = A.arrayToPercent(i);
o = A.arrayToPercent(o)
}
return {
top: {
left: r,
right: a
},
bottom: {
left: i,
right: o
}
}
}
}, {
key: "getImageClipPath",
value: function e() {
var t = this.getPolygonValues()
, n = t.top
, r = t.bottom;
return "polygon(" + n.left + ", " + n.right + ", " + r.right + ", " + r.left + ")"
}
}, {
key: "getPixelCrop",
value: function e(t) {
return {
key: this.props.selectedAnnotationId,
x: Math.round(this.sourceImage.naturalWidth * (t.x / 100)),
y: Math.round(this.sourceImage.naturalHeight * (t.y / 100)),
width: Math.round(this.sourceImage.naturalWidth * (t.width / 100)),
height: Math.round(this.sourceImage.naturalHeight * (t.height / 100))
}
}
}, {
key: "getElementOffset",
value: function e(t) {
var n = t.getBoundingClientRect();
var r = document.documentElement;
var a = n.top + window.pageYOffset - r.clientTop;
var i = n.left + window.pageXOffset - r.clientLeft;
return {
top: a,
left: i
}
}
}, {
key: "getNewSize",
value: function e() {
var t = this.evData;
var n = t.cropStartWidth + t.xDiffPc;
t.xCrossOver && (n = Math.abs(n));
var r = this.props.maxWidth;
if (!this.state.newCropIsBeingDrawn) {
r = ["nw", "w", "sw"].indexOf(t.inversedXOrd || t.ord) > -1 ? t.cropStartX : 100 - t.cropStartX;
r = A.clamp(r, 100, this.props.maxWidth)
}
n = A.clamp(n, this.props.minWidth || 0, r);
var a = void 0;
a = t.cropStartHeight + t.yDiffPc;
t.yCrossOver && (a = Math.min(Math.abs(a), t.cropStartY));
var i = this.props.maxHeight;
if (!this.state.newCropIsBeingDrawn) {
i = ["nw", "n", "ne"].indexOf(t.inversedYOrd || t.ord) > -1 ? t.cropStartY : 100 - t.cropStartY;
i = A.clamp(i, 100, this.props.maxHeight)
}
a = A.clamp(a, this.props.minHeight || 0, i);
return {
width: n,
height: a
}
}
}, {
key: "getPolygonId",
value: function e() {
return "ReactCropClipPolygon-" + this.state.polygonId
}
}, {
key: "updateImage",
value: function e() {
var t = this.sourceImage;
this.setState({
imageWidth: t.naturalWidth,
imageHeight: t.naturalHeight
})
}
}, {
key: "startCrop",
value: function e() {
var t = this;
this.mouseDownOnCrop = this.props.canAddBox;
this.setState({
newCropIsBeingDrawn: this.props.canAddBox
}, function() {
t.props.handleAnnotationSelect(null)
})
}
}, {
key: "selectEdge",
value: function e(t) {
this.setState({
selectedEdge: t
})
}
}, {
key: "resizeInDirection",
value: function e(t, n) {
var r = this;
if (!this.state.crop)
return;
var a = this.state.selectedEdge;
if (A.ORIENTATION[a] !== A.ORIENTATION[t]) {
this.selectEdge(t);
return
}
var i = this.getPixelCrop(this.state.crop);
if ("right" === t)
if ("right" === a)
i.width += n;
else {
i.width -= n;
i.x += n
}
else if ("left" === t)
if ("right" === a)
i.width -= n;
else {
i.width += n;
i.x -= n
}
else if ("down" === t)
if ("down" === a)
i.height += n;
else {
i.height -= n;
i.y += n
}
else if ("up" === t)
if ("down" === a)
i.height -= n;
else {
i.height += n;
i.y -= n
}
if (this.isCropInvalid(i))
return;
this.setState({
crop: this.pixelCropToPercentageCrop(i)
}, function() {
r.props.onComplete(i)
})
}
}, {
key: "dragCrop",
value: function e() {
var t = this.state.crop;
var n = this.evData;
t.x = A.clamp(n.cropStartX + n.xDiffPc, 0, 100 - t.width);
t.y = A.clamp(n.cropStartY + n.yDiffPc, 0, 100 - t.height)
}
}, {
key: "resizeCrop",
value: function e() {
var t = this.state.crop;
var n = this.evData;
var r = n.ord;
n.xInversed && (n.xDiffPc -= 2 * n.cropStartWidth);
n.yInversed && (n.yDiffPc -= 2 * n.cropStartHeight);
var a = this.getNewSize();
var i = n.cropStartX;
var o = n.cropStartY;
n.xCrossOver && (i = t.x + (t.width - a.width));
n.yCrossOver && (o = false === n.lastYCrossover ? t.y - a.height : t.y + (t.height - a.height));
t.x = A.clamp(i, 0, 100 - a.width);
t.y = A.clamp(o, 0, 100 - a.height);
if (A.xyOrds.indexOf(r) > -1) {
t.width = a.width;
t.height = a.height
} else
A.xOrds.indexOf(r) > -1 ? t.width = a.width : A.yOrds.indexOf(r) > -1 && (t.height = a.height);
n.lastYCrossover = n.yCrossOver;
this.crossOverCheck();
var s = this.evData.xCrossOver !== this.evData.startXCrossOver;
var l = this.evData.yCrossOver !== this.evData.startYCrossOver;
var u = A.ORD_TO_EDGE[this.evData.ord];
s && (u = A.SWAP_EDGE_X[u]);
l && (u = A.SWAP_EDGE_Y[u]);
this.evData.ord && this.setState({
selectedEdge: u
})
}
}, {
key: "handleImageLoad",
value: function e() {
this.props.imageDidLoad && this.props.imageDidLoad();
this.updateImage()
}
}, {
key: "handleImageError",
value: function e() {
this.state.imageSrc === this.props.src && this.props.fallbackSrc ? this.setState({
imageSrc: this.props.fallbackSrc
}) : this.props.imageDidLoad(false)
}
}, {
key: "handleMouseDown",
value: function e(t) {
if (t.target !== this.imageCopyRef && t.target !== this.cropWrapperRef)
return;
if (this.props.disabled)
return;
t.preventDefault();
var n = this.state.newCropIsBeingDrawn ? {} : this.state.crop;
var r = A.getMouseClientPos(t);
this.componentRef.focus();
var a = this.getElementOffset(this.sourceImage);
var i = (r.x - a.left) / this.imageWidth * 100;
var o = (r.y - a.top) / this.imageHeight * 100;
n.x = i;
n.y = o;
n.width = 0;
n.height = 0;
this.evData = {
clientStartX: r.x,
clientStartY: r.y,
cropStartWidth: n.width,
cropStartHeight: n.height,
cropStartX: n.x,
cropStartY: n.y,
xInversed: false,
yInversed: false,
xCrossOver: false,
yCrossOver: false,
startXCrossOver: false,
startYCrossOver: false,
isResize: true,
ord: "se"
};
this.startCrop()
}
}, {
key: "onDocMouseTouchMove",
value: function e(t) {
if (this.props.disabled)
return;
if (!this.mouseDownOnCrop)
return;
t.preventDefault();
var n = this.state.crop;
var r = this.evData;
var a = A.getMouseClientPos(t);
var i = a.x - r.clientStartX;
r.xDiffPc = i / this.imageWidth * 100;
var o = a.y - r.clientStartY;
r.yDiffPc = o / this.imageHeight * 100;
r.isResize ? this.resizeCrop() : this.dragCrop();
this.cropInvalid = false;
this.props.onChange && this.props.onChange(n, this.getPixelCrop(n));
this.setState({
crop: n
})
}
}, {
key: "onDocMouseTouchEnd",
value: function e() {
if (this.props.disabled)
return;
if (this.mouseDownOnCrop) {
var t = this.state.crop;
this.cropInvalid = this.isCropInvalid(t);
this.mouseDownOnCrop = false;
this.props.onComplete && this.props.onComplete(this.getPixelCrop(t));
this.setState({
newCropIsBeingDrawn: false
})
}
}
}, {
key: "onComponentMouseTouchDown",
value: function e(t) {
if (t.target !== this.imageCopyRef && t.target !== this.cropWrapperRef)
return;
if (this.props.disabled)
return;
t.preventDefault();
var n = true === this.props.keepSelection ? {} : this.state.crop;
var r = A.getMouseClientPos(t);
this.componentRef.focus();
var a = this.getElementOffset(this.sourceImage);
var i = (r.x - a.left) / this.imageWidth * 100;
var o = (r.y - a.top) / this.imageHeight * 100;
n.x = i;
n.y = o;
n.width = 0;
n.height = 0;
this.evData = {
clientStartX: r.x,
clientStartY: r.y,
cropStartWidth: n.width,
cropStartHeight: n.height,
cropStartX: n.x,
cropStartY: n.y,
xInversed: false,
yInversed: false,
xCrossOver: false,
yCrossOver: false,
startXCrossOver: false,
startYCrossOver: false,
isResize: true,
ord: "nw"
};
this.startCrop()
}
}, {
key: "onComponentKeyDown",
value: function e(t) {
var n = this;
if (this.props.disabled)
return;
var r = t.which;
var a = this.state.crop;
var i = false;
if (!a.width || !a.height)
return;
if (r === A.arrowKey.left) {
a.x -= A.nudgeStep;
i = true
} else if (r === A.arrowKey.right) {
a.x += A.nudgeStep;
i = true
} else if (r === A.arrowKey.up) {
a.y -= A.nudgeStep;
i = true
} else if (r === A.arrowKey.down) {
a.y += A.nudgeStep;
i = true
}
if (i) {
t.preventDefault();
a.x = A.clamp(a.x, 0, 100 - a.width);
a.y = A.clamp(a.y, 0, 100 - a.height);
this.setState({
crop: a
}, function() {
n.props.onChange && n.props.onChange(a, n.getPixelCrop(a));
n.props.onComplete && n.props.onComplete(a, n.getPixelCrop(a))
})
}
}
}, {
key: "onCropMouseTouchDown",
value: function e(t) {
if (this.props.disabled)
return;
t.preventDefault();
var n = this.state.crop;
var r = A.getMouseClientPos(t);
this.componentRef.focus();
var a = t.target.dataset.ord;
var i = "nw" === a || "w" === a || "sw" === a;
var o = "nw" === a || "n" === a || "ne" === a;
var s = void 0;
this.evData = {
clientStartX: r.x,
clientStartY: r.y,
cropStartWidth: n.width,
cropStartHeight: n.height,
cropStartX: i ? n.x + n.width : n.x,
cropStartY: o ? n.y + n.height : n.y,
xInversed: i,
yInversed: o,
xCrossOver: i,
yCrossOver: o,
startXCrossOver: i,
startYCrossOver: o,
isResize: t.target !== this.cropSelectRef,
ord: a,
cropOffset: s
};
this.mouseDownOnCrop = true
}
}, {
key: "handleBoundingBoxClick",
value: function e(t, n, r) {
var a = this;
r.persist();
r.preventDefault();
this.props.handleAnnotationSelect(t);
var i = this.boundingBoxById(t);
this.mouseDownOnCrop = false;
this.cropInvalid = false;
this.setState({
crop: this.pixelCropToPercentageCrop(i)
}, function() {
var e = a.state.crop;
var t = A.getMouseClientPos(r);
a.componentRef.focus();
var i = "nw" === n || "w" === n || "sw" === n;
var o = "nw" === n || "n" === n || "ne" === n;
var s = void 0;
a.evData = {
clientStartX: t.x,
clientStartY: t.y,
cropStartWidth: e.width,
cropStartHeight: e.height,
cropStartX: i ? e.x + e.width : e.x,
cropStartY: o ? e.y + e.height : e.y,
xInversed: i,
yInversed: o,
xCrossOver: i,
yCrossOver: o,
startXCrossOver: i,
startYCrossOver: o,
isResize: r.target !== a.cropSelectRef,
ord: n,
cropOffset: s
};
a.mouseDownOnCrop = true
});
return
}
}, {
key: "handleBoundingBoxSelect",
value: function e(t) {
var n = this;
if (t) {
var r = this.boundingBoxById(this.props.selectedAnnotationId);
var a = this.pixelCropToPercentageCrop(r);
this.componentRef.focus();
var i = false;
var o = false;
var s = "e";
this.cropInvalid = false;
this.setState({
crop: a
}, function() {
n.evData = {
clientStartX: a.x,
clientStartY: a.y,
cropStartWidth: a.width,
cropStartHeight: a.height,
cropStartX: i ? a.x + a.width : a.x,
cropStartY: o ? a.y + a.height : a.y,
xInversed: i,
yInversed: o,
xCrossOver: i,
yCrossOver: o,
startXCrossOver: i,
startYCrossOver: o,
isResize: false,
ord: s
};
n.mouseDownOnCrop = false;
n.props.handleChange(n.props.boundingBoxes)
})
}
}
}, {
key: "renderBoundingBoxes",
value: function e() {
var t = this;
var n = (0,
l.default)(this.state.boundingBoxes);
if (this.props.annotationVisibility < w.AnnotationVisibility.SHOW_PATHS) {
var r = this.props.selectedAnnotationId || this.props.focusedAnnotationId;
if (!r)
return null;
var a = (0,
c.default)(n, function(e) {
return e.key === r
});
n = a ? [a] : []
}
this.props.readOnly || (n = (0,
o.default)(n, function(e) {
return e.key !== t.props.selectedAnnotationId
}));
this.props.readOnly && (n = (0,
o.default)(n, function(e) {
return !e.fake
}));
return n.map(function(e) {
return v.default.createElement(_.default, d({}, e, {
key: e.key,
id: e.key,
zoomLevel: t.props.zoomLevel,
tetherZIndex: t.props.tetherZIndex,
className: null !== e.correct ? e.correct ? "correct" : "wrong" : "ungraded",
isReadOnly: t.props.readOnly,
onEdit: t.props.readOnly ? null : t.handleBoundingBoxClick,
onDelete: t.props.readOnly || !t.props.shouldShowDelete ? null : t.props.onDelete,
selectedBreakdown: t.props.selectedBreakdown,
breakdownColors: t.props.breakdownColors,
isLabelRequired: t.props.isLabelRequired,
labelChoices: t.props.labelChoices,
attrDefinitions: t.props.attrDefinitions,
showLabelBox: t.props.showLabelBox,
annotationVisibility: t.props.annotationVisibility,
selectedAnnotationId: t.props.selectedAnnotationId,
focusedAnnotationId: t.props.focusedAnnotationId,
handleAnnotationFocus: t.props.handleAnnotationFocus,
handleAnnotationSelect: t.props.handleAnnotationSelect
}))
})
}
}, {
key: "renderCropSelection",
value: function e() {
var t = this;
if (!this.state.crop)
return null;
var n = {
zIndex: 2,
top: this.state.crop.y + "%",
left: this.state.crop.x + "%",
width: this.state.crop.width + "%",
height: this.state.crop.height + "%"
};
return v.default.createElement("div", {
ref: function e(n) {
t.cropSelectRef = n
},
className: "ReactCrop--crop-selection",
style: n,
onMouseDown: this.onCropMouseTouchDown,
onTouchStart: this.onCropMouseTouchDown
}, v.default.createElement("div", {
className: "ReactCrop--drag-bar ord-n",
"data-ord": "n"
}), v.default.createElement("div", {
className: "ReactCrop--drag-bar ord-e",
"data-ord": "e"
}), v.default.createElement("div", {
className: "ReactCrop--drag-bar ord-s",
"data-ord": "s"
}), v.default.createElement("div", {
className: "ReactCrop--drag-bar ord-w",
"data-ord": "w"
}), v.default.createElement("div", {
className: "ReactCrop--drag-handle ord-nw",
"data-ord": "nw"
}), v.default.createElement("div", {
className: "ReactCrop--drag-handle ord-n",
"data-ord": "n"
}), v.default.createElement("div", {
className: "ReactCrop--drag-handle ord-ne",
"data-ord": "ne"
}), v.default.createElement("div", {
className: "ReactCrop--drag-handle ord-e",
"data-ord": "e"
}), v.default.createElement("div", {
className: "ReactCrop--drag-handle ord-se",
"data-ord": "se"
}), v.default.createElement("div", {
className: "ReactCrop--drag-handle ord-s",
"data-ord": "s"
}), v.default.createElement("div", {
className: "ReactCrop--drag-handle ord-sw",
"data-ord": "sw"
}), v.default.createElement("div", {
className: "ReactCrop--drag-handle ord-w",
"data-ord": "w"
}))
}
}, {
key: "renderSvg",
value: function e() {
if (!this.state.crop)
return null;
var t = this.getPolygonValues(true)
, n = t.top
, r = t.bottom;
var a = v.default.createElement("polygon", {
points: n.left + ", " + n.right + ", " + r.right + ", " + r.left
});
return v.default.createElement("svg", {
width: "0",
height: "0",
style: {
position: "absolute"
}
}, v.default.createElement("defs", null, v.default.createElement("clipPath", {
id: this.getPolygonId(),
clipPathUnits: "objectBoundingBox"
}, a)))
}
}, {
key: "render",
value: function e() {
var t = this;
var n = "brightness(" + 100 * this.props.imageBrightness + "%) contrast(" + 100 * this.props.imageContrast + "%)";
var r = {
maxWidth: "none",
width: this.imageWidth ? this.imageWidth : "auto",
height: this.imageHeight ? this.imageHeight : "auto",
filter: n
};
var i = (0,
l.default)(r);
var o = void 0;
if (!this.cropInvalid && !this.props.readOnly) {
o = this.renderCropSelection();
(0,
a.default)(i, {
WebkitClipPath: this.getImageClipPath(),
clipPath: 'url("#' + this.getPolygonId() + '")'
})
}
var s = ["ReactCrop"];
this.state.newCropIsBeingDrawn && s.push("ReactCrop-new-crop");
this.props.disabled && s.push("ReactCrop--disabled");
var u = (0,
h.default)("ReactCrop--crop-wrapper", {
"ReactCrop--crop-wrapper--too-small": this.isCropTooSmall(),
"ReactCrop--crop-wrapper--sel-n": "up" === this.state.selectedEdge,
"ReactCrop--crop-wrapper--sel-s": "down" === this.state.selectedEdge,
"ReactCrop--crop-wrapper--sel-e": "right" === this.state.selectedEdge,
"ReactCrop--crop-wrapper--sel-w": "left" === this.state.selectedEdge
});
return v.default.createElement("div", {
ref: function e(n) {
t.componentRef = n
},
className: s.join(" "),
onTouchStart: this.handleMouseDown,
onMouseDown: this.handleMouseDown
}, this.renderSvg(), v.default.createElement("img", {
ref: function e(n) {
t.sourceImage = n
},
key: this.state.imageSrc,
src: this.state.imageSrc,
className: "ReactCrop--image",
style: r,
onLoad: function e(n) {
return t.handleImageLoad(n.target)
},
onError: function e(n) {
return t.handleImageError(n.target)
}
}), v.default.createElement("div", {
className: u,
ref: function e(n) {
t.cropWrapperRef = n
}
}, v.default.createElement("img", {
ref: function e(n) {
t.imageCopyRef = n
},
key: this.state.imageSrc,
src: this.state.imageSrc,
className: "ReactCrop--image-copy",
style: i
}), this.renderBoundingBoxes(), o, this.props.children), v.default.createElement(j.default, null))
}
}, {
key: "imageWidth",
get: function e() {
return (this.state.imageWidth || 0) * this.props.zoomLevel
}
}, {
key: "imageHeight",
get: function e() {
return (this.state.imageHeight || 0) * this.props.zoomLevel
}
}]);
return t
}(v.default.Component);
M.defaultProps = {
disabled: false,
maxWidth: 100,
maxHeight: 100,
crossorigin: "anonymous",
handleAnnotationFocus: function e() {},
handleAnnotationSelect: function e() {},
handleChange: function e() {},
zoomLevel: 1,
shouldShowDelete: true
};
t.default = M
},
180: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = n(131);
var a = p(r);
var i = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var r in n)
Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
}
return e
}
;
var o = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var s = n(0);
var l = p(s);
var u = n(119);
var c = p(u);
var d = n(132);
var f = p(d);
function p(e) {
return e && e.__esModule ? e : {
default: e
}
}
function h(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function m(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function v(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var b = function(e) {
v(t, e);
function t(e) {
h(this, t);
var n = m(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
n.dontFill = true;
n.END_POINT = "last";
n.PATH_TYPE = "line";
return n
}
o(t, [{
key: "isDuplicatePoint",
value: function e() {
var t = this.state.currentPathPoints.length;
var n = (0,
d.getDistance)(this.state.currentPathPoints[t - 1], this.state.currentPathPoints[t - 2]);
return n < d.DISTANCE_THRESHOLD
}
}, {
key: "renderCurrentPath",
value: function e() {
var t = this;
var n = this.state.currentPathPoints;
var r = n.concat(this.state.currentNextPoint ? [this.state.currentNextPoint] : []);
r = r.map(function(e) {
return {
x: e.x * t.props.zoomLevel,
y: e.y * t.props.zoomLevel
}
});
var i = this.state.drawState === d.DRAWING && this.state.currentNextPoint && n.length >= 2 && (0,
d.getDistance)(this.state.currentNextPoint, (0,
a.default)(n)) < d.DISTANCE_THRESHOLD;
var o = n.length - 1;
return l.default.createElement("g", null, l.default.createElement(c.default, {
curve: this.props.curve,
points: r,
strokeWidth: this.props.lineWidth
}), n.map(function(e, n) {
var r = e.x * t.props.zoomLevel;
var a = e.y * t.props.zoomLevel;
return l.default.createElement("circle", {
key: r + "," + a + "#" + n,
cx: r,
cy: a,
r: n === o && i ? t.props.nodeWidth + 2 : t.props.nodeWidth,
stroke: "black",
strokeWidth: t.props.lineWidth,
fill: n === o && i ? t.props.pointFillHighlight : t.props.pointFill
})
}))
}
}]);
return t
}(f.default);
b.defaultProps = i({}, f.default.defaultProps, {
curve: "curveLinear",
nodeWidth: 4,
minPoints: 2
});
t.default = b
},
181: function(e, t, n) {
"use strict";
Object["defineProperty"](t, "__esModule", {
value: !![]
});
var r = n(22);
var a = O(r);
var i = n(81);
var o = O(i);
var s = n(80);
var l = O(s);
var u = n(7);
var c = O(u);
var d = function() {
var e = {
cSWWw: function(e, t) {
return e === t
},
SYJgr: function(e, t) {
return e(t)
},
BBfaV: function(e, t, n) {
return e(t, n)
}
};
function t(t, n) {
var r = [];
var a = !![];
var i = ![];
var o = void 0;
try {
for (var s = t[Symbol["iterator"]](), l; !(a = (l = s["next"]())["done"]); a = !![]) {
r["push"](l["value"]);
if (n && e["cSWWw"](r["length"], n))
break
}
} catch (e) {
i = !![];
o = e
} finally {
try {
!a && s["return"] && s["return"]()
} finally {
if (i)
throw o
}
}
return r
}
return function(n, r) {
if (Array["isArray"](n))
return n;
if (Symbol["iterator"]in e["SYJgr"](Object, n))
return e["BBfaV"](t, n, r);
throw new TypeError("Invalid attempt to destructure non-iterable instance")
}
}();
var f = function() {
var e = {
oedPp: function(e, t) {
return e in t
},
cyWQG: function(e, t, n) {
return e(t, n)
}
};
function t(t, n) {
for (var r = 0; r < n["length"]; r++) {
var a = n[r];
a["enumerable"] = a["enumerable"] || ![];
a["configurable"] = !![];
e["oedPp"]("value", a) && (a["writable"] = !![]);
Object["defineProperty"](t, a["key"], a)
}
}
return function(n, r, a) {
r && t(n["prototype"], r);
a && e["cyWQG"](t, n, a);
return n
}
}();
var p = n(1);
var h = O(p);
var m = n(2);
var v = O(m);
var b = n(0);
var g = O(b);
var y = n(10);
var x = O(y);
var w = n(404);
var k = O(w);
var j = n(405);
var E = O(j);
var _ = n(4);
var S = O(_);
var C = n(20);
var P = O(C);
function O(e) {
return e && e["__esModule"] ? e : {
default: e
}
}
function A(e, t) {
var n = {
RFWar: function(e, t) {
return e instanceof t
}
};
if (!n["RFWar"](e, t))
throw new TypeError("Cannot call a class as a function")
}
function M(e, t) {
var n = {
pgvVJ: "this hasn't been initialised - super() hasn't been called",
PziiW: "object",
MHKNt: function(e, t) {
return e === t
},
qDIAf: "function"
};
if (!e)
throw new ReferenceError(n["pgvVJ"]);
return t && (typeof t === n["PziiW"] || n["MHKNt"](typeof t, n["qDIAf"])) ? t : e
}
function I(e, t) {
var n = {
uZPms: function(e, t) {
return e !== t
},
MzlXP: "function",
ygBOg: function(e, t) {
return e + t
}
};
if (n["uZPms"](typeof t, n["MzlXP"]) && null !== t)
throw new TypeError(n["ygBOg"]("Super expression must either be null or a function, not ", typeof t));
e["prototype"] = Object["create"](t && t["prototype"], {
constructor: {
value: e,
enumerable: ![],
writable: !![],
configurable: !![]
}
});
t && (Object["setPrototypeOf"] ? Object["setPrototypeOf"](e, t) : e["__proto__"] = t)
}
var L = function(e) {
var t = {
aSptx: "handleMouseMove",
ZjWIi: "selectNextFrame",
mkwJX: "mouseup",
QkDOi: function(e, t) {
return e - t
},
qmKZS: function(e, t) {
return e + t
},
CsvdS: "3|1|4|5|2|0",
xRTRR: function(e, t) {
return e / t
},
NnCSl: "isDone",
jyKKu: function(e, t) {
return e === t
},
OiGhf: function(e, t) {
return e + t
},
bTyTd: function(e, t) {
return e || t
},
rHjLj: "span",
rycRK: "loading-indicator",
BYYTb: "Loading...",
jxeyu: function(e, t, n) {
return e(t, n)
},
KOkyO: function(e, t) {
return e + t
},
PwEsy: "jsx-4170419035",
Cttrr: "frame-selector",
xBQDW: ".frame.jsx-4170419035{background-color:rgba(0,0,0,0.1);}",
wFqiR: ".frame.jsx-4170419035{-webkit-transition:all 0.3s;-webkit-transition:all 0.3s;transition:all 0.3s;}",
ygCbG: ".frame.jsx-4170419035:hover{-webkit-transform:scaleY(1.25);-webkit-transform:scaleY(1.25);-ms-transform:scaleY(1.25);transform:scaleY(1.25);}",
iPkmh: ".frame.jsx-4170419035:nth-last-child(2){border-top-right-radius:8px;border-bottom-right-radius:8px;}",
egddm: "body{cursor:-webkit--webkit-grabbing !important;cursor:-moz--webkit-grabbing !important;cursor:-webkit-grabbing !important;cursor:-webkit-grabbing !important;cursor:-moz-grabbing !important;cursor:grabbing !important;}",
jfoBO: function(e, t) {
return e + t
},
teAgm: function(e, t) {
return e + t
},
xJleY: "jsx-4217095939",
pvzHS: function(e, t) {
return e + t
},
RkljD: "Frame ",
OAfnD: function(e, t) {
return e + t
},
BNAjn: " (Showing all)",
lBvZY: "div",
cshau: function(e, t) {
return e + t
},
Jtezi: function(e, t) {
return e + t
},
beuKM: "frame-selector-prev",
RFbUX: "frame-selector-next",
FRtmd: "strong",
qfzIv: "trigger",
ILHqi: "Previous frame  ",
DBaAI: ".frame-selector.jsx-4217095939{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:400px;margin:0 auto;}",
oFOSh: ".frame-selector.disabled.jsx-4217095939{opacity:0.5;pointer-events:none;}",
Wdkxb: ".frame-selector__title.jsx-4217095939{text-align:center;font-weight:bold;font-size:14px;margin-bottom:6px;}",
wlPJK: ".frame-selector__component.jsx-4217095939 a.jsx-4217095939{-ms-flex-negative:0;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;margin-top:-6px;font-size:20px;color:#777;cursor:pointer;-webkit-transition:all 80ms ease-in-out;-webkit-transition:all 80ms ease-in-out;transition:all 80ms ease-in-out;-webkit-transform-origin:center center;-webkit-transform-origin:center center;-ms-transform-origin:center center;transform-origin:center center;}",
OfrUB: ".frame-selector__component.jsx-4217095939 a.jsx-4217095939:hover{color:#333;-webkit-transform:scale(1.1);-webkit-transform:scale(1.1);-ms-transform:scale(1.1);transform:scale(1.1);}",
dnKAe: ".frame-selector__component.jsx-4217095939 a.jsx-4217095939:last-child{margin-left:4px;}",
BgLUA: "componentDidMount",
YWbiQ: "componentWillUnmount",
VrRMn: "getMinMax",
ftdpi: "selectPreviousFrame",
hKtOn: "handleMouseUp",
uyspO: "renderFrames",
twPZq: "renderDetailText"
};
t["jxeyu"](I, n, e);
function n(e, r) {
var a = "1|2|3|0|4"["split"]("|")
, i = 0;
while (!![]) {
switch (a[i++]) {
case "0":
(0,
S["default"])(o, t["aSptx"], "handleMouseUp", "selectPreviousFrame", t["ZjWIi"]);
continue;
case "1":
A(this, n);
continue;
case "2":
var o = M(this, (n["__proto__"] || Object["getPrototypeOf"](n))["call"](this, e, r));
continue;
case "3":
o["state"] = {};
continue;
case "4":
return o
}
break
}
}
t["jxeyu"](f, n, [{
key: t["BgLUA"],
value: function e() {
document["addEventListener"]("mousemove", this["handleMouseMove"]);
document["addEventListener"]("mouseup", this["handleMouseUp"])
}
}, {
key: t["YWbiQ"],
value: function e() {
document["removeEventListener"]("mousemove", this["handleMouseMove"]);
document["removeEventListener"](t["mkwJX"], this["handleMouseUp"])
}
}, {
key: t["VrRMn"],
value: function e() {
return [0, this["props"]["total"]]
}
}, {
key: t["ftdpi"],
value: function e() {
this["props"]["onSelect"](t["QkDOi"](this["props"]["frame"], 1))
}
}, {
key: "selectNextFrame",
value: function e() {
this["props"]["onSelect"](t["qmKZS"](this["props"]["frame"], 1))
}
}, {
key: t["aSptx"],
value: function e(n) {
if (this["state"]["isDragging"]) {
var r = t["CsvdS"]["split"]("|")
, a = 0;
while (!![]) {
switch (r[a++]) {
case "0":
this["props"]["onSelect"](o);
continue;
case "1":
var i = this["frames"]["getBoundingClientRect"]()["right"];
continue;
case "2":
var o = Math["floor"](this["getMinMax"]()[0] + t["xRTRR"](l - s, t["QkDOi"](i, s)) * u);
continue;
case "3":
var s = this["frames"]["getBoundingClientRect"]()["left"];
continue;
case "4":
var l = Math["min"](Math["max"](n["clientX"], s), i);
continue;
case "5":
var u = t["QkDOi"](this["getMinMax"]()[1], this["getMinMax"]()[0]);
continue
}
break
}
}
}
}, {
key: t["hKtOn"],
value: function e() {
this["setState"](function(e) {
if (e["isDragging"])
return {
isDragging: ![]
}
})
}
}, {
key: t["uyspO"],
value: function e() {
var n = {
zknKQ: t["NnCSl"],
vcRJY: function(e, n) {
return t["jyKKu"](e, n)
},
fSVTm: "div",
pcWQp: function(e, n) {
return t["OiGhf"](e, n)
},
RrVYC: function(e, n) {
return t["bTyTd"](e, n)
}
};
var r = this;
if (this["props"]["loading"])
return g["default"]["createElement"](t["rHjLj"], {
className: t["rycRK"]
}, t["BYYTb"]);
var i = this["getMinMax"]()
, s = t["jxeyu"](d, i, 2)
, u = s[0]
, f = s[1];
var p = this["props"]["frame"];
return g["default"]["createElement"]("div", {
ref: function e(t) {
r["frames"] = t
},
className: t["KOkyO"](t["PwEsy"], " ") + "frame-selector__frames"
}, (0,
c["default"])((0,
l["default"])(u, f), function(e) {
var t = (0,
o["default"])(r["props"]["frameDetails"], [e, "isPresent"]);
var i = t && !(0,
o["default"])(r["props"]["frameDetails"], [e, n["zknKQ"]]);
var s = n["vcRJY"](e, p);
var l = r["state"]["isDragging"];
var u = !(0,
a["default"])(r["props"]["loadedFrames"], e);
var c = (0,
v["default"])({
frame: !![],
default: !r["props"]["detailColor"] && !t,
loading: u,
dragging: l,
selected: s,
present: t,
incomplete: i
});
var d = {};
t && (d["background"] = r["props"]["detailColor"]);
if (i) {
d["background"] = r["props"]["detailColor"];
d["opacity"] = .35
}
return g["default"]["createElement"](n["fSVTm"], {
key: e,
"data-tip": n["pcWQp"](e, 1),
"data-for": "frame-selector",
onMouseDown: function t() {
r["props"]["onSelect"](e);
r["setState"]({
isDragging: !![]
})
},
style: d,
className: "jsx-4170419035 " + n["RrVYC"](c, "")
})
}), g["default"]["createElement"]("strong", {
className: "jsx-4170419035"
}, g["default"]["createElement"](x["default"], {
id: t["Cttrr"]
})), g["default"]["createElement"](h["default"], {
styleId: "4170419035",
css: [".frame-selector__frames.jsx-4170419035{-webkit-box-flex:1;-ms-flex-positive:1;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-item-align:stretch;-webkit-align-self:stretch;-ms-flex-item-align:stretch;align-self:stretch;display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;white-space:nowrap;-webkit-box-pack:stretch;-ms-flex-pack:stretch;-webkit-box-pack:stretch;-webkit-justify-content:stretch;-ms-flex-pack:stretch;justify-content:stretch;}", ".frame.jsx-4170419035{min-width:1px;-webkit-box-flex:1;-ms-flex-positive:1;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", t["xBQDW"], ".frame.loading.jsx-4170419035{background-color:white;}", ".frame.jsx-4170419035:hover,.frame.selected.jsx-4170419035{background-color:#333;}", ".frame.default.jsx-4170419035:hover,.frame.default.selected.jsx-4170419035{background-color:var(--link-color);}", ".frame.jsx-4170419035{cursor:pointer;}", ".frame.selected.jsx-4170419035{cursor:-webkit--webkit-grab;cursor:-moz--webkit-grab;cursor:-webkit-grab;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab;}", ".frame.dragging.jsx-4170419035{cursor:-webkit--webkit-grabbing;cursor:-moz--webkit-grabbing;cursor:-webkit-grabbing;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing;}", t["wFqiR"], t["ygCbG"], ".frame.selected.jsx-4170419035{-webkit-transform:scaleY(1.5);-webkit-transform:scaleY(1.5);-ms-transform:scaleY(1.5);transform:scaleY(1.5);}", ".frame.jsx-4170419035:first-child{border-top-left-radius:8px;border-bottom-left-radius:8px;}", t["iPkmh"]]
}))
}
}, {
key: "renderCursor",
value: function e() {
if (!this["state"]["isDragging"])
return null;
return g["default"]["createElement"]("div", {
className: "jsx-308963053"
}, g["default"]["createElement"](h["default"], {
styleId: "308963053",
css: [t["egddm"]]
}))
}
}, {
key: t["twPZq"],
value: function e() {
if (!this["props"]["detailText"])
return null;
return g["default"]["createElement"]("span", {
style: {
backgroundColor: this["props"]["detailColor"]
},
className: t["jfoBO"](t["teAgm"]("jsx-722887148", " "), "detail")
}, this["props"]["detailText"], g["default"]["createElement"](h["default"], {
styleId: "722887148",
css: [".detail.jsx-722887148{margin-left:12px;padding:4px 8px;border-radius:100px;color:white;font-weight:bold;font-size:13px;}"]
}))
}
}, {
key: "render",
value: function e() {
var n = (0,
v["default"])(t["Cttrr"], {
disabled: this["props"]["disabled"]
});
return g["default"]["createElement"]("div", {
style: this["props"]["style"],
className: t["teAgm"](t["xJleY"] + " ", n || "")
}, g["default"]["createElement"]("div", {
className: t["teAgm"](t["pvzHS"]("jsx-4217095939", " "), "frame-selector__title")
}, t["RkljD"], t["OAfnD"](this["props"]["frame"], 1), this["props"]["standalone"] ? " of " + this["getMinMax"]()[1] : null, this["props"]["showingAllFrames"] && g["default"]["createElement"]("span", {
className: t["xJleY"]
}, t["BNAjn"]), this["renderDetailText"]()), g["default"]["createElement"](t["lBvZY"], {
className: t["cshau"](t["Jtezi"](t["xJleY"], " "), "frame-selector__component")
}, g["default"]["createElement"]("a", {
onClick: this["selectPreviousFrame"],
"data-tip": !![],
"data-for": t["beuKM"],
className: t["xJleY"]
}, g["default"]["createElement"](k["default"], null)), this["renderFrames"](), g["default"]["createElement"]("a", {
onClick: this["selectNextFrame"],
"data-tip": !![],
"data-for": t["RFbUX"],
className: "jsx-4217095939"
}, g["default"]["createElement"](E["default"], null)), g["default"]["createElement"](x["default"], {
id: "frame-selector-prev"
}, g["default"]["createElement"](t["FRtmd"], {
className: t["xJleY"]
}, g["default"]["createElement"]("span", {
className: t["Jtezi"](t["Jtezi"]("jsx-4217095939", " "), t["qfzIv"])
}, t["ILHqi"], g["default"]["createElement"](P["default"], null, this["props"]["prevFrameHotkey"])))), g["default"]["createElement"](x["default"], {
id: t["RFbUX"]
}, g["default"]["createElement"]("strong", {
className: "jsx-4217095939"
}, g["default"]["createElement"]("span", {
className: "jsx-4217095939 trigger"
}, "Next frame  ", g["default"]["createElement"](P["default"], null, this["props"]["nextFrameHotkey"]))))), g["default"]["createElement"](h["default"], {
styleId: "4217095939",
css: [t["DBaAI"], t["oFOSh"], t["Wdkxb"], ".frame-selector__component.jsx-4217095939{height:16px;display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:stretch;-ms-flex-align:stretch;-webkit-align-items:stretch;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;-webkit-box-pack:stretch;-ms-flex-pack:stretch;-webkit-box-pack:stretch;-webkit-justify-content:stretch;-ms-flex-pack:stretch;justify-content:stretch;}", t["wlPJK"], t["OfrUB"], ".frame-selector__component.jsx-4217095939 a.jsx-4217095939:first-child{margin-right:4px;}", t["dnKAe"]]
}), this["renderCursor"]())
}
}]);
return n
}(b["Component"]);
L["defaultProps"] = {
loading: ![],
disabled: ![],
frame: 0,
frameDetails: [],
total: 1,
onSelect: function e() {},
prevFrameHotkey: "-",
nextFrameHotkey: "="
};
t["default"] = L
},
184: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
t.ANNOTATION_PATH_PUBLIC_PROPERTIES = void 0;
var r = n(163);
var a = p(r);
var i = n(46);
var o = p(i);
var s = n(91);
var l = p(s);
var u = n(127);
var c = p(u);
var d = n(9);
var f = p(d);
function p(e) {
return e && e.__esModule ? e : {
default: e
}
}
var h = t.ANNOTATION_PATH_PUBLIC_PROPERTIES = ["scene", "numFrames", "props", "version"];
var m = function() {
function e(t) {
var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : h;
(0,
l.default)(this, e);
f.default.defaults(this, f.default.pick(t, n), {
version: -1,
props: {
static: {},
perFrame: {}
}
});
this._publicProperties = n
}
(0,
c.default)(e, [{
key: "toJSON",
value: function e() {
return f.default.pick(this, this._publicProperties)
}
}, {
key: "isStatic",
value: function e(t) {
return void 0 !== this.props.static[t]
}
}, {
key: "isPerFrame",
value: function e(t) {
return void 0 !== this.props.perFrame[t]
}
}, {
key: "getProp",
value: function e(t, n) {
if (this.isStatic(t))
return this.getStaticProp(t);
if (this.isPerFrame(t))
return this.getPropAtFrame(t, n);
throw new Error("Path does not have property: " + t)
}
}, {
key: "getPropAtFrame",
value: function e(t, n) {
if (!this.isPerFrame(t))
throw new Error("Property is not per-frame: " + t);
return this.props.perFrame[t][n]
}
}, {
key: "getStaticProp",
value: function e(t) {
if (!this.isStatic(t))
throw new Error("Property is not static: " + t);
return this.props.static[t]
}
}, {
key: "setPropAtFrame",
value: function e(t, n, r) {
if (!this.isPerFrame(t))
throw new Error("Property is not per-frame: " + t);
var a = this.props.perFrame[t][n];
this.props.perFrame[t][n] = r;
return a
}
}, {
key: "setStaticProp",
value: function e(t, n) {
if (!this.isStatic(t))
throw new Error("Property is not static: " + t);
var r = this.props.static[t];
this.props.static[t] = n;
return r
}
}, {
key: "makeStatic",
value: function e(t, n) {
var r = void 0;
if (this.isPerFrame(t)) {
r = this.props.perFrame[t];
delete this.props.perFrame[t]
}
this.props.static[t] = n;
return r
}
}, {
key: "makePerFrame",
value: function e(t, n) {
var r = void 0;
if (this.isStatic(t)) {
r = this.props.static[t];
delete this.props.static[t]
}
this.props.perFrame[t] = new Array(this.numFrames);
this.props.perFrame[t].fill(n);
return r
}
}, {
key: "deleteAtFrame",
value: function e(t) {
var n = true;
var r = false;
var i = void 0;
try {
for (var s = (0,
o.default)((0,
a.default)(this.props.perFrame)), l; !(n = (l = s.next()).done); n = true) {
var u = l.value;
delete this.props.perFrame[u][t]
}
} catch (e) {
r = true;
i = e
} finally {
try {
!n && s.return && s.return()
} finally {
if (r)
throw i
}
}
}
}, {
key: "deleteAllProps",
value: function e() {
this.props = {
static: {},
perFrame: {}
}
}
}, {
key: "deleteStaticProp",
value: function e(t) {
delete this.props.static[t]
}
}, {
key: "hasProp",
value: function e(t) {
if (this.isStatic(t)) {
var n = this.getStaticProp(t);
return void 0 !== n && null !== n
}
if (this.isPerFrame(t))
return true;
return false
}
}, {
key: "hasPropAtFrame",
value: function e(t, n) {
if (!this.isPerFrame(t))
return false;
var r = this.getPropAtFrame(t, n);
return void 0 !== r && null !== r
}
}, {
key: "hasStaticProp",
value: function e(t) {
if (!this.isStatic(t))
return false;
var n = this.getStaticProp(t);
return void 0 !== n && null !== n
}
}]);
return e
}();
t.default = m
},
186: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = n(214);
Object.defineProperty(t, "ControlButton", {
enumerable: true,
get: function e() {
return o(r).default
}
});
var a = n(125);
Object.defineProperty(t, "Slider", {
enumerable: true,
get: function e() {
return o(a).default
}
});
var i = n(215);
Object.defineProperty(t, "Shortcuts", {
enumerable: true,
get: function e() {
return o(i).default
}
});
function o(e) {
return e && e.__esModule ? e : {
default: e
}
}
},
187: function(e, t, n) {
"use strict";
Object["defineProperty"](t, "__esModule", {
value: !![]
});
var r = n(39);
var a = i(r);
function i(e) {
var t = {
UoCTU: function(e, t) {
return e != t
}
};
if (e && e["__esModule"])
return e;
var n = {};
if (t["UoCTU"](e, null))
for (var r in e)
Object["prototype"]["hasOwnProperty"]["call"](e, r) && (n[r] = e[r]);
n["default"] = e;
return n
}
var o = new a["Matrix4"];
o["set"](609.695409, 180.384202, 0, .999945389, -721.421597, 7.64479802, 0, .000124365378, -1.25125855, -719.651474, 0, .010451303, -123.041806, -101.016688, 384.38148, -.269386912);
o["transpose"]();
var s = function e(t) {
var n = {
fkNvt: function(e, t) {
return e - t
}
};
var r = t["projectionMatrix"];
return function(e) {
var i = "6|2|4|5|3|1|0"["split"]("|")
, o = 0;
while (!![]) {
switch (i[o++]) {
case "0":
return s;
case "1":
s["multiplyScalar"](t["scale"]);
continue;
case "2":
s["applyMatrix4"](r);
continue;
case "3":
if (t["reversedCoordinates"]) {
s["x"] = t["imageWidth"] - s["x"];
s["y"] = n["fkNvt"](t["imageHeight"], s["y"])
}
continue;
case "4":
s["multiplyScalar"](1 / s["w"]);
continue;
case "5":
t["imageDownscale"] && s["multiplyScalar"](1 / t["imageDownscale"]);
continue;
case "6":
var s = new a["Vector4"](e["x"],e["y"],e["z"],1);
continue
}
break
}
}
};
var l = function e(t) {
var n = {
ZBJKh: "5|1|0|7|2|6|4|3|8",
zGWDW: function(e, t) {
return e / t
},
HOAWq: function(e, t) {
return e * t
},
phtQu: function(e, t) {
return e < t
},
Lsyym: function(e, t) {
return e < t
},
QSBpJ: function(e, t) {
return e * t
},
uOZRQ: function(e, t) {
return e + t
}
};
var r = t["projectionMatrix"];
return function(e) {
var i = n["ZBJKh"]["split"]("|")
, o = 0;
while (!![]) {
switch (i[o++]) {
case "0":
u["applyMatrix4"](r);
continue;
case "1":
var s = .5;
continue;
case "2":
if (!t["imageHeight"] || !t["imageWidth"])
return !![];
continue;
case "3":
u["multiplyScalar"](n["zGWDW"](1, u["w"]));
continue;
case "4":
var l = n["HOAWq"](t["imageWidth"], t["imageDownscale"]);
continue;
case "5":
var u = new a["Vector4"](e["x"],e["y"],e["z"],1);
continue;
case "6":
var c = n["HOAWq"](t["imageHeight"], t["imageDownscale"]);
continue;
case "7":
if (u["w"] <= 0)
return ![];
continue;
case "8":
return n["phtQu"](n["HOAWq"](-s, c), u["y"]) && n["Lsyym"](u["y"], n["QSBpJ"](1 + s, c)) && -s * l < u["x"] && n["Lsyym"](u["x"], n["uOZRQ"](1, s) * l)
}
break
}
}
};
t["default"] = {
componentPropsToImageProjectionFunction: s,
componentPropsToIsVisibleFunction: l,
KITTIProjectionMatrix: o
}
},
188: function(e, t, n) {
"use strict";
Object["defineProperty"](t, "__esModule", {
value: !![]
});
var r = n(195);
var a = _(r);
var i = n(235);
var o = _(i);
var s = n(168);
var l = _(s);
var u = n(193);
var c = _(u);
var d = n(574);
var f = _(d);
var p = n(80);
var h = _(p);
var m = function() {
function e(e, t) {
for (var n = 0; n < t["length"]; n++) {
var r = "2|3|4|0|1"["split"]("|")
, a = 0;
while (!![]) {
switch (r[a++]) {
case "0":
"value"in i && (i["writable"] = !![]);
continue;
case "1":
Object["defineProperty"](e, i["key"], i);
continue;
case "2":
var i = t[n];
continue;
case "3":
i["enumerable"] = i["enumerable"] || ![];
continue;
case "4":
i["configurable"] = !![];
continue
}
break
}
}
}
return function(t, n, r) {
n && e(t["prototype"], n);
r && e(t, r);
return t
}
}();
var v = Object["assign"] || function(e) {
var t = {
FGAOT: function(e, t) {
return e < t
}
};
for (var n = 1; t["FGAOT"](n, arguments["length"]); n++) {
var r = arguments[n];
for (var a in r)
Object["prototype"]["hasOwnProperty"]["call"](r, a) && (e[a] = r[a])
}
return e
}
;
t["getBoundingBox"] = T;
t["getVisibleVertices"] = R;
var b = n(0);
var g = _(b);
var y = n(187);
var x = _(y);
var w = n(233);
var k = n(52);
var j = n(134);
var E = n(147);
function _(e) {
return e && e["__esModule"] ? e : {
default: e
}
}
function S(e, t) {
var n = {
vZByy: function(e, t) {
return e instanceof t
},
dGsAY: "Cannot call a class as a function"
};
if (!n["vZByy"](e, t))
throw new TypeError(n["dGsAY"])
}
function C(e, t) {
var n = {
pcrAf: "this hasn't been initialised - super() hasn't been called",
ULMJH: "object",
nhRwR: "function"
};
if (!e)
throw new ReferenceError(n["pcrAf"]);
return !t || typeof t !== n["ULMJH"] && typeof t !== n["nhRwR"] ? e : t
}
function P(e, t) {
var n = {
gUgfp: function(e, t) {
return e !== t
},
WkqAa: "function",
CfBJl: "Super expression must either be null or a function, not "
};
if (n["gUgfp"](typeof t, n["WkqAa"]) && null !== t)
throw new TypeError(n["CfBJl"] + typeof t);
e["prototype"] = Object["create"](t && t["prototype"], {
constructor: {
value: e,
enumerable: ![],
writable: !![],
configurable: !![]
}
});
t && (Object["setPrototypeOf"] ? Object["setPrototypeOf"](e, t) : e["__proto__"] = t)
}
function O(e) {
var t = {
xojHo: function(e, t) {
return e < t
}
};
if (Array["isArray"](e)) {
for (var n = 0, r = Array(e["length"]); t["xojHo"](n, e["length"]); n++)
r[n] = e[n];
return r
}
return Array["from"](e)
}
function A(e, t, n) {
var r = {
Thhpu: function(e, t) {
return e / t
},
NbPRs: function(e, t) {
return e + t
}
};
return (0,
h["default"])(r["NbPRs"](n, 1))["map"](function(a) {
return t["clone"]()["multiplyScalar"](a)["add"](e["clone"]()["multiplyScalar"](n - a))["multiplyScalar"](r["Thhpu"](1, n))
})
}
function M(e, t) {
var n = x["default"]["componentPropsToImageProjectionFunction"](t)
, r = x["default"]["componentPropsToIsVisibleFunction"](t);
return function t(a) {
if (!r(a))
return;
a = n(a);
if (e && e["cx"] && e["cy"] && e["fx"] && e["fy"]) {
if (!(0,
w["distortPointIsGood"])(a, e))
return;
a = (0,
w["distortPoint"])(a, e)
}
return a
}
}
function I(e, t, n, r) {
var a = {
WbpHp: function(e, t) {
return e ^ t
},
aufmD: function(e, t, n, r) {
return e(t, n, r)
},
Mymnm: function(e, t) {
return e(t)
}
};
var i = n ? 10 : 3;
var o = (0,
E["getCorners"])(t);
var s = (0,
k["parseVector3"])(e["position"]);
var u = o["map"](function(e) {
return (0,
k["parseVector3"])(e)["distanceTo"](s)
});
var d = (0,
f["default"])(u, (0,
c["default"])(u));
o = (0,
h["default"])(8)["map"](function(e) {
return o[a["WbpHp"](7 ^ e, d)]
});
var p = [{
isDashed: ![],
edgePaths: [[0, 1, 3, 2], [1, 5, 4, 0, 2, 6, 4]]
}, {
isDashed: !![],
edgePaths: [[5, 7, 3], [7, 6]]
}];
var m = [];
p["forEach"](function(e) {
var t = e["isDashed"]
, n = e["edgePaths"];
n["forEach"](function(e) {
var n = [];
for (var s = 0; s + 1 < e["length"]; s += 1) {
var u = a["aufmD"](A, o[e[s]], o[e[s + 1]], i);
n["push"]["apply"](n, a["Mymnm"](O, u["map"](r)["filter"](l["default"])))
}
m["push"]({
points: n,
isDashed: t
})
})
});
return m
}
function L(e, t, n) {
var r = {
YGZTZ: function(e, t, n, r) {
return e(t, n, r)
}
};
var a = t ? 10 : 3;
var i = (0,
E["getCorners"])(e);
var o = [0, 4, 5, 1, 0];
var s = [];
(0,
h["default"])(4)["forEach"](function(e) {
var t = r["YGZTZ"](A, i[o[e]], i[o[e + 1]], a);
s["push"]["apply"](s, O(t["map"](n)["filter"](l["default"])))
});
return s
}
function T(e, t, n, r, a) {
var i = {
Jqloh: function(e, t, n) {
return e(t, n)
}
};
var s = i["Jqloh"](M, e, v({}, n, {
scale: r,
projectionMatrix: a
}));
var l = I(e, t, !![], s);
var u = []
, d = [];
l["forEach"](function(e) {
e["points"]["forEach"](function(e) {
var t = e["x"]
, n = e["y"];
u["push"](t);
d["push"](n)
})
});
return {
minX: (0,
o["default"])(u),
maxX: (0,
c["default"])(u),
minY: (0,
o["default"])(d),
maxY: (0,
c["default"])(d)
}
}
function R(e, t, n, r, i) {
var o = {
DZaHS: function(e, t, n, r) {
return e(t, n, r)
}
};
var s = M(e, o["DZaHS"](v, {}, n, {
scale: r,
projectionMatrix: i
}));
var l = (0,
E["getCorners"])(t)["map"](s)["filter"](function(e) {
return !(0,
a["default"])(e)
});
return l
}
var F = function(e) {
var t = {
PHVEj: function(e, t, n) {
return e(t, n)
},
ofUZH: function(e, t, n) {
return e(t, n)
},
PMsfm: "idx",
iMUNm: function(e, t) {
return e + t
},
AVXPc: "transparent",
qUkyI: function(e, t) {
return e + t
},
QZMKJ: function(e, t) {
return e * t
},
rittE: "4|2|5|7|8|3|0|6|1|9",
cwgWX: function(e, t, n, r) {
return e(t, n, r)
},
YukgE: function(e, t, n, r, a, i) {
return e(t, n, r, a, i)
},
oxffo: function(e, t) {
return e + t
},
UiXew: function(e, t) {
return e * t
},
POdOS: function(e, t, n) {
return e(t, n)
},
ZjNOL: function(e, t, n, r) {
return e(t, n, r)
},
DVkXb: function(e, t, n, r, a) {
return e(t, n, r, a)
},
efZLo: "polyline",
PLVFS: "render"
};
P(n, e);
function n() {
t["PHVEj"](S, this, n);
return t["ofUZH"](C, this, (n["__proto__"] || Object["getPrototypeOf"](n))["apply"](this, arguments))
}
m(n, [{
key: t["PLVFS"],
value: function e() {
var n = t["rittE"]["split"]("|")
, r = 0;
while (!![]) {
switch (n[r++]) {
case "0":
var a = t["cwgWX"](L, d, f, x);
continue;
case "1":
var i = b ? (0,
j["getLabelColor"])(d["label"]) : d["color"];
continue;
case "2":
var o = this;
continue;
case "3":
var s = t["YukgE"](R, c, d, p, h, m);
continue;
case "4":
var l = {
TFjyP: function(e, n) {
return t["oxffo"](e, n)
}
};
continue;
case "5":
var u = this["props"]
, c = u["camera"]
, d = u["cuboid"]
, f = u["detailed"]
, p = u["cameraProps"]
, h = u["scale"]
, m = u["projectionMatrix"]
, b = u["coloredByLabel"];
continue;
case "6":
var y = t["UiXew"](this["props"]["strokeWidth"], 4);
continue;
case "7":
var x = t["POdOS"](M, c, t["ZjNOL"](v, {}, p, {
scale: h,
projectionMatrix: m
}));
continue;
case "8":
var w = t["DVkXb"](I, c, d, f, x);
continue;
case "9":
return g["default"]["createElement"]("g", null, w["map"](function(e, n) {
var r = e["points"]
, a = e["isDashed"];
return g["default"]["createElement"]("polyline", {
key: d["id"] + t["PMsfm"] + n,
points: r["map"](function(e) {
var t = e["x"]
, n = e["y"];
return l["TFjyP"](t + ",", n)
})["join"](" "),
strokeWidth: o["props"]["strokeWidth"],
stroke: (0,
j["toColorString"])(i),
strokeDasharray: a ? t["iMUNm"](y + ",", y) : "",
fill: t["AVXPc"]
})
}), g["default"]["createElement"](t["efZLo"], {
key: d["id"],
points: a["map"](function(e) {
var t = e["x"]
, n = e["y"];
return t + "," + n
})["join"](" "),
fill: (0,
j["toColorString"])(i, .25)
}), this["props"]["detailed"] && s["map"](function(e, n) {
return g["default"]["createElement"]("circle", {
key: t["iMUNm"](t["qUkyI"](d["id"], "idx"), n),
cx: e["x"],
cy: e["y"],
r: t["QZMKJ"](o["props"]["scale"], .8) * o["props"]["strokeWidth"],
fill: (0,
j["toColorString"])(i),
strokeWidth: 1,
stroke: "white"
})
}))
}
break
}
}
}]);
return n
}(g["default"]["PureComponent"]);
t["default"] = F;
F["defaultProps"] = {
scale: 1,
imageDownscale: 1,
reversedCoordinates: ![],
imageHeight: null,
imageWidth: null,
strokeWidth: 1
}
},
190: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = n(7);
var a = P(r);
var i = n(18);
var o = P(i);
var s = n(58);
var l = P(s);
var u = n(126);
var c = P(u);
var d = n(14);
var f = P(d);
var p = n(33);
var h = P(p);
var m = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var v = n(1);
var b = P(v);
var g = n(0);
var y = P(g);
var x = n(2);
var w = P(x);
var k = n(241);
var j = P(k);
var E = n(4);
var _ = P(E);
var S = n(8);
var C = P(S);
function P(e) {
return e && e.__esModule ? e : {
default: e
}
}
function O(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function A(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function M(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var I = function(e) {
M(t, e);
function t(e) {
O(this, t);
var n = A(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
(0,
_.default)(n, "handleClick");
return n
}
m(t, [{
key: "handleClick",
value: function e(t) {
t.preventDefault();
t.stopPropagation();
this.props.onChange({
target: {
checked: !this.props.checked
}
})
}
}, {
key: "render",
value: function e() {
var t = this.props.checked ? y.default.createElement(C.default, {
name: this.props.iconOn
}) : y.default.createElement(C.default, {
name: this.props.iconOff
});
return y.default.createElement("span", {
onClick: this.handleClick,
style: {
color: this.props.checked ? "black" : "rgba(0, 0, 0, 0.2)"
},
className: "jsx-2129955871 indicator"
}, t, y.default.createElement(b.default, {
styleId: "2129955871",
css: [".indicator.jsx-2129955871{display:inline-block;width:32px;text-align:center;-webkit-transition:all 0.2s;-webkit-transition:all 0.2s;transition:all 0.2s;cursor:pointer;}", ".indicator.jsx-2129955871:hover{-webkit-transform:scale(1.2);-webkit-transform:scale(1.2);-ms-transform:scale(1.2);transform:scale(1.2);}"]
}))
}
}]);
return t
}(y.default.Component);
var L = function(e) {
M(t, e);
function t(e) {
O(this, t);
var n = A(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
(0,
_.default)(n, "handleLabelEnter", "handleLabelLeave");
return n
}
m(t, [{
key: "removeInstance",
value: function e(t, n, r) {
t.preventDefault();
var a = this.props.labelsMap[n];
var i = (0,
h.default)(a, {
index: r
});
window.confirm("Are you sure you want to delete " + n + " #" + (i + 1) + "? This action is permanent and it resets the whole undo history.") && this.props.removeInstance(n, r)
}
}, {
key: "handleLabelEnter",
value: function e(t, n) {
this.props.highlightLabel && this.props.highlightLabel(n)
}
}, {
key: "handleLabelLeave",
value: function e() {
this.props.unhighlightLabel()
}
}, {
key: "renderLabel",
value: function e(t, n) {
var r = this;
var a = arguments.length > 2 && void 0 !== arguments[2] && arguments[2];
var i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : null;
var s = this.props.onVisibleLabelsChange && (0,
f.default)((0,
c.default)((0,
l.default)(this.props.labelsMap)), function(e) {
return e.visible
}).length > 0;
var u = this.props.hoveredLabelIndex === n;
var d = (0,
w.default)("label", {
selected: this.props.isEditableMode && this.props.selectedLabelIndex === n,
disabled: this.props.disabled,
hovered: u
});
var p = "rgb(" + this.props.colormap[n].slice(0, 3).join(",") + ")";
return y.default.createElement("div", {
onMouseEnter: function e(t) {
return r.handleLabelEnter(t, n)
},
onMouseLeave: function e(t) {
return r.handleLabelLeave(t, n)
},
onClick: function e(t) {
return ["INPUT", "path", "svg"].indexOf(t.target.nodeName) < 0 && r.props.isEditableMode && r.props.selectLabel && r.props.selectLabel(n)
},
key: t,
className: "jsx-3043451248 " + (d || "")
}, y.default.createElement("span", {
className: "jsx-3043451248"
}, y.default.createElement("svg", {
height: "20px",
width: "20px",
className: "jsx-3043451248 ball"
}, y.default.createElement("circle", {
cx: "10",
cy: "10",
r: "8",
fill: p,
className: "jsx-3043451248"
})), y.default.createElement("span", {
className: "jsx-3043451248 labelName"
}, t)), y.default.createElement("span", {
className: "jsx-3043451248"
}, this.props.onLockedLabelsChange && this.props.isEditableMode && y.default.createElement(I, {
key: "locked",
iconOn: "lock",
iconOff: "unlock",
onChange: function e(t) {
return r.props.onLockedLabelsChange(n, t)
},
checked: (0,
o.default)((0,
c.default)((0,
l.default)(this.props.labelsMap)), {
index: n
}).locked
}), s && y.default.createElement(I, {
key: "visible",
iconOn: "eye",
iconOff: "eye-slash",
onChange: function e(t) {
return r.props.onVisibleLabelsChange(n, t)
},
checked: (0,
o.default)((0,
c.default)((0,
l.default)(this.props.labelsMap)), {
index: n
}).visible
}), this.props.isEditableMode && a && y.default.createElement("button", {
onClick: function e(t) {
return r.removeInstance(t, i, n)
},
className: "jsx-3043451248 removeInstance"
}, "-")), y.default.createElement(b.default, {
styleId: "3043451248",
css: [".selected.jsx-3043451248{background-color:rgba(0,0,0,0.1);}", ".label.jsx-3043451248:hover{background-color:rgba(0,0,0,0.05);}", ".removeInstance.jsx-3043451248{margin-left:8px;}", "input[type=checkbox].jsx-3043451248{float:right;}", ".label.jsx-3043451248{padding:8px;border-radius:var(--border-radius);display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-transition:all 0.2s;-webkit-transition:all 0.2s;transition:all 0.2s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;}", ".label.short.jsx-3043451248{display:inline-block;width:150px;}", ".label.disabled.jsx-3043451248{pointer-events:none;opacity:0.7;}", ".label.jsx-3043451248 .ball.jsx-3043451248{display:inline-block;vertical-align:middle;margin-right:8px;}", ".label.jsx-3043451248 .labelName.jsx-3043451248{font-size:14px;font-weight:bold;vertical-align:middle;}"]
}))
}
}, {
key: "renderInstanceLabel",
value: function e(t) {
var n = this;
var r = "rgb(" + this.props.colormap[0].slice(0, 3).join(",") + ")";
var i = (0,
f.default)(this.props.labelsMap[t], function(e) {
return !!e.instance
});
return y.default.createElement("div", {
key: t,
className: "jsx-3183167706 instanceLabel"
}, y.default.createElement("svg", {
height: "20px",
width: "20px",
className: "jsx-3183167706 ball"
}, y.default.createElement("circle", {
cx: "10",
cy: "10",
r: "8",
stroke: r,
fill: "none",
className: "jsx-3183167706"
})), y.default.createElement("span", {
className: "jsx-3183167706 labelName"
}, t), this.props.isEditableMode && this.props.addInstance && y.default.createElement("button", {
onClick: function e(r) {
r.preventDefault();
n.props.addInstance(t)
},
className: "jsx-3183167706 createInstance"
}, "+"), this.props.labelsMap && this.props.labelsMap[t] && y.default.createElement("div", {
className: "jsx-3183167706"
}, (0,
a.default)(i, function(e, r) {
return n.renderLabel(t + " #" + (r + 1), e.index, true, t)
})), y.default.createElement(b.default, {
styleId: "3183167706",
css: [".instanceLabel.jsx-3183167706{padding:8px;cursor:default;}", ".instanceLabel.jsx-3183167706 .createInstance.jsx-3183167706{margin-left:8px;}", ".instanceLabel.jsx-3183167706 .ball.jsx-3183167706{display:inline-block;vertical-align:middle;margin-right:8px;}", ".instanceLabel.jsx-3183167706 .labelName.jsx-3183167706{font-size:14px;font-weight:bold;vertical-align:middle;}"]
}))
}
}, {
key: "render",
value: function e() {
var t = this;
var n = this.props.onVisibleLabelsChange && (0,
f.default)((0,
c.default)((0,
l.default)(this.props.labelsMap)), function(e) {
return e.visible
});
var r = "visible";
var i = "inline-block";
if (!this.props.isEditableMode) {
r = "hidden";
n || (i = "none")
}
return y.default.createElement("div", {
style: this.props.style,
className: "jsx-421736974 labels-list"
}, y.default.createElement("div", {
style: {
visibility: r,
display: i,
width: "100%"
},
onClick: function e() {
return t.props.selectLabel && t.props.selectLabel(0)
},
onMouseOver: function e() {
return t.props.highlightLabel && t.props.highlightLabel(0)
},
onMouseOut: this.props.unhighlightLabel,
className: "jsx-421736974 " + ((0,
w.default)("label", "short", {
selected: 0 === this.props.selectedLabelIndex,
disabled: this.props.disabled,
hovered: 0 === this.props.hoveredLabelIndex
}) || "")
}, y.default.createElement(j.default, {
style: {
verticalAlign: "middle",
marginRight: "8px"
},
width: "20px",
height: "20px"
}), y.default.createElement("span", {
className: "jsx-421736974 labelName"
}, "Eraser")), (0,
a.default)(this.props.labelsMap, function(e, n) {
return Array.isArray(e) ? t.renderInstanceLabel(n) : t.renderLabel(n, e.index)
}), y.default.createElement(b.default, {
styleId: "421736974",
css: [".labels-list.jsx-421736974{max-height:400px;overflow:auto;}", ".labels-list.jsx-421736974 .selected.jsx-421736974{background-color:rgba(0,0,0,0.1);}", ".labels-list.jsx-421736974 .label.jsx-421736974:hover{background-color:rgba(0,0,0,0.05);}", ".labels-list.jsx-421736974 input[type=checkbox].jsx-421736974{float:right;}", ".labels-list.jsx-421736974 .label.jsx-421736974{padding:8px;border-radius:var(--border-radius);-webkit-transition:all 0.2s;-webkit-transition:all 0.2s;transition:all 0.2s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;}", ".labels-list.jsx-421736974 .label.short.jsx-421736974{display:inline-block;width:150px;}", ".labels-list.jsx-421736974 .label.disabled.jsx-421736974{pointer-events:none;opacity:0.7;}", ".labels-list.jsx-421736974 .label.jsx-421736974 .ball.jsx-421736974{display:inline-block;vertical-align:middle;margin-right:8px;}", ".labels-list.jsx-421736974 .label.jsx-421736974 .labelName.jsx-421736974{font-size:14px;font-weight:bold;vertical-align:middle;}"]
}))
}
}]);
return t
}(y.default.Component);
t.default = L
},
191: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
t.BaseBoxAnnotation = void 0;
var r = n(3);
var a = _e(r);
var i = n(7);
var o = _e(i);
var s = n(14);
var l = _e(s);
var u = n(138);
var c = _e(u);
var d = n(48);
var f = _e(d);
var p = n(99);
var h = _e(p);
var m = n(110);
var v = _e(m);
var b = n(33);
var g = _e(b);
var y = n(85);
var x = _e(y);
var w = n(58);
var k = _e(w);
var j = n(22);
var E = _e(j);
var _ = n(468);
var S = _e(_);
var C = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var r in n)
Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
}
return e
}
;
var P = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var O = function e(t, n, r) {
null === t && (t = Function.prototype);
var a = Object.getOwnPropertyDescriptor(t, n);
if (void 0 === a) {
var i = Object.getPrototypeOf(t);
return null === i ? void 0 : e(i, n, r)
}
if ("value"in a)
return a.value;
var o = a.get;
if (void 0 === o)
return;
return o.call(r)
};
var A = n(1);
var M = _e(A);
var I = n(50);
var L = _e(I);
var T = n(12);
var R = _e(T);
var F = n(47);
var N = _e(F);
var D = n(0);
var z = _e(D);
var B = n(10);
var V = _e(B);
var W = n(23);
var U = _e(W);
var H = n(25);
var G = n(11);
var Y = n(4);
var K = _e(Y);
var Q = n(6);
var q = _e(Q);
var Z = n(44);
var X = _e(Z);
var J = n(20);
var $ = _e(J);
var ee = n(109);
var te = _e(ee);
var ne = n(179);
var re = _e(ne);
var ae = n(83);
var ie = _e(ae);
var oe = n(93);
var se = _e(oe);
var le = n(94);
var ue = _e(le);
var ce = n(135);
var de = _e(ce);
var fe = n(95);
var pe = _e(fe);
var he = n(122);
var me = _e(he);
var ve = n(156);
var be = _e(ve);
var ge = n(35);
var ye = _e(ge);
var xe = n(42);
var we = _e(xe);
var ke = n(43);
var je = _e(ke);
var Ee = n(92);
function _e(e) {
return e && e.__esModule ? e : {
default: e
}
}
function Se(e) {
if (Array.isArray(e)) {
for (var t = 0, n = Array(e.length); t < e.length; t++)
n[t] = e[t];
return n
}
return Array.from(e)
}
function Ce(e) {
return function() {
var t = e.apply(this, arguments);
return new Promise(function(e, n) {
function r(a, i) {
try {
var o = t[a](i);
var s = o.value
} catch (e) {
n(e);
return
}
if (!o.done)
return Promise.resolve(s).then(function(e) {
r("next", e)
}, function(e) {
r("throw", e)
});
e(s)
}
return r("next")
}
)
}
}
function Pe(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function Oe(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function Ae(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var Me = "57fbc670e27e100600947ed7";
var Ie = "57e973fb830a8cfc8bd08124";
var Le = function(e) {
Ae(t, e);
function t(e) {
Pe(this, t);
var n = Oe(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
n.updateScroll = function(e) {
n.annotationTaskMedia && n.annotationTaskMedia.updateScroll(e)
}
;
(0,
K.default)(n, "handleChange", "handleAnnotationCreate", "handleAnnotationUpdate", "handleAnnotationDelete", "handleAnnotationFocus", "handleAnnotationSelect", "submit");
return n
}
P(t, [{
key: "buildDefaultState",
value: function e() {
var t = -1 !== [Ie, Me].indexOf(this.props.user);
var n = (0,
E.default)((0,
k.default)(G.CRUISE_EV_PROJECTS), this.projectId);
var r = ["593786157da82b0600b0cb91", "59f11892c11cb20007a6998a", "592669568d6cbc06005b1b5a"];
var a = (0,
E.default)(r, this.props.user);
return {
startTime: new Date,
noAnnotations: false,
isCropEnabled: true,
isSubmittingTask: false,
isAttachmentLoading: true,
lastStartedAnnotation: null,
minWidth: t ? n ? 0 : 15 : this.props.params.min_width || 0,
minHeight: t ? n ? 0 : 15 : this.props.params.min_height || 0,
isMinDimensionsAnd: a,
attributes: this.props.attributeDefinitions,
maxAttachmentLoadingTime: (0,
R.default)().add("5", "seconds").toDate(),
showingAnnotations: true,
modalIsOpen: false,
selectedAnnotationId: null,
focusedAnnotationId: null
}
}
}, {
key: "componentWillMount",
value: function e() {
this.setState(this.defaultState)
}
}, {
key: "componentWillUnmount",
value: function e() {
O(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "componentWillUnmount", this).call(this)
}
}, {
key: "componentWillReceiveProps",
value: function e(n) {
O(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "componentWillReceiveProps", this).call(this, n);
!n.isReviewMode || n.editable || this.props.isReviewMode && !this.props.editable || this.handleAnnotationSelect(null);
this.props.baseAnnotations !== n.baseAnnotations && this.setState({
annotations: (0,
H.convertBoxAnnotations)(n.baseAnnotations)
})
}
}, {
key: "getSubmitDisabledStatus",
value: function e() {
var n = O(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "getSubmitDisabledStatus", this).call(this);
if (!n.canSubmit)
return n;
if (!this.props.isReviewMode && !this.state.noAnnotations && !this.state.annotations.length)
return {
canSubmit: false,
submitTooltip: "If there are no annotations, select 'No annotations' before submitting."
};
if (this.unfinishedAnnotations)
return {
canSubmit: false,
submitTooltip: "Make sure to fill out all annotation fields before submitting."
};
return {
canSubmit: true,
submitTooltip: null
}
}
}, {
key: "getReviewSubmitDisabledStatus",
value: function e() {
var n = O(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "getReviewSubmitDisabledStatus", this).call(this);
if (!n.canSubmit)
return n;
return {
canSubmit: true,
submitTooltip: null
}
}
}, {
key: "getReviewChanges",
value: function e() {
return {
annotations: this.annotationsToSubmit
}
}
}, {
key: "cycleSelectedAnnotation",
value: function e() {
var t = this;
var n = this.state.annotations;
if (n.length <= 1)
return;
var r = (0,
g.default)(this.state.annotations, function(e) {
return e.key === t.state.selectedAnnotationId
});
var a = r + 1;
a === (0,
v.default)(this.state.annotations) && (a = 0);
this.handleAnnotationSelect(this.state.annotations[a].key)
}
}, {
key: "resetCurrentCrop",
value: function e() {
var t = this;
if (this.crop) {
this.crop.cropInvalid = true;
this.setState({
isCropEnabled: false
}, function() {
t.setState({
isCropEnabled: true
})
})
}
}
}, {
key: "discardChanges",
value: function e() {
this.setState({
annotations: (0,
H.convertBoxAnnotations)(this.props.baseAnnotations)
})
}
}, {
key: "sendCompletedTask",
value: function e(t, n) {
return this.props.onSubmit(this.props.type, {
task_id: this.props._id,
subtaskVersion: this.props.subtaskVersion,
annotations: this.annotationsToSubmit,
override: !!this.props.fixResponse,
timeSpentSecs: t / 1e3,
timeSpentLoadingSecs: n / 1e3
})
}
}, {
key: "submit",
value: function e() {
var t = this;
if (this.state.noAnnotations && this.state.annotations.length > 0)
return alert("There are annotations and no annotations is checked. To submit this task, either remove the annotations or uncheck No annotations");
var n = (0,
Ee.lintTaskAndResponse)("annotation", {
task: this.props,
response: {
annotations: this.annotationsToSubmit
}
});
if (n.length) {
var r = true;
var i = false;
var o = void 0;
try {
for (var s = n[Symbol.iterator](), l; !(r = (l = s.next()).done); r = true) {
var u = l.value;
U.default.error(u.data.message, {
timeout: "none"
})
}
} catch (e) {
i = true;
o = e
} finally {
try {
!r && s.return && s.return()
} finally {
if (i)
throw o
}
}
return
}
var c = this.taskTimer.elapsedTime();
var d = (0,
R.default)(this.state.attachmentLoadTime).diff(this.state.startTime);
this.resetTimer();
this.setState({
isSubmittingTask: true
}, Ce(a.default.mark(function e() {
return a.default.wrap(function e(n) {
while (1)
switch (n.prev = n.next) {
case 0:
n.prev = 0;
t.closeAllAlerts();
n.next = 4;
return t.sendCompletedTask(c, d);
case 4:
n.next = 9;
break;
case 6:
n.prev = 6;
n.t0 = n["catch"](0);
t.onSubmitError(n.t0);
case 9:
case "end":
return n.stop()
}
}, e, t, [[0, 6]])
})))
}
}, {
key: "handleChange",
value: function e(t) {
var n = this;
this.setState({
annotations: t
}, function() {
n.props.onChange && n.props.onChange(n.madeChanges)
})
}
}, {
key: "handleAnnotationCreate",
value: function e(t) {
if (this.state.selectedAnnotationId) {
this.handleAnnotationUpdate(t);
return
}
if (!t.height || !t.width) {
this.setState({
annotation: null
});
return
}
var n = (0,
h.default)((0,
f.default)(t), {
key: L.default.v4()
});
this.handleChange([].concat(Se(this.state.annotations), [n]));
this.handleAnnotationSelect(n.key)
}
}, {
key: "handleAnnotationUpdate",
value: function e(t) {
var n = (0,
g.default)(this.state.annotations, function(e) {
return e.key === t.key
});
var r = (0,
h.default)((0,
f.default)(this.state.annotations[n]), t);
var a = (0,
c.default)((0,
f.default)(this.state.annotations), n, r);
this.handleChange(a)
}
}, {
key: "handleAnnotationDelete",
value: function e(t, n) {
if (n) {
n.preventDefault();
n.stopPropagation()
}
this.handleAnnotationSelect(null);
this.handleChange((0,
l.default)(this.state.annotations, function(e) {
return e.key !== t
}))
}
}, {
key: "handleAnnotationSelect",
value: function e(t) {
this.setState({
selectedAnnotationId: t
});
t || this.resetCurrentCrop()
}
}, {
key: "handleAnnotationFocus",
value: function e(t) {
this.setState({
focusedAnnotationId: t
})
}
}, {
key: "renderImageBoxLabeler",
value: function e() {
var t = this;
if (this.state.isSubmittingTask)
return;
var n = void 0;
n = this.props.isReviewMode && !this.props.editable ? {
readOnly: true,
disabled: true
} : {
readOnly: false,
disabled: !this.state.isCropEnabled,
onComplete: this.handleAnnotationCreate,
onUpdate: this.handleAnnotationUpdate,
onDelete: this.handleAnnotationDelete,
handleChange: this.handleChange
};
return z.default.createElement(re.default, C({
key: this.props._id,
ref: function e(n) {
t.crop = n
},
boundingBoxes: this.state.annotations,
canAddBox: this.props.canAddBaseAnnotations,
shouldShowDelete: this.props.canDeleteBaseAnnotations,
isLabelRequired: this.props.params.with_labels,
labelChoices: this.objectsToAnnotate,
attrDefinitions: this.props.attributeDefinitions,
breakdownColors: this.props.breakdownColors,
selectedBreakdown: this.props.selectedBreakdown,
handleBreakdownSelect: this.props.handleBreakdownSelect,
keepSelection: true,
minimumWidth: this.state.minWidth,
minimumHeight: this.state.minHeight,
isMinDimensionsAnd: this.state.isMinDimensionsAnd,
src: this.props.params.attachment,
fallbackSrc: this.props.params.fallbackAttachment,
imageDidLoad: this.didLoadAttachment,
imageBrightness: this.props.imageBrightness,
imageContrast: this.props.imageContrast,
zoomLevel: this.props.zoomLevel,
annotationVisibility: this.props.annotationVisibility,
selectedAnnotationId: this.state.selectedAnnotationId,
focusedAnnotationId: this.state.focusedAnnotationId,
handleAnnotationSelect: this.handleAnnotationSelect,
handleAnnotationFocus: this.handleAnnotationFocus,
updateScroll: this.updateScroll
}, n))
}
}, {
key: "renderLoadingSpinner",
value: function e() {
if (!this.state.isAttachmentLoading)
return;
return z.default.createElement("div", {
className: "jsx-180742432 spinner"
}, z.default.createElement(X.default, {
center: true
}), z.default.createElement(M.default, {
styleId: "180742432",
css: [".spinner.jsx-180742432{position:fixed;top:50%;left:50%;z-index:100000;}"]
}))
}
}, {
key: "renderTaskFooter",
value: function e() {
var t = this;
if (this.props.isReviewMode)
return null;
return z.default.createElement(je.default, {
toggleShowingInstructions: this.toggleShowingInstructions,
toggleShowingShortcuts: function e() {
return t.shortcuts.toggleShowing()
},
timerComponent: this.renderTaskTimer(),
claimTimerComponent: this.renderClaimTimer(),
isSubmittingTask: this.state.isSubmittingTask
}, z.default.createElement("div", {
className: "task-footer__right"
}, this.renderNoAnnotations(), this.renderSkipButton(), z.default.createElement(q.default, {
primary: true,
style: {
marginLeft: "15px"
},
disabled: this.isSubmitDisabled() || this.state.isSubmittingTask,
onClick: this.submit,
tooltip: this.disabledTooltip,
type: "button"
}, this.state.isSubmittingTask ? "Submitting..." : "Submit")))
}
}, {
key: "renderMediaContent",
value: function e() {
return z.default.createElement("div", {
className: "media-content"
}, this.renderLoadingSpinner(), this.renderImageBoxLabeler(), this.props.params.layers && this.state.showingAnnotations && z.default.createElement(te.default, {
layers: this.props.params.layers
}))
}
}, {
key: "renderSidebar",
value: function e() {
var t = this;
var n = (0,
o.default)(this.state.annotations, function(e) {
return (0,
h.default)({}, e, {
complete: (0,
G.isAnnotationDone)(e, t.props.attributeDefinitions, t.props.params.with_labels)
})
});
return [z.default.createElement(ue.default, {
key: "ZoomButtons",
zoomLevel: this.props.zoomLevel,
canZoomIn: this.props.zoomLevel < ae.MAX_ZOOM_LEVEL,
canZoomOut: this.props.zoomLevel > ae.MIN_ZOOM_LEVEL,
handleZoomIn: this.props.handleZoomIn,
handleZoomOut: this.props.handleZoomOut,
handleZoomReset: this.props.handleZoomReset
}), this.props.visibilitySelector, z.default.createElement(pe.default, {
key: "ImageAdjustmentControls",
isReadOnly: this.props.isReviewMode && !this.props.editable,
imageBrightness: this.props.imageBrightness,
imageContrast: this.props.imageContrast,
handleBrightnessAdjust: this.props.handleBrightnessAdjust,
handleContrastAdjust: this.props.handleContrastAdjust
}), z.default.createElement(me.default, {
key: "BreakdownSelector",
attrDefinitions: this.props.attributeDefinitions,
selectedBreakdown: this.props.selectedBreakdown,
handleBreakdownSelect: this.props.handleBreakdownSelect
}), z.default.createElement(de.default, {
key: "AnnotationSidebar",
annotationObjects: n,
isLabelRequired: this.props.params.with_labels,
defaultLabel: "box",
labelChoices: this.props.params.objects_to_annotate,
attrDefinitions: this.props.attributeDefinitions,
selectedBreakdown: this.props.selectedBreakdown,
breakdownColors: this.props.breakdownColors,
focusedAnnotationId: this.state.focusedAnnotationId,
selectedAnnotationId: this.state.selectedAnnotationId,
handleFocus: this.handleAnnotationFocus,
handleSelect: this.handleAnnotationSelect,
handleChange: this.handleChange,
isReadOnly: this.props.isReviewMode && !this.props.editable
})]
}
}, {
key: "render",
value: function e() {
var t = this;
return z.default.createElement("div", {
className: "task o__annotation"
}, z.default.createElement(be.default, null), z.default.createElement(we.default, {
taskId: this.props.id,
isReviewMode: this.props.isReviewMode,
taskDescription: this.taskOverview
}), z.default.createElement(se.default, {
ref: function e(n) {
n && (t.annotationTaskMedia = n)
},
mediaContent: this.renderMediaContent(),
sidebarContent: this.renderSidebar(),
didAttachmentLoad: this.state.attachmentLoadingWasSuccessful,
handleFullyScrolled: this.props.handleFullyScrolled,
zoomLevel: this.props.zoomLevel,
isSubmittingTask: this.state.isSubmittingTask
}), this.renderTaskFooter(), z.default.createElement(V.default, null), this.renderInstructions(), this.renderShortcuts())
}
}, {
key: "taskOverview",
get: function e() {
if (this.props.isReviewMode)
return "Please verify that the boxes are correct.";
return "Please annotate the image with boxes."
}
}, {
key: "navigationShortcutMapping",
get: function e() {
var n = this;
return O(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "navigationShortcutMapping", this).concat(this.props.navigationKeyboardShortcuts).concat([{
trigger: "n",
triggerLabel: z.default.createElement($.default, null, "n"),
action: function e() {
return n.cycleSelectedAnnotation()
},
actionLabel: "Select next box"
}])
}
}, {
key: "shortcutMapping",
get: function e() {
var n = this;
var r = [{
trigger: "enter",
triggerLabel: z.default.createElement($.default, null, "↩"),
action: function e() {
return n.handleAnnotationSelect(null)
},
actionLabel: "Complete annotation"
}, {
trigger: "backspace",
triggerLabel: z.default.createElement($.default, null, "⌫"),
action: function e(t) {
return n.handleAnnotationDelete(n.state.selectedAnnotationId, t)
},
actionLabel: "Delete annotation"
}];
this.props.canDeleteBaseAnnotations || (0,
S.default)(r, [{
trigger: "backspace"
}], "trigger");
return r.concat(this.props.keyboardShortcuts).concat(O(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "shortcutMapping", this))
}
}, {
key: "extraShortcutMapping",
get: function e() {
var n = this;
var r = [{
dir: "left",
keys: {
arrow: "left",
letter: "a"
},
label: {
dir: "left",
edge: "left",
letter: "a",
symbol: "←"
}
}, {
dir: "right",
keys: {
arrow: "right",
letter: "d"
},
label: {
dir: "right",
edge: "right",
letter: "d",
symbol: "→"
}
}, {
dir: "up",
keys: {
arrow: "up",
letter: "w"
},
label: {
dir: "up",
edge: "top",
letter: "w",
symbol: "↑"
}
}, {
dir: "down",
keys: {
arrow: "down",
letter: "s"
},
label: {
dir: "down",
edge: "bottom",
letter: "s",
symbol: "↓"
}
}];
var a = r.map(function(e) {
var t = e.dir
, r = e.keys
, a = e.label;
return {
trigger: r.arrow,
triggerLabel: z.default.createElement($.default, null, a.symbol),
action: function e() {
n.state.selectedAnnotationId && n.crop && n.crop.resizeInDirection(t, 1)
},
actionLabel: "Move edge " + a.dir + " 1 px",
preventsDefault: true
}
});
var i = r.map(function(e) {
var t = e.dir
, r = e.keys
, a = e.label;
return {
trigger: "shift+" + r.arrow,
triggerLabel: z.default.createElement("span", null, z.default.createElement($.default, null, "Shift ⇧"), " ", z.default.createElement($.default, null, a.symbol)),
action: function e() {
n.state.selectedAnnotationId && n.crop && n.crop.resizeInDirection(t, 5)
},
actionLabel: "Move edge " + a.dir + " 5 px",
preventsDefault: true
}
});
var o = r.map(function(e) {
var t = e.dir
, r = e.keys
, a = e.label;
return {
trigger: r.letter,
triggerLabel: z.default.createElement($.default, null, a.letter),
action: function e() {
n.state.selectedAnnotationId && n.crop && n.crop.selectEdge(t, 5)
},
actionLabel: "Select " + a.edge + " edge",
preventsDefault: true
}
});
return O(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "extraShortcutMapping", this).concat({
title: "Move edge 1px",
mapping: a
}).concat({
title: "Move edge 5px",
mapping: i
}).concat({
title: "Select edge",
mapping: o
})
}
}, {
key: "defaultState",
get: function e() {
var n = (0,
H.convertBoxAnnotations)(this.props.baseAnnotations);
var r = this.buildDefaultState();
r.annotations = n;
this.props.isReviewMode && this.props.isSubmittingTask && (r.isSubmittingTask = !!this.props.isSubmittingTask);
return Object.assign(O(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "defaultState", this), r)
}
}, {
key: "shouldAssumeAttachmentDownloadedEnough",
get: function e() {
return new Date > this.state.maxAttachmentLoadingTime
}
}, {
key: "objectsToAnnotate",
get: function e() {
if (this.props.params.objects_to_annotate)
return (0,
G.getAllChoiceDescendants)(this.props.params.objects_to_annotate);
if (this.props.params.object_to_annotate)
return [this.props.params.object_to_annotate];
return []
}
}, {
key: "objectsToFix",
get: function e() {
if (this.props.fixResponse.annotations)
return this.props.fixResponse.annotations;
if (this.props.fixResponse.annotation)
return [this.props.fixResponse.annotation];
return []
}
}, {
key: "madeChanges",
get: function e() {
if (!this.props.fixResponse)
return false;
return (0,
N.default)(this.state.annotations) !== (0,
N.default)((0,
H.convertBoxAnnotations)(this.objectsToFix))
}
}, {
key: "unfinishedAnnotations",
get: function e() {
var t = this;
var n = this.props.attributeDefinitions;
return !(0,
x.default)(this.state.annotations, function(e) {
return (0,
G.isAnnotationDone)(e, n, t.props.params.with_labels)
})
}
}, {
key: "convertedAnnotations",
get: function e() {
var t = this;
return this.state.annotations.slice().map(function(e) {
var n = {
width: e.width,
height: e.height,
left: e.x,
top: e.y
};
n.label = e.label;
t.props.attributeDefinitions && (n.attributes = e.attributes);
return n
})
}
}, {
key: "annotationsToSubmit",
get: function e() {
return this.convertedAnnotations
}
}]);
return t
}(ye.default);
t.default = (0,
ie.default)(Le, {
annotationType: ["box", "boxes"]
});
t.BaseBoxAnnotation = Le
},
192: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = n(32);
var a = _(r);
var i = n(24);
var o = _(i);
var s = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var l = n(1);
var u = _(l);
var c = n(0);
var d = _(c);
var f = n(8);
var p = _(f);
var h = n(10);
var m = _(h);
var v = n(5);
var b = _(v);
var g = n(4);
var y = _(g);
var x = n(11);
var w = n(140);
var k = _(w);
var j = n(6);
var E = _(j);
function _(e) {
return e && e.__esModule ? e : {
default: e
}
}
function S(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function C(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function P(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var O = function(e) {
P(t, e);
function t() {
S(this, t);
return C(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments))
}
s(t, [{
key: "render",
value: function e() {
var t = this;
var n = this.props.selectedGroup === this.props.annotationId;
return d.default.createElement("div", {
className: u.default.dynamic([["2929405579", [this.props.annotationColor]]]) + " grouping " + (n ? "active" : "")
}, !n && d.default.createElement(d.default.Fragment, null, d.default.createElement("strong", {
"data-tip": "Use fragments when your annotation is split into multiple pieces",
"data-for": "fragments",
className: u.default.dynamic([["2929405579", [this.props.annotationColor]]])
}, "Fragments   ", d.default.createElement(p.default, {
name: "question-circle"
})), d.default.createElement(E.default, {
size: "sm",
onClick: function e() {
return t.props.handleGroupingStart(t.props.annotationId)
}
}, d.default.createElement(p.default, {
name: "plus-circle"
}), "   Add")), n && d.default.createElement(d.default.Fragment, null, d.default.createElement("strong", {
className: u.default.dynamic([["2929405579", [this.props.annotationColor]]])
}, "Fragment mode active"), d.default.createElement(E.default, {
size: "sm",
onClick: function e() {
return t.props.handleGroupingCancel(t.props.annotationId)
}
}, "Done")), d.default.createElement(m.default, {
id: "fragments"
}), d.default.createElement(u.default, {
styleId: "2929405579",
css: [".grouping.__jsx-style-dynamic-selector{padding:16px;background:rgba(0,0,0,0.05);border-bottom-left-radius:var(--border-radius);border-bottom-right-radius:var(--border-radius);font-size:14px;display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-transition:background-color 0.2s;-webkit-transition:background-color 0.2s;transition:background-color 0.2s;}", ".grouping.active.__jsx-style-dynamic-selector{color:white;background:" + this.props.annotationColor + ";}"],
dynamic: [this.props.annotationColor]
}))
}
}]);
return t
}(d.default.Component);
var A = function(e) {
P(t, e);
function t(e) {
S(this, t);
var n = C(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
(0,
y.default)(n, "getRequiredAttributes", "handleLabelSelect", "handleAttrSelect", "renderAttribute");
return n
}
s(t, [{
key: "getRequiredAttributes",
value: function e() {
if ((0,
o.default)(this.props.attrDefinitions))
return [];
var t = (0,
x.requiredAttributesForAnnotation)({
label: this.props.labelSelection,
attributes: this.props.attrSelections
}, this.props.attrDefinitions);
return t
}
}, {
key: "handleLabelSelect",
value: function e(t, n) {
this.props.handleChange(this.props.annotationId, {
labelVal: n
})
}
}, {
key: "handleAttrSelect",
value: function e(t, n) {
this.props.handleChange(this.props.annotationId, {
attrKey: t,
attrVal: n
})
}
}, {
key: "renderLabel",
value: function e() {
var t = {
type: "label",
description: "Select a label",
choices: this.props.labelChoices
};
return d.default.createElement(k.default, {
isReadOnly: this.props.isReadOnly,
key: this.props.annotationId + " label",
attrKey: "label",
attrParams: t,
selectedChoice: this.props.labelSelection,
handleUpdateSelection: this.handleLabelSelect
})
}
}, {
key: "renderAttribute",
value: function e(t) {
return d.default.createElement(k.default, {
isReadOnly: this.props.isReadOnly,
key: this.props.annotationId + " " + t,
attrKey: t,
attrParams: this.props.attrDefinitions[t],
selectedChoice: this.props.attrSelections[t],
handleUpdateSelection: this.handleAttrSelect
})
}
}, {
key: "render",
value: function e() {
return d.default.createElement("div", {
className: "jsx-2101740806 attributes-picker"
}, d.default.createElement("div", {
style: {
padding: "16px"
},
className: "jsx-2101740806"
}, this.props.isLabelRequired && this.renderLabel(), (0,
a.default)(this.getRequiredAttributes()).map(this.renderAttribute)), this.props.isGroupingEnabled && d.default.createElement(O, {
annotationId: this.props.annotationId,
defaultLabel: this.props.defaultLabel,
selectedGroup: this.props.selectedGroup,
handleGroupingStart: this.props.handleGroupingStart,
handleGroupingCancel: this.props.handleGroupingCancel,
annotationColor: this.props.annotationColor
}), d.default.createElement(u.default, {
styleId: "2101740806",
css: [".attributes-picker.jsx-2101740806{background:var(--bg-gray-light-1);border-bottom-left-radius:var(--border-radius);border-bottom-right-radius:var(--border-radius);position:relative;z-index:0;-webkit-animation:slide 0.2s;-webkit-animation:slide-jsx-2101740806 0.2s;animation:slide-jsx-2101740806 0.2s;}", "@-webkit-keyframes slide{0%.jsx-2101740806{-webkit-transform:translateY(-50%);-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);}100%.jsx-2101740806{-webkit-transform:translateY(0);-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);}}", "@-webkit-keyframes slide-jsx-2101740806{0%{-webkit-transform:translateY(-50%);-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);}100%{-webkit-transform:translateY(0);-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);}}", "@keyframes slide-jsx-2101740806{0%{-webkit-transform:translateY(-50%);-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);}100%{-webkit-transform:translateY(0);-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);}}"]
}))
}
}]);
return t
}(d.default.Component);
t.default = A
},
20: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
t.default = l;
var r = n(1);
var a = s(r);
var i = n(0);
var o = s(i);
function s(e) {
return e && e.__esModule ? e : {
default: e
}
}
function l(e) {
return o.default.createElement("kbd", {
style: e.style,
className: "jsx-2686747360"
}, e.children, o.default.createElement(a.default, {
styleId: "2686747360",
css: ["kbd.jsx-2686747360{-webkit-box-shadow:0 1px 0 rgba(0,0,0,0.2),0 0 0 2px #fff inset;box-shadow:0 1px 0 rgba(0,0,0,0.2),0 0 0 2px #fff inset;background-color:#f7f7f7;border:1px solid #ccc;border-radius:3px;box-shadow:0 1px 0 rgba(0,0,0,0.2),0 0 0 2px #fff inset;color:#333;display:inline-block;font-family:Menlo,monospace,Arial,Helvetica,sans-serif;margin:0 .1em;padding:.1em .6em;text-shadow:0 1px 0 #fff;font-weight:normal;font-size:14px;text-transform:none !important;}"]
}))
}
},
201: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = n(222);
var a = y(r);
var i = n(219);
var o = y(i);
var s = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var l = n(1);
var u = y(l);
var c = n(0);
var d = y(c);
var f = n(2);
var p = y(f);
var h = n(119);
var m = y(h);
var v = n(4);
var b = y(v);
var g = n(78);
function y(e) {
return e && e.__esModule ? e : {
default: e
}
}
function x(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function w(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function k(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var j = function(e) {
k(t, e);
function t(e, n) {
x(this, t);
var r = w(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n));
r.state = {
dragState: "START",
dragPointIndex: null,
dragTransform: null
};
r.dragStartPoint = null;
(0,
b.default)(r, "handleMouseDownOnEdge", "handleMouseUpOnEdge", "startDragging", "updateDragging", "stopDragging", "onClick");
return r
}
s(t, [{
key: "componentDidMount",
value: function e() {
window.addEventListener("mousemove", this.updateDragging);
window.addEventListener("mouseup", this.stopDragging)
}
}, {
key: "componentWillUnmount",
value: function e() {
window.removeEventListener("mousemove", this.updateDragging);
window.removeEventListener("mouseup", this.stopDragging)
}
}, {
key: "startDragging",
value: function e(t, n) {
if (this.props.readOnly)
return;
if ("START" === this.state.dragState) {
t.stopPropagation();
this.setState({
dragState: "DRAGGING",
dragPointIndex: n
});
this.props.onPointSelect(t, this.props.keyName, n)
}
}
}, {
key: "updateDragging",
value: function e(t) {
var n = this;
if (this.props.readOnly)
return;
if ("DRAGGING" === this.state.dragState) {
var r = this.props.imageBoundingRect;
var a = void 0
, i = void 0;
a = Math.min(Math.max(r.left, t.clientX), r.left + r.width);
i = Math.min(Math.max(r.top, t.clientY), r.top + r.height);
a = (a - r.left) / r.width * this.props.sourceImage.naturalWidth;
i = (i - r.top) / r.height * this.props.sourceImage.naturalHeight;
var o = {
x: a,
y: i
};
var s = this.props.points.map(function(e, t) {
if (t === n.state.dragPointIndex)
return o;
return e
});
this.props.onUpdate(s)
}
}
}, {
key: "stopDragging",
value: function e() {
if (this.props.readOnly)
return;
this.setState({
dragState: "START"
})
}
}, {
key: "handleMouseDownOnEdge",
value: function e(t, n) {
t.stopPropagation();
this.props.onPointAdd && this.props.onPointAdd(t, this.props.keyName, n + 1);
this.startDragging(t, n + 1)
}
}, {
key: "handleMouseUpOnEdge",
value: function e(t) {
t.stopPropagation()
}
}, {
key: "getPointsWithTransformation",
value: function e() {
var t = this;
return this.props.points.map(function(e) {
return {
x: e.x * t.props.zoomLevel,
y: e.y * t.props.zoomLevel
}
})
}
}, {
key: "onClick",
value: function e(t) {
this.props.onClick && this.props.onClick(t, this.props.keyName)
}
}, {
key: "renderFill",
value: function e() {
var t = this.getPointsWithTransformation();
return d.default.createElement(m.default, {
curve: this.props.curve,
points: t,
fill: this.props.isWrong ? this.props.fillWrong : this.props.fill,
fillOpacity: .4,
stroke: "none"
})
}
}, {
key: "renderEdges",
value: function e() {
var t = this;
var n = this.getPointsWithTransformation();
if (n.length < 2)
return null;
var r = this.props.curve.endsWith("Closed");
r && n.push(n[0]);
var i = [];
(0,
o.default)((0,
a.default)(n), function(e, r) {
var a = n[r + 1];
t.props.readOnly || i.push(d.default.createElement("line", {
key: "x:" + e.x + "-y:" + e.y + "-target",
className: "line--target",
x1: e.x,
y1: e.y,
x2: a.x,
y2: a.y,
strokeOpacity: 0,
strokeWidth: 16,
onMouseDown: t.props.selectOnly ? t.onClick : function(e) {
return t.handleMouseDownOnEdge(e, r)
}
,
onMouseUp: t.props.selectOnly ? null : t.handleMouseUpOnEdge
}));
i.push(d.default.createElement("line", {
key: "x:" + e.x + "-y:" + e.y + "-display",
className: "line--display",
x1: e.x,
y1: e.y,
x2: a.x,
y2: a.y,
stroke: t.props.isWrong ? t.props.strokeWrong : t.props.stroke,
strokeWidth: t.props.lineWidth
}))
});
var s = (0,
p.default)("LabeledPathEditable__edges", {
"is-editable": "DRAGGING" !== this.state.dragState && !this.props.selectOnly,
"is-selectable": "DRAGGING" !== this.state.dragState && this.props.selectOnly
});
return d.default.createElement("g", {
className: "jsx-1133764171 " + (s || "")
}, i, d.default.createElement(u.default, {
styleId: "1133764171",
css: [".LabeledPathEditable__edges.is-editable .line--target,.LabeledPathEditable__edges.is-selectable .line--target{pointer-events:all;}", ".LabeledPathEditable__edges.is-editable .line--display,.LabeledPathEditable__edges.is-selectable .line--display{pointer-events:none;}", ".LabeledPathEditable__edges.is-editable .line--target,.line--target{cursor:cell;}", ".LabeledPathEditable__edges.is-editable .line--target:hover+.line--display,.line--target:hover+.line--display{stroke-width:3;}", ".LabeledPathEditable__edges.is-selectable .line--target{cursor:pointer;}", ".LabeledPathEditable__edges.is-selectable:hover .line--display{stroke-width:3;}"]
}))
}
}, {
key: "renderVertices",
value: function e() {
var t = this;
if (this.props.readOnly || this.props.selectOnly)
return null;
var n = this.getPointsWithTransformation();
var r = [];
(0,
o.default)(n, function(e, n) {
var a = t.props.pointFill;
if (t.props.currentPoint) {
var i = t.props.currentPoint
, o = i.pathKey
, s = i.pointIndex;
o === t.props.keyName && s === n && (a = t.props.pointFillHighlight)
}
r.push(d.default.createElement("circle", {
key: e.x + "," + e.y + "#" + n + "-target",
className: "circle--target",
onMouseDown: function e(r) {
return t.startDragging(r, n)
},
onClick: function e(r) {
return t.props.onPointSelect(r, t.props.keyName, n)
},
cx: e.x,
cy: e.y,
r: 8,
fillOpacity: 0,
strokeOpacity: 0,
style: {
transformOrigin: e.x + "px " + e.y + "px"
}
}));
r.push(d.default.createElement("circle", {
key: "target:" + e.x + "," + e.y + "#" + n + "-display",
className: "circle--display",
cx: e.x,
cy: e.y,
r: 3,
stroke: "black",
strokeWidth: t.props.lineWidth,
fill: a,
style: {
transformOrigin: e.x + "px " + e.y + "px"
}
}))
});
var a = (0,
p.default)("LabeledPathEditable__vertices", {
"is-dragging": "DRAGGING" === this.state.dragState
});
return d.default.createElement("g", {
className: "jsx-754890990 " + (a || "")
}, r, d.default.createElement(u.default, {
styleId: "754890990",
css: [".LabeledPathEditable__vertices circle{cursor:pointer;}", ".LabeledPathEditable__vertices.is-dragging circle{cursor:move;}", ".LabeledPathEditable__vertices .circle--target{pointer-events:all;}", ".LabeledPathEditable__vertices .circle--display{pointer-events:none;}", ".LabeledPathEditable__vertices .circle--target:hover+.circle--display{-webkit-transform:scale(1.5);-webkit-transform:scale(1.5);-ms-transform:scale(1.5);transform:scale(1.5);}"]
}))
}
}, {
key: "renderVertexLabels",
value: function e() {
if (!this.props.showLabels || !this.props.shouldDisplayOrdering)
return null;
var t = this.getPointsWithTransformation();
var n = [];
(0,
o.default)(t, function(e, t) {
n.push(d.default.createElement("g", {
key: "label:" + e.x + "," + e.y + "#" + t
}, d.default.createElement("circle", {
cx: e.x + 10,
cy: e.y - 10 - 6,
r: 12,
style: {
fill: "rgba(0, 0, 0, 0.6)"
}
}), d.default.createElement("text", {
x: e.x + 10,
y: e.y - 10,
style: {
fontWeight: "bold",
fill: "white"
},
textAnchor: "middle"
}, t + 1)))
});
return n
}
}, {
key: "render",
value: function e() {
return d.default.createElement("g", null, this.renderFill(), this.renderEdges(), this.renderVertices(), this.renderVertexLabels())
}
}]);
return t
}(c.Component);
j.defaultProps = {
readOnly: false,
selectOnly: false,
shouldDisplayOrdering: false,
fill: "none",
fillWrong: "rgba(256, 0, 0, 1)",
stroke: g.MaterialA400HexString.lightblue,
strokeWrong: g.MaterialA400HexString.red,
pointFill: g.MaterialA400HexString.lightblue,
pointFillHighlight: g.MaterialA400HexString.red,
lineWidth: 1.5,
curve: "curveLinear",
onUpdate: function e() {},
onPointSelect: function e() {},
isWrong: false,
zoomLevel: 1
};
t.default = j
},
204: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var a = n(1);
var i = b(a);
var o = n(0);
var s = b(o);
var l = n(136);
var u = b(l);
var c = n(492);
var d = b(c);
var f = n(4);
var p = b(f);
var h = n(6);
var m = b(h);
var v = n(37);
function b(e) {
return e && e.__esModule ? e : {
default: e
}
}
function g(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function y(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function x(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var w = function(e) {
x(t, e);
function t(e) {
g(this, t);
var n = y(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
n.state = {
showingInstructions: false
};
(0,
p.default)(n, "showInstructions", "hideInstructions");
return n
}
r(t, [{
key: "showInstructions",
value: function e() {
this.setState({
showingInstructions: true
})
}
}, {
key: "hideInstructions",
value: function e() {
this.setState({
showingInstructions: false
})
}
}, {
key: "taskIsCorrect",
value: function e() {
if (this.props.noDetails)
return false;
var t = this.props.attempt.subtask;
return t.response && !this.props.mistakes
}
}, {
key: "renderComments",
value: function e() {
var t = void 0;
t = this.props.attempt.isPractice ? this.props.attempt.subtask && this.props.attempt.subtask.comments : this.props.attempt.reviewComments;
if (!t)
return null;
return s.default.createElement("div", {
style: {
marginTop: "8px"
}
}, "“", t, "”")
}
}, {
key: "renderInstructionsModal",
value: function e() {
return s.default.createElement(v.Modal, {
isOpen: this.state.showingInstructions,
onRequestClose: this.hideInstructions,
contentLabel: "Instructions"
}, s.default.createElement(v.ModalHeader, {
onRequestClose: this.hideInstructions
}, "Instructions"), s.default.createElement(v.ModalBody, null, s.default.createElement(u.default, {
instructions: this.props.instruction
}), this.props.belowInstructions))
}
}, {
key: "renderTaskHeader",
value: function e() {
return s.default.createElement("div", {
className: "jsx-3751479048 failed-task-instructions"
}, s.default.createElement("div", {
className: "jsx-3751479048"
}, this.renderTaskInstructions(), s.default.createElement("div", {
className: "jsx-3751479048 comments"
}, this.renderComments())), s.default.createElement("div", {
className: "jsx-3751479048 failed-task-instructions__actions"
}, this.props.additionalActions, !this.props.attempt.isPractice && !this.props.attempt.isGoldenReviewFeedback && s.default.createElement("div", {
className: "jsx-3751479048 button"
}, s.default.createElement(d.default, {
attempt: this.props.attempt
}), this.props.extraButtons), this.props.attempt.isPractice && s.default.createElement("div", {
className: "jsx-3751479048 button"
}, this.props.attempt.retryRequired ? s.default.createElement(m.default, {
primary: true,
type: "button",
onClick: this.props.retryQuestionAction
}, "Retry Question") : s.default.createElement(m.default, {
primary: true,
type: "button",
onClick: this.props.nextQuestionAction,
success: true
}, "Next Question"))), s.default.createElement(i.default, {
styleId: "3751479048",
css: [".failed-task-instructions.jsx-3751479048{padding:32px;display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background:#fff;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;border-bottom:1px solid var(--border-gray-light);}", ".failed-task-instructions__actions.jsx-3751479048{display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".button.jsx-3751479048{display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".comments.jsx-3751479048{color:rgba(0,0,0,0.4);}"]
}))
}
}, {
key: "renderTaskInstructions",
value: function e() {
var t = this;
if (this.props.attempt.isPractice && this.props.attempt.completedSuccessfully)
return s.default.createElement("div", {
className: "instructions-text"
}, s.default.createElement("h3", null, s.default.createElement("span", null, "You completed the task successfully!")));
return s.default.createElement("div", {
className: "jsx-2661780212 instructions-text"
}, s.default.createElement("div", {
className: "jsx-2661780212"
}, s.default.createElement("h3", {
className: "jsx-2661780212"
}, !this.props.attempt.isReviewFix && s.default.createElement("span", {
className: "jsx-2661780212"
}, "You had to ", this.props.taskDescription, " according to these ", s.default.createElement("a", {
href: "#",
onClick: function e(n) {
n.preventDefault();
t.showInstructions()
},
className: "jsx-2661780212"
}, "instructions"), "."), this.props.attempt.isReviewFix && s.default.createElement("span", {
className: "jsx-2661780212"
}, "You reviewed a task where the scaler had to ", this.props.taskDescription, " according to these ", s.default.createElement("a", {
href: "#",
onClick: function e(n) {
n.preventDefault();
t.showInstructions()
},
className: "jsx-2661780212"
}, "instructions"), ".")), !!(this.props.mistakes || this.props.displayIfNoMistakes) && s.default.createElement("div", {
className: "jsx-2661780212 instructions-text__details"
}, !this.props.attempt.isReviewFix && s.default.createElement("span", {
className: "jsx-2661780212"
}, "You made ", s.default.createElement("strong", {
style: {
color: "red"
},
className: "jsx-2661780212"
}, this.props.mistakes), " ", 1 === this.props.mistakes ? "mistake" : "mistakes", "."), this.props.attempt.isReviewFix && s.default.createElement("span", {
className: "jsx-2661780212"
}, "You made ", s.default.createElement("strong", {
style: {
color: "red"
},
className: "jsx-2661780212"
}, this.props.mistakes), " ", 1 === this.props.mistakes ? "mistake" : "mistakes", " in your review.")), this.props.extraInfo), s.default.createElement(i.default, {
styleId: "2661780212",
css: [".instructions-text.jsx-2661780212{display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".instructions-text.jsx-2661780212 h3.jsx-2661780212{margin:0;font-size:16px;}", ".instructions-text__details.jsx-2661780212{margin-top:16px;}"]
}))
}
}, {
key: "renderBenchmarkReviewHeader",
value: function e() {
var t = this;
var n = function e() {
return s.default.createElement("span", {
className: "jsx-3573112463 correct"
}, "accepted", s.default.createElement(i.default, {
styleId: "3573112463",
css: [".correct.jsx-3573112463{display:inline-block;padding:2px 8px;border-radius:var(--border-radius);background:var(--color-accept);color:rgba(255,255,255,0.75);}"]
}))
};
var r = function e() {
return s.default.createElement("span", {
className: "jsx-1962893646 incorrect"
}, "rejected", s.default.createElement(i.default, {
styleId: "1962893646",
css: [".incorrect.jsx-1962893646{display:inline-block;padding:2px 8px;border-radius:var(--border-radius);background:var(--color-reject);color:rgba(255,255,255,0.75);}"]
}))
};
var a = void 0;
a = "accepted" === this.props.failedReview.benchmarkReviewOutcome ? s.default.createElement("div", null, s.default.createElement("strong", null, "You ", r(), " the attempt below, but you should have ", n(), " it.")) : s.default.createElement("div", null, s.default.createElement("strong", null, "You ", n(), " the attempt below, but you should have ", r(), " it."));
return s.default.createElement("div", {
className: "jsx-1960898758 failed-review-header"
}, s.default.createElement("div", {
className: "jsx-1960898758 failed-review-header__first"
}, a, s.default.createElement("em", {
className: "jsx-1960898758"
}, "This incorrect review counts against your quality score. Please dispute it if you think your response was correct.")), s.default.createElement("div", {
className: "jsx-1960898758 failed-review-header__second"
}, s.default.createElement(d.default, {
reviewerConfidence: this.props.failedReview
}), s.default.createElement("div", {
style: {
height: "12px"
},
className: "jsx-1960898758"
}), s.default.createElement("div", {
className: "jsx-1960898758"
}, s.default.createElement("a", {
href: "#",
onClick: function e(n) {
n.preventDefault();
t.showInstructions()
},
className: "jsx-1960898758"
}, "View Instructions"))), s.default.createElement(i.default, {
styleId: "1960898758",
css: [".failed-review-header.jsx-1960898758{padding:32px;border-bottom:1px solid var(--border-gray-light);display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;}", ".failed-review-header.jsx-1960898758 em.jsx-1960898758{display:block;margin-left:-12px;margin-top:12px;padding:6px 12px;border-radius:var(--border-radius);background:rgba(0,0,0,0.05);font-size:14px;font-style:normal;opacity:0.4;}", ".failed-review-header__second.jsx-1960898758{display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}"]
}))
}
}, {
key: "render",
value: function e() {
!this.props.failedReview && this.taskIsCorrect();
return s.default.createElement("div", null, this.renderInstructionsModal(), !this.props.failedReview && this.renderTaskHeader(), this.props.failedReview && this.renderBenchmarkReviewHeader())
}
}]);
return t
}(s.default.Component);
t.default = w
},
205: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
t.FailedBenchmarkReviewSidebar = t.SidebarItem = void 0;
var r = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var a = n(1);
var i = c(a);
var o = n(0);
var s = c(o);
var l = n(12);
var u = c(l);
function c(e) {
return e && e.__esModule ? e : {
default: e
}
}
function d(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function f(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function p(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var h = t.SidebarItem = function(e) {
p(t, e);
function t() {
d(this, t);
return f(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments))
}
r(t, [{
key: "render",
value: function e() {
return s.default.createElement("div", {
className: "jsx-924586247 padding"
}, this.props.children, s.default.createElement(i.default, {
styleId: "924586247",
css: [".padding.jsx-924586247{padding:20px 30px;border-bottom:1px solid #f1f1f1;}", ".padding.jsx-924586247:last-child{margin-bottom:0;}"]
}))
}
}]);
return t
}(s.default.Component);
var m = function(e) {
p(t, e);
function t() {
d(this, t);
return f(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments))
}
r(t, [{
key: "render",
value: function e() {
return s.default.createElement("div", {
className: "jsx-1086826711 failed-sidebar"
}, this.props.childrenBeforeComments, this.props.children, s.default.createElement(i.default, {
styleId: "1086826711",
css: [".failed-sidebar.jsx-1086826711{background:white;width:280px;font-size:14px;border-left:1px solid #f1f1f1;}", ".comments.jsx-1086826711{white-space:pre-line;}"]
}))
}
}]);
return t
}(s.default.Component);
t.default = m;
var v = t.FailedBenchmarkReviewSidebar = function(e) {
p(t, e);
function t() {
d(this, t);
return f(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments))
}
r(t, [{
key: "render",
value: function e() {
return s.default.createElement("div", {
className: "jsx-3722225227 failed-sidebar"
}, this.props.attempt.reviewComments && s.default.createElement(h, null, s.default.createElement("div", {
className: "jsx-3722225227 comments"
}, s.default.createElement("strong", {
className: "jsx-3722225227"
}, "Comments:"), " ", this.props.attempt.reviewComments)), s.default.createElement(h, null, s.default.createElement("strong", {
className: "jsx-3722225227"
}, "Submitted at:"), " ", (0,
u.default)(this.props.attempt.reviewedAt).utc().format("MMM Do YYYY h:mm A"), " (UTC)"), s.default.createElement(h, null, s.default.createElement("strong", {
className: "jsx-3722225227"
}, "Attempt ID:"), " ", this.props.attempt._id), s.default.createElement(h, null, s.default.createElement("strong", {
className: "jsx-3722225227"
}, "Task ID:"), " ", this.props.attempt.subtask._id || this.props.attempt.subtask), s.default.createElement(i.default, {
styleId: "3722225227",
css: [".failed-sidebar.jsx-3722225227{background:white;width:370px;font-size:14px;overflow-y:auto;border-left:1px solid #f1f1f1;}", "strong.jsx-3722225227{color:black;}"]
}))
}
}]);
return t
}(s.default.Component)
},
207: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = n(32);
var a = k(r);
var i = n(48);
var o = k(i);
var s = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var l = n(1);
var u = k(l);
var c = n(2);
var d = k(c);
var f = n(0);
var p = k(f);
var h = n(4);
var m = k(h);
var v = n(136);
var b = k(v);
var g = n(79);
var y = k(g);
var x = n(37);
var w = n(41);
function k(e) {
return e && e.__esModule ? e : {
default: e
}
}
function j(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function E(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function _(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var S = {
platform: "Remotasks error",
task: "Difficult task"
};
var C = {
platform: {
task_loading: "Task doesn't load correctly",
instructions_loading: "Instructions don't load or are hard to read",
error_claiming: "Somebody else is working on this task",
error_submitting: "I get an unexpected error when trying to submit"
},
task: {
edge_case: "Instructions are unclear about this situation",
image_quality: "The image is fuzzy or has low quality",
task_difficulty: "Not sure how to correctly complete task",
qa_difficulty: "Not sure how to fix automatically-detected mistakes",
task_length: "Task would take too long"
}
};
var P = function(e) {
_(t, e);
function t(e) {
j(this, t);
var n = E(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
n.state = n.constructor.defaultState;
(0,
m.default)(n, "openModal", "closeModal");
return n
}
s(t, [{
key: "openModal",
value: function e() {
this.setState({
isModalOpen: true
})
}
}, {
key: "closeModal",
value: function e() {
this.setState(this.constructor.defaultState)
}
}, {
key: "componentDidUpdate",
value: function e(t, n) {
n.skipCategory !== this.state.skipCategory && ("other" === this.state.skipCategory ? this.setState({
skipReason: "other"
}) : this.setState({
skipReason: null
}))
}
}, {
key: "renderReasonInput",
value: function e() {
var t = this;
var n = (0,
o.default)(S);
this.props.enableOtherReason && (n.other = "Other");
return p.default.createElement("div", {
className: "jsx-4056072800 reason"
}, p.default.createElement("div", {
className: "jsx-4056072800"
}, (0,
a.default)(n).map(function(e) {
return p.default.createElement("div", {
key: e,
onClick: function n() {
return t.setState({
skipCategory: e
})
},
className: "jsx-4056072800 " + ((0,
d.default)({
reason__category: true,
selected: t.state.skipCategory === e
}) || "")
}, n[e])
})), p.default.createElement("div", {
className: "jsx-4056072800"
}, (0,
a.default)(C[this.state.skipCategory]).map(function(e) {
return p.default.createElement("div", {
key: e,
onClick: function n() {
return t.setState({
skipReason: e
})
},
className: "jsx-4056072800 " + ((0,
d.default)({
reason__choice: true,
selected: t.state.skipReason === e
}) || "")
}, p.default.createElement(w.InputRadio, {
checked: t.state.skipReason === e
}), " ", p.default.createElement("label", {
className: "jsx-4056072800"
}, C[t.state.skipCategory][e]))
})), p.default.createElement(u.default, {
styleId: "4056072800",
css: [".reason.jsx-4056072800{color:rgba(0,0,0,0.6);font-size:14px;font-weight:bold;}", ".reason__category.jsx-4056072800{display:inline-block;margin:12px 12px 12px 0;-webkit-box-shadow:0px 2px 4px rgba(0,0,0,0.1);box-shadow:0px 2px 4px rgba(0,0,0,0.1);border-radius:var(--border-radius);padding:8px 16px;-webkit-transition:all 0.2s;-webkit-transition:all 0.2s;transition:all 0.2s;cursor:pointer;}", ".reason__category.jsx-4056072800:hover{-webkit-box-shadow:0px 4px 8px rgba(0,0,0,0.15);box-shadow:0px 4px 8px rgba(0,0,0,0.15);}", ".reason__category.selected.jsx-4056072800{background:var(--link-color);color:white;cursor:default;}", ".reason__choice.jsx-4056072800{display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:start;-ms-flex-align:start;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;margin:8px 0;padding:4px 8px;border-radius:var(--border-radius);cursor:pointer;-webkit-transition:all 0.2s;-webkit-transition:all 0.2s;transition:all 0.2s;}", ".reason__choice.jsx-4056072800:hover{background:rgba(0,0,0,0.05);}", ".reason__choice.jsx-4056072800 label.jsx-4056072800{margin-left:6px;cursor:pointer;}"]
}))
}
}, {
key: "renderModal",
value: function e() {
var t = this;
return p.default.createElement(x.Modal, {
isOpen: this.state.isModalOpen,
onRequestClose: this.closeModal,
contentLabel: "Modal",
maxWidth: "880px"
}, p.default.createElement("div", {
className: "jsx-3599262980"
}, p.default.createElement("div", {
className: "jsx-3599262980 skip-body"
}, p.default.createElement("div", {
className: "jsx-3599262980 skip-instructions"
}, p.default.createElement("div", {
className: "jsx-3599262980 skip-instructions__title"
}, "Instructions"), p.default.createElement("div", {
className: "jsx-3599262980 skip-instructions__body"
}, p.default.createElement(b.default, {
instructions: this.props.taskInstructions
}))), p.default.createElement("div", {
className: "jsx-3599262980 skip-form"
}, p.default.createElement("div", {
className: "jsx-3599262980"
}, p.default.createElement("div", {
className: "jsx-3599262980 skip-form__intro"
}, p.default.createElement("h2", {
className: "jsx-3599262980"
}, this.props.skipHeaderText || "Having a hard time with this task?"), p.default.createElement("p", {
className: "jsx-3599262980"
}, this.props.skipText || "You can always skip a task you're unsure about. Please help us understand why so that we can make tasking better for you.")), p.default.createElement("div", {
className: "jsx-3599262980 skip-form__reason"
}, p.default.createElement("div", {
className: "jsx-3599262980 skip-form__label"
}, "Select a reason"), this.renderReasonInput()), p.default.createElement("div", {
className: "jsx-3599262980 skip-form__explanation"
}, p.default.createElement("div", {
className: "jsx-3599262980 skip-form__label"
}, "Detailed explanation (optional)"), p.default.createElement(y.default, {
onChange: function e(n) {
return t.setState({
skipExplanation: n.target.value
})
},
value: this.state.skipExplanation,
placeholder: "I'm skipping this task because..."
}))), p.default.createElement("div", {
className: "jsx-3599262980"
}, this.state.skipReason && p.default.createElement("div", {
onClick: function e() {
return t.props.handleSkip(t.state.skipReason, t.state.skipExplanation)
},
className: "jsx-3599262980 skip-form__submit"
}, p.default.createElement(w.Button, {
success: true
}, this.props.confirmButtonText || "Skip task")))))), p.default.createElement(u.default, {
styleId: "3599262980",
css: [".skip-body.jsx-3599262980{max-height:700px;display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".skip-instructions.jsx-3599262980{-ms-flex-preferred-size:45%;-webkit-flex-basis:45%;-ms-flex-preferred-size:45%;flex-basis:45%;overflow-y:auto;color:rgba(0,0,0,0.5);}", ".skip-instructions.jsx-3599262980 .skip-instructions__title.jsx-3599262980{margin:48px 32px 16px;font-size:20px;font-weight:bold;}", ".skip-form.jsx-3599262980{-ms-flex-preferred-size:55%;-webkit-flex-basis:55%;-ms-flex-preferred-size:55%;flex-basis:55%;padding:48px;border-left:1px solid rgba(0,0,0,.05);display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;}", ".skip-form.jsx-3599262980 .skip-form__section.jsx-3599262980{margin:24px 0;}", ".skip-form__label.jsx-3599262980{margin-bottom:8px;text-transform:uppercase;font-weight:bold;font-size:13px;color:rgba(0,0,0,0.25);-webkit-letter-spacing:0.5px;-moz-letter-spacing:0.5px;-ms-letter-spacing:0.5px;letter-spacing:0.5px;}", ".skip-form__intro.jsx-3599262980{font-size:16px;font-weight:bold;}", ".skip-form__intro.jsx-3599262980 h2.jsx-3599262980{margin:0;font-size:20px;}", ".skip-form__intro.jsx-3599262980 p.jsx-3599262980{margin:16px 0 32px;line-height:1.7;}", ".skip-form__reason.jsx-3599262980{margin:36px 0;}", ".skip-form__explanation.jsx-3599262980{margin:36px 0;}", ".skip-form__submit.jsx-3599262980{display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;}"]
}))
}
}, {
key: "render",
value: function e() {
return p.default.createElement("div", null, p.default.createElement(w.Button, {
key: "skipTask",
type: "button",
style: this.props.style,
onClick: this.openModal
}, this.props.buttonText || "Skip"), this.state.isModalOpen && this.renderModal())
}
}]);
return t
}(p.default.Component);
P.defaultState = {
isModalOpen: false,
skipCategory: null,
skipReason: null,
skipExplanation: ""
};
t.default = P
},
208: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = n(7);
var a = w(r);
var i = n(14);
var o = w(i);
var s = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var l = n(1);
var u = w(l);
var c = n(2);
var d = w(c);
var f = n(0);
var p = w(f);
var h = n(8);
var m = w(h);
var v = n(368);
var b = w(v);
var g = n(40);
var y = n(21);
var x = w(y);
function w(e) {
return e && e.__esModule ? e : {
default: e
}
}
function k(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function j(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function E(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var _ = function(e) {
E(t, e);
function t(e) {
k(this, t);
var n = j(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
n.toggleShowingErrors = n.toggleShowingErrors.bind(n);
n.state = {
showingErrors: false
};
return n
}
s(t, [{
key: "toggleShowingErrors",
value: function e() {
this.setState((0,
x.default)("showingErrors"))
}
}, {
key: "handleClickOutside",
value: function e() {
this.setState({
showingErrors: false
})
}
}, {
key: "render",
value: function e() {
var t = this;
if (!(this.props.lintErrors && this.props.lintErrors.length))
return null;
var n = (0,
o.default)(this.props.lintErrors, function(e) {
return e.severity === g.lintSeverity.ERROR && !e.dismissed
});
var r = (0,
o.default)(this.props.lintErrors, function(e) {
return e.severity !== g.lintSeverity.ERROR && !e.dismissed
});
if (!n.length && !r.length)
return null;
return p.default.createElement("div", {
className: "jsx-321564330 lint-errors"
}, this.state.showingErrors && p.default.createElement("div", {
className: "jsx-321564330 lint-errors__body"
}, !!n.length && p.default.createElement("div", {
className: "jsx-321564330"
}, p.default.createElement("div", {
className: "jsx-321564330 lint-errors__header error"
}, n.length, " critical error", n.length > 1 ? "s" : ""), (0,
a.default)(n, function(e) {
return p.default.createElement("div", {
key: e.id,
className: "jsx-321564330 lint-errors__item"
}, e.data.message)
})), !!r.length && p.default.createElement("div", {
className: "jsx-321564330"
}, p.default.createElement("div", {
className: "jsx-321564330 lint-errors__header warning"
}, r.length, " warning", r.length > 1 ? "s" : ""), p.default.createElement("div", {
className: "jsx-321564330 lint-errors__info"
}, "Please fix the task before submitting, or dismiss the warnings if they are not applicable."), (0,
a.default)(r, function(e) {
return p.default.createElement("div", {
key: e.id,
className: "jsx-321564330 lint-errors__item"
}, p.default.createElement("span", {
className: "jsx-321564330 " + ((e.dismissed ? "dismissed" : "") || "")
}, e.data.message), p.default.createElement("span", {
onClick: function n() {
return t.props.handleErrorDismiss(e.id)
},
className: "jsx-321564330 lint-errors__item__dismiss"
}, p.default.createElement(m.default, {
name: "close"
})))
}))), p.default.createElement("div", {
onClick: this.toggleShowingErrors,
className: "jsx-321564330 " + ((0,
d.default)("lint-errors__target", {
error: !!n.length,
warning: !n.length
}) || "")
}, p.default.createElement(m.default, {
name: "warning",
style: {
fontSize: "14px",
marginRight: "8px"
}
}), this.props.lintErrors.length), p.default.createElement(u.default, {
styleId: "321564330",
css: [".lint-errors.jsx-321564330{margin-left:12px;-ms-flex-item-align:stretch;-webkit-align-self:stretch;-ms-flex-item-align:stretch;align-self:stretch;display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:relative;}", ".lint-errors__target.jsx-321564330{padding:0 12px;height:36px;min-width:60px;border-radius:var(--border-radius);color:white;font-weight:bold;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;}", ".lint-errors__target.error.jsx-321564330{background:var(--color-reject);}", ".lint-errors__target.warning.jsx-321564330{background:#f4b01f;}", ".lint-errors__body.jsx-321564330{position:absolute;z-index:2;right:0;top:-16px;-webkit-transform:translate(0,-100%);-webkit-transform:translate(0,-100%);-ms-transform:translate(0,-100%);transform:translate(0,-100%);width:240px;background:white;border:1px solid rgba(0,0,0,0.05);border-radius:var(--border-radius);-webkit-box-shadow:0px 0px 8px rgba(0,0,0,0.05);box-shadow:0px 0px 8px rgba(0,0,0,0.05);padding:12px;}", ".lint-errors__header.jsx-321564330{border-radius:var(--border-radius);padding:4px 8px;color:white;font-weight:bold;font-size:14px;display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".lint-errors__header.error.jsx-321564330{background:var(--color-reject);}", ".lint-errors__header.warning.jsx-321564330{background:#f4b01f;}", ".lint-errors__info.jsx-321564330{margin:8px;font-size:12px;color:rgba(0,0,0,0.4);line-height:1.3em;}", ".lint-errors__item.jsx-321564330{margin:8px 0;padding:0 8px;font-size:13px;font-weight:bold;color:rgba(0,0,0,0.7);line-height:1.3em;display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:start;-ms-flex-align:start;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;}", ".lint-errors__item.jsx-321564330 .dismissed.jsx-321564330{text-decoration:line-through;}", ".lint-errors__item__dismiss.jsx-321564330{margin-left:8px;cursor:pointer;-webkit-transition:all 0.2s;-webkit-transition:all 0.2s;transition:all 0.2s;}", ".lint-errors__item__dismiss.jsx-321564330:hover{color:var(--color-reject);}"]
}))
}
}]);
return t
}(p.default.Component);
t.default = (0,
b.default)(_)
},
21: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
t.default = function(e) {
return function(t) {
return r({}, e, !t[e])
}
}
;
function r(e, t, n) {
t in e ? Object.defineProperty(e, t, {
value: n,
enumerable: true,
configurable: true,
writable: true
}) : e[t] = n;
return e
}
},
211: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = n(80);
var a = s(r);
var i = n(463);
var o = s(i);
function s(e) {
return e && e.__esModule ? e : {
default: e
}
}
var l = o.default;
var u = function e(t) {
var n = l(0, t.length - 1);
return t[n]
};
var c = function e(t, n) {
var r = d(t, n);
return r.slice(0, n)
};
var d = function e(t) {
var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null;
var r = t.slice();
var i = null === n ? r.length - 1 : n;
var o = true;
var s = false;
var u = void 0;
try {
for (var c = (0,
a.default)(0, i)[Symbol.iterator](), d; !(o = (d = c.next()).done); o = true) {
var f = d.value;
var p = l(f, r.length - 1);
var h = r[p];
r[p] = r[f];
r[f] = h
}
} catch (e) {
s = true;
u = e
} finally {
try {
!o && c.return && c.return()
} finally {
if (s)
throw u
}
}
return r
};
t.default = {
randint: l,
choice: u,
sample: c,
shuffle: d
}
},
213: function(e, t, n) {
"use strict";
var r = "function" === typeof Symbol && "symbol" === typeof Symbol.iterator ? function(e) {
return typeof e
}
: function(e) {
return e && "function" === typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}
;
Object.defineProperty(t, "__esModule", {
value: true
});
var a = n(0);
var i = d(a);
var o = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var s = void 0
, l = void 0;
var u = n(5);
var c = d(u);
function d(e) {
return e && e.__esModule ? e : {
default: e
}
}
function f(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function p(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== ("undefined" === typeof t ? "undefined" : r(t)) && "function" !== typeof t ? e : t
}
function h(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + ("undefined" === typeof t ? "undefined" : r(t)));
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var m = {
Knob: {
displayName: "Knob"
}
};
var v = (l = s = function(e) {
h(t, e);
function t(e) {
f(this, t);
var n = p(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
n.getArcToValue = function(e) {
var t = void 0;
var r = void 0;
var a = n.props.log ? Math.log(Math.pow(e / n.props.min, n.angleArc)) / Math.log(n.props.max / n.props.min) : (e - n.props.min) * n.angleArc / (n.props.max - n.props.min);
if (n.props.clockwise) {
t = n.startAngle - 1e-5;
r = t + a + 1e-5
} else {
t = n.endAngle + 1e-5;
r = t - a - 1e-5
}
if (n.props.cursor) {
t = r - n.cursorExt;
r += n.cursorExt
}
return {
startAngle: t,
endAngle: r,
acw: !n.props.clockwise && !n.props.cursor
}
}
;
n.getCanvasScale = function(e) {
var t = window.devicePixelRatio || window.screen.deviceXDPI / window.screen.logicalXDPI || 1;
var n = e.webkitBackingStorePixelRatio || 1;
return t / n
}
;
n.coerceToStep = function(e) {
var t = n.props.log ? Math.pow(n.props.step, ~~((Math.abs(e) < 1 ? -.5 : .5) + Math.log(e) / Math.log(n.props.step))) : ~~((e < 0 ? -.5 : .5) + e / n.props.step) * n.props.step;
t = Math.max(Math.min(t, n.props.max), n.props.min);
isNaN(t) && (t = 0);
return Math.round(1e3 * t) / 1e3
}
;
n.eventToValue = function(e) {
var t = n.canvasRef.getBoundingClientRect();
var r = e.clientX - t.left;
var a = e.clientY - t.top;
var i = Math.atan2(r - n.w / 2, n.w / 2 - a) - n.angleOffset;
n.props.clockwise || (i = n.angleArc - i - 2 * Math.PI);
n.angleArc !== 2 * Math.PI && i < 0 && i > -.5 ? i = 0 : i < 0 && (i += 2 * Math.PI);
var o = n.props.log ? Math.pow(n.props.max / n.props.min, i / n.angleArc) * n.props.min : i * (n.props.max - n.props.min) / n.angleArc + n.props.min;
return n.coerceToStep(o)
}
;
n.handleMouseDown = function(e) {
n.props.onChange(n.eventToValue(e));
document.addEventListener("mousemove", n.handleMouseMove);
document.addEventListener("mouseup", n.handleMouseUp);
document.addEventListener("keyup", n.handleEsc)
}
;
n.handleMouseMove = function(e) {
e.preventDefault();
n.props.onChange(n.eventToValue(e))
}
;
n.handleMouseUp = function(e) {
n.props.onChangeEnd(n.eventToValue(e));
document.removeEventListener("mousemove", n.handleMouseMove);
document.removeEventListener("mouseup", n.handleMouseUp);
document.removeEventListener("keyup", n.handleEsc)
}
;
n.handleTouchStart = function(e) {
e.preventDefault();
n.touchIndex = e.targetTouches.length - 1;
n.props.onChange(n.eventToValue(e.targetTouches[n.touchIndex]));
document.addEventListener("touchmove", n.handleTouchMove, {
passive: false
});
document.addEventListener("touchend", n.handleTouchEnd);
document.addEventListener("touchcancel", n.handleTouchEnd)
}
;
n.handleTouchMove = function(e) {
e.preventDefault();
n.props.onChange(n.eventToValue(e.targetTouches[n.touchIndex]))
}
;
n.handleTouchEnd = function(e) {
n.props.onChangeEnd(n.eventToValue(e));
document.removeEventListener("touchmove", n.handleTouchMove);
document.removeEventListener("touchend", n.handleTouchEnd);
document.removeEventListener("touchcancel", n.handleTouchEnd)
}
;
n.handleEsc = function(e) {
if (27 === e.keyCode) {
e.preventDefault();
n.handleMouseUp()
}
}
;
n.handleTextInput = function(e) {
var t = Math.max(Math.min(+e.target.value, n.props.max), n.props.min) || n.props.min;
n.props.onChange(t)
}
;
n.handleWheel = function(e) {
e.preventDefault();
e.deltaX > 0 || e.deltaY > 0 ? n.props.onChange(n.coerceToStep(n.props.log ? n.props.value * n.props.step : n.props.value + n.props.step)) : (e.deltaX < 0 || e.deltaY < 0) && n.props.onChange(n.coerceToStep(n.props.log ? n.props.value / n.props.step : n.props.value - n.props.step))
}
;
n.handleArrowKey = function(e) {
if (37 === e.keyCode || 40 === e.keyCode) {
e.preventDefault();
n.props.onChange(n.coerceToStep(n.props.log ? n.props.value / n.props.step : n.props.value - n.props.step))
} else if (38 === e.keyCode || 39 === e.keyCode) {
e.preventDefault();
n.props.onChange(n.coerceToStep(n.props.log ? n.props.value * n.props.step : n.props.value + n.props.step))
}
}
;
n.inputStyle = function() {
return {
width: (n.w / 2 + 4 >> 0) + "px",
height: (n.w / 3 >> 0) + "px",
position: "absolute",
verticalAlign: "middle",
marginTop: (n.w / 3 >> 0) + "px",
marginLeft: "-" + (3 * n.w / 4 + 2 >> 0) + "px",
border: 0,
background: "none",
font: n.props.fontWeight + " " + (n.w / n.digits >> 0) + "px " + n.props.font,
textAlign: "center",
color: n.props.inputColor || n.props.fgColor,
padding: "0px",
WebkitAppearance: "none"
}
}
;
n.renderCenter = function() {
var e = n.props
, t = e.displayCustom
, r = e.displayInput
, a = e.disableTextInput
, o = e.readOnly
, s = e.value;
if (r)
return i.default.createElement("input", {
style: n.inputStyle(),
type: "text",
value: s,
onChange: n.handleTextInput,
onKeyDown: n.handleArrowKey,
readOnly: o || a
});
if (t && "function" === typeof t)
return t();
return null
}
;
n.w = n.props.width || 200;
n.h = n.props.height || n.w;
n.cursorExt = true === n.props.cursor ? .3 : n.props.cursor / 100;
n.angleArc = n.props.angleArc * Math.PI / 180;
n.angleOffset = n.props.angleOffset * Math.PI / 180;
n.startAngle = 1.5 * Math.PI + n.angleOffset;
n.endAngle = 1.5 * Math.PI + n.angleOffset + n.angleArc;
n.digits = Math.max(String(Math.abs(n.props.min)).length, String(Math.abs(n.props.max)).length, 2) + 2;
return n
}
o(t, [{
key: "componentDidMount",
value: function e() {
this.drawCanvas();
this.props.readOnly || this.canvasRef.addEventListener("touchstart", this.handleTouchStart, {
passive: false
})
}
}, {
key: "componentWillReceiveProps",
value: function e(t) {
t.width && this.w !== t.width && (this.w = t.width);
t.height && this.h !== t.height && (this.h = t.height)
}
}, {
key: "componentDidUpdate",
value: function e() {
this.drawCanvas()
}
}, {
key: "componentWillUnmount",
value: function e() {
this.canvasRef.removeEventListener("touchstart", this.handleTouchStart)
}
}, {
key: "drawCanvas",
value: function e() {
var t = this.canvasRef.getContext("2d");
var n = this.getCanvasScale(t);
this.canvasRef.width = this.w * n;
this.canvasRef.height = this.h * n;
t.scale(n, n);
this.xy = this.w / 2;
this.lineWidth = this.xy * this.props.thickness;
this.radius = this.xy - this.lineWidth / 2;
t.lineWidth = this.lineWidth;
t.lineCap = this.props.lineCap;
t.beginPath();
t.strokeStyle = this.props.bgColor;
t.arc(this.xy, this.xy, this.radius, this.endAngle - 1e-5, this.startAngle + 1e-5, true);
t.stroke();
var r = this.getArcToValue(this.props.value);
t.beginPath();
t.strokeStyle = this.props.fgColor;
t.arc(this.xy, this.xy, this.radius, r.startAngle, r.endAngle, r.acw);
t.stroke()
}
}, {
key: "render",
value: function e() {
var t = this;
var n = this.props
, r = n.canvasClassName
, a = n.className
, o = n.disableMouseWheel
, s = n.readOnly
, l = n.title
, u = n.value;
return i.default.createElement("div", {
className: a,
style: {
width: this.w,
height: this.h,
display: "inline-block"
},
onWheel: s || o ? null : this.handleWheel
}, i.default.createElement("canvas", {
ref: function e(n) {
t.canvasRef = n
},
className: r,
style: {
width: "100%",
height: "100%"
},
onMouseDown: s ? null : this.handleMouseDown,
title: l ? l + ": " + u : u
}), this.renderCenter())
}
}]);
return t
}(i.default.Component),
s.propTypes = {
value: c.default.number.isRequired,
onChange: c.default.func.isRequired,
onChangeEnd: c.default.func,
min: c.default.number,
max: c.default.number,
step: c.default.number,
log: c.default.bool,
width: c.default.number,
height: c.default.number,
thickness: c.default.number,
lineCap: c.default.oneOf(["butt", "round"]),
bgColor: c.default.string,
fgColor: c.default.string,
inputColor: c.default.string,
font: c.default.string,
fontWeight: c.default.string,
clockwise: c.default.bool,
cursor: c.default.oneOfType([c.default.number, c.default.bool]),
stopper: c.default.bool,
readOnly: c.default.bool,
disableTextInput: c.default.bool,
displayInput: c.default.bool,
displayCustom: c.default.func,
angleArc: c.default.number,
angleOffset: c.default.number,
disableMouseWheel: c.default.bool,
title: c.default.string,
className: c.default.string,
canvasClassName: c.default.string
},
s.defaultProps = {
onChangeEnd: function e() {},
min: 0,
max: 100,
step: 1,
log: false,
width: 200,
height: 200,
thickness: .35,
lineCap: "butt",
bgColor: "#EEE",
fgColor: "#EA2",
inputColor: "",
font: "Arial",
fontWeight: "bold",
clockwise: true,
cursor: false,
stopper: true,
readOnly: false,
disableTextInput: false,
displayInput: true,
angleArc: 360,
angleOffset: 0,
disableMouseWheel: false,
className: null,
canvasClassName: null
},
l);
t.default = v
},
214: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
t.ControlButton = void 0;
var r = n(1);
var a = s(r);
var i = n(0);
var o = s(i);
function s(e) {
return e && e.__esModule ? e : {
default: e
}
}
var l = t.ControlButton = function e(t) {
var n = t.children
, r = t.onClick;
return o.default.createElement("div", {
onClick: r,
className: "jsx-2743671964 control-button"
}, o.default.createElement(a.default, {
styleId: "2743671964",
css: [".control-button{color:#76c7d5;border:1px solid #ccc;font-size:20px;-webkit-letter-spacing:1px;-moz-letter-spacing:1px;-ms-letter-spacing:1px;letter-spacing:1px;height:60px;display:inline-block;border-radius:30px;cursor:pointer;white-space:nowrap;-webkit-transition:border 100ms ease-out;-webkit-transition:border 100ms ease-out;transition:border 100ms ease-out;}", ".control-button:hover{border:1px solid #76c7d5;}", ".control-button__inside{display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%;padding:0 20px;}", ".audio-transcription-player__controls .control-button{margin:0 10px;}"]
}), o.default.createElement("div", {
className: "jsx-2743671964 control-button__inside"
}, n))
}
;
t.default = l
},
215: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = n(219);
var a = w(r);
var i = n(7);
var o = w(i);
var s = n(126);
var l = w(s);
var u = n(128);
var c = w(u);
var d = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var f = n(1);
var p = w(f);
var h = n(0);
var m = w(h);
var v = n(361);
var b = w(v);
var g = n(37);
var y = n(4);
var x = w(y);
function w(e) {
return e && e.__esModule ? e : {
default: e
}
}
function k(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function j(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function E(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var _ = function(e) {
E(t, e);
function t(e) {
k(this, t);
var n = j(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
(0,
x.default)(n, "toggleShowing", "hide");
n.state = {
showing: false
};
return n
}
d(t, [{
key: "componentDidMount",
value: function e() {
this.updateShortcuts()
}
}, {
key: "componentDidUpdate",
value: function e(t) {
t.mapping === this.props.mapping && t.navigationMapping === this.props.navigationMapping || this.updateShortcuts()
}
}, {
key: "componentWillUnmount",
value: function e() {
this.bindObj.detach()
}
}, {
key: "toggleShowing",
value: function e() {
this.setState({
showing: !this.state.showing
})
}
}, {
key: "hide",
value: function e() {
this.setState({
showing: false
})
}
}, {
key: "updateShortcuts",
value: function e() {
var t = this;
this.bindObj && this.bindObj.detach();
this.bindObj = new b.default(document.documentElement);
var n = (0,
c.default)(this.props.mapping, this.props.navigationMapping, (0,
l.default)((0,
o.default)(this.props.extraMapping, function(e) {
return e.mapping
})));
(0,
a.default)(n, function(e) {
var n = e.trigger
, r = e.action
, a = e.togglesShowing
, i = e.preventsDefault;
a && t.bindObj.bind(n, function() {
t.toggleShowing();
return !i
});
r && t.bindObj.bind(n, function() {
r();
return !i
})
})
}
}, {
key: "render",
value: function e() {
return m.default.createElement(g.Modal, {
isOpen: this.state.showing,
onRequestClose: this.hide,
maxWidth: "800px",
contentLabel: "Shortcuts"
}, m.default.createElement(g.ModalHeader, {
onRequestClose: this.hide
}, "Keyboard Shortcuts"), !!this.props.navigationMapping.length && m.default.createElement("div", {
className: "jsx-983396366 shortcuts__section"
}, (0,
o.default)(this.props.navigationMapping, function(e, t) {
var n = e.triggerLabel
, r = e.actionLabel;
return m.default.createElement("div", {
key: t,
className: "jsx-983396366 shortcut"
}, m.default.createElement("div", {
className: "jsx-983396366 trigger"
}, n), m.default.createElement("div", {
className: "jsx-983396366 action"
}, r))
})), !!this.props.mapping.length && m.default.createElement("div", {
className: "jsx-983396366 shortcuts__section"
}, (0,
o.default)(this.props.mapping, function(e, t) {
var n = e.triggerLabel
, r = e.actionLabel;
return m.default.createElement("div", {
key: t,
className: "jsx-983396366 shortcut"
}, m.default.createElement("div", {
className: "jsx-983396366 trigger"
}, n), m.default.createElement("div", {
className: "jsx-983396366 action"
}, r))
})), (0,
o.default)(this.props.extraMapping, function(e, t) {
var n = e.mapping;
return m.default.createElement("div", {
key: t,
className: "jsx-983396366 shortcuts__section"
}, (0,
o.default)(n, function(e, t) {
var n = e.triggerLabel
, r = e.actionLabel;
return m.default.createElement("div", {
key: t,
className: "jsx-983396366 shortcut"
}, m.default.createElement("div", {
className: "jsx-983396366 trigger"
}, n), m.default.createElement("div", {
className: "jsx-983396366 action"
}, r))
}))
}), m.default.createElement(p.default, {
styleId: "983396366",
css: [".shortcuts__section{padding:16px;border-top:1px solid #f1f1f1;display:grid;grid-template-columns:50% 50%;}", ".shortcut{display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:40px;}", ".shortcut:first-child,.shortcut:nth-child(2){border-top:0;}", ".shortcut:last-child{border-bottom:0;}", ".trigger{text-align:right;-webkit-box-flex:1;-ms-flex:1 0 80px;-webkit-flex:1 0 80px;-ms-flex:1 0 80px;flex:1 0 80px;}", ".action{-webkit-box-flex:3;-ms-flex:3;-webkit-flex:3;-ms-flex:3;flex:3;margin-left:12px;font-size:14px;font-weight:bold;}"]
}))
}
}]);
return t
}(m.default.Component);
_.defaultProps = {
navigationMapping: [],
mapping: [],
extraMapping: []
};
t.default = _
},
216: function(e, t, n) {
"use strict";
var r = function e(t) {
console.error(t)
};
e.exports = {
trackError: r
}
},
217: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = n(18);
var a = L(r);
var i = n(7);
var o = L(i);
var s = n(48);
var l = L(s);
var u = n(165);
var c = L(u);
var d = n(34);
var f = L(d);
var p = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var r in n)
Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
}
return e
}
;
var h = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var m = n(1);
var v = L(m);
var b = n(0);
var g = L(b);
var y = n(50);
var x = L(y);
var w = n(4);
var k = L(w);
var j = n(11);
var E = n(36);
var _ = L(E);
var S = n(173);
var C = L(S);
var P = n(249);
var O = L(P);
var A = n(25);
var M = n(149);
var I = L(M);
function L(e) {
return e && e.__esModule ? e : {
default: e
}
}
function T(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function R(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function F(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var N = function e(t) {
if (!t.edge)
return null;
var n = t.edge
, r = n.ex
, a = n.ey1
, i = n.ey2;
var o = t.face
, s = o.x1
, l = o.x2
, u = o.y1
, c = o.y2;
var d = (s + l) / 2;
var f = r < d ? s : l;
var p = [f, u, r, a];
var h = [f, c, r, i];
var m = _.default.lineIntersection.apply(_.default, p.concat(h));
return m && m.y < u ? m : null
};
var D = function(e) {
F(t, e);
function t(e, n) {
T(this, t);
var r = R(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n));
var a = {};
var i = {};
if (r.props.cuboids) {
var o = true;
var s = false;
var l = void 0;
try {
for (var u = r.props.cuboids[Symbol.iterator](), c; !(o = (c = u.next()).done); o = true) {
var d = c.value;
a[d.keyName] = d.label;
i[d.keyName] = d.attributes
}
} catch (e) {
s = true;
l = e
} finally {
try {
!o && u.return && u.return()
} finally {
if (s)
throw l
}
}
}
r.state = {
imageWidth: 0,
imageHeight: 0,
cuboids: r.props.cuboids,
dragStart: null,
dragEnd: null,
horizon: null,
horizonEdited: false,
labels: a,
attributeSelections: i
};
(0,
k.default)(r, "handleImageLoad", "handleImageError", "onMouseDown", "onMouseMove", "onMouseUp", "onHorizonMove", "onCuboidSelect", "onCuboidUpdate", "handleLabelUpdate", "handleAttributesUpdate", "handleConfirmLabelAndAttributes", "emitUpdate", "renderCuboidEditable");
return r
}
h(t, [{
key: "componentDidMount",
value: function e() {
this.updateImageSource()
}
}, {
key: "componentDidUpdate",
value: function e(t) {
var n = this;
this.props.scale !== t.scale && this.props.updateScroll && this.props.updateScroll(function(e) {
var r = e.width
, a = e.height
, i = e.left
, o = e.top;
var s = (i + r / 2) / t.scale;
var l = (o + a / 2) / t.scale;
return {
left: s * n.props.scale - r / 2,
top: l * n.props.scale - a / 2
}
})
}
}, {
key: "componentWillReceiveProps",
value: function e(t) {
if (!(0,
f.default)(t.cuboids, this.props.cuboids)) {
var n = t.cuboids;
var r = {};
var a = {};
if (n) {
var i = true;
var o = false;
var s = void 0;
try {
for (var l = n[Symbol.iterator](), u; !(i = (u = l.next()).done); i = true) {
var c = u.value;
r[c.keyName] = c.label;
a[c.keyName] = c.attributes
}
} catch (e) {
o = true;
s = e
} finally {
try {
!i && l.return && l.return()
} finally {
if (o)
throw s
}
}
}
this.setState({
cuboids: n,
labels: r,
attributeSelections: a
})
}
this.props.src !== t.src && this.updateImageSource()
}
}, {
key: "estimatedHorizon",
value: function e() {
var t = this.state.cuboids.filter(function(e) {
return e.edge
});
if (t.length >= 1) {
var n = t.map(function(e) {
return N(e)
}).filter(function(e) {
return !!e
});
return n.length ? _.default.centroid(n) : null
}
return null
}
}, {
key: "eventToCoordinates",
value: function e(t) {
var n = this.sourceImage.getBoundingClientRect();
return {
x: t.clientX - n.left + this.leftOffset,
y: t.clientY - n.top + this.topOffset
}
}
}, {
key: "getColorForCuboid",
value: function e(t) {
return (0,
A.getAnnotationColor)(t, this.props.selectedBreakdown, this.props.breakdownColors)
}
}, {
key: "updateImageSource",
value: function e() {
var t = this;
if (window && window.Image) {
var n = new window.Image;
n.src = this.props.src;
n.onload = function() {
return t.handleImageLoad(n)
}
}
}
}, {
key: "handleImageLoad",
value: function e(t) {
var n = t.naturalWidth;
var r = t.naturalHeight;
if (n && r) {
this.setState({
imageWidth: n,
imageHeight: r
});
this.props.onLoad && this.props.onLoad(true)
}
}
}, {
key: "handleImageError",
value: function e() {
this.props.onLoad && this.props.onLoad(false)
}
}, {
key: "onMouseDown",
value: function e(t) {
this.props.handleAnnotationSelect(null);
var n = {};
if (!this.props.readOnly && this.props.canAddCuboid()) {
n.dragStart = this.eventToCoordinates(t);
n.dragEnd = this.eventToCoordinates(t);
t.stopPropagation()
}
this.setState(n)
}
}, {
key: "onMouseMove",
value: function e(t) {
if (this.state.dragStart) {
this.setState({
dragEnd: this.eventToCoordinates(t)
});
t.stopPropagation()
}
}
}, {
key: "onMouseUp",
value: function e(t) {
if (this.state.dragStart) {
t.stopPropagation();
var n = this.state
, r = n.dragStart
, a = n.dragEnd;
r.x -= this.leftOffset;
r.y -= this.topOffset;
a.x -= this.leftOffset;
a.y -= this.topOffset;
var i = this.state.cuboids.slice();
var o = this.state.labels;
var s = this.state.attributeSelections;
if (Math.abs(r.x - a.x) >= this.props.minWidth && Math.abs(r.y - a.y) >= this.props.minHeight) {
var l = {
keyName: x.default.v4(),
face: {
x1: r.x / this.zoomLevel,
y1: r.y / this.zoomLevel,
x2: a.x / this.zoomLevel,
y2: a.y / this.zoomLevel
}
};
i.push(l);
if (this.props.labels) {
o[l.keyName] = null;
s[l.keyName] = {}
}
}
this.setState({
dragStart: null,
dragEnd: null,
cuboids: i,
labels: o
});
this.props.resetAnnotationVisibility()
}
}
}, {
key: "emitUpdate",
value: function e() {
var t = this;
if (this.props.onUpdate) {
var n = this.state.cuboids.map(function(e) {
var n = t.state.labels[e.keyName];
var r = t.props.attributeDefinitions ? t.state.attributeSelections[e.keyName] : void 0;
var a = (0,
c.default)((0,
l.default)(e), {
label: n,
attributes: r
});
var i = (0,
j.isAnnotationDone)(a, t.props.attributeDefinitions, t.props.isLabelRequired);
return p({}, e, {
label: n,
attributes: r,
isFullyAnnotated: i
})
});
this.props.onUpdate(n)
}
}
}, {
key: "onCuboidSelect",
value: function e(t) {
this.props.handleAnnotationSelect(t)
}
}, {
key: "onCuboidDelete",
value: function e(t) {
if (!this.props.canDeleteCuboid())
return;
var n = this.state.cuboids.filter(function(e) {
return e.keyName !== t
});
this.setState({
cuboids: n
}, this.emitUpdate)
}
}, {
key: "onCuboidUpdate",
value: function e(t) {
var n = (0,
o.default)(this.state.cuboids, function(e) {
if (e.keyName === t.keyName)
return t;
return e
});
var r = n.length >= 1 && !this.state.horizonEdited ? this.estimatedHorizon(t) : this.state.horizon;
this.setState({
cuboids: n,
horizon: r
}, this.emitUpdate);
this.props.handleAnnotationSelect(t.keyName)
}
}, {
key: "handleLabelUpdate",
value: function e(t, n) {
this.setState(function(e) {
var r = (0,
l.default)(e.labels);
r[t] = n;
return {
labels: r
}
}, this.emitUpdate)
}
}, {
key: "handleAttributesUpdate",
value: function e(t, n) {
this.setState(function(e) {
var r = (0,
l.default)(e.attributeSelections);
r[t] = n;
return {
attributeSelections: r
}
}, this.emitUpdate)
}
}, {
key: "handleConfirmLabelAndAttributes",
value: function e(t, n) {
this.setState(function(e) {
var r = (0,
l.default)(e.labels);
r[t] = n;
return {
labels: r
}
}, this.emitUpdate);
this.props.handleAnnotationSelect(null)
}
}, {
key: "onHorizonMove",
value: function e(t) {
this.setState({
horizonEdited: true,
horizon: t
})
}
}, {
key: "renderCuboidEditable",
value: function e(t) {
var n = this;
var r = this.props.annotationVisibility < A.AnnotationVisibility.SHOW_PATHS || this.props.showAdjusted;
var a = this.state.labels[t.keyName];
var i = this.state.attributeSelections[t.keyName] || {};
var o = (0,
c.default)((0,
l.default)(t), {
label: a,
attributes: i
});
var s = this.props.focusedAnnotationId === t.keyName;
var u = this.props.selectedAnnotationId === t.keyName;
(s || u) && (r = false);
var d = (0,
j.isAnnotationDone)(o, this.props.attributeDefinitions, this.props.isLabelRequired);
return g.default.createElement(C.default, p({
hidden: r,
correctVertices: this.props.practiceData && this.props.practiceData[t.keyName],
key: t.keyName,
cuboidColor: this.getColorForCuboid(t),
onMouseOver: function e() {
return n.props.handleAnnotationFocus(t.keyName)
},
onMouseOut: function e() {
return n.props.handleAnnotationFocus(null)
},
onUpdate: this.onCuboidUpdate,
onDelete: function e() {
return n.onCuboidDelete(t.keyName)
},
readOnly: this.props.readOnly,
scale: this.zoomLevel,
minHeight: this.props.minHeight,
minWidth: this.props.minWidth,
isFocused: s,
isSelected: u,
horizon: this.props.showHorizon && this.state.horizonEdited ? this.state.horizon : null
}, t, {
topOffset: this.topOffset / this.zoomLevel,
leftOffset: this.leftOffset / this.zoomLevel,
isFullyAnnotated: d
}))
}
}, {
key: "renderCuboids",
value: function e() {
return this.state.cuboids.map(this.renderCuboidEditable)
}
}, {
key: "renderCuboidsFromPoints2d",
value: function e() {
var t = this;
if (!(this.props.readOnly && this.props.showAdjusted && this.props.cuboidsCorrected && this.props.cuboidsCorrected[0] && this.props.cuboidsCorrected[0].points_2d))
return null;
var n = [[0, 1], [1, 2], [2, 3], [3, 0], [0, 4], [4, 5], [5, 6], [6, 7], [7, 4], [1, 5], [6, 2], [3, 7]];
return (0,
o.default)(this.props.cuboidsCorrected, function(e) {
var r = e.points_2d;
return g.default.createElement("g", null, (0,
o.default)(n, function(n) {
return g.default.createElement("line", {
x1: r[n[0]].x * t.zoomLevel + t.leftOffset,
y1: r[n[0]].y * t.zoomLevel + t.topOffset,
x2: r[n[1]].x * t.zoomLevel + t.leftOffset,
y2: r[n[1]].y * t.zoomLevel + t.topOffset,
stroke: t.getColorForCuboid(e) || "rgba(101,31,255, 1)",
strokeWidth: 1
})
}), g.default.createElement("polygon", {
points: "\n " + (r[0].x * t.zoomLevel + t.leftOffset) + "\n " + (r[0].y * t.zoomLevel + t.topOffset) + "\n " + (r[1].x * t.zoomLevel + t.leftOffset) + "\n " + (r[1].y * t.zoomLevel + t.topOffset) + "\n " + (r[5].x * t.zoomLevel + t.leftOffset) + "\n " + (r[5].y * t.zoomLevel + t.topOffset) + "\n " + (r[4].x * t.zoomLevel + t.leftOffset) + "\n " + (r[4].y * t.zoomLevel + t.topOffset) + "\n ",
fill: t.getColorForCuboid(e) || "rgba(101,31,255, 1)",
opacity: "0.3"
}))
})
}
}, {
key: "renderAnnotationBox",
value: function e() {
var t = this;
if (!this.props.showLabelBox)
return false;
var n = (0,
a.default)(this.props.cuboids, function(e) {
return e.keyName === t.props.focusedAnnotationId
});
if (!n)
return null;
var r = n.label;
var i = n.attributes;
if (!r && !i)
return null;
return g.default.createElement(I.default, {
key: n.keyName,
labels: this.props.labels,
labelSelection: r,
updateLabelSelection: function e(r) {
return t.handleLabelUpdate(n.keyName, r)
},
attributes: this.props.attributeDefinitions,
attributeSelections: i,
updateAttributeSelections: function e(r) {
return t.handleAttributesUpdate(n.keyName, r)
},
annotationFace: n.face,
annotationScale: this.zoomLevel,
showConfirmButton: true,
confirmLabelAndAttributes: function e(r) {
return t.handleConfirmLabelAndAttributes(n.keyName, r)
},
readOnly: this.props.readOnly
})
}
}, {
key: "render",
value: function e() {
var t = this;
var n = this.state
, r = n.dragStart
, a = n.dragEnd;
return g.default.createElement("div", {
style: {
width: this.paddedWidth + "px",
height: this.paddedHeight + "px",
backgroundColor: "white"
},
className: "jsx-1229443243 ImageCuboidLabeler"
}, g.default.createElement("img", {
ref: function e(n) {
t.sourceImage = n
},
onLoad: function e(n) {
return t.handleImageLoad(n.target)
},
onError: this.handleImageError,
style: p({}, this.props.style, {
width: this.imageWidth + "px",
height: this.imageHeight + "px",
marginLeft: this.leftOffset + "px",
marginTop: this.topOffset + "px",
maxWidth: "none",
filter: "brightness(" + 100 * this.props.imageBrightness + "%) contrast(" + 100 * this.props.imageContrast + "%)"
}),
src: this.props.src,
className: "jsx-1229443243 source-image"
}), g.default.createElement("div", {
style: {
width: this.imageWidth + "px",
height: this.imageHeight + "px",
left: this.leftOffset + "px",
top: this.topOffset + "px",
position: "relative"
},
className: "jsx-1229443243"
}, this.props.children), g.default.createElement("svg", {
height: this.paddedHeight,
width: this.paddedWidth,
onMouseMove: this.onMouseMove,
onMouseUp: this.onMouseUp,
style: {
maxWidth: "none"
},
className: "jsx-1229443243 canvas"
}, g.default.createElement("rect", {
height: this.paddedHeight,
width: this.paddedWidth,
onMouseDown: this.onMouseDown,
fill: "transparent",
className: "jsx-1229443243"
}), this.renderCuboids(), this.renderCuboidsFromPoints2d(), r ? g.default.createElement("rect", {
x: Math.min(r.x, a.x),
y: Math.min(r.y, a.y),
width: Math.abs(r.x - a.x),
height: Math.abs(r.y - a.y),
stroke: "rgba(101,31,255, 1)",
fill: "rgba(101,31,255, 0.1)",
className: "jsx-1229443243"
}) : null, this.props.showHorizon ? g.default.createElement(O.default, {
x: this.state.horizon ? this.state.horizon.x : this.paddedWidth / 2 / this.zoomLevel,
y: this.state.horizon ? this.state.horizon.y : this.paddedHeight / 3 / this.zoomLevel,
scale: this.zoomLevel,
onMove: this.onHorizonMove,
r: this.state.horizonEdited ? 4 : 12,
fill: this.state.horizonEdited ? "green" : "rgba(0,255,0,0.3)",
stroke: (this.state.horizonEdited,
"rgba(255,255,255,0.8)"),
strokeDasharray: "1,1"
}) : null), this.renderAnnotationBox(), g.default.createElement(v.default, {
styleId: "1229443243",
css: ["img.source-image.jsx-1229443243,.canvas.jsx-1229443243{position:absolute;top:0;left:0;}"]
}))
}
}, {
key: "imageHeight",
get: function e() {
return this.state.imageHeight * this.zoomLevel
}
}, {
key: "imageWidth",
get: function e() {
return this.state.imageWidth * this.zoomLevel
}
}, {
key: "paddedHeight",
get: function e() {
return this.imageHeight * (this.props.paddingScale || 1.25)
}
}, {
key: "paddedWidth",
get: function e() {
return this.imageWidth * (this.props.paddingScale || 1.25)
}
}, {
key: "leftOffset",
get: function e() {
return (this.paddedWidth - this.imageWidth) / 2
}
}, {
key: "topOffset",
get: function e() {
return (this.paddedHeight - this.imageHeight) / 2
}
}, {
key: "zoomLevel",
get: function e() {
if (this.props.resizeToFit && this.state.imageWidth)
return this.props.resizeToFit / (1.25 * this.state.imageWidth);
return this.props.scale
}
}]);
return t
}(b.Component);
D.defaultProps = {
cuboids: [],
labels: null,
breakdownColors: {},
readOnly: false,
scale: 1,
minWidth: 20,
minHeight: 20,
showHorizon: false,
handleAnnotationSelect: function e() {},
handleAnnotationFocus: function e() {}
};
t.default = D
},
2191: function(e, t, n) {
e.exports = n(2192)
},
2192: function(e, t, n) {
"use strict";
var r = "function" === typeof Symbol && "symbol" === typeof Symbol.iterator ? function(e) {
return typeof e
}
: function(e) {
return e && "function" === typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}
;
Object.defineProperty(t, "__esModule", {
value: true
});
t.TasksPage = void 0;
var a = n(3);
var i = L(a);
var o = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var r in n)
Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
}
return e
}
;
var s = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var l = n(2193);
var u = L(l);
var c = n(0);
var d = L(c);
var f = n(44);
var p = L(f);
var h = n(114);
var m = L(h);
var v = n(297);
var b = L(v);
var g = n(729);
var y = n(2195);
var x = L(y);
var w = n(925);
var k = L(w);
var j = n(922);
var E = L(j);
var _ = n(64);
var S = L(_);
var C = n(51);
var P = L(C);
var O = n(88);
var A = L(O);
var M = n(62);
var I = L(M);
function L(e) {
return e && e.__esModule ? e : {
default: e
}
}
function T(e) {
return function() {
var t = e.apply(this, arguments);
return new Promise(function(e, n) {
function r(a, i) {
try {
var o = t[a](i);
var s = o.value
} catch (e) {
n(e);
return
}
if (!o.done)
return Promise.resolve(s).then(function(e) {
r("next", e)
}, function(e) {
r("throw", e)
});
e(s)
}
return r("next")
}
)
}
}
function R(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function F(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== ("undefined" === typeof t ? "undefined" : r(t)) && "function" !== typeof t ? e : t
}
function N(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + ("undefined" === typeof t ? "undefined" : r(t)));
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var D = function(e) {
N(t, e);
function t() {
R(this, t);
return F(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments))
}
s(t, [{
key: "componentDidMount",
value: function e() {
this.props.actions.fetchCurrentUser(this.props.userFromGetInitialProps)
}
}, {
key: "componentWillReceiveProps",
value: function e(t) {
if (!t.user)
return;
t.user === {} ? (0,
m.default)(null, "/scalers/login", {
includeCurrentURL: true,
clear: true
}) : "user" === t.user.accountType ? (0,
m.default)(null, "/dashboard") : (0,
b.default)(t.user) && (0,
m.default)(null, "/forbidden")
}
}, {
key: "render",
value: function e() {
if (!this.props.user)
return d.default.createElement("div", {
style: {
height: "100%"
},
className: "root o__loading scaler"
}, d.default.createElement(p.default, null));
return this.props.children
}
}]);
return t
}(d.default.Component);
var z = t.TasksPage = function(e) {
N(t, e);
function t(e) {
R(this, t);
var n = F(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
n.AuthContainer = (0,
g.connect)(w.mapStateToProps, w.mapDispatchToProps)(D);
n.TasksContainer = (0,
g.connect)(w.mapStateToProps, w.mapDispatchToProps)(x.default);
n.state = {};
return n
}
s(t, [{
key: "render",
value: function e() {
var t = this;
var n = this.AuthContainer
, r = this.TasksContainer;
if (this.props.isMobile)
return d.default.createElement(E.default, null, "Sorry! At this time, we do not support the completion of tasks on a mobile device.");
if (this.props.isNotChrome)
return d.default.createElement(E.default, null, "Sorry! At this time, we do not support the completion of tasks on a non-Chrome browser. Please ", d.default.createElement("a", {
href: "https://www.google.com/chrome/browser/desktop/index.html"
}, "download Chrome"), ".");
var a = function e(n) {
return t.captcha && t.captcha.onCaptchaComplete && t.captcha.onCaptchaComplete(n)
};
return d.default.createElement(k.default, {
config: this.props.config
}, d.default.createElement(n, this.props, d.default.createElement("div", {
style: {
height: "100%"
}
}, d.default.createElement("div", {
style: {
display: "none"
}
}, d.default.createElement(u.default, {
sitekey: this.props.config.RECAPTCHA_SITE_KEY,
ref: function e(n) {
t.captcha = n
},
onChange: a,
size: "invisible",
badge: "inline"
})), d.default.createElement(P.default, null), d.default.createElement(r, o({}, this.props, {
getCaptchaRef: function e() {
return t.captcha
}
})), d.default.createElement(S.default, {
writeKey: this.props.config.SEGMENT_KEY_SCALERS,
user: this.props.userFromGetInitialProps
}))))
}
}], [{
key: "getInitialProps",
value: function() {
var e = T(i.default.mark(function e(t, n) {
var r = n.isLoggedIn
, a = n.user;
var o, s, l;
return i.default.wrap(function e(n) {
while (1)
switch (n.prev = n.next) {
case 0:
if (!(!r || !a)) {
n.next = 4;
break
}
return n.abrupt("return", (0,
m.default)(t, "/scalers/login", {
includeCurrentURL: true,
clear: true
}));
case 4:
if (!("user" === a.accountType)) {
n.next = 6;
break
}
return n.abrupt("return", (0,
m.default)(t, "/dashboard"));
case 6:
o = "admin" === a.accountRole;
s = t.req ? t.req.headers["user-agent"] : window.navigator.userAgent;
l = t.query;
if (!(s && A.default.isMobileUserAgent(s))) {
n.next = 11;
break
}
return n.abrupt("return", {
isMobile: true
});
case 11:
if (!(s && !A.default.isChromeUserAgent(s) && !A.default.isNodeFetchUserAgent(s) && !l.lidarId && !o)) {
n.next = 13;
break
}
return n.abrupt("return", {
isNotChrome: true
});
case 13:
return n.abrupt("return", {
query: l,
userFromGetInitialProps: a,
target: l.target,
targetFrame: parseInt(l.target_frame || 0),
startFrame: parseInt(t.query.start_frame || 0),
endFrame: parseInt(t.query.end_frame || -1),
blindSampleRate: parseInt(t.query.blind_sample_rate || 0),
multiuserEnabled: !!l.multiuser,
multiuserChannel: l.multiuser
});
case 14:
case "end":
return n.stop()
}
}, e, this)
}));
function t(t, n) {
return e.apply(this, arguments)
}
return t
}()
}]);
return t
}(d.default.Component);
t.default = (0,
I.default)(z)
},
2195: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = n(3);
var a = ge(r);
var i = n(14);
var o = ge(i);
var s = n(7);
var l = ge(s);
var u = n(81);
var c = ge(u);
var d = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var r in n)
Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
}
return e
}
;
var f = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var p = n(1);
var h = ge(p);
var m = n(0);
var v = ge(m);
var b = n(53);
var g = ge(b);
var y = n(4);
var x = ge(y);
var w = n(730);
var k = n(674);
var j = ge(k);
var E = n(2196);
var _ = ge(E);
var S = n(2197);
var C = ge(S);
var P = n(191);
var O = ge(P);
var A = n(264);
var M = ge(A);
var I = n(261);
var L = ge(I);
var T = n(257);
var R = ge(T);
var F = n(259);
var N = ge(F);
var D = n(260);
var z = ge(D);
var B = n(246);
var V = ge(B);
var W = n(262);
var U = ge(W);
var H = n(299);
var G = ge(H);
var Y = n(254);
var K = ge(Y);
var Q = n(256);
var q = ge(Q);
var Z = n(253);
var X = ge(Z);
var J = n(263);
var $ = ge(J);
var ee = n(255);
var te = ge(ee);
var ne = n(2199);
var re = ge(ne);
var ae = n(371);
var ie = ge(ae);
var oe = n(613);
var se = n(676);
var le = ge(se);
var ue = n(88);
var ce = n(265);
var de = ge(ce);
var fe = n(245);
var pe = ge(fe);
var he = n(44);
var me = ge(he);
var ve = n(6);
var be = ge(ve);
function ge(e) {
return e && e.__esModule ? e : {
default: e
}
}
function ye(e) {
return function() {
var t = e.apply(this, arguments);
return new Promise(function(e, n) {
function r(a, i) {
try {
var o = t[a](i);
var s = o.value
} catch (e) {
n(e);
return
}
if (!o.done)
return Promise.resolve(s).then(function(e) {
r("next", e)
}, function(e) {
r("throw", e)
});
e(s)
}
return r("next")
}
)
}
}
function xe(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function we(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function ke(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var je = le.default.UNFIXABLE_TYPES;
var Ee = 10;
var _e = function(e) {
ke(t, e);
function t(e) {
xe(this, t);
var n = we(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
(0,
x.default)(n, "startBatch", "toggleBenchmarking", "onAttachmentLoadingFail", "onUserSkip", "onUserSkipReviewBatch", "fetchTimeSpentStats", "completeAttempt", "completeReviewAssignment", "completeGoldenReviewAssignment", "completeInternalReview", "getIdForClaim", "checkClaim", "refreshClaim", "unassignTasks");
n.state = {
lastInterstitial: new Date
};
n.completedTaskCount = 0;
n.completedWork = {};
return n
}
f(t, [{
key: "componentDidMount",
value: function e() {
this.props.actions.setCaptcha(this.props.getCaptchaRef());
this.startBatch();
this.setState({
benchmarkMode: "admin" === this.props.user.accountRole ? "off" : "disabled",
displayInterstitial: false
})
}
}, {
key: "componentWillUpdate",
value: function e(t) {
if (2 === this.props.assignments.length && (0,
c.default)(t.assignments, "0._id") !== (0,
c.default)(this.props.assignments, "0._id")) {
this.updatePermalink(t);
this.props.onAssignmentFinished && this.props.onAssignmentFinished()
}
if (this.props.batch.status !== w.ENDED && t.batch.status === w.ENDED) {
this.removePermalink();
this.props.onAssignmentFinished && this.props.onAssignmentFinished()
}
this.props.batch.status === w.PENDING && t.batch.status !== w.ENDED && this.updatePermalink(t)
}
}, {
key: "getIdForClaim",
value: function e(t) {
return (0,
ue.isReviewAssignment)(t) ? t.attemptId : t._id
}
}, {
key: "isFixable",
value: function e(t) {
return -1 === je.indexOf(t.type) && !this.isInternalReviewMode && !t.useBinaryResponse
}
}, {
key: "isValidClaim",
value: function e(t) {
var n = this.props.claims[this.getIdForClaim(t)];
return n && n.claimed
}
}, {
key: "toggleBenchmarking",
value: function e() {
this.setState(function(e) {
if ("on" === e.benchmarkMode)
return {
benchmarkMode: "off"
};
if ("off" === e.benchmarkMode)
return {
benchmarkMode: "on"
};
return {
benchmarkMode: e.benchmarkMode
}
})
}
}, {
key: "onAttachmentLoadingFail",
value: function e() {
this.props.actions.skipTask(this.props.query, this.props.assignments[0])
}
}, {
key: "unassignTasks",
value: function e() {
if (this.props.query.force)
return;
if (!this.props || !this.props.assignments)
return;
var t = this.props.assignments.map(function(e) {
var t = e.type
, n = e.attemptId
, r = e._id
, a = e.isReviewMode;
return {
type: t,
attemptId: n,
taskId: r,
isReviewMode: a
}
});
(0,
pe.default)(null, "/internal-api/tasks/unassign/batch", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
assignments: t
})
})
}
}, {
key: "onUserSkip",
value: function e(t, n) {
this.props.actions.skipTask(this.props.query, this.props.assignments[0], true, t, n)
}
}, {
key: "onUserSkipReviewBatch",
value: function e(t, n) {
this.props.actions.skipBatch(this.props.query, this.props.assignments[0].batch, t, n)
}
}, {
key: "fetchTimeSpentStats",
value: function e(t, n) {
this.props.actions.fetchTimeSpentStats(t, n, this.isReviewMode)
}
}, {
key: "startBatch",
value: function e() {
this.props.actions.fetchNextAssignments(this.props.query)
}
}, {
key: "refreshClaim",
value: function e() {
if (this.props.user.isCorporateUser && (this.props.query.force || this.props.query.internal_review_mode || "lidarannotation" === this.props.assignments[0].type))
return;
this.props.actions.refreshAssignmentClaims({
attempts: (0,
l.default)((0,
o.default)(this.props.assignments, function(e) {
return (0,
ue.isReviewAssignment)(e)
}), function(e) {
return {
id: e.attemptId
}
}),
tasks: (0,
l.default)((0,
o.default)(this.props.assignments, function(e) {
return !(0,
ue.isReviewAssignment)(e)
}), function(e) {
return {
id: e._id
}
})
})
}
}, {
key: "checkClaim",
value: function e() {
if (this.props.user.isCorporateUser && (this.props.query.force || this.props.query.internal_review_mode || "lidarannotation" === this.props.assignments[0].type))
return;
var t = this.props.assignments[0];
(0,
ue.isReviewAssignment)(t) ? this.props.actions.checkAssignmentClaim({
attempt: {
id: t.attemptId
}
}) : this.props.actions.checkAssignmentClaim({
task: {
id: t._id
}
})
}
}, {
key: "isDoubleSubmit",
value: function e(t) {
if (t.length > 7 && this.completedWork[t] && new Date - this.completedWork[t] < 5e3)
return true;
this.completedWork[t] = new Date;
return false
}
}, {
key: "completeAttempt",
value: function() {
var e = ye(a.default.mark(function e(t) {
var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
var r;
return a.default.wrap(function e(a) {
while (1)
switch (a.prev = a.next) {
case 0:
r = n.task_id + ":" + n.subtaskVersion;
if (!this.isDoubleSubmit(r)) {
a.next = 3;
break
}
return a.abrupt("return");
case 3:
a.next = 5;
return this.props.actions.completeAttempt(this.props.query, t, n);
case 5:
this.completedTaskCount++;
new Date(Date.now() - 60 * Ee * 1e3) > this.state.lastInterstitial && this.setState({
displayInterstitial: true,
lastInterstitial: new Date
});
case 7:
case "end":
return a.stop()
}
}, e, this)
}));
function t(t) {
return e.apply(this, arguments)
}
return t
}()
}, {
key: "completeReviewAssignment",
value: function() {
var e = ye(a.default.mark(function e(t) {
var n;
return a.default.wrap(function e(r) {
while (1)
switch (r.prev = r.next) {
case 0:
n = this.props.batch.assignments[0].attemptId + ":" + this.props.batch.assignments[0].attemptVersion;
if (!this.isDoubleSubmit(n)) {
r.next = 3;
break
}
return r.abrupt("return");
case 3:
r.next = 5;
return this.props.actions.completeReviewAssignment(this.props.query, t);
case 5:
this.completedTaskCount++;
new Date(Date.now() - 60 * Ee * 1e3) > this.state.lastInterstitial && this.setState({
displayInterstitial: true,
lastInterstitial: new Date
});
case 7:
case "end":
return r.stop()
}
}, e, this)
}));
function t(t) {
return e.apply(this, arguments)
}
return t
}()
}, {
key: "completeGoldenReviewAssignment",
value: function() {
var e = ye(a.default.mark(function e(t) {
return a.default.wrap(function e(n) {
while (1)
switch (n.prev = n.next) {
case 0:
n.next = 2;
return this.props.actions.completeGoldenReviewAssignment(this.props.query, t);
case 2:
this.completedTaskCount++;
case 3:
case "end":
return n.stop()
}
}, e, this)
}));
function t(t) {
return e.apply(this, arguments)
}
return t
}()
}, {
key: "completeInternalReview",
value: function e(t) {
return this.props.actions.completeInternalReview(this.props.query, t)
}
}, {
key: "updatePermalink",
value: function e(t) {
var n = (t || this.props).assignments[0];
var r = ["lidarannotation"];
if (n && n._id && -1 === r.indexOf(n.type))
this.removePermalink();
else if (n && n._id && -1 !== r.indexOf(n.type)) {
var a = {
pathname: g.default.pathname,
query: d({}, this.props.query, {
lidarId: n._id
})
};
n._id !== this.props.query._id && g.default.replace(a, a, {
shallow: true
})
}
}
}, {
key: "removePermalink",
value: function e() {
var t = {
pathname: g.default.pathname,
query: d({}, this.props.query)
};
if (!("lidarId"in t.query))
return;
delete t.query.lidarId;
g.default.replace(t, t, {
shallow: true
})
}
}, {
key: "renderInstructions",
value: function e(t) {
return v.default.createElement("div", {
className: "tasks__container scaler"
}, v.default.createElement(ie.default, {
urls: (0,
oe.collectAttachmentUrls)(this.props.assignments, this.props.config)
}), v.default.createElement(j.default, d({
customer: t.user,
type: t.type,
isReviewMode: this.isReviewMode,
isInternalReviewMode: this.isInternalReviewMode,
isGoldenReviewMode: this.isGoldenReviewMode,
goldenReviewPayoutMultiplier: t.goldenReviewPayoutMultiplier,
instructionsHash: t.instruction_hash,
instructions: t.instruction,
setLastInstructionHash: this.props.actions.setLastInstructionHash,
user: this.props.user,
urgency: t.urgency
}, this.props)))
}
}, {
key: "renderInvalidClaim",
value: function e() {
return v.default.createElement("div", {
className: "jsx-1187182994 unassigned--container"
}, v.default.createElement("div", {
className: "jsx-1187182994 unassigned"
}, v.default.createElement("div", {
className: "jsx-1187182994 unassigned__title"
}, "Oops, this task has expired!"), v.default.createElement("div", {
className: "jsx-1187182994 unassigned__desc"
}, "Tasks can expire if you exceed the maximum time limit for the task, or if they have been left idle for too long."), v.default.createElement("div", {
className: "jsx-1187182994"
}, v.default.createElement(be.default, {
success: true,
onClick: function e() {
return window.location.reload()
}
}, "Continue"))), v.default.createElement(h.default, {
styleId: "1187182994",
css: [".unassigned--container.jsx-1187182994{position:fixed;top:0;bottom:0;left:0;right:0;background:rgba(255,255,255,0.8);display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;}", ".unassigned.jsx-1187182994{width:600px;}", ".unassigned__title.jsx-1187182994{font-size:24px;font-weight:bold;padding-bottom:8px;border-bottom:2px solid black;}", ".unassigned__desc.jsx-1187182994{margin:32px 0 64px;font-size:18px;font-weight:bold;line-height:1.5em;}"]
}))
}
}, {
key: "render",
value: function e() {
var t = this;
var n = this.props.query.type;
var r = this.props.assignments[0];
if (this.state && this.state.displayInterstitial)
return v.default.createElement("div", {
className: "tasks__container scaler"
}, v.default.createElement(_.default, {
next: function e() {
return t.setState({
displayInterstitial: false
})
}
}));
if (this.props.batch.status === w.PENDING)
return v.default.createElement("div", {
className: "tasks__container scaler o__loading"
}, v.default.createElement(me.default, null));
if (!r)
return v.default.createElement("div", {
className: "tasks__container scaler"
}, v.default.createElement(de.default, this.props), v.default.createElement(C.default, {
config: this.props.config,
user: this.props.user
}));
if (!this.isValidClaim(r))
return this.renderInvalidClaim();
var a = this.props.userFromGetInitialProps && "admin" === this.props.userFromGetInitialProps.accountRole;
var i = this.props.userFromGetInitialProps && this.props.userFromGetInitialProps._id;
var o = d({}, r, {
completedTaskCount: this.completedTaskCount,
avgTimeSpentSecs: this.avgTimeSpentSecs,
onSubmit: this.completeAttempt,
onAttachmentLoadingFail: this.onAttachmentLoadingFail,
onUserSkip: this.onUserSkip,
refreshClaim: this.refreshClaim,
checkClaim: this.checkClaim,
claim: this.props.claims[this.getIdForClaim(r)],
fetchTimeSpentStats: this.fetchTimeSpentStats,
loggedUserIsAdmin: a,
loggedUserId: i,
key: r._id,
target: this.props.target,
targetFrame: this.props.targetFrame,
startFrame: this.props.startFrame,
endFrame: this.props.endFrame,
multiuserEnabled: this.props.multiuserEnabled,
multiuserChannel: this.props.multiuserChannel,
blindSampleRate: this.props.blindSampleRate
});
var s = void 0;
switch (r.type) {
case "audiotranscription":
s = v.default.createElement(X.default, o);
break;
case "annotation":
s = v.default.createElement(O.default, o);
break;
case "videoboxannotation":
s = v.default.createElement(M.default, o);
break;
case "polygonannotation":
s = v.default.createElement(L.default, o);
break;
case "laneannotation":
s = v.default.createElement(R.default, o);
break;
case "lineannotation":
s = v.default.createElement(N.default, o);
break;
case "pointannotation":
s = v.default.createElement(z.default, o);
break;
case "cuboidannotation":
s = v.default.createElement(V.default, o);
break;
case "segmentannotation":
s = v.default.createElement(U.default, d({}, o, {
config: this.props.config
}));
break;
case "categorization":
s = v.default.createElement(K.default, o);
break;
case "fixannotation":
s = v.default.createElement(G.default, o);
break;
case "datacollection":
s = v.default.createElement(q.default, o);
break;
case "transcription":
s = v.default.createElement($.default, o);
break;
case "comparison":
s = v.default.createElement(te.default, o);
break;
case "lidarannotation":
s = v.default.createElement(re.default, d({}, o, {
config: this.props.config
}));
break
}
if (!s)
return v.default.createElement("div", null, "Task type ", n, " not found...");
if (r.instruction_hash !== this.props.batch.lastInstructionHash && !this.props.target && !this.props.multiuserEnabled)
return this.renderInstructions(r);
if (this.isReviewMode) {
var l = "admin" === this.props.user.accountRole;
var u = !this.isGoldenReviewMode && (l || "audiotranscription" === r.type || "segmentannotation" === r.type || "lidarannotation" === r.type || r.project && "5ad68137b820884c40decc72" === r.project._id.toString());
var c = this.completeReviewAssignment;
this.isInternalReviewMode ? c = this.completeInternalReview : this.isGoldenReviewMode && (c = this.completeGoldenReviewAssignment);
return v.default.createElement(le.default, {
key: r._id,
instructions: r.instruction,
user: this.props.user,
config: this.props.config,
summary: void 0,
benchmarkMode: this.state.benchmarkMode,
isUserAdmin: l,
toggleBenchmarking: this.toggleBenchmarking,
isInternalReviewMode: this.isInternalReviewMode,
isGoldenReviewMode: this.isGoldenReviewMode,
goldenReviewPayoutMultiplier: r.goldenReviewPayoutMultiplier,
goldenReviewFeedback: this.props.goldenReviewFeedback,
showingGoldenReviewFeedbackModal: this.props.showingGoldenReviewFeedbackModal,
closeGoldenReviewFeedback: this.props.actions.closeGoldenReviewFeedback.bind(this),
query: this.props.query,
assignment: r,
claim: this.props.claims[this.getIdForClaim(r)],
submit: c,
onUserSkip: this.onUserSkip,
onUserSkipBatch: this.onUserSkipReviewBatch,
fixable: this.isFixable(r),
makingChanges: "audiotranscription" === r.type,
canReturnToQueue: u,
taskPage: s
}, v.default.createElement(ie.default, {
urls: (0,
oe.collectAttachmentUrls)(this.props.assignments, this.props.config)
}))
}
return v.default.createElement("div", {
className: "tasks__container scaler"
}, v.default.createElement(ie.default, {
urls: (0,
oe.collectAttachmentUrls)(this.props.assignments, this.props.config)
}), s)
}
}, {
key: "isInternalReviewMode",
get: function e() {
return !!this.props.query.internal_review_mode
}
}, {
key: "isReviewMode",
get: function e() {
return (0,
ue.isReviewAssignment)(this.props.assignments[0])
}
}, {
key: "isGoldenReviewMode",
get: function e() {
return this.props.assignments[0].isGoldenReview
}
}, {
key: "avgTimeSpentSecs",
get: function e() {
return this.props.batch.avgTimeSpentSecs
}
}]);
return t
}(m.Component);
t.default = _e
},
2196: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var a = n(0);
var i = l(a);
var o = n(6);
var s = l(o);
function l(e) {
return e && e.__esModule ? e : {
default: e
}
}
function u(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function c(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function d(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var f = function(e) {
d(t, e);
function t() {
u(this, t);
return c(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments))
}
r(t, [{
key: "render",
value: function e() {
return i.default.createElement("div", {
className: "batch__container"
}, i.default.createElement("div", {
className: "batch"
}, i.default.createElement("div", {
className: "batch__icon"
}, "🎉"), i.default.createElement("div", {
className: "batch__label"
}, i.default.createElement("strong", null, "Are you ready for another round of tasks?"), i.default.createElement("div", {
className: "batch__label--detail"
}, "More tasks are waiting 🤓")), i.default.createElement("div", {
className: "batch__actions"
}, i.default.createElement(s.default, {
success: true,
arrows: true,
type: "button",
onClick: this.props.next
}, "Bring it on"))))
}
}]);
return t
}(a.Component);
t.default = f
},
2197: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = n(3);
var a = b(r);
var i = n(22);
var o = b(i);
var s = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var l = n(1);
var u = b(l);
var c = n(0);
var d = b(c);
var f = n(2198);
var p = b(f);
var h = n(6);
var m = b(h);
var v = n(372);
function b(e) {
return e && e.__esModule ? e : {
default: e
}
}
function g(e) {
return function() {
var t = e.apply(this, arguments);
return new Promise(function(e, n) {
function r(a, i) {
try {
var o = t[a](i);
var s = o.value
} catch (e) {
n(e);
return
}
if (!o.done)
return Promise.resolve(s).then(function(e) {
r("next", e)
}, function(e) {
r("throw", e)
});
e(s)
}
return r("next")
}
)
}
}
function y(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function x(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function w(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var k = function(e) {
w(t, e);
function t(e) {
y(this, t);
var n = x(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
n.state = {
showLidarCTA: false
};
return n
}
s(t, [{
key: "componentDidMount",
value: function() {
var e = g(a.default.mark(function e() {
var t, n, r, i;
return a.default.wrap(function e(a) {
while (1)
switch (a.prev = a.next) {
case 0:
t = null;
n = this.props.user;
r = (0,
o.default)(this.props.user.allowedTaskTypes, "lidarannotation");
if (r) {
a.next = 8;
break
}
a.next = 6;
return (0,
v.checkLidarPracticePermission)({
context: t,
user: n
});
case 6:
i = a.sent;
i && this.setState({
showLidarCTA: true
});
case 8:
case "end":
return a.stop()
}
}, e, this)
}));
function t() {
return e.apply(this, arguments)
}
return t
}()
}, {
key: "render",
value: function e() {
return d.default.createElement(p.default, null, d.default.createElement("div", {
className: "jsx-3609185165"
}, d.default.createElement("h1", {
className: "jsx-3609185165"
}, "Your task queue is empty"), d.default.createElement("div", {
className: "jsx-3609185165 no-tasks__body"
}, d.default.createElement("p", {
className: "jsx-3609185165"
}, "Please check back after a little while for more tasks. You can also get enabled on more tasks by ", d.default.createElement("a", {
href: "/scalers/exams",
className: "jsx-3609185165"
}, "taking exams"), "."), this.state.showLidarCTA && d.default.createElement("p", {
className: "jsx-3609185165"
}, "🌟 We're hiring for ", d.default.createElement("strong", {
className: "jsx-3609185165"
}, "LIDAR"), " annotators! It is our most in-demand task type, so we can guarantee high task availability for quality taskers. To get started, check out the ", d.default.createElement("a", {
href: "/scalers/tutorials/lidar",
className: "jsx-3609185165"
}, "introduction to LIDAR annotation"), ".")), d.default.createElement(m.default, {
size: "lg",
href: "/scalers"
}, "Back to dashboard"), d.default.createElement(u.default, {
styleId: "3609185165",
css: [".no-tasks__body.jsx-3609185165 p.jsx-3609185165{margin:36px 0;}"]
})))
}
}]);
return t
}(c.Component);
t.default = k
},
2198: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var a = n(1);
var i = l(a);
var o = n(0);
var s = l(o);
function l(e) {
return e && e.__esModule ? e : {
default: e
}
}
function u(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function c(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function d(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var f = function(e) {
d(t, e);
function t() {
u(this, t);
return c(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments))
}
r(t, [{
key: "render",
value: function e() {
return s.default.createElement("div", {
className: "jsx-3397065203 fullscreen-card--container"
}, s.default.createElement("div", {
className: "jsx-3397065203 fullscreen-card"
}, this.props.children), s.default.createElement(i.default, {
styleId: "3397065203",
css: [".fullscreen-card--container.jsx-3397065203{background-image:linear-gradient(225deg,#8E0CFF 0%,#FF4DE9 40%,#F89558 73%,#F8F658 100%);height:100vh;width:100vw;display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;}", ".fullscreen-card.jsx-3397065203{min-height:400px;width:800px;margin:40px;-ms-flex-negative:0;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;padding:80px;display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:stretch;-ms-flex-align:stretch;-webkit-align-items:stretch;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;background:white;border-radius:8px;-webkit-box-shadow:0 50px 100px -30px rgba(0,0,0,.5);box-shadow:0 50px 100px -30px rgba(0,0,0,.5);}"]
}))
}
}]);
return t
}(s.default.Component);
t.default = f
},
2199: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = n(3);
var a = m(r);
var i = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var r in n)
Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
}
return e
}
;
var o = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var s = n(505);
var l = m(s);
var u = n(0);
var c = m(u);
var d = n(44);
var f = m(d);
var p = n(570);
var h = m(p);
function m(e) {
return e && e.__esModule ? e : {
default: e
}
}
function v(e) {
return function() {
var t = e.apply(this, arguments);
return new Promise(function(e, n) {
function r(a, i) {
try {
var o = t[a](i);
var s = o.value
} catch (e) {
n(e);
return
}
if (!o.done)
return Promise.resolve(s).then(function(e) {
r("next", e)
}, function(e) {
r("throw", e)
});
e(s)
}
return r("next")
}
)
}
}
function b(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function g(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function y(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var x = function(e) {
y(t, e);
function t(e) {
b(this, t);
var n = g(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
n.state = {
feedbackLoaded: false
};
n.perCuboidFeedback = n.props.loggedUserIsAdmin && new h.default({
subtaskId: n.props._id
},null,{
readOnly: true
});
return n
}
o(t, [{
key: "componentDidMount",
value: function() {
var e = v(a.default.mark(function e() {
return a.default.wrap(function e(t) {
while (1)
switch (t.prev = t.next) {
case 0:
if (!this.perCuboidFeedback) {
t.next = 4;
break
}
t.next = 3;
return this.perCuboidFeedback.init();
case 3:
this.setState({
feedbackLoaded: true
});
case 4:
case "end":
return t.stop()
}
}, e, this)
}));
function t() {
return e.apply(this, arguments)
}
return t
}()
}, {
key: "render",
value: function e() {
var t = this;
if (this.perCuboidFeedback && !this.state.feedbackLoaded)
return c.default.createElement("div", {
className: "tasks__container scaler o__loading"
}, c.default.createElement(f.default, null));
return c.default.createElement(l.default, i({
ref: function e(n) {
t.task = n
},
perCuboidFeedback: this.perCuboidFeedback
}, this.props))
}
}]);
return t
}(c.default.Component);
t.default = x
},
220: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = n(238);
var a = s(r);
var i = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var o = n(143);
function s(e) {
return e && e.__esModule ? e : {
default: e
}
}
function l(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function u(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function c(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var d = function(e) {
c(t, e);
function t(e) {
l(this, t);
var n = u(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));
(0,
a.default)(e, {
initialElapsedTime: 0,
tickInterval: 100,
requiresFocus: false
});
n._tickInterval = e.tickInterval;
n._requiresFocus = e.requiresFocus;
n._elapsedTime = e.initialElapsedTime;
n._timerID = null;
return n
}
i(t, [{
key: "start",
value: function e() {
var t = this;
if (null !== this._timerID)
throw new Error("Cannot start a timer more than once");
this._timerID = setInterval(function() {
return t._maybeTick()
}, this._tickInterval)
}
}, {
key: "stop",
value: function e() {
clearInterval(this._timerID);
this._timerID = null
}
}, {
key: "reset",
value: function e() {
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0;
this._elapsedTime = t;
this.emit("tick", this._elapsedTime)
}
}, {
key: "elapsedTime",
value: function e() {
return this._elapsedTime
}
}, {
key: "isRunning",
value: function e() {
return null !== this._timerID
}
}, {
key: "_maybeTick",
value: function e() {
if ("undefined" === typeof document)
return;
if (this._requiresFocus && !document.hasFocus())
return;
this._tick()
}
}, {
key: "_tick",
value: function e() {
this._elapsedTime += this._tickInterval;
this.emit("tick", this._elapsedTime)
}
}]);
return t
}(o.EventEmitter);
t.default = d
},
221: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var a = n(0);
var i = c(a);
var o = n(419);
var s = c(o);
var l = n(12);
var u = c(l);
function c(e) {
return e && e.__esModule ? e : {
default: e
}
}
function d(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function f(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function p(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
function h(e) {
return (0,
s.default)(e, 2, "0")
}
function m(e) {
var t = u.default.duration(e, "milliseconds");
return h(t.hours()) + ":" + h(t.minutes()) + ":" + h(t.seconds())
}
var v = function(e) {
p(t, e);
function t(e) {
d(this, t);
var n = f(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
n.setTime = n.setTime.bind(n);
n.state = {
time: 0
};
return n
}
r(t, [{
key: "componentWillReceiveProps",
value: function e(t) {
if (this.props.driver !== t.driver) {
this.props.driver.removeListener("tick", this.setTime);
this.setState({
time: t.driver.elapsedTime()
});
t.driver.on("tick", this.setTime)
}
}
}, {
key: "componentDidMount",
value: function e() {
this.setState({
time: this.props.driver.elapsedTime()
});
this.props.driver.on("tick", this.setTime)
}
}, {
key: "componentWillUnmount",
value: function e() {
this.props.driver.removeListener("tick", this.setTime)
}
}, {
key: "setTime",
value: function e(t) {
this.setState({
time: t
})
}
}, {
key: "render",
value: function e() {
return i.default.createElement("span", null, this.props.formatter(this.state.time))
}
}]);
return t
}(a.Component);
t.default = v;
v.defaultProps = {
formatter: m
}
},
223: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
t.lintLidar = t.checkPathLabel = t.checkPathDimensions = t.checkPathInconsistentHeadingVsMovement = t.checkPathFastRotation = void 0;
var r = n(163);
var a = x(r);
var i = n(355);
var o = x(i);
var s = n(46);
var l = x(s);
var u = n(9);
var c = x(u);
var d = n(39);
var f = y(d);
var p = n(47);
var h = x(p);
var m = n(36);
var v = x(m);
var b = n(40);
var g = n(147);
function y(e) {
if (e && e.__esModule)
return e;
var t = {};
if (null != e)
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]);
t.default = e;
return t
}
function x(e) {
return e && e.__esModule ? e : {
default: e
}
}
var w = b.lintSeverity.ERROR
, k = b.lintSeverity.WARNING
, j = b.lintSeverity.INFO;
var E = "57fbc670e27e100600947ed7";
var _ = function e(t) {
var n = t.track
, r = t.totalFrames;
if (n.frames.length >= r / 10)
return [];
return [new b.LintDiagnostic("short-path",n.frames.length < r / 20 ? k : j,{
cuboidId: n.cuboidId,
pathLength: n.frames.length,
frames: [n.frames[0].frame],
label: n.label
})]
};
var S = function e(t) {
var n = t.track
, r = t.taskCustomer;
var a = r === E;
var i = n.frames.map(function(e) {
var t = e.frame;
return t
}).sort(function(e, t) {
return e - t
});
var o = c.default.range(i[0], i[i.length - 1] + 1);
var s = o.filter(function(e) {
return !c.default.includes(i, e)
});
if (0 === s.length)
return [];
return [new b.LintDiagnostic("path-hole",a ? w : j,{
cuboidId: n.cuboidId,
frames: s,
label: n.label
})]
};
var C = function e(t) {
var n = t.track
, r = t.tracks
, a = t.totalFrames;
if (n.frames.length === a)
return [];
var i = [];
r.filter(function(e) {
return e.cuboidId !== n.cuboidId
}).forEach(function(e) {
var t = n.frames[n.frames.length - 1];
var r = e.frames[0];
var a = r.frame - t.frame === 1;
var o = r.cuboidProps.label === t.cuboidProps.label;
a && o && (0,
g.cuboidsOverlap)(t, r) && i.push(new b.LintDiagnostic("split-path",k,{
frames: [t.frame, r.frame],
cuboidId: n.cuboidId,
otherCuboidId: e.cuboidId,
label: n.label
}))
});
return i
};
var P = function e(t) {
var n = t.track
, r = t.totalFrames;
var a = [];
if (n.frames.length !== r)
return a;
function i(e) {
return {
x: v.default.round(e.cuboidProps.position.x, 3),
y: v.default.round(e.cuboidProps.position.y, 3),
z: v.default.round(e.cuboidProps.position.z, 3),
yaw: v.default.round(e.cuboidProps.yaw, 14),
stationary: e.cuboidProps.stationary
}
}
var o = n.frames.map(i);
var s = o.map(h.default);
var u = {};
var d = true;
var f = false;
var p = void 0;
try {
for (var m = (0,
l.default)(s), g; !(d = (g = m.next()).done); d = true) {
var y = g.value;
u[y] = (u[y] || 0) + 1
}
} catch (e) {
f = true;
p = e
} finally {
try {
!d && m.return && m.return()
} finally {
if (f)
throw p
}
}
var x = c.default.maxBy(c.default.keys(u), function(e) {
return u[e]
});
var w = u[x];
var k = n.frames.filter(function(e) {
return (0,
h.default)(i(e)) !== x
}).map(function(e) {
return e.frame
});
w > .98 * r && w < r && a.push(new b.LintDiagnostic("almost-stationary",r - w > 2 ? "INFO" : "WARNING",{
cuboidId: n.cuboidId,
frames: k,
label: n.label
}));
return a
};
var O = function e(t, n) {
var r = .3;
var a = {};
var i = true;
var o = false;
var s = void 0;
try {
for (var u = (0,
l.default)(n), d; !(i = (d = u.next()).done); i = true) {
var f = d.value;
var p = f.cuboidProps.position;
var h = p.z - f.cuboidProps.dimensions.z / 2;
var m = t.getFloor({
x: p.x,
y: p.y
});
if (Math.abs(h - m) > r) {
a[f.cuboid] || (a[f.cuboid] = new b.LintDiagnostic("off-ground-cuboid","WARNING",{
cuboidId: f.cuboid,
frames: [],
label: f.cuboidProps.label
},"experimental"));
a[f.cuboid].data.frames.push(f.frame)
}
}
} catch (e) {
o = true;
s = e
} finally {
try {
!i && u.return && u.return()
} finally {
if (o)
throw s
}
}
return c.default.values(a)
};
var A = function e(t) {
var n = t.rawPaths
, r = t.totalFrames;
var i = {};
var s = {};
var u = function e(t, n) {
return "torso_width_pedestrian" === t && "pedestrian_with_object" === n || "torso_width_pedestrian" === n && "pedestrian_with_object" === t
};
var d = function e(t) {
var r = n.filter(function(e) {
return e.frame === t
});
var a = new o.default;
for (var c = 0; c < r.length; c++) {
var d = r[c];
if (!a.has(d.cuboid))
for (var f = c + 1; f < r.length; f++) {
var p = r[f];
if (!a.has(p.cuboid) && (0,
g.cuboidsOverlap)(d, p)) {
if (u(d.cuboidProps.label, p.cuboidProps.label))
continue;
a.add(d.cuboid);
a.add(p.cuboid);
s[d.cuboid] = d.cuboidProps.label;
s[p.cuboid] = p.cuboidProps.label;
break
}
}
}
var h = true;
var m = false;
var v = void 0;
try {
for (var b = (0,
l.default)(a.values()), y; !(h = (y = b.next()).done); h = true) {
var x = y.value;
i[x] || (i[x] = []);
i[x].push(t)
}
} catch (e) {
m = true;
v = e
} finally {
try {
!h && b.return && b.return()
} finally {
if (m)
throw v
}
}
};
var f = true;
var p = false;
var h = void 0;
try {
for (var m = (0,
l.default)(c.default.range(0, r)), v; !(f = (v = m.next()).done); f = true) {
var y = v.value;
d(y)
}
} catch (e) {
p = true;
h = e
} finally {
try {
!f && m.return && m.return()
} finally {
if (p)
throw h
}
}
var x = [];
var w = function e(t) {
var r = i[t];
var a = n.filter(function(e) {
return c.default.includes(r, e.frame) && e.cuboid === t
}).map(function(e) {
return e.cuboidProps.label
});
var o = a.every(function(e) {
return "pedestrian" === e.toLowerCase()
});
x.push(new b.LintDiagnostic("overlapping-cuboid",o ? j : k,{
frames: r,
cuboidId: t,
label: s[t]
}))
};
var E = true;
var _ = false;
var S = void 0;
try {
for (var C = (0,
l.default)((0,
a.default)(i)), P; !(E = (P = C.next()).done); E = true) {
var O = P.value;
w(O)
}
} catch (e) {
_ = true;
S = e
} finally {
try {
!E && C.return && C.return()
} finally {
if (_)
throw S
}
}
return x
};
var M = t.checkPathFastRotation = function e(t) {
var n = v.default.deg2rad(40);
var r = v.default.deg2rad(85);
if (t.stationary)
return [];
var a = t.getExistingFrameNumbers();
if (a.length < 2)
return [];
var i = {
INFO: [],
WARNING: []
};
for (var o = 1; o < a.length; o++) {
var s = a[o - 1];
var l = a[o];
if (s + 1 !== l)
continue;
var u = v.default.normalizeRads(t.getFrame(s, true).yaw);
var c = v.default.normalizeRads(t.getFrame(s, true).yaw);
var d = Math.abs(v.default.angleDiff(u, c));
var f = void 0;
d > n && (f = j);
d > r && (f = k);
f && i[f].push(l)
}
var p = [];
var h = [j, k];
for (var m = 0; m < h.length; m++) {
var g = h[m];
i[g].length > 0 && p.push(new b.LintDiagnostic("fast-rotation",g,{
cuboidId: t.cuboidId,
frames: i[g],
label: t.label
}))
}
return p
}
;
var I = t.checkPathInconsistentHeadingVsMovement = function e(t) {
var n = .3;
var r = .8;
var a = .6;
if (t.stationary)
return [];
var i = t.getExistingFrameNumbers();
if (i.length < 2)
return [];
var o = {
INFO: [],
WARNING: []
};
var s = new f.Vector2(0,0);
var l = new f.Vector2;
var u = new f.Vector2;
var d = new f.Vector2;
var p = new f.Vector2;
for (var h = 1; h < i.length; h++) {
var m = i[h - 1];
var g = i[h];
if (m + 1 !== g)
continue;
var y = t.getFrame(m);
var x = t.getFrame(g);
l.fromArray([y.position.x, y.position.y]);
u.fromArray([x.position.x, x.position.y]);
var w = v.default.normalizeRads(y.yaw);
p.set(0, 1);
p.rotateAround(s, w);
d.subVectors(u, l);
var E = d.length();
if (E < n)
continue;
var _ = d.dot(p);
var S = _ / E;
var C = void 0;
S < r && (C = j);
S < a && (C = k);
if (C) {
o[C].push(m);
o[C].push(g)
}
}
var P = [];
var O = [j, k];
for (var A = 0; A < O.length; A++) {
var M = O[A];
if (o[M].length > 0) {
o[M] = c.default.uniq(o[M]);
P.push(new b.LintDiagnostic("inconsistent-heading-vs-movement",M,{
cuboidId: t.cuboidId,
frames: o[M],
label: t.label
}))
}
}
return P
}
;
var L = {
OtherCyclist: {
mean: {
x: 1.1035,
y: 1.9581,
z: 1.8165
},
stdDev: {
x: .838,
y: .9956,
z: .2912
}
},
Motorcyclist: {
mean: {
x: 1.0972,
y: 2.654,
z: 1.7844
},
stdDev: {
x: .3532,
y: .9556,
z: .199
}
},
OtherPedestrian: {
mean: {
x: .8815,
y: 1.5282,
z: 1.714
},
stdDev: {
x: .4009,
y: .7969,
z: .2411
}
},
Cyclist: {
mean: {
x: .9381,
y: 2.0347,
z: 1.8809
},
stdDev: {
x: .2924,
y: .59,
z: .2083
}
},
Pedestrian: {
mean: {
x: .761,
y: .8206,
z: 1.8575
},
stdDev: {
x: .2525,
y: .4457,
z: .2418
}
},
Car: {
mean: {
x: 2.17,
y: 4.6691,
z: 1.7956
},
stdDev: {
x: .9383,
y: 1.2474,
z: .3348
}
}
};
var T = t.checkPathDimensions = function e(t) {
var n = t.getRawCuboidPath();
var r = [];
function a(e) {
var a = n.getProp("dimensions", e);
var i = n.getProp("label", e);
if (!c.default.has(L, i))
return;
var o = L[i];
var s = {
x: 0,
y: 1,
z: 2
};
var l = ["x", "y", "z"];
for (var u = 0; u < l.length; u++) {
var d = l[u];
var f = o.mean[d];
var p = o.stdDev[d];
var h = a[s[d]];
var m = void 0;
var v = void 0;
if (h < f - 2 * p) {
m = j;
v = "small"
}
if (h < f - 3 * p) {
m = k;
v = "small"
}
if (h > f + 2 * p) {
m = j;
v = "large"
}
if (h > f + 3 * p) {
m = k;
v = "large"
}
m && r.push(new b.LintDiagnostic("extraordinary-dimensions",m,{
cuboidId: t.cuboidId,
dim: d,
direction: v,
frames: [e],
label: i
}))
}
}
var i = t.getExistingFrameNumbers();
if (0 === i.length)
return [];
if (n.isStatic("dimensions"))
a(i[0]);
else {
var o = true;
var s = false;
var u = void 0;
try {
for (var d = (0,
l.default)(i), f; !(o = (f = d.next()).done); o = true) {
var p = f.value;
a(p)
}
} catch (e) {
s = true;
u = e
} finally {
try {
!o && d.return && d.return()
} finally {
if (s)
throw u
}
}
}
return r
}
;
var R = t.checkPathLabel = function e(t) {
var n = [];
var r = t.label;
r && "" !== r || n.push(new b.LintDiagnostic("no-label",w,{
cuboidId: t.cuboidId,
frames: t.getExistingFrameNumbers(),
label: r
}));
return n
}
;
function F(e) {
var t = [];
var n = function n(r) {
var a = e.getFrame(r).filter(function(e) {
return !e.extrapolation
});
t = t.concat(a.map(function(e) {
return {
frame: r,
cuboidProps: e,
cuboid: e.id
}
}))
};
var r = true;
var i = false;
var o = void 0;
try {
for (var s = (0,
l.default)(c.default.range(0, e.numFrames)), u; !(r = (u = s.next()).done); r = true) {
var d = u.value;
n(d)
}
} catch (e) {
i = true;
o = e
} finally {
try {
!r && s.return && s.return()
} finally {
if (i)
throw o
}
}
var f = {};
var p = true;
var h = false;
var m = void 0;
try {
for (var v = (0,
l.default)(t), b; !(p = (b = v.next()).done); p = true) {
var g = b.value;
f[g.cuboid] || (f[g.cuboid] = []);
f[g.cuboid].push(g)
}
} catch (e) {
h = true;
m = e
} finally {
try {
!p && v.return && v.return()
} finally {
if (h)
throw m
}
}
var y = (0,
a.default)(f).sort().map(function(e) {
return {
cuboidId: e,
frames: f[e],
dimensions: f[e][0].cuboidProps.dimensions,
label: f[e][0].cuboidProps.label
}
});
return {
tracks: y,
rawPaths: t
}
}
var N = [_, S, C, P];
var D = [M, T, I, R];
var z = t.lintLidar = function e(t) {
var n = t.pointCloud
, r = t.cuboidStore
, a = t.taskCustomer
, i = t.selectedPathId;
var o = [];
var s = F(r)
, u = s.rawPaths
, c = s.tracks;
var d = r.numFrames;
var f = true;
var p = false;
var h = void 0;
try {
for (var m = (0,
l.default)(c), v; !(f = (v = m.next()).done); f = true) {
var b = v.value;
var g = true;
var y = false;
var x = void 0;
try {
for (var w = (0,
l.default)(N), k; !(g = (k = w.next()).done); g = true) {
var j = k.value;
o = o.concat(j({
track: b,
tracks: c,
totalFrames: d,
taskCustomer: a
}))
}
} catch (e) {
y = true;
x = e
} finally {
try {
!g && w.return && w.return()
} finally {
if (y)
throw x
}
}
}
} catch (e) {
p = true;
h = e
} finally {
try {
!f && m.return && m.return()
} finally {
if (p)
throw h
}
}
o = o.concat(A({
rawPaths: u,
totalFrames: d
}));
o = o.concat(O(n, u));
var E = true;
var _ = false;
var S = void 0;
try {
for (var C = (0,
l.default)(r.getNonEmptyPaths()), P; !(E = (P = C.next()).done); E = true) {
var M = P.value;
if (i && M.cuboidId !== i)
continue;
var I = true;
var L = false;
var T = void 0;
try {
for (var R = (0,
l.default)(D), z; !(I = (z = R.next()).done); I = true) {
var B = z.value;
o = o.concat(B(M))
}
} catch (e) {
L = true;
T = e
} finally {
try {
!I && R.return && R.return()
} finally {
if (L)
throw T
}
}
}
} catch (e) {
_ = true;
S = e
} finally {
try {
!E && C.return && C.return()
} finally {
if (_)
throw S
}
}
return o.filter(function(e) {
return !i || e.data && e.data.cuboidId === i
})
}
},
224: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
t.lintPolygonAnnotation = void 0;
var r = n(84);
var a = f(r);
var i = n(46);
var o = f(i);
var s = n(36);
var l = f(s);
var u = n(9);
var c = f(u);
var d = n(40);
function f(e) {
return e && e.__esModule ? e : {
default: e
}
}
var p = d.lintSeverity.ERROR;
var h = "59d28a313c09770007aec417";
var m = {
DRIVABLE_SPACE: "59d583b34c869400844035d3",
MOVING_OBJECTS: "59d583946ec494007a2bc777",
PARKING_SPACE: "59e12f91a367c22b86a3d4ef"
};
var v = function e(t) {
var n = t.task
, r = t.response;
if (n.user !== h)
return [];
if (c.default.get(n.project, "_id") !== m.PARKING_SPACE)
return [];
var a = [];
var i = c.default.get(r, "annotations", []);
i.forEach(function(e, t) {
var n = e.vertices;
l.default.polygonArea(n) > 0 && a.push(new d.LintDiagnostic("parking-point-order[" + t + "]",p,{
index: t
}))
});
return a
};
var b = function e(t) {
var n = t.task
, r = t.response;
if (n.user !== h)
return [];
if (c.default.get(n.project, "_id") !== m.MOVING_OBJECTS)
return [];
var a = 0;
var i = true;
var s = false;
var l = void 0;
try {
for (var u = (0,
o.default)(c.default.get(r, "annotations", [])), f; !(i = (f = u.next()).done); i = true) {
var v = f.value;
"Yes" === c.default.get(v, "attributes.cipv") && a++
}
} catch (e) {
s = true;
l = e
} finally {
try {
!i && u.return && u.return()
} finally {
if (s)
throw l
}
}
if (a > 2)
return [new d.LintDiagnostic("more-than-two-cipv",p,{
message: "There are " + a + " vehicles marked as CIPV. There can be at most two vehicles marked as CIPV."
})];
return []
};
var g = t.lintPolygonAnnotation = function e(t) {
var n = t.task
, r = t.response;
var i = [];
i.push.apply(i, (0,
a.default)(b({
task: n,
response: r
})));
i.push.apply(i, (0,
a.default)(v({
task: n,
response: r
})));
return i
}
},
225: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
t.lintLaneAnnotation = void 0;
var r = n(84);
var a = f(r);
var i = n(46);
var o = f(i);
var s = n(36);
var l = f(s);
var u = n(9);
var c = f(u);
var d = n(40);
function f(e) {
return e && e.__esModule ? e : {
default: e
}
}
var p = d.lintSeverity.ERROR;
var h = "59d28a313c09770007aec417";
var m = {
LANE_LABELING: "59e12d922a9d332a20eeb862"
};
var v = function e(t) {
var n = t.lines[0].vertices;
var r = t.lines[1].vertices;
var a = r.slice();
a.reverse();
var i = n.concat(r);
var o = n.concat(a);
var s = Math.abs(l.default.polygonArea(i));
var u = Math.abs(l.default.polygonArea(o));
var c = s > u ? i : o;
return l.default.polygonCentroid(c)
};
var b = function e(t) {
var n = t.task
, r = t.response;
if (n.user !== h)
return [];
if (c.default.get(n.project, "_id") !== m.LANE_LABELING)
return [];
var a = [];
var i = c.default.get(r, "annotations", []);
var o = i.map(function(e) {
return v(e).x
});
for (var s in i)
for (var l in i) {
if (s === l)
continue;
var u = ["left", "center", "right"];
var f = u.indexOf(i[s].attributes.lane);
var b = u.indexOf(i[l].attributes.lane);
var g = o[s];
var y = o[l];
-1 !== f && -1 !== b && g > y && f < b && a.push(new d.LintDiagnostic("lane-ordering",p,{
left: s,
right: l
}))
}
return a
};
var g = function e(t) {
var n = t.task
, r = t.response;
if (n.user !== h)
return [];
if (c.default.get(n.project, "_id") !== m.LANE_LABELING)
return [];
var a = 0
, i = 0
, s = 0;
var l = true;
var u = false;
var f = void 0;
try {
for (var v = (0,
o.default)(c.default.get(r, "annotations", [])), b; !(l = (b = v.next()).done); l = true) {
var g = b.value;
var y = c.default.get(g, "attributes.lane");
"left" === y ? a++ : "right" === y ? i++ : "center" === y && s++
}
} catch (e) {
u = true;
f = e
} finally {
try {
!l && v.return && v.return()
} finally {
if (u)
throw f
}
}
var x = [];
i > 1 && x.push(new d.LintDiagnostic("more-than-one-right-lane",p,{
message: "There are " + i + " lanes labeled as right lanes. There can be at most one right lane."
}));
a > 1 && x.push(new d.LintDiagnostic("more-than-one-left-lane",p,{
message: "There are " + a + " lanes labeled as left lanes. There can be at most one left lane."
}));
s < 1 && c.default.get(r, "annotations", []).length > 0 && x.push(new d.LintDiagnostic("no-center-lane",p,{
message: "There are " + s + " lanes labeled as center lanes. There needs to be at least one."
}));
return x
};
var y = function e(t) {
var n = t.response;
var r = function e(t) {
var r = true;
var a = false;
var i = void 0;
try {
for (var s = (0,
o.default)(n.annotations), l; !(r = (l = s.next()).done); r = true) {
var u = l.value;
var c = true;
var d = false;
var f = void 0;
try {
for (var p = (0,
o.default)(u.lines), h; !(c = (h = p.next()).done); c = true) {
var m = h.value;
if (m.line_id === t)
return true
}
} catch (e) {
d = true;
f = e
} finally {
try {
!c && p.return && p.return()
} finally {
if (d)
throw f
}
}
}
} catch (e) {
a = true;
i = e
} finally {
try {
!r && s.return && s.return()
} finally {
if (a)
throw i
}
}
return false
};
var a = [];
var i = true;
var s = false;
var l = void 0;
try {
for (var u = (0,
o.default)(n.lines), c; !(i = (c = u.next()).done); i = true) {
var f = c.value;
r(f.line_id) || a.push(new d.LintDiagnostic("line-not-belong-to-lane[" + f.line_id + "]",p,{
message: "There is a line that does not belong to lane. Please remove all such lines."
}))
}
} catch (e) {
s = true;
l = e
} finally {
try {
!i && u.return && u.return()
} finally {
if (s)
throw l
}
}
return a
};
var x = t.lintLaneAnnotation = function e(t) {
var n = t.task
, r = t.response;
var i = [];
i.push.apply(i, (0,
a.default)(g({
task: n,
response: r
})));
i.push.apply(i, (0,
a.default)(y({
response: r
})));
i.push.apply(i, (0,
a.default)(b({
task: n,
response: r
})));
return i
}
},
226: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
t.lintLineAnnotation = void 0;
var r = n(84);
var a = l(r);
var i = n(9);
var o = l(i);
var s = n(40);
function l(e) {
return e && e.__esModule ? e : {
default: e
}
}
var u = s.lintSeverity.WARNING
, c = s.lintSeverity.ERROR;
var d = "592669568d6cbc06005b1b5a";
var f = "59d28a313c09770007aec417";
var p = {
SIDE_CAMERA_LANE: "5a0a28a84ba9920ec9d638d9"
};
var h = function e(t) {
var n = t.task
, r = t.response;
if (n.user !== f)
return [];
if (o.default.get(n.project, "_id") !== p.SIDE_CAMERA_LANE)
return [];
var a = o.default.get(r, "annotations", []);
if (1 === a.length) {
var i = o.default.get(a[0], "attributes.lane_line");
if ("L" !== i)
return [new s.LintDiagnostic("single-line-LL-label",c,{
message: "There is only 1 line annotated, so the line should be labeled as L instead of LL."
})]
}
for (var l in a) {
var d = o.default.get(a[l], "attributes.lane_line_type");
if ("edge" === d)
return [new s.LintDiagnostic("single-line-edge-label",u,{
message: 'Make sure any lines marked as "edge" don\'t have a visible line marking'
})]
}
return []
};
var m = function e(t) {
var n = t.task
, r = t.response;
if (n.user !== f)
return [];
if (o.default.get(n.project, "_id") !== p.SIDE_CAMERA_LANE)
return [];
var a = o.default.get(r, "annotations", []);
if (2 === a.length) {
var i = o.default.get(a[0], "attributes.lane_line");
var l = o.default.get(a[1], "attributes.lane_line");
if (i === l)
return [new s.LintDiagnostic("double-line-same-label",c,{
message: "There are two lane lines both labeled " + i + ". One should be labeled L and the other LL."
})]
}
return []
};
function v(e, t) {
var n = o.default.minBy(e, "y");
var r = o.default.maxBy(e, "y");
if (n && r) {
if (n.y === r.y)
return n.x;
return ((t - n.y) * r.x + (r.y - t) * n.x) * (1 / (r.y - n.y))
}
}
function b(e, t) {
var n = 0;
var r = 0;
[].concat((0,
a.default)(e.vertices), (0,
a.default)(t.vertices)).forEach(function(a) {
var i = v(e.vertices, a.y);
var o = v(t.vertices, a.y);
if (!i || !o)
return;
i < o ? n += 1 : r += 1
});
return n && r ? "crossing" : n ? "left" : r ? "right" : "n/a"
}
var g = function e(t) {
var n = t.task
, r = t.response;
if (n.user !== d)
return [];
var a = o.default.get(r, "annotations", []);
var i = [];
a.forEach(function(e, t) {
if (!e.attributes)
return;
a.forEach(function(n, r) {
if (t === r)
return;
if (!n.attributes)
return;
var a = b(e, n);
"left" === a ? "right" === e.attributes.lane_position && "left" === n.attributes.lane_position && i.push(new s.LintDiagnostic("inconsistent-lane-positions[" + t + "-" + r + "]",c,{
message: "There is a left lane to the right of a right lane. This should not happen."
})) : "crossing" === a && t < r
})
});
return i
};
var y = t.lintLineAnnotation = function e(t) {
var n = t.task
, r = t.response;
var i = [];
i.push.apply(i, (0,
a.default)(h({
task: n,
response: r
})));
i.push.apply(i, (0,
a.default)(m({
task: n,
response: r
})));
i.push.apply(i, (0,
a.default)(g({
task: n,
response: r
})));
return i
}
},
227: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
t.lintBoxAnnotation = void 0;
var r = n(84);
var a = u(r);
var i = n(9);
var o = u(i);
var s = n(40);
var l = n(11);
function u(e) {
return e && e.__esModule ? e : {
default: e
}
}
var c = s.lintSeverity.ERROR;
var d = "57fbc670e27e100600947ed7";
var f = "59f11892c11cb20007a6998a";
var p = "5ac2b90b5f9be46c842eefff";
var h = "5a74d68c4f2d42002edd7c5d";
var m = "5ad68137b820884c40decc72";
var v = function e(t) {
var n = t.task
, r = t.response;
if (n.user.toString() !== d)
return [];
if (!n.project || !n.project._id || !o.default.includes(o.default.values(l.CRUISE_EV_PROJECTS), o.default.toString(n.project._id || n.project)))
return [];
var a = o.default.get(r, "annotations", []);
var i = o.default.filter(a, function(e) {
return "emergency vehicle" === e.label
});
if (i.length > 1)
return [new s.LintDiagnostic("too-many-evs",c,{
message: "You labeled multiple emergency vehicles. Please make sure to label only the closest emergency vehicle."
})];
var u = o.default.filter(a, function(e) {
return e.label.startsWith("light bar")
});
if (i.length < u.length)
return [new s.LintDiagnostic("too-many-light-bars",c,{
message: "There are more light bar labels than emergency vehicles. Make sure to only label the top light bar."
})];
return []
};
var b = function e(t) {
var n = t.task
, r = t.response;
if (n.user.toString() !== f)
return [];
if (!n.project || !n.project._id || n.project._id.toString() !== p)
return [];
var a = o.default.get(r, "annotations", []);
var i = o.default.filter(a, function(e) {
return "vehicle_traffic_light_box" === e.label || "bike_pedestrian_traffic_light_box" === e.label
});
if (a.length < 2 * i.length)
return [new s.LintDiagnostic("too-few-lense-boxes",c,{
message: "With every labelled traffic box, be sure to annotate the corresponding at least 50% visible lense. Otherwise, please don't annotate the traffic box."
})];
return []
};
var g = function e(t) {
var n = t.task
, r = t.response;
if (n.user.toString() !== h)
return [];
if (!n.project || !n.project._id || n.project._id.toString() !== m)
return [];
var a = o.default.get(r, "annotations", []);
var i = o.default.filter(a, function(e) {
return e.width < 15 && e.height < 15 && "DontCare" !== e.label
});
if (i.length > 0)
return [new s.LintDiagnostic("too-small-box-dont-care",c,{
message: 'For boxes that are smaller than 15px by 15px, please use the "DontCare" label.'
})];
return []
};
var y = function e(t) {
var n = t.task
, r = t.response;
if (n.user.toString() !== h)
return [];
if (!n.project || !n.project._id || n.project._id.toString() !== m)
return [];
var a = o.default.get(r, "annotations", []);
var i = o.default.get(n, "params.image_width");
var l = o.default.get(n, "params.image_height");
var u = o.default.filter(a, function(e) {
return "0%-20%" !== o.default.get(e, "attributes.truncated", "0%-20%") && e.left >= 3 && e.top >= 3 && e.left + e.width < i - 3 && e.top + e.height < l - 3
});
if (u.length > 0)
return [new s.LintDiagnostic("truncation-in-mid-image",c,{
message: "For boxes that are in the middle of the image, the truncation should be 0-20%."
})];
return []
};
var x = t.lintBoxAnnotation = function e(t) {
var n = t.task
, r = t.response;
var i = [];
i.push.apply(i, (0,
a.default)(v({
task: n,
response: r
})));
i.push.apply(i, (0,
a.default)(b({
task: n,
response: r
})));
i.push.apply(i, (0,
a.default)(g({
task: n,
response: r
})));
i.push.apply(i, (0,
a.default)(y({
task: n,
response: r
})));
return i
}
},
228: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
t.lintCuboidAnnotation = void 0;
var r = n(84);
var a = c(r);
var i = n(46);
var o = c(i);
var s = n(9);
var l = c(s);
var u = n(40);
function c(e) {
return e && e.__esModule ? e : {
default: e
}
}
var d = u.lintSeverity.ERROR
, f = u.lintSeverity.WARNING;
var p = "59d28a313c09770007aec417";
var h = 75;
var m = function e(t) {
var n = t.task
, r = t.response;
if (n.user.toString() !== p)
return [];
var a = [];
var i = 0;
var s = true;
var c = false;
var m = void 0;
try {
for (var v = (0,
o.default)(l.default.get(r, "annotations", [])), b; !(s = (b = v.next()).done); s = true) {
var g = b.value;
var y = g.edges;
var x = void 0
, w = void 0;
var k = true;
var j = false;
var E = void 0;
try {
for (var _ = (0,
o.default)(y), S; !(k = (S = _.next()).done); k = true) {
var C = S.value;
"side-top" === C.description && (x = C);
"side-bottom" === C.description && (w = C)
}
} catch (e) {
j = true;
E = e
} finally {
try {
!k && _.return && _.return()
} finally {
if (j)
throw E
}
}
if (!x && !w)
continue;
if (!x || !w)
continue;
var P = x.x1;
var O = x.y1;
var A = x.x2;
var M = x.y2;
var I = w.x1;
var L = w.y1;
var T = w.x2;
var R = w.y2;
var F = (R - L) * (A - P) - (T - I) * (M - O);
if (F <= 1e-7 && F >= -1e-7) {
i += 1;
continue
}
var N = ((T - I) * (O - L) - (R - L) * (P - I)) / F;
var D = O + N * (M - O);
a.push(D)
}
} catch (e) {
c = true;
m = e
} finally {
try {
!s && v.return && v.return()
} finally {
if (c)
throw m
}
}
if (i > 0) {
var z = void 0;
z = 1 === i ? "There is 1 cuboid with no vanishing point. Please read the instructions more carefully." : "There are " + i + " cuboids with no vanishing point. Please read the instructions more carefully.";
return [new u.LintDiagnostic("no-vanishing-point",d,{
message: z
})]
}
var B = l.default.max(a) - l.default.min(a);
if (B >= h)
return [new u.LintDiagnostic("no-vanishing-line",f,{
message: "There were vanishing points which did not lie on the vanishing point line. Please read the instructions more carefully."
})];
return []
};
var v = t.lintCuboidAnnotation = function e(t) {
var n = t.task
, r = t.response;
var i = [];
i.push.apply(i, (0,
a.default)(m({
task: n,
response: r
})));
return i
}
},
229: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
t.lintTranscription = void 0;
var r = n(84);
var a = c(r);
var i = n(46);
var o = c(i);
var s = n(9);
var l = c(s);
var u = n(40);
function c(e) {
return e && e.__esModule ? e : {
default: e
}
}
var d = u.lintSeverity.ERROR;
var f = "5b1059fea2a93f002e8e0b76";
var p = function e(t) {
var n = t.task
, r = t.response;
if (n.user.toString() !== f)
return [];
var a = l.default.get(r, "repeatable_fields", []);
if (a.length > 3)
return [new u.LintDiagnostic("too-many-categories",d,{
message: "You labeled more than three room labels. Please only select up to three room labels."
})];
return []
};
var h = function e(t) {
var n = t.task
, r = t.response;
if (n.user.toString() !== f)
return [];
var a = [];
var i = false;
var s = true;
var c = false;
var p = void 0;
try {
for (var h = (0,
o.default)(l.default.get(r, "repeatable_fields", [])), m; !(s = (m = h.next()).done); s = true) {
var v = m.value;
var b = l.default.get(v, "title", []);
a.includes(b) && (i = true);
a.push(b)
}
} catch (e) {
c = true;
p = e
} finally {
try {
!s && h.return && h.return()
} finally {
if (c)
throw p
}
}
if (i)
return [new u.LintDiagnostic("category-label-repeat",d,{
message: "You repeated the same room category label. Please use each room category label once."
})];
return []
};
var m = t.lintTranscription = function e(t) {
var n = t.task
, r = t.response;
var i = [];
i.push.apply(i, (0,
a.default)(p({
task: n,
response: r
})));
i.push.apply(i, (0,
a.default)(h({
task: n,
response: r
})));
return i
}
},
231: function(e, t, n) {
"use strict";
Object["defineProperty"](t, "__esModule", {
value: !![]
});
t["getGapSummary"] = d;
t["numberOfPointsInCuboid"] = f;
t["isGap"] = p;
t["timeTravelingIsGap"] = h;
var r = n(9);
var a = i(r);
function i(e) {
return e && e["__esModule"] ? e : {
default: e
}
}
var o = "59f9fa67b9ad8e0007866a85";
var s = "594ab13cf54210060008fb06";
var l = "57fbc670e27e100600947ed7";
var u = "59f11892c11cb20007a6998a";
var c = "59c409466989a20007b2ab99";
function d(e) {
var t = {
PsvGw: "frames",
OnMhc: "cuboidId"
};
var n = function e(n) {
return a["default"]["pick"](n, ["cuboidId", t["PsvGw"], "numbersOfPoints"])
};
return a["default"]["keyBy"](e["map"](n), t["OnMhc"])
}
function f(e) {
var t = e["cuboidId"]
, n = e["frame"]
, r = e["gaps"];
var i = r[t];
var o = a["default"]["findIndex"](i["frames"], function(e) {
return e === n
});
if (-1 === o)
return -1;
return i["numbersOfPoints"][o]
}
function p(e) {
var t = {
IhTPb: function(e, t) {
return e === t
},
WyBnx: function(e, t) {
return e(t)
},
OiuzH: function(e, t) {
return e === t
},
SyrSt: function(e, t) {
return e === t
},
FjDCh: function(e, t) {
return e === t
},
pWihZ: function(e, t) {
return e + t
}
};
var n = e["cuboidId"]
, r = e["numFrames"]
, i = e["frame"]
, d = e["gaps"]
, p = e["customerId"]
, h = e["cuboidFrames"];
if (!d)
return ![];
var m = d[n];
if (!m)
return ![];
var v = t["WyBnx"](f, {
cuboidId: n,
frame: i,
gaps: d
});
if (t["IhTPb"](p, u))
return 0 === v;
if (t["OiuzH"](m["frames"]["length"], r))
return !![];
if (t["OiuzH"](p, l))
return ![];
if (-1 === v)
return ![];
if (a["default"]["includes"]([o, s], p))
return t["SyrSt"](v, 0);
if (t["FjDCh"](p, c)) {
var b = a["default"]["range"](i + 1, t["pWihZ"](i, 4))["filter"](function(e) {
return a["default"]["includes"](h, e)
});
var g = a["default"]["some"](b, function(e) {
return t["IhTPb"](t["WyBnx"](f, {
cuboidId: n,
frame: e,
gaps: d
}), -1)
});
return !g
}
return !![]
}
function h(e) {
var t = {
wtBqZ: function(e, t) {
return e === t
},
PMCYD: function(e, t) {
return e(t)
},
ZsSDw: function(e, t) {
return e(t)
},
EtbEC: function(e, t) {
return e > t
},
voAuJ: "2018-04-30 21:22 GMT-3",
IbTbX: function(e, t) {
return e === t
},
zZqpr: function(e, t) {
return e === t
},
mKgSL: function(e, t) {
return e + t
},
bWbPo: function(e, t) {
return e === t
},
XySmF: "594ab13cf54210060008fb06",
iVXMY: function(e, t) {
return e === t
},
EmbTn: "2018-06-06 12:08 GMT-3"
};
var n = e["cuboidId"]
, r = e["numFrames"]
, i = e["frame"]
, o = e["gaps"]
, s = e["customerId"]
, l = e["cuboidFrames"]
, u = e["date"];
if (!o)
return ![];
if (!o[n])
return ![];
var c = o[n];
var d = t["ZsSDw"](f, {
cuboidId: n,
frame: i,
gaps: o
});
if (t["EtbEC"](u, new Date(t["voAuJ"])) && "59f11892c11cb20007a6998a" === s)
return t["IbTbX"](d, 0);
if (t["zZqpr"](s, "59c409466989a20007b2ab99")) {
var p = a["default"]["range"](i + 1, t["mKgSL"](i, 4))["filter"](function(e) {
return a["default"]["includes"](l, e)
});
var h = a["default"]["some"](p, function(e) {
return t["wtBqZ"](t["PMCYD"](f, {
cuboidId: n,
frame: e,
gaps: o
}), -1)
});
return !h
}
if (c["frames"]["length"] === r)
return !![];
if (t["zZqpr"](s, "57fbc670e27e100600947ed7"))
return ![];
if (t["bWbPo"](d, -1))
return ![];
if (s === t["XySmF"] || t["iVXMY"](s, "59f9fa67b9ad8e0007866a85") && t["EtbEC"](u, new Date(t["EmbTn"])))
return 0 === d;
return !![]
}
},
233: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
t.createWorldToCamera = o;
t.createCameraToProjection = s;
t.distortPoint = u;
t.distortPointIsGood = c;
var r = n(39);
var a = i(r);
function i(e) {
if (e && e.__esModule)
return e;
var t = {};
if (null != e)
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]);
t.default = e;
return t
}
function o(e, t) {
var n = new a.Vector3(e.x,e.y,e.z);
var r = new a.Quaternion(t.x,t.y,t.z,t.w);
var i = new a.Matrix4;
var o = new a.Matrix4;
var s = new a.Matrix4;
r.inverse();
n.multiplyScalar(-1);
i.makeTranslation(n.x, n.y, n.z);
o.makeRotationFromQuaternion(r);
s.multiplyMatrices(o, i);
return s
}
function s(e, t, n, r, i) {
var o = new a.Matrix4;
o.set(e, i, n, 0, 0, t, r, 0, 0, 0, 0, 0, 0, 0, 1, 0);
return o
}
function l(e, t) {
var n = new a.Vector4(e.x,e.y,e.z,e.w);
var r = n.x / n.w;
var i = n.y / n.w;
var o = t.cx;
var s = t.cy;
var l = r - o;
var u = i - s;
var c = l / t.fx;
var d = u / t.fy;
var f = c * c + d * d;
var p = t.k1 || 0
, h = t.k2 || 0
, m = t.k3 || 0
, v = t.p1 || 0
, b = t.p2 || 0;
var g = f * (p + f * (h + f * m));
n.x = r + t.fx * (c * g + v * (f + 2 * c * c) + 2 * b * c * d);
n.y = i + t.fy * (d * g + b * (f + 2 * d * d) + 2 * v * c * d);
n.x *= n.w;
n.y *= n.w;
return {
p: n,
radDistFac: g,
rSq: f
}
}
function u(e, t) {
var n = l(e, t)
, r = n.p;
return r
}
function c(e, t) {
var n = e.x / e.w;
var r = e.y / e.w;
var a = (n - t.cx) / t.fx;
var i = (r - t.cy) / t.fy;
var o = t.k1 || 0
, s = t.k2 || 0;
var l = 9 * Math.pow(o, 2) - 20 * s;
if (l > 0) {
var u = (-3 * o - Math.sqrt(l)) / (20 * s);
var c = (-3 * o + Math.sqrt(l)) / (20 * s);
var d = Math.sqrt(u > 0 ? u : c);
if (Math.abs(a) > d || Math.abs(i) > d)
return false
}
var f = Math.pow(Math.max(-o, 0), 2);
var p = 1;
var h = 8;
return Math.abs(a) < p + h * f && Math.abs(i) < p + h * f
}
},
234: function(e, t, n) {
"use strict";
Object["defineProperty"](t, "__esModule", {
value: !![]
});
t["numberOfPointsBorderingCuboid"] = t["numberOfPointsInCuboid"] = void 0;
var r = n(194);
var a = u(r);
t["filterByCuboid"] = c;
t["transformByCuboid"] = m;
var i = n(534);
var o = u(i);
var s = n(340);
var l = n(341);
function u(e) {
return e && e["__esModule"] ? e : {
default: e
}
}
function c(e, t) {
var n = (0,
s["getBuckets"])(e["position"], e["dimensions"]);
var r = t["query"](n);
return r
}
var d = (0,
l["memoize"])(function(e) {
var t = {
VHJMw: function(e, t) {
return e + t
},
zORWq: "return "
};
return new Function(t["VHJMw"](t["zORWq"], e))()
});
function f() {
var e = {
sgudR: "experimental-webgl",
OZwfE: "webgl"
};
if ("undefined" !== typeof document) {
var t = document["createElement"]("canvas");
if (!t["getContext"]("webgl2") && (t["getContext"]("webgl") || t["getContext"](e["sgudR"])))
return new o["default"]({
mode: e["OZwfE"]
})
}
return new o["default"]
}
var p = f();
function h(e, t) {
var n = {
Xanjl: function(e, t) {
return e < t
},
DFTlg: function(e, t) {
return e !== t
},
piKVE: function(e, t) {
return e === t
},
BPXVN: function(e, t) {
return e !== t
},
XnMTJ: "undefined",
Ckskk: "1|3|2|6|4|5|0",
LKLcM: "canvas",
RTZTF: "gpujs",
igQsI: "webgl2"
};
var r = arguments["length"] > 2 && n["DFTlg"](arguments[2], void 0) ? arguments[2] : {}
, a = r["shouldUseGPU"]
, i = n["piKVE"](a, void 0) ? ![] : a
, o = r["fn"]
, s = void 0 === o ? d(e) : o;
if (i)
try {
return p["createKernel"](e, t)
} catch (e) {
if (n["BPXVN"](typeof window, n["XnMTJ"]) && window["Raven"]) {
var l = n["Ckskk"]["split"]("|")
, u = 0;
while (!![]) {
switch (l[u++]) {
case "0":
window["Raven"]["captureException"](e, {
extra: v
});
continue;
case "1":
var c = document["createElement"](n["LKLcM"]);
continue;
case "2":
var f = !!window["WebGLRenderingContext"];
continue;
case "3":
var h = c["getContext"]("webgl");
continue;
case "4":
var m = !!window["WebGL2RenderingContext"];
continue;
case "5":
var v = {
errorType: n["RTZTF"],
params: t,
hasWebGL: h,
hasWebGL2: b,
hasWebGLRenderingContext: f,
hasWebGL2RenderingContext: m
};
continue;
case "6":
var b = c["getContext"](n["igQsI"]);
continue
}
break
}
}
}
var g = t["output"][0];
return function() {
for (var e = arguments["length"], r = Array(e), a = 0; n["Xanjl"](a, e); a++)
r[a] = arguments[a];
var i = new Float32Array(g);
for (var o = 0; o < g; o += 1)
i[o] = s["apply"]({
thread: {
x: o
},
constants: t["constants"]
}, r);
return i
}
}
function m(e, t) {
var n = {
WIsWr: "function(ar, cx, cy, cz, cos, sin) {\n const i = Math.floor(this.thread.x / 3);\n const x = ar[3 * i] - cx;\n const y = ar[3 * i + 1] - cy;\n const zz = ar[3 * i + 2] - cz;\n const xx = x * cos + y * sin;\n const yy = -x * sin + y * cos;\n if (this.thread.x % 3 === 0) {\n return xx;\n } else if (this.thread.x % 3 === 1) {\n return yy;\n } else {\n return zz;\n }\n }"
};
var r = "3|1|2|5|4|0|6"["split"]("|")
, a = 0;
while (!![]) {
switch (r[a++]) {
case "0":
var i = o(t, l["x"], l["y"], l["z"], c, u);
continue;
case "1":
var o = h(n["WIsWr"], {
output: [t["length"]]
}, {
shouldUseGPU: t["length"] > 7e4
});
continue;
case "2":
var s = e["yaw"]
, l = e["position"];
continue;
case "3":
if (!t || !t["length"])
return new Float32Array;
continue;
case "4":
var u = Math["sin"](s);
continue;
case "5":
var c = Math["cos"](s);
continue;
case "6":
return i
}
break
}
}
var v = t["numberOfPointsInCuboid"] = (0,
l["memoize"])(function(e, t) {
var n = {
jtydE: function(e, t) {
return e > t
},
BVRhE: function(e, t) {
return e !== t
},
KOPoE: function(e, t) {
return e === t
},
oXZqL: function(e, t, n) {
return e(t, n)
},
VXEyq: function(e, t, n, r) {
return e(t, n, r)
},
bHzCN: function(e, t, n, r, a) {
return e(t, n, r, a)
},
wDGiy: function(e, t) {
return e / t
},
jIYIp: function(e, t) {
return e + t
}
};
var r = n["jtydE"](arguments["length"], 2) && n["BVRhE"](arguments[2], void 0) ? arguments[2] : {}
, i = r["margin"]
, o = void 0 === i ? 0 : i
, s = r["ignoreZ"]
, l = n["KOPoE"](s, void 0) ? ![] : s;
var u = n["oXZqL"](c, e, t);
var d = n["oXZqL"](m, e, u);
if (0 === d["length"])
return 0;
var f = 200;
var p = d["length"] > 7e4;
var v = n["VXEyq"](h, "function(ar, dx, dy, dz) {\n let sum = 0;\n for (let i = 0; i < this.constants.size; i += 3 * this.constants.parallelism) {\n const idx = i + this.thread.x * 3;\n if (\n ar[idx] >= -dx && ar[idx] <= dx &&\n ar[idx + 1] >= -dy && ar[idx + 1] <= dy &&\n ar[idx + 2] >= -dz && ar[idx + 2] <= dz\n ) {\n sum += 1;\n }\n }\n return sum;\n }", {
output: [f],
constants: {
size: d["length"],
parallelism: f
}
}, {
shouldUseGPU: p
});
var b = e["dimensions"];
var g = (0,
a["default"])(n["bHzCN"](v, d, n["wDGiy"](b["x"], 2) + o, n["jIYIp"](b["y"] / 2, o), l ? 20 : n["jIYIp"](n["wDGiy"](b["z"], 2), o)));
return g
});
var b = t["numberOfPointsBorderingCuboid"] = (0,
l["memoize"])(function(e, t) {
var n = {
kvZGI: "5|7|6|2|4|3|1|0",
LvlfD: function(e, t) {
return e / t
},
LKpSN: function(e, t) {
return e / t
},
RsXsv: "function(ar, dx, dy, dz1, dz2) {\n let sum = 0;\n for (let i = 0; i < this.constants.size; i += 3 * this.constants.parallelism) {\n const idx = i + this.thread.x * 3;\n if (\n ar[idx] >= -dx && ar[idx] <= dx &&\n ar[idx + 1] >= -dy && ar[idx + 1] <= dy &&\n ar[idx + 2] >= -dz1 && ar[idx + 2] <= dz2\n ) {\n sum += 1;\n }\n }\n return sum;\n }",
BSgxa: function(e, t) {
return e > t
},
JJdgB: function(e, t) {
return e / t
},
kHqJL: function(e, t) {
return e + t
},
KuYRW: function(e, t, n) {
return e(t, n)
},
cjQND: function(e, t, n) {
return e(t, n)
}
};
var r = n["kvZGI"]["split"]("|")
, i = 0;
while (!![]) {
switch (r[i++]) {
case "0":
return l - o;
case "1":
var o = (0,
a["default"])(s(p, n["LvlfD"](u["x"], 2), n["LKpSN"](u["y"], 2), u["z"] / 2, n["LKpSN"](u["z"], 2)));
continue;
case "2":
var s = h(n["RsXsv"], {
output: [f],
constants: {
size: p["length"],
parallelism: f
}
}, {
shouldUseGPU: n["BSgxa"](p["length"], 7e4)
});
continue;
case "3":
var l = (0,
a["default"])(s(p, u["x"] / 2 + .1, n["JJdgB"](u["y"], 2) + .1, n["JJdgB"](u["z"], 2), n["kHqJL"](u["z"] / 2, .1)));
continue;
case "4":
var u = e["dimensions"];
continue;
case "5":
var d = n["KuYRW"](c, e, t);
continue;
case "6":
var f = 100;
continue;
case "7":
var p = n["cjQND"](m, e, d);
continue
}
break
}
})
},
239: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = n(126);
var a = ee(r);
var i = n(200);
var o = ee(i);
var s = n(128);
var l = ee(s);
var u = n(131);
var c = ee(u);
var d = n(453);
var f = ee(d);
var p = n(14);
var h = ee(p);
var m = n(7);
var v = ee(m);
var b = n(258);
var g = ee(b);
var y = n(22);
var x = ee(y);
var w = n(130);
var k = ee(w);
var j = n(18);
var E = ee(j);
var _ = n(230);
var S = ee(_);
var C = n(209);
var P = ee(C);
var O = n(238);
var A = ee(O);
var M = n(74);
var I = ee(M);
var L = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var r in n)
Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
}
return e
}
;
var T = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var R = n(0);
var F = ee(R);
var N = n(2);
var D = ee(N);
var z = n(8);
var B = ee(z);
var V = n(50);
var W = ee(V);
var U = n(4);
var H = ee(U);
var G = n(78);
var Y = n(132);
var K = n(180);
var Q = ee(K);
var q = n(201);
var Z = ee(q);
var X = n(119);
var J = ee(X);
var $ = n(25);
function ee(e) {
return e && e.__esModule ? e : {
default: e
}
}
function te(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function ne(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
function re(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
var ae = function e(t, n, r, a, i, o, s, l) {
var u = (t - r) * (o - l) - (n - a) * (i - s);
var c = ((t * a - n * r) * (i - s) - (t - r) * (i * l - o * s)) / u;
var d = ((t * a - n * r) * (o - l) - (n - a) * (i * l - o * s)) / u;
return {
x: c,
y: d
}
};
var ie = function e(t, n, r, a) {
var i = ae(t.x, t.y, n.x, n.y, r.x, r.y, a.x, a.y);
var o = (0,
I.default)([t.x, n.x, r.x, a.x])[2]
, s = (0,
I.default)([t.x, n.x, r.x, a.x])[0]
, l = (0,
I.default)([t.y, n.y, r.y, a.y])[2]
, u = (0,
I.default)([t.y, n.y, r.y, a.y])[0];
return i.x < o && i.x > s && i.y < l && i.y > u
};
var oe = G.MaterialA400HexStringOrdered;
var se = [];
var le = function e() {
0 === se.length && (se = oe.slice(0));
return se.shift()
};
var ue = function() {
function e(t) {
re(this, e);
(0,
A.default)(this, t, {
key: W.default.v4(),
lines: [],
attributes: {},
color: le()
})
}
T(e, [{
key: "addLine",
value: function e(t) {
this.lines.push(t);
this.lines = (0,
P.default)(this.lines)
}
}, {
key: "removeLine",
value: function e(t) {
this.lines = (0,
S.default)(this.lines, t)
}
}, {
key: "toObject",
value: function e() {
return {
key: this.key,
color: this.color,
lines: this.lines,
attributes: this.attributes
}
}
}, {
key: "toResponseFormat",
value: function e(t) {
return {
lines: this.lines.map(function(e) {
var n = (0,
E.default)(t, function(t) {
return t.key === e
});
var r = (0,
k.default)(n, ["vertices"]);
r.line_id = e;
return r
}),
attributes: this.attributes
}
}
}, {
key: "hasLine",
value: function e(t) {
return (0,
x.default)(this.lines, t)
}
}]);
return e
}();
var ce = function(e) {
ne(t, e);
function t(e, n) {
re(this, t);
var r = te(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n));
r.state = Object.assign(r.state, {
lanes: r.constructor.makeLanes(e.lanes)
});
(0,
H.default)(r, "onPathClick", "handleChange", "renderLaneLabel");
return r
}
T(t, [{
key: "componentWillReceiveProps",
value: function e(t) {
var n = this;
t.isGrouping && !this.props.isGrouping ? this.setState({
drawState: Y.GROUPING
}) : !t.isGrouping && this.props.isGrouping && this.setState({
drawState: Y.STARTING
});
if (t.lanes !== this.props.lanes) {
this.getCurrentLane() && !(0,
E.default)(t.lanes, function(e) {
return e.key === n.getCurrentLane().key
}) && this.props.handleAnnotationSelect(null);
this.setState({
lanes: t.lanes
})
}
t.paths !== this.props.paths && this.setState({
paths: t.paths
})
}
}, {
key: "getCurrentLane",
value: function e() {
var t = this;
if (this.props.selectedAnnotationId)
return (0,
E.default)(this.state.lanes, function(e) {
return e.key === t.props.selectedAnnotationId
});
return null
}
}, {
key: "strokeForLine",
value: function e(t) {
return (0,
g.default)(this.state.lanes, function(e, n) {
if ((0,
x.default)(n.lines, t.key)) {
if (void 0 !== n.correct)
return n.correct ? "rgba(0, 255, 0, 1)" : "rgba(255, 0, 0, 1)";
return n.color
}
return e
}, this.props.pointFill)
}
}, {
key: "closedPolygonForLane",
value: function e(t, n) {
var r = (0,
v.default)((0,
h.default)(this.state.paths, function(e) {
return (0,
x.default)(t.lines, e.key)
}), function(e) {
return (0,
f.default)(e.vertices, function(e) {
return e.x + "x " + e.y + "y"
})
});
if (2 !== r.length)
return;
var a = r[0][0];
var i = r[0][0]
, o = (0,
c.default)(r[0])
, s = r[1][0]
, u = (0,
c.default)(r[1]);
var d = ie(i, u, o, s)
, p = ie(i, s, o, u);
var m = d && !p || !d && !p && (0,
Y.getDistance)(i, s) + (0,
Y.getDistance)(o, u) < (0,
Y.getDistance)(i, u) + (0,
Y.getDistance)(o, s);
var b = (0,
l.default)(r[0], m ? r[1].reverse() : r[1], a);
return (0,
v.default)(b, function(e) {
return {
x: e.x * n,
y: e.y * n
}
})
}
}, {
key: "setSelectedPathId",
value: function e() {
return
}
}, {
key: "makeLane",
value: function e(t) {
var n = this;
var r = new ue({
lines: t
});
var a = (0,
o.default)((0,
l.default)(this.state.lanes, [r]));
this.setState({
lanes: a
}, function() {
n.handleChange();
n.props.handleAnnotationSelect(r.key)
})
}
}, {
key: "startNewLane",
value: function e(t) {
this.makeLane([t])
}
}, {
key: "updateImage",
value: function e() {
var t = this.sourceImage;
this.setState({
imageWidth: t.naturalWidth,
imageHeight: t.naturalHeight
})
}
}, {
key: "handleChange",
value: function e() {
this.props.onChange && this.props.onChange(this.state.paths, this.state.lanes, this.state.drawState === Y.GROUPING)
}
}, {
key: "handlePathFinish",
value: function e() {
2 === this.state.paths.length && this.makeLane(this.state.paths.map(function(e) {
return e.key
}))
}
}, {
key: "onPathClick",
value: function e(t, n) {
if (this.state.drawState === Y.GROUPING)
if (this.getCurrentLane())
if (this.getCurrentLane().hasLine(n)) {
this.getCurrentLane().removeLine(n);
0 === this.getCurrentLane().lines.length ? this.props.deleteLaneHandler(null, this.getCurrentLane().key) : this.handleChange()
} else if (2 === this.getCurrentLane().lines.length)
this.startNewLane(n);
else {
this.getCurrentLane().addLine(n);
this.handleChange()
}
else
this.startNewLane(n)
}
}, {
key: "renderCanvas",
value: function e() {
var t = this.props.readOnly ? {} : {
onMouseDown: this.onCanvasMouseDown,
onMouseMove: this.onCanvasMouseMove,
onMouseUp: this.onCanvasMouseUp,
onClick: this.onCanvasClick
};
return F.default.createElement("svg", L({
id: "image-path-container",
tabIndex: "1",
className: "ImagePathLabeler__canvas",
width: this.imageWidth,
height: this.imageHeight,
style: {
maxWidth: "none"
}
}, t), this.renderLaneShadings(), this.renderLines(), this.renderCurrentPath())
}
}, {
key: "renderLines",
value: function e() {
var t = this;
if (this.props.annotationVisibility < $.AnnotationVisibility.SHOW_PATHS)
return null;
return F.default.createElement("g", {
opacity: (0,
x.default)([Y.STARTING, Y.GROUPING], this.state.drawState) ? 1 : Y.OFF_OPACITY
}, this.state.paths.map(function(e, n) {
return F.default.createElement(Z.default, {
key: e.key,
keyName: e.key,
showLabels: t.props.annotationVisibility >= $.AnnotationVisibility.SHOW_LABELS,
readOnly: t.props.readOnly,
selectOnly: t.state.drawState === Y.GROUPING,
isWrong: t.props.failedTask && !e.correct,
curve: t.props.curve,
points: e.vertices,
fill: "rgba(0, 0, 0, 0)",
fillWrong: t.props.pathFillWrong,
pointFill: t.strokeForLine(e),
stroke: t.strokeForLine(e),
lineWidth: t.props.lineWidth,
onUpdate: function e(r) {
return t.handlePathUpdate(n, r)
},
onPointAdd: t.handlePointAdd,
onClick: t.onPathClick,
sourceImage: t.sourceImage,
imageBoundingRect: t.sourceImage && t.sourceImage.getBoundingClientRect(),
zoomLevel: t.props.zoomLevel
})
}))
}
}, {
key: "renderLaneLabel",
value: function e(t, n) {
var r = this;
var i = (0,
a.default)((0,
v.default)((0,
h.default)(this.state.paths, function(e) {
return (0,
x.default)(t.lines, e.key)
}), "vertices"));
var o = (0,
D.default)("ImagePathLabeler__label", {
selected: this.props.selectedAnnotationId === t.key
});
return F.default.createElement("div", {
ref: function e(n) {
r.elements[t.key] = n
},
key: t.key,
style: {
position: "absolute",
top: (0,
Y.getCenter)(this.props.zoomLevel, i).y,
left: (0,
Y.getCenter)(this.props.zoomLevel, i).x,
zIndex: 20,
transform: "translate(-50%,-50%)",
display: "flex",
alignItems: "center"
}
}, F.default.createElement("div", {
className: o,
onClick: function e() {
return r.props.handleAnnotationSelect(t.key)
}
}, "Lane ", n + 1), !this.props.readOnly && this.getCurrentLane() === t && F.default.createElement("a", {
className: "ImagePathLabeler__save-link",
onClick: function e() {
return r.props.handleAnnotationSelect(null)
}
}, F.default.createElement(B.default, {
name: "check"
})), !this.props.readOnly && F.default.createElement("a", {
className: "ImagePathLabeler__delete-link",
onClick: function e(n) {
return r.props.deleteLaneHandler(n, t.key)
},
"data-lane-key": t.key
}, F.default.createElement(B.default, {
name: "trash"
})))
}
}, {
key: "renderLaneShadings",
value: function e() {
var t = this;
if (this.props.annotationVisibility < $.AnnotationVisibility.SHOW_PATHS)
return null;
return this.state.lanes.map(function(e) {
var n = e.color;
void 0 !== e.correct && (n = e.correct ? "rgba(0, 255, 0, 1)" : "rgba(255, 0, 0, 1)");
if (2 === e.lines.length) {
var r = t.closedPolygonForLane(e, t.props.zoomLevel);
if (!r)
return null;
return F.default.createElement(J.default, {
key: e.key,
curve: t.props.curve,
points: r,
fill: n,
fillOpacity: "0.2",
stroke: "none",
strokeWidth: "0"
})
}
return null
})
}
}, {
key: "renderLaneLabels",
value: function e() {
if (this.props.annotationVisibility < $.AnnotationVisibility.SHOW_LABELS)
return null;
return F.default.createElement("div", {
className: "ImagePathLabeler__label-container",
style: {
opacity: (0,
x.default)([Y.STARTING, Y.GROUPING], this.state.drawState) ? 1 : Y.OFF_OPACITY
}
}, this.state.lanes.map(this.renderLaneLabel))
}
}, {
key: "renderLineLabels",
value: function e() {
var t = this;
if (this.props.annotationVisibility < $.AnnotationVisibility.SHOW_LABELS)
return null;
if (this.props.readOnly || this.state.drawState !== Y.STARTING)
return null;
var n = (0,
g.default)(this.state.lanes, function(e, t) {
return (0,
l.default)(e, t.lines)
}, []);
var r = this.state.paths.filter(function(e) {
return !(0,
x.default)(n, e.key)
});
return F.default.createElement("div", {
className: "ImagePathLabeler__label-container",
style: {
opacity: this.state.drawState === Y.STARTING ? 1 : Y.OFF_OPACITY
}
}, r.map(function(e) {
return F.default.createElement("div", {
key: e.key,
style: {
position: "absolute",
top: (0,
Y.getCenter)(t.props.zoomLevel, e.vertices).y,
left: (0,
Y.getCenter)(t.props.zoomLevel, e.vertices).x,
zIndex: t.state.drawState === Y.STARTING ? 20 : 0,
transform: "translate(-50%,-50%)"
}
}, F.default.createElement("a", {
className: "ImagePathLabeler__delete-link",
onClick: function n() {
return t.deletePath(e.key)
}
}, F.default.createElement(B.default, {
name: "trash"
})))
}))
}
}, {
key: "render",
value: function e() {
var t = this;
var n = {
width: this.imageWidth ? this.imageWidth + 250 : "auto",
height: this.imageHeight ? this.imageHeight + 300 : "auto"
};
var r = {
maxWidth: "none",
filter: "brightness(" + 100 * this.props.imageBrightness + "%) contrast(" + 100 * this.props.imageContrast + "%)",
width: this.imageWidth,
height: this.imageHeight
};
return F.default.createElement("div", {
className: "ImagePathLabeler",
style: n
}, this.renderStyles(), F.default.createElement("img", {
ref: function e(n) {
t.sourceImage = n
},
style: r,
src: this.props.src,
width: this.imageWidth,
height: this.imageHeight,
onLoad: function e() {
return t.handleImageLoad(true)
},
onError: function e() {
return t.handleImageLoad(false)
}
}), this.renderLaneLabels(), this.renderLineLabels(), this.renderCanvas())
}
}], [{
key: "makeLanes",
value: function e(t) {
return t.map(function(e) {
return new ue(e)
})
}
}]);
return t
}(Q.default);
ce.defaultProps = L({}, Q.default.defaultProps);
t.default = ce
},
240: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
t.LABELING = t.STARTING = t.OFF_OPACITY = void 0;
var r = n(18);
var a = C(r);
var i = n(198);
var o = C(i);
var s = n(138);
var l = C(s);
var u = n(34);
var c = C(u);
var d = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var r in n)
Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
}
return e
}
;
var f = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var p = n(0);
var h = C(p);
var m = n(8);
var v = C(m);
var b = n(4);
var g = C(b);
var y = n(50);
var x = C(y);
var w = n(2);
var k = C(w);
var j = n(319);
var E = C(j);
var _ = n(25);
var S = n(132);
function C(e) {
return e && e.__esModule ? e : {
default: e
}
}
function P(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function O(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function A(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var M = t.OFF_OPACITY = .3;
var I = t.STARTING = 1;
var L = t.LABELING = 2;
var T = function e(t, n, r, a) {
var i = t.x * a;
var o = t.y * a;
if (n - i < 300)
return {
x: i - 16,
y: o,
translate: -1
};
return {
x: i + 16,
y: o,
translate: 0
}
};
var R = function(e) {
A(t, e);
function t(e, n) {
P(this, t);
var r = O(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n));
if (!e.src)
throw new Error("No image source was defined.");
r.state = {
points: r.props.points,
drawState: I,
nextPoint: null,
focusedAnnotationId: null
};
(0,
g.default)(r, "updateImage", "onKeyDown", "finishPoint", "reset", "onMouseDown", "onMouseMove", "onMouseUp", "onClick", "handleMouseEnter", "handleMouseLeave", "handleChange", "handleImageLoad", "handlePointUpdate", "mouseEventToPoint");
return r
}
f(t, [{
key: "componentDidMount",
value: function e() {
window.addEventListener("keydown", this.onKeyDown)
}
}, {
key: "componentWillUnmount",
value: function e() {
window.removeEventListener("keydown", this.onKeyDown)
}
}, {
key: "componentWillReceiveProps",
value: function e(t) {
(0,
c.default)(t.points, this.props.points) || this.setState({
points: t.points
})
}
}, {
key: "updateImage",
value: function e() {
var t = this.sourceImage;
this.setState({
imageWidth: t.clientWidth,
imageHeight: t.clientHeight
})
}
}, {
key: "mouseEventToPoint",
value: function e(t) {
var n = this.sourceImage;
var r = n.getBoundingClientRect();
return {
x: (t.nativeEvent.clientX - r.left) / this.props.zoomLevel,
y: (t.nativeEvent.clientY - r.top) / this.props.zoomLevel
}
}
}, {
key: "onClick",
value: function e(t) {
t.preventDefault();
t.stopPropagation()
}
}, {
key: "onMouseDown",
value: function e(t) {
if (this.state.drawState === I) {
var n = this.mouseEventToPoint(t);
this.setState({
nextPoint: n
}, this.finishPoint)
}
}
}, {
key: "handleImageLoad",
value: function e(t) {
this.props.onLoad && this.props.onLoad(t);
this.updateImage()
}
}, {
key: "handleChange",
value: function e() {
this.props.onChange && this.props.onChange(this.state.points)
}
}, {
key: "handlePointUpdate",
value: function e(t) {
var n = this.state.points.map(function(e) {
return e.key === t.key ? (0,
l.default)(t, {
correct: null
}) : e
});
this.setState({
points: n
}, this.handleChange)
}
}, {
key: "reset",
value: function e() {
this.setState({
nextPoint: null,
drawState: I
})
}
}, {
key: "finishPoint",
value: function e() {
this.props.labels && this.props.labels.length ? 1 === this.props.labels.length ? this.finishPointWithLabel(this.state.nextPoint, (0,
o.default)(this.props.labels)) : this.props.defaultLabel ? this.finishPointWithLabel(this.state.nextPoint, this.props.defaultLabel) : this.setState({
drawState: L
}) : this.finishPointWithLabel(this.state.nextPoint, null)
}
}, {
key: "finishPointWithLabel",
value: function e(t, n) {
var r = this;
this.setState({
points: this.state.points.concat([{
key: x.default.v4(),
x: t.x,
y: t.y,
label: n
}])
}, function() {
r.reset();
r.handleChange();
r.props.resetAnnotationVisibility()
})
}
}, {
key: "handleSelectLabel",
value: function e(t) {
this.state.drawState === L && this.finishPointWithLabel(this.state.nextPoint, t)
}
}, {
key: "deletePoint",
value: function e(t) {
this.setState({
points: this.state.points.filter(function(e) {
return e.key !== t
})
}, this.handleChange)
}
}, {
key: "onKeyDown",
value: function e(t) {
this.state.drawState === I ? "Enter" === t.key && this.props.handleAnnotationSelect(null) : this.state.drawState === L && "Escape" === t.key && this.reset()
}
}, {
key: "onMouseMove",
value: function e() {}
}, {
key: "onMouseUp",
value: function e() {}
}, {
key: "handleMouseEnter",
value: function e(t) {
this.setState(function() {
return {
focusedAnnotationId: t
}
})
}
}, {
key: "handleMouseLeave",
value: function e(t) {
this.setState(function(e) {
if (e.focusedAnnotationId === t)
return {
focusedAnnotationId: null
}
})
}
}, {
key: "renderCurrentPoint",
value: function e() {
var t = this.state.nextPoint;
if (!t)
return null;
return h.default.createElement("g", null, h.default.createElement("circle", {
key: t.x + "," + t.y,
cx: t.x,
cy: t.y,
r: 4,
stroke: "white",
strokeWidth: this.props.lineWidth,
fill: "white",
fillOpacity: this.props.fillOpacity
}))
}
}, {
key: "renderCanvas",
value: function e() {
var t = this;
var n = this.props.readOnly ? {} : {
onMouseDown: this.onMouseDown,
onMouseMove: this.onMouseMove,
onMouseUp: this.onMouseUp,
onClick: this.onClick
};
return h.default.createElement("svg", d({
id: "image-path-container",
tabIndex: "1",
className: "ImagePathLabeler__canvas",
width: this.getImageWidth,
height: this.getImageHeight
}, n), h.default.createElement("g", {
opacity: this.state.drawState === I ? 1 : M
}, this.state.points.map(function(e, n) {
if (t.props.annotationVisibility < _.AnnotationVisibility.SHOW_PATHS)
return null;
return h.default.createElement(E.default, {
key: t.props.readOnly ? e.key || n : e.key,
keyName: e.key,
readOnly: t.props.readOnly,
point: e,
fill: t.props.breakdownColors[e.label] || t.props.pathFill,
fillWrong: t.props.pathFillWrong,
fillOpacity: t.props.fillOpacity,
isWrong: t.props.failedTask && !e.correct,
pointRadius: 6 * t.props.zoomLevel,
lineWidth: t.props.lineWidth,
onUpdate: t.handlePointUpdate,
onPointSelect: t.props.handleAnnotationSelect,
handleMouseEnter: t.handleMouseEnter,
handleMouseLeave: t.handleMouseLeave,
selectedPoint: t.props.selectedAnnotationId,
sourceImage: t.sourceImage,
imageBoundingRect: t.sourceImage && t.sourceImage.getBoundingClientRect(),
zoomLevel: t.props.zoomLevel
})
})), this.renderCurrentPoint())
}
}, {
key: "renderLabel",
value: function e(t, n) {
var r = this;
var a = T(t, this.getImageWidth, this.getImageHeight, this.props.zoomLevel);
return h.default.createElement("div", {
key: (n ? "selected-" : "focused-") + t.key,
style: {
position: "absolute",
top: a.y,
left: a.x,
whiteSpace: "nowrap",
zIndex: 30,
transform: "translate(" + 100 * a.translate + "%, -50%)"
}
}, !!t.label && h.default.createElement("span", {
className: (0,
k.default)("ImagePathLabeler__label", {
selected: n
})
}, t.label), this.props.readOnly ? null : h.default.createElement("a", {
className: "ImagePathLabeler__delete-link",
onClick: function e() {
return r.deletePoint(t.key)
}
}, h.default.createElement(v.default, {
name: "trash"
})))
}
}, {
key: "renderLabels",
value: function e() {
var t = this;
if (this.props.annotationVisibility < _.AnnotationVisibility.SHOW_PATHS)
return null;
if (!this.props.selectedAnnotationId && !this.state.focusedAnnotationId)
return null;
var n = (0,
a.default)(this.state.points, function(e) {
return e.key === t.props.selectedAnnotationId
});
var r = (0,
a.default)(this.state.points, function(e) {
return e.key === t.state.focusedAnnotationId
});
return h.default.createElement("div", {
className: "ImagePathLabeler__label-container",
style: {
height: this.getImageHeight,
width: this.getImageWidth,
opacity: this.state.drawState === I ? 1 : M
}
}, n && this.renderLabel(n, true), !n && r && this.renderLabel(r, false, true))
}
}, {
key: "renderLabelSelector",
value: function e() {
var t = this;
if (this.props.readOnly || this.state.drawState !== L)
return null;
var n = T(this.state.nextPoint, this.getImageWidth, this.getImageHeight, this.props.zoomLevel);
return h.default.createElement("div", {
className: "ImagePathLabeler__label-container",
style: {
top: n.y,
left: n.x,
transform: "translate(" + 50 * n.translate + "%, -50%)"
}
}, this.props.labels.map(function(e) {
return h.default.createElement("div", {
key: e,
onClick: function n() {
return t.handleSelectLabel(e)
},
className: "ImagePathLabeler__label selectable"
}, e)
}))
}
}, {
key: "render",
value: function e() {
var t = this;
var n = {
cursor: "crosshair",
width: this.getImageWidth ? this.getImageWidth : "auto",
height: this.getImageHeight ? this.getImageHeight : "auto",
maxWidth: "none",
filter: "brightness(" + 100 * this.props.imageBrightness + "%) contrast(" + 100 * this.props.imageContrast + "%)"
};
return h.default.createElement("div", {
className: "ImagePathLabeler",
style: n
}, h.default.createElement(S.ImagePathLabelerStyles, null), h.default.createElement("img", {
ref: function e(n) {
t.sourceImage = n
},
style: n,
src: this.props.src,
onLoad: function e() {
return t.handleImageLoad(true)
},
onError: function e() {
return t.handleImageLoad(false)
}
}), this.renderLabels(), this.renderCanvas(), this.renderLabelSelector(), this.props.graftedPaths)
}
}, {
key: "getImageWidth",
get: function e() {
return this.state.imageWidth * this.props.zoomLevel
}
}, {
key: "getImageHeight",
get: function e() {
return this.state.imageHeight * this.props.zoomLevel
}
}]);
return t
}(p.Component);
R.defaultProps = {
zoomLevel: 1,
points: [],
pathFill: "teal",
pathFillWrong: "none",
fillOpacity: .5,
src: null,
labels: null,
breakdownColors: {},
readOnly: false,
failedTask: false,
onChange: null,
style: {}
};
t.default = R
},
241: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var r in n)
Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
}
return e
}
;
var a = n(0);
var i = o(a);
function o(e) {
return e && e.__esModule ? e : {
default: e
}
}
var s = function e(t) {
return i.default.createElement("svg", r({
"data-name": "Layer 1",
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 64 64"
}, t), i.default.createElement("title", null, "Icons 300"), i.default.createElement("path", {
d: "M32.01 8.02a24 24 0 1 1-24 24 24 24 0 0 1 24-24zM21.596 39.594a2.002 2.002 0 0 0 2.83 2.83L32 34.85l7.584 7.585a2.002 2.002 0 0 0 2.83-2.83L34.83 32.02l7.613-7.612a2.002 2.002 0 0 0-2.83-2.83L32 29.19l-7.602-7.602a2.002 2.002 0 0 0-2.83 2.83l7.6 7.603z",
fillRule: "evenodd"
}))
};
t.default = s
},
246: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = n(3);
var a = we(r);
var i = n(99);
var o = we(i);
var s = n(7);
var l = we(s);
var u = n(74);
var c = we(u);
var d = n(58);
var f = we(d);
var p = n(129);
var h = we(p);
var m = n(461);
var v = we(m);
var b = n(81);
var g = we(b);
var y = n(110);
var x = we(y);
var w = n(33);
var k = we(w);
var j = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var E = function e(t, n, r) {
null === t && (t = Function.prototype);
var a = Object.getOwnPropertyDescriptor(t, n);
if (void 0 === a) {
var i = Object.getPrototypeOf(t);
return null === i ? void 0 : e(i, n, r)
}
if ("value"in a)
return a.value;
var o = a.get;
if (void 0 === o)
return;
return o.call(r)
};
var _ = n(1);
var S = we(_);
var C = n(2);
var P = we(C);
var O = n(12);
var A = we(O);
var M = n(47);
var I = we(M);
var L = n(0);
var T = we(L);
var R = n(153);
var F = we(R);
var N = n(10);
var D = we(N);
var z = n(4);
var B = we(z);
var V = n(216);
var W = we(V);
var U = n(11);
var H = n(21);
var G = we(H);
var Y = n(25);
var K = n(20);
var Q = we(K);
var q = n(6);
var Z = we(q);
var X = n(94);
var J = we(X);
var $ = n(35);
var ee = we($);
var te = n(42);
var ne = we(te);
var re = n(43);
var ae = we(re);
var ie = n(83);
var oe = we(ie);
var se = n(93);
var le = we(se);
var ue = n(109);
var ce = we(ue);
var de = n(135);
var fe = we(de);
var pe = n(217);
var he = we(pe);
var me = n(95);
var ve = we(me);
var be = n(122);
var ge = we(be);
var ye = n(155);
var xe = we(ye);
function we(e) {
return e && e.__esModule ? e : {
default: e
}
}
function ke(e) {
return function() {
var t = e.apply(this, arguments);
return new Promise(function(e, n) {
function r(a, i) {
try {
var o = t[a](i);
var s = o.value
} catch (e) {
n(e);
return
}
if (!o.done)
return Promise.resolve(s).then(function(e) {
r("next", e)
}, function(e) {
r("throw", e)
});
e(s)
}
return r("next")
}
)
}
}
function je(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function Ee(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function _e(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var Se = .25;
var Ce = 5;
F.default.setAppElement("undefined" === typeof document ? null : "#__next");
var Pe = function(e) {
_e(t, e);
function t(e) {
je(this, t);
var n = Ee(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
n.updateScroll = function(e) {
n.annotationTaskMedia && n.annotationTaskMedia.updateScroll(e)
}
;
(0,
B.default)(n, "toggleShowingExamples", "hideExamples", "handleAttributesPickerChange", "handleLabelerChange", "submit", "zoomIn", "zoomOut", "zoomReset", "canAddCuboid", "canDeleteCuboid", "cycleSelectedAnnotation");
n.state = n.defaultState;
n.preventAttachmentLoadingFromTakingTooLong();
return n
}
j(t, [{
key: "cycleSelectedAnnotation",
value: function e() {
var t = this;
if (0 === this.state.cuboids.length)
return;
var n = (0,
k.default)(this.state.cuboids, function(e) {
return e.keyName === t.props.selectedAnnotationId
});
var r = n + 1;
r === (0,
x.default)(this.state.cuboids) && (r = 0);
this.props.handleAnnotationSelect(this.state.cuboids[r].keyName)
}
}, {
key: "discardChanges",
value: function e() {
var t = this.props.fixResponse.annotations.map(function(e) {
return xe.default.annotationToCuboid(e)
});
this.setState({
annotations: this.props.fixResponse.annotations,
cuboids: t
})
}
}, {
key: "buildDefaultState",
value: function e() {
return {
startTime: new Date,
noAnnotations: false,
annotations: [],
isSubmittingTask: false,
isAttachmentLoading: true,
minWidth: this.props.params.min_width || 0,
minHeight: this.props.params.min_height || 0,
minAnnotations: this.props.params.min_annotations || 0,
maxAnnotations: this.props.params.max_annotations || 0,
showExamples: false,
scale: 1,
maxAttachmentLoadingTime: (0,
A.default)().add("5", "seconds").toDate(),
practiceData: this.props.isPracticeMode && {},
attributes: this.props.attributeDefinitions
}
}
}, {
key: "componentDidUpdate",
value: function e(n, r) {
E(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "componentDidUpdate", this).call(this, n, r);
n._id !== this.props._id && this.preventAttachmentLoadingFromTakingTooLong()
}
}, {
key: "componentWillUnmount",
value: function e() {
if (this.attachmentTimer) {
clearTimeout(this.attachmentTimer);
this.attachmentTimer = null
}
E(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "componentWillUnmount", this).call(this)
}
}, {
key: "getReviewChanges",
value: function e() {
return {
annotations: this.state.annotations
}
}
}, {
key: "cuboidsAllMinimumSize",
value: function e() {
var t = true;
var n = false;
var r = void 0;
try {
for (var a = this.state.cuboids[Symbol.iterator](), i; !(t = (i = a.next()).done); t = true) {
var o = i.value;
var s = o.face
, l = s.x1
, u = s.x2
, c = s.y1
, d = s.y2;
var f = Math.abs(l - u);
var p = Math.abs(c - d);
if (p < this.state.minHeight || f < this.state.minWidth)
return false
}
} catch (e) {
n = true;
r = e
} finally {
try {
!t && a.return && a.return()
} finally {
if (n)
throw r
}
}
return true
}
}, {
key: "canAddCuboid",
value: function e() {
var t = !this.state.maxAnnotations || this.state.cuboids.length < this.state.maxAnnotations;
t || alert("You have already reached the maximum number of cuboids allowed for this task (" + this.state.maxAnnotations + "). You may adjust the one(s) you already have, but may draw no more.");
return t && this.props.canAddBaseAnnotations
}
}, {
key: "canDeleteCuboid",
value: function e() {
return this.props.canDeleteBaseAnnotations
}
}, {
key: "getPracticeData",
value: function e(t) {
var n = this;
if (!this.props.answer || !this.props.answer.annotations)
return {};
return (0,
v.default)(t, function(e, r) {
e[r.keyName] = !xe.default.isDuplicate(r, t) && xe.default.getCorrectVertices(xe.default.cuboidToAPIValue(r), n.props.answer.annotations)
}, {})
}
}, {
key: "getSubmitDisabledStatus",
value: function e() {
var n = this;
var r = E(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "getSubmitDisabledStatus", this).call(this);
if (!r.canSubmit)
return r;
if (!this.props.isReviewMode && !this.state.noAnnotations && !this.state.annotations.length)
return {
canSubmit: false,
submitTooltip: 'Please draw at least one cuboid or check "No annotations"'
};
if (this.state.minAnnotations && this.state.cuboids.length < this.state.minAnnotations)
return {
canSubmit: false,
submitTooltip: "You drew " + this.state.cuboids.length + " cuboids, but this task requires you to draw at least " + this.state.minAnnotations + " cuboids"
};
if ((0,
h.default)(this.state.cuboids, function(e) {
return !(0,
U.isAnnotationDone)(e, n.props.attributeDefinitions, n.props.params.with_labels)
}))
return {
canSubmit: false,
submitTooltip: "Please make sure every cuboid is fully labeled"
};
var a;
var i;
var o;
false;
return r
}
}, {
key: "getReviewSubmitDisabledStatus",
value: function e() {
var n = E(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "getReviewSubmitDisabledStatus", this).call(this);
if (!n.canSubmit)
return n;
return {
canSubmit: true,
submitTooltip: null
}
}
}, {
key: "preventAttachmentLoadingFromTakingTooLong",
value: function e() {
var t = this;
var n = this.props._id;
this.attachmentTimer = window.setTimeout(function() {
if (!t.state)
return;
var e = n === t.props._id && t.shouldAssumeAttachmentDownloadedEnough;
t.setState({
isAttachmentLoading: !e && t.state.isAttachmentLoading
})
}, 5200)
}
}, {
key: "zoomIn",
value: function e() {
var t = this.state.scale;
t = Math.min(Ce, t + .5);
this.setState({
scale: t
})
}
}, {
key: "zoomOut",
value: function e() {
var t = this.state.scale;
t = Math.max(Se, t - .5);
this.setState({
scale: t
})
}
}, {
key: "zoomReset",
value: function e() {
this.setState({
scale: 1
})
}
}, {
key: "hideExamples",
value: function e() {
this.setState({
showExamples: false
})
}
}, {
key: "toggleShowingExamples",
value: function e() {
this.setState((0,
G.default)("showExamples"))
}
}, {
key: "toggleShowAdjusted",
value: function e() {
var t = this.state.showAdjusted;
this.setState({
showAdjusted: !t
})
}
}, {
key: "sendCompletedTask",
value: function e(t) {
return this.props.onSubmit(this.props.type, {
task_id: this.props._id,
subtaskVersion: this.props.subtaskVersion,
annotations: this.state.annotations,
override: !!this.props.fixResponse,
timeSpentSecs: t / 1e3
})
}
}, {
key: "submit",
value: function e() {
var t = this;
if (this.state.noAnnotations && this.state.annotations.length > 0)
return alert('There are annotations and "No annotations" is checked. To submit this task, either remove the annotations or uncheck "No annotations"');
if (this.state.minAnnotations && this.state.cuboids.length < this.state.minAnnotations)
return alert("You have not reached the minimum number of cuboids for this task (" + this.state.minAnnotations + ")");
if (!this.cuboidsAllMinimumSize())
return alert("Some cuboids are under the minimum size of " + this.state.minWidth + "x" + this.state.minHeight + " pixels. Please remove these cuboids to continue.");
var n = this.taskTimer.elapsedTime();
this.resetTimer();
this.setState({
isSubmittingTask: true
}, ke(a.default.mark(function e() {
return a.default.wrap(function e(r) {
while (1)
switch (r.prev = r.next) {
case 0:
r.prev = 0;
t.closeAllAlerts();
r.next = 4;
return t.sendCompletedTask(n);
case 4:
r.next = 9;
break;
case 6:
r.prev = 6;
r.t0 = r["catch"](0);
t.onSubmitError(r.t0);
case 9:
case "end":
return r.stop()
}
}, e, t, [[0, 6]])
})))
}
}, {
key: "handleAttributesPickerChange",
value: function e(t) {
var n = this;
var r = t.map(function(e) {
return xe.default.cuboidToAPIValue(e)
}).filter(function(e) {
return !!e
});
this.setState({
annotations: r,
cuboids: t
}, function() {
n.props.onChange && n.props.onChange(n.madeChanges)
})
}
}, {
key: "handleLabelerChange",
value: function e(t) {
var n = this;
var r = t.map(function(e) {
return xe.default.cuboidToAPIValue(e)
}).filter(function(e) {
return !!e
});
var a = this.getPracticeData(t);
this.setState({
annotations: r,
cuboids: t,
practiceData: a
}, function() {
n.props.onChange && n.props.onChange(n.madeChanges)
})
}
}, {
key: "renderCuboidLabeler",
value: function e() {
if (this.state.isSubmittingTask)
return;
return T.default.createElement("div", {
className: "labeler-container"
}, this.renderPoints2dToggle(), T.default.createElement("div", {
className: "jsx-2576962528 image-container"
}, T.default.createElement(he.default, {
practiceData: this.state.practiceData,
cuboidsCorrected: this.props.fixResponse && this.props.fixResponse.annotations,
cuboids: this.state.cuboids || [],
isLabelRequired: this.props.params.with_labels,
labels: "58ed4d04612956060087d3d7" === this.props.user ? (0,
c.default)(this.objectsToAnnotate) : this.objectsToAnnotate,
selectedBreakdown: this.props.selectedBreakdown,
breakdownColors: this.props.breakdownColors,
src: this.props.params.attachment,
imageBrightness: this.props.imageBrightness,
imageContrast: this.props.imageContrast,
readOnly: this.props.isReviewMode && !this.props.editable,
showAdjusted: this.state.showAdjusted,
paddingScale: this.props.project && "5adf9ae89ba5657c52f55b34" === this.props.project._id ? 1.5 : void 0,
onUpdate: this.handleLabelerChange,
onLoad: this.didLoadAttachment,
scale: this.state.scale,
minHeight: this.state.minHeight,
minWidth: this.state.minWidth,
showHorizon: this.shouldShowHorizon,
canAddCuboid: this.canAddCuboid,
canDeleteCuboid: this.canDeleteCuboid,
attributeDefinitions: this.state.attributes,
focusedAnnotationId: this.props.focusedAnnotationId,
selectedAnnotationId: this.props.selectedAnnotationId,
handleAnnotationFocus: this.props.handleAnnotationFocus,
handleAnnotationSelect: this.props.handleAnnotationSelect,
annotationVisibility: this.props.annotationVisibility,
resetAnnotationVisibility: this.props.resetAnnotationVisibility,
updateScroll: this.updateScroll
}, this.props.params.layers && this.props.annotationVisibility >= Y.AnnotationVisibility.SHOW_PATHS && T.default.createElement(ce.default, {
zoomLevel: this.state.scale,
layers: this.props.params.layers
})), T.default.createElement(S.default, {
styleId: "2576962528",
css: [".image-container.jsx-2576962528{position:relative;}"]
})))
}
}, {
key: "renderPracticeFeedback",
value: function e() {
var t = (0,
f.default)(this.state.practiceData).filter(function(e) {
return 6 === e.length
});
return T.default.createElement("div", {
style: {
display: "-webkit-box",
webkitBoxAlign: "center",
marginLeft: "20px"
}
}, T.default.createElement("span", null, "The correct answer has ", T.default.createElement("strong", null, this.props.answer.annotations.length), " cuboid annotations."), !!t.length && T.default.createElement("span", null, " You annotated ", T.default.createElement("strong", null, t.length), " correct cuboids."))
}
}, {
key: "renderTaskFooter",
value: function e() {
var t = this;
if (this.props.isReviewMode)
return null;
return T.default.createElement(ae.default, {
toggleShowingInstructions: this.toggleShowingInstructions,
toggleShowingShortcuts: function e() {
return t.shortcuts.toggleShowing()
},
toggleShowingExamples: this.toggleShowingExamples,
timerComponent: this.renderTaskTimer(),
claimTimerComponent: this.renderClaimTimer(),
isSubmittingTask: this.state.isSubmittingTask
}, T.default.createElement("div", {
className: "task-footer__left"
}, this.props.isPracticeMode ? this.renderPracticeFeedback() : null), T.default.createElement("div", {
className: "task-footer__right"
}, !this.props.isPracticeMode && T.default.createElement("div", {
style: {
display: "flex"
}
}, this.renderNoAnnotations(), this.renderSkipButton()), this.props.onSubmit && T.default.createElement(Z.default, {
primary: true,
style: {
marginLeft: "15px"
},
disabled: this.isSubmitDisabled() || this.state.isSubmittingTask,
onClick: this.submit,
tooltip: this.disabledTooltip,
type: "button"
}, this.state.isSubmittingTask ? "Submitting..." : "Submit")))
}
}, {
key: "renderZoomButtons",
value: function e() {
return T.default.createElement("div", {
className: "zoom-components",
key: "ZoomButtons"
}, T.default.createElement(J.default, {
zoomLevel: this.state.scale,
canZoomIn: this.state.scale < Ce,
canZoomOut: this.state.scale > Se,
handleZoomIn: this.zoomIn,
handleZoomOut: this.zoomOut,
handleZoomReset: this.zoomReset
}))
}
}, {
key: "renderSidebar",
value: function e() {
var t = this;
var n = (0,
l.default)(this.state.cuboids, function(e) {
return (0,
o.default)({}, e, {
complete: (0,
U.isAnnotationDone)(e, t.props.attributeDefinitions, t.props.params.with_labels)
})
});
return [this.renderZoomButtons(), this.props.visibilitySelector, T.default.createElement(ve.default, {
key: "ImageAdjustmentControls",
isReadOnly: this.props.isReviewMode && !this.props.editable,
imageBrightness: this.props.imageBrightness,
imageContrast: this.props.imageContrast,
handleBrightnessAdjust: this.props.handleBrightnessAdjust,
handleContrastAdjust: this.props.handleContrastAdjust
}), T.default.createElement(ge.default, {
key: "BreakdownSelector",
attrDefinitions: this.props.attributeDefinitions,
selectedBreakdown: this.props.selectedBreakdown,
handleBreakdownSelect: this.props.handleBreakdownSelect
}), T.default.createElement(fe.default, {
key: "AnnotationSidebar",
annotationObjects: n,
isLabelRequired: this.props.params.with_labels,
defaultLabel: "cuboid",
labelChoices: this.props.params.objects_to_annotate,
breakdownColors: this.props.breakdownColors,
selectedBreakdown: this.props.selectedBreakdown,
attrDefinitions: this.props.attributeDefinitions,
focusedAnnotationId: this.props.focusedAnnotationId,
selectedAnnotationId: this.props.selectedAnnotationId,
handleFocus: this.props.handleAnnotationFocus,
handleSelect: this.props.handleAnnotationSelect,
handleChange: this.handleAttributesPickerChange,
isReadOnly: this.props.isReviewMode && !this.props.editable
})]
}
}, {
key: "renderExamplesModal",
value: function e() {
return T.default.createElement(F.default, {
style: {
overlay: {
backgroundColor: "rgba(0, 0, 0, 0.5)",
zIndex: 1e3
},
content: {
zIndex: 1e3,
margin: "0 auto",
width: "auto",
maxWidth: 780
}
},
isOpen: this.state.showExamples,
onRequestClose: this.hideExamples,
contentLabel: "Examples"
}, T.default.createElement("div", {
onClick: this.hideExamples,
className: "jsx-1744067310 close-instructions-modal-btn"
}, "(ESC) Close Examples"), T.default.createElement("h1", {
className: "jsx-1744067310"
}, "CORRECT Examples of Cuboid Annotations"), T.default.createElement("p", {
className: "jsx-1744067310"
}, T.default.createElement("b", {
className: "jsx-1744067310"
}, "DO"), " draw the cuboid as if you are creating a 3D box. The bottom of the box should look like it is on the surface of the road, the top of the box should look like it is parallel with the surface of the road, and the edges should look like they are perpendicular to the road."), T.default.createElement("img", {
style: {
width: 720
},
src: "https://s3-us-west-2.amazonaws.com/scaleapi-images/cuboid_example_1.png",
className: "jsx-1744067310"
}), T.default.createElement("img", {
style: {
width: 720
},
src: "https://s3-us-west-2.amazonaws.com/scaleapi-images/cuboid_example_2.png",
className: "jsx-1744067310"
}), T.default.createElement("img", {
style: {
width: 720
},
src: "https://s3-us-west-2.amazonaws.com/scaleapi-images/cuboid_example_3.png",
className: "jsx-1744067310"
}), T.default.createElement("img", {
style: {
width: 720
},
src: "https://s3-us-west-2.amazonaws.com/scaleapi-images/cuboid_example_4.png",
className: "jsx-1744067310"
}), T.default.createElement("img", {
style: {
width: 720
},
src: "https://s3-us-west-2.amazonaws.com/scaleapi-images/cuboid_example_5.png",
className: "jsx-1744067310"
}), T.default.createElement("h1", {
className: "jsx-1744067310"
}, "INCORRECT Examples"), T.default.createElement("p", {
className: "jsx-1744067310"
}, T.default.createElement("b", {
className: "jsx-1744067310"
}, "DO NOT"), " make the top of the cuboid follow the top of the vehicle. Draw the top edge as if it were parallel to the road."), T.default.createElement("img", {
style: {
width: 720
},
src: "https://s3-us-west-2.amazonaws.com/scaleapi-images/cuboid_bad_example_1.png",
className: "jsx-1744067310"
}), T.default.createElement("img", {
style: {
width: 720
},
src: "https://s3-us-west-2.amazonaws.com/scaleapi-images/cuboid_bad_example_2.png",
className: "jsx-1744067310"
}), T.default.createElement("div", {
className: "jsx-1744067310 sp__2"
}), T.default.createElement("div", {
onClick: this.hideExamples,
className: "jsx-1744067310 btn o__skinny"
}, "Close"), T.default.createElement(S.default, {
styleId: "1744067310",
css: [".close-instructions-modal-btn.jsx-1744067310{background-color:#26B2C3;border-radius:2px;color:#fff;padding:3px 5px;font-size:16px;position:fixed;top:5px;left:5px;-webkit-box-shadow:0 0 1px #333;box-shadow:0 0 1px #333;}", ".close-instructions-modal-btn.jsx-1744067310:hover{cursor:pointer;background-color:rgb(36,169,185);}"]
}))
}
}, {
key: "renderPoints2dToggle",
value: function e() {
var t = this;
if (!this.props.isReviewMode)
return null;
if (!(0,
g.default)(this.props, ["fixResponse", "annotations", 0, "points_2d"]))
return null;
return T.default.createElement("div", {
className: "jsx-1508370849 points2d-toggle"
}, T.default.createElement("div", {
title: "Keyboard Shortcut: a",
onClick: function e() {
return t.setState({
showAdjusted: false
})
},
className: "jsx-1508370849 " + ((0,
P.default)("toggle-item", {
active: !this.state.showAdjusted
}) || "")
}, "View cuboids as drawn"), T.default.createElement("div", {
title: "Keyboard Shortcut: a",
onClick: function e() {
return t.setState({
showAdjusted: true
})
},
className: "jsx-1508370849 " + ((0,
P.default)("toggle-item", {
active: this.state.showAdjusted
}) || "")
}, "View adjusted cuboids"), T.default.createElement(S.default, {
styleId: "1508370849",
css: [".points2d-toggle.jsx-1508370849{position:absolute;z-index:10;top:12px;left:12px;padding:12px;display:-webkit-box;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".toggle-item.jsx-1508370849{cursor:pointer;border-radius:12px;padding:4px 12px;margin-right:8px;font-size:13px;font-weight:bold;-webkit-transition:0.2s background-color;-webkit-transition:0.2s background-color;transition:0.2s background-color;}", ".toggle-item.jsx-1508370849:hover{background:rgba(0,0,0,0.05);}", ".toggle-item.active.jsx-1508370849{cursor:default;color:white;background:var(--link-color);}"]
}))
}
}, {
key: "render",
value: function e() {
var t = this;
return T.default.createElement("div", {
className: "task o__annotation"
}, !this.props.isPracticeMode && T.default.createElement(ne.default, {
taskId: this.props.id,
isReviewMode: this.props.isReviewMode,
taskDescription: this.taskOverview
}), T.default.createElement(le.default, {
ref: function e(n) {
n && (t.annotationTaskMedia = n)
},
mediaContent: this.renderCuboidLabeler(),
sidebarContent: this.renderSidebar(),
didAttachmentLoad: this.state.attachmentLoadingWasSuccessful,
handleFullyScrolled: this.props.handleFullyScrolled,
zoomLevel: this.props.zoomLevel,
isSubmittingTask: this.state.isSubmittingTask
}), this.renderTaskFooter(), T.default.createElement(D.default, null), this.renderExamplesModal(), this.renderInstructions(), this.renderShortcuts())
}
}, {
key: "taskOverview",
get: function e() {
if (this.props.isReviewMode)
return "Please verify the cuboids.";
return "Please annotate the image with cuboids."
}
}, {
key: "reviewNavigationShortcuts",
get: function e() {
var t = this;
if (!this.props.isReviewMode)
return [];
return [{
trigger: "a",
triggerLabel: T.default.createElement(Q.default, null, "a"),
action: function e() {
t.toggleShowAdjusted()
},
actionLabel: "Toggle Adjusted Cuboids"
}]
}
}, {
key: "navigationShortcutMapping",
get: function e() {
var n = this;
return E(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "navigationShortcutMapping", this).concat(this.props.navigationKeyboardShortcuts).concat(this.reviewNavigationShortcuts).concat([{
trigger: "esc",
triggerLabel: T.default.createElement(Q.default, null, "Esc"),
action: function e() {
n.props.handleAnnotationSelect(null)
},
actionLabel: "Unselect cuboid"
}, {
trigger: ["=", "+"],
triggerLabel: T.default.createElement("span", null, T.default.createElement(Q.default, null, "="), " or ", T.default.createElement(Q.default, null, "+")),
action: function e() {
n.zoomIn()
},
actionLabel: "Zoom in"
}, {
trigger: ["-", "_"],
triggerLabel: T.default.createElement("span", null, T.default.createElement(Q.default, null, "-"), " or ", T.default.createElement(Q.default, null, "_")),
action: function e() {
n.zoomOut()
},
actionLabel: "Zoom out"
}, {
trigger: ["n"],
triggerLabel: T.default.createElement(Q.default, null, "n"),
action: function e() {
n.cycleSelectedAnnotation()
},
actionLabel: "Select next cuboid"
}])
}
}, {
key: "madeChanges",
get: function e() {
return (0,
I.default)(this.state.annotations) !== (0,
I.default)(this.props.baseAnnotations)
}
}, {
key: "defaultState",
get: function e() {
var t = [];
var n = (0,
g.default)(this.props.params, "base_annotations.annotations");
if (this.props.fixResponse && this.props.fixResponse.annotations)
t = this.props.fixResponse.annotations.map(function(e) {
return xe.default.annotationToCuboid(e)
});
else if (this.props.params.hypothesis && this.props.params.hypothesis.annotations)
try {
t = this.props.params.hypothesis.annotations.map(function(e) {
return xe.default.annotationToCuboid(e)
})
} catch (e) {
W.default.trackError(e)
}
else if (n)
try {
t = n.map(function(e) {
return xe.default.annotationToCuboid(e)
})
} catch (e) {
W.default.trackError(e)
}
var r = this.buildDefaultState();
r.cuboids = t;
this.props.isReviewMode && this.props.isSubmittingTask && (r.isSubmittingTask = !!this.props.isSubmittingTask);
return r
}
}, {
key: "shouldAssumeAttachmentDownloadedEnough",
get: function e() {
return new Date > this.state.maxAttachmentLoadingTime
}
}, {
key: "objectsToAnnotate",
get: function e() {
return (0,
U.getAllChoiceDescendants)(this.props.params.objects_to_annotate) || []
}
}, {
key: "shouldShowHorizon",
get: function e() {
return false
}
}]);
return t
}(ee.default);
t.default = (0,
oe.default)(Pe, {
visibilityStates: [Y.AnnotationVisibility.SHOW_PATHS, Y.AnnotationVisibility.SHOW_NONE],
annotationType: ["cuboid", "cuboids"]
})
},
248: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
t.default = r;
function r(e) {
switch (e) {
case "annotation":
return "Box annotation";
case "audiotranscription":
return "Audio Transcription";
case "sensor-fusion":
return "Sensor Fusion";
case "polygonannotation":
return "Polygon Annotation";
case "segmentannotation":
return "Segment annotation";
case "lineannotation":
return "Line annotation";
case "laneannotation":
return "Lane annotation";
case "pointannotation":
return "Point annotation";
case "cuboidannotation":
return "3D Cuboid annotation";
case "boxannotation":
return "2D Box annotation";
case "fixannotation":
return "Single box annotation";
case "categorization":
return "Categorization";
case "datacollection":
return "Data collection";
case "comparison":
return "Comparison";
case "transcription":
return "OCR transcription";
case "imagerecognition":
return "Image recognition";
case "otherannotation":
return "Other annotation";
case "lidarannotation":
return "LIDAR annotation";
case "videoboxannotation":
return "Video box annotation";
case "lidarlinking":
return "Lidar 2D/3D linking";
case "":
return "All";
default:
return e
}
}
},
249: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var a = n(1);
var i = c(a);
var o = n(0);
var s = c(o);
var l = n(4);
var u = c(l);
function c(e) {
return e && e.__esModule ? e : {
default: e
}
}
function d(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function f(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function p(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var h = function(e) {
p(t, e);
function t(e, n) {
d(this, t);
var r = f(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n));
r.state = {
dragStart: null,
dx: 0,
dy: 0
};
(0,
u.default)(r, "onMouseDown", "onMouseMove", "onMouseUp");
return r
}
r(t, [{
key: "componentDidMount",
value: function e() {
window.addEventListener("mousemove", this.onMouseMove);
window.addEventListener("mouseup", this.onMouseUp)
}
}, {
key: "componentWillUnmount",
value: function e() {
window.removeEventListener("mousemove", this.onMouseMove);
window.removeEventListener("mouseup", this.onMouseUp)
}
}, {
key: "onMouseDown",
value: function e(t) {
this.setState({
dragStart: {
x: t.clientX,
y: t.clientY,
originalX: this.props.x,
originalY: this.props.y
}
})
}
}, {
key: "onMouseMove",
value: function e(t) {
if (this.state.dragStart) {
var n = (t.clientX - this.state.dragStart.x) / this.props.scale;
var r = (t.clientY - this.state.dragStart.y) / this.props.scale;
var a = this.state.dragStart.originalX + n;
var i = this.state.dragStart.originalY + r;
this.props.onMove && this.props.onMove({
x: a,
y: i
})
}
}
}, {
key: "onMouseUp",
value: function e() {
this.state.dragStart && this.setState({
dragStart: null,
dx: 0,
dy: 0
})
}
}, {
key: "render",
value: function e() {
var t = (this.props.x + this.state.dx) * this.props.scale;
var n = (this.props.y + this.state.dy) * this.props.scale;
return s.default.createElement("g", {
className: "jsx-535908608 HorizonPointDraggable"
}, s.default.createElement("line", {
x1: 0,
y1: n,
x2: window.innerWidth,
y2: n,
stroke: this.props.stroke,
strokeDasharray: this.props.strokeDasharray,
className: "jsx-535908608"
}), s.default.createElement("circle", {
onMouseDown: this.onMouseDown,
cx: t,
cy: n,
r: this.props.r,
fill: this.props.fill,
stroke: this.props.stroke,
className: "jsx-535908608"
}), s.default.createElement(i.default, {
styleId: "535908608",
css: [".HorizonPointDraggable.jsx-535908608{cursor:move;}", ".HorizonPointDraggable.jsx-535908608 circle.jsx-535908608{-webkit-transition:r 80ms ease-in-out;-webkit-transition:r 80ms ease-in-out;transition:r 80ms ease-in-out;}"]
}))
}
}]);
return t
}(o.PureComponent);
t.default = h;
h.defaultProps = {
x: 0,
y: 0,
r: 4,
scale: 1,
stroke: "white",
fill: "green"
}
},
25: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
t.AnnotationVisibility = void 0;
var r = n(85);
var a = b(r);
var i = n(80);
var o = b(i);
var s = n(48);
var l = b(s);
var u = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var r in n)
Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
}
return e
}
;
t.getAnnotationId = g;
t.getAnnotationText = y;
t.getAnnotationColor = x;
t.convertBoxAnnotations = w;
t.convertAnnotationPaths = k;
t.isAnnotationPathValid = j;
t.getAnnotationPathText = E;
t.getAnnotationPathColor = _;
var c = n(0);
var d = b(c);
var f = n(50);
var p = b(f);
var h = n(166);
var m = b(h);
var v = n(11);
function b(e) {
return e && e.__esModule ? e : {
default: e
}
}
function g(e) {
return e.id || e.keyName || e.key || void 0
}
function y(e, t, n) {
var r = e.label ? e.label : n;
if ("label" === t)
return r;
if ("id" === t) {
var a = g(e).substring(0, 4);
return r + " " + a
}
if (t)
return e.attributes && e.attributes[t] ? e.attributes[t] : d.default.createElement("span", null, "…");
return null
}
function x(e, t, n, r) {
if ("label" === t)
return n[e.label] || r;
if ("id" === t) {
if (e.index)
return n[e.index % v.NUM_DISTINCT_COLORS];
var a = parseInt(g(e).replace("-", ""), 16);
return n[a % v.NUM_DISTINCT_COLORS]
}
if (e.attributes)
return n[e.attributes[t]] || r;
return r
}
function w(e) {
return e.map(function(e) {
var t = (0,
l.default)(e);
t.key = t.key || p.default.v4();
t.x = t.left;
t.y = t.top;
delete t.left;
delete t.top;
return t
})
}
function k(e) {
return e.map(function(e) {
var t = m.default.fromJSON(e);
return {
id: t.annotationId,
label: t.getProp("label"),
frames: (0,
o.default)(t.numFrames).map(function(e) {
return {
id: t.annotationId,
x: t.getProp("left", e),
y: t.getProp("top", e),
height: t.getProp("height", e),
width: t.getProp("width", e)
}
}),
attributes: (0,
o.default)(t.numFrames).map(function(e) {
return t.getProp("attributes", e)
})
}
})
}
function j(e, t) {
var n = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2];
return (0,
a.default)(e.frames, function(r, a) {
return !r || (0,
v.isAnnotationDone)(u({}, r, {
label: e.label,
attributes: e.attributes[a]
}), t, n)
})
}
function E(e, t) {
var n = e.id.substring(0, 4);
var r = e.label || "box";
var a = void 0;
"id" === t ? a = r + " " + n : "label" === t ? a = r : t && (a = e.currentFrame && e.currentFrame.attributes && e.currentFrame.attributes[t]);
a = a || 0 === a && "0" || d.default.createElement("span", null, "…");
return a
}
function _(e, t, n) {
var r = E(e, t, n);
var a = void 0;
a = "id" === t ? n[e.index % n.length] || a : n[r] || "#666";
return a
}
var S = t.AnnotationVisibility = {
SHOW_LABELS: 3,
SHOW_PATHS: 2,
SHOW_NONE: 1
}
},
253: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = n(3);
var a = M(r);
var i = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || false;
r.configurable = true;
"value"in r && (r.writable = true);
Object.defineProperty(e, r.key, r)
}
}
return function(t, n, r) {
n && e(t.prototype, n);
r && e(t, r);
return t
}
}();
var o = function e(t, n, r) {
null === t && (t = Function.prototype);
var a = Object.getOwnPropertyDescriptor(t, n);
if (void 0 === a) {
var i = Object.getPrototypeOf(t);
return null === i ? void 0 : e(i, n, r)
}
if ("value"in a)
return a.value;
var o = a.get;
if (void 0 === o)
return;
return o.call(r)
};
var s = n(1);
var l = M(s);
var u = n(0);
var c = M(u);
var d = n(35);
var f = M(d);
var p = n(4);
var h = M(p);
var m = n(309);
var v = M(m);
var b = n(310);
var g = M(b);
var y = n(10);
var x = M(y);
var w = n(12);
var k = M(w);
var j = n(2);
var E = M(j);
var _ = n(6);
var S = M(_);
var C = n(42);
var P = M(C);
var O = n(43);
var A = M(O);
function M(e) {
return e && e.__esModule ? e : {
default: e
}
}
function I(e) {
return function() {
var t = e.apply(this, arguments);
return new Promise(function(e, n) {
function r(a, i) {
try {
var o = t[a](i);
var s = o.value
} catch (e) {
n(e);
return
}
if (!o.done)
return Promise.resolve(s).then(function(e) {
r("next", e)
}, function(e) {
r("throw", e)
});
e(s)
}
return r("next")
}
)
}
}
function L(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function T(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== typeof t && "function" !== typeof t ? e : t
}
function R(e, t) {
if ("function" !== typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
function F(e) {
var t = []
, n = [];
var r = -1;
for (var a = 0; a < e.length; a += 1)
void 0 === e[a].offset ? t[a] = r : r = a;
r = void 0;
for (var i = e.length - 1; i >= 0; i -= 1)
void 0 === e[i].offset ? n[i] = r : r = i;
e.forEach(function(r, a) {
if (void 0 === r.offset) {
var i = -1 === t[a] ? 0 : e[t[a]].offset;
if (n[a]) {
var o = e[n[a]].offset;
r.offset = (i * (n[a] - a) + o * (a - t[a])) / (n[a] - t[a])
} else
r.offset = i + .3 * (a - t[a]);
e[a] = r
}
});
return e
}
function N(e) {
var t = [];
function n(e) {
return !!e.match(/^[.,:!?]/)
}
e.forEach(function(e) {
n(e.name) && t.length > 0 ? t[t.length - 1].word += e.name : t.push({
word: e.name,
offset: e.time,
confidence: parseFloat(e.confidence)
})
});
return F(t)
}
function D(e, t) {
var n = e.filter(function(e) {
return "not-found-in-audio" === e.case || "success" === e.case
}).map(function(e) {
return {
word: e.word,
offset: "not-found-in-audio" === e.case ? void 0 : e.start
}
});
var r = t && t.transcript;
if (r) {
var a = r.split(" ").filter(function(e) {
return e.length > 0
});
var i = 0;
n = a.map(function(e) {
if (n[i] && -1 !== e.indexOf(n[i].word)) {
var t = n[i].offset;
var r = e;
while (n[i] && -1 !== r.indexOf(n[i].word)) {
r = r.substr(r.indexOf(n[i].word) + n[i].word.length);
i += 1
}
return {
word: e,
offset: t
}
}
if (n[i + 1] && -1 !== e.indexOf(n[i + 1].word)) {
var a = n[i + 1].offset;
i += 2;
return {
word: e,
offset: a
}
}
if (n[i + 2] && -1 !== e.indexOf(n[i + 2].word)) {
var o = n[i + 2].offset;
i += 3;
return {
word: e,
offset: o
}
}
return {
word: e,
offset: void 0
}
})
}
return F(n)
}
function z(e) {
return e.split(" ").map(function(e) {
return {
word: e,
offset: void 0
}
})
}
var B = function(e) {
R(t, e);
function t(e) {
L(this, t);
var n = T(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
(0,
h.default)(n, "pausePlayer", "playPlayer", "focusPlayer", "setAudioPositionWithSeek", "setAudioPosition", "setTranscript", "focusEditor", "loaded", "tab", "submit");
return n
}
i(t, [{
key: "buildDefaultState",
value: function e() {
return {
isSubmittingTask: false,
startTime: new Date,
audioPosition: 0,
transcript: "",
loaded: false
}
}
}, {
key: "getAlignment",
value: function e(t) {
var n = t.fixResponse;
var r = t.audioAlignment;
if (r && r.alignment) {
var a = r.version;
return "speechmatics" === a || a.startsWith("speechmatics") ? N(r.alignment) : ("gentle" === a,
D(r.alignment, n))
}
return n ? z(n.transcript) : []
}
}, {
key: "componentWillMount",
value: function e() {
this.state = this.defaultState
}
}, {
key: "componentWillReceiveProps",
value: function e(n) {
o(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "componentWillReceiveProps", this).call(this, n);
this.props.fixResponse !== n.fixResponse && this.setState({
alignment: this.getAlignment(n)
})
}
}, {
key: "setAudioPositionWithSeek",
value: function e(t) {
this.player && this.player.seekToTime(t);
this.setState({
audioPosition: t
})
}
}, {
key: "setAudioPosition",
value: function e(t) {
this.setState({
audioPosition: t
})
}
}, {
key: "setTranscript",
value: function e(t) {
this.setState({
transcript: t
});
this.props.onChange && this.props.onChange(this.madeChanges)
}
}, {
key: "loaded",
value: function e(t) {
if (!this.state.loaded) {
this.props.attachmentDidLoad && this.props.attachmentDidLoad();
this.setState({
loaded
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment