/******/ (function(modules) { // webpackBootstrap /******/ // install a JSONP callback for chunk loading /******/ function webpackJsonpCallback(data) { /******/ var chunkIds = data[0]; /******/ var moreModules = data[1]; /******/ var executeModules = data[2]; /******/ /******/ // add "moreModules" to the modules object, /******/ // then flag all "chunkIds" as loaded and fire callback /******/ var moduleId, chunkId, i = 0, resolves = []; /******/ for(;i < chunkIds.length; i++) { /******/ chunkId = chunkIds[i]; /******/ if(installedChunks[chunkId]) { /******/ resolves.push(installedChunks[chunkId][0]); /******/ } /******/ installedChunks[chunkId] = 0; /******/ } /******/ for(moduleId in moreModules) { /******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) { /******/ modules[moduleId] = moreModules[moduleId]; /******/ } /******/ } /******/ if(parentJsonpFunction) parentJsonpFunction(data); /******/ /******/ while(resolves.length) { /******/ resolves.shift()(); /******/ } /******/ /******/ // add entry modules from loaded chunk to deferred list /******/ deferredModules.push.apply(deferredModules, executeModules || []); /******/ /******/ // run deferred modules when all chunks ready /******/ return checkDeferredModules(); /******/ }; /******/ function checkDeferredModules() { /******/ var result; /******/ for(var i = 0; i < deferredModules.length; i++) { /******/ var deferredModule = deferredModules[i]; /******/ var fulfilled = true; /******/ for(var j = 1; j < deferredModule.length; j++) { /******/ var depId = deferredModule[j]; /******/ if(installedChunks[depId] !== 0) fulfilled = false; /******/ } /******/ if(fulfilled) { /******/ deferredModules.splice(i--, 1); /******/ result = __webpack_require__(__webpack_require__.s = deferredModule[0]); /******/ } /******/ } /******/ /******/ return result; /******/ } /******/ /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched /******/ // Promise = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ "lib.min": 0 /******/ }; /******/ /******/ var deferredModules = []; /******/ /******/ // script path function /******/ function jsonpScriptSrc(chunkId) { /******/ return __webpack_require__.p + "chunks/" + ({"es-steps":"es-steps"}[chunkId]||chunkId) + ".js" /******/ } /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ // This file contains only the entry chunk. /******/ // The chunk loading function for additional chunks /******/ __webpack_require__.e = function requireEnsure(chunkId) { /******/ var promises = []; /******/ /******/ /******/ // JSONP chunk loading for javascript /******/ /******/ var installedChunkData = installedChunks[chunkId]; /******/ if(installedChunkData !== 0) { // 0 means "already installed". /******/ /******/ // a Promise means "currently loading". /******/ if(installedChunkData) { /******/ promises.push(installedChunkData[2]); /******/ } else { /******/ // setup Promise in chunk cache /******/ var promise = new Promise(function(resolve, reject) { /******/ installedChunkData = installedChunks[chunkId] = [resolve, reject]; /******/ }); /******/ promises.push(installedChunkData[2] = promise); /******/ /******/ // start chunk loading /******/ var script = document.createElement('script'); /******/ var onScriptComplete; /******/ /******/ script.charset = 'utf-8'; /******/ script.timeout = 120; /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } /******/ script.src = jsonpScriptSrc(chunkId); /******/ /******/ // create error before stack unwound to get useful stacktrace later /******/ var error = new Error(); /******/ onScriptComplete = function (event) { /******/ // avoid mem leaks in IE. /******/ script.onerror = script.onload = null; /******/ clearTimeout(timeout); /******/ var chunk = installedChunks[chunkId]; /******/ if(chunk !== 0) { /******/ if(chunk) { /******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); /******/ var realSrc = event && event.target && event.target.src; /******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; /******/ error.type = errorType; /******/ error.request = realSrc; /******/ chunk[1](error); /******/ } /******/ installedChunks[chunkId] = undefined; /******/ } /******/ }; /******/ var timeout = setTimeout(function(){ /******/ onScriptComplete({ type: 'timeout', target: script }); /******/ }, 120000); /******/ script.onerror = script.onload = onScriptComplete; /******/ document.head.appendChild(script); /******/ } /******/ } /******/ return Promise.all(promises); /******/ }; /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ // on error function for async loading /******/ __webpack_require__.oe = function(err) { console.error(err); throw err; }; /******/ /******/ var jsonpArray = window["webpackJsonpGUI"] = window["webpackJsonpGUI"] || []; /******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray); /******/ jsonpArray.push = webpackJsonpCallback; /******/ jsonpArray = jsonpArray.slice(); /******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]); /******/ var parentJsonpFunction = oldJsonpFunction; /******/ /******/ /******/ // run deferred modules from other chunks /******/ checkDeferredModules(); /******/ }) /************************************************************************/ /******/ ({ /***/ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js": /*!**********************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } module.exports = _interopRequireDefault; /***/ }), /***/ "./node_modules/@scratch/paper/dist/paper-full.js": /*!********************************************************!*\ !*** ./node_modules/@scratch/paper/dist/paper-full.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! * Paper.js v0.11.8 - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * * Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * * All rights reserved. * * Date: Thu Dec 20 13:26:52 2018 -0500 * *** * * Straps.js - Class inheritance library with support for bean-style accessors * * Copyright (c) 2006 - 2016 Juerg Lehni * http://scratchdisk.com/ * * Distributed under the MIT license. * *** * * Acorn.js * http://marijnhaverbeke.nl/acorn/ * * Acorn is a tiny, fast JavaScript parser written in JavaScript, * created by Marijn Haverbeke and released under an MIT license. * */ var paper = function(self, undefined) { self = self || __webpack_require__(/*! ./node/self.js */ 8); var window = self.window ? self.window : self, document = self.document; var Base = new function() { var hidden = /^(statics|enumerable|beans|preserve)$/, array = [], slice = array.slice, create = Object.create, describe = Object.getOwnPropertyDescriptor, define = Object.defineProperty, forEach = array.forEach || function(iter, bind) { for (var i = 0, l = this.length; i < l; i++) { iter.call(bind, this[i], i, this); } }, forIn = function(iter, bind) { for (var i in this) { if (this.hasOwnProperty(i)) iter.call(bind, this[i], i, this); } }, set = Object.assign || function(dst) { for (var i = 1, l = arguments.length; i < l; i++) { var src = arguments[i]; for (var key in src) { if (src.hasOwnProperty(key)) dst[key] = src[key]; } } return dst; }, each = function(obj, iter, bind) { if (obj) { var desc = describe(obj, 'length'); (desc && typeof desc.value === 'number' ? forEach : forIn) .call(obj, iter, bind = bind || obj); } return bind; }; function inject(dest, src, enumerable, beans, preserve) { var beansNames = {}; function field(name, val) { val = val || (val = describe(src, name)) && (val.get ? val : val.value); if (typeof val === 'string' && val[0] === '#') val = dest[val.substring(1)] || val; var isFunc = typeof val === 'function', res = val, prev = preserve || isFunc && !val.base ? (val && val.get ? name in dest : dest[name]) : null, bean; if (!preserve || !prev) { if (isFunc && prev) val.base = prev; if (isFunc && beans !== false && (bean = name.match(/^([gs]et|is)(([A-Z])(.*))$/))) beansNames[bean[3].toLowerCase() + bean[4]] = bean[2]; if (!res || isFunc || !res.get || typeof res.get !== 'function' || !Base.isPlainObject(res)) { res = { value: res, writable: true }; } if ((describe(dest, name) || { configurable: true }).configurable) { res.configurable = true; res.enumerable = enumerable != null ? enumerable : !bean; } define(dest, name, res); } } if (src) { for (var name in src) { if (src.hasOwnProperty(name) && !hidden.test(name)) field(name); } for (var name in beansNames) { var part = beansNames[name], set = dest['set' + part], get = dest['get' + part] || set && dest['is' + part]; if (get && (beans === true || get.length === 0)) field(name, { get: get, set: set }); } } return dest; } function Base() { for (var i = 0, l = arguments.length; i < l; i++) { var src = arguments[i]; if (src) set(this, src); } return this; } return inject(Base, { inject: function(src) { if (src) { var statics = src.statics === true ? src : src.statics, beans = src.beans, preserve = src.preserve; if (statics !== src) inject(this.prototype, src, src.enumerable, beans, preserve); inject(this, statics, null, beans, preserve); } for (var i = 1, l = arguments.length; i < l; i++) this.inject(arguments[i]); return this; }, extend: function() { var base = this, ctor, proto; for (var i = 0, obj, l = arguments.length; i < l && !(ctor && proto); i++) { obj = arguments[i]; ctor = ctor || obj.initialize; proto = proto || obj.prototype; } ctor = ctor || function() { base.apply(this, arguments); }; proto = ctor.prototype = proto || create(this.prototype); define(proto, 'constructor', { value: ctor, writable: true, configurable: true }); inject(ctor, this); if (arguments.length) this.inject.apply(ctor, arguments); ctor.base = base; return ctor; } }).inject({ enumerable: false, initialize: Base, set: Base, inject: function() { for (var i = 0, l = arguments.length; i < l; i++) { var src = arguments[i]; if (src) { inject(this, src, src.enumerable, src.beans, src.preserve); } } return this; }, extend: function() { var res = create(this); return res.inject.apply(res, arguments); }, each: function(iter, bind) { return each(this, iter, bind); }, clone: function() { return new this.constructor(this); }, statics: { set: set, each: each, create: create, define: define, describe: describe, clone: function(obj) { return set(new obj.constructor(), obj); }, isPlainObject: function(obj) { var ctor = obj != null && obj.constructor; return ctor && (ctor === Object || ctor === Base || ctor.name === 'Object'); }, pick: function(a, b) { return a !== undefined ? a : b; }, slice: function(list, begin, end) { return slice.call(list, begin, end); } } }); }; if (true) module.exports = Base; Base.inject({ enumerable: false, toString: function() { return this._id != null ? (this._class || 'Object') + (this._name ? " '" + this._name + "'" : ' @' + this._id) : '{ ' + Base.each(this, function(value, key) { if (!/^_/.test(key)) { var type = typeof value; this.push(key + ': ' + (type === 'number' ? Formatter.instance.number(value) : type === 'string' ? "'" + value + "'" : value)); } }, []).join(', ') + ' }'; }, getClassName: function() { return this._class || ''; }, importJSON: function(json) { return Base.importJSON(json, this); }, exportJSON: function(options) { return Base.exportJSON(this, options); }, toJSON: function() { return Base.serialize(this); }, set: function(props, exclude) { if (props) Base.filter(this, props, exclude, this._prioritize); return this; } }, { beans: false, statics: { exports: {}, extend: function extend() { var res = extend.base.apply(this, arguments), name = res.prototype._class; if (name && !Base.exports[name]) Base.exports[name] = res; return res; }, equals: function(obj1, obj2) { if (obj1 === obj2) return true; if (obj1 && obj1.equals) return obj1.equals(obj2); if (obj2 && obj2.equals) return obj2.equals(obj1); if (obj1 && obj2 && typeof obj1 === 'object' && typeof obj2 === 'object') { if (Array.isArray(obj1) && Array.isArray(obj2)) { var length = obj1.length; if (length !== obj2.length) return false; while (length--) { if (!Base.equals(obj1[length], obj2[length])) return false; } } else { var keys = Object.keys(obj1), length = keys.length; if (length !== Object.keys(obj2).length) return false; while (length--) { var key = keys[length]; if (!(obj2.hasOwnProperty(key) && Base.equals(obj1[key], obj2[key]))) return false; } } return true; } return false; }, read: function(list, start, options, amount) { if (this === Base) { var value = this.peek(list, start); list.__index++; return value; } var proto = this.prototype, readIndex = proto._readIndex, begin = start || readIndex && list.__index || 0, length = list.length, obj = list[begin]; amount = amount || length - begin; if (obj instanceof this || options && options.readNull && obj == null && amount <= 1) { if (readIndex) list.__index = begin + 1; return obj && options && options.clone ? obj.clone() : obj; } obj = Base.create(proto); if (readIndex) obj.__read = true; obj = obj.initialize.apply(obj, begin > 0 || begin + amount < length ? Base.slice(list, begin, begin + amount) : list) || obj; if (readIndex) { list.__index = begin + obj.__read; var filtered = obj.__filtered; if (filtered) { list.__filtered = filtered; obj.__filtered = undefined; } obj.__read = undefined; } return obj; }, peek: function(list, start) { return list[list.__index = start || list.__index || 0]; }, remain: function(list) { return list.length - (list.__index || 0); }, readList: function(list, start, options, amount) { var res = [], entry, begin = start || 0, end = amount ? begin + amount : list.length; for (var i = begin; i < end; i++) { res.push(Array.isArray(entry = list[i]) ? this.read(entry, 0, options) : this.read(list, i, options, 1)); } return res; }, readNamed: function(list, name, start, options, amount) { var value = this.getNamed(list, name), hasObject = value !== undefined; if (hasObject) { var filtered = list.__filtered; if (!filtered) { filtered = list.__filtered = Base.create(list[0]); filtered.__unfiltered = list[0]; } filtered[name] = undefined; } var l = hasObject ? [value] : list, res = this.read(l, start, options, amount); return res; }, getNamed: function(list, name) { var arg = list[0]; if (list._hasObject === undefined) list._hasObject = list.length === 1 && Base.isPlainObject(arg); if (list._hasObject) return name ? arg[name] : list.__filtered || arg; }, hasNamed: function(list, name) { return !!this.getNamed(list, name); }, filter: function(dest, source, exclude, prioritize) { var processed; function handleKey(key) { if (!(exclude && key in exclude) && !(processed && key in processed)) { var value = source[key]; if (value !== undefined) dest[key] = value; } } if (prioritize) { var keys = {}; for (var i = 0, key, l = prioritize.length; i < l; i++) { if ((key = prioritize[i]) in source) { handleKey(key); keys[key] = true; } } processed = keys; } Object.keys(source.__unfiltered || source).forEach(handleKey); return dest; }, isPlainValue: function(obj, asString) { return Base.isPlainObject(obj) || Array.isArray(obj) || asString && typeof obj === 'string'; }, serialize: function(obj, options, compact, dictionary) { options = options || {}; var isRoot = !dictionary, res; if (isRoot) { options.formatter = new Formatter(options.precision); dictionary = { length: 0, definitions: {}, references: {}, add: function(item, create) { var id = '#' + item._id, ref = this.references[id]; if (!ref) { this.length++; var res = create.call(item), name = item._class; if (name && res[0] !== name) res.unshift(name); this.definitions[id] = res; ref = this.references[id] = [id]; } return ref; } }; } if (obj && obj._serialize) { res = obj._serialize(options, dictionary); var name = obj._class; if (name && !obj._compactSerialize && (isRoot || !compact) && res[0] !== name) { res.unshift(name); } } else if (Array.isArray(obj)) { res = []; for (var i = 0, l = obj.length; i < l; i++) res[i] = Base.serialize(obj[i], options, compact, dictionary); } else if (Base.isPlainObject(obj)) { res = {}; var keys = Object.keys(obj); for (var i = 0, l = keys.length; i < l; i++) { var key = keys[i]; res[key] = Base.serialize(obj[key], options, compact, dictionary); } } else if (typeof obj === 'number') { res = options.formatter.number(obj, options.precision); } else { res = obj; } return isRoot && dictionary.length > 0 ? [['dictionary', dictionary.definitions], res] : res; }, deserialize: function(json, create, _data, _setDictionary, _isRoot) { var res = json, isFirst = !_data, hasDictionary = isFirst && json && json.length && json[0][0] === 'dictionary'; _data = _data || {}; if (Array.isArray(json)) { var type = json[0], isDictionary = type === 'dictionary'; if (json.length == 1 && /^#/.test(type)) { return _data.dictionary[type]; } type = Base.exports[type]; res = []; for (var i = type ? 1 : 0, l = json.length; i < l; i++) { res.push(Base.deserialize(json[i], create, _data, isDictionary, hasDictionary)); } if (type) { var args = res; if (create) { res = create(type, args, isFirst || _isRoot); } else { res = new type(args); } } } else if (Base.isPlainObject(json)) { res = {}; if (_setDictionary) _data.dictionary = res; for (var key in json) res[key] = Base.deserialize(json[key], create, _data); } return hasDictionary ? res[1] : res; }, exportJSON: function(obj, options) { var json = Base.serialize(obj, options); return options && options.asString == false ? json : JSON.stringify(json); }, importJSON: function(json, target) { return Base.deserialize( typeof json === 'string' ? JSON.parse(json) : json, function(ctor, args, isRoot) { var useTarget = isRoot && target && target.constructor === ctor, obj = useTarget ? target : Base.create(ctor.prototype); if (args.length === 1 && obj instanceof Item && (useTarget || !(obj instanceof Layer))) { var arg = args[0]; if (Base.isPlainObject(arg)) arg.insert = false; } (useTarget ? obj.set : ctor).apply(obj, args); if (useTarget) target = null; return obj; }); }, push: function(list, items) { var itemsLength = items.length; if (itemsLength < 4096) { list.push.apply(list, items); } else { var startLength = list.length; list.length += itemsLength; for (var i = 0; i < itemsLength; i++) { list[startLength + i] = items[i]; } } return list; }, splice: function(list, items, index, remove) { var amount = items && items.length, append = index === undefined; index = append ? list.length : index; if (index > list.length) index = list.length; for (var i = 0; i < amount; i++) items[i]._index = index + i; if (append) { Base.push(list, items); return []; } else { var args = [index, remove]; if (items) Base.push(args, items); var removed = list.splice.apply(list, args); for (var i = 0, l = removed.length; i < l; i++) removed[i]._index = undefined; for (var i = index + amount, l = list.length; i < l; i++) list[i]._index = i; return removed; } }, capitalize: function(str) { return str.replace(/\b[a-z]/g, function(match) { return match.toUpperCase(); }); }, camelize: function(str) { return str.replace(/-(.)/g, function(match, chr) { return chr.toUpperCase(); }); }, hyphenate: function(str) { return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(); } }}); var Emitter = { on: function(type, func) { if (typeof type !== 'string') { Base.each(type, function(value, key) { this.on(key, value); }, this); } else { var types = this._eventTypes, entry = types && types[type], handlers = this._callbacks = this._callbacks || {}; handlers = handlers[type] = handlers[type] || []; if (handlers.indexOf(func) === -1) { handlers.push(func); if (entry && entry.install && handlers.length === 1) entry.install.call(this, type); } } return this; }, off: function(type, func) { if (typeof type !== 'string') { Base.each(type, function(value, key) { this.off(key, value); }, this); return; } var types = this._eventTypes, entry = types && types[type], handlers = this._callbacks && this._callbacks[type], index; if (handlers) { if (!func || (index = handlers.indexOf(func)) !== -1 && handlers.length === 1) { if (entry && entry.uninstall) entry.uninstall.call(this, type); delete this._callbacks[type]; } else if (index !== -1) { handlers.splice(index, 1); } } return this; }, once: function(type, func) { return this.on(type, function() { func.apply(this, arguments); this.off(type, func); }); }, emit: function(type, event) { var handlers = this._callbacks && this._callbacks[type]; if (!handlers) return false; var args = Base.slice(arguments, 1), setTarget = event && event.target && !event.currentTarget; handlers = handlers.slice(); if (setTarget) event.currentTarget = this; for (var i = 0, l = handlers.length; i < l; i++) { if (handlers[i].apply(this, args) == false) { if (event && event.stop) event.stop(); break; } } if (setTarget) delete event.currentTarget; return true; }, responds: function(type) { return !!(this._callbacks && this._callbacks[type]); }, attach: '#on', detach: '#off', fire: '#emit', _installEvents: function(install) { var types = this._eventTypes, handlers = this._callbacks, key = install ? 'install' : 'uninstall'; if (types) { for (var type in handlers) { if (handlers[type].length > 0) { var entry = types[type], func = entry && entry[key]; if (func) func.call(this, type); } } } }, statics: { inject: function inject(src) { var events = src._events; if (events) { var types = {}; Base.each(events, function(entry, key) { var isString = typeof entry === 'string', name = isString ? entry : key, part = Base.capitalize(name), type = name.substring(2).toLowerCase(); types[type] = isString ? {} : entry; name = '_' + name; src['get' + part] = function() { return this[name]; }; src['set' + part] = function(func) { var prev = this[name]; if (prev) this.off(type, prev); if (func) this.on(type, func); this[name] = func; }; }); src._eventTypes = types; } return inject.base.apply(this, arguments); } } }; var PaperScope = Base.extend({ _class: 'PaperScope', initialize: function PaperScope() { paper = this; this.settings = new Base({ applyMatrix: true, insertItems: true, handleSize: 4, hitTolerance: 0 }); this.project = null; this.projects = []; this.tools = []; this._id = PaperScope._id++; PaperScope._scopes[this._id] = this; var proto = PaperScope.prototype; if (!this.support) { var ctx = CanvasProvider.getContext(1, 1) || {}; proto.support = { nativeDash: 'setLineDash' in ctx || 'mozDash' in ctx, nativeBlendModes: BlendMode.nativeModes }; CanvasProvider.release(ctx); } if (!this.agent) { var user = self.navigator.userAgent.toLowerCase(), os = (/(darwin|win|mac|linux|freebsd|sunos)/.exec(user)||[])[0], platform = os === 'darwin' ? 'mac' : os, agent = proto.agent = proto.browser = { platform: platform }; if (platform) agent[platform] = true; user.replace( /(opera|chrome|safari|webkit|firefox|msie|trident|atom|node)\/?\s*([.\d]+)(?:.*version\/([.\d]+))?(?:.*rv\:v?([.\d]+))?/g, function(match, n, v1, v2, rv) { if (!agent.chrome) { var v = n === 'opera' ? v2 : /^(node|trident)$/.test(n) ? rv : v1; agent.version = v; agent.versionNumber = parseFloat(v); n = n === 'trident' ? 'msie' : n; agent.name = n; agent[n] = true; } } ); if (agent.chrome) delete agent.webkit; if (agent.atom) delete agent.chrome; } }, version: "0.11.8", getView: function() { var project = this.project; return project && project._view; }, getPaper: function() { return this; }, execute: function(code, options) { var exports = paper.PaperScript.execute(code, this, options); View.updateFocus(); return exports; }, install: function(scope) { var that = this; Base.each(['project', 'view', 'tool'], function(key) { Base.define(scope, key, { configurable: true, get: function() { return that[key]; } }); }); for (var key in this) if (!/^_/.test(key) && this[key]) scope[key] = this[key]; }, setup: function(element) { paper = this; this.project = new Project(element); return this; }, createCanvas: function(width, height) { return CanvasProvider.getCanvas(width, height); }, activate: function() { paper = this; }, clear: function() { var projects = this.projects, tools = this.tools; for (var i = projects.length - 1; i >= 0; i--) projects[i].remove(); for (var i = tools.length - 1; i >= 0; i--) tools[i].remove(); }, remove: function() { this.clear(); delete PaperScope._scopes[this._id]; }, statics: new function() { function handleAttribute(name) { name += 'Attribute'; return function(el, attr) { return el[name](attr) || el[name]('data-paper-' + attr); }; } return { _scopes: {}, _id: 0, get: function(id) { return this._scopes[id] || null; }, getAttribute: handleAttribute('get'), hasAttribute: handleAttribute('has') }; } }); var PaperScopeItem = Base.extend(Emitter, { initialize: function(activate) { this._scope = paper; this._index = this._scope[this._list].push(this) - 1; if (activate || !this._scope[this._reference]) this.activate(); }, activate: function() { if (!this._scope) return false; var prev = this._scope[this._reference]; if (prev && prev !== this) prev.emit('deactivate'); this._scope[this._reference] = this; this.emit('activate', prev); return true; }, isActive: function() { return this._scope[this._reference] === this; }, remove: function() { if (this._index == null) return false; Base.splice(this._scope[this._list], null, this._index, 1); if (this._scope[this._reference] == this) this._scope[this._reference] = null; this._scope = null; return true; }, getView: function() { return this._scope.getView(); } }); var Formatter = Base.extend({ initialize: function(precision) { this.precision = Base.pick(precision, 5); this.multiplier = Math.pow(10, this.precision); }, number: function(val) { return this.precision < 16 ? Math.round(val * this.multiplier) / this.multiplier : val; }, pair: function(val1, val2, separator) { return this.number(val1) + (separator || ',') + this.number(val2); }, point: function(val, separator) { return this.number(val.x) + (separator || ',') + this.number(val.y); }, size: function(val, separator) { return this.number(val.width) + (separator || ',') + this.number(val.height); }, rectangle: function(val, separator) { return this.point(val, separator) + (separator || ',') + this.size(val, separator); } }); Formatter.instance = new Formatter(); var Numerical = new function() { var abscissas = [ [ 0.5773502691896257645091488], [0,0.7745966692414833770358531], [ 0.3399810435848562648026658,0.8611363115940525752239465], [0,0.5384693101056830910363144,0.9061798459386639927976269], [ 0.2386191860831969086305017,0.6612093864662645136613996,0.9324695142031520278123016], [0,0.4058451513773971669066064,0.7415311855993944398638648,0.9491079123427585245261897], [ 0.1834346424956498049394761,0.5255324099163289858177390,0.7966664774136267395915539,0.9602898564975362316835609], [0,0.3242534234038089290385380,0.6133714327005903973087020,0.8360311073266357942994298,0.9681602395076260898355762], [ 0.1488743389816312108848260,0.4333953941292471907992659,0.6794095682990244062343274,0.8650633666889845107320967,0.9739065285171717200779640], [0,0.2695431559523449723315320,0.5190961292068118159257257,0.7301520055740493240934163,0.8870625997680952990751578,0.9782286581460569928039380], [ 0.1252334085114689154724414,0.3678314989981801937526915,0.5873179542866174472967024,0.7699026741943046870368938,0.9041172563704748566784659,0.9815606342467192506905491], [0,0.2304583159551347940655281,0.4484927510364468528779129,0.6423493394403402206439846,0.8015780907333099127942065,0.9175983992229779652065478,0.9841830547185881494728294], [ 0.1080549487073436620662447,0.3191123689278897604356718,0.5152486363581540919652907,0.6872929048116854701480198,0.8272013150697649931897947,0.9284348836635735173363911,0.9862838086968123388415973], [0,0.2011940939974345223006283,0.3941513470775633698972074,0.5709721726085388475372267,0.7244177313601700474161861,0.8482065834104272162006483,0.9372733924007059043077589,0.9879925180204854284895657], [ 0.0950125098376374401853193,0.2816035507792589132304605,0.4580167776572273863424194,0.6178762444026437484466718,0.7554044083550030338951012,0.8656312023878317438804679,0.9445750230732325760779884,0.9894009349916499325961542] ]; var weights = [ [1], [0.8888888888888888888888889,0.5555555555555555555555556], [0.6521451548625461426269361,0.3478548451374538573730639], [0.5688888888888888888888889,0.4786286704993664680412915,0.2369268850561890875142640], [0.4679139345726910473898703,0.3607615730481386075698335,0.1713244923791703450402961], [0.4179591836734693877551020,0.3818300505051189449503698,0.2797053914892766679014678,0.1294849661688696932706114], [0.3626837833783619829651504,0.3137066458778872873379622,0.2223810344533744705443560,0.1012285362903762591525314], [0.3302393550012597631645251,0.3123470770400028400686304,0.2606106964029354623187429,0.1806481606948574040584720,0.0812743883615744119718922], [0.2955242247147528701738930,0.2692667193099963550912269,0.2190863625159820439955349,0.1494513491505805931457763,0.0666713443086881375935688], [0.2729250867779006307144835,0.2628045445102466621806889,0.2331937645919904799185237,0.1862902109277342514260976,0.1255803694649046246346943,0.0556685671161736664827537], [0.2491470458134027850005624,0.2334925365383548087608499,0.2031674267230659217490645,0.1600783285433462263346525,0.1069393259953184309602547,0.0471753363865118271946160], [0.2325515532308739101945895,0.2262831802628972384120902,0.2078160475368885023125232,0.1781459807619457382800467,0.1388735102197872384636018,0.0921214998377284479144218,0.0404840047653158795200216], [0.2152638534631577901958764,0.2051984637212956039659241,0.1855383974779378137417166,0.1572031671581935345696019,0.1215185706879031846894148,0.0801580871597602098056333,0.0351194603317518630318329], [0.2025782419255612728806202,0.1984314853271115764561183,0.1861610000155622110268006,0.1662692058169939335532009,0.1395706779261543144478048,0.1071592204671719350118695,0.0703660474881081247092674,0.0307532419961172683546284], [0.1894506104550684962853967,0.1826034150449235888667637,0.1691565193950025381893121,0.1495959888165767320815017,0.1246289712555338720524763,0.0951585116824927848099251,0.0622535239386478928628438,0.0271524594117540948517806] ]; var abs = Math.abs, sqrt = Math.sqrt, pow = Math.pow, log2 = Math.log2 || function(x) { return Math.log(x) * Math.LOG2E; }, EPSILON = 1e-12, MACHINE_EPSILON = 1.12e-16; function clamp(value, min, max) { return value < min ? min : value > max ? max : value; } function getDiscriminant(a, b, c) { function split(v) { var x = v * 134217729, y = v - x, hi = y + x, lo = v - hi; return [hi, lo]; } var D = b * b - a * c, E = b * b + a * c; if (abs(D) * 3 < E) { var ad = split(a), bd = split(b), cd = split(c), p = b * b, dp = (bd[0] * bd[0] - p + 2 * bd[0] * bd[1]) + bd[1] * bd[1], q = a * c, dq = (ad[0] * cd[0] - q + ad[0] * cd[1] + ad[1] * cd[0]) + ad[1] * cd[1]; D = (p - q) + (dp - dq); } return D; } function getNormalizationFactor() { var norm = Math.max.apply(Math, arguments); return norm && (norm < 1e-8 || norm > 1e8) ? pow(2, -Math.round(log2(norm))) : 0; } return { EPSILON: EPSILON, MACHINE_EPSILON: MACHINE_EPSILON, CURVETIME_EPSILON: 1e-8, GEOMETRIC_EPSILON: 1e-7, TRIGONOMETRIC_EPSILON: 1e-8, KAPPA: 4 * (sqrt(2) - 1) / 3, isZero: function(val) { return val >= -EPSILON && val <= EPSILON; }, clamp: clamp, integrate: function(f, a, b, n) { var x = abscissas[n - 2], w = weights[n - 2], A = (b - a) * 0.5, B = A + a, i = 0, m = (n + 1) >> 1, sum = n & 1 ? w[i++] * f(B) : 0; while (i < m) { var Ax = A * x[i]; sum += w[i++] * (f(B + Ax) + f(B - Ax)); } return A * sum; }, findRoot: function(f, df, x, a, b, n, tolerance) { for (var i = 0; i < n; i++) { var fx = f(x), dx = fx / df(x), nx = x - dx; if (abs(dx) < tolerance) { x = nx; break; } if (fx > 0) { b = x; x = nx <= a ? (a + b) * 0.5 : nx; } else { a = x; x = nx >= b ? (a + b) * 0.5 : nx; } } return clamp(x, a, b); }, solveQuadratic: function(a, b, c, roots, min, max) { var x1, x2 = Infinity; if (abs(a) < EPSILON) { if (abs(b) < EPSILON) return abs(c) < EPSILON ? -1 : 0; x1 = -c / b; } else { b *= -0.5; var D = getDiscriminant(a, b, c); if (D && abs(D) < MACHINE_EPSILON) { var f = getNormalizationFactor(abs(a), abs(b), abs(c)); if (f) { a *= f; b *= f; c *= f; D = getDiscriminant(a, b, c); } } if (D >= -MACHINE_EPSILON) { var Q = D < 0 ? 0 : sqrt(D), R = b + (b < 0 ? -Q : Q); if (R === 0) { x1 = c / a; x2 = -x1; } else { x1 = R / a; x2 = c / R; } } } var count = 0, boundless = min == null, minB = min - EPSILON, maxB = max + EPSILON; if (isFinite(x1) && (boundless || x1 > minB && x1 < maxB)) roots[count++] = boundless ? x1 : clamp(x1, min, max); if (x2 !== x1 && isFinite(x2) && (boundless || x2 > minB && x2 < maxB)) roots[count++] = boundless ? x2 : clamp(x2, min, max); return count; }, solveCubic: function(a, b, c, d, roots, min, max) { var f = getNormalizationFactor(abs(a), abs(b), abs(c), abs(d)), x, b1, c2, qd, q; if (f) { a *= f; b *= f; c *= f; d *= f; } function evaluate(x0) { x = x0; var tmp = a * x; b1 = tmp + b; c2 = b1 * x + c; qd = (tmp + b1) * x + c2; q = c2 * x + d; } if (abs(a) < EPSILON) { a = b; b1 = c; c2 = d; x = Infinity; } else if (abs(d) < EPSILON) { b1 = b; c2 = c; x = 0; } else { evaluate(-(b / a) / 3); var t = q / a, r = pow(abs(t), 1/3), s = t < 0 ? -1 : 1, td = -qd / a, rd = td > 0 ? 1.324717957244746 * Math.max(r, sqrt(td)) : r, x0 = x - s * rd; if (x0 !== x) { do { evaluate(x0); x0 = qd === 0 ? x : x - q / qd / (1 + MACHINE_EPSILON); } while (s * x0 > s * x); if (abs(a) * x * x > abs(d / x)) { c2 = -d / x; b1 = (c2 - c) / x; } } } var count = Numerical.solveQuadratic(a, b1, c2, roots, min, max), boundless = min == null; if (isFinite(x) && (count === 0 || count > 0 && x !== roots[0] && x !== roots[1]) && (boundless || x > min - EPSILON && x < max + EPSILON)) roots[count++] = boundless ? x : clamp(x, min, max); return count; } }; }; var UID = { _id: 1, _pools: {}, get: function(name) { if (name) { var pool = this._pools[name]; if (!pool) pool = this._pools[name] = { _id: 1 }; return pool._id++; } else { return this._id++; } } }; var Point = Base.extend({ _class: 'Point', _readIndex: true, initialize: function Point(arg0, arg1) { var type = typeof arg0, reading = this.__read, read = 0; if (type === 'number') { var hasY = typeof arg1 === 'number'; this._set(arg0, hasY ? arg1 : arg0); if (reading) read = hasY ? 2 : 1; } else if (type === 'undefined' || arg0 === null) { this._set(0, 0); if (reading) read = arg0 === null ? 1 : 0; } else { var obj = type === 'string' ? arg0.split(/[\s,]+/) || [] : arg0; read = 1; if (Array.isArray(obj)) { this._set(+obj[0], +(obj.length > 1 ? obj[1] : obj[0])); } else if ('x' in obj) { this._set(obj.x || 0, obj.y || 0); } else if ('width' in obj) { this._set(obj.width || 0, obj.height || 0); } else if ('angle' in obj) { this._set(obj.length || 0, 0); this.setAngle(obj.angle || 0); } else { this._set(0, 0); read = 0; } } if (reading) this.__read = read; return this; }, set: '#initialize', _set: function(x, y) { this.x = x; this.y = y; return this; }, equals: function(point) { return this === point || point && (this.x === point.x && this.y === point.y || Array.isArray(point) && this.x === point[0] && this.y === point[1]) || false; }, clone: function() { return new Point(this.x, this.y); }, toString: function() { var f = Formatter.instance; return '{ x: ' + f.number(this.x) + ', y: ' + f.number(this.y) + ' }'; }, _serialize: function(options) { var f = options.formatter; return [f.number(this.x), f.number(this.y)]; }, getLength: function() { return Math.sqrt(this.x * this.x + this.y * this.y); }, setLength: function(length) { if (this.isZero()) { var angle = this._angle || 0; this._set( Math.cos(angle) * length, Math.sin(angle) * length ); } else { var scale = length / this.getLength(); if (Numerical.isZero(scale)) this.getAngle(); this._set( this.x * scale, this.y * scale ); } }, getAngle: function() { return this.getAngleInRadians.apply(this, arguments) * 180 / Math.PI; }, setAngle: function(angle) { this.setAngleInRadians.call(this, angle * Math.PI / 180); }, getAngleInDegrees: '#getAngle', setAngleInDegrees: '#setAngle', getAngleInRadians: function() { if (!arguments.length) { return this.isZero() ? this._angle || 0 : this._angle = Math.atan2(this.y, this.x); } else { var point = Point.read(arguments), div = this.getLength() * point.getLength(); if (Numerical.isZero(div)) { return NaN; } else { var a = this.dot(point) / div; return Math.acos(a < -1 ? -1 : a > 1 ? 1 : a); } } }, setAngleInRadians: function(angle) { this._angle = angle; if (!this.isZero()) { var length = this.getLength(); this._set( Math.cos(angle) * length, Math.sin(angle) * length ); } }, getQuadrant: function() { return this.x >= 0 ? this.y >= 0 ? 1 : 4 : this.y >= 0 ? 2 : 3; } }, { beans: false, getDirectedAngle: function() { var point = Point.read(arguments); return Math.atan2(this.cross(point), this.dot(point)) * 180 / Math.PI; }, getDistance: function() { var point = Point.read(arguments), x = point.x - this.x, y = point.y - this.y, d = x * x + y * y, squared = Base.read(arguments); return squared ? d : Math.sqrt(d); }, normalize: function(length) { if (length === undefined) length = 1; var current = this.getLength(), scale = current !== 0 ? length / current : 0, point = new Point(this.x * scale, this.y * scale); if (scale >= 0) point._angle = this._angle; return point; }, rotate: function(angle, center) { if (angle === 0) return this.clone(); angle = angle * Math.PI / 180; var point = center ? this.subtract(center) : this, sin = Math.sin(angle), cos = Math.cos(angle); point = new Point( point.x * cos - point.y * sin, point.x * sin + point.y * cos ); return center ? point.add(center) : point; }, transform: function(matrix) { return matrix ? matrix._transformPoint(this) : this; }, add: function() { var point = Point.read(arguments); return new Point(this.x + point.x, this.y + point.y); }, subtract: function() { var point = Point.read(arguments); return new Point(this.x - point.x, this.y - point.y); }, multiply: function() { var point = Point.read(arguments); return new Point(this.x * point.x, this.y * point.y); }, divide: function() { var point = Point.read(arguments); return new Point(this.x / point.x, this.y / point.y); }, modulo: function() { var point = Point.read(arguments); return new Point(this.x % point.x, this.y % point.y); }, negate: function() { return new Point(-this.x, -this.y); }, isInside: function() { return Rectangle.read(arguments).contains(this); }, isClose: function() { var point = Point.read(arguments), tolerance = Base.read(arguments); return this.getDistance(point) <= tolerance; }, isCollinear: function() { var point = Point.read(arguments); return Point.isCollinear(this.x, this.y, point.x, point.y); }, isColinear: '#isCollinear', isOrthogonal: function() { var point = Point.read(arguments); return Point.isOrthogonal(this.x, this.y, point.x, point.y); }, isZero: function() { var isZero = Numerical.isZero; return isZero(this.x) && isZero(this.y); }, isNaN: function() { return isNaN(this.x) || isNaN(this.y); }, isInQuadrant: function(q) { return this.x * (q > 1 && q < 4 ? -1 : 1) >= 0 && this.y * (q > 2 ? -1 : 1) >= 0; }, dot: function() { var point = Point.read(arguments); return this.x * point.x + this.y * point.y; }, cross: function() { var point = Point.read(arguments); return this.x * point.y - this.y * point.x; }, project: function() { var point = Point.read(arguments), scale = point.isZero() ? 0 : this.dot(point) / point.dot(point); return new Point( point.x * scale, point.y * scale ); }, statics: { min: function() { var point1 = Point.read(arguments), point2 = Point.read(arguments); return new Point( Math.min(point1.x, point2.x), Math.min(point1.y, point2.y) ); }, max: function() { var point1 = Point.read(arguments), point2 = Point.read(arguments); return new Point( Math.max(point1.x, point2.x), Math.max(point1.y, point2.y) ); }, random: function() { return new Point(Math.random(), Math.random()); }, isCollinear: function(x1, y1, x2, y2) { return Math.abs(x1 * y2 - y1 * x2) <= Math.sqrt((x1 * x1 + y1 * y1) * (x2 * x2 + y2 * y2)) * 1e-8; }, isOrthogonal: function(x1, y1, x2, y2) { return Math.abs(x1 * x2 + y1 * y2) <= Math.sqrt((x1 * x1 + y1 * y1) * (x2 * x2 + y2 * y2)) * 1e-8; } } }, Base.each(['round', 'ceil', 'floor', 'abs'], function(key) { var op = Math[key]; this[key] = function() { return new Point(op(this.x), op(this.y)); }; }, {})); var LinkedPoint = Point.extend({ initialize: function Point(x, y, owner, setter) { this._x = x; this._y = y; this._owner = owner; this._setter = setter; }, _set: function(x, y, _dontNotify) { this._x = x; this._y = y; if (!_dontNotify) this._owner[this._setter](this); return this; }, getX: function() { return this._x; }, setX: function(x) { this._x = x; this._owner[this._setter](this); }, getY: function() { return this._y; }, setY: function(y) { this._y = y; this._owner[this._setter](this); }, isSelected: function() { return !!(this._owner._selection & this._getSelection()); }, setSelected: function(selected) { this._owner._changeSelection(this._getSelection(), selected); }, _getSelection: function() { return this._setter === 'setPosition' ? 4 : 0; } }); var Size = Base.extend({ _class: 'Size', _readIndex: true, initialize: function Size(arg0, arg1) { var type = typeof arg0, reading = this.__read, read = 0; if (type === 'number') { var hasHeight = typeof arg1 === 'number'; this._set(arg0, hasHeight ? arg1 : arg0); if (reading) read = hasHeight ? 2 : 1; } else if (type === 'undefined' || arg0 === null) { this._set(0, 0); if (reading) read = arg0 === null ? 1 : 0; } else { var obj = type === 'string' ? arg0.split(/[\s,]+/) || [] : arg0; read = 1; if (Array.isArray(obj)) { this._set(+obj[0], +(obj.length > 1 ? obj[1] : obj[0])); } else if ('width' in obj) { this._set(obj.width || 0, obj.height || 0); } else if ('x' in obj) { this._set(obj.x || 0, obj.y || 0); } else { this._set(0, 0); read = 0; } } if (reading) this.__read = read; return this; }, set: '#initialize', _set: function(width, height) { this.width = width; this.height = height; return this; }, equals: function(size) { return size === this || size && (this.width === size.width && this.height === size.height || Array.isArray(size) && this.width === size[0] && this.height === size[1]) || false; }, clone: function() { return new Size(this.width, this.height); }, toString: function() { var f = Formatter.instance; return '{ width: ' + f.number(this.width) + ', height: ' + f.number(this.height) + ' }'; }, _serialize: function(options) { var f = options.formatter; return [f.number(this.width), f.number(this.height)]; }, add: function() { var size = Size.read(arguments); return new Size(this.width + size.width, this.height + size.height); }, subtract: function() { var size = Size.read(arguments); return new Size(this.width - size.width, this.height - size.height); }, multiply: function() { var size = Size.read(arguments); return new Size(this.width * size.width, this.height * size.height); }, divide: function() { var size = Size.read(arguments); return new Size(this.width / size.width, this.height / size.height); }, modulo: function() { var size = Size.read(arguments); return new Size(this.width % size.width, this.height % size.height); }, negate: function() { return new Size(-this.width, -this.height); }, isZero: function() { var isZero = Numerical.isZero; return isZero(this.width) && isZero(this.height); }, isNaN: function() { return isNaN(this.width) || isNaN(this.height); }, statics: { min: function(size1, size2) { return new Size( Math.min(size1.width, size2.width), Math.min(size1.height, size2.height)); }, max: function(size1, size2) { return new Size( Math.max(size1.width, size2.width), Math.max(size1.height, size2.height)); }, random: function() { return new Size(Math.random(), Math.random()); } } }, Base.each(['round', 'ceil', 'floor', 'abs'], function(key) { var op = Math[key]; this[key] = function() { return new Size(op(this.width), op(this.height)); }; }, {})); var LinkedSize = Size.extend({ initialize: function Size(width, height, owner, setter) { this._width = width; this._height = height; this._owner = owner; this._setter = setter; }, _set: function(width, height, _dontNotify) { this._width = width; this._height = height; if (!_dontNotify) this._owner[this._setter](this); return this; }, getWidth: function() { return this._width; }, setWidth: function(width) { this._width = width; this._owner[this._setter](this); }, getHeight: function() { return this._height; }, setHeight: function(height) { this._height = height; this._owner[this._setter](this); } }); var Rectangle = Base.extend({ _class: 'Rectangle', _readIndex: true, beans: true, initialize: function Rectangle(arg0, arg1, arg2, arg3) { var type = typeof arg0, read; if (type === 'number') { this._set(arg0, arg1, arg2, arg3); read = 4; } else if (type === 'undefined' || arg0 === null) { this._set(0, 0, 0, 0); read = arg0 === null ? 1 : 0; } else if (arguments.length === 1) { if (Array.isArray(arg0)) { this._set.apply(this, arg0); read = 1; } else if (arg0.x !== undefined || arg0.width !== undefined) { this._set(arg0.x || 0, arg0.y || 0, arg0.width || 0, arg0.height || 0); read = 1; } else if (arg0.from === undefined && arg0.to === undefined) { this._set(0, 0, 0, 0); Base.filter(this, arg0); read = 1; } } if (read === undefined) { var frm = Point.readNamed(arguments, 'from'), next = Base.peek(arguments), x = frm.x, y = frm.y, width, height; if (next && next.x !== undefined || Base.hasNamed(arguments, 'to')) { var to = Point.readNamed(arguments, 'to'); width = to.x - x; height = to.y - y; if (width < 0) { x = to.x; width = -width; } if (height < 0) { y = to.y; height = -height; } } else { var size = Size.read(arguments); width = size.width; height = size.height; } this._set(x, y, width, height); read = arguments.__index; var filtered = arguments.__filtered; if (filtered) this.__filtered = filtered; } if (this.__read) this.__read = read; return this; }, set: '#initialize', _set: function(x, y, width, height) { this.x = x; this.y = y; this.width = width; this.height = height; return this; }, clone: function() { return new Rectangle(this.x, this.y, this.width, this.height); }, equals: function(rect) { var rt = Base.isPlainValue(rect) ? Rectangle.read(arguments) : rect; return rt === this || rt && this.x === rt.x && this.y === rt.y && this.width === rt.width && this.height === rt.height || false; }, toString: function() { var f = Formatter.instance; return '{ x: ' + f.number(this.x) + ', y: ' + f.number(this.y) + ', width: ' + f.number(this.width) + ', height: ' + f.number(this.height) + ' }'; }, _serialize: function(options) { var f = options.formatter; return [f.number(this.x), f.number(this.y), f.number(this.width), f.number(this.height)]; }, getPoint: function(_dontLink) { var ctor = _dontLink ? Point : LinkedPoint; return new ctor(this.x, this.y, this, 'setPoint'); }, setPoint: function() { var point = Point.read(arguments); this.x = point.x; this.y = point.y; }, getSize: function(_dontLink) { var ctor = _dontLink ? Size : LinkedSize; return new ctor(this.width, this.height, this, 'setSize'); }, _fw: 1, _fh: 1, setSize: function() { var size = Size.read(arguments), sx = this._sx, sy = this._sy, w = size.width, h = size.height; if (sx) { this.x += (this.width - w) * sx; } if (sy) { this.y += (this.height - h) * sy; } this.width = w; this.height = h; this._fw = this._fh = 1; }, getLeft: function() { return this.x; }, setLeft: function(left) { if (!this._fw) { var amount = left - this.x; this.width -= this._sx === 0.5 ? amount * 2 : amount; } this.x = left; this._sx = this._fw = 0; }, getTop: function() { return this.y; }, setTop: function(top) { if (!this._fh) { var amount = top - this.y; this.height -= this._sy === 0.5 ? amount * 2 : amount; } this.y = top; this._sy = this._fh = 0; }, getRight: function() { return this.x + this.width; }, setRight: function(right) { if (!this._fw) { var amount = right - this.x; this.width = this._sx === 0.5 ? amount * 2 : amount; } this.x = right - this.width; this._sx = 1; this._fw = 0; }, getBottom: function() { return this.y + this.height; }, setBottom: function(bottom) { if (!this._fh) { var amount = bottom - this.y; this.height = this._sy === 0.5 ? amount * 2 : amount; } this.y = bottom - this.height; this._sy = 1; this._fh = 0; }, getCenterX: function() { return this.x + this.width / 2; }, setCenterX: function(x) { if (this._fw || this._sx === 0.5) { this.x = x - this.width / 2; } else { if (this._sx) { this.x += (x - this.x) * 2 * this._sx; } this.width = (x - this.x) * 2; } this._sx = 0.5; this._fw = 0; }, getCenterY: function() { return this.y + this.height / 2; }, setCenterY: function(y) { if (this._fh || this._sy === 0.5) { this.y = y - this.height / 2; } else { if (this._sy) { this.y += (y - this.y) * 2 * this._sy; } this.height = (y - this.y) * 2; } this._sy = 0.5; this._fh = 0; }, getCenter: function(_dontLink) { var ctor = _dontLink ? Point : LinkedPoint; return new ctor(this.getCenterX(), this.getCenterY(), this, 'setCenter'); }, setCenter: function() { var point = Point.read(arguments); this.setCenterX(point.x); this.setCenterY(point.y); return this; }, getArea: function() { return this.width * this.height; }, isEmpty: function() { return this.width === 0 || this.height === 0; }, contains: function(arg) { return arg && arg.width !== undefined || (Array.isArray(arg) ? arg : arguments).length === 4 ? this._containsRectangle(Rectangle.read(arguments)) : this._containsPoint(Point.read(arguments)); }, _containsPoint: function(point) { var x = point.x, y = point.y; return x >= this.x && y >= this.y && x <= this.x + this.width && y <= this.y + this.height; }, _containsRectangle: function(rect) { var x = rect.x, y = rect.y; return x >= this.x && y >= this.y && x + rect.width <= this.x + this.width && y + rect.height <= this.y + this.height; }, intersects: function() { var rect = Rectangle.read(arguments), epsilon = Base.read(arguments) || 0; return rect.x + rect.width > this.x - epsilon && rect.y + rect.height > this.y - epsilon && rect.x < this.x + this.width + epsilon && rect.y < this.y + this.height + epsilon; }, intersect: function() { var rect = Rectangle.read(arguments), x1 = Math.max(this.x, rect.x), y1 = Math.max(this.y, rect.y), x2 = Math.min(this.x + this.width, rect.x + rect.width), y2 = Math.min(this.y + this.height, rect.y + rect.height); return new Rectangle(x1, y1, x2 - x1, y2 - y1); }, unite: function() { var rect = Rectangle.read(arguments), x1 = Math.min(this.x, rect.x), y1 = Math.min(this.y, rect.y), x2 = Math.max(this.x + this.width, rect.x + rect.width), y2 = Math.max(this.y + this.height, rect.y + rect.height); return new Rectangle(x1, y1, x2 - x1, y2 - y1); }, include: function() { var point = Point.read(arguments); var x1 = Math.min(this.x, point.x), y1 = Math.min(this.y, point.y), x2 = Math.max(this.x + this.width, point.x), y2 = Math.max(this.y + this.height, point.y); return new Rectangle(x1, y1, x2 - x1, y2 - y1); }, expand: function() { var amount = Size.read(arguments), hor = amount.width, ver = amount.height; return new Rectangle(this.x - hor / 2, this.y - ver / 2, this.width + hor, this.height + ver); }, scale: function(hor, ver) { return this.expand(this.width * hor - this.width, this.height * (ver === undefined ? hor : ver) - this.height); } }, Base.each([ ['Top', 'Left'], ['Top', 'Right'], ['Bottom', 'Left'], ['Bottom', 'Right'], ['Left', 'Center'], ['Top', 'Center'], ['Right', 'Center'], ['Bottom', 'Center'] ], function(parts, index) { var part = parts.join(''), xFirst = /^[RL]/.test(part); if (index >= 4) parts[1] += xFirst ? 'Y' : 'X'; var x = parts[xFirst ? 0 : 1], y = parts[xFirst ? 1 : 0], getX = 'get' + x, getY = 'get' + y, setX = 'set' + x, setY = 'set' + y, get = 'get' + part, set = 'set' + part; this[get] = function(_dontLink) { var ctor = _dontLink ? Point : LinkedPoint; return new ctor(this[getX](), this[getY](), this, set); }; this[set] = function() { var point = Point.read(arguments); this[setX](point.x); this[setY](point.y); }; }, { beans: true } )); var LinkedRectangle = Rectangle.extend({ initialize: function Rectangle(x, y, width, height, owner, setter) { this._set(x, y, width, height, true); this._owner = owner; this._setter = setter; }, _set: function(x, y, width, height, _dontNotify) { this._x = x; this._y = y; this._width = width; this._height = height; if (!_dontNotify) this._owner[this._setter](this); return this; } }, new function() { var proto = Rectangle.prototype; return Base.each(['x', 'y', 'width', 'height'], function(key) { var part = Base.capitalize(key), internal = '_' + key; this['get' + part] = function() { return this[internal]; }; this['set' + part] = function(value) { this[internal] = value; if (!this._dontNotify) this._owner[this._setter](this); }; }, Base.each(['Point', 'Size', 'Center', 'Left', 'Top', 'Right', 'Bottom', 'CenterX', 'CenterY', 'TopLeft', 'TopRight', 'BottomLeft', 'BottomRight', 'LeftCenter', 'TopCenter', 'RightCenter', 'BottomCenter'], function(key) { var name = 'set' + key; this[name] = function() { this._dontNotify = true; proto[name].apply(this, arguments); this._dontNotify = false; this._owner[this._setter](this); }; }, { isSelected: function() { return !!(this._owner._selection & 2); }, setSelected: function(selected) { var owner = this._owner; if (owner._changeSelection) { owner._changeSelection(2, selected); } } }) ); }); var Matrix = Base.extend({ _class: 'Matrix', initialize: function Matrix(arg, _dontNotify) { var count = arguments.length, ok = true; if (count >= 6) { this._set.apply(this, arguments); } else if (count === 1 || count === 2) { if (arg instanceof Matrix) { this._set(arg._a, arg._b, arg._c, arg._d, arg._tx, arg._ty, _dontNotify); } else if (Array.isArray(arg)) { this._set.apply(this, _dontNotify ? arg.concat([_dontNotify]) : arg); } else { ok = false; } } else if (!count) { this.reset(); } else { ok = false; } if (!ok) { throw new Error('Unsupported matrix parameters'); } return this; }, set: '#initialize', _set: function(a, b, c, d, tx, ty, _dontNotify) { this._a = a; this._b = b; this._c = c; this._d = d; this._tx = tx; this._ty = ty; if (!_dontNotify) this._changed(); return this; }, _serialize: function(options, dictionary) { return Base.serialize(this.getValues(), options, true, dictionary); }, _changed: function() { var owner = this._owner; if (owner) { if (owner._applyMatrix) { owner.transform(null, true); } else { owner._changed(25); } } }, clone: function() { return new Matrix(this._a, this._b, this._c, this._d, this._tx, this._ty); }, equals: function(mx) { return mx === this || mx && this._a === mx._a && this._b === mx._b && this._c === mx._c && this._d === mx._d && this._tx === mx._tx && this._ty === mx._ty; }, toString: function() { var f = Formatter.instance; return '[[' + [f.number(this._a), f.number(this._c), f.number(this._tx)].join(', ') + '], [' + [f.number(this._b), f.number(this._d), f.number(this._ty)].join(', ') + ']]'; }, reset: function(_dontNotify) { this._a = this._d = 1; this._b = this._c = this._tx = this._ty = 0; if (!_dontNotify) this._changed(); return this; }, apply: function(recursively, _setApplyMatrix) { var owner = this._owner; if (owner) { owner.transform(null, true, Base.pick(recursively, true), _setApplyMatrix); return this.isIdentity(); } return false; }, translate: function() { var point = Point.read(arguments), x = point.x, y = point.y; this._tx += x * this._a + y * this._c; this._ty += x * this._b + y * this._d; this._changed(); return this; }, scale: function() { var scale = Point.read(arguments), center = Point.read(arguments, 0, { readNull: true }); if (center) this.translate(center); this._a *= scale.x; this._b *= scale.x; this._c *= scale.y; this._d *= scale.y; if (center) this.translate(center.negate()); this._changed(); return this; }, rotate: function(angle ) { angle *= Math.PI / 180; var center = Point.read(arguments, 1), x = center.x, y = center.y, cos = Math.cos(angle), sin = Math.sin(angle), tx = x - x * cos + y * sin, ty = y - x * sin - y * cos, a = this._a, b = this._b, c = this._c, d = this._d; this._a = cos * a + sin * c; this._b = cos * b + sin * d; this._c = -sin * a + cos * c; this._d = -sin * b + cos * d; this._tx += tx * a + ty * c; this._ty += tx * b + ty * d; this._changed(); return this; }, shear: function() { var shear = Point.read(arguments), center = Point.read(arguments, 0, { readNull: true }); if (center) this.translate(center); var a = this._a, b = this._b; this._a += shear.y * this._c; this._b += shear.y * this._d; this._c += shear.x * a; this._d += shear.x * b; if (center) this.translate(center.negate()); this._changed(); return this; }, skew: function() { var skew = Point.read(arguments), center = Point.read(arguments, 0, { readNull: true }), toRadians = Math.PI / 180, shear = new Point(Math.tan(skew.x * toRadians), Math.tan(skew.y * toRadians)); return this.shear(shear, center); }, append: function(mx, _dontNotify) { if (mx) { var a1 = this._a, b1 = this._b, c1 = this._c, d1 = this._d, a2 = mx._a, b2 = mx._c, c2 = mx._b, d2 = mx._d, tx2 = mx._tx, ty2 = mx._ty; this._a = a2 * a1 + c2 * c1; this._c = b2 * a1 + d2 * c1; this._b = a2 * b1 + c2 * d1; this._d = b2 * b1 + d2 * d1; this._tx += tx2 * a1 + ty2 * c1; this._ty += tx2 * b1 + ty2 * d1; if (!_dontNotify) this._changed(); } return this; }, prepend: function(mx, _dontNotify) { if (mx) { var a1 = this._a, b1 = this._b, c1 = this._c, d1 = this._d, tx1 = this._tx, ty1 = this._ty, a2 = mx._a, b2 = mx._c, c2 = mx._b, d2 = mx._d, tx2 = mx._tx, ty2 = mx._ty; this._a = a2 * a1 + b2 * b1; this._c = a2 * c1 + b2 * d1; this._b = c2 * a1 + d2 * b1; this._d = c2 * c1 + d2 * d1; this._tx = a2 * tx1 + b2 * ty1 + tx2; this._ty = c2 * tx1 + d2 * ty1 + ty2; if (!_dontNotify) this._changed(); } return this; }, appended: function(mx) { return this.clone().append(mx); }, prepended: function(mx) { return this.clone().prepend(mx); }, invert: function() { var a = this._a, b = this._b, c = this._c, d = this._d, tx = this._tx, ty = this._ty, det = a * d - b * c, res = null; if (det && !isNaN(det) && isFinite(tx) && isFinite(ty)) { this._a = d / det; this._b = -b / det; this._c = -c / det; this._d = a / det; this._tx = (c * ty - d * tx) / det; this._ty = (b * tx - a * ty) / det; res = this; } return res; }, inverted: function() { return this.clone().invert(); }, concatenate: '#append', preConcatenate: '#prepend', chain: '#appended', _shiftless: function() { return new Matrix(this._a, this._b, this._c, this._d, 0, 0); }, _orNullIfIdentity: function() { return this.isIdentity() ? null : this; }, isIdentity: function() { return this._a === 1 && this._b === 0 && this._c === 0 && this._d === 1 && this._tx === 0 && this._ty === 0; }, isInvertible: function() { var det = this._a * this._d - this._c * this._b; return det && !isNaN(det) && isFinite(this._tx) && isFinite(this._ty); }, isSingular: function() { return !this.isInvertible(); }, transform: function( src, dst, count) { return arguments.length < 3 ? this._transformPoint(Point.read(arguments)) : this._transformCoordinates(src, dst, count); }, _transformPoint: function(point, dest, _dontNotify) { var x = point.x, y = point.y; if (!dest) dest = new Point(); return dest._set( x * this._a + y * this._c + this._tx, x * this._b + y * this._d + this._ty, _dontNotify); }, _transformCoordinates: function(src, dst, count) { for (var i = 0, max = 2 * count; i < max; i += 2) { var x = src[i], y = src[i + 1]; dst[i] = x * this._a + y * this._c + this._tx; dst[i + 1] = x * this._b + y * this._d + this._ty; } return dst; }, _transformCorners: function(rect) { var x1 = rect.x, y1 = rect.y, x2 = x1 + rect.width, y2 = y1 + rect.height, coords = [ x1, y1, x2, y1, x2, y2, x1, y2 ]; return this._transformCoordinates(coords, coords, 4); }, _transformBounds: function(bounds, dest, _dontNotify) { var coords = this._transformCorners(bounds), min = coords.slice(0, 2), max = min.slice(); for (var i = 2; i < 8; i++) { var val = coords[i], j = i & 1; if (val < min[j]) { min[j] = val; } else if (val > max[j]) { max[j] = val; } } if (!dest) dest = new Rectangle(); return dest._set(min[0], min[1], max[0] - min[0], max[1] - min[1], _dontNotify); }, inverseTransform: function() { return this._inverseTransform(Point.read(arguments)); }, _inverseTransform: function(point, dest, _dontNotify) { var a = this._a, b = this._b, c = this._c, d = this._d, tx = this._tx, ty = this._ty, det = a * d - b * c, res = null; if (det && !isNaN(det) && isFinite(tx) && isFinite(ty)) { var x = point.x - this._tx, y = point.y - this._ty; if (!dest) dest = new Point(); res = dest._set( (x * d - y * c) / det, (y * a - x * b) / det, _dontNotify); } return res; }, decompose: function() { var a = this._a, b = this._b, c = this._c, d = this._d, det = a * d - b * c, sqrt = Math.sqrt, atan2 = Math.atan2, degrees = 180 / Math.PI, rotate, scale, skew; if (a !== 0 || b !== 0) { var r = sqrt(a * a + b * b); rotate = Math.acos(a / r) * (b > 0 ? 1 : -1); scale = [r, det / r]; skew = [atan2(a * c + b * d, r * r), 0]; } else if (c !== 0 || d !== 0) { var s = sqrt(c * c + d * d); rotate = Math.asin(c / s) * (d > 0 ? 1 : -1); scale = [det / s, s]; skew = [0, atan2(a * c + b * d, s * s)]; } else { rotate = 0; skew = scale = [0, 0]; } return { translation: this.getTranslation(), rotation: rotate * degrees, scaling: new Point(scale), skewing: new Point(skew[0] * degrees, skew[1] * degrees) }; }, getValues: function() { return [ this._a, this._b, this._c, this._d, this._tx, this._ty ]; }, getTranslation: function() { return new Point(this._tx, this._ty); }, getScaling: function() { return this.decompose().scaling; }, getRotation: function() { return this.decompose().rotation; }, applyToContext: function(ctx) { if (!this.isIdentity()) { ctx.transform(this._a, this._b, this._c, this._d, this._tx, this._ty); } } }, Base.each(['a', 'b', 'c', 'd', 'tx', 'ty'], function(key) { var part = Base.capitalize(key), prop = '_' + key; this['get' + part] = function() { return this[prop]; }; this['set' + part] = function(value) { this[prop] = value; this._changed(); }; }, {})); var Line = Base.extend({ _class: 'Line', initialize: function Line(arg0, arg1, arg2, arg3, arg4) { var asVector = false; if (arguments.length >= 4) { this._px = arg0; this._py = arg1; this._vx = arg2; this._vy = arg3; asVector = arg4; } else { this._px = arg0.x; this._py = arg0.y; this._vx = arg1.x; this._vy = arg1.y; asVector = arg2; } if (!asVector) { this._vx -= this._px; this._vy -= this._py; } }, getPoint: function() { return new Point(this._px, this._py); }, getVector: function() { return new Point(this._vx, this._vy); }, getLength: function() { return this.getVector().getLength(); }, intersect: function(line, isInfinite) { return Line.intersect( this._px, this._py, this._vx, this._vy, line._px, line._py, line._vx, line._vy, true, isInfinite); }, getSide: function(point, isInfinite) { return Line.getSide( this._px, this._py, this._vx, this._vy, point.x, point.y, true, isInfinite); }, getDistance: function(point) { return Math.abs(this.getSignedDistance(point)); }, getSignedDistance: function(point) { return Line.getSignedDistance(this._px, this._py, this._vx, this._vy, point.x, point.y, true); }, isCollinear: function(line) { return Point.isCollinear(this._vx, this._vy, line._vx, line._vy); }, isOrthogonal: function(line) { return Point.isOrthogonal(this._vx, this._vy, line._vx, line._vy); }, statics: { intersect: function(p1x, p1y, v1x, v1y, p2x, p2y, v2x, v2y, asVector, isInfinite) { if (!asVector) { v1x -= p1x; v1y -= p1y; v2x -= p2x; v2y -= p2y; } var cross = v1x * v2y - v1y * v2x; if (!Numerical.isZero(cross)) { var dx = p1x - p2x, dy = p1y - p2y, u1 = (v2x * dy - v2y * dx) / cross, u2 = (v1x * dy - v1y * dx) / cross, epsilon = 1e-12, uMin = -epsilon, uMax = 1 + epsilon; if (isInfinite || uMin < u1 && u1 < uMax && uMin < u2 && u2 < uMax) { if (!isInfinite) { u1 = u1 <= 0 ? 0 : u1 >= 1 ? 1 : u1; } return new Point( p1x + u1 * v1x, p1y + u1 * v1y); } } }, getSide: function(px, py, vx, vy, x, y, asVector, isInfinite) { if (!asVector) { vx -= px; vy -= py; } var v2x = x - px, v2y = y - py, ccw = v2x * vy - v2y * vx; if (!isInfinite && Numerical.isZero(ccw)) { ccw = (v2x * vx + v2x * vx) / (vx * vx + vy * vy); if (ccw >= 0 && ccw <= 1) ccw = 0; } return ccw < 0 ? -1 : ccw > 0 ? 1 : 0; }, getSignedDistance: function(px, py, vx, vy, x, y, asVector) { if (!asVector) { vx -= px; vy -= py; } return vx === 0 ? vy > 0 ? x - px : px - x : vy === 0 ? vx < 0 ? y - py : py - y : ((x-px) * vy - (y-py) * vx) / Math.sqrt(vx * vx + vy * vy); }, getDistance: function(px, py, vx, vy, x, y, asVector) { return Math.abs( Line.getSignedDistance(px, py, vx, vy, x, y, asVector)); } } }); var Project = PaperScopeItem.extend({ _class: 'Project', _list: 'projects', _reference: 'project', _compactSerialize: true, initialize: function Project(element) { PaperScopeItem.call(this, true); this._children = []; this._namedChildren = {}; this._activeLayer = null; this._currentStyle = new Style(null, null, this); this._view = View.create(this, element || CanvasProvider.getCanvas(1, 1)); this._selectionItems = {}; this._selectionCount = 0; this._updateVersion = 0; }, _serialize: function(options, dictionary) { return Base.serialize(this._children, options, true, dictionary); }, _changed: function(flags, item) { if (flags & 1) { var view = this._view; if (view) { view._needsUpdate = true; if (!view._requested && view._autoUpdate) view.requestUpdate(); } } var changes = this._changes; if (changes && item) { var changesById = this._changesById, id = item._id, entry = changesById[id]; if (entry) { entry.flags |= flags; } else { changes.push(changesById[id] = { item: item, flags: flags }); } } }, clear: function() { var children = this._children; for (var i = children.length - 1; i >= 0; i--) children[i].remove(); }, isEmpty: function() { return !this._children.length; }, remove: function remove() { if (!remove.base.call(this)) return false; if (this._view) this._view.remove(); return true; }, getView: function() { return this._view; }, getCurrentStyle: function() { return this._currentStyle; }, setCurrentStyle: function(style) { this._currentStyle.set(style); }, getIndex: function() { return this._index; }, getOptions: function() { return this._scope.settings; }, getLayers: function() { return this._children; }, getActiveLayer: function() { return this._activeLayer || new Layer({ project: this, insert: true }); }, getSymbolDefinitions: function() { var definitions = [], ids = {}; this.getItems({ class: SymbolItem, match: function(item) { var definition = item._definition, id = definition._id; if (!ids[id]) { ids[id] = true; definitions.push(definition); } return false; } }); return definitions; }, getSymbols: 'getSymbolDefinitions', getSelectedItems: function() { var selectionItems = this._selectionItems, items = []; for (var id in selectionItems) { var item = selectionItems[id], selection = item._selection; if ((selection & 1) && item.isInserted()) { items.push(item); } else if (!selection) { this._updateSelection(item); } } return items; }, _updateSelection: function(item) { var id = item._id, selectionItems = this._selectionItems; if (item._selection) { if (selectionItems[id] !== item) { this._selectionCount++; selectionItems[id] = item; } } else if (selectionItems[id] === item) { this._selectionCount--; delete selectionItems[id]; } }, selectAll: function() { var children = this._children; for (var i = 0, l = children.length; i < l; i++) children[i].setFullySelected(true); }, deselectAll: function() { var selectionItems = this._selectionItems; for (var i in selectionItems) selectionItems[i].setFullySelected(false); }, addLayer: function(layer) { return this.insertLayer(undefined, layer); }, insertLayer: function(index, layer) { if (layer instanceof Layer) { layer._remove(false, true); Base.splice(this._children, [layer], index, 0); layer._setProject(this, true); var name = layer._name; if (name) layer.setName(name); if (this._changes) layer._changed(5); if (!this._activeLayer) this._activeLayer = layer; } else { layer = null; } return layer; }, _insertItem: function(index, item, _created) { item = this.insertLayer(index, item) || (this._activeLayer || this._insertItem(undefined, new Layer(Item.NO_INSERT), true)) .insertChild(index, item); if (_created && item.activate) item.activate(); return item; }, getItems: function(options) { return Item._getItems(this, options); }, getItem: function(options) { return Item._getItems(this, options, null, null, true)[0] || null; }, importJSON: function(json) { this.activate(); var layer = this._activeLayer; return Base.importJSON(json, layer && layer.isEmpty() && layer); }, removeOn: function(type) { var sets = this._removeSets; if (sets) { if (type === 'mouseup') sets.mousedrag = null; var set = sets[type]; if (set) { for (var id in set) { var item = set[id]; for (var key in sets) { var other = sets[key]; if (other && other != set) delete other[item._id]; } item.remove(); } sets[type] = null; } } }, draw: function(ctx, matrix, pixelRatio) { this._updateVersion++; ctx.save(); matrix.applyToContext(ctx); var children = this._children, param = new Base({ offset: new Point(0, 0), pixelRatio: pixelRatio, viewMatrix: matrix.isIdentity() ? null : matrix, matrices: [new Matrix()], updateMatrix: true }); for (var i = 0, l = children.length; i < l; i++) { children[i].draw(ctx, param); } ctx.restore(); if (this._selectionCount > 0) { ctx.save(); ctx.strokeWidth = 1; var items = this._selectionItems, size = this._scope.settings.handleSize, version = this._updateVersion; for (var id in items) { items[id]._drawSelection(ctx, matrix, size, items, version); } ctx.restore(); } } }); var Item = Base.extend(Emitter, { statics: { extend: function extend(src) { if (src._serializeFields) src._serializeFields = Base.set({}, this.prototype._serializeFields, src._serializeFields); return extend.base.apply(this, arguments); }, NO_INSERT: { insert: false } }, _class: 'Item', _name: null, _applyMatrix: true, _canApplyMatrix: true, _canScaleStroke: false, _pivot: null, _visible: true, _blendMode: 'normal', _opacity: 1, _locked: false, _guide: false, _clipMask: false, _selection: 0, _selectBounds: true, _selectChildren: false, _serializeFields: { name: null, applyMatrix: null, matrix: new Matrix(), pivot: null, visible: true, blendMode: 'normal', opacity: 1, locked: false, guide: false, clipMask: false, selected: false, data: {} }, _prioritize: ['applyMatrix'] }, new function() { var handlers = ['onMouseDown', 'onMouseUp', 'onMouseDrag', 'onClick', 'onDoubleClick', 'onMouseMove', 'onMouseEnter', 'onMouseLeave']; return Base.each(handlers, function(name) { this._events[name] = { install: function(type) { this.getView()._countItemEvent(type, 1); }, uninstall: function(type) { this.getView()._countItemEvent(type, -1); } }; }, { _events: { onFrame: { install: function() { this.getView()._animateItem(this, true); }, uninstall: function() { this.getView()._animateItem(this, false); } }, onLoad: {}, onError: {} }, statics: { _itemHandlers: handlers } } ); }, { initialize: function Item() { }, _initialize: function(props, point) { var hasProps = props && Base.isPlainObject(props), internal = hasProps && props.internal === true, matrix = this._matrix = new Matrix(), project = hasProps && props.project || paper.project, settings = paper.settings; this._id = internal ? null : UID.get(); this._parent = this._index = null; this._applyMatrix = this._canApplyMatrix && settings.applyMatrix; if (point) matrix.translate(point); matrix._owner = this; this._style = new Style(project._currentStyle, this, project); if (internal || hasProps && props.insert == false || !settings.insertItems && !(hasProps && props.insert === true)) { this._setProject(project); } else { (hasProps && props.parent || project) ._insertItem(undefined, this, true); } if (hasProps && props !== Item.NO_INSERT) { this.set(props, { internal: true, insert: true, project: true, parent: true }); } return hasProps; }, _serialize: function(options, dictionary) { var props = {}, that = this; function serialize(fields) { for (var key in fields) { var value = that[key]; if (!Base.equals(value, key === 'leading' ? fields.fontSize * 1.2 : fields[key])) { props[key] = Base.serialize(value, options, key !== 'data', dictionary); } } } serialize(this._serializeFields); if (!(this instanceof Group)) serialize(this._style._defaults); return [ this._class, props ]; }, _changed: function(flags) { var symbol = this._symbol, cacheParent = this._parent || symbol, project = this._project; if (flags & 8) { this._bounds = this._position = this._decomposed = undefined; } if (flags & 16) { this._globalMatrix = undefined; } if (cacheParent && (flags & 72)) { Item._clearBoundsCache(cacheParent); } if (flags & 2) { Item._clearBoundsCache(this); } if (project) project._changed(flags, this); if (symbol) symbol._changed(flags); }, getId: function() { return this._id; }, getName: function() { return this._name; }, setName: function(name) { if (this._name) this._removeNamed(); if (name === (+name) + '') throw new Error( 'Names consisting only of numbers are not supported.'); var owner = this._getOwner(); if (name && owner) { var children = owner._children, namedChildren = owner._namedChildren; (namedChildren[name] = namedChildren[name] || []).push(this); if (!(name in children)) children[name] = this; } this._name = name || undefined; this._changed(256); }, getStyle: function() { return this._style; }, setStyle: function(style) { this.getStyle().set(style); } }, Base.each(['locked', 'visible', 'blendMode', 'opacity', 'guide'], function(name) { var part = Base.capitalize(name), key = '_' + name, flags = { locked: 256, visible: 265 }; this['get' + part] = function() { return this[key]; }; this['set' + part] = function(value) { if (value != this[key]) { this[key] = value; this._changed(flags[name] || 257); } }; }, {}), { beans: true, getSelection: function() { return this._selection; }, setSelection: function(selection) { if (selection !== this._selection) { this._selection = selection; var project = this._project; if (project) { project._updateSelection(this); this._changed(257); } } }, _changeSelection: function(flag, selected) { var selection = this._selection; this.setSelection(selected ? selection | flag : selection & ~flag); }, isSelected: function() { if (this._selectChildren) { var children = this._children; for (var i = 0, l = children.length; i < l; i++) if (children[i].isSelected()) return true; } return !!(this._selection & 1); }, setSelected: function(selected) { if (this._selectChildren) { var children = this._children; for (var i = 0, l = children.length; i < l; i++) children[i].setSelected(selected); } this._changeSelection(1, selected); }, isFullySelected: function() { var children = this._children, selected = !!(this._selection & 1); if (children && selected) { for (var i = 0, l = children.length; i < l; i++) if (!children[i].isFullySelected()) return false; return true; } return selected; }, setFullySelected: function(selected) { var children = this._children; if (children) { for (var i = 0, l = children.length; i < l; i++) children[i].setFullySelected(selected); } this._changeSelection(1, selected); }, isClipMask: function() { return this._clipMask; }, setClipMask: function(clipMask) { if (this._clipMask != (clipMask = !!clipMask)) { this._clipMask = clipMask; if (clipMask) { this.setFillColor(null); this.setStrokeColor(null); } this._changed(257); if (this._parent) this._parent._changed(2048); } }, getData: function() { if (!this._data) this._data = {}; return this._data; }, setData: function(data) { this._data = data; }, getPosition: function(_dontLink) { var ctor = _dontLink ? Point : LinkedPoint; var position = this._position || (this._position = this._getPositionFromBounds()); return new ctor(position.x, position.y, this, 'setPosition'); }, setPosition: function() { this.translate(Point.read(arguments).subtract(this.getPosition(true))); }, _getPositionFromBounds: function(bounds) { return this._pivot ? this._matrix._transformPoint(this._pivot) : (bounds || this.getBounds()).getCenter(true); }, getPivot: function() { var pivot = this._pivot; return pivot ? new LinkedPoint(pivot.x, pivot.y, this, 'setPivot') : null; }, setPivot: function() { this._pivot = Point.read(arguments, 0, { clone: true, readNull: true }); this._position = undefined; } }, Base.each({ getStrokeBounds: { stroke: true }, getHandleBounds: { handle: true }, getInternalBounds: { internal: true }, getDrawnBounds: { stroke: true, drawnTextBounds: true }, }, function(options, key) { this[key] = function(matrix) { return this.getBounds(matrix, options); }; }, { beans: true, getBounds: function(matrix, options) { var hasMatrix = options || matrix instanceof Matrix, opts = Base.set({}, hasMatrix ? options : matrix, this._boundsOptions); if (!opts.stroke || this.getStrokeScaling()) opts.cacheItem = this; var rect = this._getCachedBounds(hasMatrix && matrix, opts).rect; return !arguments.length ? new LinkedRectangle(rect.x, rect.y, rect.width, rect.height, this, 'setBounds') : rect; }, setBounds: function() { var rect = Rectangle.read(arguments), bounds = this.getBounds(), _matrix = this._matrix, matrix = new Matrix(), center = rect.getCenter(); matrix.translate(center); if (rect.width != bounds.width || rect.height != bounds.height) { if (!_matrix.isInvertible()) { _matrix.set(_matrix._backup || new Matrix().translate(_matrix.getTranslation())); bounds = this.getBounds(); } matrix.scale( bounds.width !== 0 ? rect.width / bounds.width : 0, bounds.height !== 0 ? rect.height / bounds.height : 0); } center = bounds.getCenter(); matrix.translate(-center.x, -center.y); this.transform(matrix); }, _getBounds: function(matrix, options) { var children = this._children; if (!children || !children.length) return new Rectangle(); Item._updateBoundsCache(this, options.cacheItem); return Item._getBounds(children, matrix, options); }, _getBoundsCacheKey: function(options, internal) { return [ options.stroke ? 1 : 0, options.handle ? 1 : 0, options.drawnTextBounds? 1 : 0, internal ? 1 : 0 ].join(''); }, _getCachedBounds: function(matrix, options, noInternal) { matrix = matrix && matrix._orNullIfIdentity(); var internal = options.internal && !noInternal, cacheItem = options.cacheItem, _matrix = internal ? null : this._matrix._orNullIfIdentity(), cacheKey = cacheItem && (!matrix || matrix.equals(_matrix)) && this._getBoundsCacheKey(options, internal), bounds = this._bounds; Item._updateBoundsCache(this._parent || this._symbol, cacheItem); if (cacheKey && bounds && cacheKey in bounds) { var cached = bounds[cacheKey]; return { rect: cached.rect.clone(), nonscaling: cached.nonscaling }; } var res = this._getBounds(matrix || _matrix, options), rect = res.rect || res, style = this._style, nonscaling = res.nonscaling || style.hasStroke() && !style.getStrokeScaling(); if (cacheKey) { if (!bounds) { this._bounds = bounds = {}; } var cached = bounds[cacheKey] = { rect: rect.clone(), nonscaling: nonscaling, internal: internal }; } return { rect: rect, nonscaling: nonscaling }; }, _getStrokeMatrix: function(matrix, options) { var parent = this.getStrokeScaling() ? null : options && options.internal ? this : this._parent || this._symbol && this._symbol._item, mx = parent ? parent.getViewMatrix().invert() : matrix; return mx && mx._shiftless(); }, statics: { _updateBoundsCache: function(parent, item) { if (parent && item) { var id = item._id, ref = parent._boundsCache = parent._boundsCache || { ids: {}, list: [] }; if (!ref.ids[id]) { ref.list.push(item); ref.ids[id] = item; } } }, _clearBoundsCache: function(item) { var cache = item._boundsCache; if (cache) { item._bounds = item._position = item._boundsCache = undefined; for (var i = 0, list = cache.list, l = list.length; i < l; i++){ var other = list[i]; if (other !== item) { other._bounds = other._position = undefined; if (other._boundsCache) Item._clearBoundsCache(other); } } } }, _getBounds: function(items, matrix, options) { var x1 = Infinity, x2 = -x1, y1 = x1, y2 = x2, nonscaling = false; options = options || {}; for (var i = 0, l = items.length; i < l; i++) { var item = items[i]; if (item._visible && !item.isEmpty()) { var bounds = item._getCachedBounds( matrix && matrix.appended(item._matrix), options, true), rect = bounds.rect; x1 = Math.min(rect.x, x1); y1 = Math.min(rect.y, y1); x2 = Math.max(rect.x + rect.width, x2); y2 = Math.max(rect.y + rect.height, y2); if (bounds.nonscaling) nonscaling = true; } } return { rect: isFinite(x1) ? new Rectangle(x1, y1, x2 - x1, y2 - y1) : new Rectangle(), nonscaling: nonscaling }; } } }), { beans: true, _decompose: function() { return this._applyMatrix ? null : this._decomposed || (this._decomposed = this._matrix.decompose()); }, getRotation: function() { var decomposed = this._decompose(); return decomposed ? decomposed.rotation : 0; }, setRotation: function(rotation) { var current = this.getRotation(); if (current != null && rotation != null) { var decomposed = this._decomposed; this.rotate(rotation - current); if (decomposed) { decomposed.rotation = rotation; this._decomposed = decomposed; } } }, getScaling: function() { var decomposed = this._decompose(), s = decomposed && decomposed.scaling; return new LinkedPoint(s ? s.x : 1, s ? s.y : 1, this, 'setScaling'); }, setScaling: function() { var current = this.getScaling(), scaling = Point.read(arguments, 0, { clone: true, readNull: true }); if (current && scaling && !current.equals(scaling)) { var rotation = this.getRotation(), decomposed = this._decomposed, matrix = new Matrix(), center = this.getPosition(true); matrix.translate(center); if (rotation) matrix.rotate(rotation); matrix.scale(scaling.x / current.x, scaling.y / current.y); if (rotation) matrix.rotate(-rotation); matrix.translate(center.negate()); this.transform(matrix); if (decomposed) { decomposed.scaling = scaling; this._decomposed = decomposed; } } }, getMatrix: function() { return this._matrix; }, setMatrix: function() { var matrix = this._matrix; matrix.initialize.apply(matrix, arguments); }, getGlobalMatrix: function(_dontClone) { var matrix = this._globalMatrix; if (matrix) { var parent = this._parent; var parents = []; while (parent) { if (!parent._globalMatrix) { matrix = null; for (var i = 0, l = parents.length; i < l; i++) { parents[i]._globalMatrix = null; } break; } parents.push(parent); parent = parent._parent; } } if (!matrix) { matrix = this._globalMatrix = this._matrix.clone(); var parent = this._parent; if (parent) matrix.prepend(parent.getGlobalMatrix(true)); } return _dontClone ? matrix : matrix.clone(); }, getViewMatrix: function() { return this.getGlobalMatrix().prepend(this.getView()._matrix); }, getApplyMatrix: function() { return this._applyMatrix; }, setApplyMatrix: function(apply) { if (this._applyMatrix = this._canApplyMatrix && !!apply) this.transform(null, true); }, getTransformContent: '#getApplyMatrix', setTransformContent: '#setApplyMatrix', }, { getProject: function() { return this._project; }, _setProject: function(project, installEvents) { if (this._project !== project) { if (this._project) this._installEvents(false); this._project = project; var children = this._children; for (var i = 0, l = children && children.length; i < l; i++) children[i]._setProject(project); installEvents = true; } if (installEvents) this._installEvents(true); }, getView: function() { return this._project._view; }, _installEvents: function _installEvents(install) { _installEvents.base.call(this, install); var children = this._children; for (var i = 0, l = children && children.length; i < l; i++) children[i]._installEvents(install); }, getLayer: function() { var parent = this; while (parent = parent._parent) { if (parent instanceof Layer) return parent; } return null; }, getParent: function() { return this._parent; }, setParent: function(item) { return item.addChild(this); }, _getOwner: '#getParent', getChildren: function() { return this._children; }, setChildren: function(items) { this.removeChildren(); this.addChildren(items); }, getFirstChild: function() { return this._children && this._children[0] || null; }, getLastChild: function() { return this._children && this._children[this._children.length - 1] || null; }, getNextSibling: function() { var owner = this._getOwner(); return owner && owner._children[this._index + 1] || null; }, getPreviousSibling: function() { var owner = this._getOwner(); return owner && owner._children[this._index - 1] || null; }, getIndex: function() { return this._index; }, equals: function(item) { return item === this || item && this._class === item._class && this._style.equals(item._style) && this._matrix.equals(item._matrix) && this._locked === item._locked && this._visible === item._visible && this._blendMode === item._blendMode && this._opacity === item._opacity && this._clipMask === item._clipMask && this._guide === item._guide && this._equals(item) || false; }, _equals: function(item) { return Base.equals(this._children, item._children); }, clone: function(options) { var copy = new this.constructor(Item.NO_INSERT), children = this._children, insert = Base.pick(options ? options.insert : undefined, options === undefined || options === true), deep = Base.pick(options ? options.deep : undefined, true); if (children) copy.copyAttributes(this); if (!children || deep) copy.copyContent(this); if (!children) copy.copyAttributes(this); if (insert) copy.insertAbove(this); var name = this._name, parent = this._parent; if (name && parent) { var children = parent._children, orig = name, i = 1; while (children[name]) name = orig + ' ' + (i++); if (name !== orig) copy.setName(name); } return copy; }, copyContent: function(source) { var children = source._children; for (var i = 0, l = children && children.length; i < l; i++) { this.addChild(children[i].clone(false), true); } }, copyAttributes: function(source, excludeMatrix) { this.setStyle(source._style); var keys = ['_locked', '_visible', '_blendMode', '_opacity', '_clipMask', '_guide']; for (var i = 0, l = keys.length; i < l; i++) { var key = keys[i]; if (source.hasOwnProperty(key)) this[key] = source[key]; } if (!excludeMatrix) this._matrix.set(source._matrix, true); this.setApplyMatrix(source._applyMatrix); this.setPivot(source._pivot); this.setSelection(source._selection); var data = source._data, name = source._name; this._data = data ? Base.clone(data) : null; if (name) this.setName(name); }, rasterize: function(resolution, insert, boundRect) { var bounds = boundRect ? boundRect : this.getStrokeBounds(), scale = (resolution || this.getView().getResolution()) / 72, topLeft = bounds.getTopLeft().floor(), bottomRight = bounds.getBottomRight().ceil(), size = new Size(bottomRight.subtract(topLeft)), raster = new Raster(Item.NO_INSERT); if (!size.isZero()) { var canvas = CanvasProvider.getCanvas(size.multiply(scale)), ctx = canvas.getContext('2d'), matrix = new Matrix().scale(scale).translate(topLeft.negate()); ctx.imageSmoothingEnabled = false; ctx.save(); matrix.applyToContext(ctx); this.draw(ctx, new Base({ matrices: [matrix] })); ctx.restore(); raster.setCanvas(canvas); } raster.transform(new Matrix().translate(topLeft.add(size.divide(2))) .scale(1 / scale)); if (insert === undefined || insert) raster.insertAbove(this); return raster; }, contains: function() { return !!this._contains( this._matrix._inverseTransform(Point.read(arguments))); }, _contains: function(point) { var children = this._children; if (children) { for (var i = children.length - 1; i >= 0; i--) { if (children[i].contains(point)) return true; } return false; } return point.isInside(this.getInternalBounds()); }, isInside: function() { return Rectangle.read(arguments).contains(this.getBounds()); }, _asPathItem: function() { return new Path.Rectangle({ rectangle: this.getInternalBounds(), matrix: this._matrix, insert: false, }); }, intersects: function(item, _matrix) { if (!(item instanceof Item)) return false; return this._asPathItem().getIntersections(item._asPathItem(), null, _matrix, true).length > 0; } }, new function() { function hitTest() { return this._hitTest( Point.read(arguments), HitResult.getOptions(arguments)); } function hitTestAll() { var point = Point.read(arguments), options = HitResult.getOptions(arguments), all = []; this._hitTest(point, Base.set({ all: all }, options)); return all; } function hitTestChildren(point, options, viewMatrix, _exclude) { var children = this._children; if (children) { for (var i = children.length - 1; i >= 0; i--) { var child = children[i]; var res = child !== _exclude && child._hitTest(point, options, viewMatrix); if (res && !options.all) return res; } } return null; } Project.inject({ hitTest: hitTest, hitTestAll: hitTestAll, _hitTest: hitTestChildren }); return { hitTest: hitTest, hitTestAll: hitTestAll, _hitTestChildren: hitTestChildren, }; }, { _hitTest: function(point, options, parentViewMatrix) { if (this._locked || !this._visible || this._guide && !options.guides || this.isEmpty()) { return null; } var matrix = this._matrix, viewMatrix = parentViewMatrix ? parentViewMatrix.appended(matrix) : this.getGlobalMatrix().prepend(this.getView()._matrix), tolerance = Math.max(options.tolerance, 1e-12), tolerancePadding = options._tolerancePadding = new Size( Path._getStrokePadding(tolerance, matrix._shiftless().invert())); point = matrix._inverseTransform(point); if (!point || !this._children && !this.getBounds({ internal: true, stroke: true, handle: true }) .expand(tolerancePadding.multiply(2))._containsPoint(point)) { return null; } var checkSelf = !(options.guides && !this._guide || options.selected && !this.isSelected() || options.type && options.type !== Base.hyphenate(this._class) || options.class && !(this instanceof options.class)), match = options.match, that = this, bounds, res; function filter(hit) { if (hit && match && !match(hit)) hit = null; if (hit && options.all) options.all.push(hit); return hit; } function checkPoint(type, part) { var pt = part ? bounds['get' + part]() : that.getPosition(); if (point.subtract(pt).divide(tolerancePadding).length <= 1) { return new HitResult(type, that, { name: part ? Base.hyphenate(part) : type, point: pt }); } } var checkPosition = options.position, checkCenter = options.center, checkBounds = options.bounds; if (checkSelf && this._parent && (checkPosition || checkCenter || checkBounds)) { if (checkCenter || checkBounds) { bounds = this.getInternalBounds(); } res = checkPosition && checkPoint('position') || checkCenter && checkPoint('center', 'Center'); if (!res && checkBounds) { var points = [ 'TopLeft', 'TopRight', 'BottomLeft', 'BottomRight', 'LeftCenter', 'TopCenter', 'RightCenter', 'BottomCenter' ]; for (var i = 0; i < 8 && !res; i++) { res = checkPoint('bounds', points[i]); } } res = filter(res); } if (!res) { res = this._hitTestChildren(point, options, viewMatrix) || checkSelf && filter(this._hitTestSelf(point, options, viewMatrix, this.getStrokeScaling() ? null : viewMatrix._shiftless().invert())) || null; } if (res && res.point) { res.point = matrix.transform(res.point); } return res; }, _hitTestSelf: function(point, options) { if (options.fill && this.hasFill() && this._contains(point)) return new HitResult('fill', this); }, matches: function(name, compare) { function matchObject(obj1, obj2) { for (var i in obj1) { if (obj1.hasOwnProperty(i)) { var val1 = obj1[i], val2 = obj2[i]; if (Base.isPlainObject(val1) && Base.isPlainObject(val2)) { if (!matchObject(val1, val2)) return false; } else if (!Base.equals(val1, val2)) { return false; } } } return true; } var type = typeof name; if (type === 'object') { for (var key in name) { if (name.hasOwnProperty(key) && !this.matches(key, name[key])) return false; } return true; } else if (type === 'function') { return name(this); } else if (name === 'match') { return compare(this); } else { var value = /^(empty|editable)$/.test(name) ? this['is' + Base.capitalize(name)]() : name === 'type' ? Base.hyphenate(this._class) : this[name]; if (name === 'class') { if (typeof compare === 'function') return this instanceof compare; value = this._class; } if (typeof compare === 'function') { return !!compare(value); } else if (compare) { if (compare.test) { return compare.test(value); } else if (Base.isPlainObject(compare)) { return matchObject(compare, value); } } return Base.equals(value, compare); } }, getItems: function(options) { return Item._getItems(this, options, this._matrix); }, getItem: function(options) { return Item._getItems(this, options, this._matrix, null, true)[0] || null; }, statics: { _getItems: function _getItems(item, options, matrix, param, firstOnly) { if (!param) { var obj = typeof options === 'object' && options, overlapping = obj && obj.overlapping, inside = obj && obj.inside, bounds = overlapping || inside, rect = bounds && Rectangle.read([bounds]); param = { items: [], recursive: obj && obj.recursive !== false, inside: !!inside, overlapping: !!overlapping, rect: rect, path: overlapping && new Path.Rectangle({ rectangle: rect, insert: false }) }; if (obj) { options = Base.filter({}, options, { recursive: true, inside: true, overlapping: true }); } } var children = item._children, items = param.items, rect = param.rect; matrix = rect && (matrix || new Matrix()); for (var i = 0, l = children && children.length; i < l; i++) { var child = children[i], childMatrix = matrix && matrix.appended(child._matrix), add = true; if (rect) { var bounds = child.getBounds(childMatrix); if (!rect.intersects(bounds)) continue; if (!(rect.contains(bounds) || param.overlapping && (bounds.contains(rect) || param.path.intersects(child, childMatrix)))) add = false; } if (add && child.matches(options)) { items.push(child); if (firstOnly) break; } if (param.recursive !== false) { _getItems(child, options, childMatrix, param, firstOnly); } if (firstOnly && items.length > 0) break; } return items; } } }, { importJSON: function(json) { var res = Base.importJSON(json, this); return res !== this ? this.addChild(res) : res; }, addChild: function(item) { return this.insertChild(undefined, item); }, insertChild: function(index, item) { var res = item ? this.insertChildren(index, [item]) : null; return res && res[0]; }, addChildren: function(items) { return this.insertChildren(this._children.length, items); }, insertChildren: function(index, items) { var children = this._children; if (children && items && items.length > 0) { items = Base.slice(items); var inserted = {}; for (var i = items.length - 1; i >= 0; i--) { var item = items[i], id = item && item._id; if (!item || inserted[id]) { items.splice(i, 1); } else { item._remove(false, true); inserted[id] = true; } } Base.splice(children, items, index, 0); var project = this._project, notifySelf = project._changes; for (var i = 0, l = items.length; i < l; i++) { var item = items[i], name = item._name; item._parent = this; item._setProject(project, true); if (name) item.setName(name); if (notifySelf) item._changed(5); } this._changed(11); } else { items = null; } return items; }, _insertItem: '#insertChild', _insertAt: function(item, offset) { var owner = item && item._getOwner(), res = item !== this && owner ? this : null; if (res) { res._remove(false, true); owner._insertItem(item._index + offset, res); } return res; }, insertAbove: function(item) { return this._insertAt(item, 1); }, insertBelow: function(item) { return this._insertAt(item, 0); }, sendToBack: function() { var owner = this._getOwner(); return owner ? owner._insertItem(0, this) : null; }, bringToFront: function() { var owner = this._getOwner(); return owner ? owner._insertItem(undefined, this) : null; }, appendTop: '#addChild', appendBottom: function(item) { return this.insertChild(0, item); }, moveAbove: '#insertAbove', moveBelow: '#insertBelow', addTo: function(owner) { return owner._insertItem(undefined, this); }, copyTo: function(owner) { return this.clone(false).addTo(owner); }, reduce: function(options) { var children = this._children; if (children && children.length === 1) { var child = children[0].reduce(options); if (this._parent) { child.insertAbove(this); this.remove(); } else { child.remove(); } return child; } return this; }, _removeNamed: function() { var owner = this._getOwner(); if (owner) { var children = owner._children, namedChildren = owner._namedChildren, name = this._name, namedArray = namedChildren[name], index = namedArray ? namedArray.indexOf(this) : -1; if (index !== -1) { if (children[name] == this) delete children[name]; namedArray.splice(index, 1); if (namedArray.length) { children[name] = namedArray[0]; } else { delete namedChildren[name]; } } } }, _remove: function(notifySelf, notifyParent) { var owner = this._getOwner(), project = this._project, index = this._index; if (this._style) this._style._dispose(); if (owner) { if (this._name) this._removeNamed(); if (index != null) { if (project._activeLayer === this) project._activeLayer = this.getNextSibling() || this.getPreviousSibling(); Base.splice(owner._children, null, index, 1); } this._installEvents(false); if (notifySelf && project._changes) this._changed(5); if (notifyParent) owner._changed(11, this); this._parent = null; return true; } return false; }, remove: function() { return this._remove(true, true); }, replaceWith: function(item) { var ok = item && item.insertBelow(this); if (ok) this.remove(); return ok; }, removeChildren: function(start, end) { if (!this._children) return null; start = start || 0; end = Base.pick(end, this._children.length); var removed = Base.splice(this._children, null, start, end - start); for (var i = removed.length - 1; i >= 0; i--) { removed[i]._remove(true, false); } if (removed.length > 0) this._changed(11); return removed; }, clear: '#removeChildren', reverseChildren: function() { if (this._children) { this._children.reverse(); for (var i = 0, l = this._children.length; i < l; i++) this._children[i]._index = i; this._changed(11); } }, isEmpty: function() { var children = this._children; return !children || !children.length; }, isEditable: function() { var item = this; while (item) { if (!item._visible || item._locked) return false; item = item._parent; } return true; }, hasFill: function() { return this.getStyle().hasFill(); }, hasStroke: function() { return this.getStyle().hasStroke(); }, hasShadow: function() { return this.getStyle().hasShadow(); }, _getOrder: function(item) { function getList(item) { var list = []; do { list.unshift(item); } while (item = item._parent); return list; } var list1 = getList(this), list2 = getList(item); for (var i = 0, l = Math.min(list1.length, list2.length); i < l; i++) { if (list1[i] != list2[i]) { return list1[i]._index < list2[i]._index ? 1 : -1; } } return 0; }, hasChildren: function() { return this._children && this._children.length > 0; }, isInserted: function() { return this._parent ? this._parent.isInserted() : false; }, isAbove: function(item) { return this._getOrder(item) === -1; }, isBelow: function(item) { return this._getOrder(item) === 1; }, isParent: function(item) { return this._parent === item; }, isChild: function(item) { return item && item._parent === this; }, isDescendant: function(item) { var parent = this; while (parent = parent._parent) { if (parent === item) return true; } return false; }, isAncestor: function(item) { return item ? item.isDescendant(this) : false; }, isSibling: function(item) { return this._parent === item._parent; }, isGroupedWith: function(item) { var parent = this._parent; while (parent) { if (parent._parent && /^(Group|Layer|CompoundPath)$/.test(parent._class) && item.isDescendant(parent)) return true; parent = parent._parent; } return false; }, }, Base.each(['rotate', 'scale', 'shear', 'skew'], function(key) { var rotate = key === 'rotate'; this[key] = function() { var value = (rotate ? Base : Point).read(arguments), center = Point.read(arguments, 0, { readNull: true }); return this.transform(new Matrix()[key](value, center || this.getPosition(true))); }; }, { translate: function() { var mx = new Matrix(); return this.transform(mx.translate.apply(mx, arguments)); }, transform: function(matrix, _applyMatrix, _applyRecursively, _setApplyMatrix) { var _matrix = this._matrix, transformMatrix = matrix && !matrix.isIdentity(), applyMatrix = (_applyMatrix || this._applyMatrix) && ((!_matrix.isIdentity() || transformMatrix) || _applyMatrix && _applyRecursively && this._children); if (!transformMatrix && !applyMatrix) return this; if (transformMatrix) { if (!matrix.isInvertible() && _matrix.isInvertible()) _matrix._backup = _matrix.getValues(); _matrix.prepend(matrix, true); var style = this._style, fillColor = style.getFillColor(true), strokeColor = style.getStrokeColor(true); if (fillColor) fillColor.transform(matrix); if (strokeColor) strokeColor.transform(matrix); } if (applyMatrix && (applyMatrix = this._transformContent(_matrix, _applyRecursively, _setApplyMatrix))) { var pivot = this._pivot; if (pivot) _matrix._transformPoint(pivot, pivot, true); _matrix.reset(true); if (_setApplyMatrix && this._canApplyMatrix) this._applyMatrix = true; } var bounds = this._bounds, position = this._position; if (transformMatrix || applyMatrix) { this._changed(25); } var decomp = transformMatrix && bounds && matrix.decompose(); if (decomp && decomp.skewing.isZero() && decomp.rotation % 90 === 0) { for (var key in bounds) { var cache = bounds[key]; if (cache.nonscaling) { delete bounds[key]; } else if (applyMatrix || !cache.internal) { var rect = cache.rect; matrix._transformBounds(rect, rect); } } this._bounds = bounds; var cached = bounds[this._getBoundsCacheKey( this._boundsOptions || {})]; if (cached) { this._position = this._getPositionFromBounds(cached.rect); } } else if (transformMatrix && position && this._pivot) { this._position = matrix._transformPoint(position, position); } return this; }, _transformContent: function(matrix, applyRecursively, setApplyMatrix) { var children = this._children; if (children) { for (var i = 0, l = children.length; i < l; i++) children[i].transform(matrix, true, applyRecursively, setApplyMatrix); return true; } }, globalToLocal: function() { return this.getGlobalMatrix(true)._inverseTransform( Point.read(arguments)); }, localToGlobal: function() { return this.getGlobalMatrix(true)._transformPoint( Point.read(arguments)); }, parentToLocal: function() { return this._matrix._inverseTransform(Point.read(arguments)); }, localToParent: function() { return this._matrix._transformPoint(Point.read(arguments)); }, fitBounds: function(rectangle, fill) { rectangle = Rectangle.read(arguments); var bounds = this.getBounds(), itemRatio = bounds.height / bounds.width, rectRatio = rectangle.height / rectangle.width, scale = (fill ? itemRatio > rectRatio : itemRatio < rectRatio) ? rectangle.width / bounds.width : rectangle.height / bounds.height, newBounds = new Rectangle(new Point(), new Size(bounds.width * scale, bounds.height * scale)); newBounds.setCenter(rectangle.getCenter()); this.setBounds(newBounds); } }), { _setStyles: function(ctx, param, viewMatrix) { var style = this._style, matrix = this._matrix; if (style.hasFill()) { ctx.fillStyle = style.getFillColor().toCanvasStyle(ctx, matrix); } if (style.hasStroke()) { ctx.strokeStyle = style.getStrokeColor().toCanvasStyle(ctx, matrix); ctx.lineWidth = style.getStrokeWidth(); var strokeJoin = style.getStrokeJoin(), strokeCap = style.getStrokeCap(), miterLimit = style.getMiterLimit(); if (strokeJoin) ctx.lineJoin = strokeJoin; if (strokeCap) ctx.lineCap = strokeCap; if (miterLimit) ctx.miterLimit = miterLimit; if (paper.support.nativeDash) { var dashArray = style.getDashArray(), dashOffset = style.getDashOffset(); if (dashArray && dashArray.length) { if ('setLineDash' in ctx) { ctx.setLineDash(dashArray); ctx.lineDashOffset = dashOffset; } else { ctx.mozDash = dashArray; ctx.mozDashOffset = dashOffset; } } } } if (style.hasShadow()) { var pixelRatio = param.pixelRatio || 1, mx = viewMatrix._shiftless().prepend( new Matrix().scale(pixelRatio, pixelRatio)), blur = mx.transform(new Point(style.getShadowBlur(), 0)), offset = mx.transform(this.getShadowOffset()); ctx.shadowColor = style.getShadowColor().toCanvasStyle(ctx); ctx.shadowBlur = blur.getLength(); ctx.shadowOffsetX = offset.x; ctx.shadowOffsetY = offset.y; } }, draw: function(ctx, param, parentStrokeMatrix) { var updateVersion = this._updateVersion = this._project._updateVersion; if (!this._visible || this._opacity === 0) return; var matrices = param.matrices, viewMatrix = param.viewMatrix, matrix = this._matrix, globalMatrix = matrices[matrices.length - 1].appended(matrix); if (!globalMatrix.isInvertible()) return; viewMatrix = viewMatrix ? viewMatrix.appended(globalMatrix) : globalMatrix; matrices.push(globalMatrix); if (param.updateMatrix) { this._globalMatrix = globalMatrix; } var blendMode = this._blendMode, opacity = this._opacity, normalBlend = blendMode === 'normal', nativeBlend = BlendMode.nativeModes[blendMode], direct = normalBlend && opacity === 1 || param.dontStart || param.clip || (nativeBlend || normalBlend && opacity < 1) && this._canComposite(), pixelRatio = param.pixelRatio || 1, mainCtx, itemOffset, prevOffset; if (!direct) { var bounds = this.getStrokeBounds(viewMatrix); if (!bounds.width || !bounds.height) { matrices.pop(); return; } prevOffset = param.offset; itemOffset = param.offset = bounds.getTopLeft().floor(); mainCtx = ctx; ctx = CanvasProvider.getContext(bounds.getSize().ceil().add(1) .multiply(pixelRatio)); if (pixelRatio !== 1) ctx.scale(pixelRatio, pixelRatio); } ctx.save(); var strokeMatrix = parentStrokeMatrix ? parentStrokeMatrix.appended(matrix) : this._canScaleStroke && !this.getStrokeScaling(true) && viewMatrix, clip = !direct && param.clipItem, transform = !strokeMatrix || clip; if (direct) { ctx.globalAlpha = opacity; if (nativeBlend) ctx.globalCompositeOperation = blendMode; } else if (transform) { ctx.translate(-itemOffset.x, -itemOffset.y); } if (transform) { (direct ? matrix : viewMatrix).applyToContext(ctx); } if (clip) { param.clipItem.draw(ctx, param.extend({ clip: true })); } if (strokeMatrix) { ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0); var offset = param.offset; if (offset) ctx.translate(-offset.x, -offset.y); } this._draw(ctx, param, viewMatrix, strokeMatrix); ctx.restore(); matrices.pop(); if (param.clip && !param.dontFinish) ctx.clip(); if (!direct) { BlendMode.process(blendMode, ctx, mainCtx, opacity, itemOffset.subtract(prevOffset).multiply(pixelRatio)); CanvasProvider.release(ctx); param.offset = prevOffset; } }, _isUpdated: function(updateVersion) { var parent = this._parent; if (parent instanceof CompoundPath) return parent._isUpdated(updateVersion); var updated = this._updateVersion === updateVersion; if (!updated && parent && parent._visible && parent._isUpdated(updateVersion)) { this._updateVersion = updateVersion; updated = true; } return updated; }, _drawSelection: function(ctx, matrix, size, selectionItems, updateVersion) { var selection = this._selection, itemSelected = selection & 1, boundsSelected = selection & 2 || itemSelected && this._selectBounds, positionSelected = selection & 4; if (!this._drawSelected) itemSelected = false; if ((itemSelected || boundsSelected || positionSelected) && this._isUpdated(updateVersion)) { var layer, color = this.getSelectedColor(true) || (layer = this.getLayer()) && layer.getSelectedColor(true), mx = matrix.appended(this.getGlobalMatrix(true)), half = size / 2; ctx.strokeStyle = ctx.fillStyle = color ? color.toCanvasStyle(ctx) : '#009dec'; ctx.lineWidth=2.5; if (itemSelected) this._drawSelected(ctx, mx, selectionItems); if (positionSelected) { var pos = this.getPosition(true), parent = this._parent, point = parent ? parent.localToGlobal(pos) : pos, x = point.x, y = point.y; ctx.beginPath(); ctx.arc(x, y, half, 0, Math.PI * 2, true); ctx.stroke(); var deltas = [[0, -1], [1, 0], [0, 1], [-1, 0]], start = half, end = size + 1; for (var i = 0; i < 4; i++) { var delta = deltas[i], dx = delta[0], dy = delta[1]; ctx.moveTo(x + dx * start, y + dy * start); ctx.lineTo(x + dx * end, y + dy * end); ctx.stroke(); } } if (boundsSelected) { var coords = mx._transformCorners(this.getInternalBounds()); ctx.beginPath(); for (var i = 0; i < 8; i++) { ctx[!i ? 'moveTo' : 'lineTo'](coords[i], coords[++i]); } ctx.closePath(); ctx.stroke(); for (var i = 0; i < 8; i++) { ctx.fillRect(coords[i] - half, coords[++i] - half, size, size); } } } }, _canComposite: function() { return false; } }, Base.each(['down', 'drag', 'up', 'move'], function(key) { this['removeOn' + Base.capitalize(key)] = function() { var hash = {}; hash[key] = true; return this.removeOn(hash); }; }, { removeOn: function(obj) { for (var name in obj) { if (obj[name]) { var key = 'mouse' + name, project = this._project, sets = project._removeSets = project._removeSets || {}; sets[key] = sets[key] || {}; sets[key][this._id] = this; } } return this; } })); var Group = Item.extend({ _class: 'Group', _selectBounds: false, _selectChildren: true, _serializeFields: { children: [] }, initialize: function Group(arg) { this._children = []; this._namedChildren = {}; if (!this._initialize(arg)) this.addChildren(Array.isArray(arg) ? arg : arguments); }, _changed: function _changed(flags) { _changed.base.call(this, flags); if (flags & 2050) { this._clipItem = undefined; } }, _getClipItem: function() { var clipItem = this._clipItem; if (clipItem === undefined) { clipItem = null; var children = this._children; for (var i = 0, l = children.length; i < l; i++) { if (children[i]._clipMask) { clipItem = children[i]; break; } } this._clipItem = clipItem; } return clipItem; }, isClipped: function() { return !!this._getClipItem(); }, setClipped: function(clipped) { var child = this.getFirstChild(); if (child) child.setClipMask(clipped); }, _getBounds: function _getBounds(matrix, options) { var clipItem = this._getClipItem(); return clipItem ? clipItem._getCachedBounds( matrix && matrix.appended(clipItem._matrix), Base.set({}, options, { stroke: false })) : _getBounds.base.call(this, matrix, options); }, _hitTestChildren: function _hitTestChildren(point, options, viewMatrix) { var clipItem = this._getClipItem(); return (!clipItem || clipItem.contains(point)) && _hitTestChildren.base.call(this, point, options, viewMatrix, clipItem); }, _draw: function(ctx, param) { var clip = param.clip, clipItem = !clip && this._getClipItem(); param = param.extend({ clipItem: clipItem, clip: false }); if (clip) { ctx.beginPath(); param.dontStart = param.dontFinish = true; } else if (clipItem) { clipItem.draw(ctx, param.extend({ clip: true })); } var children = this._children; for (var i = 0, l = children.length; i < l; i++) { var item = children[i]; if (item !== clipItem) item.draw(ctx, param); } } }); var Layer = Group.extend({ _class: 'Layer', initialize: function Layer() { Group.apply(this, arguments); }, _getOwner: function() { return this._parent || this._index != null && this._project; }, isInserted: function isInserted() { return this._parent ? isInserted.base.call(this) : this._index != null; }, activate: function() { this._project._activeLayer = this; }, _hitTestSelf: function() { } }); var Shape = Item.extend({ _class: 'Shape', _applyMatrix: false, _canApplyMatrix: false, _canScaleStroke: true, _serializeFields: { type: null, size: null, radius: null }, initialize: function Shape(props, point) { this._initialize(props, point); }, _equals: function(item) { return this._type === item._type && this._size.equals(item._size) && Base.equals(this._radius, item._radius); }, copyContent: function(source) { this.setType(source._type); this.setSize(source._size); this.setRadius(source._radius); }, getType: function() { return this._type; }, setType: function(type) { this._type = type; }, getShape: '#getType', setShape: '#setType', getSize: function() { var size = this._size; return new LinkedSize(size.width, size.height, this, 'setSize'); }, setSize: function() { var size = Size.read(arguments); if (!this._size) { this._size = size.clone(); } else if (!this._size.equals(size)) { var type = this._type, width = size.width, height = size.height; if (type === 'rectangle') { this._radius.set(Size.min(this._radius, size.divide(2))); } else if (type === 'circle') { width = height = (width + height) / 2; this._radius = width / 2; } else if (type === 'ellipse') { this._radius._set(width / 2, height / 2); } this._size._set(width, height); this._changed(9); } }, getRadius: function() { var rad = this._radius; return this._type === 'circle' ? rad : new LinkedSize(rad.width, rad.height, this, 'setRadius'); }, setRadius: function(radius) { var type = this._type; if (type === 'circle') { if (radius === this._radius) return; var size = radius * 2; this._radius = radius; this._size._set(size, size); } else { radius = Size.read(arguments); if (!this._radius) { this._radius = radius.clone(); } else { if (this._radius.equals(radius)) return; this._radius.set(radius); if (type === 'rectangle') { var size = Size.max(this._size, radius.multiply(2)); this._size.set(size); } else if (type === 'ellipse') { this._size._set(radius.width * 2, radius.height * 2); } } } this._changed(9); }, isEmpty: function() { return false; }, toPath: function(insert) { var path = new Path[Base.capitalize(this._type)]({ center: new Point(), size: this._size, radius: this._radius, insert: false }); path.copyAttributes(this); if (paper.settings.applyMatrix) path.setApplyMatrix(true); if (insert === undefined || insert) path.insertAbove(this); return path; }, toShape: '#clone', _asPathItem: function() { return this.toPath(false); }, _draw: function(ctx, param, viewMatrix, strokeMatrix) { var style = this._style, hasFill = style.hasFill(), hasStroke = style.hasStroke(), dontPaint = param.dontFinish || param.clip, untransformed = !strokeMatrix; if (hasFill || hasStroke || dontPaint) { var type = this._type, radius = this._radius, isCircle = type === 'circle'; if (!param.dontStart) ctx.beginPath(); if (untransformed && isCircle) { ctx.arc(0, 0, radius, 0, Math.PI * 2, true); } else { var rx = isCircle ? radius : radius.width, ry = isCircle ? radius : radius.height, size = this._size, width = size.width, height = size.height; if (untransformed && type === 'rectangle' && rx === 0 && ry === 0) { ctx.rect(-width / 2, -height / 2, width, height); } else { var x = width / 2, y = height / 2, kappa = 1 - 0.5522847498307936, cx = rx * kappa, cy = ry * kappa, c = [ -x, -y + ry, -x, -y + cy, -x + cx, -y, -x + rx, -y, x - rx, -y, x - cx, -y, x, -y + cy, x, -y + ry, x, y - ry, x, y - cy, x - cx, y, x - rx, y, -x + rx, y, -x + cx, y, -x, y - cy, -x, y - ry ]; if (strokeMatrix) strokeMatrix.transform(c, c, 32); ctx.moveTo(c[0], c[1]); ctx.bezierCurveTo(c[2], c[3], c[4], c[5], c[6], c[7]); if (x !== rx) ctx.lineTo(c[8], c[9]); ctx.bezierCurveTo(c[10], c[11], c[12], c[13], c[14], c[15]); if (y !== ry) ctx.lineTo(c[16], c[17]); ctx.bezierCurveTo(c[18], c[19], c[20], c[21], c[22], c[23]); if (x !== rx) ctx.lineTo(c[24], c[25]); ctx.bezierCurveTo(c[26], c[27], c[28], c[29], c[30], c[31]); } } ctx.closePath(); } if (!dontPaint && (hasFill || hasStroke)) { this._setStyles(ctx, param, viewMatrix); if (hasFill) { ctx.fill(style.getFillRule()); ctx.shadowColor = 'rgba(0,0,0,0)'; } if (hasStroke) ctx.stroke(); } }, _canComposite: function() { return !(this.hasFill() && this.hasStroke()); }, _getBounds: function(matrix, options) { var rect = new Rectangle(this._size).setCenter(0, 0), style = this._style, strokeWidth = options.stroke && style.hasStroke() && style.getStrokeWidth(); if (matrix) rect = matrix._transformBounds(rect); return strokeWidth ? rect.expand(Path._getStrokePadding(strokeWidth, this._getStrokeMatrix(matrix, options))) : rect; } }, new function() { function getCornerCenter(that, point, expand) { var radius = that._radius; if (!radius.isZero()) { var halfSize = that._size.divide(2); for (var q = 1; q <= 4; q++) { var dir = new Point(q > 1 && q < 4 ? -1 : 1, q > 2 ? -1 : 1), corner = dir.multiply(halfSize), center = corner.subtract(dir.multiply(radius)), rect = new Rectangle( expand ? corner.add(dir.multiply(expand)) : corner, center); if (rect.contains(point)) return { point: center, quadrant: q }; } } } function isOnEllipseStroke(point, radius, padding, quadrant) { var vector = point.divide(radius); return (!quadrant || vector.isInQuadrant(quadrant)) && vector.subtract(vector.normalize()).multiply(radius) .divide(padding).length <= 1; } return { _contains: function _contains(point) { if (this._type === 'rectangle') { var center = getCornerCenter(this, point); return center ? point.subtract(center.point).divide(this._radius) .getLength() <= 1 : _contains.base.call(this, point); } else { return point.divide(this.size).getLength() <= 0.5; } }, _hitTestSelf: function _hitTestSelf(point, options, viewMatrix, strokeMatrix) { var hit = false, style = this._style, hitStroke = options.stroke && style.hasStroke(), hitFill = options.fill && style.hasFill(); if (hitStroke || hitFill) { var type = this._type, radius = this._radius, strokeRadius = hitStroke ? style.getStrokeWidth() / 2 : 0, strokePadding = options._tolerancePadding.add( Path._getStrokePadding(strokeRadius, !style.getStrokeScaling() && strokeMatrix)); if (type === 'rectangle') { var padding = strokePadding.multiply(2), center = getCornerCenter(this, point, padding); if (center) { hit = isOnEllipseStroke(point.subtract(center.point), radius, strokePadding, center.quadrant); } else { var rect = new Rectangle(this._size).setCenter(0, 0), outer = rect.expand(padding), inner = rect.expand(padding.negate()); hit = outer._containsPoint(point) && !inner._containsPoint(point); } } else { hit = isOnEllipseStroke(point, radius, strokePadding); } } return hit ? new HitResult(hitStroke ? 'stroke' : 'fill', this) : _hitTestSelf.base.apply(this, arguments); } }; }, { statics: new function() { function createShape(type, point, size, radius, args) { var item = new Shape(Base.getNamed(args), point); item._type = type; item._size = size; item._radius = radius; return item; } return { Circle: function() { var center = Point.readNamed(arguments, 'center'), radius = Base.readNamed(arguments, 'radius'); return createShape('circle', center, new Size(radius * 2), radius, arguments); }, Rectangle: function() { var rect = Rectangle.readNamed(arguments, 'rectangle'), radius = Size.min(Size.readNamed(arguments, 'radius'), rect.getSize(true).divide(2)); return createShape('rectangle', rect.getCenter(true), rect.getSize(true), radius, arguments); }, Ellipse: function() { var ellipse = Shape._readEllipse(arguments), radius = ellipse.radius; return createShape('ellipse', ellipse.center, radius.multiply(2), radius, arguments); }, _readEllipse: function(args) { var center, radius; if (Base.hasNamed(args, 'radius')) { center = Point.readNamed(args, 'center'); radius = Size.readNamed(args, 'radius'); } else { var rect = Rectangle.readNamed(args, 'rectangle'); center = rect.getCenter(true); radius = rect.getSize(true).divide(2); } return { center: center, radius: radius }; } }; }}); var Raster = Item.extend({ _class: 'Raster', _applyMatrix: false, _canApplyMatrix: false, _boundsOptions: { stroke: false, handle: false }, _serializeFields: { crossOrigin: null, source: null }, _prioritize: ['crossOrigin'], _smoothing: false, initialize: function Raster(object, position) { if (!this._initialize(object, position !== undefined && Point.read(arguments, 1))) { var image = typeof object === 'string' ? document.getElementById(object) : object; if (image) { this.setImage(image); } else { this.setSource(object); } } if (!this._size) { this._size = new Size(); this._loaded = false; } }, _equals: function(item) { return this.getSource() === item.getSource(); }, copyContent: function(source) { var image = source._image, canvas = source._canvas; if (image) { this._setImage(image); } else if (canvas) { var copyCanvas = CanvasProvider.getCanvas(source._size); copyCanvas.getContext('2d').drawImage(canvas, 0, 0); this._setImage(copyCanvas); } this._crossOrigin = source._crossOrigin; }, getSize: function() { var size = this._size; return new LinkedSize(size ? size.width : 0, size ? size.height : 0, this, 'setSize'); }, setSize: function() { var size = Size.read(arguments); if (!size.equals(this._size)) { if (size.width > 0 && size.height > 0) { var element = this.getElement(); this._setImage(CanvasProvider.getCanvas(size)); if (element) this.getContext(true).drawImage(element, 0, 0, size.width, size.height); } else { if (this._canvas) CanvasProvider.release(this._canvas); this._size = size.clone(); } } }, getWidth: function() { return this._size ? this._size.width : 0; }, setWidth: function(width) { this.setSize(width, this.getHeight()); }, getHeight: function() { return this._size ? this._size.height : 0; }, setHeight: function(height) { this.setSize(this.getWidth(), height); }, getLoaded: function() { return this._loaded; }, isEmpty: function() { var size = this._size; return !size || size.width === 0 && size.height === 0; }, getResolution: function() { var matrix = this._matrix, orig = new Point(0, 0).transform(matrix), u = new Point(1, 0).transform(matrix).subtract(orig), v = new Point(0, 1).transform(matrix).subtract(orig); return new Size( 72 / u.getLength(), 72 / v.getLength() ); }, getPpi: '#getResolution', getImage: function() { return this._image; }, setImage: function(image) { var that = this; function emit(event) { var view = that.getView(), type = event && event.type || 'load'; if (view && that.responds(type)) { paper = view._scope; that.emit(type, new Event(event)); } } this._setImage(image); if (this._loaded) { setTimeout(emit, 0); } else if (image) { DomEvent.add(image, { load: function(event) { that._setImage(image); emit(event); }, error: emit }); } }, _setImage: function(image) { if (this._canvas) CanvasProvider.release(this._canvas); if (image && image.getContext) { this._image = null; this._canvas = image; this._loaded = true; } else { this._image = image; this._canvas = null; this._loaded = !!(image && image.src && image.complete); } this._size = new Size( image ? image.naturalWidth || image.width : 0, image ? image.naturalHeight || image.height : 0); this._context = null; this._changed(1033); }, getCanvas: function() { if (!this._canvas) { var ctx = CanvasProvider.getContext(this._size); try { if (this._image) ctx.drawImage(this._image, 0, 0); this._canvas = ctx.canvas; } catch (e) { CanvasProvider.release(ctx); } } return this._canvas; }, setCanvas: '#setImage', getContext: function(modify) { if (!this._context) this._context = this.getCanvas().getContext('2d'); if (modify) { this._image = null; this._changed(1025); } return this._context; }, setContext: function(context) { this._context = context; }, getSource: function() { var image = this._image; return image && image.src || this.toDataURL(); }, setSource: function(src) { var image = new self.Image(), crossOrigin = this._crossOrigin; if (crossOrigin) image.crossOrigin = crossOrigin; image.src = src; this.setImage(image); }, getCrossOrigin: function() { var image = this._image; return image && image.crossOrigin || this._crossOrigin || ''; }, setCrossOrigin: function(crossOrigin) { this._crossOrigin = crossOrigin; var image = this._image; if (image) image.crossOrigin = crossOrigin; }, getSmoothing: function() { return this._smoothing; }, setSmoothing: function(smoothing) { this._smoothing = smoothing; this._changed(257); }, getElement: function() { return this._canvas || this._loaded && this._image; } }, { beans: false, getSubCanvas: function() { var rect = Rectangle.read(arguments), ctx = CanvasProvider.getContext(rect.getSize()); var clippedStartX = Math.max(0, rect.x); var clippedStartY = Math.max(0, rect.y); var clippedEndX = Math.min(this.getCanvas().width, rect.x + rect.width); var clippedEndY = Math.min(this.getCanvas().height, rect.y + rect.height); ctx.drawImage(this.getCanvas(), clippedStartX, clippedStartY, clippedEndX - clippedStartX, clippedEndY - clippedStartY, clippedStartX - rect.x, clippedStartY - rect.y, clippedEndX - clippedStartX, clippedEndY - clippedStartY ); return ctx.canvas; }, getSubRaster: function() { var rect = Rectangle.read(arguments), raster = new Raster(Item.NO_INSERT); raster._setImage(this.getSubCanvas(rect)); raster.translate(rect.getCenter().subtract(this.getSize().divide(2))); raster._matrix.prepend(this._matrix); raster.insertAbove(this); return raster; }, toDataURL: function() { var image = this._image, src = image && image.src; if (/^data:/.test(src)) return src; var canvas = this.getCanvas(); return canvas ? canvas.toDataURL.apply(canvas, arguments) : null; }, drawImage: function(image ) { var point = Point.read(arguments, 1); this.getContext(true).drawImage(image, point.x, point.y); }, getAverageColor: function(object) { var bounds, path; if (!object) { bounds = this.getBounds(); } else if (object instanceof PathItem) { path = object; bounds = object.getBounds(); } else if (typeof object === 'object') { if ('width' in object) { bounds = new Rectangle(object); } else if ('x' in object) { bounds = new Rectangle(object.x - 0.5, object.y - 0.5, 1, 1); } } if (!bounds) return null; var sampleSize = 32, width = Math.min(bounds.width, sampleSize), height = Math.min(bounds.height, sampleSize); var ctx = Raster._sampleContext; if (!ctx) { ctx = Raster._sampleContext = CanvasProvider.getContext( new Size(sampleSize)); } else { ctx.clearRect(0, 0, sampleSize + 1, sampleSize + 1); } ctx.save(); var matrix = new Matrix() .scale(width / bounds.width, height / bounds.height) .translate(-bounds.x, -bounds.y); matrix.applyToContext(ctx); if (path) path.draw(ctx, new Base({ clip: true, matrices: [matrix] })); this._matrix.applyToContext(ctx); var element = this.getElement(), size = this._size; if (element) ctx.drawImage(element, -size.width / 2, -size.height / 2); ctx.restore(); var pixels = ctx.getImageData(0.5, 0.5, Math.ceil(width), Math.ceil(height)).data, channels = [0, 0, 0], total = 0; for (var i = 0, l = pixels.length; i < l; i += 4) { var alpha = pixels[i + 3]; total += alpha; alpha /= 255; channels[0] += pixels[i] * alpha; channels[1] += pixels[i + 1] * alpha; channels[2] += pixels[i + 2] * alpha; } for (var i = 0; i < 3; i++) channels[i] /= total; return total ? Color.read(channels) : null; }, getPixel: function() { var point = Point.read(arguments); var data = this.getContext().getImageData(point.x, point.y, 1, 1).data; return new Color('rgb', [data[0] / 255, data[1] / 255, data[2] / 255], data[3] / 255); }, setPixel: function() { var point = Point.read(arguments), color = Color.read(arguments), components = color._convert('rgb'), alpha = color._alpha, ctx = this.getContext(true), imageData = ctx.createImageData(1, 1), data = imageData.data; data[0] = components[0] * 255; data[1] = components[1] * 255; data[2] = components[2] * 255; data[3] = alpha != null ? alpha * 255 : 255; ctx.putImageData(imageData, point.x, point.y); }, createImageData: function() { var size = Size.read(arguments); return this.getContext().createImageData(size.width, size.height); }, getImageData: function() { var rect = Rectangle.read(arguments); if (rect.isEmpty()) rect = new Rectangle(this._size); return this.getContext().getImageData(rect.x, rect.y, rect.width, rect.height); }, setImageData: function(data ) { var point = Point.read(arguments, 1); this.getContext(true).putImageData(data, point.x, point.y); }, _getBounds: function(matrix, options) { var rect = new Rectangle(this._size).setCenter(0, 0); return matrix ? matrix._transformBounds(rect) : rect; }, _hitTestSelf: function(point) { if (this._contains(point)) { var that = this; return new HitResult('pixel', that, { offset: point.add(that._size.divide(2)).round(), color: { get: function() { return that.getPixel(this.offset); } } }); } }, _draw: function(ctx, param, viewMatrix) { var element = this.getElement(); if (element) { ctx.globalAlpha = this._opacity; this._setStyles(ctx, param, viewMatrix); DomElement.setPrefixed( ctx, 'imageSmoothingEnabled', this._smoothing ); ctx.drawImage(element, -this._size.width / 2, -this._size.height / 2); } }, _canComposite: function() { return true; } }); var SymbolItem = Item.extend({ _class: 'SymbolItem', _applyMatrix: false, _canApplyMatrix: false, _boundsOptions: { stroke: true }, _serializeFields: { symbol: null }, initialize: function SymbolItem(arg0, arg1) { if (!this._initialize(arg0, arg1 !== undefined && Point.read(arguments, 1))) this.setDefinition(arg0 instanceof SymbolDefinition ? arg0 : new SymbolDefinition(arg0)); }, _equals: function(item) { return this._definition === item._definition; }, copyContent: function(source) { this.setDefinition(source._definition); }, getDefinition: function() { return this._definition; }, setDefinition: function(definition) { this._definition = definition; this._changed(9); }, getSymbol: '#getDefinition', setSymbol: '#setDefinition', isEmpty: function() { return this._definition._item.isEmpty(); }, _getBounds: function(matrix, options) { var item = this._definition._item; return item._getCachedBounds(item._matrix.prepended(matrix), options); }, _hitTestSelf: function(point, options, viewMatrix) { var res = this._definition._item._hitTest(point, options, viewMatrix); if (res) res.item = this; return res; }, _draw: function(ctx, param) { this._definition._item.draw(ctx, param); } }); var SymbolDefinition = Base.extend({ _class: 'SymbolDefinition', initialize: function SymbolDefinition(item, dontCenter) { this._id = UID.get(); this.project = paper.project; if (item) this.setItem(item, dontCenter); }, _serialize: function(options, dictionary) { return dictionary.add(this, function() { return Base.serialize([this._class, this._item], options, false, dictionary); }); }, _changed: function(flags) { if (flags & 8) Item._clearBoundsCache(this); if (flags & 1) this.project._changed(flags); }, getItem: function() { return this._item; }, setItem: function(item, _dontCenter) { if (item._symbol) item = item.clone(); if (this._item) this._item._symbol = null; this._item = item; item.remove(); item.setSelected(false); if (!_dontCenter) item.setPosition(new Point()); item._symbol = this; this._changed(9); }, getDefinition: '#getItem', setDefinition: '#setItem', place: function(position) { return new SymbolItem(this, position); }, clone: function() { return new SymbolDefinition(this._item.clone(false)); }, equals: function(symbol) { return symbol === this || symbol && this._item.equals(symbol._item) || false; } }); var HitResult = Base.extend({ _class: 'HitResult', initialize: function HitResult(type, item, values) { this.type = type; this.item = item; if (values) this.inject(values); }, statics: { getOptions: function(args) { var options = args && Base.read(args); return Base.set({ type: null, tolerance: paper.settings.hitTolerance, fill: !options, stroke: !options, segments: !options, handles: false, ends: false, position: false, center: false, bounds: false, guides: false, selected: false }, options); } } }); var Segment = Base.extend({ _class: 'Segment', beans: true, _selection: 0, initialize: function Segment(arg0, arg1, arg2, arg3, arg4, arg5) { var count = arguments.length, point, handleIn, handleOut, selection; if (count > 0) { if (arg0 == null || typeof arg0 === 'object') { if (count === 1 && arg0 && 'point' in arg0) { point = arg0.point; handleIn = arg0.handleIn; handleOut = arg0.handleOut; selection = arg0.selection; } else { point = arg0; handleIn = arg1; handleOut = arg2; selection = arg3; } } else { point = [ arg0, arg1 ]; handleIn = arg2 !== undefined ? [ arg2, arg3 ] : null; handleOut = arg4 !== undefined ? [ arg4, arg5 ] : null; } } new SegmentPoint(point, this, '_point'); new SegmentPoint(handleIn, this, '_handleIn'); new SegmentPoint(handleOut, this, '_handleOut'); if (selection) this.setSelection(selection); }, _serialize: function(options, dictionary) { var point = this._point, selection = this._selection, obj = selection || this.hasHandles() ? [point, this._handleIn, this._handleOut] : point; if (selection) obj.push(selection); return Base.serialize(obj, options, true, dictionary); }, _changed: function(point) { var path = this._path; if (!path) return; var curves = path._curves, index = this._index, curve; if (curves) { if ((!point || point === this._point || point === this._handleIn) && (curve = index > 0 ? curves[index - 1] : path._closed ? curves[curves.length - 1] : null)) curve._changed(); if ((!point || point === this._point || point === this._handleOut) && (curve = curves[index])) curve._changed(); } path._changed(41); }, getPoint: function() { return this._point; }, setPoint: function() { this._point.set(Point.read(arguments)); }, getHandleIn: function() { return this._handleIn; }, setHandleIn: function() { this._handleIn.set(Point.read(arguments)); }, getHandleOut: function() { return this._handleOut; }, setHandleOut: function() { this._handleOut.set(Point.read(arguments)); }, hasHandles: function() { return !this._handleIn.isZero() || !this._handleOut.isZero(); }, isSmooth: function() { var handleIn = this._handleIn, handleOut = this._handleOut; return !handleIn.isZero() && !handleOut.isZero() && handleIn.isCollinear(handleOut); }, clearHandles: function() { this._handleIn._set(0, 0); this._handleOut._set(0, 0); }, getSelection: function() { return this._selection; }, setSelection: function(selection) { var oldSelection = this._selection, path = this._path; this._selection = selection = selection || 0; if (path && selection !== oldSelection) { path._updateSelection(this, oldSelection, selection); path._changed(257); } }, _changeSelection: function(flag, selected) { var selection = this._selection; this.setSelection(selected ? selection | flag : selection & ~flag); }, isSelected: function() { return !!(this._selection & 7); }, setSelected: function(selected) { this._changeSelection(7, selected); }, getIndex: function() { return this._index !== undefined ? this._index : null; }, getPath: function() { return this._path || null; }, getCurve: function() { var path = this._path, index = this._index; if (path) { if (index > 0 && !path._closed && index === path._segments.length - 1) index--; return path.getCurves()[index] || null; } return null; }, getLocation: function() { var curve = this.getCurve(); return curve ? new CurveLocation(curve, this === curve._segment1 ? 0 : 1) : null; }, getNext: function() { var segments = this._path && this._path._segments; return segments && (segments[this._index + 1] || this._path._closed && segments[0]) || null; }, smooth: function(options, _first, _last) { var opts = options || {}, type = opts.type, factor = opts.factor, prev = this.getPrevious(), next = this.getNext(), p0 = (prev || this)._point, p1 = this._point, p2 = (next || this)._point, d1 = p0.getDistance(p1), d2 = p1.getDistance(p2); if (!type || type === 'catmull-rom') { var a = factor === undefined ? 0.5 : factor, d1_a = Math.pow(d1, a), d1_2a = d1_a * d1_a, d2_a = Math.pow(d2, a), d2_2a = d2_a * d2_a; if (!_first && prev) { var A = 2 * d2_2a + 3 * d2_a * d1_a + d1_2a, N = 3 * d2_a * (d2_a + d1_a); this.setHandleIn(N !== 0 ? new Point( (d2_2a * p0._x + A * p1._x - d1_2a * p2._x) / N - p1._x, (d2_2a * p0._y + A * p1._y - d1_2a * p2._y) / N - p1._y) : new Point()); } if (!_last && next) { var A = 2 * d1_2a + 3 * d1_a * d2_a + d2_2a, N = 3 * d1_a * (d1_a + d2_a); this.setHandleOut(N !== 0 ? new Point( (d1_2a * p2._x + A * p1._x - d2_2a * p0._x) / N - p1._x, (d1_2a * p2._y + A * p1._y - d2_2a * p0._y) / N - p1._y) : new Point()); } } else if (type === 'geometric') { if (prev && next) { var vector = p0.subtract(p2), t = factor === undefined ? 0.4 : factor, k = t * d1 / (d1 + d2); if (!_first) this.setHandleIn(vector.multiply(k)); if (!_last) this.setHandleOut(vector.multiply(k - t)); } } else { throw new Error('Smoothing method \'' + type + '\' not supported.'); } }, getPrevious: function() { var segments = this._path && this._path._segments; return segments && (segments[this._index - 1] || this._path._closed && segments[segments.length - 1]) || null; }, isFirst: function() { return !this._index; }, isLast: function() { var path = this._path; return path && this._index === path._segments.length - 1 || false; }, reverse: function() { var handleIn = this._handleIn, handleOut = this._handleOut, tmp = handleIn.clone(); handleIn.set(handleOut); handleOut.set(tmp); }, reversed: function() { return new Segment(this._point, this._handleOut, this._handleIn); }, remove: function() { return this._path ? !!this._path.removeSegment(this._index) : false; }, clone: function() { return new Segment(this._point, this._handleIn, this._handleOut); }, equals: function(segment) { return segment === this || segment && this._class === segment._class && this._point.equals(segment._point) && this._handleIn.equals(segment._handleIn) && this._handleOut.equals(segment._handleOut) || false; }, toString: function() { var parts = [ 'point: ' + this._point ]; if (!this._handleIn.isZero()) parts.push('handleIn: ' + this._handleIn); if (!this._handleOut.isZero()) parts.push('handleOut: ' + this._handleOut); return '{ ' + parts.join(', ') + ' }'; }, transform: function(matrix) { this._transformCoordinates(matrix, new Array(6), true); this._changed(); }, interpolate: function(from, to, factor) { var u = 1 - factor, v = factor, point1 = from._point, point2 = to._point, handleIn1 = from._handleIn, handleIn2 = to._handleIn, handleOut2 = to._handleOut, handleOut1 = from._handleOut; this._point._set( u * point1._x + v * point2._x, u * point1._y + v * point2._y, true); this._handleIn._set( u * handleIn1._x + v * handleIn2._x, u * handleIn1._y + v * handleIn2._y, true); this._handleOut._set( u * handleOut1._x + v * handleOut2._x, u * handleOut1._y + v * handleOut2._y, true); this._changed(); }, _transformCoordinates: function(matrix, coords, change) { var point = this._point, handleIn = !change || !this._handleIn.isZero() ? this._handleIn : null, handleOut = !change || !this._handleOut.isZero() ? this._handleOut : null, x = point._x, y = point._y, i = 2; coords[0] = x; coords[1] = y; if (handleIn) { coords[i++] = handleIn._x + x; coords[i++] = handleIn._y + y; } if (handleOut) { coords[i++] = handleOut._x + x; coords[i++] = handleOut._y + y; } if (matrix) { matrix._transformCoordinates(coords, coords, i / 2); x = coords[0]; y = coords[1]; if (change) { point._x = x; point._y = y; i = 2; if (handleIn) { handleIn._x = coords[i++] - x; handleIn._y = coords[i++] - y; } if (handleOut) { handleOut._x = coords[i++] - x; handleOut._y = coords[i++] - y; } } else { if (!handleIn) { coords[i++] = x; coords[i++] = y; } if (!handleOut) { coords[i++] = x; coords[i++] = y; } } } return coords; } }); var SegmentPoint = Point.extend({ initialize: function SegmentPoint(point, owner, key) { var x, y, selected; if (!point) { x = y = 0; } else if ((x = point[0]) !== undefined) { y = point[1]; } else { var pt = point; if ((x = pt.x) === undefined) { pt = Point.read(arguments); x = pt.x; } y = pt.y; selected = pt.selected; } this._x = x; this._y = y; this._owner = owner; owner[key] = this; if (selected) this.setSelected(true); }, _set: function(x, y) { this._x = x; this._y = y; this._owner._changed(this); return this; }, getX: function() { return this._x; }, setX: function(x) { this._x = x; this._owner._changed(this); }, getY: function() { return this._y; }, setY: function(y) { this._y = y; this._owner._changed(this); }, isZero: function() { var isZero = Numerical.isZero; return isZero(this._x) && isZero(this._y); }, isSelected: function() { return !!(this._owner._selection & this._getSelection()); }, setSelected: function(selected) { this._owner._changeSelection(this._getSelection(), selected); }, _getSelection: function() { var owner = this._owner; return this === owner._point ? 1 : this === owner._handleIn ? 2 : this === owner._handleOut ? 4 : 0; } }); var Curve = Base.extend({ _class: 'Curve', beans: true, initialize: function Curve(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) { var count = arguments.length, seg1, seg2, point1, point2, handle1, handle2; if (count === 3) { this._path = arg0; seg1 = arg1; seg2 = arg2; } else if (!count) { seg1 = new Segment(); seg2 = new Segment(); } else if (count === 1) { if ('segment1' in arg0) { seg1 = new Segment(arg0.segment1); seg2 = new Segment(arg0.segment2); } else if ('point1' in arg0) { point1 = arg0.point1; handle1 = arg0.handle1; handle2 = arg0.handle2; point2 = arg0.point2; } else if (Array.isArray(arg0)) { point1 = [arg0[0], arg0[1]]; point2 = [arg0[6], arg0[7]]; handle1 = [arg0[2] - arg0[0], arg0[3] - arg0[1]]; handle2 = [arg0[4] - arg0[6], arg0[5] - arg0[7]]; } } else if (count === 2) { seg1 = new Segment(arg0); seg2 = new Segment(arg1); } else if (count === 4) { point1 = arg0; handle1 = arg1; handle2 = arg2; point2 = arg3; } else if (count === 8) { point1 = [arg0, arg1]; point2 = [arg6, arg7]; handle1 = [arg2 - arg0, arg3 - arg1]; handle2 = [arg4 - arg6, arg5 - arg7]; } this._segment1 = seg1 || new Segment(point1, null, handle1); this._segment2 = seg2 || new Segment(point2, handle2, null); }, _serialize: function(options, dictionary) { return Base.serialize(this.hasHandles() ? [this.getPoint1(), this.getHandle1(), this.getHandle2(), this.getPoint2()] : [this.getPoint1(), this.getPoint2()], options, true, dictionary); }, _changed: function() { this._length = this._bounds = undefined; }, clone: function() { return new Curve(this._segment1, this._segment2); }, toString: function() { var parts = [ 'point1: ' + this._segment1._point ]; if (!this._segment1._handleOut.isZero()) parts.push('handle1: ' + this._segment1._handleOut); if (!this._segment2._handleIn.isZero()) parts.push('handle2: ' + this._segment2._handleIn); parts.push('point2: ' + this._segment2._point); return '{ ' + parts.join(', ') + ' }'; }, classify: function() { return Curve.classify(this.getValues()); }, remove: function() { var removed = false; if (this._path) { var segment2 = this._segment2, handleOut = segment2._handleOut; removed = segment2.remove(); if (removed) this._segment1._handleOut.set(handleOut); } return removed; }, getPoint1: function() { return this._segment1._point; }, setPoint1: function() { this._segment1._point.set(Point.read(arguments)); }, getPoint2: function() { return this._segment2._point; }, setPoint2: function() { this._segment2._point.set(Point.read(arguments)); }, getHandle1: function() { return this._segment1._handleOut; }, setHandle1: function() { this._segment1._handleOut.set(Point.read(arguments)); }, getHandle2: function() { return this._segment2._handleIn; }, setHandle2: function() { this._segment2._handleIn.set(Point.read(arguments)); }, getSegment1: function() { return this._segment1; }, getSegment2: function() { return this._segment2; }, getPath: function() { return this._path; }, getIndex: function() { return this._segment1._index; }, getNext: function() { var curves = this._path && this._path._curves; return curves && (curves[this._segment1._index + 1] || this._path._closed && curves[0]) || null; }, getPrevious: function() { var curves = this._path && this._path._curves; return curves && (curves[this._segment1._index - 1] || this._path._closed && curves[curves.length - 1]) || null; }, isFirst: function() { return !this._segment1._index; }, isLast: function() { var path = this._path; return path && this._segment1._index === path._curves.length - 1 || false; }, isSelected: function() { return this.getPoint1().isSelected() && this.getHandle1().isSelected() && this.getHandle2().isSelected() && this.getPoint2().isSelected(); }, setSelected: function(selected) { this.getPoint1().setSelected(selected); this.getHandle1().setSelected(selected); this.getHandle2().setSelected(selected); this.getPoint2().setSelected(selected); }, getValues: function(matrix) { return Curve.getValues(this._segment1, this._segment2, matrix); }, getPoints: function() { var coords = this.getValues(), points = []; for (var i = 0; i < 8; i += 2) points.push(new Point(coords[i], coords[i + 1])); return points; } }, { getLength: function() { if (this._length == null) this._length = Curve.getLength(this.getValues(), 0, 1); return this._length; }, getArea: function() { return Curve.getArea(this.getValues()); }, getLine: function() { return new Line(this._segment1._point, this._segment2._point); }, getPart: function(from, to) { return new Curve(Curve.getPart(this.getValues(), from, to)); }, getPartLength: function(from, to) { return Curve.getLength(this.getValues(), from, to); }, divideAt: function(location) { return this.divideAtTime(location && location.curve === this ? location.time : this.getTimeAt(location)); }, divideAtTime: function(time, _setHandles) { var tMin = 1e-8, tMax = 1 - tMin, res = null; if (time >= tMin && time <= tMax) { var parts = Curve.subdivide(this.getValues(), time), left = parts[0], right = parts[1], setHandles = _setHandles || this.hasHandles(), seg1 = this._segment1, seg2 = this._segment2, path = this._path; if (setHandles) { seg1._handleOut._set(left[2] - left[0], left[3] - left[1]); seg2._handleIn._set(right[4] - right[6],right[5] - right[7]); } var x = left[6], y = left[7], segment = new Segment(new Point(x, y), setHandles && new Point(left[4] - x, left[5] - y), setHandles && new Point(right[2] - x, right[3] - y)); if (path) { path.insert(seg1._index + 1, segment); res = this.getNext(); } else { this._segment2 = segment; this._changed(); res = new Curve(segment, seg2); } } return res; }, splitAt: function(location) { var path = this._path; return path ? path.splitAt(location) : null; }, splitAtTime: function(time) { return this.splitAt(this.getLocationAtTime(time)); }, divide: function(offset, isTime) { return this.divideAtTime(offset === undefined ? 0.5 : isTime ? offset : this.getTimeAt(offset)); }, split: function(offset, isTime) { return this.splitAtTime(offset === undefined ? 0.5 : isTime ? offset : this.getTimeAt(offset)); }, reversed: function() { return new Curve(this._segment2.reversed(), this._segment1.reversed()); }, clearHandles: function() { this._segment1._handleOut._set(0, 0); this._segment2._handleIn._set(0, 0); }, statics: { getValues: function(segment1, segment2, matrix, straight) { var p1 = segment1._point, h1 = segment1._handleOut, h2 = segment2._handleIn, p2 = segment2._point, x1 = p1.x, y1 = p1.y, x2 = p2.x, y2 = p2.y, values = straight ? [ x1, y1, x1, y1, x2, y2, x2, y2 ] : [ x1, y1, x1 + h1._x, y1 + h1._y, x2 + h2._x, y2 + h2._y, x2, y2 ]; if (matrix) matrix._transformCoordinates(values, values, 4); return values; }, subdivide: function(v, t) { var x0 = v[0], y0 = v[1], x1 = v[2], y1 = v[3], x2 = v[4], y2 = v[5], x3 = v[6], y3 = v[7]; if (t === undefined) t = 0.5; var u = 1 - t, x4 = u * x0 + t * x1, y4 = u * y0 + t * y1, x5 = u * x1 + t * x2, y5 = u * y1 + t * y2, x6 = u * x2 + t * x3, y6 = u * y2 + t * y3, x7 = u * x4 + t * x5, y7 = u * y4 + t * y5, x8 = u * x5 + t * x6, y8 = u * y5 + t * y6, x9 = u * x7 + t * x8, y9 = u * y7 + t * y8; return [ [x0, y0, x4, y4, x7, y7, x9, y9], [x9, y9, x8, y8, x6, y6, x3, y3] ]; }, getMonoCurves: function(v, dir) { var curves = [], io = dir ? 0 : 1, o0 = v[io + 0], o1 = v[io + 2], o2 = v[io + 4], o3 = v[io + 6]; if ((o0 >= o1) === (o1 >= o2) && (o1 >= o2) === (o2 >= o3) || Curve.isStraight(v)) { curves.push(v); } else { var a = 3 * (o1 - o2) - o0 + o3, b = 2 * (o0 + o2) - 4 * o1, c = o1 - o0, tMin = 1e-8, tMax = 1 - tMin, roots = [], n = Numerical.solveQuadratic(a, b, c, roots, tMin, tMax); if (!n) { curves.push(v); } else { roots.sort(); var t = roots[0], parts = Curve.subdivide(v, t); curves.push(parts[0]); if (n > 1) { t = (roots[1] - t) / (1 - t); parts = Curve.subdivide(parts[1], t); curves.push(parts[0]); } curves.push(parts[1]); } } return curves; }, solveCubic: function (v, coord, val, roots, min, max) { var v0 = v[coord], v1 = v[coord + 2], v2 = v[coord + 4], v3 = v[coord + 6], res = 0; if ( !(v0 < val && v3 < val && v1 < val && v2 < val || v0 > val && v3 > val && v1 > val && v2 > val)) { var c = 3 * (v1 - v0), b = 3 * (v2 - v1) - c, a = v3 - v0 - c - b; res = Numerical.solveCubic(a, b, c, v0 - val, roots, min, max); } return res; }, getTimeOf: function(v, point) { var p0 = new Point(v[0], v[1]), p3 = new Point(v[6], v[7]), epsilon = 1e-12, geomEpsilon = 1e-7, t = point.isClose(p0, epsilon) ? 0 : point.isClose(p3, epsilon) ? 1 : null; if (t === null) { var coords = [point.x, point.y], roots = []; for (var c = 0; c < 2; c++) { var count = Curve.solveCubic(v, c, coords[c], roots, 0, 1); for (var i = 0; i < count; i++) { var u = roots[i]; if (point.isClose(Curve.getPoint(v, u), geomEpsilon)) return u; } } } return point.isClose(p0, geomEpsilon) ? 0 : point.isClose(p3, geomEpsilon) ? 1 : null; }, getNearestTime: function(v, point) { if (Curve.isStraight(v)) { var x0 = v[0], y0 = v[1], x3 = v[6], y3 = v[7], vx = x3 - x0, vy = y3 - y0, det = vx * vx + vy * vy; if (det === 0) return 0; var u = ((point.x - x0) * vx + (point.y - y0) * vy) / det; return u < 1e-12 ? 0 : u > 0.999999999999 ? 1 : Curve.getTimeOf(v, new Point(x0 + u * vx, y0 + u * vy)); } var count = 100, minDist = Infinity, minT = 0; function refine(t) { if (t >= 0 && t <= 1) { var dist = point.getDistance(Curve.getPoint(v, t), true); if (dist < minDist) { minDist = dist; minT = t; return true; } } } for (var i = 0; i <= count; i++) refine(i / count); var step = 1 / (count * 2); while (step > 1e-8) { if (!refine(minT - step) && !refine(minT + step)) step /= 2; } return minT; }, getPart: function(v, from, to) { var flip = from > to; if (flip) { var tmp = from; from = to; to = tmp; } if (from > 0) v = Curve.subdivide(v, from)[1]; if (to < 1) v = Curve.subdivide(v, (to - from) / (1 - from))[0]; return flip ? [v[6], v[7], v[4], v[5], v[2], v[3], v[0], v[1]] : v; }, isFlatEnough: function(v, flatness) { var x0 = v[0], y0 = v[1], x1 = v[2], y1 = v[3], x2 = v[4], y2 = v[5], x3 = v[6], y3 = v[7], ux = 3 * x1 - 2 * x0 - x3, uy = 3 * y1 - 2 * y0 - y3, vx = 3 * x2 - 2 * x3 - x0, vy = 3 * y2 - 2 * y3 - y0; return Math.max(ux * ux, vx * vx) + Math.max(uy * uy, vy * vy) <= 16 * flatness * flatness; }, getArea: function(v) { var x0 = v[0], y0 = v[1], x1 = v[2], y1 = v[3], x2 = v[4], y2 = v[5], x3 = v[6], y3 = v[7]; return 3 * ((y3 - y0) * (x1 + x2) - (x3 - x0) * (y1 + y2) + y1 * (x0 - x2) - x1 * (y0 - y2) + y3 * (x2 + x0 / 3) - x3 * (y2 + y0 / 3)) / 20; }, getBounds: function(v) { var min = v.slice(0, 2), max = min.slice(), roots = [0, 0]; for (var i = 0; i < 2; i++) Curve._addBounds(v[i], v[i + 2], v[i + 4], v[i + 6], i, 0, min, max, roots); return new Rectangle(min[0], min[1], max[0] - min[0], max[1] - min[1]); }, _addBounds: function(v0, v1, v2, v3, coord, padding, min, max, roots) { function add(value, padding) { var left = value - padding, right = value + padding; if (left < min[coord]) min[coord] = left; if (right > max[coord]) max[coord] = right; } padding /= 2; var minPad = min[coord] - padding, maxPad = max[coord] + padding; if ( v0 < minPad || v1 < minPad || v2 < minPad || v3 < minPad || v0 > maxPad || v1 > maxPad || v2 > maxPad || v3 > maxPad) { if (v1 < v0 != v1 < v3 && v2 < v0 != v2 < v3) { add(v0, padding); add(v3, padding); } else { var a = 3 * (v1 - v2) - v0 + v3, b = 2 * (v0 + v2) - 4 * v1, c = v1 - v0, count = Numerical.solveQuadratic(a, b, c, roots), tMin = 1e-8, tMax = 1 - tMin; add(v3, 0); for (var i = 0; i < count; i++) { var t = roots[i], u = 1 - t; if (tMin <= t && t <= tMax) add(u * u * u * v0 + 3 * u * u * t * v1 + 3 * u * t * t * v2 + t * t * t * v3, padding); } } } } }}, Base.each( ['getBounds', 'getStrokeBounds', 'getHandleBounds'], function(name) { this[name] = function() { if (!this._bounds) this._bounds = {}; var bounds = this._bounds[name]; if (!bounds) { bounds = this._bounds[name] = Path[name]( [this._segment1, this._segment2], false, this._path); } return bounds.clone(); }; }, { }), Base.each({ isStraight: function(p1, h1, h2, p2) { if (h1.isZero() && h2.isZero()) { return true; } else { var v = p2.subtract(p1); if (v.isZero()) { return false; } else if (v.isCollinear(h1) && v.isCollinear(h2)) { var l = new Line(p1, p2), epsilon = 1e-7; if (l.getDistance(p1.add(h1)) < epsilon && l.getDistance(p2.add(h2)) < epsilon) { var div = v.dot(v), s1 = v.dot(h1) / div, s2 = v.dot(h2) / div; return s1 >= 0 && s1 <= 1 && s2 <= 0 && s2 >= -1; } } } return false; }, isLinear: function(p1, h1, h2, p2) { var third = p2.subtract(p1).divide(3); return h1.equals(third) && h2.negate().equals(third); } }, function(test, name) { this[name] = function(epsilon) { var seg1 = this._segment1, seg2 = this._segment2; return test(seg1._point, seg1._handleOut, seg2._handleIn, seg2._point, epsilon); }; this.statics[name] = function(v, epsilon) { var x0 = v[0], y0 = v[1], x3 = v[6], y3 = v[7]; return test( new Point(x0, y0), new Point(v[2] - x0, v[3] - y0), new Point(v[4] - x3, v[5] - y3), new Point(x3, y3), epsilon); }; }, { statics: {}, hasHandles: function() { return !this._segment1._handleOut.isZero() || !this._segment2._handleIn.isZero(); }, hasLength: function(epsilon) { return (!this.getPoint1().equals(this.getPoint2()) || this.hasHandles()) && this.getLength() > (epsilon || 0); }, isCollinear: function(curve) { return curve && this.isStraight() && curve.isStraight() && this.getLine().isCollinear(curve.getLine()); }, isHorizontal: function() { return this.isStraight() && Math.abs(this.getTangentAtTime(0.5).y) < 1e-8; }, isVertical: function() { return this.isStraight() && Math.abs(this.getTangentAtTime(0.5).x) < 1e-8; } }), { beans: false, getLocationAt: function(offset, _isTime) { return this.getLocationAtTime( _isTime ? offset : this.getTimeAt(offset)); }, getLocationAtTime: function(t) { return t != null && t >= 0 && t <= 1 ? new CurveLocation(this, t) : null; }, getTimeAt: function(offset, start) { return Curve.getTimeAt(this.getValues(), offset, start); }, getParameterAt: '#getTimeAt', getTimesWithTangent: function () { var tangent = Point.read(arguments); return tangent.isZero() ? [] : Curve.getTimesWithTangent(this.getValues(), tangent); }, getOffsetAtTime: function(t) { return this.getPartLength(0, t); }, getLocationOf: function() { return this.getLocationAtTime(this.getTimeOf(Point.read(arguments))); }, getOffsetOf: function() { var loc = this.getLocationOf.apply(this, arguments); return loc ? loc.getOffset() : null; }, getTimeOf: function() { return Curve.getTimeOf(this.getValues(), Point.read(arguments)); }, getParameterOf: '#getTimeOf', getNearestLocation: function() { var point = Point.read(arguments), values = this.getValues(), t = Curve.getNearestTime(values, point), pt = Curve.getPoint(values, t); return new CurveLocation(this, t, pt, null, point.getDistance(pt)); }, getNearestPoint: function() { var loc = this.getNearestLocation.apply(this, arguments); return loc ? loc.getPoint() : loc; } }, new function() { var methods = ['getPoint', 'getTangent', 'getNormal', 'getWeightedTangent', 'getWeightedNormal', 'getCurvature']; return Base.each(methods, function(name) { this[name + 'At'] = function(location, _isTime) { var values = this.getValues(); return Curve[name](values, _isTime ? location : Curve.getTimeAt(values, location)); }; this[name + 'AtTime'] = function(time) { return Curve[name](this.getValues(), time); }; }, { statics: { _evaluateMethods: methods } } ); }, new function() { function getLengthIntegrand(v) { var x0 = v[0], y0 = v[1], x1 = v[2], y1 = v[3], x2 = v[4], y2 = v[5], x3 = v[6], y3 = v[7], ax = 9 * (x1 - x2) + 3 * (x3 - x0), bx = 6 * (x0 + x2) - 12 * x1, cx = 3 * (x1 - x0), ay = 9 * (y1 - y2) + 3 * (y3 - y0), by = 6 * (y0 + y2) - 12 * y1, cy = 3 * (y1 - y0); return function(t) { var dx = (ax * t + bx) * t + cx, dy = (ay * t + by) * t + cy; return Math.sqrt(dx * dx + dy * dy); }; } function getIterations(a, b) { return Math.max(2, Math.min(16, Math.ceil(Math.abs(b - a) * 32))); } function evaluate(v, t, type, normalized) { if (t == null || t < 0 || t > 1) return null; var x0 = v[0], y0 = v[1], x1 = v[2], y1 = v[3], x2 = v[4], y2 = v[5], x3 = v[6], y3 = v[7], isZero = Numerical.isZero; if (isZero(x1 - x0) && isZero(y1 - y0)) { x1 = x0; y1 = y0; } if (isZero(x2 - x3) && isZero(y2 - y3)) { x2 = x3; y2 = y3; } var cx = 3 * (x1 - x0), bx = 3 * (x2 - x1) - cx, ax = x3 - x0 - cx - bx, cy = 3 * (y1 - y0), by = 3 * (y2 - y1) - cy, ay = y3 - y0 - cy - by, x, y; if (type === 0) { x = t === 0 ? x0 : t === 1 ? x3 : ((ax * t + bx) * t + cx) * t + x0; y = t === 0 ? y0 : t === 1 ? y3 : ((ay * t + by) * t + cy) * t + y0; } else { var tMin = 1e-8, tMax = 1 - tMin; if (t < tMin) { x = cx; y = cy; } else if (t > tMax) { x = 3 * (x3 - x2); y = 3 * (y3 - y2); } else { x = (3 * ax * t + 2 * bx) * t + cx; y = (3 * ay * t + 2 * by) * t + cy; } if (normalized) { if (x === 0 && y === 0 && (t < tMin || t > tMax)) { x = x2 - x1; y = y2 - y1; } var len = Math.sqrt(x * x + y * y); if (len) { x /= len; y /= len; } } if (type === 3) { var x2 = 6 * ax * t + 2 * bx, y2 = 6 * ay * t + 2 * by, d = Math.pow(x * x + y * y, 3 / 2); x = d !== 0 ? (x * y2 - y * x2) / d : 0; y = 0; } } return type === 2 ? new Point(y, -x) : new Point(x, y); } return { statics: { classify: function(v) { var x0 = v[0], y0 = v[1], x1 = v[2], y1 = v[3], x2 = v[4], y2 = v[5], x3 = v[6], y3 = v[7], a1 = x0 * (y3 - y2) + y0 * (x2 - x3) + x3 * y2 - y3 * x2, a2 = x1 * (y0 - y3) + y1 * (x3 - x0) + x0 * y3 - y0 * x3, a3 = x2 * (y1 - y0) + y2 * (x0 - x1) + x1 * y0 - y1 * x0, d3 = 3 * a3, d2 = d3 - a2, d1 = d2 - a2 + a1, l = Math.sqrt(d1 * d1 + d2 * d2 + d3 * d3), s = l !== 0 ? 1 / l : 0, isZero = Numerical.isZero, serpentine = 'serpentine'; d1 *= s; d2 *= s; d3 *= s; function type(type, t1, t2) { var hasRoots = t1 !== undefined, t1Ok = hasRoots && t1 > 0 && t1 < 1, t2Ok = hasRoots && t2 > 0 && t2 < 1; if (hasRoots && (!(t1Ok || t2Ok) || type === 'loop' && !(t1Ok && t2Ok))) { type = 'arch'; t1Ok = t2Ok = false; } return { type: type, roots: t1Ok || t2Ok ? t1Ok && t2Ok ? t1 < t2 ? [t1, t2] : [t2, t1] : [t1Ok ? t1 : t2] : null }; } if (isZero(d1)) { return isZero(d2) ? type(isZero(d3) ? 'line' : 'quadratic') : type(serpentine, d3 / (3 * d2)); } var d = 3 * d2 * d2 - 4 * d1 * d3; if (isZero(d)) { return type('cusp', d2 / (2 * d1)); } var f1 = d > 0 ? Math.sqrt(d / 3) : Math.sqrt(-d), f2 = 2 * d1; return type(d > 0 ? serpentine : 'loop', (d2 + f1) / f2, (d2 - f1) / f2); }, getLength: function(v, a, b, ds) { if (a === undefined) a = 0; if (b === undefined) b = 1; if (Curve.isStraight(v)) { var c = v; if (b < 1) { c = Curve.subdivide(c, b)[0]; a /= b; } if (a > 0) { c = Curve.subdivide(c, a)[1]; } var dx = c[6] - c[0], dy = c[7] - c[1]; return Math.sqrt(dx * dx + dy * dy); } return Numerical.integrate(ds || getLengthIntegrand(v), a, b, getIterations(a, b)); }, getTimeAt: function(v, offset, start) { if (start === undefined) start = offset < 0 ? 1 : 0; if (offset === 0) return start; var abs = Math.abs, epsilon = 1e-12, forward = offset > 0, a = forward ? start : 0, b = forward ? 1 : start, ds = getLengthIntegrand(v), rangeLength = Curve.getLength(v, a, b, ds), diff = abs(offset) - rangeLength; if (abs(diff) < epsilon) { return forward ? b : a; } else if (diff > epsilon) { return null; } var guess = offset / rangeLength, length = 0; function f(t) { length += Numerical.integrate(ds, start, t, getIterations(start, t)); start = t; return length - offset; } return Numerical.findRoot(f, ds, start + guess, a, b, 32, 1e-12); }, getPoint: function(v, t) { return evaluate(v, t, 0, false); }, getTangent: function(v, t) { return evaluate(v, t, 1, true); }, getWeightedTangent: function(v, t) { return evaluate(v, t, 1, false); }, getNormal: function(v, t) { return evaluate(v, t, 2, true); }, getWeightedNormal: function(v, t) { return evaluate(v, t, 2, false); }, getCurvature: function(v, t) { return evaluate(v, t, 3, false).x; }, getPeaks: function(v) { var x0 = v[0], y0 = v[1], x1 = v[2], y1 = v[3], x2 = v[4], y2 = v[5], x3 = v[6], y3 = v[7], ax = -x0 + 3 * x1 - 3 * x2 + x3, bx = 3 * x0 - 6 * x1 + 3 * x2, cx = -3 * x0 + 3 * x1, ay = -y0 + 3 * y1 - 3 * y2 + y3, by = 3 * y0 - 6 * y1 + 3 * y2, cy = -3 * y0 + 3 * y1, tMin = 1e-8, tMax = 1 - tMin, roots = []; Numerical.solveCubic( 9 * (ax * ax + ay * ay), 9 * (ax * bx + by * ay), 2 * (bx * bx + by * by) + 3 * (cx * ax + cy * ay), (cx * bx + by * cy), roots, tMin, tMax); return roots.sort(); } }}; }, new function() { function addLocation(locations, include, c1, t1, c2, t2, overlap) { var excludeStart = !overlap && c1.getPrevious() === c2, excludeEnd = !overlap && c1 !== c2 && c1.getNext() === c2, tMin = 1e-8, tMax = 1 - tMin; if (t1 !== null && t1 >= (excludeStart ? tMin : 0) && t1 <= (excludeEnd ? tMax : 1)) { if (t2 !== null && t2 >= (excludeEnd ? tMin : 0) && t2 <= (excludeStart ? tMax : 1)) { var loc1 = new CurveLocation(c1, t1, null, overlap), loc2 = new CurveLocation(c2, t2, null, overlap); loc1._intersection = loc2; loc2._intersection = loc1; if (!include || include(loc1)) { CurveLocation.insert(locations, loc1, true); } } } } function addCurveIntersections(v1, v2, c1, c2, locations, include, flip, recursion, calls, tMin, tMax, uMin, uMax) { if (++calls >= 4096 || ++recursion >= 40) return calls; var fatLineEpsilon = 1e-9, q0x = v2[0], q0y = v2[1], q3x = v2[6], q3y = v2[7], getSignedDistance = Line.getSignedDistance, d1 = getSignedDistance(q0x, q0y, q3x, q3y, v2[2], v2[3]), d2 = getSignedDistance(q0x, q0y, q3x, q3y, v2[4], v2[5]), factor = d1 * d2 > 0 ? 3 / 4 : 4 / 9, dMin = factor * Math.min(0, d1, d2), dMax = factor * Math.max(0, d1, d2), dp0 = getSignedDistance(q0x, q0y, q3x, q3y, v1[0], v1[1]), dp1 = getSignedDistance(q0x, q0y, q3x, q3y, v1[2], v1[3]), dp2 = getSignedDistance(q0x, q0y, q3x, q3y, v1[4], v1[5]), dp3 = getSignedDistance(q0x, q0y, q3x, q3y, v1[6], v1[7]), hull = getConvexHull(dp0, dp1, dp2, dp3), top = hull[0], bottom = hull[1], tMinClip, tMaxClip; if (d1 === 0 && d2 === 0 && dp0 === 0 && dp1 === 0 && dp2 === 0 && dp3 === 0 || (tMinClip = clipConvexHull(top, bottom, dMin, dMax)) == null || (tMaxClip = clipConvexHull(top.reverse(), bottom.reverse(), dMin, dMax)) == null) return calls; var tMinNew = tMin + (tMax - tMin) * tMinClip, tMaxNew = tMin + (tMax - tMin) * tMaxClip; if (Math.max(uMax - uMin, tMaxNew - tMinNew) < fatLineEpsilon) { var t = (tMinNew + tMaxNew) / 2, u = (uMin + uMax) / 2; addLocation(locations, include, flip ? c2 : c1, flip ? u : t, flip ? c1 : c2, flip ? t : u); } else { v1 = Curve.getPart(v1, tMinClip, tMaxClip); if (tMaxClip - tMinClip > 0.8) { if (tMaxNew - tMinNew > uMax - uMin) { var parts = Curve.subdivide(v1, 0.5), t = (tMinNew + tMaxNew) / 2; calls = addCurveIntersections( v2, parts[0], c2, c1, locations, include, !flip, recursion, calls, uMin, uMax, tMinNew, t); calls = addCurveIntersections( v2, parts[1], c2, c1, locations, include, !flip, recursion, calls, uMin, uMax, t, tMaxNew); } else { var parts = Curve.subdivide(v2, 0.5), u = (uMin + uMax) / 2; calls = addCurveIntersections( parts[0], v1, c2, c1, locations, include, !flip, recursion, calls, uMin, u, tMinNew, tMaxNew); calls = addCurveIntersections( parts[1], v1, c2, c1, locations, include, !flip, recursion, calls, u, uMax, tMinNew, tMaxNew); } } else { if (uMax - uMin >= fatLineEpsilon) { calls = addCurveIntersections( v2, v1, c2, c1, locations, include, !flip, recursion, calls, uMin, uMax, tMinNew, tMaxNew); } else { calls = addCurveIntersections( v1, v2, c1, c2, locations, include, flip, recursion, calls, tMinNew, tMaxNew, uMin, uMax); } } } return calls; } function getConvexHull(dq0, dq1, dq2, dq3) { var p0 = [ 0, dq0 ], p1 = [ 1 / 3, dq1 ], p2 = [ 2 / 3, dq2 ], p3 = [ 1, dq3 ], dist1 = dq1 - (2 * dq0 + dq3) / 3, dist2 = dq2 - (dq0 + 2 * dq3) / 3, hull; if (dist1 * dist2 < 0) { hull = [[p0, p1, p3], [p0, p2, p3]]; } else { var distRatio = dist1 / dist2; hull = [ distRatio >= 2 ? [p0, p1, p3] : distRatio <= 0.5 ? [p0, p2, p3] : [p0, p1, p2, p3], [p0, p3] ]; } return (dist1 || dist2) < 0 ? hull.reverse() : hull; } function clipConvexHull(hullTop, hullBottom, dMin, dMax) { if (hullTop[0][1] < dMin) { return clipConvexHullPart(hullTop, true, dMin); } else if (hullBottom[0][1] > dMax) { return clipConvexHullPart(hullBottom, false, dMax); } else { return hullTop[0][0]; } } function clipConvexHullPart(part, top, threshold) { var px = part[0][0], py = part[0][1]; for (var i = 1, l = part.length; i < l; i++) { var qx = part[i][0], qy = part[i][1]; if (top ? qy >= threshold : qy <= threshold) { return qy === threshold ? qx : px + (threshold - py) * (qx - px) / (qy - py); } px = qx; py = qy; } return null; } function getCurveLineIntersections(v, px, py, vx, vy) { var isZero = Numerical.isZero; if (isZero(vx) && isZero(vy)) { var t = Curve.getTimeOf(v, new Point(px, py)); return t === null ? [] : [t]; } var angle = Math.atan2(-vy, vx), sin = Math.sin(angle), cos = Math.cos(angle), rv = [], roots = []; for (var i = 0; i < 8; i += 2) { var x = v[i] - px, y = v[i + 1] - py; rv.push( x * cos - y * sin, x * sin + y * cos); } Curve.solveCubic(rv, 1, 0, roots, 0, 1); return roots; } function addCurveLineIntersections(v1, v2, c1, c2, locations, include, flip) { var x1 = v2[0], y1 = v2[1], x2 = v2[6], y2 = v2[7], roots = getCurveLineIntersections(v1, x1, y1, x2 - x1, y2 - y1); for (var i = 0, l = roots.length; i < l; i++) { var t1 = roots[i], p1 = Curve.getPoint(v1, t1), t2 = Curve.getTimeOf(v2, p1); if (t2 !== null) { addLocation(locations, include, flip ? c2 : c1, flip ? t2 : t1, flip ? c1 : c2, flip ? t1 : t2); } } } function addLineIntersection(v1, v2, c1, c2, locations, include) { var pt = Line.intersect( v1[0], v1[1], v1[6], v1[7], v2[0], v2[1], v2[6], v2[7]); if (pt) { addLocation(locations, include, c1, Curve.getTimeOf(v1, pt), c2, Curve.getTimeOf(v2, pt)); } } function getCurveIntersections(v1, v2, c1, c2, locations, include) { var epsilon = 1e-12, min = Math.min, max = Math.max; if (max(v1[0], v1[2], v1[4], v1[6]) + epsilon > min(v2[0], v2[2], v2[4], v2[6]) && min(v1[0], v1[2], v1[4], v1[6]) - epsilon < max(v2[0], v2[2], v2[4], v2[6]) && max(v1[1], v1[3], v1[5], v1[7]) + epsilon > min(v2[1], v2[3], v2[5], v2[7]) && min(v1[1], v1[3], v1[5], v1[7]) - epsilon < max(v2[1], v2[3], v2[5], v2[7])) { var overlaps = getOverlaps(v1, v2); if (overlaps) { for (var i = 0; i < 2; i++) { var overlap = overlaps[i]; addLocation(locations, include, c1, overlap[0], c2, overlap[1], true); } } else { var straight1 = Curve.isStraight(v1), straight2 = Curve.isStraight(v2), straight = straight1 && straight2, flip = straight1 && !straight2, before = locations.length; (straight ? addLineIntersection : straight1 || straight2 ? addCurveLineIntersections : addCurveIntersections)( flip ? v2 : v1, flip ? v1 : v2, flip ? c2 : c1, flip ? c1 : c2, locations, include, flip, 0, 0, 0, 1, 0, 1); if (!straight || locations.length === before) { for (var i = 0; i < 4; i++) { var t1 = i >> 1, t2 = i & 1, i1 = t1 * 6, i2 = t2 * 6, p1 = new Point(v1[i1], v1[i1 + 1]), p2 = new Point(v2[i2], v2[i2 + 1]); if (p1.isClose(p2, epsilon)) { addLocation(locations, include, c1, t1, c2, t2); } } } } } return locations; } function getLoopIntersection(v1, c1, locations, include) { var info = Curve.classify(v1); if (info.type === 'loop') { var roots = info.roots; addLocation(locations, include, c1, roots[0], c1, roots[1]); } return locations; } function getIntersections(curves1, curves2, include, matrix1, matrix2, _returnFirst) { var self = !curves2; if (self) curves2 = curves1; var length1 = curves1.length, length2 = curves2.length, values2 = [], arrays = [], locations, current; for (var i = 0; i < length2; i++) values2[i] = curves2[i].getValues(matrix2); for (var i = 0; i < length1; i++) { var curve1 = curves1[i], values1 = self ? values2[i] : curve1.getValues(matrix1), path1 = curve1.getPath(); if (path1 !== current) { current = path1; locations = []; arrays.push(locations); } if (self) { getLoopIntersection(values1, curve1, locations, include); } for (var j = self ? i + 1 : 0; j < length2; j++) { if (_returnFirst && locations.length) return locations; getCurveIntersections(values1, values2[j], curve1, curves2[j], locations, include); } } locations = []; for (var i = 0, l = arrays.length; i < l; i++) { Base.push(locations, arrays[i]); } return locations; } function getOverlaps(v1, v2) { function getSquaredLineLength(v) { var x = v[6] - v[0], y = v[7] - v[1]; return x * x + y * y; } var abs = Math.abs, getDistance = Line.getDistance, timeEpsilon = 1e-8, geomEpsilon = 1e-7, straight1 = Curve.isStraight(v1), straight2 = Curve.isStraight(v2), straightBoth = straight1 && straight2, flip = getSquaredLineLength(v1) < getSquaredLineLength(v2), l1 = flip ? v2 : v1, l2 = flip ? v1 : v2, px = l1[0], py = l1[1], vx = l1[6] - px, vy = l1[7] - py; if (getDistance(px, py, vx, vy, l2[0], l2[1], true) < geomEpsilon && getDistance(px, py, vx, vy, l2[6], l2[7], true) < geomEpsilon) { if (!straightBoth && getDistance(px, py, vx, vy, l1[2], l1[3], true) < geomEpsilon && getDistance(px, py, vx, vy, l1[4], l1[5], true) < geomEpsilon && getDistance(px, py, vx, vy, l2[2], l2[3], true) < geomEpsilon && getDistance(px, py, vx, vy, l2[4], l2[5], true) < geomEpsilon) { straight1 = straight2 = straightBoth = true; } } else if (straightBoth) { return null; } if (straight1 ^ straight2) { return null; } var v = [v1, v2], pairs = []; for (var i = 0; i < 4 && pairs.length < 2; i++) { var i1 = i & 1, i2 = i1 ^ 1, t1 = i >> 1, t2 = Curve.getTimeOf(v[i1], new Point( v[i2][t1 ? 6 : 0], v[i2][t1 ? 7 : 1])); if (t2 != null) { var pair = i1 ? [t1, t2] : [t2, t1]; if (!pairs.length || abs(pair[0] - pairs[0][0]) > timeEpsilon && abs(pair[1] - pairs[0][1]) > timeEpsilon) { pairs.push(pair); } } if (i > 2 && !pairs.length) break; } if (pairs.length !== 2) { pairs = null; } else if (!straightBoth) { var o1 = Curve.getPart(v1, pairs[0][0], pairs[1][0]), o2 = Curve.getPart(v2, pairs[0][1], pairs[1][1]); if (abs(o2[2] - o1[2]) > geomEpsilon || abs(o2[3] - o1[3]) > geomEpsilon || abs(o2[4] - o1[4]) > geomEpsilon || abs(o2[5] - o1[5]) > geomEpsilon) pairs = null; } return pairs; } function getTimesWithTangent(v, tangent) { var x0 = v[0], y0 = v[1], x1 = v[2], y1 = v[3], x2 = v[4], y2 = v[5], x3 = v[6], y3 = v[7], normalized = tangent.normalize(), tx = normalized.x, ty = normalized.y, ax = 3 * x3 - 9 * x2 + 9 * x1 - 3 * x0, ay = 3 * y3 - 9 * y2 + 9 * y1 - 3 * y0, bx = 6 * x2 - 12 * x1 + 6 * x0, by = 6 * y2 - 12 * y1 + 6 * y0, cx = 3 * x1 - 3 * x0, cy = 3 * y1 - 3 * y0, den = 2 * ax * ty - 2 * ay * tx, times = []; if (Math.abs(den) < Numerical.CURVETIME_EPSILON) { var num = ax * cy - ay * cx, den = ax * by - ay * bx; if (den != 0) { var t = -num / den; if (t >= 0 && t <= 1) times.push(t); } } else { var delta = (bx * bx - 4 * ax * cx) * ty * ty + (-2 * bx * by + 4 * ay * cx + 4 * ax * cy) * tx * ty + (by * by - 4 * ay * cy) * tx * tx, k = bx * ty - by * tx; if (delta >= 0 && den != 0) { var d = Math.sqrt(delta), t0 = -(k + d) / den, t1 = (-k + d) / den; if (t0 >= 0 && t0 <= 1) times.push(t0); if (t1 >= 0 && t1 <= 1) times.push(t1); } } return times; } return { getIntersections: function(curve) { var v1 = this.getValues(), v2 = curve && curve !== this && curve.getValues(); return v2 ? getCurveIntersections(v1, v2, this, curve, []) : getLoopIntersection(v1, this, []); }, statics: { getOverlaps: getOverlaps, getIntersections: getIntersections, getCurveLineIntersections: getCurveLineIntersections, getTimesWithTangent: getTimesWithTangent } }; }); var CurveLocation = Base.extend({ _class: 'CurveLocation', initialize: function CurveLocation(curve, time, point, _overlap, _distance) { if (time >= 0.99999999) { var next = curve.getNext(); if (next) { time = 0; curve = next; } } this._setCurve(curve); this._time = time; this._point = point || curve.getPointAtTime(time); this._overlap = _overlap; this._distance = _distance; this._intersection = this._next = this._previous = null; }, _setCurve: function(curve) { var path = curve._path; this._path = path; this._version = path ? path._version : 0; this._curve = curve; this._segment = null; this._segment1 = curve._segment1; this._segment2 = curve._segment2; }, _setSegment: function(segment) { this._setCurve(segment.getCurve()); this._segment = segment; this._time = segment === this._segment1 ? 0 : 1; this._point = segment._point.clone(); }, getSegment: function() { var segment = this._segment; if (!segment) { var curve = this.getCurve(), time = this.getTime(); if (time === 0) { segment = curve._segment1; } else if (time === 1) { segment = curve._segment2; } else if (time != null) { segment = curve.getPartLength(0, time) < curve.getPartLength(time, 1) ? curve._segment1 : curve._segment2; } this._segment = segment; } return segment; }, getCurve: function() { var path = this._path, that = this; if (path && path._version !== this._version) { this._time = this._offset = this._curveOffset = this._curve = null; } function trySegment(segment) { var curve = segment && segment.getCurve(); if (curve && (that._time = curve.getTimeOf(that._point)) != null) { that._setCurve(curve); return curve; } } return this._curve || trySegment(this._segment) || trySegment(this._segment1) || trySegment(this._segment2.getPrevious()); }, getPath: function() { var curve = this.getCurve(); return curve && curve._path; }, getIndex: function() { var curve = this.getCurve(); return curve && curve.getIndex(); }, getTime: function() { var curve = this.getCurve(), time = this._time; return curve && time == null ? this._time = curve.getTimeOf(this._point) : time; }, getParameter: '#getTime', getPoint: function() { return this._point; }, getOffset: function() { var offset = this._offset; if (offset == null) { offset = 0; var path = this.getPath(), index = this.getIndex(); if (path && index != null) { var curves = path.getCurves(); for (var i = 0; i < index; i++) offset += curves[i].getLength(); } this._offset = offset += this.getCurveOffset(); } return offset; }, getCurveOffset: function() { var offset = this._curveOffset; if (offset == null) { var curve = this.getCurve(), time = this.getTime(); this._curveOffset = offset = time != null && curve && curve.getPartLength(0, time); } return offset; }, getIntersection: function() { return this._intersection; }, getDistance: function() { return this._distance; }, divide: function() { var curve = this.getCurve(), res = curve && curve.divideAtTime(this.getTime()); if (res) { this._setSegment(res._segment1); } return res; }, split: function() { var curve = this.getCurve(), path = curve._path, res = curve && curve.splitAtTime(this.getTime()); if (res) { this._setSegment(path.getLastSegment()); } return res; }, equals: function(loc, _ignoreOther) { var res = this === loc; if (!res && loc instanceof CurveLocation) { var c1 = this.getCurve(), c2 = loc.getCurve(), p1 = c1._path, p2 = c2._path; if (p1 === p2) { var abs = Math.abs, epsilon = 1e-7, diff = abs(this.getOffset() - loc.getOffset()), i1 = !_ignoreOther && this._intersection, i2 = !_ignoreOther && loc._intersection; res = (diff < epsilon || p1 && abs(p1.getLength() - diff) < epsilon) && (!i1 && !i2 || i1 && i2 && i1.equals(i2, true)); } } return res; }, toString: function() { var parts = [], point = this.getPoint(), f = Formatter.instance; if (point) parts.push('point: ' + point); var index = this.getIndex(); if (index != null) parts.push('index: ' + index); var time = this.getTime(); if (time != null) parts.push('time: ' + f.number(time)); if (this._distance != null) parts.push('distance: ' + f.number(this._distance)); return '{ ' + parts.join(', ') + ' }'; }, isTouching: function() { var inter = this._intersection; if (inter && this.getTangent().isCollinear(inter.getTangent())) { var curve1 = this.getCurve(), curve2 = inter.getCurve(); return !(curve1.isStraight() && curve2.isStraight() && curve1.getLine().intersect(curve2.getLine())); } return false; }, isCrossing: function() { var inter = this._intersection; if (!inter) return false; var t1 = this.getTime(), t2 = inter.getTime(), tMin = 1e-8, tMax = 1 - tMin, t1Inside = t1 >= tMin && t1 <= tMax, t2Inside = t2 >= tMin && t2 <= tMax; if (t1Inside && t2Inside) return !this.isTouching(); var c2 = this.getCurve(), c1 = t1 < tMin ? c2.getPrevious() : c2, c4 = inter.getCurve(), c3 = t2 < tMin ? c4.getPrevious() : c4; if (t1 > tMax) c2 = c2.getNext(); if (t2 > tMax) c4 = c4.getNext(); if (!c1 || !c2 || !c3 || !c4) return false; var offsets = []; function addOffsets(curve, end) { var v = curve.getValues(), roots = Curve.classify(v).roots || Curve.getPeaks(v), count = roots.length, t = end && count > 1 ? roots[count - 1] : count > 0 ? roots[0] : 0.5; offsets.push(Curve.getLength(v, end ? t : 0, end ? 1 : t) / 2); } function isInRange(angle, min, max) { return min < max ? angle > min && angle < max : angle > min || angle < max; } if (!t1Inside) { addOffsets(c1, true); addOffsets(c2, false); } if (!t2Inside) { addOffsets(c3, true); addOffsets(c4, false); } var pt = this.getPoint(), offset = Math.min.apply(Math, offsets), v2 = t1Inside ? c2.getTangentAtTime(t1) : c2.getPointAt(offset).subtract(pt), v1 = t1Inside ? v2.negate() : c1.getPointAt(-offset).subtract(pt), v4 = t2Inside ? c4.getTangentAtTime(t2) : c4.getPointAt(offset).subtract(pt), v3 = t2Inside ? v4.negate() : c3.getPointAt(-offset).subtract(pt), a1 = v1.getAngle(), a2 = v2.getAngle(), a3 = v3.getAngle(), a4 = v4.getAngle(); return !!(t1Inside ? (isInRange(a1, a3, a4) ^ isInRange(a2, a3, a4)) && (isInRange(a1, a4, a3) ^ isInRange(a2, a4, a3)) : (isInRange(a3, a1, a2) ^ isInRange(a4, a1, a2)) && (isInRange(a3, a2, a1) ^ isInRange(a4, a2, a1))); }, hasOverlap: function() { return !!this._overlap; } }, Base.each(Curve._evaluateMethods, function(name) { var get = name + 'At'; this[name] = function() { var curve = this.getCurve(), time = this.getTime(); return time != null && curve && curve[get](time, true); }; }, { preserve: true }), new function() { function insert(locations, loc, merge) { var length = locations.length, l = 0, r = length - 1; function search(index, dir) { for (var i = index + dir; i >= -1 && i <= length; i += dir) { var loc2 = locations[((i % length) + length) % length]; if (!loc.getPoint().isClose(loc2.getPoint(), 1e-7)) break; if (loc.equals(loc2)) return loc2; } return null; } while (l <= r) { var m = (l + r) >>> 1, loc2 = locations[m], found; if (merge && (found = loc.equals(loc2) ? loc2 : (search(m, -1) || search(m, 1)))) { if (loc._overlap) { found._overlap = found._intersection._overlap = true; } return found; } var path1 = loc.getPath(), path2 = loc2.getPath(), diff = path1 !== path2 ? path1._id - path2._id : (loc.getIndex() + loc.getTime()) - (loc2.getIndex() + loc2.getTime()); if (diff < 0) { r = m - 1; } else { l = m + 1; } } locations.splice(l, 0, loc); return loc; } return { statics: { insert: insert, expand: function(locations) { var expanded = locations.slice(); for (var i = locations.length - 1; i >= 0; i--) { insert(expanded, locations[i]._intersection, false); } return expanded; } }}; }); var PathItem = Item.extend({ _class: 'PathItem', _selectBounds: false, _canScaleStroke: true, beans: true, initialize: function PathItem() { }, statics: { create: function(arg) { var data, segments, compound; if (Base.isPlainObject(arg)) { segments = arg.segments; data = arg.pathData; } else if (Array.isArray(arg)) { segments = arg; } else if (typeof arg === 'string') { data = arg; } if (segments) { var first = segments[0]; compound = first && Array.isArray(first[0]); } else if (data) { compound = (data.match(/m/gi) || []).length > 1 || /z\s*\S+/i.test(data); } var ctor = compound ? CompoundPath : Path; return new ctor(arg); } }, _asPathItem: function() { return this; }, isClockwise: function() { return this.getArea() >= 0; }, setClockwise: function(clockwise) { if (this.isClockwise() != (clockwise = !!clockwise)) this.reverse(); }, setPathData: function(data) { var parts = data && data.match(/[mlhvcsqtaz][^mlhvcsqtaz]*/ig), coords, relative = false, previous, control, current = new Point(), start = new Point(); function getCoord(index, coord) { var val = +coords[index]; if (relative) val += current[coord]; return val; } function getPoint(index) { return new Point( getCoord(index, 'x'), getCoord(index + 1, 'y') ); } this.clear(); for (var i = 0, l = parts && parts.length; i < l; i++) { var part = parts[i], command = part[0], lower = command.toLowerCase(); coords = part.match(/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g); var length = coords && coords.length; relative = command === lower; if (previous === 'z' && !/[mz]/.test(lower)) this.moveTo(current); switch (lower) { case 'm': case 'l': var move = lower === 'm'; for (var j = 0; j < length; j += 2) { this[move ? 'moveTo' : 'lineTo'](current = getPoint(j)); if (move) { start = current; move = false; } } control = current; break; case 'h': case 'v': var coord = lower === 'h' ? 'x' : 'y'; current = current.clone(); for (var j = 0; j < length; j++) { current[coord] = getCoord(j, coord); this.lineTo(current); } control = current; break; case 'c': for (var j = 0; j < length; j += 6) { this.cubicCurveTo( getPoint(j), control = getPoint(j + 2), current = getPoint(j + 4)); } break; case 's': for (var j = 0; j < length; j += 4) { this.cubicCurveTo( /[cs]/.test(previous) ? current.multiply(2).subtract(control) : current, control = getPoint(j), current = getPoint(j + 2)); previous = lower; } break; case 'q': for (var j = 0; j < length; j += 4) { this.quadraticCurveTo( control = getPoint(j), current = getPoint(j + 2)); } break; case 't': for (var j = 0; j < length; j += 2) { this.quadraticCurveTo( control = (/[qt]/.test(previous) ? current.multiply(2).subtract(control) : current), current = getPoint(j)); previous = lower; } break; case 'a': for (var j = 0; j < length; j += 7) { this.arcTo(current = getPoint(j + 5), new Size(+coords[j], +coords[j + 1]), +coords[j + 2], +coords[j + 4], +coords[j + 3]); } break; case 'z': this.closePath(1e-12); current = start; break; } previous = lower; } }, _canComposite: function() { return !(this.hasFill() && this.hasStroke()); }, _contains: function(point) { var winding = point.isInside( this.getBounds({ internal: true, handle: true })) ? this._getWinding(point) : {}; return winding.onPath || !!(this.getFillRule() === 'evenodd' ? winding.windingL & 1 || winding.windingR & 1 : winding.winding); }, getIntersections: function(path, include, _matrix, _returnFirst) { var self = this === path || !path, matrix1 = this._matrix._orNullIfIdentity(), matrix2 = self ? matrix1 : (_matrix || path._matrix)._orNullIfIdentity(); return self || this.getBounds(matrix1).intersects( path.getBounds(matrix2), 1e-12) ? Curve.getIntersections( this.getCurves(), !self && path.getCurves(), include, matrix1, matrix2, _returnFirst) : []; }, getCrossings: function(path) { return this.getIntersections(path, function(inter) { return inter.hasOverlap() || inter.isCrossing(); }); }, getNearestLocation: function() { var point = Point.read(arguments), curves = this.getCurves(), minDist = Infinity, minLoc = null; for (var i = 0, l = curves.length; i < l; i++) { var loc = curves[i].getNearestLocation(point); if (loc._distance < minDist) { minDist = loc._distance; minLoc = loc; } } return minLoc; }, getNearestPoint: function() { var loc = this.getNearestLocation.apply(this, arguments); return loc ? loc.getPoint() : loc; }, interpolate: function(from, to, factor) { var isPath = !this._children, name = isPath ? '_segments' : '_children', itemsFrom = from[name], itemsTo = to[name], items = this[name]; if (!itemsFrom || !itemsTo || itemsFrom.length !== itemsTo.length) { throw new Error('Invalid operands in interpolate() call: ' + from + ', ' + to); } var current = items.length, length = itemsTo.length; if (current < length) { var ctor = isPath ? Segment : Path; for (var i = current; i < length; i++) { this.add(new ctor()); } } else if (current > length) { this[isPath ? 'removeSegments' : 'removeChildren'](length, current); } for (var i = 0; i < length; i++) { items[i].interpolate(itemsFrom[i], itemsTo[i], factor); } if (isPath) { this.setClosed(from._closed); this._changed(9); } }, compare: function(path) { var ok = false; if (path) { var paths1 = this._children || [this], paths2 = path._children ? path._children.slice() : [path], length1 = paths1.length, length2 = paths2.length, matched = [], count = 0; ok = true; for (var i1 = length1 - 1; i1 >= 0 && ok; i1--) { var path1 = paths1[i1]; ok = false; for (var i2 = length2 - 1; i2 >= 0 && !ok; i2--) { if (path1.compare(paths2[i2])) { if (!matched[i2]) { matched[i2] = true; count++; } ok = true; } } } ok = ok && count === length2; } return ok; }, }); var Path = PathItem.extend({ _class: 'Path', _serializeFields: { segments: [], closed: false }, initialize: function Path(arg) { this._closed = false; this._segments = []; this._version = 0; var segments = Array.isArray(arg) ? typeof arg[0] === 'object' ? arg : arguments : arg && (arg.size === undefined && (arg.x !== undefined || arg.point !== undefined)) ? arguments : null; if (segments && segments.length > 0) { this.setSegments(segments); } else { this._curves = undefined; this._segmentSelection = 0; if (!segments && typeof arg === 'string') { this.setPathData(arg); arg = null; } } this._initialize(!segments && arg); }, _equals: function(item) { return this._closed === item._closed && Base.equals(this._segments, item._segments); }, copyContent: function(source) { this.setSegments(source._segments); this._closed = source._closed; }, _changed: function _changed(flags) { _changed.base.call(this, flags); if (flags & 8) { this._length = this._area = undefined; if (flags & 32) { this._version++; } else if (this._curves) { for (var i = 0, l = this._curves.length; i < l; i++) this._curves[i]._changed(); } } else if (flags & 64) { this._bounds = undefined; } }, getStyle: function() { var parent = this._parent; return (parent instanceof CompoundPath ? parent : this)._style; }, getSegments: function() { return this._segments; }, setSegments: function(segments) { var fullySelected = this.isFullySelected(), length = segments && segments.length; this._segments.length = 0; this._segmentSelection = 0; this._curves = undefined; if (length) { var last = segments[length - 1]; if (typeof last === 'boolean') { this.setClosed(last); length--; } this._add(Segment.readList(segments, 0, {}, length)); } if (fullySelected) this.setFullySelected(true); }, getFirstSegment: function() { return this._segments[0]; }, getLastSegment: function() { return this._segments[this._segments.length - 1]; }, getCurves: function() { var curves = this._curves, segments = this._segments; if (!curves) { var length = this._countCurves(); curves = this._curves = new Array(length); for (var i = 0; i < length; i++) curves[i] = new Curve(this, segments[i], segments[i + 1] || segments[0]); } return curves; }, getFirstCurve: function() { return this.getCurves()[0]; }, getLastCurve: function() { var curves = this.getCurves(); return curves[curves.length - 1]; }, isClosed: function() { return this._closed; }, setClosed: function(closed) { if (this._closed != (closed = !!closed)) { this._closed = closed; if (this._curves) { var length = this._curves.length = this._countCurves(); if (closed) this._curves[length - 1] = new Curve(this, this._segments[length - 1], this._segments[0]); } this._changed(41); } } }, { beans: true, getPathData: function(_matrix, _precision) { var segments = this._segments, length = segments.length, f = new Formatter(_precision), coords = new Array(6), first = true, curX, curY, prevX, prevY, inX, inY, outX, outY, parts = []; function addSegment(segment, skipLine) { segment._transformCoordinates(_matrix, coords); curX = coords[0]; curY = coords[1]; if (first) { parts.push('M' + f.pair(curX, curY)); first = false; } else { inX = coords[2]; inY = coords[3]; if (inX === curX && inY === curY && outX === prevX && outY === prevY) { if (!skipLine) { var dx = curX - prevX, dy = curY - prevY; parts.push( dx === 0 ? 'v' + f.number(dy) : dy === 0 ? 'h' + f.number(dx) : 'l' + f.pair(dx, dy)); } } else { parts.push('c' + f.pair(outX - prevX, outY - prevY) + ' ' + f.pair( inX - prevX, inY - prevY) + ' ' + f.pair(curX - prevX, curY - prevY)); } } prevX = curX; prevY = curY; outX = coords[4]; outY = coords[5]; } if (!length) return ''; for (var i = 0; i < length; i++) addSegment(segments[i]); if (this._closed && length > 0) { addSegment(segments[0], true); parts.push('z'); } return parts.join(''); }, isEmpty: function() { return !this._segments.length; }, _transformContent: function(matrix) { var segments = this._segments, coords = new Array(6); for (var i = 0, l = segments.length; i < l; i++) segments[i]._transformCoordinates(matrix, coords, true); return true; }, _add: function(segs, index) { var segments = this._segments, curves = this._curves, amount = segs.length, append = index == null, index = append ? segments.length : index; for (var i = 0; i < amount; i++) { var segment = segs[i]; if (segment._path) segment = segs[i] = segment.clone(); segment._path = this; segment._index = index + i; if (segment._selection) this._updateSelection(segment, 0, segment._selection); } if (append) { Base.push(segments, segs); } else { segments.splice.apply(segments, [index, 0].concat(segs)); for (var i = index + amount, l = segments.length; i < l; i++) segments[i]._index = i; } if (curves) { var total = this._countCurves(), start = index > 0 && index + amount - 1 === total ? index - 1 : index, insert = start, end = Math.min(start + amount, total); if (segs._curves) { curves.splice.apply(curves, [start, 0].concat(segs._curves)); insert += segs._curves.length; } for (var i = insert; i < end; i++) curves.splice(i, 0, new Curve(this, null, null)); this._adjustCurves(start, end); } this._changed(41); return segs; }, _adjustCurves: function(start, end) { var segments = this._segments, curves = this._curves, curve; for (var i = start; i < end; i++) { curve = curves[i]; curve._path = this; curve._segment1 = segments[i]; curve._segment2 = segments[i + 1] || segments[0]; curve._changed(); } if (curve = curves[this._closed && !start ? segments.length - 1 : start - 1]) { curve._segment2 = segments[start] || segments[0]; curve._changed(); } if (curve = curves[end]) { curve._segment1 = segments[end]; curve._changed(); } }, _countCurves: function() { var length = this._segments.length; return !this._closed && length > 0 ? length - 1 : length; }, add: function(segment1 ) { return arguments.length > 1 && typeof segment1 !== 'number' ? this._add(Segment.readList(arguments)) : this._add([ Segment.read(arguments) ])[0]; }, insert: function(index, segment1 ) { return arguments.length > 2 && typeof segment1 !== 'number' ? this._add(Segment.readList(arguments, 1), index) : this._add([ Segment.read(arguments, 1) ], index)[0]; }, addSegment: function() { return this._add([ Segment.read(arguments) ])[0]; }, insertSegment: function(index ) { return this._add([ Segment.read(arguments, 1) ], index)[0]; }, addSegments: function(segments) { return this._add(Segment.readList(segments)); }, insertSegments: function(index, segments) { return this._add(Segment.readList(segments), index); }, removeSegment: function(index) { return this.removeSegments(index, index + 1)[0] || null; }, removeSegments: function(start, end, _includeCurves) { start = start || 0; end = Base.pick(end, this._segments.length); var segments = this._segments, curves = this._curves, count = segments.length, removed = segments.splice(start, end - start), amount = removed.length; if (!amount) return removed; for (var i = 0; i < amount; i++) { var segment = removed[i]; if (segment._selection) this._updateSelection(segment, segment._selection, 0); segment._index = segment._path = null; } for (var i = start, l = segments.length; i < l; i++) segments[i]._index = i; if (curves) { var index = start > 0 && end === count + (this._closed ? 1 : 0) ? start - 1 : start, curves = curves.splice(index, amount); for (var i = curves.length - 1; i >= 0; i--) curves[i]._path = null; if (_includeCurves) removed._curves = curves.slice(1); this._adjustCurves(index, index); } this._changed(41); return removed; }, clear: '#removeSegments', hasHandles: function() { var segments = this._segments; for (var i = 0, l = segments.length; i < l; i++) { if (segments[i].hasHandles()) return true; } return false; }, clearHandles: function() { var segments = this._segments; for (var i = 0, l = segments.length; i < l; i++) segments[i].clearHandles(); }, getLength: function() { if (this._length == null) { var curves = this.getCurves(), length = 0; for (var i = 0, l = curves.length; i < l; i++) length += curves[i].getLength(); this._length = length; } return this._length; }, getArea: function() { var area = this._area; if (area == null) { var segments = this._segments, closed = this._closed; area = 0; for (var i = 0, l = segments.length; i < l; i++) { var last = i + 1 === l; area += Curve.getArea(Curve.getValues( segments[i], segments[last ? 0 : i + 1], null, last && !closed)); } this._area = area; } return area; }, isFullySelected: function() { var length = this._segments.length; return this.isSelected() && length > 0 && this._segmentSelection === length * 7; }, setFullySelected: function(selected) { if (selected) this._selectSegments(true); this.setSelected(selected); }, setSelection: function setSelection(selection) { if (!(selection & 1)) this._selectSegments(false); setSelection.base.call(this, selection); }, _selectSegments: function(selected) { var segments = this._segments, length = segments.length, selection = selected ? 7 : 0; this._segmentSelection = selection * length; for (var i = 0; i < length; i++) segments[i]._selection = selection; }, _updateSelection: function(segment, oldSelection, newSelection) { segment._selection = newSelection; var selection = this._segmentSelection += newSelection - oldSelection; if (selection > 0) this.setSelected(true); }, divideAt: function(location) { var loc = this.getLocationAt(location), curve; return loc && (curve = loc.getCurve().divideAt(loc.getCurveOffset())) ? curve._segment1 : null; }, splitAt: function(location) { var loc = this.getLocationAt(location), index = loc && loc.index, time = loc && loc.time, tMin = 1e-8, tMax = 1 - tMin; if (time > tMax) { index++; time = 0; } var curves = this.getCurves(); if (index >= 0 && index < curves.length) { if (time >= tMin) { curves[index++].divideAtTime(time); } var segs = this.removeSegments(index, this._segments.length, true), path; if (this._closed) { this.setClosed(false); path = this; } else { path = new Path(Item.NO_INSERT); path.insertAbove(this); path.copyAttributes(this); } path._add(segs, 0); this.addSegment(segs[0]); return path; } return null; }, split: function(index, time) { var curve, location = time === undefined ? index : (curve = this.getCurves()[index]) && curve.getLocationAtTime(time); return location != null ? this.splitAt(location) : null; }, join: function(path, tolerance) { var epsilon = tolerance || 0; if (path && path !== this) { var segments = path._segments, last1 = this.getLastSegment(), last2 = path.getLastSegment(); if (!last2) return this; if (last1 && last1._point.isClose(last2._point, epsilon)) path.reverse(); var first2 = path.getFirstSegment(); if (last1 && last1._point.isClose(first2._point, epsilon)) { last1.setHandleOut(first2._handleOut); this._add(segments.slice(1)); } else { var first1 = this.getFirstSegment(); if (first1 && first1._point.isClose(first2._point, epsilon)) path.reverse(); last2 = path.getLastSegment(); if (first1 && first1._point.isClose(last2._point, epsilon)) { first1.setHandleIn(last2._handleIn); this._add(segments.slice(0, segments.length - 1), 0); } else { this._add(segments.slice()); } } if (path._closed) this._add([segments[0]]); path.remove(); } var first = this.getFirstSegment(), last = this.getLastSegment(); if (first !== last && first._point.isClose(last._point, epsilon)) { first.setHandleIn(last._handleIn); last.remove(); this.setClosed(true); } return this; }, reduce: function(options) { var curves = this.getCurves(), simplify = options && options.simplify, tolerance = simplify ? 1e-7 : 0; for (var i = curves.length - 1; i >= 0; i--) { var curve = curves[i]; if (!curve.hasHandles() && (!curve.hasLength(tolerance) || simplify && curve.isCollinear(curve.getNext()))) curve.remove(); } return this; }, reverse: function() { this._segments.reverse(); for (var i = 0, l = this._segments.length; i < l; i++) { var segment = this._segments[i]; var handleIn = segment._handleIn; segment._handleIn = segment._handleOut; segment._handleOut = handleIn; segment._index = i; } this._curves = null; this._changed(9); }, flatten: function(flatness) { var flattener = new PathFlattener(this, flatness || 0.25, 256, true), parts = flattener.parts, length = parts.length, segments = []; for (var i = 0; i < length; i++) { segments.push(new Segment(parts[i].curve.slice(0, 2))); } if (!this._closed && length > 0) { segments.push(new Segment(parts[length - 1].curve.slice(6))); } this.setSegments(segments); }, simplify: function(tolerance) { var segments = new PathFitter(this).fit(tolerance || 2.5); if (segments) this.setSegments(segments); return !!segments; }, smooth: function(options) { var that = this, opts = options || {}, type = opts.type || 'asymmetric', segments = this._segments, length = segments.length, closed = this._closed; function getIndex(value, _default) { var index = value && value.index; if (index != null) { var path = value.path; if (path && path !== that) throw new Error(value._class + ' ' + index + ' of ' + path + ' is not part of ' + that); if (_default && value instanceof Curve) index++; } else { index = typeof value === 'number' ? value : _default; } return Math.min(index < 0 && closed ? index % length : index < 0 ? index + length : index, length - 1); } var loop = closed && opts.from === undefined && opts.to === undefined, from = getIndex(opts.from, 0), to = getIndex(opts.to, length - 1); if (from > to) { if (closed) { from -= length; } else { var tmp = from; from = to; to = tmp; } } if (/^(?:asymmetric|continuous)$/.test(type)) { var asymmetric = type === 'asymmetric', min = Math.min, amount = to - from + 1, n = amount - 1, padding = loop ? min(amount, 4) : 1, paddingLeft = padding, paddingRight = padding, knots = []; if (!closed) { paddingLeft = min(1, from); paddingRight = min(1, length - to - 1); } n += paddingLeft + paddingRight; if (n <= 1) return; for (var i = 0, j = from - paddingLeft; i <= n; i++, j++) { knots[i] = segments[(j < 0 ? j + length : j) % length]._point; } var x = knots[0]._x + 2 * knots[1]._x, y = knots[0]._y + 2 * knots[1]._y, f = 2, n_1 = n - 1, rx = [x], ry = [y], rf = [f], px = [], py = []; for (var i = 1; i < n; i++) { var internal = i < n_1, a = internal ? 1 : asymmetric ? 1 : 2, b = internal ? 4 : asymmetric ? 2 : 7, u = internal ? 4 : asymmetric ? 3 : 8, v = internal ? 2 : asymmetric ? 0 : 1, m = a / f; f = rf[i] = b - m; x = rx[i] = u * knots[i]._x + v * knots[i + 1]._x - m * x; y = ry[i] = u * knots[i]._y + v * knots[i + 1]._y - m * y; } px[n_1] = rx[n_1] / rf[n_1]; py[n_1] = ry[n_1] / rf[n_1]; for (var i = n - 2; i >= 0; i--) { px[i] = (rx[i] - px[i + 1]) / rf[i]; py[i] = (ry[i] - py[i + 1]) / rf[i]; } px[n] = (3 * knots[n]._x - px[n_1]) / 2; py[n] = (3 * knots[n]._y - py[n_1]) / 2; for (var i = paddingLeft, max = n - paddingRight, j = from; i <= max; i++, j++) { var segment = segments[j < 0 ? j + length : j], pt = segment._point, hx = px[i] - pt._x, hy = py[i] - pt._y; if (loop || i < max) segment.setHandleOut(hx, hy); if (loop || i > paddingLeft) segment.setHandleIn(-hx, -hy); } } else { for (var i = from; i <= to; i++) { segments[i < 0 ? i + length : i].smooth(opts, !loop && i === from, !loop && i === to); } } }, toShape: function(insert) { if (!this._closed) return null; var segments = this._segments, type, size, radius, topCenter; function isCollinear(i, j) { var seg1 = segments[i], seg2 = seg1.getNext(), seg3 = segments[j], seg4 = seg3.getNext(); return seg1._handleOut.isZero() && seg2._handleIn.isZero() && seg3._handleOut.isZero() && seg4._handleIn.isZero() && seg2._point.subtract(seg1._point).isCollinear( seg4._point.subtract(seg3._point)); } function isOrthogonal(i) { var seg2 = segments[i], seg1 = seg2.getPrevious(), seg3 = seg2.getNext(); return seg1._handleOut.isZero() && seg2._handleIn.isZero() && seg2._handleOut.isZero() && seg3._handleIn.isZero() && seg2._point.subtract(seg1._point).isOrthogonal( seg3._point.subtract(seg2._point)); } function isArc(i) { var seg1 = segments[i], seg2 = seg1.getNext(), handle1 = seg1._handleOut, handle2 = seg2._handleIn, kappa = 0.5522847498307936; if (handle1.isOrthogonal(handle2)) { var pt1 = seg1._point, pt2 = seg2._point, corner = new Line(pt1, handle1, true).intersect( new Line(pt2, handle2, true), true); return corner && Numerical.isZero(handle1.getLength() / corner.subtract(pt1).getLength() - kappa) && Numerical.isZero(handle2.getLength() / corner.subtract(pt2).getLength() - kappa); } return false; } function getDistance(i, j) { return segments[i]._point.getDistance(segments[j]._point); } if (!this.hasHandles() && segments.length === 4 && isCollinear(0, 2) && isCollinear(1, 3) && isOrthogonal(1)) { type = Shape.Rectangle; size = new Size(getDistance(0, 3), getDistance(0, 1)); topCenter = segments[1]._point.add(segments[2]._point).divide(2); } else if (segments.length === 8 && isArc(0) && isArc(2) && isArc(4) && isArc(6) && isCollinear(1, 5) && isCollinear(3, 7)) { type = Shape.Rectangle; size = new Size(getDistance(1, 6), getDistance(0, 3)); radius = size.subtract(new Size(getDistance(0, 7), getDistance(1, 2))).divide(2); topCenter = segments[3]._point.add(segments[4]._point).divide(2); } else if (segments.length === 4 && isArc(0) && isArc(1) && isArc(2) && isArc(3)) { if (Numerical.isZero(getDistance(0, 2) - getDistance(1, 3))) { type = Shape.Circle; radius = getDistance(0, 2) / 2; } else { type = Shape.Ellipse; radius = new Size(getDistance(2, 0) / 2, getDistance(3, 1) / 2); } topCenter = segments[1]._point; } if (type) { var center = this.getPosition(true), shape = new type({ center: center, size: size, radius: radius, insert: false }); shape.copyAttributes(this, true); shape._matrix.prepend(this._matrix); shape.rotate(topCenter.subtract(center).getAngle() + 90); if (insert === undefined || insert) shape.insertAbove(this); return shape; } return null; }, toPath: '#clone', compare: function compare(path) { if (!path || path instanceof CompoundPath) return compare.base.call(this, path); var curves1 = this.getCurves(), curves2 = path.getCurves(), length1 = curves1.length, length2 = curves2.length; if (!length1 || !length2) { return length1 == length2; } var v1 = curves1[0].getValues(), values2 = [], pos1 = 0, pos2, end1 = 0, end2; for (var i = 0; i < length2; i++) { var v2 = curves2[i].getValues(); values2.push(v2); var overlaps = Curve.getOverlaps(v1, v2); if (overlaps) { pos2 = !i && overlaps[0][0] > 0 ? length2 - 1 : i; end2 = overlaps[0][1]; break; } } var abs = Math.abs, epsilon = 1e-8, v2 = values2[pos2], start2; while (v1 && v2) { var overlaps = Curve.getOverlaps(v1, v2); if (overlaps) { var t1 = overlaps[0][0]; if (abs(t1 - end1) < epsilon) { end1 = overlaps[1][0]; if (end1 === 1) { v1 = ++pos1 < length1 ? curves1[pos1].getValues() : null; end1 = 0; } var t2 = overlaps[0][1]; if (abs(t2 - end2) < epsilon) { if (!start2) start2 = [pos2, t2]; end2 = overlaps[1][1]; if (end2 === 1) { if (++pos2 >= length2) pos2 = 0; v2 = values2[pos2] || curves2[pos2].getValues(); end2 = 0; } if (!v1) { return start2[0] === pos2 && start2[1] === end2; } continue; } } } break; } return false; }, _hitTestSelf: function(point, options, viewMatrix, strokeMatrix) { var that = this, style = this.getStyle(), segments = this._segments, numSegments = segments.length, closed = this._closed, tolerancePadding = options._tolerancePadding, strokePadding = tolerancePadding, join, cap, miterLimit, area, loc, res, hitStroke = options.stroke && style.hasStroke(), hitFill = options.hitUnfilledPaths ? options.fill : options.fill && style.hasFill(), hitCurves = options.curves, strokeRadius = hitStroke ? style.getStrokeWidth() / 2 : hitFill && options.tolerance > 0 || hitCurves ? 0 : null; if (strokeRadius !== null) { if (strokeRadius > 0) { join = style.getStrokeJoin(); cap = style.getStrokeCap(); miterLimit = style.getMiterLimit(); strokePadding = strokePadding.add( Path._getStrokePadding(strokeRadius, strokeMatrix)); } else { join = cap = 'round'; } } function isCloseEnough(pt, padding) { return point.subtract(pt).divide(padding).length <= 1; } function checkSegmentPoint(seg, pt, name) { if (!options.selected || pt.isSelected()) { var anchor = seg._point; if (pt !== anchor) pt = pt.add(anchor); if (isCloseEnough(pt, strokePadding)) { return new HitResult(name, that, { segment: seg, point: pt }); } } } function checkSegmentPoints(seg, ends) { return (ends || options.segments) && checkSegmentPoint(seg, seg._point, 'segment') || (!ends && options.handles) && ( checkSegmentPoint(seg, seg._handleIn, 'handle-in') || checkSegmentPoint(seg, seg._handleOut, 'handle-out')); } function addToArea(point) { area.add(point); } function checkSegmentStroke(segment) { var isJoin = closed || segment._index > 0 && segment._index < numSegments - 1; if ((isJoin ? join : cap) === 'round') { return isCloseEnough(segment._point, strokePadding); } else { area = new Path({ internal: true, closed: true }); if (isJoin) { if (!segment.isSmooth()) { Path._addBevelJoin(segment, join, strokeRadius, miterLimit, null, strokeMatrix, addToArea, true); } } else if (cap === 'square') { Path._addSquareCap(segment, cap, strokeRadius, null, strokeMatrix, addToArea, true); } if (!area.isEmpty()) { var loc; return area.contains(point) || (loc = area.getNearestLocation(point)) && isCloseEnough(loc.getPoint(), tolerancePadding); } } } if (options.ends && !options.segments && !closed) { if (res = checkSegmentPoints(segments[0], true) || checkSegmentPoints(segments[numSegments - 1], true)) return res; } else if (options.segments || options.handles) { for (var i = 0; i < numSegments; i++) if (res = checkSegmentPoints(segments[i])) return res; } if (strokeRadius !== null) { loc = this.getNearestLocation(point); if (loc) { var time = loc.getTime(); if (time === 0 || time === 1 && numSegments > 1) { if (!checkSegmentStroke(loc.getSegment())) loc = null; } else if (!isCloseEnough(loc.getPoint(), strokePadding)) { loc = null; } } if (!loc && join === 'miter' && numSegments > 1) { for (var i = 0; i < numSegments; i++) { var segment = segments[i]; if (point.getDistance(segment._point) <= miterLimit * strokeRadius && checkSegmentStroke(segment)) { loc = segment.getLocation(); break; } } } } return !loc && hitFill && this._contains(point) || loc && !hitStroke && !hitCurves ? new HitResult('fill', this) : loc ? new HitResult(hitStroke ? 'stroke' : 'curve', this, { location: loc, point: loc.getPoint() }) : null; } }, Base.each(Curve._evaluateMethods, function(name) { this[name + 'At'] = function(offset) { var loc = this.getLocationAt(offset); return loc && loc[name](); }; }, { beans: false, getLocationOf: function() { var point = Point.read(arguments), curves = this.getCurves(); for (var i = 0, l = curves.length; i < l; i++) { var loc = curves[i].getLocationOf(point); if (loc) return loc; } return null; }, getOffsetOf: function() { var loc = this.getLocationOf.apply(this, arguments); return loc ? loc.getOffset() : null; }, getLocationAt: function(offset) { if (typeof offset === 'number') { var curves = this.getCurves(), length = 0; for (var i = 0, l = curves.length; i < l; i++) { var start = length, curve = curves[i]; length += curve.getLength(); if (length > offset) { return curve.getLocationAt(offset - start); } } if (curves.length > 0 && offset <= this.getLength()) { return new CurveLocation(curves[curves.length - 1], 1); } } else if (offset && offset.getPath && offset.getPath() === this) { return offset; } return null; }, getOffsetsWithTangent: function() { var tangent = Point.read(arguments); if (tangent.isZero()) { return []; } var offsets = []; var curveStart = 0; var curves = this.getCurves(); for (var i = 0, l = curves.length; i < l; i++) { var curve = curves[i]; var curveTimes = curve.getTimesWithTangent(tangent); for (var j = 0, m = curveTimes.length; j < m; j++) { var offset = curveStart + curve.getOffsetAtTime(curveTimes[j]); if (offsets.indexOf(offset) < 0) { offsets.push(offset); } } curveStart += curve.length; } return offsets; } }), new function() { function drawHandles(ctx, segments, matrix, size, isFullySelected) { if (size === 0) { return; } var half = size / 2, coords = new Array(6), pX, pY; function drawHandle(index) { var hX = coords[index], hY = coords[index + 1]; if (pX != hX || pY != hY) { ctx.beginPath(); ctx.moveTo(pX, pY); ctx.lineTo(hX, hY); ctx.moveTo(hX - half, hY); ctx.lineTo(hX, hY + half); ctx.lineTo(hX + half, hY); ctx.lineTo(hX, hY - half); ctx.closePath(); ctx.stroke(); } } for (var i = 0, l = segments.length; i < l; i++) { var segment = segments[i], selection = segment._selection; segment._transformCoordinates(matrix, coords); pX = coords[0]; pY = coords[1]; if (selection & 2 && !isFullySelected) drawHandle(2); if (selection & 4 && !isFullySelected) drawHandle(4); ctx.beginPath(); ctx.arc(pX, pY, half, 0, Math.PI * 2, true); ctx.stroke(); var fillStyle = ctx.fillStyle; if (!(selection & 1)) { ctx.fillStyle = 'rgba(255, 255, 255, 0.5)'; } ctx.fill(); ctx.fillStyle = fillStyle; } } function drawSegments(ctx, path, matrix) { var segments = path._segments, length = segments.length, coords = new Array(6), first = true, curX, curY, prevX, prevY, inX, inY, outX, outY; function drawSegment(segment) { if (matrix) { segment._transformCoordinates(matrix, coords); curX = coords[0]; curY = coords[1]; } else { var point = segment._point; curX = point._x; curY = point._y; } if (first) { ctx.moveTo(curX, curY); first = false; } else { if (matrix) { inX = coords[2]; inY = coords[3]; } else { var handle = segment._handleIn; inX = curX + handle._x; inY = curY + handle._y; } if (inX === curX && inY === curY && outX === prevX && outY === prevY) { ctx.lineTo(curX, curY); } else { ctx.bezierCurveTo(outX, outY, inX, inY, curX, curY); } } prevX = curX; prevY = curY; if (matrix) { outX = coords[4]; outY = coords[5]; } else { var handle = segment._handleOut; outX = prevX + handle._x; outY = prevY + handle._y; } } for (var i = 0; i < length; i++) drawSegment(segments[i]); if (path._closed && length > 0) drawSegment(segments[0]); } return { _draw: function(ctx, param, viewMatrix, strokeMatrix) { var dontStart = param.dontStart, dontPaint = param.dontFinish || param.clip, style = this.getStyle(), hasFill = style.hasFill(), hasStroke = style.hasStroke(), dashArray = style.getDashArray(), dashLength = !paper.support.nativeDash && hasStroke && dashArray && dashArray.length; if (!dontStart) ctx.beginPath(); if (hasFill || hasStroke && !dashLength || dontPaint) { drawSegments(ctx, this, strokeMatrix); if (this._closed) ctx.closePath(); } function getOffset(i) { return dashArray[((i % dashLength) + dashLength) % dashLength]; } if (!dontPaint && (hasFill || hasStroke)) { this._setStyles(ctx, param, viewMatrix); if (hasFill) { ctx.fill(style.getFillRule()); ctx.shadowColor = 'rgba(0,0,0,0)'; } if (hasStroke) { if (dashLength) { if (!dontStart) ctx.beginPath(); var flattener = new PathFlattener(this, 0.25, 32, false, strokeMatrix), length = flattener.length, from = -style.getDashOffset(), to, i = 0; from = from % length; while (from > 0) { from -= getOffset(i--) + getOffset(i--); } while (from < length) { to = from + getOffset(i++); if (from > 0 || to > 0) flattener.drawPart(ctx, Math.max(from, 0), Math.max(to, 0)); from = to + getOffset(i++); } } ctx.stroke(); } } }, _drawSelected: function(ctx, matrix) { ctx.beginPath(); drawSegments(ctx, this, matrix); ctx.stroke(); drawHandles(ctx, this._segments, matrix, paper.settings.handleSize, this.isFullySelected()); } }; }, new function() { function getCurrentSegment(that) { var segments = that._segments; if (!segments.length) throw new Error('Use a moveTo() command first'); return segments[segments.length - 1]; } return { moveTo: function() { var segments = this._segments; if (segments.length === 1) this.removeSegment(0); if (!segments.length) this._add([ new Segment(Point.read(arguments)) ]); }, moveBy: function() { throw new Error('moveBy() is unsupported on Path items.'); }, lineTo: function() { this._add([ new Segment(Point.read(arguments)) ]); }, cubicCurveTo: function() { var handle1 = Point.read(arguments), handle2 = Point.read(arguments), to = Point.read(arguments), current = getCurrentSegment(this); current.setHandleOut(handle1.subtract(current._point)); this._add([ new Segment(to, handle2.subtract(to)) ]); }, quadraticCurveTo: function() { var handle = Point.read(arguments), to = Point.read(arguments), current = getCurrentSegment(this)._point; this.cubicCurveTo( handle.add(current.subtract(handle).multiply(1 / 3)), handle.add(to.subtract(handle).multiply(1 / 3)), to ); }, curveTo: function() { var through = Point.read(arguments), to = Point.read(arguments), t = Base.pick(Base.read(arguments), 0.5), t1 = 1 - t, current = getCurrentSegment(this)._point, handle = through.subtract(current.multiply(t1 * t1)) .subtract(to.multiply(t * t)).divide(2 * t * t1); if (handle.isNaN()) throw new Error( 'Cannot put a curve through points with parameter = ' + t); this.quadraticCurveTo(handle, to); }, arcTo: function() { var abs = Math.abs, sqrt = Math.sqrt, current = getCurrentSegment(this), from = current._point, to = Point.read(arguments), through, peek = Base.peek(arguments), clockwise = Base.pick(peek, true), center, extent, vector, matrix; if (typeof clockwise === 'boolean') { var middle = from.add(to).divide(2), through = middle.add(middle.subtract(from).rotate( clockwise ? -90 : 90)); } else if (Base.remain(arguments) <= 2) { through = to; to = Point.read(arguments); } else { var radius = Size.read(arguments), isZero = Numerical.isZero; if (isZero(radius.width) || isZero(radius.height)) return this.lineTo(to); var rotation = Base.read(arguments), clockwise = !!Base.read(arguments), large = !!Base.read(arguments), middle = from.add(to).divide(2), pt = from.subtract(middle).rotate(-rotation), x = pt.x, y = pt.y, rx = abs(radius.width), ry = abs(radius.height), rxSq = rx * rx, rySq = ry * ry, xSq = x * x, ySq = y * y; var factor = sqrt(xSq / rxSq + ySq / rySq); if (factor > 1) { rx *= factor; ry *= factor; rxSq = rx * rx; rySq = ry * ry; } factor = (rxSq * rySq - rxSq * ySq - rySq * xSq) / (rxSq * ySq + rySq * xSq); if (abs(factor) < 1e-12) factor = 0; if (factor < 0) throw new Error( 'Cannot create an arc with the given arguments'); center = new Point(rx * y / ry, -ry * x / rx) .multiply((large === clockwise ? -1 : 1) * sqrt(factor)) .rotate(rotation).add(middle); matrix = new Matrix().translate(center).rotate(rotation) .scale(rx, ry); vector = matrix._inverseTransform(from); extent = vector.getDirectedAngle(matrix._inverseTransform(to)); if (!clockwise && extent > 0) extent -= 360; else if (clockwise && extent < 0) extent += 360; } if (through) { var l1 = new Line(from.add(through).divide(2), through.subtract(from).rotate(90), true), l2 = new Line(through.add(to).divide(2), to.subtract(through).rotate(90), true), line = new Line(from, to), throughSide = line.getSide(through); center = l1.intersect(l2, true); if (!center) { if (!throughSide) return this.lineTo(to); throw new Error( 'Cannot create an arc with the given arguments'); } vector = from.subtract(center); extent = vector.getDirectedAngle(to.subtract(center)); var centerSide = line.getSide(center, true); if (centerSide === 0) { extent = throughSide * abs(extent); } else if (throughSide === centerSide) { extent += extent < 0 ? 360 : -360; } } var epsilon = 1e-7, ext = abs(extent), count = ext >= 360 ? 4 : Math.ceil((ext - epsilon) / 90), inc = extent / count, half = inc * Math.PI / 360, z = 4 / 3 * Math.sin(half) / (1 + Math.cos(half)), segments = []; for (var i = 0; i <= count; i++) { var pt = to, out = null; if (i < count) { out = vector.rotate(90).multiply(z); if (matrix) { pt = matrix._transformPoint(vector); out = matrix._transformPoint(vector.add(out)) .subtract(pt); } else { pt = center.add(vector); } } if (!i) { current.setHandleOut(out); } else { var _in = vector.rotate(-90).multiply(z); if (matrix) { _in = matrix._transformPoint(vector.add(_in)) .subtract(pt); } segments.push(new Segment(pt, _in, out)); } vector = vector.rotate(inc); } this._add(segments); }, lineBy: function() { var to = Point.read(arguments), current = getCurrentSegment(this)._point; this.lineTo(current.add(to)); }, curveBy: function() { var through = Point.read(arguments), to = Point.read(arguments), parameter = Base.read(arguments), current = getCurrentSegment(this)._point; this.curveTo(current.add(through), current.add(to), parameter); }, cubicCurveBy: function() { var handle1 = Point.read(arguments), handle2 = Point.read(arguments), to = Point.read(arguments), current = getCurrentSegment(this)._point; this.cubicCurveTo(current.add(handle1), current.add(handle2), current.add(to)); }, quadraticCurveBy: function() { var handle = Point.read(arguments), to = Point.read(arguments), current = getCurrentSegment(this)._point; this.quadraticCurveTo(current.add(handle), current.add(to)); }, arcBy: function() { var current = getCurrentSegment(this)._point, point = current.add(Point.read(arguments)), clockwise = Base.pick(Base.peek(arguments), true); if (typeof clockwise === 'boolean') { this.arcTo(point, clockwise); } else { this.arcTo(point, current.add(Point.read(arguments))); } }, closePath: function(tolerance) { this.setClosed(true); this.join(this, tolerance); } }; }, { _getBounds: function(matrix, options) { var method = options.handle ? 'getHandleBounds' : options.stroke ? 'getStrokeBounds' : 'getBounds'; return Path[method](this._segments, this._closed, this, matrix, options); }, statics: { getBounds: function(segments, closed, path, matrix, options, strokePadding) { var first = segments[0]; if (!first) return new Rectangle(); var coords = new Array(6), prevCoords = first._transformCoordinates(matrix, new Array(6)), min = prevCoords.slice(0, 2), max = min.slice(), roots = new Array(2); function processSegment(segment) { segment._transformCoordinates(matrix, coords); for (var i = 0; i < 2; i++) { Curve._addBounds( prevCoords[i], prevCoords[i + 4], coords[i + 2], coords[i], i, strokePadding ? strokePadding[i] : 0, min, max, roots); } var tmp = prevCoords; prevCoords = coords; coords = tmp; } for (var i = 1, l = segments.length; i < l; i++) processSegment(segments[i]); if (closed) processSegment(first); return new Rectangle(min[0], min[1], max[0] - min[0], max[1] - min[1]); }, getStrokeBounds: function(segments, closed, path, matrix, options) { var style = path.getStyle(), stroke = style.hasStroke(), strokeWidth = style.getStrokeWidth(), strokeMatrix = stroke && path._getStrokeMatrix(matrix, options), strokePadding = stroke && Path._getStrokePadding(strokeWidth, strokeMatrix), bounds = Path.getBounds(segments, closed, path, matrix, options, strokePadding); if (!stroke) return bounds; var strokeRadius = strokeWidth / 2, join = style.getStrokeJoin(), cap = style.getStrokeCap(), miterLimit = style.getMiterLimit(), joinBounds = new Rectangle(new Size(strokePadding)); function addPoint(point) { bounds = bounds.include(point); } function addRound(segment) { bounds = bounds.unite( joinBounds.setCenter(segment._point.transform(matrix))); } function addJoin(segment, join) { if (join === 'round' || segment.isSmooth()) { addRound(segment); } else { Path._addBevelJoin(segment, join, strokeRadius, miterLimit, matrix, strokeMatrix, addPoint); } } function addCap(segment, cap) { if (cap === 'round') { addRound(segment); } else { Path._addSquareCap(segment, cap, strokeRadius, matrix, strokeMatrix, addPoint); } } var length = segments.length - (closed ? 0 : 1); for (var i = 1; i < length; i++) addJoin(segments[i], join); if (closed) { addJoin(segments[0], join); } else if (length > 0) { addCap(segments[0], cap); addCap(segments[segments.length - 1], cap); } return bounds; }, _getStrokePadding: function(radius, matrix) { if (!matrix) return [radius, radius]; var hor = new Point(radius, 0).transform(matrix), ver = new Point(0, radius).transform(matrix), phi = hor.getAngleInRadians(), a = hor.getLength(), b = ver.getLength(); var sin = Math.sin(phi), cos = Math.cos(phi), tan = Math.tan(phi), tx = Math.atan2(b * tan, a), ty = Math.atan2(b, tan * a); return [Math.abs(a * Math.cos(tx) * cos + b * Math.sin(tx) * sin), Math.abs(b * Math.sin(ty) * cos + a * Math.cos(ty) * sin)]; }, _addBevelJoin: function(segment, join, radius, miterLimit, matrix, strokeMatrix, addPoint, isArea) { var curve2 = segment.getCurve(), curve1 = curve2.getPrevious(), point = curve2.getPoint1().transform(matrix), normal1 = curve1.getNormalAtTime(1).multiply(radius) .transform(strokeMatrix), normal2 = curve2.getNormalAtTime(0).multiply(radius) .transform(strokeMatrix); if (normal1.getDirectedAngle(normal2) < 0) { normal1 = normal1.negate(); normal2 = normal2.negate(); } if (isArea) addPoint(point); addPoint(point.add(normal1)); if (join === 'miter') { var corner = new Line(point.add(normal1), new Point(-normal1.y, normal1.x), true ).intersect(new Line(point.add(normal2), new Point(-normal2.y, normal2.x), true ), true); if (corner && point.getDistance(corner) <= miterLimit * radius) { addPoint(corner); } } addPoint(point.add(normal2)); }, _addSquareCap: function(segment, cap, radius, matrix, strokeMatrix, addPoint, isArea) { var point = segment._point.transform(matrix), loc = segment.getLocation(), normal = loc.getNormal() .multiply(loc.getTime() === 0 ? radius : -radius) .transform(strokeMatrix); if (cap === 'square') { if (isArea) { addPoint(point.subtract(normal)); addPoint(point.add(normal)); } point = point.add(normal.rotate(-90)); } addPoint(point.add(normal)); addPoint(point.subtract(normal)); }, getHandleBounds: function(segments, closed, path, matrix, options) { var style = path.getStyle(), stroke = options.stroke && style.hasStroke(), strokePadding, joinPadding; if (stroke) { var strokeMatrix = path._getStrokeMatrix(matrix, options), strokeRadius = style.getStrokeWidth() / 2, joinRadius = strokeRadius; if (style.getStrokeJoin() === 'miter') joinRadius = strokeRadius * style.getMiterLimit(); if (style.getStrokeCap() === 'square') joinRadius = Math.max(joinRadius, strokeRadius * Math.SQRT2); strokePadding = Path._getStrokePadding(strokeRadius, strokeMatrix); joinPadding = Path._getStrokePadding(joinRadius, strokeMatrix); } var coords = new Array(6), x1 = Infinity, x2 = -x1, y1 = x1, y2 = x2; for (var i = 0, l = segments.length; i < l; i++) { var segment = segments[i]; segment._transformCoordinates(matrix, coords); for (var j = 0; j < 6; j += 2) { var padding = !j ? joinPadding : strokePadding, paddingX = padding ? padding[0] : 0, paddingY = padding ? padding[1] : 0, x = coords[j], y = coords[j + 1], xn = x - paddingX, xx = x + paddingX, yn = y - paddingY, yx = y + paddingY; if (xn < x1) x1 = xn; if (xx > x2) x2 = xx; if (yn < y1) y1 = yn; if (yx > y2) y2 = yx; } } return new Rectangle(x1, y1, x2 - x1, y2 - y1); } }}); Path.inject({ statics: new function() { var kappa = 0.5522847498307936, ellipseSegments = [ new Segment([-1, 0], [0, kappa ], [0, -kappa]), new Segment([0, -1], [-kappa, 0], [kappa, 0 ]), new Segment([1, 0], [0, -kappa], [0, kappa ]), new Segment([0, 1], [kappa, 0 ], [-kappa, 0]) ]; function createPath(segments, closed, args) { var props = Base.getNamed(args), path = new Path(props && props.insert == false && Item.NO_INSERT); path._add(segments); path._closed = closed; return path.set(props, { insert: true }); } function createEllipse(center, radius, args) { var segments = new Array(4); for (var i = 0; i < 4; i++) { var segment = ellipseSegments[i]; segments[i] = new Segment( segment._point.multiply(radius).add(center), segment._handleIn.multiply(radius), segment._handleOut.multiply(radius) ); } return createPath(segments, true, args); } return { Line: function() { return createPath([ new Segment(Point.readNamed(arguments, 'from')), new Segment(Point.readNamed(arguments, 'to')) ], false, arguments); }, Circle: function() { var center = Point.readNamed(arguments, 'center'), radius = Base.readNamed(arguments, 'radius'); return createEllipse(center, new Size(radius), arguments); }, Rectangle: function() { var rect = Rectangle.readNamed(arguments, 'rectangle'), radius = Size.readNamed(arguments, 'radius', 0, { readNull: true }), bl = rect.getBottomLeft(true), tl = rect.getTopLeft(true), tr = rect.getTopRight(true), br = rect.getBottomRight(true), segments; if (!radius || radius.isZero()) { segments = [ new Segment(bl), new Segment(tl), new Segment(tr), new Segment(br) ]; } else { radius = Size.min(radius, rect.getSize(true).divide(2)); var rx = radius.width, ry = radius.height, hx = rx * kappa, hy = ry * kappa; segments = [ new Segment(bl.add(rx, 0), null, [-hx, 0]), new Segment(bl.subtract(0, ry), [0, hy]), new Segment(tl.add(0, ry), null, [0, -hy]), new Segment(tl.add(rx, 0), [-hx, 0], null), new Segment(tr.subtract(rx, 0), null, [hx, 0]), new Segment(tr.add(0, ry), [0, -hy], null), new Segment(br.subtract(0, ry), null, [0, hy]), new Segment(br.subtract(rx, 0), [hx, 0]) ]; } return createPath(segments, true, arguments); }, RoundRectangle: '#Rectangle', Ellipse: function() { var ellipse = Shape._readEllipse(arguments); return createEllipse(ellipse.center, ellipse.radius, arguments); }, Oval: '#Ellipse', Arc: function() { var from = Point.readNamed(arguments, 'from'), through = Point.readNamed(arguments, 'through'), to = Point.readNamed(arguments, 'to'), props = Base.getNamed(arguments), path = new Path(props && props.insert == false && Item.NO_INSERT); path.moveTo(from); path.arcTo(through, to); return path.set(props); }, RegularPolygon: function() { var center = Point.readNamed(arguments, 'center'), sides = Base.readNamed(arguments, 'sides'), radius = Base.readNamed(arguments, 'radius'), step = 360 / sides, three = sides % 3 === 0, vector = new Point(0, three ? -radius : radius), offset = three ? -1 : 0.5, segments = new Array(sides); for (var i = 0; i < sides; i++) segments[i] = new Segment(center.add( vector.rotate((i + offset) * step))); return createPath(segments, true, arguments); }, Star: function() { var center = Point.readNamed(arguments, 'center'), points = Base.readNamed(arguments, 'points') * 2, radius1 = Base.readNamed(arguments, 'radius1'), radius2 = Base.readNamed(arguments, 'radius2'), step = 360 / points, vector = new Point(0, -1), segments = new Array(points); for (var i = 0; i < points; i++) segments[i] = new Segment(center.add(vector.rotate(step * i) .multiply(i % 2 ? radius2 : radius1))); return createPath(segments, true, arguments); } }; }}); var CompoundPath = PathItem.extend({ _class: 'CompoundPath', _serializeFields: { children: [] }, beans: true, initialize: function CompoundPath(arg) { this._children = []; this._namedChildren = {}; if (!this._initialize(arg)) { if (typeof arg === 'string') { this.setPathData(arg); } else { this.addChildren(Array.isArray(arg) ? arg : arguments); } } }, insertChildren: function insertChildren(index, items) { var list = items, first = list[0]; if (first && typeof first[0] === 'number') list = [list]; for (var i = items.length - 1; i >= 0; i--) { var item = list[i]; if (list === items && !(item instanceof Path)) list = Base.slice(list); if (Array.isArray(item)) { list[i] = new Path({ segments: item, insert: false }); } else if (item instanceof CompoundPath) { list.splice.apply(list, [i, 1].concat(item.removeChildren())); item.remove(); } } return insertChildren.base.call(this, index, list); }, reduce: function reduce(options) { var children = this._children; for (var i = children.length - 1; i >= 0; i--) { var path = children[i].reduce(options); if (path.isEmpty()) path.remove(); } if (!children.length) { var path = new Path(Item.NO_INSERT); path.copyAttributes(this); path.insertAbove(this); this.remove(); return path; } return reduce.base.call(this); }, isClosed: function() { var children = this._children; for (var i = 0, l = children.length; i < l; i++) { if (!children[i]._closed) return false; } return true; }, setClosed: function(closed) { var children = this._children; for (var i = 0, l = children.length; i < l; i++) { children[i].setClosed(closed); } }, getFirstSegment: function() { var first = this.getFirstChild(); return first && first.getFirstSegment(); }, getLastSegment: function() { var last = this.getLastChild(); return last && last.getLastSegment(); }, getCurves: function() { var children = this._children, curves = []; for (var i = 0, l = children.length; i < l; i++) { Base.push(curves, children[i].getCurves()); } return curves; }, getFirstCurve: function() { var first = this.getFirstChild(); return first && first.getFirstCurve(); }, getLastCurve: function() { var last = this.getLastChild(); return last && last.getLastCurve(); }, getArea: function() { var children = this._children, area = 0; for (var i = 0, l = children.length; i < l; i++) area += children[i].getArea(); return area; }, getLength: function() { var children = this._children, length = 0; for (var i = 0, l = children.length; i < l; i++) length += children[i].getLength(); return length; }, getPathData: function(_matrix, _precision) { var children = this._children, paths = []; for (var i = 0, l = children.length; i < l; i++) { var child = children[i], mx = child._matrix; paths.push(child.getPathData(_matrix && !mx.isIdentity() ? _matrix.appended(mx) : _matrix, _precision)); } return paths.join(''); }, _hitTestChildren: function _hitTestChildren(point, options, viewMatrix) { return _hitTestChildren.base.call(this, point, options.class === Path || options.type === 'path' || options.hitUnfilledPaths ? options : Base.set({}, options, { fill: false }), viewMatrix); }, _draw: function(ctx, param, viewMatrix, strokeMatrix) { var children = this._children; if (!children.length) return; param = param.extend({ dontStart: true, dontFinish: true }); ctx.beginPath(); for (var i = 0, l = children.length; i < l; i++) children[i].draw(ctx, param, strokeMatrix); if (!param.clip) { this._setStyles(ctx, param, viewMatrix); var style = this._style; if (style.hasFill()) { ctx.fill(style.getFillRule()); ctx.shadowColor = 'rgba(0,0,0,0)'; } if (style.hasStroke()) ctx.stroke(); } }, _drawSelected: function(ctx, matrix, selectionItems) { var children = this._children; for (var i = 0, l = children.length; i < l; i++) { var child = children[i], mx = child._matrix; if (!selectionItems[child._id]) { child._drawSelected(ctx, mx.isIdentity() ? matrix : matrix.appended(mx)); } } } }, new function() { function getCurrentPath(that, check) { var children = that._children; if (check && !children.length) throw new Error('Use a moveTo() command first'); return children[children.length - 1]; } return Base.each(['lineTo', 'cubicCurveTo', 'quadraticCurveTo', 'curveTo', 'arcTo', 'lineBy', 'cubicCurveBy', 'quadraticCurveBy', 'curveBy', 'arcBy'], function(key) { this[key] = function() { var path = getCurrentPath(this, true); path[key].apply(path, arguments); }; }, { moveTo: function() { var current = getCurrentPath(this), path = current && current.isEmpty() ? current : new Path(Item.NO_INSERT); if (path !== current) this.addChild(path); path.moveTo.apply(path, arguments); }, moveBy: function() { var current = getCurrentPath(this, true), last = current && current.getLastSegment(), point = Point.read(arguments); this.moveTo(last ? point.add(last._point) : point); }, closePath: function(tolerance) { getCurrentPath(this, true).closePath(tolerance); } } ); }, Base.each(['reverse', 'flatten', 'simplify', 'smooth'], function(key) { this[key] = function(param) { var children = this._children, res; for (var i = 0, l = children.length; i < l; i++) { res = children[i][key](param) || res; } return res; }; }, {})); PathItem.inject(new function() { var min = Math.min, max = Math.max, abs = Math.abs, operators = { unite: { '1': true, '2': true }, intersect: { '2': true }, subtract: { '1': true }, exclude: { '1': true, '-1': true } }; function preparePath(path, resolve) { var res = path.clone(false).reduce({ simplify: true }) .transform(null, true, true); return resolve ? res.resolveCrossings().reorient( res.getFillRule() === 'nonzero', true) : res; } function createResult(paths, simplify, path1, path2, options) { var result = new CompoundPath(Item.NO_INSERT); result.addChildren(paths, true); result = result.reduce({ simplify: simplify }); if (!(options && options.insert == false)) { result.insertAbove(path2 && path1.isSibling(path2) && path1.getIndex() < path2.getIndex() ? path2 : path1); } result.copyAttributes(path1, true); return result; } function traceBoolean(path1, path2, operation, options) { if (options && (options.trace == false || options.stroke) && /^(subtract|intersect)$/.test(operation)) return splitBoolean(path1, path2, operation); var _path1 = preparePath(path1, true), _path2 = path2 && path1 !== path2 && preparePath(path2, true), operator = operators[operation]; operator[operation] = true; if (_path2 && (operator.subtract || operator.exclude) ^ (_path2.isClockwise() ^ _path1.isClockwise())) _path2.reverse(); var crossings = divideLocations( CurveLocation.expand(_path1.getCrossings(_path2))), paths1 = _path1._children || [_path1], paths2 = _path2 && (_path2._children || [_path2]), segments = [], curves = [], paths; function collect(paths) { for (var i = 0, l = paths.length; i < l; i++) { var path = paths[i]; Base.push(segments, path._segments); Base.push(curves, path.getCurves()); path._overlapsOnly = true; } } if (crossings.length) { collect(paths1); if (paths2) collect(paths2); for (var i = 0, l = crossings.length; i < l; i++) { propagateWinding(crossings[i]._segment, _path1, _path2, curves, operator); } for (var i = 0, l = segments.length; i < l; i++) { var segment = segments[i], inter = segment._intersection; if (!segment._winding) { propagateWinding(segment, _path1, _path2, curves, operator); } if (!(inter && inter._overlap)) segment._path._overlapsOnly = false; } paths = tracePaths(segments, operator); } else { paths = reorientPaths( paths2 ? paths1.concat(paths2) : paths1.slice(), function(w) { return !!operator[w]; }); } return createResult(paths, true, path1, path2, options); } function splitBoolean(path1, path2, operation) { var _path1 = preparePath(path1), _path2 = preparePath(path2), crossings = _path1.getCrossings(_path2), subtract = operation === 'subtract', divide = operation === 'divide', added = {}, paths = []; function addPath(path) { if (!added[path._id] && (divide || _path2.contains(path.getPointAt(path.getLength() / 2)) ^ subtract)) { paths.unshift(path); return added[path._id] = true; } } for (var i = crossings.length - 1; i >= 0; i--) { var path = crossings[i].split(); if (path) { if (addPath(path)) path.getFirstSegment().setHandleIn(0, 0); _path1.getLastSegment().setHandleOut(0, 0); } } addPath(_path1); return createResult(paths, false, path1, path2); } function linkIntersections(from, to) { var prev = from; while (prev) { if (prev === to) return; prev = prev._previous; } while (from._next && from._next !== to) from = from._next; if (!from._next) { while (to._previous) to = to._previous; from._next = to; to._previous = from; } } function clearCurveHandles(curves) { for (var i = curves.length - 1; i >= 0; i--) curves[i].clearHandles(); } function reorientPaths(paths, isInside, clockwise) { var length = paths && paths.length; if (length) { var lookup = Base.each(paths, function (path, i) { this[path._id] = { container: null, winding: path.isClockwise() ? 1 : -1, index: i }; }, {}), sorted = paths.slice().sort(function (a, b) { return abs(b.getArea()) - abs(a.getArea()); }), first = sorted[0]; if (clockwise == null) clockwise = first.isClockwise(); for (var i = 0; i < length; i++) { var path1 = sorted[i], entry1 = lookup[path1._id], point = path1.getInteriorPoint(), containerWinding = 0; for (var j = i - 1; j >= 0; j--) { var path2 = sorted[j]; if (path2.contains(point)) { var entry2 = lookup[path2._id]; containerWinding = entry2.winding; entry1.winding += containerWinding; entry1.container = entry2.exclude ? entry2.container : path2; break; } } if (isInside(entry1.winding) === isInside(containerWinding)) { entry1.exclude = true; paths[entry1.index] = null; } else { var container = entry1.container; path1.setClockwise(container ? !container.isClockwise() : clockwise); } } } return paths; } function divideLocations(locations, include, clearLater) { var results = include && [], tMin = 1e-8, tMax = 1 - tMin, clearHandles = false, clearCurves = clearLater || [], clearLookup = clearLater && {}, renormalizeLocs, prevCurve, prevTime; function getId(curve) { return curve._path._id + '.' + curve._segment1._index; } for (var i = (clearLater && clearLater.length) - 1; i >= 0; i--) { var curve = clearLater[i]; if (curve._path) clearLookup[getId(curve)] = true; } for (var i = locations.length - 1; i >= 0; i--) { var loc = locations[i], time = loc._time, origTime = time, exclude = include && !include(loc), curve = loc._curve, segment; if (curve) { if (curve !== prevCurve) { clearHandles = !curve.hasHandles() || clearLookup && clearLookup[getId(curve)]; renormalizeLocs = []; prevTime = null; prevCurve = curve; } else if (prevTime >= tMin) { time /= prevTime; } } if (exclude) { if (renormalizeLocs) renormalizeLocs.push(loc); continue; } else if (include) { results.unshift(loc); } prevTime = origTime; if (time < tMin) { segment = curve._segment1; } else if (time > tMax) { segment = curve._segment2; } else { var newCurve = curve.divideAtTime(time, true); if (clearHandles) clearCurves.push(curve, newCurve); segment = newCurve._segment1; for (var j = renormalizeLocs.length - 1; j >= 0; j--) { var l = renormalizeLocs[j]; l._time = (l._time - time) / (1 - time); } } loc._setSegment(segment); var inter = segment._intersection, dest = loc._intersection; if (inter) { linkIntersections(inter, dest); var other = inter; while (other) { linkIntersections(other._intersection, inter); other = other._next; } } else { segment._intersection = dest; } } if (!clearLater) clearCurveHandles(clearCurves); return results || locations; } function getWinding(point, curves, dir, closed, dontFlip) { var ia = dir ? 1 : 0, io = ia ^ 1, pv = [point.x, point.y], pa = pv[ia], po = pv[io], windingEpsilon = 1e-9, qualityEpsilon = 1e-6, paL = pa - windingEpsilon, paR = pa + windingEpsilon, windingL = 0, windingR = 0, pathWindingL = 0, pathWindingR = 0, onPath = false, onAnyPath = false, quality = 1, roots = [], vPrev, vClose; function addWinding(v) { var o0 = v[io + 0], o3 = v[io + 6]; if (po < min(o0, o3) || po > max(o0, o3)) { return; } var a0 = v[ia + 0], a1 = v[ia + 2], a2 = v[ia + 4], a3 = v[ia + 6]; if (o0 === o3) { if (a0 < paR && a3 > paL || a3 < paR && a0 > paL) { onPath = true; } return; } var t = po === o0 ? 0 : po === o3 ? 1 : paL > max(a0, a1, a2, a3) || paR < min(a0, a1, a2, a3) ? 1 : Curve.solveCubic(v, io, po, roots, 0, 1) > 0 ? roots[0] : 1, a = t === 0 ? a0 : t === 1 ? a3 : Curve.getPoint(v, t)[dir ? 'y' : 'x'], winding = o0 > o3 ? 1 : -1, windingPrev = vPrev[io] > vPrev[io + 6] ? 1 : -1, a3Prev = vPrev[ia + 6]; if (po !== o0) { if (a < paL) { pathWindingL += winding; } else if (a > paR) { pathWindingR += winding; } else { onPath = true; } if (a > pa - qualityEpsilon && a < pa + qualityEpsilon) quality /= 2; } else { if (winding !== windingPrev) { if (a0 < paL) { pathWindingL += winding; } else if (a0 > paR) { pathWindingR += winding; } } else if (a0 != a3Prev) { if (a3Prev < paR && a > paR) { pathWindingR += winding; onPath = true; } else if (a3Prev > paL && a < paL) { pathWindingL += winding; onPath = true; } } quality = 0; } vPrev = v; return !dontFlip && a > paL && a < paR && Curve.getTangent(v, t)[dir ? 'x' : 'y'] === 0 && getWinding(point, curves, !dir, closed, true); } function handleCurve(v) { var o0 = v[io + 0], o1 = v[io + 2], o2 = v[io + 4], o3 = v[io + 6]; if (po <= max(o0, o1, o2, o3) && po >= min(o0, o1, o2, o3)) { var a0 = v[ia + 0], a1 = v[ia + 2], a2 = v[ia + 4], a3 = v[ia + 6], monoCurves = paL > max(a0, a1, a2, a3) || paR < min(a0, a1, a2, a3) ? [v] : Curve.getMonoCurves(v, dir), res; for (var i = 0, l = monoCurves.length; i < l; i++) { if (res = addWinding(monoCurves[i])) return res; } } } for (var i = 0, l = curves.length; i < l; i++) { var curve = curves[i], path = curve._path, v = curve.getValues(), res; if (!i || curves[i - 1]._path !== path) { vPrev = null; if (!path._closed) { vClose = Curve.getValues( path.getLastCurve().getSegment2(), curve.getSegment1(), null, !closed); if (vClose[io] !== vClose[io + 6]) { vPrev = vClose; } } if (!vPrev) { vPrev = v; var prev = path.getLastCurve(); while (prev && prev !== curve) { var v2 = prev.getValues(); if (v2[io] !== v2[io + 6]) { vPrev = v2; break; } prev = prev.getPrevious(); } } } if (res = handleCurve(v)) return res; if (i + 1 === l || curves[i + 1]._path !== path) { if (vClose && (res = handleCurve(vClose))) return res; if (onPath && !pathWindingL && !pathWindingR) { pathWindingL = pathWindingR = path.isClockwise(closed) ^ dir ? 1 : -1; } windingL += pathWindingL; windingR += pathWindingR; pathWindingL = pathWindingR = 0; if (onPath) { onAnyPath = true; onPath = false; } vClose = null; } } windingL = abs(windingL); windingR = abs(windingR); return { winding: max(windingL, windingR), windingL: windingL, windingR: windingR, quality: quality, onPath: onAnyPath }; } function propagateWinding(segment, path1, path2, curves, operator) { var chain = [], start = segment, totalLength = 0, winding; do { var curve = segment.getCurve(), length = curve.getLength(); chain.push({ segment: segment, curve: curve, length: length }); totalLength += length; segment = segment.getNext(); } while (segment && !segment._intersection && segment !== start); var offsets = [0.5, 0.25, 0.75], winding = { winding: 0, quality: -1 }, tMin = 1e-8, tMax = 1 - tMin; for (var i = 0; i < offsets.length && winding.quality < 0.5; i++) { var length = totalLength * offsets[i]; for (var j = 0, l = chain.length; j < l; j++) { var entry = chain[j], curveLength = entry.length; if (length <= curveLength) { var curve = entry.curve, path = curve._path, parent = path._parent, operand = parent instanceof CompoundPath ? parent : path, t = Numerical.clamp(curve.getTimeAt(length), tMin, tMax), pt = curve.getPointAtTime(t), dir = abs(curve.getTangentAtTime(t).y) < Math.SQRT1_2; var wind = null; if (operator.subtract && path2) { var pathWinding = operand === path1 ? path2._getWinding(pt, dir, true) : path1._getWinding(pt, dir, true); if (operand === path1 && pathWinding.winding || operand === path2 && !pathWinding.winding) { if (pathWinding.quality < 1) { continue; } else { wind = { winding: 0, quality: 1 }; } } } wind = wind || getWinding(pt, curves, dir, true); if (wind.quality > winding.quality) winding = wind; break; } length -= curveLength; } } for (var j = chain.length - 1; j >= 0; j--) { chain[j].segment._winding = winding; } } function tracePaths(segments, operator) { var paths = [], starts; function isValid(seg) { var winding; return !!(seg && !seg._visited && (!operator || operator[(winding = seg._winding || {}).winding] && !(operator.unite && winding.winding === 2 && winding.windingL && winding.windingR))); } function isStart(seg) { if (seg) { for (var i = 0, l = starts.length; i < l; i++) { if (seg === starts[i]) return true; } } return false; } function visitPath(path) { var segments = path._segments; for (var i = 0, l = segments.length; i < l; i++) { segments[i]._visited = true; } } function getCrossingSegments(segment, collectStarts) { var inter = segment._intersection, start = inter, crossings = []; if (collectStarts) starts = [segment]; function collect(inter, end) { while (inter && inter !== end) { var other = inter._segment, path = other && other._path; if (path) { var next = other.getNext() || path.getFirstSegment(), nextInter = next._intersection; if (other !== segment && (isStart(other) || isStart(next) || next && (isValid(other) && (isValid(next) || nextInter && isValid(nextInter._segment)))) ) { crossings.push(other); } if (collectStarts) starts.push(other); } inter = inter._next; } } if (inter) { collect(inter); while (inter && inter._prev) inter = inter._prev; collect(inter, start); } return crossings; } segments.sort(function(seg1, seg2) { var inter1 = seg1._intersection, inter2 = seg2._intersection, over1 = !!(inter1 && inter1._overlap), over2 = !!(inter2 && inter2._overlap), path1 = seg1._path, path2 = seg2._path; return over1 ^ over2 ? over1 ? 1 : -1 : !inter1 ^ !inter2 ? inter1 ? 1 : -1 : path1 !== path2 ? path1._id - path2._id : seg1._index - seg2._index; }); for (var i = 0, l = segments.length; i < l; i++) { var seg = segments[i], valid = isValid(seg), path = null, finished = false, closed = true, branches = [], branch, visited, handleIn; if (valid && seg._path._overlapsOnly) { var path1 = seg._path, path2 = seg._intersection._segment._path; if (path1.compare(path2)) { if (path1.getArea()) paths.push(path1.clone(false)); visitPath(path1); visitPath(path2); valid = false; } } while (valid) { var first = !path, crossings = getCrossingSegments(seg, first), other = crossings.shift(), finished = !first && (isStart(seg) || isStart(other)), cross = !finished && other; if (first) { path = new Path(Item.NO_INSERT); branch = null; } if (finished) { if (seg.isFirst() || seg.isLast()) closed = seg._path._closed; seg._visited = true; break; } if (cross && branch) { branches.push(branch); branch = null; } if (!branch) { if (cross) crossings.push(seg); branch = { start: path._segments.length, crossings: crossings, visited: visited = [], handleIn: handleIn }; } if (cross) seg = other; if (!isValid(seg)) { path.removeSegments(branch.start); for (var j = 0, k = visited.length; j < k; j++) { visited[j]._visited = false; } visited.length = 0; do { seg = branch && branch.crossings.shift(); if (!seg || !seg._path) { seg = null; branch = branches.pop(); if (branch) { visited = branch.visited; handleIn = branch.handleIn; } } } while (branch && !isValid(seg)); if (!seg) break; } var next = seg.getNext(); path.add(new Segment(seg._point, handleIn, next && seg._handleOut)); seg._visited = true; visited.push(seg); seg = next || seg._path.getFirstSegment(); handleIn = next && next._handleIn; } if (finished) { if (closed) { path.getFirstSegment().setHandleIn(handleIn); path.setClosed(closed); } if (path.getArea() !== 0) { paths.push(path); } } } return paths; } return { _getWinding: function(point, dir, closed) { return getWinding(point, this.getCurves(), dir, closed); }, unite: function(path, options) { return traceBoolean(this, path, 'unite', options); }, intersect: function(path, options) { return traceBoolean(this, path, 'intersect', options); }, subtract: function(path, options) { return traceBoolean(this, path, 'subtract', options); }, exclude: function(path, options) { return traceBoolean(this, path, 'exclude', options); }, divide: function(path, options) { return options && (options.trace == false || options.stroke) ? splitBoolean(this, path, 'divide') : createResult([ this.subtract(path, options), this.intersect(path, options) ], true, this, path, options); }, resolveCrossings: function() { var children = this._children, paths = children || [this]; function hasOverlap(seg, path) { var inter = seg && seg._intersection; return inter && inter._overlap && inter._path === path; } var hasOverlaps = false, hasCrossings = false, intersections = this.getIntersections(null, function(inter) { return inter.hasOverlap() && (hasOverlaps = true) || inter.isCrossing() && (hasCrossings = true); }), clearCurves = hasOverlaps && hasCrossings && []; intersections = CurveLocation.expand(intersections); if (hasOverlaps) { var overlaps = divideLocations(intersections, function(inter) { return inter.hasOverlap(); }, clearCurves); for (var i = overlaps.length - 1; i >= 0; i--) { var overlap = overlaps[i], path = overlap._path, seg = overlap._segment, prev = seg.getPrevious(), next = seg.getNext(); if (hasOverlap(prev, path) && hasOverlap(next, path)) { seg.remove(); prev._handleOut._set(0, 0); next._handleIn._set(0, 0); if (prev !== seg && !prev.getCurve().hasLength()) { next._handleIn.set(prev._handleIn); prev.remove(); } } } } if (hasCrossings) { divideLocations(intersections, hasOverlaps && function(inter) { var curve1 = inter.getCurve(), seg1 = inter.getSegment(), other = inter._intersection, curve2 = other._curve, seg2 = other._segment; if (curve1 && curve2 && curve1._path && curve2._path) return true; if (seg1) seg1._intersection = null; if (seg2) seg2._intersection = null; }, clearCurves); if (clearCurves) clearCurveHandles(clearCurves); paths = tracePaths(Base.each(paths, function(path) { Base.push(this, path._segments); }, [])); } var length = paths.length, item; if (length > 1 && children) { if (paths !== children) this.setChildren(paths); item = this; } else if (length === 1 && !children) { if (paths[0] !== this) this.setSegments(paths[0].removeSegments()); item = this; } if (!item) { item = new CompoundPath(Item.NO_INSERT); item.addChildren(paths); item = item.reduce(); item.copyAttributes(this); this.replaceWith(item); } return item; }, reorient: function(nonZero, clockwise) { var children = this._children; if (children && children.length) { this.setChildren(reorientPaths(this.removeChildren(), function(w) { return !!(nonZero ? w : w & 1); }, clockwise)); } else if (clockwise !== undefined) { this.setClockwise(clockwise); } return this; }, getInteriorPoint: function() { var bounds = this.getBounds(), point = bounds.getCenter(true); if (!this.contains(point)) { var curves = this.getCurves(), y = point.y, intercepts = [], roots = []; for (var i = 0, l = curves.length; i < l; i++) { var v = curves[i].getValues(), o0 = v[1], o1 = v[3], o2 = v[5], o3 = v[7]; if (y >= min(o0, o1, o2, o3) && y <= max(o0, o1, o2, o3)) { var monoCurves = Curve.getMonoCurves(v); for (var j = 0, m = monoCurves.length; j < m; j++) { var mv = monoCurves[j], mo0 = mv[1], mo3 = mv[7]; if ((mo0 !== mo3) && (y >= mo0 && y <= mo3 || y >= mo3 && y <= mo0)){ var x = y === mo0 ? mv[0] : y === mo3 ? mv[6] : Curve.solveCubic(mv, 1, y, roots, 0, 1) === 1 ? Curve.getPoint(mv, roots[0]).x : (mv[0] + mv[6]) / 2; intercepts.push(x); } } } } if (intercepts.length > 1) { intercepts.sort(function(a, b) { return a - b; }); point.x = (intercepts[0] + intercepts[1]) / 2; } } return point; } }; }); var PathFlattener = Base.extend({ _class: 'PathFlattener', initialize: function(path, flatness, maxRecursion, ignoreStraight, matrix) { var curves = [], parts = [], length = 0, minSpan = 1 / (maxRecursion || 32), segments = path._segments, segment1 = segments[0], segment2; function addCurve(segment1, segment2) { var curve = Curve.getValues(segment1, segment2, matrix); curves.push(curve); computeParts(curve, segment1._index, 0, 1); } function computeParts(curve, index, t1, t2) { if ((t2 - t1) > minSpan && !(ignoreStraight && Curve.isStraight(curve)) && !Curve.isFlatEnough(curve, flatness || 0.25)) { var halves = Curve.subdivide(curve, 0.5), tMid = (t1 + t2) / 2; computeParts(halves[0], index, t1, tMid); computeParts(halves[1], index, tMid, t2); } else { var dx = curve[6] - curve[0], dy = curve[7] - curve[1], dist = Math.sqrt(dx * dx + dy * dy); if (dist > 0) { length += dist; parts.push({ offset: length, curve: curve, index: index, time: t2, }); } } } for (var i = 1, l = segments.length; i < l; i++) { segment2 = segments[i]; addCurve(segment1, segment2); segment1 = segment2; } if (path._closed) addCurve(segment2 || segment1, segments[0]); this.curves = curves; this.parts = parts; this.length = length; this.index = 0; }, _get: function(offset) { var parts = this.parts, length = parts.length, start, i, j = this.index; for (;;) { i = j; if (!j || parts[--j].offset < offset) break; } for (; i < length; i++) { var part = parts[i]; if (part.offset >= offset) { this.index = i; var prev = parts[i - 1], prevTime = prev && prev.index === part.index ? prev.time : 0, prevOffset = prev ? prev.offset : 0; return { index: part.index, time: prevTime + (part.time - prevTime) * (offset - prevOffset) / (part.offset - prevOffset) }; } } return { index: parts[length - 1].index, time: 1 }; }, drawPart: function(ctx, from, to) { var start = this._get(from), end = this._get(to); for (var i = start.index, l = end.index; i <= l; i++) { var curve = Curve.getPart(this.curves[i], i === start.index ? start.time : 0, i === end.index ? end.time : 1); if (i === start.index) ctx.moveTo(curve[0], curve[1]); ctx.bezierCurveTo.apply(ctx, curve.slice(2)); } } }, Base.each(Curve._evaluateMethods, function(name) { this[name + 'At'] = function(offset) { var param = this._get(offset); return Curve[name](this.curves[param.index], param.time); }; }, {}) ); var PathFitter = Base.extend({ initialize: function(path) { var points = this.points = [], segments = path._segments, closed = path._closed; for (var i = 0, prev, l = segments.length; i < l; i++) { var point = segments[i].point; if (!prev || !prev.equals(point)) { points.push(prev = point.clone()); } } if (closed) { points.unshift(points[points.length - 1]); points.push(points[1]); } this.closed = closed; }, fit: function(error) { var points = this.points, length = points.length, segments = null; if (length > 0) { segments = [new Segment(points[0])]; if (length > 1) { this.fitCubic(segments, error, 0, length - 1, points[1].subtract(points[0]), points[length - 2].subtract(points[length - 1])); if (this.closed) { segments.shift(); segments.pop(); } } } return segments; }, fitCubic: function(segments, error, first, last, tan1, tan2) { var points = this.points; if (last - first === 1) { var pt1 = points[first], pt2 = points[last], dist = pt1.getDistance(pt2) / 3; this.addCurve(segments, [pt1, pt1.add(tan1.normalize(dist)), pt2.add(tan2.normalize(dist)), pt2]); return; } var uPrime = this.chordLengthParameterize(first, last), maxError = Math.max(error, error * error), split, parametersInOrder = true; for (var i = 0; i <= 4; i++) { var curve = this.generateBezier(first, last, uPrime, tan1, tan2); var max = this.findMaxError(first, last, curve, uPrime); if (max.error < error && parametersInOrder) { this.addCurve(segments, curve); return; } split = max.index; if (max.error >= maxError) break; parametersInOrder = this.reparameterize(first, last, uPrime, curve); maxError = max.error; } var tanCenter = points[split - 1].subtract(points[split + 1]); this.fitCubic(segments, error, first, split, tan1, tanCenter); this.fitCubic(segments, error, split, last, tanCenter.negate(), tan2); }, addCurve: function(segments, curve) { var prev = segments[segments.length - 1]; prev.setHandleOut(curve[1].subtract(curve[0])); segments.push(new Segment(curve[3], curve[2].subtract(curve[3]))); }, generateBezier: function(first, last, uPrime, tan1, tan2) { var epsilon = 1e-12, abs = Math.abs, points = this.points, pt1 = points[first], pt2 = points[last], C = [[0, 0], [0, 0]], X = [0, 0]; for (var i = 0, l = last - first + 1; i < l; i++) { var u = uPrime[i], t = 1 - u, b = 3 * u * t, b0 = t * t * t, b1 = b * t, b2 = b * u, b3 = u * u * u, a1 = tan1.normalize(b1), a2 = tan2.normalize(b2), tmp = points[first + i] .subtract(pt1.multiply(b0 + b1)) .subtract(pt2.multiply(b2 + b3)); C[0][0] += a1.dot(a1); C[0][1] += a1.dot(a2); C[1][0] = C[0][1]; C[1][1] += a2.dot(a2); X[0] += a1.dot(tmp); X[1] += a2.dot(tmp); } var detC0C1 = C[0][0] * C[1][1] - C[1][0] * C[0][1], alpha1, alpha2; if (abs(detC0C1) > epsilon) { var detC0X = C[0][0] * X[1] - C[1][0] * X[0], detXC1 = X[0] * C[1][1] - X[1] * C[0][1]; alpha1 = detXC1 / detC0C1; alpha2 = detC0X / detC0C1; } else { var c0 = C[0][0] + C[0][1], c1 = C[1][0] + C[1][1]; alpha1 = alpha2 = abs(c0) > epsilon ? X[0] / c0 : abs(c1) > epsilon ? X[1] / c1 : 0; } var segLength = pt2.getDistance(pt1), eps = epsilon * segLength, handle1, handle2; if (alpha1 < eps || alpha2 < eps) { alpha1 = alpha2 = segLength / 3; } else { var line = pt2.subtract(pt1); handle1 = tan1.normalize(alpha1); handle2 = tan2.normalize(alpha2); if (handle1.dot(line) - handle2.dot(line) > segLength * segLength) { alpha1 = alpha2 = segLength / 3; handle1 = handle2 = null; } } return [pt1, pt1.add(handle1 || tan1.normalize(alpha1)), pt2.add(handle2 || tan2.normalize(alpha2)), pt2]; }, reparameterize: function(first, last, u, curve) { for (var i = first; i <= last; i++) { u[i - first] = this.findRoot(curve, this.points[i], u[i - first]); } for (var i = 1, l = u.length; i < l; i++) { if (u[i] <= u[i - 1]) return false; } return true; }, findRoot: function(curve, point, u) { var curve1 = [], curve2 = []; for (var i = 0; i <= 2; i++) { curve1[i] = curve[i + 1].subtract(curve[i]).multiply(3); } for (var i = 0; i <= 1; i++) { curve2[i] = curve1[i + 1].subtract(curve1[i]).multiply(2); } var pt = this.evaluate(3, curve, u), pt1 = this.evaluate(2, curve1, u), pt2 = this.evaluate(1, curve2, u), diff = pt.subtract(point), df = pt1.dot(pt1) + diff.dot(pt2); return Numerical.isZero(df) ? u : u - diff.dot(pt1) / df; }, evaluate: function(degree, curve, t) { var tmp = curve.slice(); for (var i = 1; i <= degree; i++) { for (var j = 0; j <= degree - i; j++) { tmp[j] = tmp[j].multiply(1 - t).add(tmp[j + 1].multiply(t)); } } return tmp[0]; }, chordLengthParameterize: function(first, last) { var u = [0]; for (var i = first + 1; i <= last; i++) { u[i - first] = u[i - first - 1] + this.points[i].getDistance(this.points[i - 1]); } for (var i = 1, m = last - first; i <= m; i++) { u[i] /= u[m]; } return u; }, findMaxError: function(first, last, curve, u) { var index = Math.floor((last - first + 1) / 2), maxDist = 0; for (var i = first + 1; i < last; i++) { var P = this.evaluate(3, curve, u[i - first]); var v = P.subtract(this.points[i]); var dist = v.x * v.x + v.y * v.y; if (dist >= maxDist) { maxDist = dist; index = i; } } return { error: maxDist, index: index }; } }); var TextItem = Item.extend({ _class: 'TextItem', _applyMatrix: false, _canApplyMatrix: false, _serializeFields: { content: null }, _boundsOptions: { stroke: false, handle: false }, initialize: function TextItem(arg) { this._content = ''; this._lines = []; var hasProps = arg && Base.isPlainObject(arg) && arg.x === undefined && arg.y === undefined; this._initialize(hasProps && arg, !hasProps && Point.read(arguments)); }, _equals: function(item) { return this._content === item._content; }, copyContent: function(source) { this.setContent(source._content); }, getContent: function() { return this._content; }, setContent: function(content) { this._content = '' + content; this._lines = this._content.split(/\r\n|\n|\r/mg); this._changed(521); }, isEmpty: function() { return !this._content; }, getCharacterStyle: '#getStyle', setCharacterStyle: '#setStyle', getParagraphStyle: '#getStyle', setParagraphStyle: '#setStyle' }); var PointText = TextItem.extend({ _class: 'PointText', initialize: function PointText() { TextItem.apply(this, arguments); }, getPoint: function() { var point = this._matrix.getTranslation(); return new LinkedPoint(point.x, point.y, this, 'setPoint'); }, setPoint: function() { var point = Point.read(arguments); this.translate(point.subtract(this._matrix.getTranslation())); }, _draw: function(ctx, param, viewMatrix) { if (!this._content) return; this._setStyles(ctx, param, viewMatrix); var lines = this._lines, style = this._style, hasFill = style.hasFill(), hasStroke = style.hasStroke(), leading = style.getLeading(), shadowColor = ctx.shadowColor; ctx.font = style.getFontStyle(); ctx.textAlign = style.getJustification(); for (var i = 0, l = lines.length; i < l; i++) { ctx.shadowColor = shadowColor; var line = lines[i]; if (hasFill) { ctx.fillText(line, 0, 0); ctx.shadowColor = 'rgba(0,0,0,0)'; } if (hasStroke) ctx.strokeText(line, 0, 0); ctx.translate(0, leading); } }, _getBounds: function(matrix, options) { var rect = options.drawnTextBounds ? this._getDrawnTextSize() : this._getMeasuredTextSize(); return matrix ? matrix._transformBounds(rect, rect) : rect; }, _getMeasuredTextSize: function() { var style = this._style, lines = this._lines, numLines = lines.length, justification = style.getJustification(), leading = style.getLeading(), width = this.getView().getTextWidth(style.getFontStyle(), lines), x = 0; if (justification !== 'left') x -= width / (justification === 'center' ? 2: 1); return new Rectangle(x, numLines ? - 0.75 * leading : 0, width, numLines * leading); }, _getDrawnTextSize: function() { var style = this._style; var lines = this._lines; var numLines = lines.length; var leading = style.getLeading(); var justification = style.getJustification(); var svg = SvgElement.create('svg', { version: '1.1', xmlns: SvgElement.svg }); var node = SvgElement.create('text'); node.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve'); svg.appendChild(node); for (var i = 0; i < numLines; i++) { var tspanNode = SvgElement.create('tspan', { x: '0', dy: i === 0 ? '0' : leading + 'px' }); tspanNode.textContent = this._lines[i]; node.appendChild(tspanNode); } var element = document.createElement('span'); element.style.visibility = ('hidden'); element.style.whiteSpace = 'pre'; element.style.fontSize = this.fontSize + 'px'; element.style.fontFamily = this.font; element.style.lineHeight = this.leading / this.fontSize; var bbox; try { element.appendChild(svg); document.body.appendChild(element); bbox = svg.getBBox(); } finally { document.body.removeChild(element); } var halfStrokeWidth = this.strokeWidth / 2; var width = bbox.width + (halfStrokeWidth * 2); var height = bbox.height + (halfStrokeWidth * 2); var x = bbox.x - halfStrokeWidth; var y = bbox.y - halfStrokeWidth; if (justification !== 'left') { var eltWidth = this.getView().getTextWidth(style.getFontStyle(), lines); x -= eltWidth / (justification === 'center' ? 2: 1); } return new Rectangle(x, y, width + 1, Math.max(height, numLines * leading)); }, _hitTestSelf: function(point, options) { if (options.fill && (this.hasFill() || options.hitUnfilledPaths) && this._contains(point)) return new HitResult('fill', this); } }); var Color = Base.extend(new function() { var types = { gray: ['gray'], rgb: ['red', 'green', 'blue'], hsb: ['hue', 'saturation', 'brightness'], hsl: ['hue', 'saturation', 'lightness'], gradient: ['gradient', 'origin', 'destination', 'highlight'] }; var componentParsers = {}, namedColors = { transparent: [0, 0, 0, 0] }, colorCtx; function fromCSS(string) { var match = string.match( /^#([\da-f]{2})([\da-f]{2})([\da-f]{2})([\da-f]{2})?$/i ) || string.match( /^#([\da-f])([\da-f])([\da-f])([\da-f])?$/i ), type = 'rgb', components; if (match) { var amount = match[4] ? 4 : 3; components = new Array(amount); for (var i = 0; i < amount; i++) { var value = match[i + 1]; components[i] = parseInt(value.length == 1 ? value + value : value, 16) / 255; } } else if (match = string.match(/^(rgb|hsl)a?\((.*)\)$/)) { type = match[1]; components = match[2].split(/[,\s]+/g); var isHSL = type === 'hsl'; for (var i = 0, l = Math.min(components.length, 4); i < l; i++) { var component = components[i]; var value = parseFloat(component); if (isHSL) { if (i === 0) { var unit = component.match(/([a-z]*)$/)[1]; value *= ({ turn: 360, rad: 180 / Math.PI, grad: 0.9 }[unit] || 1); } else if (i < 3) { value /= 100; } } else if (i < 3) { value /= 255; } components[i] = value; } } else { var color = namedColors[string]; if (!color) { if (window) { if (!colorCtx) { colorCtx = CanvasProvider.getContext(1, 1); colorCtx.globalCompositeOperation = 'copy'; } colorCtx.fillStyle = 'rgba(0,0,0,0)'; colorCtx.fillStyle = string; colorCtx.fillRect(0, 0, 1, 1); var data = colorCtx.getImageData(0, 0, 1, 1).data; color = namedColors[string] = [ data[0] / 255, data[1] / 255, data[2] / 255 ]; } else { color = [0, 0, 0]; } } components = color.slice(); } return [type, components]; } var hsbIndices = [ [0, 3, 1], [2, 0, 1], [1, 0, 3], [1, 2, 0], [3, 1, 0], [0, 1, 2] ]; var converters = { 'rgb-hsb': function(r, g, b) { var max = Math.max(r, g, b), min = Math.min(r, g, b), delta = max - min, h = delta === 0 ? 0 : ( max == r ? (g - b) / delta + (g < b ? 6 : 0) : max == g ? (b - r) / delta + 2 : (r - g) / delta + 4) * 60; return [h, max === 0 ? 0 : delta / max, max]; }, 'hsb-rgb': function(h, s, b) { h = (((h / 60) % 6) + 6) % 6; var i = Math.floor(h), f = h - i, i = hsbIndices[i], v = [ b, b * (1 - s), b * (1 - s * f), b * (1 - s * (1 - f)) ]; return [v[i[0]], v[i[1]], v[i[2]]]; }, 'rgb-hsl': function(r, g, b) { var max = Math.max(r, g, b), min = Math.min(r, g, b), delta = max - min, achromatic = delta === 0, h = achromatic ? 0 : ( max == r ? (g - b) / delta + (g < b ? 6 : 0) : max == g ? (b - r) / delta + 2 : (r - g) / delta + 4) * 60, l = (max + min) / 2, s = achromatic ? 0 : l < 0.5 ? delta / (max + min) : delta / (2 - max - min); return [h, s, l]; }, 'hsl-rgb': function(h, s, l) { h = (((h / 360) % 1) + 1) % 1; if (s === 0) return [l, l, l]; var t3s = [ h + 1 / 3, h, h - 1 / 3 ], t2 = l < 0.5 ? l * (1 + s) : l + s - l * s, t1 = 2 * l - t2, c = []; for (var i = 0; i < 3; i++) { var t3 = t3s[i]; if (t3 < 0) t3 += 1; if (t3 > 1) t3 -= 1; c[i] = 6 * t3 < 1 ? t1 + (t2 - t1) * 6 * t3 : 2 * t3 < 1 ? t2 : 3 * t3 < 2 ? t1 + (t2 - t1) * ((2 / 3) - t3) * 6 : t1; } return c; }, 'rgb-gray': function(r, g, b) { return [r * 0.2989 + g * 0.587 + b * 0.114]; }, 'gray-rgb': function(g) { return [g, g, g]; }, 'gray-hsb': function(g) { return [0, 0, g]; }, 'gray-hsl': function(g) { return [0, 0, g]; }, 'gradient-rgb': function() { return []; }, 'rgb-gradient': function() { return []; } }; return Base.each(types, function(properties, type) { componentParsers[type] = []; Base.each(properties, function(name, index) { var part = Base.capitalize(name), hasOverlap = /^(hue|saturation)$/.test(name), parser = componentParsers[type][index] = type === 'gradient' ? name === 'gradient' ? function(value) { var current = this._components[0]; value = Gradient.read( Array.isArray(value) ? value : arguments, 0, { readNull: true } ); if (current !== value) { if (current) current._removeOwner(this); if (value) value._addOwner(this); } return value; } : function() { return Point.read(arguments, 0, { readNull: name === 'highlight', clone: true }); } : function(value) { return value == null || isNaN(value) ? 0 : +value; }; this['get' + part] = function() { return this._type === type || hasOverlap && /^hs[bl]$/.test(this._type) ? this._components[index] : this._convert(type)[index]; }; this['set' + part] = function(value) { if (this._type !== type && !(hasOverlap && /^hs[bl]$/.test(this._type))) { this._components = this._convert(type); this._properties = types[type]; this._type = type; } this._components[index] = parser.call(this, value); this._changed(); }; }, this); }, { _class: 'Color', _readIndex: true, initialize: function Color(arg) { var args = arguments, reading = this.__read, read = 0, type, components, alpha, values; if (Array.isArray(arg)) { args = arg; arg = args[0]; } var argType = arg != null && typeof arg; if (argType === 'string' && arg in types) { type = arg; arg = args[1]; if (Array.isArray(arg)) { components = arg; alpha = args[2]; } else { if (reading) read = 1; args = Base.slice(args, 1); argType = typeof arg; } } if (!components) { values = argType === 'number' ? args : argType === 'object' && arg.length != null ? arg : null; if (values) { if (!type) type = values.length >= 3 ? 'rgb' : 'gray'; var length = types[type].length; alpha = values[length]; if (reading) { read += values === arguments ? length + (alpha != null ? 1 : 0) : 1; } if (values.length > length) values = Base.slice(values, 0, length); } else if (argType === 'string') { var converted = fromCSS(arg); type = converted[0]; components = converted[1]; if (components.length === 4) { alpha = components[3]; components.length--; } } else if (argType === 'object') { if (arg.constructor === Color) { type = arg._type; components = arg._components.slice(); alpha = arg._alpha; if (type === 'gradient') { for (var i = 1, l = components.length; i < l; i++) { var point = components[i]; if (point) components[i] = point.clone(); } } } else if (arg.constructor === Gradient) { type = 'gradient'; values = args; } else { type = 'hue' in arg ? 'lightness' in arg ? 'hsl' : 'hsb' : 'gradient' in arg || 'stops' in arg || 'radial' in arg ? 'gradient' : 'gray' in arg ? 'gray' : 'rgb'; var properties = types[type], parsers = componentParsers[type]; this._components = components = []; for (var i = 0, l = properties.length; i < l; i++) { var value = arg[properties[i]]; if (value == null && !i && type === 'gradient' && 'stops' in arg) { value = { stops: arg.stops, radial: arg.radial }; } value = parsers[i].call(this, value); if (value != null) components[i] = value; } alpha = arg.alpha; } } if (reading && type) read = 1; } this._type = type || 'rgb'; if (!components) { this._components = components = []; var parsers = componentParsers[this._type]; for (var i = 0, l = parsers.length; i < l; i++) { var value = parsers[i].call(this, values && values[i]); if (value != null) components[i] = value; } } this._components = components; this._properties = types[this._type]; this._alpha = alpha; if (reading) this.__read = read; return this; }, set: '#initialize', _serialize: function(options, dictionary) { var components = this.getComponents(); return Base.serialize( /^(gray|rgb)$/.test(this._type) ? components : [this._type].concat(components), options, true, dictionary); }, _changed: function() { this._canvasStyle = null; if (this._owner) this._owner._changed(129); }, _convert: function(type) { var converter; return this._type === type ? this._components.slice() : (converter = converters[this._type + '-' + type]) ? converter.apply(this, this._components) : converters['rgb-' + type].apply(this, converters[this._type + '-rgb'].apply(this, this._components)); }, convert: function(type) { return new Color(type, this._convert(type), this._alpha); }, getType: function() { return this._type; }, setType: function(type) { this._components = this._convert(type); this._properties = types[type]; this._type = type; }, getComponents: function() { var components = this._components.slice(); if (this._alpha != null) components.push(this._alpha); return components; }, getAlpha: function() { return this._alpha != null ? this._alpha : 1; }, setAlpha: function(alpha) { this._alpha = alpha == null ? null : Math.min(Math.max(alpha, 0), 1); this._changed(); }, hasAlpha: function() { return this._alpha != null; }, equals: function(color) { var col = Base.isPlainValue(color, true) ? Color.read(arguments) : color; return col === this || col && this._class === col._class && this._type === col._type && this.getAlpha() === col.getAlpha() && Base.equals(this._components, col._components) || false; }, toString: function() { var properties = this._properties, parts = [], isGradient = this._type === 'gradient', f = Formatter.instance; for (var i = 0, l = properties.length; i < l; i++) { var value = this._components[i]; if (value != null) parts.push(properties[i] + ': ' + (isGradient ? value : f.number(value))); } if (this._alpha != null) parts.push('alpha: ' + f.number(this._alpha)); return '{ ' + parts.join(', ') + ' }'; }, toCSS: function(hex) { var components = this._convert('rgb'), alpha = hex || this._alpha == null ? 1 : this._alpha; function convert(val) { return Math.round((val < 0 ? 0 : val > 1 ? 1 : val) * 255); } components = [ convert(components[0]), convert(components[1]), convert(components[2]) ]; if (alpha < 1) components.push(alpha < 0 ? 0 : alpha); return hex ? '#' + ((1 << 24) + (components[0] << 16) + (components[1] << 8) + components[2]).toString(16).slice(1) : (components.length == 4 ? 'rgba(' : 'rgb(') + components.join(',') + ')'; }, toCanvasStyle: function(ctx, matrix) { if (this._canvasStyle) return this._canvasStyle; if (this._type !== 'gradient') return this._canvasStyle = this.toCSS(); var components = this._components, gradient = components[0], stops = gradient._stops, origin = components[1], destination = components[2], highlight = components[3], inverse = matrix && matrix.inverted(), canvasGradient; if (inverse) { origin = inverse._transformPoint(origin); destination = inverse._transformPoint(destination); if (highlight) highlight = inverse._transformPoint(highlight); } if (gradient._radial) { var radius = destination.getDistance(origin); if (highlight) { var vector = highlight.subtract(origin); if (vector.getLength() > radius) highlight = origin.add(vector.normalize(radius - 0.1)); } var start = highlight || origin; canvasGradient = ctx.createRadialGradient(start.x, start.y, 0, origin.x, origin.y, radius); } else { canvasGradient = ctx.createLinearGradient(origin.x, origin.y, destination.x, destination.y); } for (var i = 0, l = stops.length; i < l; i++) { var stop = stops[i], offset = stop._offset; canvasGradient.addColorStop( offset == null ? i / (l - 1) : offset, stop._color.toCanvasStyle()); } return this._canvasStyle = canvasGradient; }, transform: function(matrix) { if (this._type === 'gradient') { var components = this._components; for (var i = 1, l = components.length; i < l; i++) { var point = components[i]; matrix._transformPoint(point, point, true); } this._changed(); } }, statics: { _types: types, random: function() { var random = Math.random; return new Color(random(), random(), random()); } } }); }, new function() { var operators = { add: function(a, b) { return a + b; }, subtract: function(a, b) { return a - b; }, multiply: function(a, b) { return a * b; }, divide: function(a, b) { return a / b; } }; return Base.each(operators, function(operator, name) { this[name] = function(color) { color = Color.read(arguments); var type = this._type, components1 = this._components, components2 = color._convert(type); for (var i = 0, l = components1.length; i < l; i++) components2[i] = operator(components1[i], components2[i]); return new Color(type, components2, this._alpha != null ? operator(this._alpha, color.getAlpha()) : null); }; }, { }); }); var Gradient = Base.extend({ _class: 'Gradient', initialize: function Gradient(stops, radial) { this._id = UID.get(); if (stops && Base.isPlainObject(stops)) { this.set(stops); stops = radial = null; } if (this._stops == null) { this.setStops(stops || ['white', 'black']); } if (this._radial == null) { this.setRadial(typeof radial === 'string' && radial === 'radial' || radial || false); } }, _serialize: function(options, dictionary) { return dictionary.add(this, function() { return Base.serialize([this._stops, this._radial], options, true, dictionary); }); }, _changed: function() { for (var i = 0, l = this._owners && this._owners.length; i < l; i++) { this._owners[i]._changed(); } }, _addOwner: function(color) { if (!this._owners) this._owners = []; this._owners.push(color); }, _removeOwner: function(color) { var index = this._owners ? this._owners.indexOf(color) : -1; if (index != -1) { this._owners.splice(index, 1); if (!this._owners.length) this._owners = undefined; } }, clone: function() { var stops = []; for (var i = 0, l = this._stops.length; i < l; i++) { stops[i] = this._stops[i].clone(); } return new Gradient(stops, this._radial); }, getStops: function() { return this._stops; }, setStops: function(stops) { if (stops.length < 2) { throw new Error( 'Gradient stop list needs to contain at least two stops.'); } var _stops = this._stops; if (_stops) { for (var i = 0, l = _stops.length; i < l; i++) _stops[i]._owner = undefined; } _stops = this._stops = GradientStop.readList(stops, 0, { clone: true }); for (var i = 0, l = _stops.length; i < l; i++) _stops[i]._owner = this; this._changed(); }, getRadial: function() { return this._radial; }, setRadial: function(radial) { this._radial = radial; this._changed(); }, equals: function(gradient) { if (gradient === this) return true; if (gradient && this._class === gradient._class) { var stops1 = this._stops, stops2 = gradient._stops, length = stops1.length; if (length === stops2.length) { for (var i = 0; i < length; i++) { if (!stops1[i].equals(stops2[i])) return false; } return true; } } return false; } }); var GradientStop = Base.extend({ _class: 'GradientStop', initialize: function GradientStop(arg0, arg1) { var color = arg0, offset = arg1; if (typeof arg0 === 'object' && arg1 === undefined) { if (Array.isArray(arg0) && typeof arg0[0] !== 'number') { color = arg0[0]; offset = arg0[1]; } else if ('color' in arg0 || 'offset' in arg0 || 'rampPoint' in arg0) { color = arg0.color; offset = arg0.offset || arg0.rampPoint || 0; } } this.setColor(color); this.setOffset(offset); }, clone: function() { return new GradientStop(this._color.clone(), this._offset); }, _serialize: function(options, dictionary) { var color = this._color, offset = this._offset; return Base.serialize(offset == null ? [color] : [color, offset], options, true, dictionary); }, _changed: function() { if (this._owner) this._owner._changed(129); }, getOffset: function() { return this._offset; }, setOffset: function(offset) { this._offset = offset; this._changed(); }, getRampPoint: '#getOffset', setRampPoint: '#setOffset', getColor: function() { return this._color; }, setColor: function() { var color = Color.read(arguments, 0, { clone: true }); if (color) color._owner = this; this._color = color; this._changed(); }, equals: function(stop) { return stop === this || stop && this._class === stop._class && this._color.equals(stop._color) && this._offset == stop._offset || false; } }); var Style = Base.extend(new function() { var itemDefaults = { fillColor: null, fillRule: 'nonzero', strokeColor: null, strokeWidth: 1, strokeCap: 'butt', strokeJoin: 'miter', strokeScaling: true, miterLimit: 10, dashOffset: 0, dashArray: [], shadowColor: null, shadowBlur: 0, shadowOffset: new Point(), selectedColor: null }, groupDefaults = Base.set({}, itemDefaults, { fontFamily: 'sans-serif', fontWeight: 'normal', fontSize: 12, leading: null, justification: 'left' }), textDefaults = Base.set({}, groupDefaults, { fillColor: new Color() }), flags = { strokeWidth: 193, strokeCap: 193, strokeJoin: 193, strokeScaling: 201, miterLimit: 193, fontFamily: 9, fontWeight: 9, fontSize: 9, font: 9, leading: 9, justification: 9 }, item = { beans: true }, fields = { _class: 'Style', beans: true, initialize: function Style(style, _owner, _project) { this._values = {}; this._owner = _owner; this._project = _owner && _owner._project || _project || paper.project; this._defaults = !_owner || _owner instanceof Group ? groupDefaults : _owner instanceof TextItem ? textDefaults : itemDefaults; if (style) this.set(style); } }; Base.each(groupDefaults, function(value, key) { var isColor = /Color$/.test(key), isPoint = key === 'shadowOffset', part = Base.capitalize(key), flag = flags[key], set = 'set' + part, get = 'get' + part; fields[set] = function(value) { var owner = this._owner, children = owner && owner._children; if (children && children.length > 0 && !(owner instanceof CompoundPath)) { for (var i = 0, l = children.length; i < l; i++) children[i]._style[set](value); } else if (key in this._defaults) { var old = this._values[key]; if (old !== value) { if (isColor) { if (old && old._owner !== undefined) { old._owner = undefined; old._canvasStyle = null; } if (value && value.constructor === Color) { if (value._owner) value = value.clone(); value._owner = owner; } } this._values[key] = value; if (owner) owner._changed(flag || 129); } } }; fields[get] = function(_dontMerge) { var owner = this._owner, children = owner && owner._children, value; if (key in this._defaults && (!children || !children.length || _dontMerge || owner instanceof CompoundPath)) { var value = this._values[key]; if (value === undefined) { value = this._defaults[key]; if (value && value.clone) value = value.clone(); } else { var ctor = isColor ? Color : isPoint ? Point : null; if (ctor && !(value && value.constructor === ctor)) { this._values[key] = value = ctor.read([value], 0, { readNull: true, clone: true }); if (value && isColor) value._owner = owner; } } } else if (children) { for (var i = 0, l = children.length; i < l; i++) { var childValue = children[i]._style[get](); if (!i) { value = childValue; } else if (!Base.equals(value, childValue)) { return undefined; } } } return value; }; item[get] = function(_dontMerge) { return this._style[get](_dontMerge); }; item[set] = function(value) { this._style[set](value); }; }); Base.each({ Font: 'FontFamily', WindingRule: 'FillRule' }, function(value, key) { var get = 'get' + key, set = 'set' + key; fields[get] = item[get] = '#get' + value; fields[set] = item[set] = '#set' + value; }); Item.inject(item); return fields; }, { set: function(style) { var isStyle = style instanceof Style, values = isStyle ? style._values : style; if (values) { for (var key in values) { if (key in this._defaults) { var value = values[key]; this[key] = value && isStyle && value.clone ? value.clone() : value; } } } }, equals: function(style) { function compare(style1, style2, secondary) { var values1 = style1._values, values2 = style2._values, defaults2 = style2._defaults; for (var key in values1) { var value1 = values1[key], value2 = values2[key]; if (!(secondary && key in values2) && !Base.equals(value1, value2 === undefined ? defaults2[key] : value2)) return false; } return true; } return style === this || style && this._class === style._class && compare(this, style) && compare(style, this, true) || false; }, _dispose: function() { var color; color = this.getFillColor(); if (color) color._canvasStyle = null; color = this.getStrokeColor(); if (color) color._canvasStyle = null; color = this.getShadowColor(); if (color) color._canvasStyle = null; }, hasFill: function() { var color = this.getFillColor(); return !!color && color.alpha > 0; }, hasStroke: function() { var color = this.getStrokeColor(); return !!color && color.alpha > 0 && this.getStrokeWidth() > 0; }, hasShadow: function() { var color = this.getShadowColor(); return !!color && color.alpha > 0 && (this.getShadowBlur() > 0 || !this.getShadowOffset().isZero()); }, getView: function() { return this._project._view; }, getFontStyle: function() { var fontSize = this.getFontSize(); return this.getFontWeight() + ' ' + fontSize + (/[a-z]/i.test(fontSize + '') ? ' ' : 'px ') + this.getFontFamily(); }, getFont: '#getFontFamily', setFont: '#setFontFamily', getLeading: function getLeading() { var leading = getLeading.base.call(this), fontSize = this.getFontSize(); if (/pt|em|%|px/.test(fontSize)) fontSize = this.getView().getPixelSize(fontSize); return leading != null ? leading : fontSize * 1.2; } }); var DomElement = new function() { function handlePrefix(el, name, set, value) { var prefixes = ['', 'webkit', 'moz', 'Moz', 'ms', 'o'], suffix = name[0].toUpperCase() + name.substring(1); for (var i = 0; i < 6; i++) { var prefix = prefixes[i], key = prefix ? prefix + suffix : name; if (key in el) { if (set) { el[key] = value; } else { return el[key]; } break; } } } return { getStyles: function(el) { var doc = el && el.nodeType !== 9 ? el.ownerDocument : el, view = doc && doc.defaultView; return view && view.getComputedStyle(el, ''); }, getBounds: function(el, viewport) { var doc = el.ownerDocument, body = doc.body, html = doc.documentElement, rect; try { rect = el.getBoundingClientRect(); } catch (e) { rect = { left: 0, top: 0, width: 0, height: 0 }; } var x = rect.left - (html.clientLeft || body.clientLeft || 0), y = rect.top - (html.clientTop || body.clientTop || 0); if (!viewport) { var view = doc.defaultView; x += view.pageXOffset || html.scrollLeft || body.scrollLeft; y += view.pageYOffset || html.scrollTop || body.scrollTop; } return new Rectangle(x, y, rect.width, rect.height); }, getViewportBounds: function(el) { var doc = el.ownerDocument, view = doc.defaultView, html = doc.documentElement; return new Rectangle(0, 0, view.innerWidth || html.clientWidth, view.innerHeight || html.clientHeight ); }, getOffset: function(el, viewport) { return DomElement.getBounds(el, viewport).getPoint(); }, getSize: function(el) { return DomElement.getBounds(el, true).getSize(); }, isInvisible: function(el) { return DomElement.getSize(el).equals(new Size(0, 0)); }, isInView: function(el) { return !DomElement.isInvisible(el) && DomElement.getViewportBounds(el).intersects( DomElement.getBounds(el, true)); }, isInserted: function(el) { return document.body.contains(el); }, getPrefixed: function(el, name) { return el && handlePrefix(el, name); }, setPrefixed: function(el, name, value) { if (typeof name === 'object') { for (var key in name) handlePrefix(el, key, true, name[key]); } else { handlePrefix(el, name, true, value); } } }; }; var DomEvent = { add: function(el, events) { if (el) { for (var type in events) { var func = events[type], parts = type.split(/[\s,]+/g); for (var i = 0, l = parts.length; i < l; i++) { var name = parts[i]; var options = ( el === document && (name === 'touchstart' || name === 'touchmove') ) ? { passive: false } : false; el.addEventListener(name, func, options); } } } }, remove: function(el, events) { if (el) { for (var type in events) { var func = events[type], parts = type.split(/[\s,]+/g); for (var i = 0, l = parts.length; i < l; i++) el.removeEventListener(parts[i], func, false); } } }, getPoint: function(event) { var pos = event.targetTouches ? event.targetTouches.length ? event.targetTouches[0] : event.changedTouches[0] : event; return new Point( pos.pageX || pos.clientX + document.documentElement.scrollLeft, pos.pageY || pos.clientY + document.documentElement.scrollTop ); }, getTarget: function(event) { return event.target || event.srcElement; }, getRelatedTarget: function(event) { return event.relatedTarget || event.toElement; }, getOffset: function(event, target) { return DomEvent.getPoint(event).subtract(DomElement.getOffset( target || DomEvent.getTarget(event))); } }; DomEvent.requestAnimationFrame = new function() { var nativeRequest = DomElement.getPrefixed(window, 'requestAnimationFrame'), requested = false, callbacks = [], timer; function handleCallbacks() { var functions = callbacks; callbacks = []; for (var i = 0, l = functions.length; i < l; i++) functions[i](); requested = nativeRequest && callbacks.length; if (requested) nativeRequest(handleCallbacks); } return function(callback) { callbacks.push(callback); if (nativeRequest) { if (!requested) { nativeRequest(handleCallbacks); requested = true; } } else if (!timer) { timer = setInterval(handleCallbacks, 1000 / 60); } }; }; var View = Base.extend(Emitter, { _class: 'View', initialize: function View(project, element) { function getSize(name) { return element[name] || parseInt(element.getAttribute(name), 10); } function getCanvasSize() { var size = DomElement.getSize(element); return size.isNaN() || size.isZero() ? new Size(getSize('width'), getSize('height')) : size; } var size; if (window && element) { this._id = element.getAttribute('id'); if (this._id == null) element.setAttribute('id', this._id = 'view-' + View._id++); DomEvent.add(element, this._viewEvents); var none = 'none'; DomElement.setPrefixed(element.style, { userDrag: none, userSelect: none, touchCallout: none, contentZooming: none, tapHighlightColor: 'rgba(0,0,0,0)' }); if (PaperScope.hasAttribute(element, 'resize')) { var that = this; DomEvent.add(window, this._windowEvents = { resize: function() { that.setViewSize(getCanvasSize()); } }); } size = getCanvasSize(); if (PaperScope.hasAttribute(element, 'stats') && typeof Stats !== 'undefined') { this._stats = new Stats(); var stats = this._stats.domElement, style = stats.style, offset = DomElement.getOffset(element); style.position = 'absolute'; style.left = offset.x + 'px'; style.top = offset.y + 'px'; document.body.appendChild(stats); } } else { size = new Size(element); element = null; } this._project = project; this._scope = project._scope; this._element = element; if (!this._pixelRatio) this._pixelRatio = window && window.devicePixelRatio || 1; this._setElementSize(size.width, size.height); this._viewSize = size; View._views.push(this); View._viewsById[this._id] = this; (this._matrix = new Matrix())._owner = this; if (!View._focused) View._focused = this; this._frameItems = {}; this._frameItemCount = 0; this._itemEvents = { native: {}, virtual: {} }; this._autoUpdate = !paper.agent.node; this._needsUpdate = false; }, remove: function() { if (!this._project) return false; if (View._focused === this) View._focused = null; View._views.splice(View._views.indexOf(this), 1); delete View._viewsById[this._id]; var project = this._project; if (project._view === this) project._view = null; DomEvent.remove(this._element, this._viewEvents); DomEvent.remove(window, this._windowEvents); this._element = this._project = null; this.off('frame'); this._animate = false; this._frameItems = {}; return true; }, _events: Base.each( Item._itemHandlers.concat(['onResize', 'onKeyDown', 'onKeyUp']), function(name) { this[name] = {}; }, { onFrame: { install: function() { this.play(); }, uninstall: function() { this.pause(); } } } ), _animate: false, _time: 0, _count: 0, getAutoUpdate: function() { return this._autoUpdate; }, setAutoUpdate: function(autoUpdate) { this._autoUpdate = autoUpdate; if (autoUpdate) this.requestUpdate(); }, update: function() { }, draw: function() { this.update(); }, requestUpdate: function() { if (!this._requested) { var that = this; DomEvent.requestAnimationFrame(function() { that._requested = false; if (that._animate) { that.requestUpdate(); var element = that._element; if ((!DomElement.getPrefixed(document, 'hidden') || PaperScope.getAttribute(element, 'keepalive') === 'true') && DomElement.isInView(element)) { that._handleFrame(); } } if (that._autoUpdate) that.update(); }); this._requested = true; } }, play: function() { this._animate = true; this.requestUpdate(); }, pause: function() { this._animate = false; }, _handleFrame: function() { paper = this._scope; var now = Date.now() / 1000, delta = this._last ? now - this._last : 0; this._last = now; this.emit('frame', new Base({ delta: delta, time: this._time += delta, count: this._count++ })); if (this._stats) this._stats.update(); }, _animateItem: function(item, animate) { var items = this._frameItems; if (animate) { items[item._id] = { item: item, time: 0, count: 0 }; if (++this._frameItemCount === 1) this.on('frame', this._handleFrameItems); } else { delete items[item._id]; if (--this._frameItemCount === 0) { this.off('frame', this._handleFrameItems); } } }, _handleFrameItems: function(event) { for (var i in this._frameItems) { var entry = this._frameItems[i]; entry.item.emit('frame', new Base(event, { time: entry.time += event.delta, count: entry.count++ })); } }, _changed: function() { this._project._changed(4097); this._bounds = this._decomposed = undefined; }, getElement: function() { return this._element; }, getPixelRatio: function() { return this._pixelRatio; }, getResolution: function() { return this._pixelRatio * 72; }, getViewSize: function() { var size = this._viewSize; return new LinkedSize(size.width, size.height, this, 'setViewSize'); }, setViewSize: function() { var size = Size.read(arguments), delta = size.subtract(this._viewSize); if (delta.isZero()) return; this._setElementSize(size.width, size.height); this._viewSize.set(size); this._changed(); this.emit('resize', { size: size, delta: delta }); if (this._autoUpdate) { this.update(); } }, _setElementSize: function(width, height) { var element = this._element; if (element) { if (element.width !== width) element.width = width; if (element.height !== height) element.height = height; } }, getBounds: function() { if (!this._bounds) this._bounds = this._matrix.inverted()._transformBounds( new Rectangle(new Point(), this._viewSize)); return this._bounds; }, getSize: function() { return this.getBounds().getSize(); }, isVisible: function() { return DomElement.isInView(this._element); }, isInserted: function() { return DomElement.isInserted(this._element); }, getPixelSize: function(size) { var element = this._element, pixels; if (element) { var parent = element.parentNode, temp = document.createElement('div'); temp.style.fontSize = size; parent.appendChild(temp); pixels = parseFloat(DomElement.getStyles(temp).fontSize); parent.removeChild(temp); } else { pixels = parseFloat(pixels); } return pixels; }, getTextWidth: function(font, lines) { return 0; } }, Base.each(['rotate', 'scale', 'shear', 'skew'], function(key) { var rotate = key === 'rotate'; this[key] = function() { var value = (rotate ? Base : Point).read(arguments), center = Point.read(arguments, 0, { readNull: true }); return this.transform(new Matrix()[key](value, center || this.getCenter(true))); }; }, { _decompose: function() { return this._decomposed || (this._decomposed = this._matrix.decompose()); }, translate: function() { var mx = new Matrix(); return this.transform(mx.translate.apply(mx, arguments)); }, getCenter: function() { return this.getBounds().getCenter(); }, setCenter: function() { var center = Point.read(arguments); this.translate(this.getCenter().subtract(center)); }, getZoom: function() { var scaling = this._decompose().scaling; return (scaling.x + scaling.y) / 2; }, setZoom: function(zoom) { this.transform(new Matrix().scale(zoom / this.getZoom(), this.getCenter())); }, getRotation: function() { return this._decompose().rotation; }, setRotation: function(rotation) { var current = this.getRotation(); if (current != null && rotation != null) { this.rotate(rotation - current); } }, getScaling: function() { var scaling = this._decompose().scaling; return new LinkedPoint(scaling.x, scaling.y, this, 'setScaling'); }, setScaling: function() { var current = this.getScaling(), scaling = Point.read(arguments, 0, { clone: true, readNull: true }); if (current && scaling) { this.scale(scaling.x / current.x, scaling.y / current.y); } }, getMatrix: function() { return this._matrix; }, setMatrix: function() { var matrix = this._matrix; matrix.initialize.apply(matrix, arguments); }, transform: function(matrix) { this._matrix.append(matrix); }, scrollBy: function() { this.translate(Point.read(arguments).negate()); } }), { projectToView: function() { return this._matrix._transformPoint(Point.read(arguments)); }, viewToProject: function() { return this._matrix._inverseTransform(Point.read(arguments)); }, getEventPoint: function(event) { return this.viewToProject(DomEvent.getOffset(event, this._element)); }, }, { statics: { _views: [], _viewsById: {}, _id: 0, create: function(project, element) { if (document && typeof element === 'string') element = document.getElementById(element); var ctor = window ? CanvasView : View; return new ctor(project, element); } } }, new function() { if (!window) return; var prevFocus, tempFocus, dragging = false, mouseDown = false; function getView(event) { var target = DomEvent.getTarget(event); return target.getAttribute && View._viewsById[ target.getAttribute('id')]; } function updateFocus() { var view = View._focused; if (!view || !view.isVisible()) { for (var i = 0, l = View._views.length; i < l; i++) { if ((view = View._views[i]).isVisible()) { View._focused = tempFocus = view; break; } } } } function handleMouseMove(view, event, point) { view._handleMouseEvent('mousemove', event, point); } var navigator = window.navigator, mousedown, mousemove, mouseup; if (navigator.pointerEnabled || navigator.msPointerEnabled) { mousedown = 'pointerdown MSPointerDown'; mousemove = 'pointermove MSPointerMove'; mouseup = 'pointerup pointercancel MSPointerUp MSPointerCancel'; } else { mousedown = 'touchstart'; mousemove = 'touchmove'; mouseup = 'touchend touchcancel'; if (!('ontouchstart' in window && navigator.userAgent.match( /mobile|tablet|ip(ad|hone|od)|android|silk/i))) { mousedown += ' mousedown'; mousemove += ' mousemove'; mouseup += ' mouseup'; } } var viewEvents = {}, docEvents = { mouseout: function(event) { var view = View._focused, target = DomEvent.getRelatedTarget(event); if (view && (!target || target.nodeName === 'HTML')) { var offset = DomEvent.getOffset(event, view._element), x = offset.x, abs = Math.abs, ax = abs(x), max = 1 << 25, diff = ax - max; offset.x = abs(diff) < ax ? diff * (x < 0 ? -1 : 1) : x; handleMouseMove(view, event, view.viewToProject(offset)); } }, scroll: updateFocus }; viewEvents[mousedown] = function(event) { var view = View._focused = getView(event); if (!dragging) { dragging = true; view._handleMouseEvent('mousedown', event); } }; docEvents[mousemove] = function(event) { var view = View._focused; if (!mouseDown) { var target = getView(event); if (target) { if (view !== target) { if (view) handleMouseMove(view, event); if (!prevFocus) prevFocus = view; view = View._focused = tempFocus = target; } } else if (tempFocus && tempFocus === view) { if (prevFocus && !prevFocus.isInserted()) prevFocus = null; view = View._focused = prevFocus; prevFocus = null; updateFocus(); } } if (view) handleMouseMove(view, event); }; docEvents[mousedown] = function() { mouseDown = true; }; docEvents[mouseup] = function(event) { var view = View._focused; if (view && dragging) view._handleMouseEvent('mouseup', event); mouseDown = dragging = false; }; DomEvent.add(document, docEvents); DomEvent.add(window, { load: updateFocus }); var called = false, prevented = false, fallbacks = { doubleclick: 'click', mousedrag: 'mousemove' }, wasInView = false, overView, downPoint, lastPoint, downItem, overItem, dragItem, clickItem, clickTime, dblClick; function emitMouseEvent(obj, target, type, event, point, prevPoint, stopItem) { var stopped = false, mouseEvent; function emit(obj, type) { if (obj.responds(type)) { if (!mouseEvent) { mouseEvent = new MouseEvent(type, event, point, target || obj, prevPoint ? point.subtract(prevPoint) : null); } if (obj.emit(type, mouseEvent)) { called = true; if (mouseEvent.prevented) prevented = true; if (mouseEvent.stopped) return stopped = true; } } else { var fallback = fallbacks[type]; if (fallback) return emit(obj, fallback); } } while (obj && obj !== stopItem) { if (emit(obj, type)) break; obj = obj._parent; } return stopped; } function emitMouseEvents(view, hitItem, type, event, point, prevPoint) { view._project.removeOn(type); prevented = called = false; return (dragItem && emitMouseEvent(dragItem, null, type, event, point, prevPoint) || hitItem && hitItem !== dragItem && !hitItem.isDescendant(dragItem) && emitMouseEvent(hitItem, null, type === 'mousedrag' ? 'mousemove' : type, event, point, prevPoint, dragItem) || emitMouseEvent(view, dragItem || hitItem || view, type, event, point, prevPoint)); } var itemEventsMap = { mousedown: { mousedown: 1, mousedrag: 1, click: 1, doubleclick: 1 }, mouseup: { mouseup: 1, mousedrag: 1, click: 1, doubleclick: 1 }, mousemove: { mousedrag: 1, mousemove: 1, mouseenter: 1, mouseleave: 1 } }; return { _viewEvents: viewEvents, _handleMouseEvent: function(type, event, point) { var itemEvents = this._itemEvents, hitItems = itemEvents.native[type], nativeMove = type === 'mousemove', tool = this._scope.tool, view = this; function responds(type) { return itemEvents.virtual[type] || view.responds(type) || tool && tool.responds(type); } if (nativeMove && dragging && responds('mousedrag')) type = 'mousedrag'; if (!point) point = this.getEventPoint(event); var inView = this.getBounds().contains(point), hit = hitItems && inView && view._project.hitTest(point, { tolerance: 0, fill: true, stroke: true }), hitItem = hit && hit.item || null, handle = false, mouse = {}; mouse[type.substr(5)] = true; if (hitItems && hitItem !== overItem) { if (overItem) { emitMouseEvent(overItem, null, 'mouseleave', event, point); } if (hitItem) { emitMouseEvent(hitItem, null, 'mouseenter', event, point); } overItem = hitItem; } if (wasInView ^ inView) { emitMouseEvent(this, null, inView ? 'mouseenter' : 'mouseleave', event, point); overView = inView ? this : null; handle = true; } if ((inView || mouse.drag) && !point.equals(lastPoint)) { emitMouseEvents(this, hitItem, nativeMove ? type : 'mousemove', event, point, lastPoint); handle = true; } wasInView = inView; if (mouse.down && inView || mouse.up && downPoint) { emitMouseEvents(this, hitItem, type, event, point, downPoint); if (mouse.down) { dblClick = hitItem === clickItem && (Date.now() - clickTime < 300); downItem = clickItem = hitItem; if (!prevented && hitItem) { var item = hitItem; while (item && !item.responds('mousedrag')) item = item._parent; if (item) dragItem = hitItem; } downPoint = point; } else if (mouse.up) { if (!prevented && hitItem === downItem) { clickTime = Date.now(); emitMouseEvents(this, hitItem, dblClick ? 'doubleclick' : 'click', event, point, downPoint); dblClick = false; } downItem = dragItem = null; } wasInView = false; handle = true; } lastPoint = point; if (handle && tool) { called = tool._handleMouseEvent(type, event, point, mouse) || called; } if ( event.cancelable !== false && (called && !mouse.move || mouse.down && responds('mouseup')) ) { event.preventDefault(); } }, _handleKeyEvent: function(type, event, key, character) { var scope = this._scope, tool = scope.tool, keyEvent; function emit(obj) { if (obj.responds(type)) { paper = scope; obj.emit(type, keyEvent = keyEvent || new KeyEvent(type, event, key, character)); } } if (this.isVisible()) { emit(this); if (tool && tool.responds(type)) emit(tool); } }, _countItemEvent: function(type, sign) { var itemEvents = this._itemEvents, native = itemEvents.native, virtual = itemEvents.virtual; for (var key in itemEventsMap) { native[key] = (native[key] || 0) + (itemEventsMap[key][type] || 0) * sign; } virtual[type] = (virtual[type] || 0) + sign; }, statics: { updateFocus: updateFocus, _resetState: function() { dragging = mouseDown = called = wasInView = false; prevFocus = tempFocus = overView = downPoint = lastPoint = downItem = overItem = dragItem = clickItem = clickTime = dblClick = null; } } }; }); var CanvasView = View.extend({ _class: 'CanvasView', initialize: function CanvasView(project, canvas) { if (!(canvas instanceof window.HTMLCanvasElement)) { var size = Size.read(arguments, 1); if (size.isZero()) throw new Error( 'Cannot create CanvasView with the provided argument: ' + Base.slice(arguments, 1)); canvas = CanvasProvider.getCanvas(size); } var ctx = this._context = canvas.getContext('2d'); ctx.save(); this._pixelRatio = 1; if (!/^off|false$/.test(PaperScope.getAttribute(canvas, 'hidpi'))) { var deviceRatio = window.devicePixelRatio || 1, backingStoreRatio = DomElement.getPrefixed(ctx, 'backingStorePixelRatio') || 1; this._pixelRatio = deviceRatio / backingStoreRatio; } View.call(this, project, canvas); this._needsUpdate = true; }, remove: function remove() { this._context.restore(); return remove.base.call(this); }, _setElementSize: function _setElementSize(width, height) { var pixelRatio = this._pixelRatio; _setElementSize.base.call(this, width * pixelRatio, height * pixelRatio); if (pixelRatio !== 1) { var element = this._element, ctx = this._context; if (!PaperScope.hasAttribute(element, 'resize')) { var style = element.style; style.width = width + 'px'; style.height = height + 'px'; } ctx.restore(); ctx.save(); ctx.scale(pixelRatio, pixelRatio); } }, getPixelSize: function getPixelSize(size) { var agent = paper.agent, pixels; if (agent && agent.firefox) { pixels = getPixelSize.base.call(this, size); } else { var ctx = this._context, prevFont = ctx.font; ctx.font = size + ' serif'; pixels = parseFloat(ctx.font); ctx.font = prevFont; } return pixels; }, getTextWidth: function(font, lines) { var ctx = this._context, prevFont = ctx.font, width = 0; ctx.font = font; for (var i = 0, l = lines.length; i < l; i++) width = Math.max(width, ctx.measureText(lines[i]).width); ctx.font = prevFont; return width; }, update: function() { if (!this._needsUpdate) return false; var project = this._project, ctx = this._context, size = this._viewSize; ctx.clearRect(0, 0, size.width + 1, size.height + 1); if (project) project.draw(ctx, this._matrix, this._pixelRatio); this._needsUpdate = false; return true; } }); var Event = Base.extend({ _class: 'Event', initialize: function Event(event) { this.event = event; this.type = event && event.type; }, prevented: false, stopped: false, preventDefault: function() { this.prevented = true; this.event.preventDefault(); }, stopPropagation: function() { this.stopped = true; this.event.stopPropagation(); }, stop: function() { this.stopPropagation(); this.preventDefault(); }, getTimeStamp: function() { return this.event.timeStamp; }, getModifiers: function() { return Key.modifiers; } }); var KeyEvent = Event.extend({ _class: 'KeyEvent', initialize: function KeyEvent(type, event, key, character) { this.type = type; this.event = event; this.key = key; this.character = character; }, toString: function() { return "{ type: '" + this.type + "', key: '" + this.key + "', character: '" + this.character + "', modifiers: " + this.getModifiers() + " }"; } }); var Key = new function() { var keyLookup = { '\t': 'tab', ' ': 'space', '\b': 'backspace', '\x7f': 'delete', 'Spacebar': 'space', 'Del': 'delete', 'Win': 'meta', 'Esc': 'escape' }, charLookup = { 'tab': '\t', 'space': ' ', 'enter': '\r' }, keyMap = {}, charMap = {}, metaFixMap, downKey, modifiers = new Base({ shift: false, control: false, alt: false, meta: false, capsLock: false, space: false }).inject({ option: { get: function() { return this.alt; } }, command: { get: function() { var agent = paper && paper.agent; return agent && agent.mac ? this.meta : this.control; } } }); function getKey(event) { var key = event.key || event.keyIdentifier; key = /^U\+/.test(key) ? String.fromCharCode(parseInt(key.substr(2), 16)) : /^Arrow[A-Z]/.test(key) ? key.substr(5) : key === 'Unidentified' || key === undefined ? String.fromCharCode(event.keyCode) : key; return keyLookup[key] || (key.length > 1 ? Base.hyphenate(key) : key.toLowerCase()); } function handleKey(down, key, character, event) { var type = down ? 'keydown' : 'keyup', view = View._focused, name; keyMap[key] = down; if (down) { charMap[key] = character; } else { delete charMap[key]; } if (key.length > 1 && (name = Base.camelize(key)) in modifiers) { modifiers[name] = down; var agent = paper && paper.agent; if (name === 'meta' && agent && agent.mac) { if (down) { metaFixMap = {}; } else { for (var k in metaFixMap) { if (k in charMap) handleKey(false, k, metaFixMap[k], event); } metaFixMap = null; } } } else if (down && metaFixMap) { metaFixMap[key] = character; } if (view) { view._handleKeyEvent(down ? 'keydown' : 'keyup', event, key, character); } } DomEvent.add(document, { keydown: function(event) { var key = getKey(event), agent = paper && paper.agent; if (key.length > 1 || agent && (agent.chrome && (event.altKey || agent.mac && event.metaKey || !agent.mac && event.ctrlKey))) { handleKey(true, key, charLookup[key] || (key.length > 1 ? '' : key), event); } else { downKey = key; } }, keypress: function(event) { if (downKey) { var key = getKey(event), code = event.charCode, character = code >= 32 ? String.fromCharCode(code) : key.length > 1 ? '' : key; if (key !== downKey) { key = character.toLowerCase(); } handleKey(true, key, character, event); downKey = null; } }, keyup: function(event) { var key = getKey(event); if (key in charMap) handleKey(false, key, charMap[key], event); } }); DomEvent.add(window, { blur: function(event) { for (var key in charMap) handleKey(false, key, charMap[key], event); } }); return { modifiers: modifiers, isDown: function(key) { return !!keyMap[key]; } }; }; var MouseEvent = Event.extend({ _class: 'MouseEvent', initialize: function MouseEvent(type, event, point, target, delta) { this.type = type; this.event = event; this.point = point; this.target = target; this.delta = delta; }, toString: function() { return "{ type: '" + this.type + "', point: " + this.point + ', target: ' + this.target + (this.delta ? ', delta: ' + this.delta : '') + ', modifiers: ' + this.getModifiers() + ' }'; } }); var ToolEvent = Event.extend({ _class: 'ToolEvent', _item: null, initialize: function ToolEvent(tool, type, event) { this.tool = tool; this.type = type; this.event = event; }, _choosePoint: function(point, toolPoint) { return point ? point : toolPoint ? toolPoint.clone() : null; }, getPoint: function() { return this._choosePoint(this._point, this.tool._point); }, setPoint: function(point) { this._point = point; }, getLastPoint: function() { return this._choosePoint(this._lastPoint, this.tool._lastPoint); }, setLastPoint: function(lastPoint) { this._lastPoint = lastPoint; }, getDownPoint: function() { return this._choosePoint(this._downPoint, this.tool._downPoint); }, setDownPoint: function(downPoint) { this._downPoint = downPoint; }, getMiddlePoint: function() { if (!this._middlePoint && this.tool._lastPoint) { return this.tool._point.add(this.tool._lastPoint).divide(2); } return this._middlePoint; }, setMiddlePoint: function(middlePoint) { this._middlePoint = middlePoint; }, getDelta: function() { return !this._delta && this.tool._lastPoint ? this.tool._point.subtract(this.tool._lastPoint) : this._delta; }, setDelta: function(delta) { this._delta = delta; }, getCount: function() { return this.tool[/^mouse(down|up)$/.test(this.type) ? '_downCount' : '_moveCount']; }, setCount: function(count) { this.tool[/^mouse(down|up)$/.test(this.type) ? 'downCount' : 'count'] = count; }, getItem: function() { if (!this._item) { var result = this.tool._scope.project.hitTest(this.getPoint()); if (result) { var item = result.item, parent = item._parent; while (/^(Group|CompoundPath)$/.test(parent._class)) { item = parent; parent = parent._parent; } this._item = item; } } return this._item; }, setItem: function(item) { this._item = item; }, toString: function() { return '{ type: ' + this.type + ', point: ' + this.getPoint() + ', count: ' + this.getCount() + ', modifiers: ' + this.getModifiers() + ' }'; } }); var Tool = PaperScopeItem.extend({ _class: 'Tool', _list: 'tools', _reference: 'tool', _events: ['onMouseDown', 'onMouseUp', 'onMouseDrag', 'onMouseMove', 'onActivate', 'onDeactivate', 'onEditOptions', 'onKeyDown', 'onKeyUp'], initialize: function Tool(props) { PaperScopeItem.call(this); this._moveCount = -1; this._downCount = -1; this.set(props); }, getMinDistance: function() { return this._minDistance; }, setMinDistance: function(minDistance) { this._minDistance = minDistance; if (minDistance != null && this._maxDistance != null && minDistance > this._maxDistance) { this._maxDistance = minDistance; } }, getMaxDistance: function() { return this._maxDistance; }, setMaxDistance: function(maxDistance) { this._maxDistance = maxDistance; if (this._minDistance != null && maxDistance != null && maxDistance < this._minDistance) { this._minDistance = maxDistance; } }, getFixedDistance: function() { return this._minDistance == this._maxDistance ? this._minDistance : null; }, setFixedDistance: function(distance) { this._minDistance = this._maxDistance = distance; }, _handleMouseEvent: function(type, event, point, mouse) { paper = this._scope; if (mouse.drag && !this.responds(type)) type = 'mousemove'; var move = mouse.move || mouse.drag, responds = this.responds(type), minDistance = this.minDistance, maxDistance = this.maxDistance, called = false, tool = this; function update(minDistance, maxDistance) { var pt = point, toolPoint = move ? tool._point : (tool._downPoint || pt); if (move) { if (tool._moveCount >= 0 && pt.equals(toolPoint)) { return false; } if (toolPoint && (minDistance != null || maxDistance != null)) { var vector = pt.subtract(toolPoint), distance = vector.getLength(); if (distance < (minDistance || 0)) return false; if (maxDistance) { pt = toolPoint.add(vector.normalize( Math.min(distance, maxDistance))); } } tool._moveCount++; } tool._point = pt; tool._lastPoint = toolPoint || pt; if (mouse.down) { tool._moveCount = -1; tool._downPoint = pt; tool._downCount++; } return true; } function emit() { if (responds) { called = tool.emit(type, new ToolEvent(tool, type, event)) || called; } } if (mouse.down) { update(); emit(); } else if (mouse.up) { update(null, maxDistance); emit(); } else if (responds) { while (update(minDistance, maxDistance)) emit(); } return called; } }); var Http = { request: function(options) { var xhr = new self.XMLHttpRequest(); xhr.open((options.method || 'get').toUpperCase(), options.url, Base.pick(options.async, true)); if (options.mimeType) xhr.overrideMimeType(options.mimeType); xhr.onload = function() { var status = xhr.status; if (status === 0 || status === 200) { if (options.onLoad) { options.onLoad.call(xhr, xhr.responseText); } } else { xhr.onerror(); } }; xhr.onerror = function() { var status = xhr.status, message = 'Could not load "' + options.url + '" (Status: ' + status + ')'; if (options.onError) { options.onError(message, status); } else { throw new Error(message); } }; return xhr.send(null); } }; var CanvasProvider = { canvases: [], getCanvas: function(width, height) { if (!window) return null; var canvas, clear = true; if (typeof width === 'object') { height = width.height; width = width.width; } if (this.canvases.length) { canvas = this.canvases.pop(); } else { canvas = document.createElement('canvas'); clear = false; } var ctx = canvas.getContext('2d'); if (!ctx) { throw new Error('Canvas ' + canvas + ' is unable to provide a 2D context.'); } if (canvas.width === width && canvas.height === height) { if (clear) ctx.clearRect(0, 0, width + 1, height + 1); } else { canvas.width = width; canvas.height = height; } ctx.save(); return canvas; }, getContext: function(width, height) { var canvas = this.getCanvas(width, height); return canvas ? canvas.getContext('2d') : null; }, release: function(obj) { var canvas = obj && obj.canvas ? obj.canvas : obj; if (canvas && canvas.getContext) { canvas.getContext('2d').restore(); this.canvases.push(canvas); } } }; var BlendMode = new function() { var min = Math.min, max = Math.max, abs = Math.abs, sr, sg, sb, sa, br, bg, bb, ba, dr, dg, db; function getLum(r, g, b) { return 0.2989 * r + 0.587 * g + 0.114 * b; } function setLum(r, g, b, l) { var d = l - getLum(r, g, b); dr = r + d; dg = g + d; db = b + d; var l = getLum(dr, dg, db), mn = min(dr, dg, db), mx = max(dr, dg, db); if (mn < 0) { var lmn = l - mn; dr = l + (dr - l) * l / lmn; dg = l + (dg - l) * l / lmn; db = l + (db - l) * l / lmn; } if (mx > 255) { var ln = 255 - l, mxl = mx - l; dr = l + (dr - l) * ln / mxl; dg = l + (dg - l) * ln / mxl; db = l + (db - l) * ln / mxl; } } function getSat(r, g, b) { return max(r, g, b) - min(r, g, b); } function setSat(r, g, b, s) { var col = [r, g, b], mx = max(r, g, b), mn = min(r, g, b), md; mn = mn === r ? 0 : mn === g ? 1 : 2; mx = mx === r ? 0 : mx === g ? 1 : 2; md = min(mn, mx) === 0 ? max(mn, mx) === 1 ? 2 : 1 : 0; if (col[mx] > col[mn]) { col[md] = (col[md] - col[mn]) * s / (col[mx] - col[mn]); col[mx] = s; } else { col[md] = col[mx] = 0; } col[mn] = 0; dr = col[0]; dg = col[1]; db = col[2]; } var modes = { multiply: function() { dr = br * sr / 255; dg = bg * sg / 255; db = bb * sb / 255; }, screen: function() { dr = br + sr - (br * sr / 255); dg = bg + sg - (bg * sg / 255); db = bb + sb - (bb * sb / 255); }, overlay: function() { dr = br < 128 ? 2 * br * sr / 255 : 255 - 2 * (255 - br) * (255 - sr) / 255; dg = bg < 128 ? 2 * bg * sg / 255 : 255 - 2 * (255 - bg) * (255 - sg) / 255; db = bb < 128 ? 2 * bb * sb / 255 : 255 - 2 * (255 - bb) * (255 - sb) / 255; }, 'soft-light': function() { var t = sr * br / 255; dr = t + br * (255 - (255 - br) * (255 - sr) / 255 - t) / 255; t = sg * bg / 255; dg = t + bg * (255 - (255 - bg) * (255 - sg) / 255 - t) / 255; t = sb * bb / 255; db = t + bb * (255 - (255 - bb) * (255 - sb) / 255 - t) / 255; }, 'hard-light': function() { dr = sr < 128 ? 2 * sr * br / 255 : 255 - 2 * (255 - sr) * (255 - br) / 255; dg = sg < 128 ? 2 * sg * bg / 255 : 255 - 2 * (255 - sg) * (255 - bg) / 255; db = sb < 128 ? 2 * sb * bb / 255 : 255 - 2 * (255 - sb) * (255 - bb) / 255; }, 'color-dodge': function() { dr = br === 0 ? 0 : sr === 255 ? 255 : min(255, 255 * br / (255 - sr)); dg = bg === 0 ? 0 : sg === 255 ? 255 : min(255, 255 * bg / (255 - sg)); db = bb === 0 ? 0 : sb === 255 ? 255 : min(255, 255 * bb / (255 - sb)); }, 'color-burn': function() { dr = br === 255 ? 255 : sr === 0 ? 0 : max(0, 255 - (255 - br) * 255 / sr); dg = bg === 255 ? 255 : sg === 0 ? 0 : max(0, 255 - (255 - bg) * 255 / sg); db = bb === 255 ? 255 : sb === 0 ? 0 : max(0, 255 - (255 - bb) * 255 / sb); }, darken: function() { dr = br < sr ? br : sr; dg = bg < sg ? bg : sg; db = bb < sb ? bb : sb; }, lighten: function() { dr = br > sr ? br : sr; dg = bg > sg ? bg : sg; db = bb > sb ? bb : sb; }, difference: function() { dr = br - sr; if (dr < 0) dr = -dr; dg = bg - sg; if (dg < 0) dg = -dg; db = bb - sb; if (db < 0) db = -db; }, exclusion: function() { dr = br + sr * (255 - br - br) / 255; dg = bg + sg * (255 - bg - bg) / 255; db = bb + sb * (255 - bb - bb) / 255; }, hue: function() { setSat(sr, sg, sb, getSat(br, bg, bb)); setLum(dr, dg, db, getLum(br, bg, bb)); }, saturation: function() { setSat(br, bg, bb, getSat(sr, sg, sb)); setLum(dr, dg, db, getLum(br, bg, bb)); }, luminosity: function() { setLum(br, bg, bb, getLum(sr, sg, sb)); }, color: function() { setLum(sr, sg, sb, getLum(br, bg, bb)); }, add: function() { dr = min(br + sr, 255); dg = min(bg + sg, 255); db = min(bb + sb, 255); }, subtract: function() { dr = max(br - sr, 0); dg = max(bg - sg, 0); db = max(bb - sb, 0); }, average: function() { dr = (br + sr) / 2; dg = (bg + sg) / 2; db = (bb + sb) / 2; }, negation: function() { dr = 255 - abs(255 - sr - br); dg = 255 - abs(255 - sg - bg); db = 255 - abs(255 - sb - bb); } }; var nativeModes = this.nativeModes = Base.each([ 'source-over', 'source-in', 'source-out', 'source-atop', 'destination-over', 'destination-in', 'destination-out', 'destination-atop', 'lighter', 'darker', 'copy', 'xor' ], function(mode) { this[mode] = true; }, {}); var ctx = CanvasProvider.getContext(1, 1); if (ctx) { Base.each(modes, function(func, mode) { var darken = mode === 'darken', ok = false; ctx.save(); try { ctx.fillStyle = darken ? '#300' : '#a00'; ctx.fillRect(0, 0, 1, 1); ctx.globalCompositeOperation = mode; if (ctx.globalCompositeOperation === mode) { ctx.fillStyle = darken ? '#a00' : '#300'; ctx.fillRect(0, 0, 1, 1); ok = ctx.getImageData(0, 0, 1, 1).data[0] !== darken ? 170 : 51; } } catch (e) {} ctx.restore(); nativeModes[mode] = ok; }); CanvasProvider.release(ctx); } this.process = function(mode, srcContext, dstContext, alpha, offset) { var srcCanvas = srcContext.canvas, normal = mode === 'normal'; if (normal || nativeModes[mode]) { dstContext.save(); dstContext.setTransform(1, 0, 0, 1, 0, 0); dstContext.globalAlpha = alpha; if (!normal) dstContext.globalCompositeOperation = mode; dstContext.drawImage(srcCanvas, offset.x, offset.y); dstContext.restore(); } else { var process = modes[mode]; if (!process) return; var dstData = dstContext.getImageData(offset.x, offset.y, srcCanvas.width, srcCanvas.height), dst = dstData.data, src = srcContext.getImageData(0, 0, srcCanvas.width, srcCanvas.height).data; for (var i = 0, l = dst.length; i < l; i += 4) { sr = src[i]; br = dst[i]; sg = src[i + 1]; bg = dst[i + 1]; sb = src[i + 2]; bb = dst[i + 2]; sa = src[i + 3]; ba = dst[i + 3]; process(); var a1 = sa * alpha / 255, a2 = 1 - a1; dst[i] = a1 * dr + a2 * br; dst[i + 1] = a1 * dg + a2 * bg; dst[i + 2] = a1 * db + a2 * bb; dst[i + 3] = sa * alpha + a2 * ba; } dstContext.putImageData(dstData, offset.x, offset.y); } }; }; var SvgElement = new function() { var svg = 'http://www.w3.org/2000/svg', xmlns = 'http://www.w3.org/2000/xmlns', xlink = 'http://www.w3.org/1999/xlink', attributeNamespace = { href: xlink, xlink: xmlns, xmlns: xmlns + '/', 'xmlns:xlink': xmlns + '/' }; function create(tag, attributes, formatter) { return set(document.createElementNS(svg, tag), attributes, formatter); } function get(node, name) { var namespace = attributeNamespace[name], value = namespace ? node.getAttributeNS(namespace, name) : node.getAttribute(name); return value === 'null' ? null : value; } function set(node, attributes, formatter) { for (var name in attributes) { var value = attributes[name], namespace = attributeNamespace[name]; if (typeof value === 'number' && formatter) value = formatter.number(value); if (namespace) { node.setAttributeNS(namespace, name, value); } else { node.setAttribute(name, value); } } return node; } return { svg: svg, xmlns: xmlns, xlink: xlink, create: create, get: get, set: set }; }; var SvgStyles = Base.each({ fillColor: ['fill', 'color'], fillRule: ['fill-rule', 'string'], strokeColor: ['stroke', 'color'], strokeWidth: ['stroke-width', 'number'], strokeCap: ['stroke-linecap', 'string'], strokeJoin: ['stroke-linejoin', 'string'], strokeScaling: ['vector-effect', 'lookup', { true: 'none', false: 'non-scaling-stroke' }, function(item, value) { return !value && (item instanceof PathItem || item instanceof Shape || item instanceof TextItem); }], miterLimit: ['stroke-miterlimit', 'number'], dashArray: ['stroke-dasharray', 'array'], dashOffset: ['stroke-dashoffset', 'number'], fontFamily: ['font-family', 'string'], fontWeight: ['font-weight', 'string'], fontSize: ['font-size', 'number'], justification: ['text-anchor', 'lookup', { left: 'start', center: 'middle', right: 'end' }], opacity: ['opacity', 'number'], blendMode: ['mix-blend-mode', 'style'] }, function(entry, key) { var part = Base.capitalize(key), lookup = entry[2]; this[key] = { type: entry[1], property: key, attribute: entry[0], toSVG: lookup, fromSVG: lookup && Base.each(lookup, function(value, name) { this[value] = name; }, {}), exportFilter: entry[3], get: 'get' + part, set: 'set' + part }; }, {}); new function() { var formatter; function getTransform(matrix, coordinates, center) { var attrs = new Base(), trans = matrix.getTranslation(); if (coordinates) { matrix = matrix._shiftless(); var point = matrix._inverseTransform(trans); attrs[center ? 'cx' : 'x'] = point.x; attrs[center ? 'cy' : 'y'] = point.y; trans = null; } if (!matrix.isIdentity()) { var decomposed = matrix.decompose(); if (decomposed) { var parts = [], angle = decomposed.rotation, scale = decomposed.scaling, skew = decomposed.skewing; if (trans && !trans.isZero()) parts.push('translate(' + formatter.point(trans) + ')'); if (angle) parts.push('rotate(' + formatter.number(angle) + ')'); if (!Numerical.isZero(scale.x - 1) || !Numerical.isZero(scale.y - 1)) parts.push('scale(' + formatter.point(scale) +')'); if (skew.x) parts.push('skewX(' + formatter.number(skew.x) + ')'); if (skew.y) parts.push('skewY(' + formatter.number(skew.y) + ')'); attrs.transform = parts.join(' '); } else { attrs.transform = 'matrix(' + matrix.getValues().join(',') + ')'; } } return attrs; } function exportGroup(item, options) { var attrs = getTransform(item._matrix), children = item._children; var node = SvgElement.create('g', attrs, formatter); for (var i = 0, l = children.length; i < l; i++) { var child = children[i]; var childNode = exportSVG(child, options); if (childNode) { if (child.isClipMask()) { var clip = SvgElement.create('clipPath'); clip.appendChild(childNode); setDefinition(child, clip, 'clip'); SvgElement.set(node, { 'clip-path': 'url(#' + clip.id + ')' }); } else { node.appendChild(childNode); } } } return node; } function exportRaster(item, options) { var attrs = getTransform(item._matrix, true), size = item.getSize(), image = item.getImage(); attrs.x -= size.width / 2; attrs.y -= size.height / 2; attrs.width = size.width; attrs.height = size.height; attrs.href = options.embedImages == false && image && image.src || item.toDataURL(); return SvgElement.create('image', attrs, formatter); } function exportPath(item, options) { var matchShapes = options.matchShapes; if (matchShapes) { var shape = item.toShape(false); if (shape) return exportShape(shape, options); } var segments = item._segments, length = segments.length, type, attrs = getTransform(item._matrix); if (matchShapes && length >= 2 && !item.hasHandles()) { if (length > 2) { type = item._closed ? 'polygon' : 'polyline'; var parts = []; for (var i = 0; i < length; i++) { parts.push(formatter.point(segments[i]._point)); } attrs.points = parts.join(' '); } else { type = 'line'; var start = segments[0]._point, end = segments[1]._point; attrs.set({ x1: start.x, y1: start.y, x2: end.x, y2: end.y }); } } else { type = 'path'; attrs.d = item.getPathData(null, options.precision); } return SvgElement.create(type, attrs, formatter); } function exportShape(item) { var type = item._type, radius = item._radius, attrs = getTransform(item._matrix, true, type !== 'rectangle'); if (type === 'rectangle') { type = 'rect'; var size = item._size, width = size.width, height = size.height; attrs.x -= width / 2; attrs.y -= height / 2; attrs.width = width; attrs.height = height; if (radius.isZero()) radius = null; } if (radius) { if (type === 'circle') { attrs.r = radius; } else { attrs.rx = radius.width; attrs.ry = radius.height; } } return SvgElement.create(type, attrs, formatter); } function exportCompoundPath(item, options) { var attrs = getTransform(item._matrix); var data = item.getPathData(null, options.precision); if (data) attrs.d = data; return SvgElement.create('path', attrs, formatter); } function exportSymbolItem(item, options) { var attrs = getTransform(item._matrix, true), definition = item._definition, node = getDefinition(definition, 'symbol'), definitionItem = definition._item, bounds = definitionItem.getBounds(); if (!node) { node = SvgElement.create('symbol', { viewBox: formatter.rectangle(bounds) }); node.appendChild(exportSVG(definitionItem, options)); setDefinition(definition, node, 'symbol'); } attrs.href = '#' + node.id; attrs.x += bounds.x; attrs.y += bounds.y; attrs.width = bounds.width; attrs.height = bounds.height; attrs.overflow = 'visible'; return SvgElement.create('use', attrs, formatter); } function exportGradient(color, item) { var gradientNode = getDefinition(color, 'color'); if (!gradientNode) { var gradient = color.getGradient(), radial = gradient._radial, origin = color.getOrigin(), destination = color.getDestination(), attrs; if (radial) { attrs = { cx: origin.x, cy: origin.y, r: origin.getDistance(destination) }; var highlight = color.getHighlight(); if (highlight) { attrs.fx = highlight.x; attrs.fy = highlight.y; } } else { attrs = { x1: origin.x, y1: origin.y, x2: destination.x, y2: destination.y }; } if (item instanceof paper.PointText) { attrs.gradientTransform = getTransform( item._matrix.clone().invert(), false, formatter).transform; } attrs.gradientUnits = 'userSpaceOnUse'; gradientNode = SvgElement.create((radial ? 'radial' : 'linear') + 'Gradient', attrs, formatter); var stops = gradient._stops; for (var i = 0, l = stops.length; i < l; i++) { var stop = stops[i], stopColor = stop._color, alpha = stopColor.getAlpha(), offset = stop._offset; attrs = { offset: offset == null ? i / (l - 1) : offset }; if (stopColor) attrs['stop-color'] = stopColor.toCSS(true); if (alpha < 1) attrs['stop-opacity'] = alpha; gradientNode.appendChild( SvgElement.create('stop', attrs, formatter)); } setDefinition(color, gradientNode, 'color'); } return 'url(#' + gradientNode.id + ')'; } function exportText(item) { var node = SvgElement.create('text', getTransform(item._matrix, false), formatter); node.setAttribute('font-size', item.fontSize); node.setAttribute('xml:space', 'preserve'); for (var i = 0; i < item._lines.length; i++) { var tspanNode = SvgElement.create('tspan', { x: '0', dy: i === 0 ? '0' : item.getLeading() + 'px' }, formatter); tspanNode.textContent = item._lines[i] ? item._lines[i] : ' '; node.appendChild(tspanNode); } return node; } var exporters = { Group: exportGroup, Layer: exportGroup, Raster: exportRaster, Path: exportPath, Shape: exportShape, CompoundPath: exportCompoundPath, SymbolItem: exportSymbolItem, PointText: exportText }; function applyStyle(item, node, isRoot) { var attrs = {}, parent = !isRoot && item.getParent(), style = []; if (item._name != null) attrs.id = item._name; Base.each(SvgStyles, function(entry) { var get = entry.get, type = entry.type, value = item[get](); if (entry.exportFilter ? entry.exportFilter(item, value) : !parent || !Base.equals(parent[get](), value) || item instanceof paper.PointText) { if (type === 'color' && value != null) { var alpha = value.getAlpha(); if (alpha < 1) attrs[entry.attribute + '-opacity'] = alpha; } if (type === 'style') { style.push(entry.attribute + ': ' + value); } else { attrs[entry.attribute] = value == null ? 'none' : type === 'color' ? value.gradient ? exportGradient(value, item) : value.toCSS(true) : type === 'array' ? value.join(',') : type === 'lookup' ? entry.toSVG[value] : value; } } }); if (style.length) attrs.style = style.join(';'); if (attrs.opacity === 1) delete attrs.opacity; if (!item._visible) attrs.visibility = 'hidden'; return SvgElement.set(node, attrs, formatter); } var definitions; function getDefinition(item, type) { if (!definitions) definitions = { ids: {}, svgs: {} }; return item && definitions.svgs[type + '-' + (item._id || item.__id || (item.__id = UID.get('svg')))]; } function setDefinition(item, node, type) { if (!definitions) getDefinition(); var typeId = definitions.ids[type] = (definitions.ids[type] || 0) + 1; node.id = type + '-' + typeId; definitions.svgs[type + '-' + (item._id || item.__id)] = node; } function exportDefinitions(node, options) { var svg = node, defs = null; if (definitions) { svg = node.nodeName.toLowerCase() === 'svg' && node; for (var i in definitions.svgs) { if (!defs) { if (!svg) { svg = SvgElement.create('svg'); svg.appendChild(node); } defs = svg.insertBefore(SvgElement.create('defs'), svg.firstChild); } defs.appendChild(definitions.svgs[i]); } definitions = null; } return options.asString ? new self.XMLSerializer().serializeToString(svg) : svg; } function exportSVG(item, options, isRoot) { var exporter = exporters[item._class], node = exporter && exporter(item, options); if (node) { var onExport = options.onExport; if (onExport) node = onExport(item, node, options) || node; var data = JSON.stringify(item._data); if (data && data !== '{}' && data !== 'null') node.setAttribute('data-paper-data', data); } return node && applyStyle(item, node, isRoot); } function setOptions(options) { if (!options) options = {}; formatter = new Formatter(options.precision); return options; } Item.inject({ exportSVG: function(options) { options = setOptions(options); return exportDefinitions(exportSVG(this, options, true), options); } }); Project.inject({ exportSVG: function(options) { options = setOptions(options); var children = this._children, view = this.getView(), bounds = Base.pick(options.bounds, 'view'), mx = options.matrix || bounds === 'view' && view._matrix, matrix = mx && Matrix.read([mx]), rect = bounds === 'view' ? new Rectangle([0, 0], view.getViewSize()) : bounds === 'content' ? Item._getBounds(children, matrix, { stroke: true, drawnTextBounds: true }) .rect : Rectangle.read([bounds], 0, { readNull: true }), attrs = { version: '1.1', xmlns: SvgElement.svg, 'xmlns:xlink': SvgElement.xlink, }; if (rect) { attrs.width = rect.width; attrs.height = rect.height; if (rect.x || rect.y) attrs.viewBox = formatter.rectangle(rect); } var node = SvgElement.create('svg', attrs, formatter), parent = node; if (matrix && !matrix.isIdentity()) { parent = node.appendChild(SvgElement.create('g', getTransform(matrix), formatter)); } for (var i = 0, l = children.length; i < l; i++) { parent.appendChild(exportSVG(children[i], options, true)); } return exportDefinitions(node, options); } }); }; new function() { var definitions = {}, rootSize; function getValue(node, name, isString, allowNull, allowPercent) { var value = SvgElement.get(node, name), res = value == null ? allowNull ? null : isString ? '' : 0 : isString ? value : parseFloat(value); return /%\s*$/.test(value) ? (res / 100) * (allowPercent ? 1 : rootSize[/x|^width/.test(name) ? 'width' : 'height']) : res; } function getPoint(node, x, y, allowNull, allowPercent) { x = getValue(node, x || 'x', false, allowNull, allowPercent); y = getValue(node, y || 'y', false, allowNull, allowPercent); return allowNull && (x == null || y == null) ? null : new Point(x, y); } function getSize(node, w, h, allowNull, allowPercent) { w = getValue(node, w || 'width', false, allowNull, allowPercent); h = getValue(node, h || 'height', false, allowNull, allowPercent); return allowNull && (w == null || h == null) ? null : new Size(w, h); } function convertValue(value, type, lookup) { return value === 'none' ? null : type === 'number' ? parseFloat(value) : type === 'array' ? value ? value.split(/[\s,]+/g).map(parseFloat) : [] : type === 'color' ? getDefinition(value) || value : type === 'lookup' ? lookup[value] : value; } function importGroup(node, type, options, isRoot) { var nodes = node.childNodes, isClip = type === 'clippath', isDefs = type === 'defs', item = new Group(), project = item._project, currentStyle = project._currentStyle, children = []; if (!isClip && !isDefs) { item = applyAttributes(item, node, isRoot); project._currentStyle = item._style.clone(); } if (isRoot) { var defs = node.querySelectorAll('defs'); for (var i = 0, l = defs.length; i < l; i++) { importNode(defs[i], options, false); } } for (var i = 0, l = nodes.length; i < l; i++) { var childNode = nodes[i], child; if (childNode.nodeType === 1 && !/^defs$/i.test(childNode.nodeName) && (child = importNode(childNode, options, false)) && !(child instanceof SymbolDefinition)) children.push(child); } item.addChildren(children); if (isClip) item = applyAttributes(item.reduce(), node, isRoot); project._currentStyle = currentStyle; if (isClip || isDefs) { item.remove(); item = null; } return item; } function importPoly(node, type) { var coords = node.getAttribute('points').match( /[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g), points = []; for (var i = 0, l = coords.length; i < l; i += 2) points.push(new Point( parseFloat(coords[i]), parseFloat(coords[i + 1]))); var path = new Path(points); if (type === 'polygon') path.closePath(); return path; } function importPath(node) { return PathItem.create(node.getAttribute('d')); } function importGradient(node, type) { var id = (getValue(node, 'href', true) || '').substring(1), radial = type === 'radialgradient', gradient; if (id) { gradient = definitions[id].getGradient(); if (gradient._radial ^ radial) { gradient = gradient.clone(); gradient._radial = radial; } } else { var nodes = node.childNodes, stops = []; for (var i = 0, l = nodes.length; i < l; i++) { var child = nodes[i]; if (child.nodeType === 1) stops.push(applyAttributes(new GradientStop(), child)); } gradient = new Gradient(stops, radial); } var origin, destination, highlight, scaleToBounds = getValue(node, 'gradientUnits', true) !== 'userSpaceOnUse'; if (radial) { origin = getPoint(node, 'cx', 'cy', false, scaleToBounds); destination = origin.add( getValue(node, 'r', false, false, scaleToBounds), 0); highlight = getPoint(node, 'fx', 'fy', true, scaleToBounds); } else { origin = getPoint(node, 'x1', 'y1', false, scaleToBounds); destination = getPoint(node, 'x2', 'y2', false, scaleToBounds); } var color = applyAttributes( new Color(gradient, origin, destination, highlight), node); color._scaleToBounds = scaleToBounds; return null; } var importers = { '#document': function (node, type, options, isRoot) { var nodes = node.childNodes; for (var i = 0, l = nodes.length; i < l; i++) { var child = nodes[i]; if (child.nodeType === 1) return importNode(child, options, isRoot); } }, g: importGroup, svg: importGroup, clippath: importGroup, polygon: importPoly, polyline: importPoly, path: importPath, lineargradient: importGradient, radialgradient: importGradient, image: function (node) { var raster = new Raster(getValue(node, 'href', true)); raster.on('load', function() { var size = getSize(node); this.setSize(size); var center = getPoint(node).add(size.divide(2)); this._matrix.append(new Matrix().translate(center)); }); return raster; }, symbol: function(node, type, options, isRoot) { return new SymbolDefinition( importGroup(node, type, options, isRoot), true); }, defs: importGroup, use: function(node) { var id = (getValue(node, 'href', true) || '').substring(1), definition = definitions[id], point = getPoint(node); return definition ? definition instanceof SymbolDefinition ? definition.place(point) : definition.clone().translate(point) : null; }, circle: function(node) { return new Shape.Circle( getPoint(node, 'cx', 'cy'), getValue(node, 'r')); }, ellipse: function(node) { return new Shape.Ellipse({ center: getPoint(node, 'cx', 'cy'), radius: getSize(node, 'rx', 'ry') }); }, rect: function(node) { return new Shape.Rectangle(new Rectangle( getPoint(node), getSize(node) ), getSize(node, 'rx', 'ry')); }, line: function(node) { return new Path.Line( getPoint(node, 'x1', 'y1'), getPoint(node, 'x2', 'y2')); }, text: function(node) { var fontSize = parseFloat(node.getAttribute("font-size")); var alignmentBaseline = node.getAttribute("alignment-baseline"); if (node.childElementCount === 0) { var text = new PointText(); text.setContent(node.textContent.trim() || ''); text.translate(0, text._style.getLeading()); if (!isNaN(fontSize)) text.setFontSize(fontSize); return text; } else { var lines = []; var spacing = 1.2; for (var i = 0; i < node.childNodes.length; i++) { var child = node.childNodes[i]; lines.push(child.textContent); var dyString = child.getAttribute('dy'); if (dyString) { var dy = parseFloat(dyString); if (!isNaN(dy)) { if (dyString.endsWith('em')) { spacing = dy; } else if (dyString.endsWith('px') && !isNaN(fontSize)) { spacing = dy / fontSize; } } } } var text = new PointText(); if (!isNaN(fontSize)) text.setFontSize(fontSize); text.setLeading(text.fontSize * spacing); if (alignmentBaseline === 'text-before-edge') { text.setContent(' '); text.translate(0, text.bounds.height); } text.setContent(lines.join('\n')); return text; } } }; function applyTransform(item, value, name, node) { if (item.transform) { var transforms = (node.getAttribute(name) || '').split(/\)\s*/g), matrix = new Matrix(); for (var i = 0, l = transforms.length; i < l; i++) { var transform = transforms[i]; if (!transform) break; var parts = transform.split(/\(\s*/), command = parts[0], v = parts[1].split(/[\s,]+/g); for (var j = 0, m = v.length; j < m; j++) v[j] = parseFloat(v[j]); switch (command) { case 'matrix': matrix.append( new Matrix(v[0], v[1], v[2], v[3], v[4], v[5])); break; case 'rotate': matrix.rotate(v[0], v[1] || 0, v[2] || 0); break; case 'translate': matrix.translate(v[0], v[1] || 0); break; case 'scale': matrix.scale(v); break; case 'skewX': matrix.skew(v[0], 0); break; case 'skewY': matrix.skew(0, v[0]); break; } } item.transform(matrix); } } function applyOpacity(item, value, name) { var key = name === 'fill-opacity' ? 'getFillColor' : 'getStrokeColor', color = item[key] && item[key](); if (color) color.setAlpha(parseFloat(value)); } var attributes = Base.set(Base.each(SvgStyles, function(entry) { this[entry.attribute] = function(item, value) { if (item[entry.set]) { item[entry.set](convertValue(value, entry.type, entry.fromSVG)); if (entry.type === 'color') { var color = item[entry.get](); if (color) { if (color._scaleToBounds) { var bounds = item.getBounds(); color.transform(new Matrix() .translate(bounds.getPoint()) .scale(bounds.getSize())); } } } } }; }, {}), { id: function(item, value) { definitions[value] = item; if (item.setName) item.setName(value); }, 'clip-path': function(item, value) { var clip = getDefinition(value); if (clip) { clip = clip.clone(); clip.setClipMask(true); if (item instanceof Group) { item.insertChild(0, clip); } else { return new Group(clip, item); } } }, gradientTransform: applyTransform, transform: applyTransform, 'fill-opacity': applyOpacity, 'stroke-opacity': applyOpacity, visibility: function(item, value) { if (item.setVisible) item.setVisible(value === 'visible'); }, display: function(item, value) { if (item.setVisible) item.setVisible(value !== null); }, 'stop-color': function(item, value) { if (item.setColor) item.setColor(value); }, 'stop-opacity': function(item, value) { if (item._color) item._color.setAlpha(parseFloat(value)); }, offset: function(item, value) { if (item.setOffset) { var percent = value.match(/(.*)%$/); item.setOffset(percent ? percent[1] / 100 : parseFloat(value)); } }, viewBox: function(item, value, name, node, styles) { var rect = new Rectangle(convertValue(value, 'array')), size = getSize(node, null, null, true), group, matrix; if (item instanceof Group) { var scale = size ? size.divide(rect.getSize()) : 1, matrix = new Matrix().scale(scale) .translate(rect.getPoint().negate()); group = item; } else if (item instanceof SymbolDefinition) { if (size) rect.setSize(size); group = item._item; } if (group) { if (getAttribute(node, 'overflow', styles) !== 'visible') { var clip = new Shape.Rectangle(rect); clip.setClipMask(true); group.addChild(clip); } if (matrix) group.transform(matrix); } } }); function getAttribute(node, name, styles) { var attr = node.attributes[name], value = attr && attr.value; if (!value && node.style) { var style = Base.camelize(name); value = node.style[style]; if (!value && styles.node[style] !== styles.parent[style]) value = styles.node[style]; } return !value ? undefined : value === 'none' ? null : value; } function applyAttributes(item, node, isRoot) { var parent = node.parentNode, styles = { node: DomElement.getStyles(node) || {}, parent: !isRoot && !/^defs$/i.test(parent.tagName) && DomElement.getStyles(parent) || {} }; Base.each(attributes, function(apply, name) { var value = getAttribute(node, name, styles); item = value !== undefined && apply(item, value, name, node, styles) || item; }); return item; } function getDefinition(value) { var match = value && value.match(/\((?:["'#]*)([^"')]+)/), name = match && match[1], res = name && definitions[window ? name.replace(window.location.href.split('#')[0] + '#', '') : name]; if (res && res._scaleToBounds) { res = res.clone(); res._scaleToBounds = true; } return res; } function importNode(node, options, isRoot) { var type = node.nodeName.toLowerCase(), isElement = type !== '#document', body = document.body, container, parent, next; if (isRoot && isElement) { rootSize = paper.getView().getSize(); rootSize = getSize(node, null, null, true) || rootSize; container = SvgElement.create('svg', { style: 'stroke-width: 1px; stroke-miterlimit: 10' }); parent = node.parentNode; next = node.nextSibling; container.appendChild(node); body.appendChild(container); } var settings = paper.settings, applyMatrix = settings.applyMatrix, insertItems = settings.insertItems; settings.applyMatrix = false; settings.insertItems = false; var importer = importers[type], item = importer && importer(node, type, options, isRoot) || null; settings.insertItems = insertItems; settings.applyMatrix = applyMatrix; if (item) { if (isElement && !(item instanceof Group)) item = applyAttributes(item, node, isRoot); var onImport = options.onImport, data = isElement && node.getAttribute('data-paper-data'); if (onImport) item = onImport(node, item, options) || item; if (options.expandShapes && item instanceof Shape) { item.remove(); item = item.toPath(); } if (data) item._data = JSON.parse(data); } if (container) { body.removeChild(container); if (parent) { if (next) { parent.insertBefore(node, next); } else { parent.appendChild(node); } } } if (isRoot) { definitions = {}; if (item && Base.pick(options.applyMatrix, applyMatrix)) item.matrix.apply(true, true); } return item; } function importSVG(source, options, owner) { if (!source) return null; options = typeof options === 'function' ? { onLoad: options } : options || {}; var scope = paper, item = null; function onLoad(svg) { try { var node = typeof svg === 'object' ? svg : new self.DOMParser() .parseFromString(svg, 'image/svg+xml'); if (!node.nodeName) { node = null; throw new Error('Unsupported SVG source: ' + source); } paper = scope; item = importNode(node, options, true); if (!options || options.insert !== false) { owner._insertItem(undefined, item); } var onLoad = options.onLoad; if (onLoad) onLoad(item, svg); } catch (e) { onError(e); } } function onError(message, status) { var onError = options.onError; if (onError) { onError(message, status); } else { throw new Error(message); } } if (typeof source === 'string' && !/^.* 3) { cats.sort(function(a, b) {return b.length - a.length;}); f += "switch(str.length){"; for (var i = 0; i < cats.length; ++i) { var cat = cats[i]; f += "case " + cat[0].length + ":"; compareTo(cat); } f += "}"; } else { compareTo(words); } return new Function("str", f); } var isReservedWord3 = makePredicate("abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile"); var isReservedWord5 = makePredicate("class enum extends super const export import"); var isStrictReservedWord = makePredicate("implements interface let package private protected public static yield"); var isStrictBadIdWord = makePredicate("eval arguments"); var isKeyword = makePredicate("break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"); var nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/; var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; var nonASCIIidentifierChars = "\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u0620-\u0649\u0672-\u06d3\u06e7-\u06e8\u06fb-\u06fc\u0730-\u074a\u0800-\u0814\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0840-\u0857\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962-\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09d7\u09df-\u09e0\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2-\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b5f-\u0b60\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62-\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2-\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d46-\u0d48\u0d57\u0d62-\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e34-\u0e3a\u0e40-\u0e45\u0e50-\u0e59\u0eb4-\u0eb9\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f41-\u0f47\u0f71-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1029\u1040-\u1049\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u170e-\u1710\u1720-\u1730\u1740-\u1750\u1772\u1773\u1780-\u17b2\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1920-\u192b\u1930-\u193b\u1951-\u196d\u19b0-\u19c0\u19c8-\u19c9\u19d0-\u19d9\u1a00-\u1a15\u1a20-\u1a53\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b46-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1bb0-\u1bb9\u1be6-\u1bf3\u1c00-\u1c22\u1c40-\u1c49\u1c5b-\u1c7d\u1cd0-\u1cd2\u1d00-\u1dbe\u1e01-\u1f15\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2d81-\u2d96\u2de0-\u2dff\u3021-\u3028\u3099\u309a\ua640-\ua66d\ua674-\ua67d\ua69f\ua6f0-\ua6f1\ua7f8-\ua800\ua806\ua80b\ua823-\ua827\ua880-\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8f3-\ua8f7\ua900-\ua909\ua926-\ua92d\ua930-\ua945\ua980-\ua983\ua9b3-\ua9c0\uaa00-\uaa27\uaa40-\uaa41\uaa4c-\uaa4d\uaa50-\uaa59\uaa7b\uaae0-\uaae9\uaaf2-\uaaf3\uabc0-\uabe1\uabec\uabed\uabf0-\uabf9\ufb20-\ufb28\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); var newline = /[\n\r\u2028\u2029]/; var lineBreak = /\r\n|[\n\r\u2028\u2029]/g; var isIdentifierStart = exports.isIdentifierStart = function(code) { if (code < 65) return code === 36; if (code < 91) return true; if (code < 97) return code === 95; if (code < 123)return true; return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); }; var isIdentifierChar = exports.isIdentifierChar = function(code) { if (code < 48) return code === 36; if (code < 58) return true; if (code < 65) return false; if (code < 91) return true; if (code < 97) return code === 95; if (code < 123)return true; return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); }; function line_loc_t() { this.line = tokCurLine; this.column = tokPos - tokLineStart; } function initTokenState() { tokCurLine = 1; tokPos = tokLineStart = 0; tokRegexpAllowed = true; skipSpace(); } function finishToken(type, val) { tokEnd = tokPos; if (options.locations) tokEndLoc = new line_loc_t; tokType = type; skipSpace(); tokVal = val; tokRegexpAllowed = type.beforeExpr; } function skipBlockComment() { var startLoc = options.onComment && options.locations && new line_loc_t; var start = tokPos, end = input.indexOf("*/", tokPos += 2); if (end === -1) raise(tokPos - 2, "Unterminated comment"); tokPos = end + 2; if (options.locations) { lineBreak.lastIndex = start; var match; while ((match = lineBreak.exec(input)) && match.index < tokPos) { ++tokCurLine; tokLineStart = match.index + match[0].length; } } if (options.onComment) options.onComment(true, input.slice(start + 2, end), start, tokPos, startLoc, options.locations && new line_loc_t); } function skipLineComment() { var start = tokPos; var startLoc = options.onComment && options.locations && new line_loc_t; var ch = input.charCodeAt(tokPos+=2); while (tokPos < inputLen && ch !== 10 && ch !== 13 && ch !== 8232 && ch !== 8233) { ++tokPos; ch = input.charCodeAt(tokPos); } if (options.onComment) options.onComment(false, input.slice(start + 2, tokPos), start, tokPos, startLoc, options.locations && new line_loc_t); } function skipSpace() { while (tokPos < inputLen) { var ch = input.charCodeAt(tokPos); if (ch === 32) { ++tokPos; } else if (ch === 13) { ++tokPos; var next = input.charCodeAt(tokPos); if (next === 10) { ++tokPos; } if (options.locations) { ++tokCurLine; tokLineStart = tokPos; } } else if (ch === 10 || ch === 8232 || ch === 8233) { ++tokPos; if (options.locations) { ++tokCurLine; tokLineStart = tokPos; } } else if (ch > 8 && ch < 14) { ++tokPos; } else if (ch === 47) { var next = input.charCodeAt(tokPos + 1); if (next === 42) { skipBlockComment(); } else if (next === 47) { skipLineComment(); } else break; } else if (ch === 160) { ++tokPos; } else if (ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { ++tokPos; } else { break; } } } function readToken_dot() { var next = input.charCodeAt(tokPos + 1); if (next >= 48 && next <= 57) return readNumber(true); ++tokPos; return finishToken(_dot); } function readToken_slash() { var next = input.charCodeAt(tokPos + 1); if (tokRegexpAllowed) {++tokPos; return readRegexp();} if (next === 61) return finishOp(_assign, 2); return finishOp(_slash, 1); } function readToken_mult_modulo() { var next = input.charCodeAt(tokPos + 1); if (next === 61) return finishOp(_assign, 2); return finishOp(_multiplyModulo, 1); } function readToken_pipe_amp(code) { var next = input.charCodeAt(tokPos + 1); if (next === code) return finishOp(code === 124 ? _logicalOR : _logicalAND, 2); if (next === 61) return finishOp(_assign, 2); return finishOp(code === 124 ? _bitwiseOR : _bitwiseAND, 1); } function readToken_caret() { var next = input.charCodeAt(tokPos + 1); if (next === 61) return finishOp(_assign, 2); return finishOp(_bitwiseXOR, 1); } function readToken_plus_min(code) { var next = input.charCodeAt(tokPos + 1); if (next === code) { if (next == 45 && input.charCodeAt(tokPos + 2) == 62 && newline.test(input.slice(lastEnd, tokPos))) { tokPos += 3; skipLineComment(); skipSpace(); return readToken(); } return finishOp(_incDec, 2); } if (next === 61) return finishOp(_assign, 2); return finishOp(_plusMin, 1); } function readToken_lt_gt(code) { var next = input.charCodeAt(tokPos + 1); var size = 1; if (next === code) { size = code === 62 && input.charCodeAt(tokPos + 2) === 62 ? 3 : 2; if (input.charCodeAt(tokPos + size) === 61) return finishOp(_assign, size + 1); return finishOp(_bitShift, size); } if (next == 33 && code == 60 && input.charCodeAt(tokPos + 2) == 45 && input.charCodeAt(tokPos + 3) == 45) { tokPos += 4; skipLineComment(); skipSpace(); return readToken(); } if (next === 61) size = input.charCodeAt(tokPos + 2) === 61 ? 3 : 2; return finishOp(_relational, size); } function readToken_eq_excl(code) { var next = input.charCodeAt(tokPos + 1); if (next === 61) return finishOp(_equality, input.charCodeAt(tokPos + 2) === 61 ? 3 : 2); return finishOp(code === 61 ? _eq : _prefix, 1); } function getTokenFromCode(code) { switch(code) { case 46: return readToken_dot(); case 40: ++tokPos; return finishToken(_parenL); case 41: ++tokPos; return finishToken(_parenR); case 59: ++tokPos; return finishToken(_semi); case 44: ++tokPos; return finishToken(_comma); case 91: ++tokPos; return finishToken(_bracketL); case 93: ++tokPos; return finishToken(_bracketR); case 123: ++tokPos; return finishToken(_braceL); case 125: ++tokPos; return finishToken(_braceR); case 58: ++tokPos; return finishToken(_colon); case 63: ++tokPos; return finishToken(_question); case 48: var next = input.charCodeAt(tokPos + 1); if (next === 120 || next === 88) return readHexNumber(); case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: return readNumber(false); case 34: case 39: return readString(code); case 47: return readToken_slash(code); case 37: case 42: return readToken_mult_modulo(); case 124: case 38: return readToken_pipe_amp(code); case 94: return readToken_caret(); case 43: case 45: return readToken_plus_min(code); case 60: case 62: return readToken_lt_gt(code); case 61: case 33: return readToken_eq_excl(code); case 126: return finishOp(_prefix, 1); } return false; } function readToken(forceRegexp) { if (!forceRegexp) tokStart = tokPos; else tokPos = tokStart + 1; if (options.locations) tokStartLoc = new line_loc_t; if (forceRegexp) return readRegexp(); if (tokPos >= inputLen) return finishToken(_eof); var code = input.charCodeAt(tokPos); if (isIdentifierStart(code) || code === 92 ) return readWord(); var tok = getTokenFromCode(code); if (tok === false) { var ch = String.fromCharCode(code); if (ch === "\\" || nonASCIIidentifierStart.test(ch)) return readWord(); raise(tokPos, "Unexpected character '" + ch + "'"); } return tok; } function finishOp(type, size) { var str = input.slice(tokPos, tokPos + size); tokPos += size; finishToken(type, str); } function readRegexp() { var content = "", escaped, inClass, start = tokPos; for (;;) { if (tokPos >= inputLen) raise(start, "Unterminated regular expression"); var ch = input.charAt(tokPos); if (newline.test(ch)) raise(start, "Unterminated regular expression"); if (!escaped) { if (ch === "[") inClass = true; else if (ch === "]" && inClass) inClass = false; else if (ch === "/" && !inClass) break; escaped = ch === "\\"; } else escaped = false; ++tokPos; } var content = input.slice(start, tokPos); ++tokPos; var mods = readWord1(); if (mods && !/^[gmsiy]*$/.test(mods)) raise(start, "Invalid regexp flag"); try { var value = new RegExp(content, mods); } catch (e) { if (e instanceof SyntaxError) raise(start, e.message); raise(e); } return finishToken(_regexp, value); } function readInt(radix, len) { var start = tokPos, total = 0; for (var i = 0, e = len == null ? Infinity : len; i < e; ++i) { var code = input.charCodeAt(tokPos), val; if (code >= 97) val = code - 97 + 10; else if (code >= 65) val = code - 65 + 10; else if (code >= 48 && code <= 57) val = code - 48; else val = Infinity; if (val >= radix) break; ++tokPos; total = total * radix + val; } if (tokPos === start || len != null && tokPos - start !== len) return null; return total; } function readHexNumber() { tokPos += 2; var val = readInt(16); if (val == null) raise(tokStart + 2, "Expected hexadecimal number"); if (isIdentifierStart(input.charCodeAt(tokPos))) raise(tokPos, "Identifier directly after number"); return finishToken(_num, val); } function readNumber(startsWithDot) { var start = tokPos, isFloat = false, octal = input.charCodeAt(tokPos) === 48; if (!startsWithDot && readInt(10) === null) raise(start, "Invalid number"); if (input.charCodeAt(tokPos) === 46) { ++tokPos; readInt(10); isFloat = true; } var next = input.charCodeAt(tokPos); if (next === 69 || next === 101) { next = input.charCodeAt(++tokPos); if (next === 43 || next === 45) ++tokPos; if (readInt(10) === null) raise(start, "Invalid number"); isFloat = true; } if (isIdentifierStart(input.charCodeAt(tokPos))) raise(tokPos, "Identifier directly after number"); var str = input.slice(start, tokPos), val; if (isFloat) val = parseFloat(str); else if (!octal || str.length === 1) val = parseInt(str, 10); else if (/[89]/.test(str) || strict) raise(start, "Invalid number"); else val = parseInt(str, 8); return finishToken(_num, val); } function readString(quote) { tokPos++; var out = ""; for (;;) { if (tokPos >= inputLen) raise(tokStart, "Unterminated string constant"); var ch = input.charCodeAt(tokPos); if (ch === quote) { ++tokPos; return finishToken(_string, out); } if (ch === 92) { ch = input.charCodeAt(++tokPos); var octal = /^[0-7]+/.exec(input.slice(tokPos, tokPos + 3)); if (octal) octal = octal[0]; while (octal && parseInt(octal, 8) > 255) octal = octal.slice(0, -1); if (octal === "0") octal = null; ++tokPos; if (octal) { if (strict) raise(tokPos - 2, "Octal literal in strict mode"); out += String.fromCharCode(parseInt(octal, 8)); tokPos += octal.length - 1; } else { switch (ch) { case 110: out += "\n"; break; case 114: out += "\r"; break; case 120: out += String.fromCharCode(readHexChar(2)); break; case 117: out += String.fromCharCode(readHexChar(4)); break; case 85: out += String.fromCharCode(readHexChar(8)); break; case 116: out += "\t"; break; case 98: out += "\b"; break; case 118: out += "\u000b"; break; case 102: out += "\f"; break; case 48: out += "\0"; break; case 13: if (input.charCodeAt(tokPos) === 10) ++tokPos; case 10: if (options.locations) { tokLineStart = tokPos; ++tokCurLine; } break; default: out += String.fromCharCode(ch); break; } } } else { if (ch === 13 || ch === 10 || ch === 8232 || ch === 8233) raise(tokStart, "Unterminated string constant"); out += String.fromCharCode(ch); ++tokPos; } } } function readHexChar(len) { var n = readInt(16, len); if (n === null) raise(tokStart, "Bad character escape sequence"); return n; } var containsEsc; function readWord1() { containsEsc = false; var word, first = true, start = tokPos; for (;;) { var ch = input.charCodeAt(tokPos); if (isIdentifierChar(ch)) { if (containsEsc) word += input.charAt(tokPos); ++tokPos; } else if (ch === 92) { if (!containsEsc) word = input.slice(start, tokPos); containsEsc = true; if (input.charCodeAt(++tokPos) != 117) raise(tokPos, "Expecting Unicode escape sequence \\uXXXX"); ++tokPos; var esc = readHexChar(4); var escStr = String.fromCharCode(esc); if (!escStr) raise(tokPos - 1, "Invalid Unicode escape"); if (!(first ? isIdentifierStart(esc) : isIdentifierChar(esc))) raise(tokPos - 4, "Invalid Unicode escape"); word += escStr; } else { break; } first = false; } return containsEsc ? word : input.slice(start, tokPos); } function readWord() { var word = readWord1(); var type = _name; if (!containsEsc && isKeyword(word)) type = keywordTypes[word]; return finishToken(type, word); } function next() { lastStart = tokStart; lastEnd = tokEnd; lastEndLoc = tokEndLoc; readToken(); } function setStrict(strct) { strict = strct; tokPos = tokStart; if (options.locations) { while (tokPos < tokLineStart) { tokLineStart = input.lastIndexOf("\n", tokLineStart - 2) + 1; --tokCurLine; } } skipSpace(); readToken(); } function node_t() { this.type = null; this.start = tokStart; this.end = null; } function node_loc_t() { this.start = tokStartLoc; this.end = null; if (sourceFile !== null) this.source = sourceFile; } function startNode() { var node = new node_t(); if (options.locations) node.loc = new node_loc_t(); if (options.directSourceFile) node.sourceFile = options.directSourceFile; if (options.ranges) node.range = [tokStart, 0]; return node; } function startNodeFrom(other) { var node = new node_t(); node.start = other.start; if (options.locations) { node.loc = new node_loc_t(); node.loc.start = other.loc.start; } if (options.ranges) node.range = [other.range[0], 0]; return node; } function finishNode(node, type) { node.type = type; node.end = lastEnd; if (options.locations) node.loc.end = lastEndLoc; if (options.ranges) node.range[1] = lastEnd; return node; } function isUseStrict(stmt) { return options.ecmaVersion >= 5 && stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && stmt.expression.value === "use strict"; } function eat(type) { if (tokType === type) { next(); return true; } } function canInsertSemicolon() { return !options.strictSemicolons && (tokType === _eof || tokType === _braceR || newline.test(input.slice(lastEnd, tokStart))); } function semicolon() { if (!eat(_semi) && !canInsertSemicolon()) unexpected(); } function expect(type) { if (tokType === type) next(); else unexpected(); } function unexpected() { raise(tokStart, "Unexpected token"); } function checkLVal(expr) { if (expr.type !== "Identifier" && expr.type !== "MemberExpression") raise(expr.start, "Assigning to rvalue"); if (strict && expr.type === "Identifier" && isStrictBadIdWord(expr.name)) raise(expr.start, "Assigning to " + expr.name + " in strict mode"); } function parseTopLevel(program) { lastStart = lastEnd = tokPos; if (options.locations) lastEndLoc = new line_loc_t; inFunction = strict = null; labels = []; readToken(); var node = program || startNode(), first = true; if (!program) node.body = []; while (tokType !== _eof) { var stmt = parseStatement(); node.body.push(stmt); if (first && isUseStrict(stmt)) setStrict(true); first = false; } return finishNode(node, "Program"); } var loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"}; function parseStatement() { if (tokType === _slash || tokType === _assign && tokVal == "/=") readToken(true); var starttype = tokType, node = startNode(); switch (starttype) { case _break: case _continue: next(); var isBreak = starttype === _break; if (eat(_semi) || canInsertSemicolon()) node.label = null; else if (tokType !== _name) unexpected(); else { node.label = parseIdent(); semicolon(); } for (var i = 0; i < labels.length; ++i) { var lab = labels[i]; if (node.label == null || lab.name === node.label.name) { if (lab.kind != null && (isBreak || lab.kind === "loop")) break; if (node.label && isBreak) break; } } if (i === labels.length) raise(node.start, "Unsyntactic " + starttype.keyword); return finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement"); case _debugger: next(); semicolon(); return finishNode(node, "DebuggerStatement"); case _do: next(); labels.push(loopLabel); node.body = parseStatement(); labels.pop(); expect(_while); node.test = parseParenExpression(); semicolon(); return finishNode(node, "DoWhileStatement"); case _for: next(); labels.push(loopLabel); expect(_parenL); if (tokType === _semi) return parseFor(node, null); if (tokType === _var) { var init = startNode(); next(); parseVar(init, true); finishNode(init, "VariableDeclaration"); if (init.declarations.length === 1 && eat(_in)) return parseForIn(node, init); return parseFor(node, init); } var init = parseExpression(false, true); if (eat(_in)) {checkLVal(init); return parseForIn(node, init);} return parseFor(node, init); case _function: next(); return parseFunction(node, true); case _if: next(); node.test = parseParenExpression(); node.consequent = parseStatement(); node.alternate = eat(_else) ? parseStatement() : null; return finishNode(node, "IfStatement"); case _return: if (!inFunction && !options.allowReturnOutsideFunction) raise(tokStart, "'return' outside of function"); next(); if (eat(_semi) || canInsertSemicolon()) node.argument = null; else { node.argument = parseExpression(); semicolon(); } return finishNode(node, "ReturnStatement"); case _switch: next(); node.discriminant = parseParenExpression(); node.cases = []; expect(_braceL); labels.push(switchLabel); for (var cur, sawDefault; tokType != _braceR;) { if (tokType === _case || tokType === _default) { var isCase = tokType === _case; if (cur) finishNode(cur, "SwitchCase"); node.cases.push(cur = startNode()); cur.consequent = []; next(); if (isCase) cur.test = parseExpression(); else { if (sawDefault) raise(lastStart, "Multiple default clauses"); sawDefault = true; cur.test = null; } expect(_colon); } else { if (!cur) unexpected(); cur.consequent.push(parseStatement()); } } if (cur) finishNode(cur, "SwitchCase"); next(); labels.pop(); return finishNode(node, "SwitchStatement"); case _throw: next(); if (newline.test(input.slice(lastEnd, tokStart))) raise(lastEnd, "Illegal newline after throw"); node.argument = parseExpression(); semicolon(); return finishNode(node, "ThrowStatement"); case _try: next(); node.block = parseBlock(); node.handler = null; if (tokType === _catch) { var clause = startNode(); next(); expect(_parenL); clause.param = parseIdent(); if (strict && isStrictBadIdWord(clause.param.name)) raise(clause.param.start, "Binding " + clause.param.name + " in strict mode"); expect(_parenR); clause.guard = null; clause.body = parseBlock(); node.handler = finishNode(clause, "CatchClause"); } node.guardedHandlers = empty; node.finalizer = eat(_finally) ? parseBlock() : null; if (!node.handler && !node.finalizer) raise(node.start, "Missing catch or finally clause"); return finishNode(node, "TryStatement"); case _var: next(); parseVar(node); semicolon(); return finishNode(node, "VariableDeclaration"); case _while: next(); node.test = parseParenExpression(); labels.push(loopLabel); node.body = parseStatement(); labels.pop(); return finishNode(node, "WhileStatement"); case _with: if (strict) raise(tokStart, "'with' in strict mode"); next(); node.object = parseParenExpression(); node.body = parseStatement(); return finishNode(node, "WithStatement"); case _braceL: return parseBlock(); case _semi: next(); return finishNode(node, "EmptyStatement"); default: var maybeName = tokVal, expr = parseExpression(); if (starttype === _name && expr.type === "Identifier" && eat(_colon)) { for (var i = 0; i < labels.length; ++i) if (labels[i].name === maybeName) raise(expr.start, "Label '" + maybeName + "' is already declared"); var kind = tokType.isLoop ? "loop" : tokType === _switch ? "switch" : null; labels.push({name: maybeName, kind: kind}); node.body = parseStatement(); labels.pop(); node.label = expr; return finishNode(node, "LabeledStatement"); } else { node.expression = expr; semicolon(); return finishNode(node, "ExpressionStatement"); } } } function parseParenExpression() { expect(_parenL); var val = parseExpression(); expect(_parenR); return val; } function parseBlock(allowStrict) { var node = startNode(), first = true, strict = false, oldStrict; node.body = []; expect(_braceL); while (!eat(_braceR)) { var stmt = parseStatement(); node.body.push(stmt); if (first && allowStrict && isUseStrict(stmt)) { oldStrict = strict; setStrict(strict = true); } first = false; } if (strict && !oldStrict) setStrict(false); return finishNode(node, "BlockStatement"); } function parseFor(node, init) { node.init = init; expect(_semi); node.test = tokType === _semi ? null : parseExpression(); expect(_semi); node.update = tokType === _parenR ? null : parseExpression(); expect(_parenR); node.body = parseStatement(); labels.pop(); return finishNode(node, "ForStatement"); } function parseForIn(node, init) { node.left = init; node.right = parseExpression(); expect(_parenR); node.body = parseStatement(); labels.pop(); return finishNode(node, "ForInStatement"); } function parseVar(node, noIn) { node.declarations = []; node.kind = "var"; for (;;) { var decl = startNode(); decl.id = parseIdent(); if (strict && isStrictBadIdWord(decl.id.name)) raise(decl.id.start, "Binding " + decl.id.name + " in strict mode"); decl.init = eat(_eq) ? parseExpression(true, noIn) : null; node.declarations.push(finishNode(decl, "VariableDeclarator")); if (!eat(_comma)) break; } return node; } function parseExpression(noComma, noIn) { var expr = parseMaybeAssign(noIn); if (!noComma && tokType === _comma) { var node = startNodeFrom(expr); node.expressions = [expr]; while (eat(_comma)) node.expressions.push(parseMaybeAssign(noIn)); return finishNode(node, "SequenceExpression"); } return expr; } function parseMaybeAssign(noIn) { var left = parseMaybeConditional(noIn); if (tokType.isAssign) { var node = startNodeFrom(left); node.operator = tokVal; node.left = left; next(); node.right = parseMaybeAssign(noIn); checkLVal(left); return finishNode(node, "AssignmentExpression"); } return left; } function parseMaybeConditional(noIn) { var expr = parseExprOps(noIn); if (eat(_question)) { var node = startNodeFrom(expr); node.test = expr; node.consequent = parseExpression(true); expect(_colon); node.alternate = parseExpression(true, noIn); return finishNode(node, "ConditionalExpression"); } return expr; } function parseExprOps(noIn) { return parseExprOp(parseMaybeUnary(), -1, noIn); } function parseExprOp(left, minPrec, noIn) { var prec = tokType.binop; if (prec != null && (!noIn || tokType !== _in)) { if (prec > minPrec) { var node = startNodeFrom(left); node.left = left; node.operator = tokVal; var op = tokType; next(); node.right = parseExprOp(parseMaybeUnary(), prec, noIn); var exprNode = finishNode(node, (op === _logicalOR || op === _logicalAND) ? "LogicalExpression" : "BinaryExpression"); return parseExprOp(exprNode, minPrec, noIn); } } return left; } function parseMaybeUnary() { if (tokType.prefix) { var node = startNode(), update = tokType.isUpdate; node.operator = tokVal; node.prefix = true; tokRegexpAllowed = true; next(); node.argument = parseMaybeUnary(); if (update) checkLVal(node.argument); else if (strict && node.operator === "delete" && node.argument.type === "Identifier") raise(node.start, "Deleting local variable in strict mode"); return finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); } var expr = parseExprSubscripts(); while (tokType.postfix && !canInsertSemicolon()) { var node = startNodeFrom(expr); node.operator = tokVal; node.prefix = false; node.argument = expr; checkLVal(expr); next(); expr = finishNode(node, "UpdateExpression"); } return expr; } function parseExprSubscripts() { return parseSubscripts(parseExprAtom()); } function parseSubscripts(base, noCalls) { if (eat(_dot)) { var node = startNodeFrom(base); node.object = base; node.property = parseIdent(true); node.computed = false; return parseSubscripts(finishNode(node, "MemberExpression"), noCalls); } else if (eat(_bracketL)) { var node = startNodeFrom(base); node.object = base; node.property = parseExpression(); node.computed = true; expect(_bracketR); return parseSubscripts(finishNode(node, "MemberExpression"), noCalls); } else if (!noCalls && eat(_parenL)) { var node = startNodeFrom(base); node.callee = base; node.arguments = parseExprList(_parenR, false); return parseSubscripts(finishNode(node, "CallExpression"), noCalls); } else return base; } function parseExprAtom() { switch (tokType) { case _this: var node = startNode(); next(); return finishNode(node, "ThisExpression"); case _name: return parseIdent(); case _num: case _string: case _regexp: var node = startNode(); node.value = tokVal; node.raw = input.slice(tokStart, tokEnd); next(); return finishNode(node, "Literal"); case _null: case _true: case _false: var node = startNode(); node.value = tokType.atomValue; node.raw = tokType.keyword; next(); return finishNode(node, "Literal"); case _parenL: var tokStartLoc1 = tokStartLoc, tokStart1 = tokStart; next(); var val = parseExpression(); val.start = tokStart1; val.end = tokEnd; if (options.locations) { val.loc.start = tokStartLoc1; val.loc.end = tokEndLoc; } if (options.ranges) val.range = [tokStart1, tokEnd]; expect(_parenR); return val; case _bracketL: var node = startNode(); next(); node.elements = parseExprList(_bracketR, true, true); return finishNode(node, "ArrayExpression"); case _braceL: return parseObj(); case _function: var node = startNode(); next(); return parseFunction(node, false); case _new: return parseNew(); default: unexpected(); } } function parseNew() { var node = startNode(); next(); node.callee = parseSubscripts(parseExprAtom(), true); if (eat(_parenL)) node.arguments = parseExprList(_parenR, false); else node.arguments = empty; return finishNode(node, "NewExpression"); } function parseObj() { var node = startNode(), first = true, sawGetSet = false; node.properties = []; next(); while (!eat(_braceR)) { if (!first) { expect(_comma); if (options.allowTrailingCommas && eat(_braceR)) break; } else first = false; var prop = {key: parsePropertyName()}, isGetSet = false, kind; if (eat(_colon)) { prop.value = parseExpression(true); kind = prop.kind = "init"; } else if (options.ecmaVersion >= 5 && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set")) { isGetSet = sawGetSet = true; kind = prop.kind = prop.key.name; prop.key = parsePropertyName(); if (tokType !== _parenL) unexpected(); prop.value = parseFunction(startNode(), false); } else unexpected(); if (prop.key.type === "Identifier" && (strict || sawGetSet)) { for (var i = 0; i < node.properties.length; ++i) { var other = node.properties[i]; if (other.key.name === prop.key.name) { var conflict = kind == other.kind || isGetSet && other.kind === "init" || kind === "init" && (other.kind === "get" || other.kind === "set"); if (conflict && !strict && kind === "init" && other.kind === "init") conflict = false; if (conflict) raise(prop.key.start, "Redefinition of property"); } } } node.properties.push(prop); } return finishNode(node, "ObjectExpression"); } function parsePropertyName() { if (tokType === _num || tokType === _string) return parseExprAtom(); return parseIdent(true); } function parseFunction(node, isStatement) { if (tokType === _name) node.id = parseIdent(); else if (isStatement) unexpected(); else node.id = null; node.params = []; var first = true; expect(_parenL); while (!eat(_parenR)) { if (!first) expect(_comma); else first = false; node.params.push(parseIdent()); } var oldInFunc = inFunction, oldLabels = labels; inFunction = true; labels = []; node.body = parseBlock(true); inFunction = oldInFunc; labels = oldLabels; if (strict || node.body.body.length && isUseStrict(node.body.body[0])) { for (var i = node.id ? -1 : 0; i < node.params.length; ++i) { var id = i < 0 ? node.id : node.params[i]; if (isStrictReservedWord(id.name) || isStrictBadIdWord(id.name)) raise(id.start, "Defining '" + id.name + "' in strict mode"); if (i >= 0) for (var j = 0; j < i; ++j) if (id.name === node.params[j].name) raise(id.start, "Argument name clash in strict mode"); } } return finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression"); } function parseExprList(close, allowTrailingComma, allowEmpty) { var elts = [], first = true; while (!eat(close)) { if (!first) { expect(_comma); if (allowTrailingComma && options.allowTrailingCommas && eat(close)) break; } else first = false; if (allowEmpty && tokType === _comma) elts.push(null); else elts.push(parseExpression(true)); } return elts; } function parseIdent(liberal) { var node = startNode(); if (liberal && options.forbidReserved == "everywhere") liberal = false; if (tokType === _name) { if (!liberal && (options.forbidReserved && (options.ecmaVersion === 3 ? isReservedWord3 : isReservedWord5)(tokVal) || strict && isStrictReservedWord(tokVal)) && input.slice(tokStart, tokEnd).indexOf("\\") == -1) raise(tokStart, "The keyword '" + tokVal + "' is reserved"); node.name = tokVal; } else if (liberal && tokType.keyword) { node.name = tokType.keyword; } else { unexpected(); } tokRegexpAllowed = false; next(); return finishNode(node, "Identifier"); } }); if (!acorn.version) acorn = null; } function parse(code, options) { return (global.acorn || acorn).parse(code, options); } var binaryOperators = { '+': '__add', '-': '__subtract', '*': '__multiply', '/': '__divide', '%': '__modulo', '==': '__equals', '!=': '__equals' }; var unaryOperators = { '-': '__negate', '+': '__self' }; var fields = Base.each( ['add', 'subtract', 'multiply', 'divide', 'modulo', 'equals', 'negate'], function(name) { this['__' + name] = '#' + name; }, { __self: function() { return this; } } ); Point.inject(fields); Size.inject(fields); Color.inject(fields); function __$__(left, operator, right) { var handler = binaryOperators[operator]; if (left && left[handler]) { var res = left[handler](right); return operator === '!=' ? !res : res; } switch (operator) { case '+': return left + right; case '-': return left - right; case '*': return left * right; case '/': return left / right; case '%': return left % right; case '==': return left == right; case '!=': return left != right; } } function $__(operator, value) { var handler = unaryOperators[operator]; if (value && value[handler]) return value[handler](); switch (operator) { case '+': return +value; case '-': return -value; } } function compile(code, options) { if (!code) return ''; options = options || {}; var insertions = []; function getOffset(offset) { for (var i = 0, l = insertions.length; i < l; i++) { var insertion = insertions[i]; if (insertion[0] >= offset) break; offset += insertion[1]; } return offset; } function getCode(node) { return code.substring(getOffset(node.range[0]), getOffset(node.range[1])); } function getBetween(left, right) { return code.substring(getOffset(left.range[1]), getOffset(right.range[0])); } function replaceCode(node, str) { var start = getOffset(node.range[0]), end = getOffset(node.range[1]), insert = 0; for (var i = insertions.length - 1; i >= 0; i--) { if (start > insertions[i][0]) { insert = i + 1; break; } } insertions.splice(insert, 0, [start, str.length - end + start]); code = code.substring(0, start) + str + code.substring(end); } function walkAST(node, parent) { if (!node) return; for (var key in node) { if (key === 'range' || key === 'loc') continue; var value = node[key]; if (Array.isArray(value)) { for (var i = 0, l = value.length; i < l; i++) walkAST(value[i], node); } else if (value && typeof value === 'object') { walkAST(value, node); } } switch (node.type) { case 'UnaryExpression': if (node.operator in unaryOperators && node.argument.type !== 'Literal') { var arg = getCode(node.argument); replaceCode(node, '$__("' + node.operator + '", ' + arg + ')'); } break; case 'BinaryExpression': if (node.operator in binaryOperators && node.left.type !== 'Literal') { var left = getCode(node.left), right = getCode(node.right), between = getBetween(node.left, node.right), operator = node.operator; replaceCode(node, '__$__(' + left + ',' + between.replace(new RegExp('\\' + operator), '"' + operator + '"') + ', ' + right + ')'); } break; case 'UpdateExpression': case 'AssignmentExpression': var parentType = parent && parent.type; if (!( parentType === 'ForStatement' || parentType === 'BinaryExpression' && /^[=!<>]/.test(parent.operator) || parentType === 'MemberExpression' && parent.computed )) { if (node.type === 'UpdateExpression') { var arg = getCode(node.argument), exp = '__$__(' + arg + ', "' + node.operator[0] + '", 1)', str = arg + ' = ' + exp; if (!node.prefix && (parentType === 'AssignmentExpression' || parentType === 'VariableDeclarator')) { if (getCode(parent.left || parent.id) === arg) str = exp; str = arg + '; ' + str; } replaceCode(node, str); } else { if (/^.=$/.test(node.operator) && node.left.type !== 'Literal') { var left = getCode(node.left), right = getCode(node.right), exp = left + ' = __$__(' + left + ', "' + node.operator[0] + '", ' + right + ')'; replaceCode(node, /^\(.*\)$/.test(getCode(node)) ? '(' + exp + ')' : exp); } } } break; case 'ExportDefaultDeclaration': replaceCode({ range: [node.start, node.declaration.start] }, 'module.exports = '); break; case 'ExportNamedDeclaration': var declaration = node.declaration; var specifiers = node.specifiers; if (declaration) { var declarations = declaration.declarations; if (declarations) { declarations.forEach(function(dec) { replaceCode(dec, 'module.exports.' + getCode(dec)); }); replaceCode({ range: [ node.start, declaration.start + declaration.kind.length ] }, ''); } } else if (specifiers) { var exports = specifiers.map(function(specifier) { var name = getCode(specifier); return 'module.exports.' + name + ' = ' + name + '; '; }).join(''); if (exports) { replaceCode(node, exports); } } break; } } function encodeVLQ(value) { var res = '', base64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; value = (Math.abs(value) << 1) + (value < 0 ? 1 : 0); while (value || !res) { var next = value & (32 - 1); value >>= 5; if (value) next |= 32; res += base64[next]; } return res; } var url = options.url || '', agent = paper.agent, version = agent.versionNumber, offsetCode = false, sourceMaps = options.sourceMaps, source = options.source || code, lineBreaks = /\r\n|\n|\r/mg, offset = options.offset || 0, map; if (sourceMaps && (agent.chrome && version >= 30 || agent.webkit && version >= 537.76 || agent.firefox && version >= 23 || agent.node)) { if (agent.node) { offset -= 2; } else if (window && url && !window.location.href.indexOf(url)) { var html = document.getElementsByTagName('html')[0].innerHTML; offset = html.substr(0, html.indexOf(code) + 1).match( lineBreaks).length + 1; } offsetCode = offset > 0 && !( agent.chrome && version >= 36 || agent.safari && version >= 600 || agent.firefox && version >= 40 || agent.node); var mappings = ['AA' + encodeVLQ(offsetCode ? 0 : offset) + 'A']; mappings.length = (code.match(lineBreaks) || []).length + 1 + (offsetCode ? offset : 0); map = { version: 3, file: url, names:[], mappings: mappings.join(';AACA'), sourceRoot: '', sources: [url], sourcesContent: [source] }; } walkAST(parse(code, { ranges: true, preserveParens: true, sourceType: 'module' })); if (map) { if (offsetCode) { code = new Array(offset + 1).join('\n') + code; } if (/^(inline|both)$/.test(sourceMaps)) { code += "\n//# sourceMappingURL=data:application/json;base64," + self.btoa(unescape(encodeURIComponent( JSON.stringify(map)))); } code += "\n//# sourceURL=" + (url || 'paperscript'); } return { url: url, source: source, code: code, map: map }; } function execute(code, scope, options) { paper = scope; var view = scope.getView(), tool = /\btool\.\w+|\s+on(?:Key|Mouse)(?:Up|Down|Move|Drag)\b/ .test(code) && !/\bnew\s+Tool\b/.test(code) ? new Tool() : null, toolHandlers = tool ? tool._events : [], handlers = ['onFrame', 'onResize'].concat(toolHandlers), params = [], args = [], func, compiled = typeof code === 'object' ? code : compile(code, options); code = compiled.code; function expose(scope, hidden) { for (var key in scope) { if ((hidden || !/^_/.test(key)) && new RegExp('([\\b\\s\\W]|^)' + key.replace(/\$/g, '\\$') + '\\b').test(code)) { params.push(key); args.push(scope[key]); } } } expose({ __$__: __$__, $__: $__, paper: scope, view: view, tool: tool }, true); expose(scope); code = 'var module = { exports: {} }; ' + code; var exports = Base.each(handlers, function(key) { if (new RegExp('\\s+' + key + '\\b').test(code)) { params.push(key); this.push('module.exports.' + key + ' = ' + key + ';'); } }, []).join('\n'); if (exports) { code += '\n' + exports; } code += '\nreturn module.exports;'; var agent = paper.agent; if (document && (agent.chrome || agent.firefox && agent.versionNumber < 40)) { var script = document.createElement('script'), head = document.head || document.getElementsByTagName('head')[0]; if (agent.firefox) code = '\n' + code; script.appendChild(document.createTextNode( 'document.__paperscript__ = function(' + params + ') {' + code + '\n}' )); head.appendChild(script); func = document.__paperscript__; delete document.__paperscript__; head.removeChild(script); } else { func = Function(params, code); } var exports = func && func.apply(scope, args); var obj = exports || {}; Base.each(toolHandlers, function(key) { var value = obj[key]; if (value) tool[key] = value; }); if (view) { if (obj.onResize) view.setOnResize(obj.onResize); view.emit('resize', { size: view.size, delta: new Point() }); if (obj.onFrame) view.setOnFrame(obj.onFrame); view.requestUpdate(); } return exports; } function loadScript(script) { if (/^text\/(?:x-|)paperscript$/.test(script.type) && PaperScope.getAttribute(script, 'ignore') !== 'true') { var canvasId = PaperScope.getAttribute(script, 'canvas'), canvas = document.getElementById(canvasId), src = script.src || script.getAttribute('data-src'), async = PaperScope.hasAttribute(script, 'async'), scopeAttribute = 'data-paper-scope'; if (!canvas) throw new Error('Unable to find canvas with id "' + canvasId + '"'); var scope = PaperScope.get(canvas.getAttribute(scopeAttribute)) || new PaperScope().setup(canvas); canvas.setAttribute(scopeAttribute, scope._id); if (src) { Http.request({ url: src, async: async, mimeType: 'text/plain', onLoad: function(code) { execute(code, scope, src); } }); } else { execute(script.innerHTML, scope, script.baseURI); } script.setAttribute('data-paper-ignore', 'true'); return scope; } } function loadAll() { Base.each(document && document.getElementsByTagName('script'), loadScript); } function load(script) { return script ? loadScript(script) : loadAll(); } if (window) { if (document.readyState === 'complete') { setTimeout(loadAll); } else { DomEvent.add(window, { load: loadAll }); } } return { compile: compile, execute: execute, load: load, parse: parse }; }.call(this); var paper = new (PaperScope.inject(Base.exports, { Base: Base, Numerical: Numerical, Key: Key, DomEvent: DomEvent, DomElement: DomElement, document: document, window: window, Symbol: SymbolDefinition, PlacedSymbol: SymbolItem }))(); if (paper.agent.node) { __webpack_require__(/*! ./node/extend.js */ 9)(paper); } if (true) { !(__WEBPACK_AMD_DEFINE_FACTORY__ = (paper), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else {} return paper; }.call(this, typeof self === 'object' ? self : null); /***/ }), /***/ "./node_modules/@vernier/godirect/dist/godirect.min.umd.js": /*!*****************************************************************!*\ !*** ./node_modules/@vernier/godirect/dist/godirect.min.umd.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } /** * Copyright (c) 2019 Vernier Software. All rights reserved. * This code may only be used under the BSD 3-Clause license found at * https://raw.githubusercontent.com/VernierST/godirect-js/master/LICENSE */ !function (e, t) { "object" == ( false ? undefined : _typeof(exports)) && "undefined" != typeof module ? module.exports = t() : true ? !(__WEBPACK_AMD_DEFINE_FACTORY__ = (t), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : undefined; }(this, function () { "use strict"; function e(e, t, n, r, i, a, o) { try { var s = e[a](o), u = s.value; } catch (e) { return void n(e); } s.done ? t(u) : Promise.resolve(u).then(r, i); } function t(t) { return function () { var n = this, r = arguments; return new Promise(function (i, a) { var o = t.apply(n, r); function s(t) { e(o, i, a, s, u, "next", t); } function u(t) { e(o, i, a, s, u, "throw", t); } s(void 0); }); }; } function n(e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); } function r(e, t) { for (var n = 0; n < t.length; n++) { var r = t[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); } } function i(e, t, n) { return t && r(e.prototype, t), n && r(e, n), e; } function a(e, t) { if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function"); e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), t && s(e, t); } function o(e) { return (o = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) { return e.__proto__ || Object.getPrototypeOf(e); })(e); } function s(e, t) { return (s = Object.setPrototypeOf || function (e, t) { return e.__proto__ = t, e; })(e, t); } function u(e, t) { return !t || "object" != _typeof(t) && "function" != typeof t ? function (e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }(e) : t; } !function (e) { var t, n = Object.prototype, r = n.hasOwnProperty, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", o = i.asyncIterator || "@@asyncIterator", s = i.toStringTag || "@@toStringTag", u = "object" == ( false ? undefined : _typeof(module)), c = e.regeneratorRuntime; if (c) u && (module.exports = c);else { (c = e.regeneratorRuntime = u ? module.exports : {}).wrap = b; var f = "suspendedStart", h = "suspendedYield", l = "executing", p = "completed", d = {}, m = {}; m[a] = function () { return this; }; var v = Object.getPrototypeOf, g = v && v(v(C([]))); g && g !== n && r.call(g, a) && (m = g); var y = x.prototype = _.prototype = Object.create(m); k.prototype = y.constructor = x, x.constructor = k, x[s] = k.displayName = "GeneratorFunction", c.isGeneratorFunction = function (e) { var t = "function" == typeof e && e.constructor; return !!t && (t === k || "GeneratorFunction" === (t.displayName || t.name)); }, c.mark = function (e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, x) : (e.__proto__ = x, s in e || (e[s] = "GeneratorFunction")), e.prototype = Object.create(y), e; }, c.awrap = function (e) { return { __await: e }; }, E(S.prototype), S.prototype[o] = function () { return this; }, c.AsyncIterator = S, c.async = function (e, t, n, r) { var i = new S(b(e, t, n, r)); return c.isGeneratorFunction(t) ? i : i.next().then(function (e) { return e.done ? e.value : i.next(); }); }, E(y), y[s] = "Generator", y[a] = function () { return this; }, y.toString = function () { return "[object Generator]"; }, c.keys = function (e) { var t = []; for (var n in e) { t.push(n); } return t.reverse(), function n() { for (; t.length;) { var r = t.pop(); if (r in e) return n.value = r, n.done = !1, n; } return n.done = !0, n; }; }, c.values = C, A.prototype = { constructor: A, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(M), !e) for (var n in this) { "t" === n.charAt(0) && r.call(this, n) && !isNaN(+n.slice(1)) && (this[n] = t); } }, stop: function stop() { this.done = !0; var e = this.tryEntries[0].completion; if ("throw" === e.type) throw e.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var n = this; function i(r, i) { return s.type = "throw", s.arg = e, n.next = r, i && (n.method = "next", n.arg = t), !!i; } for (var a = this.tryEntries.length - 1; a >= 0; --a) { var o = this.tryEntries[a], s = o.completion; if ("root" === o.tryLoc) return i("end"); if (o.tryLoc <= this.prev) { var u = r.call(o, "catchLoc"), c = r.call(o, "finallyLoc"); if (u && c) { if (this.prev < o.catchLoc) return i(o.catchLoc, !0); if (this.prev < o.finallyLoc) return i(o.finallyLoc); } else if (u) { if (this.prev < o.catchLoc) return i(o.catchLoc, !0); } else { if (!c) throw new Error("try statement without catch or finally"); if (this.prev < o.finallyLoc) return i(o.finallyLoc); } } } }, abrupt: function abrupt(e, t) { for (var n = this.tryEntries.length - 1; n >= 0; --n) { var i = this.tryEntries[n]; if (i.tryLoc <= this.prev && r.call(i, "finallyLoc") && this.prev < i.finallyLoc) { var a = i; break; } } a && ("break" === e || "continue" === e) && a.tryLoc <= t && t <= a.finallyLoc && (a = null); var o = a ? a.completion : {}; return o.type = e, o.arg = t, a ? (this.method = "next", this.next = a.finallyLoc, d) : this.complete(o); }, complete: function complete(e, t) { if ("throw" === e.type) throw e.arg; return "break" === e.type || "continue" === e.type ? this.next = e.arg : "return" === e.type ? (this.rval = this.arg = e.arg, this.method = "return", this.next = "end") : "normal" === e.type && t && (this.next = t), d; }, finish: function finish(e) { for (var t = this.tryEntries.length - 1; t >= 0; --t) { var n = this.tryEntries[t]; if (n.finallyLoc === e) return this.complete(n.completion, n.afterLoc), M(n), d; } }, catch: function _catch(e) { for (var t = this.tryEntries.length - 1; t >= 0; --t) { var n = this.tryEntries[t]; if (n.tryLoc === e) { var r = n.completion; if ("throw" === r.type) { var i = r.arg; M(n); } return i; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, n, r) { return this.delegate = { iterator: C(e), resultName: n, nextLoc: r }, "next" === this.method && (this.arg = t), d; } }; } function b(e, t, n, r) { var i = t && t.prototype instanceof _ ? t : _, a = Object.create(i.prototype), o = new A(r || []); return a._invoke = function (e, t, n) { var r = f; return function (i, a) { if (r === l) throw new Error("Generator is already running"); if (r === p) { if ("throw" === i) throw a; return L(); } for (n.method = i, n.arg = a;;) { var o = n.delegate; if (o) { var s = R(o, n); if (s) { if (s === d) continue; return s; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (r === f) throw r = p, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); r = l; var u = w(e, t, n); if ("normal" === u.type) { if (r = n.done ? p : h, u.arg === d) continue; return { value: u.arg, done: n.done }; } "throw" === u.type && (r = p, n.method = "throw", n.arg = u.arg); } }; }(e, n, o), a; } function w(e, t, n) { try { return { type: "normal", arg: e.call(t, n) }; } catch (e) { return { type: "throw", arg: e }; } } function _() {} function k() {} function x() {} function E(e) { ["next", "throw", "return"].forEach(function (t) { e[t] = function (e) { return this._invoke(t, e); }; }); } function S(e) { var t; this._invoke = function (n, i) { function a() { return new Promise(function (t, a) { !function t(n, i, a, o) { var s = w(e[n], e, i); if ("throw" !== s.type) { var u = s.arg, c = u.value; return c && "object" == _typeof(c) && r.call(c, "__await") ? Promise.resolve(c.__await).then(function (e) { t("next", e, a, o); }, function (e) { t("throw", e, a, o); }) : Promise.resolve(c).then(function (e) { u.value = e, a(u); }, function (e) { return t("throw", e, a, o); }); } o(s.arg); }(n, i, t, a); }); } return t = t ? t.then(a, a) : a(); }; } function R(e, n) { var r = e.iterator[n.method]; if (r === t) { if (n.delegate = null, "throw" === n.method) { if (e.iterator.return && (n.method = "return", n.arg = t, R(e, n), "throw" === n.method)) return d; n.method = "throw", n.arg = new TypeError("The iterator does not provide a 'throw' method"); } return d; } var i = w(r, e.iterator, n.arg); if ("throw" === i.type) return n.method = "throw", n.arg = i.arg, n.delegate = null, d; var a = i.arg; return a ? a.done ? (n[e.resultName] = a.value, n.next = e.nextLoc, "return" !== n.method && (n.method = "next", n.arg = t), n.delegate = null, d) : a : (n.method = "throw", n.arg = new TypeError("iterator result is not an object"), n.delegate = null, d); } function U(e) { var t = { tryLoc: e[0] }; 1 in e && (t.catchLoc = e[1]), 2 in e && (t.finallyLoc = e[2], t.afterLoc = e[3]), this.tryEntries.push(t); } function M(e) { var t = e.completion || {}; t.type = "normal", delete t.arg, e.completion = t; } function A(e) { this.tryEntries = [{ tryLoc: "root" }], e.forEach(U, this), this.reset(!0); } function C(e) { if (e) { var n = e[a]; if (n) return n.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var i = -1, o = function n() { for (; ++i < e.length;) { if (r.call(e, i)) return n.value = e[i], n.done = !1, n; } return n.value = t, n.done = !0, n; }; return o.next = o; } } return { next: L }; } function L() { return { value: t, done: !0 }; } }(function () { return this || "object" == (typeof self === "undefined" ? "undefined" : _typeof(self)) && self; }() || Function("return this")()); var c = new Uint8Array([88, 0, 0, 0]), f = new Uint8Array([26, 165, 74, 6, 73, 7, 72, 8, 71, 9, 70, 10, 69, 11, 68, 12, 67, 13, 66, 14, 65]), h = new Uint8Array([24, 255, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), l = new Uint8Array([25, 255, 0, 255, 255, 255, 255]), p = new Uint8Array([27, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0]), d = { HEADER: c, INIT: f, DISCONNECT: new Uint8Array([84]), START_MEASUREMENTS: h, STOP_MEASUREMENTS: l, SET_MEASUREMENT_PERIOD: p, GET_INFO: new Uint8Array([85]), GET_STATUS: new Uint8Array([16]), GET_SENSOR_IDS: new Uint8Array([81]), GET_SENSOR_INFO: new Uint8Array([80, 0]), GET_DEFAULT_SENSORS_MASK: new Uint8Array([86]) }, m = 6, v = 7, g = 10, y = 8, b = 9, w = 11, _ = 12, k = 13, x = 14, E = 32, S = function S(e) { return 0 !== e; }, R = function () { function e() { n(this, e), this._listenerMap = new Map(); } return i(e, [{ key: "on", value: function value(e, t) { this._listenerMap.has(e) || this._listenerMap.set(e, []), this._listenerMap.get(e).push(t); } }, { key: "off", value: function value(e, t) { var n = this._listenerMap.get(e); if (n && n.length) { var r = n.reduce(function (e, n, r) { return "function" == typeof n && n === t ? e = r : e; }, -1); if (r > -1) return n.splice(r, 1), this._listenerMap.set(e, n), !0; } return !1; } }, { key: "unbind", value: function value() { this._listenerMap.clear(); } }, { key: "emit", value: function value(e) { for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++) { n[r - 1] = arguments[r]; } var i = this._listenerMap.get(e); return !(!i || !i.length) && (i.forEach(function (e) { e.apply(void 0, n); }), !0); } }]), e; }(), U = function U() {}, M = function M() {}; function A(e) { return Array.from(new Uint8Array(e)).map(function (e) { return e.toString(16).padStart(2, "0"); }).join(" "); } var C, L = function e() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; n(this, e), this.type = t.type, this.mode = t.mode, this.minValue = t.minValue, this.maxValue = t.maxValue, this.uncertainty = t.uncertainty, this.minPeriod = t.minPeriod, this.maxPeriod = t.maxPeriod, this.typicalPeriod = t.typicalPeriod, this.granularity = t.granularity; }, P = function e() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; n(this, e), this.number = t.number, this.name = t.name, this.unit = t.unit, this.id = t.id, this.mutalExclusionMask = t.mutalExclusionMask, this.measurementInfo = t.measurementInfo; }, T = function (e) { function t(e) { var r; return n(this, t), (r = u(this, o(t).call(this))).number = e.number, r.name = e.name, r.unit = e.unit, r.specs = e, r.enabled = !1, r.values = [], r.value = null, r; } return a(t, R), i(t, [{ key: "clear", value: function value() { this.value = null, this.values = []; } }, { key: "setValue", value: function value(e, t) { this.value = e, t && this.values.push(this.value), this.emit("value-changed", this); } }, { key: "setEnabled", value: function value(e) { this.enabled !== e && (this.enabled = e, this.emit("state-changed", this)); } }]), t; }(), N = function (e) { function r(e) { var t; if (n(this, r), t = u(this, o(r).call(this)), "undefined" == typeof TextDecoder) { var i = __webpack_require__(/*! text-encoding */ "./node_modules/text-encoding/index.js"); C = i.TextDecoder; } else C = TextDecoder; return t.device = e, t.sensors = [], t.opened = !1, t.rollingCounter = 0, t.collecting = !1, t.measurementPeriod = 10, t.response = null, t.remainingResponseLength = 0, t.defaultSensorsMask = 0, t.keepValues = !0, t.minMeasurementPeriod = 10, t.serialNumber = "", t.orderCode = "", t.name = "", t; } return a(r, R), i(r, [{ key: "getBatteryLevel", value: function () { var e = t(regeneratorRuntime.mark(function e() { var t; return regeneratorRuntime.wrap(function (e) { for (;;) { switch (e.prev = e.next) { case 0: return e.next = 2, this._getStatus(); case 2: return t = e.sent, e.abrupt("return", t.battery); case 4: case "end": return e.stop(); } } }, e, this); })); return function () { return e.apply(this, arguments); }; }() }, { key: "getChargingState", value: function () { var e = t(regeneratorRuntime.mark(function e() { var t; return regeneratorRuntime.wrap(function (e) { for (;;) { switch (e.prev = e.next) { case 0: return e.next = 2, this._getStatus(); case 2: return t = e.sent, e.abrupt("return", t.chargingStatus); case 4: case "end": return e.stop(); } } }, e, this); })); return function () { return e.apply(this, arguments); }; }() }, { key: "open", value: function () { var e = t(regeneratorRuntime.mark(function e() { var t, n = arguments; return regeneratorRuntime.wrap(function (e) { for (;;) { switch (e.prev = e.next) { case 0: return t = n.length > 0 && void 0 !== n[0] && n[0], e.prev = 1, e.next = 4, this._connect(); case 4: return e.next = 6, this._init(); case 6: return e.next = 8, this._getStatus(); case 8: return e.next = 10, this._getDeviceInfo(); case 10: return e.next = 12, this._getDefaultSensorsMask(); case 12: return e.next = 14, this._getAvailableSensors(); case 14: this._onOpened(), t && this.start(), e.next = 21; break; case 18: e.prev = 18, e.t0 = e.catch(1), console.error(e.t0); case 21: case "end": return e.stop(); } } }, e, this, [[1, 18]]); })); return function () { return e.apply(this, arguments); }; }() }, { key: "close", value: function () { var e = t(regeneratorRuntime.mark(function e() { return regeneratorRuntime.wrap(function (e) { for (;;) { switch (e.prev = e.next) { case 0: return e.next = 2, this._stopMeasurements(); case 2: return e.next = 4, this._sendCommand(d.DISCONNECT); case 4: return e.abrupt("return", this._disconnect()); case 5: case "end": return e.stop(); } } }, e, this); })); return function () { return e.apply(this, arguments); }; }() }, { key: "enableDefaultSensors", value: function value() { for (var e = 1, t = 0; t < 32; ++t) { if ((this.defaultSensorsMask & e) === e) { var n = this.getSensor(t); n && n.setEnabled(!0); } e <<= 1; } } }, { key: "start", value: function value() { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null, t = this.sensors.filter(function (e) { return e.enabled; }); 0 === t.length && (this.enableDefaultSensors(), t = this.sensors.filter(function (e) { return e.enabled; })), t.forEach(function (e) { return e.clear(); }), e && (this.measurementPeriod = e), this._startMeasurements(); } }, { key: "stop", value: function value() { this._stopMeasurements(); } }, { key: "getSensor", value: function value(e) { return this.sensors.find(function (t) { return t.number === e; }); } }, { key: "_connect", value: function () { var e = t(regeneratorRuntime.mark(function e() { var t = this; return regeneratorRuntime.wrap(function (e) { for (;;) { switch (e.prev = e.next) { case 0: return e.abrupt("return", this.device.setup({ onClosed: function onClosed() { return t._onClosed(); }, onResponse: function onResponse(e) { return t._handleResponse(e); } })); case 1: case "end": return e.stop(); } } }, e, this); })); return function () { return e.apply(this, arguments); }; }() }, { key: "_disconnect", value: function () { var e = t(regeneratorRuntime.mark(function e() { return regeneratorRuntime.wrap(function (e) { for (;;) { switch (e.prev = e.next) { case 0: return e.abrupt("return", this.device.close()); case 1: case "end": return e.stop(); } } }, e, this); })); return function () { return e.apply(this, arguments); }; }() }, { key: "_init", value: function value() { return this.collecting = !1, this.rollingCounter = 255, this.writeQueue = [], this._sendCommand(d.INIT); } }, { key: "_handleResponse", value: function value(e) { if (U("command notified: ".concat(A(e.buffer))), this.remainingResponseLegnth > 0) { if (this.remainingResponseLegnth -= e.buffer.byteLength, this.response = new DataView((t = this.response.buffer, n = e.buffer.slice(0), (r = new Uint8Array(t.byteLength + n.byteLength)).set(new Uint8Array(t), 0), r.set(new Uint8Array(n), t.byteLength), r.buffer)), this.remainingResponseLegnth > 0) return; } else this.response = e; var t, n, r, i = this.response.getUint8(1); if (i > this.response.buffer.byteLength) this.remainingResponseLegnth = i - this.response.buffer.byteLength;else switch (U("handle command: ".concat(A(this.response.buffer))), this.response.getUint8(0)) { case E: this._processMeasurements(this.response); break; default: var a = this.response.getUint8(4), o = this.response.getUint8(5), s = new DataView(this.response.buffer, 6); this._resolveWriteCommand(a, o, s), this.remainingResponseLegnth = 0, this.response = null; } } }, { key: "_getSensorsWithMask", value: function value(e) { for (var t = [], n = 1, r = 0; r < 32; ++r) { if ((e & n) === n) { var i = this.getSensor(r); i && (t.push(i), U("available: [".concat(e, "] ").concat(t[t.length - 1].number))); } n <<= 1; } return t; } }, { key: "_processMeasurements", value: function value(e) { var t = [], n = !0, r = 0, i = 0, a = e.getUint8(4); switch (a) { case m: t = this._getSensorsWithMask(e.getUint16(5, !0)), r = e.getUint8(7, !0), i = 9; break; case v: t = this._getSensorsWithMask(e.getUint32(5, !0)), r = e.getUint8(9, !0), i = 11; break; case g: case y: t[0] = this.getSensor(e.getUint8(6)), r = e.getUint8(7, !0), i = 8; break; case w: case b: t[0] = this.getSensor(e.getUint8(6)), r = e.getUint8(7, !0), i = 8, n = !1; break; case _: case k: case x: U("Purposely Ignoring packet type: ".concat(a)); break; default: U("Unknown packet type: ".concat(a)); } for (var o = 0; o < r; ++o) { for (var s = 0; s < t.length; ++s) { n ? t[s].setValue(e.getFloat32(i, !0), this.keepValues) : t[s].setValue(e.getInt32(i, !0), this.keepValues), i += 4; } } } }, { key: "_resolveWriteCommand", value: function value(e, t, n) { var r = this.writeQueue.find(function (n) { return n.command === e && n.rollingCounter === t; }); r && (r.resolve(n), this.writeQueue = this.writeQueue.filter(function (e) { return e !== r; })); } }, { key: "_onOpened", value: function value() { U("opened"), this.opened = !0, this.emit("device-opened"); } }, { key: "_onClosed", value: function value() { U("closed"), this.opened = !1, this.emit("device-closed"); } }, { key: "_decRollingCounter", value: function value() { return this.rollingCounter -= 1, this.rollingCounter; } }, { key: "_calculateChecksum", value: function value(e) { for (var t = e[1], n = -1 * e[3], r = 0; r < t; ++r) { n += e[r], n &= 255; } return n < 0 || n > 255 ? (U("Checksum failed!"), 0) : n; } }, { key: "_sendCommand", value: function value(e) { var t = new Uint8Array(d.HEADER.byteLength + e.byteLength); return t.set(new Uint8Array(d.HEADER), 0), t.set(new Uint8Array(e), d.HEADER.byteLength), t[1] = t.length, t[2] = this._decRollingCounter(), t[3] = this._calculateChecksum(t), this._queueWriteCommand(t, 0, t.length); } }, { key: "_writeCommand", value: function () { var e = t(regeneratorRuntime.mark(function e(t, n, r) { var i; return regeneratorRuntime.wrap(function (e) { for (;;) { switch (e.prev = e.next) { case 0: if (!(r > 0)) { e.next = 12; break; } return e.prev = 1, r > 20 ? (i = t.subarray(n, n + 20), r -= 20, n += 20) : (i = t.subarray(n, n + r), r = 0), e.next = 5, this.device.writeCommand(i); case 5: e.next = 10; break; case 7: e.prev = 7, e.t0 = e.catch(1), U("Write Failure: ".concat(e.t0)); case 10: e.next = 0; break; case 12: case "end": return e.stop(); } } }, e, this, [[1, 7]]); })); return function (t, n, r) { return e.apply(this, arguments); }; }() }, { key: "_queueWriteCommand", value: function value(e, t, n) { var r = this; U("command queued: ".concat(A(e))); var i = new Promise(function (t, n) { r.writeQueue.push({ command: e[4], rollingCounter: e[2], resolve: t, reject: n }), setTimeout(function () { r.writeQueue = r.writeQueue.filter(function (t) { return t.command === e[4] && t.rollingCounter !== e[2]; }), n(new Error("write command timed out after 5s. Command: ".concat(e[4].toString(16), " Rolling Counter: ").concat(e[2].toString(16)))); }, 1e4); }); return this._writeCommand(e, t, n), i; } }, { key: "_getStatus", value: function () { var e = t(regeneratorRuntime.mark(function e() { var t, n; return regeneratorRuntime.wrap(function (e) { for (;;) { switch (e.prev = e.next) { case 0: return e.next = 2, this._sendCommand(d.GET_STATUS); case 2: return t = e.sent, n = { masterFirmwareVersion: "".concat(t.getUint8(2), ".").concat(t.getUint8(3)), bleFirmwareVersion: "".concat(t.getUint8(6), ".").concat(t.getUint8(9)), battery: t.getUint8(10), chargingStatus: "".concat(t.getUint8(11)) }, e.abrupt("return", n); case 5: case "end": return e.stop(); } } }, e, this); })); return function () { return e.apply(this, arguments); }; }() }, { key: "_getAvailableSensors", value: function () { var e = t(regeneratorRuntime.mark(function e() { var t, n, r = this; return regeneratorRuntime.wrap(function (e) { for (;;) { switch (e.prev = e.next) { case 0: return e.next = 2, this._sendCommand(d.GET_SENSOR_IDS).then(function (e) { r.availableSensors = e.getUint32(0, !0), U("Get Available Sensors Returned ".concat(r.availableSensors)); }); case 2: t = 1, n = 0; case 4: if (!(n < 31)) { e.next = 12; break; } if ((this.availableSensors & t) !== t) { e.next = 8; break; } return e.next = 8, this._getSensorInfo(n); case 8: t <<= 1; case 9: ++n, e.next = 4; break; case 12: case "end": return e.stop(); } } }, e, this); })); return function () { return e.apply(this, arguments); }; }() }, { key: "_getDefaultSensorsMask", value: function value() { var e = this; return this._sendCommand(d.GET_DEFAULT_SENSORS_MASK).then(function (t) { e.defaultSensorsMask = t.getUint32(0, !0), U("Default Sensors:"), M(e); }); } }, { key: "_getDeviceInfo", value: function value() { var e = this; return this._sendCommand(d.GET_INFO).then(function (t) { var n = new C("utf-8"); e.orderCode = n.decode(new Uint8Array(t.buffer, 6, 16).filter(S)), e.serialNumber = n.decode(new Uint8Array(t.buffer, 22, 16).filter(S)), e.name = n.decode(new Uint8Array(t.buffer, 38, 32).filter(S)), U("Device Info:"), M(e); }); } }, { key: "_getSensorInfo", value: function () { var e = t(regeneratorRuntime.mark(function e(t) { var n, r = this; return regeneratorRuntime.wrap(function (e) { for (;;) { switch (e.prev = e.next) { case 0: return (n = new Uint8Array(d.GET_SENSOR_INFO))[1] = t, e.abrupt("return", this._sendCommand(n).then(function (e) { var t = e.getUint32(2, !0); if (t > 0) { var n = new C("utf-8"), i = new L({ type: e.getUint8(6), mode: e.getUint8(7), minValue: e.getFloat64(108, !0), maxValue: e.getFloat64(116, !0), uncertainty: e.getFloat64(100, !0), minPeriod: e.getUint32(124, !0) / 1e3, maxPeriod: ((e.getUint32(132, !0) << 32) + e.getUint32(128, !0)) / 1e3, typicalPeriod: e.getUint32(136, !0) / 1e3, granularity: e.getUint32(140, !0) / 1e3 }), a = new P({ number: e.getUint8(0), name: n.decode(new Uint8Array(e.buffer, 14, 60).filter(S)), unit: n.decode(new Uint8Array(e.buffer, 74, 32).filter(S)), mutalExclusiveMask: e.getUint32(144, !0), measurementInfo: i, sensorId: t }), o = new T(a); U("Get Sensor Info Returned"), M(o), r.sensors.push(o), o.on("state-changed", function () { U("Sensor Restart: ".concat(o.number)), o.enabled && (r.measurementPeriod = o.specs.measurementInfo.typicalPeriod, r.sensors.forEach(function (e) { if (o.number !== e.number && e.enabled) { var t = 1 << e.number; (t & o.specs.mutalExclusiveMask) === t ? e.enabled = !1 : e.specs.measurementInfo.typicalPeriod > r.measurementPeriod && (r.measurementPeriod = e.specs.measurementInfo.typicalPeriod); } })), r._restartMeasurements(); }); } })); case 3: case "end": return e.stop(); } } }, e, this); })); return function (t) { return e.apply(this, arguments); }; }() }, { key: "_restartMeasurements", value: function () { var e = t(regeneratorRuntime.mark(function e() { var t; return regeneratorRuntime.wrap(function (e) { for (;;) { switch (e.prev = e.next) { case 0: if (t = this.collecting, !this.collecting) { e.next = 10; break; } return e.prev = 2, e.next = 5, this._stopMeasurements(); case 5: e.next = 10; break; case 7: e.prev = 7, e.t0 = e.catch(2), console.error(e.t0); case 10: if (this.collecting || !t) { e.next = 19; break; } return e.prev = 11, e.next = 14, this._startMeasurements(); case 14: e.next = 19; break; case 16: e.prev = 16, e.t1 = e.catch(11), console.error(e.t1); case 19: case "end": return e.stop(); } } }, e, this, [[2, 7], [11, 16]]); })); return function () { return e.apply(this, arguments); }; }() }, { key: "_setMeasurementPeriod", value: function value(e) { var t = new Uint8Array(d.SET_MEASUREMENT_PERIOD), n = 1e3 * this.minMeasurementPeriod; return e < n && (e = n), U("MeasurementPeriod: ".concat(e)), t[3] = e >> 0 & 255, t[4] = e >> 8 & 255, t[5] = e >> 16 & 255, t[6] = e >> 24 & 255, this._sendCommand(t); } }, { key: "_getEnabledChannelMask", value: function value() { var e = 0; return this.sensors.filter(function (e) { return e.enabled; }).forEach(function (t) { e += 1 << t.number; }), e; } }, { key: "_startMeasurements", value: function value() { var e = this; return this._setMeasurementPeriod(1e3 * this.measurementPeriod).then(function () { var t = e._getEnabledChannelMask(); U("ChannelMask: ".concat(t)); var n = new Uint8Array(d.START_MEASUREMENTS); return n[3] = t >> 0 & 255, n[4] = t >> 8 & 255, n[5] = t >> 16 & 255, n[6] = t >> 24 & 255, e._sendCommand(n).then(function (t) { 0 === t.getUint8(0) && (e.collecting = !0, e.emit("measurements-started")); }); }); } }, { key: "_stopMeasurements", value: function value() { var e = this; return this._sendCommand(d.STOP_MEASUREMENTS).then(function (t) { 0 === t.getUint8(0) && (e.collecting = !1, e.emit("measurements-stopped")); }); } }]), r; }(), O = function () { function e(t) { n(this, e), this.webBluetoothNativeDevice = t, this.deviceCommand = null, this.deviceResponse = null; } return i(e, [{ key: "writeCommand", value: function () { var e = t(regeneratorRuntime.mark(function e(t) { return regeneratorRuntime.wrap(function (e) { for (;;) { switch (e.prev = e.next) { case 0: return e.abrupt("return", this.deviceCommand.writeValue(t)); case 1: case "end": return e.stop(); } } }, e, this); })); return function (t) { return e.apply(this, arguments); }; }() }, { key: "setup", value: function () { var e = t(regeneratorRuntime.mark(function e(t) { var n, r, i, a, o = this; return regeneratorRuntime.wrap(function (e) { for (;;) { switch (e.prev = e.next) { case 0: return n = t.onClosed, r = t.onResponse, this.webBluetoothNativeDevice.addEventListener("gattserverdisconnected", n), e.prev = 2, e.next = 5, this.webBluetoothNativeDevice.gatt.connect(); case 5: return i = e.sent, e.next = 8, i.getPrimaryService("d91714ef-28b9-4f91-ba16-f0d9a604f112"); case 8: return a = e.sent, e.next = 11, a.getCharacteristics(); case 11: e.sent.forEach(function (e) { switch (e.uuid) { case "f4bf14a6-c7d5-4b6d-8aa8-df1a7c83adcb": o.deviceCommand = e; break; case "b41e6675-a329-40e0-aa01-44d2f444babe": o.deviceResponse = e, o.deviceResponse.addEventListener("characteristicvaluechanged", function (e) { var t = e.target.value; r(t); }), o.deviceResponse.startNotifications(); break; default: U("No case found for ".concat(e.uuid)); } }), e.next = 18; break; case 15: e.prev = 15, e.t0 = e.catch(2), console.error(e.t0); case 18: if (this.deviceCommand && this.deviceResponse) { e.next = 20; break; } throw new Error("Expected command and response characteristics not found."); case 20: case "end": return e.stop(); } } }, e, this, [[2, 15]]); })); return function (t) { return e.apply(this, arguments); }; }() }, { key: "close", value: function () { var e = t(regeneratorRuntime.mark(function e() { return regeneratorRuntime.wrap(function (e) { for (;;) { switch (e.prev = e.next) { case 0: return e.abrupt("return", this.webBluetoothNativeDevice.gatt.disconnect()); case 1: case "end": return e.stop(); } } }, e, this); })); return function () { return e.apply(this, arguments); }; }() }, { key: "godirectAdapter", get: function get() { return !0; } }]), e; }(), D = { createDevice: function () { var e = t(regeneratorRuntime.mark(function e(t) { var n, r, i, a, o, s, u, c = arguments; return regeneratorRuntime.wrap(function (e) { for (;;) { switch (e.prev = e.next) { case 0: if (n = c.length > 1 && void 0 !== c[1] ? c[1] : {}, r = n.open, i = void 0 === r || r, a = n.startMeasurements, o = void 0 === a || a, (s = t).godirectAdapter || (s = new O(t)), u = new N(s), !i) { e.next = 14; break; } return e.prev = 5, e.next = 8, u.open(o); case 8: e.next = 14; break; case 10: throw e.prev = 10, e.t0 = e.catch(5), console.error(e.t0), e.t0; case 14: return e.abrupt("return", u); case 15: case "end": return e.stop(); } } }, e, this, [[5, 10]]); })); return function (t) { return e.apply(this, arguments); }; }(), selectDevice: function () { var e = t(regeneratorRuntime.mark(function e() { var t; return regeneratorRuntime.wrap(function (e) { for (;;) { switch (e.prev = e.next) { case 0: if (navigator.bluetooth) { e.next = 2; break; } return e.abrupt("return", Promise.reject(new Error("No Web Bluetooth support."))); case 2: return e.next = 4, navigator.bluetooth.requestDevice({ filters: [{ namePrefix: "GDX" }], optionalServices: ["d91714ef-28b9-4f91-ba16-f0d9a604f112"] }); case 4: return t = e.sent, e.abrupt("return", D.createDevice(t)); case 6: case "end": return e.stop(); } } }, e, this); })); return function () { return e.apply(this, arguments); }; }() }; return D; }); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) /***/ }), /***/ "./node_modules/acorn/dist/acorn.mjs": /*!*******************************************!*\ !*** ./node_modules/acorn/dist/acorn.mjs ***! \*******************************************/ /*! exports provided: version, parse, parseExpressionAt, tokenizer, Parser, defaultOptions, Position, SourceLocation, getLineInfo, Node, TokenType, tokTypes, keywordTypes, TokContext, tokContexts, isIdentifierChar, isIdentifierStart, Token, isNewLine, lineBreak, lineBreakG, nonASCIIwhitespace */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "version", function() { return version; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parse", function() { return parse; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseExpressionAt", function() { return parseExpressionAt; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tokenizer", function() { return tokenizer; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Parser", function() { return Parser; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultOptions", function() { return defaultOptions; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Position", function() { return Position; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SourceLocation", function() { return SourceLocation; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLineInfo", function() { return getLineInfo; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Node", function() { return Node; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TokenType", function() { return TokenType; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tokTypes", function() { return types; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "keywordTypes", function() { return keywords$1; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TokContext", function() { return TokContext; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tokContexts", function() { return types$1; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isIdentifierChar", function() { return isIdentifierChar; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isIdentifierStart", function() { return isIdentifierStart; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Token", function() { return Token; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNewLine", function() { return isNewLine; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lineBreak", function() { return lineBreak; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lineBreakG", function() { return lineBreakG; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "nonASCIIwhitespace", function() { return nonASCIIwhitespace; }); // Reserved word lists for various dialects of the language var reservedWords = { 3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile", 5: "class enum extends super const export import", 6: "enum", strict: "implements interface let package private protected public static yield", strictBind: "eval arguments" }; // And the keywords var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"; var keywords = { 5: ecma5AndLessKeywords, 6: ecma5AndLessKeywords + " const class extends export import super" }; var keywordRelationalOperator = /^in(stanceof)?$/; // ## Character categories // Big ugly regular expressions that match characters in the // whitespace, identifier, and identifier-start categories. These // are only applied when a character is found to actually have a // code point above 128. // Generated by `bin/generate-identifier-regex.js`. var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08bd\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fef\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7b9\ua7f7-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab65\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; // These are a run-length and offset encoded representation of the // >0xffff code points that are a valid part of identifiers. The // offset starts at 0x10000, and each pair of numbers represents an // offset to the next range, and then a size of the range. They were // generated by bin/generate-identifier-regex.js // eslint-disable-next-line comma-spacing var astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,477,28,11,0,9,21,190,52,76,44,33,24,27,35,30,0,12,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,54,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,86,26,230,43,117,63,32,0,257,0,11,39,8,0,22,0,12,39,3,3,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,270,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,68,12,0,67,12,65,1,31,6129,15,754,9486,286,82,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,4149,196,60,67,1213,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,15,7472,3104,541]; // eslint-disable-next-line comma-spacing var astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,525,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,4,9,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,280,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1016,45,17,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,2214,6,110,6,6,9,792487,239]; // This has a complexity linear to the value of the code. The // assumption is that looking up astral identifier characters is // rare. function isInAstralSet(code, set) { var pos = 0x10000; for (var i = 0; i < set.length; i += 2) { pos += set[i]; if (pos > code) { return false } pos += set[i + 1]; if (pos >= code) { return true } } } // Test whether a given character code starts an identifier. function isIdentifierStart(code, astral) { if (code < 65) { return code === 36 } if (code < 91) { return true } if (code < 97) { return code === 95 } if (code < 123) { return true } if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)) } if (astral === false) { return false } return isInAstralSet(code, astralIdentifierStartCodes) } // Test whether a given character is part of an identifier. function isIdentifierChar(code, astral) { if (code < 48) { return code === 36 } if (code < 58) { return true } if (code < 65) { return false } if (code < 91) { return true } if (code < 97) { return code === 95 } if (code < 123) { return true } if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) } if (astral === false) { return false } return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes) } // ## Token types // The assignment of fine-grained, information-carrying type objects // allows the tokenizer to store the information it has about a // token in a way that is very cheap for the parser to look up. // All token type variables start with an underscore, to make them // easy to recognize. // The `beforeExpr` property is used to disambiguate between regular // expressions and divisions. It is set on all token types that can // be followed by an expression (thus, a slash after them would be a // regular expression). // // The `startsExpr` property is used to check if the token ends a // `yield` expression. It is set on all token types that either can // directly start an expression (like a quotation mark) or can // continue an expression (like the body of a string). // // `isLoop` marks a keyword as starting a loop, which is important // to know when parsing a label, in order to allow or disallow // continue jumps to that label. var TokenType = function TokenType(label, conf) { if ( conf === void 0 ) conf = {}; this.label = label; this.keyword = conf.keyword; this.beforeExpr = !!conf.beforeExpr; this.startsExpr = !!conf.startsExpr; this.isLoop = !!conf.isLoop; this.isAssign = !!conf.isAssign; this.prefix = !!conf.prefix; this.postfix = !!conf.postfix; this.binop = conf.binop || null; this.updateContext = null; }; function binop(name, prec) { return new TokenType(name, {beforeExpr: true, binop: prec}) } var beforeExpr = {beforeExpr: true}; var startsExpr = {startsExpr: true}; // Map keyword names to token types. var keywords$1 = {}; // Succinct definitions of keyword token types function kw(name, options) { if ( options === void 0 ) options = {}; options.keyword = name; return keywords$1[name] = new TokenType(name, options) } var types = { num: new TokenType("num", startsExpr), regexp: new TokenType("regexp", startsExpr), string: new TokenType("string", startsExpr), name: new TokenType("name", startsExpr), eof: new TokenType("eof"), // Punctuation token types. bracketL: new TokenType("[", {beforeExpr: true, startsExpr: true}), bracketR: new TokenType("]"), braceL: new TokenType("{", {beforeExpr: true, startsExpr: true}), braceR: new TokenType("}"), parenL: new TokenType("(", {beforeExpr: true, startsExpr: true}), parenR: new TokenType(")"), comma: new TokenType(",", beforeExpr), semi: new TokenType(";", beforeExpr), colon: new TokenType(":", beforeExpr), dot: new TokenType("."), question: new TokenType("?", beforeExpr), arrow: new TokenType("=>", beforeExpr), template: new TokenType("template"), invalidTemplate: new TokenType("invalidTemplate"), ellipsis: new TokenType("...", beforeExpr), backQuote: new TokenType("`", startsExpr), dollarBraceL: new TokenType("${", {beforeExpr: true, startsExpr: true}), // Operators. These carry several kinds of properties to help the // parser use them properly (the presence of these properties is // what categorizes them as operators). // // `binop`, when present, specifies that this operator is a binary // operator, and will refer to its precedence. // // `prefix` and `postfix` mark the operator as a prefix or postfix // unary operator. // // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as // binary operators with a very low precedence, that should result // in AssignmentExpression nodes. eq: new TokenType("=", {beforeExpr: true, isAssign: true}), assign: new TokenType("_=", {beforeExpr: true, isAssign: true}), incDec: new TokenType("++/--", {prefix: true, postfix: true, startsExpr: true}), prefix: new TokenType("!/~", {beforeExpr: true, prefix: true, startsExpr: true}), logicalOR: binop("||", 1), logicalAND: binop("&&", 2), bitwiseOR: binop("|", 3), bitwiseXOR: binop("^", 4), bitwiseAND: binop("&", 5), equality: binop("==/!=/===/!==", 6), relational: binop("/<=/>=", 7), bitShift: binop("<>/>>>", 8), plusMin: new TokenType("+/-", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}), modulo: binop("%", 10), star: binop("*", 10), slash: binop("/", 10), starstar: new TokenType("**", {beforeExpr: true}), // Keyword token types. _break: kw("break"), _case: kw("case", beforeExpr), _catch: kw("catch"), _continue: kw("continue"), _debugger: kw("debugger"), _default: kw("default", beforeExpr), _do: kw("do", {isLoop: true, beforeExpr: true}), _else: kw("else", beforeExpr), _finally: kw("finally"), _for: kw("for", {isLoop: true}), _function: kw("function", startsExpr), _if: kw("if"), _return: kw("return", beforeExpr), _switch: kw("switch"), _throw: kw("throw", beforeExpr), _try: kw("try"), _var: kw("var"), _const: kw("const"), _while: kw("while", {isLoop: true}), _with: kw("with"), _new: kw("new", {beforeExpr: true, startsExpr: true}), _this: kw("this", startsExpr), _super: kw("super", startsExpr), _class: kw("class", startsExpr), _extends: kw("extends", beforeExpr), _export: kw("export"), _import: kw("import"), _null: kw("null", startsExpr), _true: kw("true", startsExpr), _false: kw("false", startsExpr), _in: kw("in", {beforeExpr: true, binop: 7}), _instanceof: kw("instanceof", {beforeExpr: true, binop: 7}), _typeof: kw("typeof", {beforeExpr: true, prefix: true, startsExpr: true}), _void: kw("void", {beforeExpr: true, prefix: true, startsExpr: true}), _delete: kw("delete", {beforeExpr: true, prefix: true, startsExpr: true}) }; // Matches a whole line break (where CRLF is considered a single // line break). Used to count lines. var lineBreak = /\r\n?|\n|\u2028|\u2029/; var lineBreakG = new RegExp(lineBreak.source, "g"); function isNewLine(code, ecma2019String) { return code === 10 || code === 13 || (!ecma2019String && (code === 0x2028 || code === 0x2029)) } var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/; var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; var ref = Object.prototype; var hasOwnProperty = ref.hasOwnProperty; var toString = ref.toString; // Checks if an object has a property. function has(obj, propName) { return hasOwnProperty.call(obj, propName) } var isArray = Array.isArray || (function (obj) { return ( toString.call(obj) === "[object Array]" ); }); function wordsRegexp(words) { return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$") } // These are used when `options.locations` is on, for the // `startLoc` and `endLoc` properties. var Position = function Position(line, col) { this.line = line; this.column = col; }; Position.prototype.offset = function offset (n) { return new Position(this.line, this.column + n) }; var SourceLocation = function SourceLocation(p, start, end) { this.start = start; this.end = end; if (p.sourceFile !== null) { this.source = p.sourceFile; } }; // The `getLineInfo` function is mostly useful when the // `locations` option is off (for performance reasons) and you // want to find the line/column position for a given character // offset. `input` should be the code string that the offset refers // into. function getLineInfo(input, offset) { for (var line = 1, cur = 0;;) { lineBreakG.lastIndex = cur; var match = lineBreakG.exec(input); if (match && match.index < offset) { ++line; cur = match.index + match[0].length; } else { return new Position(line, offset - cur) } } } // A second optional argument can be given to further configure // the parser process. These options are recognized: var defaultOptions = { // `ecmaVersion` indicates the ECMAScript version to parse. Must be // either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018), or 10 // (2019). This influences support for strict mode, the set of // reserved words, and support for new syntax features. The default // is 9. ecmaVersion: 9, // `sourceType` indicates the mode the code should be parsed in. // Can be either `"script"` or `"module"`. This influences global // strict mode and parsing of `import` and `export` declarations. sourceType: "script", // `onInsertedSemicolon` can be a callback that will be called // when a semicolon is automatically inserted. It will be passed // the position of the comma as an offset, and if `locations` is // enabled, it is given the location as a `{line, column}` object // as second argument. onInsertedSemicolon: null, // `onTrailingComma` is similar to `onInsertedSemicolon`, but for // trailing commas. onTrailingComma: null, // By default, reserved words are only enforced if ecmaVersion >= 5. // Set `allowReserved` to a boolean value to explicitly turn this on // an off. When this option has the value "never", reserved words // and keywords can also not be used as property names. allowReserved: null, // When enabled, a return at the top level is not considered an // error. allowReturnOutsideFunction: false, // When enabled, import/export statements are not constrained to // appearing at the top of the program. allowImportExportEverywhere: false, // When enabled, await identifiers are allowed to appear at the top-level scope, // but they are still not allowed in non-async functions. allowAwaitOutsideFunction: false, // When enabled, hashbang directive in the beginning of file // is allowed and treated as a line comment. allowHashBang: false, // When `locations` is on, `loc` properties holding objects with // `start` and `end` properties in `{line, column}` form (with // line being 1-based and column 0-based) will be attached to the // nodes. locations: false, // A function can be passed as `onToken` option, which will // cause Acorn to call that function with object in the same // format as tokens returned from `tokenizer().getToken()`. Note // that you are not allowed to call the parser from the // callback—that will corrupt its internal state. onToken: null, // A function can be passed as `onComment` option, which will // cause Acorn to call that function with `(block, text, start, // end)` parameters whenever a comment is skipped. `block` is a // boolean indicating whether this is a block (`/* */`) comment, // `text` is the content of the comment, and `start` and `end` are // character offsets that denote the start and end of the comment. // When the `locations` option is on, two more parameters are // passed, the full `{line, column}` locations of the start and // end of the comments. Note that you are not allowed to call the // parser from the callback—that will corrupt its internal state. onComment: null, // Nodes have their start and end characters offsets recorded in // `start` and `end` properties (directly on the node, rather than // the `loc` object, which holds line/column data. To also add a // [semi-standardized][range] `range` property holding a `[start, // end]` array with the same numbers, set the `ranges` option to // `true`. // // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678 ranges: false, // It is possible to parse multiple files into a single AST by // passing the tree produced by parsing the first file as // `program` option in subsequent parses. This will add the // toplevel forms of the parsed file to the `Program` (top) node // of an existing parse tree. program: null, // When `locations` is on, you can pass this to record the source // file in every node's `loc` object. sourceFile: null, // This value, if given, is stored in every node, whether // `locations` is on or off. directSourceFile: null, // When enabled, parenthesized expressions are represented by // (non-standard) ParenthesizedExpression nodes preserveParens: false }; // Interpret and default an options object function getOptions(opts) { var options = {}; for (var opt in defaultOptions) { options[opt] = opts && has(opts, opt) ? opts[opt] : defaultOptions[opt]; } if (options.ecmaVersion >= 2015) { options.ecmaVersion -= 2009; } if (options.allowReserved == null) { options.allowReserved = options.ecmaVersion < 5; } if (isArray(options.onToken)) { var tokens = options.onToken; options.onToken = function (token) { return tokens.push(token); }; } if (isArray(options.onComment)) { options.onComment = pushComment(options, options.onComment); } return options } function pushComment(options, array) { return function(block, text, start, end, startLoc, endLoc) { var comment = { type: block ? "Block" : "Line", value: text, start: start, end: end }; if (options.locations) { comment.loc = new SourceLocation(this, startLoc, endLoc); } if (options.ranges) { comment.range = [start, end]; } array.push(comment); } } // Each scope gets a bitset that may contain these flags var SCOPE_TOP = 1; var SCOPE_FUNCTION = 2; var SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION; var SCOPE_ASYNC = 4; var SCOPE_GENERATOR = 8; var SCOPE_ARROW = 16; var SCOPE_SIMPLE_CATCH = 32; var SCOPE_SUPER = 64; var SCOPE_DIRECT_SUPER = 128; function functionFlags(async, generator) { return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0) } // Used in checkLVal and declareName to determine the type of a binding var BIND_NONE = 0; var BIND_VAR = 1; var BIND_LEXICAL = 2; var BIND_FUNCTION = 3; var BIND_SIMPLE_CATCH = 4; var BIND_OUTSIDE = 5; // Special case for function names as bound inside the function var Parser = function Parser(options, input, startPos) { this.options = options = getOptions(options); this.sourceFile = options.sourceFile; this.keywords = wordsRegexp(keywords[options.ecmaVersion >= 6 ? 6 : 5]); var reserved = ""; if (!options.allowReserved) { for (var v = options.ecmaVersion;; v--) { if (reserved = reservedWords[v]) { break } } if (options.sourceType === "module") { reserved += " await"; } } this.reservedWords = wordsRegexp(reserved); var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict; this.reservedWordsStrict = wordsRegexp(reservedStrict); this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind); this.input = String(input); // Used to signal to callers of `readWord1` whether the word // contained any escape sequences. This is needed because words with // escape sequences must not be interpreted as keywords. this.containsEsc = false; // Set up token state // The current position of the tokenizer in the input. if (startPos) { this.pos = startPos; this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1; this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length; } else { this.pos = this.lineStart = 0; this.curLine = 1; } // Properties of the current token: // Its type this.type = types.eof; // For tokens that include more information than their type, the value this.value = null; // Its start and end offset this.start = this.end = this.pos; // And, if locations are used, the {line, column} object // corresponding to those offsets this.startLoc = this.endLoc = this.curPosition(); // Position information for the previous token this.lastTokEndLoc = this.lastTokStartLoc = null; this.lastTokStart = this.lastTokEnd = this.pos; // The context stack is used to superficially track syntactic // context to predict whether a regular expression is allowed in a // given position. this.context = this.initialContext(); this.exprAllowed = true; // Figure out if it's a module code. this.inModule = options.sourceType === "module"; this.strict = this.inModule || this.strictDirective(this.pos); // Used to signify the start of a potential arrow function this.potentialArrowAt = -1; // Positions to delayed-check that yield/await does not exist in default parameters. this.yieldPos = this.awaitPos = this.awaitIdentPos = 0; // Labels in scope. this.labels = []; // Thus-far undefined exports. this.undefinedExports = {}; // If enabled, skip leading hashbang line. if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!") { this.skipLineComment(2); } // Scope tracking for duplicate variable names (see scope.js) this.scopeStack = []; this.enterScope(SCOPE_TOP); // For RegExp validation this.regexpState = null; }; var prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },allowSuper: { configurable: true },allowDirectSuper: { configurable: true },treatFunctionsAsVar: { configurable: true } }; Parser.prototype.parse = function parse () { var node = this.options.program || this.startNode(); this.nextToken(); return this.parseTopLevel(node) }; prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 }; prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 }; prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 }; prototypeAccessors.allowSuper.get = function () { return (this.currentThisScope().flags & SCOPE_SUPER) > 0 }; prototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 }; prototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()) }; // Switch to a getter for 7.0.0. Parser.prototype.inNonArrowFunction = function inNonArrowFunction () { return (this.currentThisScope().flags & SCOPE_FUNCTION) > 0 }; Parser.extend = function extend () { var plugins = [], len = arguments.length; while ( len-- ) plugins[ len ] = arguments[ len ]; var cls = this; for (var i = 0; i < plugins.length; i++) { cls = plugins[i](cls); } return cls }; Parser.parse = function parse (input, options) { return new this(options, input).parse() }; Parser.parseExpressionAt = function parseExpressionAt (input, pos, options) { var parser = new this(options, input, pos); parser.nextToken(); return parser.parseExpression() }; Parser.tokenizer = function tokenizer (input, options) { return new this(options, input) }; Object.defineProperties( Parser.prototype, prototypeAccessors ); var pp = Parser.prototype; // ## Parser utilities var literal = /^(?:'((?:\\.|[^'])*?)'|"((?:\\.|[^"])*?)")/; pp.strictDirective = function(start) { var this$1 = this; for (;;) { // Try to find string literal. skipWhiteSpace.lastIndex = start; start += skipWhiteSpace.exec(this$1.input)[0].length; var match = literal.exec(this$1.input.slice(start)); if (!match) { return false } if ((match[1] || match[2]) === "use strict") { return true } start += match[0].length; // Skip semicolon, if any. skipWhiteSpace.lastIndex = start; start += skipWhiteSpace.exec(this$1.input)[0].length; if (this$1.input[start] === ";") { start++; } } }; // Predicate that tests whether the next token is of the given // type, and if yes, consumes it as a side effect. pp.eat = function(type) { if (this.type === type) { this.next(); return true } else { return false } }; // Tests whether parsed token is a contextual keyword. pp.isContextual = function(name) { return this.type === types.name && this.value === name && !this.containsEsc }; // Consumes contextual keyword if possible. pp.eatContextual = function(name) { if (!this.isContextual(name)) { return false } this.next(); return true }; // Asserts that following token is given contextual keyword. pp.expectContextual = function(name) { if (!this.eatContextual(name)) { this.unexpected(); } }; // Test whether a semicolon can be inserted at the current position. pp.canInsertSemicolon = function() { return this.type === types.eof || this.type === types.braceR || lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) }; pp.insertSemicolon = function() { if (this.canInsertSemicolon()) { if (this.options.onInsertedSemicolon) { this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); } return true } }; // Consume a semicolon, or, failing that, see if we are allowed to // pretend that there is a semicolon at this position. pp.semicolon = function() { if (!this.eat(types.semi) && !this.insertSemicolon()) { this.unexpected(); } }; pp.afterTrailingComma = function(tokType, notNext) { if (this.type === tokType) { if (this.options.onTrailingComma) { this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); } if (!notNext) { this.next(); } return true } }; // Expect a token of a given type. If found, consume it, otherwise, // raise an unexpected token error. pp.expect = function(type) { this.eat(type) || this.unexpected(); }; // Raise an unexpected token error. pp.unexpected = function(pos) { this.raise(pos != null ? pos : this.start, "Unexpected token"); }; function DestructuringErrors() { this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1; } pp.checkPatternErrors = function(refDestructuringErrors, isAssign) { if (!refDestructuringErrors) { return } if (refDestructuringErrors.trailingComma > -1) { this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); } var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind; if (parens > -1) { this.raiseRecoverable(parens, "Parenthesized pattern"); } }; pp.checkExpressionErrors = function(refDestructuringErrors, andThrow) { if (!refDestructuringErrors) { return false } var shorthandAssign = refDestructuringErrors.shorthandAssign; var doubleProto = refDestructuringErrors.doubleProto; if (!andThrow) { return shorthandAssign >= 0 || doubleProto >= 0 } if (shorthandAssign >= 0) { this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns"); } if (doubleProto >= 0) { this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); } }; pp.checkYieldAwaitInDefaultParams = function() { if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos)) { this.raise(this.yieldPos, "Yield expression cannot be a default value"); } if (this.awaitPos) { this.raise(this.awaitPos, "Await expression cannot be a default value"); } }; pp.isSimpleAssignTarget = function(expr) { if (expr.type === "ParenthesizedExpression") { return this.isSimpleAssignTarget(expr.expression) } return expr.type === "Identifier" || expr.type === "MemberExpression" }; var pp$1 = Parser.prototype; // ### Statement parsing // Parse a program. Initializes the parser, reads any number of // statements, and wraps them in a Program node. Optionally takes a // `program` argument. If present, the statements will be appended // to its body instead of creating a new node. pp$1.parseTopLevel = function(node) { var this$1 = this; var exports = {}; if (!node.body) { node.body = []; } while (this.type !== types.eof) { var stmt = this$1.parseStatement(null, true, exports); node.body.push(stmt); } if (this.inModule) { for (var i = 0, list = Object.keys(this$1.undefinedExports); i < list.length; i += 1) { var name = list[i]; this$1.raiseRecoverable(this$1.undefinedExports[name].start, ("Export '" + name + "' is not defined")); } } this.adaptDirectivePrologue(node.body); this.next(); if (this.options.ecmaVersion >= 6) { node.sourceType = this.options.sourceType; } return this.finishNode(node, "Program") }; var loopLabel = {kind: "loop"}; var switchLabel = {kind: "switch"}; pp$1.isLet = function(context) { if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { return false } skipWhiteSpace.lastIndex = this.pos; var skip = skipWhiteSpace.exec(this.input); var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); // For ambiguous cases, determine if a LexicalDeclaration (or only a // Statement) is allowed here. If context is not empty then only a Statement // is allowed. However, `let [` is an explicit negative lookahead for // ExpressionStatement, so special-case it first. if (nextCh === 91) { return true } // '[' if (context) { return false } if (nextCh === 123) { return true } // '{' if (isIdentifierStart(nextCh, true)) { var pos = next + 1; while (isIdentifierChar(this.input.charCodeAt(pos), true)) { ++pos; } var ident = this.input.slice(next, pos); if (!keywordRelationalOperator.test(ident)) { return true } } return false }; // check 'async [no LineTerminator here] function' // - 'async /*foo*/ function' is OK. // - 'async /*\n*/ function' is invalid. pp$1.isAsyncFunction = function() { if (this.options.ecmaVersion < 8 || !this.isContextual("async")) { return false } skipWhiteSpace.lastIndex = this.pos; var skip = skipWhiteSpace.exec(this.input); var next = this.pos + skip[0].length; return !lineBreak.test(this.input.slice(this.pos, next)) && this.input.slice(next, next + 8) === "function" && (next + 8 === this.input.length || !isIdentifierChar(this.input.charAt(next + 8))) }; // Parse a single statement. // // If expecting a statement and finding a slash operator, parse a // regular expression literal. This is to handle cases like // `if (foo) /blah/.exec(foo)`, where looking at the previous token // does not help. pp$1.parseStatement = function(context, topLevel, exports) { var starttype = this.type, node = this.startNode(), kind; if (this.isLet(context)) { starttype = types._var; kind = "let"; } // Most types of statements are recognized by the keyword they // start with. Many are trivial to parse, some require a bit of // complexity. switch (starttype) { case types._break: case types._continue: return this.parseBreakContinueStatement(node, starttype.keyword) case types._debugger: return this.parseDebuggerStatement(node) case types._do: return this.parseDoStatement(node) case types._for: return this.parseForStatement(node) case types._function: // Function as sole body of either an if statement or a labeled statement // works, but not when it is part of a labeled statement that is the sole // body of an if statement. if ((context && (this.strict || context !== "if" && context !== "label")) && this.options.ecmaVersion >= 6) { this.unexpected(); } return this.parseFunctionStatement(node, false, !context) case types._class: if (context) { this.unexpected(); } return this.parseClass(node, true) case types._if: return this.parseIfStatement(node) case types._return: return this.parseReturnStatement(node) case types._switch: return this.parseSwitchStatement(node) case types._throw: return this.parseThrowStatement(node) case types._try: return this.parseTryStatement(node) case types._const: case types._var: kind = kind || this.value; if (context && kind !== "var") { this.unexpected(); } return this.parseVarStatement(node, kind) case types._while: return this.parseWhileStatement(node) case types._with: return this.parseWithStatement(node) case types.braceL: return this.parseBlock(true, node) case types.semi: return this.parseEmptyStatement(node) case types._export: case types._import: if (!this.options.allowImportExportEverywhere) { if (!topLevel) { this.raise(this.start, "'import' and 'export' may only appear at the top level"); } if (!this.inModule) { this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); } } return starttype === types._import ? this.parseImport(node) : this.parseExport(node, exports) // If the statement does not start with a statement keyword or a // brace, it's an ExpressionStatement or LabeledStatement. We // simply start parsing an expression, and afterwards, if the // next token is a colon and the expression was a simple // Identifier node, we switch to interpreting it as a label. default: if (this.isAsyncFunction()) { if (context) { this.unexpected(); } this.next(); return this.parseFunctionStatement(node, true, !context) } var maybeName = this.value, expr = this.parseExpression(); if (starttype === types.name && expr.type === "Identifier" && this.eat(types.colon)) { return this.parseLabeledStatement(node, maybeName, expr, context) } else { return this.parseExpressionStatement(node, expr) } } }; pp$1.parseBreakContinueStatement = function(node, keyword) { var this$1 = this; var isBreak = keyword === "break"; this.next(); if (this.eat(types.semi) || this.insertSemicolon()) { node.label = null; } else if (this.type !== types.name) { this.unexpected(); } else { node.label = this.parseIdent(); this.semicolon(); } // Verify that there is an actual destination to break or // continue to. var i = 0; for (; i < this.labels.length; ++i) { var lab = this$1.labels[i]; if (node.label == null || lab.name === node.label.name) { if (lab.kind != null && (isBreak || lab.kind === "loop")) { break } if (node.label && isBreak) { break } } } if (i === this.labels.length) { this.raise(node.start, "Unsyntactic " + keyword); } return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement") }; pp$1.parseDebuggerStatement = function(node) { this.next(); this.semicolon(); return this.finishNode(node, "DebuggerStatement") }; pp$1.parseDoStatement = function(node) { this.next(); this.labels.push(loopLabel); node.body = this.parseStatement("do"); this.labels.pop(); this.expect(types._while); node.test = this.parseParenExpression(); if (this.options.ecmaVersion >= 6) { this.eat(types.semi); } else { this.semicolon(); } return this.finishNode(node, "DoWhileStatement") }; // Disambiguating between a `for` and a `for`/`in` or `for`/`of` // loop is non-trivial. Basically, we have to parse the init `var` // statement or expression, disallowing the `in` operator (see // the second parameter to `parseExpression`), and then check // whether the next token is `in` or `of`. When there is no init // part (semicolon immediately after the opening parenthesis), it // is a regular `for` loop. pp$1.parseForStatement = function(node) { this.next(); var awaitAt = (this.options.ecmaVersion >= 9 && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction)) && this.eatContextual("await")) ? this.lastTokStart : -1; this.labels.push(loopLabel); this.enterScope(0); this.expect(types.parenL); if (this.type === types.semi) { if (awaitAt > -1) { this.unexpected(awaitAt); } return this.parseFor(node, null) } var isLet = this.isLet(); if (this.type === types._var || this.type === types._const || isLet) { var init$1 = this.startNode(), kind = isLet ? "let" : this.value; this.next(); this.parseVar(init$1, true, kind); this.finishNode(init$1, "VariableDeclaration"); if ((this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1 && !(kind !== "var" && init$1.declarations[0].init)) { if (this.options.ecmaVersion >= 9) { if (this.type === types._in) { if (awaitAt > -1) { this.unexpected(awaitAt); } } else { node.await = awaitAt > -1; } } return this.parseForIn(node, init$1) } if (awaitAt > -1) { this.unexpected(awaitAt); } return this.parseFor(node, init$1) } var refDestructuringErrors = new DestructuringErrors; var init = this.parseExpression(true, refDestructuringErrors); if (this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) { if (this.options.ecmaVersion >= 9) { if (this.type === types._in) { if (awaitAt > -1) { this.unexpected(awaitAt); } } else { node.await = awaitAt > -1; } } this.toAssignable(init, false, refDestructuringErrors); this.checkLVal(init); return this.parseForIn(node, init) } else { this.checkExpressionErrors(refDestructuringErrors, true); } if (awaitAt > -1) { this.unexpected(awaitAt); } return this.parseFor(node, init) }; pp$1.parseFunctionStatement = function(node, isAsync, declarationPosition) { this.next(); return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync) }; pp$1.parseIfStatement = function(node) { this.next(); node.test = this.parseParenExpression(); // allow function declarations in branches, but only in non-strict mode node.consequent = this.parseStatement("if"); node.alternate = this.eat(types._else) ? this.parseStatement("if") : null; return this.finishNode(node, "IfStatement") }; pp$1.parseReturnStatement = function(node) { if (!this.inFunction && !this.options.allowReturnOutsideFunction) { this.raise(this.start, "'return' outside of function"); } this.next(); // In `return` (and `break`/`continue`), the keywords with // optional arguments, we eagerly look for a semicolon or the // possibility to insert one. if (this.eat(types.semi) || this.insertSemicolon()) { node.argument = null; } else { node.argument = this.parseExpression(); this.semicolon(); } return this.finishNode(node, "ReturnStatement") }; pp$1.parseSwitchStatement = function(node) { var this$1 = this; this.next(); node.discriminant = this.parseParenExpression(); node.cases = []; this.expect(types.braceL); this.labels.push(switchLabel); this.enterScope(0); // Statements under must be grouped (by label) in SwitchCase // nodes. `cur` is used to keep the node that we are currently // adding statements to. var cur; for (var sawDefault = false; this.type !== types.braceR;) { if (this$1.type === types._case || this$1.type === types._default) { var isCase = this$1.type === types._case; if (cur) { this$1.finishNode(cur, "SwitchCase"); } node.cases.push(cur = this$1.startNode()); cur.consequent = []; this$1.next(); if (isCase) { cur.test = this$1.parseExpression(); } else { if (sawDefault) { this$1.raiseRecoverable(this$1.lastTokStart, "Multiple default clauses"); } sawDefault = true; cur.test = null; } this$1.expect(types.colon); } else { if (!cur) { this$1.unexpected(); } cur.consequent.push(this$1.parseStatement(null)); } } this.exitScope(); if (cur) { this.finishNode(cur, "SwitchCase"); } this.next(); // Closing brace this.labels.pop(); return this.finishNode(node, "SwitchStatement") }; pp$1.parseThrowStatement = function(node) { this.next(); if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) { this.raise(this.lastTokEnd, "Illegal newline after throw"); } node.argument = this.parseExpression(); this.semicolon(); return this.finishNode(node, "ThrowStatement") }; // Reused empty array added for node fields that are always empty. var empty = []; pp$1.parseTryStatement = function(node) { this.next(); node.block = this.parseBlock(); node.handler = null; if (this.type === types._catch) { var clause = this.startNode(); this.next(); if (this.eat(types.parenL)) { clause.param = this.parseBindingAtom(); var simple = clause.param.type === "Identifier"; this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0); this.checkLVal(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL); this.expect(types.parenR); } else { if (this.options.ecmaVersion < 10) { this.unexpected(); } clause.param = null; this.enterScope(0); } clause.body = this.parseBlock(false); this.exitScope(); node.handler = this.finishNode(clause, "CatchClause"); } node.finalizer = this.eat(types._finally) ? this.parseBlock() : null; if (!node.handler && !node.finalizer) { this.raise(node.start, "Missing catch or finally clause"); } return this.finishNode(node, "TryStatement") }; pp$1.parseVarStatement = function(node, kind) { this.next(); this.parseVar(node, false, kind); this.semicolon(); return this.finishNode(node, "VariableDeclaration") }; pp$1.parseWhileStatement = function(node) { this.next(); node.test = this.parseParenExpression(); this.labels.push(loopLabel); node.body = this.parseStatement("while"); this.labels.pop(); return this.finishNode(node, "WhileStatement") }; pp$1.parseWithStatement = function(node) { if (this.strict) { this.raise(this.start, "'with' in strict mode"); } this.next(); node.object = this.parseParenExpression(); node.body = this.parseStatement("with"); return this.finishNode(node, "WithStatement") }; pp$1.parseEmptyStatement = function(node) { this.next(); return this.finishNode(node, "EmptyStatement") }; pp$1.parseLabeledStatement = function(node, maybeName, expr, context) { var this$1 = this; for (var i$1 = 0, list = this$1.labels; i$1 < list.length; i$1 += 1) { var label = list[i$1]; if (label.name === maybeName) { this$1.raise(expr.start, "Label '" + maybeName + "' is already declared"); } } var kind = this.type.isLoop ? "loop" : this.type === types._switch ? "switch" : null; for (var i = this.labels.length - 1; i >= 0; i--) { var label$1 = this$1.labels[i]; if (label$1.statementStart === node.start) { // Update information about previous labels on this node label$1.statementStart = this$1.start; label$1.kind = kind; } else { break } } this.labels.push({name: maybeName, kind: kind, statementStart: this.start}); node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label"); this.labels.pop(); node.label = expr; return this.finishNode(node, "LabeledStatement") }; pp$1.parseExpressionStatement = function(node, expr) { node.expression = expr; this.semicolon(); return this.finishNode(node, "ExpressionStatement") }; // Parse a semicolon-enclosed block of statements, handling `"use // strict"` declarations when `allowStrict` is true (used for // function bodies). pp$1.parseBlock = function(createNewLexicalScope, node) { var this$1 = this; if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true; if ( node === void 0 ) node = this.startNode(); node.body = []; this.expect(types.braceL); if (createNewLexicalScope) { this.enterScope(0); } while (!this.eat(types.braceR)) { var stmt = this$1.parseStatement(null); node.body.push(stmt); } if (createNewLexicalScope) { this.exitScope(); } return this.finishNode(node, "BlockStatement") }; // Parse a regular `for` loop. The disambiguation code in // `parseStatement` will already have parsed the init statement or // expression. pp$1.parseFor = function(node, init) { node.init = init; this.expect(types.semi); node.test = this.type === types.semi ? null : this.parseExpression(); this.expect(types.semi); node.update = this.type === types.parenR ? null : this.parseExpression(); this.expect(types.parenR); node.body = this.parseStatement("for"); this.exitScope(); this.labels.pop(); return this.finishNode(node, "ForStatement") }; // Parse a `for`/`in` and `for`/`of` loop, which are almost // same from parser's perspective. pp$1.parseForIn = function(node, init) { var type = this.type === types._in ? "ForInStatement" : "ForOfStatement"; this.next(); if (type === "ForInStatement") { if (init.type === "AssignmentPattern" || (init.type === "VariableDeclaration" && init.declarations[0].init != null && (this.strict || init.declarations[0].id.type !== "Identifier"))) { this.raise(init.start, "Invalid assignment in for-in loop head"); } } node.left = init; node.right = type === "ForInStatement" ? this.parseExpression() : this.parseMaybeAssign(); this.expect(types.parenR); node.body = this.parseStatement("for"); this.exitScope(); this.labels.pop(); return this.finishNode(node, type) }; // Parse a list of variable declarations. pp$1.parseVar = function(node, isFor, kind) { var this$1 = this; node.declarations = []; node.kind = kind; for (;;) { var decl = this$1.startNode(); this$1.parseVarId(decl, kind); if (this$1.eat(types.eq)) { decl.init = this$1.parseMaybeAssign(isFor); } else if (kind === "const" && !(this$1.type === types._in || (this$1.options.ecmaVersion >= 6 && this$1.isContextual("of")))) { this$1.unexpected(); } else if (decl.id.type !== "Identifier" && !(isFor && (this$1.type === types._in || this$1.isContextual("of")))) { this$1.raise(this$1.lastTokEnd, "Complex binding patterns require an initialization value"); } else { decl.init = null; } node.declarations.push(this$1.finishNode(decl, "VariableDeclarator")); if (!this$1.eat(types.comma)) { break } } return node }; pp$1.parseVarId = function(decl, kind) { if ((kind === "const" || kind === "let") && this.isContextual("let")) { this.raiseRecoverable(this.start, "let is disallowed as a lexically bound name"); } decl.id = this.parseBindingAtom(); this.checkLVal(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false); }; var FUNC_STATEMENT = 1; var FUNC_HANGING_STATEMENT = 2; var FUNC_NULLABLE_ID = 4; // Parse a function declaration or literal (depending on the // `statement & FUNC_STATEMENT`). // Remove `allowExpressionBody` for 7.0.0, as it is only called with false pp$1.parseFunction = function(node, statement, allowExpressionBody, isAsync) { this.initFunction(node); if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) { if (this.type === types.star && (statement & FUNC_HANGING_STATEMENT)) { this.unexpected(); } node.generator = this.eat(types.star); } if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; } if (statement & FUNC_STATEMENT) { node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types.name ? null : this.parseIdent(); if (node.id && !(statement & FUNC_HANGING_STATEMENT)) // If it is a regular function declaration in sloppy mode, then it is // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding // mode depends on properties of the current scope (see // treatFunctionsAsVar). { this.checkLVal(node.id, (this.strict || node.generator || node.async) ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION); } } var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; this.yieldPos = 0; this.awaitPos = 0; this.awaitIdentPos = 0; this.enterScope(functionFlags(node.async, node.generator)); if (!(statement & FUNC_STATEMENT)) { node.id = this.type === types.name ? this.parseIdent() : null; } this.parseFunctionParams(node); this.parseFunctionBody(node, allowExpressionBody, false); this.yieldPos = oldYieldPos; this.awaitPos = oldAwaitPos; this.awaitIdentPos = oldAwaitIdentPos; return this.finishNode(node, (statement & FUNC_STATEMENT) ? "FunctionDeclaration" : "FunctionExpression") }; pp$1.parseFunctionParams = function(node) { this.expect(types.parenL); node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8); this.checkYieldAwaitInDefaultParams(); }; // Parse a class declaration or literal (depending on the // `isStatement` parameter). pp$1.parseClass = function(node, isStatement) { var this$1 = this; this.next(); // ecma-262 14.6 Class Definitions // A class definition is always strict mode code. var oldStrict = this.strict; this.strict = true; this.parseClassId(node, isStatement); this.parseClassSuper(node); var classBody = this.startNode(); var hadConstructor = false; classBody.body = []; this.expect(types.braceL); while (!this.eat(types.braceR)) { var element = this$1.parseClassElement(node.superClass !== null); if (element) { classBody.body.push(element); if (element.type === "MethodDefinition" && element.kind === "constructor") { if (hadConstructor) { this$1.raise(element.start, "Duplicate constructor in the same class"); } hadConstructor = true; } } } node.body = this.finishNode(classBody, "ClassBody"); this.strict = oldStrict; return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression") }; pp$1.parseClassElement = function(constructorAllowsSuper) { var this$1 = this; if (this.eat(types.semi)) { return null } var method = this.startNode(); var tryContextual = function (k, noLineBreak) { if ( noLineBreak === void 0 ) noLineBreak = false; var start = this$1.start, startLoc = this$1.startLoc; if (!this$1.eatContextual(k)) { return false } if (this$1.type !== types.parenL && (!noLineBreak || !this$1.canInsertSemicolon())) { return true } if (method.key) { this$1.unexpected(); } method.computed = false; method.key = this$1.startNodeAt(start, startLoc); method.key.name = k; this$1.finishNode(method.key, "Identifier"); return false }; method.kind = "method"; method.static = tryContextual("static"); var isGenerator = this.eat(types.star); var isAsync = false; if (!isGenerator) { if (this.options.ecmaVersion >= 8 && tryContextual("async", true)) { isAsync = true; isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star); } else if (tryContextual("get")) { method.kind = "get"; } else if (tryContextual("set")) { method.kind = "set"; } } if (!method.key) { this.parsePropertyName(method); } var key = method.key; var allowsDirectSuper = false; if (!method.computed && !method.static && (key.type === "Identifier" && key.name === "constructor" || key.type === "Literal" && key.value === "constructor")) { if (method.kind !== "method") { this.raise(key.start, "Constructor can't have get/set modifier"); } if (isGenerator) { this.raise(key.start, "Constructor can't be a generator"); } if (isAsync) { this.raise(key.start, "Constructor can't be an async method"); } method.kind = "constructor"; allowsDirectSuper = constructorAllowsSuper; } else if (method.static && key.type === "Identifier" && key.name === "prototype") { this.raise(key.start, "Classes may not have a static property named prototype"); } this.parseClassMethod(method, isGenerator, isAsync, allowsDirectSuper); if (method.kind === "get" && method.value.params.length !== 0) { this.raiseRecoverable(method.value.start, "getter should have no params"); } if (method.kind === "set" && method.value.params.length !== 1) { this.raiseRecoverable(method.value.start, "setter should have exactly one param"); } if (method.kind === "set" && method.value.params[0].type === "RestElement") { this.raiseRecoverable(method.value.params[0].start, "Setter cannot use rest params"); } return method }; pp$1.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) { method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper); return this.finishNode(method, "MethodDefinition") }; pp$1.parseClassId = function(node, isStatement) { if (this.type === types.name) { node.id = this.parseIdent(); if (isStatement) { this.checkLVal(node.id, BIND_LEXICAL, false); } } else { if (isStatement === true) { this.unexpected(); } node.id = null; } }; pp$1.parseClassSuper = function(node) { node.superClass = this.eat(types._extends) ? this.parseExprSubscripts() : null; }; // Parses module export declaration. pp$1.parseExport = function(node, exports) { var this$1 = this; this.next(); // export * from '...' if (this.eat(types.star)) { this.expectContextual("from"); if (this.type !== types.string) { this.unexpected(); } node.source = this.parseExprAtom(); this.semicolon(); return this.finishNode(node, "ExportAllDeclaration") } if (this.eat(types._default)) { // export default ... this.checkExport(exports, "default", this.lastTokStart); var isAsync; if (this.type === types._function || (isAsync = this.isAsyncFunction())) { var fNode = this.startNode(); this.next(); if (isAsync) { this.next(); } node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync); } else if (this.type === types._class) { var cNode = this.startNode(); node.declaration = this.parseClass(cNode, "nullableID"); } else { node.declaration = this.parseMaybeAssign(); this.semicolon(); } return this.finishNode(node, "ExportDefaultDeclaration") } // export var|const|let|function|class ... if (this.shouldParseExportStatement()) { node.declaration = this.parseStatement(null); if (node.declaration.type === "VariableDeclaration") { this.checkVariableExport(exports, node.declaration.declarations); } else { this.checkExport(exports, node.declaration.id.name, node.declaration.id.start); } node.specifiers = []; node.source = null; } else { // export { x, y as z } [from '...'] node.declaration = null; node.specifiers = this.parseExportSpecifiers(exports); if (this.eatContextual("from")) { if (this.type !== types.string) { this.unexpected(); } node.source = this.parseExprAtom(); } else { for (var i = 0, list = node.specifiers; i < list.length; i += 1) { // check for keywords used as local names var spec = list[i]; this$1.checkUnreserved(spec.local); // check if export is defined this$1.checkLocalExport(spec.local); } node.source = null; } this.semicolon(); } return this.finishNode(node, "ExportNamedDeclaration") }; pp$1.checkExport = function(exports, name, pos) { if (!exports) { return } if (has(exports, name)) { this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); } exports[name] = true; }; pp$1.checkPatternExport = function(exports, pat) { var this$1 = this; var type = pat.type; if (type === "Identifier") { this.checkExport(exports, pat.name, pat.start); } else if (type === "ObjectPattern") { for (var i = 0, list = pat.properties; i < list.length; i += 1) { var prop = list[i]; this$1.checkPatternExport(exports, prop); } } else if (type === "ArrayPattern") { for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) { var elt = list$1[i$1]; if (elt) { this$1.checkPatternExport(exports, elt); } } } else if (type === "Property") { this.checkPatternExport(exports, pat.value); } else if (type === "AssignmentPattern") { this.checkPatternExport(exports, pat.left); } else if (type === "RestElement") { this.checkPatternExport(exports, pat.argument); } else if (type === "ParenthesizedExpression") { this.checkPatternExport(exports, pat.expression); } }; pp$1.checkVariableExport = function(exports, decls) { var this$1 = this; if (!exports) { return } for (var i = 0, list = decls; i < list.length; i += 1) { var decl = list[i]; this$1.checkPatternExport(exports, decl.id); } }; pp$1.shouldParseExportStatement = function() { return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || this.type.keyword === "function" || this.isLet() || this.isAsyncFunction() }; // Parses a comma-separated list of module exports. pp$1.parseExportSpecifiers = function(exports) { var this$1 = this; var nodes = [], first = true; // export { x, y as z } [from '...'] this.expect(types.braceL); while (!this.eat(types.braceR)) { if (!first) { this$1.expect(types.comma); if (this$1.afterTrailingComma(types.braceR)) { break } } else { first = false; } var node = this$1.startNode(); node.local = this$1.parseIdent(true); node.exported = this$1.eatContextual("as") ? this$1.parseIdent(true) : node.local; this$1.checkExport(exports, node.exported.name, node.exported.start); nodes.push(this$1.finishNode(node, "ExportSpecifier")); } return nodes }; // Parses import declaration. pp$1.parseImport = function(node) { this.next(); // import '...' if (this.type === types.string) { node.specifiers = empty; node.source = this.parseExprAtom(); } else { node.specifiers = this.parseImportSpecifiers(); this.expectContextual("from"); node.source = this.type === types.string ? this.parseExprAtom() : this.unexpected(); } this.semicolon(); return this.finishNode(node, "ImportDeclaration") }; // Parses a comma-separated list of module imports. pp$1.parseImportSpecifiers = function() { var this$1 = this; var nodes = [], first = true; if (this.type === types.name) { // import defaultObj, { x, y as z } from '...' var node = this.startNode(); node.local = this.parseIdent(); this.checkLVal(node.local, BIND_LEXICAL); nodes.push(this.finishNode(node, "ImportDefaultSpecifier")); if (!this.eat(types.comma)) { return nodes } } if (this.type === types.star) { var node$1 = this.startNode(); this.next(); this.expectContextual("as"); node$1.local = this.parseIdent(); this.checkLVal(node$1.local, BIND_LEXICAL); nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier")); return nodes } this.expect(types.braceL); while (!this.eat(types.braceR)) { if (!first) { this$1.expect(types.comma); if (this$1.afterTrailingComma(types.braceR)) { break } } else { first = false; } var node$2 = this$1.startNode(); node$2.imported = this$1.parseIdent(true); if (this$1.eatContextual("as")) { node$2.local = this$1.parseIdent(); } else { this$1.checkUnreserved(node$2.imported); node$2.local = node$2.imported; } this$1.checkLVal(node$2.local, BIND_LEXICAL); nodes.push(this$1.finishNode(node$2, "ImportSpecifier")); } return nodes }; // Set `ExpressionStatement#directive` property for directive prologues. pp$1.adaptDirectivePrologue = function(statements) { for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) { statements[i].directive = statements[i].expression.raw.slice(1, -1); } }; pp$1.isDirectiveCandidate = function(statement) { return ( statement.type === "ExpressionStatement" && statement.expression.type === "Literal" && typeof statement.expression.value === "string" && // Reject parenthesized strings. (this.input[statement.start] === "\"" || this.input[statement.start] === "'") ) }; var pp$2 = Parser.prototype; // Convert existing expression atom to assignable pattern // if possible. pp$2.toAssignable = function(node, isBinding, refDestructuringErrors) { var this$1 = this; if (this.options.ecmaVersion >= 6 && node) { switch (node.type) { case "Identifier": if (this.inAsync && node.name === "await") { this.raise(node.start, "Cannot use 'await' as identifier inside an async function"); } break case "ObjectPattern": case "ArrayPattern": case "RestElement": break case "ObjectExpression": node.type = "ObjectPattern"; if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } for (var i = 0, list = node.properties; i < list.length; i += 1) { var prop = list[i]; this$1.toAssignable(prop, isBinding); // Early error: // AssignmentRestProperty[Yield, Await] : // `...` DestructuringAssignmentTarget[Yield, Await] // // It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|. if ( prop.type === "RestElement" && (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern") ) { this$1.raise(prop.argument.start, "Unexpected token"); } } break case "Property": // AssignmentProperty has type === "Property" if (node.kind !== "init") { this.raise(node.key.start, "Object pattern can't contain getter or setter"); } this.toAssignable(node.value, isBinding); break case "ArrayExpression": node.type = "ArrayPattern"; if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } this.toAssignableList(node.elements, isBinding); break case "SpreadElement": node.type = "RestElement"; this.toAssignable(node.argument, isBinding); if (node.argument.type === "AssignmentPattern") { this.raise(node.argument.start, "Rest elements cannot have a default value"); } break case "AssignmentExpression": if (node.operator !== "=") { this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); } node.type = "AssignmentPattern"; delete node.operator; this.toAssignable(node.left, isBinding); // falls through to AssignmentPattern case "AssignmentPattern": break case "ParenthesizedExpression": this.toAssignable(node.expression, isBinding, refDestructuringErrors); break case "MemberExpression": if (!isBinding) { break } default: this.raise(node.start, "Assigning to rvalue"); } } else if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } return node }; // Convert list of expression atoms to binding list. pp$2.toAssignableList = function(exprList, isBinding) { var this$1 = this; var end = exprList.length; for (var i = 0; i < end; i++) { var elt = exprList[i]; if (elt) { this$1.toAssignable(elt, isBinding); } } if (end) { var last = exprList[end - 1]; if (this.options.ecmaVersion === 6 && isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier") { this.unexpected(last.argument.start); } } return exprList }; // Parses spread element. pp$2.parseSpread = function(refDestructuringErrors) { var node = this.startNode(); this.next(); node.argument = this.parseMaybeAssign(false, refDestructuringErrors); return this.finishNode(node, "SpreadElement") }; pp$2.parseRestBinding = function() { var node = this.startNode(); this.next(); // RestElement inside of a function parameter must be an identifier if (this.options.ecmaVersion === 6 && this.type !== types.name) { this.unexpected(); } node.argument = this.parseBindingAtom(); return this.finishNode(node, "RestElement") }; // Parses lvalue (assignable) atom. pp$2.parseBindingAtom = function() { if (this.options.ecmaVersion >= 6) { switch (this.type) { case types.bracketL: var node = this.startNode(); this.next(); node.elements = this.parseBindingList(types.bracketR, true, true); return this.finishNode(node, "ArrayPattern") case types.braceL: return this.parseObj(true) } } return this.parseIdent() }; pp$2.parseBindingList = function(close, allowEmpty, allowTrailingComma) { var this$1 = this; var elts = [], first = true; while (!this.eat(close)) { if (first) { first = false; } else { this$1.expect(types.comma); } if (allowEmpty && this$1.type === types.comma) { elts.push(null); } else if (allowTrailingComma && this$1.afterTrailingComma(close)) { break } else if (this$1.type === types.ellipsis) { var rest = this$1.parseRestBinding(); this$1.parseBindingListItem(rest); elts.push(rest); if (this$1.type === types.comma) { this$1.raise(this$1.start, "Comma is not permitted after the rest element"); } this$1.expect(close); break } else { var elem = this$1.parseMaybeDefault(this$1.start, this$1.startLoc); this$1.parseBindingListItem(elem); elts.push(elem); } } return elts }; pp$2.parseBindingListItem = function(param) { return param }; // Parses assignment pattern around given atom if possible. pp$2.parseMaybeDefault = function(startPos, startLoc, left) { left = left || this.parseBindingAtom(); if (this.options.ecmaVersion < 6 || !this.eat(types.eq)) { return left } var node = this.startNodeAt(startPos, startLoc); node.left = left; node.right = this.parseMaybeAssign(); return this.finishNode(node, "AssignmentPattern") }; // Verify that a node is an lval — something that can be assigned // to. // bindingType can be either: // 'var' indicating that the lval creates a 'var' binding // 'let' indicating that the lval creates a lexical ('let' or 'const') binding // 'none' indicating that the binding should be checked for illegal identifiers, but not for duplicate references pp$2.checkLVal = function(expr, bindingType, checkClashes) { var this$1 = this; if ( bindingType === void 0 ) bindingType = BIND_NONE; switch (expr.type) { case "Identifier": if (this.strict && this.reservedWordsStrictBind.test(expr.name)) { this.raiseRecoverable(expr.start, (bindingType ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); } if (checkClashes) { if (has(checkClashes, expr.name)) { this.raiseRecoverable(expr.start, "Argument name clash"); } checkClashes[expr.name] = true; } if (bindingType !== BIND_NONE && bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); } break case "MemberExpression": if (bindingType) { this.raiseRecoverable(expr.start, "Binding member expression"); } break case "ObjectPattern": for (var i = 0, list = expr.properties; i < list.length; i += 1) { var prop = list[i]; this$1.checkLVal(prop, bindingType, checkClashes); } break case "Property": // AssignmentProperty has type === "Property" this.checkLVal(expr.value, bindingType, checkClashes); break case "ArrayPattern": for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) { var elem = list$1[i$1]; if (elem) { this$1.checkLVal(elem, bindingType, checkClashes); } } break case "AssignmentPattern": this.checkLVal(expr.left, bindingType, checkClashes); break case "RestElement": this.checkLVal(expr.argument, bindingType, checkClashes); break case "ParenthesizedExpression": this.checkLVal(expr.expression, bindingType, checkClashes); break default: this.raise(expr.start, (bindingType ? "Binding" : "Assigning to") + " rvalue"); } }; // A recursive descent parser operates by defining functions for all // syntactic elements, and recursively calling those, each function // advancing the input stream and returning an AST node. Precedence // of constructs (for example, the fact that `!x[1]` means `!(x[1])` // instead of `(!x)[1]` is handled by the fact that the parser // function that parses unary prefix operators is called first, and // in turn calls the function that parses `[]` subscripts — that // way, it'll receive the node for `x[1]` already parsed, and wraps // *that* in the unary operator node. // // Acorn uses an [operator precedence parser][opp] to handle binary // operator precedence, because it is much more compact than using // the technique outlined above, which uses different, nesting // functions to specify precedence, for all of the ten binary // precedence levels that JavaScript defines. // // [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser var pp$3 = Parser.prototype; // Check if property name clashes with already added. // Object/class getters and setters are not allowed to clash — // either with each other or with an init property — and in // strict mode, init properties are also not allowed to be repeated. pp$3.checkPropClash = function(prop, propHash, refDestructuringErrors) { if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement") { return } if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand)) { return } var key = prop.key; var name; switch (key.type) { case "Identifier": name = key.name; break case "Literal": name = String(key.value); break default: return } var kind = prop.kind; if (this.options.ecmaVersion >= 6) { if (name === "__proto__" && kind === "init") { if (propHash.proto) { if (refDestructuringErrors && refDestructuringErrors.doubleProto < 0) { refDestructuringErrors.doubleProto = key.start; } // Backwards-compat kludge. Can be removed in version 6.0 else { this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); } } propHash.proto = true; } return } name = "$" + name; var other = propHash[name]; if (other) { var redefinition; if (kind === "init") { redefinition = this.strict && other.init || other.get || other.set; } else { redefinition = other.init || other[kind]; } if (redefinition) { this.raiseRecoverable(key.start, "Redefinition of property"); } } else { other = propHash[name] = { init: false, get: false, set: false }; } other[kind] = true; }; // ### Expression parsing // These nest, from the most general expression type at the top to // 'atomic', nondivisible expression types at the bottom. Most of // the functions will simply let the function(s) below them parse, // and, *if* the syntactic construct they handle is present, wrap // the AST node that the inner parser gave them in another node. // Parse a full expression. The optional arguments are used to // forbid the `in` operator (in for loops initalization expressions) // and provide reference for storing '=' operator inside shorthand // property assignment in contexts where both object expression // and object pattern might appear (so it's possible to raise // delayed syntax error at correct position). pp$3.parseExpression = function(noIn, refDestructuringErrors) { var this$1 = this; var startPos = this.start, startLoc = this.startLoc; var expr = this.parseMaybeAssign(noIn, refDestructuringErrors); if (this.type === types.comma) { var node = this.startNodeAt(startPos, startLoc); node.expressions = [expr]; while (this.eat(types.comma)) { node.expressions.push(this$1.parseMaybeAssign(noIn, refDestructuringErrors)); } return this.finishNode(node, "SequenceExpression") } return expr }; // Parse an assignment expression. This includes applications of // operators like `+=`. pp$3.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) { if (this.isContextual("yield")) { if (this.inGenerator) { return this.parseYield(noIn) } // The tokenizer will assume an expression is allowed after // `yield`, but this isn't that kind of yield else { this.exprAllowed = false; } } var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldShorthandAssign = -1; if (refDestructuringErrors) { oldParenAssign = refDestructuringErrors.parenthesizedAssign; oldTrailingComma = refDestructuringErrors.trailingComma; oldShorthandAssign = refDestructuringErrors.shorthandAssign; refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.shorthandAssign = -1; } else { refDestructuringErrors = new DestructuringErrors; ownDestructuringErrors = true; } var startPos = this.start, startLoc = this.startLoc; if (this.type === types.parenL || this.type === types.name) { this.potentialArrowAt = this.start; } var left = this.parseMaybeConditional(noIn, refDestructuringErrors); if (afterLeftParse) { left = afterLeftParse.call(this, left, startPos, startLoc); } if (this.type.isAssign) { var node = this.startNodeAt(startPos, startLoc); node.operator = this.value; node.left = this.type === types.eq ? this.toAssignable(left, false, refDestructuringErrors) : left; if (!ownDestructuringErrors) { DestructuringErrors.call(refDestructuringErrors); } refDestructuringErrors.shorthandAssign = -1; // reset because shorthand default was used correctly this.checkLVal(left); this.next(); node.right = this.parseMaybeAssign(noIn); return this.finishNode(node, "AssignmentExpression") } else { if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); } } if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; } if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; } if (oldShorthandAssign > -1) { refDestructuringErrors.shorthandAssign = oldShorthandAssign; } return left }; // Parse a ternary conditional (`?:`) operator. pp$3.parseMaybeConditional = function(noIn, refDestructuringErrors) { var startPos = this.start, startLoc = this.startLoc; var expr = this.parseExprOps(noIn, refDestructuringErrors); if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } if (this.eat(types.question)) { var node = this.startNodeAt(startPos, startLoc); node.test = expr; node.consequent = this.parseMaybeAssign(); this.expect(types.colon); node.alternate = this.parseMaybeAssign(noIn); return this.finishNode(node, "ConditionalExpression") } return expr }; // Start the precedence parser. pp$3.parseExprOps = function(noIn, refDestructuringErrors) { var startPos = this.start, startLoc = this.startLoc; var expr = this.parseMaybeUnary(refDestructuringErrors, false); if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, noIn) }; // Parse binary operators with the operator precedence parsing // algorithm. `left` is the left-hand side of the operator. // `minPrec` provides context that allows the function to stop and // defer further parser to one of its callers when it encounters an // operator that has a lower precedence than the set it is parsing. pp$3.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, noIn) { var prec = this.type.binop; if (prec != null && (!noIn || this.type !== types._in)) { if (prec > minPrec) { var logical = this.type === types.logicalOR || this.type === types.logicalAND; var op = this.value; this.next(); var startPos = this.start, startLoc = this.startLoc; var right = this.parseExprOp(this.parseMaybeUnary(null, false), startPos, startLoc, prec, noIn); var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical); return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn) } } return left }; pp$3.buildBinary = function(startPos, startLoc, left, right, op, logical) { var node = this.startNodeAt(startPos, startLoc); node.left = left; node.operator = op; node.right = right; return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression") }; // Parse unary operators, both prefix and postfix. pp$3.parseMaybeUnary = function(refDestructuringErrors, sawUnary) { var this$1 = this; var startPos = this.start, startLoc = this.startLoc, expr; if (this.isContextual("await") && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction))) { expr = this.parseAwait(); sawUnary = true; } else if (this.type.prefix) { var node = this.startNode(), update = this.type === types.incDec; node.operator = this.value; node.prefix = true; this.next(); node.argument = this.parseMaybeUnary(null, true); this.checkExpressionErrors(refDestructuringErrors, true); if (update) { this.checkLVal(node.argument); } else if (this.strict && node.operator === "delete" && node.argument.type === "Identifier") { this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); } else { sawUnary = true; } expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); } else { expr = this.parseExprSubscripts(refDestructuringErrors); if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } while (this.type.postfix && !this.canInsertSemicolon()) { var node$1 = this$1.startNodeAt(startPos, startLoc); node$1.operator = this$1.value; node$1.prefix = false; node$1.argument = expr; this$1.checkLVal(expr); this$1.next(); expr = this$1.finishNode(node$1, "UpdateExpression"); } } if (!sawUnary && this.eat(types.starstar)) { return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false), "**", false) } else { return expr } }; // Parse call, dot, and `[]`-subscript expressions. pp$3.parseExprSubscripts = function(refDestructuringErrors) { var startPos = this.start, startLoc = this.startLoc; var expr = this.parseExprAtom(refDestructuringErrors); var skipArrowSubscripts = expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")"; if (this.checkExpressionErrors(refDestructuringErrors) || skipArrowSubscripts) { return expr } var result = this.parseSubscripts(expr, startPos, startLoc); if (refDestructuringErrors && result.type === "MemberExpression") { if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; } if (refDestructuringErrors.parenthesizedBind >= result.start) { refDestructuringErrors.parenthesizedBind = -1; } } return result }; pp$3.parseSubscripts = function(base, startPos, startLoc, noCalls) { var this$1 = this; var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" && this.lastTokEnd === base.end && !this.canInsertSemicolon() && this.input.slice(base.start, base.end) === "async"; while (true) { var element = this$1.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow); if (element === base || element.type === "ArrowFunctionExpression") { return element } base = element; } }; pp$3.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow) { var computed = this.eat(types.bracketL); if (computed || this.eat(types.dot)) { var node = this.startNodeAt(startPos, startLoc); node.object = base; node.property = computed ? this.parseExpression() : this.parseIdent(true); node.computed = !!computed; if (computed) { this.expect(types.bracketR); } base = this.finishNode(node, "MemberExpression"); } else if (!noCalls && this.eat(types.parenL)) { var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; this.yieldPos = 0; this.awaitPos = 0; this.awaitIdentPos = 0; var exprList = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors); if (maybeAsyncArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) { this.checkPatternErrors(refDestructuringErrors, false); this.checkYieldAwaitInDefaultParams(); if (this.awaitIdentPos > 0) { this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"); } this.yieldPos = oldYieldPos; this.awaitPos = oldAwaitPos; this.awaitIdentPos = oldAwaitIdentPos; return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true) } this.checkExpressionErrors(refDestructuringErrors, true); this.yieldPos = oldYieldPos || this.yieldPos; this.awaitPos = oldAwaitPos || this.awaitPos; this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos; var node$1 = this.startNodeAt(startPos, startLoc); node$1.callee = base; node$1.arguments = exprList; base = this.finishNode(node$1, "CallExpression"); } else if (this.type === types.backQuote) { var node$2 = this.startNodeAt(startPos, startLoc); node$2.tag = base; node$2.quasi = this.parseTemplate({isTagged: true}); base = this.finishNode(node$2, "TaggedTemplateExpression"); } return base }; // Parse an atomic expression — either a single token that is an // expression, an expression started by a keyword like `function` or // `new`, or an expression wrapped in punctuation like `()`, `[]`, // or `{}`. pp$3.parseExprAtom = function(refDestructuringErrors) { // If a division operator appears in an expression position, the // tokenizer got confused, and we force it to read a regexp instead. if (this.type === types.slash) { this.readRegexp(); } var node, canBeArrow = this.potentialArrowAt === this.start; switch (this.type) { case types._super: if (!this.allowSuper) { this.raise(this.start, "'super' keyword outside a method"); } node = this.startNode(); this.next(); if (this.type === types.parenL && !this.allowDirectSuper) { this.raise(node.start, "super() call outside constructor of a subclass"); } // The `super` keyword can appear at below: // SuperProperty: // super [ Expression ] // super . IdentifierName // SuperCall: // super Arguments if (this.type !== types.dot && this.type !== types.bracketL && this.type !== types.parenL) { this.unexpected(); } return this.finishNode(node, "Super") case types._this: node = this.startNode(); this.next(); return this.finishNode(node, "ThisExpression") case types.name: var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc; var id = this.parseIdent(false); if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types._function)) { return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true) } if (canBeArrow && !this.canInsertSemicolon()) { if (this.eat(types.arrow)) { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false) } if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types.name && !containsEsc) { id = this.parseIdent(false); if (this.canInsertSemicolon() || !this.eat(types.arrow)) { this.unexpected(); } return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true) } } return id case types.regexp: var value = this.value; node = this.parseLiteral(value.value); node.regex = {pattern: value.pattern, flags: value.flags}; return node case types.num: case types.string: return this.parseLiteral(this.value) case types._null: case types._true: case types._false: node = this.startNode(); node.value = this.type === types._null ? null : this.type === types._true; node.raw = this.type.keyword; this.next(); return this.finishNode(node, "Literal") case types.parenL: var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow); if (refDestructuringErrors) { if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr)) { refDestructuringErrors.parenthesizedAssign = start; } if (refDestructuringErrors.parenthesizedBind < 0) { refDestructuringErrors.parenthesizedBind = start; } } return expr case types.bracketL: node = this.startNode(); this.next(); node.elements = this.parseExprList(types.bracketR, true, true, refDestructuringErrors); return this.finishNode(node, "ArrayExpression") case types.braceL: return this.parseObj(false, refDestructuringErrors) case types._function: node = this.startNode(); this.next(); return this.parseFunction(node, 0) case types._class: return this.parseClass(this.startNode(), false) case types._new: return this.parseNew() case types.backQuote: return this.parseTemplate() default: this.unexpected(); } }; pp$3.parseLiteral = function(value) { var node = this.startNode(); node.value = value; node.raw = this.input.slice(this.start, this.end); this.next(); return this.finishNode(node, "Literal") }; pp$3.parseParenExpression = function() { this.expect(types.parenL); var val = this.parseExpression(); this.expect(types.parenR); return val }; pp$3.parseParenAndDistinguishExpression = function(canBeArrow) { var this$1 = this; var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8; if (this.options.ecmaVersion >= 6) { this.next(); var innerStartPos = this.start, innerStartLoc = this.startLoc; var exprList = [], first = true, lastIsComma = false; var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart; this.yieldPos = 0; this.awaitPos = 0; // Do not save awaitIdentPos to allow checking awaits nested in parameters while (this.type !== types.parenR) { first ? first = false : this$1.expect(types.comma); if (allowTrailingComma && this$1.afterTrailingComma(types.parenR, true)) { lastIsComma = true; break } else if (this$1.type === types.ellipsis) { spreadStart = this$1.start; exprList.push(this$1.parseParenItem(this$1.parseRestBinding())); if (this$1.type === types.comma) { this$1.raise(this$1.start, "Comma is not permitted after the rest element"); } break } else { exprList.push(this$1.parseMaybeAssign(false, refDestructuringErrors, this$1.parseParenItem)); } } var innerEndPos = this.start, innerEndLoc = this.startLoc; this.expect(types.parenR); if (canBeArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) { this.checkPatternErrors(refDestructuringErrors, false); this.checkYieldAwaitInDefaultParams(); this.yieldPos = oldYieldPos; this.awaitPos = oldAwaitPos; return this.parseParenArrowList(startPos, startLoc, exprList) } if (!exprList.length || lastIsComma) { this.unexpected(this.lastTokStart); } if (spreadStart) { this.unexpected(spreadStart); } this.checkExpressionErrors(refDestructuringErrors, true); this.yieldPos = oldYieldPos || this.yieldPos; this.awaitPos = oldAwaitPos || this.awaitPos; if (exprList.length > 1) { val = this.startNodeAt(innerStartPos, innerStartLoc); val.expressions = exprList; this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc); } else { val = exprList[0]; } } else { val = this.parseParenExpression(); } if (this.options.preserveParens) { var par = this.startNodeAt(startPos, startLoc); par.expression = val; return this.finishNode(par, "ParenthesizedExpression") } else { return val } }; pp$3.parseParenItem = function(item) { return item }; pp$3.parseParenArrowList = function(startPos, startLoc, exprList) { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList) }; // New's precedence is slightly tricky. It must allow its argument to // be a `[]` or dot subscript expression, but not a call — at least, // not without wrapping it in parentheses. Thus, it uses the noCalls // argument to parseSubscripts to prevent it from consuming the // argument list. var empty$1 = []; pp$3.parseNew = function() { var node = this.startNode(); var meta = this.parseIdent(true); if (this.options.ecmaVersion >= 6 && this.eat(types.dot)) { node.meta = meta; var containsEsc = this.containsEsc; node.property = this.parseIdent(true); if (node.property.name !== "target" || containsEsc) { this.raiseRecoverable(node.property.start, "The only valid meta property for new is new.target"); } if (!this.inNonArrowFunction()) { this.raiseRecoverable(node.start, "new.target can only be used in functions"); } return this.finishNode(node, "MetaProperty") } var startPos = this.start, startLoc = this.startLoc; node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true); if (this.eat(types.parenL)) { node.arguments = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false); } else { node.arguments = empty$1; } return this.finishNode(node, "NewExpression") }; // Parse template expression. pp$3.parseTemplateElement = function(ref) { var isTagged = ref.isTagged; var elem = this.startNode(); if (this.type === types.invalidTemplate) { if (!isTagged) { this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"); } elem.value = { raw: this.value, cooked: null }; } else { elem.value = { raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"), cooked: this.value }; } this.next(); elem.tail = this.type === types.backQuote; return this.finishNode(elem, "TemplateElement") }; pp$3.parseTemplate = function(ref) { var this$1 = this; if ( ref === void 0 ) ref = {}; var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false; var node = this.startNode(); this.next(); node.expressions = []; var curElt = this.parseTemplateElement({isTagged: isTagged}); node.quasis = [curElt]; while (!curElt.tail) { if (this$1.type === types.eof) { this$1.raise(this$1.pos, "Unterminated template literal"); } this$1.expect(types.dollarBraceL); node.expressions.push(this$1.parseExpression()); this$1.expect(types.braceR); node.quasis.push(curElt = this$1.parseTemplateElement({isTagged: isTagged})); } this.next(); return this.finishNode(node, "TemplateLiteral") }; pp$3.isAsyncProp = function(prop) { return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && (this.type === types.name || this.type === types.num || this.type === types.string || this.type === types.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types.star)) && !lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) }; // Parse an object literal or binding pattern. pp$3.parseObj = function(isPattern, refDestructuringErrors) { var this$1 = this; var node = this.startNode(), first = true, propHash = {}; node.properties = []; this.next(); while (!this.eat(types.braceR)) { if (!first) { this$1.expect(types.comma); if (this$1.afterTrailingComma(types.braceR)) { break } } else { first = false; } var prop = this$1.parseProperty(isPattern, refDestructuringErrors); if (!isPattern) { this$1.checkPropClash(prop, propHash, refDestructuringErrors); } node.properties.push(prop); } return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression") }; pp$3.parseProperty = function(isPattern, refDestructuringErrors) { var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc; if (this.options.ecmaVersion >= 9 && this.eat(types.ellipsis)) { if (isPattern) { prop.argument = this.parseIdent(false); if (this.type === types.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } return this.finishNode(prop, "RestElement") } // To disallow parenthesized identifier via `this.toAssignable()`. if (this.type === types.parenL && refDestructuringErrors) { if (refDestructuringErrors.parenthesizedAssign < 0) { refDestructuringErrors.parenthesizedAssign = this.start; } if (refDestructuringErrors.parenthesizedBind < 0) { refDestructuringErrors.parenthesizedBind = this.start; } } // Parse argument. prop.argument = this.parseMaybeAssign(false, refDestructuringErrors); // To disallow trailing comma via `this.toAssignable()`. if (this.type === types.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) { refDestructuringErrors.trailingComma = this.start; } // Finish return this.finishNode(prop, "SpreadElement") } if (this.options.ecmaVersion >= 6) { prop.method = false; prop.shorthand = false; if (isPattern || refDestructuringErrors) { startPos = this.start; startLoc = this.startLoc; } if (!isPattern) { isGenerator = this.eat(types.star); } } var containsEsc = this.containsEsc; this.parsePropertyName(prop); if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) { isAsync = true; isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star); this.parsePropertyName(prop, refDestructuringErrors); } else { isAsync = false; } this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc); return this.finishNode(prop, "Property") }; pp$3.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) { if ((isGenerator || isAsync) && this.type === types.colon) { this.unexpected(); } if (this.eat(types.colon)) { prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors); prop.kind = "init"; } else if (this.options.ecmaVersion >= 6 && this.type === types.parenL) { if (isPattern) { this.unexpected(); } prop.kind = "init"; prop.method = true; prop.value = this.parseMethod(isGenerator, isAsync); } else if (!isPattern && !containsEsc && this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && (this.type !== types.comma && this.type !== types.braceR)) { if (isGenerator || isAsync) { this.unexpected(); } prop.kind = prop.key.name; this.parsePropertyName(prop); prop.value = this.parseMethod(false); var paramCount = prop.kind === "get" ? 0 : 1; if (prop.value.params.length !== paramCount) { var start = prop.value.start; if (prop.kind === "get") { this.raiseRecoverable(start, "getter should have no params"); } else { this.raiseRecoverable(start, "setter should have exactly one param"); } } else { if (prop.kind === "set" && prop.value.params[0].type === "RestElement") { this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); } } } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") { if (isGenerator || isAsync) { this.unexpected(); } this.checkUnreserved(prop.key); if (prop.key.name === "await" && !this.awaitIdentPos) { this.awaitIdentPos = startPos; } prop.kind = "init"; if (isPattern) { prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key); } else if (this.type === types.eq && refDestructuringErrors) { if (refDestructuringErrors.shorthandAssign < 0) { refDestructuringErrors.shorthandAssign = this.start; } prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key); } else { prop.value = prop.key; } prop.shorthand = true; } else { this.unexpected(); } }; pp$3.parsePropertyName = function(prop) { if (this.options.ecmaVersion >= 6) { if (this.eat(types.bracketL)) { prop.computed = true; prop.key = this.parseMaybeAssign(); this.expect(types.bracketR); return prop.key } else { prop.computed = false; } } return prop.key = this.type === types.num || this.type === types.string ? this.parseExprAtom() : this.parseIdent(true) }; // Initialize empty function node. pp$3.initFunction = function(node) { node.id = null; if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; } if (this.options.ecmaVersion >= 8) { node.async = false; } }; // Parse object or class method. pp$3.parseMethod = function(isGenerator, isAsync, allowDirectSuper) { var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; this.initFunction(node); if (this.options.ecmaVersion >= 6) { node.generator = isGenerator; } if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; } this.yieldPos = 0; this.awaitPos = 0; this.awaitIdentPos = 0; this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0)); this.expect(types.parenL); node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8); this.checkYieldAwaitInDefaultParams(); this.parseFunctionBody(node, false, true); this.yieldPos = oldYieldPos; this.awaitPos = oldAwaitPos; this.awaitIdentPos = oldAwaitIdentPos; return this.finishNode(node, "FunctionExpression") }; // Parse arrow function expression with given parameters. pp$3.parseArrowExpression = function(node, params, isAsync) { var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW); this.initFunction(node); if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; } this.yieldPos = 0; this.awaitPos = 0; this.awaitIdentPos = 0; node.params = this.toAssignableList(params, true); this.parseFunctionBody(node, true, false); this.yieldPos = oldYieldPos; this.awaitPos = oldAwaitPos; this.awaitIdentPos = oldAwaitIdentPos; return this.finishNode(node, "ArrowFunctionExpression") }; // Parse function body and check parameters. pp$3.parseFunctionBody = function(node, isArrowFunction, isMethod) { var isExpression = isArrowFunction && this.type !== types.braceL; var oldStrict = this.strict, useStrict = false; if (isExpression) { node.body = this.parseMaybeAssign(); node.expression = true; this.checkParams(node, false); } else { var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params); if (!oldStrict || nonSimple) { useStrict = this.strictDirective(this.end); // If this is a strict mode function, verify that argument names // are not repeated, and it does not try to bind the words `eval` // or `arguments`. if (useStrict && nonSimple) { this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"); } } // Start a new scope with regard to labels and the `inFunction` // flag (restore them to their old value afterwards). var oldLabels = this.labels; this.labels = []; if (useStrict) { this.strict = true; } // Add the params to varDeclaredNames to ensure that an error is thrown // if a let/const declaration in the function clashes with one of the params. this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params)); node.body = this.parseBlock(false); node.expression = false; this.adaptDirectivePrologue(node.body.body); this.labels = oldLabels; } this.exitScope(); // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval' if (this.strict && node.id) { this.checkLVal(node.id, BIND_OUTSIDE); } this.strict = oldStrict; }; pp$3.isSimpleParamList = function(params) { for (var i = 0, list = params; i < list.length; i += 1) { var param = list[i]; if (param.type !== "Identifier") { return false } } return true }; // Checks function params for various disallowed patterns such as using "eval" // or "arguments" and duplicate parameters. pp$3.checkParams = function(node, allowDuplicates) { var this$1 = this; var nameHash = {}; for (var i = 0, list = node.params; i < list.length; i += 1) { var param = list[i]; this$1.checkLVal(param, BIND_VAR, allowDuplicates ? null : nameHash); } }; // Parses a comma-separated list of expressions, and returns them as // an array. `close` is the token type that ends the list, and // `allowEmpty` can be turned on to allow subsequent commas with // nothing in between them to be parsed as `null` (which is needed // for array literals). pp$3.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) { var this$1 = this; var elts = [], first = true; while (!this.eat(close)) { if (!first) { this$1.expect(types.comma); if (allowTrailingComma && this$1.afterTrailingComma(close)) { break } } else { first = false; } var elt = (void 0); if (allowEmpty && this$1.type === types.comma) { elt = null; } else if (this$1.type === types.ellipsis) { elt = this$1.parseSpread(refDestructuringErrors); if (refDestructuringErrors && this$1.type === types.comma && refDestructuringErrors.trailingComma < 0) { refDestructuringErrors.trailingComma = this$1.start; } } else { elt = this$1.parseMaybeAssign(false, refDestructuringErrors); } elts.push(elt); } return elts }; pp$3.checkUnreserved = function(ref) { var start = ref.start; var end = ref.end; var name = ref.name; if (this.inGenerator && name === "yield") { this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator"); } if (this.inAsync && name === "await") { this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function"); } if (this.keywords.test(name)) { this.raise(start, ("Unexpected keyword '" + name + "'")); } if (this.options.ecmaVersion < 6 && this.input.slice(start, end).indexOf("\\") !== -1) { return } var re = this.strict ? this.reservedWordsStrict : this.reservedWords; if (re.test(name)) { if (!this.inAsync && name === "await") { this.raiseRecoverable(start, "Cannot use keyword 'await' outside an async function"); } this.raiseRecoverable(start, ("The keyword '" + name + "' is reserved")); } }; // Parse the next token as an identifier. If `liberal` is true (used // when parsing properties), it will also convert keywords into // identifiers. pp$3.parseIdent = function(liberal, isBinding) { var node = this.startNode(); if (liberal && this.options.allowReserved === "never") { liberal = false; } if (this.type === types.name) { node.name = this.value; } else if (this.type.keyword) { node.name = this.type.keyword; // To fix https://github.com/acornjs/acorn/issues/575 // `class` and `function` keywords push new context into this.context. // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name. // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword if ((node.name === "class" || node.name === "function") && (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) { this.context.pop(); } } else { this.unexpected(); } this.next(); this.finishNode(node, "Identifier"); if (!liberal) { this.checkUnreserved(node); if (node.name === "await" && !this.awaitIdentPos) { this.awaitIdentPos = node.start; } } return node }; // Parses yield expression inside generator. pp$3.parseYield = function(noIn) { if (!this.yieldPos) { this.yieldPos = this.start; } var node = this.startNode(); this.next(); if (this.type === types.semi || this.canInsertSemicolon() || (this.type !== types.star && !this.type.startsExpr)) { node.delegate = false; node.argument = null; } else { node.delegate = this.eat(types.star); node.argument = this.parseMaybeAssign(noIn); } return this.finishNode(node, "YieldExpression") }; pp$3.parseAwait = function() { if (!this.awaitPos) { this.awaitPos = this.start; } var node = this.startNode(); this.next(); node.argument = this.parseMaybeUnary(null, true); return this.finishNode(node, "AwaitExpression") }; var pp$4 = Parser.prototype; // This function is used to raise exceptions on parse errors. It // takes an offset integer (into the current `input`) to indicate // the location of the error, attaches the position to the end // of the error message, and then raises a `SyntaxError` with that // message. pp$4.raise = function(pos, message) { var loc = getLineInfo(this.input, pos); message += " (" + loc.line + ":" + loc.column + ")"; var err = new SyntaxError(message); err.pos = pos; err.loc = loc; err.raisedAt = this.pos; throw err }; pp$4.raiseRecoverable = pp$4.raise; pp$4.curPosition = function() { if (this.options.locations) { return new Position(this.curLine, this.pos - this.lineStart) } }; var pp$5 = Parser.prototype; var Scope = function Scope(flags) { this.flags = flags; // A list of var-declared names in the current lexical scope this.var = []; // A list of lexically-declared names in the current lexical scope this.lexical = []; // A list of lexically-declared FunctionDeclaration names in the current lexical scope this.functions = []; }; // The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names. pp$5.enterScope = function(flags) { this.scopeStack.push(new Scope(flags)); }; pp$5.exitScope = function() { this.scopeStack.pop(); }; // The spec says: // > At the top level of a function, or script, function declarations are // > treated like var declarations rather than like lexical declarations. pp$5.treatFunctionsAsVarInScope = function(scope) { return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP) }; pp$5.declareName = function(name, bindingType, pos) { var this$1 = this; var redeclared = false; if (bindingType === BIND_LEXICAL) { var scope = this.currentScope(); redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1; scope.lexical.push(name); if (this.inModule && (scope.flags & SCOPE_TOP)) { delete this.undefinedExports[name]; } } else if (bindingType === BIND_SIMPLE_CATCH) { var scope$1 = this.currentScope(); scope$1.lexical.push(name); } else if (bindingType === BIND_FUNCTION) { var scope$2 = this.currentScope(); if (this.treatFunctionsAsVar) { redeclared = scope$2.lexical.indexOf(name) > -1; } else { redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1; } scope$2.functions.push(name); } else { for (var i = this.scopeStack.length - 1; i >= 0; --i) { var scope$3 = this$1.scopeStack[i]; if (scope$3.lexical.indexOf(name) > -1 && !((scope$3.flags & SCOPE_SIMPLE_CATCH) && scope$3.lexical[0] === name) || !this$1.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) { redeclared = true; break } scope$3.var.push(name); if (this$1.inModule && (scope$3.flags & SCOPE_TOP)) { delete this$1.undefinedExports[name]; } if (scope$3.flags & SCOPE_VAR) { break } } } if (redeclared) { this.raiseRecoverable(pos, ("Identifier '" + name + "' has already been declared")); } }; pp$5.checkLocalExport = function(id) { // scope.functions must be empty as Module code is always strict. if (this.scopeStack[0].lexical.indexOf(id.name) === -1 && this.scopeStack[0].var.indexOf(id.name) === -1) { this.undefinedExports[id.name] = id; } }; pp$5.currentScope = function() { return this.scopeStack[this.scopeStack.length - 1] }; pp$5.currentVarScope = function() { var this$1 = this; for (var i = this.scopeStack.length - 1;; i--) { var scope = this$1.scopeStack[i]; if (scope.flags & SCOPE_VAR) { return scope } } }; // Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`. pp$5.currentThisScope = function() { var this$1 = this; for (var i = this.scopeStack.length - 1;; i--) { var scope = this$1.scopeStack[i]; if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { return scope } } }; var Node = function Node(parser, pos, loc) { this.type = ""; this.start = pos; this.end = 0; if (parser.options.locations) { this.loc = new SourceLocation(parser, loc); } if (parser.options.directSourceFile) { this.sourceFile = parser.options.directSourceFile; } if (parser.options.ranges) { this.range = [pos, 0]; } }; // Start an AST node, attaching a start offset. var pp$6 = Parser.prototype; pp$6.startNode = function() { return new Node(this, this.start, this.startLoc) }; pp$6.startNodeAt = function(pos, loc) { return new Node(this, pos, loc) }; // Finish an AST node, adding `type` and `end` properties. function finishNodeAt(node, type, pos, loc) { node.type = type; node.end = pos; if (this.options.locations) { node.loc.end = loc; } if (this.options.ranges) { node.range[1] = pos; } return node } pp$6.finishNode = function(node, type) { return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc) }; // Finish node at given position pp$6.finishNodeAt = function(node, type, pos, loc) { return finishNodeAt.call(this, node, type, pos, loc) }; // The algorithm used to determine whether a regexp can appear at a // given point in the program is loosely based on sweet.js' approach. // See https://github.com/mozilla/sweet.js/wiki/design var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) { this.token = token; this.isExpr = !!isExpr; this.preserveSpace = !!preserveSpace; this.override = override; this.generator = !!generator; }; var types$1 = { b_stat: new TokContext("{", false), b_expr: new TokContext("{", true), b_tmpl: new TokContext("${", false), p_stat: new TokContext("(", false), p_expr: new TokContext("(", true), q_tmpl: new TokContext("`", true, true, function (p) { return p.tryReadTemplateToken(); }), f_stat: new TokContext("function", false), f_expr: new TokContext("function", true), f_expr_gen: new TokContext("function", true, false, null, true), f_gen: new TokContext("function", false, false, null, true) }; var pp$7 = Parser.prototype; pp$7.initialContext = function() { return [types$1.b_stat] }; pp$7.braceIsBlock = function(prevType) { var parent = this.curContext(); if (parent === types$1.f_expr || parent === types$1.f_stat) { return true } if (prevType === types.colon && (parent === types$1.b_stat || parent === types$1.b_expr)) { return !parent.isExpr } // The check for `tt.name && exprAllowed` detects whether we are // after a `yield` or `of` construct. See the `updateContext` for // `tt.name`. if (prevType === types._return || prevType === types.name && this.exprAllowed) { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) } if (prevType === types._else || prevType === types.semi || prevType === types.eof || prevType === types.parenR || prevType === types.arrow) { return true } if (prevType === types.braceL) { return parent === types$1.b_stat } if (prevType === types._var || prevType === types._const || prevType === types.name) { return false } return !this.exprAllowed }; pp$7.inGeneratorContext = function() { var this$1 = this; for (var i = this.context.length - 1; i >= 1; i--) { var context = this$1.context[i]; if (context.token === "function") { return context.generator } } return false }; pp$7.updateContext = function(prevType) { var update, type = this.type; if (type.keyword && prevType === types.dot) { this.exprAllowed = false; } else if (update = type.updateContext) { update.call(this, prevType); } else { this.exprAllowed = type.beforeExpr; } }; // Token-specific context update code types.parenR.updateContext = types.braceR.updateContext = function() { if (this.context.length === 1) { this.exprAllowed = true; return } var out = this.context.pop(); if (out === types$1.b_stat && this.curContext().token === "function") { out = this.context.pop(); } this.exprAllowed = !out.isExpr; }; types.braceL.updateContext = function(prevType) { this.context.push(this.braceIsBlock(prevType) ? types$1.b_stat : types$1.b_expr); this.exprAllowed = true; }; types.dollarBraceL.updateContext = function() { this.context.push(types$1.b_tmpl); this.exprAllowed = true; }; types.parenL.updateContext = function(prevType) { var statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while; this.context.push(statementParens ? types$1.p_stat : types$1.p_expr); this.exprAllowed = true; }; types.incDec.updateContext = function() { // tokExprAllowed stays unchanged }; types._function.updateContext = types._class.updateContext = function(prevType) { if (prevType.beforeExpr && prevType !== types.semi && prevType !== types._else && !(prevType === types._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) && !((prevType === types.colon || prevType === types.braceL) && this.curContext() === types$1.b_stat)) { this.context.push(types$1.f_expr); } else { this.context.push(types$1.f_stat); } this.exprAllowed = false; }; types.backQuote.updateContext = function() { if (this.curContext() === types$1.q_tmpl) { this.context.pop(); } else { this.context.push(types$1.q_tmpl); } this.exprAllowed = false; }; types.star.updateContext = function(prevType) { if (prevType === types._function) { var index = this.context.length - 1; if (this.context[index] === types$1.f_expr) { this.context[index] = types$1.f_expr_gen; } else { this.context[index] = types$1.f_gen; } } this.exprAllowed = true; }; types.name.updateContext = function(prevType) { var allowed = false; if (this.options.ecmaVersion >= 6 && prevType !== types.dot) { if (this.value === "of" && !this.exprAllowed || this.value === "yield" && this.inGeneratorContext()) { allowed = true; } } this.exprAllowed = allowed; }; // This file contains Unicode properties extracted from the ECMAScript // specification. The lists are extracted like so: // $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText) // #table-binary-unicode-properties var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS"; var unicodeBinaryProperties = { 9: ecma9BinaryProperties, 10: ecma9BinaryProperties + " Extended_Pictographic" }; // #table-unicode-general-category-values var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu"; // #table-unicode-script-values var ecma9ScriptValues = "Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb"; var unicodeScriptValues = { 9: ecma9ScriptValues, 10: ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd" }; var data = {}; function buildUnicodeData(ecmaVersion) { var d = data[ecmaVersion] = { binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + " " + unicodeGeneralCategoryValues), nonBinary: { General_Category: wordsRegexp(unicodeGeneralCategoryValues), Script: wordsRegexp(unicodeScriptValues[ecmaVersion]) } }; d.nonBinary.Script_Extensions = d.nonBinary.Script; d.nonBinary.gc = d.nonBinary.General_Category; d.nonBinary.sc = d.nonBinary.Script; d.nonBinary.scx = d.nonBinary.Script_Extensions; } buildUnicodeData(9); buildUnicodeData(10); var pp$9 = Parser.prototype; var RegExpValidationState = function RegExpValidationState(parser) { this.parser = parser; this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : ""); this.unicodeProperties = data[parser.options.ecmaVersion >= 10 ? 10 : parser.options.ecmaVersion]; this.source = ""; this.flags = ""; this.start = 0; this.switchU = false; this.switchN = false; this.pos = 0; this.lastIntValue = 0; this.lastStringValue = ""; this.lastAssertionIsQuantifiable = false; this.numCapturingParens = 0; this.maxBackReference = 0; this.groupNames = []; this.backReferenceNames = []; }; RegExpValidationState.prototype.reset = function reset (start, pattern, flags) { var unicode = flags.indexOf("u") !== -1; this.start = start | 0; this.source = pattern + ""; this.flags = flags; this.switchU = unicode && this.parser.options.ecmaVersion >= 6; this.switchN = unicode && this.parser.options.ecmaVersion >= 9; }; RegExpValidationState.prototype.raise = function raise (message) { this.parser.raiseRecoverable(this.start, ("Invalid regular expression: /" + (this.source) + "/: " + message)); }; // If u flag is given, this returns the code point at the index (it combines a surrogate pair). // Otherwise, this returns the code unit of the index (can be a part of a surrogate pair). RegExpValidationState.prototype.at = function at (i) { var s = this.source; var l = s.length; if (i >= l) { return -1 } var c = s.charCodeAt(i); if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) { return c } return (c << 10) + s.charCodeAt(i + 1) - 0x35FDC00 }; RegExpValidationState.prototype.nextIndex = function nextIndex (i) { var s = this.source; var l = s.length; if (i >= l) { return l } var c = s.charCodeAt(i); if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) { return i + 1 } return i + 2 }; RegExpValidationState.prototype.current = function current () { return this.at(this.pos) }; RegExpValidationState.prototype.lookahead = function lookahead () { return this.at(this.nextIndex(this.pos)) }; RegExpValidationState.prototype.advance = function advance () { this.pos = this.nextIndex(this.pos); }; RegExpValidationState.prototype.eat = function eat (ch) { if (this.current() === ch) { this.advance(); return true } return false }; function codePointToString$1(ch) { if (ch <= 0xFFFF) { return String.fromCharCode(ch) } ch -= 0x10000; return String.fromCharCode((ch >> 10) + 0xD800, (ch & 0x03FF) + 0xDC00) } /** * Validate the flags part of a given RegExpLiteral. * * @param {RegExpValidationState} state The state to validate RegExp. * @returns {void} */ pp$9.validateRegExpFlags = function(state) { var this$1 = this; var validFlags = state.validFlags; var flags = state.flags; for (var i = 0; i < flags.length; i++) { var flag = flags.charAt(i); if (validFlags.indexOf(flag) === -1) { this$1.raise(state.start, "Invalid regular expression flag"); } if (flags.indexOf(flag, i + 1) > -1) { this$1.raise(state.start, "Duplicate regular expression flag"); } } }; /** * Validate the pattern part of a given RegExpLiteral. * * @param {RegExpValidationState} state The state to validate RegExp. * @returns {void} */ pp$9.validateRegExpPattern = function(state) { this.regexp_pattern(state); // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of // parsing contains a |GroupName|, reparse with the goal symbol // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError* // exception if _P_ did not conform to the grammar, if any elements of _P_ // were not matched by the parse, or if any Early Error conditions exist. if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) { state.switchN = true; this.regexp_pattern(state); } }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern pp$9.regexp_pattern = function(state) { state.pos = 0; state.lastIntValue = 0; state.lastStringValue = ""; state.lastAssertionIsQuantifiable = false; state.numCapturingParens = 0; state.maxBackReference = 0; state.groupNames.length = 0; state.backReferenceNames.length = 0; this.regexp_disjunction(state); if (state.pos !== state.source.length) { // Make the same messages as V8. if (state.eat(0x29 /* ) */)) { state.raise("Unmatched ')'"); } if (state.eat(0x5D /* [ */) || state.eat(0x7D /* } */)) { state.raise("Lone quantifier brackets"); } } if (state.maxBackReference > state.numCapturingParens) { state.raise("Invalid escape"); } for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) { var name = list[i]; if (state.groupNames.indexOf(name) === -1) { state.raise("Invalid named capture referenced"); } } }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction pp$9.regexp_disjunction = function(state) { var this$1 = this; this.regexp_alternative(state); while (state.eat(0x7C /* | */)) { this$1.regexp_alternative(state); } // Make the same message as V8. if (this.regexp_eatQuantifier(state, true)) { state.raise("Nothing to repeat"); } if (state.eat(0x7B /* { */)) { state.raise("Lone quantifier brackets"); } }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative pp$9.regexp_alternative = function(state) { while (state.pos < state.source.length && this.regexp_eatTerm(state)) { } }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term pp$9.regexp_eatTerm = function(state) { if (this.regexp_eatAssertion(state)) { // Handle `QuantifiableAssertion Quantifier` alternative. // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion // is a QuantifiableAssertion. if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) { // Make the same message as V8. if (state.switchU) { state.raise("Invalid quantifier"); } } return true } if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) { this.regexp_eatQuantifier(state); return true } return false }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion pp$9.regexp_eatAssertion = function(state) { var start = state.pos; state.lastAssertionIsQuantifiable = false; // ^, $ if (state.eat(0x5E /* ^ */) || state.eat(0x24 /* $ */)) { return true } // \b \B if (state.eat(0x5C /* \ */)) { if (state.eat(0x42 /* B */) || state.eat(0x62 /* b */)) { return true } state.pos = start; } // Lookahead / Lookbehind if (state.eat(0x28 /* ( */) && state.eat(0x3F /* ? */)) { var lookbehind = false; if (this.options.ecmaVersion >= 9) { lookbehind = state.eat(0x3C /* < */); } if (state.eat(0x3D /* = */) || state.eat(0x21 /* ! */)) { this.regexp_disjunction(state); if (!state.eat(0x29 /* ) */)) { state.raise("Unterminated group"); } state.lastAssertionIsQuantifiable = !lookbehind; return true } } state.pos = start; return false }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier pp$9.regexp_eatQuantifier = function(state, noError) { if ( noError === void 0 ) noError = false; if (this.regexp_eatQuantifierPrefix(state, noError)) { state.eat(0x3F /* ? */); return true } return false }; // https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix pp$9.regexp_eatQuantifierPrefix = function(state, noError) { return ( state.eat(0x2A /* * */) || state.eat(0x2B /* + */) || state.eat(0x3F /* ? */) || this.regexp_eatBracedQuantifier(state, noError) ) }; pp$9.regexp_eatBracedQuantifier = function(state, noError) { var start = state.pos; if (state.eat(0x7B /* { */)) { var min = 0, max = -1; if (this.regexp_eatDecimalDigits(state)) { min = state.lastIntValue; if (state.eat(0x2C /* , */) && this.regexp_eatDecimalDigits(state)) { max = state.lastIntValue; } if (state.eat(0x7D /* } */)) { // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term if (max !== -1 && max < min && !noError) { state.raise("numbers out of order in {} quantifier"); } return true } } if (state.switchU && !noError) { state.raise("Incomplete quantifier"); } state.pos = start; } return false }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Atom pp$9.regexp_eatAtom = function(state) { return ( this.regexp_eatPatternCharacters(state) || state.eat(0x2E /* . */) || this.regexp_eatReverseSolidusAtomEscape(state) || this.regexp_eatCharacterClass(state) || this.regexp_eatUncapturingGroup(state) || this.regexp_eatCapturingGroup(state) ) }; pp$9.regexp_eatReverseSolidusAtomEscape = function(state) { var start = state.pos; if (state.eat(0x5C /* \ */)) { if (this.regexp_eatAtomEscape(state)) { return true } state.pos = start; } return false }; pp$9.regexp_eatUncapturingGroup = function(state) { var start = state.pos; if (state.eat(0x28 /* ( */)) { if (state.eat(0x3F /* ? */) && state.eat(0x3A /* : */)) { this.regexp_disjunction(state); if (state.eat(0x29 /* ) */)) { return true } state.raise("Unterminated group"); } state.pos = start; } return false }; pp$9.regexp_eatCapturingGroup = function(state) { if (state.eat(0x28 /* ( */)) { if (this.options.ecmaVersion >= 9) { this.regexp_groupSpecifier(state); } else if (state.current() === 0x3F /* ? */) { state.raise("Invalid group"); } this.regexp_disjunction(state); if (state.eat(0x29 /* ) */)) { state.numCapturingParens += 1; return true } state.raise("Unterminated group"); } return false }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom pp$9.regexp_eatExtendedAtom = function(state) { return ( state.eat(0x2E /* . */) || this.regexp_eatReverseSolidusAtomEscape(state) || this.regexp_eatCharacterClass(state) || this.regexp_eatUncapturingGroup(state) || this.regexp_eatCapturingGroup(state) || this.regexp_eatInvalidBracedQuantifier(state) || this.regexp_eatExtendedPatternCharacter(state) ) }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier pp$9.regexp_eatInvalidBracedQuantifier = function(state) { if (this.regexp_eatBracedQuantifier(state, true)) { state.raise("Nothing to repeat"); } return false }; // https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter pp$9.regexp_eatSyntaxCharacter = function(state) { var ch = state.current(); if (isSyntaxCharacter(ch)) { state.lastIntValue = ch; state.advance(); return true } return false }; function isSyntaxCharacter(ch) { return ( ch === 0x24 /* $ */ || ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ || ch === 0x2E /* . */ || ch === 0x3F /* ? */ || ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ || ch >= 0x7B /* { */ && ch <= 0x7D /* } */ ) } // https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter // But eat eager. pp$9.regexp_eatPatternCharacters = function(state) { var start = state.pos; var ch = 0; while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) { state.advance(); } return state.pos !== start }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter pp$9.regexp_eatExtendedPatternCharacter = function(state) { var ch = state.current(); if ( ch !== -1 && ch !== 0x24 /* $ */ && !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */) && ch !== 0x2E /* . */ && ch !== 0x3F /* ? */ && ch !== 0x5B /* [ */ && ch !== 0x5E /* ^ */ && ch !== 0x7C /* | */ ) { state.advance(); return true } return false }; // GroupSpecifier[U] :: // [empty] // `?` GroupName[?U] pp$9.regexp_groupSpecifier = function(state) { if (state.eat(0x3F /* ? */)) { if (this.regexp_eatGroupName(state)) { if (state.groupNames.indexOf(state.lastStringValue) !== -1) { state.raise("Duplicate capture group name"); } state.groupNames.push(state.lastStringValue); return } state.raise("Invalid group"); } }; // GroupName[U] :: // `<` RegExpIdentifierName[?U] `>` // Note: this updates `state.lastStringValue` property with the eaten name. pp$9.regexp_eatGroupName = function(state) { state.lastStringValue = ""; if (state.eat(0x3C /* < */)) { if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) { return true } state.raise("Invalid capture group name"); } return false }; // RegExpIdentifierName[U] :: // RegExpIdentifierStart[?U] // RegExpIdentifierName[?U] RegExpIdentifierPart[?U] // Note: this updates `state.lastStringValue` property with the eaten name. pp$9.regexp_eatRegExpIdentifierName = function(state) { state.lastStringValue = ""; if (this.regexp_eatRegExpIdentifierStart(state)) { state.lastStringValue += codePointToString$1(state.lastIntValue); while (this.regexp_eatRegExpIdentifierPart(state)) { state.lastStringValue += codePointToString$1(state.lastIntValue); } return true } return false }; // RegExpIdentifierStart[U] :: // UnicodeIDStart // `$` // `_` // `\` RegExpUnicodeEscapeSequence[?U] pp$9.regexp_eatRegExpIdentifierStart = function(state) { var start = state.pos; var ch = state.current(); state.advance(); if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state)) { ch = state.lastIntValue; } if (isRegExpIdentifierStart(ch)) { state.lastIntValue = ch; return true } state.pos = start; return false }; function isRegExpIdentifierStart(ch) { return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ } // RegExpIdentifierPart[U] :: // UnicodeIDContinue // `$` // `_` // `\` RegExpUnicodeEscapeSequence[?U] // // pp$9.regexp_eatRegExpIdentifierPart = function(state) { var start = state.pos; var ch = state.current(); state.advance(); if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state)) { ch = state.lastIntValue; } if (isRegExpIdentifierPart(ch)) { state.lastIntValue = ch; return true } state.pos = start; return false }; function isRegExpIdentifierPart(ch) { return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* */ || ch === 0x200D /* */ } // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape pp$9.regexp_eatAtomEscape = function(state) { if ( this.regexp_eatBackReference(state) || this.regexp_eatCharacterClassEscape(state) || this.regexp_eatCharacterEscape(state) || (state.switchN && this.regexp_eatKGroupName(state)) ) { return true } if (state.switchU) { // Make the same message as V8. if (state.current() === 0x63 /* c */) { state.raise("Invalid unicode escape"); } state.raise("Invalid escape"); } return false }; pp$9.regexp_eatBackReference = function(state) { var start = state.pos; if (this.regexp_eatDecimalEscape(state)) { var n = state.lastIntValue; if (state.switchU) { // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape if (n > state.maxBackReference) { state.maxBackReference = n; } return true } if (n <= state.numCapturingParens) { return true } state.pos = start; } return false }; pp$9.regexp_eatKGroupName = function(state) { if (state.eat(0x6B /* k */)) { if (this.regexp_eatGroupName(state)) { state.backReferenceNames.push(state.lastStringValue); return true } state.raise("Invalid named reference"); } return false }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape pp$9.regexp_eatCharacterEscape = function(state) { return ( this.regexp_eatControlEscape(state) || this.regexp_eatCControlLetter(state) || this.regexp_eatZero(state) || this.regexp_eatHexEscapeSequence(state) || this.regexp_eatRegExpUnicodeEscapeSequence(state) || (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) || this.regexp_eatIdentityEscape(state) ) }; pp$9.regexp_eatCControlLetter = function(state) { var start = state.pos; if (state.eat(0x63 /* c */)) { if (this.regexp_eatControlLetter(state)) { return true } state.pos = start; } return false }; pp$9.regexp_eatZero = function(state) { if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) { state.lastIntValue = 0; state.advance(); return true } return false }; // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape pp$9.regexp_eatControlEscape = function(state) { var ch = state.current(); if (ch === 0x74 /* t */) { state.lastIntValue = 0x09; /* \t */ state.advance(); return true } if (ch === 0x6E /* n */) { state.lastIntValue = 0x0A; /* \n */ state.advance(); return true } if (ch === 0x76 /* v */) { state.lastIntValue = 0x0B; /* \v */ state.advance(); return true } if (ch === 0x66 /* f */) { state.lastIntValue = 0x0C; /* \f */ state.advance(); return true } if (ch === 0x72 /* r */) { state.lastIntValue = 0x0D; /* \r */ state.advance(); return true } return false }; // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter pp$9.regexp_eatControlLetter = function(state) { var ch = state.current(); if (isControlLetter(ch)) { state.lastIntValue = ch % 0x20; state.advance(); return true } return false }; function isControlLetter(ch) { return ( (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */) || (ch >= 0x61 /* a */ && ch <= 0x7A /* z */) ) } // https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence pp$9.regexp_eatRegExpUnicodeEscapeSequence = function(state) { var start = state.pos; if (state.eat(0x75 /* u */)) { if (this.regexp_eatFixedHexDigits(state, 4)) { var lead = state.lastIntValue; if (state.switchU && lead >= 0xD800 && lead <= 0xDBFF) { var leadSurrogateEnd = state.pos; if (state.eat(0x5C /* \ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) { var trail = state.lastIntValue; if (trail >= 0xDC00 && trail <= 0xDFFF) { state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; return true } } state.pos = leadSurrogateEnd; state.lastIntValue = lead; } return true } if ( state.switchU && state.eat(0x7B /* { */) && this.regexp_eatHexDigits(state) && state.eat(0x7D /* } */) && isValidUnicode(state.lastIntValue) ) { return true } if (state.switchU) { state.raise("Invalid unicode escape"); } state.pos = start; } return false }; function isValidUnicode(ch) { return ch >= 0 && ch <= 0x10FFFF } // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape pp$9.regexp_eatIdentityEscape = function(state) { if (state.switchU) { if (this.regexp_eatSyntaxCharacter(state)) { return true } if (state.eat(0x2F /* / */)) { state.lastIntValue = 0x2F; /* / */ return true } return false } var ch = state.current(); if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */)) { state.lastIntValue = ch; state.advance(); return true } return false }; // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape pp$9.regexp_eatDecimalEscape = function(state) { state.lastIntValue = 0; var ch = state.current(); if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) { do { state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */); state.advance(); } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) return true } return false }; // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape pp$9.regexp_eatCharacterClassEscape = function(state) { var ch = state.current(); if (isCharacterClassEscape(ch)) { state.lastIntValue = -1; state.advance(); return true } if ( state.switchU && this.options.ecmaVersion >= 9 && (ch === 0x50 /* P */ || ch === 0x70 /* p */) ) { state.lastIntValue = -1; state.advance(); if ( state.eat(0x7B /* { */) && this.regexp_eatUnicodePropertyValueExpression(state) && state.eat(0x7D /* } */) ) { return true } state.raise("Invalid property name"); } return false }; function isCharacterClassEscape(ch) { return ( ch === 0x64 /* d */ || ch === 0x44 /* D */ || ch === 0x73 /* s */ || ch === 0x53 /* S */ || ch === 0x77 /* w */ || ch === 0x57 /* W */ ) } // UnicodePropertyValueExpression :: // UnicodePropertyName `=` UnicodePropertyValue // LoneUnicodePropertyNameOrValue pp$9.regexp_eatUnicodePropertyValueExpression = function(state) { var start = state.pos; // UnicodePropertyName `=` UnicodePropertyValue if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */)) { var name = state.lastStringValue; if (this.regexp_eatUnicodePropertyValue(state)) { var value = state.lastStringValue; this.regexp_validateUnicodePropertyNameAndValue(state, name, value); return true } } state.pos = start; // LoneUnicodePropertyNameOrValue if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) { var nameOrValue = state.lastStringValue; this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue); return true } return false }; pp$9.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) { if (!has(state.unicodeProperties.nonBinary, name)) { state.raise("Invalid property name"); } if (!state.unicodeProperties.nonBinary[name].test(value)) { state.raise("Invalid property value"); } }; pp$9.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) { if (!state.unicodeProperties.binary.test(nameOrValue)) { state.raise("Invalid property name"); } }; // UnicodePropertyName :: // UnicodePropertyNameCharacters pp$9.regexp_eatUnicodePropertyName = function(state) { var ch = 0; state.lastStringValue = ""; while (isUnicodePropertyNameCharacter(ch = state.current())) { state.lastStringValue += codePointToString$1(ch); state.advance(); } return state.lastStringValue !== "" }; function isUnicodePropertyNameCharacter(ch) { return isControlLetter(ch) || ch === 0x5F /* _ */ } // UnicodePropertyValue :: // UnicodePropertyValueCharacters pp$9.regexp_eatUnicodePropertyValue = function(state) { var ch = 0; state.lastStringValue = ""; while (isUnicodePropertyValueCharacter(ch = state.current())) { state.lastStringValue += codePointToString$1(ch); state.advance(); } return state.lastStringValue !== "" }; function isUnicodePropertyValueCharacter(ch) { return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch) } // LoneUnicodePropertyNameOrValue :: // UnicodePropertyValueCharacters pp$9.regexp_eatLoneUnicodePropertyNameOrValue = function(state) { return this.regexp_eatUnicodePropertyValue(state) }; // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass pp$9.regexp_eatCharacterClass = function(state) { if (state.eat(0x5B /* [ */)) { state.eat(0x5E /* ^ */); this.regexp_classRanges(state); if (state.eat(0x5D /* [ */)) { return true } // Unreachable since it threw "unterminated regular expression" error before. state.raise("Unterminated character class"); } return false }; // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash pp$9.regexp_classRanges = function(state) { var this$1 = this; while (this.regexp_eatClassAtom(state)) { var left = state.lastIntValue; if (state.eat(0x2D /* - */) && this$1.regexp_eatClassAtom(state)) { var right = state.lastIntValue; if (state.switchU && (left === -1 || right === -1)) { state.raise("Invalid character class"); } if (left !== -1 && right !== -1 && left > right) { state.raise("Range out of order in character class"); } } } }; // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash pp$9.regexp_eatClassAtom = function(state) { var start = state.pos; if (state.eat(0x5C /* \ */)) { if (this.regexp_eatClassEscape(state)) { return true } if (state.switchU) { // Make the same message as V8. var ch$1 = state.current(); if (ch$1 === 0x63 /* c */ || isOctalDigit(ch$1)) { state.raise("Invalid class escape"); } state.raise("Invalid escape"); } state.pos = start; } var ch = state.current(); if (ch !== 0x5D /* [ */) { state.lastIntValue = ch; state.advance(); return true } return false }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape pp$9.regexp_eatClassEscape = function(state) { var start = state.pos; if (state.eat(0x62 /* b */)) { state.lastIntValue = 0x08; /* */ return true } if (state.switchU && state.eat(0x2D /* - */)) { state.lastIntValue = 0x2D; /* - */ return true } if (!state.switchU && state.eat(0x63 /* c */)) { if (this.regexp_eatClassControlLetter(state)) { return true } state.pos = start; } return ( this.regexp_eatCharacterClassEscape(state) || this.regexp_eatCharacterEscape(state) ) }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter pp$9.regexp_eatClassControlLetter = function(state) { var ch = state.current(); if (isDecimalDigit(ch) || ch === 0x5F /* _ */) { state.lastIntValue = ch % 0x20; state.advance(); return true } return false }; // https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence pp$9.regexp_eatHexEscapeSequence = function(state) { var start = state.pos; if (state.eat(0x78 /* x */)) { if (this.regexp_eatFixedHexDigits(state, 2)) { return true } if (state.switchU) { state.raise("Invalid escape"); } state.pos = start; } return false }; // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits pp$9.regexp_eatDecimalDigits = function(state) { var start = state.pos; var ch = 0; state.lastIntValue = 0; while (isDecimalDigit(ch = state.current())) { state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */); state.advance(); } return state.pos !== start }; function isDecimalDigit(ch) { return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */ } // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits pp$9.regexp_eatHexDigits = function(state) { var start = state.pos; var ch = 0; state.lastIntValue = 0; while (isHexDigit(ch = state.current())) { state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); state.advance(); } return state.pos !== start }; function isHexDigit(ch) { return ( (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) || (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) || (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) ) } function hexToInt(ch) { if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) { return 10 + (ch - 0x41 /* A */) } if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) { return 10 + (ch - 0x61 /* a */) } return ch - 0x30 /* 0 */ } // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence // Allows only 0-377(octal) i.e. 0-255(decimal). pp$9.regexp_eatLegacyOctalEscapeSequence = function(state) { if (this.regexp_eatOctalDigit(state)) { var n1 = state.lastIntValue; if (this.regexp_eatOctalDigit(state)) { var n2 = state.lastIntValue; if (n1 <= 3 && this.regexp_eatOctalDigit(state)) { state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue; } else { state.lastIntValue = n1 * 8 + n2; } } else { state.lastIntValue = n1; } return true } return false }; // https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit pp$9.regexp_eatOctalDigit = function(state) { var ch = state.current(); if (isOctalDigit(ch)) { state.lastIntValue = ch - 0x30; /* 0 */ state.advance(); return true } state.lastIntValue = 0; return false }; function isOctalDigit(ch) { return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */ } // https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit // And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence pp$9.regexp_eatFixedHexDigits = function(state, length) { var start = state.pos; state.lastIntValue = 0; for (var i = 0; i < length; ++i) { var ch = state.current(); if (!isHexDigit(ch)) { state.pos = start; return false } state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); state.advance(); } return true }; // Object type used to represent tokens. Note that normally, tokens // simply exist as properties on the parser object. This is only // used for the onToken callback and the external tokenizer. var Token = function Token(p) { this.type = p.type; this.value = p.value; this.start = p.start; this.end = p.end; if (p.options.locations) { this.loc = new SourceLocation(p, p.startLoc, p.endLoc); } if (p.options.ranges) { this.range = [p.start, p.end]; } }; // ## Tokenizer var pp$8 = Parser.prototype; // Move to the next token pp$8.next = function() { if (this.options.onToken) { this.options.onToken(new Token(this)); } this.lastTokEnd = this.end; this.lastTokStart = this.start; this.lastTokEndLoc = this.endLoc; this.lastTokStartLoc = this.startLoc; this.nextToken(); }; pp$8.getToken = function() { this.next(); return new Token(this) }; // If we're in an ES6 environment, make parsers iterable if (typeof Symbol !== "undefined") { pp$8[Symbol.iterator] = function() { var this$1 = this; return { next: function () { var token = this$1.getToken(); return { done: token.type === types.eof, value: token } } } }; } // Toggle strict mode. Re-reads the next number or string to please // pedantic tests (`"use strict"; 010;` should fail). pp$8.curContext = function() { return this.context[this.context.length - 1] }; // Read a single token, updating the parser object's token-related // properties. pp$8.nextToken = function() { var curContext = this.curContext(); if (!curContext || !curContext.preserveSpace) { this.skipSpace(); } this.start = this.pos; if (this.options.locations) { this.startLoc = this.curPosition(); } if (this.pos >= this.input.length) { return this.finishToken(types.eof) } if (curContext.override) { return curContext.override(this) } else { this.readToken(this.fullCharCodeAtPos()); } }; pp$8.readToken = function(code) { // Identifier or keyword. '\uXXXX' sequences are allowed in // identifiers, so '\' also dispatches to that. if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */) { return this.readWord() } return this.getTokenFromCode(code) }; pp$8.fullCharCodeAtPos = function() { var code = this.input.charCodeAt(this.pos); if (code <= 0xd7ff || code >= 0xe000) { return code } var next = this.input.charCodeAt(this.pos + 1); return (code << 10) + next - 0x35fdc00 }; pp$8.skipBlockComment = function() { var this$1 = this; var startLoc = this.options.onComment && this.curPosition(); var start = this.pos, end = this.input.indexOf("*/", this.pos += 2); if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); } this.pos = end + 2; if (this.options.locations) { lineBreakG.lastIndex = start; var match; while ((match = lineBreakG.exec(this.input)) && match.index < this.pos) { ++this$1.curLine; this$1.lineStart = match.index + match[0].length; } } if (this.options.onComment) { this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos, startLoc, this.curPosition()); } }; pp$8.skipLineComment = function(startSkip) { var this$1 = this; var start = this.pos; var startLoc = this.options.onComment && this.curPosition(); var ch = this.input.charCodeAt(this.pos += startSkip); while (this.pos < this.input.length && !isNewLine(ch)) { ch = this$1.input.charCodeAt(++this$1.pos); } if (this.options.onComment) { this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos, startLoc, this.curPosition()); } }; // Called at the start of the parse and after every token. Skips // whitespace and comments, and. pp$8.skipSpace = function() { var this$1 = this; loop: while (this.pos < this.input.length) { var ch = this$1.input.charCodeAt(this$1.pos); switch (ch) { case 32: case 160: // ' ' ++this$1.pos; break case 13: if (this$1.input.charCodeAt(this$1.pos + 1) === 10) { ++this$1.pos; } case 10: case 8232: case 8233: ++this$1.pos; if (this$1.options.locations) { ++this$1.curLine; this$1.lineStart = this$1.pos; } break case 47: // '/' switch (this$1.input.charCodeAt(this$1.pos + 1)) { case 42: // '*' this$1.skipBlockComment(); break case 47: this$1.skipLineComment(2); break default: break loop } break default: if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { ++this$1.pos; } else { break loop } } } }; // Called at the end of every token. Sets `end`, `val`, and // maintains `context` and `exprAllowed`, and skips the space after // the token, so that the next one's `start` will point at the // right position. pp$8.finishToken = function(type, val) { this.end = this.pos; if (this.options.locations) { this.endLoc = this.curPosition(); } var prevType = this.type; this.type = type; this.value = val; this.updateContext(prevType); }; // ### Token reading // This is the function that is called to fetch the next token. It // is somewhat obscure, because it works in character codes rather // than characters, and because operator parsing has been inlined // into it. // // All in the name of speed. // pp$8.readToken_dot = function() { var next = this.input.charCodeAt(this.pos + 1); if (next >= 48 && next <= 57) { return this.readNumber(true) } var next2 = this.input.charCodeAt(this.pos + 2); if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.' this.pos += 3; return this.finishToken(types.ellipsis) } else { ++this.pos; return this.finishToken(types.dot) } }; pp$8.readToken_slash = function() { // '/' var next = this.input.charCodeAt(this.pos + 1); if (this.exprAllowed) { ++this.pos; return this.readRegexp() } if (next === 61) { return this.finishOp(types.assign, 2) } return this.finishOp(types.slash, 1) }; pp$8.readToken_mult_modulo_exp = function(code) { // '%*' var next = this.input.charCodeAt(this.pos + 1); var size = 1; var tokentype = code === 42 ? types.star : types.modulo; // exponentiation operator ** and **= if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) { ++size; tokentype = types.starstar; next = this.input.charCodeAt(this.pos + 2); } if (next === 61) { return this.finishOp(types.assign, size + 1) } return this.finishOp(tokentype, size) }; pp$8.readToken_pipe_amp = function(code) { // '|&' var next = this.input.charCodeAt(this.pos + 1); if (next === code) { return this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2) } if (next === 61) { return this.finishOp(types.assign, 2) } return this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1) }; pp$8.readToken_caret = function() { // '^' var next = this.input.charCodeAt(this.pos + 1); if (next === 61) { return this.finishOp(types.assign, 2) } return this.finishOp(types.bitwiseXOR, 1) }; pp$8.readToken_plus_min = function(code) { // '+-' var next = this.input.charCodeAt(this.pos + 1); if (next === code) { if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) { // A `-->` line comment this.skipLineComment(3); this.skipSpace(); return this.nextToken() } return this.finishOp(types.incDec, 2) } if (next === 61) { return this.finishOp(types.assign, 2) } return this.finishOp(types.plusMin, 1) }; pp$8.readToken_lt_gt = function(code) { // '<>' var next = this.input.charCodeAt(this.pos + 1); var size = 1; if (next === code) { size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) } return this.finishOp(types.bitShift, size) } if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && this.input.charCodeAt(this.pos + 3) === 45) { // `'; } /***/ }), /***/ "./node_modules/domelementtype/index.js": /*!**********************************************!*\ !*** ./node_modules/domelementtype/index.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports) { //Types of elements found in the DOM module.exports = { Text: "text", //Text Directive: "directive", // Comment: "comment", // Script: "script", // // // Has one line before it which is invalid according to GLSL ES 3.00 // var lineOffset = 0; if (spaceRE.test(shaderSource)) { lineOffset = 1; shaderSource = shaderSource.replace(spaceRE, ''); } // Load the shader source gl.shaderSource(shader, shaderSource); // Compile the shader gl.compileShader(shader); // Check the compile status var compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS); if (!compiled) { // Something went wrong during compilation; get the error var lastError = gl.getShaderInfoLog(shader); errFn(addLineNumbers(shaderSource, lineOffset) + "\n*** Error compiling shader: " + lastError); gl.deleteShader(shader); return null; } return shader; } /** * @typedef {Object} ProgramOptions * @property {function(string)} [errorCallback] callback for errors * @property {Object.} [attribLocations] a attribute name to location map * @property {(module:twgl.BufferInfo|Object.|string[])} [transformFeedbackVaryings] If passed * a BufferInfo will use the attribs names inside. If passed an object of AttribInfos will use the names from that object. Otherwise * you can pass an array of names. * @property {number} [transformFeedbackMode] the mode to pass `gl.transformFeedbackVaryings`. Defaults to `SEPARATE_ATTRIBS`. * @memberOf module:twgl */ /** * Gets the program options based on all these optional arguments * @param {module:twgl.ProgramOptions|string[]} [opt_attribs] Options for the program or an array of attribs names. Locations will be assigned by index if not passed in * @param {number[]} [opt_locations] The locations for the. A parallel array to opt_attribs letting you assign locations. * @param {module:twgl.ErrorCallback} [opt_errorCallback] callback for errors. By default it just prints an error to the console * on error. If you want something else pass an callback. It's passed an error message. * @return {module:twgl.ProgramOptions} an instance of ProgramOptions based on the arguments pased on */ function getProgramOptions(opt_attribs, opt_locations, opt_errorCallback) { var transformFeedbackVaryings; if (typeof opt_locations === 'function') { opt_errorCallback = opt_locations; opt_locations = undefined; } if (typeof opt_attribs === 'function') { opt_errorCallback = opt_attribs; opt_attribs = undefined; } else if (opt_attribs && !Array.isArray(opt_attribs)) { // If we have an errorCallback we can just return this object // Otherwise we need to construct one with default errorCallback if (opt_attribs.errorCallback) { return opt_attribs; } var opt = opt_attribs; opt_errorCallback = opt.errorCallback; opt_attribs = opt.attribLocations; transformFeedbackVaryings = opt.transformFeedbackVaryings; } var options = { errorCallback: opt_errorCallback || error, transformFeedbackVaryings: transformFeedbackVaryings }; if (opt_attribs) { var attribLocations = {}; if (Array.isArray(opt_attribs)) { opt_attribs.forEach(function (attrib, ndx) { attribLocations[attrib] = opt_locations ? opt_locations[ndx] : ndx; }); } else { attribLocations = opt_attribs; } options.attribLocations = attribLocations; } return options; } var defaultShaderType = ["VERTEX_SHADER", "FRAGMENT_SHADER"]; function getShaderTypeFromScriptType(scriptType) { if (scriptType.indexOf("frag") >= 0) { return gl.FRAGMENT_SHADER; } else if (scriptType.indexOf("vert") >= 0) { return gl.VERTEX_SHADER; } return undefined; } function deleteShaders(gl, shaders) { shaders.forEach(function (shader) { gl.deleteShader(shader); }); } /** * Creates a program, attaches (and/or compiles) shaders, binds attrib locations, links the * program and calls useProgram. * * NOTE: There are 4 signatures for this function * * twgl.createProgram(gl, [vs, fs], options); * twgl.createProgram(gl, [vs, fs], opt_errFunc); * twgl.createProgram(gl, [vs, fs], opt_attribs, opt_errFunc); * twgl.createProgram(gl, [vs, fs], opt_attribs, opt_locations, opt_errFunc); * * @param {WebGLShader[]|string[]} shaders The shaders to attach, or element ids for their source, or strings that contain their source * @param {module:twgl.ProgramOptions|string[]} [opt_attribs] Options for the program or an array of attribs names. Locations will be assigned by index if not passed in * @param {number[]} [opt_locations] The locations for the. A parallel array to opt_attribs letting you assign locations. * @param {module:twgl.ErrorCallback} [opt_errorCallback] callback for errors. By default it just prints an error to the console * on error. If you want something else pass an callback. It's passed an error message. * @return {WebGLProgram?} the created program or null if error. * @memberOf module:twgl/programs */ function createProgram(gl, shaders, opt_attribs, opt_locations, opt_errorCallback) { var progOptions = getProgramOptions(opt_attribs, opt_locations, opt_errorCallback); var realShaders = []; var newShaders = []; for (var ndx = 0; ndx < shaders.length; ++ndx) { var shader = shaders[ndx]; if (typeof shader === 'string') { var elem = getElementById(shader); var src = elem ? elem.text : shader; var type = gl[defaultShaderType[ndx]]; if (elem && elem.type) { type = getShaderTypeFromScriptType(elem.type) || type; } shader = loadShader(gl, src, type, progOptions.errorCallback); newShaders.push(shader); } if (helper.isShader(gl, shader)) { realShaders.push(shader); } } if (realShaders.length !== shaders.length) { progOptions.errorCallback("not enough shaders for program"); deleteShaders(gl, newShaders); return null; } var program = gl.createProgram(); realShaders.forEach(function (shader) { gl.attachShader(program, shader); }); if (progOptions.attribLocations) { Object.keys(progOptions.attribLocations).forEach(function (attrib) { gl.bindAttribLocation(program, progOptions.attribLocations[attrib], attrib); }); } var varyings = progOptions.transformFeedbackVaryings; if (varyings) { if (varyings.attribs) { varyings = varyings.attribs; } if (!Array.isArray(varyings)) { varyings = Object.keys(varyings); } gl.transformFeedbackVaryings(program, varyings, progOptions.transformFeedbackMode || gl.SEPARATE_ATTRIBS); } gl.linkProgram(program); // Check the link status var linked = gl.getProgramParameter(program, gl.LINK_STATUS); if (!linked) { // something went wrong with the link var lastError = gl.getProgramInfoLog(program); progOptions.errorCallback("Error in program linking:" + lastError); gl.deleteProgram(program); deleteShaders(gl, newShaders); return null; } return program; } /** * Loads a shader from a script tag. * @param {WebGLRenderingContext} gl The WebGLRenderingContext to use. * @param {string} scriptId The id of the script tag. * @param {number} [opt_shaderType] The type of shader. If not passed in it will * be derived from the type of the script tag. * @param {module:twgl.ErrorCallback} [opt_errorCallback] callback for errors. * @return {WebGLShader?} The created shader or null if error. */ function createShaderFromScript(gl, scriptId, opt_shaderType, opt_errorCallback) { var shaderSource = ""; var shaderScript = getElementById(scriptId); if (!shaderScript) { throw "*** Error: unknown script element" + scriptId; } shaderSource = shaderScript.text; var shaderType = opt_shaderType || getShaderTypeFromScriptType(shaderScript.type); if (!shaderType) { throw "*** Error: unknown shader type"; } return loadShader(gl, shaderSource, shaderType, opt_errorCallback); } /** * Creates a program from 2 script tags. * * NOTE: There are 4 signatures for this function * * twgl.createProgramFromScripts(gl, [vs, fs], opt_options); * twgl.createProgramFromScripts(gl, [vs, fs], opt_errFunc); * twgl.createProgramFromScripts(gl, [vs, fs], opt_attribs, opt_errFunc); * twgl.createProgramFromScripts(gl, [vs, fs], opt_attribs, opt_locations, opt_errFunc); * * @param {WebGLRenderingContext} gl The WebGLRenderingContext * to use. * @param {string[]} shaderScriptIds Array of ids of the script * tags for the shaders. The first is assumed to be the * vertex shader, the second the fragment shader. * @param {string[]} [opt_attribs] An array of attribs names. Locations will be assigned by index if not passed in * @param {number[]} [opt_locations] The locations for the. A parallel array to opt_attribs letting you assign locations. * @param {module:twgl.ErrorCallback} opt_errorCallback callback for errors. By default it just prints an error to the console * on error. If you want something else pass an callback. It's passed an error message. * @return {WebGLProgram} The created program. * @memberOf module:twgl/programs */ function createProgramFromScripts(gl, shaderScriptIds, opt_attribs, opt_locations, opt_errorCallback) { var progOptions = getProgramOptions(opt_attribs, opt_locations, opt_errorCallback); var shaders = []; for (var ii = 0; ii < shaderScriptIds.length; ++ii) { var shader = createShaderFromScript(gl, shaderScriptIds[ii], gl[defaultShaderType[ii]], progOptions.errorCallback); if (!shader) { return null; } shaders.push(shader); } return createProgram(gl, shaders, progOptions); } /** * Creates a program from 2 sources. * * NOTE: There are 4 signatures for this function * * twgl.createProgramFromSource(gl, [vs, fs], opt_options); * twgl.createProgramFromSource(gl, [vs, fs], opt_errFunc); * twgl.createProgramFromSource(gl, [vs, fs], opt_attribs, opt_errFunc); * twgl.createProgramFromSource(gl, [vs, fs], opt_attribs, opt_locations, opt_errFunc); * * @param {WebGLRenderingContext} gl The WebGLRenderingContext * to use. * @param {string[]} shaderSources Array of sources for the * shaders. The first is assumed to be the vertex shader, * the second the fragment shader. * @param {string[]} [opt_attribs] An array of attribs names. Locations will be assigned by index if not passed in * @param {number[]} [opt_locations] The locations for the. A parallel array to opt_attribs letting you assign locations. * @param {module:twgl.ErrorCallback} opt_errorCallback callback for errors. By default it just prints an error to the console * on error. If you want something else pass an callback. It's passed an error message. * @return {WebGLProgram} The created program. * @memberOf module:twgl/programs */ function createProgramFromSources(gl, shaderSources, opt_attribs, opt_locations, opt_errorCallback) { var progOptions = getProgramOptions(opt_attribs, opt_locations, opt_errorCallback); var shaders = []; for (var ii = 0; ii < shaderSources.length; ++ii) { var shader = loadShader(gl, shaderSources[ii], gl[defaultShaderType[ii]], progOptions.errorCallback); if (!shader) { return null; } shaders.push(shader); } return createProgram(gl, shaders, progOptions); } /** * Returns true if attribute/uniform is a reserved/built in * * It makes no sense to me why GL returns these because it's * illegal to call `gl.getUniformLocation` and `gl.getAttribLocation` * with names that start with `gl_` (and `webgl_` in WebGL) * * I can only assume they are there because they might count * when computing the number of uniforms/attributes used when you want to * know if you are near the limit. That doesn't really make sense * to me but the fact that these get returned are in the spec. * * @param {WebGLActiveInfo} info As returned from `gl.getActiveUniform` or * `gl.getActiveAttrib`. * @return {bool} true if it's reserved */ function isBuiltIn(info) { var name = info.name; return name.startsWith("gl_") || name.startsWith("webgl_"); } /** * Creates setter functions for all uniforms of a shader * program. * * @see {@link module:twgl.setUniforms} * * @param {WebGLProgram} program the program to create setters for. * @returns {Object.} an object with a setter by name for each uniform * @memberOf module:twgl/programs */ function createUniformSetters(gl, program) { var textureUnit = 0; /** * Creates a setter for a uniform of the given program with it's * location embedded in the setter. * @param {WebGLProgram} program * @param {WebGLUniformInfo} uniformInfo * @returns {function} the created setter. */ function createUniformSetter(program, uniformInfo) { var location = gl.getUniformLocation(program, uniformInfo.name); var isArray = uniformInfo.size > 1 && uniformInfo.name.substr(-3) === "[0]"; var type = uniformInfo.type; var typeInfo = typeMap[type]; if (!typeInfo) { throw "unknown type: 0x" + type.toString(16); // we should never get here. } var setter; if (typeInfo.bindPoint) { // it's a sampler var unit = textureUnit; textureUnit += uniformInfo.size; if (isArray) { setter = typeInfo.arraySetter(gl, type, unit, location, uniformInfo.size); } else { setter = typeInfo.setter(gl, type, unit, location, uniformInfo.size); } } else { if (typeInfo.arraySetter && isArray) { setter = typeInfo.arraySetter(gl, location); } else { setter = typeInfo.setter(gl, location); } } setter.location = location; return setter; } var uniformSetters = {}; var numUniforms = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS); for (var ii = 0; ii < numUniforms; ++ii) { var uniformInfo = gl.getActiveUniform(program, ii); if (isBuiltIn(uniformInfo)) { continue; } var name = uniformInfo.name; // remove the array suffix. if (name.substr(-3) === "[0]") { name = name.substr(0, name.length - 3); } var setter = createUniformSetter(program, uniformInfo); uniformSetters[name] = setter; } return uniformSetters; } /** * @typedef {Object} TransformFeedbackInfo * @property {number} index index of transform feedback * @property {number} type GL type * @property {number} size 1 - 4 * @memberOf module:twgl */ /** * Create TransformFeedbackInfo for passing to bind/unbindTransformFeedbackInfo. * @param {WebGLRenderingContext} gl The WebGLRenderingContext to use. * @param {WebGLProgram} program an existing WebGLProgram. * @return {Object} * @memberOf module:twgl */ function createTransformFeedbackInfo(gl, program) { var info = {}; var numVaryings = gl.getProgramParameter(program, gl.TRANSFORM_FEEDBACK_VARYINGS); for (var ii = 0; ii < numVaryings; ++ii) { var varying = gl.getTransformFeedbackVarying(program, ii); info[varying.name] = { index: ii, type: varying.type, size: varying.size }; } return info; } /** * Binds buffers for transform feedback. * * @param {WebGLRenderingContext} gl The WebGLRenderingContext to use. * @param {(module:twgl.ProgramInfo|Object)} transformFeedbackInfo A ProgramInfo or TransformFeedbackInfo. * @param {(module:twgl.BufferInfo|Object)} [bufferInfo] A BufferInfo or set of AttribInfos. * @memberOf module:twgl */ function bindTransformFeedbackInfo(gl, transformFeedbackInfo, bufferInfo) { if (transformFeedbackInfo.transformFeedbackInfo) { transformFeedbackInfo = transformFeedbackInfo.transformFeedbackInfo; } if (bufferInfo.attribs) { bufferInfo = bufferInfo.attribs; } for (var name in bufferInfo) { var varying = transformFeedbackInfo[name]; if (varying) { var buf = bufferInfo[name]; if (buf.offset) { gl.bindBufferRange(gl.TRANSFORM_FEEDBACK_BUFFER, varying.index, buf.buffer, buf.offset, buf.size); } else { gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, varying.index, buf.buffer); } } } } /** * Unbinds buffers afetr transform feedback. * * Buffers can not be bound to 2 bind points so if you try to bind a buffer used * in a transform feedback as an ARRAY_BUFFER for an attribute it will fail. * * This function unbinds all buffers that were bound with {@link module:twgl.bindTransformFeedbackInfo}. * * @param {WebGLRenderingContext} gl The WebGLRenderingContext to use. * @param {(module:twgl.ProgramInfo|Object)} transformFeedbackInfo A ProgramInfo or TransformFeedbackInfo. * @param {(module:twgl.BufferInfo|Object)} [bufferInfo] A BufferInfo or set of AttribInfos. */ function unbindTransformFeedbackInfo(gl, transformFeedbackInfo, bufferInfo) { if (transformFeedbackInfo.transformFeedbackInfo) { transformFeedbackInfo = transformFeedbackInfo.transformFeedbackInfo; } if (bufferInfo.attribs) { bufferInfo = bufferInfo.attribs; } for (var name in bufferInfo) { var varying = transformFeedbackInfo[name]; if (varying) { gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, varying.index, null); } } } /** * Creates a transform feedback and sets the buffers * @param {WebGLRenderingContext} gl The WebGLRenderingContext to use. * @param {module:twgl.ProgramInfo} programInfo A ProgramInfo as returned from {@link module:twgl.createProgramInfo} * @param {(module:twgl.BufferInfo|Object)} [bufferInfo] A BufferInfo or set of AttribInfos. * @return {WebGLTransformFeedback} the created transform feedback * @memberOf module:twgl */ function createTransformFeedback(gl, programInfo, bufferInfo) { var tf = gl.createTransformFeedback(); gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, tf); gl.useProgram(programInfo.program); bindTransformFeedbackInfo(gl, programInfo, bufferInfo); gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, null); // This is only needed because of a bug in Chrome 56. Will remove // when chrome fixes it. unbindTransformFeedbackInfo(gl, programInfo, bufferInfo); return tf; } /** * @typedef {Object} UniformData * @property {number} type The WebGL type enum for this uniform * @property {number} size The number of elements for this uniform * @property {number} blockNdx The block index this uniform appears in * @property {number} offset The byte offset in the block for this uniform's value * @memberOf module:twgl */ /** * The specification for one UniformBlockObject * * @typedef {Object} BlockSpec * @property {number} index The index of the block. * @property {number} size The size in bytes needed for the block * @property {number[]} uniformIndices The indices of the uniforms used by the block. These indices * correspond to entries in a UniformData array in the {@link module:twgl.UniformBlockSpec}. * @property {bool} usedByVertexShader Self explanitory * @property {bool} usedByFragmentShader Self explanitory * @property {bool} used Self explanitory * @memberOf module:twgl */ /** * A `UniformBlockSpec` represents the data needed to create and bind * UniformBlockObjects for a given program * * @typedef {Object} UniformBlockSpec * @property {Object. blockSpecs The BlockSpec for each block by block name * @property {UniformData[]} uniformData An array of data for each uniform by uniform index. * @memberOf module:twgl */ /** * Creates a UniformBlockSpec for the given program. * * A UniformBlockSpec represents the data needed to create and bind * UniformBlockObjects * * @param {WebGL2RenderingContext} gl A WebGL2 Rendering Context * @param {WebGLProgram} program A WebGLProgram for a successfully linked program * @return {module:twgl.UniformBlockSpec} The created UniformBlockSpec * @memberOf module:twgl/programs */ function createUniformBlockSpecFromProgram(gl, program) { var numUniforms = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS); var uniformData = []; var uniformIndices = []; for (var ii = 0; ii < numUniforms; ++ii) { uniformIndices.push(ii); uniformData.push({}); var uniformInfo = gl.getActiveUniform(program, ii); if (isBuiltIn(uniformInfo)) { break; } // REMOVE [0]? uniformData[ii].name = uniformInfo.name; } [["UNIFORM_TYPE", "type"], ["UNIFORM_SIZE", "size"], // num elements ["UNIFORM_BLOCK_INDEX", "blockNdx"], ["UNIFORM_OFFSET", "offset"]].forEach(function (pair) { var pname = pair[0]; var key = pair[1]; gl.getActiveUniforms(program, uniformIndices, gl[pname]).forEach(function (value, ndx) { uniformData[ndx][key] = value; }); }); var blockSpecs = {}; var numUniformBlocks = gl.getProgramParameter(program, gl.ACTIVE_UNIFORM_BLOCKS); for (var _ii = 0; _ii < numUniformBlocks; ++_ii) { var name = gl.getActiveUniformBlockName(program, _ii); var blockSpec = { index: _ii, usedByVertexShader: gl.getActiveUniformBlockParameter(program, _ii, gl.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER), usedByFragmentShader: gl.getActiveUniformBlockParameter(program, _ii, gl.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER), size: gl.getActiveUniformBlockParameter(program, _ii, gl.UNIFORM_BLOCK_DATA_SIZE), uniformIndices: gl.getActiveUniformBlockParameter(program, _ii, gl.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES) }; blockSpec.used = blockSpec.usedByVertexSahder || blockSpec.usedByFragmentShader; blockSpecs[name] = blockSpec; } return { blockSpecs: blockSpecs, uniformData: uniformData }; } var arraySuffixRE = /\[\d+\]\.$/; // better way to check? /** * Represents a UniformBlockObject including an ArrayBuffer with all the uniform values * and a corresponding WebGLBuffer to hold those values on the GPU * * @typedef {Object} UniformBlockInfo * @property {string} name The name of the block * @property {ArrayBuffer} array The array buffer that contains the uniform values * @property {Float32Array} asFloat A float view on the array buffer. This is useful * inspecting the contents of the buffer in the debugger. * @property {WebGLBuffer} buffer A WebGL buffer that will hold a copy of the uniform values for rendering. * @property {number} [offset] offset into buffer * @property {Object.} uniforms A uniform name to ArrayBufferView map. * each Uniform has a correctly typed `ArrayBufferView` into array at the correct offset * and length of that uniform. So for example a float uniform would have a 1 float `Float32Array` * view. A single mat4 would have a 16 element `Float32Array` view. An ivec2 would have an * `Int32Array` view, etc. * @memberOf module:twgl */ /** * Creates a `UniformBlockInfo` for the specified block * * Note: **If the blockName matches no existing blocks a warning is printed to the console and a dummy * `UniformBlockInfo` is returned**. This is because when debugging GLSL * it is common to comment out large portions of a shader or for example set * the final output to a constant. When that happens blocks get optimized out. * If this function did not create dummy blocks your code would crash when debugging. * * @param {WebGL2RenderingContext} gl A WebGL2RenderingContext * @param {WebGLProgram} program A WebGLProgram * @param {module:twgl.UniformBlockSpec} uinformBlockSpec. A UniformBlockSpec as returned * from {@link module:twgl.createUniformBlockSpecFromProgram}. * @param {string} blockName The name of the block. * @return {module:twgl.UniformBlockInfo} The created UniformBlockInfo * @memberOf module:twgl/programs */ function createUniformBlockInfoFromProgram(gl, program, uniformBlockSpec, blockName) { var blockSpecs = uniformBlockSpec.blockSpecs; var uniformData = uniformBlockSpec.uniformData; var blockSpec = blockSpecs[blockName]; if (!blockSpec) { warn("no uniform block object named:", blockName); return { name: blockName, uniforms: {} }; } var array = new ArrayBuffer(blockSpec.size); var buffer = gl.createBuffer(); var uniformBufferIndex = blockSpec.index; gl.bindBuffer(gl.UNIFORM_BUFFER, buffer); gl.uniformBlockBinding(program, blockSpec.index, uniformBufferIndex); var prefix = blockName + "."; if (arraySuffixRE.test(prefix)) { prefix = prefix.replace(arraySuffixRE, "."); } var uniforms = {}; blockSpec.uniformIndices.forEach(function (uniformNdx) { var data = uniformData[uniformNdx]; var typeInfo = typeMap[data.type]; var Type = typeInfo.Type; var length = data.size * typeInfo.size; var name = data.name; if (name.substr(0, prefix.length) === prefix) { name = name.substr(prefix.length); } uniforms[name] = new Type(array, data.offset, length / Type.BYTES_PER_ELEMENT); }); return { name: blockName, array: array, asFloat: new Float32Array(array), // for debugging buffer: buffer, uniforms: uniforms }; } /** * Creates a `UniformBlockInfo` for the specified block * * Note: **If the blockName matches no existing blocks a warning is printed to the console and a dummy * `UniformBlockInfo` is returned**. This is because when debugging GLSL * it is common to comment out large portions of a shader or for example set * the final output to a constant. When that happens blocks get optimized out. * If this function did not create dummy blocks your code would crash when debugging. * * @param {WebGL2RenderingContext} gl A WebGL2RenderingContext * @param {module:twgl.ProgramInfo} programInfo a `ProgramInfo` * as returned from {@link module:twgl.createProgramInfo} * @param {string} blockName The name of the block. * @return {module:twgl.UniformBlockInfo} The created UniformBlockInfo * @memberOf module:twgl/programs */ function createUniformBlockInfo(gl, programInfo, blockName) { return createUniformBlockInfoFromProgram(gl, programInfo.program, programInfo.uniformBlockSpec, blockName); } /** * Binds a unform block to the matching uniform block point. * Matches by blocks by name so blocks must have the same name not just the same * structure. * * If you have changed any values and you upload the valus into the corresponding WebGLBuffer * call {@link module:twgl.setUniformBlock} instead. * * @param {WebGL2RenderingContext} gl A WebGL 2 rendering context. * @param {(module:twgl.ProgramInfo|module:twgl.UniformBlockSpec)} programInfo a `ProgramInfo` * as returned from {@link module:twgl.createProgramInfo} or or `UniformBlockSpec` as * returned from {@link module:twgl.createUniformBlockSpecFromProgram}. * @param {module:twgl.UniformBlockInfo} uniformBlockInfo a `UniformBlockInfo` as returned from * {@link module:twgl.createUniformBlockInfo}. * @return {bool} true if buffer was bound. If the programInfo has no block with the same block name * no buffer is bound. * @memberOf module:twgl/programs */ function bindUniformBlock(gl, programInfo, uniformBlockInfo) { var uniformBlockSpec = programInfo.uniformBlockSpec || programInfo; var blockSpec = uniformBlockSpec.blockSpecs[uniformBlockInfo.name]; if (blockSpec) { var bufferBindIndex = blockSpec.index; gl.bindBufferRange(gl.UNIFORM_BUFFER, bufferBindIndex, uniformBlockInfo.buffer, uniformBlockInfo.offset || 0, uniformBlockInfo.array.byteLength); return true; } return false; } /** * Uploads the current uniform values to the corresponding WebGLBuffer * and binds that buffer to the program's corresponding bind point for the uniform block object. * * If you haven't changed any values and you only need to bind the uniform block object * call {@link module:twgl.bindUniformBlock} instead. * * @param {WebGL2RenderingContext} gl A WebGL 2 rendering context. * @param {(module:twgl.ProgramInfo|module:twgl.UniformBlockSpec)} programInfo a `ProgramInfo` * as returned from {@link module:twgl.createProgramInfo} or or `UniformBlockSpec` as * returned from {@link module:twgl.createUniformBlockSpecFromProgram}. * @param {module:twgl.UniformBlockInfo} uniformBlockInfo a `UniformBlockInfo` as returned from * {@link module:twgl.createUniformBlockInfo}. * @memberOf module:twgl/programs */ function setUniformBlock(gl, programInfo, uniformBlockInfo) { if (bindUniformBlock(gl, programInfo, uniformBlockInfo)) { gl.bufferData(gl.UNIFORM_BUFFER, uniformBlockInfo.array, gl.DYNAMIC_DRAW); } } /** * Sets values of a uniform block object * * @param {module:twgl.UniformBlockInfo} uniformBlockInfo A UniformBlockInfo as returned by {@link module:twgl.createUniformBlockInfo}. * @param {Object.} values A uniform name to value map where the value is correct for the given * type of uniform. So for example given a block like * * uniform SomeBlock { * float someFloat; * vec2 someVec2; * vec3 someVec3Array[2]; * int someInt; * } * * You can set the values of the uniform block with * * twgl.setBlockUniforms(someBlockInfo, { * someFloat: 12.3, * someVec2: [1, 2], * someVec3Array: [1, 2, 3, 4, 5, 6], * someInt: 5, * } * * Arrays can be JavaScript arrays or typed arrays * * Any name that doesn't match will be ignored * @memberOf module:twgl/programs */ function setBlockUniforms(uniformBlockInfo, values) { var uniforms = uniformBlockInfo.uniforms; for (var name in values) { var array = uniforms[name]; if (array) { var value = values[name]; if (value.length) { array.set(value); } else { array[0] = value; } } } } /** * Set uniforms and binds related textures. * * example: * * const programInfo = createProgramInfo( * gl, ["some-vs", "some-fs"]); * * const tex1 = gl.createTexture(); * const tex2 = gl.createTexture(); * * ... assume we setup the textures with data ... * * const uniforms = { * u_someSampler: tex1, * u_someOtherSampler: tex2, * u_someColor: [1,0,0,1], * u_somePosition: [0,1,1], * u_someMatrix: [ * 1,0,0,0, * 0,1,0,0, * 0,0,1,0, * 0,0,0,0, * ], * }; * * gl.useProgram(program); * * This will automatically bind the textures AND set the * uniforms. * * twgl.setUniforms(programInfo, uniforms); * * For the example above it is equivalent to * * var texUnit = 0; * gl.activeTexture(gl.TEXTURE0 + texUnit); * gl.bindTexture(gl.TEXTURE_2D, tex1); * gl.uniform1i(u_someSamplerLocation, texUnit++); * gl.activeTexture(gl.TEXTURE0 + texUnit); * gl.bindTexture(gl.TEXTURE_2D, tex2); * gl.uniform1i(u_someSamplerLocation, texUnit++); * gl.uniform4fv(u_someColorLocation, [1, 0, 0, 1]); * gl.uniform3fv(u_somePositionLocation, [0, 1, 1]); * gl.uniformMatrix4fv(u_someMatrix, false, [ * 1,0,0,0, * 0,1,0,0, * 0,0,1,0, * 0,0,0,0, * ]); * * Note it is perfectly reasonable to call `setUniforms` multiple times. For example * * const uniforms = { * u_someSampler: tex1, * u_someOtherSampler: tex2, * }; * * const moreUniforms { * u_someColor: [1,0,0,1], * u_somePosition: [0,1,1], * u_someMatrix: [ * 1,0,0,0, * 0,1,0,0, * 0,0,1,0, * 0,0,0,0, * ], * }; * * twgl.setUniforms(programInfo, uniforms); * twgl.setUniforms(programInfo, moreUniforms); * * You can also add WebGLSamplers to uniform samplers as in * * const uniforms = { * u_someSampler: { * texture: someWebGLTexture, * sampler: someWebGLSampler, * }, * }; * * In which case both the sampler and texture will be bound to the * same unit. * * @param {(module:twgl.ProgramInfo|Object.)} setters a `ProgramInfo` as returned from `createProgramInfo` or the setters returned from * `createUniformSetters`. * @param {Object.} values an object with values for the * uniforms. * You can pass multiple objects by putting them in an array or by calling with more arguments.For example * * const sharedUniforms = { * u_fogNear: 10, * u_projection: ... * ... * }; * * const localUniforms = { * u_world: ... * u_diffuseColor: ... * }; * * twgl.setUniforms(programInfo, sharedUniforms, localUniforms); * * // is the same as * * twgl.setUniforms(programInfo, [sharedUniforms, localUniforms]); * * // is the same as * * twgl.setUniforms(programInfo, sharedUniforms); * twgl.setUniforms(programInfo, localUniforms}; * * @memberOf module:twgl/programs */ function setUniforms(setters, values) { // eslint-disable-line var actualSetters = setters.uniformSetters || setters; var numArgs = arguments.length; for (var andx = 1; andx < numArgs; ++andx) { var vals = arguments[andx]; if (Array.isArray(vals)) { var numValues = vals.length; for (var ii = 0; ii < numValues; ++ii) { setUniforms(actualSetters, vals[ii]); } } else { for (var name in vals) { var setter = actualSetters[name]; if (setter) { setter(vals[name]); } } } } } /** * Creates setter functions for all attributes of a shader * program. You can pass this to {@link module:twgl.setBuffersAndAttributes} to set all your buffers and attributes. * * @see {@link module:twgl.setAttributes} for example * @param {WebGLProgram} program the program to create setters for. * @return {Object.} an object with a setter for each attribute by name. * @memberOf module:twgl/programs */ function createAttributeSetters(gl, program) { var attribSetters = {}; var numAttribs = gl.getProgramParameter(program, gl.ACTIVE_ATTRIBUTES); for (var ii = 0; ii < numAttribs; ++ii) { var attribInfo = gl.getActiveAttrib(program, ii); if (isBuiltIn(attribInfo)) { continue; } var index = gl.getAttribLocation(program, attribInfo.name); var typeInfo = attrTypeMap[attribInfo.type]; var setter = typeInfo.setter(gl, index, typeInfo); setter.location = index; attribSetters[attribInfo.name] = setter; } return attribSetters; } /** * Sets attributes and binds buffers (deprecated... use {@link module:twgl.setBuffersAndAttributes}) * * Example: * * const program = createProgramFromScripts( * gl, ["some-vs", "some-fs"); * * const attribSetters = createAttributeSetters(program); * * const positionBuffer = gl.createBuffer(); * const texcoordBuffer = gl.createBuffer(); * * const attribs = { * a_position: {buffer: positionBuffer, numComponents: 3}, * a_texcoord: {buffer: texcoordBuffer, numComponents: 2}, * }; * * gl.useProgram(program); * * This will automatically bind the buffers AND set the * attributes. * * setAttributes(attribSetters, attribs); * * Properties of attribs. For each attrib you can add * properties: * * * type: the type of data in the buffer. Default = gl.FLOAT * * normalize: whether or not to normalize the data. Default = false * * stride: the stride. Default = 0 * * offset: offset into the buffer. Default = 0 * * divisor: the divisor for instances. Default = undefined * * For example if you had 3 value float positions, 2 value * float texcoord and 4 value uint8 colors you'd setup your * attribs like this * * const attribs = { * a_position: {buffer: positionBuffer, numComponents: 3}, * a_texcoord: {buffer: texcoordBuffer, numComponents: 2}, * a_color: { * buffer: colorBuffer, * numComponents: 4, * type: gl.UNSIGNED_BYTE, * normalize: true, * }, * }; * * @param {Object.} setters Attribute setters as returned from createAttributeSetters * @param {Object.} buffers AttribInfos mapped by attribute name. * @memberOf module:twgl/programs * @deprecated use {@link module:twgl.setBuffersAndAttributes} */ function setAttributes(setters, buffers) { for (var name in buffers) { var setter = setters[name]; if (setter) { setter(buffers[name]); } } } /** * Sets attributes and buffers including the `ELEMENT_ARRAY_BUFFER` if appropriate * * Example: * * const programInfo = createProgramInfo( * gl, ["some-vs", "some-fs"); * * const arrays = { * position: { numComponents: 3, data: [0, 0, 0, 10, 0, 0, 0, 10, 0, 10, 10, 0], }, * texcoord: { numComponents: 2, data: [0, 0, 0, 1, 1, 0, 1, 1], }, * }; * * const bufferInfo = createBufferInfoFromArrays(gl, arrays); * * gl.useProgram(programInfo.program); * * This will automatically bind the buffers AND set the * attributes. * * setBuffersAndAttributes(gl, programInfo, bufferInfo); * * For the example above it is equivilent to * * gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer); * gl.enableVertexAttribArray(a_positionLocation); * gl.vertexAttribPointer(a_positionLocation, 3, gl.FLOAT, false, 0, 0); * gl.bindBuffer(gl.ARRAY_BUFFER, texcoordBuffer); * gl.enableVertexAttribArray(a_texcoordLocation); * gl.vertexAttribPointer(a_texcoordLocation, 4, gl.FLOAT, false, 0, 0); * * @param {WebGLRenderingContext} gl A WebGLRenderingContext. * @param {(module:twgl.ProgramInfo|Object.)} setters A `ProgramInfo` as returned from {@link module:twgl.createProgrmaInfo} or Attribute setters as returned from {@link module:twgl.createAttributeSetters} * @param {(module:twgl.BufferInfo|module:twgl.vertexArrayInfo)} buffers a `BufferInfo` as returned from {@link module:twgl.createBufferInfoFromArrays}. * or a `VertexArrayInfo` as returned from {@link module:twgl.createVertexArrayInfo} * @memberOf module:twgl/programs */ function setBuffersAndAttributes(gl, programInfo, buffers) { if (buffers.vertexArrayObject) { gl.bindVertexArray(buffers.vertexArrayObject); } else { setAttributes(programInfo.attribSetters || programInfo, buffers.attribs); if (buffers.indices) { gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffers.indices); } } } /** * @typedef {Object} ProgramInfo * @property {WebGLProgram} program A shader program * @property {Object} uniformSetters object of setters as returned from createUniformSetters, * @property {Object} attribSetters object of setters as returned from createAttribSetters, * @propetty {module:twgl.UniformBlockSpec} [uniformBlockSpace] a uniform block spec for making UniformBlockInfos with createUniformBlockInfo etc.. * @property {Object} [transformFeedbackInfo] info for transform feedbacks * @memberOf module:twgl */ /** * Creates a ProgramInfo from an existing program. * * A ProgramInfo contains * * programInfo = { * program: WebGLProgram, * uniformSetters: object of setters as returned from createUniformSetters, * attribSetters: object of setters as returned from createAttribSetters, * } * * @param {WebGLRenderingContext} gl The WebGLRenderingContext * to use. * @param {WebGLProgram} program an existing WebGLProgram. * @return {module:twgl.ProgramInfo} The created ProgramInfo. * @memberOf module:twgl/programs */ function createProgramInfoFromProgram(gl, program) { var uniformSetters = createUniformSetters(gl, program); var attribSetters = createAttributeSetters(gl, program); var programInfo = { program: program, uniformSetters: uniformSetters, attribSetters: attribSetters }; if (utils.isWebGL2(gl)) { programInfo.uniformBlockSpec = createUniformBlockSpecFromProgram(gl, program); programInfo.transformFeedbackInfo = createTransformFeedbackInfo(gl, program); } return programInfo; } /** * Creates a ProgramInfo from 2 sources. * * A ProgramInfo contains * * programInfo = { * program: WebGLProgram, * uniformSetters: object of setters as returned from createUniformSetters, * attribSetters: object of setters as returned from createAttribSetters, * } * * NOTE: There are 4 signatures for this function * * twgl.createProgramInfo(gl, [vs, fs], options); * twgl.createProgramInfo(gl, [vs, fs], opt_errFunc); * twgl.createProgramInfo(gl, [vs, fs], opt_attribs, opt_errFunc); * twgl.createProgramInfo(gl, [vs, fs], opt_attribs, opt_locations, opt_errFunc); * * @param {WebGLRenderingContext} gl The WebGLRenderingContext * to use. * @param {string[]} shaderSources Array of sources for the * shaders or ids. The first is assumed to be the vertex shader, * the second the fragment shader. * @param {module:twgl.ProgramOptions|string[]} [opt_attribs] Options for the program or an array of attribs names. Locations will be assigned by index if not passed in * @param {number[]} [opt_locations] The locations for the attributes. A parallel array to opt_attribs letting you assign locations. * @param {module:twgl.ErrorCallback} opt_errorCallback callback for errors. By default it just prints an error to the console * on error. If you want something else pass an callback. It's passed an error message. * @return {module:twgl.ProgramInfo?} The created ProgramInfo or null if it failed to link or compile * @memberOf module:twgl/programs */ function createProgramInfo(gl, shaderSources, opt_attribs, opt_locations, opt_errorCallback) { var progOptions = getProgramOptions(opt_attribs, opt_locations, opt_errorCallback); var good = true; shaderSources = shaderSources.map(function (source) { // Lets assume if there is no \n it's an id if (source.indexOf("\n") < 0) { var script = getElementById(source); if (!script) { progOptions.errorCallback("no element with id: " + source); good = false; } else { source = script.text; } } return source; }); if (!good) { return null; } var program = createProgramFromSources(gl, shaderSources, progOptions); if (!program) { return null; } return createProgramInfoFromProgram(gl, program); } /***/ }), /* 6 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.axisRotate = axisRotate; exports.axisRotation = axisRotation; exports.copy = copy; exports.frustum = frustum; exports.getAxis = getAxis; exports.getTranslation = getTranslation; exports.identity = identity; exports.inverse = inverse; exports.lookAt = lookAt; exports.multiply = multiply; exports.negate = negate; exports.ortho = ortho; exports.perspective = perspective; exports.rotateX = rotateX; exports.rotateY = rotateY; exports.rotateZ = rotateZ; exports.rotationX = rotationX; exports.rotationY = rotationY; exports.rotationZ = rotationZ; exports.scale = scale; exports.scaling = scaling; exports.setAxis = setAxis; exports.setDefaultType = setDefaultType; exports.setTranslation = setTranslation; exports.transformDirection = transformDirection; exports.transformNormal = transformNormal; exports.transformPoint = transformPoint; exports.translate = translate; exports.translation = translation; exports.transpose = transpose; var v3 = _interopRequireWildcard(__webpack_require__(3)); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } /* * Copyright 2015, Gregg Tavares. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Gregg Tavares. nor the names of his * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * 4x4 Matrix math math functions. * * Almost all functions take an optional `dst` argument. If it is not passed in the * functions will create a new matrix. In other words you can do this * * const mat = m4.translation([1, 2, 3]); // Creates a new translation matrix * * or * * const mat = m4.create(); * m4.translation([1, 2, 3], mat); // Puts translation matrix in mat. * * The first style is often easier but depending on where it's used it generates garbage where * as there is almost never allocation with the second style. * * It is always save to pass any matrix as the destination. So for example * * const mat = m4.identity(); * const trans = m4.translation([1, 2, 3]); * m4.multiply(mat, trans, mat); // Multiplies mat * trans and puts result in mat. * * @module twgl/m4 */ var MatType = Float32Array; var tempV3a = v3.create(); var tempV3b = v3.create(); var tempV3c = v3.create(); /** * A JavaScript array with 16 values or a Float32Array with 16 values. * When created by the library will create the default type which is `Float32Array` * but can be set by calling {@link module:twgl/m4.setDefaultType}. * @typedef {(number[]|Float32Array)} Mat4 * @memberOf module:twgl/m4 */ /** * Sets the type this library creates for a Mat4 * @param {constructor} ctor the constructor for the type. Either `Float32Array` or `Array` * @return {constructor} previous constructor for Mat4 */ function setDefaultType(ctor) { var oldType = MatType; MatType = ctor; return oldType; } /** * Negates a matrix. * @param {module:twgl/m4.Mat4} m The matrix. * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. * @return {module:twgl/m4.Mat4} -m. * @memberOf module:twgl/m4 */ function negate(m, dst) { dst = dst || new MatType(16); dst[0] = -m[0]; dst[1] = -m[1]; dst[2] = -m[2]; dst[3] = -m[3]; dst[4] = -m[4]; dst[5] = -m[5]; dst[6] = -m[6]; dst[7] = -m[7]; dst[8] = -m[8]; dst[9] = -m[9]; dst[10] = -m[10]; dst[11] = -m[11]; dst[12] = -m[12]; dst[13] = -m[13]; dst[14] = -m[14]; dst[15] = -m[15]; return dst; } /** * Copies a matrix. * @param {module:twgl/m4.Mat4} m The matrix. * @param {module:twgl/m4.Mat4} [dst] The matrix. * @return {module:twgl/m4.Mat4} A copy of m. * @memberOf module:twgl/m4 */ function copy(m, dst) { dst = dst || new MatType(16); dst[0] = m[0]; dst[1] = m[1]; dst[2] = m[2]; dst[3] = m[3]; dst[4] = m[4]; dst[5] = m[5]; dst[6] = m[6]; dst[7] = m[7]; dst[8] = m[8]; dst[9] = m[9]; dst[10] = m[10]; dst[11] = m[11]; dst[12] = m[12]; dst[13] = m[13]; dst[14] = m[14]; dst[15] = m[15]; return dst; } /** * Creates an n-by-n identity matrix. * * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. * @return {module:twgl/m4.Mat4} An n-by-n identity matrix. * @memberOf module:twgl/m4 */ function identity(dst) { dst = dst || new MatType(16); dst[0] = 1; dst[1] = 0; dst[2] = 0; dst[3] = 0; dst[4] = 0; dst[5] = 1; dst[6] = 0; dst[7] = 0; dst[8] = 0; dst[9] = 0; dst[10] = 1; dst[11] = 0; dst[12] = 0; dst[13] = 0; dst[14] = 0; dst[15] = 1; return dst; } /** * Takes the transpose of a matrix. * @param {module:twgl/m4.Mat4} m The matrix. * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. * @return {module:twgl/m4.Mat4} The transpose of m. * @memberOf module:twgl/m4 */ function transpose(m, dst) { dst = dst || new MatType(16); if (dst === m) { var t; t = m[1]; m[1] = m[4]; m[4] = t; t = m[2]; m[2] = m[8]; m[8] = t; t = m[3]; m[3] = m[12]; m[12] = t; t = m[6]; m[6] = m[9]; m[9] = t; t = m[7]; m[7] = m[13]; m[13] = t; t = m[11]; m[11] = m[14]; m[14] = t; return dst; } var m00 = m[0 * 4 + 0]; var m01 = m[0 * 4 + 1]; var m02 = m[0 * 4 + 2]; var m03 = m[0 * 4 + 3]; var m10 = m[1 * 4 + 0]; var m11 = m[1 * 4 + 1]; var m12 = m[1 * 4 + 2]; var m13 = m[1 * 4 + 3]; var m20 = m[2 * 4 + 0]; var m21 = m[2 * 4 + 1]; var m22 = m[2 * 4 + 2]; var m23 = m[2 * 4 + 3]; var m30 = m[3 * 4 + 0]; var m31 = m[3 * 4 + 1]; var m32 = m[3 * 4 + 2]; var m33 = m[3 * 4 + 3]; dst[0] = m00; dst[1] = m10; dst[2] = m20; dst[3] = m30; dst[4] = m01; dst[5] = m11; dst[6] = m21; dst[7] = m31; dst[8] = m02; dst[9] = m12; dst[10] = m22; dst[11] = m32; dst[12] = m03; dst[13] = m13; dst[14] = m23; dst[15] = m33; return dst; } /** * Computes the inverse of a 4-by-4 matrix. * @param {module:twgl/m4.Mat4} m The matrix. * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. * @return {module:twgl/m4.Mat4} The inverse of m. * @memberOf module:twgl/m4 */ function inverse(m, dst) { dst = dst || new MatType(16); var m00 = m[0 * 4 + 0]; var m01 = m[0 * 4 + 1]; var m02 = m[0 * 4 + 2]; var m03 = m[0 * 4 + 3]; var m10 = m[1 * 4 + 0]; var m11 = m[1 * 4 + 1]; var m12 = m[1 * 4 + 2]; var m13 = m[1 * 4 + 3]; var m20 = m[2 * 4 + 0]; var m21 = m[2 * 4 + 1]; var m22 = m[2 * 4 + 2]; var m23 = m[2 * 4 + 3]; var m30 = m[3 * 4 + 0]; var m31 = m[3 * 4 + 1]; var m32 = m[3 * 4 + 2]; var m33 = m[3 * 4 + 3]; var tmp_0 = m22 * m33; var tmp_1 = m32 * m23; var tmp_2 = m12 * m33; var tmp_3 = m32 * m13; var tmp_4 = m12 * m23; var tmp_5 = m22 * m13; var tmp_6 = m02 * m33; var tmp_7 = m32 * m03; var tmp_8 = m02 * m23; var tmp_9 = m22 * m03; var tmp_10 = m02 * m13; var tmp_11 = m12 * m03; var tmp_12 = m20 * m31; var tmp_13 = m30 * m21; var tmp_14 = m10 * m31; var tmp_15 = m30 * m11; var tmp_16 = m10 * m21; var tmp_17 = m20 * m11; var tmp_18 = m00 * m31; var tmp_19 = m30 * m01; var tmp_20 = m00 * m21; var tmp_21 = m20 * m01; var tmp_22 = m00 * m11; var tmp_23 = m10 * m01; var t0 = tmp_0 * m11 + tmp_3 * m21 + tmp_4 * m31 - (tmp_1 * m11 + tmp_2 * m21 + tmp_5 * m31); var t1 = tmp_1 * m01 + tmp_6 * m21 + tmp_9 * m31 - (tmp_0 * m01 + tmp_7 * m21 + tmp_8 * m31); var t2 = tmp_2 * m01 + tmp_7 * m11 + tmp_10 * m31 - (tmp_3 * m01 + tmp_6 * m11 + tmp_11 * m31); var t3 = tmp_5 * m01 + tmp_8 * m11 + tmp_11 * m21 - (tmp_4 * m01 + tmp_9 * m11 + tmp_10 * m21); var d = 1.0 / (m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3); dst[0] = d * t0; dst[1] = d * t1; dst[2] = d * t2; dst[3] = d * t3; dst[4] = d * (tmp_1 * m10 + tmp_2 * m20 + tmp_5 * m30 - (tmp_0 * m10 + tmp_3 * m20 + tmp_4 * m30)); dst[5] = d * (tmp_0 * m00 + tmp_7 * m20 + tmp_8 * m30 - (tmp_1 * m00 + tmp_6 * m20 + tmp_9 * m30)); dst[6] = d * (tmp_3 * m00 + tmp_6 * m10 + tmp_11 * m30 - (tmp_2 * m00 + tmp_7 * m10 + tmp_10 * m30)); dst[7] = d * (tmp_4 * m00 + tmp_9 * m10 + tmp_10 * m20 - (tmp_5 * m00 + tmp_8 * m10 + tmp_11 * m20)); dst[8] = d * (tmp_12 * m13 + tmp_15 * m23 + tmp_16 * m33 - (tmp_13 * m13 + tmp_14 * m23 + tmp_17 * m33)); dst[9] = d * (tmp_13 * m03 + tmp_18 * m23 + tmp_21 * m33 - (tmp_12 * m03 + tmp_19 * m23 + tmp_20 * m33)); dst[10] = d * (tmp_14 * m03 + tmp_19 * m13 + tmp_22 * m33 - (tmp_15 * m03 + tmp_18 * m13 + tmp_23 * m33)); dst[11] = d * (tmp_17 * m03 + tmp_20 * m13 + tmp_23 * m23 - (tmp_16 * m03 + tmp_21 * m13 + tmp_22 * m23)); dst[12] = d * (tmp_14 * m22 + tmp_17 * m32 + tmp_13 * m12 - (tmp_16 * m32 + tmp_12 * m12 + tmp_15 * m22)); dst[13] = d * (tmp_20 * m32 + tmp_12 * m02 + tmp_19 * m22 - (tmp_18 * m22 + tmp_21 * m32 + tmp_13 * m02)); dst[14] = d * (tmp_18 * m12 + tmp_23 * m32 + tmp_15 * m02 - (tmp_22 * m32 + tmp_14 * m02 + tmp_19 * m12)); dst[15] = d * (tmp_22 * m22 + tmp_16 * m02 + tmp_21 * m12 - (tmp_20 * m12 + tmp_23 * m22 + tmp_17 * m02)); return dst; } /** * Multiplies two 4-by-4 matrices with a on the left and b on the right * @param {module:twgl/m4.Mat4} a The matrix on the left. * @param {module:twgl/m4.Mat4} b The matrix on the right. * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. * @return {module:twgl/m4.Mat4} The matrix product of a and b. * @memberOf module:twgl/m4 */ function multiply(a, b, dst) { dst = dst || new MatType(16); var a00 = a[0]; var a01 = a[1]; var a02 = a[2]; var a03 = a[3]; var a10 = a[4 + 0]; var a11 = a[4 + 1]; var a12 = a[4 + 2]; var a13 = a[4 + 3]; var a20 = a[8 + 0]; var a21 = a[8 + 1]; var a22 = a[8 + 2]; var a23 = a[8 + 3]; var a30 = a[12 + 0]; var a31 = a[12 + 1]; var a32 = a[12 + 2]; var a33 = a[12 + 3]; var b00 = b[0]; var b01 = b[1]; var b02 = b[2]; var b03 = b[3]; var b10 = b[4 + 0]; var b11 = b[4 + 1]; var b12 = b[4 + 2]; var b13 = b[4 + 3]; var b20 = b[8 + 0]; var b21 = b[8 + 1]; var b22 = b[8 + 2]; var b23 = b[8 + 3]; var b30 = b[12 + 0]; var b31 = b[12 + 1]; var b32 = b[12 + 2]; var b33 = b[12 + 3]; dst[0] = a00 * b00 + a10 * b01 + a20 * b02 + a30 * b03; dst[1] = a01 * b00 + a11 * b01 + a21 * b02 + a31 * b03; dst[2] = a02 * b00 + a12 * b01 + a22 * b02 + a32 * b03; dst[3] = a03 * b00 + a13 * b01 + a23 * b02 + a33 * b03; dst[4] = a00 * b10 + a10 * b11 + a20 * b12 + a30 * b13; dst[5] = a01 * b10 + a11 * b11 + a21 * b12 + a31 * b13; dst[6] = a02 * b10 + a12 * b11 + a22 * b12 + a32 * b13; dst[7] = a03 * b10 + a13 * b11 + a23 * b12 + a33 * b13; dst[8] = a00 * b20 + a10 * b21 + a20 * b22 + a30 * b23; dst[9] = a01 * b20 + a11 * b21 + a21 * b22 + a31 * b23; dst[10] = a02 * b20 + a12 * b21 + a22 * b22 + a32 * b23; dst[11] = a03 * b20 + a13 * b21 + a23 * b22 + a33 * b23; dst[12] = a00 * b30 + a10 * b31 + a20 * b32 + a30 * b33; dst[13] = a01 * b30 + a11 * b31 + a21 * b32 + a31 * b33; dst[14] = a02 * b30 + a12 * b31 + a22 * b32 + a32 * b33; dst[15] = a03 * b30 + a13 * b31 + a23 * b32 + a33 * b33; return dst; } /** * Sets the translation component of a 4-by-4 matrix to the given * vector. * @param {module:twgl/m4.Mat4} a The matrix. * @param {Vec3} v The vector. * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. * @return {module:twgl/m4.Mat4} a once modified. * @memberOf module:twgl/m4 */ function setTranslation(a, v, dst) { dst = dst || identity(); if (a !== dst) { dst[0] = a[0]; dst[1] = a[1]; dst[2] = a[2]; dst[3] = a[3]; dst[4] = a[4]; dst[5] = a[5]; dst[6] = a[6]; dst[7] = a[7]; dst[8] = a[8]; dst[9] = a[9]; dst[10] = a[10]; dst[11] = a[11]; } dst[12] = v[0]; dst[13] = v[1]; dst[14] = v[2]; dst[15] = 1; return dst; } /** * Returns the translation component of a 4-by-4 matrix as a vector with 3 * entries. * @param {module:twgl/m4.Mat4} m The matrix. * @param {Vec3} [dst] vector.. * @return {Vec3} The translation component of m. * @memberOf module:twgl/m4 */ function getTranslation(m, dst) { dst = dst || v3.create(); dst[0] = m[12]; dst[1] = m[13]; dst[2] = m[14]; return dst; } /** * Returns an axis of a 4x4 matrix as a vector with 3 entries * @param {module:twgl/m4.Mat4} m The matrix. * @param {number} axis The axis 0 = x, 1 = y, 2 = z; * @return {Vec3} [dst] vector. * @return {Vec3} The axis component of m. * @memberOf module:twgl/m4 */ function getAxis(m, axis, dst) { dst = dst || v3.create(); var off = axis * 4; dst[0] = m[off + 0]; dst[1] = m[off + 1]; dst[2] = m[off + 2]; return dst; } /** * Sets an axis of a 4x4 matrix as a vector with 3 entries * @param {Vec3} v the axis vector * @param {number} axis The axis 0 = x, 1 = y, 2 = z; * @param {module:twgl/m4.Mat4} [dst] The matrix to set. If none a new one is created * @return {module:twgl/m4.Mat4} dst * @memberOf module:twgl/m4 */ function setAxis(a, v, axis, dst) { if (dst !== a) { dst = copy(a, dst); } var off = axis * 4; dst[off + 0] = v[0]; dst[off + 1] = v[1]; dst[off + 2] = v[2]; return dst; } /** * Computes a 4-by-4 perspective transformation matrix given the angular height * of the frustum, the aspect ratio, and the near and far clipping planes. The * arguments define a frustum extending in the negative z direction. The given * angle is the vertical angle of the frustum, and the horizontal angle is * determined to produce the given aspect ratio. The arguments near and far are * the distances to the near and far clipping planes. Note that near and far * are not z coordinates, but rather they are distances along the negative * z-axis. The matrix generated sends the viewing frustum to the unit box. * We assume a unit box extending from -1 to 1 in the x and y dimensions and * from 0 to 1 in the z dimension. * @param {number} fieldOfViewYInRadians The camera angle from top to bottom (in radians). * @param {number} aspect The aspect ratio width / height. * @param {number} zNear The depth (negative z coordinate) * of the near clipping plane. * @param {number} zFar The depth (negative z coordinate) * of the far clipping plane. * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. * @return {module:twgl/m4.Mat4} The perspective matrix. * @memberOf module:twgl/m4 */ function perspective(fieldOfViewYInRadians, aspect, zNear, zFar, dst) { dst = dst || new MatType(16); var f = Math.tan(Math.PI * 0.5 - 0.5 * fieldOfViewYInRadians); var rangeInv = 1.0 / (zNear - zFar); dst[0] = f / aspect; dst[1] = 0; dst[2] = 0; dst[3] = 0; dst[4] = 0; dst[5] = f; dst[6] = 0; dst[7] = 0; dst[8] = 0; dst[9] = 0; dst[10] = (zNear + zFar) * rangeInv; dst[11] = -1; dst[12] = 0; dst[13] = 0; dst[14] = zNear * zFar * rangeInv * 2; dst[15] = 0; return dst; } /** * Computes a 4-by-4 othogonal transformation matrix given the left, right, * bottom, and top dimensions of the near clipping plane as well as the * near and far clipping plane distances. * @param {number} left Left side of the near clipping plane viewport. * @param {number} right Right side of the near clipping plane viewport. * @param {number} top Top of the near clipping plane viewport. * @param {number} bottom Bottom of the near clipping plane viewport. * @param {number} near The depth (negative z coordinate) * of the near clipping plane. * @param {number} far The depth (negative z coordinate) * of the far clipping plane. * @param {module:twgl/m4.Mat4} [dst] Output matrix. * @return {module:twgl/m4.Mat4} The perspective matrix. * @memberOf module:twgl/m4 */ function ortho(left, right, bottom, top, near, far, dst) { dst = dst || new MatType(16); dst[0] = 2 / (right - left); dst[1] = 0; dst[2] = 0; dst[3] = 0; dst[4] = 0; dst[5] = 2 / (top - bottom); dst[6] = 0; dst[7] = 0; dst[8] = 0; dst[9] = 0; dst[10] = 2 / (near - far); dst[11] = 0; dst[12] = (right + left) / (left - right); dst[13] = (top + bottom) / (bottom - top); dst[14] = (far + near) / (near - far); dst[15] = 1; return dst; } /** * Computes a 4-by-4 perspective transformation matrix given the left, right, * top, bottom, near and far clipping planes. The arguments define a frustum * extending in the negative z direction. The arguments near and far are the * distances to the near and far clipping planes. Note that near and far are not * z coordinates, but rather they are distances along the negative z-axis. The * matrix generated sends the viewing frustum to the unit box. We assume a unit * box extending from -1 to 1 in the x and y dimensions and from 0 to 1 in the z * dimension. * @param {number} left The x coordinate of the left plane of the box. * @param {number} right The x coordinate of the right plane of the box. * @param {number} bottom The y coordinate of the bottom plane of the box. * @param {number} top The y coordinate of the right plane of the box. * @param {number} near The negative z coordinate of the near plane of the box. * @param {number} far The negative z coordinate of the far plane of the box. * @param {module:twgl/m4.Mat4} [dst] Output matrix. * @return {module:twgl/m4.Mat4} The perspective projection matrix. * @memberOf module:twgl/m4 */ function frustum(left, right, bottom, top, near, far, dst) { dst = dst || new MatType(16); var dx = right - left; var dy = top - bottom; var dz = near - far; dst[0] = 2 * near / dx; dst[1] = 0; dst[2] = 0; dst[3] = 0; dst[4] = 0; dst[5] = 2 * near / dy; dst[6] = 0; dst[7] = 0; dst[8] = (left + right) / dx; dst[9] = (top + bottom) / dy; dst[10] = far / dz; dst[11] = -1; dst[12] = 0; dst[13] = 0; dst[14] = near * far / dz; dst[15] = 0; return dst; } /** * Computes a 4-by-4 look-at transformation. * * This is a matrix which positions the camera itself. If you want * a view matrix (a matrix which moves things in front of the camera) * take the inverse of this. * * @param {Vec3} eye The position of the eye. * @param {Vec3} target The position meant to be viewed. * @param {Vec3} up A vector pointing up. * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. * @return {module:twgl/m4.Mat4} The look-at matrix. * @memberOf module:twgl/m4 */ function lookAt(eye, target, up, dst) { dst = dst || new MatType(16); var xAxis = tempV3a; var yAxis = tempV3b; var zAxis = tempV3c; v3.normalize(v3.subtract(eye, target, zAxis), zAxis); v3.normalize(v3.cross(up, zAxis, xAxis), xAxis); v3.normalize(v3.cross(zAxis, xAxis, yAxis), yAxis); dst[0] = xAxis[0]; dst[1] = xAxis[1]; dst[2] = xAxis[2]; dst[3] = 0; dst[4] = yAxis[0]; dst[5] = yAxis[1]; dst[6] = yAxis[2]; dst[7] = 0; dst[8] = zAxis[0]; dst[9] = zAxis[1]; dst[10] = zAxis[2]; dst[11] = 0; dst[12] = eye[0]; dst[13] = eye[1]; dst[14] = eye[2]; dst[15] = 1; return dst; } /** * Creates a 4-by-4 matrix which translates by the given vector v. * @param {Vec3} v The vector by * which to translate. * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. * @return {module:twgl/m4.Mat4} The translation matrix. * @memberOf module:twgl/m4 */ function translation(v, dst) { dst = dst || new MatType(16); dst[0] = 1; dst[1] = 0; dst[2] = 0; dst[3] = 0; dst[4] = 0; dst[5] = 1; dst[6] = 0; dst[7] = 0; dst[8] = 0; dst[9] = 0; dst[10] = 1; dst[11] = 0; dst[12] = v[0]; dst[13] = v[1]; dst[14] = v[2]; dst[15] = 1; return dst; } /** * Modifies the given 4-by-4 matrix by translation by the given vector v. * @param {module:twgl/m4.Mat4} m The matrix. * @param {Vec3} v The vector by * which to translate. * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. * @return {module:twgl/m4.Mat4} m once modified. * @memberOf module:twgl/m4 */ function translate(m, v, dst) { dst = dst || new MatType(16); var v0 = v[0]; var v1 = v[1]; var v2 = v[2]; var m00 = m[0]; var m01 = m[1]; var m02 = m[2]; var m03 = m[3]; var m10 = m[1 * 4 + 0]; var m11 = m[1 * 4 + 1]; var m12 = m[1 * 4 + 2]; var m13 = m[1 * 4 + 3]; var m20 = m[2 * 4 + 0]; var m21 = m[2 * 4 + 1]; var m22 = m[2 * 4 + 2]; var m23 = m[2 * 4 + 3]; var m30 = m[3 * 4 + 0]; var m31 = m[3 * 4 + 1]; var m32 = m[3 * 4 + 2]; var m33 = m[3 * 4 + 3]; if (m !== dst) { dst[0] = m00; dst[1] = m01; dst[2] = m02; dst[3] = m03; dst[4] = m10; dst[5] = m11; dst[6] = m12; dst[7] = m13; dst[8] = m20; dst[9] = m21; dst[10] = m22; dst[11] = m23; } dst[12] = m00 * v0 + m10 * v1 + m20 * v2 + m30; dst[13] = m01 * v0 + m11 * v1 + m21 * v2 + m31; dst[14] = m02 * v0 + m12 * v1 + m22 * v2 + m32; dst[15] = m03 * v0 + m13 * v1 + m23 * v2 + m33; return dst; } /** * Creates a 4-by-4 matrix which rotates around the x-axis by the given angle. * @param {number} angleInRadians The angle by which to rotate (in radians). * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. * @return {module:twgl/m4.Mat4} The rotation matrix. * @memberOf module:twgl/m4 */ function rotationX(angleInRadians, dst) { dst = dst || new MatType(16); var c = Math.cos(angleInRadians); var s = Math.sin(angleInRadians); dst[0] = 1; dst[1] = 0; dst[2] = 0; dst[3] = 0; dst[4] = 0; dst[5] = c; dst[6] = s; dst[7] = 0; dst[8] = 0; dst[9] = -s; dst[10] = c; dst[11] = 0; dst[12] = 0; dst[13] = 0; dst[14] = 0; dst[15] = 1; return dst; } /** * Modifies the given 4-by-4 matrix by a rotation around the x-axis by the given * angle. * @param {module:twgl/m4.Mat4} m The matrix. * @param {number} angleInRadians The angle by which to rotate (in radians). * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. * @return {module:twgl/m4.Mat4} m once modified. * @memberOf module:twgl/m4 */ function rotateX(m, angleInRadians, dst) { dst = dst || new MatType(16); var m10 = m[4]; var m11 = m[5]; var m12 = m[6]; var m13 = m[7]; var m20 = m[8]; var m21 = m[9]; var m22 = m[10]; var m23 = m[11]; var c = Math.cos(angleInRadians); var s = Math.sin(angleInRadians); dst[4] = c * m10 + s * m20; dst[5] = c * m11 + s * m21; dst[6] = c * m12 + s * m22; dst[7] = c * m13 + s * m23; dst[8] = c * m20 - s * m10; dst[9] = c * m21 - s * m11; dst[10] = c * m22 - s * m12; dst[11] = c * m23 - s * m13; if (m !== dst) { dst[0] = m[0]; dst[1] = m[1]; dst[2] = m[2]; dst[3] = m[3]; dst[12] = m[12]; dst[13] = m[13]; dst[14] = m[14]; dst[15] = m[15]; } return dst; } /** * Creates a 4-by-4 matrix which rotates around the y-axis by the given angle. * @param {number} angleInRadians The angle by which to rotate (in radians). * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. * @return {module:twgl/m4.Mat4} The rotation matrix. * @memberOf module:twgl/m4 */ function rotationY(angleInRadians, dst) { dst = dst || new MatType(16); var c = Math.cos(angleInRadians); var s = Math.sin(angleInRadians); dst[0] = c; dst[1] = 0; dst[2] = -s; dst[3] = 0; dst[4] = 0; dst[5] = 1; dst[6] = 0; dst[7] = 0; dst[8] = s; dst[9] = 0; dst[10] = c; dst[11] = 0; dst[12] = 0; dst[13] = 0; dst[14] = 0; dst[15] = 1; return dst; } /** * Modifies the given 4-by-4 matrix by a rotation around the y-axis by the given * angle. * @param {module:twgl/m4.Mat4} m The matrix. * @param {number} angleInRadians The angle by which to rotate (in radians). * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. * @return {module:twgl/m4.Mat4} m once modified. * @memberOf module:twgl/m4 */ function rotateY(m, angleInRadians, dst) { dst = dst || new MatType(16); var m00 = m[0 * 4 + 0]; var m01 = m[0 * 4 + 1]; var m02 = m[0 * 4 + 2]; var m03 = m[0 * 4 + 3]; var m20 = m[2 * 4 + 0]; var m21 = m[2 * 4 + 1]; var m22 = m[2 * 4 + 2]; var m23 = m[2 * 4 + 3]; var c = Math.cos(angleInRadians); var s = Math.sin(angleInRadians); dst[0] = c * m00 - s * m20; dst[1] = c * m01 - s * m21; dst[2] = c * m02 - s * m22; dst[3] = c * m03 - s * m23; dst[8] = c * m20 + s * m00; dst[9] = c * m21 + s * m01; dst[10] = c * m22 + s * m02; dst[11] = c * m23 + s * m03; if (m !== dst) { dst[4] = m[4]; dst[5] = m[5]; dst[6] = m[6]; dst[7] = m[7]; dst[12] = m[12]; dst[13] = m[13]; dst[14] = m[14]; dst[15] = m[15]; } return dst; } /** * Creates a 4-by-4 matrix which rotates around the z-axis by the given angle. * @param {number} angleInRadians The angle by which to rotate (in radians). * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. * @return {module:twgl/m4.Mat4} The rotation matrix. * @memberOf module:twgl/m4 */ function rotationZ(angleInRadians, dst) { dst = dst || new MatType(16); var c = Math.cos(angleInRadians); var s = Math.sin(angleInRadians); dst[0] = c; dst[1] = s; dst[2] = 0; dst[3] = 0; dst[4] = -s; dst[5] = c; dst[6] = 0; dst[7] = 0; dst[8] = 0; dst[9] = 0; dst[10] = 1; dst[11] = 0; dst[12] = 0; dst[13] = 0; dst[14] = 0; dst[15] = 1; return dst; } /** * Modifies the given 4-by-4 matrix by a rotation around the z-axis by the given * angle. * @param {module:twgl/m4.Mat4} m The matrix. * @param {number} angleInRadians The angle by which to rotate (in radians). * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. * @return {module:twgl/m4.Mat4} m once modified. * @memberOf module:twgl/m4 */ function rotateZ(m, angleInRadians, dst) { dst = dst || new MatType(16); var m00 = m[0 * 4 + 0]; var m01 = m[0 * 4 + 1]; var m02 = m[0 * 4 + 2]; var m03 = m[0 * 4 + 3]; var m10 = m[1 * 4 + 0]; var m11 = m[1 * 4 + 1]; var m12 = m[1 * 4 + 2]; var m13 = m[1 * 4 + 3]; var c = Math.cos(angleInRadians); var s = Math.sin(angleInRadians); dst[0] = c * m00 + s * m10; dst[1] = c * m01 + s * m11; dst[2] = c * m02 + s * m12; dst[3] = c * m03 + s * m13; dst[4] = c * m10 - s * m00; dst[5] = c * m11 - s * m01; dst[6] = c * m12 - s * m02; dst[7] = c * m13 - s * m03; if (m !== dst) { dst[8] = m[8]; dst[9] = m[9]; dst[10] = m[10]; dst[11] = m[11]; dst[12] = m[12]; dst[13] = m[13]; dst[14] = m[14]; dst[15] = m[15]; } return dst; } /** * Creates a 4-by-4 matrix which rotates around the given axis by the given * angle. * @param {Vec3} axis The axis * about which to rotate. * @param {number} angleInRadians The angle by which to rotate (in radians). * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. * @return {module:twgl/m4.Mat4} A matrix which rotates angle radians * around the axis. * @memberOf module:twgl/m4 */ function axisRotation(axis, angleInRadians, dst) { dst = dst || new MatType(16); var x = axis[0]; var y = axis[1]; var z = axis[2]; var n = Math.sqrt(x * x + y * y + z * z); x /= n; y /= n; z /= n; var xx = x * x; var yy = y * y; var zz = z * z; var c = Math.cos(angleInRadians); var s = Math.sin(angleInRadians); var oneMinusCosine = 1 - c; dst[0] = xx + (1 - xx) * c; dst[1] = x * y * oneMinusCosine + z * s; dst[2] = x * z * oneMinusCosine - y * s; dst[3] = 0; dst[4] = x * y * oneMinusCosine - z * s; dst[5] = yy + (1 - yy) * c; dst[6] = y * z * oneMinusCosine + x * s; dst[7] = 0; dst[8] = x * z * oneMinusCosine + y * s; dst[9] = y * z * oneMinusCosine - x * s; dst[10] = zz + (1 - zz) * c; dst[11] = 0; dst[12] = 0; dst[13] = 0; dst[14] = 0; dst[15] = 1; return dst; } /** * Modifies the given 4-by-4 matrix by rotation around the given axis by the * given angle. * @param {module:twgl/m4.Mat4} m The matrix. * @param {Vec3} axis The axis * about which to rotate. * @param {number} angleInRadians The angle by which to rotate (in radians). * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. * @return {module:twgl/m4.Mat4} m once modified. * @memberOf module:twgl/m4 */ function axisRotate(m, axis, angleInRadians, dst) { dst = dst || new MatType(16); var x = axis[0]; var y = axis[1]; var z = axis[2]; var n = Math.sqrt(x * x + y * y + z * z); x /= n; y /= n; z /= n; var xx = x * x; var yy = y * y; var zz = z * z; var c = Math.cos(angleInRadians); var s = Math.sin(angleInRadians); var oneMinusCosine = 1 - c; var r00 = xx + (1 - xx) * c; var r01 = x * y * oneMinusCosine + z * s; var r02 = x * z * oneMinusCosine - y * s; var r10 = x * y * oneMinusCosine - z * s; var r11 = yy + (1 - yy) * c; var r12 = y * z * oneMinusCosine + x * s; var r20 = x * z * oneMinusCosine + y * s; var r21 = y * z * oneMinusCosine - x * s; var r22 = zz + (1 - zz) * c; var m00 = m[0]; var m01 = m[1]; var m02 = m[2]; var m03 = m[3]; var m10 = m[4]; var m11 = m[5]; var m12 = m[6]; var m13 = m[7]; var m20 = m[8]; var m21 = m[9]; var m22 = m[10]; var m23 = m[11]; dst[0] = r00 * m00 + r01 * m10 + r02 * m20; dst[1] = r00 * m01 + r01 * m11 + r02 * m21; dst[2] = r00 * m02 + r01 * m12 + r02 * m22; dst[3] = r00 * m03 + r01 * m13 + r02 * m23; dst[4] = r10 * m00 + r11 * m10 + r12 * m20; dst[5] = r10 * m01 + r11 * m11 + r12 * m21; dst[6] = r10 * m02 + r11 * m12 + r12 * m22; dst[7] = r10 * m03 + r11 * m13 + r12 * m23; dst[8] = r20 * m00 + r21 * m10 + r22 * m20; dst[9] = r20 * m01 + r21 * m11 + r22 * m21; dst[10] = r20 * m02 + r21 * m12 + r22 * m22; dst[11] = r20 * m03 + r21 * m13 + r22 * m23; if (m !== dst) { dst[12] = m[12]; dst[13] = m[13]; dst[14] = m[14]; dst[15] = m[15]; } return dst; } /** * Creates a 4-by-4 matrix which scales in each dimension by an amount given by * the corresponding entry in the given vector; assumes the vector has three * entries. * @param {Vec3} v A vector of * three entries specifying the factor by which to scale in each dimension. * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. * @return {module:twgl/m4.Mat4} The scaling matrix. * @memberOf module:twgl/m4 */ function scaling(v, dst) { dst = dst || new MatType(16); dst[0] = v[0]; dst[1] = 0; dst[2] = 0; dst[3] = 0; dst[4] = 0; dst[5] = v[1]; dst[6] = 0; dst[7] = 0; dst[8] = 0; dst[9] = 0; dst[10] = v[2]; dst[11] = 0; dst[12] = 0; dst[13] = 0; dst[14] = 0; dst[15] = 1; return dst; } /** * Modifies the given 4-by-4 matrix, scaling in each dimension by an amount * given by the corresponding entry in the given vector; assumes the vector has * three entries. * @param {module:twgl/m4.Mat4} m The matrix to be modified. * @param {Vec3} v A vector of three entries specifying the * factor by which to scale in each dimension. * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. * @return {module:twgl/m4.Mat4} m once modified. * @memberOf module:twgl/m4 */ function scale(m, v, dst) { dst = dst || new MatType(16); var v0 = v[0]; var v1 = v[1]; var v2 = v[2]; dst[0] = v0 * m[0 * 4 + 0]; dst[1] = v0 * m[0 * 4 + 1]; dst[2] = v0 * m[0 * 4 + 2]; dst[3] = v0 * m[0 * 4 + 3]; dst[4] = v1 * m[1 * 4 + 0]; dst[5] = v1 * m[1 * 4 + 1]; dst[6] = v1 * m[1 * 4 + 2]; dst[7] = v1 * m[1 * 4 + 3]; dst[8] = v2 * m[2 * 4 + 0]; dst[9] = v2 * m[2 * 4 + 1]; dst[10] = v2 * m[2 * 4 + 2]; dst[11] = v2 * m[2 * 4 + 3]; if (m !== dst) { dst[12] = m[12]; dst[13] = m[13]; dst[14] = m[14]; dst[15] = m[15]; } return dst; } /** * Takes a 4-by-4 matrix and a vector with 3 entries, * interprets the vector as a point, transforms that point by the matrix, and * returns the result as a vector with 3 entries. * @param {module:twgl/m4.Mat4} m The matrix. * @param {Vec3} v The point. * @param {Vec3} dst optional vec3 to store result * @return {Vec3} dst or new vec3 if not provided * @memberOf module:twgl/m4 */ function transformPoint(m, v, dst) { dst = dst || v3.create(); var v0 = v[0]; var v1 = v[1]; var v2 = v[2]; var d = v0 * m[0 * 4 + 3] + v1 * m[1 * 4 + 3] + v2 * m[2 * 4 + 3] + m[3 * 4 + 3]; dst[0] = (v0 * m[0 * 4 + 0] + v1 * m[1 * 4 + 0] + v2 * m[2 * 4 + 0] + m[3 * 4 + 0]) / d; dst[1] = (v0 * m[0 * 4 + 1] + v1 * m[1 * 4 + 1] + v2 * m[2 * 4 + 1] + m[3 * 4 + 1]) / d; dst[2] = (v0 * m[0 * 4 + 2] + v1 * m[1 * 4 + 2] + v2 * m[2 * 4 + 2] + m[3 * 4 + 2]) / d; return dst; } /** * Takes a 4-by-4 matrix and a vector with 3 entries, interprets the vector as a * direction, transforms that direction by the matrix, and returns the result; * assumes the transformation of 3-dimensional space represented by the matrix * is parallel-preserving, i.e. any combination of rotation, scaling and * translation, but not a perspective distortion. Returns a vector with 3 * entries. * @param {module:twgl/m4.Mat4} m The matrix. * @param {Vec3} v The direction. * @param {Vec3} dst optional Vec3 to store result * @return {Vec3} dst or new Vec3 if not provided * @memberOf module:twgl/m4 */ function transformDirection(m, v, dst) { dst = dst || v3.create(); var v0 = v[0]; var v1 = v[1]; var v2 = v[2]; dst[0] = v0 * m[0 * 4 + 0] + v1 * m[1 * 4 + 0] + v2 * m[2 * 4 + 0]; dst[1] = v0 * m[0 * 4 + 1] + v1 * m[1 * 4 + 1] + v2 * m[2 * 4 + 1]; dst[2] = v0 * m[0 * 4 + 2] + v1 * m[1 * 4 + 2] + v2 * m[2 * 4 + 2]; return dst; } /** * Takes a 4-by-4 matrix m and a vector v with 3 entries, interprets the vector * as a normal to a surface, and computes a vector which is normal upon * transforming that surface by the matrix. The effect of this function is the * same as transforming v (as a direction) by the inverse-transpose of m. This * function assumes the transformation of 3-dimensional space represented by the * matrix is parallel-preserving, i.e. any combination of rotation, scaling and * translation, but not a perspective distortion. Returns a vector with 3 * entries. * @param {module:twgl/m4.Mat4} m The matrix. * @param {Vec3} v The normal. * @param {Vec3} [dst] The direction. * @return {Vec3} The transformed direction. * @memberOf module:twgl/m4 */ function transformNormal(m, v, dst) { dst = dst || v3.create(); var mi = inverse(m); var v0 = v[0]; var v1 = v[1]; var v2 = v[2]; dst[0] = v0 * mi[0 * 4 + 0] + v1 * mi[0 * 4 + 1] + v2 * mi[0 * 4 + 2]; dst[1] = v0 * mi[1 * 4 + 0] + v1 * mi[1 * 4 + 1] + v2 * mi[1 * 4 + 2]; dst[2] = v0 * mi[2 * 4 + 0] + v1 * mi[2 * 4 + 1] + v2 * mi[2 * 4 + 2]; return dst; } /***/ }), /* 7 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.createAttribsFromArrays = createAttribsFromArrays; exports.createBuffersFromArrays = createBuffersFromArrays; exports.createBufferFromArray = createBufferFromArray; exports.createBufferFromTypedArray = createBufferFromTypedArray; exports.createBufferInfoFromArrays = createBufferInfoFromArrays; exports.setAttribInfoBufferFromArray = setAttribInfoBufferFromArray; exports.setAttributePrefix = setAttributePrefix; exports.setAttributeDefaults_ = setDefaults; exports.getNumComponents_ = getNumComponents; exports.getArray_ = getArray; var typedArrays = _interopRequireWildcard(__webpack_require__(1)); var helper = _interopRequireWildcard(__webpack_require__(0)); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } /* * Copyright 2015, Gregg Tavares. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Gregg Tavares. nor the names of his * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * Low level attribute and buffer related functions * * You should generally not need to use these functions. They are provided * for those cases where you're doing something out of the ordinary * and you need lower level access. * * For backward compatibily they are available at both `twgl.attributes` and `twgl` * itself * * See {@link module:twgl} for core functions * * @module twgl/attributes */ // make sure we don't see a global gl var gl = undefined; // eslint-disable-line var defaults = { attribPrefix: "" }; /** * Sets the default attrib prefix * * When writing shaders I prefer to name attributes with `a_`, uniforms with `u_` and varyings with `v_` * as it makes it clear where they came from. But, when building geometry I prefer using unprefixed names. * * In otherwords I'll create arrays of geometry like this * * var arrays = { * position: ... * normal: ... * texcoord: ... * }; * * But need those mapped to attributes and my attributes start with `a_`. * * @deprecated see {@link module:twgl.setDefaults} * @param {string} prefix prefix for attribs * @memberOf module:twgl/attributes */ function setAttributePrefix(prefix) { defaults.attribPrefix = prefix; } function setDefaults(newDefaults) { helper.copyExistingProperties(newDefaults, defaults); } function setBufferFromTypedArray(gl, type, buffer, array, drawType) { gl.bindBuffer(type, buffer); gl.bufferData(type, array, drawType || gl.STATIC_DRAW); } /** * Given typed array creates a WebGLBuffer and copies the typed array * into it. * * @param {WebGLRenderingContext} gl A WebGLRenderingContext * @param {ArrayBuffer|SharedArrayBuffer|ArrayBufferView|WebGLBuffer} typedArray the typed array. Note: If a WebGLBuffer is passed in it will just be returned. No action will be taken * @param {number} [type] the GL bind type for the buffer. Default = `gl.ARRAY_BUFFER`. * @param {number} [drawType] the GL draw type for the buffer. Default = 'gl.STATIC_DRAW`. * @return {WebGLBuffer} the created WebGLBuffer * @memberOf module:twgl/attributes */ function createBufferFromTypedArray(gl, typedArray, type, drawType) { if (helper.isBuffer(gl, typedArray)) { return typedArray; } type = type || gl.ARRAY_BUFFER; var buffer = gl.createBuffer(); setBufferFromTypedArray(gl, type, buffer, typedArray, drawType); return buffer; } function isIndices(name) { return name === "indices"; } // This is really just a guess. Though I can't really imagine using // anything else? Maybe for some compression? function getNormalizationForTypedArray(typedArray) { if (typedArray instanceof Int8Array) { return true; } // eslint-disable-line if (typedArray instanceof Uint8Array) { return true; } // eslint-disable-line return false; } // This is really just a guess. Though I can't really imagine using // anything else? Maybe for some compression? function getNormalizationForTypedArrayType(typedArrayType) { if (typedArrayType === Int8Array) { return true; } // eslint-disable-line if (typedArrayType === Uint8Array) { return true; } // eslint-disable-line return false; } function getArray(array) { return array.length ? array : array.data; } var texcoordRE = /coord|texture/i; var colorRE = /color|colour/i; function guessNumComponentsFromName(name, length) { var numComponents; if (texcoordRE.test(name)) { numComponents = 2; } else if (colorRE.test(name)) { numComponents = 4; } else { numComponents = 3; // position, normals, indices ... } if (length % numComponents > 0) { throw "Can not guess numComponents for attribute '" + name + "'. Tried " + numComponents + " but " + length + " values is not evenly divisible by " + numComponents + ". You should specify it."; } return numComponents; } function getNumComponents(array, arrayName) { return array.numComponents || array.size || guessNumComponentsFromName(arrayName, getArray(array).length); } function makeTypedArray(array, name) { if (typedArrays.isArrayBuffer(array)) { return array; } if (typedArrays.isArrayBuffer(array.data)) { return array.data; } if (Array.isArray(array)) { array = { data: array }; } var Type = array.type; if (!Type) { if (isIndices(name)) { Type = Uint16Array; } else { Type = Float32Array; } } return new Type(array.data); } /** * The info for an attribute. This is effectively just the arguments to `gl.vertexAttribPointer` plus the WebGLBuffer * for the attribute. * * @typedef {Object} AttribInfo * @property {number} [numComponents] the number of components for this attribute. * @property {number} [size] synonym for `numComponents`. * @property {number} [type] the type of the attribute (eg. `gl.FLOAT`, `gl.UNSIGNED_BYTE`, etc...) Default = `gl.FLOAT` * @property {boolean} [normalize] whether or not to normalize the data. Default = false * @property {number} [offset] offset into buffer in bytes. Default = 0 * @property {number} [stride] the stride in bytes per element. Default = 0 * @property {number} [divisor] the divisor in instances. Default = undefined. Note: undefined = don't call gl.vertexAttribDivisor * where as anything else = do call it with this value * @property {WebGLBuffer} buffer the buffer that contains the data for this attribute * @property {number} [drawType] the draw type passed to gl.bufferData. Default = gl.STATIC_DRAW * @memberOf module:twgl */ /** * Use this type of array spec when TWGL can't guess the type or number of compoments of an array * @typedef {Object} FullArraySpec * @property {(number|number[]|ArrayBufferView)} data The data of the array. A number alone becomes the number of elements of type. * @property {number} [numComponents] number of components for `vertexAttribPointer`. Default is based on the name of the array. * If `coord` is in the name assumes `numComponents = 2`. * If `color` is in the name assumes `numComponents = 4`. * otherwise assumes `numComponents = 3` * @property {constructor} type The type. This is only used if `data` is a JavaScript array. It is the constructor for the typedarray. (eg. `Uint8Array`). * For example if you want colors in a `Uint8Array` you might have a `FullArraySpec` like `{ type: Uint8Array, data: [255,0,255,255, ...], }`. * @property {number} [size] synonym for `numComponents`. * @property {boolean} [normalize] normalize for `vertexAttribPointer`. Default is true if type is `Int8Array` or `Uint8Array` otherwise false. * @property {number} [stride] stride for `vertexAttribPointer`. Default = 0 * @property {number} [offset] offset for `vertexAttribPointer`. Default = 0 * @property {number} [divisor] divisor for `vertexAttribDivisor`. Default = undefined. Note: undefined = don't call gl.vertexAttribDivisor * where as anything else = do call it with this value * @property {string} [attrib] name of attribute this array maps to. Defaults to same name as array prefixed by the default attribPrefix. * @property {string} [name] synonym for `attrib`. * @property {string} [attribName] synonym for `attrib`. * @memberOf module:twgl */ /** * An individual array in {@link module:twgl.Arrays} * * When passed to {@link module:twgl.createBufferInfoFromArrays} if an ArraySpec is `number[]` or `ArrayBufferView` * the types will be guessed based on the name. `indices` will be `Uint16Array`, everything else will * be `Float32Array`. If an ArraySpec is a number it's the number of floats for an empty (zeroed) buffer. * * @typedef {(number|number[]|ArrayBufferView|module:twgl.FullArraySpec)} ArraySpec * @memberOf module:twgl */ /** * This is a JavaScript object of arrays by name. The names should match your shader's attributes. If your * attributes have a common prefix you can specify it by calling {@link module:twgl.setAttributePrefix}. * * Bare JavaScript Arrays * * var arrays = { * position: [-1, 1, 0], * normal: [0, 1, 0], * ... * } * * Bare TypedArrays * * var arrays = { * position: new Float32Array([-1, 1, 0]), * color: new Uint8Array([255, 128, 64, 255]), * ... * } * * * Will guess at `numComponents` if not specified based on name. * * If `coord` is in the name assumes `numComponents = 2` * * If `color` is in the name assumes `numComponents = 4` * * otherwise assumes `numComponents = 3` * * Objects with various fields. See {@link module:twgl.FullArraySpec}. * * var arrays = { * position: { numComponents: 3, data: [0, 0, 0, 10, 0, 0, 0, 10, 0, 10, 10, 0], }, * texcoord: { numComponents: 2, data: [0, 0, 0, 1, 1, 0, 1, 1], }, * normal: { numComponents: 3, data: [0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1], }, * indices: { numComponents: 3, data: [0, 1, 2, 1, 2, 3], }, * }; * * @typedef {Object.} Arrays * @memberOf module:twgl */ /** * Creates a set of attribute data and WebGLBuffers from set of arrays * * Given * * var arrays = { * position: { numComponents: 3, data: [0, 0, 0, 10, 0, 0, 0, 10, 0, 10, 10, 0], }, * texcoord: { numComponents: 2, data: [0, 0, 0, 1, 1, 0, 1, 1], }, * normal: { numComponents: 3, data: [0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1], }, * color: { numComponents: 4, data: [255, 255, 255, 255, 255, 0, 0, 255, 0, 0, 255, 255], type: Uint8Array, }, * indices: { numComponents: 3, data: [0, 1, 2, 1, 2, 3], }, * }; * * returns something like * * var attribs = { * position: { numComponents: 3, type: gl.FLOAT, normalize: false, buffer: WebGLBuffer, }, * texcoord: { numComponents: 2, type: gl.FLOAT, normalize: false, buffer: WebGLBuffer, }, * normal: { numComponents: 3, type: gl.FLOAT, normalize: false, buffer: WebGLBuffer, }, * color: { numComponents: 4, type: gl.UNSIGNED_BYTE, normalize: true, buffer: WebGLBuffer, }, * }; * * notes: * * * Arrays can take various forms * * Bare JavaScript Arrays * * var arrays = { * position: [-1, 1, 0], * normal: [0, 1, 0], * ... * } * * Bare TypedArrays * * var arrays = { * position: new Float32Array([-1, 1, 0]), * color: new Uint8Array([255, 128, 64, 255]), * ... * } * * * Will guess at `numComponents` if not specified based on name. * * If `coord` is in the name assumes `numComponents = 2` * * If `color` is in the name assumes `numComponents = 4` * * otherwise assumes `numComponents = 3` * * @param {WebGLRenderingContext} gl The webgl rendering context. * @param {module:twgl.Arrays} arrays The arrays * @return {Object.} the attribs * @memberOf module:twgl/attributes */ function createAttribsFromArrays(gl, arrays) { var attribs = {}; Object.keys(arrays).forEach(function (arrayName) { if (!isIndices(arrayName)) { var array = arrays[arrayName]; var attribName = array.attrib || array.name || array.attribName || defaults.attribPrefix + arrayName; var buffer; var type; var normalization; var numComponents; var numValues; if (typeof array === "number" || typeof array.data === "number") { numValues = array.data || array; var arrayType = array.type || Float32Array; var numBytes = numValues * arrayType.BYTES_PER_ELEMENT; type = typedArrays.getGLTypeForTypedArrayType(arrayType); normalization = array.normalize !== undefined ? array.normalize : getNormalizationForTypedArrayType(arrayType); numComponents = array.numComponents || array.size || guessNumComponentsFromName(arrayName, numValues); buffer = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, buffer); gl.bufferData(gl.ARRAY_BUFFER, numBytes, array.drawType || gl.STATIC_DRAW); } else { var typedArray = makeTypedArray(array, arrayName); buffer = createBufferFromTypedArray(gl, typedArray, undefined, array.drawType); type = typedArrays.getGLTypeForTypedArray(typedArray); normalization = array.normalize !== undefined ? array.normalize : getNormalizationForTypedArray(typedArray); numComponents = getNumComponents(array, arrayName); numValues = typedArray.length; } attribs[attribName] = { buffer: buffer, numComponents: numComponents, type: type, normalize: normalization, stride: array.stride || 0, offset: array.offset || 0, divisor: array.divisor === undefined ? undefined : array.divisor, drawType: array.drawType }; } }); gl.bindBuffer(gl.ARRAY_BUFFER, null); return attribs; } /** * Sets the contents of a buffer attached to an attribInfo * * This is helper function to dynamically update a buffer. * * Let's say you make a bufferInfo * * var arrays = { * position: new Float32Array([0, 0, 0, 10, 0, 0, 0, 10, 0, 10, 10, 0]), * texcoord: new Float32Array([0, 0, 0, 1, 1, 0, 1, 1]), * normal: new Float32Array([0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1]), * indices: new Uint16Array([0, 1, 2, 1, 2, 3]), * }; * var bufferInfo = twgl.createBufferInfoFromArrays(gl, arrays); * * And you want to dynamically upate the positions. You could do this * * // assuming arrays.position has already been updated with new data. * twgl.setAttribInfoBufferFromArray(gl, bufferInfo.attribs.position, arrays.position); * * @param {WebGLRenderingContext} gl * @param {AttribInfo} attribInfo The attribInfo who's buffer contents to set. NOTE: If you have an attribute prefix * the name of the attribute will include the prefix. * @param {ArraySpec} array Note: it is arguably ineffient to pass in anything but a typed array because anything * else will have to be converted to a typed array before it can be used by WebGL. During init time that * inefficiency is usually not important but if you're updating data dynamically best to be efficient. * @param {number} [offset] an optional offset into the buffer. This is only an offset into the WebGL buffer * not the array. To pass in an offset into the array itself use a typed array and create an `ArrayBufferView` * for the portion of the array you want to use. * * var someArray = new Float32Array(1000); // an array with 1000 floats * var someSubArray = new Float32Array(someArray.buffer, offsetInBytes, sizeInUnits); // a view into someArray * * Now you can pass `someSubArray` into setAttribInfoBufferFromArray` * @memberOf module:twgl/attributes */ function setAttribInfoBufferFromArray(gl, attribInfo, array, offset) { array = makeTypedArray(array); if (offset !== undefined) { gl.bindBuffer(gl.ARRAY_BUFFER, attribInfo.buffer); gl.bufferSubData(gl.ARRAY_BUFFER, offset, array); } else { setBufferFromTypedArray(gl, gl.ARRAY_BUFFER, attribInfo.buffer, array, attribInfo.drawType); } } function getBytesPerValueForGLType(gl, type) { if (type === gl.BYTE) return 1; // eslint-disable-line if (type === gl.UNSIGNED_BYTE) return 1; // eslint-disable-line if (type === gl.SHORT) return 2; // eslint-disable-line if (type === gl.UNSIGNED_SHORT) return 2; // eslint-disable-line if (type === gl.INT) return 4; // eslint-disable-line if (type === gl.UNSIGNED_INT) return 4; // eslint-disable-line if (type === gl.FLOAT) return 4; // eslint-disable-line return 0; } /** * tries to get the number of elements from a set of arrays. */ var positionKeys = ['position', 'positions', 'a_position']; function getNumElementsFromNonIndexedArrays(arrays) { var key; for (var _ii = 0; _ii < positionKeys.length; ++_ii) { key = positionKeys[_ii]; if (key in arrays) { break; } } if (ii === positionKeys.length) { key = Object.keys(arrays)[0]; } var array = arrays[key]; var length = getArray(array).length; var numComponents = getNumComponents(array, key); var numElements = length / numComponents; if (length % numComponents > 0) { throw "numComponents " + numComponents + " not correct for length " + length; } return numElements; } function getNumElementsFromAttributes(gl, attribs) { var key; var ii; for (ii = 0; ii < positionKeys.length; ++ii) { key = positionKeys[ii]; if (key in attribs) { break; } key = defaults.attribPrefix + key; if (key in attribs) { break; } } if (ii === positionKeys.length) { key = Object.keys(attribs)[0]; } var attrib = attribs[key]; gl.bindBuffer(gl.ARRAY_BUFFER, attrib.buffer); var numBytes = gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE); gl.bindBuffer(gl.ARRAY_BUFFER, null); var bytesPerValue = getBytesPerValueForGLType(gl, attrib.type); var totalElements = numBytes / bytesPerValue; var numComponents = attrib.numComponents || attrib.size; // TODO: check stride var numElements = totalElements / numComponents; if (numElements % 1 !== 0) { throw "numComponents " + numComponents + " not correct for length " + length; } return numElements; } /** * @typedef {Object} BufferInfo * @property {number} numElements The number of elements to pass to `gl.drawArrays` or `gl.drawElements`. * @property {number} [elementType] The type of indices `UNSIGNED_BYTE`, `UNSIGNED_SHORT` etc.. * @property {WebGLBuffer} [indices] The indices `ELEMENT_ARRAY_BUFFER` if any indices exist. * @property {Object.} [attribs] The attribs approriate to call `setAttributes` * @memberOf module:twgl */ /** * Creates a BufferInfo from an object of arrays. * * This can be passed to {@link module:twgl.setBuffersAndAttributes} and to * {@link module:twgl:drawBufferInfo}. * * Given an object like * * var arrays = { * position: { numComponents: 3, data: [0, 0, 0, 10, 0, 0, 0, 10, 0, 10, 10, 0], }, * texcoord: { numComponents: 2, data: [0, 0, 0, 1, 1, 0, 1, 1], }, * normal: { numComponents: 3, data: [0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1], }, * indices: { numComponents: 3, data: [0, 1, 2, 1, 2, 3], }, * }; * * Creates an BufferInfo like this * * bufferInfo = { * numElements: 4, // or whatever the number of elements is * indices: WebGLBuffer, // this property will not exist if there are no indices * attribs: { * a_position: { buffer: WebGLBuffer, numComponents: 3, }, * a_normal: { buffer: WebGLBuffer, numComponents: 3, }, * a_texcoord: { buffer: WebGLBuffer, numComponents: 2, }, * }, * }; * * The properties of arrays can be JavaScript arrays in which case the number of components * will be guessed. * * var arrays = { * position: [0, 0, 0, 10, 0, 0, 0, 10, 0, 10, 10, 0], * texcoord: [0, 0, 0, 1, 1, 0, 1, 1], * normal: [0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1], * indices: [0, 1, 2, 1, 2, 3], * }; * * They can also by TypedArrays * * var arrays = { * position: new Float32Array([0, 0, 0, 10, 0, 0, 0, 10, 0, 10, 10, 0]), * texcoord: new Float32Array([0, 0, 0, 1, 1, 0, 1, 1]), * normal: new Float32Array([0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1]), * indices: new Uint16Array([0, 1, 2, 1, 2, 3]), * }; * * Or augmentedTypedArrays * * var positions = createAugmentedTypedArray(3, 4); * var texcoords = createAugmentedTypedArray(2, 4); * var normals = createAugmentedTypedArray(3, 4); * var indices = createAugmentedTypedArray(3, 2, Uint16Array); * * positions.push([0, 0, 0, 10, 0, 0, 0, 10, 0, 10, 10, 0]); * texcoords.push([0, 0, 0, 1, 1, 0, 1, 1]); * normals.push([0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1]); * indices.push([0, 1, 2, 1, 2, 3]); * * var arrays = { * position: positions, * texcoord: texcoords, * normal: normals, * indices: indices, * }; * * For the last example it is equivalent to * * var bufferInfo = { * attribs: { * a_position: { numComponents: 3, buffer: gl.createBuffer(), }, * a_texcoods: { numComponents: 2, buffer: gl.createBuffer(), }, * a_normals: { numComponents: 3, buffer: gl.createBuffer(), }, * }, * indices: gl.createBuffer(), * numElements: 6, * }; * * gl.bindBuffer(gl.ARRAY_BUFFER, bufferInfo.attribs.a_position.buffer); * gl.bufferData(gl.ARRAY_BUFFER, arrays.position, gl.STATIC_DRAW); * gl.bindBuffer(gl.ARRAY_BUFFER, bufferInfo.attribs.a_texcoord.buffer); * gl.bufferData(gl.ARRAY_BUFFER, arrays.texcoord, gl.STATIC_DRAW); * gl.bindBuffer(gl.ARRAY_BUFFER, bufferInfo.attribs.a_normal.buffer); * gl.bufferData(gl.ARRAY_BUFFER, arrays.normal, gl.STATIC_DRAW); * gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, bufferInfo.indices); * gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, arrays.indices, gl.STATIC_DRAW); * * @param {WebGLRenderingContext} gl A WebGLRenderingContext * @param {module:twgl.Arrays} arrays Your data * @return {module:twgl.BufferInfo} A BufferInfo * @memberOf module:twgl/attributes */ function createBufferInfoFromArrays(gl, arrays) { var bufferInfo = { attribs: createAttribsFromArrays(gl, arrays) }; var indices = arrays.indices; if (indices) { var newIndices = makeTypedArray(indices, "indices"); bufferInfo.indices = createBufferFromTypedArray(gl, newIndices, gl.ELEMENT_ARRAY_BUFFER); bufferInfo.numElements = newIndices.length; bufferInfo.elementType = typedArrays.getGLTypeForTypedArray(newIndices); } else { bufferInfo.numElements = getNumElementsFromAttributes(gl, bufferInfo.attribs); } return bufferInfo; } /** * Creates a buffer from an array, typed array, or array spec * * Given something like this * * [1, 2, 3], * * or * * new Uint16Array([1,2,3]); * * or * * { * data: [1, 2, 3], * type: Uint8Array, * } * * returns a WebGLBuffer that constains the given data. * * @param {WebGLRenderingContext} gl A WebGLRenderingContext. * @param {module:twgl.ArraySpec} array an array, typed array, or array spec. * @param {string} arrayName name of array. Used to guess the type if type can not be dervied other wise. * @return {WebGLBuffer} a WebGLBuffer containing the data in array. * @memberOf module:twgl/attributes */ function createBufferFromArray(gl, array, arrayName) { var type = arrayName === "indices" ? gl.ELEMENT_ARRAY_BUFFER : gl.ARRAY_BUFFER; var typedArray = makeTypedArray(array, arrayName); return createBufferFromTypedArray(gl, typedArray, type); } /** * Creates buffers from arrays or typed arrays * * Given something like this * * var arrays = { * positions: [1, 2, 3], * normals: [0, 0, 1], * } * * returns something like * * buffers = { * positions: WebGLBuffer, * normals: WebGLBuffer, * } * * If the buffer is named 'indices' it will be made an ELEMENT_ARRAY_BUFFER. * * @param {WebGLRenderingContext} gl A WebGLRenderingContext. * @param {module:twgl.Arrays} arrays * @return {Object} returns an object with one WebGLBuffer per array * @memberOf module:twgl/attributes */ function createBuffersFromArrays(gl, arrays) { var buffers = {}; Object.keys(arrays).forEach(function (key) { buffers[key] = createBufferFromArray(gl, arrays[key], key); }); // Ugh! if (arrays.indices) { buffers.numElements = arrays.indices.length; buffers.elementType = typedArrays.getGLTypeForTypedArray(makeTypedArray(arrays.indices), 'indices'); } else { buffers.numElements = getNumElementsFromNonIndexedArrays(arrays); } return buffers; } /***/ }), /* 8 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.setTextureDefaults_ = setDefaults; exports.createSampler = createSampler; exports.createSamplers = createSamplers; exports.setSamplerParameters = setSamplerParameters; exports.createTexture = createTexture; exports.setEmptyTexture = setEmptyTexture; exports.setTextureFromArray = setTextureFromArray; exports.loadTextureFromUrl = loadTextureFromUrl; exports.setTextureFromElement = setTextureFromElement; exports.setTextureFilteringForSize = setTextureFilteringForSize; exports.setTextureParameters = setTextureParameters; exports.setDefaultTextureColor = setDefaultTextureColor; exports.createTextures = createTextures; exports.resizeTexture = resizeTexture; exports.getNumComponentsForFormat = getNumComponentsForFormat; exports.getBytesPerElementForInternalFormat = getBytesPerElementForInternalFormat; var utils = _interopRequireWildcard(__webpack_require__(4)); var typedArrays = _interopRequireWildcard(__webpack_require__(1)); var helper = _interopRequireWildcard(__webpack_require__(0)); var _globalObject = _interopRequireDefault(__webpack_require__(2)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } /* * Copyright 2015, Gregg Tavares. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Gregg Tavares. nor the names of his * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * Low level texture related functions * * You should generally not need to use these functions. They are provided * for those cases where you're doing something out of the ordinary * and you need lower level access. * * For backward compatibily they are available at both `twgl.textures` and `twgl` * itself * * See {@link module:twgl} for core functions * * @module twgl/textures */ // make sure we don't see a global gl var gl = undefined; // eslint-disable-line var defaults = { textureColor: new Uint8Array([128, 192, 255, 255]), textureOptions: {}, crossOrigin: undefined }; var isArrayBuffer = typedArrays.isArrayBuffer; // Should we make this on demand? var ctx = _globalObject.default.document && _globalObject.default.document.createElement ? _globalObject.default.document.createElement("canvas").getContext("2d") : null; // NOTE: Chrome supports 2D canvas in a Worker (behind flag as of v64 but // not only does Firefox NOT support it but Firefox freezes immediately // if you try to create one instead of just returning null and continuing. // : (global.OffscreenCanvas && (new global.OffscreenCanvas(1, 1)).getContext("2d")); // OffscreenCanvas may not support 2d // NOTE: We can maybe remove some of the need for the 2d canvas. In WebGL2 // we can use the various unpack settings. Otherwise we could try using // the ability of an imagebitmap to be cut. Unfortunately cutting an imagebitmap // is async and the current TWGL code expects a non-Async result though that // might not be a problem. ImageBitmap though is not available in Edge or Safari // as of 2018-01-02 /* PixelFormat */ var ALPHA = 0x1906; var RGB = 0x1907; var RGBA = 0x1908; var LUMINANCE = 0x1909; var LUMINANCE_ALPHA = 0x190A; var DEPTH_COMPONENT = 0x1902; var DEPTH_STENCIL = 0x84F9; /* TextureWrapMode */ var REPEAT = 0x2901; // eslint-disable-line var MIRRORED_REPEAT = 0x8370; // eslint-disable-line /* TextureMagFilter */ var NEAREST = 0x2600; // eslint-disable-line /* TextureMinFilter */ var NEAREST_MIPMAP_NEAREST = 0x2700; // eslint-disable-line var LINEAR_MIPMAP_NEAREST = 0x2701; // eslint-disable-line var NEAREST_MIPMAP_LINEAR = 0x2702; // eslint-disable-line var LINEAR_MIPMAP_LINEAR = 0x2703; // eslint-disable-line var R8 = 0x8229; var R8_SNORM = 0x8F94; var R16F = 0x822D; var R32F = 0x822E; var R8UI = 0x8232; var R8I = 0x8231; var RG16UI = 0x823A; var RG16I = 0x8239; var RG32UI = 0x823C; var RG32I = 0x823B; var RG8 = 0x822B; var RG8_SNORM = 0x8F95; var RG16F = 0x822F; var RG32F = 0x8230; var RG8UI = 0x8238; var RG8I = 0x8237; var R16UI = 0x8234; var R16I = 0x8233; var R32UI = 0x8236; var R32I = 0x8235; var RGB8 = 0x8051; var SRGB8 = 0x8C41; var RGB565 = 0x8D62; var RGB8_SNORM = 0x8F96; var R11F_G11F_B10F = 0x8C3A; var RGB9_E5 = 0x8C3D; var RGB16F = 0x881B; var RGB32F = 0x8815; var RGB8UI = 0x8D7D; var RGB8I = 0x8D8F; var RGB16UI = 0x8D77; var RGB16I = 0x8D89; var RGB32UI = 0x8D71; var RGB32I = 0x8D83; var RGBA8 = 0x8058; var SRGB8_ALPHA8 = 0x8C43; var RGBA8_SNORM = 0x8F97; var RGB5_A1 = 0x8057; var RGBA4 = 0x8056; var RGB10_A2 = 0x8059; var RGBA16F = 0x881A; var RGBA32F = 0x8814; var RGBA8UI = 0x8D7C; var RGBA8I = 0x8D8E; var RGB10_A2UI = 0x906F; var RGBA16UI = 0x8D76; var RGBA16I = 0x8D88; var RGBA32I = 0x8D82; var RGBA32UI = 0x8D70; var DEPTH_COMPONENT16 = 0x81A5; var DEPTH_COMPONENT24 = 0x81A6; var DEPTH_COMPONENT32F = 0x8CAC; var DEPTH32F_STENCIL8 = 0x8CAD; var DEPTH24_STENCIL8 = 0x88F0; /* DataType */ var BYTE = 0x1400; var UNSIGNED_BYTE = 0x1401; var SHORT = 0x1402; var UNSIGNED_SHORT = 0x1403; var INT = 0x1404; var UNSIGNED_INT = 0x1405; var FLOAT = 0x1406; var UNSIGNED_SHORT_4_4_4_4 = 0x8033; var UNSIGNED_SHORT_5_5_5_1 = 0x8034; var UNSIGNED_SHORT_5_6_5 = 0x8363; var HALF_FLOAT = 0x140B; var HALF_FLOAT_OES = 0x8D61; // Thanks Khronos for making this different >:( var UNSIGNED_INT_2_10_10_10_REV = 0x8368; var UNSIGNED_INT_10F_11F_11F_REV = 0x8C3B; var UNSIGNED_INT_5_9_9_9_REV = 0x8C3E; var FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD; var UNSIGNED_INT_24_8 = 0x84FA; var RG = 0x8227; var RG_INTEGER = 0x8228; var RED = 0x1903; var RED_INTEGER = 0x8D94; var RGB_INTEGER = 0x8D98; var RGBA_INTEGER = 0x8D99; var formatInfo = {}; { // NOTE: this is named `numColorComponents` vs `numComponents` so we can let Uglify mangle // the name. var f = formatInfo; f[ALPHA] = { numColorComponents: 1 }; f[LUMINANCE] = { numColorComponents: 1 }; f[LUMINANCE_ALPHA] = { numColorComponents: 2 }; f[RGB] = { numColorComponents: 3 }; f[RGBA] = { numColorComponents: 4 }; f[RED] = { numColorComponents: 1 }; f[RED_INTEGER] = { numColorComponents: 1 }; f[RG] = { numColorComponents: 2 }; f[RG_INTEGER] = { numColorComponents: 2 }; f[RGB] = { numColorComponents: 3 }; f[RGB_INTEGER] = { numColorComponents: 3 }; f[RGBA] = { numColorComponents: 4 }; f[RGBA_INTEGER] = { numColorComponents: 4 }; f[DEPTH_COMPONENT] = { numColorComponents: 1 }; f[DEPTH_STENCIL] = { numColorComponents: 2 }; } var textureInternalFormatInfo = {}; { // NOTE: these properties need unique names so we can let Uglify mangle the name. var t = textureInternalFormatInfo; // unsized formats t[ALPHA] = { textureFormat: ALPHA, colorRenderable: true, textureFilterable: true, bytesPerElement: [1, 2, 2, 4], type: [UNSIGNED_BYTE, HALF_FLOAT, HALF_FLOAT_OES, FLOAT] }; t[LUMINANCE] = { textureFormat: LUMINANCE, colorRenderable: true, textureFilterable: true, bytesPerElement: [1, 2, 2, 4], type: [UNSIGNED_BYTE, HALF_FLOAT, HALF_FLOAT_OES, FLOAT] }; t[LUMINANCE_ALPHA] = { textureFormat: LUMINANCE_ALPHA, colorRenderable: true, textureFilterable: true, bytesPerElement: [2, 4, 4, 8], type: [UNSIGNED_BYTE, HALF_FLOAT, HALF_FLOAT_OES, FLOAT] }; t[RGB] = { textureFormat: RGB, colorRenderable: true, textureFilterable: true, bytesPerElement: [3, 6, 6, 12, 2], type: [UNSIGNED_BYTE, HALF_FLOAT, HALF_FLOAT_OES, FLOAT, UNSIGNED_SHORT_5_6_5] }; t[RGBA] = { textureFormat: RGBA, colorRenderable: true, textureFilterable: true, bytesPerElement: [4, 8, 8, 16, 2, 2], type: [UNSIGNED_BYTE, HALF_FLOAT, HALF_FLOAT_OES, FLOAT, UNSIGNED_SHORT_4_4_4_4, UNSIGNED_SHORT_5_5_5_1] }; // sized formats t[R8] = { textureFormat: RED, colorRenderable: true, textureFilterable: true, bytesPerElement: 1, type: UNSIGNED_BYTE }; t[R8_SNORM] = { textureFormat: RED, colorRenderable: false, textureFilterable: true, bytesPerElement: 1, type: BYTE }; t[R16F] = { textureFormat: RED, colorRenderable: false, textureFilterable: true, bytesPerElement: [4, 2], type: [FLOAT, HALF_FLOAT] }; t[R32F] = { textureFormat: RED, colorRenderable: false, textureFilterable: false, bytesPerElement: 4, type: FLOAT }; t[R8UI] = { textureFormat: RED_INTEGER, colorRenderable: true, textureFilterable: false, bytesPerElement: 1, type: UNSIGNED_BYTE }; t[R8I] = { textureFormat: RED_INTEGER, colorRenderable: true, textureFilterable: false, bytesPerElement: 1, type: BYTE }; t[R16UI] = { textureFormat: RED_INTEGER, colorRenderable: true, textureFilterable: false, bytesPerElement: 2, type: UNSIGNED_SHORT }; t[R16I] = { textureFormat: RED_INTEGER, colorRenderable: true, textureFilterable: false, bytesPerElement: 2, type: SHORT }; t[R32UI] = { textureFormat: RED_INTEGER, colorRenderable: true, textureFilterable: false, bytesPerElement: 4, type: UNSIGNED_INT }; t[R32I] = { textureFormat: RED_INTEGER, colorRenderable: true, textureFilterable: false, bytesPerElement: 4, type: INT }; t[RG8] = { textureFormat: RG, colorRenderable: true, textureFilterable: true, bytesPerElement: 2, type: UNSIGNED_BYTE }; t[RG8_SNORM] = { textureFormat: RG, colorRenderable: false, textureFilterable: true, bytesPerElement: 2, type: BYTE }; t[RG16F] = { textureFormat: RG, colorRenderable: false, textureFilterable: true, bytesPerElement: [8, 4], type: [FLOAT, HALF_FLOAT] }; t[RG32F] = { textureFormat: RG, colorRenderable: false, textureFilterable: false, bytesPerElement: 8, type: FLOAT }; t[RG8UI] = { textureFormat: RG_INTEGER, colorRenderable: true, textureFilterable: false, bytesPerElement: 2, type: UNSIGNED_BYTE }; t[RG8I] = { textureFormat: RG_INTEGER, colorRenderable: true, textureFilterable: false, bytesPerElement: 2, type: BYTE }; t[RG16UI] = { textureFormat: RG_INTEGER, colorRenderable: true, textureFilterable: false, bytesPerElement: 4, type: UNSIGNED_SHORT }; t[RG16I] = { textureFormat: RG_INTEGER, colorRenderable: true, textureFilterable: false, bytesPerElement: 4, type: SHORT }; t[RG32UI] = { textureFormat: RG_INTEGER, colorRenderable: true, textureFilterable: false, bytesPerElement: 8, type: UNSIGNED_INT }; t[RG32I] = { textureFormat: RG_INTEGER, colorRenderable: true, textureFilterable: false, bytesPerElement: 8, type: INT }; t[RGB8] = { textureFormat: RGB, colorRenderable: true, textureFilterable: true, bytesPerElement: 3, type: UNSIGNED_BYTE }; t[SRGB8] = { textureFormat: RGB, colorRenderable: false, textureFilterable: true, bytesPerElement: 3, type: UNSIGNED_BYTE }; t[RGB565] = { textureFormat: RGB, colorRenderable: true, textureFilterable: true, bytesPerElement: [3, 2], type: [UNSIGNED_BYTE, UNSIGNED_SHORT_5_6_5] }; t[RGB8_SNORM] = { textureFormat: RGB, colorRenderable: false, textureFilterable: true, bytesPerElement: 3, type: BYTE }; t[R11F_G11F_B10F] = { textureFormat: RGB, colorRenderable: false, textureFilterable: true, bytesPerElement: [12, 6, 4], type: [FLOAT, HALF_FLOAT, UNSIGNED_INT_10F_11F_11F_REV] }; t[RGB9_E5] = { textureFormat: RGB, colorRenderable: false, textureFilterable: true, bytesPerElement: [12, 6, 4], type: [FLOAT, HALF_FLOAT, UNSIGNED_INT_5_9_9_9_REV] }; t[RGB16F] = { textureFormat: RGB, colorRenderable: false, textureFilterable: true, bytesPerElement: [12, 6], type: [FLOAT, HALF_FLOAT] }; t[RGB32F] = { textureFormat: RGB, colorRenderable: false, textureFilterable: false, bytesPerElement: 12, type: FLOAT }; t[RGB8UI] = { textureFormat: RGB_INTEGER, colorRenderable: false, textureFilterable: false, bytesPerElement: 3, type: UNSIGNED_BYTE }; t[RGB8I] = { textureFormat: RGB_INTEGER, colorRenderable: false, textureFilterable: false, bytesPerElement: 3, type: BYTE }; t[RGB16UI] = { textureFormat: RGB_INTEGER, colorRenderable: false, textureFilterable: false, bytesPerElement: 6, type: UNSIGNED_SHORT }; t[RGB16I] = { textureFormat: RGB_INTEGER, colorRenderable: false, textureFilterable: false, bytesPerElement: 6, type: SHORT }; t[RGB32UI] = { textureFormat: RGB_INTEGER, colorRenderable: false, textureFilterable: false, bytesPerElement: 12, type: UNSIGNED_INT }; t[RGB32I] = { textureFormat: RGB_INTEGER, colorRenderable: false, textureFilterable: false, bytesPerElement: 12, type: INT }; t[RGBA8] = { textureFormat: RGBA, colorRenderable: true, textureFilterable: true, bytesPerElement: 4, type: UNSIGNED_BYTE }; t[SRGB8_ALPHA8] = { textureFormat: RGBA, colorRenderable: true, textureFilterable: true, bytesPerElement: 4, type: UNSIGNED_BYTE }; t[RGBA8_SNORM] = { textureFormat: RGBA, colorRenderable: false, textureFilterable: true, bytesPerElement: 4, type: BYTE }; t[RGB5_A1] = { textureFormat: RGBA, colorRenderable: true, textureFilterable: true, bytesPerElement: [4, 2, 4], type: [UNSIGNED_BYTE, UNSIGNED_SHORT_5_5_5_1, UNSIGNED_INT_2_10_10_10_REV] }; t[RGBA4] = { textureFormat: RGBA, colorRenderable: true, textureFilterable: true, bytesPerElement: [4, 2], type: [UNSIGNED_BYTE, UNSIGNED_SHORT_4_4_4_4] }; t[RGB10_A2] = { textureFormat: RGBA, colorRenderable: true, textureFilterable: true, bytesPerElement: 4, type: UNSIGNED_INT_2_10_10_10_REV }; t[RGBA16F] = { textureFormat: RGBA, colorRenderable: false, textureFilterable: true, bytesPerElement: [16, 8], type: [FLOAT, HALF_FLOAT] }; t[RGBA32F] = { textureFormat: RGBA, colorRenderable: false, textureFilterable: false, bytesPerElement: 16, type: FLOAT }; t[RGBA8UI] = { textureFormat: RGBA_INTEGER, colorRenderable: true, textureFilterable: false, bytesPerElement: 4, type: UNSIGNED_BYTE }; t[RGBA8I] = { textureFormat: RGBA_INTEGER, colorRenderable: true, textureFilterable: false, bytesPerElement: 4, type: BYTE }; t[RGB10_A2UI] = { textureFormat: RGBA_INTEGER, colorRenderable: true, textureFilterable: false, bytesPerElement: 4, type: UNSIGNED_INT_2_10_10_10_REV }; t[RGBA16UI] = { textureFormat: RGBA_INTEGER, colorRenderable: true, textureFilterable: false, bytesPerElement: 8, type: UNSIGNED_SHORT }; t[RGBA16I] = { textureFormat: RGBA_INTEGER, colorRenderable: true, textureFilterable: false, bytesPerElement: 8, type: SHORT }; t[RGBA32I] = { textureFormat: RGBA_INTEGER, colorRenderable: true, textureFilterable: false, bytesPerElement: 16, type: INT }; t[RGBA32UI] = { textureFormat: RGBA_INTEGER, colorRenderable: true, textureFilterable: false, bytesPerElement: 16, type: UNSIGNED_INT }; // Sized Internal t[DEPTH_COMPONENT16] = { textureFormat: DEPTH_COMPONENT, colorRenderable: true, textureFilterable: false, bytesPerElement: [2, 4], type: [UNSIGNED_SHORT, UNSIGNED_INT] }; t[DEPTH_COMPONENT24] = { textureFormat: DEPTH_COMPONENT, colorRenderable: true, textureFilterable: false, bytesPerElement: 4, type: UNSIGNED_INT }; t[DEPTH_COMPONENT32F] = { textureFormat: DEPTH_COMPONENT, colorRenderable: true, textureFilterable: false, bytesPerElement: 4, type: FLOAT }; t[DEPTH24_STENCIL8] = { textureFormat: DEPTH_STENCIL, colorRenderable: true, textureFilterable: false, bytesPerElement: 4, type: UNSIGNED_INT_24_8 }; t[DEPTH32F_STENCIL8] = { textureFormat: DEPTH_STENCIL, colorRenderable: true, textureFilterable: false, bytesPerElement: 4, type: FLOAT_32_UNSIGNED_INT_24_8_REV }; Object.keys(t).forEach(function (internalFormat) { var info = t[internalFormat]; info.bytesPerElementMap = {}; if (Array.isArray(info.bytesPerElement)) { info.bytesPerElement.forEach(function (bytesPerElement, ndx) { var type = info.type[ndx]; info.bytesPerElementMap[type] = bytesPerElement; }); } else { var type = info.type; info.bytesPerElementMap[type] = info.bytesPerElement; } }); } /** * Gets the number of bytes per element for a given internalFormat / type * @param {number} internalFormat The internalFormat parameter from texImage2D etc.. * @param {number} type The type parameter for texImage2D etc.. * @return {number} the number of bytes per element for the given internalFormat, type combo * @memberOf module:twgl/textures */ function getBytesPerElementForInternalFormat(internalFormat, type) { var info = textureInternalFormatInfo[internalFormat]; if (!info) { throw "unknown internal format"; } var bytesPerElement = info.bytesPerElementMap[type]; if (bytesPerElement === undefined) { throw "unknown internal format"; } return bytesPerElement; } /** * Gets the format for a given internalFormat * * @param {number} internalFormat The internal format * @return {{format:number, type:number}} the corresponding format and type */ function getFormatAndTypeForInternalFormat(internalFormat) { var info = textureInternalFormatInfo[internalFormat]; if (!info) { throw "unknown internal format"; } return { format: info.textureFormat, type: Array.isArray(info.type) ? info.type[0] : info.type }; } /** * Returns true if value is power of 2 * @param {number} value number to check. * @return true if value is power of 2 */ function isPowerOf2(value) { return (value & value - 1) === 0; } /** * Gets whether or not we can generate mips for the given format * @param {number} internalFormat The internalFormat parameter from texImage2D etc.. * @param {number} type The type parameter for texImage2D etc.. * @return {boolean} true if we can generate mips */ function canGenerateMipmap(gl, width, height, internalFormat /*, type */ ) { if (!utils.isWebGL2(gl)) { return isPowerOf2(width) && isPowerOf2(height); } var info = textureInternalFormatInfo[internalFormat]; if (!info) { throw "unknown internal format"; } return info.colorRenderable && info.textureFilterable; } /** * Gets whether or not we can generate mips for the given format * @param {number} internalFormat The internalFormat parameter from texImage2D etc.. * @param {number} type The type parameter for texImage2D etc.. * @return {boolean} true if we can generate mips */ function canFilter(internalFormat /*, type */ ) { var info = textureInternalFormatInfo[internalFormat]; if (!info) { throw "unknown internal format"; } return info.textureFilterable; } /** * Gets the number of compontents for a given image format. * @param {number} format the format. * @return {number} the number of components for the format. * @memberOf module:twgl/textures */ function getNumComponentsForFormat(format) { var info = formatInfo[format]; if (!info) { throw "unknown format: " + format; } return info.numColorComponents; } /** * Gets the texture type for a given array type. * @param {WebGLRenderingContext} gl the WebGLRenderingContext * @return {number} the gl texture type */ function getTextureTypeForArrayType(gl, src, defaultType) { if (isArrayBuffer(src)) { return typedArrays.getGLTypeForTypedArray(src); } return defaultType || gl.UNSIGNED_BYTE; } function guessDimensions(gl, target, width, height, numElements) { if (numElements % 1 !== 0) { throw "can't guess dimensions"; } if (!width && !height) { var size = Math.sqrt(numElements / (target === gl.TEXTURE_CUBE_MAP ? 6 : 1)); if (size % 1 === 0) { width = size; height = size; } else { width = numElements; height = 1; } } else if (!height) { height = numElements / width; if (height % 1) { throw "can't guess dimensions"; } } else if (!width) { width = numElements / height; if (width % 1) { throw "can't guess dimensions"; } } return { width: width, height: height }; } /** * Sets the default texture color. * * The default texture color is used when loading textures from * urls. Because the URL will be loaded async we'd like to be * able to use the texture immediately. By putting a 1x1 pixel * color in the texture we can start using the texture before * the URL has loaded. * * @param {number[]} color Array of 4 values in the range 0 to 1 * @deprecated see {@link module:twgl.setDefaults} * @memberOf module:twgl/textures */ function setDefaultTextureColor(color) { defaults.textureColor = new Uint8Array([color[0] * 255, color[1] * 255, color[2] * 255, color[3] * 255]); } function setDefaults(newDefaults) { helper.copyExistingProperties(newDefaults, defaults); if (newDefaults.textureColor) { setDefaultTextureColor(newDefaults.textureColor); } } /** * A function to generate the source for a texture. * @callback TextureFunc * @param {WebGLRenderingContext} gl A WebGLRenderingContext * @param {module:twgl.TextureOptions} options the texture options * @return {*} Returns any of the things documentented for `src` for {@link module:twgl.TextureOptions}. * @memberOf module:twgl */ /** * Texture options passed to most texture functions. Each function will use whatever options * are appropriate for its needs. This lets you pass the same options to all functions. * * Note: A `TexImageSource` is defined in the WebGL spec as a `HTMLImageElement`, `HTMLVideoElement`, * `HTMLCanvasElement`, `ImageBitmap`, or `ImageData`. * * @typedef {Object} TextureOptions * @property {number} [target] the type of texture `gl.TEXTURE_2D` or `gl.TEXTURE_CUBE_MAP`. Defaults to `gl.TEXTURE_2D`. * @property {number} [level] the mip level to affect. Defaults to 0. Note, if set auto will be considered false unless explicitly set to true. * @property {number} [width] the width of the texture. Only used if src is an array or typed array or null. * @property {number} [height] the height of a texture. Only used if src is an array or typed array or null. * @property {number} [depth] the depth of a texture. Only used if src is an array or type array or null and target is `TEXTURE_3D` . * @property {number} [min] the min filter setting (eg. `gl.LINEAR`). Defaults to `gl.NEAREST_MIPMAP_LINEAR` * or if texture is not a power of 2 on both dimensions then defaults to `gl.LINEAR`. * @property {number} [mag] the mag filter setting (eg. `gl.LINEAR`). Defaults to `gl.LINEAR` * @property {number} [minMag] both the min and mag filter settings. * @property {number} [internalFormat] internal format for texture. Defaults to `gl.RGBA` * @property {number} [format] format for texture. Defaults to `gl.RGBA`. * @property {number} [type] type for texture. Defaults to `gl.UNSIGNED_BYTE` unless `src` is ArrayBufferView. If `src` * is ArrayBufferView defaults to type that matches ArrayBufferView type. * @property {number} [wrap] Texture wrapping for both S and T (and R if TEXTURE_3D or WebGLSampler). Defaults to `gl.REPEAT` for 2D unless src is WebGL1 and src not npot and `gl.CLAMP_TO_EDGE` for cube * @property {number} [wrapS] Texture wrapping for S. Defaults to `gl.REPEAT` and `gl.CLAMP_TO_EDGE` for cube. If set takes precedence over `wrap`. * @property {number} [wrapT] Texture wrapping for T. Defaults to `gl.REPEAT` and `gl.CLAMP_TO_EDGE` for cube. If set takes precedence over `wrap`. * @property {number} [wrapR] Texture wrapping for R. Defaults to `gl.REPEAT` and `gl.CLAMP_TO_EDGE` for cube. If set takes precedence over `wrap`. * @property {number} [minLod] TEXTURE_MIN_LOD setting * @property {number} [maxLod] TEXTURE_MAX_LOD setting * @property {number} [baseLevel] TEXTURE_BASE_LEVEL setting * @property {number} [maxLevel] TEXTURE_MAX_LEVEL setting * @property {number} [unpackAlignment] The `gl.UNPACK_ALIGNMENT` used when uploading an array. Defaults to 1. * @property {number} [premultiplyAlpha] Whether or not to premultiply alpha. Defaults to whatever the current setting is. * This lets you set it once before calling `twgl.createTexture` or `twgl.createTextures` and only override * the current setting for specific textures. * @property {number} [flipY] Whether or not to flip the texture vertically on upload. Defaults to whatever the current setting is. * This lets you set it once before calling `twgl.createTexture` or `twgl.createTextures` and only override * the current setting for specific textures. * @property {number} [colorspaceConversion] Whether or not to let the browser do colorspace conversion of the texture on upload. Defaults to whatever the current setting is. * This lets you set it once before calling `twgl.createTexture` or `twgl.createTextures` and only override * the current setting for specific textures. * @property {(number[]|ArrayBufferView)} color color used as temporary 1x1 pixel color for textures loaded async when src is a string. * If it's a JavaScript array assumes color is 0 to 1 like most GL colors as in `[1, 0, 0, 1] = red=1, green=0, blue=0, alpha=0`. * Defaults to `[0.5, 0.75, 1, 1]`. See {@link module:twgl.setDefaultTextureColor}. If `false` texture is set. Can be used to re-load a texture * @property {boolean} [auto] If `undefined` or `true`, in WebGL1, texture filtering is set automatically for non-power of 2 images and * mips are generated for power of 2 images. In WebGL2 mips are generated if they can be. Note: if `level` is set above * then then `auto` is assumed to be `false` unless explicity set to `true`. * @property {number[]} [cubeFaceOrder] The order that cube faces are pulled out of an img or set of images. The default is * * [gl.TEXTURE_CUBE_MAP_POSITIVE_X, * gl.TEXTURE_CUBE_MAP_NEGATIVE_X, * gl.TEXTURE_CUBE_MAP_POSITIVE_Y, * gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, * gl.TEXTURE_CUBE_MAP_POSITIVE_Z, * gl.TEXTURE_CUBE_MAP_NEGATIVE_Z] * * @property {(number[]|ArrayBufferView|TexImageSource|TexImageSource[]|string|string[]|module:twgl.TextureFunc)} [src] source for texture * * If `string` then it's assumed to be a URL to an image. The image will be downloaded async. A usable * 1x1 pixel texture will be returned immediatley. The texture will be updated once the image has downloaded. * If `target` is `gl.TEXTURE_CUBE_MAP` will attempt to divide image into 6 square pieces. 1x6, 6x1, 3x2, 2x3. * The pieces will be uploaded in `cubeFaceOrder` * * If `string[]` or `TexImageSource[]` and target is `gl.TEXTURE_CUBE_MAP` then it must have 6 entries, one for each face of a cube map. * * If `string[]` or `TexImageSource[]` and target is `gl.TEXTURE_2D_ARRAY` then eact entry is a slice of the a 2d array texture * and will be scaled to the specified width and height OR to the size of the first image that loads. * * If `TexImageSource` then it wil be used immediately to create the contents of the texture. Examples `HTMLImageElement`, * `HTMLCanvasElement`, `HTMLVideoElement`. * * If `number[]` or `ArrayBufferView` it's assumed to be data for a texture. If `width` or `height` is * not specified it is guessed as follows. First the number of elements is computed by `src.length / numComponents` * where `numComponents` is derived from `format`. If `target` is `gl.TEXTURE_CUBE_MAP` then `numElements` is divided * by 6. Then * * * If neither `width` nor `height` are specified and `sqrt(numElements)` is an integer then width and height * are set to `sqrt(numElements)`. Otherwise `width = numElements` and `height = 1`. * * * If only one of `width` or `height` is specified then the other equals `numElements / specifiedDimension`. * * If `number[]` will be converted to `type`. * * If `src` is a function it will be called with a `WebGLRenderingContext` and these options. * Whatever it returns is subject to these rules. So it can return a string url, an `HTMLElement` * an array etc... * * If `src` is undefined then an empty texture will be created of size `width` by `height`. * * @property {string} [crossOrigin] What to set the crossOrigin property of images when they are downloaded. * default: undefined. Also see {@link module:twgl.setDefaults}. * * @memberOf module:twgl */ // NOTE: While querying GL is considered slow it's not remotely as slow // as uploading a texture. On top of that you're unlikely to call this in // a perf critical loop. Even if upload a texture every frame that's unlikely // to be more than 1 or 2 textures a frame. In other words, the benefits of // making the API easy to use outweigh any supposed perf benefits // // Also note I get that having one global of these is bad practice. // As long as it's used correctly it means no garbage which probably // doesn't matter when dealing with textures but old habits die hard. var lastPackState = {}; /** * Saves any packing state that will be set based on the options. * @param {module:twgl.TextureOptions} options A TextureOptions object with whatever parameters you want set. * @param {WebGLRenderingContext} gl the WebGLRenderingContext */ function savePackState(gl, options) { if (options.colorspaceConversion !== undefined) { lastPackState.colorspaceConversion = gl.getParameter(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL); gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, options.colorspaceConversion); } if (options.premultiplyAlpha !== undefined) { lastPackState.premultiplyAlpha = gl.getParameter(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL); gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, options.premultiplyAlpha); } if (options.flipY !== undefined) { lastPackState.flipY = gl.getParameter(gl.UNPACK_FLIP_Y_WEBGL); gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, options.flipY); } } /** * Restores any packing state that was set based on the options. * @param {module:twgl.TextureOptions} options A TextureOptions object with whatever parameters you want set. * @param {WebGLRenderingContext} gl the WebGLRenderingContext */ function restorePackState(gl, options) { if (options.colorspaceConversion !== undefined) { gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, lastPackState.colorspaceConversion); } if (options.premultiplyAlpha !== undefined) { gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, lastPackState.premultiplyAlpha); } if (options.flipY !== undefined) { gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, lastPackState.flipY); } } /** * Saves state related to data size * @param {WebGLRenderingContext} gl the WebGLRenderingContext */ function saveSkipState(gl) { lastPackState.unpackAlignment = gl.getParameter(gl.UNPACK_ALIGNMENT); if (utils.isWebGL2(gl)) { lastPackState.unpackRowLength = gl.getParameter(gl.UNPACK_ROW_LENGTH); lastPackState.unpackImageHeight = gl.getParameter(gl.UNPACK_IMAGE_HEIGHT); lastPackState.unpackSkipPixels = gl.getParameter(gl.UNPACK_SKIP_PIXELS); lastPackState.unpackSkipRows = gl.getParameter(gl.UNPACK_SKIP_ROWS); lastPackState.unpackSkipImages = gl.getParameter(gl.UNPACK_SKIP_IMAGES); } } /** * Restores state related to data size * @param {WebGLRenderingContext} gl the WebGLRenderingContext */ function restoreSkipState(gl) { gl.pixelStorei(gl.UNPACK_ALIGNMENT, lastPackState.unpackAlignment); if (utils.isWebGL2(gl)) { gl.pixelStorei(gl.UNPACK_ROW_LENGTH, lastPackState.unpackRowLength); gl.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, lastPackState.unpackImageHeight); gl.pixelStorei(gl.UNPACK_SKIP_PIXELS, lastPackState.unpackSkipPixels); gl.pixelStorei(gl.UNPACK_SKIP_ROWS, lastPackState.unpackSkipRows); gl.pixelStorei(gl.UNPACK_SKIP_IMAGES, lastPackState.unpackSkipImages); } } /** * Sets the parameters of a texture or sampler * @param {WebGLRenderingContext} gl the WebGLRenderingContext * @param {number|WebGLSampler} target texture target or sampler * @param {function()} parameteriFn texParamteri or samplerParameteri fn * @param {WebGLTexture} tex the WebGLTexture to set parameters for * @param {module:twgl.TextureOptions} options A TextureOptions object with whatever parameters you want set. * This is often the same options you passed in when you created the texture. */ function setTextureSamplerParameters(gl, target, parameteriFn, options) { if (options.minMag) { parameteriFn.call(gl, target, gl.TEXTURE_MIN_FILTER, options.minMag); parameteriFn.call(gl, target, gl.TEXTURE_MAG_FILTER, options.minMag); } if (options.min) { parameteriFn.call(gl, target, gl.TEXTURE_MIN_FILTER, options.min); } if (options.mag) { parameteriFn.call(gl, target, gl.TEXTURE_MAG_FILTER, options.mag); } if (options.wrap) { parameteriFn.call(gl, target, gl.TEXTURE_WRAP_S, options.wrap); parameteriFn.call(gl, target, gl.TEXTURE_WRAP_T, options.wrap); if (target === gl.TEXTURE_3D || helper.isSampler(gl, target)) { parameteriFn.call(gl, target, gl.TEXTURE_WRAP_R, options.wrap); } } if (options.wrapR) { parameteriFn.call(gl, target, gl.TEXTURE_WRAP_R, options.wrapR); } if (options.wrapS) { parameteriFn.call(gl, target, gl.TEXTURE_WRAP_S, options.wrapS); } if (options.wrapT) { parameteriFn.call(gl, target, gl.TEXTURE_WRAP_T, options.wrapT); } if (options.minLod) { parameteriFn.call(gl, target, gl.TEXTURE_MIN_LOD, options.minLod); } if (options.maxLod) { parameteriFn.call(gl, target, gl.TEXTURE_MAX_LOD, options.maxLod); } if (options.baseLevel) { parameteriFn.call(gl, target, gl.TEXTURE_BASE_LEVEL, options.baseLevel); } if (options.maxLevel) { parameteriFn.call(gl, target, gl.TEXTURE_MAX_LEVEL, options.maxLevel); } } /** * Sets the texture parameters of a texture. * @param {WebGLRenderingContext} gl the WebGLRenderingContext * @param {WebGLTexture} tex the WebGLTexture to set parameters for * @param {module:twgl.TextureOptions} options A TextureOptions object with whatever parameters you want set. * This is often the same options you passed in when you created the texture. * @memberOf module:twgl/textures */ function setTextureParameters(gl, tex, options) { var target = options.target || gl.TEXTURE_2D; gl.bindTexture(target, tex); setTextureSamplerParameters(gl, target, gl.texParameteri, options); } /** * Sets the sampler parameters of a sampler. * @param {WebGLRenderingContext} gl the WebGLRenderingContext * @param {WebGLSampler} sampler the WebGLSampler to set parameters for * @param {module:twgl.TextureOptions} options A TextureOptions object with whatever parameters you want set. * @memberOf module:twgl/textures */ function setSamplerParameters(gl, sampler, options) { setTextureSamplerParameters(gl, sampler, gl.samplerParameteri, options); } /** * Creates a new sampler object and sets parameters. * * Example: * * const sampler = twgl.createSampler(gl, { * minMag: gl.NEAREST, // sets both TEXTURE_MIN_FILTER and TEXTURE_MAG_FILTER * wrap: gl.CLAMP_TO_NEAREST, // sets both TEXTURE_WRAP_S and TEXTURE_WRAP_T and TEXTURE_WRAP_R * }); * * @param {WebGLRenderingContext} gl the WebGLRenderingContext * @param {Object.} options A object of TextureOptions one per sampler. * @return {Object.} the created samplers by name */ function createSampler(gl, options) { var sampler = gl.createSampler(); setSamplerParameters(gl, sampler, options); return sampler; } /** * Creates a multiple sampler objects and sets parameters on each. * * Example: * * const samplers = twgl.createSamplers(gl, { * nearest: { * minMag: gl.NEAREST, * }, * nearestClampS: { * minMag: gl.NEAREST, * wrapS: gl.CLAMP_TO_NEAREST, * }, * linear: { * minMag: gl.LINEAR, * }, * nearestClamp: { * minMag: gl.NEAREST, * wrap: gl.CLAMP_TO_EDGE, * }, * linearClamp: { * minMag: gl.LINEAR, * wrap: gl.CLAMP_TO_EDGE, * }, * linearClampT: { * minMag: gl.LINEAR, * wrapT: gl.CLAMP_TO_EDGE, * }, * }); * * @param {WebGLRenderingContext} gl the WebGLRenderingContext * @param {module:twgl.TextureOptions} [options] A TextureOptions object with whatever parameters you want set on the sampler */ function createSamplers(gl, samplerOptions) { var samplers = {}; Object.keys(samplerOptions).forEach(function (name) { samplers[name] = createSampler(gl, samplerOptions[name]); }); return samplers; } /** * Makes a 1x1 pixel * If no color is passed in uses the default color which can be set by calling `setDefaultTextureColor`. * @param {(number[]|ArrayBufferView)} [color] The color using 0-1 values * @return {Uint8Array} Unit8Array with color. */ function make1Pixel(color) { color = color || defaults.textureColor; if (isArrayBuffer(color)) { return color; } return new Uint8Array([color[0] * 255, color[1] * 255, color[2] * 255, color[3] * 255]); } /** * Sets filtering or generates mips for texture based on width or height * If width or height is not passed in uses `options.width` and//or `options.height` * * @param {WebGLRenderingContext} gl the WebGLRenderingContext * @param {WebGLTexture} tex the WebGLTexture to set parameters for * @param {module:twgl.TextureOptions} [options] A TextureOptions object with whatever parameters you want set. * This is often the same options you passed in when you created the texture. * @param {number} [width] width of texture * @param {number} [height] height of texture * @param {number} [internalFormat] The internalFormat parameter from texImage2D etc.. * @param {number} [type] The type parameter for texImage2D etc.. * @memberOf module:twgl/textures */ function setTextureFilteringForSize(gl, tex, options, width, height, internalFormat, type) { options = options || defaults.textureOptions; internalFormat = internalFormat || gl.RGBA; type = type || gl.UNSIGNED_BYTE; var target = options.target || gl.TEXTURE_2D; width = width || options.width; height = height || options.height; gl.bindTexture(target, tex); if (canGenerateMipmap(gl, width, height, internalFormat, type)) { gl.generateMipmap(target); } else { var filtering = canFilter(internalFormat, type) ? gl.LINEAR : gl.NEAREST; gl.texParameteri(target, gl.TEXTURE_MIN_FILTER, filtering); gl.texParameteri(target, gl.TEXTURE_MAG_FILTER, filtering); gl.texParameteri(target, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); gl.texParameteri(target, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); } } function shouldAutomaticallySetTextureFilteringForSize(options) { return options.auto === true || options.auto === undefined && options.level === undefined; } /** * Gets an array of cubemap face enums * @param {WebGLRenderingContext} gl the WebGLRenderingContext * @param {module:twgl.TextureOptions} options A TextureOptions object with whatever parameters you want set. * This is often the same options you passed in when you created the texture. * @return {number[]} cubemap face enums */ function getCubeFaceOrder(gl, options) { options = options || {}; return options.cubeFaceOrder || [gl.TEXTURE_CUBE_MAP_POSITIVE_X, gl.TEXTURE_CUBE_MAP_NEGATIVE_X, gl.TEXTURE_CUBE_MAP_POSITIVE_Y, gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, gl.TEXTURE_CUBE_MAP_POSITIVE_Z, gl.TEXTURE_CUBE_MAP_NEGATIVE_Z]; } /** * @typedef {Object} FaceInfo * @property {number} face gl enum for texImage2D * @property {number} ndx face index (0 - 5) into source data * @ignore */ /** * Gets an array of FaceInfos * There's a bug in some NVidia drivers that will crash the driver if * `gl.TEXTURE_CUBE_MAP_POSITIVE_X` is not uploaded first. So, we take * the user's desired order from his faces to WebGL and make sure we * do the faces in WebGL order * * @param {WebGLRenderingContext} gl the WebGLRenderingContext * @param {module:twgl.TextureOptions} options A TextureOptions object with whatever parameters you want set. * @return {FaceInfo[]} cubemap face infos. Arguably the `face` property of each element is redundent but * it's needed internally to sort the array of `ndx` properties by `face`. */ function getCubeFacesWithNdx(gl, options) { var faces = getCubeFaceOrder(gl, options); // work around bug in NVidia drivers. We have to upload the first face first else the driver crashes :( var facesWithNdx = faces.map(function (face, ndx) { return { face: face, ndx: ndx }; }); facesWithNdx.sort(function (a, b) { return a.face - b.face; }); return facesWithNdx; } /** * Set a texture from the contents of an element. Will also set * texture filtering or generate mips based on the dimensions of the element * unless `options.auto === false`. If `target === gl.TEXTURE_CUBE_MAP` will * attempt to slice image into 1x6, 2x3, 3x2, or 6x1 images, one for each face. * @param {WebGLRenderingContext} gl the WebGLRenderingContext * @param {WebGLTexture} tex the WebGLTexture to set parameters for * @param {HTMLElement} element a canvas, img, or video element. * @param {module:twgl.TextureOptions} [options] A TextureOptions object with whatever parameters you want set. * This is often the same options you passed in when you created the texture. * @memberOf module:twgl/textures * @kind function */ function setTextureFromElement(gl, tex, element, options) { options = options || defaults.textureOptions; var target = options.target || gl.TEXTURE_2D; var level = options.level || 0; var width = element.width; var height = element.height; var internalFormat = options.internalFormat || options.format || gl.RGBA; var formatType = getFormatAndTypeForInternalFormat(internalFormat); var format = options.format || formatType.format; var type = options.type || formatType.type; savePackState(gl, options); gl.bindTexture(target, tex); if (target === gl.TEXTURE_CUBE_MAP) { // guess the parts var imgWidth = element.width; var imgHeight = element.height; var size; var slices; if (imgWidth / 6 === imgHeight) { // It's 6x1 size = imgHeight; slices = [0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0]; } else if (imgHeight / 6 === imgWidth) { // It's 1x6 size = imgWidth; slices = [0, 0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5]; } else if (imgWidth / 3 === imgHeight / 2) { // It's 3x2 size = imgWidth / 3; slices = [0, 0, 1, 0, 2, 0, 0, 1, 1, 1, 2, 1]; } else if (imgWidth / 2 === imgHeight / 3) { // It's 2x3 size = imgWidth / 2; slices = [0, 0, 1, 0, 0, 1, 1, 1, 0, 2, 1, 2]; } else { throw "can't figure out cube map from element: " + (element.src ? element.src : element.nodeName); } if (ctx) { ctx.canvas.width = size; ctx.canvas.height = size; width = size; height = size; getCubeFacesWithNdx(gl, options).forEach(function (f) { var xOffset = slices[f.ndx * 2 + 0] * size; var yOffset = slices[f.ndx * 2 + 1] * size; ctx.drawImage(element, xOffset, yOffset, size, size, 0, 0, size, size); gl.texImage2D(f.face, level, internalFormat, format, type, ctx.canvas); }); // Free up the canvas memory ctx.canvas.width = 1; ctx.canvas.height = 1; } else if (_globalObject.default.createImageBitmap) { // NOTE: It seems like we should prefer ImageBitmap because unlike canvas it's // note lossy? (alpha is not premultiplied? although I'm not sure what width = size; height = size; getCubeFacesWithNdx(gl, options).forEach(function (f) { var xOffset = slices[f.ndx * 2 + 0] * size; var yOffset = slices[f.ndx * 2 + 1] * size; // We can't easily use a default texture color here as it would have to match // the type across all faces where as with a 2D one there's only one face // so we're replacing everything all at once. It also has to be the correct size. // On the other hand we need all faces to be the same size so as one face loads // the rest match else the texture will be unrenderable. gl.texImage2D(f.face, level, internalFormat, size, size, 0, format, type, null); _globalObject.default.createImageBitmap(element, xOffset, yOffset, size, size, { premultiplyAlpha: 'none', colorSpaceConversion: 'none' }).then(function (imageBitmap) { savePackState(gl, options); gl.bindTexture(target, tex); gl.texImage2D(f.face, level, internalFormat, format, type, imageBitmap); restorePackState(gl, options); if (shouldAutomaticallySetTextureFilteringForSize(options)) { setTextureFilteringForSize(gl, tex, options, width, height, internalFormat, type); } }); }); } } else if (target === gl.TEXTURE_3D || target === gl.TEXTURE_2D_ARRAY) { var smallest = Math.min(element.width, element.height); var largest = Math.max(element.width, element.height); var depth = largest / smallest; if (depth % 1 !== 0) { throw "can not compute 3D dimensions of element"; } var xMult = element.width === largest ? 1 : 0; var yMult = element.height === largest ? 1 : 0; saveSkipState(gl); gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1); gl.pixelStorei(gl.UNPACK_ROW_LENGTH, element.width); gl.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, 0); gl.pixelStorei(gl.UNPACK_SKIP_IMAGES, 0); gl.texImage3D(target, level, internalFormat, smallest, smallest, smallest, 0, format, type, null); for (var d = 0; d < depth; ++d) { var srcX = d * smallest * xMult; var srcY = d * smallest * yMult; gl.pixelStorei(gl.UNPACK_SKIP_PIXELS, srcX); gl.pixelStorei(gl.UNPACK_SKIP_ROWS, srcY); gl.texSubImage3D(target, level, 0, 0, d, smallest, smallest, 1, format, type, element); } restoreSkipState(gl); } else { gl.texImage2D(target, level, internalFormat, format, type, element); } restorePackState(gl, options); if (shouldAutomaticallySetTextureFilteringForSize(options)) { setTextureFilteringForSize(gl, tex, options, width, height, internalFormat, type); } setTextureParameters(gl, tex, options); } function noop() {} /** * Loads an image * @param {string} url url to image * @param {string} crossOrigin * @param {function(err, img)} [callback] a callback that's passed an error and the image. The error will be non-null * if there was an error * @return {HTMLImageElement} the image being loaded. */ function loadImage(url, crossOrigin, callback) { callback = callback || noop; var img; if (_globalObject.default.Image) { img = new _globalObject.default.Image(); crossOrigin = crossOrigin !== undefined ? crossOrigin : defaults.crossOrigin; if (crossOrigin !== undefined) { img.crossOrigin = crossOrigin; } var clearEventHandlers = function clearEventHandlers() { img.removeEventListener('error', onError); // eslint-disable-line img.removeEventListener('load', onLoad); // eslint-disable-line img = null; }; var onError = function onError() { var msg = "couldn't load image: " + url; helper.error(msg); callback(msg, img); clearEventHandlers(); }; var onLoad = function onLoad() { callback(null, img); clearEventHandlers(); }; img.addEventListener('error', onError); img.addEventListener('load', onLoad); img.src = url; return img; } else if (_globalObject.default.ImageBitmap) { var err; var bm; var cb = function cb() { callback(err, bm); }; var options = {}; if (crossOrigin) { options.mode = 'cors'; // TODO: not sure how to translate image.crossOrigin } fetch(url, options).then(function (response) { if (!response.ok) { throw response; } return response.blob(); }).then(function (blob) { return _globalObject.default.createImageBitmap(blob, { premultiplyAlpha: 'none', colorSpaceConversion: 'none' }); }).then(function (bitmap) { // not sure if this works. We don't want // to catch the user's error. So, call // the callback in a timeout so we're // not in this scope inside the promise. bm = bitmap; setTimeout(cb); }).catch(function (e) { err = e; setTimeout(cb); }); img = null; } return img; } /** * check if object is a TexImageSource * * @param {Object} obj Object to test * @return {boolean} true if object is a TexImageSource */ function isTexImageSource(obj) { return _globalObject.default.ImageBitmap && obj instanceof _globalObject.default.ImageBitmap || _globalObject.default.ImageData && obj instanceof _globalObject.default.ImageData || _globalObject.default.HTMLElement && obj instanceof _globalObject.default.HTMLElement; } /** * if obj is an TexImageSource then just * uses it otherwise if obj is a string * then load it first. * * @param {string|TexImageSource} obj * @param {string} crossOrigin * @param {function(err, img)} [callback] a callback that's passed an error and the image. The error will be non-null * if there was an error */ function loadAndUseImage(obj, crossOrigin, callback) { if (isTexImageSource(obj)) { setTimeout(function () { callback(null, obj); }); return obj; } return loadImage(obj, crossOrigin, callback); } /** * Sets a texture to a 1x1 pixel color. If `options.color === false` is nothing happens. If it's not set * the default texture color is used which can be set by calling `setDefaultTextureColor`. * @param {WebGLRenderingContext} gl the WebGLRenderingContext * @param {WebGLTexture} tex the WebGLTexture to set parameters for * @param {module:twgl.TextureOptions} [options] A TextureOptions object with whatever parameters you want set. * This is often the same options you passed in when you created the texture. * @memberOf module:twgl/textures */ function setTextureTo1PixelColor(gl, tex, options) { options = options || defaults.textureOptions; var target = options.target || gl.TEXTURE_2D; gl.bindTexture(target, tex); if (options.color === false) { return; } // Assume it's a URL // Put 1x1 pixels in texture. That makes it renderable immediately regardless of filtering. var color = make1Pixel(options.color); if (target === gl.TEXTURE_CUBE_MAP) { for (var ii = 0; ii < 6; ++ii) { gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + ii, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, color); } } else if (target === gl.TEXTURE_3D || target === gl.TEXTURE_2D_ARRAY) { gl.texImage3D(target, 0, gl.RGBA, 1, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, color); } else { gl.texImage2D(target, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, color); } } /** * The src image(s) used to create a texture. * * When you call {@link module:twgl.createTexture} or {@link module:twgl.createTextures} * you can pass in urls for images to load into the textures. If it's a single url * then this will be a single HTMLImageElement. If it's an array of urls used for a cubemap * this will be a corresponding array of images for the cubemap. * * @typedef {HTMLImageElement|HTMLImageElement[]} TextureSrc * @memberOf module:twgl */ /** * A callback for when an image finished downloading and been uploaded into a texture * @callback TextureReadyCallback * @param {*} err If truthy there was an error. * @param {WebGLTexture} texture the texture. * @param {module:twgl.TextureSrc} souce image(s) used to as the src for the texture * @memberOf module:twgl */ /** * A callback for when all images have finished downloading and been uploaded into their respective textures * @callback TexturesReadyCallback * @param {*} err If truthy there was an error. * @param {Object.} textures the created textures by name. Same as returned by {@link module:twgl.createTextures}. * @param {Object.} sources the image(s) used for the texture by name. * @memberOf module:twgl */ /** * A callback for when an image finished downloading and been uploaded into a texture * @callback CubemapReadyCallback * @param {*} err If truthy there was an error. * @param {WebGLTexture} tex the texture. * @param {HTMLImageElement[]} imgs the images for each face. * @memberOf module:twgl */ /** * A callback for when an image finished downloading and been uploaded into a texture * @callback ThreeDReadyCallback * @param {*} err If truthy there was an error. * @param {WebGLTexture} tex the texture. * @param {HTMLImageElement[]} imgs the images for each slice. * @memberOf module:twgl */ /** * Loads a texture from an image from a Url as specified in `options.src` * If `options.color !== false` will set the texture to a 1x1 pixel color so that the texture is * immediately useable. It will be updated with the contents of the image once the image has finished * downloading. Filtering options will be set as approriate for image unless `options.auto === false`. * @param {WebGLRenderingContext} gl the WebGLRenderingContext * @param {WebGLTexture} tex the WebGLTexture to set parameters for * @param {module:twgl.TextureOptions} [options] A TextureOptions object with whatever parameters you want set. * @param {module:twgl.TextureReadyCallback} [callback] A function to be called when the image has finished loading. err will * be non null if there was an error. * @return {HTMLImageElement} the image being downloaded. * @memberOf module:twgl/textures */ function loadTextureFromUrl(gl, tex, options, callback) { callback = callback || noop; options = options || defaults.textureOptions; setTextureTo1PixelColor(gl, tex, options); // Because it's async we need to copy the options. options = Object.assign({}, options); var img = loadAndUseImage(options.src, options.crossOrigin, function (err, img) { if (err) { callback(err, tex, img); } else { setTextureFromElement(gl, tex, img, options); callback(null, tex, img); } }); return img; } /** * Loads a cubemap from 6 urls or TexImageSources as specified in `options.src`. Will set the cubemap to a 1x1 pixel color * so that it is usable immediately unless `option.color === false`. * @param {WebGLRenderingContext} gl the WebGLRenderingContext * @param {WebGLTexture} tex the WebGLTexture to set parameters for * @param {module:twgl.TextureOptions} options A TextureOptions object with whatever parameters you want set. * @param {module:twgl.CubemapReadyCallback} [callback] A function to be called when all the images have finished loading. err will * be non null if there was an error. * @memberOf module:twgl/textures */ function loadCubemapFromUrls(gl, tex, options, callback) { callback = callback || noop; var urls = options.src; if (urls.length !== 6) { throw "there must be 6 urls for a cubemap"; } var level = options.level || 0; var internalFormat = options.internalFormat || options.format || gl.RGBA; var formatType = getFormatAndTypeForInternalFormat(internalFormat); var format = options.format || formatType.format; var type = options.type || gl.UNSIGNED_BYTE; var target = options.target || gl.TEXTURE_2D; if (target !== gl.TEXTURE_CUBE_MAP) { throw "target must be TEXTURE_CUBE_MAP"; } setTextureTo1PixelColor(gl, tex, options); // Because it's async we need to copy the options. options = Object.assign({}, options); var numToLoad = 6; var errors = []; var faces = getCubeFaceOrder(gl, options); var imgs; // eslint-disable-line function uploadImg(faceTarget) { return function (err, img) { --numToLoad; if (err) { errors.push(err); } else { if (img.width !== img.height) { errors.push("cubemap face img is not a square: " + img.src); } else { savePackState(gl, options); gl.bindTexture(target, tex); // So assuming this is the first image we now have one face that's img sized // and 5 faces that are 1x1 pixel so size the other faces if (numToLoad === 5) { // use the default order getCubeFaceOrder(gl).forEach(function (otherTarget) { // Should we re-use the same face or a color? gl.texImage2D(otherTarget, level, internalFormat, format, type, img); }); } else { gl.texImage2D(faceTarget, level, internalFormat, format, type, img); } restorePackState(gl, options); if (shouldAutomaticallySetTextureFilteringForSize(options)) { gl.generateMipmap(target); } } } if (numToLoad === 0) { callback(errors.length ? errors : undefined, tex, imgs); } }; } imgs = urls.map(function (url, ndx) { return loadAndUseImage(url, options.crossOrigin, uploadImg(faces[ndx])); }); } /** * Loads a 2d array or 3d texture from urls OR TexImageSources as specified in `options.src`. * Will set the texture to a 1x1 pixel color * so that it is usable immediately unless `option.color === false`. * * If the width and height is not specified the width and height of the first * image loaded will be used. Note that since images are loaded async * which image downloads first is unknown. * * If an image is not the same size as the width and height it will be scaled * to that width and height. * * @param {WebGLRenderingContext} gl the WebGLRenderingContext * @param {WebGLTexture} tex the WebGLTexture to set parameters for * @param {module:twgl.TextureOptions} options A TextureOptions object with whatever parameters you want set. * @param {module:twgl.ThreeDReadyCallback} [callback] A function to be called when all the images have finished loading. err will * be non null if there was an error. * @memberOf module:twgl/textures */ function loadSlicesFromUrls(gl, tex, options, callback) { callback = callback || noop; var urls = options.src; var internalFormat = options.internalFormat || options.format || gl.RGBA; var formatType = getFormatAndTypeForInternalFormat(internalFormat); var format = options.format || formatType.format; var type = options.type || gl.UNSIGNED_BYTE; var target = options.target || gl.TEXTURE_2D_ARRAY; if (target !== gl.TEXTURE_3D && target !== gl.TEXTURE_2D_ARRAY) { throw "target must be TEXTURE_3D or TEXTURE_2D_ARRAY"; } setTextureTo1PixelColor(gl, tex, options); // Because it's async we need to copy the options. options = Object.assign({}, options); var numToLoad = urls.length; var errors = []; var imgs; // eslint-disable-line var level = options.level || 0; var width = options.width; var height = options.height; var depth = urls.length; var firstImage = true; function uploadImg(slice) { return function (err, img) { --numToLoad; if (err) { errors.push(err); } else { savePackState(gl, options); gl.bindTexture(target, tex); if (firstImage) { firstImage = false; width = options.width || img.width; height = options.height || img.height; gl.texImage3D(target, level, internalFormat, width, height, depth, 0, format, type, null); // put it in every slice otherwise some slices will be 0,0,0,0 for (var s = 0; s < depth; ++s) { gl.texSubImage3D(target, level, 0, 0, s, width, height, 1, format, type, img); } } else { var src = img; if (img.width !== width || img.height !== height) { // Size the image to fix src = ctx.canvas; ctx.canvas.width = width; ctx.canvas.height = height; ctx.drawImage(img, 0, 0, width, height); } gl.texSubImage3D(target, level, 0, 0, slice, width, height, 1, format, type, src); // free the canvas memory if (src === ctx.canvas) { ctx.canvas.width = 0; ctx.canvas.height = 0; } } restorePackState(gl, options); if (shouldAutomaticallySetTextureFilteringForSize(options)) { gl.generateMipmap(target); } } if (numToLoad === 0) { callback(errors.length ? errors : undefined, tex, imgs); } }; } imgs = urls.map(function (url, ndx) { return loadAndUseImage(url, options.crossOrigin, uploadImg(ndx)); }); } /** * Sets a texture from an array or typed array. If the width or height is not provided will attempt to * guess the size. See {@link module:twgl.TextureOptions}. * @param {WebGLRenderingContext} gl the WebGLRenderingContext * @param {WebGLTexture} tex the WebGLTexture to set parameters for * @param {(number[]|ArrayBufferView)} src An array or typed arry with texture data. * @param {module:twgl.TextureOptions} [options] A TextureOptions object with whatever parameters you want set. * This is often the same options you passed in when you created the texture. * @memberOf module:twgl/textures */ function setTextureFromArray(gl, tex, src, options) { options = options || defaults.textureOptions; var target = options.target || gl.TEXTURE_2D; gl.bindTexture(target, tex); var width = options.width; var height = options.height; var depth = options.depth; var level = options.level || 0; var internalFormat = options.internalFormat || options.format || gl.RGBA; var formatType = getFormatAndTypeForInternalFormat(internalFormat); var format = options.format || formatType.format; var type = options.type || getTextureTypeForArrayType(gl, src, formatType.type); if (!isArrayBuffer(src)) { var Type = typedArrays.getTypedArrayTypeForGLType(type); src = new Type(src); } else if (src instanceof Uint8ClampedArray) { src = new Uint8Array(src.buffer); } var bytesPerElement = getBytesPerElementForInternalFormat(internalFormat, type); var numElements = src.byteLength / bytesPerElement; // TODO: check UNPACK_ALIGNMENT? if (numElements % 1) { throw "length wrong size for format: " + utils.glEnumToString(gl, format); } var dimensions; if (target === gl.TEXTURE_3D) { if (!width && !height && !depth) { var size = Math.cbrt(numElements); if (size % 1 !== 0) { throw "can't guess cube size of array of numElements: " + numElements; } width = size; height = size; depth = size; } else if (width && (!height || !depth)) { dimensions = guessDimensions(gl, target, height, depth, numElements / width); height = dimensions.width; depth = dimensions.height; } else if (height && (!width || !depth)) { dimensions = guessDimensions(gl, target, width, depth, numElements / height); width = dimensions.width; depth = dimensions.height; } else { dimensions = guessDimensions(gl, target, width, height, numElements / depth); width = dimensions.width; height = dimensions.height; } } else { dimensions = guessDimensions(gl, target, width, height, numElements); width = dimensions.width; height = dimensions.height; } saveSkipState(gl); gl.pixelStorei(gl.UNPACK_ALIGNMENT, options.unpackAlignment || 1); savePackState(gl, options); if (target === gl.TEXTURE_CUBE_MAP) { var elementsPerElement = bytesPerElement / src.BYTES_PER_ELEMENT; var faceSize = numElements / 6 * elementsPerElement; getCubeFacesWithNdx(gl, options).forEach(function (f) { var offset = faceSize * f.ndx; var data = src.subarray(offset, offset + faceSize); gl.texImage2D(f.face, level, internalFormat, width, height, 0, format, type, data); }); } else if (target === gl.TEXTURE_3D) { gl.texImage3D(target, level, internalFormat, width, height, depth, 0, format, type, src); } else { gl.texImage2D(target, level, internalFormat, width, height, 0, format, type, src); } restorePackState(gl, options); restoreSkipState(gl); return { width: width, height: height, depth: depth, type: type }; } /** * Sets a texture with no contents of a certain size. In other words calls `gl.texImage2D` with `null`. * You must set `options.width` and `options.height`. * @param {WebGLRenderingContext} gl the WebGLRenderingContext * @param {WebGLTexture} tex the WebGLTexture to set parameters for * @param {module:twgl.TextureOptions} options A TextureOptions object with whatever parameters you want set. * @memberOf module:twgl/textures */ function setEmptyTexture(gl, tex, options) { var target = options.target || gl.TEXTURE_2D; gl.bindTexture(target, tex); var level = options.level || 0; var internalFormat = options.internalFormat || options.format || gl.RGBA; var formatType = getFormatAndTypeForInternalFormat(internalFormat); var format = options.format || formatType.format; var type = options.type || formatType.type; savePackState(gl, options); if (target === gl.TEXTURE_CUBE_MAP) { for (var ii = 0; ii < 6; ++ii) { gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + ii, level, internalFormat, options.width, options.height, 0, format, type, null); } } else if (target === gl.TEXTURE_3D) { gl.texImage3D(target, level, internalFormat, options.width, options.height, options.depth, 0, format, type, null); } else { gl.texImage2D(target, level, internalFormat, options.width, options.height, 0, format, type, null); } restorePackState(gl, options); } /** * Creates a texture based on the options passed in. * @param {WebGLRenderingContext} gl the WebGLRenderingContext * @param {module:twgl.TextureOptions} [options] A TextureOptions object with whatever parameters you want set. * @param {module:twgl.TextureReadyCallback} [callback] A callback called when an image has been downloaded and uploaded to the texture. * @return {WebGLTexture} the created texture. * @memberOf module:twgl/textures */ function createTexture(gl, options, callback) { callback = callback || noop; options = options || defaults.textureOptions; var tex = gl.createTexture(); var target = options.target || gl.TEXTURE_2D; var width = options.width || 1; var height = options.height || 1; var internalFormat = options.internalFormat || gl.RGBA; var formatType = getFormatAndTypeForInternalFormat(internalFormat); var type = options.type || formatType.type; gl.bindTexture(target, tex); if (target === gl.TEXTURE_CUBE_MAP) { // this should have been the default for CUBEMAPS :( gl.texParameteri(target, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); gl.texParameteri(target, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); } var src = options.src; if (src) { if (typeof src === "function") { src = src(gl, options); } if (typeof src === "string") { loadTextureFromUrl(gl, tex, options, callback); } else if (isArrayBuffer(src) || Array.isArray(src) && (typeof src[0] === 'number' || Array.isArray(src[0]) || isArrayBuffer(src[0]))) { var dimensions = setTextureFromArray(gl, tex, src, options); width = dimensions.width; height = dimensions.height; type = dimensions.type; } else if (Array.isArray(src) && (typeof src[0] === 'string' || isTexImageSource(src[0]))) { if (target === gl.TEXTURE_CUBE_MAP) { loadCubemapFromUrls(gl, tex, options, callback); } else { loadSlicesFromUrls(gl, tex, options, callback); } } else if (isTexImageSource(src)) { setTextureFromElement(gl, tex, src, options); width = src.width; height = src.height; } else { throw "unsupported src type"; } } else { setEmptyTexture(gl, tex, options); } if (shouldAutomaticallySetTextureFilteringForSize(options)) { setTextureFilteringForSize(gl, tex, options, width, height, internalFormat, type); } setTextureParameters(gl, tex, options); return tex; } /** * Resizes a texture based on the options passed in. * * Note: This is not a generic resize anything function. * It's mostly used by {@link module:twgl.resizeFramebufferInfo} * It will use `options.src` if it exists to try to determine a `type` * otherwise it will assume `gl.UNSIGNED_BYTE`. No data is provided * for the texture. Texture parameters will be set accordingly * * @param {WebGLRenderingContext} gl the WebGLRenderingContext * @param {WebGLTexture} tex the texture to resize * @param {module:twgl.TextureOptions} options A TextureOptions object with whatever parameters you want set. * @param {number} [width] the new width. If not passed in will use `options.width` * @param {number} [height] the new height. If not passed in will use `options.height` * @memberOf module:twgl/textures */ function resizeTexture(gl, tex, options, width, height) { width = width || options.width; height = height || options.height; var target = options.target || gl.TEXTURE_2D; gl.bindTexture(target, tex); var level = options.level || 0; var internalFormat = options.internalFormat || options.format || gl.RGBA; var formatType = getFormatAndTypeForInternalFormat(internalFormat); var format = options.format || formatType.format; var type; var src = options.src; if (!src) { type = options.type || formatType.type; } else if (isArrayBuffer(src) || Array.isArray(src) && typeof src[0] === 'number') { type = options.type || getTextureTypeForArrayType(gl, src, formatType.type); } else { type = options.type || formatType.type; } if (target === gl.TEXTURE_CUBE_MAP) { for (var ii = 0; ii < 6; ++ii) { gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + ii, level, internalFormat, width, height, 0, format, type, null); } } else { gl.texImage2D(target, level, internalFormat, width, height, 0, format, type, null); } } /** * Check if a src is an async request. * if src is a string we're going to download an image * if src is an array of strings we're going to download cubemap images * @param {*} src The src from a TextureOptions * @returns {bool} true if src is async. */ function isAsyncSrc(src) { return typeof src === 'string' || Array.isArray(src) && typeof src[0] === 'string'; } /** * Creates a bunch of textures based on the passed in options. * * Example: * * const textures = twgl.createTextures(gl, { * // a power of 2 image * hftIcon: { src: "images/hft-icon-16.png", mag: gl.NEAREST }, * // a non-power of 2 image * clover: { src: "images/clover.jpg" }, * // From a canvas * fromCanvas: { src: ctx.canvas }, * // A cubemap from 6 images * yokohama: { * target: gl.TEXTURE_CUBE_MAP, * src: [ * 'images/yokohama/posx.jpg', * 'images/yokohama/negx.jpg', * 'images/yokohama/posy.jpg', * 'images/yokohama/negy.jpg', * 'images/yokohama/posz.jpg', * 'images/yokohama/negz.jpg', * ], * }, * // A cubemap from 1 image (can be 1x6, 2x3, 3x2, 6x1) * goldengate: { * target: gl.TEXTURE_CUBE_MAP, * src: 'images/goldengate.jpg', * }, * // A 2x2 pixel texture from a JavaScript array * checker: { * mag: gl.NEAREST, * min: gl.LINEAR, * src: [ * 255,255,255,255, * 192,192,192,255, * 192,192,192,255, * 255,255,255,255, * ], * }, * // a 1x2 pixel texture from a typed array. * stripe: { * mag: gl.NEAREST, * min: gl.LINEAR, * format: gl.LUMINANCE, * src: new Uint8Array([ * 255, * 128, * 255, * 128, * 255, * 128, * 255, * 128, * ]), * width: 1, * }, * }); * * Now * * * `textures.hftIcon` will be a 2d texture * * `textures.clover` will be a 2d texture * * `textures.fromCanvas` will be a 2d texture * * `textures.yohohama` will be a cubemap texture * * `textures.goldengate` will be a cubemap texture * * `textures.checker` will be a 2d texture * * `textures.stripe` will be a 2d texture * * @param {WebGLRenderingContext} gl the WebGLRenderingContext * @param {Object.} options A object of TextureOptions one per texture. * @param {module:twgl.TexturesReadyCallback} [callback] A callback called when all textures have been downloaded. * @return {Object.} the created textures by name * @memberOf module:twgl/textures */ function createTextures(gl, textureOptions, callback) { callback = callback || noop; var numDownloading = 0; var errors = []; var textures = {}; var images = {}; function callCallbackIfReady() { if (numDownloading === 0) { setTimeout(function () { callback(errors.length ? errors : undefined, textures, images); }, 0); } } Object.keys(textureOptions).forEach(function (name) { var options = textureOptions[name]; var onLoadFn; if (isAsyncSrc(options.src)) { onLoadFn = function onLoadFn(err, tex, img) { images[name] = img; --numDownloading; if (err) { errors.push(err); } callCallbackIfReady(); }; ++numDownloading; } textures[name] = createTexture(gl, options, onLoadFn); }); // queue the callback if there are no images to download. // We do this because if your code is structured to wait for // images to download but then you comment out all the async // images your code would break. callCallbackIfReady(); return textures; } // Using quotes prevents Uglify from changing the names. // No speed diff AFAICT. /***/ }), /* 9 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var _exportNames = { m4: true, v3: true, primitives: true }; exports.primitives = exports.v3 = exports.m4 = void 0; var m4 = _interopRequireWildcard(__webpack_require__(6)); exports.m4 = m4; var v3 = _interopRequireWildcard(__webpack_require__(3)); exports.v3 = v3; var primitives = _interopRequireWildcard(__webpack_require__(10)); exports.primitives = primitives; var _twgl = __webpack_require__(11); Object.keys(_twgl).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; exports[key] = _twgl[key]; }); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } /***/ }), /* 10 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.create3DFVertices = create3DFVertices; exports.createAugmentedTypedArray = createAugmentedTypedArray; exports.createCubeVertices = createCubeVertices; exports.createPlaneVertices = createPlaneVertices; exports.createSphereVertices = createSphereVertices; exports.createTruncatedConeVertices = createTruncatedConeVertices; exports.createXYQuadVertices = createXYQuadVertices; exports.createCresentVertices = createCresentVertices; exports.createCylinderVertices = createCylinderVertices; exports.createTorusVertices = createTorusVertices; exports.createDiscVertices = createDiscVertices; exports.deindexVertices = deindexVertices; exports.flattenNormals = flattenNormals; exports.makeRandomVertexColors = makeRandomVertexColors; exports.reorientDirections = reorientDirections; exports.reorientNormals = reorientNormals; exports.reorientPositions = reorientPositions; exports.reorientVertices = reorientVertices; exports.concatVertices = concatVertices; exports.duplicateVertices = duplicateVertices; exports.createDiscBuffers = exports.createDiscBufferInfo = exports.createTorusBuffers = exports.createTorusBufferInfo = exports.createCylinderBuffers = exports.createCylinderBufferInfo = exports.createCresentBuffers = exports.createCresentBufferInfo = exports.createXYQuadBuffers = exports.createXYQuadBufferInfo = exports.createTruncatedConeBuffers = exports.createTruncatedConeBufferInfo = exports.createSphereBuffers = exports.createSphereBufferInfo = exports.createPlaneBuffers = exports.createPlaneBufferInfo = exports.createCubeBuffers = exports.createCubeBufferInfo = exports.create3DFBuffers = exports.create3DFBufferInfo = void 0; var attributes = _interopRequireWildcard(__webpack_require__(7)); var helper = _interopRequireWildcard(__webpack_require__(0)); var typedArrays = _interopRequireWildcard(__webpack_require__(1)); var m4 = _interopRequireWildcard(__webpack_require__(6)); var v3 = _interopRequireWildcard(__webpack_require__(3)); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } /* * Copyright 2015, Gregg Tavares. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Gregg Tavares. nor the names of his * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * Various functions to make simple primitives * * note: Most primitive functions come in 3 styles * * * `createSomeShapeBufferInfo` * * These functions are almost always the functions you want to call. They * create vertices then make WebGLBuffers and create {@link module:twgl.AttribInfo}s * returing a {@link module:twgl.BufferInfo} you can pass to {@link module:twgl.setBuffersAndAttributes} * and {@link module:twgl.drawBufferInfo} etc... * * * `createSomeShapeBuffers` * * These create WebGLBuffers and put your data in them but nothing else. * It's a shortcut to doing it yourself if you don't want to use * the higher level functions. * * * `createSomeShapeVertices` * * These just create vertices, no buffers. This allows you to manipulate the vertices * or add more data before generating a {@link module:twgl.BufferInfo}. Once you're finished * manipulating the vertices call {@link module:twgl.createBufferInfoFromArrays}. * * example: * * const arrays = twgl.primitives.createPlaneArrays(1); * twgl.primitives.reorientVertices(arrays, m4.rotationX(Math.PI * 0.5)); * const bufferInfo = twgl.createBufferInfoFromArrays(gl, arrays); * * @module twgl/primitives */ var getArray = attributes.getArray_; // eslint-disable-line var getNumComponents = attributes.getNumComponents_; // eslint-disable-line /** * Add `push` to a typed array. It just keeps a 'cursor' * and allows use to `push` values into the array so we * don't have to manually compute offsets * @param {TypedArray} typedArray TypedArray to augment * @param {number} numComponents number of components. */ function augmentTypedArray(typedArray, numComponents) { var cursor = 0; typedArray.push = function () { for (var ii = 0; ii < arguments.length; ++ii) { var value = arguments[ii]; if (value instanceof Array || typedArrays.isArrayBuffer(value)) { for (var jj = 0; jj < value.length; ++jj) { typedArray[cursor++] = value[jj]; } } else { typedArray[cursor++] = value; } } }; typedArray.reset = function (opt_index) { cursor = opt_index || 0; }; typedArray.numComponents = numComponents; Object.defineProperty(typedArray, 'numElements', { get: function get() { return this.length / this.numComponents | 0; } }); return typedArray; } /** * creates a typed array with a `push` function attached * so that you can easily *push* values. * * `push` can take multiple arguments. If an argument is an array each element * of the array will be added to the typed array. * * Example: * * const array = createAugmentedTypedArray(3, 2); // creates a Float32Array with 6 values * array.push(1, 2, 3); * array.push([4, 5, 6]); * // array now contains [1, 2, 3, 4, 5, 6] * * Also has `numComponents` and `numElements` properties. * * @param {number} numComponents number of components * @param {number} numElements number of elements. The total size of the array will be `numComponents * numElements`. * @param {constructor} opt_type A constructor for the type. Default = `Float32Array`. * @return {ArrayBufferView} A typed array. * @memberOf module:twgl/primitives */ function createAugmentedTypedArray(numComponents, numElements, opt_type) { var Type = opt_type || Float32Array; return augmentTypedArray(new Type(numComponents * numElements), numComponents); } function allButIndices(name) { return name !== "indices"; } /** * Given indexed vertices creates a new set of vertices unindexed by expanding the indexed vertices. * @param {Object.} vertices The indexed vertices to deindex * @return {Object.} The deindexed vertices * @memberOf module:twgl/primitives */ function deindexVertices(vertices) { var indices = vertices.indices; var newVertices = {}; var numElements = indices.length; function expandToUnindexed(channel) { var srcBuffer = vertices[channel]; var numComponents = srcBuffer.numComponents; var dstBuffer = createAugmentedTypedArray(numComponents, numElements, srcBuffer.constructor); for (var ii = 0; ii < numElements; ++ii) { var ndx = indices[ii]; var offset = ndx * numComponents; for (var jj = 0; jj < numComponents; ++jj) { dstBuffer.push(srcBuffer[offset + jj]); } } newVertices[channel] = dstBuffer; } Object.keys(vertices).filter(allButIndices).forEach(expandToUnindexed); return newVertices; } /** * flattens the normals of deindexed vertices in place. * @param {Object.} vertices The deindexed vertices who's normals to flatten * @return {Object.} The flattened vertices (same as was passed in) * @memberOf module:twgl/primitives */ function flattenNormals(vertices) { if (vertices.indices) { throw "can't flatten normals of indexed vertices. deindex them first"; } var normals = vertices.normal; var numNormals = normals.length; for (var ii = 0; ii < numNormals; ii += 9) { // pull out the 3 normals for this triangle var nax = normals[ii + 0]; var nay = normals[ii + 1]; var naz = normals[ii + 2]; var nbx = normals[ii + 3]; var nby = normals[ii + 4]; var nbz = normals[ii + 5]; var ncx = normals[ii + 6]; var ncy = normals[ii + 7]; var ncz = normals[ii + 8]; // add them var nx = nax + nbx + ncx; var ny = nay + nby + ncy; var nz = naz + nbz + ncz; // normalize them var length = Math.sqrt(nx * nx + ny * ny + nz * nz); nx /= length; ny /= length; nz /= length; // copy them back in normals[ii + 0] = nx; normals[ii + 1] = ny; normals[ii + 2] = nz; normals[ii + 3] = nx; normals[ii + 4] = ny; normals[ii + 5] = nz; normals[ii + 6] = nx; normals[ii + 7] = ny; normals[ii + 8] = nz; } return vertices; } function applyFuncToV3Array(array, matrix, fn) { var len = array.length; var tmp = new Float32Array(3); for (var ii = 0; ii < len; ii += 3) { fn(matrix, [array[ii], array[ii + 1], array[ii + 2]], tmp); array[ii] = tmp[0]; array[ii + 1] = tmp[1]; array[ii + 2] = tmp[2]; } } function transformNormal(mi, v, dst) { dst = dst || v3.create(); var v0 = v[0]; var v1 = v[1]; var v2 = v[2]; dst[0] = v0 * mi[0 * 4 + 0] + v1 * mi[0 * 4 + 1] + v2 * mi[0 * 4 + 2]; dst[1] = v0 * mi[1 * 4 + 0] + v1 * mi[1 * 4 + 1] + v2 * mi[1 * 4 + 2]; dst[2] = v0 * mi[2 * 4 + 0] + v1 * mi[2 * 4 + 1] + v2 * mi[2 * 4 + 2]; return dst; } /** * Reorients directions by the given matrix.. * @param {number[]|TypedArray} array The array. Assumes value floats per element. * @param {Matrix} matrix A matrix to multiply by. * @return {number[]|TypedArray} the same array that was passed in * @memberOf module:twgl/primitives */ function reorientDirections(array, matrix) { applyFuncToV3Array(array, matrix, m4.transformDirection); return array; } /** * Reorients normals by the inverse-transpose of the given * matrix.. * @param {number[]|TypedArray} array The array. Assumes value floats per element. * @param {Matrix} matrix A matrix to multiply by. * @return {number[]|TypedArray} the same array that was passed in * @memberOf module:twgl/primitives */ function reorientNormals(array, matrix) { applyFuncToV3Array(array, m4.inverse(matrix), transformNormal); return array; } /** * Reorients positions by the given matrix. In other words, it * multiplies each vertex by the given matrix. * @param {number[]|TypedArray} array The array. Assumes value floats per element. * @param {Matrix} matrix A matrix to multiply by. * @return {number[]|TypedArray} the same array that was passed in * @memberOf module:twgl/primitives */ function reorientPositions(array, matrix) { applyFuncToV3Array(array, matrix, m4.transformPoint); return array; } /** * Reorients arrays by the given matrix. Assumes arrays have * names that contains 'pos' could be reoriented as positions, * 'binorm' or 'tan' as directions, and 'norm' as normals. * * @param {Object.} arrays The vertices to reorient * @param {Matrix} matrix matrix to reorient by. * @return {Object.} same arrays that were passed in. * @memberOf module:twgl/primitives */ function reorientVertices(arrays, matrix) { Object.keys(arrays).forEach(function (name) { var array = arrays[name]; if (name.indexOf("pos") >= 0) { reorientPositions(array, matrix); } else if (name.indexOf("tan") >= 0 || name.indexOf("binorm") >= 0) { reorientDirections(array, matrix); } else if (name.indexOf("norm") >= 0) { reorientNormals(array, matrix); } }); return arrays; } /** * Creates XY quad BufferInfo * * The default with no parameters will return a 2x2 quad with values from -1 to +1. * If you want a unit quad with that goes from 0 to 1 you'd call it with * * twgl.primitives.createXYQuadBufferInfo(gl, 1, 0.5, 0.5); * * If you want a unit quad centered above 0,0 you'd call it with * * twgl.primitives.createXYQuadBufferInfo(gl, 1, 0, 0.5); * * @param {WebGLRenderingContext} gl The WebGLRenderingContext. * @param {number} [size] the size across the quad. Defaults to 2 which means vertices will go from -1 to +1 * @param {number} [xOffset] the amount to offset the quad in X * @param {number} [yOffset] the amount to offset the quad in Y * @return {Object.} the created XY Quad BufferInfo * @memberOf module:twgl/primitives * @function createXYQuadBufferInfo */ /** * Creates XY quad Buffers * * The default with no parameters will return a 2x2 quad with values from -1 to +1. * If you want a unit quad with that goes from 0 to 1 you'd call it with * * twgl.primitives.createXYQuadBufferInfo(gl, 1, 0.5, 0.5); * * If you want a unit quad centered above 0,0 you'd call it with * * twgl.primitives.createXYQuadBufferInfo(gl, 1, 0, 0.5); * * @param {WebGLRenderingContext} gl The WebGLRenderingContext. * @param {number} [size] the size across the quad. Defaults to 2 which means vertices will go from -1 to +1 * @param {number} [xOffset] the amount to offset the quad in X * @param {number} [yOffset] the amount to offset the quad in Y * @return {module:twgl.BufferInfo} the created XY Quad buffers * @memberOf module:twgl/primitives * @function createXYQuadBuffers */ /** * Creates XY quad vertices * * The default with no parameters will return a 2x2 quad with values from -1 to +1. * If you want a unit quad with that goes from 0 to 1 you'd call it with * * twgl.primitives.createXYQuadVertices(1, 0.5, 0.5); * * If you want a unit quad centered above 0,0 you'd call it with * * twgl.primitives.createXYQuadVertices(1, 0, 0.5); * * @param {number} [size] the size across the quad. Defaults to 2 which means vertices will go from -1 to +1 * @param {number} [xOffset] the amount to offset the quad in X * @param {number} [yOffset] the amount to offset the quad in Y * @return {Object. the created XY Quad vertices * @memberOf module:twgl/primitives */ function createXYQuadVertices(size, xOffset, yOffset) { size = size || 2; xOffset = xOffset || 0; yOffset = yOffset || 0; size *= 0.5; return { position: { numComponents: 2, data: [xOffset + -1 * size, yOffset + -1 * size, xOffset + 1 * size, yOffset + -1 * size, xOffset + -1 * size, yOffset + 1 * size, xOffset + 1 * size, yOffset + 1 * size] }, normal: [0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1], texcoord: [0, 0, 1, 0, 0, 1, 1, 1], indices: [0, 1, 2, 2, 1, 3] }; } /** * Creates XZ plane BufferInfo. * * The created plane has position, normal, and texcoord data * * @param {WebGLRenderingContext} gl The WebGLRenderingContext. * @param {number} [width] Width of the plane. Default = 1 * @param {number} [depth] Depth of the plane. Default = 1 * @param {number} [subdivisionsWidth] Number of steps across the plane. Default = 1 * @param {number} [subdivisionsDepth] Number of steps down the plane. Default = 1 * @param {Matrix4} [matrix] A matrix by which to multiply all the vertices. * @return {@module:twgl.BufferInfo} The created plane BufferInfo. * @memberOf module:twgl/primitives * @function createPlaneBufferInfo */ /** * Creates XZ plane buffers. * * The created plane has position, normal, and texcoord data * * @param {WebGLRenderingContext} gl The WebGLRenderingContext. * @param {number} [width] Width of the plane. Default = 1 * @param {number} [depth] Depth of the plane. Default = 1 * @param {number} [subdivisionsWidth] Number of steps across the plane. Default = 1 * @param {number} [subdivisionsDepth] Number of steps down the plane. Default = 1 * @param {Matrix4} [matrix] A matrix by which to multiply all the vertices. * @return {Object.} The created plane buffers. * @memberOf module:twgl/primitives * @function createPlaneBuffers */ /** * Creates XZ plane vertices. * * The created plane has position, normal, and texcoord data * * @param {number} [width] Width of the plane. Default = 1 * @param {number} [depth] Depth of the plane. Default = 1 * @param {number} [subdivisionsWidth] Number of steps across the plane. Default = 1 * @param {number} [subdivisionsDepth] Number of steps down the plane. Default = 1 * @param {Matrix4} [matrix] A matrix by which to multiply all the vertices. * @return {Object.} The created plane vertices. * @memberOf module:twgl/primitives */ function createPlaneVertices(width, depth, subdivisionsWidth, subdivisionsDepth, matrix) { width = width || 1; depth = depth || 1; subdivisionsWidth = subdivisionsWidth || 1; subdivisionsDepth = subdivisionsDepth || 1; matrix = matrix || m4.identity(); var numVertices = (subdivisionsWidth + 1) * (subdivisionsDepth + 1); var positions = createAugmentedTypedArray(3, numVertices); var normals = createAugmentedTypedArray(3, numVertices); var texcoords = createAugmentedTypedArray(2, numVertices); for (var z = 0; z <= subdivisionsDepth; z++) { for (var x = 0; x <= subdivisionsWidth; x++) { var u = x / subdivisionsWidth; var v = z / subdivisionsDepth; positions.push(width * u - width * 0.5, 0, depth * v - depth * 0.5); normals.push(0, 1, 0); texcoords.push(u, v); } } var numVertsAcross = subdivisionsWidth + 1; var indices = createAugmentedTypedArray(3, subdivisionsWidth * subdivisionsDepth * 2, Uint16Array); for (var _z = 0; _z < subdivisionsDepth; _z++) { // eslint-disable-line for (var _x = 0; _x < subdivisionsWidth; _x++) { // eslint-disable-line // Make triangle 1 of quad. indices.push((_z + 0) * numVertsAcross + _x, (_z + 1) * numVertsAcross + _x, (_z + 0) * numVertsAcross + _x + 1); // Make triangle 2 of quad. indices.push((_z + 1) * numVertsAcross + _x, (_z + 1) * numVertsAcross + _x + 1, (_z + 0) * numVertsAcross + _x + 1); } } var arrays = reorientVertices({ position: positions, normal: normals, texcoord: texcoords, indices: indices }, matrix); return arrays; } /** * Creates sphere BufferInfo. * * The created sphere has position, normal, and texcoord data * * @param {WebGLRenderingContext} gl The WebGLRenderingContext. * @param {number} radius radius of the sphere. * @param {number} subdivisionsAxis number of steps around the sphere. * @param {number} subdivisionsHeight number of vertically on the sphere. * @param {number} [opt_startLatitudeInRadians] where to start the * top of the sphere. Default = 0. * @param {number} [opt_endLatitudeInRadians] Where to end the * bottom of the sphere. Default = Math.PI. * @param {number} [opt_startLongitudeInRadians] where to start * wrapping the sphere. Default = 0. * @param {number} [opt_endLongitudeInRadians] where to end * wrapping the sphere. Default = 2 * Math.PI. * @return {module:twgl.BufferInfo} The created sphere BufferInfo. * @memberOf module:twgl/primitives * @function createSphereBufferInfo */ /** * Creates sphere buffers. * * The created sphere has position, normal, and texcoord data * * @param {WebGLRenderingContext} gl The WebGLRenderingContext. * @param {number} radius radius of the sphere. * @param {number} subdivisionsAxis number of steps around the sphere. * @param {number} subdivisionsHeight number of vertically on the sphere. * @param {number} [opt_startLatitudeInRadians] where to start the * top of the sphere. Default = 0. * @param {number} [opt_endLatitudeInRadians] Where to end the * bottom of the sphere. Default = Math.PI. * @param {number} [opt_startLongitudeInRadians] where to start * wrapping the sphere. Default = 0. * @param {number} [opt_endLongitudeInRadians] where to end * wrapping the sphere. Default = 2 * Math.PI. * @return {Object.} The created sphere buffers. * @memberOf module:twgl/primitives * @function createSphereBuffers */ /** * Creates sphere vertices. * * The created sphere has position, normal, and texcoord data * * @param {number} radius radius of the sphere. * @param {number} subdivisionsAxis number of steps around the sphere. * @param {number} subdivisionsHeight number of vertically on the sphere. * @param {number} [opt_startLatitudeInRadians] where to start the * top of the sphere. Default = 0. * @param {number} [opt_endLatitudeInRadians] Where to end the * bottom of the sphere. Default = Math.PI. * @param {number} [opt_startLongitudeInRadians] where to start * wrapping the sphere. Default = 0. * @param {number} [opt_endLongitudeInRadians] where to end * wrapping the sphere. Default = 2 * Math.PI. * @return {Object.} The created sphere vertices. * @memberOf module:twgl/primitives */ function createSphereVertices(radius, subdivisionsAxis, subdivisionsHeight, opt_startLatitudeInRadians, opt_endLatitudeInRadians, opt_startLongitudeInRadians, opt_endLongitudeInRadians) { if (subdivisionsAxis <= 0 || subdivisionsHeight <= 0) { throw Error('subdivisionAxis and subdivisionHeight must be > 0'); } opt_startLatitudeInRadians = opt_startLatitudeInRadians || 0; opt_endLatitudeInRadians = opt_endLatitudeInRadians || Math.PI; opt_startLongitudeInRadians = opt_startLongitudeInRadians || 0; opt_endLongitudeInRadians = opt_endLongitudeInRadians || Math.PI * 2; var latRange = opt_endLatitudeInRadians - opt_startLatitudeInRadians; var longRange = opt_endLongitudeInRadians - opt_startLongitudeInRadians; // We are going to generate our sphere by iterating through its // spherical coordinates and generating 2 triangles for each quad on a // ring of the sphere. var numVertices = (subdivisionsAxis + 1) * (subdivisionsHeight + 1); var positions = createAugmentedTypedArray(3, numVertices); var normals = createAugmentedTypedArray(3, numVertices); var texcoords = createAugmentedTypedArray(2, numVertices); // Generate the individual vertices in our vertex buffer. for (var y = 0; y <= subdivisionsHeight; y++) { for (var x = 0; x <= subdivisionsAxis; x++) { // Generate a vertex based on its spherical coordinates var u = x / subdivisionsAxis; var v = y / subdivisionsHeight; var theta = longRange * u; var phi = latRange * v; var sinTheta = Math.sin(theta); var cosTheta = Math.cos(theta); var sinPhi = Math.sin(phi); var cosPhi = Math.cos(phi); var ux = cosTheta * sinPhi; var uy = cosPhi; var uz = sinTheta * sinPhi; positions.push(radius * ux, radius * uy, radius * uz); normals.push(ux, uy, uz); texcoords.push(1 - u, v); } } var numVertsAround = subdivisionsAxis + 1; var indices = createAugmentedTypedArray(3, subdivisionsAxis * subdivisionsHeight * 2, Uint16Array); for (var _x2 = 0; _x2 < subdivisionsAxis; _x2++) { // eslint-disable-line for (var _y = 0; _y < subdivisionsHeight; _y++) { // eslint-disable-line // Make triangle 1 of quad. indices.push((_y + 0) * numVertsAround + _x2, (_y + 0) * numVertsAround + _x2 + 1, (_y + 1) * numVertsAround + _x2); // Make triangle 2 of quad. indices.push((_y + 1) * numVertsAround + _x2, (_y + 0) * numVertsAround + _x2 + 1, (_y + 1) * numVertsAround + _x2 + 1); } } return { position: positions, normal: normals, texcoord: texcoords, indices: indices }; } /** * Array of the indices of corners of each face of a cube. * @type {Array.} */ var CUBE_FACE_INDICES = [[3, 7, 5, 1], // right [6, 2, 0, 4], // left [6, 7, 3, 2], // ?? [0, 1, 5, 4], // ?? [7, 6, 4, 5], // front [2, 3, 1, 0]]; /** * Creates a BufferInfo for a cube. * * The cube is created around the origin. (-size / 2, size / 2). * * @param {WebGLRenderingContext} gl The WebGLRenderingContext. * @param {number} [size] width, height and depth of the cube. * @return {module:twgl.BufferInfo} The created BufferInfo. * @memberOf module:twgl/primitives * @function createCubeBufferInfo */ /** * Creates the buffers and indices for a cube. * * The cube is created around the origin. (-size / 2, size / 2). * * @param {WebGLRenderingContext} gl The WebGLRenderingContext. * @param {number} [size] width, height and depth of the cube. * @return {Object.} The created buffers. * @memberOf module:twgl/primitives * @function createCubeBuffers */ /** * Creates the vertices and indices for a cube. * * The cube is created around the origin. (-size / 2, size / 2). * * @param {number} [size] width, height and depth of the cube. * @return {Object.} The created vertices. * @memberOf module:twgl/primitives */ function createCubeVertices(size) { size = size || 1; var k = size / 2; var cornerVertices = [[-k, -k, -k], [+k, -k, -k], [-k, +k, -k], [+k, +k, -k], [-k, -k, +k], [+k, -k, +k], [-k, +k, +k], [+k, +k, +k]]; var faceNormals = [[+1, +0, +0], [-1, +0, +0], [+0, +1, +0], [+0, -1, +0], [+0, +0, +1], [+0, +0, -1]]; var uvCoords = [[1, 0], [0, 0], [0, 1], [1, 1]]; var numVertices = 6 * 4; var positions = createAugmentedTypedArray(3, numVertices); var normals = createAugmentedTypedArray(3, numVertices); var texcoords = createAugmentedTypedArray(2, numVertices); var indices = createAugmentedTypedArray(3, 6 * 2, Uint16Array); for (var f = 0; f < 6; ++f) { var faceIndices = CUBE_FACE_INDICES[f]; for (var v = 0; v < 4; ++v) { var position = cornerVertices[faceIndices[v]]; var normal = faceNormals[f]; var uv = uvCoords[v]; // Each face needs all four vertices because the normals and texture // coordinates are not all the same. positions.push(position); normals.push(normal); texcoords.push(uv); } // Two triangles make a square face. var offset = 4 * f; indices.push(offset + 0, offset + 1, offset + 2); indices.push(offset + 0, offset + 2, offset + 3); } return { position: positions, normal: normals, texcoord: texcoords, indices: indices }; } /** * Creates a BufferInfo for a truncated cone, which is like a cylinder * except that it has different top and bottom radii. A truncated cone * can also be used to create cylinders and regular cones. The * truncated cone will be created centered about the origin, with the * y axis as its vertical axis. * * @param {WebGLRenderingContext} gl The WebGLRenderingContext. * @param {number} bottomRadius Bottom radius of truncated cone. * @param {number} topRadius Top radius of truncated cone. * @param {number} height Height of truncated cone. * @param {number} radialSubdivisions The number of subdivisions around the * truncated cone. * @param {number} verticalSubdivisions The number of subdivisions down the * truncated cone. * @param {boolean} [opt_topCap] Create top cap. Default = true. * @param {boolean} [opt_bottomCap] Create bottom cap. Default = true. * @return {module:twgl.BufferInfo} The created cone BufferInfo. * @memberOf module:twgl/primitives * @function createTruncatedConeBufferInfo */ /** * Creates buffers for a truncated cone, which is like a cylinder * except that it has different top and bottom radii. A truncated cone * can also be used to create cylinders and regular cones. The * truncated cone will be created centered about the origin, with the * y axis as its vertical axis. * * @param {WebGLRenderingContext} gl The WebGLRenderingContext. * @param {number} bottomRadius Bottom radius of truncated cone. * @param {number} topRadius Top radius of truncated cone. * @param {number} height Height of truncated cone. * @param {number} radialSubdivisions The number of subdivisions around the * truncated cone. * @param {number} verticalSubdivisions The number of subdivisions down the * truncated cone. * @param {boolean} [opt_topCap] Create top cap. Default = true. * @param {boolean} [opt_bottomCap] Create bottom cap. Default = true. * @return {Object.} The created cone buffers. * @memberOf module:twgl/primitives * @function createTruncatedConeBuffers */ /** * Creates vertices for a truncated cone, which is like a cylinder * except that it has different top and bottom radii. A truncated cone * can also be used to create cylinders and regular cones. The * truncated cone will be created centered about the origin, with the * y axis as its vertical axis. . * * @param {number} bottomRadius Bottom radius of truncated cone. * @param {number} topRadius Top radius of truncated cone. * @param {number} height Height of truncated cone. * @param {number} radialSubdivisions The number of subdivisions around the * truncated cone. * @param {number} verticalSubdivisions The number of subdivisions down the * truncated cone. * @param {boolean} [opt_topCap] Create top cap. Default = true. * @param {boolean} [opt_bottomCap] Create bottom cap. Default = true. * @return {Object.} The created cone vertices. * @memberOf module:twgl/primitives */ function createTruncatedConeVertices(bottomRadius, topRadius, height, radialSubdivisions, verticalSubdivisions, opt_topCap, opt_bottomCap) { if (radialSubdivisions < 3) { throw Error('radialSubdivisions must be 3 or greater'); } if (verticalSubdivisions < 1) { throw Error('verticalSubdivisions must be 1 or greater'); } var topCap = opt_topCap === undefined ? true : opt_topCap; var bottomCap = opt_bottomCap === undefined ? true : opt_bottomCap; var extra = (topCap ? 2 : 0) + (bottomCap ? 2 : 0); var numVertices = (radialSubdivisions + 1) * (verticalSubdivisions + 1 + extra); var positions = createAugmentedTypedArray(3, numVertices); var normals = createAugmentedTypedArray(3, numVertices); var texcoords = createAugmentedTypedArray(2, numVertices); var indices = createAugmentedTypedArray(3, radialSubdivisions * (verticalSubdivisions + extra) * 2, Uint16Array); var vertsAroundEdge = radialSubdivisions + 1; // The slant of the cone is constant across its surface var slant = Math.atan2(bottomRadius - topRadius, height); var cosSlant = Math.cos(slant); var sinSlant = Math.sin(slant); var start = topCap ? -2 : 0; var end = verticalSubdivisions + (bottomCap ? 2 : 0); for (var yy = start; yy <= end; ++yy) { var v = yy / verticalSubdivisions; var y = height * v; var ringRadius = void 0; if (yy < 0) { y = 0; v = 1; ringRadius = bottomRadius; } else if (yy > verticalSubdivisions) { y = height; v = 1; ringRadius = topRadius; } else { ringRadius = bottomRadius + (topRadius - bottomRadius) * (yy / verticalSubdivisions); } if (yy === -2 || yy === verticalSubdivisions + 2) { ringRadius = 0; v = 0; } y -= height / 2; for (var ii = 0; ii < vertsAroundEdge; ++ii) { var sin = Math.sin(ii * Math.PI * 2 / radialSubdivisions); var cos = Math.cos(ii * Math.PI * 2 / radialSubdivisions); positions.push(sin * ringRadius, y, cos * ringRadius); normals.push(yy < 0 || yy > verticalSubdivisions ? 0 : sin * cosSlant, yy < 0 ? -1 : yy > verticalSubdivisions ? 1 : sinSlant, yy < 0 || yy > verticalSubdivisions ? 0 : cos * cosSlant); texcoords.push(ii / radialSubdivisions, 1 - v); } } for (var _yy = 0; _yy < verticalSubdivisions + extra; ++_yy) { // eslint-disable-line for (var _ii = 0; _ii < radialSubdivisions; ++_ii) { // eslint-disable-line indices.push(vertsAroundEdge * (_yy + 0) + 0 + _ii, vertsAroundEdge * (_yy + 0) + 1 + _ii, vertsAroundEdge * (_yy + 1) + 1 + _ii); indices.push(vertsAroundEdge * (_yy + 0) + 0 + _ii, vertsAroundEdge * (_yy + 1) + 1 + _ii, vertsAroundEdge * (_yy + 1) + 0 + _ii); } } return { position: positions, normal: normals, texcoord: texcoords, indices: indices }; } /** * Expands RLE data * @param {number[]} rleData data in format of run-length, x, y, z, run-length, x, y, z * @param {number[]} [padding] value to add each entry with. * @return {number[]} the expanded rleData */ function expandRLEData(rleData, padding) { padding = padding || []; var data = []; for (var ii = 0; ii < rleData.length; ii += 4) { var runLength = rleData[ii]; var element = rleData.slice(ii + 1, ii + 4); element.push.apply(element, padding); for (var jj = 0; jj < runLength; ++jj) { data.push.apply(data, element); } } return data; } /** * Creates 3D 'F' BufferInfo. * An 'F' is useful because you can easily tell which way it is oriented. * The created 'F' has position, normal, texcoord, and color buffers. * * @param {WebGLRenderingContext} gl The WebGLRenderingContext. * @return {module:twgl.BufferInfo} The created BufferInfo. * @memberOf module:twgl/primitives * @function create3DFBufferInfo */ /** * Creates 3D 'F' buffers. * An 'F' is useful because you can easily tell which way it is oriented. * The created 'F' has position, normal, texcoord, and color buffers. * * @param {WebGLRenderingContext} gl The WebGLRenderingContext. * @return {Object.} The created buffers. * @memberOf module:twgl/primitives * @function create3DFBuffers */ /** * Creates 3D 'F' vertices. * An 'F' is useful because you can easily tell which way it is oriented. * The created 'F' has position, normal, texcoord, and color arrays. * * @return {Object.} The created vertices. * @memberOf module:twgl/primitives */ function create3DFVertices() { var positions = [// left column front 0, 0, 0, 0, 150, 0, 30, 0, 0, 0, 150, 0, 30, 150, 0, 30, 0, 0, // top rung front 30, 0, 0, 30, 30, 0, 100, 0, 0, 30, 30, 0, 100, 30, 0, 100, 0, 0, // middle rung front 30, 60, 0, 30, 90, 0, 67, 60, 0, 30, 90, 0, 67, 90, 0, 67, 60, 0, // left column back 0, 0, 30, 30, 0, 30, 0, 150, 30, 0, 150, 30, 30, 0, 30, 30, 150, 30, // top rung back 30, 0, 30, 100, 0, 30, 30, 30, 30, 30, 30, 30, 100, 0, 30, 100, 30, 30, // middle rung back 30, 60, 30, 67, 60, 30, 30, 90, 30, 30, 90, 30, 67, 60, 30, 67, 90, 30, // top 0, 0, 0, 100, 0, 0, 100, 0, 30, 0, 0, 0, 100, 0, 30, 0, 0, 30, // top rung front 100, 0, 0, 100, 30, 0, 100, 30, 30, 100, 0, 0, 100, 30, 30, 100, 0, 30, // under top rung 30, 30, 0, 30, 30, 30, 100, 30, 30, 30, 30, 0, 100, 30, 30, 100, 30, 0, // between top rung and middle 30, 30, 0, 30, 60, 30, 30, 30, 30, 30, 30, 0, 30, 60, 0, 30, 60, 30, // top of middle rung 30, 60, 0, 67, 60, 30, 30, 60, 30, 30, 60, 0, 67, 60, 0, 67, 60, 30, // front of middle rung 67, 60, 0, 67, 90, 30, 67, 60, 30, 67, 60, 0, 67, 90, 0, 67, 90, 30, // bottom of middle rung. 30, 90, 0, 30, 90, 30, 67, 90, 30, 30, 90, 0, 67, 90, 30, 67, 90, 0, // front of bottom 30, 90, 0, 30, 150, 30, 30, 90, 30, 30, 90, 0, 30, 150, 0, 30, 150, 30, // bottom 0, 150, 0, 0, 150, 30, 30, 150, 30, 0, 150, 0, 30, 150, 30, 30, 150, 0, // left side 0, 0, 0, 0, 0, 30, 0, 150, 30, 0, 0, 0, 0, 150, 30, 0, 150, 0]; var texcoords = [// left column front 0.22, 0.19, 0.22, 0.79, 0.34, 0.19, 0.22, 0.79, 0.34, 0.79, 0.34, 0.19, // top rung front 0.34, 0.19, 0.34, 0.31, 0.62, 0.19, 0.34, 0.31, 0.62, 0.31, 0.62, 0.19, // middle rung front 0.34, 0.43, 0.34, 0.55, 0.49, 0.43, 0.34, 0.55, 0.49, 0.55, 0.49, 0.43, // left column back 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, // top rung back 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, // middle rung back 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, // top 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, // top rung front 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, // under top rung 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, // between top rung and middle 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, // top of middle rung 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, // front of middle rung 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, // bottom of middle rung. 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, // front of bottom 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, // bottom 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, // left side 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0]; var normals = expandRLEData([// left column front // top rung front // middle rung front 18, 0, 0, 1, // left column back // top rung back // middle rung back 18, 0, 0, -1, // top 6, 0, 1, 0, // top rung front 6, 1, 0, 0, // under top rung 6, 0, -1, 0, // between top rung and middle 6, 1, 0, 0, // top of middle rung 6, 0, 1, 0, // front of middle rung 6, 1, 0, 0, // bottom of middle rung. 6, 0, -1, 0, // front of bottom 6, 1, 0, 0, // bottom 6, 0, -1, 0, // left side 6, -1, 0, 0]); var colors = expandRLEData([// left column front // top rung front // middle rung front 18, 200, 70, 120, // left column back // top rung back // middle rung back 18, 80, 70, 200, // top 6, 70, 200, 210, // top rung front 6, 200, 200, 70, // under top rung 6, 210, 100, 70, // between top rung and middle 6, 210, 160, 70, // top of middle rung 6, 70, 180, 210, // front of middle rung 6, 100, 70, 210, // bottom of middle rung. 6, 76, 210, 100, // front of bottom 6, 140, 210, 80, // bottom 6, 90, 130, 110, // left side 6, 160, 160, 220], [255]); var numVerts = positions.length / 3; var arrays = { position: createAugmentedTypedArray(3, numVerts), texcoord: createAugmentedTypedArray(2, numVerts), normal: createAugmentedTypedArray(3, numVerts), color: createAugmentedTypedArray(4, numVerts, Uint8Array), indices: createAugmentedTypedArray(3, numVerts / 3, Uint16Array) }; arrays.position.push(positions); arrays.texcoord.push(texcoords); arrays.normal.push(normals); arrays.color.push(colors); for (var ii = 0; ii < numVerts; ++ii) { arrays.indices.push(ii); } return arrays; } /** * Creates cresent BufferInfo. * * @param {WebGLRenderingContext} gl The WebGLRenderingContext. * @param {number} verticalRadius The vertical radius of the cresent. * @param {number} outerRadius The outer radius of the cresent. * @param {number} innerRadius The inner radius of the cresent. * @param {number} thickness The thickness of the cresent. * @param {number} subdivisionsDown number of steps around the cresent. * @param {number} subdivisionsThick number of vertically on the cresent. * @param {number} [startOffset] Where to start arc. Default 0. * @param {number} [endOffset] Where to end arg. Default 1. * @return {module:twgl.BufferInfo} The created BufferInfo. * @memberOf module:twgl/primitives * @function createCresentBufferInfo */ /** * Creates cresent buffers. * * @param {WebGLRenderingContext} gl The WebGLRenderingContext. * @param {number} verticalRadius The vertical radius of the cresent. * @param {number} outerRadius The outer radius of the cresent. * @param {number} innerRadius The inner radius of the cresent. * @param {number} thickness The thickness of the cresent. * @param {number} subdivisionsDown number of steps around the cresent. * @param {number} subdivisionsThick number of vertically on the cresent. * @param {number} [startOffset] Where to start arc. Default 0. * @param {number} [endOffset] Where to end arg. Default 1. * @return {Object.} The created buffers. * @memberOf module:twgl/primitives * @function createCresentBuffers */ /** * Creates cresent vertices. * * @param {number} verticalRadius The vertical radius of the cresent. * @param {number} outerRadius The outer radius of the cresent. * @param {number} innerRadius The inner radius of the cresent. * @param {number} thickness The thickness of the cresent. * @param {number} subdivisionsDown number of steps around the cresent. * @param {number} subdivisionsThick number of vertically on the cresent. * @param {number} [startOffset] Where to start arc. Default 0. * @param {number} [endOffset] Where to end arg. Default 1. * @return {Object.} The created vertices. * @memberOf module:twgl/primitives */ function createCresentVertices(verticalRadius, outerRadius, innerRadius, thickness, subdivisionsDown, startOffset, endOffset) { if (subdivisionsDown <= 0) { throw Error('subdivisionDown must be > 0'); } startOffset = startOffset || 0; endOffset = endOffset || 1; var subdivisionsThick = 2; var offsetRange = endOffset - startOffset; var numVertices = (subdivisionsDown + 1) * 2 * (2 + subdivisionsThick); var positions = createAugmentedTypedArray(3, numVertices); var normals = createAugmentedTypedArray(3, numVertices); var texcoords = createAugmentedTypedArray(2, numVertices); function lerp(a, b, s) { return a + (b - a) * s; } function createArc(arcRadius, x, normalMult, normalAdd, uMult, uAdd) { for (var z = 0; z <= subdivisionsDown; z++) { var uBack = x / (subdivisionsThick - 1); var v = z / subdivisionsDown; var xBack = (uBack - 0.5) * 2; var angle = (startOffset + v * offsetRange) * Math.PI; var s = Math.sin(angle); var c = Math.cos(angle); var radius = lerp(verticalRadius, arcRadius, s); var px = xBack * thickness; var py = c * verticalRadius; var pz = s * radius; positions.push(px, py, pz); var n = v3.add(v3.multiply([0, s, c], normalMult), normalAdd); normals.push(n); texcoords.push(uBack * uMult + uAdd, v); } } // Generate the individual vertices in our vertex buffer. for (var x = 0; x < subdivisionsThick; x++) { var uBack = (x / (subdivisionsThick - 1) - 0.5) * 2; createArc(outerRadius, x, [1, 1, 1], [0, 0, 0], 1, 0); createArc(outerRadius, x, [0, 0, 0], [uBack, 0, 0], 0, 0); createArc(innerRadius, x, [1, 1, 1], [0, 0, 0], 1, 0); createArc(innerRadius, x, [0, 0, 0], [uBack, 0, 0], 0, 1); } // Do outer surface. var indices = createAugmentedTypedArray(3, subdivisionsDown * 2 * (2 + subdivisionsThick), Uint16Array); function createSurface(leftArcOffset, rightArcOffset) { for (var z = 0; z < subdivisionsDown; ++z) { // Make triangle 1 of quad. indices.push(leftArcOffset + z + 0, leftArcOffset + z + 1, rightArcOffset + z + 0); // Make triangle 2 of quad. indices.push(leftArcOffset + z + 1, rightArcOffset + z + 1, rightArcOffset + z + 0); } } var numVerticesDown = subdivisionsDown + 1; // front createSurface(numVerticesDown * 0, numVerticesDown * 4); // right createSurface(numVerticesDown * 5, numVerticesDown * 7); // back createSurface(numVerticesDown * 6, numVerticesDown * 2); // left createSurface(numVerticesDown * 3, numVerticesDown * 1); return { position: positions, normal: normals, texcoord: texcoords, indices: indices }; } /** * Creates cylinder BufferInfo. The cylinder will be created around the origin * along the y-axis. * * @param {WebGLRenderingContext} gl The WebGLRenderingContext. * @param {number} radius Radius of cylinder. * @param {number} height Height of cylinder. * @param {number} radialSubdivisions The number of subdivisions around the cylinder. * @param {number} verticalSubdivisions The number of subdivisions down the cylinder. * @param {boolean} [topCap] Create top cap. Default = true. * @param {boolean} [bottomCap] Create bottom cap. Default = true. * @return {module:twgl.BufferInfo} The created BufferInfo. * @memberOf module:twgl/primitives * @function createCylinderBufferInfo */ /** * Creates cylinder buffers. The cylinder will be created around the origin * along the y-axis. * * @param {WebGLRenderingContext} gl The WebGLRenderingContext. * @param {number} radius Radius of cylinder. * @param {number} height Height of cylinder. * @param {number} radialSubdivisions The number of subdivisions around the cylinder. * @param {number} verticalSubdivisions The number of subdivisions down the cylinder. * @param {boolean} [topCap] Create top cap. Default = true. * @param {boolean} [bottomCap] Create bottom cap. Default = true. * @return {Object.} The created buffers. * @memberOf module:twgl/primitives * @function createCylinderBuffers */ /** * Creates cylinder vertices. The cylinder will be created around the origin * along the y-axis. * * @param {number} radius Radius of cylinder. * @param {number} height Height of cylinder. * @param {number} radialSubdivisions The number of subdivisions around the cylinder. * @param {number} verticalSubdivisions The number of subdivisions down the cylinder. * @param {boolean} [topCap] Create top cap. Default = true. * @param {boolean} [bottomCap] Create bottom cap. Default = true. * @return {Object.} The created vertices. * @memberOf module:twgl/primitives */ function createCylinderVertices(radius, height, radialSubdivisions, verticalSubdivisions, topCap, bottomCap) { return createTruncatedConeVertices(radius, radius, height, radialSubdivisions, verticalSubdivisions, topCap, bottomCap); } /** * Creates BufferInfo for a torus * * @param {WebGLRenderingContext} gl The WebGLRenderingContext. * @param {number} radius radius of center of torus circle. * @param {number} thickness radius of torus ring. * @param {number} radialSubdivisions The number of subdivisions around the torus. * @param {number} bodySubdivisions The number of subdivisions around the body torus. * @param {boolean} [startAngle] start angle in radians. Default = 0. * @param {boolean} [endAngle] end angle in radians. Default = Math.PI * 2. * @return {module:twgl.BufferInfo} The created BufferInfo. * @memberOf module:twgl/primitives * @function createTorusBufferInfo */ /** * Creates buffers for a torus * * @param {WebGLRenderingContext} gl The WebGLRenderingContext. * @param {number} radius radius of center of torus circle. * @param {number} thickness radius of torus ring. * @param {number} radialSubdivisions The number of subdivisions around the torus. * @param {number} bodySubdivisions The number of subdivisions around the body torus. * @param {boolean} [startAngle] start angle in radians. Default = 0. * @param {boolean} [endAngle] end angle in radians. Default = Math.PI * 2. * @return {Object.} The created buffers. * @memberOf module:twgl/primitives * @function createTorusBuffers */ /** * Creates vertices for a torus * * @param {number} radius radius of center of torus circle. * @param {number} thickness radius of torus ring. * @param {number} radialSubdivisions The number of subdivisions around the torus. * @param {number} bodySubdivisions The number of subdivisions around the body torus. * @param {boolean} [startAngle] start angle in radians. Default = 0. * @param {boolean} [endAngle] end angle in radians. Default = Math.PI * 2. * @return {Object.} The created vertices. * @memberOf module:twgl/primitives */ function createTorusVertices(radius, thickness, radialSubdivisions, bodySubdivisions, startAngle, endAngle) { if (radialSubdivisions < 3) { throw Error('radialSubdivisions must be 3 or greater'); } if (bodySubdivisions < 3) { throw Error('verticalSubdivisions must be 3 or greater'); } startAngle = startAngle || 0; endAngle = endAngle || Math.PI * 2; var range = endAngle - startAngle; var radialParts = radialSubdivisions + 1; var bodyParts = bodySubdivisions + 1; var numVertices = radialParts * bodyParts; var positions = createAugmentedTypedArray(3, numVertices); var normals = createAugmentedTypedArray(3, numVertices); var texcoords = createAugmentedTypedArray(2, numVertices); var indices = createAugmentedTypedArray(3, radialSubdivisions * bodySubdivisions * 2, Uint16Array); for (var slice = 0; slice < bodyParts; ++slice) { var v = slice / bodySubdivisions; var sliceAngle = v * Math.PI * 2; var sliceSin = Math.sin(sliceAngle); var ringRadius = radius + sliceSin * thickness; var ny = Math.cos(sliceAngle); var y = ny * thickness; for (var ring = 0; ring < radialParts; ++ring) { var u = ring / radialSubdivisions; var ringAngle = startAngle + u * range; var xSin = Math.sin(ringAngle); var zCos = Math.cos(ringAngle); var x = xSin * ringRadius; var z = zCos * ringRadius; var nx = xSin * sliceSin; var nz = zCos * sliceSin; positions.push(x, y, z); normals.push(nx, ny, nz); texcoords.push(u, 1 - v); } } for (var _slice = 0; _slice < bodySubdivisions; ++_slice) { // eslint-disable-line for (var _ring = 0; _ring < radialSubdivisions; ++_ring) { // eslint-disable-line var nextRingIndex = 1 + _ring; var nextSliceIndex = 1 + _slice; indices.push(radialParts * _slice + _ring, radialParts * nextSliceIndex + _ring, radialParts * _slice + nextRingIndex); indices.push(radialParts * nextSliceIndex + _ring, radialParts * nextSliceIndex + nextRingIndex, radialParts * _slice + nextRingIndex); } } return { position: positions, normal: normals, texcoord: texcoords, indices: indices }; } /** * Creates a disc BufferInfo. The disc will be in the xz plane, centered at * the origin. When creating, at least 3 divisions, or pie * pieces, need to be specified, otherwise the triangles making * up the disc will be degenerate. You can also specify the * number of radial pieces `stacks`. A value of 1 for * stacks will give you a simple disc of pie pieces. If you * want to create an annulus you can set `innerRadius` to a * value > 0. Finally, `stackPower` allows you to have the widths * increase or decrease as you move away from the center. This * is particularly useful when using the disc as a ground plane * with a fixed camera such that you don't need the resolution * of small triangles near the perimeter. For example, a value * of 2 will produce stacks whose ouside radius increases with * the square of the stack index. A value of 1 will give uniform * stacks. * * @param {WebGLRenderingContext} gl The WebGLRenderingContext. * @param {number} radius Radius of the ground plane. * @param {number} divisions Number of triangles in the ground plane (at least 3). * @param {number} [stacks] Number of radial divisions (default=1). * @param {number} [innerRadius] Default 0. * @param {number} [stackPower] Power to raise stack size to for decreasing width. * @return {module:twgl.BufferInfo} The created BufferInfo. * @memberOf module:twgl/primitives * @function createDiscBufferInfo */ /** * Creates disc buffers. The disc will be in the xz plane, centered at * the origin. When creating, at least 3 divisions, or pie * pieces, need to be specified, otherwise the triangles making * up the disc will be degenerate. You can also specify the * number of radial pieces `stacks`. A value of 1 for * stacks will give you a simple disc of pie pieces. If you * want to create an annulus you can set `innerRadius` to a * value > 0. Finally, `stackPower` allows you to have the widths * increase or decrease as you move away from the center. This * is particularly useful when using the disc as a ground plane * with a fixed camera such that you don't need the resolution * of small triangles near the perimeter. For example, a value * of 2 will produce stacks whose ouside radius increases with * the square of the stack index. A value of 1 will give uniform * stacks. * * @param {WebGLRenderingContext} gl The WebGLRenderingContext. * @param {number} radius Radius of the ground plane. * @param {number} divisions Number of triangles in the ground plane (at least 3). * @param {number} [stacks] Number of radial divisions (default=1). * @param {number} [innerRadius] Default 0. * @param {number} [stackPower] Power to raise stack size to for decreasing width. * @return {Object.} The created buffers. * @memberOf module:twgl/primitives * @function createDiscBuffers */ /** * Creates disc vertices. The disc will be in the xz plane, centered at * the origin. When creating, at least 3 divisions, or pie * pieces, need to be specified, otherwise the triangles making * up the disc will be degenerate. You can also specify the * number of radial pieces `stacks`. A value of 1 for * stacks will give you a simple disc of pie pieces. If you * want to create an annulus you can set `innerRadius` to a * value > 0. Finally, `stackPower` allows you to have the widths * increase or decrease as you move away from the center. This * is particularly useful when using the disc as a ground plane * with a fixed camera such that you don't need the resolution * of small triangles near the perimeter. For example, a value * of 2 will produce stacks whose ouside radius increases with * the square of the stack index. A value of 1 will give uniform * stacks. * * @param {number} radius Radius of the ground plane. * @param {number} divisions Number of triangles in the ground plane (at least 3). * @param {number} [stacks] Number of radial divisions (default=1). * @param {number} [innerRadius] Default 0. * @param {number} [stackPower] Power to raise stack size to for decreasing width. * @return {Object.} The created vertices. * @memberOf module:twgl/primitives */ function createDiscVertices(radius, divisions, stacks, innerRadius, stackPower) { if (divisions < 3) { throw Error('divisions must be at least 3'); } stacks = stacks ? stacks : 1; stackPower = stackPower ? stackPower : 1; innerRadius = innerRadius ? innerRadius : 0; // Note: We don't share the center vertex because that would // mess up texture coordinates. var numVertices = (divisions + 1) * (stacks + 1); var positions = createAugmentedTypedArray(3, numVertices); var normals = createAugmentedTypedArray(3, numVertices); var texcoords = createAugmentedTypedArray(2, numVertices); var indices = createAugmentedTypedArray(3, stacks * divisions * 2, Uint16Array); var firstIndex = 0; var radiusSpan = radius - innerRadius; var pointsPerStack = divisions + 1; // Build the disk one stack at a time. for (var stack = 0; stack <= stacks; ++stack) { var stackRadius = innerRadius + radiusSpan * Math.pow(stack / stacks, stackPower); for (var i = 0; i <= divisions; ++i) { var theta = 2.0 * Math.PI * i / divisions; var x = stackRadius * Math.cos(theta); var z = stackRadius * Math.sin(theta); positions.push(x, 0, z); normals.push(0, 1, 0); texcoords.push(1 - i / divisions, stack / stacks); if (stack > 0 && i !== divisions) { // a, b, c and d are the indices of the vertices of a quad. unless // the current stack is the one closest to the center, in which case // the vertices a and b connect to the center vertex. var a = firstIndex + (i + 1); var b = firstIndex + i; var c = firstIndex + i - pointsPerStack; var d = firstIndex + (i + 1) - pointsPerStack; // Make a quad of the vertices a, b, c, d. indices.push(a, b, c); indices.push(a, c, d); } } firstIndex += divisions + 1; } return { position: positions, normal: normals, texcoord: texcoords, indices: indices }; } /** * creates a random integer between 0 and range - 1 inclusive. * @param {number} range * @return {number} random value between 0 and range - 1 inclusive. */ function randInt(range) { return Math.random() * range | 0; } /** * Used to supply random colors * @callback RandomColorFunc * @param {number} ndx index of triangle/quad if unindexed or index of vertex if indexed * @param {number} channel 0 = red, 1 = green, 2 = blue, 3 = alpha * @return {number} a number from 0 to 255 * @memberOf module:twgl/primitives */ /** * @typedef {Object} RandomVerticesOptions * @property {number} [vertsPerColor] Defaults to 3 for non-indexed vertices * @property {module:twgl/primitives.RandomColorFunc} [rand] A function to generate random numbers * @memberOf module:twgl/primitives */ /** * Creates an augmentedTypedArray of random vertex colors. * If the vertices are indexed (have an indices array) then will * just make random colors. Otherwise assumes they are triangles * and makes one random color for every 3 vertices. * @param {Object.} vertices Vertices as returned from one of the createXXXVertices functions. * @param {module:twgl/primitives.RandomVerticesOptions} [options] options. * @return {Object.} same vertices as passed in with `color` added. * @memberOf module:twgl/primitives */ function makeRandomVertexColors(vertices, options) { options = options || {}; var numElements = vertices.position.numElements; var vcolors = createAugmentedTypedArray(4, numElements, Uint8Array); var rand = options.rand || function (ndx, channel) { return channel < 3 ? randInt(256) : 255; }; vertices.color = vcolors; if (vertices.indices) { // just make random colors if index for (var ii = 0; ii < numElements; ++ii) { vcolors.push(rand(ii, 0), rand(ii, 1), rand(ii, 2), rand(ii, 3)); } } else { // make random colors per triangle var numVertsPerColor = options.vertsPerColor || 3; var numSets = numElements / numVertsPerColor; for (var _ii2 = 0; _ii2 < numSets; ++_ii2) { // eslint-disable-line var color = [rand(_ii2, 0), rand(_ii2, 1), rand(_ii2, 2), rand(_ii2, 3)]; for (var jj = 0; jj < numVertsPerColor; ++jj) { vcolors.push(color); } } } return vertices; } /** * creates a function that calls fn to create vertices and then * creates a buffers for them */ function createBufferFunc(fn) { return function (gl) { var arrays = fn.apply(this, Array.prototype.slice.call(arguments, 1)); return attributes.createBuffersFromArrays(gl, arrays); }; } /** * creates a function that calls fn to create vertices and then * creates a bufferInfo object for them */ function createBufferInfoFunc(fn) { return function (gl) { var arrays = fn.apply(null, Array.prototype.slice.call(arguments, 1)); return attributes.createBufferInfoFromArrays(gl, arrays); }; } var arraySpecPropertyNames = ["numComponents", "size", "type", "normalize", "stride", "offset", "attrib", "name", "attribName"]; /** * Copy elements from one array to another * * @param {Array|TypedArray} src source array * @param {Array|TypedArray} dst dest array * @param {number} dstNdx index in dest to copy src * @param {number} [offset] offset to add to copied values */ function copyElements(src, dst, dstNdx, offset) { offset = offset || 0; var length = src.length; for (var ii = 0; ii < length; ++ii) { dst[dstNdx + ii] = src[ii] + offset; } } /** * Creates an array of the same time * * @param {(number[]|ArrayBufferView|module:twgl.FullArraySpec)} srcArray array who's type to copy * @param {number} length size of new array * @return {(number[]|ArrayBufferView|module:twgl.FullArraySpec)} array with same type as srcArray */ function createArrayOfSameType(srcArray, length) { var arraySrc = getArray(srcArray); var newArray = new arraySrc.constructor(length); var newArraySpec = newArray; // If it appears to have been augmented make new one augemented if (arraySrc.numComponents && arraySrc.numElements) { augmentTypedArray(newArray, arraySrc.numComponents); } // If it was a fullspec make new one a fullspec if (srcArray.data) { newArraySpec = { data: newArray }; helper.copyNamedProperties(arraySpecPropertyNames, srcArray, newArraySpec); } return newArraySpec; } /** * Concatinates sets of vertices * * Assumes the vertices match in composition. For example * if one set of vertices has positions, normals, and indices * all sets of vertices must have positions, normals, and indices * and of the same type. * * Example: * * const cubeVertices = twgl.primtiives.createCubeVertices(2); * const sphereVertices = twgl.primitives.createSphereVertices(1, 10, 10); * // move the sphere 2 units up * twgl.primitives.reorientVertices( * sphereVertices, twgl.m4.translation([0, 2, 0])); * // merge the sphere with the cube * const cubeSphereVertices = twgl.primitives.concatVertices( * [cubeVertices, sphereVertices]); * // turn them into WebGL buffers and attrib data * const bufferInfo = twgl.createBufferInfoFromArrays(gl, cubeSphereVertices); * * @param {module:twgl.Arrays[]} arrays Array of arrays of vertices * @return {module:twgl.Arrays} The concatinated vertices. * @memberOf module:twgl/primitives */ function concatVertices(arrayOfArrays) { var names = {}; var baseName; // get names of all arrays. // and numElements for each set of vertices var _loop = function _loop(ii) { var arrays = arrayOfArrays[ii]; Object.keys(arrays).forEach(function (name) { // eslint-disable-line if (!names[name]) { names[name] = []; } if (!baseName && name !== 'indices') { baseName = name; } var arrayInfo = arrays[name]; var numComponents = getNumComponents(arrayInfo, name); var array = getArray(arrayInfo); var numElements = array.length / numComponents; names[name].push(numElements); }); }; for (var ii = 0; ii < arrayOfArrays.length; ++ii) { _loop(ii); } // compute length of combined array // and return one for reference function getLengthOfCombinedArrays(name) { var length = 0; var arraySpec; for (var ii = 0; ii < arrayOfArrays.length; ++ii) { var arrays = arrayOfArrays[ii]; var arrayInfo = arrays[name]; var array = getArray(arrayInfo); length += array.length; if (!arraySpec || arrayInfo.data) { arraySpec = arrayInfo; } } return { length: length, spec: arraySpec }; } function copyArraysToNewArray(name, base, newArray) { var baseIndex = 0; var offset = 0; for (var ii = 0; ii < arrayOfArrays.length; ++ii) { var arrays = arrayOfArrays[ii]; var arrayInfo = arrays[name]; var array = getArray(arrayInfo); if (name === 'indices') { copyElements(array, newArray, offset, baseIndex); baseIndex += base[ii]; } else { copyElements(array, newArray, offset); } offset += array.length; } } var base = names[baseName]; var newArrays = {}; Object.keys(names).forEach(function (name) { var info = getLengthOfCombinedArrays(name); var newArraySpec = createArrayOfSameType(info.spec, info.length); copyArraysToNewArray(name, base, getArray(newArraySpec)); newArrays[name] = newArraySpec; }); return newArrays; } /** * Creates a duplicate set of vertices * * This is useful for calling reorientVertices when you * also want to keep the original available * * @param {module:twgl.Arrays} arrays of vertices * @return {module:twgl.Arrays} The dupilicated vertices. * @memberOf module:twgl/primitives */ function duplicateVertices(arrays) { var newArrays = {}; Object.keys(arrays).forEach(function (name) { var arraySpec = arrays[name]; var srcArray = getArray(arraySpec); var newArraySpec = createArrayOfSameType(arraySpec, srcArray.length); copyElements(srcArray, getArray(newArraySpec), 0); newArrays[name] = newArraySpec; }); return newArrays; } var create3DFBufferInfo = createBufferInfoFunc(create3DFVertices); exports.create3DFBufferInfo = create3DFBufferInfo; var create3DFBuffers = createBufferFunc(create3DFVertices); exports.create3DFBuffers = create3DFBuffers; var createCubeBufferInfo = createBufferInfoFunc(createCubeVertices); exports.createCubeBufferInfo = createCubeBufferInfo; var createCubeBuffers = createBufferFunc(createCubeVertices); exports.createCubeBuffers = createCubeBuffers; var createPlaneBufferInfo = createBufferInfoFunc(createPlaneVertices); exports.createPlaneBufferInfo = createPlaneBufferInfo; var createPlaneBuffers = createBufferFunc(createPlaneVertices); exports.createPlaneBuffers = createPlaneBuffers; var createSphereBufferInfo = createBufferInfoFunc(createSphereVertices); exports.createSphereBufferInfo = createSphereBufferInfo; var createSphereBuffers = createBufferFunc(createSphereVertices); exports.createSphereBuffers = createSphereBuffers; var createTruncatedConeBufferInfo = createBufferInfoFunc(createTruncatedConeVertices); exports.createTruncatedConeBufferInfo = createTruncatedConeBufferInfo; var createTruncatedConeBuffers = createBufferFunc(createTruncatedConeVertices); exports.createTruncatedConeBuffers = createTruncatedConeBuffers; var createXYQuadBufferInfo = createBufferInfoFunc(createXYQuadVertices); exports.createXYQuadBufferInfo = createXYQuadBufferInfo; var createXYQuadBuffers = createBufferFunc(createXYQuadVertices); exports.createXYQuadBuffers = createXYQuadBuffers; var createCresentBufferInfo = createBufferInfoFunc(createCresentVertices); exports.createCresentBufferInfo = createCresentBufferInfo; var createCresentBuffers = createBufferFunc(createCresentVertices); exports.createCresentBuffers = createCresentBuffers; var createCylinderBufferInfo = createBufferInfoFunc(createCylinderVertices); exports.createCylinderBufferInfo = createCylinderBufferInfo; var createCylinderBuffers = createBufferFunc(createCylinderVertices); exports.createCylinderBuffers = createCylinderBuffers; var createTorusBufferInfo = createBufferInfoFunc(createTorusVertices); exports.createTorusBufferInfo = createTorusBufferInfo; var createTorusBuffers = createBufferFunc(createTorusVertices); exports.createTorusBuffers = createTorusBuffers; var createDiscBufferInfo = createBufferInfoFunc(createDiscVertices); exports.createDiscBufferInfo = createDiscBufferInfo; var createDiscBuffers = createBufferFunc(createDiscVertices); exports.createDiscBuffers = createDiscBuffers; /***/ }), /* 11 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var _exportNames = { addExtensionsToContext: true, getContext: true, getWebGLContext: true, resizeCanvasToDisplaySize: true, setDefaults: true }; exports.addExtensionsToContext = addExtensionsToContext; exports.getContext = getContext; exports.getWebGLContext = getWebGLContext; exports.resizeCanvasToDisplaySize = resizeCanvasToDisplaySize; exports.setDefaults = setDefaults; var attributes = _interopRequireWildcard(__webpack_require__(7)); Object.keys(attributes).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; exports[key] = attributes[key]; }); var textures = _interopRequireWildcard(__webpack_require__(8)); Object.keys(textures).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; exports[key] = textures[key]; }); var helper = _interopRequireWildcard(__webpack_require__(0)); var utils = _interopRequireWildcard(__webpack_require__(4)); Object.keys(utils).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; exports[key] = utils[key]; }); var _draw = __webpack_require__(12); Object.keys(_draw).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; exports[key] = _draw[key]; }); var _framebuffers = __webpack_require__(13); Object.keys(_framebuffers).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; exports[key] = _framebuffers[key]; }); var _programs = __webpack_require__(5); Object.keys(_programs).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; exports[key] = _programs[key]; }); var _typedarrays = __webpack_require__(1); Object.keys(_typedarrays).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; exports[key] = _typedarrays[key]; }); var _vertexArrays = __webpack_require__(14); Object.keys(_vertexArrays).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; exports[key] = _vertexArrays[key]; }); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } /* * Copyright 2015, Gregg Tavares. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Gregg Tavares. nor the names of his * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * The main TWGL module. * * For most use cases you shouldn't need anything outside this module. * Exceptions between the stuff added to twgl-full (v3, m4, primitives) * * @module twgl * @borrows module:twgl/attributes.setAttribInfoBufferFromArray as setAttribInfoBufferFromArray * @borrows module:twgl/attributes.createBufferInfoFromArrays as createBufferInfoFromArrays * @borrows module:twgl/attributes.createVertexArrayInfo as createVertexArrayInfo * @borrows module:twgl/draw.drawBufferInfo as drawBufferInfo * @borrows module:twgl/draw.drawObjectList as drawObjectList * @borrows module:twgl/framebuffers.createFramebufferInfo as createFramebufferInfo * @borrows module:twgl/framebuffers.resizeFramebufferInfo as resizeFramebufferInfo * @borrows module:twgl/framebuffers.bindFramebufferInfo as bindFramebufferInfo * @borrows module:twgl/programs.createProgramInfo as createProgramInfo * @borrows module:twgl/programs.createUniformBlockInfo as createUniformBlockInfo * @borrows module:twgl/programs.bindUniformBlock as bindUniformBlock * @borrows module:twgl/programs.setUniformBlock as setUniformBlock * @borrows module:twgl/programs.setBlockUniforms as setBlockUniforms * @borrows module:twgl/programs.setUniforms as setUniforms * @borrows module:twgl/programs.setBuffersAndAttributes as setBuffersAndAttributes * @borrows module:twgl/textures.setTextureFromArray as setTextureFromArray * @borrows module:twgl/textures.createTexture as createTexture * @borrows module:twgl/textures.resizeTexture as resizeTexture * @borrows module:twgl/textures.createTextures as createTextures */ // make sure we don't see a global gl var gl = undefined; // eslint-disable-line var defaults = { addExtensionsToContext: true }; /** * Various default settings for twgl. * * Note: You can call this any number of times. Example: * * twgl.setDefaults({ textureColor: [1, 0, 0, 1] }); * twgl.setDefaults({ attribPrefix: 'a_' }); * * is equivalent to * * twgl.setDefaults({ * textureColor: [1, 0, 0, 1], * attribPrefix: 'a_', * }); * * @typedef {Object} Defaults * @property {string} attribPrefix The prefix to stick on attributes * * When writing shaders I prefer to name attributes with `a_`, uniforms with `u_` and varyings with `v_` * as it makes it clear where they came from. But, when building geometry I prefer using unprefixed names. * * In otherwords I'll create arrays of geometry like this * * const arrays = { * position: ... * normal: ... * texcoord: ... * }; * * But need those mapped to attributes and my attributes start with `a_`. * * Default: `""` * * @property {number[]} textureColor Array of 4 values in the range 0 to 1 * * The default texture color is used when loading textures from * urls. Because the URL will be loaded async we'd like to be * able to use the texture immediately. By putting a 1x1 pixel * color in the texture we can start using the texture before * the URL has loaded. * * Default: `[0.5, 0.75, 1, 1]` * * @property {string} crossOrigin * * If not undefined sets the crossOrigin attribute on images * that twgl creates when downloading images for textures. * * Also see {@link module:twgl.TextureOptions}. * * @property {bool} addExtensionsToContext * * If true, then, when twgl will try to add any supported WebGL extensions * directly to the context under their normal GL names. For example * if ANGLE_instances_arrays exists then twgl would enable it, * add the functions `vertexAttribDivisor`, `drawArraysInstanced`, * `drawElementsInstanced`, and the constant `VERTEX_ATTRIB_ARRAY_DIVISOR` * to the `WebGLRenderingContext`. * * @memberOf module:twgl */ /** * Sets various defaults for twgl. * * In the interest of terseness which is kind of the point * of twgl I've integrated a few of the older functions here * * @param {module:twgl.Defaults} newDefaults The default settings. * @memberOf module:twgl */ function setDefaults(newDefaults) { helper.copyExistingProperties(newDefaults, defaults); attributes.setAttributeDefaults_(newDefaults); // eslint-disable-line textures.setTextureDefaults_(newDefaults); // eslint-disable-line } var prefixRE = /^(.*?)_/; function addExtensionToContext(gl, extensionName) { utils.glEnumToString(gl, 0); var ext = gl.getExtension(extensionName); if (ext) { var enums = {}; var fnSuffix = prefixRE.exec(extensionName)[1]; var enumSuffix = '_' + fnSuffix; for (var key in ext) { var value = ext[key]; var isFunc = typeof value === 'function'; var suffix = isFunc ? fnSuffix : enumSuffix; var name = key; // examples of where this is not true are WEBGL_compressed_texture_s3tc // and WEBGL_compressed_texture_pvrtc if (key.endsWith(suffix)) { name = key.substring(0, key.length - suffix.length); } if (gl[name] !== undefined) { if (!isFunc && gl[name] !== value) { helper.warn(name, gl[name], value, key); } } else { if (isFunc) { gl[name] = function (origFn) { return function () { return origFn.apply(ext, arguments); }; }(value); } else { gl[name] = value; enums[name] = value; } } } // pass the modified enums to glEnumToString enums.constructor = { name: ext.constructor.name }; utils.glEnumToString(enums, 0); } return ext; } /* * If you're wondering why the code doesn't just iterate * over all extensions using `gl.getExtensions` is that it's possible * some future extension is incompatible with this code. Rather than * have thing suddenly break it seems better to manually add to this * list. * */ var supportedExtensions = ['ANGLE_instanced_arrays', 'EXT_blend_minmax', 'EXT_color_buffer_float', 'EXT_color_buffer_half_float', 'EXT_disjoint_timer_query', 'EXT_disjoint_timer_query_webgl2', 'EXT_frag_depth', 'EXT_sRGB', 'EXT_shader_texture_lod', 'EXT_texture_filter_anisotropic', 'OES_element_index_uint', 'OES_standard_derivatives', 'OES_texture_float', 'OES_texture_float_linear', 'OES_texture_half_float', 'OES_texture_half_float_linear', 'OES_vertex_array_object', 'WEBGL_color_buffer_float', 'WEBGL_compressed_texture_atc', 'WEBGL_compressed_texture_etc1', 'WEBGL_compressed_texture_pvrtc', 'WEBGL_compressed_texture_s3tc', 'WEBGL_compressed_texture_s3tc_srgb', 'WEBGL_depth_texture', 'WEBGL_draw_buffers']; /** * Attempts to enable all of the following extensions * and add their functions and constants to the * `WebGLRenderingContext` using their normal non-extension like names. * * ANGLE_instanced_arrays * EXT_blend_minmax * EXT_color_buffer_float * EXT_color_buffer_half_float * EXT_disjoint_timer_query * EXT_disjoint_timer_query_webgl2 * EXT_frag_depth * EXT_sRGB * EXT_shader_texture_lod * EXT_texture_filter_anisotropic * OES_element_index_uint * OES_standard_derivatives * OES_texture_float * OES_texture_float_linear * OES_texture_half_float * OES_texture_half_float_linear * OES_vertex_array_object * WEBGL_color_buffer_float * WEBGL_compressed_texture_atc * WEBGL_compressed_texture_etc1 * WEBGL_compressed_texture_pvrtc * WEBGL_compressed_texture_s3tc * WEBGL_compressed_texture_s3tc_srgb * WEBGL_depth_texture * WEBGL_draw_buffers * * For example if `ANGLE_instanced_arrays` exists then the functions * `drawArraysInstanced`, `drawElementsInstanced`, `vertexAttribDivisor` * and the constant `VERTEX_ATTRIB_ARRAY_DIVISOR` are added to the * `WebGLRenderingContext`. * * Note that if you want to know if the extension exists you should * probably call `gl.getExtension` for each extension. Alternatively * you can check for the existance of the functions or constants that * are expected to be added. For example * * if (gl.drawBuffers) { * // Either WEBGL_draw_buffers was enabled OR you're running in WebGL2 * .... * * @param {WebGLRenderingContext} gl A WebGLRenderingContext * @memberOf module:twgl */ function addExtensionsToContext(gl) { for (var ii = 0; ii < supportedExtensions.length; ++ii) { addExtensionToContext(gl, supportedExtensions[ii]); } } /** * Creates a webgl context. * @param {HTMLCanvasElement} canvas The canvas tag to get * context from. If one is not passed in one will be * created. * @return {WebGLRenderingContext} The created context. */ function create3DContext(canvas, opt_attribs) { var names = ["webgl", "experimental-webgl"]; var context = null; for (var ii = 0; ii < names.length; ++ii) { context = canvas.getContext(names[ii], opt_attribs); if (context) { if (defaults.addExtensionsToContext) { addExtensionsToContext(context); } break; } } return context; } /** * Gets a WebGL1 context. * * Note: Will attempt to enable Vertex Array Objects * and add WebGL2 entry points. (unless you first set defaults with * `twgl.setDefaults({enableVertexArrayObjects: false})`; * * @param {HTMLCanvasElement} canvas a canvas element. * @param {WebGLContextCreationAttirbutes} [opt_attribs] optional webgl context creation attributes * @memberOf module:twgl */ function getWebGLContext(canvas, opt_attribs) { var gl = create3DContext(canvas, opt_attribs); return gl; } /** * Creates a webgl context. * * Will return a WebGL2 context if possible. * * You can check if it's WebGL2 with * * twgl.isWebGL2(gl); * * @param {HTMLCanvasElement} canvas The canvas tag to get * context from. If one is not passed in one will be * created. * @return {WebGLRenderingContext} The created context. */ function createContext(canvas, opt_attribs) { var names = ["webgl2", "webgl", "experimental-webgl"]; var context = null; for (var ii = 0; ii < names.length; ++ii) { context = canvas.getContext(names[ii], opt_attribs); if (context) { if (defaults.addExtensionsToContext) { addExtensionsToContext(context); } break; } } return context; } /** * Gets a WebGL context. Will create a WebGL2 context if possible. * * You can check if it's WebGL2 with * * function isWebGL2(gl) { * return gl.getParameter(gl.VERSION).indexOf("WebGL 2.0 ") == 0; * } * * Note: For a WebGL1 context will attempt to enable Vertex Array Objects * and add WebGL2 entry points. (unless you first set defaults with * `twgl.setDefaults({enableVertexArrayObjects: false})`; * * @param {HTMLCanvasElement} canvas a canvas element. * @param {WebGLContextCreationAttirbutes} [opt_attribs] optional webgl context creation attributes * @return {WebGLRenderingContext} The created context. * @memberOf module:twgl */ function getContext(canvas, opt_attribs) { var gl = createContext(canvas, opt_attribs); return gl; } /** * Resize a canvas to match the size it's displayed. * @param {HTMLCanvasElement} canvas The canvas to resize. * @param {number} [multiplier] So you can pass in `window.devicePixelRatio` or other scale value if you want to. * @return {boolean} true if the canvas was resized. * @memberOf module:twgl */ function resizeCanvasToDisplaySize(canvas, multiplier) { multiplier = multiplier || 1; multiplier = Math.max(0, multiplier); var width = canvas.clientWidth * multiplier | 0; var height = canvas.clientHeight * multiplier | 0; if (canvas.width !== width || canvas.height !== height) { canvas.width = width; canvas.height = height; return true; } return false; } /***/ }), /* 12 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.drawBufferInfo = drawBufferInfo; exports.drawObjectList = drawObjectList; var programs = _interopRequireWildcard(__webpack_require__(5)); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } /* * Copyright 2015, Gregg Tavares. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Gregg Tavares. nor the names of his * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * Drawing related functions * * For backward compatibily they are available at both `twgl.draw` and `twgl` * itself * * See {@link module:twgl} for core functions * * @module twgl/draw */ /** * Calls `gl.drawElements` or `gl.drawArrays`, whichever is appropriate * * normally you'd call `gl.drawElements` or `gl.drawArrays` yourself * but calling this means if you switch from indexed data to non-indexed * data you don't have to remember to update your draw call. * * @param {WebGLRenderingContext} gl A WebGLRenderingContext * @param {(module:twgl.BufferInfo|module:twgl.VertexArrayInfo)} bufferInfo A BufferInfo as returned from {@link module:twgl.createBufferInfoFromArrays} or * a VertexArrayInfo as returned from {@link module:twgl.createVertexArrayInfo} * @param {enum} [type] eg (gl.TRIANGLES, gl.LINES, gl.POINTS, gl.TRIANGLE_STRIP, ...). Defaults to `gl.TRIANGLES` * @param {number} [count] An optional count. Defaults to bufferInfo.numElements * @param {number} [offset] An optional offset. Defaults to 0. * @param {number} [instanceCount] An optional instanceCount. if set then `drawArraysInstanced` or `drawElementsInstanced` will be called * @memberOf module:twgl/draw */ function drawBufferInfo(gl, bufferInfo, type, count, offset, instanceCount) { type = type === undefined ? gl.TRIANGLES : type; var indices = bufferInfo.indices; var elementType = bufferInfo.elementType; var numElements = count === undefined ? bufferInfo.numElements : count; offset = offset === undefined ? 0 : offset; if (elementType || indices) { if (instanceCount !== undefined) { gl.drawElementsInstanced(type, numElements, elementType === undefined ? gl.UNSIGNED_SHORT : bufferInfo.elementType, offset, instanceCount); } else { gl.drawElements(type, numElements, elementType === undefined ? gl.UNSIGNED_SHORT : bufferInfo.elementType, offset); } } else { if (instanceCount !== undefined) { gl.drawArraysInstanced(type, offset, numElements, instanceCount); } else { gl.drawArrays(type, offset, numElements); } } } /** * A DrawObject is useful for putting objects in to an array and passing them to {@link module:twgl.drawObjectList}. * * You need either a `BufferInfo` or a `VertexArrayInfo`. * * @typedef {Object} DrawObject * @property {boolean} [active] whether or not to draw. Default = `true` (must be `false` to be not true). In otherwords `undefined` = `true` * @property {number} [type] type to draw eg. `gl.TRIANGLES`, `gl.LINES`, etc... * @property {module:twgl.ProgramInfo} programInfo A ProgramInfo as returned from {@link module:twgl.createProgramInfo} * @property {module:twgl.BufferInfo} [bufferInfo] A BufferInfo as returned from {@link module:twgl.createBufferInfoFromArrays} * @property {module:twgl.VertexArrayInfo} [vertexArrayInfo] A VertexArrayInfo as returned from {@link module:twgl.createVertexArrayInfo} * @property {Object} uniforms The values for the uniforms. * You can pass multiple objects by putting them in an array. For example * * var sharedUniforms = { * u_fogNear: 10, * u_projection: ... * ... * }; * * var localUniforms = { * u_world: ... * u_diffuseColor: ... * }; * * var drawObj = { * ... * uniforms: [sharedUniforms, localUniforms], * }; * * @property {number} [offset] the offset to pass to `gl.drawArrays` or `gl.drawElements`. Defaults to 0. * @property {number} [count] the count to pass to `gl.drawArrays` or `gl.drawElemnts`. Defaults to bufferInfo.numElements. * @property {number} [instanceCount] the number of instances. Defaults to undefined. * @memberOf module:twgl */ /** * Draws a list of objects * @param {DrawObject[]} objectsToDraw an array of objects to draw. * @memberOf module:twgl/draw */ function drawObjectList(gl, objectsToDraw) { var lastUsedProgramInfo = null; var lastUsedBufferInfo = null; objectsToDraw.forEach(function (object) { if (object.active === false) { return; } var programInfo = object.programInfo; var bufferInfo = object.vertexArrayInfo || object.bufferInfo; var bindBuffers = false; var type = object.type === undefined ? gl.TRIANGLES : object.type; if (programInfo !== lastUsedProgramInfo) { lastUsedProgramInfo = programInfo; gl.useProgram(programInfo.program); // We have to rebind buffers when changing programs because we // only bind buffers the program uses. So if 2 programs use the same // bufferInfo but the 1st one uses only positions the when the // we switch to the 2nd one some of the attributes will not be on. bindBuffers = true; } // Setup all the needed attributes. if (bindBuffers || bufferInfo !== lastUsedBufferInfo) { if (lastUsedBufferInfo && lastUsedBufferInfo.vertexArrayObject && !bufferInfo.vertexArrayObject) { gl.bindVertexArray(null); } lastUsedBufferInfo = bufferInfo; programs.setBuffersAndAttributes(gl, programInfo, bufferInfo); } // Set the uniforms. programs.setUniforms(programInfo, object.uniforms); // Draw drawBufferInfo(gl, bufferInfo, type, object.count, object.offset, object.instanceCount); }); if (lastUsedBufferInfo.vertexArrayObject) { gl.bindVertexArray(null); } } /***/ }), /* 13 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.bindFramebufferInfo = bindFramebufferInfo; exports.createFramebufferInfo = createFramebufferInfo; exports.resizeFramebufferInfo = resizeFramebufferInfo; var textures = _interopRequireWildcard(__webpack_require__(8)); var helper = _interopRequireWildcard(__webpack_require__(0)); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } /* * Copyright 2015, Gregg Tavares. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Gregg Tavares. nor the names of his * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * Framebuffer related functions * * For backward compatibily they are available at both `twgl.framebuffer` and `twgl` * itself * * See {@link module:twgl} for core functions * * @module twgl/framebuffers */ // make sure we don't see a global gl var gl = undefined; // eslint-disable-line var UNSIGNED_BYTE = 0x1401; /* PixelFormat */ var DEPTH_COMPONENT = 0x1902; var RGBA = 0x1908; /* Framebuffer Object. */ var RGBA4 = 0x8056; var RGB5_A1 = 0x8057; var RGB565 = 0x8D62; var DEPTH_COMPONENT16 = 0x81A5; var STENCIL_INDEX = 0x1901; var STENCIL_INDEX8 = 0x8D48; var DEPTH_STENCIL = 0x84F9; var COLOR_ATTACHMENT0 = 0x8CE0; var DEPTH_ATTACHMENT = 0x8D00; var STENCIL_ATTACHMENT = 0x8D20; var DEPTH_STENCIL_ATTACHMENT = 0x821A; /* TextureWrapMode */ var REPEAT = 0x2901; // eslint-disable-line var CLAMP_TO_EDGE = 0x812F; var MIRRORED_REPEAT = 0x8370; // eslint-disable-line /* TextureMagFilter */ var NEAREST = 0x2600; // eslint-disable-line var LINEAR = 0x2601; /* TextureMinFilter */ var NEAREST_MIPMAP_NEAREST = 0x2700; // eslint-disable-line var LINEAR_MIPMAP_NEAREST = 0x2701; // eslint-disable-line var NEAREST_MIPMAP_LINEAR = 0x2702; // eslint-disable-line var LINEAR_MIPMAP_LINEAR = 0x2703; // eslint-disable-line /** * The options for a framebuffer attachment. * * Note: For a `format` that is a texture include all the texture * options from {@link module:twgl.TextureOptions} for example * `min`, `mag`, `clamp`, etc... Note that unlike {@link module:twgl.TextureOptions} * `auto` defaults to `false` for attachment textures but `min` and `mag` default * to `gl.LINEAR` and `wrap` defaults to `CLAMP_TO_EDGE` * * @typedef {Object} AttachmentOptions * @property {number} [attach] The attachment point. Defaults * to `gl.COLOR_ATTACTMENT0 + ndx` unless type is a depth or stencil type * then it's gl.DEPTH_ATTACHMENT or `gl.DEPTH_STENCIL_ATTACHMENT` depending * on the format or attachment type. * @property {number} [format] The format. If one of `gl.RGBA4`, * `gl.RGB565`, `gl.RGB5_A1`, `gl.DEPTH_COMPONENT16`, * `gl.STENCIL_INDEX8` or `gl.DEPTH_STENCIL` then will create a * renderbuffer. Otherwise will create a texture. Default = `gl.RGBA` * @property {number} [type] The type. Used for texture. Default = `gl.UNSIGNED_BYTE`. * @property {number} [target] The texture target for `gl.framebufferTexture2D`. * Defaults to `gl.TEXTURE_2D`. Set to appropriate face for cube maps. * @property {number} [level] level for `gl.framebufferTexture2D`. Defaults to 0. * @property {WebGLObject} [attachment] An existing renderbuffer or texture. * If provided will attach this Object. This allows you to share * attachemnts across framebuffers. * @memberOf module:twgl */ var defaultAttachments = [{ format: RGBA, type: UNSIGNED_BYTE, min: LINEAR, wrap: CLAMP_TO_EDGE }, { format: DEPTH_STENCIL }]; var attachmentsByFormat = {}; attachmentsByFormat[DEPTH_STENCIL] = DEPTH_STENCIL_ATTACHMENT; attachmentsByFormat[STENCIL_INDEX] = STENCIL_ATTACHMENT; attachmentsByFormat[STENCIL_INDEX8] = STENCIL_ATTACHMENT; attachmentsByFormat[DEPTH_COMPONENT] = DEPTH_ATTACHMENT; attachmentsByFormat[DEPTH_COMPONENT16] = DEPTH_ATTACHMENT; function getAttachmentPointForFormat(format) { return attachmentsByFormat[format]; } var renderbufferFormats = {}; renderbufferFormats[RGBA4] = true; renderbufferFormats[RGB5_A1] = true; renderbufferFormats[RGB565] = true; renderbufferFormats[DEPTH_STENCIL] = true; renderbufferFormats[DEPTH_COMPONENT16] = true; renderbufferFormats[STENCIL_INDEX] = true; renderbufferFormats[STENCIL_INDEX8] = true; function isRenderbufferFormat(format) { return renderbufferFormats[format]; } /** * @typedef {Object} FramebufferInfo * @property {WebGLFramebuffer} framebuffer The WebGLFramebuffer for this framebufferInfo * @property {WebGLObject[]} attachments The created attachments in the same order as passed in to {@link module:twgl.createFramebufferInfo}. * @memberOf module:twgl */ /** * Creates a framebuffer and attachments. * * This returns a {@link module:twgl.FramebufferInfo} because it needs to return the attachments as well as the framebuffer. * * The simplest usage * * // create an RGBA/UNSIGNED_BYTE texture and DEPTH_STENCIL renderbuffer * const fbi = twgl.createFramebufferInfo(gl); * * More complex usage * * // create an RGB565 renderbuffer and a STENCIL_INDEX8 renderbuffer * const attachments = [ * { format: RGB565, mag: NEAREST }, * { format: STENCIL_INDEX8 }, * ] * const fbi = twgl.createFramebufferInfo(gl, attachments); * * Passing in a specific size * * const width = 256; * const height = 256; * const fbi = twgl.createFramebufferInfo(gl, attachments, width, height); * * **Note!!** It is up to you to check if the framebuffer is renderable by calling `gl.checkFramebufferStatus`. * [WebGL only guarantees 3 combinations of attachments work](https://www.khronos.org/registry/webgl/specs/latest/1.0/#6.6). * * @param {WebGLRenderingContext} gl the WebGLRenderingContext * @param {module:twgl.AttachmentOptions[]} [attachments] which attachments to create. If not provided the default is a framebuffer with an * `RGBA`, `UNSIGNED_BYTE` texture `COLOR_ATTACHMENT0` and a `DEPTH_STENCIL` renderbuffer `DEPTH_STENCIL_ATTACHMENT`. * @param {number} [width] the width for the attachments. Default = size of drawingBuffer * @param {number} [height] the height for the attachments. Defautt = size of drawingBuffer * @return {module:twgl.FramebufferInfo} the framebuffer and attachments. * @memberOf module:twgl/framebuffers */ function createFramebufferInfo(gl, attachments, width, height) { var target = gl.FRAMEBUFFER; var fb = gl.createFramebuffer(); gl.bindFramebuffer(target, fb); width = width || gl.drawingBufferWidth; height = height || gl.drawingBufferHeight; attachments = attachments || defaultAttachments; var colorAttachmentCount = 0; var framebufferInfo = { framebuffer: fb, attachments: [], width: width, height: height }; attachments.forEach(function (attachmentOptions) { var attachment = attachmentOptions.attachment; var format = attachmentOptions.format; var attachmentPoint = getAttachmentPointForFormat(format); if (!attachmentPoint) { attachmentPoint = COLOR_ATTACHMENT0 + colorAttachmentCount++; } if (!attachment) { if (isRenderbufferFormat(format)) { attachment = gl.createRenderbuffer(); gl.bindRenderbuffer(gl.RENDERBUFFER, attachment); gl.renderbufferStorage(gl.RENDERBUFFER, format, width, height); } else { var textureOptions = Object.assign({}, attachmentOptions); textureOptions.width = width; textureOptions.height = height; if (textureOptions.auto === undefined) { textureOptions.auto = false; textureOptions.min = textureOptions.min || textureOptions.minMag || gl.LINEAR; textureOptions.mag = textureOptions.mag || textureOptions.minMag || gl.LINEAR; textureOptions.wrapS = textureOptions.wrapS || textureOptions.wrap || gl.CLAMP_TO_EDGE; textureOptions.wrapT = textureOptions.wrapT || textureOptions.wrap || gl.CLAMP_TO_EDGE; } attachment = textures.createTexture(gl, textureOptions); } } if (helper.isRenderbuffer(gl, attachment)) { gl.framebufferRenderbuffer(target, attachmentPoint, gl.RENDERBUFFER, attachment); } else if (helper.isTexture(gl, attachment)) { gl.framebufferTexture2D(target, attachmentPoint, attachmentOptions.texTarget || gl.TEXTURE_2D, attachment, attachmentOptions.level || 0); } else { throw "unknown attachment type"; } framebufferInfo.attachments.push(attachment); }); return framebufferInfo; } /** * Resizes the attachments of a framebuffer. * * You need to pass in the same `attachments` as you passed in {@link module:twgl.createFramebufferInfo} * because TWGL has no idea the format/type of each attachment. * * The simplest usage * * // create an RGBA/UNSIGNED_BYTE texture and DEPTH_STENCIL renderbuffer * const fbi = twgl.createFramebufferInfo(gl); * * ... * * function render() { * if (twgl.resizeCanvasToDisplaySize(gl.canvas)) { * // resize the attachments * twgl.resizeFramebufferInfo(gl, fbi); * } * * More complex usage * * // create an RGB565 renderbuffer and a STENCIL_INDEX8 renderbuffer * const attachments = [ * { format: RGB565, mag: NEAREST }, * { format: STENCIL_INDEX8 }, * ] * const fbi = twgl.createFramebufferInfo(gl, attachments); * * ... * * function render() { * if (twgl.resizeCanvasToDisplaySize(gl.canvas)) { * // resize the attachments to match * twgl.resizeFramebufferInfo(gl, fbi, attachments); * } * * @param {WebGLRenderingContext} gl the WebGLRenderingContext * @param {module:twgl.FramebufferInfo} framebufferInfo a framebufferInfo as returned from {@link module:twgl.createFramebufferInfo}. * @param {module:twgl.AttachmentOptions[]} [attachments] the same attachments options as passed to {@link module:twgl.createFramebufferInfo}. * @param {number} [width] the width for the attachments. Default = size of drawingBuffer * @param {number} [height] the height for the attachments. Defautt = size of drawingBuffer * @memberOf module:twgl/framebuffers */ function resizeFramebufferInfo(gl, framebufferInfo, attachments, width, height) { width = width || gl.drawingBufferWidth; height = height || gl.drawingBufferHeight; framebufferInfo.width = width; framebufferInfo.height = height; attachments = attachments || defaultAttachments; attachments.forEach(function (attachmentOptions, ndx) { var attachment = framebufferInfo.attachments[ndx]; var format = attachmentOptions.format; if (helper.isRenderbuffer(gl, attachment)) { gl.bindRenderbuffer(gl.RENDERBUFFER, attachment); gl.renderbufferStorage(gl.RENDERBUFFER, format, width, height); } else if (helper.isTexture(gl, attachment)) { textures.resizeTexture(gl, attachment, attachmentOptions, width, height); } else { throw "unknown attachment type"; } }); } /** * Binds a framebuffer * * This function pretty much soley exists because I spent hours * trying to figure out why something I wrote wasn't working only * to realize I forget to set the viewport dimensions. * My hope is this function will fix that. * * It is effectively the same as * * gl.bindFramebuffer(gl.FRAMEBUFFER, someFramebufferInfo.framebuffer); * gl.viewport(0, 0, someFramebufferInfo.width, someFramebufferInfo.height); * * @param {WebGLRenderingContext} gl the WebGLRenderingContext * @param {module:twgl.FramebufferInfo} [framebufferInfo] a framebufferInfo as returned from {@link module:twgl.createFramebufferInfo}. * If not passed will bind the canvas. * @param {number} [target] The target. If not passed `gl.FRAMEBUFFER` will be used. * @memberOf module:twgl/framebuffers */ function bindFramebufferInfo(gl, framebufferInfo, target) { target = target || gl.FRAMEBUFFER; if (framebufferInfo) { gl.bindFramebuffer(target, framebufferInfo.framebuffer); gl.viewport(0, 0, framebufferInfo.width, framebufferInfo.height); } else { gl.bindFramebuffer(target, null); gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); } } /***/ }), /* 14 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.createVertexArrayInfo = createVertexArrayInfo; exports.createVAOAndSetAttributes = createVAOAndSetAttributes; exports.createVAOFromBufferInfo = createVAOFromBufferInfo; var programs = _interopRequireWildcard(__webpack_require__(5)); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } /* * Copyright 2015, Gregg Tavares. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Gregg Tavares. nor the names of his * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * vertex array object related functions * * You should generally not need to use these functions. They are provided * for those cases where you're doing something out of the ordinary * and you need lower level access. * * For backward compatibily they are available at both `twgl.attributes` and `twgl` * itself * * See {@link module:twgl} for core functions * * @module twgl/vertexArrays */ /** * @typedef {Object} VertexArrayInfo * @property {number} numElements The number of elements to pass to `gl.drawArrays` or `gl.drawElements`. * @property {number} [elementType] The type of indices `UNSIGNED_BYTE`, `UNSIGNED_SHORT` etc.. * @property {WebGLVertexArrayObject} [vertexArrayObject] a vertex array object * @memberOf module:twgl */ /** * Creates a VertexArrayInfo from a BufferInfo and one or more ProgramInfos * * This can be passed to {@link module:twgl.setBuffersAndAttributes} and to * {@link module:twgl:drawBufferInfo}. * * > **IMPORTANT:** Vertex Array Objects are **not** a direct analog for a BufferInfo. Vertex Array Objects * assign buffers to specific attributes at creation time. That means they can only be used with programs * who's attributes use the same attribute locations for the same purposes. * * > Bind your attribute locations by passing an array of attribute names to {@link module:twgl.createProgramInfo} * or use WebGL 2's GLSL ES 3's `layout(location = )` to make sure locations match. * * also * * > **IMPORTANT:** After calling twgl.setBuffersAndAttribute with a BufferInfo that uses a Vertex Array Object * that Vertex Array Object will be bound. That means **ANY MANIPULATION OF ELEMENT_ARRAY_BUFFER or ATTRIBUTES** * will affect the Vertex Array Object state. * * > Call `gl.bindVertexArray(null)` to get back manipulating the global attributes and ELEMENT_ARRAY_BUFFER. * * @param {WebGLRenderingContext} gl A WebGLRenderingContext * @param {module:twgl.ProgramInfo|module:twgl.ProgramInfo[]} programInfo a programInfo or array of programInfos * @param {module:twgl.BufferInfo} bufferInfo BufferInfo as returned from createBufferInfoFromArrays etc... * * You need to make sure every attribute that will be used is bound. So for example assume shader 1 * uses attributes A, B, C and shader 2 uses attributes A, B, D. If you only pass in the programInfo * for shader 1 then only attributes A, B, and C will have their attributes set because TWGL doesn't * now attribute D's location. * * So, you can pass in both shader 1 and shader 2's programInfo * * @return {module:twgl.VertexArrayInfo} The created VertexArrayInfo * * @memberOf module:twgl/vertexArrays */ function createVertexArrayInfo(gl, programInfos, bufferInfo) { var vao = gl.createVertexArray(); gl.bindVertexArray(vao); if (!programInfos.length) { programInfos = [programInfos]; } programInfos.forEach(function (programInfo) { programs.setBuffersAndAttributes(gl, programInfo, bufferInfo); }); gl.bindVertexArray(null); return { numElements: bufferInfo.numElements, elementType: bufferInfo.elementType, vertexArrayObject: vao }; } /** * Creates a vertex array object and then sets the attributes on it * * @param {WebGLRenderingContext} gl The WebGLRenderingContext to use. * @param {Object.} setters Attribute setters as returned from createAttributeSetters * @param {Object.} attribs AttribInfos mapped by attribute name. * @param {WebGLBuffer} [indices] an optional ELEMENT_ARRAY_BUFFER of indices * @memberOf module:twgl/vertexArrays */ function createVAOAndSetAttributes(gl, setters, attribs, indices) { var vao = gl.createVertexArray(); gl.bindVertexArray(vao); programs.setAttributes(setters, attribs); if (indices) { gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indices); } // We unbind this because otherwise any change to ELEMENT_ARRAY_BUFFER // like when creating buffers for other stuff will mess up this VAO's binding gl.bindVertexArray(null); return vao; } /** * Creates a vertex array object and then sets the attributes * on it * * @param {WebGLRenderingContext} gl The WebGLRenderingContext * to use. * @param {Object.| module:twgl.ProgramInfo} programInfo as returned from createProgramInfo or Attribute setters as returned from createAttributeSetters * @param {module:twgl.BufferInfo} bufferInfo BufferInfo as returned from createBufferInfoFromArrays etc... * @param {WebGLBuffer} [indices] an optional ELEMENT_ARRAY_BUFFER of indices * @memberOf module:twgl/vertexArrays */ function createVAOFromBufferInfo(gl, programInfo, bufferInfo) { return createVAOAndSetAttributes(gl, programInfo.attribSetters || programInfo, bufferInfo.attribs, bufferInfo.indices); } /***/ }) /******/ ]); }); /***/ }), /***/ "./node_modules/unicode-trie/index.js": /*!********************************************!*\ !*** ./node_modules/unicode-trie/index.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { // Generated by CoffeeScript 1.7.1 var UnicodeTrie, inflate; inflate = __webpack_require__(/*! tiny-inflate */ "./node_modules/tiny-inflate/index.js"); UnicodeTrie = (function() { var DATA_BLOCK_LENGTH, DATA_GRANULARITY, DATA_MASK, INDEX_1_OFFSET, INDEX_2_BLOCK_LENGTH, INDEX_2_BMP_LENGTH, INDEX_2_MASK, INDEX_SHIFT, LSCP_INDEX_2_LENGTH, LSCP_INDEX_2_OFFSET, OMITTED_BMP_INDEX_1_LENGTH, SHIFT_1, SHIFT_1_2, SHIFT_2, UTF8_2B_INDEX_2_LENGTH, UTF8_2B_INDEX_2_OFFSET; SHIFT_1 = 6 + 5; SHIFT_2 = 5; SHIFT_1_2 = SHIFT_1 - SHIFT_2; OMITTED_BMP_INDEX_1_LENGTH = 0x10000 >> SHIFT_1; INDEX_2_BLOCK_LENGTH = 1 << SHIFT_1_2; INDEX_2_MASK = INDEX_2_BLOCK_LENGTH - 1; INDEX_SHIFT = 2; DATA_BLOCK_LENGTH = 1 << SHIFT_2; DATA_MASK = DATA_BLOCK_LENGTH - 1; LSCP_INDEX_2_OFFSET = 0x10000 >> SHIFT_2; LSCP_INDEX_2_LENGTH = 0x400 >> SHIFT_2; INDEX_2_BMP_LENGTH = LSCP_INDEX_2_OFFSET + LSCP_INDEX_2_LENGTH; UTF8_2B_INDEX_2_OFFSET = INDEX_2_BMP_LENGTH; UTF8_2B_INDEX_2_LENGTH = 0x800 >> 6; INDEX_1_OFFSET = UTF8_2B_INDEX_2_OFFSET + UTF8_2B_INDEX_2_LENGTH; DATA_GRANULARITY = 1 << INDEX_SHIFT; function UnicodeTrie(data) { var isBuffer, uncompressedLength, view; isBuffer = typeof data.readUInt32BE === 'function' && typeof data.slice === 'function'; if (isBuffer || data instanceof Uint8Array) { if (isBuffer) { this.highStart = data.readUInt32BE(0); this.errorValue = data.readUInt32BE(4); uncompressedLength = data.readUInt32BE(8); data = data.slice(12); } else { view = new DataView(data.buffer); this.highStart = view.getUint32(0); this.errorValue = view.getUint32(4); uncompressedLength = view.getUint32(8); data = data.subarray(12); } data = inflate(data, new Uint8Array(uncompressedLength)); data = inflate(data, new Uint8Array(uncompressedLength)); this.data = new Uint32Array(data.buffer); } else { this.data = data.data, this.highStart = data.highStart, this.errorValue = data.errorValue; } } UnicodeTrie.prototype.get = function(codePoint) { var index; if (codePoint < 0 || codePoint > 0x10ffff) { return this.errorValue; } if (codePoint < 0xd800 || (codePoint > 0xdbff && codePoint <= 0xffff)) { index = (this.data[codePoint >> SHIFT_2] << INDEX_SHIFT) + (codePoint & DATA_MASK); return this.data[index]; } if (codePoint <= 0xffff) { index = (this.data[LSCP_INDEX_2_OFFSET + ((codePoint - 0xd800) >> SHIFT_2)] << INDEX_SHIFT) + (codePoint & DATA_MASK); return this.data[index]; } if (codePoint < this.highStart) { index = this.data[(INDEX_1_OFFSET - OMITTED_BMP_INDEX_1_LENGTH) + (codePoint >> SHIFT_1)]; index = this.data[index + ((codePoint >> SHIFT_2) & INDEX_2_MASK)]; index = (index << INDEX_SHIFT) + (codePoint & DATA_MASK); return this.data[index]; } return this.data[this.data.length - DATA_GRANULARITY]; }; return UnicodeTrie; })(); module.exports = UnicodeTrie; /***/ }), /***/ "./node_modules/url/url.js": /*!*********************************!*\ !*** ./node_modules/url/url.js ***! \*********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. var punycode = __webpack_require__(/*! punycode */ "./node_modules/node-libs-browser/node_modules/punycode/punycode.js"); var util = __webpack_require__(/*! ./util */ "./node_modules/url/util.js"); exports.parse = urlParse; exports.resolve = urlResolve; exports.resolveObject = urlResolveObject; exports.format = urlFormat; exports.Url = Url; function Url() { this.protocol = null; this.slashes = null; this.auth = null; this.host = null; this.port = null; this.hostname = null; this.hash = null; this.search = null; this.query = null; this.pathname = null; this.path = null; this.href = null; } // Reference: RFC 3986, RFC 1808, RFC 2396 // define these here so at least they only have to be // compiled once on the first module load. var protocolPattern = /^([a-z0-9.+-]+:)/i, portPattern = /:[0-9]*$/, // Special case for a simple path URL simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, // RFC 2396: characters reserved for delimiting URLs. // We actually just auto-escape these. delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'], // RFC 2396: characters not allowed for various reasons. unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims), // Allowed by RFCs, but cause of XSS attacks. Always escape these. autoEscape = ['\''].concat(unwise), // Characters that are never ever allowed in a hostname. // Note that any invalid chars are also handled, but these // are the ones that are *expected* to be seen, so we fast-path // them. nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape), hostEndingChars = ['/', '?', '#'], hostnameMaxLen = 255, hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, // protocols that can allow "unsafe" and "unwise" chars. unsafeProtocol = { 'javascript': true, 'javascript:': true }, // protocols that never have a hostname. hostlessProtocol = { 'javascript': true, 'javascript:': true }, // protocols that always contain a // bit. slashedProtocol = { 'http': true, 'https': true, 'ftp': true, 'gopher': true, 'file': true, 'http:': true, 'https:': true, 'ftp:': true, 'gopher:': true, 'file:': true }, querystring = __webpack_require__(/*! querystring */ "./node_modules/querystring-es3/index.js"); function urlParse(url, parseQueryString, slashesDenoteHost) { if (url && util.isObject(url) && url instanceof Url) return url; var u = new Url; u.parse(url, parseQueryString, slashesDenoteHost); return u; } Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { if (!util.isString(url)) { throw new TypeError("Parameter 'url' must be a string, not " + typeof url); } // Copy chrome, IE, opera backslash-handling behavior. // Back slashes before the query string get converted to forward slashes // See: https://code.google.com/p/chromium/issues/detail?id=25916 var queryIndex = url.indexOf('?'), splitter = (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#', uSplit = url.split(splitter), slashRegex = /\\/g; uSplit[0] = uSplit[0].replace(slashRegex, '/'); url = uSplit.join(splitter); var rest = url; // trim before proceeding. // This is to support parse stuff like " http://foo.com \n" rest = rest.trim(); if (!slashesDenoteHost && url.split('#').length === 1) { // Try fast path regexp var simplePath = simplePathPattern.exec(rest); if (simplePath) { this.path = rest; this.href = rest; this.pathname = simplePath[1]; if (simplePath[2]) { this.search = simplePath[2]; if (parseQueryString) { this.query = querystring.parse(this.search.substr(1)); } else { this.query = this.search.substr(1); } } else if (parseQueryString) { this.search = ''; this.query = {}; } return this; } } var proto = protocolPattern.exec(rest); if (proto) { proto = proto[0]; var lowerProto = proto.toLowerCase(); this.protocol = lowerProto; rest = rest.substr(proto.length); } // figure out if it's got a host // user@server is *always* interpreted as a hostname, and url // resolution will treat //foo/bar as host=foo,path=bar because that's // how the browser resolves relative URLs. if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { var slashes = rest.substr(0, 2) === '//'; if (slashes && !(proto && hostlessProtocol[proto])) { rest = rest.substr(2); this.slashes = true; } } if (!hostlessProtocol[proto] && (slashes || (proto && !slashedProtocol[proto]))) { // there's a hostname. // the first instance of /, ?, ;, or # ends the host. // // If there is an @ in the hostname, then non-host chars *are* allowed // to the left of the last @ sign, unless some host-ending character // comes *before* the @-sign. // URLs are obnoxious. // // ex: // http://a@b@c/ => user:a@b host:c // http://a@b?@c => user:a host:c path:/?@c // v0.12 TODO(isaacs): This is not quite how Chrome does things. // Review our test case against browsers more comprehensively. // find the first instance of any hostEndingChars var hostEnd = -1; for (var i = 0; i < hostEndingChars.length; i++) { var hec = rest.indexOf(hostEndingChars[i]); if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) hostEnd = hec; } // at this point, either we have an explicit point where the // auth portion cannot go past, or the last @ char is the decider. var auth, atSign; if (hostEnd === -1) { // atSign can be anywhere. atSign = rest.lastIndexOf('@'); } else { // atSign must be in auth portion. // http://a@b/c@d => host:b auth:a path:/c@d atSign = rest.lastIndexOf('@', hostEnd); } // Now we have a portion which is definitely the auth. // Pull that off. if (atSign !== -1) { auth = rest.slice(0, atSign); rest = rest.slice(atSign + 1); this.auth = decodeURIComponent(auth); } // the host is the remaining to the left of the first non-host char hostEnd = -1; for (var i = 0; i < nonHostChars.length; i++) { var hec = rest.indexOf(nonHostChars[i]); if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) hostEnd = hec; } // if we still have not hit it, then the entire thing is a host. if (hostEnd === -1) hostEnd = rest.length; this.host = rest.slice(0, hostEnd); rest = rest.slice(hostEnd); // pull out port. this.parseHost(); // we've indicated that there is a hostname, // so even if it's empty, it has to be present. this.hostname = this.hostname || ''; // if hostname begins with [ and ends with ] // assume that it's an IPv6 address. var ipv6Hostname = this.hostname[0] === '[' && this.hostname[this.hostname.length - 1] === ']'; // validate a little. if (!ipv6Hostname) { var hostparts = this.hostname.split(/\./); for (var i = 0, l = hostparts.length; i < l; i++) { var part = hostparts[i]; if (!part) continue; if (!part.match(hostnamePartPattern)) { var newpart = ''; for (var j = 0, k = part.length; j < k; j++) { if (part.charCodeAt(j) > 127) { // we replace non-ASCII char with a temporary placeholder // we need this to make sure size of hostname is not // broken by replacing non-ASCII by nothing newpart += 'x'; } else { newpart += part[j]; } } // we test again with ASCII char only if (!newpart.match(hostnamePartPattern)) { var validParts = hostparts.slice(0, i); var notHost = hostparts.slice(i + 1); var bit = part.match(hostnamePartStart); if (bit) { validParts.push(bit[1]); notHost.unshift(bit[2]); } if (notHost.length) { rest = '/' + notHost.join('.') + rest; } this.hostname = validParts.join('.'); break; } } } } if (this.hostname.length > hostnameMaxLen) { this.hostname = ''; } else { // hostnames are always lower case. this.hostname = this.hostname.toLowerCase(); } if (!ipv6Hostname) { // IDNA Support: Returns a punycoded representation of "domain". // It only converts parts of the domain name that // have non-ASCII characters, i.e. it doesn't matter if // you call it with a domain that already is ASCII-only. this.hostname = punycode.toASCII(this.hostname); } var p = this.port ? ':' + this.port : ''; var h = this.hostname || ''; this.host = h + p; this.href += this.host; // strip [ and ] from the hostname // the host field still retains them, though if (ipv6Hostname) { this.hostname = this.hostname.substr(1, this.hostname.length - 2); if (rest[0] !== '/') { rest = '/' + rest; } } } // now rest is set to the post-host stuff. // chop off any delim chars. if (!unsafeProtocol[lowerProto]) { // First, make 100% sure that any "autoEscape" chars get // escaped, even if encodeURIComponent doesn't think they // need to be. for (var i = 0, l = autoEscape.length; i < l; i++) { var ae = autoEscape[i]; if (rest.indexOf(ae) === -1) continue; var esc = encodeURIComponent(ae); if (esc === ae) { esc = escape(ae); } rest = rest.split(ae).join(esc); } } // chop off from the tail first. var hash = rest.indexOf('#'); if (hash !== -1) { // got a fragment string. this.hash = rest.substr(hash); rest = rest.slice(0, hash); } var qm = rest.indexOf('?'); if (qm !== -1) { this.search = rest.substr(qm); this.query = rest.substr(qm + 1); if (parseQueryString) { this.query = querystring.parse(this.query); } rest = rest.slice(0, qm); } else if (parseQueryString) { // no query string, but parseQueryString still requested this.search = ''; this.query = {}; } if (rest) this.pathname = rest; if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) { this.pathname = '/'; } //to support http.request if (this.pathname || this.search) { var p = this.pathname || ''; var s = this.search || ''; this.path = p + s; } // finally, reconstruct the href based on what has been validated. this.href = this.format(); return this; }; // format a parsed object into a url string function urlFormat(obj) { // ensure it's an object, and not a string url. // If it's an obj, this is a no-op. // this way, you can call url_format() on strings // to clean up potentially wonky urls. if (util.isString(obj)) obj = urlParse(obj); if (!(obj instanceof Url)) return Url.prototype.format.call(obj); return obj.format(); } Url.prototype.format = function() { var auth = this.auth || ''; if (auth) { auth = encodeURIComponent(auth); auth = auth.replace(/%3A/i, ':'); auth += '@'; } var protocol = this.protocol || '', pathname = this.pathname || '', hash = this.hash || '', host = false, query = ''; if (this.host) { host = auth + this.host; } else if (this.hostname) { host = auth + (this.hostname.indexOf(':') === -1 ? this.hostname : '[' + this.hostname + ']'); if (this.port) { host += ':' + this.port; } } if (this.query && util.isObject(this.query) && Object.keys(this.query).length) { query = querystring.stringify(this.query); } var search = this.search || (query && ('?' + query)) || ''; if (protocol && protocol.substr(-1) !== ':') protocol += ':'; // only the slashedProtocols get the //. Not mailto:, xmpp:, etc. // unless they had them to begin with. if (this.slashes || (!protocol || slashedProtocol[protocol]) && host !== false) { host = '//' + (host || ''); if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname; } else if (!host) { host = ''; } if (hash && hash.charAt(0) !== '#') hash = '#' + hash; if (search && search.charAt(0) !== '?') search = '?' + search; pathname = pathname.replace(/[?#]/g, function(match) { return encodeURIComponent(match); }); search = search.replace('#', '%23'); return protocol + host + pathname + search + hash; }; function urlResolve(source, relative) { return urlParse(source, false, true).resolve(relative); } Url.prototype.resolve = function(relative) { return this.resolveObject(urlParse(relative, false, true)).format(); }; function urlResolveObject(source, relative) { if (!source) return relative; return urlParse(source, false, true).resolveObject(relative); } Url.prototype.resolveObject = function(relative) { if (util.isString(relative)) { var rel = new Url(); rel.parse(relative, false, true); relative = rel; } var result = new Url(); var tkeys = Object.keys(this); for (var tk = 0; tk < tkeys.length; tk++) { var tkey = tkeys[tk]; result[tkey] = this[tkey]; } // hash is always overridden, no matter what. // even href="" will remove it. result.hash = relative.hash; // if the relative url is empty, then there's nothing left to do here. if (relative.href === '') { result.href = result.format(); return result; } // hrefs like //foo/bar always cut to the protocol. if (relative.slashes && !relative.protocol) { // take everything except the protocol from relative var rkeys = Object.keys(relative); for (var rk = 0; rk < rkeys.length; rk++) { var rkey = rkeys[rk]; if (rkey !== 'protocol') result[rkey] = relative[rkey]; } //urlParse appends trailing / to urls like http://www.example.com if (slashedProtocol[result.protocol] && result.hostname && !result.pathname) { result.path = result.pathname = '/'; } result.href = result.format(); return result; } if (relative.protocol && relative.protocol !== result.protocol) { // if it's a known url protocol, then changing // the protocol does weird things // first, if it's not file:, then we MUST have a host, // and if there was a path // to begin with, then we MUST have a path. // if it is file:, then the host is dropped, // because that's known to be hostless. // anything else is assumed to be absolute. if (!slashedProtocol[relative.protocol]) { var keys = Object.keys(relative); for (var v = 0; v < keys.length; v++) { var k = keys[v]; result[k] = relative[k]; } result.href = result.format(); return result; } result.protocol = relative.protocol; if (!relative.host && !hostlessProtocol[relative.protocol]) { var relPath = (relative.pathname || '').split('/'); while (relPath.length && !(relative.host = relPath.shift())); if (!relative.host) relative.host = ''; if (!relative.hostname) relative.hostname = ''; if (relPath[0] !== '') relPath.unshift(''); if (relPath.length < 2) relPath.unshift(''); result.pathname = relPath.join('/'); } else { result.pathname = relative.pathname; } result.search = relative.search; result.query = relative.query; result.host = relative.host || ''; result.auth = relative.auth; result.hostname = relative.hostname || relative.host; result.port = relative.port; // to support http.request if (result.pathname || result.search) { var p = result.pathname || ''; var s = result.search || ''; result.path = p + s; } result.slashes = result.slashes || relative.slashes; result.href = result.format(); return result; } var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'), isRelAbs = ( relative.host || relative.pathname && relative.pathname.charAt(0) === '/' ), mustEndAbs = (isRelAbs || isSourceAbs || (result.host && relative.pathname)), removeAllDots = mustEndAbs, srcPath = result.pathname && result.pathname.split('/') || [], relPath = relative.pathname && relative.pathname.split('/') || [], psychotic = result.protocol && !slashedProtocol[result.protocol]; // if the url is a non-slashed url, then relative // links like ../.. should be able // to crawl up to the hostname, as well. This is strange. // result.protocol has already been set by now. // Later on, put the first path part into the host field. if (psychotic) { result.hostname = ''; result.port = null; if (result.host) { if (srcPath[0] === '') srcPath[0] = result.host; else srcPath.unshift(result.host); } result.host = ''; if (relative.protocol) { relative.hostname = null; relative.port = null; if (relative.host) { if (relPath[0] === '') relPath[0] = relative.host; else relPath.unshift(relative.host); } relative.host = null; } mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === ''); } if (isRelAbs) { // it's absolute. result.host = (relative.host || relative.host === '') ? relative.host : result.host; result.hostname = (relative.hostname || relative.hostname === '') ? relative.hostname : result.hostname; result.search = relative.search; result.query = relative.query; srcPath = relPath; // fall through to the dot-handling below. } else if (relPath.length) { // it's relative // throw away the existing file, and take the new path instead. if (!srcPath) srcPath = []; srcPath.pop(); srcPath = srcPath.concat(relPath); result.search = relative.search; result.query = relative.query; } else if (!util.isNullOrUndefined(relative.search)) { // just pull out the search. // like href='?foo'. // Put this after the other two cases because it simplifies the booleans if (psychotic) { result.hostname = result.host = srcPath.shift(); //occationaly the auth can get stuck only in host //this especially happens in cases like //url.resolveObject('mailto:local1@domain1', 'local2@domain2') var authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false; if (authInHost) { result.auth = authInHost.shift(); result.host = result.hostname = authInHost.shift(); } } result.search = relative.search; result.query = relative.query; //to support http.request if (!util.isNull(result.pathname) || !util.isNull(result.search)) { result.path = (result.pathname ? result.pathname : '') + (result.search ? result.search : ''); } result.href = result.format(); return result; } if (!srcPath.length) { // no path at all. easy. // we've already handled the other stuff above. result.pathname = null; //to support http.request if (result.search) { result.path = '/' + result.search; } else { result.path = null; } result.href = result.format(); return result; } // if a url ENDs in . or .., then it must get a trailing slash. // however, if it ends in anything else non-slashy, // then it must NOT get a trailing slash. var last = srcPath.slice(-1)[0]; var hasTrailingSlash = ( (result.host || relative.host || srcPath.length > 1) && (last === '.' || last === '..') || last === ''); // strip single dots, resolve double dots to parent dir // if the path tries to go above the root, `up` ends up > 0 var up = 0; for (var i = srcPath.length; i >= 0; i--) { last = srcPath[i]; if (last === '.') { srcPath.splice(i, 1); } else if (last === '..') { srcPath.splice(i, 1); up++; } else if (up) { srcPath.splice(i, 1); up--; } } // if the path is allowed to go above the root, restore leading ..s if (!mustEndAbs && !removeAllDots) { for (; up--; up) { srcPath.unshift('..'); } } if (mustEndAbs && srcPath[0] !== '' && (!srcPath[0] || srcPath[0].charAt(0) !== '/')) { srcPath.unshift(''); } if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) { srcPath.push(''); } var isAbsolute = srcPath[0] === '' || (srcPath[0] && srcPath[0].charAt(0) === '/'); // put the host back if (psychotic) { result.hostname = result.host = isAbsolute ? '' : srcPath.length ? srcPath.shift() : ''; //occationaly the auth can get stuck only in host //this especially happens in cases like //url.resolveObject('mailto:local1@domain1', 'local2@domain2') var authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false; if (authInHost) { result.auth = authInHost.shift(); result.host = result.hostname = authInHost.shift(); } } mustEndAbs = mustEndAbs || (result.host && srcPath.length); if (mustEndAbs && !isAbsolute) { srcPath.unshift(''); } if (!srcPath.length) { result.pathname = null; result.path = null; } else { result.pathname = srcPath.join('/'); } //to support request.http if (!util.isNull(result.pathname) || !util.isNull(result.search)) { result.path = (result.pathname ? result.pathname : '') + (result.search ? result.search : ''); } result.auth = relative.auth || result.auth; result.slashes = result.slashes || relative.slashes; result.href = result.format(); return result; }; Url.prototype.parseHost = function() { var host = this.host; var port = portPattern.exec(host); if (port) { port = port[0]; if (port !== ':') { this.port = port.substr(1); } host = host.substr(0, host.length - port.length); } if (host) this.hostname = host; }; /***/ }), /***/ "./node_modules/url/util.js": /*!**********************************!*\ !*** ./node_modules/url/util.js ***! \**********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = { isString: function(arg) { return typeof(arg) === 'string'; }, isObject: function(arg) { return typeof(arg) === 'object' && arg !== null; }, isNull: function(arg) { return arg === null; }, isNullOrUndefined: function(arg) { return arg == null; } }; /***/ }), /***/ "./node_modules/util-deprecate/browser.js": /*!************************************************!*\ !*** ./node_modules/util-deprecate/browser.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) { /** * Module exports. */ module.exports = deprecate; /** * Mark that a method should not be used. * Returns a modified function which warns once by default. * * If `localStorage.noDeprecation = true` is set, then it is a no-op. * * If `localStorage.throwDeprecation = true` is set, then deprecated functions * will throw an Error when invoked. * * If `localStorage.traceDeprecation = true` is set, then deprecated functions * will invoke `console.trace()` instead of `console.error()`. * * @param {Function} fn - the function to deprecate * @param {String} msg - the string to print to the console when `fn` is invoked * @returns {Function} a new "deprecated" version of `fn` * @api public */ function deprecate (fn, msg) { if (config('noDeprecation')) { return fn; } var warned = false; function deprecated() { if (!warned) { if (config('throwDeprecation')) { throw new Error(msg); } else if (config('traceDeprecation')) { console.trace(msg); } else { console.warn(msg); } warned = true; } return fn.apply(this, arguments); } return deprecated; } /** * Checks `localStorage` for boolean values for the given `name`. * * @param {String} name * @returns {Boolean} * @api private */ function config (name) { // accessing global.localStorage can trigger a DOMException in sandboxed iframes try { if (!global.localStorage) return false; } catch (_) { return false; } var val = global.localStorage[name]; if (null == val) return false; return String(val).toLowerCase() === 'true'; } /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) /***/ }), /***/ "./node_modules/warning/browser.js": /*!*****************************************!*\ !*** ./node_modules/warning/browser.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright 2014-2015, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ /** * Similar to invariant but only logs a warning if the condition is not met. * This can be used to log issues in development environments in critical * paths. Removing the logging code for production environments will keep the * same logic and follow the same code paths. */ var warning = function() {}; if (true) { warning = function(condition, format, args) { var len = arguments.length; args = new Array(len > 2 ? len - 2 : 0); for (var key = 2; key < len; key++) { args[key - 2] = arguments[key]; } if (format === undefined) { throw new Error( '`warning(condition, format, ...args)` requires a warning ' + 'message argument' ); } if (format.length < 10 || (/^[s\W]*$/).test(format)) { throw new Error( 'The warning format should be able to uniquely identify this ' + 'warning. Please, use a more descriptive format than: ' + format ); } if (!condition) { var argIndex = 0; var message = 'Warning: ' + format.replace(/%s/g, function() { return args[argIndex++]; }); if (typeof console !== 'undefined') { console.error(message); } try { // This error was thrown as a convenience so that you can use this stack // to find the callsite that caused this warning to fire. throw new Error(message); } catch(x) {} } }; } module.exports = warning; /***/ }), /***/ "./node_modules/wav-encoder/index.js": /*!*******************************************!*\ !*** ./node_modules/wav-encoder/index.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; function encodeSync(audioData, opts) { opts = opts || {}; audioData = toAudioData(audioData); if (audioData === null) { throw new TypeError("Invalid AudioData"); } var floatingPoint = !!(opts.floatingPoint || opts.float); var bitDepth = floatingPoint ? 32 : ((opts.bitDepth|0) || 16); var bytes = bitDepth >> 3; var length = audioData.length * audioData.numberOfChannels * bytes; var dataView = new DataView(new Uint8Array(44 + length).buffer); var writer = createWriter(dataView); var format = { formatId: floatingPoint ? 0x0003 : 0x0001, floatingPoint: floatingPoint, numberOfChannels: audioData.numberOfChannels, sampleRate: audioData.sampleRate, bitDepth: bitDepth }; writeHeader(writer, format, dataView.buffer.byteLength - 8); var err = writeData(writer, format, length, audioData, opts); if (err instanceof Error) { throw err; } return dataView.buffer; } function encode(audioData, opts) { return new Promise(function(resolve) { resolve(encodeSync(audioData, opts)); }); } function toAudioData(data) { var audioData = {}; if (typeof data.sampleRate !== "number") { return null; } if (!Array.isArray(data.channelData)) { return null; } if (!(data.channelData[0] instanceof Float32Array)) { return null; } audioData.numberOfChannels = data.channelData.length; audioData.length = data.channelData[0].length|0; audioData.sampleRate = data.sampleRate|0; audioData.channelData = data.channelData; return audioData; } function writeHeader(writer, format, length) { var bytes = format.bitDepth >> 3; writer.string("RIFF"); writer.uint32(length); writer.string("WAVE"); writer.string("fmt "); writer.uint32(16); writer.uint16(format.floatingPoint ? 0x0003 : 0x0001); writer.uint16(format.numberOfChannels); writer.uint32(format.sampleRate); writer.uint32(format.sampleRate * format.numberOfChannels * bytes); writer.uint16(format.numberOfChannels * bytes); writer.uint16(format.bitDepth); } function writeData(writer, format, length, audioData, opts) { var bitDepth = format.bitDepth; var encoderOption = format.floatingPoint ? "f" : opts.symmetric ? "s" : ""; var methodName = "pcm" + bitDepth + encoderOption; if (!writer[methodName]) { return new TypeError("Not supported bit depth: " + bitDepth); } var write = writer[methodName].bind(writer); var numberOfChannels = format.numberOfChannels; var channelData = audioData.channelData; writer.string("data"); writer.uint32(length); for (var i = 0, imax = audioData.length; i < imax; i++) { for (var ch = 0; ch < numberOfChannels; ch++) { write(channelData[ch][i]); } } } function createWriter(dataView) { var pos = 0; return { int16: function(value) { dataView.setInt16(pos, value, true); pos += 2; }, uint16: function(value) { dataView.setUint16(pos, value, true); pos += 2; }, uint32: function(value) { dataView.setUint32(pos, value, true); pos += 4; }, string: function(value) { for (var i = 0, imax = value.length; i < imax; i++) { dataView.setUint8(pos++, value.charCodeAt(i)); } }, pcm8: function(value) { value = Math.max(-1, Math.min(value, +1)); value = (value * 0.5 + 0.5) * 255; value = Math.round(value)|0; dataView.setUint8(pos, value, true); pos += 1; }, pcm8s: function(value) { value = Math.round(value * 128) + 128; value = Math.max(0, Math.min(value, 255)); dataView.setUint8(pos, value, true); pos += 1; }, pcm16: function(value) { value = Math.max(-1, Math.min(value, +1)); value = value < 0 ? value * 32768 : value * 32767; value = Math.round(value)|0; dataView.setInt16(pos, value, true); pos += 2; }, pcm16s: function(value) { value = Math.round(value * 32768); value = Math.max(-32768, Math.min(value, 32767)); dataView.setInt16(pos, value, true); pos += 2; }, pcm24: function(value) { value = Math.max(-1, Math.min(value, +1)); value = value < 0 ? 0x1000000 + value * 8388608 : value * 8388607; value = Math.round(value)|0; var x0 = (value >> 0) & 0xFF; var x1 = (value >> 8) & 0xFF; var x2 = (value >> 16) & 0xFF; dataView.setUint8(pos + 0, x0); dataView.setUint8(pos + 1, x1); dataView.setUint8(pos + 2, x2); pos += 3; }, pcm24s: function(value) { value = Math.round(value * 8388608); value = Math.max(-8388608, Math.min(value, 8388607)); var x0 = (value >> 0) & 0xFF; var x1 = (value >> 8) & 0xFF; var x2 = (value >> 16) & 0xFF; dataView.setUint8(pos + 0, x0); dataView.setUint8(pos + 1, x1); dataView.setUint8(pos + 2, x2); pos += 3; }, pcm32: function(value) { value = Math.max(-1, Math.min(value, +1)); value = value < 0 ? value * 2147483648 : value * 2147483647; value = Math.round(value)|0; dataView.setInt32(pos, value, true); pos += 4; }, pcm32s: function(value) { value = Math.round(value * 2147483648); value = Math.max(-2147483648, Math.min(value, +2147483647)); dataView.setInt32(pos, value, true); pos += 4; }, pcm32f: function(value) { dataView.setFloat32(pos, value, true); pos += 4; } }; } module.exports.encode = encode; module.exports.encode.sync = encodeSync; /***/ }), /***/ "./node_modules/webpack/buildin/amd-define.js": /*!***************************************!*\ !*** (webpack)/buildin/amd-define.js ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = function() { throw new Error("define cannot be used indirect"); }; /***/ }), /***/ "./node_modules/webpack/buildin/amd-options.js": /*!****************************************!*\ !*** (webpack)/buildin/amd-options.js ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports) { /* WEBPACK VAR INJECTION */(function(__webpack_amd_options__) {/* globals __webpack_amd_options__ */ module.exports = __webpack_amd_options__; /* WEBPACK VAR INJECTION */}.call(this, {})) /***/ }), /***/ "./node_modules/webpack/buildin/global.js": /*!***********************************!*\ !*** (webpack)/buildin/global.js ***! \***********************************/ /*! no static exports found */ /***/ (function(module, exports) { var g; // This works in non-strict mode g = (function() { return this; })(); try { // This works if eval is allowed (see CSP) g = g || new Function("return this")(); } catch (e) { // This works if the window reference is available if (typeof window === "object") g = window; } // g can still be undefined, but nothing to do about it... // We return undefined, instead of nothing here, so it's // easier to handle this case. if(!global) { ...} module.exports = g; /***/ }), /***/ "./node_modules/webpack/buildin/harmony-module.js": /*!*******************************************!*\ !*** (webpack)/buildin/harmony-module.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = function(originalModule) { if (!originalModule.webpackPolyfill) { var module = Object.create(originalModule); // module.parent = undefined by default if (!module.children) module.children = []; Object.defineProperty(module, "loaded", { enumerable: true, get: function() { return module.l; } }); Object.defineProperty(module, "id", { enumerable: true, get: function() { return module.i; } }); Object.defineProperty(module, "exports", { enumerable: true }); module.webpackPolyfill = 1; } return module; }; /***/ }), /***/ "./node_modules/webpack/buildin/module.js": /*!***********************************!*\ !*** (webpack)/buildin/module.js ***! \***********************************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = function(module) { if (!module.webpackPolyfill) { module.deprecate = function() {}; module.paths = []; // module.parent = undefined by default if (!module.children) module.children = []; Object.defineProperty(module, "loaded", { enumerable: true, get: function() { return module.l; } }); Object.defineProperty(module, "id", { enumerable: true, get: function() { return module.i; } }); module.webpackPolyfill = 1; } return module; }; /***/ }), /***/ "./node_modules/worker-loader/dist/cjs.js?{\"inline\":true,\"fallback\":true}!./node_modules/scratch-storage/src/FetchWorkerTool.worker.js": /*!*********************************************************************************************************************************************!*\ !*** ./node_modules/worker-loader/dist/cjs.js?{"inline":true,"fallback":true}!./node_modules/scratch-storage/src/FetchWorkerTool.worker.js ***! \*********************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = function() { return __webpack_require__(/*! !./node_modules/worker-loader/dist/workers/InlineWorker.js */ "./node_modules/worker-loader/dist/workers/InlineWorker.js")("/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// define __esModule on exports\n/******/ \t__webpack_require__.r = function(exports) {\n/******/ \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t}\n/******/ \t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t};\n/******/\n/******/ \t// create a fake namespace object\n/******/ \t// mode & 1: value is a module id, require it\n/******/ \t// mode & 2: merge all properties of value into the ns\n/******/ \t// mode & 4: return value when already ns object\n/******/ \t// mode & 8|1: behave like require\n/******/ \t__webpack_require__.t = function(value, mode) {\n/******/ \t\tif(mode & 1) value = __webpack_require__(value);\n/******/ \t\tif(mode & 8) return value;\n/******/ \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n/******/ \t\tvar ns = Object.create(null);\n/******/ \t\t__webpack_require__.r(ns);\n/******/ \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n/******/ \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n/******/ \t\treturn ns;\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = \"./node_modules/babel-loader/lib/index.js?!./node_modules/scratch-storage/src/FetchWorkerTool.worker.js\");\n/******/ })\n/************************************************************************/\n/******/ ({\n\n/***/ \"./node_modules/babel-loader/lib/index.js?!./node_modules/scratch-storage/src/FetchWorkerTool.worker.js\":\n/*!************************************************************************************************************!*\\\n !*** ./node_modules/babel-loader/lib??ref--4!./node_modules/scratch-storage/src/FetchWorkerTool.worker.js ***!\n \\************************************************************************************************************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\n/* eslint-env worker */\nvar jobsActive = 0;\nvar complete = [];\nvar intervalId = null;\n/**\n * Register a step function.\n *\n * Step checks if there are completed jobs and if there are sends them to the\n * parent. Then it checks the jobs count. If there are no further jobs, clear\n * the step.\n */\n\nvar registerStep = function registerStep() {\n intervalId = setInterval(function () {\n if (complete.length) {\n // Send our chunk of completed requests and instruct postMessage to\n // transfer the buffers instead of copying them.\n postMessage(complete.slice(), // Instruct postMessage that these buffers in the sent message\n // should use their Transferable trait. After the postMessage\n // call the \"buffers\" will still be in complete if you looked,\n // but they will all be length 0 as the data they reference has\n // been sent to the window. This lets us send a lot of data\n // without the normal postMessage behaviour of making a copy of\n // all of the data for the window.\n complete.map(function (response) {\n return response.buffer;\n }).filter(Boolean));\n complete.length = 0;\n }\n\n if (jobsActive === 0) {\n clearInterval(intervalId);\n intervalId = null;\n }\n }, 1);\n};\n/**\n * Receive a job from the parent and fetch the requested data.\n * @param {object} options.job A job id, url, and options descriptor to perform.\n */\n\n\nvar onMessage = function onMessage(_ref) {\n var job = _ref.data;\n\n if (jobsActive === 0 && !intervalId) {\n registerStep();\n }\n\n jobsActive++;\n fetch(job.url, job.options).then(function (response) {\n return response.arrayBuffer();\n }).then(function (buffer) {\n return complete.push({\n id: job.id,\n buffer: buffer\n });\n }).catch(function (error) {\n return complete.push({\n id: job.id,\n error: error\n });\n }).then(function () {\n return jobsActive--;\n });\n};\n\nif (self.fetch) {\n postMessage({\n support: {\n fetch: true\n }\n });\n self.addEventListener('message', onMessage);\n} else {\n postMessage({\n support: {\n fetch: false\n }\n });\n self.addEventListener('message', function (_ref2) {\n var job = _ref2.data;\n postMessage([{\n id: job.id,\n error: new Error('fetch is unavailable')\n }]);\n });\n}\n\n/***/ })\n\n/******/ });\n//# sourceMappingURL=326c5f98902ccd335b5b.worker.js.map", __webpack_require__.p + "326c5f98902ccd335b5b.worker.js"); }; /***/ }), /***/ "./node_modules/worker-loader/dist/workers/InlineWorker.js": /*!*****************************************************************!*\ !*** ./node_modules/worker-loader/dist/workers/InlineWorker.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // http://stackoverflow.com/questions/10343913/how-to-create-a-web-worker-from-a-string var URL = window.URL || window.webkitURL; module.exports = function (content, url) { try { try { var blob; try { // BlobBuilder = Deprecated, but widely implemented var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder; blob = new BlobBuilder(); blob.append(content); blob = blob.getBlob(); } catch (e) { // The proposed API blob = new Blob([content]); } return new Worker(URL.createObjectURL(blob)); } catch (e) { return new Worker('data:application/javascript,' + encodeURIComponent(content)); } } catch (e) { if (!url) { throw Error('Inline worker is not supported'); } return new Worker(url); } }; /***/ }), /***/ "./node_modules/xhr/index.js": /*!***********************************!*\ !*** ./node_modules/xhr/index.js ***! \***********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var window = __webpack_require__(/*! global/window */ "./node_modules/global/window.js") var isFunction = __webpack_require__(/*! is-function */ "./node_modules/is-function/index.js") var parseHeaders = __webpack_require__(/*! parse-headers */ "./node_modules/parse-headers/parse-headers.js") var xtend = __webpack_require__(/*! xtend */ "./node_modules/xtend/immutable.js") module.exports = createXHR // Allow use of default import syntax in TypeScript module.exports.default = createXHR; createXHR.XMLHttpRequest = window.XMLHttpRequest || noop createXHR.XDomainRequest = "withCredentials" in (new createXHR.XMLHttpRequest()) ? createXHR.XMLHttpRequest : window.XDomainRequest forEachArray(["get", "put", "post", "patch", "head", "delete"], function(method) { createXHR[method === "delete" ? "del" : method] = function(uri, options, callback) { options = initParams(uri, options, callback) options.method = method.toUpperCase() return _createXHR(options) } }) function forEachArray(array, iterator) { for (var i = 0; i < array.length; i++) { iterator(array[i]) } } function isEmpty(obj){ for(var i in obj){ if(obj.hasOwnProperty(i)) return false } return true } function initParams(uri, options, callback) { var params = uri if (isFunction(options)) { callback = options if (typeof uri === "string") { params = {uri:uri} } } else { params = xtend(options, {uri: uri}) } params.callback = callback return params } function createXHR(uri, options, callback) { options = initParams(uri, options, callback) return _createXHR(options) } function _createXHR(options) { if(typeof options.callback === "undefined"){ throw new Error("callback argument missing") } var called = false var callback = function cbOnce(err, response, body){ if(!called){ called = true options.callback(err, response, body) } } function readystatechange() { if (xhr.readyState === 4) { setTimeout(loadFunc, 0) } } function getBody() { // Chrome with requestType=blob throws errors arround when even testing access to responseText var body = undefined if (xhr.response) { body = xhr.response } else { body = xhr.responseText || getXml(xhr) } if (isJson) { try { body = JSON.parse(body) } catch (e) {} } return body } function errorFunc(evt) { clearTimeout(timeoutTimer) if(!(evt instanceof Error)){ evt = new Error("" + (evt || "Unknown XMLHttpRequest Error") ) } evt.statusCode = 0 return callback(evt, failureResponse) } // will load the data & process the response in a special response object function loadFunc() { if (aborted) return var status clearTimeout(timeoutTimer) if(options.useXDR && xhr.status===undefined) { //IE8 CORS GET successful response doesn't have a status field, but body is fine status = 200 } else { status = (xhr.status === 1223 ? 204 : xhr.status) } var response = failureResponse var err = null if (status !== 0){ response = { body: getBody(), statusCode: status, method: method, headers: {}, url: uri, rawRequest: xhr } if(xhr.getAllResponseHeaders){ //remember xhr can in fact be XDR for CORS in IE response.headers = parseHeaders(xhr.getAllResponseHeaders()) } } else { err = new Error("Internal XMLHttpRequest Error") } return callback(err, response, response.body) } var xhr = options.xhr || null if (!xhr) { if (options.cors || options.useXDR) { xhr = new createXHR.XDomainRequest() }else{ xhr = new createXHR.XMLHttpRequest() } } var key var aborted var uri = xhr.url = options.uri || options.url var method = xhr.method = options.method || "GET" var body = options.body || options.data var headers = xhr.headers = options.headers || {} var sync = !!options.sync var isJson = false var timeoutTimer var failureResponse = { body: undefined, headers: {}, statusCode: 0, method: method, url: uri, rawRequest: xhr } if ("json" in options && options.json !== false) { isJson = true headers["accept"] || headers["Accept"] || (headers["Accept"] = "application/json") //Don't override existing accept header declared by user if (method !== "GET" && method !== "HEAD") { headers["content-type"] || headers["Content-Type"] || (headers["Content-Type"] = "application/json") //Don't override existing accept header declared by user body = JSON.stringify(options.json === true ? body : options.json) } } xhr.onreadystatechange = readystatechange xhr.onload = loadFunc xhr.onerror = errorFunc // IE9 must have onprogress be set to a unique function. xhr.onprogress = function () { // IE must die } xhr.onabort = function(){ aborted = true; } xhr.ontimeout = errorFunc xhr.open(method, uri, !sync, options.username, options.password) //has to be after open if(!sync) { xhr.withCredentials = !!options.withCredentials } // Cannot set timeout with sync request // not setting timeout on the xhr object, because of old webkits etc. not handling that correctly // both npm's request and jquery 1.x use this kind of timeout, so this is being consistent if (!sync && options.timeout > 0 ) { timeoutTimer = setTimeout(function(){ if (aborted) return aborted = true//IE9 may still call readystatechange xhr.abort("timeout") var e = new Error("XMLHttpRequest timeout") e.code = "ETIMEDOUT" errorFunc(e) }, options.timeout ) } if (xhr.setRequestHeader) { for(key in headers){ if(headers.hasOwnProperty(key)){ xhr.setRequestHeader(key, headers[key]) } } } else if (options.headers && !isEmpty(options.headers)) { throw new Error("Headers cannot be set on an XDomainRequest object") } if ("responseType" in options) { xhr.responseType = options.responseType } if ("beforeSend" in options && typeof options.beforeSend === "function" ) { options.beforeSend(xhr) } // Microsoft Edge browser sends "undefined" when send is called with undefined value. // XMLHttpRequest spec says to pass null as body to indicate no body // See https://github.com/naugtur/xhr/issues/100. xhr.send(body || null) return xhr } function getXml(xhr) { // xhr.responseXML will throw Exception "InvalidStateError" or "DOMException" // See https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseXML. try { if (xhr.responseType === "document") { return xhr.responseXML } var firefoxBugTakenEffect = xhr.responseXML && xhr.responseXML.documentElement.nodeName === "parsererror" if (xhr.responseType === "" && !firefoxBugTakenEffect) { return xhr.responseXML } } catch (e) {} return null } function noop() {} /***/ }), /***/ "./node_modules/xtend/immutable.js": /*!*****************************************!*\ !*** ./node_modules/xtend/immutable.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = extend var hasOwnProperty = Object.prototype.hasOwnProperty; function extend() { var target = {} for (var i = 0; i < arguments.length; i++) { var source = arguments[i] for (var key in source) { if (hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target } /***/ }), /***/ "./src/components/action-menu/action-menu.css": /*!****************************************************!*\ !*** ./src/components/action-menu/action-menu.css ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./action-menu.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/action-menu/action-menu.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/action-menu/action-menu.jsx": /*!****************************************************!*\ !*** ./src/components/action-menu/action-menu.jsx ***! \****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var react_tooltip__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-tooltip */ "./node_modules/react-tooltip/dist/index.js"); /* harmony import */ var react_tooltip__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_tooltip__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _action_menu_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./action-menu.css */ "./src/components/action-menu/action-menu.css"); /* harmony import */ var _action_menu_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_action_menu_css__WEBPACK_IMPORTED_MODULE_5__); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var CLOSE_DELAY = 300; // ms var ActionMenu = /*#__PURE__*/ function (_React$Component) { _inherits(ActionMenu, _React$Component); function ActionMenu(props) { var _this; _classCallCheck(this, ActionMenu); _this = _possibleConstructorReturn(this, _getPrototypeOf(ActionMenu).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_3___default()(_assertThisInitialized(_this), ['clickDelayer', 'handleClosePopover', 'handleToggleOpenState', 'handleTouchStart', 'handleTouchOutside', 'setButtonRef', 'setContainerRef']); _this.state = { isOpen: false, forceHide: false }; _this.mainTooltipId = "tooltip-".concat(Math.random()); return _this; } _createClass(ActionMenu, [{ key: "componentDidMount", value: function componentDidMount() { // Touch start on the main button is caught to trigger open and not click this.buttonRef.addEventListener('touchstart', this.handleTouchStart); // Touch start on document is used to trigger close if it is outside document.addEventListener('touchstart', this.handleTouchOutside); } }, { key: "shouldComponentUpdate", value: function shouldComponentUpdate(newProps, newState) { // This check prevents re-rendering while the project is updating. // @todo check only the state and the title because it is enough to know // if anything substantial has changed // This is needed because of the sloppy way the props are passed as a new object, // which should be refactored. return newState.isOpen !== this.state.isOpen || newState.forceHide !== this.state.forceHide || newProps.title !== this.props.title; } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.buttonRef.removeEventListener('touchstart', this.handleTouchStart); document.removeEventListener('touchstart', this.handleTouchOutside); } }, { key: "handleClosePopover", value: function handleClosePopover() { var _this2 = this; this.closeTimeoutId = setTimeout(function () { _this2.setState({ isOpen: false }); _this2.closeTimeoutId = null; }, CLOSE_DELAY); } }, { key: "handleToggleOpenState", value: function handleToggleOpenState() { // Mouse enter back in after timeout was started prevents it from closing. if (this.closeTimeoutId) { clearTimeout(this.closeTimeoutId); this.closeTimeoutId = null; } else if (!this.state.isOpen) { this.setState({ isOpen: true, forceHide: false }); } } }, { key: "handleTouchOutside", value: function handleTouchOutside(e) { if (this.state.isOpen && !this.containerRef.contains(e.target)) { this.setState({ isOpen: false }); react_tooltip__WEBPACK_IMPORTED_MODULE_4___default.a.hide(); } } }, { key: "clickDelayer", value: function clickDelayer(fn) { var _this3 = this; // Return a wrapped action that manages the menu closing. // @todo we may be able to use react-transition for this in the future // for now all this work is to ensure the menu closes BEFORE the // (possibly slow) action is started. return function (event) { react_tooltip__WEBPACK_IMPORTED_MODULE_4___default.a.hide(); if (fn) fn(event); // Blur the button so it does not keep focus after being clicked // This prevents keyboard events from triggering the button _this3.buttonRef.blur(); _this3.setState({ forceHide: true, isOpen: false }, function () { setTimeout(function () { return _this3.setState({ forceHide: false }); }); }); }; } }, { key: "handleTouchStart", value: function handleTouchStart(e) { // Prevent this touch from becoming a click if menu is closed if (!this.state.isOpen) { e.preventDefault(); this.handleToggleOpenState(); } } }, { key: "setButtonRef", value: function setButtonRef(ref) { this.buttonRef = ref; } }, { key: "setContainerRef", value: function setContainerRef(ref) { this.containerRef = ref; } }, { key: "render", value: function render() { var _classNames, _this4 = this; var _this$props = this.props, className = _this$props.className, mainImg = _this$props.img, mainTitle = _this$props.title, moreButtons = _this$props.moreButtons, tooltipPlace = _this$props.tooltipPlace, onClick = _this$props.onClick; return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_action_menu_css__WEBPACK_IMPORTED_MODULE_5___default.a.menuContainer, className, (_classNames = {}, _defineProperty(_classNames, _action_menu_css__WEBPACK_IMPORTED_MODULE_5___default.a.expanded, this.state.isOpen), _defineProperty(_classNames, _action_menu_css__WEBPACK_IMPORTED_MODULE_5___default.a.forceHidden, this.state.forceHide), _classNames)), ref: this.setContainerRef, onMouseEnter: this.handleToggleOpenState, onMouseLeave: this.handleClosePopover }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("button", { "aria-label": mainTitle, className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_action_menu_css__WEBPACK_IMPORTED_MODULE_5___default.a.button, _action_menu_css__WEBPACK_IMPORTED_MODULE_5___default.a.mainButton), "data-for": this.mainTooltipId, "data-tip": mainTitle, ref: this.setButtonRef, onClick: this.clickDelayer(onClick) }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", { className: _action_menu_css__WEBPACK_IMPORTED_MODULE_5___default.a.mainIcon, draggable: false, src: mainImg })), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_tooltip__WEBPACK_IMPORTED_MODULE_4___default.a, { className: _action_menu_css__WEBPACK_IMPORTED_MODULE_5___default.a.tooltip, effect: "solid", id: this.mainTooltipId, place: tooltipPlace || 'left' }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _action_menu_css__WEBPACK_IMPORTED_MODULE_5___default.a.moreButtonsOuter }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _action_menu_css__WEBPACK_IMPORTED_MODULE_5___default.a.moreButtons }, (moreButtons || []).map(function (_ref, keyId) { var img = _ref.img, title = _ref.title, handleClick = _ref.onClick, fileAccept = _ref.fileAccept, fileChange = _ref.fileChange, fileInput = _ref.fileInput, fileMultiple = _ref.fileMultiple; var isComingSoon = !handleClick; var hasFileInput = fileInput; var tooltipId = "".concat(_this4.mainTooltipId, "-").concat(title); return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { key: "".concat(tooltipId, "-").concat(keyId) }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("button", { "aria-label": title, className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_action_menu_css__WEBPACK_IMPORTED_MODULE_5___default.a.button, _action_menu_css__WEBPACK_IMPORTED_MODULE_5___default.a.moreButton, _defineProperty({}, _action_menu_css__WEBPACK_IMPORTED_MODULE_5___default.a.comingSoon, isComingSoon)), "data-for": tooltipId, "data-tip": title, onClick: hasFileInput ? handleClick : _this4.clickDelayer(handleClick) }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", { className: _action_menu_css__WEBPACK_IMPORTED_MODULE_5___default.a.moreIcon, draggable: false, src: img }), hasFileInput ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("input", { accept: fileAccept, className: _action_menu_css__WEBPACK_IMPORTED_MODULE_5___default.a.fileInput, multiple: fileMultiple, ref: fileInput, type: "file", onChange: fileChange }) : null), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_tooltip__WEBPACK_IMPORTED_MODULE_4___default.a, { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_action_menu_css__WEBPACK_IMPORTED_MODULE_5___default.a.tooltip, _defineProperty({}, _action_menu_css__WEBPACK_IMPORTED_MODULE_5___default.a.comingSoonTooltip, isComingSoon)), effect: "solid", id: tooltipId, place: tooltipPlace || 'left' })); })))); } }]); return ActionMenu; }(react__WEBPACK_IMPORTED_MODULE_1___default.a.Component); ActionMenu.propTypes = { className: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, img: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, moreButtons: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({ img: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, title: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.node.isRequired, onClick: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, // Optional, "coming soon" if no callback provided fileAccept: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, // Optional, only for file upload fileChange: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, // Optional, only for file upload fileInput: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, // Optional, only for file upload fileMultiple: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool // Optional, only for file upload })), onClick: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, title: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.node.isRequired, tooltipPlace: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string }; /* harmony default export */ __webpack_exports__["default"] = (ActionMenu); /***/ }), /***/ "./src/components/action-menu/icon--backdrop.svg": /*!*******************************************************!*\ !*** ./src/components/action-menu/icon--backdrop.svg ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/385aa4b73a425883b4f9e91501a52299.svg"; /***/ }), /***/ "./src/components/action-menu/icon--camera.svg": /*!*****************************************************!*\ !*** ./src/components/action-menu/icon--camera.svg ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/c3421543ab6c9e154f4294257ce0d078.svg"; /***/ }), /***/ "./src/components/action-menu/icon--file-upload.svg": /*!**********************************************************!*\ !*** ./src/components/action-menu/icon--file-upload.svg ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/e587d9d7e9a2f1f28041ba5c15db7a40.svg"; /***/ }), /***/ "./src/components/action-menu/icon--paint.svg": /*!****************************************************!*\ !*** ./src/components/action-menu/icon--paint.svg ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/94b06fb716871f81bec601724e29a457.svg"; /***/ }), /***/ "./src/components/action-menu/icon--search.svg": /*!*****************************************************!*\ !*** ./src/components/action-menu/icon--search.svg ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/551aae506dfa65ce3b45713b5300a678.svg"; /***/ }), /***/ "./src/components/action-menu/icon--sprite.svg": /*!*****************************************************!*\ !*** ./src/components/action-menu/icon--sprite.svg ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/497f797eeffe5fa7e6a626abc0db08a1.svg"; /***/ }), /***/ "./src/components/action-menu/icon--surprise.svg": /*!*******************************************************!*\ !*** ./src/components/action-menu/icon--surprise.svg ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/301439e2e5ab88b658368ee525e6752b.svg"; /***/ }), /***/ "./src/components/alerts/alert.css": /*!*****************************************!*\ !*** ./src/components/alerts/alert.css ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./alert.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/alerts/alert.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/alerts/alert.jsx": /*!*****************************************!*\ !*** ./src/components/alerts/alert.jsx ***! \*****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _close_button_close_button_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../close-button/close-button.jsx */ "./src/components/close-button/close-button.jsx"); /* harmony import */ var _spinner_spinner_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../spinner/spinner.jsx */ "./src/components/spinner/spinner.jsx"); /* harmony import */ var _lib_alerts_index_jsx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../lib/alerts/index.jsx */ "./src/lib/alerts/index.jsx"); /* harmony import */ var _alert_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./alert.css */ "./src/components/alerts/alert.css"); /* harmony import */ var _alert_css__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_alert_css__WEBPACK_IMPORTED_MODULE_8__); var _closeButtonColors; function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var closeButtonColors = (_closeButtonColors = {}, _defineProperty(_closeButtonColors, _lib_alerts_index_jsx__WEBPACK_IMPORTED_MODULE_7__["AlertLevels"].SUCCESS, _close_button_close_button_jsx__WEBPACK_IMPORTED_MODULE_5__["default"].COLOR_GREEN), _defineProperty(_closeButtonColors, _lib_alerts_index_jsx__WEBPACK_IMPORTED_MODULE_7__["AlertLevels"].WARN, _close_button_close_button_jsx__WEBPACK_IMPORTED_MODULE_5__["default"].COLOR_ORANGE), _closeButtonColors); var AlertComponent = function AlertComponent(_ref) { var content = _ref.content, closeButton = _ref.closeButton, extensionName = _ref.extensionName, iconSpinner = _ref.iconSpinner, iconURL = _ref.iconURL, level = _ref.level, showDownload = _ref.showDownload, showSaveNow = _ref.showSaveNow, onCloseAlert = _ref.onCloseAlert, onDownload = _ref.onDownload, onSaveNow = _ref.onSaveNow, onReconnect = _ref.onReconnect, showReconnect = _ref.showReconnect; return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_alert_css__WEBPACK_IMPORTED_MODULE_8___default.a.alert, _alert_css__WEBPACK_IMPORTED_MODULE_8___default.a[level]) }, (iconSpinner || iconURL) && react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _alert_css__WEBPACK_IMPORTED_MODULE_8___default.a.iconSection }, iconSpinner && react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_spinner_spinner_jsx__WEBPACK_IMPORTED_MODULE_6__["default"], { className: _alert_css__WEBPACK_IMPORTED_MODULE_8___default.a.alertSpinner, level: level }), iconURL && react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("img", { className: _alert_css__WEBPACK_IMPORTED_MODULE_8___default.a.alertIcon, src: iconURL })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _alert_css__WEBPACK_IMPORTED_MODULE_8___default.a.alertMessage }, extensionName ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "Scratch lost connection to {extensionName}.", id: "gui.alerts.lostPeripheralConnection", values: { extensionName: "".concat(extensionName) } }) : content), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _alert_css__WEBPACK_IMPORTED_MODULE_8___default.a.alertButtons }, showSaveNow && react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", { className: _alert_css__WEBPACK_IMPORTED_MODULE_8___default.a.alertConnectionButton, onClick: onSaveNow }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "Try Again", id: "gui.alerts.tryAgain" })), showDownload && react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", { className: _alert_css__WEBPACK_IMPORTED_MODULE_8___default.a.alertConnectionButton, onClick: onDownload }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "Download", id: "gui.alerts.download" })), showReconnect && react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", { className: _alert_css__WEBPACK_IMPORTED_MODULE_8___default.a.alertConnectionButton, onClick: onReconnect }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "Reconnect", id: "gui.connection.reconnect" })), closeButton && react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: _alert_css__WEBPACK_IMPORTED_MODULE_8___default.a.alertCloseButtonContainer }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_close_button_close_button_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_alert_css__WEBPACK_IMPORTED_MODULE_8___default.a.alertCloseButton), color: closeButtonColors[level], size: _close_button_close_button_jsx__WEBPACK_IMPORTED_MODULE_5__["default"].SIZE_LARGE, onClick: onCloseAlert })))); }; AlertComponent.propTypes = { closeButton: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, content: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.element, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string]), extensionName: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, iconSpinner: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, iconURL: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, level: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, onCloseAlert: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, onDownload: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onReconnect: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onSaveNow: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, showDownload: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, showReconnect: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, showSaveNow: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool }; AlertComponent.defaultProps = { level: _lib_alerts_index_jsx__WEBPACK_IMPORTED_MODULE_7__["AlertLevels"].WARN }; /* harmony default export */ __webpack_exports__["default"] = (AlertComponent); /***/ }), /***/ "./src/components/alerts/alerts.css": /*!******************************************!*\ !*** ./src/components/alerts/alerts.css ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./alerts.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/alerts/alerts.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/alerts/alerts.jsx": /*!******************************************!*\ !*** ./src/components/alerts/alerts.jsx ***! \******************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _containers_alert_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../containers/alert.jsx */ "./src/containers/alert.jsx"); /* harmony import */ var _alerts_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./alerts.css */ "./src/components/alerts/alerts.css"); /* harmony import */ var _alerts_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_alerts_css__WEBPACK_IMPORTED_MODULE_4__); var AlertsComponent = function AlertsComponent(_ref) { var alertsList = _ref.alertsList, className = _ref.className, onCloseAlert = _ref.onCloseAlert; return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], { bounds: "parent", className: className }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], { className: _alerts_css__WEBPACK_IMPORTED_MODULE_4___default.a.alertsInnerContainer }, alertsList.map(function (a, index) { return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_containers_alert_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { closeButton: a.closeButton, content: a.content, extensionId: a.extensionId, extensionName: a.extensionName, iconSpinner: a.iconSpinner, iconURL: a.iconURL, index: index, key: index, level: a.level, message: a.message, showDownload: a.showDownload, showReconnect: a.showReconnect, showSaveNow: a.showSaveNow, onCloseAlert: onCloseAlert }); }))); }; AlertsComponent.propTypes = { alertsList: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object), className: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, onCloseAlert: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func }; /* harmony default export */ __webpack_exports__["default"] = (AlertsComponent); /***/ }), /***/ "./src/components/alerts/inline-message.css": /*!**************************************************!*\ !*** ./src/components/alerts/inline-message.css ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./inline-message.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/alerts/inline-message.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/alerts/inline-message.jsx": /*!**************************************************!*\ !*** ./src/components/alerts/inline-message.jsx ***! \**************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _spinner_spinner_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../spinner/spinner.jsx */ "./src/components/spinner/spinner.jsx"); /* harmony import */ var _lib_alerts_index_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../lib/alerts/index.jsx */ "./src/lib/alerts/index.jsx"); /* harmony import */ var _inline_message_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./inline-message.css */ "./src/components/alerts/inline-message.css"); /* harmony import */ var _inline_message_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_inline_message_css__WEBPACK_IMPORTED_MODULE_5__); var InlineMessageComponent = function InlineMessageComponent(_ref) { var content = _ref.content, iconSpinner = _ref.iconSpinner, level = _ref.level; return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_inline_message_css__WEBPACK_IMPORTED_MODULE_5___default.a.inlineMessage, _inline_message_css__WEBPACK_IMPORTED_MODULE_5___default.a[level]) }, iconSpinner && react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_spinner_spinner_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { small: true, className: _inline_message_css__WEBPACK_IMPORTED_MODULE_5___default.a.spinner, level: 'info' }), content); }; InlineMessageComponent.propTypes = { content: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.element, iconSpinner: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, level: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string }; InlineMessageComponent.defaultProps = { level: _lib_alerts_index_jsx__WEBPACK_IMPORTED_MODULE_4__["AlertLevels"].INFO }; /* harmony default export */ __webpack_exports__["default"] = (InlineMessageComponent); /***/ }), /***/ "./src/components/asset-panel/asset-panel.css": /*!****************************************************!*\ !*** ./src/components/asset-panel/asset-panel.css ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./asset-panel.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/asset-panel/asset-panel.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/asset-panel/asset-panel.jsx": /*!****************************************************!*\ !*** ./src/components/asset-panel/asset-panel.jsx ***! \****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _selector_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./selector.jsx */ "./src/components/asset-panel/selector.jsx"); /* harmony import */ var _asset_panel_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./asset-panel.css */ "./src/components/asset-panel/asset-panel.css"); /* harmony import */ var _asset_panel_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_asset_panel_css__WEBPACK_IMPORTED_MODULE_3__); function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } var AssetPanel = function AssetPanel(props) { return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_1__["default"], { className: _asset_panel_css__WEBPACK_IMPORTED_MODULE_3___default.a.wrapper }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_selector_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], _extends({ className: _asset_panel_css__WEBPACK_IMPORTED_MODULE_3___default.a.selector }, props)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_1__["default"], { className: _asset_panel_css__WEBPACK_IMPORTED_MODULE_3___default.a.detailArea }, props.children)); }; AssetPanel.propTypes = _objectSpread({}, _selector_jsx__WEBPACK_IMPORTED_MODULE_2__["default"].propTypes); /* harmony default export */ __webpack_exports__["default"] = (AssetPanel); /***/ }), /***/ "./src/components/asset-panel/icon--add-backdrop-lib.svg": /*!***************************************************************!*\ !*** ./src/components/asset-panel/icon--add-backdrop-lib.svg ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/44e4859e354c81d66c73f741df2e5ec7.svg"; /***/ }), /***/ "./src/components/asset-panel/icon--add-costume-lib.svg": /*!**************************************************************!*\ !*** ./src/components/asset-panel/icon--add-costume-lib.svg ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/c9528ee4be1a12380a6c9caf73bd99e9.svg"; /***/ }), /***/ "./src/components/asset-panel/icon--add-sound-lib.svg": /*!************************************************************!*\ !*** ./src/components/asset-panel/icon--add-sound-lib.svg ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/9cfdd378e4cc977fe663ca932e530ec6.svg"; /***/ }), /***/ "./src/components/asset-panel/icon--add-sound-record.svg": /*!***************************************************************!*\ !*** ./src/components/asset-panel/icon--add-sound-record.svg ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/35c6867250ec4f430624bc9e2e7072d7.svg"; /***/ }), /***/ "./src/components/asset-panel/icon--sound-rtl.svg": /*!********************************************************!*\ !*** ./src/components/asset-panel/icon--sound-rtl.svg ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/38ac2210b486d930f72c951ad081e4c0.svg"; /***/ }), /***/ "./src/components/asset-panel/icon--sound.svg": /*!****************************************************!*\ !*** ./src/components/asset-panel/icon--sound.svg ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/63e5827c1506216bd7c9927a4e5eb558.svg"; /***/ }), /***/ "./src/components/asset-panel/selector.css": /*!*************************************************!*\ !*** ./src/components/asset-panel/selector.css ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./selector.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/asset-panel/selector.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/asset-panel/selector.jsx": /*!*************************************************!*\ !*** ./src/components/asset-panel/selector.jsx ***! \*************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _containers_sprite_selector_item_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../containers/sprite-selector-item.jsx */ "./src/containers/sprite-selector-item.jsx"); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _action_menu_action_menu_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../action-menu/action-menu.jsx */ "./src/components/action-menu/action-menu.jsx"); /* harmony import */ var _sortable_asset_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./sortable-asset.jsx */ "./src/components/asset-panel/sortable-asset.jsx"); /* harmony import */ var _lib_sortable_hoc_jsx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../lib/sortable-hoc.jsx */ "./src/lib/sortable-hoc.jsx"); /* harmony import */ var _lib_drag_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../lib/drag-constants */ "./src/lib/drag-constants.js"); /* harmony import */ var _selector_css__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./selector.css */ "./src/components/asset-panel/selector.css"); /* harmony import */ var _selector_css__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_selector_css__WEBPACK_IMPORTED_MODULE_9__); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var Selector = function Selector(props) { var buttons = props.buttons, containerRef = props.containerRef, dragType = props.dragType, isRtl = props.isRtl, items = props.items, selectedItemIndex = props.selectedItemIndex, draggingIndex = props.draggingIndex, draggingType = props.draggingType, ordering = props.ordering, onAddSortable = props.onAddSortable, onRemoveSortable = props.onRemoveSortable, onDeleteClick = props.onDeleteClick, onDuplicateClick = props.onDuplicateClick, onExportClick = props.onExportClick, onItemClick = props.onItemClick; var isRelevantDrag = draggingType === dragType; var newButtonSection = null; if (buttons.length > 0) { var _buttons$ = buttons[0], img = _buttons$.img, title = _buttons$.title, onClick = _buttons$.onClick; var moreButtons = buttons.slice(1); newButtonSection = react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: _selector_css__WEBPACK_IMPORTED_MODULE_9___default.a.newButtons }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_action_menu_action_menu_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { img: img, moreButtons: moreButtons, title: title, tooltipPlace: isRtl ? 'left' : 'right', onClick: onClick })); } return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: _selector_css__WEBPACK_IMPORTED_MODULE_9___default.a.wrapper, componentRef: containerRef }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: _selector_css__WEBPACK_IMPORTED_MODULE_9___default.a.listArea }, items.map(function (item, index) { return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_sortable_asset_jsx__WEBPACK_IMPORTED_MODULE_6__["default"], { id: item.name, index: isRelevantDrag ? ordering.indexOf(index) : index, key: item.name, onAddSortable: onAddSortable, onRemoveSortable: onRemoveSortable }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_containers_sprite_selector_item_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { asset: item.asset, className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_selector_css__WEBPACK_IMPORTED_MODULE_9___default.a.listItem, _defineProperty({}, _selector_css__WEBPACK_IMPORTED_MODULE_9___default.a.placeholder, isRelevantDrag && index === draggingIndex)), costumeURL: item.url, details: item.details, dragPayload: item.dragPayload, dragType: dragType, id: index, index: index, name: item.name, number: index + 1 /* 1-indexed */ , selected: index === selectedItemIndex, onClick: onItemClick, onDeleteButtonClick: onDeleteClick, onDuplicateButtonClick: onDuplicateClick, onExportButtonClick: onExportClick })); })), newButtonSection); }; Selector.propTypes = { buttons: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({ title: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string.isRequired, img: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string.isRequired, onClick: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func })), containerRef: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, dragType: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.oneOf(Object.keys(_lib_drag_constants__WEBPACK_IMPORTED_MODULE_8__["default"])), draggingIndex: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number, draggingType: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.oneOf(Object.keys(_lib_drag_constants__WEBPACK_IMPORTED_MODULE_8__["default"])), isRtl: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, items: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({ url: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, name: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string.isRequired })), onAddSortable: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onDeleteClick: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onDuplicateClick: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onExportClick: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onItemClick: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onRemoveSortable: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, ordering: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number), selectedItemIndex: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number.isRequired }; /* harmony default export */ __webpack_exports__["default"] = (Object(_lib_sortable_hoc_jsx__WEBPACK_IMPORTED_MODULE_7__["default"])(Selector)); /***/ }), /***/ "./src/components/asset-panel/sortable-asset.jsx": /*!*******************************************************!*\ !*** ./src/components/asset-panel/sortable-asset.jsx ***! \*******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_2__); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var SortableAsset = /*#__PURE__*/ function (_React$Component) { _inherits(SortableAsset, _React$Component); function SortableAsset(props) { var _this; _classCallCheck(this, SortableAsset); _this = _possibleConstructorReturn(this, _getPrototypeOf(SortableAsset).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_2___default()(_assertThisInitialized(_this), ['setRef']); return _this; } _createClass(SortableAsset, [{ key: "componentDidMount", value: function componentDidMount() { this.props.onAddSortable(this.ref); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.props.onRemoveSortable(this.ref); } }, { key: "setRef", value: function setRef(ref) { this.ref = ref; } }, { key: "render", value: function render() { return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: this.props.className, ref: this.setRef, style: { order: this.props.index } }, this.props.children); } }]); return SortableAsset; }(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component); SortableAsset.propTypes = { children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node.isRequired, className: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, index: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number.isRequired, onAddSortable: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, onRemoveSortable: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired }; /* harmony default export */ __webpack_exports__["default"] = (SortableAsset); /***/ }), /***/ "./src/components/audio-trimmer/audio-trimmer.css": /*!********************************************************!*\ !*** ./src/components/audio-trimmer/audio-trimmer.css ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./audio-trimmer.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/audio-trimmer/audio-trimmer.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/audio-trimmer/audio-trimmer.jsx": /*!********************************************************!*\ !*** ./src/components/audio-trimmer/audio-trimmer.jsx ***! \********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _audio_trimmer_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./audio-trimmer.css */ "./src/components/audio-trimmer/audio-trimmer.css"); /* harmony import */ var _audio_trimmer_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_audio_trimmer_css__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _icon_handle_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./icon--handle.svg */ "./src/components/audio-trimmer/icon--handle.svg"); /* harmony import */ var _icon_handle_svg__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_icon_handle_svg__WEBPACK_IMPORTED_MODULE_5__); var AudioTrimmer = function AudioTrimmer(props) { return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _audio_trimmer_css__WEBPACK_IMPORTED_MODULE_4___default.a.absolute, ref: props.containerRef }, props.trimStart === null ? null : react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_audio_trimmer_css__WEBPACK_IMPORTED_MODULE_4___default.a.absolute, _audio_trimmer_css__WEBPACK_IMPORTED_MODULE_4___default.a.trimBackground, _audio_trimmer_css__WEBPACK_IMPORTED_MODULE_4___default.a.startTrimBackground), style: { width: "".concat(100 * props.trimStart, "%") }, onMouseDown: props.onTrimStartMouseDown, onTouchStart: props.onTrimStartMouseDown }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_audio_trimmer_css__WEBPACK_IMPORTED_MODULE_4___default.a.absolute, _audio_trimmer_css__WEBPACK_IMPORTED_MODULE_4___default.a.trimBackgroundMask) }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_audio_trimmer_css__WEBPACK_IMPORTED_MODULE_4___default.a.trimLine, _audio_trimmer_css__WEBPACK_IMPORTED_MODULE_4___default.a.startTrimLine) }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_audio_trimmer_css__WEBPACK_IMPORTED_MODULE_4___default.a.trimHandle, _audio_trimmer_css__WEBPACK_IMPORTED_MODULE_4___default.a.topTrimHandle, _audio_trimmer_css__WEBPACK_IMPORTED_MODULE_4___default.a.startTrimHandle) }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", { src: _icon_handle_svg__WEBPACK_IMPORTED_MODULE_5___default.a })), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_audio_trimmer_css__WEBPACK_IMPORTED_MODULE_4___default.a.trimHandle, _audio_trimmer_css__WEBPACK_IMPORTED_MODULE_4___default.a.bottomTrimHandle, _audio_trimmer_css__WEBPACK_IMPORTED_MODULE_4___default.a.startTrimHandle) }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", { src: _icon_handle_svg__WEBPACK_IMPORTED_MODULE_5___default.a })))), props.playhead ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _audio_trimmer_css__WEBPACK_IMPORTED_MODULE_4___default.a.playheadContainer }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_audio_trimmer_css__WEBPACK_IMPORTED_MODULE_4___default.a.trimLine, _audio_trimmer_css__WEBPACK_IMPORTED_MODULE_4___default.a.playhead), style: { transform: "translateX(".concat(100 * props.playhead, "%)") } })) : null, props.trimEnd === null ? null : react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_audio_trimmer_css__WEBPACK_IMPORTED_MODULE_4___default.a.absolute, _audio_trimmer_css__WEBPACK_IMPORTED_MODULE_4___default.a.trimBackground, _audio_trimmer_css__WEBPACK_IMPORTED_MODULE_4___default.a.endTrimBackground), style: { left: "".concat(100 * props.trimEnd, "%"), width: "".concat(100 - 100 * props.trimEnd, "%") }, onMouseDown: props.onTrimEndMouseDown, onTouchStart: props.onTrimEndMouseDown }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_audio_trimmer_css__WEBPACK_IMPORTED_MODULE_4___default.a.absolute, _audio_trimmer_css__WEBPACK_IMPORTED_MODULE_4___default.a.trimBackgroundMask) }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_audio_trimmer_css__WEBPACK_IMPORTED_MODULE_4___default.a.trimLine, _audio_trimmer_css__WEBPACK_IMPORTED_MODULE_4___default.a.endTrimLine) }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_audio_trimmer_css__WEBPACK_IMPORTED_MODULE_4___default.a.trimHandle, _audio_trimmer_css__WEBPACK_IMPORTED_MODULE_4___default.a.topTrimHandle, _audio_trimmer_css__WEBPACK_IMPORTED_MODULE_4___default.a.endTrimHandle) }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", { src: _icon_handle_svg__WEBPACK_IMPORTED_MODULE_5___default.a })), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_audio_trimmer_css__WEBPACK_IMPORTED_MODULE_4___default.a.trimHandle, _audio_trimmer_css__WEBPACK_IMPORTED_MODULE_4___default.a.bottomTrimHandle, _audio_trimmer_css__WEBPACK_IMPORTED_MODULE_4___default.a.endTrimHandle) }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", { src: _icon_handle_svg__WEBPACK_IMPORTED_MODULE_5___default.a }))))); }; AudioTrimmer.propTypes = { containerRef: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onTrimEndMouseDown: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onTrimStartMouseDown: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, playhead: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number, trimEnd: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number, trimStart: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number }; /* harmony default export */ __webpack_exports__["default"] = (AudioTrimmer); /***/ }), /***/ "./src/components/audio-trimmer/icon--handle.svg": /*!*******************************************************!*\ !*** ./src/components/audio-trimmer/icon--handle.svg ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/3eb63579853c3f4c5323a51dcf4104ac.svg"; /***/ }), /***/ "./src/components/backpack/backpack.css": /*!**********************************************!*\ !*** ./src/components/backpack/backpack.css ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./backpack.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/backpack/backpack.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/backpack/backpack.jsx": /*!**********************************************!*\ !*** ./src/components/backpack/backpack.jsx ***! \**********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _lib_drag_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../lib/drag-constants */ "./src/lib/drag-constants.js"); /* harmony import */ var _coming_soon_coming_soon_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../coming-soon/coming-soon.jsx */ "./src/components/coming-soon/coming-soon.jsx"); /* harmony import */ var _containers_sprite_selector_item_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../containers/sprite-selector-item.jsx */ "./src/containers/sprite-selector-item.jsx"); /* harmony import */ var _backpack_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./backpack.css */ "./src/components/backpack/backpack.css"); /* harmony import */ var _backpack_css__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_backpack_css__WEBPACK_IMPORTED_MODULE_7__); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } // TODO make sprite selector item not require onClick var noop = function noop() {}; var dragTypeMap = { // Keys correspond with the backpack-server item types costume: _lib_drag_constants__WEBPACK_IMPORTED_MODULE_4__["default"].BACKPACK_COSTUME, sound: _lib_drag_constants__WEBPACK_IMPORTED_MODULE_4__["default"].BACKPACK_SOUND, script: _lib_drag_constants__WEBPACK_IMPORTED_MODULE_4__["default"].BACKPACK_CODE, sprite: _lib_drag_constants__WEBPACK_IMPORTED_MODULE_4__["default"].BACKPACK_SPRITE }; var Backpack = function Backpack(_ref) { var blockDragOver = _ref.blockDragOver, containerRef = _ref.containerRef, contents = _ref.contents, dragOver = _ref.dragOver, error = _ref.error, expanded = _ref.expanded, loading = _ref.loading, showMore = _ref.showMore, onToggle = _ref.onToggle, onDelete = _ref.onDelete, onMouseEnter = _ref.onMouseEnter, onMouseLeave = _ref.onMouseLeave, onMore = _ref.onMore; return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _backpack_css__WEBPACK_IMPORTED_MODULE_7___default.a.backpackContainer }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _backpack_css__WEBPACK_IMPORTED_MODULE_7___default.a.backpackHeader, onClick: onToggle }, onToggle ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "Backpack", id: "gui.backpack.header" }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_coming_soon_coming_soon_jsx__WEBPACK_IMPORTED_MODULE_5__["ComingSoonTooltip"], { place: "top", tooltipId: "backpack-tooltip" }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "Backpack", id: "gui.backpack.header" }))), expanded ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_backpack_css__WEBPACK_IMPORTED_MODULE_7___default.a.backpackList, _defineProperty({}, _backpack_css__WEBPACK_IMPORTED_MODULE_7___default.a.dragOver, dragOver || blockDragOver)), ref: containerRef, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave }, error ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _backpack_css__WEBPACK_IMPORTED_MODULE_7___default.a.statusMessage }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "Error loading backpack", id: "gui.backpack.errorBackpack" })) : loading ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _backpack_css__WEBPACK_IMPORTED_MODULE_7___default.a.statusMessage }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "Loading...", id: "gui.backpack.loadingBackpack" })) : contents.length > 0 ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _backpack_css__WEBPACK_IMPORTED_MODULE_7___default.a.backpackListInner }, contents.map(function (item) { return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_containers_sprite_selector_item_jsx__WEBPACK_IMPORTED_MODULE_6__["default"], { className: _backpack_css__WEBPACK_IMPORTED_MODULE_7___default.a.backpackItem, costumeURL: item.thumbnailUrl, details: item.name, dragPayload: item, dragType: dragTypeMap[item.type], id: item.id, key: item.id, name: item.type, selected: false, onClick: noop, onDeleteButtonClick: onDelete }); }), showMore && react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", { className: _backpack_css__WEBPACK_IMPORTED_MODULE_7___default.a.more, onClick: onMore }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "More", id: "gui.backpack.more" }))) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _backpack_css__WEBPACK_IMPORTED_MODULE_7___default.a.statusMessage }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "Backpack is empty", id: "gui.backpack.emptyBackpack" }))) : null); }; Backpack.propTypes = { blockDragOver: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, containerRef: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, contents: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.shape({ id: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, thumbnailUrl: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, type: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, name: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string })), dragOver: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, error: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, expanded: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, loading: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, onDelete: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onMore: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onMouseEnter: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onMouseLeave: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onToggle: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, showMore: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool }; Backpack.defaultProps = { blockDragOver: false, contents: [], dragOver: false, expanded: false, loading: false, showMore: false, onMore: null, onToggle: null }; /* harmony default export */ __webpack_exports__["default"] = (Backpack); /***/ }), /***/ "./src/components/blocks/blocks.css": /*!******************************************!*\ !*** ./src/components/blocks/blocks.css ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./blocks.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/blocks/blocks.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/blocks/blocks.jsx": /*!******************************************!*\ !*** ./src/components/blocks/blocks.jsx ***! \******************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _blocks_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./blocks.css */ "./src/components/blocks/blocks.css"); /* harmony import */ var _blocks_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_blocks_css__WEBPACK_IMPORTED_MODULE_4__); function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } var BlocksComponent = function BlocksComponent(props) { var containerRef = props.containerRef, dragOver = props.dragOver, componentProps = _objectWithoutProperties(props, ["containerRef", "dragOver"]); return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], _extends({ className: classnames__WEBPACK_IMPORTED_MODULE_1___default()(_blocks_css__WEBPACK_IMPORTED_MODULE_4___default.a.blocks, _defineProperty({}, _blocks_css__WEBPACK_IMPORTED_MODULE_4___default.a.dragOver, dragOver)) }, componentProps, { componentRef: containerRef })); }; BlocksComponent.propTypes = { containerRef: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, dragOver: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool }; /* harmony default export */ __webpack_exports__["default"] = (BlocksComponent); /***/ }), /***/ "./src/components/box/box.css": /*!************************************!*\ !*** ./src/components/box/box.css ***! \************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./box.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/box/box.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/box/box.jsx": /*!************************************!*\ !*** ./src/components/box/box.jsx ***! \************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_style_proptype__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-style-proptype */ "./node_modules/react-style-proptype/src/index.js"); /* harmony import */ var react_style_proptype__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_style_proptype__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _box_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./box.css */ "./src/components/box/box.css"); /* harmony import */ var _box_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_box_css__WEBPACK_IMPORTED_MODULE_4__); function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } var getRandomColor = function () { // In "DEBUG" mode this is used to output a random background color for each // box. The function gives the same "random" set for each seed, allowing re- // renders of the same content to give the same random display. var random = function (seed) { var mW = seed; var mZ = 987654321; var mask = 0xffffffff; return function () { mZ = 36969 * (mZ & 65535) + (mZ >> 16) & mask; mW = 18000 * (mW & 65535) + (mW >> 16) & mask; var result = (mZ << 16) + mW & mask; result /= 4294967296; return result + 1; }; }(601); return function () { var r = Math.max(parseInt(random() * 100, 10) % 256, 1); var g = Math.max(parseInt(random() * 100, 10) % 256, 1); var b = Math.max(parseInt(random() * 100, 10) % 256, 1); return "rgb(".concat(r, ",").concat(g, ",").concat(b, ")"); }; }(); var Box = function Box(props) { var alignContent = props.alignContent, alignItems = props.alignItems, alignSelf = props.alignSelf, basis = props.basis, children = props.children, className = props.className, componentRef = props.componentRef, direction = props.direction, element = props.element, grow = props.grow, height = props.height, justifyContent = props.justifyContent, width = props.width, wrap = props.wrap, shrink = props.shrink, style = props.style, componentProps = _objectWithoutProperties(props, ["alignContent", "alignItems", "alignSelf", "basis", "children", "className", "componentRef", "direction", "element", "grow", "height", "justifyContent", "width", "wrap", "shrink", "style"]); return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(element, _objectSpread({ className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(className, _box_css__WEBPACK_IMPORTED_MODULE_4___default.a.box), ref: componentRef, style: Object.assign({ alignContent: alignContent, alignItems: alignItems, alignSelf: alignSelf, flexBasis: basis, flexDirection: direction, flexGrow: grow, flexShrink: shrink, flexWrap: wrap, justifyContent: justifyContent, width: width, height: height }, false ? undefined : {}, style) }, componentProps), children); }; Box.propTypes = { /** Defines how the browser distributes space between and around content items vertically within this box. */ alignContent: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOf(['flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'stretch']), /** Defines how the browser distributes space between and around flex items horizontally within this box. */ alignItems: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOf(['flex-start', 'flex-end', 'center', 'baseline', 'stretch']), /** Specifies how this box should be aligned inside of its container (requires the container to be flexable). */ alignSelf: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOf(['auto', 'flex-start', 'flex-end', 'center', 'baseline', 'stretch']), /** Specifies the initial length of this box */ basis: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOf(['auto'])]), /** Specifies the the HTML nodes which will be child elements of this box. */ children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node, /** Specifies the class name that will be set on this box */ className: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, /** * A callback function whose first parameter is the underlying dom elements. * This call back will be executed immediately after the component is mounted or unmounted */ componentRef: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, /** https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction */ direction: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOf(['row', 'row-reverse', 'column', 'column-reverse']), /** Specifies the type of HTML element of this box. Defaults to div. */ element: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, /** Specifies the flex grow factor of a flex item. */ grow: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, /** The height in pixels (if specified as a number) or a string if different units are required. */ height: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string]), /** https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content */ justifyContent: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOf(['flex-start', 'flex-end', 'center', 'space-between', 'space-around']), /** Specifies the flex shrink factor of a flex item. */ shrink: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, /** An object whose keys are css property names and whose values correspond the the css property. */ style: react_style_proptype__WEBPACK_IMPORTED_MODULE_3___default.a, /** The width in pixels (if specified as a number) or a string if different units are required. */ width: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string]), /** How whitespace should wrap within this block. */ wrap: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOf(['nowrap', 'wrap', 'wrap-reverse']) }; Box.defaultProps = { element: 'div', style: {} }; /* harmony default export */ __webpack_exports__["default"] = (Box); /***/ }), /***/ "./src/components/browser-modal/browser-modal.css": /*!********************************************************!*\ !*** ./src/components/browser-modal/browser-modal.css ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./browser-modal.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/browser-modal/browser-modal.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/browser-modal/browser-modal.jsx": /*!********************************************************!*\ !*** ./src/components/browser-modal/browser-modal.jsx ***! \********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react_modal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-modal */ "./node_modules/react-modal/lib/index.js"); /* harmony import */ var react_modal__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_modal__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _browser_modal_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./browser-modal.css */ "./src/components/browser-modal/browser-modal.css"); /* harmony import */ var _browser_modal_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_browser_modal_css__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _unsupported_browser_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./unsupported-browser.svg */ "./src/components/browser-modal/unsupported-browser.svg"); /* harmony import */ var _unsupported_browser_svg__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_unsupported_browser_svg__WEBPACK_IMPORTED_MODULE_6__); function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_4__["defineMessages"])({ label: { "id": "gui.unsupportedBrowser.label", "defaultMessage": "Browser is not supported" }, error: { "id": "gui.unsupportedBrowser.errorLabel", "defaultMessage": "An Error Occurred" } }); var BrowserModal = function BrowserModal(_ref) { var intl = _ref.intl, props = _objectWithoutProperties(_ref, ["intl"]); var label = props.error ? messages.error : messages.label; return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_modal__WEBPACK_IMPORTED_MODULE_2___default.a, { isOpen: true, className: _browser_modal_css__WEBPACK_IMPORTED_MODULE_5___default.a.modalContent, contentLabel: intl.formatMessage(_objectSpread({}, messages.label)), overlayClassName: _browser_modal_css__WEBPACK_IMPORTED_MODULE_5___default.a.modalOverlay, onRequestClose: props.onBack }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { dir: props.isRtl ? 'rtl' : 'ltr' }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _browser_modal_css__WEBPACK_IMPORTED_MODULE_5___default.a.illustration }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", { src: _unsupported_browser_svg__WEBPACK_IMPORTED_MODULE_6___default.a })), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _browser_modal_css__WEBPACK_IMPORTED_MODULE_5___default.a.body }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("h2", null, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_4__["FormattedMessage"], label)), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("p", null, props.error ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_4__["FormattedMessage"], { defaultMessage: "We are very sorry, but it looks like you are using a browser version that Scratch does not support. We recommend updating to the latest version of a supported browser such as Google Chrome, Mozilla Firefox, Microsoft Edge, or Apple Safari. ", id: "gui.unsupportedBrowser.notRecommended" }) : react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_4__["FormattedMessage"], { defaultMessage: "We are very sorry, but Scratch does not support this browser. We recommend updating to the latest version of a supported browser such as Google Chrome, Mozilla Firefox, Microsoft Edge, or Apple Safari.", id: "gui.unsupportedBrowser.description" })), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _browser_modal_css__WEBPACK_IMPORTED_MODULE_5___default.a.buttonRow }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("button", { className: _browser_modal_css__WEBPACK_IMPORTED_MODULE_5___default.a.backButton, onClick: props.onBack }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_4__["FormattedMessage"], { defaultMessage: "Back", id: "gui.unsupportedBrowser.back" }))), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _browser_modal_css__WEBPACK_IMPORTED_MODULE_5___default.a.faqLinkText }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_4__["FormattedMessage"], { defaultMessage: "To learn more, go to the {previewFaqLink}.", id: "gui.unsupportedBrowser.previewfaq", values: { previewFaqLink: react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("a", { className: _browser_modal_css__WEBPACK_IMPORTED_MODULE_5___default.a.faqLink, href: "//scratch.mit.edu/3faq" }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_4__["FormattedMessage"], { defaultMessage: "FAQ", id: "gui.unsupportedBrowser.previewfaqlinktext" })) } }))))); }; BrowserModal.propTypes = { error: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, intl: react_intl__WEBPACK_IMPORTED_MODULE_4__["intlShape"].isRequired, isRtl: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, onBack: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired }; BrowserModal.defaultProps = { error: false }; var WrappedBrowserModal = Object(react_intl__WEBPACK_IMPORTED_MODULE_4__["injectIntl"])(BrowserModal); WrappedBrowserModal.setAppElement = react_modal__WEBPACK_IMPORTED_MODULE_2___default.a.setAppElement; /* harmony default export */ __webpack_exports__["default"] = (WrappedBrowserModal); /***/ }), /***/ "./src/components/browser-modal/unsupported-browser.svg": /*!**************************************************************!*\ !*** ./src/components/browser-modal/unsupported-browser.svg ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/89a5687599f173f2b910aa5fcd862b42.svg"; /***/ }), /***/ "./src/components/button/button.css": /*!******************************************!*\ !*** ./src/components/button/button.css ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./button.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/button/button.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/button/button.jsx": /*!******************************************!*\ !*** ./src/components/button/button.jsx ***! \******************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _button_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./button.css */ "./src/components/button/button.css"); /* harmony import */ var _button_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_button_css__WEBPACK_IMPORTED_MODULE_3__); function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } var ButtonComponent = function ButtonComponent(_ref) { var className = _ref.className, disabled = _ref.disabled, iconClassName = _ref.iconClassName, iconSrc = _ref.iconSrc, onClick = _ref.onClick, children = _ref.children, props = _objectWithoutProperties(_ref, ["className", "disabled", "iconClassName", "iconSrc", "onClick", "children"]); if (disabled) { onClick = function onClick() {}; } var icon = iconSrc && react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("img", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(iconClassName, _button_css__WEBPACK_IMPORTED_MODULE_3___default.a.icon), draggable: false, src: iconSrc }); return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("span", _extends({ className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_button_css__WEBPACK_IMPORTED_MODULE_3___default.a.outlinedButton, className), role: "button", onClick: onClick }, props), icon, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _button_css__WEBPACK_IMPORTED_MODULE_3___default.a.content }, children)); }; ButtonComponent.propTypes = { children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node, className: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, disabled: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, iconClassName: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, iconSrc: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, onClick: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func }; /* harmony default export */ __webpack_exports__["default"] = (ButtonComponent); /***/ }), /***/ "./src/components/camera-modal/camera-modal.css": /*!******************************************************!*\ !*** ./src/components/camera-modal/camera-modal.css ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./camera-modal.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/camera-modal/camera-modal.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/camera-modal/camera-modal.jsx": /*!******************************************************!*\ !*** ./src/components/camera-modal/camera-modal.jsx ***! \******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _containers_modal_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../containers/modal.jsx */ "./src/containers/modal.jsx"); /* harmony import */ var _camera_modal_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./camera-modal.css */ "./src/components/camera-modal/camera-modal.css"); /* harmony import */ var _camera_modal_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_camera_modal_css__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _icon_back_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./icon--back.svg */ "./src/components/camera-modal/icon--back.svg"); /* harmony import */ var _icon_back_svg__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_icon_back_svg__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _action_menu_icon_camera_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../action-menu/icon--camera.svg */ "./src/components/action-menu/icon--camera.svg"); /* harmony import */ var _action_menu_icon_camera_svg__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_action_menu_icon_camera_svg__WEBPACK_IMPORTED_MODULE_7__); function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_2__["defineMessages"])({ cameraModalTitle: { "id": "gui.cameraModal.cameraModalTitle", "defaultMessage": "Take a Photo" }, loadingCameraMessage: { "id": "gui.cameraModal.loadingCameraMessage", "defaultMessage": "Loading Camera..." }, permissionRequest: { "id": "gui.cameraModal.permissionRequest", "defaultMessage": "We need your permission to use your camera" }, retakePhoto: { "id": "gui.cameraModal.retakePhoto", "defaultMessage": "Retake Photo" }, save: { "id": "gui.cameraModal.save", "defaultMessage": "Save" }, takePhotoButton: { "id": "gui.cameraModal.takePhoto", "defaultMessage": "Take Photo" }, loadingCaption: { "id": "gui.cameraModal.loadingCaption", "defaultMessage": "Loading..." }, enableCameraCaption: { "id": "gui.cameraModal.enableCameraCaption", "defaultMessage": "Enable Camera" } }); var CameraModal = function CameraModal(_ref) { var intl = _ref.intl, props = _objectWithoutProperties(_ref, ["intl"]); return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_containers_modal_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: _camera_modal_css__WEBPACK_IMPORTED_MODULE_5___default.a.modalContent, contentLabel: intl.formatMessage(messages.cameraModalTitle), onRequestClose: props.onCancel }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _camera_modal_css__WEBPACK_IMPORTED_MODULE_5___default.a.body }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _camera_modal_css__WEBPACK_IMPORTED_MODULE_5___default.a.cameraFeedContainer }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _camera_modal_css__WEBPACK_IMPORTED_MODULE_5___default.a.loadingText }, props.access ? intl.formatMessage(messages.loadingCameraMessage) : "\u2196\uFE0F \xA0".concat(intl.formatMessage(messages.permissionRequest))), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("canvas", { className: _camera_modal_css__WEBPACK_IMPORTED_MODULE_5___default.a.canvas // height and (below) width of the actual image // double stage dimensions to avoid the need for // resizing the captured image when importing costume // to accommodate double resolution bitmaps , height: "720", ref: props.canvasRef, width: "960" }), props.capture ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _camera_modal_css__WEBPACK_IMPORTED_MODULE_5___default.a.flashOverlay }) : null), props.capture ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _camera_modal_css__WEBPACK_IMPORTED_MODULE_5___default.a.buttonRow }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("button", { className: _camera_modal_css__WEBPACK_IMPORTED_MODULE_5___default.a.retakeButton, key: "retake-button", onClick: props.onBack }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", { draggable: false, src: _icon_back_svg__WEBPACK_IMPORTED_MODULE_6___default.a }), " ", intl.formatMessage(messages.retakePhoto)), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("button", { className: _camera_modal_css__WEBPACK_IMPORTED_MODULE_5___default.a.okButton, onClick: props.onSubmit }, " ", intl.formatMessage(messages.save))) : react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _camera_modal_css__WEBPACK_IMPORTED_MODULE_5___default.a.mainButtonRow }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("button", { className: _camera_modal_css__WEBPACK_IMPORTED_MODULE_5___default.a.mainButton, disabled: !props.loaded, key: "capture-button", onClick: props.onCapture }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", { className: _camera_modal_css__WEBPACK_IMPORTED_MODULE_5___default.a.mainIcon, draggable: false, src: _action_menu_icon_camera_svg__WEBPACK_IMPORTED_MODULE_7___default.a })), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _camera_modal_css__WEBPACK_IMPORTED_MODULE_5___default.a.helpText }, props.access ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("span", { className: props.loaded ? _camera_modal_css__WEBPACK_IMPORTED_MODULE_5___default.a.captureText : _camera_modal_css__WEBPACK_IMPORTED_MODULE_5___default.a.disabledText }, props.loaded ? intl.formatMessage(messages.takePhotoButton) : intl.formatMessage(messages.loadingCaption)) : react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("span", { className: _camera_modal_css__WEBPACK_IMPORTED_MODULE_5___default.a.disabledText }, intl.formatMessage(messages.enableCameraCaption)))))); }; CameraModal.propTypes = { access: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, canvasRef: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, capture: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, intl: react_intl__WEBPACK_IMPORTED_MODULE_2__["intlShape"].isRequired, loaded: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, onBack: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onCancel: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onCapture: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onSubmit: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_2__["injectIntl"])(CameraModal)); /***/ }), /***/ "./src/components/camera-modal/icon--back.svg": /*!****************************************************!*\ !*** ./src/components/camera-modal/icon--back.svg ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/21988681fa28c8ce37982ca26463a6f5.svg"; /***/ }), /***/ "./src/components/cards/card.css": /*!***************************************!*\ !*** ./src/components/cards/card.css ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./card.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/cards/card.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/cards/cards.jsx": /*!****************************************!*\ !*** ./src/components/cards/cards.jsx ***! \****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var react_draggable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-draggable */ "./node_modules/react-draggable/dist/react-draggable.js"); /* harmony import */ var react_draggable__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_draggable__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _card_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./card.css */ "./src/components/cards/card.css"); /* harmony import */ var _card_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_card_css__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _icon_shrink_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./icon--shrink.svg */ "./src/components/cards/icon--shrink.svg"); /* harmony import */ var _icon_shrink_svg__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_icon_shrink_svg__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _icon_expand_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./icon--expand.svg */ "./src/components/cards/icon--expand.svg"); /* harmony import */ var _icon_expand_svg__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_icon_expand_svg__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _icon_next_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./icon--next.svg */ "./src/components/cards/icon--next.svg"); /* harmony import */ var _icon_next_svg__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_icon_next_svg__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _icon_prev_svg__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./icon--prev.svg */ "./src/components/cards/icon--prev.svg"); /* harmony import */ var _icon_prev_svg__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_icon_prev_svg__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _lib_assets_icon_tutorials_svg__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../lib/assets/icon--tutorials.svg */ "./src/lib/assets/icon--tutorials.svg"); /* harmony import */ var _lib_assets_icon_tutorials_svg__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_lib_assets_icon_tutorials_svg__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _icon_close_svg__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./icon--close.svg */ "./src/components/cards/icon--close.svg"); /* harmony import */ var _icon_close_svg__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_icon_close_svg__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _lib_libraries_decks_translate_video_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../lib/libraries/decks/translate-video.js */ "./src/lib/libraries/decks/translate-video.js"); /* harmony import */ var _lib_libraries_decks_translate_image_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../lib/libraries/decks/translate-image.js */ "./src/lib/libraries/decks/translate-image.js"); function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } var CardHeader = function CardHeader(_ref) { var onCloseCards = _ref.onCloseCards, onShrinkExpandCards = _ref.onShrinkExpandCards, onShowAll = _ref.onShowAll, totalSteps = _ref.totalSteps, step = _ref.step, expanded = _ref.expanded; return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: expanded ? _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.headerButtons : classnames__WEBPACK_IMPORTED_MODULE_2___default()(_card_css__WEBPACK_IMPORTED_MODULE_5___default.a.headerButtons, _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.headerButtonsHidden) }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.allButton, onClick: onShowAll }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", { className: _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.helpIcon, src: _lib_assets_icon_tutorials_svg__WEBPACK_IMPORTED_MODULE_10___default.a }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "Tutorials", id: "gui.cards.all-tutorials" })), totalSteps > 1 ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.stepsList }, Array(totalSteps).fill(0).map(function (_, i) { return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: i === step ? _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.activeStepPip : _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.inactiveStepPip, key: "pip-step-".concat(i) }); })) : null, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.headerButtonsRight }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.shrinkExpandButton, onClick: onShrinkExpandCards }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", { draggable: false, src: expanded ? _icon_shrink_svg__WEBPACK_IMPORTED_MODULE_6___default.a : _icon_expand_svg__WEBPACK_IMPORTED_MODULE_7___default.a }), expanded ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "Shrink", id: "gui.cards.shrink" }) : react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "Expand", id: "gui.cards.expand" })), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.removeButton, onClick: onCloseCards }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", { className: _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.closeIcon, src: _icon_close_svg__WEBPACK_IMPORTED_MODULE_11___default.a }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "Close", id: "gui.cards.close" })))); }; // Video step needs to know if the card is being dragged to cover the video // so that the mouseup is not swallowed by the iframe. var VideoStep = function VideoStep(_ref2) { var video = _ref2.video, dragging = _ref2.dragging; return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.stepVideo }, dragging ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.videoCover }) : null, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("iframe", { allowFullScreen: true, allowTransparency: "true", frameBorder: "0", height: "257", scrolling: "no", src: "https://fast.wistia.net/embed/iframe/".concat(video, "?seo=false&videoFoam=true"), title: "\uD83D\uDCF9", width: "466" }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("script", { async: true, src: "https://fast.wistia.net/assets/external/E-v1.js" })); }; VideoStep.propTypes = { dragging: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool.isRequired, video: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string.isRequired }; var ImageStep = function ImageStep(_ref3) { var title = _ref3.title, image = _ref3.image; return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_1__["Fragment"], null, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.stepTitle }, title), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.stepImageContainer }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", { className: _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.stepImage, draggable: false, src: image }))); }; ImageStep.propTypes = { image: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string.isRequired, title: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.node.isRequired }; var NextPrevButtons = function NextPrevButtons(_ref4) { var isRtl = _ref4.isRtl, onNextStep = _ref4.onNextStep, onPrevStep = _ref4.onPrevStep, expanded = _ref4.expanded; return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_1__["Fragment"], null, onNextStep ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: expanded ? isRtl ? _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.leftCard : _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.rightCard : _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.hidden }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: expanded ? isRtl ? _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.leftButton : _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.rightButton : _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.hidden, onClick: onNextStep }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", { draggable: false, src: isRtl ? _icon_prev_svg__WEBPACK_IMPORTED_MODULE_9___default.a : _icon_next_svg__WEBPACK_IMPORTED_MODULE_8___default.a }))) : null, onPrevStep ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: expanded ? isRtl ? _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.rightCard : _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.leftCard : _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.hidden }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: expanded ? isRtl ? _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.rightButton : _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.leftButton : _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.hidden, onClick: onPrevStep }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", { draggable: false, src: isRtl ? _icon_next_svg__WEBPACK_IMPORTED_MODULE_8___default.a : _icon_prev_svg__WEBPACK_IMPORTED_MODULE_9___default.a }))) : null); }; NextPrevButtons.propTypes = { expanded: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool.isRequired, isRtl: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, onNextStep: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onPrevStep: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func }; CardHeader.propTypes = { expanded: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool.isRequired, onCloseCards: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onShowAll: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onShrinkExpandCards: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, step: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number, totalSteps: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number }; var PreviewsStep = function PreviewsStep(_ref5) { var deckIds = _ref5.deckIds, content = _ref5.content, onActivateDeckFactory = _ref5.onActivateDeckFactory, onShowAll = _ref5.onShowAll; return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_1__["Fragment"], null, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.stepTitle }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "More things to try!", id: "gui.cards.more-things-to-try" })), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.decks }, deckIds.slice(0, 2).map(function (id) { return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.deck, key: "deck-preview-".concat(id), onClick: onActivateDeckFactory(id) }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", { className: _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.deckImage, draggable: false, src: content[id].img }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.deckName }, content[id].name)); })), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.seeAll }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.seeAllButton, onClick: onShowAll }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "See more", id: "gui.cards.see-more" })))); }; PreviewsStep.propTypes = { content: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({ id: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({ name: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.node.isRequired, img: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string.isRequired, steps: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({ title: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.node, image: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, video: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, deckIds: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string) })) }) }).isRequired, deckIds: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string).isRequired, onActivateDeckFactory: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onShowAll: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired }; var Cards = function Cards(props) { var activeDeckId = props.activeDeckId, content = props.content, dragging = props.dragging, isRtl = props.isRtl, locale = props.locale, onActivateDeckFactory = props.onActivateDeckFactory, onCloseCards = props.onCloseCards, onShrinkExpandCards = props.onShrinkExpandCards, onDrag = props.onDrag, onStartDrag = props.onStartDrag, onEndDrag = props.onEndDrag, onShowAll = props.onShowAll, onNextStep = props.onNextStep, onPrevStep = props.onPrevStep, step = props.step, expanded = props.expanded, posProps = _objectWithoutProperties(props, ["activeDeckId", "content", "dragging", "isRtl", "locale", "onActivateDeckFactory", "onCloseCards", "onShrinkExpandCards", "onDrag", "onStartDrag", "onEndDrag", "onShowAll", "onNextStep", "onPrevStep", "step", "expanded"]); var x = posProps.x, y = posProps.y; if (activeDeckId === null) return; // Tutorial cards need to calculate their own dragging bounds // to allow for dragging the cards off the left, right and bottom // edges of the workspace. var cardHorizontalDragOffset = 400; // ~80% of card width var cardVerticalDragOffset = expanded ? 257 : 0; // ~80% of card height, if expanded var menuBarHeight = 48; // TODO: get pre-calculated from elsewhere? var wideCardWidth = 500; if (x === 0 && y === 0) { // initialize positions x = isRtl ? -190 - wideCardWidth - cardHorizontalDragOffset : 292; x += cardHorizontalDragOffset; // The tallest cards are about 320px high, and the default position is pinned // to near the bottom of the blocks palette to allow room to work above. var tallCardHeight = 320; var bottomMargin = 60; // To avoid overlapping the backpack region y = window.innerHeight - tallCardHeight - bottomMargin - menuBarHeight; } var steps = content[activeDeckId].steps; return (// Custom overlay to act as the bounding parent for the draggable, using values from above react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.cardContainerOverlay, style: { width: "".concat(window.innerWidth + 2 * cardHorizontalDragOffset, "px"), height: "".concat(window.innerHeight - menuBarHeight + cardVerticalDragOffset, "px"), top: "".concat(menuBarHeight, "px"), left: "".concat(-cardHorizontalDragOffset, "px") } }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_draggable__WEBPACK_IMPORTED_MODULE_4___default.a, { bounds: "parent", position: { x: x, y: y }, onDrag: onDrag, onStart: onStartDrag, onStop: onEndDrag }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.cardContainer }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.card }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(CardHeader, { expanded: expanded, step: step, totalSteps: steps.length, onCloseCards: onCloseCards, onShowAll: onShowAll, onShrinkExpandCards: onShrinkExpandCards }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: expanded ? _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.stepBody : _card_css__WEBPACK_IMPORTED_MODULE_5___default.a.hidden }, steps[step].deckIds ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(PreviewsStep, { content: content, deckIds: steps[step].deckIds, onActivateDeckFactory: onActivateDeckFactory, onShowAll: onShowAll }) : steps[step].video ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(VideoStep, { dragging: dragging, video: Object(_lib_libraries_decks_translate_video_js__WEBPACK_IMPORTED_MODULE_12__["translateVideo"])(steps[step].video, locale) }) : react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(ImageStep, { image: Object(_lib_libraries_decks_translate_image_js__WEBPACK_IMPORTED_MODULE_13__["translateImage"])(steps[step].image, locale), title: steps[step].title }), steps[step].trackingPixel && steps[step].trackingPixel), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(NextPrevButtons, { expanded: expanded, isRtl: isRtl, onNextStep: step < steps.length - 1 ? onNextStep : null, onPrevStep: step > 0 ? onPrevStep : null }))))) ); }; Cards.propTypes = { activeDeckId: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string.isRequired, content: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({ id: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({ name: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.node.isRequired, img: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string.isRequired, steps: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({ title: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.node, image: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, video: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, deckIds: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string) })) }) }), dragging: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool.isRequired, expanded: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool.isRequired, isRtl: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool.isRequired, locale: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string.isRequired, onActivateDeckFactory: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onCloseCards: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onDrag: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onEndDrag: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onNextStep: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onPrevStep: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onShowAll: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onShrinkExpandCards: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onStartDrag: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, step: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number.isRequired, x: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number, y: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number }; /* harmony default export */ __webpack_exports__["default"] = (Cards); /***/ }), /***/ "./src/components/cards/icon--close.svg": /*!**********************************************!*\ !*** ./src/components/cards/icon--close.svg ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/a3e689235188ba10c5cfd75730cb88a7.svg"; /***/ }), /***/ "./src/components/cards/icon--expand.svg": /*!***********************************************!*\ !*** ./src/components/cards/icon--expand.svg ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/04e28ba12fe914cf4f131dcb85ae82d6.svg"; /***/ }), /***/ "./src/components/cards/icon--next.svg": /*!*********************************************!*\ !*** ./src/components/cards/icon--next.svg ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/a80790c977586cc0595b5fe2f0bcb39a.svg"; /***/ }), /***/ "./src/components/cards/icon--prev.svg": /*!*********************************************!*\ !*** ./src/components/cards/icon--prev.svg ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/33592a76d0d0fdaa4a32b2ea41db5e16.svg"; /***/ }), /***/ "./src/components/cards/icon--shrink.svg": /*!***********************************************!*\ !*** ./src/components/cards/icon--shrink.svg ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/76121b7f4eff7d7ca0d49a45479d3f3f.svg"; /***/ }), /***/ "./src/components/close-button/close-button.css": /*!******************************************************!*\ !*** ./src/components/close-button/close-button.css ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./close-button.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/close-button/close-button.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/close-button/close-button.jsx": /*!******************************************************!*\ !*** ./src/components/close-button/close-button.jsx ***! \******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _close_button_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./close-button.css */ "./src/components/close-button/close-button.css"); /* harmony import */ var _close_button_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_close_button_css__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _icon_close_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./icon--close.svg */ "./src/components/close-button/icon--close.svg"); /* harmony import */ var _icon_close_svg__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_icon_close_svg__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _icon_close_orange_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./icon--close-orange.svg */ "./src/components/close-button/icon--close-orange.svg"); /* harmony import */ var _icon_close_orange_svg__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_icon_close_orange_svg__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _lib_assets_icon_back_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../lib/assets/icon--back.svg */ "./src/lib/assets/icon--back.svg"); /* harmony import */ var _lib_assets_icon_back_svg__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_lib_assets_icon_back_svg__WEBPACK_IMPORTED_MODULE_6__); var _closeIcons; function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var closeIcons = {}; var CloseButton = function CloseButton(props) { var _classNames; return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { "aria-label": "Close", className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_close_button_css__WEBPACK_IMPORTED_MODULE_3___default.a.closeButton, props.className, (_classNames = {}, _defineProperty(_classNames, _close_button_css__WEBPACK_IMPORTED_MODULE_3___default.a.small, props.size === CloseButton.SIZE_SMALL), _defineProperty(_classNames, _close_button_css__WEBPACK_IMPORTED_MODULE_3___default.a.large, props.size === CloseButton.SIZE_LARGE), _defineProperty(_classNames, _close_button_css__WEBPACK_IMPORTED_MODULE_3___default.a.orange, props.color === CloseButton.COLOR_ORANGE), _classNames)), role: "button", tabIndex: "0", onClick: props.onClick }, props.buttonType === 'back' ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", { className: _close_button_css__WEBPACK_IMPORTED_MODULE_3___default.a.backIcon, src: _lib_assets_icon_back_svg__WEBPACK_IMPORTED_MODULE_6___default.a }) : react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_close_button_css__WEBPACK_IMPORTED_MODULE_3___default.a.closeIcon, _defineProperty({}, _close_button_css__WEBPACK_IMPORTED_MODULE_3___default.a[props.color], props.color !== CloseButton.COLOR_NEUTRAL)), src: props.color && closeIcons[props.color] ? closeIcons[props.color] : _icon_close_svg__WEBPACK_IMPORTED_MODULE_4___default.a })); }; CloseButton.SIZE_SMALL = 'small'; CloseButton.SIZE_LARGE = 'large'; CloseButton.COLOR_NEUTRAL = 'neutral'; CloseButton.COLOR_GREEN = 'green'; CloseButton.COLOR_ORANGE = 'orange'; closeIcons = (_closeIcons = {}, _defineProperty(_closeIcons, CloseButton.COLOR_NEUTRAL, _icon_close_svg__WEBPACK_IMPORTED_MODULE_4___default.a), _defineProperty(_closeIcons, CloseButton.COLOR_GREEN, _icon_close_svg__WEBPACK_IMPORTED_MODULE_4___default.a), _defineProperty(_closeIcons, CloseButton.COLOR_ORANGE, _icon_close_orange_svg__WEBPACK_IMPORTED_MODULE_5___default.a), _closeIcons); CloseButton.propTypes = { buttonType: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.oneOf(['back', 'close']), className: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, color: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, onClick: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, size: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.oneOf([CloseButton.SIZE_SMALL, CloseButton.SIZE_LARGE]) }; CloseButton.defaultProps = { color: CloseButton.COLOR_NEUTRAL, size: CloseButton.SIZE_LARGE, buttonType: 'close' }; /* harmony default export */ __webpack_exports__["default"] = (CloseButton); /***/ }), /***/ "./src/components/close-button/icon--close-orange.svg": /*!************************************************************!*\ !*** ./src/components/close-button/icon--close-orange.svg ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/ee54d776d2cda9a3c537ac7e8f144037.svg"; /***/ }), /***/ "./src/components/close-button/icon--close.svg": /*!*****************************************************!*\ !*** ./src/components/close-button/icon--close.svg ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/cb666b99d3528f91b52f985dfb102afa.svg"; /***/ }), /***/ "./src/components/coming-soon/aww-cat.png": /*!************************************************!*\ !*** ./src/components/coming-soon/aww-cat.png ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/97926439955086f8ee4aabbd81580f17.png"; /***/ }), /***/ "./src/components/coming-soon/coming-soon.css": /*!****************************************************!*\ !*** ./src/components/coming-soon/coming-soon.css ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./coming-soon.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/coming-soon/coming-soon.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/coming-soon/coming-soon.jsx": /*!****************************************************!*\ !*** ./src/components/coming-soon/coming-soon.jsx ***! \****************************************************/ /*! exports provided: ComingSoonComponent, ComingSoonTooltip */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ComingSoonComponent", function() { return ComingSoon; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ComingSoonTooltip", function() { return ComingSoonTooltip; }); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var react_tooltip__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-tooltip */ "./node_modules/react-tooltip/dist/index.js"); /* harmony import */ var react_tooltip__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_tooltip__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _coming_soon_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./coming-soon.css */ "./src/components/coming-soon/coming-soon.css"); /* harmony import */ var _coming_soon_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_coming_soon_css__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _aww_cat_png__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./aww-cat.png */ "./src/components/coming-soon/aww-cat.png"); /* harmony import */ var _aww_cat_png__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_aww_cat_png__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _cool_cat_png__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./cool-cat.png */ "./src/components/coming-soon/cool-cat.png"); /* harmony import */ var _cool_cat_png__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_cool_cat_png__WEBPACK_IMPORTED_MODULE_8__); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_2__["defineMessages"])({ message1: { "id": "gui.comingSoon.message1", "defaultMessage": "Don't worry, we're on it {emoji}" }, message2: { "id": "gui.comingSoon.message2", "defaultMessage": "Coming Soon..." }, message3: { "id": "gui.comingSoon.message3", "defaultMessage": "We're working on it {emoji}" } }); var ComingSoonContent = /*#__PURE__*/ function (_React$Component) { _inherits(ComingSoonContent, _React$Component); function ComingSoonContent(props) { var _this; _classCallCheck(this, ComingSoonContent); _this = _possibleConstructorReturn(this, _getPrototypeOf(ComingSoonContent).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['setHide', 'setShow', 'getRandomMessage']); _this.state = { isShowing: false }; return _this; } _createClass(ComingSoonContent, [{ key: "setShow", value: function setShow() { // needed to set the opacity to 1, since the default is .9 on show this.setState({ isShowing: true }); } }, { key: "setHide", value: function setHide() { this.setState({ isShowing: false }); } }, { key: "getRandomMessage", value: function getRandomMessage() { // randomly chooses a messages from `messages` to display in the tooltip. var images = [_aww_cat_png__WEBPACK_IMPORTED_MODULE_7___default.a, _cool_cat_png__WEBPACK_IMPORTED_MODULE_8___default.a]; var messageNumber = Math.floor(Math.random() * Object.keys(messages).length) + 1; var imageNumber = Math.floor(Math.random() * Object.keys(images).length); return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_2__["FormattedMessage"], _extends({}, messages["message".concat(messageNumber)], { values: { emoji: react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("img", { className: _coming_soon_css__WEBPACK_IMPORTED_MODULE_6___default.a.comingSoonImage, src: images[imageNumber] }) } })); } }, { key: "render", value: function render() { var _classNames; return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(react_tooltip__WEBPACK_IMPORTED_MODULE_5___default.a, { afterHide: this.setHide, afterShow: this.setShow, className: classnames__WEBPACK_IMPORTED_MODULE_1___default()(_coming_soon_css__WEBPACK_IMPORTED_MODULE_6___default.a.comingSoon, this.props.className, (_classNames = {}, _defineProperty(_classNames, _coming_soon_css__WEBPACK_IMPORTED_MODULE_6___default.a.show, this.state.isShowing), _defineProperty(_classNames, _coming_soon_css__WEBPACK_IMPORTED_MODULE_6___default.a.left, this.props.place === 'left'), _defineProperty(_classNames, _coming_soon_css__WEBPACK_IMPORTED_MODULE_6___default.a.right, this.props.place === 'right'), _defineProperty(_classNames, _coming_soon_css__WEBPACK_IMPORTED_MODULE_6___default.a.top, this.props.place === 'top'), _defineProperty(_classNames, _coming_soon_css__WEBPACK_IMPORTED_MODULE_6___default.a.bottom, this.props.place === 'bottom'), _classNames)), getContent: this.getRandomMessage, id: this.props.tooltipId }); } }]); return ComingSoonContent; }(react__WEBPACK_IMPORTED_MODULE_4___default.a.Component); ComingSoonContent.propTypes = { className: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string, intl: react_intl__WEBPACK_IMPORTED_MODULE_2__["intlShape"], place: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.oneOf(['top', 'right', 'bottom', 'left']), tooltipId: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string.isRequired }; ComingSoonContent.defaultProps = { place: 'bottom' }; var ComingSoon = Object(react_intl__WEBPACK_IMPORTED_MODULE_2__["injectIntl"])(ComingSoonContent); var ComingSoonTooltip = function ComingSoonTooltip(props) { return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("div", { className: props.className }, react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("div", { "data-delay-hide": props.delayHide, "data-delay-show": props.delayShow, "data-effect": "solid", "data-for": props.tooltipId, "data-place": props.place, "data-tip": "tooltip" }, props.children), react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(ComingSoon, { className: props.tooltipClassName, place: props.place, tooltipId: props.tooltipId })); }; ComingSoonTooltip.propTypes = { children: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.node.isRequired, className: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string, delayHide: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.number, delayShow: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.number, place: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.oneOf(['top', 'right', 'bottom', 'left']), tooltipClassName: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string, tooltipId: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string.isRequired }; ComingSoonTooltip.defaultProps = { delayHide: 0, delayShow: 0 }; /***/ }), /***/ "./src/components/coming-soon/cool-cat.png": /*!*************************************************!*\ !*** ./src/components/coming-soon/cool-cat.png ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/3e83d9d800459175308f0b45b117af16.png"; /***/ }), /***/ "./src/components/connection-modal/auto-scanning-step.jsx": /*!****************************************************************!*\ !*** ./src/components/connection-modal/auto-scanning-step.jsx ***! \****************************************************************/ /*! exports provided: default, PHASES */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AutoScanningStep; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PHASES", function() { return PHASES; }); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var keymirror__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! keymirror */ "./node_modules/keymirror/index.js"); /* harmony import */ var keymirror__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(keymirror__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _dots_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./dots.jsx */ "./src/components/connection-modal/dots.jsx"); /* harmony import */ var _close_button_icon_close_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../close-button/icon--close.svg */ "./src/components/close-button/icon--close.svg"); /* harmony import */ var _close_button_icon_close_svg__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_close_button_icon_close_svg__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _icons_searching_png__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./icons/searching.png */ "./src/components/connection-modal/icons/searching.png"); /* harmony import */ var _icons_searching_png__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_icons_searching_png__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _icons_bluetooth_white_svg__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./icons/bluetooth-white.svg */ "./src/components/connection-modal/icons/bluetooth-white.svg"); /* harmony import */ var _icons_bluetooth_white_svg__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_icons_bluetooth_white_svg__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _icons_back_svg__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./icons/back.svg */ "./src/components/connection-modal/icons/back.svg"); /* harmony import */ var _icons_back_svg__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_icons_back_svg__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _connection_modal_css__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./connection-modal.css */ "./src/components/connection-modal/connection-modal.css"); /* harmony import */ var _connection_modal_css__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_connection_modal_css__WEBPACK_IMPORTED_MODULE_11__); var PHASES = keymirror__WEBPACK_IMPORTED_MODULE_3___default()({ prescan: null, pressbutton: null, notfound: null }); var AutoScanningStep = function AutoScanningStep(props) { return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_11___default.a.body }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_11___default.a.activityArea }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_11___default.a.activityAreaInfo }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_11___default.a.centeredRow }, props.phase === PHASES.prescan && react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_2___default.a.Fragment, null, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("img", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_11___default.a.radarBig, src: _icons_searching_png__WEBPACK_IMPORTED_MODULE_8___default.a }), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("img", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_11___default.a.bluetoothCenteredIcon, src: _icons_bluetooth_white_svg__WEBPACK_IMPORTED_MODULE_9___default.a })), props.phase === PHASES.pressbutton && react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_2___default.a.Fragment, null, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("img", { className: classnames__WEBPACK_IMPORTED_MODULE_4___default()(_connection_modal_css__WEBPACK_IMPORTED_MODULE_11___default.a.radarBig, _connection_modal_css__WEBPACK_IMPORTED_MODULE_11___default.a.radarSpin), src: _icons_searching_png__WEBPACK_IMPORTED_MODULE_8___default.a }), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("img", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_11___default.a.connectionTipIcon, src: props.connectionTipIconURL })), props.phase === PHASES.notfound && react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_11___default.a.instructions }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_0__["FormattedMessage"], { defaultMessage: "No devices found", id: "gui.connection.auto-scanning.noPeripheralsFound" }))))), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_11___default.a.bottomArea }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_4___default()(_connection_modal_css__WEBPACK_IMPORTED_MODULE_11___default.a.bottomAreaItem, _connection_modal_css__WEBPACK_IMPORTED_MODULE_11___default.a.instructions) }, props.phase === PHASES.prescan && react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_0__["FormattedMessage"], { defaultMessage: "Have your device nearby, then begin searching.", id: "gui.connection.auto-scanning.prescan" }), props.phase === PHASES.pressbutton && react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_0__["FormattedMessage"], { defaultMessage: "Press the button on your device.", id: "gui.connection.auto-scanning.pressbutton" })), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_dots_jsx__WEBPACK_IMPORTED_MODULE_6__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_11___default.a.bottomAreaItem, counter: 0, total: 3 }), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_4___default()(_connection_modal_css__WEBPACK_IMPORTED_MODULE_11___default.a.bottomAreaItem, _connection_modal_css__WEBPACK_IMPORTED_MODULE_11___default.a.buttonRow) }, props.phase === PHASES.prescan && react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("button", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_11___default.a.connectionButton, onClick: props.onStartScan }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_0__["FormattedMessage"], { defaultMessage: "Start Searching", id: "gui.connection.auto-scanning.start-search" })), props.phase === PHASES.pressbutton && react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_11___default.a.segmentedButton }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("button", { disabled: true, className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_11___default.a.connectionButton }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_0__["FormattedMessage"], { defaultMessage: "Searching...", id: "gui.connection.connecting-searchbutton" })), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("button", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_11___default.a.connectionButton, onClick: props.onRefresh }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("img", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_11___default.a.abortConnectingIcon, src: _close_button_icon_close_svg__WEBPACK_IMPORTED_MODULE_7___default.a }))), props.phase === PHASES.notfound && react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("button", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_11___default.a.connectionButton, onClick: props.onRefresh }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("img", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_11___default.a.buttonIconLeft, src: _icons_back_svg__WEBPACK_IMPORTED_MODULE_10___default.a }), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_0__["FormattedMessage"], { defaultMessage: "Try again", id: "gui.connection.auto-scanning.try-again" }))))); }; AutoScanningStep.propTypes = { connectionTipIconURL: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, onRefresh: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onStartScan: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, phase: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOf(Object.keys(PHASES)) }; AutoScanningStep.defaultProps = { phase: PHASES.prescan }; /***/ }), /***/ "./src/components/connection-modal/connected-step.jsx": /*!************************************************************!*\ !*** ./src/components/connection-modal/connected-step.jsx ***! \************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _dots_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./dots.jsx */ "./src/components/connection-modal/dots.jsx"); /* harmony import */ var _icons_bluetooth_white_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./icons/bluetooth-white.svg */ "./src/components/connection-modal/icons/bluetooth-white.svg"); /* harmony import */ var _icons_bluetooth_white_svg__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_icons_bluetooth_white_svg__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _connection_modal_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./connection-modal.css */ "./src/components/connection-modal/connection-modal.css"); /* harmony import */ var _connection_modal_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_connection_modal_css__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_7__); var ConnectedStep = function ConnectedStep(props) { return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.body }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.activityArea }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.centeredRow }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.peripheralActivity }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("img", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.peripheralActivityIcon, src: props.connectionIconURL }), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("img", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.bluetoothConnectedIcon, src: _icons_bluetooth_white_svg__WEBPACK_IMPORTED_MODULE_5___default.a })))), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.bottomArea }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_7___default()(_connection_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.bottomAreaItem, _connection_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.instructions) }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_0__["FormattedMessage"], { defaultMessage: "Connected", id: "gui.connection.connected" })), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_dots_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { success: true, className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.bottomAreaItem, total: 3 }), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_7___default()(_connection_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.bottomAreaItem, _connection_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.cornerButtons) }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("button", { className: classnames__WEBPACK_IMPORTED_MODULE_7___default()(_connection_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.redButton, _connection_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.connectionButton), onClick: props.onDisconnect }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_0__["FormattedMessage"], { defaultMessage: "Disconnect", id: "gui.connection.disconnect" })), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("button", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.connectionButton, onClick: props.onCancel }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_0__["FormattedMessage"], { defaultMessage: "Go to Editor", id: "gui.connection.go-to-editor" }))))); }; ConnectedStep.propTypes = { connectionIconURL: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string.isRequired, onCancel: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onDisconnect: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func }; /* harmony default export */ __webpack_exports__["default"] = (ConnectedStep); /***/ }), /***/ "./src/components/connection-modal/connecting-step.jsx": /*!*************************************************************!*\ !*** ./src/components/connection-modal/connecting-step.jsx ***! \*************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _dots_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./dots.jsx */ "./src/components/connection-modal/dots.jsx"); /* harmony import */ var _icons_bluetooth_white_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./icons/bluetooth-white.svg */ "./src/components/connection-modal/icons/bluetooth-white.svg"); /* harmony import */ var _icons_bluetooth_white_svg__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_icons_bluetooth_white_svg__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _close_button_icon_close_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../close-button/icon--close.svg */ "./src/components/close-button/icon--close.svg"); /* harmony import */ var _close_button_icon_close_svg__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_close_button_icon_close_svg__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _connection_modal_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./connection-modal.css */ "./src/components/connection-modal/connection-modal.css"); /* harmony import */ var _connection_modal_css__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_connection_modal_css__WEBPACK_IMPORTED_MODULE_8__); var ConnectingStep = function ConnectingStep(props) { return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_8___default.a.body }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_8___default.a.activityArea }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_8___default.a.centeredRow }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_8___default.a.peripheralActivity }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("img", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_8___default.a.peripheralActivityIcon, src: props.connectionIconURL }), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("img", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_8___default.a.bluetoothConnectingIcon, src: _icons_bluetooth_white_svg__WEBPACK_IMPORTED_MODULE_6___default.a })))), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_8___default.a.bottomArea }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_3___default()(_connection_modal_css__WEBPACK_IMPORTED_MODULE_8___default.a.bottomAreaItem, _connection_modal_css__WEBPACK_IMPORTED_MODULE_8___default.a.instructions) }, props.connectingMessage), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_dots_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_8___default.a.bottomAreaItem, counter: 1, total: 3 }), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_3___default()(_connection_modal_css__WEBPACK_IMPORTED_MODULE_8___default.a.bottomAreaItem, _connection_modal_css__WEBPACK_IMPORTED_MODULE_8___default.a.segmentedButton) }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("button", { disabled: true, className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_8___default.a.connectionButton }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_0__["FormattedMessage"], { defaultMessage: "Connecting...", id: "gui.connection.connecting-cancelbutton" })), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("button", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_8___default.a.connectionButton, onClick: props.onDisconnect }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("img", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_8___default.a.abortConnectingIcon, src: _close_button_icon_close_svg__WEBPACK_IMPORTED_MODULE_7___default.a }))))); }; ConnectingStep.propTypes = { connectingMessage: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node.isRequired, connectionIconURL: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string.isRequired, onDisconnect: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func }; /* harmony default export */ __webpack_exports__["default"] = (ConnectingStep); /***/ }), /***/ "./src/components/connection-modal/connection-modal.css": /*!**************************************************************!*\ !*** ./src/components/connection-modal/connection-modal.css ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./connection-modal.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/connection-modal/connection-modal.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/connection-modal/connection-modal.jsx": /*!**************************************************************!*\ !*** ./src/components/connection-modal/connection-modal.jsx ***! \**************************************************************/ /*! exports provided: default, PHASES */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ConnectionModalComponent; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PHASES", function() { return PHASES; }); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var keymirror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! keymirror */ "./node_modules/keymirror/index.js"); /* harmony import */ var keymirror__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(keymirror__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _containers_modal_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../containers/modal.jsx */ "./src/containers/modal.jsx"); /* harmony import */ var _containers_scanning_step_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../containers/scanning-step.jsx */ "./src/containers/scanning-step.jsx"); /* harmony import */ var _containers_auto_scanning_step_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../containers/auto-scanning-step.jsx */ "./src/containers/auto-scanning-step.jsx"); /* harmony import */ var _connecting_step_jsx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./connecting-step.jsx */ "./src/components/connection-modal/connecting-step.jsx"); /* harmony import */ var _connected_step_jsx__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./connected-step.jsx */ "./src/components/connection-modal/connected-step.jsx"); /* harmony import */ var _error_step_jsx__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./error-step.jsx */ "./src/components/connection-modal/error-step.jsx"); /* harmony import */ var _unavailable_step_jsx__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./unavailable-step.jsx */ "./src/components/connection-modal/unavailable-step.jsx"); /* harmony import */ var _connection_modal_css__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./connection-modal.css */ "./src/components/connection-modal/connection-modal.css"); /* harmony import */ var _connection_modal_css__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_connection_modal_css__WEBPACK_IMPORTED_MODULE_11__); var PHASES = keymirror__WEBPACK_IMPORTED_MODULE_2___default()({ scanning: null, connecting: null, connected: null, error: null, unavailable: null }); var ConnectionModalComponent = function ConnectionModalComponent(props) { return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_containers_modal_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_11___default.a.modalContent, contentLabel: props.name, headerClassName: _connection_modal_css__WEBPACK_IMPORTED_MODULE_11___default.a.header, headerImage: props.connectionSmallIconURL, id: "connectionModal", onHelp: props.onHelp, onRequestClose: props.onCancel }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_11___default.a.body }, props.phase === PHASES.scanning && !props.useAutoScan && react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_containers_scanning_step_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], props), props.phase === PHASES.scanning && props.useAutoScan && react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_containers_auto_scanning_step_jsx__WEBPACK_IMPORTED_MODULE_6__["default"], props), props.phase === PHASES.connecting && react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_connecting_step_jsx__WEBPACK_IMPORTED_MODULE_7__["default"], props), props.phase === PHASES.connected && react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_connected_step_jsx__WEBPACK_IMPORTED_MODULE_8__["default"], props), props.phase === PHASES.error && react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_error_step_jsx__WEBPACK_IMPORTED_MODULE_9__["default"], props), props.phase === PHASES.unavailable && react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_unavailable_step_jsx__WEBPACK_IMPORTED_MODULE_10__["default"], props))); }; ConnectionModalComponent.propTypes = { connectingMessage: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.node.isRequired, connectionSmallIconURL: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, connectionTipIconURL: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, name: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.node, onCancel: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onHelp: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, phase: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.oneOf(Object.keys(PHASES)).isRequired, title: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string.isRequired, useAutoScan: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool.isRequired }; ConnectionModalComponent.defaultProps = { connectingMessage: 'Connecting' }; /***/ }), /***/ "./src/components/connection-modal/dots.jsx": /*!**************************************************!*\ !*** ./src/components/connection-modal/dots.jsx ***! \**************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _connection_modal_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./connection-modal.css */ "./src/components/connection-modal/connection-modal.css"); /* harmony import */ var _connection_modal_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_connection_modal_css__WEBPACK_IMPORTED_MODULE_4__); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var Dots = function Dots(props) { var _classNames; return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(props.className, _connection_modal_css__WEBPACK_IMPORTED_MODULE_4___default.a.dotsRow) }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_connection_modal_css__WEBPACK_IMPORTED_MODULE_4___default.a.dotsHolder, (_classNames = {}, _defineProperty(_classNames, _connection_modal_css__WEBPACK_IMPORTED_MODULE_4___default.a.dotsHolderError, props.error), _defineProperty(_classNames, _connection_modal_css__WEBPACK_IMPORTED_MODULE_4___default.a.dotsHolderSuccess, props.success), _classNames)) }, Array(props.total).fill(0).map(function (_, i) { var type = 'inactive'; if (props.counter === i) type = 'active'; if (props.success) type = 'success'; if (props.error) type = 'error'; return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(Dot, { key: "dot-".concat(i), type: type }); }))); }; Dots.propTypes = { className: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, counter: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number, error: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, success: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, total: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number }; var Dot = function Dot(props) { var _classNames2; return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_connection_modal_css__WEBPACK_IMPORTED_MODULE_4___default.a.dot, (_classNames2 = {}, _defineProperty(_classNames2, _connection_modal_css__WEBPACK_IMPORTED_MODULE_4___default.a.inactiveStepDot, props.type === 'inactive'), _defineProperty(_classNames2, _connection_modal_css__WEBPACK_IMPORTED_MODULE_4___default.a.activeStepDot, props.type === 'active'), _defineProperty(_classNames2, _connection_modal_css__WEBPACK_IMPORTED_MODULE_4___default.a.successDot, props.type === 'success'), _defineProperty(_classNames2, _connection_modal_css__WEBPACK_IMPORTED_MODULE_4___default.a.errorDot, props.type === 'error'), _classNames2)) }); }; Dot.propTypes = { type: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string }; /* harmony default export */ __webpack_exports__["default"] = (Dots); /***/ }), /***/ "./src/components/connection-modal/error-step.jsx": /*!********************************************************!*\ !*** ./src/components/connection-modal/error-step.jsx ***! \********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _dots_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./dots.jsx */ "./src/components/connection-modal/dots.jsx"); /* harmony import */ var _icons_help_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./icons/help.svg */ "./src/components/connection-modal/icons/help.svg"); /* harmony import */ var _icons_help_svg__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_icons_help_svg__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _icons_back_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./icons/back.svg */ "./src/components/connection-modal/icons/back.svg"); /* harmony import */ var _icons_back_svg__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_icons_back_svg__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _connection_modal_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./connection-modal.css */ "./src/components/connection-modal/connection-modal.css"); /* harmony import */ var _connection_modal_css__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_connection_modal_css__WEBPACK_IMPORTED_MODULE_8__); var ErrorStep = function ErrorStep(props) { return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_8___default.a.body }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_8___default.a.activityArea }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_8___default.a.centeredRow }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_8___default.a.peripheralActivity }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("img", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_8___default.a.peripheralActivityIcon, src: props.connectionIconURL })))), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_8___default.a.bottomArea }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_connection_modal_css__WEBPACK_IMPORTED_MODULE_8___default.a.bottomAreaItem, _connection_modal_css__WEBPACK_IMPORTED_MODULE_8___default.a.instructions) }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_0__["FormattedMessage"], { defaultMessage: "Oops, looks like something went wrong.", id: "gui.connection.error.errorMessage" })), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_dots_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { error: true, className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_8___default.a.bottomAreaItem, total: 3 }), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_connection_modal_css__WEBPACK_IMPORTED_MODULE_8___default.a.bottomAreaItem, _connection_modal_css__WEBPACK_IMPORTED_MODULE_8___default.a.buttonRow) }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("button", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_8___default.a.connectionButton, onClick: props.onScanning }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("img", { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_connection_modal_css__WEBPACK_IMPORTED_MODULE_8___default.a.buttonIconLeft, _connection_modal_css__WEBPACK_IMPORTED_MODULE_8___default.a.buttonIconBack), src: _icons_back_svg__WEBPACK_IMPORTED_MODULE_7___default.a }), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_0__["FormattedMessage"], { defaultMessage: "Try again", id: "gui.connection.error.tryagainbutton" })), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("button", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_8___default.a.connectionButton, onClick: props.onHelp }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("img", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_8___default.a.buttonIconLeft, src: _icons_help_svg__WEBPACK_IMPORTED_MODULE_6___default.a }), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_0__["FormattedMessage"], { defaultMessage: "Help", id: "gui.connection.error.helpbutton" }))))); }; ErrorStep.propTypes = { connectionIconURL: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string.isRequired, onHelp: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onScanning: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func }; /* harmony default export */ __webpack_exports__["default"] = (ErrorStep); /***/ }), /***/ "./src/components/connection-modal/icons/back.svg": /*!********************************************************!*\ !*** ./src/components/connection-modal/icons/back.svg ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/42157e6edddc19588c3c2ff188703799.svg"; /***/ }), /***/ "./src/components/connection-modal/icons/bluetooth-white.svg": /*!*******************************************************************!*\ !*** ./src/components/connection-modal/icons/bluetooth-white.svg ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/0fd9fd69a38ab79358df5a77b29702c8.svg"; /***/ }), /***/ "./src/components/connection-modal/icons/bluetooth.svg": /*!*************************************************************!*\ !*** ./src/components/connection-modal/icons/bluetooth.svg ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/8b8f2d052b4092ec47ad66c30c8b1642.svg"; /***/ }), /***/ "./src/components/connection-modal/icons/help.svg": /*!********************************************************!*\ !*** ./src/components/connection-modal/icons/help.svg ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/4b6100c9f591be6470cdfd4697de0b54.svg"; /***/ }), /***/ "./src/components/connection-modal/icons/refresh.svg": /*!***********************************************************!*\ !*** ./src/components/connection-modal/icons/refresh.svg ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/71655cde34ae75f48cb8820abf4b31e7.svg"; /***/ }), /***/ "./src/components/connection-modal/icons/scratchlink.svg": /*!***************************************************************!*\ !*** ./src/components/connection-modal/icons/scratchlink.svg ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/05e05756b592740a3670417b4df19ca9.svg"; /***/ }), /***/ "./src/components/connection-modal/icons/searching.png": /*!*************************************************************!*\ !*** ./src/components/connection-modal/icons/searching.png ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/572a212c2e777e3a9061c97453497009.png"; /***/ }), /***/ "./src/components/connection-modal/peripheral-tile.jsx": /*!*************************************************************!*\ !*** ./src/components/connection-modal/peripheral-tile.jsx ***! \*************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _connection_modal_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./connection-modal.css */ "./src/components/connection-modal/connection-modal.css"); /* harmony import */ var _connection_modal_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_connection_modal_css__WEBPACK_IMPORTED_MODULE_6__); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var PeripheralTile = /*#__PURE__*/ function (_React$Component) { _inherits(PeripheralTile, _React$Component); function PeripheralTile(props) { var _this; _classCallCheck(this, PeripheralTile); _this = _possibleConstructorReturn(this, _getPrototypeOf(PeripheralTile).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_4___default()(_assertThisInitialized(_this), ['handleConnecting']); return _this; } _createClass(PeripheralTile, [{ key: "handleConnecting", value: function handleConnecting() { this.props.onConnecting(this.props.peripheralId); } }, { key: "render", value: function render() { return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.peripheralTile }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.peripheralTileName }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("img", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.peripheralTileImage, src: this.props.connectionSmallIconURL }), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.peripheralTileNameWrapper }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.peripheralTileNameLabel }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_0__["FormattedMessage"], { defaultMessage: "Device name", id: "gui.connection.peripheral-name-label" })), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.peripheralTileNameText }, this.props.name))), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.peripheralTileWidgets }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.signalStrengthMeter }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_connection_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.signalBar, _defineProperty({}, _connection_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.greenBar, this.props.rssi > -80)) }), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_connection_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.signalBar, _defineProperty({}, _connection_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.greenBar, this.props.rssi > -60)) }), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_connection_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.signalBar, _defineProperty({}, _connection_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.greenBar, this.props.rssi > -40)) }), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_connection_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.signalBar, _defineProperty({}, _connection_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.greenBar, this.props.rssi > -20)) })), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("button", { onClick: this.handleConnecting }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_0__["FormattedMessage"], { defaultMessage: "Connect", id: "gui.connection.connect" })))); } }]); return PeripheralTile; }(react__WEBPACK_IMPORTED_MODULE_3___default.a.Component); PeripheralTile.propTypes = { connectionSmallIconURL: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, name: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, onConnecting: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, peripheralId: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, rssi: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number }; /* harmony default export */ __webpack_exports__["default"] = (PeripheralTile); /***/ }), /***/ "./src/components/connection-modal/scanning-step.jsx": /*!***********************************************************!*\ !*** ./src/components/connection-modal/scanning-step.jsx ***! \***********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _peripheral_tile_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./peripheral-tile.jsx */ "./src/components/connection-modal/peripheral-tile.jsx"); /* harmony import */ var _dots_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./dots.jsx */ "./src/components/connection-modal/dots.jsx"); /* harmony import */ var _icons_searching_png__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./icons/searching.png */ "./src/components/connection-modal/icons/searching.png"); /* harmony import */ var _icons_searching_png__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_icons_searching_png__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _icons_refresh_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./icons/refresh.svg */ "./src/components/connection-modal/icons/refresh.svg"); /* harmony import */ var _icons_refresh_svg__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_icons_refresh_svg__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _connection_modal_css__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./connection-modal.css */ "./src/components/connection-modal/connection-modal.css"); /* harmony import */ var _connection_modal_css__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_connection_modal_css__WEBPACK_IMPORTED_MODULE_9__); var ScanningStep = function ScanningStep(props) { return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_9___default.a.body }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_9___default.a.activityArea }, props.scanning ? props.peripheralList.length === 0 ? react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_9___default.a.activityAreaInfo }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_9___default.a.centeredRow }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("img", { className: classnames__WEBPACK_IMPORTED_MODULE_3___default()(_connection_modal_css__WEBPACK_IMPORTED_MODULE_9___default.a.radarSmall, _connection_modal_css__WEBPACK_IMPORTED_MODULE_9___default.a.radarSpin), src: _icons_searching_png__WEBPACK_IMPORTED_MODULE_7___default.a }), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_0__["FormattedMessage"], { defaultMessage: "Looking for devices", id: "gui.connection.scanning.lookingforperipherals" }))) : react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_9___default.a.peripheralTilePane }, props.peripheralList.map(function (peripheral) { return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_peripheral_tile_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { connectionSmallIconURL: props.connectionSmallIconURL, key: peripheral.peripheralId, name: peripheral.name, peripheralId: peripheral.peripheralId, rssi: peripheral.rssi, onConnecting: props.onConnecting }); })) : react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_9___default.a.instructions }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_0__["FormattedMessage"], { defaultMessage: "No devices found", id: "gui.connection.scanning.noPeripheralsFound" }))), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_9___default.a.bottomArea }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_3___default()(_connection_modal_css__WEBPACK_IMPORTED_MODULE_9___default.a.bottomAreaItem, _connection_modal_css__WEBPACK_IMPORTED_MODULE_9___default.a.instructions) }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_0__["FormattedMessage"], { defaultMessage: "Select your device in the list above.", id: "gui.connection.scanning.instructions" })), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_dots_jsx__WEBPACK_IMPORTED_MODULE_6__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_9___default.a.bottomAreaItem, counter: 0, total: 3 }), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("button", { className: classnames__WEBPACK_IMPORTED_MODULE_3___default()(_connection_modal_css__WEBPACK_IMPORTED_MODULE_9___default.a.bottomAreaItem, _connection_modal_css__WEBPACK_IMPORTED_MODULE_9___default.a.connectionButton), onClick: props.onRefresh }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_0__["FormattedMessage"], { defaultMessage: "Refresh", id: "gui.connection.search" }), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("img", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_9___default.a.buttonIconRight, src: _icons_refresh_svg__WEBPACK_IMPORTED_MODULE_8___default.a })))); }; ScanningStep.propTypes = { connectionSmallIconURL: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, onConnecting: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onRefresh: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, peripheralList: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.shape({ name: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, rssi: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, peripheralId: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string })), scanning: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool.isRequired }; ScanningStep.defaultProps = { peripheralList: [], scanning: true }; /* harmony default export */ __webpack_exports__["default"] = (ScanningStep); /***/ }), /***/ "./src/components/connection-modal/unavailable-step.jsx": /*!**************************************************************!*\ !*** ./src/components/connection-modal/unavailable-step.jsx ***! \**************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _dots_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./dots.jsx */ "./src/components/connection-modal/dots.jsx"); /* harmony import */ var _icons_help_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./icons/help.svg */ "./src/components/connection-modal/icons/help.svg"); /* harmony import */ var _icons_help_svg__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_icons_help_svg__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _icons_back_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./icons/back.svg */ "./src/components/connection-modal/icons/back.svg"); /* harmony import */ var _icons_back_svg__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_icons_back_svg__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _icons_bluetooth_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./icons/bluetooth.svg */ "./src/components/connection-modal/icons/bluetooth.svg"); /* harmony import */ var _icons_bluetooth_svg__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_icons_bluetooth_svg__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _icons_scratchlink_svg__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./icons/scratchlink.svg */ "./src/components/connection-modal/icons/scratchlink.svg"); /* harmony import */ var _icons_scratchlink_svg__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_icons_scratchlink_svg__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _connection_modal_css__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./connection-modal.css */ "./src/components/connection-modal/connection-modal.css"); /* harmony import */ var _connection_modal_css__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_connection_modal_css__WEBPACK_IMPORTED_MODULE_10__); var UnavailableStep = function UnavailableStep(props) { return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.body }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.activityArea }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.scratchLinkHelp }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.scratchLinkHelpStep }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.helpStepNumber }, '1'), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.helpStepImage }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("img", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.scratchLinkIcon, src: _icons_scratchlink_svg__WEBPACK_IMPORTED_MODULE_9___default.a })), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.helpStepText }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_0__["FormattedMessage"], { defaultMessage: "Make sure you have Scratch Link installed and running", id: "gui.connection.unavailable.installscratchlink" }))), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.scratchLinkHelpStep }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.helpStepNumber }, '2'), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.helpStepImage }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("img", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.scratchLinkIcon, src: _icons_bluetooth_svg__WEBPACK_IMPORTED_MODULE_8___default.a })), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.helpStepText }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_0__["FormattedMessage"], { defaultMessage: "Check that Bluetooth is enabled", id: "gui.connection.unavailable.enablebluetooth" }))))), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.bottomArea }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_dots_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { error: true, className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.bottomAreaItem, total: 3 }), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_connection_modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.bottomAreaItem, _connection_modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.buttonRow) }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("button", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.connectionButton, onClick: props.onScanning }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("img", { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_connection_modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.buttonIconLeft, _connection_modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.buttonIconBack), src: _icons_back_svg__WEBPACK_IMPORTED_MODULE_7___default.a }), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_0__["FormattedMessage"], { defaultMessage: "Try again", id: "gui.connection.unavailable.tryagainbutton" })), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("button", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.connectionButton, onClick: props.onHelp }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("img", { className: _connection_modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.buttonIconLeft, src: _icons_help_svg__WEBPACK_IMPORTED_MODULE_6___default.a }), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_0__["FormattedMessage"], { defaultMessage: "Help", id: "gui.connection.unavailable.helpbutton" }))))); }; UnavailableStep.propTypes = { onHelp: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onScanning: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func }; /* harmony default export */ __webpack_exports__["default"] = (UnavailableStep); /***/ }), /***/ "./src/components/context-menu/context-menu.css": /*!******************************************************!*\ !*** ./src/components/context-menu/context-menu.css ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./context-menu.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/context-menu/context-menu.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/context-menu/context-menu.jsx": /*!******************************************************!*\ !*** ./src/components/context-menu/context-menu.jsx ***! \******************************************************/ /*! exports provided: BorderedMenuItem, DangerousMenuItem, ContextMenu, MenuItem */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BorderedMenuItem", function() { return BorderedMenuItem; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DangerousMenuItem", function() { return DangerousMenuItem; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContextMenu", function() { return StyledContextMenu; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MenuItem", function() { return StyledMenuItem; }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react_contextmenu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-contextmenu */ "./node_modules/react-contextmenu/es6/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _context_menu_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./context-menu.css */ "./src/components/context-menu/context-menu.css"); /* harmony import */ var _context_menu_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_context_menu_css__WEBPACK_IMPORTED_MODULE_3__); function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } var StyledContextMenu = function StyledContextMenu(props) { return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_contextmenu__WEBPACK_IMPORTED_MODULE_1__["ContextMenu"], _extends({}, props, { className: _context_menu_css__WEBPACK_IMPORTED_MODULE_3___default.a.contextMenu })); }; var StyledMenuItem = function StyledMenuItem(props) { return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_contextmenu__WEBPACK_IMPORTED_MODULE_1__["MenuItem"], _extends({}, props, { attributes: { className: _context_menu_css__WEBPACK_IMPORTED_MODULE_3___default.a.menuItem } })); }; var BorderedMenuItem = function BorderedMenuItem(props) { return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_contextmenu__WEBPACK_IMPORTED_MODULE_1__["MenuItem"], _extends({}, props, { attributes: { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_context_menu_css__WEBPACK_IMPORTED_MODULE_3___default.a.menuItem, _context_menu_css__WEBPACK_IMPORTED_MODULE_3___default.a.menuItemBordered) } })); }; var DangerousMenuItem = function DangerousMenuItem(props) { return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_contextmenu__WEBPACK_IMPORTED_MODULE_1__["MenuItem"], _extends({}, props, { attributes: { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_context_menu_css__WEBPACK_IMPORTED_MODULE_3___default.a.menuItem, _context_menu_css__WEBPACK_IMPORTED_MODULE_3___default.a.menuItemBordered, _context_menu_css__WEBPACK_IMPORTED_MODULE_3___default.a.menuItemDanger) } })); }; /***/ }), /***/ "./src/components/controls/controls.css": /*!**********************************************!*\ !*** ./src/components/controls/controls.css ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./controls.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/controls/controls.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/controls/controls.jsx": /*!**********************************************!*\ !*** ./src/components/controls/controls.jsx ***! \**********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _green_flag_green_flag_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../green-flag/green-flag.jsx */ "./src/components/green-flag/green-flag.jsx"); /* harmony import */ var _stop_all_stop_all_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../stop-all/stop-all.jsx */ "./src/components/stop-all/stop-all.jsx"); /* harmony import */ var _turbo_mode_turbo_mode_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../turbo-mode/turbo-mode.jsx */ "./src/components/turbo-mode/turbo-mode.jsx"); /* harmony import */ var _controls_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./controls.css */ "./src/components/controls/controls.css"); /* harmony import */ var _controls_css__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_controls_css__WEBPACK_IMPORTED_MODULE_7__); function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_3__["defineMessages"])({ goTitle: { "id": "gui.controls.go", "defaultMessage": "Go" }, stopTitle: { "id": "gui.controls.stop", "defaultMessage": "Stop" } }); var Controls = function Controls(props) { var active = props.active, className = props.className, intl = props.intl, onGreenFlagClick = props.onGreenFlagClick, onStopAllClick = props.onStopAllClick, turbo = props.turbo, componentProps = _objectWithoutProperties(props, ["active", "className", "intl", "onGreenFlagClick", "onStopAllClick", "turbo"]); return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", _extends({ className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_controls_css__WEBPACK_IMPORTED_MODULE_7___default.a.controlsContainer, className) }, componentProps), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_green_flag_green_flag_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { active: active, title: intl.formatMessage(messages.goTitle), onClick: onGreenFlagClick }), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_stop_all_stop_all_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { active: active, title: intl.formatMessage(messages.stopTitle), onClick: onStopAllClick }), turbo ? react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_turbo_mode_turbo_mode_jsx__WEBPACK_IMPORTED_MODULE_6__["default"], null) : null); }; Controls.propTypes = { active: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, className: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, intl: react_intl__WEBPACK_IMPORTED_MODULE_3__["intlShape"].isRequired, onGreenFlagClick: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, onStopAllClick: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, turbo: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool }; Controls.defaultProps = { active: false, turbo: false }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_3__["injectIntl"])(Controls)); /***/ }), /***/ "./src/components/crash-message/crash-message.css": /*!********************************************************!*\ !*** ./src/components/crash-message/crash-message.css ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./crash-message.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/crash-message/crash-message.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/crash-message/crash-message.jsx": /*!********************************************************!*\ !*** ./src/components/crash-message/crash-message.jsx ***! \********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _crash_message_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./crash-message.css */ "./src/components/crash-message/crash-message.css"); /* harmony import */ var _crash_message_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_crash_message_css__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _reload_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./reload.svg */ "./src/components/crash-message/reload.svg"); /* harmony import */ var _reload_svg__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_reload_svg__WEBPACK_IMPORTED_MODULE_5__); var CrashMessage = function CrashMessage(props) { return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _crash_message_css__WEBPACK_IMPORTED_MODULE_4___default.a.crashWrapper }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], { className: _crash_message_css__WEBPACK_IMPORTED_MODULE_4___default.a.body }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", { className: _crash_message_css__WEBPACK_IMPORTED_MODULE_4___default.a.reloadIcon, src: _reload_svg__WEBPACK_IMPORTED_MODULE_5___default.a }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("h2", null, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "Oops! Something went wrong.", id: "gui.crashMessage.label" })), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("p", null, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: 'We are so sorry, but it looks like Scratch has crashed. This bug has been' + ' automatically reported to the Scratch Team. Please refresh your page to try' + ' again.', id: "gui.crashMessage.description" })), props.eventId && react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("p", null, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "Your error was logged with id {errorId}", id: "gui.crashMessage.errorNumber", values: { errorId: props.eventId } })), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("button", { className: _crash_message_css__WEBPACK_IMPORTED_MODULE_4___default.a.reloadButton, onClick: props.onReload }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "Reload", id: "gui.crashMessage.reload" })))); }; CrashMessage.propTypes = { eventId: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, onReload: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired }; /* harmony default export */ __webpack_exports__["default"] = (CrashMessage); /***/ }), /***/ "./src/components/crash-message/reload.svg": /*!*************************************************!*\ !*** ./src/components/crash-message/reload.svg ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/dd98971c2c185caf86144b6b5234d0fa.svg"; /***/ }), /***/ "./src/components/custom-procedures/custom-procedures.css": /*!****************************************************************!*\ !*** ./src/components/custom-procedures/custom-procedures.css ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./custom-procedures.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/custom-procedures/custom-procedures.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/custom-procedures/custom-procedures.jsx": /*!****************************************************************!*\ !*** ./src/components/custom-procedures/custom-procedures.jsx ***! \****************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _containers_modal_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../containers/modal.jsx */ "./src/containers/modal.jsx"); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _icon_boolean_input_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./icon--boolean-input.svg */ "./src/components/custom-procedures/icon--boolean-input.svg"); /* harmony import */ var _icon_boolean_input_svg__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_icon_boolean_input_svg__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _icon_text_input_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./icon--text-input.svg */ "./src/components/custom-procedures/icon--text-input.svg"); /* harmony import */ var _icon_text_input_svg__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_icon_text_input_svg__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _icon_label_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./icon--label.svg */ "./src/components/custom-procedures/icon--label.svg"); /* harmony import */ var _icon_label_svg__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_icon_label_svg__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _custom_procedures_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./custom-procedures.css */ "./src/components/custom-procedures/custom-procedures.css"); /* harmony import */ var _custom_procedures_css__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_custom_procedures_css__WEBPACK_IMPORTED_MODULE_8__); var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_4__["defineMessages"])({ myblockModalTitle: { "id": "gui.customProcedures.myblockModalTitle", "defaultMessage": "Make a Block" } }); var CustomProcedures = function CustomProcedures(props) { return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_containers_modal_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], { className: _custom_procedures_css__WEBPACK_IMPORTED_MODULE_8___default.a.modalContent, contentLabel: props.intl.formatMessage(messages.myblockModalTitle), onRequestClose: props.onCancel }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _custom_procedures_css__WEBPACK_IMPORTED_MODULE_8___default.a.workspace, componentRef: props.componentRef }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _custom_procedures_css__WEBPACK_IMPORTED_MODULE_8___default.a.body }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _custom_procedures_css__WEBPACK_IMPORTED_MODULE_8___default.a.optionsRow }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _custom_procedures_css__WEBPACK_IMPORTED_MODULE_8___default.a.optionCard, role: "button", tabIndex: "0", onClick: props.onAddTextNumber }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", { className: _custom_procedures_css__WEBPACK_IMPORTED_MODULE_8___default.a.optionIcon, src: _icon_text_input_svg__WEBPACK_IMPORTED_MODULE_6___default.a }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _custom_procedures_css__WEBPACK_IMPORTED_MODULE_8___default.a.optionTitle }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_4__["FormattedMessage"], { defaultMessage: "Add an input", id: "gui.customProcedures.addAnInputNumberText" })), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _custom_procedures_css__WEBPACK_IMPORTED_MODULE_8___default.a.optionDescription }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_4__["FormattedMessage"], { defaultMessage: "number or text", id: "gui.customProcedures.numberTextType" }))), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _custom_procedures_css__WEBPACK_IMPORTED_MODULE_8___default.a.optionCard, role: "button", tabIndex: "0", onClick: props.onAddBoolean }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", { className: _custom_procedures_css__WEBPACK_IMPORTED_MODULE_8___default.a.optionIcon, src: _icon_boolean_input_svg__WEBPACK_IMPORTED_MODULE_5___default.a }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _custom_procedures_css__WEBPACK_IMPORTED_MODULE_8___default.a.optionTitle }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_4__["FormattedMessage"], { defaultMessage: "Add an input", id: "gui.customProcedures.addAnInputBoolean" })), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _custom_procedures_css__WEBPACK_IMPORTED_MODULE_8___default.a.optionDescription }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_4__["FormattedMessage"], { defaultMessage: "boolean", id: "gui.customProcedures.booleanType" }))), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _custom_procedures_css__WEBPACK_IMPORTED_MODULE_8___default.a.optionCard, role: "button", tabIndex: "0", onClick: props.onAddLabel }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", { className: _custom_procedures_css__WEBPACK_IMPORTED_MODULE_8___default.a.optionIcon, src: _icon_label_svg__WEBPACK_IMPORTED_MODULE_7___default.a }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _custom_procedures_css__WEBPACK_IMPORTED_MODULE_8___default.a.optionTitle }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_4__["FormattedMessage"], { defaultMessage: "Add a label", id: "gui.customProcedures.addALabel" })))), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _custom_procedures_css__WEBPACK_IMPORTED_MODULE_8___default.a.checkboxRow }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("input", { checked: props.warp, type: "checkbox", onChange: props.onToggleWarp }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_4__["FormattedMessage"], { defaultMessage: "Run without screen refresh", id: "gui.customProcedures.runWithoutScreenRefresh" }))), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _custom_procedures_css__WEBPACK_IMPORTED_MODULE_8___default.a.buttonRow }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("button", { className: _custom_procedures_css__WEBPACK_IMPORTED_MODULE_8___default.a.cancelButton, onClick: props.onCancel }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_4__["FormattedMessage"], { defaultMessage: "Cancel", id: "gui.customProcedures.cancel" })), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("button", { className: _custom_procedures_css__WEBPACK_IMPORTED_MODULE_8___default.a.okButton, onClick: props.onOk }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_4__["FormattedMessage"], { defaultMessage: "OK", id: "gui.customProcedures.ok" }))))); }; CustomProcedures.propTypes = { componentRef: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, intl: react_intl__WEBPACK_IMPORTED_MODULE_4__["intlShape"], onAddBoolean: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onAddLabel: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onAddTextNumber: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onCancel: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onOk: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onToggleWarp: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, warp: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool.isRequired }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_4__["injectIntl"])(CustomProcedures)); /***/ }), /***/ "./src/components/custom-procedures/icon--boolean-input.svg": /*!******************************************************************!*\ !*** ./src/components/custom-procedures/icon--boolean-input.svg ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/10811a978de201353d564df7ba1ddb58.svg"; /***/ }), /***/ "./src/components/custom-procedures/icon--label.svg": /*!**********************************************************!*\ !*** ./src/components/custom-procedures/icon--label.svg ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/8beb9da10f72d02b48baf0b24ac72449.svg"; /***/ }), /***/ "./src/components/custom-procedures/icon--text-input.svg": /*!***************************************************************!*\ !*** ./src/components/custom-procedures/icon--text-input.svg ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/2a70b21aaaed0619bdfcdec91db1ebe8.svg"; /***/ }), /***/ "./src/components/direction-picker/dial.css": /*!**************************************************!*\ !*** ./src/components/direction-picker/dial.css ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./dial.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/direction-picker/dial.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/direction-picker/dial.jsx": /*!**************************************************!*\ !*** ./src/components/direction-picker/dial.jsx ***! \**************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _lib_touch_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../lib/touch-utils */ "./src/lib/touch-utils.js"); /* harmony import */ var _dial_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./dial.css */ "./src/components/direction-picker/dial.css"); /* harmony import */ var _dial_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_dial_css__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _icon_dial_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./icon--dial.svg */ "./src/components/direction-picker/icon--dial.svg"); /* harmony import */ var _icon_dial_svg__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_icon_dial_svg__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _icon_handle_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./icon--handle.svg */ "./src/components/direction-picker/icon--handle.svg"); /* harmony import */ var _icon_handle_svg__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_icon_handle_svg__WEBPACK_IMPORTED_MODULE_6__); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var Dial = /*#__PURE__*/ function (_React$Component) { _inherits(Dial, _React$Component); function Dial(props) { var _this; _classCallCheck(this, Dial); _this = _possibleConstructorReturn(this, _getPrototypeOf(Dial).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_1___default()(_assertThisInitialized(_this), ['handleMouseDown', 'handleMouseMove', 'containerRef', 'handleRef', 'unbindMouseEvents']); return _this; } _createClass(Dial, [{ key: "componentDidMount", value: function componentDidMount() { // Manually add touch/mouse handlers so that preventDefault can be used // to prevent scrolling on touch. // Tracked as a react issue https://github.com/facebook/react/issues/6436 this.handleElement.addEventListener('mousedown', this.handleMouseDown); this.handleElement.addEventListener('touchstart', this.handleMouseDown); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.unbindMouseEvents(); this.handleElement.removeEventListener('mousedown', this.handleMouseDown); this.handleElement.removeEventListener('touchstart', this.handleMouseDown); } /** * Get direction from dial center to mouse move event. * @param {Event} e - Mouse move event. * @returns {number} Direction in degrees, clockwise, 90=horizontal. */ }, { key: "directionToMouseEvent", value: function directionToMouseEvent(e) { var _getEventXY = Object(_lib_touch_utils__WEBPACK_IMPORTED_MODULE_3__["getEventXY"])(e), mx = _getEventXY.x, my = _getEventXY.y; var bbox = this.containerElement.getBoundingClientRect(); var cy = bbox.top + bbox.height / 2; var cx = bbox.left + bbox.width / 2; var angle = Math.atan2(my - cy, mx - cx); var degrees = angle * (180 / Math.PI); return degrees + 90; // To correspond with scratch coordinate system } /** * Create SVG path data string for the dial "gauge", the overlaid arc slice. * @param {number} radius - The radius of the dial. * @param {number} direction - Direction in degrees, clockwise, 90=horizontal. * @returns {string} Path data string for the gauge. */ }, { key: "gaugePath", value: function gaugePath(radius, direction) { var rads = direction * (Math.PI / 180); var path = []; path.push("M ".concat(radius, " 0")); path.push("L ".concat(radius, " ").concat(radius)); path.push("L ".concat(radius + radius * Math.sin(rads), " ").concat(radius - radius * Math.cos(rads))); path.push("A ".concat(radius, " ").concat(radius, " 0 0 ").concat(direction < 0 ? 1 : 0, " ").concat(radius, " 0")); path.push("Z"); return path.join(' '); } }, { key: "handleMouseMove", value: function handleMouseMove(e) { this.props.onChange(this.directionToMouseEvent(e) + this.directionOffset); e.preventDefault(); } }, { key: "unbindMouseEvents", value: function unbindMouseEvents() { window.removeEventListener('mousemove', this.handleMouseMove); window.removeEventListener('mouseup', this.unbindMouseEvents); window.removeEventListener('touchmove', this.handleMouseMove); window.removeEventListener('touchend', this.unbindMouseEvents); } }, { key: "handleMouseDown", value: function handleMouseDown(e) { // Because the drag handle is not a single point, there is some initial // difference between the current sprite direction and the direction to the mouse // Store this offset to prevent jumping when the mouse is moved. this.directionOffset = this.props.direction - this.directionToMouseEvent(e); window.addEventListener('mousemove', this.handleMouseMove); window.addEventListener('mouseup', this.unbindMouseEvents); window.addEventListener('touchmove', this.handleMouseMove); window.addEventListener('touchend', this.unbindMouseEvents); e.preventDefault(); } }, { key: "containerRef", value: function containerRef(el) { this.containerElement = el; } }, { key: "handleRef", value: function handleRef(el) { this.handleElement = el; } }, { key: "render", value: function render() { var _this$props = this.props, direction = _this$props.direction, radius = _this$props.radius; return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _dial_css__WEBPACK_IMPORTED_MODULE_4___default.a.container }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _dial_css__WEBPACK_IMPORTED_MODULE_4___default.a.dialContainer, ref: this.containerRef, style: { width: "".concat(radius * 2, "px"), height: "".concat(radius * 2, "px") } }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("img", { className: _dial_css__WEBPACK_IMPORTED_MODULE_4___default.a.dialFace, draggable: false, src: _icon_dial_svg__WEBPACK_IMPORTED_MODULE_5___default.a }), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("svg", { className: _dial_css__WEBPACK_IMPORTED_MODULE_4___default.a.gauge, height: radius * 2, width: radius * 2 }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("path", { className: _dial_css__WEBPACK_IMPORTED_MODULE_4___default.a.gaugePath, d: this.gaugePath(radius, direction) })), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("img", { className: _dial_css__WEBPACK_IMPORTED_MODULE_4___default.a.dialHandle, draggable: false, ref: this.handleRef, src: _icon_handle_svg__WEBPACK_IMPORTED_MODULE_6___default.a, style: { top: "".concat(radius - radius * Math.cos(direction * (Math.PI / 180)), "px"), left: "".concat(radius + radius * Math.sin(direction * (Math.PI / 180)), "px"), transform: "rotate(".concat(direction, "deg)") } }))); } }]); return Dial; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.Component); Dial.propTypes = { direction: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number, onChange: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, radius: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number }; Dial.defaultProps = { direction: 90, // degrees radius: 56 // px }; /* harmony default export */ __webpack_exports__["default"] = (Dial); /***/ }), /***/ "./src/components/direction-picker/direction-picker.css": /*!**************************************************************!*\ !*** ./src/components/direction-picker/direction-picker.css ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./direction-picker.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/direction-picker/direction-picker.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/direction-picker/direction-picker.jsx": /*!**************************************************************!*\ !*** ./src/components/direction-picker/direction-picker.jsx ***! \**************************************************************/ /*! exports provided: default, RotationStyles */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return WrappedDirectionPicker; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RotationStyles", function() { return RotationStyles; }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_popover__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-popover */ "./node_modules/react-popover/index.js"); /* harmony import */ var react_popover__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_popover__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _forms_label_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../forms/label.jsx */ "./src/components/forms/label.jsx"); /* harmony import */ var _forms_input_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../forms/input.jsx */ "./src/components/forms/input.jsx"); /* harmony import */ var _forms_buffered_input_hoc_jsx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../forms/buffered-input-hoc.jsx */ "./src/components/forms/buffered-input-hoc.jsx"); /* harmony import */ var _dial_jsx__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./dial.jsx */ "./src/components/direction-picker/dial.jsx"); /* harmony import */ var _direction_picker_css__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./direction-picker.css */ "./src/components/direction-picker/direction-picker.css"); /* harmony import */ var _direction_picker_css__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_direction_picker_css__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _icon_all_around_svg__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./icon--all-around.svg */ "./src/components/direction-picker/icon--all-around.svg"); /* harmony import */ var _icon_all_around_svg__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_icon_all_around_svg__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _icon_left_right_svg__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./icon--left-right.svg */ "./src/components/direction-picker/icon--left-right.svg"); /* harmony import */ var _icon_left_right_svg__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_icon_left_right_svg__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _icon_dont_rotate_svg__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./icon--dont-rotate.svg */ "./src/components/direction-picker/icon--dont-rotate.svg"); /* harmony import */ var _icon_dont_rotate_svg__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_icon_dont_rotate_svg__WEBPACK_IMPORTED_MODULE_12__); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var BufferedInput = Object(_forms_buffered_input_hoc_jsx__WEBPACK_IMPORTED_MODULE_7__["default"])(_forms_input_jsx__WEBPACK_IMPORTED_MODULE_6__["default"]); var directionLabel = react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_4__["FormattedMessage"], { defaultMessage: "Direction", id: "gui.SpriteInfo.direction" }); var RotationStyles = { ALL_AROUND: 'all around', LEFT_RIGHT: 'left-right', DONT_ROTATE: "don't rotate" }; var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_4__["defineMessages"])({ allAround: { "id": "gui.directionPicker.rotationStyles.allAround", "defaultMessage": "All Around" }, leftRight: { "id": "gui.directionPicker.rotationStyles.leftRight", "defaultMessage": "Left/Right" }, dontRotate: { "id": "gui.directionPicker.rotationStyles.dontRotate", "defaultMessage": "Do not rotate" } }); var DirectionPicker = function DirectionPicker(props) { return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_forms_label_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { secondary: true, above: props.labelAbove, text: directionLabel }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_popover__WEBPACK_IMPORTED_MODULE_3___default.a, { body: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_dial_jsx__WEBPACK_IMPORTED_MODULE_8__["default"], { direction: props.direction, onChange: props.onChangeDirection }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _direction_picker_css__WEBPACK_IMPORTED_MODULE_9___default.a.buttonRow }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_direction_picker_css__WEBPACK_IMPORTED_MODULE_9___default.a.iconButton, _defineProperty({}, _direction_picker_css__WEBPACK_IMPORTED_MODULE_9___default.a.active, props.rotationStyle === RotationStyles.ALL_AROUND)), title: props.intl.formatMessage(messages.allAround), onClick: props.onClickAllAround }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("img", { draggable: false, src: _icon_all_around_svg__WEBPACK_IMPORTED_MODULE_10___default.a })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_direction_picker_css__WEBPACK_IMPORTED_MODULE_9___default.a.iconButton, _defineProperty({}, _direction_picker_css__WEBPACK_IMPORTED_MODULE_9___default.a.active, props.rotationStyle === RotationStyles.LEFT_RIGHT)), title: props.intl.formatMessage(messages.leftRight), onClick: props.onClickLeftRight }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("img", { draggable: false, src: _icon_left_right_svg__WEBPACK_IMPORTED_MODULE_11___default.a })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_direction_picker_css__WEBPACK_IMPORTED_MODULE_9___default.a.iconButton, _defineProperty({}, _direction_picker_css__WEBPACK_IMPORTED_MODULE_9___default.a.active, props.rotationStyle === RotationStyles.DONT_ROTATE)), title: props.intl.formatMessage(messages.dontRotate), onClick: props.onClickDontRotate }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("img", { draggable: false, src: _icon_dont_rotate_svg__WEBPACK_IMPORTED_MODULE_12___default.a })))), isOpen: props.popoverOpen, preferPlace: "above", onOuterAction: props.onClosePopover }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(BufferedInput, { small: true, disabled: props.disabled, label: directionLabel, tabIndex: "0", type: "text", value: props.disabled ? '' : props.direction, onFocus: props.onOpenPopover, onSubmit: props.onChangeDirection }))); }; DirectionPicker.propTypes = { direction: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, disabled: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool.isRequired, intl: react_intl__WEBPACK_IMPORTED_MODULE_4__["intlShape"], labelAbove: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, onChangeDirection: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, onClickAllAround: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, onClickDontRotate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, onClickLeftRight: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, onClosePopover: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, onOpenPopover: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, popoverOpen: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool.isRequired, rotationStyle: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string }; DirectionPicker.defaultProps = { labelAbove: false }; var WrappedDirectionPicker = Object(react_intl__WEBPACK_IMPORTED_MODULE_4__["injectIntl"])(DirectionPicker); /***/ }), /***/ "./src/components/direction-picker/icon--all-around.svg": /*!**************************************************************!*\ !*** ./src/components/direction-picker/icon--all-around.svg ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/85288751058f7704ffdb91f15d189260.svg"; /***/ }), /***/ "./src/components/direction-picker/icon--dial.svg": /*!********************************************************!*\ !*** ./src/components/direction-picker/icon--dial.svg ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/3732270cfcc864cbbd939ae7213f1a5a.svg"; /***/ }), /***/ "./src/components/direction-picker/icon--dont-rotate.svg": /*!***************************************************************!*\ !*** ./src/components/direction-picker/icon--dont-rotate.svg ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/e7c972c634096b89b182b99441a20b1d.svg"; /***/ }), /***/ "./src/components/direction-picker/icon--handle.svg": /*!**********************************************************!*\ !*** ./src/components/direction-picker/icon--handle.svg ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/14120e6444ca2744dad272d8ca2a4646.svg"; /***/ }), /***/ "./src/components/direction-picker/icon--left-right.svg": /*!**************************************************************!*\ !*** ./src/components/direction-picker/icon--left-right.svg ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/148e4f4cfc7a1a253eb52c50bbb635a0.svg"; /***/ }), /***/ "./src/components/divider/divider.css": /*!********************************************!*\ !*** ./src/components/divider/divider.css ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./divider.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/divider/divider.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/divider/divider.jsx": /*!********************************************!*\ !*** ./src/components/divider/divider.jsx ***! \********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _divider_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./divider.css */ "./src/components/divider/divider.css"); /* harmony import */ var _divider_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_divider_css__WEBPACK_IMPORTED_MODULE_3__); var Divider = function Divider(_ref) { var className = _ref.className; return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_divider_css__WEBPACK_IMPORTED_MODULE_3___default.a.divider, className) }); }; Divider.propTypes = { className: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string }; /* harmony default export */ __webpack_exports__["default"] = (Divider); /***/ }), /***/ "./src/components/drag-layer/drag-layer.css": /*!**************************************************!*\ !*** ./src/components/drag-layer/drag-layer.css ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./drag-layer.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/drag-layer/drag-layer.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/drag-layer/drag-layer.jsx": /*!**************************************************!*\ !*** ./src/components/drag-layer/drag-layer.jsx ***! \**************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _drag_layer_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./drag-layer.css */ "./src/components/drag-layer/drag-layer.css"); /* harmony import */ var _drag_layer_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_drag_layer_css__WEBPACK_IMPORTED_MODULE_2__); /* eslint no-confusing-arrow: ["error", {"allowParens": true}] */ var DragLayer = function DragLayer(_ref) { var dragging = _ref.dragging, img = _ref.img, currentOffset = _ref.currentOffset; return dragging ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _drag_layer_css__WEBPACK_IMPORTED_MODULE_2___default.a.dragLayer }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _drag_layer_css__WEBPACK_IMPORTED_MODULE_2___default.a.imageWrapper, style: { transform: "translate(".concat(currentOffset.x, "px, ").concat(currentOffset.y, "px)") } }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("img", { className: _drag_layer_css__WEBPACK_IMPORTED_MODULE_2___default.a.image, src: img }))) : null; }; DragLayer.propTypes = { currentOffset: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.shape({ x: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number.isRequired, y: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number.isRequired }), dragging: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool.isRequired, img: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string }; /* harmony default export */ __webpack_exports__["default"] = (DragLayer); /***/ }), /***/ "./src/components/filter/filter.css": /*!******************************************!*\ !*** ./src/components/filter/filter.css ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./filter.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/filter/filter.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/filter/filter.jsx": /*!******************************************!*\ !*** ./src/components/filter/filter.jsx ***! \******************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _icon_filter_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./icon--filter.svg */ "./src/components/filter/icon--filter.svg"); /* harmony import */ var _icon_filter_svg__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_icon_filter_svg__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _icon_x_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./icon--x.svg */ "./src/components/filter/icon--x.svg"); /* harmony import */ var _icon_x_svg__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_icon_x_svg__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _filter_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./filter.css */ "./src/components/filter/filter.css"); /* harmony import */ var _filter_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_filter_css__WEBPACK_IMPORTED_MODULE_5__); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var FilterComponent = function FilterComponent(props) { var className = props.className, onChange = props.onChange, onClear = props.onClear, placeholderText = props.placeholderText, filterQuery = props.filterQuery, inputClassName = props.inputClassName; return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(className, _filter_css__WEBPACK_IMPORTED_MODULE_5___default.a.filter, _defineProperty({}, _filter_css__WEBPACK_IMPORTED_MODULE_5___default.a.isActive, filterQuery.length > 0)) }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("img", { className: _filter_css__WEBPACK_IMPORTED_MODULE_5___default.a.filterIcon, src: _icon_filter_svg__WEBPACK_IMPORTED_MODULE_3___default.a }), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("input", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_filter_css__WEBPACK_IMPORTED_MODULE_5___default.a.filterInput, inputClassName), placeholder: placeholderText, type: "text", value: filterQuery, onChange: onChange }), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _filter_css__WEBPACK_IMPORTED_MODULE_5___default.a.xIconWrapper, onClick: onClear }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("img", { className: _filter_css__WEBPACK_IMPORTED_MODULE_5___default.a.xIcon, src: _icon_x_svg__WEBPACK_IMPORTED_MODULE_4___default.a }))); }; FilterComponent.propTypes = { className: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, filterQuery: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, inputClassName: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, onChange: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onClear: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, placeholderText: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string }; FilterComponent.defaultProps = { placeholderText: 'Search' }; /* harmony default export */ __webpack_exports__["default"] = (FilterComponent); /***/ }), /***/ "./src/components/filter/icon--filter.svg": /*!************************************************!*\ !*** ./src/components/filter/icon--filter.svg ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/a4451ef35d29c4997f7c8e837da8af44.svg"; /***/ }), /***/ "./src/components/filter/icon--x.svg": /*!*******************************************!*\ !*** ./src/components/filter/icon--x.svg ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/9c49ade683c0f0d75796136ff5d1030f.svg"; /***/ }), /***/ "./src/components/forms/buffered-input-hoc.jsx": /*!*****************************************************!*\ !*** ./src/components/forms/buffered-input-hoc.jsx ***! \*****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } /** * Higher Order Component to manage inputs that submit on blur and * @param {React.Component} Input text input that consumes onChange, onBlur, onKeyPress * @returns {React.Component} Buffered input that calls onSubmit on blur and */ /* harmony default export */ __webpack_exports__["default"] = (function (Input) { var BufferedInput = /*#__PURE__*/ function (_React$Component) { _inherits(BufferedInput, _React$Component); function BufferedInput(props) { var _this; _classCallCheck(this, BufferedInput); _this = _possibleConstructorReturn(this, _getPrototypeOf(BufferedInput).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['handleChange', 'handleKeyPress', 'handleFlush']); _this.state = { value: null }; return _this; } _createClass(BufferedInput, [{ key: "handleKeyPress", value: function handleKeyPress(e) { if (e.key === 'Enter') { this.handleFlush(); e.target.blur(); } } }, { key: "handleFlush", value: function handleFlush() { var isNumeric = typeof this.props.value === 'number'; var validatesNumeric = isNumeric ? !isNaN(this.state.value) : true; if (this.state.value !== null && validatesNumeric) { this.props.onSubmit(isNumeric ? Number(this.state.value) : this.state.value); } this.setState({ value: null }); } }, { key: "handleChange", value: function handleChange(e) { this.setState({ value: e.target.value }); } }, { key: "render", value: function render() { var bufferedValue = this.state.value === null ? this.props.value : this.state.value; return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(Input, _extends({}, this.props, { value: bufferedValue, onBlur: this.handleFlush, onChange: this.handleChange, onKeyPress: this.handleKeyPress })); } }]); return BufferedInput; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.Component); BufferedInput.propTypes = { onSubmit: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, value: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number]) }; return BufferedInput; }); /***/ }), /***/ "./src/components/forms/input.css": /*!****************************************!*\ !*** ./src/components/forms/input.css ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./input.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/forms/input.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/forms/input.jsx": /*!****************************************!*\ !*** ./src/components/forms/input.jsx ***! \****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _input_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./input.css */ "./src/components/forms/input.css"); /* harmony import */ var _input_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_input_css__WEBPACK_IMPORTED_MODULE_3__); function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } var Input = function Input(props) { var small = props.small, componentProps = _objectWithoutProperties(props, ["small"]); return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("input", _extends({}, componentProps, { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_input_css__WEBPACK_IMPORTED_MODULE_3___default.a.inputForm, props.className, _defineProperty({}, _input_css__WEBPACK_IMPORTED_MODULE_3___default.a.inputSmall, small)) })); }; Input.propTypes = { className: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, small: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool }; Input.defaultProps = { small: false }; /* harmony default export */ __webpack_exports__["default"] = (Input); /***/ }), /***/ "./src/components/forms/label.css": /*!****************************************!*\ !*** ./src/components/forms/label.css ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./label.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/forms/label.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/forms/label.jsx": /*!****************************************!*\ !*** ./src/components/forms/label.jsx ***! \****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _label_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./label.css */ "./src/components/forms/label.css"); /* harmony import */ var _label_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_label_css__WEBPACK_IMPORTED_MODULE_2__); var Label = function Label(props) { return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("label", { className: props.above ? _label_css__WEBPACK_IMPORTED_MODULE_2___default.a.inputGroupColumn : _label_css__WEBPACK_IMPORTED_MODULE_2___default.a.inputGroup }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("span", { className: props.secondary ? _label_css__WEBPACK_IMPORTED_MODULE_2___default.a.inputLabelSecondary : _label_css__WEBPACK_IMPORTED_MODULE_2___default.a.inputLabel }, props.text), props.children); }; Label.propTypes = { above: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, children: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.node, secondary: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, text: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.node]).isRequired }; Label.defaultProps = { above: false, secondary: false }; /* harmony default export */ __webpack_exports__["default"] = (Label); /***/ }), /***/ "./src/components/green-flag/green-flag.css": /*!**************************************************!*\ !*** ./src/components/green-flag/green-flag.css ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./green-flag.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/green-flag/green-flag.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/green-flag/green-flag.jsx": /*!**************************************************!*\ !*** ./src/components/green-flag/green-flag.jsx ***! \**************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _icon_green_flag_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./icon--green-flag.svg */ "./src/components/green-flag/icon--green-flag.svg"); /* harmony import */ var _icon_green_flag_svg__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_icon_green_flag_svg__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _green_flag_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./green-flag.css */ "./src/components/green-flag/green-flag.css"); /* harmony import */ var _green_flag_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_green_flag_css__WEBPACK_IMPORTED_MODULE_4__); function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } var GreenFlagComponent = function GreenFlagComponent(props) { var active = props.active, className = props.className, onClick = props.onClick, title = props.title, componentProps = _objectWithoutProperties(props, ["active", "className", "onClick", "title"]); return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("img", _extends({ className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(className, _green_flag_css__WEBPACK_IMPORTED_MODULE_4___default.a.greenFlag, _defineProperty({}, _green_flag_css__WEBPACK_IMPORTED_MODULE_4___default.a.isActive, active)), draggable: false, src: _icon_green_flag_svg__WEBPACK_IMPORTED_MODULE_3___default.a, title: title, onClick: onClick }, componentProps)); }; GreenFlagComponent.propTypes = { active: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, className: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, onClick: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, title: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string }; GreenFlagComponent.defaultProps = { active: false, title: 'Go' }; /* harmony default export */ __webpack_exports__["default"] = (GreenFlagComponent); /***/ }), /***/ "./src/components/green-flag/icon--green-flag.svg": /*!********************************************************!*\ !*** ./src/components/green-flag/icon--green-flag.svg ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/2e0c4790f8f9cf28e3c346b9cef0fcb6.svg"; /***/ }), /***/ "./src/components/gui/gui.css": /*!************************************!*\ !*** ./src/components/gui/gui.css ***! \************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./gui.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/gui/gui.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/gui/gui.jsx": /*!************************************!*\ !*** ./src/components/gui/gui.jsx ***! \************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var lodash_omit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash.omit */ "./node_modules/lodash.omit/index.js"); /* harmony import */ var lodash_omit__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_omit__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var react_responsive__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react-responsive */ "./node_modules/react-responsive/dist/react-responsive.js"); /* harmony import */ var react_responsive__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_responsive__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var react_tabs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react-tabs */ "./node_modules/react-tabs/esm/index.js"); /* harmony import */ var react_tabs_style_react_tabs_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react-tabs/style/react-tabs.css */ "./node_modules/react-tabs/style/react-tabs.css"); /* harmony import */ var react_tabs_style_react_tabs_css__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(react_tabs_style_react_tabs_css__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! scratch-vm */ "./node_modules/scratch-vm/src/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(scratch_vm__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var scratch_render__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! scratch-render */ "./node_modules/scratch-render/src/index.js"); /* harmony import */ var scratch_render__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(scratch_render__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _containers_blocks_jsx__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../containers/blocks.jsx */ "./src/containers/blocks.jsx"); /* harmony import */ var _containers_costume_tab_jsx__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../containers/costume-tab.jsx */ "./src/containers/costume-tab.jsx"); /* harmony import */ var _containers_target_pane_jsx__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../containers/target-pane.jsx */ "./src/containers/target-pane.jsx"); /* harmony import */ var _containers_sound_tab_jsx__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../containers/sound-tab.jsx */ "./src/containers/sound-tab.jsx"); /* harmony import */ var _containers_stage_wrapper_jsx__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../containers/stage-wrapper.jsx */ "./src/containers/stage-wrapper.jsx"); /* harmony import */ var _loader_loader_jsx__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../loader/loader.jsx */ "./src/components/loader/loader.jsx"); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _menu_bar_menu_bar_jsx__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../menu-bar/menu-bar.jsx */ "./src/components/menu-bar/menu-bar.jsx"); /* harmony import */ var _containers_costume_library_jsx__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../containers/costume-library.jsx */ "./src/containers/costume-library.jsx"); /* harmony import */ var _containers_backdrop_library_jsx__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../containers/backdrop-library.jsx */ "./src/containers/backdrop-library.jsx"); /* harmony import */ var _containers_watermark_jsx__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../containers/watermark.jsx */ "./src/containers/watermark.jsx"); /* harmony import */ var _containers_backpack_jsx__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../containers/backpack.jsx */ "./src/containers/backpack.jsx"); /* harmony import */ var _containers_webgl_modal_jsx__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../containers/webgl-modal.jsx */ "./src/containers/webgl-modal.jsx"); /* harmony import */ var _containers_tips_library_jsx__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../../containers/tips-library.jsx */ "./src/containers/tips-library.jsx"); /* harmony import */ var _containers_cards_jsx__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../../containers/cards.jsx */ "./src/containers/cards.jsx"); /* harmony import */ var _containers_alerts_jsx__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../../containers/alerts.jsx */ "./src/containers/alerts.jsx"); /* harmony import */ var _containers_drag_layer_jsx__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../../containers/drag-layer.jsx */ "./src/containers/drag-layer.jsx"); /* harmony import */ var _containers_connection_modal_jsx__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../../containers/connection-modal.jsx */ "./src/containers/connection-modal.jsx"); /* harmony import */ var _telemetry_modal_telemetry_modal_jsx__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../telemetry-modal/telemetry-modal.jsx */ "./src/components/telemetry-modal/telemetry-modal.jsx"); /* harmony import */ var _lib_layout_constants__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../../lib/layout-constants */ "./src/lib/layout-constants.js"); /* harmony import */ var _lib_screen_utils__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../../lib/screen-utils */ "./src/lib/screen-utils.js"); /* harmony import */ var _gui_css__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./gui.css */ "./src/components/gui/gui.css"); /* harmony import */ var _gui_css__WEBPACK_IMPORTED_MODULE_32___default = /*#__PURE__*/__webpack_require__.n(_gui_css__WEBPACK_IMPORTED_MODULE_32__); /* harmony import */ var _icon_extensions_svg__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./icon--extensions.svg */ "./src/components/gui/icon--extensions.svg"); /* harmony import */ var _icon_extensions_svg__WEBPACK_IMPORTED_MODULE_33___default = /*#__PURE__*/__webpack_require__.n(_icon_extensions_svg__WEBPACK_IMPORTED_MODULE_33__); /* harmony import */ var _icon_code_svg__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./icon--code.svg */ "./src/components/gui/icon--code.svg"); /* harmony import */ var _icon_code_svg__WEBPACK_IMPORTED_MODULE_34___default = /*#__PURE__*/__webpack_require__.n(_icon_code_svg__WEBPACK_IMPORTED_MODULE_34__); /* harmony import */ var _icon_costumes_svg__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./icon--costumes.svg */ "./src/components/gui/icon--costumes.svg"); /* harmony import */ var _icon_costumes_svg__WEBPACK_IMPORTED_MODULE_35___default = /*#__PURE__*/__webpack_require__.n(_icon_costumes_svg__WEBPACK_IMPORTED_MODULE_35__); /* harmony import */ var _icon_sounds_svg__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./icon--sounds.svg */ "./src/components/gui/icon--sounds.svg"); /* harmony import */ var _icon_sounds_svg__WEBPACK_IMPORTED_MODULE_36___default = /*#__PURE__*/__webpack_require__.n(_icon_sounds_svg__WEBPACK_IMPORTED_MODULE_36__); function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_4__["defineMessages"])({ addExtension: { "id": "gui.gui.addExtension", "defaultMessage": "Add Extension" } }); // Cache this value to only retrieve it once the first time. // Assume that it doesn't change for a session. var isRendererSupported = null; var GUIComponent = function GUIComponent(props) { var _omit = lodash_omit__WEBPACK_IMPORTED_MODULE_1___default()(props, 'dispatch'), accountNavOpen = _omit.accountNavOpen, activeTabIndex = _omit.activeTabIndex, alertsVisible = _omit.alertsVisible, authorId = _omit.authorId, authorThumbnailUrl = _omit.authorThumbnailUrl, authorUsername = _omit.authorUsername, basePath = _omit.basePath, backdropLibraryVisible = _omit.backdropLibraryVisible, backpackHost = _omit.backpackHost, backpackVisible = _omit.backpackVisible, blocksTabVisible = _omit.blocksTabVisible, cardsVisible = _omit.cardsVisible, canCreateNew = _omit.canCreateNew, canEditTitle = _omit.canEditTitle, canRemix = _omit.canRemix, canSave = _omit.canSave, canCreateCopy = _omit.canCreateCopy, canShare = _omit.canShare, canUseCloud = _omit.canUseCloud, children = _omit.children, connectionModalVisible = _omit.connectionModalVisible, costumeLibraryVisible = _omit.costumeLibraryVisible, costumesTabVisible = _omit.costumesTabVisible, enableCommunity = _omit.enableCommunity, intl = _omit.intl, isCreating = _omit.isCreating, isFullScreen = _omit.isFullScreen, isPlayerOnly = _omit.isPlayerOnly, isRtl = _omit.isRtl, isShared = _omit.isShared, loading = _omit.loading, renderLogin = _omit.renderLogin, onClickAccountNav = _omit.onClickAccountNav, onCloseAccountNav = _omit.onCloseAccountNav, onLogOut = _omit.onLogOut, onOpenRegistration = _omit.onOpenRegistration, onToggleLoginOpen = _omit.onToggleLoginOpen, onUpdateProjectTitle = _omit.onUpdateProjectTitle, onActivateCostumesTab = _omit.onActivateCostumesTab, onActivateSoundsTab = _omit.onActivateSoundsTab, onActivateTab = _omit.onActivateTab, onClickLogo = _omit.onClickLogo, onExtensionButtonClick = _omit.onExtensionButtonClick, onProjectTelemetryEvent = _omit.onProjectTelemetryEvent, onRequestCloseBackdropLibrary = _omit.onRequestCloseBackdropLibrary, onRequestCloseCostumeLibrary = _omit.onRequestCloseCostumeLibrary, onRequestCloseTelemetryModal = _omit.onRequestCloseTelemetryModal, onSeeCommunity = _omit.onSeeCommunity, onShare = _omit.onShare, onTelemetryModalCancel = _omit.onTelemetryModalCancel, onTelemetryModalOptIn = _omit.onTelemetryModalOptIn, onTelemetryModalOptOut = _omit.onTelemetryModalOptOut, showComingSoon = _omit.showComingSoon, soundsTabVisible = _omit.soundsTabVisible, stageSizeMode = _omit.stageSizeMode, targetIsStage = _omit.targetIsStage, telemetryModalVisible = _omit.telemetryModalVisible, tipsLibraryVisible = _omit.tipsLibraryVisible, vm = _omit.vm, componentProps = _objectWithoutProperties(_omit, ["accountNavOpen", "activeTabIndex", "alertsVisible", "authorId", "authorThumbnailUrl", "authorUsername", "basePath", "backdropLibraryVisible", "backpackHost", "backpackVisible", "blocksTabVisible", "cardsVisible", "canCreateNew", "canEditTitle", "canRemix", "canSave", "canCreateCopy", "canShare", "canUseCloud", "children", "connectionModalVisible", "costumeLibraryVisible", "costumesTabVisible", "enableCommunity", "intl", "isCreating", "isFullScreen", "isPlayerOnly", "isRtl", "isShared", "loading", "renderLogin", "onClickAccountNav", "onCloseAccountNav", "onLogOut", "onOpenRegistration", "onToggleLoginOpen", "onUpdateProjectTitle", "onActivateCostumesTab", "onActivateSoundsTab", "onActivateTab", "onClickLogo", "onExtensionButtonClick", "onProjectTelemetryEvent", "onRequestCloseBackdropLibrary", "onRequestCloseCostumeLibrary", "onRequestCloseTelemetryModal", "onSeeCommunity", "onShare", "onTelemetryModalCancel", "onTelemetryModalOptIn", "onTelemetryModalOptOut", "showComingSoon", "soundsTabVisible", "stageSizeMode", "targetIsStage", "telemetryModalVisible", "tipsLibraryVisible", "vm"]); if (children) { return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_17__["default"], componentProps, children); } var tabClassNames = { tabs: _gui_css__WEBPACK_IMPORTED_MODULE_32___default.a.tabs, tab: classnames__WEBPACK_IMPORTED_MODULE_0___default()(react_tabs_style_react_tabs_css__WEBPACK_IMPORTED_MODULE_8___default.a.reactTabsTab, _gui_css__WEBPACK_IMPORTED_MODULE_32___default.a.tab), tabList: classnames__WEBPACK_IMPORTED_MODULE_0___default()(react_tabs_style_react_tabs_css__WEBPACK_IMPORTED_MODULE_8___default.a.reactTabsTabList, _gui_css__WEBPACK_IMPORTED_MODULE_32___default.a.tabList), tabPanel: classnames__WEBPACK_IMPORTED_MODULE_0___default()(react_tabs_style_react_tabs_css__WEBPACK_IMPORTED_MODULE_8___default.a.reactTabsTabPanel, _gui_css__WEBPACK_IMPORTED_MODULE_32___default.a.tabPanel), tabPanelSelected: classnames__WEBPACK_IMPORTED_MODULE_0___default()(react_tabs_style_react_tabs_css__WEBPACK_IMPORTED_MODULE_8___default.a.reactTabsTabPanelSelected, _gui_css__WEBPACK_IMPORTED_MODULE_32___default.a.isSelected), tabSelected: classnames__WEBPACK_IMPORTED_MODULE_0___default()(react_tabs_style_react_tabs_css__WEBPACK_IMPORTED_MODULE_8___default.a.reactTabsTabSelected, _gui_css__WEBPACK_IMPORTED_MODULE_32___default.a.isSelected) }; if (isRendererSupported === null) { isRendererSupported = scratch_render__WEBPACK_IMPORTED_MODULE_10___default.a.isSupported(); } return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_responsive__WEBPACK_IMPORTED_MODULE_6___default.a, { minWidth: _lib_layout_constants__WEBPACK_IMPORTED_MODULE_30__["default"].fullSizeMinWidth }, function (isFullSize) { var stageSize = Object(_lib_screen_utils__WEBPACK_IMPORTED_MODULE_31__["resolveStageSize"])(stageSizeMode, isFullSize); return isPlayerOnly ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_containers_stage_wrapper_jsx__WEBPACK_IMPORTED_MODULE_15__["default"], { isFullScreen: isFullScreen, isRendererSupported: isRendererSupported, isRtl: isRtl, loading: loading, stageSize: _lib_layout_constants__WEBPACK_IMPORTED_MODULE_30__["STAGE_SIZE_MODES"].large, vm: vm }, alertsVisible ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_containers_alerts_jsx__WEBPACK_IMPORTED_MODULE_26__["default"], { className: _gui_css__WEBPACK_IMPORTED_MODULE_32___default.a.alertsContainer }) : null) : react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_17__["default"], _extends({ className: _gui_css__WEBPACK_IMPORTED_MODULE_32___default.a.pageWrapper, dir: isRtl ? 'rtl' : 'ltr' }, componentProps), telemetryModalVisible ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_telemetry_modal_telemetry_modal_jsx__WEBPACK_IMPORTED_MODULE_29__["default"], { onCancel: onTelemetryModalCancel, onOptIn: onTelemetryModalOptIn, onOptOut: onTelemetryModalOptOut, onRequestClose: onRequestCloseTelemetryModal }) : null, loading ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_loader_loader_jsx__WEBPACK_IMPORTED_MODULE_16__["default"], null) : null, isCreating ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_loader_loader_jsx__WEBPACK_IMPORTED_MODULE_16__["default"], { messageId: "gui.loader.creating" }) : null, isRendererSupported ? null : react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_containers_webgl_modal_jsx__WEBPACK_IMPORTED_MODULE_23__["default"], { isRtl: isRtl }), tipsLibraryVisible ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_containers_tips_library_jsx__WEBPACK_IMPORTED_MODULE_24__["default"], null) : null, cardsVisible ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_containers_cards_jsx__WEBPACK_IMPORTED_MODULE_25__["default"], null) : null, alertsVisible ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_containers_alerts_jsx__WEBPACK_IMPORTED_MODULE_26__["default"], { className: _gui_css__WEBPACK_IMPORTED_MODULE_32___default.a.alertsContainer }) : null, connectionModalVisible ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_containers_connection_modal_jsx__WEBPACK_IMPORTED_MODULE_28__["default"], { vm: vm }) : null, costumeLibraryVisible ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_containers_costume_library_jsx__WEBPACK_IMPORTED_MODULE_19__["default"], { vm: vm, onRequestClose: onRequestCloseCostumeLibrary }) : null, backdropLibraryVisible ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_containers_backdrop_library_jsx__WEBPACK_IMPORTED_MODULE_20__["default"], { vm: vm, onRequestClose: onRequestCloseBackdropLibrary }) : null, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_menu_bar_menu_bar_jsx__WEBPACK_IMPORTED_MODULE_18__["default"], { accountNavOpen: accountNavOpen, authorId: authorId, authorThumbnailUrl: authorThumbnailUrl, authorUsername: authorUsername, canCreateCopy: canCreateCopy, canCreateNew: canCreateNew, canEditTitle: canEditTitle, canRemix: canRemix, canSave: canSave, canShare: canShare, className: _gui_css__WEBPACK_IMPORTED_MODULE_32___default.a.menuBarPosition, enableCommunity: enableCommunity, isShared: isShared, renderLogin: renderLogin, showComingSoon: showComingSoon, onClickAccountNav: onClickAccountNav, onClickLogo: onClickLogo, onCloseAccountNav: onCloseAccountNav, onLogOut: onLogOut, onOpenRegistration: onOpenRegistration, onProjectTelemetryEvent: onProjectTelemetryEvent, onSeeCommunity: onSeeCommunity, onShare: onShare, onToggleLoginOpen: onToggleLoginOpen, onUpdateProjectTitle: onUpdateProjectTitle }), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_17__["default"], { className: _gui_css__WEBPACK_IMPORTED_MODULE_32___default.a.bodyWrapper }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_17__["default"], { className: _gui_css__WEBPACK_IMPORTED_MODULE_32___default.a.flexWrapper }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_17__["default"], { className: _gui_css__WEBPACK_IMPORTED_MODULE_32___default.a.editorWrapper }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_tabs__WEBPACK_IMPORTED_MODULE_7__["Tabs"], { forceRenderTabPanel: true, className: tabClassNames.tabs, selectedIndex: activeTabIndex, selectedTabClassName: tabClassNames.tabSelected, selectedTabPanelClassName: tabClassNames.tabPanelSelected, onSelect: onActivateTab }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_tabs__WEBPACK_IMPORTED_MODULE_7__["TabList"], { className: tabClassNames.tabList }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_tabs__WEBPACK_IMPORTED_MODULE_7__["Tab"], { className: tabClassNames.tab }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("img", { draggable: false, src: _icon_code_svg__WEBPACK_IMPORTED_MODULE_34___default.a }), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_4__["FormattedMessage"], { defaultMessage: "Code", id: "gui.gui.codeTab" })), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_tabs__WEBPACK_IMPORTED_MODULE_7__["Tab"], { className: tabClassNames.tab, onClick: onActivateCostumesTab }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("img", { draggable: false, src: _icon_costumes_svg__WEBPACK_IMPORTED_MODULE_35___default.a }), targetIsStage ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_4__["FormattedMessage"], { defaultMessage: "Backdrops", id: "gui.gui.backdropsTab" }) : react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_4__["FormattedMessage"], { defaultMessage: "Costumes", id: "gui.gui.costumesTab" })), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_tabs__WEBPACK_IMPORTED_MODULE_7__["Tab"], { className: tabClassNames.tab, onClick: onActivateSoundsTab }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("img", { draggable: false, src: _icon_sounds_svg__WEBPACK_IMPORTED_MODULE_36___default.a }), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_4__["FormattedMessage"], { defaultMessage: "Sounds", id: "gui.gui.soundsTab" }))), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_tabs__WEBPACK_IMPORTED_MODULE_7__["TabPanel"], { className: tabClassNames.tabPanel }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_17__["default"], { className: _gui_css__WEBPACK_IMPORTED_MODULE_32___default.a.blocksWrapper }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_containers_blocks_jsx__WEBPACK_IMPORTED_MODULE_11__["default"], { canUseCloud: canUseCloud, grow: 1, isVisible: blocksTabVisible, options: { media: "".concat(basePath, "static/blocks-media/") }, stageSize: stageSize, vm: vm })), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_17__["default"], { className: _gui_css__WEBPACK_IMPORTED_MODULE_32___default.a.extensionButtonContainer }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("button", { className: _gui_css__WEBPACK_IMPORTED_MODULE_32___default.a.extensionButton, title: intl.formatMessage(messages.addExtension), onClick: onExtensionButtonClick }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("img", { className: _gui_css__WEBPACK_IMPORTED_MODULE_32___default.a.extensionButtonIcon, draggable: false, src: _icon_extensions_svg__WEBPACK_IMPORTED_MODULE_33___default.a }))), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_17__["default"], { className: _gui_css__WEBPACK_IMPORTED_MODULE_32___default.a.watermark }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_containers_watermark_jsx__WEBPACK_IMPORTED_MODULE_21__["default"], null))), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_tabs__WEBPACK_IMPORTED_MODULE_7__["TabPanel"], { className: tabClassNames.tabPanel }, costumesTabVisible ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_containers_costume_tab_jsx__WEBPACK_IMPORTED_MODULE_12__["default"], { vm: vm }) : null), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_tabs__WEBPACK_IMPORTED_MODULE_7__["TabPanel"], { className: tabClassNames.tabPanel }, soundsTabVisible ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_containers_sound_tab_jsx__WEBPACK_IMPORTED_MODULE_14__["default"], { vm: vm }) : null)), backpackVisible ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_containers_backpack_jsx__WEBPACK_IMPORTED_MODULE_22__["default"], { host: backpackHost }) : null), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_17__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_gui_css__WEBPACK_IMPORTED_MODULE_32___default.a.stageAndTargetWrapper, _gui_css__WEBPACK_IMPORTED_MODULE_32___default.a[stageSize]) }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_containers_stage_wrapper_jsx__WEBPACK_IMPORTED_MODULE_15__["default"], { isRendererSupported: isRendererSupported, isRtl: isRtl, stageSize: stageSize, vm: vm }), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_17__["default"], { className: _gui_css__WEBPACK_IMPORTED_MODULE_32___default.a.targetWrapper }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_containers_target_pane_jsx__WEBPACK_IMPORTED_MODULE_13__["default"], { stageSize: stageSize, vm: vm }))))), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_containers_drag_layer_jsx__WEBPACK_IMPORTED_MODULE_27__["default"], null)); }); }; GUIComponent.propTypes = { accountNavOpen: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, activeTabIndex: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number, authorId: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool]), // can be false authorThumbnailUrl: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, authorUsername: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool]), // can be false backdropLibraryVisible: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, backpackHost: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, backpackVisible: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, basePath: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, blocksTabVisible: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, canCreateCopy: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, canCreateNew: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, canEditTitle: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, canRemix: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, canSave: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, canShare: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, canUseCloud: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, cardsVisible: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, children: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.node, costumeLibraryVisible: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, costumesTabVisible: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, enableCommunity: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, intl: react_intl__WEBPACK_IMPORTED_MODULE_4__["intlShape"].isRequired, isCreating: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, isFullScreen: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, isPlayerOnly: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, isRtl: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, isShared: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, loading: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, onActivateCostumesTab: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onActivateSoundsTab: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onActivateTab: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onClickAccountNav: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onClickLogo: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onCloseAccountNav: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onExtensionButtonClick: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onLogOut: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onOpenRegistration: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onRequestCloseBackdropLibrary: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onRequestCloseCostumeLibrary: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onRequestCloseTelemetryModal: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onSeeCommunity: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onShare: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onTabSelect: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onTelemetryModalCancel: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onTelemetryModalOptIn: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onTelemetryModalOptOut: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onToggleLoginOpen: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onUpdateProjectTitle: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, renderLogin: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, showComingSoon: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, soundsTabVisible: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, stageSizeMode: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOf(Object.keys(_lib_layout_constants__WEBPACK_IMPORTED_MODULE_30__["STAGE_SIZE_MODES"])), targetIsStage: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, telemetryModalVisible: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, tipsLibraryVisible: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, vm: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.instanceOf(scratch_vm__WEBPACK_IMPORTED_MODULE_9___default.a).isRequired }; GUIComponent.defaultProps = { backpackHost: null, backpackVisible: false, basePath: './', canCreateNew: false, canEditTitle: false, canRemix: false, canSave: false, canCreateCopy: false, canShare: false, canUseCloud: false, enableCommunity: false, isCreating: false, isShared: false, loading: false, onUpdateProjectTitle: function onUpdateProjectTitle() {}, showComingSoon: false, stageSizeMode: _lib_layout_constants__WEBPACK_IMPORTED_MODULE_30__["STAGE_SIZE_MODES"].large }; var mapStateToProps = function mapStateToProps(state) { return { // This is the button's mode, as opposed to the actual current state stageSizeMode: state.scratchGui.stageSize.stageSize }; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_4__["injectIntl"])(Object(react_redux__WEBPACK_IMPORTED_MODULE_5__["connect"])(mapStateToProps)(GUIComponent))); /***/ }), /***/ "./src/components/gui/icon--code.svg": /*!*******************************************!*\ !*** ./src/components/gui/icon--code.svg ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/257e3788c5fbfe56c151a97e97dc20d8.svg"; /***/ }), /***/ "./src/components/gui/icon--costumes.svg": /*!***********************************************!*\ !*** ./src/components/gui/icon--costumes.svg ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/1dfe5425b42628b6f1df1f39e97a319f.svg"; /***/ }), /***/ "./src/components/gui/icon--extensions.svg": /*!*************************************************!*\ !*** ./src/components/gui/icon--extensions.svg ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/5f4208a6b7257c456c018d57efc8a7e9.svg"; /***/ }), /***/ "./src/components/gui/icon--sounds.svg": /*!*********************************************!*\ !*** ./src/components/gui/icon--sounds.svg ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/2258ea6dfe9ad15440ca55aca291698d.svg"; /***/ }), /***/ "./src/components/icon-button/icon-button.css": /*!****************************************************!*\ !*** ./src/components/icon-button/icon-button.css ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./icon-button.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/icon-button/icon-button.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/icon-button/icon-button.jsx": /*!****************************************************!*\ !*** ./src/components/icon-button/icon-button.jsx ***! \****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _icon_button_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./icon-button.css */ "./src/components/icon-button/icon-button.css"); /* harmony import */ var _icon_button_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_icon_button_css__WEBPACK_IMPORTED_MODULE_3__); var IconButton = function IconButton(_ref) { var img = _ref.img, className = _ref.className, title = _ref.title, onClick = _ref.onClick; return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_icon_button_css__WEBPACK_IMPORTED_MODULE_3___default.a.container, className), role: "button", onClick: onClick }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", { className: _icon_button_css__WEBPACK_IMPORTED_MODULE_3___default.a.icon, draggable: false, src: img }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _icon_button_css__WEBPACK_IMPORTED_MODULE_3___default.a.title }, title)); }; IconButton.propTypes = { className: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, img: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, onClick: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, title: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.node.isRequired }; /* harmony default export */ __webpack_exports__["default"] = (IconButton); /***/ }), /***/ "./src/components/language-selector/language-icon.svg": /*!************************************************************!*\ !*** ./src/components/language-selector/language-icon.svg ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/1319094a51748798730f01d1dc0972ac.svg"; /***/ }), /***/ "./src/components/language-selector/language-selector.css": /*!****************************************************************!*\ !*** ./src/components/language-selector/language-selector.css ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./language-selector.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/language-selector/language-selector.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/language-selector/language-selector.jsx": /*!****************************************************************!*\ !*** ./src/components/language-selector/language-selector.jsx ***! \****************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var scratch_l10n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! scratch-l10n */ "./node_modules/scratch-l10n/src/index.js"); /* harmony import */ var _language_selector_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./language-selector.css */ "./src/components/language-selector/language-selector.css"); /* harmony import */ var _language_selector_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_language_selector_css__WEBPACK_IMPORTED_MODULE_3__); // supported languages to exclude from the menu, but allow as a URL option var ignore = []; var LanguageSelector = function LanguageSelector(_ref) { var currentLocale = _ref.currentLocale, label = _ref.label, onChange = _ref.onChange; return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("select", { "aria-label": label, className: _language_selector_css__WEBPACK_IMPORTED_MODULE_3___default.a.languageSelect, value: currentLocale, onChange: onChange }, Object.keys(scratch_l10n__WEBPACK_IMPORTED_MODULE_2__["default"]).filter(function (l) { return !ignore.includes(l); }).map(function (locale) { return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("option", { key: locale, value: locale }, scratch_l10n__WEBPACK_IMPORTED_MODULE_2__["default"][locale].name); })); }; LanguageSelector.propTypes = { currentLocale: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, label: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, onChange: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func }; /* harmony default export */ __webpack_exports__["default"] = (LanguageSelector); /***/ }), /***/ "./src/components/library-item/bluetooth.svg": /*!***************************************************!*\ !*** ./src/components/library-item/bluetooth.svg ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/dfe35552790fb5ff38c78a43f5e62f30.svg"; /***/ }), /***/ "./src/components/library-item/internet-connection.svg": /*!*************************************************************!*\ !*** ./src/components/library-item/internet-connection.svg ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/1bb0adb555e07593962e9fc28ec7566d.svg"; /***/ }), /***/ "./src/components/library-item/library-item.css": /*!******************************************************!*\ !*** ./src/components/library-item/library-item.css ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./library-item.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/library-item/library-item.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/library-item/library-item.jsx": /*!******************************************************!*\ !*** ./src/components/library-item/library-item.jsx ***! \******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _scratch_image_scratch_image_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../scratch-image/scratch-image.jsx */ "./src/components/scratch-image/scratch-image.jsx"); /* harmony import */ var _library_item_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./library-item.css */ "./src/components/library-item/library-item.css"); /* harmony import */ var _library_item_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_library_item_css__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _bluetooth_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./bluetooth.svg */ "./src/components/library-item/bluetooth.svg"); /* harmony import */ var _bluetooth_svg__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_bluetooth_svg__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _internet_connection_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./internet-connection.svg */ "./src/components/library-item/internet-connection.svg"); /* harmony import */ var _internet_connection_svg__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_internet_connection_svg__WEBPACK_IMPORTED_MODULE_8__); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } /* eslint-disable react/prefer-stateless-function */ var LibraryItemComponent = /*#__PURE__*/ function (_React$PureComponent) { _inherits(LibraryItemComponent, _React$PureComponent); function LibraryItemComponent() { _classCallCheck(this, LibraryItemComponent); return _possibleConstructorReturn(this, _getPrototypeOf(LibraryItemComponent).apply(this, arguments)); } _createClass(LibraryItemComponent, [{ key: "render", value: function render() { return this.props.featured ? react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_6___default()(_library_item_css__WEBPACK_IMPORTED_MODULE_5___default.a.libraryItem, _library_item_css__WEBPACK_IMPORTED_MODULE_5___default.a.featuredItem, _defineProperty({}, _library_item_css__WEBPACK_IMPORTED_MODULE_5___default.a.disabled, this.props.disabled), this.props.extensionId ? _library_item_css__WEBPACK_IMPORTED_MODULE_5___default.a.libraryItemExtension : null, this.props.hidden ? _library_item_css__WEBPACK_IMPORTED_MODULE_5___default.a.hidden : null), onClick: this.props.onClick }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _library_item_css__WEBPACK_IMPORTED_MODULE_5___default.a.featuredImageContainer }, this.props.disabled ? react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _library_item_css__WEBPACK_IMPORTED_MODULE_5___default.a.comingSoonText }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_0__["FormattedMessage"], { defaultMessage: "Coming Soon", id: "gui.extensionLibrary.comingSoon" })) : null, this.props.iconSource ? react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_scratch_image_scratch_image_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: _library_item_css__WEBPACK_IMPORTED_MODULE_5___default.a.featuredImage, imageSource: this.props.iconSource }) : null), this.props.insetIconURL ? react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _library_item_css__WEBPACK_IMPORTED_MODULE_5___default.a.libraryItemInsetImageContainer }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("img", { className: _library_item_css__WEBPACK_IMPORTED_MODULE_5___default.a.libraryItemInsetImage, src: this.props.insetIconURL })) : null, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: this.props.extensionId ? classnames__WEBPACK_IMPORTED_MODULE_6___default()(_library_item_css__WEBPACK_IMPORTED_MODULE_5___default.a.featuredExtensionText, _library_item_css__WEBPACK_IMPORTED_MODULE_5___default.a.featuredText) : _library_item_css__WEBPACK_IMPORTED_MODULE_5___default.a.featuredText }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("span", { className: _library_item_css__WEBPACK_IMPORTED_MODULE_5___default.a.libraryItemName }, this.props.name), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("br", null), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("span", { className: _library_item_css__WEBPACK_IMPORTED_MODULE_5___default.a.featuredDescription }, this.props.description)), this.props.bluetoothRequired || this.props.internetConnectionRequired || this.props.collaborator ? react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _library_item_css__WEBPACK_IMPORTED_MODULE_5___default.a.featuredExtensionMetadata }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _library_item_css__WEBPACK_IMPORTED_MODULE_5___default.a.featuredExtensionRequirement }, this.props.bluetoothRequired || this.props.internetConnectionRequired ? react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_0__["FormattedMessage"], { defaultMessage: "Requires", id: "gui.extensionLibrary.requires" })), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _library_item_css__WEBPACK_IMPORTED_MODULE_5___default.a.featuredExtensionMetadataDetail }, this.props.bluetoothRequired ? react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("img", { src: _bluetooth_svg__WEBPACK_IMPORTED_MODULE_7___default.a }) : null, this.props.internetConnectionRequired ? react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("img", { src: _internet_connection_svg__WEBPACK_IMPORTED_MODULE_8___default.a }) : null)) : null), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _library_item_css__WEBPACK_IMPORTED_MODULE_5___default.a.featuredExtensionCollaboration }, this.props.collaborator ? react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_0__["FormattedMessage"], { defaultMessage: "Collaboration with", id: "gui.extensionLibrary.collaboration" })), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _library_item_css__WEBPACK_IMPORTED_MODULE_5___default.a.featuredExtensionMetadataDetail }, this.props.collaborator)) : null)) : null) : react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_6___default()(_library_item_css__WEBPACK_IMPORTED_MODULE_5___default.a.libraryItem, this.props.hidden ? _library_item_css__WEBPACK_IMPORTED_MODULE_5___default.a.hidden : null), role: "button", tabIndex: "0", onBlur: this.props.onBlur, onClick: this.props.onClick, onFocus: this.props.onFocus, onKeyPress: this.props.onKeyPress, onMouseEnter: this.props.onMouseEnter, onMouseLeave: this.props.onMouseLeave }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _library_item_css__WEBPACK_IMPORTED_MODULE_5___default.a.libraryItemImageContainerWrapper }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _library_item_css__WEBPACK_IMPORTED_MODULE_5___default.a.libraryItemImageContainer }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_scratch_image_scratch_image_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: _library_item_css__WEBPACK_IMPORTED_MODULE_5___default.a.libraryItemImage, imageSource: this.props.iconSource }))), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("span", { className: _library_item_css__WEBPACK_IMPORTED_MODULE_5___default.a.libraryItemName }, this.props.name)); } }]); return LibraryItemComponent; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.PureComponent); /* eslint-enable react/prefer-stateless-function */ LibraryItemComponent.propTypes = { bluetoothRequired: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, collaborator: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, description: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node]), disabled: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, extensionId: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, featured: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, hidden: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, iconSource: _scratch_image_scratch_image_jsx__WEBPACK_IMPORTED_MODULE_4__["default"].ImageSourcePropType, insetIconURL: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, internetConnectionRequired: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, name: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node]), onBlur: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, onClick: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, onFocus: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, onKeyPress: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, onMouseEnter: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, onMouseLeave: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired }; LibraryItemComponent.defaultProps = { disabled: false }; /* harmony default export */ __webpack_exports__["default"] = (LibraryItemComponent); /***/ }), /***/ "./src/components/library/library.css": /*!********************************************!*\ !*** ./src/components/library/library.css ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./library.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/library/library.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/library/library.jsx": /*!********************************************!*\ !*** ./src/components/library/library.jsx ***! \********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _containers_library_item_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../containers/library-item.jsx */ "./src/containers/library-item.jsx"); /* harmony import */ var _containers_modal_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../containers/modal.jsx */ "./src/containers/modal.jsx"); /* harmony import */ var _divider_divider_jsx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../divider/divider.jsx */ "./src/components/divider/divider.jsx"); /* harmony import */ var _filter_filter_jsx__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../filter/filter.jsx */ "./src/components/filter/filter.jsx"); /* harmony import */ var _containers_tag_button_jsx__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../containers/tag-button.jsx */ "./src/containers/tag-button.jsx"); /* harmony import */ var _lib_storage__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../lib/storage */ "./src/lib/storage.js"); /* harmony import */ var _library_css__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./library.css */ "./src/components/library/library.css"); /* harmony import */ var _library_css__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_library_css__WEBPACK_IMPORTED_MODULE_11__); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_4__["defineMessages"])({ filterPlaceholder: { "id": "gui.library.filterPlaceholder", "defaultMessage": "Search" }, allTag: { "id": "gui.library.allTag", "defaultMessage": "All" } }); var ALL_TAG = { tag: 'all', intlLabel: messages.allTag }; var tagListPrefix = [ALL_TAG]; /** * Find the AssetType which corresponds to a particular file extension. For example, 'png' => AssetType.ImageBitmap. * @param {string} fileExtension - the file extension to look up. * @returns {AssetType} - the AssetType corresponding to the extension, if any. */ var getAssetTypeForFileExtension = function getAssetTypeForFileExtension(fileExtension) { var compareOptions = { sensitivity: 'accent', usage: 'search' }; for (var assetTypeId in _lib_storage__WEBPACK_IMPORTED_MODULE_10__["default"].AssetType) { var assetType = _lib_storage__WEBPACK_IMPORTED_MODULE_10__["default"].AssetType[assetTypeId]; if (fileExtension.localeCompare(assetType.runtimeFormat, compareOptions) === 0) { return assetType; } } }; /** * Figure out an `imageSource` (URI or asset ID & type) for a library item's icon. * @param {object} item - either a library item or one of a library item's costumes. * @returns {object} - an `imageSource` ready to be passed to a `ScratchImage`. */ var getItemImageSource = function getItemImageSource(item) { if (item.rawURL) { return { uri: item.rawURL }; } // TODO: adjust libraries to be more storage-friendly; don't use split() here. var md5 = item.md5 || item.baseLayerMD5; if (md5) { var _md5$split = md5.split('.'), _md5$split2 = _slicedToArray(_md5$split, 2), assetId = _md5$split2[0], fileExtension = _md5$split2[1]; return { assetId: assetId, assetType: getAssetTypeForFileExtension(fileExtension) }; } }; var LibraryComponent = /*#__PURE__*/ function (_React$Component) { _inherits(LibraryComponent, _React$Component); function LibraryComponent(props) { var _this; _classCallCheck(this, LibraryComponent); _this = _possibleConstructorReturn(this, _getPrototypeOf(LibraryComponent).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_1___default()(_assertThisInitialized(_this), ['handleClose', 'handleFilterChange', 'handleFilterClear', 'handleMouseEnter', 'handleMouseLeave', 'handleSelect', 'handleTagClick', 'setFilteredDataRef']); _this.state = { selectedItem: null, filterQuery: '', selectedTag: ALL_TAG.tag }; return _this; } _createClass(LibraryComponent, [{ key: "componentDidUpdate", value: function componentDidUpdate(prevProps, prevState) { if (prevState.filterQuery !== this.state.filterQuery || prevState.selectedTag !== this.state.selectedTag) { this.scrollToTop(); } } }, { key: "handleSelect", value: function handleSelect(id) { this.handleClose(); this.props.onItemSelected(this.getFilteredData()[id]); } }, { key: "handleClose", value: function handleClose() { this.props.onRequestClose(); } }, { key: "handleTagClick", value: function handleTagClick(tag) { this.setState({ filterQuery: '', selectedTag: tag.toLowerCase() }); } }, { key: "handleMouseEnter", value: function handleMouseEnter(id) { if (this.props.onItemMouseEnter) this.props.onItemMouseEnter(this.getFilteredData()[id]); } }, { key: "handleMouseLeave", value: function handleMouseLeave(id) { if (this.props.onItemMouseLeave) this.props.onItemMouseLeave(this.getFilteredData()[id]); } }, { key: "handleFilterChange", value: function handleFilterChange(event) { this.setState({ filterQuery: event.target.value, selectedTag: ALL_TAG.tag }); } }, { key: "handleFilterClear", value: function handleFilterClear() { this.setState({ filterQuery: '' }); } }, { key: "getFilteredData", value: function getFilteredData() { var _this2 = this; if (this.state.selectedTag === 'all') { if (!this.state.filterQuery) return this.props.data; return this.props.data.filter(function (dataItem) { return (dataItem.tags || []). // Second argument to map sets `this` map(String.prototype.toLowerCase.call, String.prototype.toLowerCase).concat(dataItem.name ? (typeof dataItem.name === 'string' ? // Use the name if it is a string, else use formatMessage to get the translated name dataItem.name : _this2.props.intl.formatMessage(dataItem.name.props)).toLowerCase() : null).join('\n') // unlikely to partially match newlines .indexOf(_this2.state.filterQuery.toLowerCase()) !== -1; }); } return this.props.data.filter(function (dataItem) { return dataItem.tags && dataItem.tags.map(String.prototype.toLowerCase.call, String.prototype.toLowerCase).indexOf(_this2.state.selectedTag) !== -1; }); } }, { key: "scrollToTop", value: function scrollToTop() { this.filteredDataRef.scrollTop = 0; } }, { key: "setFilteredDataRef", value: function setFilteredDataRef(ref) { this.filteredDataRef = ref; } }, { key: "render", value: function render() { var _this3 = this; return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_containers_modal_jsx__WEBPACK_IMPORTED_MODULE_6__["default"], { fullScreen: true, contentLabel: this.props.title, id: this.props.id, onRequestClose: this.handleClose }, (this.props.filterable || this.props.tags) && react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", { className: _library_css__WEBPACK_IMPORTED_MODULE_11___default.a.filterBar }, this.props.filterable && react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_filter_filter_jsx__WEBPACK_IMPORTED_MODULE_8__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_library_css__WEBPACK_IMPORTED_MODULE_11___default.a.filterBarItem, _library_css__WEBPACK_IMPORTED_MODULE_11___default.a.filter), filterQuery: this.state.filterQuery, inputClassName: _library_css__WEBPACK_IMPORTED_MODULE_11___default.a.filterInput, placeholderText: this.props.intl.formatMessage(messages.filterPlaceholder), onChange: this.handleFilterChange, onClear: this.handleFilterClear }), this.props.filterable && this.props.tags && react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_divider_divider_jsx__WEBPACK_IMPORTED_MODULE_7__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_library_css__WEBPACK_IMPORTED_MODULE_11___default.a.filterBarItem, _library_css__WEBPACK_IMPORTED_MODULE_11___default.a.divider) }), this.props.tags && react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", { className: _library_css__WEBPACK_IMPORTED_MODULE_11___default.a.tagWrapper }, tagListPrefix.concat(this.props.tags).map(function (tagProps, id) { return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_containers_tag_button_jsx__WEBPACK_IMPORTED_MODULE_9__["default"], _extends({ active: _this3.state.selectedTag === tagProps.tag.toLowerCase(), className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_library_css__WEBPACK_IMPORTED_MODULE_11___default.a.filterBarItem, _library_css__WEBPACK_IMPORTED_MODULE_11___default.a.tagButton, tagProps.className), key: "tag-button-".concat(id), onClick: _this3.handleTagClick }, tagProps)); }))), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_library_css__WEBPACK_IMPORTED_MODULE_11___default.a.libraryScrollGrid, _defineProperty({}, _library_css__WEBPACK_IMPORTED_MODULE_11___default.a.withFilterBar, this.props.filterable || this.props.tags)), ref: this.setFilteredDataRef }, this.getFilteredData().map(function (dataItem, index) { var iconSource = getItemImageSource(dataItem); var icons = dataItem.json && dataItem.json.costumes.map(getItemImageSource); return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_containers_library_item_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { bluetoothRequired: dataItem.bluetoothRequired, collaborator: dataItem.collaborator, description: dataItem.description, disabled: dataItem.disabled, extensionId: dataItem.extensionId, featured: dataItem.featured, hidden: dataItem.hidden, iconSource: iconSource, icons: icons, id: index, insetIconURL: dataItem.insetIconURL, internetConnectionRequired: dataItem.internetConnectionRequired, key: "item_".concat(index), name: dataItem.name, onMouseEnter: _this3.handleMouseEnter, onMouseLeave: _this3.handleMouseLeave, onSelect: _this3.handleSelect }); }))); } }]); return LibraryComponent; }(react__WEBPACK_IMPORTED_MODULE_3___default.a.Component); LibraryComponent.propTypes = { data: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.arrayOf( /* eslint-disable react/no-unused-prop-types, lines-around-comment */ // An item in the library prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.shape({ // @todo remove md5/rawURL prop from library, refactor to use storage md5: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, name: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.node]), rawURL: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string }) /* eslint-enable react/no-unused-prop-types, lines-around-comment */ ), filterable: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, id: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string.isRequired, intl: react_intl__WEBPACK_IMPORTED_MODULE_4__["intlShape"].isRequired, onItemMouseEnter: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onItemMouseLeave: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onItemSelected: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onRequestClose: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, tags: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.shape(_containers_tag_button_jsx__WEBPACK_IMPORTED_MODULE_9__["default"].propTypes)), title: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string.isRequired }; LibraryComponent.defaultProps = { filterable: true }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_4__["injectIntl"])(LibraryComponent)); /***/ }), /***/ "./src/components/loader/bottom-block.svg": /*!************************************************!*\ !*** ./src/components/loader/bottom-block.svg ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/ce5820b006d753e4133f46ae776f4d96.svg"; /***/ }), /***/ "./src/components/loader/loader.css": /*!******************************************!*\ !*** ./src/components/loader/loader.css ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./loader.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/loader/loader.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/loader/loader.jsx": /*!******************************************!*\ !*** ./src/components/loader/loader.jsx ***! \******************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _loader_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./loader.css */ "./src/components/loader/loader.css"); /* harmony import */ var _loader_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_loader_css__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _top_block_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./top-block.svg */ "./src/components/loader/top-block.svg"); /* harmony import */ var _top_block_svg__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_top_block_svg__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _middle_block_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./middle-block.svg */ "./src/components/loader/middle-block.svg"); /* harmony import */ var _middle_block_svg__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_middle_block_svg__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _bottom_block_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./bottom-block.svg */ "./src/components/loader/bottom-block.svg"); /* harmony import */ var _bottom_block_svg__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_bottom_block_svg__WEBPACK_IMPORTED_MODULE_7__); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var messages = [{ message: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Creating blocks \u2026", id: "gui.loader.message1" }), weight: 50 }, { message: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Loading sprites \u2026", id: "gui.loader.message2" }), weight: 50 }, { message: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Loading sounds \u2026", id: "gui.loader.message3" }), weight: 50 }, { message: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Loading extensions \u2026", id: "gui.loader.message4" }), weight: 50 }, { message: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Creating blocks \u2026", id: "gui.loader.message1" }), weight: 20 }, { message: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Herding cats \u2026", id: "gui.loader.message5" }), weight: 1 }, { message: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Transmitting nanos \u2026", id: "gui.loader.message6" }), weight: 1 }, { message: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Inflating gobos \u2026", id: "gui.loader.message7" }), weight: 1 }, { message: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Preparing emojis \u2026", id: "gui.loader.message8" }), weight: 1 }]; var mainMessages = { 'gui.loader.headline': react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Loading Project", id: "gui.loader.headline" }), 'gui.loader.creating': react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Creating Project", id: "gui.loader.creating" }) }; var LoaderComponent = /*#__PURE__*/ function (_React$Component) { _inherits(LoaderComponent, _React$Component); function LoaderComponent(props) { var _this; _classCallCheck(this, LoaderComponent); _this = _possibleConstructorReturn(this, _getPrototypeOf(LoaderComponent).call(this, props)); _this.state = { messageNumber: _this.chooseRandomMessage() }; return _this; } _createClass(LoaderComponent, [{ key: "componentDidMount", value: function componentDidMount() { var _this2 = this; // Start an interval to choose a new message every 5 seconds this.intervalId = setInterval(function () { _this2.setState({ messageNumber: _this2.chooseRandomMessage() }); }, 5000); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { clearInterval(this.intervalId); // HACK: In Sugarizer wait the end of "Creating project" window, then launch "Loading project" process var getUrlParameter = function getUrlParameter(name) { var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search); return match && decodeURIComponent(match[1].replace(/\+/g, ' ')); }; if (this.props.messageId == "gui.loader.creating" && getUrlParameter("o")) { var found = null; for (var i = 0; i < document.body.getElementsByTagName("span").length; i++) { var spanElement = document.getElementsByTagName("span")[i]; if (spanElement.innerHTML == "Load from Sugarizer") { found = spanElement; break; } } console.log(found ? "Injected successfully" : "Unable to inject"); if (found) { var loadInterval = window.setInterval(function () { var dataURI = document.getElementById("myBlocks").value; if (dataURI) { clearInterval(loadInterval); found.click(); } }, 500); } } } }, { key: "chooseRandomMessage", value: function chooseRandomMessage() { var messageNumber; var sum = messages.reduce(function (acc, m) { return acc + m.weight; }, 0); var rand = sum * Math.random(); for (var i = 0; i < messages.length; i++) { rand -= messages[i].weight; if (rand <= 0) { messageNumber = i; break; } } return messageNumber; } }, { key: "render", value: function render() { return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_loader_css__WEBPACK_IMPORTED_MODULE_3___default.a.background, _defineProperty({}, _loader_css__WEBPACK_IMPORTED_MODULE_3___default.a.fullscreen, this.props.isFullScreen)) }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _loader_css__WEBPACK_IMPORTED_MODULE_3___default.a.container }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _loader_css__WEBPACK_IMPORTED_MODULE_3___default.a.blockAnimation }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("img", { className: _loader_css__WEBPACK_IMPORTED_MODULE_3___default.a.topBlock, src: _top_block_svg__WEBPACK_IMPORTED_MODULE_5___default.a }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("img", { className: _loader_css__WEBPACK_IMPORTED_MODULE_3___default.a.middleBlock, src: _middle_block_svg__WEBPACK_IMPORTED_MODULE_6___default.a }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("img", { className: _loader_css__WEBPACK_IMPORTED_MODULE_3___default.a.bottomBlock, src: _bottom_block_svg__WEBPACK_IMPORTED_MODULE_7___default.a })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _loader_css__WEBPACK_IMPORTED_MODULE_3___default.a.title }, mainMessages[this.props.messageId]), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _loader_css__WEBPACK_IMPORTED_MODULE_3___default.a.messageContainerOuter }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _loader_css__WEBPACK_IMPORTED_MODULE_3___default.a.messageContainerInner, style: { transform: "translate(0, -".concat(this.state.messageNumber * 25, "px)") } }, messages.map(function (m, i) { return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _loader_css__WEBPACK_IMPORTED_MODULE_3___default.a.message, key: i }, m.message); }))))); } }]); return LoaderComponent; }(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component); LoaderComponent.propTypes = { isFullScreen: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, messageId: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.string }; LoaderComponent.defaultProps = { isFullScreen: false, messageId: 'gui.loader.headline' }; /* harmony default export */ __webpack_exports__["default"] = (LoaderComponent); /***/ }), /***/ "./src/components/loader/middle-block.svg": /*!************************************************!*\ !*** ./src/components/loader/middle-block.svg ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/f9dce53613d5f85b311ce9f84423c08b.svg"; /***/ }), /***/ "./src/components/loader/top-block.svg": /*!*********************************************!*\ !*** ./src/components/loader/top-block.svg ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/bbbd98ae6a34eac772e34a57aaa5f977.svg"; /***/ }), /***/ "./src/components/loupe/loupe.css": /*!****************************************!*\ !*** ./src/components/loupe/loupe.css ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./loupe.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/loupe/loupe.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/loupe/loupe.jsx": /*!****************************************!*\ !*** ./src/components/loupe/loupe.jsx ***! \****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _loupe_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./loupe.css */ "./src/components/loupe/loupe.css"); /* harmony import */ var _loupe_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_loupe_css__WEBPACK_IMPORTED_MODULE_4__); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var zoomScale = 3; var LoupeComponent = /*#__PURE__*/ function (_React$Component) { _inherits(LoupeComponent, _React$Component); function LoupeComponent(props) { var _this; _classCallCheck(this, LoupeComponent); _this = _possibleConstructorReturn(this, _getPrototypeOf(LoupeComponent).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_2___default()(_assertThisInitialized(_this), ['setCanvas']); return _this; } _createClass(LoupeComponent, [{ key: "componentDidUpdate", value: function componentDidUpdate() { this.draw(); } }, { key: "draw", value: function draw() { var boxSize = 6 / zoomScale; var boxLineWidth = 1 / zoomScale; var colorRingWidth = 15 / zoomScale; var ctx = this.canvas.getContext('2d'); var _this$props$colorInfo = this.props.colorInfo, color = _this$props$colorInfo.color, data = _this$props$colorInfo.data, width = _this$props$colorInfo.width, height = _this$props$colorInfo.height; this.canvas.width = zoomScale * width; this.canvas.height = zoomScale * height; // In order to scale the image data, must draw to a tmp canvas first var tmpCanvas = document.createElement('canvas'); tmpCanvas.width = width; tmpCanvas.height = height; var tmpCtx = tmpCanvas.getContext('2d'); var imageData = tmpCtx.createImageData(width, height); imageData.data.set(data); tmpCtx.putImageData(imageData, 0, 0); // Scale the loupe canvas and draw the zoomed image ctx.save(); ctx.scale(zoomScale, zoomScale); ctx.drawImage(tmpCanvas, 0, 0, width, height); // Draw an outlined square at the cursor position (cursor is hidden) ctx.lineWidth = boxLineWidth; ctx.strokeStyle = 'black'; ctx.fillStyle = "rgba(".concat(color.r, ", ").concat(color.g, ", ").concat(color.b, ", ").concat(color.a, ")"); ctx.beginPath(); ctx.rect(width / 2 - boxSize / 2, height / 2 - boxSize / 2, boxSize, boxSize); ctx.fill(); ctx.stroke(); // Draw a thick ring around the loupe showing the current color ctx.strokeStyle = "rgba(".concat(color.r, ", ").concat(color.g, ", ").concat(color.b, ", ").concat(color.a, ")"); ctx.lineWidth = colorRingWidth; ctx.beginPath(); ctx.moveTo(width, height / 2); ctx.arc(width / 2, height / 2, width / 2, 0, 2 * Math.PI); ctx.stroke(); ctx.restore(); } }, { key: "setCanvas", value: function setCanvas(element) { this.canvas = element; } }, { key: "render", value: function render() { var _this$props = this.props, colorInfo = _this$props.colorInfo, boxProps = _objectWithoutProperties(_this$props, ["colorInfo"]); return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], _extends({}, boxProps, { className: _loupe_css__WEBPACK_IMPORTED_MODULE_4___default.a.colorPicker, componentRef: this.setCanvas, element: "canvas", height: colorInfo.height, style: { top: colorInfo.y - zoomScale * colorInfo.height / 2, left: colorInfo.x - zoomScale * colorInfo.width / 2, width: colorInfo.width * zoomScale, height: colorInfo.height * zoomScale }, width: colorInfo.width })); } }]); return LoupeComponent; }(react__WEBPACK_IMPORTED_MODULE_1___default.a.Component); LoupeComponent.propTypes = { colorInfo: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({ color: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({ r: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number, g: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number, b: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number }), data: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.instanceOf(Uint8Array), width: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number, height: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number, x: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number, y: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number }) }; /* harmony default export */ __webpack_exports__["default"] = (LoupeComponent); /***/ }), /***/ "./src/components/menu-bar/account-nav.css": /*!*************************************************!*\ !*** ./src/components/menu-bar/account-nav.css ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./account-nav.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/menu-bar/account-nav.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/menu-bar/account-nav.jsx": /*!*************************************************!*\ !*** ./src/components/menu-bar/account-nav.jsx ***! \*************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _menu_bar_menu_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./menu-bar-menu.jsx */ "./src/components/menu-bar/menu-bar-menu.jsx"); /* harmony import */ var _menu_menu_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../menu/menu.jsx */ "./src/components/menu/menu.jsx"); /* harmony import */ var _containers_menu_item_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../containers/menu-item.jsx */ "./src/containers/menu-item.jsx"); /* harmony import */ var _user_avatar_jsx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./user-avatar.jsx */ "./src/components/menu-bar/user-avatar.jsx"); /* harmony import */ var _dropdown_caret_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./dropdown-caret.svg */ "./src/components/menu-bar/dropdown-caret.svg"); /* harmony import */ var _dropdown_caret_svg__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_dropdown_caret_svg__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _account_nav_css__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./account-nav.css */ "./src/components/menu-bar/account-nav.css"); /* harmony import */ var _account_nav_css__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_account_nav_css__WEBPACK_IMPORTED_MODULE_9__); /* NOTE: this file only temporarily resides in scratch-gui. Nearly identical code appears in scratch-www, and the two should eventually be consolidated. */ var AccountNavComponent = function AccountNavComponent(_ref) { var className = _ref.className, classroomId = _ref.classroomId, isEducator = _ref.isEducator, isOpen = _ref.isOpen, isRtl = _ref.isRtl, isStudent = _ref.isStudent, menuBarMenuClassName = _ref.menuBarMenuClassName, onClick = _ref.onClick, onClose = _ref.onClose, onLogOut = _ref.onLogOut, profileUrl = _ref.profileUrl, thumbnailUrl = _ref.thumbnailUrl, username = _ref.username; return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_3___default.a.Fragment, null, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_account_nav_css__WEBPACK_IMPORTED_MODULE_9___default.a.userInfo, className), onMouseUp: onClick }, thumbnailUrl ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_user_avatar_jsx__WEBPACK_IMPORTED_MODULE_7__["default"], { className: _account_nav_css__WEBPACK_IMPORTED_MODULE_9___default.a.avatar, imageUrl: thumbnailUrl }) : null, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("span", { className: _account_nav_css__WEBPACK_IMPORTED_MODULE_9___default.a.profileName }, username), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", { className: _account_nav_css__WEBPACK_IMPORTED_MODULE_9___default.a.dropdownCaretPosition }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("img", { className: _account_nav_css__WEBPACK_IMPORTED_MODULE_9___default.a.dropdownCaretIcon, src: _dropdown_caret_svg__WEBPACK_IMPORTED_MODULE_8___default.a }))), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_menu_bar_menu_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: menuBarMenuClassName, open: isOpen // note: the Rtl styles are switched here, because this menu is justified // opposite all the others , place: isRtl ? 'right' : 'left', onRequestClose: onClose }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_containers_menu_item_jsx__WEBPACK_IMPORTED_MODULE_6__["default"], { href: profileUrl }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Profile", id: "gui.accountMenu.profile" })), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_containers_menu_item_jsx__WEBPACK_IMPORTED_MODULE_6__["default"], { href: "/mystuff/" }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "My Stuff", id: "gui.accountMenu.myStuff" })), isEducator ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_containers_menu_item_jsx__WEBPACK_IMPORTED_MODULE_6__["default"], { href: "/educators/classes/" }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "My Classes", id: "gui.accountMenu.myClasses" })) : null, isStudent ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_containers_menu_item_jsx__WEBPACK_IMPORTED_MODULE_6__["default"], { href: "/classes/".concat(classroomId, "/") }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "My Class", id: "gui.accountMenu.myClass" })) : null, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_containers_menu_item_jsx__WEBPACK_IMPORTED_MODULE_6__["default"], { href: "/accounts/settings/" }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Account settings", id: "gui.accountMenu.accountSettings" })), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_menu_menu_jsx__WEBPACK_IMPORTED_MODULE_5__["MenuSection"], null, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_containers_menu_item_jsx__WEBPACK_IMPORTED_MODULE_6__["default"], { onClick: onLogOut }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Sign out", id: "gui.accountMenu.signOut" }))))); }; AccountNavComponent.propTypes = { className: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, classroomId: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, isEducator: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, isOpen: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, isRtl: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, isStudent: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, menuBarMenuClassName: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, onClick: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onClose: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onLogOut: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, profileUrl: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, thumbnailUrl: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, username: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string }; /* harmony default export */ __webpack_exports__["default"] = (AccountNavComponent); /***/ }), /***/ "./src/components/menu-bar/author-info.css": /*!*************************************************!*\ !*** ./src/components/menu-bar/author-info.css ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./author-info.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/menu-bar/author-info.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/menu-bar/author-info.jsx": /*!*************************************************!*\ !*** ./src/components/menu-bar/author-info.jsx ***! \*************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _user_avatar_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./user-avatar.jsx */ "./src/components/menu-bar/user-avatar.jsx"); /* harmony import */ var _author_info_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./author-info.css */ "./src/components/menu-bar/author-info.css"); /* harmony import */ var _author_info_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_author_info_css__WEBPACK_IMPORTED_MODULE_5__); var AuthorInfo = function AuthorInfo(_ref) { var className = _ref.className, imageUrl = _ref.imageUrl, projectTitle = _ref.projectTitle, userId = _ref.userId, username = _ref.username; return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, _author_info_css__WEBPACK_IMPORTED_MODULE_5___default.a.authorInfo) }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_user_avatar_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: _author_info_css__WEBPACK_IMPORTED_MODULE_5___default.a.avatar, imageUrl: imageUrl }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _author_info_css__WEBPACK_IMPORTED_MODULE_5___default.a.titleAuthor }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("span", { className: _author_info_css__WEBPACK_IMPORTED_MODULE_5___default.a.projectTitle }, projectTitle), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("span", { className: _author_info_css__WEBPACK_IMPORTED_MODULE_5___default.a.usernameLine }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "by {username}", id: "gui.authorInfo.byUser", values: { username: react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("span", { className: _author_info_css__WEBPACK_IMPORTED_MODULE_5___default.a.username }, username) } }))))); }; AuthorInfo.propTypes = { className: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, imageUrl: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, projectTitle: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, userId: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool]), username: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool]) }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_3__["injectIntl"])(AuthorInfo)); /***/ }), /***/ "./src/components/menu-bar/community-button.css": /*!******************************************************!*\ !*** ./src/components/menu-bar/community-button.css ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./community-button.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/menu-bar/community-button.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/menu-bar/community-button.jsx": /*!******************************************************!*\ !*** ./src/components/menu-bar/community-button.jsx ***! \******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _button_button_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../button/button.jsx */ "./src/components/button/button.jsx"); /* harmony import */ var _icon_see_community_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./icon--see-community.svg */ "./src/components/menu-bar/icon--see-community.svg"); /* harmony import */ var _icon_see_community_svg__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_icon_see_community_svg__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _community_button_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./community-button.css */ "./src/components/menu-bar/community-button.css"); /* harmony import */ var _community_button_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_community_button_css__WEBPACK_IMPORTED_MODULE_6__); var CommunityButton = function CommunityButton(_ref) { var className = _ref.className, onClick = _ref.onClick; return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_button_button_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(className, _community_button_css__WEBPACK_IMPORTED_MODULE_6___default.a.communityButton), iconClassName: _community_button_css__WEBPACK_IMPORTED_MODULE_6___default.a.communityButtonIcon, iconSrc: _icon_see_community_svg__WEBPACK_IMPORTED_MODULE_5___default.a, onClick: onClick }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "See Project Page", id: "gui.menuBar.seeProjectPage" })); }; CommunityButton.propTypes = { className: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, onClick: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func }; CommunityButton.defaultProps = { onClick: function onClick() {} }; /* harmony default export */ __webpack_exports__["default"] = (CommunityButton); /***/ }), /***/ "./src/components/menu-bar/dropdown-caret.svg": /*!****************************************************!*\ !*** ./src/components/menu-bar/dropdown-caret.svg ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/664d94e5cb8676c780c74c695f2e972c.svg"; /***/ }), /***/ "./src/components/menu-bar/icon--mystuff.png": /*!***************************************************!*\ !*** ./src/components/menu-bar/icon--mystuff.png ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/e764d9d9a7a12892e0845b11cd4202df.png"; /***/ }), /***/ "./src/components/menu-bar/icon--profile.png": /*!***************************************************!*\ !*** ./src/components/menu-bar/icon--profile.png ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/52797b48d511ecdd8e938684cee7638e.png"; /***/ }), /***/ "./src/components/menu-bar/icon--remix.svg": /*!*************************************************!*\ !*** ./src/components/menu-bar/icon--remix.svg ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/f8ff5dbef05bc3337cd3660fb956cffa.svg"; /***/ }), /***/ "./src/components/menu-bar/icon--see-community.svg": /*!*********************************************************!*\ !*** ./src/components/menu-bar/icon--see-community.svg ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/2f9cda00a530ac237fc24063067377c3.svg"; /***/ }), /***/ "./src/components/menu-bar/login-dropdown.css": /*!****************************************************!*\ !*** ./src/components/menu-bar/login-dropdown.css ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./login-dropdown.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/menu-bar/login-dropdown.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/menu-bar/login-dropdown.jsx": /*!****************************************************!*\ !*** ./src/components/menu-bar/login-dropdown.jsx ***! \****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _menu_bar_menu_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./menu-bar-menu.jsx */ "./src/components/menu-bar/menu-bar-menu.jsx"); /* harmony import */ var _login_dropdown_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./login-dropdown.css */ "./src/components/menu-bar/login-dropdown.css"); /* harmony import */ var _login_dropdown_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_login_dropdown_css__WEBPACK_IMPORTED_MODULE_5__); /* NOTE: this file only temporarily resides in scratch-gui. Nearly identical code appears in scratch-www, and the two should eventually be consolidated. */ // these are here as a hack to get them translated, so that equivalent messages will be translated // when passed in from www via gui's renderLogin() function var LoginDropdownMessages = Object(react_intl__WEBPACK_IMPORTED_MODULE_3__["defineMessages"])({ // eslint-disable-line no-unused-vars username: { "id": "general.username", "defaultMessage": "Username" }, password: { "id": "general.password", "defaultMessage": "Password" }, signin: { "id": "general.signIn", "defaultMessage": "Sign in" }, needhelp: { "id": "login.needHelp", "defaultMessage": "Need Help?" }, validationRequired: { "id": "form.validationRequired", "defaultMessage": "This field is required" } }); var LoginDropdown = function LoginDropdown(_ref) { var className = _ref.className, isOpen = _ref.isOpen, isRtl = _ref.isRtl, onClose = _ref.onClose, renderLogin = _ref.renderLogin; return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_menu_bar_menu_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: className, open: isOpen // note: the Rtl styles are switched here, because this menu is justified // opposite all the others , place: isRtl ? 'right' : 'left', onRequestClose: onClose }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_login_dropdown_css__WEBPACK_IMPORTED_MODULE_5___default.a.login) }, renderLogin({ onClose: onClose }))); }; LoginDropdown.propTypes = { className: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, isOpen: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, isRtl: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, onClose: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, renderLogin: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func }; /* harmony default export */ __webpack_exports__["default"] = (LoginDropdown); /***/ }), /***/ "./src/components/menu-bar/menu-bar-menu.jsx": /*!***************************************************!*\ !*** ./src/components/menu-bar/menu-bar-menu.jsx ***! \***************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _containers_menu_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../containers/menu.jsx */ "./src/containers/menu.jsx"); var MenuBarMenu = function MenuBarMenu(_ref) { var children = _ref.children, className = _ref.className, onRequestClose = _ref.onRequestClose, open = _ref.open, _ref$place = _ref.place, place = _ref$place === void 0 ? 'right' : _ref$place; return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: className }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_containers_menu_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], { open: open, place: place, onRequestClose: onRequestClose }, children)); }; MenuBarMenu.propTypes = { children: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.node, className: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, onRequestClose: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, open: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, place: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.oneOf(['left', 'right']) }; /* harmony default export */ __webpack_exports__["default"] = (MenuBarMenu); /***/ }), /***/ "./src/components/menu-bar/menu-bar.css": /*!**********************************************!*\ !*** ./src/components/menu-bar/menu-bar.css ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./menu-bar.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/menu-bar/menu-bar.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/menu-bar/menu-bar.jsx": /*!**********************************************!*\ !*** ./src/components/menu-bar/menu-bar.jsx ***! \**********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var redux__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! redux */ "./node_modules/redux/es/index.js"); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var bowser__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! bowser */ "./node_modules/bowser/src/bowser.js"); /* harmony import */ var bowser__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(bowser__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! scratch-vm */ "./node_modules/scratch-vm/src/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(scratch_vm__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _button_button_jsx__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../button/button.jsx */ "./src/components/button/button.jsx"); /* harmony import */ var _community_button_jsx__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./community-button.jsx */ "./src/components/menu-bar/community-button.jsx"); /* harmony import */ var _share_button_jsx__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./share-button.jsx */ "./src/components/menu-bar/share-button.jsx"); /* harmony import */ var _coming_soon_coming_soon_jsx__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../coming-soon/coming-soon.jsx */ "./src/components/coming-soon/coming-soon.jsx"); /* harmony import */ var _divider_divider_jsx__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../divider/divider.jsx */ "./src/components/divider/divider.jsx"); /* harmony import */ var _containers_language_selector_jsx__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../containers/language-selector.jsx */ "./src/containers/language-selector.jsx"); /* harmony import */ var _save_status_jsx__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./save-status.jsx */ "./src/components/menu-bar/save-status.jsx"); /* harmony import */ var _containers_sb_file_uploader_jsx__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../containers/sb-file-uploader.jsx */ "./src/containers/sb-file-uploader.jsx"); /* harmony import */ var _containers_project_watcher_jsx__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../containers/project-watcher.jsx */ "./src/containers/project-watcher.jsx"); /* harmony import */ var _menu_bar_menu_jsx__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./menu-bar-menu.jsx */ "./src/components/menu-bar/menu-bar-menu.jsx"); /* harmony import */ var _menu_menu_jsx__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../menu/menu.jsx */ "./src/components/menu/menu.jsx"); /* harmony import */ var _project_title_input_jsx__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./project-title-input.jsx */ "./src/components/menu-bar/project-title-input.jsx"); /* harmony import */ var _author_info_jsx__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./author-info.jsx */ "./src/components/menu-bar/author-info.jsx"); /* harmony import */ var _containers_account_nav_jsx__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../containers/account-nav.jsx */ "./src/containers/account-nav.jsx"); /* harmony import */ var _login_dropdown_jsx__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./login-dropdown.jsx */ "./src/components/menu-bar/login-dropdown.jsx"); /* harmony import */ var _containers_sb3_downloader_jsx__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../../containers/sb3-downloader.jsx */ "./src/containers/sb3-downloader.jsx"); /* harmony import */ var _containers_deletion_restorer_jsx__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../../containers/deletion-restorer.jsx */ "./src/containers/deletion-restorer.jsx"); /* harmony import */ var _containers_turbo_mode_jsx__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../../containers/turbo-mode.jsx */ "./src/containers/turbo-mode.jsx"); /* harmony import */ var _containers_menu_bar_hoc_jsx__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../../containers/menu-bar-hoc.jsx */ "./src/containers/menu-bar-hoc.jsx"); /* harmony import */ var _containers_sugarizer_saver_jsx__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../../containers/sugarizer-saver.jsx */ "./src/containers/sugarizer-saver.jsx"); /* harmony import */ var _containers_sugarizer_loader_jsx__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../../containers/sugarizer-loader.jsx */ "./src/containers/sugarizer-loader.jsx"); /* harmony import */ var _reducers_modals__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../../reducers/modals */ "./src/reducers/modals.js"); /* harmony import */ var _reducers_mode__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../../reducers/mode */ "./src/reducers/mode.js"); /* harmony import */ var _reducers_project_state__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../../reducers/project-state */ "./src/reducers/project-state.js"); /* harmony import */ var _reducers_menus__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../../reducers/menus */ "./src/reducers/menus.js"); /* harmony import */ var _lib_collect_metadata__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../../lib/collect-metadata */ "./src/lib/collect-metadata.js"); /* harmony import */ var _menu_bar_css__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./menu-bar.css */ "./src/components/menu-bar/menu-bar.css"); /* harmony import */ var _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default = /*#__PURE__*/__webpack_require__.n(_menu_bar_css__WEBPACK_IMPORTED_MODULE_36__); /* harmony import */ var _lib_assets_icon_tutorials_svg__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ../../lib/assets/icon--tutorials.svg */ "./src/lib/assets/icon--tutorials.svg"); /* harmony import */ var _lib_assets_icon_tutorials_svg__WEBPACK_IMPORTED_MODULE_37___default = /*#__PURE__*/__webpack_require__.n(_lib_assets_icon_tutorials_svg__WEBPACK_IMPORTED_MODULE_37__); /* harmony import */ var _icon_mystuff_png__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./icon--mystuff.png */ "./src/components/menu-bar/icon--mystuff.png"); /* harmony import */ var _icon_mystuff_png__WEBPACK_IMPORTED_MODULE_38___default = /*#__PURE__*/__webpack_require__.n(_icon_mystuff_png__WEBPACK_IMPORTED_MODULE_38__); /* harmony import */ var _icon_profile_png__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./icon--profile.png */ "./src/components/menu-bar/icon--profile.png"); /* harmony import */ var _icon_profile_png__WEBPACK_IMPORTED_MODULE_39___default = /*#__PURE__*/__webpack_require__.n(_icon_profile_png__WEBPACK_IMPORTED_MODULE_39__); /* harmony import */ var _icon_remix_svg__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./icon--remix.svg */ "./src/components/menu-bar/icon--remix.svg"); /* harmony import */ var _icon_remix_svg__WEBPACK_IMPORTED_MODULE_40___default = /*#__PURE__*/__webpack_require__.n(_icon_remix_svg__WEBPACK_IMPORTED_MODULE_40__); /* harmony import */ var _dropdown_caret_svg__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./dropdown-caret.svg */ "./src/components/menu-bar/dropdown-caret.svg"); /* harmony import */ var _dropdown_caret_svg__WEBPACK_IMPORTED_MODULE_41___default = /*#__PURE__*/__webpack_require__.n(_dropdown_caret_svg__WEBPACK_IMPORTED_MODULE_41__); /* harmony import */ var _language_selector_language_icon_svg__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ../language-selector/language-icon.svg */ "./src/components/language-selector/language-icon.svg"); /* harmony import */ var _language_selector_language_icon_svg__WEBPACK_IMPORTED_MODULE_42___default = /*#__PURE__*/__webpack_require__.n(_language_selector_language_icon_svg__WEBPACK_IMPORTED_MODULE_42__); /* harmony import */ var _scratch_logo_svg__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./scratch-logo.svg */ "./src/components/menu-bar/scratch-logo.svg"); /* harmony import */ var _scratch_logo_svg__WEBPACK_IMPORTED_MODULE_43___default = /*#__PURE__*/__webpack_require__.n(_scratch_logo_svg__WEBPACK_IMPORTED_MODULE_43__); /* harmony import */ var _lib_shared_messages__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ../../lib/shared-messages */ "./src/lib/shared-messages.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } // HACK: In Sugarizer, add two popup menu in the menubar to launch Save project and Load project // Both are launched by the activity.js file var ariaMessages = Object(react_intl__WEBPACK_IMPORTED_MODULE_3__["defineMessages"])({ language: { "id": "gui.menuBar.LanguageSelector", "defaultMessage": "language selector" }, tutorials: { "id": "gui.menuBar.tutorialsLibrary", "defaultMessage": "Tutorials" } }); var MenuBarItemTooltip = function MenuBarItemTooltip(_ref) { var children = _ref.children, className = _ref.className, enable = _ref.enable, id = _ref.id, _ref$place = _ref.place, place = _ref$place === void 0 ? 'bottom' : _ref$place; if (enable) { return react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_7___default.a.Fragment, null, children); } return react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_coming_soon_coming_soon_jsx__WEBPACK_IMPORTED_MODULE_13__["ComingSoonTooltip"], { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.comingSoon, className), place: place, tooltipClassName: _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.comingSoonTooltip, tooltipId: id }, children); }; MenuBarItemTooltip.propTypes = { children: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.node, className: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.string, enable: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, id: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.string, place: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.oneOf(['top', 'bottom', 'left', 'right']) }; var MenuItemTooltip = function MenuItemTooltip(_ref2) { var id = _ref2.id, isRtl = _ref2.isRtl, children = _ref2.children, className = _ref2.className; return react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_coming_soon_coming_soon_jsx__WEBPACK_IMPORTED_MODULE_13__["ComingSoonTooltip"], { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.comingSoon, className), isRtl: isRtl, place: isRtl ? 'left' : 'right', tooltipClassName: _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.comingSoonTooltip, tooltipId: id }, children); }; MenuItemTooltip.propTypes = { children: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.node, className: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.string, id: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.string, isRtl: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool }; var MenuBar = /*#__PURE__*/ function (_React$Component) { _inherits(MenuBar, _React$Component); function MenuBar(props) { var _this; _classCallCheck(this, MenuBar); _this = _possibleConstructorReturn(this, _getPrototypeOf(MenuBar).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_5___default()(_assertThisInitialized(_this), ['handleClickNew', 'handleClickRemix', 'handleClickSave', 'handleClickSaveAsCopy', 'handleClickSeeCommunity', 'handleClickShare', 'handleKeyPress', 'handleLanguageMouseUp', 'handleRestoreOption', 'handleSaveToComputer', 'restoreOptionMessage']); return _this; } _createClass(MenuBar, [{ key: "componentDidMount", value: function componentDidMount() { document.addEventListener('keydown', this.handleKeyPress); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { document.removeEventListener('keydown', this.handleKeyPress); } }, { key: "handleClickNew", value: function handleClickNew() { // if the project is dirty, and user owns the project, we will autosave. // but if they are not logged in and can't save, user should consider // downloading or logging in first. // Note that if user is logged in and editing someone else's project, // they'll lose their work. var readyToReplaceProject = this.props.confirmReadyToReplaceProject(this.props.intl.formatMessage(_lib_shared_messages__WEBPACK_IMPORTED_MODULE_44__["default"].replaceProjectWarning)); this.props.onRequestCloseFile(); if (readyToReplaceProject) { this.props.onClickNew(this.props.canSave && this.props.canCreateNew); } this.props.onRequestCloseFile(); } }, { key: "handleClickRemix", value: function handleClickRemix() { this.props.onClickRemix(); this.props.onRequestCloseFile(); } }, { key: "handleClickSave", value: function handleClickSave() { this.props.onClickSave(); this.props.onRequestCloseFile(); } }, { key: "handleClickSaveAsCopy", value: function handleClickSaveAsCopy() { this.props.onClickSaveAsCopy(); this.props.onRequestCloseFile(); } }, { key: "handleClickSeeCommunity", value: function handleClickSeeCommunity(waitForUpdate) { if (this.props.shouldSaveBeforeTransition()) { this.props.autoUpdateProject(); // save before transitioning to project page waitForUpdate(true); // queue the transition to project page } else { waitForUpdate(false); // immediately transition to project page } } }, { key: "handleClickShare", value: function handleClickShare(waitForUpdate) { if (!this.props.isShared) { if (this.props.canShare) { // save before transitioning to project page this.props.onShare(); } if (this.props.canSave) { // save before transitioning to project page this.props.autoUpdateProject(); waitForUpdate(true); // queue the transition to project page } else { waitForUpdate(false); // immediately transition to project page } } } }, { key: "handleRestoreOption", value: function handleRestoreOption(restoreFun) { var _this2 = this; return function () { restoreFun(); _this2.props.onRequestCloseEdit(); }; } }, { key: "handleKeyPress", value: function handleKeyPress(event) { var modifier = bowser__WEBPACK_IMPORTED_MODULE_6___default.a.mac ? event.metaKey : event.ctrlKey; if (modifier && event.key === 's') { this.props.onClickSave(); event.preventDefault(); } } }, { key: "handleSaveToComputer", value: function handleSaveToComputer(downloadProjectCallback) { var _this3 = this; return function () { _this3.props.onRequestCloseFile(); downloadProjectCallback(); if (_this3.props.onProjectTelemetryEvent) { var metadata = Object(_lib_collect_metadata__WEBPACK_IMPORTED_MODULE_35__["default"])(_this3.props.vm, _this3.props.projectTitle, _this3.props.locale); _this3.props.onProjectTelemetryEvent('projectDidSave', metadata); } }; } }, { key: "handleLanguageMouseUp", value: function handleLanguageMouseUp(e) { if (!this.props.languageMenuOpen) { this.props.onClickLanguage(e); } } }, { key: "restoreOptionMessage", value: function restoreOptionMessage(deletedItem) { switch (deletedItem) { case 'Sprite': return react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "Restore Sprite", id: "gui.menuBar.restoreSprite" }); case 'Sound': return react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "Restore Sound", id: "gui.menuBar.restoreSound" }); case 'Costume': return react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "Restore Costume", id: "gui.menuBar.restoreCostume" }); default: { return react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "Restore", /* eslint-disable-line max-len */ id: "gui.menuBar.restore" }); } } } }, { key: "render", value: function render() { var _this4 = this; var saveNowMessage = react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "Save now", id: "gui.menuBar.saveNow" }); var createCopyMessage = react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "Save as a copy", id: "gui.menuBar.saveAsCopy" }); var remixMessage = react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "Remix", id: "gui.menuBar.remix" }); var newProjectMessage = react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "New", id: "gui.menuBar.new" }); var remixButton = react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_button_button_jsx__WEBPACK_IMPORTED_MODULE_10__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.menuBarButton, _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.remixButton), iconClassName: _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.remixButtonIcon, iconSrc: _icon_remix_svg__WEBPACK_IMPORTED_MODULE_40___default.a, onClick: this.handleClickRemix }, remixMessage); return react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_9__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(this.props.className, _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.menuBar) }, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement("div", { className: _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.mainMenu }, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement("div", { className: _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.fileGroup }, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.menuBarItem) }, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement("img", { alt: "Scratch", className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.scratchLogo, _defineProperty({}, _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.clickable, typeof this.props.onClickLogo !== 'undefined')), draggable: false, src: _scratch_logo_svg__WEBPACK_IMPORTED_MODULE_43___default.a, onClick: this.props.onClickLogo })), react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.menuBarItem, _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.hoverable, _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.languageMenu) }, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement("img", { className: _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.languageIcon, src: _language_selector_language_icon_svg__WEBPACK_IMPORTED_MODULE_42___default.a }), react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement("img", { className: _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.languageCaret, src: _dropdown_caret_svg__WEBPACK_IMPORTED_MODULE_41___default.a })), react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_containers_language_selector_jsx__WEBPACK_IMPORTED_MODULE_15__["default"], { label: this.props.intl.formatMessage(ariaMessages.language) })), react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.menuBarItem, _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.hoverable, _defineProperty({}, _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.active, this.props.fileMenuOpen)), onMouseUp: this.props.onClickFile }, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "File", id: "gui.menuBar.file" }), react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_menu_bar_menu_jsx__WEBPACK_IMPORTED_MODULE_19__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.menuBarMenu), open: this.props.fileMenuOpen, place: this.props.isRtl ? 'left' : 'right', onRequestClose: this.props.onRequestCloseFile }, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_menu_menu_jsx__WEBPACK_IMPORTED_MODULE_20__["MenuSection"], null, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_menu_menu_jsx__WEBPACK_IMPORTED_MODULE_20__["MenuItem"], { isRtl: this.props.isRtl, onClick: this.handleClickNew }, newProjectMessage)), (this.props.canSave || this.props.canCreateCopy || this.props.canRemix) && react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_menu_menu_jsx__WEBPACK_IMPORTED_MODULE_20__["MenuSection"], null, this.props.canSave ? react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_menu_menu_jsx__WEBPACK_IMPORTED_MODULE_20__["MenuItem"], { onClick: this.handleClickSave }, saveNowMessage) : [], this.props.canCreateCopy ? react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_menu_menu_jsx__WEBPACK_IMPORTED_MODULE_20__["MenuItem"], { onClick: this.handleClickSaveAsCopy }, createCopyMessage) : [], this.props.canRemix ? react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_menu_menu_jsx__WEBPACK_IMPORTED_MODULE_20__["MenuItem"], { onClick: this.handleClickRemix }, remixMessage) : []), react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_menu_menu_jsx__WEBPACK_IMPORTED_MODULE_20__["MenuSection"], null, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_containers_sb_file_uploader_jsx__WEBPACK_IMPORTED_MODULE_17__["default"], { canSave: this.props.canSave, userOwnsProject: this.props.userOwnsProject, onUpdateProjectTitle: this.props.onUpdateProjectTitle }, function (className, renderFileInput, loadProject) { return react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_menu_menu_jsx__WEBPACK_IMPORTED_MODULE_20__["MenuItem"], { className: className, onClick: loadProject }, _this4.props.intl.formatMessage(_lib_shared_messages__WEBPACK_IMPORTED_MODULE_44__["default"].loadFromComputerTitle), renderFileInput()); }), react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_containers_sb3_downloader_jsx__WEBPACK_IMPORTED_MODULE_25__["default"], null, function (className, downloadProjectCallback) { return react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_menu_menu_jsx__WEBPACK_IMPORTED_MODULE_20__["MenuItem"], { className: className, onClick: _this4.handleSaveToComputer(downloadProjectCallback) }, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "Save to your computer", id: "gui.menuBar.downloadToComputer" })); })))), react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_containers_sugarizer_loader_jsx__WEBPACK_IMPORTED_MODULE_30__["default"], null, function (loadProject) { return react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_menu_menu_jsx__WEBPACK_IMPORTED_MODULE_20__["MenuItem"], { onClick: loadProject }, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "Load from Sugarizer", id: "gui.menuBar.loadFromSugarizer" })); }), react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_containers_sugarizer_saver_jsx__WEBPACK_IMPORTED_MODULE_29__["default"], null, function (saveProject) { return react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_menu_menu_jsx__WEBPACK_IMPORTED_MODULE_20__["MenuItem"], { onClick: saveProject }, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "Save to Sugarizer", id: "gui.menuBar.saveToSugarizer" })); }), react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.menuBarItem, _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.hoverable, _defineProperty({}, _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.active, this.props.editMenuOpen)), onMouseUp: this.props.onClickEdit }, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.editMenu) }, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "Edit", id: "gui.menuBar.edit" })), react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_menu_bar_menu_jsx__WEBPACK_IMPORTED_MODULE_19__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.menuBarMenu), open: this.props.editMenuOpen, place: this.props.isRtl ? 'left' : 'right', onRequestClose: this.props.onRequestCloseEdit }, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_containers_deletion_restorer_jsx__WEBPACK_IMPORTED_MODULE_26__["default"], null, function (handleRestore, _ref3) { var restorable = _ref3.restorable, deletedItem = _ref3.deletedItem; return react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_menu_menu_jsx__WEBPACK_IMPORTED_MODULE_20__["MenuItem"], { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_defineProperty({}, _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.disabled, !restorable)), onClick: _this4.handleRestoreOption(handleRestore) }, _this4.restoreOptionMessage(deletedItem)); }), react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_menu_menu_jsx__WEBPACK_IMPORTED_MODULE_20__["MenuSection"], null, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_containers_turbo_mode_jsx__WEBPACK_IMPORTED_MODULE_27__["default"], null, function (toggleTurboMode, _ref4) { var turboMode = _ref4.turboMode; return react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_menu_menu_jsx__WEBPACK_IMPORTED_MODULE_20__["MenuItem"], { onClick: toggleTurboMode }, turboMode ? react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "Turn off Turbo Mode", id: "gui.menuBar.turboModeOff" }) : react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "Turn on Turbo Mode", id: "gui.menuBar.turboModeOn" })); }))))), react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_divider_divider_jsx__WEBPACK_IMPORTED_MODULE_14__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.divider) }), react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement("div", { "aria-label": this.props.intl.formatMessage(ariaMessages.tutorials), className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.menuBarItem, _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.hoverable), onClick: this.props.onOpenTipLibrary }, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement("img", { className: _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.helpIcon, src: _lib_assets_icon_tutorials_svg__WEBPACK_IMPORTED_MODULE_37___default.a }), react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], ariaMessages.tutorials)), react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_divider_divider_jsx__WEBPACK_IMPORTED_MODULE_14__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.divider) }), this.props.canEditTitle ? react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.menuBarItem, _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.growable) }, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(MenuBarItemTooltip, { enable: true, id: "title-field" }, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_project_title_input_jsx__WEBPACK_IMPORTED_MODULE_21__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.titleFieldGrowable), onUpdateProjectTitle: this.props.onUpdateProjectTitle }))) : this.props.authorUsername && this.props.authorUsername !== this.props.username ? react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_author_info_jsx__WEBPACK_IMPORTED_MODULE_22__["default"], { className: _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.authorInfo, imageUrl: this.props.authorThumbnailUrl, projectTitle: this.props.projectTitle, userId: this.props.authorId, username: this.props.authorUsername }) : null, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.menuBarItem) }, this.props.canShare ? (this.props.isShowingProject || this.props.isUpdating) && react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_containers_project_watcher_jsx__WEBPACK_IMPORTED_MODULE_18__["default"], { onDoneUpdating: this.props.onSeeCommunity }, function (waitForUpdate) { return react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_share_button_jsx__WEBPACK_IMPORTED_MODULE_12__["default"], { className: _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.menuBarButton, isShared: _this4.props.isShared /* eslint-disable react/jsx-no-bind */ , onClick: function onClick() { _this4.handleClickShare(waitForUpdate); } /* eslint-enable react/jsx-no-bind */ }); }) : this.props.showComingSoon ? react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(MenuBarItemTooltip, { id: "share-button" }, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_share_button_jsx__WEBPACK_IMPORTED_MODULE_12__["default"], { className: _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.menuBarButton })) : [], this.props.canRemix ? remixButton : []), react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.menuBarItem, _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.communityButtonWrapper) }, this.props.enableCommunity ? (this.props.isShowingProject || this.props.isUpdating) && react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_containers_project_watcher_jsx__WEBPACK_IMPORTED_MODULE_18__["default"], { onDoneUpdating: this.props.onSeeCommunity }, function (waitForUpdate) { return react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_community_button_jsx__WEBPACK_IMPORTED_MODULE_11__["default"], { className: _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.menuBarButton /* eslint-disable react/jsx-no-bind */ , onClick: function onClick() { _this4.handleClickSeeCommunity(waitForUpdate); } /* eslint-enable react/jsx-no-bind */ }); }) : this.props.showComingSoon ? react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(MenuBarItemTooltip, { id: "community-button" }, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_community_button_jsx__WEBPACK_IMPORTED_MODULE_11__["default"], { className: _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.menuBarButton })) : [])), react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement("div", { className: _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.accountInfoGroup }, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement("div", { className: _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.menuBarItem }, this.props.canSave && react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_save_status_jsx__WEBPACK_IMPORTED_MODULE_16__["default"], null)), this.props.sessionExists ? this.props.username ? // ************ user is logged in ************ react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_7___default.a.Fragment, null, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement("a", { href: "/mystuff/" }, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.menuBarItem, _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.hoverable, _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.mystuffButton) }, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement("img", { className: _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.mystuffIcon, src: _icon_mystuff_png__WEBPACK_IMPORTED_MODULE_38___default.a }))), react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_containers_account_nav_jsx__WEBPACK_IMPORTED_MODULE_23__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.menuBarItem, _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.hoverable, _defineProperty({}, _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.active, this.props.accountMenuOpen)), isOpen: this.props.accountMenuOpen, isRtl: this.props.isRtl, menuBarMenuClassName: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.menuBarMenu), onClick: this.props.onClickAccount, onClose: this.props.onRequestCloseAccount, onLogOut: this.props.onLogOut })) : // ********* user not logged in, but a session exists // ********* so they can choose to log in react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_7___default.a.Fragment, null, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.menuBarItem, _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.hoverable), key: "join", onMouseUp: this.props.onOpenRegistration }, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "Join Scratch", id: "gui.menuBar.joinScratch" })), react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.menuBarItem, _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.hoverable), key: "login", onMouseUp: this.props.onClickLogin }, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "Sign in", id: "gui.menuBar.signIn" }), react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(_login_dropdown_jsx__WEBPACK_IMPORTED_MODULE_24__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.menuBarMenu), isOpen: this.props.loginMenuOpen, isRtl: this.props.isRtl, renderLogin: this.props.renderLogin, onClose: this.props.onRequestCloseLogin }))) : // ******** no login session is available, so don't show login stuff react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_7___default.a.Fragment, null, this.props.showComingSoon ? react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_7___default.a.Fragment, null, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(MenuBarItemTooltip, { id: "mystuff" }, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.menuBarItem, _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.hoverable, _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.mystuffButton) }, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement("img", { className: _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.mystuffIcon, src: _icon_mystuff_png__WEBPACK_IMPORTED_MODULE_38___default.a }))), react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(MenuBarItemTooltip, { id: "account-nav", place: this.props.isRtl ? 'right' : 'left' }, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.menuBarItem, _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.hoverable, _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.accountNavMenu) }, react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement("img", { className: _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.profileIcon, src: _icon_profile_png__WEBPACK_IMPORTED_MODULE_39___default.a }), react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement("span", null, 'scratch-cat'), react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement("img", { className: _menu_bar_css__WEBPACK_IMPORTED_MODULE_36___default.a.dropdownCaretIcon, src: _dropdown_caret_svg__WEBPACK_IMPORTED_MODULE_41___default.a })))) : []))); } }]); return MenuBar; }(react__WEBPACK_IMPORTED_MODULE_7___default.a.Component); MenuBar.propTypes = { accountMenuOpen: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, authorId: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool]), authorThumbnailUrl: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.string, authorUsername: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool]), autoUpdateProject: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, canCreateCopy: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, canCreateNew: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, canEditTitle: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, canRemix: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, canSave: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, canShare: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, className: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.string, confirmReadyToReplaceProject: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, editMenuOpen: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, enableCommunity: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, fileMenuOpen: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, intl: react_intl__WEBPACK_IMPORTED_MODULE_3__["intlShape"], isRtl: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, isShared: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, isShowingProject: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, isUpdating: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, languageMenuOpen: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, locale: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.string.isRequired, loginMenuOpen: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, onClickAccount: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, onClickEdit: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, onClickFile: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, onClickLanguage: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, onClickLogin: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, onClickLogo: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, onClickNew: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, onClickRemix: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, onClickSave: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, onClickSaveAsCopy: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, onLogOut: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, onOpenRegistration: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, onOpenTipLibrary: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, onProjectTelemetryEvent: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, onRequestCloseAccount: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, onRequestCloseEdit: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, onRequestCloseFile: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, onRequestCloseLanguage: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, onRequestCloseLogin: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, onSeeCommunity: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, onShare: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, onToggleLoginOpen: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, onUpdateProjectTitle: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, projectTitle: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.string, renderLogin: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, sessionExists: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, shouldSaveBeforeTransition: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, showComingSoon: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, userOwnsProject: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, username: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.string, vm: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.instanceOf(scratch_vm__WEBPACK_IMPORTED_MODULE_8___default.a).isRequired }; MenuBar.defaultProps = { onShare: function onShare() {} }; var mapStateToProps = function mapStateToProps(state, ownProps) { var loadingState = state.scratchGui.projectState.loadingState; var user = state.session && state.session.session && state.session.session.user; return { accountMenuOpen: Object(_reducers_menus__WEBPACK_IMPORTED_MODULE_34__["accountMenuOpen"])(state), fileMenuOpen: Object(_reducers_menus__WEBPACK_IMPORTED_MODULE_34__["fileMenuOpen"])(state), editMenuOpen: Object(_reducers_menus__WEBPACK_IMPORTED_MODULE_34__["editMenuOpen"])(state), isRtl: state.locales.isRtl, isUpdating: Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_33__["getIsUpdating"])(loadingState), isShowingProject: Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_33__["getIsShowingProject"])(loadingState), languageMenuOpen: Object(_reducers_menus__WEBPACK_IMPORTED_MODULE_34__["languageMenuOpen"])(state), locale: state.locales.locale, loginMenuOpen: Object(_reducers_menus__WEBPACK_IMPORTED_MODULE_34__["loginMenuOpen"])(state), projectTitle: state.scratchGui.projectTitle, sessionExists: state.session && typeof state.session.session !== 'undefined', username: user ? user.username : null, userOwnsProject: ownProps.authorUsername && user && ownProps.authorUsername === user.username, vm: state.scratchGui.vm }; }; var mapDispatchToProps = function mapDispatchToProps(dispatch) { return { autoUpdateProject: function autoUpdateProject() { return dispatch(Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_33__["autoUpdateProject"])()); }, onOpenTipLibrary: function onOpenTipLibrary() { return dispatch(Object(_reducers_modals__WEBPACK_IMPORTED_MODULE_31__["openTipsLibrary"])()); }, onClickAccount: function onClickAccount() { return dispatch(Object(_reducers_menus__WEBPACK_IMPORTED_MODULE_34__["openAccountMenu"])()); }, onRequestCloseAccount: function onRequestCloseAccount() { return dispatch(Object(_reducers_menus__WEBPACK_IMPORTED_MODULE_34__["closeAccountMenu"])()); }, onClickFile: function onClickFile() { return dispatch(Object(_reducers_menus__WEBPACK_IMPORTED_MODULE_34__["openFileMenu"])()); }, onRequestCloseFile: function onRequestCloseFile() { return dispatch(Object(_reducers_menus__WEBPACK_IMPORTED_MODULE_34__["closeFileMenu"])()); }, onClickEdit: function onClickEdit() { return dispatch(Object(_reducers_menus__WEBPACK_IMPORTED_MODULE_34__["openEditMenu"])()); }, onRequestCloseEdit: function onRequestCloseEdit() { return dispatch(Object(_reducers_menus__WEBPACK_IMPORTED_MODULE_34__["closeEditMenu"])()); }, onClickLanguage: function onClickLanguage() { return dispatch(Object(_reducers_menus__WEBPACK_IMPORTED_MODULE_34__["openLanguageMenu"])()); }, onRequestCloseLanguage: function onRequestCloseLanguage() { return dispatch(Object(_reducers_menus__WEBPACK_IMPORTED_MODULE_34__["closeLanguageMenu"])()); }, onClickLogin: function onClickLogin() { return dispatch(Object(_reducers_menus__WEBPACK_IMPORTED_MODULE_34__["openLoginMenu"])()); }, onRequestCloseLogin: function onRequestCloseLogin() { return dispatch(Object(_reducers_menus__WEBPACK_IMPORTED_MODULE_34__["closeLoginMenu"])()); }, onClickNew: function onClickNew(needSave) { return dispatch(Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_33__["requestNewProject"])(needSave)); }, onClickRemix: function onClickRemix() { return dispatch(Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_33__["remixProject"])()); }, onClickSave: function onClickSave() { return dispatch(Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_33__["manualUpdateProject"])()); }, onClickSaveAsCopy: function onClickSaveAsCopy() { return dispatch(Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_33__["saveProjectAsCopy"])()); }, onSeeCommunity: function onSeeCommunity() { return dispatch(Object(_reducers_mode__WEBPACK_IMPORTED_MODULE_32__["setPlayer"])(true)); } }; }; /* harmony default export */ __webpack_exports__["default"] = (Object(redux__WEBPACK_IMPORTED_MODULE_2__["compose"])(react_intl__WEBPACK_IMPORTED_MODULE_3__["injectIntl"], _containers_menu_bar_hoc_jsx__WEBPACK_IMPORTED_MODULE_28__["default"], Object(react_redux__WEBPACK_IMPORTED_MODULE_1__["connect"])(mapStateToProps, mapDispatchToProps))(MenuBar)); /***/ }), /***/ "./src/components/menu-bar/project-title-input.css": /*!*********************************************************!*\ !*** ./src/components/menu-bar/project-title-input.css ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./project-title-input.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/menu-bar/project-title-input.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/menu-bar/project-title-input.jsx": /*!*********************************************************!*\ !*** ./src/components/menu-bar/project-title-input.jsx ***! \*********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _forms_buffered_input_hoc_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../forms/buffered-input-hoc.jsx */ "./src/components/forms/buffered-input-hoc.jsx"); /* harmony import */ var _forms_input_jsx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../forms/input.jsx */ "./src/components/forms/input.jsx"); /* harmony import */ var _project_title_input_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./project-title-input.css */ "./src/components/menu-bar/project-title-input.css"); /* harmony import */ var _project_title_input_css__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_project_title_input_css__WEBPACK_IMPORTED_MODULE_8__); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var BufferedInput = Object(_forms_buffered_input_hoc_jsx__WEBPACK_IMPORTED_MODULE_6__["default"])(_forms_input_jsx__WEBPACK_IMPORTED_MODULE_7__["default"]); var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_5__["defineMessages"])({ projectTitlePlaceholder: { "id": "gui.gui.projectTitlePlaceholder", "defaultMessage": "Project title here" } }); var ProjectTitleInput = /*#__PURE__*/ function (_React$Component) { _inherits(ProjectTitleInput, _React$Component); function ProjectTitleInput(props) { var _this; _classCallCheck(this, ProjectTitleInput); _this = _possibleConstructorReturn(this, _getPrototypeOf(ProjectTitleInput).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_3___default()(_assertThisInitialized(_this), ['handleUpdateProjectTitle']); return _this; } // call onUpdateProjectTitle if it is defined (only defined when gui // is used within scratch-www) _createClass(ProjectTitleInput, [{ key: "handleUpdateProjectTitle", value: function handleUpdateProjectTitle(newTitle) { if (this.props.onUpdateProjectTitle) { this.props.onUpdateProjectTitle(newTitle); } } }, { key: "render", value: function render() { return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(BufferedInput, { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_project_title_input_css__WEBPACK_IMPORTED_MODULE_8___default.a.titleField, this.props.className), maxLength: "100", placeholder: this.props.intl.formatMessage(messages.projectTitlePlaceholder), tabIndex: "0", type: "text", value: this.props.projectTitle, onSubmit: this.handleUpdateProjectTitle }); } }]); return ProjectTitleInput; }(react__WEBPACK_IMPORTED_MODULE_4___default.a.Component); ProjectTitleInput.propTypes = { className: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, intl: react_intl__WEBPACK_IMPORTED_MODULE_5__["intlShape"].isRequired, onUpdateProjectTitle: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, projectTitle: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string }; var mapStateToProps = function mapStateToProps(state) { return { projectTitle: state.scratchGui.projectTitle }; }; var mapDispatchToProps = function mapDispatchToProps() { return {}; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_5__["injectIntl"])(Object(react_redux__WEBPACK_IMPORTED_MODULE_1__["connect"])(mapStateToProps, mapDispatchToProps)(ProjectTitleInput))); /***/ }), /***/ "./src/components/menu-bar/save-status.css": /*!*************************************************!*\ !*** ./src/components/menu-bar/save-status.css ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./save-status.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/menu-bar/save-status.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/menu-bar/save-status.jsx": /*!*************************************************!*\ !*** ./src/components/menu-bar/save-status.jsx ***! \*************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _containers_inline_messages_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../containers/inline-messages.jsx */ "./src/containers/inline-messages.jsx"); /* harmony import */ var _reducers_project_state__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../reducers/project-state */ "./src/reducers/project-state.js"); /* harmony import */ var _reducers_alerts__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../reducers/alerts */ "./src/reducers/alerts.js"); /* harmony import */ var _save_status_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./save-status.css */ "./src/components/menu-bar/save-status.css"); /* harmony import */ var _save_status_css__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_save_status_css__WEBPACK_IMPORTED_MODULE_7__); // Wrapper for inline messages in the nav bar, which are all related to saving. // Show any inline messages if present, else show the "Save Now" button if the // project has changed. // We decided to not use an inline message for "Save Now" because it is a reflection // of the project state, rather than an event. var SaveStatus = function SaveStatus(_ref) { var alertsList = _ref.alertsList, projectChanged = _ref.projectChanged, onClickSave = _ref.onClickSave; return Object(_reducers_alerts__WEBPACK_IMPORTED_MODULE_6__["filterInlineAlerts"])(alertsList).length > 0 ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_containers_inline_messages_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], null) : projectChanged && react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", { className: _save_status_css__WEBPACK_IMPORTED_MODULE_7___default.a.saveNow, onClick: onClickSave }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Save Now", id: "gui.menuBar.saveNowLink" })); }; SaveStatus.propTypes = { alertsList: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.object), onClickSave: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, projectChanged: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool }; var mapStateToProps = function mapStateToProps(state) { return { alertsList: state.scratchGui.alerts.alertsList, projectChanged: state.scratchGui.projectChanged }; }; var mapDispatchToProps = function mapDispatchToProps(dispatch) { return { onClickSave: function onClickSave() { return dispatch(Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_5__["manualUpdateProject"])()); } }; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_redux__WEBPACK_IMPORTED_MODULE_0__["connect"])(mapStateToProps, mapDispatchToProps)(SaveStatus)); /***/ }), /***/ "./src/components/menu-bar/scratch-logo.svg": /*!**************************************************!*\ !*** ./src/components/menu-bar/scratch-logo.svg ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/1e9652bec24bcaacf5285be19746a750.svg"; /***/ }), /***/ "./src/components/menu-bar/share-button.css": /*!**************************************************!*\ !*** ./src/components/menu-bar/share-button.css ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./share-button.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/menu-bar/share-button.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/menu-bar/share-button.jsx": /*!**************************************************!*\ !*** ./src/components/menu-bar/share-button.jsx ***! \**************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _button_button_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../button/button.jsx */ "./src/components/button/button.jsx"); /* harmony import */ var _share_button_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./share-button.css */ "./src/components/menu-bar/share-button.css"); /* harmony import */ var _share_button_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_share_button_css__WEBPACK_IMPORTED_MODULE_5__); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var ShareButton = function ShareButton(_ref) { var className = _ref.className, isShared = _ref.isShared, onClick = _ref.onClick; return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_button_button_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(className, _share_button_css__WEBPACK_IMPORTED_MODULE_5___default.a.shareButton, _defineProperty({}, _share_button_css__WEBPACK_IMPORTED_MODULE_5___default.a.shareButtonIsShared, isShared)), onClick: onClick }, isShared ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Shared", id: "gui.menuBar.isShared" }) : react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Share", id: "gui.menuBar.share" })); }; ShareButton.propTypes = { className: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, isShared: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, onClick: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func }; ShareButton.defaultProps = { onClick: function onClick() {} }; /* harmony default export */ __webpack_exports__["default"] = (ShareButton); /***/ }), /***/ "./src/components/menu-bar/user-avatar.css": /*!*************************************************!*\ !*** ./src/components/menu-bar/user-avatar.css ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./user-avatar.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/menu-bar/user-avatar.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/menu-bar/user-avatar.jsx": /*!*************************************************!*\ !*** ./src/components/menu-bar/user-avatar.jsx ***! \*************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _user_avatar_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./user-avatar.css */ "./src/components/menu-bar/user-avatar.css"); /* harmony import */ var _user_avatar_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_user_avatar_css__WEBPACK_IMPORTED_MODULE_3__); var UserAvatar = function UserAvatar(_ref) { var className = _ref.className, imageUrl = _ref.imageUrl; return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("img", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(className, _user_avatar_css__WEBPACK_IMPORTED_MODULE_3___default.a.userThumbnail), src: imageUrl }); }; UserAvatar.propTypes = { className: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, imageUrl: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string }; /* harmony default export */ __webpack_exports__["default"] = (UserAvatar); /***/ }), /***/ "./src/components/menu/menu.css": /*!**************************************!*\ !*** ./src/components/menu/menu.css ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./menu.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/menu/menu.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/menu/menu.jsx": /*!**************************************!*\ !*** ./src/components/menu/menu.jsx ***! \**************************************/ /*! exports provided: default, MenuItem, MenuSection */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MenuComponent; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MenuItem", function() { return MenuItem; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MenuSection", function() { return MenuSection; }); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _menu_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./menu.css */ "./src/components/menu/menu.css"); /* harmony import */ var _menu_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_menu_css__WEBPACK_IMPORTED_MODULE_3__); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var MenuComponent = function MenuComponent(_ref) { var _classNames; var _ref$className = _ref.className, className = _ref$className === void 0 ? '' : _ref$className, children = _ref.children, componentRef = _ref.componentRef, _ref$place = _ref.place, place = _ref$place === void 0 ? 'right' : _ref$place; return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("ul", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_menu_css__WEBPACK_IMPORTED_MODULE_3___default.a.menu, className, (_classNames = {}, _defineProperty(_classNames, _menu_css__WEBPACK_IMPORTED_MODULE_3___default.a.left, place === 'left'), _defineProperty(_classNames, _menu_css__WEBPACK_IMPORTED_MODULE_3___default.a.right, place === 'right'), _classNames)), ref: componentRef }, children); }; MenuComponent.propTypes = { children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node, className: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, componentRef: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, place: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOf(['left', 'right']) }; var MenuItem = function MenuItem(_ref2) { var children = _ref2.children, className = _ref2.className, onClick = _ref2.onClick; return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("li", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_menu_css__WEBPACK_IMPORTED_MODULE_3___default.a.menuItem, _menu_css__WEBPACK_IMPORTED_MODULE_3___default.a.hoverable, className), onClick: onClick }, children); }; MenuItem.propTypes = { children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node, className: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, onClick: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func }; var addDividerClassToFirstChild = function addDividerClassToFirstChild(child, id) { return react__WEBPACK_IMPORTED_MODULE_2___default.a.cloneElement(child, { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(child.className, _defineProperty({}, _menu_css__WEBPACK_IMPORTED_MODULE_3___default.a.menuSection, id === 0)), key: id }); }; var MenuSection = function MenuSection(_ref3) { var children = _ref3.children; return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_2___default.a.Fragment, null, react__WEBPACK_IMPORTED_MODULE_2___default.a.Children.map(children, addDividerClassToFirstChild)); }; MenuSection.propTypes = { children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node }; /***/ }), /***/ "./src/components/meter/meter.css": /*!****************************************!*\ !*** ./src/components/meter/meter.css ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./meter.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/meter/meter.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/meter/meter.jsx": /*!****************************************!*\ !*** ./src/components/meter/meter.jsx ***! \****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _meter_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./meter.css */ "./src/components/meter/meter.css"); /* harmony import */ var _meter_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_meter_css__WEBPACK_IMPORTED_MODULE_2__); var Meter = function Meter(props) { var level = props.level, width = props.width, height = props.height; var nGreen = 11; var nYellow = 5; var nRed = 3; var nBars = nGreen + nYellow + nRed; var barSpacing = 2.5; var barRounding = 3; var barHeight = (height - barSpacing * (nBars + 1)) / nBars; var nBarsToMask = nBars - Math.floor(level * nBars); var scale = (nBarsToMask * (barHeight + barSpacing) + barSpacing / 2) / height; return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _meter_css__WEBPACK_IMPORTED_MODULE_2___default.a.maskContainer, style: { height: "".concat(height, "px") } }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("svg", { className: _meter_css__WEBPACK_IMPORTED_MODULE_2___default.a.container, height: height, width: width }, Array(nBars).fill(0).map(function (value, index) { return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("rect", { className: index < nGreen ? _meter_css__WEBPACK_IMPORTED_MODULE_2___default.a.green : index < nGreen + nYellow ? _meter_css__WEBPACK_IMPORTED_MODULE_2___default.a.yellow : _meter_css__WEBPACK_IMPORTED_MODULE_2___default.a.red, height: barHeight, key: index, rx: barRounding, ry: barRounding, width: width - 2, x: 1, y: height - (barSpacing + barHeight) * (index + 1) }); })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _meter_css__WEBPACK_IMPORTED_MODULE_2___default.a.mask, style: { transform: "scaleY(".concat(scale, ")") } })); }; Meter.propTypes = { height: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, level: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, width: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number }; /* harmony default export */ __webpack_exports__["default"] = (Meter); /***/ }), /***/ "./src/components/mic-indicator/mic-indicator.css": /*!********************************************************!*\ !*** ./src/components/mic-indicator/mic-indicator.css ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./mic-indicator.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/mic-indicator/mic-indicator.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/mic-indicator/mic-indicator.jsx": /*!********************************************************!*\ !*** ./src/components/mic-indicator/mic-indicator.jsx ***! \********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _mic_indicator_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mic-indicator.css */ "./src/components/mic-indicator/mic-indicator.css"); /* harmony import */ var _mic_indicator_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_mic_indicator_css__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _mic_indicator_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mic-indicator.svg */ "./src/components/mic-indicator/mic-indicator.svg"); /* harmony import */ var _mic_indicator_svg__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_mic_indicator_svg__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_screen_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../lib/screen-utils */ "./src/lib/screen-utils.js"); var MicIndicatorComponent = function MicIndicatorComponent(props) { return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: props.className, style: Object(_lib_screen_utils__WEBPACK_IMPORTED_MODULE_4__["stageSizeToTransform"])(props.stageSize) }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("img", { className: _mic_indicator_css__WEBPACK_IMPORTED_MODULE_2___default.a.micImg, src: _mic_indicator_svg__WEBPACK_IMPORTED_MODULE_3___default.a })); }; MicIndicatorComponent.propTypes = { className: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, stageSize: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.shape({ width: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, height: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, widthDefault: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, heightDefault: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number }).isRequired }; /* harmony default export */ __webpack_exports__["default"] = (MicIndicatorComponent); /***/ }), /***/ "./src/components/mic-indicator/mic-indicator.svg": /*!********************************************************!*\ !*** ./src/components/mic-indicator/mic-indicator.svg ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/4da38973d5ffd15c54e80894d430288c.svg"; /***/ }), /***/ "./src/components/modal/modal.css": /*!****************************************!*\ !*** ./src/components/modal/modal.css ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./modal.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/modal/modal.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/modal/modal.jsx": /*!****************************************!*\ !*** ./src/components/modal/modal.jsx ***! \****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_modal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-modal */ "./node_modules/react-modal/lib/index.js"); /* harmony import */ var react_modal__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_modal__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _button_button_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../button/button.jsx */ "./src/components/button/button.jsx"); /* harmony import */ var _close_button_close_button_jsx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../close-button/close-button.jsx */ "./src/components/close-button/close-button.jsx"); /* harmony import */ var _lib_assets_icon_back_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../lib/assets/icon--back.svg */ "./src/lib/assets/icon--back.svg"); /* harmony import */ var _lib_assets_icon_back_svg__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_lib_assets_icon_back_svg__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _lib_assets_icon_help_svg__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../lib/assets/icon--help.svg */ "./src/lib/assets/icon--help.svg"); /* harmony import */ var _lib_assets_icon_help_svg__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_lib_assets_icon_help_svg__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _modal_css__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./modal.css */ "./src/components/modal/modal.css"); /* harmony import */ var _modal_css__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_modal_css__WEBPACK_IMPORTED_MODULE_10__); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var ModalComponent = function ModalComponent(props) { return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_modal__WEBPACK_IMPORTED_MODULE_3___default.a, { isOpen: true, className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.modalContent, props.className, _defineProperty({}, _modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.fullScreen, props.fullScreen)), contentLabel: props.contentLabel, overlayClassName: _modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.modalOverlay, onRequestClose: props.onRequestClose }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { dir: props.isRtl ? 'rtl' : 'ltr', direction: "column", grow: 1 }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.header, props.headerClassName) }, props.onHelp ? react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.headerItem, _modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.headerItemHelp) }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_button_button_jsx__WEBPACK_IMPORTED_MODULE_6__["default"], { className: _modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.helpButton, iconSrc: _lib_assets_icon_help_svg__WEBPACK_IMPORTED_MODULE_9___default.a, onClick: props.onHelp }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_4__["FormattedMessage"], { defaultMessage: "Help", id: "gui.modal.help" }))) : null, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.headerItem, _modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.headerItemTitle) }, props.headerImage ? react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("img", { className: _modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.headerImage, src: props.headerImage }) : null, props.contentLabel), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.headerItem, _modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.headerItemClose) }, props.fullScreen ? react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_button_button_jsx__WEBPACK_IMPORTED_MODULE_6__["default"], { className: _modal_css__WEBPACK_IMPORTED_MODULE_10___default.a.backButton, iconSrc: _lib_assets_icon_back_svg__WEBPACK_IMPORTED_MODULE_8___default.a, onClick: props.onRequestClose }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_4__["FormattedMessage"], { defaultMessage: "Back", id: "gui.modal.back" })) : react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_close_button_close_button_jsx__WEBPACK_IMPORTED_MODULE_7__["default"], { size: _close_button_close_button_jsx__WEBPACK_IMPORTED_MODULE_7__["default"].SIZE_LARGE, onClick: props.onRequestClose }))), props.children)); }; ModalComponent.propTypes = { children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node, className: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, contentLabel: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object]).isRequired, fullScreen: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, headerClassName: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, headerImage: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, isRtl: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, onHelp: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onRequestClose: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func }; /* harmony default export */ __webpack_exports__["default"] = (ModalComponent); /***/ }), /***/ "./src/components/monitor-list/monitor-list.css": /*!******************************************************!*\ !*** ./src/components/monitor-list/monitor-list.css ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./monitor-list.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/monitor-list/monitor-list.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/monitor-list/monitor-list.jsx": /*!******************************************************!*\ !*** ./src/components/monitor-list/monitor-list.jsx ***! \******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _containers_monitor_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../containers/monitor.jsx */ "./src/containers/monitor.jsx"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var immutable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! immutable */ "./node_modules/immutable/dist/immutable.js"); /* harmony import */ var immutable__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(immutable__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _lib_screen_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../lib/screen-utils */ "./src/lib/screen-utils.js"); /* harmony import */ var _monitor_list_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./monitor-list.css */ "./src/components/monitor-list/monitor-list.css"); /* harmony import */ var _monitor_list_css__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_monitor_list_css__WEBPACK_IMPORTED_MODULE_7__); var MonitorList = function MonitorList(props) { return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_2__["default"] // Use static `monitor-overlay` class for bounds of draggables , { className: classnames__WEBPACK_IMPORTED_MODULE_1___default()(_monitor_list_css__WEBPACK_IMPORTED_MODULE_7___default.a.monitorList, 'monitor-overlay'), style: { width: props.stageSize.width, height: props.stageSize.height } }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], { className: _monitor_list_css__WEBPACK_IMPORTED_MODULE_7___default.a.monitorListScaler, style: Object(_lib_screen_utils__WEBPACK_IMPORTED_MODULE_6__["stageSizeToTransform"])(props.stageSize) }, props.monitors.valueSeq().filter(function (m) { return m.visible; }).map(function (monitorData) { return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_containers_monitor_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { draggable: props.draggable, height: monitorData.height, id: monitorData.id, isDiscrete: monitorData.isDiscrete, key: monitorData.id, max: monitorData.sliderMax, min: monitorData.sliderMin, mode: monitorData.mode, opcode: monitorData.opcode, params: monitorData.params, spriteName: monitorData.spriteName, targetId: monitorData.targetId, value: monitorData.value, width: monitorData.width, x: monitorData.x, y: monitorData.y, onDragEnd: props.onMonitorChange }); }))); }; MonitorList.propTypes = { draggable: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool.isRequired, monitors: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.instanceOf(immutable__WEBPACK_IMPORTED_MODULE_5__["OrderedMap"]), onMonitorChange: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func.isRequired, stageSize: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.shape({ width: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.number, height: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.number, widthDefault: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.number, heightDefault: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.number }).isRequired }; /* harmony default export */ __webpack_exports__["default"] = (MonitorList); /***/ }), /***/ "./src/components/monitor/default-monitor.jsx": /*!****************************************************!*\ !*** ./src/components/monitor/default-monitor.jsx ***! \****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _monitor_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./monitor.css */ "./src/components/monitor/monitor.css"); /* harmony import */ var _monitor_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_monitor_css__WEBPACK_IMPORTED_MODULE_2__); var DefaultMonitor = function DefaultMonitor(_ref) { var categoryColor = _ref.categoryColor, label = _ref.label, value = _ref.value; return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _monitor_css__WEBPACK_IMPORTED_MODULE_2___default.a.defaultMonitor }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _monitor_css__WEBPACK_IMPORTED_MODULE_2___default.a.row }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _monitor_css__WEBPACK_IMPORTED_MODULE_2___default.a.label }, label), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _monitor_css__WEBPACK_IMPORTED_MODULE_2___default.a.value, style: { background: categoryColor } }, value))); }; DefaultMonitor.propTypes = { categoryColor: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string.isRequired, label: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string.isRequired, value: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number]) }; /* harmony default export */ __webpack_exports__["default"] = (DefaultMonitor); /***/ }), /***/ "./src/components/monitor/large-monitor.jsx": /*!**************************************************!*\ !*** ./src/components/monitor/large-monitor.jsx ***! \**************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _monitor_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./monitor.css */ "./src/components/monitor/monitor.css"); /* harmony import */ var _monitor_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_monitor_css__WEBPACK_IMPORTED_MODULE_2__); var LargeMonitor = function LargeMonitor(_ref) { var categoryColor = _ref.categoryColor, value = _ref.value; return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _monitor_css__WEBPACK_IMPORTED_MODULE_2___default.a.largeMonitor }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _monitor_css__WEBPACK_IMPORTED_MODULE_2___default.a.largeValue, style: { background: categoryColor } }, value)); }; LargeMonitor.propTypes = { categoryColor: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, value: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number]) }; /* harmony default export */ __webpack_exports__["default"] = (LargeMonitor); /***/ }), /***/ "./src/components/monitor/list-monitor-scroller.jsx": /*!**********************************************************!*\ !*** ./src/components/monitor/list-monitor-scroller.jsx ***! \**********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _monitor_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./monitor.css */ "./src/components/monitor/monitor.css"); /* harmony import */ var _monitor_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_monitor_css__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var react_virtualized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react-virtualized */ "./node_modules/react-virtualized/dist/es/index.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var ListMonitorScroller = /*#__PURE__*/ function (_React$Component) { _inherits(ListMonitorScroller, _React$Component); function ListMonitorScroller(props) { var _this; _classCallCheck(this, ListMonitorScroller); _this = _possibleConstructorReturn(this, _getPrototypeOf(ListMonitorScroller).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_3___default()(_assertThisInitialized(_this), ['rowRenderer', 'noRowsRenderer', 'handleEventFactory']); return _this; } _createClass(ListMonitorScroller, [{ key: "handleEventFactory", value: function handleEventFactory(index) { var _this2 = this; return function () { return _this2.props.onActivate(index); }; } }, { key: "noRowsRenderer", value: function noRowsRenderer() { return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_monitor_css__WEBPACK_IMPORTED_MODULE_5___default.a.listRow, _monitor_css__WEBPACK_IMPORTED_MODULE_5___default.a.listEmpty) }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_4__["FormattedMessage"], { defaultMessage: "(empty)", id: "gui.monitor.listMonitor.empty" })); } }, { key: "rowRenderer", value: function rowRenderer(_ref) { var index = _ref.index, key = _ref.key, style = _ref.style; return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _monitor_css__WEBPACK_IMPORTED_MODULE_5___default.a.listRow, key: key, style: style }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _monitor_css__WEBPACK_IMPORTED_MODULE_5___default.a.listIndex }, index + 1 /* one indexed */ ), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _monitor_css__WEBPACK_IMPORTED_MODULE_5___default.a.listValue, dataIndex: index, style: { background: this.props.categoryColor }, onClick: this.props.draggable ? this.handleEventFactory(index) : null }, this.props.draggable && this.props.activeIndex === index ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _monitor_css__WEBPACK_IMPORTED_MODULE_5___default.a.inputWrapper }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", { autoFocus: true, autoComplete: false, className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_monitor_css__WEBPACK_IMPORTED_MODULE_5___default.a.listInput, 'no-drag'), spellCheck: false, type: "text", value: this.props.activeValue, onBlur: this.props.onDeactivate, onChange: this.props.onInput, onFocus: this.props.onFocus, onKeyDown: this.props.onKeyPress // key down to get ahead of blur }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _monitor_css__WEBPACK_IMPORTED_MODULE_5___default.a.removeButton, onMouseDown: this.props.onRemove // mousedown to get ahead of blur }, '✖︎')) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _monitor_css__WEBPACK_IMPORTED_MODULE_5___default.a.valueInner }, this.props.values[index]))); } }, { key: "render", value: function render() { var _this$props = this.props, height = _this$props.height, values = _this$props.values, width = _this$props.width, activeIndex = _this$props.activeIndex, activeValue = _this$props.activeValue; // Keep the active index in view if defined, else must be undefined for List component var scrollToIndex = activeIndex === null ? undefined : activeIndex; /* eslint-disable-line no-undefined */ return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_virtualized__WEBPACK_IMPORTED_MODULE_6__["List"], { activeIndex: activeIndex, activeValue: activeValue, height: height - 44 /* Header/footer size, approx */ , noRowsRenderer: this.noRowsRenderer, rowCount: values.length, rowHeight: 24 /* Row size is same for all rows */ , rowRenderer: this.rowRenderer, scrollToIndex: scrollToIndex /* eslint-disable-line no-undefined */ , values: values, width: width }); } }]); return ListMonitorScroller; }(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component); ListMonitorScroller.propTypes = { activeIndex: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, activeValue: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, categoryColor: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, draggable: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, height: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, onActivate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onDeactivate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onFocus: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onInput: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onKeyPress: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onRemove: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, values: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number])), width: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number }; /* harmony default export */ __webpack_exports__["default"] = (ListMonitorScroller); /***/ }), /***/ "./src/components/monitor/list-monitor.jsx": /*!*************************************************!*\ !*** ./src/components/monitor/list-monitor.jsx ***! \*************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _monitor_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./monitor.css */ "./src/components/monitor/monitor.css"); /* harmony import */ var _monitor_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_monitor_css__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _list_monitor_scroller_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./list-monitor-scroller.jsx */ "./src/components/monitor/list-monitor-scroller.jsx"); function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } var ListMonitor = function ListMonitor(_ref) { var draggable = _ref.draggable, label = _ref.label, width = _ref.width, height = _ref.height, value = _ref.value, onResizeMouseDown = _ref.onResizeMouseDown, onAdd = _ref.onAdd, rowProps = _objectWithoutProperties(_ref, ["draggable", "label", "width", "height", "value", "onResizeMouseDown", "onAdd"]); return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _monitor_css__WEBPACK_IMPORTED_MODULE_4___default.a.listMonitor, style: { width: "".concat(width, "px"), height: "".concat(height, "px") } }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _monitor_css__WEBPACK_IMPORTED_MODULE_4___default.a.listHeader }, label), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _monitor_css__WEBPACK_IMPORTED_MODULE_4___default.a.listBody }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_list_monitor_scroller_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], _extends({ draggable: draggable, height: height, values: value, width: width }, rowProps))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _monitor_css__WEBPACK_IMPORTED_MODULE_4___default.a.listFooter }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(draggable ? _monitor_css__WEBPACK_IMPORTED_MODULE_4___default.a.addButton : null, 'no-drag'), onClick: draggable ? onAdd : null }, '+' /* TODO waiting on asset */ ), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _monitor_css__WEBPACK_IMPORTED_MODULE_4___default.a.footerLength }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "length {length}", id: "gui.monitor.listMonitor.listLength", values: { length: value.length } })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(draggable ? _monitor_css__WEBPACK_IMPORTED_MODULE_4___default.a.resizeHandle : null, 'no-drag'), onMouseDown: draggable ? onResizeMouseDown : null }, '=' /* TODO waiting on asset */ ))); }; ListMonitor.propTypes = { activeIndex: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, categoryColor: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string.isRequired, draggable: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool.isRequired, height: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, label: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string.isRequired, onActivate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onAdd: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onResizeMouseDown: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, value: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number]))]), width: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number }; ListMonitor.defaultProps = { width: 110, height: 200 }; /* harmony default export */ __webpack_exports__["default"] = (ListMonitor); /***/ }), /***/ "./src/components/monitor/monitor.css": /*!********************************************!*\ !*** ./src/components/monitor/monitor.css ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./monitor.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/monitor/monitor.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/monitor/monitor.jsx": /*!********************************************!*\ !*** ./src/components/monitor/monitor.jsx ***! \********************************************/ /*! exports provided: default, monitorModes */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MonitorComponent; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "monitorModes", function() { return monitorModes; }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"); /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_draggable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-draggable */ "./node_modules/react-draggable/dist/react-draggable.js"); /* harmony import */ var react_draggable__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_draggable__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var react_contextmenu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-contextmenu */ "./node_modules/react-contextmenu/es6/index.js"); /* harmony import */ var _context_menu_context_menu_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../context-menu/context-menu.jsx */ "./src/components/context-menu/context-menu.jsx"); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _default_monitor_jsx__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./default-monitor.jsx */ "./src/components/monitor/default-monitor.jsx"); /* harmony import */ var _large_monitor_jsx__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./large-monitor.jsx */ "./src/components/monitor/large-monitor.jsx"); /* harmony import */ var _containers_slider_monitor_jsx__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../containers/slider-monitor.jsx */ "./src/containers/slider-monitor.jsx"); /* harmony import */ var _containers_list_monitor_jsx__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../containers/list-monitor.jsx */ "./src/containers/list-monitor.jsx"); /* harmony import */ var _monitor_css__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./monitor.css */ "./src/components/monitor/monitor.css"); /* harmony import */ var _monitor_css__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_monitor_css__WEBPACK_IMPORTED_MODULE_12__); function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var categories = { data: '#FF8C1A', sensing: '#5CB1D6', sound: '#CF63CF', looks: '#9966FF', motion: '#4C97FF', list: '#FC662C', extension: '#0FBD8C' }; var modes = { default: _default_monitor_jsx__WEBPACK_IMPORTED_MODULE_8__["default"], large: _large_monitor_jsx__WEBPACK_IMPORTED_MODULE_9__["default"], slider: _containers_slider_monitor_jsx__WEBPACK_IMPORTED_MODULE_10__["default"], list: _containers_list_monitor_jsx__WEBPACK_IMPORTED_MODULE_11__["default"] }; var MonitorComponent = function MonitorComponent(props) { return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_contextmenu__WEBPACK_IMPORTED_MODULE_5__["ContextMenuTrigger"], { disable: !props.draggable, holdToDisplay: props.mode === 'slider' ? -1 : 1000, id: "monitor-".concat(props.label) }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_draggable__WEBPACK_IMPORTED_MODULE_3___default.a, { bounds: ".monitor-overlay" // Class for monitor container , cancel: ".no-drag" // Class used for slider input to prevent drag , defaultClassNameDragging: _monitor_css__WEBPACK_IMPORTED_MODULE_12___default.a.dragging, disabled: !props.draggable, onStop: props.onDragEnd }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_7__["default"], { className: _monitor_css__WEBPACK_IMPORTED_MODULE_12___default.a.monitorContainer, componentRef: props.componentRef, onDoubleClick: props.mode === 'list' || !props.draggable ? null : props.onNextMode }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(modes[props.mode], _objectSpread({ categoryColor: categories[props.category] }, props)))), react_dom__WEBPACK_IMPORTED_MODULE_1___default.a.createPortal( // Use a portal to render the context menu outside the flow to avoid // positioning conflicts between the monitors `transform: scale` and // the context menus `position: fixed`. For more details, see // http://meyerweb.com/eric/thoughts/2011/09/12/un-fixing-fixed-elements-with-css-transforms/ react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_context_menu_context_menu_jsx__WEBPACK_IMPORTED_MODULE_6__["ContextMenu"], { id: "monitor-".concat(props.label) }, props.onSetModeToDefault && react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_context_menu_context_menu_jsx__WEBPACK_IMPORTED_MODULE_6__["MenuItem"], { onClick: props.onSetModeToDefault }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_4__["FormattedMessage"], { defaultMessage: "normal readout", id: "gui.monitor.contextMenu.default" })), props.onSetModeToLarge && react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_context_menu_context_menu_jsx__WEBPACK_IMPORTED_MODULE_6__["MenuItem"], { onClick: props.onSetModeToLarge }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_4__["FormattedMessage"], { defaultMessage: "large readout", id: "gui.monitor.contextMenu.large" })), props.onSetModeToSlider && react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_context_menu_context_menu_jsx__WEBPACK_IMPORTED_MODULE_6__["MenuItem"], { onClick: props.onSetModeToSlider }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_4__["FormattedMessage"], { defaultMessage: "slider", id: "gui.monitor.contextMenu.slider" })), props.onSliderPromptOpen && props.mode === 'slider' && react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_context_menu_context_menu_jsx__WEBPACK_IMPORTED_MODULE_6__["BorderedMenuItem"], { onClick: props.onSliderPromptOpen }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_4__["FormattedMessage"], { defaultMessage: "change slider range", id: "gui.monitor.contextMenu.sliderRange" })), props.onImport && react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_context_menu_context_menu_jsx__WEBPACK_IMPORTED_MODULE_6__["MenuItem"], { onClick: props.onImport }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_4__["FormattedMessage"], { defaultMessage: "import", id: "gui.monitor.contextMenu.import" })), props.onExport && react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_context_menu_context_menu_jsx__WEBPACK_IMPORTED_MODULE_6__["MenuItem"], { onClick: props.onExport }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_4__["FormattedMessage"], { defaultMessage: "export", id: "gui.monitor.contextMenu.export" }))), document.body)); }; MonitorComponent.categories = categories; var monitorModes = Object.keys(modes); MonitorComponent.propTypes = { category: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOf(Object.keys(categories)), componentRef: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func.isRequired, draggable: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool.isRequired, label: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string.isRequired, mode: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOf(monitorModes), onDragEnd: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func.isRequired, onExport: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onImport: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onNextMode: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func.isRequired, onSetModeToDefault: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onSetModeToLarge: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onSetModeToSlider: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onSliderPromptOpen: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func }; MonitorComponent.defaultProps = { category: 'extension', mode: 'default' }; /***/ }), /***/ "./src/components/monitor/slider-monitor.jsx": /*!***************************************************!*\ !*** ./src/components/monitor/slider-monitor.jsx ***! \***************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _monitor_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./monitor.css */ "./src/components/monitor/monitor.css"); /* harmony import */ var _monitor_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_monitor_css__WEBPACK_IMPORTED_MODULE_3__); var SliderMonitor = function SliderMonitor(_ref) { var categoryColor = _ref.categoryColor, isDiscrete = _ref.isDiscrete, label = _ref.label, min = _ref.min, max = _ref.max, value = _ref.value, onSliderUpdate = _ref.onSliderUpdate; return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _monitor_css__WEBPACK_IMPORTED_MODULE_3___default.a.defaultMonitor }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _monitor_css__WEBPACK_IMPORTED_MODULE_3___default.a.row }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _monitor_css__WEBPACK_IMPORTED_MODULE_3___default.a.label }, label), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _monitor_css__WEBPACK_IMPORTED_MODULE_3___default.a.value, style: { background: categoryColor } }, value)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _monitor_css__WEBPACK_IMPORTED_MODULE_3___default.a.row }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_monitor_css__WEBPACK_IMPORTED_MODULE_3___default.a.slider, 'no-drag') // Class used on parent Draggable to prevent drags , max: max, min: min, step: isDiscrete ? 1 : 0.01, type: "range", value: value, onChange: onSliderUpdate }))); }; SliderMonitor.propTypes = { categoryColor: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string.isRequired, isDiscrete: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, label: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string.isRequired, max: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, min: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, onSliderUpdate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, value: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number]) }; SliderMonitor.defaultProps = { isDiscrete: true, min: 0, max: 100 }; /* harmony default export */ __webpack_exports__["default"] = (SliderMonitor); /***/ }), /***/ "./src/components/prompt/prompt.css": /*!******************************************!*\ !*** ./src/components/prompt/prompt.css ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./prompt.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/prompt/prompt.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/prompt/prompt.jsx": /*!******************************************!*\ !*** ./src/components/prompt/prompt.jsx ***! \******************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _containers_modal_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../containers/modal.jsx */ "./src/containers/modal.jsx"); /* harmony import */ var _prompt_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./prompt.css */ "./src/components/prompt/prompt.css"); /* harmony import */ var _prompt_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_prompt_css__WEBPACK_IMPORTED_MODULE_6__); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_1__["defineMessages"])({ forAllSpritesMessage: { "id": "gui.gui.variableScopeOptionAllSprites", "defaultMessage": "For all sprites" }, forThisSpriteMessage: { "id": "gui.gui.variableScopeOptionSpriteOnly", "defaultMessage": "For this sprite only" }, cloudVarOptionMessage: { "id": "gui.gui.cloudVariableOption", "defaultMessage": "Cloud variable (stored on server)" }, availableToAllSpritesMessage: { "id": "gui.gui.variablePromptAllSpritesMessage", "defaultMessage": "This variable will be available to all sprites." } }); var PromptComponent = function PromptComponent(props) { return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_containers_modal_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { className: _prompt_css__WEBPACK_IMPORTED_MODULE_6___default.a.modalContent, contentLabel: props.title, onRequestClose: props.onCancel }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: _prompt_css__WEBPACK_IMPORTED_MODULE_6___default.a.body }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: _prompt_css__WEBPACK_IMPORTED_MODULE_6___default.a.label }, props.label), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], null, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("input", { autoFocus: true, className: _prompt_css__WEBPACK_IMPORTED_MODULE_6___default.a.variableNameTextInput, defaultValue: props.defaultValue, name: props.label, onChange: props.onChange, onFocus: props.onFocus, onKeyPress: props.onKeyPress })), props.showVariableOptions ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", null, props.isStage ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", { className: _prompt_css__WEBPACK_IMPORTED_MODULE_6___default.a.infoMessage }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], messages.availableToAllSpritesMessage)) : react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: _prompt_css__WEBPACK_IMPORTED_MODULE_6___default.a.optionsRow }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("input", { checked: props.globalSelected, name: "variableScopeOption", type: "radio", value: "global", onChange: props.onScopeOptionSelection }), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], messages.forAllSpritesMessage)), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("label", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_defineProperty({}, _prompt_css__WEBPACK_IMPORTED_MODULE_6___default.a.disabledLabel, props.cloudSelected)) }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("input", { checked: !props.globalSelected, disabled: props.cloudSelected, name: "variableScopeOption", type: "radio", value: "local", onChange: props.onScopeOptionSelection }), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], messages.forThisSpriteMessage))), props.showCloudOption ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_prompt_css__WEBPACK_IMPORTED_MODULE_6___default.a.cloudOption) }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("label", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_defineProperty({}, _prompt_css__WEBPACK_IMPORTED_MODULE_6___default.a.disabledLabel, !props.canAddCloudVariable)) }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("input", { checked: props.cloudSelected && props.canAddCloudVariable, disabled: !props.canAddCloudVariable, type: "checkbox", onChange: props.onCloudVarOptionChange }), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], messages.cloudVarOptionMessage))) : null) : null, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: _prompt_css__WEBPACK_IMPORTED_MODULE_6___default.a.buttonRow }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("button", { className: _prompt_css__WEBPACK_IMPORTED_MODULE_6___default.a.cancelButton, onClick: props.onCancel }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Cancel", id: "gui.prompt.cancel" })), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("button", { className: _prompt_css__WEBPACK_IMPORTED_MODULE_6___default.a.okButton, onClick: props.onOk }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "OK", id: "gui.prompt.ok" }))))); }; PromptComponent.propTypes = { canAddCloudVariable: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool.isRequired, cloudSelected: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool.isRequired, defaultValue: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, globalSelected: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool.isRequired, isStage: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool.isRequired, label: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string.isRequired, onCancel: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func.isRequired, onChange: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func.isRequired, onCloudVarOptionChange: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onFocus: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func.isRequired, onKeyPress: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func.isRequired, onOk: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func.isRequired, onScopeOptionSelection: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func.isRequired, showCloudOption: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool.isRequired, showVariableOptions: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool.isRequired, title: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string.isRequired }; /* harmony default export */ __webpack_exports__["default"] = (PromptComponent); /***/ }), /***/ "./src/components/question/icon--enter.svg": /*!*************************************************!*\ !*** ./src/components/question/icon--enter.svg ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/27f90bfa982840e56c3ad207561193fa.svg"; /***/ }), /***/ "./src/components/question/question.css": /*!**********************************************!*\ !*** ./src/components/question/question.css ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./question.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/question/question.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/question/question.jsx": /*!**********************************************!*\ !*** ./src/components/question/question.jsx ***! \**********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _question_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./question.css */ "./src/components/question/question.css"); /* harmony import */ var _question_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_question_css__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _forms_input_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../forms/input.jsx */ "./src/components/forms/input.jsx"); /* harmony import */ var _icon_enter_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./icon--enter.svg */ "./src/components/question/icon--enter.svg"); /* harmony import */ var _icon_enter_svg__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_icon_enter_svg__WEBPACK_IMPORTED_MODULE_4__); var QuestionComponent = function QuestionComponent(props) { var answer = props.answer, className = props.className, question = props.question, onChange = props.onChange, onClick = props.onClick, onKeyPress = props.onKeyPress; return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: className }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _question_css__WEBPACK_IMPORTED_MODULE_2___default.a.questionContainer }, question ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _question_css__WEBPACK_IMPORTED_MODULE_2___default.a.questionLabel }, question) : null, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _question_css__WEBPACK_IMPORTED_MODULE_2___default.a.questionInput }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_forms_input_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { autoFocus: true, value: answer, onChange: onChange, onKeyPress: onKeyPress }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("button", { className: _question_css__WEBPACK_IMPORTED_MODULE_2___default.a.questionSubmitButton, onClick: onClick }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", { className: _question_css__WEBPACK_IMPORTED_MODULE_2___default.a.questionSubmitButtonIcon, draggable: false, src: _icon_enter_svg__WEBPACK_IMPORTED_MODULE_4___default.a }))))); }; QuestionComponent.propTypes = { answer: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, className: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, onChange: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onClick: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onKeyPress: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, question: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string }; /* harmony default export */ __webpack_exports__["default"] = (QuestionComponent); /***/ }), /***/ "./src/components/record-modal/icon--back.svg": /*!****************************************************!*\ !*** ./src/components/record-modal/icon--back.svg ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/21988681fa28c8ce37982ca26463a6f5.svg"; /***/ }), /***/ "./src/components/record-modal/icon--play.svg": /*!****************************************************!*\ !*** ./src/components/record-modal/icon--play.svg ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/d889a872f3b0985b28fa872764172ef1.svg"; /***/ }), /***/ "./src/components/record-modal/icon--stop-playback.svg": /*!*************************************************************!*\ !*** ./src/components/record-modal/icon--stop-playback.svg ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/26255153f92ea41df149a58d3c3fe2cf.svg"; /***/ }), /***/ "./src/components/record-modal/icon--stop-recording.svg": /*!**************************************************************!*\ !*** ./src/components/record-modal/icon--stop-recording.svg ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/993a0700d8a0972d309307b0a4688ed7.svg"; /***/ }), /***/ "./src/components/record-modal/playback-step.jsx": /*!*******************************************************!*\ !*** ./src/components/record-modal/playback-step.jsx ***! \*******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _waveform_waveform_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../waveform/waveform.jsx */ "./src/components/waveform/waveform.jsx"); /* harmony import */ var _meter_meter_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../meter/meter.jsx */ "./src/components/meter/meter.jsx"); /* harmony import */ var _containers_audio_trimmer_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../containers/audio-trimmer.jsx */ "./src/containers/audio-trimmer.jsx"); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _record_modal_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./record-modal.css */ "./src/components/record-modal/record-modal.css"); /* harmony import */ var _record_modal_css__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_record_modal_css__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _icon_back_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./icon--back.svg */ "./src/components/record-modal/icon--back.svg"); /* harmony import */ var _icon_back_svg__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_icon_back_svg__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _icon_stop_playback_svg__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./icon--stop-playback.svg */ "./src/components/record-modal/icon--stop-playback.svg"); /* harmony import */ var _icon_stop_playback_svg__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_icon_stop_playback_svg__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _icon_play_svg__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./icon--play.svg */ "./src/components/record-modal/icon--play.svg"); /* harmony import */ var _icon_play_svg__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_icon_play_svg__WEBPACK_IMPORTED_MODULE_10__); var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_6__["defineMessages"])({ stopMsg: { "id": "gui.playbackStep.stopMsg", "defaultMessage": "Stop" }, playMsg: { "id": "gui.playbackStep.playMsg", "defaultMessage": "Play" }, loadingMsg: { "id": "gui.playbackStep.loadingMsg", "defaultMessage": "Loading..." }, saveMsg: { "id": "gui.playbackStep.saveMsg", "defaultMessage": "Save" }, reRecordMsg: { "id": "gui.playbackStep.reRecordMsg", "defaultMessage": "Re-record" } }); var PlaybackStep = function PlaybackStep(props) { return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], null, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], { className: _record_modal_css__WEBPACK_IMPORTED_MODULE_7___default.a.visualizationContainer }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], { className: _record_modal_css__WEBPACK_IMPORTED_MODULE_7___default.a.meterContainer }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_meter_meter_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { height: 172, level: 0, width: 20 })), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], { className: _record_modal_css__WEBPACK_IMPORTED_MODULE_7___default.a.waveformContainer }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_waveform_waveform_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { data: props.levels, height: 150, level: 0, width: 480 }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_containers_audio_trimmer_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { playhead: props.playhead, trimEnd: props.trimEnd, trimStart: props.trimStart, onSetTrimEnd: props.onSetTrimEnd, onSetTrimStart: props.onSetTrimStart }))), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], { className: _record_modal_css__WEBPACK_IMPORTED_MODULE_7___default.a.mainButtonRow }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("button", { className: _record_modal_css__WEBPACK_IMPORTED_MODULE_7___default.a.mainButton, onClick: props.playing ? props.onStopPlaying : props.onPlay }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", { draggable: false, src: props.playing ? _icon_stop_playback_svg__WEBPACK_IMPORTED_MODULE_9___default.a : _icon_play_svg__WEBPACK_IMPORTED_MODULE_10___default.a }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _record_modal_css__WEBPACK_IMPORTED_MODULE_7___default.a.helpText }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("span", { className: _record_modal_css__WEBPACK_IMPORTED_MODULE_7___default.a.playingText }, props.playing ? props.intl.formatMessage(messages.stopMsg) : props.intl.formatMessage(messages.playMsg))))), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], { className: _record_modal_css__WEBPACK_IMPORTED_MODULE_7___default.a.buttonRow }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("button", { className: _record_modal_css__WEBPACK_IMPORTED_MODULE_7___default.a.rerecordButton, onClick: props.onBack }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", { draggable: false, src: _icon_back_svg__WEBPACK_IMPORTED_MODULE_8___default.a }), props.intl.formatMessage(messages.reRecordMsg)), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("button", { className: _record_modal_css__WEBPACK_IMPORTED_MODULE_7___default.a.okButton, disabled: props.encoding, onClick: props.onSubmit }, props.encoding ? props.intl.formatMessage(messages.loadingMsg) : props.intl.formatMessage(messages.saveMsg)))); }; PlaybackStep.propTypes = { encoding: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool.isRequired, intl: react_intl__WEBPACK_IMPORTED_MODULE_6__["intlShape"].isRequired, levels: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number).isRequired, onBack: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onPlay: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onSetTrimEnd: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onSetTrimStart: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onStopPlaying: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onSubmit: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, playhead: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number, playing: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool.isRequired, trimEnd: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number.isRequired, trimStart: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number.isRequired }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_6__["injectIntl"])(PlaybackStep)); /***/ }), /***/ "./src/components/record-modal/record-modal.css": /*!******************************************************!*\ !*** ./src/components/record-modal/record-modal.css ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./record-modal.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/record-modal/record-modal.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/record-modal/record-modal.jsx": /*!******************************************************!*\ !*** ./src/components/record-modal/record-modal.jsx ***! \******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _containers_recording_step_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../containers/recording-step.jsx */ "./src/containers/recording-step.jsx"); /* harmony import */ var _containers_playback_step_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../containers/playback-step.jsx */ "./src/containers/playback-step.jsx"); /* harmony import */ var _containers_modal_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../containers/modal.jsx */ "./src/containers/modal.jsx"); /* harmony import */ var _record_modal_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./record-modal.css */ "./src/components/record-modal/record-modal.css"); /* harmony import */ var _record_modal_css__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_record_modal_css__WEBPACK_IMPORTED_MODULE_7__); var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_3__["defineMessages"])({ title: { "id": "gui.recordModal.title", "defaultMessage": "Record Sound" } }); var RecordModal = function RecordModal(props) { return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_containers_modal_jsx__WEBPACK_IMPORTED_MODULE_6__["default"], { className: _record_modal_css__WEBPACK_IMPORTED_MODULE_7___default.a.modalContent, contentLabel: props.intl.formatMessage(messages.title), onRequestClose: props.onCancel }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], { className: _record_modal_css__WEBPACK_IMPORTED_MODULE_7___default.a.body }, props.samples ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_containers_playback_step_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { encoding: props.encoding, levels: props.levels, playhead: props.playhead, playing: props.playing, sampleRate: props.sampleRate, samples: props.samples, trimEnd: props.trimEnd, trimStart: props.trimStart, onBack: props.onBack, onPlay: props.onPlay, onSetPlayhead: props.onSetPlayhead, onSetTrimEnd: props.onSetTrimEnd, onSetTrimStart: props.onSetTrimStart, onStopPlaying: props.onStopPlaying, onSubmit: props.onSubmit }) : react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_containers_recording_step_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { recording: props.recording, onRecord: props.onRecord, onStopRecording: props.onStopRecording }))); }; RecordModal.propTypes = { encoding: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool.isRequired, intl: react_intl__WEBPACK_IMPORTED_MODULE_3__["intlShape"].isRequired, levels: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number), onBack: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onCancel: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onPlay: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onRecord: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onSetPlayhead: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onSetTrimEnd: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onSetTrimStart: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onStopPlaying: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onStopRecording: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onSubmit: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, playhead: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number, playing: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, recording: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, sampleRate: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number, samples: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.instanceOf(Float32Array), trimEnd: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number.isRequired, trimStart: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number.isRequired }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_3__["injectIntl"])(RecordModal)); /***/ }), /***/ "./src/components/record-modal/recording-step.jsx": /*!********************************************************!*\ !*** ./src/components/record-modal/recording-step.jsx ***! \********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _meter_meter_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../meter/meter.jsx */ "./src/components/meter/meter.jsx"); /* harmony import */ var _waveform_waveform_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../waveform/waveform.jsx */ "./src/components/waveform/waveform.jsx"); /* harmony import */ var _record_modal_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./record-modal.css */ "./src/components/record-modal/record-modal.css"); /* harmony import */ var _record_modal_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_record_modal_css__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _icon_stop_recording_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./icon--stop-recording.svg */ "./src/components/record-modal/icon--stop-recording.svg"); /* harmony import */ var _icon_stop_recording_svg__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_icon_stop_recording_svg__WEBPACK_IMPORTED_MODULE_7__); var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_2__["defineMessages"])({ beginRecord: { "id": "gui.recordingStep.beginRecord", "defaultMessage": "Begin recording by clicking the button below" }, permission: { "id": "gui.recordingStep.permission", "defaultMessage": "{arrow}We need your permission to use your microphone" }, stop: { "id": "gui.recordingStep.stop", "defaultMessage": "Stop recording" }, record: { "id": "gui.recordingStep.record", "defaultMessage": "Record" } }); var RecordingStep = function RecordingStep(props) { return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], null, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _record_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.visualizationContainer }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _record_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.meterContainer }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_meter_meter_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { height: 172, level: props.level, width: 20 })), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _record_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.waveformContainer }, props.levels ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_waveform_waveform_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { data: props.levels, height: 150, level: 0, width: 440 }) : react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("span", { className: _record_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.helpText }, props.listening ? props.intl.formatMessage(messages.beginRecord) : props.intl.formatMessage(messages.permission, { arrow: props.isRtl ? "\u2197\uFE0F \xA0" : "\u2196\uFE0F \xA0" })))), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _record_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.mainButtonRow }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("button", { className: _record_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.mainButton, disabled: !props.listening, onClick: props.recording ? props.onStopRecording : props.onRecord }, props.recording ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", { draggable: false, src: _icon_stop_recording_svg__WEBPACK_IMPORTED_MODULE_7___default.a }) : react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("svg", { className: _record_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.recordButton, height: "52", width: "52" }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("circle", { className: _record_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.recordButtonCircle, cx: "26", cy: "26", r: "25" }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("circle", { className: _record_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.recordButtonCircleOutline, cx: "26", cy: "26", r: 27 + props.level * 5 })), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _record_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.helpText }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("span", { className: _record_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.recordingText }, props.recording ? props.intl.formatMessage(messages.stop) : props.intl.formatMessage(messages.record)))))); }; RecordingStep.propTypes = { intl: react_intl__WEBPACK_IMPORTED_MODULE_2__["intlShape"].isRequired, isRtl: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, level: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number, levels: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number), listening: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, onRecord: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onStopRecording: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, recording: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_2__["injectIntl"])(RecordingStep)); /***/ }), /***/ "./src/components/scratch-image/scratch-image.jsx": /*!********************************************************!*\ !*** ./src/components/scratch-image/scratch-image.jsx ***! \********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react_visibility_sensor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-visibility-sensor */ "./node_modules/react-visibility-sensor/dist/visibility-sensor.js"); /* harmony import */ var react_visibility_sensor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_visibility_sensor__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _lib_storage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../lib/storage */ "./src/lib/storage.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var ScratchImage = /*#__PURE__*/ function (_React$PureComponent) { _inherits(ScratchImage, _React$PureComponent); _createClass(ScratchImage, null, [{ key: "init", value: function init() { this._maxParallelism = 6; this._currentJobs = 0; this._pendingImages = new Set(); } }, { key: "loadPendingImages", value: function loadPendingImages() { var _this2 = this; if (this._currentJobs >= this._maxParallelism) { // already busy return; } // Find the first visible image. If there aren't any, find the first non-visible image. var nextImage; var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = this._pendingImages[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var image = _step.value; if (image.isVisible) { nextImage = image; break; } else { nextImage = nextImage || image; } } // If we found an image to load: // 1) Remove it from the queue // 2) Load the image // 3) Pump the queue again } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } if (nextImage) { this._pendingImages.delete(nextImage); var imageSource = nextImage.props.imageSource; ++this._currentJobs; _lib_storage__WEBPACK_IMPORTED_MODULE_3__["default"].load(imageSource.assetType, imageSource.assetId).then(function (asset) { if (!nextImage.wasUnmounted) { var dataURI = asset.encodeDataURI(); nextImage.setState({ imageURI: dataURI }); } --_this2._currentJobs; _this2.loadPendingImages(); }); } } }]); function ScratchImage(props) { var _this; _classCallCheck(this, ScratchImage); _this = _possibleConstructorReturn(this, _getPrototypeOf(ScratchImage).call(this, props)); _this.state = {}; Object.assign(_this.state, _this._loadImageSource(props.imageSource)); return _this; } _createClass(ScratchImage, [{ key: "componentWillReceiveProps", value: function componentWillReceiveProps(nextProps) { var newState = this._loadImageSource(nextProps.imageSource); this.setState(newState); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.wasUnmounted = true; ScratchImage._pendingImages.delete(this); } /** * Calculate the state changes necessary to load the image specified in the provided source info. If the component * is mounted, call setState() with the return value of this function. If the component has not yet mounted, use * the return value of this function as initial state for the component. * * @param {object} imageSource - the new source for the image, including either assetId or URI * @returns {object} - the new state values, if any. */ }, { key: "_loadImageSource", value: function _loadImageSource(imageSource) { if (imageSource) { if (imageSource.uri) { ScratchImage._pendingImages.delete(this); return { imageURI: imageSource.uri, lastRequestedAsset: null }; } if (this.state.lastRequestedAsset !== imageSource.assetId) { ScratchImage._pendingImages.add(this); return { lastRequestedAsset: imageSource.assetId }; } } // Nothing to do - don't change any state. return {}; } }, { key: "render", value: function render() { var _this3 = this; var _this$props = this.props, _src = _this$props.src, _imageSource = _this$props.imageSource, imgProps = _objectWithoutProperties(_this$props, ["src", "imageSource"]); return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_visibility_sensor__WEBPACK_IMPORTED_MODULE_2___default.a, { intervalCheck: true, scrollCheck: true }, function (_ref) { var isVisible = _ref.isVisible; _this3.isVisible = isVisible; ScratchImage.loadPendingImages(); return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", _extends({ src: _this3.state.imageURI }, imgProps)); }); } }]); return ScratchImage; }(react__WEBPACK_IMPORTED_MODULE_1___default.a.PureComponent); ScratchImage.ImageSourcePropType = prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({ assetId: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string.isRequired, assetType: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.oneOf(Object.values(_lib_storage__WEBPACK_IMPORTED_MODULE_3__["default"].AssetType)).isRequired }), prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({ uri: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string.isRequired })]); ScratchImage.propTypes = { imageSource: ScratchImage.ImageSourcePropType.isRequired }; ScratchImage.init(); /* harmony default export */ __webpack_exports__["default"] = (ScratchImage); /***/ }), /***/ "./src/components/slider-prompt/slider-prompt.css": /*!********************************************************!*\ !*** ./src/components/slider-prompt/slider-prompt.css ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./slider-prompt.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/slider-prompt/slider-prompt.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/slider-prompt/slider-prompt.jsx": /*!********************************************************!*\ !*** ./src/components/slider-prompt/slider-prompt.jsx ***! \********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _containers_modal_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../containers/modal.jsx */ "./src/containers/modal.jsx"); /* harmony import */ var _slider_prompt_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./slider-prompt.css */ "./src/components/slider-prompt/slider-prompt.css"); /* harmony import */ var _slider_prompt_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_slider_prompt_css__WEBPACK_IMPORTED_MODULE_5__); var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_0__["defineMessages"])({ minValue: { "id": "gui.sliderModal.min", "defaultMessage": "Minimum value" }, maxValue: { "id": "gui.sliderModal.max", "defaultMessage": "Maximum value" }, title: { "id": "gui.sliderModal.title", "defaultMessage": "Change slider range" } }); var SliderPromptComponent = function SliderPromptComponent(props) { return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_containers_modal_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: _slider_prompt_css__WEBPACK_IMPORTED_MODULE_5___default.a.modalContent, contentLabel: props.intl.formatMessage(messages.title), id: "sliderPrompt", onRequestClose: props.onCancel }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _slider_prompt_css__WEBPACK_IMPORTED_MODULE_5___default.a.body }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _slider_prompt_css__WEBPACK_IMPORTED_MODULE_5___default.a.label }, props.intl.formatMessage(messages.minValue)), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], null, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("input", { className: _slider_prompt_css__WEBPACK_IMPORTED_MODULE_5___default.a.minInput, name: props.intl.formatMessage(messages.minValue), pattern: "-?[0-9]*(\\.[0-9]+)?", type: "text", value: props.minValue, onChange: props.onChangeMin, onKeyPress: props.onKeyPress })), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _slider_prompt_css__WEBPACK_IMPORTED_MODULE_5___default.a.label }, props.intl.formatMessage(messages.maxValue)), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], null, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("input", { className: _slider_prompt_css__WEBPACK_IMPORTED_MODULE_5___default.a.maxInput, name: props.intl.formatMessage(messages.maxValue), pattern: "-?[0-9]*(\\.[0-9]+)?", type: "text", value: props.maxValue, onChange: props.onChangeMax, onKeyPress: props.onKeyPress })), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _slider_prompt_css__WEBPACK_IMPORTED_MODULE_5___default.a.buttonRow }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("button", { className: _slider_prompt_css__WEBPACK_IMPORTED_MODULE_5___default.a.cancelButton, onClick: props.onCancel }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_0__["FormattedMessage"], { defaultMessage: "Cancel", id: "gui.sliderPrompt.cancel" })), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("button", { className: _slider_prompt_css__WEBPACK_IMPORTED_MODULE_5___default.a.okButton, onClick: props.onOk }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_0__["FormattedMessage"], { defaultMessage: "OK", id: "gui.sliderPrompt.ok" }))))); }; SliderPromptComponent.propTypes = { intl: react_intl__WEBPACK_IMPORTED_MODULE_0__["intlShape"], maxValue: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, minValue: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, onCancel: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, onChangeMax: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, onChangeMin: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, onKeyPress: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, onOk: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_0__["injectIntl"])(SliderPromptComponent)); /***/ }), /***/ "./src/components/sound-editor/icon--echo.svg": /*!****************************************************!*\ !*** ./src/components/sound-editor/icon--echo.svg ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/fb3f9fa9be421f5153cd0223c3b0cb87.svg"; /***/ }), /***/ "./src/components/sound-editor/icon--faster.svg": /*!******************************************************!*\ !*** ./src/components/sound-editor/icon--faster.svg ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/8279ce395d0333b880b8be6d243fd111.svg"; /***/ }), /***/ "./src/components/sound-editor/icon--louder.svg": /*!******************************************************!*\ !*** ./src/components/sound-editor/icon--louder.svg ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/b2c44c738c9cbc1a99cd6edfd0c2b85b.svg"; /***/ }), /***/ "./src/components/sound-editor/icon--redo.svg": /*!****************************************************!*\ !*** ./src/components/sound-editor/icon--redo.svg ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/7c417cd2ff5d03f924e0ec8f380ad972.svg"; /***/ }), /***/ "./src/components/sound-editor/icon--reverse.svg": /*!*******************************************************!*\ !*** ./src/components/sound-editor/icon--reverse.svg ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/fe5afd6776eac0f7724b132a9ff5057d.svg"; /***/ }), /***/ "./src/components/sound-editor/icon--robot.svg": /*!*****************************************************!*\ !*** ./src/components/sound-editor/icon--robot.svg ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/199f58b4a80fa56c5d8e032d6da5e9c2.svg"; /***/ }), /***/ "./src/components/sound-editor/icon--slower.svg": /*!******************************************************!*\ !*** ./src/components/sound-editor/icon--slower.svg ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/424371873bc8df88d6a305d8727157ab.svg"; /***/ }), /***/ "./src/components/sound-editor/icon--softer.svg": /*!******************************************************!*\ !*** ./src/components/sound-editor/icon--softer.svg ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/3547fa1f2678a483a19f46852f36b426.svg"; /***/ }), /***/ "./src/components/sound-editor/icon--trim-confirm.svg": /*!************************************************************!*\ !*** ./src/components/sound-editor/icon--trim-confirm.svg ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/a7b8435328fd6d9605bc47218b0151ab.svg"; /***/ }), /***/ "./src/components/sound-editor/icon--trim.svg": /*!****************************************************!*\ !*** ./src/components/sound-editor/icon--trim.svg ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/bc487cde787d1a887f7d5494e707ef46.svg"; /***/ }), /***/ "./src/components/sound-editor/icon--undo.svg": /*!****************************************************!*\ !*** ./src/components/sound-editor/icon--undo.svg ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/af2202211ca1873edb949012dab6f9d1.svg"; /***/ }), /***/ "./src/components/sound-editor/sound-editor.css": /*!******************************************************!*\ !*** ./src/components/sound-editor/sound-editor.css ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./sound-editor.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/sound-editor/sound-editor.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/sound-editor/sound-editor.jsx": /*!******************************************************!*\ !*** ./src/components/sound-editor/sound-editor.jsx ***! \******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _waveform_waveform_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../waveform/waveform.jsx */ "./src/components/waveform/waveform.jsx"); /* harmony import */ var _forms_label_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../forms/label.jsx */ "./src/components/forms/label.jsx"); /* harmony import */ var _forms_input_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../forms/input.jsx */ "./src/components/forms/input.jsx"); /* harmony import */ var _forms_buffered_input_hoc_jsx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../forms/buffered-input-hoc.jsx */ "./src/components/forms/buffered-input-hoc.jsx"); /* harmony import */ var _containers_audio_trimmer_jsx__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../containers/audio-trimmer.jsx */ "./src/containers/audio-trimmer.jsx"); /* harmony import */ var _icon_button_icon_button_jsx__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../icon-button/icon-button.jsx */ "./src/components/icon-button/icon-button.jsx"); /* harmony import */ var _sound_editor_css__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./sound-editor.css */ "./src/components/sound-editor/sound-editor.css"); /* harmony import */ var _sound_editor_css__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_sound_editor_css__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _record_modal_icon_play_svg__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../record-modal/icon--play.svg */ "./src/components/record-modal/icon--play.svg"); /* harmony import */ var _record_modal_icon_play_svg__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_record_modal_icon_play_svg__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _record_modal_icon_stop_playback_svg__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../record-modal/icon--stop-playback.svg */ "./src/components/record-modal/icon--stop-playback.svg"); /* harmony import */ var _record_modal_icon_stop_playback_svg__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_record_modal_icon_stop_playback_svg__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var _icon_trim_svg__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./icon--trim.svg */ "./src/components/sound-editor/icon--trim.svg"); /* harmony import */ var _icon_trim_svg__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_icon_trim_svg__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var _icon_trim_confirm_svg__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./icon--trim-confirm.svg */ "./src/components/sound-editor/icon--trim-confirm.svg"); /* harmony import */ var _icon_trim_confirm_svg__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_icon_trim_confirm_svg__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var _icon_redo_svg__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./icon--redo.svg */ "./src/components/sound-editor/icon--redo.svg"); /* harmony import */ var _icon_redo_svg__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_icon_redo_svg__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var _icon_undo_svg__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./icon--undo.svg */ "./src/components/sound-editor/icon--undo.svg"); /* harmony import */ var _icon_undo_svg__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(_icon_undo_svg__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var _icon_echo_svg__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./icon--echo.svg */ "./src/components/sound-editor/icon--echo.svg"); /* harmony import */ var _icon_echo_svg__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(_icon_echo_svg__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var _icon_faster_svg__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./icon--faster.svg */ "./src/components/sound-editor/icon--faster.svg"); /* harmony import */ var _icon_faster_svg__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(_icon_faster_svg__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var _icon_slower_svg__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./icon--slower.svg */ "./src/components/sound-editor/icon--slower.svg"); /* harmony import */ var _icon_slower_svg__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(_icon_slower_svg__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var _icon_louder_svg__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./icon--louder.svg */ "./src/components/sound-editor/icon--louder.svg"); /* harmony import */ var _icon_louder_svg__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(_icon_louder_svg__WEBPACK_IMPORTED_MODULE_20__); /* harmony import */ var _icon_softer_svg__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./icon--softer.svg */ "./src/components/sound-editor/icon--softer.svg"); /* harmony import */ var _icon_softer_svg__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(_icon_softer_svg__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var _icon_robot_svg__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./icon--robot.svg */ "./src/components/sound-editor/icon--robot.svg"); /* harmony import */ var _icon_robot_svg__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(_icon_robot_svg__WEBPACK_IMPORTED_MODULE_22__); /* harmony import */ var _icon_reverse_svg__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./icon--reverse.svg */ "./src/components/sound-editor/icon--reverse.svg"); /* harmony import */ var _icon_reverse_svg__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(_icon_reverse_svg__WEBPACK_IMPORTED_MODULE_23__); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var BufferedInput = Object(_forms_buffered_input_hoc_jsx__WEBPACK_IMPORTED_MODULE_7__["default"])(_forms_input_jsx__WEBPACK_IMPORTED_MODULE_6__["default"]); var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_3__["defineMessages"])({ sound: { "id": "gui.soundEditor.sound", "defaultMessage": "Sound" }, play: { "id": "gui.soundEditor.play", "defaultMessage": "Play" }, stop: { "id": "gui.soundEditor.stop", "defaultMessage": "Stop" }, trim: { "id": "gui.soundEditor.trim", "defaultMessage": "Trim" }, save: { "id": "gui.soundEditor.save", "defaultMessage": "Save" }, undo: { "id": "gui.soundEditor.undo", "defaultMessage": "Undo" }, redo: { "id": "gui.soundEditor.redo", "defaultMessage": "Redo" }, faster: { "id": "gui.soundEditor.faster", "defaultMessage": "Faster" }, slower: { "id": "gui.soundEditor.slower", "defaultMessage": "Slower" }, echo: { "id": "gui.soundEditor.echo", "defaultMessage": "Echo" }, robot: { "id": "gui.soundEditor.robot", "defaultMessage": "Robot" }, louder: { "id": "gui.soundEditor.louder", "defaultMessage": "Louder" }, softer: { "id": "gui.soundEditor.softer", "defaultMessage": "Softer" }, reverse: { "id": "gui.soundEditor.reverse", "defaultMessage": "Reverse" } }); var SoundEditor = function SoundEditor(props) { return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _sound_editor_css__WEBPACK_IMPORTED_MODULE_10___default.a.editorContainer }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _sound_editor_css__WEBPACK_IMPORTED_MODULE_10___default.a.row }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _sound_editor_css__WEBPACK_IMPORTED_MODULE_10___default.a.inputGroup }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_forms_label_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { text: props.intl.formatMessage(messages.sound) }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(BufferedInput, { tabIndex: "1", type: "text", value: props.name, onSubmit: props.onChangeName })), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _sound_editor_css__WEBPACK_IMPORTED_MODULE_10___default.a.buttonGroup }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("button", { className: _sound_editor_css__WEBPACK_IMPORTED_MODULE_10___default.a.button, disabled: !props.canUndo, title: props.intl.formatMessage(messages.undo), onClick: props.onUndo }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", { className: _sound_editor_css__WEBPACK_IMPORTED_MODULE_10___default.a.undoIcon, draggable: false, src: _icon_undo_svg__WEBPACK_IMPORTED_MODULE_16___default.a })), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("button", { className: _sound_editor_css__WEBPACK_IMPORTED_MODULE_10___default.a.button, disabled: !props.canRedo, title: props.intl.formatMessage(messages.redo), onClick: props.onRedo }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", { className: _sound_editor_css__WEBPACK_IMPORTED_MODULE_10___default.a.redoIcon, draggable: false, src: _icon_redo_svg__WEBPACK_IMPORTED_MODULE_15___default.a })))), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_icon_button_icon_button_jsx__WEBPACK_IMPORTED_MODULE_9__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_sound_editor_css__WEBPACK_IMPORTED_MODULE_10___default.a.trimButton, _defineProperty({}, _sound_editor_css__WEBPACK_IMPORTED_MODULE_10___default.a.trimButtonActive, props.trimStart !== null)), img: props.trimStart === null ? _icon_trim_svg__WEBPACK_IMPORTED_MODULE_13___default.a : _icon_trim_confirm_svg__WEBPACK_IMPORTED_MODULE_14___default.a, title: props.trimStart === null ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], messages.trim) : react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], messages.save), onClick: props.onActivateTrim })), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _sound_editor_css__WEBPACK_IMPORTED_MODULE_10___default.a.row }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _sound_editor_css__WEBPACK_IMPORTED_MODULE_10___default.a.waveformContainer }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_waveform_waveform_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { data: props.chunkLevels, height: 160, width: 600 }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_containers_audio_trimmer_jsx__WEBPACK_IMPORTED_MODULE_8__["default"], { playhead: props.playhead, trimEnd: props.trimEnd, trimStart: props.trimStart, onSetTrimEnd: props.onSetTrimEnd, onSetTrimStart: props.onSetTrimStart }))), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_sound_editor_css__WEBPACK_IMPORTED_MODULE_10___default.a.row, _sound_editor_css__WEBPACK_IMPORTED_MODULE_10___default.a.rowReverse) }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _sound_editor_css__WEBPACK_IMPORTED_MODULE_10___default.a.inputGroup }, props.playhead ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("button", { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_sound_editor_css__WEBPACK_IMPORTED_MODULE_10___default.a.roundButton, _sound_editor_css__WEBPACK_IMPORTED_MODULE_10___default.a.stopButtonn), title: props.intl.formatMessage(messages.stop), onClick: props.onStop }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", { draggable: false, src: _record_modal_icon_stop_playback_svg__WEBPACK_IMPORTED_MODULE_12___default.a })) : react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("button", { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_sound_editor_css__WEBPACK_IMPORTED_MODULE_10___default.a.roundButton, _sound_editor_css__WEBPACK_IMPORTED_MODULE_10___default.a.playButton), title: props.intl.formatMessage(messages.play), onClick: props.onPlay }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", { draggable: false, src: _record_modal_icon_play_svg__WEBPACK_IMPORTED_MODULE_11___default.a }))), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_icon_button_icon_button_jsx__WEBPACK_IMPORTED_MODULE_9__["default"], { className: _sound_editor_css__WEBPACK_IMPORTED_MODULE_10___default.a.effectButton, img: _icon_faster_svg__WEBPACK_IMPORTED_MODULE_18___default.a, title: react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], messages.faster), onClick: props.onFaster }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_icon_button_icon_button_jsx__WEBPACK_IMPORTED_MODULE_9__["default"], { className: _sound_editor_css__WEBPACK_IMPORTED_MODULE_10___default.a.effectButton, img: _icon_slower_svg__WEBPACK_IMPORTED_MODULE_19___default.a, title: react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], messages.slower), onClick: props.onSlower }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_icon_button_icon_button_jsx__WEBPACK_IMPORTED_MODULE_9__["default"], { className: _sound_editor_css__WEBPACK_IMPORTED_MODULE_10___default.a.effectButton, img: _icon_echo_svg__WEBPACK_IMPORTED_MODULE_17___default.a, title: react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], messages.echo), onClick: props.onEcho }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_icon_button_icon_button_jsx__WEBPACK_IMPORTED_MODULE_9__["default"], { className: _sound_editor_css__WEBPACK_IMPORTED_MODULE_10___default.a.effectButton, img: _icon_robot_svg__WEBPACK_IMPORTED_MODULE_22___default.a, title: react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], messages.robot), onClick: props.onRobot }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_icon_button_icon_button_jsx__WEBPACK_IMPORTED_MODULE_9__["default"], { className: _sound_editor_css__WEBPACK_IMPORTED_MODULE_10___default.a.effectButton, img: _icon_louder_svg__WEBPACK_IMPORTED_MODULE_20___default.a, title: react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], messages.louder), onClick: props.onLouder }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_icon_button_icon_button_jsx__WEBPACK_IMPORTED_MODULE_9__["default"], { className: _sound_editor_css__WEBPACK_IMPORTED_MODULE_10___default.a.effectButton, img: _icon_softer_svg__WEBPACK_IMPORTED_MODULE_21___default.a, title: react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], messages.softer), onClick: props.onSofter }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_icon_button_icon_button_jsx__WEBPACK_IMPORTED_MODULE_9__["default"], { className: _sound_editor_css__WEBPACK_IMPORTED_MODULE_10___default.a.effectButton, img: _icon_reverse_svg__WEBPACK_IMPORTED_MODULE_23___default.a, title: react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], messages.reverse), onClick: props.onReverse }))); }; SoundEditor.propTypes = { canRedo: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool.isRequired, canUndo: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool.isRequired, chunkLevels: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number).isRequired, intl: react_intl__WEBPACK_IMPORTED_MODULE_3__["intlShape"], name: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string.isRequired, onActivateTrim: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onChangeName: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onEcho: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onFaster: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onLouder: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onPlay: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onRedo: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onReverse: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onRobot: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onSetTrimEnd: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onSetTrimStart: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onSlower: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onSofter: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onStop: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onUndo: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, playhead: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number, trimEnd: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number, trimStart: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_3__["injectIntl"])(SoundEditor)); /***/ }), /***/ "./src/components/spinner/spinner.css": /*!********************************************!*\ !*** ./src/components/spinner/spinner.css ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./spinner.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/spinner/spinner.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/spinner/spinner.jsx": /*!********************************************!*\ !*** ./src/components/spinner/spinner.jsx ***! \********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _spinner_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./spinner.css */ "./src/components/spinner/spinner.css"); /* harmony import */ var _spinner_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_spinner_css__WEBPACK_IMPORTED_MODULE_3__); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var SpinnerComponent = function SpinnerComponent(props) { var className = props.className, level = props.level, small = props.small; return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(className, _spinner_css__WEBPACK_IMPORTED_MODULE_3___default.a.spinner, _spinner_css__WEBPACK_IMPORTED_MODULE_3___default.a[level], _defineProperty({}, _spinner_css__WEBPACK_IMPORTED_MODULE_3___default.a.small, small)) }); }; SpinnerComponent.propTypes = { className: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, level: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, small: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool }; SpinnerComponent.defaultProps = { className: '', level: 'info' }; /* harmony default export */ __webpack_exports__["default"] = (SpinnerComponent); /***/ }), /***/ "./src/components/sprite-info/icon--hide.svg": /*!***************************************************!*\ !*** ./src/components/sprite-info/icon--hide.svg ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/68d9ddbb2aa63310b88c7697e5b0c6c9.svg"; /***/ }), /***/ "./src/components/sprite-info/icon--show.svg": /*!***************************************************!*\ !*** ./src/components/sprite-info/icon--show.svg ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/acc6c29b5eee67bc6b2aa85854d9bb3a.svg"; /***/ }), /***/ "./src/components/sprite-info/icon--x.svg": /*!************************************************!*\ !*** ./src/components/sprite-info/icon--x.svg ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/38a70367a21e2f1fb15aa59b7d367450.svg"; /***/ }), /***/ "./src/components/sprite-info/icon--y.svg": /*!************************************************!*\ !*** ./src/components/sprite-info/icon--y.svg ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/9ddae4f6c1aeaf0784007203d9d4ac9c.svg"; /***/ }), /***/ "./src/components/sprite-info/sprite-info.css": /*!****************************************************!*\ !*** ./src/components/sprite-info/sprite-info.css ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./sprite-info.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/sprite-info/sprite-info.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/sprite-info/sprite-info.jsx": /*!****************************************************!*\ !*** ./src/components/sprite-info/sprite-info.jsx ***! \****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _forms_label_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../forms/label.jsx */ "./src/components/forms/label.jsx"); /* harmony import */ var _forms_input_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../forms/input.jsx */ "./src/components/forms/input.jsx"); /* harmony import */ var _forms_buffered_input_hoc_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../forms/buffered-input-hoc.jsx */ "./src/components/forms/buffered-input-hoc.jsx"); /* harmony import */ var _containers_direction_picker_jsx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../containers/direction-picker.jsx */ "./src/containers/direction-picker.jsx"); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _lib_layout_constants_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../lib/layout-constants.js */ "./src/lib/layout-constants.js"); /* harmony import */ var _lib_locale_utils_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../lib/locale-utils.js */ "./src/lib/locale-utils.js"); /* harmony import */ var _sprite_info_css__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./sprite-info.css */ "./src/components/sprite-info/sprite-info.css"); /* harmony import */ var _sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_sprite_info_css__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _icon_x_svg__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./icon--x.svg */ "./src/components/sprite-info/icon--x.svg"); /* harmony import */ var _icon_x_svg__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_icon_x_svg__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var _icon_y_svg__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./icon--y.svg */ "./src/components/sprite-info/icon--y.svg"); /* harmony import */ var _icon_y_svg__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_icon_y_svg__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var _icon_show_svg__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./icon--show.svg */ "./src/components/sprite-info/icon--show.svg"); /* harmony import */ var _icon_show_svg__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_icon_show_svg__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var _icon_hide_svg__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./icon--hide.svg */ "./src/components/sprite-info/icon--hide.svg"); /* harmony import */ var _icon_hide_svg__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_icon_hide_svg__WEBPACK_IMPORTED_MODULE_15__); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var BufferedInput = Object(_forms_buffered_input_hoc_jsx__WEBPACK_IMPORTED_MODULE_6__["default"])(_forms_input_jsx__WEBPACK_IMPORTED_MODULE_5__["default"]); var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_8__["defineMessages"])({ spritePlaceholder: { "id": "gui.SpriteInfo.spritePlaceholder", "defaultMessage": "Name" } }); var SpriteInfo = /*#__PURE__*/ function (_React$Component) { _inherits(SpriteInfo, _React$Component); function SpriteInfo() { _classCallCheck(this, SpriteInfo); return _possibleConstructorReturn(this, _getPrototypeOf(SpriteInfo).apply(this, arguments)); } _createClass(SpriteInfo, [{ key: "shouldComponentUpdate", value: function shouldComponentUpdate(nextProps) { return this.props.rotationStyle !== nextProps.rotationStyle || this.props.disabled !== nextProps.disabled || this.props.name !== nextProps.name || this.props.stageSize !== nextProps.stageSize || this.props.visible !== nextProps.visible || // Only update these if rounded value has changed Math.round(this.props.direction) !== Math.round(nextProps.direction) || Math.round(this.props.size) !== Math.round(nextProps.size) || Math.round(this.props.x) !== Math.round(nextProps.x) || Math.round(this.props.y) !== Math.round(nextProps.y); } }, { key: "render", value: function render() { var _classNames2, _classNames3; var stageSize = this.props.stageSize; var sprite = react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_8__["FormattedMessage"], { defaultMessage: "Sprite", id: "gui.SpriteInfo.sprite" }); var showLabel = react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_8__["FormattedMessage"], { defaultMessage: "Show", id: "gui.SpriteInfo.show" }); var sizeLabel = react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_8__["FormattedMessage"], { defaultMessage: "Size", id: "gui.SpriteInfo.size" }); var labelAbove = Object(_lib_locale_utils_js__WEBPACK_IMPORTED_MODULE_10__["isWideLocale"])(this.props.intl.locale); var spriteNameInput = react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(BufferedInput, { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.spriteInput, _defineProperty({}, _sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.columnInput, labelAbove)), disabled: this.props.disabled, placeholder: this.props.intl.formatMessage(messages.spritePlaceholder), tabIndex: "0", type: "text", value: this.props.disabled ? '' : this.props.name, onSubmit: this.props.onChangeName }); var xPosition = react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.group }, stageSize === _lib_layout_constants_js__WEBPACK_IMPORTED_MODULE_9__["STAGE_DISPLAY_SIZES"].large ? react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.iconWrapper }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("img", { "aria-hidden": "true", className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.xIcon, _sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.icon), src: _icon_x_svg__WEBPACK_IMPORTED_MODULE_12___default.a })) : null, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_forms_label_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { text: "x" }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(BufferedInput, { small: true, disabled: this.props.disabled, placeholder: "x", tabIndex: "0", type: "text", value: this.props.disabled ? '' : Math.round(this.props.x), onSubmit: this.props.onChangeX }))); var yPosition = react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.group }, stageSize === _lib_layout_constants_js__WEBPACK_IMPORTED_MODULE_9__["STAGE_DISPLAY_SIZES"].large ? react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.iconWrapper }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("img", { "aria-hidden": "true", className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.yIcon, _sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.icon), src: _icon_y_svg__WEBPACK_IMPORTED_MODULE_13___default.a })) : null, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_forms_label_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { text: "y" }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(BufferedInput, { small: true, disabled: this.props.disabled, placeholder: "y", tabIndex: "0", type: "text", value: this.props.disabled ? '' : Math.round(this.props.y), onSubmit: this.props.onChangeY }))); if (stageSize === _lib_layout_constants_js__WEBPACK_IMPORTED_MODULE_9__["STAGE_DISPLAY_SIZES"].small) { return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.spriteInfo }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.row, _sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.rowPrimary) }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.group }, spriteNameInput)), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.row, _sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.rowSecondary) }, xPosition, yPosition)); } return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.spriteInfo }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.row, _sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.rowPrimary) }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.group }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_forms_label_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { above: labelAbove, text: sprite }, spriteNameInput)), xPosition, yPosition), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.row, _sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.rowSecondary) }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: labelAbove ? _sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.column : _sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.group }, stageSize === _lib_layout_constants_js__WEBPACK_IMPORTED_MODULE_9__["STAGE_DISPLAY_SIZES"].large ? react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_forms_label_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { secondary: true, text: showLabel }) : null, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.radioWrapper }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.radio, _sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.radioFirst, _sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.iconWrapper, (_classNames2 = {}, _defineProperty(_classNames2, _sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.isActive, this.props.visible && !this.props.disabled), _defineProperty(_classNames2, _sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.isDisabled, this.props.disabled), _classNames2)), tabIndex: "0", onClick: this.props.onClickVisible, onKeyPress: this.props.onPressVisible }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("img", { className: _sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.icon, src: _icon_show_svg__WEBPACK_IMPORTED_MODULE_14___default.a })), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.radio, _sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.radioLast, _sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.iconWrapper, (_classNames3 = {}, _defineProperty(_classNames3, _sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.isActive, !this.props.visible && !this.props.disabled), _defineProperty(_classNames3, _sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.isDisabled, this.props.disabled), _classNames3)), tabIndex: "0", onClick: this.props.onClickNotVisible, onKeyPress: this.props.onPressNotVisible }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("img", { className: _sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.icon, src: _icon_hide_svg__WEBPACK_IMPORTED_MODULE_15___default.a })))), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.group, _sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.largerInput) }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_forms_label_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { secondary: true, above: labelAbove, text: sizeLabel }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(BufferedInput, { small: true, disabled: this.props.disabled, label: sizeLabel, tabIndex: "0", type: "text", value: this.props.disabled ? '' : Math.round(this.props.size), onSubmit: this.props.onChangeSize }))), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.group, _sprite_info_css__WEBPACK_IMPORTED_MODULE_11___default.a.largerInput) }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_containers_direction_picker_jsx__WEBPACK_IMPORTED_MODULE_7__["default"], { direction: Math.round(this.props.direction), disabled: this.props.disabled, labelAbove: labelAbove, rotationStyle: this.props.rotationStyle, onChangeDirection: this.props.onChangeDirection, onChangeRotationStyle: this.props.onChangeRotationStyle })))); } }]); return SpriteInfo; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.Component); SpriteInfo.propTypes = { direction: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number]), disabled: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, intl: react_intl__WEBPACK_IMPORTED_MODULE_8__["intlShape"], name: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, onChangeDirection: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onChangeName: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onChangeRotationStyle: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onChangeSize: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onChangeX: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onChangeY: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onClickNotVisible: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onClickVisible: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onPressNotVisible: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onPressVisible: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, rotationStyle: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, size: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number]), stageSize: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOf(Object.keys(_lib_layout_constants_js__WEBPACK_IMPORTED_MODULE_9__["STAGE_DISPLAY_SIZES"])).isRequired, visible: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, x: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number]), y: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number]) }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_8__["injectIntl"])(SpriteInfo)); /***/ }), /***/ "./src/components/sprite-selector-item/sprite-selector-item.css": /*!**********************************************************************!*\ !*** ./src/components/sprite-selector-item/sprite-selector-item.css ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./sprite-selector-item.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/sprite-selector-item/sprite-selector-item.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/sprite-selector-item/sprite-selector-item.jsx": /*!**********************************************************************!*\ !*** ./src/components/sprite-selector-item/sprite-selector-item.jsx ***! \**********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _close_button_close_button_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../close-button/close-button.jsx */ "./src/components/close-button/close-button.jsx"); /* harmony import */ var _sprite_selector_item_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./sprite-selector-item.css */ "./src/components/sprite-selector-item/sprite-selector-item.css"); /* harmony import */ var _sprite_selector_item_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_sprite_selector_item_css__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var react_contextmenu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-contextmenu */ "./node_modules/react-contextmenu/es6/index.js"); /* harmony import */ var _context_menu_context_menu_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../context-menu/context-menu.jsx */ "./src/components/context-menu/context-menu.jsx"); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } // react-contextmenu requires unique id to match trigger and context menu var contextMenuId = 0; var SpriteSelectorItem = function SpriteSelectorItem(props) { return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_contextmenu__WEBPACK_IMPORTED_MODULE_5__["ContextMenuTrigger"], { attributes: { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(props.className, _sprite_selector_item_css__WEBPACK_IMPORTED_MODULE_4___default.a.spriteSelectorItem, _defineProperty({}, _sprite_selector_item_css__WEBPACK_IMPORTED_MODULE_4___default.a.isSelected, props.selected)), onClick: props.onClick, onMouseEnter: props.onMouseEnter, onMouseLeave: props.onMouseLeave, onMouseDown: props.onMouseDown, onTouchStart: props.onMouseDown }, disable: props.dragging, id: "".concat(props.name, "-").concat(contextMenuId) }, typeof props.number === 'undefined' ? null : react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _sprite_selector_item_css__WEBPACK_IMPORTED_MODULE_4___default.a.number }, props.number), props.costumeURL ? react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _sprite_selector_item_css__WEBPACK_IMPORTED_MODULE_4___default.a.spriteImageOuter }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _sprite_selector_item_css__WEBPACK_IMPORTED_MODULE_4___default.a.spriteImageInner }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("img", { className: _sprite_selector_item_css__WEBPACK_IMPORTED_MODULE_4___default.a.spriteImage, draggable: false, src: props.costumeURL }))) : null, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _sprite_selector_item_css__WEBPACK_IMPORTED_MODULE_4___default.a.spriteInfo }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _sprite_selector_item_css__WEBPACK_IMPORTED_MODULE_4___default.a.spriteName }, props.name), props.details ? react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _sprite_selector_item_css__WEBPACK_IMPORTED_MODULE_4___default.a.spriteDetails }, props.details) : null), props.selected && props.onDeleteButtonClick ? react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_close_button_close_button_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _sprite_selector_item_css__WEBPACK_IMPORTED_MODULE_4___default.a.deleteButton, size: _close_button_close_button_jsx__WEBPACK_IMPORTED_MODULE_3__["default"].SIZE_SMALL, onClick: props.onDeleteButtonClick }) : null, props.onDuplicateButtonClick || props.onDeleteButtonClick || props.onExportButtonClick ? react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_context_menu_context_menu_jsx__WEBPACK_IMPORTED_MODULE_6__["ContextMenu"], { id: "".concat(props.name, "-").concat(contextMenuId++) }, props.onDuplicateButtonClick ? react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_context_menu_context_menu_jsx__WEBPACK_IMPORTED_MODULE_6__["MenuItem"], { onClick: props.onDuplicateButtonClick }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_7__["FormattedMessage"], { defaultMessage: "duplicate", id: "gui.spriteSelectorItem.contextMenuDuplicate" })) : null, props.onExportButtonClick ? react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_context_menu_context_menu_jsx__WEBPACK_IMPORTED_MODULE_6__["MenuItem"], { onClick: props.onExportButtonClick }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_7__["FormattedMessage"], { defaultMessage: "export", id: "gui.spriteSelectorItem.contextMenuExport" })) : null, props.onDeleteButtonClick ? react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_context_menu_context_menu_jsx__WEBPACK_IMPORTED_MODULE_6__["DangerousMenuItem"], { onClick: props.onDeleteButtonClick }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_7__["FormattedMessage"], { defaultMessage: "delete", id: "gui.spriteSelectorItem.contextMenuDelete" })) : null) : null); }; SpriteSelectorItem.propTypes = { className: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, costumeURL: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, details: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, dragging: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, name: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string.isRequired, number: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, onClick: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onDeleteButtonClick: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onDuplicateButtonClick: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onExportButtonClick: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onMouseDown: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onMouseEnter: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onMouseLeave: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, selected: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool.isRequired }; /* harmony default export */ __webpack_exports__["default"] = (SpriteSelectorItem); /***/ }), /***/ "./src/components/sprite-selector/sprite-list.jsx": /*!********************************************************!*\ !*** ./src/components/sprite-selector/sprite-list.jsx ***! \********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _lib_drag_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../lib/drag-constants */ "./src/lib/drag-constants.js"); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _containers_sprite_selector_item_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../containers/sprite-selector-item.jsx */ "./src/containers/sprite-selector-item.jsx"); /* harmony import */ var _lib_sortable_hoc_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../lib/sortable-hoc.jsx */ "./src/lib/sortable-hoc.jsx"); /* harmony import */ var _asset_panel_sortable_asset_jsx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../asset-panel/sortable-asset.jsx */ "./src/components/asset-panel/sortable-asset.jsx"); /* harmony import */ var _lib_throttled_property_hoc_jsx__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../lib/throttled-property-hoc.jsx */ "./src/lib/throttled-property-hoc.jsx"); /* harmony import */ var _sprite_selector_css__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./sprite-selector.css */ "./src/components/sprite-selector/sprite-selector.css"); /* harmony import */ var _sprite_selector_css__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_sprite_selector_css__WEBPACK_IMPORTED_MODULE_9__); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var ThrottledSpriteSelectorItem = Object(_lib_throttled_property_hoc_jsx__WEBPACK_IMPORTED_MODULE_8__["default"])('asset', 500)(_containers_sprite_selector_item_jsx__WEBPACK_IMPORTED_MODULE_5__["default"]); var SpriteList = function SpriteList(props) { var containerRef = props.containerRef, editingTarget = props.editingTarget, draggingIndex = props.draggingIndex, draggingType = props.draggingType, hoveredTarget = props.hoveredTarget, onDeleteSprite = props.onDeleteSprite, onDuplicateSprite = props.onDuplicateSprite, onExportSprite = props.onExportSprite, onSelectSprite = props.onSelectSprite, onAddSortable = props.onAddSortable, onRemoveSortable = props.onRemoveSortable, ordering = props.ordering, raised = props.raised, selectedId = props.selectedId, items = props.items; var isSpriteDrag = draggingType === _lib_drag_constants__WEBPACK_IMPORTED_MODULE_3__["default"].SPRITE; return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_sprite_selector_css__WEBPACK_IMPORTED_MODULE_9___default.a.scrollWrapper, _defineProperty({}, _sprite_selector_css__WEBPACK_IMPORTED_MODULE_9___default.a.scrollWrapperDragging, draggingType === _lib_drag_constants__WEBPACK_IMPORTED_MODULE_3__["default"].BACKPACK_SPRITE)), componentRef: containerRef }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: _sprite_selector_css__WEBPACK_IMPORTED_MODULE_9___default.a.itemsWrapper }, items.map(function (sprite, index) { var _classNames3; // If the sprite has just received a block drop, used for green highlight var receivedBlocks = hoveredTarget.sprite === sprite.id && sprite.id !== editingTarget && hoveredTarget.receivedBlocks; // If the sprite is indicating it can receive block dropping, used for blue highlight var isRaised = !receivedBlocks && raised && sprite.id !== editingTarget; // A sprite is also raised if a costume or sound is being dragged. // Note the absence of the self-sharing check: a sprite can share assets with itself. // This is a quirk of 2.0, but seems worth leaving possible, it // allows quick (albeit unusual) duplication of assets. isRaised = isRaised || [_lib_drag_constants__WEBPACK_IMPORTED_MODULE_3__["default"].COSTUME, _lib_drag_constants__WEBPACK_IMPORTED_MODULE_3__["default"].SOUND, _lib_drag_constants__WEBPACK_IMPORTED_MODULE_3__["default"].BACKPACK_COSTUME, _lib_drag_constants__WEBPACK_IMPORTED_MODULE_3__["default"].BACKPACK_SOUND, _lib_drag_constants__WEBPACK_IMPORTED_MODULE_3__["default"].BACKPACK_CODE].includes(draggingType); return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_asset_panel_sortable_asset_jsx__WEBPACK_IMPORTED_MODULE_7__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_sprite_selector_css__WEBPACK_IMPORTED_MODULE_9___default.a.spriteWrapper, _defineProperty({}, _sprite_selector_css__WEBPACK_IMPORTED_MODULE_9___default.a.placeholder, isSpriteDrag && index === draggingIndex)), index: isSpriteDrag ? ordering.indexOf(index) : index, key: sprite.name, onAddSortable: onAddSortable, onRemoveSortable: onRemoveSortable }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(ThrottledSpriteSelectorItem, { asset: sprite.costume && sprite.costume.asset, className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_sprite_selector_css__WEBPACK_IMPORTED_MODULE_9___default.a.sprite, (_classNames3 = {}, _defineProperty(_classNames3, _sprite_selector_css__WEBPACK_IMPORTED_MODULE_9___default.a.raised, isRaised), _defineProperty(_classNames3, _sprite_selector_css__WEBPACK_IMPORTED_MODULE_9___default.a.receivedBlocks, receivedBlocks), _classNames3)), dragPayload: sprite.id, dragType: _lib_drag_constants__WEBPACK_IMPORTED_MODULE_3__["default"].SPRITE, id: sprite.id, index: index, key: sprite.id, name: sprite.name, selected: sprite.id === selectedId, onClick: onSelectSprite, onDeleteButtonClick: onDeleteSprite, onDuplicateButtonClick: onDuplicateSprite, onExportButtonClick: onExportSprite })); }))); }; SpriteList.propTypes = { containerRef: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, draggingIndex: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number, draggingType: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.oneOf(Object.keys(_lib_drag_constants__WEBPACK_IMPORTED_MODULE_3__["default"])), editingTarget: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, hoveredTarget: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({ hoveredSprite: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, receivedBlocks: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool }), items: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({ costume: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({ url: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, name: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string.isRequired, bitmapResolution: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number.isRequired, rotationCenterX: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number.isRequired, rotationCenterY: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number.isRequired }), name: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string.isRequired, order: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number.isRequired })), onAddSortable: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onDeleteSprite: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onDuplicateSprite: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onExportSprite: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onRemoveSortable: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onSelectSprite: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, ordering: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number), raised: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, selectedId: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string }; /* harmony default export */ __webpack_exports__["default"] = (Object(_lib_sortable_hoc_jsx__WEBPACK_IMPORTED_MODULE_6__["default"])(SpriteList)); /***/ }), /***/ "./src/components/sprite-selector/sprite-selector.css": /*!************************************************************!*\ !*** ./src/components/sprite-selector/sprite-selector.css ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./sprite-selector.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/sprite-selector/sprite-selector.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/sprite-selector/sprite-selector.jsx": /*!************************************************************!*\ !*** ./src/components/sprite-selector/sprite-selector.jsx ***! \************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _containers_sprite_info_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../containers/sprite-info.jsx */ "./src/containers/sprite-info.jsx"); /* harmony import */ var _sprite_list_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./sprite-list.jsx */ "./src/components/sprite-selector/sprite-list.jsx"); /* harmony import */ var _action_menu_action_menu_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../action-menu/action-menu.jsx */ "./src/components/action-menu/action-menu.jsx"); /* harmony import */ var _lib_layout_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../lib/layout-constants */ "./src/lib/layout-constants.js"); /* harmony import */ var scratch_l10n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! scratch-l10n */ "./node_modules/scratch-l10n/src/index.js"); /* harmony import */ var _sprite_selector_css__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./sprite-selector.css */ "./src/components/sprite-selector/sprite-selector.css"); /* harmony import */ var _sprite_selector_css__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_sprite_selector_css__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _action_menu_icon_file_upload_svg__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../action-menu/icon--file-upload.svg */ "./src/components/action-menu/icon--file-upload.svg"); /* harmony import */ var _action_menu_icon_file_upload_svg__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_action_menu_icon_file_upload_svg__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _action_menu_icon_paint_svg__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../action-menu/icon--paint.svg */ "./src/components/action-menu/icon--paint.svg"); /* harmony import */ var _action_menu_icon_paint_svg__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_action_menu_icon_paint_svg__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _action_menu_icon_sprite_svg__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../action-menu/icon--sprite.svg */ "./src/components/action-menu/icon--sprite.svg"); /* harmony import */ var _action_menu_icon_sprite_svg__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_action_menu_icon_sprite_svg__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var _action_menu_icon_surprise_svg__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../action-menu/icon--surprise.svg */ "./src/components/action-menu/icon--surprise.svg"); /* harmony import */ var _action_menu_icon_surprise_svg__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_action_menu_icon_surprise_svg__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var _action_menu_icon_search_svg__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../action-menu/icon--search.svg */ "./src/components/action-menu/icon--search.svg"); /* harmony import */ var _action_menu_icon_search_svg__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_action_menu_icon_search_svg__WEBPACK_IMPORTED_MODULE_14__); function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_2__["defineMessages"])({ addSpriteFromLibrary: { "id": "gui.spriteSelector.addSpriteFromLibrary", "defaultMessage": "Choose a Sprite" }, addSpriteFromPaint: { "id": "gui.spriteSelector.addSpriteFromPaint", "defaultMessage": "Paint" }, addSpriteFromSurprise: { "id": "gui.spriteSelector.addSpriteFromSurprise", "defaultMessage": "Surprise" }, addSpriteFromFile: { "id": "gui.spriteSelector.addSpriteFromFile", "defaultMessage": "Upload Sprite" } }); var SpriteSelectorComponent = function SpriteSelectorComponent(props) { var editingTarget = props.editingTarget, hoveredTarget = props.hoveredTarget, intl = props.intl, onChangeSpriteDirection = props.onChangeSpriteDirection, onChangeSpriteName = props.onChangeSpriteName, onChangeSpriteRotationStyle = props.onChangeSpriteRotationStyle, onChangeSpriteSize = props.onChangeSpriteSize, onChangeSpriteVisibility = props.onChangeSpriteVisibility, onChangeSpriteX = props.onChangeSpriteX, onChangeSpriteY = props.onChangeSpriteY, onDrop = props.onDrop, onDeleteSprite = props.onDeleteSprite, onDuplicateSprite = props.onDuplicateSprite, onExportSprite = props.onExportSprite, onFileUploadClick = props.onFileUploadClick, onNewSpriteClick = props.onNewSpriteClick, onPaintSpriteClick = props.onPaintSpriteClick, onSelectSprite = props.onSelectSprite, onSpriteUpload = props.onSpriteUpload, onSurpriseSpriteClick = props.onSurpriseSpriteClick, raised = props.raised, selectedId = props.selectedId, spriteFileInput = props.spriteFileInput, sprites = props.sprites, stageSize = props.stageSize, componentProps = _objectWithoutProperties(props, ["editingTarget", "hoveredTarget", "intl", "onChangeSpriteDirection", "onChangeSpriteName", "onChangeSpriteRotationStyle", "onChangeSpriteSize", "onChangeSpriteVisibility", "onChangeSpriteX", "onChangeSpriteY", "onDrop", "onDeleteSprite", "onDuplicateSprite", "onExportSprite", "onFileUploadClick", "onNewSpriteClick", "onPaintSpriteClick", "onSelectSprite", "onSpriteUpload", "onSurpriseSpriteClick", "raised", "selectedId", "spriteFileInput", "sprites", "stageSize"]); var selectedSprite = sprites[selectedId]; var spriteInfoDisabled = false; if (typeof selectedSprite === 'undefined') { selectedSprite = {}; spriteInfoDisabled = true; } return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], _extends({ className: _sprite_selector_css__WEBPACK_IMPORTED_MODULE_9___default.a.spriteSelector }, componentProps), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_containers_sprite_info_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { direction: selectedSprite.direction, disabled: spriteInfoDisabled, name: selectedSprite.name, rotationStyle: selectedSprite.rotationStyle, size: selectedSprite.size, stageSize: stageSize, visible: selectedSprite.visible, x: selectedSprite.x, y: selectedSprite.y, onChangeDirection: onChangeSpriteDirection, onChangeName: onChangeSpriteName, onChangeRotationStyle: onChangeSpriteRotationStyle, onChangeSize: onChangeSpriteSize, onChangeVisibility: onChangeSpriteVisibility, onChangeX: onChangeSpriteX, onChangeY: onChangeSpriteY }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_sprite_list_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { editingTarget: editingTarget, hoveredTarget: hoveredTarget, items: Object.keys(sprites).map(function (id) { return sprites[id]; }), raised: raised, selectedId: selectedId, onDeleteSprite: onDeleteSprite, onDrop: onDrop, onDuplicateSprite: onDuplicateSprite, onExportSprite: onExportSprite, onSelectSprite: onSelectSprite }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_action_menu_action_menu_jsx__WEBPACK_IMPORTED_MODULE_6__["default"], { className: _sprite_selector_css__WEBPACK_IMPORTED_MODULE_9___default.a.addButton, img: _action_menu_icon_sprite_svg__WEBPACK_IMPORTED_MODULE_12___default.a, moreButtons: [{ title: intl.formatMessage(messages.addSpriteFromFile), img: _action_menu_icon_file_upload_svg__WEBPACK_IMPORTED_MODULE_10___default.a, onClick: onFileUploadClick, fileAccept: '.svg, .png, .jpg, .jpeg, .sprite2, .sprite3, .gif', fileChange: onSpriteUpload, fileInput: spriteFileInput, fileMultiple: true }, { title: intl.formatMessage(messages.addSpriteFromSurprise), img: _action_menu_icon_surprise_svg__WEBPACK_IMPORTED_MODULE_13___default.a, onClick: onSurpriseSpriteClick // TODO need real function for this }, { title: intl.formatMessage(messages.addSpriteFromPaint), img: _action_menu_icon_paint_svg__WEBPACK_IMPORTED_MODULE_11___default.a, onClick: onPaintSpriteClick // TODO need real function for this }, { title: intl.formatMessage(messages.addSpriteFromLibrary), img: _action_menu_icon_search_svg__WEBPACK_IMPORTED_MODULE_14___default.a, onClick: onNewSpriteClick }], title: intl.formatMessage(messages.addSpriteFromLibrary), tooltipPlace: Object(scratch_l10n__WEBPACK_IMPORTED_MODULE_8__["isRtl"])(intl.locale) ? 'right' : 'left', onClick: onNewSpriteClick })); }; SpriteSelectorComponent.propTypes = { editingTarget: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, hoveredTarget: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({ hoveredSprite: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, receivedBlocks: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool }), intl: react_intl__WEBPACK_IMPORTED_MODULE_2__["intlShape"].isRequired, onChangeSpriteDirection: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onChangeSpriteName: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onChangeSpriteRotationStyle: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onChangeSpriteSize: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onChangeSpriteVisibility: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onChangeSpriteX: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onChangeSpriteY: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onDeleteSprite: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onDrop: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onDuplicateSprite: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onExportSprite: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onFileUploadClick: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onNewSpriteClick: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onPaintSpriteClick: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onSelectSprite: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onSpriteUpload: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onSurpriseSpriteClick: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, raised: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, selectedId: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, spriteFileInput: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, sprites: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({ id: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({ costume: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({ url: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, name: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string.isRequired, bitmapResolution: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number.isRequired, rotationCenterX: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number.isRequired, rotationCenterY: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number.isRequired }), name: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string.isRequired, order: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number.isRequired }) }), stageSize: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.oneOf(Object.keys(_lib_layout_constants__WEBPACK_IMPORTED_MODULE_7__["STAGE_DISPLAY_SIZES"])).isRequired }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_2__["injectIntl"])(SpriteSelectorComponent)); /***/ }), /***/ "./src/components/stage-header/icon--fullscreen.svg": /*!**********************************************************!*\ !*** ./src/components/stage-header/icon--fullscreen.svg ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/422b48c2206d5240a6717c92496ba21a.svg"; /***/ }), /***/ "./src/components/stage-header/icon--large-stage.svg": /*!***********************************************************!*\ !*** ./src/components/stage-header/icon--large-stage.svg ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/51d228f5f5d5e42a252cc88210fd0cd2.svg"; /***/ }), /***/ "./src/components/stage-header/icon--small-stage.svg": /*!***********************************************************!*\ !*** ./src/components/stage-header/icon--small-stage.svg ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/a246880e69bc7a2a793c90a2fb013ae1.svg"; /***/ }), /***/ "./src/components/stage-header/icon--unfullscreen.svg": /*!************************************************************!*\ !*** ./src/components/stage-header/icon--unfullscreen.svg ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/dd55f4c6c20f5d25e520b6f5bfb090c5.svg"; /***/ }), /***/ "./src/components/stage-header/stage-header.css": /*!******************************************************!*\ !*** ./src/components/stage-header/stage-header.css ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./stage-header.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/stage-header/stage-header.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/stage-header/stage-header.jsx": /*!******************************************************!*\ !*** ./src/components/stage-header/stage-header.jsx ***! \******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! scratch-vm */ "./node_modules/scratch-vm/src/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(scratch_vm__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _button_button_jsx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../button/button.jsx */ "./src/components/button/button.jsx"); /* harmony import */ var _containers_controls_jsx__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../containers/controls.jsx */ "./src/containers/controls.jsx"); /* harmony import */ var _lib_screen_utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../lib/screen-utils */ "./src/lib/screen-utils.js"); /* harmony import */ var _lib_layout_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../lib/layout-constants */ "./src/lib/layout-constants.js"); /* harmony import */ var _icon_fullscreen_svg__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./icon--fullscreen.svg */ "./src/components/stage-header/icon--fullscreen.svg"); /* harmony import */ var _icon_fullscreen_svg__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_icon_fullscreen_svg__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _icon_large_stage_svg__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./icon--large-stage.svg */ "./src/components/stage-header/icon--large-stage.svg"); /* harmony import */ var _icon_large_stage_svg__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_icon_large_stage_svg__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var _icon_small_stage_svg__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./icon--small-stage.svg */ "./src/components/stage-header/icon--small-stage.svg"); /* harmony import */ var _icon_small_stage_svg__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_icon_small_stage_svg__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var _icon_unfullscreen_svg__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./icon--unfullscreen.svg */ "./src/components/stage-header/icon--unfullscreen.svg"); /* harmony import */ var _icon_unfullscreen_svg__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_icon_unfullscreen_svg__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var _menu_bar_scratch_logo_svg__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../menu-bar/scratch-logo.svg */ "./src/components/menu-bar/scratch-logo.svg"); /* harmony import */ var _menu_bar_scratch_logo_svg__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_menu_bar_scratch_logo_svg__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var _stage_header_css__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./stage-header.css */ "./src/components/stage-header/stage-header.css"); /* harmony import */ var _stage_header_css__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(_stage_header_css__WEBPACK_IMPORTED_MODULE_16__); var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_1__["defineMessages"])({ largeStageSizeMessage: { "id": "gui.stageHeader.stageSizeLarge", "defaultMessage": "Switch to large stage" }, smallStageSizeMessage: { "id": "gui.stageHeader.stageSizeSmall", "defaultMessage": "Switch to small stage" }, fullStageSizeMessage: { "id": "gui.stageHeader.stageSizeFull", "defaultMessage": "Enter full screen mode" }, unFullStageSizeMessage: { "id": "gui.stageHeader.stageSizeUnFull", "defaultMessage": "Exit full screen mode" }, fullscreenControl: { "id": "gui.stageHeader.fullscreenControl", "defaultMessage": "Full Screen Control" } }); var StageHeaderComponent = function StageHeaderComponent(props) { var isFullScreen = props.isFullScreen, isPlayerOnly = props.isPlayerOnly, onKeyPress = props.onKeyPress, onSetStageLarge = props.onSetStageLarge, onSetStageSmall = props.onSetStageSmall, onSetStageFull = props.onSetStageFull, onSetStageUnFull = props.onSetStageUnFull, showBranding = props.showBranding, stageSizeMode = props.stageSizeMode, vm = props.vm; var header = null; if (isFullScreen) { var stageDimensions = Object(_lib_screen_utils__WEBPACK_IMPORTED_MODULE_9__["getStageDimensions"])(null, true); var stageButton = showBranding ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", { className: _stage_header_css__WEBPACK_IMPORTED_MODULE_16___default.a.embedScratchLogo }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("a", { href: "https://scratch.mit.edu", rel: "noopener noreferrer", target: "_blank" }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("img", { alt: "Scratch", src: _menu_bar_scratch_logo_svg__WEBPACK_IMPORTED_MODULE_15___default.a }))) : react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_button_button_jsx__WEBPACK_IMPORTED_MODULE_7__["default"], { className: _stage_header_css__WEBPACK_IMPORTED_MODULE_16___default.a.stageButton, onClick: onSetStageUnFull, onKeyPress: onKeyPress }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("img", { alt: props.intl.formatMessage(messages.unFullStageSizeMessage), className: _stage_header_css__WEBPACK_IMPORTED_MODULE_16___default.a.stageButtonIcon, draggable: false, src: _icon_unfullscreen_svg__WEBPACK_IMPORTED_MODULE_14___default.a, title: props.intl.formatMessage(messages.fullscreenControl) })); header = react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_6__["default"], { className: _stage_header_css__WEBPACK_IMPORTED_MODULE_16___default.a.stageHeaderWrapperOverlay }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_6__["default"], { className: _stage_header_css__WEBPACK_IMPORTED_MODULE_16___default.a.stageMenuWrapper, style: { width: stageDimensions.width } }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_containers_controls_jsx__WEBPACK_IMPORTED_MODULE_8__["default"], { vm: vm }), stageButton)); } else { var stageControls = isPlayerOnly ? [] : react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", { className: _stage_header_css__WEBPACK_IMPORTED_MODULE_16___default.a.stageSizeToggleGroup }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_button_button_jsx__WEBPACK_IMPORTED_MODULE_7__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_stage_header_css__WEBPACK_IMPORTED_MODULE_16___default.a.stageButton, _stage_header_css__WEBPACK_IMPORTED_MODULE_16___default.a.stageButtonFirst, stageSizeMode === _lib_layout_constants__WEBPACK_IMPORTED_MODULE_10__["STAGE_SIZE_MODES"].small ? null : _stage_header_css__WEBPACK_IMPORTED_MODULE_16___default.a.stageButtonToggledOff), onClick: onSetStageSmall }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("img", { alt: props.intl.formatMessage(messages.smallStageSizeMessage), className: _stage_header_css__WEBPACK_IMPORTED_MODULE_16___default.a.stageButtonIcon, draggable: false, src: _icon_small_stage_svg__WEBPACK_IMPORTED_MODULE_13___default.a }))), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_button_button_jsx__WEBPACK_IMPORTED_MODULE_7__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_stage_header_css__WEBPACK_IMPORTED_MODULE_16___default.a.stageButton, _stage_header_css__WEBPACK_IMPORTED_MODULE_16___default.a.stageButtonLast, stageSizeMode === _lib_layout_constants__WEBPACK_IMPORTED_MODULE_10__["STAGE_SIZE_MODES"].large ? null : _stage_header_css__WEBPACK_IMPORTED_MODULE_16___default.a.stageButtonToggledOff), onClick: onSetStageLarge }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("img", { alt: props.intl.formatMessage(messages.largeStageSizeMessage), className: _stage_header_css__WEBPACK_IMPORTED_MODULE_16___default.a.stageButtonIcon, draggable: false, src: _icon_large_stage_svg__WEBPACK_IMPORTED_MODULE_12___default.a })))); header = react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_6__["default"], { className: _stage_header_css__WEBPACK_IMPORTED_MODULE_16___default.a.stageHeaderWrapper }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_6__["default"], { className: _stage_header_css__WEBPACK_IMPORTED_MODULE_16___default.a.stageMenuWrapper }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_containers_controls_jsx__WEBPACK_IMPORTED_MODULE_8__["default"], { vm: vm }), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", { className: _stage_header_css__WEBPACK_IMPORTED_MODULE_16___default.a.stageSizeRow }, stageControls, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_button_button_jsx__WEBPACK_IMPORTED_MODULE_7__["default"], { className: _stage_header_css__WEBPACK_IMPORTED_MODULE_16___default.a.stageButton, onClick: onSetStageFull }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("img", { alt: props.intl.formatMessage(messages.fullStageSizeMessage), className: _stage_header_css__WEBPACK_IMPORTED_MODULE_16___default.a.stageButtonIcon, draggable: false, src: _icon_fullscreen_svg__WEBPACK_IMPORTED_MODULE_11___default.a, title: props.intl.formatMessage(messages.fullscreenControl) })))))); } return header; }; var mapStateToProps = function mapStateToProps(state) { return { // This is the button's mode, as opposed to the actual current state stageSizeMode: state.scratchGui.stageSize.stageSize }; }; StageHeaderComponent.propTypes = { intl: react_intl__WEBPACK_IMPORTED_MODULE_1__["intlShape"], isFullScreen: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool.isRequired, isPlayerOnly: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool.isRequired, onKeyPress: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func.isRequired, onSetStageFull: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func.isRequired, onSetStageLarge: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func.isRequired, onSetStageSmall: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func.isRequired, onSetStageUnFull: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func.isRequired, showBranding: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool.isRequired, stageSizeMode: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOf(Object.keys(_lib_layout_constants__WEBPACK_IMPORTED_MODULE_10__["STAGE_SIZE_MODES"])), vm: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.instanceOf(scratch_vm__WEBPACK_IMPORTED_MODULE_5___default.a).isRequired }; StageHeaderComponent.defaultProps = { stageSizeMode: _lib_layout_constants__WEBPACK_IMPORTED_MODULE_10__["STAGE_SIZE_MODES"].large }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_1__["injectIntl"])(Object(react_redux__WEBPACK_IMPORTED_MODULE_4__["connect"])(mapStateToProps)(StageHeaderComponent))); /***/ }), /***/ "./src/components/stage-selector/stage-selector.css": /*!**********************************************************!*\ !*** ./src/components/stage-selector/stage-selector.css ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./stage-selector.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/stage-selector/stage-selector.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/stage-selector/stage-selector.jsx": /*!**********************************************************!*\ !*** ./src/components/stage-selector/stage-selector.jsx ***! \**********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _action_menu_action_menu_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../action-menu/action-menu.jsx */ "./src/components/action-menu/action-menu.jsx"); /* harmony import */ var _stage_selector_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./stage-selector.css */ "./src/components/stage-selector/stage-selector.css"); /* harmony import */ var _stage_selector_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_stage_selector_css__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var scratch_l10n__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! scratch-l10n */ "./node_modules/scratch-l10n/src/index.js"); /* harmony import */ var _action_menu_icon_backdrop_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../action-menu/icon--backdrop.svg */ "./src/components/action-menu/icon--backdrop.svg"); /* harmony import */ var _action_menu_icon_backdrop_svg__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_action_menu_icon_backdrop_svg__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _action_menu_icon_file_upload_svg__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../action-menu/icon--file-upload.svg */ "./src/components/action-menu/icon--file-upload.svg"); /* harmony import */ var _action_menu_icon_file_upload_svg__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_action_menu_icon_file_upload_svg__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _action_menu_icon_paint_svg__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../action-menu/icon--paint.svg */ "./src/components/action-menu/icon--paint.svg"); /* harmony import */ var _action_menu_icon_paint_svg__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_action_menu_icon_paint_svg__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _action_menu_icon_surprise_svg__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../action-menu/icon--surprise.svg */ "./src/components/action-menu/icon--surprise.svg"); /* harmony import */ var _action_menu_icon_surprise_svg__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_action_menu_icon_surprise_svg__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _action_menu_icon_search_svg__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../action-menu/icon--search.svg */ "./src/components/action-menu/icon--search.svg"); /* harmony import */ var _action_menu_icon_search_svg__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_action_menu_icon_search_svg__WEBPACK_IMPORTED_MODULE_12__); function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_3__["defineMessages"])({ addBackdropFromLibrary: { "id": "gui.spriteSelector.addBackdropFromLibrary", "defaultMessage": "Choose a Backdrop" }, addBackdropFromPaint: { "id": "gui.stageSelector.addBackdropFromPaint", "defaultMessage": "Paint" }, addBackdropFromSurprise: { "id": "gui.stageSelector.addBackdropFromSurprise", "defaultMessage": "Surprise" }, addBackdropFromFile: { "id": "gui.stageSelector.addBackdropFromFile", "defaultMessage": "Upload Backdrop" } }); var StageSelector = function StageSelector(props) { var _classNames; var backdropCount = props.backdropCount, containerRef = props.containerRef, dragOver = props.dragOver, fileInputRef = props.fileInputRef, intl = props.intl, selected = props.selected, raised = props.raised, receivedBlocks = props.receivedBlocks, url = props.url, onBackdropFileUploadClick = props.onBackdropFileUploadClick, onBackdropFileUpload = props.onBackdropFileUpload, onClick = props.onClick, onMouseEnter = props.onMouseEnter, onMouseLeave = props.onMouseLeave, onNewBackdropClick = props.onNewBackdropClick, onSurpriseBackdropClick = props.onSurpriseBackdropClick, onEmptyBackdropClick = props.onEmptyBackdropClick, componentProps = _objectWithoutProperties(props, ["backdropCount", "containerRef", "dragOver", "fileInputRef", "intl", "selected", "raised", "receivedBlocks", "url", "onBackdropFileUploadClick", "onBackdropFileUpload", "onClick", "onMouseEnter", "onMouseLeave", "onNewBackdropClick", "onSurpriseBackdropClick", "onEmptyBackdropClick"]); return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], _extends({ className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_stage_selector_css__WEBPACK_IMPORTED_MODULE_6___default.a.stageSelector, (_classNames = {}, _defineProperty(_classNames, _stage_selector_css__WEBPACK_IMPORTED_MODULE_6___default.a.isSelected, selected), _defineProperty(_classNames, _stage_selector_css__WEBPACK_IMPORTED_MODULE_6___default.a.raised, raised || dragOver), _defineProperty(_classNames, _stage_selector_css__WEBPACK_IMPORTED_MODULE_6___default.a.receivedBlocks, receivedBlocks), _classNames)), componentRef: containerRef, onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave }, componentProps), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _stage_selector_css__WEBPACK_IMPORTED_MODULE_6___default.a.header }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _stage_selector_css__WEBPACK_IMPORTED_MODULE_6___default.a.headerTitle }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "Stage", id: "gui.stageSelector.stage" }))), url ? react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("img", { className: _stage_selector_css__WEBPACK_IMPORTED_MODULE_6___default.a.costumeCanvas, src: url }) : null, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _stage_selector_css__WEBPACK_IMPORTED_MODULE_6___default.a.label }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], { defaultMessage: "Backdrops", id: "gui.stageSelector.backdrops" })), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { className: _stage_selector_css__WEBPACK_IMPORTED_MODULE_6___default.a.count }, backdropCount), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_action_menu_action_menu_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { className: _stage_selector_css__WEBPACK_IMPORTED_MODULE_6___default.a.addButton, img: _action_menu_icon_backdrop_svg__WEBPACK_IMPORTED_MODULE_8___default.a, moreButtons: [{ title: intl.formatMessage(messages.addBackdropFromFile), img: _action_menu_icon_file_upload_svg__WEBPACK_IMPORTED_MODULE_9___default.a, onClick: onBackdropFileUploadClick, fileAccept: '.svg, .png, .jpg, .jpeg, .gif', fileChange: onBackdropFileUpload, fileInput: fileInputRef, fileMultiple: true }, { title: intl.formatMessage(messages.addBackdropFromSurprise), img: _action_menu_icon_surprise_svg__WEBPACK_IMPORTED_MODULE_11___default.a, onClick: onSurpriseBackdropClick }, { title: intl.formatMessage(messages.addBackdropFromPaint), img: _action_menu_icon_paint_svg__WEBPACK_IMPORTED_MODULE_10___default.a, onClick: onEmptyBackdropClick }, { title: intl.formatMessage(messages.addBackdropFromLibrary), img: _action_menu_icon_search_svg__WEBPACK_IMPORTED_MODULE_12___default.a, onClick: onNewBackdropClick }], title: intl.formatMessage(messages.addBackdropFromLibrary), tooltipPlace: Object(scratch_l10n__WEBPACK_IMPORTED_MODULE_7__["isRtl"])(intl.locale) ? 'right' : 'left', onClick: onNewBackdropClick })); }; StageSelector.propTypes = { backdropCount: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number.isRequired, containerRef: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, dragOver: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, fileInputRef: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, intl: react_intl__WEBPACK_IMPORTED_MODULE_3__["intlShape"].isRequired, onBackdropFileUpload: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onBackdropFileUploadClick: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onClick: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onEmptyBackdropClick: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onMouseEnter: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onMouseLeave: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onNewBackdropClick: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onSurpriseBackdropClick: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, raised: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool.isRequired, receivedBlocks: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool.isRequired, selected: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool.isRequired, url: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_3__["injectIntl"])(StageSelector)); /***/ }), /***/ "./src/components/stage-wrapper/stage-wrapper.css": /*!********************************************************!*\ !*** ./src/components/stage-wrapper/stage-wrapper.css ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./stage-wrapper.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/stage-wrapper/stage-wrapper.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/stage-wrapper/stage-wrapper.jsx": /*!********************************************************!*\ !*** ./src/components/stage-wrapper/stage-wrapper.jsx ***! \********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! scratch-vm */ "./node_modules/scratch-vm/src/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(scratch_vm__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _lib_layout_constants_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../lib/layout-constants.js */ "./src/lib/layout-constants.js"); /* harmony import */ var _containers_stage_header_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../containers/stage-header.jsx */ "./src/containers/stage-header.jsx"); /* harmony import */ var _containers_stage_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../containers/stage.jsx */ "./src/containers/stage.jsx"); /* harmony import */ var _loader_loader_jsx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../loader/loader.jsx */ "./src/components/loader/loader.jsx"); /* harmony import */ var _stage_wrapper_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./stage-wrapper.css */ "./src/components/stage-wrapper/stage-wrapper.css"); /* harmony import */ var _stage_wrapper_css__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_stage_wrapper_css__WEBPACK_IMPORTED_MODULE_8__); var StageWrapperComponent = function StageWrapperComponent(props) { var isFullScreen = props.isFullScreen, isRtl = props.isRtl, isRendererSupported = props.isRendererSupported, loading = props.loading, stageSize = props.stageSize, vm = props.vm; return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _stage_wrapper_css__WEBPACK_IMPORTED_MODULE_8___default.a.stageWrapper, dir: isRtl ? 'rtl' : 'ltr' }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _stage_wrapper_css__WEBPACK_IMPORTED_MODULE_8___default.a.stageMenuWrapper }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_containers_stage_header_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { stageSize: stageSize, vm: vm })), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _stage_wrapper_css__WEBPACK_IMPORTED_MODULE_8___default.a.stageCanvasWrapper }, isRendererSupported ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_containers_stage_jsx__WEBPACK_IMPORTED_MODULE_6__["default"], { stageSize: stageSize, vm: vm }) : null), loading ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_loader_loader_jsx__WEBPACK_IMPORTED_MODULE_7__["default"], { isFullScreen: isFullScreen }) : null); }; StageWrapperComponent.propTypes = { isFullScreen: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, isRendererSupported: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool.isRequired, isRtl: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool.isRequired, loading: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, stageSize: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.oneOf(Object.keys(_lib_layout_constants_js__WEBPACK_IMPORTED_MODULE_4__["STAGE_DISPLAY_SIZES"])).isRequired, vm: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.instanceOf(scratch_vm__WEBPACK_IMPORTED_MODULE_2___default.a).isRequired }; /* harmony default export */ __webpack_exports__["default"] = (StageWrapperComponent); /***/ }), /***/ "./src/components/stage/stage.css": /*!****************************************!*\ !*** ./src/components/stage/stage.css ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./stage.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/stage/stage.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/stage/stage.jsx": /*!****************************************!*\ !*** ./src/components/stage/stage.jsx ***! \****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _containers_dom_element_renderer_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../containers/dom-element-renderer.jsx */ "./src/containers/dom-element-renderer.jsx"); /* harmony import */ var _loupe_loupe_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../loupe/loupe.jsx */ "./src/components/loupe/loupe.jsx"); /* harmony import */ var _containers_monitor_list_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../containers/monitor-list.jsx */ "./src/containers/monitor-list.jsx"); /* harmony import */ var _containers_target_highlight_jsx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../containers/target-highlight.jsx */ "./src/containers/target-highlight.jsx"); /* harmony import */ var _containers_green_flag_overlay_jsx__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../containers/green-flag-overlay.jsx */ "./src/containers/green-flag-overlay.jsx"); /* harmony import */ var _containers_question_jsx__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../containers/question.jsx */ "./src/containers/question.jsx"); /* harmony import */ var _mic_indicator_mic_indicator_jsx__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../mic-indicator/mic-indicator.jsx */ "./src/components/mic-indicator/mic-indicator.jsx"); /* harmony import */ var _lib_layout_constants_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../lib/layout-constants.js */ "./src/lib/layout-constants.js"); /* harmony import */ var _lib_screen_utils_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../lib/screen-utils.js */ "./src/lib/screen-utils.js"); /* harmony import */ var _stage_css__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./stage.css */ "./src/components/stage/stage.css"); /* harmony import */ var _stage_css__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_stage_css__WEBPACK_IMPORTED_MODULE_13__); function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } var StageComponent = function StageComponent(props) { var _classNames; var canvas = props.canvas, dragRef = props.dragRef, isColorPicking = props.isColorPicking, isFullScreen = props.isFullScreen, isStarted = props.isStarted, colorInfo = props.colorInfo, micIndicator = props.micIndicator, question = props.question, stageSize = props.stageSize, useEditorDragStyle = props.useEditorDragStyle, onDeactivateColorPicker = props.onDeactivateColorPicker, onDoubleClick = props.onDoubleClick, onQuestionAnswered = props.onQuestionAnswered, boxProps = _objectWithoutProperties(props, ["canvas", "dragRef", "isColorPicking", "isFullScreen", "isStarted", "colorInfo", "micIndicator", "question", "stageSize", "useEditorDragStyle", "onDeactivateColorPicker", "onDoubleClick", "onQuestionAnswered"]); var stageDimensions = Object(_lib_screen_utils_js__WEBPACK_IMPORTED_MODULE_12__["getStageDimensions"])(stageSize, isFullScreen); return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()((_classNames = {}, _defineProperty(_classNames, _stage_css__WEBPACK_IMPORTED_MODULE_13___default.a.stageWrapper, !isFullScreen), _defineProperty(_classNames, _stage_css__WEBPACK_IMPORTED_MODULE_13___default.a.stageWrapperOverlay, isFullScreen), _defineProperty(_classNames, _stage_css__WEBPACK_IMPORTED_MODULE_13___default.a.withColorPicker, !isFullScreen && isColorPicking), _classNames)), style: { minHeight: stageDimensions.height, minWidth: stageDimensions.width }, onDoubleClick: onDoubleClick }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_stage_css__WEBPACK_IMPORTED_MODULE_13___default.a.stage, _defineProperty({}, _stage_css__WEBPACK_IMPORTED_MODULE_13___default.a.stageOverlayContent, isFullScreen)), style: { height: stageDimensions.height, width: stageDimensions.width } }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_containers_dom_element_renderer_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], _extends({ domElement: canvas, style: { height: stageDimensions.height, width: stageDimensions.width } }, boxProps))), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _stage_css__WEBPACK_IMPORTED_MODULE_13___default.a.monitorWrapper }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_containers_monitor_list_jsx__WEBPACK_IMPORTED_MODULE_6__["default"], { draggable: useEditorDragStyle, stageSize: stageDimensions })), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _stage_css__WEBPACK_IMPORTED_MODULE_13___default.a.frameWrapper }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_containers_target_highlight_jsx__WEBPACK_IMPORTED_MODULE_7__["default"], { className: _stage_css__WEBPACK_IMPORTED_MODULE_13___default.a.frame, stageHeight: stageDimensions.height, stageWidth: stageDimensions.width })), isStarted ? null : react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_containers_green_flag_overlay_jsx__WEBPACK_IMPORTED_MODULE_8__["default"], { className: _stage_css__WEBPACK_IMPORTED_MODULE_13___default.a.greenFlagOverlay, wrapperClass: _stage_css__WEBPACK_IMPORTED_MODULE_13___default.a.greenFlagOverlayWrapper }), isColorPicking && colorInfo ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _stage_css__WEBPACK_IMPORTED_MODULE_13___default.a.colorPickerWrapper }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_loupe_loupe_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { colorInfo: colorInfo })) : null, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _stage_css__WEBPACK_IMPORTED_MODULE_13___default.a.stageBottomWrapper, style: { width: stageDimensions.width, height: stageDimensions.height, left: '50%', marginLeft: stageDimensions.width * -0.5 } }, micIndicator ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_mic_indicator_mic_indicator_jsx__WEBPACK_IMPORTED_MODULE_10__["default"], { className: _stage_css__WEBPACK_IMPORTED_MODULE_13___default.a.micIndicator, stageSize: stageDimensions }) : null, question === null ? null : react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _stage_css__WEBPACK_IMPORTED_MODULE_13___default.a.questionWrapper, style: { width: stageDimensions.width } }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_containers_question_jsx__WEBPACK_IMPORTED_MODULE_9__["default"], { question: question, onQuestionAnswered: onQuestionAnswered }))), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("canvas", { className: _stage_css__WEBPACK_IMPORTED_MODULE_13___default.a.draggingSprite, height: 0, ref: dragRef, width: 0 })), isColorPicking ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _stage_css__WEBPACK_IMPORTED_MODULE_13___default.a.colorPickerBackground, onClick: onDeactivateColorPicker }) : null); }; StageComponent.propTypes = { canvas: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.instanceOf(Element).isRequired, colorInfo: _loupe_loupe_jsx__WEBPACK_IMPORTED_MODULE_5__["default"].propTypes.colorInfo, dragRef: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, isColorPicking: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, isFullScreen: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool.isRequired, isStarted: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, micIndicator: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, onDeactivateColorPicker: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onDoubleClick: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onQuestionAnswered: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, question: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, stageSize: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.oneOf(Object.keys(_lib_layout_constants_js__WEBPACK_IMPORTED_MODULE_11__["STAGE_DISPLAY_SIZES"])).isRequired, useEditorDragStyle: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool }; StageComponent.defaultProps = { dragRef: function dragRef() {} }; /* harmony default export */ __webpack_exports__["default"] = (StageComponent); /***/ }), /***/ "./src/components/stop-all/icon--stop-all.svg": /*!****************************************************!*\ !*** ./src/components/stop-all/icon--stop-all.svg ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/36fcc7dbca20720abcab01e49d4955f9.svg"; /***/ }), /***/ "./src/components/stop-all/stop-all.css": /*!**********************************************!*\ !*** ./src/components/stop-all/stop-all.css ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./stop-all.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/stop-all/stop-all.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/stop-all/stop-all.jsx": /*!**********************************************!*\ !*** ./src/components/stop-all/stop-all.jsx ***! \**********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _icon_stop_all_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./icon--stop-all.svg */ "./src/components/stop-all/icon--stop-all.svg"); /* harmony import */ var _icon_stop_all_svg__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_icon_stop_all_svg__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _stop_all_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./stop-all.css */ "./src/components/stop-all/stop-all.css"); /* harmony import */ var _stop_all_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_stop_all_css__WEBPACK_IMPORTED_MODULE_4__); function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } var StopAllComponent = function StopAllComponent(props) { var active = props.active, className = props.className, onClick = props.onClick, title = props.title, componentProps = _objectWithoutProperties(props, ["active", "className", "onClick", "title"]); return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("img", _extends({ className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(className, _stop_all_css__WEBPACK_IMPORTED_MODULE_4___default.a.stopAll, _defineProperty({}, _stop_all_css__WEBPACK_IMPORTED_MODULE_4___default.a.isActive, active)), draggable: false, src: _icon_stop_all_svg__WEBPACK_IMPORTED_MODULE_3___default.a, title: title, onClick: onClick }, componentProps)); }; StopAllComponent.propTypes = { active: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, className: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, onClick: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, title: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string }; StopAllComponent.defaultProps = { active: false, title: 'Stop' }; /* harmony default export */ __webpack_exports__["default"] = (StopAllComponent); /***/ }), /***/ "./src/components/tag-button/tag-button.css": /*!**************************************************!*\ !*** ./src/components/tag-button/tag-button.css ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./tag-button.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/tag-button/tag-button.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/tag-button/tag-button.jsx": /*!**************************************************!*\ !*** ./src/components/tag-button/tag-button.jsx ***! \**************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _button_button_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../button/button.jsx */ "./src/components/button/button.jsx"); /* harmony import */ var _tag_button_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./tag-button.css */ "./src/components/tag-button/tag-button.css"); /* harmony import */ var _tag_button_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_tag_button_css__WEBPACK_IMPORTED_MODULE_5__); function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } var TagButtonComponent = function TagButtonComponent(_ref) { var active = _ref.active, iconClassName = _ref.iconClassName, className = _ref.className, tag = _ref.tag, intlLabel = _ref.intlLabel, props = _objectWithoutProperties(_ref, ["active", "iconClassName", "className", "tag", "intlLabel"]); return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_button_button_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], _extends({ className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_tag_button_css__WEBPACK_IMPORTED_MODULE_5___default.a.tagButton, className, _defineProperty({}, _tag_button_css__WEBPACK_IMPORTED_MODULE_5___default.a.active, active)), iconClassName: classnames__WEBPACK_IMPORTED_MODULE_0___default()(_tag_button_css__WEBPACK_IMPORTED_MODULE_5___default.a.tagButtonIcon, iconClassName) }, props), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], intlLabel)); }; TagButtonComponent.propTypes = _objectSpread({}, _button_button_jsx__WEBPACK_IMPORTED_MODULE_4__["default"].propTypes, { active: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, intlLabel: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.shape({ defaultMessage: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, description: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, id: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string }).isRequired, tag: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string.isRequired }); TagButtonComponent.defaultProps = { active: false }; /* harmony default export */ __webpack_exports__["default"] = (TagButtonComponent); /***/ }), /***/ "./src/components/target-pane/target-pane.css": /*!****************************************************!*\ !*** ./src/components/target-pane/target-pane.css ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./target-pane.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/target-pane/target-pane.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/target-pane/target-pane.jsx": /*!****************************************************!*\ !*** ./src/components/target-pane/target-pane.jsx ***! \****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! scratch-vm */ "./node_modules/scratch-vm/src/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(scratch_vm__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _containers_sprite_library_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../containers/sprite-library.jsx */ "./src/containers/sprite-library.jsx"); /* harmony import */ var _sprite_selector_sprite_selector_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../sprite-selector/sprite-selector.jsx */ "./src/components/sprite-selector/sprite-selector.jsx"); /* harmony import */ var _containers_stage_selector_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../containers/stage-selector.jsx */ "./src/containers/stage-selector.jsx"); /* harmony import */ var _lib_layout_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../lib/layout-constants */ "./src/lib/layout-constants.js"); /* harmony import */ var _target_pane_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./target-pane.css */ "./src/components/target-pane/target-pane.css"); /* harmony import */ var _target_pane_css__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_target_pane_css__WEBPACK_IMPORTED_MODULE_7__); function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } /* * Pane that contains the sprite selector, sprite info, stage selector, * and the new sprite, costume and backdrop buttons * @param {object} props Props for the component * @returns {React.Component} rendered component */ var TargetPane = function TargetPane(_ref) { var editingTarget = _ref.editingTarget, fileInputRef = _ref.fileInputRef, hoveredTarget = _ref.hoveredTarget, spriteLibraryVisible = _ref.spriteLibraryVisible, onActivateBlocksTab = _ref.onActivateBlocksTab, onChangeSpriteDirection = _ref.onChangeSpriteDirection, onChangeSpriteName = _ref.onChangeSpriteName, onChangeSpriteRotationStyle = _ref.onChangeSpriteRotationStyle, onChangeSpriteSize = _ref.onChangeSpriteSize, onChangeSpriteVisibility = _ref.onChangeSpriteVisibility, onChangeSpriteX = _ref.onChangeSpriteX, onChangeSpriteY = _ref.onChangeSpriteY, onDeleteSprite = _ref.onDeleteSprite, onDrop = _ref.onDrop, onDuplicateSprite = _ref.onDuplicateSprite, onExportSprite = _ref.onExportSprite, onFileUploadClick = _ref.onFileUploadClick, onNewSpriteClick = _ref.onNewSpriteClick, onPaintSpriteClick = _ref.onPaintSpriteClick, onRequestCloseSpriteLibrary = _ref.onRequestCloseSpriteLibrary, onSelectSprite = _ref.onSelectSprite, onSpriteUpload = _ref.onSpriteUpload, onSurpriseSpriteClick = _ref.onSurpriseSpriteClick, raiseSprites = _ref.raiseSprites, stage = _ref.stage, stageSize = _ref.stageSize, sprites = _ref.sprites, vm = _ref.vm, componentProps = _objectWithoutProperties(_ref, ["editingTarget", "fileInputRef", "hoveredTarget", "spriteLibraryVisible", "onActivateBlocksTab", "onChangeSpriteDirection", "onChangeSpriteName", "onChangeSpriteRotationStyle", "onChangeSpriteSize", "onChangeSpriteVisibility", "onChangeSpriteX", "onChangeSpriteY", "onDeleteSprite", "onDrop", "onDuplicateSprite", "onExportSprite", "onFileUploadClick", "onNewSpriteClick", "onPaintSpriteClick", "onRequestCloseSpriteLibrary", "onSelectSprite", "onSpriteUpload", "onSurpriseSpriteClick", "raiseSprites", "stage", "stageSize", "sprites", "vm"]); return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", _extends({ className: _target_pane_css__WEBPACK_IMPORTED_MODULE_7___default.a.targetPane }, componentProps), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_sprite_selector_sprite_selector_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { editingTarget: editingTarget, hoveredTarget: hoveredTarget, raised: raiseSprites, selectedId: editingTarget, spriteFileInput: fileInputRef, sprites: sprites, stageSize: stageSize, onChangeSpriteDirection: onChangeSpriteDirection, onChangeSpriteName: onChangeSpriteName, onChangeSpriteRotationStyle: onChangeSpriteRotationStyle, onChangeSpriteSize: onChangeSpriteSize, onChangeSpriteVisibility: onChangeSpriteVisibility, onChangeSpriteX: onChangeSpriteX, onChangeSpriteY: onChangeSpriteY, onDeleteSprite: onDeleteSprite, onDrop: onDrop, onDuplicateSprite: onDuplicateSprite, onExportSprite: onExportSprite, onFileUploadClick: onFileUploadClick, onNewSpriteClick: onNewSpriteClick, onPaintSpriteClick: onPaintSpriteClick, onSelectSprite: onSelectSprite, onSpriteUpload: onSpriteUpload, onSurpriseSpriteClick: onSurpriseSpriteClick }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _target_pane_css__WEBPACK_IMPORTED_MODULE_7___default.a.stageSelectorWrapper }, stage.id && react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_containers_stage_selector_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { asset: stage.costume && stage.costume.asset, backdropCount: stage.costumeCount, id: stage.id, selected: stage.id === editingTarget, onSelect: onSelectSprite }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", null, spriteLibraryVisible ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_containers_sprite_library_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { vm: vm, onActivateBlocksTab: onActivateBlocksTab, onRequestClose: onRequestCloseSpriteLibrary }) : null))); }; var spriteShape = prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({ costume: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({ url: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, name: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string.isRequired, // The following are optional because costumes uploaded from disk // will not have these properties available bitmapResolution: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number, rotationCenterX: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number, rotationCenterY: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number }), direction: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number, id: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, name: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, order: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number, size: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number, visibility: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, x: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number, y: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number }); TargetPane.propTypes = { editingTarget: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, extensionLibraryVisible: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, fileInputRef: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, hoveredTarget: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({ hoveredSprite: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, receivedBlocks: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool }), onActivateBlocksTab: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onChangeSpriteDirection: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onChangeSpriteName: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onChangeSpriteRotationStyle: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onChangeSpriteSize: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onChangeSpriteVisibility: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onChangeSpriteX: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onChangeSpriteY: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onDeleteSprite: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onDrop: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onDuplicateSprite: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onExportSprite: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onFileUploadClick: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onNewSpriteClick: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onPaintSpriteClick: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onRequestCloseExtensionLibrary: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onRequestCloseSpriteLibrary: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onSelectSprite: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onSpriteUpload: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onSurpriseSpriteClick: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, raiseSprites: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, spriteLibraryVisible: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, sprites: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.objectOf(spriteShape), stage: spriteShape, stageSize: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.oneOf(Object.keys(_lib_layout_constants__WEBPACK_IMPORTED_MODULE_6__["STAGE_DISPLAY_SIZES"])).isRequired, vm: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.instanceOf(scratch_vm__WEBPACK_IMPORTED_MODULE_2___default.a) }; /* harmony default export */ __webpack_exports__["default"] = (TargetPane); /***/ }), /***/ "./src/components/telemetry-modal/telemetry-modal-header.png": /*!*******************************************************************!*\ !*** ./src/components/telemetry-modal/telemetry-modal-header.png ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/fb356e819d8ab210a241ce81b9bac33c.png"; /***/ }), /***/ "./src/components/telemetry-modal/telemetry-modal.css": /*!************************************************************!*\ !*** ./src/components/telemetry-modal/telemetry-modal.css ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./telemetry-modal.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/telemetry-modal/telemetry-modal.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/telemetry-modal/telemetry-modal.jsx": /*!************************************************************!*\ !*** ./src/components/telemetry-modal/telemetry-modal.jsx ***! \************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var react_modal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-modal */ "./node_modules/react-modal/lib/index.js"); /* harmony import */ var react_modal__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_modal__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _telemetry_modal_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./telemetry-modal.css */ "./src/components/telemetry-modal/telemetry-modal.css"); /* harmony import */ var _telemetry_modal_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_telemetry_modal_css__WEBPACK_IMPORTED_MODULE_6__); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_3__["defineMessages"])({ label: { "id": "gui.telemetryOptIn.label", "defaultMessage": "Report statistics to improve Scratch" }, bodyText1: { "id": "gui.telemetryOptIn.body1", "defaultMessage": "The Scratch Team is always looking to better understand how Scratch is used around the world. To help support this effort, you can allow Scratch to automatically send usage information to the Scratch Team." }, bodyText2: { "id": "gui.telemetryOptIn.body2", "defaultMessage": "The information we collect includes language selection, blocks usage, and some events like saving, loading, and uploading a project. We DO NOT collect any personal information. Please see our {privacyPolicyLink} for more information." }, privacyPolicyLink: { "id": "gui.telemetryOptIn.privacyPolicyLink", "defaultMessage": "Privacy Policy" }, noButton: { "id": "gui.telemetryOptIn.buttonTextNo", "defaultMessage": "No, thanks" }, noTooltip: { "id": "gui.telemetryOptIn.buttonTooltipNo", "defaultMessage": "Disable telemetry" }, yesButton: { "id": "gui.telemetryOptIn.buttonTextYes", "defaultMessage": "Yes, I'd like to help improve Scratch" }, yesTooltip: { "id": "gui.telemetryOptIn.buttonTooltipYes", "defaultMessage": "Enable telemetry" } }); var TelemetryModal = /*#__PURE__*/ function (_React$PureComponent) { _inherits(TelemetryModal, _React$PureComponent); function TelemetryModal(props) { var _this; _classCallCheck(this, TelemetryModal); _this = _possibleConstructorReturn(this, _getPrototypeOf(TelemetryModal).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['handleCancel', 'handleOptIn', 'handleOptOut']); return _this; } _createClass(TelemetryModal, [{ key: "handleCancel", value: function handleCancel() { this.props.onRequestClose(); if (this.props.onCancel) { this.props.onCancel(); } } }, { key: "handleOptIn", value: function handleOptIn() { this.props.onRequestClose(); if (this.props.onOptIn) { this.props.onOptIn(); } } }, { key: "handleOptOut", value: function handleOptOut() { this.props.onRequestClose(); if (this.props.onOptOut) { this.props.onOptOut(); } } }, { key: "render", value: function render() { return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_modal__WEBPACK_IMPORTED_MODULE_4___default.a, { isOpen: true, className: _telemetry_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.modalContent, contentLabel: this.props.intl.formatMessage(messages.label), overlayClassName: _telemetry_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.modalOverlay, onRequestClose: this.handleCancel }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { dir: this.props.isRtl ? 'rtl' : 'ltr' }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { className: _telemetry_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.illustration }), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { className: _telemetry_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.body }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("p", null, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], messages.bodyText1)), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("p", null, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], _extends({}, messages.bodyText2, { values: { privacyPolicyLink: react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("a", { className: _telemetry_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.privacyPolicyLink, href: "https://scratch.mit.edu/privacy_policy/" }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], messages.privacyPolicyLink)) } }))), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { className: _telemetry_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.buttonRow }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("button", { className: _telemetry_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.optOut, title: this.props.intl.formatMessage(messages.noTooltip), onClick: this.handleOptOut }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], messages.noButton)), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("button", { className: _telemetry_modal_css__WEBPACK_IMPORTED_MODULE_6___default.a.optIn, title: this.props.intl.formatMessage(messages.yesTooltip), onClick: this.handleOptIn }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_3__["FormattedMessage"], messages.yesButton)))))); } }]); return TelemetryModal; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.PureComponent); TelemetryModal.propTypes = { intl: react_intl__WEBPACK_IMPORTED_MODULE_3__["intlShape"].isRequired, isRtl: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, onCancel: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onOptIn: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, onOptOut: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, onRequestClose: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_3__["injectIntl"])(TelemetryModal)); /***/ }), /***/ "./src/components/turbo-mode/icon--turbo.svg": /*!***************************************************!*\ !*** ./src/components/turbo-mode/icon--turbo.svg ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/f2457825850317e66ef2128504613c30.svg"; /***/ }), /***/ "./src/components/turbo-mode/turbo-mode.css": /*!**************************************************!*\ !*** ./src/components/turbo-mode/turbo-mode.css ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./turbo-mode.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/turbo-mode/turbo-mode.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/turbo-mode/turbo-mode.jsx": /*!**************************************************!*\ !*** ./src/components/turbo-mode/turbo-mode.jsx ***! \**************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _icon_turbo_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./icon--turbo.svg */ "./src/components/turbo-mode/icon--turbo.svg"); /* harmony import */ var _icon_turbo_svg__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_icon_turbo_svg__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _turbo_mode_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./turbo-mode.css */ "./src/components/turbo-mode/turbo-mode.css"); /* harmony import */ var _turbo_mode_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_turbo_mode_css__WEBPACK_IMPORTED_MODULE_3__); var TurboMode = function TurboMode() { return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _turbo_mode_css__WEBPACK_IMPORTED_MODULE_3___default.a.turboContainer }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("img", { className: _turbo_mode_css__WEBPACK_IMPORTED_MODULE_3___default.a.turboIcon, src: _icon_turbo_svg__WEBPACK_IMPORTED_MODULE_2___default.a }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _turbo_mode_css__WEBPACK_IMPORTED_MODULE_3___default.a.turboLabel }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Turbo Mode", id: "gui.turboMode.active" }))); }; /* harmony default export */ __webpack_exports__["default"] = (TurboMode); /***/ }), /***/ "./src/components/watermark/watermark.css": /*!************************************************!*\ !*** ./src/components/watermark/watermark.css ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./watermark.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/watermark/watermark.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/watermark/watermark.jsx": /*!************************************************!*\ !*** ./src/components/watermark/watermark.jsx ***! \************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _watermark_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./watermark.css */ "./src/components/watermark/watermark.css"); /* harmony import */ var _watermark_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_watermark_css__WEBPACK_IMPORTED_MODULE_2__); var Watermark = function Watermark(props) { return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", { className: _watermark_css__WEBPACK_IMPORTED_MODULE_2___default.a.spriteImage, src: props.costumeURL }); }; Watermark.propTypes = { costumeURL: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string }; /* harmony default export */ __webpack_exports__["default"] = (Watermark); /***/ }), /***/ "./src/components/waveform/waveform.css": /*!**********************************************!*\ !*** ./src/components/waveform/waveform.css ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./waveform.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/waveform/waveform.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/waveform/waveform.jsx": /*!**********************************************!*\ !*** ./src/components/waveform/waveform.jsx ***! \**********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _waveform_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./waveform.css */ "./src/components/waveform/waveform.css"); /* harmony import */ var _waveform_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_waveform_css__WEBPACK_IMPORTED_MODULE_2__); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } // Waveform is expensive to compute, make sure it only updates when data does // by using PureComponent. In future can be changed back to function with React.memo // eslint-disable-next-line react/prefer-stateless-function var Waveform = /*#__PURE__*/ function (_React$PureComponent) { _inherits(Waveform, _React$PureComponent); function Waveform() { _classCallCheck(this, Waveform); return _possibleConstructorReturn(this, _getPrototypeOf(Waveform).apply(this, arguments)); } _createClass(Waveform, [{ key: "render", value: function render() { var _this$props = this.props, width = _this$props.width, height = _this$props.height, data = _this$props.data; // Never want a density of points higher than the number of pixels // This is very conservative, could be far fewer points because of curve smoothing. // Drawing too many points seems to cause an explosion in browser // composite time when animating the playhead var takeEveryN = Math.ceil(data.length / width); var filteredData = takeEveryN === 1 ? data : data.filter(function (_, i) { return i % takeEveryN === 0; }); var cappedData = [0].concat(_toConsumableArray(filteredData), [0]); var points = [].concat(_toConsumableArray(cappedData.map(function (v, i) { return [width * i / cappedData.length, height * v / 2]; })), _toConsumableArray(cappedData.reverse().map(function (v, i) { return [width * (cappedData.length - i - 1) / cappedData.length, -height * v / 2]; }))); var pathComponents = points.map(function (_ref, i) { var _ref2 = _slicedToArray(_ref, 2), x = _ref2[0], y = _ref2[1]; var _points = _slicedToArray(points[i < points.length - 1 ? i + 1 : 0], 2), nx = _points[0], ny = _points[1]; return "Q".concat(x, " ").concat(y, " ").concat((x + nx) / 2, " ").concat((y + ny) / 2); }); return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("svg", { className: _waveform_css__WEBPACK_IMPORTED_MODULE_2___default.a.container, viewBox: "-1 0 ".concat(width, " ").concat(height) }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("line", { className: _waveform_css__WEBPACK_IMPORTED_MODULE_2___default.a.baseline, x1: -1, x2: width, y1: height / 2, y2: height / 2 }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("g", { transform: "scale(1, -1) translate(0, -".concat(height / 2, ")") }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("path", { className: _waveform_css__WEBPACK_IMPORTED_MODULE_2___default.a.waveformPath, d: "M0 0".concat(pathComponents.join(' '), "Z"), strokeLinejoin: 'round', strokeWidth: 1 }))); } }]); return Waveform; }(react__WEBPACK_IMPORTED_MODULE_0___default.a.PureComponent); Waveform.propTypes = { data: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number), height: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, width: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number }; /* harmony default export */ __webpack_exports__["default"] = (Waveform); /***/ }), /***/ "./src/components/webgl-modal/unsupported.png": /*!****************************************************!*\ !*** ./src/components/webgl-modal/unsupported.png ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/905aaa5ec7fca7cf364f5e74bcb10be1.png"; /***/ }), /***/ "./src/components/webgl-modal/webgl-modal.css": /*!****************************************************!*\ !*** ./src/components/webgl-modal/webgl-modal.css ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/src??postcss!./webgl-modal.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./src/components/webgl-modal/webgl-modal.css"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/components/webgl-modal/webgl-modal.jsx": /*!****************************************************!*\ !*** ./src/components/webgl-modal/webgl-modal.jsx ***! \****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react_modal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-modal */ "./node_modules/react-modal/lib/index.js"); /* harmony import */ var react_modal__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_modal__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _box_box_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _webgl_modal_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./webgl-modal.css */ "./src/components/webgl-modal/webgl-modal.css"); /* harmony import */ var _webgl_modal_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_webgl_modal_css__WEBPACK_IMPORTED_MODULE_5__); function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_4__["defineMessages"])({ label: { "id": "gui.webglModal.label", "defaultMessage": "Your Browser Does Not Support WebGL" } }); var WebGlModal = function WebGlModal(_ref) { var intl = _ref.intl, props = _objectWithoutProperties(_ref, ["intl"]); return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_modal__WEBPACK_IMPORTED_MODULE_2___default.a, { isOpen: true, className: _webgl_modal_css__WEBPACK_IMPORTED_MODULE_5___default.a.modalContent, contentLabel: intl.formatMessage(_objectSpread({}, messages.label)), overlayClassName: _webgl_modal_css__WEBPACK_IMPORTED_MODULE_5___default.a.modalOverlay, onRequestClose: props.onBack }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { dir: props.isRtl ? 'rtl' : 'ltr' }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _webgl_modal_css__WEBPACK_IMPORTED_MODULE_5___default.a.illustration }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _webgl_modal_css__WEBPACK_IMPORTED_MODULE_5___default.a.body }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("h2", null, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_4__["FormattedMessage"], messages.label)), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("p", null, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_4__["FormattedMessage"], { defaultMessage: "Unfortunately it looks like your browser or computer {webGlLink}. This technology is needed for Scratch 3.0 to run.", id: "gui.webglModal.description", values: { webGlLink: react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("a", { className: _webgl_modal_css__WEBPACK_IMPORTED_MODULE_5___default.a.faqLink, href: "https://get.webgl.org/" }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_4__["FormattedMessage"], { defaultMessage: "does not support WebGL", id: "gui.webglModal.webgllink" })) } })), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_box_box_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { className: _webgl_modal_css__WEBPACK_IMPORTED_MODULE_5___default.a.buttonRow }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("button", { className: _webgl_modal_css__WEBPACK_IMPORTED_MODULE_5___default.a.backButton, onClick: props.onBack }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_4__["FormattedMessage"], { defaultMessage: "Back", id: "gui.webglModal.back" }))), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: _webgl_modal_css__WEBPACK_IMPORTED_MODULE_5___default.a.faqLinkText }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_4__["FormattedMessage"], { defaultMessage: "To learn more, go to the {previewFaqLink}.", id: "gui.webglModal.previewfaq", values: { previewFaqLink: react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("a", { className: _webgl_modal_css__WEBPACK_IMPORTED_MODULE_5___default.a.faqLink, href: "//scratch.mit.edu/3faq" }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_4__["FormattedMessage"], { defaultMessage: "FAQ", id: "gui.webglModal.previewfaqlinktext" })) } }))))); }; WebGlModal.propTypes = { intl: react_intl__WEBPACK_IMPORTED_MODULE_4__["intlShape"].isRequired, isRtl: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, onBack: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_4__["injectIntl"])(WebGlModal)); /***/ }), /***/ "./src/containers/account-nav.jsx": /*!****************************************!*\ !*** ./src/containers/account-nav.jsx ***! \****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _components_menu_bar_account_nav_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../components/menu-bar/account-nav.jsx */ "./src/components/menu-bar/account-nav.jsx"); function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /* NOTE: this file only temporarily resides in scratch-gui. Nearly identical code appears in scratch-www, and the two should eventually be consolidated. */ var AccountNav = function AccountNav(props) { var componentProps = _extends({}, props); return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_components_menu_bar_account_nav_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], componentProps); }; AccountNav.propTypes = { classroomId: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, isEducator: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, isRtl: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, isStudent: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, profileUrl: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, thumbnailUrl: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, username: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string }; var mapStateToProps = function mapStateToProps(state) { return { classroomId: state.session && state.session.session && state.session.session.user ? state.session.session.user.classroomId : '', isEducator: state.session && state.session.permissions && state.session.permissions.educator, isStudent: state.session && state.session.permissions && state.session.permissions.student, profileUrl: state.session && state.session.session && state.session.session.user ? "/users/".concat(state.session.session.user.username) : '', thumbnailUrl: state.session && state.session.session && state.session.session.user ? state.session.session.user.thumbnailUrl : null, username: state.session && state.session.session && state.session.session.user ? state.session.session.user.username : '' }; }; var mapDispatchToProps = function mapDispatchToProps() { return {}; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_0__["injectIntl"])(Object(react_redux__WEBPACK_IMPORTED_MODULE_3__["connect"])(mapStateToProps, mapDispatchToProps)(AccountNav))); /***/ }), /***/ "./src/containers/alert.jsx": /*!**********************************!*\ !*** ./src/containers/alert.jsx ***! \**********************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _sb3_downloader_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./sb3-downloader.jsx */ "./src/containers/sb3-downloader.jsx"); /* harmony import */ var _components_alerts_alert_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../components/alerts/alert.jsx */ "./src/components/alerts/alert.jsx"); /* harmony import */ var _reducers_modals__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../reducers/modals */ "./src/reducers/modals.js"); /* harmony import */ var _reducers_connection_modal__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../reducers/connection-modal */ "./src/reducers/connection-modal.js"); /* harmony import */ var _reducers_project_state__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../reducers/project-state */ "./src/reducers/project-state.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var Alert = /*#__PURE__*/ function (_React$Component) { _inherits(Alert, _React$Component); function Alert(props) { var _this; _classCallCheck(this, Alert); _this = _possibleConstructorReturn(this, _getPrototypeOf(Alert).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_1___default()(_assertThisInitialized(_this), ['handleOnCloseAlert', 'handleOnReconnect']); return _this; } _createClass(Alert, [{ key: "handleOnCloseAlert", value: function handleOnCloseAlert() { this.props.onCloseAlert(this.props.index); } }, { key: "handleOnReconnect", value: function handleOnReconnect() { this.props.onOpenConnectionModal(this.props.extensionId); this.handleOnCloseAlert(); } }, { key: "render", value: function render() { var _this2 = this; var _this$props = this.props, closeButton = _this$props.closeButton, content = _this$props.content, extensionName = _this$props.extensionName, index = _this$props.index, level = _this$props.level, iconSpinner = _this$props.iconSpinner, iconURL = _this$props.iconURL, message = _this$props.message, onSaveNow = _this$props.onSaveNow, showDownload = _this$props.showDownload, showReconnect = _this$props.showReconnect, showSaveNow = _this$props.showSaveNow; return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_sb3_downloader_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], null, function (_, downloadProject) { return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_alerts_alert_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { closeButton: closeButton, content: content, extensionName: extensionName, iconSpinner: iconSpinner, iconURL: iconURL, level: level, message: message, showDownload: showDownload, showReconnect: showReconnect, showSaveNow: showSaveNow, onCloseAlert: _this2.handleOnCloseAlert, onDownload: downloadProject, onReconnect: _this2.handleOnReconnect, onSaveNow: onSaveNow }); }); } }]); return Alert; }(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component); var mapStateToProps = function mapStateToProps() { return {}; }; var mapDispatchToProps = function mapDispatchToProps(dispatch) { return { onOpenConnectionModal: function onOpenConnectionModal(id) { dispatch(Object(_reducers_connection_modal__WEBPACK_IMPORTED_MODULE_7__["setConnectionModalExtensionId"])(id)); dispatch(Object(_reducers_modals__WEBPACK_IMPORTED_MODULE_6__["openConnectionModal"])()); }, onSaveNow: function onSaveNow() { dispatch(Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_8__["manualUpdateProject"])()); } }; }; Alert.propTypes = { closeButton: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, content: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.element, extensionId: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, extensionName: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, iconSpinner: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, iconURL: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, index: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number, level: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string.isRequired, message: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, onCloseAlert: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func.isRequired, onOpenConnectionModal: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onSaveNow: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, showDownload: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, showReconnect: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, showSaveNow: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_redux__WEBPACK_IMPORTED_MODULE_3__["connect"])(mapStateToProps, mapDispatchToProps)(Alert)); /***/ }), /***/ "./src/containers/alerts.jsx": /*!***********************************!*\ !*** ./src/containers/alerts.jsx ***! \***********************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _reducers_alerts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../reducers/alerts */ "./src/reducers/alerts.js"); /* harmony import */ var _components_alerts_alerts_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../components/alerts/alerts.jsx */ "./src/components/alerts/alerts.jsx"); var Alerts = function Alerts(_ref) { var alertsList = _ref.alertsList, className = _ref.className, onCloseAlert = _ref.onCloseAlert; return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_alerts_alerts_jsx__WEBPACK_IMPORTED_MODULE_4__["default"] // only display standard and extension alerts here , { alertsList: Object(_reducers_alerts__WEBPACK_IMPORTED_MODULE_3__["filterPopupAlerts"])(alertsList), className: className, onCloseAlert: onCloseAlert }); }; Alerts.propTypes = { alertsList: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object), className: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, onCloseAlert: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func }; var mapStateToProps = function mapStateToProps(state) { return { alertsList: state.scratchGui.alerts.alertsList }; }; var mapDispatchToProps = function mapDispatchToProps(dispatch) { return { onCloseAlert: function onCloseAlert(index) { return dispatch(Object(_reducers_alerts__WEBPACK_IMPORTED_MODULE_3__["closeAlert"])(index)); } }; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_redux__WEBPACK_IMPORTED_MODULE_2__["connect"])(mapStateToProps, mapDispatchToProps)(Alerts)); /***/ }), /***/ "./src/containers/audio-trimmer.jsx": /*!******************************************!*\ !*** ./src/containers/audio-trimmer.jsx ***! \******************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _components_audio_trimmer_audio_trimmer_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/audio-trimmer/audio-trimmer.jsx */ "./src/components/audio-trimmer/audio-trimmer.jsx"); /* harmony import */ var _lib_touch_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/touch-utils */ "./src/lib/touch-utils.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var MIN_LENGTH = 0.01; // Used to stop sounds being trimmed smaller than 1% var AudioTrimmer = /*#__PURE__*/ function (_React$Component) { _inherits(AudioTrimmer, _React$Component); function AudioTrimmer(props) { var _this; _classCallCheck(this, AudioTrimmer); _this = _possibleConstructorReturn(this, _getPrototypeOf(AudioTrimmer).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_2___default()(_assertThisInitialized(_this), ['handleTrimStartMouseDown', 'handleTrimEndMouseDown', 'handleTrimStartMouseMove', 'handleTrimEndMouseMove', 'handleTrimStartMouseUp', 'handleTrimEndMouseUp', 'storeRef']); return _this; } _createClass(AudioTrimmer, [{ key: "handleTrimStartMouseMove", value: function handleTrimStartMouseMove(e) { var containerSize = this.containerElement.getBoundingClientRect().width; var dx = (Object(_lib_touch_utils__WEBPACK_IMPORTED_MODULE_4__["getEventXY"])(e).x - this.initialX) / containerSize; var newTrim = Math.max(0, Math.min(this.props.trimEnd - MIN_LENGTH, this.initialTrim + dx)); this.props.onSetTrimStart(newTrim); e.preventDefault(); } }, { key: "handleTrimEndMouseMove", value: function handleTrimEndMouseMove(e) { var containerSize = this.containerElement.getBoundingClientRect().width; var dx = (Object(_lib_touch_utils__WEBPACK_IMPORTED_MODULE_4__["getEventXY"])(e).x - this.initialX) / containerSize; var newTrim = Math.min(1, Math.max(this.props.trimStart + MIN_LENGTH, this.initialTrim + dx)); this.props.onSetTrimEnd(newTrim); e.preventDefault(); } }, { key: "handleTrimStartMouseUp", value: function handleTrimStartMouseUp() { window.removeEventListener('mousemove', this.handleTrimStartMouseMove); window.removeEventListener('mouseup', this.handleTrimStartMouseUp); window.removeEventListener('touchmove', this.handleTrimStartMouseMove); window.removeEventListener('touchend', this.handleTrimStartMouseUp); } }, { key: "handleTrimEndMouseUp", value: function handleTrimEndMouseUp() { window.removeEventListener('mousemove', this.handleTrimEndMouseMove); window.removeEventListener('mouseup', this.handleTrimEndMouseUp); window.removeEventListener('touchmove', this.handleTrimEndMouseMove); window.removeEventListener('touchend', this.handleTrimEndMouseUp); } }, { key: "handleTrimStartMouseDown", value: function handleTrimStartMouseDown(e) { this.initialX = Object(_lib_touch_utils__WEBPACK_IMPORTED_MODULE_4__["getEventXY"])(e).x; this.initialTrim = this.props.trimStart; window.addEventListener('mousemove', this.handleTrimStartMouseMove); window.addEventListener('mouseup', this.handleTrimStartMouseUp); window.addEventListener('touchmove', this.handleTrimStartMouseMove); window.addEventListener('touchend', this.handleTrimStartMouseUp); } }, { key: "handleTrimEndMouseDown", value: function handleTrimEndMouseDown(e) { this.initialX = Object(_lib_touch_utils__WEBPACK_IMPORTED_MODULE_4__["getEventXY"])(e).x; this.initialTrim = this.props.trimEnd; window.addEventListener('mousemove', this.handleTrimEndMouseMove); window.addEventListener('mouseup', this.handleTrimEndMouseUp); window.addEventListener('touchmove', this.handleTrimEndMouseMove); window.addEventListener('touchend', this.handleTrimEndMouseUp); } }, { key: "storeRef", value: function storeRef(el) { this.containerElement = el; } }, { key: "render", value: function render() { return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_audio_trimmer_audio_trimmer_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { containerRef: this.storeRef, playhead: this.props.playhead, trimEnd: this.props.trimEnd, trimStart: this.props.trimStart, onTrimEndMouseDown: this.handleTrimEndMouseDown, onTrimStartMouseDown: this.handleTrimStartMouseDown }); } }]); return AudioTrimmer; }(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component); AudioTrimmer.propTypes = { onSetTrimEnd: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onSetTrimStart: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, playhead: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, trimEnd: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, trimStart: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number }; /* harmony default export */ __webpack_exports__["default"] = (AudioTrimmer); /***/ }), /***/ "./src/containers/auto-scanning-step.jsx": /*!***********************************************!*\ !*** ./src/containers/auto-scanning-step.jsx ***! \***********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _components_connection_modal_auto_scanning_step_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/connection-modal/auto-scanning-step.jsx */ "./src/components/connection-modal/auto-scanning-step.jsx"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! scratch-vm */ "./node_modules/scratch-vm/src/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(scratch_vm__WEBPACK_IMPORTED_MODULE_4__); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var AutoScanningStep = /*#__PURE__*/ function (_React$Component) { _inherits(AutoScanningStep, _React$Component); function AutoScanningStep(props) { var _this; _classCallCheck(this, AutoScanningStep); _this = _possibleConstructorReturn(this, _getPrototypeOf(AutoScanningStep).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_2___default()(_assertThisInitialized(_this), ['handlePeripheralListUpdate', 'handlePeripheralScanTimeout', 'handleStartScan', 'handleRefresh']); _this.state = { phase: _components_connection_modal_auto_scanning_step_jsx__WEBPACK_IMPORTED_MODULE_3__["PHASES"].prescan }; return _this; } _createClass(AutoScanningStep, [{ key: "componentWillUnmount", value: function componentWillUnmount() { // @todo: stop the peripheral scan here this.unbindPeripheralUpdates(); } }, { key: "handlePeripheralScanTimeout", value: function handlePeripheralScanTimeout() { this.setState({ phase: _components_connection_modal_auto_scanning_step_jsx__WEBPACK_IMPORTED_MODULE_3__["PHASES"].notfound }); this.unbindPeripheralUpdates(); } }, { key: "handlePeripheralListUpdate", value: function handlePeripheralListUpdate(newList) { // TODO: sort peripherals by signal strength? so they don't jump around var peripheralArray = Object.keys(newList).map(function (id) { return newList[id]; }); if (peripheralArray.length > 0) { this.props.onConnecting(peripheralArray[0].peripheralId); } } }, { key: "bindPeripheralUpdates", value: function bindPeripheralUpdates() { this.props.vm.on('PERIPHERAL_LIST_UPDATE', this.handlePeripheralListUpdate); this.props.vm.on('PERIPHERAL_SCAN_TIMEOUT', this.handlePeripheralScanTimeout); } }, { key: "unbindPeripheralUpdates", value: function unbindPeripheralUpdates() { this.props.vm.removeListener('PERIPHERAL_LIST_UPDATE', this.handlePeripheralListUpdate); this.props.vm.removeListener('PERIPHERAL_SCAN_TIMEOUT', this.handlePeripheralScanTimeout); } }, { key: "handleRefresh", value: function handleRefresh() { // @todo: stop the peripheral scan here, it is more important for auto scan // due to timeout and cancellation this.setState({ phase: _components_connection_modal_auto_scanning_step_jsx__WEBPACK_IMPORTED_MODULE_3__["PHASES"].prescan }); this.unbindPeripheralUpdates(); } }, { key: "handleStartScan", value: function handleStartScan() { this.bindPeripheralUpdates(); this.props.vm.scanForPeripheral(this.props.extensionId); this.setState({ phase: _components_connection_modal_auto_scanning_step_jsx__WEBPACK_IMPORTED_MODULE_3__["PHASES"].pressbutton }); } }, { key: "render", value: function render() { return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_components_connection_modal_auto_scanning_step_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { connectionTipIconURL: this.props.connectionTipIconURL, phase: this.state.phase, title: this.props.extensionId, onRefresh: this.handleRefresh, onStartScan: this.handleStartScan }); } }]); return AutoScanningStep; }(react__WEBPACK_IMPORTED_MODULE_1___default.a.Component); AutoScanningStep.propTypes = { connectionTipIconURL: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, extensionId: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string.isRequired, onConnecting: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, vm: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.instanceOf(scratch_vm__WEBPACK_IMPORTED_MODULE_4___default.a).isRequired }; /* harmony default export */ __webpack_exports__["default"] = (AutoScanningStep); /***/ }), /***/ "./src/containers/backdrop-library.jsx": /*!*********************************************!*\ !*** ./src/containers/backdrop-library.jsx ***! \*********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! scratch-vm */ "./node_modules/scratch-vm/src/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(scratch_vm__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _lib_libraries_backdrops_json__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lib/libraries/backdrops.json */ "./src/lib/libraries/backdrops.json"); var _lib_libraries_backdrops_json__WEBPACK_IMPORTED_MODULE_6___namespace = /*#__PURE__*/__webpack_require__.t(/*! ../lib/libraries/backdrops.json */ "./src/lib/libraries/backdrops.json", 1); /* harmony import */ var _lib_libraries_backdrop_tags__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../lib/libraries/backdrop-tags */ "./src/lib/libraries/backdrop-tags.js"); /* harmony import */ var _components_library_library_jsx__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../components/library/library.jsx */ "./src/components/library/library.jsx"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_3__["defineMessages"])({ libraryTitle: { "id": "gui.costumeLibrary.chooseABackdrop", "defaultMessage": "Choose a Backdrop" } }); var BackdropLibrary = /*#__PURE__*/ function (_React$Component) { _inherits(BackdropLibrary, _React$Component); function BackdropLibrary(props) { var _this; _classCallCheck(this, BackdropLibrary); _this = _possibleConstructorReturn(this, _getPrototypeOf(BackdropLibrary).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['handleItemSelect']); return _this; } _createClass(BackdropLibrary, [{ key: "handleItemSelect", value: function handleItemSelect(item) { var vmBackdrop = { name: item.name, rotationCenterX: item.info[0] && item.info[0] / 2, rotationCenterY: item.info[1] && item.info[1] / 2, bitmapResolution: item.info.length > 2 ? item.info[2] : 1, skinId: null }; this.props.vm.setEditingTarget(this.props.stageID); this.props.vm.addBackdrop(item.md5, vmBackdrop); } }, { key: "render", value: function render() { return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_components_library_library_jsx__WEBPACK_IMPORTED_MODULE_8__["default"], { data: _lib_libraries_backdrops_json__WEBPACK_IMPORTED_MODULE_6__, id: "backdropLibrary", tags: _lib_libraries_backdrop_tags__WEBPACK_IMPORTED_MODULE_7__["default"], title: this.props.intl.formatMessage(messages.libraryTitle), onItemSelected: this.handleItemSelect, onRequestClose: this.props.onRequestClose }); } }]); return BackdropLibrary; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.Component); BackdropLibrary.propTypes = { intl: react_intl__WEBPACK_IMPORTED_MODULE_3__["intlShape"].isRequired, onRequestClose: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, stageID: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string.isRequired, vm: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.instanceOf(scratch_vm__WEBPACK_IMPORTED_MODULE_5___default.a).isRequired }; var mapStateToProps = function mapStateToProps(state) { return { stageID: state.scratchGui.targets.stage.id }; }; var mapDispatchToProps = function mapDispatchToProps() { return {}; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_3__["injectIntl"])(Object(react_redux__WEBPACK_IMPORTED_MODULE_4__["connect"])(mapStateToProps, mapDispatchToProps)(BackdropLibrary))); /***/ }), /***/ "./src/containers/backpack.jsx": /*!*************************************!*\ !*** ./src/containers/backpack.jsx ***! \*************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _components_backpack_backpack_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/backpack/backpack.jsx */ "./src/components/backpack/backpack.jsx"); /* harmony import */ var _lib_backpack_api__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/backpack-api */ "./src/lib/backpack-api.js"); /* harmony import */ var _lib_drag_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../lib/drag-constants */ "./src/lib/drag-constants.js"); /* harmony import */ var _lib_drop_area_hoc_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lib/drop-area-hoc.jsx */ "./src/lib/drop-area-hoc.jsx"); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _lib_storage__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../lib/storage */ "./src/lib/storage.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! scratch-vm */ "./node_modules/scratch-vm/src/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(scratch_vm__WEBPACK_IMPORTED_MODULE_9__); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var dragTypes = [_lib_drag_constants__WEBPACK_IMPORTED_MODULE_5__["default"].COSTUME, _lib_drag_constants__WEBPACK_IMPORTED_MODULE_5__["default"].SOUND, _lib_drag_constants__WEBPACK_IMPORTED_MODULE_5__["default"].SPRITE]; var DroppableBackpack = Object(_lib_drop_area_hoc_jsx__WEBPACK_IMPORTED_MODULE_6__["default"])(dragTypes)(_components_backpack_backpack_jsx__WEBPACK_IMPORTED_MODULE_3__["default"]); var Backpack = /*#__PURE__*/ function (_React$Component) { _inherits(Backpack, _React$Component); function Backpack(props) { var _this; _classCallCheck(this, Backpack); _this = _possibleConstructorReturn(this, _getPrototypeOf(Backpack).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_2___default()(_assertThisInitialized(_this), ['handleDrop', 'handleToggle', 'handleDelete', 'getBackpackAssetURL', 'getContents', 'handleMouseEnter', 'handleMouseLeave', 'handleBlockDragEnd', 'handleBlockDragUpdate', 'handleMore']); _this.state = { // While the DroppableHOC manages drop interactions for asset tiles, // we still need to micromanage drops coming from the block workspace. // TODO this may be refactorable with the share-the-love logic in SpriteSelectorItem blockDragOutsideWorkspace: false, blockDragOverBackpack: false, error: false, itemsPerPage: 20, moreToLoad: false, loading: false, expanded: false, contents: [] }; // If a host is given, add it as a web source to the storage module // TODO remove the hacky flag that prevents double adding if (props.host && !_lib_storage__WEBPACK_IMPORTED_MODULE_8__["default"]._hasAddedBackpackSource) { _lib_storage__WEBPACK_IMPORTED_MODULE_8__["default"].addWebSource([_lib_storage__WEBPACK_IMPORTED_MODULE_8__["default"].AssetType.ImageVector, _lib_storage__WEBPACK_IMPORTED_MODULE_8__["default"].AssetType.ImageBitmap, _lib_storage__WEBPACK_IMPORTED_MODULE_8__["default"].AssetType.Sound], _this.getBackpackAssetURL); _lib_storage__WEBPACK_IMPORTED_MODULE_8__["default"]._hasAddedBackpackSource = true; } return _this; } _createClass(Backpack, [{ key: "componentDidMount", value: function componentDidMount() { this.props.vm.addListener('BLOCK_DRAG_END', this.handleBlockDragEnd); this.props.vm.addListener('BLOCK_DRAG_UPDATE', this.handleBlockDragUpdate); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.props.vm.removeListener('BLOCK_DRAG_END', this.handleBlockDragEnd); this.props.vm.removeListener('BLOCK_DRAG_UPDATE', this.handleBlockDragUpdate); } }, { key: "getBackpackAssetURL", value: function getBackpackAssetURL(asset) { return "".concat(this.props.host, "/").concat(asset.assetId, ".").concat(asset.dataFormat); } }, { key: "handleToggle", value: function handleToggle() { var newState = !this.state.expanded; this.setState({ expanded: newState, contents: [] }, function () { // Emit resize on window to get blocks to resize window.dispatchEvent(new Event('resize')); }); if (newState) { this.getContents(); } } }, { key: "handleDrop", value: function handleDrop(dragInfo) { var _this2 = this; var payloader = null; var presaveAsset = null; switch (dragInfo.dragType) { case _lib_drag_constants__WEBPACK_IMPORTED_MODULE_5__["default"].COSTUME: payloader = _lib_backpack_api__WEBPACK_IMPORTED_MODULE_4__["costumePayload"]; presaveAsset = dragInfo.payload.asset; break; case _lib_drag_constants__WEBPACK_IMPORTED_MODULE_5__["default"].SOUND: payloader = _lib_backpack_api__WEBPACK_IMPORTED_MODULE_4__["soundPayload"]; presaveAsset = dragInfo.payload.asset; break; case _lib_drag_constants__WEBPACK_IMPORTED_MODULE_5__["default"].SPRITE: payloader = _lib_backpack_api__WEBPACK_IMPORTED_MODULE_4__["spritePayload"]; break; case _lib_drag_constants__WEBPACK_IMPORTED_MODULE_5__["default"].CODE: payloader = _lib_backpack_api__WEBPACK_IMPORTED_MODULE_4__["codePayload"]; break; } if (!payloader) return; // Creating the payload is async, so set loading before starting this.setState({ loading: true }, function () { payloader(dragInfo.payload, _this2.props.vm).then(function (payload) { // Force the asset to save to the asset server before storing in backpack // Ensures any asset present in the backpack is also on the asset server if (presaveAsset && !presaveAsset.clean) { return _lib_storage__WEBPACK_IMPORTED_MODULE_8__["default"].store(presaveAsset.assetType, presaveAsset.dataFormat, presaveAsset.data, presaveAsset.assetId).then(function () { return payload; }); } return payload; }).then(function (payload) { return Object(_lib_backpack_api__WEBPACK_IMPORTED_MODULE_4__["saveBackpackObject"])(_objectSpread({ host: _this2.props.host, token: _this2.props.token, username: _this2.props.username }, payload)); }).then(function (item) { _this2.setState({ loading: false, contents: [item].concat(_this2.state.contents) }); }).catch(function (error) { _this2.setState({ error: true, loading: false }); throw error; }); }); } }, { key: "handleDelete", value: function handleDelete(id) { var _this3 = this; this.setState({ loading: true }, function () { Object(_lib_backpack_api__WEBPACK_IMPORTED_MODULE_4__["deleteBackpackObject"])({ host: _this3.props.host, token: _this3.props.token, username: _this3.props.username, id: id }).then(function () { _this3.setState({ loading: false, contents: _this3.state.contents.filter(function (o) { return o.id !== id; }) }); }).catch(function (error) { _this3.setState({ error: true, loading: false }); throw error; }); }); } }, { key: "getContents", value: function getContents() { var _this4 = this; if (this.props.token && this.props.username) { this.setState({ loading: true, error: false }, function () { Object(_lib_backpack_api__WEBPACK_IMPORTED_MODULE_4__["getBackpackContents"])({ host: _this4.props.host, token: _this4.props.token, username: _this4.props.username, offset: _this4.state.contents.length, limit: _this4.state.itemsPerPage }).then(function (contents) { _this4.setState({ contents: _this4.state.contents.concat(contents), moreToLoad: contents.length === _this4.state.itemsPerPage, loading: false }); }).catch(function (error) { _this4.setState({ error: true, loading: false }); throw error; }); }); } } }, { key: "handleBlockDragUpdate", value: function handleBlockDragUpdate(isOutsideWorkspace) { this.setState({ blockDragOutsideWorkspace: isOutsideWorkspace }); } }, { key: "handleMouseEnter", value: function handleMouseEnter() { if (this.state.blockDragOutsideWorkspace) { this.setState({ blockDragOverBackpack: true }); } } }, { key: "handleMouseLeave", value: function handleMouseLeave() { this.setState({ blockDragOverBackpack: false }); } }, { key: "handleBlockDragEnd", value: function handleBlockDragEnd(blocks, topBlockId) { if (this.state.blockDragOverBackpack) { this.handleDrop({ dragType: _lib_drag_constants__WEBPACK_IMPORTED_MODULE_5__["default"].CODE, payload: { blockObjects: blocks, topBlockId: topBlockId } }); } this.setState({ blockDragOverBackpack: false, blockDragOutsideWorkspace: false }); } }, { key: "handleMore", value: function handleMore() { this.getContents(); } }, { key: "render", value: function render() { return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(DroppableBackpack, { blockDragOver: this.state.blockDragOverBackpack, contents: this.state.contents, error: this.state.error, expanded: this.state.expanded, loading: this.state.loading, showMore: this.state.moreToLoad, onDelete: this.handleDelete, onDrop: this.handleDrop, onMore: this.handleMore, onMouseEnter: this.handleMouseEnter, onMouseLeave: this.handleMouseLeave, onToggle: this.props.host ? this.handleToggle : null }); } }]); return Backpack; }(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component); Backpack.propTypes = { host: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, token: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, username: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, vm: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.instanceOf(scratch_vm__WEBPACK_IMPORTED_MODULE_9___default.a) }; var getTokenAndUsername = function getTokenAndUsername(state) { // Look for the session state provided by scratch-www if (state.session && state.session.session && state.session.session.user) { return { token: state.session.session.user.token, username: state.session.session.user.username }; } // Otherwise try to pull testing params out of the URL, or return nulls // TODO a hack for testing the backpack var tokenMatches = window.location.href.match(/[?&]token=([^&]*)&?/); var usernameMatches = window.location.href.match(/[?&]username=([^&]*)&?/); return { token: tokenMatches ? tokenMatches[1] : null, username: usernameMatches ? usernameMatches[1] : null }; }; var mapStateToProps = function mapStateToProps(state) { return Object.assign({ dragInfo: state.scratchGui.assetDrag, vm: state.scratchGui.vm, blockDrag: state.scratchGui.blockDrag }, getTokenAndUsername(state)); }; var mapDispatchToProps = function mapDispatchToProps() { return {}; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_redux__WEBPACK_IMPORTED_MODULE_7__["connect"])(mapStateToProps, mapDispatchToProps)(Backpack)); /***/ }), /***/ "./src/containers/blocks.jsx": /*!***********************************!*\ !*** ./src/containers/blocks.jsx ***! \***********************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash.debounce */ "./node_modules/lodash.debounce/index.js"); /* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_debounce__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var lodash_defaultsdeep__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash.defaultsdeep */ "./node_modules/lodash.defaultsdeep/index.js"); /* harmony import */ var lodash_defaultsdeep__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_defaultsdeep__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _lib_make_toolbox_xml__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../lib/make-toolbox-xml */ "./src/lib/make-toolbox-xml.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _lib_blocks__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lib/blocks */ "./src/lib/blocks.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! scratch-vm */ "./node_modules/scratch-vm/src/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(scratch_vm__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _lib_log_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../lib/log.js */ "./src/lib/log.js"); /* harmony import */ var _prompt_jsx__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./prompt.jsx */ "./src/containers/prompt.jsx"); /* harmony import */ var _components_blocks_blocks_jsx__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../components/blocks/blocks.jsx */ "./src/components/blocks/blocks.jsx"); /* harmony import */ var _extension_library_jsx__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./extension-library.jsx */ "./src/containers/extension-library.jsx"); /* harmony import */ var _lib_libraries_extensions_index_jsx__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../lib/libraries/extensions/index.jsx */ "./src/lib/libraries/extensions/index.jsx"); /* harmony import */ var _custom_procedures_jsx__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./custom-procedures.jsx */ "./src/containers/custom-procedures.jsx"); /* harmony import */ var _lib_error_boundary_hoc_jsx__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../lib/error-boundary-hoc.jsx */ "./src/lib/error-boundary-hoc.jsx"); /* harmony import */ var _lib_layout_constants__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../lib/layout-constants */ "./src/lib/layout-constants.js"); /* harmony import */ var _lib_drop_area_hoc_jsx__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../lib/drop-area-hoc.jsx */ "./src/lib/drop-area-hoc.jsx"); /* harmony import */ var _lib_drag_constants__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../lib/drag-constants */ "./src/lib/drag-constants.js"); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _reducers_toolbox__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../reducers/toolbox */ "./src/reducers/toolbox.js"); /* harmony import */ var _reducers_color_picker__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../reducers/color-picker */ "./src/reducers/color-picker.js"); /* harmony import */ var _reducers_modals__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../reducers/modals */ "./src/reducers/modals.js"); /* harmony import */ var _reducers_custom_procedures__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../reducers/custom-procedures */ "./src/reducers/custom-procedures.js"); /* harmony import */ var _reducers_connection_modal__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../reducers/connection-modal */ "./src/reducers/connection-modal.js"); /* harmony import */ var _reducers_editor_tab__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../reducers/editor-tab */ "./src/reducers/editor-tab.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var addFunctionListener = function addFunctionListener(object, property, callback) { var oldFn = object[property]; object[property] = function () { var result = oldFn.apply(this, arguments); callback.apply(this, result); return result; }; }; var DroppableBlocks = Object(_lib_drop_area_hoc_jsx__WEBPACK_IMPORTED_MODULE_16__["default"])([_lib_drag_constants__WEBPACK_IMPORTED_MODULE_17__["default"].BACKPACK_CODE])(_components_blocks_blocks_jsx__WEBPACK_IMPORTED_MODULE_10__["default"]); var Blocks = /*#__PURE__*/ function (_React$Component) { _inherits(Blocks, _React$Component); function Blocks(props) { var _this; _classCallCheck(this, Blocks); _this = _possibleConstructorReturn(this, _getPrototypeOf(Blocks).call(this, props)); _this.ScratchBlocks = Object(_lib_blocks__WEBPACK_IMPORTED_MODULE_6__["default"])(props.vm); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['attachVM', 'detachVM', 'getToolboxXML', 'handleCategorySelected', 'handleConnectionModalStart', 'handleDrop', 'handleStatusButtonUpdate', 'handleOpenSoundRecorder', 'handlePromptStart', 'handlePromptCallback', 'handlePromptClose', 'handleCustomProceduresClose', 'onScriptGlowOn', 'onScriptGlowOff', 'onBlockGlowOn', 'onBlockGlowOff', 'handleExtensionAdded', 'handleBlocksInfoUpdate', 'onTargetsUpdate', 'onVisualReport', 'onWorkspaceUpdate', 'onWorkspaceMetricsChange', 'setBlocks', 'setLocale']); _this.ScratchBlocks.prompt = _this.handlePromptStart; _this.ScratchBlocks.statusButtonCallback = _this.handleConnectionModalStart; _this.ScratchBlocks.recordSoundCallback = _this.handleOpenSoundRecorder; _this.state = { workspaceMetrics: {}, prompt: null }; _this.onTargetsUpdate = lodash_debounce__WEBPACK_IMPORTED_MODULE_1___default()(_this.onTargetsUpdate, 100); _this.toolboxUpdateQueue = []; return _this; } _createClass(Blocks, [{ key: "componentDidMount", value: function componentDidMount() { var _this2 = this; this.ScratchBlocks.FieldColourSlider.activateEyedropper_ = this.props.onActivateColorPicker; this.ScratchBlocks.Procedures.externalProcedureDefCallback = this.props.onActivateCustomProcedures; this.ScratchBlocks.ScratchMsgs.setLocale(this.props.locale); var workspaceConfig = lodash_defaultsdeep__WEBPACK_IMPORTED_MODULE_2___default()({}, Blocks.defaultOptions, this.props.options, { rtl: this.props.isRtl, toolbox: this.props.toolboxXML }); this.workspace = this.ScratchBlocks.inject(this.blocks, workspaceConfig); // Register buttons under new callback keys for creating variables, // lists, and procedures from extensions. var toolboxWorkspace = this.workspace.getFlyout().getWorkspace(); var varListButtonCallback = function varListButtonCallback(type) { return function () { return _this2.ScratchBlocks.Variables.createVariable(_this2.workspace, null, type); }; }; var procButtonCallback = function procButtonCallback() { _this2.ScratchBlocks.Procedures.createProcedureDefCallback_(_this2.workspace); }; toolboxWorkspace.registerButtonCallback('MAKE_A_VARIABLE', varListButtonCallback('')); toolboxWorkspace.registerButtonCallback('MAKE_A_LIST', varListButtonCallback('list')); toolboxWorkspace.registerButtonCallback('MAKE_A_PROCEDURE', procButtonCallback); // Store the xml of the toolbox that is actually rendered. // This is used in componentDidUpdate instead of prevProps, because // the xml can change while e.g. on the costumes tab. this._renderedToolboxXML = this.props.toolboxXML; // we actually never want the workspace to enable "refresh toolbox" - this basically re-renders the // entire toolbox every time we reset the workspace. We call updateToolbox as a part of // componentDidUpdate so the toolbox will still correctly be updated this.setToolboxRefreshEnabled = this.workspace.setToolboxRefreshEnabled.bind(this.workspace); this.workspace.setToolboxRefreshEnabled = function () { _this2.setToolboxRefreshEnabled(false); }; // @todo change this when blockly supports UI events addFunctionListener(this.workspace, 'translate', this.onWorkspaceMetricsChange); addFunctionListener(this.workspace, 'zoom', this.onWorkspaceMetricsChange); this.attachVM(); // Only update blocks/vm locale when visible to avoid sizing issues // If locale changes while not visible it will get handled in didUpdate if (this.props.isVisible) { this.setLocale(); } } }, { key: "shouldComponentUpdate", value: function shouldComponentUpdate(nextProps, nextState) { return this.state.prompt !== nextState.prompt || this.props.isVisible !== nextProps.isVisible || this._renderedToolboxXML !== nextProps.toolboxXML || this.props.extensionLibraryVisible !== nextProps.extensionLibraryVisible || this.props.customProceduresVisible !== nextProps.customProceduresVisible || this.props.locale !== nextProps.locale || this.props.anyModalVisible !== nextProps.anyModalVisible || this.props.stageSize !== nextProps.stageSize; } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { // If any modals are open, call hideChaff to close z-indexed field editors if (this.props.anyModalVisible && !prevProps.anyModalVisible) { this.ScratchBlocks.hideChaff(); } // Only rerender the toolbox when the blocks are visible and the xml is // different from the previously rendered toolbox xml. // Do not check against prevProps.toolboxXML because that may not have been rendered. if (this.props.isVisible && this.props.toolboxXML !== this._renderedToolboxXML) { this.requestToolboxUpdate(); } if (this.props.isVisible === prevProps.isVisible) { if (this.props.stageSize !== prevProps.stageSize) { // force workspace to redraw for the new stage size window.dispatchEvent(new Event('resize')); } return; } // @todo hack to resize blockly manually in case resize happened while hidden // @todo hack to reload the workspace due to gui bug #413 if (this.props.isVisible) { // Scripts tab this.workspace.setVisible(true); if (prevProps.locale !== this.props.locale || this.props.locale !== this.props.vm.getLocale()) { // call setLocale if the locale has changed, or changed while the blocks were hidden. // vm.getLocale() will be out of sync if locale was changed while not visible this.setLocale(); } else { this.props.vm.refreshWorkspace(); this.requestToolboxUpdate(); } window.dispatchEvent(new Event('resize')); } else { this.workspace.setVisible(false); } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.detachVM(); this.workspace.dispose(); clearTimeout(this.toolboxUpdateTimeout); } }, { key: "requestToolboxUpdate", value: function requestToolboxUpdate() { var _this3 = this; clearTimeout(this.toolboxUpdateTimeout); this.toolboxUpdateTimeout = setTimeout(function () { _this3.updateToolbox(); }, 0); } }, { key: "setLocale", value: function setLocale() { var _this4 = this; this.ScratchBlocks.ScratchMsgs.setLocale(this.props.locale); this.props.vm.setLocale(this.props.locale, this.props.messages).then(function () { _this4.workspace.getFlyout().setRecyclingEnabled(false); _this4.props.vm.refreshWorkspace(); _this4.requestToolboxUpdate(); _this4.withToolboxUpdates(function () { _this4.workspace.getFlyout().setRecyclingEnabled(true); }); }); } }, { key: "updateToolbox", value: function updateToolbox() { this.toolboxUpdateTimeout = false; var categoryId = this.workspace.toolbox_.getSelectedCategoryId(); var offset = this.workspace.toolbox_.getCategoryScrollOffset(); this.workspace.updateToolbox(this.props.toolboxXML); this._renderedToolboxXML = this.props.toolboxXML; // In order to catch any changes that mutate the toolbox during "normal runtime" // (variable changes/etc), re-enable toolbox refresh. // Using the setter function will rerender the entire toolbox which we just rendered. this.workspace.toolboxRefreshEnabled_ = true; var currentCategoryPos = this.workspace.toolbox_.getCategoryPositionById(categoryId); var currentCategoryLen = this.workspace.toolbox_.getCategoryLengthById(categoryId); if (offset < currentCategoryLen) { this.workspace.toolbox_.setFlyoutScrollPos(currentCategoryPos + offset); } else { this.workspace.toolbox_.setFlyoutScrollPos(currentCategoryPos); } var queue = this.toolboxUpdateQueue; this.toolboxUpdateQueue = []; queue.forEach(function (fn) { return fn(); }); } }, { key: "withToolboxUpdates", value: function withToolboxUpdates(fn) { // if there is a queued toolbox update, we need to wait if (this.toolboxUpdateTimeout) { this.toolboxUpdateQueue.push(fn); } else { fn(); } } }, { key: "attachVM", value: function attachVM() { this.workspace.addChangeListener(this.props.vm.blockListener); this.flyoutWorkspace = this.workspace.getFlyout().getWorkspace(); this.flyoutWorkspace.addChangeListener(this.props.vm.flyoutBlockListener); this.flyoutWorkspace.addChangeListener(this.props.vm.monitorBlockListener); this.props.vm.addListener('SCRIPT_GLOW_ON', this.onScriptGlowOn); this.props.vm.addListener('SCRIPT_GLOW_OFF', this.onScriptGlowOff); this.props.vm.addListener('BLOCK_GLOW_ON', this.onBlockGlowOn); this.props.vm.addListener('BLOCK_GLOW_OFF', this.onBlockGlowOff); this.props.vm.addListener('VISUAL_REPORT', this.onVisualReport); this.props.vm.addListener('workspaceUpdate', this.onWorkspaceUpdate); this.props.vm.addListener('targetsUpdate', this.onTargetsUpdate); this.props.vm.addListener('EXTENSION_ADDED', this.handleExtensionAdded); this.props.vm.addListener('BLOCKSINFO_UPDATE', this.handleBlocksInfoUpdate); this.props.vm.addListener('PERIPHERAL_CONNECTED', this.handleStatusButtonUpdate); this.props.vm.addListener('PERIPHERAL_DISCONNECTED', this.handleStatusButtonUpdate); } }, { key: "detachVM", value: function detachVM() { this.props.vm.removeListener('SCRIPT_GLOW_ON', this.onScriptGlowOn); this.props.vm.removeListener('SCRIPT_GLOW_OFF', this.onScriptGlowOff); this.props.vm.removeListener('BLOCK_GLOW_ON', this.onBlockGlowOn); this.props.vm.removeListener('BLOCK_GLOW_OFF', this.onBlockGlowOff); this.props.vm.removeListener('VISUAL_REPORT', this.onVisualReport); this.props.vm.removeListener('workspaceUpdate', this.onWorkspaceUpdate); this.props.vm.removeListener('targetsUpdate', this.onTargetsUpdate); this.props.vm.removeListener('EXTENSION_ADDED', this.handleExtensionAdded); this.props.vm.removeListener('BLOCKSINFO_UPDATE', this.handleBlocksInfoUpdate); this.props.vm.removeListener('PERIPHERAL_CONNECTED', this.handleStatusButtonUpdate); this.props.vm.removeListener('PERIPHERAL_DISCONNECTED', this.handleStatusButtonUpdate); } }, { key: "updateToolboxBlockValue", value: function updateToolboxBlockValue(id, value) { var _this5 = this; this.withToolboxUpdates(function () { var block = _this5.workspace.getFlyout().getWorkspace().getBlockById(id); if (block) { block.inputList[0].fieldRow[0].setValue(value); } }); } }, { key: "onTargetsUpdate", value: function onTargetsUpdate() { var _this6 = this; if (this.props.vm.editingTarget && this.workspace.getFlyout()) { ['glide', 'move', 'set'].forEach(function (prefix) { _this6.updateToolboxBlockValue("".concat(prefix, "x"), Math.round(_this6.props.vm.editingTarget.x).toString()); _this6.updateToolboxBlockValue("".concat(prefix, "y"), Math.round(_this6.props.vm.editingTarget.y).toString()); }); } } }, { key: "onWorkspaceMetricsChange", value: function onWorkspaceMetricsChange() { var target = this.props.vm.editingTarget; if (target && target.id) { var workspaceMetrics = Object.assign({}, this.state.workspaceMetrics, _defineProperty({}, target.id, { scrollX: this.workspace.scrollX, scrollY: this.workspace.scrollY, scale: this.workspace.scale })); this.setState({ workspaceMetrics: workspaceMetrics }); } } }, { key: "onScriptGlowOn", value: function onScriptGlowOn(data) { this.workspace.glowStack(data.id, true); } }, { key: "onScriptGlowOff", value: function onScriptGlowOff(data) { this.workspace.glowStack(data.id, false); } }, { key: "onBlockGlowOn", value: function onBlockGlowOn(data) { this.workspace.glowBlock(data.id, true); } }, { key: "onBlockGlowOff", value: function onBlockGlowOff(data) { this.workspace.glowBlock(data.id, false); } }, { key: "onVisualReport", value: function onVisualReport(data) { this.workspace.reportValue(data.id, data.value); } }, { key: "getToolboxXML", value: function getToolboxXML() { // Use try/catch because this requires digging pretty deep into the VM // Code inside intentionally ignores several error situations (no stage, etc.) // Because they would get caught by this try/catch try { var _this$props$vm = this.props.vm, target = _this$props$vm.editingTarget, runtime = _this$props$vm.runtime; var stage = runtime.getTargetForStage(); if (!target) target = stage; // If no editingTarget, use the stage var stageCostumes = stage.getCostumes(); var targetCostumes = target.getCostumes(); var targetSounds = target.getSounds(); var dynamicBlocksXML = this.props.vm.runtime.getBlocksXML(); return Object(_lib_make_toolbox_xml__WEBPACK_IMPORTED_MODULE_3__["default"])(target.isStage, target.id, dynamicBlocksXML, targetCostumes[0].name, stageCostumes[0].name, targetSounds.length > 0 ? targetSounds[0].name : ''); } catch (_unused) { return null; } } }, { key: "onWorkspaceUpdate", value: function onWorkspaceUpdate(data) { // When we change sprites, update the toolbox to have the new sprite's blocks var toolboxXML = this.getToolboxXML(); if (toolboxXML) { this.props.updateToolboxState(toolboxXML); } if (this.props.vm.editingTarget && !this.state.workspaceMetrics[this.props.vm.editingTarget.id]) { this.onWorkspaceMetricsChange(); } // Remove and reattach the workspace listener (but allow flyout events) this.workspace.removeChangeListener(this.props.vm.blockListener); var dom = this.ScratchBlocks.Xml.textToDom(data.xml); try { this.ScratchBlocks.Xml.clearWorkspaceAndLoadFromXml(dom, this.workspace); } catch (error) { // The workspace is likely incomplete. What did update should be // functional. // // Instead of throwing the error, by logging it and continuing as // normal lets the other workspace update processes complete in the // gui and vm, which lets the vm run even if the workspace is // incomplete. Throwing the error would keep things like setting the // correct editing target from happening which can interfere with // some blocks and processes in the vm. if (error.message) { error.message = "Workspace Update Error: ".concat(error.message); } _lib_log_js__WEBPACK_IMPORTED_MODULE_8__["default"].error(error); } this.workspace.addChangeListener(this.props.vm.blockListener); if (this.props.vm.editingTarget && this.state.workspaceMetrics[this.props.vm.editingTarget.id]) { var _this$state$workspace = this.state.workspaceMetrics[this.props.vm.editingTarget.id], scrollX = _this$state$workspace.scrollX, scrollY = _this$state$workspace.scrollY, scale = _this$state$workspace.scale; this.workspace.scrollX = scrollX; this.workspace.scrollY = scrollY; this.workspace.scale = scale; this.workspace.resize(); } // Clear the undo state of the workspace since this is a // fresh workspace and we don't want any changes made to another sprites // workspace to be 'undone' here. this.workspace.clearUndo(); } }, { key: "handleExtensionAdded", value: function handleExtensionAdded(blocksInfo) { // select JSON from each block info object then reject the pseudo-blocks which don't have JSON, like separators // this actually defines blocks and MUST run regardless of the UI state this.ScratchBlocks.defineBlocksWithJsonArray(blocksInfo.map(function (blockInfo) { return blockInfo.json; }).filter(function (x) { return x; })); // Update the toolbox with new blocks var toolboxXML = this.getToolboxXML(); if (toolboxXML) { this.props.updateToolboxState(toolboxXML); } } }, { key: "handleBlocksInfoUpdate", value: function handleBlocksInfoUpdate(blocksInfo) { // @todo Later we should replace this to avoid all the warnings from redefining blocks. this.handleExtensionAdded(blocksInfo); } }, { key: "handleCategorySelected", value: function handleCategorySelected(categoryId) { var _this7 = this; var extension = _lib_libraries_extensions_index_jsx__WEBPACK_IMPORTED_MODULE_12__["default"].find(function (ext) { return ext.extensionId === categoryId; }); if (extension && extension.launchPeripheralConnectionFlow) { this.handleConnectionModalStart(categoryId); } this.withToolboxUpdates(function () { _this7.workspace.toolbox_.setSelectedCategoryById(categoryId); }); } }, { key: "setBlocks", value: function setBlocks(blocks) { this.blocks = blocks; } }, { key: "handlePromptStart", value: function handlePromptStart(message, defaultValue, callback, optTitle, optVarType) { var p = { prompt: { callback: callback, message: message, defaultValue: defaultValue } }; p.prompt.title = optTitle ? optTitle : this.ScratchBlocks.Msg.VARIABLE_MODAL_TITLE; p.prompt.varType = typeof optVarType === 'string' ? optVarType : this.ScratchBlocks.SCALAR_VARIABLE_TYPE; p.prompt.showVariableOptions = // This flag means that we should show variable/list options about scope optVarType !== this.ScratchBlocks.BROADCAST_MESSAGE_VARIABLE_TYPE && p.prompt.title !== this.ScratchBlocks.Msg.RENAME_VARIABLE_MODAL_TITLE && p.prompt.title !== this.ScratchBlocks.Msg.RENAME_LIST_MODAL_TITLE; p.prompt.showCloudOption = optVarType === this.ScratchBlocks.SCALAR_VARIABLE_TYPE && this.props.canUseCloud; this.setState(p); } }, { key: "handleConnectionModalStart", value: function handleConnectionModalStart(extensionId) { this.props.onOpenConnectionModal(extensionId); } }, { key: "handleStatusButtonUpdate", value: function handleStatusButtonUpdate() { this.ScratchBlocks.refreshStatusButtons(this.workspace); } }, { key: "handleOpenSoundRecorder", value: function handleOpenSoundRecorder() { this.props.onOpenSoundRecorder(); } /* * Pass along information about proposed name and variable options (scope and isCloud) * and additional potentially conflicting variable names from the VM * to the variable validation prompt callback used in scratch-blocks. */ }, { key: "handlePromptCallback", value: function handlePromptCallback(input, variableOptions) { this.state.prompt.callback(input, this.props.vm.runtime.getAllVarNamesOfType(this.state.prompt.varType), variableOptions); this.handlePromptClose(); } }, { key: "handlePromptClose", value: function handlePromptClose() { this.setState({ prompt: null }); } }, { key: "handleCustomProceduresClose", value: function handleCustomProceduresClose(data) { this.props.onRequestCloseCustomProcedures(data); var ws = this.workspace; ws.refreshToolboxSelection_(); ws.toolbox_.scrollToCategoryById('myBlocks'); } }, { key: "handleDrop", value: function handleDrop(dragInfo) { var _this8 = this; fetch(dragInfo.payload.bodyUrl).then(function (response) { return response.json(); }).then(function (blocks) { return _this8.props.vm.shareBlocksToTarget(blocks, _this8.props.vm.editingTarget.id); }).then(function () { _this8.props.vm.refreshWorkspace(); _this8.updateToolbox(); // To show new variables/custom blocks }); } }, { key: "render", value: function render() { /* eslint-disable no-unused-vars */ var _this$props = this.props, anyModalVisible = _this$props.anyModalVisible, canUseCloud = _this$props.canUseCloud, customProceduresVisible = _this$props.customProceduresVisible, extensionLibraryVisible = _this$props.extensionLibraryVisible, options = _this$props.options, stageSize = _this$props.stageSize, vm = _this$props.vm, isRtl = _this$props.isRtl, isVisible = _this$props.isVisible, onActivateColorPicker = _this$props.onActivateColorPicker, onOpenConnectionModal = _this$props.onOpenConnectionModal, onOpenSoundRecorder = _this$props.onOpenSoundRecorder, updateToolboxState = _this$props.updateToolboxState, onActivateCustomProcedures = _this$props.onActivateCustomProcedures, onRequestCloseExtensionLibrary = _this$props.onRequestCloseExtensionLibrary, onRequestCloseCustomProcedures = _this$props.onRequestCloseCustomProcedures, toolboxXML = _this$props.toolboxXML, props = _objectWithoutProperties(_this$props, ["anyModalVisible", "canUseCloud", "customProceduresVisible", "extensionLibraryVisible", "options", "stageSize", "vm", "isRtl", "isVisible", "onActivateColorPicker", "onOpenConnectionModal", "onOpenSoundRecorder", "updateToolboxState", "onActivateCustomProcedures", "onRequestCloseExtensionLibrary", "onRequestCloseCustomProcedures", "toolboxXML"]); /* eslint-enable no-unused-vars */ return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_5___default.a.Fragment, null, react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(DroppableBlocks, _extends({ componentRef: this.setBlocks, onDrop: this.handleDrop }, props)), this.state.prompt ? react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_prompt_jsx__WEBPACK_IMPORTED_MODULE_9__["default"], { defaultValue: this.state.prompt.defaultValue, isStage: vm.runtime.getEditingTarget().isStage, label: this.state.prompt.message, showCloudOption: this.state.prompt.showCloudOption, showVariableOptions: this.state.prompt.showVariableOptions, title: this.state.prompt.title, vm: vm, onCancel: this.handlePromptClose, onOk: this.handlePromptCallback }) : null, extensionLibraryVisible ? react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_extension_library_jsx__WEBPACK_IMPORTED_MODULE_11__["default"], { vm: vm, onCategorySelected: this.handleCategorySelected, onRequestClose: onRequestCloseExtensionLibrary }) : null, customProceduresVisible ? react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_custom_procedures_jsx__WEBPACK_IMPORTED_MODULE_13__["default"], { options: { media: options.media }, onRequestClose: this.handleCustomProceduresClose }) : null); } }]); return Blocks; }(react__WEBPACK_IMPORTED_MODULE_5___default.a.Component); Blocks.propTypes = { anyModalVisible: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, canUseCloud: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, customProceduresVisible: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, extensionLibraryVisible: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, isRtl: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, isVisible: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, locale: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.string.isRequired, messages: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.objectOf(prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.string), onActivateColorPicker: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, onActivateCustomProcedures: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, onOpenConnectionModal: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, onOpenSoundRecorder: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, onRequestCloseCustomProcedures: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, onRequestCloseExtensionLibrary: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, options: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.shape({ media: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.string, zoom: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.shape({ controls: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, wheel: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, startScale: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.number }), colours: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.shape({ workspace: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.string, flyout: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.string, toolbox: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.string, toolboxSelected: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.string, scrollbar: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.string, scrollbarHover: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.string, insertionMarker: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.string, insertionMarkerOpacity: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.number, fieldShadow: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.string, dragShadowOpacity: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.number }), comments: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, collapse: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool }), stageSize: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.oneOf(Object.keys(_lib_layout_constants__WEBPACK_IMPORTED_MODULE_15__["STAGE_DISPLAY_SIZES"])).isRequired, toolboxXML: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.string, updateToolboxState: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, vm: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.instanceOf(scratch_vm__WEBPACK_IMPORTED_MODULE_7___default.a).isRequired }; Blocks.defaultOptions = { zoom: { controls: true, wheel: true, startScale: 0.675 }, grid: { spacing: 40, length: 2, colour: '#ddd' }, colours: { workspace: '#F9F9F9', flyout: '#F9F9F9', toolbox: '#FFFFFF', toolboxSelected: '#E9EEF2', scrollbar: '#CECDCE', scrollbarHover: '#CECDCE', insertionMarker: '#000000', insertionMarkerOpacity: 0.2, fieldShadow: 'rgba(255, 255, 255, 0.3)', dragShadowOpacity: 0.6 }, comments: true, collapse: false, sounds: false }; Blocks.defaultProps = { isVisible: true, options: Blocks.defaultOptions }; var mapStateToProps = function mapStateToProps(state) { return { anyModalVisible: Object.keys(state.scratchGui.modals).some(function (key) { return state.scratchGui.modals[key]; }) || state.scratchGui.mode.isFullScreen, extensionLibraryVisible: state.scratchGui.modals.extensionLibrary, isRtl: state.locales.isRtl, locale: state.locales.locale, messages: state.locales.messages, toolboxXML: state.scratchGui.toolbox.toolboxXML, customProceduresVisible: state.scratchGui.customProcedures.active }; }; var mapDispatchToProps = function mapDispatchToProps(dispatch) { return { onActivateColorPicker: function onActivateColorPicker(callback) { return dispatch(Object(_reducers_color_picker__WEBPACK_IMPORTED_MODULE_20__["activateColorPicker"])(callback)); }, onActivateCustomProcedures: function onActivateCustomProcedures(data, callback) { return dispatch(Object(_reducers_custom_procedures__WEBPACK_IMPORTED_MODULE_22__["activateCustomProcedures"])(data, callback)); }, onOpenConnectionModal: function onOpenConnectionModal(id) { dispatch(Object(_reducers_connection_modal__WEBPACK_IMPORTED_MODULE_23__["setConnectionModalExtensionId"])(id)); dispatch(Object(_reducers_modals__WEBPACK_IMPORTED_MODULE_21__["openConnectionModal"])()); }, onOpenSoundRecorder: function onOpenSoundRecorder() { dispatch(Object(_reducers_editor_tab__WEBPACK_IMPORTED_MODULE_24__["activateTab"])(_reducers_editor_tab__WEBPACK_IMPORTED_MODULE_24__["SOUNDS_TAB_INDEX"])); dispatch(Object(_reducers_modals__WEBPACK_IMPORTED_MODULE_21__["openSoundRecorder"])()); }, onRequestCloseExtensionLibrary: function onRequestCloseExtensionLibrary() { dispatch(Object(_reducers_modals__WEBPACK_IMPORTED_MODULE_21__["closeExtensionLibrary"])()); }, onRequestCloseCustomProcedures: function onRequestCloseCustomProcedures(data) { dispatch(Object(_reducers_custom_procedures__WEBPACK_IMPORTED_MODULE_22__["deactivateCustomProcedures"])(data)); }, updateToolboxState: function updateToolboxState(toolboxXML) { dispatch(Object(_reducers_toolbox__WEBPACK_IMPORTED_MODULE_19__["updateToolbox"])(toolboxXML)); } }; }; /* harmony default export */ __webpack_exports__["default"] = (Object(_lib_error_boundary_hoc_jsx__WEBPACK_IMPORTED_MODULE_14__["default"])('Blocks')(Object(react_redux__WEBPACK_IMPORTED_MODULE_18__["connect"])(mapStateToProps, mapDispatchToProps)(Blocks))); /***/ }), /***/ "./src/containers/camera-modal.jsx": /*!*****************************************!*\ !*** ./src/containers/camera-modal.jsx ***! \*****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _components_camera_modal_camera_modal_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../components/camera-modal/camera-modal.jsx */ "./src/components/camera-modal/camera-modal.jsx"); /* harmony import */ var _lib_video_modal_video_manager_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../lib/video/modal-video-manager.js */ "./src/lib/video/modal-video-manager.js"); /* harmony import */ var _reducers_modals__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../reducers/modals */ "./src/reducers/modals.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var CameraModal = /*#__PURE__*/ function (_React$Component) { _inherits(CameraModal, _React$Component); function CameraModal(props) { var _this; _classCallCheck(this, CameraModal); _this = _possibleConstructorReturn(this, _getPrototypeOf(CameraModal).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['handleAccess', 'handleBack', 'handleCancel', 'handleCapture', 'handleLoaded', 'handleSubmit', 'setCanvas']); _this.video = null; _this.videoDevice = null; _this.state = { capture: null, access: false, loaded: false }; return _this; } _createClass(CameraModal, [{ key: "componentWillUnmount", value: function componentWillUnmount() { if (this.videoDevice) { this.videoDevice.disableVideo(); } } }, { key: "handleAccess", value: function handleAccess() { this.setState({ access: true }); } }, { key: "handleLoaded", value: function handleLoaded() { this.setState({ loaded: true }); } }, { key: "handleBack", value: function handleBack() { this.setState({ capture: null }); this.videoDevice.clearSnapshot(); } }, { key: "handleCapture", value: function handleCapture() { if (this.state.loaded) { var capture = this.videoDevice.takeSnapshot(); this.setState({ capture: capture }); } } }, { key: "setCanvas", value: function setCanvas(canvas) { this.canvas = canvas; if (this.canvas) { this.videoDevice = new _lib_video_modal_video_manager_js__WEBPACK_IMPORTED_MODULE_5__["default"](this.canvas); this.videoDevice.enableVideo(this.handleAccess, this.handleLoaded); } } }, { key: "handleSubmit", value: function handleSubmit() { if (!this.state.capture) return; this.props.onNewCostume(this.state.capture); this.props.onClose(); } }, { key: "handleCancel", value: function handleCancel() { this.props.onClose(); } }, { key: "render", value: function render() { return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_components_camera_modal_camera_modal_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { access: this.state.access, canvasRef: this.setCanvas, capture: this.state.capture, loaded: this.state.loaded, onBack: this.handleBack, onCancel: this.handleCancel, onCapture: this.handleCapture, onSubmit: this.handleSubmit }); } }]); return CameraModal; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.Component); CameraModal.propTypes = { onClose: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onNewCostume: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func }; var mapStateToProps = function mapStateToProps() { return {}; }; var mapDispatchToProps = function mapDispatchToProps(dispatch) { return { onClose: function onClose() { dispatch(Object(_reducers_modals__WEBPACK_IMPORTED_MODULE_6__["closeCameraCapture"])()); } }; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_redux__WEBPACK_IMPORTED_MODULE_3__["connect"])(mapStateToProps, mapDispatchToProps)(CameraModal)); /***/ }), /***/ "./src/containers/cards.jsx": /*!**********************************!*\ !*** ./src/containers/cards.jsx ***! \**********************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _reducers_cards__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../reducers/cards */ "./src/reducers/cards.js"); /* harmony import */ var _reducers_modals__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../reducers/modals */ "./src/reducers/modals.js"); /* harmony import */ var _components_cards_cards_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../components/cards/cards.jsx */ "./src/components/cards/cards.jsx"); /* harmony import */ var _lib_libraries_decks_translate_image_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lib/libraries/decks/translate-image.js */ "./src/lib/libraries/decks/translate-image.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var Cards = /*#__PURE__*/ function (_React$Component) { _inherits(Cards, _React$Component); function Cards() { _classCallCheck(this, Cards); return _possibleConstructorReturn(this, _getPrototypeOf(Cards).apply(this, arguments)); } _createClass(Cards, [{ key: "componentDidMount", value: function componentDidMount() { if (this.props.locale !== 'en') { Object(_lib_libraries_decks_translate_image_js__WEBPACK_IMPORTED_MODULE_6__["loadImageData"])(this.props.locale); } } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (this.props.locale !== prevProps.locale) { Object(_lib_libraries_decks_translate_image_js__WEBPACK_IMPORTED_MODULE_6__["loadImageData"])(this.props.locale); } } }, { key: "render", value: function render() { return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_components_cards_cards_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], this.props); } }]); return Cards; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.Component); Cards.propTypes = { locale: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string.isRequired }; var mapStateToProps = function mapStateToProps(state) { return { visible: state.scratchGui.cards.visible, content: state.scratchGui.cards.content, activeDeckId: state.scratchGui.cards.activeDeckId, step: state.scratchGui.cards.step, expanded: state.scratchGui.cards.expanded, x: state.scratchGui.cards.x, y: state.scratchGui.cards.y, isRtl: state.locales.isRtl, locale: state.locales.locale, dragging: state.scratchGui.cards.dragging }; }; var mapDispatchToProps = function mapDispatchToProps(dispatch) { return { onActivateDeckFactory: function onActivateDeckFactory(id) { return function () { return dispatch(Object(_reducers_cards__WEBPACK_IMPORTED_MODULE_3__["activateDeck"])(id)); }; }, onShowAll: function onShowAll() { dispatch(Object(_reducers_modals__WEBPACK_IMPORTED_MODULE_4__["openTipsLibrary"])()); dispatch(Object(_reducers_cards__WEBPACK_IMPORTED_MODULE_3__["closeCards"])()); }, onCloseCards: function onCloseCards() { return dispatch(Object(_reducers_cards__WEBPACK_IMPORTED_MODULE_3__["closeCards"])()); }, onShrinkExpandCards: function onShrinkExpandCards() { return dispatch(Object(_reducers_cards__WEBPACK_IMPORTED_MODULE_3__["shrinkExpandCards"])()); }, onNextStep: function onNextStep() { return dispatch(Object(_reducers_cards__WEBPACK_IMPORTED_MODULE_3__["nextStep"])()); }, onPrevStep: function onPrevStep() { return dispatch(Object(_reducers_cards__WEBPACK_IMPORTED_MODULE_3__["prevStep"])()); }, onDrag: function onDrag(e_, data) { return dispatch(Object(_reducers_cards__WEBPACK_IMPORTED_MODULE_3__["dragCard"])(data.x, data.y)); }, onStartDrag: function onStartDrag() { return dispatch(Object(_reducers_cards__WEBPACK_IMPORTED_MODULE_3__["startDrag"])()); }, onEndDrag: function onEndDrag() { return dispatch(Object(_reducers_cards__WEBPACK_IMPORTED_MODULE_3__["endDrag"])()); } }; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_redux__WEBPACK_IMPORTED_MODULE_0__["connect"])(mapStateToProps, mapDispatchToProps)(Cards)); /***/ }), /***/ "./src/containers/connection-modal.jsx": /*!*********************************************!*\ !*** ./src/containers/connection-modal.jsx ***! \*********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _components_connection_modal_connection_modal_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/connection-modal/connection-modal.jsx */ "./src/components/connection-modal/connection-modal.jsx"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! scratch-vm */ "./node_modules/scratch-vm/src/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(scratch_vm__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _lib_analytics__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../lib/analytics */ "./src/lib/analytics.js"); /* harmony import */ var _lib_libraries_extensions_index_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lib/libraries/extensions/index.jsx */ "./src/lib/libraries/extensions/index.jsx"); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _reducers_modals__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../reducers/modals */ "./src/reducers/modals.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var ConnectionModal = /*#__PURE__*/ function (_React$Component) { _inherits(ConnectionModal, _React$Component); function ConnectionModal(props) { var _this; _classCallCheck(this, ConnectionModal); _this = _possibleConstructorReturn(this, _getPrototypeOf(ConnectionModal).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_2___default()(_assertThisInitialized(_this), ['handleScanning', 'handleCancel', 'handleConnected', 'handleConnecting', 'handleDisconnect', 'handleError', 'handleHelp']); _this.state = { extension: _lib_libraries_extensions_index_jsx__WEBPACK_IMPORTED_MODULE_6__["default"].find(function (ext) { return ext.extensionId === props.extensionId; }), phase: props.vm.getPeripheralIsConnected(props.extensionId) ? _components_connection_modal_connection_modal_jsx__WEBPACK_IMPORTED_MODULE_3__["PHASES"].connected : _components_connection_modal_connection_modal_jsx__WEBPACK_IMPORTED_MODULE_3__["PHASES"].scanning }; return _this; } _createClass(ConnectionModal, [{ key: "componentDidMount", value: function componentDidMount() { this.props.vm.on('PERIPHERAL_CONNECTED', this.handleConnected); this.props.vm.on('PERIPHERAL_REQUEST_ERROR', this.handleError); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.props.vm.removeListener('PERIPHERAL_CONNECTED', this.handleConnected); this.props.vm.removeListener('PERIPHERAL_REQUEST_ERROR', this.handleError); } }, { key: "handleScanning", value: function handleScanning() { this.setState({ phase: _components_connection_modal_connection_modal_jsx__WEBPACK_IMPORTED_MODULE_3__["PHASES"].scanning }); } }, { key: "handleConnecting", value: function handleConnecting(peripheralId) { this.props.vm.connectPeripheral(this.props.extensionId, peripheralId); this.setState({ phase: _components_connection_modal_connection_modal_jsx__WEBPACK_IMPORTED_MODULE_3__["PHASES"].connecting }); _lib_analytics__WEBPACK_IMPORTED_MODULE_5__["default"].event({ category: 'extensions', action: 'connecting', label: this.props.extensionId }); } }, { key: "handleDisconnect", value: function handleDisconnect() { try { this.props.vm.disconnectPeripheral(this.props.extensionId); } finally { this.props.onCancel(); } } }, { key: "handleCancel", value: function handleCancel() { try { // If we're not connected to a peripheral, close the websocket so we stop scanning. if (!this.props.vm.getPeripheralIsConnected(this.props.extensionId)) { this.props.vm.disconnectPeripheral(this.props.extensionId); } } finally { // Close the modal. this.props.onCancel(); } } }, { key: "handleError", value: function handleError() { // Assume errors that come in during scanning phase are the result of not // having scratch-link installed. if (this.state.phase === _components_connection_modal_connection_modal_jsx__WEBPACK_IMPORTED_MODULE_3__["PHASES"].scanning || this.state.phase === _components_connection_modal_connection_modal_jsx__WEBPACK_IMPORTED_MODULE_3__["PHASES"].unavailable) { this.setState({ phase: _components_connection_modal_connection_modal_jsx__WEBPACK_IMPORTED_MODULE_3__["PHASES"].unavailable }); } else { this.setState({ phase: _components_connection_modal_connection_modal_jsx__WEBPACK_IMPORTED_MODULE_3__["PHASES"].error }); _lib_analytics__WEBPACK_IMPORTED_MODULE_5__["default"].event({ category: 'extensions', action: 'connecting error', label: this.props.extensionId }); } } }, { key: "handleConnected", value: function handleConnected() { this.setState({ phase: _components_connection_modal_connection_modal_jsx__WEBPACK_IMPORTED_MODULE_3__["PHASES"].connected }); _lib_analytics__WEBPACK_IMPORTED_MODULE_5__["default"].event({ category: 'extensions', action: 'connected', label: this.props.extensionId }); } }, { key: "handleHelp", value: function handleHelp() { window.open(this.state.extension.helpLink, '_blank'); _lib_analytics__WEBPACK_IMPORTED_MODULE_5__["default"].event({ category: 'extensions', action: 'help', label: this.props.extensionId }); } }, { key: "render", value: function render() { return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_components_connection_modal_connection_modal_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { connectingMessage: this.state.extension && this.state.extension.connectingMessage, connectionIconURL: this.state.extension && this.state.extension.connectionIconURL, connectionSmallIconURL: this.state.extension && this.state.extension.connectionSmallIconURL, connectionTipIconURL: this.state.extension && this.state.extension.connectionTipIconURL, extensionId: this.props.extensionId, name: this.state.extension && this.state.extension.name, phase: this.state.phase, title: this.props.extensionId, useAutoScan: this.state.extension && this.state.extension.useAutoScan, vm: this.props.vm, onCancel: this.handleCancel, onConnected: this.handleConnected, onConnecting: this.handleConnecting, onDisconnect: this.handleDisconnect, onHelp: this.handleHelp, onScanning: this.handleScanning }); } }]); return ConnectionModal; }(react__WEBPACK_IMPORTED_MODULE_1___default.a.Component); ConnectionModal.propTypes = { extensionId: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string.isRequired, onCancel: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, vm: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.instanceOf(scratch_vm__WEBPACK_IMPORTED_MODULE_4___default.a).isRequired }; var mapStateToProps = function mapStateToProps(state) { return { extensionId: state.scratchGui.connectionModal.extensionId }; }; var mapDispatchToProps = function mapDispatchToProps(dispatch) { return { onCancel: function onCancel() { dispatch(Object(_reducers_modals__WEBPACK_IMPORTED_MODULE_8__["closeConnectionModal"])()); } }; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_redux__WEBPACK_IMPORTED_MODULE_7__["connect"])(mapStateToProps, mapDispatchToProps)(ConnectionModal)); /***/ }), /***/ "./src/containers/controls.jsx": /*!*************************************!*\ !*** ./src/containers/controls.jsx ***! \*************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! scratch-vm */ "./node_modules/scratch-vm/src/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(scratch_vm__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _components_controls_controls_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../components/controls/controls.jsx */ "./src/components/controls/controls.jsx"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var Controls = /*#__PURE__*/ function (_React$Component) { _inherits(Controls, _React$Component); function Controls(props) { var _this; _classCallCheck(this, Controls); _this = _possibleConstructorReturn(this, _getPrototypeOf(Controls).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['handleGreenFlagClick', 'handleStopAllClick']); return _this; } _createClass(Controls, [{ key: "handleGreenFlagClick", value: function handleGreenFlagClick(e) { e.preventDefault(); if (e.shiftKey) { this.props.vm.setTurboMode(!this.props.turbo); } else { if (!this.props.isStarted) { this.props.vm.start(); } this.props.vm.greenFlag(); } } }, { key: "handleStopAllClick", value: function handleStopAllClick(e) { e.preventDefault(); this.props.vm.stopAll(); } }, { key: "render", value: function render() { var _this$props = this.props, vm = _this$props.vm, isStarted = _this$props.isStarted, projectRunning = _this$props.projectRunning, turbo = _this$props.turbo, props = _objectWithoutProperties(_this$props, ["vm", "isStarted", "projectRunning", "turbo"]); return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_components_controls_controls_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], _extends({}, props, { active: projectRunning, turbo: turbo, onGreenFlagClick: this.handleGreenFlagClick, onStopAllClick: this.handleStopAllClick })); } }]); return Controls; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.Component); Controls.propTypes = { isStarted: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool.isRequired, projectRunning: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool.isRequired, turbo: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool.isRequired, vm: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.instanceOf(scratch_vm__WEBPACK_IMPORTED_MODULE_3___default.a) }; var mapStateToProps = function mapStateToProps(state) { return { isStarted: state.scratchGui.vmStatus.running, projectRunning: state.scratchGui.vmStatus.running, turbo: state.scratchGui.vmStatus.turbo }; }; // no-op function to prevent dispatch prop being passed to component var mapDispatchToProps = function mapDispatchToProps() { return {}; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_redux__WEBPACK_IMPORTED_MODULE_4__["connect"])(mapStateToProps, mapDispatchToProps)(Controls)); /***/ }), /***/ "./src/containers/costume-library.jsx": /*!********************************************!*\ !*** ./src/containers/costume-library.jsx ***! \********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! scratch-vm */ "./node_modules/scratch-vm/src/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(scratch_vm__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _lib_libraries_costumes_json__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../lib/libraries/costumes.json */ "./src/lib/libraries/costumes.json"); var _lib_libraries_costumes_json__WEBPACK_IMPORTED_MODULE_5___namespace = /*#__PURE__*/__webpack_require__.t(/*! ../lib/libraries/costumes.json */ "./src/lib/libraries/costumes.json", 1); /* harmony import */ var _lib_libraries_sprite_tags__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lib/libraries/sprite-tags */ "./src/lib/libraries/sprite-tags.js"); /* harmony import */ var _components_library_library_jsx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../components/library/library.jsx */ "./src/components/library/library.jsx"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_3__["defineMessages"])({ libraryTitle: { "id": "gui.costumeLibrary.chooseACostume", "defaultMessage": "Choose a Costume" } }); var CostumeLibrary = /*#__PURE__*/ function (_React$PureComponent) { _inherits(CostumeLibrary, _React$PureComponent); function CostumeLibrary(props) { var _this; _classCallCheck(this, CostumeLibrary); _this = _possibleConstructorReturn(this, _getPrototypeOf(CostumeLibrary).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['handleItemSelected']); return _this; } _createClass(CostumeLibrary, [{ key: "handleItemSelected", value: function handleItemSelected(item) { var split = item.md5.split('.'); var type = split.length > 1 ? split[1] : null; var rotationCenterX = type === 'svg' ? item.info[0] : item.info[0] / 2; var rotationCenterY = type === 'svg' ? item.info[1] : item.info[1] / 2; var vmCostume = { name: item.name, rotationCenterX: rotationCenterX, rotationCenterY: rotationCenterY, bitmapResolution: item.info.length > 2 ? item.info[2] : 1, skinId: null }; this.props.vm.addCostumeFromLibrary(item.md5, vmCostume); } }, { key: "render", value: function render() { return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_components_library_library_jsx__WEBPACK_IMPORTED_MODULE_7__["default"], { data: _lib_libraries_costumes_json__WEBPACK_IMPORTED_MODULE_5__, id: "costumeLibrary", tags: _lib_libraries_sprite_tags__WEBPACK_IMPORTED_MODULE_6__["default"], title: this.props.intl.formatMessage(messages.libraryTitle), onItemSelected: this.handleItemSelected, onRequestClose: this.props.onRequestClose }); } }]); return CostumeLibrary; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.PureComponent); CostumeLibrary.propTypes = { intl: react_intl__WEBPACK_IMPORTED_MODULE_3__["intlShape"].isRequired, onRequestClose: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, vm: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.instanceOf(scratch_vm__WEBPACK_IMPORTED_MODULE_4___default.a).isRequired }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_3__["injectIntl"])(CostumeLibrary)); /***/ }), /***/ "./src/containers/costume-tab.jsx": /*!****************************************!*\ !*** ./src/containers/costume-tab.jsx ***! \****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! scratch-vm */ "./node_modules/scratch-vm/src/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(scratch_vm__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _components_asset_panel_asset_panel_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../components/asset-panel/asset-panel.jsx */ "./src/components/asset-panel/asset-panel.jsx"); /* harmony import */ var _paint_editor_wrapper_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./paint-editor-wrapper.jsx */ "./src/containers/paint-editor-wrapper.jsx"); /* harmony import */ var _camera_modal_jsx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./camera-modal.jsx */ "./src/containers/camera-modal.jsx"); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _lib_file_uploader_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../lib/file-uploader.js */ "./src/lib/file-uploader.js"); /* harmony import */ var _lib_error_boundary_hoc_jsx__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../lib/error-boundary-hoc.jsx */ "./src/lib/error-boundary-hoc.jsx"); /* harmony import */ var _lib_drag_constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../lib/drag-constants */ "./src/lib/drag-constants.js"); /* harmony import */ var _lib_empty_assets__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../lib/empty-assets */ "./src/lib/empty-assets.js"); /* harmony import */ var _lib_shared_messages__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../lib/shared-messages */ "./src/lib/shared-messages.js"); /* harmony import */ var _lib_download_blob__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../lib/download-blob */ "./src/lib/download-blob.js"); /* harmony import */ var _reducers_modals__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../reducers/modals */ "./src/reducers/modals.js"); /* harmony import */ var _reducers_editor_tab__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../reducers/editor-tab */ "./src/reducers/editor-tab.js"); /* harmony import */ var _reducers_restore_deletion__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../reducers/restore-deletion */ "./src/reducers/restore-deletion.js"); /* harmony import */ var _reducers_alerts__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../reducers/alerts */ "./src/reducers/alerts.js"); /* harmony import */ var _components_asset_panel_icon_add_backdrop_lib_svg__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../components/asset-panel/icon--add-backdrop-lib.svg */ "./src/components/asset-panel/icon--add-backdrop-lib.svg"); /* harmony import */ var _components_asset_panel_icon_add_backdrop_lib_svg__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(_components_asset_panel_icon_add_backdrop_lib_svg__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var _components_asset_panel_icon_add_costume_lib_svg__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../components/asset-panel/icon--add-costume-lib.svg */ "./src/components/asset-panel/icon--add-costume-lib.svg"); /* harmony import */ var _components_asset_panel_icon_add_costume_lib_svg__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(_components_asset_panel_icon_add_costume_lib_svg__WEBPACK_IMPORTED_MODULE_20__); /* harmony import */ var _components_action_menu_icon_file_upload_svg__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../components/action-menu/icon--file-upload.svg */ "./src/components/action-menu/icon--file-upload.svg"); /* harmony import */ var _components_action_menu_icon_file_upload_svg__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(_components_action_menu_icon_file_upload_svg__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var _components_action_menu_icon_paint_svg__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../components/action-menu/icon--paint.svg */ "./src/components/action-menu/icon--paint.svg"); /* harmony import */ var _components_action_menu_icon_paint_svg__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(_components_action_menu_icon_paint_svg__WEBPACK_IMPORTED_MODULE_22__); /* harmony import */ var _components_action_menu_icon_camera_svg__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../components/action-menu/icon--camera.svg */ "./src/components/action-menu/icon--camera.svg"); /* harmony import */ var _components_action_menu_icon_camera_svg__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(_components_action_menu_icon_camera_svg__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var _components_action_menu_icon_surprise_svg__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../components/action-menu/icon--surprise.svg */ "./src/components/action-menu/icon--surprise.svg"); /* harmony import */ var _components_action_menu_icon_surprise_svg__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(_components_action_menu_icon_surprise_svg__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var _components_action_menu_icon_search_svg__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../components/action-menu/icon--search.svg */ "./src/components/action-menu/icon--search.svg"); /* harmony import */ var _components_action_menu_icon_search_svg__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(_components_action_menu_icon_search_svg__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var _lib_libraries_costumes_json__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../lib/libraries/costumes.json */ "./src/lib/libraries/costumes.json"); var _lib_libraries_costumes_json__WEBPACK_IMPORTED_MODULE_26___namespace = /*#__PURE__*/__webpack_require__.t(/*! ../lib/libraries/costumes.json */ "./src/lib/libraries/costumes.json", 1); /* harmony import */ var _lib_libraries_backdrops_json__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../lib/libraries/backdrops.json */ "./src/lib/libraries/backdrops.json"); var _lib_libraries_backdrops_json__WEBPACK_IMPORTED_MODULE_27___namespace = /*#__PURE__*/__webpack_require__.t(/*! ../lib/libraries/backdrops.json */ "./src/lib/libraries/backdrops.json", 1); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_3__["defineMessages"])({ addLibraryBackdropMsg: { "id": "gui.costumeTab.addBackdropFromLibrary", "defaultMessage": "Choose a Backdrop" }, addLibraryCostumeMsg: { "id": "gui.costumeTab.addCostumeFromLibrary", "defaultMessage": "Choose a Costume" }, addBlankCostumeMsg: { "id": "gui.costumeTab.addBlankCostume", "defaultMessage": "Paint" }, addSurpriseCostumeMsg: { "id": "gui.costumeTab.addSurpriseCostume", "defaultMessage": "Surprise" }, addFileBackdropMsg: { "id": "gui.costumeTab.addFileBackdrop", "defaultMessage": "Upload Backdrop" }, addFileCostumeMsg: { "id": "gui.costumeTab.addFileCostume", "defaultMessage": "Upload Costume" }, addCameraCostumeMsg: { "id": "gui.costumeTab.addCameraCostume", "defaultMessage": "Camera" } }); messages = _objectSpread({}, messages, _lib_shared_messages__WEBPACK_IMPORTED_MODULE_13__["default"]); var CostumeTab = /*#__PURE__*/ function (_React$Component) { _inherits(CostumeTab, _React$Component); function CostumeTab(props) { var _this; _classCallCheck(this, CostumeTab); _this = _possibleConstructorReturn(this, _getPrototypeOf(CostumeTab).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_2___default()(_assertThisInitialized(_this), ['handleSelectCostume', 'handleDeleteCostume', 'handleDuplicateCostume', 'handleExportCostume', 'handleNewCostume', 'handleNewBlankCostume', 'handleSurpriseCostume', 'handleSurpriseBackdrop', 'handleFileUploadClick', 'handleCostumeUpload', 'handleCameraBuffer', 'handleDrop', 'setFileInput']); var editingTarget = props.editingTarget, sprites = props.sprites, stage = props.stage; var target = editingTarget && sprites[editingTarget] ? sprites[editingTarget] : stage; if (target && target.currentCostume) { _this.state = { selectedCostumeIndex: target.currentCostume }; } else { _this.state = { selectedCostumeIndex: 0 }; } return _this; } _createClass(CostumeTab, [{ key: "componentWillReceiveProps", value: function componentWillReceiveProps(nextProps) { var editingTarget = nextProps.editingTarget, sprites = nextProps.sprites, stage = nextProps.stage; var target = editingTarget && sprites[editingTarget] ? sprites[editingTarget] : stage; if (!target || !target.costumes) { return; } if (this.props.editingTarget === editingTarget) { // If costumes have been added or removed, change costumes to the editing target's // current costume. var oldTarget = this.props.sprites[editingTarget] ? this.props.sprites[editingTarget] : this.props.stage; // @todo: Find and switch to the index of the costume that is new. This is blocked by // https://github.com/LLK/scratch-vm/issues/967 // Right now, you can land on the wrong costume if a costume changing script is running. if (oldTarget.costumeCount !== target.costumeCount) { this.setState({ selectedCostumeIndex: target.currentCostume }); } } else { // If switching editing targets, update the costume index this.setState({ selectedCostumeIndex: target.currentCostume }); } } }, { key: "handleSelectCostume", value: function handleSelectCostume(costumeIndex) { this.props.vm.editingTarget.setCostume(costumeIndex); this.setState({ selectedCostumeIndex: costumeIndex }); } }, { key: "handleDeleteCostume", value: function handleDeleteCostume(costumeIndex) { var restoreCostumeFun = this.props.vm.deleteCostume(costumeIndex); this.props.dispatchUpdateRestore({ restoreFun: restoreCostumeFun, deletedItem: 'Costume' }); } }, { key: "handleDuplicateCostume", value: function handleDuplicateCostume(costumeIndex) { this.props.vm.duplicateCostume(costumeIndex); } }, { key: "handleExportCostume", value: function handleExportCostume(costumeIndex) { var item = this.props.vm.editingTarget.sprite.costumes[costumeIndex]; var blob = new Blob([item.asset.data], { type: item.asset.assetType.contentType }); Object(_lib_download_blob__WEBPACK_IMPORTED_MODULE_14__["default"])("".concat(item.name, ".").concat(item.asset.dataFormat), blob); } }, { key: "handleNewCostume", value: function handleNewCostume(costume, fromCostumeLibrary) { var _this2 = this; var costumes = Array.isArray(costume) ? costume : [costume]; return Promise.all(costumes.map(function (c) { if (fromCostumeLibrary) { return _this2.props.vm.addCostumeFromLibrary(c.md5, c); } return _this2.props.vm.addCostume(c.md5, c); })); } }, { key: "handleNewBlankCostume", value: function handleNewBlankCostume() { var name = this.props.vm.editingTarget.isStage ? this.props.intl.formatMessage(messages.backdrop, { index: 1 }) : this.props.intl.formatMessage(messages.costume, { index: 1 }); this.handleNewCostume(Object(_lib_empty_assets__WEBPACK_IMPORTED_MODULE_12__["emptyCostume"])(name)); } }, { key: "handleSurpriseCostume", value: function handleSurpriseCostume() { var item = _lib_libraries_costumes_json__WEBPACK_IMPORTED_MODULE_26__[Math.floor(Math.random() * _lib_libraries_costumes_json__WEBPACK_IMPORTED_MODULE_26__.length)]; var split = item.md5.split('.'); var type = split.length > 1 ? split[1] : null; var rotationCenterX = type === 'svg' ? item.info[0] : item.info[0] / 2; var rotationCenterY = type === 'svg' ? item.info[1] : item.info[1] / 2; var vmCostume = { name: item.name, md5: item.md5, rotationCenterX: rotationCenterX, rotationCenterY: rotationCenterY, bitmapResolution: item.info.length > 2 ? item.info[2] : 1, skinId: null }; this.handleNewCostume(vmCostume, true /* fromCostumeLibrary */ ); } }, { key: "handleSurpriseBackdrop", value: function handleSurpriseBackdrop() { var item = _lib_libraries_backdrops_json__WEBPACK_IMPORTED_MODULE_27__[Math.floor(Math.random() * _lib_libraries_backdrops_json__WEBPACK_IMPORTED_MODULE_27__.length)]; var vmCostume = { name: item.name, md5: item.md5, rotationCenterX: item.info[0] && item.info[0] / 2, rotationCenterY: item.info[1] && item.info[1] / 2, bitmapResolution: item.info.length > 2 ? item.info[2] : 1, skinId: null }; this.handleNewCostume(vmCostume); } }, { key: "handleCostumeUpload", value: function handleCostumeUpload(e) { var _this3 = this; var storage = this.props.vm.runtime.storage; this.props.onShowImporting(); Object(_lib_file_uploader_js__WEBPACK_IMPORTED_MODULE_9__["handleFileUpload"])(e.target, function (buffer, fileType, fileName, fileIndex, fileCount) { Object(_lib_file_uploader_js__WEBPACK_IMPORTED_MODULE_9__["costumeUpload"])(buffer, fileType, storage, function (vmCostumes) { vmCostumes.forEach(function (costume, i) { costume.name = "".concat(fileName).concat(i ? i + 1 : ''); }); _this3.handleNewCostume(vmCostumes).then(function () { if (fileIndex === fileCount - 1) { _this3.props.onCloseImporting(); } }); }, _this3.props.onCloseImporting); }, this.props.onCloseImporting); } }, { key: "handleCameraBuffer", value: function handleCameraBuffer(buffer) { var _this4 = this; var storage = this.props.vm.runtime.storage; Object(_lib_file_uploader_js__WEBPACK_IMPORTED_MODULE_9__["costumeUpload"])(buffer, 'image/png', storage, function (vmCostumes) { vmCostumes[0].name = _this4.props.intl.formatMessage(messages.costume, { index: 1 }); _this4.handleNewCostume(vmCostumes); }); } }, { key: "handleFileUploadClick", value: function handleFileUploadClick() { this.fileInput.click(); } }, { key: "handleDrop", value: function handleDrop(dropInfo) { if (dropInfo.dragType === _lib_drag_constants__WEBPACK_IMPORTED_MODULE_11__["default"].COSTUME) { var sprite = this.props.vm.editingTarget.sprite; var activeCostume = sprite.costumes[this.state.selectedCostumeIndex]; this.props.vm.reorderCostume(this.props.vm.editingTarget.id, dropInfo.index, dropInfo.newIndex); this.setState({ selectedCostumeIndex: sprite.costumes.indexOf(activeCostume) }); } else if (dropInfo.dragType === _lib_drag_constants__WEBPACK_IMPORTED_MODULE_11__["default"].BACKPACK_COSTUME) { this.props.vm.addCostume(dropInfo.payload.body, { name: dropInfo.payload.name }); } else if (dropInfo.dragType === _lib_drag_constants__WEBPACK_IMPORTED_MODULE_11__["default"].BACKPACK_SOUND) { this.props.onActivateSoundsTab(); this.props.vm.addSound({ md5: dropInfo.payload.body, name: dropInfo.payload.name }); } } }, { key: "setFileInput", value: function setFileInput(input) { this.fileInput = input; } }, { key: "formatCostumeDetails", value: function formatCostumeDetails(size, optResolution) { // If no resolution is given, assume that the costume is an SVG var resolution = optResolution ? optResolution : 1; // Convert size to stage units by dividing by resolution // Round up width and height for scratch-flash compatibility // https://github.com/LLK/scratch-flash/blob/9fbac92ef3d09ceca0c0782f8a08deaa79e4df69/src/ui/media/MediaInfo.as#L224-L237 return "".concat(Math.ceil(size[0] / resolution), " x ").concat(Math.ceil(size[1] / resolution)); } }, { key: "render", value: function render() { var _this5 = this; var _this$props = this.props, dispatchUpdateRestore = _this$props.dispatchUpdateRestore, intl = _this$props.intl, isRtl = _this$props.isRtl, onNewCostumeFromCameraClick = _this$props.onNewCostumeFromCameraClick, onNewLibraryBackdropClick = _this$props.onNewLibraryBackdropClick, onNewLibraryCostumeClick = _this$props.onNewLibraryCostumeClick, cameraModalVisible = _this$props.cameraModalVisible, onRequestCloseCameraModal = _this$props.onRequestCloseCameraModal, vm = _this$props.vm; if (!vm.editingTarget) { return null; } var isStage = vm.editingTarget.isStage; var target = vm.editingTarget.sprite; var addLibraryMessage = isStage ? messages.addLibraryBackdropMsg : messages.addLibraryCostumeMsg; var addFileMessage = isStage ? messages.addFileBackdropMsg : messages.addFileCostumeMsg; var addSurpriseFunc = isStage ? this.handleSurpriseBackdrop : this.handleSurpriseCostume; var addLibraryFunc = isStage ? onNewLibraryBackdropClick : onNewLibraryCostumeClick; var addLibraryIcon = isStage ? _components_asset_panel_icon_add_backdrop_lib_svg__WEBPACK_IMPORTED_MODULE_19___default.a : _components_asset_panel_icon_add_costume_lib_svg__WEBPACK_IMPORTED_MODULE_20___default.a; var costumeData = target.costumes ? target.costumes.map(function (costume) { return { name: costume.name, asset: costume.asset, details: costume.size ? _this5.formatCostumeDetails(costume.size, costume.bitmapResolution) : null, dragPayload: costume }; }) : []; return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_components_asset_panel_asset_panel_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { buttons: [{ title: intl.formatMessage(addLibraryMessage), img: addLibraryIcon, onClick: addLibraryFunc }, { title: intl.formatMessage(messages.addCameraCostumeMsg), img: _components_action_menu_icon_camera_svg__WEBPACK_IMPORTED_MODULE_23___default.a, onClick: onNewCostumeFromCameraClick }, { title: intl.formatMessage(addFileMessage), img: _components_action_menu_icon_file_upload_svg__WEBPACK_IMPORTED_MODULE_21___default.a, onClick: this.handleFileUploadClick, fileAccept: '.svg, .png, .jpg, .jpeg, .gif', fileChange: this.handleCostumeUpload, fileInput: this.setFileInput, fileMultiple: true }, { title: intl.formatMessage(messages.addSurpriseCostumeMsg), img: _components_action_menu_icon_surprise_svg__WEBPACK_IMPORTED_MODULE_24___default.a, onClick: addSurpriseFunc }, { title: intl.formatMessage(messages.addBlankCostumeMsg), img: _components_action_menu_icon_paint_svg__WEBPACK_IMPORTED_MODULE_22___default.a, onClick: this.handleNewBlankCostume }, { title: intl.formatMessage(addLibraryMessage), img: _components_action_menu_icon_search_svg__WEBPACK_IMPORTED_MODULE_25___default.a, onClick: addLibraryFunc }], dragType: _lib_drag_constants__WEBPACK_IMPORTED_MODULE_11__["default"].COSTUME, isRtl: isRtl, items: costumeData, selectedItemIndex: this.state.selectedCostumeIndex, onDeleteClick: target && target.costumes && target.costumes.length > 1 ? this.handleDeleteCostume : null, onDrop: this.handleDrop, onDuplicateClick: this.handleDuplicateCostume, onExportClick: this.handleExportCostume, onItemClick: this.handleSelectCostume }, target.costumes ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_paint_editor_wrapper_jsx__WEBPACK_IMPORTED_MODULE_6__["default"], { selectedCostumeIndex: this.state.selectedCostumeIndex }) : null, cameraModalVisible ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_camera_modal_jsx__WEBPACK_IMPORTED_MODULE_7__["default"], { onClose: onRequestCloseCameraModal, onNewCostume: this.handleCameraBuffer }) : null); } }]); return CostumeTab; }(react__WEBPACK_IMPORTED_MODULE_1___default.a.Component); CostumeTab.propTypes = { cameraModalVisible: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, dispatchUpdateRestore: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, editingTarget: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, intl: react_intl__WEBPACK_IMPORTED_MODULE_3__["intlShape"], isRtl: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, onActivateSoundsTab: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onCloseImporting: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onNewCostumeFromCameraClick: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onNewLibraryBackdropClick: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onNewLibraryCostumeClick: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onRequestCloseCameraModal: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onShowImporting: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, sprites: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({ id: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({ costumes: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({ url: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, name: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string.isRequired, skinId: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number })) }) }), stage: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({ sounds: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({ name: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string.isRequired })) }), vm: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.instanceOf(scratch_vm__WEBPACK_IMPORTED_MODULE_4___default.a) }; var mapStateToProps = function mapStateToProps(state) { return { editingTarget: state.scratchGui.targets.editingTarget, isRtl: state.locales.isRtl, sprites: state.scratchGui.targets.sprites, stage: state.scratchGui.targets.stage, dragging: state.scratchGui.assetDrag.dragging, cameraModalVisible: state.scratchGui.modals.cameraCapture }; }; var mapDispatchToProps = function mapDispatchToProps(dispatch) { return { onActivateSoundsTab: function onActivateSoundsTab() { return dispatch(Object(_reducers_editor_tab__WEBPACK_IMPORTED_MODULE_16__["activateTab"])(_reducers_editor_tab__WEBPACK_IMPORTED_MODULE_16__["SOUNDS_TAB_INDEX"])); }, onNewLibraryBackdropClick: function onNewLibraryBackdropClick(e) { e.preventDefault(); dispatch(Object(_reducers_modals__WEBPACK_IMPORTED_MODULE_15__["openBackdropLibrary"])()); }, onNewLibraryCostumeClick: function onNewLibraryCostumeClick(e) { e.preventDefault(); dispatch(Object(_reducers_modals__WEBPACK_IMPORTED_MODULE_15__["openCostumeLibrary"])()); }, onNewCostumeFromCameraClick: function onNewCostumeFromCameraClick() { dispatch(Object(_reducers_modals__WEBPACK_IMPORTED_MODULE_15__["openCameraCapture"])()); }, onRequestCloseCameraModal: function onRequestCloseCameraModal() { dispatch(Object(_reducers_modals__WEBPACK_IMPORTED_MODULE_15__["closeCameraCapture"])()); }, dispatchUpdateRestore: function dispatchUpdateRestore(restoreState) { dispatch(Object(_reducers_restore_deletion__WEBPACK_IMPORTED_MODULE_17__["setRestore"])(restoreState)); }, onCloseImporting: function onCloseImporting() { return dispatch(Object(_reducers_alerts__WEBPACK_IMPORTED_MODULE_18__["closeAlertWithId"])('importingAsset')); }, onShowImporting: function onShowImporting() { return dispatch(Object(_reducers_alerts__WEBPACK_IMPORTED_MODULE_18__["showStandardAlert"])('importingAsset')); } }; }; /* harmony default export */ __webpack_exports__["default"] = (Object(_lib_error_boundary_hoc_jsx__WEBPACK_IMPORTED_MODULE_10__["default"])('Costume Tab')(Object(react_intl__WEBPACK_IMPORTED_MODULE_3__["injectIntl"])(Object(react_redux__WEBPACK_IMPORTED_MODULE_8__["connect"])(mapStateToProps, mapDispatchToProps)(CostumeTab)))); /***/ }), /***/ "./src/containers/custom-procedures.jsx": /*!**********************************************!*\ !*** ./src/containers/custom-procedures.jsx ***! \**********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var lodash_defaultsdeep__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash.defaultsdeep */ "./node_modules/lodash.defaultsdeep/index.js"); /* harmony import */ var lodash_defaultsdeep__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaultsdeep__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _components_custom_procedures_custom_procedures_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../components/custom-procedures/custom-procedures.jsx */ "./src/components/custom-procedures/custom-procedures.jsx"); /* harmony import */ var scratch_blocks__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! scratch-blocks */ "./node_modules/scratch-blocks/shim/vertical.js"); /* harmony import */ var scratch_blocks__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(scratch_blocks__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var CustomProcedures = /*#__PURE__*/ function (_React$Component) { _inherits(CustomProcedures, _React$Component); function CustomProcedures(props) { var _this; _classCallCheck(this, CustomProcedures); _this = _possibleConstructorReturn(this, _getPrototypeOf(CustomProcedures).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['handleAddLabel', 'handleAddBoolean', 'handleAddTextNumber', 'handleToggleWarp', 'handleCancel', 'handleOk', 'setBlocks']); _this.state = { rtlOffset: 0, warp: false }; return _this; } _createClass(CustomProcedures, [{ key: "componentWillUnmount", value: function componentWillUnmount() { if (this.workspace) { this.workspace.dispose(); } } }, { key: "setBlocks", value: function setBlocks(blocksRef) { var _this2 = this; if (!blocksRef) return; this.blocks = blocksRef; var workspaceConfig = lodash_defaultsdeep__WEBPACK_IMPORTED_MODULE_1___default()({}, CustomProcedures.defaultOptions, this.props.options, { rtl: this.props.isRtl }); // @todo This is a hack to make there be no toolbox. var oldDefaultToolbox = scratch_blocks__WEBPACK_IMPORTED_MODULE_5___default.a.Blocks.defaultToolbox; scratch_blocks__WEBPACK_IMPORTED_MODULE_5___default.a.Blocks.defaultToolbox = null; this.workspace = scratch_blocks__WEBPACK_IMPORTED_MODULE_5___default.a.inject(this.blocks, workspaceConfig); scratch_blocks__WEBPACK_IMPORTED_MODULE_5___default.a.Blocks.defaultToolbox = oldDefaultToolbox; // Create the procedure declaration block for editing the mutation. this.mutationRoot = this.workspace.newBlock('procedures_declaration'); // Make the declaration immovable, undeletable and have no context menu this.mutationRoot.setMovable(false); this.mutationRoot.setDeletable(false); this.mutationRoot.contextMenu = false; this.workspace.addChangeListener(function () { _this2.mutationRoot.onChangeFn(); // Keep the block centered on the workspace var metrics = _this2.workspace.getMetrics(); var _this2$mutationRoot$g = _this2.mutationRoot.getRelativeToSurfaceXY(), x = _this2$mutationRoot$g.x, y = _this2$mutationRoot$g.y; var dy = metrics.viewHeight / 2 - _this2.mutationRoot.height / 2 - y; var dx; if (_this2.props.isRtl) { // // TODO: https://github.com/LLK/scratch-gui/issues/2838 // This is temporary until we can figure out what's going on width // block positioning on the workspace for RTL. // Workspace is always origin top-left, with x increasing to the right // Calculate initial starting offset and save it, every other move // has to take the original offset into account. // Calculate a new left postion based on new width // Convert current x position into LTR (mirror) x position (uses original offset) // Use the difference between ltrX and mirrorX as the amount to move var ltrX = metrics.viewWidth / 2 - _this2.mutationRoot.width / 2 + 25; var mirrorX = x - (x - _this2.state.rtlOffset) * 2; if (mirrorX === ltrX) { return; } dx = mirrorX - ltrX; var midPoint = metrics.viewWidth / 2; if (x === 0) { // if it's the first time positioning, it should always move right if (_this2.mutationRoot.width < midPoint) { dx = ltrX; } else if (_this2.mutationRoot.width < metrics.viewWidth) { dx = midPoint - (metrics.viewWidth - _this2.mutationRoot.width) / 2; } else { dx = midPoint + (_this2.mutationRoot.width - metrics.viewWidth); } _this2.mutationRoot.moveBy(dx, dy); _this2.setState({ rtlOffset: _this2.mutationRoot.getRelativeToSurfaceXY().x }); return; } if (_this2.mutationRoot.width > metrics.viewWidth) { dx = dx + _this2.mutationRoot.width - metrics.viewWidth; } } else { dx = metrics.viewWidth / 2 - _this2.mutationRoot.width / 2 - x; // If the procedure declaration is wider than the view width, // keep the right-hand side of the procedure in view. if (_this2.mutationRoot.width > metrics.viewWidth) { dx = metrics.viewWidth - _this2.mutationRoot.width - x; } } _this2.mutationRoot.moveBy(dx, dy); }); this.mutationRoot.domToMutation(this.props.mutator); this.mutationRoot.initSvg(); this.mutationRoot.render(); this.setState({ warp: this.mutationRoot.getWarp() }); // Allow the initial events to run to position this block, then focus. setTimeout(function () { _this2.mutationRoot.focusLastEditor_(); }); } }, { key: "handleCancel", value: function handleCancel() { this.props.onRequestClose(); } }, { key: "handleOk", value: function handleOk() { var newMutation = this.mutationRoot ? this.mutationRoot.mutationToDom(true) : null; this.props.onRequestClose(newMutation); } }, { key: "handleAddLabel", value: function handleAddLabel() { if (this.mutationRoot) { this.mutationRoot.addLabelExternal(); } } }, { key: "handleAddBoolean", value: function handleAddBoolean() { if (this.mutationRoot) { this.mutationRoot.addBooleanExternal(); } } }, { key: "handleAddTextNumber", value: function handleAddTextNumber() { if (this.mutationRoot) { this.mutationRoot.addStringNumberExternal(); } } }, { key: "handleToggleWarp", value: function handleToggleWarp() { if (this.mutationRoot) { var newWarp = !this.mutationRoot.getWarp(); this.mutationRoot.setWarp(newWarp); this.setState({ warp: newWarp }); } } }, { key: "render", value: function render() { return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_components_custom_procedures_custom_procedures_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { componentRef: this.setBlocks, warp: this.state.warp, onAddBoolean: this.handleAddBoolean, onAddLabel: this.handleAddLabel, onAddTextNumber: this.handleAddTextNumber, onCancel: this.handleCancel, onOk: this.handleOk, onToggleWarp: this.handleToggleWarp }); } }]); return CustomProcedures; }(react__WEBPACK_IMPORTED_MODULE_3___default.a.Component); CustomProcedures.propTypes = { isRtl: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, mutator: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.instanceOf(Element), onRequestClose: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func.isRequired, options: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.shape({ media: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, zoom: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.shape({ controls: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, wheel: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, startScale: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number }), comments: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, collapse: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool }) }; CustomProcedures.defaultOptions = { zoom: { controls: false, wheel: false, startScale: 0.9 }, comments: false, collapse: false, scrollbars: true }; CustomProcedures.defaultProps = { options: CustomProcedures.defaultOptions }; var mapStateToProps = function mapStateToProps(state) { return { isRtl: state.locales.isRtl, mutator: state.scratchGui.customProcedures.mutator }; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_redux__WEBPACK_IMPORTED_MODULE_6__["connect"])(mapStateToProps)(CustomProcedures)); /***/ }), /***/ "./src/containers/deletion-restorer.jsx": /*!**********************************************!*\ !*** ./src/containers/deletion-restorer.jsx ***! \**********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _reducers_restore_deletion__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../reducers/restore-deletion */ "./src/reducers/restore-deletion.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } /** * DeletionRestorer component passes a restoreDeletion function to its child. * It expects this child to be a function with the signature * function (restoreDeletion, props) {} * The component can then be used to attach deletion restoring functionality * to any other component: * * {(restoreDeletion, props) => ( * * )} */ var DeletionRestorer = /*#__PURE__*/ function (_React$Component) { _inherits(DeletionRestorer, _React$Component); function DeletionRestorer(props) { var _this; _classCallCheck(this, DeletionRestorer); _this = _possibleConstructorReturn(this, _getPrototypeOf(DeletionRestorer).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['restoreDeletion']); return _this; } _createClass(DeletionRestorer, [{ key: "restoreDeletion", value: function restoreDeletion() { if (typeof this.props.restore === 'function') { this.props.restore(); this.props.dispatchUpdateRestore({ restoreFun: null, deletedItem: '' }); } } }, { key: "render", value: function render() { var _this$props = this.props, children = _this$props.children, dispatchUpdateRestore = _this$props.dispatchUpdateRestore, props = _objectWithoutProperties(_this$props, ["children", "dispatchUpdateRestore"]); var restorable = typeof this.props.restore === 'function'; return this.props.children(this.restoreDeletion, _objectSpread({}, props, { restorable: restorable })); } }]); return DeletionRestorer; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.Component); DeletionRestorer.propTypes = { children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, deletedItem: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, dispatchUpdateRestore: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, restore: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func }; var mapStateToProps = function mapStateToProps(state) { return { deletedItem: state.scratchGui.restoreDeletion.deletedItem, restore: state.scratchGui.restoreDeletion.restoreFun }; }; var mapDispatchToProps = function mapDispatchToProps(dispatch) { return { dispatchUpdateRestore: function dispatchUpdateRestore(updatedState) { dispatch(Object(_reducers_restore_deletion__WEBPACK_IMPORTED_MODULE_4__["setRestore"])(updatedState)); } }; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_redux__WEBPACK_IMPORTED_MODULE_3__["connect"])(mapStateToProps, mapDispatchToProps)(DeletionRestorer)); /***/ }), /***/ "./src/containers/direction-picker.jsx": /*!*********************************************!*\ !*** ./src/containers/direction-picker.jsx ***! \*********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _components_direction_picker_direction_picker_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/direction-picker/direction-picker.jsx */ "./src/components/direction-picker/direction-picker.jsx"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var DirectionPicker = /*#__PURE__*/ function (_React$Component) { _inherits(DirectionPicker, _React$Component); function DirectionPicker(props) { var _this; _classCallCheck(this, DirectionPicker); _this = _possibleConstructorReturn(this, _getPrototypeOf(DirectionPicker).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['handleOpenPopover', 'handleClosePopover', 'handleClickLeftRight', 'handleClickDontRotate', 'handleClickAllAround']); _this.state = { popoverOpen: false }; return _this; } _createClass(DirectionPicker, [{ key: "handleOpenPopover", value: function handleOpenPopover() { this.setState({ popoverOpen: true }); } }, { key: "handleClosePopover", value: function handleClosePopover() { this.setState({ popoverOpen: false }); } }, { key: "handleClickAllAround", value: function handleClickAllAround() { this.props.onChangeRotationStyle(_components_direction_picker_direction_picker_jsx__WEBPACK_IMPORTED_MODULE_3__["RotationStyles"].ALL_AROUND); } }, { key: "handleClickLeftRight", value: function handleClickLeftRight() { this.props.onChangeRotationStyle(_components_direction_picker_direction_picker_jsx__WEBPACK_IMPORTED_MODULE_3__["RotationStyles"].LEFT_RIGHT); } }, { key: "handleClickDontRotate", value: function handleClickDontRotate() { this.props.onChangeRotationStyle(_components_direction_picker_direction_picker_jsx__WEBPACK_IMPORTED_MODULE_3__["RotationStyles"].DONT_ROTATE); } }, { key: "render", value: function render() { return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_components_direction_picker_direction_picker_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { direction: this.props.direction, disabled: this.props.disabled, labelAbove: this.props.labelAbove, popoverOpen: this.state.popoverOpen && !this.props.disabled, rotationStyle: this.props.rotationStyle, onChangeDirection: this.props.onChangeDirection, onClickAllAround: this.handleClickAllAround, onClickDontRotate: this.handleClickDontRotate, onClickLeftRight: this.handleClickLeftRight, onClosePopover: this.handleClosePopover, onOpenPopover: this.handleOpenPopover }); } }]); return DirectionPicker; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.Component); DirectionPicker.propTypes = { direction: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, disabled: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, labelAbove: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, onChangeDirection: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onChangeRotationStyle: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, rotationStyle: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string }; /* harmony default export */ __webpack_exports__["default"] = (DirectionPicker); /***/ }), /***/ "./src/containers/dom-element-renderer.jsx": /*!*************************************************!*\ !*** ./src/containers/dom-element-renderer.jsx ***! \*************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_omit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.omit */ "./node_modules/lodash.omit/index.js"); /* harmony import */ var lodash_omit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_omit__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var to_style__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! to-style */ "./node_modules/to-style/index.js"); /* harmony import */ var to_style__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(to_style__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var react_style_proptype__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-style-proptype */ "./node_modules/react-style-proptype/src/index.js"); /* harmony import */ var react_style_proptype__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_style_proptype__WEBPACK_IMPORTED_MODULE_4__); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } /* * DOMElementRenderer wraps a DOM element, allowing it to be * rendered by React. It's up to the containing component * to retain a reference to the element prop, or else it * will be garbage collected after unmounting. * * Props passed to the DOMElementRenderer will be set on the * DOM element like it's a normal component. */ var DOMElementRenderer = /*#__PURE__*/ function (_React$Component) { _inherits(DOMElementRenderer, _React$Component); function DOMElementRenderer(props) { var _this; _classCallCheck(this, DOMElementRenderer); _this = _possibleConstructorReturn(this, _getPrototypeOf(DOMElementRenderer).call(this, props)); _this.setContainer = _this.setContainer.bind(_assertThisInitialized(_this)); return _this; } _createClass(DOMElementRenderer, [{ key: "componentDidMount", value: function componentDidMount() { this.container.appendChild(this.props.domElement); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.container.removeChild(this.props.domElement); } }, { key: "setContainer", value: function setContainer(c) { this.container = c; } }, { key: "render", value: function render() { // Apply props to the DOM element, so its attributes // are updated as if it were a normal component. // Look at me, I'm the React now! Object.assign(this.props.domElement, lodash_omit__WEBPACK_IMPORTED_MODULE_0___default()(this.props, ['domElement', 'children', 'style'])); // Convert react style prop to dom element styling. if (this.props.style) { this.props.domElement.style.cssText = to_style__WEBPACK_IMPORTED_MODULE_3___default.a.string(this.props.style); } return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { ref: this.setContainer }); } }]); return DOMElementRenderer; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.Component); DOMElementRenderer.propTypes = { domElement: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.instanceOf(Element).isRequired, style: react_style_proptype__WEBPACK_IMPORTED_MODULE_4___default.a }; /* harmony default export */ __webpack_exports__["default"] = (DOMElementRenderer); /***/ }), /***/ "./src/containers/drag-layer.jsx": /*!***************************************!*\ !*** ./src/containers/drag-layer.jsx ***! \***************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _components_drag_layer_drag_layer_jsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/drag-layer/drag-layer.jsx */ "./src/components/drag-layer/drag-layer.jsx"); var mapStateToProps = function mapStateToProps(state) { return { dragging: state.scratchGui.assetDrag.dragging, currentOffset: state.scratchGui.assetDrag.currentOffset, img: state.scratchGui.assetDrag.img }; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_redux__WEBPACK_IMPORTED_MODULE_0__["connect"])(mapStateToProps)(_components_drag_layer_drag_layer_jsx__WEBPACK_IMPORTED_MODULE_1__["default"])); /***/ }), /***/ "./src/containers/error-boundary.jsx": /*!*******************************************!*\ !*** ./src/containers/error-boundary.jsx ***! \*******************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _components_browser_modal_browser_modal_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/browser-modal/browser-modal.jsx */ "./src/components/browser-modal/browser-modal.jsx"); /* harmony import */ var _components_crash_message_crash_message_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../components/crash-message/crash-message.jsx */ "./src/components/crash-message/crash-message.jsx"); /* harmony import */ var _lib_log_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../lib/log.js */ "./src/lib/log.js"); /* harmony import */ var _lib_supported_browser__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lib/supported-browser */ "./src/lib/supported-browser.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var ErrorBoundary = /*#__PURE__*/ function (_React$Component) { _inherits(ErrorBoundary, _React$Component); function ErrorBoundary(props) { var _this; _classCallCheck(this, ErrorBoundary); _this = _possibleConstructorReturn(this, _getPrototypeOf(ErrorBoundary).call(this, props)); _this.state = { hasError: false, errorId: null }; return _this; } _createClass(ErrorBoundary, [{ key: "componentDidCatch", value: function componentDidCatch(error, info) { var _this2 = this; // Error object may be undefined (IE?) error = error || { stack: 'Unknown stack', message: 'Unknown error' }; // Log errors to analytics, leaving out browsers that are not in our recommended set if (Object(_lib_supported_browser__WEBPACK_IMPORTED_MODULE_6__["recommendedBrowser"])() && window.Sentry) { window.Sentry.withScope(function (scope) { Object.keys(info).forEach(function (key) { scope.setExtra(key, info[key]); }); scope.setExtra('action', _this2.props.action); window.Sentry.captureException(error); }); } // Display fallback UI this.setState({ hasError: true, errorId: window.Sentry ? window.Sentry.lastEventId() : null }); // Log error locally for debugging as well. _lib_log_js__WEBPACK_IMPORTED_MODULE_5__["default"].error("Unhandled Error: ".concat(error.stack, "\nComponent stack: ").concat(info.componentStack)); } }, { key: "handleBack", value: function handleBack() { window.history.back(); } }, { key: "handleReload", value: function handleReload() { window.location.replace(window.location.origin + window.location.pathname); } }, { key: "render", value: function render() { if (this.state.hasError) { if (Object(_lib_supported_browser__WEBPACK_IMPORTED_MODULE_6__["recommendedBrowser"])()) { return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_crash_message_crash_message_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { eventId: this.state.errorId, onReload: this.handleReload }); } return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_browser_modal_browser_modal_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { error: true, isRtl: this.props.isRtl, onBack: this.handleBack }); } return this.props.children; } }]); return ErrorBoundary; }(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component); ErrorBoundary.propTypes = { action: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string.isRequired, // Used for defining tracking action children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node, isRtl: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool }; var mapStateToProps = function mapStateToProps(state) { return { isRtl: state.locales.isRtl }; }; // no-op function to prevent dispatch prop being passed to component var mapDispatchToProps = function mapDispatchToProps() { return {}; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_redux__WEBPACK_IMPORTED_MODULE_2__["connect"])(mapStateToProps, mapDispatchToProps)(ErrorBoundary)); /***/ }), /***/ "./src/containers/extension-library.jsx": /*!**********************************************!*\ !*** ./src/containers/extension-library.jsx ***! \**********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! scratch-vm */ "./node_modules/scratch-vm/src/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(scratch_vm__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _lib_libraries_extensions_index_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../lib/libraries/extensions/index.jsx */ "./src/lib/libraries/extensions/index.jsx"); /* harmony import */ var _components_library_library_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../components/library/library.jsx */ "./src/components/library/library.jsx"); /* harmony import */ var _components_action_menu_icon_sprite_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../components/action-menu/icon--sprite.svg */ "./src/components/action-menu/icon--sprite.svg"); /* harmony import */ var _components_action_menu_icon_sprite_svg__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_components_action_menu_icon_sprite_svg__WEBPACK_IMPORTED_MODULE_7__); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_4__["defineMessages"])({ extensionTitle: { "id": "gui.extensionLibrary.chooseAnExtension", "defaultMessage": "Choose an Extension" }, extensionUrl: { "id": "gui.extensionLibrary.extensionUrl", "defaultMessage": "Enter the URL of the extension" } }); var ExtensionLibrary = /*#__PURE__*/ function (_React$PureComponent) { _inherits(ExtensionLibrary, _React$PureComponent); function ExtensionLibrary(props) { var _this; _classCallCheck(this, ExtensionLibrary); _this = _possibleConstructorReturn(this, _getPrototypeOf(ExtensionLibrary).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['handleItemSelect']); return _this; } _createClass(ExtensionLibrary, [{ key: "handleItemSelect", value: function handleItemSelect(item) { var _this2 = this; var id = item.extensionId; var url = item.extensionURL ? item.extensionURL : id; if (!item.disabled && !id) { // eslint-disable-next-line no-alert url = prompt(this.props.intl.formatMessage(messages.extensionUrl)); } if (id && !item.disabled) { if (this.props.vm.extensionManager.isExtensionLoaded(url)) { this.props.onCategorySelected(id); } else { this.props.vm.extensionManager.loadExtensionURL(url).then(function () { _this2.props.onCategorySelected(id); }); } } } }, { key: "render", value: function render() { var extensionLibraryThumbnailData = _lib_libraries_extensions_index_jsx__WEBPACK_IMPORTED_MODULE_5__["default"].map(function (extension) { return _objectSpread({ rawURL: extension.iconURL || _components_action_menu_icon_sprite_svg__WEBPACK_IMPORTED_MODULE_7___default.a }, extension); }); return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_components_library_library_jsx__WEBPACK_IMPORTED_MODULE_6__["default"], { data: extensionLibraryThumbnailData, filterable: false, id: "extensionLibrary", title: this.props.intl.formatMessage(messages.extensionTitle), visible: this.props.visible, onItemSelected: this.handleItemSelect, onRequestClose: this.props.onRequestClose }); } }]); return ExtensionLibrary; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.PureComponent); ExtensionLibrary.propTypes = { intl: react_intl__WEBPACK_IMPORTED_MODULE_4__["intlShape"].isRequired, onCategorySelected: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onRequestClose: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, visible: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, vm: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.instanceOf(scratch_vm__WEBPACK_IMPORTED_MODULE_3___default.a).isRequired // eslint-disable-line react/no-unused-prop-types }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_4__["injectIntl"])(ExtensionLibrary)); /***/ }), /***/ "./src/containers/green-flag-overlay.jsx": /*!***********************************************!*\ !*** ./src/containers/green-flag-overlay.jsx ***! \***********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! scratch-vm */ "./node_modules/scratch-vm/src/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(scratch_vm__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _components_box_box_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../components/box/box.jsx */ "./src/components/box/box.jsx"); /* harmony import */ var _components_green_flag_icon_green_flag_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../components/green-flag/icon--green-flag.svg */ "./src/components/green-flag/icon--green-flag.svg"); /* harmony import */ var _components_green_flag_icon_green_flag_svg__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_components_green_flag_icon_green_flag_svg__WEBPACK_IMPORTED_MODULE_6__); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var GreenFlagOverlay = /*#__PURE__*/ function (_React$Component) { _inherits(GreenFlagOverlay, _React$Component); function GreenFlagOverlay(props) { var _this; _classCallCheck(this, GreenFlagOverlay); _this = _possibleConstructorReturn(this, _getPrototypeOf(GreenFlagOverlay).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['handleClick']); return _this; } _createClass(GreenFlagOverlay, [{ key: "handleClick", value: function handleClick() { this.props.vm.start(); this.props.vm.greenFlag(); } }, { key: "render", value: function render() { if (this.props.isStarted) return null; return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_components_box_box_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { className: this.props.wrapperClass, onClick: this.handleClick }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: this.props.className }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", { draggable: false, src: _components_green_flag_icon_green_flag_svg__WEBPACK_IMPORTED_MODULE_6___default.a }))); } }]); return GreenFlagOverlay; }(react__WEBPACK_IMPORTED_MODULE_1___default.a.Component); GreenFlagOverlay.propTypes = { className: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, isStarted: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, vm: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.instanceOf(scratch_vm__WEBPACK_IMPORTED_MODULE_4___default.a), wrapperClass: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string }; var mapStateToProps = function mapStateToProps(state) { return { isStarted: state.scratchGui.vmStatus.started, vm: state.scratchGui.vm }; }; var mapDispatchToProps = function mapDispatchToProps() { return {}; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_redux__WEBPACK_IMPORTED_MODULE_3__["connect"])(mapStateToProps, mapDispatchToProps)(GreenFlagOverlay)); /***/ }), /***/ "./src/containers/gui.jsx": /*!********************************!*\ !*** ./src/containers/gui.jsx ***! \********************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var redux__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! redux */ "./node_modules/redux/es/index.js"); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var react_modal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-modal */ "./node_modules/react-modal/lib/index.js"); /* harmony import */ var react_modal__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_modal__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! scratch-vm */ "./node_modules/scratch-vm/src/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(scratch_vm__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _lib_error_boundary_hoc_jsx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../lib/error-boundary-hoc.jsx */ "./src/lib/error-boundary-hoc.jsx"); /* harmony import */ var _reducers_project_state__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../reducers/project-state */ "./src/reducers/project-state.js"); /* harmony import */ var _reducers_project_title__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../reducers/project-title */ "./src/reducers/project-title.js"); /* harmony import */ var _reducers_editor_tab__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../reducers/editor-tab */ "./src/reducers/editor-tab.js"); /* harmony import */ var _reducers_modals__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../reducers/modals */ "./src/reducers/modals.js"); /* harmony import */ var _lib_font_loader_hoc_jsx__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../lib/font-loader-hoc.jsx */ "./src/lib/font-loader-hoc.jsx"); /* harmony import */ var _lib_localization_hoc_jsx__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../lib/localization-hoc.jsx */ "./src/lib/localization-hoc.jsx"); /* harmony import */ var _lib_project_fetcher_hoc_jsx__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../lib/project-fetcher-hoc.jsx */ "./src/lib/project-fetcher-hoc.jsx"); /* harmony import */ var _lib_project_saver_hoc_jsx__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../lib/project-saver-hoc.jsx */ "./src/lib/project-saver-hoc.jsx"); /* harmony import */ var _lib_query_parser_hoc_jsx__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../lib/query-parser-hoc.jsx */ "./src/lib/query-parser-hoc.jsx"); /* harmony import */ var _lib_storage__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../lib/storage */ "./src/lib/storage.js"); /* harmony import */ var _lib_vm_listener_hoc_jsx__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../lib/vm-listener-hoc.jsx */ "./src/lib/vm-listener-hoc.jsx"); /* harmony import */ var _lib_vm_manager_hoc_jsx__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../lib/vm-manager-hoc.jsx */ "./src/lib/vm-manager-hoc.jsx"); /* harmony import */ var _lib_cloud_manager_hoc_jsx__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../lib/cloud-manager-hoc.jsx */ "./src/lib/cloud-manager-hoc.jsx"); /* harmony import */ var _components_gui_gui_jsx__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../components/gui/gui.jsx */ "./src/components/gui/gui.jsx"); /* harmony import */ var _lib_isScratchDesktop_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../lib/isScratchDesktop.js */ "./src/lib/isScratchDesktop.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_6__["defineMessages"])({ defaultProjectTitle: { "id": "gui.gui.defaultProjectTitle", "defaultMessage": "Scratch Project" } }); var GUI = /*#__PURE__*/ function (_React$Component) { _inherits(GUI, _React$Component); function GUI() { _classCallCheck(this, GUI); return _possibleConstructorReturn(this, _getPrototypeOf(GUI).apply(this, arguments)); } _createClass(GUI, [{ key: "componentDidMount", value: function componentDidMount() { Object(_lib_isScratchDesktop_js__WEBPACK_IMPORTED_MODULE_22__["setIsScratchDesktop"])(this.props.isScratchDesktop); this.setReduxTitle(this.props.projectTitle); this.props.onStorageInit(_lib_storage__WEBPACK_IMPORTED_MODULE_17__["default"]); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (this.props.projectId !== prevProps.projectId && this.props.projectId !== null) { this.props.onUpdateProjectId(this.props.projectId); } if (this.props.projectTitle !== prevProps.projectTitle) { this.setReduxTitle(this.props.projectTitle); } if (this.props.isShowingProject && !prevProps.isShowingProject) { // this only notifies container when a project changes from not yet loaded to loaded // At this time the project view in www doesn't need to know when a project is unloaded this.props.onProjectLoaded(); } } }, { key: "setReduxTitle", value: function setReduxTitle(newTitle) { if (newTitle === null || typeof newTitle === 'undefined') { this.props.onUpdateReduxProjectTitle(this.props.intl.formatMessage(messages.defaultProjectTitle)); } else { this.props.onUpdateReduxProjectTitle(newTitle); } } }, { key: "render", value: function render() { if (this.props.isError) { throw new Error("Error in Scratch GUI [location=".concat(window.location, "]: ").concat(this.props.error)); } var _this$props = this.props, assetHost = _this$props.assetHost, cloudHost = _this$props.cloudHost, error = _this$props.error, isError = _this$props.isError, isScratchDesktop = _this$props.isScratchDesktop, isShowingProject = _this$props.isShowingProject, onProjectLoaded = _this$props.onProjectLoaded, onStorageInit = _this$props.onStorageInit, onUpdateProjectId = _this$props.onUpdateProjectId, onUpdateReduxProjectTitle = _this$props.onUpdateReduxProjectTitle, projectHost = _this$props.projectHost, projectId = _this$props.projectId, projectTitle = _this$props.projectTitle, children = _this$props.children, fetchingProject = _this$props.fetchingProject, isLoading = _this$props.isLoading, loadingStateVisible = _this$props.loadingStateVisible, componentProps = _objectWithoutProperties(_this$props, ["assetHost", "cloudHost", "error", "isError", "isScratchDesktop", "isShowingProject", "onProjectLoaded", "onStorageInit", "onUpdateProjectId", "onUpdateReduxProjectTitle", "projectHost", "projectId", "projectTitle", "children", "fetchingProject", "isLoading", "loadingStateVisible"]); return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_components_gui_gui_jsx__WEBPACK_IMPORTED_MODULE_21__["default"], _extends({ loading: fetchingProject || isLoading || loadingStateVisible }, componentProps), children); } }]); return GUI; }(react__WEBPACK_IMPORTED_MODULE_1___default.a.Component); GUI.propTypes = { assetHost: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, children: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.node, cloudHost: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, error: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.object, prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string]), fetchingProject: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, intl: react_intl__WEBPACK_IMPORTED_MODULE_6__["intlShape"], isError: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, isLoading: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, isScratchDesktop: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, isShowingProject: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, loadingStateVisible: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, onProjectLoaded: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onSeeCommunity: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onStorageInit: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onUpdateProjectId: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onUpdateProjectTitle: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, onUpdateReduxProjectTitle: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, projectHost: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, projectId: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number]), projectTitle: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, telemetryModalVisible: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, vm: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.instanceOf(scratch_vm__WEBPACK_IMPORTED_MODULE_5___default.a).isRequired }; GUI.defaultProps = { isScratchDesktop: false, onStorageInit: function onStorageInit(storageInstance) { return storageInstance.addOfficialScratchWebStores(); }, onProjectLoaded: function onProjectLoaded() {}, onUpdateProjectId: function onUpdateProjectId() {} }; var mapStateToProps = function mapStateToProps(state) { var loadingState = state.scratchGui.projectState.loadingState; return { activeTabIndex: state.scratchGui.editorTab.activeTabIndex, alertsVisible: state.scratchGui.alerts.visible, backdropLibraryVisible: state.scratchGui.modals.backdropLibrary, blocksTabVisible: state.scratchGui.editorTab.activeTabIndex === _reducers_editor_tab__WEBPACK_IMPORTED_MODULE_10__["BLOCKS_TAB_INDEX"], cardsVisible: state.scratchGui.cards.visible, connectionModalVisible: state.scratchGui.modals.connectionModal, costumeLibraryVisible: state.scratchGui.modals.costumeLibrary, costumesTabVisible: state.scratchGui.editorTab.activeTabIndex === _reducers_editor_tab__WEBPACK_IMPORTED_MODULE_10__["COSTUMES_TAB_INDEX"], error: state.scratchGui.projectState.error, isError: Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_8__["getIsError"])(loadingState), isFullScreen: state.scratchGui.mode.isFullScreen, isPlayerOnly: state.scratchGui.mode.isPlayerOnly, isRtl: state.locales.isRtl, isShowingProject: Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_8__["getIsShowingProject"])(loadingState), loadingStateVisible: state.scratchGui.modals.loadingProject, projectId: state.scratchGui.projectState.projectId, soundsTabVisible: state.scratchGui.editorTab.activeTabIndex === _reducers_editor_tab__WEBPACK_IMPORTED_MODULE_10__["SOUNDS_TAB_INDEX"], targetIsStage: state.scratchGui.targets.stage && state.scratchGui.targets.stage.id === state.scratchGui.targets.editingTarget, telemetryModalVisible: state.scratchGui.modals.telemetryModal, tipsLibraryVisible: state.scratchGui.modals.tipsLibrary, vm: state.scratchGui.vm }; }; var mapDispatchToProps = function mapDispatchToProps(dispatch) { return { onExtensionButtonClick: function onExtensionButtonClick() { return dispatch(Object(_reducers_modals__WEBPACK_IMPORTED_MODULE_11__["openExtensionLibrary"])()); }, onActivateTab: function onActivateTab(tab) { return dispatch(Object(_reducers_editor_tab__WEBPACK_IMPORTED_MODULE_10__["activateTab"])(tab)); }, onActivateCostumesTab: function onActivateCostumesTab() { return dispatch(Object(_reducers_editor_tab__WEBPACK_IMPORTED_MODULE_10__["activateTab"])(_reducers_editor_tab__WEBPACK_IMPORTED_MODULE_10__["COSTUMES_TAB_INDEX"])); }, onActivateSoundsTab: function onActivateSoundsTab() { return dispatch(Object(_reducers_editor_tab__WEBPACK_IMPORTED_MODULE_10__["activateTab"])(_reducers_editor_tab__WEBPACK_IMPORTED_MODULE_10__["SOUNDS_TAB_INDEX"])); }, onRequestCloseBackdropLibrary: function onRequestCloseBackdropLibrary() { return dispatch(Object(_reducers_modals__WEBPACK_IMPORTED_MODULE_11__["closeBackdropLibrary"])()); }, onRequestCloseCostumeLibrary: function onRequestCloseCostumeLibrary() { return dispatch(Object(_reducers_modals__WEBPACK_IMPORTED_MODULE_11__["closeCostumeLibrary"])()); }, onRequestCloseTelemetryModal: function onRequestCloseTelemetryModal() { return dispatch(Object(_reducers_modals__WEBPACK_IMPORTED_MODULE_11__["closeTelemetryModal"])()); }, onUpdateReduxProjectTitle: function onUpdateReduxProjectTitle(title) { return dispatch(Object(_reducers_project_title__WEBPACK_IMPORTED_MODULE_9__["setProjectTitle"])(title)); } }; }; var ConnectedGUI = Object(react_intl__WEBPACK_IMPORTED_MODULE_6__["injectIntl"])(Object(react_redux__WEBPACK_IMPORTED_MODULE_3__["connect"])(mapStateToProps, mapDispatchToProps)(GUI)); // note that redux's 'compose' function is just being used as a general utility to make // the hierarchy of HOC constructor calls clearer here; it has nothing to do with redux's // ability to compose reducers. var WrappedGui = Object(redux__WEBPACK_IMPORTED_MODULE_2__["compose"])(_lib_localization_hoc_jsx__WEBPACK_IMPORTED_MODULE_13__["default"], Object(_lib_error_boundary_hoc_jsx__WEBPACK_IMPORTED_MODULE_7__["default"])('Top Level App'), _lib_font_loader_hoc_jsx__WEBPACK_IMPORTED_MODULE_12__["default"], _lib_query_parser_hoc_jsx__WEBPACK_IMPORTED_MODULE_16__["default"], _lib_project_fetcher_hoc_jsx__WEBPACK_IMPORTED_MODULE_14__["default"], _lib_project_saver_hoc_jsx__WEBPACK_IMPORTED_MODULE_15__["default"], _lib_vm_listener_hoc_jsx__WEBPACK_IMPORTED_MODULE_18__["default"], _lib_vm_manager_hoc_jsx__WEBPACK_IMPORTED_MODULE_19__["default"], _lib_cloud_manager_hoc_jsx__WEBPACK_IMPORTED_MODULE_20__["default"])(ConnectedGUI); WrappedGui.setAppElement = react_modal__WEBPACK_IMPORTED_MODULE_4___default.a.setAppElement; /* harmony default export */ __webpack_exports__["default"] = (WrappedGui); /***/ }), /***/ "./src/containers/inline-messages.jsx": /*!********************************************!*\ !*** ./src/containers/inline-messages.jsx ***! \********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _reducers_alerts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../reducers/alerts */ "./src/reducers/alerts.js"); /* harmony import */ var _components_alerts_inline_message_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../components/alerts/inline-message.jsx */ "./src/components/alerts/inline-message.jsx"); var InlineMessages = function InlineMessages(_ref) { var alertsList = _ref.alertsList, className = _ref.className; if (!alertsList) { return null; } // only display inline alerts here var inlineAlerts = Object(_reducers_alerts__WEBPACK_IMPORTED_MODULE_3__["filterInlineAlerts"])(alertsList); if (!inlineAlerts || !inlineAlerts.length) { return null; } // get first alert var firstInlineAlert = inlineAlerts[0]; var content = firstInlineAlert.content, iconSpinner = firstInlineAlert.iconSpinner, level = firstInlineAlert.level; return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_alerts_inline_message_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { className: className, content: content, iconSpinner: iconSpinner, level: level }); }; InlineMessages.propTypes = { alertsList: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object), className: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string }; var mapStateToProps = function mapStateToProps(state) { return { alertsList: state.scratchGui.alerts.alertsList }; }; var mapDispatchToProps = function mapDispatchToProps() { return {}; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_redux__WEBPACK_IMPORTED_MODULE_2__["connect"])(mapStateToProps, mapDispatchToProps)(InlineMessages)); /***/ }), /***/ "./src/containers/language-selector.jsx": /*!**********************************************!*\ !*** ./src/containers/language-selector.jsx ***! \**********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _reducers_locales__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../reducers/locales */ "./src/reducers/locales.js"); /* harmony import */ var _reducers_menus__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../reducers/menus */ "./src/reducers/menus.js"); /* harmony import */ var _components_language_selector_language_selector_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../components/language-selector/language-selector.jsx */ "./src/components/language-selector/language-selector.jsx"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var LanguageSelector = /*#__PURE__*/ function (_React$Component) { _inherits(LanguageSelector, _React$Component); function LanguageSelector(props) { var _this; _classCallCheck(this, LanguageSelector); _this = _possibleConstructorReturn(this, _getPrototypeOf(LanguageSelector).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['handleChange']); document.documentElement.lang = props.currentLocale; return _this; } _createClass(LanguageSelector, [{ key: "handleChange", value: function handleChange(e) { var newLocale = e.target.value; if (this.props.messagesByLocale[newLocale]) { this.props.onChangeLanguage(newLocale); document.documentElement.lang = newLocale; } } }, { key: "render", value: function render() { var _this$props = this.props, onChangeLanguage = _this$props.onChangeLanguage, messagesByLocale = _this$props.messagesByLocale, children = _this$props.children, props = _objectWithoutProperties(_this$props, ["onChangeLanguage", "messagesByLocale", "children"]); return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_components_language_selector_language_selector_jsx__WEBPACK_IMPORTED_MODULE_6__["default"], _extends({ onChange: this.handleChange }, props), children); } }]); return LanguageSelector; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.Component); LanguageSelector.propTypes = { children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node, currentLocale: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string.isRequired, // Only checking key presence for messagesByLocale, no need to be more specific than object messagesByLocale: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object, // eslint-disable-line react/forbid-prop-types onChangeLanguage: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired }; var mapStateToProps = function mapStateToProps(state) { return { currentLocale: state.locales.locale, messagesByLocale: state.locales.messagesByLocale }; }; var mapDispatchToProps = function mapDispatchToProps(dispatch) { return { onChangeLanguage: function onChangeLanguage(locale) { dispatch(Object(_reducers_locales__WEBPACK_IMPORTED_MODULE_4__["selectLocale"])(locale)); dispatch(Object(_reducers_menus__WEBPACK_IMPORTED_MODULE_5__["closeLanguageMenu"])()); } }; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_redux__WEBPACK_IMPORTED_MODULE_3__["connect"])(mapStateToProps, mapDispatchToProps)(LanguageSelector)); /***/ }), /***/ "./src/containers/library-item.jsx": /*!*****************************************!*\ !*** ./src/containers/library-item.jsx ***! \*****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _components_library_item_library_item_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../components/library-item/library-item.jsx */ "./src/components/library-item/library-item.jsx"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var LibraryItem = /*#__PURE__*/ function (_React$PureComponent) { _inherits(LibraryItem, _React$PureComponent); function LibraryItem(props) { var _this; _classCallCheck(this, LibraryItem); _this = _possibleConstructorReturn(this, _getPrototypeOf(LibraryItem).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['handleBlur', 'handleClick', 'handleFocus', 'handleKeyPress', 'handleMouseEnter', 'handleMouseLeave', 'rotateIcon', 'startRotatingIcons', 'stopRotatingIcons']); _this.state = { iconIndex: 0, isRotatingIcon: false }; return _this; } _createClass(LibraryItem, [{ key: "componentWillUnmount", value: function componentWillUnmount() { clearInterval(this.intervalId); } }, { key: "handleBlur", value: function handleBlur(id) { this.handleMouseLeave(id); } }, { key: "handleClick", value: function handleClick(e) { if (!this.props.disabled) { this.props.onSelect(this.props.id); } e.preventDefault(); } }, { key: "handleFocus", value: function handleFocus(id) { this.handleMouseEnter(id); } }, { key: "handleKeyPress", value: function handleKeyPress(e) { if (e.key === ' ' || e.key === 'Enter') { e.preventDefault(); this.props.onSelect(this.props.id); } } }, { key: "handleMouseEnter", value: function handleMouseEnter() { this.props.onMouseEnter(this.props.id); if (this.props.icons && this.props.icons.length) { this.stopRotatingIcons(); this.setState({ isRotatingIcon: true }, this.startRotatingIcons); } } }, { key: "handleMouseLeave", value: function handleMouseLeave() { this.props.onMouseLeave(this.props.id); if (this.props.icons && this.props.icons.length) { this.setState({ isRotatingIcon: false }, this.stopRotatingIcons); } } }, { key: "startRotatingIcons", value: function startRotatingIcons() { this.rotateIcon(); this.intervalId = setInterval(this.rotateIcon, 300); } }, { key: "stopRotatingIcons", value: function stopRotatingIcons() { if (this.intervalId) { this.intervalId = clearInterval(this.intervalId); } } }, { key: "rotateIcon", value: function rotateIcon() { var nextIconIndex = (this.state.iconIndex + 1) % this.props.icons.length; this.setState({ iconIndex: nextIconIndex }); } }, { key: "curIconSource", value: function curIconSource() { if (this.props.icons && this.state.isRotatingIcon && this.state.iconIndex < this.props.icons.length && this.props.icons[this.state.iconIndex]) { return this.props.icons[this.state.iconIndex]; } return this.props.iconSource; } }, { key: "render", value: function render() { var iconSource = this.curIconSource(); return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_components_library_item_library_item_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { bluetoothRequired: this.props.bluetoothRequired, collaborator: this.props.collaborator, description: this.props.description, disabled: this.props.disabled, extensionId: this.props.extensionId, featured: this.props.featured, hidden: this.props.hidden, iconSource: iconSource, id: this.props.id, insetIconURL: this.props.insetIconURL, internetConnectionRequired: this.props.internetConnectionRequired, name: this.props.name, onBlur: this.handleBlur, onClick: this.handleClick, onFocus: this.handleFocus, onKeyPress: this.handleKeyPress, onMouseEnter: this.handleMouseEnter, onMouseLeave: this.handleMouseLeave }); } }]); return LibraryItem; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.PureComponent); LibraryItem.propTypes = { bluetoothRequired: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, collaborator: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, description: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node]), disabled: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, extensionId: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, featured: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, hidden: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, iconSource: _components_library_item_library_item_jsx__WEBPACK_IMPORTED_MODULE_4__["default"].propTypes.iconSource, // single icon icons: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.arrayOf(_components_library_item_library_item_jsx__WEBPACK_IMPORTED_MODULE_4__["default"].propTypes.iconSource), // rotating icons id: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number.isRequired, insetIconURL: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, internetConnectionRequired: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, name: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node]), onMouseEnter: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, onMouseLeave: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, onSelect: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_3__["injectIntl"])(LibraryItem)); /***/ }), /***/ "./src/containers/list-monitor.jsx": /*!*****************************************!*\ !*** ./src/containers/list-monitor.jsx ***! \*****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! scratch-vm */ "./node_modules/scratch-vm/src/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(scratch_vm__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _lib_touch_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../lib/touch-utils */ "./src/lib/touch-utils.js"); /* harmony import */ var _lib_variable_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lib/variable-utils */ "./src/lib/variable-utils.js"); /* harmony import */ var _components_monitor_list_monitor_jsx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../components/monitor/list-monitor.jsx */ "./src/components/monitor/list-monitor.jsx"); /* harmony import */ var immutable__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! immutable */ "./node_modules/immutable/dist/immutable.js"); /* harmony import */ var immutable__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(immutable__WEBPACK_IMPORTED_MODULE_8__); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var ListMonitor = /*#__PURE__*/ function (_React$Component) { _inherits(ListMonitor, _React$Component); function ListMonitor(props) { var _this; _classCallCheck(this, ListMonitor); _this = _possibleConstructorReturn(this, _getPrototypeOf(ListMonitor).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['handleActivate', 'handleDeactivate', 'handleInput', 'handleRemove', 'handleKeyPress', 'handleFocus', 'handleAdd', 'handleResizeMouseDown']); _this.state = { activeIndex: null, activeValue: null, width: props.width || 100, height: props.height || 200 }; return _this; } _createClass(ListMonitor, [{ key: "handleActivate", value: function handleActivate(index) { // Do nothing if activating the currently active item if (this.state.activeIndex === index) { return; } this.setState({ activeIndex: index, activeValue: this.props.value[index] }); } }, { key: "handleDeactivate", value: function handleDeactivate() { // Submit any in-progress value edits on blur if (this.state.activeIndex !== null) { var _this$props = this.props, vm = _this$props.vm, targetId = _this$props.targetId, variableId = _this$props.id; var newListValue = Object(_lib_variable_utils__WEBPACK_IMPORTED_MODULE_6__["getVariableValue"])(vm, targetId, variableId); newListValue[this.state.activeIndex] = this.state.activeValue; Object(_lib_variable_utils__WEBPACK_IMPORTED_MODULE_6__["setVariableValue"])(vm, targetId, variableId, newListValue); this.setState({ activeIndex: null, activeValue: null }); } } }, { key: "handleFocus", value: function handleFocus(e) { // Select all the text in the input when it is focused. e.target.select(); } }, { key: "handleKeyPress", value: function handleKeyPress(e) { // Special case for tab, arrow keys and enter. // Tab / shift+tab navigate down / up the list. // Arrow down / arrow up navigate down / up the list. // Enter / shift+enter insert new blank item below / above. var previouslyActiveIndex = this.state.activeIndex; var _this$props2 = this.props, vm = _this$props2.vm, targetId = _this$props2.targetId, variableId = _this$props2.id; var navigateDirection = 0; if (e.key === 'Tab') navigateDirection = e.shiftKey ? -1 : 1;else if (e.key === 'ArrowUp') navigateDirection = -1;else if (e.key === 'ArrowDown') navigateDirection = 1; if (navigateDirection) { this.handleDeactivate(); // Submit in-progress edits var newIndex = this.wrapListIndex(previouslyActiveIndex + navigateDirection, this.props.value.length); this.setState({ activeIndex: newIndex, activeValue: this.props.value[newIndex] }); e.preventDefault(); // Stop default tab behavior, handled by this state change } else if (e.key === 'Enter') { this.handleDeactivate(); // Submit in-progress edits var newListItemValue = ''; // Enter adds a blank item var newValueOffset = e.shiftKey ? 0 : 1; // Shift-enter inserts above var listValue = Object(_lib_variable_utils__WEBPACK_IMPORTED_MODULE_6__["getVariableValue"])(vm, targetId, variableId); var newListValue = listValue.slice(0, previouslyActiveIndex + newValueOffset).concat([newListItemValue]).concat(listValue.slice(previouslyActiveIndex + newValueOffset)); Object(_lib_variable_utils__WEBPACK_IMPORTED_MODULE_6__["setVariableValue"])(vm, targetId, variableId, newListValue); var _newIndex = this.wrapListIndex(previouslyActiveIndex + newValueOffset, newListValue.length); this.setState({ activeIndex: _newIndex, activeValue: newListItemValue }); } } }, { key: "handleInput", value: function handleInput(e) { this.setState({ activeValue: e.target.value }); } }, { key: "handleRemove", value: function handleRemove(e) { e.preventDefault(); // Default would blur input, prevent that. e.stopPropagation(); // Bubbling would activate, which will be handled here var _this$props3 = this.props, vm = _this$props3.vm, targetId = _this$props3.targetId, variableId = _this$props3.id; var listValue = Object(_lib_variable_utils__WEBPACK_IMPORTED_MODULE_6__["getVariableValue"])(vm, targetId, variableId); var newListValue = listValue.slice(0, this.state.activeIndex).concat(listValue.slice(this.state.activeIndex + 1)); Object(_lib_variable_utils__WEBPACK_IMPORTED_MODULE_6__["setVariableValue"])(vm, targetId, variableId, newListValue); var newActiveIndex = Math.min(newListValue.length - 1, this.state.activeIndex); this.setState({ activeIndex: newActiveIndex, activeValue: newListValue[newActiveIndex] }); } }, { key: "handleAdd", value: function handleAdd() { // Add button appends a blank value and switches to it var _this$props4 = this.props, vm = _this$props4.vm, targetId = _this$props4.targetId, variableId = _this$props4.id; var newListValue = Object(_lib_variable_utils__WEBPACK_IMPORTED_MODULE_6__["getVariableValue"])(vm, targetId, variableId).concat(['']); Object(_lib_variable_utils__WEBPACK_IMPORTED_MODULE_6__["setVariableValue"])(vm, targetId, variableId, newListValue); this.setState({ activeIndex: newListValue.length - 1, activeValue: '' }); } }, { key: "handleResizeMouseDown", value: function handleResizeMouseDown(e) { var _this2 = this; this.initialPosition = Object(_lib_touch_utils__WEBPACK_IMPORTED_MODULE_5__["getEventXY"])(e); this.initialWidth = this.state.width; this.initialHeight = this.state.height; var onMouseMove = function onMouseMove(ev) { var newPosition = Object(_lib_touch_utils__WEBPACK_IMPORTED_MODULE_5__["getEventXY"])(ev); var dx = newPosition.x - _this2.initialPosition.x; var dy = newPosition.y - _this2.initialPosition.y; _this2.setState({ width: Math.max(Math.min(_this2.initialWidth + dx, 480), 100), height: Math.max(Math.min(_this2.initialHeight + dy, 360), 60) }); }; var onMouseUp = function onMouseUp(ev) { onMouseMove(ev); // Make sure width/height are up-to-date window.removeEventListener('mousemove', onMouseMove); window.removeEventListener('mouseup', onMouseUp); _this2.props.vm.runtime.requestUpdateMonitor(Object(immutable__WEBPACK_IMPORTED_MODULE_8__["Map"])({ id: _this2.props.id, height: _this2.state.height, width: _this2.state.width })); }; window.addEventListener('mousemove', onMouseMove); window.addEventListener('mouseup', onMouseUp); } }, { key: "wrapListIndex", value: function wrapListIndex(index, length) { return (index + length) % length; } }, { key: "render", value: function render() { var _this$props5 = this.props, vm = _this$props5.vm, props = _objectWithoutProperties(_this$props5, ["vm"]); return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_components_monitor_list_monitor_jsx__WEBPACK_IMPORTED_MODULE_7__["default"], _extends({}, props, { activeIndex: this.state.activeIndex, activeValue: this.state.activeValue, height: this.state.height, width: this.state.width, onActivate: this.handleActivate, onAdd: this.handleAdd, onDeactivate: this.handleDeactivate, onFocus: this.handleFocus, onInput: this.handleInput, onKeyPress: this.handleKeyPress, onRemove: this.handleRemove, onResizeMouseDown: this.handleResizeMouseDown })); } }]); return ListMonitor; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.Component); ListMonitor.propTypes = { height: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, id: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, targetId: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, value: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string]), vm: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.instanceOf(scratch_vm__WEBPACK_IMPORTED_MODULE_3___default.a), width: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, x: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, y: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number }; var mapStateToProps = function mapStateToProps(state) { return { vm: state.scratchGui.vm }; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_redux__WEBPACK_IMPORTED_MODULE_4__["connect"])(mapStateToProps)(ListMonitor)); /***/ }), /***/ "./src/containers/menu-bar-hoc.jsx": /*!*****************************************!*\ !*** ./src/containers/menu-bar-hoc.jsx ***! \*****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var MenuBarHOC = function MenuBarHOC(WrappedComponent) { var MenuBarContainer = /*#__PURE__*/ function (_React$PureComponent) { _inherits(MenuBarContainer, _React$PureComponent); function MenuBarContainer(props) { var _this; _classCallCheck(this, MenuBarContainer); _this = _possibleConstructorReturn(this, _getPrototypeOf(MenuBarContainer).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_2___default()(_assertThisInitialized(_this), ['confirmReadyToReplaceProject', 'shouldSaveBeforeTransition']); return _this; } _createClass(MenuBarContainer, [{ key: "confirmReadyToReplaceProject", value: function confirmReadyToReplaceProject(message) { var readyToReplaceProject = true; if (this.props.projectChanged && !this.props.canCreateNew) { readyToReplaceProject = this.props.confirmWithMessage(message); } return readyToReplaceProject; } }, { key: "shouldSaveBeforeTransition", value: function shouldSaveBeforeTransition() { return this.props.canSave && this.props.projectChanged; } }, { key: "render", value: function render() { var _this$props = this.props, projectChanged = _this$props.projectChanged, props = _objectWithoutProperties(_this$props, ["projectChanged"]); return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(WrappedComponent, _extends({ confirmReadyToReplaceProject: this.confirmReadyToReplaceProject, shouldSaveBeforeTransition: this.shouldSaveBeforeTransition }, props)); } }]); return MenuBarContainer; }(react__WEBPACK_IMPORTED_MODULE_3___default.a.PureComponent); MenuBarContainer.propTypes = { canCreateNew: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, canSave: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, confirmWithMessage: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, projectChanged: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool }; MenuBarContainer.defaultProps = { // default to using standard js confirm confirmWithMessage: function confirmWithMessage(message) { return confirm(message); } // eslint-disable-line no-alert }; var mapStateToProps = function mapStateToProps(state) { return { projectChanged: state.scratchGui.projectChanged }; }; var mapDispatchToProps = function mapDispatchToProps() { return {}; }; // Allow incoming props to override redux-provided props. Used to mock in tests. var mergeProps = function mergeProps(stateProps, dispatchProps, ownProps) { return Object.assign({}, stateProps, dispatchProps, ownProps); }; return Object(react_redux__WEBPACK_IMPORTED_MODULE_0__["connect"])(mapStateToProps, mapDispatchToProps, mergeProps)(MenuBarContainer); }; /* harmony default export */ __webpack_exports__["default"] = (MenuBarHOC); /***/ }), /***/ "./src/containers/menu-item.jsx": /*!**************************************!*\ !*** ./src/containers/menu-item.jsx ***! \**************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _components_menu_menu_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/menu/menu.jsx */ "./src/components/menu/menu.jsx"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var MenuItem = /*#__PURE__*/ function (_React$Component) { _inherits(MenuItem, _React$Component); function MenuItem(props) { var _this; _classCallCheck(this, MenuItem); _this = _possibleConstructorReturn(this, _getPrototypeOf(MenuItem).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['navigateToHref']); return _this; } _createClass(MenuItem, [{ key: "navigateToHref", value: function navigateToHref() { if (this.props.href) window.location.href = this.props.href; } }, { key: "render", value: function render() { var _this$props = this.props, children = _this$props.children, className = _this$props.className, onClick = _this$props.onClick; var clickAction = onClick ? onClick : this.navigateToHref; return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_components_menu_menu_jsx__WEBPACK_IMPORTED_MODULE_3__["MenuItem"], { className: className, onClick: clickAction }, children); } }]); return MenuItem; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.Component); MenuItem.propTypes = { children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node, className: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, // can take an onClick prop, or take an href and build an onClick handler href: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, onClick: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func }; /* harmony default export */ __webpack_exports__["default"] = (MenuItem); /***/ }), /***/ "./src/containers/menu.jsx": /*!*********************************!*\ !*** ./src/containers/menu.jsx ***! \*********************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _components_menu_menu_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/menu/menu.jsx */ "./src/components/menu/menu.jsx"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var Menu = /*#__PURE__*/ function (_React$Component) { _inherits(Menu, _React$Component); function Menu(props) { var _this; _classCallCheck(this, Menu); _this = _possibleConstructorReturn(this, _getPrototypeOf(Menu).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['addListeners', 'removeListeners', 'handleClick', 'ref']); return _this; } _createClass(Menu, [{ key: "componentDidMount", value: function componentDidMount() { if (this.props.open) this.addListeners(); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (this.props.open && !prevProps.open) this.addListeners(); if (!this.props.open && prevProps.open) this.removeListeners(); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.removeListeners(); } }, { key: "addListeners", value: function addListeners() { document.addEventListener('mouseup', this.handleClick); } }, { key: "removeListeners", value: function removeListeners() { document.removeEventListener('mouseup', this.handleClick); } }, { key: "handleClick", value: function handleClick(e) { if (this.props.open && !this.menu.contains(e.target)) { this.props.onRequestClose(); } } }, { key: "ref", value: function ref(c) { this.menu = c; } }, { key: "render", value: function render() { var _this$props = this.props, open = _this$props.open, children = _this$props.children, props = _objectWithoutProperties(_this$props, ["open", "children"]); if (!open) return null; return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_components_menu_menu_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], _extends({ componentRef: this.ref }, props), children); } }]); return Menu; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.Component); Menu.propTypes = { children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node, onRequestClose: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, open: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool.isRequired }; /* harmony default export */ __webpack_exports__["default"] = (Menu); /***/ }), /***/ "./src/containers/modal.jsx": /*!**********************************!*\ !*** ./src/containers/modal.jsx ***! \**********************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _components_modal_modal_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../components/modal/modal.jsx */ "./src/components/modal/modal.jsx"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var Modal = /*#__PURE__*/ function (_React$Component) { _inherits(Modal, _React$Component); function Modal(props) { var _this; _classCallCheck(this, Modal); _this = _possibleConstructorReturn(this, _getPrototypeOf(Modal).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['addEventListeners', 'removeEventListeners', 'handlePopState', 'pushHistory']); _this.addEventListeners(); return _this; } _createClass(Modal, [{ key: "componentDidMount", value: function componentDidMount() { // Add a history event only if it's not currently for our modal. This // avoids polluting the history with many entries. We only need one. this.pushHistory(this.id, history.state === null || history.state !== this.id); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.removeEventListeners(); } }, { key: "addEventListeners", value: function addEventListeners() { window.addEventListener('popstate', this.handlePopState); } }, { key: "removeEventListeners", value: function removeEventListeners() { window.removeEventListener('popstate', this.handlePopState); } }, { key: "handlePopState", value: function handlePopState() { // Whenever someone navigates, we want to be closed this.props.onRequestClose(); } }, { key: "pushHistory", value: function pushHistory(state, push) { if (push) return history.pushState(state, this.id); history.replaceState(state, this.id); } }, { key: "render", value: function render() { return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_components_modal_modal_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], this.props); } }, { key: "id", get: function get() { return "modal-".concat(this.props.id); } }]); return Modal; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.Component); Modal.propTypes = { id: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string.isRequired, isRtl: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, onRequestClose: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onRequestOpen: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func }; var mapStateToProps = function mapStateToProps(state) { return { isRtl: state.locales.isRtl }; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_redux__WEBPACK_IMPORTED_MODULE_3__["connect"])(mapStateToProps)(Modal)); /***/ }), /***/ "./src/containers/monitor-list.jsx": /*!*****************************************!*\ !*** ./src/containers/monitor-list.jsx ***! \*****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _reducers_monitor_layout__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../reducers/monitor-layout */ "./src/reducers/monitor-layout.js"); /* harmony import */ var _lib_error_boundary_hoc_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lib/error-boundary-hoc.jsx */ "./src/lib/error-boundary-hoc.jsx"); /* harmony import */ var _lib_opcode_labels__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../lib/opcode-labels */ "./src/lib/opcode-labels.js"); /* harmony import */ var _components_monitor_list_monitor_list_jsx__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../components/monitor-list/monitor-list.jsx */ "./src/components/monitor-list/monitor-list.jsx"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var MonitorList = /*#__PURE__*/ function (_React$Component) { _inherits(MonitorList, _React$Component); function MonitorList(props) { var _this; _classCallCheck(this, MonitorList); _this = _possibleConstructorReturn(this, _getPrototypeOf(MonitorList).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['handleMonitorChange']); _lib_opcode_labels__WEBPACK_IMPORTED_MODULE_7__["default"].setTranslatorFunction(props.intl.formatMessage); return _this; } _createClass(MonitorList, [{ key: "handleMonitorChange", value: function handleMonitorChange(id, x, y) { // eslint-disable-line no-unused-vars this.props.moveMonitorRect(id, x, y); } }, { key: "render", value: function render() { return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_components_monitor_list_monitor_list_jsx__WEBPACK_IMPORTED_MODULE_8__["default"], _extends({ onMonitorChange: this.handleMonitorChange }, this.props)); } }]); return MonitorList; }(react__WEBPACK_IMPORTED_MODULE_1___default.a.Component); MonitorList.propTypes = { intl: react_intl__WEBPACK_IMPORTED_MODULE_3__["intlShape"].isRequired, moveMonitorRect: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func.isRequired }; var mapStateToProps = function mapStateToProps(state) { return { monitors: state.scratchGui.monitors }; }; var mapDispatchToProps = function mapDispatchToProps(dispatch) { return { moveMonitorRect: function moveMonitorRect(id, x, y) { return dispatch(Object(_reducers_monitor_layout__WEBPACK_IMPORTED_MODULE_5__["moveMonitorRect"])(id, x, y)); } }; }; /* harmony default export */ __webpack_exports__["default"] = (Object(_lib_error_boundary_hoc_jsx__WEBPACK_IMPORTED_MODULE_6__["default"])('Monitors')(Object(react_intl__WEBPACK_IMPORTED_MODULE_3__["injectIntl"])(Object(react_redux__WEBPACK_IMPORTED_MODULE_4__["connect"])(mapStateToProps, mapDispatchToProps)(MonitorList)))); /***/ }), /***/ "./src/containers/monitor.jsx": /*!************************************!*\ !*** ./src/containers/monitor.jsx ***! \************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _lib_monitor_adapter_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/monitor-adapter.js */ "./src/lib/monitor-adapter.js"); /* harmony import */ var _components_monitor_monitor_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../components/monitor/monitor.jsx */ "./src/components/monitor/monitor.jsx"); /* harmony import */ var _reducers_monitor_layout__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../reducers/monitor-layout */ "./src/reducers/monitor-layout.js"); /* harmony import */ var _lib_variable_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../lib/variable-utils */ "./src/lib/variable-utils.js"); /* harmony import */ var _lib_import_csv__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../lib/import-csv */ "./src/lib/import-csv.js"); /* harmony import */ var _lib_download_blob__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../lib/download-blob */ "./src/lib/download-blob.js"); /* harmony import */ var _slider_prompt_jsx__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./slider-prompt.jsx */ "./src/containers/slider-prompt.jsx"); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var immutable__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! immutable */ "./node_modules/immutable/dist/immutable.js"); /* harmony import */ var immutable__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(immutable__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! scratch-vm */ "./node_modules/scratch-vm/src/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(scratch_vm__WEBPACK_IMPORTED_MODULE_13__); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var availableModes = function availableModes(opcode) { return _components_monitor_monitor_jsx__WEBPACK_IMPORTED_MODULE_5__["monitorModes"].filter(function (t) { if (opcode === 'data_variable') { return t !== 'list'; } else if (opcode === 'data_listcontents') { return t === 'list'; } return t !== 'slider' && t !== 'list'; }); }; var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_3__["defineMessages"])({ columnPrompt: { "id": "gui.monitors.importListColumnPrompt", "defaultMessage": "Which column should be used (1-{numberOfColumns})?" } }); var Monitor = /*#__PURE__*/ function (_React$Component) { _inherits(Monitor, _React$Component); function Monitor(props) { var _this; _classCallCheck(this, Monitor); _this = _possibleConstructorReturn(this, _getPrototypeOf(Monitor).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['handleDragEnd', 'handleNextMode', 'handleSetModeToDefault', 'handleSetModeToLarge', 'handleSetModeToSlider', 'handleSliderPromptClose', 'handleSliderPromptOk', 'handleSliderPromptOpen', 'handleImport', 'handleExport', 'setElement']); _this.state = { sliderPrompt: false }; return _this; } _createClass(Monitor, [{ key: "componentDidMount", value: function componentDidMount() { var rect; var isNum = function isNum(num) { return typeof num === 'number' && !isNaN(num); }; // Load the VM provided position if not loaded already // If a monitor has numbers for the x and y positions, load the saved position. // Otherwise, auto-position the monitor. if (isNum(this.props.x) && isNum(this.props.y) && !this.props.monitorLayout.savedMonitorPositions[this.props.id]) { rect = { upperStart: { x: this.props.x, y: this.props.y }, lowerEnd: { x: this.props.x + this.element.offsetWidth, y: this.props.y + this.element.offsetHeight } }; this.props.addMonitorRect(this.props.id, rect, true /* savePosition */ ); } else { // Newly created user monitor rect = Object(_reducers_monitor_layout__WEBPACK_IMPORTED_MODULE_6__["getInitialPosition"])(this.props.monitorLayout, this.props.id, this.element.offsetWidth, this.element.offsetHeight); this.props.addMonitorRect(this.props.id, rect); this.props.vm.runtime.requestUpdateMonitor(Object(immutable__WEBPACK_IMPORTED_MODULE_12__["Map"])({ id: this.props.id, x: rect.upperStart.x, y: rect.upperStart.y })); } this.element.style.top = "".concat(rect.upperStart.y, "px"); this.element.style.left = "".concat(rect.upperStart.x, "px"); } }, { key: "shouldComponentUpdate", value: function shouldComponentUpdate(nextProps, nextState) { if (nextState !== this.state) { return true; } var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = Object.getOwnPropertyNames(nextProps)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var key = _step.value; // Don't need to rerender when other monitors are moved. // monitorLayout is only used during initial layout. if (key !== 'monitorLayout' && nextProps[key] !== this.props[key]) { return true; } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } return false; } }, { key: "componentDidUpdate", value: function componentDidUpdate() { this.props.resizeMonitorRect(this.props.id, this.element.offsetWidth, this.element.offsetHeight); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.props.removeMonitorRect(this.props.id); } }, { key: "handleDragEnd", value: function handleDragEnd(e, _ref) { var x = _ref.x, y = _ref.y; var newX = parseInt(this.element.style.left, 10) + x; var newY = parseInt(this.element.style.top, 10) + y; this.props.onDragEnd(this.props.id, newX, newY); this.props.vm.runtime.requestUpdateMonitor(Object(immutable__WEBPACK_IMPORTED_MODULE_12__["Map"])({ id: this.props.id, x: newX, y: newY })); } }, { key: "handleNextMode", value: function handleNextMode() { var modes = availableModes(this.props.opcode); var modeIndex = modes.indexOf(this.props.mode); var newMode = modes[(modeIndex + 1) % modes.length]; this.props.vm.runtime.requestUpdateMonitor(Object(immutable__WEBPACK_IMPORTED_MODULE_12__["Map"])({ id: this.props.id, mode: newMode })); } }, { key: "handleSetModeToDefault", value: function handleSetModeToDefault() { this.props.vm.runtime.requestUpdateMonitor(Object(immutable__WEBPACK_IMPORTED_MODULE_12__["Map"])({ id: this.props.id, mode: 'default' })); } }, { key: "handleSetModeToLarge", value: function handleSetModeToLarge() { this.props.vm.runtime.requestUpdateMonitor(Object(immutable__WEBPACK_IMPORTED_MODULE_12__["Map"])({ id: this.props.id, mode: 'large' })); } }, { key: "handleSetModeToSlider", value: function handleSetModeToSlider() { this.props.vm.runtime.requestUpdateMonitor(Object(immutable__WEBPACK_IMPORTED_MODULE_12__["Map"])({ id: this.props.id, mode: 'slider' })); } }, { key: "handleSliderPromptClose", value: function handleSliderPromptClose() { this.setState({ sliderPrompt: false }); } }, { key: "handleSliderPromptOpen", value: function handleSliderPromptOpen() { this.setState({ sliderPrompt: true }); } }, { key: "handleSliderPromptOk", value: function handleSliderPromptOk(min, max, isDiscrete) { var realMin = Math.min(min, max); var realMax = Math.max(min, max); this.props.vm.runtime.requestUpdateMonitor(Object(immutable__WEBPACK_IMPORTED_MODULE_12__["Map"])({ id: this.props.id, sliderMin: realMin, sliderMax: realMax, isDiscrete: isDiscrete })); this.handleSliderPromptClose(); } }, { key: "setElement", value: function setElement(monitorElt) { this.element = monitorElt; } }, { key: "handleImport", value: function handleImport() { var _this2 = this; Object(_lib_import_csv__WEBPACK_IMPORTED_MODULE_8__["default"])().then(function (rows) { var numberOfColumns = rows[0].length; var columnNumber = 1; if (numberOfColumns > 1) { var msg = _this2.props.intl.formatMessage(messages.columnPrompt, { numberOfColumns: numberOfColumns }); columnNumber = parseInt(prompt(msg), 10); // eslint-disable-line no-alert } var newListValue = rows.map(function (row) { return row[columnNumber - 1]; }).filter(function (item) { return typeof item === 'string'; }); // CSV importer can leave undefineds var _this2$props = _this2.props, vm = _this2$props.vm, targetId = _this2$props.targetId, variableId = _this2$props.id; Object(_lib_variable_utils__WEBPACK_IMPORTED_MODULE_7__["setVariableValue"])(vm, targetId, variableId, newListValue); }); } }, { key: "handleExport", value: function handleExport() { var _this$props = this.props, vm = _this$props.vm, targetId = _this$props.targetId, variableId = _this$props.id; var variable = Object(_lib_variable_utils__WEBPACK_IMPORTED_MODULE_7__["getVariable"])(vm, targetId, variableId); var text = variable.value.join('\r\n'); var blob = new Blob([text], { type: 'text/plain;charset=utf-8' }); Object(_lib_download_blob__WEBPACK_IMPORTED_MODULE_9__["default"])("".concat(variable.name, ".txt"), blob); } }, { key: "render", value: function render() { var monitorProps = Object(_lib_monitor_adapter_js__WEBPACK_IMPORTED_MODULE_4__["default"])(this.props); var showSliderOption = availableModes(this.props.opcode).indexOf('slider') !== -1; var isList = this.props.mode === 'list'; return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_1___default.a.Fragment, null, this.state.sliderPrompt && react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_slider_prompt_jsx__WEBPACK_IMPORTED_MODULE_10__["default"], { isDiscrete: this.props.isDiscrete, maxValue: parseFloat(this.props.max), minValue: parseFloat(this.props.min), onCancel: this.handleSliderPromptClose, onOk: this.handleSliderPromptOk }), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_components_monitor_monitor_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], _extends({ componentRef: this.setElement }, monitorProps, { draggable: this.props.draggable, height: this.props.height, isDiscrete: this.props.isDiscrete, max: this.props.max, min: this.props.min, mode: this.props.mode, targetId: this.props.targetId, width: this.props.width, onDragEnd: this.handleDragEnd, onExport: isList ? this.handleExport : null, onImport: isList ? this.handleImport : null, onNextMode: this.handleNextMode, onSetModeToDefault: isList ? null : this.handleSetModeToDefault, onSetModeToLarge: isList ? null : this.handleSetModeToLarge, onSetModeToSlider: showSliderOption ? this.handleSetModeToSlider : null, onSliderPromptOpen: this.handleSliderPromptOpen }))); } }]); return Monitor; }(react__WEBPACK_IMPORTED_MODULE_1___default.a.Component); Monitor.propTypes = { addMonitorRect: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func.isRequired, draggable: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, height: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number, id: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string.isRequired, intl: react_intl__WEBPACK_IMPORTED_MODULE_3__["intlShape"], isDiscrete: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, max: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number, min: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number, mode: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOf(['default', 'slider', 'large', 'list']), monitorLayout: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.shape({ monitors: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.object, savedMonitorPositions: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.object }).isRequired, onDragEnd: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func.isRequired, opcode: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string.isRequired, // eslint-disable-line react/no-unused-prop-types params: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.object, // eslint-disable-line react/no-unused-prop-types, react/forbid-prop-types removeMonitorRect: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func.isRequired, resizeMonitorRect: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func.isRequired, spriteName: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, // eslint-disable-line react/no-unused-prop-types targetId: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, value: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number, prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number]))]), // eslint-disable-line react/no-unused-prop-types vm: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.instanceOf(scratch_vm__WEBPACK_IMPORTED_MODULE_13___default.a), width: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number, x: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number, y: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number }; var mapStateToProps = function mapStateToProps(state) { return { monitorLayout: state.scratchGui.monitorLayout, vm: state.scratchGui.vm }; }; var mapDispatchToProps = function mapDispatchToProps(dispatch) { return { addMonitorRect: function addMonitorRect(id, rect, savePosition) { return dispatch(Object(_reducers_monitor_layout__WEBPACK_IMPORTED_MODULE_6__["addMonitorRect"])(id, rect.upperStart, rect.lowerEnd, savePosition)); }, resizeMonitorRect: function resizeMonitorRect(id, newWidth, newHeight) { return dispatch(Object(_reducers_monitor_layout__WEBPACK_IMPORTED_MODULE_6__["resizeMonitorRect"])(id, newWidth, newHeight)); }, removeMonitorRect: function removeMonitorRect(id) { return dispatch(Object(_reducers_monitor_layout__WEBPACK_IMPORTED_MODULE_6__["removeMonitorRect"])(id)); } }; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_3__["injectIntl"])(Object(react_redux__WEBPACK_IMPORTED_MODULE_11__["connect"])(mapStateToProps, mapDispatchToProps)(Monitor))); /***/ }), /***/ "./src/containers/paint-editor-wrapper.jsx": /*!*************************************************!*\ !*** ./src/containers/paint-editor-wrapper.jsx ***! \*************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! scratch-vm */ "./node_modules/scratch-vm/src/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(scratch_vm__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var scratch_paint__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! scratch-paint */ "./node_modules/scratch-paint/src/index.js"); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var PaintEditorWrapper = /*#__PURE__*/ function (_React$Component) { _inherits(PaintEditorWrapper, _React$Component); function PaintEditorWrapper(props) { var _this; _classCallCheck(this, PaintEditorWrapper); _this = _possibleConstructorReturn(this, _getPrototypeOf(PaintEditorWrapper).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_2___default()(_assertThisInitialized(_this), ['handleUpdateImage', 'handleUpdateName']); return _this; } _createClass(PaintEditorWrapper, [{ key: "shouldComponentUpdate", value: function shouldComponentUpdate(nextProps) { return this.props.imageId !== nextProps.imageId || this.props.rtl !== nextProps.rtl || this.props.name !== nextProps.name; } }, { key: "handleUpdateName", value: function handleUpdateName(name) { this.props.vm.renameCostume(this.props.selectedCostumeIndex, name); } }, { key: "handleUpdateImage", value: function handleUpdateImage(isVector, image, rotationCenterX, rotationCenterY) { if (isVector) { this.props.vm.updateSvg(this.props.selectedCostumeIndex, image, rotationCenterX, rotationCenterY); } else { this.props.vm.updateBitmap(this.props.selectedCostumeIndex, image, rotationCenterX, rotationCenterY, 2 /* bitmapResolution */ ); } } }, { key: "render", value: function render() { if (!this.props.imageId) return null; var _this$props = this.props, selectedCostumeIndex = _this$props.selectedCostumeIndex, vm = _this$props.vm, componentProps = _objectWithoutProperties(_this$props, ["selectedCostumeIndex", "vm"]); return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(scratch_paint__WEBPACK_IMPORTED_MODULE_4__["default"], _extends({}, componentProps, { image: vm.getCostume(selectedCostumeIndex), onUpdateImage: this.handleUpdateImage, onUpdateName: this.handleUpdateName })); } }]); return PaintEditorWrapper; }(react__WEBPACK_IMPORTED_MODULE_1___default.a.Component); PaintEditorWrapper.propTypes = { imageFormat: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string.isRequired, imageId: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string.isRequired, name: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, rotationCenterX: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number, rotationCenterY: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number, rtl: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, selectedCostumeIndex: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number.isRequired, vm: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.instanceOf(scratch_vm__WEBPACK_IMPORTED_MODULE_3___default.a) }; var mapStateToProps = function mapStateToProps(state, _ref) { var selectedCostumeIndex = _ref.selectedCostumeIndex; var targetId = state.scratchGui.vm.editingTarget.id; var sprite = state.scratchGui.vm.editingTarget.sprite; // Make sure the costume index doesn't go out of range. var index = selectedCostumeIndex < sprite.costumes.length ? selectedCostumeIndex : sprite.costumes.length - 1; var costume = state.scratchGui.vm.editingTarget.sprite.costumes[index]; return { name: costume && costume.name, rotationCenterX: costume && costume.rotationCenterX, rotationCenterY: costume && costume.rotationCenterY, imageFormat: costume && costume.dataFormat, imageId: targetId && "".concat(targetId).concat(costume.skinId), rtl: state.locales.isRtl, selectedCostumeIndex: index, vm: state.scratchGui.vm, zoomLevelId: targetId }; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_redux__WEBPACK_IMPORTED_MODULE_5__["connect"])(mapStateToProps)(PaintEditorWrapper)); /***/ }), /***/ "./src/containers/playback-step.jsx": /*!******************************************!*\ !*** ./src/containers/playback-step.jsx ***! \******************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _components_record_modal_playback_step_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/record-modal/playback-step.jsx */ "./src/components/record-modal/playback-step.jsx"); /* harmony import */ var _lib_audio_audio_buffer_player_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/audio/audio-buffer-player.js */ "./src/lib/audio/audio-buffer-player.js"); function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var PlaybackStep = /*#__PURE__*/ function (_React$Component) { _inherits(PlaybackStep, _React$Component); function PlaybackStep(props) { var _this; _classCallCheck(this, PlaybackStep); _this = _possibleConstructorReturn(this, _getPrototypeOf(PlaybackStep).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_2___default()(_assertThisInitialized(_this), ['handlePlay', 'handleStopPlaying']); return _this; } _createClass(PlaybackStep, [{ key: "componentDidMount", value: function componentDidMount() { this.audioBufferPlayer = new _lib_audio_audio_buffer_player_js__WEBPACK_IMPORTED_MODULE_4__["default"](this.props.samples, this.props.sampleRate); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.audioBufferPlayer.stop(); } }, { key: "handlePlay", value: function handlePlay() { this.audioBufferPlayer.play(this.props.trimStart, this.props.trimEnd, this.props.onSetPlayhead, this.props.onStopPlaying); this.props.onPlay(); } }, { key: "handleStopPlaying", value: function handleStopPlaying() { this.audioBufferPlayer.stop(); this.props.onStopPlaying(); } }, { key: "render", value: function render() { var _this$props = this.props, sampleRate = _this$props.sampleRate, onPlay = _this$props.onPlay, onStopPlaying = _this$props.onStopPlaying, onSetPlayhead = _this$props.onSetPlayhead, componentProps = _objectWithoutProperties(_this$props, ["sampleRate", "onPlay", "onStopPlaying", "onSetPlayhead"]); return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_record_modal_playback_step_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], _extends({ onPlay: this.handlePlay, onStopPlaying: this.handleStopPlaying }, componentProps)); } }]); return PlaybackStep; }(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component); PlaybackStep.propTypes = _objectSpread({ sampleRate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number.isRequired, samples: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.instanceOf(Float32Array).isRequired }, _components_record_modal_playback_step_jsx__WEBPACK_IMPORTED_MODULE_3__["default"].propTypes); /* harmony default export */ __webpack_exports__["default"] = (PlaybackStep); /***/ }), /***/ "./src/containers/project-watcher.jsx": /*!********************************************!*\ !*** ./src/containers/project-watcher.jsx ***! \********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _reducers_project_state__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../reducers/project-state */ "./src/reducers/project-state.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } /** * Watches for project to finish updating before taking some action. * * To use ProjectWatcher, pass it a callback function using the onDoneUpdating prop. * ProjectWatcher passes a waitForUpdate function to its children, which they can call * to set ProjectWatcher to request that it call the onDoneUpdating callback when * project is no longer updating. */ var ProjectWatcher = /*#__PURE__*/ function (_React$Component) { _inherits(ProjectWatcher, _React$Component); function ProjectWatcher(props) { var _this; _classCallCheck(this, ProjectWatcher); _this = _possibleConstructorReturn(this, _getPrototypeOf(ProjectWatcher).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['waitForUpdate']); _this.state = { waiting: false }; return _this; } _createClass(ProjectWatcher, [{ key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (this.state.waiting && this.props.isShowingWithId && !prevProps.isShowingWithId) { this.fulfill(); } } }, { key: "fulfill", value: function fulfill() { this.props.onDoneUpdating(); this.setState({ // eslint-disable-line react/no-did-update-set-state waiting: false }); } }, { key: "waitForUpdate", value: function waitForUpdate(isUpdating) { if (isUpdating) { this.setState({ waiting: true }); } else { // fulfill immediately this.fulfill(); } } }, { key: "render", value: function render() { return this.props.children(this.waitForUpdate); } }]); return ProjectWatcher; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.Component); ProjectWatcher.propTypes = { children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, isShowingWithId: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, onDoneUpdating: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func }; ProjectWatcher.defaultProps = { onDoneUpdating: function onDoneUpdating() {} }; var mapStateToProps = function mapStateToProps(state) { var loadingState = state.scratchGui.projectState.loadingState; return { isShowingWithId: Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_4__["getIsShowingWithId"])(loadingState) }; }; var mapDispatchToProps = function mapDispatchToProps() { return {}; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_redux__WEBPACK_IMPORTED_MODULE_3__["connect"])(mapStateToProps, mapDispatchToProps)(ProjectWatcher)); /***/ }), /***/ "./src/containers/prompt.jsx": /*!***********************************!*\ !*** ./src/containers/prompt.jsx ***! \***********************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _components_prompt_prompt_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/prompt/prompt.jsx */ "./src/components/prompt/prompt.jsx"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! scratch-vm */ "./node_modules/scratch-vm/src/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(scratch_vm__WEBPACK_IMPORTED_MODULE_4__); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var Prompt = /*#__PURE__*/ function (_React$Component) { _inherits(Prompt, _React$Component); function Prompt(props) { var _this; _classCallCheck(this, Prompt); _this = _possibleConstructorReturn(this, _getPrototypeOf(Prompt).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_2___default()(_assertThisInitialized(_this), ['handleOk', 'handleScopeOptionSelection', 'handleCancel', 'handleChange', 'handleKeyPress', 'handleCloudVariableOptionChange']); _this.state = { inputValue: '', globalSelected: true, cloudSelected: false, canAddCloudVariable: props.vm && props.vm.runtime.canAddCloudVariable() || false }; return _this; } _createClass(Prompt, [{ key: "handleKeyPress", value: function handleKeyPress(event) { if (event.key === 'Enter') this.handleOk(); } }, { key: "handleFocus", value: function handleFocus(event) { event.target.select(); } }, { key: "handleOk", value: function handleOk() { this.props.onOk(this.state.inputValue, { scope: this.state.globalSelected ? 'global' : 'local', isCloud: this.state.cloudSelected }); } }, { key: "handleCancel", value: function handleCancel() { this.props.onCancel(); } }, { key: "handleChange", value: function handleChange(e) { this.setState({ inputValue: e.target.value }); } }, { key: "handleScopeOptionSelection", value: function handleScopeOptionSelection(e) { this.setState({ globalSelected: e.target.value === 'global' }); } }, { key: "handleCloudVariableOptionChange", value: function handleCloudVariableOptionChange(e) { if (!this.props.showCloudOption) return; var checked = e.target.checked; this.setState({ cloudSelected: checked }); if (checked) { this.setState({ globalSelected: true }); } } }, { key: "render", value: function render() { return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_components_prompt_prompt_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { canAddCloudVariable: this.state.canAddCloudVariable, cloudSelected: this.state.cloudSelected, defaultValue: this.props.defaultValue, globalSelected: this.state.globalSelected, isStage: this.props.isStage, label: this.props.label, showCloudOption: this.props.showCloudOption, showVariableOptions: this.props.showVariableOptions, title: this.props.title, onCancel: this.handleCancel, onChange: this.handleChange, onCloudVarOptionChange: this.handleCloudVariableOptionChange, onFocus: this.handleFocus, onKeyPress: this.handleKeyPress, onOk: this.handleOk, onScopeOptionSelection: this.handleScopeOptionSelection }); } }]); return Prompt; }(react__WEBPACK_IMPORTED_MODULE_1___default.a.Component); Prompt.propTypes = { defaultValue: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, isStage: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool.isRequired, label: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string.isRequired, onCancel: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onOk: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, showCloudOption: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool.isRequired, showVariableOptions: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool.isRequired, title: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string.isRequired, vm: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.instanceOf(scratch_vm__WEBPACK_IMPORTED_MODULE_4___default.a) }; /* harmony default export */ __webpack_exports__["default"] = (Prompt); /***/ }), /***/ "./src/containers/question.jsx": /*!*************************************!*\ !*** ./src/containers/question.jsx ***! \*************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _components_question_question_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/question/question.jsx */ "./src/components/question/question.jsx"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var Question = /*#__PURE__*/ function (_React$Component) { _inherits(Question, _React$Component); function Question(props) { var _this; _classCallCheck(this, Question); _this = _possibleConstructorReturn(this, _getPrototypeOf(Question).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_2___default()(_assertThisInitialized(_this), ['handleChange', 'handleKeyPress', 'handleSubmit']); _this.state = { answer: '' }; return _this; } _createClass(Question, [{ key: "handleChange", value: function handleChange(e) { this.setState({ answer: e.target.value }); } }, { key: "handleKeyPress", value: function handleKeyPress(event) { if (event.key === 'Enter') this.handleSubmit(); } }, { key: "handleSubmit", value: function handleSubmit() { this.props.onQuestionAnswered(this.state.answer); } }, { key: "render", value: function render() { return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_components_question_question_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { answer: this.state.answer, question: this.props.question, onChange: this.handleChange, onClick: this.handleSubmit, onKeyPress: this.handleKeyPress }); } }]); return Question; }(react__WEBPACK_IMPORTED_MODULE_1___default.a.Component); Question.propTypes = { onQuestionAnswered: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, question: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string }; /* harmony default export */ __webpack_exports__["default"] = (Question); /***/ }), /***/ "./src/containers/record-modal.jsx": /*!*****************************************!*\ !*** ./src/containers/record-modal.jsx ***! \*****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! scratch-vm */ "./node_modules/scratch-vm/src/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(scratch_vm__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var wav_encoder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! wav-encoder */ "./node_modules/wav-encoder/index.js"); /* harmony import */ var wav_encoder__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(wav_encoder__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _components_record_modal_record_modal_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../components/record-modal/record-modal.jsx */ "./src/components/record-modal/record-modal.jsx"); /* harmony import */ var _reducers_modals__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../reducers/modals */ "./src/reducers/modals.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var RecordModal = /*#__PURE__*/ function (_React$Component) { _inherits(RecordModal, _React$Component); function RecordModal(props) { var _this; _classCallCheck(this, RecordModal); _this = _possibleConstructorReturn(this, _getPrototypeOf(RecordModal).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['handleRecord', 'handleStopRecording', 'handlePlay', 'handleStopPlaying', 'handleBack', 'handleSubmit', 'handleCancel', 'handleSetPlayhead', 'handleSetTrimStart', 'handleSetTrimEnd']); _this.state = { samples: null, encoding: false, levels: null, playhead: null, playing: false, recording: false, sampleRate: null, trimStart: 0, trimEnd: 1 }; return _this; } _createClass(RecordModal, [{ key: "handleRecord", value: function handleRecord() { this.setState({ recording: true }); } }, { key: "handleStopRecording", value: function handleStopRecording(samples, sampleRate, levels, trimStart, trimEnd) { if (samples.length > 0) { this.setState({ samples: samples, sampleRate: sampleRate, levels: levels, trimStart: trimStart, trimEnd: trimEnd, recording: false }); } } }, { key: "handlePlay", value: function handlePlay() { this.setState({ playing: true }); } }, { key: "handleStopPlaying", value: function handleStopPlaying() { this.setState({ playing: false, playhead: null }); } }, { key: "handleBack", value: function handleBack() { this.setState({ playing: false, samples: null }); } }, { key: "handleSetTrimEnd", value: function handleSetTrimEnd(trimEnd) { this.setState({ trimEnd: trimEnd }); } }, { key: "handleSetTrimStart", value: function handleSetTrimStart(trimStart) { this.setState({ trimStart: trimStart }); } }, { key: "handleSetPlayhead", value: function handleSetPlayhead(playhead) { this.setState({ playhead: playhead }); } }, { key: "handleSubmit", value: function handleSubmit() { var _this2 = this; this.setState({ encoding: true }, function () { var sampleCount = _this2.state.samples.length; var startIndex = Math.floor(_this2.state.trimStart * sampleCount); var endIndex = Math.floor(_this2.state.trimEnd * sampleCount); var clippedSamples = _this2.state.samples.slice(startIndex, endIndex); wav_encoder__WEBPACK_IMPORTED_MODULE_4___default.a.encode({ sampleRate: _this2.state.sampleRate, channelData: [clippedSamples] }).then(function (wavBuffer) { var vmSound = { format: '', dataFormat: 'wav', rate: _this2.state.sampleRate, sampleCount: clippedSamples.length }; // Create an asset from the encoded .wav and get resulting md5 var storage = _this2.props.vm.runtime.storage; vmSound.asset = storage.createAsset(storage.AssetType.Sound, storage.DataFormat.WAV, new Uint8Array(wavBuffer), null, true // generate md5 ); vmSound.assetId = vmSound.asset.assetId; // update vmSound object with md5 property vmSound.md5 = "".concat(vmSound.assetId, ".").concat(vmSound.dataFormat); // The VM will update the sound name to a fresh name // if the following is already taken vmSound.name = 'recording1'; _this2.props.vm.addSound(vmSound).then(function () { _this2.props.onClose(); _this2.props.onNewSound(); }); }); }); } }, { key: "handleCancel", value: function handleCancel() { this.props.onClose(); } }, { key: "render", value: function render() { return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_components_record_modal_record_modal_jsx__WEBPACK_IMPORTED_MODULE_6__["default"], { encoding: this.state.encoding, levels: this.state.levels, playhead: this.state.playhead, playing: this.state.playing, recording: this.state.recording, sampleRate: this.state.sampleRate, samples: this.state.samples, trimEnd: this.state.trimEnd, trimStart: this.state.trimStart, onBack: this.handleBack, onCancel: this.handleCancel, onPlay: this.handlePlay, onRecord: this.handleRecord, onSetPlayhead: this.handleSetPlayhead, onSetTrimEnd: this.handleSetTrimEnd, onSetTrimStart: this.handleSetTrimStart, onStopPlaying: this.handleStopPlaying, onStopRecording: this.handleStopRecording, onSubmit: this.handleSubmit }); } }]); return RecordModal; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.Component); RecordModal.propTypes = { onClose: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onNewSound: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, vm: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.instanceOf(scratch_vm__WEBPACK_IMPORTED_MODULE_3___default.a) }; var mapStateToProps = function mapStateToProps(state) { return { vm: state.scratchGui.vm }; }; var mapDispatchToProps = function mapDispatchToProps(dispatch) { return { onClose: function onClose() { dispatch(Object(_reducers_modals__WEBPACK_IMPORTED_MODULE_7__["closeSoundRecorder"])()); } }; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_redux__WEBPACK_IMPORTED_MODULE_5__["connect"])(mapStateToProps, mapDispatchToProps)(RecordModal)); /***/ }), /***/ "./src/containers/recording-step.jsx": /*!*******************************************!*\ !*** ./src/containers/recording-step.jsx ***! \*******************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _components_record_modal_recording_step_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/record-modal/recording-step.jsx */ "./src/components/record-modal/recording-step.jsx"); /* harmony import */ var _lib_audio_audio_recorder_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/audio/audio-recorder.js */ "./src/lib/audio/audio-recorder.js"); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_5__["defineMessages"])({ alertMsg: { "id": "gui.recordingStep.alertMsg", "defaultMessage": "Could not start recording" } }); var RecordingStep = /*#__PURE__*/ function (_React$Component) { _inherits(RecordingStep, _React$Component); function RecordingStep(props) { var _this; _classCallCheck(this, RecordingStep); _this = _possibleConstructorReturn(this, _getPrototypeOf(RecordingStep).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_2___default()(_assertThisInitialized(_this), ['handleRecord', 'handleStopRecording', 'handleStarted', 'handleLevelUpdate', 'handleRecordingError']); _this.state = { listening: false, level: 0, levels: null }; return _this; } _createClass(RecordingStep, [{ key: "componentDidMount", value: function componentDidMount() { this.audioRecorder = new _lib_audio_audio_recorder_js__WEBPACK_IMPORTED_MODULE_4__["default"](); this.audioRecorder.startListening(this.handleStarted, this.handleLevelUpdate, this.handleRecordingError); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.audioRecorder.dispose(); } }, { key: "handleStarted", value: function handleStarted() { this.setState({ listening: true }); } }, { key: "handleRecordingError", value: function handleRecordingError() { alert(this.props.intl.formatMessage(messages.alertMsg)); // eslint-disable-line no-alert } }, { key: "handleLevelUpdate", value: function handleLevelUpdate(level) { this.setState({ level: level }); if (this.props.recording) { this.setState({ levels: (this.state.levels || []).concat([level]) }); } } }, { key: "handleRecord", value: function handleRecord() { this.audioRecorder.startRecording(); this.props.onRecord(); } }, { key: "handleStopRecording", value: function handleStopRecording() { var _this$audioRecorder$s = this.audioRecorder.stop(), samples = _this$audioRecorder$s.samples, sampleRate = _this$audioRecorder$s.sampleRate, levels = _this$audioRecorder$s.levels, trimStart = _this$audioRecorder$s.trimStart, trimEnd = _this$audioRecorder$s.trimEnd; this.props.onStopRecording(samples, sampleRate, levels, trimStart, trimEnd); } }, { key: "render", value: function render() { var _this$props = this.props, onRecord = _this$props.onRecord, onStopRecording = _this$props.onStopRecording, componentProps = _objectWithoutProperties(_this$props, ["onRecord", "onStopRecording"]); return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_record_modal_recording_step_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], _extends({ level: this.state.level, levels: this.state.levels, listening: this.state.listening, onRecord: this.handleRecord, onStopRecording: this.handleStopRecording }, componentProps)); } }]); return RecordingStep; }(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component); RecordingStep.propTypes = { intl: react_intl__WEBPACK_IMPORTED_MODULE_5__["intlShape"].isRequired, onRecord: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, onStopRecording: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, recording: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_5__["injectIntl"])(RecordingStep)); /***/ }), /***/ "./src/containers/sb-file-uploader.jsx": /*!*********************************************!*\ !*** ./src/containers/sb-file-uploader.jsx ***! \*********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _lib_log__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../lib/log */ "./src/lib/log.js"); /* harmony import */ var _lib_shared_messages__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lib/shared-messages */ "./src/lib/shared-messages.js"); /* harmony import */ var _reducers_project_state__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../reducers/project-state */ "./src/reducers/project-state.js"); /* harmony import */ var _reducers_modals__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../reducers/modals */ "./src/reducers/modals.js"); /* harmony import */ var _reducers_menus__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../reducers/menus */ "./src/reducers/menus.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } /** * SBFileUploader component passes a file input, load handler and props to its child. * It expects this child to be a function with the signature * function (renderFileInput, loadProject) {} * The component can then be used to attach project loading functionality * to any other component: * * {(renderFileInput, loadProject) => ( * * {renderFileInput()} * * )} */ var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_4__["defineMessages"])({ loadError: { "id": "gui.projectLoader.loadError", "defaultMessage": "The project file that was selected failed to load." } }); var SBFileUploader = /*#__PURE__*/ function (_React$Component) { _inherits(SBFileUploader, _React$Component); function SBFileUploader(props) { var _this; _classCallCheck(this, SBFileUploader); _this = _possibleConstructorReturn(this, _getPrototypeOf(SBFileUploader).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['getProjectTitleFromFilename', 'renderFileInput', 'setFileInput', 'handleChange', 'handleClick', 'onload', 'resetFileInput']); return _this; } _createClass(SBFileUploader, [{ key: "componentWillMount", value: function componentWillMount() { this.reader = new FileReader(); this.reader.onload = this.onload; this.resetFileInput(); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (this.props.isLoadingUpload && !prevProps.isLoadingUpload && this.fileToUpload && this.reader) { this.reader.readAsArrayBuffer(this.fileToUpload); } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.reader = null; this.resetFileInput(); } }, { key: "resetFileInput", value: function resetFileInput() { this.fileToUpload = null; if (this.fileInput) { this.fileInput.value = null; } } }, { key: "getProjectTitleFromFilename", value: function getProjectTitleFromFilename(fileInputFilename) { if (!fileInputFilename) return ''; // only parse title with valid scratch project extensions // (.sb, .sb2, and .sb3) var matches = fileInputFilename.match(/^(.*)\.sb[23]?$/); if (!matches) return ''; return matches[1].substring(0, 100); // truncate project title to max 100 chars } // called when user has finished selecting a file to upload }, { key: "handleChange", value: function handleChange(e) { var _this$props = this.props, intl = _this$props.intl, isShowingWithoutId = _this$props.isShowingWithoutId, loadingState = _this$props.loadingState, projectChanged = _this$props.projectChanged, userOwnsProject = _this$props.userOwnsProject; var thisFileInput = e.target; if (thisFileInput.files) { // Don't attempt to load if no file was selected this.fileToUpload = thisFileInput.files[0]; // If user owns the project, or user has changed the project, // we must confirm with the user that they really intend to replace it. // (If they don't own the project and haven't changed it, no need to confirm.) var uploadAllowed = true; if (userOwnsProject || projectChanged && isShowingWithoutId) { uploadAllowed = confirm( // eslint-disable-line no-alert intl.formatMessage(_lib_shared_messages__WEBPACK_IMPORTED_MODULE_6__["default"].replaceProjectWarning)); } if (uploadAllowed) { this.props.requestProjectUpload(loadingState); } else { this.props.closeFileMenu(); } } } // called when file upload raw data is available in the reader }, { key: "onload", value: function onload() { var _this2 = this; if (this.reader) { this.props.onLoadingStarted(); var filename = this.fileToUpload && this.fileToUpload.name; this.props.vm.loadProject(this.reader.result).then(function () { _this2.props.onLoadingFinished(_this2.props.loadingState, true); // Reset the file input after project is loaded // This is necessary in case the user wants to reload a project if (filename) { var uploadedProjectTitle = _this2.getProjectTitleFromFilename(filename); _this2.props.onUpdateProjectTitle(uploadedProjectTitle); } _this2.resetFileInput(); }).catch(function (error) { _lib_log__WEBPACK_IMPORTED_MODULE_5__["default"].warn(error); alert(_this2.props.intl.formatMessage(messages.loadError)); // eslint-disable-line no-alert _this2.props.onLoadingFinished(_this2.props.loadingState, false); // Reset the file input after project is loaded // This is necessary in case the user wants to reload a project _this2.resetFileInput(); }); } } }, { key: "handleClick", value: function handleClick() { // open filesystem browsing window this.fileInput.click(); } }, { key: "setFileInput", value: function setFileInput(input) { this.fileInput = input; } }, { key: "renderFileInput", value: function renderFileInput() { return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("input", { accept: ".sb,.sb2,.sb3", ref: this.setFileInput, style: { display: 'none' }, type: "file", onChange: this.handleChange }); } }, { key: "render", value: function render() { return this.props.children(this.props.className, this.renderFileInput, this.handleClick); } }]); return SBFileUploader; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.Component); SBFileUploader.propTypes = { canSave: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, // eslint-disable-line react/no-unused-prop-types children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, className: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, closeFileMenu: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, intl: react_intl__WEBPACK_IMPORTED_MODULE_4__["intlShape"].isRequired, isLoadingUpload: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, isShowingWithoutId: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, loadingState: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOf(_reducers_project_state__WEBPACK_IMPORTED_MODULE_7__["LoadingStates"]), onLoadingFinished: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onLoadingStarted: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onUpdateProjectTitle: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, projectChanged: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, requestProjectUpload: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, userOwnsProject: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, vm: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.shape({ loadProject: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func }) }; SBFileUploader.defaultProps = { className: '' }; var mapStateToProps = function mapStateToProps(state) { var loadingState = state.scratchGui.projectState.loadingState; return { isLoadingUpload: Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_7__["getIsLoadingUpload"])(loadingState), isShowingWithoutId: Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_7__["getIsShowingWithoutId"])(loadingState), loadingState: loadingState, projectChanged: state.scratchGui.projectChanged, vm: state.scratchGui.vm }; }; var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { return { closeFileMenu: function closeFileMenu() { return dispatch(Object(_reducers_menus__WEBPACK_IMPORTED_MODULE_9__["closeFileMenu"])()); }, onLoadingFinished: function onLoadingFinished(loadingState, success) { dispatch(Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_7__["onLoadedProject"])(loadingState, ownProps.canSave, success)); dispatch(Object(_reducers_modals__WEBPACK_IMPORTED_MODULE_8__["closeLoadingProject"])()); dispatch(Object(_reducers_menus__WEBPACK_IMPORTED_MODULE_9__["closeFileMenu"])()); }, requestProjectUpload: function requestProjectUpload(loadingState) { return dispatch(Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_7__["requestProjectUpload"])(loadingState)); }, onLoadingStarted: function onLoadingStarted() { return dispatch(Object(_reducers_modals__WEBPACK_IMPORTED_MODULE_8__["openLoadingProject"])()); } }; }; // Allow incoming props to override redux-provided props. Used to mock in tests. var mergeProps = function mergeProps(stateProps, dispatchProps, ownProps) { return Object.assign({}, stateProps, dispatchProps, ownProps); }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_redux__WEBPACK_IMPORTED_MODULE_3__["connect"])(mapStateToProps, mapDispatchToProps, mergeProps)(Object(react_intl__WEBPACK_IMPORTED_MODULE_4__["injectIntl"])(SBFileUploader))); /***/ }), /***/ "./src/containers/sb3-downloader.jsx": /*!*******************************************!*\ !*** ./src/containers/sb3-downloader.jsx ***! \*******************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _reducers_project_title__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../reducers/project-title */ "./src/reducers/project-title.js"); /* harmony import */ var _lib_download_blob__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../lib/download-blob */ "./src/lib/download-blob.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } /** * Project saver component passes a downloadProject function to its child. * It expects this child to be a function with the signature * function (downloadProject, props) {} * The component can then be used to attach project saving functionality * to any other component: * * {(downloadProject, props) => ( * * )} */ var SB3Downloader = /*#__PURE__*/ function (_React$Component) { _inherits(SB3Downloader, _React$Component); function SB3Downloader(props) { var _this; _classCallCheck(this, SB3Downloader); _this = _possibleConstructorReturn(this, _getPrototypeOf(SB3Downloader).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['downloadProject']); return _this; } _createClass(SB3Downloader, [{ key: "downloadProject", value: function downloadProject() { var _this2 = this; this.props.saveProjectSb3().then(function (content) { if (_this2.props.onSaveFinished) { _this2.props.onSaveFinished(); } Object(_lib_download_blob__WEBPACK_IMPORTED_MODULE_5__["default"])(_this2.props.projectFilename, content); }); } }, { key: "render", value: function render() { var children = this.props.children; return children(this.props.className, this.downloadProject); } }]); return SB3Downloader; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.Component); var getProjectFilename = function getProjectFilename(curTitle, defaultTitle) { var filenameTitle = curTitle; if (!filenameTitle || filenameTitle.length === 0) { filenameTitle = defaultTitle; } return "".concat(filenameTitle.substring(0, 100), ".sb3"); }; SB3Downloader.propTypes = { children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, className: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, onSaveFinished: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, projectFilename: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, saveProjectSb3: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func }; SB3Downloader.defaultProps = { className: '' }; var mapStateToProps = function mapStateToProps(state) { return { saveProjectSb3: state.scratchGui.vm.saveProjectSb3.bind(state.scratchGui.vm), projectFilename: getProjectFilename(state.scratchGui.projectTitle, _reducers_project_title__WEBPACK_IMPORTED_MODULE_4__["projectTitleInitialState"]) }; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_redux__WEBPACK_IMPORTED_MODULE_3__["connect"])(mapStateToProps, function () { return {}; } // omit dispatch prop )(SB3Downloader)); /***/ }), /***/ "./src/containers/scanning-step.jsx": /*!******************************************!*\ !*** ./src/containers/scanning-step.jsx ***! \******************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _components_connection_modal_scanning_step_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/connection-modal/scanning-step.jsx */ "./src/components/connection-modal/scanning-step.jsx"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! scratch-vm */ "./node_modules/scratch-vm/src/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(scratch_vm__WEBPACK_IMPORTED_MODULE_4__); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var ScanningStep = /*#__PURE__*/ function (_React$Component) { _inherits(ScanningStep, _React$Component); function ScanningStep(props) { var _this; _classCallCheck(this, ScanningStep); _this = _possibleConstructorReturn(this, _getPrototypeOf(ScanningStep).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_2___default()(_assertThisInitialized(_this), ['handlePeripheralListUpdate', 'handlePeripheralScanTimeout', 'handleRefresh']); _this.state = { scanning: true, peripheralList: [] }; return _this; } _createClass(ScanningStep, [{ key: "componentDidMount", value: function componentDidMount() { this.props.vm.scanForPeripheral(this.props.extensionId); this.props.vm.on('PERIPHERAL_LIST_UPDATE', this.handlePeripheralListUpdate); this.props.vm.on('PERIPHERAL_SCAN_TIMEOUT', this.handlePeripheralScanTimeout); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { // @todo: stop the peripheral scan here this.props.vm.removeListener('PERIPHERAL_LIST_UPDATE', this.handlePeripheralListUpdate); this.props.vm.removeListener('PERIPHERAL_SCAN_TIMEOUT', this.handlePeripheralScanTimeout); } }, { key: "handlePeripheralScanTimeout", value: function handlePeripheralScanTimeout() { this.setState({ scanning: false, peripheralList: [] }); } }, { key: "handlePeripheralListUpdate", value: function handlePeripheralListUpdate(newList) { // TODO: sort peripherals by signal strength? so they don't jump around var peripheralArray = Object.keys(newList).map(function (id) { return newList[id]; }); this.setState({ peripheralList: peripheralArray }); } }, { key: "handleRefresh", value: function handleRefresh() { this.props.vm.scanForPeripheral(this.props.extensionId); this.setState({ scanning: true, peripheralList: [] }); } }, { key: "render", value: function render() { return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_components_connection_modal_scanning_step_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { connectionSmallIconURL: this.props.connectionSmallIconURL, peripheralList: this.state.peripheralList, phase: this.state.phase, scanning: this.state.scanning, title: this.props.extensionId, onConnected: this.props.onConnected, onConnecting: this.props.onConnecting, onRefresh: this.handleRefresh }); } }]); return ScanningStep; }(react__WEBPACK_IMPORTED_MODULE_1___default.a.Component); ScanningStep.propTypes = { connectionSmallIconURL: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, extensionId: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string.isRequired, onConnected: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onConnecting: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, vm: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.instanceOf(scratch_vm__WEBPACK_IMPORTED_MODULE_4___default.a).isRequired }; /* harmony default export */ __webpack_exports__["default"] = (ScanningStep); /***/ }), /***/ "./src/containers/slider-monitor.jsx": /*!*******************************************!*\ !*** ./src/containers/slider-monitor.jsx ***! \*******************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! scratch-vm */ "./node_modules/scratch-vm/src/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(scratch_vm__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_variable_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/variable-utils */ "./src/lib/variable-utils.js"); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _components_monitor_slider_monitor_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../components/monitor/slider-monitor.jsx */ "./src/components/monitor/slider-monitor.jsx"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var SliderMonitor = /*#__PURE__*/ function (_React$Component) { _inherits(SliderMonitor, _React$Component); function SliderMonitor(props) { var _this; _classCallCheck(this, SliderMonitor); _this = _possibleConstructorReturn(this, _getPrototypeOf(SliderMonitor).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['handleSliderUpdate']); _this.state = { value: props.value }; return _this; } _createClass(SliderMonitor, [{ key: "componentWillReceiveProps", value: function componentWillReceiveProps(nextProps) { if (this.state.value !== nextProps.value) { this.setState({ value: nextProps.value }); } } }, { key: "handleSliderUpdate", value: function handleSliderUpdate(e) { this.setState({ value: Number(e.target.value) }); var _this$props = this.props, vm = _this$props.vm, targetId = _this$props.targetId, variableId = _this$props.id; Object(_lib_variable_utils__WEBPACK_IMPORTED_MODULE_4__["setVariableValue"])(vm, targetId, variableId, Number(e.target.value)); } }, { key: "render", value: function render() { var _this$props2 = this.props, vm = _this$props2.vm, value = _this$props2.value, props = _objectWithoutProperties(_this$props2, ["vm", "value"]); return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_components_monitor_slider_monitor_jsx__WEBPACK_IMPORTED_MODULE_6__["default"], _extends({}, props, { value: this.state.value, onSliderUpdate: this.handleSliderUpdate })); } }]); return SliderMonitor; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.Component); SliderMonitor.propTypes = { id: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, targetId: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, value: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string]), vm: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.instanceOf(scratch_vm__WEBPACK_IMPORTED_MODULE_3___default.a) }; var mapStateToProps = function mapStateToProps(state) { return { vm: state.scratchGui.vm }; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_redux__WEBPACK_IMPORTED_MODULE_5__["connect"])(mapStateToProps)(SliderMonitor)); /***/ }), /***/ "./src/containers/slider-prompt.jsx": /*!******************************************!*\ !*** ./src/containers/slider-prompt.jsx ***! \******************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _components_slider_prompt_slider_prompt_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/slider-prompt/slider-prompt.jsx */ "./src/components/slider-prompt/slider-prompt.jsx"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var SliderPrompt = /*#__PURE__*/ function (_React$Component) { _inherits(SliderPrompt, _React$Component); function SliderPrompt(props) { var _this; _classCallCheck(this, SliderPrompt); _this = _possibleConstructorReturn(this, _getPrototypeOf(SliderPrompt).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_2___default()(_assertThisInitialized(_this), ['handleOk', 'handleCancel', 'handleChangeMin', 'handleChangeMax', 'handleKeyPress', 'validates', 'shouldBeDiscrete']); var _this$props = _this.props, isDiscrete = _this$props.isDiscrete, minValue = _this$props.minValue, maxValue = _this$props.maxValue; _this.state = { // For internal use, convert values to strings based on isDiscrete // This is because `` always returns values as strings. minValue: isDiscrete ? minValue.toFixed(0) : minValue.toFixed(2), maxValue: isDiscrete ? maxValue.toFixed(0) : maxValue.toFixed(2) }; return _this; } _createClass(SliderPrompt, [{ key: "handleKeyPress", value: function handleKeyPress(event) { if (event.key === 'Enter') this.handleOk(); } }, { key: "handleOk", value: function handleOk() { var _this$state = this.state, minValue = _this$state.minValue, maxValue = _this$state.maxValue; if (!this.validates(minValue, maxValue)) { this.props.onCancel(); return; } this.props.onOk(parseFloat(minValue), parseFloat(maxValue), this.shouldBeDiscrete(minValue, maxValue)); } }, { key: "handleCancel", value: function handleCancel() { this.props.onCancel(); } }, { key: "handleChangeMin", value: function handleChangeMin(e) { this.setState({ minValue: e.target.value }); } }, { key: "handleChangeMax", value: function handleChangeMax(e) { this.setState({ maxValue: e.target.value }); } }, { key: "shouldBeDiscrete", value: function shouldBeDiscrete(min, max) { return min.indexOf('.') + max.indexOf('.') === -2; // Both -1 } }, { key: "validates", value: function validates(min, max) { return isFinite(min) && isFinite(max); } }, { key: "render", value: function render() { return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_components_slider_prompt_slider_prompt_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { maxValue: this.state.maxValue, minValue: this.state.minValue, onCancel: this.handleCancel, onChangeMax: this.handleChangeMax, onChangeMin: this.handleChangeMin, onKeyPress: this.handleKeyPress, onOk: this.handleOk }); } }]); return SliderPrompt; }(react__WEBPACK_IMPORTED_MODULE_1___default.a.Component); SliderPrompt.propTypes = { isDiscrete: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, maxValue: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number, minValue: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number, onCancel: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onOk: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired }; SliderPrompt.defaultProps = { maxValue: 100, minValue: 0, isDiscrete: true }; /* harmony default export */ __webpack_exports__["default"] = (SliderPrompt); /***/ }), /***/ "./src/containers/sound-editor.jsx": /*!*****************************************!*\ !*** ./src/containers/sound-editor.jsx ***! \*****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var wav_encoder__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! wav-encoder */ "./node_modules/wav-encoder/index.js"); /* harmony import */ var wav_encoder__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(wav_encoder__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _lib_audio_audio_util_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../lib/audio/audio-util.js */ "./src/lib/audio/audio-util.js"); /* harmony import */ var _lib_audio_audio_effects_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lib/audio/audio-effects.js */ "./src/lib/audio/audio-effects.js"); /* harmony import */ var _components_sound_editor_sound_editor_jsx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../components/sound-editor/sound-editor.jsx */ "./src/components/sound-editor/sound-editor.jsx"); /* harmony import */ var _lib_audio_audio_buffer_player_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../lib/audio/audio-buffer-player.js */ "./src/lib/audio/audio-buffer-player.js"); /* harmony import */ var _lib_log_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../lib/log.js */ "./src/lib/log.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var UNDO_STACK_SIZE = 99; var SoundEditor = /*#__PURE__*/ function (_React$Component) { _inherits(SoundEditor, _React$Component); function SoundEditor(props) { var _this; _classCallCheck(this, SoundEditor); _this = _possibleConstructorReturn(this, _getPrototypeOf(SoundEditor).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['copyCurrentBuffer', 'handleStoppedPlaying', 'handleChangeName', 'handlePlay', 'handleStopPlaying', 'handleUpdatePlayhead', 'handleActivateTrim', 'handleUpdateTrimEnd', 'handleUpdateTrimStart', 'handleEffect', 'handleUndo', 'handleRedo', 'submitNewSamples']); _this.state = { chunkLevels: Object(_lib_audio_audio_util_js__WEBPACK_IMPORTED_MODULE_5__["computeChunkedRMS"])(_this.props.samples), playhead: null, // null is not playing, [0 -> 1] is playing percent trimStart: null, trimEnd: null }; _this.redoStack = []; _this.undoStack = []; return _this; } _createClass(SoundEditor, [{ key: "componentDidMount", value: function componentDidMount() { this.audioBufferPlayer = new _lib_audio_audio_buffer_player_js__WEBPACK_IMPORTED_MODULE_8__["default"](this.props.samples, this.props.sampleRate); } }, { key: "componentWillReceiveProps", value: function componentWillReceiveProps(newProps) { if (newProps.soundId !== this.props.soundId) { // A different sound has been selected this.redoStack = []; this.undoStack = []; this.resetState(newProps.samples, newProps.sampleRate); } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.audioBufferPlayer.stop(); } }, { key: "resetState", value: function resetState(samples, sampleRate) { this.audioBufferPlayer.stop(); this.audioBufferPlayer = new _lib_audio_audio_buffer_player_js__WEBPACK_IMPORTED_MODULE_8__["default"](samples, sampleRate); this.setState({ chunkLevels: Object(_lib_audio_audio_util_js__WEBPACK_IMPORTED_MODULE_5__["computeChunkedRMS"])(samples), playhead: null, trimStart: null, trimEnd: null }); } }, { key: "submitNewSamples", value: function submitNewSamples(samples, sampleRate, skipUndo) { // Encode the new sound into a wav so that it can be stored var wavBuffer = null; try { wavBuffer = wav_encoder__WEBPACK_IMPORTED_MODULE_3___default.a.encode.sync({ sampleRate: sampleRate, channelData: [samples] }); if (wavBuffer.byteLength > _lib_audio_audio_util_js__WEBPACK_IMPORTED_MODULE_5__["SOUND_BYTE_LIMIT"]) { // Cancel the sound update by setting to null wavBuffer = null; _lib_log_js__WEBPACK_IMPORTED_MODULE_9__["default"].error("Refusing to encode sound larger than ".concat(_lib_audio_audio_util_js__WEBPACK_IMPORTED_MODULE_5__["SOUND_BYTE_LIMIT"], " bytes")); } } catch (e) { // This error state is mostly for the mock sounds used during testing. // Any incorrect sound buffer trying to get interpretd as a Wav file // should yield this error. // This can also happen if the sound is too be allocated in memory. _lib_log_js__WEBPACK_IMPORTED_MODULE_9__["default"].error("Encountered error while trying to encode sound update: ".concat(e)); } // Do not submit sound if it could not be encoded (i.e. if too large) if (wavBuffer) { if (!skipUndo) { this.redoStack = []; if (this.undoStack.length >= UNDO_STACK_SIZE) { this.undoStack.shift(); // Drop the first element off the array } this.undoStack.push(this.copyCurrentBuffer()); } this.resetState(samples, sampleRate); this.props.vm.updateSoundBuffer(this.props.soundIndex, this.audioBufferPlayer.buffer, new Uint8Array(wavBuffer)); return true; // Update succeeded } return false; // Update failed } }, { key: "handlePlay", value: function handlePlay() { this.audioBufferPlayer.play(this.state.trimStart || 0, this.state.trimEnd || 1, this.handleUpdatePlayhead, this.handleStoppedPlaying); } }, { key: "handleStopPlaying", value: function handleStopPlaying() { this.audioBufferPlayer.stop(); this.handleStoppedPlaying(); } }, { key: "handleStoppedPlaying", value: function handleStoppedPlaying() { this.setState({ playhead: null }); } }, { key: "handleUpdatePlayhead", value: function handleUpdatePlayhead(playhead) { this.setState({ playhead: playhead }); } }, { key: "handleChangeName", value: function handleChangeName(name) { this.props.vm.renameSound(this.props.soundIndex, name); } }, { key: "handleActivateTrim", value: function handleActivateTrim() { if (this.state.trimStart === null && this.state.trimEnd === null) { this.setState({ trimEnd: 0.95, trimStart: 0.05 }); } else { var _this$copyCurrentBuff = this.copyCurrentBuffer(), samples = _this$copyCurrentBuff.samples, sampleRate = _this$copyCurrentBuff.sampleRate; var sampleCount = samples.length; var startIndex = Math.floor(this.state.trimStart * sampleCount); var endIndex = Math.floor(this.state.trimEnd * sampleCount); if (endIndex > startIndex) { // Strictly greater to prevent 0 sample sounds var clippedSamples = samples.slice(startIndex, endIndex); this.submitNewSamples(clippedSamples, sampleRate); } else { // Just clear the trim state, it cannot be completed this.setState({ trimStart: null, trimEnd: null }); } } } }, { key: "handleUpdateTrimEnd", value: function handleUpdateTrimEnd(trimEnd) { this.setState({ trimEnd: trimEnd }); } }, { key: "handleUpdateTrimStart", value: function handleUpdateTrimStart(trimStart) { this.setState({ trimStart: trimStart }); } }, { key: "effectFactory", value: function effectFactory(name) { var _this2 = this; return function () { return _this2.handleEffect(name); }; } }, { key: "copyCurrentBuffer", value: function copyCurrentBuffer() { // Cannot reliably use props.samples because it gets detached by Firefox return { samples: this.audioBufferPlayer.buffer.getChannelData(0), sampleRate: this.audioBufferPlayer.buffer.sampleRate }; } }, { key: "handleEffect", value: function handleEffect(name) { var _this3 = this; var effects = new _lib_audio_audio_effects_js__WEBPACK_IMPORTED_MODULE_6__["default"](this.audioBufferPlayer.buffer, name); effects.process(function (_ref) { var renderedBuffer = _ref.renderedBuffer; var samples = renderedBuffer.getChannelData(0); var sampleRate = renderedBuffer.sampleRate; var success = _this3.submitNewSamples(samples, sampleRate); if (success) _this3.handlePlay(); }); } }, { key: "handleUndo", value: function handleUndo() { this.redoStack.push(this.copyCurrentBuffer()); var _this$undoStack$pop = this.undoStack.pop(), samples = _this$undoStack$pop.samples, sampleRate = _this$undoStack$pop.sampleRate; if (samples) { this.submitNewSamples(samples, sampleRate, true); this.handlePlay(); } } }, { key: "handleRedo", value: function handleRedo() { var _this$redoStack$pop = this.redoStack.pop(), samples = _this$redoStack$pop.samples, sampleRate = _this$redoStack$pop.sampleRate; if (samples) { this.undoStack.push(this.copyCurrentBuffer()); this.submitNewSamples(samples, sampleRate, true); this.handlePlay(); } } }, { key: "render", value: function render() { var effectTypes = _lib_audio_audio_effects_js__WEBPACK_IMPORTED_MODULE_6__["default"].effectTypes; return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_components_sound_editor_sound_editor_jsx__WEBPACK_IMPORTED_MODULE_7__["default"], { canRedo: this.redoStack.length > 0, canUndo: this.undoStack.length > 0, chunkLevels: this.state.chunkLevels, name: this.props.name, playhead: this.state.playhead, trimEnd: this.state.trimEnd, trimStart: this.state.trimStart, onActivateTrim: this.handleActivateTrim, onChangeName: this.handleChangeName, onEcho: this.effectFactory(effectTypes.ECHO), onFaster: this.effectFactory(effectTypes.FASTER), onLouder: this.effectFactory(effectTypes.LOUDER), onPlay: this.handlePlay, onRedo: this.handleRedo, onReverse: this.effectFactory(effectTypes.REVERSE), onRobot: this.effectFactory(effectTypes.ROBOT), onSetTrimEnd: this.handleUpdateTrimEnd, onSetTrimStart: this.handleUpdateTrimStart, onSlower: this.effectFactory(effectTypes.SLOWER), onSofter: this.effectFactory(effectTypes.SOFTER), onStop: this.handleStopPlaying, onUndo: this.handleUndo }); } }]); return SoundEditor; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.Component); SoundEditor.propTypes = { name: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string.isRequired, sampleRate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, samples: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.instanceOf(Float32Array), soundId: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, soundIndex: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, vm: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.shape({ updateSoundBuffer: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, renameSound: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func }) }; var mapStateToProps = function mapStateToProps(state, _ref2) { var soundIndex = _ref2.soundIndex; var sprite = state.scratchGui.vm.editingTarget.sprite; // Make sure the sound index doesn't go out of range. var index = soundIndex < sprite.sounds.length ? soundIndex : sprite.sounds.length - 1; var sound = state.scratchGui.vm.editingTarget.sprite.sounds[index]; var audioBuffer = state.scratchGui.vm.getSoundBuffer(index); return { soundId: sound.soundId, sampleRate: audioBuffer.sampleRate, samples: audioBuffer.getChannelData(0), name: sound.name, vm: state.scratchGui.vm }; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_redux__WEBPACK_IMPORTED_MODULE_4__["connect"])(mapStateToProps)(SoundEditor)); /***/ }), /***/ "./src/containers/sound-library.jsx": /*!******************************************!*\ !*** ./src/containers/sound-library.jsx ***! \******************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! scratch-vm */ "./node_modules/scratch-vm/src/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(scratch_vm__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var scratch_audio__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! scratch-audio */ "./node_modules/scratch-audio/src/index.js"); /* harmony import */ var scratch_audio__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(scratch_audio__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _components_library_library_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../components/library/library.jsx */ "./src/components/library/library.jsx"); /* harmony import */ var _components_asset_panel_icon_sound_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../components/asset-panel/icon--sound.svg */ "./src/components/asset-panel/icon--sound.svg"); /* harmony import */ var _components_asset_panel_icon_sound_svg__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_components_asset_panel_icon_sound_svg__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _components_asset_panel_icon_sound_rtl_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../components/asset-panel/icon--sound-rtl.svg */ "./src/components/asset-panel/icon--sound-rtl.svg"); /* harmony import */ var _components_asset_panel_icon_sound_rtl_svg__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_components_asset_panel_icon_sound_rtl_svg__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _lib_libraries_sounds_json__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../lib/libraries/sounds.json */ "./src/lib/libraries/sounds.json"); var _lib_libraries_sounds_json__WEBPACK_IMPORTED_MODULE_9___namespace = /*#__PURE__*/__webpack_require__.t(/*! ../lib/libraries/sounds.json */ "./src/lib/libraries/sounds.json", 1); /* harmony import */ var _lib_libraries_sound_tags__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../lib/libraries/sound-tags */ "./src/lib/libraries/sound-tags.js"); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_3__["defineMessages"])({ libraryTitle: { "id": "gui.soundLibrary.chooseASound", "defaultMessage": "Choose a Sound" } }); var SoundLibrary = /*#__PURE__*/ function (_React$PureComponent) { _inherits(SoundLibrary, _React$PureComponent); function SoundLibrary(props) { var _this; _classCallCheck(this, SoundLibrary); _this = _possibleConstructorReturn(this, _getPrototypeOf(SoundLibrary).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['handleItemSelected', 'handleItemMouseEnter', 'handleItemMouseLeave']); /** * AudioEngine that will decode and play sounds for us. * @type {AudioEngine} */ _this.audioEngine = null; /** * A promise for the sound queued to play as soon as it loads and * decodes. * @type {Promise} */ _this.playingSoundPromise = null; return _this; } _createClass(SoundLibrary, [{ key: "componentDidMount", value: function componentDidMount() { this.audioEngine = new scratch_audio__WEBPACK_IMPORTED_MODULE_5___default.a(); this.playingSoundPromise = null; } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.stopPlayingSound(); } }, { key: "stopPlayingSound", value: function stopPlayingSound() { // Playback is queued, playing, or has played recently and finished // normally. if (this.playingSoundPromise !== null) { // Queued playback began playing before this method. if (this.playingSoundPromise.isPlaying) { // Fetch the player from the promise and stop playback soon. this.playingSoundPromise.then(function (soundPlayer) { soundPlayer.stop(); }); } else { // Fetch the player from the promise and stop immediately. Since // the sound is not playing yet, this callback will be called // immediately after the sound starts playback. Stopping it // immediately will have the effect of no sound being played. this.playingSoundPromise.then(function (soundPlayer) { soundPlayer.stopImmediately(); }); } // No further work should be performed on this promise and its // soundPlayer. this.playingSoundPromise = null; } } }, { key: "handleItemMouseEnter", value: function handleItemMouseEnter(soundItem) { var _this2 = this; var md5ext = soundItem._md5; var idParts = md5ext.split('.'); var md5 = idParts[0]; var vm = this.props.vm; // In case enter is called twice without a corresponding leave // inbetween, stop the last playback before queueing a new sound. this.stopPlayingSound(); // Save the promise so code to stop the sound may queue the stop // instruction after the play instruction. this.playingSoundPromise = vm.runtime.storage.load(vm.runtime.storage.AssetType.Sound, md5).then(function (soundAsset) { var sound = { md5: md5ext, name: soundItem.name, format: soundItem.format, data: soundAsset.data }; return _this2.audioEngine.decodeSoundPlayer(sound); }).then(function (soundPlayer) { soundPlayer.connect(_this2.audioEngine); // Play the sound. Playing the sound will always come before a // paired stop if the sound must stop early. soundPlayer.play(); // Set that the sound is playing. This affects the type of stop // instruction given if the sound must stop early. if (_this2.playingSoundPromise !== null) { _this2.playingSoundPromise.isPlaying = true; } return soundPlayer; }); } }, { key: "handleItemMouseLeave", value: function handleItemMouseLeave() { this.stopPlayingSound(); } }, { key: "handleItemSelected", value: function handleItemSelected(soundItem) { var _this3 = this; var vmSound = { format: soundItem.format, md5: soundItem._md5, rate: soundItem.rate, sampleCount: soundItem.sampleCount, name: soundItem.name }; this.props.vm.addSound(vmSound).then(function () { _this3.props.onNewSound(); }); } }, { key: "render", value: function render() { var _this4 = this; // @todo need to use this hack to avoid library using md5 for image var soundLibraryThumbnailData = _lib_libraries_sounds_json__WEBPACK_IMPORTED_MODULE_9__.map(function (sound) { var md5 = sound.md5, otherData = _objectWithoutProperties(sound, ["md5"]); return _objectSpread({ _md5: md5, rawURL: _this4.props.isRtl ? _components_asset_panel_icon_sound_rtl_svg__WEBPACK_IMPORTED_MODULE_8___default.a : _components_asset_panel_icon_sound_svg__WEBPACK_IMPORTED_MODULE_7___default.a }, otherData); }); return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_components_library_library_jsx__WEBPACK_IMPORTED_MODULE_6__["default"], { data: soundLibraryThumbnailData, id: "soundLibrary", tags: _lib_libraries_sound_tags__WEBPACK_IMPORTED_MODULE_10__["default"], title: this.props.intl.formatMessage(messages.libraryTitle), onItemMouseEnter: this.handleItemMouseEnter, onItemMouseLeave: this.handleItemMouseLeave, onItemSelected: this.handleItemSelected, onRequestClose: this.props.onRequestClose }); } }]); return SoundLibrary; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.PureComponent); SoundLibrary.propTypes = { intl: react_intl__WEBPACK_IMPORTED_MODULE_3__["intlShape"].isRequired, isRtl: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, onNewSound: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, onRequestClose: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, vm: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.instanceOf(scratch_vm__WEBPACK_IMPORTED_MODULE_4___default.a).isRequired }; var mapStateToProps = function mapStateToProps(state) { return { isRtl: state.locales.isRtl }; }; var mapDispatchToProps = function mapDispatchToProps() { return {}; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_3__["injectIntl"])(Object(react_redux__WEBPACK_IMPORTED_MODULE_11__["connect"])(mapStateToProps, mapDispatchToProps)(SoundLibrary))); /***/ }), /***/ "./src/containers/sound-tab.jsx": /*!**************************************!*\ !*** ./src/containers/sound-tab.jsx ***! \**************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! scratch-vm */ "./node_modules/scratch-vm/src/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(scratch_vm__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _components_asset_panel_asset_panel_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../components/asset-panel/asset-panel.jsx */ "./src/components/asset-panel/asset-panel.jsx"); /* harmony import */ var _components_asset_panel_icon_sound_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../components/asset-panel/icon--sound.svg */ "./src/components/asset-panel/icon--sound.svg"); /* harmony import */ var _components_asset_panel_icon_sound_svg__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_components_asset_panel_icon_sound_svg__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _components_asset_panel_icon_sound_rtl_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../components/asset-panel/icon--sound-rtl.svg */ "./src/components/asset-panel/icon--sound-rtl.svg"); /* harmony import */ var _components_asset_panel_icon_sound_rtl_svg__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_components_asset_panel_icon_sound_rtl_svg__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _components_asset_panel_icon_add_sound_lib_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../components/asset-panel/icon--add-sound-lib.svg */ "./src/components/asset-panel/icon--add-sound-lib.svg"); /* harmony import */ var _components_asset_panel_icon_add_sound_lib_svg__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_components_asset_panel_icon_add_sound_lib_svg__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _components_asset_panel_icon_add_sound_record_svg__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../components/asset-panel/icon--add-sound-record.svg */ "./src/components/asset-panel/icon--add-sound-record.svg"); /* harmony import */ var _components_asset_panel_icon_add_sound_record_svg__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_components_asset_panel_icon_add_sound_record_svg__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _components_action_menu_icon_file_upload_svg__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../components/action-menu/icon--file-upload.svg */ "./src/components/action-menu/icon--file-upload.svg"); /* harmony import */ var _components_action_menu_icon_file_upload_svg__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_components_action_menu_icon_file_upload_svg__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _components_action_menu_icon_surprise_svg__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../components/action-menu/icon--surprise.svg */ "./src/components/action-menu/icon--surprise.svg"); /* harmony import */ var _components_action_menu_icon_surprise_svg__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_components_action_menu_icon_surprise_svg__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _components_action_menu_icon_search_svg__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../components/action-menu/icon--search.svg */ "./src/components/action-menu/icon--search.svg"); /* harmony import */ var _components_action_menu_icon_search_svg__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_components_action_menu_icon_search_svg__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var _record_modal_jsx__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./record-modal.jsx */ "./src/containers/record-modal.jsx"); /* harmony import */ var _sound_editor_jsx__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./sound-editor.jsx */ "./src/containers/sound-editor.jsx"); /* harmony import */ var _sound_library_jsx__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./sound-library.jsx */ "./src/containers/sound-library.jsx"); /* harmony import */ var _lib_libraries_sounds_json__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../lib/libraries/sounds.json */ "./src/lib/libraries/sounds.json"); var _lib_libraries_sounds_json__WEBPACK_IMPORTED_MODULE_16___namespace = /*#__PURE__*/__webpack_require__.t(/*! ../lib/libraries/sounds.json */ "./src/lib/libraries/sounds.json", 1); /* harmony import */ var _lib_file_uploader_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../lib/file-uploader.js */ "./src/lib/file-uploader.js"); /* harmony import */ var _lib_error_boundary_hoc_jsx__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../lib/error-boundary-hoc.jsx */ "./src/lib/error-boundary-hoc.jsx"); /* harmony import */ var _lib_drag_constants__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../lib/drag-constants */ "./src/lib/drag-constants.js"); /* harmony import */ var _lib_download_blob__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../lib/download-blob */ "./src/lib/download-blob.js"); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _reducers_modals__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../reducers/modals */ "./src/reducers/modals.js"); /* harmony import */ var _reducers_editor_tab__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../reducers/editor-tab */ "./src/reducers/editor-tab.js"); /* harmony import */ var _reducers_restore_deletion__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../reducers/restore-deletion */ "./src/reducers/restore-deletion.js"); /* harmony import */ var _reducers_alerts__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../reducers/alerts */ "./src/reducers/alerts.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var SoundTab = /*#__PURE__*/ function (_React$Component) { _inherits(SoundTab, _React$Component); function SoundTab(props) { var _this; _classCallCheck(this, SoundTab); _this = _possibleConstructorReturn(this, _getPrototypeOf(SoundTab).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_2___default()(_assertThisInitialized(_this), ['handleSelectSound', 'handleDeleteSound', 'handleDuplicateSound', 'handleExportSound', 'handleNewSound', 'handleSurpriseSound', 'handleFileUploadClick', 'handleSoundUpload', 'handleDrop', 'setFileInput']); _this.state = { selectedSoundIndex: 0 }; return _this; } _createClass(SoundTab, [{ key: "componentWillReceiveProps", value: function componentWillReceiveProps(nextProps) { var editingTarget = nextProps.editingTarget, sprites = nextProps.sprites, stage = nextProps.stage; var target = editingTarget && sprites[editingTarget] ? sprites[editingTarget] : stage; if (!target || !target.sounds) { return; } // If switching editing targets, reset the sound index if (this.props.editingTarget !== editingTarget) { this.setState({ selectedSoundIndex: 0 }); } else if (this.state.selectedSoundIndex > target.sounds.length - 1) { this.setState({ selectedSoundIndex: Math.max(target.sounds.length - 1, 0) }); } } }, { key: "handleSelectSound", value: function handleSelectSound(soundIndex) { this.setState({ selectedSoundIndex: soundIndex }); } }, { key: "handleDeleteSound", value: function handleDeleteSound(soundIndex) { var restoreFun = this.props.vm.deleteSound(soundIndex); if (soundIndex >= this.state.selectedSoundIndex) { this.setState({ selectedSoundIndex: Math.max(0, soundIndex - 1) }); } this.props.dispatchUpdateRestore({ restoreFun: restoreFun, deletedItem: 'Sound' }); } }, { key: "handleExportSound", value: function handleExportSound(soundIndex) { var item = this.props.vm.editingTarget.sprite.sounds[soundIndex]; var blob = new Blob([item.asset.data], { type: item.asset.assetType.contentType }); Object(_lib_download_blob__WEBPACK_IMPORTED_MODULE_20__["default"])("".concat(item.name, ".").concat(item.asset.dataFormat), blob); } }, { key: "handleDuplicateSound", value: function handleDuplicateSound(soundIndex) { var _this2 = this; this.props.vm.duplicateSound(soundIndex).then(function () { _this2.setState({ selectedSoundIndex: soundIndex + 1 }); }); } }, { key: "handleNewSound", value: function handleNewSound() { if (!this.props.vm.editingTarget) { return null; } var sprite = this.props.vm.editingTarget.sprite; var sounds = sprite.sounds ? sprite.sounds : []; this.setState({ selectedSoundIndex: Math.max(sounds.length - 1, 0) }); } }, { key: "handleSurpriseSound", value: function handleSurpriseSound() { var _this3 = this; var soundItem = _lib_libraries_sounds_json__WEBPACK_IMPORTED_MODULE_16__[Math.floor(Math.random() * _lib_libraries_sounds_json__WEBPACK_IMPORTED_MODULE_16__.length)]; var vmSound = { format: soundItem.format, md5: soundItem.md5, rate: soundItem.rate, sampleCount: soundItem.sampleCount, name: soundItem.name }; this.props.vm.addSound(vmSound).then(function () { _this3.handleNewSound(); }); } }, { key: "handleFileUploadClick", value: function handleFileUploadClick() { this.fileInput.click(); } }, { key: "handleSoundUpload", value: function handleSoundUpload(e) { var _this4 = this; var storage = this.props.vm.runtime.storage; this.props.onShowImporting(); Object(_lib_file_uploader_js__WEBPACK_IMPORTED_MODULE_17__["handleFileUpload"])(e.target, function (buffer, fileType, fileName, fileIndex, fileCount) { Object(_lib_file_uploader_js__WEBPACK_IMPORTED_MODULE_17__["soundUpload"])(buffer, fileType, storage, function (newSound) { newSound.name = fileName; _this4.props.vm.addSound(newSound).then(function () { _this4.handleNewSound(); if (fileIndex === fileCount - 1) { _this4.props.onCloseImporting(); } }); }); }, this.props.onCloseImporting); } }, { key: "handleDrop", value: function handleDrop(dropInfo) { if (dropInfo.dragType === _lib_drag_constants__WEBPACK_IMPORTED_MODULE_19__["default"].SOUND) { var sprite = this.props.vm.editingTarget.sprite; var activeSound = sprite.sounds[this.state.selectedSoundIndex]; this.props.vm.reorderSound(this.props.vm.editingTarget.id, dropInfo.index, dropInfo.newIndex); this.setState({ selectedSoundIndex: sprite.sounds.indexOf(activeSound) }); } else if (dropInfo.dragType === _lib_drag_constants__WEBPACK_IMPORTED_MODULE_19__["default"].BACKPACK_COSTUME) { this.props.onActivateCostumesTab(); this.props.vm.addCostume(dropInfo.payload.body, { name: dropInfo.payload.name }); } else if (dropInfo.dragType === _lib_drag_constants__WEBPACK_IMPORTED_MODULE_19__["default"].BACKPACK_SOUND) { this.props.vm.addSound({ md5: dropInfo.payload.body, name: dropInfo.payload.name }).then(this.handleNewSound); } } }, { key: "setFileInput", value: function setFileInput(input) { this.fileInput = input; } }, { key: "render", value: function render() { var _this$props = this.props, dispatchUpdateRestore = _this$props.dispatchUpdateRestore, intl = _this$props.intl, isRtl = _this$props.isRtl, vm = _this$props.vm, onNewSoundFromLibraryClick = _this$props.onNewSoundFromLibraryClick, onNewSoundFromRecordingClick = _this$props.onNewSoundFromRecordingClick; if (!vm.editingTarget) { return null; } var sprite = vm.editingTarget.sprite; var sounds = sprite.sounds ? sprite.sounds.map(function (sound) { return { url: isRtl ? _components_asset_panel_icon_sound_rtl_svg__WEBPACK_IMPORTED_MODULE_7___default.a : _components_asset_panel_icon_sound_svg__WEBPACK_IMPORTED_MODULE_6___default.a, name: sound.name, details: (sound.sampleCount / sound.rate).toFixed(2), dragPayload: sound }; }) : []; var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_3__["defineMessages"])({ fileUploadSound: { "id": "gui.soundTab.fileUploadSound", "defaultMessage": "Upload Sound" }, surpriseSound: { "id": "gui.soundTab.surpriseSound", "defaultMessage": "Surprise" }, recordSound: { "id": "gui.soundTab.recordSound", "defaultMessage": "Record" }, addSound: { "id": "gui.soundTab.addSoundFromLibrary", "defaultMessage": "Choose a Sound" } }); return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_components_asset_panel_asset_panel_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], { buttons: [{ title: intl.formatMessage(messages.addSound), img: _components_asset_panel_icon_add_sound_lib_svg__WEBPACK_IMPORTED_MODULE_8___default.a, onClick: onNewSoundFromLibraryClick }, { title: intl.formatMessage(messages.fileUploadSound), img: _components_action_menu_icon_file_upload_svg__WEBPACK_IMPORTED_MODULE_10___default.a, onClick: this.handleFileUploadClick, fileAccept: '.wav, .mp3', fileChange: this.handleSoundUpload, fileInput: this.setFileInput, fileMultiple: true }, { title: intl.formatMessage(messages.surpriseSound), img: _components_action_menu_icon_surprise_svg__WEBPACK_IMPORTED_MODULE_11___default.a, onClick: this.handleSurpriseSound }, { title: intl.formatMessage(messages.recordSound), img: _components_asset_panel_icon_add_sound_record_svg__WEBPACK_IMPORTED_MODULE_9___default.a, onClick: onNewSoundFromRecordingClick }, { title: intl.formatMessage(messages.addSound), img: _components_action_menu_icon_search_svg__WEBPACK_IMPORTED_MODULE_12___default.a, onClick: onNewSoundFromLibraryClick }], dragType: _lib_drag_constants__WEBPACK_IMPORTED_MODULE_19__["default"].SOUND, isRtl: isRtl, items: sounds, selectedItemIndex: this.state.selectedSoundIndex, onDeleteClick: this.handleDeleteSound, onDrop: this.handleDrop, onDuplicateClick: this.handleDuplicateSound, onExportClick: this.handleExportSound, onItemClick: this.handleSelectSound }, sprite.sounds && sprite.sounds[this.state.selectedSoundIndex] ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_sound_editor_jsx__WEBPACK_IMPORTED_MODULE_14__["default"], { soundIndex: this.state.selectedSoundIndex }) : null, this.props.soundRecorderVisible ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_record_modal_jsx__WEBPACK_IMPORTED_MODULE_13__["default"], { onNewSound: this.handleNewSound }) : null, this.props.soundLibraryVisible ? react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_sound_library_jsx__WEBPACK_IMPORTED_MODULE_15__["default"], { vm: this.props.vm, onNewSound: this.handleNewSound, onRequestClose: this.props.onRequestCloseSoundLibrary }) : null); } }]); return SoundTab; }(react__WEBPACK_IMPORTED_MODULE_1___default.a.Component); SoundTab.propTypes = { dispatchUpdateRestore: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, editingTarget: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, intl: react_intl__WEBPACK_IMPORTED_MODULE_3__["intlShape"], isRtl: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, onActivateCostumesTab: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onCloseImporting: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onNewSoundFromLibraryClick: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onNewSoundFromRecordingClick: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onRequestCloseSoundLibrary: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, onShowImporting: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, soundLibraryVisible: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, soundRecorderVisible: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, sprites: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({ id: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({ sounds: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({ name: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string.isRequired })) }) }), stage: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({ sounds: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({ name: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string.isRequired })) }), vm: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.instanceOf(scratch_vm__WEBPACK_IMPORTED_MODULE_4___default.a).isRequired }; var mapStateToProps = function mapStateToProps(state) { return { editingTarget: state.scratchGui.targets.editingTarget, isRtl: state.locales.isRtl, sprites: state.scratchGui.targets.sprites, stage: state.scratchGui.targets.stage, soundLibraryVisible: state.scratchGui.modals.soundLibrary, soundRecorderVisible: state.scratchGui.modals.soundRecorder }; }; var mapDispatchToProps = function mapDispatchToProps(dispatch) { return { onActivateCostumesTab: function onActivateCostumesTab() { return dispatch(Object(_reducers_editor_tab__WEBPACK_IMPORTED_MODULE_23__["activateTab"])(_reducers_editor_tab__WEBPACK_IMPORTED_MODULE_23__["COSTUMES_TAB_INDEX"])); }, onNewSoundFromLibraryClick: function onNewSoundFromLibraryClick(e) { e.preventDefault(); dispatch(Object(_reducers_modals__WEBPACK_IMPORTED_MODULE_22__["openSoundLibrary"])()); }, onNewSoundFromRecordingClick: function onNewSoundFromRecordingClick() { dispatch(Object(_reducers_modals__WEBPACK_IMPORTED_MODULE_22__["openSoundRecorder"])()); }, onRequestCloseSoundLibrary: function onRequestCloseSoundLibrary() { dispatch(Object(_reducers_modals__WEBPACK_IMPORTED_MODULE_22__["closeSoundLibrary"])()); }, dispatchUpdateRestore: function dispatchUpdateRestore(restoreState) { dispatch(Object(_reducers_restore_deletion__WEBPACK_IMPORTED_MODULE_24__["setRestore"])(restoreState)); }, onCloseImporting: function onCloseImporting() { return dispatch(Object(_reducers_alerts__WEBPACK_IMPORTED_MODULE_25__["closeAlertWithId"])('importingAsset')); }, onShowImporting: function onShowImporting() { return dispatch(Object(_reducers_alerts__WEBPACK_IMPORTED_MODULE_25__["showStandardAlert"])('importingAsset')); } }; }; /* harmony default export */ __webpack_exports__["default"] = (Object(_lib_error_boundary_hoc_jsx__WEBPACK_IMPORTED_MODULE_18__["default"])('Sound Tab')(Object(react_intl__WEBPACK_IMPORTED_MODULE_3__["injectIntl"])(Object(react_redux__WEBPACK_IMPORTED_MODULE_21__["connect"])(mapStateToProps, mapDispatchToProps)(SoundTab)))); /***/ }), /***/ "./src/containers/sprite-info.jsx": /*!****************************************!*\ !*** ./src/containers/sprite-info.jsx ***! \****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _components_sprite_info_sprite_info_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/sprite-info/sprite-info.jsx */ "./src/components/sprite-info/sprite-info.jsx"); function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var SpriteInfo = /*#__PURE__*/ function (_React$Component) { _inherits(SpriteInfo, _React$Component); function SpriteInfo(props) { var _this; _classCallCheck(this, SpriteInfo); _this = _possibleConstructorReturn(this, _getPrototypeOf(SpriteInfo).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['handleClickVisible', 'handleClickNotVisible', 'handlePressVisible', 'handlePressNotVisible']); return _this; } _createClass(SpriteInfo, [{ key: "handleClickVisible", value: function handleClickVisible(e) { e.preventDefault(); this.props.onChangeVisibility(true); } }, { key: "handleClickNotVisible", value: function handleClickNotVisible(e) { e.preventDefault(); this.props.onChangeVisibility(false); } }, { key: "handlePressVisible", value: function handlePressVisible(e) { if (e.key === ' ' || e.key === 'Enter') { e.preventDefault(); this.props.onChangeVisibility(true); } } }, { key: "handlePressNotVisible", value: function handlePressNotVisible(e) { if (e.key === ' ' || e.key === 'Enter') { e.preventDefault(); this.props.onChangeVisibility(false); } } }, { key: "render", value: function render() { return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_components_sprite_info_sprite_info_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], _extends({}, this.props, { onClickNotVisible: this.handleClickNotVisible, onClickVisible: this.handleClickVisible, onPressNotVisible: this.handlePressNotVisible, onPressVisible: this.handlePressVisible })); } }]); return SpriteInfo; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.Component); SpriteInfo.propTypes = _objectSpread({}, _components_sprite_info_sprite_info_jsx__WEBPACK_IMPORTED_MODULE_3__["default"].propTypes, { onChangeDirection: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onChangeName: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onChangeSize: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onChangeVisibility: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onChangeX: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onChangeY: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, x: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, y: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number }); /* harmony default export */ __webpack_exports__["default"] = (SpriteInfo); /***/ }), /***/ "./src/containers/sprite-library.jsx": /*!*******************************************!*\ !*** ./src/containers/sprite-library.jsx ***! \*******************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! scratch-vm */ "./node_modules/scratch-vm/src/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(scratch_vm__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _lib_libraries_sprites_json__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../lib/libraries/sprites.json */ "./src/lib/libraries/sprites.json"); var _lib_libraries_sprites_json__WEBPACK_IMPORTED_MODULE_5___namespace = /*#__PURE__*/__webpack_require__.t(/*! ../lib/libraries/sprites.json */ "./src/lib/libraries/sprites.json", 1); /* harmony import */ var _lib_randomize_sprite_position__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lib/randomize-sprite-position */ "./src/lib/randomize-sprite-position.js"); /* harmony import */ var _lib_libraries_sprite_tags__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../lib/libraries/sprite-tags */ "./src/lib/libraries/sprite-tags.js"); /* harmony import */ var _components_library_library_jsx__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../components/library/library.jsx */ "./src/components/library/library.jsx"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_3__["defineMessages"])({ libraryTitle: { "id": "gui.spriteLibrary.chooseASprite", "defaultMessage": "Choose a Sprite" } }); var SpriteLibrary = /*#__PURE__*/ function (_React$PureComponent) { _inherits(SpriteLibrary, _React$PureComponent); function SpriteLibrary(props) { var _this; _classCallCheck(this, SpriteLibrary); _this = _possibleConstructorReturn(this, _getPrototypeOf(SpriteLibrary).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['handleItemSelect']); return _this; } _createClass(SpriteLibrary, [{ key: "handleItemSelect", value: function handleItemSelect(item) { var _this2 = this; // Randomize position of library sprite Object(_lib_randomize_sprite_position__WEBPACK_IMPORTED_MODULE_6__["default"])(item); this.props.vm.addSprite(JSON.stringify(item.json)).then(function () { _this2.props.onActivateBlocksTab(); }); } }, { key: "render", value: function render() { return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_components_library_library_jsx__WEBPACK_IMPORTED_MODULE_8__["default"], { data: _lib_libraries_sprites_json__WEBPACK_IMPORTED_MODULE_5__, id: "spriteLibrary", tags: _lib_libraries_sprite_tags__WEBPACK_IMPORTED_MODULE_7__["default"], title: this.props.intl.formatMessage(messages.libraryTitle), onItemSelected: this.handleItemSelect, onRequestClose: this.props.onRequestClose }); } }]); return SpriteLibrary; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.PureComponent); SpriteLibrary.propTypes = { intl: react_intl__WEBPACK_IMPORTED_MODULE_3__["intlShape"].isRequired, onActivateBlocksTab: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, onRequestClose: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, vm: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.instanceOf(scratch_vm__WEBPACK_IMPORTED_MODULE_4___default.a).isRequired }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_3__["injectIntl"])(SpriteLibrary)); /***/ }), /***/ "./src/containers/sprite-selector-item.jsx": /*!*************************************************!*\ !*** ./src/containers/sprite-selector-item.jsx ***! \*************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _reducers_hovered_target__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../reducers/hovered-target */ "./src/reducers/hovered-target.js"); /* harmony import */ var _reducers_asset_drag__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../reducers/asset-drag */ "./src/reducers/asset-drag.js"); /* harmony import */ var _lib_storage__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lib/storage */ "./src/lib/storage.js"); /* harmony import */ var _lib_touch_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../lib/touch-utils */ "./src/lib/touch-utils.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! scratch-vm */ "./node_modules/scratch-vm/src/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(scratch_vm__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _lib_get_costume_url__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../lib/get-costume-url */ "./src/lib/get-costume-url.js"); /* harmony import */ var _components_sprite_selector_item_sprite_selector_item_jsx__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../components/sprite-selector-item/sprite-selector-item.jsx */ "./src/components/sprite-selector-item/sprite-selector-item.jsx"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var dragThreshold = 3; // Same as the block drag threshold var SpriteSelectorItem = /*#__PURE__*/ function (_React$PureComponent) { _inherits(SpriteSelectorItem, _React$PureComponent); function SpriteSelectorItem(props) { var _this; _classCallCheck(this, SpriteSelectorItem); _this = _possibleConstructorReturn(this, _getPrototypeOf(SpriteSelectorItem).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['getCostumeData', 'handleClick', 'handleDelete', 'handleDuplicate', 'handleExport', 'handleMouseEnter', 'handleMouseLeave', 'handleMouseDown', 'handleMouseMove', 'handleMouseUp']); return _this; } _createClass(SpriteSelectorItem, [{ key: "getCostumeData", value: function getCostumeData() { if (this.props.costumeURL) return this.props.costumeURL; if (!this.props.asset) return null; return Object(_lib_get_costume_url__WEBPACK_IMPORTED_MODULE_9__["default"])(this.props.asset); } }, { key: "handleMouseUp", value: function handleMouseUp() { var _this2 = this; this.initialOffset = null; window.removeEventListener('mouseup', this.handleMouseUp); window.removeEventListener('mousemove', this.handleMouseMove); window.removeEventListener('touchend', this.handleMouseUp); window.removeEventListener('touchmove', this.handleMouseMove); if (this.props.dragging) { this.props.onDrag({ img: null, currentOffset: null, dragging: false, dragType: null, index: null }); } setTimeout(function () { _this2.noClick = false; }); } }, { key: "handleMouseMove", value: function handleMouseMove(e) { var currentOffset = Object(_lib_touch_utils__WEBPACK_IMPORTED_MODULE_7__["getEventXY"])(e); var dx = currentOffset.x - this.initialOffset.x; var dy = currentOffset.y - this.initialOffset.y; if (Math.sqrt(dx * dx + dy * dy) > dragThreshold) { this.props.onDrag({ img: this.getCostumeData(), currentOffset: currentOffset, dragging: true, dragType: this.props.dragType, index: this.props.index, payload: this.props.dragPayload }); this.noClick = true; } e.preventDefault(); } }, { key: "handleMouseDown", value: function handleMouseDown(e) { this.initialOffset = Object(_lib_touch_utils__WEBPACK_IMPORTED_MODULE_7__["getEventXY"])(e); window.addEventListener('mouseup', this.handleMouseUp); window.addEventListener('mousemove', this.handleMouseMove); window.addEventListener('touchend', this.handleMouseUp); window.addEventListener('touchmove', this.handleMouseMove); } }, { key: "handleClick", value: function handleClick(e) { e.preventDefault(); if (!this.noClick) { this.props.onClick(this.props.id); } } }, { key: "handleDelete", value: function handleDelete(e) { e.stopPropagation(); // To prevent from bubbling back to handleClick this.props.onDeleteButtonClick(this.props.id); } }, { key: "handleDuplicate", value: function handleDuplicate(e) { e.stopPropagation(); // To prevent from bubbling back to handleClick this.props.onDuplicateButtonClick(this.props.id); } }, { key: "handleExport", value: function handleExport(e) { e.stopPropagation(); this.props.onExportButtonClick(this.props.id); } }, { key: "handleMouseLeave", value: function handleMouseLeave() { this.props.dispatchSetHoveredSprite(null); } }, { key: "handleMouseEnter", value: function handleMouseEnter() { this.props.dispatchSetHoveredSprite(this.props.id); } }, { key: "render", value: function render() { var _this$props = this.props, asset = _this$props.asset, id = _this$props.id, index = _this$props.index, onClick = _this$props.onClick, onDeleteButtonClick = _this$props.onDeleteButtonClick, onDuplicateButtonClick = _this$props.onDuplicateButtonClick, onExportButtonClick = _this$props.onExportButtonClick, dragPayload = _this$props.dragPayload, receivedBlocks = _this$props.receivedBlocks, costumeURL = _this$props.costumeURL, vm = _this$props.vm, props = _objectWithoutProperties(_this$props, ["asset", "id", "index", "onClick", "onDeleteButtonClick", "onDuplicateButtonClick", "onExportButtonClick", "dragPayload", "receivedBlocks", "costumeURL", "vm"]); return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_components_sprite_selector_item_sprite_selector_item_jsx__WEBPACK_IMPORTED_MODULE_10__["default"], _extends({ costumeURL: this.getCostumeData(), onClick: this.handleClick, onDeleteButtonClick: onDeleteButtonClick ? this.handleDelete : null, onDuplicateButtonClick: onDuplicateButtonClick ? this.handleDuplicate : null, onExportButtonClick: onExportButtonClick ? this.handleExport : null, onMouseDown: this.handleMouseDown, onMouseEnter: this.handleMouseEnter, onMouseLeave: this.handleMouseLeave }, props)); } }]); return SpriteSelectorItem; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.PureComponent); SpriteSelectorItem.propTypes = { asset: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.instanceOf(_lib_storage__WEBPACK_IMPORTED_MODULE_6__["default"].Asset), costumeURL: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, dispatchSetHoveredSprite: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, dragPayload: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number]), dragType: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, dragging: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, id: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number]), index: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, name: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, onClick: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onDeleteButtonClick: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onDrag: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, onDuplicateButtonClick: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onExportButtonClick: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, receivedBlocks: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool.isRequired, selected: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, vm: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.instanceOf(scratch_vm__WEBPACK_IMPORTED_MODULE_8___default.a).isRequired }; var mapStateToProps = function mapStateToProps(state, _ref) { var id = _ref.id; return { dragging: state.scratchGui.assetDrag.dragging, receivedBlocks: state.scratchGui.hoveredTarget.receivedBlocks && state.scratchGui.hoveredTarget.sprite === id, vm: state.scratchGui.vm }; }; var mapDispatchToProps = function mapDispatchToProps(dispatch) { return { dispatchSetHoveredSprite: function dispatchSetHoveredSprite(spriteId) { dispatch(Object(_reducers_hovered_target__WEBPACK_IMPORTED_MODULE_4__["setHoveredSprite"])(spriteId)); }, onDrag: function onDrag(data) { return dispatch(Object(_reducers_asset_drag__WEBPACK_IMPORTED_MODULE_5__["updateAssetDrag"])(data)); } }; }; var ConnectedComponent = Object(react_redux__WEBPACK_IMPORTED_MODULE_3__["connect"])(mapStateToProps, mapDispatchToProps)(SpriteSelectorItem); /* harmony default export */ __webpack_exports__["default"] = (ConnectedComponent); /***/ }), /***/ "./src/containers/stage-header.jsx": /*!*****************************************!*\ !*** ./src/containers/stage-header.jsx ***! \*****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! scratch-vm */ "./node_modules/scratch-vm/src/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(scratch_vm__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_layout_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/layout-constants */ "./src/lib/layout-constants.js"); /* harmony import */ var _reducers_stage_size__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../reducers/stage-size */ "./src/reducers/stage-size.js"); /* harmony import */ var _reducers_mode__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../reducers/mode */ "./src/reducers/mode.js"); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _components_stage_header_stage_header_jsx__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../components/stage-header/stage-header.jsx */ "./src/components/stage-header/stage-header.jsx"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } // eslint-disable-next-line react/prefer-stateless-function var StageHeader = /*#__PURE__*/ function (_React$Component) { _inherits(StageHeader, _React$Component); function StageHeader(props) { var _this; _classCallCheck(this, StageHeader); _this = _possibleConstructorReturn(this, _getPrototypeOf(StageHeader).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_2___default()(_assertThisInitialized(_this), ['handleKeyPress']); return _this; } _createClass(StageHeader, [{ key: "componentDidMount", value: function componentDidMount() { document.addEventListener('keydown', this.handleKeyPress); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { document.removeEventListener('keydown', this.handleKeyPress); } }, { key: "handleKeyPress", value: function handleKeyPress(event) { if (event.key === 'Escape' && this.props.isFullScreen) { this.props.onSetStageUnFull(false); } } }, { key: "render", value: function render() { var props = _extends({}, this.props); return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_components_stage_header_stage_header_jsx__WEBPACK_IMPORTED_MODULE_8__["default"], _extends({}, props, { onKeyPress: this.handleKeyPress })); } }]); return StageHeader; }(react__WEBPACK_IMPORTED_MODULE_1___default.a.Component); StageHeader.propTypes = { isFullScreen: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, isPlayerOnly: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, onSetStageUnFull: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func.isRequired, showBranding: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, stageSizeMode: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.oneOf(Object.keys(_lib_layout_constants__WEBPACK_IMPORTED_MODULE_4__["STAGE_SIZE_MODES"])), vm: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.instanceOf(scratch_vm__WEBPACK_IMPORTED_MODULE_3___default.a).isRequired }; var mapStateToProps = function mapStateToProps(state) { return { stageSizeMode: state.scratchGui.stageSize.stageSize, showBranding: state.scratchGui.mode.showBranding, isFullScreen: state.scratchGui.mode.isFullScreen, isPlayerOnly: state.scratchGui.mode.isPlayerOnly }; }; var mapDispatchToProps = function mapDispatchToProps(dispatch) { return { onSetStageLarge: function onSetStageLarge() { return dispatch(Object(_reducers_stage_size__WEBPACK_IMPORTED_MODULE_5__["setStageSize"])(_lib_layout_constants__WEBPACK_IMPORTED_MODULE_4__["STAGE_SIZE_MODES"].large)); }, onSetStageSmall: function onSetStageSmall() { return dispatch(Object(_reducers_stage_size__WEBPACK_IMPORTED_MODULE_5__["setStageSize"])(_lib_layout_constants__WEBPACK_IMPORTED_MODULE_4__["STAGE_SIZE_MODES"].small)); }, onSetStageFull: function onSetStageFull() { return dispatch(Object(_reducers_mode__WEBPACK_IMPORTED_MODULE_6__["setFullScreen"])(true)); }, onSetStageUnFull: function onSetStageUnFull() { return dispatch(Object(_reducers_mode__WEBPACK_IMPORTED_MODULE_6__["setFullScreen"])(false)); } }; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_redux__WEBPACK_IMPORTED_MODULE_7__["connect"])(mapStateToProps, mapDispatchToProps)(StageHeader)); /***/ }), /***/ "./src/containers/stage-selector.jsx": /*!*******************************************!*\ !*** ./src/containers/stage-selector.jsx ***! \*******************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var lodash_omit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash.omit */ "./node_modules/lodash.omit/index.js"); /* harmony import */ var lodash_omit__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_omit__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _reducers_modals__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../reducers/modals */ "./src/reducers/modals.js"); /* harmony import */ var _reducers_editor_tab__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../reducers/editor-tab */ "./src/reducers/editor-tab.js"); /* harmony import */ var _reducers_alerts__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../reducers/alerts */ "./src/reducers/alerts.js"); /* harmony import */ var _reducers_hovered_target__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../reducers/hovered-target */ "./src/reducers/hovered-target.js"); /* harmony import */ var _lib_drag_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../lib/drag-constants */ "./src/lib/drag-constants.js"); /* harmony import */ var _lib_drop_area_hoc_jsx__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../lib/drop-area-hoc.jsx */ "./src/lib/drop-area-hoc.jsx"); /* harmony import */ var _lib_throttled_property_hoc_jsx__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../lib/throttled-property-hoc.jsx */ "./src/lib/throttled-property-hoc.jsx"); /* harmony import */ var _lib_empty_assets__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../lib/empty-assets */ "./src/lib/empty-assets.js"); /* harmony import */ var _lib_shared_messages__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../lib/shared-messages */ "./src/lib/shared-messages.js"); /* harmony import */ var _lib_backpack_api__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../lib/backpack-api */ "./src/lib/backpack-api.js"); /* harmony import */ var _components_stage_selector_stage_selector_jsx__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../components/stage-selector/stage-selector.jsx */ "./src/components/stage-selector/stage-selector.jsx"); /* harmony import */ var _lib_libraries_backdrops_json__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../lib/libraries/backdrops.json */ "./src/lib/libraries/backdrops.json"); var _lib_libraries_backdrops_json__WEBPACK_IMPORTED_MODULE_17___namespace = /*#__PURE__*/__webpack_require__.t(/*! ../lib/libraries/backdrops.json */ "./src/lib/libraries/backdrops.json", 1); /* harmony import */ var _lib_file_uploader_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../lib/file-uploader.js */ "./src/lib/file-uploader.js"); function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var dragTypes = [_lib_drag_constants__WEBPACK_IMPORTED_MODULE_10__["default"].COSTUME, _lib_drag_constants__WEBPACK_IMPORTED_MODULE_10__["default"].SOUND, _lib_drag_constants__WEBPACK_IMPORTED_MODULE_10__["default"].BACKPACK_COSTUME, _lib_drag_constants__WEBPACK_IMPORTED_MODULE_10__["default"].BACKPACK_SOUND, _lib_drag_constants__WEBPACK_IMPORTED_MODULE_10__["default"].BACKPACK_CODE]; var DroppableThrottledStage = Object(_lib_drop_area_hoc_jsx__WEBPACK_IMPORTED_MODULE_11__["default"])(dragTypes)(Object(_lib_throttled_property_hoc_jsx__WEBPACK_IMPORTED_MODULE_12__["default"])('url', 500)(_components_stage_selector_stage_selector_jsx__WEBPACK_IMPORTED_MODULE_16__["default"])); var StageSelector = /*#__PURE__*/ function (_React$Component) { _inherits(StageSelector, _React$Component); function StageSelector(props) { var _this; _classCallCheck(this, StageSelector); _this = _possibleConstructorReturn(this, _getPrototypeOf(StageSelector).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['handleClick', 'handleNewBackdrop', 'handleSurpriseBackdrop', 'handleEmptyBackdrop', 'addBackdropFromLibraryItem', 'handleFileUploadClick', 'handleBackdropUpload', 'handleMouseEnter', 'handleMouseLeave', 'handleDrop', 'setFileInput']); return _this; } _createClass(StageSelector, [{ key: "addBackdropFromLibraryItem", value: function addBackdropFromLibraryItem(item) { var vmBackdrop = { name: item.name, md5: item.md5, rotationCenterX: item.info[0] && item.info[0] / 2, rotationCenterY: item.info[1] && item.info[1] / 2, bitmapResolution: item.info.length > 2 ? item.info[2] : 1, skinId: null }; this.handleNewBackdrop(vmBackdrop); } }, { key: "handleClick", value: function handleClick() { this.props.onSelect(this.props.id); } }, { key: "handleNewBackdrop", value: function handleNewBackdrop(backdrops_) { var _this2 = this; var backdrops = Array.isArray(backdrops_) ? backdrops_ : [backdrops_]; return Promise.all(backdrops.map(function (backdrop) { return _this2.props.vm.addBackdrop(backdrop.md5, backdrop); })).then(function () { return _this2.props.onActivateTab(_reducers_editor_tab__WEBPACK_IMPORTED_MODULE_7__["COSTUMES_TAB_INDEX"]); }); } }, { key: "handleSurpriseBackdrop", value: function handleSurpriseBackdrop() { // @todo should this not add a backdrop you already have? var item = _lib_libraries_backdrops_json__WEBPACK_IMPORTED_MODULE_17__[Math.floor(Math.random() * _lib_libraries_backdrops_json__WEBPACK_IMPORTED_MODULE_17__.length)]; this.addBackdropFromLibraryItem(item); } }, { key: "handleEmptyBackdrop", value: function handleEmptyBackdrop() { this.handleNewBackdrop(Object(_lib_empty_assets__WEBPACK_IMPORTED_MODULE_13__["emptyCostume"])(this.props.intl.formatMessage(_lib_shared_messages__WEBPACK_IMPORTED_MODULE_14__["default"].backdrop, { index: 1 }))); } }, { key: "handleBackdropUpload", value: function handleBackdropUpload(e) { var _this3 = this; var storage = this.props.vm.runtime.storage; this.props.onShowImporting(); Object(_lib_file_uploader_js__WEBPACK_IMPORTED_MODULE_18__["handleFileUpload"])(e.target, function (buffer, fileType, fileName, fileIndex, fileCount) { Object(_lib_file_uploader_js__WEBPACK_IMPORTED_MODULE_18__["costumeUpload"])(buffer, fileType, storage, function (vmCostumes) { vmCostumes.forEach(function (costume, i) { costume.name = "".concat(fileName).concat(i ? i + 1 : ''); }); _this3.handleNewBackdrop(vmCostumes).then(function () { if (fileIndex === fileCount - 1) { _this3.props.onCloseImporting(); } }); }, _this3.props.onCloseImporting); }, this.props.onCloseImporting); } }, { key: "handleFileUploadClick", value: function handleFileUploadClick() { this.fileInput.click(); } }, { key: "handleMouseEnter", value: function handleMouseEnter() { this.props.dispatchSetHoveredSprite(this.props.id); } }, { key: "handleMouseLeave", value: function handleMouseLeave() { this.props.dispatchSetHoveredSprite(null); } }, { key: "handleDrop", value: function handleDrop(dragInfo) { var _this4 = this; if (dragInfo.dragType === _lib_drag_constants__WEBPACK_IMPORTED_MODULE_10__["default"].COSTUME) { this.props.vm.shareCostumeToTarget(dragInfo.index, this.props.id); } else if (dragInfo.dragType === _lib_drag_constants__WEBPACK_IMPORTED_MODULE_10__["default"].SOUND) { this.props.vm.shareSoundToTarget(dragInfo.index, this.props.id); } else if (dragInfo.dragType === _lib_drag_constants__WEBPACK_IMPORTED_MODULE_10__["default"].BACKPACK_COSTUME) { this.props.vm.addCostume(dragInfo.payload.body, { name: dragInfo.payload.name }, this.props.id); } else if (dragInfo.dragType === _lib_drag_constants__WEBPACK_IMPORTED_MODULE_10__["default"].BACKPACK_SOUND) { this.props.vm.addSound({ md5: dragInfo.payload.body, name: dragInfo.payload.name }, this.props.id); } else if (dragInfo.dragType === _lib_drag_constants__WEBPACK_IMPORTED_MODULE_10__["default"].BACKPACK_CODE) { Object(_lib_backpack_api__WEBPACK_IMPORTED_MODULE_15__["fetchCode"])(dragInfo.payload.bodyUrl).then(function (blocks) { _this4.props.vm.shareBlocksToTarget(blocks, _this4.props.id); _this4.props.vm.refreshWorkspace(); }); } } }, { key: "setFileInput", value: function setFileInput(input) { this.fileInput = input; } }, { key: "render", value: function render() { var componentProps = lodash_omit__WEBPACK_IMPORTED_MODULE_1___default()(this.props, ['asset', 'dispatchSetHoveredSprite', 'id', 'intl', 'onActivateTab', 'onSelect', 'onShowImporting', 'onCloseImporting']); return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(DroppableThrottledStage, _extends({ fileInputRef: this.setFileInput, onBackdropFileUpload: this.handleBackdropUpload, onBackdropFileUploadClick: this.handleFileUploadClick, onClick: this.handleClick, onDrop: this.handleDrop, onEmptyBackdropClick: this.handleEmptyBackdrop, onMouseEnter: this.handleMouseEnter, onMouseLeave: this.handleMouseLeave, onSurpriseBackdropClick: this.handleSurpriseBackdrop }, componentProps)); } }]); return StageSelector; }(react__WEBPACK_IMPORTED_MODULE_3___default.a.Component); StageSelector.propTypes = _objectSpread({}, _components_stage_selector_stage_selector_jsx__WEBPACK_IMPORTED_MODULE_16__["default"].propTypes, { id: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, intl: react_intl__WEBPACK_IMPORTED_MODULE_4__["intlShape"].isRequired, onCloseImporting: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onSelect: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onShowImporting: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func }); var mapStateToProps = function mapStateToProps(state, _ref) { var asset = _ref.asset, id = _ref.id; return { url: asset && asset.encodeDataURI(), vm: state.scratchGui.vm, receivedBlocks: state.scratchGui.hoveredTarget.receivedBlocks && state.scratchGui.hoveredTarget.sprite === id, raised: state.scratchGui.blockDrag }; }; var mapDispatchToProps = function mapDispatchToProps(dispatch) { return { onNewBackdropClick: function onNewBackdropClick(e) { e.stopPropagation(); dispatch(Object(_reducers_modals__WEBPACK_IMPORTED_MODULE_6__["openBackdropLibrary"])()); }, onActivateTab: function onActivateTab(tabIndex) { dispatch(Object(_reducers_editor_tab__WEBPACK_IMPORTED_MODULE_7__["activateTab"])(tabIndex)); }, dispatchSetHoveredSprite: function dispatchSetHoveredSprite(spriteId) { dispatch(Object(_reducers_hovered_target__WEBPACK_IMPORTED_MODULE_9__["setHoveredSprite"])(spriteId)); }, onCloseImporting: function onCloseImporting() { return dispatch(Object(_reducers_alerts__WEBPACK_IMPORTED_MODULE_8__["closeAlertWithId"])('importingAsset')); }, onShowImporting: function onShowImporting() { return dispatch(Object(_reducers_alerts__WEBPACK_IMPORTED_MODULE_8__["showStandardAlert"])('importingAsset')); } }; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_4__["injectIntl"])(Object(react_redux__WEBPACK_IMPORTED_MODULE_5__["connect"])(mapStateToProps, mapDispatchToProps)(StageSelector))); /***/ }), /***/ "./src/containers/stage-wrapper.jsx": /*!******************************************!*\ !*** ./src/containers/stage-wrapper.jsx ***! \******************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! scratch-vm */ "./node_modules/scratch-vm/src/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(scratch_vm__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _lib_layout_constants_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../lib/layout-constants.js */ "./src/lib/layout-constants.js"); /* harmony import */ var _components_stage_wrapper_stage_wrapper_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../components/stage-wrapper/stage-wrapper.jsx */ "./src/components/stage-wrapper/stage-wrapper.jsx"); var StageWrapper = function StageWrapper(props) { return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_components_stage_wrapper_stage_wrapper_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], props); }; StageWrapper.propTypes = { isRendererSupported: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool.isRequired, stageSize: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.oneOf(Object.keys(_lib_layout_constants_js__WEBPACK_IMPORTED_MODULE_3__["STAGE_DISPLAY_SIZES"])).isRequired, vm: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.instanceOf(scratch_vm__WEBPACK_IMPORTED_MODULE_2___default.a).isRequired }; /* harmony default export */ __webpack_exports__["default"] = (StageWrapper); /***/ }), /***/ "./src/containers/stage.jsx": /*!**********************************!*\ !*** ./src/containers/stage.jsx ***! \**********************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var scratch_render__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! scratch-render */ "./node_modules/scratch-render/src/index.js"); /* harmony import */ var scratch_render__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(scratch_render__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! scratch-vm */ "./node_modules/scratch-vm/src/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(scratch_vm__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _lib_layout_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lib/layout-constants */ "./src/lib/layout-constants.js"); /* harmony import */ var _lib_touch_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../lib/touch-utils */ "./src/lib/touch-utils.js"); /* harmony import */ var _lib_video_video_provider__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../lib/video/video-provider */ "./src/lib/video/video-provider.js"); /* harmony import */ var scratch_svg_renderer__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! scratch-svg-renderer */ "./node_modules/scratch-svg-renderer/src/index.js"); /* harmony import */ var scratch_svg_renderer__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(scratch_svg_renderer__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _components_stage_stage_jsx__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../components/stage/stage.jsx */ "./src/components/stage/stage.jsx"); /* harmony import */ var _reducers_color_picker__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../reducers/color-picker */ "./src/reducers/color-picker.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var colorPickerRadius = 20; var dragThreshold = 3; // Same as the block drag threshold var Stage = /*#__PURE__*/ function (_React$Component) { _inherits(Stage, _React$Component); function Stage(props) { var _this; _classCallCheck(this, Stage); _this = _possibleConstructorReturn(this, _getPrototypeOf(Stage).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['attachMouseEvents', 'cancelMouseDownTimeout', 'detachMouseEvents', 'handleDoubleClick', 'handleQuestionAnswered', 'onMouseUp', 'onMouseMove', 'onMouseDown', 'onStartDrag', 'onStopDrag', 'onWheel', 'updateRect', 'questionListener', 'setDragCanvas', 'clearDragCanvas', 'drawDragCanvas', 'positionDragCanvas']); _this.state = { mouseDownTimeoutId: null, mouseDownPosition: null, isDragging: false, dragOffset: null, dragId: null, colorInfo: null, question: null }; if (_this.props.vm.renderer) { _this.renderer = _this.props.vm.renderer; _this.canvas = _this.renderer.canvas; } else { _this.canvas = document.createElement('canvas'); _this.renderer = new scratch_render__WEBPACK_IMPORTED_MODULE_3___default.a(_this.canvas); _this.props.vm.attachRenderer(_this.renderer); // Only attach a video provider once because it is stateful _this.props.vm.setVideoProvider(new _lib_video_video_provider__WEBPACK_IMPORTED_MODULE_8__["default"]()); // Calling draw a single time before any project is loaded just makes // the canvas white instead of solid black–needed because it is not // possible to use CSS to style the canvas to have a different // default color _this.props.vm.renderer.draw(); } _this.props.vm.attachV2SVGAdapter(new scratch_svg_renderer__WEBPACK_IMPORTED_MODULE_9__["SVGRenderer"]()); _this.props.vm.attachV2BitmapAdapter(new scratch_svg_renderer__WEBPACK_IMPORTED_MODULE_9__["BitmapAdapter"]()); return _this; } _createClass(Stage, [{ key: "componentDidMount", value: function componentDidMount() { this.attachRectEvents(); this.attachMouseEvents(this.canvas); this.updateRect(); this.props.vm.runtime.addListener('QUESTION', this.questionListener); } }, { key: "shouldComponentUpdate", value: function shouldComponentUpdate(nextProps, nextState) { return this.props.stageSize !== nextProps.stageSize || this.props.isColorPicking !== nextProps.isColorPicking || this.state.colorInfo !== nextState.colorInfo || this.props.isFullScreen !== nextProps.isFullScreen || this.state.question !== nextState.question || this.props.micIndicator !== nextProps.micIndicator || this.props.isStarted !== nextProps.isStarted; } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (this.props.isColorPicking && !prevProps.isColorPicking) { this.startColorPickingLoop(); } else if (!this.props.isColorPicking && prevProps.isColorPicking) { this.stopColorPickingLoop(); } this.updateRect(); this.renderer.resize(this.rect.width, this.rect.height); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.detachMouseEvents(this.canvas); this.detachRectEvents(); this.stopColorPickingLoop(); this.props.vm.runtime.removeListener('QUESTION', this.questionListener); } }, { key: "questionListener", value: function questionListener(question) { this.setState({ question: question }); } }, { key: "handleQuestionAnswered", value: function handleQuestionAnswered(answer) { var _this2 = this; this.setState({ question: null }, function () { _this2.props.vm.runtime.emit('ANSWER', answer); }); } }, { key: "startColorPickingLoop", value: function startColorPickingLoop() { var _this3 = this; this.intervalId = setInterval(function () { if (typeof _this3.pickX === 'number') { _this3.setState({ colorInfo: _this3.getColorInfo(_this3.pickX, _this3.pickY) }); } }, 30); } }, { key: "stopColorPickingLoop", value: function stopColorPickingLoop() { clearInterval(this.intervalId); } }, { key: "attachMouseEvents", value: function attachMouseEvents(canvas) { document.addEventListener('mousemove', this.onMouseMove); document.addEventListener('mouseup', this.onMouseUp); document.addEventListener('touchmove', this.onMouseMove); document.addEventListener('touchend', this.onMouseUp); canvas.addEventListener('mousedown', this.onMouseDown); canvas.addEventListener('touchstart', this.onMouseDown); canvas.addEventListener('wheel', this.onWheel); } }, { key: "detachMouseEvents", value: function detachMouseEvents(canvas) { document.removeEventListener('mousemove', this.onMouseMove); document.removeEventListener('mouseup', this.onMouseUp); document.removeEventListener('touchmove', this.onMouseMove); document.removeEventListener('touchend', this.onMouseUp); canvas.removeEventListener('mousedown', this.onMouseDown); canvas.removeEventListener('touchstart', this.onMouseDown); canvas.removeEventListener('wheel', this.onWheel); } }, { key: "attachRectEvents", value: function attachRectEvents() { window.addEventListener('resize', this.updateRect); window.addEventListener('scroll', this.updateRect); } }, { key: "detachRectEvents", value: function detachRectEvents() { window.removeEventListener('resize', this.updateRect); window.removeEventListener('scroll', this.updateRect); } }, { key: "updateRect", value: function updateRect() { this.rect = this.canvas.getBoundingClientRect(); } }, { key: "getScratchCoords", value: function getScratchCoords(x, y) { var nativeSize = this.renderer.getNativeSize(); return [nativeSize[0] / this.rect.width * (x - this.rect.width / 2), nativeSize[1] / this.rect.height * (y - this.rect.height / 2)]; } }, { key: "getColorInfo", value: function getColorInfo(x, y) { return _objectSpread({ x: x, y: y }, this.renderer.extractColor(x, y, colorPickerRadius)); } }, { key: "handleDoubleClick", value: function handleDoubleClick(e) { var _getEventXY = Object(_lib_touch_utils__WEBPACK_IMPORTED_MODULE_7__["getEventXY"])(e), x = _getEventXY.x, y = _getEventXY.y; // Set editing target from cursor position, if clicking on a sprite. var mousePosition = [x - this.rect.left, y - this.rect.top]; var drawableId = this.renderer.pick(mousePosition[0], mousePosition[1]); if (drawableId === null) return; var targetId = this.props.vm.getTargetIdForDrawableId(drawableId); if (targetId === null) return; this.props.vm.setEditingTarget(targetId); } }, { key: "onMouseMove", value: function onMouseMove(e) { var _getEventXY2 = Object(_lib_touch_utils__WEBPACK_IMPORTED_MODULE_7__["getEventXY"])(e), x = _getEventXY2.x, y = _getEventXY2.y; var mousePosition = [x - this.rect.left, y - this.rect.top]; if (this.props.isColorPicking) { // Set the pickX/Y for the color picker loop to pick up this.pickX = mousePosition[0]; this.pickY = mousePosition[1]; } if (this.state.mouseDown && !this.state.isDragging) { var distanceFromMouseDown = Math.sqrt(Math.pow(mousePosition[0] - this.state.mouseDownPosition[0], 2) + Math.pow(mousePosition[1] - this.state.mouseDownPosition[1], 2)); if (distanceFromMouseDown > dragThreshold) { this.cancelMouseDownTimeout(); this.onStartDrag.apply(this, _toConsumableArray(this.state.mouseDownPosition)); } } if (this.state.mouseDown && this.state.isDragging) { // Editor drag style only updates the drag canvas, does full update at the end of drag // Non-editor drag style just updates the sprite continuously. if (this.props.useEditorDragStyle) { this.positionDragCanvas(mousePosition[0], mousePosition[1]); } else { var spritePosition = this.getScratchCoords(mousePosition[0], mousePosition[1]); this.props.vm.postSpriteInfo({ x: spritePosition[0] + this.state.dragOffset[0], y: -(spritePosition[1] + this.state.dragOffset[1]), force: true }); } } var coordinates = { x: mousePosition[0], y: mousePosition[1], canvasWidth: this.rect.width, canvasHeight: this.rect.height }; this.props.vm.postIOData('mouse', coordinates); } }, { key: "onMouseUp", value: function onMouseUp(e) { var _getEventXY3 = Object(_lib_touch_utils__WEBPACK_IMPORTED_MODULE_7__["getEventXY"])(e), x = _getEventXY3.x, y = _getEventXY3.y; var mousePosition = [x - this.rect.left, y - this.rect.top]; this.cancelMouseDownTimeout(); this.setState({ mouseDown: false, mouseDownPosition: null }); var data = { isDown: false, x: x - this.rect.left, y: y - this.rect.top, canvasWidth: this.rect.width, canvasHeight: this.rect.height, wasDragged: this.state.isDragging }; if (this.state.isDragging) { this.onStopDrag(mousePosition[0], mousePosition[1]); } this.props.vm.postIOData('mouse', data); if (this.props.isColorPicking && mousePosition[0] > 0 && mousePosition[0] < this.rect.width && mousePosition[1] > 0 && mousePosition[1] < this.rect.height) { var _this$state$colorInfo = this.state.colorInfo.color, r = _this$state$colorInfo.r, g = _this$state$colorInfo.g, b = _this$state$colorInfo.b; var componentToString = function componentToString(c) { var hex = c.toString(16); return hex.length === 1 ? "0".concat(hex) : hex; }; var colorString = "#".concat(componentToString(r)).concat(componentToString(g)).concat(componentToString(b)); this.props.onDeactivateColorPicker(colorString); this.setState({ colorInfo: null }); this.pickX = null; this.pickY = null; } } }, { key: "onMouseDown", value: function onMouseDown(e) { this.updateRect(); var _getEventXY4 = Object(_lib_touch_utils__WEBPACK_IMPORTED_MODULE_7__["getEventXY"])(e), x = _getEventXY4.x, y = _getEventXY4.y; var mousePosition = [x - this.rect.left, y - this.rect.top]; if (this.props.isColorPicking) { // Set the pickX/Y for the color picker loop to pick up this.pickX = mousePosition[0]; this.pickY = mousePosition[1]; // Immediately update the color picker info this.setState({ colorInfo: this.getColorInfo(this.pickX, this.pickY) }); } else { if (e.button === 0 || window.TouchEvent && e instanceof TouchEvent) { this.setState({ mouseDown: true, mouseDownPosition: mousePosition, mouseDownTimeoutId: setTimeout(this.onStartDrag.bind(this, mousePosition[0], mousePosition[1]), 400) }); } var data = { isDown: true, x: mousePosition[0], y: mousePosition[1], canvasWidth: this.rect.width, canvasHeight: this.rect.height }; this.props.vm.postIOData('mouse', data); if (e.preventDefault) { // Prevent default to prevent touch from dragging page e.preventDefault(); // But we do want any active input to be blurred if (document.activeElement && document.activeElement.blur) { document.activeElement.blur(); } } } } }, { key: "onWheel", value: function onWheel(e) { var data = { deltaX: e.deltaX, deltaY: e.deltaY }; this.props.vm.postIOData('mouseWheel', data); } }, { key: "cancelMouseDownTimeout", value: function cancelMouseDownTimeout() { if (this.state.mouseDownTimeoutId !== null) { clearTimeout(this.state.mouseDownTimeoutId); } this.setState({ mouseDownTimeoutId: null }); } }, { key: "drawDragCanvas", value: function drawDragCanvas(drawableData) { var data = drawableData.data, width = drawableData.width, height = drawableData.height, x = drawableData.x, y = drawableData.y; this.dragCanvas.width = width; this.dragCanvas.height = height; // Need to convert uint8array from WebGL readPixels into Uint8ClampedArray // for ImageData constructor. Shares underlying buffer, so it is fast. var imageData = new ImageData(new Uint8ClampedArray(data.buffer), width, height); this.dragCanvas.getContext('2d').putImageData(imageData, 0, 0); // Position so that pick location is at (0, 0) so that positionDragCanvas() // can use translation to move to mouse position smoothly. this.dragCanvas.style.left = "".concat(-x, "px"); this.dragCanvas.style.top = "".concat(-y, "px"); this.dragCanvas.style.display = 'block'; } }, { key: "clearDragCanvas", value: function clearDragCanvas() { this.dragCanvas.width = this.dragCanvas.height = 0; this.dragCanvas.style.display = 'none'; } }, { key: "positionDragCanvas", value: function positionDragCanvas(mouseX, mouseY) { // mouseX/Y are relative to stage top/left, and dragCanvas is already // positioned so that the pick location is at (0,0). this.dragCanvas.style.transform = "translate(".concat(mouseX, "px, ").concat(mouseY, "px)"); } }, { key: "onStartDrag", value: function onStartDrag(x, y) { if (this.state.dragId) return; var drawableId = this.renderer.pick(x, y); if (drawableId === null) return; var targetId = this.props.vm.getTargetIdForDrawableId(drawableId); if (targetId === null) return; var target = this.props.vm.runtime.getTargetById(targetId); // Do not start drag unless in editor drag mode or target is draggable if (!(this.props.useEditorDragStyle || target.draggable)) return; // Dragging always brings the target to the front target.goToFront(); // Extract the drawable art var drawableData = this.renderer.extractDrawable(drawableId, x, y); this.props.vm.startDrag(targetId); this.setState({ isDragging: true, dragId: targetId, dragOffset: drawableData.scratchOffset }); if (this.props.useEditorDragStyle) { this.drawDragCanvas(drawableData); this.positionDragCanvas(x, y); this.props.vm.postSpriteInfo({ visible: false }); } } }, { key: "onStopDrag", value: function onStopDrag(mouseX, mouseY) { var _this4 = this; var dragId = this.state.dragId; var commonStopDragActions = function commonStopDragActions() { _this4.props.vm.stopDrag(dragId); _this4.setState({ isDragging: false, dragOffset: null, dragId: null }); }; if (this.props.useEditorDragStyle) { // Need to sequence these actions to prevent flickering. var spriteInfo = { visible: true }; // First update the sprite position if dropped in the stage. if (mouseX > 0 && mouseX < this.rect.width && mouseY > 0 && mouseY < this.rect.height) { var spritePosition = this.getScratchCoords(mouseX, mouseY); spriteInfo.x = spritePosition[0] + this.state.dragOffset[0]; spriteInfo.y = -(spritePosition[1] + this.state.dragOffset[1]); spriteInfo.force = true; } this.props.vm.postSpriteInfo(spriteInfo); // Then clear the dragging canvas and stop drag (potentially slow if selecting sprite) setTimeout(function () { _this4.clearDragCanvas(); setTimeout(function () { commonStopDragActions(); }, 30); }, 30); } else { commonStopDragActions(); } } }, { key: "setDragCanvas", value: function setDragCanvas(canvas) { this.dragCanvas = canvas; } }, { key: "render", value: function render() { var _this$props = this.props, vm = _this$props.vm, onActivateColorPicker = _this$props.onActivateColorPicker, props = _objectWithoutProperties(_this$props, ["vm", "onActivateColorPicker"]); return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_components_stage_stage_jsx__WEBPACK_IMPORTED_MODULE_10__["default"], _extends({ canvas: this.canvas, colorInfo: this.state.colorInfo, dragRef: this.setDragCanvas, question: this.state.question, onDoubleClick: this.handleDoubleClick, onQuestionAnswered: this.handleQuestionAnswered }, props)); } }]); return Stage; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.Component); Stage.propTypes = { isColorPicking: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, isFullScreen: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool.isRequired, isStarted: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, micIndicator: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, onActivateColorPicker: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onDeactivateColorPicker: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, stageSize: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOf(Object.keys(_lib_layout_constants__WEBPACK_IMPORTED_MODULE_6__["STAGE_DISPLAY_SIZES"])).isRequired, useEditorDragStyle: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, vm: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.instanceOf(scratch_vm__WEBPACK_IMPORTED_MODULE_4___default.a).isRequired }; Stage.defaultProps = { useEditorDragStyle: true }; var mapStateToProps = function mapStateToProps(state) { return { isColorPicking: state.scratchGui.colorPicker.active, isFullScreen: state.scratchGui.mode.isFullScreen, isStarted: state.scratchGui.vmStatus.started, micIndicator: state.scratchGui.micIndicator, // Do not use editor drag style in fullscreen or player mode. useEditorDragStyle: !(state.scratchGui.mode.isFullScreen || state.scratchGui.mode.isPlayerOnly) }; }; var mapDispatchToProps = function mapDispatchToProps(dispatch) { return { onActivateColorPicker: function onActivateColorPicker() { return dispatch(Object(_reducers_color_picker__WEBPACK_IMPORTED_MODULE_11__["activateColorPicker"])()); }, onDeactivateColorPicker: function onDeactivateColorPicker(color) { return dispatch(Object(_reducers_color_picker__WEBPACK_IMPORTED_MODULE_11__["deactivateColorPicker"])(color)); } }; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_redux__WEBPACK_IMPORTED_MODULE_5__["connect"])(mapStateToProps, mapDispatchToProps)(Stage)); /***/ }), /***/ "./src/containers/sugarizer-loader.jsx": /*!*********************************************!*\ !*** ./src/containers/sugarizer-loader.jsx ***! \*********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _lib_log__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../lib/log */ "./src/lib/log.js"); /* harmony import */ var _lib_shared_messages__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lib/shared-messages */ "./src/lib/shared-messages.js"); /* harmony import */ var _reducers_project_state__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../reducers/project-state */ "./src/reducers/project-state.js"); /* harmony import */ var _reducers_modals__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../reducers/modals */ "./src/reducers/modals.js"); /* harmony import */ var _reducers_menus__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../reducers/menus */ "./src/reducers/menus.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } /** * SugarizerLoader component passes a file input, load handler and props to its child. * It expects this child to be a function with the signature * function (renderFileInput, loadProject) {} * The component can then be used to attach project loading functionality * to any other component: * * {(renderFileInput, loadProject) => ( * * * )} */ var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_4__["defineMessages"])({ loadError: { "id": "gui.projectLoader.loadError", "defaultMessage": "The project file that was selected failed to load." } }); var SugarizerLoader = /*#__PURE__*/ function (_React$Component) { _inherits(SugarizerLoader, _React$Component); function SugarizerLoader(props) { var _this; _classCallCheck(this, SugarizerLoader); _this = _possibleConstructorReturn(this, _getPrototypeOf(SugarizerLoader).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['loadProject']); return _this; } _createClass(SugarizerLoader, [{ key: "loadProject", value: function loadProject() { this.props.onLoadingStarted(); var dataURI = document.getElementById("myBlocks").value; if (dataURI) { var byteString = atob(dataURI.split(',')[1]); var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]; var ab = new ArrayBuffer(byteString.length); var ia = new Uint8Array(ab); for (var i = 0; i < byteString.length; i++) { ia[i] = byteString.charCodeAt(i); } var blob = new Blob([ab], { type: mimeString }); var reader = new FileReader(); var that = this; reader.addEventListener("loadend", function () { that.props.vm.loadProject(reader.result).then(function () { that.props.onLoadingFinished(that.props.loadingState, true); }).catch(function (error) { that.props.onLoadingFinished(that.props.loadingState, false); }); }); reader.readAsArrayBuffer(blob); } else { console.log("ERROR loading Sugarizer project"); this.props.onLoadingFinished(this.props.loadingState, false); } } }, { key: "render", value: function render() { var children = this.props.children; return children(this.loadProject); } }]); return SugarizerLoader; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.Component); SugarizerLoader.propTypes = { canSave: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, // eslint-disable-line react/no-unused-prop-types children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, className: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, closeFileMenu: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, isLoadingUpload: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, isShowingWithoutId: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, loadingState: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOf(_reducers_project_state__WEBPACK_IMPORTED_MODULE_7__["LoadingStates"]), onLoadingFinished: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onLoadingStarted: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onUpdateProjectTitle: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, projectChanged: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, requestProjectUpload: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, userOwnsProject: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, vm: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.shape({ loadProject: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func }) }; SugarizerLoader.defaultProps = { className: '' }; var mapStateToProps = function mapStateToProps(state) { var loadingState = state.scratchGui.projectState.loadingState; return { isLoadingUpload: Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_7__["getIsLoadingUpload"])(loadingState), isShowingWithoutId: Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_7__["getIsShowingWithoutId"])(loadingState), loadingState: loadingState, projectChanged: state.scratchGui.projectChanged, vm: state.scratchGui.vm }; }; var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { return { closeFileMenu: function closeFileMenu() { return dispatch(Object(_reducers_menus__WEBPACK_IMPORTED_MODULE_9__["closeFileMenu"])()); }, onLoadingFinished: function onLoadingFinished(loadingState, success) { dispatch(Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_7__["onLoadedProject"])(loadingState, ownProps.canSave, success)); dispatch(Object(_reducers_modals__WEBPACK_IMPORTED_MODULE_8__["closeLoadingProject"])()); dispatch(Object(_reducers_menus__WEBPACK_IMPORTED_MODULE_9__["closeFileMenu"])()); }, requestProjectUpload: function requestProjectUpload(loadingState) { return dispatch(Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_7__["requestProjectUpload"])(loadingState)); }, onLoadingStarted: function onLoadingStarted() { return dispatch(Object(_reducers_modals__WEBPACK_IMPORTED_MODULE_8__["openLoadingProject"])()); } }; }; // Allow incoming props to override redux-provided props. Used to mock in tests. var mergeProps = function mergeProps(stateProps, dispatchProps, ownProps) { return Object.assign({}, stateProps, dispatchProps, ownProps); }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_redux__WEBPACK_IMPORTED_MODULE_3__["connect"])(mapStateToProps, mapDispatchToProps, mergeProps)(SugarizerLoader)); /***/ }), /***/ "./src/containers/sugarizer-saver.jsx": /*!********************************************!*\ !*** ./src/containers/sugarizer-saver.jsx ***! \********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _reducers_project_title__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../reducers/project-title */ "./src/reducers/project-title.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } /** * Project saver component passes a saveProject function to its child. * It expects this child to be a function with the signature * function (saveProject, props) {} * The component can then be used to attach project saving functionality * to any other component: * * {(saveProject, props) => ( * * )} */ var SugarizerSaver = /*#__PURE__*/ function (_React$Component) { _inherits(SugarizerSaver, _React$Component); function SugarizerSaver(props) { var _this; _classCallCheck(this, SugarizerSaver); _this = _possibleConstructorReturn(this, _getPrototypeOf(SugarizerSaver).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['saveProject']); return _this; } _createClass(SugarizerSaver, [{ key: "saveProject", value: function saveProject() { this.props.saveProjectSb3().then(function (content) { var reader = new FileReader(); reader.addEventListener("loadend", function () { var json = reader.result; if (json) { document.getElementById("myBlocks").value = json; document.getElementById("myBlocks").click(); } else { console.log("ERROR saving Sugarizer project"); } }); reader.readAsDataURL(content); }); } }, { key: "render", value: function render() { var children = this.props.children; return children(this.saveProject); } }]); return SugarizerSaver; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.Component); var getProjectFilename = function getProjectFilename(curTitle, defaultTitle) { var filenameTitle = curTitle; if (!filenameTitle || filenameTitle.length === 0) { filenameTitle = defaultTitle; } return "".concat(filenameTitle.substring(0, 100), ".sb3"); }; SugarizerSaver.propTypes = { children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, className: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, onSaveFinished: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, projectFilename: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, saveProjectSb3: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func }; SugarizerSaver.defaultProps = { className: '' }; var mapStateToProps = function mapStateToProps(state) { return { saveProjectSb3: state.scratchGui.vm.saveProjectSb3.bind(state.scratchGui.vm), projectFilename: getProjectFilename(state.scratchGui.projectTitle, _reducers_project_title__WEBPACK_IMPORTED_MODULE_4__["projectTitleInitialState"]) }; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_redux__WEBPACK_IMPORTED_MODULE_3__["connect"])(mapStateToProps, function () { return {}; } // omit dispatch prop )(SugarizerSaver)); /***/ }), /***/ "./src/containers/tag-button.jsx": /*!***************************************!*\ !*** ./src/containers/tag-button.jsx ***! \***************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _components_tag_button_tag_button_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/tag-button/tag-button.jsx */ "./src/components/tag-button/tag-button.jsx"); function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var TagButton = /*#__PURE__*/ function (_React$Component) { _inherits(TagButton, _React$Component); function TagButton(props) { var _this; _classCallCheck(this, TagButton); _this = _possibleConstructorReturn(this, _getPrototypeOf(TagButton).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['handleClick']); return _this; } _createClass(TagButton, [{ key: "handleClick", value: function handleClick() { this.props.onClick(this.props.tag); } }, { key: "render", value: function render() { return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_components_tag_button_tag_button_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], _extends({}, this.props, { onClick: this.handleClick })); } }]); return TagButton; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.Component); TagButton.propTypes = _objectSpread({}, _components_tag_button_tag_button_jsx__WEBPACK_IMPORTED_MODULE_3__["default"].propTypes, { onClick: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func }); /* harmony default export */ __webpack_exports__["default"] = (TagButton); /***/ }), /***/ "./src/containers/target-highlight.jsx": /*!*********************************************!*\ !*** ./src/containers/target-highlight.jsx ***! \*********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! scratch-vm */ "./node_modules/scratch-vm/src/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(scratch_vm__WEBPACK_IMPORTED_MODULE_4__); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var TargetHighlight = /*#__PURE__*/ function (_React$Component) { _inherits(TargetHighlight, _React$Component); function TargetHighlight(props) { var _this; _classCallCheck(this, TargetHighlight); _this = _possibleConstructorReturn(this, _getPrototypeOf(TargetHighlight).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['getPageCoords']); return _this; } // Transform scratch coordinates into page coordinates _createClass(TargetHighlight, [{ key: "getPageCoords", value: function getPageCoords(x, y) { var _this$props = this.props, stageWidth = _this$props.stageWidth, stageHeight = _this$props.stageHeight, vm = _this$props.vm; // The renderers "nativeSize" is the [width, height] of the stage in scratch-units var nativeSize = vm.renderer.getNativeSize(); return [stageWidth / nativeSize[0] * x + stageWidth / 2, -(stageHeight / nativeSize[1] * y) + stageHeight / 2]; } }, { key: "render", value: function render() { var _this$props2 = this.props, className = _this$props2.className, highlightedTargetId = _this$props2.highlightedTargetId, highlightedTargetTime = _this$props2.highlightedTargetTime, vm = _this$props2.vm; if (!(highlightedTargetId && vm && vm.renderer && vm.runtime.getTargetById(highlightedTargetId))) return null; var target = vm.runtime.getTargetById(highlightedTargetId); var bounds = vm.renderer.getBounds(target.drawableID); var _this$getPageCoords = this.getPageCoords(bounds.left, bounds.top), _this$getPageCoords2 = _slicedToArray(_this$getPageCoords, 2), left = _this$getPageCoords2[0], top = _this$getPageCoords2[1]; var _this$getPageCoords3 = this.getPageCoords(bounds.right, bounds.bottom), _this$getPageCoords4 = _slicedToArray(_this$getPageCoords3, 2), right = _this$getPageCoords4[0], bottom = _this$getPageCoords4[1]; var pad = 2; // px return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { className: className // Ensure new DOM element each update to restart animation , key: highlightedTargetTime, style: { position: 'absolute', top: "".concat(top - pad, "px"), left: "".concat(left - pad, "px"), width: "".concat(right - left + 2 * pad, "px"), height: "".concat(bottom - top + 2 * pad, "px") } }); } }]); return TargetHighlight; }(react__WEBPACK_IMPORTED_MODULE_1___default.a.Component); TargetHighlight.propTypes = { className: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, highlightedTargetId: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, highlightedTargetTime: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number, stageHeight: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number, stageWidth: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number, vm: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.instanceOf(scratch_vm__WEBPACK_IMPORTED_MODULE_4___default.a) }; var mapStateToProps = function mapStateToProps(state) { return { highlightedTargetTime: state.scratchGui.targets.highlightedTargetTime, highlightedTargetId: state.scratchGui.targets.highlightedTargetId, vm: state.scratchGui.vm }; }; var mapDispatchToProps = function mapDispatchToProps() { return {}; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_redux__WEBPACK_IMPORTED_MODULE_3__["connect"])(mapStateToProps, mapDispatchToProps)(TargetHighlight)); /***/ }), /***/ "./src/containers/target-pane.jsx": /*!****************************************!*\ !*** ./src/containers/target-pane.jsx ***! \****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _reducers_modals__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../reducers/modals */ "./src/reducers/modals.js"); /* harmony import */ var _reducers_editor_tab__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../reducers/editor-tab */ "./src/reducers/editor-tab.js"); /* harmony import */ var _reducers_hovered_target__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../reducers/hovered-target */ "./src/reducers/hovered-target.js"); /* harmony import */ var _reducers_alerts__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../reducers/alerts */ "./src/reducers/alerts.js"); /* harmony import */ var _reducers_restore_deletion__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../reducers/restore-deletion */ "./src/reducers/restore-deletion.js"); /* harmony import */ var _lib_drag_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../lib/drag-constants */ "./src/lib/drag-constants.js"); /* harmony import */ var _components_target_pane_target_pane_jsx__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../components/target-pane/target-pane.jsx */ "./src/components/target-pane/target-pane.jsx"); /* harmony import */ var _lib_libraries_sprites_json__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../lib/libraries/sprites.json */ "./src/lib/libraries/sprites.json"); var _lib_libraries_sprites_json__WEBPACK_IMPORTED_MODULE_12___namespace = /*#__PURE__*/__webpack_require__.t(/*! ../lib/libraries/sprites.json */ "./src/lib/libraries/sprites.json", 1); /* harmony import */ var _lib_file_uploader_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../lib/file-uploader.js */ "./src/lib/file-uploader.js"); /* harmony import */ var _lib_shared_messages__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../lib/shared-messages */ "./src/lib/shared-messages.js"); /* harmony import */ var _lib_empty_assets__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../lib/empty-assets */ "./src/lib/empty-assets.js"); /* harmony import */ var _reducers_targets__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../reducers/targets */ "./src/reducers/targets.js"); /* harmony import */ var _lib_backpack_api__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../lib/backpack-api */ "./src/lib/backpack-api.js"); /* harmony import */ var _lib_randomize_sprite_position__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../lib/randomize-sprite-position */ "./src/lib/randomize-sprite-position.js"); /* harmony import */ var _lib_download_blob__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../lib/download-blob */ "./src/lib/download-blob.js"); function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var TargetPane = /*#__PURE__*/ function (_React$Component) { _inherits(TargetPane, _React$Component); function TargetPane(props) { var _this; _classCallCheck(this, TargetPane); _this = _possibleConstructorReturn(this, _getPrototypeOf(TargetPane).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['handleActivateBlocksTab', 'handleBlockDragEnd', 'handleChangeSpriteRotationStyle', 'handleChangeSpriteDirection', 'handleChangeSpriteName', 'handleChangeSpriteSize', 'handleChangeSpriteVisibility', 'handleChangeSpriteX', 'handleChangeSpriteY', 'handleDeleteSprite', 'handleDrop', 'handleDuplicateSprite', 'handleExportSprite', 'handleNewSprite', 'handleSelectSprite', 'handleSurpriseSpriteClick', 'handlePaintSpriteClick', 'handleFileUploadClick', 'handleSpriteUpload', 'setFileInput']); return _this; } _createClass(TargetPane, [{ key: "componentDidMount", value: function componentDidMount() { this.props.vm.addListener('BLOCK_DRAG_END', this.handleBlockDragEnd); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.props.vm.removeListener('BLOCK_DRAG_END', this.handleBlockDragEnd); } }, { key: "handleChangeSpriteDirection", value: function handleChangeSpriteDirection(direction) { this.props.vm.postSpriteInfo({ direction: direction }); } }, { key: "handleChangeSpriteRotationStyle", value: function handleChangeSpriteRotationStyle(rotationStyle) { this.props.vm.postSpriteInfo({ rotationStyle: rotationStyle }); } }, { key: "handleChangeSpriteName", value: function handleChangeSpriteName(name) { this.props.vm.renameSprite(this.props.editingTarget, name); } }, { key: "handleChangeSpriteSize", value: function handleChangeSpriteSize(size) { this.props.vm.postSpriteInfo({ size: size }); } }, { key: "handleChangeSpriteVisibility", value: function handleChangeSpriteVisibility(visible) { this.props.vm.postSpriteInfo({ visible: visible }); } }, { key: "handleChangeSpriteX", value: function handleChangeSpriteX(x) { this.props.vm.postSpriteInfo({ x: x }); } }, { key: "handleChangeSpriteY", value: function handleChangeSpriteY(y) { this.props.vm.postSpriteInfo({ y: y }); } }, { key: "handleDeleteSprite", value: function handleDeleteSprite(id) { var _this2 = this; var restoreSprite = this.props.vm.deleteSprite(id); var restoreFun = function restoreFun() { return restoreSprite().then(_this2.handleActivateBlocksTab); }; this.props.dispatchUpdateRestore({ restoreFun: restoreFun, deletedItem: 'Sprite' }); } }, { key: "handleDuplicateSprite", value: function handleDuplicateSprite(id) { this.props.vm.duplicateSprite(id); } }, { key: "handleExportSprite", value: function handleExportSprite(id) { var spriteName = this.props.vm.runtime.getTargetById(id).getName(); var saveLink = document.createElement('a'); document.body.appendChild(saveLink); this.props.vm.exportSprite(id).then(function (content) { Object(_lib_download_blob__WEBPACK_IMPORTED_MODULE_19__["default"])("".concat(spriteName, ".sprite3"), content); }); } }, { key: "handleSelectSprite", value: function handleSelectSprite(id) { this.props.vm.setEditingTarget(id); if (this.props.stage && id !== this.props.stage.id) { this.props.onHighlightTarget(id); } } }, { key: "handleSurpriseSpriteClick", value: function handleSurpriseSpriteClick() { var item = _lib_libraries_sprites_json__WEBPACK_IMPORTED_MODULE_12__[Math.floor(Math.random() * _lib_libraries_sprites_json__WEBPACK_IMPORTED_MODULE_12__.length)]; Object(_lib_randomize_sprite_position__WEBPACK_IMPORTED_MODULE_18__["default"])(item); this.props.vm.addSprite(JSON.stringify(item.json)).then(this.handleActivateBlocksTab); } }, { key: "handlePaintSpriteClick", value: function handlePaintSpriteClick() { var _this3 = this; var formatMessage = this.props.intl.formatMessage; var emptyItem = Object(_lib_empty_assets__WEBPACK_IMPORTED_MODULE_15__["emptySprite"])(formatMessage(_lib_shared_messages__WEBPACK_IMPORTED_MODULE_14__["default"].sprite, { index: 1 }), formatMessage(_lib_shared_messages__WEBPACK_IMPORTED_MODULE_14__["default"].pop), formatMessage(_lib_shared_messages__WEBPACK_IMPORTED_MODULE_14__["default"].costume, { index: 1 })); this.props.vm.addSprite(JSON.stringify(emptyItem)).then(function () { setTimeout(function () { // Wait for targets update to propagate before tab switching _this3.props.onActivateTab(_reducers_editor_tab__WEBPACK_IMPORTED_MODULE_6__["COSTUMES_TAB_INDEX"]); }); }); } }, { key: "handleActivateBlocksTab", value: function handleActivateBlocksTab() { this.props.onActivateTab(_reducers_editor_tab__WEBPACK_IMPORTED_MODULE_6__["BLOCKS_TAB_INDEX"]); } }, { key: "handleNewSprite", value: function handleNewSprite(spriteJSONString) { return this.props.vm.addSprite(spriteJSONString).then(this.handleActivateBlocksTab); } }, { key: "handleFileUploadClick", value: function handleFileUploadClick() { this.fileInput.click(); } }, { key: "handleSpriteUpload", value: function handleSpriteUpload(e) { var _this4 = this; var storage = this.props.vm.runtime.storage; this.props.onShowImporting(); Object(_lib_file_uploader_js__WEBPACK_IMPORTED_MODULE_13__["handleFileUpload"])(e.target, function (buffer, fileType, fileName, fileIndex, fileCount) { Object(_lib_file_uploader_js__WEBPACK_IMPORTED_MODULE_13__["spriteUpload"])(buffer, fileType, fileName, storage, function (newSprite) { _this4.handleNewSprite(newSprite).then(function () { if (fileIndex === fileCount - 1) { _this4.props.onCloseImporting(); } }); }, _this4.props.onCloseImporting); }, this.props.onCloseImporting); } }, { key: "setFileInput", value: function setFileInput(input) { this.fileInput = input; } }, { key: "handleBlockDragEnd", value: function handleBlockDragEnd(blocks) { if (this.props.hoveredTarget.sprite && this.props.hoveredTarget.sprite !== this.props.editingTarget) { this.props.vm.shareBlocksToTarget(blocks, this.props.hoveredTarget.sprite, this.props.editingTarget); this.props.onReceivedBlocks(true); } } }, { key: "handleDrop", value: function handleDrop(dragInfo) { var _this5 = this; var targetId = this.props.hoveredTarget.sprite; if (dragInfo.dragType === _lib_drag_constants__WEBPACK_IMPORTED_MODULE_10__["default"].SPRITE) { // Add one to both new and target index because we are not counting/moving the stage this.props.vm.reorderTarget(dragInfo.index + 1, dragInfo.newIndex + 1); } else if (dragInfo.dragType === _lib_drag_constants__WEBPACK_IMPORTED_MODULE_10__["default"].BACKPACK_SPRITE) { // TODO storage does not have a way of loading zips right now, and may never need it. // So for now just grab the zip manually. Object(_lib_backpack_api__WEBPACK_IMPORTED_MODULE_17__["fetchSprite"])(dragInfo.payload.bodyUrl).then(function (sprite3Zip) { return _this5.props.vm.addSprite(sprite3Zip); }); } else if (targetId) { // Something is being dragged over one of the sprite tiles or the backdrop. // Dropping assets like sounds and costumes duplicate the asset on the // hovered target. Shared costumes also become the current costume on that target. // However, dropping does not switch the editing target or activate that editor tab. // This is based on 2.0 behavior, but seems like it keeps confusing switching to a minimum. // it allows the user to share multiple things without switching back and forth. if (dragInfo.dragType === _lib_drag_constants__WEBPACK_IMPORTED_MODULE_10__["default"].COSTUME) { this.props.vm.shareCostumeToTarget(dragInfo.index, targetId); } else if (targetId && dragInfo.dragType === _lib_drag_constants__WEBPACK_IMPORTED_MODULE_10__["default"].SOUND) { this.props.vm.shareSoundToTarget(dragInfo.index, targetId); } else if (dragInfo.dragType === _lib_drag_constants__WEBPACK_IMPORTED_MODULE_10__["default"].BACKPACK_COSTUME) { // In scratch 2, this only creates a new sprite from the costume. // We may be able to handle both kinds of drops, depending on where // the drop happens. For now, just add the costume. this.props.vm.addCostume(dragInfo.payload.body, { name: dragInfo.payload.name }, targetId); } else if (dragInfo.dragType === _lib_drag_constants__WEBPACK_IMPORTED_MODULE_10__["default"].BACKPACK_SOUND) { this.props.vm.addSound({ md5: dragInfo.payload.body, name: dragInfo.payload.name }, targetId); } else if (dragInfo.dragType === _lib_drag_constants__WEBPACK_IMPORTED_MODULE_10__["default"].BACKPACK_CODE) { Object(_lib_backpack_api__WEBPACK_IMPORTED_MODULE_17__["fetchCode"])(dragInfo.payload.bodyUrl).then(function (blocks) { _this5.props.vm.shareBlocksToTarget(blocks, targetId); _this5.props.vm.refreshWorkspace(); }); } } } }, { key: "render", value: function render() { var _this$props = this.props, onActivateTab = _this$props.onActivateTab, onReceivedBlocks = _this$props.onReceivedBlocks, onHighlightTarget = _this$props.onHighlightTarget, dispatchUpdateRestore = _this$props.dispatchUpdateRestore, onShowImporting = _this$props.onShowImporting, onCloseImporting = _this$props.onCloseImporting, componentProps = _objectWithoutProperties(_this$props, ["onActivateTab", "onReceivedBlocks", "onHighlightTarget", "dispatchUpdateRestore", "onShowImporting", "onCloseImporting"]); return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_components_target_pane_target_pane_jsx__WEBPACK_IMPORTED_MODULE_11__["default"], _extends({}, componentProps, { fileInputRef: this.setFileInput, onActivateBlocksTab: this.handleActivateBlocksTab, onChangeSpriteDirection: this.handleChangeSpriteDirection, onChangeSpriteName: this.handleChangeSpriteName, onChangeSpriteRotationStyle: this.handleChangeSpriteRotationStyle, onChangeSpriteSize: this.handleChangeSpriteSize, onChangeSpriteVisibility: this.handleChangeSpriteVisibility, onChangeSpriteX: this.handleChangeSpriteX, onChangeSpriteY: this.handleChangeSpriteY, onDeleteSprite: this.handleDeleteSprite, onDrop: this.handleDrop, onDuplicateSprite: this.handleDuplicateSprite, onExportSprite: this.handleExportSprite, onFileUploadClick: this.handleFileUploadClick, onPaintSpriteClick: this.handlePaintSpriteClick, onSelectSprite: this.handleSelectSprite, onSpriteUpload: this.handleSpriteUpload, onSurpriseSpriteClick: this.handleSurpriseSpriteClick })); } }]); return TargetPane; }(react__WEBPACK_IMPORTED_MODULE_1___default.a.Component); var _TargetPaneComponent$ = _components_target_pane_target_pane_jsx__WEBPACK_IMPORTED_MODULE_11__["default"].propTypes, onSelectSprite = _TargetPaneComponent$.onSelectSprite, onActivateBlocksTab = _TargetPaneComponent$.onActivateBlocksTab, targetPaneProps = _objectWithoutProperties(_TargetPaneComponent$, ["onSelectSprite", "onActivateBlocksTab"]); TargetPane.propTypes = _objectSpread({ intl: react_intl__WEBPACK_IMPORTED_MODULE_4__["intlShape"].isRequired, onCloseImporting: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onShowImporting: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func }, targetPaneProps); var mapStateToProps = function mapStateToProps(state) { return { editingTarget: state.scratchGui.targets.editingTarget, hoveredTarget: state.scratchGui.hoveredTarget, sprites: state.scratchGui.targets.sprites, stage: state.scratchGui.targets.stage, raiseSprites: state.scratchGui.blockDrag, spriteLibraryVisible: state.scratchGui.modals.spriteLibrary }; }; var mapDispatchToProps = function mapDispatchToProps(dispatch) { return { onNewSpriteClick: function onNewSpriteClick(e) { e.preventDefault(); dispatch(Object(_reducers_modals__WEBPACK_IMPORTED_MODULE_5__["openSpriteLibrary"])()); }, onRequestCloseSpriteLibrary: function onRequestCloseSpriteLibrary() { dispatch(Object(_reducers_modals__WEBPACK_IMPORTED_MODULE_5__["closeSpriteLibrary"])()); }, onActivateTab: function onActivateTab(tabIndex) { dispatch(Object(_reducers_editor_tab__WEBPACK_IMPORTED_MODULE_6__["activateTab"])(tabIndex)); }, onReceivedBlocks: function onReceivedBlocks(receivedBlocks) { dispatch(Object(_reducers_hovered_target__WEBPACK_IMPORTED_MODULE_7__["setReceivedBlocks"])(receivedBlocks)); }, dispatchUpdateRestore: function dispatchUpdateRestore(restoreState) { dispatch(Object(_reducers_restore_deletion__WEBPACK_IMPORTED_MODULE_9__["setRestore"])(restoreState)); }, onHighlightTarget: function onHighlightTarget(id) { dispatch(Object(_reducers_targets__WEBPACK_IMPORTED_MODULE_16__["highlightTarget"])(id)); }, onCloseImporting: function onCloseImporting() { return dispatch(Object(_reducers_alerts__WEBPACK_IMPORTED_MODULE_8__["closeAlertWithId"])('importingAsset')); }, onShowImporting: function onShowImporting() { return dispatch(Object(_reducers_alerts__WEBPACK_IMPORTED_MODULE_8__["showStandardAlert"])('importingAsset')); } }; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_4__["injectIntl"])(Object(react_redux__WEBPACK_IMPORTED_MODULE_3__["connect"])(mapStateToProps, mapDispatchToProps)(TargetPane))); /***/ }), /***/ "./src/containers/tips-library.jsx": /*!*****************************************!*\ !*** ./src/containers/tips-library.jsx ***! \*****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _lib_libraries_decks_index_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/libraries/decks/index.jsx */ "./src/lib/libraries/decks/index.jsx"); /* harmony import */ var _lib_libraries_tutorial_tags__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../lib/libraries/tutorial-tags */ "./src/lib/libraries/tutorial-tags.js"); /* harmony import */ var _lib_analytics__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lib/analytics */ "./src/lib/analytics.js"); /* harmony import */ var _lib_isScratchDesktop__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../lib/isScratchDesktop */ "./src/lib/isScratchDesktop.js"); /* harmony import */ var _components_library_library_jsx__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../components/library/library.jsx */ "./src/components/library/library.jsx"); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _reducers_modals__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../reducers/modals */ "./src/reducers/modals.js"); /* harmony import */ var _reducers_cards__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../reducers/cards */ "./src/reducers/cards.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_3__["defineMessages"])({ tipsLibraryTitle: { "id": "gui.tipsLibrary.tutorials", "defaultMessage": "Choose a Tutorial" } }); var TipsLibrary = /*#__PURE__*/ function (_React$PureComponent) { _inherits(TipsLibrary, _React$PureComponent); function TipsLibrary(props) { var _this; _classCallCheck(this, TipsLibrary); _this = _possibleConstructorReturn(this, _getPrototypeOf(TipsLibrary).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['handleItemSelect']); return _this; } _createClass(TipsLibrary, [{ key: "handleItemSelect", value: function handleItemSelect(item) { _lib_analytics__WEBPACK_IMPORTED_MODULE_6__["default"].event({ category: 'library', action: 'Select How-to', label: item.id }); /* Support tutorials that require specific starter projects. If a tutorial declares "requiredProjectId", check that the URL contains it. If it is not, open a new page with this tutorial and project id. TODO remove this at first opportunity. If this is still here after HOC2018, blame Eric R. Andrew is also on record saying "this is temporary". UPDATE well now Paul is wrapped into this as well. Sigh... eventually we will find a solution that doesn't involve loading a whole project */ if (item.requiredProjectId && item.requiredProjectId !== this.props.projectId) { var urlParams = "/projects/".concat(item.requiredProjectId, "/editor?tutorial=").concat(item.urlId); return window.open(window.location.origin + urlParams, '_blank'); } this.props.onActivateDeck(item.id); } }, { key: "render", value: function render() { var decksLibraryThumbnailData = Object.keys(_lib_libraries_decks_index_jsx__WEBPACK_IMPORTED_MODULE_4__["default"]).filter(function (id) { return (// Scratch Desktop doesn't want tutorials with `requiredProjectId` Object(_lib_isScratchDesktop__WEBPACK_IMPORTED_MODULE_7__["notScratchDesktop"])() || !_lib_libraries_decks_index_jsx__WEBPACK_IMPORTED_MODULE_4__["default"][id].hasOwnProperty('requiredProjectId') ); }).map(function (id) { return { rawURL: _lib_libraries_decks_index_jsx__WEBPACK_IMPORTED_MODULE_4__["default"][id].img, id: id, name: _lib_libraries_decks_index_jsx__WEBPACK_IMPORTED_MODULE_4__["default"][id].name, featured: true, tags: _lib_libraries_decks_index_jsx__WEBPACK_IMPORTED_MODULE_4__["default"][id].tags, urlId: _lib_libraries_decks_index_jsx__WEBPACK_IMPORTED_MODULE_4__["default"][id].urlId, requiredProjectId: _lib_libraries_decks_index_jsx__WEBPACK_IMPORTED_MODULE_4__["default"][id].requiredProjectId, hidden: _lib_libraries_decks_index_jsx__WEBPACK_IMPORTED_MODULE_4__["default"][id].hidden || false }; }); if (!this.props.visible) return null; return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_components_library_library_jsx__WEBPACK_IMPORTED_MODULE_8__["default"], { filterable: true, data: decksLibraryThumbnailData, id: "tipsLibrary", tags: _lib_libraries_tutorial_tags__WEBPACK_IMPORTED_MODULE_5__["default"], title: this.props.intl.formatMessage(messages.tipsLibraryTitle), visible: this.props.visible, onItemSelected: this.handleItemSelect, onRequestClose: this.props.onRequestClose }); } }]); return TipsLibrary; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.PureComponent); TipsLibrary.propTypes = { intl: react_intl__WEBPACK_IMPORTED_MODULE_3__["intlShape"].isRequired, onActivateDeck: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired, onRequestClose: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, projectId: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number]), visible: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool }; var mapStateToProps = function mapStateToProps(state) { return { visible: state.scratchGui.modals.tipsLibrary, projectId: state.scratchGui.projectState.projectId }; }; var mapDispatchToProps = function mapDispatchToProps(dispatch) { return { onActivateDeck: function onActivateDeck(id) { return dispatch(Object(_reducers_cards__WEBPACK_IMPORTED_MODULE_11__["activateDeck"])(id)); }, onRequestClose: function onRequestClose() { return dispatch(Object(_reducers_modals__WEBPACK_IMPORTED_MODULE_10__["closeTipsLibrary"])()); } }; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_3__["injectIntl"])(Object(react_redux__WEBPACK_IMPORTED_MODULE_9__["connect"])(mapStateToProps, mapDispatchToProps)(TipsLibrary))); /***/ }), /***/ "./src/containers/turbo-mode.jsx": /*!***************************************!*\ !*** ./src/containers/turbo-mode.jsx ***! \***************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } /** * Turbo Mode component passes toggleTurboMode function to its child. * It also includes `turboMode` in the props passed to the children. * It expects this child to be a function with the signature * function (toggleTurboMode, {turboMode, ...props}) {} * The component can then be used to attach turbo mode setting functionality * to any other component: * * {(toggleTurboMode, props) => ( * * )} */ var TurboMode = /*#__PURE__*/ function (_React$Component) { _inherits(TurboMode, _React$Component); function TurboMode(props) { var _this; _classCallCheck(this, TurboMode); _this = _possibleConstructorReturn(this, _getPrototypeOf(TurboMode).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['toggleTurboMode']); return _this; } _createClass(TurboMode, [{ key: "toggleTurboMode", value: function toggleTurboMode() { this.props.vm.setTurboMode(!this.props.turboMode); } }, { key: "render", value: function render() { var _this$props = this.props, children = _this$props.children, vm = _this$props.vm, props = _objectWithoutProperties(_this$props, ["children", "vm"]); return this.props.children(this.toggleTurboMode, props); } }]); return TurboMode; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.Component); TurboMode.propTypes = { children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, turboMode: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, vm: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.shape({ setTurboMode: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func }) }; var mapStateToProps = function mapStateToProps(state) { return { vm: state.scratchGui.vm, turboMode: state.scratchGui.vmStatus.turbo }; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_redux__WEBPACK_IMPORTED_MODULE_3__["connect"])(mapStateToProps, function () { return {}; } // omit dispatch prop )(TurboMode)); /***/ }), /***/ "./src/containers/watermark.jsx": /*!**************************************!*\ !*** ./src/containers/watermark.jsx ***! \**************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var lodash_omit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash.omit */ "./node_modules/lodash.omit/index.js"); /* harmony import */ var lodash_omit__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_omit__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _lib_throttled_property_hoc_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../lib/throttled-property-hoc.jsx */ "./src/lib/throttled-property-hoc.jsx"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! scratch-vm */ "./node_modules/scratch-vm/src/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(scratch_vm__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _lib_storage__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../lib/storage */ "./src/lib/storage.js"); /* harmony import */ var _lib_get_costume_url__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../lib/get-costume-url */ "./src/lib/get-costume-url.js"); /* harmony import */ var _components_watermark_watermark_jsx__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../components/watermark/watermark.jsx */ "./src/components/watermark/watermark.jsx"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var Watermark = /*#__PURE__*/ function (_React$Component) { _inherits(Watermark, _React$Component); function Watermark(props) { var _this; _classCallCheck(this, Watermark); _this = _possibleConstructorReturn(this, _getPrototypeOf(Watermark).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['getCostumeData']); return _this; } _createClass(Watermark, [{ key: "getCostumeData", value: function getCostumeData() { if (!this.props.asset) return null; return Object(_lib_get_costume_url__WEBPACK_IMPORTED_MODULE_8__["default"])(this.props.asset); } }, { key: "render", value: function render() { var componentProps = lodash_omit__WEBPACK_IMPORTED_MODULE_1___default()(this.props, ['asset', 'vm']); return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_components_watermark_watermark_jsx__WEBPACK_IMPORTED_MODULE_9__["default"], _extends({ costumeURL: this.getCostumeData() }, componentProps)); } }]); return Watermark; }(react__WEBPACK_IMPORTED_MODULE_3___default.a.Component); Watermark.propTypes = { asset: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.instanceOf(_lib_storage__WEBPACK_IMPORTED_MODULE_7__["default"].Asset), vm: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.instanceOf(scratch_vm__WEBPACK_IMPORTED_MODULE_6___default.a).isRequired }; var mapStateToProps = function mapStateToProps(state) { var targets = state.scratchGui.targets; var currentTargetId = targets.editingTarget; var asset; if (currentTargetId) { if (targets.stage.id === currentTargetId) { asset = targets.stage.costume.asset; } else if (targets.sprites.hasOwnProperty(currentTargetId)) { var currentSprite = targets.sprites[currentTargetId]; asset = currentSprite.costume.asset; } } return { vm: state.scratchGui.vm, asset: asset }; }; var ConnectedComponent = Object(react_redux__WEBPACK_IMPORTED_MODULE_4__["connect"])(mapStateToProps)(Object(_lib_throttled_property_hoc_jsx__WEBPACK_IMPORTED_MODULE_5__["default"])('asset', 500)(Watermark)); /* harmony default export */ __webpack_exports__["default"] = (ConnectedComponent); /***/ }), /***/ "./src/containers/webgl-modal.jsx": /*!****************************************!*\ !*** ./src/containers/webgl-modal.jsx ***! \****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _components_webgl_modal_webgl_modal_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/webgl-modal/webgl-modal.jsx */ "./src/components/webgl-modal/webgl-modal.jsx"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var WebGlModal = /*#__PURE__*/ function (_React$Component) { _inherits(WebGlModal, _React$Component); function WebGlModal() { _classCallCheck(this, WebGlModal); return _possibleConstructorReturn(this, _getPrototypeOf(WebGlModal).apply(this, arguments)); } _createClass(WebGlModal, [{ key: "handleCancel", value: function handleCancel() { window.history.back(); } }, { key: "render", value: function render() { return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_webgl_modal_webgl_modal_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], { isRtl: this.props.isRtl, onBack: this.handleCancel }); } }]); return WebGlModal; }(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component); WebGlModal.propTypes = { isRtl: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool }; /* harmony default export */ __webpack_exports__["default"] = (WebGlModal); /***/ }), /***/ "./src/lib/alerts/index.jsx": /*!**********************************!*\ !*** ./src/lib/alerts/index.jsx ***! \**********************************/ /*! exports provided: default, AlertLevels, AlertTypes */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return alerts; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AlertLevels", function() { return AlertLevels; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AlertTypes", function() { return AlertTypes; }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var keymirror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! keymirror */ "./node_modules/keymirror/index.js"); /* harmony import */ var keymirror__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(keymirror__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _assets_icon_success_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../assets/icon--success.svg */ "./src/lib/assets/icon--success.svg"); /* harmony import */ var _assets_icon_success_svg__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_assets_icon_success_svg__WEBPACK_IMPORTED_MODULE_3__); var AlertTypes = keymirror__WEBPACK_IMPORTED_MODULE_2___default()({ STANDARD: null, EXTENSION: null, INLINE: null }); var AlertLevels = { SUCCESS: 'success', INFO: 'info', WARN: 'warn' }; var alerts = [{ alertId: 'createSuccess', alertType: AlertTypes.STANDARD, clearList: ['createSuccess', 'creating', 'createCopySuccess', 'creatingCopy', 'createRemixSuccess', 'creatingRemix', 'saveSuccess', 'saving'], content: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "New project created.", id: "gui.alerts.createsuccess" }), iconURL: _assets_icon_success_svg__WEBPACK_IMPORTED_MODULE_3___default.a, level: AlertLevels.SUCCESS, maxDisplaySecs: 5 }, { alertId: 'createCopySuccess', alertType: AlertTypes.STANDARD, clearList: ['createSuccess', 'creating', 'createCopySuccess', 'creatingCopy', 'createRemixSuccess', 'creatingRemix', 'saveSuccess', 'saving'], content: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Project saved as a copy.", id: "gui.alerts.createcopysuccess" }), iconURL: _assets_icon_success_svg__WEBPACK_IMPORTED_MODULE_3___default.a, level: AlertLevels.SUCCESS, maxDisplaySecs: 5 }, { alertId: 'createRemixSuccess', alertType: AlertTypes.STANDARD, clearList: ['createSuccess', 'creating', 'createCopySuccess', 'creatingCopy', 'createRemixSuccess', 'creatingRemix', 'saveSuccess', 'saving'], content: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Project saved as a remix.", id: "gui.alerts.createremixsuccess" }), iconURL: _assets_icon_success_svg__WEBPACK_IMPORTED_MODULE_3___default.a, level: AlertLevels.SUCCESS, maxDisplaySecs: 5 }, { alertId: 'creating', alertType: AlertTypes.STANDARD, clearList: ['createSuccess', 'creating', 'createCopySuccess', 'creatingCopy', 'createRemixSuccess', 'creatingRemix', 'saveSuccess', 'saving'], content: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Creating new\u2026", id: "gui.alerts.creating" }), iconSpinner: true, level: AlertLevels.SUCCESS }, { alertId: 'creatingCopy', alertType: AlertTypes.STANDARD, clearList: ['createSuccess', 'creating', 'createCopySuccess', 'creatingCopy', 'createRemixSuccess', 'creatingRemix', 'saveSuccess', 'saving'], content: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Copying project\u2026", id: "gui.alerts.creatingCopy" }), iconSpinner: true, level: AlertLevels.SUCCESS }, { alertId: 'creatingRemix', alertType: AlertTypes.STANDARD, clearList: ['createSuccess', 'creating', 'createCopySuccess', 'creatingCopy', 'createRemixSuccess', 'creatingRemix', 'saveSuccess', 'saving'], content: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Remixing project\u2026", id: "gui.alerts.creatingRemix" }), iconSpinner: true, level: AlertLevels.SUCCESS }, { alertId: 'creatingError', clearList: ['createSuccess', 'creating', 'createCopySuccess', 'creatingCopy', 'createRemixSuccess', 'creatingRemix', 'saveSuccess', 'saving'], closeButton: true, content: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Could not create the project. Please try again!", id: "gui.alerts.creatingError" }), level: AlertLevels.WARN }, { alertId: 'savingError', clearList: ['createSuccess', 'creating', 'createCopySuccess', 'creatingCopy', 'createRemixSuccess', 'creatingRemix', 'saveSuccess', 'saving'], showDownload: true, showSaveNow: true, closeButton: false, content: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Project could not save.", id: "gui.alerts.savingError" }), level: AlertLevels.WARN }, { alertId: 'saveSuccess', alertType: AlertTypes.INLINE, clearList: ['saveSuccess', 'saving', 'savingError'], content: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Project saved.", id: "gui.alerts.savesuccess" }), iconURL: _assets_icon_success_svg__WEBPACK_IMPORTED_MODULE_3___default.a, level: AlertLevels.SUCCESS, maxDisplaySecs: 3 }, { alertId: 'saving', alertType: AlertTypes.INLINE, clearList: ['saveSuccess', 'saving', 'savingError'], content: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Saving project\u2026", id: "gui.alerts.saving" }), iconSpinner: true, level: AlertLevels.INFO }, { alertId: 'cloudInfo', alertType: AlertTypes.STANDARD, clearList: ['cloudInfo'], content: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Please note, cloud variables only support numbers, not letters or symbols. {learnMoreLink}" // eslint-disable-line max-len , id: "gui.alerts.cloudInfo", values: { learnMoreLink: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", { href: "https://scratch.mit.edu/info/faq/#clouddata", rel: "noopener noreferrer", target: "_blank" }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Learn more.", id: "gui.alerts.cloudInfoLearnMore" })) } }), closeButton: true, level: AlertLevels.SUCCESS, maxDisplaySecs: 15 }, { alertId: 'importingAsset', alertType: AlertTypes.STANDARD, clearList: [], content: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Importing\u2026", id: "gui.alerts.importing" }), iconSpinner: true, level: AlertLevels.SUCCESS }]; /***/ }), /***/ "./src/lib/analytics.js": /*!******************************!*\ !*** ./src/lib/analytics.js ***! \******************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react_ga__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-ga */ "./node_modules/react-ga/dist/react-ga.js"); /* harmony import */ var react_ga__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_ga__WEBPACK_IMPORTED_MODULE_0__); /*GoogleAnalytics.initialize(process.env.GA_ID || window.GA_ID, { debug: (process.env.NODE_ENV !== 'production'), titleCase: true, sampleRate: (process.env.NODE_ENV === 'production') ? 100 : 0, forceSSL: true });*/ /* harmony default export */ __webpack_exports__["default"] = (react_ga__WEBPACK_IMPORTED_MODULE_0___default.a); /***/ }), /***/ "./src/lib/app-state-hoc.jsx": /*!***********************************!*\ !*** ./src/lib/app-state-hoc.jsx ***! \***********************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var redux__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! redux */ "./node_modules/redux/es/index.js"); /* harmony import */ var _connected_intl_provider_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./connected-intl-provider.jsx */ "./src/lib/connected-intl-provider.jsx"); /* harmony import */ var _reducers_locales__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../reducers/locales */ "./src/reducers/locales.js"); /* harmony import */ var _reducers_mode_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../reducers/mode.js */ "./src/reducers/mode.js"); /* harmony import */ var scratch_l10n__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! scratch-l10n */ "./node_modules/scratch-l10n/src/index.js"); /* harmony import */ var _detect_locale__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./detect-locale */ "./src/lib/detect-locale.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || redux__WEBPACK_IMPORTED_MODULE_3__["compose"]; /* * Higher Order Component to provide redux state. If an `intl` prop is provided * it will override the internal `intl` redux state * @param {React.Component} WrappedComponent - component to provide state for * @param {boolean} localesOnly - only provide the locale state, not everything * required by the GUI. Used to exclude excess state when only rendering modals, not the GUI. * @returns {React.Component} component with redux and intl state provided */ var AppStateHOC = function AppStateHOC(WrappedComponent, localesOnly) { var AppStateWrapper = /*#__PURE__*/ function (_React$Component) { _inherits(AppStateWrapper, _React$Component); function AppStateWrapper(props) { var _this; _classCallCheck(this, AppStateWrapper); _this = _possibleConstructorReturn(this, _getPrototypeOf(AppStateWrapper).call(this, props)); var initialState = {}; var reducers = {}; var enhancer; var initializedLocales = _reducers_locales__WEBPACK_IMPORTED_MODULE_5__["localesInitialState"]; var locale = Object(_detect_locale__WEBPACK_IMPORTED_MODULE_8__["detectLocale"])(Object.keys(scratch_l10n__WEBPACK_IMPORTED_MODULE_7__["default"])); if (locale !== 'en') { initializedLocales = Object(_reducers_locales__WEBPACK_IMPORTED_MODULE_5__["initLocale"])(initializedLocales, locale); } if (localesOnly) { // Used for instantiating minimal state for the unsupported // browser modal reducers = { locales: _reducers_locales__WEBPACK_IMPORTED_MODULE_5__["default"] }; initialState = { locales: initializedLocales }; enhancer = composeEnhancers(); } else { // You are right, this is gross. But it's necessary to avoid // importing unneeded code that will crash unsupported browsers. var guiRedux = __webpack_require__(/*! ../reducers/gui */ "./src/reducers/gui.js"); var guiReducer = guiRedux.default; var guiInitialState = guiRedux.guiInitialState, guiMiddleware = guiRedux.guiMiddleware, initFullScreen = guiRedux.initFullScreen, initPlayer = guiRedux.initPlayer, initTelemetryModal = guiRedux.initTelemetryModal; var _require = __webpack_require__(/*! scratch-paint */ "./node_modules/scratch-paint/src/index.js"), ScratchPaintReducer = _require.ScratchPaintReducer; var initializedGui = guiInitialState; if (props.isFullScreen || props.isPlayerOnly) { if (props.isFullScreen) { initializedGui = initFullScreen(initializedGui); } if (props.isPlayerOnly) { initializedGui = initPlayer(initializedGui); } } else if (props.showTelemetryModal) { initializedGui = initTelemetryModal(initializedGui); } reducers = { locales: _reducers_locales__WEBPACK_IMPORTED_MODULE_5__["default"], scratchGui: guiReducer, scratchPaint: ScratchPaintReducer }; initialState = { locales: initializedLocales, scratchGui: initializedGui }; enhancer = composeEnhancers(guiMiddleware); } var reducer = Object(redux__WEBPACK_IMPORTED_MODULE_3__["combineReducers"])(reducers); _this.store = Object(redux__WEBPACK_IMPORTED_MODULE_3__["createStore"])(reducer, initialState, enhancer); return _this; } _createClass(AppStateWrapper, [{ key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (localesOnly) return; if (prevProps.isPlayerOnly !== this.props.isPlayerOnly) { this.store.dispatch(Object(_reducers_mode_js__WEBPACK_IMPORTED_MODULE_6__["setPlayer"])(this.props.isPlayerOnly)); } if (prevProps.isFullScreen !== this.props.isFullScreen) { this.store.dispatch(Object(_reducers_mode_js__WEBPACK_IMPORTED_MODULE_6__["setFullScreen"])(this.props.isFullScreen)); } } }, { key: "render", value: function render() { var _this$props = this.props, isFullScreen = _this$props.isFullScreen, isPlayerOnly = _this$props.isPlayerOnly, showTelemetryModal = _this$props.showTelemetryModal, componentProps = _objectWithoutProperties(_this$props, ["isFullScreen", "isPlayerOnly", "showTelemetryModal"]); return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_redux__WEBPACK_IMPORTED_MODULE_2__["Provider"], { store: this.store }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_connected_intl_provider_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(WrappedComponent, componentProps))); } }]); return AppStateWrapper; }(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component); AppStateWrapper.propTypes = { isFullScreen: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, isPlayerOnly: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, showTelemetryModal: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool }; return AppStateWrapper; }; /* harmony default export */ __webpack_exports__["default"] = (AppStateHOC); /***/ }), /***/ "./src/lib/assets/icon--back.svg": /*!***************************************!*\ !*** ./src/lib/assets/icon--back.svg ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/aaa4a3575852fe11d04f44c4a972ae73.svg"; /***/ }), /***/ "./src/lib/assets/icon--help.svg": /*!***************************************!*\ !*** ./src/lib/assets/icon--help.svg ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/4b6100c9f591be6470cdfd4697de0b54.svg"; /***/ }), /***/ "./src/lib/assets/icon--success.svg": /*!******************************************!*\ !*** ./src/lib/assets/icon--success.svg ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/bc45b073cd2fc0c2265374bdb4e05d67.svg"; /***/ }), /***/ "./src/lib/assets/icon--tutorials.svg": /*!********************************************!*\ !*** ./src/lib/assets/icon--tutorials.svg ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/b433ee02a13fa2a12f7f7059f1f6729a.svg"; /***/ }), /***/ "./src/lib/audio/audio-buffer-player.js": /*!**********************************************!*\ !*** ./src/lib/audio/audio-buffer-player.js ***! \**********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _shared_audio_context_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./shared-audio-context.js */ "./src/lib/audio/shared-audio-context.js"); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } var AudioBufferPlayer = /*#__PURE__*/ function () { function AudioBufferPlayer(samples, sampleRate) { _classCallCheck(this, AudioBufferPlayer); this.audioContext = new _shared_audio_context_js__WEBPACK_IMPORTED_MODULE_0__["default"](); this.buffer = this.audioContext.createBuffer(1, samples.length, sampleRate); this.buffer.getChannelData(0).set(samples); this.source = null; this.startTime = null; this.updateCallback = null; this.trimStart = null; this.trimEnd = null; } _createClass(AudioBufferPlayer, [{ key: "play", value: function play(trimStart, trimEnd, onUpdate, onEnded) { this.updateCallback = onUpdate; this.trimStart = trimStart; this.trimEnd = trimEnd; this.startTime = Date.now(); var trimStartTime = this.buffer.duration * trimStart; var trimmedDuration = this.buffer.duration * trimEnd - trimStartTime; this.source = this.audioContext.createBufferSource(); this.source.onended = onEnded; this.source.buffer = this.buffer; this.source.connect(this.audioContext.destination); this.source.start(0, trimStartTime, trimmedDuration); this.update(); } }, { key: "update", value: function update() { var timeSinceStart = (Date.now() - this.startTime) / 1000; var percentage = timeSinceStart / this.buffer.duration; if (percentage + this.trimStart < this.trimEnd && this.source.onended) { requestAnimationFrame(this.update.bind(this)); this.updateCallback(percentage + this.trimStart); } else { this.updateCallback = null; } } }, { key: "stop", value: function stop() { if (this.source) { this.source.onended = null; // Do not call onEnded callback if manually stopped try { this.source.stop(); } catch (e) { // This is probably Safari, which dies when you call stop more than once // which the spec says is allowed: https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode console.log('Caught error while stopping buffer source node.'); // eslint-disable-line no-console } } } }]); return AudioBufferPlayer; }(); /* harmony default export */ __webpack_exports__["default"] = (AudioBufferPlayer); /***/ }), /***/ "./src/lib/audio/audio-effects.js": /*!****************************************!*\ !*** ./src/lib/audio/audio-effects.js ***! \****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _effects_echo_effect_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./effects/echo-effect.js */ "./src/lib/audio/effects/echo-effect.js"); /* harmony import */ var _effects_robot_effect_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./effects/robot-effect.js */ "./src/lib/audio/effects/robot-effect.js"); /* harmony import */ var _effects_volume_effect_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./effects/volume-effect.js */ "./src/lib/audio/effects/volume-effect.js"); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } var effectTypes = { ROBOT: 'robot', REVERSE: 'reverse', LOUDER: 'higher', SOFTER: 'lower', FASTER: 'faster', SLOWER: 'slower', ECHO: 'echo' }; var AudioEffects = /*#__PURE__*/ function () { _createClass(AudioEffects, null, [{ key: "effectTypes", get: function get() { return effectTypes; } }]); function AudioEffects(buffer, name) { _classCallCheck(this, AudioEffects); // Some effects will modify the playback rate and/or number of samples. // Need to precompute those values to create the offline audio context. var pitchRatio = Math.pow(2, 4 / 12); // A major third var sampleCount = buffer.length; var playbackRate = 1; switch (name) { case effectTypes.ECHO: sampleCount = buffer.length + 0.25 * 3 * buffer.sampleRate; break; case effectTypes.FASTER: playbackRate = pitchRatio; sampleCount = Math.floor(buffer.length / playbackRate); break; case effectTypes.SLOWER: playbackRate = 1 / pitchRatio; sampleCount = Math.floor(buffer.length / playbackRate); break; } if (window.OfflineAudioContext) { this.audioContext = new window.OfflineAudioContext(1, sampleCount, buffer.sampleRate); } else { // Need to use webkitOfflineAudioContext, which doesn't support all sample rates. // Resample by adjusting sample count to make room and set offline context to desired sample rate. var sampleScale = 44100 / buffer.sampleRate; this.audioContext = new window.webkitOfflineAudioContext(1, sampleScale * sampleCount, 44100); } // For the reverse effect we need to manually reverse the data into a new audio buffer // to prevent overwriting the original, so that the undo stack works correctly. // Doing buffer.reverse() would mutate the original data. if (name === effectTypes.REVERSE) { var originalBufferData = buffer.getChannelData(0); var newBuffer = this.audioContext.createBuffer(1, buffer.length, buffer.sampleRate); var newBufferData = newBuffer.getChannelData(0); var bufferLength = buffer.length; for (var i = 0; i < bufferLength; i++) { newBufferData[i] = originalBufferData[bufferLength - i - 1]; } this.buffer = newBuffer; } else { // All other effects use the original buffer because it is not modified. this.buffer = buffer; } this.source = this.audioContext.createBufferSource(); this.source.buffer = this.buffer; this.source.playbackRate.value = playbackRate; this.name = name; } _createClass(AudioEffects, [{ key: "process", value: function process(done) { // Some effects need to use more nodes and must expose an input and output var input; var output; switch (this.name) { case effectTypes.LOUDER: var _ref = new _effects_volume_effect_js__WEBPACK_IMPORTED_MODULE_2__["default"](this.audioContext, 1.25); input = _ref.input; output = _ref.output; break; case effectTypes.SOFTER: var _ref2 = new _effects_volume_effect_js__WEBPACK_IMPORTED_MODULE_2__["default"](this.audioContext, 0.75); input = _ref2.input; output = _ref2.output; break; case effectTypes.ECHO: var _ref3 = new _effects_echo_effect_js__WEBPACK_IMPORTED_MODULE_0__["default"](this.audioContext, 0.25); input = _ref3.input; output = _ref3.output; break; case effectTypes.ROBOT: var _ref4 = new _effects_robot_effect_js__WEBPACK_IMPORTED_MODULE_1__["default"](this.audioContext, 0.25); input = _ref4.input; output = _ref4.output; break; } if (input && output) { this.source.connect(input); output.connect(this.audioContext.destination); } else { // No effects nodes are needed, wire directly to the output this.source.connect(this.audioContext.destination); } this.source.start(); this.audioContext.startRendering(); this.audioContext.oncomplete = done; } }]); return AudioEffects; }(); /* harmony default export */ __webpack_exports__["default"] = (AudioEffects); /***/ }), /***/ "./src/lib/audio/audio-recorder.js": /*!*****************************************!*\ !*** ./src/lib/audio/audio-recorder.js ***! \*****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var get_float_time_domain_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! get-float-time-domain-data */ "./node_modules/get-float-time-domain-data/lib/get-float-time-domain-data.js"); /* harmony import */ var get_float_time_domain_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(get_float_time_domain_data__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var get_user_media_promise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! get-user-media-promise */ "./node_modules/get-user-media-promise/lib/get-user-media-promise.js"); /* harmony import */ var get_user_media_promise__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(get_user_media_promise__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _shared_audio_context_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./shared-audio-context.js */ "./src/lib/audio/shared-audio-context.js"); /* harmony import */ var _audio_util_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./audio-util.js */ "./src/lib/audio/audio-util.js"); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } var AudioRecorder = /*#__PURE__*/ function () { function AudioRecorder() { _classCallCheck(this, AudioRecorder); this.audioContext = new _shared_audio_context_js__WEBPACK_IMPORTED_MODULE_2__["default"](); this.bufferLength = 1024; this.userMediaStream = null; this.mediaStreamSource = null; this.sourceNode = null; this.scriptProcessorNode = null; this.recordedSamples = 0; this.recording = false; this.started = false; this.buffers = []; this.disposed = false; } _createClass(AudioRecorder, [{ key: "startListening", value: function startListening(onStarted, onUpdate, onError) { var _this = this; try { get_user_media_promise__WEBPACK_IMPORTED_MODULE_1___default()({ audio: true }).then(function (userMediaStream) { if (!_this.disposed) { _this.started = true; onStarted(); _this.attachUserMediaStream(userMediaStream, onUpdate); } }).catch(function (e) { if (!_this.disposed) { onError(e); } }); } catch (e) { if (!this.disposed) { onError(e); } } } }, { key: "startRecording", value: function startRecording() { this.recording = true; } }, { key: "attachUserMediaStream", value: function attachUserMediaStream(userMediaStream, onUpdate) { var _this2 = this; this.userMediaStream = userMediaStream; this.mediaStreamSource = this.audioContext.createMediaStreamSource(userMediaStream); this.sourceNode = this.audioContext.createGain(); this.scriptProcessorNode = this.audioContext.createScriptProcessor(this.bufferLength, 2, 2); this.scriptProcessorNode.onaudioprocess = function (processEvent) { if (_this2.recording && !_this2.disposed) { _this2.buffers.push(new Float32Array(processEvent.inputBuffer.getChannelData(0))); } }; this.analyserNode = this.audioContext.createAnalyser(); this.analyserNode.fftSize = 2048; var bufferLength = this.analyserNode.frequencyBinCount; var dataArray = new Float32Array(bufferLength); var update = function update() { if (_this2.disposed) return; requestAnimationFrame(update); _this2.analyserNode.getFloatTimeDomainData(dataArray); onUpdate(Object(_audio_util_js__WEBPACK_IMPORTED_MODULE_3__["computeRMS"])(dataArray)); }; requestAnimationFrame(update); // Wire everything together, ending in the destination this.mediaStreamSource.connect(this.sourceNode); this.sourceNode.connect(this.analyserNode); this.analyserNode.connect(this.scriptProcessorNode); this.scriptProcessorNode.connect(this.audioContext.destination); } }, { key: "stop", value: function stop() { var chunkLevels = this.buffers.map(function (buffer) { return Object(_audio_util_js__WEBPACK_IMPORTED_MODULE_3__["computeRMS"])(buffer); }); var maxRMS = Math.max.apply(null, chunkLevels); var threshold = maxRMS / 8; var firstChunkAboveThreshold = null; var lastChunkAboveThreshold = null; for (var i = 0; i < chunkLevels.length; i++) { if (chunkLevels[i] > threshold) { if (firstChunkAboveThreshold === null) firstChunkAboveThreshold = i + 1; lastChunkAboveThreshold = i + 1; } } var trimStart = Math.max(2, firstChunkAboveThreshold - 2) / this.buffers.length; var trimEnd = Math.min(this.buffers.length - 2, lastChunkAboveThreshold + 2) / this.buffers.length; // With very few samples, the automatic trimming can produce invalid values if (trimStart >= trimEnd) { trimStart = 0; trimEnd = 1; } var buffer = new Float32Array(this.buffers.length * this.bufferLength); var offset = 0; for (var _i = 0; _i < this.buffers.length; _i++) { var bufferChunk = this.buffers[_i]; buffer.set(bufferChunk, offset); offset += bufferChunk.length; } return { levels: chunkLevels, samples: buffer, sampleRate: this.audioContext.sampleRate, trimStart: trimStart, trimEnd: trimEnd }; } }, { key: "dispose", value: function dispose() { if (this.started) { this.scriptProcessorNode.onaudioprocess = null; this.scriptProcessorNode.disconnect(); this.analyserNode.disconnect(); this.sourceNode.disconnect(); this.mediaStreamSource.disconnect(); this.userMediaStream.getAudioTracks()[0].stop(); } this.disposed = true; } }]); return AudioRecorder; }(); /* harmony default export */ __webpack_exports__["default"] = (AudioRecorder); /***/ }), /***/ "./src/lib/audio/audio-util.js": /*!*************************************!*\ !*** ./src/lib/audio/audio-util.js ***! \*************************************/ /*! exports provided: computeRMS, computeChunkedRMS, SOUND_BYTE_LIMIT */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "computeRMS", function() { return computeRMS; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "computeChunkedRMS", function() { return computeChunkedRMS; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SOUND_BYTE_LIMIT", function() { return SOUND_BYTE_LIMIT; }); var SOUND_BYTE_LIMIT = 10 * 1000 * 1000; // 10mb var computeRMS = function computeRMS(samples) { var scaling = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.55; if (samples.length === 0) return 0; // Calculate RMS, adapted from https://github.com/Tonejs/Tone.js/blob/master/Tone/component/Meter.js#L88 var sum = 0; for (var i = 0; i < samples.length; i++) { var sample = samples[i]; sum += Math.pow(sample, 2); } var rms = Math.sqrt(sum / samples.length); var val = rms / scaling; return Math.sqrt(val); }; var computeChunkedRMS = function computeChunkedRMS(samples) { var chunkSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1024; var sampleCount = samples.length; var chunkLevels = []; for (var i = 0; i < sampleCount; i += chunkSize) { var maxIndex = Math.min(sampleCount, i + chunkSize); chunkLevels.push(computeRMS(samples.slice(i, maxIndex))); } return chunkLevels; }; /***/ }), /***/ "./src/lib/audio/effects/echo-effect.js": /*!**********************************************!*\ !*** ./src/lib/audio/effects/echo-effect.js ***! \**********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var EchoEffect = function EchoEffect(audioContext, delayTime) { _classCallCheck(this, EchoEffect); this.audioContext = audioContext; this.delayTime = delayTime; this.input = this.audioContext.createGain(); this.output = this.audioContext.createGain(); this.effectInput = this.audioContext.createGain(); this.effectInput.gain.value = 0.75; this.delay = this.audioContext.createDelay(1); this.delay.delayTime.value = delayTime; this.decay = this.audioContext.createGain(); this.decay.gain.value = 0.3; this.compressor = this.audioContext.createDynamicsCompressor(); this.compressor.threshold.value = -5; this.compressor.knee.value = 15; this.compressor.ratio.value = 12; this.compressor.attack.value = 0; this.compressor.release.value = 0.25; this.input.connect(this.effectInput); this.effectInput.connect(this.delay); this.delay.connect(this.compressor); this.input.connect(this.compressor); this.delay.connect(this.decay); this.decay.connect(this.delay); this.compressor.connect(this.output); }; /* harmony default export */ __webpack_exports__["default"] = (EchoEffect); /***/ }), /***/ "./src/lib/audio/effects/robot-effect.js": /*!***********************************************!*\ !*** ./src/lib/audio/effects/robot-effect.js ***! \***********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var RobotEffect = function RobotEffect(audioContext) { var _this = this; _classCallCheck(this, RobotEffect); this.audioContext = audioContext; this.input = this.audioContext.createGain(); this.output = this.audioContext.createGain(); // Ring modulator inspired by BBC Dalek voice // http://recherche.ircam.fr/pub/dafx11/Papers/66_e.pdf // https://github.com/bbc/webaudio.prototyping.bbc.co.uk // > There are four parallel signal paths, two which process the // > combination Vc + Vin / 2 and two which process Vc - Vin/2. // > Each branch consists of a non-linearity [diode]... var createDiodeNode = function createDiodeNode() { var node = _this.audioContext.createWaveShaper(); // Piecewise function given by (2) in Parker paper var transform = function transform(v) { var vb = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.2; var vl = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.4; var h = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0.65; if (v <= vb) return 0; if (v <= vl) return h * (Math.pow(v - vb, 2) / (2 * vl - 2 * vb)); return h * v - h * vl + h * (Math.pow(v - vb, 2) / (2 * vl - 2 * vb)); }; // Create the waveshaper curve with the voltage transform above var bufferLength = 1024; var curve = new Float32Array(bufferLength); for (var i = 0; i < bufferLength; i++) { var voltage = 2 * (i / bufferLength) - 1; curve[i] = transform(voltage); } node.curve = curve; return node; }; var oscillator = this.audioContext.createOscillator(); oscillator.frequency.value = 50; oscillator.start(0); var vInGain = this.audioContext.createGain(); vInGain.gain.value = 0.5; var vInInverter1 = this.audioContext.createGain(); vInInverter1.gain.value = -1; var vInInverter2 = this.audioContext.createGain(); vInInverter2.gain.value = -1; var vInDiode1 = createDiodeNode(this.audioContext); var vInDiode2 = createDiodeNode(this.audioContext); var vInInverter3 = this.audioContext.createGain(); vInInverter3.gain.value = -1; var vcInverter1 = this.audioContext.createGain(); vcInverter1.gain.value = -1; var vcDiode3 = createDiodeNode(this.audioContext); var vcDiode4 = createDiodeNode(this.audioContext); var compressor = this.audioContext.createDynamicsCompressor(); compressor.threshold.value = -5; compressor.knee.value = 15; compressor.ratio.value = 12; compressor.attack.value = 0; compressor.release.value = 0.25; var biquadFilter = this.audioContext.createBiquadFilter(); biquadFilter.type = 'highpass'; biquadFilter.frequency.value = 1000; biquadFilter.gain.value = 1.25; this.input.connect(vcInverter1); this.input.connect(vcDiode4); vcInverter1.connect(vcDiode3); oscillator.connect(vInGain); vInGain.connect(vInInverter1); vInGain.connect(vcInverter1); vInGain.connect(vcDiode4); vInInverter1.connect(vInInverter2); vInInverter1.connect(vInDiode2); vInInverter2.connect(vInDiode1); vInDiode1.connect(vInInverter3); vInDiode2.connect(vInInverter3); vInInverter3.connect(compressor); vcDiode3.connect(compressor); vcDiode4.connect(compressor); this.input.connect(biquadFilter); biquadFilter.connect(compressor); compressor.connect(this.output); }; /* harmony default export */ __webpack_exports__["default"] = (RobotEffect); /***/ }), /***/ "./src/lib/audio/effects/volume-effect.js": /*!************************************************!*\ !*** ./src/lib/audio/effects/volume-effect.js ***! \************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var VolumeEffect = function VolumeEffect(audioContext, volume) { _classCallCheck(this, VolumeEffect); this.audioContext = audioContext; this.input = this.audioContext.createGain(); this.output = this.audioContext.createGain(); this.gain = this.audioContext.createGain(); this.gain.gain.value = volume; this.input.connect(this.gain); this.gain.connect(this.output); }; /* harmony default export */ __webpack_exports__["default"] = (VolumeEffect); /***/ }), /***/ "./src/lib/audio/shared-audio-context.js": /*!***********************************************!*\ !*** ./src/lib/audio/shared-audio-context.js ***! \***********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var startaudiocontext__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! startaudiocontext */ "./node_modules/startaudiocontext/StartAudioContext.js"); /* harmony import */ var startaudiocontext__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(startaudiocontext__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var bowser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! bowser */ "./node_modules/bowser/src/bowser.js"); /* harmony import */ var bowser__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(bowser__WEBPACK_IMPORTED_MODULE_1__); var AUDIO_CONTEXT; if (!bowser__WEBPACK_IMPORTED_MODULE_1___default.a.msie) { AUDIO_CONTEXT = new (window.AudioContext || window.webkitAudioContext)(); startaudiocontext__WEBPACK_IMPORTED_MODULE_0___default()(AUDIO_CONTEXT); } /** * Wrap browser AudioContext because we shouldn't create more than one * @return {AudioContext} The singleton AudioContext */ /* harmony default export */ __webpack_exports__["default"] = (function () { return AUDIO_CONTEXT; }); /***/ }), /***/ "./src/lib/backpack-api.js": /*!*********************************!*\ !*** ./src/lib/backpack-api.js ***! \*********************************/ /*! exports provided: getBackpackContents, saveBackpackObject, deleteBackpackObject, costumePayload, soundPayload, spritePayload, codePayload, fetchCode, fetchSprite */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBackpackContents", function() { return getBackpackContents; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "saveBackpackObject", function() { return saveBackpackObject; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "deleteBackpackObject", function() { return deleteBackpackObject; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fetchCode", function() { return fetchCode; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fetchSprite", function() { return fetchSprite; }); /* harmony import */ var xhr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! xhr */ "./node_modules/xhr/index.js"); /* harmony import */ var xhr__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(xhr__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _backpack_costume_payload__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./backpack/costume-payload */ "./src/lib/backpack/costume-payload.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "costumePayload", function() { return _backpack_costume_payload__WEBPACK_IMPORTED_MODULE_1__["default"]; }); /* harmony import */ var _backpack_sound_payload__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./backpack/sound-payload */ "./src/lib/backpack/sound-payload.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "soundPayload", function() { return _backpack_sound_payload__WEBPACK_IMPORTED_MODULE_2__["default"]; }); /* harmony import */ var _backpack_sprite_payload__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./backpack/sprite-payload */ "./src/lib/backpack/sprite-payload.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "spritePayload", function() { return _backpack_sprite_payload__WEBPACK_IMPORTED_MODULE_3__["default"]; }); /* harmony import */ var _backpack_code_payload__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./backpack/code-payload */ "./src/lib/backpack/code-payload.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "codePayload", function() { return _backpack_code_payload__WEBPACK_IMPORTED_MODULE_4__["default"]; }); // Add a new property for the full thumbnail url, which includes the host. // Also include a full body url for loading sprite zips // TODO retreiving the images through storage would allow us to remove this. var includeFullUrls = function includeFullUrls(item, host) { return Object.assign({}, item, { thumbnailUrl: "".concat(host, "/").concat(item.thumbnail), bodyUrl: "".concat(host, "/").concat(item.body) }); }; var getBackpackContents = function getBackpackContents(_ref) { var host = _ref.host, username = _ref.username, token = _ref.token, limit = _ref.limit, offset = _ref.offset; return new Promise(function (resolve, reject) { xhr__WEBPACK_IMPORTED_MODULE_0___default()({ method: 'GET', uri: "".concat(host, "/").concat(username, "?limit=").concat(limit, "&offset=").concat(offset), headers: { 'x-token': token }, json: true }, function (error, response) { if (error || response.statusCode !== 200) { return reject(); } return resolve(response.body.map(function (item) { return includeFullUrls(item, host); })); }); }); }; var saveBackpackObject = function saveBackpackObject(_ref2) { var host = _ref2.host, username = _ref2.username, token = _ref2.token, type = _ref2.type, mime = _ref2.mime, name = _ref2.name, body = _ref2.body, thumbnail = _ref2.thumbnail; return new Promise(function (resolve, reject) { xhr__WEBPACK_IMPORTED_MODULE_0___default()({ method: 'POST', uri: "".concat(host, "/").concat(username), headers: { 'x-token': token }, json: { type: type, mime: mime, name: name, body: body, thumbnail: thumbnail } }, function (error, response) { if (error || response.statusCode !== 200) { return reject(); } return resolve(includeFullUrls(response.body, host)); }); }); }; var deleteBackpackObject = function deleteBackpackObject(_ref3) { var host = _ref3.host, username = _ref3.username, token = _ref3.token, id = _ref3.id; return new Promise(function (resolve, reject) { xhr__WEBPACK_IMPORTED_MODULE_0___default()({ method: 'DELETE', uri: "".concat(host, "/").concat(username, "/").concat(id), headers: { 'x-token': token } }, function (error, response) { if (error || response.statusCode !== 200) { return reject(); } return resolve(response.body); }); }); }; // Two types of backpack items are not retreivable through storage // code, as json and sprite3 as arraybuffer zips. var fetchAs = function fetchAs(responseType, uri) { return new Promise(function (resolve, reject) { xhr__WEBPACK_IMPORTED_MODULE_0___default()({ uri: uri, responseType: responseType }, function (error, response) { if (error || response.statusCode !== 200) { return reject(); } return resolve(response.body); }); }); }; // These two helpers allow easy fetching of backpack code and sprite zips // Use the curried fetchAs here so the consumer does not worry about XHR responseTypes var fetchCode = fetchAs.bind(null, 'json'); var fetchSprite = fetchAs.bind(null, 'arraybuffer'); /***/ }), /***/ "./src/lib/backpack/block-to-image.js": /*!********************************************!*\ !*** ./src/lib/backpack/block-to-image.js ***! \********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var computed_style_to_inline_style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! computed-style-to-inline-style */ "./node_modules/computed-style-to-inline-style/dist/index.js"); /* harmony import */ var computed_style_to_inline_style__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(computed_style_to_inline_style__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var scratch_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! scratch-blocks */ "./node_modules/scratch-blocks/shim/vertical.js"); /* harmony import */ var scratch_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(scratch_blocks__WEBPACK_IMPORTED_MODULE_1__); /** * Given a blockId, return a data-uri image that can be used to create a thumbnail. * @param {string} blockId the ID of the block to imagify * @return {Promise} resolves to a data-url of a picture of the blocks */ /* harmony default export */ __webpack_exports__["default"] = (function (blockId) { // Not sure any better way to access the scratch-blocks workspace than this... var block = scratch_blocks__WEBPACK_IMPORTED_MODULE_1___default.a.getMainWorkspace().getBlockById(blockId); var blockSvg = block.getSvgRoot().cloneNode(true /* deep */ ); // Once we have the cloned SVG, do the rest in a setTimeout to prevent // blocking the drag end from finishing promptly. return new Promise(function (resolve) { setTimeout(function () { // Strip   entities that cannot be inlined blockSvg.innerHTML = blockSvg.innerHTML.replace(/ /g, ' '); // Create an element to put the cloned blockSvg inside var NS = 'http://www.w3.org/2000/svg'; var svg = document.createElementNS(NS, 'svg'); svg.appendChild(blockSvg); // Needs to be on the DOM to get CSS properties and correct sizing document.body.appendChild(svg); var padding = 10; var extraHatPadding = 16; var topPadding = padding + (blockSvg.getAttribute('data-shapes') === 'hat' ? extraHatPadding : 0); var leftPadding = padding; blockSvg.setAttribute('transform', "translate(".concat(leftPadding, " ").concat(topPadding, ")")); var bounds = blockSvg.getBoundingClientRect(); svg.setAttribute('width', bounds.width + 2 * padding); svg.setAttribute('height', bounds.height + 2 * padding); // We need to inline the styles set by CSS rules because // not all the styles are set directly on the SVG. This makes the // image styled the same way the block actually appears. // TODO this doesn't handle images that are xlink:href in the SVG computed_style_to_inline_style__WEBPACK_IMPORTED_MODULE_0___default()(svg, { recursive: true, // Enumerate the specific properties we need to inline. // Specifically properties that are set from CSS in scratch-blocks properties: ['fill', 'font-family', 'font-size', 'font-weight'] }); var svgString = new XMLSerializer().serializeToString(svg); // Once we have the svg as a string, remove it from the DOM svg.parentNode.removeChild(svg); resolve("data:image/svg+xml;utf-8,".concat(encodeURIComponent(svgString))); }, 10); }); }); /***/ }), /***/ "./src/lib/backpack/code-payload.js": /*!******************************************!*\ !*** ./src/lib/backpack/code-payload.js ***! \******************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _block_to_image__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./block-to-image */ "./src/lib/backpack/block-to-image.js"); /* harmony import */ var _jpeg_thumbnail__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./jpeg-thumbnail */ "./src/lib/backpack/jpeg-thumbnail.js"); /* harmony import */ var js_base64__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! js-base64 */ "./node_modules/js-base64/base64.js"); /* harmony import */ var js_base64__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(js_base64__WEBPACK_IMPORTED_MODULE_2__); var codePayload = function codePayload(_ref) { var blockObjects = _ref.blockObjects, topBlockId = _ref.topBlockId; var payload = { type: 'script', // Needs to match backpack-server type name name: 'code', // All code currently gets the same name mime: 'application/json', // Backpack expects a base64 encoded string to store. Cannot use btoa because // the code can contain characters outside the 0-255 code-point range supported by btoa body: js_base64__WEBPACK_IMPORTED_MODULE_2__["Base64"].encode(JSON.stringify(blockObjects)) // Base64 encode the json }; return Object(_block_to_image__WEBPACK_IMPORTED_MODULE_0__["default"])(topBlockId).then(_jpeg_thumbnail__WEBPACK_IMPORTED_MODULE_1__["default"]).then(function (thumbnail) { payload.thumbnail = thumbnail.replace('data:image/jpeg;base64,', ''); return payload; }); }; /* harmony default export */ __webpack_exports__["default"] = (codePayload); /***/ }), /***/ "./src/lib/backpack/costume-payload.js": /*!*********************************************!*\ !*** ./src/lib/backpack/costume-payload.js ***! \*********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _jpeg_thumbnail__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./jpeg-thumbnail */ "./src/lib/backpack/jpeg-thumbnail.js"); /* harmony import */ var _get_costume_url__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../get-costume-url */ "./src/lib/get-costume-url.js"); var costumePayload = function costumePayload(costume) { // TODO is it ok to base64 encode SVGs? What about unicode text inside them? var assetDataUrl = costume.asset.encodeDataURI(); var assetDataFormat = costume.dataFormat; var payload = { type: 'costume', name: costume.name, // Params to be filled in below mime: '', body: '', thumbnail: '' }; switch (assetDataFormat) { case 'svg': payload.mime = 'image/svg+xml'; payload.body = assetDataUrl.replace('data:image/svg+xml;base64,', ''); break; case 'png': payload.mime = 'image/png'; payload.body = assetDataUrl.replace('data:image/png;base64,', ''); break; default: alert("Cannot serialize for format: ".concat(assetDataFormat)); // eslint-disable-line } // Do not generate the thumbnail from the raw asset. Instead use the getCostumeUrl // utility which inlines the fonts to make the thumbnail show the right fonts. var inlinedFontDataUrl = Object(_get_costume_url__WEBPACK_IMPORTED_MODULE_1__["default"])(costume.asset); return Object(_jpeg_thumbnail__WEBPACK_IMPORTED_MODULE_0__["default"])(inlinedFontDataUrl).then(function (thumbnail) { payload.thumbnail = thumbnail.replace('data:image/jpeg;base64,', ''); return payload; }); }; /* harmony default export */ __webpack_exports__["default"] = (costumePayload); /***/ }), /***/ "./src/lib/backpack/jpeg-thumbnail.js": /*!********************************************!*\ !*** ./src/lib/backpack/jpeg-thumbnail.js ***! \********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); var jpegThumbnail = function jpegThumbnail(dataUrl) { return new Promise(function (resolve, reject) { var image = new Image(); image.onload = function () { var canvas = document.createElement('canvas'); var ctx = canvas.getContext('2d'); // TODO we may want to draw to a smaller, fixed size to optimize file size canvas.width = image.width; canvas.height = image.height; ctx.fillStyle = 'white'; // Create white background, since jpeg doesn't have transparency ctx.fillRect(0, 0, canvas.width, canvas.height); ctx.drawImage(image, 0, 0); // TODO we can play with the `quality` option here to optimize file size resolve(canvas.toDataURL('image/jpeg', 0.92 /* quality */ )); // Default quality is 0.92 }; image.onerror = function (err) { reject(err); }; image.src = dataUrl; }); }; /* harmony default export */ __webpack_exports__["default"] = (jpegThumbnail); /***/ }), /***/ "./src/lib/backpack/sound-payload.js": /*!*******************************************!*\ !*** ./src/lib/backpack/sound-payload.js ***! \*******************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _base64_loader_sound_thumbnail_jpg__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! base64-loader!./sound-thumbnail.jpg */ "./node_modules/base64-loader/index.js!./src/lib/backpack/sound-thumbnail.jpg"); /* harmony import */ var _base64_loader_sound_thumbnail_jpg__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_base64_loader_sound_thumbnail_jpg__WEBPACK_IMPORTED_MODULE_0__); // eslint-disable-next-line import/no-unresolved var soundPayload = function soundPayload(sound) { var assetDataUrl = sound.asset.encodeDataURI(); var assetDataFormat = sound.dataFormat; var payload = { type: 'sound', name: sound.name, thumbnail: _base64_loader_sound_thumbnail_jpg__WEBPACK_IMPORTED_MODULE_0___default.a, // Params to be filled in below mime: '', body: '' }; switch (assetDataFormat) { case 'wav': payload.mime = 'audio/x-wav'; payload.body = assetDataUrl.replace('data:audio/x-wav;base64,', ''); break; case 'mp3': payload.mime = 'audio/mp3'; // TODO scratch-storage should be fixed so that encodeDataURI does not // always prepend the wave format header; Once that is fixed, the following // line will have to change. payload.body = assetDataUrl.replace('data:audio/x-wav;base64,', ''); break; default: alert("Cannot serialize for format: ".concat(assetDataFormat)); // eslint-disable-line } // Return a promise to make it consistent with other payload constructors like costume-payload return new Promise(function (resolve) { return resolve(payload); }); }; /* harmony default export */ __webpack_exports__["default"] = (soundPayload); /***/ }), /***/ "./src/lib/backpack/sprite-payload.js": /*!********************************************!*\ !*** ./src/lib/backpack/sprite-payload.js ***! \********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _jpeg_thumbnail__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./jpeg-thumbnail */ "./src/lib/backpack/jpeg-thumbnail.js"); var spritePayload = function spritePayload(id, vm) { var target = vm.runtime.getTargetById(id); if (!target) return null; return vm.exportSprite(id, 'base64').then(function (zippedSprite) { var payload = { type: 'sprite', name: target.sprite.name, mime: 'application/zip', body: zippedSprite, // Filled in below thumbnail: '' }; var costumeDataUrl = target.sprite.costumes[target.currentCostume].asset.encodeDataURI(); return Object(_jpeg_thumbnail__WEBPACK_IMPORTED_MODULE_0__["default"])(costumeDataUrl).then(function (thumbnail) { payload.thumbnail = thumbnail.replace('data:image/jpeg;base64,', ''); return payload; }); }); }; /* harmony default export */ __webpack_exports__["default"] = (spritePayload); /***/ }), /***/ "./src/lib/blocks.js": /*!***************************!*\ !*** ./src/lib/blocks.js ***! \***************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var scratch_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! scratch-blocks */ "./node_modules/scratch-blocks/shim/vertical.js"); /* harmony import */ var scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(scratch_blocks__WEBPACK_IMPORTED_MODULE_0__); /** * Connect scratch blocks with the vm * @param {VirtualMachine} vm - The scratch vm * @return {ScratchBlocks} ScratchBlocks connected with the vm */ /* harmony default export */ __webpack_exports__["default"] = (function (vm) { var jsonForMenuBlock = function jsonForMenuBlock(name, menuOptionsFn, colors, start) { return { message0: '%1', args0: [{ type: 'field_dropdown', name: name, options: function options() { return start.concat(menuOptionsFn()); } }], inputsInline: true, output: 'String', colour: colors.secondary, colourSecondary: colors.secondary, colourTertiary: colors.tertiary, outputShape: scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.OUTPUT_SHAPE_ROUND }; }; var jsonForHatBlockMenu = function jsonForHatBlockMenu(hatName, name, menuOptionsFn, colors, start) { return { message0: hatName, args0: [{ type: 'field_dropdown', name: name, options: function options() { return start.concat(menuOptionsFn()); } }], colour: colors.primary, colourSecondary: colors.secondary, colourTertiary: colors.tertiary, extensions: ['shape_hat'] }; }; var jsonForSensingMenus = function jsonForSensingMenus(menuOptionsFn) { return { message0: scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.Msg.SENSING_OF, args0: [{ type: 'field_dropdown', name: 'PROPERTY', options: function options() { return menuOptionsFn(); } }, { type: 'input_value', name: 'OBJECT' }], output: true, colour: scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.Colours.sensing.primary, colourSecondary: scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.Colours.sensing.secondary, colourTertiary: scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.Colours.sensing.tertiary, outputShape: scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.OUTPUT_SHAPE_ROUND }; }; var soundsMenu = function soundsMenu() { var menu = [['', '']]; if (vm.editingTarget && vm.editingTarget.sprite.sounds.length > 0) { menu = vm.editingTarget.sprite.sounds.map(function (sound) { return [sound.name, sound.name]; }); } menu.push([scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.ScratchMsgs.translate('SOUND_RECORD', 'record...'), scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.recordSoundCallback]); return menu; }; var costumesMenu = function costumesMenu() { if (vm.editingTarget && vm.editingTarget.getCostumes().length > 0) { return vm.editingTarget.getCostumes().map(function (costume) { return [costume.name, costume.name]; }); } return [['', '']]; }; var backdropsMenu = function backdropsMenu() { var next = scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.ScratchMsgs.translate('LOOKS_NEXTBACKDROP', 'next backdrop'); var previous = scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.ScratchMsgs.translate('LOOKS_PREVIOUSBACKDROP', 'previous backdrop'); var random = scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.ScratchMsgs.translate('LOOKS_RANDOMBACKDROP', 'random backdrop'); if (vm.runtime.targets[0] && vm.runtime.targets[0].getCostumes().length > 0) { return vm.runtime.targets[0].getCostumes().map(function (costume) { return [costume.name, costume.name]; }).concat([[next, 'next backdrop'], [previous, 'previous backdrop'], [random, 'random backdrop']]); } return [['', '']]; }; var backdropNamesMenu = function backdropNamesMenu() { var stage = vm.runtime.getTargetForStage(); if (stage && stage.getCostumes().length > 0) { return stage.getCostumes().map(function (costume) { return [costume.name, costume.name]; }); } return [['', '']]; }; var spriteMenu = function spriteMenu() { var sprites = []; for (var targetId in vm.runtime.targets) { if (!vm.runtime.targets.hasOwnProperty(targetId)) continue; if (vm.runtime.targets[targetId].isOriginal) { if (!vm.runtime.targets[targetId].isStage) { if (vm.runtime.targets[targetId] === vm.editingTarget) { continue; } sprites.push([vm.runtime.targets[targetId].sprite.name, vm.runtime.targets[targetId].sprite.name]); } } } return sprites; }; var cloneMenu = function cloneMenu() { if (vm.editingTarget && vm.editingTarget.isStage) { var menu = spriteMenu(); if (menu.length === 0) { return [['', '']]; // Empty menu matches Scratch 2 behavior } return menu; } var myself = scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.ScratchMsgs.translate('CONTROL_CREATECLONEOF_MYSELF', 'myself'); return [[myself, '_myself_']].concat(spriteMenu()); }; var soundColors = scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.Colours.sounds; var looksColors = scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.Colours.looks; var motionColors = scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.Colours.motion; var sensingColors = scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.Colours.sensing; var controlColors = scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.Colours.control; var eventColors = scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.Colours.event; scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.Blocks.sound_sounds_menu.init = function () { var json = jsonForMenuBlock('SOUND_MENU', soundsMenu, soundColors, []); this.jsonInit(json); }; scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.Blocks.looks_costume.init = function () { var json = jsonForMenuBlock('COSTUME', costumesMenu, looksColors, []); this.jsonInit(json); }; scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.Blocks.looks_backdrops.init = function () { var json = jsonForMenuBlock('BACKDROP', backdropsMenu, looksColors, []); this.jsonInit(json); }; scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.Blocks.event_whenbackdropswitchesto.init = function () { var json = jsonForHatBlockMenu(scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.Msg.EVENT_WHENBACKDROPSWITCHESTO, 'BACKDROP', backdropNamesMenu, eventColors, []); this.jsonInit(json); }; scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.Blocks.motion_pointtowards_menu.init = function () { var mouse = scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.ScratchMsgs.translate('MOTION_POINTTOWARDS_POINTER', 'mouse-pointer'); var json = jsonForMenuBlock('TOWARDS', spriteMenu, motionColors, [[mouse, '_mouse_']]); this.jsonInit(json); }; scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.Blocks.motion_goto_menu.init = function () { var random = scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.ScratchMsgs.translate('MOTION_GOTO_RANDOM', 'random position'); var mouse = scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.ScratchMsgs.translate('MOTION_GOTO_POINTER', 'mouse-pointer'); var json = jsonForMenuBlock('TO', spriteMenu, motionColors, [[random, '_random_'], [mouse, '_mouse_']]); this.jsonInit(json); }; scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.Blocks.motion_glideto_menu.init = function () { var random = scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.ScratchMsgs.translate('MOTION_GLIDETO_RANDOM', 'random position'); var mouse = scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.ScratchMsgs.translate('MOTION_GLIDETO_POINTER', 'mouse-pointer'); var json = jsonForMenuBlock('TO', spriteMenu, motionColors, [[random, '_random_'], [mouse, '_mouse_']]); this.jsonInit(json); }; scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.Blocks.sensing_of_object_menu.init = function () { var stage = scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.ScratchMsgs.translate('SENSING_OF_STAGE', 'Stage'); var json = jsonForMenuBlock('OBJECT', spriteMenu, sensingColors, [[stage, '_stage_']]); this.jsonInit(json); }; scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.Blocks.sensing_of.init = function () { var blockId = this.id; // Function that fills in menu for the first input in the sensing block. // Called every time it opens since it depends on the values in the other block input. var menuFn = function menuFn() { var stageOptions = [[scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.Msg.SENSING_OF_BACKDROPNUMBER, 'backdrop #'], [scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.Msg.SENSING_OF_BACKDROPNAME, 'backdrop name'], [scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.Msg.SENSING_OF_VOLUME, 'volume']]; var spriteOptions = [[scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.Msg.SENSING_OF_XPOSITION, 'x position'], [scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.Msg.SENSING_OF_YPOSITION, 'y position'], [scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.Msg.SENSING_OF_DIRECTION, 'direction'], [scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.Msg.SENSING_OF_COSTUMENUMBER, 'costume #'], [scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.Msg.SENSING_OF_COSTUMENAME, 'costume name'], [scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.Msg.SENSING_OF_SIZE, 'size'], [scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.Msg.SENSING_OF_VOLUME, 'volume']]; if (vm.editingTarget) { var lookupBlocks = vm.editingTarget.blocks; var sensingOfBlock = lookupBlocks.getBlock(blockId); // The block doesn't exist, but should be in the flyout. Look there. if (!sensingOfBlock) { sensingOfBlock = vm.runtime.flyoutBlocks.getBlock(blockId); // If we still don't have a block, just return an empty list . This happens during // scratch blocks construction. if (!sensingOfBlock) { return [['', '']]; } // The block was in the flyout so look up future block info there. lookupBlocks = vm.runtime.flyoutBlocks; } var sort = function sort(options) { options.sort(scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.scratchBlocksUtils.compareStrings); }; // Get all the stage variables (no lists) so we can add them to menu when the stage is selected. var stageVariableOptions = vm.runtime.getTargetForStage().getAllVariableNamesInScopeByType(''); sort(stageVariableOptions); var stageVariableMenuItems = stageVariableOptions.map(function (variable) { return [variable, variable]; }); if (sensingOfBlock.inputs.OBJECT.shadow !== sensingOfBlock.inputs.OBJECT.block) { // There's a block dropped on top of the menu. It'd be nice to evaluate it and // return the correct list, but that is tricky. Scratch2 just returns stage options // so just do that here too. return stageOptions.concat(stageVariableMenuItems); } var menuBlock = lookupBlocks.getBlock(sensingOfBlock.inputs.OBJECT.shadow); var selectedItem = menuBlock.fields.OBJECT.value; if (selectedItem === '_stage_') { return stageOptions.concat(stageVariableMenuItems); } // Get all the local variables (no lists) and add them to the menu. var target = vm.runtime.getSpriteTargetByName(selectedItem); var spriteVariableOptions = []; // The target should exist, but there are ways for it not to (e.g. #4203). if (target) { spriteVariableOptions = target.getAllVariableNamesInScopeByType('', true); sort(spriteVariableOptions); } var spriteVariableMenuItems = spriteVariableOptions.map(function (variable) { return [variable, variable]; }); return spriteOptions.concat(spriteVariableMenuItems); } return [['', '']]; }; var json = jsonForSensingMenus(menuFn); this.jsonInit(json); }; scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.Blocks.sensing_distancetomenu.init = function () { var mouse = scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.ScratchMsgs.translate('SENSING_DISTANCETO_POINTER', 'mouse-pointer'); var json = jsonForMenuBlock('DISTANCETOMENU', spriteMenu, sensingColors, [[mouse, '_mouse_']]); this.jsonInit(json); }; scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.Blocks.sensing_touchingobjectmenu.init = function () { var mouse = scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.ScratchMsgs.translate('SENSING_TOUCHINGOBJECT_POINTER', 'mouse-pointer'); var edge = scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.ScratchMsgs.translate('SENSING_TOUCHINGOBJECT_EDGE', 'edge'); var json = jsonForMenuBlock('TOUCHINGOBJECTMENU', spriteMenu, sensingColors, [[mouse, '_mouse_'], [edge, '_edge_']]); this.jsonInit(json); }; scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.Blocks.control_create_clone_of_menu.init = function () { var json = jsonForMenuBlock('CLONE_OPTION', cloneMenu, controlColors, []); this.jsonInit(json); }; scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.VerticalFlyout.getCheckboxState = function (blockId) { var monitoredBlock = vm.runtime.monitorBlocks._blocks[blockId]; return monitoredBlock ? monitoredBlock.isMonitored : false; }; scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.FlyoutExtensionCategoryHeader.getExtensionState = function (extensionId) { if (vm.getPeripheralIsConnected(extensionId)) { return scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.StatusButtonState.READY; } return scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.StatusButtonState.NOT_READY; }; scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.FieldNote.playNote_ = function (noteNum, extensionId) { vm.runtime.emit('PLAY_NOTE', noteNum, extensionId); }; // Use a collator's compare instead of localeCompare which internally // creates a collator. Using this is a lot faster in browsers that create a // collator for every localeCompare call. var collator = new Intl.Collator([], { sensitivity: 'base', numeric: true }); scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.scratchBlocksUtils.compareStrings = function (str1, str2) { return collator.compare(str1, str2); }; // Blocks wants to know if 3D CSS transforms are supported. The cross // section of browsers Scratch supports and browsers that support 3D CSS // transforms will make the return always true. // // Shortcutting to true lets us skip an expensive style recalculation when // first loading the Scratch editor. scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.utils.is3dSupported = function () { return true; }; return scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a; }); /***/ }), /***/ "./src/lib/cloud-manager-hoc.jsx": /*!***************************************!*\ !*** ./src/lib/cloud-manager-hoc.jsx ***! \***************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! scratch-vm */ "./node_modules/scratch-vm/src/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(scratch_vm__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _lib_cloud_provider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../lib/cloud-provider */ "./src/lib/cloud-provider.js"); /* harmony import */ var _reducers_project_state__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../reducers/project-state */ "./src/reducers/project-state.js"); /* harmony import */ var _reducers_alerts__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../reducers/alerts */ "./src/reducers/alerts.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } /* * Higher Order Component to manage the connection to the cloud server. * @param {React.Component} WrappedComponent component to manage VM events for * @returns {React.Component} connected component with vm events bound to redux */ var cloudManagerHOC = function cloudManagerHOC(WrappedComponent) { var CloudManager = /*#__PURE__*/ function (_React$Component) { _inherits(CloudManager, _React$Component); function CloudManager(props) { var _this; _classCallCheck(this, CloudManager); _this = _possibleConstructorReturn(this, _getPrototypeOf(CloudManager).call(this, props)); _this.cloudProvider = null; lodash_bindall__WEBPACK_IMPORTED_MODULE_3___default()(_assertThisInitialized(_this), ['handleCloudDataUpdate']); _this.props.vm.on('HAS_CLOUD_DATA_UPDATE', _this.handleCloudDataUpdate); return _this; } _createClass(CloudManager, [{ key: "componentDidMount", value: function componentDidMount() { if (this.shouldConnect(this.props)) { this.connectToCloud(); } } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { // TODO need to add cloud provider disconnection logic and cloud data clearing logic // when loading a new project e.g. via file upload // (and eventually move it out of the vm.clear function) if (this.shouldConnect(this.props) && !this.shouldConnect(prevProps)) { this.connectToCloud(); } if (this.shouldDisconnect(this.props, prevProps)) { this.disconnectFromCloud(); } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.disconnectFromCloud(); } }, { key: "canUseCloud", value: function canUseCloud(props) { return !!(props.cloudHost && props.username && props.vm && props.projectId && props.hasCloudPermission); } }, { key: "shouldNotModifyCloudData", value: function shouldNotModifyCloudData(props) { return props.hasEverEnteredEditor && !props.canSave; } }, { key: "shouldConnect", value: function shouldConnect(props) { return !this.isConnected() && this.canUseCloud(props) && props.isShowingWithId && props.vm.runtime.hasCloudData() && !this.shouldNotModifyCloudData(props); } }, { key: "shouldDisconnect", value: function shouldDisconnect(props, prevProps) { return this.isConnected() && ( // Can no longer use cloud or cloud provider info is now stale !this.canUseCloud(props) || !props.vm.runtime.hasCloudData() || props.projectId !== prevProps.projectId || props.username !== prevProps.username || // Editing someone else's project this.shouldNotModifyCloudData(props)); } }, { key: "isConnected", value: function isConnected() { return this.cloudProvider && !!this.cloudProvider.connection; } }, { key: "connectToCloud", value: function connectToCloud() { this.cloudProvider = new _lib_cloud_provider__WEBPACK_IMPORTED_MODULE_5__["default"](this.props.cloudHost, this.props.vm, this.props.username, this.props.projectId); this.props.vm.setCloudProvider(this.cloudProvider); } }, { key: "disconnectFromCloud", value: function disconnectFromCloud() { if (this.cloudProvider) { this.cloudProvider.requestCloseConnection(); this.cloudProvider = null; this.props.vm.setCloudProvider(null); } } }, { key: "handleCloudDataUpdate", value: function handleCloudDataUpdate(projectHasCloudData) { if (this.isConnected() && !projectHasCloudData) { this.disconnectFromCloud(); } else if (this.shouldConnect(this.props)) { this.props.onShowCloudInfo(); this.connectToCloud(); } } }, { key: "render", value: function render() { var _this$props = this.props, cloudHost = _this$props.cloudHost, projectId = _this$props.projectId, username = _this$props.username, hasCloudPermission = _this$props.hasCloudPermission, hasEverEnteredEditor = _this$props.hasEverEnteredEditor, isShowingWithId = _this$props.isShowingWithId, onShowCloudInfo = _this$props.onShowCloudInfo, vm = _this$props.vm, componentProps = _objectWithoutProperties(_this$props, ["cloudHost", "projectId", "username", "hasCloudPermission", "hasEverEnteredEditor", "isShowingWithId", "onShowCloudInfo", "vm"]); return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(WrappedComponent, _extends({ canUseCloud: this.canUseCloud(this.props), vm: vm }, componentProps)); } }]); return CloudManager; }(react__WEBPACK_IMPORTED_MODULE_1___default.a.Component); CloudManager.propTypes = { canSave: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool.isRequired, cloudHost: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, hasCloudPermission: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, hasEverEnteredEditor: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, isShowingWithId: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, onShowCloudInfo: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, projectId: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number]), username: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, vm: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.instanceOf(scratch_vm__WEBPACK_IMPORTED_MODULE_4___default.a).isRequired }; var mapStateToProps = function mapStateToProps(state) { var loadingState = state.scratchGui.projectState.loadingState; return { hasEverEnteredEditor: state.scratchGui.mode.hasEverEnteredEditor, isShowingWithId: Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_6__["getIsShowingWithId"])(loadingState), projectId: state.scratchGui.projectState.projectId }; }; var mapDispatchToProps = function mapDispatchToProps(dispatch) { return { onShowCloudInfo: function onShowCloudInfo() { return Object(_reducers_alerts__WEBPACK_IMPORTED_MODULE_7__["showAlertWithTimeout"])(dispatch, 'cloudInfo'); } }; }; // Allow incoming props to override redux-provided props. Used to mock in tests. var mergeProps = function mergeProps(stateProps, dispatchProps, ownProps) { return Object.assign({}, stateProps, dispatchProps, ownProps); }; return Object(react_redux__WEBPACK_IMPORTED_MODULE_2__["connect"])(mapStateToProps, mapDispatchToProps, mergeProps)(CloudManager); }; /* harmony default export */ __webpack_exports__["default"] = (cloudManagerHOC); /***/ }), /***/ "./src/lib/cloud-provider.js": /*!***********************************!*\ !*** ./src/lib/cloud-provider.js ***! \***********************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _log_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./log.js */ "./src/lib/log.js"); /* harmony import */ var lodash_throttle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash.throttle */ "./node_modules/lodash.throttle/index.js"); /* harmony import */ var lodash_throttle__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_throttle__WEBPACK_IMPORTED_MODULE_1__); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } var CloudProvider = /*#__PURE__*/ function () { /** * A cloud data provider which creates and manages a web socket connection * to the Scratch cloud data server. This provider is responsible for * interfacing with the VM's cloud io device. * @param {string} cloudHost The url for the cloud data server * @param {VirtualMachine} vm The Scratch virtual machine to interface with * @param {string} username The username to associate cloud data updates with * @param {string} projectId The id associated with the project containing * cloud data. */ function CloudProvider(cloudHost, vm, username, projectId) { _classCallCheck(this, CloudProvider); this.vm = vm; this.username = username; this.projectId = projectId; this.cloudHost = cloudHost; this.connectionAttempts = 0; // A queue of messages to send which were received before the // connection was ready this.queuedData = []; this.openConnection(); // Send a message to the cloud server at a rate of no more // than 10 messages/sec. this.sendCloudData = lodash_throttle__WEBPACK_IMPORTED_MODULE_1___default()(this._sendCloudData, 100); } /** * Open a new websocket connection to the clouddata server. * @param {string} cloudHost The cloud data server to connect to. */ _createClass(CloudProvider, [{ key: "openConnection", value: function openConnection() { this.connectionAttempts += 1; try { this.connection = new WebSocket((location.protocol === 'http:' ? 'ws://' : 'wss://') + this.cloudHost); } catch (e) { _log_js__WEBPACK_IMPORTED_MODULE_0__["default"].warn('Websocket support is not available in this browser', e); this.connection = null; return; } this.connection.onerror = this.onError.bind(this); this.connection.onmessage = this.onMessage.bind(this); this.connection.onopen = this.onOpen.bind(this); this.connection.onclose = this.onClose.bind(this); } }, { key: "onError", value: function onError(event) { _log_js__WEBPACK_IMPORTED_MODULE_0__["default"].error("Websocket connection error: ".concat(JSON.stringify(event))); // Error is always followed by close, which handles reconnect logic. } }, { key: "onMessage", value: function onMessage(event) { var _this = this; var messageString = event.data; // Multiple commands can be received, newline separated messageString.split('\n').forEach(function (message) { if (message) { // .split can also contain '' in the array it returns var parsedData = _this.parseMessage(JSON.parse(message)); _this.vm.postIOData('cloud', parsedData); } }); } }, { key: "onOpen", value: function onOpen() { var _this2 = this; // Reset connection attempts to 1 to make sure any subsequent reconnects // use connectionAttempts=1 to calculate timeout this.connectionAttempts = 1; this.writeToServer('handshake'); _log_js__WEBPACK_IMPORTED_MODULE_0__["default"].info("Successfully connected to clouddata server."); // Go through the queued data and send off messages that we weren't // ready to send before this.queuedData.forEach(function (data) { _this2.sendCloudData(data); }); // Reset the queue this.queuedData = []; } }, { key: "onClose", value: function onClose() { _log_js__WEBPACK_IMPORTED_MODULE_0__["default"].info("Closed connection to websocket"); var randomizedTimeout = this.randomizeDuration(this.exponentialTimeout()); this.setTimeout(this.openConnection.bind(this), randomizedTimeout); } }, { key: "exponentialTimeout", value: function exponentialTimeout() { return (Math.pow(2, Math.min(this.connectionAttempts, 5)) - 1) * 1000; } }, { key: "randomizeDuration", value: function randomizeDuration(t) { return Math.random() * t; } }, { key: "setTimeout", value: function setTimeout(fn, time) { _log_js__WEBPACK_IMPORTED_MODULE_0__["default"].info("Reconnecting in ".concat((time / 1000).toFixed(1), "s, attempt ").concat(this.connectionAttempts)); this._connectionTimeout = window.setTimeout(fn, time); } }, { key: "parseMessage", value: function parseMessage(message) { var varData = {}; switch (message.method) { case 'set': { varData.varUpdate = { name: message.name, value: message.value }; break; } } return varData; } /** * Format and send a message to the cloud data server. * @param {string} methodName The message method, indicating the action to perform. * @param {string} dataName The name of the cloud variable this message pertains to * @param {string | number} dataValue The value to set the cloud variable to * @param {string} dataNewName The new name for the cloud variable (if renaming) */ }, { key: "writeToServer", value: function writeToServer(methodName, dataName, dataValue, dataNewName) { var msg = {}; msg.method = methodName; msg.user = this.username; msg.project_id = this.projectId; // Optional string params can use simple falsey undefined check if (dataName) msg.name = dataName; if (dataNewName) msg.new_name = dataNewName; // Optional number params need different undefined check if (typeof dataValue !== 'undefined' && dataValue !== null) msg.value = dataValue; var dataToWrite = JSON.stringify(msg); if (this.connection && this.connection.readyState === WebSocket.OPEN) { this.sendCloudData(dataToWrite); } else if (msg.method === 'create' || msg.method === 'delete' || msg.method === 'rename') { // Save data for sending when connection is open, iff the data // is a create, rename, or delete this.queuedData.push(dataToWrite); } } /** * Send a formatted message to the cloud data server. * @param {string} data The formatted message to send. */ }, { key: "_sendCloudData", value: function _sendCloudData(data) { this.connection.send("".concat(data, "\n")); } /** * Provides an API for the VM's cloud IO device to create * a new cloud variable on the server. * @param {string} name The name of the variable to create * @param {string | number} value The value of the new cloud variable. */ }, { key: "createVariable", value: function createVariable(name, value) { this.writeToServer('create', name, value); } /** * Provides an API for the VM's cloud IO device to update * a cloud variable on the server. * @param {string} name The name of the variable to update * @param {string | number} value The new value for the variable */ }, { key: "updateVariable", value: function updateVariable(name, value) { this.writeToServer('set', name, value); } /** * Provides an API for the VM's cloud IO device to rename * a cloud variable on the server. * @param {string} oldName The old name of the variable to rename * @param {string} newName The new name for the cloud variable. */ }, { key: "renameVariable", value: function renameVariable(oldName, newName) { this.writeToServer('rename', oldName, null, newName); } /** * Provides an API for the VM's cloud IO device to delete * a cloud variable on the server. * @param {string} name The name of the variable to delete */ }, { key: "deleteVariable", value: function deleteVariable(name) { this.writeToServer('delete', name); } /** * Closes the connection to the web socket and clears the cloud * provider of references related to the cloud data project. */ }, { key: "requestCloseConnection", value: function requestCloseConnection() { if (this.connection && this.connection.readyState !== WebSocket.CLOSING && this.connection.readyState !== WebSocket.CLOSED) { _log_js__WEBPACK_IMPORTED_MODULE_0__["default"].info('Request close cloud connection without reconnecting'); // Remove listeners, after this point we do not want to react to connection updates this.connection.onclose = function () {}; this.connection.onerror = function () {}; this.connection.close(); } this.clear(); } /** * Clear this provider of references related to the project * and current state. */ }, { key: "clear", value: function clear() { this.connection = null; this.vm = null; this.username = null; this.projectId = null; if (this._connectionTimeout) { clearTimeout(this._connectionTimeout); this._connectionTimeout = null; } this.connectionAttempts = 0; } }]); return CloudProvider; }(); /* harmony default export */ __webpack_exports__["default"] = (CloudProvider); /***/ }), /***/ "./src/lib/collect-metadata.js": /*!*************************************!*\ !*** ./src/lib/collect-metadata.js ***! \*************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /** * Report a telemetry event. * @param {string} event - one of `projectWasCreated`, `projectDidLoad`, `projectDidSave`, `projectWasUploaded` */ // TODO make a telemetry HOC and move this stuff there var collectMetadata = function collectMetadata(vm) { var projectName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; var locale = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; // TODO move most or all of this into a collectMetadata() method on the VM/Runtime var metadata = { projectName: projectName, language: locale, spriteCount: 0, blocksCount: 0, costumesCount: 0, listsCount: 0, scriptCount: 0, soundsCount: 0, variablesCount: 0 }; var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = vm.runtime.targets[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var target = _step.value; ++metadata.spriteCount; metadata.blocksCount += Object.keys(target.sprite.blocks._blocks).length; metadata.costumesCount += target.sprite.costumes_.length; metadata.scriptCount += target.sprite.blocks._scripts.length; metadata.soundsCount += target.sprite.sounds.length; for (var variableName in target.variables) { var variable = target.variables[variableName]; if (variable.type === 'list') { ++metadata.listsCount; } else { ++metadata.variablesCount; } } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } return metadata; }; /* harmony default export */ __webpack_exports__["default"] = (collectMetadata); /***/ }), /***/ "./src/lib/connected-intl-provider.jsx": /*!*********************************************!*\ !*** ./src/lib/connected-intl-provider.jsx ***! \*********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); var mapStateToProps = function mapStateToProps(state) { return { key: state.locales.locale, locale: state.locales.locale, messages: state.locales.messages }; }; /* harmony default export */ __webpack_exports__["default"] = (Object(react_redux__WEBPACK_IMPORTED_MODULE_1__["connect"])(mapStateToProps)(react_intl__WEBPACK_IMPORTED_MODULE_0__["IntlProvider"])); /***/ }), /***/ "./src/lib/data-uri-to-blob.js": /*!*************************************!*\ !*** ./src/lib/data-uri-to-blob.js ***! \*************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return dataURItoBlob; }); /** * Utility to convert data URIs to blobs * Adapted from https://stackoverflow.com/questions/12168909/blob-from-dataurl * @param {string} dataURI the data uri to blobify * @return {Blob} a blob representing the data uri */ function dataURItoBlob(dataURI) { var byteString = atob(dataURI.split(',')[1]); var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]; var arrayBuffer = new ArrayBuffer(byteString.length); var uintArray = new Uint8Array(arrayBuffer); for (var i = 0; i < byteString.length; i++) { uintArray[i] = byteString.charCodeAt(i); } var blob = new Blob([arrayBuffer], { type: mimeString }); return blob; } /***/ }), /***/ "./src/lib/default-project/index.js": /*!******************************************!*\ !*** ./src/lib/default-project/index.js ***! \******************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _project_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./project-data */ "./src/lib/default-project/project-data.js"); /* harmony import */ var _arraybuffer_loader_83a9787d4cb6f3b7632b4ddfebf74367_wav__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! arraybuffer-loader!./83a9787d4cb6f3b7632b4ddfebf74367.wav */ "./node_modules/arraybuffer-loader/index.js!./src/lib/default-project/83a9787d4cb6f3b7632b4ddfebf74367.wav"); /* harmony import */ var _arraybuffer_loader_83a9787d4cb6f3b7632b4ddfebf74367_wav__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_arraybuffer_loader_83a9787d4cb6f3b7632b4ddfebf74367_wav__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _arraybuffer_loader_83c36d806dc92327b9e7049a565c6bff_wav__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! arraybuffer-loader!./83c36d806dc92327b9e7049a565c6bff.wav */ "./node_modules/arraybuffer-loader/index.js!./src/lib/default-project/83c36d806dc92327b9e7049a565c6bff.wav"); /* harmony import */ var _arraybuffer_loader_83c36d806dc92327b9e7049a565c6bff_wav__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_arraybuffer_loader_83c36d806dc92327b9e7049a565c6bff_wav__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _raw_loader_cd21514d0531fdffb22204e0ec5ed84a_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! raw-loader!./cd21514d0531fdffb22204e0ec5ed84a.svg */ "./node_modules/raw-loader/index.js!./src/lib/default-project/cd21514d0531fdffb22204e0ec5ed84a.svg"); /* harmony import */ var _raw_loader_cd21514d0531fdffb22204e0ec5ed84a_svg__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_raw_loader_cd21514d0531fdffb22204e0ec5ed84a_svg__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _raw_loader_09dc888b0b7df19f70d81588ae73420e_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! raw-loader!./09dc888b0b7df19f70d81588ae73420e.svg */ "./node_modules/raw-loader/index.js!./src/lib/default-project/09dc888b0b7df19f70d81588ae73420e.svg"); /* harmony import */ var _raw_loader_09dc888b0b7df19f70d81588ae73420e_svg__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_raw_loader_09dc888b0b7df19f70d81588ae73420e_svg__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _raw_loader_3696356a03a8d938318876a593572843_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! raw-loader!./3696356a03a8d938318876a593572843.svg */ "./node_modules/raw-loader/index.js!./src/lib/default-project/3696356a03a8d938318876a593572843.svg"); /* harmony import */ var _raw_loader_3696356a03a8d938318876a593572843_svg__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_raw_loader_3696356a03a8d938318876a593572843_svg__WEBPACK_IMPORTED_MODULE_5__); /* eslint-disable import/no-unresolved */ /* eslint-enable import/no-unresolved */ var defaultProject = function defaultProject(translator) { var _TextEncoder; if (typeof TextEncoder === 'undefined') { _TextEncoder = __webpack_require__(/*! text-encoding */ "./node_modules/text-encoding/index.js").TextEncoder; } else { /* global TextEncoder */ _TextEncoder = TextEncoder; } var encoder = new _TextEncoder(); var projectJson = Object(_project_data__WEBPACK_IMPORTED_MODULE_0__["default"])(translator); return [{ id: 0, assetType: 'Project', dataFormat: 'JSON', data: JSON.stringify(projectJson) }, { id: '83a9787d4cb6f3b7632b4ddfebf74367', assetType: 'Sound', dataFormat: 'WAV', data: new Uint8Array(_arraybuffer_loader_83a9787d4cb6f3b7632b4ddfebf74367_wav__WEBPACK_IMPORTED_MODULE_1___default.a) }, { id: '83c36d806dc92327b9e7049a565c6bff', assetType: 'Sound', dataFormat: 'WAV', data: new Uint8Array(_arraybuffer_loader_83c36d806dc92327b9e7049a565c6bff_wav__WEBPACK_IMPORTED_MODULE_2___default.a) }, { id: 'cd21514d0531fdffb22204e0ec5ed84a', assetType: 'ImageVector', dataFormat: 'SVG', data: encoder.encode(_raw_loader_cd21514d0531fdffb22204e0ec5ed84a_svg__WEBPACK_IMPORTED_MODULE_3___default.a) }, { id: '09dc888b0b7df19f70d81588ae73420e', assetType: 'ImageVector', dataFormat: 'SVG', data: encoder.encode(_raw_loader_09dc888b0b7df19f70d81588ae73420e_svg__WEBPACK_IMPORTED_MODULE_4___default.a) }, { id: '3696356a03a8d938318876a593572843', assetType: 'ImageVector', dataFormat: 'SVG', data: encoder.encode(_raw_loader_3696356a03a8d938318876a593572843_svg__WEBPACK_IMPORTED_MODULE_5___default.a) }]; }; /* harmony default export */ __webpack_exports__["default"] = (defaultProject); /***/ }), /***/ "./src/lib/default-project/project-data.js": /*!*************************************************!*\ !*** ./src/lib/default-project/project-data.js ***! \*************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _shared_messages__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../shared-messages */ "./src/lib/shared-messages.js"); function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_0__["defineMessages"])({ meow: { "id": "gui.defaultProject.meow", "defaultMessage": "Meow" }, variable: { "id": "gui.defaultProject.variable", "defaultMessage": "my variable" } }); messages = _objectSpread({}, messages, _shared_messages__WEBPACK_IMPORTED_MODULE_1__["default"]); // use the default message if a translation function is not passed var defaultTranslator = function defaultTranslator(msgObj) { return msgObj.defaultMessage; }; /** * Generate a localized version of the default project * @param {function} translateFunction a function to use for translating the default names * @return {object} the project data json for the default project */ var projectData = function projectData(translateFunction) { var translator = translateFunction || defaultTranslator; return { targets: [{ isStage: true, name: 'Stage', variables: { '`jEk@4|i[#Fk?(8x)AV.-my variable': [translator(messages.variable), 0] }, lists: {}, broadcasts: {}, blocks: {}, currentCostume: 0, costumes: [{ assetId: 'cd21514d0531fdffb22204e0ec5ed84a', name: translator(messages.backdrop, { index: 1 }), md5ext: 'cd21514d0531fdffb22204e0ec5ed84a.svg', dataFormat: 'svg', rotationCenterX: 240, rotationCenterY: 180 }], sounds: [{ assetId: '83a9787d4cb6f3b7632b4ddfebf74367', name: translator(messages.pop), dataFormat: 'wav', format: '', rate: 11025, sampleCount: 258, md5ext: '83a9787d4cb6f3b7632b4ddfebf74367.wav' }], volume: 100 }, { isStage: false, name: translator(messages.sprite, { index: 1 }), variables: {}, lists: {}, broadcasts: {}, blocks: {}, currentCostume: 0, costumes: [{ assetId: 'b7853f557e4426412e64bb3da6531a99', name: translator(messages.costume, { index: 1 }), bitmapResolution: 1, md5ext: 'b7853f557e4426412e64bb3da6531a99.svg', dataFormat: 'svg', rotationCenterX: 48, rotationCenterY: 50 }, { assetId: 'e6ddc55a6ddd9cc9d84fe0b4c21e016f', name: translator(messages.costume, { index: 2 }), bitmapResolution: 1, md5ext: 'e6ddc55a6ddd9cc9d84fe0b4c21e016f.svg', dataFormat: 'svg', rotationCenterX: 46, rotationCenterY: 53 }], sounds: [{ assetId: '83c36d806dc92327b9e7049a565c6bff', name: translator(messages.meow), dataFormat: 'wav', format: '', rate: 22050, sampleCount: 18688, md5ext: '83c36d806dc92327b9e7049a565c6bff.wav' }], volume: 100, visible: true, x: 0, y: 0, size: 100, direction: 90, draggable: false, rotationStyle: 'all around' }], meta: { semver: '3.0.0', vm: '0.1.0', agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36' // eslint-disable-line max-len } }; }; /* harmony default export */ __webpack_exports__["default"] = (projectData); /***/ }), /***/ "./src/lib/detect-locale.js": /*!**********************************!*\ !*** ./src/lib/detect-locale.js ***! \**********************************/ /*! exports provided: detectLocale */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "detectLocale", function() { return detectLocale; }); /* harmony import */ var query_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! query-string */ "./node_modules/query-string/index.js"); /* harmony import */ var query_string__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(query_string__WEBPACK_IMPORTED_MODULE_0__); /** * @fileoverview * Utility function to detect locale from the browser setting or paramenter on the URL. */ /** * look for language setting in the browser. Check against supported locales. * If there's a parameter in the URL, override the browser setting * @param {Array.string} supportedLocales An array of supported locale codes. * @return {string} the preferred locale */ var detectLocale = function detectLocale(supportedLocales) { var locale = 'en'; // default // HACK: On Sugarizer the locale depend of Sugarizer Settings var sugarizerLocale = null; var sugarizerSettings = window.localStorage.getItem('sugar_settings'); if (sugarizerSettings) { sugarizerSettings = JSON.parse(sugarizerSettings); if (sugarizerSettings) { sugarizerLocale = sugarizerSettings.language; } } var browserLocale = sugarizerLocale || window.navigator.userLanguage || window.navigator.language; browserLocale = browserLocale.toLowerCase(); // try to set locale from browserLocale if (supportedLocales.includes(browserLocale)) { locale = browserLocale; } else { browserLocale = browserLocale.split('-')[0]; if (supportedLocales.includes(browserLocale)) { locale = browserLocale; } } var queryParams = query_string__WEBPACK_IMPORTED_MODULE_0___default.a.parse(location.search); // Flatten potential arrays and remove falsy values var potentialLocales = [].concat(queryParams.locale, queryParams.lang).filter(function (l) { return l; }); if (!potentialLocales.length) { return locale; } var urlLocale = potentialLocales[0].toLowerCase(); if (supportedLocales.includes(urlLocale)) { return urlLocale; } return locale; }; /***/ }), /***/ "./src/lib/download-blob.js": /*!**********************************!*\ !*** ./src/lib/download-blob.js ***! \**********************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony default export */ __webpack_exports__["default"] = (function (filename, blob) { var downloadLink = document.createElement('a'); document.body.appendChild(downloadLink); // Use special ms version if available to get it working on Edge. if (navigator.msSaveOrOpenBlob) { navigator.msSaveOrOpenBlob(blob, filename); return; } var url = window.URL.createObjectURL(blob); downloadLink.href = url; downloadLink.download = filename; downloadLink.click(); window.URL.revokeObjectURL(url); document.body.removeChild(downloadLink); }); /***/ }), /***/ "./src/lib/drag-constants.js": /*!***********************************!*\ !*** ./src/lib/drag-constants.js ***! \***********************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony default export */ __webpack_exports__["default"] = ({ SOUND: 'SOUND', COSTUME: 'COSTUME', SPRITE: 'SPRITE', CODE: 'CODE', BACKPACK_SOUND: 'BACKPACK_SOUND', BACKPACK_COSTUME: 'BACKPACK_COSTUME', BACKPACK_SPRITE: 'BACKPACK_SPRITE', BACKPACK_CODE: 'BACKPACK_CODE' }); /***/ }), /***/ "./src/lib/drag-utils.js": /*!*******************************!*\ !*** ./src/lib/drag-utils.js ***! \*******************************/ /*! exports provided: indexForPositionOnList */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "indexForPositionOnList", function() { return indexForPositionOnList; }); /** * @fileoverview * Utility functions for drag interactions, e.g. sorting items in a grid/list. */ /** * From an xy position and a list of boxes {top, left, bottom, right}, return there * corresponding box index the position is over. The boxes are in a (possibly wrapped) * list, the only requirement being all boxes are flush against the edges, that is, * if they are along an outer edge, the position of that edge is identical. * This functionality works for a single column of items, a wrapped list with * many rows, or a single row of items. * @param {{x: number, y: number}} position The xy coordinates to retreive the corresponding index of. * @param {Array.} boxes The rects of the items, returned from `getBoundingClientRect` * @return {?number} index of the corresponding box, or null if one could not be found. */ var indexForPositionOnList = function indexForPositionOnList(_ref, boxes) { var x = _ref.x, y = _ref.y; if (boxes.length === 0) return null; var index = null; var leftEdge = Math.min.apply(null, boxes.map(function (b) { return b.left; })); var rightEdge = Math.max.apply(null, boxes.map(function (b) { return b.right; })); var topEdge = Math.min.apply(null, boxes.map(function (b) { return b.top; })); var bottomEdge = Math.max.apply(null, boxes.map(function (b) { return b.bottom; })); for (var n = 0; n < boxes.length; n++) { var box = boxes[n]; // Construct an "extended" box for each, extending out to infinity if // the box is along a boundary. var minX = box.left === leftEdge ? -Infinity : box.left; var minY = box.top === topEdge ? -Infinity : box.top; var maxY = box.bottom === bottomEdge ? Infinity : box.bottom; // The last item in the wrapped list gets a right edge at infinity, even // if it isn't the farthest right. Add this as an "or" condition for extension. var maxX = n === boxes.length - 1 || box.right === rightEdge ? Infinity : box.right; // Check if the point is in the bounds. if (x > minX && x <= maxX && y > minY && y <= maxY) { index = n; break; // No need to keep looking. } } return index; }; /***/ }), /***/ "./src/lib/drop-area-hoc.jsx": /*!***********************************!*\ !*** ./src/lib/drop-area-hoc.jsx ***! \***********************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var lodash_omit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash.omit */ "./node_modules/lodash.omit/index.js"); /* harmony import */ var lodash_omit__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_omit__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } /** * Higher Order Component to give components the ability to react to drag overs * and drops of objects stored in the assetDrag redux state. * * Example: You want to enable MyComponent to receive drops from a drag type * Wrapped = DropAreaHOC([...dragTypes])( * * ) * * MyComponent now receives 2 new props * containerRef: a ref that must be set on the container element * dragOver: boolean if an asset is being dragged above the component * * Use the wrapped component: * * * NB: This HOC _only_ works with objects that drag using the assetDrag reducer. * This _does not_ handle drags for blocks coming from the workspace. * * @param {Array.} dragTypes Types to respond to, from DragConstants * @returns {function} The HOC, specialized for those drag types */ var DropAreaHOC = function DropAreaHOC(dragTypes) { /** * Return the HOC, specialized for the dragTypes * @param {React.Component} WrappedComponent component to receive drop behaviors * @returns {React.Component} component with drag over/drop behavior */ return function (WrappedComponent) { var DropAreaWrapper = /*#__PURE__*/ function (_React$Component) { _inherits(DropAreaWrapper, _React$Component); function DropAreaWrapper(props) { var _this; _classCallCheck(this, DropAreaWrapper); _this = _possibleConstructorReturn(this, _getPrototypeOf(DropAreaWrapper).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['setRef']); _this.state = { dragOver: false }; _this.ref = null; _this.containerBox = null; return _this; } _createClass(DropAreaWrapper, [{ key: "componentWillReceiveProps", value: function componentWillReceiveProps(newProps) { // If `dragging` becomes true, record the drop area rectangle if (newProps.dragInfo.dragging && !this.props.dragInfo.dragging) { this.dropAreaRect = this.ref && this.ref.getBoundingClientRect(); // If `dragging` becomes false, call the drop handler } else if (!newProps.dragInfo.dragging && this.props.dragInfo.dragging && this.state.dragOver) { this.props.onDrop(this.props.dragInfo); this.setState({ dragOver: false }); } // If a drag is in progress (currentOffset) and it matches the relevant drag types, // test if the drag is within the drop area rect and set the state accordingly. if (this.dropAreaRect && newProps.dragInfo.currentOffset && dragTypes.includes(newProps.dragInfo.dragType)) { var _newProps$dragInfo$cu = newProps.dragInfo.currentOffset, x = _newProps$dragInfo$cu.x, y = _newProps$dragInfo$cu.y; var _this$dropAreaRect = this.dropAreaRect, top = _this$dropAreaRect.top, right = _this$dropAreaRect.right, bottom = _this$dropAreaRect.bottom, left = _this$dropAreaRect.left; if (x > left && x < right && y > top && y < bottom) { this.setState({ dragOver: true }); } else { this.setState({ dragOver: false }); } } } }, { key: "setRef", value: function setRef(el) { this.ref = el; if (this.props.componentRef) { this.props.componentRef(this.ref); } } }, { key: "render", value: function render() { var componentProps = lodash_omit__WEBPACK_IMPORTED_MODULE_3___default()(this.props, ['onDrop', 'dragInfo']); return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(WrappedComponent, _extends({ containerRef: this.setRef, dragOver: this.state.dragOver }, componentProps)); } }]); return DropAreaWrapper; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.Component); DropAreaWrapper.propTypes = { componentRef: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, dragInfo: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.shape({ currentOffset: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.shape({ x: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, y: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number }), dragType: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, dragging: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, index: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number }), onDrop: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func }; var mapStateToProps = function mapStateToProps(state) { return { dragInfo: state.scratchGui.assetDrag }; }; var mapDispatchToProps = function mapDispatchToProps() { return {}; }; return Object(react_redux__WEBPACK_IMPORTED_MODULE_4__["connect"])(mapStateToProps, mapDispatchToProps)(DropAreaWrapper); }; }; /* harmony default export */ __webpack_exports__["default"] = (DropAreaHOC); /***/ }), /***/ "./src/lib/empty-assets.js": /*!*********************************!*\ !*** ./src/lib/empty-assets.js ***! \*********************************/ /*! exports provided: emptyCostume, emptySprite */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "emptyCostume", function() { return emptyCostume; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "emptySprite", function() { return emptySprite; }); /** * @fileoverview * Utility functions to return json corresponding to default empty assets. */ /** * Generate a blank costume object for vm.addCostume with the provided name. * @param {string} name the name to use for the costume, caller should localize * @return {object} vm costume object */ var emptyCostume = function emptyCostume(name) { return { name: name, md5: 'cd21514d0531fdffb22204e0ec5ed84a.svg', rotationCenterX: 0, rotationCenterY: 0, bitmapResolution: 1, skinId: null }; }; /** * Generate a new empty sprite. The caller should provide localized versions of the * default names. * @param {string} name the name to use for the sprite * @param {string} soundName the name to use for the default sound * @param {string} costumeName the name to use for the default costume * @return {object} object expected by vm.addSprite */ var emptySprite = function emptySprite(name, soundName, costumeName) { return { objName: name, sounds: [{ soundName: soundName, soundID: -1, md5: '83a9787d4cb6f3b7632b4ddfebf74367.wav', sampleCount: 258, rate: 11025, format: '' }], costumes: [{ costumeName: costumeName, baseLayerID: -1, baseLayerMD5: 'cd21514d0531fdffb22204e0ec5ed84a.svg', bitmapResolution: 1, rotationCenterX: 0, rotationCenterY: 0 }], currentCostumeIndex: 0, scratchX: 36, scratchY: 28, scale: 1, direction: 90, rotationStyle: 'normal', isDraggable: false, visible: true, spriteInfo: {} }; }; /***/ }), /***/ "./src/lib/error-boundary-hoc.jsx": /*!****************************************!*\ !*** ./src/lib/error-boundary-hoc.jsx ***! \****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _containers_error_boundary_jsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../containers/error-boundary.jsx */ "./src/containers/error-boundary.jsx"); /* * Higher Order Component to provide error boundary for wrapped component. * A curried function, call like errorHOC()(). * @param {string} action - Label for GA tracking of errors. * @returns {function} a function that accepts a component to wrap. */ var ErrorBoundaryHOC = function ErrorBoundaryHOC(action) { /** * The function to be called with a React component to wrap it. * @param {React.Component} WrappedComponent - Component to wrap with an error boundary. * @returns {React.Component} the component wrapped with an error boundary. */ return function (WrappedComponent) { var ErrorBoundaryWrapper = function ErrorBoundaryWrapper(props) { return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_containers_error_boundary_jsx__WEBPACK_IMPORTED_MODULE_1__["default"], { action: action }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(WrappedComponent, props)); }; return ErrorBoundaryWrapper; }; }; /* harmony default export */ __webpack_exports__["default"] = (ErrorBoundaryHOC); /***/ }), /***/ "./src/lib/file-uploader.js": /*!**********************************!*\ !*** ./src/lib/file-uploader.js ***! \**********************************/ /*! exports provided: handleFileUpload, costumeUpload, soundUpload, spriteUpload */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "handleFileUpload", function() { return handleFileUpload; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "costumeUpload", function() { return costumeUpload; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "soundUpload", function() { return soundUpload; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "spriteUpload", function() { return spriteUpload; }); /* harmony import */ var scratch_svg_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! scratch-svg-renderer */ "./node_modules/scratch-svg-renderer/src/index.js"); /* harmony import */ var scratch_svg_renderer__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(scratch_svg_renderer__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _log_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./log.js */ "./src/lib/log.js"); /* harmony import */ var _randomize_sprite_position_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./randomize-sprite-position.js */ "./src/lib/randomize-sprite-position.js"); /* harmony import */ var _gif_decoder__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./gif-decoder */ "./src/lib/gif-decoder.js"); /** * Extract the file name given a string of the form fileName + ext * @param {string} nameExt File name + extension (e.g. 'my_image.png') * @return {string} The name without the extension, or the full name if * there was no '.' in the string (e.g. 'my_image') */ var extractFileName = function extractFileName(nameExt) { // There could be multiple dots, but get the stuff before the first . var nameParts = nameExt.split('.', 1); // we only care about the first . return nameParts[0]; }; /** * Handle a file upload given the input element that contains the file, * and a function to handle loading the file. * @param {Input} fileInput The element that contains the file being loaded * @param {Function} onload The function that handles loading the file * @param {Function} onerror The function that handles any error loading the file */ var handleFileUpload = function handleFileUpload(fileInput, onload, onerror) { var readFile = function readFile(i, files) { if (i === files.length) { // Reset the file input value now that we have everything we need // so that the user can upload the same sound multiple times if // they choose fileInput.value = null; return; } var file = files[i]; var reader = new FileReader(); reader.onload = function () { var fileType = file.type; var fileName = extractFileName(file.name); onload(reader.result, fileType, fileName, i, files.length); readFile(i + 1, files); }; reader.onerror = onerror; reader.readAsArrayBuffer(file); }; readFile(0, fileInput.files); }; /** * @typedef VMAsset * @property {string} name The user-readable name of this asset - This will * automatically get translated to a fresh name if this one already exists in the * scope of this vm asset (e.g. if a sound already exists with the same name for * the same target) * @property {string} dataFormat The data format of this asset, typically * the extension to be used for that particular asset, e.g. 'svg' for vector images * @property {string} md5 The md5 hash of the asset data, followed by '.'' and dataFormat * @property {string} The md5 hash of the asset data // TODO remove duplication.... */ /** * Create an asset (costume, sound) with storage and return an object representation * of the asset to track in the VM. * @param {ScratchStorage} storage The storage to cache the asset in * @param {AssetType} assetType A ScratchStorage AssetType indicating what kind of * asset this is. * @param {string} dataFormat The format of this data (typically the file extension) * @param {UInt8Array} data The asset data buffer * @return {VMAsset} An object representing this asset and relevant information * which can be used to look up the data in storage */ var createVMAsset = function createVMAsset(storage, assetType, dataFormat, data) { var asset = storage.createAsset(assetType, dataFormat, data, null, true // generate md5 ); return { name: null, // Needs to be set by caller dataFormat: dataFormat, asset: asset, md5: "".concat(asset.assetId, ".").concat(dataFormat), assetId: asset.assetId }; }; /** * Handles loading a costume or a backdrop using the provided, context-relevant information. * @param {ArrayBuffer | string} fileData The costume data to load (this can be a base64 string * iff the image is a bitmap) * @param {string} fileType The MIME type of this file * @param {ScratchStorage} storage The ScratchStorage instance to cache the costume data * @param {Function} handleCostume The function to execute on the costume object returned after * caching this costume in storage - This function should be responsible for * adding the costume to the VM and handling other UI flow that should come after adding the costume * @param {Function} handleError The function to execute if there is an error parsing the costume */ var costumeUpload = function costumeUpload(fileData, fileType, storage, handleCostume) { var handleError = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : function () {}; var costumeFormat = null; var assetType = null; switch (fileType) { case 'image/svg+xml': { costumeFormat = storage.DataFormat.SVG; assetType = storage.AssetType.ImageVector; break; } case 'image/jpeg': { costumeFormat = storage.DataFormat.JPG; assetType = storage.AssetType.ImageBitmap; break; } case 'image/png': { costumeFormat = storage.DataFormat.PNG; assetType = storage.AssetType.ImageBitmap; break; } case 'image/gif': { var costumes = []; Object(_gif_decoder__WEBPACK_IMPORTED_MODULE_3__["default"])(fileData, function (frameNumber, dataUrl, numFrames) { costumeUpload(dataUrl, 'image/png', storage, function (costumes_) { costumes = costumes.concat(costumes_); if (frameNumber === numFrames - 1) { handleCostume(costumes); } }, handleError); }); return; // Abandon this load, do not try to load gif itself } default: handleError("Encountered unexpected file type: ".concat(fileType)); return; } var bitmapAdapter = new scratch_svg_renderer__WEBPACK_IMPORTED_MODULE_0__["BitmapAdapter"](); var addCostumeFromBuffer = function addCostumeFromBuffer(dataBuffer) { var vmCostume = createVMAsset(storage, assetType, costumeFormat, dataBuffer); handleCostume([vmCostume]); }; if (costumeFormat === storage.DataFormat.SVG) { // Must pass in file data as a Uint8Array, // passing in an array buffer causes the sprite/costume // thumbnails to not display because the data URI for the costume // is invalid addCostumeFromBuffer(new Uint8Array(fileData)); } else { // otherwise it's a bitmap bitmapAdapter.importBitmap(fileData, fileType).then(addCostumeFromBuffer).catch(handleError); } }; /** * Handles loading a sound using the provided, context-relevant information. * @param {ArrayBuffer} fileData The sound data to load * @param {string} fileType The MIME type of this file; This function will exit * early if the fileType is unexpected. * @param {ScratchStorage} storage The ScratchStorage instance to cache the sound data * @param {Function} handleSound The function to execute on the sound object of type VMAsset * This function should be responsible for adding the sound to the VM * as well as handling other UI flow that should come after adding the sound */ var soundUpload = function soundUpload(fileData, fileType, storage, handleSound) { var soundFormat; switch (fileType) { case 'audio/mp3': case 'audio/mpeg': { soundFormat = storage.DataFormat.MP3; break; } case 'audio/wav': case 'audio/wave': case 'audio/x-wav': case 'audio/x-pn-wav': { soundFormat = storage.DataFormat.WAV; break; } default: _log_js__WEBPACK_IMPORTED_MODULE_1__["default"].warn("Encountered unexpected file type: ".concat(fileType)); return; } var vmSound = createVMAsset(storage, storage.AssetType.Sound, soundFormat, new Uint8Array(fileData)); handleSound(vmSound); }; var spriteUpload = function spriteUpload(fileData, fileType, spriteName, storage, handleSprite) { var handleError = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : function () {}; switch (fileType) { case '': case 'application/zip': { // We think this is a .sprite2 or .sprite3 file handleSprite(new Uint8Array(fileData)); return; } case 'image/svg+xml': case 'image/png': case 'image/jpeg': case 'image/gif': { // Make a sprite from an image by making it a costume first costumeUpload(fileData, fileType, storage, function (vmCostumes) { vmCostumes.forEach(function (costume, i) { costume.name = "".concat(spriteName).concat(i ? i + 1 : ''); }); var newSprite = { name: spriteName, isStage: false, x: 0, // x/y will be randomized below y: 0, visible: true, size: 100, rotationStyle: 'all around', direction: 90, draggable: false, currentCostume: 0, blocks: {}, variables: {}, costumes: vmCostumes, sounds: [] // TODO are all of these necessary? }; Object(_randomize_sprite_position_js__WEBPACK_IMPORTED_MODULE_2__["default"])(newSprite); // TODO probably just want sprite upload to handle this object directly handleSprite(JSON.stringify(newSprite)); }, handleError); return; } default: { handleError("Encountered unexpected file type: ".concat(fileType)); return; } } }; /***/ }), /***/ "./src/lib/font-loader-hoc.jsx": /*!*************************************!*\ !*** ./src/lib/font-loader-hoc.jsx ***! \*************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontLoaderHOC; }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var lodash_omit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash.omit */ "./node_modules/lodash.omit/index.js"); /* harmony import */ var lodash_omit__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_omit__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _reducers_fonts_loaded__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../reducers/fonts-loaded */ "./src/reducers/fonts-loaded.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } // This list is from scratch-render-fonts: // https://github.com/LLK/scratch-render-fonts/blob/master/src/index.js#L4 var FONTS = ['Sans Serif', 'Serif', 'Handwriting', 'Marker', 'Curly', 'Pixel', 'Scratch']; /* Higher Order Component to provide behavior for loading fonts. * @param {React.Component} WrappedComponent component to receive fontsLoaded prop * @returns {React.Component} component with font loading behavior */ var FontLoaderHOC = function FontLoaderHOC(WrappedComponent) { var FontLoaderComponent = /*#__PURE__*/ function (_React$Component) { _inherits(FontLoaderComponent, _React$Component); function FontLoaderComponent() { _classCallCheck(this, FontLoaderComponent); return _possibleConstructorReturn(this, _getPrototypeOf(FontLoaderComponent).apply(this, arguments)); } _createClass(FontLoaderComponent, [{ key: "componentDidMount", value: function componentDidMount() { var _this = this; if (this.props.fontsLoaded) return; var getFontPromises = function getFontPromises() { var fontPromises = []; // Browsers that support the font loader interface have an iterable document.fonts.values() // Firefox has a mocked out object that doesn't actually implement iterable, which is why // the deep safety check is necessary. if (document.fonts && typeof document.fonts.values === 'function' && typeof document.fonts.values()[Symbol.iterator] === 'function') { var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = document.fonts.values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var fontFace = _step.value; // Only load fonts from this list. If we load all fonts on the document, we may block on // loading fonts from things like chrome extensions. if (FONTS.indexOf(fontFace.family) !== -1) { fontPromises.push(fontFace.loaded); fontFace.load(); } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } } return fontPromises; }; // Font promises must be gathered after the document is loaded, because on Mac Chrome, the promise // objects get replaced and the old ones never resolve. if (document.readyState === 'complete') { Promise.all(getFontPromises()).then(function () { _this.props.onSetFontsLoaded(); }); } else { document.onreadystatechange = function () { if (document.readyState !== 'complete') return; document.onreadystatechange = null; Promise.all(getFontPromises()).then(function () { _this.props.onSetFontsLoaded(); }); }; } } }, { key: "render", value: function render() { var componentProps = lodash_omit__WEBPACK_IMPORTED_MODULE_2___default()(this.props, ['onSetFontsLoaded']); return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(WrappedComponent, componentProps); } }]); return FontLoaderComponent; }(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component); FontLoaderComponent.propTypes = { fontsLoaded: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool.isRequired, onSetFontsLoaded: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired }; var mapStateToProps = function mapStateToProps(state) { return { fontsLoaded: state.scratchGui.fontsLoaded }; }; var mapDispatchToProps = function mapDispatchToProps(dispatch) { return { onSetFontsLoaded: function onSetFontsLoaded() { return dispatch(Object(_reducers_fonts_loaded__WEBPACK_IMPORTED_MODULE_4__["setFontsLoaded"])()); } }; }; return Object(react_redux__WEBPACK_IMPORTED_MODULE_3__["connect"])(mapStateToProps, mapDispatchToProps)(FontLoaderComponent); }; /***/ }), /***/ "./src/lib/get-costume-url.js": /*!************************************!*\ !*** ./src/lib/get-costume-url.js ***! \************************************/ /*! exports provided: default, HAS_FONT_REGEXP */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getCostumeUrl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HAS_FONT_REGEXP", function() { return HAS_FONT_REGEXP; }); /* harmony import */ var _storage__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./storage */ "./src/lib/storage.js"); /* harmony import */ var scratch_svg_renderer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! scratch-svg-renderer */ "./node_modules/scratch-svg-renderer/src/index.js"); /* harmony import */ var scratch_svg_renderer__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(scratch_svg_renderer__WEBPACK_IMPORTED_MODULE_1__); // Contains 'font-family', but doesn't only contain 'font-family="none"' var HAS_FONT_REGEXP = 'font-family(?!="none")'; var getCostumeUrl = function () { var cachedAssetId; var cachedUrl; return function (asset) { if (cachedAssetId === asset.assetId) { return cachedUrl; } cachedAssetId = asset.assetId; // If the SVG refers to fonts, they must be inlined in order to display correctly in the img tag. // Avoid parsing the SVG when possible, since it's expensive. if (asset.assetType === _storage__WEBPACK_IMPORTED_MODULE_0__["default"].AssetType.ImageVector) { var svgString = asset.decodeText(); if (svgString.match(HAS_FONT_REGEXP)) { var svgText = Object(scratch_svg_renderer__WEBPACK_IMPORTED_MODULE_1__["inlineSvgFonts"])(svgString); cachedUrl = "data:image/svg+xml;utf8,".concat(encodeURIComponent(svgText)); } else { cachedUrl = asset.encodeDataURI(); } } else { cachedUrl = asset.encodeDataURI(); } return cachedUrl; }; }(); /***/ }), /***/ "./src/lib/gif-decoder.js": /*!********************************!*\ !*** ./src/lib/gif-decoder.js ***! \********************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var omggif__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! omggif */ "./node_modules/omggif/omggif.js"); /* harmony import */ var omggif__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(omggif__WEBPACK_IMPORTED_MODULE_0__); /* harmony default export */ __webpack_exports__["default"] = (function (arrayBuffer, onFrame) { var canvas = document.createElement('canvas'); var ctx = canvas.getContext('2d'); var gifReader = new omggif__WEBPACK_IMPORTED_MODULE_0__["GifReader"](new Uint8Array(arrayBuffer)); var numFrames = gifReader.numFrames(); canvas.width = gifReader.width; canvas.height = gifReader.height; var imageData = ctx.createImageData(canvas.width, canvas.height); var previousData = ctx.createImageData(canvas.width, canvas.height); var loadFrame = function loadFrame(i) { var framePixels = []; gifReader.decodeAndBlitFrameRGBA(i, framePixels); var _gifReader$frameInfo = gifReader.frameInfo(i), x = _gifReader$frameInfo.x, y = _gifReader$frameInfo.y, width = _gifReader$frameInfo.width, height = _gifReader$frameInfo.height, disposal = _gifReader$frameInfo.disposal; for (var row = 0; row < height; row++) { for (var column = 0; column < width; column++) { var indexOffset = 4 * (x + y * canvas.width); var j = indexOffset + 4 * (column + row * canvas.width); if (framePixels[j + 3]) { imageData.data[j + 0] = framePixels[j + 0]; imageData.data[j + 1] = framePixels[j + 1]; imageData.data[j + 2] = framePixels[j + 2]; imageData.data[j + 3] = framePixels[j + 3]; } } } ctx.clearRect(0, 0, canvas.width, canvas.height); ctx.putImageData(imageData, 0, 0); var dataUrl = canvas.toDataURL(); switch (disposal) { case 2: // "Return to background", blank out the current frame ctx.clearRect(x, y, width, height); imageData = ctx.getImageData(0, 0, canvas.width, canvas.height); break; case 3: // "Restore to previous", copy previous data to current imageData = ctx.createImageData(canvas.width, canvas.height); imageData.data.set(previousData.data); break; default: // 0 and 1, as well as 4+ modes = do-not-dispose, so cache frame previousData = ctx.getImageData(0, 0, canvas.width, canvas.height); break; } onFrame(i, dataUrl, numFrames); if (i < numFrames - 1) { setTimeout(function () { loadFrame(i + 1); }); } }; loadFrame(0); }); /***/ }), /***/ "./src/lib/hash-parser-hoc.jsx": /*!*************************************!*\ !*** ./src/lib/hash-parser-hoc.jsx ***! \*************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HashParserHOC; }); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _reducers_project_state__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../reducers/project-state */ "./src/reducers/project-state.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } /* Higher Order Component to get the project id from location.hash * @param {React.Component} WrappedComponent: component to render * @returns {React.Component} component with hash parsing behavior */ var HashParserHOC = function HashParserHOC(WrappedComponent) { var HashParserComponent = /*#__PURE__*/ function (_React$Component) { _inherits(HashParserComponent, _React$Component); function HashParserComponent(props) { var _this; _classCallCheck(this, HashParserComponent); _this = _possibleConstructorReturn(this, _getPrototypeOf(HashParserComponent).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['handleHashChange']); return _this; } _createClass(HashParserComponent, [{ key: "componentDidMount", value: function componentDidMount() { window.addEventListener('hashchange', this.handleHashChange); this.handleHashChange(); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { // if we are newly fetching a non-hash project... if (this.props.isFetchingWithoutId && !prevProps.isFetchingWithoutId) { // ...clear the hash from the url history.pushState('new-project', 'new-project', window.location.pathname + window.location.search); } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { window.removeEventListener('hashchange', this.handleHashChange); } }, { key: "handleHashChange", value: function handleHashChange() { var hashMatch = window.location.hash.match(/#(\d+)/); var hashProjectId = hashMatch === null ? _reducers_project_state__WEBPACK_IMPORTED_MODULE_4__["defaultProjectId"] : hashMatch[1]; this.props.setProjectId(hashProjectId.toString()); } }, { key: "render", value: function render() { var _this$props = this.props, isFetchingWithoutIdProp = _this$props.isFetchingWithoutId, reduxProjectId = _this$props.reduxProjectId, setProjectIdProp = _this$props.setProjectId, componentProps = _objectWithoutProperties(_this$props, ["isFetchingWithoutId", "reduxProjectId", "setProjectId"]); return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(WrappedComponent, componentProps); } }]); return HashParserComponent; }(react__WEBPACK_IMPORTED_MODULE_1___default.a.Component); HashParserComponent.propTypes = { isFetchingWithoutId: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, reduxProjectId: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number]), setProjectId: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func }; var mapStateToProps = function mapStateToProps(state) { var loadingState = state.scratchGui.projectState.loadingState; return { isFetchingWithoutId: Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_4__["getIsFetchingWithoutId"])(loadingState), reduxProjectId: state.scratchGui.projectState.projectId }; }; var mapDispatchToProps = function mapDispatchToProps(dispatch) { return { setProjectId: function setProjectId(projectId) { dispatch(Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_4__["setProjectId"])(projectId)); } }; }; // Allow incoming props to override redux-provided props. Used to mock in tests. var mergeProps = function mergeProps(stateProps, dispatchProps, ownProps) { return Object.assign({}, stateProps, dispatchProps, ownProps); }; return Object(react_redux__WEBPACK_IMPORTED_MODULE_3__["connect"])(mapStateToProps, mapDispatchToProps, mergeProps)(HashParserComponent); }; /***/ }), /***/ "./src/lib/import-csv.js": /*!*******************************!*\ !*** ./src/lib/import-csv.js ***! \*******************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var papaparse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! papaparse */ "./node_modules/papaparse/papaparse.min.js"); /* harmony import */ var papaparse__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(papaparse__WEBPACK_IMPORTED_MODULE_0__); /* harmony default export */ __webpack_exports__["default"] = (function () { return new Promise(function (resolve, reject) { var fileInput = document.createElement('input'); fileInput.setAttribute('type', 'file'); fileInput.setAttribute('accept', '.csv, .tsv, .txt'); // parser auto-detects delimiter fileInput.onchange = function (e) { var file = e.target.files[0]; papaparse__WEBPACK_IMPORTED_MODULE_0___default.a.parse(file, { header: false, complete: function complete(results) { document.body.removeChild(fileInput); resolve(results.data); }, error: function error(err) { document.body.removeChild(fileInput); reject(err); } }); }; document.body.appendChild(fileInput); fileInput.click(); }); }); /***/ }), /***/ "./src/lib/isScratchDesktop.js": /*!*************************************!*\ !*** ./src/lib/isScratchDesktop.js ***! \*************************************/ /*! exports provided: default, isScratchDesktop, notScratchDesktop, setIsScratchDesktop */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isScratchDesktop", function() { return isScratchDesktop; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "notScratchDesktop", function() { return notScratchDesktop; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setIsScratchDesktop", function() { return setIsScratchDesktop; }); /** * Internal stored state. Not valid until after at least one call to `setIsScratchDesktop()`. * @type {boolean} */ var _isScratchDesktop; // undefined = not ready yet /** * Tell the `isScratchDesktop()` whether or not the GUI is running under Scratch Desktop. * @param {boolean} value - the new value which `isScratchDesktop()` should return in the future. */ var setIsScratchDesktop = function setIsScratchDesktop(value) { _isScratchDesktop = value; }; /** * @returns {boolean} - true if it seems like the GUI is running under Scratch Desktop; false otherwise. * If `setIsScratchDesktop()` has not yet been called, this can return `undefined`. */ var isScratchDesktop = function isScratchDesktop() { return _isScratchDesktop; }; /** * @returns {boolean} - false if it seems like the GUI is running under Scratch Desktop; true otherwise. */ var notScratchDesktop = function notScratchDesktop() { return !isScratchDesktop(); }; /* harmony default export */ __webpack_exports__["default"] = (isScratchDesktop); /***/ }), /***/ "./src/lib/layout-constants.js": /*!*************************************!*\ !*** ./src/lib/layout-constants.js ***! \*************************************/ /*! exports provided: default, STAGE_DISPLAY_SCALES, STAGE_DISPLAY_SIZES, STAGE_SIZE_MODES */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "STAGE_DISPLAY_SCALES", function() { return STAGE_DISPLAY_SCALES; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "STAGE_DISPLAY_SIZES", function() { return STAGE_DISPLAY_SIZES; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "STAGE_SIZE_MODES", function() { return STAGE_SIZE_MODES; }); /* harmony import */ var keymirror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! keymirror */ "./node_modules/keymirror/index.js"); /* harmony import */ var keymirror__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(keymirror__WEBPACK_IMPORTED_MODULE_0__); /** * Names for each state of the stage size toggle * @enum {string} */ var STAGE_SIZE_MODES = keymirror__WEBPACK_IMPORTED_MODULE_0___default()({ /** * The "large stage" button is pressed; the user would like a large stage. */ large: null, /** * The "small stage" button is pressed; the user would like a small stage. */ small: null }); /** * Names for each stage render size * @enum {string} */ var STAGE_DISPLAY_SIZES = keymirror__WEBPACK_IMPORTED_MODULE_0___default()({ /** * Large stage with wide browser */ large: null, /** * Large stage with narrow browser */ largeConstrained: null, /** * Small stage (ignores browser width) */ small: null }); var STAGE_DISPLAY_SCALES = {}; STAGE_DISPLAY_SCALES[STAGE_DISPLAY_SIZES.large] = 1; // large mode, wide browser (standard) STAGE_DISPLAY_SCALES[STAGE_DISPLAY_SIZES.largeConstrained] = 0.85; // large mode but narrow browser STAGE_DISPLAY_SCALES[STAGE_DISPLAY_SIZES.small] = 0.5; // small mode, regardless of browser size /* harmony default export */ __webpack_exports__["default"] = ({ standardStageWidth: 480, standardStageHeight: 360, fullSizeMinWidth: 1096, fullSizePaintMinWidth: 1250 }); /***/ }), /***/ "./src/lib/libraries/backdrop-tags.js": /*!********************************************!*\ !*** ./src/lib/libraries/backdrop-tags.js ***! \********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./tag-messages.js */ "./src/lib/libraries/tag-messages.js"); /* harmony default export */ __webpack_exports__["default"] = ([{ tag: 'fantasy', intlLabel: _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__["default"].fantasy }, { tag: 'music', intlLabel: _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__["default"].music }, { tag: 'sports', intlLabel: _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__["default"].sports }, { tag: 'outdoors', intlLabel: _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__["default"].outdoors }, { tag: 'indoors', intlLabel: _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__["default"].indoors }, { tag: 'space', intlLabel: _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__["default"].space }, { tag: 'underwater', intlLabel: _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__["default"].underwater }, { tag: 'patterns', intlLabel: _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__["default"].patterns }]); /***/ }), /***/ "./src/lib/libraries/backdrops.json": /*!******************************************!*\ !*** ./src/lib/libraries/backdrops.json ***! \******************************************/ /*! exports provided: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, default */ /***/ (function(module) { module.exports = [{"name":"Arctic","md5":"67e0db3305b3c8bac3a363b1c428892e.png","type":"backdrop","tags":["outdoors","cold","north pole","south pole","ice","antarctica","robert hunter"],"info":[960,720,2]},{"name":"Baseball 1","md5":"825d9b54682c406215d9d1f98a819449.svg","type":"backdrop","tags":["baseball","sports","outdoors","alex eben meyer"],"info":[480,360,1]},{"name":"Baseball 2","md5":"7be1f5b3e682813dac1f297e52ff7dca.svg","type":"backdrop","tags":["baseball","sports","outdoors","alex eben meyer"],"info":[480,360,1]},{"name":"Basketball 1","md5":"e494c4f44897d94e0541f7036a302449.svg","type":"backdrop","tags":["sports","outdoors","basketball","alex eben meyer"],"info":[480,360,1]},{"name":"Basketball 2","md5":"a5865738283613a2725b2c9dda6d8c78.png","type":"backdrop","tags":["outdoors","sports","basketball"],"info":[960,720,2]},{"name":"Beach Malibu","md5":"050615fe992a00d6af0e664e497ebf53.png","type":"backdrop","tags":["outdoors"],"info":[960,720,2]},{"name":"Beach Rio","md5":"968f0ede6e70e1dbb763d6fd4c5003e0.png","type":"backdrop","tags":["outdoors"],"info":[960,720,2]},{"name":"Bedroom 1","md5":"7aa6bbb2ddc4c10f901e1a50aeac1c7e.png","type":"backdrop","tags":["bedroom","indoors"],"info":[960,720,2]},{"name":"Bedroom 2","md5":"e2f8b0dbd0a65d2ad8bfc21616662a6a.png","type":"backdrop","tags":["indoors"],"info":[960,720,2]},{"name":"Bedroom 3","md5":"8cc0b88d53345b3e337e8f028a32a4e7.png","type":"backdrop","tags":["indoors"],"info":[960,720,2]},{"name":"Bench With View","md5":"962201a2b712a302fb087f8f0dcb2076.png","type":"backdrop","tags":["outdoors","hill","view"],"info":[960,720,2]},{"name":"Blue Sky","md5":"e7c147730f19d284bcd7b3f00af19bb6.svg","type":"backdrop","tags":["outdoors","flying"],"info":[480,360,1]},{"name":"Blue Sky 2 ","md5":"5a906c2f272b77f59f0ef207857a8b3a.svg","type":"backdrop","tags":["outdoors","flying"],"info":[480,360,1]},{"name":"Boardwalk","md5":"de0e54cd11551566f044e7e6bc588b2c.png","type":"backdrop","tags":["outdoors","ocean"],"info":[960,720,2]},{"name":"Canyon","md5":"c7c0b27b959193a0b570a9639cfe8158.png","type":"backdrop","tags":["outdoors","nature"],"info":[960,720,2]},{"name":"Castle 1","md5":"e1914ed7917267f1c2ef2b48004cade9.png","type":"backdrop","tags":["fantasy"],"info":[960,720,2]},{"name":"Castle 2","md5":"951765ee7f7370f120c9df20b577c22f.png","type":"backdrop","tags":["fantasy"],"info":[960,720,2]},{"name":"Castle 3","md5":"76fa99f67569fcd39b4be74ed38c33f3.png","type":"backdrop","tags":["fantasy"],"info":[960,720,2]},{"name":"Castle 4","md5":"4f45f79af8e8dac3d41eb5a06ade61d4.png","type":"backdrop","tags":["fantasy"],"info":[960,720,2]},{"name":"Chalkboard","md5":"a8a24b5aa717bbef09dbe31368914427.png","type":"backdrop","tags":["indoors","school"],"info":[960,720,2]},{"name":"Circles","md5":"4e29033ec2b891a8f1ca21242811d403.svg","type":"backdrop","tags":["patterns"],"info":[480,360,1]},{"name":"City With Water","md5":"1ef98019fc94ea65a1b55d5521285c7a.png","type":"backdrop","tags":["outdoors","boston"],"info":[960,720,2]},{"name":"Colorful City","md5":"04d18ddd1b85f0ea30beb14b8da49f60.png","type":"backdrop","tags":["city","town","road","skyline","outdoors"],"info":[960,720,2]},{"name":"Concert","md5":"c8d90320d2966c08af8cdd1c6a7a93b5.png","type":"backdrop","tags":["indoors","music","andrew rae"],"info":[960,720,2]},{"name":"Desert","md5":"d98a9526a34890cf4bad11b5409eae2a.png","type":"backdrop","tags":["desert"," landscape"," outdoors"," cacti"],"info":[960,720,2]},{"name":"Farm","md5":"1e8a70bd07f1dcba3383883f3b948266.png","type":"backdrop","tags":["outdoors","chicken","barn","coup","owen davey"],"info":[960,720,2]},{"name":"Field At Mit","md5":"5b0a970202b464915915260c03f05455.png","type":"backdrop","tags":["outdoors","architecture"],"info":[960,720,2]},{"name":"Flowers","md5":"25a6ede51a96d4e55de2ffb81ae96f8c.png","type":"backdrop","tags":["outdoors","nature"],"info":[960,720,2]},{"name":"Forest","md5":"92968ac16b2f0c3f7835a6dacd172c7b.png","type":"backdrop","tags":["outdoors","forest"],"info":[960,720,2]},{"name":"Galaxy","md5":"5fab1922f254ae9fd150162c3e392bef.png","type":"backdrop","tags":["space","stars","nasa"],"info":[960,720,2]},{"name":"Garden-rock","md5":"4f66053598bea0905e1559ab9d5a6e31.png","type":"backdrop","tags":["outdoors"," garden"," park"],"info":[960,720,2]},{"name":"Greek Theater","md5":"93d71e8b8a96cc007b8d68f36acd338a.png","type":"backdrop","tags":["outdoors","theatre"],"info":[960,720,2]},{"name":"Hall","md5":"ea86ca30b346f27ca5faf1254f6a31e3.png","type":"backdrop","tags":["indoors"],"info":[960,720,2]},{"name":"Hay Field","md5":"da102a69d135973e0fc139131dec785a.png","type":"backdrop","tags":["outdoors","farm"],"info":[960,720,2]},{"name":"Hearts","md5":"26d3418b2fbc1af2c5fea82e1c3df1db.svg","type":"backdrop","tags":["patterns"],"info":[480,360,1]},{"name":"Hill","md5":"2129c842f28d6881f622fdc3497ff2da.png","type":"backdrop","tags":["outdoors","nature"],"info":[960,720,2]},{"name":"Jungle","md5":"f4f908da19e2753f3ed679d7b37650ca.png","type":"backdrop","tags":["outdoors","forest","robert hunter"],"info":[960,720,2]},{"name":"Jurassic","md5":"64025bdca5db4938f65597e3682fddcf.svg","type":"backdrop","tags":["outdoors","dinosaur","alex eben meyer"],"info":[480,360,1]},{"name":"Light","md5":"4b98c07876ed8997c3762e75790507b4.svg","type":"backdrop","tags":["patterns"],"info":[480,360,1]},{"name":"Metro","md5":"0b4a15ba028bf205ec051390d6ac4de7.png","type":"backdrop","tags":["outdoors","city","urban"],"info":[960,720,2]},{"name":"Moon","md5":"0b1d2eaf22d62ef88de80ccde5578fba.png","type":"backdrop","tags":["space","nasa","apollo"],"info":[960,720,2]},{"name":"Mountain","md5":"f84989feee2cf462a1c597169777ee3c.png","type":"backdrop","tags":["outdoors","snow","cave","robert hunter"],"info":[960,720,2]},{"name":"Mural","md5":"efb625f7e0b199b15f69e116cd053cea.png","type":"backdrop","tags":["outdoors","mural","graffiti","street","art"],"info":[960,720,2]},{"name":"Nebula","md5":"9b5cdbd596da1b6149f56b794b6394f4.png","type":"backdrop","tags":["space","nasa","bubble","hubble"],"info":[960,720,2]},{"name":"Neon Tunnel","md5":"57d2b13b2f73d3d878c72810c137b0d6.png","type":"backdrop","tags":["games","game","space"],"info":[960,720,2]},{"name":"Night City","md5":"6fdc795ff487204f72740567be5f64f9.png","type":"backdrop","tags":["outdoors","urban","city","metro"],"info":[960,720,2]},{"name":"Night City With Street","md5":"14443ad7907b6479d7562a12b8ae0efb.png","type":"backdrop","tags":["urban","city","metro","transportation"],"info":[960,720,2]},{"name":"Party","md5":"108160d0e44d1c340182e31c9dc0758a.svg","type":"backdrop","tags":["indoors","inflatable"],"info":[480,360,1]},{"name":"Pathway","md5":"5d747ec036755a4b129f0d5b978bc61c.png","type":"backdrop","tags":["outdoors","garden"],"info":[960,720,2]},{"name":"Playground","md5":"e5f794c8756ca0cead5cb7e7fe354c41.png","type":"backdrop","tags":["outdoors","play"],"info":[960,720,2]},{"name":"Playing Field","md5":"2de108f3098e92f5c5976cf75d38e99d.png","type":"backdrop","tags":["outdoors","sports"],"info":[960,720,2]},{"name":"Pool","md5":"6cab934df643d2fc508cfa90c0c4059b.png","type":"backdrop","tags":["outdoors","sports","swim","swimming"],"info":[960,720,2]},{"name":"Rays","md5":"87e963282db9e020e8c4d075891ea12b.svg","type":"backdrop","tags":["patterns","raimondious"],"info":[480,360,1]},{"name":"Refrigerator","md5":"98f053f9681e872f34fafd783ce72205.svg","type":"backdrop","tags":["food","indoors","alex eben meyer"],"info":[480,360,1]},{"name":"Room 1","md5":"a81668321aa3dcc0fc185d3e36ae76f6.png","type":"backdrop","tags":["indoors","books","library"],"info":[960,720,2]},{"name":"Room 2","md5":"05ae3e3bbea890a6e3552ffe8456775e.png","type":"backdrop","tags":["indoors"],"info":[960,720,2]},{"name":"Savanna","md5":"9b020b8c7cb6a9592f7303add9441d8f.png","type":"backdrop","tags":["africa","savanna","savanah","outdoors","robert hunter"],"info":[960,720,2]},{"name":"School","md5":"1dea69ac0f62cf538d368a7bde1372ac.png","type":"backdrop","tags":["outdoors","building","education","learning"],"info":[960,720,2]},{"name":"Slopes","md5":"63b6a69594a0a87888b56244bfa2ac1b.png","type":"backdrop","tags":["outdoors","winter","ski","snowboard","cold","snow"],"info":[960,720,2]},{"name":"Soccer","md5":"04a63154f04b09494354090f7cc2f1b9.png","type":"backdrop","tags":["soccer","football","sports","alex eben meyer"],"info":[960,720,2]},{"name":"Soccer 2","md5":"b0dc1268cb595aaeef405bce40d1639c.png","type":"backdrop","tags":["soccer","football","sports","alex eben meyer"],"info":[960,720,2]},{"name":"Space","md5":"84208d9a3718ec3c9fc5a32a792fa1d0.png","type":"backdrop","tags":["space","moon","science fiction","planet","wren mcdonald"],"info":[960,720,2]},{"name":"Space City 1","md5":"20344b0edcc498281e4cb80242a72667.png","type":"backdrop","tags":["space","moon","science fiction","planet","wren mcdonald"],"info":[960,720,2]},{"name":"Space City 2","md5":"32b2316fd375faa18088f6c57ebb1c8d.png","type":"backdrop","tags":["space","moon","science fiction","planet","wren mcdonald"],"info":[960,720,2]},{"name":"Spaceship","md5":"0c450891306fa63ef02aa0fda7fd0ef9.png","type":"backdrop","tags":["space","moon","science fiction","planet","wren mcdonald"],"info":[960,720,2]},{"name":"Spotlight","md5":"d26bf4c3980163d9106625cc2ea6c50d.png","type":"backdrop","tags":["music","dance"],"info":[960,720,2]},{"name":"Stars","md5":"47282ff0f7047c6fab9c94b531abf721.png","type":"backdrop","tags":["space","nasa"],"info":[960,720,2]},{"name":"Stripes","md5":"a6a21f5c08d586e8daaebde37c97fb6f.svg","type":"backdrop","tags":["patterns"],"info":[480,360,1]},{"name":"Theater","md5":"c2b097bc5cdb6a14ef5485202bc5ee76.png","type":"backdrop","tags":["indoors","music","andrew rae"],"info":[960,720,2]},{"name":"Theater 2","md5":"061a78ed83495dd0acd6d62e83e1b972.png","type":"backdrop","tags":["music"],"info":[960,720,2]},{"name":"Tree","md5":"a23fbf972001c94637b568992f8fd7bd.png","type":"backdrop","tags":["outdoors","nature"],"info":[960,720,2]},{"name":"Underwater 1","md5":"fb907f72b310acc8b95cbf2d2cccabc9.svg","type":"backdrop","tags":["ocean","outdoors","underwater","ipzy"],"info":[480,360,1]},{"name":"Underwater 2","md5":"1517c21786d2d0edc2f3037408d850bd.png","type":"backdrop","tags":["outdoors","nature","underwater"],"info":[960,720,2]},{"name":"Urban","md5":"1679049718869e1f548e1e8823e29c1c.png","type":"backdrop","tags":["outdoors","city","metro","transportation"],"info":[960,720,2]},{"name":"Wall 1","md5":"7e5327c68ff6ddabc48dbfe4717a04fe.png","type":"backdrop","tags":["outdoors","brick"],"info":[960,720,2]},{"name":"Wall 2","md5":"82d867fcd9f1b5f49e29c2f853d55665.png","type":"backdrop","tags":["outdoors","brick"],"info":[960,720,2]},{"name":"Water And Rocks","md5":"0015433a406a53f00b792424b823268c.png","type":"backdrop","tags":["outdoors","nature","tree","river","stream"],"info":[960,720,2]},{"name":"Wetland","md5":"ef9973bcff6d4cbc558e946028ec7d23.png","type":"backdrop","tags":["outdoor","nature","swamp","wetland","owen davey"],"info":[960,720,2]},{"name":"Winter","md5":"5fa9385a60b904672d0e46e9d768bb32.svg","type":"backdrop","tags":["outdoors","trees","forest","winter"],"info":[480,360,1]},{"name":"Witch House","md5":"597b9a9813fe5d8d387283138a0b8f2b.svg","type":"backdrop","tags":["fantasy","indoors","ipzy"],"info":[480,360,1]},{"name":"Woods","md5":"d26cfd278999c9e37d6af75c296a58df.svg","type":"backdrop","tags":["fantasy","spooky","halloween","outdoors","haunted","forest","alex eben meyer"],"info":[480,360,1]},{"name":"Woods And Bench","md5":"4fcf7ed0de6c6b6e9b52c511b0650e9c.png","type":"backdrop","tags":["outdoors","park"],"info":[960,720,2]},{"name":"Xy-grid","md5":"9838d02002d05f88dc54d96494fbc202.png","type":"backdrop","tags":["grid","xy","coordinates"],"info":[960,720,2]},{"name":"Xy-grid-20px","md5":"4eec0e1db92b8dea3e5bee25105e8f46.png","type":"backdrop","tags":["grid","xy","coordinates"],"info":[960,720,2]},{"name":"Xy-grid-30px","md5":"3b8bcabd0ac683b7cb3673208039764b.png","type":"backdrop","tags":["grid","xy","coordinates"],"info":[960,720,2]}]; /***/ }), /***/ "./src/lib/libraries/costumes.json": /*!*****************************************!*\ !*** ./src/lib/libraries/costumes.json ***! \*****************************************/ /*! exports provided: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, default */ /***/ (function(module) { module.exports = [{"name":"Abby-a","md5":"afab2d2141e9811bd89e385e9628cb5f.svg","type":"costume","tags":["people","person","drawing"],"info":[31,100,1]},{"name":"Abby-b","md5":"1e0116c7c2e5e80c679d0b33f1f5cfb7.svg","type":"costume","tags":["people","person","drawing"],"info":[31,100,1]},{"name":"Abby-c","md5":"b6e23922f23b49ddc6f62f675e77417c.svg","type":"costume","tags":["people","person","drawing"],"info":[32,100,1]},{"name":"Abby-d","md5":"2d05d4da65e7b5009a491d8153d37253.svg","type":"costume","tags":["people","person","drawing"],"info":[32,101,1]},{"name":"Amon","md5":"60f720956ab1840431dcf0616ce98f14.png","type":"costume","tags":["people","dance"],"info":[348,324,2]},{"name":"Andie-a","md5":"419ff5a76adbb4b076c072f68267fdeb.svg","type":"costume","tags":["sports","basketball","people","wheelchair","handicap","handicapable","alex eben meyer"],"info":[86,81,1]},{"name":"Andie-b","md5":"a6a766912b4e43064ee3f389c72925b4.svg","type":"costume","tags":["sports","basketball","people","wheelchair","handicap","handicapable","alex eben meyer"],"info":[46,106,1]},{"name":"Andie-c","md5":"fac1025857d2c28391cb31f39a80df54.svg","type":"costume","tags":["sports","basketball","people","wheelchair","handicap","handicapable","alex eben meyer"],"info":[52,65,1]},{"name":"Andie-d","md5":"7af50835e05d43e5e07cd2d641e7401e.svg","type":"costume","tags":["sports","basketball","people","wheelchair","handicap","handicapable","alex eben meyer"],"info":[87,72,1]},{"name":"Anina Pop Down","md5":"e3698b76cb0864df2fbaba80e6bd8067.png","type":"costume","tags":["people","dance"],"info":[148,312,2]},{"name":"Anina Pop Front","md5":"4931a363e3e4efa20230f6ff2991c6b4.png","type":"costume","tags":["people","dance"],"info":[136,540,2]},{"name":"Anina Pop L Arm","md5":"62c50c90535b64f2ae130a5c680ddcb4.png","type":"costume","tags":["people","dance"],"info":[136,548,2]},{"name":"Anina Pop Left","md5":"d86bb27b4f8d7b70c39c96f29c6943b4.png","type":"costume","tags":["people","dance"],"info":[476,532,2]},{"name":"Anina Pop R Arm","md5":"ca27e001a263ee6b5852508f39d021db.png","type":"costume","tags":["people","dance"],"info":[176,544,2]},{"name":"Anina Pop Right","md5":"7bb9c790b02231e1272701167c26b17a.png","type":"costume","tags":["people","dance"],"info":[132,536,2]},{"name":"Anina Pop Stand","md5":"105f4f3d260dcb8bea02ea9ee5d18cf4.png","type":"costume","tags":["people","dance"],"info":[152,552,2]},{"name":"Anina R Cross","md5":"3948aad16f8169c013c956dd152a09a6.png","type":"costume","tags":["people","dance"],"info":[252,536,2]},{"name":"Anina Stance","md5":"84c5e22b4303c7c1fb707125706c9aaa.png","type":"costume","tags":["people","dance"],"info":[152,504,2]},{"name":"Anina Top Freeze","md5":"b7693bd6250d4411ee622b67f8025924.png","type":"costume","tags":["people","dance"],"info":[220,536,2]},{"name":"Anina Top L Step","md5":"ed90e8b7a05c1552194af597ac0637cd.png","type":"costume","tags":["people","dance"],"info":[456,548,2]},{"name":"Anina Top R Step","md5":"2d208a34e74fdce9dab9d4c585dcfa2b.png","type":"costume","tags":["people","dance"],"info":[496,544,2]},{"name":"Anina Top Stand","md5":"db6c03113f71b91f22a9f3351f90e5bf.png","type":"costume","tags":["people","dance"],"info":[148,560,2]},{"name":"Apple","md5":"831ccd4741a7a56d85f6698a21f4ca69.svg","type":"costume","tags":["food","red","crunchy","fruit"],"info":[31,31,1]},{"name":"Arrow1-a","md5":"62f8794dd120e9b4ead4d098d50fc64b.svg","type":"costume","tags":["icons","symbols","right"],"info":[28,23,1]},{"name":"Arrow1-b","md5":"a157dc7e33d7c7a048af933de999e397.svg","type":"costume","tags":["icons","symbols","left"],"info":[28,23,1]},{"name":"Arrow1-c","md5":"d3b389e91f7beb22b2b1a80af09990ee.svg","type":"costume","tags":["icons","symbols","down"],"info":[23,28,1]},{"name":"Arrow1-d","md5":"412717ff731e9f19003a5840054057eb.svg","type":"costume","tags":["icons","symbols","up"],"info":[23,28,1]},{"name":"Avery Walking-a","md5":"ed334e546806dfbf26d2591d7ddb12d0.svg","type":"costume","tags":["people","walking"],"info":[50,95,1]},{"name":"Avery Walking-b","md5":"c295731e8666ad2e1575fb4b4f82988d.svg","type":"costume","tags":["people","walking"],"info":[50,102,1]},{"name":"Avery Walking-c","md5":"597a834225c9949e419dff7db1bc2453.svg","type":"costume","tags":["people","walking"],"info":[48,95,1]},{"name":"Avery Walking-d","md5":"ce9622d11d24607eec7988196b38c3c6.svg","type":"costume","tags":["people","walking"],"info":[50,101,1]},{"name":"Avery-a","md5":"21393c9114c7d34b1df7ccd12c793672.svg","type":"costume","tags":["people"],"info":[39,94,1]},{"name":"Avery-b","md5":"cc55f2f09599edc4ae0876e8b3d187d0.svg","type":"costume","tags":["people"],"info":[39,94,1]},{"name":"Ball-a","md5":"10117ddaefa98d819f2b1df93805622f.svg","type":"costume","tags":["round","game","bounce","circle","yellow","things"],"info":[22,22,1]},{"name":"Ball-b","md5":"6e6330cad7750ea7e9dc88402661deb8.svg","type":"costume","tags":["round","game","bounce","circle","blue","things"],"info":[22,22,1]},{"name":"Ball-c","md5":"bb45ed5db278f15c17c012c34a6b160f.svg","type":"costume","tags":["round","game","bounce","circle","pink","things"],"info":[22,22,1]},{"name":"Ball-d","md5":"5d494659deae5c0de06b5885f5524276.svg","type":"costume","tags":["round","game","bounce","circle","green","things"],"info":[22,22,1]},{"name":"Ball-e","md5":"e80c98bc62fd32e8df81642af11ffb1a.svg","type":"costume","tags":["round","game","bounce","circle","purple","things"],"info":[22,22,1]},{"name":"Ballerina-a","md5":"6051bb7008cf17c8853a6f81f04c8a0f.svg","type":"costume","tags":["dance"],"info":[75,75,1]},{"name":"Ballerina-b","md5":"8bc5e47fb1439e29e11e9e3f2e20c6de.svg","type":"costume","tags":["dance"],"info":[75,75,1]},{"name":"Ballerina-c","md5":"6d3a07761b294f705987b0af58f8e335.svg","type":"costume","tags":["dance"],"info":[75,75,1]},{"name":"Ballerina-d","md5":"c3164795edf39e436272f425b4f5e487.svg","type":"costume","tags":["dance"],"info":[75,75,1]},{"name":"Balloon1-a","md5":"bc96a1fb5fe794377acd44807e421ce2.svg","type":"costume","tags":["party","pop","flying","helium","blue","things"],"info":[32,94,1]},{"name":"Balloon1-b","md5":"d7bb51d9c38af6314bd2b4058d2a592d.svg","type":"costume","tags":["party","pop","flying","helium","yellow","things"],"info":[31,94,1]},{"name":"Balloon1-c","md5":"247cef27b665d77d9efaca69327cae77.svg","type":"costume","tags":["party","pop","flying","helium","purple","things"],"info":[31,94,1]},{"name":"Bananas","md5":"1a76b68e056954f5c8ac1f073df1533d.svg","type":"costume","tags":["food","yellow","mushy","potassium","fruit"],"info":[39,38,1]},{"name":"Baseball","md5":"838dc2b2278619d3a9beefc6c8072a08.svg","type":"costume","tags":["baseball","sports","ball","alex eben meyer"],"info":[28,28,1]},{"name":"Basketball","md5":"482f04cbffa835c4abf29ab996d3fbbd.svg","type":"costume","tags":["sports","basketball","alex eben meyer"],"info":[23,23,1]},{"name":"Bat-a","md5":"75bf9a5c5ec7dc9325a0301b6f6e72dd.svg","type":"costume","tags":["fantasy","spooky","halloween","bat","animals","alex eben meyer"],"info":[80,60,1]},{"name":"Bat-b","md5":"b92d4967a0c233b0e78d6e834653f846.svg","type":"costume","tags":["fantasy","spooky","halloween","bat","animals","alex eben meyer"],"info":[39,61,1]},{"name":"Bat-c","md5":"56b1458bd81b8ac2401c216f7352343c.svg","type":"costume","tags":["fantasy","spooky","halloween","bat","animals","alex eben meyer"],"info":[68,66,1]},{"name":"Bat-d","md5":"7f806f928a192aab0b0d03aa96a89a67.svg","type":"costume","tags":["fantasy","spooky","halloween","bat","animals","alex eben meyer"],"info":[29,62,1]},{"name":"Batter-a","md5":"f7357c4cef5f31c6460e4f69dd0adabb.svg","type":"costume","tags":["baseball","sports","people","alex eben meyer"],"info":[46,80,1]},{"name":"Batter-b","md5":"c60fe1da0dcddedfd152384c60cbd5cc.svg","type":"costume","tags":["baseball","sports","people","alex eben meyer"],"info":[16,67,1]},{"name":"Batter-c","md5":"165c30e123e785d4cbbc0d9621f1c349.svg","type":"costume","tags":["baseball","sports","people","alex eben meyer"],"info":[94,66,1]},{"name":"Batter-d","md5":"e82529d9c31b56a3dd098ccc94be68a6.svg","type":"costume","tags":["baseball","sports","people","alex eben meyer"],"info":[70,102,1]},{"name":"Beachball","md5":"87d64cab74c64b31498cc85f07510ee4.svg","type":"costume","tags":["round","sports","bounce","inflatable"],"info":[34,33,1]},{"name":"Bear-a","md5":"5a4148d7684fc95f38c58a1672062c9e.svg","type":"costume","tags":["animals","ipzy","walking"],"info":[100,90,1]},{"name":"Bear-b","md5":"92a64ce184c8515217e0e98e49624622.svg","type":"costume","tags":["animals","ipzy","walking"],"info":[94,191,1]},{"name":"Bear-walk-a","md5":"d15eddb1a0f0ff0fa867bc006b46685d.svg","type":"costume","tags":["animals","ipzy","walking"],"info":[130,94,1]},{"name":"Bear-walk-b","md5":"06e3f1bcf4f46b83df3820d92430f202.svg","type":"costume","tags":["animals","ipzy","walking"],"info":[130,94,1]},{"name":"Bear-walk-c","md5":"13a3584040c9903b1824bb249d7f8a0e.svg","type":"costume","tags":["animals","ipzy","walking"],"info":[130,94,1]},{"name":"Bear-walk-d","md5":"c5d49a105619c497be45a5d2c43a740a.svg","type":"costume","tags":["animals","ipzy","walking"],"info":[130,94,1]},{"name":"Bear-walk-e","md5":"ece252d79c2d30c647c43c58986d9671.svg","type":"costume","tags":["animals","ipzy","walking"],"info":[130,94,1]},{"name":"Bear-walk-f","md5":"ff66b87efec0e647dc30ec58df168ec4.svg","type":"costume","tags":["animals","ipzy","walking"],"info":[130,94,1]},{"name":"Bear-walk-g","md5":"d1404b12adf0d6b1b881f0dca47ce21a.svg","type":"costume","tags":["animals","ipzy","walking"],"info":[130,94,1]},{"name":"Bear-walk-h","md5":"489055be58a7d9806e1d50455c88c399.svg","type":"costume","tags":["animals","ipzy","walking"],"info":[130,94,1]},{"name":"Beetle","md5":"e1ce8f153f011fdd52486c91c6ed594d.svg","type":"costume","tags":["animals","insect","bug","antennae"],"info":[43,38,1]},{"name":"Bell1","md5":"f35056c772395455d703773657e1da6e.svg","type":"costume","tags":["music","holiday","ring","things"],"info":[59,69,1]},{"name":"Ben-a","md5":"4386d05d5abd6e1aa0a93b7b447d1b39.svg","type":"costume","tags":["sports","soccer","football","people","alex eben meyer"],"info":[53,69,1]},{"name":"Ben-b","md5":"90db137cd0743204d02fdc9be1c8eb94.svg","type":"costume","tags":["sports","soccer","football","people","alex eben meyer"],"info":[53,67,1]},{"name":"Ben-c","md5":"5f05d41ede773b3bb379286e86a5b869.svg","type":"costume","tags":["sports","soccer","football","people","alex eben meyer"],"info":[71,72,1]},{"name":"Ben-d","md5":"6f6e246567c0639c758ed4f6930be76f.svg","type":"costume","tags":["sports","soccer","football","people","alex eben meyer"],"info":[42,72,1]},{"name":"Bowl-a","md5":"86f616639846f06fef29931e6b9b59de.svg","type":"costume","tags":["thing","food"],"info":[30,15,1]},{"name":"Bowtie","md5":"7d876f3ba4b04f3193a701ed30b4490c.svg","type":"costume","tags":["fashion"],"info":[15,8,1]},{"name":"Bread","md5":"68366160ce0ac1221cdde4455eca9cba.svg","type":"costume","tags":["food","ipzy"],"info":[37,12,1]},{"name":"Broom","md5":"836197f784bc4c4decfb1a5a60ca6c56.svg","type":"costume","tags":["fantasy","ipzy","flying","things"],"info":[135,25,1]},{"name":"Building-a","md5":"d713270e235851e5962becd73a951771.svg","type":"costume","tags":["things","city","flying","architecture"],"info":[40,30,1]},{"name":"Building-b","md5":"8c2d59c50a97d33b096f629258f02be6.svg","type":"costume","tags":["things","city","flying","architecture"],"info":[46,-11,1]},{"name":"Building-c","md5":"7f3f51f495c39809bed95991dfa1f80d.svg","type":"costume","tags":["things","city","flying","architecture"],"info":[25,17,1]},{"name":"Building-d","md5":"bbe68ab80b36e4c71f4e28414c7f781e.svg","type":"costume","tags":["things","city","flying","architecture"],"info":[59,-10,1]},{"name":"Building-e","md5":"1beeb8f034a1128c9a799297b0b7fc26.svg","type":"costume","tags":["things","city","flying","architecture"],"info":[36,55,1]},{"name":"Building-f","md5":"451e0a565e95d945fe2addfe609ee9df.svg","type":"costume","tags":["things","city","flying","architecture"],"info":[41,27,1]},{"name":"Building-g","md5":"58b3c9b7a41dde698fa2b427b502c1fa.svg","type":"costume","tags":["things","city","flying","architecture"],"info":[64,-65,1]},{"name":"Building-h","md5":"e952c8b14eeac894302d07d37a45ed99.svg","type":"costume","tags":["things","city","flying","architecture"],"info":[33,136,1]},{"name":"Building-i","md5":"b00b1123e3bfcb600242528d059ffcfb.svg","type":"costume","tags":["things","city","flying","architecture"],"info":[31,-12,1]},{"name":"Building-j","md5":"e08fd1a7397efcfe0e3691f945693cb4.svg","type":"costume","tags":["things","city","flying","architecture"],"info":[29,33,1]},{"name":"Butterfly1-a","md5":"8419d4851defd1e862e4f7c1699d2190.svg","type":"costume","tags":["animals","insect","bug","wetland","owen davey"],"info":[65,49,1]},{"name":"Butterfly1-b","md5":"0873714e8d55d9eeb0bc8e8ab64441cc.svg","type":"costume","tags":["animals","insect","bug","wetland","owen davey"],"info":[65,49,1]},{"name":"Butterfly1-c","md5":"9c422631ca8d46413487f5dd627b65c6.svg","type":"costume","tags":["animals","insect","bug","wetland","owen davey"],"info":[65,49,1]},{"name":"Butterfly2-a","md5":"836d4cc7889f4a1cbcb0303934f31f79.svg","type":"costume","tags":["animals","drawing","happy","bug","insect","antennae"],"info":[75,75,1]},{"name":"Butterfly2-b","md5":"55dd0671a359d7c35f7b78f4176660e8.svg","type":"costume","tags":["animals","drawing","happy","bug","insect","antennae"],"info":[75,75,1]},{"name":"Button1","md5":"7ef67c5bc8cf7df64fdb3b1d6b250f71.svg","type":"costume","tags":["icons","round","green","games"],"info":[72,72,1]},{"name":"Button2-a","md5":"c0051ff23e9aae78295964206793c1e3.svg","type":"costume","tags":["icons","blue","games"],"info":[72,72,1]},{"name":"Button2-b","md5":"712a561dc0ad66e348b8247e566b50ef.svg","type":"costume","tags":["icons","orange","games"],"info":[72,72,1]},{"name":"Button3-a","md5":"ffb2a9c21084c58fdb677c8d12a97519.svg","type":"costume","tags":["icons","gray","games"],"info":[72,72,1]},{"name":"Button3-b","md5":"7a9ccb55e4da36f48811ab125d2492e0.svg","type":"costume","tags":["icons","blue","games"],"info":[72,72,1]},{"name":"Button4-a","md5":"ecfe263bc256349777e571eaf39761d4.svg","type":"costume","tags":["icons","checkmark"],"info":[35,34,1]},{"name":"Button4-b","md5":"9c49edde00b80cd22d636a0577a9b1c9.svg","type":"costume","tags":["icons","checkmark"],"info":[35,34,1]},{"name":"Button5-a","md5":"71e97245b7be4fd6fe3ba8cdeecadaf1.svg","type":"costume","tags":["icons","symbols","x","black"],"info":[72,72,1]},{"name":"Button5-b","md5":"54cd55512f7571060e6e64168e541222.svg","type":"costume","tags":["icons","symbols","x","red"],"info":[72,72,1]},{"name":"Cake-a","md5":"e1e8e8a765b8778d6181035c5c66984d.svg","type":"costume","tags":["food","bakery","baking","frosting","sprinkles","sprankles","dragable"],"info":[64,50,1]},{"name":"Cake-b","md5":"460268a804e7682c9fabf37e4b70071c.svg","type":"costume","tags":["food","bakery","baking","frosting","sprinkles","sprankles","dragable","lie"],"info":[64,42,1]},{"name":"Calvrett Jumping","md5":"452683db3ad7a882f5ab9de496441592.png","type":"costume","tags":["people"],"info":[336,432,2]},{"name":"Calvrett Thinking","md5":"728ec1ebc275b53809023a36c66eeaa3.png","type":"costume","tags":["people"],"info":[212,340,2]},{"name":"Casey-a","md5":"b7269d70079e96299666cc7b3f8eabc3.svg","type":"costume","tags":["sports","basketball","people","alex eben meyer"],"info":[75,62,1]},{"name":"Casey-b","md5":"d22f6e818106f247f91e1c7c315863c3.svg","type":"costume","tags":["sports","basketball","people","alex eben meyer"],"info":[60,74,1]},{"name":"Casey-c","md5":"a6ea02408a3f8366dfd704aae9a6ed0b.svg","type":"costume","tags":["sports","basketball","people","alex eben meyer"],"info":[57,72,1]},{"name":"Casey-d","md5":"033ef301acfdfbc38774a14a559c1654.svg","type":"costume","tags":["sports","basketball","people","alex eben meyer"],"info":[71,74,1]},{"name":"Cassy-a","md5":"6cb3686db1fa658b6541cc9fa3ccfcc7.png","type":"costume","tags":["people","dance"],"info":[208,384,2]},{"name":"Cassy-b","md5":"f801cec764da5ef6374e1d557296d14e.png","type":"costume","tags":["people","dance"],"info":[280,384,2]},{"name":"Cassy-c","md5":"63483bbf72fc55719918a335e1a16426.png","type":"costume","tags":["people","dance"],"info":[148,376,2]},{"name":"Cassy-d","md5":"aca39a47cf3affd8a83d3287d2856c29.png","type":"costume","tags":["people","dance"],"info":[188,360,2]},{"name":"Cat 2","md5":"01ae57fd339529445cb890978ef8a054.svg","type":"costume","tags":["kitty","kitten","animals","mammal"],"info":[87,39,1]},{"name":"Cat Flying-a","md5":"bf6b9f91e6928be67eda5154ca5fb2c6.svg","type":"costume","tags":["animals","cat","kitty","kitten"],"info":[55,37,1]},{"name":"Cat Flying-b","md5":"6a5f707419e619463135f5bae599fa5b.svg","type":"costume","tags":["animals","cat","kitty","kitten"],"info":[44,46,1]},{"name":"Cat-a","md5":"b7853f557e4426412e64bb3da6531a99.svg","type":"costume","tags":["animals","cat","kitten","kitty","mammal","orange","scratch cat"],"info":[48,50,1]},{"name":"Cat-b","md5":"e6ddc55a6ddd9cc9d84fe0b4c21e016f.svg","type":"costume","tags":["animals","cat","kitten","kitty","mammal","orange","scratch cat"],"info":[46,53,1]},{"name":"Catcher-a","md5":"27c88c54a59b9fff7e3e4763a6e9874e.svg","type":"costume","tags":["baseball","sports","people","alex eben meyer"],"info":[41,51,1]},{"name":"Catcher-b","md5":"799a822cffc9460c0bf1b387cbd5e06b.svg","type":"costume","tags":["baseball","sports","people","alex eben meyer"],"info":[41,47,1]},{"name":"Catcher-c","md5":"a6f2bf8b354e8d1a789f8e6f83133d02.svg","type":"costume","tags":["baseball","sports","people","alex eben meyer"],"info":[60,87,1]},{"name":"Catcher-d","md5":"c86af45d9168bfb81259e5bb40be1778.svg","type":"costume","tags":["baseball","sports","people","alex eben meyer"],"info":[86,46,1]},{"name":"Centaur-a","md5":"45c1890ae0ab41f24f67ea74bec006c9.svg","type":"costume","tags":["fantasy","people","ipzy","emotions"],"info":[110,140,1]},{"name":"Centaur-b","md5":"783e8cd43e0c1feca25f639cb5cbc7da.svg","type":"costume","tags":["fantasy","people","ipzy","emotions"],"info":[110,140,1]},{"name":"Centaur-c","md5":"d09f7160383c6399354c3d9960e852db.svg","type":"costume","tags":["fantasy","people","ipzy","emotions"],"info":[110,140,1]},{"name":"Centaur-d","md5":"1ba8b4d384f995688c1b7048d1935697.svg","type":"costume","tags":["fantasy","people","ipzy","emotions"],"info":[110,140,1]},{"name":"Champ99-a","md5":"7b073f47fbd9421e0d60daacc157f506.png","type":"costume","tags":["people","dance"],"info":[496,612,2]},{"name":"Champ99-b","md5":"d6ae13605610aa008d48b0c8b25a57d3.png","type":"costume","tags":["people","dance"],"info":[328,580,2]},{"name":"Champ99-c","md5":"26fdff424232926001d20041c3d5673b.png","type":"costume","tags":["people","dance"],"info":[304,540,2]},{"name":"Champ99-d","md5":"a28ffc2b129fb359ff22c79c48341267.png","type":"costume","tags":["people","dance"],"info":[376,520,2]},{"name":"Champ99-e","md5":"56f3220fa82d99dcfc7d27d433ed01e4.png","type":"costume","tags":["people","dance"],"info":[380,496,2]},{"name":"Champ99-f","md5":"68453506ae4b6b60a3fc6817ba39d492.png","type":"costume","tags":["people","dance"],"info":[228,500,2]},{"name":"Champ99-g","md5":"20318b14a332fd618ec91e7c1de8be9a.png","type":"costume","tags":["people","dance"],"info":[264,516,2]},{"name":"Cheesy Puffs","md5":"82772a61ec74974e84c686c61ea0b7d5.png","type":"costume","tags":["food"],"info":[174,144,2]},{"name":"Chick-a","md5":"7cd74ad0da97a828e8499ee181c9dbb1.svg","type":"costume","tags":["animals","chicken","farm","owen davey"],"info":[32,37,1]},{"name":"Chick-b","md5":"07c2dad5f7063fddf7705f4817fad4f6.svg","type":"costume","tags":["animals","chicken","farm","owen davey"],"info":[32,37,1]},{"name":"Chick-c","md5":"272d3e4503a4123df62f25b67bad6f03.svg","type":"costume","tags":["animals","chicken","farm","owen davey"],"info":[21,24,1]},{"name":"City Bus-a","md5":"accf64aceae7997b7533fb51624ca297.svg","type":"costume","tags":["city","bus","vehicle","car"],"info":[107,67,1]},{"name":"City Bus-b","md5":"b9ea0e326ffa98bc58a73bdf17c9542b.svg","type":"costume","tags":["city","bus","vehicle","car"],"info":[107,67,1]},{"name":"Cloud","md5":"47005a1f20309f577a03a67abbb6b94e.svg","type":"costume","tags":["thing","weather","whether"],"info":[71,45,1]},{"name":"Cloud-a","md5":"c7d7de8e29179407f03b054fa640f4d0.svg","type":"costume","tags":["flying","weather","things","sky"],"info":[76,19,1]},{"name":"Cloud-b","md5":"d8595350ebb460494c9189dabb968336.svg","type":"costume","tags":["flying","weather","things","sky"],"info":[101,20,1]},{"name":"Cloud-c","md5":"395fc991e64ac0a4aa46758ab4bc65cb.svg","type":"costume","tags":["flying","weather","things","sky"],"info":[97,9,1]},{"name":"Cloud-d","md5":"1767e704acb11ffa409f77cc79ba7e86.svg","type":"costume","tags":["flying","weather","things","sky"],"info":[87,21,1]},{"name":"Convertible","md5":"5b883f396844ff5cfecd7c95553fa4fb.png","type":"costume","tags":["car","transportation"],"info":[360,88,2]},{"name":"Convertible 3","md5":"b6ac3c9e1789cba2302d2ef82d62d019.svg","type":"costume","tags":["transportation","car","things"],"info":[75,75,1]},{"name":"Crab-a","md5":"114249a5660f7948663d95de575cfd8d.svg","type":"costume","tags":["animals","crustacean","antennae","baltimore","maryland","underwater","ocean","sea","summer","arthropod"],"info":[75,75,1]},{"name":"Crab-b","md5":"9bf050664e68c10d2616e85f2873be09.svg","type":"costume","tags":["animals","crustacean","antennae","baltimore","maryland","underwater","ocean","sea","summer","arthropod"],"info":[75,75,1]},{"name":"Crystal-a","md5":"8520264d48537bea17b7f6d18e9bb558.svg","type":"costume","tags":["fantasy","ipzy","things"],"info":[15,15,1]},{"name":"Crystal-b","md5":"b62ce1dc2d34741bad036664a01912fb.svg","type":"costume","tags":["fantasy","ipzy","things"],"info":[12,24,1]},{"name":"Dan-a","md5":"307250744e230fb15e7062238bf2634c.png","type":"costume","tags":["people"],"info":[144,392,2]},{"name":"Dan-b","md5":"89b55d049f4b3811676311df00681385.png","type":"costume","tags":["people"],"info":[188,400,2]},{"name":"Dani-a","md5":"e620d1c3143b5ff05a0e4df89576e054.svg","type":"costume","tags":["people"],"info":[37,141,1]},{"name":"Dani-b","md5":"4de54672f1c7af00623a0ee3bc490ba7.svg","type":"costume","tags":["people"],"info":[86,141,1]},{"name":"Dani-c","md5":"b4a303342f9b7ed6a74059054347dd30.svg","type":"costume","tags":["people"],"info":[37,138,1]},{"name":"Dee-a","md5":"aa239b7ccdce6bddf06900c709525764.svg","type":"costume","tags":["people"],"info":[52,99,1]},{"name":"Dee-b","md5":"62b4ac1b735599e21af77c390b178095.svg","type":"costume","tags":["people"],"info":[33,99,1]},{"name":"Dee-c","md5":"6aa6196ce3245e93b8d1299f33adffcd.svg","type":"costume","tags":["people"],"info":[36,102,1]},{"name":"Dee-d","md5":"2159a6be8f7ff450d0b5e938ca34a3f4.svg","type":"costume","tags":["people"],"info":[33,99,1]},{"name":"Dee-e","md5":"e358d2a7e3a0a680928657161ce81a0a.svg","type":"costume","tags":["people"],"info":[32,99,1]},{"name":"Devin-a","md5":"b1897e56265470b55fa65fabe2423c55.svg","type":"costume","tags":["people"],"info":[39,95,1]},{"name":"Devin-b","md5":"873fbd641768c8f753a6568da97633e7.svg","type":"costume","tags":["people"],"info":[40,96,1]},{"name":"Devin-c","md5":"eac3c03d86cebb42c8f30e373cb7f623.svg","type":"costume","tags":["people"],"info":[32,95,1]},{"name":"Devin-d","md5":"fa6a75afb0e4b822b91d8bb20d40c68f.svg","type":"costume","tags":["people"],"info":[41,95,1]},{"name":"Dinosaur1-a","md5":"e70ab4de006f3df64e776abf912a62be.svg","type":"costume","tags":["animals","dinosaur","alex eben meyer","sauropod"],"info":[98,92,1]},{"name":"Dinosaur1-b","md5":"af2d8211a65dce9871d49fa70671ce0c.svg","type":"costume","tags":["animals","dinosaur","alex eben meyer","sauropod"],"info":[98,47,1]},{"name":"Dinosaur1-c","md5":"a2bb28d5ba55ba997bec63772437cecf.svg","type":"costume","tags":["animals","dinosaur","alex eben meyer","sauropod"],"info":[81,91,1]},{"name":"Dinosaur1-d","md5":"91f3dba45e8cec7bdff31ed5acde2c85.svg","type":"costume","tags":["animals","dinosaur","alex eben meyer","sauropod"],"info":[99,91,1]},{"name":"Dinosaur2-a","md5":"f49719e8f2440f5d328f2604e97eb71d.svg","type":"costume","tags":["animals","dinosaur","triceratops","alex eben meyer"],"info":[63,67,1]},{"name":"Dinosaur2-b","md5":"1af6b3af3bf2cda862bbe01034a336bb.svg","type":"costume","tags":["animals","dinosaur","triceratops","alex eben meyer"],"info":[76,67,1]},{"name":"Dinosaur2-c","md5":"e83b30a4517bbe155e2b4a6367c8f70b.svg","type":"costume","tags":["animals","dinosaur","triceratops","alex eben meyer"],"info":[64,67,1]},{"name":"Dinosaur2-d","md5":"8244f1fb159237179d1caaa69c070060.svg","type":"costume","tags":["animals","dinosaur","triceratops","alex eben meyer"],"info":[73,67,1]},{"name":"Dinosaur3-a","md5":"c4867c44f38df5bde472844878d5beea.svg","type":"costume","tags":["animals","dinosaur","pteranodon","flying","alex eben meyer"],"info":[113,42,1]},{"name":"Dinosaur3-b","md5":"b682c1e58ea1c6bea737670f57517b6f.svg","type":"costume","tags":["animals","dinosaur","pteranodon","flying","alex eben meyer"],"info":[113,59,1]},{"name":"Dinosaur3-c","md5":"47a617ca48f4782efeeb60199cff801e.svg","type":"costume","tags":["animals","dinosaur","pteranodon","flying","alex eben meyer"],"info":[47,59,1]},{"name":"Dinosaur3-d","md5":"710ff3380d6872b04785db97dc0565c6.svg","type":"costume","tags":["animals","dinosaur","pteranodon","flying","alex eben meyer"],"info":[113,65,1]},{"name":"Dinosaur3-e","md5":"6f40025c1157f37858adf7fa85090e64.svg","type":"costume","tags":["animals","dinosaur","pteranodon","alex eben meyer"],"info":[41,40,1]},{"name":"Dinosaur4-a","md5":"d87b5e3c45f5d234c7aa47107c788f18.svg","type":"costume","tags":["animals","dinosaur","tyrannosaurus","t-rex","trex","alex eben meyer"],"info":[60,52,1]},{"name":"Dinosaur4-b","md5":"cfe906702bbd30bc3bb8acb53079b6b0.svg","type":"costume","tags":["animals","dinosaur","tyrannosaurus","t-rex","trex","alex eben meyer"],"info":[87,52,1]},{"name":"Dinosaur4-c","md5":"1879b07cfe788b0258afada17aa46973.svg","type":"costume","tags":["animals","dinosaur","tyrannosaurus","t-rex","trex","alex eben meyer"],"info":[59,52,1]},{"name":"Dinosaur4-d","md5":"52c17657698ab82881ed3ccf83080684.svg","type":"costume","tags":["animals","dinosaur","tyrannosaurus","t-rex","trex","alex eben meyer"],"info":[89,88,1]},{"name":"Diver1","md5":"853803d5600b66538474909c5438c8ee.svg","type":"costume","tags":["people","underwater","ocean","sea","summer","swimming"],"info":[75,75,1]},{"name":"Diver2","md5":"248d3e69ada69a64b1077149ef6a931a.svg","type":"costume","tags":["people","underwater","ocean","sea","summer","swimming"],"info":[75,75,1]},{"name":"Dm Freeze","md5":"a4b5d644d9abdbcab236acf19b2a2e81.png","type":"costume","tags":["people","dance"],"info":[440,468,2]},{"name":"Dm Pop Down","md5":"729812366245c0dafd456339c9d94e08.png","type":"costume","tags":["people","dance"],"info":[128,148,2]},{"name":"Dm Pop Front","md5":"70da166596bb484eae1bfbaad5c03d54.png","type":"costume","tags":["people","dance"],"info":[184,468,2]},{"name":"Dm Pop L Arm","md5":"3cdebabdb41f6c3e84561cf3ea87bac3.png","type":"costume","tags":["people","dance"],"info":[180,476,2]},{"name":"Dm Pop Left","md5":"32ec7b5332cfebd1cfed7f6b79c76e67.png","type":"costume","tags":["people","dance"],"info":[408,500,2]},{"name":"Dm Pop R Arm","md5":"50faf1630ea383c0b8c77f70a9329797.png","type":"costume","tags":["people","dance"],"info":[160,480,2]},{"name":"Dm Pop Right","md5":"19bd7995d37e3baade673b2fe7cb982b.png","type":"costume","tags":["people","dance"],"info":[156,476,2]},{"name":"Dm Pop Stand","md5":"05529eb3c09294bd15f57c6f10d5894e.png","type":"costume","tags":["people","dance"],"info":[200,488,2]},{"name":"Dm Stance","md5":"dafbdfe454c5ec7029b5c1e07fcabc90.png","type":"costume","tags":["people","dance"],"info":[212,476,2]},{"name":"Dm Top L Leg","md5":"344384a6a3f1bdf494cc7af31e928d36.png","type":"costume","tags":["people","dance"],"info":[460,480,2]},{"name":"Dm Top R Leg","md5":"12db59633a1709a2c39534d35263791f.png","type":"costume","tags":["people","dance"],"info":[436,464,2]},{"name":"Dm Top R Leg2","md5":"fcb8c2b6cf9b7e6ce9df521b2486deb3.png","type":"costume","tags":[],"info":[436,464,2]},{"name":"Dm Top Stand","md5":"a22da98e5e63de7b2883355afd0184f0.png","type":"costume","tags":["people","dance"],"info":[164,488,2]},{"name":"Dog1-a","md5":"39ddefa0cc58f3b1b06474d63d81ef56.svg","type":"costume","tags":["animals","puppy","puppies","mammals"],"info":[83,80,1]},{"name":"Dog1-b","md5":"598f4aa3d8f671375d1d2b3acf753416.svg","type":"costume","tags":["animals","puppy","puppies","mammals"],"info":[83,80,1]},{"name":"Dog2-a","md5":"e921f865b19b27cd99e16a341dbf09c2.svg","type":"costume","tags":["animals","puppy","puppies","mammals"],"info":[75,75,1]},{"name":"Dog2-b","md5":"891f2fb7daf79ba8b224a9173eeb0a63.svg","type":"costume","tags":["animals","puppy","puppies","mammals"],"info":[75,75,1]},{"name":"Dog2-c","md5":"cd236d5eef4431dea82983ac9eec406b.svg","type":"costume","tags":["animals","puppy","puppies","mammals"],"info":[75,75,1]},{"name":"Donut","md5":"9e7b4d153421dae04a24571d7e079e85.svg","type":"costume","tags":["food","sweets","bakery","baking","homer","frosting","sprinkles","sprankles"],"info":[73,15,1]},{"name":"Dorian-a","md5":"503f1d4d0fe61d071e1dd8b5233cceb0.svg","type":"costume","tags":["sports","basketball","people","alex eben meyer"],"info":[60,65,1]},{"name":"Dorian-b","md5":"d5f795ef2395bcd11ceee0b0c24c9341.svg","type":"costume","tags":["sports","basketball","people","alex eben meyer"],"info":[60,65,1]},{"name":"Dorian-c","md5":"4ad4ddf4251b9b5bcb16d8d77213685f.svg","type":"costume","tags":["sports","basketball","people","alex eben meyer"],"info":[77,67,1]},{"name":"Dorian-d","md5":"67fba4e187ecf42749bdd44e64f29192.svg","type":"costume","tags":["sports","basketball","people","alex eben meyer"],"info":[77,53,1]},{"name":"Dot-a","md5":"3b9e6830365aeadb63c21b681777b783.svg","type":"costume","tags":["animals","space","dog","wren mcdonald"],"info":[52,67,1]},{"name":"Dot-b","md5":"a80a07906ffbb9671dba3633223859af.svg","type":"costume","tags":["animals","space","dog","wren mcdonald"],"info":[65,67,1]},{"name":"Dot-c","md5":"1e1bdccbab5b566beb7f91b5ec01352f.svg","type":"costume","tags":["animals","space","dog","wren mcdonald"],"info":[51,69,1]},{"name":"Dot-d","md5":"06d70d5de0e25f97c1c606e513ab019c.svg","type":"costume","tags":["animals","space","dog","wren mcdonald"],"info":[57,67,1]},{"name":"Dove-a","md5":"6dde2b880ad6ddeaea2a53821befb86d.svg","type":"costume","tags":["animals","bird","flying"],"info":[86,59,1]},{"name":"Dove-b","md5":"1c0bc118044d7f6033bc9cd1ef555590.svg","type":"costume","tags":["animals","bird","flying"],"info":[88,57,1]},{"name":"Dragon-a","md5":"8aed65cee4cfe22b4f4b8e749092dbbb.svg","type":"costume","tags":["fantasy","animals","ipzy","flying"],"info":[210,150,1]},{"name":"Dragon-b","md5":"c3360f16bb78b136d9911325da9fda49.svg","type":"costume","tags":["fantasy","animals","ipzy","flying"],"info":[210,150,1]},{"name":"Dragon-c","md5":"e81af82ebde008c167ebc6874df3ecb4.svg","type":"costume","tags":["fantasy","animals","ipzy","flying"],"info":[210,150,1]},{"name":"Dragon1-a","md5":"ee0082b436d6d5dc3de33047166e7bf2.svg","type":"costume","tags":["fantasy","reptile","flying","fire"],"info":[65,60,1]},{"name":"Dragon1-b","md5":"bb58ce36997fa205a86a085f202837fd.svg","type":"costume","tags":["fantasy","reptile","flying","fire"],"info":[84,56,1]},{"name":"Dragonfly-a","md5":"87aaecd2fb73580e6f1f38c5a2e579a9.svg","type":"costume","tags":["animals","insect","dragonfly","wetland","owen davey"],"info":[108,52,1]},{"name":"Dragonfly-b","md5":"4e775a49bd5a7a6d38392731924f72e0.svg","type":"costume","tags":["animals","insect","dragonfly","wetland","owen davey"],"info":[108,46,1]},{"name":"Dress-a","md5":"fa7e0b37a324c212d0f1ce0f701a1ae0.svg","type":"costume","tags":["fashion"],"info":[57,83,1]},{"name":"Dress-b","md5":"308b6ad8e6cfe5c2b2c1e3a1eb9cc404.svg","type":"costume","tags":["fashion"],"info":[58,83,1]},{"name":"Dress-c","md5":"1f7a725ba285dc97cb142d4b812db624.svg","type":"costume","tags":["fashion"],"info":[49,83,1]},{"name":"Drum-a","md5":"dd66742bc2a3cfe5a6f9f540afd2e15c.svg","type":"costume","tags":["music","andrew rae"],"info":[43,60,1]},{"name":"Drum-b","md5":"9c9d371da382c227e43f09b1a748c554.svg","type":"costume","tags":["music","andrew rae"],"info":[43,60,1]},{"name":"Drum-cymbal-a","md5":"d6d41862fda966df1455d2dbff5e1988.svg","type":"costume","tags":["music","andrew rae"],"info":[30,74,1]},{"name":"Drum-cymbal-b","md5":"e6b7d7d8874bc4b7be58afe927157554.svg","type":"costume","tags":["music","andrew rae"],"info":[30,74,1]},{"name":"Drum-highhat-a","md5":"81fb79151a63cb096258607451cc2cf5.svg","type":"costume","tags":["music","andrew rae"],"info":[33,73,1]},{"name":"Drum-highhat-b","md5":"e3c273e4ad1a24583064f9b61fcd753a.svg","type":"costume","tags":["music","andrew rae"],"info":[33,73,1]},{"name":"Drum-kit","md5":"131d040d86ecea62ccd175a8709c7866.svg","type":"costume","tags":["music","andrew rae"],"info":[58,78,1]},{"name":"Drum-kit-b","md5":"ff14be049146cf9ab142e0951cb9b735.svg","type":"costume","tags":["music","andrew rae"],"info":[58,78,1]},{"name":"Drum-snare-a","md5":"ace58710b8fa5fca8fb5bbca15e7d19c.svg","type":"costume","tags":["music","andrew rae"],"info":[21,32,1]},{"name":"Drum-snare-b","md5":"f6120839d3f73b262571add2444c443a.svg","type":"costume","tags":["music","andrew rae"],"info":[34,48,1]},{"name":"Drums Conga-a","md5":"b3da94523b6d3df2dd30602399599ab4.svg","type":"costume","tags":["drums"," music"," ericr"],"info":[65,66,1]},{"name":"Drums Conga-b","md5":"037703c2b65f051c12e9b22dcf93856c.svg","type":"costume","tags":["drums"," music"," ericr"],"info":[66,94,1]},{"name":"Duck","md5":"c3baf7eedfbdac8cd1e4f1f1f779dc0c.svg","type":"costume","tags":["animals","chrisg","quack","birds","birb"],"info":[61,59,1]},{"name":"Earth","md5":"d9df2cf4f6eb2460d0de3e4f1e05f40b.svg","type":"costume","tags":["space","planet","earth"],"info":[41,40,1]},{"name":"Easel-a","md5":"edc81e35c94c07dc380c43ea9b311394.svg","type":"costume","tags":["bedroom","art","easel"],"info":[69,95,1]},{"name":"Easel-b","md5":"cac798e8cf0364fa9a8bc52b85bda6b2.svg","type":"costume","tags":["bedroom","art","easel"],"info":[69,95,1]},{"name":"Easel-c","md5":"afbf42eb496694afb31f9ea69b3a1a7a.svg","type":"costume","tags":["bedroom","art","easel"],"info":[68,94,1]},{"name":"Egg-a","md5":"6f1a24a63d16c45425aa2eb64934a278.svg","type":"costume","tags":["food","breakfast","alex eben meyer"],"info":[18,26,1]},{"name":"Egg-b","md5":"7f1320549dd8bfd596c52aec02d898ce.svg","type":"costume","tags":["food","breakfast","alex eben meyer"],"info":[23,27,1]},{"name":"Egg-c","md5":"62ed6f412aae07a575faa51451009168.svg","type":"costume","tags":["food","breakfast","alex eben meyer"],"info":[28,27,1]},{"name":"Egg-d","md5":"0dce0615471ebf1bebc3ba8b4bebbd18.svg","type":"costume","tags":["food","breakfast","alex eben meyer"],"info":[19,27,1]},{"name":"Egg-e","md5":"3848cf5708b7c712bb7bb9bbcce636aa.svg","type":"costume","tags":["food","breakfast","alex eben meyer"],"info":[20,26,1]},{"name":"Egg-f","md5":"0f7e63d9f23038a5012409af93c8dfad.svg","type":"costume","tags":["food","breakfast","alex eben meyer"],"info":[31,26,1]},{"name":"Elephant-a","md5":"b3515b3805938b0fae4e527aa0b4524e.svg","type":"costume","tags":["animals","mammals","pachydermata"],"info":[107,33,1]},{"name":"Elephant-b","md5":"bce91fa266220d3679a4c19c4e38b1f7.svg","type":"costume","tags":["animals","mammals","pachydermata"],"info":[95,40,1]},{"name":"Elf-a","md5":"00748a750dc4fd754ce4debb5e3595c0.svg","type":"costume","tags":["fantasy","people","ipzy","emotions"],"info":[50,140,1]},{"name":"Elf-b","md5":"91815a19569ef9f0ef68bca56bb80446.svg","type":"costume","tags":["fantasy","people","ipzy","emotions"],"info":[50,140,1]},{"name":"Elf-c","md5":"8153eaf84bc3db9a671cafd34506243b.svg","type":"costume","tags":["fantasy","people","ipzy","emotions"],"info":[50,140,1]},{"name":"Elf-d","md5":"2432797fc69a62fc643505b0ba039169.svg","type":"costume","tags":["fantasy","people","ipzy","emotions"],"info":[50,140,1]},{"name":"Elf-e","md5":"a06e6c93b143ae2a7b776bd1deee6b59.svg","type":"costume","tags":["fantasy","people","ipzy","emotions"],"info":[50,140,1]},{"name":"Fairy-a","md5":"fe97687c7f1b747bb6f41c252cc5926a.svg","type":"costume","tags":["fantasy","people","ipzy","emotions"],"info":[85,140,1]},{"name":"Fairy-b","md5":"c8e0d935b2e4372ecc813705a79be3eb.svg","type":"costume","tags":["fantasy","people","ipzy","emotions"],"info":[85,140,1]},{"name":"Fairy-c","md5":"4d0740d1b5be93256ad235062daa876b.svg","type":"costume","tags":["fantasy","people","ipzy","emotions"],"info":[85,140,1]},{"name":"Fairy-d","md5":"ca555dadd377431e38a3bc67ece4d36a.svg","type":"costume","tags":["fantasy","people","ipzy","emotions"],"info":[85,140,1]},{"name":"Fairy-e","md5":"a681f6d6044abdebcdd6634ce85da484.svg","type":"costume","tags":["fantasy","people","ipzy","emotions"],"info":[85,140,1]},{"name":"Fish-a","md5":"8598752b1b7b9892c23817c4ed848e7d.svg","type":"costume","tags":["animals","ocean","sea","underwater","daria skrybchencko"],"info":[63,45,1]},{"name":"Fish-b","md5":"52032e4310f9855b89f873b528a5e928.svg","type":"costume","tags":["animals","ocean","sea","underwater","daria skrybchencko"],"info":[63,45,1]},{"name":"Fish-c","md5":"06c139dcfe45bf31ef45e7030b77dc36.svg","type":"costume","tags":["animals","ocean","sea","underwater","daria skrybchencko"],"info":[63,45,1]},{"name":"Fish-d","md5":"6a3a2c97374c157e0dbc0a03c2079284.svg","type":"costume","tags":["animals","ocean","sea","underwater","daria skrybchencko"],"info":[63,45,1]},{"name":"Fishbowl-a","md5":"9d1013e04ca7425f680a4b4e6dd6ede6.svg","type":"costume","tags":["fishbowl","fish","animals","pet"],"info":[28,24,1]},{"name":"Fishbowl-b","md5":"0bbfc827e8d2f3da6db82efe95563f93.svg","type":"costume","tags":["fishbowl","fish","animals","pet"],"info":[28,24,1]},{"name":"Food Truck-a","md5":"b30ec8ff043e0f1747591d564d56d7fa.svg","type":"costume","tags":["city","truck","vehicle","food","car"],"info":[121,125,1]},{"name":"Food Truck-b","md5":"afd51531621d2b33869b47342311b363.svg","type":"costume","tags":["city","truck","vehicle","food","car"],"info":[121,101,1]},{"name":"Food Truck-c","md5":"42f88485a25bf9a683d28957db9f969f.svg","type":"costume","tags":["city","truck","vehicle","food","car"],"info":[121,92,1]},{"name":"Football Running","md5":"7ee31371b2eafba57cc5a78fc1a787fe.png","type":"costume","tags":["people","sports"],"info":[184,400,2]},{"name":"Football Standing","md5":"c717def72c8bd98749284d31b51d7097.png","type":"costume","tags":["people","sports"],"info":[148,400,2]},{"name":"Fortune Cookie","md5":"c56dcaa1fa4e3c9740142b93d5982850.png","type":"costume","tags":["food"],"info":[120,124,2]},{"name":"Fox-a","md5":"0aef4633e8580e209020b054eb55982f.svg","type":"costume","tags":["animals","mammal","robert hunter"],"info":[86,44,1]},{"name":"Fox-b","md5":"ae0bb1b900e853ddc8820e0c7bd60f53.svg","type":"costume","tags":["animals","mammal","robert hunter"],"info":[44,50,1]},{"name":"Fox-c","md5":"3cc3761cbabdcf13dbfdf04048bfbccf.svg","type":"costume","tags":["animals","mammal","robert hunter"],"info":[48,38,1]},{"name":"Frank-a","md5":"8ebcc9a619ae0455df9da42d39f59c1d.svg","type":"costume","tags":["fantasy","people","spooky","halloween","frankenstein","monster","alex eben meyer"],"info":[97,63,1]},{"name":"Frank-b","md5":"e605b9d87181c52825ae21597c9c1e07.svg","type":"costume","tags":["fantasy","spooky","people","halloween","frankenstein","monster","alex eben meyer"],"info":[105,63,1]},{"name":"Frank-c","md5":"a53378250f07b6dad161516a5317277e.svg","type":"costume","tags":["fantasy","spooky","people","halloween","frankenstein","monster","alex eben meyer"],"info":[159,59,1]},{"name":"Frank-d","md5":"44b4ba838b60f14d6e7ebddf5df4d4c4.svg","type":"costume","tags":["fantasy","spooky","people","halloween","frankenstein","monster","alex eben meyer"],"info":[106,107,1]},{"name":"Frog","md5":"285483a688eed2ff8010c65112f99c41.svg","type":"costume","tags":["animals","amphibian","nature","hopping","green","wart"],"info":[48,30,1]},{"name":"Frog 2-a","md5":"07160d455202e95f5b4b5c842eff6788.svg","type":"costume","tags":["animals","frog","wetland","owen davey"],"info":[101,60,1]},{"name":"Frog 2-b","md5":"9663ddb4d100eb4e18702ee13eca835e.svg","type":"costume","tags":["animals","frog","wetland","owen davey"],"info":[101,58,1]},{"name":"Frog 2-c","md5":"5c2ec9de8d1695cd4b59beea45046560.svg","type":"costume","tags":["animals","frog","wetland","owen davey"],"info":[96,87,1]},{"name":"Fruit Platter","md5":"6c3252378da3334f63eebddbed3fae91.png","type":"costume","tags":["food"],"info":[296,156,2]},{"name":"Fruitsalad","md5":"dbf8cc34f7ca18b4a008d2890dba56b7.svg","type":"costume","tags":["food","fruit"],"info":[30,22,1]},{"name":"Ghost-a","md5":"fca9fdf3ec9aafcfbd915105fecb6ce6.svg","type":"costume","tags":["fantasy","spooky","halloween","ghoul","monster","alex eben meyer"],"info":[37,68,1]},{"name":"Ghost-b","md5":"9d6e168d234d023476324cb72430e645.svg","type":"costume","tags":["fantasy","spooky","halloween","ghoul","monster","alex eben meyer"],"info":[41,68,1]},{"name":"Ghost-c","md5":"8296c8aa0782b53c5188dabde5fce10f.svg","type":"costume","tags":["fantasy","spooky","halloween","ghoul","monster","alex eben meyer"],"info":[61,72,1]},{"name":"Ghost-d","md5":"2a3c6eb1faa6b2e4403c64945d59e122.svg","type":"costume","tags":["fantasy","spooky","halloween","ghoul","monster","alex eben meyer"],"info":[78,69,1]},{"name":"Gift-a","md5":"abeae2217b3ce67b1ff761cd7a89274d.svg","type":"costume","tags":["thing","holiday"],"info":[33,25,1]},{"name":"Gift-b","md5":"5cae973c98f2d98b51e6c6b3c9602f8c.svg","type":"costume","tags":["thing","holiday"],"info":[33,26,1]},{"name":"Giga Walk1","md5":"f76bc420011db2cdb2de378c1536f6da.svg","type":"costume","tags":["fantasy","walking"],"info":[70,107,1]},{"name":"Giga Walk2","md5":"43b5874e8a54f93bd02727f0abf6905b.svg","type":"costume","tags":["fantasy","walking"],"info":[71,107,1]},{"name":"Giga Walk3","md5":"9aab3bbb375765391978be4f6d478ab3.svg","type":"costume","tags":["fantasy","walking"],"info":[71,107,1]},{"name":"Giga-a","md5":"93cb048a1d199f92424b9c097fa5fa38.svg","type":"costume","tags":["fantasy","drawing","happy"],"info":[72,96,1]},{"name":"Giga-b","md5":"528613711a7eae3a929025be04db081c.svg","type":"costume","tags":["fantasy","drawing","happy"],"info":[72,96,1]},{"name":"Giga-c","md5":"ee4dd21d7ca6d1b889ee25d245cbcc66.svg","type":"costume","tags":["fantasy","drawing","happy"],"info":[73,96,1]},{"name":"Giga-d","md5":"7708e2d9f83a01476ee6d17aa540ddf1.svg","type":"costume","tags":["fantasy","drawing","mad"],"info":[73,96,1]},{"name":"Giraffe-a","md5":"2d3955997d2b3aa8dad9389c61de384f.svg","type":"costume","tags":["animals","savanna","robert hunter"],"info":[87,132,1]},{"name":"Giraffe-b","md5":"b129c6016fedc7d03fb7f0a06363af28.svg","type":"costume","tags":["animals","savanna","robert hunter"],"info":[82,132,1]},{"name":"Giraffe-c","md5":"1af467957df0350765ba9a10e8d85572.svg","type":"costume","tags":["animals","savanna","robert hunter"],"info":[86,132,1]},{"name":"Glass Water-a","md5":"c364b9e1f4bcdc61705032d89eaaa0a1.svg","type":"costume","tags":["food","things","underwater"],"info":[39,48,1]},{"name":"Glass Water-b","md5":"bc07ce6a2004ac91ce704531a1c526e5.svg","type":"costume","tags":["food","things","eaten","empty"],"info":[39,48,1]},{"name":"Glasses-a","md5":"f42180039c37c3b221e1e426b92e5092.svg","type":"costume","tags":["fashion","glasses"],"info":[33,13,1]},{"name":"Glasses-b","md5":"58b728ee8c1f739e2de13800dee562de.svg","type":"costume","tags":["fashion","glasses"],"info":[35,14,1]},{"name":"Glasses-c","md5":"d8bf373e1fcbb46f6eb8d225ba01613e.svg","type":"costume","tags":["fashion","glasses"],"info":[34,12,1]},{"name":"Glasses-e","md5":"6b706718a8c350522c3f29fb82b40327.svg","type":"costume","tags":["fashion","glasses"],"info":[39,53,1]},{"name":"Goalie-a","md5":"dbf6a1b0402377be2cd8c75a3b4fdf53.svg","type":"costume","tags":["sports","soccer","football","alex eben meyer"],"info":[59,63,1]},{"name":"Goalie-b","md5":"987d8c2bb6c26cad265a3aa339fe432e.svg","type":"costume","tags":["sports","soccer","football","alex eben meyer"],"info":[59,63,1]},{"name":"Goalie-c","md5":"52609ef559a29052e72efe08d1384980.svg","type":"costume","tags":["sports","soccer","football","alex eben meyer"],"info":[62,61,1]},{"name":"Goalie-d","md5":"a4de535b4c4a7c6a65e6736491e01497.svg","type":"costume","tags":["sports","soccer","football","alex eben meyer"],"info":[63,62,1]},{"name":"Goalie-e","md5":"ca55a23f3172e9fff061484e00493d2c.svg","type":"costume","tags":["sports","soccer","football","alex eben meyer"],"info":[59,69,1]},{"name":"Goblin-a","md5":"f10eaedff51f50f0809a7b4b310337fa.svg","type":"costume","tags":["fantasy","ipzy","emotions"],"info":[40,80,1]},{"name":"Goblin-b","md5":"71e7c77d89299cd99739b1216fc03a85.svg","type":"costume","tags":["fantasy","ipzy","emotions"],"info":[40,80,1]},{"name":"Goblin-c","md5":"ab0611427d6f9b54d83672cf9e554876.svg","type":"costume","tags":["fantasy","ipzy","emotions"],"info":[40,80,1]},{"name":"Goblin-d","md5":"87dd413e7a8545bea9b3da208a5d5735.svg","type":"costume","tags":["fantasy","ipzy","emotions"],"info":[40,80,1]},{"name":"Gobo-a","md5":"1f5ea0d12f85aed2e471cdd21b0bd6d7.svg","type":"costume","tags":["fantasy","drawing","jenkins","ganglia"],"info":[47,55,1]},{"name":"Gobo-b","md5":"73e493e4abd5d0954b677b97abcb7116.svg","type":"costume","tags":["fantasy","drawing","jenkins","ganglia"],"info":[47,55,1]},{"name":"Gobo-c","md5":"bc68a6bdf300df7b53d73b38f74c844e.svg","type":"costume","tags":["fantasy","drawing","jenkins","ganglia"],"info":[47,55,1]},{"name":"Grasshopper-a","md5":"fcddf46c04479b07b2944ee36d0b7635.svg","type":"costume","tags":["animals","insect","bug","wetland","owen davey"],"info":[103,43,1]},{"name":"Grasshopper-b","md5":"40b48bcb95f06a2281ba1cad60c8c504.svg","type":"costume","tags":["animals","insect","bug","wetland","owen davey"],"info":[114,118,1]},{"name":"Grasshopper-c","md5":"fa9a02a4a6df86612365dc65c065d2cb.svg","type":"costume","tags":["animals","insect","bug","wetland","owen davey"],"info":[34,170,1]},{"name":"Grasshopper-d","md5":"f80ba703a7fb17a870ec0818add2f3b8.svg","type":"costume","tags":["animals","insect","bug","wetland","owen davey"],"info":[70,100,1]},{"name":"Grasshopper-e","md5":"6519eeaa65eac086198d6901cf0a5b9e.svg","type":"costume","tags":["animals","insect","bug","wetland","owen davey"],"info":[56,86,1]},{"name":"Grasshopper-f","md5":"8d865e6bbea03cda509d766085b883f4.svg","type":"costume","tags":["animals","insect","bug","wetland","owen davey"],"info":[22,54,1]},{"name":"Green Flag","md5":"173e20ac537d2c278ed621be3db3fc87.svg","type":"costume","tags":["thing"],"info":[70,30,1]},{"name":"Griffin-a","md5":"1ceea469ec409d0a3a13bd04ea1e756c.svg","type":"costume","tags":["fantasy","animals","ipzy","flying"],"info":[127,109,1]},{"name":"Griffin-b","md5":"1dd10e8e53c048ad6f95c82501801f48.svg","type":"costume","tags":["fantasy","animals","ipzy","flying"],"info":[127,76,1]},{"name":"Griffin-c","md5":"e4d7c3c18463f15083683ce0826adcee.svg","type":"costume","tags":["fantasy","animals","ipzy","flying"],"info":[127,109,1]},{"name":"Griffin-d","md5":"54504b1d8dedf816b0bd599e768f191d.svg","type":"costume","tags":["fantasy","animals","ipzy","flying"],"info":[144,69,1]},{"name":"Guitar-a","md5":"cb8c2a5e69da7538e1dd73cb7ff4a666.svg","type":"costume","tags":["music","andrew rae"],"info":[47,83,1]},{"name":"Guitar-b","md5":"fed44bd1091628c060f45060a84f2885.svg","type":"costume","tags":["music","andrew rae"],"info":[47,83,1]},{"name":"Guitar-electric1-a","md5":"b2b469b9d11fd23bdd671eab94dc58ff.svg","type":"costume","tags":["music","andrew rae"],"info":[42,85,1]},{"name":"Guitar-electric1-b","md5":"3632184c19c66a088a99568570d61b13.svg","type":"costume","tags":["music","andrew rae"],"info":[42,85,1]},{"name":"Guitar-electric2-a","md5":"1fc433b89038f9e16092c9f4d7514cca.svg","type":"costume","tags":["music","andrew rae"],"info":[38,94,1]},{"name":"Guitar-electric2-b","md5":"7b843dbc93d4b2ea31fa67cca3d5077c.svg","type":"costume","tags":["music","andrew rae"],"info":[38,94,1]},{"name":"Hannah-a","md5":"b983d99560313e38b4b3cd36cbd5f0d1.png","type":"costume","tags":["people","run","running","sprint","sports"],"info":[276,252,2]},{"name":"Hannah-b","md5":"d0c3b4b24fbf1152de3ebb68f6b875ae.png","type":"costume","tags":["people","sports"],"info":[96,320,2]},{"name":"Hannah-c","md5":"5fdce07935156bbcf943793fa84e826c.png","type":"costume","tags":["people","sports"],"info":[340,260,2]},{"name":"Hare-a","md5":"8209c43050785e3c4276f84abb52c245.svg","type":"costume","tags":["animals","rabbit","cold","north pole","south pole","ice","antarctica","arctic","robert hunter"],"info":[29,50,1]},{"name":"Hare-b","md5":"62796e48dc8e540398e0575d79f562fe.svg","type":"costume","tags":["animals","rabbit","cold","north pole","south pole","ice","antarctica","arctic","robert hunter"],"info":[57,35,1]},{"name":"Hare-c","md5":"4bc5c29283dfff4b9c876cc23540a4b5.svg","type":"costume","tags":["animals","rabbit","cold","north pole","south pole","ice","antarctica","arctic","robert hunter"],"info":[40,40,1]},{"name":"Harper-a","md5":"0d5979db40b0a4dcaa601fb7679ef71c.svg","type":"costume","tags":["people","fashion"],"info":[54,143,1]},{"name":"Harper-b","md5":"c435a1fcdf5f60a29f620fa800e391e0.svg","type":"costume","tags":["people","fashion"],"info":[54,134,1]},{"name":"Harper-c","md5":"9c35763ec87604ff1b4848ff18e0b040.svg","type":"costume","tags":["people","fashion"],"info":[56,138,1]},{"name":"Hat-a","md5":"52540f9dba4537f79f1ad3067d44e3f6.svg","type":"costume","tags":["fashion","hat"],"info":[37,30,1]},{"name":"Hat-b","md5":"874462b3e079308d775629c235940d8f.svg","type":"costume","tags":["fashion","hat"],"info":[39,22,1]},{"name":"Hat-c","md5":"b40accecd4bd57fed8bdb96ee15e5c05.svg","type":"costume","tags":["fashion","hat"],"info":[40,27,1]},{"name":"Hat-d","md5":"a8ef874bd7542fec62785eac80019417.svg","type":"costume","tags":["fashion","hat"],"info":[45,30,1]},{"name":"Hatchling-a","md5":"25e4da6bcd209c60690729f5c7016b83.svg","type":"costume","tags":["animals","chicken","farm","owen davey"],"info":[15,23,1]},{"name":"Hatchling-b","md5":"b0f8451e7c52cf2b94b94c4a2051398b.svg","type":"costume","tags":["animals","chicken","farm","owen davey"],"info":[16,38,1]},{"name":"Hatchling-c","md5":"5f70ae46957bf425121ac532dc6a2f34.svg","type":"costume","tags":["animals","chicken","farm","owen davey"],"info":[38,72,1]},{"name":"Heart Code","md5":"1bc73fc472df673a1089d965b537f5ac.svg","type":"costume","tags":["food","sweethearts"],"info":[73,72,1]},{"name":"Heart Face","md5":"4ab84263da32069cf97cc0fa52729a0d.svg","type":"costume","tags":["emotions"],"info":[59,52,1]},{"name":"Heart Love","md5":"a9d25b961eef81521c8ed38beb1456a0.svg","type":"costume","tags":["food","sweethearts"],"info":[73,72,1]},{"name":"Heart Purple","md5":"b15362bb6b02a59e364db9081ccf19aa.svg","type":"costume","tags":["holiday","purple","shape","love","emotions"],"info":[66,62,1]},{"name":"Heart Red","md5":"6e79e087c866a016f99ee482e1aeba47.svg","type":"costume","tags":["holiday","red","shape","love","emotions"],"info":[65,56,1]},{"name":"Heart Smile","md5":"66b29ca063bc74d2bacfc0a06bc7b6fc.svg","type":"costume","tags":["food","sweethearts"],"info":[73,72,1]},{"name":"Heart Sweet","md5":"9a9a8efa369379ee8538632c43a6a3d1.svg","type":"costume","tags":["food","sweethearts"],"info":[73,72,1]},{"name":"Hedgehog-a","md5":"32416e6b2ef8e45fb5fd10778c1b9a9f.svg","type":"costume","tags":["animals","daria skrybchencko","mammal","spikey"],"info":[71,56,1]},{"name":"Hedgehog-b","md5":"4d3ccc06660e07b55bd38246e1f82f7f.svg","type":"costume","tags":["animals","daria skrybchencko","mammal","spikey"],"info":[71,56,1]},{"name":"Hedgehog-c","md5":"2446f79c0f553594cfbcdbe6b1e459a5.svg","type":"costume","tags":["animals","daria skrybchencko","mammal","spikey"],"info":[71,56,1]},{"name":"Hedgehog-d","md5":"bdb7c8e86125092da0c4848d1ffd901c.svg","type":"costume","tags":["animals","daria skrybchencko","mammal","spikey"],"info":[71,56,1]},{"name":"Hedgehog-e","md5":"78a0e3789f6d778e20f9bf3d308a0b19.svg","type":"costume","tags":["animals","daria skrybchencko","mammal","spikey"],"info":[61,45,1]},{"name":"Hen-a","md5":"eb0a9890a92ef616ef8740328eeabb79.svg","type":"costume","tags":["animals","chicken","farm","owen davey"],"info":[60,53,1]},{"name":"Hen-b","md5":"12aabf8636096f223e9297d2fd8177a4.svg","type":"costume","tags":["animals","chicken","farm","owen davey"],"info":[63,50,1]},{"name":"Hen-c","md5":"af2c57d1f12272335629635e669df487.svg","type":"costume","tags":["animals","chicken","farm","owen davey"],"info":[56,53,1]},{"name":"Hen-d","md5":"84d0492c094ec01d73f808c92b4c3138.svg","type":"costume","tags":["animals","chicken","farm","owen davey"],"info":[51,77,1]},{"name":"Hippo1-a","md5":"c1353c4a5eec5e6f32ed053e6f6e8f99.svg","type":"costume","tags":["animals","mammals","flying","fantasy","insect","pachydermata"],"info":[69,65,1]},{"name":"Hippo1-b","md5":"e65ed93bbb9cccf698fc7e774ab609a6.svg","type":"costume","tags":["animals","mammals","flying","fantasy","insect","pachydermata"],"info":[69,68,1]},{"name":"Home Button","md5":"1bac530a0701a8fc88bb0802ae6787a3.svg","type":"costume","tags":["ui","thing"],"info":[72,72,1]},{"name":"Horse-a","md5":"83a698304f00242a34ddd63b1525373b.svg","type":"costume","tags":["animals","hoof","hooves","mammal","racing","saddle"],"info":[119,83,1]},{"name":"Horse-b","md5":"2e7d212692b46b049a9ebc1224edd990.svg","type":"costume","tags":["animals","hoof","hooves","mammal","racing","saddle"],"info":[103,97,1]},{"name":"Jaime Walking-a","md5":"d6cc9814f7a6640e4c2b1a4276987dc5.png","type":"costume","tags":["people"],"info":[212,344,2]},{"name":"Jaime Walking-b","md5":"7fb579a98d6db257f1b16109d3c4609a.png","type":"costume","tags":["people"],"info":[104,352,2]},{"name":"Jaime Walking-c","md5":"5883bdefba451aaeac8d77c798d41eb0.png","type":"costume","tags":["people"],"info":[176,340,2]},{"name":"Jaime Walking-d","md5":"4b9d2162e30dbb924840575ed35fddb0.png","type":"costume","tags":["people"],"info":[92,348,2]},{"name":"Jaime Walking-e","md5":"63e56d28cc3e3d9b735e1f1d51248cc0.png","type":"costume","tags":["people"],"info":[168,344,2]},{"name":"Jaime-a","md5":"3ddc912edef87ae29121f57294fa0cb5.png","type":"costume","tags":["people"],"info":[152,308,2]},{"name":"Jaime-b","md5":"5a683f4536abca0f83a77bc341df4c9a.png","type":"costume","tags":["people"],"info":[136,308,2]},{"name":"Jamal-a","md5":"c7531e6c05aa488edd6ad3c369204452.svg","type":"costume","tags":["sports","basketball","people","alex eben meyer"],"info":[55,49,1]},{"name":"Jamal-b","md5":"8b8bd6ff0fe64e7056d1e70c63b9ec9f.svg","type":"costume","tags":["sports","basketball","people","alex eben meyer"],"info":[75,53,1]},{"name":"Jamal-c","md5":"c659f292333f93854be243f84b337ec5.svg","type":"costume","tags":["sports","basketball","people","alex eben meyer"],"info":[54,102,1]},{"name":"Jamal-d","md5":"9dc8cfa22793c43aee826c76d144e09b.svg","type":"costume","tags":["sports","basketball","people","alex eben meyer"],"info":[54,95,1]},{"name":"Jar-a","md5":"73784b267083733e08bcf06aa7d6536a.svg","type":"costume","tags":["food","ipzy","things","fruit"],"info":[20,25,1]},{"name":"Jar-b","md5":"a37eb72115966a75bc1bf521deeccc0c.svg","type":"costume","tags":["food","ipzy","things"],"info":[20,25,1]},{"name":"Jellyfish-a","md5":"9e6563e417350af3094c2ed02b9b0bbd.svg","type":"costume","tags":["animals","ocean","underwater","daria skrybchencko"],"info":[99,86,1]},{"name":"Jellyfish-b","md5":"31a42fad0891f1298c522a6d5008930a.svg","type":"costume","tags":["animals","ocean","underwater","daria skrybchencko"],"info":[99,86,1]},{"name":"Jellyfish-c","md5":"697262d9ed04467bae52cca786c36bd3.svg","type":"costume","tags":["animals","ocean","underwater","daria skrybchencko"],"info":[99,86,1]},{"name":"Jellyfish-d","md5":"6a949493aaf62954f1c74f8369d494c4.svg","type":"costume","tags":["animals","ocean","underwater","daria skrybchencko"],"info":[99,86,1]},{"name":"Jo Pop Down","md5":"a55fbb529c10f70bcb374aef8a63571b.png","type":"costume","tags":["people","dance"],"info":[136,148,2]},{"name":"Jo Pop Front","md5":"3d3ea804243800981acabc7caba10939.png","type":"costume","tags":["people","dance"],"info":[140,456,2]},{"name":"Jo Pop L Arm","md5":"a9fbc01a4124d555da12630312e46197.png","type":"costume","tags":["people","dance"],"info":[216,516,2]},{"name":"Jo Pop Left","md5":"ea812b4c2b2405aa2b73158023298f71.png","type":"costume","tags":["people","dance"],"info":[392,452,2]},{"name":"Jo Pop R Arm","md5":"aabfedff0d11243386b6b0941e0f72e9.png","type":"costume","tags":["people","dance"],"info":[216,520,2]},{"name":"Jo Pop Right","md5":"01dd2f553c7262329ebaba2516e3a2b1.png","type":"costume","tags":["people","dance"],"info":[132,484,2]},{"name":"Jo Pop Stand","md5":"75ee2383fd83992b401c8a0730521d94.png","type":"costume","tags":["people","dance"],"info":[156,524,2]},{"name":"Jo Stance","md5":"6f68790ee3eb9bdccf8749305186b0dd.png","type":"costume","tags":["people","dance"],"info":[188,480,2]},{"name":"Jo Top L Cross","md5":"2e2a6534d33883fdd2f8471a1adbebb7.png","type":"costume","tags":["people","dance"],"info":[168,536,2]},{"name":"Jo Top L Leg","md5":"a12f40b18067bb31746f9cf461de88aa.png","type":"costume","tags":["people","dance"],"info":[416,536,2]},{"name":"Jo Top R Cross","md5":"c2d5519e8a0f2214ff757117038c28dc.png","type":"costume","tags":["people","dance"],"info":[288,540,2]},{"name":"Jo Top R Leg","md5":"efaa8eb6c8cf7dc35d4d37d546ebd333.png","type":"costume","tags":["people","dance"],"info":[436,524,2]},{"name":"Jo Top Stand","md5":"0ed4a09c41871d150c51119c1bceded2.png","type":"costume","tags":["people","dance"],"info":[136,520,2]},{"name":"Jordyn-a","md5":"8355df83cca2baa0fdf6269d1311f1ea.svg","type":"costume","tags":["sports","soccer","football","people","alex eben meyer"],"info":[51,63,1]},{"name":"Jordyn-b","md5":"2e2c43bbd7b18524fb132f1426ca3134.svg","type":"costume","tags":["sports","soccer","football","people","alex eben meyer"],"info":[51,63,1]},{"name":"Jordyn-c","md5":"5c0d24c53805e16358a2f6f6cc4a456e.svg","type":"costume","tags":["sports","soccer","football","people","alex eben meyer"],"info":[68,61,1]},{"name":"Jordyn-d","md5":"ebe2b20b99c1e1b373fd2b02be48aab9.svg","type":"costume","tags":["sports","soccer","football","people","alex eben meyer"],"info":[40,61,1]},{"name":"Kai-a","md5":"6e007fde15e49c66ee7996561f80b452.png","type":"costume","tags":["people"],"info":[136,320,2]},{"name":"Kai-b","md5":"c1e1149f6d7e308e3e4eba14ccc8a751.png","type":"costume","tags":["people"],"info":[164,316,2]},{"name":"Key","md5":"af35300cef35803e11f4ed744dc5e818.svg","type":"costume","tags":["fantasy","thing"],"info":[42,27,1]},{"name":"Keyboard-a","md5":"c67d180e964926b6393ac14781541b39.svg","type":"costume","tags":["music","andrew rae"],"info":[72,68,1]},{"name":"Keyboard-b","md5":"dbaf62b33de45093c3c7d13b5d49d637.svg","type":"costume","tags":["music","andrew rae"],"info":[72,68,1]},{"name":"Kiran-a","md5":"9de23c4a7a7fbb67136b539241346854.svg","type":"costume","tags":["space","people","wren mcdonald"],"info":[67,95,1]},{"name":"Kiran-b","md5":"f1e74f3c02333e9e2068e8baf4e77aa0.svg","type":"costume","tags":["space","people","wren mcdonald"],"info":[67,95,1]},{"name":"Kiran-c","md5":"e2482cf509c312935f08be0e2e2c9d84.svg","type":"costume","tags":["space","people","wren mcdonald"],"info":[67,95,1]},{"name":"Kiran-d","md5":"569e736b519199efddfbae2572f7e92b.svg","type":"costume","tags":["space","people","wren mcdonald"],"info":[67,95,1]},{"name":"Kiran-e","md5":"2261bed0f2cc819def17969158297b4f.svg","type":"costume","tags":["space","people","wren mcdonald"],"info":[77,95,1]},{"name":"Kiran-f","md5":"d7f44adb3dc7906b9dfb3599a028e0d6.svg","type":"costume","tags":["space","people","wren mcdonald"],"info":[62,94,1]},{"name":"Knight","md5":"f2c5e8bc24d001b81566879dbf2f1a13.svg","type":"costume","tags":["people","castle","armor"],"info":[75,75,1]},{"name":"Ladybug2","md5":"f16a1ccc69a4a8190a927f1595aa7bfa.svg","type":"costume","tags":["animals","insect","bug","antennae"],"info":[41,43,1]},{"name":"Ladybug2-a","md5":"c018a3eed966d5f92c69f2188dfd2aae.svg","type":"costume","tags":["animals","insect","arthropod","antennae","aphids"],"info":[49,28,1]},{"name":"Ladybug2-b","md5":"a2bb15ace808e070a2b815502952b292.svg","type":"costume","tags":["animals","insect","arthropod","antennae","aphids"],"info":[49,28,1]},{"name":"Laptop","md5":"76f456b30b98eeefd7c942b27b524e31.svg","type":"costume","tags":["things","computers"],"info":[75,75,1]},{"name":"Lb Pop Down","md5":"563f86443cb102b9241cebb62eb2d81a.png","type":"costume","tags":["people","dance"],"info":[112,180,2]},{"name":"Lb Pop Front","md5":"cdd52259075b75628001672d375e4985.png","type":"costume","tags":["people","dance"],"info":[132,544,2]},{"name":"Lb Pop L Arm","md5":"b508808c087adb55ce156f5cfbdac61b.png","type":"costume","tags":["people","dance"],"info":[200,524,2]},{"name":"Lb Pop Left","md5":"525285312925e1e6b4e237a119b61305.png","type":"costume","tags":["people","dance"],"info":[396,532,2]},{"name":"Lb Pop R Arm","md5":"0725440743391e7c622bb5df6a94e1d4.png","type":"costume","tags":["people","dance"],"info":[156,516,2]},{"name":"Lb Pop Right","md5":"0a2461b3b9a4b8603e75565d78b1d4d7.png","type":"costume","tags":["people","dance"],"info":[152,528,2]},{"name":"Lb Pop Stand","md5":"5f176ef763be18f7c342dc2e2de7bf16.png","type":"costume","tags":["people","dance"],"info":[132,536,2]},{"name":"Lb Stance","md5":"71dde8c43985815bffb5a5ed5632af58.png","type":"costume","tags":["people","dance"],"info":[108,488,2]},{"name":"Lb Top L Cross","md5":"645d6e2674452009df7a9a844a604791.png","type":"costume","tags":["people","dance"],"info":[296,516,2]},{"name":"Lb Top L Leg","md5":"63d099e94aa8a973dcfa4c5d8b4a3e7a.png","type":"costume","tags":["people","dance"],"info":[468,572,2]},{"name":"Lb Top R Cross","md5":"4423159d81378ada5ffd7f053d7ef471.png","type":"costume","tags":["people","dance"],"info":[348,512,2]},{"name":"Lb Top R Leg","md5":"79ca528d13ffb557a236f0a35a0eb486.png","type":"costume","tags":["people","dance"],"info":[488,500,2]},{"name":"Lb Top Stand","md5":"e68d899e178309ff3eae3e1de8a8ec28.png","type":"costume","tags":["people","dance"],"info":[140,496,2]},{"name":"Lightning","md5":"c2d636ab2b491e591536afc3d49cbecd.svg","type":"costume","tags":["weather","whether","fantasy","storm","thunder"],"info":[21,83,1]},{"name":"Line","md5":"1b2cfb4d4746522aeb84e16a62820299.svg","type":"costume","tags":["lava","shape","red"],"info":[239,7,1]},{"name":"Lion-a","md5":"75e6b2178518fa354f1ebf7ab7061ceb.svg","type":"costume","tags":["cat","animals","africa","savanna","robert hunter"],"info":[95,43,1]},{"name":"Lion-b","md5":"7304176fe4dc85758e6b77324a185ea2.svg","type":"costume","tags":["cat","animals","africa","savanna","robert hunter"],"info":[94,43,1]},{"name":"Lion-c","md5":"8411de793909216761cd19fd95418945.svg","type":"costume","tags":["cat","animals","africa","savanna","robert hunter"],"info":[95,43,1]},{"name":"Llama","md5":"f5841f36b41c4df26f9c724d913c279b.svg","type":"costume","tags":["animals","mammal","robert hunter"],"info":[72,95,1]},{"name":"Llama-b","md5":"ef3f8491668de2b751d8d7a8921c9879.svg","type":"costume","tags":["animals","mammal","robert hunter"],"info":[92,90,1]},{"name":"Llama-c","md5":"b0af19d2c7a7c039c060f21874816164.svg","type":"costume","tags":["animals","mammal","robert hunter"],"info":[73,39,1]},{"name":"Magicwand","md5":"3db9bfe57d561557795633c5cda44e8c.svg","type":"costume","tags":["fantasy","things","zap"],"info":[41,18,1]},{"name":"Max-a","md5":"5cc168bddf4561e6e7f1d30845d6efbf.svg","type":"costume","tags":["sports","basketball","people","alex eben meyer"],"info":[70,61,1]},{"name":"Max-b","md5":"8e2ad5735e26c5544b6b1a057f4efa80.svg","type":"costume","tags":["sports","basketball","people","alex eben meyer"],"info":[71,64,1]},{"name":"Max-c","md5":"261a40ebecfe135308befd79c6c07fd5.svg","type":"costume","tags":["sports","basketball","people","alex eben meyer"],"info":[46,59,1]},{"name":"Max-d","md5":"4b6eecd411daddef6422fa3a5850cd52.svg","type":"costume","tags":["sports","basketball","people","alex eben meyer"],"info":[37,59,1]},{"name":"Mermaid-a","md5":"36db41c47259881c26d9b98a806d3308.svg","type":"costume","tags":["fantasy","people","underwater","ipzy"],"info":[92,130,1]},{"name":"Mermaid-b","md5":"564bf3f466df3b3e8aba71eeae8255ab.svg","type":"costume","tags":["fantasy","people","underwater","ipzy"],"info":[92,130,1]},{"name":"Mermaid-c","md5":"2295784bb8e6354bfa7676089235cb9f.svg","type":"costume","tags":["fantasy","people","underwater","ipzy"],"info":[150,115,1]},{"name":"Mermaid-d","md5":"9f973b89b68f7d8147f157cbac8af341.svg","type":"costume","tags":["fantasy","people","underwater","ipzy"],"info":[150,115,1]},{"name":"Microphone-a","md5":"9126b6362313e20578fb88d38902cd4c.svg","type":"costume","tags":["music","andrew rae"],"info":[40,88,1]},{"name":"Microphone-b","md5":"29988ebbde49beaceb06d9eb66138b80.svg","type":"costume","tags":["music","andrew rae"],"info":[40,88,1]},{"name":"Milk-a","md5":"1b8ec45254b7c40d86e7a33818b77e35.svg","type":"costume","tags":["food","drink","alex eben meyer"],"info":[32,63,1]},{"name":"Milk-b","md5":"2ba802dcac09a81f9d82cc9d3b95d71b.svg","type":"costume","tags":["food","drink","alex eben meyer"],"info":[42,64,1]},{"name":"Milk-c","md5":"287b322e939ad54691aef4876c48f422.svg","type":"costume","tags":["food","drink","alex eben meyer"],"info":[47,56,1]},{"name":"Milk-d","md5":"df4f5d863fa680331aa6c8f867b9fcbb.svg","type":"costume","tags":["food","drink","alex eben meyer"],"info":[45,64,1]},{"name":"Milk-e","md5":"e642678d42d5e74fe49e6ceb5538724e.svg","type":"costume","tags":["food","drink","alex eben meyer"],"info":[35,45,1]},{"name":"Monet-a","md5":"11c46aaa5e30ad46f5c1883d6feb47b8.svg","type":"costume","tags":["space","people","wren mcdonald"],"info":[64,87,1]},{"name":"Monet-b","md5":"9c8f83e39dc8ac49d57c0622ffe2063f.svg","type":"costume","tags":["space","people","wren mcdonald"],"info":[64,87,1]},{"name":"Monet-c","md5":"4435678d26e8fbc266d647693f65f5d7.svg","type":"costume","tags":["space","people","wren mcdonald"],"info":[64,87,1]},{"name":"Monet-d","md5":"42113ca3eca593c3a8f232a9202d6f14.svg","type":"costume","tags":["space","people","wren mcdonald"],"info":[82,87,1]},{"name":"Monet-e","md5":"e530d0dac5290c5366af719cfb4e5953.svg","type":"costume","tags":["space","people","wren mcdonald"],"info":[65,89,1]},{"name":"Monkey-a","md5":"6e4de762dbd52cd2b6356694a9668211.svg","type":"costume","tags":["animals","mammals","primate","prehensile tail"],"info":[68,99,1]},{"name":"Monkey-b","md5":"7662a3a0f4c6fa21fdf2de33bd80fe5f.svg","type":"costume","tags":["animals","mammals","primate","prehensile tail"],"info":[68,99,1]},{"name":"Monkey-c","md5":"db8eb50b948047181922310bb94511fb.svg","type":"costume","tags":["animals","mammals","primate","prehensile tail"],"info":[68,99,1]},{"name":"Motorcycle-a","md5":"5065a917834923efc3e0c112d5791e80.svg","type":"costume","tags":["city","bike","vehicle","motorcycle"],"info":[52,44,1]},{"name":"Motorcycle-b","md5":"fe0923cb08c0b7c373de1daf8b74de74.svg","type":"costume","tags":["city","vehicle","bike","motorcycle"],"info":[52,44,1]},{"name":"Motorcycle-c","md5":"6af27b2b5e1eeae9e60702630e6909a8.svg","type":"costume","tags":["city","vehicle","bike","motorcycle"],"info":[52,44,1]},{"name":"Motorcycle-d","md5":"c5d78ac1de3a7f786a4ca6dc0fe087d4.svg","type":"costume","tags":["city","vehicle","bike","motorcycle"],"info":[52,44,1]},{"name":"Mouse1-a","md5":"e1f0c26afecbe9d4b9923d8e6bf489a8.svg","type":"costume","tags":["animals","mammals","rodents"],"info":[50,27,1]},{"name":"Mouse1-b","md5":"f5e477a3f94fc98ba3cd927228405646.svg","type":"costume","tags":["animals","mammals","rodents"],"info":[65,21,1]},{"name":"Muffin-a","md5":"18da0857a1b7f1c960146d2b85edd10f.svg","type":"costume","tags":["food"],"info":[85,48,1]},{"name":"Muffin-b","md5":"a89f3b99bf4cccfaeb1b39e25633c53c.svg","type":"costume","tags":["food","eaten"],"info":[85,48,1]},{"name":"Nano-a","md5":"02c5433118f508038484bbc5b111e187.svg","type":"costume","tags":["fantasy","drawing"],"info":[61,60,1]},{"name":"Nano-b","md5":"10d6d9130618cd092ae02158cde2e113.svg","type":"costume","tags":["fantasy","drawing","happy"],"info":[61,60,1]},{"name":"Nano-c","md5":"85e762d45bc626ca2edb3472c7cfaa32.svg","type":"costume","tags":["fantasy","drawing","happy"],"info":[61,60,1]},{"name":"Nano-d","md5":"b10925346da8080443f27e7dfaeff6f7.svg","type":"costume","tags":["fantasy","drawing","angry"],"info":[61,60,1]},{"name":"Neigh Pony","md5":"176c4fb4df80df899ca28a48bd1f0edf.svg","type":"costume","tags":["animals","fantasy"],"info":[74,78,1]},{"name":"Octopus-a","md5":"038df646d2f935d2a5dd601b343fc1d9.svg","type":"costume","tags":["animals","ocean","underwater","daria skrybchencko"],"info":[88,86,1]},{"name":"Octopus-b","md5":"31bdcbdf05688c01aace3fd94c5e82df.svg","type":"costume","tags":["animals","ocean","underwater","daria skrybchencko"],"info":[88,86,1]},{"name":"Octopus-c","md5":"51e80c09323e36489ad452250acd827c.svg","type":"costume","tags":["animals","ocean","underwater","teacup","daria skrybchencko"],"info":[88,86,1]},{"name":"Octopus-d","md5":"b4242e6cde0392bb9a5fb43a8f232962.svg","type":"costume","tags":["animals","ocean","underwater","pirate","daria skrybchencko"],"info":[88,86,1]},{"name":"Octopus-e","md5":"edfda0a36d9cd8482e3a8dc317107d56.svg","type":"costume","tags":["animals","ocean","underwater","music","daria skrybchencko"],"info":[88,86,1]},{"name":"Orange","md5":"27d5dfbadceea215e983d2641ce3e51f.svg","type":"costume","tags":["food","fruit"],"info":[19,18,1]},{"name":"Orange2-a","md5":"8a7d8515df41f83c1326ec3233a3a42a.svg","type":"costume","tags":["food","fruit","eaten"],"info":[49,24,1]},{"name":"Orange2-b","md5":"70c7f1822ffdb37157c304273dae9102.svg","type":"costume","tags":["food","fruit","eaten"],"info":[49,27,1]},{"name":"Outfielder-a","md5":"d2e2e4a9249c4cbe479e431a4c985286.svg","type":"costume","tags":["baseball","sports","people","alex eben meyer"],"info":[42,78,1]},{"name":"Outfielder-b","md5":"5a960b109ae5dbe3c3ea5555894e8c13.svg","type":"costume","tags":["baseball","sports","people","alex eben meyer"],"info":[42,74,1]},{"name":"Outfielder-c","md5":"480ab4ce1ab5586e829e1cf804824c8b.svg","type":"costume","tags":["baseball","sports","people","alex eben meyer"],"info":[67,97,1]},{"name":"Outfielder-d","md5":"e5803b5601e0aafa8d0b227f1b1ae742.svg","type":"costume","tags":["baseball","sports","people","alex eben meyer"],"info":[130,114,1]},{"name":"Owl-a","md5":"5348f1ea36a645322e88796545ca8ca1.svg","type":"costume","tags":["animals","bird","robert hunter"],"info":[24,40,1]},{"name":"Owl-b","md5":"3d8ba4198a03e484ed63bde584fd5bc1.svg","type":"costume","tags":["animals","bird","robert hunter"],"info":[44,46,1]},{"name":"Owl-c","md5":"4e81445e70169f074ad50473a78f3381.svg","type":"costume","tags":["animals","bird","robert hunter"],"info":[109,41,1]},{"name":"Paddle","md5":"8038149bdfe24733ea2144d37d297815.svg","type":"costume","tags":["thing"],"info":[44,7,1]},{"name":"Panther-a","md5":"04ca2c122cff11b9bc23834d6f79361e.svg","type":"costume","tags":["animals","tiger","leopard","robert hunter"],"info":[125,81,1]},{"name":"Panther-b","md5":"f8c33765d1105f3bb4cd145fad0f717e.svg","type":"costume","tags":["animals","tiger","leopard","robert hunter"],"info":[125,81,1]},{"name":"Panther-c","md5":"096bf9cad84def12eef2b5d84736b393.svg","type":"costume","tags":["animals","tiger","leopard","robert hunter"],"info":[125,81,1]},{"name":"Pants-a","md5":"f7a0584eca14eaa0e29662e5c24fb62d.svg","type":"costume","tags":["fashion","pants"],"info":[34,66,1]},{"name":"Pants-b","md5":"22ea0cf68b885817a5b6a01194c6f5d3.svg","type":"costume","tags":["fashion","pants"],"info":[35,66,1]},{"name":"Parrot-a","md5":"098570b8e1aa85b32f9b4eb07bea3af2.svg","type":"costume","tags":["animals","bird","birb","tropical","color","flying"],"info":[86,106,1]},{"name":"Parrot-b","md5":"721255a0733c9d8d2ba518ff09b3b7cb.svg","type":"costume","tags":["animals","bird","birb","tropical","color","flying"],"info":[49,31,1]},{"name":"Party Hat-a","md5":"f3ee428806f9fa6d396e30a8d6d0e741.svg","type":"costume","tags":["fashion","winter"],"info":[24,55,1]},{"name":"Party Hat-b","md5":"71b51d9680be4aa946eb6642bc044791.svg","type":"costume","tags":["fashion","winter"],"info":[40,61,1]},{"name":"Party Hat-e","md5":"e69516f2a9bb6d632fdaba4fadd8f8f1.svg","type":"costume","tags":["fashion","winter"],"info":[52,44,1]},{"name":"Pencil-a","md5":"4495fcb0443cebc5d43e66243a88f1ac.svg","type":"costume","tags":["thing","yellow"],"info":[49,54,1]},{"name":"Pencil-b","md5":"21088922dbe127f6d2e58e2e83fb632e.svg","type":"costume","tags":["thing","yellow"],"info":[48,68,1]},{"name":"Penguin-a","md5":"0e78708b8988802d2209a34b50292bd3.svg","type":"costume","tags":["penguin","animals","bird","cold","north pole","south pole","ice","antarctica","arctic","robert hunter"],"info":[36,46,1]},{"name":"Penguin-b","md5":"43af2a0b7f922ec5dc94217b2f3e08e4.svg","type":"costume","tags":["animals","penguin","bird","cold","north pole","south pole","ice","antarctica","arctic","robert hunter"],"info":[26,46,1]},{"name":"Penguin-c","md5":"4f35c3940957e3ffc2e83a2565942171.svg","type":"costume","tags":["animals","penguin","bird","cold","north pole","south pole","ice","antarctica","arctic","robert hunter"],"info":[35,46,1]},{"name":"Penguin2-a","md5":"c17d9e4bdb59c574e0c34aa70af516da.svg","type":"costume","tags":["animals","bird","winter","antarctica"],"info":[54,61,1]},{"name":"Penguin2-b","md5":"b224a582395e0847c2ef4eefcfbc4546.svg","type":"costume","tags":["animals","bird","winter","antarctica"],"info":[54,61,1]},{"name":"Penguin2-c","md5":"35fec7aa5f60cca945fe0615413f1f08.svg","type":"costume","tags":["animals","bird","winter","antarctica"],"info":[48,62,1]},{"name":"Penguin2-d","md5":"18fa51a64ebd5518f0c5c465525346e5.svg","type":"costume","tags":["animals","bird","winter","antarctica"],"info":[48,61,1]},{"name":"Pico Walk1","md5":"8eab5fe20dd249bf22964298b1d377eb.svg","type":"costume","tags":["fantasy","walking"],"info":[54,71,1]},{"name":"Pico Walk2","md5":"39ecd3c38d3f2cd81e3a17ee6c25699f.svg","type":"costume","tags":["fantasy","walking"],"info":[54,71,1]},{"name":"Pico Walk3","md5":"43f7d92dcf9eadf77c07a6fc1eb4104f.svg","type":"costume","tags":["fantasy","walking"],"info":[54,70,1]},{"name":"Pico Walk4","md5":"2582d012d57bca59bc0315c5c5954958.svg","type":"costume","tags":["fantasy","walking"],"info":[54,70,1]},{"name":"Pico-a","md5":"0579fe60bb3717c49dfd7743caa84ada.svg","type":"costume","tags":["fantasy","drawing"],"info":[55,66,1]},{"name":"Pico-b","md5":"26c688d7544757225ff51cd2fb1519b5.svg","type":"costume","tags":["fantasy","drawing","happy"],"info":[55,66,1]},{"name":"Pico-c","md5":"adf61e2090f8060e1e8b2b0604d03751.svg","type":"costume","tags":["fantasy","drawing","happy"],"info":[55,66,1]},{"name":"Pico-d","md5":"594704bf12e3c4d9e83bb91661ad709a.svg","type":"costume","tags":["fantasy","drawing","angry"],"info":[55,66,1]},{"name":"Pitcher-a","md5":"24008f02de4b0d999d4526d34dec8b76.svg","type":"costume","tags":["baseball","sports","people","alex eben meyer"],"info":[42,74,1]},{"name":"Pitcher-b","md5":"4644ab73c577ed878e3ccaa3d89ccc2b.svg","type":"costume","tags":["baseball","sports","people","alex eben meyer"],"info":[75,97,1]},{"name":"Pitcher-c","md5":"f46aa0b114a9977c52eeefa252953e2b.svg","type":"costume","tags":["baseball","sports","people","alex eben meyer"],"info":[69,98,1]},{"name":"Pitcher-d","md5":"d75a06e24f717e8647db27e94618e693.svg","type":"costume","tags":["baseball","sports","people","alex eben meyer"],"info":[84,57,1]},{"name":"Planet2","md5":"978784738c1d9dd4b1d397fd18bdf406.svg","type":"costume","tags":["space"],"info":[72,72,1]},{"name":"Polar Bear-a","md5":"b1d892d9f8a897bc6a446e2ff766ba74.svg","type":"costume","tags":["bear","animals","cold","north pole","south pole","ice","antarctica","arctic","robert hunter"],"info":[104,42,1]},{"name":"Polar Bear-b","md5":"54728e795213e67ac7cecca1c32fe293.svg","type":"costume","tags":["bear","animals","cold","north pole","south pole","ice","antarctica","arctic","robert hunter"],"info":[87,47,1]},{"name":"Polar Bear-c","md5":"7d5812e0aa1cde33771f9270ff521cfe.svg","type":"costume","tags":["bear","animals","cold","north pole","south pole","ice","antarctica","arctic","robert hunter"],"info":[104,43,1]},{"name":"Potion-a","md5":"a317b50b255a208455a7733091adad23.svg","type":"costume","tags":["fantasy","ipzy","things"],"info":[15,21,1]},{"name":"Potion-b","md5":"5f96576605c3a022df48278b630da745.svg","type":"costume","tags":["fantasy","ipzy","things"],"info":[15,28,1]},{"name":"Potion-c","md5":"92d0184c28fac9acb0fb720ec599d61d.svg","type":"costume","tags":["fantasy","ipzy","things"],"info":[15,42,1]},{"name":"Prince","md5":"a760bed1cfc28a30b2dc7fd045c90792.svg","type":"costume","tags":["people","☥","fantasy"],"info":[75,75,1]},{"name":"Princess-a","md5":"fcbf44a543dfda884d8acbd6af66faad.svg","type":"costume","tags":["fantasy","people","ipzy","castle","emotions"],"info":[75,150,1]},{"name":"Princess-b","md5":"562e5eba4a598118411be3062cfbb26f.svg","type":"costume","tags":["fantasy","people","ipzy","castle","emotions"],"info":[75,150,1]},{"name":"Princess-c","md5":"f3e5f466d406745cf1b6ce44b0567b9a.svg","type":"costume","tags":["fantasy","people","ipzy","castle","emotions"],"info":[75,150,1]},{"name":"Princess-d","md5":"663134f64588f0c55e77767ba9039cfe.svg","type":"costume","tags":["fantasy","people","ipzy","castle","emotions"],"info":[75,150,1]},{"name":"Princess-e","md5":"ad0ecbf907d132ddbb547666551ac087.svg","type":"costume","tags":["fantasy","people","ipzy","castle","emotions"],"info":[75,150,1]},{"name":"Pufferfish-a","md5":"81d7db99142a39c9082be2c2183f2175.svg","type":"costume","tags":["animals","ocean","underwater","daria skrybchencko"],"info":[69,61,1]},{"name":"Pufferfish-b","md5":"6ea79950db63f5ac24d6c5091df3836b.svg","type":"costume","tags":["animals","ocean","underwater","daria skrybchencko"],"info":[69,61,1]},{"name":"Pufferfish-c","md5":"4acf5bc398c19d58acf69fce047ee8f6.svg","type":"costume","tags":["animals","ocean","underwater","daria skrybchencko"],"info":[69,61,1]},{"name":"Pufferfish-d","md5":"c214fa8a9ceed06db03664007b8ad5c6.svg","type":"costume","tags":["animals","ocean","underwater","daria skrybchencko"],"info":[69,61,1]},{"name":"Puppy Back","md5":"05630bfa94501a3e5d61ce443a0cea70.png","type":"costume","tags":["animals","dog","puppy"],"info":[468,188,2]},{"name":"Puppy Right","md5":"2768d9e44a0aab055856d301bbc2b04e.png","type":"costume","tags":["animals","dog","puppy"],"info":[214,206,2]},{"name":"Puppy Side","md5":"c4aeb5c39b39ef57a3f18ace54cf7db1.png","type":"costume","tags":["animals","dog","puppy"],"info":[208,228,2]},{"name":"Puppy Sit","md5":"c7817052ed9e78057f877d0d56b5c6a6.png","type":"costume","tags":["animals","dog","puppy"],"info":[174,224,2]},{"name":"Rabbit-a","md5":"2f42891c3f3d63c0e591aeabc5946533.svg","type":"costume","tags":["animals","daria skrybchencko","mammal","bunny","bunnies","fluffy"],"info":[84,84,1]},{"name":"Rabbit-b","md5":"80e05ff501040cdc9f52fa6782e06fd2.svg","type":"costume","tags":["animals","daria skrybchencko","mammal","bunny","bunnies","fluffy"],"info":[84,84,1]},{"name":"Rabbit-c","md5":"88ed8b7925baa025b6c7fc628a64b9b1.svg","type":"costume","tags":["animals","daria skrybchencko","mammal","bunny","bunnies","fluffy"],"info":[84,84,1]},{"name":"Rabbit-d","md5":"5f3b8df4d6ab8a72e887f89f554db0be.svg","type":"costume","tags":["animals","daria skrybchencko","mammal","bunny","bunnies","fluffy"],"info":[84,84,1]},{"name":"Rabbit-e","md5":"3003f1135f4aa3b6c361734243621260.svg","type":"costume","tags":["animals","daria skrybchencko","mammal","bunny","bunnies","fluffy"],"info":[84,84,1]},{"name":"Radio-a","md5":"d2266f31369a97fdf7ec37090bf0a968.svg","type":"costume","tags":["radio","music","beatbox"],"info":[52,38,1]},{"name":"Radio-b","md5":"cd4cff5586d0167fd992772360bddf68.svg","type":"costume","tags":["radio","music","beatbox"],"info":[51,84,1]},{"name":"Rainbow","md5":"680a806bd87a28c8b25b5f9b6347f022.svg","type":"costume","tags":["things","flying","drawing","color"],"info":[72,36,1]},{"name":"Referee-a","md5":"7caaa6c83b0f947268866b48fbf34ed9.svg","type":"costume","tags":["sports","soccer","football","alex eben meyer"],"info":[44,63,1]},{"name":"Referee-b","md5":"b26bc52a8400fa3d51201e9ab4a4dbb2.svg","type":"costume","tags":["sports","soccer","football","alex eben meyer"],"info":[44,63,1]},{"name":"Referee-c","md5":"f96a3af7f21c0b195b8f7a84146b6704.svg","type":"costume","tags":["sports","soccer","football","alex eben meyer"],"info":[55,62,1]},{"name":"Referee-d","md5":"d6795f2992d899611ee5889811801e42.svg","type":"costume","tags":["sports","soccer","football","alex eben meyer"],"info":[50,63,1]},{"name":"Reindeer","md5":"0fff0b181cc4d9250b5b985cc283b049.svg","type":"costume","tags":["animals","mammals","holiday"],"info":[39,70,1]},{"name":"Retro Robot A","md5":"a17c1ce38c261395ae268f3b8a9037db.svg","type":"costume","tags":["robot"],"info":[55,86,1]},{"name":"Retro Robot B","md5":"bfb5afe62358ef542f118299bb53d4b7.svg","type":"costume","tags":["robot"],"info":[52,88,1]},{"name":"Retro Robot C","md5":"f925e3bde178001133a11fa97847a9ae.svg","type":"costume","tags":["robot"],"info":[72,91,1]},{"name":"Ripley-a","md5":"417ec9f25ad70281564e85e67c97aa08.svg","type":"costume","tags":["space","people","wren mcdonald"],"info":[57,89,1]},{"name":"Ripley-b","md5":"e40918acf5c4d1d0d42b437b6b6e965d.svg","type":"costume","tags":["space","people","wren mcdonald"],"info":[57,89,1]},{"name":"Ripley-c","md5":"5fb713effcdae17208e6e89527bf720c.svg","type":"costume","tags":["space","people","wren mcdonald"],"info":[57,89,1]},{"name":"Ripley-d","md5":"6c6597c221c9a5b46c160f537b9795a2.svg","type":"costume","tags":["space","people","wren mcdonald"],"info":[85,89,1]},{"name":"Ripley-e","md5":"92909161afd79673c93a77d15fe8d456.svg","type":"costume","tags":["space","people","wren mcdonald"],"info":[56,89,1]},{"name":"Ripley-f","md5":"16e31a6b510ba4e8c1215e6e3a41d9f9.svg","type":"costume","tags":["space","people","wren mcdonald"],"info":[58,90,1]},{"name":"Robot-a","md5":"cb3985cd066ccbab11954709b3d54c17.svg","type":"costume","tags":["space","robot","wren mcdonald"],"info":[74,109,1]},{"name":"Robot-b","md5":"fc9276d0909539fd31c30db7b2e08bf9.svg","type":"costume","tags":["space","robot","wren mcdonald"],"info":[56,97,1]},{"name":"Robot-c","md5":"c5e02f00d233199fea1c51b71c402ce4.svg","type":"costume","tags":["space","robot","wren mcdonald"],"info":[63,97,1]},{"name":"Robot-d","md5":"ca2cf7d6c0446fbce36621006a4b0fac.svg","type":"costume","tags":["space","robot","wren mcdonald"],"info":[59,95,1]},{"name":"Rocketship-a","md5":"85190bb07708855c0896224340e159ed.svg","type":"costume","tags":["space","spaceship","wren mcdonald"],"info":[63,92,1]},{"name":"Rocketship-b","md5":"2c0f804073ec656a86bbc3ebdf18bf5d.svg","type":"costume","tags":["space","spaceship","wren mcdonald"],"info":[54,92,1]},{"name":"Rocketship-c","md5":"13a0accfa405979e4deee12e6eb9c41e.svg","type":"costume","tags":["space","spaceship","wren mcdonald"],"info":[59,91,1]},{"name":"Rocketship-d","md5":"f4d0c6da1c167abbd8e86ff720ae24f9.svg","type":"costume","tags":["space","spaceship","wren mcdonald"],"info":[65,91,1]},{"name":"Rocketship-e","md5":"6e58c447e994a38b51eeb105dff5711c.svg","type":"costume","tags":["space","spaceship","wren mcdonald"],"info":[71,111,1]},{"name":"Rocks","md5":"82c79fdb6a7d9c49ab7f70ee79a3d7f8.svg","type":"costume","tags":["things","potassium"],"info":[59,15,1]},{"name":"Rooster-a","md5":"db49a3dc8db15ea2b92d7934488f996b.svg","type":"costume","tags":["animals","chicken","farm","owen davey"],"info":[59,70,1]},{"name":"Rooster-b","md5":"c5aa68995a2ac203d6fe2e4dd9d86911.svg","type":"costume","tags":["animals","chicken","farm","owen davey"],"info":[58,70,1]},{"name":"Rooster-c","md5":"b7a5c9f9d387cc7d36d6ed935d2a46b1.svg","type":"costume","tags":["animals","chicken","farm","owen davey"],"info":[54,72,1]},{"name":"Ruby-a","md5":"c30210e8f719c3a4d2c7cc6917a39300.png","type":"costume","tags":["people"],"info":[108,344,2]},{"name":"Ruby-b","md5":"fc15fdbcc535473f6140cab28197f3be.png","type":"costume","tags":["people"],"info":[152,284,2]},{"name":"Sailboat","md5":"ca241a938a2c44a0de6b91230012ff39.png","type":"costume","tags":["boat","transportation"],"info":[448,364,2]},{"name":"Sam","md5":"8208e99159b36c957fb9fbc187e51bc7.png","type":"costume","tags":["people"],"info":[234,318,2]},{"name":"Saxophone-a","md5":"e9e4297f5d7e630a384b1dea835ec72d.svg","type":"costume","tags":["music","andrew rae"],"info":[47,80,1]},{"name":"Saxophone-b","md5":"04e5650480bfcf9190aa35bbd8d67b8e.svg","type":"costume","tags":["music","andrew rae"],"info":[47,80,1]},{"name":"Scarf-a","md5":"5d671a4eb5c42e365d3c0ba1b885d9d8.svg","type":"costume","tags":["fashion","clothing","blue","scarf"],"info":[54,23,1]},{"name":"Scarf-b","md5":"0c03668b4e26eba969ad803a4e810c78.svg","type":"costume","tags":["fashion","clothing","scarf","red"],"info":[54,23,1]},{"name":"Scarf-c","md5":"ce66662165e2756070f1b12e0a7cb5db.svg","type":"costume","tags":["fashionclothing","scarf","purple"],"info":[30,44,1]},{"name":"Shark-a","md5":"4ca6776e9c021e8b21c3346793c9361d.svg","type":"costume","tags":["animals","underwater","ipzy","fish"],"info":[150,60,1]},{"name":"Shark-b","md5":"0bb623f0bbec53ee9667cee0b7ad6d47.svg","type":"costume","tags":["animals","underwater","ipzy","fish"],"info":[150,60,1]},{"name":"Shark2-a","md5":"7c0a907eae79462f69f8e2af8e7df828.svg","type":"costume","tags":["animals","ocean","sea","fish","teeth","carnivore","chomp"],"info":[75,75,1]},{"name":"Shark2-b","md5":"cff9ae87a93294693a0650b38a7a33d2.svg","type":"costume","tags":["animals","ocean","sea","fish","teeth","carnivore","chomp"],"info":[75,75,1]},{"name":"Shark2-c","md5":"afeae3f998598424f7c50918507f6ce6.svg","type":"costume","tags":["animals","ocean","sea","fish","teeth","carnivore","chomp"],"info":[77,37,1]},{"name":"Shirt-a","md5":"659465944053fe6fb6aa1ed0e11be9aa.svg","type":"costume","tags":["fashion","shirt"],"info":[46,40,1]},{"name":"Shoes-a","md5":"4639a1af5bc91f1a6f14e822cd46972f.svg","type":"costume","tags":["fashion","shoes"],"info":[40,13,1]},{"name":"Shoes-b","md5":"6ba2a692c17f47170d611578a5620ae5.svg","type":"costume","tags":["fashion","shoes"],"info":[40,31,1]},{"name":"Shoes-c","md5":"14c6843195bd13824d253cb3fdb9e6de.svg","type":"costume","tags":["fashion","shoes"],"info":[45,33,1]},{"name":"Shoes-d","md5":"1130f7ca93716bac6afa31af86329e92.svg","type":"costume","tags":["fashion","shoes"],"info":[44,32,1]},{"name":"Shorts-a","md5":"d9b580c913c0d1d1a996dd733af91e68.svg","type":"costume","tags":["fashion","pants","shorts","clothing"],"info":[35,37,1]},{"name":"Shorts-b","md5":"1e07ab2763e5e0f5557f97c0e2c89020.svg","type":"costume","tags":["fashion","pants","shorts","clothing"],"info":[43,36,1]},{"name":"Shorts-c","md5":"dc9e0a1c2489ec0bf59a937b6c8ae85b.svg","type":"costume","tags":["fashion","pants","shorts","clothing"],"info":[35,29,1]},{"name":"Singer1","md5":"e47ef1af3b925e5ac9e3b3f809d440b3.svg","type":"costume","tags":["people","music"],"info":[75,75,1]},{"name":"Skeleton-a","md5":"e06f6eaf4fd27ff22f4c8207aa13c967.svg","type":"costume","tags":["fantasy","spooky","halloween","bones","monster","alex eben meyer"],"info":[59,100,1]},{"name":"Skeleton-b","md5":"06769ddf5fad85e101c7beda554d60b9.svg","type":"costume","tags":["fantasy","spooky","halloween","bones","monster","alex eben meyer"],"info":[69,90,1]},{"name":"Skeleton-d","md5":"155efd0dfdc59a0e2a546a4a7d068ece.svg","type":"costume","tags":["fantasy","spooky","halloween","bones","monster","alex eben meyer"],"info":[51,100,1]},{"name":"Skeleton-e","md5":"c41a11468602522cdc6dec7043215f65.svg","type":"costume","tags":["fantasy","spooky","halloween","bones","monster","alex eben meyer"],"info":[55,89,1]},{"name":"Snake-a","md5":"4d06e12d90479461303d828f0970f2d4.svg","type":"costume","tags":["animals","reptile","robert hunter"],"info":[142,68,1]},{"name":"Snake-b","md5":"a8546a5f9ccaa2bdb678a362c50a17ec.svg","type":"costume","tags":["animals","reptile","robert hunter"],"info":[142,68,1]},{"name":"Snake-c","md5":"d993a7d70179777c14ac91a07e711d90.svg","type":"costume","tags":["animals","reptile","robert hunter"],"info":[142,68,1]},{"name":"Snowflake","md5":"67de2af723246de37d7379b76800ee0b.svg","type":"costume","tags":["winter"],"info":[104,103,1]},{"name":"Snowman","md5":"56c71c31c17b9bc66a2aab0342cf94b2.svg","type":"costume","tags":["fantasy","drawing","winter"],"info":[75,75,1]},{"name":"Soccer Ball","md5":"73eaf05fed60e9d65867508736f84569.svg","type":"costume","tags":["sports","soccer","football","alex eben meyer"],"info":[23,22,1]},{"name":"Speaker","md5":"44dc3a2ec161999545914d1f77332d76.svg","type":"costume","tags":["music","things","bass","treble","concert"],"info":[53,79,1]},{"name":"Squirrel","md5":"b86efb7f23387300cf9037a61f328ab9.png","type":"costume","tags":["animals","scoob"],"info":[316,292,2]},{"name":"Star","md5":"e929c1274c379b6b6fed12e6dec63368.svg","type":"costume","tags":["shapes","space"],"info":[22,23,1]},{"name":"Starfish-a","md5":"3d1101bbc24ae292a36356af325f660c.svg","type":"costume","tags":["animals","echinodermata","underwater","sea","ocean"],"info":[75,75,1]},{"name":"Starfish-b ","md5":"ad8007f4e63693984d4adc466ffa3ad2.svg","type":"costume","tags":["animals","echinodermata","underwater","sea","ocean"],"info":[53,60,1]},{"name":"Stop","md5":"5b9e3e8edffb0bd4914113609eec5e04.svg","type":"costume","tags":["shapes","things"],"info":[25,25,1]},{"name":"Strawberry-a","md5":"b4cff4b414b5f7fbf25c7c45abfb6c62.svg","type":"costume","tags":["food","fruit","alex eben meyer"],"info":[31,47,1]},{"name":"Strawberry-b","md5":"ebb8720dc679772e3dcb1b49e0503aa4.svg","type":"costume","tags":["food","fruit","alex eben meyer"],"info":[43,47,1]},{"name":"Strawberry-c","md5":"278dc229a71e2fbff475908ca5c2483e.svg","type":"costume","tags":["food","fruit","alex eben meyer"],"info":[43,47,1]},{"name":"Strawberry-d","md5":"68a023e80cb9eff2350374361c034f08.svg","type":"costume","tags":["food","fruit","alex eben meyer"],"info":[41,47,1]},{"name":"Strawberry-e","md5":"9fef0cd91ba59163d74f4464b02824b8.svg","type":"costume","tags":["food","fruit","alex eben meyer"],"info":[32,36,1]},{"name":"Sun","md5":"55c931c65456822c0c56a2b30e3e550d.svg","type":"costume","tags":["space","star","hydrogen","helium","fusion","nuclear"],"info":[72,72,1]},{"name":"Sunglasses-a","md5":"424393e8705aeadcfecb8559ce4dcea2.svg","type":"costume","tags":["fashion","cool"],"info":[37,14,1]},{"name":"Sunglasses-b","md5":"3185d2295bbf2c5ebd0688c9e4f13076.svg","type":"costume","tags":["fashion","cool"],"info":[29,10,1]},{"name":"Tabla-a","md5":"68ce53b53fcc68744584c28d20144c4f.svg","type":"costume","tags":["drums"," music"," ericr"],"info":[79,67,1]},{"name":"Tabla-b","md5":"01b6ffb8691d32be10fabc77ddfb55b0.svg","type":"costume","tags":["drums"," music"," ericr"],"info":[86,73,1]},{"name":"Taco","md5":"bc78fb90ed373d56c11d5fafa4203ccd.svg","type":"costume","tags":["food","designerd"],"info":[78,48,1]},{"name":"Taco-wizard","md5":"5e9e65db20d403b590578ed44b1a3792.svg","type":"costume","tags":["food","fantasy","abrakadabra","alakazam","designerd"],"info":[125,82,1]},{"name":"Takeout-a","md5":"05c010b2425c4433353ff85d43ed7a1d.svg","type":"costume","tags":["food","alex eben meyer"],"info":[33,41,1]},{"name":"Takeout-b","md5":"26c3be261cbb0327eaa1afe0467c80d0.svg","type":"costume","tags":["food","alex eben meyer"],"info":[33,42,1]},{"name":"Takeout-c","md5":"801fa349b34531a15d467fef2b940f87.svg","type":"costume","tags":["food","alex eben meyer"],"info":[33,53,1]},{"name":"Takeout-d","md5":"24e21e2846b59cdf2c390ebe985b3c74.svg","type":"costume","tags":["food","alex eben meyer"],"info":[40,42,1]},{"name":"Takeout-e","md5":"95584a98e22df5ca7370f5c01ebe6d06.svg","type":"costume","tags":["food","alex eben meyer"],"info":[41,35,1]},{"name":"Ten80 Pop Down","md5":"fea7045c09073700b88fae8d4d257cd1.png","type":"costume","tags":["people","dance"],"info":[148,376,2]},{"name":"Ten80 Pop Front","md5":"86602007ae2952236d47d7fd587a56b6.png","type":"costume","tags":["people","dance"],"info":[144,532,2]},{"name":"Ten80 Pop L Arm","md5":"ce2141ce97921ddc333bc65ff5bec27d.png","type":"costume","tags":["people","dance"],"info":[200,560,2]},{"name":"Ten80 Pop Left","md5":"3c9a7eac1d696ae74ee40c6efa8fa4dd.png","type":"costume","tags":["people","dance"],"info":[368,532,2]},{"name":"Ten80 Pop R Arm","md5":"279bd5499329f98a68cf92c68014e198.png","type":"costume","tags":["people","dance"],"info":[148,556,2]},{"name":"Ten80 Pop Right","md5":"548bdf23904e409c1fcc0992f44d0b4c.png","type":"costume","tags":["people","dance"],"info":[156,552,2]},{"name":"Ten80 Pop Stand","md5":"377b8521c436f4f39ed2100fa1cb7c2f.png","type":"costume","tags":["people","dance"],"info":[184,560,2]},{"name":"Ten80 Stance","md5":"f60f99278455c843b7833fb7615428dd.png","type":"costume","tags":["people","dance"],"info":[140,556,2]},{"name":"Ten80 Top Freeze","md5":"8313a2229d555bbdb8ce92dffed067ad.png","type":"costume","tags":["people","dance"],"info":[108,516,2]},{"name":"Ten80 Top L Step","md5":"e51942bb4651e616549cfce1ad36ff83.png","type":"costume","tags":["people","dance"],"info":[288,532,2]},{"name":"Ten80 Top R Cross","md5":"e06ac61e96e3a5abf4ca0863816f5d28.png","type":"costume","tags":["people","dance"],"info":[412,504,2]},{"name":"Ten80 Top R Step","md5":"580fba92f23d5592200eb5a9079dc38f.png","type":"costume","tags":["people","dance"],"info":[400,540,2]},{"name":"Ten80 Top Stand","md5":"b2f75ac1cd84615efaea6a7d7a4ee205.png","type":"costume","tags":["people","dance"],"info":[148,548,2]},{"name":"Tennisball","md5":"34fa36004be0340ec845ba6bbeb5e5d5.png","type":"costume","tags":["ball","sports"],"info":[60,60,2]},{"name":"Tera-a","md5":"b54a4a9087435863ab6f6c908f1cac99.svg","type":"costume","tags":["fantasy","drawing"],"info":[49,63,1]},{"name":"Tera-b","md5":"1e6b3a29351cda80d1a70a3cc0e499f2.svg","type":"costume","tags":["fantasy","drawing","happy"],"info":[49,64,1]},{"name":"Tera-c","md5":"7edf116cbb7111292361431521ae699e.svg","type":"costume","tags":["fantasy","drawing","happy"],"info":[49,63,1]},{"name":"Tera-d","md5":"7c3c9c8b5f4ac77de2036175712a777a.svg","type":"costume","tags":["fantasy","drawing","angry"],"info":[49,63,1]},{"name":"Toucan-a","md5":"6c8798e606abd728b112aecedb5dc249.svg","type":"costume","tags":["animals","bird","robert hunter"],"info":[80,63,1]},{"name":"Toucan-b","md5":"a3e12be9efa0e7aa83778f6054c9c541.svg","type":"costume","tags":["animals","bird","robert hunter"],"info":[80,63,1]},{"name":"Toucan-c","md5":"56522b58a9959fd6152060346129f7cb.svg","type":"costume","tags":["animals","bird","robert hunter"],"info":[80,63,1]},{"name":"Trampoline","md5":"20b16bcb61396df304cad5e8886ceb46.png","type":"costume","tags":["sports"],"info":[100,41,1]},{"name":"Tree1","md5":"8c40e2662c55d17bc384f47165ac43c1.svg","type":"costume","tags":["plants","wood","forest"],"info":[77,126,1]},{"name":"Trees-a","md5":"866ed2c2971bb04157e14e935ac8521c.svg","type":"costume","tags":["plants","wood","forest"],"info":[49,94,1]},{"name":"Trees-b","md5":"f1393dde1bb0fc512577995b27616d86.svg","type":"costume","tags":["plants","wood","forest"],"info":[36,87,1]},{"name":"Truck-a","md5":"51404247db5cdbc082336dfa4c03d675.svg","type":"costume","tags":["truck","city","car","vehicle"],"info":[174,49,1]},{"name":"Truck-b","md5":"1887b8233d1b0728f715a3985f0e01b6.svg","type":"costume","tags":["truck","city","car","vehicle"],"info":[174,58,1]},{"name":"Truck-c","md5":"e45bc3f87d9f603e588abe14b63b8e90.svg","type":"costume","tags":["truck","city","car","vehicle"],"info":[174,58,1]},{"name":"Trumpet-a","md5":"36a48cc311fd28b4517e15d44b11587c.svg","type":"costume","tags":["music","andrew rae"],"info":[57,38,1]},{"name":"Trumpet-b","md5":"c04cdfd5f05ff2817b6ab78027ef5d22.svg","type":"costume","tags":["music","andrew rae"],"info":[55,37,1]},{"name":"Unicorn","md5":"c491fd1867375aa0160b013788d188e5.svg","type":"costume","tags":["fantasy","animals","ipzy"],"info":[91,95,1]},{"name":"Unicorn 2","md5":"a04def38351e7fd805226345cac4fbfe.svg","type":"costume","tags":["fantasy","animals","horse","horn","rainbow"],"info":[75,75,1]},{"name":"Unicorn Running-a","md5":"d938a2bfbac8f3caf713d189fd993af5.svg","type":"costume","tags":["fantasy","animals","ipzy","walking"],"info":[118,90,1]},{"name":"Unicorn Running-b","md5":"663618fcc0484879de6ad485b288c444.svg","type":"costume","tags":["fantasy","animals","ipzy","walking"],"info":[120,89,1]},{"name":"Unicorn Running-c","md5":"ceb2f88fe182bc61af4e3864f8b46bba.svg","type":"costume","tags":["fantasy","animals","ipzy","walking"],"info":[121,90,1]},{"name":"Unicorn Running-d","md5":"dddad08a2d03f406307ec7155f43c51c.svg","type":"costume","tags":["fantasy","animals","ipzy","walking"],"info":[120,87,1]},{"name":"Unicorn Running-e","md5":"cf3a00e72f3fc20d9ad15379fdb7b424.svg","type":"costume","tags":["fantasy","animals","ipzy","walking"],"info":[119,90,1]},{"name":"Unicorn Running-f","md5":"264a70e872af2d3f6b2abad85daf82ae.svg","type":"costume","tags":["fantasy","animals","ipzy","walking"],"info":[117,86,1]},{"name":"Wand","md5":"1aa56e9ef7043eaf36ecfe8e330271b7.svg","type":"costume","tags":["fantasy","ipzy","things"],"info":[12,42,1]},{"name":"Wanda","md5":"450bc8fbd5ab6bc2e83576aad58cd07c.svg","type":"costume","tags":["people"],"info":[49,68,1]},{"name":"Watermelon-a","md5":"26fecef75cf3b6e0d98bff5c06475036.svg","type":"costume","tags":["food","fruit","summer","seeds","seedless","plants"],"info":[40,27,1]},{"name":"Watermelon-b","md5":"fbdaf4d1d349edd3ddf3a1c4528aa9ec.svg","type":"costume","tags":["food","fruit","summer","seeds","plants"],"info":[22,27,1]},{"name":"Watermelon-c","md5":"5976c10412306fc093c1d1930fa05119.svg","type":"costume","tags":["food","fruit","summer","seeds","plants"],"info":[21,15,1]},{"name":"Winter Hat","md5":"62678324450bac2154703e2978e8ab61.svg","type":"costume","tags":["fashion","winter","hat"],"info":[35,39,1]},{"name":"Witch","md5":"c991196a708294535a1dbdce7189c23c.svg","type":"costume","tags":["fantasy","broom","wart","flying","hat","magic"],"info":[74,59,1]},{"name":"Witch-a","md5":"cbc54e15cd62f0c16369587377636099.svg","type":"costume","tags":["fantasy","people","ipzy","castle","emotions","magic"],"info":[65,140,1]},{"name":"Witch-b","md5":"64d2c4c51e6cb6008cd5e93f77e6f591.svg","type":"costume","tags":["fantasy","people","ipzy","castle","emotions","magic"],"info":[65,140,1]},{"name":"Witch-c","md5":"00b768c3da5b4ee3efddf05d1eb88de2.svg","type":"costume","tags":["fantasy","people","ipzy","castle","emotions","magic"],"info":[65,140,1]},{"name":"Witch-d","md5":"4fe4c0ee34a9028f2c6988b7294a61c1.svg","type":"costume","tags":["fantasy","people","ipzy","castle","emotions","magic"],"info":[65,140,1]},{"name":"Wizard Hat","md5":"2da561a7e5cbfcda613f4750020d4aa5.svg","type":"costume","tags":["fashion","fantasy","winter"],"info":[34,60,1]},{"name":"Wizard-a","md5":"9632aab80fce1c5bdb58150b29cb0067.svg","type":"costume","tags":["fantasy","people","ipzy","castle","emotions","magic"],"info":[87,150,1]},{"name":"Wizard-b","md5":"36c9b8b93ddb2c392b7145862fc4e8d8.svg","type":"costume","tags":["fantasy","people","ipzy","castle","emotions","magic"],"info":[79,144,1]},{"name":"Wizard-c","md5":"16d4d221a2182278cfa6b0621f455cf6.svg","type":"costume","tags":["fantasy","people","ipzy","castle","emotions","magic"],"info":[87,150,1]},{"name":"Wizard-toad-a","md5":"fd5c4cce36e866489febc227e23b21aa.svg","type":"costume","tags":["fantasy","people","animals","ipzy","castle","animals","amphibians","magic"],"info":[87,80,1]},{"name":"Wizard-toad-b","md5":"4c260807d4ac4c0ad39760f1efeef1de.svg","type":"costume","tags":["fantasy","people","animals","ipzy","castle","amphibians","magic"],"info":[87,80,1]},{"name":"Zebra-a","md5":"f58632e6b34fa8f9b35219e52ed2c864.svg","type":"costume","tags":["animals","savanna","zebra","robert hunter"],"info":[97,56,1]},{"name":"Zebra-b","md5":"ea23797598a55938a2d46f2b0a389fd6.svg","type":"costume","tags":["animals","savanna","zebra","robert hunter"],"info":[96,56,1]},{"name":"Block-a","md5":"602a16930a8050e1298e1a0ae844363e.svg","type":"costume","tags":["alphabet","letters"],"info":[28,38,1]},{"name":"Block-b","md5":"f8c683cf71660e8ac1f8855599857a25.svg","type":"costume","tags":["alphabet","letters"],"info":[29,42,1]},{"name":"Block-c","md5":"f8f4cc686ffc5a4113a99f70b09abd32.svg","type":"costume","tags":["alphabet","letters"],"info":[35,43,1]},{"name":"Block-d","md5":"aee2d71ef0293b33479bff9423d16b67.svg","type":"costume","tags":["alphabet","letters"],"info":[31,41,1]},{"name":"Block-e","md5":"16c6257316ff94cc7539ccdfc24e5fb8.svg","type":"costume","tags":["alphabet","letters"],"info":[25,39,1]},{"name":"Block-f","md5":"34c090c1f573c569332ead68cb99b595.svg","type":"costume","tags":["alphabet","letters"],"info":[23,40,1]},{"name":"Block-g","md5":"8bb2382627004eb08ff10ea8171cc724.svg","type":"costume","tags":["alphabet","letters"],"info":[28,39,1]},{"name":"Block-h","md5":"f1578807d4a124fc02b639a8febeaab3.svg","type":"costume","tags":["alphabet","letters"],"info":[27,38,1]},{"name":"Block-i","md5":"341bc70442886d6fdf959f2a97a63554.svg","type":"costume","tags":["alphabet","letters"],"info":[19,39,1]},{"name":"Block-j","md5":"4b420cce964beedf2c1dc43faa59fdec.svg","type":"costume","tags":["alphabet","letters"],"info":[25,41,1]},{"name":"Block-k","md5":"19601cc33449813aa93a47c63167e5c1.svg","type":"costume","tags":["alphabet","letters"],"info":[24,40,1]},{"name":"Block-l","md5":"87358e3c9b9f5be4376253ce08d0192d.svg","type":"costume","tags":["alphabet","letters"],"info":[26,40,1]},{"name":"Block-m","md5":"7ba0642be1f0080c0d273ea96e29b1e8.svg","type":"costume","tags":["alphabet","letters"],"info":[35,37,1]},{"name":"Block-n","md5":"6c1fbc57821744bd9356ce9a21ed70f7.svg","type":"costume","tags":["alphabet","letters"],"info":[28,37,1]},{"name":"Block-o","md5":"e88638200a73e167d0e266a343019cec.svg","type":"costume","tags":["alphabet","letters"],"info":[32,40,1]},{"name":"Block-p","md5":"ad2fc3a1c6538678915633a11ab6ec73.svg","type":"costume","tags":["alphabet","letters"],"info":[18,33,1]},{"name":"Block-q","md5":"64da9da8684c74deb567dbdb661d3a52.svg","type":"costume","tags":["alphabet","letters"],"info":[26,33,1]},{"name":"Block-r","md5":"73e8d46f7475476d8cb4cfcfc75ee50d.svg","type":"costume","tags":["alphabet","letters"],"info":[22,33,1]},{"name":"Block-s","md5":"9feb5593fed51e88dbb3128cfc290d29.svg","type":"costume","tags":["alphabet","letters"],"info":[13,30,1]},{"name":"Block-t","md5":"d29c1caf5cf195740c38f279e82a77a4.svg","type":"costume","tags":["alphabet","letters"],"info":[25,33,1]},{"name":"Block-u","md5":"faef46b7bf589c36300142f6f03c5d32.svg","type":"costume","tags":["alphabet","letters"],"info":[28,41,1]},{"name":"Block-v","md5":"65e2f4821ab084827e22920acb61c92b.svg","type":"costume","tags":["alphabet","letters"],"info":[35,41,1]},{"name":"Block-w","md5":"5ab197b4f70b2f98a3658c7ccdc3351d.svg","type":"costume","tags":["alphabet","letters"],"info":[47,39,1]},{"name":"Block-x","md5":"cb9dff35f05e823d954e47e4a717a48c.svg","type":"costume","tags":["alphabet","letters"],"info":[25,32,1]},{"name":"Block-y","md5":"4c13c440bcb35c8c3aa6226374fced3f.svg","type":"costume","tags":["alphabet","letters"],"info":[26,33,1]},{"name":"Block-z","md5":"0ccff1898f1bf1b25333d581db09fae2.svg","type":"costume","tags":["alphabet","letters"],"info":[24,38,1]},{"name":"Glow-0","md5":"38b2b342659adc6fa289090975e0e71d.svg","type":"costume","tags":["numbers","digits"],"info":[29,39,1]},{"name":"Glow-1","md5":"2c88706210672655401fe09edd8ff6a7.svg","type":"costume","tags":["numbers","digits"],"info":[24,39,1]},{"name":"Glow-2","md5":"b9faa5708a799a1607f0325a7af2561c.svg","type":"costume","tags":["numbers","digits"],"info":[28,41,1]},{"name":"Glow-3","md5":"cf42a50552ce26032ead712ac4f36c23.svg","type":"costume","tags":["numbers","digits"],"info":[33,42,1]},{"name":"Glow-4","md5":"3ffa6aee373e28fc36b9395ac4d0467e.svg","type":"costume","tags":["numbers","digits"],"info":[31,38,1]},{"name":"Glow-5","md5":"85d87d32e7e9e6be122c905b0d2e7e33.svg","type":"costume","tags":["numbers","digits"],"info":[30,38,1]},{"name":"Glow-6","md5":"62cc2a6def27f19d11ed56e86e95aac5.svg","type":"costume","tags":["numbers","digits"],"info":[30,37,1]},{"name":"Glow-7","md5":"8887983eb4df2e62a2ed4770a1d98d60.svg","type":"costume","tags":["numbers","digits"],"info":[31,42,1]},{"name":"Glow-8","md5":"4c42c4cb0c1e090d0f9570416d3c80c8.svg","type":"costume","tags":["numbers","digits"],"info":[31,37,1]},{"name":"Glow-9","md5":"7bcb7e2e48f5cb770c83d4267922fec0.svg","type":"costume","tags":["numbers","digits"],"info":[28,36,1]},{"name":"Glow-A","md5":"d5aa299350c24c747200a64b63b1aa52.svg","type":"costume","tags":["alphabet","letters"],"info":[36,37,1]},{"name":"Glow-B","md5":"a2e95f268a6cab03f3e94b3b0b792d83.svg","type":"costume","tags":["alphabet","letters"],"info":[32,35,1]},{"name":"Glow-C","md5":"9779a4a40934f04a4bf84920b258d7c9.svg","type":"costume","tags":["alphabet","letters"],"info":[27,35,1]},{"name":"Glow-D","md5":"3555b8bbbbcdc00354bf6fa81ac7042f.svg","type":"costume","tags":["alphabet","letters"],"info":[33,35,1]},{"name":"Glow-E","md5":"44dbc655d5ac9f13618473848e23484e.svg","type":"costume","tags":["alphabet","letters"],"info":[34,38,1]},{"name":"Glow-F","md5":"dec417e749e43d7de3985155f5f5a7a0.svg","type":"costume","tags":["alphabet","letters"],"info":[35,41,1]},{"name":"Glow-G","md5":"cf4aa465cd8fb7049cc571d7546a7eb1.svg","type":"costume","tags":["alphabet","letters"],"info":[32,39,1]},{"name":"Glow-H","md5":"8d9bd5f00ea1ac6f92d0f97ee491b0f3.svg","type":"costume","tags":["alphabet","letters"],"info":[35,46,1]},{"name":"Glow-I","md5":"0e86de55840103dcd50199ab2b765de7.svg","type":"costume","tags":["alphabet","letters"],"info":[21,38,1]},{"name":"Glow-J","md5":"b3832145eacc39f91bd3a9a6673fa05c.svg","type":"costume","tags":["alphabet","letters"],"info":[29,39,1]},{"name":"Glow-K","md5":"f4e37a7552ba05e995613211a7146de5.svg","type":"costume","tags":["alphabet","letters"],"info":[38,36,1]},{"name":"Glow-L","md5":"a75e45773ea6afaf8ae44f79f936fc82.svg","type":"costume","tags":["alphabet","letters"],"info":[33,35,1]},{"name":"Glow-M","md5":"219b06faa5b816347165450d148213b4.svg","type":"costume","tags":["alphabet","letters"],"info":[42,39,1]},{"name":"Glow-N","md5":"4b724479fb3b2184fd8be6f83fb20e54.svg","type":"costume","tags":["alphabet","letters"],"info":[37,39,1]},{"name":"Glow-O","md5":"38b2b342659adc6fa289090975e0e71d.svg","type":"costume","tags":["alphabet","letters"],"info":[29,39,1]},{"name":"Glow-P","md5":"1cfa849cc967069730b7e9d0809c9dc1.svg","type":"costume","tags":["alphabet","letters"],"info":[32,39,1]},{"name":"Glow-Q","md5":"9d35979e9404ac234301269fcd7de288.svg","type":"costume","tags":["alphabet","letters"],"info":[33,43,1]},{"name":"Glow-R","md5":"fc067ee076ecaba8430ccd54d9414c1b.svg","type":"costume","tags":["alphabet","letters"],"info":[35,38,1]},{"name":"Glow-S","md5":"19a93db8a294ccaec4d6eef4020a446f.svg","type":"costume","tags":["alphabet","letters"],"info":[27,40,1]},{"name":"Glow-T","md5":"d7bcda522a1e9504dafcf2fa0fcde39b.svg","type":"costume","tags":["alphabet","letters"],"info":[35,38,1]},{"name":"Glow-U","md5":"790482a3c3691a1e96ef34eee7303872.svg","type":"costume","tags":["alphabet","letters"],"info":[37,37,1]},{"name":"Glow-V","md5":"6a00388d8dc6be645b843cef9c22681c.svg","type":"costume","tags":["alphabet","letters"],"info":[35,42,1]},{"name":"Glow-W","md5":"1a9ea7305a85b271c1de79beafe16cb4.svg","type":"costume","tags":["alphabet","letters"],"info":[45,41,1]},{"name":"Glow-X","md5":"ec4e65b9ae475a676973128f4205df5f.svg","type":"costume","tags":["alphabet","letters"],"info":[40,39,1]},{"name":"Glow-Y","md5":"683cd093bb3b254733a15df6f843464c.svg","type":"costume","tags":["alphabet","letters"],"info":[38,41,1]},{"name":"Glow-Z","md5":"db89a4c9b123123542e0b7556ed3ff9f.svg","type":"costume","tags":["alphabet","letters"],"info":[30,39,1]},{"name":"story-A-1","md5":"5406b37278d819d4787a588b9c91f68e.svg","type":"costume","tags":["alphabet","letters"],"info":[23,26,1]},{"name":"story-A-2","md5":"f277943adf8d79b41b9b568321a786ee.svg","type":"costume","tags":["alphabet","letters"],"info":[23,26,1]},{"name":"story-A-3","md5":"cc0cc7ae3240eab7d040e148cc663325.svg","type":"costume","tags":["alphabet","letters"],"info":[22,24,1]},{"name":"story-B-1","md5":"2a8fac3c82d95f13203843a597b5757b.svg","type":"costume","tags":["alphabet","letters"],"info":[20,25,1]},{"name":"story-B-2","md5":"07fa4ebc421d84743b6ced189dd2f9cf.svg","type":"costume","tags":["alphabet","letters"],"info":[19,25,1]},{"name":"story-B-3","md5":"6c9a9203155f93f24f31b30e3bd76b6d.svg","type":"costume","tags":["alphabet","letters"],"info":[18,23,1]},{"name":"story-C-1","md5":"144845715016910e88e2a223ed4d3df1.svg","type":"costume","tags":["alphabet","letters"],"info":[22,26,1]},{"name":"story-C-2","md5":"1045c56c4be3d8d0650579864417fbc7.svg","type":"costume","tags":["alphabet","letters"],"info":[22,26,1]},{"name":"story-C-3","md5":"c8fd35294d17a369fecb6d6e4725d04a.svg","type":"costume","tags":["alphabet","letters"],"info":[20,24,1]},{"name":"story-D-1","md5":"dfd362f2da975c20aa7849a8fa2fb4df.svg","type":"costume","tags":["alphabet","letters"],"info":[25,26,1]},{"name":"story-D-2","md5":"3e4cc4cff08bb42bc690eff66dffbbe9.svg","type":"costume","tags":["alphabet","letters"],"info":[25,26,1]},{"name":"story-D-3","md5":"bd7f984fe82d9d0fdcff0a87b3c0f9e0.svg","type":"costume","tags":["alphabet","letters"],"info":[22,23,1]},{"name":"story-E-1","md5":"56473bacbdf6f0dbca1afb04e5aebaf7.svg","type":"costume","tags":["alphabet","letters"],"info":[20,25,1]},{"name":"story-E-2","md5":"8bba14966fe35f0dccb66ef06a9843ca.svg","type":"costume","tags":["alphabet","letters"],"info":[20,25,1]},{"name":"story-E-3","md5":"e8cfc63375f6d6c2a580823489427f38.svg","type":"costume","tags":["alphabet","letters"],"info":[18,23,1]},{"name":"story-F-1","md5":"5844ff29fc8663c8613f12169d2f07ef.svg","type":"costume","tags":["alphabet","letters"],"info":[18,26,1]},{"name":"story-F-2","md5":"0dbe4a064abea1a9a3bc0d2732643e6b.svg","type":"costume","tags":["alphabet","letters"],"info":[18,25,1]},{"name":"story-F-3","md5":"3db373f4482e391e66d1b06335a96144.svg","type":"costume","tags":["alphabet","letters"],"info":[16,23,1]},{"name":"story-G-1","md5":"ee6454d15fbbe93e908a2ebbfad483a0.svg","type":"costume","tags":["alphabet","letters"],"info":[23,25,1]},{"name":"story-G-2","md5":"991023d303f79ce092f070392ffbd69f.svg","type":"costume","tags":["alphabet","letters"],"info":[23,25,1]},{"name":"story-G-3","md5":"38f22c0d8dbe541bde409ba1f241d4c1.svg","type":"costume","tags":["alphabet","letters"],"info":[21,24,1]},{"name":"story-H-1","md5":"2a0e1308d6cb806818af696a89b21863.svg","type":"costume","tags":["alphabet","letters"],"info":[24,25,1]},{"name":"story-H-2","md5":"ca33be5270308a695c9b88af73f590dc.svg","type":"costume","tags":["alphabet","letters"],"info":[24,25,1]},{"name":"story-H-3","md5":"668ba2b891f82ce78d8590f0287632b1.svg","type":"costume","tags":["alphabet","letters"],"info":[22,24,1]},{"name":"story-I-1","md5":"705297637ea83af5b94b6fe2e34aeef4.svg","type":"costume","tags":["alphabet","letters"],"info":[9,26,1]},{"name":"story-I-2","md5":"7b3ae96764795727fa1cb0be68a9ca5e.svg","type":"costume","tags":["alphabet","letters"],"info":[9,26,1]},{"name":"story-I-3","md5":"3475aa570304accb7e6dbd2516234135.svg","type":"costume","tags":["alphabet","letters"],"info":[7,23,1]},{"name":"story-J-1","md5":"ac2e7eaecb80c5501e5e56802d03af00.svg","type":"costume","tags":["alphabet","letters"],"info":[14,25,1]},{"name":"story-J-2","md5":"0ab9a94fc2e32160efc113a8e5ffb984.svg","type":"costume","tags":["alphabet","letters"],"info":[14,25,1]},{"name":"story-J-3","md5":"c9356a022cfbc25be6c484e9781e4637.svg","type":"costume","tags":["alphabet","letters"],"info":[12,24,1]},{"name":"story-K-1","md5":"62dcc92dc3c6cb0271244190320c4f71.svg","type":"costume","tags":["alphabet","letters"],"info":[24,26,1]},{"name":"story-K-2","md5":"ef02339e8a0382367f0b5a414915b885.svg","type":"costume","tags":["alphabet","letters"],"info":[24,26,1]},{"name":"story-K-3","md5":"07977708617d12381b22d1ee0f4926a3.svg","type":"costume","tags":["alphabet","letters"],"info":[21,24,1]},{"name":"story-L-1","md5":"7ce306e9c9c0dd0a24279606301f1d05.svg","type":"costume","tags":["alphabet","letters"],"info":[19,26,1]},{"name":"story-L-2","md5":"067c21a9b2f91ed33e07131ce5a59210.svg","type":"costume","tags":["alphabet","letters"],"info":[19,26,1]},{"name":"story-L-3","md5":"488d66f17c0089a7796d44cfc70792e8.svg","type":"costume","tags":["alphabet","letters"],"info":[17,23,1]},{"name":"story-M-1","md5":"b27f166f9ab4a3fb93a50a77c58c3df3.svg","type":"costume","tags":["alphabet","letters"],"info":[30,25,1]},{"name":"story-M-2","md5":"55f00a23d0f5cc57be9533f126a7ac8c.svg","type":"costume","tags":["alphabet","letters"],"info":[30,25,1]},{"name":"story-M-3","md5":"613df2bd97784a239ab992f7a95458a0.svg","type":"costume","tags":["alphabet","letters"],"info":[27,24,1]},{"name":"story-N-1","md5":"293589fd5bbc358a20c165ab49c19833.svg","type":"costume","tags":["alphabet","letters"],"info":[26,25,1]},{"name":"story-N-2","md5":"5e07ee61cb20bc575720774584dfec53.svg","type":"costume","tags":["alphabet","letters"],"info":[26,25,1]},{"name":"story-N-3","md5":"435697335345f946d943c1d89fdb459a.svg","type":"costume","tags":["alphabet","letters"],"info":[24,23,1]},{"name":"story-O-1","md5":"088beed7ce0dff554da06f54d0558bc0.svg","type":"costume","tags":["alphabet","letters"],"info":[25,25,1]},{"name":"story-O-2","md5":"e8fa671bb1ca53c044bfb27225321c25.svg","type":"costume","tags":["alphabet","letters"],"info":[24,25,1]},{"name":"story-O-3","md5":"a132bf3d4084ef8ca9e0797f64c0f082.svg","type":"costume","tags":["alphabet","letters"],"info":[22,24,1]},{"name":"story-P-1","md5":"ad4a101b83f28ced16849be3e393caa9.svg","type":"costume","tags":["alphabet","letters"],"info":[20,25,1]},{"name":"story-P-2","md5":"781c42f9da36bbc0ee3775f18ac98124.svg","type":"costume","tags":["alphabet","letters"],"info":[20,25,1]},{"name":"story-P-3","md5":"bcaec7c778920d8d74c275c1aff634fe.svg","type":"costume","tags":["alphabet","letters"],"info":[17,24,1]},{"name":"story-Q-1","md5":"484e44f908e84d795c87cf994364e722.svg","type":"costume","tags":["alphabet","letters"],"info":[25,30,1]},{"name":"story-Q-2","md5":"31f28be74dc7de42a5c4a38504d666ca.svg","type":"costume","tags":["alphabet","letters"],"info":[25,30,1]},{"name":"story-Q-3","md5":"aef19097378515308e934a79f147032e.svg","type":"costume","tags":["alphabet","letters"],"info":[22,29,1]},{"name":"story-R-1","md5":"55999cb6783ef8351d841294d75af942.svg","type":"costume","tags":["alphabet","letters"],"info":[22,26,1]},{"name":"story-R-2","md5":"926f8ff770cb15b42b12f209fd02d98c.svg","type":"costume","tags":["alphabet","letters"],"info":[22,26,1]},{"name":"story-R-3","md5":"a66d8f0ba6d40c624873edc8df58c014.svg","type":"costume","tags":["alphabet","letters"],"info":[20,23,1]},{"name":"story-S-1","md5":"fca1555f335392f1c4ef620bf098c0de.svg","type":"costume","tags":["alphabet","letters"],"info":[16,25,1]},{"name":"story-S-2","md5":"c529ed7b40f4a949539f8f454e3fe475.svg","type":"costume","tags":["alphabet","letters"],"info":[16,25,1]},{"name":"story-S-3","md5":"e96388c9197733bdadbad3ce014c0e59.svg","type":"costume","tags":["alphabet","letters"],"info":[14,23,1]},{"name":"story-T-1","md5":"d3b342c795a620b69639c02a419e8535.svg","type":"costume","tags":["alphabet","letters"],"info":[22,27,1]},{"name":"story-T-2","md5":"eeb0fd25c9273747ac38766d1959ba2b.svg","type":"costume","tags":["alphabet","letters"],"info":[22,27,1]},{"name":"story-T-3","md5":"a9683d4946b08a76864a51bd21d811cb.svg","type":"costume","tags":["alphabet","letters"],"info":[20,24,1]},{"name":"story-U-1","md5":"fcf99b6e8aeb2d504e1e9b2194640916.svg","type":"costume","tags":["alphabet","letters"],"info":[24,26,1]},{"name":"story-U-2","md5":"f442802f17225d6506ac9718810f179e.svg","type":"costume","tags":["alphabet","letters"],"info":[24,26,1]},{"name":"story-U-3","md5":"0779f03a6589c60352b1d4806a4a61c0.svg","type":"costume","tags":["alphabet","letters"],"info":[21,24,1]},{"name":"story-V-1","md5":"750b47f1de2143f76354239b27e1e5f0.svg","type":"costume","tags":["alphabet","letters"],"info":[25,25,1]},{"name":"story-V-2","md5":"03de7add77e31799ca568a9c671012b4.svg","type":"costume","tags":["alphabet","letters"],"info":[25,25,1]},{"name":"story-V-3","md5":"29befe20b105b69471f5507d025ec3e0.svg","type":"costume","tags":["alphabet","letters"],"info":[22,23,1]},{"name":"story-W-1","md5":"7d9d4c0da9bd1a3ddf253d1bea26f4e9.svg","type":"costume","tags":["alphabet","letters"],"info":[37,25,1]},{"name":"story-W-2","md5":"c0f48eb69cae4a611d3e7b7e06b0d1c1.svg","type":"costume","tags":["alphabet","letters"],"info":[37,25,1]},{"name":"story-W-3","md5":"d1c922c9e9d53d2f6f36ca637e85de6b.svg","type":"costume","tags":["alphabet","letters"],"info":[34,24,1]},{"name":"story-X-1","md5":"92c452555b3d5a4993f107810043ea03.svg","type":"costume","tags":["alphabet","letters"],"info":[22,26,1]},{"name":"story-X-2","md5":"f688425da41c2b7f80d4b8752de69bc9.svg","type":"costume","tags":["alphabet","letters"],"info":[22,26,1]},{"name":"story-X-3","md5":"ec90479a0ce3c7706f1916daef0f3c67.svg","type":"costume","tags":["alphabet","letters"],"info":[20,24,1]},{"name":"story-Y-1","md5":"b3c252450d413fc75be0eafdbe4490dc.svg","type":"costume","tags":["alphabet","letters"],"info":[22,27,1]},{"name":"story-Y-2","md5":"1cfa161ae5d60ea163e4e0aa34d08f02.svg","type":"costume","tags":["alphabet","letters"],"info":[22,27,1]},{"name":"story-Y-3","md5":"a1fc3c0fa304255364c0f98547e0e448.svg","type":"costume","tags":["alphabet","letters"],"info":[20,24,1]},{"name":"story-Z-1","md5":"86326c9180c485b557a075f4794939d7.svg","type":"costume","tags":["alphabet","letters"],"info":[19,26,1]},{"name":"story-Z-2","md5":"e10b203e47bbb41edab78be59e628449.svg","type":"costume","tags":["alphabet","letters"],"info":[19,26,1]},{"name":"story-Z-3","md5":"0788df7b1d9cf02dfdebc021d4f30ce4.svg","type":"costume","tags":["alphabet","letters"],"info":[17,23,1]}]; /***/ }), /***/ "./src/lib/libraries/decks/en-steps.js": /*!*********************************************!*\ !*** ./src/lib/libraries/decks/en-steps.js ***! \*********************************************/ /*! exports provided: enImages */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "enImages", function() { return enImages; }); /* harmony import */ var _steps_intro_move_en_gif__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./steps/intro-move.en.gif */ "./src/lib/libraries/decks/steps/intro-move.en.gif"); /* harmony import */ var _steps_intro_move_en_gif__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_steps_intro_move_en_gif__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _steps_intro_say_hello_en_gif__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./steps/intro-say-hello.en.gif */ "./src/lib/libraries/decks/steps/intro-say-hello.en.gif"); /* harmony import */ var _steps_intro_say_hello_en_gif__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_steps_intro_say_hello_en_gif__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _steps_speech_add_extension_en_gif__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./steps/speech-add-extension.en.gif */ "./src/lib/libraries/decks/steps/speech-add-extension.en.gif"); /* harmony import */ var _steps_speech_add_extension_en_gif__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_steps_speech_add_extension_en_gif__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _steps_speech_say_something_en_gif__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./steps/speech-say-something.en.gif */ "./src/lib/libraries/decks/steps/speech-say-something.en.gif"); /* harmony import */ var _steps_speech_say_something_en_gif__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_steps_speech_say_something_en_gif__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _steps_speech_set_voice_en_gif__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./steps/speech-set-voice.en.gif */ "./src/lib/libraries/decks/steps/speech-set-voice.en.gif"); /* harmony import */ var _steps_speech_set_voice_en_gif__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_steps_speech_set_voice_en_gif__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _steps_speech_move_around_en_gif__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./steps/speech-move-around.en.gif */ "./src/lib/libraries/decks/steps/speech-move-around.en.gif"); /* harmony import */ var _steps_speech_move_around_en_gif__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_steps_speech_move_around_en_gif__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _steps_speech_add_backdrop_en_gif__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./steps/speech-add-backdrop.en.gif */ "./src/lib/libraries/decks/steps/speech-add-backdrop.en.gif"); /* harmony import */ var _steps_speech_add_backdrop_en_gif__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_steps_speech_add_backdrop_en_gif__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _steps_speech_add_sprite_en_gif__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./steps/speech-add-sprite.en.gif */ "./src/lib/libraries/decks/steps/speech-add-sprite.en.gif"); /* harmony import */ var _steps_speech_add_sprite_en_gif__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_steps_speech_add_sprite_en_gif__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _steps_speech_song_en_gif__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./steps/speech-song.en.gif */ "./src/lib/libraries/decks/steps/speech-song.en.gif"); /* harmony import */ var _steps_speech_song_en_gif__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_steps_speech_song_en_gif__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _steps_speech_change_color_en_gif__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./steps/speech-change-color.en.gif */ "./src/lib/libraries/decks/steps/speech-change-color.en.gif"); /* harmony import */ var _steps_speech_change_color_en_gif__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_steps_speech_change_color_en_gif__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _steps_speech_spin_en_gif__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./steps/speech-spin.en.gif */ "./src/lib/libraries/decks/steps/speech-spin.en.gif"); /* harmony import */ var _steps_speech_spin_en_gif__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_steps_speech_spin_en_gif__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _steps_speech_grow_shrink_en_gif__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./steps/speech-grow-shrink.en.gif */ "./src/lib/libraries/decks/steps/speech-grow-shrink.en.gif"); /* harmony import */ var _steps_speech_grow_shrink_en_gif__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_steps_speech_grow_shrink_en_gif__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _steps_cn_show_character_en_gif__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./steps/cn-show-character.en.gif */ "./src/lib/libraries/decks/steps/cn-show-character.en.gif"); /* harmony import */ var _steps_cn_show_character_en_gif__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_steps_cn_show_character_en_gif__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var _steps_cn_say_en_gif__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./steps/cn-say.en.gif */ "./src/lib/libraries/decks/steps/cn-say.en.gif"); /* harmony import */ var _steps_cn_say_en_gif__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_steps_cn_say_en_gif__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var _steps_cn_glide_en_gif__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./steps/cn-glide.en.gif */ "./src/lib/libraries/decks/steps/cn-glide.en.gif"); /* harmony import */ var _steps_cn_glide_en_gif__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_steps_cn_glide_en_gif__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var _steps_cn_pick_sprite_en_gif__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./steps/cn-pick-sprite.en.gif */ "./src/lib/libraries/decks/steps/cn-pick-sprite.en.gif"); /* harmony import */ var _steps_cn_pick_sprite_en_gif__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_steps_cn_pick_sprite_en_gif__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var _steps_cn_collect_en_gif__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./steps/cn-collect.en.gif */ "./src/lib/libraries/decks/steps/cn-collect.en.gif"); /* harmony import */ var _steps_cn_collect_en_gif__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(_steps_cn_collect_en_gif__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var _steps_cn_variable_en_gif__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./steps/cn-variable.en.gif */ "./src/lib/libraries/decks/steps/cn-variable.en.gif"); /* harmony import */ var _steps_cn_variable_en_gif__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(_steps_cn_variable_en_gif__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var _steps_cn_score_en_gif__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./steps/cn-score.en.gif */ "./src/lib/libraries/decks/steps/cn-score.en.gif"); /* harmony import */ var _steps_cn_score_en_gif__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(_steps_cn_score_en_gif__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var _steps_cn_backdrop_en_gif__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./steps/cn-backdrop.en.gif */ "./src/lib/libraries/decks/steps/cn-backdrop.en.gif"); /* harmony import */ var _steps_cn_backdrop_en_gif__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(_steps_cn_backdrop_en_gif__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var _steps_add_sprite_en_gif__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./steps/add-sprite.en.gif */ "./src/lib/libraries/decks/steps/add-sprite.en.gif"); /* harmony import */ var _steps_add_sprite_en_gif__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(_steps_add_sprite_en_gif__WEBPACK_IMPORTED_MODULE_20__); /* harmony import */ var _steps_name_pick_letter_en_gif__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./steps/name-pick-letter.en.gif */ "./src/lib/libraries/decks/steps/name-pick-letter.en.gif"); /* harmony import */ var _steps_name_pick_letter_en_gif__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(_steps_name_pick_letter_en_gif__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var _steps_name_play_sound_en_gif__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./steps/name-play-sound.en.gif */ "./src/lib/libraries/decks/steps/name-play-sound.en.gif"); /* harmony import */ var _steps_name_play_sound_en_gif__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(_steps_name_play_sound_en_gif__WEBPACK_IMPORTED_MODULE_22__); /* harmony import */ var _steps_name_pick_letter2_en_gif__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./steps/name-pick-letter2.en.gif */ "./src/lib/libraries/decks/steps/name-pick-letter2.en.gif"); /* harmony import */ var _steps_name_pick_letter2_en_gif__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(_steps_name_pick_letter2_en_gif__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var _steps_name_change_color_en_gif__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./steps/name-change-color.en.gif */ "./src/lib/libraries/decks/steps/name-change-color.en.gif"); /* harmony import */ var _steps_name_change_color_en_gif__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(_steps_name_change_color_en_gif__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var _steps_name_spin_en_gif__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./steps/name-spin.en.gif */ "./src/lib/libraries/decks/steps/name-spin.en.gif"); /* harmony import */ var _steps_name_spin_en_gif__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(_steps_name_spin_en_gif__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var _steps_name_grow_en_gif__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./steps/name-grow.en.gif */ "./src/lib/libraries/decks/steps/name-grow.en.gif"); /* harmony import */ var _steps_name_grow_en_gif__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(_steps_name_grow_en_gif__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var _steps_music_pick_instrument_en_gif__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./steps/music-pick-instrument.en.gif */ "./src/lib/libraries/decks/steps/music-pick-instrument.en.gif"); /* harmony import */ var _steps_music_pick_instrument_en_gif__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(_steps_music_pick_instrument_en_gif__WEBPACK_IMPORTED_MODULE_27__); /* harmony import */ var _steps_music_play_sound_en_gif__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./steps/music-play-sound.en.gif */ "./src/lib/libraries/decks/steps/music-play-sound.en.gif"); /* harmony import */ var _steps_music_play_sound_en_gif__WEBPACK_IMPORTED_MODULE_28___default = /*#__PURE__*/__webpack_require__.n(_steps_music_play_sound_en_gif__WEBPACK_IMPORTED_MODULE_28__); /* harmony import */ var _steps_music_make_song_en_gif__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./steps/music-make-song.en.gif */ "./src/lib/libraries/decks/steps/music-make-song.en.gif"); /* harmony import */ var _steps_music_make_song_en_gif__WEBPACK_IMPORTED_MODULE_29___default = /*#__PURE__*/__webpack_require__.n(_steps_music_make_song_en_gif__WEBPACK_IMPORTED_MODULE_29__); /* harmony import */ var _steps_music_make_beat_en_gif__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./steps/music-make-beat.en.gif */ "./src/lib/libraries/decks/steps/music-make-beat.en.gif"); /* harmony import */ var _steps_music_make_beat_en_gif__WEBPACK_IMPORTED_MODULE_30___default = /*#__PURE__*/__webpack_require__.n(_steps_music_make_beat_en_gif__WEBPACK_IMPORTED_MODULE_30__); /* harmony import */ var _steps_music_make_beatbox_en_gif__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./steps/music-make-beatbox.en.gif */ "./src/lib/libraries/decks/steps/music-make-beatbox.en.gif"); /* harmony import */ var _steps_music_make_beatbox_en_gif__WEBPACK_IMPORTED_MODULE_31___default = /*#__PURE__*/__webpack_require__.n(_steps_music_make_beatbox_en_gif__WEBPACK_IMPORTED_MODULE_31__); /* harmony import */ var _steps_chase_game_add_backdrop_en_gif__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./steps/chase-game-add-backdrop.en.gif */ "./src/lib/libraries/decks/steps/chase-game-add-backdrop.en.gif"); /* harmony import */ var _steps_chase_game_add_backdrop_en_gif__WEBPACK_IMPORTED_MODULE_32___default = /*#__PURE__*/__webpack_require__.n(_steps_chase_game_add_backdrop_en_gif__WEBPACK_IMPORTED_MODULE_32__); /* harmony import */ var _steps_chase_game_add_sprite1_en_gif__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./steps/chase-game-add-sprite1.en.gif */ "./src/lib/libraries/decks/steps/chase-game-add-sprite1.en.gif"); /* harmony import */ var _steps_chase_game_add_sprite1_en_gif__WEBPACK_IMPORTED_MODULE_33___default = /*#__PURE__*/__webpack_require__.n(_steps_chase_game_add_sprite1_en_gif__WEBPACK_IMPORTED_MODULE_33__); /* harmony import */ var _steps_chase_game_right_left_en_gif__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./steps/chase-game-right-left.en.gif */ "./src/lib/libraries/decks/steps/chase-game-right-left.en.gif"); /* harmony import */ var _steps_chase_game_right_left_en_gif__WEBPACK_IMPORTED_MODULE_34___default = /*#__PURE__*/__webpack_require__.n(_steps_chase_game_right_left_en_gif__WEBPACK_IMPORTED_MODULE_34__); /* harmony import */ var _steps_chase_game_up_down_en_gif__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./steps/chase-game-up-down.en.gif */ "./src/lib/libraries/decks/steps/chase-game-up-down.en.gif"); /* harmony import */ var _steps_chase_game_up_down_en_gif__WEBPACK_IMPORTED_MODULE_35___default = /*#__PURE__*/__webpack_require__.n(_steps_chase_game_up_down_en_gif__WEBPACK_IMPORTED_MODULE_35__); /* harmony import */ var _steps_chase_game_add_sprite2_en_gif__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./steps/chase-game-add-sprite2.en.gif */ "./src/lib/libraries/decks/steps/chase-game-add-sprite2.en.gif"); /* harmony import */ var _steps_chase_game_add_sprite2_en_gif__WEBPACK_IMPORTED_MODULE_36___default = /*#__PURE__*/__webpack_require__.n(_steps_chase_game_add_sprite2_en_gif__WEBPACK_IMPORTED_MODULE_36__); /* harmony import */ var _steps_chase_game_move_randomly_en_gif__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./steps/chase-game-move-randomly.en.gif */ "./src/lib/libraries/decks/steps/chase-game-move-randomly.en.gif"); /* harmony import */ var _steps_chase_game_move_randomly_en_gif__WEBPACK_IMPORTED_MODULE_37___default = /*#__PURE__*/__webpack_require__.n(_steps_chase_game_move_randomly_en_gif__WEBPACK_IMPORTED_MODULE_37__); /* harmony import */ var _steps_chase_game_play_sound_en_gif__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./steps/chase-game-play-sound.en.gif */ "./src/lib/libraries/decks/steps/chase-game-play-sound.en.gif"); /* harmony import */ var _steps_chase_game_play_sound_en_gif__WEBPACK_IMPORTED_MODULE_38___default = /*#__PURE__*/__webpack_require__.n(_steps_chase_game_play_sound_en_gif__WEBPACK_IMPORTED_MODULE_38__); /* harmony import */ var _steps_chase_game_add_variable_en_gif__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./steps/chase-game-add-variable.en.gif */ "./src/lib/libraries/decks/steps/chase-game-add-variable.en.gif"); /* harmony import */ var _steps_chase_game_add_variable_en_gif__WEBPACK_IMPORTED_MODULE_39___default = /*#__PURE__*/__webpack_require__.n(_steps_chase_game_add_variable_en_gif__WEBPACK_IMPORTED_MODULE_39__); /* harmony import */ var _steps_chase_game_change_score_en_gif__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./steps/chase-game-change-score.en.gif */ "./src/lib/libraries/decks/steps/chase-game-change-score.en.gif"); /* harmony import */ var _steps_chase_game_change_score_en_gif__WEBPACK_IMPORTED_MODULE_40___default = /*#__PURE__*/__webpack_require__.n(_steps_chase_game_change_score_en_gif__WEBPACK_IMPORTED_MODULE_40__); /* harmony import */ var _steps_pop_game_pick_sprite_en_gif__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./steps/pop-game-pick-sprite.en.gif */ "./src/lib/libraries/decks/steps/pop-game-pick-sprite.en.gif"); /* harmony import */ var _steps_pop_game_pick_sprite_en_gif__WEBPACK_IMPORTED_MODULE_41___default = /*#__PURE__*/__webpack_require__.n(_steps_pop_game_pick_sprite_en_gif__WEBPACK_IMPORTED_MODULE_41__); /* harmony import */ var _steps_pop_game_play_sound_en_gif__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./steps/pop-game-play-sound.en.gif */ "./src/lib/libraries/decks/steps/pop-game-play-sound.en.gif"); /* harmony import */ var _steps_pop_game_play_sound_en_gif__WEBPACK_IMPORTED_MODULE_42___default = /*#__PURE__*/__webpack_require__.n(_steps_pop_game_play_sound_en_gif__WEBPACK_IMPORTED_MODULE_42__); /* harmony import */ var _steps_pop_game_add_score_en_gif__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./steps/pop-game-add-score.en.gif */ "./src/lib/libraries/decks/steps/pop-game-add-score.en.gif"); /* harmony import */ var _steps_pop_game_add_score_en_gif__WEBPACK_IMPORTED_MODULE_43___default = /*#__PURE__*/__webpack_require__.n(_steps_pop_game_add_score_en_gif__WEBPACK_IMPORTED_MODULE_43__); /* harmony import */ var _steps_pop_game_change_score_en_gif__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./steps/pop-game-change-score.en.gif */ "./src/lib/libraries/decks/steps/pop-game-change-score.en.gif"); /* harmony import */ var _steps_pop_game_change_score_en_gif__WEBPACK_IMPORTED_MODULE_44___default = /*#__PURE__*/__webpack_require__.n(_steps_pop_game_change_score_en_gif__WEBPACK_IMPORTED_MODULE_44__); /* harmony import */ var _steps_pop_game_random_position_en_gif__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./steps/pop-game-random-position.en.gif */ "./src/lib/libraries/decks/steps/pop-game-random-position.en.gif"); /* harmony import */ var _steps_pop_game_random_position_en_gif__WEBPACK_IMPORTED_MODULE_45___default = /*#__PURE__*/__webpack_require__.n(_steps_pop_game_random_position_en_gif__WEBPACK_IMPORTED_MODULE_45__); /* harmony import */ var _steps_pop_game_change_color_en_gif__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./steps/pop-game-change-color.en.gif */ "./src/lib/libraries/decks/steps/pop-game-change-color.en.gif"); /* harmony import */ var _steps_pop_game_change_color_en_gif__WEBPACK_IMPORTED_MODULE_46___default = /*#__PURE__*/__webpack_require__.n(_steps_pop_game_change_color_en_gif__WEBPACK_IMPORTED_MODULE_46__); /* harmony import */ var _steps_pop_game_reset_score_en_gif__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./steps/pop-game-reset-score.en.gif */ "./src/lib/libraries/decks/steps/pop-game-reset-score.en.gif"); /* harmony import */ var _steps_pop_game_reset_score_en_gif__WEBPACK_IMPORTED_MODULE_47___default = /*#__PURE__*/__webpack_require__.n(_steps_pop_game_reset_score_en_gif__WEBPACK_IMPORTED_MODULE_47__); /* harmony import */ var _steps_animate_char_pick_backdrop_en_gif__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./steps/animate-char-pick-backdrop.en.gif */ "./src/lib/libraries/decks/steps/animate-char-pick-backdrop.en.gif"); /* harmony import */ var _steps_animate_char_pick_backdrop_en_gif__WEBPACK_IMPORTED_MODULE_48___default = /*#__PURE__*/__webpack_require__.n(_steps_animate_char_pick_backdrop_en_gif__WEBPACK_IMPORTED_MODULE_48__); /* harmony import */ var _steps_animate_char_pick_sprite_en_gif__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./steps/animate-char-pick-sprite.en.gif */ "./src/lib/libraries/decks/steps/animate-char-pick-sprite.en.gif"); /* harmony import */ var _steps_animate_char_pick_sprite_en_gif__WEBPACK_IMPORTED_MODULE_49___default = /*#__PURE__*/__webpack_require__.n(_steps_animate_char_pick_sprite_en_gif__WEBPACK_IMPORTED_MODULE_49__); /* harmony import */ var _steps_animate_char_say_something_en_gif__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./steps/animate-char-say-something.en.gif */ "./src/lib/libraries/decks/steps/animate-char-say-something.en.gif"); /* harmony import */ var _steps_animate_char_say_something_en_gif__WEBPACK_IMPORTED_MODULE_50___default = /*#__PURE__*/__webpack_require__.n(_steps_animate_char_say_something_en_gif__WEBPACK_IMPORTED_MODULE_50__); /* harmony import */ var _steps_animate_char_add_sound_en_gif__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./steps/animate-char-add-sound.en.gif */ "./src/lib/libraries/decks/steps/animate-char-add-sound.en.gif"); /* harmony import */ var _steps_animate_char_add_sound_en_gif__WEBPACK_IMPORTED_MODULE_51___default = /*#__PURE__*/__webpack_require__.n(_steps_animate_char_add_sound_en_gif__WEBPACK_IMPORTED_MODULE_51__); /* harmony import */ var _steps_animate_char_talk_en_gif__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./steps/animate-char-talk.en.gif */ "./src/lib/libraries/decks/steps/animate-char-talk.en.gif"); /* harmony import */ var _steps_animate_char_talk_en_gif__WEBPACK_IMPORTED_MODULE_52___default = /*#__PURE__*/__webpack_require__.n(_steps_animate_char_talk_en_gif__WEBPACK_IMPORTED_MODULE_52__); /* harmony import */ var _steps_animate_char_move_en_gif__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./steps/animate-char-move.en.gif */ "./src/lib/libraries/decks/steps/animate-char-move.en.gif"); /* harmony import */ var _steps_animate_char_move_en_gif__WEBPACK_IMPORTED_MODULE_53___default = /*#__PURE__*/__webpack_require__.n(_steps_animate_char_move_en_gif__WEBPACK_IMPORTED_MODULE_53__); /* harmony import */ var _steps_animate_char_jump_en_gif__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./steps/animate-char-jump.en.gif */ "./src/lib/libraries/decks/steps/animate-char-jump.en.gif"); /* harmony import */ var _steps_animate_char_jump_en_gif__WEBPACK_IMPORTED_MODULE_54___default = /*#__PURE__*/__webpack_require__.n(_steps_animate_char_jump_en_gif__WEBPACK_IMPORTED_MODULE_54__); /* harmony import */ var _steps_animate_char_change_color_en_gif__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./steps/animate-char-change-color.en.gif */ "./src/lib/libraries/decks/steps/animate-char-change-color.en.gif"); /* harmony import */ var _steps_animate_char_change_color_en_gif__WEBPACK_IMPORTED_MODULE_55___default = /*#__PURE__*/__webpack_require__.n(_steps_animate_char_change_color_en_gif__WEBPACK_IMPORTED_MODULE_55__); /* harmony import */ var _steps_story_pick_backdrop_en_gif__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./steps/story-pick-backdrop.en.gif */ "./src/lib/libraries/decks/steps/story-pick-backdrop.en.gif"); /* harmony import */ var _steps_story_pick_backdrop_en_gif__WEBPACK_IMPORTED_MODULE_56___default = /*#__PURE__*/__webpack_require__.n(_steps_story_pick_backdrop_en_gif__WEBPACK_IMPORTED_MODULE_56__); /* harmony import */ var _steps_story_pick_sprite_en_gif__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./steps/story-pick-sprite.en.gif */ "./src/lib/libraries/decks/steps/story-pick-sprite.en.gif"); /* harmony import */ var _steps_story_pick_sprite_en_gif__WEBPACK_IMPORTED_MODULE_57___default = /*#__PURE__*/__webpack_require__.n(_steps_story_pick_sprite_en_gif__WEBPACK_IMPORTED_MODULE_57__); /* harmony import */ var _steps_story_say_something_en_gif__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ./steps/story-say-something.en.gif */ "./src/lib/libraries/decks/steps/story-say-something.en.gif"); /* harmony import */ var _steps_story_say_something_en_gif__WEBPACK_IMPORTED_MODULE_58___default = /*#__PURE__*/__webpack_require__.n(_steps_story_say_something_en_gif__WEBPACK_IMPORTED_MODULE_58__); /* harmony import */ var _steps_story_pick_sprite2_en_gif__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ./steps/story-pick-sprite2.en.gif */ "./src/lib/libraries/decks/steps/story-pick-sprite2.en.gif"); /* harmony import */ var _steps_story_pick_sprite2_en_gif__WEBPACK_IMPORTED_MODULE_59___default = /*#__PURE__*/__webpack_require__.n(_steps_story_pick_sprite2_en_gif__WEBPACK_IMPORTED_MODULE_59__); /* harmony import */ var _steps_story_flip_en_gif__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ./steps/story-flip.en.gif */ "./src/lib/libraries/decks/steps/story-flip.en.gif"); /* harmony import */ var _steps_story_flip_en_gif__WEBPACK_IMPORTED_MODULE_60___default = /*#__PURE__*/__webpack_require__.n(_steps_story_flip_en_gif__WEBPACK_IMPORTED_MODULE_60__); /* harmony import */ var _steps_story_conversation_en_gif__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ./steps/story-conversation.en.gif */ "./src/lib/libraries/decks/steps/story-conversation.en.gif"); /* harmony import */ var _steps_story_conversation_en_gif__WEBPACK_IMPORTED_MODULE_61___default = /*#__PURE__*/__webpack_require__.n(_steps_story_conversation_en_gif__WEBPACK_IMPORTED_MODULE_61__); /* harmony import */ var _steps_story_pick_backdrop2_en_gif__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ./steps/story-pick-backdrop2.en.gif */ "./src/lib/libraries/decks/steps/story-pick-backdrop2.en.gif"); /* harmony import */ var _steps_story_pick_backdrop2_en_gif__WEBPACK_IMPORTED_MODULE_62___default = /*#__PURE__*/__webpack_require__.n(_steps_story_pick_backdrop2_en_gif__WEBPACK_IMPORTED_MODULE_62__); /* harmony import */ var _steps_story_switch_backdrop_en_gif__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ./steps/story-switch-backdrop.en.gif */ "./src/lib/libraries/decks/steps/story-switch-backdrop.en.gif"); /* harmony import */ var _steps_story_switch_backdrop_en_gif__WEBPACK_IMPORTED_MODULE_63___default = /*#__PURE__*/__webpack_require__.n(_steps_story_switch_backdrop_en_gif__WEBPACK_IMPORTED_MODULE_63__); /* harmony import */ var _steps_story_hide_character_en_gif__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ./steps/story-hide-character.en.gif */ "./src/lib/libraries/decks/steps/story-hide-character.en.gif"); /* harmony import */ var _steps_story_hide_character_en_gif__WEBPACK_IMPORTED_MODULE_64___default = /*#__PURE__*/__webpack_require__.n(_steps_story_hide_character_en_gif__WEBPACK_IMPORTED_MODULE_64__); /* harmony import */ var _steps_story_show_character_en_gif__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(/*! ./steps/story-show-character.en.gif */ "./src/lib/libraries/decks/steps/story-show-character.en.gif"); /* harmony import */ var _steps_story_show_character_en_gif__WEBPACK_IMPORTED_MODULE_65___default = /*#__PURE__*/__webpack_require__.n(_steps_story_show_character_en_gif__WEBPACK_IMPORTED_MODULE_65__); /* harmony import */ var _steps_video_add_extension_en_gif__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(/*! ./steps/video-add-extension.en.gif */ "./src/lib/libraries/decks/steps/video-add-extension.en.gif"); /* harmony import */ var _steps_video_add_extension_en_gif__WEBPACK_IMPORTED_MODULE_66___default = /*#__PURE__*/__webpack_require__.n(_steps_video_add_extension_en_gif__WEBPACK_IMPORTED_MODULE_66__); /* harmony import */ var _steps_video_pet_en_gif__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(/*! ./steps/video-pet.en.gif */ "./src/lib/libraries/decks/steps/video-pet.en.gif"); /* harmony import */ var _steps_video_pet_en_gif__WEBPACK_IMPORTED_MODULE_67___default = /*#__PURE__*/__webpack_require__.n(_steps_video_pet_en_gif__WEBPACK_IMPORTED_MODULE_67__); /* harmony import */ var _steps_video_animate_en_gif__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(/*! ./steps/video-animate.en.gif */ "./src/lib/libraries/decks/steps/video-animate.en.gif"); /* harmony import */ var _steps_video_animate_en_gif__WEBPACK_IMPORTED_MODULE_68___default = /*#__PURE__*/__webpack_require__.n(_steps_video_animate_en_gif__WEBPACK_IMPORTED_MODULE_68__); /* harmony import */ var _steps_video_pop_en_gif__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(/*! ./steps/video-pop.en.gif */ "./src/lib/libraries/decks/steps/video-pop.en.gif"); /* harmony import */ var _steps_video_pop_en_gif__WEBPACK_IMPORTED_MODULE_69___default = /*#__PURE__*/__webpack_require__.n(_steps_video_pop_en_gif__WEBPACK_IMPORTED_MODULE_69__); // Intro // Text to Speech // Cartoon Network // Add sprite // Animate a name // Make-Music // Chase-Game // Clicker-Game (Pop Game) // Animate A Character // Tell A Story // Video Sensing var enImages = { // Intro introMove: _steps_intro_move_en_gif__WEBPACK_IMPORTED_MODULE_0___default.a, introSayHello: _steps_intro_say_hello_en_gif__WEBPACK_IMPORTED_MODULE_1___default.a, // Text to Speech speechAddExtension: _steps_speech_add_extension_en_gif__WEBPACK_IMPORTED_MODULE_2___default.a, speechSaySomething: _steps_speech_say_something_en_gif__WEBPACK_IMPORTED_MODULE_3___default.a, speechSetVoice: _steps_speech_set_voice_en_gif__WEBPACK_IMPORTED_MODULE_4___default.a, speechMoveAround: _steps_speech_move_around_en_gif__WEBPACK_IMPORTED_MODULE_5___default.a, speechAddBackdrop: _steps_speech_add_backdrop_en_gif__WEBPACK_IMPORTED_MODULE_6___default.a, speechAddSprite: _steps_speech_add_sprite_en_gif__WEBPACK_IMPORTED_MODULE_7___default.a, speechSong: _steps_speech_song_en_gif__WEBPACK_IMPORTED_MODULE_8___default.a, speechChangeColor: _steps_speech_change_color_en_gif__WEBPACK_IMPORTED_MODULE_9___default.a, speechSpin: _steps_speech_spin_en_gif__WEBPACK_IMPORTED_MODULE_10___default.a, speechGrowShrink: _steps_speech_grow_shrink_en_gif__WEBPACK_IMPORTED_MODULE_11___default.a, // Cartoon Network cnShowCharacter: _steps_cn_show_character_en_gif__WEBPACK_IMPORTED_MODULE_12___default.a, cnSay: _steps_cn_say_en_gif__WEBPACK_IMPORTED_MODULE_13___default.a, cnGlide: _steps_cn_glide_en_gif__WEBPACK_IMPORTED_MODULE_14___default.a, cnPickSprite: _steps_cn_pick_sprite_en_gif__WEBPACK_IMPORTED_MODULE_15___default.a, cnCollect: _steps_cn_collect_en_gif__WEBPACK_IMPORTED_MODULE_16___default.a, cnVariable: _steps_cn_variable_en_gif__WEBPACK_IMPORTED_MODULE_17___default.a, cnScore: _steps_cn_score_en_gif__WEBPACK_IMPORTED_MODULE_18___default.a, cnBackdrop: _steps_cn_backdrop_en_gif__WEBPACK_IMPORTED_MODULE_19___default.a, // Add sprite addSprite: _steps_add_sprite_en_gif__WEBPACK_IMPORTED_MODULE_20___default.a, // Animate a name namePickLetter: _steps_name_pick_letter_en_gif__WEBPACK_IMPORTED_MODULE_21___default.a, namePlaySound: _steps_name_play_sound_en_gif__WEBPACK_IMPORTED_MODULE_22___default.a, namePickLetter2: _steps_name_pick_letter2_en_gif__WEBPACK_IMPORTED_MODULE_23___default.a, nameChangeColor: _steps_name_change_color_en_gif__WEBPACK_IMPORTED_MODULE_24___default.a, nameSpin: _steps_name_spin_en_gif__WEBPACK_IMPORTED_MODULE_25___default.a, nameGrow: _steps_name_grow_en_gif__WEBPACK_IMPORTED_MODULE_26___default.a, // Make-Music musicPickInstrument: _steps_music_pick_instrument_en_gif__WEBPACK_IMPORTED_MODULE_27___default.a, musicPlaySound: _steps_music_play_sound_en_gif__WEBPACK_IMPORTED_MODULE_28___default.a, musicMakeSong: _steps_music_make_song_en_gif__WEBPACK_IMPORTED_MODULE_29___default.a, musicMakeBeat: _steps_music_make_beat_en_gif__WEBPACK_IMPORTED_MODULE_30___default.a, musicMakeBeatbox: _steps_music_make_beatbox_en_gif__WEBPACK_IMPORTED_MODULE_31___default.a, // Chase-Game chaseGameAddBackdrop: _steps_chase_game_add_backdrop_en_gif__WEBPACK_IMPORTED_MODULE_32___default.a, chaseGameAddSprite1: _steps_chase_game_add_sprite1_en_gif__WEBPACK_IMPORTED_MODULE_33___default.a, chaseGameRightLeft: _steps_chase_game_right_left_en_gif__WEBPACK_IMPORTED_MODULE_34___default.a, chaseGameUpDown: _steps_chase_game_up_down_en_gif__WEBPACK_IMPORTED_MODULE_35___default.a, chaseGameAddSprite2: _steps_chase_game_add_sprite2_en_gif__WEBPACK_IMPORTED_MODULE_36___default.a, chaseGameMoveRandomly: _steps_chase_game_move_randomly_en_gif__WEBPACK_IMPORTED_MODULE_37___default.a, chaseGamePlaySound: _steps_chase_game_play_sound_en_gif__WEBPACK_IMPORTED_MODULE_38___default.a, chaseGameAddVariable: _steps_chase_game_add_variable_en_gif__WEBPACK_IMPORTED_MODULE_39___default.a, chaseGameChangeScore: _steps_chase_game_change_score_en_gif__WEBPACK_IMPORTED_MODULE_40___default.a, // Make-A-Pop/Clicker Game popGamePickSprite: _steps_pop_game_pick_sprite_en_gif__WEBPACK_IMPORTED_MODULE_41___default.a, popGamePlaySound: _steps_pop_game_play_sound_en_gif__WEBPACK_IMPORTED_MODULE_42___default.a, popGameAddScore: _steps_pop_game_add_score_en_gif__WEBPACK_IMPORTED_MODULE_43___default.a, popGameChangeScore: _steps_pop_game_change_score_en_gif__WEBPACK_IMPORTED_MODULE_44___default.a, popGameRandomPosition: _steps_pop_game_random_position_en_gif__WEBPACK_IMPORTED_MODULE_45___default.a, popGameChangeColor: _steps_pop_game_change_color_en_gif__WEBPACK_IMPORTED_MODULE_46___default.a, popGameResetScore: _steps_pop_game_reset_score_en_gif__WEBPACK_IMPORTED_MODULE_47___default.a, // Animate A Character animateCharPickBackdrop: _steps_animate_char_pick_backdrop_en_gif__WEBPACK_IMPORTED_MODULE_48___default.a, animateCharPickSprite: _steps_animate_char_pick_sprite_en_gif__WEBPACK_IMPORTED_MODULE_49___default.a, animateCharSaySomething: _steps_animate_char_say_something_en_gif__WEBPACK_IMPORTED_MODULE_50___default.a, animateCharAddSound: _steps_animate_char_add_sound_en_gif__WEBPACK_IMPORTED_MODULE_51___default.a, animateCharTalk: _steps_animate_char_talk_en_gif__WEBPACK_IMPORTED_MODULE_52___default.a, animateCharMove: _steps_animate_char_move_en_gif__WEBPACK_IMPORTED_MODULE_53___default.a, animateCharJump: _steps_animate_char_jump_en_gif__WEBPACK_IMPORTED_MODULE_54___default.a, animateCharChangeColor: _steps_animate_char_change_color_en_gif__WEBPACK_IMPORTED_MODULE_55___default.a, // Tell A Story storyPickBackdrop: _steps_story_pick_backdrop_en_gif__WEBPACK_IMPORTED_MODULE_56___default.a, storyPickSprite: _steps_story_pick_sprite_en_gif__WEBPACK_IMPORTED_MODULE_57___default.a, storySaySomething: _steps_story_say_something_en_gif__WEBPACK_IMPORTED_MODULE_58___default.a, storyPickSprite2: _steps_story_pick_sprite2_en_gif__WEBPACK_IMPORTED_MODULE_59___default.a, storyFlip: _steps_story_flip_en_gif__WEBPACK_IMPORTED_MODULE_60___default.a, storyConversation: _steps_story_conversation_en_gif__WEBPACK_IMPORTED_MODULE_61___default.a, storyPickBackdrop2: _steps_story_pick_backdrop2_en_gif__WEBPACK_IMPORTED_MODULE_62___default.a, storySwitchBackdrop: _steps_story_switch_backdrop_en_gif__WEBPACK_IMPORTED_MODULE_63___default.a, storyHideCharacter: _steps_story_hide_character_en_gif__WEBPACK_IMPORTED_MODULE_64___default.a, storyShowCharacter: _steps_story_show_character_en_gif__WEBPACK_IMPORTED_MODULE_65___default.a, // Video Sensing videoAddExtension: _steps_video_add_extension_en_gif__WEBPACK_IMPORTED_MODULE_66___default.a, videoPet: _steps_video_pet_en_gif__WEBPACK_IMPORTED_MODULE_67___default.a, videoAnimate: _steps_video_animate_en_gif__WEBPACK_IMPORTED_MODULE_68___default.a, videoPop: _steps_video_pop_en_gif__WEBPACK_IMPORTED_MODULE_69___default.a }; /***/ }), /***/ "./src/lib/libraries/decks/index.jsx": /*!*******************************************!*\ !*** ./src/lib/libraries/decks/index.jsx ***! \*******************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _thumbnails_getting_started_jpg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./thumbnails/getting-started.jpg */ "./src/lib/libraries/decks/thumbnails/getting-started.jpg"); /* harmony import */ var _thumbnails_getting_started_jpg__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_thumbnails_getting_started_jpg__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _thumbnails_text_to_speech_jpg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./thumbnails/text-to-speech.jpg */ "./src/lib/libraries/decks/thumbnails/text-to-speech.jpg"); /* harmony import */ var _thumbnails_text_to_speech_jpg__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_thumbnails_text_to_speech_jpg__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _thumbnails_cartoon_network_jpg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./thumbnails/cartoon-network.jpg */ "./src/lib/libraries/decks/thumbnails/cartoon-network.jpg"); /* harmony import */ var _thumbnails_cartoon_network_jpg__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_thumbnails_cartoon_network_jpg__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _thumbnails_add_sprite_jpg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./thumbnails/add-sprite.jpg */ "./src/lib/libraries/decks/thumbnails/add-sprite.jpg"); /* harmony import */ var _thumbnails_add_sprite_jpg__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_thumbnails_add_sprite_jpg__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _thumbnails_animate_a_name_jpg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./thumbnails/animate-a-name.jpg */ "./src/lib/libraries/decks/thumbnails/animate-a-name.jpg"); /* harmony import */ var _thumbnails_animate_a_name_jpg__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_thumbnails_animate_a_name_jpg__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _thumbnails_make_music_jpg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./thumbnails/make-music.jpg */ "./src/lib/libraries/decks/thumbnails/make-music.jpg"); /* harmony import */ var _thumbnails_make_music_jpg__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_thumbnails_make_music_jpg__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _thumbnails_chase_game_jpg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./thumbnails/chase-game.jpg */ "./src/lib/libraries/decks/thumbnails/chase-game.jpg"); /* harmony import */ var _thumbnails_chase_game_jpg__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_thumbnails_chase_game_jpg__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _thumbnails_pop_game_jpg__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./thumbnails/pop-game.jpg */ "./src/lib/libraries/decks/thumbnails/pop-game.jpg"); /* harmony import */ var _thumbnails_pop_game_jpg__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_thumbnails_pop_game_jpg__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _thumbnails_animate_a_character_jpg__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./thumbnails/animate-a-character.jpg */ "./src/lib/libraries/decks/thumbnails/animate-a-character.jpg"); /* harmony import */ var _thumbnails_animate_a_character_jpg__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_thumbnails_animate_a_character_jpg__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _thumbnails_tell_a_story_jpg__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./thumbnails/tell-a-story.jpg */ "./src/lib/libraries/decks/thumbnails/tell-a-story.jpg"); /* harmony import */ var _thumbnails_tell_a_story_jpg__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_thumbnails_tell_a_story_jpg__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _thumbnails_video_sensing_jpg__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./thumbnails/video-sensing.jpg */ "./src/lib/libraries/decks/thumbnails/video-sensing.jpg"); /* harmony import */ var _thumbnails_video_sensing_jpg__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_thumbnails_video_sensing_jpg__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var _thumbnails_record_a_sound_jpg__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./thumbnails/record-a-sound.jpg */ "./src/lib/libraries/decks/thumbnails/record-a-sound.jpg"); /* harmony import */ var _thumbnails_record_a_sound_jpg__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_thumbnails_record_a_sound_jpg__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var _thumbnails_glide_around_jpg__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./thumbnails/glide-around.jpg */ "./src/lib/libraries/decks/thumbnails/glide-around.jpg"); /* harmony import */ var _thumbnails_glide_around_jpg__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_thumbnails_glide_around_jpg__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var _thumbnails_change_size_jpg__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./thumbnails/change-size.jpg */ "./src/lib/libraries/decks/thumbnails/change-size.jpg"); /* harmony import */ var _thumbnails_change_size_jpg__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_thumbnails_change_size_jpg__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var _thumbnails_animate_sprite_jpg__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./thumbnails/animate-sprite.jpg */ "./src/lib/libraries/decks/thumbnails/animate-sprite.jpg"); /* harmony import */ var _thumbnails_animate_sprite_jpg__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(_thumbnails_animate_sprite_jpg__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var _thumbnails_hide_and_show_jpg__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./thumbnails/hide-and-show.jpg */ "./src/lib/libraries/decks/thumbnails/hide-and-show.jpg"); /* harmony import */ var _thumbnails_hide_and_show_jpg__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(_thumbnails_hide_and_show_jpg__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var _thumbnails_add_backdrop_jpg__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./thumbnails/add-backdrop.jpg */ "./src/lib/libraries/decks/thumbnails/add-backdrop.jpg"); /* harmony import */ var _thumbnails_add_backdrop_jpg__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(_thumbnails_add_backdrop_jpg__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var _thumbnails_add_effects_jpg__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./thumbnails/add-effects.jpg */ "./src/lib/libraries/decks/thumbnails/add-effects.jpg"); /* harmony import */ var _thumbnails_add_effects_jpg__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(_thumbnails_add_effects_jpg__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var _thumbnails_move_arrow_keys_jpg__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./thumbnails/move-arrow-keys.jpg */ "./src/lib/libraries/decks/thumbnails/move-arrow-keys.jpg"); /* harmony import */ var _thumbnails_move_arrow_keys_jpg__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(_thumbnails_move_arrow_keys_jpg__WEBPACK_IMPORTED_MODULE_20__); /* harmony import */ var _thumbnails_spin_jpg__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./thumbnails/spin.jpg */ "./src/lib/libraries/decks/thumbnails/spin.jpg"); /* harmony import */ var _thumbnails_spin_jpg__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(_thumbnails_spin_jpg__WEBPACK_IMPORTED_MODULE_21__); // Tutorial thumbnails: Avoid using any text that would need to be // translated in thumbnails. // Intro // Text to Speech // Cartoon Network // Add sprite // Animate a name // Make-Music // Chase-Game // Make-A-Game // Animate A Character // Tell A Story // Video Sensing // Videos /* harmony default export */ __webpack_exports__["default"] = ({ 'intro-move-sayhello': { name: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Getting Started", id: "gui.howtos.intro-move-sayhello-hat.name" }), tags: ['help', 'stuck', 'how', 'can', 'say'], img: _thumbnails_getting_started_jpg__WEBPACK_IMPORTED_MODULE_2___default.a, steps: [{ video: 'intro-move-sayhello' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Add a move block", id: "gui.howtos.intro-move.step_stepMove" }), image: 'introMove' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Click the green flag to start", id: "gui.howtos.add-a-move-block.step_stepMoveSayHello" }), image: 'introSayHello' }, { deckIds: ['add-a-backdrop', 'add-sprite'] }], urlId: 'getStarted' }, 'say-it-out-loud': { name: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Create Animations That Talk", id: "gui.howtos.say-it-out-loud" }), img: _thumbnails_text_to_speech_jpg__WEBPACK_IMPORTED_MODULE_3___default.a, steps: [{ video: 'k54n8uwcty', trackingPixel: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("img", { src: "https://code.org/api/hour/begin_scratch_talk.png" }) }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Add the Text to Speech blocks", id: "gui.howtos.say-it-out-loud.step_AddTXTextension" }), image: 'speechAddExtension' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Say Something", id: "gui.howtos.say-it-out-loud.step_TXTSpeech" }), image: 'speechSaySomething' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Set a Voice", id: "gui.howtos.say-it-out-loud_TXTSetVoice" }), image: 'speechSetVoice' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Move Around", id: "gui.howtos.say-it-out-loud.step_TXTMove" }), image: 'speechMoveAround' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Add a Backdrop ", id: "gui.howtos.say-it-out-loud.step_TXTBackdrop" }), image: 'speechAddBackdrop' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Add Another Character", id: "gui.howtos.say-it-out-loud.step_TXTAddSprite" }), image: 'speechAddSprite' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Perform a Song", id: "gui.howtos.say-it-out-loud.step_TXTSong" }), image: 'speechSong' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Change Color", id: "gui.howtos.say-it-out-loud.step_TXTColor" }), image: 'speechChangeColor' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Spin Around", id: "gui.howtos.say-it-out-loud.step_TXTSpin" }), image: 'speechSpin' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Grow and Shrink", id: "gui.howtos.say-it-out-loud.step_TXTGrow" }), image: 'speechGrowShrink' }, { deckIds: ['animate-a-name', 'Make-Music'] }], urlId: 'animations-that-talk' }, 'cartoon-network': { name: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Animate an Adventure Game", id: "gui.howtos.cartoon-network" }), requiredProjectId: '249143200', img: _thumbnails_cartoon_network_jpg__WEBPACK_IMPORTED_MODULE_4___default.a, steps: [{ video: 'uz5oz5h9yg', trackingPixel: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("img", { src: "https://code.org/api/hour/begin_scratch_adventure.png" }) }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Choose a Character to Show", id: "gui.howtos.cartoon-network.step_CNcharacter" }), image: 'cnShowCharacter' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Say Something", id: "gui.howtos.cartoon-network.step_CNsay" }), image: 'cnSay' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Glide Around", id: "gui.howtos.cartoon-network.step_CNglide" }), image: 'cnGlide' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: " Choose an Object to Chase ", id: "gui.howtos.cartoon-network.step_CNpicksprite" }), image: 'cnPickSprite' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Collect Objects", id: "gui.howtos.cartoon-network.step_CNcollect" }), image: 'cnCollect' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Make a Score Variable", id: "gui.howtos.cartoon-network.step_CNvariable" }), image: 'cnVariable' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Keep Score", id: "gui.howtos.cartoon-network.step_CNscore" }), image: 'cnScore' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Level Up: Change Backdrop", id: "gui.howtos.cartoon-network.step_CNbackdrop" }), image: 'cnBackdrop' }, { video: '6o76f5ivo1' }, { deckIds: ['switch-costume', 'add-effects'] }], urlId: 'animate-an-adventure-game' }, 'animate-a-name': { name: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Animate a Name", id: "gui.howtos.animate-a-name.name" }), img: _thumbnails_animate_a_name_jpg__WEBPACK_IMPORTED_MODULE_6___default.a, tags: ['animation', 'art', 'spin', 'grow'], steps: [{ video: 'animate-a-name' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Pick a Letter Sprite", id: "gui.howtos.animate-a-name.step_AnimatePickLetter" }), image: 'namePickLetter' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Play a Sound When Clicked", id: "gui.howtos.animate-a-name.step_AnimatePlaySound" }), image: 'namePlaySound' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Pick Another Letter Sprite", id: "gui.howtos.animate-a-name.step_AnimatePickLetter2" }), image: 'namePickLetter2' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Change color", id: "gui.howtos.animate-a-name.step_AnimateChangeColor" }), image: 'nameChangeColor' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Pick Another Letter Sprite & Make It Spin", id: "gui.howtos.animate-a-name.step_AnimateSpin" }), image: 'nameSpin' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Pick Another Letter Sprite & Make It Grow", id: "gui.howtos.animate-a-name.step_AnimateGrow" }), image: 'nameGrow' }, { deckIds: ['add-a-backdrop', 'glide-around'] }], urlId: 'name' }, 'Make-Music': { name: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Make Music", id: "gui.howtos.make-music.name" }), img: _thumbnails_make_music_jpg__WEBPACK_IMPORTED_MODULE_7___default.a, tags: ['music', 'sound', 'instrument', 'play', 'song', 'band'], steps: [{ video: 'Make-Music' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Pick an Instrument Sprite ", id: "gui.howtos.Make-Music.step_PickInstrument" }), image: 'musicPickInstrument' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Play Sound When Clicked", id: "gui.howtos.Make-Music.step_PlaySoundClick" }), image: 'musicPlaySound' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Create a Song", id: "gui.howtos.Make-Music.step_MakeSong" }), image: 'musicMakeSong' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Choose a Drum & Make a Beat", id: "gui.howtos.make-music.step_MakeBeat" }), image: 'musicMakeBeat' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Choose the Microphone Sprite & Surprise Beatbox", id: "gui.howtos.make-music.step_MakeBeatBox" }), image: 'musicMakeBeatbox' }, { deckIds: ['add-a-backdrop', 'add-sprite'] }], urlId: 'music' }, 'Make-A-Game': { name: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Make a Clicker Game", id: "gui.howtos.make-a-game.name" }), img: _thumbnails_pop_game_jpg__WEBPACK_IMPORTED_MODULE_9___default.a, tags: ['games', 'click', 'clicked', 'score'], steps: [{ video: 'Make-A-Game' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Pick A Sprite", id: "gui.howtos.Make-A-Game.step_GamePickSprite" }), image: 'popGamePickSprite' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Play Sound When Clicked", id: "gui.howtos.make-a-game.step_GamePlaySound" }), image: 'popGamePlaySound' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Create Score Variable", id: "gui.howtos.make-a-game.step_GameAddScore" }), image: 'popGameAddScore' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "When Clicked Increase Score", id: "gui.howtos.make-a-game.step_GameChangeScore" }), image: 'popGameChangeScore' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Go to a random position", id: "gui.howtos.make-a-game.step_Random" }), image: 'popGameRandomPosition' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Change Color", id: "gui.howtos.make-music.step_GameChangeColor" }), image: 'popGameChangeColor' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Reset Score", id: "gui.howtos.make-music.step_ResetScore" }), image: 'popGameResetScore' }, { deckIds: ['add-a-backdrop', 'move-around-with-arrow-keys'] }], urlId: 'clicker-game' }, 'Chase-Game': { name: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Make a Chase Game", id: "gui.howtos.make-a-chase-game.name" }), img: _thumbnails_chase_game_jpg__WEBPACK_IMPORTED_MODULE_8___default.a, tags: ['games', 'arrow', 'keyboard', 'score'], steps: [{ video: 'Chase-Game' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Add a Backdrop", id: "gui.howtos.Chase-Game.step_BG" }), image: 'chaseGameAddBackdrop' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Add a Sprite", id: "gui.howtos.chase-game.step_AddOcto" }), image: 'chaseGameAddSprite1' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Move Right & Left With Arrow Keys", id: "gui.howtos.make-music.step_LeftRight" }), image: 'chaseGameRightLeft' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Move Up & Down With Arrow Keys", id: "gui.howtos.Chase-Game.step_UpDown" }), image: 'chaseGameUpDown' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Add Another Sprite", id: "gui.howtos.Chase-Game.step_AddStar" }), image: 'chaseGameAddSprite2' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Move Randomly", id: "gui.howtos.Chase-Game.step_MoveRandom" }), image: 'chaseGameMoveRandomly' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "In Octopus Sprite, When Touching Play Sound", id: "gui.howtos.Chase-Game.step_WhenTouch" }), image: 'chaseGamePlaySound' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Create Score Variable", id: "gui.howtos.Chase-Game.step_ScoreVariable" }), image: 'chaseGameAddVariable' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "In Octopus Sprite, When Touching Add Score", id: "gui.howtos.Chase-Game.ScoreWhenTouch" }), image: 'chaseGameChangeScore' }, { deckIds: ['add-effects', 'move-around-with-arrow-keys'] }], urlId: 'chase-game' }, 'Animate-A-Character': { name: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Animate A Character", id: "gui.howtos.animate-char.name" }), img: _thumbnails_animate_a_character_jpg__WEBPACK_IMPORTED_MODULE_10___default.a, steps: [{ video: 's228u3g5u9' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Add a Backdrop", id: "gui.howtos.animate-char.step_addbg" }), image: 'animateCharPickBackdrop' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Add a Sprite", id: "gui.howtos.animate-char.step_addsprite" }), image: 'animateCharPickSprite' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Say Something", id: "gui.howtos.animate-char.step_saysomething" }), image: 'animateCharSaySomething' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Add Sound", id: "gui.howtos.animate-char.step_addsound" }), image: 'animateCharAddSound' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Animate Talking", id: "gui.howtos.animate-char.step_animatetalking" }), image: 'animateCharTalk' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Move Using Arrow Keys", id: "gui.howtos.animate-char.step_arrowkeys" }), image: 'animateCharMove' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Jump", id: "gui.howtos.animate-char.step_jump" }), image: 'animateCharJump' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Change Color", id: "gui.howtos.animate-char.step_changecolor" }), image: 'animateCharChangeColor' }, { deckIds: ['Chase-Game', 'Tell-A-Story'] }], urlId: 'animate-a-character' }, 'Tell-A-Story': { name: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Create A Story", id: "gui.howtos.story.name" }), img: _thumbnails_tell_a_story_jpg__WEBPACK_IMPORTED_MODULE_11___default.a, steps: [{ video: 'stah7jjorp' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Add a Backdrop", id: "gui.howtos.story.step_addbg" }), image: 'storyPickBackdrop' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Add a Character", id: "gui.howtos.story.step_addsprite" }), image: 'storyPickSprite' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Say Something", id: "gui.howtos.story.step_saysomething" }), image: 'storySaySomething' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Add Another Character", id: "gui.howtos.story.step_addanothersprite" }), image: 'storyPickSprite2' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Flip Direction", id: "gui.howtos.story.step_flip" }), image: 'storyFlip' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Have A Conversation", id: "gui.howtos.story.step_conversation" }), image: 'storyConversation' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Add Another Backdrop", id: "gui.howtos.story.addanotherbg" }), image: 'storyPickBackdrop2' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Switch Backdrops", id: "gui.howtos.story.step_swithbg" }), image: 'storySwitchBackdrop' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Hide a Character", id: "gui.howtos.story.step_hidewizard" }), image: 'storyHideCharacter' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Show a Character", id: "gui.howtos.story.step_showwizard" }), image: 'storyShowCharacter' }, { deckIds: ['say-it-out-loud', 'record-a-sound'] }], urlId: 'tell-a-story' }, 'Video-Sensing': { name: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Video Sensing", id: "gui.howtos.videosens.name" }), img: _thumbnails_video_sensing_jpg__WEBPACK_IMPORTED_MODULE_12___default.a, steps: [{ video: '3pd1z110d6' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Add Extension", id: "gui.howtos.videosens.step_addextension" }), image: 'videoAddExtension' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Pet the Cat", id: "gui.howtos.videosens.step_pet" }), image: 'videoPet' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Animate", id: "gui.howtos.videosens.step_animate" }), image: 'videoAnimate' }, { title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Pop a Balloon", id: "gui.howtos.videosens.step_pop" }), image: 'videoPop' }, { deckIds: ['Make-Music', 'add-effects'] }], urlId: 'video-sensing' }, 'add-sprite': { name: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Add a Sprite", id: "gui.howtos.add-sprite.name" }), img: _thumbnails_add_sprite_jpg__WEBPACK_IMPORTED_MODULE_5___default.a, tags: ['art', 'games', 'stories', 'character'], steps: [{ title: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Add a Sprite", id: "gui.howtos.add-sprite.step_addSprite" }), image: 'addSprite' }, { deckIds: ['add-a-backdrop', 'switch-costume'] }], urlId: 'add-a-sprite' }, 'add-a-backdrop': { name: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Add a Backdrop", id: "gui.howtos.add-a-backdrop.name" }), img: _thumbnails_add_backdrop_jpg__WEBPACK_IMPORTED_MODULE_18___default.a, tags: ['art', 'games', 'stories', 'background'], steps: [{ video: 'add-a-backdrop' }, { deckIds: ['change-size', 'switch-costume'] }], urlId: 'add-a-backdrop' }, 'change-size': { name: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Change Size", id: "gui.howtos.change-size.name" }), img: _thumbnails_change_size_jpg__WEBPACK_IMPORTED_MODULE_15___default.a, scale: ['art', 'animation', 'scale'], steps: [{ video: 'change-size' }, { deckIds: ['glide-around', 'spin-video'] }], urlId: 'change-size' }, 'glide-around': { name: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Glide Around", id: "gui.howtos.glide-around.name" }), img: _thumbnails_glide_around_jpg__WEBPACK_IMPORTED_MODULE_14___default.a, tags: ['animation', 'stories', 'music', 'instrument', 'play', 'song', 'band'], steps: [{ video: 'glide-around' }, { deckIds: ['add-a-backdrop', 'switch-costume'] }], urlId: 'glide-around' }, 'record-a-sound': { name: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Record a Sound", id: "gui.howtos.record-a-sound.name" }), tags: ['music', 'games', 'stories'], img: _thumbnails_record_a_sound_jpg__WEBPACK_IMPORTED_MODULE_13___default.a, steps: [{ video: 'record-a-sound' }, { deckIds: ['Make-Music', 'switch-costume'] }], urlId: 'record-a-sound' }, 'spin-video': { name: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Make It Spin", id: "gui.howtos.spin-video.name" }), img: _thumbnails_spin_jpg__WEBPACK_IMPORTED_MODULE_21___default.a, tags: ['animation', 'rotate', 'rotation'], steps: [{ video: 'spin-video' }, { deckIds: ['add-a-backdrop', 'switch-costume'] }], urlId: 'make-it-spin' }, 'hide-and-show': { name: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Hide and Show", id: "gui.howtos.hide-and-show.name" }), img: _thumbnails_hide_and_show_jpg__WEBPACK_IMPORTED_MODULE_17___default.a, tags: ['stories', 'appear', 'disappear'], steps: [{ video: 'hide-and-show' }, { deckIds: ['add-a-backdrop', 'switch-costume'] }], urlId: 'hide' }, 'switch-costume': { name: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Animate a Sprite", id: "gui.howtos.switch-costume.name" }), img: _thumbnails_animate_sprite_jpg__WEBPACK_IMPORTED_MODULE_16___default.a, tags: ['animation', 'art', 'games', 'stories', 'paint', 'edit', 'change', 'character', 'sprite'], steps: [{ video: 'switch-costume' }, { deckIds: ['add-a-backdrop', 'add-effects'] }], urlId: 'animate-a-sprite' }, 'move-around-with-arrow-keys': { name: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Use Arrow Keys", id: "gui.howtos.move-around-with-arrow-keys.name" }), img: _thumbnails_move_arrow_keys_jpg__WEBPACK_IMPORTED_MODULE_20___default.a, tags: ['games', 'keyboard'], steps: [{ video: 'move-around-with-arrow-keys' }, { deckIds: ['add-a-backdrop', 'switch-costume'] }], urlId: 'arrow-keys' }, 'add-effects': { name: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Add Effects", id: "gui.howtos.add-effects.name" }), tags: ['animation', 'art', 'games', 'stories', '8-bit', 'brightness', 'ghost', 'transparency', 'opacity', 'fx', 'color', 'fisheye', 'whirl', 'twist', 'pixelate', 'mosaic', '8bit'], img: _thumbnails_add_effects_jpg__WEBPACK_IMPORTED_MODULE_19___default.a, steps: [{ video: 'add-effects' }, { deckIds: ['add-a-backdrop', 'switch-costume'] }], urlId: 'add-effects' }, 'wedo2-getting-started': { steps: [{ video: '4im7iizv47' }], urlId: 'wedo', hidden: true }, 'ev3-getting-started': { steps: [{ video: 'qgu78c5y7d' }], urlId: 'ev3', hidden: true }, 'whats-new': { steps: [{ video: 'mtqymxg0qq' }], urlId: 'whatsnew', hidden: true } }); /***/ }), /***/ "./src/lib/libraries/decks/steps/add-sprite.en.gif": /*!*********************************************************!*\ !*** ./src/lib/libraries/decks/steps/add-sprite.en.gif ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/ba5625a05f8ae4818d871287530dcfa9.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/animate-char-add-sound.en.gif": /*!*********************************************************************!*\ !*** ./src/lib/libraries/decks/steps/animate-char-add-sound.en.gif ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/5bca6b3a9b72144dafb5cecab39092c0.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/animate-char-change-color.en.gif": /*!************************************************************************!*\ !*** ./src/lib/libraries/decks/steps/animate-char-change-color.en.gif ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/51d064ccbf7daeb159a16fb735dd0a69.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/animate-char-jump.en.gif": /*!****************************************************************!*\ !*** ./src/lib/libraries/decks/steps/animate-char-jump.en.gif ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/0408e986e15e0f56aefc6e9719fa42e3.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/animate-char-move.en.gif": /*!****************************************************************!*\ !*** ./src/lib/libraries/decks/steps/animate-char-move.en.gif ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/7176aa6fc1d9d4bc12dc35951a7fdfe0.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/animate-char-pick-backdrop.en.gif": /*!*************************************************************************!*\ !*** ./src/lib/libraries/decks/steps/animate-char-pick-backdrop.en.gif ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/11142fccab3fabab617ec3f32cc6d3cc.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/animate-char-pick-sprite.en.gif": /*!***********************************************************************!*\ !*** ./src/lib/libraries/decks/steps/animate-char-pick-sprite.en.gif ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/fbbef73344d80136b4ba150032c2fa60.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/animate-char-say-something.en.gif": /*!*************************************************************************!*\ !*** ./src/lib/libraries/decks/steps/animate-char-say-something.en.gif ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/aa249b12450d4c37c61f7123b03dab3a.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/animate-char-talk.en.gif": /*!****************************************************************!*\ !*** ./src/lib/libraries/decks/steps/animate-char-talk.en.gif ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/03ef1b0818e7a1222012b7f61079e2dc.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/chase-game-add-backdrop.en.gif": /*!**********************************************************************!*\ !*** ./src/lib/libraries/decks/steps/chase-game-add-backdrop.en.gif ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/1cb157de017b539c4f4e761d7847956e.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/chase-game-add-sprite1.en.gif": /*!*********************************************************************!*\ !*** ./src/lib/libraries/decks/steps/chase-game-add-sprite1.en.gif ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/1824f8a20462980dad8a315af06ac9e5.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/chase-game-add-sprite2.en.gif": /*!*********************************************************************!*\ !*** ./src/lib/libraries/decks/steps/chase-game-add-sprite2.en.gif ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/eaeb48bb0997c81359942ee431680a8d.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/chase-game-add-variable.en.gif": /*!**********************************************************************!*\ !*** ./src/lib/libraries/decks/steps/chase-game-add-variable.en.gif ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/fc4228c3fe329628c4ba78569e5620eb.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/chase-game-change-score.en.gif": /*!**********************************************************************!*\ !*** ./src/lib/libraries/decks/steps/chase-game-change-score.en.gif ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/25497089eb1925a13ab0ce12d6df6a72.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/chase-game-move-randomly.en.gif": /*!***********************************************************************!*\ !*** ./src/lib/libraries/decks/steps/chase-game-move-randomly.en.gif ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/a8f3ce9fb80d558020a867afe7a840cd.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/chase-game-play-sound.en.gif": /*!********************************************************************!*\ !*** ./src/lib/libraries/decks/steps/chase-game-play-sound.en.gif ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/cbce5aef3c3b611073790b49bc49bc26.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/chase-game-right-left.en.gif": /*!********************************************************************!*\ !*** ./src/lib/libraries/decks/steps/chase-game-right-left.en.gif ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/682da989d442750088077c7a699dec0a.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/chase-game-up-down.en.gif": /*!*****************************************************************!*\ !*** ./src/lib/libraries/decks/steps/chase-game-up-down.en.gif ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/9c029845bbb161b90781ac839ac533f6.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/cn-backdrop.en.gif": /*!**********************************************************!*\ !*** ./src/lib/libraries/decks/steps/cn-backdrop.en.gif ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/6b7cb6ae65beb0c64262c053f24a0bca.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/cn-collect.en.gif": /*!*********************************************************!*\ !*** ./src/lib/libraries/decks/steps/cn-collect.en.gif ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/17f08403f12daff6297d46f3cd203acc.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/cn-glide.en.gif": /*!*******************************************************!*\ !*** ./src/lib/libraries/decks/steps/cn-glide.en.gif ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/55b56d9f7b5eb7267f4ac19441146e85.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/cn-pick-sprite.en.gif": /*!*************************************************************!*\ !*** ./src/lib/libraries/decks/steps/cn-pick-sprite.en.gif ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/31fc60412c9b904fb1e9f1d4d932a4e2.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/cn-say.en.gif": /*!*****************************************************!*\ !*** ./src/lib/libraries/decks/steps/cn-say.en.gif ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/f197a5756552118c132f63fc9dce21d4.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/cn-score.en.gif": /*!*******************************************************!*\ !*** ./src/lib/libraries/decks/steps/cn-score.en.gif ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/9844f07238b57b2a35cf880055fcec35.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/cn-show-character.en.gif": /*!****************************************************************!*\ !*** ./src/lib/libraries/decks/steps/cn-show-character.en.gif ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/8e27ca9b97818a169be94795a48d8bad.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/cn-variable.en.gif": /*!**********************************************************!*\ !*** ./src/lib/libraries/decks/steps/cn-variable.en.gif ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/73b3649625bed526e496a41860dc8400.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/intro-move.en.gif": /*!*********************************************************!*\ !*** ./src/lib/libraries/decks/steps/intro-move.en.gif ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/45353905cf166ce2cb04d16a217a8d4e.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/intro-say-hello.en.gif": /*!**************************************************************!*\ !*** ./src/lib/libraries/decks/steps/intro-say-hello.en.gif ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/f3eebf3dbf52d3ba97c9176807aa32ad.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/music-make-beat.en.gif": /*!**************************************************************!*\ !*** ./src/lib/libraries/decks/steps/music-make-beat.en.gif ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/e113aa02e926ad23da7d46fead1231b9.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/music-make-beatbox.en.gif": /*!*****************************************************************!*\ !*** ./src/lib/libraries/decks/steps/music-make-beatbox.en.gif ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/c68c293bc65d68238f912074b1fd1386.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/music-make-song.en.gif": /*!**************************************************************!*\ !*** ./src/lib/libraries/decks/steps/music-make-song.en.gif ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/a45329a2542b590a54dba0ccd30fdf4e.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/music-pick-instrument.en.gif": /*!********************************************************************!*\ !*** ./src/lib/libraries/decks/steps/music-pick-instrument.en.gif ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/b96acdcc724f0651325c9c54b8daeb23.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/music-play-sound.en.gif": /*!***************************************************************!*\ !*** ./src/lib/libraries/decks/steps/music-play-sound.en.gif ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/c26c369a2ca3f3a09b60e5af6c30bd15.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/name-change-color.en.gif": /*!****************************************************************!*\ !*** ./src/lib/libraries/decks/steps/name-change-color.en.gif ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/59bec17a687a56c251f423378f05cb72.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/name-grow.en.gif": /*!********************************************************!*\ !*** ./src/lib/libraries/decks/steps/name-grow.en.gif ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/89b23cdaf4cd793344e503007bd3b405.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/name-pick-letter.en.gif": /*!***************************************************************!*\ !*** ./src/lib/libraries/decks/steps/name-pick-letter.en.gif ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/376daa5444cadd88038ef6ff16bfd653.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/name-pick-letter2.en.gif": /*!****************************************************************!*\ !*** ./src/lib/libraries/decks/steps/name-pick-letter2.en.gif ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/7ca82ca6ee18a4c008cae2b4fc8d5be2.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/name-play-sound.en.gif": /*!**************************************************************!*\ !*** ./src/lib/libraries/decks/steps/name-play-sound.en.gif ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/6de06131f1124722ba9dbd735ba1b62f.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/name-spin.en.gif": /*!********************************************************!*\ !*** ./src/lib/libraries/decks/steps/name-spin.en.gif ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/52d4a61d9fd788fe438f3037b9c49d3a.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/pop-game-add-score.en.gif": /*!*****************************************************************!*\ !*** ./src/lib/libraries/decks/steps/pop-game-add-score.en.gif ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/fc4228c3fe329628c4ba78569e5620eb.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/pop-game-change-color.en.gif": /*!********************************************************************!*\ !*** ./src/lib/libraries/decks/steps/pop-game-change-color.en.gif ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/eef0c5e9761d7850485979484434754c.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/pop-game-change-score.en.gif": /*!********************************************************************!*\ !*** ./src/lib/libraries/decks/steps/pop-game-change-score.en.gif ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/11fabbdd1bc0ff364d4c110e60db2287.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/pop-game-pick-sprite.en.gif": /*!*******************************************************************!*\ !*** ./src/lib/libraries/decks/steps/pop-game-pick-sprite.en.gif ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/4cfb617bd5ddb3963da6bdc2a814d06c.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/pop-game-play-sound.en.gif": /*!******************************************************************!*\ !*** ./src/lib/libraries/decks/steps/pop-game-play-sound.en.gif ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/2fe969399d52e076d779f489ca815728.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/pop-game-random-position.en.gif": /*!***********************************************************************!*\ !*** ./src/lib/libraries/decks/steps/pop-game-random-position.en.gif ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/e3cc49b6555f37b43d85e1beb5df7aa7.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/pop-game-reset-score.en.gif": /*!*******************************************************************!*\ !*** ./src/lib/libraries/decks/steps/pop-game-reset-score.en.gif ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/7838388419a0268456642d4a08fcf5b9.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/speech-add-backdrop.en.gif": /*!******************************************************************!*\ !*** ./src/lib/libraries/decks/steps/speech-add-backdrop.en.gif ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/8c5774830e83c866d2be15afe09f5590.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/speech-add-extension.en.gif": /*!*******************************************************************!*\ !*** ./src/lib/libraries/decks/steps/speech-add-extension.en.gif ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/ba6834dd9e9cf47dc96d1c27f7655d18.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/speech-add-sprite.en.gif": /*!****************************************************************!*\ !*** ./src/lib/libraries/decks/steps/speech-add-sprite.en.gif ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/aedf793e59c5c73331d9722cffd4cb92.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/speech-change-color.en.gif": /*!******************************************************************!*\ !*** ./src/lib/libraries/decks/steps/speech-change-color.en.gif ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/b86108e6db1c6c32ad39ba422a355ef3.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/speech-grow-shrink.en.gif": /*!*****************************************************************!*\ !*** ./src/lib/libraries/decks/steps/speech-grow-shrink.en.gif ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/7ea9fdc7b4f02bc900f206308c0efe81.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/speech-move-around.en.gif": /*!*****************************************************************!*\ !*** ./src/lib/libraries/decks/steps/speech-move-around.en.gif ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/ddc0f358d6689675472ef9aad95dc698.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/speech-say-something.en.gif": /*!*******************************************************************!*\ !*** ./src/lib/libraries/decks/steps/speech-say-something.en.gif ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/d505a716f1a00276ab72af1b4d0ec190.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/speech-set-voice.en.gif": /*!***************************************************************!*\ !*** ./src/lib/libraries/decks/steps/speech-set-voice.en.gif ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/8b19555004f40ebd9677c44da642a4ad.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/speech-song.en.gif": /*!**********************************************************!*\ !*** ./src/lib/libraries/decks/steps/speech-song.en.gif ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/4c5b75c306a0bd0facfe31074e251c00.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/speech-spin.en.gif": /*!**********************************************************!*\ !*** ./src/lib/libraries/decks/steps/speech-spin.en.gif ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/1b03c7316fd577db0df2948594c0de38.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/story-conversation.en.gif": /*!*****************************************************************!*\ !*** ./src/lib/libraries/decks/steps/story-conversation.en.gif ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/8e637b4e1bc1aeca8229b3cfa622df3c.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/story-flip.en.gif": /*!*********************************************************!*\ !*** ./src/lib/libraries/decks/steps/story-flip.en.gif ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/d11f933570ff0cb8c71e25aed760f609.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/story-hide-character.en.gif": /*!*******************************************************************!*\ !*** ./src/lib/libraries/decks/steps/story-hide-character.en.gif ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/4ea7c61d2cbfd28b75d7e188f1815d80.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/story-pick-backdrop.en.gif": /*!******************************************************************!*\ !*** ./src/lib/libraries/decks/steps/story-pick-backdrop.en.gif ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/4a3e1c364658c715fe01969e00551112.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/story-pick-backdrop2.en.gif": /*!*******************************************************************!*\ !*** ./src/lib/libraries/decks/steps/story-pick-backdrop2.en.gif ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/0960bb1c4cf12a924f2bc74325583fea.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/story-pick-sprite.en.gif": /*!****************************************************************!*\ !*** ./src/lib/libraries/decks/steps/story-pick-sprite.en.gif ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/91c5fa4689392dff5c308d48d674f5fa.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/story-pick-sprite2.en.gif": /*!*****************************************************************!*\ !*** ./src/lib/libraries/decks/steps/story-pick-sprite2.en.gif ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/0f98e06e39d9ea466d7dbeecee38677f.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/story-say-something.en.gif": /*!******************************************************************!*\ !*** ./src/lib/libraries/decks/steps/story-say-something.en.gif ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/cdf71f36614586632e5d600e2a15405d.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/story-show-character.en.gif": /*!*******************************************************************!*\ !*** ./src/lib/libraries/decks/steps/story-show-character.en.gif ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/d92faa93ec9d77baa6d7dc2ca6652996.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/story-switch-backdrop.en.gif": /*!********************************************************************!*\ !*** ./src/lib/libraries/decks/steps/story-switch-backdrop.en.gif ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/74af5393beb64d092e7ecc033d89ce4d.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/video-add-extension.en.gif": /*!******************************************************************!*\ !*** ./src/lib/libraries/decks/steps/video-add-extension.en.gif ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/4823748f50030407329768f2674e49a9.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/video-animate.en.gif": /*!************************************************************!*\ !*** ./src/lib/libraries/decks/steps/video-animate.en.gif ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/2fb4b430169c3f5148703e29bfde1ef4.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/video-pet.en.gif": /*!********************************************************!*\ !*** ./src/lib/libraries/decks/steps/video-pet.en.gif ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/619f7584233d9a517d7f73a4df7af66c.gif"; /***/ }), /***/ "./src/lib/libraries/decks/steps/video-pop.en.gif": /*!********************************************************!*\ !*** ./src/lib/libraries/decks/steps/video-pop.en.gif ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/563e9cf9e28b483c7c515fb438412311.gif"; /***/ }), /***/ "./src/lib/libraries/decks/thumbnails/add-backdrop.jpg": /*!*************************************************************!*\ !*** ./src/lib/libraries/decks/thumbnails/add-backdrop.jpg ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/c19282f27937a0db7e8146672018fa8b.jpg"; /***/ }), /***/ "./src/lib/libraries/decks/thumbnails/add-effects.jpg": /*!************************************************************!*\ !*** ./src/lib/libraries/decks/thumbnails/add-effects.jpg ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/0611d215fe34175ddbab01f4f48f3517.jpg"; /***/ }), /***/ "./src/lib/libraries/decks/thumbnails/add-sprite.jpg": /*!***********************************************************!*\ !*** ./src/lib/libraries/decks/thumbnails/add-sprite.jpg ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/24a18c39cf49ac3797806a525e07cd7b.jpg"; /***/ }), /***/ "./src/lib/libraries/decks/thumbnails/animate-a-character.jpg": /*!********************************************************************!*\ !*** ./src/lib/libraries/decks/thumbnails/animate-a-character.jpg ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/8c3127887a7aacaea989aa247e510f84.jpg"; /***/ }), /***/ "./src/lib/libraries/decks/thumbnails/animate-a-name.jpg": /*!***************************************************************!*\ !*** ./src/lib/libraries/decks/thumbnails/animate-a-name.jpg ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/d9e0fd6da7031be3ed69ef361ad28792.jpg"; /***/ }), /***/ "./src/lib/libraries/decks/thumbnails/animate-sprite.jpg": /*!***************************************************************!*\ !*** ./src/lib/libraries/decks/thumbnails/animate-sprite.jpg ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/d1680a847046403c792a689d2572ff80.jpg"; /***/ }), /***/ "./src/lib/libraries/decks/thumbnails/cartoon-network.jpg": /*!****************************************************************!*\ !*** ./src/lib/libraries/decks/thumbnails/cartoon-network.jpg ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/9fd052aaf1b4701ff0134d124d6327a3.jpg"; /***/ }), /***/ "./src/lib/libraries/decks/thumbnails/change-size.jpg": /*!************************************************************!*\ !*** ./src/lib/libraries/decks/thumbnails/change-size.jpg ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/3f5201aea12f282cdb6edd2575fef169.jpg"; /***/ }), /***/ "./src/lib/libraries/decks/thumbnails/chase-game.jpg": /*!***********************************************************!*\ !*** ./src/lib/libraries/decks/thumbnails/chase-game.jpg ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/31bc4953d6286b30920ef5a53878e875.jpg"; /***/ }), /***/ "./src/lib/libraries/decks/thumbnails/getting-started.jpg": /*!****************************************************************!*\ !*** ./src/lib/libraries/decks/thumbnails/getting-started.jpg ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/5c74b2c74fb87685d69914f6af840bc2.jpg"; /***/ }), /***/ "./src/lib/libraries/decks/thumbnails/glide-around.jpg": /*!*************************************************************!*\ !*** ./src/lib/libraries/decks/thumbnails/glide-around.jpg ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/223e926c7036a87ef1b5f5d6e07ac7eb.jpg"; /***/ }), /***/ "./src/lib/libraries/decks/thumbnails/hide-and-show.jpg": /*!**************************************************************!*\ !*** ./src/lib/libraries/decks/thumbnails/hide-and-show.jpg ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/c4ceba83cf15016aa9c2cf6c3b9c764b.jpg"; /***/ }), /***/ "./src/lib/libraries/decks/thumbnails/make-music.jpg": /*!***********************************************************!*\ !*** ./src/lib/libraries/decks/thumbnails/make-music.jpg ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/410ccbdf0bbd12597c7152f64d44afca.jpg"; /***/ }), /***/ "./src/lib/libraries/decks/thumbnails/move-arrow-keys.jpg": /*!****************************************************************!*\ !*** ./src/lib/libraries/decks/thumbnails/move-arrow-keys.jpg ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/ae4fdf588b063e05cd99593e785dd60d.jpg"; /***/ }), /***/ "./src/lib/libraries/decks/thumbnails/pop-game.jpg": /*!*********************************************************!*\ !*** ./src/lib/libraries/decks/thumbnails/pop-game.jpg ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/e0e5baf4d9616b66aaa2e560cf4cfb51.jpg"; /***/ }), /***/ "./src/lib/libraries/decks/thumbnails/record-a-sound.jpg": /*!***************************************************************!*\ !*** ./src/lib/libraries/decks/thumbnails/record-a-sound.jpg ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/41f52071ce371c8a792b03b0c1c4c4b0.jpg"; /***/ }), /***/ "./src/lib/libraries/decks/thumbnails/spin.jpg": /*!*****************************************************!*\ !*** ./src/lib/libraries/decks/thumbnails/spin.jpg ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/ababebe088315c098726bb98f6dacd65.jpg"; /***/ }), /***/ "./src/lib/libraries/decks/thumbnails/tell-a-story.jpg": /*!*************************************************************!*\ !*** ./src/lib/libraries/decks/thumbnails/tell-a-story.jpg ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/66644f76b3f90ffeeb9bec0ffd4bccdb.jpg"; /***/ }), /***/ "./src/lib/libraries/decks/thumbnails/text-to-speech.jpg": /*!***************************************************************!*\ !*** ./src/lib/libraries/decks/thumbnails/text-to-speech.jpg ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/d7eb1e753d603d291d24509c5389d92b.jpg"; /***/ }), /***/ "./src/lib/libraries/decks/thumbnails/video-sensing.jpg": /*!**************************************************************!*\ !*** ./src/lib/libraries/decks/thumbnails/video-sensing.jpg ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/e8db9671e95c4c4530eea1528936b9e7.jpg"; /***/ }), /***/ "./src/lib/libraries/decks/translate-image.js": /*!****************************************************!*\ !*** ./src/lib/libraries/decks/translate-image.js ***! \****************************************************/ /*! exports provided: loadImageData, translateImage */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "loadImageData", function() { return loadImageData; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "translateImage", function() { return translateImage; }); /* harmony import */ var _en_steps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./en-steps.js */ "./src/lib/libraries/decks/en-steps.js"); /** * @fileoverview * Utility functions for handling tutorial images in multiple languages */ var savedImages = {}; var savedLocale = ''; var loadSpanish = function loadSpanish() { return __webpack_require__.e(/*! import() | es-steps */ "es-steps").then(__webpack_require__.bind(null, /*! ./es-steps.js */ "./src/lib/libraries/decks/es-steps.js")).then(function (_ref) { var imageData = _ref.esImages; return imageData; }); }; var translations = { es: function es() { return loadSpanish(); } }; var loadImageData = function loadImageData(locale) { if (translations.hasOwnProperty(locale)) { translations[locale]().then(function (newImages) { savedImages = newImages; savedLocale = locale; }); } }; /** * Return image data for tutorials based on locale (default: en) * @param {string} imageId key in the images object, or id string. * @param {string} locale requested locale * @return {string} image */ var translateImage = function translateImage(imageId, locale) { if (locale !== savedLocale || !savedImages.hasOwnProperty(imageId)) { return _en_steps_js__WEBPACK_IMPORTED_MODULE_0__["enImages"][imageId]; } return savedImages[imageId]; }; /***/ }), /***/ "./src/lib/libraries/decks/translate-video.js": /*!****************************************************!*\ !*** ./src/lib/libraries/decks/translate-video.js ***! \****************************************************/ /*! exports provided: translateVideo */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "translateVideo", function() { return translateVideo; }); /** * @fileoverview * Utility function to look up whether a translated video exists for a locale. */ // TODO: ja-Hira are copies of ja, replace with real ja-Hira when available. var videos = { 'intro-move-sayhello': { 'en': 'rpjvs3v9gj', 'ja': 'v2c2f3y2sc', 'ja-Hira': 'v2c2f3y2sc' }, 'animate-a-name': { 'en': 'pyur30ho05', 'ja': 'xrmgno02th', 'ja-Hira': 'xrmgno02th' }, 'Make-Music': { 'en': 'ir0j8ljsgm', 'ja': 'iybhyobckr', 'ja-Hira': 'iybhyobckr' }, 'Make-A-Game': { 'en': '5rp47ys13g', 'ja': 'h4q2ea3ojw', 'ja-Hira': 'h4q2ea3ojw' }, 'Chase-Game': { 'en': 'kusyx9thl5', 'ja': 'wr6ysk8s6d', 'ja-Hira': 'wr6ysk8s6d' }, 'add-a-backdrop': { 'en': 'nict6zdzlx', 'ja': 'j382ohngg7', 'ja-Hira': 'j382ohngg7' }, 'change-size': { 'en': 'p8va85hh61', 'ja': 'uzkfi9uai0', 'ja-Hira': 'uzkfi9uai0' }, 'glide-around': { 'en': 'sh9j978rg8', 'ja': 'jsat4vhu48', 'ja-Hira': 'jsat4vhu48' }, 'record-a-sound': { 'en': 'ulzl1fbzny', 'ja': '5zmy6u614k', 'ja-Hira': '5zmy6u614k' }, 'spin-video': { 'en': '07fed5hhpv', 'ja': 'hjhc0a8r7j', 'ja-Hira': 'hjhc0a8r7j' }, 'hide-and-show': { 'en': 'g479ahobo9', 'ja': 'ruynguvag5', 'ja-Hira': 'ruynguvag5' }, 'switch-costume': { 'en': '1ocp6a1ejn', 'ja': 'g3vluv0ms8', 'ja-Hira': 'g3vluv0ms8' }, 'move-around-with-arrow-keys': { 'en': 'yetrmk4iuu', 'ja': 'fk34dcg5oz', 'ja-Hira': 'fk34dcg5oz' }, 'add-effects': { 'en': '3jvl8zgjo2', 'ja': 'q7zq9vu0wb', 'ja-Hira': 'q7zq9vu0wb' } }; /** * Return a video identifier (on our video hosting service) * @param {string} videoId key in the videos object, or id string. * @param {string} locale locale to look up. If locale is not defined return the id for 'en' by default * @return {string} identifier for the video on our video hosting service. */ var translateVideo = function translateVideo(videoId, locale) { // if the videoId is not recognized in the videos object, assume it's already a video id on wistia if (!videos.hasOwnProperty(videoId)) return videoId; if (videos[videoId].hasOwnProperty(locale)) { return videos[videoId][locale]; } return videos[videoId].en; }; /***/ }), /***/ "./src/lib/libraries/extensions/boost/boost-button-illustration.svg": /*!**************************************************************************!*\ !*** ./src/lib/libraries/extensions/boost/boost-button-illustration.svg ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/d92e74438d72c2223692825df66e026e.svg"; /***/ }), /***/ "./src/lib/libraries/extensions/boost/boost-illustration.svg": /*!*******************************************************************!*\ !*** ./src/lib/libraries/extensions/boost/boost-illustration.svg ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/73773f78bf2bfc449218fbaee1922964.svg"; /***/ }), /***/ "./src/lib/libraries/extensions/boost/boost-small.svg": /*!************************************************************!*\ !*** ./src/lib/libraries/extensions/boost/boost-small.svg ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/3d9e2585d6ed12b9fb994438e0c4c42a.svg"; /***/ }), /***/ "./src/lib/libraries/extensions/boost/boost.png": /*!******************************************************!*\ !*** ./src/lib/libraries/extensions/boost/boost.png ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/bf3ee9d7d91a231cde773f88f6799425.png"; /***/ }), /***/ "./src/lib/libraries/extensions/ev3/ev3-hub-illustration.svg": /*!*******************************************************************!*\ !*** ./src/lib/libraries/extensions/ev3/ev3-hub-illustration.svg ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/8e5e28b23ba596614a60d319d9c64165.svg"; /***/ }), /***/ "./src/lib/libraries/extensions/ev3/ev3-small.svg": /*!********************************************************!*\ !*** ./src/lib/libraries/extensions/ev3/ev3-small.svg ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/3286e2838658ebdb82f62d062b14e951.svg"; /***/ }), /***/ "./src/lib/libraries/extensions/ev3/ev3.png": /*!**************************************************!*\ !*** ./src/lib/libraries/extensions/ev3/ev3.png ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/6608d56b3dce2738b2b137569d305d3b.png"; /***/ }), /***/ "./src/lib/libraries/extensions/gdxfor/gdxfor-illustration.svg": /*!*********************************************************************!*\ !*** ./src/lib/libraries/extensions/gdxfor/gdxfor-illustration.svg ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/60fc7acc624571cfa9d250d7d5cff041.svg"; /***/ }), /***/ "./src/lib/libraries/extensions/gdxfor/gdxfor-small.svg": /*!**************************************************************!*\ !*** ./src/lib/libraries/extensions/gdxfor/gdxfor-small.svg ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/7b6399d516d5921bb199f57cdd8bbbbe.svg"; /***/ }), /***/ "./src/lib/libraries/extensions/gdxfor/gdxfor.png": /*!********************************************************!*\ !*** ./src/lib/libraries/extensions/gdxfor/gdxfor.png ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/5a70df361bb00fa62b9338d89c92f377.png"; /***/ }), /***/ "./src/lib/libraries/extensions/index.jsx": /*!************************************************!*\ !*** ./src/lib/libraries/extensions/index.jsx ***! \************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var _music_music_png__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./music/music.png */ "./src/lib/libraries/extensions/music/music.png"); /* harmony import */ var _music_music_png__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_music_music_png__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _music_music_small_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./music/music-small.svg */ "./src/lib/libraries/extensions/music/music-small.svg"); /* harmony import */ var _music_music_small_svg__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_music_music_small_svg__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _pen_pen_png__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./pen/pen.png */ "./src/lib/libraries/extensions/pen/pen.png"); /* harmony import */ var _pen_pen_png__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_pen_pen_png__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _pen_pen_small_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./pen/pen-small.svg */ "./src/lib/libraries/extensions/pen/pen-small.svg"); /* harmony import */ var _pen_pen_small_svg__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_pen_pen_small_svg__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _videoSensing_video_sensing_png__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./videoSensing/video-sensing.png */ "./src/lib/libraries/extensions/videoSensing/video-sensing.png"); /* harmony import */ var _videoSensing_video_sensing_png__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_videoSensing_video_sensing_png__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _videoSensing_video_sensing_small_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./videoSensing/video-sensing-small.svg */ "./src/lib/libraries/extensions/videoSensing/video-sensing-small.svg"); /* harmony import */ var _videoSensing_video_sensing_small_svg__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_videoSensing_video_sensing_small_svg__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _text2speech_text2speech_png__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./text2speech/text2speech.png */ "./src/lib/libraries/extensions/text2speech/text2speech.png"); /* harmony import */ var _text2speech_text2speech_png__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_text2speech_text2speech_png__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _text2speech_text2speech_small_svg__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./text2speech/text2speech-small.svg */ "./src/lib/libraries/extensions/text2speech/text2speech-small.svg"); /* harmony import */ var _text2speech_text2speech_small_svg__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_text2speech_text2speech_small_svg__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _translate_translate_png__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./translate/translate.png */ "./src/lib/libraries/extensions/translate/translate.png"); /* harmony import */ var _translate_translate_png__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_translate_translate_png__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _translate_translate_small_png__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./translate/translate-small.png */ "./src/lib/libraries/extensions/translate/translate-small.png"); /* harmony import */ var _translate_translate_small_png__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_translate_translate_small_png__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _makeymakey_makeymakey_png__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./makeymakey/makeymakey.png */ "./src/lib/libraries/extensions/makeymakey/makeymakey.png"); /* harmony import */ var _makeymakey_makeymakey_png__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_makeymakey_makeymakey_png__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var _makeymakey_makeymakey_small_svg__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./makeymakey/makeymakey-small.svg */ "./src/lib/libraries/extensions/makeymakey/makeymakey-small.svg"); /* harmony import */ var _makeymakey_makeymakey_small_svg__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_makeymakey_makeymakey_small_svg__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var _microbit_microbit_png__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./microbit/microbit.png */ "./src/lib/libraries/extensions/microbit/microbit.png"); /* harmony import */ var _microbit_microbit_png__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_microbit_microbit_png__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var _microbit_microbit_small_svg__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./microbit/microbit-small.svg */ "./src/lib/libraries/extensions/microbit/microbit-small.svg"); /* harmony import */ var _microbit_microbit_small_svg__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_microbit_microbit_small_svg__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var _microbit_microbit_illustration_svg__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./microbit/microbit-illustration.svg */ "./src/lib/libraries/extensions/microbit/microbit-illustration.svg"); /* harmony import */ var _microbit_microbit_illustration_svg__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(_microbit_microbit_illustration_svg__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var _ev3_ev3_png__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./ev3/ev3.png */ "./src/lib/libraries/extensions/ev3/ev3.png"); /* harmony import */ var _ev3_ev3_png__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(_ev3_ev3_png__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var _ev3_ev3_small_svg__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./ev3/ev3-small.svg */ "./src/lib/libraries/extensions/ev3/ev3-small.svg"); /* harmony import */ var _ev3_ev3_small_svg__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(_ev3_ev3_small_svg__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var _ev3_ev3_hub_illustration_svg__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./ev3/ev3-hub-illustration.svg */ "./src/lib/libraries/extensions/ev3/ev3-hub-illustration.svg"); /* harmony import */ var _ev3_ev3_hub_illustration_svg__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(_ev3_ev3_hub_illustration_svg__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var _wedo2_wedo_png__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./wedo2/wedo.png */ "./src/lib/libraries/extensions/wedo2/wedo.png"); /* harmony import */ var _wedo2_wedo_png__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(_wedo2_wedo_png__WEBPACK_IMPORTED_MODULE_20__); /* harmony import */ var _wedo2_wedo_small_svg__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./wedo2/wedo-small.svg */ "./src/lib/libraries/extensions/wedo2/wedo-small.svg"); /* harmony import */ var _wedo2_wedo_small_svg__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(_wedo2_wedo_small_svg__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var _wedo2_wedo_illustration_svg__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./wedo2/wedo-illustration.svg */ "./src/lib/libraries/extensions/wedo2/wedo-illustration.svg"); /* harmony import */ var _wedo2_wedo_illustration_svg__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(_wedo2_wedo_illustration_svg__WEBPACK_IMPORTED_MODULE_22__); /* harmony import */ var _wedo2_wedo_button_illustration_svg__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./wedo2/wedo-button-illustration.svg */ "./src/lib/libraries/extensions/wedo2/wedo-button-illustration.svg"); /* harmony import */ var _wedo2_wedo_button_illustration_svg__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(_wedo2_wedo_button_illustration_svg__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var _boost_boost_png__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./boost/boost.png */ "./src/lib/libraries/extensions/boost/boost.png"); /* harmony import */ var _boost_boost_png__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(_boost_boost_png__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var _boost_boost_small_svg__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./boost/boost-small.svg */ "./src/lib/libraries/extensions/boost/boost-small.svg"); /* harmony import */ var _boost_boost_small_svg__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(_boost_boost_small_svg__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var _boost_boost_illustration_svg__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./boost/boost-illustration.svg */ "./src/lib/libraries/extensions/boost/boost-illustration.svg"); /* harmony import */ var _boost_boost_illustration_svg__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(_boost_boost_illustration_svg__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var _boost_boost_button_illustration_svg__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./boost/boost-button-illustration.svg */ "./src/lib/libraries/extensions/boost/boost-button-illustration.svg"); /* harmony import */ var _boost_boost_button_illustration_svg__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(_boost_boost_button_illustration_svg__WEBPACK_IMPORTED_MODULE_27__); /* harmony import */ var _gdxfor_gdxfor_png__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./gdxfor/gdxfor.png */ "./src/lib/libraries/extensions/gdxfor/gdxfor.png"); /* harmony import */ var _gdxfor_gdxfor_png__WEBPACK_IMPORTED_MODULE_28___default = /*#__PURE__*/__webpack_require__.n(_gdxfor_gdxfor_png__WEBPACK_IMPORTED_MODULE_28__); /* harmony import */ var _gdxfor_gdxfor_small_svg__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./gdxfor/gdxfor-small.svg */ "./src/lib/libraries/extensions/gdxfor/gdxfor-small.svg"); /* harmony import */ var _gdxfor_gdxfor_small_svg__WEBPACK_IMPORTED_MODULE_29___default = /*#__PURE__*/__webpack_require__.n(_gdxfor_gdxfor_small_svg__WEBPACK_IMPORTED_MODULE_29__); /* harmony import */ var _gdxfor_gdxfor_illustration_svg__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./gdxfor/gdxfor-illustration.svg */ "./src/lib/libraries/extensions/gdxfor/gdxfor-illustration.svg"); /* harmony import */ var _gdxfor_gdxfor_illustration_svg__WEBPACK_IMPORTED_MODULE_30___default = /*#__PURE__*/__webpack_require__.n(_gdxfor_gdxfor_illustration_svg__WEBPACK_IMPORTED_MODULE_30__); // TODO: Rename file names to match variable/prop names? /* harmony default export */ __webpack_exports__["default"] = ([{ name: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Music", id: "gui.extension.music.name" }), extensionId: 'music', iconURL: _music_music_png__WEBPACK_IMPORTED_MODULE_2___default.a, insetIconURL: _music_music_small_svg__WEBPACK_IMPORTED_MODULE_3___default.a, description: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Play instruments and drums.", id: "gui.extension.music.description" }), featured: true }, { name: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Pen", id: "gui.extension.pen.name" }), extensionId: 'pen', iconURL: _pen_pen_png__WEBPACK_IMPORTED_MODULE_4___default.a, insetIconURL: _pen_pen_small_svg__WEBPACK_IMPORTED_MODULE_5___default.a, description: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Draw with your sprites.", id: "gui.extension.pen.description" }), featured: true }, { name: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Video Sensing", id: "gui.extension.videosensing.name" }), extensionId: 'videoSensing', iconURL: _videoSensing_video_sensing_png__WEBPACK_IMPORTED_MODULE_6___default.a, insetIconURL: _videoSensing_video_sensing_small_svg__WEBPACK_IMPORTED_MODULE_7___default.a, description: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Sense motion with the camera.", id: "gui.extension.videosensing.description" }), featured: true }, { name: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Text to Speech", id: "gui.extension.text2speech.name" }), extensionId: 'text2speech', collaborator: 'Amazon Web Services', iconURL: _text2speech_text2speech_png__WEBPACK_IMPORTED_MODULE_8___default.a, insetIconURL: _text2speech_text2speech_small_svg__WEBPACK_IMPORTED_MODULE_9___default.a, description: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Make your projects talk.", id: "gui.extension.text2speech.description" }), featured: true, internetConnectionRequired: true }, { name: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Translate", id: "gui.extension.translate.name" }), extensionId: 'translate', collaborator: 'Google', iconURL: _translate_translate_png__WEBPACK_IMPORTED_MODULE_10___default.a, insetIconURL: _translate_translate_small_png__WEBPACK_IMPORTED_MODULE_11___default.a, description: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Translate text into many languages.", id: "gui.extension.translate.description" }), featured: true, internetConnectionRequired: true }, { name: 'Makey Makey', extensionId: 'makeymakey', collaborator: 'JoyLabz', iconURL: _makeymakey_makeymakey_png__WEBPACK_IMPORTED_MODULE_12___default.a, insetIconURL: _makeymakey_makeymakey_small_svg__WEBPACK_IMPORTED_MODULE_13___default.a, description: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Make anything into a key.", id: "gui.extension.makeymakey.description" }), featured: true }, { name: 'micro:bit', extensionId: 'microbit', collaborator: 'micro:bit', iconURL: _microbit_microbit_png__WEBPACK_IMPORTED_MODULE_14___default.a, insetIconURL: _microbit_microbit_small_svg__WEBPACK_IMPORTED_MODULE_15___default.a, description: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Connect your projects with the world.", id: "gui.extension.microbit.description" }), featured: true, disabled: false, bluetoothRequired: true, internetConnectionRequired: true, launchPeripheralConnectionFlow: true, useAutoScan: false, connectionIconURL: _microbit_microbit_illustration_svg__WEBPACK_IMPORTED_MODULE_16___default.a, connectionSmallIconURL: _microbit_microbit_small_svg__WEBPACK_IMPORTED_MODULE_15___default.a, connectingMessage: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Connecting", id: "gui.extension.microbit.connectingMessage" }), helpLink: 'https://scratch.mit.edu/microbit' }, { name: 'LEGO MINDSTORMS EV3', extensionId: 'ev3', collaborator: 'LEGO', iconURL: _ev3_ev3_png__WEBPACK_IMPORTED_MODULE_17___default.a, insetIconURL: _ev3_ev3_small_svg__WEBPACK_IMPORTED_MODULE_18___default.a, description: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Build interactive robots and more.", id: "gui.extension.ev3.description" }), featured: true, disabled: false, bluetoothRequired: true, internetConnectionRequired: true, launchPeripheralConnectionFlow: true, useAutoScan: false, connectionIconURL: _ev3_ev3_hub_illustration_svg__WEBPACK_IMPORTED_MODULE_19___default.a, connectionSmallIconURL: _ev3_ev3_small_svg__WEBPACK_IMPORTED_MODULE_18___default.a, connectingMessage: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Connecting. Make sure the pin on your EV3 is set to 1234.", id: "gui.extension.ev3.connectingMessage" }), helpLink: 'https://scratch.mit.edu/ev3' }, { name: 'LEGO BOOST', extensionId: 'boost', collaborator: 'LEGO', iconURL: _boost_boost_png__WEBPACK_IMPORTED_MODULE_24___default.a, insetIconURL: _boost_boost_small_svg__WEBPACK_IMPORTED_MODULE_25___default.a, description: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Bring robotic creations to life.", id: "gui.extension.boost.description" }), featured: true, disabled: false, bluetoothRequired: true, internetConnectionRequired: true, launchPeripheralConnectionFlow: true, useAutoScan: true, connectionIconURL: _boost_boost_illustration_svg__WEBPACK_IMPORTED_MODULE_26___default.a, connectionSmallIconURL: _boost_boost_small_svg__WEBPACK_IMPORTED_MODULE_25___default.a, connectionTipIconURL: _boost_boost_button_illustration_svg__WEBPACK_IMPORTED_MODULE_27___default.a, connectingMessage: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Connecting", id: "gui.extension.boost.connectingMessage" }), helpLink: 'https://scratch.mit.edu/boost' }, { name: 'LEGO Education WeDo 2.0', extensionId: 'wedo2', collaborator: 'LEGO', iconURL: _wedo2_wedo_png__WEBPACK_IMPORTED_MODULE_20___default.a, insetIconURL: _wedo2_wedo_small_svg__WEBPACK_IMPORTED_MODULE_21___default.a, description: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Build with motors and sensors.", id: "gui.extension.wedo2.description" }), featured: true, disabled: false, bluetoothRequired: true, internetConnectionRequired: true, launchPeripheralConnectionFlow: true, useAutoScan: true, connectionIconURL: _wedo2_wedo_illustration_svg__WEBPACK_IMPORTED_MODULE_22___default.a, connectionSmallIconURL: _wedo2_wedo_small_svg__WEBPACK_IMPORTED_MODULE_21___default.a, connectionTipIconURL: _wedo2_wedo_button_illustration_svg__WEBPACK_IMPORTED_MODULE_23___default.a, connectingMessage: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Connecting", id: "gui.extension.wedo2.connectingMessage" }), helpLink: 'https://scratch.mit.edu/wedo' }, { name: 'Go Direct Force & Acceleration', extensionId: 'gdxfor', collaborator: 'Vernier', iconURL: _gdxfor_gdxfor_png__WEBPACK_IMPORTED_MODULE_28___default.a, insetIconURL: _gdxfor_gdxfor_small_svg__WEBPACK_IMPORTED_MODULE_29___default.a, description: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Sense push, pull, motion, and spin.", id: "gui.extension.gdxfor.description" }), featured: true, disabled: false, bluetoothRequired: true, internetConnectionRequired: true, launchPeripheralConnectionFlow: true, useAutoScan: false, connectionIconURL: _gdxfor_gdxfor_illustration_svg__WEBPACK_IMPORTED_MODULE_30___default.a, connectionSmallIconURL: _gdxfor_gdxfor_small_svg__WEBPACK_IMPORTED_MODULE_29___default.a, connectingMessage: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__["FormattedMessage"], { defaultMessage: "Connecting", id: "gui.extension.gdxfor.connectingMessage" }), helpLink: 'https://scratch.mit.edu/vernier' }]); /***/ }), /***/ "./src/lib/libraries/extensions/makeymakey/makeymakey-small.svg": /*!**********************************************************************!*\ !*** ./src/lib/libraries/extensions/makeymakey/makeymakey-small.svg ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/d61429ad96a25ec2917ebc77d900aae0.svg"; /***/ }), /***/ "./src/lib/libraries/extensions/makeymakey/makeymakey.png": /*!****************************************************************!*\ !*** ./src/lib/libraries/extensions/makeymakey/makeymakey.png ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/c30d6a0e73cf38ad6ea7f5e4fe0428a3.png"; /***/ }), /***/ "./src/lib/libraries/extensions/microbit/microbit-illustration.svg": /*!*************************************************************************!*\ !*** ./src/lib/libraries/extensions/microbit/microbit-illustration.svg ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/84a9455c54ab68ad8dcf8b6f6465ae71.svg"; /***/ }), /***/ "./src/lib/libraries/extensions/microbit/microbit-small.svg": /*!******************************************************************!*\ !*** ./src/lib/libraries/extensions/microbit/microbit-small.svg ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/6be143c7cb9d23c787f7f20674a76f72.svg"; /***/ }), /***/ "./src/lib/libraries/extensions/microbit/microbit.png": /*!************************************************************!*\ !*** ./src/lib/libraries/extensions/microbit/microbit.png ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/4b6ca5259f1271d510f081867e746847.png"; /***/ }), /***/ "./src/lib/libraries/extensions/music/music-small.svg": /*!************************************************************!*\ !*** ./src/lib/libraries/extensions/music/music-small.svg ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/504d73be1b361b4b9ca7f655ce085dc6.svg"; /***/ }), /***/ "./src/lib/libraries/extensions/music/music.png": /*!******************************************************!*\ !*** ./src/lib/libraries/extensions/music/music.png ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/7eea42371f5ccb84b4fc7d0ba7331ea3.png"; /***/ }), /***/ "./src/lib/libraries/extensions/pen/pen-small.svg": /*!********************************************************!*\ !*** ./src/lib/libraries/extensions/pen/pen-small.svg ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/800f6f1573677d59954e8d3164602287.svg"; /***/ }), /***/ "./src/lib/libraries/extensions/pen/pen.png": /*!**************************************************!*\ !*** ./src/lib/libraries/extensions/pen/pen.png ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/7679e8aa3b5a6b745823e00a7b950065.png"; /***/ }), /***/ "./src/lib/libraries/extensions/text2speech/text2speech-small.svg": /*!************************************************************************!*\ !*** ./src/lib/libraries/extensions/text2speech/text2speech-small.svg ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/c7ffd288176b935f835311512a224d4b.svg"; /***/ }), /***/ "./src/lib/libraries/extensions/text2speech/text2speech.png": /*!******************************************************************!*\ !*** ./src/lib/libraries/extensions/text2speech/text2speech.png ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/d6f130fb79e78e4dd351fd930e742bcc.png"; /***/ }), /***/ "./src/lib/libraries/extensions/translate/translate-small.png": /*!********************************************************************!*\ !*** ./src/lib/libraries/extensions/translate/translate-small.png ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/f40501ed87782097b1a4eec8747eb84a.png"; /***/ }), /***/ "./src/lib/libraries/extensions/translate/translate.png": /*!**************************************************************!*\ !*** ./src/lib/libraries/extensions/translate/translate.png ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/b6162ffbfe48d4b6c67f0b469f1615ae.png"; /***/ }), /***/ "./src/lib/libraries/extensions/videoSensing/video-sensing-small.svg": /*!***************************************************************************!*\ !*** ./src/lib/libraries/extensions/videoSensing/video-sensing-small.svg ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/5e8eccd5a576638f029a1ed2deb4784b.svg"; /***/ }), /***/ "./src/lib/libraries/extensions/videoSensing/video-sensing.png": /*!*********************************************************************!*\ !*** ./src/lib/libraries/extensions/videoSensing/video-sensing.png ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/a03436c2c26c934fc0a7997065971874.png"; /***/ }), /***/ "./src/lib/libraries/extensions/wedo2/wedo-button-illustration.svg": /*!*************************************************************************!*\ !*** ./src/lib/libraries/extensions/wedo2/wedo-button-illustration.svg ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/7130491bf33852e50503dcb4024c0279.svg"; /***/ }), /***/ "./src/lib/libraries/extensions/wedo2/wedo-illustration.svg": /*!******************************************************************!*\ !*** ./src/lib/libraries/extensions/wedo2/wedo-illustration.svg ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/5f7a79af3db62e0f5b7306ac0bd5ebf9.svg"; /***/ }), /***/ "./src/lib/libraries/extensions/wedo2/wedo-small.svg": /*!***********************************************************!*\ !*** ./src/lib/libraries/extensions/wedo2/wedo-small.svg ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/0f9efe3bd6e80747dfa3aeb9e19997b5.svg"; /***/ }), /***/ "./src/lib/libraries/extensions/wedo2/wedo.png": /*!*****************************************************!*\ !*** ./src/lib/libraries/extensions/wedo2/wedo.png ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "static/assets/f011f09e649e804c4c0c8275a7d1ba5b.png"; /***/ }), /***/ "./src/lib/libraries/sound-tags.js": /*!*****************************************!*\ !*** ./src/lib/libraries/sound-tags.js ***! \*****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./tag-messages.js */ "./src/lib/libraries/tag-messages.js"); /* harmony default export */ __webpack_exports__["default"] = ([{ tag: 'animals', intlLabel: _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__["default"].animals }, { tag: 'effects', intlLabel: _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__["default"].effects }, { tag: 'loops', intlLabel: _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__["default"].loops }, { tag: 'notes', intlLabel: _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__["default"].notes }, { tag: 'percussion', intlLabel: _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__["default"].percussion }, { tag: 'space', intlLabel: _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__["default"].space }, { tag: 'sports', intlLabel: _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__["default"].sports }, { tag: 'voice', intlLabel: _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__["default"].voice }, { tag: 'wacky', intlLabel: _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__["default"].wacky }]); /***/ }), /***/ "./src/lib/libraries/sounds.json": /*!***************************************!*\ !*** ./src/lib/libraries/sounds.json ***! \***************************************/ /*! exports provided: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, default */ /***/ (function(module) { module.exports = [{"name":"A Bass","md5":"c04ebf21e5e19342fa1535e4efcdb43b.wav","sampleCount":28160,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"A Elec Bass","md5":"5cb46ddd903fc2c9976ff881df9273c9.wav","sampleCount":5920,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"A Elec Guitar","md5":"fa5f7fea601e9368dd68449d9a54c995.wav","sampleCount":44100,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"A Elec Piano","md5":"0cfa8e84d6a5cd63afa31d541625a9ef.wav","sampleCount":44100,"rate":22050,"format":"","tags":["music","note","piano","keyboard"]},{"name":"A Guitar","md5":"ee753e87d212d4b2fb650ca660f1e839.wav","sampleCount":31872,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"A Minor Ukulele","md5":"69d25af0fd065da39c71439174efc589.wav","sampleCount":18267,"rate":22050,"format":"","tags":["music","instruments","notes","chords"]},{"name":"A Piano","md5":"0727959edb2ea0525feed9b0c816991c.wav","sampleCount":44100,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"A Sax","md5":"420991e0d6d99292c6d736963842536a.wav","sampleCount":6472,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"A Trombone","md5":"863ccc8ba66e6dabbce2a1261c22be0f.wav","sampleCount":17227,"rate":22050,"format":"adpcm","tags":["music","instruments","notes"]},{"name":"A Trumpet","md5":"d2dd6b4372ca17411965dc92d52b2172.wav","sampleCount":13911,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"Afro String","md5":"3477ccfde26047eeb93ff43a21ac7d3d.wav","sampleCount":9807,"rate":11025,"format":"","tags":[]},{"name":"Alert","md5":"f62e3bfccab9c23eee781473c94a009c.wav","sampleCount":21362,"rate":22050,"format":"adpcm","tags":["effects","electronic","games","space"]},{"name":"Alien Creak1","md5":"0377a7476136e5e8c780c64a4828922d.wav","sampleCount":8045,"rate":11025,"format":"","tags":["effects","space"]},{"name":"Alien Creak2","md5":"21f82b7f1a83c501539c5031aea4fa8c.wav","sampleCount":8300,"rate":11025,"format":"","tags":["effects","space"]},{"name":"B Bass","md5":"e31dcaf7bcdf58ac2a26533c48936c45.wav","sampleCount":25792,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"B Elec Bass","md5":"5a0701d0a914223b5288300ac94e90e4.wav","sampleCount":6208,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"B Elec Guitar","md5":"81f142d0b00189703d7fe9b1f13f6f87.wav","sampleCount":44100,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"B Elec Piano","md5":"9cc77167419f228503dd57fddaa5b2a6.wav","sampleCount":44100,"rate":22050,"format":"","tags":["music","note","piano","keyboard"]},{"name":"B Guitar","md5":"2ae2d67de62df8ca54d638b4ad2466c3.wav","sampleCount":29504,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"B Piano","md5":"86826c6022a46370ed1afae69f1ab1b9.wav","sampleCount":44100,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"B Sax","md5":"653ebe92d491b49ad5d8101d629f567b.wav","sampleCount":9555,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"B Trombone","md5":"85b663229525b73d9f6647f78eb23e0a.wav","sampleCount":15522,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"B Trumpet","md5":"cad2bc57729942ed9b605145fc9ea65d.wav","sampleCount":14704,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"Baa","md5":"ca694053020e42704bcf1fc01a70f1c3.wav","sampleCount":41822,"rate":22050,"format":"adpcm","tags":["animals","sheep"]},{"name":"Bark","md5":"cd8fa8390b0efdd281882533fbfcfcfb.wav","sampleCount":3168,"rate":22050,"format":"","tags":[]},{"name":"Basketball Bounce","md5":"1727f65b5f22d151685b8e5917456a60.wav","sampleCount":8099,"rate":22050,"format":"adpcm","tags":["sports","effects"]},{"name":"Bass Beatbox","md5":"28153621d293c86da0b246d314458faf.wav","sampleCount":6720,"rate":22050,"format":"","tags":[]},{"name":"Beat Box1","md5":"663270af0235bf14c890ba184631675f.wav","sampleCount":5729,"rate":11025,"format":"","tags":["music","human","voice","hiphop"]},{"name":"Beat Box2","md5":"b9b8073f6aa9a60085ad11b0341a4af2.wav","sampleCount":5729,"rate":11025,"format":"","tags":["music","human","voice","hiphop"]},{"name":"Bell Cymbal","md5":"efddec047de95492f775a1b5b2e8d19e.wav","sampleCount":19328,"rate":22050,"format":"","tags":[]},{"name":"Bell Toll","md5":"25d61e79cbeba4041eebeaebd7bf9598.wav","sampleCount":45168,"rate":11025,"format":"","tags":["effects","dramatic"]},{"name":"Big Boing","md5":"00d6e72ef8bf7088233e98fbcee0ec6d.wav","sampleCount":18174,"rate":22050,"format":"adpcm","tags":["wacky","effects","cartoon"]},{"name":"Bird","md5":"18bd4b634a3f992a16b30344c7d810e0.wav","sampleCount":3840,"rate":11025,"format":"","tags":[]},{"name":"Birthday","md5":"89691587a169d935a58c48c3d4e78534.wav","sampleCount":161408,"rate":22050,"format":"","tags":[]},{"name":"Bite","md5":"0039635b1d6853face36581784558454.wav","sampleCount":7672,"rate":22050,"format":"adpcm","tags":["wacky","effects","human"]},{"name":"Boing","md5":"53a3c2e27d1fb5fdb14aaf0cb41e7889.wav","sampleCount":6804,"rate":22050,"format":"adpcm","tags":["effects"]},{"name":"Bonk","md5":"dd93f7835a407d4de5b2512ec4a6a806.wav","sampleCount":13908,"rate":22050,"format":"adpcm","tags":["wacky","effects","cartoon"]},{"name":"Boom Cloud","md5":"62d87dfb0f873735e59669d965bdbd7d.wav","sampleCount":88200,"rate":22050,"format":"adpcm","tags":["effects","games","space","dramatic"]},{"name":"Boop Bing Bop","md5":"66968153be7dce9e5abf62d627ffe40f.wav","sampleCount":54957,"rate":22050,"format":"adpcm","tags":["wacky","effects","cartoon"]},{"name":"Bossa Nova","md5":"04ccc72f32e909292adcaf40348be5f3.wav","sampleCount":136645,"rate":22050,"format":"adpcm","tags":["loops","music","latin"]},{"name":"Bowling Strike","md5":"32f3af03ddfbd9cc89c8565678a26813.wav","sampleCount":26629,"rate":22050,"format":"adpcm","tags":["sports","effects"]},{"name":"Bubbles","md5":"78b0be9c9c2f664158b886bc7e794095.wav","sampleCount":45056,"rate":11025,"format":"","tags":[]},{"name":"Buzz Whir","md5":"d4f76ded6bccd765958d15b63804de55.wav","sampleCount":9037,"rate":11025,"format":"","tags":[]},{"name":"C Bass","md5":"c3566ec797b483acde28f790994cc409.wav","sampleCount":44608,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"C Elec Bass","md5":"69eee3d038ea0f1c34ec9156a789236d.wav","sampleCount":5216,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"C Elec Guitar","md5":"0d340de02e14bebaf8dfa0e43eb3f1f9.wav","sampleCount":44100,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"C Elec Piano","md5":"8366ee963cc57ad24a8a35a26f722c2b.wav","sampleCount":44100,"rate":22050,"format":"","tags":["music","note","piano","keyboard"]},{"name":"C Guitar","md5":"22baa07795a9a524614075cdea543793.wav","sampleCount":44864,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"C Major Ukulele","md5":"aa2ca112507b59b5337f341aaa75fb08.wav","sampleCount":18203,"rate":22050,"format":"","tags":["music","instruments","notes","chords"]},{"name":"C Piano","md5":"d27ed8d953fe8f03c00f4d733d31d2cc.wav","sampleCount":44100,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"C Sax","md5":"4d2c939d6953b5f241a27a62cf72de64.wav","sampleCount":9491,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"C Trombone","md5":"821b23a489201a0f21f47ba8528ba47f.wav","sampleCount":19053,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"C Trumpet","md5":"8970afcdc4e47bb54959a81fe27522bd.wav","sampleCount":13118,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"C2 Bass","md5":"667d6c527b79321d398e85b526f15b99.wav","sampleCount":24128,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"C2 Elec Bass","md5":"56fc995b8860e713c5948ecd1c2ae572.wav","sampleCount":5792,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"C2 Elec Guitar","md5":"3a8ed3129f22cba5b0810bc030d16b5f.wav","sampleCount":44100,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"C2 Elec Piano","md5":"366c7edbd4dd5cca68bf62902999bd66.wav","sampleCount":44100,"rate":22050,"format":"","tags":["music","note","piano","keyboard"]},{"name":"C2 Guitar","md5":"c8d2851bd99d8e0ce6c1f05e4acc7f34.wav","sampleCount":27712,"rate":22050,"format":"","tags":[]},{"name":"C2 Piano","md5":"75d7d2c9b5d40dd4e1cb268111abf1a2.wav","sampleCount":44100,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"C2 Sax","md5":"ea8d34b18c3d8fe328cea201666458bf.wav","sampleCount":7349,"rate":22050,"format":"adpcm","tags":["music","instruments","notes"]},{"name":"C2 Trombone","md5":"68aec107bd3633b2ee40c532eedc3897.wav","sampleCount":13904,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"C2 Trumpet","md5":"df08249ed5446cc5e10b7ac62faac89b.wav","sampleCount":15849,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"Car Horn","md5":"7c887f6a2ecd1cdb85d5527898d7f7a0.wav","sampleCount":42443,"rate":22050,"format":"adpcm","tags":["effects","transportation"]},{"name":"Car Passing","md5":"c21a5ad00b40b5ce923e56c905c94a9f.wav","sampleCount":84992,"rate":11025,"format":"","tags":["transportation","ambience","background"]},{"name":"Car Vroom","md5":"ead1da4a87ff6cb53441142f7ac37b8f.wav","sampleCount":43358,"rate":22050,"format":"adpcm","tags":["sports","transportation"]},{"name":"Cave","md5":"881f1bf5f301a36efcce4204a44af9ab.wav","sampleCount":163584,"rate":22050,"format":"adpcm","tags":["music","loops"]},{"name":"Chatter","md5":"fd8543abeeba255072da239223d2d342.wav","sampleCount":25843,"rate":22050,"format":"adpcm","tags":["animals","squirrel","chipmunk"]},{"name":"Chee Chee","md5":"25f4826cdd61e0a1c623ec2324c16ca0.wav","sampleCount":34560,"rate":22050,"format":"","tags":["animals","monkey"]},{"name":"Cheer","md5":"170e05c29d50918ae0b482c2955768c0.wav","sampleCount":108864,"rate":22050,"format":"adpcm","tags":["sports","human","voice"]},{"name":"Chill","md5":"c4e9e84fd9244ca43986c2bdb6669ae8.wav","sampleCount":176400,"rate":22050,"format":"","tags":["loops","music","electronic","chill"]},{"name":"Chirp","md5":"3b8236bbb288019d93ae38362e865972.wav","sampleCount":5301,"rate":22050,"format":"adpcm","tags":["animals","bird"]},{"name":"Chomp","md5":"0b1e3033140d094563248e61de4039e5.wav","sampleCount":2912,"rate":11025,"format":"","tags":["effects","human"]},{"name":"Chord","md5":"7ffe91cce06c5415df53610d173336e7.wav","sampleCount":20608,"rate":11025,"format":"","tags":["music","electronic"]},{"name":"Clang","md5":"4102d78dc98ae81448b140f35fd73e80.wav","sampleCount":26703,"rate":22050,"format":"adpcm","tags":["effects","games"]},{"name":"Clap Beatbox","md5":"abc70bb390f8e55f22f32265500d814a.wav","sampleCount":4224,"rate":22050,"format":"","tags":[]},{"name":"Clapping","md5":"684ffae7bc3a65e35e9f0aaf7a579dd5.wav","sampleCount":84160,"rate":22050,"format":"","tags":["human"]},{"name":"Classical Piano","md5":"646ea2f42ab04b54f1359ccfac958561.wav","sampleCount":152874,"rate":22050,"format":"","tags":["loops","music","classical","bach"]},{"name":"Clock Ticking","md5":"a634fcb87894520edbd7a534d1479ec4.wav","sampleCount":109584,"rate":22050,"format":"adpcm","tags":["effects","home"]},{"name":"Clown Honk","md5":"ec66961f188e9b8a9c75771db744d096.wav","sampleCount":9009,"rate":22050,"format":"adpcm","tags":["wacky","horn"]},{"name":"Coin","md5":"1f81d88fb419084f4d82ffb859b94ed6.wav","sampleCount":3975,"rate":22050,"format":"adpcm","tags":["effects","electronic","games"]},{"name":"Collect","md5":"32514c51e03db680e9c63857b840ae78.wav","sampleCount":13320,"rate":22050,"format":"adpcm","tags":["effects","electronic","games"]},{"name":"Computer Beep","md5":"28c76b6bebd04be1383fe9ba4933d263.wav","sampleCount":9536,"rate":11025,"format":"","tags":[]},{"name":"Computer Beep2","md5":"1da43f6d52d0615da8a250e28100a80d.wav","sampleCount":19200,"rate":11025,"format":"","tags":["effects","electronic"]},{"name":"Connect","md5":"9aad12085708ccd279297d4bea9c5ae0.wav","sampleCount":22623,"rate":22050,"format":"adpcm","tags":["effects","electronic","games"]},{"name":"Cough1","md5":"98ec3e1eeb7893fca519aa52cc1ef3c1.wav","sampleCount":7516,"rate":11025,"format":"","tags":["human"]},{"name":"Cough2","md5":"467fe8ef3cab475af4b3088fd1261510.wav","sampleCount":16612,"rate":22050,"format":"","tags":["human"]},{"name":"Crank","md5":"a54f8ce520a0b9fff3cd53817e280ede.wav","sampleCount":100649,"rate":22050,"format":"adpcm","tags":["effects"]},{"name":"Crash Beatbox","md5":"725e29369e9138a43f11e0e5eb3eb562.wav","sampleCount":26883,"rate":22050,"format":"","tags":[]},{"name":"Crash Cymbal","md5":"f2c47a46f614f467a7ac802ed9ec3d8e.wav","sampleCount":25220,"rate":22050,"format":"","tags":[]},{"name":"Crazy Laugh","md5":"2293a751b71a2df8cdce1bec5558cc1e.wav","sampleCount":37485,"rate":22050,"format":"adpcm","tags":["human","cartoon","voice"]},{"name":"Cricket","md5":"a2b3cac37065c109aac17ed46005445e.wav","sampleCount":3673,"rate":22050,"format":"","tags":["animals","insects","bugs"]},{"name":"Crickets","md5":"cae6206eb3c57bb8c4b3e2ca362dfa6d.wav","sampleCount":92160,"rate":22050,"format":"","tags":["animals","insects","bugs","ambience","background"]},{"name":"Croak","md5":"c6ce0aadb89903a43f76fc20ea57633e.wav","sampleCount":6424,"rate":22050,"format":"adpcm","tags":["animals","frog","toad"]},{"name":"Crowd Gasp","md5":"0eaf773c9d1b06e801e7b5fd56298801.wav","sampleCount":27434,"rate":22050,"format":"adpcm","tags":["voice","human"]},{"name":"Crowd Laugh","md5":"f4942ab2532087118e11b0c4d4e0e342.wav","sampleCount":91584,"rate":22050,"format":"adpcm","tags":["voice","human"]},{"name":"Crunch","md5":"cac3341417949acc66781308a254529c.wav","sampleCount":4297,"rate":22050,"format":"adpcm","tags":["effects","electronic","games"]},{"name":"Cymbal","md5":"7c5405a9cf561f65a941aff10e661593.wav","sampleCount":24118,"rate":22050,"format":"adpcm","tags":["music","percussion","electronic"]},{"name":"Cymbal Crash","md5":"fa2c9da1d4fd70207ab749851853cb50.wav","sampleCount":25219,"rate":22050,"format":"","tags":["music","percussion"]},{"name":"Cymbal Echo","md5":"bb243badd1201b2607bf2513df10cd97.wav","sampleCount":44326,"rate":22050,"format":"","tags":["music","loops","hiphop"]},{"name":"D Bass","md5":"5a3ae8a2665f50fdc38cc301fbac79ba.wav","sampleCount":40192,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"D Elec Bass","md5":"67a6d1aa68233a2fa641aee88c7f051f.wav","sampleCount":5568,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"D Elec Guitar","md5":"1b5de9866801eb2f9d4f57c7c3b473f5.wav","sampleCount":44100,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"D Elec Piano","md5":"835f136ca8d346a17b4d4baf8405be37.wav","sampleCount":44100,"rate":22050,"format":"","tags":["music","note","piano","keyboard"]},{"name":"D Guitar","md5":"2dbcfae6a55738f94bbb40aa5fcbf7ce.wav","sampleCount":41120,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"D Piano","md5":"51381ac422605ee8c7d64cfcbfd75efc.wav","sampleCount":44100,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"D Sax","md5":"39f41954a73c0e15d842061e1a4c5e1d.wav","sampleCount":9555,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"D Trombone","md5":"f3afca380ba74372d611d3f518c2f35b.wav","sampleCount":17339,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"D Trumpet","md5":"0b1345b8fe2ba3076fedb4f3ae48748a.wav","sampleCount":12702,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"Dance Around","md5":"8bcea76415eaf98ec1cbc3825845b934.wav","sampleCount":343746,"rate":22050,"format":"adpcm","tags":["music","electronic","loops"]},{"name":"Dance Celebrate","md5":"0edb8fb88af19e6e17d0f8cf64c1d136.wav","sampleCount":176401,"rate":22050,"format":"adpcm","tags":["music","loops","electronic"]},{"name":"Dance Celebrate2","md5":"0edb8fb88af19e6e17d0f8cf64c1d136.wav","sampleCount":176401,"rate":22050,"format":"adpcm","tags":[]},{"name":"Dance Chill Out","md5":"b235da45581b1f212c9e9cce70d2a2dc.wav","sampleCount":222822,"rate":22050,"format":"adpcm","tags":["music","electronic","loops"]},{"name":"Dance Energetic","md5":"e213e09ed852c621ba87cde7f95eec79.wav","sampleCount":176400,"rate":22050,"format":"","tags":["loops","music","electronic","EDM"]},{"name":"Dance Funky","md5":"a8383eaddc02d33714dc5832c02ccf13.wav","sampleCount":111412,"rate":22050,"format":"adpcm","tags":["music","electronic","loops"]},{"name":"Dance Head Nod","md5":"65e8a47d55df3f4cb17722959f6220db.wav","sampleCount":124519,"rate":22050,"format":"adpcm","tags":["music","electronic","loops"]},{"name":"Dance Magic","md5":"042309f190183383c0b1c1fc3edc2e84.wav","sampleCount":187200,"rate":22050,"format":"adpcm","tags":["music","electronic","loops"]},{"name":"Dance Sitar","md5":"c4e893b927524ffd669898f69d096fd8.wav","sampleCount":110505,"rate":22050,"format":"adpcm","tags":["loops","music","india","tabla"]},{"name":"Dance Slow Mo","md5":"329ee6f3418c0a569418e102e620edf0.wav","sampleCount":445643,"rate":22050,"format":"adpcm","tags":["music","electronic","loops"]},{"name":"Dance Snare Beat","md5":"562587bdb75e3a8124cdaa46ba0f648b.wav","sampleCount":176401,"rate":22050,"format":"adpcm","tags":["music","electronic","loops"]},{"name":"Dance Space","md5":"e15333f5ffaf08e145ace1610fccd67d.wav","sampleCount":88200,"rate":22050,"format":"adpcm","tags":["music","electronic","loops"]},{"name":"Disconnect","md5":"56df0714ed1ed455a2befd787a077214.wav","sampleCount":27563,"rate":22050,"format":"adpcm","tags":["effects","electronic","games"]},{"name":"Dog1","md5":"b15adefc3c12f758b6dc6a045362532f.wav","sampleCount":3672,"rate":22050,"format":"","tags":["animals"]},{"name":"Dog2","md5":"cd8fa8390b0efdd281882533fbfcfcfb.wav","sampleCount":3168,"rate":22050,"format":"","tags":["animals"]},{"name":"Door Closing","md5":"d8c78c6c272cca91342435ff543c1274.wav","sampleCount":7454,"rate":22050,"format":"adpcm","tags":["effects","home"]},{"name":"Door Creak","md5":"56985da9c052a5e26007c99aa5a958f7.wav","sampleCount":54272,"rate":11025,"format":"","tags":["effects","home"]},{"name":"Doorbell","md5":"b67db6ed07f882e52a9ef4dbb76f5f64.wav","sampleCount":109662,"rate":22050,"format":"adpcm","tags":["effects","home"]},{"name":"Drip Drop","md5":"3249e61fa135d0a1d68ff515ba3bd92f.wav","sampleCount":62680,"rate":22050,"format":"adpcm","tags":["music","electronic","loops"]},{"name":"Drive Around","md5":"a3a85fb8564b0266f50a9c091087b7aa.wav","sampleCount":44096,"rate":22050,"format":"","tags":["music","loops","electronic"]},{"name":"Drum","md5":"f730246174873cd4ae4127c83e475b50.wav","sampleCount":107136,"rate":22050,"format":"adpcm","tags":["music","percussion","loops","hiphop","jazz"]},{"name":"Drum Bass1","md5":"48328c874353617451e4c7902cc82817.wav","sampleCount":6528,"rate":22050,"format":"","tags":[]},{"name":"Drum Bass2","md5":"711a1270d1cf2e5de9b145ee539213e4.wav","sampleCount":3791,"rate":22050,"format":"adpcm","tags":[]},{"name":"Drum Bass3","md5":"c21704337b16359ea631b5f8eb48f765.wav","sampleCount":8576,"rate":22050,"format":"","tags":[]},{"name":"Drum Boing","md5":"5f4216970527d5a2e259758ba12e6a1b.wav","sampleCount":18640,"rate":22050,"format":"adpcm","tags":["effects","wacky","cartoon","percussion"]},{"name":"Drum Buzz","md5":"3650dc4262bcc5010c0d8fa8d7c670cf.wav","sampleCount":5742,"rate":11025,"format":"","tags":["music","electronic","percussion"]},{"name":"Drum Funky","md5":"fb56022366d21b299cbc3fd5e16000c2.wav","sampleCount":44748,"rate":22050,"format":"adpcm","tags":["music","loops","hiphop"]},{"name":"Drum Jam","md5":"8b5486ccc806e97e83049d25b071f7e4.wav","sampleCount":44288,"rate":22050,"format":"","tags":["music","loops","percussion"]},{"name":"Drum Machine","md5":"f9d53d773b42e16df3dfca6174015592.wav","sampleCount":105984,"rate":22050,"format":"adpcm","tags":["music","electronic","loops"]},{"name":"Drum Roll","md5":"fb12e119d7a88a7f75ab980243f75073.wav","sampleCount":37809,"rate":22050,"format":"adpcm","tags":["wacky","percussion"]},{"name":"Drum Satellite","md5":"079067d7909f791b29f8be1c00fc2131.wav","sampleCount":44096,"rate":22050,"format":"","tags":["music","loops","percussion"]},{"name":"Drum Set1","md5":"38a2bb8129bddb4e8eaa06781cfa3040.wav","sampleCount":46080,"rate":22050,"format":"adpcm","tags":["music","percussion","jazz","loops"]},{"name":"Drum Set2","md5":"738e871fda577295e8beb9021f670e28.wav","sampleCount":37440,"rate":22050,"format":"adpcm","tags":["music","percussion","jazz","loops"]},{"name":"Dubstep","md5":"906af1e30f19a919d203b2eb307e04ac.wav","sampleCount":151216,"rate":22050,"format":"adpcm","tags":["loops","music","electronic","EDM"]},{"name":"Duck","md5":"af5b039e1b05e0ccb12944f648a8884e.wav","sampleCount":5792,"rate":22050,"format":"","tags":["animals"]},{"name":"Dun Dun Dunnn","md5":"e956a99ab9ac64cfb5c6b2d8b1e949eb.wav","sampleCount":63729,"rate":22050,"format":"adpcm","tags":["effects","surprise","wacky","dramatic"]},{"name":"E Bass","md5":"0657e39bae81a232b01a18f727d3b891.wav","sampleCount":36160,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"E Elec Bass","md5":"0704b8ceabe54f1dcedda8c98f1119fd.wav","sampleCount":5691,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"E Elec Guitar","md5":"2e6a6ae3e0f72bf78c74def8130f459a.wav","sampleCount":44100,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"E Elec Piano","md5":"ab3c198f8e36efff14f0a5bad35fa3cd.wav","sampleCount":44100,"rate":22050,"format":"","tags":["music","note","piano","keyboard"]},{"name":"E Guitar","md5":"4b5d1da83e59bf35578324573c991666.wav","sampleCount":38400,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"E Piano","md5":"c818fdfaf8a0efcb562e24e794700a57.wav","sampleCount":44100,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"E Sax","md5":"3568b7dfe173fab6877a9ff1dcbcf1aa.wav","sampleCount":7489,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"E Trombone","md5":"c859fb0954acaa25c4b329df5fb76434.wav","sampleCount":16699,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"E Trumpet","md5":"494295a92314cadb220945a6711c568c.wav","sampleCount":8680,"rate":22050,"format":"adpcm","tags":["music","instruments","notes"]},{"name":"Eggs","md5":"659de1f3826ece8dbeca948884835f14.wav","sampleCount":336480,"rate":22050,"format":"adpcm","tags":["music","loops"]},{"name":"Elec Piano A Minor","md5":"8fe470b5f2fb58364b153fe647adcbbf.wav","sampleCount":44100,"rate":22050,"format":"","tags":["music","notes","instruments"]},{"name":"Elec Piano C Major","md5":"228429930dfc60f48d75ce8e14291416.wav","sampleCount":44100,"rate":22050,"format":"","tags":["music","notes","instruments"]},{"name":"Elec Piano F Major","md5":"740098316ed06d9a64c14b93f65c5da5.wav","sampleCount":44100,"rate":22050,"format":"","tags":["music","notes","instruments"]},{"name":"Elec Piano G Major","md5":"5a5f5de80bcdf782250e889747b374bd.wav","sampleCount":43908,"rate":22050,"format":"","tags":["music","notes","instruments"]},{"name":"Elec Piano Loop","md5":"7b4822ccca655db47de0880bab0e7bd9.wav","sampleCount":43844,"rate":22050,"format":"","tags":["music","notes","instruments","loops"]},{"name":"Emotional Piano","md5":"c587075453ace1584cf155d6a8de604d.wav","sampleCount":165090,"rate":22050,"format":"","tags":["loops","music","chill","calm"]},{"name":"Engine","md5":"f5c4e2311024f18c989e53f9b3448db8.wav","sampleCount":172729,"rate":22050,"format":"adpcm","tags":["effects","transportation"]},{"name":"F Bass","md5":"ea21bdae86f70d60b28f1dddcf50d104.wav","sampleCount":34368,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"F Elec Bass","md5":"45eedb4ce62a9cbbd2207824b94a4641.wav","sampleCount":5312,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"F Elec Guitar","md5":"5eb00f15f21f734986aa45156d44478d.wav","sampleCount":44100,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"F Elec Piano","md5":"dc5e368fc0d0dad1da609bfc3e29aa15.wav","sampleCount":44100,"rate":22050,"format":"","tags":["music","note","piano","keyboard"]},{"name":"F Guitar","md5":"b51d086aeb1921ec405561df52ecbc50.wav","sampleCount":36416,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"F Major Ukulele","md5":"cd0ab5d1b0120c6ed92a1654ccf81376.wav","sampleCount":18235,"rate":22050,"format":"","tags":["music","instruments","notes","chords"]},{"name":"F Piano","md5":"cdab3cce84f74ecf53e3941c6a003b5e.wav","sampleCount":44100,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"F Sax","md5":"2ae3083817bcd595e26ea2884b6684d5.wav","sampleCount":7361,"rate":22050,"format":"adpcm","tags":["music","instruments","notes"]},{"name":"F Trombone","md5":"d6758470457aac2aa712717a676a5163.wav","sampleCount":19373,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"F Trumpet","md5":"5fa3108b119ca266029b4caa340a7cd0.wav","sampleCount":12766,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"Fairydust","md5":"b92de59d992a655c1b542223a784cda6.wav","sampleCount":11247,"rate":22050,"format":"","tags":[]},{"name":"Finger Snap","md5":"99d02ffb3212d86b3e5b173b6f33f835.wav","sampleCount":1985,"rate":11025,"format":"","tags":["effects","percussion","human"]},{"name":"Flam Snare","md5":"3b6cce9f8c56c0537ca61eee3945cd1d.wav","sampleCount":4416,"rate":22050,"format":"","tags":[]},{"name":"Footsteps","md5":"c893b0a9b3e2e0594f1f921a12aa66be.wav","sampleCount":58880,"rate":11025,"format":"","tags":["effects","human"]},{"name":"G Bass","md5":"05c192194e8f1944514dce3833e33439.wav","sampleCount":30976,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"G Elec Bass","md5":"97b187d72219b994a6ef6a5a6b09605c.wav","sampleCount":5568,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"G Elec Guitar","md5":"cd0d0e7dad415b2ffa2ba7a61860eaf8.wav","sampleCount":44100,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"G Elec Piano","md5":"39525f6545d62a95d05153f92d63301a.wav","sampleCount":44100,"rate":22050,"format":"","tags":["music","note","piano","keyboard"]},{"name":"G Guitar","md5":"98a835713ecea2f3ef9f4f442d52ad20.wav","sampleCount":33600,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"G Piano","md5":"42bb2ed28e7023e111b33220e1594a6f.wav","sampleCount":44100,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"G Sax","md5":"cefba5de46adfe5702485e0934bb1e13.wav","sampleCount":7349,"rate":22050,"format":"adpcm","tags":["music","instruments","notes"]},{"name":"G Trombone","md5":"9436fd7a0eacb4a6067e7db14236dde1.wav","sampleCount":17179,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"G Trumpet","md5":"e84afda25975f14b364118591538ccf4.wav","sampleCount":14640,"rate":22050,"format":"","tags":["music","instruments","notes"]},{"name":"G Ukulele","md5":"d20218f92ee606277658959005538e2d.wav","sampleCount":18235,"rate":22050,"format":"","tags":["music","instruments","notes","chords"]},{"name":"Gallop","md5":"8388c266cd774a8e8c8796155b18ef47.wav","sampleCount":36209,"rate":22050,"format":"adpcm","tags":["animals","horse"]},{"name":"Garden","md5":"7c25f6d39011cd2ee5ffb1af539d9d0c.wav","sampleCount":371520,"rate":22050,"format":"adpcm","tags":["music","loops"]},{"name":"Glass Breaking","md5":"4b33c58ba14e4555373fa2478b3f891f.wav","sampleCount":52237,"rate":22050,"format":"adpcm","tags":["effects"]},{"name":"Glug","md5":"5606722c6105f3c58f9689a958f5c45f.wav","sampleCount":12100,"rate":22050,"format":"adpcm","tags":["effects","potion","drink","water"]},{"name":"Goal Cheer","md5":"a434069c58e79d42f5d21abb1c318919.wav","sampleCount":84096,"rate":22050,"format":"adpcm","tags":["sports","human","voice"]},{"name":"Gong","md5":"9d30c38443691e9626d510546d98327c.wav","sampleCount":114432,"rate":11025,"format":"","tags":["music","percussion"]},{"name":"Goose","md5":"16a3b9d516e125cdb2ad74cd8d205d71.wav","sampleCount":8208,"rate":22050,"format":"","tags":["animals","birds"]},{"name":"Growl","md5":"79d052b0921d2078d42389328b1be168.wav","sampleCount":19228,"rate":22050,"format":"adpcm","tags":["animals","dog"]},{"name":"Grunt","md5":"caa0a1685ef7a5334413834c6c818c5a.wav","sampleCount":20551,"rate":22050,"format":"adpcm","tags":["animals","buffalo"]},{"name":"Guitar Chords1","md5":"2b1a5bc63580d8625cf24ff3d7622c0b.wav","sampleCount":123264,"rate":22050,"format":"adpcm","tags":["music","instruments","loops"]},{"name":"Guitar Chords2","md5":"e956f15da397a13fae0c90d9fe4571fb.wav","sampleCount":158976,"rate":22050,"format":"adpcm","tags":["music","instruments","loops"]},{"name":"Guitar Strum","md5":"29000fa713f70765147ee0551fa42d9e.wav","sampleCount":25216,"rate":11025,"format":"","tags":["music","instruments","chords"]},{"name":"Hand Clap","md5":"9502142875e67f7b0292a117a27e9563.wav","sampleCount":2464,"rate":22050,"format":"","tags":["human","percussion"]},{"name":"Head Shake","md5":"e56fdc9f76d035ff01f4e7b39e9e9989.wav","sampleCount":20025,"rate":22050,"format":"adpcm","tags":["effects","wacky","cartoon"]},{"name":"Hey","md5":"ec7c272faa862c9f8f731792e686e3c9.wav","sampleCount":5414,"rate":22050,"format":"adpcm","tags":["human","voice"]},{"name":"Hi Beatbox","md5":"5a07847bf246c227204728b05a3fc8f3.wav","sampleCount":5856,"rate":22050,"format":"","tags":[]},{"name":"Hi Na Tabla","md5":"35b42d98c43404a5b1b52fb232a62bd7.wav","sampleCount":4096,"rate":22050,"format":"","tags":["drums","instrument","percussion"]},{"name":"Hi Tun Tabla","md5":"da734693dfa6a9a7eccdc7f9a0ca9840.wav","sampleCount":18656,"rate":22050,"format":"","tags":["drums","instrument","percussion"]},{"name":"High Conga","md5":"16144544de90e98a92a265d4fc3241ea.wav","sampleCount":8192,"rate":22050,"format":"","tags":["drums","instrument","percussion"]},{"name":"High Hat","md5":"0d91b2759ac861d156235f5ecf8d3218.wav","sampleCount":2757,"rate":22050,"format":"adpcm","tags":["music","percussion","drums"]},{"name":"High Tom","md5":"d623f99b3c8d33932eb2c6c9cfd817c5.wav","sampleCount":12320,"rate":22050,"format":"","tags":[]},{"name":"High Whoosh","md5":"6a10c380af8c400f8f6eea84eb28bd12.wav","sampleCount":6116,"rate":22050,"format":"adpcm","tags":["effects","games"]},{"name":"Hihat Beatbox","md5":"5a07847bf246c227204728b05a3fc8f3.wav","sampleCount":5856,"rate":22050,"format":"","tags":["human","percussion","music","hiphop"]},{"name":"Hihat Cymbal","md5":"2d01f60d0f20ab39facbf707899c6b2a.wav","sampleCount":2752,"rate":22050,"format":"","tags":[]},{"name":"Hip Hop","md5":"7ed8ce1853bde6dcbc6f7f5a1c65ae47.wav","sampleCount":108864,"rate":22050,"format":"adpcm","tags":["music","loops","hiphop"]},{"name":"Horse","md5":"45ffcf97ee2edca0199ff5aa71a5b72e.wav","sampleCount":14464,"rate":11025,"format":"","tags":["animals","effects"]},{"name":"Horse Gallop","md5":"058a34b5fb8b57178b5322d994b6b8c8.wav","sampleCount":38336,"rate":11025,"format":"","tags":[]},{"name":"Human Beatbox1","md5":"37f37455c35fea71449926eb0bff05dd.wav","sampleCount":103680,"rate":22050,"format":"adpcm","tags":["human","percussion","music","hiphop","loops"]},{"name":"Human Beatbox2","md5":"f62e9f7deeb0e06268df6edffa14f5de.wav","sampleCount":62392,"rate":22050,"format":"adpcm","tags":["human","percussion","music","hiphop","loops"]},{"name":"Jump","md5":"6fcd64d6357e4ea03704e5f96bfd35ba.wav","sampleCount":6867,"rate":22050,"format":"adpcm","tags":["effects","electronic","games"]},{"name":"Jungle","md5":"b234a04cc3958437c43ed3d93f34a345.wav","sampleCount":76032,"rate":22050,"format":"adpcm","tags":["music","electronic","loops"]},{"name":"Jungle Frogs","md5":"2ca5fbda5288b79a6e12f5ca3c20b0fa.wav","sampleCount":291214,"rate":22050,"format":"adpcm","tags":["animals","background","crickets","ambience"]},{"name":"Kick Back","md5":"9cd340d9d568b1479f731e69e103b3ce.wav","sampleCount":44748,"rate":22050,"format":"adpcm","tags":["music","loops","hiphop"]},{"name":"Kick Drum","md5":"711a1270d1cf2e5de9b145ee539213e4.wav","sampleCount":3791,"rate":22050,"format":"adpcm","tags":["music","percussion","hiphop"]},{"name":"Large Cowbell","md5":"006316650ffc673dc02d36aa55881327.wav","sampleCount":20856,"rate":22050,"format":"adpcm","tags":["music","percussion","drums"]},{"name":"Laser1","md5":"46571f8ec0f2cc91666c80e312579082.wav","sampleCount":516,"rate":11025,"format":"","tags":[]},{"name":"Laser2","md5":"27654ed2e3224f0a3f77c244e4fae9aa.wav","sampleCount":755,"rate":11025,"format":"","tags":[]},{"name":"Laugh1","md5":"1e8e7fb94103282d02a4bb597248c788.wav","sampleCount":13547,"rate":11025,"format":"","tags":["human","voice"]},{"name":"Laugh2","md5":"8b1e025f38b0635f7e34e9afcace1b5e.wav","sampleCount":14662,"rate":11025,"format":"","tags":["human","voice"]},{"name":"Laugh3","md5":"86dee6fa7cd73095ba17e4d666a27804.wav","sampleCount":32065,"rate":11025,"format":"","tags":["human","voice"]},{"name":"Lo Geh Tabla","md5":"9205359ab69d042ed3da8a160a651690.wav","sampleCount":30784,"rate":22050,"format":"","tags":["drums","instrument","percussion"]},{"name":"Lo Gliss Tabla","md5":"d7cd24689737569c93e7ea7344ba6b0e.wav","sampleCount":7008,"rate":22050,"format":"","tags":["drums","instrument","percussion"]},{"name":"Lose","md5":"d73eacaf5a905bf864041c7a70937ac4.wav","sampleCount":81379,"rate":22050,"format":"adpcm","tags":["effects","electronic","games"]},{"name":"Low Boing","md5":"33e9314fd25ef8e800a749c86487f7a9.wav","sampleCount":16592,"rate":22050,"format":"adpcm","tags":["effects"]},{"name":"Low Conga","md5":"0b6f94487cd8a1cf0bb77e15966656c3.wav","sampleCount":8384,"rate":22050,"format":"","tags":["drums","instrument","percussion"]},{"name":"Low Squeak","md5":"0aae06b65c875a6ba1fd51f4251b16b3.wav","sampleCount":16736,"rate":22050,"format":"adpcm","tags":["effects"]},{"name":"Low Tom","md5":"1569bbbd8952b0575e5a5cb5aefb50ba.wav","sampleCount":20000,"rate":22050,"format":"","tags":[]},{"name":"Low Whoosh","md5":"d42f096c89764484a442046f4342c9ad.wav","sampleCount":11220,"rate":22050,"format":"adpcm","tags":["effects","games"]},{"name":"Machine","md5":"e7dfb630116153533989ff839c1973a5.wav","sampleCount":10209,"rate":22050,"format":"adpcm","tags":["effects"]},{"name":"Magic Spell","md5":"1cb60ecdb1075c8769cb346d5c2a22c7.wav","sampleCount":43077,"rate":22050,"format":"adpcm","tags":["effects","fantasy"]},{"name":"Medieval1","md5":"9329fef6a59c5406d70cbe5837976d6b.wav","sampleCount":213120,"rate":22050,"format":"adpcm","tags":["music","loops","fantasy"]},{"name":"Medieval2","md5":"7bc8c4a9d0525f04451356c6cc483dd7.wav","sampleCount":324288,"rate":22050,"format":"adpcm","tags":["music","loops","fantasy"]},{"name":"Meow","md5":"83c36d806dc92327b9e7049a565c6bff.wav","sampleCount":18688,"rate":22050,"format":"","tags":["animals","cat"]},{"name":"Meow2","md5":"cf51a0c4088942d95bcc20af13202710.wav","sampleCount":6512,"rate":11025,"format":"","tags":["animals","cat"]},{"name":"Moo","md5":"7206280bd4444a06d25f19a84dcb56b1.wav","sampleCount":27225,"rate":22050,"format":"adpcm","tags":["animals","cow"]},{"name":"Motorcycle Passing","md5":"b49ab3a926da46578396d1faffd24d3b.wav","sampleCount":86016,"rate":11025,"format":"","tags":["transportation","ambience","background"]},{"name":"Movie 1","md5":"84f7b490f0f536cc1337ab7948aa3aa7.wav","sampleCount":220500,"rate":22050,"format":"","tags":["loops","music","cinematic"]},{"name":"Movie 2","md5":"77ea2403120936066eb6280a47b063fd.wav","sampleCount":151201,"rate":22050,"format":"adpcm","tags":["loops","music","cinematic"]},{"name":"Muted Conga","md5":"1d4abbe3c9bfe198a88badb10762de75.wav","sampleCount":4544,"rate":22050,"format":"","tags":["drums","instrument","percussion"]},{"name":"Mystery","md5":"a822b56063729f4f42f9a62e6010768b.wav","sampleCount":94315,"rate":22050,"format":"adpcm","tags":["loops","music","cinematic"]},{"name":"Ocean Wave","md5":"c904610d770398b98872a708a2f75611.wav","sampleCount":99206,"rate":22050,"format":"adpcm","tags":["effects","water","underwater"]},{"name":"Odesong","md5":"2c41921491b1da2bfa1ebcaba34265ca.wav","sampleCount":212553,"rate":22050,"format":"adpcm","tags":["music","loops","electronic"]},{"name":"Oops","md5":"1139072c3d2d31fa5903c46632789d08.wav","sampleCount":30514,"rate":22050,"format":"adpcm","tags":["effects","electronic","games"]},{"name":"Orchestra Tuning","md5":"9fdef8a1f57a24b99add29d4f1925c76.wav","sampleCount":221837,"rate":22050,"format":"adpcm","tags":["effects","ambience","background","music"]},{"name":"Owl","md5":"e8b6d605f5a1bb36c29e4e21ef754209.wav","sampleCount":8111,"rate":11025,"format":"","tags":[]},{"name":"Party Noise","md5":"8f5a994abfa814da72272e766772dbac.wav","sampleCount":44672,"rate":11025,"format":"","tags":["human","voice","ambience","background"]},{"name":"Pew","md5":"21a2cc083ef51767fb13791151194348.wav","sampleCount":5816,"rate":22050,"format":"adpcm","tags":["effects","electronic","games"]},{"name":"Ping Pong Hit","md5":"8357b4bdf6fbe10b972be3b78167b3c8.wav","sampleCount":11171,"rate":22050,"format":"adpcm","tags":["sports"]},{"name":"Pluck","md5":"0f2aa4c395cb932512defb2d14dc1691.wav","sampleCount":6537,"rate":22050,"format":"adpcm","tags":["effects","wacky","cartoon"]},{"name":"Plunge","md5":"c09455ee9da0e7eeead42d4e73c2555d.wav","sampleCount":22400,"rate":11025,"format":"","tags":["effects","water","splash"]},{"name":"Police Siren","md5":"b10dcd209865fbd392534633307dafad.wav","sampleCount":8649,"rate":22050,"format":"adpcm","tags":["effects"]},{"name":"Pop","md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":"","tags":[]},{"name":"Rain","md5":"b5db20c28ef4946137129b47772dcf69.wav","sampleCount":220295,"rate":22050,"format":"adpcm","tags":["ambience","background","weather","water"]},{"name":"Rattle","md5":"74f1c07e0bcd7811fd9d456a5f8667f8.wav","sampleCount":13184,"rate":22050,"format":"","tags":[]},{"name":"Referee Whistle","md5":"8468b9b3f11a665ee4d215afd8463b97.wav","sampleCount":14034,"rate":22050,"format":"adpcm","tags":["sports"]},{"name":"Reggae","md5":"19211d5ecd34214b6aba947790e63bb0.wav","sampleCount":173023,"rate":22050,"format":"","tags":["loops","music"]},{"name":"Ricochet","md5":"49407acfc004ec6960e8b84d363bd98d.wav","sampleCount":23862,"rate":22050,"format":"adpcm","tags":["effects","wacky"]},{"name":"Ride Cymbal","md5":"53badb02228d10494e0efdd1e839548d.wav","sampleCount":8144,"rate":11025,"format":"","tags":["music","percussion","drums"]},{"name":"Ring Tone","md5":"895c0887b4de4e0051e3adbceaf96061.wav","sampleCount":70656,"rate":22050,"format":"adpcm","tags":["effects","home"]},{"name":"Rip","md5":"4081f8fac2ca83bd34329400eb95bbde.wav","sampleCount":11877,"rate":22050,"format":"adpcm","tags":["effects","games"]},{"name":"Ripples","md5":"d3c95a4ba37dcf90c8a57e8b2fd1632d.wav","sampleCount":21504,"rate":11025,"format":"","tags":["effects","water"]},{"name":"Roll Cymbal","md5":"da8355d753cd2a5ddd19cb2bb41c1547.wav","sampleCount":26432,"rate":22050,"format":"","tags":[]},{"name":"Rooster","md5":"2e375acae2c7c0d655935a9de14b12f6.wav","sampleCount":17110,"rate":11025,"format":"","tags":[]},{"name":"Scrambling Feet","md5":"0fbca8db08d46419416c0f104345bc53.wav","sampleCount":35770,"rate":22050,"format":"adpcm","tags":["wacky","effects","cartoon"]},{"name":"Scratch Beatbox","md5":"859249563a7b1fc0f6e92e36d1db81c7.wav","sampleCount":11552,"rate":22050,"format":"","tags":[]},{"name":"Scratchy Beat","md5":"289dc558e076971e74dd1a0bd55719b1.wav","sampleCount":44096,"rate":22050,"format":"","tags":["music","loops","hiphop"]},{"name":"Scream1","md5":"10420bb2f5a3ab440f3b10fc8ea2b08b.wav","sampleCount":6628,"rate":11025,"format":"","tags":["human","voice"]},{"name":"Scream2","md5":"e06e29398d770dae3cd57447439752ef.wav","sampleCount":17010,"rate":22050,"format":"","tags":["human","voice"]},{"name":"Screech","md5":"10644c5cc83a9a2dd3ab466deb0eb03d.wav","sampleCount":12907,"rate":22050,"format":"adpcm","tags":["animals","monkey"]},{"name":"Seagulls","md5":"42bbbb6c37439abc82057ec2e67b78dc.wav","sampleCount":64936,"rate":22050,"format":"adpcm","tags":["animals","bird"]},{"name":"Sewing Machine","md5":"7bd800cb66d6fb18886a4c5cea1b76a6.wav","sampleCount":107964,"rate":22050,"format":"adpcm","tags":["effects","home"]},{"name":"Shaker","md5":"714e598d28e493cc50babc17f2c4895d.wav","sampleCount":18560,"rate":11025,"format":"","tags":["music","percussion"]},{"name":"Ship Bell","md5":"4cbd4dc0c55656e7edc4b0f00a3f9738.wav","sampleCount":78597,"rate":22050,"format":"adpcm","tags":["effects","transportation"]},{"name":"Sidestick Snare","md5":"f6868ee5cf626fc4ef3ca1119dc95592.wav","sampleCount":2336,"rate":22050,"format":"","tags":[]},{"name":"Singer1","md5":"92ee32e9be5ed7b69370fc38bb550597.wav","sampleCount":23653,"rate":11025,"format":"","tags":["human","voice","vocals","music"]},{"name":"Singer2","md5":"5d3d2865906889e866b3edf154e6cf5d.wav","sampleCount":28636,"rate":11025,"format":"","tags":["human","voice","vocals","music"]},{"name":"Siren Whistle","md5":"ea0d6aced66db4b8cafaeb6418ef9cf6.wav","sampleCount":20821,"rate":22050,"format":"adpcm","tags":["wacky","effects"]},{"name":"Skid","md5":"2c22bb6e3c65d9430185fd83ec3db64a.wav","sampleCount":23939,"rate":22050,"format":"adpcm","tags":["wacky","cartoon","effects","transportation"]},{"name":"Slide Whistle","md5":"3858bab5ea1211ff3c5902a4b680f7d8.wav","sampleCount":12273,"rate":22050,"format":"adpcm","tags":["wacky","effects","cartoon"]},{"name":"Small Cowbell","md5":"e29154f53f56f96f8a3292bdcddcec54.wav","sampleCount":9718,"rate":22050,"format":"adpcm","tags":["music","percussion","drums"]},{"name":"Snap","md5":"c2ff5da4d9d85dee866615f672b749ce.wav","sampleCount":15360,"rate":22050,"format":"","tags":["music","percussion","drums"]},{"name":"Snare Beatbox","md5":"c642c4c00135d890998f351faec55498.wav","sampleCount":5630,"rate":22050,"format":"adpcm","tags":[]},{"name":"Snare Beatbox2","md5":"7ede1382b578d8fc32850b48d082d914.wav","sampleCount":4960,"rate":22050,"format":"","tags":[]},{"name":"Snare Drum","md5":"c27fb569aba99c7203e954aecb1ed8e4.wav","sampleCount":2757,"rate":22050,"format":"adpcm","tags":["music","percussion","drums"]},{"name":"Sneaker Squeak","md5":"03f61f7d2c32da8a1493a380414710a2.wav","sampleCount":8370,"rate":22050,"format":"adpcm","tags":["sports","effects"]},{"name":"Sneeze1","md5":"31600c613823710b66a74f4dd54c4cdd.wav","sampleCount":11818,"rate":11025,"format":"","tags":["human","voice"]},{"name":"Sneeze2","md5":"42b5a31628083f3089f494f2ba644660.wav","sampleCount":15218,"rate":22050,"format":"","tags":["voice","human"]},{"name":"Snoring","md5":"5b1a88cd6db7e239642d7ca8a0d74a1a.wav","sampleCount":103974,"rate":22050,"format":"adpcm","tags":["human","wacky","voice","cartoon"]},{"name":"Snort","md5":"362d7440a57cab29914fecea621e50d4.wav","sampleCount":16421,"rate":22050,"format":"adpcm","tags":["animals","horse"]},{"name":"Space Ambience","md5":"f8903e89c1082987f18fc30b3de6d61a.wav","sampleCount":220160,"rate":22050,"format":"adpcm","tags":["effects","games","background","space"]},{"name":"Space Flyby","md5":"49c2e36b7258338fb3a8576e646c6738.wav","sampleCount":52770,"rate":22050,"format":"adpcm","tags":["effects","games","space","transportation"]},{"name":"Space Noise","md5":"a5cd5e83841aaaf34583d6ad53d551f5.wav","sampleCount":58212,"rate":22050,"format":"adpcm","tags":["effects","electronic","games","space"]},{"name":"Space Ripple","md5":"ff8b8c3bf841a11fd5fe3afaa92be1b5.wav","sampleCount":41149,"rate":11025,"format":"","tags":[]},{"name":"Spiral","md5":"c987c4e2c85d1a034ef047c2611aff25.wav","sampleCount":28672,"rate":11025,"format":"","tags":["space","effects","electronic"]},{"name":"Splash","md5":"6aed5e38d40b87a21d893d26fa2858c0.wav","sampleCount":46080,"rate":22050,"format":"adpcm","tags":["sports","water"]},{"name":"Splash Cymbal","md5":"9d63ed5be96c43b06492e8b4a9cea8d8.wav","sampleCount":9600,"rate":22050,"format":"","tags":[]},{"name":"Spooky String","md5":"6648b690e6e22c7504db7746879d51b4.wav","sampleCount":51376,"rate":11025,"format":"","tags":["effects","dramatic"]},{"name":"Squawk","md5":"e140d7ff07de8fa35c3d1595bba835ac.wav","sampleCount":8208,"rate":22050,"format":"","tags":["animals","birds"]},{"name":"Squeaks","md5":"62244fb9600ee90c780875deba2ba24f.wav","sampleCount":53626,"rate":22050,"format":"adpcm","tags":["animals","guinea pig"]},{"name":"Squeaky Toy","md5":"09d36c3c7531a0a1224437f3994bad40.wav","sampleCount":9982,"rate":22050,"format":"adpcm","tags":["wacky","effects","cartoon","horn"]},{"name":"Squish Pop","md5":"853cc25eb47a35c88e3a1fe88b171ed4.wav","sampleCount":9355,"rate":22050,"format":"adpcm","tags":["wacky","effects","cartoon"]},{"name":"String Accent","md5":"c1b5c86a10f43f87746b1c305d4fd8df.wav","sampleCount":16896,"rate":11025,"format":"","tags":["effects","music"]},{"name":"String Pluck","md5":"d658129427a96764819cb9bd52076860.wav","sampleCount":4976,"rate":11025,"format":"","tags":["effects","music","instruments"]},{"name":"Suction Cup","md5":"76b9d125d013562dc4f423525b028a19.wav","sampleCount":4882,"rate":22050,"format":"adpcm","tags":["effects"]},{"name":"Suspense","md5":"12f86e0188510860970e04df45370c1d.wav","sampleCount":16659,"rate":11025,"format":"","tags":["effects","music","dramatic"]},{"name":"Tada","md5":"10eed5b6b49ec7baf1d4b3b3fad0ac99.wav","sampleCount":55125,"rate":22050,"format":"adpcm","tags":["effects","surprise","wacky","dramatic"]},{"name":"Tambura","md5":"c2109f07f83086ec863e70887ef55fb6.wav","sampleCount":22261,"rate":11025,"format":"","tags":["effects","music","instruments"]},{"name":"Tap Conga","md5":"fd9a67157f57f9cc6fe3cdce38a6d4a8.wav","sampleCount":6880,"rate":22050,"format":"","tags":["drums","instrument","percussion"]},{"name":"Tap Snare","md5":"d55b3954d72c6275917f375e49b502f3.wav","sampleCount":3296,"rate":22050,"format":"","tags":[]},{"name":"Techno","md5":"8700dac70c8e08f4a5d21411980304bb.wav","sampleCount":175680,"rate":22050,"format":"adpcm","tags":["loops","music","electronic"]},{"name":"Techno2","md5":"693b428f3797561a11ad0ddbd897b5df.wav","sampleCount":327168,"rate":22050,"format":"adpcm","tags":["loops","music","electronic"]},{"name":"Telephone Ring","md5":"276f97d3a9d0f9938b37db8225af97f5.wav","sampleCount":74666,"rate":22050,"format":"adpcm","tags":["effects","home"]},{"name":"Telephone Ring2","md5":"d0096aa9ecc28c0729a99b0349399371.wav","sampleCount":25373,"rate":22050,"format":"adpcm","tags":["effects","home"]},{"name":"Teleport","md5":"2d625187556c4323169fc1a8f29a7a7d.wav","sampleCount":110250,"rate":22050,"format":"adpcm","tags":["effects","electronic","games","space"]},{"name":"Teleport2","md5":"7e5019890a930f3535604cf9cad63ba4.wav","sampleCount":15898,"rate":22050,"format":"adpcm","tags":["effects","electronic","games","space"]},{"name":"Teleport3","md5":"58f76f299a1df2373d4fca3614221186.wav","sampleCount":95440,"rate":22050,"format":"adpcm","tags":["effects","electronic","games","space"]},{"name":"Tennis Hit","md5":"01bd4d670cd586613705ee8273f22568.wav","sampleCount":18176,"rate":22050,"format":"adpcm","tags":["sports","effects"]},{"name":"Thunder Storm","md5":"11f13be7e53b2e9116d59344c5efc66a.wav","sampleCount":307513,"rate":22050,"format":"adpcm","tags":["weather","rain","ambience","background","dramatic"]},{"name":"Tom Drum","md5":"5a8b8678d37a860dd6c08082d5cda3c2.wav","sampleCount":35803,"rate":22050,"format":"adpcm","tags":["percussion","drums","music"]},{"name":"Toy Honk","md5":"67aadcd28620ecdcdee2ad8eeebefa20.wav","sampleCount":10726,"rate":22050,"format":"adpcm","tags":["wacky","effects","transportation"]},{"name":"Toy Zing","md5":"52cf0926d9bab8774194a37eba636c0e.wav","sampleCount":14103,"rate":22050,"format":"adpcm","tags":["effects"]},{"name":"Traffic","md5":"c983b482802b15a80983786019276c28.wav","sampleCount":141977,"rate":22050,"format":"adpcm","tags":["effects","transportation","ambience","background"]},{"name":"Train Whistle","md5":"50f29d0e028ec5c11210d0e2f91f83dd.wav","sampleCount":47594,"rate":22050,"format":"adpcm","tags":["effects","transportation"]},{"name":"Trap Beat","md5":"8c2ae70ee6a15c8d58004df7c4718de1.wav","sampleCount":147326,"rate":22050,"format":"","tags":["loops","music","electronic","EDM"]},{"name":"Triumph","md5":"072f4d9a3dfd2a082d50ff90ac7dc8f2.wav","sampleCount":89280,"rate":22050,"format":"adpcm","tags":["loops","music","dramatic","win"]},{"name":"Tropical Birds","md5":"18e5a88512296cd96417449496bd8711.wav","sampleCount":546917,"rate":22050,"format":"adpcm","tags":["animals","background","ambience"]},{"name":"Trumpet1","md5":"851c9e2c38e5e71922231a8f64c37e70.wav","sampleCount":25800,"rate":11025,"format":"","tags":["notes","music","instruments"]},{"name":"Trumpet2","md5":"dd73f891deca0241b800ed203408b6f3.wav","sampleCount":23424,"rate":11025,"format":"","tags":["notes","music","instruments"]},{"name":"Video Game 1","md5":"fc6e9cc9ba13c7e4ebb1af6cd7c90c49.wav","sampleCount":171419,"rate":22050,"format":"adpcm","tags":["loops","music","8bit","8-bit","electronic"]},{"name":"Video Game 2","md5":"287c477da485506c5b4ce37c57a64b5f.wav","sampleCount":150479,"rate":22050,"format":"adpcm","tags":["loops","music","games","electronic"]},{"name":"Wah Beatbox","md5":"9021b7bb06f2399f18e2db4fb87095dc.wav","sampleCount":6624,"rate":22050,"format":"","tags":[]},{"name":"Wand","md5":"d182adef7a68a5f38f1c78ab7d5afd6a.wav","sampleCount":47447,"rate":22050,"format":"adpcm","tags":["effects","fantasy"]},{"name":"Water Drop","md5":"e133e625fd367d269e76964d4b722fc2.wav","sampleCount":15131,"rate":22050,"format":"adpcm","tags":["effects"]},{"name":"Whinny","md5":"f9513bacf2fc665de05a8dd9bcb88117.wav","sampleCount":46108,"rate":22050,"format":"adpcm","tags":["animals","horse"]},{"name":"Whistle Thump","md5":"a3fab5681aedaa678982173ed9ca3d36.wav","sampleCount":14441,"rate":22050,"format":"adpcm","tags":["wacky","effects","cartoon"]},{"name":"Whiz","md5":"d790e1887515deb4097f0946fbf597ad.wav","sampleCount":19243,"rate":22050,"format":"adpcm","tags":["wacky","effects","cartoon"]},{"name":"Whoop","md5":"fbbbb76a2f53dae6ff1cf61b41f66038.wav","sampleCount":54400,"rate":11025,"format":"","tags":["effects","electronic","space"]},{"name":"Win","md5":"db480f6d5ae6d494dbb76ffb9bd995d5.wav","sampleCount":44771,"rate":22050,"format":"adpcm","tags":["effects","electronic","games"]},{"name":"Wobble","md5":"9913a64bfb5cfa6bb30ec24002cce56b.wav","sampleCount":39950,"rate":22050,"format":"adpcm","tags":["wacky","effects","cartoon"]},{"name":"Wolf Howl","md5":"5e36d74bb16aa5085b901362788b0fbf.wav","sampleCount":43008,"rate":11025,"format":"","tags":[]},{"name":"Wood Tap","md5":"de5b41c7080396986873d97e9e47acf6.wav","sampleCount":2729,"rate":22050,"format":"adpcm","tags":["effects"]},{"name":"Wub Beatbox","md5":"e1f32c057411da4237181ce72ae15d23.wav","sampleCount":7392,"rate":22050,"format":"","tags":[]},{"name":"Xylo1","md5":"6ac484e97c1c1fe1384642e26a125e70.wav","sampleCount":238232,"rate":22050,"format":"adpcm","tags":["music","loops"]},{"name":"Xylo2","md5":"d38fc904a0acfc27854baf7335ed46f9.wav","sampleCount":246552,"rate":22050,"format":"adpcm","tags":["music","loops"]},{"name":"Xylo3","md5":"786a7a66e96c801ca2efed59b20bf025.wav","sampleCount":208832,"rate":22050,"format":"adpcm","tags":["music","loops"]},{"name":"Xylo4","md5":"b3ee7b6515eaf85aebab3c624c1423e9.wav","sampleCount":77184,"rate":22050,"format":"adpcm","tags":["music","loops"]},{"name":"Ya","md5":"30987bbe464eb8db1e4c781dc238f81c.wav","sampleCount":5691,"rate":11025,"format":"","tags":["voice","hiphop"]},{"name":"Zip","md5":"c5f35ef67ab1baccdd3b7df87b329d99.wav","sampleCount":10467,"rate":22050,"format":"adpcm","tags":["wacky","human"]},{"name":"Zoop","md5":"01f5372ddac43001a2db4c82d71f37bb.wav","sampleCount":2764,"rate":11025,"format":"","tags":["effects","electronic","space"]}]; /***/ }), /***/ "./src/lib/libraries/sprite-tags.js": /*!******************************************!*\ !*** ./src/lib/libraries/sprite-tags.js ***! \******************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./tag-messages.js */ "./src/lib/libraries/tag-messages.js"); /* harmony default export */ __webpack_exports__["default"] = ([{ tag: 'animals', intlLabel: _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__["default"].animals }, { tag: 'people', intlLabel: _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__["default"].people }, { tag: 'fantasy', intlLabel: _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__["default"].fantasy }, { tag: 'dance', intlLabel: _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__["default"].dance }, { tag: 'music', intlLabel: _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__["default"].music }, { tag: 'sports', intlLabel: _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__["default"].sports }, { tag: 'food', intlLabel: _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__["default"].food }, { tag: 'fashion', intlLabel: _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__["default"].fashion }, { tag: 'letters', intlLabel: _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__["default"].letters }]); /***/ }), /***/ "./src/lib/libraries/sprites.json": /*!****************************************!*\ !*** ./src/lib/libraries/sprites.json ***! \****************************************/ /*! exports provided: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, default */ /***/ (function(module) { module.exports = [{"name":"Abby","md5":"afab2d2141e9811bd89e385e9628cb5f.svg","type":"sprite","tags":["people","person","drawing"],"info":[0,4,1],"json":{"objName":"Abby","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"abby-a","baseLayerID":-1,"baseLayerMD5":"afab2d2141e9811bd89e385e9628cb5f.svg","bitmapResolution":1,"rotationCenterX":31,"rotationCenterY":100},{"costumeName":"abby-b","baseLayerID":-1,"baseLayerMD5":"1e0116c7c2e5e80c679d0b33f1f5cfb7.svg","bitmapResolution":1,"rotationCenterX":31,"rotationCenterY":100},{"costumeName":"abby-c","baseLayerID":-1,"baseLayerMD5":"b6e23922f23b49ddc6f62f675e77417c.svg","bitmapResolution":1,"rotationCenterX":32,"rotationCenterY":100},{"costumeName":"abby-d","baseLayerID":-1,"baseLayerMD5":"2d05d4da65e7b5009a491d8153d37253.svg","bitmapResolution":1,"rotationCenterX":32,"rotationCenterY":101}],"currentCostumeIndex":0,"scratchX":-20,"scratchY":-38,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Amon","md5":"60f720956ab1840431dcf0616ce98f14.png","type":"sprite","tags":["people","dance"],"info":[0,1,1],"json":{"objName":"Amon","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"amon","baseLayerID":-1,"baseLayerMD5":"60f720956ab1840431dcf0616ce98f14.png","bitmapResolution":2,"rotationCenterX":174,"rotationCenterY":162}],"currentCostumeIndex":0,"scratchX":-79,"scratchY":11,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Andie","md5":"419ff5a76adbb4b076c072f68267fdeb.svg","type":"sprite","tags":["sports","basketball","people","wheelchair","handicap","handicapable","alex eben meyer"],"info":[0,4,1],"json":{"objName":"Andie","sounds":[{"soundName":"basketball bounce","soundID":-1,"md5":"1727f65b5f22d151685b8e5917456a60.wav","sampleCount":8099,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"andie-a","baseLayerID":0,"baseLayerMD5":"419ff5a76adbb4b076c072f68267fdeb.svg","bitmapResolution":1,"rotationCenterX":86,"rotationCenterY":81},{"costumeName":"andie-b","baseLayerID":-1,"baseLayerMD5":"a6a766912b4e43064ee3f389c72925b4.svg","bitmapResolution":1,"rotationCenterX":46,"rotationCenterY":106},{"costumeName":"andie-c","baseLayerID":-1,"baseLayerMD5":"fac1025857d2c28391cb31f39a80df54.svg","bitmapResolution":1,"rotationCenterX":52,"rotationCenterY":65},{"costumeName":"andie-d","baseLayerID":-1,"baseLayerMD5":"7af50835e05d43e5e07cd2d641e7401e.svg","bitmapResolution":1,"rotationCenterX":87,"rotationCenterY":72}],"currentCostumeIndex":0,"scratchX":-129,"scratchY":-73,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Anina Dance","md5":"84c5e22b4303c7c1fb707125706c9aaa.png","type":"sprite","tags":["people","dance"],"info":[0,13,2],"json":{"objName":"Anina Dance","sounds":[{"soundName":"dance celebrate","soundID":-1,"md5":"0edb8fb88af19e6e17d0f8cf64c1d136.wav","sampleCount":176401,"rate":22050,"format":"adpcm"},{"soundName":"dance magic","soundID":-1,"md5":"042309f190183383c0b1c1fc3edc2e84.wav","sampleCount":187200,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"anina stance","baseLayerID":-1,"baseLayerMD5":"84c5e22b4303c7c1fb707125706c9aaa.png","bitmapResolution":2,"rotationCenterX":76,"rotationCenterY":252},{"costumeName":"anina top stand","baseLayerID":-1,"baseLayerMD5":"db6c03113f71b91f22a9f3351f90e5bf.png","bitmapResolution":2,"rotationCenterX":74,"rotationCenterY":280},{"costumeName":"anina top R step","baseLayerID":-1,"baseLayerMD5":"2d208a34e74fdce9dab9d4c585dcfa2b.png","bitmapResolution":2,"rotationCenterX":248,"rotationCenterY":272},{"costumeName":"anina top L step","baseLayerID":-1,"baseLayerMD5":"ed90e8b7a05c1552194af597ac0637cd.png","bitmapResolution":2,"rotationCenterX":228,"rotationCenterY":274},{"costumeName":"anina top freeze","baseLayerID":-1,"baseLayerMD5":"b7693bd6250d4411ee622b67f8025924.png","bitmapResolution":2,"rotationCenterX":110,"rotationCenterY":268},{"costumeName":"anina R cross","baseLayerID":-1,"baseLayerMD5":"3948aad16f8169c013c956dd152a09a6.png","bitmapResolution":2,"rotationCenterX":126,"rotationCenterY":268},{"costumeName":"anina pop front","baseLayerID":-1,"baseLayerMD5":"4931a363e3e4efa20230f6ff2991c6b4.png","bitmapResolution":2,"rotationCenterX":68,"rotationCenterY":270},{"costumeName":"anina pop down","baseLayerID":-1,"baseLayerMD5":"e3698b76cb0864df2fbaba80e6bd8067.png","bitmapResolution":2,"rotationCenterX":74,"rotationCenterY":156},{"costumeName":"anina pop left","baseLayerID":-1,"baseLayerMD5":"d86bb27b4f8d7b70c39c96f29c6943b4.png","bitmapResolution":2,"rotationCenterX":238,"rotationCenterY":266},{"costumeName":"anina pop right","baseLayerID":-1,"baseLayerMD5":"7bb9c790b02231e1272701167c26b17a.png","bitmapResolution":2,"rotationCenterX":66,"rotationCenterY":268},{"costumeName":"anina pop L arm","baseLayerID":-1,"baseLayerMD5":"62c50c90535b64f2ae130a5c680ddcb4.png","bitmapResolution":2,"rotationCenterX":68,"rotationCenterY":274},{"costumeName":"anina pop stand","baseLayerID":-1,"baseLayerMD5":"105f4f3d260dcb8bea02ea9ee5d18cf4.png","bitmapResolution":2,"rotationCenterX":76,"rotationCenterY":276},{"costumeName":"anina pop R arm","baseLayerID":-1,"baseLayerMD5":"ca27e001a263ee6b5852508f39d021db.png","bitmapResolution":2,"rotationCenterX":88,"rotationCenterY":272}],"currentCostumeIndex":0,"scratchX":-27,"scratchY":1,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Apple","md5":"831ccd4741a7a56d85f6698a21f4ca69.svg","type":"sprite","tags":["food","red","crunchy","fruit"],"info":[0,1,1],"json":{"objName":"Apple","sounds":[{"soundName":"Chomp","soundID":-1,"md5":"0b1e3033140d094563248e61de4039e5.wav","sampleCount":2912,"rate":11025,"format":""}],"costumes":[{"costumeName":"apple","baseLayerID":-1,"baseLayerMD5":"831ccd4741a7a56d85f6698a21f4ca69.svg","bitmapResolution":1,"rotationCenterX":31,"rotationCenterY":31}],"currentCostumeIndex":0,"scratchX":93,"scratchY":-23,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Arrow1","md5":"62f8794dd120e9b4ead4d098d50fc64b.svg","type":"sprite","tags":["icons","symbols","game","right"],"info":[0,4,1],"json":{"objName":"Arrow1","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"arrow1-a","baseLayerID":-1,"baseLayerMD5":"62f8794dd120e9b4ead4d098d50fc64b.svg","bitmapResolution":1,"rotationCenterX":28,"rotationCenterY":23},{"costumeName":"arrow1-b","baseLayerID":-1,"baseLayerMD5":"a157dc7e33d7c7a048af933de999e397.svg","bitmapResolution":1,"rotationCenterX":28,"rotationCenterY":23},{"costumeName":"arrow1-c","baseLayerID":-1,"baseLayerMD5":"d3b389e91f7beb22b2b1a80af09990ee.svg","bitmapResolution":1,"rotationCenterX":23,"rotationCenterY":28},{"costumeName":"arrow1-d","baseLayerID":-1,"baseLayerMD5":"412717ff731e9f19003a5840054057eb.svg","bitmapResolution":1,"rotationCenterX":23,"rotationCenterY":28}],"currentCostumeIndex":0,"scratchX":-36,"scratchY":-14,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Avery","md5":"21393c9114c7d34b1df7ccd12c793672.svg","type":"sprite","tags":["people"],"info":[0,2,1],"json":{"objName":"Avery","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"avery-a","baseLayerID":-1,"baseLayerMD5":"21393c9114c7d34b1df7ccd12c793672.svg","bitmapResolution":1,"rotationCenterX":39,"rotationCenterY":94},{"costumeName":"avery-b","baseLayerID":-1,"baseLayerMD5":"cc55f2f09599edc4ae0876e8b3d187d0.svg","bitmapResolution":1,"rotationCenterX":39,"rotationCenterY":94}],"currentCostumeIndex":0,"scratchX":-171,"scratchY":-76,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Avery Walking","md5":"ed334e546806dfbf26d2591d7ddb12d0.svg","type":"sprite","tags":["people","walking"],"info":[0,4,1],"json":{"objName":"Avery Walking","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"avery walking-a","baseLayerID":-1,"baseLayerMD5":"ed334e546806dfbf26d2591d7ddb12d0.svg","bitmapResolution":1,"rotationCenterX":50,"rotationCenterY":95},{"costumeName":"avery walking-b","baseLayerID":-1,"baseLayerMD5":"c295731e8666ad2e1575fb4b4f82988d.svg","bitmapResolution":1,"rotationCenterX":50,"rotationCenterY":102},{"costumeName":"avery walking-c","baseLayerID":-1,"baseLayerMD5":"597a834225c9949e419dff7db1bc2453.svg","bitmapResolution":1,"rotationCenterX":48,"rotationCenterY":95},{"costumeName":"avery walking-d","baseLayerID":-1,"baseLayerMD5":"ce9622d11d24607eec7988196b38c3c6.svg","bitmapResolution":1,"rotationCenterX":50,"rotationCenterY":101}],"currentCostumeIndex":0,"scratchX":-177,"scratchY":76,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Ball","md5":"10117ddaefa98d819f2b1df93805622f.svg","type":"sprite","tags":["round","game","bounce","circle","yellow","blue","pink","green","purple","things"],"info":[0,5,2],"json":{"objName":"Ball","sounds":[{"soundName":"Boing","soundID":-1,"md5":"53a3c2e27d1fb5fdb14aaf0cb41e7889.wav","sampleCount":6804,"rate":22050,"format":"adpcm"},{"soundName":"Pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"ball-a","baseLayerID":-1,"baseLayerMD5":"10117ddaefa98d819f2b1df93805622f.svg","bitmapResolution":1,"rotationCenterX":22,"rotationCenterY":22},{"costumeName":"ball-b","baseLayerID":-1,"baseLayerMD5":"6e6330cad7750ea7e9dc88402661deb8.svg","bitmapResolution":1,"rotationCenterX":22,"rotationCenterY":22},{"costumeName":"ball-c","baseLayerID":-1,"baseLayerMD5":"bb45ed5db278f15c17c012c34a6b160f.svg","bitmapResolution":1,"rotationCenterX":22,"rotationCenterY":22},{"costumeName":"ball-d","baseLayerID":-1,"baseLayerMD5":"5d494659deae5c0de06b5885f5524276.svg","bitmapResolution":1,"rotationCenterX":22,"rotationCenterY":22},{"costumeName":"ball-e","baseLayerID":-1,"baseLayerMD5":"e80c98bc62fd32e8df81642af11ffb1a.svg","bitmapResolution":1,"rotationCenterX":22,"rotationCenterY":22}],"currentCostumeIndex":0,"scratchX":-38,"scratchY":-24,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Ballerina","md5":"6051bb7008cf17c8853a6f81f04c8a0f.svg","type":"sprite","tags":["people","dance"],"info":[0,4,1],"json":{"objName":"Ballerina","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"ballerina-a","baseLayerID":-1,"baseLayerMD5":"6051bb7008cf17c8853a6f81f04c8a0f.svg","bitmapResolution":1,"rotationCenterX":75,"rotationCenterY":75},{"costumeName":"ballerina-b","baseLayerID":-1,"baseLayerMD5":"8bc5e47fb1439e29e11e9e3f2e20c6de.svg","bitmapResolution":1,"rotationCenterX":75,"rotationCenterY":75},{"costumeName":"ballerina-c","baseLayerID":-1,"baseLayerMD5":"6d3a07761b294f705987b0af58f8e335.svg","bitmapResolution":1,"rotationCenterX":75,"rotationCenterY":75},{"costumeName":"ballerina-d","baseLayerID":-1,"baseLayerMD5":"c3164795edf39e436272f425b4f5e487.svg","bitmapResolution":1,"rotationCenterX":75,"rotationCenterY":75}],"currentCostumeIndex":0,"scratchX":-19,"scratchY":-7,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Balloon1","md5":"bc96a1fb5fe794377acd44807e421ce2.svg","type":"sprite","tags":["party","pop","flying","helium","blue","yellow","purple","things"],"info":[0,3,1],"json":{"objName":"Balloon1","sounds":[{"soundName":"Pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"balloon1-a","baseLayerID":-1,"baseLayerMD5":"bc96a1fb5fe794377acd44807e421ce2.svg","bitmapResolution":1,"rotationCenterX":32,"rotationCenterY":94},{"costumeName":"balloon1-b","baseLayerID":-1,"baseLayerMD5":"d7bb51d9c38af6314bd2b4058d2a592d.svg","bitmapResolution":1,"rotationCenterX":31,"rotationCenterY":94},{"costumeName":"balloon1-c","baseLayerID":-1,"baseLayerMD5":"247cef27b665d77d9efaca69327cae77.svg","bitmapResolution":1,"rotationCenterX":31,"rotationCenterY":94}],"currentCostumeIndex":0,"scratchX":-69,"scratchY":41,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Bananas","md5":"1a76b68e056954f5c8ac1f073df1533d.svg","type":"sprite","tags":["food","yellow","mushy","potassium","fruit"],"info":[0,1,2],"json":{"objName":"Bananas","sounds":[{"soundName":"Chomp","soundID":-1,"md5":"0b1e3033140d094563248e61de4039e5.wav","sampleCount":2912,"rate":11025,"format":""},{"soundName":"Bite","soundID":-1,"md5":"0039635b1d6853face36581784558454.wav","sampleCount":7672,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"bananas","baseLayerID":-1,"baseLayerMD5":"1a76b68e056954f5c8ac1f073df1533d.svg","bitmapResolution":1,"rotationCenterX":39,"rotationCenterY":38}],"currentCostumeIndex":0,"scratchX":83,"scratchY":-45,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Baseball","md5":"838dc2b2278619d3a9beefc6c8072a08.svg","type":"sprite","tags":["baseball","sports","ball","alex eben meyer"],"info":[0,1,1],"json":{"objName":"Baseball","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"baseball","baseLayerID":-1,"baseLayerMD5":"838dc2b2278619d3a9beefc6c8072a08.svg","bitmapResolution":1,"rotationCenterX":28,"rotationCenterY":28}],"currentCostumeIndex":0,"scratchX":173,"scratchY":-89,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Basketball","md5":"482f04cbffa835c4abf29ab996d3fbbd.svg","type":"sprite","tags":["sports","basketball","alex eben meyer"],"info":[0,1,2],"json":{"objName":"Basketball","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""},{"soundName":"basketball bounce","soundID":-1,"md5":"1727f65b5f22d151685b8e5917456a60.wav","sampleCount":8099,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"basketball","baseLayerID":-1,"baseLayerMD5":"482f04cbffa835c4abf29ab996d3fbbd.svg","bitmapResolution":1,"rotationCenterX":23,"rotationCenterY":23}],"currentCostumeIndex":0,"scratchX":202,"scratchY":-108,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Bat","md5":"75bf9a5c5ec7dc9325a0301b6f6e72dd.svg","type":"sprite","tags":["fantasy","spooky","halloween","bat","animals","alex eben meyer"],"info":[0,4,1],"json":{"objName":"Bat","sounds":[{"soundName":"owl","soundID":-1,"md5":"e8b6d605f5a1bb36c29e4e21ef754209.wav","sampleCount":8111,"rate":11025,"format":""}],"costumes":[{"costumeName":"bat-a","baseLayerID":-1,"baseLayerMD5":"75bf9a5c5ec7dc9325a0301b6f6e72dd.svg","bitmapResolution":1,"rotationCenterX":80,"rotationCenterY":60},{"costumeName":"bat-b","baseLayerID":-1,"baseLayerMD5":"b92d4967a0c233b0e78d6e834653f846.svg","bitmapResolution":1,"rotationCenterX":39,"rotationCenterY":61},{"costumeName":"bat-c","baseLayerID":-1,"baseLayerMD5":"56b1458bd81b8ac2401c216f7352343c.svg","bitmapResolution":1,"rotationCenterX":68,"rotationCenterY":66},{"costumeName":"bat-d","baseLayerID":-1,"baseLayerMD5":"7f806f928a192aab0b0d03aa96a89a67.svg","bitmapResolution":1,"rotationCenterX":29,"rotationCenterY":62}],"currentCostumeIndex":0,"scratchX":-81,"scratchY":107,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Batter","md5":"f7357c4cef5f31c6460e4f69dd0adabb.svg","type":"sprite","tags":["baseball","sports","people","alex eben meyer"],"info":[0,4,1],"json":{"objName":"Batter","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"batter-a","baseLayerID":-1,"baseLayerMD5":"f7357c4cef5f31c6460e4f69dd0adabb.svg","bitmapResolution":1,"rotationCenterX":46,"rotationCenterY":80},{"costumeName":"batter-b","baseLayerID":-1,"baseLayerMD5":"c60fe1da0dcddedfd152384c60cbd5cc.svg","bitmapResolution":1,"rotationCenterX":16,"rotationCenterY":67},{"costumeName":"batter-c","baseLayerID":-1,"baseLayerMD5":"165c30e123e785d4cbbc0d9621f1c349.svg","bitmapResolution":1,"rotationCenterX":94,"rotationCenterY":66},{"costumeName":"batter-d","baseLayerID":-1,"baseLayerMD5":"e82529d9c31b56a3dd098ccc94be68a6.svg","bitmapResolution":1,"rotationCenterX":70,"rotationCenterY":102}],"currentCostumeIndex":0,"scratchX":121,"scratchY":70,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Beachball","md5":"87d64cab74c64b31498cc85f07510ee4.svg","type":"sprite","tags":["round","sports","bounce","inflatable"],"info":[0,1,2],"json":{"objName":"Beachball","sounds":[{"soundName":"Basketball Bounce","soundID":-1,"md5":"1727f65b5f22d151685b8e5917456a60.wav","sampleCount":8099,"rate":22050,"format":"adpcm"},{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"beachball","baseLayerID":-1,"baseLayerMD5":"87d64cab74c64b31498cc85f07510ee4.svg","bitmapResolution":1,"rotationCenterX":34,"rotationCenterY":33}],"currentCostumeIndex":0,"scratchX":-83,"scratchY":-24,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Bear","md5":"5a4148d7684fc95f38c58a1672062c9e.svg","type":"sprite","tags":["animals","ipzy","walking"],"info":[0,2,1],"json":{"objName":"Bear","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"bear-a","baseLayerID":-1,"baseLayerMD5":"5a4148d7684fc95f38c58a1672062c9e.svg","bitmapResolution":1,"rotationCenterX":100,"rotationCenterY":90},{"costumeName":"bear-b","baseLayerID":-1,"baseLayerMD5":"92a64ce184c8515217e0e98e49624622.svg","bitmapResolution":1,"rotationCenterX":94,"rotationCenterY":191}],"currentCostumeIndex":0,"scratchX":6,"scratchY":-18,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Bear-walking","md5":"d15eddb1a0f0ff0fa867bc006b46685d.svg","type":"sprite","tags":["animals","ipzy","walking"],"info":[0,8,1],"json":{"objName":"Bear-walking","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"bear-walk-a","baseLayerID":-1,"baseLayerMD5":"d15eddb1a0f0ff0fa867bc006b46685d.svg","bitmapResolution":1,"rotationCenterX":130,"rotationCenterY":94},{"costumeName":"bear-walk-b","baseLayerID":-1,"baseLayerMD5":"06e3f1bcf4f46b83df3820d92430f202.svg","bitmapResolution":1,"rotationCenterX":130,"rotationCenterY":94},{"costumeName":"bear-walk-c","baseLayerID":-1,"baseLayerMD5":"13a3584040c9903b1824bb249d7f8a0e.svg","bitmapResolution":1,"rotationCenterX":130,"rotationCenterY":94},{"costumeName":"bear-walk-d","baseLayerID":-1,"baseLayerMD5":"c5d49a105619c497be45a5d2c43a740a.svg","bitmapResolution":1,"rotationCenterX":130,"rotationCenterY":94},{"costumeName":"bear-walk-e","baseLayerID":-1,"baseLayerMD5":"ece252d79c2d30c647c43c58986d9671.svg","bitmapResolution":1,"rotationCenterX":130,"rotationCenterY":94},{"costumeName":"bear-walk-f","baseLayerID":-1,"baseLayerMD5":"ff66b87efec0e647dc30ec58df168ec4.svg","bitmapResolution":1,"rotationCenterX":130,"rotationCenterY":94},{"costumeName":"bear-walk-g","baseLayerID":-1,"baseLayerMD5":"d1404b12adf0d6b1b881f0dca47ce21a.svg","bitmapResolution":1,"rotationCenterX":130,"rotationCenterY":94},{"costumeName":"bear-walk-h","baseLayerID":-1,"baseLayerMD5":"489055be58a7d9806e1d50455c88c399.svg","bitmapResolution":1,"rotationCenterX":130,"rotationCenterY":94}],"currentCostumeIndex":0,"scratchX":-13,"scratchY":-35,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Beetle","md5":"e1ce8f153f011fdd52486c91c6ed594d.svg","type":"sprite","tags":["animals","insect","bug","antennae"],"info":[0,1,1],"json":{"objName":"Beetle","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"beetle","baseLayerID":-1,"baseLayerMD5":"e1ce8f153f011fdd52486c91c6ed594d.svg","bitmapResolution":1,"rotationCenterX":43,"rotationCenterY":38}],"currentCostumeIndex":0,"scratchX":77,"scratchY":-42,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Bell","md5":"f35056c772395455d703773657e1da6e.svg","type":"sprite","tags":["music","holiday","ring","things"],"info":[0,1,2],"json":{"objName":"Bell","sounds":[{"soundName":"xylo1","soundID":-1,"md5":"6ac484e97c1c1fe1384642e26a125e70.wav","sampleCount":238232,"rate":22050,"format":"adpcm"},{"soundName":"bell toll","soundID":-1,"md5":"25d61e79cbeba4041eebeaebd7bf9598.wav","sampleCount":45168,"rate":11025,"format":""}],"costumes":[{"costumeName":"bell1","baseLayerID":-1,"baseLayerMD5":"f35056c772395455d703773657e1da6e.svg","bitmapResolution":1,"rotationCenterX":59,"rotationCenterY":69}],"currentCostumeIndex":0,"scratchX":96,"scratchY":8,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Ben","md5":"4386d05d5abd6e1aa0a93b7b447d1b39.svg","type":"sprite","tags":["sports","soccer","football","people","alex eben meyer"],"info":[0,4,2],"json":{"objName":"Ben","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""},{"soundName":"basketball bounce","soundID":-1,"md5":"1727f65b5f22d151685b8e5917456a60.wav","sampleCount":8099,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"ben-a","baseLayerID":-1,"baseLayerMD5":"4386d05d5abd6e1aa0a93b7b447d1b39.svg","bitmapResolution":1,"rotationCenterX":53,"rotationCenterY":69},{"costumeName":"ben-b","baseLayerID":-1,"baseLayerMD5":"90db137cd0743204d02fdc9be1c8eb94.svg","bitmapResolution":1,"rotationCenterX":53,"rotationCenterY":67},{"costumeName":"ben-c","baseLayerID":-1,"baseLayerMD5":"5f05d41ede773b3bb379286e86a5b869.svg","bitmapResolution":1,"rotationCenterX":71,"rotationCenterY":72},{"costumeName":"ben-d","baseLayerID":-1,"baseLayerMD5":"6f6e246567c0639c758ed4f6930be76f.svg","bitmapResolution":1,"rotationCenterX":42,"rotationCenterY":72}],"currentCostumeIndex":0,"scratchX":-63,"scratchY":-94,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Bowl","md5":"86f616639846f06fef29931e6b9b59de.svg","type":"sprite","tags":["thing","food"],"info":[0,1,1],"json":{"objName":"Bowl","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"bowl-a","baseLayerID":-1,"baseLayerMD5":"86f616639846f06fef29931e6b9b59de.svg","bitmapResolution":1,"rotationCenterX":30,"rotationCenterY":15}],"currentCostumeIndex":0,"scratchX":17,"scratchY":18,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Bowtie","md5":"7d876f3ba4b04f3193a701ed30b4490c.svg","type":"sprite","tags":["fashion","clothing","bowtie"],"info":[0,1,1],"json":{"objName":"Bowtie","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"bowtie","baseLayerID":-1,"baseLayerMD5":"7d876f3ba4b04f3193a701ed30b4490c.svg","bitmapResolution":1,"rotationCenterX":15,"rotationCenterY":8}],"currentCostumeIndex":0,"scratchX":-65,"scratchY":58,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Bread","md5":"68366160ce0ac1221cdde4455eca9cba.svg","type":"sprite","tags":["food","ipzy"],"info":[0,1,1],"json":{"objName":"Bread","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"bread","baseLayerID":-1,"baseLayerMD5":"68366160ce0ac1221cdde4455eca9cba.svg","bitmapResolution":1,"rotationCenterX":37,"rotationCenterY":12}],"currentCostumeIndex":0,"scratchX":6,"scratchY":49,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Broom","md5":"836197f784bc4c4decfb1a5a60ca6c56.svg","type":"sprite","tags":["fantasy","ipzy","flying","things"],"info":[0,1,1],"json":{"objName":"Broom","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"broom","baseLayerID":-1,"baseLayerMD5":"836197f784bc4c4decfb1a5a60ca6c56.svg","bitmapResolution":1,"rotationCenterX":135,"rotationCenterY":25}],"currentCostumeIndex":0,"scratchX":-14,"scratchY":-59,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Buildings","md5":"d713270e235851e5962becd73a951771.svg","type":"sprite","tags":["things","city","flying","architecture"],"info":[0,10,1],"json":{"objName":"Buildings","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"building-a","baseLayerID":-1,"baseLayerMD5":"d713270e235851e5962becd73a951771.svg","bitmapResolution":1,"rotationCenterX":40,"rotationCenterY":30},{"costumeName":"building-b","baseLayerID":-1,"baseLayerMD5":"8c2d59c50a97d33b096f629258f02be6.svg","bitmapResolution":1,"rotationCenterX":46,"rotationCenterY":-11},{"costumeName":"building-c","baseLayerID":-1,"baseLayerMD5":"7f3f51f495c39809bed95991dfa1f80d.svg","bitmapResolution":1,"rotationCenterX":25,"rotationCenterY":17},{"costumeName":"building-d","baseLayerID":-1,"baseLayerMD5":"bbe68ab80b36e4c71f4e28414c7f781e.svg","bitmapResolution":1,"rotationCenterX":59,"rotationCenterY":-10},{"costumeName":"building-e","baseLayerID":-1,"baseLayerMD5":"1beeb8f034a1128c9a799297b0b7fc26.svg","bitmapResolution":1,"rotationCenterX":36,"rotationCenterY":55},{"costumeName":"building-f","baseLayerID":-1,"baseLayerMD5":"451e0a565e95d945fe2addfe609ee9df.svg","bitmapResolution":1,"rotationCenterX":41,"rotationCenterY":27},{"costumeName":"building-g","baseLayerID":-1,"baseLayerMD5":"58b3c9b7a41dde698fa2b427b502c1fa.svg","bitmapResolution":1,"rotationCenterX":64,"rotationCenterY":-65},{"costumeName":"building-h","baseLayerID":-1,"baseLayerMD5":"e952c8b14eeac894302d07d37a45ed99.svg","bitmapResolution":1,"rotationCenterX":33,"rotationCenterY":136},{"costumeName":"building-i","baseLayerID":-1,"baseLayerMD5":"b00b1123e3bfcb600242528d059ffcfb.svg","bitmapResolution":1,"rotationCenterX":31,"rotationCenterY":-12},{"costumeName":"building-j","baseLayerID":-1,"baseLayerMD5":"e08fd1a7397efcfe0e3691f945693cb4.svg","bitmapResolution":1,"rotationCenterX":29,"rotationCenterY":33}],"currentCostumeIndex":0,"scratchX":4,"scratchY":-24,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Butterfly 1","md5":"8419d4851defd1e862e4f7c1699d2190.svg","type":"sprite","tags":["animals","insect","bug","wetland","owen davey"],"info":[0,3,1],"json":{"objName":"Butterfly 1","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"butterfly1-a","baseLayerID":-1,"baseLayerMD5":"8419d4851defd1e862e4f7c1699d2190.svg","bitmapResolution":1,"rotationCenterX":65,"rotationCenterY":49},{"costumeName":"butterfly1-b","baseLayerID":-1,"baseLayerMD5":"0873714e8d55d9eeb0bc8e8ab64441cc.svg","bitmapResolution":1,"rotationCenterX":65,"rotationCenterY":49},{"costumeName":"butterfly1-c","baseLayerID":-1,"baseLayerMD5":"9c422631ca8d46413487f5dd627b65c6.svg","bitmapResolution":1,"rotationCenterX":65,"rotationCenterY":49}],"currentCostumeIndex":0,"scratchX":-107,"scratchY":104,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Butterfly 2","md5":"836d4cc7889f4a1cbcb0303934f31f79.svg","type":"sprite","tags":["animals","drawing","happy","bug","insect","antennae","flappers"],"info":[0,2,1],"json":{"objName":"Butterfly 2","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"butterfly2-a","baseLayerID":-1,"baseLayerMD5":"836d4cc7889f4a1cbcb0303934f31f79.svg","bitmapResolution":1,"rotationCenterX":75,"rotationCenterY":75},{"costumeName":"butterfly2-b","baseLayerID":-1,"baseLayerMD5":"55dd0671a359d7c35f7b78f4176660e8.svg","bitmapResolution":1,"rotationCenterX":75,"rotationCenterY":75}],"currentCostumeIndex":0,"scratchX":-98,"scratchY":-16,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Button1","md5":"7ef67c5bc8cf7df64fdb3b1d6b250f71.svg","type":"sprite","tags":["icons","round","green","games"],"info":[0,1,1],"json":{"objName":"Button1","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"button1","baseLayerID":-1,"baseLayerMD5":"7ef67c5bc8cf7df64fdb3b1d6b250f71.svg","bitmapResolution":1,"rotationCenterX":72,"rotationCenterY":72}],"currentCostumeIndex":0,"scratchX":-22,"scratchY":-30,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Button2","md5":"c0051ff23e9aae78295964206793c1e3.svg","type":"sprite","tags":["icons","blue","games"],"info":[0,2,1],"json":{"objName":"Button2","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"button2-a","baseLayerID":-1,"baseLayerMD5":"c0051ff23e9aae78295964206793c1e3.svg","bitmapResolution":1,"rotationCenterX":72,"rotationCenterY":72},{"costumeName":"button2-b","baseLayerID":-1,"baseLayerMD5":"712a561dc0ad66e348b8247e566b50ef.svg","bitmapResolution":1,"rotationCenterX":72,"rotationCenterY":72}],"currentCostumeIndex":0,"scratchX":-27,"scratchY":-16,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Button3","md5":"ffb2a9c21084c58fdb677c8d12a97519.svg","type":"sprite","tags":["icons","gray","blue","games"],"info":[0,2,1],"json":{"objName":"Button3","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"button3-a","baseLayerID":-1,"baseLayerMD5":"ffb2a9c21084c58fdb677c8d12a97519.svg","bitmapResolution":1,"rotationCenterX":72,"rotationCenterY":72},{"costumeName":"button3-b","baseLayerID":-1,"baseLayerMD5":"7a9ccb55e4da36f48811ab125d2492e0.svg","bitmapResolution":1,"rotationCenterX":72,"rotationCenterY":72}],"currentCostumeIndex":0,"scratchX":-58,"scratchY":10,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Button4","md5":"ecfe263bc256349777e571eaf39761d4.svg","type":"sprite","tags":["icons","checkmark"],"info":[0,2,1],"json":{"objName":"Button4","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"button4-a","baseLayerID":-1,"baseLayerMD5":"ecfe263bc256349777e571eaf39761d4.svg","bitmapResolution":1,"rotationCenterX":35,"rotationCenterY":34},{"costumeName":"button4-b","baseLayerID":-1,"baseLayerMD5":"9c49edde00b80cd22d636a0577a9b1c9.svg","bitmapResolution":1,"rotationCenterX":35,"rotationCenterY":34}],"currentCostumeIndex":0,"scratchX":-32,"scratchY":48,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Button5","md5":"71e97245b7be4fd6fe3ba8cdeecadaf1.svg","type":"sprite","tags":["icons","symbols","x","red","black"],"info":[0,2,1],"json":{"objName":"Button5","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"button5-a","baseLayerID":-1,"baseLayerMD5":"71e97245b7be4fd6fe3ba8cdeecadaf1.svg","bitmapResolution":1,"rotationCenterX":72,"rotationCenterY":72},{"costumeName":"button5-b","baseLayerID":-1,"baseLayerMD5":"54cd55512f7571060e6e64168e541222.svg","bitmapResolution":1,"rotationCenterX":72,"rotationCenterY":72}],"currentCostumeIndex":0,"scratchX":37,"scratchY":37,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Cake","md5":"e1e8e8a765b8778d6181035c5c66984d.svg","type":"sprite","tags":["food","bakery","baking","frosting","sprinkles","sprankles","dragable","lie"],"info":[0,2,1],"json":{"objName":"Cake","sounds":[{"soundName":"Birthday","soundID":-1,"md5":"89691587a169d935a58c48c3d4e78534.wav","sampleCount":161408,"rate":22050,"format":""}],"costumes":[{"costumeName":"cake-a","baseLayerID":-1,"baseLayerMD5":"e1e8e8a765b8778d6181035c5c66984d.svg","bitmapResolution":1,"rotationCenterX":64,"rotationCenterY":50},{"costumeName":"cake-b","baseLayerID":-1,"baseLayerMD5":"460268a804e7682c9fabf37e4b70071c.svg","bitmapResolution":1,"rotationCenterX":64,"rotationCenterY":42}],"currentCostumeIndex":0,"scratchX":53,"scratchY":34,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Calvrett","md5":"452683db3ad7a882f5ab9de496441592.png","type":"sprite","tags":["people"],"info":[0,2,1],"json":{"objName":"Calvrett","sounds":[{"soundName":"dance chill out","soundID":-1,"md5":"b235da45581b1f212c9e9cce70d2a2dc.wav","sampleCount":222822,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"calvrett jumping","baseLayerID":-1,"baseLayerMD5":"452683db3ad7a882f5ab9de496441592.png","bitmapResolution":2,"rotationCenterX":168,"rotationCenterY":216},{"costumeName":"calvrett thinking","baseLayerID":-1,"baseLayerMD5":"728ec1ebc275b53809023a36c66eeaa3.png","bitmapResolution":2,"rotationCenterX":106,"rotationCenterY":170}],"currentCostumeIndex":0,"scratchX":39,"scratchY":-9,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Casey","md5":"b7269d70079e96299666cc7b3f8eabc3.svg","type":"sprite","tags":["sports","basketball","people","alex eben meyer"],"info":[0,4,1],"json":{"objName":"Casey","sounds":[{"soundName":"basketball bounce","soundID":-1,"md5":"1727f65b5f22d151685b8e5917456a60.wav","sampleCount":8099,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"casey-a","baseLayerID":-1,"baseLayerMD5":"b7269d70079e96299666cc7b3f8eabc3.svg","bitmapResolution":1,"rotationCenterX":75,"rotationCenterY":62},{"costumeName":"casey-b","baseLayerID":-1,"baseLayerMD5":"d22f6e818106f247f91e1c7c315863c3.svg","bitmapResolution":1,"rotationCenterX":60,"rotationCenterY":74},{"costumeName":"casey-c","baseLayerID":-1,"baseLayerMD5":"a6ea02408a3f8366dfd704aae9a6ed0b.svg","bitmapResolution":1,"rotationCenterX":57,"rotationCenterY":72},{"costumeName":"casey-d","baseLayerID":-1,"baseLayerMD5":"033ef301acfdfbc38774a14a559c1654.svg","bitmapResolution":1,"rotationCenterX":71,"rotationCenterY":74}],"currentCostumeIndex":0,"scratchX":-138,"scratchY":11,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Cassy Dance","md5":"6cb3686db1fa658b6541cc9fa3ccfcc7.png","type":"sprite","tags":["people","dance"],"info":[0,4,1],"json":{"objName":"Cassy Dance","sounds":[{"soundName":"dance around","soundID":-1,"md5":"8bcea76415eaf98ec1cbc3825845b934.wav","sampleCount":343746,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"cassy-a","baseLayerID":-1,"baseLayerMD5":"6cb3686db1fa658b6541cc9fa3ccfcc7.png","bitmapResolution":2,"rotationCenterX":104,"rotationCenterY":192},{"costumeName":"cassy-b","baseLayerID":-1,"baseLayerMD5":"f801cec764da5ef6374e1d557296d14e.png","bitmapResolution":2,"rotationCenterX":140,"rotationCenterY":192},{"costumeName":"cassy-c","baseLayerID":-1,"baseLayerMD5":"63483bbf72fc55719918a335e1a16426.png","bitmapResolution":2,"rotationCenterX":74,"rotationCenterY":188},{"costumeName":"cassy-d","baseLayerID":-1,"baseLayerMD5":"aca39a47cf3affd8a83d3287d2856c29.png","bitmapResolution":2,"rotationCenterX":94,"rotationCenterY":180}],"currentCostumeIndex":0,"scratchX":-88,"scratchY":44,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Cat","md5":"b7853f557e4426412e64bb3da6531a99.svg","type":"sprite","tags":["animals","cat","kitten","kitty","mammal","orange","scratch cat"],"info":[0,2,1],"json":{"objName":"Cat","sounds":[{"soundName":"Meow","soundID":-1,"md5":"83c36d806dc92327b9e7049a565c6bff.wav","sampleCount":18688,"rate":22050,"format":""}],"costumes":[{"costumeName":"cat-a","baseLayerID":-1,"baseLayerMD5":"b7853f557e4426412e64bb3da6531a99.svg","bitmapResolution":1,"rotationCenterX":48,"rotationCenterY":50},{"costumeName":"cat-b","baseLayerID":-1,"baseLayerMD5":"e6ddc55a6ddd9cc9d84fe0b4c21e016f.svg","bitmapResolution":1,"rotationCenterX":46,"rotationCenterY":53}],"currentCostumeIndex":0,"scratchX":24,"scratchY":16,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Cat 2","md5":"01ae57fd339529445cb890978ef8a054.svg","type":"sprite","tags":["cat","kitty","kitten","animals","mammal"],"info":[0,1,1],"json":{"objName":"Cat 2","sounds":[{"soundName":"meow2","soundID":-1,"md5":"cf51a0c4088942d95bcc20af13202710.wav","sampleCount":6512,"rate":11025,"format":""}],"costumes":[{"costumeName":"cat 2","baseLayerID":-1,"baseLayerMD5":"01ae57fd339529445cb890978ef8a054.svg","bitmapResolution":1,"rotationCenterX":87,"rotationCenterY":39}],"currentCostumeIndex":0,"scratchX":-71,"scratchY":1,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Cat Flying","md5":"bf6b9f91e6928be67eda5154ca5fb2c6.svg","type":"sprite","tags":["animals","cat","kitty","kitten"],"info":[0,2,1],"json":{"objName":"Cat Flying","sounds":[{"soundName":"Pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"cat flying-a","baseLayerID":-1,"baseLayerMD5":"bf6b9f91e6928be67eda5154ca5fb2c6.svg","bitmapResolution":1,"rotationCenterX":55,"rotationCenterY":37},{"costumeName":"cat flying-b","baseLayerID":-1,"baseLayerMD5":"6a5f707419e619463135f5bae599fa5b.svg","bitmapResolution":1,"rotationCenterX":44,"rotationCenterY":46}],"currentCostumeIndex":0,"scratchX":-53,"scratchY":-14,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Catcher","md5":"27c88c54a59b9fff7e3e4763a6e9874e.svg","type":"sprite","tags":["baseball","sports","people","alex eben meyer"],"info":[0,4,1],"json":{"objName":"Catcher","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"catcher-a","baseLayerID":-1,"baseLayerMD5":"27c88c54a59b9fff7e3e4763a6e9874e.svg","bitmapResolution":1,"rotationCenterX":41,"rotationCenterY":51},{"costumeName":"catcher-b","baseLayerID":0,"baseLayerMD5":"799a822cffc9460c0bf1b387cbd5e06b.svg","bitmapResolution":1,"rotationCenterX":41,"rotationCenterY":47},{"costumeName":"catcher-c","baseLayerID":-1,"baseLayerMD5":"a6f2bf8b354e8d1a789f8e6f83133d02.svg","bitmapResolution":1,"rotationCenterX":60,"rotationCenterY":87},{"costumeName":"catcher-d","baseLayerID":-1,"baseLayerMD5":"c86af45d9168bfb81259e5bb40be1778.svg","bitmapResolution":1,"rotationCenterX":86,"rotationCenterY":46}],"currentCostumeIndex":0,"scratchX":-6,"scratchY":70,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Centaur","md5":"45c1890ae0ab41f24f67ea74bec006c9.svg","type":"sprite","tags":["fantasy","people","ipzy","emotions"],"info":[0,4,2],"json":{"objName":"Centaur","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""},{"soundName":"snort","soundID":-1,"md5":"362d7440a57cab29914fecea621e50d4.wav","sampleCount":16421,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"centaur-a","baseLayerID":-1,"baseLayerMD5":"45c1890ae0ab41f24f67ea74bec006c9.svg","bitmapResolution":1,"rotationCenterX":110,"rotationCenterY":140},{"costumeName":"centaur-b","baseLayerID":-1,"baseLayerMD5":"783e8cd43e0c1feca25f639cb5cbc7da.svg","bitmapResolution":1,"rotationCenterX":110,"rotationCenterY":140},{"costumeName":"centaur-c","baseLayerID":-1,"baseLayerMD5":"d09f7160383c6399354c3d9960e852db.svg","bitmapResolution":1,"rotationCenterX":110,"rotationCenterY":140},{"costumeName":"centaur-d","baseLayerID":-1,"baseLayerMD5":"1ba8b4d384f995688c1b7048d1935697.svg","bitmapResolution":1,"rotationCenterX":110,"rotationCenterY":140}],"currentCostumeIndex":0,"scratchX":32,"scratchY":8,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Champ99","md5":"7b073f47fbd9421e0d60daacc157f506.png","type":"sprite","tags":["people","dance"],"info":[0,7,1],"json":{"objName":"Champ99","sounds":[{"soundName":"dance celebrate","soundID":-1,"md5":"0edb8fb88af19e6e17d0f8cf64c1d136.wav","sampleCount":176401,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"champ99-a","baseLayerID":-1,"baseLayerMD5":"7b073f47fbd9421e0d60daacc157f506.png","bitmapResolution":2,"rotationCenterX":248,"rotationCenterY":306},{"costumeName":"champ99-b","baseLayerID":-1,"baseLayerMD5":"d6ae13605610aa008d48b0c8b25a57d3.png","bitmapResolution":2,"rotationCenterX":164,"rotationCenterY":290},{"costumeName":"champ99-c","baseLayerID":-1,"baseLayerMD5":"26fdff424232926001d20041c3d5673b.png","bitmapResolution":2,"rotationCenterX":152,"rotationCenterY":270},{"costumeName":"champ99-d","baseLayerID":-1,"baseLayerMD5":"a28ffc2b129fb359ff22c79c48341267.png","bitmapResolution":2,"rotationCenterX":188,"rotationCenterY":260},{"costumeName":"champ99-e","baseLayerID":-1,"baseLayerMD5":"56f3220fa82d99dcfc7d27d433ed01e4.png","bitmapResolution":2,"rotationCenterX":190,"rotationCenterY":248},{"costumeName":"champ99-f","baseLayerID":-1,"baseLayerMD5":"68453506ae4b6b60a3fc6817ba39d492.png","bitmapResolution":2,"rotationCenterX":114,"rotationCenterY":250},{"costumeName":"champ99-g","baseLayerID":-1,"baseLayerMD5":"20318b14a332fd618ec91e7c1de8be9a.png","bitmapResolution":2,"rotationCenterX":132,"rotationCenterY":258}],"currentCostumeIndex":0,"scratchX":-6,"scratchY":13,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Cheesy Puffs","md5":"82772a61ec74974e84c686c61ea0b7d5.png","type":"sprite","tags":["food"],"info":[0,1,1],"json":{"objName":"Cheesy Puffs","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"cheesy puffs","baseLayerID":-1,"baseLayerMD5":"82772a61ec74974e84c686c61ea0b7d5.png","bitmapResolution":2,"rotationCenterX":87,"rotationCenterY":72}],"currentCostumeIndex":0,"scratchX":-7,"scratchY":-20,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Chick","md5":"7cd74ad0da97a828e8499ee181c9dbb1.svg","type":"sprite","tags":["animals","chicken","farm","owen davey"],"info":[0,3,1],"json":{"objName":"Chick","sounds":[{"soundName":"Chirp","soundID":-1,"md5":"3b8236bbb288019d93ae38362e865972.wav","sampleCount":5301,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"chick-a","baseLayerID":-1,"baseLayerMD5":"7cd74ad0da97a828e8499ee181c9dbb1.svg","bitmapResolution":1,"rotationCenterX":32,"rotationCenterY":37},{"costumeName":"chick-b","baseLayerID":-1,"baseLayerMD5":"07c2dad5f7063fddf7705f4817fad4f6.svg","bitmapResolution":1,"rotationCenterX":32,"rotationCenterY":37},{"costumeName":"chick-c","baseLayerID":-1,"baseLayerMD5":"272d3e4503a4123df62f25b67bad6f03.svg","bitmapResolution":1,"rotationCenterX":21,"rotationCenterY":24}],"currentCostumeIndex":0,"scratchX":-1,"scratchY":-122,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"City Bus","md5":"accf64aceae7997b7533fb51624ca297.svg","type":"sprite","tags":["city","bus","vehicle","car"],"info":[0,2,2],"json":{"objName":"City Bus","sounds":[{"soundName":"clown honk","soundID":-1,"md5":"ec66961f188e9b8a9c75771db744d096.wav","sampleCount":9009,"rate":22050,"format":"adpcm"},{"soundName":"car vroom","soundID":-1,"md5":"ead1da4a87ff6cb53441142f7ac37b8f.wav","sampleCount":43358,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"City Bus-a","baseLayerID":-1,"baseLayerMD5":"accf64aceae7997b7533fb51624ca297.svg","bitmapResolution":1,"rotationCenterX":107,"rotationCenterY":67},{"costumeName":"City Bus-b","baseLayerID":-1,"baseLayerMD5":"b9ea0e326ffa98bc58a73bdf17c9542b.svg","bitmapResolution":1,"rotationCenterX":107,"rotationCenterY":67}],"currentCostumeIndex":0,"scratchX":158,"scratchY":-54,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Cloud","md5":"47005a1f20309f577a03a67abbb6b94e.svg","type":"sprite","tags":["thing","weather","whether"],"info":[0,1,1],"json":{"objName":"Cloud","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"cloud","baseLayerID":-1,"baseLayerMD5":"47005a1f20309f577a03a67abbb6b94e.svg","bitmapResolution":1,"rotationCenterX":71,"rotationCenterY":45}],"currentCostumeIndex":0,"scratchX":81,"scratchY":-12,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Clouds","md5":"c7d7de8e29179407f03b054fa640f4d0.svg","type":"sprite","tags":["flying","weather","things","sky"],"info":[0,4,1],"json":{"objName":"Clouds","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"cloud-a","baseLayerID":-1,"baseLayerMD5":"c7d7de8e29179407f03b054fa640f4d0.svg","bitmapResolution":1,"rotationCenterX":76,"rotationCenterY":19},{"costumeName":"cloud-b","baseLayerID":-1,"baseLayerMD5":"d8595350ebb460494c9189dabb968336.svg","bitmapResolution":1,"rotationCenterX":101,"rotationCenterY":20},{"costumeName":"cloud-c","baseLayerID":-1,"baseLayerMD5":"395fc991e64ac0a4aa46758ab4bc65cb.svg","bitmapResolution":1,"rotationCenterX":97,"rotationCenterY":9},{"costumeName":"cloud-d","baseLayerID":-1,"baseLayerMD5":"1767e704acb11ffa409f77cc79ba7e86.svg","bitmapResolution":1,"rotationCenterX":87,"rotationCenterY":21}],"currentCostumeIndex":0,"scratchX":-21,"scratchY":16,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Convertible","md5":"5b883f396844ff5cfecd7c95553fa4fb.png","type":"sprite","tags":["car","transportation"],"info":[0,1,1],"json":{"objName":"Convertible","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"convertible","baseLayerID":-1,"baseLayerMD5":"5b883f396844ff5cfecd7c95553fa4fb.png","bitmapResolution":2,"rotationCenterX":180,"rotationCenterY":44}],"currentCostumeIndex":0,"scratchX":36,"scratchY":-11,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Convertible 2","md5":"b6ac3c9e1789cba2302d2ef82d62d019.svg","type":"sprite","tags":["transportation","car","things"],"info":[0,1,1],"json":{"objName":"Convertible 2","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"convertible 3","baseLayerID":-1,"baseLayerMD5":"b6ac3c9e1789cba2302d2ef82d62d019.svg","bitmapResolution":1,"rotationCenterX":75,"rotationCenterY":75}],"currentCostumeIndex":0,"scratchX":7,"scratchY":13,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Crab","md5":"114249a5660f7948663d95de575cfd8d.svg","type":"sprite","tags":["animals","crustacean","antennae","baltimore","maryland","underwater","ocean","sea","summer","arthropod"],"info":[0,2,1],"json":{"objName":"Crab","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"crab-a","baseLayerID":-1,"baseLayerMD5":"114249a5660f7948663d95de575cfd8d.svg","bitmapResolution":1,"rotationCenterX":75,"rotationCenterY":75},{"costumeName":"crab-b","baseLayerID":-1,"baseLayerMD5":"9bf050664e68c10d2616e85f2873be09.svg","bitmapResolution":1,"rotationCenterX":75,"rotationCenterY":75}],"currentCostumeIndex":0,"scratchX":45,"scratchY":-33,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Crystal","md5":"8520264d48537bea17b7f6d18e9bb558.svg","type":"sprite","tags":["fantasy","ipzy","things"],"info":[0,2,2],"json":{"objName":"Crystal","sounds":[{"soundName":"Magic Spell","soundID":-1,"md5":"1cb60ecdb1075c8769cb346d5c2a22c7.wav","sampleCount":43077,"rate":22050,"format":"adpcm"},{"soundName":"collect","soundID":-1,"md5":"32514c51e03db680e9c63857b840ae78.wav","sampleCount":13320,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"crystal-a","baseLayerID":-1,"baseLayerMD5":"8520264d48537bea17b7f6d18e9bb558.svg","bitmapResolution":1,"rotationCenterX":15,"rotationCenterY":15},{"costumeName":"crystal-b","baseLayerID":-1,"baseLayerMD5":"b62ce1dc2d34741bad036664a01912fb.svg","bitmapResolution":1,"rotationCenterX":12,"rotationCenterY":24}],"currentCostumeIndex":0,"scratchX":-110,"scratchY":7,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"D-Money Dance","md5":"dafbdfe454c5ec7029b5c1e07fcabc90.png","type":"sprite","tags":["people","dance"],"info":[0,13,1],"json":{"objName":"D-Money Dance","sounds":[{"soundName":"dance celebrate","soundID":-1,"md5":"0edb8fb88af19e6e17d0f8cf64c1d136.wav","sampleCount":176401,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"dm stance","baseLayerID":-1,"baseLayerMD5":"dafbdfe454c5ec7029b5c1e07fcabc90.png","bitmapResolution":2,"rotationCenterX":106,"rotationCenterY":238},{"costumeName":"dm top stand","baseLayerID":-1,"baseLayerMD5":"a22da98e5e63de7b2883355afd0184f0.png","bitmapResolution":2,"rotationCenterX":82,"rotationCenterY":244},{"costumeName":"dm top R leg","baseLayerID":-1,"baseLayerMD5":"12db59633a1709a2c39534d35263791f.png","bitmapResolution":2,"rotationCenterX":218,"rotationCenterY":232},{"costumeName":"dm top L leg","baseLayerID":-1,"baseLayerMD5":"344384a6a3f1bdf494cc7af31e928d36.png","bitmapResolution":2,"rotationCenterX":230,"rotationCenterY":240},{"costumeName":"dm freeze","baseLayerID":-1,"baseLayerMD5":"a4b5d644d9abdbcab236acf19b2a2e81.png","bitmapResolution":2,"rotationCenterX":220,"rotationCenterY":234},{"costumeName":"dm pop front","baseLayerID":-1,"baseLayerMD5":"70da166596bb484eae1bfbaad5c03d54.png","bitmapResolution":2,"rotationCenterX":92,"rotationCenterY":234},{"costumeName":"dm pop down","baseLayerID":-1,"baseLayerMD5":"729812366245c0dafd456339c9d94e08.png","bitmapResolution":2,"rotationCenterX":64,"rotationCenterY":74},{"costumeName":"dm pop left","baseLayerID":-1,"baseLayerMD5":"32ec7b5332cfebd1cfed7f6b79c76e67.png","bitmapResolution":2,"rotationCenterX":204,"rotationCenterY":250},{"costumeName":"dm pop right","baseLayerID":-1,"baseLayerMD5":"19bd7995d37e3baade673b2fe7cb982b.png","bitmapResolution":2,"rotationCenterX":78,"rotationCenterY":238},{"costumeName":"dm pop L arm","baseLayerID":-1,"baseLayerMD5":"3cdebabdb41f6c3e84561cf3ea87bac3.png","bitmapResolution":2,"rotationCenterX":90,"rotationCenterY":238},{"costumeName":"dm pop stand","baseLayerID":-1,"baseLayerMD5":"05529eb3c09294bd15f57c6f10d5894e.png","bitmapResolution":2,"rotationCenterX":100,"rotationCenterY":244},{"costumeName":"dm pop R arm","baseLayerID":-1,"baseLayerMD5":"50faf1630ea383c0b8c77f70a9329797.png","bitmapResolution":2,"rotationCenterX":80,"rotationCenterY":240},{"costumeName":"dm top R leg2","baseLayerID":-1,"baseLayerMD5":"fcb8c2b6cf9b7e6ce9df521b2486deb3.png","bitmapResolution":2,"rotationCenterX":218,"rotationCenterY":232}],"currentCostumeIndex":0,"scratchX":-29,"scratchY":34,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Dan","md5":"307250744e230fb15e7062238bf2634c.png","type":"sprite","tags":["people"],"info":[0,2,1],"json":{"objName":"Dan","sounds":[{"soundName":"dance magic","soundID":-1,"md5":"042309f190183383c0b1c1fc3edc2e84.wav","sampleCount":187200,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"dan-a","baseLayerID":-1,"baseLayerMD5":"307250744e230fb15e7062238bf2634c.png","bitmapResolution":2,"rotationCenterX":72,"rotationCenterY":196},{"costumeName":"dan-b","baseLayerID":-1,"baseLayerMD5":"89b55d049f4b3811676311df00681385.png","bitmapResolution":2,"rotationCenterX":94,"rotationCenterY":200}],"currentCostumeIndex":0,"scratchX":9,"scratchY":-38,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Dani","md5":"e620d1c3143b5ff05a0e4df89576e054.svg","type":"sprite","tags":["people"],"info":[0,3,1],"json":{"objName":"Dani","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Dani-a","baseLayerID":-1,"baseLayerMD5":"e620d1c3143b5ff05a0e4df89576e054.svg","bitmapResolution":1,"rotationCenterX":37,"rotationCenterY":141},{"costumeName":"Dani-b","baseLayerID":-1,"baseLayerMD5":"4de54672f1c7af00623a0ee3bc490ba7.svg","bitmapResolution":1,"rotationCenterX":86,"rotationCenterY":141},{"costumeName":"Dani-c","baseLayerID":-1,"baseLayerMD5":"b4a303342f9b7ed6a74059054347dd30.svg","bitmapResolution":1,"rotationCenterX":37,"rotationCenterY":138}],"currentCostumeIndex":0,"scratchX":-86,"scratchY":-9,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Dee","md5":"aa239b7ccdce6bddf06900c709525764.svg","type":"sprite","tags":["people"],"info":[0,5,1],"json":{"objName":"Dee","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"dee-a","baseLayerID":-1,"baseLayerMD5":"aa239b7ccdce6bddf06900c709525764.svg","bitmapResolution":1,"rotationCenterX":52,"rotationCenterY":99},{"costumeName":"dee-b","baseLayerID":-1,"baseLayerMD5":"62b4ac1b735599e21af77c390b178095.svg","bitmapResolution":1,"rotationCenterX":33,"rotationCenterY":99},{"costumeName":"dee-c","baseLayerID":-1,"baseLayerMD5":"6aa6196ce3245e93b8d1299f33adffcd.svg","bitmapResolution":1,"rotationCenterX":36,"rotationCenterY":102},{"costumeName":"dee-d","baseLayerID":-1,"baseLayerMD5":"2159a6be8f7ff450d0b5e938ca34a3f4.svg","bitmapResolution":1,"rotationCenterX":33,"rotationCenterY":99},{"costumeName":"dee-e","baseLayerID":-1,"baseLayerMD5":"e358d2a7e3a0a680928657161ce81a0a.svg","bitmapResolution":1,"rotationCenterX":32,"rotationCenterY":99}],"currentCostumeIndex":0,"scratchX":84,"scratchY":-39,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Devin","md5":"b1897e56265470b55fa65fabe2423c55.svg","type":"sprite","tags":["people"],"info":[0,4,1],"json":{"objName":"Devin","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"devin-a","baseLayerID":-1,"baseLayerMD5":"b1897e56265470b55fa65fabe2423c55.svg","bitmapResolution":1,"rotationCenterX":39,"rotationCenterY":95},{"costumeName":"devin-b","baseLayerID":-1,"baseLayerMD5":"873fbd641768c8f753a6568da97633e7.svg","bitmapResolution":1,"rotationCenterX":40,"rotationCenterY":96},{"costumeName":"devin-c","baseLayerID":-1,"baseLayerMD5":"eac3c03d86cebb42c8f30e373cb7f623.svg","bitmapResolution":1,"rotationCenterX":32,"rotationCenterY":95},{"costumeName":"devin-d","baseLayerID":-1,"baseLayerMD5":"fa6a75afb0e4b822b91d8bb20d40c68f.svg","bitmapResolution":1,"rotationCenterX":41,"rotationCenterY":95}],"currentCostumeIndex":0,"scratchX":82,"scratchY":-18,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Dinosaur1","md5":"e70ab4de006f3df64e776abf912a62be.svg","type":"sprite","tags":["animals","dinosaur","alex eben meyer"],"info":[0,4,1],"json":{"objName":"Dinosaur1","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"dinosaur1-a","baseLayerID":-1,"baseLayerMD5":"e70ab4de006f3df64e776abf912a62be.svg","bitmapResolution":1,"rotationCenterX":98,"rotationCenterY":92},{"costumeName":"dinosaur1-b","baseLayerID":-1,"baseLayerMD5":"af2d8211a65dce9871d49fa70671ce0c.svg","bitmapResolution":1,"rotationCenterX":98,"rotationCenterY":47},{"costumeName":"dinosaur1-c","baseLayerID":-1,"baseLayerMD5":"a2bb28d5ba55ba997bec63772437cecf.svg","bitmapResolution":1,"rotationCenterX":81,"rotationCenterY":91},{"costumeName":"dinosaur1-d","baseLayerID":-1,"baseLayerMD5":"91f3dba45e8cec7bdff31ed5acde2c85.svg","bitmapResolution":1,"rotationCenterX":99,"rotationCenterY":91}],"currentCostumeIndex":0,"scratchX":-138,"scratchY":-51,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Dinosaur2","md5":"f49719e8f2440f5d328f2604e97eb71d.svg","type":"sprite","tags":["animals","dinosaur","triceratops","alex eben meyer"],"info":[0,4,1],"json":{"objName":"Dinosaur2","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"dinosaur2-a","baseLayerID":-1,"baseLayerMD5":"f49719e8f2440f5d328f2604e97eb71d.svg","bitmapResolution":1,"rotationCenterX":63,"rotationCenterY":67},{"costumeName":"dinosaur2-b","baseLayerID":-1,"baseLayerMD5":"1af6b3af3bf2cda862bbe01034a336bb.svg","bitmapResolution":1,"rotationCenterX":76,"rotationCenterY":67},{"costumeName":"dinosaur2-c","baseLayerID":-1,"baseLayerMD5":"e83b30a4517bbe155e2b4a6367c8f70b.svg","bitmapResolution":1,"rotationCenterX":64,"rotationCenterY":67},{"costumeName":"dinosaur2-d","baseLayerID":-1,"baseLayerMD5":"8244f1fb159237179d1caaa69c070060.svg","bitmapResolution":1,"rotationCenterX":73,"rotationCenterY":67}],"currentCostumeIndex":0,"scratchX":10,"scratchY":26,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Dinosaur3","md5":"c4867c44f38df5bde472844878d5beea.svg","type":"sprite","tags":["animals","dinosaur","pteranodon","flying","alex eben meyer"],"info":[0,5,1],"json":{"objName":"Dinosaur3","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"dinosaur3-a","baseLayerID":-1,"baseLayerMD5":"c4867c44f38df5bde472844878d5beea.svg","bitmapResolution":1,"rotationCenterX":113,"rotationCenterY":42},{"costumeName":"dinosaur3-b","baseLayerID":-1,"baseLayerMD5":"b682c1e58ea1c6bea737670f57517b6f.svg","bitmapResolution":1,"rotationCenterX":113,"rotationCenterY":59},{"costumeName":"dinosaur3-c","baseLayerID":-1,"baseLayerMD5":"47a617ca48f4782efeeb60199cff801e.svg","bitmapResolution":1,"rotationCenterX":47,"rotationCenterY":59},{"costumeName":"dinosaur3-d","baseLayerID":-1,"baseLayerMD5":"710ff3380d6872b04785db97dc0565c6.svg","bitmapResolution":1,"rotationCenterX":113,"rotationCenterY":65},{"costumeName":"dinosaur3-e","baseLayerID":-1,"baseLayerMD5":"6f40025c1157f37858adf7fa85090e64.svg","bitmapResolution":1,"rotationCenterX":41,"rotationCenterY":40}],"currentCostumeIndex":0,"scratchX":-76,"scratchY":101,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Dinosaur4","md5":"d87b5e3c45f5d234c7aa47107c788f18.svg","type":"sprite","tags":["animals","dinosaur","tyrannosaurus","t-rex","trex","alex eben meyer"],"info":[0,4,1],"json":{"objName":"Dinosaur4","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"dinosaur4-a","baseLayerID":0,"baseLayerMD5":"d87b5e3c45f5d234c7aa47107c788f18.svg","bitmapResolution":1,"rotationCenterX":60,"rotationCenterY":52},{"costumeName":"dinosaur4-b","baseLayerID":-1,"baseLayerMD5":"cfe906702bbd30bc3bb8acb53079b6b0.svg","bitmapResolution":1,"rotationCenterX":87,"rotationCenterY":52},{"costumeName":"dinosaur4-c","baseLayerID":-1,"baseLayerMD5":"1879b07cfe788b0258afada17aa46973.svg","bitmapResolution":1,"rotationCenterX":59,"rotationCenterY":52},{"costumeName":"dinosaur4-d","baseLayerID":-1,"baseLayerMD5":"52c17657698ab82881ed3ccf83080684.svg","bitmapResolution":1,"rotationCenterX":89,"rotationCenterY":88}],"currentCostumeIndex":0,"scratchX":128,"scratchY":-19,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Dinosaur5","md5":"42e3bf118c775ba54239af4276800a0a.png","type":"sprite","tags":["animals","dinosaur","leigh mcg"],"info":[0,8,2],"json":{"objName":"Dinosaur5","sounds":[{"soundName":"dance funky","soundID":-1,"md5":"51c00a150d33c4639203184bb24c637b.wav","sampleCount":111870,"rate":22050,"format":"adpcm"},{"soundName":"bite","soundID":-1,"md5":"6759a83e9b92cd6082b68611e858fd23.wav","sampleCount":8136,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"Dinosaur5-a","baseLayerID":-1,"baseLayerMD5":"42e3bf118c775ba54239af4276800a0a.png","bitmapResolution":2,"rotationCenterX":104,"rotationCenterY":150},{"costumeName":"Dinosaur5-b","baseLayerID":-1,"baseLayerMD5":"5a0832162a0cfa7adab6090c42e89714.png","bitmapResolution":2,"rotationCenterX":112,"rotationCenterY":166},{"costumeName":"Dinosaur5-c","baseLayerID":-1,"baseLayerMD5":"26fca11e4251d60ed7aa5d08f4ae2a69.png","bitmapResolution":2,"rotationCenterX":112,"rotationCenterY":150},{"costumeName":"Dinosaur5-d","baseLayerID":-1,"baseLayerMD5":"c4044a3badea77ced4f2db69aff866ed.png","bitmapResolution":2,"rotationCenterX":90,"rotationCenterY":134},{"costumeName":"Dinosaur5-e","baseLayerID":-1,"baseLayerMD5":"f49b3b098a24474f20c8f4686681c611.png","bitmapResolution":2,"rotationCenterX":88,"rotationCenterY":150},{"costumeName":"Dinosaur5-f","baseLayerID":-1,"baseLayerMD5":"9d200a7c2e93eac8cf52ede3a87d7969.png","bitmapResolution":2,"rotationCenterX":94,"rotationCenterY":166},{"costumeName":"Dinosaur5-g","baseLayerID":-1,"baseLayerMD5":"5882227a9e2f0f3b2014c49328969762.png","bitmapResolution":2,"rotationCenterX":102,"rotationCenterY":150},{"costumeName":"Dinosaur5-h","baseLayerID":-1,"baseLayerMD5":"3b2cf97b1cc7fc535162ba5849a0e29c.png","bitmapResolution":2,"rotationCenterX":108,"rotationCenterY":134}],"currentCostumeIndex":0,"scratchX":0,"scratchY":0,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Diver1","md5":"853803d5600b66538474909c5438c8ee.svg","type":"sprite","tags":["people","underwater","ocean","sea","summer","swimming"],"info":[0,1,1],"json":{"objName":"Diver1","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"diver1","baseLayerID":-1,"baseLayerMD5":"853803d5600b66538474909c5438c8ee.svg","bitmapResolution":1,"rotationCenterX":75,"rotationCenterY":75}],"currentCostumeIndex":0,"scratchX":11,"scratchY":48,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Diver2","md5":"248d3e69ada69a64b1077149ef6a931a.svg","type":"sprite","tags":["people","underwater","ocean","sea","summer","swimming"],"info":[0,1,1],"json":{"objName":"Diver2","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"diver2","baseLayerID":-1,"baseLayerMD5":"248d3e69ada69a64b1077149ef6a931a.svg","bitmapResolution":1,"rotationCenterX":75,"rotationCenterY":75}],"currentCostumeIndex":0,"scratchX":89,"scratchY":-48,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Dog1","md5":"39ddefa0cc58f3b1b06474d63d81ef56.svg","type":"sprite","tags":["animals","puppy","puppies","mammals"],"info":[0,2,1],"json":{"objName":"Dog1","sounds":[{"soundName":"dog1","soundID":-1,"md5":"b15adefc3c12f758b6dc6a045362532f.wav","sampleCount":3672,"rate":22050,"format":""}],"costumes":[{"costumeName":"dog1-a","baseLayerID":-1,"baseLayerMD5":"39ddefa0cc58f3b1b06474d63d81ef56.svg","bitmapResolution":1,"rotationCenterX":83,"rotationCenterY":80},{"costumeName":"dog1-b","baseLayerID":-1,"baseLayerMD5":"598f4aa3d8f671375d1d2b3acf753416.svg","bitmapResolution":1,"rotationCenterX":83,"rotationCenterY":80}],"currentCostumeIndex":0,"scratchX":78,"scratchY":-36,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Dog2","md5":"e921f865b19b27cd99e16a341dbf09c2.svg","type":"sprite","tags":["animals","puppy","puppies","mammals"],"info":[0,3,1],"json":{"objName":"Dog2","sounds":[{"soundName":"dog1","soundID":-1,"md5":"b15adefc3c12f758b6dc6a045362532f.wav","sampleCount":3672,"rate":22050,"format":""}],"costumes":[{"costumeName":"dog2-a","baseLayerID":-1,"baseLayerMD5":"e921f865b19b27cd99e16a341dbf09c2.svg","bitmapResolution":1,"rotationCenterX":75,"rotationCenterY":75},{"costumeName":"dog2-b","baseLayerID":-1,"baseLayerMD5":"891f2fb7daf79ba8b224a9173eeb0a63.svg","bitmapResolution":1,"rotationCenterX":75,"rotationCenterY":75},{"costumeName":"dog2-c","baseLayerID":-1,"baseLayerMD5":"cd236d5eef4431dea82983ac9eec406b.svg","bitmapResolution":1,"rotationCenterX":75,"rotationCenterY":75}],"currentCostumeIndex":0,"scratchX":99,"scratchY":27,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Donut","md5":"9e7b4d153421dae04a24571d7e079e85.svg","type":"sprite","tags":["food","sweets","bakery","baking","homer","frosting","sprinkles","sprankles"],"info":[0,1,2],"json":{"objName":"Donut","sounds":[{"soundName":"Bite","soundID":-1,"md5":"0039635b1d6853face36581784558454.wav","sampleCount":7672,"rate":22050,"format":"adpcm"},{"soundName":"Chomp","soundID":-1,"md5":"0b1e3033140d094563248e61de4039e5.wav","sampleCount":2912,"rate":11025,"format":""}],"costumes":[{"costumeName":"donut","baseLayerID":-1,"baseLayerMD5":"9e7b4d153421dae04a24571d7e079e85.svg","bitmapResolution":1,"rotationCenterX":73,"rotationCenterY":15}],"currentCostumeIndex":0,"scratchX":-2,"scratchY":43,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Dorian","md5":"503f1d4d0fe61d071e1dd8b5233cceb0.svg","type":"sprite","tags":["sports","basketball","people","alex eben meyer"],"info":[0,4,1],"json":{"objName":"Dorian","sounds":[{"soundName":"basketball bounce","soundID":-1,"md5":"1727f65b5f22d151685b8e5917456a60.wav","sampleCount":8099,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"dorian-a","baseLayerID":-1,"baseLayerMD5":"503f1d4d0fe61d071e1dd8b5233cceb0.svg","bitmapResolution":1,"rotationCenterX":60,"rotationCenterY":65},{"costumeName":"dorian-b","baseLayerID":-1,"baseLayerMD5":"d5f795ef2395bcd11ceee0b0c24c9341.svg","bitmapResolution":1,"rotationCenterX":60,"rotationCenterY":65},{"costumeName":"dorian-c","baseLayerID":-1,"baseLayerMD5":"4ad4ddf4251b9b5bcb16d8d77213685f.svg","bitmapResolution":1,"rotationCenterX":77,"rotationCenterY":67},{"costumeName":"dorian-d","baseLayerID":-1,"baseLayerMD5":"67fba4e187ecf42749bdd44e64f29192.svg","bitmapResolution":1,"rotationCenterX":77,"rotationCenterY":53}],"currentCostumeIndex":0,"scratchX":-24,"scratchY":-57,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Dot","md5":"3b9e6830365aeadb63c21b681777b783.svg","type":"sprite","tags":["space","dog","animals","wren mcdonald"],"info":[0,4,1],"json":{"objName":"Dot","sounds":[{"soundName":"bark","soundID":-1,"md5":"cd8fa8390b0efdd281882533fbfcfcfb.wav","sampleCount":3168,"rate":22050,"format":""}],"costumes":[{"costumeName":"dot-a","baseLayerID":-1,"baseLayerMD5":"3b9e6830365aeadb63c21b681777b783.svg","bitmapResolution":1,"rotationCenterX":52,"rotationCenterY":67},{"costumeName":"dot-b","baseLayerID":-1,"baseLayerMD5":"a80a07906ffbb9671dba3633223859af.svg","bitmapResolution":1,"rotationCenterX":65,"rotationCenterY":67},{"costumeName":"dot-c","baseLayerID":-1,"baseLayerMD5":"1e1bdccbab5b566beb7f91b5ec01352f.svg","bitmapResolution":1,"rotationCenterX":51,"rotationCenterY":69},{"costumeName":"dot-d","baseLayerID":-1,"baseLayerMD5":"06d70d5de0e25f97c1c606e513ab019c.svg","bitmapResolution":1,"rotationCenterX":57,"rotationCenterY":67}],"currentCostumeIndex":0,"scratchX":-162,"scratchY":-69,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Dove","md5":"6dde2b880ad6ddeaea2a53821befb86d.svg","type":"sprite","tags":["animals","bird","flying"],"info":[0,2,1],"json":{"objName":"Dove","sounds":[{"soundName":"bird","soundID":-1,"md5":"18bd4b634a3f992a16b30344c7d810e0.wav","sampleCount":3840,"rate":11025,"format":""}],"costumes":[{"costumeName":"dove-a","baseLayerID":-1,"baseLayerMD5":"6dde2b880ad6ddeaea2a53821befb86d.svg","bitmapResolution":1,"rotationCenterX":86,"rotationCenterY":59},{"costumeName":"dove-b","baseLayerID":-1,"baseLayerMD5":"1c0bc118044d7f6033bc9cd1ef555590.svg","bitmapResolution":1,"rotationCenterX":88,"rotationCenterY":57}],"currentCostumeIndex":0,"scratchX":-71,"scratchY":24,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Dragon","md5":"8aed65cee4cfe22b4f4b8e749092dbbb.svg","type":"sprite","tags":["fantasy","animals","ipzy","flying"],"info":[0,3,1],"json":{"objName":"Dragon","sounds":[{"soundName":"Magic Spell","soundID":-1,"md5":"1cb60ecdb1075c8769cb346d5c2a22c7.wav","sampleCount":43077,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"dragon-a","baseLayerID":-1,"baseLayerMD5":"8aed65cee4cfe22b4f4b8e749092dbbb.svg","bitmapResolution":1,"rotationCenterX":210,"rotationCenterY":150},{"costumeName":"dragon-b","baseLayerID":-1,"baseLayerMD5":"c3360f16bb78b136d9911325da9fda49.svg","bitmapResolution":1,"rotationCenterX":210,"rotationCenterY":150},{"costumeName":"dragon-c","baseLayerID":-1,"baseLayerMD5":"e81af82ebde008c167ebc6874df3ecb4.svg","bitmapResolution":1,"rotationCenterX":210,"rotationCenterY":150}],"currentCostumeIndex":0,"scratchX":-36,"scratchY":-7,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Dragonfly","md5":"87aaecd2fb73580e6f1f38c5a2e579a9.svg","type":"sprite","tags":["animals","insect","dragonfly","wetland","owen davey"],"info":[0,2,1],"json":{"objName":"Dragonfly","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Dragonfly-a","baseLayerID":-1,"baseLayerMD5":"87aaecd2fb73580e6f1f38c5a2e579a9.svg","bitmapResolution":1,"rotationCenterX":108,"rotationCenterY":52},{"costumeName":"Dragonfly-b","baseLayerID":-1,"baseLayerMD5":"4e775a49bd5a7a6d38392731924f72e0.svg","bitmapResolution":1,"rotationCenterX":108,"rotationCenterY":46}],"currentCostumeIndex":0,"scratchX":138,"scratchY":107,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Dress","md5":"fa7e0b37a324c212d0f1ce0f701a1ae0.svg","type":"sprite","tags":["fashion","dress","clothing"],"info":[0,3,1],"json":{"objName":"Dress","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"dress-a","baseLayerID":-1,"baseLayerMD5":"fa7e0b37a324c212d0f1ce0f701a1ae0.svg","bitmapResolution":1,"rotationCenterX":57,"rotationCenterY":83},{"costumeName":"dress-b","baseLayerID":-1,"baseLayerMD5":"308b6ad8e6cfe5c2b2c1e3a1eb9cc404.svg","bitmapResolution":1,"rotationCenterX":58,"rotationCenterY":83},{"costumeName":"dress-c","baseLayerID":-1,"baseLayerMD5":"1f7a725ba285dc97cb142d4b812db624.svg","bitmapResolution":1,"rotationCenterX":49,"rotationCenterY":83}],"currentCostumeIndex":0,"scratchX":-65,"scratchY":-50,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Drum","md5":"dd66742bc2a3cfe5a6f9f540afd2e15c.svg","type":"sprite","tags":["music","andrew rae"],"info":[0,2,2],"json":{"objName":"Drum","sounds":[{"soundName":"High Tom","soundID":-1,"md5":"d623f99b3c8d33932eb2c6c9cfd817c5.wav","sampleCount":12320,"rate":22050,"format":""},{"soundName":"Low Tom","soundID":-1,"md5":"1569bbbd8952b0575e5a5cb5aefb50ba.wav","sampleCount":20000,"rate":22050,"format":""}],"costumes":[{"costumeName":"drum-a","baseLayerID":-1,"baseLayerMD5":"dd66742bc2a3cfe5a6f9f540afd2e15c.svg","bitmapResolution":1,"rotationCenterX":43,"rotationCenterY":60},{"costumeName":"drum-b","baseLayerID":-1,"baseLayerMD5":"9c9d371da382c227e43f09b1a748c554.svg","bitmapResolution":1,"rotationCenterX":43,"rotationCenterY":60}],"currentCostumeIndex":0,"scratchX":-43,"scratchY":-29,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Drum Kit","md5":"131d040d86ecea62ccd175a8709c7866.svg","type":"sprite","tags":["music","andrew rae"],"info":[0,2,5],"json":{"objName":"Drum Kit","sounds":[{"soundName":"Drum Bass1","soundID":-1,"md5":"48328c874353617451e4c7902cc82817.wav","sampleCount":6528,"rate":22050,"format":""},{"soundName":"Drum Bass2","soundID":-1,"md5":"711a1270d1cf2e5de9b145ee539213e4.wav","sampleCount":3791,"rate":22050,"format":"adpcm"},{"soundName":"Drum Bass3","soundID":-1,"md5":"c21704337b16359ea631b5f8eb48f765.wav","sampleCount":8576,"rate":22050,"format":""},{"soundName":"High Tom","soundID":-1,"md5":"d623f99b3c8d33932eb2c6c9cfd817c5.wav","sampleCount":12320,"rate":22050,"format":""},{"soundName":"Low Tom","soundID":-1,"md5":"1569bbbd8952b0575e5a5cb5aefb50ba.wav","sampleCount":20000,"rate":22050,"format":""}],"costumes":[{"costumeName":"drum-kit","baseLayerID":-1,"baseLayerMD5":"131d040d86ecea62ccd175a8709c7866.svg","bitmapResolution":1,"rotationCenterX":58,"rotationCenterY":78},{"costumeName":"drum-kit-b","baseLayerID":-1,"baseLayerMD5":"ff14be049146cf9ab142e0951cb9b735.svg","bitmapResolution":1,"rotationCenterX":58,"rotationCenterY":78}],"currentCostumeIndex":0,"scratchX":4,"scratchY":-31,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Drum-cymbal","md5":"d6d41862fda966df1455d2dbff5e1988.svg","type":"sprite","tags":["music","andrew rae"],"info":[0,2,4],"json":{"objName":"Drum-cymbal","sounds":[{"soundName":"crash cymbal","soundID":-1,"md5":"f2c47a46f614f467a7ac802ed9ec3d8e.wav","sampleCount":25220,"rate":22050,"format":""},{"soundName":"splash cymbal","soundID":-1,"md5":"9d63ed5be96c43b06492e8b4a9cea8d8.wav","sampleCount":9600,"rate":22050,"format":""},{"soundName":"bell cymbal","soundID":-1,"md5":"efddec047de95492f775a1b5b2e8d19e.wav","sampleCount":19328,"rate":22050,"format":""},{"soundName":"roll cymbal","soundID":-1,"md5":"da8355d753cd2a5ddd19cb2bb41c1547.wav","sampleCount":26432,"rate":22050,"format":""}],"costumes":[{"costumeName":"drum-cymbal-a","baseLayerID":-1,"baseLayerMD5":"d6d41862fda966df1455d2dbff5e1988.svg","bitmapResolution":1,"rotationCenterX":30,"rotationCenterY":74},{"costumeName":"drum-cymbal-b","baseLayerID":-1,"baseLayerMD5":"e6b7d7d8874bc4b7be58afe927157554.svg","bitmapResolution":1,"rotationCenterX":30,"rotationCenterY":74}],"currentCostumeIndex":0,"scratchX":-50,"scratchY":-19,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Drum-highhat","md5":"81fb79151a63cb096258607451cc2cf5.svg","type":"sprite","tags":["music","andrew rae"],"info":[0,2,1],"json":{"objName":"Drum-highhat","sounds":[{"soundName":"hihat cymbal","soundID":-1,"md5":"2d01f60d0f20ab39facbf707899c6b2a.wav","sampleCount":2752,"rate":22050,"format":""}],"costumes":[{"costumeName":"drum-highhat-a","baseLayerID":-1,"baseLayerMD5":"81fb79151a63cb096258607451cc2cf5.svg","bitmapResolution":1,"rotationCenterX":33,"rotationCenterY":73},{"costumeName":"drum-highhat-b","baseLayerID":-1,"baseLayerMD5":"e3c273e4ad1a24583064f9b61fcd753a.svg","bitmapResolution":1,"rotationCenterX":33,"rotationCenterY":73}],"currentCostumeIndex":0,"scratchX":64,"scratchY":-33,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Drum-snare","md5":"ace58710b8fa5fca8fb5bbca15e7d19c.svg","type":"sprite","tags":["music","andrew rae"],"info":[0,2,3],"json":{"objName":"Drum-snare","sounds":[{"soundName":"tap snare","soundID":-1,"md5":"d55b3954d72c6275917f375e49b502f3.wav","sampleCount":3296,"rate":22050,"format":""},{"soundName":"flam snare","soundID":-1,"md5":"3b6cce9f8c56c0537ca61eee3945cd1d.wav","sampleCount":4416,"rate":22050,"format":""},{"soundName":"sidestick snare","soundID":-1,"md5":"f6868ee5cf626fc4ef3ca1119dc95592.wav","sampleCount":2336,"rate":22050,"format":""}],"costumes":[{"costumeName":"drum-snare-a","baseLayerID":-1,"baseLayerMD5":"ace58710b8fa5fca8fb5bbca15e7d19c.svg","bitmapResolution":1,"rotationCenterX":21,"rotationCenterY":32},{"costumeName":"drum-snare-b","baseLayerID":-1,"baseLayerMD5":"f6120839d3f73b262571add2444c443a.svg","bitmapResolution":1,"rotationCenterX":34,"rotationCenterY":48}],"currentCostumeIndex":0,"scratchX":45,"scratchY":-33,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Drums Conga","md5":"b3da94523b6d3df2dd30602399599ab4.svg","type":"sprite","tags":["drums","drum","music","instrument","percussion"],"info":[0,2,4],"json":{"objName":"Drums Conga","sounds":[{"soundName":"High Conga","soundID":-1,"md5":"16144544de90e98a92a265d4fc3241ea.wav","sampleCount":8192,"rate":22050,"format":""},{"soundName":"Low Conga","soundID":-1,"md5":"0b6f94487cd8a1cf0bb77e15966656c3.wav","sampleCount":8384,"rate":22050,"format":""},{"soundName":"Muted Conga","soundID":-1,"md5":"1d4abbe3c9bfe198a88badb10762de75.wav","sampleCount":4544,"rate":22050,"format":""},{"soundName":"Tap Conga","soundID":-1,"md5":"fd9a67157f57f9cc6fe3cdce38a6d4a8.wav","sampleCount":6880,"rate":22050,"format":""}],"costumes":[{"costumeName":"Drums Conga-a","baseLayerID":-1,"baseLayerMD5":"b3da94523b6d3df2dd30602399599ab4.svg","bitmapResolution":1,"rotationCenterX":65,"rotationCenterY":66},{"costumeName":"Drums Conga-b","baseLayerID":-1,"baseLayerMD5":"037703c2b65f051c12e9b22dcf93856c.svg","bitmapResolution":1,"rotationCenterX":66,"rotationCenterY":94}],"currentCostumeIndex":0,"scratchX":61,"scratchY":-87,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Drums Tabla","md5":"68ce53b53fcc68744584c28d20144c4f.svg","type":"sprite","tags":["drums","drum","music","instrument","percussion"],"info":[0,2,4],"json":{"objName":"Drums Tabla","sounds":[{"soundName":"Hi Na Tabla","soundID":-1,"md5":"35b42d98c43404a5b1b52fb232a62bd7.wav","sampleCount":4096,"rate":22050,"format":""},{"soundName":"Hi Tun Tabla","soundID":-1,"md5":"da734693dfa6a9a7eccdc7f9a0ca9840.wav","sampleCount":18656,"rate":22050,"format":""},{"soundName":"Lo Geh Tabla","soundID":-1,"md5":"9205359ab69d042ed3da8a160a651690.wav","sampleCount":30784,"rate":22050,"format":""},{"soundName":"Lo Gliss Tabla","soundID":-1,"md5":"d7cd24689737569c93e7ea7344ba6b0e.wav","sampleCount":7008,"rate":22050,"format":""}],"costumes":[{"costumeName":"Tabla-a","baseLayerID":-1,"baseLayerMD5":"68ce53b53fcc68744584c28d20144c4f.svg","bitmapResolution":1,"rotationCenterX":79,"rotationCenterY":67},{"costumeName":"Tabla-b","baseLayerID":-1,"baseLayerMD5":"01b6ffb8691d32be10fabc77ddfb55b0.svg","bitmapResolution":1,"rotationCenterX":86,"rotationCenterY":73}],"currentCostumeIndex":0,"scratchX":-50,"scratchY":-106,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Duck","md5":"c3baf7eedfbdac8cd1e4f1f1f779dc0c.svg","type":"sprite","tags":["animals","chrisg","quack","birds","birb"],"info":[0,1,1],"json":{"objName":"Duck","sounds":[{"soundName":"duck","soundID":-1,"md5":"af5b039e1b05e0ccb12944f648a8884e.wav","sampleCount":5792,"rate":22050,"format":""}],"costumes":[{"costumeName":"duck","baseLayerID":-1,"baseLayerMD5":"c3baf7eedfbdac8cd1e4f1f1f779dc0c.svg","bitmapResolution":1,"rotationCenterX":61,"rotationCenterY":59}],"currentCostumeIndex":0,"scratchX":60,"scratchY":49,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Earth","md5":"d9df2cf4f6eb2460d0de3e4f1e05f40b.svg","type":"sprite","tags":["space","planet","earth"],"info":[0,1,1],"json":{"objName":"Earth","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Earth","baseLayerID":-1,"baseLayerMD5":"d9df2cf4f6eb2460d0de3e4f1e05f40b.svg","bitmapResolution":1,"rotationCenterX":41,"rotationCenterY":40}],"currentCostumeIndex":0,"scratchX":57,"scratchY":-39,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Easel","md5":"edc81e35c94c07dc380c43ea9b311394.svg","type":"sprite","tags":["bedroom","art","easel"],"info":[0,3,1],"json":{"objName":"Easel","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Easel-a","baseLayerID":-1,"baseLayerMD5":"edc81e35c94c07dc380c43ea9b311394.svg","bitmapResolution":1,"rotationCenterX":69,"rotationCenterY":95},{"costumeName":"Easel-b","baseLayerID":-1,"baseLayerMD5":"cac798e8cf0364fa9a8bc52b85bda6b2.svg","bitmapResolution":1,"rotationCenterX":69,"rotationCenterY":95},{"costumeName":"Easel-c","baseLayerID":-1,"baseLayerMD5":"afbf42eb496694afb31f9ea69b3a1a7a.svg","bitmapResolution":1,"rotationCenterX":68,"rotationCenterY":94}],"currentCostumeIndex":0,"scratchX":182,"scratchY":-41,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Egg","md5":"6f1a24a63d16c45425aa2eb64934a278.svg","type":"sprite","tags":["food","breakfast","alex eben meyer"],"info":[0,6,1],"json":{"objName":"Egg","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"egg-a","baseLayerID":-1,"baseLayerMD5":"6f1a24a63d16c45425aa2eb64934a278.svg","bitmapResolution":1,"rotationCenterX":18,"rotationCenterY":26},{"costumeName":"egg-b","baseLayerID":-1,"baseLayerMD5":"7f1320549dd8bfd596c52aec02d898ce.svg","bitmapResolution":1,"rotationCenterX":23,"rotationCenterY":27},{"costumeName":"egg-c","baseLayerID":-1,"baseLayerMD5":"62ed6f412aae07a575faa51451009168.svg","bitmapResolution":1,"rotationCenterX":28,"rotationCenterY":27},{"costumeName":"egg-d","baseLayerID":-1,"baseLayerMD5":"0dce0615471ebf1bebc3ba8b4bebbd18.svg","bitmapResolution":1,"rotationCenterX":19,"rotationCenterY":27},{"costumeName":"egg-e","baseLayerID":-1,"baseLayerMD5":"3848cf5708b7c712bb7bb9bbcce636aa.svg","bitmapResolution":1,"rotationCenterX":20,"rotationCenterY":26},{"costumeName":"egg-f","baseLayerID":-1,"baseLayerMD5":"0f7e63d9f23038a5012409af93c8dfad.svg","bitmapResolution":1,"rotationCenterX":31,"rotationCenterY":26}],"currentCostumeIndex":0,"scratchX":-102,"scratchY":53,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Elephant","md5":"b3515b3805938b0fae4e527aa0b4524e.svg","type":"sprite","tags":["animals","mammals","pachydermata"],"info":[0,2,1],"json":{"objName":"Elephant","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"elephant-a","baseLayerID":-1,"baseLayerMD5":"b3515b3805938b0fae4e527aa0b4524e.svg","bitmapResolution":1,"rotationCenterX":107,"rotationCenterY":33},{"costumeName":"elephant-b","baseLayerID":-1,"baseLayerMD5":"bce91fa266220d3679a4c19c4e38b1f7.svg","bitmapResolution":1,"rotationCenterX":95,"rotationCenterY":40}],"currentCostumeIndex":0,"scratchX":-51,"scratchY":-17,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Elf","md5":"00748a750dc4fd754ce4debb5e3595c0.svg","type":"sprite","tags":["fantasy","people","ipzy","emotions"],"info":[0,5,1],"json":{"objName":"Elf","sounds":[{"soundName":"Magic Spell","soundID":-1,"md5":"1cb60ecdb1075c8769cb346d5c2a22c7.wav","sampleCount":43077,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"elf-a","baseLayerID":-1,"baseLayerMD5":"00748a750dc4fd754ce4debb5e3595c0.svg","bitmapResolution":1,"rotationCenterX":50,"rotationCenterY":140},{"costumeName":"elf-b","baseLayerID":-1,"baseLayerMD5":"91815a19569ef9f0ef68bca56bb80446.svg","bitmapResolution":1,"rotationCenterX":50,"rotationCenterY":140},{"costumeName":"elf-c","baseLayerID":-1,"baseLayerMD5":"8153eaf84bc3db9a671cafd34506243b.svg","bitmapResolution":1,"rotationCenterX":50,"rotationCenterY":140},{"costumeName":"elf-d","baseLayerID":-1,"baseLayerMD5":"2432797fc69a62fc643505b0ba039169.svg","bitmapResolution":1,"rotationCenterX":50,"rotationCenterY":140},{"costumeName":"elf-e","baseLayerID":-1,"baseLayerMD5":"a06e6c93b143ae2a7b776bd1deee6b59.svg","bitmapResolution":1,"rotationCenterX":50,"rotationCenterY":140}],"currentCostumeIndex":0,"scratchX":39,"scratchY":-15,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Fairy","md5":"fe97687c7f1b747bb6f41c252cc5926a.svg","type":"sprite","tags":["fantasy","people","ipzy","emotions"],"info":[0,5,1],"json":{"objName":"Fairy","sounds":[{"soundName":"Magic Spell","soundID":-1,"md5":"1cb60ecdb1075c8769cb346d5c2a22c7.wav","sampleCount":43077,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"fairy-a","baseLayerID":-1,"baseLayerMD5":"fe97687c7f1b747bb6f41c252cc5926a.svg","bitmapResolution":1,"rotationCenterX":85,"rotationCenterY":140},{"costumeName":"fairy-b","baseLayerID":-1,"baseLayerMD5":"c8e0d935b2e4372ecc813705a79be3eb.svg","bitmapResolution":1,"rotationCenterX":85,"rotationCenterY":140},{"costumeName":"fairy-c","baseLayerID":-1,"baseLayerMD5":"4d0740d1b5be93256ad235062daa876b.svg","bitmapResolution":1,"rotationCenterX":85,"rotationCenterY":140},{"costumeName":"fairy-d","baseLayerID":-1,"baseLayerMD5":"ca555dadd377431e38a3bc67ece4d36a.svg","bitmapResolution":1,"rotationCenterX":85,"rotationCenterY":140},{"costumeName":"fairy-e","baseLayerID":-1,"baseLayerMD5":"a681f6d6044abdebcdd6634ce85da484.svg","bitmapResolution":1,"rotationCenterX":85,"rotationCenterY":140}],"currentCostumeIndex":0,"scratchX":-24,"scratchY":-21,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Fish","md5":"8598752b1b7b9892c23817c4ed848e7d.svg","type":"sprite","tags":["animals","ocean","sea","underwater","daria skrybchencko"],"info":[0,4,2],"json":{"objName":"Fish","sounds":[{"soundName":"bubbles","soundID":-1,"md5":"78b0be9c9c2f664158b886bc7e794095.wav","sampleCount":45056,"rate":11025,"format":""},{"soundName":"ocean wave","soundID":-1,"md5":"c904610d770398b98872a708a2f75611.wav","sampleCount":99206,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"fish-a","baseLayerID":-1,"baseLayerMD5":"8598752b1b7b9892c23817c4ed848e7d.svg","bitmapResolution":1,"rotationCenterX":63,"rotationCenterY":45},{"costumeName":"fish-b","baseLayerID":-1,"baseLayerMD5":"52032e4310f9855b89f873b528a5e928.svg","bitmapResolution":1,"rotationCenterX":63,"rotationCenterY":45},{"costumeName":"fish-c","baseLayerID":-1,"baseLayerMD5":"06c139dcfe45bf31ef45e7030b77dc36.svg","bitmapResolution":1,"rotationCenterX":63,"rotationCenterY":45},{"costumeName":"fish-d","baseLayerID":-1,"baseLayerMD5":"6a3a2c97374c157e0dbc0a03c2079284.svg","bitmapResolution":1,"rotationCenterX":63,"rotationCenterY":45}],"currentCostumeIndex":0,"scratchX":38,"scratchY":-53,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Fishbowl","md5":"9d1013e04ca7425f680a4b4e6dd6ede6.svg","type":"sprite","tags":["fishbowl","fish","animals","pet"],"info":[0,2,1],"json":{"objName":"Fishbowl","sounds":[{"soundName":"water drop","soundID":-1,"md5":"aa488de9e2c871e9d4faecd246ed737a.wav","sampleCount":8136,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"Fishbowl-a","baseLayerID":-1,"baseLayerMD5":"9d1013e04ca7425f680a4b4e6dd6ede6.svg","bitmapResolution":1,"rotationCenterX":28,"rotationCenterY":24},{"costumeName":"Fishbowl-b","baseLayerID":-1,"baseLayerMD5":"0bbfc827e8d2f3da6db82efe95563f93.svg","bitmapResolution":1,"rotationCenterX":28,"rotationCenterY":24}],"currentCostumeIndex":0,"scratchX":-34,"scratchY":74,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Food Truck","md5":"b30ec8ff043e0f1747591d564d56d7fa.svg","type":"sprite","tags":["city","truck","vehicle","food","car"],"info":[0,3,3],"json":{"objName":"Food Truck","sounds":[{"soundName":"car horn","soundID":-1,"md5":"7c887f6a2ecd1cdb85d5527898d7f7a0.wav","sampleCount":42443,"rate":22050,"format":"adpcm"},{"soundName":"clown honk","soundID":-1,"md5":"ec66961f188e9b8a9c75771db744d096.wav","sampleCount":9009,"rate":22050,"format":"adpcm"},{"soundName":"car vroom","soundID":-1,"md5":"ead1da4a87ff6cb53441142f7ac37b8f.wav","sampleCount":43358,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"Food Truck-a","baseLayerID":-1,"baseLayerMD5":"b30ec8ff043e0f1747591d564d56d7fa.svg","bitmapResolution":1,"rotationCenterX":121,"rotationCenterY":125},{"costumeName":"Food Truck-b","baseLayerID":-1,"baseLayerMD5":"afd51531621d2b33869b47342311b363.svg","bitmapResolution":1,"rotationCenterX":121,"rotationCenterY":101},{"costumeName":"Food Truck-c","baseLayerID":-1,"baseLayerMD5":"42f88485a25bf9a683d28957db9f969f.svg","bitmapResolution":1,"rotationCenterX":121,"rotationCenterY":92}],"currentCostumeIndex":0,"scratchX":-50,"scratchY":-54,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Football","md5":"7ee31371b2eafba57cc5a78fc1a787fe.png","type":"sprite","tags":["people","sports"],"info":[0,2,1],"json":{"objName":"Football","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"football running","baseLayerID":-1,"baseLayerMD5":"7ee31371b2eafba57cc5a78fc1a787fe.png","bitmapResolution":2,"rotationCenterX":92,"rotationCenterY":200},{"costumeName":"football standing","baseLayerID":-1,"baseLayerMD5":"c717def72c8bd98749284d31b51d7097.png","bitmapResolution":2,"rotationCenterX":74,"rotationCenterY":200}],"currentCostumeIndex":0,"scratchX":-41,"scratchY":-39,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Fortune Cookie","md5":"c56dcaa1fa4e3c9740142b93d5982850.png","type":"sprite","tags":["food"],"info":[0,1,1],"json":{"objName":"Fortune Cookie","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"fortune cookie","baseLayerID":-1,"baseLayerMD5":"c56dcaa1fa4e3c9740142b93d5982850.png","bitmapResolution":2,"rotationCenterX":60,"rotationCenterY":62}],"currentCostumeIndex":0,"scratchX":-5,"scratchY":-46,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Fox","md5":"0aef4633e8580e209020b054eb55982f.svg","type":"sprite","tags":["animals","mammal","robert hunter"],"info":[0,3,1],"json":{"objName":"Fox","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"fox-a","baseLayerID":-1,"baseLayerMD5":"0aef4633e8580e209020b054eb55982f.svg","bitmapResolution":1,"rotationCenterX":86,"rotationCenterY":44},{"costumeName":"fox-b","baseLayerID":-1,"baseLayerMD5":"ae0bb1b900e853ddc8820e0c7bd60f53.svg","bitmapResolution":1,"rotationCenterX":44,"rotationCenterY":50},{"costumeName":"fox-c","baseLayerID":-1,"baseLayerMD5":"3cc3761cbabdcf13dbfdf04048bfbccf.svg","bitmapResolution":1,"rotationCenterX":48,"rotationCenterY":38}],"currentCostumeIndex":0,"scratchX":32,"scratchY":-124,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Frank","md5":"8ebcc9a619ae0455df9da42d39f59c1d.svg","type":"sprite","tags":["fantasy","spooky","people","halloween","frankenstein","monster","alex eben meyer"],"info":[0,4,1],"json":{"objName":"Frank","sounds":[{"soundName":"wolf howl","soundID":-1,"md5":"5e36d74bb16aa5085b901362788b0fbf.wav","sampleCount":43008,"rate":11025,"format":""}],"costumes":[{"costumeName":"frank-a","baseLayerID":-1,"baseLayerMD5":"8ebcc9a619ae0455df9da42d39f59c1d.svg","bitmapResolution":1,"rotationCenterX":97,"rotationCenterY":63},{"costumeName":"frank-b","baseLayerID":-1,"baseLayerMD5":"e605b9d87181c52825ae21597c9c1e07.svg","bitmapResolution":1,"rotationCenterX":105,"rotationCenterY":63},{"costumeName":"frank-c","baseLayerID":-1,"baseLayerMD5":"a53378250f07b6dad161516a5317277e.svg","bitmapResolution":1,"rotationCenterX":159,"rotationCenterY":59},{"costumeName":"frank-d","baseLayerID":-1,"baseLayerMD5":"44b4ba838b60f14d6e7ebddf5df4d4c4.svg","bitmapResolution":1,"rotationCenterX":106,"rotationCenterY":107}],"currentCostumeIndex":0,"scratchX":-115,"scratchY":-46,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Frog","md5":"285483a688eed2ff8010c65112f99c41.svg","type":"sprite","tags":["animals","amphibian","nature","hopping","green","wart"],"info":[0,1,1],"json":{"objName":"Frog","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"frog","baseLayerID":-1,"baseLayerMD5":"285483a688eed2ff8010c65112f99c41.svg","bitmapResolution":1,"rotationCenterX":48,"rotationCenterY":30}],"currentCostumeIndex":0,"scratchX":-19,"scratchY":-11,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Frog 2 ","md5":"07160d455202e95f5b4b5c842eff6788.svg","type":"sprite","tags":["animals","insect","bug","wetland","owen davey"],"info":[0,3,1],"json":{"objName":"Frog 2 ","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Frog 2-a","baseLayerID":-1,"baseLayerMD5":"07160d455202e95f5b4b5c842eff6788.svg","bitmapResolution":1,"rotationCenterX":101,"rotationCenterY":60},{"costumeName":"Frog 2-b","baseLayerID":-1,"baseLayerMD5":"9663ddb4d100eb4e18702ee13eca835e.svg","bitmapResolution":1,"rotationCenterX":101,"rotationCenterY":58},{"costumeName":"Frog 2-c","baseLayerID":-1,"baseLayerMD5":"5c2ec9de8d1695cd4b59beea45046560.svg","bitmapResolution":1,"rotationCenterX":96,"rotationCenterY":87}],"currentCostumeIndex":0,"scratchX":-19,"scratchY":-6,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Fruit Platter","md5":"6c3252378da3334f63eebddbed3fae91.png","type":"sprite","tags":["food"],"info":[0,1,1],"json":{"objName":"Fruit Platter","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"fruit platter","baseLayerID":-1,"baseLayerMD5":"6c3252378da3334f63eebddbed3fae91.png","bitmapResolution":2,"rotationCenterX":148,"rotationCenterY":78}],"currentCostumeIndex":0,"scratchX":-24,"scratchY":7,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Fruit Salad","md5":"dbf8cc34f7ca18b4a008d2890dba56b7.svg","type":"sprite","tags":["food","fruit"],"info":[0,1,1],"json":{"objName":"Fruit Salad","sounds":[{"soundName":"Chomp","soundID":-1,"md5":"0b1e3033140d094563248e61de4039e5.wav","sampleCount":2912,"rate":11025,"format":""}],"costumes":[{"costumeName":"fruitsalad","baseLayerID":-1,"baseLayerMD5":"dbf8cc34f7ca18b4a008d2890dba56b7.svg","bitmapResolution":1,"rotationCenterX":30,"rotationCenterY":22}],"currentCostumeIndex":0,"scratchX":27,"scratchY":0,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Ghost","md5":"fca9fdf3ec9aafcfbd915105fecb6ce6.svg","type":"sprite","tags":["fantasy","spooky","halloween","ghoul","monster","alex eben meyer"],"info":[0,4,1],"json":{"objName":"Ghost","sounds":[{"soundName":"space ripple","soundID":-1,"md5":"ff8b8c3bf841a11fd5fe3afaa92be1b5.wav","sampleCount":41149,"rate":11025,"format":""}],"costumes":[{"costumeName":"ghost-a","baseLayerID":-1,"baseLayerMD5":"fca9fdf3ec9aafcfbd915105fecb6ce6.svg","bitmapResolution":1,"rotationCenterX":37,"rotationCenterY":68},{"costumeName":"ghost-b","baseLayerID":-1,"baseLayerMD5":"9d6e168d234d023476324cb72430e645.svg","bitmapResolution":1,"rotationCenterX":41,"rotationCenterY":68},{"costumeName":"ghost-c","baseLayerID":-1,"baseLayerMD5":"8296c8aa0782b53c5188dabde5fce10f.svg","bitmapResolution":1,"rotationCenterX":61,"rotationCenterY":72},{"costumeName":"ghost-d","baseLayerID":-1,"baseLayerMD5":"2a3c6eb1faa6b2e4403c64945d59e122.svg","bitmapResolution":1,"rotationCenterX":78,"rotationCenterY":69}],"currentCostumeIndex":0,"scratchX":42,"scratchY":27,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Gift","md5":"abeae2217b3ce67b1ff761cd7a89274d.svg","type":"sprite","tags":["thing","holiday"],"info":[0,2,1],"json":{"objName":"Gift","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"gift-a","baseLayerID":-1,"baseLayerMD5":"abeae2217b3ce67b1ff761cd7a89274d.svg","bitmapResolution":1,"rotationCenterX":33,"rotationCenterY":25},{"costumeName":"gift-b","baseLayerID":-1,"baseLayerMD5":"5cae973c98f2d98b51e6c6b3c9602f8c.svg","bitmapResolution":1,"rotationCenterX":33,"rotationCenterY":26}],"currentCostumeIndex":0,"scratchX":26,"scratchY":28,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Giga","md5":"93cb048a1d199f92424b9c097fa5fa38.svg","type":"sprite","tags":["fantasy","drawing"],"info":[0,4,1],"json":{"objName":"Giga","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"giga-a","baseLayerID":-1,"baseLayerMD5":"93cb048a1d199f92424b9c097fa5fa38.svg","bitmapResolution":1,"rotationCenterX":72,"rotationCenterY":96},{"costumeName":"giga-b","baseLayerID":-1,"baseLayerMD5":"528613711a7eae3a929025be04db081c.svg","bitmapResolution":1,"rotationCenterX":72,"rotationCenterY":96},{"costumeName":"giga-c","baseLayerID":-1,"baseLayerMD5":"ee4dd21d7ca6d1b889ee25d245cbcc66.svg","bitmapResolution":1,"rotationCenterX":73,"rotationCenterY":96},{"costumeName":"giga-d","baseLayerID":-1,"baseLayerMD5":"7708e2d9f83a01476ee6d17aa540ddf1.svg","bitmapResolution":1,"rotationCenterX":73,"rotationCenterY":96}],"currentCostumeIndex":0,"scratchX":36,"scratchY":20,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Giga Walking","md5":"f76bc420011db2cdb2de378c1536f6da.svg","type":"sprite","tags":["fantasy","walking"],"info":[0,3,1],"json":{"objName":"Giga Walking","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Giga walk1","baseLayerID":-1,"baseLayerMD5":"f76bc420011db2cdb2de378c1536f6da.svg","bitmapResolution":1,"rotationCenterX":70,"rotationCenterY":107},{"costumeName":"Giga walk2","baseLayerID":-1,"baseLayerMD5":"43b5874e8a54f93bd02727f0abf6905b.svg","bitmapResolution":1,"rotationCenterX":71,"rotationCenterY":107},{"costumeName":"Giga walk3","baseLayerID":-1,"baseLayerMD5":"9aab3bbb375765391978be4f6d478ab3.svg","bitmapResolution":1,"rotationCenterX":71,"rotationCenterY":107}],"currentCostumeIndex":0,"scratchX":160,"scratchY":-114,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Giraffe","md5":"2d3955997d2b3aa8dad9389c61de384f.svg","type":"sprite","tags":["animals","savanna","robert hunter"],"info":[0,3,1],"json":{"objName":"Giraffe","sounds":[{"soundName":"horse gallop","soundID":-1,"md5":"058a34b5fb8b57178b5322d994b6b8c8.wav","sampleCount":38336,"rate":11025,"format":""}],"costumes":[{"costumeName":"giraffe-a","baseLayerID":-1,"baseLayerMD5":"2d3955997d2b3aa8dad9389c61de384f.svg","bitmapResolution":1,"rotationCenterX":87,"rotationCenterY":132},{"costumeName":"giraffe-b","baseLayerID":-1,"baseLayerMD5":"b129c6016fedc7d03fb7f0a06363af28.svg","bitmapResolution":1,"rotationCenterX":82,"rotationCenterY":132},{"costumeName":"giraffe-c","baseLayerID":-1,"baseLayerMD5":"1af467957df0350765ba9a10e8d85572.svg","bitmapResolution":1,"rotationCenterX":86,"rotationCenterY":132}],"currentCostumeIndex":0,"scratchX":-130,"scratchY":10,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glass Water","md5":"c364b9e1f4bcdc61705032d89eaaa0a1.svg","type":"sprite","tags":["food","things","underwater"],"info":[0,2,1],"json":{"objName":"Glass Water","sounds":[{"soundName":"Water Drop","soundID":-1,"md5":"aa488de9e2c871e9d4faecd246ed737a.wav","sampleCount":8136,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"glass water-a","baseLayerID":-1,"baseLayerMD5":"c364b9e1f4bcdc61705032d89eaaa0a1.svg","bitmapResolution":1,"rotationCenterX":39,"rotationCenterY":48},{"costumeName":"glass water-b","baseLayerID":-1,"baseLayerMD5":"bc07ce6a2004ac91ce704531a1c526e5.svg","bitmapResolution":1,"rotationCenterX":39,"rotationCenterY":48}],"currentCostumeIndex":0,"scratchX":43,"scratchY":-10,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glasses","md5":"f42180039c37c3b221e1e426b92e5092.svg","type":"sprite","tags":["fashion","glasses","clothing"],"info":[0,4,1],"json":{"objName":"Glasses","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"glasses-a","baseLayerID":-1,"baseLayerMD5":"f42180039c37c3b221e1e426b92e5092.svg","bitmapResolution":1,"rotationCenterX":33,"rotationCenterY":13},{"costumeName":"glasses-b","baseLayerID":-1,"baseLayerMD5":"58b728ee8c1f739e2de13800dee562de.svg","bitmapResolution":1,"rotationCenterX":35,"rotationCenterY":14},{"costumeName":"glasses-c","baseLayerID":-1,"baseLayerMD5":"d8bf373e1fcbb46f6eb8d225ba01613e.svg","bitmapResolution":1,"rotationCenterX":34,"rotationCenterY":12},{"costumeName":"glasses-e","baseLayerID":-1,"baseLayerMD5":"6b706718a8c350522c3f29fb82b40327.svg","bitmapResolution":1,"rotationCenterX":39,"rotationCenterY":53}],"currentCostumeIndex":0,"scratchX":39,"scratchY":100,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Goalie","md5":"dbf6a1b0402377be2cd8c75a3b4fdf53.svg","type":"sprite","tags":["sports","soccer","football","alex eben meyer"],"info":[0,5,1],"json":{"objName":"Goalie","sounds":[{"soundName":"cheer","soundID":-1,"md5":"170e05c29d50918ae0b482c2955768c0.wav","sampleCount":108864,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"goalie-a","baseLayerID":-1,"baseLayerMD5":"dbf6a1b0402377be2cd8c75a3b4fdf53.svg","bitmapResolution":1,"rotationCenterX":59,"rotationCenterY":63},{"costumeName":"goalie-b","baseLayerID":-1,"baseLayerMD5":"987d8c2bb6c26cad265a3aa339fe432e.svg","bitmapResolution":1,"rotationCenterX":59,"rotationCenterY":63},{"costumeName":"goalie-c","baseLayerID":-1,"baseLayerMD5":"52609ef559a29052e72efe08d1384980.svg","bitmapResolution":1,"rotationCenterX":62,"rotationCenterY":61},{"costumeName":"goalie-d","baseLayerID":-1,"baseLayerMD5":"a4de535b4c4a7c6a65e6736491e01497.svg","bitmapResolution":1,"rotationCenterX":63,"rotationCenterY":62},{"costumeName":"goalie-e","baseLayerID":-1,"baseLayerMD5":"ca55a23f3172e9fff061484e00493d2c.svg","bitmapResolution":1,"rotationCenterX":59,"rotationCenterY":69}],"currentCostumeIndex":0,"scratchX":-5,"scratchY":39,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Goblin","md5":"f10eaedff51f50f0809a7b4b310337fa.svg","type":"sprite","tags":["fantasy","ipzy","emotions"],"info":[0,4,1],"json":{"objName":"Goblin","sounds":[{"soundName":"fairydust","soundID":-1,"md5":"b92de59d992a655c1b542223a784cda6.wav","sampleCount":11247,"rate":22050,"format":""}],"costumes":[{"costumeName":"goblin-a","baseLayerID":-1,"baseLayerMD5":"f10eaedff51f50f0809a7b4b310337fa.svg","bitmapResolution":1,"rotationCenterX":40,"rotationCenterY":80},{"costumeName":"goblin-b","baseLayerID":-1,"baseLayerMD5":"71e7c77d89299cd99739b1216fc03a85.svg","bitmapResolution":1,"rotationCenterX":40,"rotationCenterY":80},{"costumeName":"goblin-c","baseLayerID":-1,"baseLayerMD5":"ab0611427d6f9b54d83672cf9e554876.svg","bitmapResolution":1,"rotationCenterX":40,"rotationCenterY":80},{"costumeName":"goblin-d","baseLayerID":-1,"baseLayerMD5":"87dd413e7a8545bea9b3da208a5d5735.svg","bitmapResolution":1,"rotationCenterX":40,"rotationCenterY":80}],"currentCostumeIndex":0,"scratchX":123,"scratchY":-66,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Gobo","md5":"1f5ea0d12f85aed2e471cdd21b0bd6d7.svg","type":"sprite","tags":["fantasy","drawing","jenkins","ganglia"],"info":[0,3,1],"json":{"objName":"Gobo","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"gobo-a","baseLayerID":-1,"baseLayerMD5":"1f5ea0d12f85aed2e471cdd21b0bd6d7.svg","bitmapResolution":1,"rotationCenterX":47,"rotationCenterY":55},{"costumeName":"gobo-b","baseLayerID":-1,"baseLayerMD5":"73e493e4abd5d0954b677b97abcb7116.svg","bitmapResolution":1,"rotationCenterX":47,"rotationCenterY":55},{"costumeName":"gobo-c","baseLayerID":-1,"baseLayerMD5":"bc68a6bdf300df7b53d73b38f74c844e.svg","bitmapResolution":1,"rotationCenterX":47,"rotationCenterY":55}],"currentCostumeIndex":0,"scratchX":-33,"scratchY":25,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Grasshopper","md5":"fcddf46c04479b07b2944ee36d0b7635.svg","type":"sprite","tags":["animals","insect","bug","wetland","owen davey"],"info":[0,6,1],"json":{"objName":"Grasshopper","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Grasshopper-a","baseLayerID":-1,"baseLayerMD5":"fcddf46c04479b07b2944ee36d0b7635.svg","bitmapResolution":1,"rotationCenterX":103,"rotationCenterY":43},{"costumeName":"Grasshopper-b","baseLayerID":-1,"baseLayerMD5":"40b48bcb95f06a2281ba1cad60c8c504.svg","bitmapResolution":1,"rotationCenterX":114,"rotationCenterY":118},{"costumeName":"Grasshopper-c","baseLayerID":-1,"baseLayerMD5":"fa9a02a4a6df86612365dc65c065d2cb.svg","bitmapResolution":1,"rotationCenterX":34,"rotationCenterY":170},{"costumeName":"Grasshopper-d","baseLayerID":-1,"baseLayerMD5":"f80ba703a7fb17a870ec0818add2f3b8.svg","bitmapResolution":1,"rotationCenterX":70,"rotationCenterY":100},{"costumeName":"Grasshopper-e","baseLayerID":-1,"baseLayerMD5":"6519eeaa65eac086198d6901cf0a5b9e.svg","bitmapResolution":1,"rotationCenterX":56,"rotationCenterY":86},{"costumeName":"Grasshopper-f","baseLayerID":-1,"baseLayerMD5":"8d865e6bbea03cda509d766085b883f4.svg","bitmapResolution":1,"rotationCenterX":22,"rotationCenterY":54}],"currentCostumeIndex":0,"scratchX":-7,"scratchY":-115,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Green Flag","md5":"173e20ac537d2c278ed621be3db3fc87.svg","type":"sprite","tags":["thing"],"info":[0,1,1],"json":{"objName":"Green Flag","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"green flag","baseLayerID":-1,"baseLayerMD5":"173e20ac537d2c278ed621be3db3fc87.svg","bitmapResolution":1,"rotationCenterX":70,"rotationCenterY":30}],"currentCostumeIndex":0,"scratchX":-36,"scratchY":39,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Griffin","md5":"1ceea469ec409d0a3a13bd04ea1e756c.svg","type":"sprite","tags":["fantasy","animals","ipzy","flying"],"info":[0,4,1],"json":{"objName":"Griffin","sounds":[{"soundName":"Magic Spell","soundID":-1,"md5":"1cb60ecdb1075c8769cb346d5c2a22c7.wav","sampleCount":43077,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"Griffin-a","baseLayerID":-1,"baseLayerMD5":"1ceea469ec409d0a3a13bd04ea1e756c.svg","bitmapResolution":1,"rotationCenterX":127,"rotationCenterY":109},{"costumeName":"Griffin-b","baseLayerID":-1,"baseLayerMD5":"1dd10e8e53c048ad6f95c82501801f48.svg","bitmapResolution":1,"rotationCenterX":127,"rotationCenterY":76},{"costumeName":"Griffin-c","baseLayerID":-1,"baseLayerMD5":"e4d7c3c18463f15083683ce0826adcee.svg","bitmapResolution":1,"rotationCenterX":127,"rotationCenterY":109},{"costumeName":"Griffin-d","baseLayerID":-1,"baseLayerMD5":"54504b1d8dedf816b0bd599e768f191d.svg","bitmapResolution":1,"rotationCenterX":144,"rotationCenterY":69}],"currentCostumeIndex":0,"scratchX":-18,"scratchY":-4,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Guitar","md5":"cb8c2a5e69da7538e1dd73cb7ff4a666.svg","type":"sprite","tags":["music","andrew rae"],"info":[0,2,8],"json":{"objName":"Guitar","sounds":[{"soundName":"C Guitar","soundID":-1,"md5":"22baa07795a9a524614075cdea543793.wav","sampleCount":44864,"rate":22050,"format":""},{"soundName":"D Guitar","soundID":-1,"md5":"2dbcfae6a55738f94bbb40aa5fcbf7ce.wav","sampleCount":41120,"rate":22050,"format":""},{"soundName":"E Guitar","soundID":-1,"md5":"4b5d1da83e59bf35578324573c991666.wav","sampleCount":38400,"rate":22050,"format":""},{"soundName":"F Guitar","soundID":-1,"md5":"b51d086aeb1921ec405561df52ecbc50.wav","sampleCount":36416,"rate":22050,"format":""},{"soundName":"G Guitar","soundID":-1,"md5":"98a835713ecea2f3ef9f4f442d52ad20.wav","sampleCount":33600,"rate":22050,"format":""},{"soundName":"A Guitar","soundID":-1,"md5":"ee753e87d212d4b2fb650ca660f1e839.wav","sampleCount":31872,"rate":22050,"format":""},{"soundName":"B Guitar","soundID":-1,"md5":"2ae2d67de62df8ca54d638b4ad2466c3.wav","sampleCount":29504,"rate":22050,"format":""},{"soundName":"C2 guitar","soundID":-1,"md5":"c8d2851bd99d8e0ce6c1f05e4acc7f34.wav","sampleCount":27712,"rate":22050,"format":""}],"costumes":[{"costumeName":"guitar-a","baseLayerID":-1,"baseLayerMD5":"cb8c2a5e69da7538e1dd73cb7ff4a666.svg","bitmapResolution":1,"rotationCenterX":47,"rotationCenterY":83},{"costumeName":"guitar-b","baseLayerID":-1,"baseLayerMD5":"fed44bd1091628c060f45060a84f2885.svg","bitmapResolution":1,"rotationCenterX":47,"rotationCenterY":83}],"currentCostumeIndex":0,"scratchX":-150,"scratchY":9,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Guitar-electric1","md5":"b2b469b9d11fd23bdd671eab94dc58ff.svg","type":"sprite","tags":["music","andrew rae"],"info":[0,2,8],"json":{"objName":"Guitar-electric1","sounds":[{"soundName":"C Elec Guitar","soundID":-1,"md5":"0d340de02e14bebaf8dfa0e43eb3f1f9.wav","sampleCount":44100,"rate":22050,"format":""},{"soundName":"D Elec Guitar","soundID":-1,"md5":"1b5de9866801eb2f9d4f57c7c3b473f5.wav","sampleCount":44100,"rate":22050,"format":""},{"soundName":"E Elec Guitar","soundID":-1,"md5":"2e6a6ae3e0f72bf78c74def8130f459a.wav","sampleCount":44100,"rate":22050,"format":""},{"soundName":"F Elec Guitar","soundID":-1,"md5":"5eb00f15f21f734986aa45156d44478d.wav","sampleCount":44100,"rate":22050,"format":""},{"soundName":"G Elec Guitar","soundID":-1,"md5":"cd0d0e7dad415b2ffa2ba7a61860eaf8.wav","sampleCount":44100,"rate":22050,"format":""},{"soundName":"A Elec Guitar","soundID":-1,"md5":"fa5f7fea601e9368dd68449d9a54c995.wav","sampleCount":44100,"rate":22050,"format":""},{"soundName":"B Elec Guitar","soundID":-1,"md5":"81f142d0b00189703d7fe9b1f13f6f87.wav","sampleCount":44100,"rate":22050,"format":""},{"soundName":"C2 Elec Guitar","soundID":-1,"md5":"3a8ed3129f22cba5b0810bc030d16b5f.wav","sampleCount":44100,"rate":22050,"format":""}],"costumes":[{"costumeName":"guitar-electric1-a","baseLayerID":-1,"baseLayerMD5":"b2b469b9d11fd23bdd671eab94dc58ff.svg","bitmapResolution":1,"rotationCenterX":42,"rotationCenterY":85},{"costumeName":"guitar-electric1-b","baseLayerID":-1,"baseLayerMD5":"3632184c19c66a088a99568570d61b13.svg","bitmapResolution":1,"rotationCenterX":42,"rotationCenterY":85}],"currentCostumeIndex":0,"scratchX":-122,"scratchY":-19,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Guitar-electric2","md5":"1fc433b89038f9e16092c9f4d7514cca.svg","type":"sprite","tags":["music","andrew rae"],"info":[0,2,8],"json":{"objName":"Guitar-electric2","sounds":[{"soundName":"C Elec Guitar","soundID":-1,"md5":"0d340de02e14bebaf8dfa0e43eb3f1f9.wav","sampleCount":44100,"rate":22050,"format":""},{"soundName":"D Elec Guitar","soundID":-1,"md5":"1b5de9866801eb2f9d4f57c7c3b473f5.wav","sampleCount":44100,"rate":22050,"format":""},{"soundName":"E Elec Guitar","soundID":-1,"md5":"2e6a6ae3e0f72bf78c74def8130f459a.wav","sampleCount":44100,"rate":22050,"format":""},{"soundName":"F Elec Guitar","soundID":-1,"md5":"5eb00f15f21f734986aa45156d44478d.wav","sampleCount":44100,"rate":22050,"format":""},{"soundName":"G Elec Guitar","soundID":-1,"md5":"cd0d0e7dad415b2ffa2ba7a61860eaf8.wav","sampleCount":44100,"rate":22050,"format":""},{"soundName":"A Elec Guitar","soundID":-1,"md5":"fa5f7fea601e9368dd68449d9a54c995.wav","sampleCount":44100,"rate":22050,"format":""},{"soundName":"B Elec Guitar","soundID":-1,"md5":"81f142d0b00189703d7fe9b1f13f6f87.wav","sampleCount":44100,"rate":22050,"format":""},{"soundName":"C2 Elec Guitar","soundID":-1,"md5":"3a8ed3129f22cba5b0810bc030d16b5f.wav","sampleCount":44100,"rate":22050,"format":""}],"costumes":[{"costumeName":"guitar-electric2-a","baseLayerID":-1,"baseLayerMD5":"1fc433b89038f9e16092c9f4d7514cca.svg","bitmapResolution":1,"rotationCenterX":38,"rotationCenterY":94},{"costumeName":"guitar-electric2-b","baseLayerID":-1,"baseLayerMD5":"7b843dbc93d4b2ea31fa67cca3d5077c.svg","bitmapResolution":1,"rotationCenterX":38,"rotationCenterY":94}],"currentCostumeIndex":0,"scratchX":-99,"scratchY":17,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Hannah","md5":"b983d99560313e38b4b3cd36cbd5f0d1.png","type":"sprite","tags":["people","sports"],"info":[0,3,1],"json":{"objName":"Hannah","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"hannah-a","baseLayerID":-1,"baseLayerMD5":"b983d99560313e38b4b3cd36cbd5f0d1.png","bitmapResolution":2,"rotationCenterX":138,"rotationCenterY":126},{"costumeName":"hannah-b","baseLayerID":-1,"baseLayerMD5":"d0c3b4b24fbf1152de3ebb68f6b875ae.png","bitmapResolution":2,"rotationCenterX":48,"rotationCenterY":160},{"costumeName":"hannah-c","baseLayerID":-1,"baseLayerMD5":"5fdce07935156bbcf943793fa84e826c.png","bitmapResolution":2,"rotationCenterX":170,"rotationCenterY":130}],"currentCostumeIndex":0,"scratchX":34,"scratchY":1,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Hare","md5":"8209c43050785e3c4276f84abb52c245.svg","type":"sprite","tags":["animals","rabbit","cold","north pole","south pole","ice","antarctica","arctic","robert hunter"],"info":[0,3,1],"json":{"objName":"Hare","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"hare-a","baseLayerID":-1,"baseLayerMD5":"8209c43050785e3c4276f84abb52c245.svg","bitmapResolution":1,"rotationCenterX":29,"rotationCenterY":50},{"costumeName":"hare-b","baseLayerID":-1,"baseLayerMD5":"62796e48dc8e540398e0575d79f562fe.svg","bitmapResolution":1,"rotationCenterX":57,"rotationCenterY":35},{"costumeName":"hare-c","baseLayerID":-1,"baseLayerMD5":"4bc5c29283dfff4b9c876cc23540a4b5.svg","bitmapResolution":1,"rotationCenterX":40,"rotationCenterY":40}],"currentCostumeIndex":0,"scratchX":-191,"scratchY":-54,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Harper","md5":"0d5979db40b0a4dcaa601fb7679ef71c.svg","type":"sprite","tags":["people","fashion","clothing"],"info":[0,3,1],"json":{"objName":"Harper","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"harper-a","baseLayerID":-1,"baseLayerMD5":"0d5979db40b0a4dcaa601fb7679ef71c.svg","bitmapResolution":1,"rotationCenterX":54,"rotationCenterY":143},{"costumeName":"harper-b","baseLayerID":-1,"baseLayerMD5":"c435a1fcdf5f60a29f620fa800e391e0.svg","bitmapResolution":1,"rotationCenterX":54,"rotationCenterY":134},{"costumeName":"harper-c","baseLayerID":-1,"baseLayerMD5":"9c35763ec87604ff1b4848ff18e0b040.svg","bitmapResolution":1,"rotationCenterX":56,"rotationCenterY":138}],"currentCostumeIndex":0,"scratchX":38,"scratchY":18,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Hat1 ","md5":"52540f9dba4537f79f1ad3067d44e3f6.svg","type":"sprite","tags":["fashion","hat","clothing"],"info":[0,4,1],"json":{"objName":"Hat1 ","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"hat-a","baseLayerID":-1,"baseLayerMD5":"52540f9dba4537f79f1ad3067d44e3f6.svg","bitmapResolution":1,"rotationCenterX":37,"rotationCenterY":30},{"costumeName":"hat-b","baseLayerID":-1,"baseLayerMD5":"874462b3e079308d775629c235940d8f.svg","bitmapResolution":1,"rotationCenterX":39,"rotationCenterY":22},{"costumeName":"hat-c","baseLayerID":-1,"baseLayerMD5":"b40accecd4bd57fed8bdb96ee15e5c05.svg","bitmapResolution":1,"rotationCenterX":40,"rotationCenterY":27},{"costumeName":"hat-d","baseLayerID":-1,"baseLayerMD5":"a8ef874bd7542fec62785eac80019417.svg","bitmapResolution":1,"rotationCenterX":45,"rotationCenterY":30}],"currentCostumeIndex":0,"scratchX":-70,"scratchY":126,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Hatchling","md5":"25e4da6bcd209c60690729f5c7016b83.svg","type":"sprite","tags":["animals","chicken","farm","owen davey"],"info":[0,3,1],"json":{"objName":"Hatchling","sounds":[{"soundName":"Chirp","soundID":-1,"md5":"3b8236bbb288019d93ae38362e865972.wav","sampleCount":5301,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"hatchling-a","baseLayerID":-1,"baseLayerMD5":"25e4da6bcd209c60690729f5c7016b83.svg","bitmapResolution":1,"rotationCenterX":15,"rotationCenterY":23},{"costumeName":"hatchling-b","baseLayerID":-1,"baseLayerMD5":"b0f8451e7c52cf2b94b94c4a2051398b.svg","bitmapResolution":1,"rotationCenterX":16,"rotationCenterY":38},{"costumeName":"hatchling-c","baseLayerID":-1,"baseLayerMD5":"5f70ae46957bf425121ac532dc6a2f34.svg","bitmapResolution":1,"rotationCenterX":38,"rotationCenterY":72}],"currentCostumeIndex":0,"scratchX":-156,"scratchY":-76,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Heart","md5":"6e79e087c866a016f99ee482e1aeba47.svg","type":"sprite","tags":["holiday","red","shape","love","emotions"],"info":[0,2,1],"json":{"objName":"Heart","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"heart red","baseLayerID":-1,"baseLayerMD5":"6e79e087c866a016f99ee482e1aeba47.svg","bitmapResolution":1,"rotationCenterX":65,"rotationCenterY":56},{"costumeName":"heart purple","baseLayerID":-1,"baseLayerMD5":"b15362bb6b02a59e364db9081ccf19aa.svg","bitmapResolution":1,"rotationCenterX":66,"rotationCenterY":62}],"currentCostumeIndex":0,"scratchX":-31,"scratchY":40,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Heart Candy","md5":"1bc73fc472df673a1089d965b537f5ac.svg","type":"sprite","tags":["food","sweethearts"],"info":[0,4,1],"json":{"objName":"Heart Candy","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"heart code","baseLayerID":-1,"baseLayerMD5":"1bc73fc472df673a1089d965b537f5ac.svg","bitmapResolution":1,"rotationCenterX":73,"rotationCenterY":72},{"costumeName":"heart love","baseLayerID":-1,"baseLayerMD5":"a9d25b961eef81521c8ed38beb1456a0.svg","bitmapResolution":1,"rotationCenterX":73,"rotationCenterY":72},{"costumeName":"heart sweet","baseLayerID":-1,"baseLayerMD5":"9a9a8efa369379ee8538632c43a6a3d1.svg","bitmapResolution":1,"rotationCenterX":73,"rotationCenterY":72},{"costumeName":"heart smile","baseLayerID":-1,"baseLayerMD5":"66b29ca063bc74d2bacfc0a06bc7b6fc.svg","bitmapResolution":1,"rotationCenterX":73,"rotationCenterY":72}],"currentCostumeIndex":0,"scratchX":-24,"scratchY":-4,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Heart Face","md5":"4ab84263da32069cf97cc0fa52729a0d.svg","type":"sprite","tags":["emotions"],"info":[0,1,1],"json":{"objName":"Heart Face","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"heart face","baseLayerID":-1,"baseLayerMD5":"4ab84263da32069cf97cc0fa52729a0d.svg","bitmapResolution":1,"rotationCenterX":59,"rotationCenterY":52}],"currentCostumeIndex":0,"scratchX":50,"scratchY":39,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Hedgehog","md5":"32416e6b2ef8e45fb5fd10778c1b9a9f.svg","type":"sprite","tags":["animals","daria skrybchencko","mammals","spikey"],"info":[0,5,1],"json":{"objName":"Hedgehog","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"hedgehog-a","baseLayerID":-1,"baseLayerMD5":"32416e6b2ef8e45fb5fd10778c1b9a9f.svg","bitmapResolution":1,"rotationCenterX":71,"rotationCenterY":56},{"costumeName":"hedgehog-b","baseLayerID":-1,"baseLayerMD5":"4d3ccc06660e07b55bd38246e1f82f7f.svg","bitmapResolution":1,"rotationCenterX":71,"rotationCenterY":56},{"costumeName":"hedgehog-c","baseLayerID":-1,"baseLayerMD5":"2446f79c0f553594cfbcdbe6b1e459a5.svg","bitmapResolution":1,"rotationCenterX":71,"rotationCenterY":56},{"costumeName":"hedgehog-d","baseLayerID":-1,"baseLayerMD5":"bdb7c8e86125092da0c4848d1ffd901c.svg","bitmapResolution":1,"rotationCenterX":71,"rotationCenterY":56},{"costumeName":"hedgehog-e","baseLayerID":-1,"baseLayerMD5":"78a0e3789f6d778e20f9bf3d308a0b19.svg","bitmapResolution":1,"rotationCenterX":61,"rotationCenterY":45}],"currentCostumeIndex":0,"scratchX":-134,"scratchY":-77,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Hen","md5":"eb0a9890a92ef616ef8740328eeabb79.svg","type":"sprite","tags":["animals","chicken","farm","owen davey"],"info":[0,4,1],"json":{"objName":"Hen","sounds":[{"soundName":"bird","soundID":-1,"md5":"18bd4b634a3f992a16b30344c7d810e0.wav","sampleCount":3840,"rate":11025,"format":""}],"costumes":[{"costumeName":"hen-a","baseLayerID":-1,"baseLayerMD5":"eb0a9890a92ef616ef8740328eeabb79.svg","bitmapResolution":1,"rotationCenterX":60,"rotationCenterY":53},{"costumeName":"hen-b","baseLayerID":-1,"baseLayerMD5":"12aabf8636096f223e9297d2fd8177a4.svg","bitmapResolution":1,"rotationCenterX":63,"rotationCenterY":50},{"costumeName":"hen-c","baseLayerID":-1,"baseLayerMD5":"af2c57d1f12272335629635e669df487.svg","bitmapResolution":1,"rotationCenterX":56,"rotationCenterY":53},{"costumeName":"hen-d","baseLayerID":-1,"baseLayerMD5":"84d0492c094ec01d73f808c92b4c3138.svg","bitmapResolution":1,"rotationCenterX":51,"rotationCenterY":77}],"currentCostumeIndex":0,"scratchX":141,"scratchY":-104,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Hippo1","md5":"c1353c4a5eec5e6f32ed053e6f6e8f99.svg","type":"sprite","tags":["animals","mammals","flying","fantasy","insect","pachydermata","snortyboys","flappers"],"info":[0,2,1],"json":{"objName":"Hippo1","sounds":[{"soundName":"meow","soundID":-1,"md5":"83c36d806dc92327b9e7049a565c6bff.wav","sampleCount":18688,"rate":22050,"format":""}],"costumes":[{"costumeName":"hippo1-a","baseLayerID":-1,"baseLayerMD5":"c1353c4a5eec5e6f32ed053e6f6e8f99.svg","bitmapResolution":1,"rotationCenterX":69,"rotationCenterY":65},{"costumeName":"hippo1-b","baseLayerID":-1,"baseLayerMD5":"e65ed93bbb9cccf698fc7e774ab609a6.svg","bitmapResolution":1,"rotationCenterX":69,"rotationCenterY":68}],"currentCostumeIndex":0,"scratchX":59,"scratchY":37,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Home Button","md5":"1bac530a0701a8fc88bb0802ae6787a3.svg","type":"sprite","tags":["ui","thing"],"info":[0,1,1],"json":{"objName":"Home Button","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"home button","baseLayerID":-1,"baseLayerMD5":"1bac530a0701a8fc88bb0802ae6787a3.svg","bitmapResolution":1,"rotationCenterX":72,"rotationCenterY":72}],"currentCostumeIndex":0,"scratchX":42,"scratchY":42,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Horse","md5":"83a698304f00242a34ddd63b1525373b.svg","type":"sprite","tags":["animals","hoof","hooves","mammal","racing","saddle"],"info":[0,2,2],"json":{"objName":"Horse","sounds":[{"soundName":"horse","soundID":-1,"md5":"45ffcf97ee2edca0199ff5aa71a5b72e.wav","sampleCount":14464,"rate":11025,"format":""},{"soundName":"horse gallop","soundID":-1,"md5":"058a34b5fb8b57178b5322d994b6b8c8.wav","sampleCount":38336,"rate":11025,"format":""}],"costumes":[{"costumeName":"horse-a","baseLayerID":-1,"baseLayerMD5":"83a698304f00242a34ddd63b1525373b.svg","bitmapResolution":1,"rotationCenterX":119,"rotationCenterY":83},{"costumeName":"horse-b","baseLayerID":-1,"baseLayerMD5":"2e7d212692b46b049a9ebc1224edd990.svg","bitmapResolution":1,"rotationCenterX":103,"rotationCenterY":97}],"currentCostumeIndex":0,"scratchX":-4,"scratchY":-26,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Jaime","md5":"3ddc912edef87ae29121f57294fa0cb5.png","type":"sprite","tags":["people"],"info":[0,7,1],"json":{"objName":"Jaime","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"jaime-a","baseLayerID":-1,"baseLayerMD5":"3ddc912edef87ae29121f57294fa0cb5.png","bitmapResolution":2,"rotationCenterX":76,"rotationCenterY":154},{"costumeName":"jaime-b","baseLayerID":-1,"baseLayerMD5":"5a683f4536abca0f83a77bc341df4c9a.png","bitmapResolution":2,"rotationCenterX":68,"rotationCenterY":154},{"costumeName":"jaime walking-a","baseLayerID":-1,"baseLayerMD5":"d6cc9814f7a6640e4c2b1a4276987dc5.png","bitmapResolution":2,"rotationCenterX":106,"rotationCenterY":172},{"costumeName":"jaime walking-b","baseLayerID":-1,"baseLayerMD5":"7fb579a98d6db257f1b16109d3c4609a.png","bitmapResolution":2,"rotationCenterX":52,"rotationCenterY":176},{"costumeName":"jaime walking-c","baseLayerID":-1,"baseLayerMD5":"5883bdefba451aaeac8d77c798d41eb0.png","bitmapResolution":2,"rotationCenterX":88,"rotationCenterY":170},{"costumeName":"jaime walking-d","baseLayerID":-1,"baseLayerMD5":"4b9d2162e30dbb924840575ed35fddb0.png","bitmapResolution":2,"rotationCenterX":46,"rotationCenterY":174},{"costumeName":"jaime walking-e","baseLayerID":-1,"baseLayerMD5":"63e56d28cc3e3d9b735e1f1d51248cc0.png","bitmapResolution":2,"rotationCenterX":84,"rotationCenterY":172}],"currentCostumeIndex":0,"scratchX":51,"scratchY":31,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Jamal","md5":"c7531e6c05aa488edd6ad3c369204452.svg","type":"sprite","tags":["sports","basketball","people","alex eben meyer"],"info":[0,4,2],"json":{"objName":"Jamal","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""},{"soundName":"basketball bounce","soundID":-1,"md5":"1727f65b5f22d151685b8e5917456a60.wav","sampleCount":8099,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"jamal-a","baseLayerID":-1,"baseLayerMD5":"c7531e6c05aa488edd6ad3c369204452.svg","bitmapResolution":1,"rotationCenterX":55,"rotationCenterY":49},{"costumeName":"jamal-b","baseLayerID":-1,"baseLayerMD5":"8b8bd6ff0fe64e7056d1e70c63b9ec9f.svg","bitmapResolution":1,"rotationCenterX":75,"rotationCenterY":53},{"costumeName":"jamal-c","baseLayerID":-1,"baseLayerMD5":"c659f292333f93854be243f84b337ec5.svg","bitmapResolution":1,"rotationCenterX":54,"rotationCenterY":102},{"costumeName":"jamal-d","baseLayerID":-1,"baseLayerMD5":"9dc8cfa22793c43aee826c76d144e09b.svg","bitmapResolution":1,"rotationCenterX":54,"rotationCenterY":95}],"currentCostumeIndex":0,"scratchX":56,"scratchY":37,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Jar","md5":"73784b267083733e08bcf06aa7d6536a.svg","type":"sprite","tags":["food","ipzy","things"],"info":[0,2,1],"json":{"objName":"Jar","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"jar-a","baseLayerID":-1,"baseLayerMD5":"73784b267083733e08bcf06aa7d6536a.svg","bitmapResolution":1,"rotationCenterX":20,"rotationCenterY":25},{"costumeName":"jar-b","baseLayerID":-1,"baseLayerMD5":"a37eb72115966a75bc1bf521deeccc0c.svg","bitmapResolution":1,"rotationCenterX":20,"rotationCenterY":25}],"currentCostumeIndex":0,"scratchX":9,"scratchY":-11,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Jellyfish","md5":"9e6563e417350af3094c2ed02b9b0bbd.svg","type":"sprite","tags":["animals","ocean","sea","underwater","emotions","daria skrybchencko"],"info":[0,4,2],"json":{"objName":"Jellyfish","sounds":[{"soundName":"bubbles","soundID":-1,"md5":"78b0be9c9c2f664158b886bc7e794095.wav","sampleCount":45056,"rate":11025,"format":""},{"soundName":"ocean wave","soundID":-1,"md5":"c904610d770398b98872a708a2f75611.wav","sampleCount":99206,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"jellyfish-a","baseLayerID":-1,"baseLayerMD5":"9e6563e417350af3094c2ed02b9b0bbd.svg","bitmapResolution":1,"rotationCenterX":99,"rotationCenterY":86},{"costumeName":"jellyfish-b","baseLayerID":-1,"baseLayerMD5":"31a42fad0891f1298c522a6d5008930a.svg","bitmapResolution":1,"rotationCenterX":99,"rotationCenterY":86},{"costumeName":"jellyfish-c","baseLayerID":-1,"baseLayerMD5":"697262d9ed04467bae52cca786c36bd3.svg","bitmapResolution":1,"rotationCenterX":99,"rotationCenterY":86},{"costumeName":"jellyfish-d","baseLayerID":-1,"baseLayerMD5":"6a949493aaf62954f1c74f8369d494c4.svg","bitmapResolution":1,"rotationCenterX":99,"rotationCenterY":86}],"currentCostumeIndex":0,"scratchX":-163,"scratchY":99,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Jordyn","md5":"8355df83cca2baa0fdf6269d1311f1ea.svg","type":"sprite","tags":["sports","soccer","football","people","alex eben meyer"],"info":[0,4,1],"json":{"objName":"Jordyn","sounds":[{"soundName":"basketball bounce","soundID":-1,"md5":"1727f65b5f22d151685b8e5917456a60.wav","sampleCount":8099,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"jordyn-a","baseLayerID":-1,"baseLayerMD5":"8355df83cca2baa0fdf6269d1311f1ea.svg","bitmapResolution":1,"rotationCenterX":51,"rotationCenterY":63},{"costumeName":"jordyn-b","baseLayerID":-1,"baseLayerMD5":"2e2c43bbd7b18524fb132f1426ca3134.svg","bitmapResolution":1,"rotationCenterX":51,"rotationCenterY":63},{"costumeName":"jordyn-c","baseLayerID":-1,"baseLayerMD5":"5c0d24c53805e16358a2f6f6cc4a456e.svg","bitmapResolution":1,"rotationCenterX":68,"rotationCenterY":61},{"costumeName":"jordyn-d","baseLayerID":-1,"baseLayerMD5":"ebe2b20b99c1e1b373fd2b02be48aab9.svg","bitmapResolution":1,"rotationCenterX":40,"rotationCenterY":61}],"currentCostumeIndex":0,"scratchX":-164,"scratchY":-41,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Jouvi Dance","md5":"6f68790ee3eb9bdccf8749305186b0dd.png","type":"sprite","tags":["people","dance"],"info":[0,13,1],"json":{"objName":"Jouvi Dance","sounds":[{"soundName":"dance celebrate2","soundID":-1,"md5":"0edb8fb88af19e6e17d0f8cf64c1d136.wav","sampleCount":176401,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"jo stance","baseLayerID":-1,"baseLayerMD5":"6f68790ee3eb9bdccf8749305186b0dd.png","bitmapResolution":2,"rotationCenterX":94,"rotationCenterY":240},{"costumeName":"jo top stand","baseLayerID":-1,"baseLayerMD5":"0ed4a09c41871d150c51119c1bceded2.png","bitmapResolution":2,"rotationCenterX":68,"rotationCenterY":260},{"costumeName":"jo top R leg","baseLayerID":-1,"baseLayerMD5":"efaa8eb6c8cf7dc35d4d37d546ebd333.png","bitmapResolution":2,"rotationCenterX":218,"rotationCenterY":262},{"costumeName":"jo top L leg","baseLayerID":-1,"baseLayerMD5":"a12f40b18067bb31746f9cf461de88aa.png","bitmapResolution":2,"rotationCenterX":208,"rotationCenterY":268},{"costumeName":"jo top R cross","baseLayerID":-1,"baseLayerMD5":"c2d5519e8a0f2214ff757117038c28dc.png","bitmapResolution":2,"rotationCenterX":144,"rotationCenterY":270},{"costumeName":"jo top L cross","baseLayerID":-1,"baseLayerMD5":"2e2a6534d33883fdd2f8471a1adbebb7.png","bitmapResolution":2,"rotationCenterX":84,"rotationCenterY":268},{"costumeName":"jo pop front","baseLayerID":-1,"baseLayerMD5":"3d3ea804243800981acabc7caba10939.png","bitmapResolution":2,"rotationCenterX":70,"rotationCenterY":228},{"costumeName":"jo pop down","baseLayerID":-1,"baseLayerMD5":"a55fbb529c10f70bcb374aef8a63571b.png","bitmapResolution":2,"rotationCenterX":68,"rotationCenterY":74},{"costumeName":"jo pop left","baseLayerID":-1,"baseLayerMD5":"ea812b4c2b2405aa2b73158023298f71.png","bitmapResolution":2,"rotationCenterX":196,"rotationCenterY":226},{"costumeName":"jo pop right","baseLayerID":-1,"baseLayerMD5":"01dd2f553c7262329ebaba2516e3a2b1.png","bitmapResolution":2,"rotationCenterX":66,"rotationCenterY":242},{"costumeName":"jo pop L arm","baseLayerID":-1,"baseLayerMD5":"a9fbc01a4124d555da12630312e46197.png","bitmapResolution":2,"rotationCenterX":108,"rotationCenterY":258},{"costumeName":"jo pop stand","baseLayerID":-1,"baseLayerMD5":"75ee2383fd83992b401c8a0730521d94.png","bitmapResolution":2,"rotationCenterX":78,"rotationCenterY":262},{"costumeName":"jo pop R arm","baseLayerID":-1,"baseLayerMD5":"aabfedff0d11243386b6b0941e0f72e9.png","bitmapResolution":2,"rotationCenterX":108,"rotationCenterY":260}],"currentCostumeIndex":0,"scratchX":-58,"scratchY":-27,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Kai","md5":"6e007fde15e49c66ee7996561f80b452.png","type":"sprite","tags":["people"],"info":[0,2,1],"json":{"objName":"Kai","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"kai-a","baseLayerID":-1,"baseLayerMD5":"6e007fde15e49c66ee7996561f80b452.png","bitmapResolution":2,"rotationCenterX":68,"rotationCenterY":160},{"costumeName":"kai-b","baseLayerID":-1,"baseLayerMD5":"c1e1149f6d7e308e3e4eba14ccc8a751.png","bitmapResolution":2,"rotationCenterX":82,"rotationCenterY":158}],"currentCostumeIndex":0,"scratchX":57,"scratchY":47,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Key","md5":"af35300cef35803e11f4ed744dc5e818.svg","type":"sprite","tags":["thing","fantasy"],"info":[0,1,1],"json":{"objName":"Key","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"key","baseLayerID":-1,"baseLayerMD5":"af35300cef35803e11f4ed744dc5e818.svg","bitmapResolution":1,"rotationCenterX":42,"rotationCenterY":27}],"currentCostumeIndex":0,"scratchX":-14,"scratchY":0,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Keyboard","md5":"c67d180e964926b6393ac14781541b39.svg","type":"sprite","tags":["music","andrew rae"],"info":[0,2,8],"json":{"objName":"Keyboard","sounds":[{"soundName":"C Elec Piano","soundID":-1,"md5":"8366ee963cc57ad24a8a35a26f722c2b.wav","sampleCount":44100,"rate":22050,"format":""},{"soundName":"D Elec Piano","soundID":-1,"md5":"835f136ca8d346a17b4d4baf8405be37.wav","sampleCount":44100,"rate":22050,"format":""},{"soundName":"E Elec Piano","soundID":-1,"md5":"ab3c198f8e36efff14f0a5bad35fa3cd.wav","sampleCount":44100,"rate":22050,"format":""},{"soundName":"F Elec Piano","soundID":-1,"md5":"dc5e368fc0d0dad1da609bfc3e29aa15.wav","sampleCount":44100,"rate":22050,"format":""},{"soundName":"G Elec Piano","soundID":-1,"md5":"39525f6545d62a95d05153f92d63301a.wav","sampleCount":44100,"rate":22050,"format":""},{"soundName":"A Elec Piano","soundID":-1,"md5":"0cfa8e84d6a5cd63afa31d541625a9ef.wav","sampleCount":44100,"rate":22050,"format":""},{"soundName":"B Elec Piano","soundID":-1,"md5":"9cc77167419f228503dd57fddaa5b2a6.wav","sampleCount":44100,"rate":22050,"format":""},{"soundName":"C2 Elec Piano","soundID":-1,"md5":"366c7edbd4dd5cca68bf62902999bd66.wav","sampleCount":44100,"rate":22050,"format":""}],"costumes":[{"costumeName":"keyboard-a","baseLayerID":-1,"baseLayerMD5":"c67d180e964926b6393ac14781541b39.svg","bitmapResolution":1,"rotationCenterX":72,"rotationCenterY":68},{"costumeName":"keyboard-b","baseLayerID":-1,"baseLayerMD5":"dbaf62b33de45093c3c7d13b5d49d637.svg","bitmapResolution":1,"rotationCenterX":72,"rotationCenterY":68}],"currentCostumeIndex":0,"scratchX":135,"scratchY":-90,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Kiran","md5":"9de23c4a7a7fbb67136b539241346854.svg","type":"sprite","tags":["space","people","wren mcdonald"],"info":[0,6,1],"json":{"objName":"Kiran","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"kiran-a","baseLayerID":-1,"baseLayerMD5":"9de23c4a7a7fbb67136b539241346854.svg","bitmapResolution":1,"rotationCenterX":67,"rotationCenterY":95},{"costumeName":"kiran-b","baseLayerID":-1,"baseLayerMD5":"f1e74f3c02333e9e2068e8baf4e77aa0.svg","bitmapResolution":1,"rotationCenterX":67,"rotationCenterY":95},{"costumeName":"kiran-c","baseLayerID":-1,"baseLayerMD5":"e2482cf509c312935f08be0e2e2c9d84.svg","bitmapResolution":1,"rotationCenterX":67,"rotationCenterY":95},{"costumeName":"kiran-d","baseLayerID":-1,"baseLayerMD5":"569e736b519199efddfbae2572f7e92b.svg","bitmapResolution":1,"rotationCenterX":67,"rotationCenterY":95},{"costumeName":"kiran-e","baseLayerID":-1,"baseLayerMD5":"2261bed0f2cc819def17969158297b4f.svg","bitmapResolution":1,"rotationCenterX":77,"rotationCenterY":95},{"costumeName":"kiran-f","baseLayerID":-1,"baseLayerMD5":"d7f44adb3dc7906b9dfb3599a028e0d6.svg","bitmapResolution":1,"rotationCenterX":62,"rotationCenterY":94}],"currentCostumeIndex":0,"scratchX":57,"scratchY":-42,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Knight","md5":"f2c5e8bc24d001b81566879dbf2f1a13.svg","type":"sprite","tags":["people","castle","armor"],"info":[0,1,1],"json":{"objName":"Knight","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"knight","baseLayerID":-1,"baseLayerMD5":"f2c5e8bc24d001b81566879dbf2f1a13.svg","bitmapResolution":1,"rotationCenterX":75,"rotationCenterY":75}],"currentCostumeIndex":0,"scratchX":90,"scratchY":-18,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"LB Dance","md5":"71dde8c43985815bffb5a5ed5632af58.png","type":"sprite","tags":["people","dance"],"info":[0,13,1],"json":{"objName":"LB Dance","sounds":[{"soundName":"dance celebrate","soundID":-1,"md5":"0edb8fb88af19e6e17d0f8cf64c1d136.wav","sampleCount":176401,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"lb stance","baseLayerID":0,"baseLayerMD5":"71dde8c43985815bffb5a5ed5632af58.png","bitmapResolution":2,"rotationCenterX":54,"rotationCenterY":244},{"costumeName":"lb top stand","baseLayerID":-1,"baseLayerMD5":"e68d899e178309ff3eae3e1de8a8ec28.png","bitmapResolution":2,"rotationCenterX":70,"rotationCenterY":248},{"costumeName":"lb top R leg","baseLayerID":-1,"baseLayerMD5":"79ca528d13ffb557a236f0a35a0eb486.png","bitmapResolution":2,"rotationCenterX":244,"rotationCenterY":250},{"costumeName":"lb top L leg","baseLayerID":-1,"baseLayerMD5":"63d099e94aa8a973dcfa4c5d8b4a3e7a.png","bitmapResolution":2,"rotationCenterX":234,"rotationCenterY":286},{"costumeName":"lb top L cross","baseLayerID":-1,"baseLayerMD5":"645d6e2674452009df7a9a844a604791.png","bitmapResolution":2,"rotationCenterX":148,"rotationCenterY":258},{"costumeName":"lb top R cross","baseLayerID":-1,"baseLayerMD5":"4423159d81378ada5ffd7f053d7ef471.png","bitmapResolution":2,"rotationCenterX":174,"rotationCenterY":256},{"costumeName":"lb pop front","baseLayerID":-1,"baseLayerMD5":"cdd52259075b75628001672d375e4985.png","bitmapResolution":2,"rotationCenterX":66,"rotationCenterY":272},{"costumeName":"lb pop down","baseLayerID":-1,"baseLayerMD5":"563f86443cb102b9241cebb62eb2d81a.png","bitmapResolution":2,"rotationCenterX":56,"rotationCenterY":90},{"costumeName":"lb pop left","baseLayerID":-1,"baseLayerMD5":"525285312925e1e6b4e237a119b61305.png","bitmapResolution":2,"rotationCenterX":198,"rotationCenterY":266},{"costumeName":"lb pop right","baseLayerID":-1,"baseLayerMD5":"0a2461b3b9a4b8603e75565d78b1d4d7.png","bitmapResolution":2,"rotationCenterX":76,"rotationCenterY":264},{"costumeName":"lb pop L arm","baseLayerID":-1,"baseLayerMD5":"b508808c087adb55ce156f5cfbdac61b.png","bitmapResolution":2,"rotationCenterX":100,"rotationCenterY":262},{"costumeName":"lb pop stand","baseLayerID":-1,"baseLayerMD5":"5f176ef763be18f7c342dc2e2de7bf16.png","bitmapResolution":2,"rotationCenterX":66,"rotationCenterY":268},{"costumeName":"lb pop R arm","baseLayerID":-1,"baseLayerMD5":"0725440743391e7c622bb5df6a94e1d4.png","bitmapResolution":2,"rotationCenterX":78,"rotationCenterY":258}],"currentCostumeIndex":0,"scratchX":12,"scratchY":17,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Ladybug1","md5":"f16a1ccc69a4a8190a927f1595aa7bfa.svg","type":"sprite","tags":["animals","insect","bug","antennae"],"info":[0,1,1],"json":{"objName":"Ladybug1","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"ladybug2","baseLayerID":-1,"baseLayerMD5":"f16a1ccc69a4a8190a927f1595aa7bfa.svg","bitmapResolution":1,"rotationCenterX":41,"rotationCenterY":43}],"currentCostumeIndex":0,"scratchX":-90,"scratchY":42,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Ladybug2","md5":"c018a3eed966d5f92c69f2188dfd2aae.svg","type":"sprite","tags":["animals","insect","arthropod","antennae","aphids"],"info":[0,2,1],"json":{"objName":"Ladybug2","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"ladybug2-a","baseLayerID":-1,"baseLayerMD5":"c018a3eed966d5f92c69f2188dfd2aae.svg","bitmapResolution":1,"rotationCenterX":49,"rotationCenterY":28},{"costumeName":"ladybug2-b","baseLayerID":-1,"baseLayerMD5":"a2bb15ace808e070a2b815502952b292.svg","bitmapResolution":1,"rotationCenterX":49,"rotationCenterY":28}],"currentCostumeIndex":0,"scratchX":26,"scratchY":-3,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Laptop","md5":"76f456b30b98eeefd7c942b27b524e31.svg","type":"sprite","tags":["things","computers"],"info":[0,1,1],"json":{"objName":"Laptop","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"laptop","baseLayerID":-1,"baseLayerMD5":"76f456b30b98eeefd7c942b27b524e31.svg","bitmapResolution":1,"rotationCenterX":75,"rotationCenterY":75}],"currentCostumeIndex":0,"scratchX":-22,"scratchY":7,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Lightning","md5":"c2d636ab2b491e591536afc3d49cbecd.svg","type":"sprite","tags":["weather","whether","fantasy","storm","thunder"],"info":[0,1,1],"json":{"objName":"Lightning","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"lightning","baseLayerID":-1,"baseLayerMD5":"c2d636ab2b491e591536afc3d49cbecd.svg","bitmapResolution":1,"rotationCenterX":21,"rotationCenterY":83}],"currentCostumeIndex":0,"scratchX":65,"scratchY":25,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Line","md5":"1b2cfb4d4746522aeb84e16a62820299.svg","type":"sprite","tags":["lava","shape","red"],"info":[0,1,1],"json":{"objName":"Line","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"line","baseLayerID":-1,"baseLayerMD5":"1b2cfb4d4746522aeb84e16a62820299.svg","bitmapResolution":1,"rotationCenterX":239,"rotationCenterY":7}],"currentCostumeIndex":0,"scratchX":43,"scratchY":-13,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Lion","md5":"75e6b2178518fa354f1ebf7ab7061ceb.svg","type":"sprite","tags":["cat","animals","africa","savanna","robert hunter"],"info":[0,3,2],"json":{"objName":"Lion","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""},{"soundName":"grunt","soundID":-1,"md5":"caa0a1685ef7a5334413834c6c818c5a.wav","sampleCount":20551,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"lion-a","baseLayerID":-1,"baseLayerMD5":"75e6b2178518fa354f1ebf7ab7061ceb.svg","bitmapResolution":1,"rotationCenterX":95,"rotationCenterY":43},{"costumeName":"lion-b","baseLayerID":-1,"baseLayerMD5":"7304176fe4dc85758e6b77324a185ea2.svg","bitmapResolution":1,"rotationCenterX":94,"rotationCenterY":43},{"costumeName":"lion-c","baseLayerID":-1,"baseLayerMD5":"8411de793909216761cd19fd95418945.svg","bitmapResolution":1,"rotationCenterX":95,"rotationCenterY":43}],"currentCostumeIndex":0,"scratchX":25,"scratchY":-87,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Llama","md5":"f5841f36b41c4df26f9c724d913c279b.svg","type":"sprite","tags":["animals","mammal","robert hunter"],"info":[0,3,1],"json":{"objName":"Llama","sounds":[{"soundName":"snort","soundID":-1,"md5":"362d7440a57cab29914fecea621e50d4.wav","sampleCount":16421,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"llama","baseLayerID":-1,"baseLayerMD5":"f5841f36b41c4df26f9c724d913c279b.svg","bitmapResolution":1,"rotationCenterX":72,"rotationCenterY":95},{"costumeName":"llama-b","baseLayerID":-1,"baseLayerMD5":"ef3f8491668de2b751d8d7a8921c9879.svg","bitmapResolution":1,"rotationCenterX":92,"rotationCenterY":90},{"costumeName":"llama-c","baseLayerID":-1,"baseLayerMD5":"b0af19d2c7a7c039c060f21874816164.svg","bitmapResolution":1,"rotationCenterX":73,"rotationCenterY":39}],"currentCostumeIndex":0,"scratchX":-143,"scratchY":-14,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Magic Wand","md5":"3db9bfe57d561557795633c5cda44e8c.svg","type":"sprite","tags":["fantasy","things","zap"],"info":[0,1,1],"json":{"objName":"Magic Wand","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"magicwand","baseLayerID":-1,"baseLayerMD5":"3db9bfe57d561557795633c5cda44e8c.svg","bitmapResolution":1,"rotationCenterX":41,"rotationCenterY":18}],"currentCostumeIndex":0,"scratchX":78,"scratchY":35,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Max","md5":"5cc168bddf4561e6e7f1d30845d6efbf.svg","type":"sprite","tags":["sports","basketball","people","alex eben meyer"],"info":[0,4,1],"json":{"objName":"Max","sounds":[{"soundName":"basketball bounce","soundID":-1,"md5":"1727f65b5f22d151685b8e5917456a60.wav","sampleCount":8099,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"max-a","baseLayerID":-1,"baseLayerMD5":"5cc168bddf4561e6e7f1d30845d6efbf.svg","bitmapResolution":1,"rotationCenterX":70,"rotationCenterY":61},{"costumeName":"max-b","baseLayerID":-1,"baseLayerMD5":"8e2ad5735e26c5544b6b1a057f4efa80.svg","bitmapResolution":1,"rotationCenterX":71,"rotationCenterY":64},{"costumeName":"max-c","baseLayerID":-1,"baseLayerMD5":"261a40ebecfe135308befd79c6c07fd5.svg","bitmapResolution":1,"rotationCenterX":46,"rotationCenterY":59},{"costumeName":"max-d","baseLayerID":-1,"baseLayerMD5":"4b6eecd411daddef6422fa3a5850cd52.svg","bitmapResolution":1,"rotationCenterX":37,"rotationCenterY":59}],"currentCostumeIndex":0,"scratchX":143,"scratchY":-71,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Mermaid","md5":"36db41c47259881c26d9b98a806d3308.svg","type":"sprite","tags":["fantasy","people","underwater","ipzy"],"info":[0,4,1],"json":{"objName":"Mermaid","sounds":[{"soundName":"ocean wave","soundID":-1,"md5":"c904610d770398b98872a708a2f75611.wav","sampleCount":99206,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"mermaid-a","baseLayerID":-1,"baseLayerMD5":"36db41c47259881c26d9b98a806d3308.svg","bitmapResolution":1,"rotationCenterX":92,"rotationCenterY":130},{"costumeName":"mermaid-b","baseLayerID":-1,"baseLayerMD5":"564bf3f466df3b3e8aba71eeae8255ab.svg","bitmapResolution":1,"rotationCenterX":92,"rotationCenterY":130},{"costumeName":"mermaid-c","baseLayerID":-1,"baseLayerMD5":"2295784bb8e6354bfa7676089235cb9f.svg","bitmapResolution":1,"rotationCenterX":150,"rotationCenterY":115},{"costumeName":"mermaid-d","baseLayerID":-1,"baseLayerMD5":"9f973b89b68f7d8147f157cbac8af341.svg","bitmapResolution":1,"rotationCenterX":150,"rotationCenterY":115}],"currentCostumeIndex":0,"scratchX":-110,"scratchY":-21,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Microphone","md5":"9126b6362313e20578fb88d38902cd4c.svg","type":"sprite","tags":["music","andrew rae"],"info":[0,2,9],"json":{"objName":"Microphone","sounds":[{"soundName":"Bass Beatbox","soundID":-1,"md5":"28153621d293c86da0b246d314458faf.wav","sampleCount":6720,"rate":22050,"format":""},{"soundName":"Clap Beatbox","soundID":-1,"md5":"abc70bb390f8e55f22f32265500d814a.wav","sampleCount":4224,"rate":22050,"format":""},{"soundName":"Hi Beatbox","soundID":-1,"md5":"5a07847bf246c227204728b05a3fc8f3.wav","sampleCount":5856,"rate":22050,"format":""},{"soundName":"Scratch Beatbox","soundID":-1,"md5":"859249563a7b1fc0f6e92e36d1db81c7.wav","sampleCount":11552,"rate":22050,"format":""},{"soundName":"Snare Beatbox","soundID":-1,"md5":"c642c4c00135d890998f351faec55498.wav","sampleCount":5630,"rate":22050,"format":"adpcm"},{"soundName":"Snare Beatbox2","soundID":-1,"md5":"7ede1382b578d8fc32850b48d082d914.wav","sampleCount":4960,"rate":22050,"format":""},{"soundName":"Wah Beatbox","soundID":-1,"md5":"9021b7bb06f2399f18e2db4fb87095dc.wav","sampleCount":6624,"rate":22050,"format":""},{"soundName":"Crash Beatbox","soundID":-1,"md5":"725e29369e9138a43f11e0e5eb3eb562.wav","sampleCount":26883,"rate":22050,"format":""},{"soundName":"Wub Beatbox","soundID":-1,"md5":"e1f32c057411da4237181ce72ae15d23.wav","sampleCount":7392,"rate":22050,"format":""}],"costumes":[{"costumeName":"microphone-a","baseLayerID":-1,"baseLayerMD5":"9126b6362313e20578fb88d38902cd4c.svg","bitmapResolution":1,"rotationCenterX":40,"rotationCenterY":88},{"costumeName":"microphone-b","baseLayerID":-1,"baseLayerMD5":"29988ebbde49beaceb06d9eb66138b80.svg","bitmapResolution":1,"rotationCenterX":40,"rotationCenterY":88}],"currentCostumeIndex":0,"scratchX":125,"scratchY":49,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Milk","md5":"1b8ec45254b7c40d86e7a33818b77e35.svg","type":"sprite","tags":["food","drink","alex eben meyer"],"info":[0,5,1],"json":{"objName":"Milk","sounds":[{"soundName":"glug","soundID":-1,"md5":"5606722c6105f3c58f9689a958f5c45f.wav","sampleCount":12100,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"milk-a","baseLayerID":-1,"baseLayerMD5":"1b8ec45254b7c40d86e7a33818b77e35.svg","bitmapResolution":1,"rotationCenterX":32,"rotationCenterY":63},{"costumeName":"milk-b","baseLayerID":-1,"baseLayerMD5":"2ba802dcac09a81f9d82cc9d3b95d71b.svg","bitmapResolution":1,"rotationCenterX":42,"rotationCenterY":64},{"costumeName":"milk-c","baseLayerID":-1,"baseLayerMD5":"287b322e939ad54691aef4876c48f422.svg","bitmapResolution":1,"rotationCenterX":47,"rotationCenterY":56},{"costumeName":"milk-d","baseLayerID":-1,"baseLayerMD5":"df4f5d863fa680331aa6c8f867b9fcbb.svg","bitmapResolution":1,"rotationCenterX":45,"rotationCenterY":64},{"costumeName":"milk-e","baseLayerID":-1,"baseLayerMD5":"e642678d42d5e74fe49e6ceb5538724e.svg","bitmapResolution":1,"rotationCenterX":35,"rotationCenterY":45}],"currentCostumeIndex":0,"scratchX":-4,"scratchY":-82,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Monet","md5":"11c46aaa5e30ad46f5c1883d6feb47b8.svg","type":"sprite","tags":["space","people","wren mcdonald"],"info":[0,5,1],"json":{"objName":"Monet","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"monet-a","baseLayerID":-1,"baseLayerMD5":"11c46aaa5e30ad46f5c1883d6feb47b8.svg","bitmapResolution":1,"rotationCenterX":64,"rotationCenterY":87},{"costumeName":"monet-b","baseLayerID":-1,"baseLayerMD5":"9c8f83e39dc8ac49d57c0622ffe2063f.svg","bitmapResolution":1,"rotationCenterX":64,"rotationCenterY":87},{"costumeName":"monet-c","baseLayerID":-1,"baseLayerMD5":"4435678d26e8fbc266d647693f65f5d7.svg","bitmapResolution":1,"rotationCenterX":64,"rotationCenterY":87},{"costumeName":"monet-d","baseLayerID":-1,"baseLayerMD5":"42113ca3eca593c3a8f232a9202d6f14.svg","bitmapResolution":1,"rotationCenterX":82,"rotationCenterY":87},{"costumeName":"monet-e","baseLayerID":-1,"baseLayerMD5":"e530d0dac5290c5366af719cfb4e5953.svg","bitmapResolution":1,"rotationCenterX":65,"rotationCenterY":89}],"currentCostumeIndex":0,"scratchX":-53,"scratchY":-50,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Monkey","md5":"6e4de762dbd52cd2b6356694a9668211.svg","type":"sprite","tags":["animals","mammals","primate","prehensile tail"],"info":[0,3,2],"json":{"objName":"Monkey","sounds":[{"soundName":"Chee Chee","soundID":-1,"md5":"25f4826cdd61e0a1c623ec2324c16ca0.wav","sampleCount":34560,"rate":22050,"format":""},{"soundName":"Chomp","soundID":-1,"md5":"0b1e3033140d094563248e61de4039e5.wav","sampleCount":2912,"rate":11025,"format":""}],"costumes":[{"costumeName":"monkey-a","baseLayerID":-1,"baseLayerMD5":"6e4de762dbd52cd2b6356694a9668211.svg","bitmapResolution":1,"rotationCenterX":68,"rotationCenterY":99},{"costumeName":"monkey-b","baseLayerID":-1,"baseLayerMD5":"7662a3a0f4c6fa21fdf2de33bd80fe5f.svg","bitmapResolution":1,"rotationCenterX":68,"rotationCenterY":99},{"costumeName":"monkey-c","baseLayerID":-1,"baseLayerMD5":"db8eb50b948047181922310bb94511fb.svg","bitmapResolution":1,"rotationCenterX":68,"rotationCenterY":99}],"currentCostumeIndex":0,"scratchX":-61,"scratchY":24,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Motorcycle","md5":"5065a917834923efc3e0c112d5791e80.svg","type":"sprite","tags":["city","vehicle","bike","motorcycle"],"info":[0,4,2],"json":{"objName":"Motorcycle","sounds":[{"soundName":"clown honk","soundID":-1,"md5":"ec66961f188e9b8a9c75771db744d096.wav","sampleCount":9009,"rate":22050,"format":"adpcm"},{"soundName":"car vroom","soundID":-1,"md5":"ead1da4a87ff6cb53441142f7ac37b8f.wav","sampleCount":43358,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"Motorcycle-a","baseLayerID":-1,"baseLayerMD5":"5065a917834923efc3e0c112d5791e80.svg","bitmapResolution":1,"rotationCenterX":52,"rotationCenterY":44},{"costumeName":"Motorcycle-b","baseLayerID":-1,"baseLayerMD5":"fe0923cb08c0b7c373de1daf8b74de74.svg","bitmapResolution":1,"rotationCenterX":52,"rotationCenterY":44},{"costumeName":"Motorcycle-c","baseLayerID":-1,"baseLayerMD5":"6af27b2b5e1eeae9e60702630e6909a8.svg","bitmapResolution":1,"rotationCenterX":52,"rotationCenterY":44},{"costumeName":"Motorcycle-d","baseLayerID":-1,"baseLayerMD5":"c5d78ac1de3a7f786a4ca6dc0fe087d4.svg","bitmapResolution":1,"rotationCenterX":52,"rotationCenterY":44}],"currentCostumeIndex":0,"scratchX":181,"scratchY":-133,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Mouse1","md5":"e1f0c26afecbe9d4b9923d8e6bf489a8.svg","type":"sprite","tags":["animals","mammals","rodents"],"info":[0,2,1],"json":{"objName":"Mouse1","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"mouse1-a","baseLayerID":-1,"baseLayerMD5":"e1f0c26afecbe9d4b9923d8e6bf489a8.svg","bitmapResolution":1,"rotationCenterX":50,"rotationCenterY":27},{"costumeName":"mouse1-b","baseLayerID":-1,"baseLayerMD5":"f5e477a3f94fc98ba3cd927228405646.svg","bitmapResolution":1,"rotationCenterX":65,"rotationCenterY":21}],"currentCostumeIndex":0,"scratchX":-10,"scratchY":-20,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Muffin","md5":"18da0857a1b7f1c960146d2b85edd10f.svg","type":"sprite","tags":["food"],"info":[0,2,1],"json":{"objName":"Muffin","sounds":[{"soundName":"Chomp","soundID":-1,"md5":"0b1e3033140d094563248e61de4039e5.wav","sampleCount":2912,"rate":11025,"format":""}],"costumes":[{"costumeName":"muffin-a","baseLayerID":-1,"baseLayerMD5":"18da0857a1b7f1c960146d2b85edd10f.svg","bitmapResolution":1,"rotationCenterX":85,"rotationCenterY":48},{"costumeName":"muffin-b","baseLayerID":-1,"baseLayerMD5":"a89f3b99bf4cccfaeb1b39e25633c53c.svg","bitmapResolution":1,"rotationCenterX":85,"rotationCenterY":48}],"currentCostumeIndex":0,"scratchX":-74,"scratchY":-3,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Nano","md5":"02c5433118f508038484bbc5b111e187.svg","type":"sprite","tags":["fantasy","drawing"],"info":[0,4,1],"json":{"objName":"Nano","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"nano-a","baseLayerID":-1,"baseLayerMD5":"02c5433118f508038484bbc5b111e187.svg","bitmapResolution":1,"rotationCenterX":61,"rotationCenterY":60},{"costumeName":"nano-b","baseLayerID":-1,"baseLayerMD5":"10d6d9130618cd092ae02158cde2e113.svg","bitmapResolution":1,"rotationCenterX":61,"rotationCenterY":60},{"costumeName":"nano-c","baseLayerID":-1,"baseLayerMD5":"85e762d45bc626ca2edb3472c7cfaa32.svg","bitmapResolution":1,"rotationCenterX":61,"rotationCenterY":60},{"costumeName":"nano-d","baseLayerID":-1,"baseLayerMD5":"b10925346da8080443f27e7dfaeff6f7.svg","bitmapResolution":1,"rotationCenterX":61,"rotationCenterY":60}],"currentCostumeIndex":0,"scratchX":-18,"scratchY":28,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Neigh Pony","md5":"176c4fb4df80df899ca28a48bd1f0edf.svg","type":"sprite","tags":["animals","fantasy"],"info":[0,1,1],"json":{"objName":"Neigh Pony","sounds":[{"soundName":"horse","soundID":-1,"md5":"45ffcf97ee2edca0199ff5aa71a5b72e.wav","sampleCount":14464,"rate":11025,"format":""}],"costumes":[{"costumeName":"neigh pony","baseLayerID":-1,"baseLayerMD5":"176c4fb4df80df899ca28a48bd1f0edf.svg","bitmapResolution":1,"rotationCenterX":74,"rotationCenterY":78}],"currentCostumeIndex":0,"scratchX":3,"scratchY":37,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Octopus","md5":"038df646d2f935d2a5dd601b343fc1d9.svg","type":"sprite","tags":["animals","ocean","sea","underwater","daria skrybchencko"],"info":[0,5,2],"json":{"objName":"Octopus","sounds":[{"soundName":"splash","soundID":-1,"md5":"6aed5e38d40b87a21d893d26fa2858c0.wav","sampleCount":46080,"rate":22050,"format":"adpcm"},{"soundName":"ocean wave","soundID":-1,"md5":"c904610d770398b98872a708a2f75611.wav","sampleCount":99206,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"octopus-a","baseLayerID":-1,"baseLayerMD5":"038df646d2f935d2a5dd601b343fc1d9.svg","bitmapResolution":1,"rotationCenterX":88,"rotationCenterY":86},{"costumeName":"octopus-b","baseLayerID":-1,"baseLayerMD5":"31bdcbdf05688c01aace3fd94c5e82df.svg","bitmapResolution":1,"rotationCenterX":88,"rotationCenterY":86},{"costumeName":"octopus-c","baseLayerID":-1,"baseLayerMD5":"51e80c09323e36489ad452250acd827c.svg","bitmapResolution":1,"rotationCenterX":88,"rotationCenterY":86},{"costumeName":"octopus-d","baseLayerID":-1,"baseLayerMD5":"b4242e6cde0392bb9a5fb43a8f232962.svg","bitmapResolution":1,"rotationCenterX":88,"rotationCenterY":86},{"costumeName":"octopus-e","baseLayerID":-1,"baseLayerMD5":"edfda0a36d9cd8482e3a8dc317107d56.svg","bitmapResolution":1,"rotationCenterX":88,"rotationCenterY":86}],"currentCostumeIndex":0,"scratchX":157,"scratchY":83,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Orange","md5":"27d5dfbadceea215e983d2641ce3e51f.svg","type":"sprite","tags":["food","fruit"],"info":[0,1,1],"json":{"objName":"Orange","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"orange","baseLayerID":-1,"baseLayerMD5":"27d5dfbadceea215e983d2641ce3e51f.svg","bitmapResolution":1,"rotationCenterX":19,"rotationCenterY":18}],"currentCostumeIndex":0,"scratchX":44,"scratchY":-6,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Orange2","md5":"8a7d8515df41f83c1326ec3233a3a42a.svg","type":"sprite","tags":["food","fruit","eaten"],"info":[0,2,1],"json":{"objName":"Orange2","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"orange2-a","baseLayerID":-1,"baseLayerMD5":"8a7d8515df41f83c1326ec3233a3a42a.svg","bitmapResolution":1,"rotationCenterX":49,"rotationCenterY":24},{"costumeName":"orange2-b","baseLayerID":-1,"baseLayerMD5":"70c7f1822ffdb37157c304273dae9102.svg","bitmapResolution":1,"rotationCenterX":49,"rotationCenterY":27}],"currentCostumeIndex":0,"scratchX":-60,"scratchY":9,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Outfielder","md5":"d2e2e4a9249c4cbe479e431a4c985286.svg","type":"sprite","tags":["baseball","sports","people","alex eben meyer"],"info":[0,4,1],"json":{"objName":"Outfielder","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"outfielder-a","baseLayerID":-1,"baseLayerMD5":"d2e2e4a9249c4cbe479e431a4c985286.svg","bitmapResolution":1,"rotationCenterX":42,"rotationCenterY":78},{"costumeName":"outfielder-b","baseLayerID":-1,"baseLayerMD5":"5a960b109ae5dbe3c3ea5555894e8c13.svg","bitmapResolution":1,"rotationCenterX":42,"rotationCenterY":74},{"costumeName":"outfielder-c","baseLayerID":-1,"baseLayerMD5":"480ab4ce1ab5586e829e1cf804824c8b.svg","bitmapResolution":1,"rotationCenterX":67,"rotationCenterY":97},{"costumeName":"outfielder-d","baseLayerID":-1,"baseLayerMD5":"e5803b5601e0aafa8d0b227f1b1ae742.svg","bitmapResolution":1,"rotationCenterX":130,"rotationCenterY":114}],"currentCostumeIndex":0,"scratchX":-156,"scratchY":-28,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Owl","md5":"5348f1ea36a645322e88796545ca8ca1.svg","type":"sprite","tags":["animals","bird","robert hunter"],"info":[0,3,1],"json":{"objName":"Owl","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"owl-a","baseLayerID":-1,"baseLayerMD5":"5348f1ea36a645322e88796545ca8ca1.svg","bitmapResolution":1,"rotationCenterX":24,"rotationCenterY":40},{"costumeName":"owl-b","baseLayerID":-1,"baseLayerMD5":"3d8ba4198a03e484ed63bde584fd5bc1.svg","bitmapResolution":1,"rotationCenterX":44,"rotationCenterY":46},{"costumeName":"owl-c","baseLayerID":-1,"baseLayerMD5":"4e81445e70169f074ad50473a78f3381.svg","bitmapResolution":1,"rotationCenterX":109,"rotationCenterY":41}],"currentCostumeIndex":0,"scratchX":167,"scratchY":-3,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Paddle","md5":"8038149bdfe24733ea2144d37d297815.svg","type":"sprite","tags":["thing"],"info":[0,1,1],"json":{"objName":"Paddle","sounds":[{"soundName":"boing","soundID":-1,"md5":"53a3c2e27d1fb5fdb14aaf0cb41e7889.wav","sampleCount":6804,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"paddle","baseLayerID":-1,"baseLayerMD5":"8038149bdfe24733ea2144d37d297815.svg","bitmapResolution":1,"rotationCenterX":44,"rotationCenterY":7}],"currentCostumeIndex":0,"scratchX":47,"scratchY":-12,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Panther","md5":"04ca2c122cff11b9bc23834d6f79361e.svg","type":"sprite","tags":["animals","tiger","leopard","robert hunter"],"info":[0,3,1],"json":{"objName":"Panther","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"panther-a","baseLayerID":-1,"baseLayerMD5":"04ca2c122cff11b9bc23834d6f79361e.svg","bitmapResolution":1,"rotationCenterX":125,"rotationCenterY":81},{"costumeName":"panther-b","baseLayerID":-1,"baseLayerMD5":"f8c33765d1105f3bb4cd145fad0f717e.svg","bitmapResolution":1,"rotationCenterX":125,"rotationCenterY":81},{"costumeName":"panther-c","baseLayerID":-1,"baseLayerMD5":"096bf9cad84def12eef2b5d84736b393.svg","bitmapResolution":1,"rotationCenterX":125,"rotationCenterY":81}],"currentCostumeIndex":0,"scratchX":-27,"scratchY":8,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Pants","md5":"f7a0584eca14eaa0e29662e5c24fb62d.svg","type":"sprite","tags":["fashion","pants","clothing"],"info":[0,2,1],"json":{"objName":"Pants","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"pants-a","baseLayerID":-1,"baseLayerMD5":"f7a0584eca14eaa0e29662e5c24fb62d.svg","bitmapResolution":1,"rotationCenterX":34,"rotationCenterY":66},{"costumeName":"pants-b","baseLayerID":-1,"baseLayerMD5":"22ea0cf68b885817a5b6a01194c6f5d3.svg","bitmapResolution":1,"rotationCenterX":35,"rotationCenterY":66}],"currentCostumeIndex":0,"scratchX":148,"scratchY":-49,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Parrot","md5":"098570b8e1aa85b32f9b4eb07bea3af2.svg","type":"sprite","tags":["animals","bird","birb","tropical","color","flying","flappers"],"info":[0,2,1],"json":{"objName":"Parrot","sounds":[{"soundName":"Bird","soundID":-1,"md5":"18bd4b634a3f992a16b30344c7d810e0.wav","sampleCount":3840,"rate":11025,"format":""}],"costumes":[{"costumeName":"parrot-a","baseLayerID":-1,"baseLayerMD5":"098570b8e1aa85b32f9b4eb07bea3af2.svg","bitmapResolution":1,"rotationCenterX":86,"rotationCenterY":106},{"costumeName":"parrot-b","baseLayerID":-1,"baseLayerMD5":"721255a0733c9d8d2ba518ff09b3b7cb.svg","bitmapResolution":1,"rotationCenterX":49,"rotationCenterY":31}],"currentCostumeIndex":0,"scratchX":77,"scratchY":23,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Party Hats","md5":"f3ee428806f9fa6d396e30a8d6d0e741.svg","type":"sprite","tags":["fashion","holiday"],"info":[0,3,1],"json":{"objName":"Party Hats","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Party Hat-a","baseLayerID":-1,"baseLayerMD5":"f3ee428806f9fa6d396e30a8d6d0e741.svg","bitmapResolution":1,"rotationCenterX":24,"rotationCenterY":55},{"costumeName":"Party Hat-b","baseLayerID":-1,"baseLayerMD5":"71b51d9680be4aa946eb6642bc044791.svg","bitmapResolution":1,"rotationCenterX":40,"rotationCenterY":61},{"costumeName":"Party Hat-e","baseLayerID":-1,"baseLayerMD5":"e69516f2a9bb6d632fdaba4fadd8f8f1.svg","bitmapResolution":1,"rotationCenterX":52,"rotationCenterY":44}],"currentCostumeIndex":0,"scratchX":-80,"scratchY":-31,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Pencil","md5":"4495fcb0443cebc5d43e66243a88f1ac.svg","type":"sprite","tags":["thing","yellow"],"info":[0,2,1],"json":{"objName":"Pencil","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"pencil-a","baseLayerID":-1,"baseLayerMD5":"4495fcb0443cebc5d43e66243a88f1ac.svg","bitmapResolution":1,"rotationCenterX":49,"rotationCenterY":54},{"costumeName":"pencil-b","baseLayerID":-1,"baseLayerMD5":"21088922dbe127f6d2e58e2e83fb632e.svg","bitmapResolution":1,"rotationCenterX":48,"rotationCenterY":68}],"currentCostumeIndex":0,"scratchX":57,"scratchY":42,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Penguin","md5":"0e78708b8988802d2209a34b50292bd3.svg","type":"sprite","tags":["animals","penguin","cold","north pole","south pole","ice","antarctica","arctic","robert hunter"],"info":[0,3,1],"json":{"objName":"Penguin","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"penguin-a","baseLayerID":-1,"baseLayerMD5":"0e78708b8988802d2209a34b50292bd3.svg","bitmapResolution":1,"rotationCenterX":36,"rotationCenterY":46},{"costumeName":"penguin-b","baseLayerID":-1,"baseLayerMD5":"43af2a0b7f922ec5dc94217b2f3e08e4.svg","bitmapResolution":1,"rotationCenterX":26,"rotationCenterY":46},{"costumeName":"penguin-c","baseLayerID":-1,"baseLayerMD5":"4f35c3940957e3ffc2e83a2565942171.svg","bitmapResolution":1,"rotationCenterX":35,"rotationCenterY":46}],"currentCostumeIndex":0,"scratchX":-84,"scratchY":-100,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Penguin 2","md5":"c17d9e4bdb59c574e0c34aa70af516da.svg","type":"sprite","tags":["animals","bird","winter","antarctica"],"info":[0,4,1],"json":{"objName":"Penguin 2","sounds":[{"soundName":"Chirp","soundID":-1,"md5":"3b8236bbb288019d93ae38362e865972.wav","sampleCount":5301,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"penguin2-a","baseLayerID":-1,"baseLayerMD5":"c17d9e4bdb59c574e0c34aa70af516da.svg","bitmapResolution":1,"rotationCenterX":54,"rotationCenterY":61},{"costumeName":"penguin2-b","baseLayerID":-1,"baseLayerMD5":"b224a582395e0847c2ef4eefcfbc4546.svg","bitmapResolution":1,"rotationCenterX":54,"rotationCenterY":61},{"costumeName":"penguin2-c","baseLayerID":-1,"baseLayerMD5":"35fec7aa5f60cca945fe0615413f1f08.svg","bitmapResolution":1,"rotationCenterX":48,"rotationCenterY":62},{"costumeName":"penguin2-d","baseLayerID":-1,"baseLayerMD5":"18fa51a64ebd5518f0c5c465525346e5.svg","bitmapResolution":1,"rotationCenterX":48,"rotationCenterY":61}],"currentCostumeIndex":0,"scratchX":-58,"scratchY":-19,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Pico","md5":"0579fe60bb3717c49dfd7743caa84ada.svg","type":"sprite","tags":["fantasy","drawing"],"info":[0,4,1],"json":{"objName":"Pico","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"pico-a","baseLayerID":-1,"baseLayerMD5":"0579fe60bb3717c49dfd7743caa84ada.svg","bitmapResolution":1,"rotationCenterX":55,"rotationCenterY":66},{"costumeName":"pico-b","baseLayerID":-1,"baseLayerMD5":"26c688d7544757225ff51cd2fb1519b5.svg","bitmapResolution":1,"rotationCenterX":55,"rotationCenterY":66},{"costumeName":"pico-c","baseLayerID":-1,"baseLayerMD5":"adf61e2090f8060e1e8b2b0604d03751.svg","bitmapResolution":1,"rotationCenterX":55,"rotationCenterY":66},{"costumeName":"pico-d","baseLayerID":-1,"baseLayerMD5":"594704bf12e3c4d9e83bb91661ad709a.svg","bitmapResolution":1,"rotationCenterX":55,"rotationCenterY":66}],"currentCostumeIndex":0,"scratchX":80,"scratchY":-26,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Pico Walking","md5":"8eab5fe20dd249bf22964298b1d377eb.svg","type":"sprite","tags":["fantasy","walking"],"info":[0,4,1],"json":{"objName":"Pico Walking","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Pico walk1","baseLayerID":-1,"baseLayerMD5":"8eab5fe20dd249bf22964298b1d377eb.svg","bitmapResolution":1,"rotationCenterX":54,"rotationCenterY":71},{"costumeName":"Pico walk2","baseLayerID":-1,"baseLayerMD5":"39ecd3c38d3f2cd81e3a17ee6c25699f.svg","bitmapResolution":1,"rotationCenterX":54,"rotationCenterY":71},{"costumeName":"Pico walk3","baseLayerID":-1,"baseLayerMD5":"43f7d92dcf9eadf77c07a6fc1eb4104f.svg","bitmapResolution":1,"rotationCenterX":54,"rotationCenterY":70},{"costumeName":"Pico walk4","baseLayerID":-1,"baseLayerMD5":"2582d012d57bca59bc0315c5c5954958.svg","bitmapResolution":1,"rotationCenterX":54,"rotationCenterY":70}],"currentCostumeIndex":0,"scratchX":98,"scratchY":-32,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Pitcher","md5":"24008f02de4b0d999d4526d34dec8b76.svg","type":"sprite","tags":["baseball","sports","people","alex eben meyer"],"info":[0,4,1],"json":{"objName":"Pitcher","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"pitcher-a","baseLayerID":-1,"baseLayerMD5":"24008f02de4b0d999d4526d34dec8b76.svg","bitmapResolution":1,"rotationCenterX":42,"rotationCenterY":74},{"costumeName":"pitcher-b","baseLayerID":-1,"baseLayerMD5":"4644ab73c577ed878e3ccaa3d89ccc2b.svg","bitmapResolution":1,"rotationCenterX":75,"rotationCenterY":97},{"costumeName":"pitcher-c","baseLayerID":-1,"baseLayerMD5":"f46aa0b114a9977c52eeefa252953e2b.svg","bitmapResolution":1,"rotationCenterX":69,"rotationCenterY":98},{"costumeName":"pitcher-d","baseLayerID":-1,"baseLayerMD5":"d75a06e24f717e8647db27e94618e693.svg","bitmapResolution":1,"rotationCenterX":84,"rotationCenterY":57}],"currentCostumeIndex":0,"scratchX":-6,"scratchY":-88,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Planet2","md5":"978784738c1d9dd4b1d397fd18bdf406.svg","type":"sprite","tags":["space"],"info":[0,1,1],"json":{"objName":"Planet2","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"planet2","baseLayerID":-1,"baseLayerMD5":"978784738c1d9dd4b1d397fd18bdf406.svg","bitmapResolution":1,"rotationCenterX":72,"rotationCenterY":72}],"currentCostumeIndex":0,"scratchX":52,"scratchY":25,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Polar Bear","md5":"b1d892d9f8a897bc6a446e2ff766ba74.svg","type":"sprite","tags":["animals","bear","polar bear","cold","north pole","south pole","ice","antarctica","arctic","robert hunter"],"info":[0,3,1],"json":{"objName":"Polar Bear","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"polar bear-a","baseLayerID":-1,"baseLayerMD5":"b1d892d9f8a897bc6a446e2ff766ba74.svg","bitmapResolution":1,"rotationCenterX":104,"rotationCenterY":42},{"costumeName":"polar bear-b","baseLayerID":-1,"baseLayerMD5":"54728e795213e67ac7cecca1c32fe293.svg","bitmapResolution":1,"rotationCenterX":87,"rotationCenterY":47},{"costumeName":"polar bear-c","baseLayerID":-1,"baseLayerMD5":"7d5812e0aa1cde33771f9270ff521cfe.svg","bitmapResolution":1,"rotationCenterX":104,"rotationCenterY":43}],"currentCostumeIndex":0,"scratchX":109,"scratchY":-55,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Potion","md5":"a317b50b255a208455a7733091adad23.svg","type":"sprite","tags":["fantasy","ipzy","things"],"info":[0,3,1],"json":{"objName":"Potion","sounds":[{"soundName":"Magic Spell","soundID":-1,"md5":"1cb60ecdb1075c8769cb346d5c2a22c7.wav","sampleCount":43077,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"potion-a","baseLayerID":-1,"baseLayerMD5":"a317b50b255a208455a7733091adad23.svg","bitmapResolution":1,"rotationCenterX":15,"rotationCenterY":21},{"costumeName":"potion-b","baseLayerID":-1,"baseLayerMD5":"5f96576605c3a022df48278b630da745.svg","bitmapResolution":1,"rotationCenterX":15,"rotationCenterY":28},{"costumeName":"potion-c","baseLayerID":-1,"baseLayerMD5":"92d0184c28fac9acb0fb720ec599d61d.svg","bitmapResolution":1,"rotationCenterX":15,"rotationCenterY":42}],"currentCostumeIndex":0,"scratchX":86,"scratchY":7,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Prince","md5":"a760bed1cfc28a30b2dc7fd045c90792.svg","type":"sprite","tags":["people","☥","fantasy"],"info":[0,1,1],"json":{"objName":"Prince","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"prince","baseLayerID":-1,"baseLayerMD5":"a760bed1cfc28a30b2dc7fd045c90792.svg","bitmapResolution":1,"rotationCenterX":75,"rotationCenterY":75}],"currentCostumeIndex":0,"scratchX":-73,"scratchY":-42,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Princess","md5":"fcbf44a543dfda884d8acbd6af66faad.svg","type":"sprite","tags":["fantasy","people","ipzy","castle","emotions"],"info":[0,5,1],"json":{"objName":"Princess","sounds":[{"soundName":"magic spell","soundID":-1,"md5":"1cb60ecdb1075c8769cb346d5c2a22c7.wav","sampleCount":43077,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"princess-a","baseLayerID":-1,"baseLayerMD5":"fcbf44a543dfda884d8acbd6af66faad.svg","bitmapResolution":1,"rotationCenterX":75,"rotationCenterY":150},{"costumeName":"princess-b","baseLayerID":-1,"baseLayerMD5":"562e5eba4a598118411be3062cfbb26f.svg","bitmapResolution":1,"rotationCenterX":75,"rotationCenterY":150},{"costumeName":"princess-c","baseLayerID":-1,"baseLayerMD5":"f3e5f466d406745cf1b6ce44b0567b9a.svg","bitmapResolution":1,"rotationCenterX":75,"rotationCenterY":150},{"costumeName":"princess-d","baseLayerID":-1,"baseLayerMD5":"663134f64588f0c55e77767ba9039cfe.svg","bitmapResolution":1,"rotationCenterX":75,"rotationCenterY":150},{"costumeName":"princess-e","baseLayerID":-1,"baseLayerMD5":"ad0ecbf907d132ddbb547666551ac087.svg","bitmapResolution":1,"rotationCenterX":75,"rotationCenterY":150}],"currentCostumeIndex":0,"scratchX":123,"scratchY":-13,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Pufferfish","md5":"81d7db99142a39c9082be2c2183f2175.svg","type":"sprite","tags":["animals","ocean","sea","underwater","daria skrybchencko"],"info":[0,4,1],"json":{"objName":"Pufferfish","sounds":[{"soundName":"ocean wave","soundID":-1,"md5":"c904610d770398b98872a708a2f75611.wav","sampleCount":99206,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"pufferfish-a","baseLayerID":-1,"baseLayerMD5":"81d7db99142a39c9082be2c2183f2175.svg","bitmapResolution":1,"rotationCenterX":69,"rotationCenterY":61},{"costumeName":"pufferfish-b","baseLayerID":-1,"baseLayerMD5":"6ea79950db63f5ac24d6c5091df3836b.svg","bitmapResolution":1,"rotationCenterX":69,"rotationCenterY":61},{"costumeName":"pufferfish-c","baseLayerID":-1,"baseLayerMD5":"4acf5bc398c19d58acf69fce047ee8f6.svg","bitmapResolution":1,"rotationCenterX":69,"rotationCenterY":61},{"costumeName":"pufferfish-d","baseLayerID":-1,"baseLayerMD5":"c214fa8a9ceed06db03664007b8ad5c6.svg","bitmapResolution":1,"rotationCenterX":69,"rotationCenterY":61}],"currentCostumeIndex":0,"scratchX":-30,"scratchY":53,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Puppy","md5":"2768d9e44a0aab055856d301bbc2b04e.png","type":"sprite","tags":["animals","dog","puppy"],"info":[0,4,1],"json":{"objName":"Puppy","sounds":[{"soundName":"dog2","soundID":-1,"md5":"cd8fa8390b0efdd281882533fbfcfcfb.wav","sampleCount":3168,"rate":22050,"format":""}],"costumes":[{"costumeName":"puppy right","baseLayerID":-1,"baseLayerMD5":"2768d9e44a0aab055856d301bbc2b04e.png","bitmapResolution":2,"rotationCenterX":107,"rotationCenterY":103},{"costumeName":"puppy sit","baseLayerID":-1,"baseLayerMD5":"c7817052ed9e78057f877d0d56b5c6a6.png","bitmapResolution":2,"rotationCenterX":87,"rotationCenterY":112},{"costumeName":"puppy side","baseLayerID":-1,"baseLayerMD5":"c4aeb5c39b39ef57a3f18ace54cf7db1.png","bitmapResolution":2,"rotationCenterX":104,"rotationCenterY":114},{"costumeName":"puppy back","baseLayerID":-1,"baseLayerMD5":"05630bfa94501a3e5d61ce443a0cea70.png","bitmapResolution":2,"rotationCenterX":234,"rotationCenterY":94}],"currentCostumeIndex":0,"scratchX":-91,"scratchY":33,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Rabbit","md5":"2f42891c3f3d63c0e591aeabc5946533.svg","type":"sprite","tags":["animals","daria skrybchencko","mammal","bunny","bunnies","fluffy"],"info":[0,5,1],"json":{"objName":"Rabbit","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"rabbit-a","baseLayerID":-1,"baseLayerMD5":"2f42891c3f3d63c0e591aeabc5946533.svg","bitmapResolution":1,"rotationCenterX":84,"rotationCenterY":84},{"costumeName":"rabbit-b","baseLayerID":-1,"baseLayerMD5":"80e05ff501040cdc9f52fa6782e06fd2.svg","bitmapResolution":1,"rotationCenterX":84,"rotationCenterY":84},{"costumeName":"rabbit-c","baseLayerID":-1,"baseLayerMD5":"88ed8b7925baa025b6c7fc628a64b9b1.svg","bitmapResolution":1,"rotationCenterX":84,"rotationCenterY":84},{"costumeName":"rabbit-d","baseLayerID":-1,"baseLayerMD5":"5f3b8df4d6ab8a72e887f89f554db0be.svg","bitmapResolution":1,"rotationCenterX":84,"rotationCenterY":84},{"costumeName":"rabbit-e","baseLayerID":-1,"baseLayerMD5":"3003f1135f4aa3b6c361734243621260.svg","bitmapResolution":1,"rotationCenterX":84,"rotationCenterY":84}],"currentCostumeIndex":0,"scratchX":71,"scratchY":-48,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Radio","md5":"d2266f31369a97fdf7ec37090bf0a968.svg","type":"sprite","tags":["radio","music","beatbox","bedrorom"],"info":[0,2,4],"json":{"objName":"Radio","sounds":[{"soundName":"scratch beatbox","soundID":-1,"md5":"859249563a7b1fc0f6e92e36d1db81c7.wav","sampleCount":11552,"rate":22050,"format":""},{"soundName":"snare beatbox2","soundID":-1,"md5":"7ede1382b578d8fc32850b48d082d914.wav","sampleCount":4960,"rate":22050,"format":""},{"soundName":"wah beatbox","soundID":-1,"md5":"9021b7bb06f2399f18e2db4fb87095dc.wav","sampleCount":6624,"rate":22050,"format":""},{"soundName":"bass beatbox","soundID":-1,"md5":"28153621d293c86da0b246d314458faf.wav","sampleCount":6720,"rate":22050,"format":""}],"costumes":[{"costumeName":"Radio-a","baseLayerID":-1,"baseLayerMD5":"d2266f31369a97fdf7ec37090bf0a968.svg","bitmapResolution":1,"rotationCenterX":52,"rotationCenterY":38},{"costumeName":"Radio-b","baseLayerID":-1,"baseLayerMD5":"cd4cff5586d0167fd992772360bddf68.svg","bitmapResolution":1,"rotationCenterX":51,"rotationCenterY":84}],"currentCostumeIndex":0,"scratchX":-164,"scratchY":-96,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Rainbow","md5":"680a806bd87a28c8b25b5f9b6347f022.svg","type":"sprite","tags":["things","flying","drawing","color"],"info":[0,1,1],"json":{"objName":"Rainbow","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"rainbow","baseLayerID":-1,"baseLayerMD5":"680a806bd87a28c8b25b5f9b6347f022.svg","bitmapResolution":1,"rotationCenterX":72,"rotationCenterY":36}],"currentCostumeIndex":0,"scratchX":-91,"scratchY":11,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Referee","md5":"7caaa6c83b0f947268866b48fbf34ed9.svg","type":"sprite","tags":["sports","soccer","football","alex eben meyer"],"info":[0,4,1],"json":{"objName":"Referee","sounds":[{"soundName":"referee whistle","soundID":-1,"md5":"8468b9b3f11a665ee4d215afd8463b97.wav","sampleCount":14034,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"referee-a","baseLayerID":-1,"baseLayerMD5":"7caaa6c83b0f947268866b48fbf34ed9.svg","bitmapResolution":1,"rotationCenterX":44,"rotationCenterY":63},{"costumeName":"referee-b","baseLayerID":-1,"baseLayerMD5":"b26bc52a8400fa3d51201e9ab4a4dbb2.svg","bitmapResolution":1,"rotationCenterX":44,"rotationCenterY":63},{"costumeName":"referee-c","baseLayerID":-1,"baseLayerMD5":"f96a3af7f21c0b195b8f7a84146b6704.svg","bitmapResolution":1,"rotationCenterX":55,"rotationCenterY":62},{"costumeName":"referee-d","baseLayerID":-1,"baseLayerMD5":"d6795f2992d899611ee5889811801e42.svg","bitmapResolution":1,"rotationCenterX":50,"rotationCenterY":63}],"currentCostumeIndex":0,"scratchX":112,"scratchY":28,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Reindeer","md5":"0fff0b181cc4d9250b5b985cc283b049.svg","type":"sprite","tags":["animals","mammals","holiday"],"info":[0,1,1],"json":{"objName":"Reindeer","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"reindeer","baseLayerID":-1,"baseLayerMD5":"0fff0b181cc4d9250b5b985cc283b049.svg","bitmapResolution":1,"rotationCenterX":39,"rotationCenterY":70}],"currentCostumeIndex":0,"scratchX":13,"scratchY":26,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Retro Robot","md5":"a17c1ce38c261395ae268f3b8a9037db.svg","type":"sprite","tags":["robot"],"info":[0,3,2],"json":{"objName":"Retro Robot","sounds":[{"soundName":"computer beeps1","soundID":-1,"md5":"1da43f6d52d0615da8a250e28100a80d.wav","sampleCount":19200,"rate":11025,"format":""},{"soundName":"computer beeps2","soundID":-1,"md5":"28c76b6bebd04be1383fe9ba4933d263.wav","sampleCount":9536,"rate":11025,"format":""}],"costumes":[{"costumeName":"Retro Robot a","baseLayerID":-1,"baseLayerMD5":"a17c1ce38c261395ae268f3b8a9037db.svg","bitmapResolution":1,"rotationCenterX":55,"rotationCenterY":86},{"costumeName":"Retro Robot b","baseLayerID":-1,"baseLayerMD5":"bfb5afe62358ef542f118299bb53d4b7.svg","bitmapResolution":1,"rotationCenterX":52,"rotationCenterY":88},{"costumeName":"Retro Robot c","baseLayerID":-1,"baseLayerMD5":"f925e3bde178001133a11fa97847a9ae.svg","bitmapResolution":1,"rotationCenterX":72,"rotationCenterY":91}],"currentCostumeIndex":0,"scratchX":50,"scratchY":-72,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Ripley","md5":"417ec9f25ad70281564e85e67c97aa08.svg","type":"sprite","tags":["space","people","wren mcdonald"],"info":[0,6,1],"json":{"objName":"Ripley","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"ripley-a","baseLayerID":-1,"baseLayerMD5":"417ec9f25ad70281564e85e67c97aa08.svg","bitmapResolution":1,"rotationCenterX":57,"rotationCenterY":89},{"costumeName":"ripley-b","baseLayerID":-1,"baseLayerMD5":"e40918acf5c4d1d0d42b437b6b6e965d.svg","bitmapResolution":1,"rotationCenterX":57,"rotationCenterY":89},{"costumeName":"ripley-c","baseLayerID":-1,"baseLayerMD5":"5fb713effcdae17208e6e89527bf720c.svg","bitmapResolution":1,"rotationCenterX":57,"rotationCenterY":89},{"costumeName":"ripley-d","baseLayerID":-1,"baseLayerMD5":"6c6597c221c9a5b46c160f537b9795a2.svg","bitmapResolution":1,"rotationCenterX":85,"rotationCenterY":89},{"costumeName":"ripley-e","baseLayerID":-1,"baseLayerMD5":"92909161afd79673c93a77d15fe8d456.svg","bitmapResolution":1,"rotationCenterX":56,"rotationCenterY":89},{"costumeName":"ripley-f","baseLayerID":-1,"baseLayerMD5":"16e31a6b510ba4e8c1215e6e3a41d9f9.svg","bitmapResolution":1,"rotationCenterX":58,"rotationCenterY":90}],"currentCostumeIndex":0,"scratchX":163,"scratchY":-51,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Robot","md5":"cb3985cd066ccbab11954709b3d54c17.svg","type":"sprite","tags":["space","robot","wren mcdonald"],"info":[0,4,3],"json":{"objName":"Robot","sounds":[{"soundName":"computer beep","soundID":-1,"md5":"28c76b6bebd04be1383fe9ba4933d263.wav","sampleCount":9536,"rate":11025,"format":""},{"soundName":"collect","soundID":-1,"md5":"32514c51e03db680e9c63857b840ae78.wav","sampleCount":13320,"rate":22050,"format":"adpcm"},{"soundName":"buzz whir","soundID":-1,"md5":"d4f76ded6bccd765958d15b63804de55.wav","sampleCount":9037,"rate":11025,"format":""}],"costumes":[{"costumeName":"robot-a","baseLayerID":-1,"baseLayerMD5":"cb3985cd066ccbab11954709b3d54c17.svg","bitmapResolution":1,"rotationCenterX":74,"rotationCenterY":109},{"costumeName":"robot-b","baseLayerID":-1,"baseLayerMD5":"fc9276d0909539fd31c30db7b2e08bf9.svg","bitmapResolution":1,"rotationCenterX":56,"rotationCenterY":97},{"costumeName":"robot-c","baseLayerID":-1,"baseLayerMD5":"c5e02f00d233199fea1c51b71c402ce4.svg","bitmapResolution":1,"rotationCenterX":63,"rotationCenterY":97},{"costumeName":"robot-d","baseLayerID":-1,"baseLayerMD5":"ca2cf7d6c0446fbce36621006a4b0fac.svg","bitmapResolution":1,"rotationCenterX":59,"rotationCenterY":95}],"currentCostumeIndex":0,"scratchX":-127,"scratchY":87,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Rocketship","md5":"85190bb07708855c0896224340e159ed.svg","type":"sprite","tags":["space","spaceship","wren mcdonald"],"info":[0,5,3],"json":{"objName":"Rocketship","sounds":[{"soundName":"space ripple","soundID":-1,"md5":"ff8b8c3bf841a11fd5fe3afaa92be1b5.wav","sampleCount":41149,"rate":11025,"format":""},{"soundName":"laser1","soundID":-1,"md5":"46571f8ec0f2cc91666c80e312579082.wav","sampleCount":516,"rate":11025,"format":""},{"soundName":"laser2","soundID":-1,"md5":"27654ed2e3224f0a3f77c244e4fae9aa.wav","sampleCount":755,"rate":11025,"format":""}],"costumes":[{"costumeName":"rocketship-a","baseLayerID":-1,"baseLayerMD5":"85190bb07708855c0896224340e159ed.svg","bitmapResolution":1,"rotationCenterX":63,"rotationCenterY":92},{"costumeName":"rocketship-b","baseLayerID":-1,"baseLayerMD5":"2c0f804073ec656a86bbc3ebdf18bf5d.svg","bitmapResolution":1,"rotationCenterX":54,"rotationCenterY":92},{"costumeName":"rocketship-c","baseLayerID":-1,"baseLayerMD5":"13a0accfa405979e4deee12e6eb9c41e.svg","bitmapResolution":1,"rotationCenterX":59,"rotationCenterY":91},{"costumeName":"rocketship-d","baseLayerID":-1,"baseLayerMD5":"f4d0c6da1c167abbd8e86ff720ae24f9.svg","bitmapResolution":1,"rotationCenterX":65,"rotationCenterY":91},{"costumeName":"rocketship-e","baseLayerID":-1,"baseLayerMD5":"6e58c447e994a38b51eeb105dff5711c.svg","bitmapResolution":1,"rotationCenterX":71,"rotationCenterY":111}],"currentCostumeIndex":0,"scratchX":123,"scratchY":50,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Rocks","md5":"82c79fdb6a7d9c49ab7f70ee79a3d7f8.svg","type":"sprite","tags":["things","potassium"],"info":[0,1,1],"json":{"objName":"Rocks","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"rocks","baseLayerID":-1,"baseLayerMD5":"82c79fdb6a7d9c49ab7f70ee79a3d7f8.svg","bitmapResolution":1,"rotationCenterX":59,"rotationCenterY":15}],"currentCostumeIndex":0,"scratchX":35,"scratchY":36,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Rooster","md5":"db49a3dc8db15ea2b92d7934488f996b.svg","type":"sprite","tags":["animals","chicken","farm","owen davey"],"info":[0,3,2],"json":{"objName":"Rooster","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""},{"soundName":"rooster","soundID":-1,"md5":"2e375acae2c7c0d655935a9de14b12f6.wav","sampleCount":17110,"rate":11025,"format":""}],"costumes":[{"costumeName":"rooster-a","baseLayerID":-1,"baseLayerMD5":"db49a3dc8db15ea2b92d7934488f996b.svg","bitmapResolution":1,"rotationCenterX":59,"rotationCenterY":70},{"costumeName":"rooster-b","baseLayerID":-1,"baseLayerMD5":"c5aa68995a2ac203d6fe2e4dd9d86911.svg","bitmapResolution":1,"rotationCenterX":58,"rotationCenterY":70},{"costumeName":"rooster-c","baseLayerID":-1,"baseLayerMD5":"b7a5c9f9d387cc7d36d6ed935d2a46b1.svg","bitmapResolution":1,"rotationCenterX":54,"rotationCenterY":72}],"currentCostumeIndex":0,"scratchX":-6,"scratchY":3,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Ruby","md5":"c30210e8f719c3a4d2c7cc6917a39300.png","type":"sprite","tags":["people"],"info":[0,2,1],"json":{"objName":"Ruby","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"ruby-a","baseLayerID":-1,"baseLayerMD5":"c30210e8f719c3a4d2c7cc6917a39300.png","bitmapResolution":2,"rotationCenterX":54,"rotationCenterY":172},{"costumeName":"ruby-b","baseLayerID":-1,"baseLayerMD5":"fc15fdbcc535473f6140cab28197f3be.png","bitmapResolution":2,"rotationCenterX":76,"rotationCenterY":142}],"currentCostumeIndex":0,"scratchX":-39,"scratchY":37,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Sailboat","md5":"ca241a938a2c44a0de6b91230012ff39.png","type":"sprite","tags":["boat","transportation"],"info":[0,1,1],"json":{"objName":"Sailboat","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"sailboat","baseLayerID":-1,"baseLayerMD5":"ca241a938a2c44a0de6b91230012ff39.png","bitmapResolution":2,"rotationCenterX":224,"rotationCenterY":182}],"currentCostumeIndex":0,"scratchX":18,"scratchY":49,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Sam","md5":"8208e99159b36c957fb9fbc187e51bc7.png","type":"sprite","tags":["people"],"info":[0,1,1],"json":{"objName":"Sam","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"sam","baseLayerID":-1,"baseLayerMD5":"8208e99159b36c957fb9fbc187e51bc7.png","bitmapResolution":2,"rotationCenterX":117,"rotationCenterY":159}],"currentCostumeIndex":0,"scratchX":50,"scratchY":-28,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Saxophone","md5":"e9e4297f5d7e630a384b1dea835ec72d.svg","type":"sprite","tags":["music","andrew rae"],"info":[0,2,8],"json":{"objName":"Saxophone","sounds":[{"soundName":"C Sax","soundID":-1,"md5":"4d2c939d6953b5f241a27a62cf72de64.wav","sampleCount":9491,"rate":22050,"format":""},{"soundName":"D Sax","soundID":-1,"md5":"39f41954a73c0e15d842061e1a4c5e1d.wav","sampleCount":9555,"rate":22050,"format":""},{"soundName":"E Sax","soundID":-1,"md5":"3568b7dfe173fab6877a9ff1dcbcf1aa.wav","sampleCount":7489,"rate":22050,"format":""},{"soundName":"F Sax","soundID":-1,"md5":"2ae3083817bcd595e26ea2884b6684d5.wav","sampleCount":7361,"rate":22050,"format":"adpcm"},{"soundName":"G Sax","soundID":-1,"md5":"cefba5de46adfe5702485e0934bb1e13.wav","sampleCount":7349,"rate":22050,"format":"adpcm"},{"soundName":"A Sax","soundID":-1,"md5":"420991e0d6d99292c6d736963842536a.wav","sampleCount":6472,"rate":22050,"format":""},{"soundName":"B Sax","soundID":-1,"md5":"653ebe92d491b49ad5d8101d629f567b.wav","sampleCount":9555,"rate":22050,"format":""},{"soundName":"C2 Sax","soundID":-1,"md5":"ea8d34b18c3d8fe328cea201666458bf.wav","sampleCount":7349,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"saxophone-a","baseLayerID":-1,"baseLayerMD5":"e9e4297f5d7e630a384b1dea835ec72d.svg","bitmapResolution":1,"rotationCenterX":47,"rotationCenterY":80},{"costumeName":"saxophone-b","baseLayerID":-1,"baseLayerMD5":"04e5650480bfcf9190aa35bbd8d67b8e.svg","bitmapResolution":1,"rotationCenterX":47,"rotationCenterY":80}],"currentCostumeIndex":0,"scratchX":137,"scratchY":-13,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Scarf","md5":"5d671a4eb5c42e365d3c0ba1b885d9d8.svg","type":"sprite","tags":["fashion","red"],"info":[0,3,1],"json":{"objName":"Scarf","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Scarf-a","baseLayerID":-1,"baseLayerMD5":"5d671a4eb5c42e365d3c0ba1b885d9d8.svg","bitmapResolution":1,"rotationCenterX":54,"rotationCenterY":23},{"costumeName":"Scarf-b","baseLayerID":-1,"baseLayerMD5":"0c03668b4e26eba969ad803a4e810c78.svg","bitmapResolution":1,"rotationCenterX":54,"rotationCenterY":23},{"costumeName":"Scarf-c","baseLayerID":-1,"baseLayerMD5":"ce66662165e2756070f1b12e0a7cb5db.svg","bitmapResolution":1,"rotationCenterX":30,"rotationCenterY":44}],"currentCostumeIndex":0,"scratchX":53,"scratchY":10,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Shark","md5":"4ca6776e9c021e8b21c3346793c9361d.svg","type":"sprite","tags":["animals","underwater","ipzy","fish"],"info":[0,2,1],"json":{"objName":"Shark","sounds":[{"soundName":"chomp","soundID":-1,"md5":"0b1e3033140d094563248e61de4039e5.wav","sampleCount":2912,"rate":11025,"format":""}],"costumes":[{"costumeName":"shark-a","baseLayerID":-1,"baseLayerMD5":"4ca6776e9c021e8b21c3346793c9361d.svg","bitmapResolution":1,"rotationCenterX":150,"rotationCenterY":60},{"costumeName":"shark-b","baseLayerID":-1,"baseLayerMD5":"0bb623f0bbec53ee9667cee0b7ad6d47.svg","bitmapResolution":1,"rotationCenterX":150,"rotationCenterY":60}],"currentCostumeIndex":0,"scratchX":-5,"scratchY":54,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Shark 2","md5":"7c0a907eae79462f69f8e2af8e7df828.svg","type":"sprite","tags":["animals","ocean","sea","fish","teeth","carnivore","chomp"],"info":[0,3,3],"json":{"objName":"Shark 2","sounds":[{"soundName":"Water drop","soundID":-1,"md5":"e133e625fd367d269e76964d4b722fc2.wav","sampleCount":15131,"rate":22050,"format":"adpcm"},{"soundName":"Bite","soundID":-1,"md5":"0039635b1d6853face36581784558454.wav","sampleCount":7672,"rate":22050,"format":"adpcm"},{"soundName":"Water drop","soundID":-1,"md5":"0b1e3033140d094563248e61de4039e5.wav","sampleCount":2912,"rate":11025,"format":""}],"costumes":[{"costumeName":"shark2-a","baseLayerID":-1,"baseLayerMD5":"7c0a907eae79462f69f8e2af8e7df828.svg","bitmapResolution":1,"rotationCenterX":75,"rotationCenterY":75},{"costumeName":"shark2-b","baseLayerID":-1,"baseLayerMD5":"cff9ae87a93294693a0650b38a7a33d2.svg","bitmapResolution":1,"rotationCenterX":75,"rotationCenterY":75},{"costumeName":"shark2-c","baseLayerID":-1,"baseLayerMD5":"afeae3f998598424f7c50918507f6ce6.svg","bitmapResolution":1,"rotationCenterX":77,"rotationCenterY":37}],"currentCostumeIndex":0,"scratchX":41,"scratchY":-15,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Shirt","md5":"659465944053fe6fb6aa1ed0e11be9aa.svg","type":"sprite","tags":["fashion","shirt"],"info":[0,1,1],"json":{"objName":"Shirt","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"shirt-a","baseLayerID":-1,"baseLayerMD5":"659465944053fe6fb6aa1ed0e11be9aa.svg","bitmapResolution":1,"rotationCenterX":46,"rotationCenterY":40}],"currentCostumeIndex":0,"scratchX":147,"scratchY":93,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Shoes","md5":"4639a1af5bc91f1a6f14e822cd46972f.svg","type":"sprite","tags":["fashion","shoes","sneakers","clothing"],"info":[0,4,1],"json":{"objName":"Shoes","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"shoes-a","baseLayerID":-1,"baseLayerMD5":"4639a1af5bc91f1a6f14e822cd46972f.svg","bitmapResolution":1,"rotationCenterX":40,"rotationCenterY":13},{"costumeName":"shoes-b","baseLayerID":-1,"baseLayerMD5":"6ba2a692c17f47170d611578a5620ae5.svg","bitmapResolution":1,"rotationCenterX":40,"rotationCenterY":31},{"costumeName":"shoes-d","baseLayerID":-1,"baseLayerMD5":"1130f7ca93716bac6afa31af86329e92.svg","bitmapResolution":1,"rotationCenterX":44,"rotationCenterY":32},{"costumeName":"shoes-c","baseLayerID":-1,"baseLayerMD5":"14c6843195bd13824d253cb3fdb9e6de.svg","bitmapResolution":1,"rotationCenterX":45,"rotationCenterY":33}],"currentCostumeIndex":0,"scratchX":49,"scratchY":-140,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Shorts","md5":"d9b580c913c0d1d1a996dd733af91e68.svg","type":"sprite","tags":["fashion","pants","shorts","clothing"],"info":[0,3,1],"json":{"objName":"Shorts","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"shorts-a","baseLayerID":-1,"baseLayerMD5":"d9b580c913c0d1d1a996dd733af91e68.svg","bitmapResolution":1,"rotationCenterX":35,"rotationCenterY":37},{"costumeName":"shorts-b","baseLayerID":-1,"baseLayerMD5":"1e07ab2763e5e0f5557f97c0e2c89020.svg","bitmapResolution":1,"rotationCenterX":43,"rotationCenterY":36},{"costumeName":"shorts-c","baseLayerID":-1,"baseLayerMD5":"dc9e0a1c2489ec0bf59a937b6c8ae85b.svg","bitmapResolution":1,"rotationCenterX":35,"rotationCenterY":29}],"currentCostumeIndex":0,"scratchX":-166,"scratchY":-113,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Singer1","md5":"e47ef1af3b925e5ac9e3b3f809d440b3.svg","type":"sprite","tags":["people","music"],"info":[0,1,1],"json":{"objName":"Singer1","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Singer1","baseLayerID":-1,"baseLayerMD5":"e47ef1af3b925e5ac9e3b3f809d440b3.svg","bitmapResolution":1,"rotationCenterX":75,"rotationCenterY":75}],"currentCostumeIndex":0,"scratchX":-74,"scratchY":-32,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Skeleton","md5":"e06f6eaf4fd27ff22f4c8207aa13c967.svg","type":"sprite","tags":["fantasy","spooky","halloween","bones","monster","alex eben meyer"],"info":[0,4,1],"json":{"objName":"Skeleton","sounds":[{"soundName":"rattle","soundID":-1,"md5":"74f1c07e0bcd7811fd9d456a5f8667f8.wav","sampleCount":13184,"rate":22050,"format":""}],"costumes":[{"costumeName":"skeleton-a","baseLayerID":-1,"baseLayerMD5":"e06f6eaf4fd27ff22f4c8207aa13c967.svg","bitmapResolution":1,"rotationCenterX":59,"rotationCenterY":100},{"costumeName":"skeleton-b","baseLayerID":-1,"baseLayerMD5":"06769ddf5fad85e101c7beda554d60b9.svg","bitmapResolution":1,"rotationCenterX":69,"rotationCenterY":90},{"costumeName":"skeleton-d","baseLayerID":-1,"baseLayerMD5":"155efd0dfdc59a0e2a546a4a7d068ece.svg","bitmapResolution":1,"rotationCenterX":51,"rotationCenterY":100},{"costumeName":"skeleton-e","baseLayerID":-1,"baseLayerMD5":"c41a11468602522cdc6dec7043215f65.svg","bitmapResolution":1,"rotationCenterX":55,"rotationCenterY":89}],"currentCostumeIndex":0,"scratchX":148,"scratchY":-34,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Snake","md5":"4d06e12d90479461303d828f0970f2d4.svg","type":"sprite","tags":["animals","reptile","robert hunter"],"info":[0,3,1],"json":{"objName":"Snake","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"snake-a","baseLayerID":-1,"baseLayerMD5":"4d06e12d90479461303d828f0970f2d4.svg","bitmapResolution":1,"rotationCenterX":142,"rotationCenterY":68},{"costumeName":"snake-b","baseLayerID":-1,"baseLayerMD5":"a8546a5f9ccaa2bdb678a362c50a17ec.svg","bitmapResolution":1,"rotationCenterX":142,"rotationCenterY":68},{"costumeName":"snake-c","baseLayerID":-1,"baseLayerMD5":"d993a7d70179777c14ac91a07e711d90.svg","bitmapResolution":1,"rotationCenterX":142,"rotationCenterY":68}],"currentCostumeIndex":0,"scratchX":-113,"scratchY":-99,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Snowflake","md5":"67de2af723246de37d7379b76800ee0b.svg","type":"sprite","tags":["winter"],"info":[0,1,1],"json":{"objName":"Snowflake","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"snowflake","baseLayerID":-1,"baseLayerMD5":"67de2af723246de37d7379b76800ee0b.svg","bitmapResolution":1,"rotationCenterX":104,"rotationCenterY":103}],"currentCostumeIndex":0,"scratchX":0,"scratchY":-32,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Snowman","md5":"56c71c31c17b9bc66a2aab0342cf94b2.svg","type":"sprite","tags":["fantasy","drawing","winter"],"info":[0,1,1],"json":{"objName":"Snowman","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"snowman","baseLayerID":-1,"baseLayerMD5":"56c71c31c17b9bc66a2aab0342cf94b2.svg","bitmapResolution":1,"rotationCenterX":75,"rotationCenterY":75}],"currentCostumeIndex":0,"scratchX":-86,"scratchY":45,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Soccer Ball","md5":"73eaf05fed60e9d65867508736f84569.svg","type":"sprite","tags":["sports","soccer","football","alex eben meyer"],"info":[0,1,1],"json":{"objName":"Soccer Ball","sounds":[{"soundName":"basketball bounce","soundID":-1,"md5":"1727f65b5f22d151685b8e5917456a60.wav","sampleCount":8099,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"soccer ball","baseLayerID":-1,"baseLayerMD5":"73eaf05fed60e9d65867508736f84569.svg","bitmapResolution":1,"rotationCenterX":23,"rotationCenterY":22}],"currentCostumeIndex":0,"scratchX":74,"scratchY":-80,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Speaker","md5":"44dc3a2ec161999545914d1f77332d76.svg","type":"sprite","tags":["music","things","bass","treble","concert"],"info":[0,1,7],"json":{"objName":"Speaker","variables":[{"name":"scale degree","value":1,"isPersistent":false},{"name":"octave","value":0,"isPersistent":false},{"name":"note number","value":62,"isPersistent":false},{"name":"loop number","value":1,"isPersistent":false}],"sounds":[{"soundName":"Drive Around","soundID":-1,"md5":"a3a85fb8564b0266f50a9c091087b7aa.wav","sampleCount":44096,"rate":22050,"format":""},{"soundName":"Scratchy Beat","soundID":-1,"md5":"289dc558e076971e74dd1a0bd55719b1.wav","sampleCount":44096,"rate":22050,"format":""},{"soundName":"Drum Jam","soundID":-1,"md5":"8b5486ccc806e97e83049d25b071f7e4.wav","sampleCount":44288,"rate":22050,"format":""},{"soundName":"Cymbal Echo","soundID":-1,"md5":"bb243badd1201b2607bf2513df10cd97.wav","sampleCount":44326,"rate":22050,"format":""},{"soundName":"Drum Satellite","soundID":-1,"md5":"079067d7909f791b29f8be1c00fc2131.wav","sampleCount":44096,"rate":22050,"format":""},{"soundName":"Kick Back","soundID":-1,"md5":"9cd340d9d568b1479f731e69e103b3ce.wav","sampleCount":44748,"rate":22050,"format":"adpcm"},{"soundName":"Drum Funky","soundID":-1,"md5":"fb56022366d21b299cbc3fd5e16000c2.wav","sampleCount":44748,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"speaker","baseLayerID":-1,"baseLayerMD5":"44dc3a2ec161999545914d1f77332d76.svg","bitmapResolution":1,"rotationCenterX":53,"rotationCenterY":79}],"currentCostumeIndex":0,"scratchX":-1,"scratchY":-28,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Squirrel","md5":"b86efb7f23387300cf9037a61f328ab9.png","type":"sprite","tags":["animals"],"info":[0,1,1],"json":{"objName":"Squirrel","sounds":[{"soundName":"meow","soundID":-1,"md5":"83c36d806dc92327b9e7049a565c6bff.wav","sampleCount":18688,"rate":22050,"format":""}],"costumes":[{"costumeName":"squirrel","baseLayerID":-1,"baseLayerMD5":"b86efb7f23387300cf9037a61f328ab9.png","bitmapResolution":2,"rotationCenterX":158,"rotationCenterY":146}],"currentCostumeIndex":0,"scratchX":52,"scratchY":-28,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Star","md5":"e929c1274c379b6b6fed12e6dec63368.svg","type":"sprite","tags":["shapes","space"],"info":[0,1,1],"json":{"objName":"Star","sounds":[{"soundName":"collect","soundID":-1,"md5":"32514c51e03db680e9c63857b840ae78.wav","sampleCount":13320,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"star","baseLayerID":-1,"baseLayerMD5":"e929c1274c379b6b6fed12e6dec63368.svg","bitmapResolution":1,"rotationCenterX":22,"rotationCenterY":23}],"currentCostumeIndex":0,"scratchX":55,"scratchY":44,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Starfish","md5":"3d1101bbc24ae292a36356af325f660c.svg","type":"sprite","tags":["animals","echinodermata","underwater","sea","ocean"],"info":[0,2,1],"json":{"objName":"Starfish","sounds":[{"soundName":"collect","soundID":-1,"md5":"32514c51e03db680e9c63857b840ae78.wav","sampleCount":13320,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"starfish-a","baseLayerID":-1,"baseLayerMD5":"3d1101bbc24ae292a36356af325f660c.svg","bitmapResolution":1,"rotationCenterX":75,"rotationCenterY":75},{"costumeName":"starfish-b ","baseLayerID":-1,"baseLayerMD5":"ad8007f4e63693984d4adc466ffa3ad2.svg","bitmapResolution":1,"rotationCenterX":53,"rotationCenterY":60}],"currentCostumeIndex":0,"scratchX":-32,"scratchY":5,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Stop","md5":"5b9e3e8edffb0bd4914113609eec5e04.svg","type":"sprite","tags":["shapes","things"],"info":[0,1,1],"json":{"objName":"Stop","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"stop","baseLayerID":-1,"baseLayerMD5":"5b9e3e8edffb0bd4914113609eec5e04.svg","bitmapResolution":1,"rotationCenterX":25,"rotationCenterY":25}],"currentCostumeIndex":0,"scratchX":-29,"scratchY":-29,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Strawberry","md5":"b4cff4b414b5f7fbf25c7c45abfb6c62.svg","type":"sprite","tags":["food","fruit","alex eben meyer"],"info":[0,5,1],"json":{"objName":"Strawberry","sounds":[{"soundName":"chomp","soundID":-1,"md5":"0b1e3033140d094563248e61de4039e5.wav","sampleCount":2912,"rate":11025,"format":""}],"costumes":[{"costumeName":"strawberry-a","baseLayerID":-1,"baseLayerMD5":"b4cff4b414b5f7fbf25c7c45abfb6c62.svg","bitmapResolution":1,"rotationCenterX":31,"rotationCenterY":47},{"costumeName":"strawberry-b","baseLayerID":-1,"baseLayerMD5":"ebb8720dc679772e3dcb1b49e0503aa4.svg","bitmapResolution":1,"rotationCenterX":43,"rotationCenterY":47},{"costumeName":"strawberry-c","baseLayerID":-1,"baseLayerMD5":"278dc229a71e2fbff475908ca5c2483e.svg","bitmapResolution":1,"rotationCenterX":43,"rotationCenterY":47},{"costumeName":"strawberry-d","baseLayerID":-1,"baseLayerMD5":"68a023e80cb9eff2350374361c034f08.svg","bitmapResolution":1,"rotationCenterX":41,"rotationCenterY":47},{"costumeName":"strawberry-e","baseLayerID":-1,"baseLayerMD5":"9fef0cd91ba59163d74f4464b02824b8.svg","bitmapResolution":1,"rotationCenterX":32,"rotationCenterY":36}],"currentCostumeIndex":0,"scratchX":138,"scratchY":91,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Sun","md5":"55c931c65456822c0c56a2b30e3e550d.svg","type":"sprite","tags":["space","star","hydrogen","helium","fusion","nuclear"],"info":[0,1,1],"json":{"objName":"Sun","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"sun","baseLayerID":-1,"baseLayerMD5":"55c931c65456822c0c56a2b30e3e550d.svg","bitmapResolution":1,"rotationCenterX":72,"rotationCenterY":72}],"currentCostumeIndex":0,"scratchX":16,"scratchY":-28,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Sunglasses1","md5":"424393e8705aeadcfecb8559ce4dcea2.svg","type":"sprite","tags":["fashion","cool"],"info":[0,2,1],"json":{"objName":"Sunglasses1","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"sunglasses-a","baseLayerID":-1,"baseLayerMD5":"424393e8705aeadcfecb8559ce4dcea2.svg","bitmapResolution":1,"rotationCenterX":37,"rotationCenterY":14},{"costumeName":"sunglasses-b","baseLayerID":-1,"baseLayerMD5":"3185d2295bbf2c5ebd0688c9e4f13076.svg","bitmapResolution":1,"rotationCenterX":29,"rotationCenterY":10}],"currentCostumeIndex":0,"scratchX":-36,"scratchY":0,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Taco","md5":"bc78fb90ed373d56c11d5fafa4203ccd.svg","type":"sprite","tags":["food","designerd"],"info":[0,2,1],"json":{"objName":"Taco","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Taco","baseLayerID":-1,"baseLayerMD5":"bc78fb90ed373d56c11d5fafa4203ccd.svg","bitmapResolution":1,"rotationCenterX":78,"rotationCenterY":48},{"costumeName":"Taco-wizard","baseLayerID":-1,"baseLayerMD5":"5e9e65db20d403b590578ed44b1a3792.svg","bitmapResolution":1,"rotationCenterX":125,"rotationCenterY":82}],"currentCostumeIndex":0,"scratchX":0,"scratchY":0,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Takeout","md5":"05c010b2425c4433353ff85d43ed7a1d.svg","type":"sprite","tags":["food","alex eben meyer"],"info":[0,5,1],"json":{"objName":"Takeout","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"takeout-a","baseLayerID":-1,"baseLayerMD5":"05c010b2425c4433353ff85d43ed7a1d.svg","bitmapResolution":1,"rotationCenterX":33,"rotationCenterY":41},{"costumeName":"takeout-b","baseLayerID":-1,"baseLayerMD5":"26c3be261cbb0327eaa1afe0467c80d0.svg","bitmapResolution":1,"rotationCenterX":33,"rotationCenterY":42},{"costumeName":"takeout-c","baseLayerID":-1,"baseLayerMD5":"801fa349b34531a15d467fef2b940f87.svg","bitmapResolution":1,"rotationCenterX":33,"rotationCenterY":53},{"costumeName":"takeout-d","baseLayerID":-1,"baseLayerMD5":"24e21e2846b59cdf2c390ebe985b3c74.svg","bitmapResolution":1,"rotationCenterX":40,"rotationCenterY":42},{"costumeName":"takeout-e","baseLayerID":-1,"baseLayerMD5":"95584a98e22df5ca7370f5c01ebe6d06.svg","bitmapResolution":1,"rotationCenterX":41,"rotationCenterY":35}],"currentCostumeIndex":0,"scratchX":-5,"scratchY":65,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Ten80 Dance","md5":"f60f99278455c843b7833fb7615428dd.png","type":"sprite","tags":["people","dance"],"info":[0,13,1],"json":{"objName":"Ten80 Dance","sounds":[{"soundName":"dance celebrate","soundID":-1,"md5":"0edb8fb88af19e6e17d0f8cf64c1d136.wav","sampleCount":176401,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"Ten80 stance","baseLayerID":-1,"baseLayerMD5":"f60f99278455c843b7833fb7615428dd.png","bitmapResolution":2,"rotationCenterX":70,"rotationCenterY":278},{"costumeName":"Ten80 top stand","baseLayerID":-1,"baseLayerMD5":"b2f75ac1cd84615efaea6a7d7a4ee205.png","bitmapResolution":2,"rotationCenterX":74,"rotationCenterY":274},{"costumeName":"Ten80 top R step","baseLayerID":-1,"baseLayerMD5":"580fba92f23d5592200eb5a9079dc38f.png","bitmapResolution":2,"rotationCenterX":200,"rotationCenterY":270},{"costumeName":"Ten80 top L step","baseLayerID":-1,"baseLayerMD5":"e51942bb4651e616549cfce1ad36ff83.png","bitmapResolution":2,"rotationCenterX":144,"rotationCenterY":266},{"costumeName":"Ten80 top freeze","baseLayerID":-1,"baseLayerMD5":"8313a2229d555bbdb8ce92dffed067ad.png","bitmapResolution":2,"rotationCenterX":54,"rotationCenterY":258},{"costumeName":"Ten80 top R cross","baseLayerID":-1,"baseLayerMD5":"e06ac61e96e3a5abf4ca0863816f5d28.png","bitmapResolution":2,"rotationCenterX":206,"rotationCenterY":252},{"costumeName":"Ten80 pop front","baseLayerID":-1,"baseLayerMD5":"86602007ae2952236d47d7fd587a56b6.png","bitmapResolution":2,"rotationCenterX":72,"rotationCenterY":266},{"costumeName":"Ten80 pop down","baseLayerID":-1,"baseLayerMD5":"fea7045c09073700b88fae8d4d257cd1.png","bitmapResolution":2,"rotationCenterX":74,"rotationCenterY":188},{"costumeName":"Ten80 pop left","baseLayerID":-1,"baseLayerMD5":"3c9a7eac1d696ae74ee40c6efa8fa4dd.png","bitmapResolution":2,"rotationCenterX":184,"rotationCenterY":266},{"costumeName":"Ten80 pop right","baseLayerID":-1,"baseLayerMD5":"548bdf23904e409c1fcc0992f44d0b4c.png","bitmapResolution":2,"rotationCenterX":78,"rotationCenterY":276},{"costumeName":"Ten80 pop L arm","baseLayerID":-1,"baseLayerMD5":"ce2141ce97921ddc333bc65ff5bec27d.png","bitmapResolution":2,"rotationCenterX":100,"rotationCenterY":280},{"costumeName":"Ten80 pop stand","baseLayerID":-1,"baseLayerMD5":"377b8521c436f4f39ed2100fa1cb7c2f.png","bitmapResolution":2,"rotationCenterX":92,"rotationCenterY":280},{"costumeName":"Ten80 pop R arm","baseLayerID":-1,"baseLayerMD5":"279bd5499329f98a68cf92c68014e198.png","bitmapResolution":2,"rotationCenterX":74,"rotationCenterY":278}],"currentCostumeIndex":0,"scratchX":-86,"scratchY":4,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Tennis Ball","md5":"34fa36004be0340ec845ba6bbeb5e5d5.png","type":"sprite","tags":["ball","sports"],"info":[0,1,1],"json":{"objName":"Tennis Ball","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"tennisball","baseLayerID":-1,"baseLayerMD5":"34fa36004be0340ec845ba6bbeb5e5d5.png","bitmapResolution":2,"rotationCenterX":30,"rotationCenterY":30}],"currentCostumeIndex":0,"scratchX":39,"scratchY":-20,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Tera","md5":"b54a4a9087435863ab6f6c908f1cac99.svg","type":"sprite","tags":["fantasy","drawing"],"info":[0,4,1],"json":{"objName":"Tera","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"tera-a","baseLayerID":-1,"baseLayerMD5":"b54a4a9087435863ab6f6c908f1cac99.svg","bitmapResolution":1,"rotationCenterX":49,"rotationCenterY":63},{"costumeName":"tera-b","baseLayerID":-1,"baseLayerMD5":"1e6b3a29351cda80d1a70a3cc0e499f2.svg","bitmapResolution":1,"rotationCenterX":49,"rotationCenterY":64},{"costumeName":"tera-c","baseLayerID":-1,"baseLayerMD5":"7edf116cbb7111292361431521ae699e.svg","bitmapResolution":1,"rotationCenterX":49,"rotationCenterY":63},{"costumeName":"tera-d","baseLayerID":-1,"baseLayerMD5":"7c3c9c8b5f4ac77de2036175712a777a.svg","bitmapResolution":1,"rotationCenterX":49,"rotationCenterY":63}],"currentCostumeIndex":0,"scratchX":54,"scratchY":-17,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Toucan","md5":"6c8798e606abd728b112aecedb5dc249.svg","type":"sprite","tags":["animals","bird","robert hunter"],"info":[0,3,1],"json":{"objName":"Toucan","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"toucan-a","baseLayerID":-1,"baseLayerMD5":"6c8798e606abd728b112aecedb5dc249.svg","bitmapResolution":1,"rotationCenterX":80,"rotationCenterY":63},{"costumeName":"toucan-b","baseLayerID":-1,"baseLayerMD5":"a3e12be9efa0e7aa83778f6054c9c541.svg","bitmapResolution":1,"rotationCenterX":80,"rotationCenterY":63},{"costumeName":"toucan-c","baseLayerID":-1,"baseLayerMD5":"56522b58a9959fd6152060346129f7cb.svg","bitmapResolution":1,"rotationCenterX":80,"rotationCenterY":63}],"currentCostumeIndex":0,"scratchX":111,"scratchY":-94,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Trampoline","md5":"20b16bcb61396df304cad5e8886ceb46.png","type":"sprite","tags":["sports"],"info":[0,1,1],"json":{"objName":"Trampoline","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"trampoline","baseLayerID":-1,"baseLayerMD5":"20b16bcb61396df304cad5e8886ceb46.png","bitmapResolution":1,"rotationCenterX":100,"rotationCenterY":41}],"currentCostumeIndex":0,"scratchX":20,"scratchY":-40,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Tree1","md5":"8c40e2662c55d17bc384f47165ac43c1.svg","type":"sprite","tags":["plants","wood","forest"],"info":[0,1,1],"json":{"objName":"Tree1","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"tree1","baseLayerID":-1,"baseLayerMD5":"8c40e2662c55d17bc384f47165ac43c1.svg","bitmapResolution":1,"rotationCenterX":77,"rotationCenterY":126}],"currentCostumeIndex":0,"scratchX":91,"scratchY":18,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Trees","md5":"866ed2c2971bb04157e14e935ac8521c.svg","type":"sprite","tags":["plants","wood","forest"],"info":[0,2,1],"json":{"objName":"Trees","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"trees-a","baseLayerID":-1,"baseLayerMD5":"866ed2c2971bb04157e14e935ac8521c.svg","bitmapResolution":1,"rotationCenterX":49,"rotationCenterY":94},{"costumeName":"trees-b","baseLayerID":-1,"baseLayerMD5":"f1393dde1bb0fc512577995b27616d86.svg","bitmapResolution":1,"rotationCenterX":36,"rotationCenterY":87}],"currentCostumeIndex":0,"scratchX":26,"scratchY":-5,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Truck","md5":"51404247db5cdbc082336dfa4c03d675.svg","type":"sprite","tags":["truck","city","vehicle","car"],"info":[0,3,1],"json":{"objName":"Truck","sounds":[{"soundName":"toy honk","soundID":-1,"md5":"67aadcd28620ecdcdee2ad8eeebefa20.wav","sampleCount":10726,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"Truck-a","baseLayerID":-1,"baseLayerMD5":"51404247db5cdbc082336dfa4c03d675.svg","bitmapResolution":1,"rotationCenterX":174,"rotationCenterY":49},{"costumeName":"Truck-b","baseLayerID":-1,"baseLayerMD5":"1887b8233d1b0728f715a3985f0e01b6.svg","bitmapResolution":1,"rotationCenterX":174,"rotationCenterY":58},{"costumeName":"Truck-c","baseLayerID":-1,"baseLayerMD5":"e45bc3f87d9f603e588abe14b63b8e90.svg","bitmapResolution":1,"rotationCenterX":174,"rotationCenterY":58}],"currentCostumeIndex":0,"scratchX":-74,"scratchY":-46,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Trumpet","md5":"36a48cc311fd28b4517e15d44b11587c.svg","type":"sprite","tags":["music","andrew rae"],"info":[0,2,8],"json":{"objName":"Trumpet","sounds":[{"soundName":"C Trumpet","soundID":-1,"md5":"8970afcdc4e47bb54959a81fe27522bd.wav","sampleCount":13118,"rate":22050,"format":""},{"soundName":"D Trumpet","soundID":-1,"md5":"0b1345b8fe2ba3076fedb4f3ae48748a.wav","sampleCount":12702,"rate":22050,"format":""},{"soundName":"E Trumpet","soundID":-1,"md5":"494295a92314cadb220945a6711c568c.wav","sampleCount":8680,"rate":22050,"format":"adpcm"},{"soundName":"F Trumpet","soundID":-1,"md5":"5fa3108b119ca266029b4caa340a7cd0.wav","sampleCount":12766,"rate":22050,"format":""},{"soundName":"G Trumpet","soundID":-1,"md5":"e84afda25975f14b364118591538ccf4.wav","sampleCount":14640,"rate":22050,"format":""},{"soundName":"A Trumpet","soundID":-1,"md5":"d2dd6b4372ca17411965dc92d52b2172.wav","sampleCount":13911,"rate":22050,"format":""},{"soundName":"B Trumpet","soundID":-1,"md5":"cad2bc57729942ed9b605145fc9ea65d.wav","sampleCount":14704,"rate":22050,"format":""},{"soundName":"C2 Trumpet","soundID":-1,"md5":"df08249ed5446cc5e10b7ac62faac89b.wav","sampleCount":15849,"rate":22050,"format":""}],"costumes":[{"costumeName":"trumpet-a","baseLayerID":-1,"baseLayerMD5":"36a48cc311fd28b4517e15d44b11587c.svg","bitmapResolution":1,"rotationCenterX":57,"rotationCenterY":38},{"costumeName":"trumpet-b","baseLayerID":-1,"baseLayerMD5":"c04cdfd5f05ff2817b6ab78027ef5d22.svg","bitmapResolution":1,"rotationCenterX":55,"rotationCenterY":37}],"currentCostumeIndex":0,"scratchX":7,"scratchY":46,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Unicorn","md5":"c491fd1867375aa0160b013788d188e5.svg","type":"sprite","tags":["fantasy","animals","ipzy"],"info":[0,1,1],"json":{"objName":"Unicorn","sounds":[{"soundName":"Magic Spell","soundID":-1,"md5":"1cb60ecdb1075c8769cb346d5c2a22c7.wav","sampleCount":43077,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"unicorn","baseLayerID":-1,"baseLayerMD5":"c491fd1867375aa0160b013788d188e5.svg","bitmapResolution":1,"rotationCenterX":91,"rotationCenterY":95}],"currentCostumeIndex":0,"scratchX":5,"scratchY":-72,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Unicorn 2","md5":"a04def38351e7fd805226345cac4fbfe.svg","type":"sprite","tags":["fantasy","animals","horse","horn","rainbow"],"info":[0,1,1],"json":{"objName":"Unicorn 2","sounds":[{"soundName":"magic spell","soundID":-1,"md5":"1cb60ecdb1075c8769cb346d5c2a22c7.wav","sampleCount":43077,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"unicorn 2","baseLayerID":-1,"baseLayerMD5":"a04def38351e7fd805226345cac4fbfe.svg","bitmapResolution":1,"rotationCenterX":75,"rotationCenterY":75}],"currentCostumeIndex":0,"scratchX":-96,"scratchY":-43,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Unicorn Running","md5":"d938a2bfbac8f3caf713d189fd993af5.svg","type":"sprite","tags":["fantasy","animals","ipzy","walking"],"info":[0,6,1],"json":{"objName":"Unicorn Running","sounds":[{"soundName":"Magic Spell","soundID":-1,"md5":"1cb60ecdb1075c8769cb346d5c2a22c7.wav","sampleCount":43077,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"unicorn running-a","baseLayerID":-1,"baseLayerMD5":"d938a2bfbac8f3caf713d189fd993af5.svg","bitmapResolution":1,"rotationCenterX":118,"rotationCenterY":90},{"costumeName":"unicorn running-b","baseLayerID":-1,"baseLayerMD5":"663618fcc0484879de6ad485b288c444.svg","bitmapResolution":1,"rotationCenterX":120,"rotationCenterY":89},{"costumeName":"unicorn running-c","baseLayerID":-1,"baseLayerMD5":"ceb2f88fe182bc61af4e3864f8b46bba.svg","bitmapResolution":1,"rotationCenterX":121,"rotationCenterY":90},{"costumeName":"unicorn running-d","baseLayerID":-1,"baseLayerMD5":"dddad08a2d03f406307ec7155f43c51c.svg","bitmapResolution":1,"rotationCenterX":120,"rotationCenterY":87},{"costumeName":"unicorn running-e","baseLayerID":-1,"baseLayerMD5":"cf3a00e72f3fc20d9ad15379fdb7b424.svg","bitmapResolution":1,"rotationCenterX":119,"rotationCenterY":90},{"costumeName":"unicorn running-f","baseLayerID":-1,"baseLayerMD5":"264a70e872af2d3f6b2abad85daf82ae.svg","bitmapResolution":1,"rotationCenterX":117,"rotationCenterY":86}],"currentCostumeIndex":0,"scratchX":78,"scratchY":-73,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Wand","md5":"1aa56e9ef7043eaf36ecfe8e330271b7.svg","type":"sprite","tags":["fantasy","ipzy","things"],"info":[0,1,1],"json":{"objName":"Wand","sounds":[{"soundName":"Magic Spell","soundID":-1,"md5":"1cb60ecdb1075c8769cb346d5c2a22c7.wav","sampleCount":43077,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"wand","baseLayerID":-1,"baseLayerMD5":"1aa56e9ef7043eaf36ecfe8e330271b7.svg","bitmapResolution":1,"rotationCenterX":12,"rotationCenterY":42}],"currentCostumeIndex":0,"scratchX":-63,"scratchY":15,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Wanda","md5":"450bc8fbd5ab6bc2e83576aad58cd07c.svg","type":"sprite","tags":["people"],"info":[0,1,1],"json":{"objName":"Wanda","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"wanda","baseLayerID":-1,"baseLayerMD5":"450bc8fbd5ab6bc2e83576aad58cd07c.svg","bitmapResolution":1,"rotationCenterX":49,"rotationCenterY":68}],"currentCostumeIndex":0,"scratchX":-75,"scratchY":49,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Watermelon","md5":"26fecef75cf3b6e0d98bff5c06475036.svg","type":"sprite","tags":["food","fruit","summer","seeds","seedless","plants"],"info":[0,3,1],"json":{"objName":"Watermelon","sounds":[{"soundName":"Bite","soundID":-1,"md5":"0039635b1d6853face36581784558454.wav","sampleCount":7672,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"watermelon-a","baseLayerID":-1,"baseLayerMD5":"26fecef75cf3b6e0d98bff5c06475036.svg","bitmapResolution":1,"rotationCenterX":40,"rotationCenterY":27},{"costumeName":"watermelon-b","baseLayerID":-1,"baseLayerMD5":"fbdaf4d1d349edd3ddf3a1c4528aa9ec.svg","bitmapResolution":1,"rotationCenterX":22,"rotationCenterY":27},{"costumeName":"watermelon-c","baseLayerID":-1,"baseLayerMD5":"5976c10412306fc093c1d1930fa05119.svg","bitmapResolution":1,"rotationCenterX":21,"rotationCenterY":15}],"currentCostumeIndex":0,"scratchX":73,"scratchY":-47,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Winter Hat","md5":"62678324450bac2154703e2978e8ab61.svg","type":"sprite","tags":["fashion"," clothing","winter","hat"],"info":[0,1,1],"json":{"objName":"Winter Hat","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Winter Hat","baseLayerID":-1,"baseLayerMD5":"62678324450bac2154703e2978e8ab61.svg","bitmapResolution":1,"rotationCenterX":35,"rotationCenterY":39}],"currentCostumeIndex":0,"scratchX":12,"scratchY":-131,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Witch","md5":"cbc54e15cd62f0c16369587377636099.svg","type":"sprite","tags":["fantasy","people","ipzy","castle","emotions","magic"],"info":[0,4,1],"json":{"objName":"Witch","sounds":[{"soundName":"Magic Spell","soundID":-1,"md5":"1cb60ecdb1075c8769cb346d5c2a22c7.wav","sampleCount":43077,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"witch-a","baseLayerID":-1,"baseLayerMD5":"cbc54e15cd62f0c16369587377636099.svg","bitmapResolution":1,"rotationCenterX":65,"rotationCenterY":140},{"costumeName":"witch-b","baseLayerID":-1,"baseLayerMD5":"64d2c4c51e6cb6008cd5e93f77e6f591.svg","bitmapResolution":1,"rotationCenterX":65,"rotationCenterY":140},{"costumeName":"witch-c","baseLayerID":-1,"baseLayerMD5":"00b768c3da5b4ee3efddf05d1eb88de2.svg","bitmapResolution":1,"rotationCenterX":65,"rotationCenterY":140},{"costumeName":"witch-d","baseLayerID":-1,"baseLayerMD5":"4fe4c0ee34a9028f2c6988b7294a61c1.svg","bitmapResolution":1,"rotationCenterX":65,"rotationCenterY":140}],"currentCostumeIndex":0,"scratchX":-47,"scratchY":33,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Wizard","md5":"9632aab80fce1c5bdb58150b29cb0067.svg","type":"sprite","tags":["fantasy","people","ipzy","castle","emotions","magic"],"info":[0,3,1],"json":{"objName":"Wizard","sounds":[{"soundName":"Magic Spell","soundID":-1,"md5":"1cb60ecdb1075c8769cb346d5c2a22c7.wav","sampleCount":43077,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"wizard-a","baseLayerID":-1,"baseLayerMD5":"9632aab80fce1c5bdb58150b29cb0067.svg","bitmapResolution":1,"rotationCenterX":87,"rotationCenterY":150},{"costumeName":"wizard-b","baseLayerID":-1,"baseLayerMD5":"36c9b8b93ddb2c392b7145862fc4e8d8.svg","bitmapResolution":1,"rotationCenterX":79,"rotationCenterY":144},{"costumeName":"wizard-c","baseLayerID":-1,"baseLayerMD5":"16d4d221a2182278cfa6b0621f455cf6.svg","bitmapResolution":1,"rotationCenterX":87,"rotationCenterY":150}],"currentCostumeIndex":0,"scratchX":-137,"scratchY":2,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Wizard Hat","md5":"2da561a7e5cbfcda613f4750020d4aa5.svg","type":"sprite","tags":["fashion","fantasy","winter"],"info":[0,1,1],"json":{"objName":"Wizard Hat","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Wizard Hat","baseLayerID":-1,"baseLayerMD5":"2da561a7e5cbfcda613f4750020d4aa5.svg","bitmapResolution":1,"rotationCenterX":34,"rotationCenterY":60}],"currentCostumeIndex":0,"scratchX":3,"scratchY":-34,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Wizard-toad","md5":"fd5c4cce36e866489febc227e23b21aa.svg","type":"sprite","tags":["fantasy","animals","people","ipzy","castle","amphibians","magic"],"info":[0,2,2],"json":{"objName":"Wizard-toad","sounds":[{"soundName":"Magic Spell","soundID":-1,"md5":"1cb60ecdb1075c8769cb346d5c2a22c7.wav","sampleCount":43077,"rate":22050,"format":"adpcm"},{"soundName":"croak","soundID":-1,"md5":"c6ce0aadb89903a43f76fc20ea57633e.wav","sampleCount":6424,"rate":22050,"format":"adpcm"}],"costumes":[{"costumeName":"wizard-toad-a","baseLayerID":-1,"baseLayerMD5":"fd5c4cce36e866489febc227e23b21aa.svg","bitmapResolution":1,"rotationCenterX":87,"rotationCenterY":80},{"costumeName":"wizard-toad-b","baseLayerID":-1,"baseLayerMD5":"4c260807d4ac4c0ad39760f1efeef1de.svg","bitmapResolution":1,"rotationCenterX":87,"rotationCenterY":80}],"currentCostumeIndex":0,"scratchX":-128,"scratchY":-85,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Zebra","md5":"f58632e6b34fa8f9b35219e52ed2c864.svg","type":"sprite","tags":["animals","zebra","savanna","robert hunter"],"info":[0,2,1],"json":{"objName":"Zebra","sounds":[{"soundName":"horse gallop","soundID":-1,"md5":"058a34b5fb8b57178b5322d994b6b8c8.wav","sampleCount":38336,"rate":11025,"format":""}],"costumes":[{"costumeName":"zebra-a","baseLayerID":-1,"baseLayerMD5":"f58632e6b34fa8f9b35219e52ed2c864.svg","bitmapResolution":1,"rotationCenterX":97,"rotationCenterY":56},{"costumeName":"zebra-b","baseLayerID":-1,"baseLayerMD5":"ea23797598a55938a2d46f2b0a389fd6.svg","bitmapResolution":1,"rotationCenterX":96,"rotationCenterY":56}],"currentCostumeIndex":0,"scratchX":122,"scratchY":11,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Block-A","md5":"602a16930a8050e1298e1a0ae844363e.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Block-A","sounds":[{"soundName":"meow","soundID":-1,"md5":"83c36d806dc92327b9e7049a565c6bff.wav","sampleCount":18688,"rate":22050,"format":""}],"costumes":[{"costumeName":"Block-a","baseLayerID":-1,"baseLayerMD5":"602a16930a8050e1298e1a0ae844363e.svg","bitmapResolution":1,"rotationCenterX":28,"rotationCenterY":38}],"currentCostumeIndex":0,"scratchX":36,"scratchY":-31,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Block-B","md5":"f8c683cf71660e8ac1f8855599857a25.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Block-B","sounds":[{"soundName":"meow","soundID":-1,"md5":"83c36d806dc92327b9e7049a565c6bff.wav","sampleCount":18688,"rate":22050,"format":""}],"costumes":[{"costumeName":"Block-b","baseLayerID":-1,"baseLayerMD5":"f8c683cf71660e8ac1f8855599857a25.svg","bitmapResolution":1,"rotationCenterX":29,"rotationCenterY":42}],"currentCostumeIndex":0,"scratchX":-24,"scratchY":-45,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Block-C","md5":"f8f4cc686ffc5a4113a99f70b09abd32.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Block-C","sounds":[{"soundName":"meow","soundID":-1,"md5":"83c36d806dc92327b9e7049a565c6bff.wav","sampleCount":18688,"rate":22050,"format":""}],"costumes":[{"costumeName":"Block-c","baseLayerID":-1,"baseLayerMD5":"f8f4cc686ffc5a4113a99f70b09abd32.svg","bitmapResolution":1,"rotationCenterX":35,"rotationCenterY":43}],"currentCostumeIndex":0,"scratchX":42,"scratchY":22,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Block-D","md5":"aee2d71ef0293b33479bff9423d16b67.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Block-D","sounds":[{"soundName":"meow","soundID":-1,"md5":"83c36d806dc92327b9e7049a565c6bff.wav","sampleCount":18688,"rate":22050,"format":""}],"costumes":[{"costumeName":"Block-d","baseLayerID":-1,"baseLayerMD5":"aee2d71ef0293b33479bff9423d16b67.svg","bitmapResolution":1,"rotationCenterX":31,"rotationCenterY":41}],"currentCostumeIndex":0,"scratchX":30,"scratchY":-39,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Block-E","md5":"16c6257316ff94cc7539ccdfc24e5fb8.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Block-E","sounds":[{"soundName":"meow","soundID":-1,"md5":"83c36d806dc92327b9e7049a565c6bff.wav","sampleCount":18688,"rate":22050,"format":""}],"costumes":[{"costumeName":"Block-e","baseLayerID":-1,"baseLayerMD5":"16c6257316ff94cc7539ccdfc24e5fb8.svg","bitmapResolution":1,"rotationCenterX":25,"rotationCenterY":39}],"currentCostumeIndex":0,"scratchX":-87,"scratchY":-22,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Block-F","md5":"34c090c1f573c569332ead68cb99b595.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Block-F","sounds":[{"soundName":"meow","soundID":-1,"md5":"83c36d806dc92327b9e7049a565c6bff.wav","sampleCount":18688,"rate":22050,"format":""}],"costumes":[{"costumeName":"Block-f","baseLayerID":-1,"baseLayerMD5":"34c090c1f573c569332ead68cb99b595.svg","bitmapResolution":1,"rotationCenterX":23,"rotationCenterY":40}],"currentCostumeIndex":0,"scratchX":-80,"scratchY":21,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Block-G","md5":"8bb2382627004eb08ff10ea8171cc724.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Block-G","sounds":[{"soundName":"meow","soundID":-1,"md5":"83c36d806dc92327b9e7049a565c6bff.wav","sampleCount":18688,"rate":22050,"format":""}],"costumes":[{"costumeName":"Block-g","baseLayerID":-1,"baseLayerMD5":"8bb2382627004eb08ff10ea8171cc724.svg","bitmapResolution":1,"rotationCenterX":28,"rotationCenterY":39}],"currentCostumeIndex":0,"scratchX":3,"scratchY":33,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Block-H","md5":"f1578807d4a124fc02b639a8febeaab3.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Block-H","sounds":[{"soundName":"meow","soundID":-1,"md5":"83c36d806dc92327b9e7049a565c6bff.wav","sampleCount":18688,"rate":22050,"format":""}],"costumes":[{"costumeName":"Block-h","baseLayerID":-1,"baseLayerMD5":"f1578807d4a124fc02b639a8febeaab3.svg","bitmapResolution":1,"rotationCenterX":27,"rotationCenterY":38}],"currentCostumeIndex":0,"scratchX":96,"scratchY":42,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Block-I","md5":"341bc70442886d6fdf959f2a97a63554.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Block-I","sounds":[{"soundName":"meow","soundID":-1,"md5":"83c36d806dc92327b9e7049a565c6bff.wav","sampleCount":18688,"rate":22050,"format":""}],"costumes":[{"costumeName":"Block-i","baseLayerID":-1,"baseLayerMD5":"341bc70442886d6fdf959f2a97a63554.svg","bitmapResolution":1,"rotationCenterX":19,"rotationCenterY":39}],"currentCostumeIndex":0,"scratchX":23,"scratchY":25,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Block-J","md5":"4b420cce964beedf2c1dc43faa59fdec.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Block-J","sounds":[{"soundName":"meow","soundID":-1,"md5":"83c36d806dc92327b9e7049a565c6bff.wav","sampleCount":18688,"rate":22050,"format":""}],"costumes":[{"costumeName":"Block-j","baseLayerID":-1,"baseLayerMD5":"4b420cce964beedf2c1dc43faa59fdec.svg","bitmapResolution":1,"rotationCenterX":25,"rotationCenterY":41}],"currentCostumeIndex":0,"scratchX":-26,"scratchY":39,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Block-K","md5":"19601cc33449813aa93a47c63167e5c1.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Block-K","sounds":[{"soundName":"meow","soundID":-1,"md5":"83c36d806dc92327b9e7049a565c6bff.wav","sampleCount":18688,"rate":22050,"format":""}],"costumes":[{"costumeName":"Block-k","baseLayerID":-1,"baseLayerMD5":"19601cc33449813aa93a47c63167e5c1.svg","bitmapResolution":1,"rotationCenterX":24,"rotationCenterY":40}],"currentCostumeIndex":0,"scratchX":-10,"scratchY":-31,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Block-L","md5":"87358e3c9b9f5be4376253ce08d0192d.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Block-L","sounds":[{"soundName":"meow","soundID":-1,"md5":"83c36d806dc92327b9e7049a565c6bff.wav","sampleCount":18688,"rate":22050,"format":""}],"costumes":[{"costumeName":"Block-l","baseLayerID":-1,"baseLayerMD5":"87358e3c9b9f5be4376253ce08d0192d.svg","bitmapResolution":1,"rotationCenterX":26,"rotationCenterY":40}],"currentCostumeIndex":0,"scratchX":-40,"scratchY":-33,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Block-M","md5":"7ba0642be1f0080c0d273ea96e29b1e8.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Block-M","sounds":[{"soundName":"meow","soundID":-1,"md5":"83c36d806dc92327b9e7049a565c6bff.wav","sampleCount":18688,"rate":22050,"format":""}],"costumes":[{"costumeName":"Block-m","baseLayerID":-1,"baseLayerMD5":"7ba0642be1f0080c0d273ea96e29b1e8.svg","bitmapResolution":1,"rotationCenterX":35,"rotationCenterY":37}],"currentCostumeIndex":0,"scratchX":-80,"scratchY":10,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Block-N","md5":"6c1fbc57821744bd9356ce9a21ed70f7.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Block-N","sounds":[{"soundName":"meow","soundID":-1,"md5":"83c36d806dc92327b9e7049a565c6bff.wav","sampleCount":18688,"rate":22050,"format":""}],"costumes":[{"costumeName":"Block-n","baseLayerID":-1,"baseLayerMD5":"6c1fbc57821744bd9356ce9a21ed70f7.svg","bitmapResolution":1,"rotationCenterX":28,"rotationCenterY":37}],"currentCostumeIndex":0,"scratchX":66,"scratchY":0,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Block-O","md5":"e88638200a73e167d0e266a343019cec.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Block-O","sounds":[{"soundName":"meow","soundID":-1,"md5":"83c36d806dc92327b9e7049a565c6bff.wav","sampleCount":18688,"rate":22050,"format":""}],"costumes":[{"costumeName":"Block-o","baseLayerID":-1,"baseLayerMD5":"e88638200a73e167d0e266a343019cec.svg","bitmapResolution":1,"rotationCenterX":32,"rotationCenterY":40}],"currentCostumeIndex":0,"scratchX":-82,"scratchY":-14,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Block-P","md5":"ad2fc3a1c6538678915633a11ab6ec73.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Block-P","sounds":[{"soundName":"meow","soundID":-1,"md5":"83c36d806dc92327b9e7049a565c6bff.wav","sampleCount":18688,"rate":22050,"format":""}],"costumes":[{"costumeName":"Block-p","baseLayerID":-1,"baseLayerMD5":"ad2fc3a1c6538678915633a11ab6ec73.svg","bitmapResolution":1,"rotationCenterX":18,"rotationCenterY":33}],"currentCostumeIndex":0,"scratchX":53,"scratchY":43,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Block-Q","md5":"64da9da8684c74deb567dbdb661d3a52.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Block-Q","sounds":[{"soundName":"meow","soundID":-1,"md5":"83c36d806dc92327b9e7049a565c6bff.wav","sampleCount":18688,"rate":22050,"format":""}],"costumes":[{"costumeName":"Block-q","baseLayerID":-1,"baseLayerMD5":"64da9da8684c74deb567dbdb661d3a52.svg","bitmapResolution":1,"rotationCenterX":26,"rotationCenterY":33}],"currentCostumeIndex":0,"scratchX":52,"scratchY":47,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Block-R","md5":"73e8d46f7475476d8cb4cfcfc75ee50d.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Block-R","sounds":[{"soundName":"meow","soundID":-1,"md5":"83c36d806dc92327b9e7049a565c6bff.wav","sampleCount":18688,"rate":22050,"format":""}],"costumes":[{"costumeName":"Block-r","baseLayerID":-1,"baseLayerMD5":"73e8d46f7475476d8cb4cfcfc75ee50d.svg","bitmapResolution":1,"rotationCenterX":22,"rotationCenterY":33}],"currentCostumeIndex":0,"scratchX":-88,"scratchY":14,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Block-S","md5":"9feb5593fed51e88dbb3128cfc290d29.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Block-S","sounds":[{"soundName":"meow","soundID":-1,"md5":"83c36d806dc92327b9e7049a565c6bff.wav","sampleCount":18688,"rate":22050,"format":""}],"costumes":[{"costumeName":"Block-s","baseLayerID":-1,"baseLayerMD5":"9feb5593fed51e88dbb3128cfc290d29.svg","bitmapResolution":1,"rotationCenterX":13,"rotationCenterY":30}],"currentCostumeIndex":0,"scratchX":-74,"scratchY":-29,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Block-T","md5":"d29c1caf5cf195740c38f279e82a77a4.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Block-T","sounds":[{"soundName":"meow","soundID":-1,"md5":"83c36d806dc92327b9e7049a565c6bff.wav","sampleCount":18688,"rate":22050,"format":""}],"costumes":[{"costumeName":"Block-t","baseLayerID":-1,"baseLayerMD5":"d29c1caf5cf195740c38f279e82a77a4.svg","bitmapResolution":1,"rotationCenterX":25,"rotationCenterY":33}],"currentCostumeIndex":0,"scratchX":41,"scratchY":26,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Block-U","md5":"faef46b7bf589c36300142f6f03c5d32.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Block-U","sounds":[{"soundName":"meow","soundID":-1,"md5":"83c36d806dc92327b9e7049a565c6bff.wav","sampleCount":18688,"rate":22050,"format":""}],"costumes":[{"costumeName":"Block-u","baseLayerID":-1,"baseLayerMD5":"faef46b7bf589c36300142f6f03c5d32.svg","bitmapResolution":1,"rotationCenterX":28,"rotationCenterY":41}],"currentCostumeIndex":0,"scratchX":52,"scratchY":-28,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Block-V","md5":"65e2f4821ab084827e22920acb61c92b.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Block-V","sounds":[{"soundName":"meow","soundID":-1,"md5":"83c36d806dc92327b9e7049a565c6bff.wav","sampleCount":18688,"rate":22050,"format":""}],"costumes":[{"costumeName":"Block-v","baseLayerID":-1,"baseLayerMD5":"65e2f4821ab084827e22920acb61c92b.svg","bitmapResolution":1,"rotationCenterX":35,"rotationCenterY":41}],"currentCostumeIndex":0,"scratchX":73,"scratchY":-32,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Block-W","md5":"5ab197b4f70b2f98a3658c7ccdc3351d.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Block-W","sounds":[{"soundName":"meow","soundID":-1,"md5":"83c36d806dc92327b9e7049a565c6bff.wav","sampleCount":18688,"rate":22050,"format":""}],"costumes":[{"costumeName":"Block-w","baseLayerID":-1,"baseLayerMD5":"5ab197b4f70b2f98a3658c7ccdc3351d.svg","bitmapResolution":1,"rotationCenterX":47,"rotationCenterY":39}],"currentCostumeIndex":0,"scratchX":1,"scratchY":-49,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Block-X","md5":"cb9dff35f05e823d954e47e4a717a48c.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Block-X","sounds":[{"soundName":"meow","soundID":-1,"md5":"83c36d806dc92327b9e7049a565c6bff.wav","sampleCount":18688,"rate":22050,"format":""}],"costumes":[{"costumeName":"Block-x","baseLayerID":-1,"baseLayerMD5":"cb9dff35f05e823d954e47e4a717a48c.svg","bitmapResolution":1,"rotationCenterX":25,"rotationCenterY":32}],"currentCostumeIndex":0,"scratchX":61,"scratchY":-35,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Block-Y","md5":"4c13c440bcb35c8c3aa6226374fced3f.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Block-Y","sounds":[{"soundName":"meow","soundID":-1,"md5":"83c36d806dc92327b9e7049a565c6bff.wav","sampleCount":18688,"rate":22050,"format":""}],"costumes":[{"costumeName":"Block-y","baseLayerID":-1,"baseLayerMD5":"4c13c440bcb35c8c3aa6226374fced3f.svg","bitmapResolution":1,"rotationCenterX":26,"rotationCenterY":33}],"currentCostumeIndex":0,"scratchX":53,"scratchY":-12,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Block-Z","md5":"0ccff1898f1bf1b25333d581db09fae2.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Block-Z","sounds":[{"soundName":"meow","soundID":-1,"md5":"83c36d806dc92327b9e7049a565c6bff.wav","sampleCount":18688,"rate":22050,"format":""}],"costumes":[{"costumeName":"Block-z","baseLayerID":-1,"baseLayerMD5":"0ccff1898f1bf1b25333d581db09fae2.svg","bitmapResolution":1,"rotationCenterX":24,"rotationCenterY":38}],"currentCostumeIndex":0,"scratchX":-33,"scratchY":-20,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-0","md5":"38b2b342659adc6fa289090975e0e71d.svg","type":"sprite","tags":["numbers","digits"],"info":[0,1,1],"json":{"objName":"Glow-0","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-0","baseLayerID":-1,"baseLayerMD5":"38b2b342659adc6fa289090975e0e71d.svg","bitmapResolution":1,"rotationCenterX":29,"rotationCenterY":39}],"currentCostumeIndex":0,"scratchX":-31,"scratchY":-37,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-1","md5":"2c88706210672655401fe09edd8ff6a7.svg","type":"sprite","tags":["numbers","digits"],"info":[0,1,1],"json":{"objName":"Glow-1","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-1","baseLayerID":-1,"baseLayerMD5":"2c88706210672655401fe09edd8ff6a7.svg","bitmapResolution":1,"rotationCenterX":24,"rotationCenterY":39}],"currentCostumeIndex":0,"scratchX":95,"scratchY":-19,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-2","md5":"b9faa5708a799a1607f0325a7af2561c.svg","type":"sprite","tags":["numbers","digits"],"info":[0,1,1],"json":{"objName":"Glow-2","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-2","baseLayerID":-1,"baseLayerMD5":"b9faa5708a799a1607f0325a7af2561c.svg","bitmapResolution":1,"rotationCenterX":28,"rotationCenterY":41}],"currentCostumeIndex":0,"scratchX":-44,"scratchY":-10,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-3","md5":"cf42a50552ce26032ead712ac4f36c23.svg","type":"sprite","tags":["numbers","digits"],"info":[0,1,1],"json":{"objName":"Glow-3","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-3","baseLayerID":-1,"baseLayerMD5":"cf42a50552ce26032ead712ac4f36c23.svg","bitmapResolution":1,"rotationCenterX":33,"rotationCenterY":42}],"currentCostumeIndex":0,"scratchX":48,"scratchY":7,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-4","md5":"3ffa6aee373e28fc36b9395ac4d0467e.svg","type":"sprite","tags":["numbers","digits"],"info":[0,1,1],"json":{"objName":"Glow-4","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-4","baseLayerID":-1,"baseLayerMD5":"3ffa6aee373e28fc36b9395ac4d0467e.svg","bitmapResolution":1,"rotationCenterX":31,"rotationCenterY":38}],"currentCostumeIndex":0,"scratchX":50,"scratchY":-12,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-5","md5":"85d87d32e7e9e6be122c905b0d2e7e33.svg","type":"sprite","tags":["numbers","digits"],"info":[0,1,1],"json":{"objName":"Glow-5","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-5","baseLayerID":-1,"baseLayerMD5":"85d87d32e7e9e6be122c905b0d2e7e33.svg","bitmapResolution":1,"rotationCenterX":30,"rotationCenterY":38}],"currentCostumeIndex":0,"scratchX":-88,"scratchY":-37,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-6","md5":"62cc2a6def27f19d11ed56e86e95aac5.svg","type":"sprite","tags":["numbers","digits"],"info":[0,1,1],"json":{"objName":"Glow-6","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-6","baseLayerID":-1,"baseLayerMD5":"62cc2a6def27f19d11ed56e86e95aac5.svg","bitmapResolution":1,"rotationCenterX":30,"rotationCenterY":37}],"currentCostumeIndex":0,"scratchX":35,"scratchY":31,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-7","md5":"8887983eb4df2e62a2ed4770a1d98d60.svg","type":"sprite","tags":["numbers","digits"],"info":[0,1,1],"json":{"objName":"Glow-7","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-7","baseLayerID":-1,"baseLayerMD5":"8887983eb4df2e62a2ed4770a1d98d60.svg","bitmapResolution":1,"rotationCenterX":31,"rotationCenterY":42}],"currentCostumeIndex":0,"scratchX":30,"scratchY":5,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-8","md5":"4c42c4cb0c1e090d0f9570416d3c80c8.svg","type":"sprite","tags":["numbers","digits"],"info":[0,1,1],"json":{"objName":"Glow-8","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-8","baseLayerID":-1,"baseLayerMD5":"4c42c4cb0c1e090d0f9570416d3c80c8.svg","bitmapResolution":1,"rotationCenterX":31,"rotationCenterY":37}],"currentCostumeIndex":0,"scratchX":-39,"scratchY":-8,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-9","md5":"7bcb7e2e48f5cb770c83d4267922fec0.svg","type":"sprite","tags":["numbers","digits"],"info":[0,1,1],"json":{"objName":"Glow-9","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-9","baseLayerID":-1,"baseLayerMD5":"7bcb7e2e48f5cb770c83d4267922fec0.svg","bitmapResolution":1,"rotationCenterX":28,"rotationCenterY":36}],"currentCostumeIndex":0,"scratchX":87,"scratchY":36,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-A","md5":"d5aa299350c24c747200a64b63b1aa52.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Glow-A","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-A","baseLayerID":-1,"baseLayerMD5":"d5aa299350c24c747200a64b63b1aa52.svg","bitmapResolution":1,"rotationCenterX":36,"rotationCenterY":37}],"currentCostumeIndex":0,"scratchX":48,"scratchY":-44,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-B","md5":"a2e95f268a6cab03f3e94b3b0b792d83.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Glow-B","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-B","baseLayerID":-1,"baseLayerMD5":"a2e95f268a6cab03f3e94b3b0b792d83.svg","bitmapResolution":1,"rotationCenterX":32,"rotationCenterY":35}],"currentCostumeIndex":0,"scratchX":-85,"scratchY":45,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-C","md5":"9779a4a40934f04a4bf84920b258d7c9.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Glow-C","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-C","baseLayerID":-1,"baseLayerMD5":"9779a4a40934f04a4bf84920b258d7c9.svg","bitmapResolution":1,"rotationCenterX":27,"rotationCenterY":35}],"currentCostumeIndex":0,"scratchX":-98,"scratchY":35,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-D","md5":"3555b8bbbbcdc00354bf6fa81ac7042f.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Glow-D","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-D","baseLayerID":-1,"baseLayerMD5":"3555b8bbbbcdc00354bf6fa81ac7042f.svg","bitmapResolution":1,"rotationCenterX":33,"rotationCenterY":35}],"currentCostumeIndex":0,"scratchX":25,"scratchY":-13,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-E","md5":"44dbc655d5ac9f13618473848e23484e.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Glow-E","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-E","baseLayerID":-1,"baseLayerMD5":"44dbc655d5ac9f13618473848e23484e.svg","bitmapResolution":1,"rotationCenterX":34,"rotationCenterY":38}],"currentCostumeIndex":0,"scratchX":-5,"scratchY":-19,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-F","md5":"dec417e749e43d7de3985155f5f5a7a0.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Glow-F","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-F","baseLayerID":-1,"baseLayerMD5":"dec417e749e43d7de3985155f5f5a7a0.svg","bitmapResolution":1,"rotationCenterX":35,"rotationCenterY":41}],"currentCostumeIndex":0,"scratchX":-89,"scratchY":-22,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-G","md5":"cf4aa465cd8fb7049cc571d7546a7eb1.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Glow-G","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-G","baseLayerID":-1,"baseLayerMD5":"cf4aa465cd8fb7049cc571d7546a7eb1.svg","bitmapResolution":1,"rotationCenterX":32,"rotationCenterY":39}],"currentCostumeIndex":0,"scratchX":28,"scratchY":16,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-H","md5":"8d9bd5f00ea1ac6f92d0f97ee491b0f3.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Glow-H","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-H","baseLayerID":-1,"baseLayerMD5":"8d9bd5f00ea1ac6f92d0f97ee491b0f3.svg","bitmapResolution":1,"rotationCenterX":35,"rotationCenterY":46}],"currentCostumeIndex":0,"scratchX":91,"scratchY":-38,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-I","md5":"0e86de55840103dcd50199ab2b765de7.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Glow-I","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-I","baseLayerID":-1,"baseLayerMD5":"0e86de55840103dcd50199ab2b765de7.svg","bitmapResolution":1,"rotationCenterX":21,"rotationCenterY":38}],"currentCostumeIndex":0,"scratchX":-38,"scratchY":-29,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-J","md5":"b3832145eacc39f91bd3a9a6673fa05c.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Glow-J","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-J","baseLayerID":-1,"baseLayerMD5":"b3832145eacc39f91bd3a9a6673fa05c.svg","bitmapResolution":1,"rotationCenterX":29,"rotationCenterY":39}],"currentCostumeIndex":0,"scratchX":-34,"scratchY":1,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-K","md5":"f4e37a7552ba05e995613211a7146de5.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Glow-K","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-K","baseLayerID":-1,"baseLayerMD5":"f4e37a7552ba05e995613211a7146de5.svg","bitmapResolution":1,"rotationCenterX":38,"rotationCenterY":36}],"currentCostumeIndex":0,"scratchX":-41,"scratchY":30,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-L","md5":"a75e45773ea6afaf8ae44f79f936fc82.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Glow-L","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-L","baseLayerID":-1,"baseLayerMD5":"a75e45773ea6afaf8ae44f79f936fc82.svg","bitmapResolution":1,"rotationCenterX":33,"rotationCenterY":35}],"currentCostumeIndex":0,"scratchX":54,"scratchY":-21,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-M","md5":"219b06faa5b816347165450d148213b4.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Glow-M","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-M","baseLayerID":-1,"baseLayerMD5":"219b06faa5b816347165450d148213b4.svg","bitmapResolution":1,"rotationCenterX":42,"rotationCenterY":39}],"currentCostumeIndex":0,"scratchX":-43,"scratchY":-15,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-N","md5":"4b724479fb3b2184fd8be6f83fb20e54.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Glow-N","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-N","baseLayerID":-1,"baseLayerMD5":"4b724479fb3b2184fd8be6f83fb20e54.svg","bitmapResolution":1,"rotationCenterX":37,"rotationCenterY":39}],"currentCostumeIndex":0,"scratchX":-23,"scratchY":-33,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-O","md5":"38b2b342659adc6fa289090975e0e71d.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Glow-O","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-O","baseLayerID":-1,"baseLayerMD5":"38b2b342659adc6fa289090975e0e71d.svg","bitmapResolution":1,"rotationCenterX":29,"rotationCenterY":39}],"currentCostumeIndex":0,"scratchX":-40,"scratchY":26,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-P","md5":"1cfa849cc967069730b7e9d0809c9dc1.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Glow-P","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-P","baseLayerID":-1,"baseLayerMD5":"1cfa849cc967069730b7e9d0809c9dc1.svg","bitmapResolution":1,"rotationCenterX":32,"rotationCenterY":39}],"currentCostumeIndex":0,"scratchX":-10,"scratchY":-9,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-Q","md5":"9d35979e9404ac234301269fcd7de288.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Glow-Q","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-Q","baseLayerID":-1,"baseLayerMD5":"9d35979e9404ac234301269fcd7de288.svg","bitmapResolution":1,"rotationCenterX":33,"rotationCenterY":43}],"currentCostumeIndex":0,"scratchX":-85,"scratchY":-1,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-R","md5":"fc067ee076ecaba8430ccd54d9414c1b.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Glow-R","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-R","baseLayerID":-1,"baseLayerMD5":"fc067ee076ecaba8430ccd54d9414c1b.svg","bitmapResolution":1,"rotationCenterX":35,"rotationCenterY":38}],"currentCostumeIndex":0,"scratchX":26,"scratchY":37,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-S","md5":"19a93db8a294ccaec4d6eef4020a446f.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Glow-S","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-S","baseLayerID":-1,"baseLayerMD5":"19a93db8a294ccaec4d6eef4020a446f.svg","bitmapResolution":1,"rotationCenterX":27,"rotationCenterY":40}],"currentCostumeIndex":0,"scratchX":-94,"scratchY":-36,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-T","md5":"d7bcda522a1e9504dafcf2fa0fcde39b.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Glow-T","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-T","baseLayerID":-1,"baseLayerMD5":"d7bcda522a1e9504dafcf2fa0fcde39b.svg","bitmapResolution":1,"rotationCenterX":35,"rotationCenterY":38}],"currentCostumeIndex":0,"scratchX":37,"scratchY":-20,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-U","md5":"790482a3c3691a1e96ef34eee7303872.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Glow-U","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-U","baseLayerID":-1,"baseLayerMD5":"790482a3c3691a1e96ef34eee7303872.svg","bitmapResolution":1,"rotationCenterX":37,"rotationCenterY":37}],"currentCostumeIndex":0,"scratchX":17,"scratchY":31,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-V","md5":"6a00388d8dc6be645b843cef9c22681c.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Glow-V","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-V","baseLayerID":-1,"baseLayerMD5":"6a00388d8dc6be645b843cef9c22681c.svg","bitmapResolution":1,"rotationCenterX":35,"rotationCenterY":42}],"currentCostumeIndex":0,"scratchX":82,"scratchY":26,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-W","md5":"1a9ea7305a85b271c1de79beafe16cb4.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Glow-W","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-W","baseLayerID":-1,"baseLayerMD5":"1a9ea7305a85b271c1de79beafe16cb4.svg","bitmapResolution":1,"rotationCenterX":45,"rotationCenterY":41}],"currentCostumeIndex":0,"scratchX":-18,"scratchY":11,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-X","md5":"ec4e65b9ae475a676973128f4205df5f.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Glow-X","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-X","baseLayerID":-1,"baseLayerMD5":"ec4e65b9ae475a676973128f4205df5f.svg","bitmapResolution":1,"rotationCenterX":40,"rotationCenterY":39}],"currentCostumeIndex":0,"scratchX":-84,"scratchY":46,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-Y","md5":"683cd093bb3b254733a15df6f843464c.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Glow-Y","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-Y","baseLayerID":-1,"baseLayerMD5":"683cd093bb3b254733a15df6f843464c.svg","bitmapResolution":1,"rotationCenterX":38,"rotationCenterY":41}],"currentCostumeIndex":0,"scratchX":-34,"scratchY":46,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Glow-Z","md5":"db89a4c9b123123542e0b7556ed3ff9f.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,1,1],"json":{"objName":"Glow-Z","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"Glow-Z","baseLayerID":-1,"baseLayerMD5":"db89a4c9b123123542e0b7556ed3ff9f.svg","bitmapResolution":1,"rotationCenterX":30,"rotationCenterY":39}],"currentCostumeIndex":0,"scratchX":87,"scratchY":15,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Story-A","md5":"5406b37278d819d4787a588b9c91f68e.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,3,1],"json":{"objName":"Story-A","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"story-A-1","baseLayerID":-1,"baseLayerMD5":"5406b37278d819d4787a588b9c91f68e.svg","bitmapResolution":1,"rotationCenterX":23,"rotationCenterY":26},{"costumeName":"story-A-2","baseLayerID":-1,"baseLayerMD5":"f277943adf8d79b41b9b568321a786ee.svg","bitmapResolution":1,"rotationCenterX":23,"rotationCenterY":26},{"costumeName":"story-A-3","baseLayerID":-1,"baseLayerMD5":"cc0cc7ae3240eab7d040e148cc663325.svg","bitmapResolution":1,"rotationCenterX":22,"rotationCenterY":24}],"currentCostumeIndex":0,"scratchX":-76,"scratchY":32,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Story-B","md5":"2a8fac3c82d95f13203843a597b5757b.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,3,1],"json":{"objName":"Story-B","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"story-B-1","baseLayerID":-1,"baseLayerMD5":"2a8fac3c82d95f13203843a597b5757b.svg","bitmapResolution":1,"rotationCenterX":20,"rotationCenterY":25},{"costumeName":"story-B-2","baseLayerID":-1,"baseLayerMD5":"07fa4ebc421d84743b6ced189dd2f9cf.svg","bitmapResolution":1,"rotationCenterX":19,"rotationCenterY":25},{"costumeName":"story-B-3","baseLayerID":-1,"baseLayerMD5":"6c9a9203155f93f24f31b30e3bd76b6d.svg","bitmapResolution":1,"rotationCenterX":18,"rotationCenterY":23}],"currentCostumeIndex":0,"scratchX":-12,"scratchY":-43,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Story-C","md5":"144845715016910e88e2a223ed4d3df1.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,3,1],"json":{"objName":"Story-C","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"story-C-1","baseLayerID":-1,"baseLayerMD5":"144845715016910e88e2a223ed4d3df1.svg","bitmapResolution":1,"rotationCenterX":22,"rotationCenterY":26},{"costumeName":"story-C-2","baseLayerID":-1,"baseLayerMD5":"1045c56c4be3d8d0650579864417fbc7.svg","bitmapResolution":1,"rotationCenterX":22,"rotationCenterY":26},{"costumeName":"story-C-3","baseLayerID":-1,"baseLayerMD5":"c8fd35294d17a369fecb6d6e4725d04a.svg","bitmapResolution":1,"rotationCenterX":20,"rotationCenterY":24}],"currentCostumeIndex":0,"scratchX":73,"scratchY":-19,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Story-D","md5":"dfd362f2da975c20aa7849a8fa2fb4df.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,3,1],"json":{"objName":"Story-D","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"story-D-1","baseLayerID":-1,"baseLayerMD5":"dfd362f2da975c20aa7849a8fa2fb4df.svg","bitmapResolution":1,"rotationCenterX":25,"rotationCenterY":26},{"costumeName":"story-D-2","baseLayerID":-1,"baseLayerMD5":"3e4cc4cff08bb42bc690eff66dffbbe9.svg","bitmapResolution":1,"rotationCenterX":25,"rotationCenterY":26},{"costumeName":"story-D-3","baseLayerID":-1,"baseLayerMD5":"bd7f984fe82d9d0fdcff0a87b3c0f9e0.svg","bitmapResolution":1,"rotationCenterX":22,"rotationCenterY":23}],"currentCostumeIndex":0,"scratchX":-30,"scratchY":-3,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Story-E","md5":"56473bacbdf6f0dbca1afb04e5aebaf7.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,3,1],"json":{"objName":"Story-E","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"story-E-1","baseLayerID":-1,"baseLayerMD5":"56473bacbdf6f0dbca1afb04e5aebaf7.svg","bitmapResolution":1,"rotationCenterX":20,"rotationCenterY":25},{"costumeName":"story-E-2","baseLayerID":-1,"baseLayerMD5":"8bba14966fe35f0dccb66ef06a9843ca.svg","bitmapResolution":1,"rotationCenterX":20,"rotationCenterY":25},{"costumeName":"story-E-3","baseLayerID":-1,"baseLayerMD5":"e8cfc63375f6d6c2a580823489427f38.svg","bitmapResolution":1,"rotationCenterX":18,"rotationCenterY":23}],"currentCostumeIndex":0,"scratchX":-12,"scratchY":5,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Story-F","md5":"5844ff29fc8663c8613f12169d2f07ef.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,3,1],"json":{"objName":"Story-F","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"story-F-1","baseLayerID":-1,"baseLayerMD5":"5844ff29fc8663c8613f12169d2f07ef.svg","bitmapResolution":1,"rotationCenterX":18,"rotationCenterY":26},{"costumeName":"story-F-2","baseLayerID":-1,"baseLayerMD5":"0dbe4a064abea1a9a3bc0d2732643e6b.svg","bitmapResolution":1,"rotationCenterX":18,"rotationCenterY":25},{"costumeName":"story-F-3","baseLayerID":-1,"baseLayerMD5":"3db373f4482e391e66d1b06335a96144.svg","bitmapResolution":1,"rotationCenterX":16,"rotationCenterY":23}],"currentCostumeIndex":0,"scratchX":85,"scratchY":-20,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Story-G","md5":"ee6454d15fbbe93e908a2ebbfad483a0.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,3,1],"json":{"objName":"Story-G","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"story-G-1","baseLayerID":-1,"baseLayerMD5":"ee6454d15fbbe93e908a2ebbfad483a0.svg","bitmapResolution":1,"rotationCenterX":23,"rotationCenterY":25},{"costumeName":"story-G-2","baseLayerID":-1,"baseLayerMD5":"991023d303f79ce092f070392ffbd69f.svg","bitmapResolution":1,"rotationCenterX":23,"rotationCenterY":25},{"costumeName":"story-G-3","baseLayerID":-1,"baseLayerMD5":"38f22c0d8dbe541bde409ba1f241d4c1.svg","bitmapResolution":1,"rotationCenterX":21,"rotationCenterY":24}],"currentCostumeIndex":0,"scratchX":3,"scratchY":9,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Story-H","md5":"2a0e1308d6cb806818af696a89b21863.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,3,1],"json":{"objName":"Story-H","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"story-H-1","baseLayerID":-1,"baseLayerMD5":"2a0e1308d6cb806818af696a89b21863.svg","bitmapResolution":1,"rotationCenterX":24,"rotationCenterY":25},{"costumeName":"story-H-2","baseLayerID":-1,"baseLayerMD5":"ca33be5270308a695c9b88af73f590dc.svg","bitmapResolution":1,"rotationCenterX":24,"rotationCenterY":25},{"costumeName":"story-H-3","baseLayerID":-1,"baseLayerMD5":"668ba2b891f82ce78d8590f0287632b1.svg","bitmapResolution":1,"rotationCenterX":22,"rotationCenterY":24}],"currentCostumeIndex":0,"scratchX":72,"scratchY":3,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Story-I","md5":"705297637ea83af5b94b6fe2e34aeef4.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,3,1],"json":{"objName":"Story-I","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"story-I-1","baseLayerID":-1,"baseLayerMD5":"705297637ea83af5b94b6fe2e34aeef4.svg","bitmapResolution":1,"rotationCenterX":9,"rotationCenterY":26},{"costumeName":"story-I-2","baseLayerID":-1,"baseLayerMD5":"7b3ae96764795727fa1cb0be68a9ca5e.svg","bitmapResolution":1,"rotationCenterX":9,"rotationCenterY":26},{"costumeName":"story-I-3","baseLayerID":-1,"baseLayerMD5":"3475aa570304accb7e6dbd2516234135.svg","bitmapResolution":1,"rotationCenterX":7,"rotationCenterY":23}],"currentCostumeIndex":0,"scratchX":-50,"scratchY":-33,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Story-J","md5":"ac2e7eaecb80c5501e5e56802d03af00.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,3,1],"json":{"objName":"Story-J","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"story-J-1","baseLayerID":-1,"baseLayerMD5":"ac2e7eaecb80c5501e5e56802d03af00.svg","bitmapResolution":1,"rotationCenterX":14,"rotationCenterY":25},{"costumeName":"story-J-2","baseLayerID":-1,"baseLayerMD5":"0ab9a94fc2e32160efc113a8e5ffb984.svg","bitmapResolution":1,"rotationCenterX":14,"rotationCenterY":25},{"costumeName":"story-J-3","baseLayerID":-1,"baseLayerMD5":"c9356a022cfbc25be6c484e9781e4637.svg","bitmapResolution":1,"rotationCenterX":12,"rotationCenterY":24}],"currentCostumeIndex":0,"scratchX":57,"scratchY":46,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Story-K","md5":"62dcc92dc3c6cb0271244190320c4f71.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,3,1],"json":{"objName":"Story-K","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"story-K-1","baseLayerID":-1,"baseLayerMD5":"62dcc92dc3c6cb0271244190320c4f71.svg","bitmapResolution":1,"rotationCenterX":24,"rotationCenterY":26},{"costumeName":"story-K-2","baseLayerID":-1,"baseLayerMD5":"ef02339e8a0382367f0b5a414915b885.svg","bitmapResolution":1,"rotationCenterX":24,"rotationCenterY":26},{"costumeName":"story-K-3","baseLayerID":-1,"baseLayerMD5":"07977708617d12381b22d1ee0f4926a3.svg","bitmapResolution":1,"rotationCenterX":21,"rotationCenterY":24}],"currentCostumeIndex":0,"scratchX":-97,"scratchY":-1,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Story-L","md5":"7ce306e9c9c0dd0a24279606301f1d05.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,3,1],"json":{"objName":"Story-L","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"story-L-1","baseLayerID":-1,"baseLayerMD5":"7ce306e9c9c0dd0a24279606301f1d05.svg","bitmapResolution":1,"rotationCenterX":19,"rotationCenterY":26},{"costumeName":"story-L-2","baseLayerID":-1,"baseLayerMD5":"067c21a9b2f91ed33e07131ce5a59210.svg","bitmapResolution":1,"rotationCenterX":19,"rotationCenterY":26},{"costumeName":"story-L-3","baseLayerID":-1,"baseLayerMD5":"488d66f17c0089a7796d44cfc70792e8.svg","bitmapResolution":1,"rotationCenterX":17,"rotationCenterY":23}],"currentCostumeIndex":0,"scratchX":-55,"scratchY":-27,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Story-M","md5":"b27f166f9ab4a3fb93a50a77c58c3df3.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,3,1],"json":{"objName":"Story-M","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"story-M-1","baseLayerID":-1,"baseLayerMD5":"b27f166f9ab4a3fb93a50a77c58c3df3.svg","bitmapResolution":1,"rotationCenterX":30,"rotationCenterY":25},{"costumeName":"story-M-2","baseLayerID":-1,"baseLayerMD5":"55f00a23d0f5cc57be9533f126a7ac8c.svg","bitmapResolution":1,"rotationCenterX":30,"rotationCenterY":25},{"costumeName":"story-M-3","baseLayerID":-1,"baseLayerMD5":"613df2bd97784a239ab992f7a95458a0.svg","bitmapResolution":1,"rotationCenterX":27,"rotationCenterY":24}],"currentCostumeIndex":0,"scratchX":93,"scratchY":39,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Story-N","md5":"293589fd5bbc358a20c165ab49c19833.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,3,1],"json":{"objName":"Story-N","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"story-N-1","baseLayerID":-1,"baseLayerMD5":"293589fd5bbc358a20c165ab49c19833.svg","bitmapResolution":1,"rotationCenterX":26,"rotationCenterY":25},{"costumeName":"story-N-2","baseLayerID":-1,"baseLayerMD5":"5e07ee61cb20bc575720774584dfec53.svg","bitmapResolution":1,"rotationCenterX":26,"rotationCenterY":25},{"costumeName":"story-N-3","baseLayerID":-1,"baseLayerMD5":"435697335345f946d943c1d89fdb459a.svg","bitmapResolution":1,"rotationCenterX":24,"rotationCenterY":23}],"currentCostumeIndex":0,"scratchX":37,"scratchY":-32,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Story-O","md5":"088beed7ce0dff554da06f54d0558bc0.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,3,1],"json":{"objName":"Story-O","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"story-O-1","baseLayerID":-1,"baseLayerMD5":"088beed7ce0dff554da06f54d0558bc0.svg","bitmapResolution":1,"rotationCenterX":25,"rotationCenterY":25},{"costumeName":"story-O-2","baseLayerID":-1,"baseLayerMD5":"e8fa671bb1ca53c044bfb27225321c25.svg","bitmapResolution":1,"rotationCenterX":24,"rotationCenterY":25},{"costumeName":"story-O-3","baseLayerID":-1,"baseLayerMD5":"a132bf3d4084ef8ca9e0797f64c0f082.svg","bitmapResolution":1,"rotationCenterX":22,"rotationCenterY":24}],"currentCostumeIndex":0,"scratchX":98,"scratchY":3,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Story-P","md5":"ad4a101b83f28ced16849be3e393caa9.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,3,1],"json":{"objName":"Story-P","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"story-P-1","baseLayerID":-1,"baseLayerMD5":"ad4a101b83f28ced16849be3e393caa9.svg","bitmapResolution":1,"rotationCenterX":20,"rotationCenterY":25},{"costumeName":"story-P-2","baseLayerID":-1,"baseLayerMD5":"781c42f9da36bbc0ee3775f18ac98124.svg","bitmapResolution":1,"rotationCenterX":20,"rotationCenterY":25},{"costumeName":"story-P-3","baseLayerID":-1,"baseLayerMD5":"bcaec7c778920d8d74c275c1aff634fe.svg","bitmapResolution":1,"rotationCenterX":17,"rotationCenterY":24}],"currentCostumeIndex":0,"scratchX":-46,"scratchY":-29,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Story-Q","md5":"484e44f908e84d795c87cf994364e722.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,3,1],"json":{"objName":"Story-Q","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"story-Q-1","baseLayerID":-1,"baseLayerMD5":"484e44f908e84d795c87cf994364e722.svg","bitmapResolution":1,"rotationCenterX":25,"rotationCenterY":30},{"costumeName":"story-Q-2","baseLayerID":-1,"baseLayerMD5":"31f28be74dc7de42a5c4a38504d666ca.svg","bitmapResolution":1,"rotationCenterX":25,"rotationCenterY":30},{"costumeName":"story-Q-3","baseLayerID":-1,"baseLayerMD5":"aef19097378515308e934a79f147032e.svg","bitmapResolution":1,"rotationCenterX":22,"rotationCenterY":29}],"currentCostumeIndex":0,"scratchX":68,"scratchY":5,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Story-R","md5":"55999cb6783ef8351d841294d75af942.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,3,1],"json":{"objName":"Story-R","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"story-R-1","baseLayerID":-1,"baseLayerMD5":"55999cb6783ef8351d841294d75af942.svg","bitmapResolution":1,"rotationCenterX":22,"rotationCenterY":26},{"costumeName":"story-R-2","baseLayerID":-1,"baseLayerMD5":"926f8ff770cb15b42b12f209fd02d98c.svg","bitmapResolution":1,"rotationCenterX":22,"rotationCenterY":26},{"costumeName":"story-R-3","baseLayerID":-1,"baseLayerMD5":"a66d8f0ba6d40c624873edc8df58c014.svg","bitmapResolution":1,"rotationCenterX":20,"rotationCenterY":23}],"currentCostumeIndex":0,"scratchX":17,"scratchY":45,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Story-S","md5":"fca1555f335392f1c4ef620bf098c0de.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,3,1],"json":{"objName":"Story-S","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"story-S-1","baseLayerID":-1,"baseLayerMD5":"fca1555f335392f1c4ef620bf098c0de.svg","bitmapResolution":1,"rotationCenterX":16,"rotationCenterY":25},{"costumeName":"story-S-2","baseLayerID":-1,"baseLayerMD5":"c529ed7b40f4a949539f8f454e3fe475.svg","bitmapResolution":1,"rotationCenterX":16,"rotationCenterY":25},{"costumeName":"story-S-3","baseLayerID":-1,"baseLayerMD5":"e96388c9197733bdadbad3ce014c0e59.svg","bitmapResolution":1,"rotationCenterX":14,"rotationCenterY":23}],"currentCostumeIndex":0,"scratchX":67,"scratchY":-26,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Story-T","md5":"d3b342c795a620b69639c02a419e8535.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,3,1],"json":{"objName":"Story-T","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"story-T-1","baseLayerID":-1,"baseLayerMD5":"d3b342c795a620b69639c02a419e8535.svg","bitmapResolution":1,"rotationCenterX":22,"rotationCenterY":27},{"costumeName":"story-T-2","baseLayerID":-1,"baseLayerMD5":"eeb0fd25c9273747ac38766d1959ba2b.svg","bitmapResolution":1,"rotationCenterX":22,"rotationCenterY":27},{"costumeName":"story-T-3","baseLayerID":-1,"baseLayerMD5":"a9683d4946b08a76864a51bd21d811cb.svg","bitmapResolution":1,"rotationCenterX":20,"rotationCenterY":24}],"currentCostumeIndex":0,"scratchX":-77,"scratchY":44,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Story-U","md5":"fcf99b6e8aeb2d504e1e9b2194640916.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,3,1],"json":{"objName":"Story-U","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"story-U-1","baseLayerID":-1,"baseLayerMD5":"fcf99b6e8aeb2d504e1e9b2194640916.svg","bitmapResolution":1,"rotationCenterX":24,"rotationCenterY":26},{"costumeName":"story-U-2","baseLayerID":-1,"baseLayerMD5":"f442802f17225d6506ac9718810f179e.svg","bitmapResolution":1,"rotationCenterX":24,"rotationCenterY":26},{"costumeName":"story-U-3","baseLayerID":-1,"baseLayerMD5":"0779f03a6589c60352b1d4806a4a61c0.svg","bitmapResolution":1,"rotationCenterX":21,"rotationCenterY":24}],"currentCostumeIndex":0,"scratchX":39,"scratchY":-7,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Story-V","md5":"750b47f1de2143f76354239b27e1e5f0.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,3,1],"json":{"objName":"Story-V","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"story-V-1","baseLayerID":-1,"baseLayerMD5":"750b47f1de2143f76354239b27e1e5f0.svg","bitmapResolution":1,"rotationCenterX":25,"rotationCenterY":25},{"costumeName":"story-V-2","baseLayerID":-1,"baseLayerMD5":"03de7add77e31799ca568a9c671012b4.svg","bitmapResolution":1,"rotationCenterX":25,"rotationCenterY":25},{"costumeName":"story-V-3","baseLayerID":-1,"baseLayerMD5":"29befe20b105b69471f5507d025ec3e0.svg","bitmapResolution":1,"rotationCenterX":22,"rotationCenterY":23}],"currentCostumeIndex":0,"scratchX":40,"scratchY":-35,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Story-W","md5":"7d9d4c0da9bd1a3ddf253d1bea26f4e9.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,3,1],"json":{"objName":"Story-W","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"story-W-1","baseLayerID":-1,"baseLayerMD5":"7d9d4c0da9bd1a3ddf253d1bea26f4e9.svg","bitmapResolution":1,"rotationCenterX":37,"rotationCenterY":25},{"costumeName":"story-W-2","baseLayerID":-1,"baseLayerMD5":"c0f48eb69cae4a611d3e7b7e06b0d1c1.svg","bitmapResolution":1,"rotationCenterX":37,"rotationCenterY":25},{"costumeName":"story-W-3","baseLayerID":-1,"baseLayerMD5":"d1c922c9e9d53d2f6f36ca637e85de6b.svg","bitmapResolution":1,"rotationCenterX":34,"rotationCenterY":24}],"currentCostumeIndex":0,"scratchX":-99,"scratchY":4,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Story-X","md5":"92c452555b3d5a4993f107810043ea03.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,3,1],"json":{"objName":"Story-X","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"story-X-1","baseLayerID":-1,"baseLayerMD5":"92c452555b3d5a4993f107810043ea03.svg","bitmapResolution":1,"rotationCenterX":22,"rotationCenterY":26},{"costumeName":"story-X-2","baseLayerID":-1,"baseLayerMD5":"f688425da41c2b7f80d4b8752de69bc9.svg","bitmapResolution":1,"rotationCenterX":22,"rotationCenterY":26},{"costumeName":"story-X-3","baseLayerID":-1,"baseLayerMD5":"ec90479a0ce3c7706f1916daef0f3c67.svg","bitmapResolution":1,"rotationCenterX":20,"rotationCenterY":24}],"currentCostumeIndex":0,"scratchX":65,"scratchY":-5,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Story-Y","md5":"b3c252450d413fc75be0eafdbe4490dc.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,3,1],"json":{"objName":"Story-Y","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"story-Y-1","baseLayerID":-1,"baseLayerMD5":"b3c252450d413fc75be0eafdbe4490dc.svg","bitmapResolution":1,"rotationCenterX":22,"rotationCenterY":27},{"costumeName":"story-Y-2","baseLayerID":-1,"baseLayerMD5":"1cfa161ae5d60ea163e4e0aa34d08f02.svg","bitmapResolution":1,"rotationCenterX":22,"rotationCenterY":27},{"costumeName":"story-Y-3","baseLayerID":-1,"baseLayerMD5":"a1fc3c0fa304255364c0f98547e0e448.svg","bitmapResolution":1,"rotationCenterX":20,"rotationCenterY":24}],"currentCostumeIndex":0,"scratchX":-77,"scratchY":31,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}},{"name":"Story-Z","md5":"86326c9180c485b557a075f4794939d7.svg","type":"sprite","tags":["alphabet","letters"],"info":[0,3,1],"json":{"objName":"Story-Z","sounds":[{"soundName":"pop","soundID":-1,"md5":"83a9787d4cb6f3b7632b4ddfebf74367.wav","sampleCount":258,"rate":11025,"format":""}],"costumes":[{"costumeName":"story-Z-1","baseLayerID":-1,"baseLayerMD5":"86326c9180c485b557a075f4794939d7.svg","bitmapResolution":1,"rotationCenterX":19,"rotationCenterY":26},{"costumeName":"story-Z-2","baseLayerID":-1,"baseLayerMD5":"e10b203e47bbb41edab78be59e628449.svg","bitmapResolution":1,"rotationCenterX":19,"rotationCenterY":26},{"costumeName":"story-Z-3","baseLayerID":-1,"baseLayerMD5":"0788df7b1d9cf02dfdebc021d4f30ce4.svg","bitmapResolution":1,"rotationCenterX":17,"rotationCenterY":23}],"currentCostumeIndex":0,"scratchX":4,"scratchY":9,"scale":1,"direction":90,"rotationStyle":"normal","isDraggable":false,"visible":true,"spriteInfo":{}}}]; /***/ }), /***/ "./src/lib/libraries/tag-messages.js": /*!*******************************************!*\ !*** ./src/lib/libraries/tag-messages.js ***! \*******************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony default export */ __webpack_exports__["default"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_0__["defineMessages"])({ all: { "id": "gui.libraryTags.all", "defaultMessage": "All" }, animals: { "id": "gui.libraryTags.animals", "defaultMessage": "Animals" }, dance: { "id": "gui.libraryTags.dance", "defaultMessage": "Dance" }, effects: { "id": "gui.libraryTags.effects", "defaultMessage": "Effects" }, fantasy: { "id": "gui.libraryTags.fantasy", "defaultMessage": "Fantasy" }, fashion: { "id": "gui.libraryTags.fashion", "defaultMessage": "Fashion" }, food: { "id": "gui.libraryTags.food", "defaultMessage": "Food" }, indoors: { "id": "gui.libraryTags.indoors", "defaultMessage": "Indoors" }, loops: { "id": "gui.libraryTags.loops", "defaultMessage": "Loops" }, music: { "id": "gui.libraryTags.music", "defaultMessage": "Music" }, notes: { "id": "gui.libraryTags.notes", "defaultMessage": "Notes" }, outdoors: { "id": "gui.libraryTags.outdoors", "defaultMessage": "Outdoors" }, patterns: { "id": "gui.libraryTags.patterns", "defaultMessage": "Patterns" }, people: { "id": "gui.libraryTags.people", "defaultMessage": "People" }, percussion: { "id": "gui.libraryTags.percussion", "defaultMessage": "Percussion" }, space: { "id": "gui.libraryTags.space", "defaultMessage": "Space" }, sports: { "id": "gui.libraryTags.sports", "defaultMessage": "Sports" }, underwater: { "id": "gui.libraryTags.underwater", "defaultMessage": "Underwater" }, voice: { "id": "gui.libraryTags.voice", "defaultMessage": "Voice" }, wacky: { "id": "gui.libraryTags.wacky", "defaultMessage": "Wacky" }, animation: { "id": "gui.libraryTags.animation", "defaultMessage": "Animation" }, art: { "id": "gui.libraryTags.art", "defaultMessage": "Art" }, games: { "id": "gui.libraryTags.games", "defaultMessage": "Games" }, stories: { "id": "gui.libraryTags.stories", "defaultMessage": "Stories" }, letters: { "id": "gui.libraryTags.letters", "defaultMessage": "Letters" } })); /***/ }), /***/ "./src/lib/libraries/tutorial-tags.js": /*!********************************************!*\ !*** ./src/lib/libraries/tutorial-tags.js ***! \********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./tag-messages.js */ "./src/lib/libraries/tag-messages.js"); /* harmony default export */ __webpack_exports__["default"] = ([{ tag: 'animation', intlLabel: _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__["default"].animation }, { tag: 'art', intlLabel: _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__["default"].art }, { tag: 'music', intlLabel: _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__["default"].music }, { tag: 'games', intlLabel: _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__["default"].games }, { tag: 'stories', intlLabel: _tag_messages_js__WEBPACK_IMPORTED_MODULE_0__["default"].stories }]); /***/ }), /***/ "./src/lib/locale-utils.js": /*!*********************************!*\ !*** ./src/lib/locale-utils.js ***! \*********************************/ /*! exports provided: wideLocales, isWideLocale */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wideLocales", function() { return wideLocales; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isWideLocale", function() { return isWideLocale; }); /** * @fileoverview * Utility functions related to localization specific to the GUI */ var wideLocales = ['ab', 'ca', 'de', 'el', 'it', 'ja', 'ja-Hira', 'ko', 'hu', 'ru', 'vi']; /** * Identify the languages where translations are too long to fit in fixed width parts of the gui. * @param {string} locale The current locale. * @return {bool} true if translations in this language are too long */ var isWideLocale = function isWideLocale(locale) { return wideLocales.indexOf(locale) !== -1; }; /***/ }), /***/ "./src/lib/localization-hoc.jsx": /*!**************************************!*\ !*** ./src/lib/localization-hoc.jsx ***! \**************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _connected_intl_provider_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./connected-intl-provider.jsx */ "./src/lib/connected-intl-provider.jsx"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } /* * Higher Order Component to provide localiztion state. Creates a nested IntlProvider * to handle Gui intl context. The component accepts an onSetLanguage callback that is * called when the locale chagnes. * @param {React.Component} WrappedComponent - component to provide state for * @returns {React.Component} component with intl state provided from redux */ var LocalizationHOC = function LocalizationHOC(WrappedComponent) { var LocalizationWrapper = /*#__PURE__*/ function (_React$Component) { _inherits(LocalizationWrapper, _React$Component); function LocalizationWrapper() { _classCallCheck(this, LocalizationWrapper); return _possibleConstructorReturn(this, _getPrototypeOf(LocalizationWrapper).apply(this, arguments)); } _createClass(LocalizationWrapper, [{ key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (prevProps.locale !== this.props.locale) { this.props.onSetLanguage(this.props.locale); } } }, { key: "render", value: function render() { var _this$props = this.props, locale = _this$props.locale, onSetLanguage = _this$props.onSetLanguage, componentProps = _objectWithoutProperties(_this$props, ["locale", "onSetLanguage"]); return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_connected_intl_provider_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(WrappedComponent, componentProps)); } }]); return LocalizationWrapper; }(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component); LocalizationWrapper.propTypes = { locale: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, onSetLanguage: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func }; LocalizationWrapper.defaultProps = { onSetLanguage: function onSetLanguage() {} }; var mapStateToProps = function mapStateToProps(state) { return { locale: state.locales.locale }; }; var mapDispatchToProps = function mapDispatchToProps() { return {}; }; return Object(react_redux__WEBPACK_IMPORTED_MODULE_2__["connect"])(mapStateToProps, mapDispatchToProps)(LocalizationWrapper); }; /* harmony default export */ __webpack_exports__["default"] = (LocalizationHOC); /***/ }), /***/ "./src/lib/log.js": /*!************************!*\ !*** ./src/lib/log.js ***! \************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var minilog__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! minilog */ "./node_modules/minilog/lib/web/index.js"); /* harmony import */ var minilog__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(minilog__WEBPACK_IMPORTED_MODULE_0__); minilog__WEBPACK_IMPORTED_MODULE_0___default.a.enable(); /* harmony default export */ __webpack_exports__["default"] = (minilog__WEBPACK_IMPORTED_MODULE_0___default()('gui')); /***/ }), /***/ "./src/lib/make-toolbox-xml.js": /*!*************************************!*\ !*** ./src/lib/make-toolbox-xml.js ***! \*************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var scratch_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! scratch-blocks */ "./node_modules/scratch-blocks/shim/vertical.js"); /* harmony import */ var scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(scratch_blocks__WEBPACK_IMPORTED_MODULE_0__); var categorySeparator = ''; var blockSeparator = ''; // At default scale, about 28px var motion = function motion(isStage, targetId) { var stageSelected = scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.ScratchMsgs.translate('MOTION_STAGE_SELECTED', 'Stage selected: no motion blocks'); return "\n \n ".concat(isStage ? "\n \n ") : "\n \n \n \n 10\n \n \n \n \n \n \n 15\n \n \n \n \n \n \n 15\n \n \n \n ".concat(blockSeparator, "\n \n \n \n \n \n \n \n \n \n 0\n \n \n \n \n 0\n \n \n \n \n \n \n 1\n \n \n \n \n \n \n \n \n \n \n 1\n \n \n \n \n 0\n \n \n \n \n 0\n \n \n \n ").concat(blockSeparator, "\n \n \n \n 90\n \n \n \n \n \n \n \n \n \n ").concat(blockSeparator, "\n \n \n \n 10\n \n \n \n \n \n \n 0\n \n \n \n \n \n \n 10\n \n \n \n \n \n \n 0\n \n \n \n ").concat(blockSeparator, "\n \n ").concat(blockSeparator, "\n \n ").concat(blockSeparator, "\n \n \n "), "\n ").concat(categorySeparator, "\n \n "); }; var xmlEscape = function xmlEscape(unsafe) { return unsafe.replace(/[<>&'"]/g, function (c) { switch (c) { case '<': return '<'; case '>': return '>'; case '&': return '&'; case '\'': return '''; case '"': return '"'; } }); }; var looks = function looks(isStage, targetId, costumeName, backdropName) { var hello = scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.ScratchMsgs.translate('LOOKS_HELLO', 'Hello!'); var hmm = scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.ScratchMsgs.translate('LOOKS_HMM', 'Hmm...'); return "\n \n ".concat(isStage ? '' : "\n \n \n \n ".concat(hello, "\n \n \n \n \n 2\n \n \n \n \n \n \n ").concat(hello, "\n \n \n \n \n \n \n ").concat(hmm, "\n \n \n \n \n 2\n \n \n \n \n \n \n ").concat(hmm, "\n \n \n \n ").concat(blockSeparator, "\n "), "\n ").concat(isStage ? "\n \n \n \n ".concat(backdropName, "\n \n \n \n \n \n \n ").concat(backdropName, "\n \n \n \n \n ") : "\n \n \n \n ").concat(costumeName, "\n \n \n \n \n \n \n \n ").concat(backdropName, "\n \n \n \n \n ").concat(blockSeparator, "\n \n \n \n 10\n \n \n \n \n \n \n 100\n \n \n \n "), "\n ").concat(blockSeparator, "\n \n \n \n 25\n \n \n \n \n \n \n 0\n \n \n \n \n ").concat(blockSeparator, "\n ").concat(isStage ? '' : "\n \n \n ".concat(blockSeparator, "\n \n \n \n \n 1\n \n \n \n "), "\n ").concat(isStage ? "\n \n " : "\n \n \n \n "), "\n ").concat(categorySeparator, "\n \n "); }; var sound = function sound(isStage, targetId, soundName) { return "\n \n \n \n \n ").concat(soundName, "\n \n \n \n \n \n \n ").concat(soundName, "\n \n \n \n \n ").concat(blockSeparator, "\n \n \n \n 10\n \n \n \n \n \n \n 100\n \n \n \n \n ").concat(blockSeparator, "\n \n \n \n -10\n \n \n \n \n \n \n 100\n \n \n \n \n ").concat(categorySeparator, "\n \n "); }; var events = function events(isStage) { return "\n \n \n \n \n ".concat(isStage ? "\n \n " : "\n \n ", "\n \n \n ").concat(blockSeparator, "\n \n \n \n 10\n \n \n \n ").concat(blockSeparator, "\n \n \n \n \n \n \n \n \n \n \n \n \n ").concat(categorySeparator, "\n \n "); }; var control = function control(isStage) { return "\n \n \n \n \n 1\n \n \n \n ".concat(blockSeparator, "\n \n \n \n 10\n \n \n \n \n ").concat(blockSeparator, "\n \n \n \n \n ").concat(blockSeparator, "\n \n ").concat(blockSeparator, "\n ").concat(isStage ? "\n \n \n \n \n \n " : "\n \n \n \n \n \n \n \n ", "\n ").concat(categorySeparator, "\n \n "); }; var sensing = function sensing(isStage) { var name = scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.ScratchMsgs.translate('SENSING_ASK_TEXT', 'What\'s your name?'); return "\n \n ".concat(isStage ? '' : "\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ".concat(blockSeparator, "\n "), "\n \n \n \n ").concat(name, "\n \n \n \n \n ").concat(blockSeparator, "\n \n \n \n \n \n \n \n \n ").concat(isStage ? '' : "\n ".concat(blockSeparator, "\n ''+\n ").concat(blockSeparator, "\n "), "\n ").concat(blockSeparator, "\n \n ").concat(blockSeparator, "\n \n \n ").concat(blockSeparator, "\n \n \n \n \n \n ").concat(blockSeparator, "\n \n \n ").concat(blockSeparator, "\n \n ").concat(categorySeparator, "\n \n "); }; var operators = function operators() { var apple = scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.ScratchMsgs.translate('OPERATORS_JOIN_APPLE', 'apple'); var banana = scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.ScratchMsgs.translate('OPERATORS_JOIN_BANANA', 'banana'); var letter = scratch_blocks__WEBPACK_IMPORTED_MODULE_0___default.a.ScratchMsgs.translate('OPERATORS_LETTEROF_APPLE', 'a'); return "\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ".concat(blockSeparator, "\n \n \n \n 1\n \n \n \n \n 10\n \n \n \n ").concat(blockSeparator, "\n \n \n \n \n \n \n \n \n 50\n \n \n \n \n \n \n \n \n \n \n \n 50\n \n \n \n \n \n \n \n \n \n \n \n 50\n \n \n \n ").concat(blockSeparator, "\n \n \n \n ").concat(blockSeparator, "\n \n \n \n ").concat(apple, " \n \n \n \n \n ").concat(banana, "\n \n \n \n \n \n \n 1\n \n \n \n \n ").concat(apple, "\n \n \n \n \n \n \n ").concat(apple, "\n \n \n \n \n \n \n ").concat(apple, "\n \n \n \n \n ").concat(letter, "\n \n \n \n ").concat(blockSeparator, "\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ").concat(blockSeparator, "\n \n \n \n \n \n \n \n ").concat(categorySeparator, "\n \n "); }; var variables = function variables() { return "\n \n \n "; }; var myBlocks = function myBlocks() { return "\n \n \n "; }; var xmlOpen = ''; var xmlClose = ''; /** * @param {!boolean} isStage - Whether the toolbox is for a stage-type target. * @param {?string} targetId - The current editing target * @param {?string} categoriesXML - null for default toolbox, or an XML string with elements. * @param {?string} costumeName - The name of the default selected costume dropdown. * @param {?string} backdropName - The name of the default selected backdrop dropdown. * @param {?string} soundName - The name of the default selected sound dropdown. * @returns {string} - a ScratchBlocks-style XML document for the contents of the toolbox. */ var makeToolboxXML = function makeToolboxXML(isStage, targetId, categoriesXML) { var costumeName = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ''; var backdropName = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : ''; var soundName = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : ''; var gap = [categorySeparator]; costumeName = xmlEscape(costumeName); backdropName = xmlEscape(backdropName); soundName = xmlEscape(soundName); var everything = [xmlOpen, motion(isStage, targetId), gap, looks(isStage, targetId, costumeName, backdropName), gap, sound(isStage, targetId, soundName), gap, events(isStage, targetId), gap, control(isStage, targetId), gap, sensing(isStage, targetId), gap, operators(isStage, targetId), gap, variables(isStage, targetId), gap, myBlocks(isStage, targetId)]; if (categoriesXML) { everything.push(gap, categoriesXML); } everything.push(xmlClose); return everything.join('\n'); }; /* harmony default export */ __webpack_exports__["default"] = (makeToolboxXML); /***/ }), /***/ "./src/lib/monitor-adapter.js": /*!************************************!*\ !*** ./src/lib/monitor-adapter.js ***! \************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _opcode_labels_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./opcode-labels.js */ "./src/lib/opcode-labels.js"); var isUndefined = function isUndefined(a) { return typeof a === 'undefined'; }; /** * Convert monitors from VM format to what the GUI needs to render. * - Convert opcode to a label and a category * @param {string} block.id - The id of the monitor block * @param {string} block.spriteName - Present only if the monitor applies only to the sprite * with given target ID. The name of the target sprite when the monitor was created * @param {string} block.opcode - The opcode of the monitor * @param {object} block.params - Extra params to the monitor block * @param {string|number|Array} block.value - The monitor value * @param {VirtualMachine} block.vm - the VM instance which owns the block * @return {object} The adapted monitor with label and category */ /* harmony default export */ __webpack_exports__["default"] = (function (_ref) { var id = _ref.id, spriteName = _ref.spriteName, opcode = _ref.opcode, params = _ref.params, value = _ref.value, vm = _ref.vm; // Extension monitors get their labels from the Runtime through `getLabelForOpcode`. // Other monitors' labels are hard-coded in `OpcodeLabels`. var _ref2 = vm && vm.runtime.getLabelForOpcode(opcode) || _opcode_labels_js__WEBPACK_IMPORTED_MODULE_0__["default"].getLabel(opcode), label = _ref2.label, category = _ref2.category, labelFn = _ref2.labelFn; // Use labelFn if provided for dynamic labelling (e.g. variables) if (!isUndefined(labelFn)) label = labelFn(params); // Append sprite name for sprite-specific monitors if (spriteName) { label = "".concat(spriteName, ": ").concat(label); } // If value is a number, round it to six decimal places if (typeof value === 'number') { value = Number(value.toFixed(6)); } // Turn the value to a string, for handle boolean values if (typeof value === 'boolean') { value = value.toString(); } // Lists can contain booleans, which should also be turned to strings if (Array.isArray(value)) { value = value.map(function (item) { return item.toString(); }); } return { id: id, label: label, category: category, value: value }; }); /***/ }), /***/ "./src/lib/opcode-labels.js": /*!**********************************!*\ !*** ./src/lib/opcode-labels.js ***! \**********************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } var messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_0__["defineMessages"])({ motion_direction: { "id": "gui.opcodeLabels.direction", "defaultMessage": "direction" }, motion_xposition: { "id": "gui.opcodeLabels.xposition", "defaultMessage": "x position" }, motion_yposition: { "id": "gui.opcodeLabels.yposition", "defaultMessage": "y position" }, // Looks looks_size: { "id": "gui.opcodeLabels.size", "defaultMessage": "size" }, looks_costumename: { "id": "gui.opcodeLabels.costumename", "defaultMessage": "costume name" }, looks_costumenumber: { "id": "gui.opcodeLabels.costumenumber", "defaultMessage": "costume number" }, looks_backdropname: { "id": "gui.opcodeLabels.backdropname", "defaultMessage": "backdrop name" }, looks_backdropnumber: { "id": "gui.opcodeLabels.backdropnumber", "defaultMessage": "backdrop number" }, // Sound sound_volume: { "id": "gui.opcodeLabels.volume", "defaultMessage": "volume" }, sound_tempo: { "id": "gui.opcodeLabels.tempo", "defaultMessage": "tempo" }, // Sensing sensing_answer: { "id": "gui.opcodeLabels.answer", "defaultMessage": "answer" }, sensing_loudness: { "id": "gui.opcodeLabels.loudness", "defaultMessage": "loudness" }, sensing_username: { "id": "gui.opcodeLabels.username", "defaultMessage": "username" }, sensing_current_year: { "id": "gui.opcodeLabels.year", "defaultMessage": "year" }, sensing_current_month: { "id": "gui.opcodeLabels.month", "defaultMessage": "month" }, sensing_current_date: { "id": "gui.opcodeLabels.date", "defaultMessage": "date" }, sensing_current_dayofweek: { "id": "gui.opcodeLabels.dayofweek", "defaultMessage": "day of week" }, sensing_current_hour: { "id": "gui.opcodeLabels.hour", "defaultMessage": "hour" }, sensing_current_minute: { "id": "gui.opcodeLabels.minute", "defaultMessage": "minute" }, sensing_current_second: { "id": "gui.opcodeLabels.second", "defaultMessage": "second" }, sensing_timer: { "id": "gui.opcodeLabels.timer", "defaultMessage": "timer" } }); var OpcodeLabels = /*#__PURE__*/ function () { function OpcodeLabels() { _classCallCheck(this, OpcodeLabels); /** * Translation function for labels. By default just return the defaultMessage * @private * @param {object} message A message object compatible with react-intl formatMessage * @return {string} Return the default string initially */ this._translator = function (message) { return message.defaultMessage; }; /** * Initial opcode map, with categories defined * @private */ this._opcodeMap = { // Motion motion_direction: { category: 'motion' }, motion_xposition: { category: 'motion' }, motion_yposition: { category: 'motion' }, // Looks looks_size: { category: 'looks' }, looks_costumenumbername: { category: 'looks' }, looks_backdropnumbername: { category: 'looks' }, looks_backdropname: { category: 'looks' }, // Data data_variable: { category: 'data' }, data_listcontents: { category: 'list' }, // Sound sound_volume: { category: 'sound' }, sound_tempo: { category: 'sound' }, // Sensing sensing_answer: { category: 'sensing' }, sensing_loudness: { category: 'sensing' }, sensing_username: { category: 'sensing' }, sensing_current: { category: 'sensing' }, sensing_timer: { category: 'sensing' } }; // Initialize opcodeMap with default strings this._refreshOpcodeMap(); } /** * Set the translation function for monitor labels. The function should accept * a message object as defined by react-intl defineMessages * @param {function} translator the function to use for localization */ _createClass(OpcodeLabels, [{ key: "setTranslatorFunction", value: function setTranslatorFunction(translator) { this._translator = translator; this._refreshOpcodeMap(); } /** * Internal function to update opcode Map when translation function is defined * @private */ }, { key: "_refreshOpcodeMap", value: function _refreshOpcodeMap() { var _this = this; // Motion this._opcodeMap.motion_direction.labelFn = function () { return _this._translator(messages.motion_direction); }; this._opcodeMap.motion_xposition.labelFn = function () { return _this._translator(messages.motion_xposition); }; this._opcodeMap.motion_yposition.labelFn = function () { return _this._translator(messages.motion_yposition); }; // Looks this._opcodeMap.looks_size.labelFn = function () { return _this._translator(messages.looks_size); }; this._opcodeMap.looks_costumenumbername.labelFn = function (params) { if (params.NUMBER_NAME === 'number') { return _this._translator(messages.looks_costumenumber); } return _this._translator(messages.looks_costumename); }; this._opcodeMap.looks_backdropnumbername.labelFn = function (params) { if (params.NUMBER_NAME === 'number') { return _this._translator(messages.looks_backdropnumber); } return _this._translator(messages.looks_backdropname); }; this._opcodeMap.looks_backdropname.labelFn = function () { return _this._translator(messages.looks_backdropname); }; // Data this._opcodeMap.data_variable.labelFn = function (params) { return params.VARIABLE; }; this._opcodeMap.data_listcontents.labelFn = function (params) { return params.LIST; }; // Sound this._opcodeMap.sound_volume.labelFn = function () { return _this._translator(messages.sound_volume); }; this._opcodeMap.sound_tempo.labelFn = function () { return _this._translator(messages.sound_tempo); }; // Sensing this._opcodeMap.sensing_answer.labelFn = function () { return _this._translator(messages.sensing_answer); }; this._opcodeMap.sensing_loudness.labelFn = function () { return _this._translator(messages.sensing_loudness); }; this._opcodeMap.sensing_username.labelFn = function () { return _this._translator(messages.sensing_username); }; this._opcodeMap.sensing_current.labelFn = function (params) { switch (params.CURRENTMENU.toLowerCase()) { case 'year': return _this._translator(messages.sensing_current_year); case 'month': return _this._translator(messages.sensing_current_month); case 'date': return _this._translator(messages.sensing_current_date); case 'dayofweek': return _this._translator(messages.sensing_current_dayofweek); case 'hour': return _this._translator(messages.sensing_current_hour); case 'minute': return _this._translator(messages.sensing_current_minute); case 'second': return _this._translator(messages.sensing_current_second); } }; this._opcodeMap.sensing_timer.labelFn = function () { return _this._translator(messages.sensing_timer); }; } /** * Return the label for an opcode * @param {string} opcode the opcode you want a label for * @return {object} object with label and category */ }, { key: "getLabel", value: function getLabel(opcode) { if (opcode in this._opcodeMap) return this._opcodeMap[opcode]; return { category: 'extension', label: opcode }; } }]); return OpcodeLabels; }(); /* harmony default export */ __webpack_exports__["default"] = (new OpcodeLabels()); /***/ }), /***/ "./src/lib/project-fetcher-hoc.jsx": /*!*****************************************!*\ !*** ./src/lib/project-fetcher-hoc.jsx ***! \*****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ProjectFetcherHOC; }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _reducers_project_changed__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../reducers/project-changed */ "./src/reducers/project-changed.js"); /* harmony import */ var _reducers_project_state__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../reducers/project-state */ "./src/reducers/project-state.js"); /* harmony import */ var _reducers_editor_tab__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../reducers/editor-tab */ "./src/reducers/editor-tab.js"); /* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./log */ "./src/lib/log.js"); /* harmony import */ var _storage__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./storage */ "./src/lib/storage.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } /* Higher Order Component to provide behavior for loading projects by id. If * there's no id, the default project is loaded. * @param {React.Component} WrappedComponent component to receive projectData prop * @returns {React.Component} component with project loading behavior */ var ProjectFetcherHOC = function ProjectFetcherHOC(WrappedComponent) { var ProjectFetcherComponent = /*#__PURE__*/ function (_React$Component) { _inherits(ProjectFetcherComponent, _React$Component); function ProjectFetcherComponent(props) { var _this; _classCallCheck(this, ProjectFetcherComponent); _this = _possibleConstructorReturn(this, _getPrototypeOf(ProjectFetcherComponent).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_3___default()(_assertThisInitialized(_this), ['fetchProject']); _storage__WEBPACK_IMPORTED_MODULE_9__["default"].setProjectHost(props.projectHost); _storage__WEBPACK_IMPORTED_MODULE_9__["default"].setAssetHost(props.assetHost); _storage__WEBPACK_IMPORTED_MODULE_9__["default"].setTranslatorFunction(props.intl.formatMessage); // props.projectId might be unset, in which case we use our default; // or it may be set by an even higher HOC, and passed to us. // Either way, we now know what the initial projectId should be, so // set it in the redux store. if (props.projectId !== '' && props.projectId !== null && typeof props.projectId !== 'undefined') { _this.props.setProjectId(props.projectId.toString()); } return _this; } _createClass(ProjectFetcherComponent, [{ key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (prevProps.projectHost !== this.props.projectHost) { _storage__WEBPACK_IMPORTED_MODULE_9__["default"].setProjectHost(this.props.projectHost); } if (prevProps.assetHost !== this.props.assetHost) { _storage__WEBPACK_IMPORTED_MODULE_9__["default"].setAssetHost(this.props.assetHost); } if (this.props.isFetchingWithId && !prevProps.isFetchingWithId) { this.fetchProject(this.props.reduxProjectId, this.props.loadingState); } if (this.props.isShowingProject && !prevProps.isShowingProject) { this.props.onProjectUnchanged(); } if (this.props.isShowingProject && (prevProps.isLoadingProject || prevProps.isCreatingNew)) { this.props.onActivateTab(_reducers_editor_tab__WEBPACK_IMPORTED_MODULE_7__["BLOCKS_TAB_INDEX"]); } } }, { key: "fetchProject", value: function fetchProject(projectId, loadingState) { var _this2 = this; return _storage__WEBPACK_IMPORTED_MODULE_9__["default"].load(_storage__WEBPACK_IMPORTED_MODULE_9__["default"].AssetType.Project, projectId, _storage__WEBPACK_IMPORTED_MODULE_9__["default"].DataFormat.JSON).then(function (projectAsset) { if (projectAsset) { _this2.props.onFetchedProjectData(projectAsset.data, loadingState); } else { // Treat failure to load as an error // Throw to be caught by catch later on throw new Error('Could not find project'); } }).catch(function (err) { _this2.props.onError(err); _log__WEBPACK_IMPORTED_MODULE_8__["default"].error(err); }); } }, { key: "render", value: function render() { var _this$props = this.props, assetHost = _this$props.assetHost, intl = _this$props.intl, isLoadingProjectProp = _this$props.isLoadingProject, loadingState = _this$props.loadingState, onActivateTab = _this$props.onActivateTab, onErrorProp = _this$props.onError, onFetchedProjectDataProp = _this$props.onFetchedProjectData, onProjectUnchanged = _this$props.onProjectUnchanged, projectHost = _this$props.projectHost, projectId = _this$props.projectId, reduxProjectId = _this$props.reduxProjectId, setProjectIdProp = _this$props.setProjectId, isFetchingWithIdProp = _this$props.isFetchingWithId, componentProps = _objectWithoutProperties(_this$props, ["assetHost", "intl", "isLoadingProject", "loadingState", "onActivateTab", "onError", "onFetchedProjectData", "onProjectUnchanged", "projectHost", "projectId", "reduxProjectId", "setProjectId", "isFetchingWithId"]); return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(WrappedComponent, _extends({ fetchingProject: isFetchingWithIdProp }, componentProps)); } }]); return ProjectFetcherComponent; }(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component); ProjectFetcherComponent.propTypes = { assetHost: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, canSave: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, intl: react_intl__WEBPACK_IMPORTED_MODULE_2__["intlShape"].isRequired, isCreatingNew: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, isFetchingWithId: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, isLoadingProject: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, isShowingProject: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, loadingState: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOf(_reducers_project_state__WEBPACK_IMPORTED_MODULE_6__["LoadingStates"]), onActivateTab: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onError: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onFetchedProjectData: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onProjectUnchanged: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, projectHost: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, projectId: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number]), reduxProjectId: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number]), setProjectId: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func }; ProjectFetcherComponent.defaultProps = { assetHost: 'https://assets.scratch.mit.edu', projectHost: 'https://projects.scratch.mit.edu' }; var mapStateToProps = function mapStateToProps(state) { return { isCreatingNew: Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_6__["getIsCreatingNew"])(state.scratchGui.projectState.loadingState), isFetchingWithId: Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_6__["getIsFetchingWithId"])(state.scratchGui.projectState.loadingState), isLoadingProject: Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_6__["getIsLoading"])(state.scratchGui.projectState.loadingState), isShowingProject: Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_6__["getIsShowingProject"])(state.scratchGui.projectState.loadingState), loadingState: state.scratchGui.projectState.loadingState, reduxProjectId: state.scratchGui.projectState.projectId }; }; var mapDispatchToProps = function mapDispatchToProps(dispatch) { return { onActivateTab: function onActivateTab(tab) { return dispatch(Object(_reducers_editor_tab__WEBPACK_IMPORTED_MODULE_7__["activateTab"])(tab)); }, onError: function onError(error) { return dispatch(Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_6__["projectError"])(error)); }, onFetchedProjectData: function onFetchedProjectData(projectData, loadingState) { return dispatch(Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_6__["onFetchedProjectData"])(projectData, loadingState)); }, setProjectId: function setProjectId(projectId) { return dispatch(Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_6__["setProjectId"])(projectId)); }, onProjectUnchanged: function onProjectUnchanged() { return dispatch(Object(_reducers_project_changed__WEBPACK_IMPORTED_MODULE_5__["setProjectUnchanged"])()); } }; }; // Allow incoming props to override redux-provided props. Used to mock in tests. var mergeProps = function mergeProps(stateProps, dispatchProps, ownProps) { return Object.assign({}, stateProps, dispatchProps, ownProps); }; return Object(react_intl__WEBPACK_IMPORTED_MODULE_2__["injectIntl"])(Object(react_redux__WEBPACK_IMPORTED_MODULE_4__["connect"])(mapStateToProps, mapDispatchToProps, mergeProps)(ProjectFetcherComponent)); }; /***/ }), /***/ "./src/lib/project-saver-hoc.jsx": /*!***************************************!*\ !*** ./src/lib/project-saver-hoc.jsx ***! \***************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ProjectSaverHOC; }); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! scratch-vm */ "./node_modules/scratch-vm/src/index.js"); /* harmony import */ var scratch_vm__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(scratch_vm__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _lib_collect_metadata__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../lib/collect-metadata */ "./src/lib/collect-metadata.js"); /* harmony import */ var _lib_log__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lib/log */ "./src/lib/log.js"); /* harmony import */ var _lib_storage__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../lib/storage */ "./src/lib/storage.js"); /* harmony import */ var _lib_data_uri_to_blob__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../lib/data-uri-to-blob */ "./src/lib/data-uri-to-blob.js"); /* harmony import */ var _lib_save_project_to_server__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../lib/save-project-to-server */ "./src/lib/save-project-to-server.js"); /* harmony import */ var _reducers_alerts__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../reducers/alerts */ "./src/reducers/alerts.js"); /* harmony import */ var _reducers_timeout__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../reducers/timeout */ "./src/reducers/timeout.js"); /* harmony import */ var _reducers_project_changed__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../reducers/project-changed */ "./src/reducers/project-changed.js"); /* harmony import */ var _reducers_project_state__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../reducers/project-state */ "./src/reducers/project-state.js"); function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } /** * Higher Order Component to provide behavior for saving projects. * @param {React.Component} WrappedComponent the component to add project saving functionality to * @returns {React.Component} WrappedComponent with project saving functionality added * * * * */ var ProjectSaverHOC = function ProjectSaverHOC(WrappedComponent) { var ProjectSaverComponent = /*#__PURE__*/ function (_React$Component) { _inherits(ProjectSaverComponent, _React$Component); function ProjectSaverComponent(props) { var _this; _classCallCheck(this, ProjectSaverComponent); _this = _possibleConstructorReturn(this, _getPrototypeOf(ProjectSaverComponent).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['getProjectThumbnail', 'leavePageConfirm', 'tryToAutoSave']); return _this; } _createClass(ProjectSaverComponent, [{ key: "componentWillMount", value: function componentWillMount() { var _this2 = this; if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === 'object') { // Note: it might be better to use a listener instead of assigning onbeforeunload; // but then it'd be hard to turn this listening off in our tests window.onbeforeunload = function (e) { return _this2.leavePageConfirm(e); }; } // Allow the GUI consumer to pass in a function to receive a trigger // for triggering thumbnail or whole project saves. // These functions are called with null on unmount to prevent stale references. this.props.onSetProjectThumbnailer(this.getProjectThumbnail); this.props.onSetProjectSaver(this.tryToAutoSave); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (!this.props.isAnyCreatingNewState && prevProps.isAnyCreatingNewState) { this.reportTelemetryEvent('projectWasCreated'); } if (!this.props.isLoading && prevProps.isLoading) { this.reportTelemetryEvent('projectDidLoad'); } if (this.props.projectChanged && !prevProps.projectChanged) { this.scheduleAutoSave(); } if (this.props.isUpdating && !prevProps.isUpdating) { this.updateProjectToStorage(); } if (this.props.isCreatingNew && !prevProps.isCreatingNew) { this.createNewProjectToStorage(); } if (this.props.isCreatingCopy && !prevProps.isCreatingCopy) { this.createCopyToStorage(); } if (this.props.isRemixing && !prevProps.isRemixing) { this.props.onRemixing(true); this.createRemixToStorage(); } else if (!this.props.isRemixing && prevProps.isRemixing) { this.props.onRemixing(false); } // see if we should "create" the current project on the server // // don't try to create or save immediately after trying to create if (prevProps.isCreatingNew) return; // if we're newly able to create this project, create it! if (this.isShowingCreatable(this.props) && !this.isShowingCreatable(prevProps)) { this.props.onCreateProject(); } // see if we should save/update the current project on the server // // don't try to save immediately after trying to save if (prevProps.isUpdating) return; // if we're newly able to save this project, save it! var becameAbleToSave = this.props.canSave && !prevProps.canSave; var becameShared = this.props.isShared && !prevProps.isShared; if (this.props.isShowingSaveable && (becameAbleToSave || becameShared)) { this.props.onAutoUpdateProject(); } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.clearAutoSaveTimeout(); // Cant unset the beforeunload because it might no longer belong to this component // i.e. if another of this component has been mounted before this one gets unmounted // which happens when going from project to editor view. // window.onbeforeunload = undefined; // eslint-disable-line no-undefined // Remove project thumbnailer function since the components are unmounting this.props.onSetProjectThumbnailer(null); this.props.onSetProjectSaver(null); } }, { key: "leavePageConfirm", value: function leavePageConfirm(e) { if (this.props.projectChanged) { // both methods of returning a value may be necessary for browser compatibility (e || window.event).returnValue = true; return true; } return; // Returning undefined prevents the prompt from coming up } }, { key: "clearAutoSaveTimeout", value: function clearAutoSaveTimeout() { if (this.props.autoSaveTimeoutId !== null) { clearTimeout(this.props.autoSaveTimeoutId); this.props.setAutoSaveTimeoutId(null); } } }, { key: "scheduleAutoSave", value: function scheduleAutoSave() { if (this.props.isShowingSaveable && this.props.autoSaveTimeoutId === null) { var timeoutId = setTimeout(this.tryToAutoSave, this.props.autoSaveIntervalSecs * 1000); this.props.setAutoSaveTimeoutId(timeoutId); } } }, { key: "tryToAutoSave", value: function tryToAutoSave() { if (this.props.projectChanged && this.props.isShowingSaveable) { this.props.onAutoUpdateProject(); } } }, { key: "isShowingCreatable", value: function isShowingCreatable(props) { return props.canCreateNew && props.isShowingWithoutId; } }, { key: "updateProjectToStorage", value: function updateProjectToStorage() { var _this3 = this; this.props.onShowSavingAlert(); return this.storeProject(this.props.reduxProjectId).then(function () { // there's an http response object available here, but we don't need to examine // it, because there are no values contained in it that we care about _this3.props.onUpdatedProject(_this3.props.loadingState); _this3.props.onShowSaveSuccessAlert(); }).catch(function (err) { // Always show the savingError alert because it gives the // user the chance to download or retry the save manually. _this3.props.onShowAlert('savingError'); _this3.props.onProjectError(err); }); } }, { key: "createNewProjectToStorage", value: function createNewProjectToStorage() { var _this4 = this; return this.storeProject(null).then(function (response) { _this4.props.onCreatedProject(response.id.toString(), _this4.props.loadingState); }).catch(function (err) { _this4.props.onShowAlert('creatingError'); _this4.props.onProjectError(err); }); } }, { key: "createCopyToStorage", value: function createCopyToStorage() { var _this5 = this; this.props.onShowCreatingCopyAlert(); return this.storeProject(null, { originalId: this.props.reduxProjectId, isCopy: 1, title: this.props.reduxProjectTitle }).then(function (response) { _this5.props.onCreatedProject(response.id.toString(), _this5.props.loadingState); _this5.props.onShowCopySuccessAlert(); }).catch(function (err) { _this5.props.onShowAlert('creatingError'); _this5.props.onProjectError(err); }); } }, { key: "createRemixToStorage", value: function createRemixToStorage() { var _this6 = this; this.props.onShowCreatingRemixAlert(); return this.storeProject(null, { originalId: this.props.reduxProjectId, isRemix: 1, title: this.props.reduxProjectTitle }).then(function (response) { _this6.props.onCreatedProject(response.id.toString(), _this6.props.loadingState); _this6.props.onShowRemixSuccessAlert(); }).catch(function (err) { _this6.props.onShowAlert('creatingError'); _this6.props.onProjectError(err); }); } /** * storeProject: * @param {number|string|undefined} projectId - defined value will PUT/update; undefined/null will POST/create * @return {Promise} - resolves with json object containing project's existing or new id * @param {?object} requestParams - object of params to add to request body */ }, { key: "storeProject", value: function storeProject(projectId, requestParams) { var _this7 = this; requestParams = requestParams || {}; this.clearAutoSaveTimeout(); // Serialize VM state now before embarking on // the asynchronous journey of storing assets to // the server. This ensures that assets don't update // while in the process of saving a project (e.g. the // serialized project refers to a newer asset than what // we just finished saving). var savedVMState = this.props.vm.toJSON(); return Promise.all(this.props.vm.assets.filter(function (asset) { return !asset.clean; }).map(function (asset) { return _lib_storage__WEBPACK_IMPORTED_MODULE_7__["default"].store(asset.assetType, asset.dataFormat, asset.data, asset.assetId).then(function () { return asset.clean = true; }); })).then(function () { return _this7.props.onUpdateProjectData(projectId, savedVMState, requestParams); }).then(function (response) { _this7.props.onSetProjectUnchanged(); var id = response.id.toString(); if (id && _this7.props.onUpdateProjectThumbnail) { _this7.storeProjectThumbnail(id); } return response; }).catch(function (err) { _lib_log__WEBPACK_IMPORTED_MODULE_6__["default"].error(err); throw err; // pass the error up the chain }); } /** * Store a snapshot of the project once it has been saved/created. * Needs to happen _after_ save because the project must have an ID. * @param {!string} projectId - id of the project, must be defined. */ }, { key: "storeProjectThumbnail", value: function storeProjectThumbnail(projectId) { var _this8 = this; try { this.getProjectThumbnail(function (dataURI) { _this8.props.onUpdateProjectThumbnail(projectId, Object(_lib_data_uri_to_blob__WEBPACK_IMPORTED_MODULE_8__["default"])(dataURI)); }); } catch (e) { _lib_log__WEBPACK_IMPORTED_MODULE_6__["default"].error('Project thumbnail save error', e); // This is intentionally fire/forget because a failure // to save the thumbnail is not vitally important to the user. } } }, { key: "getProjectThumbnail", value: function getProjectThumbnail(callback) { var _this9 = this; this.props.vm.postIOData('video', { forceTransparentPreview: true }); this.props.vm.renderer.requestSnapshot(function (dataURI) { _this9.props.vm.postIOData('video', { forceTransparentPreview: false }); callback(dataURI); }); this.props.vm.renderer.draw(); } /** * Report a telemetry event. * @param {string} event - one of `projectWasCreated`, `projectDidLoad`, `projectDidSave`, `projectWasUploaded` */ // TODO make a telemetry HOC and move this stuff there }, { key: "reportTelemetryEvent", value: function reportTelemetryEvent(event) { if (this.props.onProjectTelemetryEvent) { var metadata = Object(_lib_collect_metadata__WEBPACK_IMPORTED_MODULE_5__["default"])(this.props.vm, this.props.reduxProjectTitle, this.props.locale); this.props.onProjectTelemetryEvent(event, metadata); } } }, { key: "render", value: function render() { var _this$props = this.props, autoSaveTimeoutId = _this$props.autoSaveTimeoutId, autoSaveIntervalSecs = _this$props.autoSaveIntervalSecs, isCreatingCopy = _this$props.isCreatingCopy, isCreatingNew = _this$props.isCreatingNew, projectChanged = _this$props.projectChanged, isAnyCreatingNewState = _this$props.isAnyCreatingNewState, isLoading = _this$props.isLoading, isManualUpdating = _this$props.isManualUpdating, isRemixing = _this$props.isRemixing, isShowingSaveable = _this$props.isShowingSaveable, isShowingWithId = _this$props.isShowingWithId, isShowingWithoutId = _this$props.isShowingWithoutId, isUpdating = _this$props.isUpdating, loadingState = _this$props.loadingState, onAutoUpdateProject = _this$props.onAutoUpdateProject, onCreatedProject = _this$props.onCreatedProject, onCreateProject = _this$props.onCreateProject, onProjectError = _this$props.onProjectError, onRemixing = _this$props.onRemixing, onSetProjectUnchanged = _this$props.onSetProjectUnchanged, onSetProjectThumbnailer = _this$props.onSetProjectThumbnailer, onSetProjectSaver = _this$props.onSetProjectSaver, onShowAlert = _this$props.onShowAlert, onShowCopySuccessAlert = _this$props.onShowCopySuccessAlert, onShowRemixSuccessAlert = _this$props.onShowRemixSuccessAlert, onShowCreatingCopyAlert = _this$props.onShowCreatingCopyAlert, onShowCreatingRemixAlert = _this$props.onShowCreatingRemixAlert, onShowSaveSuccessAlert = _this$props.onShowSaveSuccessAlert, onShowSavingAlert = _this$props.onShowSavingAlert, onUpdatedProject = _this$props.onUpdatedProject, onUpdateProjectData = _this$props.onUpdateProjectData, onUpdateProjectThumbnail = _this$props.onUpdateProjectThumbnail, reduxProjectId = _this$props.reduxProjectId, reduxProjectTitle = _this$props.reduxProjectTitle, setAutoSaveTimeoutIdProp = _this$props.setAutoSaveTimeoutId, componentProps = _objectWithoutProperties(_this$props, ["autoSaveTimeoutId", "autoSaveIntervalSecs", "isCreatingCopy", "isCreatingNew", "projectChanged", "isAnyCreatingNewState", "isLoading", "isManualUpdating", "isRemixing", "isShowingSaveable", "isShowingWithId", "isShowingWithoutId", "isUpdating", "loadingState", "onAutoUpdateProject", "onCreatedProject", "onCreateProject", "onProjectError", "onRemixing", "onSetProjectUnchanged", "onSetProjectThumbnailer", "onSetProjectSaver", "onShowAlert", "onShowCopySuccessAlert", "onShowRemixSuccessAlert", "onShowCreatingCopyAlert", "onShowCreatingRemixAlert", "onShowSaveSuccessAlert", "onShowSavingAlert", "onUpdatedProject", "onUpdateProjectData", "onUpdateProjectThumbnail", "reduxProjectId", "reduxProjectTitle", "setAutoSaveTimeoutId"]); return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(WrappedComponent, _extends({ isCreating: isAnyCreatingNewState }, componentProps)); } }]); return ProjectSaverComponent; }(react__WEBPACK_IMPORTED_MODULE_1___default.a.Component); ProjectSaverComponent.propTypes = { autoSaveIntervalSecs: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number.isRequired, autoSaveTimeoutId: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number, canCreateNew: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, canSave: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, isAnyCreatingNewState: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, isCreatingCopy: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, isCreatingNew: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, isLoading: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, isManualUpdating: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, isRemixing: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, isShared: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, isShowingSaveable: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, isShowingWithId: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, isShowingWithoutId: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, isUpdating: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, loadingState: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOf(_reducers_project_state__WEBPACK_IMPORTED_MODULE_13__["LoadingStates"]), locale: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string.isRequired, onAutoUpdateProject: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onCreateProject: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onCreatedProject: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onProjectError: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onProjectTelemetryEvent: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onRemixing: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onSetProjectSaver: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func.isRequired, onSetProjectThumbnailer: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func.isRequired, onSetProjectUnchanged: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func.isRequired, onShowAlert: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onShowCopySuccessAlert: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onShowCreatingCopyAlert: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onShowCreatingRemixAlert: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onShowRemixSuccessAlert: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onShowSaveSuccessAlert: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onShowSavingAlert: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onUpdateProjectData: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func.isRequired, onUpdateProjectThumbnail: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, onUpdatedProject: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func, projectChanged: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, reduxProjectId: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number]), reduxProjectTitle: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, setAutoSaveTimeoutId: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func.isRequired, vm: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.instanceOf(scratch_vm__WEBPACK_IMPORTED_MODULE_4___default.a).isRequired }; ProjectSaverComponent.defaultProps = { autoSaveIntervalSecs: 120, onRemixing: function onRemixing() {}, onSetProjectThumbnailer: function onSetProjectThumbnailer() {}, onSetProjectSaver: function onSetProjectSaver() {}, onUpdateProjectData: _lib_save_project_to_server__WEBPACK_IMPORTED_MODULE_9__["default"] }; var mapStateToProps = function mapStateToProps(state, ownProps) { var loadingState = state.scratchGui.projectState.loadingState; var isShowingWithId = Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_13__["getIsShowingWithId"])(loadingState); return { autoSaveTimeoutId: state.scratchGui.timeout.autoSaveTimeoutId, isAnyCreatingNewState: Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_13__["getIsAnyCreatingNewState"])(loadingState), isLoading: Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_13__["getIsLoading"])(loadingState), isCreatingCopy: Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_13__["getIsCreatingCopy"])(loadingState), isCreatingNew: Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_13__["getIsCreatingNew"])(loadingState), isRemixing: Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_13__["getIsRemixing"])(loadingState), isShowingSaveable: ownProps.canSave && isShowingWithId, isShowingWithId: isShowingWithId, isShowingWithoutId: Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_13__["getIsShowingWithoutId"])(loadingState), isUpdating: Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_13__["getIsUpdating"])(loadingState), isManualUpdating: Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_13__["getIsManualUpdating"])(loadingState), loadingState: loadingState, locale: state.locales.locale, projectChanged: state.scratchGui.projectChanged, reduxProjectId: state.scratchGui.projectState.projectId, reduxProjectTitle: state.scratchGui.projectTitle, vm: state.scratchGui.vm }; }; var mapDispatchToProps = function mapDispatchToProps(dispatch) { return { onAutoUpdateProject: function onAutoUpdateProject() { return dispatch(Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_13__["autoUpdateProject"])()); }, onCreatedProject: function onCreatedProject(projectId, loadingState) { return dispatch(Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_13__["doneCreatingProject"])(projectId, loadingState)); }, onCreateProject: function onCreateProject() { return dispatch(Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_13__["createProject"])()); }, onProjectError: function onProjectError(error) { return dispatch(Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_13__["projectError"])(error)); }, onSetProjectUnchanged: function onSetProjectUnchanged() { return dispatch(Object(_reducers_project_changed__WEBPACK_IMPORTED_MODULE_12__["setProjectUnchanged"])()); }, onShowAlert: function onShowAlert(alertType) { return dispatch(Object(_reducers_alerts__WEBPACK_IMPORTED_MODULE_10__["showStandardAlert"])(alertType)); }, onShowCopySuccessAlert: function onShowCopySuccessAlert() { return Object(_reducers_alerts__WEBPACK_IMPORTED_MODULE_10__["showAlertWithTimeout"])(dispatch, 'createCopySuccess'); }, onShowRemixSuccessAlert: function onShowRemixSuccessAlert() { return Object(_reducers_alerts__WEBPACK_IMPORTED_MODULE_10__["showAlertWithTimeout"])(dispatch, 'createRemixSuccess'); }, onShowCreatingCopyAlert: function onShowCreatingCopyAlert() { return Object(_reducers_alerts__WEBPACK_IMPORTED_MODULE_10__["showAlertWithTimeout"])(dispatch, 'creatingCopy'); }, onShowCreatingRemixAlert: function onShowCreatingRemixAlert() { return Object(_reducers_alerts__WEBPACK_IMPORTED_MODULE_10__["showAlertWithTimeout"])(dispatch, 'creatingRemix'); }, onShowSaveSuccessAlert: function onShowSaveSuccessAlert() { return Object(_reducers_alerts__WEBPACK_IMPORTED_MODULE_10__["showAlertWithTimeout"])(dispatch, 'saveSuccess'); }, onShowSavingAlert: function onShowSavingAlert() { return Object(_reducers_alerts__WEBPACK_IMPORTED_MODULE_10__["showAlertWithTimeout"])(dispatch, 'saving'); }, onUpdatedProject: function onUpdatedProject(projectId, loadingState) { return dispatch(Object(_reducers_project_state__WEBPACK_IMPORTED_MODULE_13__["doneUpdatingProject"])(projectId, loadingState)); }, setAutoSaveTimeoutId: function setAutoSaveTimeoutId(id) { return dispatch(Object(_reducers_timeout__WEBPACK_IMPORTED_MODULE_11__["setAutoSaveTimeoutId"])(id)); } }; }; // Allow incoming props to override redux-provided props. Used to mock in tests. var mergeProps = function mergeProps(stateProps, dispatchProps, ownProps) { return Object.assign({}, stateProps, dispatchProps, ownProps); }; return Object(react_redux__WEBPACK_IMPORTED_MODULE_3__["connect"])(mapStateToProps, mapDispatchToProps, mergeProps)(ProjectSaverComponent); }; /***/ }), /***/ "./src/lib/query-parser-hoc.jsx": /*!**************************************!*\ !*** ./src/lib/query-parser-hoc.jsx ***! \**************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return QueryParserHOC; }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var query_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! query-string */ "./node_modules/query-string/index.js"); /* harmony import */ var query_string__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(query_string__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _tutorial_from_url__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tutorial-from-url */ "./src/lib/tutorial-from-url.js"); /* harmony import */ var _reducers_cards__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../reducers/cards */ "./src/reducers/cards.js"); /* harmony import */ var _reducers_modals__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../reducers/modals */ "./src/reducers/modals.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } /* Higher Order Component to get parameters from the URL query string and initialize redux state * @param {React.Component} WrappedComponent: component to render * @returns {React.Component} component with query parsing behavior */ var QueryParserHOC = function QueryParserHOC(WrappedComponent) { var QueryParserComponent = /*#__PURE__*/ function (_React$Component) { _inherits(QueryParserComponent, _React$Component); function QueryParserComponent(props) { var _this; _classCallCheck(this, QueryParserComponent); _this = _possibleConstructorReturn(this, _getPrototypeOf(QueryParserComponent).call(this, props)); var queryParams = query_string__WEBPACK_IMPORTED_MODULE_2___default.a.parse(location.search); var tutorialId = Object(_tutorial_from_url__WEBPACK_IMPORTED_MODULE_4__["detectTutorialId"])(queryParams); if (tutorialId) { if (tutorialId === 'all') { _this.openTutorials(); } else { _this.setActiveCards(tutorialId); } } return _this; } _createClass(QueryParserComponent, [{ key: "setActiveCards", value: function setActiveCards(tutorialId) { this.props.onUpdateReduxDeck(tutorialId); } }, { key: "openTutorials", value: function openTutorials() { this.props.onOpenTipsLibrary(); } }, { key: "render", value: function render() { var _this$props = this.props, onOpenTipsLibrary = _this$props.onOpenTipsLibrary, onUpdateReduxDeck = _this$props.onUpdateReduxDeck, componentProps = _objectWithoutProperties(_this$props, ["onOpenTipsLibrary", "onUpdateReduxDeck"]); return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(WrappedComponent, componentProps); } }]); return QueryParserComponent; }(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component); QueryParserComponent.propTypes = { onOpenTipsLibrary: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onUpdateReduxDeck: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func }; var mapDispatchToProps = function mapDispatchToProps(dispatch) { return { onOpenTipsLibrary: function onOpenTipsLibrary() { dispatch(Object(_reducers_modals__WEBPACK_IMPORTED_MODULE_6__["openTipsLibrary"])()); }, onUpdateReduxDeck: function onUpdateReduxDeck(tutorialId) { dispatch(Object(_reducers_cards__WEBPACK_IMPORTED_MODULE_5__["activateDeck"])(tutorialId)); } }; }; return Object(react_redux__WEBPACK_IMPORTED_MODULE_3__["connect"])(null, mapDispatchToProps)(QueryParserComponent); }; /***/ }), /***/ "./src/lib/randomize-sprite-position.js": /*!**********************************************!*\ !*** ./src/lib/randomize-sprite-position.js ***! \**********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); var randomizeSpritePosition = function randomizeSpritePosition(spriteObject) { // https://github.com/LLK/scratch-flash/blob/689f3c79a7e8b2e98f5be80056d877f303a8d8ba/src/Scratch.as#L1385 var randomX = Math.floor(200 * Math.random() - 100); var randomY = Math.floor(100 * Math.random() - 50); if (spriteObject.hasOwnProperty('json')) { // Library sprite object spriteObject.json.scratchX = randomX; spriteObject.json.scratchY = randomY; } else if (spriteObject.hasOwnProperty('x') && spriteObject.hasOwnProperty('y')) { // Scratch 3 sprite object spriteObject.x = randomX; spriteObject.y = randomY; } }; /* harmony default export */ __webpack_exports__["default"] = (randomizeSpritePosition); /***/ }), /***/ "./src/lib/save-project-to-server.js": /*!*******************************************!*\ !*** ./src/lib/save-project-to-server.js ***! \*******************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var query_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! query-string */ "./node_modules/query-string/index.js"); /* harmony import */ var query_string__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(query_string__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var xhr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! xhr */ "./node_modules/xhr/index.js"); /* harmony import */ var xhr__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(xhr__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _lib_storage__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lib/storage */ "./src/lib/storage.js"); /** * Save a project JSON to the project server. * This should eventually live in scratch-www. * @param {number} projectId the ID of the project, null if a new project. * @param {object} vmState the JSON project representation. * @param {object} params the request params. * @property {?number} params.originalId the original project ID if a copy/remix. * @property {?boolean} params.isCopy a flag indicating if this save is creating a copy. * @property {?boolean} params.isRemix a flag indicating if this save is creating a remix. * @property {?string} params.title the title of the project. * @return {Promise} A promise that resolves when the network request resolves. */ /* harmony default export */ __webpack_exports__["default"] = (function (projectId, vmState, params) { var opts = { body: vmState, // If we set json:true then the body is double-stringified, so don't headers: { 'Content-Type': 'application/json' }, withCredentials: true }; var creatingProject = projectId === null || typeof projectId === 'undefined'; var queryParams = {}; if (params.hasOwnProperty('originalId')) queryParams.original_id = params.originalId; if (params.hasOwnProperty('isCopy')) queryParams.is_copy = params.isCopy; if (params.hasOwnProperty('isRemix')) queryParams.is_remix = params.isRemix; if (params.hasOwnProperty('title')) queryParams.title = params.title; var qs = query_string__WEBPACK_IMPORTED_MODULE_0___default.a.stringify(queryParams); if (qs) qs = "?".concat(qs); if (creatingProject) { Object.assign(opts, { method: 'post', url: "".concat(_lib_storage__WEBPACK_IMPORTED_MODULE_2__["default"].projectHost, "/").concat(qs) }); } else { Object.assign(opts, { method: 'put', url: "".concat(_lib_storage__WEBPACK_IMPORTED_MODULE_2__["default"].projectHost, "/").concat(projectId).concat(qs) }); } return new Promise(function (resolve, reject) { xhr__WEBPACK_IMPORTED_MODULE_1___default()(opts, function (err, response) { if (err) return reject(err); var body; try { // Since we didn't set json: true, we have to parse manually body = JSON.parse(response.body); } catch (e) { return reject(e); } body.id = projectId; if (creatingProject) { body.id = body['content-name']; } resolve(body); }); }); }); /***/ }), /***/ "./src/lib/screen-utils.js": /*!*********************************!*\ !*** ./src/lib/screen-utils.js ***! \*********************************/ /*! exports provided: getStageDimensions, resolveStageSize, stageSizeToTransform */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getStageDimensions", function() { return getStageDimensions; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resolveStageSize", function() { return resolveStageSize; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stageSizeToTransform", function() { return stageSizeToTransform; }); /* harmony import */ var _lib_layout_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../lib/layout-constants */ "./src/lib/layout-constants.js"); /** * @typedef {object} StageDimensions * @property {int} height - the height to be used for the stage in the current situation. * @property {int} width - the width to be used for the stage in the current situation. * @property {number} scale - the scale factor from the stage's default size to its current size. * @property {int} heightDefault - the height of the stage in its default (large) size. * @property {int} widthDefault - the width of the stage in its default (large) size. */ var STAGE_DIMENSION_DEFAULTS = { // referencing css/units.css, // spacingBorderAdjustment = 2 * $full-screen-top-bottom-margin + // 2 * $full-screen-border-width fullScreenSpacingBorderAdjustment: 12, // referencing css/units.css, // menuHeightAdjustment = $stage-menu-height menuHeightAdjustment: 44 }; /** * Resolve the current GUI and browser state to an actual stage size enum value. * @param {STAGE_SIZE_MODES} stageSizeMode - the state of the stage size toggle button. * @param {boolean} isFullSize - true if the window is large enough for the large stage at its full size. * @return {STAGE_DISPLAY_SIZES} - the stage size enum value we should use in this situation. */ var resolveStageSize = function resolveStageSize(stageSizeMode, isFullSize) { if (stageSizeMode === _lib_layout_constants__WEBPACK_IMPORTED_MODULE_0__["STAGE_SIZE_MODES"].small) { return _lib_layout_constants__WEBPACK_IMPORTED_MODULE_0__["STAGE_DISPLAY_SIZES"].small; } if (isFullSize) { return _lib_layout_constants__WEBPACK_IMPORTED_MODULE_0__["STAGE_DISPLAY_SIZES"].large; } return _lib_layout_constants__WEBPACK_IMPORTED_MODULE_0__["STAGE_DISPLAY_SIZES"].largeConstrained; }; /** * Retrieve info used to determine the actual stage size based on the current GUI and browser state. * @param {STAGE_DISPLAY_SIZES} stageSize - the current fully-resolved stage size. * @param {boolean} isFullScreen - true if full-screen mode is enabled. * @return {StageDimensions} - an object describing the dimensions of the stage. */ var getStageDimensions = function getStageDimensions(stageSize, isFullScreen) { var stageDimensions = { heightDefault: _lib_layout_constants__WEBPACK_IMPORTED_MODULE_0__["default"].standardStageHeight, widthDefault: _lib_layout_constants__WEBPACK_IMPORTED_MODULE_0__["default"].standardStageWidth, height: 0, width: 0, scale: 0 }; if (isFullScreen) { stageDimensions.height = window.innerHeight - STAGE_DIMENSION_DEFAULTS.menuHeightAdjustment - STAGE_DIMENSION_DEFAULTS.fullScreenSpacingBorderAdjustment; stageDimensions.width = stageDimensions.height + stageDimensions.height / 3; if (stageDimensions.width > window.innerWidth) { stageDimensions.width = window.innerWidth; stageDimensions.height = stageDimensions.width * .75; } stageDimensions.scale = stageDimensions.width / stageDimensions.widthDefault; } else { stageDimensions.scale = _lib_layout_constants__WEBPACK_IMPORTED_MODULE_0__["STAGE_DISPLAY_SCALES"][stageSize]; stageDimensions.height = stageDimensions.scale * stageDimensions.heightDefault; stageDimensions.width = stageDimensions.scale * stageDimensions.widthDefault; } // Round off dimensions to prevent resampling/blurriness stageDimensions.height = Math.round(stageDimensions.height); stageDimensions.width = Math.round(stageDimensions.width); return stageDimensions; }; /** * Take a pair of sizes for the stage (a target height and width and a default height and width), * calculate the ratio between them, and return a CSS transform to scale to that ratio. * @param {object} sizeInfo An object containing dimensions of the target and default stage sizes. * @param {number} sizeInfo.width The target width * @param {number} sizeInfo.height The target height * @param {number} sizeInfo.widthDefault The default width * @param {number} sizeInfo.heightDefault The default height * @returns {object} the CSS transform */ var stageSizeToTransform = function stageSizeToTransform(_ref) { var width = _ref.width, height = _ref.height, widthDefault = _ref.widthDefault, heightDefault = _ref.heightDefault; var scaleX = width / widthDefault; var scaleY = height / heightDefault; if (scaleX === 1 && scaleY === 1) { // Do not set a transform if the scale is 1 because // it messes up `position: fixed` elements like the context menu. return; } return { transform: "scale(".concat(scaleX, ",").concat(scaleY, ")") }; }; /***/ }), /***/ "./src/lib/shared-messages.js": /*!************************************!*\ !*** ./src/lib/shared-messages.js ***! \************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-intl */ "./node_modules/react-intl/lib/index.es.js"); /* harmony default export */ __webpack_exports__["default"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_0__["defineMessages"])({ backdrop: { "id": "gui.sharedMessages.backdrop", "defaultMessage": "backdrop{index}" }, costume: { "id": "gui.sharedMessages.costume", "defaultMessage": "costume{index}" }, sprite: { "id": "gui.sharedMessages.sprite", "defaultMessage": "Sprite{index}" }, pop: { "id": "gui.sharedMessages.pop", "defaultMessage": "pop" }, replaceProjectWarning: { "id": "gui.sharedMessages.replaceProjectWarning", "defaultMessage": "Replace contents of the current project?" }, loadFromComputerTitle: { "id": "gui.sharedMessages.loadFromComputerTitle", "defaultMessage": "Load from your computer" } })); /***/ }), /***/ "./src/lib/sortable-hoc.jsx": /*!**********************************!*\ !*** ./src/lib/sortable-hoc.jsx ***! \**********************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); /* harmony import */ var _drag_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./drag-utils */ "./src/lib/drag-utils.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var SortableHOC = function SortableHOC(WrappedComponent) { var SortableWrapper = /*#__PURE__*/ function (_React$Component) { _inherits(SortableWrapper, _React$Component); function SortableWrapper(props) { var _this; _classCallCheck(this, SortableWrapper); _this = _possibleConstructorReturn(this, _getPrototypeOf(SortableWrapper).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_0___default()(_assertThisInitialized(_this), ['setRef', 'handleAddSortable', 'handleRemoveSortable']); _this.sortableRefs = []; _this.boxes = null; _this.ref = null; _this.containerBox = null; return _this; } _createClass(SortableWrapper, [{ key: "componentWillReceiveProps", value: function componentWillReceiveProps(newProps) { if (newProps.dragInfo.dragging && !this.props.dragInfo.dragging) { // Drag just started, snapshot the sorted bounding boxes for sortables. this.boxes = this.sortableRefs.map(function (el) { return el && el.getBoundingClientRect(); }); this.boxes.sort(function (a, b) { // Sort top-to-bottom, left-to-right. if (a.top === b.top) return a.left - b.left; return a.top - b.top; }); if (!this.ref) { throw new Error('The containerRef must be assigned to the sortable area'); } this.containerBox = this.ref.getBoundingClientRect(); } else if (!newProps.dragInfo.dragging && this.props.dragInfo.dragging) { var newIndex = this.getMouseOverIndex(); if (newIndex !== null) { this.props.onDrop(Object.assign({}, this.props.dragInfo, { newIndex: newIndex })); } } } }, { key: "handleAddSortable", value: function handleAddSortable(node) { this.sortableRefs.push(node); } }, { key: "handleRemoveSortable", value: function handleRemoveSortable(node) { var index = this.sortableRefs.indexOf(node); this.sortableRefs = this.sortableRefs.slice(0, index).concat(this.sortableRefs.slice(index + 1)); } }, { key: "getOrdering", value: function getOrdering(items, draggingIndex, newIndex) { // An "Ordering" is an array of indices, where the position array value corresponds // to the position of the item in props.items, and the index of the value // is the index at which the item should appear. // That is, if props.items is ['a', 'b', 'c', 'd'], and we want the GUI to display // ['b', 'c', 'a, 'd'], the value of "ordering" would be [1, 2, 0, 3]. // This mapping is used because it is easy to translate to flexbox ordering, // the `order` property for item N is ordering.indexOf(N). // If the user-facing order matches props.items, the ordering is just [0, 1, 2, ...] var ordering = Array(this.props.items.length).fill(0).map(function (_, i) { return i; }); var isNumber = function isNumber(v) { return typeof v === 'number' && !isNaN(v); }; if (isNumber(draggingIndex) && isNumber(newIndex)) { ordering = ordering.slice(0, draggingIndex).concat(ordering.slice(draggingIndex + 1)); ordering.splice(newIndex, 0, draggingIndex); } return ordering; } }, { key: "getMouseOverIndex", value: function getMouseOverIndex() { // MouseOverIndex is the index that the current drag wants to place the // the dragging object. Obviously only exists if there is a drag (i.e. currentOffset). // Return null if outside the container, zero if there are no boxes. var mouseOverIndex = null; if (this.props.dragInfo.currentOffset) { var _this$props$dragInfo$ = this.props.dragInfo.currentOffset, x = _this$props$dragInfo$.x, y = _this$props$dragInfo$.y; var _this$containerBox = this.containerBox, top = _this$containerBox.top, left = _this$containerBox.left, bottom = _this$containerBox.bottom, right = _this$containerBox.right; if (x >= left && x <= right && y >= top && y <= bottom) { if (this.boxes.length === 0) { mouseOverIndex = 0; } else { mouseOverIndex = Object(_drag_utils__WEBPACK_IMPORTED_MODULE_4__["indexForPositionOnList"])(this.props.dragInfo.currentOffset, this.boxes); } } } return mouseOverIndex; } }, { key: "setRef", value: function setRef(el) { this.ref = el; } }, { key: "render", value: function render() { var _this$props = this.props, _this$props$dragInfo = _this$props.dragInfo, dragIndex = _this$props$dragInfo.index, dragType = _this$props$dragInfo.dragType, items = _this$props.items; var mouseOverIndex = this.getMouseOverIndex(); var ordering = this.getOrdering(items, dragIndex, mouseOverIndex); return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(WrappedComponent, _extends({ containerRef: this.setRef, draggingIndex: dragIndex, draggingType: dragType, mouseOverIndex: mouseOverIndex, ordering: ordering, onAddSortable: this.handleAddSortable, onRemoveSortable: this.handleRemoveSortable }, this.props)); } }]); return SortableWrapper; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.Component); SortableWrapper.propTypes = { dragInfo: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.shape({ currentOffset: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.shape({ x: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, y: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number }), dragType: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, dragging: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, index: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number }), items: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.shape({ url: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, name: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string.isRequired })), onClose: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, onDrop: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func }; var mapStateToProps = function mapStateToProps(state) { return { dragInfo: state.scratchGui.assetDrag }; }; var mapDispatchToProps = function mapDispatchToProps() { return {}; }; return Object(react_redux__WEBPACK_IMPORTED_MODULE_3__["connect"])(mapStateToProps, mapDispatchToProps)(SortableWrapper); }; /* harmony default export */ __webpack_exports__["default"] = (SortableHOC); /***/ }), /***/ "./src/lib/storage.js": /*!****************************!*\ !*** ./src/lib/storage.js ***! \****************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var scratch_storage__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! scratch-storage */ "./node_modules/scratch-storage/src/index.js"); /* harmony import */ var scratch_storage__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(scratch_storage__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _default_project__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./default-project */ "./src/lib/default-project/index.js"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } /** * Wrapper for ScratchStorage which adds default web sources. * @todo make this more configurable */ var Storage = /*#__PURE__*/ function (_ScratchStorage) { _inherits(Storage, _ScratchStorage); function Storage() { var _this; _classCallCheck(this, Storage); _this = _possibleConstructorReturn(this, _getPrototypeOf(Storage).call(this)); _this.cacheDefaultProject(); // HACK: Use class property on myBlocks element to detect offline mode _this.localUrl = window.location.href; _this.localUrl = _this.localUrl.substring(0, _this.localUrl.lastIndexOf('/')); _this.offlinemode = document.getElementById("myBlocks").className == "offlinemode"; return _this; } _createClass(Storage, [{ key: "addOfficialScratchWebStores", value: function addOfficialScratchWebStores() { this.addWebStore([this.AssetType.Project], this.getProjectGetConfig.bind(this), this.getProjectCreateConfig.bind(this), this.getProjectUpdateConfig.bind(this)); this.addWebStore([this.AssetType.ImageVector, this.AssetType.ImageBitmap, this.AssetType.Sound], this.getAssetGetConfig.bind(this), // We set both the create and update configs to the same method because // storage assumes it should update if there is an assetId, but the // asset store uses the assetId as part of the create URI. this.getAssetCreateConfig.bind(this), this.getAssetCreateConfig.bind(this)); this.addWebStore([this.AssetType.Sound], function (asset) { return "static/extension-assets/scratch3_music/".concat(asset.assetId, ".").concat(asset.dataFormat); }); } }, { key: "setProjectHost", value: function setProjectHost(projectHost) { this.projectHost = projectHost; } }, { key: "getProjectGetConfig", value: function getProjectGetConfig(projectAsset) { return "".concat(this.projectHost, "/").concat(projectAsset.assetId); } }, { key: "getProjectCreateConfig", value: function getProjectCreateConfig() { return { url: "".concat(this.projectHost, "/"), withCredentials: true }; } }, { key: "getProjectUpdateConfig", value: function getProjectUpdateConfig(projectAsset) { return { url: "".concat(this.projectHost, "/").concat(projectAsset.assetId), withCredentials: true }; } }, { key: "setAssetHost", value: function setAssetHost(assetHost) { this.assetHost = assetHost; } }, { key: "getAssetGetConfig", value: function getAssetGetConfig(asset) { return "".concat(this.assetHost, "/internalapi/asset/").concat(asset.assetId, ".").concat(asset.dataFormat, "/get/"); } }, { key: "getAssetCreateConfig", value: function getAssetCreateConfig(asset) { return { // There is no such thing as updating assets, but storage assumes it // should update if there is an assetId, and the asset store uses the // assetId as part of the create URI. So, force the method to POST. // Then when storage finds this config to use for the "update", still POSTs method: 'post', url: "".concat(this.assetHost, "/").concat(asset.assetId, ".").concat(asset.dataFormat), withCredentials: true }; } }, { key: "setTranslatorFunction", value: function setTranslatorFunction(translator) { this.translator = translator; this.cacheDefaultProject(); } }, { key: "cacheDefaultProject", value: function cacheDefaultProject() { var _this2 = this; var defaultProjectAssets = Object(_default_project__WEBPACK_IMPORTED_MODULE_1__["default"])(this.translator); defaultProjectAssets.forEach(function (asset) { return _this2.builtinHelper._store(_this2.AssetType[asset.assetType], _this2.DataFormat[asset.dataFormat], asset.data, asset.id); }); } // HACK: Override load in storage to get contents locally (offline mode) }, { key: "load", value: function load(assetType, assetId, dataFormat) { // New promise to encapsulate XMLHttpRequest // Need because Fetch API used by default is not supported on file:// (prerequisite for Cordova) var makeRequest = function makeRequest(method, url, format) { return new Promise(function (resolve, reject) { var xhr = new XMLHttpRequest(); if (format != "svg") xhr.responseType = "arraybuffer"; xhr.open(method, url); xhr.onload = function () { if (this.status == 0 || this.status >= 200 && this.status < 300) { resolve(format != "svg" ? new Uint8Array(xhr.response) : new TextEncoder().encode(xhr.responseText)); } else { reject({ status: this.status, statusText: xhr.statusText }); } }; xhr.onerror = function () { reject({ status: this.status, statusText: xhr.statusText }); }; xhr.send(); }); }; if (this.offlinemode && (assetType.runtimeFormat == "svg" || assetType.runtimeFormat == "wav" || assetType.runtimeFormat == "png")) { var url = this.localUrl + '/static/internal-assets/' + assetId + "." + assetType.runtimeFormat; var asset = new scratch_storage__WEBPACK_IMPORTED_MODULE_0___default.a.Asset(assetType, assetId); var dataFormat = assetType.runtimeFormat; var loadLocally = function loadLocally() { return makeRequest('GET', url, dataFormat).then(function (response) { asset.setData(response, dataFormat); Promise.resolve(asset); }).catch(function (err) { console.log("Error loading local resource " + url); console.log(err); }); }; return loadLocally().then(function () { return asset; }); } return _get(_getPrototypeOf(Storage.prototype), "load", this).call(this, assetType, assetId, dataFormat); } }]); return Storage; }(scratch_storage__WEBPACK_IMPORTED_MODULE_0___default.a); var storage = new Storage(); /* harmony default export */ __webpack_exports__["default"] = (storage); /***/ }), /***/ "./src/lib/supported-browser.js": /*!**************************************!*\ !*** ./src/lib/supported-browser.js ***! \**************************************/ /*! exports provided: default, recommendedBrowser */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return supportedBrowser; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "recommendedBrowser", function() { return recommendedBrowser; }); /* harmony import */ var bowser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! bowser */ "./node_modules/bowser/src/bowser.js"); /* harmony import */ var bowser__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(bowser__WEBPACK_IMPORTED_MODULE_0__); var minVersions = { chrome: '63', msedge: '15', firefox: '57', safari: '11' }; /** * Helper function to determine if the browser is supported at all. * @returns {boolean} False if the platform is definitely not supported. */ var supportedBrowser = function supportedBrowser() { if (bowser__WEBPACK_IMPORTED_MODULE_0___default.a.msie) { return false; } return true; }; /** * Helper function to determine if the browser meets the minimum recommended version * @returns {boolean} False if the browser isn't a recommended browser, or doesn't * meet the minimum version for recommended browsers. * NOTE: uses strict_mode==true so that any browser not listed in the minVersions * always returns false */ var recommendedBrowser = function recommendedBrowser() { return !bowser__WEBPACK_IMPORTED_MODULE_0___default.a.isUnsupportedBrowser(minVersions, true); }; /***/ }), /***/ "./src/lib/throttled-property-hoc.jsx": /*!********************************************!*\ !*** ./src/lib/throttled-property-hoc.jsx ***! \********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } /* Higher Order Component to throttle updates to specific props. * Why? Because certain prop updates are expensive, and need to be throttled. * This allows renders when other properties change, and will use the last * rendered value of a prop for comparison. * @param {string} propName the name of the prop to throttle updates from. * @param {string} throttleTime the minimum time between updates to that specific property. * @returns {function} a function that accepts a component to wrap. */ var ThrottledPropertyHOC = function ThrottledPropertyHOC(propName, throttleTime) { /** * The function to be called with a React component to wrap it. * @param {React.Component} WrappedComponent - Component to wrap with throttler. * @returns {React.Component} the component wrapped with the throttler. */ return function (WrappedComponent) { var ThrottledPropertyWrapper = /*#__PURE__*/ function (_React$Component) { _inherits(ThrottledPropertyWrapper, _React$Component); function ThrottledPropertyWrapper() { _classCallCheck(this, ThrottledPropertyWrapper); return _possibleConstructorReturn(this, _getPrototypeOf(ThrottledPropertyWrapper).apply(this, arguments)); } _createClass(ThrottledPropertyWrapper, [{ key: "shouldComponentUpdate", value: function shouldComponentUpdate(nextProps) { for (var property in nextProps) { if (property !== propName && this.props[property] !== nextProps[property]) { return true; // Always update if another property has changed } } // If only that prop has changed, allow update to go to render based // on _lastRenderedTime and _lastRenderTime are updated in render if (nextProps[propName] !== this._lastRenderedValue && Date.now() - this._lastRenderTime > throttleTime) { return true; // Allow this update to go to render } return false; } }, { key: "render", value: function render() { this._lastRenderTime = Date.now(); this._lastRenderedValue = this.props[propName]; return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(WrappedComponent, this.props); } }]); return ThrottledPropertyWrapper; }(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component); return ThrottledPropertyWrapper; }; }; /* harmony default export */ __webpack_exports__["default"] = (ThrottledPropertyHOC); /***/ }), /***/ "./src/lib/titled-hoc.jsx": /*!********************************!*\ !*** ./src/lib/titled-hoc.jsx ***! \********************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TitledHOC; }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash.bindall */ "./node_modules/lodash.bindall/index.js"); /* harmony import */ var lodash_bindall__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_bindall__WEBPACK_IMPORTED_MODULE_1__); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } /* Higher Order Component to get and set the project title * @param {React.Component} WrappedComponent component to receive project title related props * @returns {React.Component} component with project loading behavior */ var TitledHOC = function TitledHOC(WrappedComponent) { var TitledComponent = /*#__PURE__*/ function (_React$Component) { _inherits(TitledComponent, _React$Component); function TitledComponent(props) { var _this; _classCallCheck(this, TitledComponent); _this = _possibleConstructorReturn(this, _getPrototypeOf(TitledComponent).call(this, props)); lodash_bindall__WEBPACK_IMPORTED_MODULE_1___default()(_assertThisInitialized(_this), ['handleUpdateProjectTitle']); _this.state = { projectTitle: null }; return _this; } _createClass(TitledComponent, [{ key: "handleUpdateProjectTitle", value: function handleUpdateProjectTitle(newTitle) { this.setState({ projectTitle: newTitle }); } }, { key: "render", value: function render() { return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(WrappedComponent, _extends({ canEditTitle: true, projectTitle: this.state.projectTitle, onUpdateProjectTitle: this.handleUpdateProjectTitle }, this.props)); } }]); return TitledComponent; }(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component); return TitledComponent; }; /***/ }), /***/ "./src/lib/touch-utils.js": /*!********************************!*\ !*** ./src/lib/touch-utils.js ***! \********************************/ /*! exports provided: getEventXY */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEventXY", function() { return getEventXY; }); var getEventXY = function getEventXY(e) { if (e.touches && e.touches[0]) { return { x: e.touches[0].clientX, y: e.touches[0].clientY }; } else if (e.changedTouches && e.changedTouches[0]) { return { x: e.changedTouches[0].clientX, y: e.changedTouches[0].clientY }; } return { x: e.clientX, y: e.clientY }; }; /***/ }), /***/ "./src/lib/tutorial-from-url.js": /*!**************************************!*\ !*** ./src/lib/tutorial-from-url.js ***! \**************************************/ /*! exports provided: detectTutorialId */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "detectTutorialId", function() { return detectTutorialId; }); /* harmony import */ var _libraries_decks_index_jsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./libraries/decks/index.jsx */ "./src/lib/libraries/decks/index.jsx"); /* harmony import */ var _analytics__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./analytics */ "./src/lib/analytics.js"); /** * @fileoverview * Utility function to detect tutorial id from query paramenter on the URL. */ /** * Get the tutorial id from the given numerical id (representing the * url id of the tutorial). * @param {number} urlId The URL Id for the tutorial * @returns {string} The string id for the tutorial, or null if the URL ID * was not found. */ var getDeckIdFromUrlId = function getDeckIdFromUrlId(urlId) { for (var deckId in _libraries_decks_index_jsx__WEBPACK_IMPORTED_MODULE_0__["default"]) { if (_libraries_decks_index_jsx__WEBPACK_IMPORTED_MODULE_0__["default"][deckId].urlId === urlId) { _analytics__WEBPACK_IMPORTED_MODULE_1__["default"].event({ category: 'how-to', action: 'load from url', label: "".concat(deckId) }); return deckId; } } return null; }; /** * Check if there's a tutorial id provided as a query parameter in the URL. * Return the corresponding tutorial id or null if not found. * @param {object} queryParams the results of parsing the query string * @return {string} The ID of the requested tutorial or null if no tutorial was * requested or found. */ var detectTutorialId = function detectTutorialId(queryParams) { var tutorialID = Array.isArray(queryParams.tutorial) ? queryParams.tutorial[0] : queryParams.tutorial; if (typeof tutorialID === 'undefined') return null; if (tutorialID === 'all') return tutorialID; return getDeckIdFromUrlId(tutorialID); }; /***/ }), /***/ "./src/lib/variable-utils.js": /*!***********************************!*\ !*** ./src/lib/variable-utils.js ***! \***********************************/ /*! exports provided: getVariable, getVariableValue, setVariableValue */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getVariable", function() { return getVariable; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getVariableValue", function() { return getVariableValue; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setVariableValue", function() { return setVariableValue; }); // Utility functions for updating variables in the VM // TODO (VM#1145) these should be moved to top-level VM API var getVariable = function getVariable(vm, targetId, variableId) { var target = targetId ? vm.runtime.getTargetById(targetId) : vm.runtime.getTargetForStage(); return target.variables[variableId]; }; var getVariableValue = function getVariableValue(vm, targetId, variableId) { var variable = getVariable(vm, targetId, variableId); // If array, return a new copy for mutating, ensuring that updates stay immutable. if (variable.value instanceof Array) return variable.value.slice(); return variable.value; }; var setVariableValue = function setVariableValue(vm, targetId, variableId, value) { getVariable(vm, targetId, variableId).value = value; }; /***/ }), /***/ "./src/lib/video/camera.js": /*!*********************************!*\ !*** ./src/lib/video/camera.js ***! \*********************************/ /*! exports provided: requestVideoStream, requestDisableVideo */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "requestVideoStream", function() { return requestVideoStream; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "requestDisableVideo", function() { return requestDisableVideo; }); /* harmony import */ var get_user_media_promise__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! get-user-media-promise */ "./node_modules/get-user-media-promise/lib/get-user-media-promise.js"); /* harmony import */ var get_user_media_promise__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(get_user_media_promise__WEBPACK_IMPORTED_MODULE_0__); // Single Setup For All Video Streams used by the GUI // While VideoProvider uses a private _singleSetup // property to ensure that each instance of a VideoProvider // use the same setup, this ensures that all instances // of VideoProviders use a single stream. This way, closing a camera modal // does not affect the video on the stage, and a program running and disabling // video on the stage will not affect the camera modal's video. var requestStack = []; var requestVideoStream = function requestVideoStream(videoDesc) { var streamPromise; if (requestStack.length === 0) { streamPromise = get_user_media_promise__WEBPACK_IMPORTED_MODULE_0___default()({ audio: false, video: videoDesc }); requestStack.push(streamPromise); } else if (requestStack.length > 0) { streamPromise = requestStack[0]; requestStack.push(true); } return streamPromise; }; var requestDisableVideo = function requestDisableVideo() { requestStack.pop(); if (requestStack.length > 0) return false; return true; }; /***/ }), /***/ "./src/lib/video/modal-video-manager.js": /*!**********************************************!*\ !*** ./src/lib/video/modal-video-manager.js ***! \**********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _video_provider_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./video-provider.js */ "./src/lib/video/video-provider.js"); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } /** * Video Manager for Camera Modal */ var ModalVideoManager = /*#__PURE__*/ function () { function ModalVideoManager(canvas) { _classCallCheck(this, ModalVideoManager); this._videoProvider = new _video_provider_js__WEBPACK_IMPORTED_MODULE_0__["default"](); this._frameTimeout = 16; this._canvas = canvas; // These values are double the stage dimensions so that the resulting // image does not have to get sized down to accomodate double resolution this._canvasWidth = 960; // Double Stage Width this._canvasHeight = 720; // Double Stage Height } _createClass(ModalVideoManager, [{ key: "enableVideo", value: function enableVideo(onPermissionSuccess, onVideoLoaded) { var thisContext = this; this._videoProvider.enableVideo(onVideoLoaded).then(function () { if (onPermissionSuccess) onPermissionSuccess(); var ctx = thisContext._canvas.getContext('2d'); ctx.scale(-1, 1); ctx.translate(thisContext._canvasWidth * -1, 0); if (onVideoLoaded) { thisContext._videoProvider.video.onloadeddata = function () { onVideoLoaded(); }; } thisContext._drawFrames(); }); } }, { key: "_drawFrames", value: function _drawFrames() { var _this = this; var video = this._videoProvider.video; this._videoFeedInterval = setInterval(function () { return _this._canvas.getContext('2d').drawImage(video, // source x, y, width, height 0, 0, video.videoWidth, video.videoHeight, // dest x, y, width, height 0, 0, _this._canvasWidth, _this._canvasHeight); }, this._frameTimeout); } }, { key: "takeSnapshot", value: function takeSnapshot() { clearInterval(this._videoFeedInterval); return this._canvas.toDataURL('image/png'); } }, { key: "clearSnapshot", value: function clearSnapshot() { this._drawFrames(); } }, { key: "disableVideo", value: function disableVideo() { this._videoProvider.disableVideo(); } }]); return ModalVideoManager; }(); /* harmony default export */ __webpack_exports__["default"] = (ModalVideoManager); /***/ }), /***/ "./src/lib/video/video-provider.js": /*!*****************************************!*\ !*** ./src/lib/video/video-provider.js ***! \*****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _camera_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./camera.js */ "./src/lib/video/camera.js"); /* harmony import */ var _log_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../log.js */ "./src/lib/log.js"); function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } /** * Video Manager for video extensions. */ var VideoProvider = /*#__PURE__*/ function () { function VideoProvider() { _classCallCheck(this, VideoProvider); /** * Default value for mirrored frames. * @type boolean */ this.mirror = true; /** * Cache frames for this many ms. * @type number */ this._frameCacheTimeout = 16; /** * DOM Video element * @private */ this._video = null; /** * Usermedia stream track * @private */ this._track = null; /** * Stores some canvas/frame data per resolution/mirror states */ this._workspace = []; } _createClass(VideoProvider, [{ key: "enableVideo", /** * Request video be enabled. Sets up video, creates video skin and enables preview. * * @return {Promise.