@croquet/microverse-library
Version:
An npm package version of Microverse
18 lines (15 loc) • 3.99 MB
JavaScript
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ "./node_modules/@croquet/croquet/cjs/croquet-croquet.js":
/*!**************************************************************!*\
!*** ./node_modules/@croquet/croquet/cjs/croquet-croquet.js ***!
\**************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
/**
* Copyright Croquet Corporation 2024
* Bundle of @croquet/croquet
* Date: 2024-03-20
* Version: 1.1.0
*/
if(Object.defineProperty(exports,"__esModule",{value:!0}),void 0===globalThis.TextEncoder){globalThis.TextEncoder=function(){},TextEncoder.prototype.encode=function(t){for(var e=t.length,s=-1,i="undefined"==typeof Uint8Array?new Array(1.5*e):new Uint8Array(3*e),n=0,o=0,r=0;r!==e;){if(n=t.charCodeAt(r),r+=1,n>=55296&&n<=56319){if(r===e){i[s+=1]=239,i[s+=1]=191,i[s+=1]=189;break}if(!((o=t.charCodeAt(r))>=56320&&o<=57343)){i[s+=1]=239,i[s+=1]=191,i[s+=1]=189;continue}if(r+=1,(n=1024*(n-55296)+o-56320+65536)>65535){i[s+=1]=240|n>>>18,i[s+=1]=128|n>>>12&63,i[s+=1]=128|n>>>6&63,i[s+=1]=128|63&n;continue}}n<=127?i[s+=1]=0|n:n<=2047?(i[s+=1]=192|n>>>6,i[s+=1]=128|63&n):(i[s+=1]=224|n>>>12,i[s+=1]=128|n>>>6&63,i[s+=1]=128|63&n)}return"undefined"!=typeof Uint8Array?i.subarray(0,s+1):(i.length=s+1,i)},TextEncoder.prototype.toString=function(){return"[object TextEncoder]"};try{Object.defineProperty(TextEncoder.prototype,"encoding",{get:function(){if(TextEncoder.prototype.isPrototypeOf(this))return"utf-8";throw TypeError("Illegal invocation")}})}catch(t){TextEncoder.prototype.encoding="utf-8"}"undefined"!=typeof Symbol&&(TextEncoder.prototype[Symbol.toStringTag]="TextEncoder")}var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof __webpack_require__.g?__webpack_require__.g:"undefined"!=typeof self?self:{};!function(t){var e=function(t){var e,s=Object.prototype,i=s.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",r=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function l(t,e,s){return Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,s){return t[e]=s}}function c(t,e,s,i){var n=e&&e.prototype instanceof b?e:b,o=Object.create(n.prototype),r=new W(i||[]);return o._invoke=function(t,e,s){var i=h;return function(n,o){if(i===m)throw new Error("Generator is already running");if(i===p){if("throw"===n)throw o;return C()}for(s.method=n,s.arg=o;;){var r=s.delegate;if(r){var a=S(r,s);if(a){if(a===f)continue;return a}}if("next"===s.method)s.sent=s._sent=s.arg;else if("throw"===s.method){if(i===h)throw i=p,s.arg;s.dispatchException(s.arg)}else"return"===s.method&&s.abrupt("return",s.arg);i=m;var l=d(t,e,s);if("normal"===l.type){if(i=s.done?p:u,l.arg===f)continue;return{value:l.arg,done:s.done}}"throw"===l.type&&(i=p,s.method="throw",s.arg=l.arg)}}}(t,s,r),o}function d(t,e,s){try{return{type:"normal",arg:t.call(e,s)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var h="suspendedStart",u="suspendedYield",m="executing",p="completed",f={};function b(){}function y(){}function g(){}var w={};l(w,o,(function(){return this}));var Z=Object.getPrototypeOf,v=Z&&Z(Z(T([])));v&&v!==s&&i.call(v,o)&&(w=v);var X=g.prototype=b.prototype=Object.create(w);function L(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function s(n,o,r,a){var l=d(t[n],t,o);if("throw"!==l.type){var c=l.arg,h=c.value;return h&&"object"==typeof h&&i.call(h,"__await")?e.resolve(h.__await).then((function(t){s("next",t,r,a)}),(function(t){s("throw",t,r,a)})):e.resolve(h).then((function(t){c.value=t,r(c)}),(function(t){return s("throw",t,r,a)}))}a(l.arg)}var n;this._invoke=function(t,i){function o(){return new e((function(e,n){s(t,i,e,n)}))}return n=n?n.then(o,o):o()}}function S(t,s){var i=t.iterator[s.method];if(i===e){if(s.delegate=null,"throw"===s.method){if(t.iterator.return&&(s.method="return",s.arg=e,S(t,s),"throw"===s.method))return f;s.method="throw",s.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=d(i,t.iterator,s.arg);if("throw"===n.type)return s.method="throw",s.arg=n.arg,s.delegate=null,f;var o=n.arg;return o?o.done?(s[t.resultName]=o.value,s.next=t.nextLoc,"return"!==s.method&&(s.method="next",s.arg=e),s.delegate=null,f):o:(s.method="throw",s.arg=new TypeError("iterator result is not an object"),s.delegate=null,f)}function G(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function W(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(G,this),this.reset(!0)}function T(t){if(t){var s=t[o];if(s)return s.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function s(){for(;++n<t.length;)if(i.call(t,n))return s.value=t[n],s.done=!1,s;return s.value=e,s.done=!0,s};return r.next=r}}return{next:C}}function C(){return{value:e,done:!0}}return y.prototype=g,l(X,"constructor",g),l(g,"constructor",y),y.displayName=l(g,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,a,"GeneratorFunction")),t.prototype=Object.create(X),t},t.awrap=function(t){return{__await:t}},L(x.prototype),l(x.prototype,r,(function(){return this})),t.AsyncIterator=x,t.async=function(e,s,i,n,o){void 0===o&&(o=Promise);var r=new x(c(e,s,i,n),o);return t.isGeneratorFunction(s)?r:r.next().then((function(t){return t.done?t.value:r.next()}))},L(X),l(X,a,"Generator"),l(X,o,(function(){return this})),l(X,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var s in t)e.push(s);return e.reverse(),function s(){for(;e.length;){var i=e.pop();if(i in t)return s.value=i,s.done=!1,s}return s.done=!0,s}},t.values=T,W.prototype={constructor:W,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(k),!t)for(var s in this)"t"===s.charAt(0)&&i.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var s=this;function n(i,n){return a.type="throw",a.arg=t,s.next=i,n&&(s.method="next",s.arg=e),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var r=this.tryEntries[o],a=r.completion;if("root"===r.tryLoc)return n("end");if(r.tryLoc<=this.prev){var l=i.call(r,"catchLoc"),c=i.call(r,"finallyLoc");if(l&&c){if(this.prev<r.catchLoc)return n(r.catchLoc,!0);if(this.prev<r.finallyLoc)return n(r.finallyLoc)}else if(l){if(this.prev<r.catchLoc)return n(r.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return n(r.finallyLoc)}}}},abrupt:function(t,e){for(var s=this.tryEntries.length-1;s>=0;--s){var n=this.tryEntries[s];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var r=o?o.completion:{};return r.type=t,r.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(r)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var s=this.tryEntries[e];if(s.finallyLoc===t)return this.complete(s.completion,s.afterLoc),k(s),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var s=this.tryEntries[e];if(s.tryLoc===t){var i=s.completion;if("throw"===i.type){var n=i.arg;k(s)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(t,s,i){return this.delegate={iterator:T(t),resultName:s,nextLoc:i},"next"===this.method&&(this.arg=e),f}},t}(t.exports);try{globalThis.regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}}({exports:{}});const e={CROQUET_VERSION:"1.1.0"},s=window.location.hostname.endsWith("croquet.studio");let i="",n="";function o(t,e){if(e)for(const s of e.split("&")){const e=s.split("="),i=e[0];let n=!0;if(e.length>1&&(n=decodeURIComponent(e.slice(1).join("=")),n.match(/^(true|false|null|[0-9.]*|["[{].*)$/)))try{n=JSON.parse(n)}catch(t){"["===n[0]&&(n=n.slice(1,-1).split(","))}t[i]=n}}const r=new class{constructor(){this.getSession(),o(this,window.location.search.slice(1)),o(this,s?window.location.hash.slice(1):n),window.location.pathname.indexOf("/ar.html")>=0&&(this.ar=!0)}has(t,e,s){"boolean"!=typeof s&&(s=this.isHost(s));const i=this[t];if("string"!=typeof i)return s;const n=i.split(",");return!0===s&&(e=`no${e}`),e.endsWith("s")&&(e=e.slice(0,-1)),n.includes(e)||n.includes(`${e}s`)?!s:s}getSession(){if(s){const t=/^\/([^/]+)\/(.*)$/,e=window.location.pathname.match(t);if(e)return i=e[1],e[2]}else{const t=/^#([^&]+)&?(.*)$/,e=window.location.hash.match(t);if(e)return e[1].includes("=")?(n=`${e[1]}&${e[2]}`,""):(n=e[2],e[1])}return"string"==typeof this.session?(n=window.location.hash.slice(1),this.session):""}setSession(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];null==s&&this.getSession();const{search:o,hash:r}=window.location,a=s?`/${i}/${t}${o}${r}`:`#${t}${n?"&"+n:""}`;e?window.history.replaceState({},"",a):window.history.pushState({},"",a)}isHost(t){const e=window.location.hostname;if(e===t)return!0;if("localhost"!==t)return!1;if(e.endsWith(".ngrok.io"))return!0;if(e.endsWith("croquet.dev"))return!0;if("croquet.io"===e){if(window.location.pathname.match(/^\/(dev|files)\//))return!0}return"file:"===window.location.protocol||["127.0.0.1","[::1]"].includes(e)}isLocalhost(){return this.isHost("localhost")}};var a,l,c,d={exports:{}};l=t,c=function(t){var e=function(t){return new e.lib.init(t)};function s(t,e){return e.offset[t]?isNaN(e.offset[t])?e.offset[t]:e.offset[t]+"px":"0px"}function i(t,e){return!(!t||"string"!=typeof e||!(t.className&&t.className.trim().split(/\s+/gi).indexOf(e)>-1))}return e.defaults={oldestFirst:!0,text:"Toastify is awesome!",node:void 0,duration:3e3,selector:void 0,callback:function(){},destination:void 0,newWindow:!1,close:!1,gravity:"toastify-top",positionLeft:!1,position:"",backgroundColor:"",avatar:"",className:"",stopOnFocus:!0,onClick:function(){},offset:{x:0,y:0},escapeMarkup:!0,style:{background:""}},e.lib=e.prototype={toastify:"1.11.2",constructor:e,init:function(t){return t||(t={}),this.options={},this.toastElement=null,this.options.text=t.text||e.defaults.text,this.options.node=t.node||e.defaults.node,this.options.duration=0===t.duration?0:t.duration||e.defaults.duration,this.options.selector=t.selector||e.defaults.selector,this.options.callback=t.callback||e.defaults.callback,this.options.destination=t.destination||e.defaults.destination,this.options.newWindow=t.newWindow||e.defaults.newWindow,this.options.close=t.close||e.defaults.close,this.options.gravity="bottom"===t.gravity?"toastify-bottom":e.defaults.gravity,this.options.positionLeft=t.positionLeft||e.defaults.positionLeft,this.options.position=t.position||e.defaults.position,this.options.backgroundColor=t.backgroundColor||e.defaults.backgroundColor,this.options.avatar=t.avatar||e.defaults.avatar,this.options.className=t.className||e.defaults.className,this.options.stopOnFocus=void 0===t.stopOnFocus?e.defaults.stopOnFocus:t.stopOnFocus,this.options.onClick=t.onClick||e.defaults.onClick,this.options.offset=t.offset||e.defaults.offset,this.options.escapeMarkup=void 0!==t.escapeMarkup?t.escapeMarkup:e.defaults.escapeMarkup,this.options.style=t.style||e.defaults.style,t.backgroundColor&&(this.options.style.background=t.backgroundColor),this},buildToast:function(){if(!this.options)throw"Toastify is not initialized";var t=document.createElement("div");for(var e in t.className="toastify on "+this.options.className,this.options.position?t.className+=" toastify-"+this.options.position:!0===this.options.positionLeft?(t.className+=" toastify-left",console.warn("Property `positionLeft` will be depreciated in further versions. Please use `position` instead.")):t.className+=" toastify-right",t.className+=" "+this.options.gravity,this.options.backgroundColor&&console.warn('DEPRECATION NOTICE: "backgroundColor" is being deprecated. Please use the "style.background" property.'),this.options.style)t.style[e]=this.options.style[e];if(this.options.node&&this.options.node.nodeType===Node.ELEMENT_NODE)t.appendChild(this.options.node);else if(this.options.escapeMarkup?t.innerText=this.options.text:t.innerHTML=this.options.text,""!==this.options.avatar){var i=document.createElement("img");i.src=this.options.avatar,i.className="toastify-avatar","left"==this.options.position||!0===this.options.positionLeft?t.appendChild(i):t.insertAdjacentElement("afterbegin",i)}if(!0===this.options.close){var n=document.createElement("span");n.innerHTML="✖",n.className="toast-close",n.addEventListener("click",function(t){t.stopPropagation(),this.removeElement(this.toastElement),window.clearTimeout(this.toastElement.timeOutValue)}.bind(this));var o=window.innerWidth>0?window.innerWidth:screen.width;("left"==this.options.position||!0===this.options.positionLeft)&&o>360?t.insertAdjacentElement("afterbegin",n):t.appendChild(n)}if(this.options.stopOnFocus&&this.options.duration>0){var r=this;t.addEventListener("mouseover",(function(e){window.clearTimeout(t.timeOutValue)})),t.addEventListener("mouseleave",(function(){t.timeOutValue=window.setTimeout((function(){r.removeElement(t)}),r.options.duration)}))}if(void 0!==this.options.destination&&t.addEventListener("click",function(t){t.stopPropagation(),!0===this.options.newWindow?window.open(this.options.destination,"_blank"):window.location=this.options.destination}.bind(this)),"function"==typeof this.options.onClick&&void 0===this.options.destination&&t.addEventListener("click",function(t){t.stopPropagation(),this.options.onClick()}.bind(this)),"object"==typeof this.options.offset){var a=s("x",this.options),l=s("y",this.options),c="left"==this.options.position?a:"-"+a,d="toastify-top"==this.options.gravity?l:"-"+l;t.style.transform="translate("+c+","+d+")"}return t},showToast:function(){var t;if(this.toastElement=this.buildToast(),!(t="string"==typeof this.options.selector?document.getElementById(this.options.selector):this.options.selector instanceof HTMLElement||"undefined"!=typeof ShadowRoot&&this.options.selector instanceof ShadowRoot?this.options.selector:document.body))throw"Root element is not defined";var s=e.defaults.oldestFirst?t.firstChild:t.lastChild;return t.insertBefore(this.toastElement,s),e.reposition(),this.options.duration>0&&(this.toastElement.timeOutValue=window.setTimeout(function(){this.removeElement(this.toastElement)}.bind(this),this.options.duration)),this},hideToast:function(){this.toastElement.timeOutValue&&clearTimeout(this.toastElement.timeOutValue),this.removeElement(this.toastElement)},removeElement:function(t){t.className=t.className.replace(" on",""),window.setTimeout(function(){this.options.node&&this.options.node.parentNode&&this.options.node.parentNode.removeChild(this.options.node),t.parentNode&&t.parentNode.removeChild(t),this.options.callback.call(t),e.reposition()}.bind(this),400)}},e.reposition=function(){for(var t,e={top:15,bottom:15},s={top:15,bottom:15},n={top:15,bottom:15},o=document.getElementsByClassName("toastify"),r=0;r<o.length;r++){t=!0===i(o[r],"toastify-top")?"toastify-top":"toastify-bottom";var a=o[r].offsetHeight;t=t.substr(9,t.length-1),(window.innerWidth>0?window.innerWidth:screen.width)<=360?(o[r].style[t]=n[t]+"px",n[t]+=a+15):!0===i(o[r],"toastify-left")?(o[r].style[t]=e[t]+"px",e[t]+=a+15):(o[r].style[t]=s[t]+"px",s[t]+=a+15)}return this},e.lib.init.prototype=e.lib,e},(a=d).exports?a.exports=c():l.Toastify=c();var h=d.exports,u={exports:{}};!function(e){!function(t,s,i){var n,o=256,r=i.pow(o,6),a=i.pow(2,52),l=2*a,c=255;function d(e,c,d){var b=[],y=p(m((c=1==c?{entropy:!0}:c||{}).entropy?[e,f(s)]:null==e?function(){try{var e;return n&&(e=n.randomBytes)?e=e(o):(e=new Uint8Array(o),(t.crypto||t.msCrypto).getRandomValues(e)),f(e)}catch(e){var i=t.navigator,r=i&&i.plugins;return[+new Date,t,r,t.screen,f(s)]}}():e,3),b),g=new h(b),w=function(){for(var t=g.g(6),e=r,s=0;t<a;)t=(t+s)*o,e*=o,s=g.g(1);for(;t>=l;)t/=2,e/=2,s>>>=1;return(t+s)/e};return w.int32=function(){return 0|g.g(4)},w.quick=function(){return g.g(4)/4294967296},w.double=w,p(f(g.S),s),(c.pass||d||function(t,e,s,n){return n&&(n.S&&u(n,g),t.state=function(){return u(g,{})}),s?(i.random=t,e):t})(w,y,"global"in c?c.global:this==i,c.state)}function h(t){var e,s=t.length,i=this,n=0,r=i.i=i.j=0,a=i.S=[];for(s||(t=[s++]);n<o;)a[n]=n++;for(n=0;n<o;n++)a[n]=a[r=c&r+t[n%s]+(e=a[n])],a[r]=e;(i.g=function(t){for(var e,s=0,n=i.i,r=i.j,a=i.S;t--;)e=a[n=c&n+1],s=s*o+a[c&(a[n]=a[r=c&r+e])+(a[r]=e)];return i.i=n,i.j=r,s})(o)}function u(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function m(t,e){var s,i=[],n=typeof t;if(e&&"object"==n)for(s in t)try{i.push(m(t[s],e-1))}catch(t){}return i.length?i:"string"==n?t:t+"\0"}function p(t,e){for(var s,i=t+"",n=0;n<i.length;)e[c&n]=c&(s^=19*e[c&n])+i.charCodeAt(n++);return f(e)}function f(t){return String.fromCharCode.apply(0,t)}if(p(i.random(),s),e.exports){e.exports=d;try{n=undefined}catch(t){}}else i.seedrandom=d}("undefined"!=typeof self?self:t,[],Math)}(u);var m,p=u.exports;!function(){function t(t){this.mode=s.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var e=0,i=this.data.length;e<i;e++){var n=[],o=this.data.charCodeAt(e);o>65536?(n[0]=240|(1835008&o)>>>18,n[1]=128|(258048&o)>>>12,n[2]=128|(4032&o)>>>6,n[3]=128|63&o):o>2048?(n[0]=224|(61440&o)>>>12,n[1]=128|(4032&o)>>>6,n[2]=128|63&o):o>128?(n[0]=192|(1984&o)>>>6,n[1]=128|63&o):n[0]=o,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}function e(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}t.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,s=this.parsedData.length;e<s;e++)t.put(this.parsedData[e],8)}},e.prototype={addData:function(e){var s=new t(e);this.dataList.push(s),this.dataCache=null},isDark:function(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(t,s){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var i=0;i<this.moduleCount;i++){this.modules[i]=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[i][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,s),this.typeNumber>=7&&this.setupTypeNumber(t),null==this.dataCache&&(this.dataCache=e.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,s)},setupPositionProbePattern:function(t,e){for(var s=-1;s<=7;s++)if(!(t+s<=-1||this.moduleCount<=t+s))for(var i=-1;i<=7;i++)e+i<=-1||this.moduleCount<=e+i||(this.modules[t+s][e+i]=0<=s&&s<=6&&(0==i||6==i)||0<=i&&i<=6&&(0==s||6==s)||2<=s&&s<=4&&2<=i&&i<=4)},getBestMaskPattern:function(){for(var t=0,e=0,s=0;s<8;s++){this.makeImpl(!0,s);var i=u.getLostPoint(this);(0==s||t>i)&&(t=i,e=s)}return e},createMovieClip:function(t,e,s){var i=t.createEmptyMovieClip(e,s);this.make();for(var n=0;n<this.modules.length;n++)for(var o=1*n,r=0;r<this.modules[n].length;r++){var a=1*r;this.modules[n][r]&&(i.beginFill(0,100),i.moveTo(a,o),i.lineTo(a+1,o),i.lineTo(a+1,o+1),i.lineTo(a,o+1),i.endFill())}return i},setupTimingPattern:function(){for(var t=8;t<this.moduleCount-8;t++)null==this.modules[t][6]&&(this.modules[t][6]=t%2==0);for(var e=8;e<this.moduleCount-8;e++)null==this.modules[6][e]&&(this.modules[6][e]=e%2==0)},setupPositionAdjustPattern:function(){for(var t=u.getPatternPosition(this.typeNumber),e=0;e<t.length;e++)for(var s=0;s<t.length;s++){var i=t[e],n=t[s];if(null==this.modules[i][n])for(var o=-2;o<=2;o++)for(var r=-2;r<=2;r++)this.modules[i+o][n+r]=-2==o||2==o||-2==r||2==r||0==o&&0==r}},setupTypeNumber:function(t){for(var e=u.getBCHTypeNumber(this.typeNumber),s=0;s<18;s++){var i=!t&&1==(e>>s&1);this.modules[Math.floor(s/3)][s%3+this.moduleCount-8-3]=i}for(s=0;s<18;s++){i=!t&&1==(e>>s&1);this.modules[s%3+this.moduleCount-8-3][Math.floor(s/3)]=i}},setupTypeInfo:function(t,e){for(var s=this.errorCorrectLevel<<3|e,i=u.getBCHTypeInfo(s),n=0;n<15;n++){var o=!t&&1==(i>>n&1);n<6?this.modules[n][8]=o:n<8?this.modules[n+1][8]=o:this.modules[this.moduleCount-15+n][8]=o}for(n=0;n<15;n++){o=!t&&1==(i>>n&1);n<8?this.modules[8][this.moduleCount-n-1]=o:n<9?this.modules[8][15-n-1+1]=o:this.modules[8][15-n-1]=o}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var s=-1,i=this.moduleCount-1,n=7,o=0,r=this.moduleCount-1;r>0;r-=2)for(6==r&&r--;;){for(var a=0;a<2;a++)if(null==this.modules[i][r-a]){var l=!1;o<t.length&&(l=1==(t[o]>>>n&1)),u.getMask(e,i,r-a)&&(l=!l),this.modules[i][r-a]=l,-1==--n&&(o++,n=7)}if((i+=s)<0||this.moduleCount<=i){i-=s,s=-s;break}}}},e.PAD0=236,e.PAD1=17,e.createData=function(t,s,i){for(var n=y.getRSBlocks(t,s),o=new g,r=0;r<i.length;r++){var a=i[r];o.put(a.mode,4),o.put(a.getLength(),u.getLengthInBits(a.mode,t)),a.write(o)}var l=0;for(r=0;r<n.length;r++)l+=n[r].dataCount;if(o.getLengthInBits()>8*l)throw new Error("code length overflow. ("+o.getLengthInBits()+">"+8*l+")");for(o.getLengthInBits()+4<=8*l&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(!1);for(;!(o.getLengthInBits()>=8*l||(o.put(e.PAD0,8),o.getLengthInBits()>=8*l));)o.put(e.PAD1,8);return e.createBytes(o,n)},e.createBytes=function(t,e){for(var s=0,i=0,n=0,o=new Array(e.length),r=new Array(e.length),a=0;a<e.length;a++){var l=e[a].dataCount,c=e[a].totalCount-l;i=Math.max(i,l),n=Math.max(n,c),o[a]=new Array(l);for(var d=0;d<o[a].length;d++)o[a][d]=255&t.buffer[d+s];s+=l;var h=u.getErrorCorrectPolynomial(c),m=new b(o[a],h.getLength()-1).mod(h);r[a]=new Array(h.getLength()-1);for(d=0;d<r[a].length;d++){var p=d+m.getLength()-r[a].length;r[a][d]=p>=0?m.get(p):0}}var f=0;for(d=0;d<e.length;d++)f+=e[d].totalCount;var y=new Array(f),g=0;for(d=0;d<i;d++)for(a=0;a<e.length;a++)d<o[a].length&&(y[g++]=o[a][d]);for(d=0;d<n;d++)for(a=0;a<e.length;a++)d<r[a].length&&(y[g++]=r[a][d]);return y};for(var s={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},i={L:1,M:0,Q:3,H:2},n=0,o=1,r=2,a=3,l=4,c=5,d=6,h=7,u={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(t){for(var e=t<<10;u.getBCHDigit(e)-u.getBCHDigit(u.G15)>=0;)e^=u.G15<<u.getBCHDigit(e)-u.getBCHDigit(u.G15);return(t<<10|e)^u.G15_MASK},getBCHTypeNumber:function(t){for(var e=t<<12;u.getBCHDigit(e)-u.getBCHDigit(u.G18)>=0;)e^=u.G18<<u.getBCHDigit(e)-u.getBCHDigit(u.G18);return t<<12|e},getBCHDigit:function(t){for(var e=0;0!=t;)e++,t>>>=1;return e},getPatternPosition:function(t){return u.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,s){switch(t){case n:return(e+s)%2==0;case o:return e%2==0;case r:return s%3==0;case a:return(e+s)%3==0;case l:return(Math.floor(e/2)+Math.floor(s/3))%2==0;case c:return e*s%2+e*s%3==0;case d:return(e*s%2+e*s%3)%2==0;case h:return(e*s%3+(e+s)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new b([1],0),s=0;s<t;s++)e=e.multiply(new b([1,p.gexp(s)],0));return e},getLengthInBits:function(t,e){if(1<=e&&e<10)switch(t){case s.MODE_NUMBER:return 10;case s.MODE_ALPHA_NUM:return 9;case s.MODE_8BIT_BYTE:case s.MODE_KANJI:return 8;default:throw new Error("mode:"+t)}else if(e<27)switch(t){case s.MODE_NUMBER:return 12;case s.MODE_ALPHA_NUM:return 11;case s.MODE_8BIT_BYTE:return 16;case s.MODE_KANJI:return 10;default:throw new Error("mode:"+t)}else{if(!(e<41))throw new Error("type:"+e);switch(t){case s.MODE_NUMBER:return 14;case s.MODE_ALPHA_NUM:return 13;case s.MODE_8BIT_BYTE:return 16;case s.MODE_KANJI:return 12;default:throw new Error("mode:"+t)}}},getLostPoint:function(t){for(var e=t.getModuleCount(),s=0,i=0;i<e;i++)for(var n=0;n<e;n++){for(var o=0,r=t.isDark(i,n),a=-1;a<=1;a++)if(!(i+a<0||e<=i+a))for(var l=-1;l<=1;l++)n+l<0||e<=n+l||0==a&&0==l||r==t.isDark(i+a,n+l)&&o++;o>5&&(s+=3+o-5)}for(i=0;i<e-1;i++)for(n=0;n<e-1;n++){var c=0;t.isDark(i,n)&&c++,t.isDark(i+1,n)&&c++,t.isDark(i,n+1)&&c++,t.isDark(i+1,n+1)&&c++,0!=c&&4!=c||(s+=3)}for(i=0;i<e;i++)for(n=0;n<e-6;n++)t.isDark(i,n)&&!t.isDark(i,n+1)&&t.isDark(i,n+2)&&t.isDark(i,n+3)&&t.isDark(i,n+4)&&!t.isDark(i,n+5)&&t.isDark(i,n+6)&&(s+=40);for(n=0;n<e;n++)for(i=0;i<e-6;i++)t.isDark(i,n)&&!t.isDark(i+1,n)&&t.isDark(i+2,n)&&t.isDark(i+3,n)&&t.isDark(i+4,n)&&!t.isDark(i+5,n)&&t.isDark(i+6,n)&&(s+=40);var d=0;for(n=0;n<e;n++)for(i=0;i<e;i++)t.isDark(i,n)&&d++;return s+=10*(Math.abs(100*d/e/e-50)/5)}},p={glog:function(t){if(t<1)throw new Error("glog("+t+")");return p.LOG_TABLE[t]},gexp:function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return p.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},f=0;f<8;f++)p.EXP_TABLE[f]=1<<f;for(f=8;f<256;f++)p.EXP_TABLE[f]=p.EXP_TABLE[f-4]^p.EXP_TABLE[f-5]^p.EXP_TABLE[f-6]^p.EXP_TABLE[f-8];for(f=0;f<255;f++)p.LOG_TABLE[p.EXP_TABLE[f]]=f;function b(t,e){if(null==t.length)throw new Error(t.length+"/"+e);for(var s=0;s<t.length&&0==t[s];)s++;this.num=new Array(t.length-s+e);for(var i=0;i<t.length-s;i++)this.num[i]=t[i+s]}function y(t,e){this.totalCount=t,this.dataCount=e}function g(){this.buffer=[],this.length=0}b.prototype={get:function(t){return this.num[t]},getLength:function(){return this.num.length},multiply:function(t){for(var e=new Array(this.getLength()+t.getLength()-1),s=0;s<this.getLength();s++)for(var i=0;i<t.getLength();i++)e[s+i]^=p.gexp(p.glog(this.get(s))+p.glog(t.get(i)));return new b(e,0)},mod:function(t){if(this.getLength()-t.getLength()<0)return this;for(var e=p.glog(this.get(0))-p.glog(t.get(0)),s=new Array(this.getLength()),i=0;i<this.getLength();i++)s[i]=this.get(i);for(i=0;i<t.getLength();i++)s[i]^=p.gexp(p.glog(t.get(i))+e);return new b(s,0).mod(t)}},y.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],y.getRSBlocks=function(t,e){var s=y.getRsBlockTable(t,e);if(null==s)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);for(var i=s.length/3,n=[],o=0;o<i;o++)for(var r=s[3*o+0],a=s[3*o+1],l=s[3*o+2],c=0;c<r;c++)n.push(new y(a,l));return n},y.getRsBlockTable=function(t,e){switch(e){case i.L:return y.RS_BLOCK_TABLE[4*(t-1)+0];case i.M:return y.RS_BLOCK_TABLE[4*(t-1)+1];case i.Q:return y.RS_BLOCK_TABLE[4*(t-1)+2];case i.H:return y.RS_BLOCK_TABLE[4*(t-1)+3];default:return}},g.prototype={get:function(t){var e=Math.floor(t/8);return 1==(this.buffer[e]>>>7-t%8&1)},put:function(t,e){for(var s=0;s<e;s++)this.putBit(1==(t>>>e-s-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var w=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]],Z=function(){var t=function(t,e){this._bIsPainted=!1,this._htOption=e,this._elCanvas=document.createElement("canvas"),this._elCanvas.width=e.width,this._elCanvas.height=e.height,t.appendChild(this._elCanvas),this._el=t,this._oContext=this._elCanvas.getContext("2d"),this._bIsPainted=!1,this._bSupportDataURI=null};return t.prototype.draw=function(t){var e=this._oContext,s=this._htOption,i=t.getModuleCount(),n=s.width/i,o=s.height/i,r=Math.round(n),a=Math.round(o);this.clear();for(var l=0;l<i;l++)for(var c=0;c<i;c++){var d=t.isDark(l,c),h=c*n,u=l*o;e.strokeStyle=d?s.colorDark:s.colorLight,e.lineWidth=1,e.fillStyle=d?s.colorDark:s.colorLight,e.fillRect(h,u,n,o),e.strokeRect(Math.floor(h)+.5,Math.floor(u)+.5,r,a),e.strokeRect(Math.ceil(h)-.5,Math.ceil(u)-.5,r,a)}this._bIsPainted=!0},t.prototype.isPainted=function(){return this._bIsPainted},t.prototype.clear=function(){this._oContext.clearRect(0,0,this._elCanvas.width,this._elCanvas.height),this._bIsPainted=!1},t.prototype.round=function(t){return t?Math.floor(1e3*t)/1e3:t},t}();function v(t,e){for(var s=1,n=function(t){var e=encodeURI(t).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return e.length+(e.length!=t?3:0)}(t),o=0,r=w.length;o<=r;o++){var a=0;switch(e){case i.L:a=w[o][0];break;case i.M:a=w[o][1];break;case i.Q:a=w[o][2];break;case i.H:a=w[o][3]}if(n<=a)break;s++}if(s>w.length)throw new Error("Too long data");return s}m=function(t,e){if(this._htOption={width:256,height:256,typeNumber:4,colorDark:"#000000",colorLight:"#ffffff",correctLevel:i.H},"string"==typeof e&&(e={text:e}),e)for(var s in e)this._htOption[s]=e[s];"string"==typeof t&&(t=document.getElementById(t)),this._htOption.useSVG&&(Z=svgDrawer),this._el=t,this._oQRCode=null,this._oDrawing=new Z(this._el,this._htOption),this._htOption.text&&this.makeCode(this._htOption.text)},m.prototype.makeCode=function(t){this._oQRCode=new e(v(t,this._htOption.correctLevel),this._htOption.correctLevel),this._oQRCode.addData(t),this._oQRCode.make(),this._oDrawing.draw(this._oQRCode)},m.prototype.clear=function(){this._oDrawing.clear()},m.prototype.getCanvas=function(){for(let t=0;t<this._el.children.length;t++){const e=this._el.children[t];if("CANVAS"===e.tagName)return e}return null},m.CorrectLevel=i}();var f,b=m,y=function(t,e){e||(e={}),"function"==typeof e&&(e={cmp:e});var s,i="boolean"==typeof e.cycles&&e.cycles,n=e.cmp&&(s=e.cmp,function(t){return function(e,i){var n={key:e,value:t[e]},o={key:i,value:t[i]};return s(n,o)}}),o=[];return function t(e){if(e&&e.toJSON&&"function"==typeof e.toJSON&&(e=e.toJSON()),void 0!==e){if("number"==typeof e)return isFinite(e)?""+e:"null";if("object"!=typeof e)return JSON.stringify(e);var s,r;if(Array.isArray(e)){for(r="[",s=0;s<e.length;s++)s&&(r+=","),r+=t(e[s])||"null";return r+"]"}if(null===e)return"null";if(-1!==o.indexOf(e)){if(i)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var a=o.push(e)-1,l=Object.keys(e).sort(n&&n(e));for(r="",s=0;s<l.length;s++){var c=l[s],d=t(e[c]);d&&(r&&(r+=","),r+=JSON.stringify(c)+":"+d)}return o.splice(a,1),"{"+r+"}"}}(t)},g={exports:{}},w={exports:{}};w.exports=(f=f||function(e,s){var i;if("undefined"!=typeof window&&window.crypto&&(i=window.crypto),"undefined"!=typeof self&&self.crypto&&(i=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(i=globalThis.crypto),!i&&"undefined"!=typeof window&&window.msCrypto&&(i=window.msCrypto),!i&&void 0!==t&&t.crypto&&(i=t.crypto),!i)try{i=__webpack_require__(/*! crypto */ "?985c")}catch(t){}var n=function(){if(i){if("function"==typeof i.getRandomValues)try{return i.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof i.randomBytes)try{return i.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function t(){}return function(e){var s;return t.prototype=e,s=new t,t.prototype=null,s}}(),r={},a=r.lib={},l=a.Base={extend:function(t){var e=o(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},c=a.WordArray=l.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=e!=s?e:4*t.length},toString:function(t){return(t||h).stringify(this)},concat:function(t){var e=this.words,s=t.words,i=this.sigBytes,n=t.sigBytes;if(this.clamp(),i%4)for(var o=0;o<n;o++){var r=s[o>>>2]>>>24-o%4*8&255;e[i+o>>>2]|=r<<24-(i+o)%4*8}else for(var a=0;a<n;a+=4)e[i+a>>>2]=s[a>>>2];return this.sigBytes+=n,this},clamp:function(){var t=this.words,s=this.sigBytes;t[s>>>2]&=4294967295<<32-s%4*8,t.length=e.ceil(s/4)},clone:function(){var t=l.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],s=0;s<t;s+=4)e.push(n());return new c.init(e,t)}}),d=r.enc={},h=d.Hex={stringify:function(t){for(var e=t.words,s=t.sigBytes,i=[],n=0;n<s;n++){var o=e[n>>>2]>>>24-n%4*8&255;i.push((o>>>4).toString(16)),i.push((15&o).toString(16))}return i.join("")},parse:function(t){for(var e=t.length,s=[],i=0;i<e;i+=2)s[i>>>3]|=parseInt(t.substr(i,2),16)<<24-i%8*4;return new c.init(s,e/2)}},u=d.Latin1={stringify:function(t){for(var e=t.words,s=t.sigBytes,i=[],n=0;n<s;n++){var o=e[n>>>2]>>>24-n%4*8&255;i.push(String.fromCharCode(o))}return i.join("")},parse:function(t){for(var e=t.length,s=[],i=0;i<e;i++)s[i>>>2]|=(255&t.charCodeAt(i))<<24-i%4*8;return new c.init(s,e)}},m=d.Utf8={stringify:function(t){try{return decodeURIComponent(escape(u.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return u.parse(unescape(encodeURIComponent(t)))}},p=a.BufferedBlockAlgorithm=l.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=m.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(t){var s,i=this._data,n=i.words,o=i.sigBytes,r=this.blockSize,a=o/(4*r),l=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*r,d=e.min(4*l,o);if(l){for(var h=0;h<l;h+=r)this._doProcessBlock(n,h);s=n.splice(0,l),i.sigBytes-=d}return new c.init(s,d)},clone:function(){var t=l.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0});a.Hasher=p.extend({cfg:l.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,s){return new t.init(s).finalize(e)}},_createHmacHelper:function(t){return function(e,s){return new f.HMAC.init(t,s).finalize(e)}}});var f=r.algo={};return r}(Math),f);var Z=g.exports=function(t){return function(){if("function"==typeof ArrayBuffer){var e=t.lib.WordArray,s=e.init,i=e.init=function(t){if(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),(t instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array)&&(t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)),t instanceof Uint8Array){for(var e=t.byteLength,i=[],n=0;n<e;n++)i[n>>>2]|=t[n]<<24-n%4*8;s.call(this,i,e)}else s.apply(this,arguments)};i.prototype=e}}(),t.lib.WordArray}(w.exports),v={exports:{}},X=v.exports=function(t){return function(e){var s=t,i=s.lib,n=i.WordArray,o=i.Hasher,r=s.algo,a=[],l=[];!function(){function t(t){for(var s=e.sqrt(t),i=2;i<=s;i++)if(!(t%i))return!1;return!0}function s(t){return 4294967296*(t-(0|t))|0}for(var i=2,n=0;n<64;)t(i)&&(n<8&&(a[n]=s(e.pow(i,.5))),l[n]=s(e.pow(i,1/3)),n++),i++}();var c=[],d=r.SHA256=o.extend({_doReset:function(){this._hash=new n.init(a.slice(0))},_doProcessBlock:function(t,e){for(var s=this._hash.words,i=s[0],n=s[1],o=s[2],r=s[3],a=s[4],d=s[5],h=s[6],u=s[7],m=0;m<64;m++){if(m<16)c[m]=0|t[e+m];else{var p=c[m-15],f=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,b=c[m-2],y=(b<<15|b>>>17)^(b<<13|b>>>19)^b>>>10;c[m]=f+c[m-7]+y+c[m-16]}var g=i&n^i&o^n&o,w=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),Z=u+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&d^~a&h)+l[m]+c[m];u=h,h=d,d=a,a=r+Z|0,r=o,o=n,n=i,i=Z+(w+g)|0}s[0]=s[0]+i|0,s[1]=s[1]+n|0,s[2]=s[2]+o|0,s[3]=s[3]+r|0,s[4]=s[4]+a|0,s[5]=s[5]+d|0,s[6]=s[6]+h|0,s[7]=s[7]+u|0},_doFinalize:function(){var t=this._data,s=t.words,i=8*this._nDataBytes,n=8*t.sigBytes;return s[n>>>5]|=128<<24-n%32,s[14+(n+64>>>9<<4)]=e.floor(i/4294967296),s[15+(n+64>>>9<<4)]=i,t.sigBytes=4*s.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});s.SHA256=o._createHelper(d),s.HmacSHA256=o._createHmacHelper(d)}(Math),t.SHA256}(w.exports);const L="node"===e.CROQUET_PLATFORM;let x;function S(t){const e=t.sigBytes,s=t.words,i=new Uint8Array(e);let n=0,o=0;for(;n<e;){const t=s[o++];if(i[n++]=(4278190080&t)>>>24,n===e)break;if(i[n++]=(16711680&t)>>>16,n===e)break;if(i[n++]=(65280&t)>>>8,n===e)break;i[n++]=255&t}return i}function G(t){function e(t){const e=t.indexOf("{"),s=t.lastIndexOf("}");if(-1===e||-1===s||s<e)return t;const i=t.slice(0,e).replace(/\s+/g," ").replace(/\s\(/,"("),n=t.slice(e+1,s);return`${i.trim()}{${n.trim()}}`}let s=e(""+t);if(!s.startsWith("class")){const i=t.prototype;i&&(s+=Object.getOwnPropertyNames(i).map((t=>`${t}:${e(""+i[t])}`)).join(""))}return s}function k(t){return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function W(){return r.has("debug","hashing",!1)}x=globalThis.crypto&&globalThis.crypto.subtle&&"function"==typeof globalThis.crypto.subtle.digest?globalThis.crypto.subtle.digest.bind(globalThis.crypto.subtle):(t,e)=>{if("SHA-256"!==t)throw Error("Croquet: only SHA-256 available");const s=Z.create(e);return S(X(s)).buffer};let T={};const C=new TextEncoder;async function P(t){const e=C.encode(t),s=await async function(t){return 0===t.length?"47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU":k(await x("SHA-256",t))}(e);return T[s]={string:t,buffer:e},s}const V=[],R={};const Y=new Set;const M=Date.now();"undefined"==typeof performance&&(window.performance={now:()=>Date.now()-M});const I=["simulate","update","render","snapshot"],H={total:"black",update:"blue",render:"magenta",simulate:"yellow",snapshot:"green",backlog:"red",network:"lightgray"};let K,z,N=null,F=null,_=null,j=0,Q=null,E=null;function J(t){for(N=t;t.firstChild;)t.removeChild(t.firstChild);t.style.background="#faf0dc",Q=document.createElement("canvas"),E=Q.getContext("2d"),Q.id="text_stats",Q.width=Math.min(140,window.innerWidth),Q.height=36,Q.style.width=Q.width,Q.style.height=Q.height,E.font="9.5pt sans-serif",t.appendChild(Q),t.title=Object.entries(H).map((t=>{let[e,s]=t;return`${s}: ${e}`})).join("\n"),F=document.createElement("canvas"),F.width=Math.min(125,window.innerWidth),F.height=125,F.style.width="100%";const e=document.createElement("div");e.id="innerDiv",t.appendChild(e),e.appendChild(F),_=F.getContext("2d")}const U=[];let D=0,O=!1,B=tt(0);const A=1e3/60;function $(t){return 20*(1-t/A)+60}function q(t){K=function(t){const e=document.createElement("canvas");return e.width=t.width,e.height=t.height,e.style.width="100%",e.style.position="absolute",e.style.left="0px",N.querySelector("#innerDiv").appendChild(e),e}(t),z=K.getContext("2d"),z.strokeStyle="rgba(255, 255, 255, 0.5)";for(let t=0;t<60;t+=A){const e=$(t);z.moveTo(0,e),z.lineTo(K.width,e),z.stroke()}}function tt(t){return{start:t,total:0,items:{},users:0,backlog:0,network:0,latency:0,activity:1e3,connected:O}}function et(t){B.total=t-B.start;const e=Math.min(120,window.innerWidth);if(U.length>=e&&U.splice(0,U.length-e+1),U.push(B),U.length<=1)return;if(!N)return;if(0===N.offsetHeight)return;const s=U.slice(1).filter((t=>t.total)),i=s.map((t=>t.total)).reduce(((t,e)=>t+e),0)/s.length,n=Math.max(...s.map((t=>t.total)));Math.max(...s.map((t=>Math.max(t.backlog,t.network)))),D=1e3,function(t,e){E.globalCompositeOperation="copy",E.fillStyle="rgb(255, 255, 255, 0)",E.fillRect(0,0,Q.width,Q.height),E.fillStyle="rgb(0, 0, 0, 1)",E.globalCompositeOperation="source-over";let s=`${B.users} users, ${Math.round(1e3/t)} fps`;e>70&&(s+=` ${Math.ceil(e).toLocaleString()}ms`),E.fillText(s,2,15),s=B.backlog<100&&B.activity<1e3?`latency: ${B.latency} ms`:`backlog: ${B.backlog<100?"0.0":(B.backlog/1e3).toFixed(1)} s`,E.fillText(s,2,33)}(i,n),K||q(F),j===F.width?(_.globalCompositeOperation="copy",_.drawImage(F,1,0,F.width-1,F.height,0,0,F.width-1,F.height),_.globalCompositeOperation="source-over",_.fillStyle="transparent",_.fillRect(F.width-1,0,1,F.height)):j++;const o=t=>$(t/D*-2*A)+5;{const t=U[U.length-1],e=j-.5;let s=$(0);_.beginPath(),_.moveTo(e,s),_.lineTo(e,$(t.total)),_.strokeStyle=H[t.connected?"total":"network"],_.stroke(),_.beginPath(),_.moveTo(e,s),s=$(t.total);let i=0;for(const n of I)t.items[n]&&(i+=t.items[n],s=$(i),_.lineTo(e,s),_.strokeStyle=H[n],_.stroke(),_.beginPath(),_.moveTo(e,s));t.network&&(_.beginPath(),_.moveTo(e,o(0)),_.lineTo(e,o(t.network)),_.strokeStyle=H.network,_.stroke())}}const st=[],it={};let nt={};const ot={frames:U,animationFrame(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};et(t),B=tt(t);for(const[t,s]of Object.entries(e))this[t](s)},begin(t){const e=performance.now();B.items[t]=(B.items[t]||0)-e;const s=st[st.length-1];return s&&(B.items[s]+=e),st.push(t),e},end(t){const e=performance.now();B.items[t]+=e;const s=st.pop();if(s!==t)throw Error(`Unmatched stats calls: expected end("${s}"), got end("${t}")`);const i=st[st.length-1];return i&&(B.items[i]-=e),e},backlog(t){B.backlog=Math.max(t,B.backlog)},network(t){B.network=t},starvation(t){B.network=t},latency(t){B.latency=t},activity(t){B.activity=t},users(t){B.users=t},connected(t){const e=O;B.connected=O=t,e&&!O&&K&&(K.remove(),z=null)},networkTraffic:it,addNetworkTraffic(t,e){it[t]=(it[t]||0)+e},perSecondTally(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(window.logMessageStats)for(const[e,s]of Object.entries(t))nt[e]=(nt[e]||0)+s},stepSession(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const s=Math.floor(Date.now()/1e3);if(!window.logMessageStats)return nt={second:s},null;let i=null;if(s!==nt.second){if(nt.second&&e&&(nt.requestedMessages||nt.sentMessagesTotal)){i={...nt};const t=s-nt.second;1!==t&&(i.sampleSeconds=t),i.sentBundles&&(i.averageDelay=Math.round(10*i.sendDelay/i.sentMessagesTotal)/10,i.averageBundlePayload=Math.round(i.sentBundlePayload/i.sentBundles)),delete i.second,delete i.sendDelay,delete i.sentBundlePayload}nt={second:s}}return i}};globalThis.CROQUETSTATS=ot;const rt="ontouchstart"in document.documentElement,at=window.parent!==window,lt=rt?20:12,ct=rt?0:15;let dt=!1;function ht(){if(dt)return;dt=!0;const t=`\n #croquet_dock { position: fixed; z-index: 2; border: 3px solid white; bottom: 6px; left: 6px; width: 36px; height: 36px; box-sizing: border-box; background: white; opacity: 0.4; transition: all 0.3s ease; }\n #croquet_dock.active { opacity: 0.95; border-radius: 12px; }\n #croquet_dock.debug { width: 84px; }\n #croquet_dock_bar { position: absolute; border: 3px solid white; width: 100%; height: 30px; box-sizing: border-box; background: white; }\n\n #croquet_badge { position: absolute; width: 72px; height: 24px; top: 50%; transform: translate(0px, -50%); cursor: none; }\n #croquet_dock.active #croquet_badge { left: 2%; }\n #croquet_dock:not(.debug) #croquet_badge { display: none; }\n\n .croquet_dock_button { position: absolute; width: ${lt}%; height: 90%; top: 50%; transform: translate(0px, -50%); border-radius: 20%; }\n .croquet_dock_button:focus { outline: 0; }\n .croquet_dock_button canvas { position: absolute; width: 100%; height: 100%; top: 0px; left: 0px; }\n #croquet_dock:not(.active) .croquet_dock_button { display: none; }\n #croquet_dock_left { right: ${2+ct+lt+2}% }\n #croquet_dock:not(.debug) #croquet_dock_left { display: none; }\n #croquet_dock_right { right: ${2+ct}%; }\n #croquet_dock:not(.debug) #croquet_dock_right { display: none; }\n #croquet_dock_pin { right: 2%; }\n #croquet_dock_pin.pinned { background: #cce6ff; }\n\n #croquet_dock_content { position: absolute; left: 2px; top: 2px; right: 2px; bottom: 2px; background: white; overflow: hidden; }\n #croquet_dock.debug:not(.active) #croquet_dock_content { display: none; }\n #croquet_dock.debug:not(.active) #croquet_dock_content div { display: none; }\n\n #croquet_qrcode { position: absolute; width: 100%; height: 100%;box-sizing: border-box; cursor: crosshair; }\n #croquet_dock.active #croquet_qrcode { border: 6px solid white; }\n #croquet_dock.debug #croquet_qrcode:not(.active) { display: none; }\n #croquet_qrcode canvas { image-rendering: pixelated; }\n\n #croquet_stats { position: absolute; width: 70%; height: 90%; left: 15%; top: 5%; opacity: 0.8; font-family: sans-serif; }\n #croquet_stats:not(.active) { display: none; }\n`,e=document.createElement("style");e.innerHTML=t,document.head.insertBefore(e,document.head.getElementsByTagName("style")[0])}let ut=!1;let mt,pt=!1;function ft(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t&&Vt.showMessage(t,{...e,level:"warning"})}function bt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t&&Vt.showMessage(t,{...e,level:"status"})}function yt(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"error";console.error(`Error during ${t}`,e);const i=(e.stack||"").split("\n").filter((t=>!t.match(/croquet-.*\.min.js/))).join("\n");Vt.showMessage(`Error during ${t}: ${e.message}\n\n${i