pxt-core 7.5.22 → 7.5.23

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.
package/built/pxt.js CHANGED
@@ -152889,62 +152889,64 @@ var pxsim;
152889
152889
  const single = !!((_a = this._currentRuntime) === null || _a === void 0 ? void 0 : _a.single);
152890
152890
  const parentWindow = window.parent && window.parent !== window.window
152891
152891
  ? window.parent : window.opener;
152892
- if (this.options.nestedEditorSim && parentWindow) {
152892
+ if (parentWindow) {
152893
152893
  // if message comes from parent already, don't echo
152894
152894
  if (source !== parentWindow) {
152895
152895
  const parentOrigin = this.options.parentOrigin || window.location.origin;
152896
152896
  parentWindow.postMessage(msg, parentOrigin);
152897
152897
  }
152898
- // send message to other editors
152899
152898
  }
152900
- else if (depEditors) {
152901
- depEditors.forEach(w => {
152902
- if (source !== w)
152903
- // dependant editors should be in the same origin
152904
- w.postMessage(msg, window.location.origin);
152905
- });
152906
- // start second simulator
152907
- }
152908
- else if (!single) {
152909
- const messageChannel = msg.type === "messagepacket" && msg.channel;
152910
- const messageSimulator = messageChannel &&
152911
- this.options.messageSimulators &&
152912
- this.options.messageSimulators[messageChannel];
152913
- // should we start an extension editor?
152914
- if (messageSimulator) {
152915
- // find a frame already running that simulator
152916
- let messageFrame = frames.find(frame => frame.dataset[FRAME_DATA_MESSAGE_CHANNEL] === messageChannel);
152917
- // not found, spin a new one
152918
- if (!messageFrame) {
152919
- const useLocalHost = pxsim.U.isLocalHost() && /localhostmessagesims=1/i.test(window.location.href);
152920
- const url = ((useLocalHost && messageSimulator.localHostUrl) || messageSimulator.url)
152921
- .replace("$PARENT_ORIGIN$", encodeURIComponent(this.options.parentOrigin || ""));
152922
- let wrapper = this.createFrame(url);
152923
- this.container.appendChild(wrapper);
152924
- messageFrame = wrapper.firstElementChild;
152925
- messageFrame.dataset[FRAME_DATA_MESSAGE_CHANNEL] = messageChannel;
152926
- pxsim.U.addClass(wrapper, "simmsg");
152927
- pxsim.U.addClass(wrapper, "simmsg" + messageChannel);
152928
- if (messageSimulator.permanent)
152929
- messageFrame.dataset[PERMANENT] = "true";
152930
- this.startFrame(messageFrame);
152931
- frames = this.simFrames(); // refresh
152932
- }
152933
- // not running the curren run, restart
152934
- else if (messageFrame.dataset['runid'] != this.runId) {
152935
- this.startFrame(messageFrame);
152936
- }
152937
- }
152938
- else {
152939
- // start secondary frame if needed
152940
- const mkcdFrames = frames.filter(frame => !frame.dataset[FRAME_DATA_MESSAGE_CHANNEL]);
152941
- if (mkcdFrames.length < 2) {
152942
- this.container.appendChild(this.createFrame());
152943
- frames = this.simFrames();
152944
- // there might be an old frame
152899
+ if (!this.options.nestedEditorSim && !(broadcastmsg === null || broadcastmsg === void 0 ? void 0 : broadcastmsg.toParentIFrameOnly)) {
152900
+ // send message to other editors
152901
+ if (depEditors) {
152902
+ depEditors.forEach(w => {
152903
+ if (source !== w)
152904
+ // dependant editors should be in the same origin
152905
+ w.postMessage(msg, window.location.origin);
152906
+ });
152907
+ // start second simulator
152908
+ }
152909
+ else if (!single) {
152910
+ const messageChannel = msg.type === "messagepacket" && msg.channel;
152911
+ const messageSimulator = messageChannel &&
152912
+ this.options.messageSimulators &&
152913
+ this.options.messageSimulators[messageChannel];
152914
+ // should we start an extension editor?
152915
+ if (messageSimulator) {
152916
+ // find a frame already running that simulator
152917
+ let messageFrame = frames.find(frame => frame.dataset[FRAME_DATA_MESSAGE_CHANNEL] === messageChannel);
152918
+ // not found, spin a new one
152919
+ if (!messageFrame) {
152920
+ const useLocalHost = pxsim.U.isLocalHost() && /localhostmessagesims=1/i.test(window.location.href);
152921
+ const url = ((useLocalHost && messageSimulator.localHostUrl) || messageSimulator.url)
152922
+ .replace("$PARENT_ORIGIN$", encodeURIComponent(this.options.parentOrigin || ""));
152923
+ let wrapper = this.createFrame(url);
152924
+ this.container.appendChild(wrapper);
152925
+ messageFrame = wrapper.firstElementChild;
152926
+ messageFrame.dataset[FRAME_DATA_MESSAGE_CHANNEL] = messageChannel;
152927
+ pxsim.U.addClass(wrapper, "simmsg");
152928
+ pxsim.U.addClass(wrapper, "simmsg" + messageChannel);
152929
+ if (messageSimulator.permanent)
152930
+ messageFrame.dataset[PERMANENT] = "true";
152931
+ this.startFrame(messageFrame);
152932
+ frames = this.simFrames(); // refresh
152933
+ }
152934
+ // not running the curren run, restart
152935
+ else if (messageFrame.dataset['runid'] != this.runId) {
152936
+ this.startFrame(messageFrame);
152937
+ }
152945
152938
  }
152946
- else if (mkcdFrames[1].dataset['runid'] != this.runId) {
152947
- this.startFrame(mkcdFrames[1]);
152939
+ else {
152940
+ // start secondary frame if needed
152941
+ const mkcdFrames = frames.filter(frame => !frame.dataset[FRAME_DATA_MESSAGE_CHANNEL]);
152942
+ if (mkcdFrames.length < 2) {
152943
+ this.container.appendChild(this.createFrame());
152944
+ frames = this.simFrames();
152945
+ // there might be an old frame
152946
+ }
152947
+ else if (mkcdFrames[1].dataset['runid'] != this.runId) {
152948
+ this.startFrame(mkcdFrames[1]);
152949
+ }
152948
152950
  }
152949
152951
  }
152950
152952
  }
@@ -153224,12 +153226,14 @@ var pxsim;
153224
153226
  }
153225
153227
  // ensure _currentRuntime is ready
153226
153228
  startFrame(frame) {
153229
+ var _a, _b;
153227
153230
  if (!this._currentRuntime || !frame.contentWindow)
153228
153231
  return false;
153229
153232
  const msg = JSON.parse(JSON.stringify(this._currentRuntime));
153230
153233
  msg.frameCounter = ++this.frameCounter;
153231
153234
  msg.options = {
153232
153235
  theme: this.themes[this.nextFrameId++ % this.themes.length],
153236
+ mpRole: (_b = (_a = /[\&\?]mp=(server|client)/i.exec(window.location.href)) === null || _a === void 0 ? void 0 : _a[1]) === null || _b === void 0 ? void 0 : _b.toLowerCase()
153233
153237
  };
153234
153238
  msg.id = `${msg.options.theme}-${this.nextId()}`;
153235
153239
  frame.dataset['runid'] = this.runId;
@@ -674,7 +674,7 @@ Blockly.Field.prototype.markDirty=function(){this.isDirty_=!0;this.constants_=nu
674
674
  Blockly.Field.prototype.setValue=function(a){if(null!==a){var b=this.doClassValidation_(a);a=this.processValidation_(a,b);if(!(a instanceof Error)){if(b=this.getValidator())if(b=b.call(this,a),a=this.processValidation_(a,b),a instanceof Error)return;b=this.sourceBlock_;if(!b||!b.disposed){var c=this.getValue();c===a?this.doValueUpdate_(a):(b&&Blockly.Events.isEnabled()&&Blockly.Events.fire(new (Blockly.Events.get(Blockly.Events.BLOCK_CHANGE))(b,"field",this.name||null,c,a)),this.doValueUpdate_(a),
675
675
  this.isDirty_&&this.forceRerender())}}}};Blockly.Field.prototype.processValidation_=function(a,b){if(null===b)return this.doValueInvalid_(a),this.isDirty_&&this.forceRerender(),Error();void 0!==b&&(a=b);return a};Blockly.Field.prototype.getValue=function(){return this.value_};Blockly.Field.prototype.doClassValidation_=function(a){return null===a||void 0===a?null:a};Blockly.Field.prototype.doValueUpdate_=function(a){this.value_=a;this.isDirty_=!0};Blockly.Field.prototype.doValueInvalid_=function(a){};
676
676
  Blockly.Field.prototype.onMouseDown_=function(a){this.sourceBlock_&&this.sourceBlock_.workspace&&(a=this.sourceBlock_.workspace.getGesture(a))&&a.setStartField(this)};Blockly.Field.prototype.setTooltip=function(a){a||""===a||(a=this.sourceBlock_);var b=this.getClickTarget_();b?b.tooltip=a:this.tooltip_=a};Blockly.Field.prototype.getTooltip=function(){var a=this.getClickTarget_();return a?Blockly.Tooltip.getTooltipOfObject(a):Blockly.Tooltip.getTooltipOfObject({tooltip:this.tooltip_})};
677
- Blockly.Field.prototype.getClickTarget_=function(){if(this.clickTarget_)return this.clickTarget_;if(!this.sourceBlock_)return null;for(var a=0,b=0,c=0,d;d=this.sourceBlock_.inputList[c];c++){for(var e=0,f;f=d.fieldRow[e];e++)f instanceof Blockly.FieldLabel||a++;d.connection&&b++}return this.clickTarget_=1>=a&&this.sourceBlock_.outputConnection&&!b?this.sourceBlock_.getSvgRoot():this.getSvgRoot()};
677
+ Blockly.Field.prototype.getClickTarget_=function(){if(this.clickTarget_)return this.clickTarget_;if(!this.sourceBlock_||!this.sourceBlock_.getSvgRoot)return null;for(var a=0,b=0,c=0,d;d=this.sourceBlock_.inputList[c];c++){for(var e=0,f;f=d.fieldRow[e];e++)f instanceof Blockly.FieldLabel||a++;d.connection&&b++}return this.clickTarget_=1>=a&&this.sourceBlock_.outputConnection&&!b?this.sourceBlock_.getSvgRoot():this.getSvgRoot()};
678
678
  Blockly.Field.prototype.getTotalFields_=function(a){a=void 0===a?!1:a;for(var b=0,c=0,d;d=this.sourceBlock_.inputList[c];c++)for(var e=0,f;f=d.fieldRow[e];e++)f instanceof Blockly.FieldLabel&&a||b++;return b};Blockly.Field.prototype.getAbsoluteXY_=function(){return Blockly.utils.style.getPageOffset(this.getClickTarget_())};Blockly.Field.prototype.referencesVariables=function(){return!1};
679
679
  Blockly.Field.prototype.getParentInput=function(){for(var a=null,b=this.sourceBlock_,c=b.inputList,d=0;d<b.inputList.length;d++)for(var e=c[d],f=e.fieldRow,g=0;g<f.length;g++)if(f[g]===this){a=e;break}return a};Blockly.Field.prototype.getFlipRtl=function(){return!1};Blockly.Field.prototype.isTabNavigable=function(){return!1};Blockly.Field.prototype.onShortcut=function(a){return!1};
680
680
  Blockly.Field.prototype.setCursorSvg=function(a){a?(this.fieldGroup_.appendChild(a),this.cursorSvg_=a):this.cursorSvg_=null};Blockly.Field.prototype.setMarkerSvg=function(a){a?(this.fieldGroup_.appendChild(a),this.markerSvg_=a):this.markerSvg_=null};Blockly.Field.prototype.updateMarkers_=function(){var a=this.sourceBlock_.workspace;a.keyboardAccessibilityMode&&this.cursorSvg_&&a.getCursor().draw();a.keyboardAccessibilityMode&&this.markerSvg_&&a.getMarker(Blockly.MarkerManager.LOCAL_MARKER).draw()};Blockly.fieldRegistry={};Blockly.fieldRegistry.register=function(a,b){Blockly.registry.register(Blockly.registry.Type.FIELD,a,b)};Blockly.fieldRegistry.unregister=function(a){Blockly.registry.unregister(Blockly.registry.Type.FIELD,a)};
@@ -1084,7 +1084,7 @@ return Blockly.Functions.namesInUse(b,null,a)[c]?(Blockly.alert(Blockly.Msg.VARI
1084
1084
  Blockly.Functions.mutateCallersAndDefinition=function(a,b,c){var d=Blockly.Functions.getDefinition(a,b);d?(a=Blockly.Functions.getCallers(a,d.workspace),a.push(d),Blockly.Events.setGroup(!0),a.forEach(function(a){var b=a.mutationToDom(),e=b&&Blockly.Xml.domToText(b);a.domToMutation(c);var h=a.mutationToDom(),k=h&&Blockly.Xml.domToText(h);if(e!=k)if(Blockly.Events.fire(new Blockly.Events.BlockChange(a,"mutation",null,e,k)),a.id==d.id){var l=Blockly.Functions.getArgMap(b),m=Blockly.Functions.getArgMap(h,
1085
1085
  !0);d.getDescendants().forEach(function(a){if(Blockly.pxtBlocklyUtils.isFunctionArgumentReporter(a)){var b=a.getFieldValue("VALUE"),c=l[b];m[c]?m[c]!==b&&a.setFieldValue(m[c],"VALUE"):a.dispose()}})}else setTimeout(function(){a.bumpNeighbours()},Blockly.BUMP_DELAY)}),Blockly.Events.setGroup(!1)):console.warn("Attempted to change function "+a+", but no definition block was found on the workspace")};
1086
1086
  Blockly.Functions.createFlyout=function(a,b){var c=new Blockly.Options({scrollbars:!0,disabledPatternId:a.options.disabledPatternId,parentWorkspace:a,rtl:a.RTL,oneBasedIndex:a.options.oneBasedIndex,horizontalLayout:a.horizontalLayout,toolboxPosition:a.options.toolboxPosition,zoomOptions:a.options.zoomOptions,renderer:a.options.renderer,rendererOverrides:a.options.rendererOverrides,newFunctions:a.options.newFunctions,move:{scrollbars:!0}});c=c.horizontalLayout?new Blockly.HorizontalFlyout(c):new Blockly.VerticalFlyout(c);
1087
- var d=c.createDom("svg");goog.dom.insertSiblingAfter(d,b);c.init(a);return c};Blockly.VERSION="4.0.9";Blockly.mainWorkspace=null;Blockly.selected=null;Blockly.draggingConnections=[];Blockly.clipboardXml_=null;Blockly.clipboardSource_=null;Blockly.clipboardTypeCounts_=null;Blockly.cache3dSupported_=null;Blockly.parentContainer=null;Blockly.svgSize=function(a){Blockly.utils.deprecation.warn("Blockly.svgSize","March 2021","March 2022","workspace.getCachedParentSvgSize");return new Blockly.utils.Size(a.cachedWidth_,a.cachedHeight_)};Blockly.resizeSvgContents=function(a){a.resizeContents()};
1087
+ var d=c.createDom("svg");goog.dom.insertSiblingAfter(d,b);c.init(a);return c};Blockly.VERSION="4.0.10";Blockly.mainWorkspace=null;Blockly.selected=null;Blockly.draggingConnections=[];Blockly.clipboardXml_=null;Blockly.clipboardSource_=null;Blockly.clipboardTypeCounts_=null;Blockly.cache3dSupported_=null;Blockly.parentContainer=null;Blockly.svgSize=function(a){Blockly.utils.deprecation.warn("Blockly.svgSize","March 2021","March 2022","workspace.getCachedParentSvgSize");return new Blockly.utils.Size(a.cachedWidth_,a.cachedHeight_)};Blockly.resizeSvgContents=function(a){a.resizeContents()};
1088
1088
  Blockly.svgResize=function(a){for(;a.options.parentWorkspace;)a=a.options.parentWorkspace;var b=a.getParentSvg(),c=a.getCachedParentSvgSize(),d=b.parentNode;if(d){var e=d.offsetWidth;d=d.offsetHeight;c.width!=e&&(b.setAttribute("width",e+"px"),a.setCachedParentSvgSize(e,null));c.height!=d&&(b.setAttribute("height",d+"px"),a.setCachedParentSvgSize(null,d));a.resize()}};
1089
1089
  Blockly.onKeyDown=function(a){var b=Blockly.mainWorkspace;if(b&&!(Blockly.utils.isTargetInput(a)||b.rendered&&!b.isVisible()))Blockly.ShortcutRegistry.registry.onKeyDown(b,a)};Blockly.deleteBlock=function(a){a.workspace.isFlyout||(Blockly.Events.setGroup(!0),Blockly.hideChaff(),a.outputConnection?a.dispose(!1,!0):a.dispose(!0,!0),Blockly.Events.setGroup(!1))};Blockly.copy=function(a){if(a=a.toCopyData())Blockly.clipboardXml_=a.xml,Blockly.clipboardSource_=a.source,Blockly.clipboardTypeCounts_=a.typeCounts};
1090
1090
  Blockly.paste=function(){if(!Blockly.clipboardXml_)return!1;var a=Blockly.clipboardSource_;a.isFlyout&&(a=a.targetWorkspace);return Blockly.clipboardTypeCounts_&&a.isCapacityAvailable(Blockly.clipboardTypeCounts_)?(Blockly.Events.setGroup(!0),a.paste(Blockly.clipboardXml_),Blockly.Events.setGroup(!1),!0):!1};
package/built/pxtsim.d.ts CHANGED
@@ -382,6 +382,7 @@ declare namespace pxsim {
382
382
  }
383
383
  interface SimulatorBroadcastMessage extends SimulatorMessage {
384
384
  broadcast: boolean;
385
+ toParentIFrameOnly?: boolean;
385
386
  }
386
387
  interface SimulatorControlMessage extends SimulatorBroadcastMessage {
387
388
  type: "messagepacket";
@@ -1219,6 +1220,7 @@ declare namespace pxsim {
1219
1220
  invalidatedClass?: string;
1220
1221
  nestedEditorSim?: boolean;
1221
1222
  parentOrigin?: string;
1223
+ mpRole?: string;
1222
1224
  messageSimulators?: pxt.Map<{
1223
1225
  url: string;
1224
1226
  localHostUrl?: string;
package/built/pxtsim.js CHANGED
@@ -6199,62 +6199,64 @@ var pxsim;
6199
6199
  const single = !!((_a = this._currentRuntime) === null || _a === void 0 ? void 0 : _a.single);
6200
6200
  const parentWindow = window.parent && window.parent !== window.window
6201
6201
  ? window.parent : window.opener;
6202
- if (this.options.nestedEditorSim && parentWindow) {
6202
+ if (parentWindow) {
6203
6203
  // if message comes from parent already, don't echo
6204
6204
  if (source !== parentWindow) {
6205
6205
  const parentOrigin = this.options.parentOrigin || window.location.origin;
6206
6206
  parentWindow.postMessage(msg, parentOrigin);
6207
6207
  }
6208
- // send message to other editors
6209
6208
  }
6210
- else if (depEditors) {
6211
- depEditors.forEach(w => {
6212
- if (source !== w)
6213
- // dependant editors should be in the same origin
6214
- w.postMessage(msg, window.location.origin);
6215
- });
6216
- // start second simulator
6217
- }
6218
- else if (!single) {
6219
- const messageChannel = msg.type === "messagepacket" && msg.channel;
6220
- const messageSimulator = messageChannel &&
6221
- this.options.messageSimulators &&
6222
- this.options.messageSimulators[messageChannel];
6223
- // should we start an extension editor?
6224
- if (messageSimulator) {
6225
- // find a frame already running that simulator
6226
- let messageFrame = frames.find(frame => frame.dataset[FRAME_DATA_MESSAGE_CHANNEL] === messageChannel);
6227
- // not found, spin a new one
6228
- if (!messageFrame) {
6229
- const useLocalHost = pxsim.U.isLocalHost() && /localhostmessagesims=1/i.test(window.location.href);
6230
- const url = ((useLocalHost && messageSimulator.localHostUrl) || messageSimulator.url)
6231
- .replace("$PARENT_ORIGIN$", encodeURIComponent(this.options.parentOrigin || ""));
6232
- let wrapper = this.createFrame(url);
6233
- this.container.appendChild(wrapper);
6234
- messageFrame = wrapper.firstElementChild;
6235
- messageFrame.dataset[FRAME_DATA_MESSAGE_CHANNEL] = messageChannel;
6236
- pxsim.U.addClass(wrapper, "simmsg");
6237
- pxsim.U.addClass(wrapper, "simmsg" + messageChannel);
6238
- if (messageSimulator.permanent)
6239
- messageFrame.dataset[PERMANENT] = "true";
6240
- this.startFrame(messageFrame);
6241
- frames = this.simFrames(); // refresh
6242
- }
6243
- // not running the curren run, restart
6244
- else if (messageFrame.dataset['runid'] != this.runId) {
6245
- this.startFrame(messageFrame);
6246
- }
6247
- }
6248
- else {
6249
- // start secondary frame if needed
6250
- const mkcdFrames = frames.filter(frame => !frame.dataset[FRAME_DATA_MESSAGE_CHANNEL]);
6251
- if (mkcdFrames.length < 2) {
6252
- this.container.appendChild(this.createFrame());
6253
- frames = this.simFrames();
6254
- // there might be an old frame
6209
+ if (!this.options.nestedEditorSim && !(broadcastmsg === null || broadcastmsg === void 0 ? void 0 : broadcastmsg.toParentIFrameOnly)) {
6210
+ // send message to other editors
6211
+ if (depEditors) {
6212
+ depEditors.forEach(w => {
6213
+ if (source !== w)
6214
+ // dependant editors should be in the same origin
6215
+ w.postMessage(msg, window.location.origin);
6216
+ });
6217
+ // start second simulator
6218
+ }
6219
+ else if (!single) {
6220
+ const messageChannel = msg.type === "messagepacket" && msg.channel;
6221
+ const messageSimulator = messageChannel &&
6222
+ this.options.messageSimulators &&
6223
+ this.options.messageSimulators[messageChannel];
6224
+ // should we start an extension editor?
6225
+ if (messageSimulator) {
6226
+ // find a frame already running that simulator
6227
+ let messageFrame = frames.find(frame => frame.dataset[FRAME_DATA_MESSAGE_CHANNEL] === messageChannel);
6228
+ // not found, spin a new one
6229
+ if (!messageFrame) {
6230
+ const useLocalHost = pxsim.U.isLocalHost() && /localhostmessagesims=1/i.test(window.location.href);
6231
+ const url = ((useLocalHost && messageSimulator.localHostUrl) || messageSimulator.url)
6232
+ .replace("$PARENT_ORIGIN$", encodeURIComponent(this.options.parentOrigin || ""));
6233
+ let wrapper = this.createFrame(url);
6234
+ this.container.appendChild(wrapper);
6235
+ messageFrame = wrapper.firstElementChild;
6236
+ messageFrame.dataset[FRAME_DATA_MESSAGE_CHANNEL] = messageChannel;
6237
+ pxsim.U.addClass(wrapper, "simmsg");
6238
+ pxsim.U.addClass(wrapper, "simmsg" + messageChannel);
6239
+ if (messageSimulator.permanent)
6240
+ messageFrame.dataset[PERMANENT] = "true";
6241
+ this.startFrame(messageFrame);
6242
+ frames = this.simFrames(); // refresh
6243
+ }
6244
+ // not running the curren run, restart
6245
+ else if (messageFrame.dataset['runid'] != this.runId) {
6246
+ this.startFrame(messageFrame);
6247
+ }
6255
6248
  }
6256
- else if (mkcdFrames[1].dataset['runid'] != this.runId) {
6257
- this.startFrame(mkcdFrames[1]);
6249
+ else {
6250
+ // start secondary frame if needed
6251
+ const mkcdFrames = frames.filter(frame => !frame.dataset[FRAME_DATA_MESSAGE_CHANNEL]);
6252
+ if (mkcdFrames.length < 2) {
6253
+ this.container.appendChild(this.createFrame());
6254
+ frames = this.simFrames();
6255
+ // there might be an old frame
6256
+ }
6257
+ else if (mkcdFrames[1].dataset['runid'] != this.runId) {
6258
+ this.startFrame(mkcdFrames[1]);
6259
+ }
6258
6260
  }
6259
6261
  }
6260
6262
  }
@@ -6534,12 +6536,14 @@ var pxsim;
6534
6536
  }
6535
6537
  // ensure _currentRuntime is ready
6536
6538
  startFrame(frame) {
6539
+ var _a, _b;
6537
6540
  if (!this._currentRuntime || !frame.contentWindow)
6538
6541
  return false;
6539
6542
  const msg = JSON.parse(JSON.stringify(this._currentRuntime));
6540
6543
  msg.frameCounter = ++this.frameCounter;
6541
6544
  msg.options = {
6542
6545
  theme: this.themes[this.nextFrameId++ % this.themes.length],
6546
+ mpRole: (_b = (_a = /[\&\?]mp=(server|client)/i.exec(window.location.href)) === null || _a === void 0 ? void 0 : _a[1]) === null || _b === void 0 ? void 0 : _b.toLowerCase()
6543
6547
  };
6544
6548
  msg.id = `${msg.options.theme}-${this.nextId()}`;
6545
6549
  frame.dataset['runid'] = this.runId;