@scratch/scratch-vm 11.2.0-svg-sanitization.3 → 11.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,6 +6,13 @@
|
|
|
6
6
|
* MIT Licence
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
/*!
|
|
10
|
+
* CSS color - Resolve, parse, convert CSS color.
|
|
11
|
+
* @license MIT
|
|
12
|
+
* @copyright asamuzaK (Kazz)
|
|
13
|
+
* @see {@link https://github.com/asamuzaK/cssColor/blob/main/LICENSE}
|
|
14
|
+
*/
|
|
15
|
+
|
|
9
16
|
/*!
|
|
10
17
|
* Copyright (c) 2015-2020, Salesforce.com, Inc.
|
|
11
18
|
* All rights reserved.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.VirtualMachine=t():e.VirtualMachine=t()}(self,()=>(()=>{var e={329:(e,t,n)=>{var r=n(2491),i=n(2216),o={debug:["cyan"],info:["purple"],warn:["yellow",!0],error:["red",!0]},s=new r;s.write=function(e,t,n){console.log;console[t]&&console[t].apply&&console[t].apply(console,["%c"+e+" %c"+t,i("gray"),i.apply(i,o[t])].concat(n))},s.pipe=function(){},e.exports=s},1920:e=>{function t(){this._events={}}t.prototype={on:function(e,t){this._events||(this._events={});var n=this._events;return(n[e]||(n[e]=[])).push(t),this},removeListener:function(e,t){var n,r=this._events[e]||[];for(n=r.length-1;n>=0&&r[n];n--)r[n]!==t&&r[n].cb!==t||r.splice(n,1)},removeAllListeners:function(e){e?this._events[e]&&(this._events[e]=[]):this._events={}},listeners:function(e){return this._events&&this._events[e]||[]},emit:function(e){this._events||(this._events={});var t,n=Array.prototype.slice.call(arguments,1),r=this._events[e]||[];for(t=r.length-1;t>=0&&r[t];t--)r[t].apply(this,n);return this},when:function(e,t){return this.once(e,t,!0)},once:function(e,t,n){if(!t)return this;function r(){n||this.removeListener(e,r),t.apply(this,arguments)&&n&&this.removeListener(e,r)}return r.cb=t,this.on(e,r),this}},t.mixin=function(e){var n,r=t.prototype;for(n in r)r.hasOwnProperty(n)&&(e.prototype[n]=r[n])},e.exports=t},2216:e=>{var t={black:"#000",red:"#c23621",green:"#25bc26",yellow:"#bbbb00",blue:"#492ee1",magenta:"#d338d3",cyan:"#33bbc8",gray:"#808080",purple:"#708"};e.exports=function(e,n){return n?"color: #fff; background: "+t[e]+";":"color: "+t[e]+";"}},2491:(e,t,n)=>{function r(){}n(1920).mixin(r),r.prototype.write=function(e,t,n){this.emit("item",e,t,n)},r.prototype.end=function(){this.emit("end"),this.removeAllListeners()},r.prototype.pipe=function(e){var t=this;function n(){e.write.apply(e,Array.prototype.slice.call(arguments))}function r(){!e._isStdio&&e.end()}return t.emit("unpipe",e),e.emit("pipe",t),t.on("item",n),t.on("end",r),t.when("unpipe",function(i){var o=i===e||void 0===i;return o&&(t.removeListener("item",n),t.removeListener("end",r),e.emit("unpipe")),o}),e},r.prototype.unpipe=function(e){return this.emit("unpipe",e),this},r.prototype.format=function(e){throw new Error(["Warning: .format() is deprecated in Minilog v2! Use .pipe() instead. For example:","var Minilog = require('minilog');","Minilog"," .pipe(Minilog.backends.console.formatClean)"," .pipe(Minilog.backends.console);"].join("\n"))},r.mixin=function(e){var t,n=r.prototype;for(t in n)n.hasOwnProperty(t)&&(e.prototype[t]=n[t])},e.exports=r},2589:(e,t,n)=>{const r=n(3707);e.exports=class{constructor(){this.callbacks=[],this.nextResponseId=0}call(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return this.transferCall(e,t,null,...r)}transferCall(e,t,n){try{const{provider:s,isRemote:a}=this._getServiceProvider(e);if(s){for(var r=arguments.length,i=new Array(r>3?r-3:0),o=3;o<r;o++)i[o-3]=arguments[o];if(a)return this._remoteTransferCall(s,e,t,n,...i);const c=s[t].apply(s,i);return Promise.resolve(c)}return Promise.reject(new Error("Service not found: ".concat(e)))}catch(e){return Promise.reject(e)}}_isRemoteService(e){return this._getServiceProvider(e).isRemote}_remoteCall(e,t,n){for(var r=arguments.length,i=new Array(r>3?r-3:0),o=3;o<r;o++)i[o-3]=arguments[o];return this._remoteTransferCall(e,t,n,null,...i)}_remoteTransferCall(e,t,n,r){for(var i=arguments.length,o=new Array(i>4?i-4:0),s=4;s<i;s++)o[s-4]=arguments[s];return new Promise((i,s)=>{const a=this._storeCallbacks(i,s);o.length>0&&"function"==typeof o[o.length-1].yield&&o.pop(),r?e.postMessage({service:t,method:n,responseId:a,args:o},r):e.postMessage({service:t,method:n,responseId:a,args:o})})}_storeCallbacks(e,t){const n=this.nextResponseId++;return this.callbacks[n]=[e,t],n}_deliverResponse(e,t){try{const[n,r]=this.callbacks[e];delete this.callbacks[e],t.error?r(t.error):n(t.result)}catch(e){r.error("Dispatch callback failed: ".concat(JSON.stringify(e)))}}_onMessage(e,t){const n=t.data;let i;n.args=n.args||[],n.service?i="dispatch"===n.service?this._onDispatchMessage(e,n):this.call(n.service,n.method,...n.args):void 0===n.responseId?r.error("Dispatch caught malformed message from a worker: ".concat(JSON.stringify(t))):this._deliverResponse(n.responseId,n),i&&(void 0===n.responseId?r.error("Dispatch message missing required response ID: ".concat(JSON.stringify(t))):i.then(t=>e.postMessage({responseId:n.responseId,result:t}),t=>e.postMessage({responseId:n.responseId,error:t})))}_getServiceProvider(e){throw new Error("Could not get provider for ".concat(e,": _getServiceProvider not implemented"))}_onDispatchMessage(e,t){throw new Error("Unimplemented dispatch message handler cannot handle ".concat(t.method," method"))}}},3260:(e,t,n)=>{const r=n(2589),i=n(3707);e.exports=new class extends r{constructor(){super(),this._connectionPromise=new Promise(e=>{this._onConnect=e}),this.services={},this._onMessage=this._onMessage.bind(this,self),"undefined"!=typeof self&&(self.onmessage=this._onMessage)}get waitForConnection(){return this._connectionPromise}setService(e,t){return Object.prototype.hasOwnProperty.call(this.services,e)&&i.warn("Worker dispatch replacing existing service provider for ".concat(e)),this.services[e]=t,this.waitForConnection.then(()=>this._remoteCall(self,"dispatch","setService",e))}_getServiceProvider(e){const t=this.services[e];return{provider:t||self,isRemote:!t}}_onDispatchMessage(e,t){let n;switch(t.method){case"handshake":n=this._onConnect();break;case"terminate":setTimeout(()=>self.close(),0),n=Promise.resolve();break;default:i.error("Worker dispatch received message for unknown method: ".concat(t.method))}return n}}},3545:(e,t,n)=>{var r=n(2491),i=(new Date).valueOf().toString(36);function o(e){this.url=e.url||"",this.cache=[],this.timer=null,this.interval=e.interval||3e4,this.enabled=!0,this.jQuery=window.jQuery,this.extras={}}r.mixin(o),o.prototype.write=function(e,t,n){this.timer||this.init(),this.cache.push([e,t].concat(n))},o.prototype.init=function(){if(this.enabled&&this.jQuery){var e=this;this.timer=setTimeout(function(){var t,n,r=[],o=e.url;if(0==e.cache.length)return e.init();for(t=0;t<e.cache.length;t++)try{JSON.stringify(e.cache[t]),r.push(e.cache[t])}catch(e){}e.jQuery.isEmptyObject(e.extras)?(n=JSON.stringify({logs:r}),o=e.url+"?client_id="+i):n=JSON.stringify(e.jQuery.extend({logs:r},e.extras)),e.jQuery.ajax(o,{type:"POST",cache:!1,processData:!1,data:n,contentType:"application/json",timeout:1e4}).success(function(t,n,r){t.interval&&(e.interval=Math.max(1e3,t.interval))}).error(function(){e.interval=3e4}).always(function(){e.init()}),e.cache=[]},this.interval)}},o.prototype.end=function(){},o.jQueryWait=function(e){if("undefined"!=typeof window&&(window.jQuery||window.$))return e(window.jQuery||window.$);"undefined"!=typeof window&&setTimeout(function(){o.jQueryWait(e)},200)},e.exports=o},3707:(e,t,n)=>{const r=n(6824);r.enable(),e.exports=r("vm")},4932:(e,t,n)=>{var r=n(2491),i=n(8589),o=new r,s=Array.prototype.slice;(t=e.exports=function(e){var n=function(){return o.write(e,void 0,s.call(arguments)),n};return n.debug=function(){return o.write(e,"debug",s.call(arguments)),n},n.info=function(){return o.write(e,"info",s.call(arguments)),n},n.warn=function(){return o.write(e,"warn",s.call(arguments)),n},n.error=function(){return o.write(e,"error",s.call(arguments)),n},n.log=n.debug,n.suggest=t.suggest,n.format=o.format,n}).defaultBackend=t.defaultFormatter=null,t.pipe=function(e){return o.pipe(e)},t.end=t.unpipe=t.disable=function(e){return o.unpipe(e)},t.Transform=r,t.Filter=i,t.suggest=new i,t.enable=function(){return t.defaultFormatter?o.pipe(t.suggest).pipe(t.defaultFormatter).pipe(t.defaultBackend):o.pipe(t.suggest).pipe(t.defaultBackend)}},6178:(e,t,n)=>{var r=n(2491),i=!1,o=new r;o.write=function(e,t,n){if("undefined"!=typeof window&&"undefined"!=typeof JSON&&JSON.stringify&&JSON.parse)try{i||(i=window.localStorage.minilog?JSON.parse(window.localStorage.minilog):[]),i.push([(new Date).toString(),e,t,n]),window.localStorage.minilog=JSON.stringify(i)}catch(e){}},e.exports=o},6342:e=>{e.exports={ANGLE:"angle",BOOLEAN:"Boolean",COLOR:"color",NUMBER:"number",STRING:"string",MATRIX:"matrix",NOTE:"note",IMAGE:"image"}},6824:(e,t,n)=>{var r=n(4932),i=r.enable,o=r.disable,s="undefined"!=typeof navigator&&/chrome/i.test(navigator.userAgent),a=n(9925);if(r.defaultBackend=s?a.minilog:a,"undefined"!=typeof window){try{r.enable(JSON.parse(window.localStorage.minilogSettings))}catch(e){}if(window.location&&window.location.search){var c=RegExp("[?&]minilog=([^&]*)").exec(window.location.search);c&&r.enable(decodeURIComponent(c[1]))}}r.enable=function(){i.call(r,!0);try{window.localStorage.minilogSettings=JSON.stringify(!0)}catch(e){}return this},r.disable=function(){o.call(r);try{delete window.localStorage.minilogSettings}catch(e){}return this},(e.exports=r).backends={array:n(7585),browser:r.defaultBackend,localStorage:n(6178),jQuery:n(3545)}},7585:(e,t,n)=>{var r=n(2491),i=[],o=new r;o.write=function(e,t,n){i.push([e,t,n])},o.get=function(){return i},o.empty=function(){i=[]},e.exports=o},8589:(e,t,n)=>{var r=n(2491),i={debug:1,info:2,warn:3,error:4};function o(){this.enabled=!0,this.defaultResult=!0,this.clear()}function s(e,t){return e.n.test?e.n.test(t):e.n==t}r.mixin(o),o.prototype.allow=function(e,t){return this._white.push({n:e,l:i[t]}),this},o.prototype.deny=function(e,t){return this._black.push({n:e,l:i[t]}),this},o.prototype.clear=function(){return this._white=[],this._black=[],this},o.prototype.test=function(e,t){var n,r=Math.max(this._white.length,this._black.length);for(n=0;n<r;n++){if(this._white[n]&&s(this._white[n],e)&&i[t]>=this._white[n].l)return!0;if(this._black[n]&&s(this._black[n],e)&&i[t]<=this._black[n].l)return!1}return this.defaultResult},o.prototype.write=function(e,t,n){if(!this.enabled||this.test(e,t))return this.emit("item",e,t,n)},e.exports=o},8933:(e,t,n)=>{var r=n(2491),i=n(2216),o={debug:["gray"],info:["purple"],warn:["yellow",!0],error:["red",!0]},s=new r;s.write=function(e,t,n){var r=console.log;"debug"!=t&&console[t]&&(r=console[t]);var s=0;if("info"!=t){for(;s<n.length&&"string"==typeof n[s];s++);r.apply(console,["%c"+e+" "+n.slice(0,s).join(" "),i.apply(i,o[t])].concat(n.slice(s)))}else r.apply(console,["%c"+e,i.apply(i,o[t])].concat(n))},s.pipe=function(){},e.exports=s},9274:e=>{e.exports={BOOLEAN:"Boolean",BUTTON:"button",COMMAND:"command",CONDITIONAL:"conditional",EVENT:"event",HAT:"hat",LOOP:"loop",REPORTER:"reporter"}},9432:e=>{e.exports={SPRITE:"sprite",STAGE:"stage"}},9925:(e,t,n)=>{var r=n(2491),i=/\n+$/,o=new r;o.write=function(e,t,n){var r=n.length-1;if("undefined"!=typeof console&&console.log){if(console.log.apply)return console.log.apply(console,[e,t].concat(n));if(JSON&&JSON.stringify){n[r]&&"string"==typeof n[r]&&(n[r]=n[r].replace(i,""));try{for(r=0;r<n.length;r++)n[r]=JSON.stringify(n[r])}catch(e){}console.log(n.join(" "))}}},o.formatters=["color","minilog"],o.color=n(329),o.minilog=n(8933),e.exports=o}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();const r=n(6342),i=n(9274),o=n(3260),s=n(9432);n.g.Scratch=n.g.Scratch||{},n.g.Scratch.ArgumentType=r,n.g.Scratch.BlockType=i,n.g.Scratch.TargetType=s;const a=new class{constructor(){this.nextExtensionId=0,this.initialRegistrations=[],o.waitForConnection.then(()=>{o.call("extensions","allocateWorker").then(e=>{const[t,n]=e;this.workerId=t;try{importScripts(n);const e=this.initialRegistrations;this.initialRegistrations=null,Promise.all(e).then(()=>o.call("extensions","onWorkerInit",t))}catch(e){o.call("extensions","onWorkerInit",t,e)}})}),this.extensions=[]}register(e){const t=this.nextExtensionId++;this.extensions.push(e);const n="extension.".concat(this.workerId,".").concat(t),r=o.setService(n,e).then(()=>o.call("extensions","registerExtensionService",n));return this.initialRegistrations&&this.initialRegistrations.push(r),r}};return n.g.Scratch.extensions={register:a.register.bind(a)},{}})());
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.VirtualMachine=t():e.VirtualMachine=t()}(self,(()=>(()=>{var e={329:(e,t,n)=>{var r=n(2491),i=n(2216),o={debug:["cyan"],info:["purple"],warn:["yellow",!0],error:["red",!0]},s=new r;s.write=function(e,t,n){console.log;console[t]&&console[t].apply&&console[t].apply(console,["%c"+e+" %c"+t,i("gray"),i.apply(i,o[t])].concat(n))},s.pipe=function(){},e.exports=s},1920:e=>{function t(){this._events={}}t.prototype={on:function(e,t){this._events||(this._events={});var n=this._events;return(n[e]||(n[e]=[])).push(t),this},removeListener:function(e,t){var n,r=this._events[e]||[];for(n=r.length-1;n>=0&&r[n];n--)r[n]!==t&&r[n].cb!==t||r.splice(n,1)},removeAllListeners:function(e){e?this._events[e]&&(this._events[e]=[]):this._events={}},listeners:function(e){return this._events&&this._events[e]||[]},emit:function(e){this._events||(this._events={});var t,n=Array.prototype.slice.call(arguments,1),r=this._events[e]||[];for(t=r.length-1;t>=0&&r[t];t--)r[t].apply(this,n);return this},when:function(e,t){return this.once(e,t,!0)},once:function(e,t,n){if(!t)return this;function r(){n||this.removeListener(e,r),t.apply(this,arguments)&&n&&this.removeListener(e,r)}return r.cb=t,this.on(e,r),this}},t.mixin=function(e){var n,r=t.prototype;for(n in r)r.hasOwnProperty(n)&&(e.prototype[n]=r[n])},e.exports=t},2216:e=>{var t={black:"#000",red:"#c23621",green:"#25bc26",yellow:"#bbbb00",blue:"#492ee1",magenta:"#d338d3",cyan:"#33bbc8",gray:"#808080",purple:"#708"};e.exports=function(e,n){return n?"color: #fff; background: "+t[e]+";":"color: "+t[e]+";"}},2491:(e,t,n)=>{function r(){}n(1920).mixin(r),r.prototype.write=function(e,t,n){this.emit("item",e,t,n)},r.prototype.end=function(){this.emit("end"),this.removeAllListeners()},r.prototype.pipe=function(e){var t=this;function n(){e.write.apply(e,Array.prototype.slice.call(arguments))}function r(){!e._isStdio&&e.end()}return t.emit("unpipe",e),e.emit("pipe",t),t.on("item",n),t.on("end",r),t.when("unpipe",(function(i){var o=i===e||void 0===i;return o&&(t.removeListener("item",n),t.removeListener("end",r),e.emit("unpipe")),o})),e},r.prototype.unpipe=function(e){return this.emit("unpipe",e),this},r.prototype.format=function(e){throw new Error(["Warning: .format() is deprecated in Minilog v2! Use .pipe() instead. For example:","var Minilog = require('minilog');","Minilog"," .pipe(Minilog.backends.console.formatClean)"," .pipe(Minilog.backends.console);"].join("\n"))},r.mixin=function(e){var t,n=r.prototype;for(t in n)n.hasOwnProperty(t)&&(e.prototype[t]=n[t])},e.exports=r},2589:(e,t,n)=>{const r=n(3707);e.exports=class{constructor(){this.callbacks=[],this.nextResponseId=0}call(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return this.transferCall(e,t,null,...r)}transferCall(e,t,n){try{const{provider:s,isRemote:a}=this._getServiceProvider(e);if(s){for(var r=arguments.length,i=new Array(r>3?r-3:0),o=3;o<r;o++)i[o-3]=arguments[o];if(a)return this._remoteTransferCall(s,e,t,n,...i);const c=s[t].apply(s,i);return Promise.resolve(c)}return Promise.reject(new Error("Service not found: ".concat(e)))}catch(e){return Promise.reject(e)}}_isRemoteService(e){return this._getServiceProvider(e).isRemote}_remoteCall(e,t,n){for(var r=arguments.length,i=new Array(r>3?r-3:0),o=3;o<r;o++)i[o-3]=arguments[o];return this._remoteTransferCall(e,t,n,null,...i)}_remoteTransferCall(e,t,n,r){for(var i=arguments.length,o=new Array(i>4?i-4:0),s=4;s<i;s++)o[s-4]=arguments[s];return new Promise(((i,s)=>{const a=this._storeCallbacks(i,s);o.length>0&&"function"==typeof o[o.length-1].yield&&o.pop(),r?e.postMessage({service:t,method:n,responseId:a,args:o},r):e.postMessage({service:t,method:n,responseId:a,args:o})}))}_storeCallbacks(e,t){const n=this.nextResponseId++;return this.callbacks[n]=[e,t],n}_deliverResponse(e,t){try{const[n,r]=this.callbacks[e];delete this.callbacks[e],t.error?r(t.error):n(t.result)}catch(e){r.error("Dispatch callback failed: ".concat(JSON.stringify(e)))}}_onMessage(e,t){const n=t.data;let i;n.args=n.args||[],n.service?i="dispatch"===n.service?this._onDispatchMessage(e,n):this.call(n.service,n.method,...n.args):void 0===n.responseId?r.error("Dispatch caught malformed message from a worker: ".concat(JSON.stringify(t))):this._deliverResponse(n.responseId,n),i&&(void 0===n.responseId?r.error("Dispatch message missing required response ID: ".concat(JSON.stringify(t))):i.then((t=>e.postMessage({responseId:n.responseId,result:t})),(t=>e.postMessage({responseId:n.responseId,error:t}))))}_getServiceProvider(e){throw new Error("Could not get provider for ".concat(e,": _getServiceProvider not implemented"))}_onDispatchMessage(e,t){throw new Error("Unimplemented dispatch message handler cannot handle ".concat(t.method," method"))}}},3260:(e,t,n)=>{const r=n(2589),i=n(3707);e.exports=new class extends r{constructor(){super(),this._connectionPromise=new Promise((e=>{this._onConnect=e})),this.services={},this._onMessage=this._onMessage.bind(this,self),"undefined"!=typeof self&&(self.onmessage=this._onMessage)}get waitForConnection(){return this._connectionPromise}setService(e,t){return Object.prototype.hasOwnProperty.call(this.services,e)&&i.warn("Worker dispatch replacing existing service provider for ".concat(e)),this.services[e]=t,this.waitForConnection.then((()=>this._remoteCall(self,"dispatch","setService",e)))}_getServiceProvider(e){const t=this.services[e];return{provider:t||self,isRemote:!t}}_onDispatchMessage(e,t){let n;switch(t.method){case"handshake":n=this._onConnect();break;case"terminate":setTimeout((()=>self.close()),0),n=Promise.resolve();break;default:i.error("Worker dispatch received message for unknown method: ".concat(t.method))}return n}}},3545:(e,t,n)=>{var r=n(2491),i=(new Date).valueOf().toString(36);function o(e){this.url=e.url||"",this.cache=[],this.timer=null,this.interval=e.interval||3e4,this.enabled=!0,this.jQuery=window.jQuery,this.extras={}}r.mixin(o),o.prototype.write=function(e,t,n){this.timer||this.init(),this.cache.push([e,t].concat(n))},o.prototype.init=function(){if(this.enabled&&this.jQuery){var e=this;this.timer=setTimeout((function(){var t,n,r=[],o=e.url;if(0==e.cache.length)return e.init();for(t=0;t<e.cache.length;t++)try{JSON.stringify(e.cache[t]),r.push(e.cache[t])}catch(e){}e.jQuery.isEmptyObject(e.extras)?(n=JSON.stringify({logs:r}),o=e.url+"?client_id="+i):n=JSON.stringify(e.jQuery.extend({logs:r},e.extras)),e.jQuery.ajax(o,{type:"POST",cache:!1,processData:!1,data:n,contentType:"application/json",timeout:1e4}).success((function(t,n,r){t.interval&&(e.interval=Math.max(1e3,t.interval))})).error((function(){e.interval=3e4})).always((function(){e.init()})),e.cache=[]}),this.interval)}},o.prototype.end=function(){},o.jQueryWait=function(e){if("undefined"!=typeof window&&(window.jQuery||window.$))return e(window.jQuery||window.$);"undefined"!=typeof window&&setTimeout((function(){o.jQueryWait(e)}),200)},e.exports=o},3707:(e,t,n)=>{const r=n(6824);r.enable(),e.exports=r("vm")},4932:(e,t,n)=>{var r=n(2491),i=n(8589),o=new r,s=Array.prototype.slice;(t=e.exports=function(e){var n=function(){return o.write(e,void 0,s.call(arguments)),n};return n.debug=function(){return o.write(e,"debug",s.call(arguments)),n},n.info=function(){return o.write(e,"info",s.call(arguments)),n},n.warn=function(){return o.write(e,"warn",s.call(arguments)),n},n.error=function(){return o.write(e,"error",s.call(arguments)),n},n.log=n.debug,n.suggest=t.suggest,n.format=o.format,n}).defaultBackend=t.defaultFormatter=null,t.pipe=function(e){return o.pipe(e)},t.end=t.unpipe=t.disable=function(e){return o.unpipe(e)},t.Transform=r,t.Filter=i,t.suggest=new i,t.enable=function(){return t.defaultFormatter?o.pipe(t.suggest).pipe(t.defaultFormatter).pipe(t.defaultBackend):o.pipe(t.suggest).pipe(t.defaultBackend)}},6178:(e,t,n)=>{var r=n(2491),i=!1,o=new r;o.write=function(e,t,n){if("undefined"!=typeof window&&"undefined"!=typeof JSON&&JSON.stringify&&JSON.parse)try{i||(i=window.localStorage.minilog?JSON.parse(window.localStorage.minilog):[]),i.push([(new Date).toString(),e,t,n]),window.localStorage.minilog=JSON.stringify(i)}catch(e){}},e.exports=o},6342:e=>{e.exports={ANGLE:"angle",BOOLEAN:"Boolean",COLOR:"color",NUMBER:"number",STRING:"string",MATRIX:"matrix",NOTE:"note",IMAGE:"image"}},6824:(e,t,n)=>{var r=n(4932),i=r.enable,o=r.disable,s="undefined"!=typeof navigator&&/chrome/i.test(navigator.userAgent),a=n(9925);if(r.defaultBackend=s?a.minilog:a,"undefined"!=typeof window){try{r.enable(JSON.parse(window.localStorage.minilogSettings))}catch(e){}if(window.location&&window.location.search){var c=RegExp("[?&]minilog=([^&]*)").exec(window.location.search);c&&r.enable(decodeURIComponent(c[1]))}}r.enable=function(){i.call(r,!0);try{window.localStorage.minilogSettings=JSON.stringify(!0)}catch(e){}return this},r.disable=function(){o.call(r);try{delete window.localStorage.minilogSettings}catch(e){}return this},(e.exports=r).backends={array:n(7585),browser:r.defaultBackend,localStorage:n(6178),jQuery:n(3545)}},7585:(e,t,n)=>{var r=n(2491),i=[],o=new r;o.write=function(e,t,n){i.push([e,t,n])},o.get=function(){return i},o.empty=function(){i=[]},e.exports=o},8589:(e,t,n)=>{var r=n(2491),i={debug:1,info:2,warn:3,error:4};function o(){this.enabled=!0,this.defaultResult=!0,this.clear()}function s(e,t){return e.n.test?e.n.test(t):e.n==t}r.mixin(o),o.prototype.allow=function(e,t){return this._white.push({n:e,l:i[t]}),this},o.prototype.deny=function(e,t){return this._black.push({n:e,l:i[t]}),this},o.prototype.clear=function(){return this._white=[],this._black=[],this},o.prototype.test=function(e,t){var n,r=Math.max(this._white.length,this._black.length);for(n=0;n<r;n++){if(this._white[n]&&s(this._white[n],e)&&i[t]>=this._white[n].l)return!0;if(this._black[n]&&s(this._black[n],e)&&i[t]<=this._black[n].l)return!1}return this.defaultResult},o.prototype.write=function(e,t,n){if(!this.enabled||this.test(e,t))return this.emit("item",e,t,n)},e.exports=o},8933:(e,t,n)=>{var r=n(2491),i=n(2216),o={debug:["gray"],info:["purple"],warn:["yellow",!0],error:["red",!0]},s=new r;s.write=function(e,t,n){var r=console.log;"debug"!=t&&console[t]&&(r=console[t]);var s=0;if("info"!=t){for(;s<n.length&&"string"==typeof n[s];s++);r.apply(console,["%c"+e+" "+n.slice(0,s).join(" "),i.apply(i,o[t])].concat(n.slice(s)))}else r.apply(console,["%c"+e,i.apply(i,o[t])].concat(n))},s.pipe=function(){},e.exports=s},9274:e=>{e.exports={BOOLEAN:"Boolean",BUTTON:"button",COMMAND:"command",CONDITIONAL:"conditional",EVENT:"event",HAT:"hat",LOOP:"loop",REPORTER:"reporter"}},9432:e=>{e.exports={SPRITE:"sprite",STAGE:"stage"}},9925:(e,t,n)=>{var r=n(2491),i=/\n+$/,o=new r;o.write=function(e,t,n){var r=n.length-1;if("undefined"!=typeof console&&console.log){if(console.log.apply)return console.log.apply(console,[e,t].concat(n));if(JSON&&JSON.stringify){n[r]&&"string"==typeof n[r]&&(n[r]=n[r].replace(i,""));try{for(r=0;r<n.length;r++)n[r]=JSON.stringify(n[r])}catch(e){}console.log(n.join(" "))}}},o.formatters=["color","minilog"],o.color=n(329),o.minilog=n(8933),e.exports=o}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();const r=n(6342),i=n(9274),o=n(3260),s=n(9432);n.g.Scratch=n.g.Scratch||{},n.g.Scratch.ArgumentType=r,n.g.Scratch.BlockType=i,n.g.Scratch.TargetType=s;const a=new class{constructor(){this.nextExtensionId=0,this.initialRegistrations=[],o.waitForConnection.then((()=>{o.call("extensions","allocateWorker").then((e=>{const[t,n]=e;this.workerId=t;try{importScripts(n);const e=this.initialRegistrations;this.initialRegistrations=null,Promise.all(e).then((()=>o.call("extensions","onWorkerInit",t)))}catch(e){o.call("extensions","onWorkerInit",t,e)}}))})),this.extensions=[]}register(e){const t=this.nextExtensionId++;this.extensions.push(e);const n="extension.".concat(this.workerId,".").concat(t),r=o.setService(n,e).then((()=>o.call("extensions","registerExtensionService",n)));return this.initialRegistrations&&this.initialRegistrations.push(r),r}};return n.g.Scratch.extensions={register:a.register.bind(a)},{}})()));
|
|
2
2
|
//# sourceMappingURL=extension-worker.js.map
|