diff --git a/src/containers/blocks.jsx b/src/containers/blocks.jsx index f12b9548d37..dd162d70ff5 100644 --- a/src/containers/blocks.jsx +++ b/src/containers/blocks.jsx @@ -20,6 +20,7 @@ import DragConstants from '../lib/drag-constants'; import defineDynamicBlock from '../lib/define-dynamic-block'; import AddonHooks from '../addons/hooks'; import LoadScratchBlocksHOC from '../lib/tw-load-scratch-blocks-hoc.jsx'; +import eurekaloader from './bp-eureka-loader.js'; import {connect} from 'react-redux'; import {updateToolbox} from '../reducers/toolbox'; @@ -167,6 +168,7 @@ class Blocks extends React.Component { for (const category of this.props.vm.runtime._blockInfo) { this.handleExtensionAdded(category); } + eurekaloader.load(); } shouldComponentUpdate (nextProps, nextState) { return ( diff --git a/src/containers/bp-eureka-loader.js b/src/containers/bp-eureka-loader.js new file mode 100644 index 00000000000..bea6d4c2438 --- /dev/null +++ b/src/containers/bp-eureka-loader.js @@ -0,0 +1,17 @@ +// this was made by dumo i yoinked it from https://github.com/thepython555/ba4x-player + +let injected = false; + +const load = () => { + if (injected) return; + injected = true; + + const script = document.createElement('script'); + script.src = `/Eureka-7.js`; + + document.head.appendChild(script); +}; + +export default { + load +} \ No newline at end of file diff --git a/static/Eureka-7.js b/static/Eureka-7.js new file mode 100644 index 00000000000..3cdafbee415 --- /dev/null +++ b/static/Eureka-7.js @@ -0,0 +1,33 @@ +// ==UserScript== +// @name Eureka +// @description Universal scratch extension loader. +// @version 7 +// @author SimonShiki +// @include https://scratch.mit.edu/projects/* +// @include https://aerfaying.com/Projects/* +// @include https://www.ccw.site/* +// @include https://gitblock.cn/Projects/* +// @include https://world.xiaomawang.com/* +// @include https://cocrea.world/* +// @include https://create.codelab.club/* +// @include https://www.scratch-cn.cn/* +// @include https://www.40code.com/* +// @include https://turbowarp.org/* +// @include https://codingclip.com/* +// @include https://editor.turbowarp.cn/* +// @include https://0832.ink/rc/* +// @include https://code.xueersi.com/scratch3/* +// @include https://play.creaticode.com/projects/* +// @include https://www.adacraft.org/* +// @include https://studio.penguinmod.com/* +// @include https://code.xueersi.com/* +// @include http://localhost:8601/* +// @grant none +// @license AGPL-3.0-only +// @namespace EurekaLoader +// @run-at document-start +// @source https://github.com/EurekaScratch/eureka +// ==/UserScript== + +/*! For license information please see eureka-loader.js.LICENSE.txt */ +(()=>{var r,e,n,t,a,o,i={344:(r,e,n)=>{"use strict";n.a(r,(async(r,e)=>{try{var t=n(320),a=n(28),o=window.open;(0,a.Yz)("eureka-loader ".concat("7")),await(0,t.G)(o),void 0!==window.eureka.vm?(0,t.u)(window.eureka.vm):(0,a.Yz)("Cannot find vm in this page, stop injecting."),e()}catch(r){e(r)}}),1)},320:(r,e,n)=>{"use strict";n.d(e,{u:()=>Pr,G:()=>Tr});var t=n(28),a={convertProcCall:!0,dontExposeCtx:!1,noConfirmDialog:!1,sideloadOnly:!0},o="$CHIBI_SETTINGS";function i(){try{var r=window.localStorage.getItem(o);return r?JSON.parse(r):null}catch(r){return null}}window.localStorage.getItem(o)||window.localStorage.setItem(o,JSON.stringify(a));var c=new Proxy(a,{get:function(r,e){var n=i();return n&&e in n?Reflect.get(n,e):Reflect.get(r,e)},set:function(r,e,n){var t=i();return t||(t=Object.assign({},a)),Reflect.set(t,e,n),window.localStorage.setItem(o,JSON.stringify(t)),!0}});const l=function(r){if("string"!=typeof r){if(!Array.isArray(r))return t.e5("Unexpected input recieved in replaceUnsafeChars"),r;r=String(r)}return r.replace(/[<>&'"]/g,(function(r){switch(r){case"<":return"<";case">":return">";case"&":return"&";case"'":return"'";case'"':return"""}return""}))};var u=function(r){return r.ANGLE="angle",r.BOOLEAN="Boolean",r.COLOR="color",r.NUMBER="number",r.STRING="string",r.MATRIX="matrix",r.NOTE="note",r.IMAGE="image",r}(u||{}),s=function(r){return r.BOOLEAN="Boolean",r.BUTTON="button",r.COMMAND="command",r.CONDITIONAL="conditional",r.EVENT="event",r.HAT="hat",r.LABEL="label",r.LOOP="loop",r.REPORTER="reporter",r.XML="xml",r}(s||{}),f=function(r){return r.GLOBAL="global",r.TARGET="target",r}(f||{}),d=function(r){return r.SPRITE="sprite",r.STAGE="stage",r}(d||{}),h=n(540),p=n.n(h);function y(r){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},y(r)}var v=function(r,e,n){return r&&"object"===y(r)&&r.id&&r.default?p()(r,e,n):r};function m(r){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},m(r)}function b(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){var n=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=n){var t,a,o,i,c=[],l=!0,u=!1;try{if(o=(n=n.call(r)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(t=o.call(n)).done)&&(c.push(t.value),c.length!==e);l=!0);}catch(r){u=!0,a=r}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw a}}return c}}(r,e)||g(r,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(r,e){if(r){if("string"==typeof r)return w(r,e);var n=Object.prototype.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w(r,e):void 0}}function w(r,e){(null==e||e>r.length)&&(e=r.length);for(var n=0,t=new Array(e);n2?o-2:0),c=2;c2?n-2:0),a=2;a3?i-3:0),l=3;l3?t-3:0),o=3;o4?o-4:0),c=4;c1&&void 0!==arguments[1]?arguments[1]:new Set,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if("function"!=typeof r&&"symbol"!==m(r)){if(null!==r&&"object"===m(r)){if(n.has(r))return;if(n.add(r),Array.isArray(r))return r.map((function(r){return e._purifyObject(r,n,t+1)}));for(var a={},o=0,i=Object.entries(r);o>24&255;return{r:r>>16&255,g:r>>8&255,b:255&r,a:e>0?e:255}}},{key:"hexToRgb",value:function(r){r.startsWith("#")&&(r=r.substring(1));var e=parseInt(r,16);if(isNaN(e))return null;if(6===r.length)return{r:e>>16&255,g:e>>8&255,b:255&e};if(3===r.length){var n=e>>8&15,t=e>>4&15,a=15&e;return{r:n<<4|n,g:t<<4|t,b:a<<4|a}}return null}},{key:"rgbToHex",value:function(e){return r.decimalToHex(r.rgbToDecimal(e))}},{key:"rgbToDecimal",value:function(r){if(null===r)throw new Error("rgb must be an RGBObject");return(r.r<<16)+(r.g<<8)+r.b}},{key:"hexToDecimal",value:function(e){return r.rgbToDecimal(r.hexToRgb(e))}},{key:"hsvToRgb",value:function(r){var e=r.h%360;e<0&&(e+=360);var n,t,a,o=Math.max(0,Math.min(r.s,1)),i=Math.max(0,Math.min(r.v,1)),c=Math.floor(e/60),l=e/60-c,u=i*(1-o),s=i*(1-o*l),f=i*(1-o*(1-l));switch(c){default:case 0:n=i,t=f,a=u;break;case 1:n=s,t=i,a=u;break;case 2:n=u,t=i,a=f;break;case 3:n=u,t=s,a=i;break;case 4:n=f,t=u,a=i;break;case 5:n=i,t=u,a=s}return{r:Math.floor(255*n),g:Math.floor(255*t),b:Math.floor(255*a)}}},{key:"rgbToHsv",value:function(r){var e=r.r/255,n=r.g/255,t=r.b/255,a=Math.min(Math.min(e,n),t),o=Math.max(Math.max(e,n),t),i=0,c=0;return a!==o&&(i=60*((e===a?3:n===a?5:1)-(e===a?n-t:n===a?t-e:e-n)/(o-a))%360,c=(o-a)/o),{h:i,s:c,v:o}}},{key:"mixRgb",value:function(r,e,n){if(n<=0)return r;if(n>=1)return e;var t=1-n;return{r:t*r.r+n*e.r,g:t*r.g+n*e.g,b:t*r.b+n*e.b}}}],null&&N(e.prototype,null),n&&N(e,n),Object.defineProperty(e,"prototype",{writable:!1}),r}();function U(r){return U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},U(r)}function F(r,e){for(var n=0;no?1:0}return n===1/0&&t===1/0||n===-1/0&&t===-1/0?0:n-t}},{key:"isInt",value:function(r){return"number"==typeof r?!!isNaN(r)||r===Math.floor(r):"boolean"==typeof r||"string"==typeof r&&r.indexOf(".")<0}},{key:"LIST_INVALID",get:function(){return"INVALID"}},{key:"LIST_ALL",get:function(){return"ALL"}},{key:"toListIndex",value:function(e,n,t){if("number"!=typeof e){if("all"===e)return t?r.LIST_ALL:r.LIST_INVALID;if("last"===e)return n>0?n:r.LIST_INVALID;if("random"===e||"any"===e)return n>0?1+Math.floor(Math.random()*n):r.LIST_INVALID}return(e=Math.floor(r.toNumber(e)))<1||e>n?r.LIST_INVALID:e}}],null&&F(e.prototype,null),n&&F(e,n),Object.defineProperty(e,"prototype",{writable:!1}),r}();function z(r){return z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},z(r)}function V(r){var e=p().namespace(),n=function(r,n){if(r&&"object"===z(r));else{if("string"!=typeof r)throw new Error("unsupported data type in translate()");r={default:r}}return e(r,n)},t=function(r){return"_".concat(r)},a=function(){return r?r.getLocale():"undefined"!=typeof navigator?navigator.language:"en"},o={};return n.setup=function(r){r&&(o=r),e.setup({locale:a(),missingTranslation:"ignore",generateId:t,translations:o})},n.setup({}),r&&r.on("LOCALE_CHANGED",(function(){n.setup(null)})),Object.defineProperty(n,"language",{configurable:!0,enumerable:!0,get:function(){return a()}}),n}function K(r){var e={ArgumentType:u,BlockType:s,TargetType:d,ReporterScope:f,Cast:W,extensions:{register:function(){throw new Error("not implemented")},unsandboxed:!!r,chibi:!0,eureka:!0},translate:V(r),fetch:function(r){function e(e,n){return r.apply(this,arguments)}return e.toString=function(){return r.toString()},e}((function(r,e){return fetch(r,e)})),canFetch:function(r){var e=function(r){try{return new URL(r,location.href)}catch(r){return null}}(r);return!!e}};return r&&(e.vm=r,e.renderer=r.runtime.renderer),e}var H=n(984),Y=n.n(H);function J(){return Y()('// ==UserScript==\n// @name Eureka\n// @description Universal scratch extension loader.\n// @version 7\n// @author SimonShiki\n// @include https://scratch.mit.edu/projects/*\n// @include https://aerfaying.com/Projects/*\n// @include https://www.ccw.site/*\n// @include https://gitblock.cn/Projects/*\n// @include https://world.xiaomawang.com/*\n// @include https://cocrea.world/*\n// @include https://create.codelab.club/*\n// @include https://www.scratch-cn.cn/*\n// @include https://www.40code.com/*\n// @include https://turbowarp.org/*\n// @include https://codingclip.com/*\n// @include https://editor.turbowarp.cn/*\n// @include https://0832.ink/rc/*\n// @include https://code.xueersi.com/scratch3/*\n// @include https://play.creaticode.com/projects/*\n// @include https://www.adacraft.org/*\n// @include https://studio.penguinmod.com/*\n// @include https://code.xueersi.com/*\n// @include http://localhost:8601/*\n// @grant none\n// @license AGPL-3.0-only\n// @namespace EurekaLoader\n// @run-at document-start\n// @source https://github.com/EurekaScratch/eureka\n// ==/UserScript==\n\n(()=>{var r={160:r=>{var n="long",e="short",t="narrow",a="numeric",i="2-digit";r.exports={number:{decimal:{style:"decimal"},integer:{style:"decimal",maximumFractionDigits:0},currency:{style:"currency",currency:"USD"},percent:{style:"percent"},default:{style:"decimal"}},date:{short:{month:a,day:a,year:i},medium:{month:e,day:a,year:a},long:{month:n,day:a,year:a},full:{month:n,day:a,year:a,weekday:n},default:{month:e,day:a,year:a}},time:{short:{hour:a,minute:a},medium:{hour:a,minute:a,second:a},long:{hour:a,minute:a,second:a,timeZoneName:e},full:{hour:a,minute:a,second:a,timeZoneName:e},default:{hour:a,minute:a,second:a}},duration:{default:{hours:{minimumIntegerDigits:1,maximumFractionDigits:0},minutes:{minimumIntegerDigits:2,maximumFractionDigits:0},seconds:{minimumIntegerDigits:2,maximumFractionDigits:3}}},parseNumberPattern:function(r){if(r){var n={},e=r.match(/\\b[A-Z]{3}\\b/i),t=r.replace(/[^¤]/g,"").length;if(!t&&e&&(t=1),t?(n.style="currency",n.currencyDisplay=1===t?"symbol":2===t?"code":"name",n.currency=e?e[0].toUpperCase():"USD"):r.indexOf("%")>=0&&(n.style="percent"),!/[@#0]/.test(r))return n.style?n:void 0;if(n.useGrouping=r.indexOf(",")>=0,/E\\+?[@#0]+/i.test(r)||r.indexOf("@")>=0){var a=r.replace(/E\\+?[@#0]+|[^@#0]/gi,"");n.minimumSignificantDigits=Math.min(Math.max(a.replace(/[^@0]/g,"").length,1),21),n.maximumSignificantDigits=Math.min(Math.max(a.length,1),21)}else{for(var i=r.replace(/[^#0.]/g,"").split("."),o=i[0],l=o.length-1;"0"===o[l];)--l;n.minimumIntegerDigits=Math.min(Math.max(o.length-1-l,1),21);var u=i[1]||"";for(l=0;"0"===u[l];)++l;for(n.minimumFractionDigits=Math.min(Math.max(l,0),20);"#"===u[l];)++l;n.maximumFractionDigits=Math.min(Math.max(l,0),20)}return n}},parseDatePattern:function(r){if(r){for(var o={},l=0;l{"use strict";var t=e(160),a=e(144),i=e(240);function o(r,n,e,t,a){var i=r.map((function(r){return function(r,n,e,t,a){if("string"==typeof r){var i=r;return function(){return i}}var u,c=r[0],s=r[1];if(n&&"#"===r[0]){c=n[0];var f=n[2],h=(t.number||d.number)([c,"number"],e);return function(r){return h(l(c,r)-f,r)}}"plural"===s||"selectordinal"===s?(u={},Object.keys(r[3]).forEach((function(n){u[n]=o(r[3][n],r,e,t,a)})),r=[r[0],r[1],r[2],u]):r[2]&&"object"==typeof r[2]&&(u={},Object.keys(r[2]).forEach((function(n){u[n]=o(r[2][n],r,e,t,a)})),r=[r[0],r[1],u]);var p=s&&(t[s]||d[s]);if(p){var m=p(r,e);return function(r){return m(l(c,r),r)}}return a?function(r){return String(l(c,r))}:function(r){return l(c,r)}}(r,n,e,t,a)}));return a?1===i.length?i[0]:function(r){for(var n="",e=0;e0)e=new Intl.PluralRules(n,{type:t});else{var u=a(n,i),c=u&&i[u][t]||f;e={select:c}}return function(r,n){return(l["="+ +r]||l[e.select(r-o)]||l.other)(n)}}function f(){return"other"}(n=r.exports=function(r,n,e){return o(r,null,n||"en",e||{},!0)}).toParts=function(r,n,e){return o(r,null,n||"en",e||{},!1)};var d={number:u,ordinal:u,spellout:u,duration:function(r,n){var e=r[2],a=t.duration[e]||t.duration.default,i=new Intl.NumberFormat(n,a.seconds).format,o=new Intl.NumberFormat(n,a.minutes).format,l=new Intl.NumberFormat(n,a.hours).format,u=/^fi$|^fi-|^da/.test(String(n))?".":":";return function(r,n){if(r=+r,!isFinite(r))return i(r);var e=~~(r/60/60),t=~~(r/60%60),a=(e?l(Math.abs(e))+u:"")+o(Math.abs(t))+u+i(Math.abs(r%60));return r<0?l(-1).replace(l(1),a):a}},date:c,time:c,plural:s,selectordinal:s,select:function(r,n){var e=r[2];return function(r,n){return(e[r]||e.other)(n)}}};n.types=d},240:r=>{"use strict";var n="zero",e="one",t="two",a="few",i="many",o="other",l=[function(r){return 1==+r?e:o},function(r){var n=+r;return 0<=n&&n<=1?e:o},function(r){return 0===Math.floor(Math.abs(+r))||1==+r?e:o},function(r){var l=+r;return 0===l?n:1===l?e:2===l?t:3<=l%100&&l%100<=10?a:11<=l%100&&l%100<=99?i:o},function(r){var n=Math.floor(Math.abs(+r)),t=(r+".").split(".")[1].length;return 1===n&&0===t?e:o},function(r){var n=+r;return n%10==1&&n%100!=11?e:2<=n%10&&n%10<=4&&(n%100<12||14{"use strict";var e="{",t="}",a=",",i="#",o="<",l=">",u="",s="\'",f="offset:",d=["number","date","time","ordinal","duration","spellout"],h=["plural","select","selectordinal"];function p(r,n){var e=r.pattern,a=e.length,i=[],o=r.index,l=m(r,n);for(l&&i.push(l),l&&r.tokens&&r.tokens.push(["text",e.slice(o,r.index)]);r.index=9&&r<=13||32===r||133===r||160===r||6158===r||r>=8192&&r<=8205||8232===r||8233===r||8239===r||8287===r||8288===r||12288===r||65279===r}function b(r){for(var n=r.pattern,e=n.length,t=r.index;r.index=48&&n<=57);)++r.index;if(i===r.index)throw S(r,"offset number");r.tokens&&r.tokens.push(["number",e.slice(i,r.index)]),a=+e.slice(i,r.index)}return a}(r);b(r),y=[h,v,w,k(r,v)]}else if("select"===v)y=[h,v,k(r,v)];else if(d.indexOf(v)>=0)y=[h,v,x(r)];else{var M=r.index,O=x(r);b(r),n[r.index]===e&&(r.index=M,O=k(r,v)),y=[h,v,O]}if(b(r),n[r.index]!==t)throw S(r,t);return r.tokens&&r.tokens.push(["syntax",t]),++r.index,y}function g(r,n){for(var u=r.pattern,c=u.length,f="";r.index=0)throw S(r,null,null,\'"other" sub-message must be specified in \'+n);return i}function w(r,n){if(r.pattern[r.index]!==e)throw S(r,e+" to start sub-message");r.tokens&&r.tokens.push(["syntax",e]),++r.index;var a=p(r,n);if(r.pattern[r.index]!==t)throw S(r,t+" to end sub-message");return r.tokens&&r.tokens.push(["syntax",t]),++r.index,a}function S(r,n,e,t){var a=r.pattern,i=a.slice(0,r.index).split(/\\r?\\n/),o=r.index,l=i.length,u=i.slice(-1)[0].length;return e=e||(r.index>=a.length?"end of message pattern":g(r)||a[r.index]),t||(t=function(r,n){return r?"Expected "+r+" but found "+n:"Unexpected "+n+" found"}(n,e)),new M(t+=" in "+a.replace(/\\r?\\n/g,"\\n"),n,e,o,l,u)}function M(r,n,e,t,a,i){Error.call(this,r),this.name="SyntaxError",this.message=r,this.expected=n,this.found=e,this.offset=t,this.line=a,this.column=i}n=r.exports=function(r,n){return p({pattern:String(r),index:0,tagsType:n&&n.tagsType||null,tokens:n&&n.tokens||null},"")},M.prototype=Object.create(Error.prototype),n.SyntaxError=M},540:(r,n,e)=>{"use strict";var t=e(784),a=e(157),i=e(240),o=e(144),l=e(160);function u(r,n){return Object.keys(n).forEach((function(e){r[e]=n[e]})),r}r.exports=function r(){var n=u({},l),e="en",c={},s=function(r){return r},f=null,d="warning",h={};function p(r,n,i){var o="string"==typeof r?r:r.default,l=b(o,"object"==typeof r&&r.id||s(o),i||e);return(l.format||(l.format=a(t(l.message),i||e,h)))(n)}p.rich=function(r,n,i){var o="string"==typeof r?r:r.default,l=b(o,"object"==typeof r&&r.id||s(o),i||e);return(l.toParts||(l.toParts=a.toParts(t(l.message,{tagsType:m}),i||e,h)))(n)};var m="<>";function y(r,n){var e=r[2];return function(r,n){var t="object"==typeof e?function(r,n){return Object.keys(r).reduce((function(e,t){return e[t]=r[t](n),e}),{})}(e,n):e;return"function"==typeof r?r(t):r}}function b(r,n,e){var t=o(e,c)||"en",a=c[t]||(c[t]={}),i=a[n];if("string"==typeof i&&(i=a[n]={message:i}),!i){var l=\'Translation for "\'+n+\'" in "\'+t+\'" is missing\';if("warning"===d)"undefined"!=typeof console&&console.warn(l);else if("ignore"!==d)throw new Error(l);var u="function"==typeof f?f(r,n,t)||r:f||r;i=a[n]={message:u}}return i}function v(r,n,t,a,l){"object"==typeof t&&"object"!=typeof a&&(l=a,a=t,t=0);var u=o(l||e,i),c=u&&i[u][r]||g;return a["="+ +n]||a[c(n-t)]||a.other}function g(){return"other"}return h[m]=y,p.setup=function(r){return(r=r||{}).locale&&(e=r.locale),"translations"in r&&(c=r.translations||{}),r.generateId&&(s=r.generateId),"missingReplacement"in r&&(f=r.missingReplacement),r.missingTranslation&&(d=r.missingTranslation),r.formats&&(r.formats.number&&u(n.number,r.formats.number),r.formats.date&&u(n.date,r.formats.date),r.formats.time&&u(n.time,r.formats.time)),r.types&&((h=r.types)[m]=y),{locale:e,translations:c,generateId:s,missingReplacement:f,missingTranslation:d,formats:n,types:h}},p.number=function(r,t,a){var i=t&&n.number[t]||n.parseNumberPattern(t)||n.number.default;return new Intl.NumberFormat(a||e,i).format(r)},p.date=function(r,t,a){var i=t&&n.date[t]||n.parseDatePattern(t)||n.date.default;return new Intl.DateTimeFormat(a||e,i).format(r)},p.time=function(r,t,a){var i=t&&n.time[t]||n.parseDatePattern(t)||n.time.default;return new Intl.DateTimeFormat(a||e,i).format(r)},p.select=function(r,n){return n[r]||n.other},p.custom=function(r,n,e,t){return r[1]in h?h[r[1]](r,n)(e,t):e},p.plural=v.bind(null,"cardinal"),p.selectordinal=v.bind(null,"ordinal"),p.namespace=r,p}()},144:r=>{r.exports=function(r,n){if("string"==typeof r&&n[r])return r;for(var e=[].concat(r||[]),t=0,a=e.length;t{var n=r&&r.__esModule?()=>r.default:()=>r;return e.d(n,{a:n}),n},e.d=(r,n)=>{for(var t in n)e.o(n,t)&&!e.o(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:n[t]})},e.o=(r,n)=>Object.prototype.hasOwnProperty.call(r,n),(()=>{"use strict";var r=function(r){return r.ANGLE="angle",r.BOOLEAN="Boolean",r.COLOR="color",r.NUMBER="number",r.STRING="string",r.MATRIX="matrix",r.NOTE="note",r.IMAGE="image",r}(r||{}),n=function(r){return r.BOOLEAN="Boolean",r.BUTTON="button",r.COMMAND="command",r.CONDITIONAL="conditional",r.EVENT="event",r.HAT="hat",r.LABEL="label",r.LOOP="loop",r.REPORTER="reporter",r.XML="xml",r}(n||{}),t=function(r){return r.GLOBAL="global",r.TARGET="target",r}(t||{}),a=function(r){return r.SPRITE="sprite",r.STAGE="stage",r}(a||{});function i(r){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},i(r)}function o(r,n){for(var e=0;e>24&255;return{r:r>>16&255,g:r>>8&255,b:255&r,a:n>0?n:255}}},{key:"hexToRgb",value:function(r){r.startsWith("#")&&(r=r.substring(1));var n=parseInt(r,16);if(isNaN(n))return null;if(6===r.length)return{r:n>>16&255,g:n>>8&255,b:255&n};if(3===r.length){var e=n>>8&15,t=n>>4&15,a=15&n;return{r:e<<4|e,g:t<<4|t,b:a<<4|a}}return null}},{key:"rgbToHex",value:function(n){return r.decimalToHex(r.rgbToDecimal(n))}},{key:"rgbToDecimal",value:function(r){if(null===r)throw new Error("rgb must be an RGBObject");return(r.r<<16)+(r.g<<8)+r.b}},{key:"hexToDecimal",value:function(n){return r.rgbToDecimal(r.hexToRgb(n))}},{key:"hsvToRgb",value:function(r){var n=r.h%360;n<0&&(n+=360);var e,t,a,i=Math.max(0,Math.min(r.s,1)),o=Math.max(0,Math.min(r.v,1)),l=Math.floor(n/60),u=n/60-l,c=o*(1-i),s=o*(1-i*u),f=o*(1-i*(1-u));switch(l){default:case 0:e=o,t=f,a=c;break;case 1:e=s,t=o,a=c;break;case 2:e=c,t=o,a=f;break;case 3:e=c,t=s,a=o;break;case 4:e=f,t=c,a=o;break;case 5:e=o,t=c,a=s}return{r:Math.floor(255*e),g:Math.floor(255*t),b:Math.floor(255*a)}}},{key:"rgbToHsv",value:function(r){var n=r.r/255,e=r.g/255,t=r.b/255,a=Math.min(Math.min(n,e),t),i=Math.max(Math.max(n,e),t),o=0,l=0;return a!==i&&(o=60*((n===a?3:e===a?5:1)-(n===a?e-t:e===a?t-n:n-e)/(i-a))%360,l=(i-a)/i),{h:o,s:l,v:i}}},{key:"mixRgb",value:function(r,n,e){if(e<=0)return r;if(e>=1)return n;var t=1-e;return{r:t*r.r+e*n.r,g:t*r.g+e*n.g,b:t*r.b+e*n.b}}}],null&&o(n.prototype,null),e&&o(n,e),Object.defineProperty(n,"prototype",{writable:!1}),r}();function c(r){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},c(r)}function s(r,n){for(var e=0;ei?1:0}return e===1/0&&t===1/0||e===-1/0&&t===-1/0?0:e-t}},{key:"isInt",value:function(r){return"number"==typeof r?!!isNaN(r)||r===Math.floor(r):"boolean"==typeof r||"string"==typeof r&&r.indexOf(".")<0}},{key:"LIST_INVALID",get:function(){return"INVALID"}},{key:"LIST_ALL",get:function(){return"ALL"}},{key:"toListIndex",value:function(n,e,t){if("number"!=typeof n){if("all"===n)return t?r.LIST_ALL:r.LIST_INVALID;if("last"===n)return e>0?e:r.LIST_INVALID;if("random"===n||"any"===n)return e>0?1+Math.floor(Math.random()*e):r.LIST_INVALID}return(n=Math.floor(r.toNumber(n)))<1||n>e?r.LIST_INVALID:n}}],null&&s(n.prototype,null),e&&s(n,e),Object.defineProperty(n,"prototype",{writable:!1}),r}(),p=e(540),m=e.n(p);function y(r){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},y(r)}function b(r){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},b(r)}function v(r,n){return function(r){if(Array.isArray(r))return r}(r)||function(r,n){var e=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=e){var t,a,i,o,l=[],u=!0,c=!1;try{if(i=(e=e.call(r)).next,0===n){if(Object(e)!==e)return;u=!1}else for(;!(u=(t=i.call(e)).done)&&(l.push(t.value),l.length!==n);u=!0);}catch(r){c=!0,a=r}finally{try{if(!u&&null!=e.return&&(o=e.return(),Object(o)!==o))return}finally{if(c)throw a}}return l}}(r,n)||g(r,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(r,n){if(r){if("string"==typeof r)return x(r,n);var e=Object.prototype.toString.call(r).slice(8,-1);return"Object"===e&&r.constructor&&(e=r.constructor.name),"Map"===e||"Set"===e?Array.from(r):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?x(r,n):void 0}}function x(r,n){(null==n||n>r.length)&&(n=r.length);for(var e=0,t=new Array(n);e2?e-2:0),a=2;a3?o-3:0),u=3;u3?t-3:0),i=3;i4?i-4:0),l=4;l1&&void 0!==arguments[1]?arguments[1]:new Set,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if("function"!=typeof r&&"symbol"!==b(r)){if(null!==r&&"object"===b(r)){if(e.has(r))return;if(e.add(r),Array.isArray(r))return r.map((function(r){return n._purifyObject(r,e,t+1)}));for(var a={},i=0,o=Object.entries(r);ir.length)&&(n=r.length);for(var e=0,t=new Array(n);e=r.length?{done:!0}:{done:!1,value:r[t++]}},e:function(r){throw r},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,c=!1;return{s:function(){n=n.call(r)},n:function(){var r=n.next();return i=r.done,r},e:function(r){c=!0,o=r},f:function(){try{i||null==n.return||n.return()}finally{if(c)throw o}}}}function X(r,e){if(r){if("string"==typeof r)return Q(r,e);var n=Object.prototype.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Q(r,e):void 0}}function Q(r,e){(null==e||e>r.length)&&(e=r.length);for(var n=0,t=new Array(e);n=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var l=t.call(i,"catchLoc"),u=t.call(i,"finallyLoc");if(l&&u){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&t.call(a,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===r)return this.complete(n.completion,n.afterLoc),_(n),v}},catch:function(r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===r){var t=n.completion;if("throw"===t.type){var a=t.arg;_(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,t){return this.delegate={iterator:A(e),resultName:n,nextLoc:t},"next"===this.method&&(this.arg=r),v}},e}function er(r,e,n,t,a,o,i){try{var c=r[o](i),l=c.value}catch(r){return void n(r)}c.done?e(l):Promise.resolve(l).then(t,a)}function nr(r){return function(){var e=this,n=arguments;return new Promise((function(t,a){var o=r.apply(e,n);function i(r){er(o,t,a,i,c,"next",r)}function c(r){er(o,t,a,i,c,"throw",r)}i(void 0)}))}}function tr(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function ar(r,e){for(var n=0;n1&&void 0!==c[1]?c[1]:"sandboxed","string"!=typeof e){r.next=13;break}r.t0=n,r.next="sandboxed"===r.t0?5:"unsandboxed"===r.t0?6:12;break;case 5:return r.abrupt("return",new Promise((function(r,n){var t=new J;i.pendingExtensions.push({extensionURL:e,resolve:r,reject:n}),P.addWorker(t)})));case 6:return t=K(this.vm),window.eureka.settings.dontExposeCtx||(window.Scratch=t),t.extensions.register=function(r){var n=r.getInfo();i._registerExtensionInfo(r,n,e)},r.next=11,lr.load(e,t);case 11:return r.abrupt("return");case 12:throw new Error("unexpected env");case 13:return a=new e(this.vm.runtime),o=a.getInfo(),this._registerExtensionInfo(a,o,o.id),r.abrupt("return",o);case 17:case"end":return r.stop()}}),r,this)}))),function(r){return i.apply(this,arguments)})},{key:"reload",value:(o=nr(rr().mark((function r(e){var n,t,a,o;return rr().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(n=this.loadedScratchExtension.get(e)){r.next=3;break}throw new Error("Cannot locate extension ".concat(e,"."));case 3:if("string"!=typeof n.instance){r.next=10;break}return r.next=6,P.call(n.instance,"getInfo");case 6:return t=r.sent,a=this._prepareExtensionInfo(null,t,n.instance),this.vm.runtime._refreshExtensionPrimitives(a),r.abrupt("return",a);case 10:return o=n.instance.getInfo(),o=this._prepareExtensionInfo(n.instance,o),this.vm.runtime._refreshExtensionPrimitives(o),r.abrupt("return",o);case 14:case"end":return r.stop()}}),r,this)}))),function(r){return o.apply(this,arguments)})},{key:"getIdByUrl",value:function(r){var e,n=Z(this.loadedScratchExtension.entries());try{for(n.s();!(e=n.n()).done;){var t=q(e.value,2),a=t[0];if(t[1].url===r)return a}}catch(r){n.e(r)}finally{n.f()}}},{key:"reloadAll",value:function(){var r,e=[],n=Z(this.loadedScratchExtension.entries());try{for(n.s();!(r=n.n()).done;){var t=q(r.value,1)[0];e.push(this.reload(t))}}catch(r){n.e(r)}finally{n.f()}return Promise.all(e)}},{key:"_registerExtensionInfo",value:function(r,e,n,t){if(!this.loadedScratchExtension.has(e.id)){if(!r&&!t)throw new Error("Cannnot mark ".concat(e.id," as loaded."));this.loadedScratchExtension.set(e.id,{type:"scratch",id:e.id,url:n,info:e,instance:null!=r?r:t,env:t?"sandboxed":"unsandboxed"}),this.vm.extensionManager._loadedExtensions.set(e.id,"Eureka")}e=this._prepareExtensionInfo(r,e,t),this.vm.runtime._registerExtensionPrimitives(e)}},{key:"_sanitizeID",value:function(r){return r.toString().replace(/[<"&]/,"_")}},{key:"_prepareExtensionInfo",value:function(r,e,n){var a=this;if(e=Object.assign({},e),!/^[a-z0-9]+$/i.test(e.id))throw new Error("Invalid extension id");return e.name=e.name||e.id,e.blocks=e.blocks||[],e.targetTypes=e.targetTypes||[],e.blocks=e.blocks.reduce((function(o,i){try{var c;c="---"===i?"---":a._prepareBlockInfo(r,i,n,e),o.push(c)}catch(r){(0,t.e5)("Error processing block: ".concat(r.message,", Block:\n").concat(JSON.stringify(i)))}return o}),[]),e.menus=e.menus||{},e.menus=this._prepareMenuInfo(r,e.menus,n),e}},{key:"_prepareMenuInfo",value:function(r,e,n){for(var t=Object.getOwnPropertyNames(e),a=0;a2?t-2:0),o=2;o')};case s.XML:return{info:e,xml:e.xml};default:if("extensions"in e){var i,c=r.call.apply(r,[this,e,n].concat(a)),u=Z(e.extensions);try{for(u.s();!(i=u.n()).done;){var f=i.value;"extensions"in c.json||(c.json=[]),c.json.extensions.includes(f)||c.json.extensions.push(f)}}catch(r){u.e(r)}finally{u.f()}return c}return r.call.apply(r,[this,e,n].concat(a))}return r.call.apply(r,[this,e,n].concat(a))};var e=this.vm.runtime._convertButtonForScratchBlocks;this.vm.runtime._convertButtonForScratchBlocks=function(r){window.eureka.blockly&&!["MAKE_A_LIST","MAKE_A_PROCEDURE","MAKE_A_VARIABLE"].includes(r.func)&&window.Blockly.getMainWorkspace().registerButtonCallback(r.func,r.callback);for(var n=arguments.length,t=new Array(n>1?n-1:0),a=1;a=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var l=t.call(i,"catchLoc"),u=t.call(i,"finallyLoc");if(l&&u){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&t.call(a,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===r)return this.complete(n.completion,n.afterLoc),_(n),v}},catch:function(r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===r){var t=n.completion;if("throw"===t.type){var a=t.arg;_(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,t){return this.delegate={iterator:A(e),resultName:n,nextLoc:t},"next"===this.method&&(this.arg=r),v}},e}function dr(r,e,n,t,a,o,i){try{var c=r[o](i),l=c.value}catch(r){return void n(r)}c.done?e(l):Promise.resolve(l).then(t,a)}function hr(r,e){if(r){if("string"==typeof r)return pr(r,e);var n=Object.prototype.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pr(r,e):void 0}}function pr(r,e){(null==e||e>r.length)&&(e=r.length);for(var n=0,t=new Array(e);n=r.length?{done:!0}:{done:!1,value:r[t++]}},e:function(r){throw r},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,c=!1;return{s:function(){n=n.call(r)},n:function(){var r=n.next();return i=r.done,r},e:function(r){c=!0,o=r},f:function(){try{i||null==n.return||n.return()}finally{if(c)throw o}}}}(window.eureka.loader.loadedScratchExtension.entries());try{for(a.s();!(r=a.n()).done;){var o=(e=r.value,n=2,function(r){if(Array.isArray(r))return r}(e)||function(r,e){var n=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=n){var t,a,o,i,c=[],l=!0,u=!1;try{if(o=(n=n.call(r)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(t=o.call(n)).done)&&(c.push(t.value),c.length!==e);l=!0);}catch(r){u=!0,a=r}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw a}}return c}}(e,n)||hr(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),i=o[0],c=o[1];t.push({name:i,sandboxed:"sandboxed"===c.env})}}catch(r){a.e(r)}finally{a.f()}return t}function mr(){var r;return r=fr().mark((function r(e){var n,t,a,o,c;return fr().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("https://eureka.codingclip.cc"===e.origin){r.next=2;break}return r.abrupt("return");case 2:if("type"in e.data){r.next=4;break}return r.abrupt("return");case 4:r.t0=e.data.type,r.next="allocate"===r.t0?7:"load"===r.t0?12:"updateSettings"===r.t0?16:19;break;case 7:return console.log("handshake with frontend"),null===(n=yr)||void 0===n||n.postMessage({type:"handshake",clientInfo:{version:Number(window.eureka.version),url:window.location.host}},"*"),null===(t=yr)||void 0===t||t.postMessage({type:"extension",extensions:vr()},"*"),null===(a=yr)||void 0===a||a.postMessage({type:"settings",settings:i()},"*"),r.abrupt("break",19);case 12:return r.next=14,window.eureka.loader.load(e.data.info.url,e.data.info.sandboxed?"sandboxed":"unsandboxed");case 14:return null===(o=yr)||void 0===o||o.postMessage({type:"extension",extensions:vr()},"*"),r.abrupt("break",19);case 16:return window.eureka.settings[e.data.item.name]=e.data.item.value,null===(c=yr)||void 0===c||c.postMessage({type:"settings",settings:i()},"*"),r.abrupt("break",19);case 19:case"end":return r.stop()}}),r)})),mr=function(){var e=this,n=arguments;return new Promise((function(t,a){var o=r.apply(e,n);function i(r){dr(o,t,a,i,c,"next",r)}function c(r){dr(o,t,a,i,c,"throw",r)}i(void 0)}))},mr.apply(this,arguments)}window.addEventListener("message",(function(r){return mr.apply(this,arguments)}));const br=function(r){yr=r("https://eureka.codingclip.cc/#manage","Eureka","popup=yes,status=no,location=no,toolbar=no,menubar=no")},gr=JSON.parse('{"zh-cn":{"eureka.openFrontend":"🎨 打开面板","eureka.sideload":"🌏 从 URL 侧载扩展","eureka.sideloadTemporarily":"📄 从文件侧载扩展","eureka.errorIgnored":"❌ 在加载扩展扩展时出现错误。为了避免加载进程的中断,此错误已被忽略。","eureka.exprimentalFileWarning":"🛠️ 这是一项实验性功能 -- 刷新页面后插件将不可用。\\n确定要继续么?","eureka.tryLoad":"🤨 项目正从 {url} 加载扩展 {extensionURL}。要通过 Eureka 进行加载吗?","eureka.tryLoadInEnv":"🤨 项目正以 {env} 模式从 {url} 加载扩展 {extensionURL}。要加载么?","eureka.loadInSandbox":"🤨 要在沙箱模式中加载扩展么?","eureka.enterURL":"🌐 输入 URL。"},"en":{"eureka.openFrontend":"🎨 Open Frontend","eureka.sideload":"🌎 Sideload from URL","eureka.sideloadTemporarily":"📄 Sideload from File","eureka.errorIgnored":"❌ Error occurred while sideloading extension. To avoid interrupting the loading process, we chose to ignore this error.","eureka.exprimentalFileWarning":"🛠️ This is an experimental feature -- the extension will be unavailable after reloading.\\nAre you sure you want to continue?","eureka.tryLoad":"🤨 Project is trying to loading {extensionURL} from {url}. Do you want to load via Eureka?","eureka.tryLoadInEnv":"🤨 Project is trying to sideloading {extensionURL} from {url} in {env} mode. Do you want to load?","eureka.loadInSandbox":"🤨 Do you want to load it in the sandbox?","eureka.enterURL":"🌐 Enter URL."},"ja":{"eureka.openFrontend":"🎨 ダッシュボードを開く","eureka.sideload":"🌏 URL から拡張機能を導入","eureka.sideloadTemporarily":"📄 ファイルから拡張機能を導入","eureka.errorIgnored":"❌ 拡張機能のサイドロード中でエラーが発生しました。ロードの中断を防ぐために、このエラーは無視しました。","eureka.exprimentalFileWarning":"🛠️ これは実験機能であり -- ページをリロードしたら、拡張機能は使用できなくなります。\\nよろしいですか?","eureka.tryLoad":"🤨 プロジェクトは {url} から {extensionURL} をサイドロードしています。ロードしますか?","eureka.tryLoadInEnv":"🤨 プロジェクトは {env} モードで、{url} から {extensionURL} をサイドロードしています。ロードしますか?","eureka.loadInSandbox":"🤨 サンドボックス環境でロードしますか?","eureka.enterURL":"🌐 URL を入力してください。"}}');var wr=n.t(gr,2);function xr(r){return xr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},xr(r)}function kr(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){var n=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=n){var t,a,o,i,c=[],l=!0,u=!1;try{if(o=(n=n.call(r)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(t=o.call(n)).done)&&(c.push(t.value),c.length!==e);l=!0);}catch(r){u=!0,a=r}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw a}}return c}}(r,e)||Er(r,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Sr(r,e){var n="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!n){if(Array.isArray(r)||(n=Er(r))||e&&r&&"number"==typeof r.length){n&&(r=n);var t=0,a=function(){};return{s:a,n:function(){return t>=r.length?{done:!0}:{done:!1,value:r[t++]}},e:function(r){throw r},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,c=!1;return{s:function(){n=n.call(r)},n:function(){var r=n.next();return i=r.done,r},e:function(r){c=!0,o=r},f:function(){try{i||null==n.return||n.return()}finally{if(c)throw o}}}}function Er(r,e){if(r){if("string"==typeof r)return Or(r,e);var n=Object.prototype.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Or(r,e):void 0}}function Or(r,e){(null==e||e>r.length)&&(e=r.length);for(var n=0,t=new Array(e);n=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var l=t.call(i,"catchLoc"),u=t.call(i,"finallyLoc");if(l&&u){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&t.call(a,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===r)return this.complete(n.completion,n.afterLoc),_(n),v}},catch:function(r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===r){var t=n.completion;if("throw"===t.type){var a=t.arg;_(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,t){return this.delegate={iterator:A(e),resultName:n,nextLoc:t},"next"===this.method&&(this.arg=r),v}},e}function jr(r,e,n,t,a,o,i){try{var c=r[o](i),l=c.value}catch(r){return void n(r)}c.done?e(l):Promise.resolve(l).then(t,a)}function Lr(r){return function(){var e=this,n=arguments;return new Promise((function(t,a){var o=r.apply(e,n);function i(r){jr(o,t,a,i,c,"next",r)}function c(r){jr(o,t,a,i,c,"throw",r)}i(void 0)}))}}var _r=3e4;function Ir(r){var e=r.indexOf("_"),n=r.substring(0,e).replace(/[^\w-]/g,"-");if(""!==n)return n}function Ar(){return(Ar=Lr(Mr().mark((function r(e){var n,t,a;return Mr().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return a=(t=function(){var r;function n(r){var e=Function.prototype.apply;Function.prototype.apply=function(r){return r};var n=r();return Function.prototype.apply=e,n}var t=null===(r=e._events)||void 0===r?void 0:r.EXTENSION_ADDED;if(t)if(t instanceof Function){var a=n(t);if(a&&"object"===xr(a)&&"ScratchBlocks"in a)return a.ScratchBlocks}else{var o,i=Sr(t);try{for(i.s();!(o=i.n()).done;){var c=n(o.value);if(c&&"object"===xr(c)&&"ScratchBlocks"in c)return c.ScratchBlocks}}catch(r){i.e(r)}finally{i.f()}}return null})(),r.abrupt("return",null!==(n=a)&&void 0!==n?n:new Promise((function(r){var n=void 0;Reflect.defineProperty(e._events,"EXTENSION_ADDED",{get:function(){return n},set:function(o){n=o,(a=t())&&(Reflect.defineProperty(e._events,"EXTENSION_ADDED",{value:n,writable:!0}),r(a))},configurable:!0})})));case 3:case"end":return r.stop()}}),r)})))).apply(this,arguments)}function Tr(r){window.eureka={version:"7",registeredExtension:{},settings:c,openFrontend:br.bind(null,r)},(0,t.Yz)("Listening bind function...");var e=Function.prototype.bind;return new Promise((function(r){var n=setTimeout((function(){(0,t.Yz)("Cannot find vm instance, stop listening."),Function.prototype.bind=e,r()}),_r);Function.prototype.bind=function(){for(var a=arguments.length,o=new Array(a),i=0;i1?i-1:0),l=1;l1?e-1:0),t=1;t1?v-1:0),b=1;b1?n-1:0),a=1;a1?e-1:0),a=1;a1?o-1:0),c=1;c2?t-2:0),i=2;i1?n-1:0),a=1;a{"use strict";function t(){for(var r,e=arguments.length,n=new Array(e),t=0;tt,e5:()=>o,mo:()=>a})},984:r=>{"use strict";r.exports=function(r,e,n,t){var a=self||window;try{try{var o;try{o=new a.Blob([r])}catch(e){(o=new(a.BlobBuilder||a.WebKitBlobBuilder||a.MozBlobBuilder||a.MSBlobBuilder)).append(r),o=o.getBlob()}var i=a.URL||a.webkitURL,c=i.createObjectURL(o),l=new a[e](c,n);return i.revokeObjectURL(c),l}catch(t){return new a[e]("data:application/javascript,".concat(encodeURIComponent(r)),n)}}catch(r){if(!t)throw Error("Inline worker is not supported");return new a[e](t,n)}}},160:r=>{var e="long",n="short",t="narrow",a="numeric",o="2-digit";r.exports={number:{decimal:{style:"decimal"},integer:{style:"decimal",maximumFractionDigits:0},currency:{style:"currency",currency:"USD"},percent:{style:"percent"},default:{style:"decimal"}},date:{short:{month:a,day:a,year:o},medium:{month:n,day:a,year:a},long:{month:e,day:a,year:a},full:{month:e,day:a,year:a,weekday:e},default:{month:n,day:a,year:a}},time:{short:{hour:a,minute:a},medium:{hour:a,minute:a,second:a},long:{hour:a,minute:a,second:a,timeZoneName:n},full:{hour:a,minute:a,second:a,timeZoneName:n},default:{hour:a,minute:a,second:a}},duration:{default:{hours:{minimumIntegerDigits:1,maximumFractionDigits:0},minutes:{minimumIntegerDigits:2,maximumFractionDigits:0},seconds:{minimumIntegerDigits:2,maximumFractionDigits:3}}},parseNumberPattern:function(r){if(r){var e={},n=r.match(/\b[A-Z]{3}\b/i),t=r.replace(/[^¤]/g,"").length;if(!t&&n&&(t=1),t?(e.style="currency",e.currencyDisplay=1===t?"symbol":2===t?"code":"name",e.currency=n?n[0].toUpperCase():"USD"):r.indexOf("%")>=0&&(e.style="percent"),!/[@#0]/.test(r))return e.style?e:void 0;if(e.useGrouping=r.indexOf(",")>=0,/E\+?[@#0]+/i.test(r)||r.indexOf("@")>=0){var a=r.replace(/E\+?[@#0]+|[^@#0]/gi,"");e.minimumSignificantDigits=Math.min(Math.max(a.replace(/[^@0]/g,"").length,1),21),e.maximumSignificantDigits=Math.min(Math.max(a.length,1),21)}else{for(var o=r.replace(/[^#0.]/g,"").split("."),i=o[0],c=i.length-1;"0"===i[c];)--c;e.minimumIntegerDigits=Math.min(Math.max(i.length-1-c,1),21);var l=o[1]||"";for(c=0;"0"===l[c];)++c;for(e.minimumFractionDigits=Math.min(Math.max(c,0),20);"#"===l[c];)++c;e.maximumFractionDigits=Math.min(Math.max(c,0),20)}return e}},parseDatePattern:function(r){if(r){for(var i={},c=0;c{"use strict";var t=n(160),a=n(144),o=n(240);function i(r,e,n,t,a){var o=r.map((function(r){return function(r,e,n,t,a){if("string"==typeof r){var o=r;return function(){return o}}var l,u=r[0],s=r[1];if(e&&"#"===r[0]){u=e[0];var f=e[2],h=(t.number||d.number)([u,"number"],n);return function(r){return h(c(u,r)-f,r)}}"plural"===s||"selectordinal"===s?(l={},Object.keys(r[3]).forEach((function(e){l[e]=i(r[3][e],r,n,t,a)})),r=[r[0],r[1],r[2],l]):r[2]&&"object"==typeof r[2]&&(l={},Object.keys(r[2]).forEach((function(e){l[e]=i(r[2][e],r,n,t,a)})),r=[r[0],r[1],l]);var p=s&&(t[s]||d[s]);if(p){var y=p(r,n);return function(r){return y(c(u,r),r)}}return a?function(r){return String(c(u,r))}:function(r){return c(u,r)}}(r,e,n,t,a)}));return a?1===o.length?o[0]:function(r){for(var e="",n=0;n0)n=new Intl.PluralRules(e,{type:t});else{var l=a(e,o),u=l&&o[l][t]||f;n={select:u}}return function(r,e){return(c["="+ +r]||c[n.select(r-i)]||c.other)(e)}}function f(){return"other"}(e=r.exports=function(r,e,n){return i(r,null,e||"en",n||{},!0)}).toParts=function(r,e,n){return i(r,null,e||"en",n||{},!1)};var d={number:l,ordinal:l,spellout:l,duration:function(r,e){var n=r[2],a=t.duration[n]||t.duration.default,o=new Intl.NumberFormat(e,a.seconds).format,i=new Intl.NumberFormat(e,a.minutes).format,c=new Intl.NumberFormat(e,a.hours).format,l=/^fi$|^fi-|^da/.test(String(e))?".":":";return function(r,e){if(r=+r,!isFinite(r))return o(r);var n=~~(r/60/60),t=~~(r/60%60),a=(n?c(Math.abs(n))+l:"")+i(Math.abs(t))+l+o(Math.abs(r%60));return r<0?c(-1).replace(c(1),a):a}},date:u,time:u,plural:s,selectordinal:s,select:function(r,e){var n=r[2];return function(r,e){return(n[r]||n.other)(e)}}};e.types=d},240:r=>{"use strict";var e="zero",n="one",t="two",a="few",o="many",i="other",c=[function(r){return 1==+r?n:i},function(r){var e=+r;return 0<=e&&e<=1?n:i},function(r){return 0===Math.floor(Math.abs(+r))||1==+r?n:i},function(r){var c=+r;return 0===c?e:1===c?n:2===c?t:3<=c%100&&c%100<=10?a:11<=c%100&&c%100<=99?o:i},function(r){var e=Math.floor(Math.abs(+r)),t=(r+".").split(".")[1].length;return 1===e&&0===t?n:i},function(r){var e=+r;return e%10==1&&e%100!=11?n:2<=e%10&&e%10<=4&&(e%100<12||14{"use strict";var n="{",t="}",a=",",o="#",i="<",c=">",l="",s="'",f="offset:",d=["number","date","time","ordinal","duration","spellout"],h=["plural","select","selectordinal"];function p(r,e){var n=r.pattern,a=n.length,o=[],i=r.index,c=y(r,e);for(c&&o.push(c),c&&r.tokens&&r.tokens.push(["text",n.slice(i,r.index)]);r.index=9&&r<=13||32===r||133===r||160===r||6158===r||r>=8192&&r<=8205||8232===r||8233===r||8239===r||8287===r||8288===r||12288===r||65279===r}function m(r){for(var e=r.pattern,n=e.length,t=r.index;r.index=48&&e<=57);)++r.index;if(o===r.index)throw S(r,"offset number");r.tokens&&r.tokens.push(["number",n.slice(o,r.index)]),a=+n.slice(o,r.index)}return a}(r);m(r),v=[h,b,k,x(r,b)]}else if("select"===b)v=[h,b,x(r,b)];else if(d.indexOf(b)>=0)v=[h,b,w(r)];else{var E=r.index,O=w(r);m(r),e[r.index]===n&&(r.index=E,O=x(r,b)),v=[h,b,O]}if(m(r),e[r.index]!==t)throw S(r,t);return r.tokens&&r.tokens.push(["syntax",t]),++r.index,v}function g(r,e){for(var l=r.pattern,u=l.length,f="";r.index=0)throw S(r,null,null,'"other" sub-message must be specified in '+e);return o}function k(r,e){if(r.pattern[r.index]!==n)throw S(r,n+" to start sub-message");r.tokens&&r.tokens.push(["syntax",n]),++r.index;var a=p(r,e);if(r.pattern[r.index]!==t)throw S(r,t+" to end sub-message");return r.tokens&&r.tokens.push(["syntax",t]),++r.index,a}function S(r,e,n,t){var a=r.pattern,o=a.slice(0,r.index).split(/\r?\n/),i=r.index,c=o.length,l=o.slice(-1)[0].length;return n=n||(r.index>=a.length?"end of message pattern":g(r)||a[r.index]),t||(t=function(r,e){return r?"Expected "+r+" but found "+e:"Unexpected "+e+" found"}(e,n)),new E(t+=" in "+a.replace(/\r?\n/g,"\n"),e,n,i,c,l)}function E(r,e,n,t,a,o){Error.call(this,r),this.name="SyntaxError",this.message=r,this.expected=e,this.found=n,this.offset=t,this.line=a,this.column=o}e=r.exports=function(r,e){return p({pattern:String(r),index:0,tagsType:e&&e.tagsType||null,tokens:e&&e.tokens||null},"")},E.prototype=Object.create(Error.prototype),e.SyntaxError=E},540:(r,e,n)=>{"use strict";var t=n(784),a=n(157),o=n(240),i=n(144),c=n(160);function l(r,e){return Object.keys(e).forEach((function(n){r[n]=e[n]})),r}r.exports=function r(){var e=l({},c),n="en",u={},s=function(r){return r},f=null,d="warning",h={};function p(r,e,o){var i="string"==typeof r?r:r.default,c=m(i,"object"==typeof r&&r.id||s(i),o||n);return(c.format||(c.format=a(t(c.message),o||n,h)))(e)}p.rich=function(r,e,o){var i="string"==typeof r?r:r.default,c=m(i,"object"==typeof r&&r.id||s(i),o||n);return(c.toParts||(c.toParts=a.toParts(t(c.message,{tagsType:y}),o||n,h)))(e)};var y="<>";function v(r,e){var n=r[2];return function(r,e){var t="object"==typeof n?function(r,e){return Object.keys(r).reduce((function(n,t){return n[t]=r[t](e),n}),{})}(n,e):n;return"function"==typeof r?r(t):r}}function m(r,e,n){var t=i(n,u)||"en",a=u[t]||(u[t]={}),o=a[e];if("string"==typeof o&&(o=a[e]={message:o}),!o){var c='Translation for "'+e+'" in "'+t+'" is missing';if("warning"===d)"undefined"!=typeof console&&console.warn(c);else if("ignore"!==d)throw new Error(c);var l="function"==typeof f?f(r,e,t)||r:f||r;o=a[e]={message:l}}return o}function b(r,e,t,a,c){"object"==typeof t&&"object"!=typeof a&&(c=a,a=t,t=0);var l=i(c||n,o),u=l&&o[l][r]||g;return a["="+ +e]||a[u(e-t)]||a.other}function g(){return"other"}return h[y]=v,p.setup=function(r){return(r=r||{}).locale&&(n=r.locale),"translations"in r&&(u=r.translations||{}),r.generateId&&(s=r.generateId),"missingReplacement"in r&&(f=r.missingReplacement),r.missingTranslation&&(d=r.missingTranslation),r.formats&&(r.formats.number&&l(e.number,r.formats.number),r.formats.date&&l(e.date,r.formats.date),r.formats.time&&l(e.time,r.formats.time)),r.types&&((h=r.types)[y]=v),{locale:n,translations:u,generateId:s,missingReplacement:f,missingTranslation:d,formats:e,types:h}},p.number=function(r,t,a){var o=t&&e.number[t]||e.parseNumberPattern(t)||e.number.default;return new Intl.NumberFormat(a||n,o).format(r)},p.date=function(r,t,a){var o=t&&e.date[t]||e.parseDatePattern(t)||e.date.default;return new Intl.DateTimeFormat(a||n,o).format(r)},p.time=function(r,t,a){var o=t&&e.time[t]||e.parseDatePattern(t)||e.time.default;return new Intl.DateTimeFormat(a||n,o).format(r)},p.select=function(r,e){return e[r]||e.other},p.custom=function(r,e,n,t){return r[1]in h?h[r[1]](r,e)(n,t):n},p.plural=b.bind(null,"cardinal"),p.selectordinal=b.bind(null,"ordinal"),p.namespace=r,p}()},144:r=>{r.exports=function(r,e){if("string"==typeof r&&e[r])return r;for(var n=[].concat(r||[]),t=0,a=n.length;t{r&&r.d<1&&(r.d=1,r.forEach((r=>r.r--)),r.forEach((r=>r.r--?r.r++:r())))},l.a=(a,o,i)=>{var c;i&&((c=[]).d=-1);var l,u,s,f=new Set,d=a.exports,h=new Promise(((r,e)=>{s=e,u=r}));h[e]=d,h[r]=r=>(c&&r(c),f.forEach(r),h.catch((r=>{}))),a.exports=h,o((a=>{var o;l=(a=>a.map((a=>{if(null!==a&&"object"==typeof a){if(a[r])return a;if(a.then){var o=[];o.d=0,a.then((r=>{i[e]=r,t(o)}),(r=>{i[n]=r,t(o)}));var i={};return i[r]=r=>r(o),i}}var c={};return c[r]=r=>{},c[e]=a,c})))(a);var i=()=>l.map((r=>{if(r[n])throw r[n];return r[e]})),u=new Promise((e=>{(o=()=>e(i)).r=0;var n=r=>r!==c&&!f.has(r)&&(f.add(r),r&&!r.d&&(o.r++,r.push(o)));l.map((e=>e[r](n)))}));return o.r?u:i()}),(r=>(r?s(h[n]=r):u(d),t(c)))),c&&c.d<0&&(c.d=0)},l.n=r=>{var e=r&&r.__esModule?()=>r.default:()=>r;return l.d(e,{a:e}),e},o=Object.getPrototypeOf?r=>Object.getPrototypeOf(r):r=>r.__proto__,l.t=function(r,e){if(1&e&&(r=this(r)),8&e)return r;if("object"==typeof r&&r){if(4&e&&r.__esModule)return r;if(16&e&&"function"==typeof r.then)return r}var n=Object.create(null);l.r(n);var t={};a=a||[null,o({}),o([]),o(o)];for(var i=2&e&&r;"object"==typeof i&&!~a.indexOf(i);i=o(i))Object.getOwnPropertyNames(i).forEach((e=>t[e]=()=>r[e]));return t.default=()=>r,l.d(n,t),n},l.d=(r,e)=>{for(var n in e)l.o(e,n)&&!l.o(r,n)&&Object.defineProperty(r,n,{enumerable:!0,get:e[n]})},l.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e),l.r=r=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},l.p="./",l(344)})(); \ No newline at end of file