diff --git a/dist/25.8df17cac035cfb1e39e3.js b/dist/25.2ce3859ad52d843046c8.js similarity index 99% rename from dist/25.8df17cac035cfb1e39e3.js rename to dist/25.2ce3859ad52d843046c8.js index c474d0d8dd..75dbdf96f6 100644 --- a/dist/25.8df17cac035cfb1e39e3.js +++ b/dist/25.2ce3859ad52d843046c8.js @@ -121,6 +121,8 @@ var map = { "./block_dadublock.js": 76201, "./block_dalgona": 7996, "./block_dalgona.js": 7996, + "./block_dalgona_basic": 60996, + "./block_dalgona_basic.js": 60996, "./block_dash": 78165, "./block_dash.js": 78165, "./block_davinci": 82482, diff --git a/dist/entry.js b/dist/entry.js index 5476cd6355..6e05d6a6f8 100644 --- a/dist/entry.js +++ b/dist/entry.js @@ -10400,6 +10400,129 @@ Entry.skeleton.pebble_loop = { }; +/***/ }), + +/***/ 87337: +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +var __values = (undefined && undefined.__values) || function(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +}; +var __read = (undefined && undefined.__read) || function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +}; +var DataStore = /** @class */ (function () { + function DataStore() { + this.dataMap = new Map(); + } + // 데이터 추가 메서드 + DataStore.prototype.add = function (key, value) { + if (!this.dataMap.has(key)) { + this.dataMap.set(key, []); + } + this.dataMap.get(key).push(value); // "!"는 값이 null 또는 undefined가 아님을 나타냅니다. + }; + // 특정 키에 대한 모든 데이터 가져오기 + DataStore.prototype.getAll = function (key) { + return this.dataMap.get(key) || []; + }; + // 특정 키를 제외한 모든 데이터 가져오기 + DataStore.prototype.getAllExcept = function (excludedKey) { + var e_1, _a; + var allData = []; + try { + for (var _b = __values(this.dataMap.entries()), _c = _b.next(); !_c.done; _c = _b.next()) { + var _d = __read(_c.value, 2), key = _d[0], values = _d[1]; + if (key !== excludedKey) { + allData = allData.concat(values); + } + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (_c && !_c.done && (_a = _b.return)) _a.call(_b); + } + finally { if (e_1) throw e_1.error; } + } + return allData; + }; + // 모든 키와 데이터 가져오기 + DataStore.prototype.getAllData = function () { + return Array.from(this.dataMap.entries()); + }; + DataStore.prototype.getAllValues = function () { + var e_2, _a; + var allValues = []; + try { + for (var _b = __values(this.dataMap.values()), _c = _b.next(); !_c.done; _c = _b.next()) { + var values = _c.value; + allValues = allValues.concat(values); + } + } + catch (e_2_1) { e_2 = { error: e_2_1 }; } + finally { + try { + if (_c && !_c.done && (_a = _b.return)) _a.call(_b); + } + finally { if (e_2) throw e_2.error; } + } + return allValues; + }; + // 특정 키의 데이터 삭제하기 + DataStore.prototype.delete = function (key) { + this.dataMap.delete(key); + }; + DataStore.prototype.deleteItemByKeyAndValue = function (key, value) { + var valuesForKey = this.dataMap.get(key); + if (!valuesForKey) { + return false; + } + var index = valuesForKey.indexOf(value); + if (index === -1) { + return false; + } + valuesForKey.splice(index, 1); + if (valuesForKey.length === 0) { + this.dataMap.delete(key); + } + return true; + }; + // 모든 데이터 삭제하기 + DataStore.prototype.clear = function () { + this.dataMap.clear(); + }; + return DataStore; +}()); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DataStore); + + /***/ }), /***/ 69744: @@ -12341,7 +12464,7 @@ var inline_default = /*#__PURE__*/__webpack_require__.n(inline); function Worker_fn() { - return inline_default()("/******/ (() => { // webpackBootstrap\n/******/ \tvar __webpack_modules__ = ({\n\n/***/ 6479:\n/***/ ((module) => {\n\n\"use strict\";\n\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n return arr2;\n}\nmodule.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n/***/ }),\n\n/***/ 7324:\n/***/ ((module) => {\n\n\"use strict\";\n\n\nfunction _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\nmodule.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n/***/ }),\n\n/***/ 2445:\n/***/ ((module) => {\n\n\"use strict\";\n\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}\nmodule.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n/***/ }),\n\n/***/ 8953:\n/***/ ((module) => {\n\n\"use strict\";\n\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\nfunction _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n _next(undefined);\n });\n };\n}\nmodule.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n/***/ }),\n\n/***/ 12:\n/***/ ((module) => {\n\n\"use strict\";\n\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\nmodule.exports = _classCallCheck, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n/***/ }),\n\n/***/ 5832:\n/***/ ((module) => {\n\n\"use strict\";\n\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nmodule.exports = _createClass, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n/***/ }),\n\n/***/ 9587:\n/***/ ((module) => {\n\n\"use strict\";\n\n\nfunction _extends() {\n module.exports = _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n return _extends.apply(this, arguments);\n}\nmodule.exports = _extends, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n/***/ }),\n\n/***/ 4711:\n/***/ ((module) => {\n\n\"use strict\";\n\n\nfunction _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n return _getPrototypeOf(o);\n}\nmodule.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n/***/ }),\n\n/***/ 6598:\n/***/ ((module, __unused_webpack_exports, __webpack_require__) => {\n\n\"use strict\";\n\n\nvar setPrototypeOf = __webpack_require__(4786);\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\nmodule.exports = _inherits, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n/***/ }),\n\n/***/ 1592:\n/***/ ((module) => {\n\n\"use strict\";\n\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\nmodule.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n/***/ }),\n\n/***/ 8858:\n/***/ ((module) => {\n\n\"use strict\";\n\n\nfunction _iterableToArrayLimit(arr, i) {\n var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"];\n if (_i == null) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _s, _e;\n try {\n for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n return _arr;\n}\nmodule.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n/***/ }),\n\n/***/ 1749:\n/***/ ((module) => {\n\n\"use strict\";\n\n\nfunction _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nmodule.exports = _nonIterableRest, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n/***/ }),\n\n/***/ 5311:\n/***/ ((module, __unused_webpack_exports, __webpack_require__) => {\n\n\"use strict\";\n\n\nvar _typeof = (__webpack_require__(9680)[\"default\"]);\nvar assertThisInitialized = __webpack_require__(2445);\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n return assertThisInitialized(self);\n}\nmodule.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n/***/ }),\n\n/***/ 4786:\n/***/ ((module) => {\n\n\"use strict\";\n\n\nfunction _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n return _setPrototypeOf(o, p);\n}\nmodule.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n/***/ }),\n\n/***/ 2764:\n/***/ ((module, __unused_webpack_exports, __webpack_require__) => {\n\n\"use strict\";\n\n\nvar arrayWithHoles = __webpack_require__(7324);\nvar iterableToArrayLimit = __webpack_require__(8858);\nvar unsupportedIterableToArray = __webpack_require__(7863);\nvar nonIterableRest = __webpack_require__(1749);\nfunction _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}\nmodule.exports = _slicedToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n/***/ }),\n\n/***/ 9680:\n/***/ ((module) => {\n\n\"use strict\";\n\n\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(obj);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n/***/ }),\n\n/***/ 7863:\n/***/ ((module, __unused_webpack_exports, __webpack_require__) => {\n\n\"use strict\";\n\n\nvar arrayLikeToArray = __webpack_require__(6479);\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}\nmodule.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n/***/ }),\n\n/***/ 8671:\n/***/ ((module, __unused_webpack_exports, __webpack_require__) => {\n\n\"use strict\";\n\n\nmodule.exports = __webpack_require__(8832);\n\n/***/ }),\n\n/***/ 1679:\n/***/ ((module, exports, __webpack_require__) => {\n\n\"use strict\";\nvar __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;\n\nvar _interopRequireDefault = __webpack_require__(1592);\nvar _regenerator = _interopRequireDefault(__webpack_require__(8671));\nvar _slicedToArray2 = _interopRequireDefault(__webpack_require__(2764));\nvar _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(8953));\nvar _classCallCheck2 = _interopRequireDefault(__webpack_require__(12));\nvar _createClass2 = _interopRequireDefault(__webpack_require__(5832));\nvar _typeof2 = _interopRequireDefault(__webpack_require__(9680));\n/**\n * @license\n * Copyright 2021 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n!function (e, a) {\n \"object\" == ( false ? 0 : (0, _typeof2[\"default\"])(exports)) && \"undefined\" != \"object\" ? a(exports, __webpack_require__(5405), __webpack_require__(4205)) : true ? !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(5405), __webpack_require__(4205)], __WEBPACK_AMD_DEFINE_FACTORY__ = (a),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : 0;\n}(void 0, function (e, a, m) {\n \"use strict\";\n\n var i = {\n 1: {\n name: \"/m/01g317\",\n id: 1,\n displayName: \"person\"\n },\n 2: {\n name: \"/m/0199g\",\n id: 2,\n displayName: \"bicycle\"\n },\n 3: {\n name: \"/m/0k4j\",\n id: 3,\n displayName: \"car\"\n },\n 4: {\n name: \"/m/04_sv\",\n id: 4,\n displayName: \"motorcycle\"\n },\n 5: {\n name: \"/m/05czz6l\",\n id: 5,\n displayName: \"airplane\"\n },\n 6: {\n name: \"/m/01bjv\",\n id: 6,\n displayName: \"bus\"\n },\n 7: {\n name: \"/m/07jdr\",\n id: 7,\n displayName: \"train\"\n },\n 8: {\n name: \"/m/07r04\",\n id: 8,\n displayName: \"truck\"\n },\n 9: {\n name: \"/m/019jd\",\n id: 9,\n displayName: \"boat\"\n },\n 10: {\n name: \"/m/015qff\",\n id: 10,\n displayName: \"traffic light\"\n },\n 11: {\n name: \"/m/01pns0\",\n id: 11,\n displayName: \"fire hydrant\"\n },\n 13: {\n name: \"/m/02pv19\",\n id: 13,\n displayName: \"stop sign\"\n },\n 14: {\n name: \"/m/015qbp\",\n id: 14,\n displayName: \"parking meter\"\n },\n 15: {\n name: \"/m/0cvnqh\",\n id: 15,\n displayName: \"bench\"\n },\n 16: {\n name: \"/m/015p6\",\n id: 16,\n displayName: \"bird\"\n },\n 17: {\n name: \"/m/01yrx\",\n id: 17,\n displayName: \"cat\"\n },\n 18: {\n name: \"/m/0bt9lr\",\n id: 18,\n displayName: \"dog\"\n },\n 19: {\n name: \"/m/03k3r\",\n id: 19,\n displayName: \"horse\"\n },\n 20: {\n name: \"/m/07bgp\",\n id: 20,\n displayName: \"sheep\"\n },\n 21: {\n name: \"/m/01xq0k1\",\n id: 21,\n displayName: \"cow\"\n },\n 22: {\n name: \"/m/0bwd_0j\",\n id: 22,\n displayName: \"elephant\"\n },\n 23: {\n name: \"/m/01dws\",\n id: 23,\n displayName: \"bear\"\n },\n 24: {\n name: \"/m/0898b\",\n id: 24,\n displayName: \"zebra\"\n },\n 25: {\n name: \"/m/03bk1\",\n id: 25,\n displayName: \"giraffe\"\n },\n 27: {\n name: \"/m/01940j\",\n id: 27,\n displayName: \"backpack\"\n },\n 28: {\n name: \"/m/0hnnb\",\n id: 28,\n displayName: \"umbrella\"\n },\n 31: {\n name: \"/m/080hkjn\",\n id: 31,\n displayName: \"handbag\"\n },\n 32: {\n name: \"/m/01rkbr\",\n id: 32,\n displayName: \"tie\"\n },\n 33: {\n name: \"/m/01s55n\",\n id: 33,\n displayName: \"suitcase\"\n },\n 34: {\n name: \"/m/02wmf\",\n id: 34,\n displayName: \"frisbee\"\n },\n 35: {\n name: \"/m/071p9\",\n id: 35,\n displayName: \"skis\"\n },\n 36: {\n name: \"/m/06__v\",\n id: 36,\n displayName: \"snowboard\"\n },\n 37: {\n name: \"/m/018xm\",\n id: 37,\n displayName: \"sports ball\"\n },\n 38: {\n name: \"/m/02zt3\",\n id: 38,\n displayName: \"kite\"\n },\n 39: {\n name: \"/m/03g8mr\",\n id: 39,\n displayName: \"baseball bat\"\n },\n 40: {\n name: \"/m/03grzl\",\n id: 40,\n displayName: \"baseball glove\"\n },\n 41: {\n name: \"/m/06_fw\",\n id: 41,\n displayName: \"skateboard\"\n },\n 42: {\n name: \"/m/019w40\",\n id: 42,\n displayName: \"surfboard\"\n },\n 43: {\n name: \"/m/0dv9c\",\n id: 43,\n displayName: \"tennis racket\"\n },\n 44: {\n name: \"/m/04dr76w\",\n id: 44,\n displayName: \"bottle\"\n },\n 46: {\n name: \"/m/09tvcd\",\n id: 46,\n displayName: \"wine glass\"\n },\n 47: {\n name: \"/m/08gqpm\",\n id: 47,\n displayName: \"cup\"\n },\n 48: {\n name: \"/m/0dt3t\",\n id: 48,\n displayName: \"fork\"\n },\n 49: {\n name: \"/m/04ctx\",\n id: 49,\n displayName: \"knife\"\n },\n 50: {\n name: \"/m/0cmx8\",\n id: 50,\n displayName: \"spoon\"\n },\n 51: {\n name: \"/m/04kkgm\",\n id: 51,\n displayName: \"bowl\"\n },\n 52: {\n name: \"/m/09qck\",\n id: 52,\n displayName: \"banana\"\n },\n 53: {\n name: \"/m/014j1m\",\n id: 53,\n displayName: \"apple\"\n },\n 54: {\n name: \"/m/0l515\",\n id: 54,\n displayName: \"sandwich\"\n },\n 55: {\n name: \"/m/0cyhj_\",\n id: 55,\n displayName: \"orange\"\n },\n 56: {\n name: \"/m/0hkxq\",\n id: 56,\n displayName: \"broccoli\"\n },\n 57: {\n name: \"/m/0fj52s\",\n id: 57,\n displayName: \"carrot\"\n },\n 58: {\n name: \"/m/01b9xk\",\n id: 58,\n displayName: \"hot dog\"\n },\n 59: {\n name: \"/m/0663v\",\n id: 59,\n displayName: \"pizza\"\n },\n 60: {\n name: \"/m/0jy4k\",\n id: 60,\n displayName: \"donut\"\n },\n 61: {\n name: \"/m/0fszt\",\n id: 61,\n displayName: \"cake\"\n },\n 62: {\n name: \"/m/01mzpv\",\n id: 62,\n displayName: \"chair\"\n },\n 63: {\n name: \"/m/02crq1\",\n id: 63,\n displayName: \"couch\"\n },\n 64: {\n name: \"/m/03fp41\",\n id: 64,\n displayName: \"potted plant\"\n },\n 65: {\n name: \"/m/03ssj5\",\n id: 65,\n displayName: \"bed\"\n },\n 67: {\n name: \"/m/04bcr3\",\n id: 67,\n displayName: \"dining table\"\n },\n 70: {\n name: \"/m/09g1w\",\n id: 70,\n displayName: \"toilet\"\n },\n 72: {\n name: \"/m/07c52\",\n id: 72,\n displayName: \"tv\"\n },\n 73: {\n name: \"/m/01c648\",\n id: 73,\n displayName: \"laptop\"\n },\n 74: {\n name: \"/m/020lf\",\n id: 74,\n displayName: \"mouse\"\n },\n 75: {\n name: \"/m/0qjjc\",\n id: 75,\n displayName: \"remote\"\n },\n 76: {\n name: \"/m/01m2v\",\n id: 76,\n displayName: \"keyboard\"\n },\n 77: {\n name: \"/m/050k8\",\n id: 77,\n displayName: \"cell phone\"\n },\n 78: {\n name: \"/m/0fx9l\",\n id: 78,\n displayName: \"microwave\"\n },\n 79: {\n name: \"/m/029bxz\",\n id: 79,\n displayName: \"oven\"\n },\n 80: {\n name: \"/m/01k6s3\",\n id: 80,\n displayName: \"toaster\"\n },\n 81: {\n name: \"/m/0130jx\",\n id: 81,\n displayName: \"sink\"\n },\n 82: {\n name: \"/m/040b_t\",\n id: 82,\n displayName: \"refrigerator\"\n },\n 84: {\n name: \"/m/0bt_c3\",\n id: 84,\n displayName: \"book\"\n },\n 85: {\n name: \"/m/01x3z\",\n id: 85,\n displayName: \"clock\"\n },\n 86: {\n name: \"/m/02s195\",\n id: 86,\n displayName: \"vase\"\n },\n 87: {\n name: \"/m/01lsmm\",\n id: 87,\n displayName: \"scissors\"\n },\n 88: {\n name: \"/m/0kmg4\",\n id: 88,\n displayName: \"teddy bear\"\n },\n 89: {\n name: \"/m/03wvsk\",\n id: 89,\n displayName: \"hair drier\"\n },\n 90: {\n name: \"/m/012xff\",\n id: 90,\n displayName: \"toothbrush\"\n }\n };\n var d = /*#__PURE__*/function () {\n function d(e, a) {\n (0, _classCallCheck2[\"default\"])(this, d);\n this.modelPath = a || \"https://storage.googleapis.com/tfjs-models/savedmodel/\".concat(this.getPrefix(e), \"/model.json\");\n }\n (0, _createClass2[\"default\"])(d, [{\n key: \"getPrefix\",\n value: function getPrefix(e) {\n return \"lite_mobilenet_v2\" === e ? \"ssd\".concat(e) : \"ssd_\".concat(e);\n }\n }, {\n key: \"load\",\n value: function () {\n var _load = (0, _asyncToGenerator2[\"default\"])( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee() {\n var e, i;\n return _regenerator[\"default\"].wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return a.loadGraphModel(this.modelPath);\n case 2:\n this.model = _context.sent;\n e = m.zeros([1, 300, 300, 3], \"int32\");\n _context.next = 6;\n return this.model.executeAsync(e);\n case 6:\n i = _context.sent;\n _context.next = 9;\n return Promise.all(i.map(function (e) {\n return e.data();\n }));\n case 9:\n i.map(function (e) {\n return e.dispose();\n });\n e.dispose();\n case 11:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n function load() {\n return _load.apply(this, arguments);\n }\n return load;\n }()\n }, {\n key: \"infer\",\n value: function () {\n var _infer = (0, _asyncToGenerator2[\"default\"])( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee2(e, a, i) {\n var _d, s, n, l, t, o, _this$calculateMaxSco, _this$calculateMaxSco2, p, r, c, y, N;\n return _regenerator[\"default\"].wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _d = m.tidy(function () {\n return e instanceof m.Tensor || (e = m.browser.fromPixels(e)), m.expandDims(e);\n });\n s = _d.shape[1];\n n = _d.shape[2];\n _context2.next = 5;\n return this.model.executeAsync(_d);\n case 5:\n l = _context2.sent;\n t = l[0].dataSync();\n o = l[1].dataSync();\n _d.dispose(), m.dispose(l);\n _this$calculateMaxSco = this.calculateMaxScores(t, l[0].shape[1], l[0].shape[2]), _this$calculateMaxSco2 = (0, _slicedToArray2[\"default\"])(_this$calculateMaxSco, 2), p = _this$calculateMaxSco2[0], r = _this$calculateMaxSco2[1], c = m.getBackend();\n \"webgl\" === m.getBackend() && m.setBackend(\"cpu\");\n y = m.tidy(function () {\n var e = m.tensor2d(o, [l[1].shape[1], l[1].shape[3]]);\n return m.image.nonMaxSuppression(e, p, a, i, i);\n }), N = y.dataSync();\n return _context2.abrupt(\"return\", (y.dispose(), c !== m.getBackend() && m.setBackend(c), this.buildDetectedObjects(n, s, o, p, N, r)));\n case 13:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n function infer(_x, _x2, _x3) {\n return _infer.apply(this, arguments);\n }\n return infer;\n }()\n }, {\n key: \"buildDetectedObjects\",\n value: function buildDetectedObjects(e, a, m, _d2, s, n) {\n var l = s.length,\n t = [];\n for (var o = 0; o < l; o++) {\n var _l = [];\n for (var _e = 0; _e < 4; _e++) {\n _l[_e] = m[4 * s[o] + _e];\n }\n var p = _l[0] * a,\n r = _l[1] * e,\n c = _l[2] * a,\n y = _l[3] * e;\n _l[0] = r, _l[1] = p, _l[2] = y - r, _l[3] = c - p, t.push({\n bbox: _l,\n \"class\": i[n[s[o]] + 1].displayName,\n score: _d2[s[o]]\n });\n }\n return t;\n }\n }, {\n key: \"calculateMaxScores\",\n value: function calculateMaxScores(e, a, m) {\n var i = [],\n _d3 = [];\n for (var s = 0; s < a; s++) {\n var _a = Number.MIN_VALUE,\n n = -1;\n for (var _i = 0; _i < m; _i++) {\n e[s * m + _i] > _a && (_a = e[s * m + _i], n = _i);\n }\n i[s] = _a, _d3[s] = n;\n }\n return [i, _d3];\n }\n }, {\n key: \"detect\",\n value: function () {\n var _detect = (0, _asyncToGenerator2[\"default\"])( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee3(e) {\n var a,\n m,\n _args3 = arguments;\n return _regenerator[\"default\"].wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n a = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : 20;\n m = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : .5;\n return _context3.abrupt(\"return\", this.infer(e, a, m));\n case 3:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3, this);\n }));\n function detect(_x4) {\n return _detect.apply(this, arguments);\n }\n return detect;\n }()\n }, {\n key: \"dispose\",\n value: function dispose() {\n null != this.model && this.model.dispose();\n }\n }]);\n return d;\n }();\n e.ObjectDetection = d, e.load = /*#__PURE__*/(0, _asyncToGenerator2[\"default\"])( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee4() {\n var e,\n a,\n i,\n s,\n _args4 = arguments;\n return _regenerator[\"default\"].wrap(function _callee4$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n e = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};\n if (!(null == m)) {\n _context4.next = 3;\n break;\n }\n throw new Error(\"Cannot find TensorFlow.js. If you are using a