@netless/window-manager 1.0.2 → 1.0.3

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/dist/index.mjs CHANGED
@@ -623,10 +623,10 @@ class BindContainerRoomPhaseInvalidError extends Error {
623
623
  this.message = "[WindowManager]: room phase only Connected can be bindContainer";
624
624
  }
625
625
  }
626
- const e$3 = "!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", s$3 = e$3.length, t$4 = Array(20), r$4 = () => {
626
+ const e$3 = "!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", s$3 = e$3.length, t$3 = Array(20), r$4 = () => {
627
627
  for (let r2 = 0; r2 < 20; r2++)
628
- t$4[r2] = e$3.charAt(Math.random() * s$3);
629
- return t$4.join("");
628
+ t$3[r2] = e$3.charAt(Math.random() * s$3);
629
+ return t$3.join("");
630
630
  };
631
631
  class o$2 {
632
632
  constructor() {
@@ -2996,561 +2996,200 @@ class ContainerResizeObserver {
2996
2996
  }
2997
2997
  }
2998
2998
  }
2999
- var react = { exports: {} };
3000
- var react_production_min = {};
3001
- /*
3002
- object-assign
3003
- (c) Sindre Sorhus
3004
- @license MIT
3005
- */
3006
- var getOwnPropertySymbols = Object.getOwnPropertySymbols;
3007
- var hasOwnProperty = Object.prototype.hasOwnProperty;
3008
- var propIsEnumerable = Object.prototype.propertyIsEnumerable;
3009
- function toObject(val) {
3010
- if (val === null || val === void 0) {
3011
- throw new TypeError("Object.assign cannot be called with null or undefined");
2999
+ var __defProp2 = Object.defineProperty;
3000
+ var __defProps2 = Object.defineProperties;
3001
+ var __getOwnPropDescs2 = Object.getOwnPropertyDescriptors;
3002
+ var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
3003
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
3004
+ var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
3005
+ var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3006
+ var __spreadValues2 = (a2, b2) => {
3007
+ for (var prop in b2 || (b2 = {}))
3008
+ if (__hasOwnProp2.call(b2, prop))
3009
+ __defNormalProp2(a2, prop, b2[prop]);
3010
+ if (__getOwnPropSymbols2)
3011
+ for (var prop of __getOwnPropSymbols2(b2)) {
3012
+ if (__propIsEnum2.call(b2, prop))
3013
+ __defNormalProp2(a2, prop, b2[prop]);
3014
+ }
3015
+ return a2;
3016
+ };
3017
+ var __spreadProps2 = (a2, b2) => __defProps2(a2, __getOwnPropDescs2(b2));
3018
+ var eventemitter3 = { exports: {} };
3019
+ (function(module) {
3020
+ var has2 = Object.prototype.hasOwnProperty, prefix = "~";
3021
+ function Events2() {
3012
3022
  }
3013
- return Object(val);
3014
- }
3015
- function shouldUseNative$1() {
3016
- try {
3017
- if (!Object.assign) {
3018
- return false;
3023
+ if (Object.create) {
3024
+ Events2.prototype = /* @__PURE__ */ Object.create(null);
3025
+ if (!new Events2().__proto__)
3026
+ prefix = false;
3027
+ }
3028
+ function EE(fn, context, once) {
3029
+ this.fn = fn;
3030
+ this.context = context;
3031
+ this.once = once || false;
3032
+ }
3033
+ function addListener(emitter, event, fn, context, once) {
3034
+ if (typeof fn !== "function") {
3035
+ throw new TypeError("The listener must be a function");
3019
3036
  }
3020
- var test1 = new String("abc");
3021
- test1[5] = "de";
3022
- if (Object.getOwnPropertyNames(test1)[0] === "5") {
3023
- return false;
3037
+ var listener = new EE(fn, context || emitter, once), evt = prefix ? prefix + event : event;
3038
+ if (!emitter._events[evt])
3039
+ emitter._events[evt] = listener, emitter._eventsCount++;
3040
+ else if (!emitter._events[evt].fn)
3041
+ emitter._events[evt].push(listener);
3042
+ else
3043
+ emitter._events[evt] = [emitter._events[evt], listener];
3044
+ return emitter;
3045
+ }
3046
+ function clearEvent(emitter, evt) {
3047
+ if (--emitter._eventsCount === 0)
3048
+ emitter._events = new Events2();
3049
+ else
3050
+ delete emitter._events[evt];
3051
+ }
3052
+ function EventEmitter2() {
3053
+ this._events = new Events2();
3054
+ this._eventsCount = 0;
3055
+ }
3056
+ EventEmitter2.prototype.eventNames = function eventNames() {
3057
+ var names = [], events2, name;
3058
+ if (this._eventsCount === 0)
3059
+ return names;
3060
+ for (name in events2 = this._events) {
3061
+ if (has2.call(events2, name))
3062
+ names.push(prefix ? name.slice(1) : name);
3024
3063
  }
3025
- var test2 = {};
3026
- for (var i2 = 0; i2 < 10; i2++) {
3027
- test2["_" + String.fromCharCode(i2)] = i2;
3064
+ if (Object.getOwnPropertySymbols) {
3065
+ return names.concat(Object.getOwnPropertySymbols(events2));
3028
3066
  }
3029
- var order2 = Object.getOwnPropertyNames(test2).map(function(n2) {
3030
- return test2[n2];
3031
- });
3032
- if (order2.join("") !== "0123456789") {
3033
- return false;
3067
+ return names;
3068
+ };
3069
+ EventEmitter2.prototype.listeners = function listeners(event) {
3070
+ var evt = prefix ? prefix + event : event, handlers = this._events[evt];
3071
+ if (!handlers)
3072
+ return [];
3073
+ if (handlers.fn)
3074
+ return [handlers.fn];
3075
+ for (var i2 = 0, l2 = handlers.length, ee2 = new Array(l2); i2 < l2; i2++) {
3076
+ ee2[i2] = handlers[i2].fn;
3034
3077
  }
3035
- var test3 = {};
3036
- "abcdefghijklmnopqrst".split("").forEach(function(letter) {
3037
- test3[letter] = letter;
3038
- });
3039
- if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
3078
+ return ee2;
3079
+ };
3080
+ EventEmitter2.prototype.listenerCount = function listenerCount(event) {
3081
+ var evt = prefix ? prefix + event : event, listeners = this._events[evt];
3082
+ if (!listeners)
3083
+ return 0;
3084
+ if (listeners.fn)
3085
+ return 1;
3086
+ return listeners.length;
3087
+ };
3088
+ EventEmitter2.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
3089
+ var evt = prefix ? prefix + event : event;
3090
+ if (!this._events[evt])
3040
3091
  return false;
3092
+ var listeners = this._events[evt], len = arguments.length, args, i2;
3093
+ if (listeners.fn) {
3094
+ if (listeners.once)
3095
+ this.removeListener(event, listeners.fn, void 0, true);
3096
+ switch (len) {
3097
+ case 1:
3098
+ return listeners.fn.call(listeners.context), true;
3099
+ case 2:
3100
+ return listeners.fn.call(listeners.context, a1), true;
3101
+ case 3:
3102
+ return listeners.fn.call(listeners.context, a1, a2), true;
3103
+ case 4:
3104
+ return listeners.fn.call(listeners.context, a1, a2, a3), true;
3105
+ case 5:
3106
+ return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
3107
+ case 6:
3108
+ return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
3109
+ }
3110
+ for (i2 = 1, args = new Array(len - 1); i2 < len; i2++) {
3111
+ args[i2 - 1] = arguments[i2];
3112
+ }
3113
+ listeners.fn.apply(listeners.context, args);
3114
+ } else {
3115
+ var length = listeners.length, j2;
3116
+ for (i2 = 0; i2 < length; i2++) {
3117
+ if (listeners[i2].once)
3118
+ this.removeListener(event, listeners[i2].fn, void 0, true);
3119
+ switch (len) {
3120
+ case 1:
3121
+ listeners[i2].fn.call(listeners[i2].context);
3122
+ break;
3123
+ case 2:
3124
+ listeners[i2].fn.call(listeners[i2].context, a1);
3125
+ break;
3126
+ case 3:
3127
+ listeners[i2].fn.call(listeners[i2].context, a1, a2);
3128
+ break;
3129
+ case 4:
3130
+ listeners[i2].fn.call(listeners[i2].context, a1, a2, a3);
3131
+ break;
3132
+ default:
3133
+ if (!args)
3134
+ for (j2 = 1, args = new Array(len - 1); j2 < len; j2++) {
3135
+ args[j2 - 1] = arguments[j2];
3136
+ }
3137
+ listeners[i2].fn.apply(listeners[i2].context, args);
3138
+ }
3139
+ }
3041
3140
  }
3042
3141
  return true;
3043
- } catch (err) {
3044
- return false;
3045
- }
3046
- }
3047
- var objectAssign = shouldUseNative$1() ? Object.assign : function(target, source) {
3048
- var from;
3049
- var to = toObject(target);
3050
- var symbols;
3051
- for (var s2 = 1; s2 < arguments.length; s2++) {
3052
- from = Object(arguments[s2]);
3053
- for (var key in from) {
3054
- if (hasOwnProperty.call(from, key)) {
3055
- to[key] = from[key];
3056
- }
3142
+ };
3143
+ EventEmitter2.prototype.on = function on(event, fn, context) {
3144
+ return addListener(this, event, fn, context, false);
3145
+ };
3146
+ EventEmitter2.prototype.once = function once(event, fn, context) {
3147
+ return addListener(this, event, fn, context, true);
3148
+ };
3149
+ EventEmitter2.prototype.removeListener = function removeListener(event, fn, context, once) {
3150
+ var evt = prefix ? prefix + event : event;
3151
+ if (!this._events[evt])
3152
+ return this;
3153
+ if (!fn) {
3154
+ clearEvent(this, evt);
3155
+ return this;
3057
3156
  }
3058
- if (getOwnPropertySymbols) {
3059
- symbols = getOwnPropertySymbols(from);
3060
- for (var i2 = 0; i2 < symbols.length; i2++) {
3061
- if (propIsEnumerable.call(from, symbols[i2])) {
3062
- to[symbols[i2]] = from[symbols[i2]];
3157
+ var listeners = this._events[evt];
3158
+ if (listeners.fn) {
3159
+ if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) {
3160
+ clearEvent(this, evt);
3161
+ }
3162
+ } else {
3163
+ for (var i2 = 0, events2 = [], length = listeners.length; i2 < length; i2++) {
3164
+ if (listeners[i2].fn !== fn || once && !listeners[i2].once || context && listeners[i2].context !== context) {
3165
+ events2.push(listeners[i2]);
3063
3166
  }
3064
3167
  }
3168
+ if (events2.length)
3169
+ this._events[evt] = events2.length === 1 ? events2[0] : events2;
3170
+ else
3171
+ clearEvent(this, evt);
3172
+ }
3173
+ return this;
3174
+ };
3175
+ EventEmitter2.prototype.removeAllListeners = function removeAllListeners(event) {
3176
+ var evt;
3177
+ if (event) {
3178
+ evt = prefix ? prefix + event : event;
3179
+ if (this._events[evt])
3180
+ clearEvent(this, evt);
3181
+ } else {
3182
+ this._events = new Events2();
3183
+ this._eventsCount = 0;
3065
3184
  }
3066
- }
3067
- return to;
3068
- };
3069
- /** @license React v16.14.0
3070
- * react.production.min.js
3071
- *
3072
- * Copyright (c) Facebook, Inc. and its affiliates.
3073
- *
3074
- * This source code is licensed under the MIT license found in the
3075
- * LICENSE file in the root directory of this source tree.
3076
- */
3077
- var l$1 = objectAssign, n$2 = typeof Symbol === "function" && Symbol.for, p = n$2 ? Symbol.for("react.element") : 60103, q$1 = n$2 ? Symbol.for("react.portal") : 60106, r$3 = n$2 ? Symbol.for("react.fragment") : 60107, t$3 = n$2 ? Symbol.for("react.strict_mode") : 60108, u$2 = n$2 ? Symbol.for("react.profiler") : 60114, v$2 = n$2 ? Symbol.for("react.provider") : 60109, w$1 = n$2 ? Symbol.for("react.context") : 60110, x$1 = n$2 ? Symbol.for("react.forward_ref") : 60112, y$1 = n$2 ? Symbol.for("react.suspense") : 60113, z$1 = n$2 ? Symbol.for("react.memo") : 60115, A$1 = n$2 ? Symbol.for("react.lazy") : 60116, B$1 = typeof Symbol === "function" && Symbol.iterator;
3078
- function C$2(a2) {
3079
- for (var b2 = "https://reactjs.org/docs/error-decoder.html?invariant=" + a2, c2 = 1; c2 < arguments.length; c2++)
3080
- b2 += "&args[]=" + encodeURIComponent(arguments[c2]);
3081
- return "Minified React error #" + a2 + "; visit " + b2 + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
3082
- }
3083
- var D$1 = { isMounted: function() {
3084
- return false;
3085
- }, enqueueForceUpdate: function() {
3086
- }, enqueueReplaceState: function() {
3087
- }, enqueueSetState: function() {
3088
- } }, E$2 = {};
3089
- function F$2(a2, b2, c2) {
3090
- this.props = a2;
3091
- this.context = b2;
3092
- this.refs = E$2;
3093
- this.updater = c2 || D$1;
3094
- }
3095
- F$2.prototype.isReactComponent = {};
3096
- F$2.prototype.setState = function(a2, b2) {
3097
- if (typeof a2 !== "object" && typeof a2 !== "function" && a2 != null)
3098
- throw Error(C$2(85));
3099
- this.updater.enqueueSetState(this, a2, b2, "setState");
3100
- };
3101
- F$2.prototype.forceUpdate = function(a2) {
3102
- this.updater.enqueueForceUpdate(this, a2, "forceUpdate");
3103
- };
3104
- function G$2() {
3105
- }
3106
- G$2.prototype = F$2.prototype;
3107
- function H$2(a2, b2, c2) {
3108
- this.props = a2;
3109
- this.context = b2;
3110
- this.refs = E$2;
3111
- this.updater = c2 || D$1;
3112
- }
3113
- var I$2 = H$2.prototype = new G$2();
3114
- I$2.constructor = H$2;
3115
- l$1(I$2, F$2.prototype);
3116
- I$2.isPureReactComponent = true;
3117
- var J$2 = { current: null }, K$2 = Object.prototype.hasOwnProperty, L$2 = { key: true, ref: true, __self: true, __source: true };
3118
- function M$2(a2, b2, c2) {
3119
- var e2, d2 = {}, g2 = null, k2 = null;
3120
- if (b2 != null)
3121
- for (e2 in b2.ref !== void 0 && (k2 = b2.ref), b2.key !== void 0 && (g2 = "" + b2.key), b2)
3122
- K$2.call(b2, e2) && !L$2.hasOwnProperty(e2) && (d2[e2] = b2[e2]);
3123
- var f2 = arguments.length - 2;
3124
- if (f2 === 1)
3125
- d2.children = c2;
3126
- else if (1 < f2) {
3127
- for (var h2 = Array(f2), m2 = 0; m2 < f2; m2++)
3128
- h2[m2] = arguments[m2 + 2];
3129
- d2.children = h2;
3130
- }
3131
- if (a2 && a2.defaultProps)
3132
- for (e2 in f2 = a2.defaultProps, f2)
3133
- d2[e2] === void 0 && (d2[e2] = f2[e2]);
3134
- return { $$typeof: p, type: a2, key: g2, ref: k2, props: d2, _owner: J$2.current };
3135
- }
3136
- function N$2(a2, b2) {
3137
- return { $$typeof: p, type: a2.type, key: b2, ref: a2.ref, props: a2.props, _owner: a2._owner };
3138
- }
3139
- function O$2(a2) {
3140
- return typeof a2 === "object" && a2 !== null && a2.$$typeof === p;
3141
- }
3142
- function escape(a2) {
3143
- var b2 = { "=": "=0", ":": "=2" };
3144
- return "$" + ("" + a2).replace(/[=:]/g, function(a3) {
3145
- return b2[a3];
3146
- });
3147
- }
3148
- var P$2 = /\/+/g, Q$2 = [];
3149
- function R$2(a2, b2, c2, e2) {
3150
- if (Q$2.length) {
3151
- var d2 = Q$2.pop();
3152
- d2.result = a2;
3153
- d2.keyPrefix = b2;
3154
- d2.func = c2;
3155
- d2.context = e2;
3156
- d2.count = 0;
3157
- return d2;
3158
- }
3159
- return { result: a2, keyPrefix: b2, func: c2, context: e2, count: 0 };
3160
- }
3161
- function S$2(a2) {
3162
- a2.result = null;
3163
- a2.keyPrefix = null;
3164
- a2.func = null;
3165
- a2.context = null;
3166
- a2.count = 0;
3167
- 10 > Q$2.length && Q$2.push(a2);
3168
- }
3169
- function T$2(a2, b2, c2, e2) {
3170
- var d2 = typeof a2;
3171
- if (d2 === "undefined" || d2 === "boolean")
3172
- a2 = null;
3173
- var g2 = false;
3174
- if (a2 === null)
3175
- g2 = true;
3176
- else
3177
- switch (d2) {
3178
- case "string":
3179
- case "number":
3180
- g2 = true;
3181
- break;
3182
- case "object":
3183
- switch (a2.$$typeof) {
3184
- case p:
3185
- case q$1:
3186
- g2 = true;
3187
- }
3188
- }
3189
- if (g2)
3190
- return c2(e2, a2, b2 === "" ? "." + U$2(a2, 0) : b2), 1;
3191
- g2 = 0;
3192
- b2 = b2 === "" ? "." : b2 + ":";
3193
- if (Array.isArray(a2))
3194
- for (var k2 = 0; k2 < a2.length; k2++) {
3195
- d2 = a2[k2];
3196
- var f2 = b2 + U$2(d2, k2);
3197
- g2 += T$2(d2, f2, c2, e2);
3198
- }
3199
- else if (a2 === null || typeof a2 !== "object" ? f2 = null : (f2 = B$1 && a2[B$1] || a2["@@iterator"], f2 = typeof f2 === "function" ? f2 : null), typeof f2 === "function")
3200
- for (a2 = f2.call(a2), k2 = 0; !(d2 = a2.next()).done; )
3201
- d2 = d2.value, f2 = b2 + U$2(d2, k2++), g2 += T$2(d2, f2, c2, e2);
3202
- else if (d2 === "object")
3203
- throw c2 = "" + a2, Error(C$2(31, c2 === "[object Object]" ? "object with keys {" + Object.keys(a2).join(", ") + "}" : c2, ""));
3204
- return g2;
3205
- }
3206
- function V$2(a2, b2, c2) {
3207
- return a2 == null ? 0 : T$2(a2, "", b2, c2);
3208
- }
3209
- function U$2(a2, b2) {
3210
- return typeof a2 === "object" && a2 !== null && a2.key != null ? escape(a2.key) : b2.toString(36);
3211
- }
3212
- function W$2(a2, b2) {
3213
- a2.func.call(a2.context, b2, a2.count++);
3214
- }
3215
- function aa$1(a2, b2, c2) {
3216
- var e2 = a2.result, d2 = a2.keyPrefix;
3217
- a2 = a2.func.call(a2.context, b2, a2.count++);
3218
- Array.isArray(a2) ? X$2(a2, e2, c2, function(a3) {
3219
- return a3;
3220
- }) : a2 != null && (O$2(a2) && (a2 = N$2(a2, d2 + (!a2.key || b2 && b2.key === a2.key ? "" : ("" + a2.key).replace(P$2, "$&/") + "/") + c2)), e2.push(a2));
3221
- }
3222
- function X$2(a2, b2, c2, e2, d2) {
3223
- var g2 = "";
3224
- c2 != null && (g2 = ("" + c2).replace(P$2, "$&/") + "/");
3225
- b2 = R$2(b2, g2, e2, d2);
3226
- V$2(a2, aa$1, b2);
3227
- S$2(b2);
3228
- }
3229
- var Y$2 = { current: null };
3230
- function Z$2() {
3231
- var a2 = Y$2.current;
3232
- if (a2 === null)
3233
- throw Error(C$2(321));
3234
- return a2;
3235
- }
3236
- var ba$1 = { ReactCurrentDispatcher: Y$2, ReactCurrentBatchConfig: { suspense: null }, ReactCurrentOwner: J$2, IsSomeRendererActing: { current: false }, assign: l$1 };
3237
- react_production_min.Children = { map: function(a2, b2, c2) {
3238
- if (a2 == null)
3239
- return a2;
3240
- var e2 = [];
3241
- X$2(a2, e2, null, b2, c2);
3242
- return e2;
3243
- }, forEach: function(a2, b2, c2) {
3244
- if (a2 == null)
3245
- return a2;
3246
- b2 = R$2(null, null, b2, c2);
3247
- V$2(a2, W$2, b2);
3248
- S$2(b2);
3249
- }, count: function(a2) {
3250
- return V$2(a2, function() {
3251
- return null;
3252
- }, null);
3253
- }, toArray: function(a2) {
3254
- var b2 = [];
3255
- X$2(a2, b2, null, function(a3) {
3256
- return a3;
3257
- });
3258
- return b2;
3259
- }, only: function(a2) {
3260
- if (!O$2(a2))
3261
- throw Error(C$2(143));
3262
- return a2;
3263
- } };
3264
- react_production_min.Component = F$2;
3265
- react_production_min.Fragment = r$3;
3266
- react_production_min.Profiler = u$2;
3267
- react_production_min.PureComponent = H$2;
3268
- react_production_min.StrictMode = t$3;
3269
- react_production_min.Suspense = y$1;
3270
- react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ba$1;
3271
- react_production_min.cloneElement = function(a2, b2, c2) {
3272
- if (a2 === null || a2 === void 0)
3273
- throw Error(C$2(267, a2));
3274
- var e2 = l$1({}, a2.props), d2 = a2.key, g2 = a2.ref, k2 = a2._owner;
3275
- if (b2 != null) {
3276
- b2.ref !== void 0 && (g2 = b2.ref, k2 = J$2.current);
3277
- b2.key !== void 0 && (d2 = "" + b2.key);
3278
- if (a2.type && a2.type.defaultProps)
3279
- var f2 = a2.type.defaultProps;
3280
- for (h2 in b2)
3281
- K$2.call(b2, h2) && !L$2.hasOwnProperty(h2) && (e2[h2] = b2[h2] === void 0 && f2 !== void 0 ? f2[h2] : b2[h2]);
3282
- }
3283
- var h2 = arguments.length - 2;
3284
- if (h2 === 1)
3285
- e2.children = c2;
3286
- else if (1 < h2) {
3287
- f2 = Array(h2);
3288
- for (var m2 = 0; m2 < h2; m2++)
3289
- f2[m2] = arguments[m2 + 2];
3290
- e2.children = f2;
3291
- }
3292
- return {
3293
- $$typeof: p,
3294
- type: a2.type,
3295
- key: d2,
3296
- ref: g2,
3297
- props: e2,
3298
- _owner: k2
3299
- };
3300
- };
3301
- react_production_min.createContext = function(a2, b2) {
3302
- b2 === void 0 && (b2 = null);
3303
- a2 = { $$typeof: w$1, _calculateChangedBits: b2, _currentValue: a2, _currentValue2: a2, _threadCount: 0, Provider: null, Consumer: null };
3304
- a2.Provider = { $$typeof: v$2, _context: a2 };
3305
- return a2.Consumer = a2;
3306
- };
3307
- react_production_min.createElement = M$2;
3308
- react_production_min.createFactory = function(a2) {
3309
- var b2 = M$2.bind(null, a2);
3310
- b2.type = a2;
3311
- return b2;
3312
- };
3313
- react_production_min.createRef = function() {
3314
- return { current: null };
3315
- };
3316
- react_production_min.forwardRef = function(a2) {
3317
- return { $$typeof: x$1, render: a2 };
3318
- };
3319
- react_production_min.isValidElement = O$2;
3320
- react_production_min.lazy = function(a2) {
3321
- return { $$typeof: A$1, _ctor: a2, _status: -1, _result: null };
3322
- };
3323
- react_production_min.memo = function(a2, b2) {
3324
- return { $$typeof: z$1, type: a2, compare: b2 === void 0 ? null : b2 };
3325
- };
3326
- react_production_min.useCallback = function(a2, b2) {
3327
- return Z$2().useCallback(a2, b2);
3328
- };
3329
- react_production_min.useContext = function(a2, b2) {
3330
- return Z$2().useContext(a2, b2);
3331
- };
3332
- react_production_min.useDebugValue = function() {
3333
- };
3334
- react_production_min.useEffect = function(a2, b2) {
3335
- return Z$2().useEffect(a2, b2);
3336
- };
3337
- react_production_min.useImperativeHandle = function(a2, b2, c2) {
3338
- return Z$2().useImperativeHandle(a2, b2, c2);
3339
- };
3340
- react_production_min.useLayoutEffect = function(a2, b2) {
3341
- return Z$2().useLayoutEffect(a2, b2);
3342
- };
3343
- react_production_min.useMemo = function(a2, b2) {
3344
- return Z$2().useMemo(a2, b2);
3345
- };
3346
- react_production_min.useReducer = function(a2, b2, c2) {
3347
- return Z$2().useReducer(a2, b2, c2);
3348
- };
3349
- react_production_min.useRef = function(a2) {
3350
- return Z$2().useRef(a2);
3351
- };
3352
- react_production_min.useState = function(a2) {
3353
- return Z$2().useState(a2);
3354
- };
3355
- react_production_min.version = "16.14.0";
3356
- {
3357
- react.exports = react_production_min;
3358
- }
3359
- var l = react.exports;
3360
- var __defProp2 = Object.defineProperty;
3361
- var __defProps2 = Object.defineProperties;
3362
- var __getOwnPropDescs2 = Object.getOwnPropertyDescriptors;
3363
- var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
3364
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
3365
- var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
3366
- var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3367
- var __spreadValues2 = (a2, b2) => {
3368
- for (var prop in b2 || (b2 = {}))
3369
- if (__hasOwnProp2.call(b2, prop))
3370
- __defNormalProp2(a2, prop, b2[prop]);
3371
- if (__getOwnPropSymbols2)
3372
- for (var prop of __getOwnPropSymbols2(b2)) {
3373
- if (__propIsEnum2.call(b2, prop))
3374
- __defNormalProp2(a2, prop, b2[prop]);
3375
- }
3376
- return a2;
3377
- };
3378
- var __spreadProps2 = (a2, b2) => __defProps2(a2, __getOwnPropDescs2(b2));
3379
- var eventemitter3 = { exports: {} };
3380
- (function(module) {
3381
- var has2 = Object.prototype.hasOwnProperty, prefix = "~";
3382
- function Events2() {
3383
- }
3384
- if (Object.create) {
3385
- Events2.prototype = /* @__PURE__ */ Object.create(null);
3386
- if (!new Events2().__proto__)
3387
- prefix = false;
3388
- }
3389
- function EE(fn, context, once) {
3390
- this.fn = fn;
3391
- this.context = context;
3392
- this.once = once || false;
3393
- }
3394
- function addListener(emitter, event, fn, context, once) {
3395
- if (typeof fn !== "function") {
3396
- throw new TypeError("The listener must be a function");
3397
- }
3398
- var listener = new EE(fn, context || emitter, once), evt = prefix ? prefix + event : event;
3399
- if (!emitter._events[evt])
3400
- emitter._events[evt] = listener, emitter._eventsCount++;
3401
- else if (!emitter._events[evt].fn)
3402
- emitter._events[evt].push(listener);
3403
- else
3404
- emitter._events[evt] = [emitter._events[evt], listener];
3405
- return emitter;
3406
- }
3407
- function clearEvent(emitter, evt) {
3408
- if (--emitter._eventsCount === 0)
3409
- emitter._events = new Events2();
3410
- else
3411
- delete emitter._events[evt];
3412
- }
3413
- function EventEmitter2() {
3414
- this._events = new Events2();
3415
- this._eventsCount = 0;
3416
- }
3417
- EventEmitter2.prototype.eventNames = function eventNames() {
3418
- var names = [], events2, name;
3419
- if (this._eventsCount === 0)
3420
- return names;
3421
- for (name in events2 = this._events) {
3422
- if (has2.call(events2, name))
3423
- names.push(prefix ? name.slice(1) : name);
3424
- }
3425
- if (Object.getOwnPropertySymbols) {
3426
- return names.concat(Object.getOwnPropertySymbols(events2));
3427
- }
3428
- return names;
3429
- };
3430
- EventEmitter2.prototype.listeners = function listeners(event) {
3431
- var evt = prefix ? prefix + event : event, handlers = this._events[evt];
3432
- if (!handlers)
3433
- return [];
3434
- if (handlers.fn)
3435
- return [handlers.fn];
3436
- for (var i2 = 0, l2 = handlers.length, ee2 = new Array(l2); i2 < l2; i2++) {
3437
- ee2[i2] = handlers[i2].fn;
3438
- }
3439
- return ee2;
3440
- };
3441
- EventEmitter2.prototype.listenerCount = function listenerCount(event) {
3442
- var evt = prefix ? prefix + event : event, listeners = this._events[evt];
3443
- if (!listeners)
3444
- return 0;
3445
- if (listeners.fn)
3446
- return 1;
3447
- return listeners.length;
3448
- };
3449
- EventEmitter2.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
3450
- var evt = prefix ? prefix + event : event;
3451
- if (!this._events[evt])
3452
- return false;
3453
- var listeners = this._events[evt], len = arguments.length, args, i2;
3454
- if (listeners.fn) {
3455
- if (listeners.once)
3456
- this.removeListener(event, listeners.fn, void 0, true);
3457
- switch (len) {
3458
- case 1:
3459
- return listeners.fn.call(listeners.context), true;
3460
- case 2:
3461
- return listeners.fn.call(listeners.context, a1), true;
3462
- case 3:
3463
- return listeners.fn.call(listeners.context, a1, a2), true;
3464
- case 4:
3465
- return listeners.fn.call(listeners.context, a1, a2, a3), true;
3466
- case 5:
3467
- return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
3468
- case 6:
3469
- return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
3470
- }
3471
- for (i2 = 1, args = new Array(len - 1); i2 < len; i2++) {
3472
- args[i2 - 1] = arguments[i2];
3473
- }
3474
- listeners.fn.apply(listeners.context, args);
3475
- } else {
3476
- var length = listeners.length, j2;
3477
- for (i2 = 0; i2 < length; i2++) {
3478
- if (listeners[i2].once)
3479
- this.removeListener(event, listeners[i2].fn, void 0, true);
3480
- switch (len) {
3481
- case 1:
3482
- listeners[i2].fn.call(listeners[i2].context);
3483
- break;
3484
- case 2:
3485
- listeners[i2].fn.call(listeners[i2].context, a1);
3486
- break;
3487
- case 3:
3488
- listeners[i2].fn.call(listeners[i2].context, a1, a2);
3489
- break;
3490
- case 4:
3491
- listeners[i2].fn.call(listeners[i2].context, a1, a2, a3);
3492
- break;
3493
- default:
3494
- if (!args)
3495
- for (j2 = 1, args = new Array(len - 1); j2 < len; j2++) {
3496
- args[j2 - 1] = arguments[j2];
3497
- }
3498
- listeners[i2].fn.apply(listeners[i2].context, args);
3499
- }
3500
- }
3501
- }
3502
- return true;
3503
- };
3504
- EventEmitter2.prototype.on = function on(event, fn, context) {
3505
- return addListener(this, event, fn, context, false);
3506
- };
3507
- EventEmitter2.prototype.once = function once(event, fn, context) {
3508
- return addListener(this, event, fn, context, true);
3509
- };
3510
- EventEmitter2.prototype.removeListener = function removeListener(event, fn, context, once) {
3511
- var evt = prefix ? prefix + event : event;
3512
- if (!this._events[evt])
3513
- return this;
3514
- if (!fn) {
3515
- clearEvent(this, evt);
3516
- return this;
3517
- }
3518
- var listeners = this._events[evt];
3519
- if (listeners.fn) {
3520
- if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) {
3521
- clearEvent(this, evt);
3522
- }
3523
- } else {
3524
- for (var i2 = 0, events2 = [], length = listeners.length; i2 < length; i2++) {
3525
- if (listeners[i2].fn !== fn || once && !listeners[i2].once || context && listeners[i2].context !== context) {
3526
- events2.push(listeners[i2]);
3527
- }
3528
- }
3529
- if (events2.length)
3530
- this._events[evt] = events2.length === 1 ? events2[0] : events2;
3531
- else
3532
- clearEvent(this, evt);
3533
- }
3534
- return this;
3535
- };
3536
- EventEmitter2.prototype.removeAllListeners = function removeAllListeners(event) {
3537
- var evt;
3538
- if (event) {
3539
- evt = prefix ? prefix + event : event;
3540
- if (this._events[evt])
3541
- clearEvent(this, evt);
3542
- } else {
3543
- this._events = new Events2();
3544
- this._eventsCount = 0;
3545
- }
3546
- return this;
3547
- };
3548
- EventEmitter2.prototype.off = EventEmitter2.prototype.removeListener;
3549
- EventEmitter2.prototype.addListener = EventEmitter2.prototype.on;
3550
- EventEmitter2.prefixed = prefix;
3551
- EventEmitter2.EventEmitter = EventEmitter2;
3552
- {
3553
- module.exports = EventEmitter2;
3185
+ return this;
3186
+ };
3187
+ EventEmitter2.prototype.off = EventEmitter2.prototype.removeListener;
3188
+ EventEmitter2.prototype.addListener = EventEmitter2.prototype.on;
3189
+ EventEmitter2.prefixed = prefix;
3190
+ EventEmitter2.EventEmitter = EventEmitter2;
3191
+ {
3192
+ module.exports = EventEmitter2;
3554
3193
  }
3555
3194
  })(eventemitter3);
3556
3195
  var EventEmitter = eventemitter3.exports;
@@ -4422,10 +4061,10 @@ var shallowequal = function shallowEqual(objA, objB, compare, compareContext) {
4422
4061
  }
4423
4062
  return true;
4424
4063
  };
4425
- const e$1 = "!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", s$1 = e$1.length, t$1 = Array(20), r$1$1 = () => {
4064
+ const e$1 = "!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", s$1 = e$1.length, t$1$1 = Array(20), r$1$1 = () => {
4426
4065
  for (let r2 = 0; r2 < 20; r2++)
4427
- t$1[r2] = e$1.charAt(Math.random() * s$1);
4428
- return t$1.join("");
4066
+ t$1$1[r2] = e$1.charAt(Math.random() * s$1);
4067
+ return t$1$1.join("");
4429
4068
  };
4430
4069
  class o$1 {
4431
4070
  constructor() {
@@ -4480,7 +4119,7 @@ class o$1 {
4480
4119
  var e$2 = Object.defineProperty, s$2 = (typeof require != "undefined" && require, (s2, r2, t2) => (((s3, r3, t3) => {
4481
4120
  r3 in s3 ? e$2(s3, r3, { enumerable: true, configurable: true, writable: true, value: t3 }) : s3[r3] = t3;
4482
4121
  })(s2, typeof r2 != "symbol" ? r2 + "" : r2, t2), t2));
4483
- class r$2 {
4122
+ class r$3 {
4484
4123
  constructor(e2, r2) {
4485
4124
  s$2(this, "_value"), s$2(this, "_beforeDestroys"), s$2(this, "_subscribers"), this._value = e2, r2 && (this.compare = r2);
4486
4125
  }
@@ -4503,7 +4142,7 @@ class r$2 {
4503
4142
  return e2(this._value, void 0, s2), r2;
4504
4143
  }
4505
4144
  derive(e2, s2, t2) {
4506
- const i2 = new r$2(e2(this.value, void 0, t2), s2), o2 = this.reaction((s3, r2, t3) => {
4145
+ const i2 = new r$3(e2(this.value, void 0, t2), s2), o2 = this.reaction((s3, r2, t3) => {
4507
4146
  i2.setValue(e2(s3, r2, t3));
4508
4147
  });
4509
4148
  return i2.addBeforeDestroy(o2), i2;
@@ -4522,7 +4161,7 @@ class r$2 {
4522
4161
  }
4523
4162
  function t$2(e2, s2, t2, i2) {
4524
4163
  let o2 = e2.map((e3) => e3.value);
4525
- const u2 = new r$2(s2(o2, void 0, i2), t2);
4164
+ const u2 = new r$3(s2(o2, void 0, i2), t2);
4526
4165
  return e2.forEach((e3, r2) => {
4527
4166
  const t3 = e3.reaction((e4, t4, i3) => {
4528
4167
  const c2 = o2.slice();
@@ -4535,10 +4174,10 @@ function t$2(e2, s2, t2, i2) {
4535
4174
  }
4536
4175
  function i$1(e2, s2) {
4537
4176
  Object.keys(s2).forEach((r2) => {
4538
- u$1(e2, r2, s2[r2]);
4177
+ u$2(e2, r2, s2[r2]);
4539
4178
  });
4540
4179
  }
4541
- function u$1(e2, s2, r2) {
4180
+ function u$2(e2, s2, r2) {
4542
4181
  var t2;
4543
4182
  return Object.defineProperties(e2, { [s2]: { get: () => r2.value }, [`_${s2}$`]: { value: r2 }, [`set${t2 = s2, t2[0].toUpperCase() + t2.slice(1)}`]: { value: (e3, s3) => r2.setValue(e3, s3) } }), e2;
4544
4183
  }
@@ -4551,7 +4190,7 @@ function c(e2) {
4551
4190
  e2.remove(r2);
4552
4191
  }), s3;
4553
4192
  };
4554
- return { bindSideEffect: s2, combine: (e3, r2, i2, o2) => s2(t$2(e3, r2, i2, o2)), createVal: (e3, t2) => s2(new r$2(e3, t2)) };
4193
+ return { bindSideEffect: s2, combine: (e3, r2, i2, o2) => s2(t$2(e3, r2, i2, o2)), createVal: (e3, t2) => s2(new r$3(e3, t2)) };
4555
4194
  }
4556
4195
  var TELE_BOX_COLOR_SCHEME;
4557
4196
  (function(TELE_BOX_COLOR_SCHEME2) {
@@ -4909,6 +4548,11 @@ class TeleBox {
4909
4548
  const containerRect$ = createVal(containerRect, shallowequal);
4910
4549
  const collectorRect$ = createVal(collectorRect, shallowequal);
4911
4550
  const title$ = createVal(title);
4551
+ title$.reaction((title2, _2, skipUpdate) => {
4552
+ if (!skipUpdate) {
4553
+ this.titleBar.setTitle(title2);
4554
+ }
4555
+ });
4912
4556
  const visible$ = createVal(visible);
4913
4557
  visible$.reaction((visible2, _2, skipUpdate) => {
4914
4558
  if (!skipUpdate && !visible2) {
@@ -5313,7 +4957,11 @@ class TeleBox {
5313
4957
  });
5314
4958
  });
5315
4959
  this._renderSideEffect.add(() => this._visible$.subscribe((visible) => {
5316
- this.$box.style.display = visible ? "block" : "none";
4960
+ if (visible) {
4961
+ this.$box.style.removeProperty("display");
4962
+ } else {
4963
+ this.$box.style.display = "none";
4964
+ }
5317
4965
  }));
5318
4966
  this._renderSideEffect.add(() => this._zIndex$.subscribe((zIndex) => {
5319
4967
  this.$box.style.zIndex = String(zIndex);
@@ -6186,7 +5834,7 @@ class TeleBoxManager {
6186
5834
  this.removeAll(skipUpdate);
6187
5835
  Object.keys(this).forEach((key) => {
6188
5836
  const value = this[key];
6189
- if (value instanceof r$2) {
5837
+ if (value instanceof r$3) {
6190
5838
  value.destroy();
6191
5839
  }
6192
5840
  });
@@ -9249,7 +8897,7 @@ const onExit = (element2, entry, settings, instance2) => {
9249
8897
  safeCallback(settings.callback_exit, element2, entry, instance2);
9250
8898
  };
9251
8899
  const tagsWithNativeLazy = ["IMG", "IFRAME", "VIDEO"];
9252
- const shouldUseNative = (settings) => settings.use_native && "loading" in HTMLImageElement.prototype;
8900
+ const shouldUseNative$1 = (settings) => settings.use_native && "loading" in HTMLImageElement.prototype;
9253
8901
  const loadAllNative = (elements, settings, instance2) => {
9254
8902
  elements.forEach((element2) => {
9255
8903
  if (tagsWithNativeLazy.indexOf(element2.tagName) === -1) {
@@ -9277,7 +8925,7 @@ const updateObserver = (observer, elementsToObserve) => {
9277
8925
  observeElements(observer, elementsToObserve);
9278
8926
  };
9279
8927
  const setObserver = (settings, instance2) => {
9280
- if (!supportsIntersectionObserver || shouldUseNative(settings)) {
8928
+ if (!supportsIntersectionObserver || shouldUseNative$1(settings)) {
9281
8929
  return;
9282
8930
  }
9283
8931
  instance2._observer = new IntersectionObserver((entries) => {
@@ -9330,7 +8978,7 @@ LazyLoad.prototype = {
9330
8978
  this.loadAll(elementsToLoad);
9331
8979
  return;
9332
8980
  }
9333
- if (shouldUseNative(settings)) {
8981
+ if (shouldUseNative$1(settings)) {
9334
8982
  loadAllNative(elementsToLoad, settings, this);
9335
8983
  return;
9336
8984
  }
@@ -10682,50 +10330,411 @@ function setupStaticDocsViewer(context, whiteboardView, box, pages) {
10682
10330
  index: docsViewer.viewer.pageIndex,
10683
10331
  length: pages.length
10684
10332
  });
10685
- context.emitter.on("attributesUpdate", (attributes) => {
10686
- if (attributes) {
10687
- if (attributes.pageScrollTop != null) {
10688
- docsViewer.syncPageScrollTop(attributes.pageScrollTop);
10689
- }
10333
+ context.emitter.on("attributesUpdate", (attributes) => {
10334
+ if (attributes) {
10335
+ if (attributes.pageScrollTop != null) {
10336
+ docsViewer.syncPageScrollTop(attributes.pageScrollTop);
10337
+ }
10338
+ }
10339
+ });
10340
+ context.emitter.on("writableChange", (isWritable) => {
10341
+ docsViewer.setReadonly(!isWritable);
10342
+ whiteboardView.disableCameraTransform = !isWritable;
10343
+ });
10344
+ }
10345
+ function setupDynamicDocsViewer(context, whiteboardView, box, pages) {
10346
+ whiteboardView.disableCameraTransform = true;
10347
+ const docsViewer = new DynamicDocsViewer({
10348
+ context,
10349
+ whiteboardView,
10350
+ box,
10351
+ pages
10352
+ }).mount();
10353
+ docsViewer.viewer.onPageIndexChanged = (index2) => {
10354
+ context.dispatchAppEvent("pageStateChange", { index: index2, length: pages.length });
10355
+ };
10356
+ context.dispatchAppEvent("pageStateChange", {
10357
+ index: docsViewer.getPageIndex(),
10358
+ length: pages.length
10359
+ });
10360
+ context.mountView(docsViewer.$whiteboardView);
10361
+ if (context.isAddApp) {
10362
+ whiteboardView.callbacks.once("onSizeUpdated", ({ width: contentWidth, height: contentHeight }) => {
10363
+ if (pages.length > 0 && box.state !== "maximized") {
10364
+ const { width: pageWidth, height: pageHeight } = pages[0];
10365
+ const preferHeight = pageHeight / pageWidth * contentWidth;
10366
+ const diff = preferHeight - contentHeight;
10367
+ if (diff !== 0 && context.getIsWritable()) {
10368
+ context.emitter.emit("setBoxSize", {
10369
+ width: box.width,
10370
+ height: box.height + diff / box.containerRect.height
10371
+ });
10372
+ }
10373
+ }
10374
+ });
10375
+ }
10376
+ }
10377
+ var react = { exports: {} };
10378
+ var react_production_min = {};
10379
+ /*
10380
+ object-assign
10381
+ (c) Sindre Sorhus
10382
+ @license MIT
10383
+ */
10384
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
10385
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
10386
+ var propIsEnumerable = Object.prototype.propertyIsEnumerable;
10387
+ function toObject(val) {
10388
+ if (val === null || val === void 0) {
10389
+ throw new TypeError("Object.assign cannot be called with null or undefined");
10390
+ }
10391
+ return Object(val);
10392
+ }
10393
+ function shouldUseNative() {
10394
+ try {
10395
+ if (!Object.assign) {
10396
+ return false;
10397
+ }
10398
+ var test1 = new String("abc");
10399
+ test1[5] = "de";
10400
+ if (Object.getOwnPropertyNames(test1)[0] === "5") {
10401
+ return false;
10402
+ }
10403
+ var test2 = {};
10404
+ for (var i2 = 0; i2 < 10; i2++) {
10405
+ test2["_" + String.fromCharCode(i2)] = i2;
10406
+ }
10407
+ var order2 = Object.getOwnPropertyNames(test2).map(function(n2) {
10408
+ return test2[n2];
10409
+ });
10410
+ if (order2.join("") !== "0123456789") {
10411
+ return false;
10412
+ }
10413
+ var test3 = {};
10414
+ "abcdefghijklmnopqrst".split("").forEach(function(letter) {
10415
+ test3[letter] = letter;
10416
+ });
10417
+ if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
10418
+ return false;
10419
+ }
10420
+ return true;
10421
+ } catch (err) {
10422
+ return false;
10423
+ }
10424
+ }
10425
+ var objectAssign = shouldUseNative() ? Object.assign : function(target, source) {
10426
+ var from;
10427
+ var to = toObject(target);
10428
+ var symbols;
10429
+ for (var s2 = 1; s2 < arguments.length; s2++) {
10430
+ from = Object(arguments[s2]);
10431
+ for (var key in from) {
10432
+ if (hasOwnProperty.call(from, key)) {
10433
+ to[key] = from[key];
10434
+ }
10435
+ }
10436
+ if (getOwnPropertySymbols) {
10437
+ symbols = getOwnPropertySymbols(from);
10438
+ for (var i2 = 0; i2 < symbols.length; i2++) {
10439
+ if (propIsEnumerable.call(from, symbols[i2])) {
10440
+ to[symbols[i2]] = from[symbols[i2]];
10441
+ }
10442
+ }
10443
+ }
10444
+ }
10445
+ return to;
10446
+ };
10447
+ /** @license React v16.14.0
10448
+ * react.production.min.js
10449
+ *
10450
+ * Copyright (c) Facebook, Inc. and its affiliates.
10451
+ *
10452
+ * This source code is licensed under the MIT license found in the
10453
+ * LICENSE file in the root directory of this source tree.
10454
+ */
10455
+ var l$1 = objectAssign, n$2 = typeof Symbol === "function" && Symbol.for, p = n$2 ? Symbol.for("react.element") : 60103, q$1 = n$2 ? Symbol.for("react.portal") : 60106, r$2 = n$2 ? Symbol.for("react.fragment") : 60107, t$1 = n$2 ? Symbol.for("react.strict_mode") : 60108, u$1 = n$2 ? Symbol.for("react.profiler") : 60114, v$2 = n$2 ? Symbol.for("react.provider") : 60109, w$1 = n$2 ? Symbol.for("react.context") : 60110, x$1 = n$2 ? Symbol.for("react.forward_ref") : 60112, y$1 = n$2 ? Symbol.for("react.suspense") : 60113, z$1 = n$2 ? Symbol.for("react.memo") : 60115, A$1 = n$2 ? Symbol.for("react.lazy") : 60116, B$1 = typeof Symbol === "function" && Symbol.iterator;
10456
+ function C$2(a2) {
10457
+ for (var b2 = "https://reactjs.org/docs/error-decoder.html?invariant=" + a2, c2 = 1; c2 < arguments.length; c2++)
10458
+ b2 += "&args[]=" + encodeURIComponent(arguments[c2]);
10459
+ return "Minified React error #" + a2 + "; visit " + b2 + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
10460
+ }
10461
+ var D$1 = { isMounted: function() {
10462
+ return false;
10463
+ }, enqueueForceUpdate: function() {
10464
+ }, enqueueReplaceState: function() {
10465
+ }, enqueueSetState: function() {
10466
+ } }, E$2 = {};
10467
+ function F$2(a2, b2, c2) {
10468
+ this.props = a2;
10469
+ this.context = b2;
10470
+ this.refs = E$2;
10471
+ this.updater = c2 || D$1;
10472
+ }
10473
+ F$2.prototype.isReactComponent = {};
10474
+ F$2.prototype.setState = function(a2, b2) {
10475
+ if (typeof a2 !== "object" && typeof a2 !== "function" && a2 != null)
10476
+ throw Error(C$2(85));
10477
+ this.updater.enqueueSetState(this, a2, b2, "setState");
10478
+ };
10479
+ F$2.prototype.forceUpdate = function(a2) {
10480
+ this.updater.enqueueForceUpdate(this, a2, "forceUpdate");
10481
+ };
10482
+ function G$2() {
10483
+ }
10484
+ G$2.prototype = F$2.prototype;
10485
+ function H$2(a2, b2, c2) {
10486
+ this.props = a2;
10487
+ this.context = b2;
10488
+ this.refs = E$2;
10489
+ this.updater = c2 || D$1;
10490
+ }
10491
+ var I$2 = H$2.prototype = new G$2();
10492
+ I$2.constructor = H$2;
10493
+ l$1(I$2, F$2.prototype);
10494
+ I$2.isPureReactComponent = true;
10495
+ var J$2 = { current: null }, K$2 = Object.prototype.hasOwnProperty, L$2 = { key: true, ref: true, __self: true, __source: true };
10496
+ function M$2(a2, b2, c2) {
10497
+ var e2, d2 = {}, g2 = null, k2 = null;
10498
+ if (b2 != null)
10499
+ for (e2 in b2.ref !== void 0 && (k2 = b2.ref), b2.key !== void 0 && (g2 = "" + b2.key), b2)
10500
+ K$2.call(b2, e2) && !L$2.hasOwnProperty(e2) && (d2[e2] = b2[e2]);
10501
+ var f2 = arguments.length - 2;
10502
+ if (f2 === 1)
10503
+ d2.children = c2;
10504
+ else if (1 < f2) {
10505
+ for (var h2 = Array(f2), m2 = 0; m2 < f2; m2++)
10506
+ h2[m2] = arguments[m2 + 2];
10507
+ d2.children = h2;
10508
+ }
10509
+ if (a2 && a2.defaultProps)
10510
+ for (e2 in f2 = a2.defaultProps, f2)
10511
+ d2[e2] === void 0 && (d2[e2] = f2[e2]);
10512
+ return { $$typeof: p, type: a2, key: g2, ref: k2, props: d2, _owner: J$2.current };
10513
+ }
10514
+ function N$2(a2, b2) {
10515
+ return { $$typeof: p, type: a2.type, key: b2, ref: a2.ref, props: a2.props, _owner: a2._owner };
10516
+ }
10517
+ function O$2(a2) {
10518
+ return typeof a2 === "object" && a2 !== null && a2.$$typeof === p;
10519
+ }
10520
+ function escape(a2) {
10521
+ var b2 = { "=": "=0", ":": "=2" };
10522
+ return "$" + ("" + a2).replace(/[=:]/g, function(a3) {
10523
+ return b2[a3];
10524
+ });
10525
+ }
10526
+ var P$2 = /\/+/g, Q$2 = [];
10527
+ function R$2(a2, b2, c2, e2) {
10528
+ if (Q$2.length) {
10529
+ var d2 = Q$2.pop();
10530
+ d2.result = a2;
10531
+ d2.keyPrefix = b2;
10532
+ d2.func = c2;
10533
+ d2.context = e2;
10534
+ d2.count = 0;
10535
+ return d2;
10536
+ }
10537
+ return { result: a2, keyPrefix: b2, func: c2, context: e2, count: 0 };
10538
+ }
10539
+ function S$2(a2) {
10540
+ a2.result = null;
10541
+ a2.keyPrefix = null;
10542
+ a2.func = null;
10543
+ a2.context = null;
10544
+ a2.count = 0;
10545
+ 10 > Q$2.length && Q$2.push(a2);
10546
+ }
10547
+ function T$2(a2, b2, c2, e2) {
10548
+ var d2 = typeof a2;
10549
+ if (d2 === "undefined" || d2 === "boolean")
10550
+ a2 = null;
10551
+ var g2 = false;
10552
+ if (a2 === null)
10553
+ g2 = true;
10554
+ else
10555
+ switch (d2) {
10556
+ case "string":
10557
+ case "number":
10558
+ g2 = true;
10559
+ break;
10560
+ case "object":
10561
+ switch (a2.$$typeof) {
10562
+ case p:
10563
+ case q$1:
10564
+ g2 = true;
10565
+ }
10690
10566
  }
10691
- });
10692
- context.emitter.on("writableChange", (isWritable) => {
10693
- docsViewer.setReadonly(!isWritable);
10694
- whiteboardView.disableCameraTransform = !isWritable;
10695
- });
10567
+ if (g2)
10568
+ return c2(e2, a2, b2 === "" ? "." + U$2(a2, 0) : b2), 1;
10569
+ g2 = 0;
10570
+ b2 = b2 === "" ? "." : b2 + ":";
10571
+ if (Array.isArray(a2))
10572
+ for (var k2 = 0; k2 < a2.length; k2++) {
10573
+ d2 = a2[k2];
10574
+ var f2 = b2 + U$2(d2, k2);
10575
+ g2 += T$2(d2, f2, c2, e2);
10576
+ }
10577
+ else if (a2 === null || typeof a2 !== "object" ? f2 = null : (f2 = B$1 && a2[B$1] || a2["@@iterator"], f2 = typeof f2 === "function" ? f2 : null), typeof f2 === "function")
10578
+ for (a2 = f2.call(a2), k2 = 0; !(d2 = a2.next()).done; )
10579
+ d2 = d2.value, f2 = b2 + U$2(d2, k2++), g2 += T$2(d2, f2, c2, e2);
10580
+ else if (d2 === "object")
10581
+ throw c2 = "" + a2, Error(C$2(31, c2 === "[object Object]" ? "object with keys {" + Object.keys(a2).join(", ") + "}" : c2, ""));
10582
+ return g2;
10696
10583
  }
10697
- function setupDynamicDocsViewer(context, whiteboardView, box, pages) {
10698
- whiteboardView.disableCameraTransform = true;
10699
- const docsViewer = new DynamicDocsViewer({
10700
- context,
10701
- whiteboardView,
10702
- box,
10703
- pages
10704
- }).mount();
10705
- docsViewer.viewer.onPageIndexChanged = (index2) => {
10706
- context.dispatchAppEvent("pageStateChange", { index: index2, length: pages.length });
10707
- };
10708
- context.dispatchAppEvent("pageStateChange", {
10709
- index: docsViewer.getPageIndex(),
10710
- length: pages.length
10584
+ function V$2(a2, b2, c2) {
10585
+ return a2 == null ? 0 : T$2(a2, "", b2, c2);
10586
+ }
10587
+ function U$2(a2, b2) {
10588
+ return typeof a2 === "object" && a2 !== null && a2.key != null ? escape(a2.key) : b2.toString(36);
10589
+ }
10590
+ function W$2(a2, b2) {
10591
+ a2.func.call(a2.context, b2, a2.count++);
10592
+ }
10593
+ function aa$1(a2, b2, c2) {
10594
+ var e2 = a2.result, d2 = a2.keyPrefix;
10595
+ a2 = a2.func.call(a2.context, b2, a2.count++);
10596
+ Array.isArray(a2) ? X$2(a2, e2, c2, function(a3) {
10597
+ return a3;
10598
+ }) : a2 != null && (O$2(a2) && (a2 = N$2(a2, d2 + (!a2.key || b2 && b2.key === a2.key ? "" : ("" + a2.key).replace(P$2, "$&/") + "/") + c2)), e2.push(a2));
10599
+ }
10600
+ function X$2(a2, b2, c2, e2, d2) {
10601
+ var g2 = "";
10602
+ c2 != null && (g2 = ("" + c2).replace(P$2, "$&/") + "/");
10603
+ b2 = R$2(b2, g2, e2, d2);
10604
+ V$2(a2, aa$1, b2);
10605
+ S$2(b2);
10606
+ }
10607
+ var Y$2 = { current: null };
10608
+ function Z$2() {
10609
+ var a2 = Y$2.current;
10610
+ if (a2 === null)
10611
+ throw Error(C$2(321));
10612
+ return a2;
10613
+ }
10614
+ var ba$1 = { ReactCurrentDispatcher: Y$2, ReactCurrentBatchConfig: { suspense: null }, ReactCurrentOwner: J$2, IsSomeRendererActing: { current: false }, assign: l$1 };
10615
+ react_production_min.Children = { map: function(a2, b2, c2) {
10616
+ if (a2 == null)
10617
+ return a2;
10618
+ var e2 = [];
10619
+ X$2(a2, e2, null, b2, c2);
10620
+ return e2;
10621
+ }, forEach: function(a2, b2, c2) {
10622
+ if (a2 == null)
10623
+ return a2;
10624
+ b2 = R$2(null, null, b2, c2);
10625
+ V$2(a2, W$2, b2);
10626
+ S$2(b2);
10627
+ }, count: function(a2) {
10628
+ return V$2(a2, function() {
10629
+ return null;
10630
+ }, null);
10631
+ }, toArray: function(a2) {
10632
+ var b2 = [];
10633
+ X$2(a2, b2, null, function(a3) {
10634
+ return a3;
10711
10635
  });
10712
- context.mountView(docsViewer.$whiteboardView);
10713
- if (context.isAddApp) {
10714
- whiteboardView.callbacks.once("onSizeUpdated", ({ width: contentWidth, height: contentHeight }) => {
10715
- if (pages.length > 0 && box.state !== "maximized") {
10716
- const { width: pageWidth, height: pageHeight } = pages[0];
10717
- const preferHeight = pageHeight / pageWidth * contentWidth;
10718
- const diff = preferHeight - contentHeight;
10719
- if (diff !== 0 && context.getIsWritable()) {
10720
- context.emitter.emit("setBoxSize", {
10721
- width: box.width,
10722
- height: box.height + diff / box.containerRect.height
10723
- });
10724
- }
10725
- }
10726
- });
10636
+ return b2;
10637
+ }, only: function(a2) {
10638
+ if (!O$2(a2))
10639
+ throw Error(C$2(143));
10640
+ return a2;
10641
+ } };
10642
+ react_production_min.Component = F$2;
10643
+ react_production_min.Fragment = r$2;
10644
+ react_production_min.Profiler = u$1;
10645
+ react_production_min.PureComponent = H$2;
10646
+ react_production_min.StrictMode = t$1;
10647
+ react_production_min.Suspense = y$1;
10648
+ react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ba$1;
10649
+ react_production_min.cloneElement = function(a2, b2, c2) {
10650
+ if (a2 === null || a2 === void 0)
10651
+ throw Error(C$2(267, a2));
10652
+ var e2 = l$1({}, a2.props), d2 = a2.key, g2 = a2.ref, k2 = a2._owner;
10653
+ if (b2 != null) {
10654
+ b2.ref !== void 0 && (g2 = b2.ref, k2 = J$2.current);
10655
+ b2.key !== void 0 && (d2 = "" + b2.key);
10656
+ if (a2.type && a2.type.defaultProps)
10657
+ var f2 = a2.type.defaultProps;
10658
+ for (h2 in b2)
10659
+ K$2.call(b2, h2) && !L$2.hasOwnProperty(h2) && (e2[h2] = b2[h2] === void 0 && f2 !== void 0 ? f2[h2] : b2[h2]);
10660
+ }
10661
+ var h2 = arguments.length - 2;
10662
+ if (h2 === 1)
10663
+ e2.children = c2;
10664
+ else if (1 < h2) {
10665
+ f2 = Array(h2);
10666
+ for (var m2 = 0; m2 < h2; m2++)
10667
+ f2[m2] = arguments[m2 + 2];
10668
+ e2.children = f2;
10727
10669
  }
10670
+ return {
10671
+ $$typeof: p,
10672
+ type: a2.type,
10673
+ key: d2,
10674
+ ref: g2,
10675
+ props: e2,
10676
+ _owner: k2
10677
+ };
10678
+ };
10679
+ react_production_min.createContext = function(a2, b2) {
10680
+ b2 === void 0 && (b2 = null);
10681
+ a2 = { $$typeof: w$1, _calculateChangedBits: b2, _currentValue: a2, _currentValue2: a2, _threadCount: 0, Provider: null, Consumer: null };
10682
+ a2.Provider = { $$typeof: v$2, _context: a2 };
10683
+ return a2.Consumer = a2;
10684
+ };
10685
+ react_production_min.createElement = M$2;
10686
+ react_production_min.createFactory = function(a2) {
10687
+ var b2 = M$2.bind(null, a2);
10688
+ b2.type = a2;
10689
+ return b2;
10690
+ };
10691
+ react_production_min.createRef = function() {
10692
+ return { current: null };
10693
+ };
10694
+ react_production_min.forwardRef = function(a2) {
10695
+ return { $$typeof: x$1, render: a2 };
10696
+ };
10697
+ react_production_min.isValidElement = O$2;
10698
+ react_production_min.lazy = function(a2) {
10699
+ return { $$typeof: A$1, _ctor: a2, _status: -1, _result: null };
10700
+ };
10701
+ react_production_min.memo = function(a2, b2) {
10702
+ return { $$typeof: z$1, type: a2, compare: b2 === void 0 ? null : b2 };
10703
+ };
10704
+ react_production_min.useCallback = function(a2, b2) {
10705
+ return Z$2().useCallback(a2, b2);
10706
+ };
10707
+ react_production_min.useContext = function(a2, b2) {
10708
+ return Z$2().useContext(a2, b2);
10709
+ };
10710
+ react_production_min.useDebugValue = function() {
10711
+ };
10712
+ react_production_min.useEffect = function(a2, b2) {
10713
+ return Z$2().useEffect(a2, b2);
10714
+ };
10715
+ react_production_min.useImperativeHandle = function(a2, b2, c2) {
10716
+ return Z$2().useImperativeHandle(a2, b2, c2);
10717
+ };
10718
+ react_production_min.useLayoutEffect = function(a2, b2) {
10719
+ return Z$2().useLayoutEffect(a2, b2);
10720
+ };
10721
+ react_production_min.useMemo = function(a2, b2) {
10722
+ return Z$2().useMemo(a2, b2);
10723
+ };
10724
+ react_production_min.useReducer = function(a2, b2, c2) {
10725
+ return Z$2().useReducer(a2, b2, c2);
10726
+ };
10727
+ react_production_min.useRef = function(a2) {
10728
+ return Z$2().useRef(a2);
10729
+ };
10730
+ react_production_min.useState = function(a2) {
10731
+ return Z$2().useState(a2);
10732
+ };
10733
+ react_production_min.version = "16.14.0";
10734
+ {
10735
+ react.exports = react_production_min;
10728
10736
  }
10737
+ var l = react.exports;
10729
10738
  var reactDom = { exports: {} };
10730
10739
  var reactDom_production_min = {};
10731
10740
  var scheduler = { exports: {} };
@@ -17899,15 +17908,15 @@ const reconnectRefresher = new ReconnectRefresher({ emitter: internalEmitter });
17899
17908
  const _WindowManager = class extends InvisiblePlugin {
17900
17909
  constructor(context) {
17901
17910
  super(context);
17902
- this.version = "1.0.2";
17903
- this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "0.2.28", "emittery": "^0.9.2", "lodash": "^4.17.21", "p-retry": "^4.6.1", "uuid": "^7.0.3", "video.js": ">=7" }, "peerDependencies": { "jspdf": "2.5.1", "white-web-sdk": "^2.16.52" }, "devDependencies": { "@hyrious/dts": "^0.2.2", "@netless/app-docs-viewer": "^0.2.18", "@netless/app-media-player": "0.1.4", "@rollup/plugin-commonjs": "^20.0.0", "@rollup/plugin-node-resolve": "^13.0.4", "@rollup/plugin-url": "^6.1.0", "@sveltejs/vite-plugin-svelte": "^1.0.0-next.22", "@tsconfig/svelte": "^2.0.1", "@types/debug": "^4.1.7", "@types/lodash": "^4.14.182", "@types/lodash-es": "^4.17.4", "@types/uuid": "^8.3.1", "@typescript-eslint/eslint-plugin": "^4.30.0", "@typescript-eslint/parser": "^4.30.0", "@vitest/ui": "^0.14.1", "cypress": "^8.7.0", "dotenv": "^10.0.0", "eslint": "^7.32.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-svelte3": "^3.2.0", "jsdom": "^19.0.0", "jspdf": "^2.5.1", "less": "^4.1.1", "prettier": "^2.3.2", "prettier-plugin-svelte": "^2.4.0", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-styles": "^3.14.1", "side-effect-manager": "0.1.5", "svelte": "^3.42.4", "typescript": "^4.5.5", "vite": "^2.9.9", "vitest": "^0.14.1", "white-web-sdk": "2.16.52" } };
17911
+ this.version = "1.0.3";
17912
+ this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "0.2.31", "emittery": "^0.9.2", "lodash": "^4.17.21", "p-retry": "^4.6.1", "uuid": "^7.0.3", "video.js": ">=7" }, "peerDependencies": { "jspdf": "2.5.1", "white-web-sdk": "^2.16.52" }, "devDependencies": { "@hyrious/dts": "^0.2.2", "@netless/app-docs-viewer": "^0.2.18", "@netless/app-media-player": "0.1.4", "@rollup/plugin-commonjs": "^20.0.0", "@rollup/plugin-node-resolve": "^13.0.4", "@rollup/plugin-url": "^6.1.0", "@sveltejs/vite-plugin-svelte": "^1.0.0-next.22", "@tsconfig/svelte": "^2.0.1", "@types/debug": "^4.1.7", "@types/lodash": "^4.14.182", "@types/lodash-es": "^4.17.4", "@types/uuid": "^8.3.1", "@typescript-eslint/eslint-plugin": "^4.30.0", "@typescript-eslint/parser": "^4.30.0", "@vitest/ui": "^0.14.1", "cypress": "^8.7.0", "dotenv": "^10.0.0", "eslint": "^7.32.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-svelte3": "^3.2.0", "jsdom": "^19.0.0", "jspdf": "^2.5.1", "less": "^4.1.1", "prettier": "^2.3.2", "prettier-plugin-svelte": "^2.4.0", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-styles": "^3.14.1", "side-effect-manager": "0.1.5", "svelte": "^3.42.4", "typescript": "^4.5.5", "vite": "^2.9.9", "vitest": "^0.14.1", "white-web-sdk": "2.16.52" } };
17904
17913
  this.emitter = callbacks$1;
17905
17914
  this.viewMode = ViewMode.Broadcaster;
17906
17915
  this.isReplay = isPlayer(this.displayer);
17907
17916
  this._cursorUIDs = [];
17908
17917
  this.containerSizeRatio = _WindowManager.containerSizeRatio;
17909
17918
  _WindowManager.displayer = context.displayer;
17910
- window.NETLESS_DEPS = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "0.2.28", "emittery": "^0.9.2", "lodash": "^4.17.21", "p-retry": "^4.6.1", "uuid": "^7.0.3", "video.js": ">=7" }, "peerDependencies": { "jspdf": "2.5.1", "white-web-sdk": "^2.16.52" }, "devDependencies": { "@hyrious/dts": "^0.2.2", "@netless/app-docs-viewer": "^0.2.18", "@netless/app-media-player": "0.1.4", "@rollup/plugin-commonjs": "^20.0.0", "@rollup/plugin-node-resolve": "^13.0.4", "@rollup/plugin-url": "^6.1.0", "@sveltejs/vite-plugin-svelte": "^1.0.0-next.22", "@tsconfig/svelte": "^2.0.1", "@types/debug": "^4.1.7", "@types/lodash": "^4.14.182", "@types/lodash-es": "^4.17.4", "@types/uuid": "^8.3.1", "@typescript-eslint/eslint-plugin": "^4.30.0", "@typescript-eslint/parser": "^4.30.0", "@vitest/ui": "^0.14.1", "cypress": "^8.7.0", "dotenv": "^10.0.0", "eslint": "^7.32.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-svelte3": "^3.2.0", "jsdom": "^19.0.0", "jspdf": "^2.5.1", "less": "^4.1.1", "prettier": "^2.3.2", "prettier-plugin-svelte": "^2.4.0", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-styles": "^3.14.1", "side-effect-manager": "0.1.5", "svelte": "^3.42.4", "typescript": "^4.5.5", "vite": "^2.9.9", "vitest": "^0.14.1", "white-web-sdk": "2.16.52" } };
17919
+ window.NETLESS_DEPS = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "0.2.31", "emittery": "^0.9.2", "lodash": "^4.17.21", "p-retry": "^4.6.1", "uuid": "^7.0.3", "video.js": ">=7" }, "peerDependencies": { "jspdf": "2.5.1", "white-web-sdk": "^2.16.52" }, "devDependencies": { "@hyrious/dts": "^0.2.2", "@netless/app-docs-viewer": "^0.2.18", "@netless/app-media-player": "0.1.4", "@rollup/plugin-commonjs": "^20.0.0", "@rollup/plugin-node-resolve": "^13.0.4", "@rollup/plugin-url": "^6.1.0", "@sveltejs/vite-plugin-svelte": "^1.0.0-next.22", "@tsconfig/svelte": "^2.0.1", "@types/debug": "^4.1.7", "@types/lodash": "^4.14.182", "@types/lodash-es": "^4.17.4", "@types/uuid": "^8.3.1", "@typescript-eslint/eslint-plugin": "^4.30.0", "@typescript-eslint/parser": "^4.30.0", "@vitest/ui": "^0.14.1", "cypress": "^8.7.0", "dotenv": "^10.0.0", "eslint": "^7.32.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-svelte3": "^3.2.0", "jsdom": "^19.0.0", "jspdf": "^2.5.1", "less": "^4.1.1", "prettier": "^2.3.2", "prettier-plugin-svelte": "^2.4.0", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-styles": "^3.14.1", "side-effect-manager": "0.1.5", "svelte": "^3.42.4", "typescript": "^4.5.5", "vite": "^2.9.9", "vitest": "^0.14.1", "white-web-sdk": "2.16.52" } };
17911
17920
  }
17912
17921
  static onCreate(manager) {
17913
17922
  _WindowManager._resolve(manager);