UNPKG

@croquet/croquet

Version:

Multiuser for Static Web Apps by Running Server Code in Synced Client VMs

8 lines (7 loc) 361 kB
/** * Copyright Croquet Labs 2025 * Bundle of @croquet/croquet * Date: 2025-06-09 * Version: 2.0.4 */ var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function s(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if("function"==typeof e){var s=function t(){return this instanceof t?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};s.prototype=e.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(s,e,n.get?n:{enumerable:!0,get:function(){return t[e]}})})),s}var n,i={exports:{}};n||(n=1,function(t){var e=function(t){var e,s=Object.prototype,n=s.hasOwnProperty,i=Object.defineProperty||function(t,e,s){t[e]=s.value},o="function"==typeof Symbol?Symbol:{},r=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(t,e,s){return Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,s){return t[e]=s}}function d(t,e,s,n){var o=e&&e.prototype instanceof y?e:y,r=Object.create(o.prototype),a=new k(n||[]);return i(r,"_invoke",{value:G(t,s,a)}),r}function h(t,e,s){try{return{type:"normal",arg:t.call(e,s)}}catch(t){return{type:"throw",arg:t}}}t.wrap=d;var u="suspendedStart",m="suspendedYield",p="executing",f="completed",b={};function y(){}function g(){}function w(){}var Z={};c(Z,r,(function(){return this}));var v=Object.getPrototypeOf,X=v&&v(v(P([])));X&&X!==s&&n.call(X,r)&&(Z=X);var L=w.prototype=y.prototype=Object.create(Z);function x(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function s(i,o,r,a){var l=h(t[i],t,o);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"==typeof d&&n.call(d,"__await")?e.resolve(d.__await).then((function(t){s("next",t,r,a)}),(function(t){s("throw",t,r,a)})):e.resolve(d).then((function(t){c.value=t,r(c)}),(function(t){return s("throw",t,r,a)}))}a(l.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){s(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function G(t,s,n){var i=u;return function(o,r){if(i===p)throw new Error("Generator is already running");if(i===f){if("throw"===o)throw r;return{value:e,done:!0}}for(n.method=o,n.arg=r;;){var a=n.delegate;if(a){var l=T(a,n);if(l){if(l===b)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===u)throw i=f,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=h(t,s,n);if("normal"===c.type){if(i=n.done?f:m,c.arg===b)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=f,n.method="throw",n.arg=c.arg)}}}function T(t,s){var n=s.method,i=t.iterator[n];if(i===e)return s.delegate=null,"throw"===n&&t.iterator.return&&(s.method="return",s.arg=e,T(t,s),"throw"===s.method)||"return"!==n&&(s.method="throw",s.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var o=h(i,t.iterator,s.arg);if("throw"===o.type)return s.method="throw",s.arg=o.arg,s.delegate=null,b;var r=o.arg;return r?r.done?(s[t.resultName]=r.value,s.next=t.nextLoc,"return"!==s.method&&(s.method="next",s.arg=e),s.delegate=null,b):r:(s.method="throw",s.arg=new TypeError("iterator result is not an object"),s.delegate=null,b)}function W(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 C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(W,this),this.reset(!0)}function P(t){if(null!=t){var s=t[r];if(s)return s.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function s(){for(;++i<t.length;)if(n.call(t,i))return s.value=t[i],s.done=!1,s;return s.value=e,s.done=!0,s};return o.next=o}}throw new TypeError(typeof t+" is not iterable")}return g.prototype=w,i(L,"constructor",{value:w,configurable:!0}),i(w,"constructor",{value:g,configurable:!0}),g.displayName=c(w,l,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,c(t,l,"GeneratorFunction")),t.prototype=Object.create(L),t},t.awrap=function(t){return{__await:t}},x(S.prototype),c(S.prototype,a,(function(){return this})),t.AsyncIterator=S,t.async=function(e,s,n,i,o){void 0===o&&(o=Promise);var r=new S(d(e,s,n,i),o);return t.isGeneratorFunction(s)?r:r.next().then((function(t){return t.done?t.value:r.next()}))},x(L),c(L,l,"Generator"),c(L,r,(function(){return this})),c(L,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),s=[];for(var n in e)s.push(n);return s.reverse(),function t(){for(;s.length;){var n=s.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=P,k.prototype={constructor:k,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(C),!t)for(var s in this)"t"===s.charAt(0)&&n.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 i(n,i){return a.type="throw",a.arg=t,s.next=n,i&&(s.method="next",s.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var r=this.tryEntries[o],a=r.completion;if("root"===r.tryLoc)return i("end");if(r.tryLoc<=this.prev){var l=n.call(r,"catchLoc"),c=n.call(r,"finallyLoc");if(l&&c){if(this.prev<r.catchLoc)return i(r.catchLoc,!0);if(this.prev<r.finallyLoc)return i(r.finallyLoc)}else if(l){if(this.prev<r.catchLoc)return i(r.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return i(r.finallyLoc)}}}},abrupt:function(t,e){for(var s=this.tryEntries.length-1;s>=0;--s){var i=this.tryEntries[s];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;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,b):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),b},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),C(s),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var s=this.tryEntries[e];if(s.tryLoc===t){var n=s.completion;if("throw"===n.type){var i=n.arg;C(s)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,s,n){return this.delegate={iterator:P(t),resultName:s,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}(t.exports);try{globalThis.regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}}(i));const o={CROQUET_VERSION:"2.0.4"},r=window&&window.location.hostname.endsWith("croquet.studio");let a="",l="";function c(t,e){if(e)for(const s of e.split("&")){const e=s.split("="),n=e[0];let i=!0;if(e.length>1&&(i=decodeURIComponent(e.slice(1).join("=")),i.match(/^(true|false|null|[0-9.]*|["[{].*)$/)))try{i=JSON.parse(i)}catch(t){"["===i[0]&&(i=i.slice(1,-1).split(","))}t[n]=i}}const d=new class{constructor(){this.getSession(),c(this,window.location.search.slice(1)),c(this,r?window.location.hash.slice(1):l),window.location.pathname.indexOf("/ar.html")>=0&&(this.ar=!0)}has(t,e){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];"string"==typeof s&&(s=this.isHost(s));const n=this[t];if("string"!=typeof n)return s;const i=n.split(",");return!0===s&&(e=`no${e}`),e.endsWith("s")&&(e=e.slice(0,-1)),i.includes(e)||i.includes(`${e}s`)?!s:s}getSession(){if(r){const t=/^\/([^/]+)\/(.*)$/,e=window.location.pathname.match(t);if(e)return a=e[1],e[2]}else{const t=/^#([^&]+)&?(.*)$/,e=window.location.hash.match(t);if(e)return e[1].includes("=")?(l=`${e[1]}&${e[2]}`,""):(l=e[2],e[1])}return"string"==typeof this.session?(l=window.location.hash.slice(1),this.session):""}setSession(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];null==r&&this.getSession();const{search:s,hash:n}=window.location,i=r?`/${a}/${t}${s}${n}`:`#${t}${l?"&"+l:""}`;e?window.history.replaceState({},"",i):window.history.pushState({},"",i)}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("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 h,u={exports:{}};var m,p,f,b,y=(h||(h=1,p=u.exports,f=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 n(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,ariaLive:"polite",style:{background:""}},e.lib=e.prototype={toastify:"1.12.0",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.ariaLive=t.ariaLive||e.defaults.ariaLive,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.ariaLive&&t.setAttribute("aria-live",this.options.ariaLive),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 n=document.createElement("img");n.src=this.options.avatar,n.className="toastify-avatar","left"==this.options.position||!0===this.options.positionLeft?t.appendChild(n):t.insertAdjacentElement("afterbegin",n)}if(!0===this.options.close){var i=document.createElement("button");i.type="button",i.setAttribute("aria-label","Close"),i.className="toast-close",i.innerHTML="&#10006;",i.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",i):t.appendChild(i)}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},i={top:15,bottom:15},o=document.getElementsByClassName("toastify"),r=0;r<o.length;r++){t=!0===n(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]=i[t]+"px",i[t]+=a+15):!0===n(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},(m=u).exports?m.exports=f():p.Toastify=f()),u.exports),g=e(y),w=256,Z=Math.pow(w,6),v=Math.pow(2,52),X=2*v,L=255;function x(t,e){var s=[];if((e=e||{}).entropy)throw new Error("this version of seedrandom does not support entropy");if(null==t&&!e.state)throw new Error("this version of seedrandom requires a seed");!function(t,e){var s,n=t+"",i=0;for(;i<n.length;)e[L&i]=L&(s^=19*e[L&i])+n.charCodeAt(i++);return o=e,String.fromCharCode.apply(0,o);var o}(T(t,3),s);var n=new S(s),i=function(){for(var t=n.g(6),e=Z,s=0;t<v;)t=(t+s)*w,e*=w,s=n.g(1);for(;t>=X;)t/=2,e/=2,s>>>=1;return(t+s)/e};return i.int32=function(){return 0|n.g(4)},i.quick=function(){return n.g(4)/4294967296},i.double=i,(e.pass||function(t,e){return e&&(e.S&&G(e,n),t.state=function(){return G(n,{})}),t})(i,e.state)}function S(t){var e,s=t.length,n=this,i=0,o=n.i=n.j=0,r=n.S=[];for(s||(t=[s++]);i<w;)r[i]=i++;for(i=0;i<w;i++)r[i]=r[o=L&o+t[i%s]+(e=r[i])],r[o]=e;(n.g=function(t){for(var e,s=0,i=n.i,o=n.j,r=n.S;t--;)e=r[i=L&i+1],s=s*w+r[L&(r[i]=r[o=L&o+e])+(r[o]=e)];return n.i=i,n.j=o,s})(w)}function G(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function T(t,e){var s,n=[],i=typeof t;if(e&&"object"==i)for(s in t)try{n.push(T(t[s],e-1))}catch(t){}return n.length?n:"string"==i?t:t+"\0"}!function(){function t(t){this.mode=s.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var e=0,n=this.data.length;e<n;e++){var i=[],o=this.data.charCodeAt(e);o>65536?(i[0]=240|(1835008&o)>>>18,i[1]=128|(258048&o)>>>12,i[2]=128|(4032&o)>>>6,i[3]=128|63&o):o>2048?(i[0]=224|(61440&o)>>>12,i[1]=128|(4032&o)>>>6,i[2]=128|63&o):o>128?(i[0]=192|(1984&o)>>>6,i[1]=128|63&o):i[0]=o,this.parsedData.push(i)}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 n=0;n<this.moduleCount;n++){this.modules[n]=new Array(this.moduleCount);for(var i=0;i<this.moduleCount;i++)this.modules[n][i]=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 n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(this.modules[t+s][e+n]=0<=s&&s<=6&&(0==n||6==n)||0<=n&&n<=6&&(0==s||6==s)||2<=s&&s<=4&&2<=n&&n<=4)},getBestMaskPattern:function(){for(var t=0,e=0,s=0;s<8;s++){this.makeImpl(!0,s);var n=u.getLostPoint(this);(0==s||t>n)&&(t=n,e=s)}return e},createMovieClip:function(t,e,s){var n=t.createEmptyMovieClip(e,s);this.make();for(var i=0;i<this.modules.length;i++)for(var o=1*i,r=0;r<this.modules[i].length;r++){var a=1*r;this.modules[i][r]&&(n.beginFill(0,100),n.moveTo(a,o),n.lineTo(a+1,o),n.lineTo(a+1,o+1),n.lineTo(a,o+1),n.endFill())}return n},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 n=t[e],i=t[s];if(null==this.modules[n][i])for(var o=-2;o<=2;o++)for(var r=-2;r<=2;r++)this.modules[n+o][i+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 n=!t&&1==(e>>s&1);this.modules[Math.floor(s/3)][s%3+this.moduleCount-8-3]=n}for(s=0;s<18;s++){n=!t&&1==(e>>s&1);this.modules[s%3+this.moduleCount-8-3][Math.floor(s/3)]=n}},setupTypeInfo:function(t,e){for(var s=this.errorCorrectLevel<<3|e,n=u.getBCHTypeInfo(s),i=0;i<15;i++){var o=!t&&1==(n>>i&1);i<6?this.modules[i][8]=o:i<8?this.modules[i+1][8]=o:this.modules[this.moduleCount-15+i][8]=o}for(i=0;i<15;i++){o=!t&&1==(n>>i&1);i<8?this.modules[8][this.moduleCount-i-1]=o:i<9?this.modules[8][15-i-1+1]=o:this.modules[8][15-i-1]=o}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var s=-1,n=this.moduleCount-1,i=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[n][r-a]){var l=!1;o<t.length&&(l=1==(t[o]>>>i&1)),u.getMask(e,n,r-a)&&(l=!l),this.modules[n][r-a]=l,-1==--i&&(o++,i=7)}if((n+=s)<0||this.moduleCount<=n){n-=s,s=-s;break}}}},e.PAD0=236,e.PAD1=17,e.createData=function(t,s,n){for(var i=y.getRSBlocks(t,s),o=new g,r=0;r<n.length;r++){var a=n[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<i.length;r++)l+=i[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,i)},e.createBytes=function(t,e){for(var s=0,n=0,i=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;n=Math.max(n,l),i=Math.max(i,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 f(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 b=0;for(d=0;d<e.length;d++)b+=e[d].totalCount;var y=new Array(b),g=0;for(d=0;d<n;d++)for(a=0;a<e.length;a++)d<o[a].length&&(y[g++]=o[a][d]);for(d=0;d<i;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},n={L:1,M:0,Q:3,H:2},i=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 i: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 f([1],0),s=0;s<t;s++)e=e.multiply(new f([1,m.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,n=0;n<e;n++)for(var i=0;i<e;i++){for(var o=0,r=t.isDark(n,i),a=-1;a<=1;a++)if(!(n+a<0||e<=n+a))for(var l=-1;l<=1;l++)i+l<0||e<=i+l||0==a&&0==l||r==t.isDark(n+a,i+l)&&o++;o>5&&(s+=3+o-5)}for(n=0;n<e-1;n++)for(i=0;i<e-1;i++){var c=0;t.isDark(n,i)&&c++,t.isDark(n+1,i)&&c++,t.isDark(n,i+1)&&c++,t.isDark(n+1,i+1)&&c++,0!=c&&4!=c||(s+=3)}for(n=0;n<e;n++)for(i=0;i<e-6;i++)t.isDark(n,i)&&!t.isDark(n,i+1)&&t.isDark(n,i+2)&&t.isDark(n,i+3)&&t.isDark(n,i+4)&&!t.isDark(n,i+5)&&t.isDark(n,i+6)&&(s+=40);for(i=0;i<e;i++)for(n=0;n<e-6;n++)t.isDark(n,i)&&!t.isDark(n+1,i)&&t.isDark(n+2,i)&&t.isDark(n+3,i)&&t.isDark(n+4,i)&&!t.isDark(n+5,i)&&t.isDark(n+6,i)&&(s+=40);var d=0;for(i=0;i<e;i++)for(n=0;n<e;n++)t.isDark(n,i)&&d++;return s+=10*(Math.abs(100*d/e/e-50)/5)}},m={glog:function(t){if(t<1)throw new Error("glog("+t+")");return m.LOG_TABLE[t]},gexp:function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return m.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},p=0;p<8;p++)m.EXP_TABLE[p]=1<<p;for(p=8;p<256;p++)m.EXP_TABLE[p]=m.EXP_TABLE[p-4]^m.EXP_TABLE[p-5]^m.EXP_TABLE[p-6]^m.EXP_TABLE[p-8];for(p=0;p<255;p++)m.LOG_TABLE[m.EXP_TABLE[p]]=p;function f(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 n=0;n<t.length-s;n++)this.num[n]=t[n+s]}function y(t,e){this.totalCount=t,this.dataCount=e}function g(){this.buffer=[],this.length=0}f.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 n=0;n<t.getLength();n++)e[s+n]^=m.gexp(m.glog(this.get(s))+m.glog(t.get(n)));return new f(e,0)},mod:function(t){if(this.getLength()-t.getLength()<0)return this;for(var e=m.glog(this.get(0))-m.glog(t.get(0)),s=new Array(this.getLength()),n=0;n<this.getLength();n++)s[n]=this.get(n);for(n=0;n<t.getLength();n++)s[n]^=m.gexp(m.glog(t.get(n))+e);return new f(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 n=s.length/3,i=[],o=0;o<n;o++)for(var r=s[3*o+0],a=s[3*o+1],l=s[3*o+2],c=0;c<r;c++)i.push(new y(a,l));return i},y.getRsBlockTable=function(t,e){switch(e){case n.L:return y.RS_BLOCK_TABLE[4*(t-1)+0];case n.M:return y.RS_BLOCK_TABLE[4*(t-1)+1];case n.Q:return y.RS_BLOCK_TABLE[4*(t-1)+2];case n.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,n=t.getModuleCount(),i=s.width/n,o=s.height/n,r=Math.round(i),a=Math.round(o);this.clear();for(var l=0;l<n;l++)for(var c=0;c<n;c++){var d=t.isDark(l,c),h=c*i,u=l*o;e.strokeStyle=d?s.colorDark:s.colorLight,e.lineWidth=1,e.fillStyle=d?s.colorDark:s.colorLight,e.fillRect(h,u,i,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,i=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 n.L:a=w[o][0];break;case n.M:a=w[o][1];break;case n.Q:a=w[o][2];break;case n.H:a=w[o][3]}if(i<=a)break;s++}if(s>w.length)throw new Error("Too long data");return s}b=function(t,e){if(this._htOption={width:256,height:256,typeNumber:4,colorDark:"#000000",colorLight:"#ffffff",correctLevel:n.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)},b.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)},b.prototype.clear=function(){this._oDrawing.clear()},b.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},b.CorrectLevel=n}();var W,C,k=b;var P=e(C?W:(C=1,W=function(t,e){e||(e={}),"function"==typeof e&&(e={cmp:e});var s,n="boolean"==typeof e.cycles&&e.cycles,i=e.cmp&&(s=e.cmp,function(t){return function(e,n){var i={key:e,value:t[e]},o={key:n,value:t[n]};return s(i,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(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var a=o.push(e)-1,l=Object.keys(e).sort(i&&i(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)})),I={exports:{}};var R,V={exports:{}},M=s(Object.freeze({__proto__:null,default:{}}));function Y(){return R||(R=1,V.exports=(e=e||function(e,s){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==t&&t.crypto&&(n=t.crypto),!n)try{n=M}catch(t){}var i=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof n.randomBytes)try{return n.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,n=this.sigBytes,i=t.sigBytes;if(this.clamp(),n%4)for(var o=0;o<i;o++){var r=s[o>>>2]>>>24-o%4*8&255;e[n+o>>>2]|=r<<24-(n+o)%4*8}else for(var a=0;a<i;a+=4)e[n+a>>>2]=s[a>>>2];return this.sigBytes+=i,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(i());return new c.init(e,t)}}),d=r.enc={},h=d.Hex={stringify:function(t){for(var e=t.words,s=t.sigBytes,n=[],i=0;i<s;i++){var o=e[i>>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,s=[],n=0;n<e;n+=2)s[n>>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new c.init(s,e/2)}},u=d.Latin1={stringify:function(t){for(var e=t.words,s=t.sigBytes,n=[],i=0;i<s;i++){var o=e[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(t){for(var e=t.length,s=[],n=0;n<e;n++)s[n>>>2]|=(255&t.charCodeAt(n))<<24-n%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,n=this._data,i=n.words,o=n.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(i,h);s=i.splice(0,l),n.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),e)),V.exports;var e}var H;var K,N,z=(H||(H=1,I.exports=(K=Y(),function(){if("function"==typeof ArrayBuffer){var t=K.lib.WordArray,e=t.init,s=t.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 s=t.byteLength,n=[],i=0;i<s;i++)n[i>>>2]|=t[i]<<24-i%4*8;e.call(this,n,s)}else e.apply(this,arguments)};s.prototype=t}}(),K.lib.WordArray)),I.exports),_=e(z),F={exports:{}};function E(){return N||(N=1,F.exports=function(t){return function(e){var s=t,n=s.lib,i=n.WordArray,o=n.Hasher,r=s.algo,a=[],l=[];!function(){function t(t){for(var s=e.sqrt(t),n=2;n<=s;n++)if(!(t%n))return!1;return!0}function s(t){return 4294967296*(t-(0|t))|0}for(var n=2,i=0;i<64;)t(n)&&(i<8&&(a[i]=s(e.pow(n,.5))),l[i]=s(e.pow(n,1/3)),i++),n++}();var c=[],d=r.SHA256=o.extend({_doReset:function(){this._hash=new i.init(a.slice(0))},_doProcessBlock:function(t,e){for(var s=this._hash.words,n=s[0],i=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=n&i^n&o^i&o,w=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>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=i,i=n,n=Z+(w+g)|0}s[0]=s[0]+n|0,s[1]=s[1]+i|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,n=8*this._nDataBytes,i=8*t.sigBytes;return s[i>>>5]|=128<<24-i%32,s[14+(i+64>>>9<<4)]=e.floor(n/4294967296),s[15+(i+64>>>9<<4)]=n,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}(Y())),F.exports}var j=e(E());const J="node"===o.CROQUET_PLATFORM;let Q;function U(t){const e=t.sigBytes,s=t.words,n=new Uint8Array(e);let i=0,o=0;for(;i<e;){const t=s[o++];if(n[i++]=(4278190080&t)>>>24,i===e)break;if(n[i++]=(16711680&t)>>>16,i===e)break;if(n[i++]=(65280&t)>>>8,i===e)break;n[i++]=255&t}return n}function D(t){function e(t){const e=t.indexOf("{"),s=t.lastIndexOf("}");if(-1===e||-1===s||s<e)return t;const n=t.slice(0,e).replace(/\s+/g," ").replace(/\s\(/,"("),i=t.slice(e+1,s);return`${n.trim()}{${i.trim()}}`}let s=e(""+t);if(!s.startsWith("class")){const n=t.prototype;n&&(s+=Object.getOwnPropertyNames(n).map((t=>`${t}:${e(""+n[t])}`)).join(""))}return s}function O(t){return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function B(){return d.has("debug","hashing",!1)}Q=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(`${qt.libName}: only SHA-256 available`);const s=_.create(e);return U(j(s)).buffer};let A={};const $=new TextEncoder;async function q(t){const e=$.encode(t),s=await async function(t){return 0===t.length?"47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU":O(await Q("SHA-256",t))}(e);return A[s]={string:t,buffer:e},s}const tt=[],et={};const st=new Set;const nt=Date.now();"undefined"==typeof performance&&(window.performance={now:()=>Date.now()-nt});const it=["simulate","update","render","snapshot"],ot={total:"black",update:"blue",render:"magenta",simulate:"yellow",snapshot:"green",backlog:"red",network:"lightgray"};let rt,at,lt=null,ct=null,dt=null,ht=0,ut=null,mt=null;function pt(t){for(lt=t;t.firstChild;)t.removeChild(t.firstChild);t.style.background="#faf0dc",ut=document.createElement("canvas"),mt=ut.getContext("2d"),ut.id="text_stats",ut.width=Math.min(140,window.innerWidth),ut.height=36,ut.style.width=ut.width,ut.style.height=ut.height,mt.font="9.5pt sans-serif",t.appendChild(ut),t.title=Object.entries(ot).map((t=>{let[e,s]=t;return`${s}: ${e}`})).join("\n"),ct=document.createElement("canvas"),ct.width=Math.min(125,window.innerWidth),ct.height=125,ct.style.width="100%";const e=document.createElement("div");e.id="innerDiv",t.appendChild(e),e.appendChild(ct),dt=ct.getContext("2d")}const ft=[];let bt=0,yt=!1,gt=Xt(0);const wt=1e3/60;function Zt(t){return 20*(1-t/wt)+60}function vt(t){rt=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",lt.querySelector("#innerDiv").appendChild(e),e}(t),at=rt.getContext("2d"),at.strokeStyle="rgba(255, 255, 255, 0.5)";for(let t=0;t<60;t+=wt){const e=Zt(t);at.moveTo(0,e),at.lineTo(rt.width,e),at.stroke()}}function Xt(t){return{start:t,total:0,items:{},users:0,backlog:0,network:0,latency:0,activity:1e3,connected:yt}}function Lt(t){gt.total=t-gt.start;const e=Math.min(120,window.innerWidth);if(ft.length>=e&&ft.splice(0,ft.length-e+1),ft.push(gt),ft.length<=1)return;if(!lt)return;if(0===lt.offsetHeight)return;const s=ft.slice(1).filter((t=>t.total)),n=s.map((t=>t.total)).reduce(((t,e)=>t+e),0)/s.length,i=Math.max(...s.map((t=>t.total)));Math.max(...s.map((t=>Math.max(t.backlog,t.network)))),bt=1e3,function(t,e){mt.globalCompositeOperation="copy",mt.fillStyle="rgb(255, 255, 255, 0)",mt.fillRect(0,0,ut.width,ut.height),mt.fillStyle="rgb(0, 0, 0, 1)",mt.globalCompositeOperation="source-over";let s=`${gt.users} users, ${Math.round(1e3/t)} fps`;e>70&&(s+=` ${Math.ceil(e).toLocaleString()}ms`),mt.fillText(s,2,15),s=gt.backlog<100&&gt.activity<1e3?`latency: ${gt.latency} ms`:`backlog: ${gt.backlog<100?"0.0":(gt.backlog/1e3).toFixed(1)} s`,mt.fillText(s,2,33)}(n,i),rt||vt(ct),ht===ct.width?(dt.globalCompositeOperation="copy",dt.drawImage(ct,1,0,ct.width-1,ct.height,0,0,ct.width-1,ct.height),dt.globalCompositeOperation="source-over",dt.fillStyle="transparent",dt.fillRect(ct.width-1,0,1,ct.height)):ht++;const o=t=>Zt(t/bt*-2*wt)+5;{const t=ft[ft.length-1],e=ht-.5;let s=Zt(0);dt.beginPath(),dt.moveTo(e,s),dt.lineTo(e,Zt(t.total)),dt.strokeStyle=ot[t.connected?"total":"network"],dt.stroke(),dt.beginPath(),dt.moveTo(e,s),s=Zt(t.total);let n=0;for(const i of it)t.items[i]&&(n+=t.items[i],s=Zt(n),dt.lineTo(e,s),dt.strokeStyle=ot[i],dt.stroke(),dt.beginPath(),dt.moveTo(e,s));t.network&&(dt.beginPath(),dt.moveTo(e,o(0)),dt.lineTo(e,o(t.network)),dt.strokeStyle=ot.network,dt.stroke())}}const xt=[],St={};let Gt={};const Tt={frames:ft,animationFrame(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Lt(t),gt=Xt(t);for(const[t,s]of Object.entries(e))this[t](s)},begin(t){const e=performance.now();gt.items[t]=(gt.items[t]||0)-e;const s=xt[xt.length-1];return s&&(gt.items[s]+=e),xt.push(t),e},end(t){const e=performance.now();gt.items[t]+=e;const s=xt.pop();if(s!==t)throw Error(`Unmatched stats calls: expected end("${s}"), got end("${t}")`);const n=xt[xt.length-1];return n&&(gt.items[n]-=e),e},backlog(t){gt.backlog=Math.max(t,gt.backlog)},starvation(t){gt.network=t},latency(t){gt.latency=t},activity(t){gt.activity=t},users(t){gt.users=t},connected(t){const e=yt;gt.connected=yt=t,e&&!yt&&rt&&(rt.remove(),at=null)},networkTraffic:St,addNetworkTraffic(t,e){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];St[t]=(St[t]||0)+e,s&&(St[`audit_${t}`]=(St[`audit_${t}`]||0)+e)},resetAuditStats(){for(const t in St)t.startsWith("audit_")&&(St[t]=0)},perSecondTally(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(window.logMessageStats)for(const[e,s]of Object.entries(t))Gt[e]=(Gt[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 Gt={second:s},null;let n=null;if(s!==Gt.second){if(Gt.second&&e&&(Gt.requestedMessages||Gt.sentMessagesTotal)){n={...Gt};const t=s-Gt.second;1!==t&&(n.sampleSeconds=t),n.sentBundles&&(n.averageDelay=Math.round(10*n.sendDelay/n.sentMessagesTotal)/10,n.averageBundlePayload=Math.round(n.sentBundlePayload/n.sentBundles)),delete n.second,delete n.sendDelay,delete n.sentBundlePayload}Gt={second:s}}return n}};globalThis.CROQUETSTATS=Tt;const Wt="ontouchstart"in document.documentElement,Ct=window&&window.parent!==window,kt=Wt?20:12,Pt=Wt?0:15;let It=!1;let Rt=!1;let Vt,Mt=!1;function Yt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t&&qt.showMessage(t,{...e,level:"warning"})}function Ht(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t&&qt.showMessage(t,{...e,level:"status"})}function Kt(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"error";console.error(`Error during ${t}`,e);const n=(e.stack||"").split("\n").filter((t=>!t.match(/croquet-.*\.min.js/))).join("\n");qt.showMessage(`Error during ${t}: ${e.message}\n\n${n}`,{level:s,duration:"error"===s?1e4:void 0,stopOnFocus:!0})}try{if(Vt=window.localStorage,Vt["croquet-debug-persist-allowed"]="true","true"!==Vt["croquet-debug-persist-allowed"])throw Error("localStorage not persisted");delete Vt["croquet-debug-persist-allowed"]}catch($r){console.warn("localStorage not allowed"),Vt={}}const Nt={get pinned(){return"true"===Vt[window.location.pathname+"/croquet-debug-ui-pinned"]},set pinned(t){Vt[window.location.pathname+"/croquet-debug-ui-pinned"]=!!t},get activePage(){return Vt[window.location.pathname+"/croquet-debug-ui-activePage"]},set activePage(t){Vt[window.location.pathname+"/croquet-debug-ui-activePage"]=t}},zt=t=>{t.preventDefault(),t.stopPropagation()};function _t(t,e,s){const n=document.createElement("canvas"),i=n.width=40*kt/12,o=n.height=60,r=n.getContext("2d");r.font="36px Arial",r.textAlign="center",r.textBaseline="middle",r.fillStyle="black",r.fillText(t,i/2,.55*o);const a=document.createElement("button");a.id=e,a.className="croquet_dock_button";const l=t=>{t.preventDefault(),t.stopPropagation(),s()};return Wt?(a.ontouchstart=l,a.ontouchend=zt,a.onpointerdown=zt,a.onpointerup=zt):(a.onclick=l,a.onpointerdown=zt,a.onpointerup=zt),a.appendChild(n),a}function Ft(t,e){if(!1===qt.badge)return;const s=function(t){const e=new x(t),s=["bcdfghjklmnpqrstvwxyz","aeiou"];let n="";for(let t=0;t<5;t++)n+=s[t%2][e.quick()*s[t%2].length|0];return n}(e);for(document.title=document.title.replace(/:.*/,""),document.title+=":"+s;t.firstChild;)t.removeChild(t.firstChild);const n=document.createElement("canvas"),i=n.width=120,o=n.height=40;n.style.width="100%",t.appendChild(n);const r=n.getContext("2d"),a=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const s=new x(t),n=[];for(let t=0;t<e;t++)n.push(`hsl(${360*s.quick()}, 50%, 70%)`);return n}(e,2);r.fillStyle=a[0],r.beginPath(),r.moveTo(0,0),r.lineTo(0,o),r.lineTo(i,0),r.closePath(),r.fill(),r.fillStyle=a[1],r.beginPath(),r.moveTo(i,o),r.lineTo(i,0),r.lineTo(0,o),r.closePath(),r.fill(),r.font="30px Arial",r.textAlign="center",r.textBaseline="middle",r.fillStyle="black",r.fillText(s,i/2,o/2)}function Et(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};for(;t.firstChild;)t.removeChild(t.firstChild);return new k(t,{text:e,width:128,height:128,colorDark:"#000000",colorLight:"#ffffff",correctLevel:k.CorrectLevel.L,...s})}function jt(){if(!1===qt.root||!1===qt.qrcode)return;if(d.noqr)return;const t=qt.sessionURL;if(!t)return void console.warn("App.sessionURL is not set");const e=Ot(qt.qrcode);if(!e)return;Wt||(e.onclick=e=>{e.preventDefault(),e.stopPropagation(),e.shiftKey?function(){const t=document.getElementById("croquet_dock");t&&t.classList.toggle("debug")}():window.open(t)});Et(e,t).getCanvas().style.width="100%"}let Jt,Qt,Ut=0;function Dt(){!function(){if(Rt)return;Rt=!0;const t=`\n ${Ct?"body { min-height: 100vh }":""}\n #croquet_spinnerOverlay {\n z-index: 1000;\n position: fixed;\n l