@ours.network/cowork 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/daemon.js +38 -16
- package/dist/web/assets/app.js +1 -1
- package/docs/01-prerequisites.md +1 -1
- package/docs/06-invites.md +13 -1
- package/docs/07-messaging-history.md +7 -0
- package/docs/11-web-console.md +1 -1
- package/package.json +2 -2
package/dist/daemon.js
CHANGED
|
@@ -5582,6 +5582,7 @@ var init_packets = __esm({
|
|
|
5582
5582
|
cid;
|
|
5583
5583
|
client;
|
|
5584
5584
|
contacts = [];
|
|
5585
|
+
hasInviteProvenance = false;
|
|
5585
5586
|
invites = [];
|
|
5586
5587
|
refreshWork;
|
|
5587
5588
|
contactRefreshWork;
|
|
@@ -5607,8 +5608,12 @@ var init_packets = __esm({
|
|
|
5607
5608
|
return this.contactRefreshWork;
|
|
5608
5609
|
}
|
|
5609
5610
|
async refreshContactsUnlocked() {
|
|
5610
|
-
const
|
|
5611
|
-
this.
|
|
5611
|
+
const listed = await this.client.listContacts();
|
|
5612
|
+
this.hasInviteProvenance = listed.origins !== void 0;
|
|
5613
|
+
this.contacts = listed.contacts.map((contact) => ({
|
|
5614
|
+
...contact,
|
|
5615
|
+
...listed.origins?.[contact.container_id] === void 0 ? {} : { accepted_via_invite_id: listed.origins[contact.container_id] }
|
|
5616
|
+
}));
|
|
5612
5617
|
}
|
|
5613
5618
|
async mintInvite(mode) {
|
|
5614
5619
|
const result = await this.client.generateInvite({ mode });
|
|
@@ -5634,6 +5639,9 @@ var init_packets = __esm({
|
|
|
5634
5639
|
listInvites() {
|
|
5635
5640
|
return this.invites.map((invite) => ({ ...invite }));
|
|
5636
5641
|
}
|
|
5642
|
+
get supportsInviteProvenance() {
|
|
5643
|
+
return this.hasInviteProvenance;
|
|
5644
|
+
}
|
|
5637
5645
|
listContacts() {
|
|
5638
5646
|
return this.contacts.map((contact) => ({ ...contact }));
|
|
5639
5647
|
}
|
|
@@ -5993,7 +6001,12 @@ var init_intake = __esm({
|
|
|
5993
6001
|
const seats = room.seats.map((candidate) => candidate.participant_id === removed.participant_id ? { ...candidate, bounced_at: this.now() } : candidate);
|
|
5994
6002
|
await this.store.save(RoomSchema.parse({ ...room, seats }));
|
|
5995
6003
|
try {
|
|
5996
|
-
const unsigned = {
|
|
6004
|
+
const unsigned = {
|
|
6005
|
+
version: 1,
|
|
6006
|
+
kind: "room_not_member",
|
|
6007
|
+
room_id: roomId,
|
|
6008
|
+
room_name: room.room_name
|
|
6009
|
+
};
|
|
5997
6010
|
await sendRoomBody(packet, item.sender_id, unsigned);
|
|
5998
6011
|
} catch {
|
|
5999
6012
|
}
|
|
@@ -6082,6 +6095,7 @@ var init_intake = __esm({
|
|
|
6082
6095
|
version: 1,
|
|
6083
6096
|
kind: "room_file",
|
|
6084
6097
|
room_id: roomId,
|
|
6098
|
+
room_name: room.room_name,
|
|
6085
6099
|
file_id: file.file_id,
|
|
6086
6100
|
author,
|
|
6087
6101
|
filename: file.filename,
|
|
@@ -6131,6 +6145,7 @@ var init_intake = __esm({
|
|
|
6131
6145
|
version: 1,
|
|
6132
6146
|
kind: wireKind(message.category),
|
|
6133
6147
|
room_id: roomId,
|
|
6148
|
+
room_name: room.room_name,
|
|
6134
6149
|
message_id: message.message_id,
|
|
6135
6150
|
// An anonymous author leaves the archive only in alias form.
|
|
6136
6151
|
author: message.author_alias === void 0 ? message.author : {
|
|
@@ -6472,9 +6487,9 @@ var init_service = __esm({
|
|
|
6472
6487
|
return this.lock(id, async () => {
|
|
6473
6488
|
const room = await this.store.load(id);
|
|
6474
6489
|
this.assertMutable(room, "create an invite for");
|
|
6475
|
-
if (room.invites.some((invite) => invite.state === "live" || invite.state === "receipt_pending")) {
|
|
6490
|
+
if (!this.packet(id).supportsInviteProvenance && room.invites.some((invite) => invite.state === "live" || invite.state === "receipt_pending")) {
|
|
6476
6491
|
throw new RoomServiceError(
|
|
6477
|
-
"
|
|
6492
|
+
"the installed ours SDK does not expose authenticated invite provenance; revoke or consume the current invitation before creating another"
|
|
6478
6493
|
);
|
|
6479
6494
|
}
|
|
6480
6495
|
return this.mintInviteUnlocked(room, {
|
|
@@ -6560,12 +6575,12 @@ var init_service = __esm({
|
|
|
6560
6575
|
return receipt;
|
|
6561
6576
|
}
|
|
6562
6577
|
async mintInviteUnlocked(room, request) {
|
|
6563
|
-
|
|
6578
|
+
const packet = this.packet(room.room_id);
|
|
6579
|
+
if (!packet.supportsInviteProvenance && room.invites.some((invite2) => invite2.state === "live" || invite2.state === "receipt_pending")) {
|
|
6564
6580
|
throw new RoomServiceError(
|
|
6565
|
-
"
|
|
6581
|
+
"the installed ours SDK does not expose authenticated invite provenance; revoke or consume the current invitation first"
|
|
6566
6582
|
);
|
|
6567
6583
|
}
|
|
6568
|
-
const packet = this.packet(room.room_id);
|
|
6569
6584
|
const minted = await packet.mintInvite(request.mode);
|
|
6570
6585
|
const invite = RoomInviteSchema.parse({
|
|
6571
6586
|
invite_id: minted.invite_id,
|
|
@@ -7164,7 +7179,12 @@ var init_service = __esm({
|
|
|
7164
7179
|
if (room.state === "closed" || room.state === "closing") return room;
|
|
7165
7180
|
const contactsByCid = /* @__PURE__ */ new Map();
|
|
7166
7181
|
for (const contact of packet.listContacts()) {
|
|
7167
|
-
if (
|
|
7182
|
+
if (contactsByCid.has(contact.container_id)) continue;
|
|
7183
|
+
const authenticatedInvite = contact.accepted_via_invite_id;
|
|
7184
|
+
contactsByCid.set(contact.container_id, {
|
|
7185
|
+
displayName: contact.name,
|
|
7186
|
+
...authenticatedInvite === void 0 ? {} : { inviteId: authenticatedInvite }
|
|
7187
|
+
});
|
|
7168
7188
|
}
|
|
7169
7189
|
const inviteById = new Map(room.invites.map((invite) => [invite.invite_id, invite]));
|
|
7170
7190
|
const existingCids = new Set(room.seats.filter((seat) => seat.state === "active" || seat.state === "pending").map((seat) => seat.identity));
|
|
@@ -7180,13 +7200,13 @@ var init_service = __esm({
|
|
|
7180
7200
|
const seatsWithActivations = [...room.seats];
|
|
7181
7201
|
for (const [seatIndex, seat] of room.seats.entries()) {
|
|
7182
7202
|
if (seat.state !== "pending") continue;
|
|
7183
|
-
const
|
|
7184
|
-
if (
|
|
7203
|
+
const contact = contactsByCid.get(seat.identity);
|
|
7204
|
+
if (contact === void 0) continue;
|
|
7185
7205
|
const { alias: _alias, replaces_seat: _replacesSeat, ...base } = seat;
|
|
7186
7206
|
const activated = {
|
|
7187
7207
|
...base,
|
|
7188
7208
|
state: "active",
|
|
7189
|
-
display_name: displayName,
|
|
7209
|
+
display_name: contact.displayName,
|
|
7190
7210
|
accepted_at: this.now(),
|
|
7191
7211
|
..._replacesSeat === void 0 ? {} : { replaces_seat: _replacesSeat },
|
|
7192
7212
|
...room.anonymous ? { alias: _alias } : {}
|
|
@@ -7196,11 +7216,13 @@ var init_service = __esm({
|
|
|
7196
7216
|
}
|
|
7197
7217
|
const newSeats = [];
|
|
7198
7218
|
const eligibleInvites = room.invites.filter((invite) => invite.state === "live" && (invite.recovery_of === void 0 || invite.recovery_confirmed === true));
|
|
7199
|
-
const
|
|
7200
|
-
for (const [cid,
|
|
7219
|
+
const legacyAdmissionInvite = !packet.supportsInviteProvenance && eligibleInvites.length === 1 ? eligibleInvites[0] : void 0;
|
|
7220
|
+
for (const [cid, contact] of contactsByCid) {
|
|
7201
7221
|
if (existingCids.has(cid)) continue;
|
|
7202
|
-
const invite =
|
|
7222
|
+
const invite = contact.inviteId === void 0 ? legacyAdmissionInvite : inviteById.get(contact.inviteId);
|
|
7203
7223
|
if (!invite) continue;
|
|
7224
|
+
if (invite.state !== "live") continue;
|
|
7225
|
+
if (invite.recovery_of !== void 0 && invite.recovery_confirmed !== true) continue;
|
|
7204
7226
|
const removedAt = lastRemovedAt.get(cid);
|
|
7205
7227
|
if (removedAt !== void 0 && invite.created_at <= removedAt) continue;
|
|
7206
7228
|
const seated = [...seatsWithActivations, ...newSeats];
|
|
@@ -7208,7 +7230,7 @@ var init_service = __esm({
|
|
|
7208
7230
|
if (invite.replaces_seat !== void 0 && !predecessor) continue;
|
|
7209
7231
|
newSeats.push({
|
|
7210
7232
|
identity: cid,
|
|
7211
|
-
display_name: displayName,
|
|
7233
|
+
display_name: contact.displayName,
|
|
7212
7234
|
role: invite.role,
|
|
7213
7235
|
invite_id: invite.invite_id,
|
|
7214
7236
|
accepted_at: this.now(),
|
package/dist/web/assets/app.js
CHANGED
|
@@ -37,4 +37,4 @@ var Gf=Object.defineProperty;var Zf=(i,c,u)=>c in i?Gf(i,c,{enumerable:!0,config
|
|
|
37
37
|
`+o[s].replace(" at new "," at ");return e.displayName&&f.includes("<anonymous>")&&(f=f.replace("<anonymous>",e.displayName)),f}while(1<=s&&0<=d);break}}}finally{ne=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?N(e):""}function ae(e){switch(e.tag){case 5:return N(e.type);case 16:return N("Lazy");case 13:return N("Suspense");case 19:return N("SuspenseList");case 0:case 2:case 15:return e=re(e.type,!1),e;case 11:return e=re(e.type.render,!1),e;case 1:return e=re(e.type,!0),e;default:return""}}function ie(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Re:return"Fragment";case pe:return"Portal";case te:return"Profiler";case Ee:return"StrictMode";case Te:return"Suspense";case ot:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ke:return(e.displayName||"Context")+".Consumer";case Ye:return(e._context.displayName||"Context")+".Provider";case it:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case lt:return t=e.displayName||null,t!==null?t:ie(e.type)||"Memo";case Xe:t=e._payload,e=e._init;try{return ie(e(t))}catch{}}return null}function fe(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ie(t);case 8:return t===Ee?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ue(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function se(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function _e(e){var t=se(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,l=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,l.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function tt(e){e._valueTracker||(e._valueTracker=_e(e))}function yi(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=se(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function st(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Yn(e,t){var n=t.checked;return V({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Er(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ue(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Cr(e,t){t=t.checked,t!=null&&le(e,"checked",t,!1)}function Kn(e,t){Cr(e,t);var n=ue(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?At(e,t.type,n):t.hasOwnProperty("defaultValue")&&At(e,t.type,ue(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function jr(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function At(e,t,n){(t!=="number"||st(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ae=Array.isArray;function Pt(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+ue(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function tn(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(u(91));return V({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Wt(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(u(92));if(Ae(n)){if(1<n.length)throw Error(u(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:ue(n)}}function Nn(e,t){var n=ue(t.value),r=ue(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function gi(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Se(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function nn(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Se(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var rn,qe=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(rn=rn||document.createElement("div"),rn.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=rn.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Rn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Tn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},de=["Webkit","ms","Moz","O"];Object.keys(Tn).forEach(function(e){de.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Tn[t]=Tn[e]})});function _i(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Tn.hasOwnProperty(e)&&Tn[e]?(""+t).trim():t+"px"}function wi(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=_i(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var Do=V({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Nr(e,t){if(t){if(Do[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(u(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(u(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(u(61))}if(t.style!=null&&typeof t.style!="object")throw Error(u(62))}}function Rr(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Tr=null;function Pr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xn=null,x=null,A=null;function F(e){if(e=Zr(e)){if(typeof Xn!="function")throw Error(u(280));var t=e.stateNode;t&&(t=Hi(t),Xn(e.stateNode,e.type,t))}}function b(e){x?A?A.push(e):A=[e]:x=e}function Y(){if(x){var e=x,t=A;if(A=x=null,F(e),t)for(e=0;e<t.length;e++)F(t[e])}}function me(e,t){return e(t)}function he(){}var ht=!1;function Qt(e,t,n){if(ht)return e(t,n);ht=!0;try{return me(e,t,n)}finally{ht=!1,(x!==null||A!==null)&&(he(),Y())}}function on(e,t){var n=e.stateNode;if(n===null)return null;var r=Hi(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(u(231,t,typeof n));return n}var Gn=!1;if(z)try{var zr={};Object.defineProperty(zr,"passive",{get:function(){Gn=!0}}),window.addEventListener("test",zr,zr),window.removeEventListener("test",zr,zr)}catch{Gn=!1}function td(e,t,n,r,o,l,s,d,f){var w=Array.prototype.slice.call(arguments,3);try{t.apply(n,w)}catch(T){this.onError(T)}}var Lr=!1,xi=null,Si=!1,Io=null,nd={onError:function(e){Lr=!0,xi=e}};function rd(e,t,n,r,o,l,s,d,f){Lr=!1,xi=null,td.apply(nd,arguments)}function id(e,t,n,r,o,l,s,d,f){if(rd.apply(this,arguments),Lr){if(Lr){var w=xi;Lr=!1,xi=null}else throw Error(u(198));Si||(Si=!0,Io=w)}}function Pn(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Ds(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Is(e){if(Pn(e)!==e)throw Error(u(188))}function od(e){var t=e.alternate;if(!t){if(t=Pn(e),t===null)throw Error(u(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var l=o.alternate;if(l===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===l.child){for(l=o.child;l;){if(l===n)return Is(o),e;if(l===r)return Is(o),t;l=l.sibling}throw Error(u(188))}if(n.return!==r.return)n=o,r=l;else{for(var s=!1,d=o.child;d;){if(d===n){s=!0,n=o,r=l;break}if(d===r){s=!0,r=o,n=l;break}d=d.sibling}if(!s){for(d=l.child;d;){if(d===n){s=!0,n=l,r=o;break}if(d===r){s=!0,r=l,n=o;break}d=d.sibling}if(!s)throw Error(u(189))}}if(n.alternate!==r)throw Error(u(190))}if(n.tag!==3)throw Error(u(188));return n.stateNode.current===n?e:t}function Fs(e){return e=od(e),e!==null?As(e):null}function As(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=As(e);if(t!==null)return t;e=e.sibling}return null}var $s=c.unstable_scheduleCallback,Us=c.unstable_cancelCallback,ld=c.unstable_shouldYield,sd=c.unstable_requestPaint,Me=c.unstable_now,ad=c.unstable_getCurrentPriorityLevel,Fo=c.unstable_ImmediatePriority,Bs=c.unstable_UserBlockingPriority,ki=c.unstable_NormalPriority,ud=c.unstable_LowPriority,Vs=c.unstable_IdlePriority,Ei=null,$t=null;function cd(e){if($t&&typeof $t.onCommitFiberRoot=="function")try{$t.onCommitFiberRoot(Ei,e,void 0,(e.current.flags&128)===128)}catch{}}var zt=Math.clz32?Math.clz32:pd,dd=Math.log,fd=Math.LN2;function pd(e){return e>>>=0,e===0?32:31-(dd(e)/fd|0)|0}var Ci=64,ji=4194304;function Or(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ni(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,l=e.pingedLanes,s=n&268435455;if(s!==0){var d=s&~o;d!==0?r=Or(d):(l&=s,l!==0&&(r=Or(l)))}else s=n&~o,s!==0?r=Or(s):l!==0&&(r=Or(l));if(r===0)return 0;if(t!==0&&t!==r&&(t&o)===0&&(o=r&-r,l=t&-t,o>=l||o===16&&(l&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-zt(t),o=1<<n,r|=e[n],t&=~o;return r}function md(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function hd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,l=e.pendingLanes;0<l;){var s=31-zt(l),d=1<<s,f=o[s];f===-1?((d&n)===0||(d&r)!==0)&&(o[s]=md(d,t)):f<=t&&(e.expiredLanes|=d),l&=~d}}function Ao(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Hs(){var e=Ci;return Ci<<=1,(Ci&4194240)===0&&(Ci=64),e}function $o(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Mr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-zt(t),e[t]=n}function vd(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-zt(n),l=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~l}}function Uo(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-zt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var we=0;function qs(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Ws,Bo,Qs,Ys,Ks,Vo=!1,Ri=[],ln=null,sn=null,an=null,Dr=new Map,Ir=new Map,un=[],yd="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Xs(e,t){switch(e){case"focusin":case"focusout":ln=null;break;case"dragenter":case"dragleave":sn=null;break;case"mouseover":case"mouseout":an=null;break;case"pointerover":case"pointerout":Dr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ir.delete(t.pointerId)}}function Fr(e,t,n,r,o,l){return e===null||e.nativeEvent!==l?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:l,targetContainers:[o]},t!==null&&(t=Zr(t),t!==null&&Bo(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function gd(e,t,n,r,o){switch(t){case"focusin":return ln=Fr(ln,e,t,n,r,o),!0;case"dragenter":return sn=Fr(sn,e,t,n,r,o),!0;case"mouseover":return an=Fr(an,e,t,n,r,o),!0;case"pointerover":var l=o.pointerId;return Dr.set(l,Fr(Dr.get(l)||null,e,t,n,r,o)),!0;case"gotpointercapture":return l=o.pointerId,Ir.set(l,Fr(Ir.get(l)||null,e,t,n,r,o)),!0}return!1}function Gs(e){var t=zn(e.target);if(t!==null){var n=Pn(t);if(n!==null){if(t=n.tag,t===13){if(t=Ds(n),t!==null){e.blockedOn=t,Ks(e.priority,function(){Qs(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ti(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=qo(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Tr=r,n.target.dispatchEvent(r),Tr=null}else return t=Zr(n),t!==null&&Bo(t),e.blockedOn=n,!1;t.shift()}return!0}function Zs(e,t,n){Ti(e)&&n.delete(t)}function _d(){Vo=!1,ln!==null&&Ti(ln)&&(ln=null),sn!==null&&Ti(sn)&&(sn=null),an!==null&&Ti(an)&&(an=null),Dr.forEach(Zs),Ir.forEach(Zs)}function Ar(e,t){e.blockedOn===t&&(e.blockedOn=null,Vo||(Vo=!0,c.unstable_scheduleCallback(c.unstable_NormalPriority,_d)))}function $r(e){function t(o){return Ar(o,e)}if(0<Ri.length){Ar(Ri[0],e);for(var n=1;n<Ri.length;n++){var r=Ri[n];r.blockedOn===e&&(r.blockedOn=null)}}for(ln!==null&&Ar(ln,e),sn!==null&&Ar(sn,e),an!==null&&Ar(an,e),Dr.forEach(t),Ir.forEach(t),n=0;n<un.length;n++)r=un[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<un.length&&(n=un[0],n.blockedOn===null);)Gs(n),n.blockedOn===null&&un.shift()}var Zn=ge.ReactCurrentBatchConfig,Pi=!0;function wd(e,t,n,r){var o=we,l=Zn.transition;Zn.transition=null;try{we=1,Ho(e,t,n,r)}finally{we=o,Zn.transition=l}}function xd(e,t,n,r){var o=we,l=Zn.transition;Zn.transition=null;try{we=4,Ho(e,t,n,r)}finally{we=o,Zn.transition=l}}function Ho(e,t,n,r){if(Pi){var o=qo(e,t,n,r);if(o===null)sl(e,t,r,zi,n),Xs(e,r);else if(gd(o,e,t,n,r))r.stopPropagation();else if(Xs(e,r),t&4&&-1<yd.indexOf(e)){for(;o!==null;){var l=Zr(o);if(l!==null&&Ws(l),l=qo(e,t,n,r),l===null&&sl(e,t,r,zi,n),l===o)break;o=l}o!==null&&r.stopPropagation()}else sl(e,t,r,null,n)}}var zi=null;function qo(e,t,n,r){if(zi=null,e=Pr(r),e=zn(e),e!==null)if(t=Pn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Ds(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return zi=e,null}function bs(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(ad()){case Fo:return 1;case Bs:return 4;case ki:case ud:return 16;case Vs:return 536870912;default:return 16}default:return 16}}var cn=null,Wo=null,Li=null;function Js(){if(Li)return Li;var e,t=Wo,n=t.length,r,o="value"in cn?cn.value:cn.textContent,l=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[l-r];r++);return Li=o.slice(e,1<r?1-r:void 0)}function Oi(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Mi(){return!0}function ea(){return!1}function vt(e){function t(n,r,o,l,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=l,this.target=s,this.currentTarget=null;for(var d in e)e.hasOwnProperty(d)&&(n=e[d],this[d]=n?n(l):l[d]);return this.isDefaultPrevented=(l.defaultPrevented!=null?l.defaultPrevented:l.returnValue===!1)?Mi:ea,this.isPropagationStopped=ea,this}return V(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Mi)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Mi)},persist:function(){},isPersistent:Mi}),t}var bn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Qo=vt(bn),Ur=V({},bn,{view:0,detail:0}),Sd=vt(Ur),Yo,Ko,Br,Di=V({},Ur,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Go,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Br&&(Br&&e.type==="mousemove"?(Yo=e.screenX-Br.screenX,Ko=e.screenY-Br.screenY):Ko=Yo=0,Br=e),Yo)},movementY:function(e){return"movementY"in e?e.movementY:Ko}}),ta=vt(Di),kd=V({},Di,{dataTransfer:0}),Ed=vt(kd),Cd=V({},Ur,{relatedTarget:0}),Xo=vt(Cd),jd=V({},bn,{animationName:0,elapsedTime:0,pseudoElement:0}),Nd=vt(jd),Rd=V({},bn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Td=vt(Rd),Pd=V({},bn,{data:0}),na=vt(Pd),zd={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ld={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Od={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Md(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Od[e])?!!t[e]:!1}function Go(){return Md}var Dd=V({},Ur,{key:function(e){if(e.key){var t=zd[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Oi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ld[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Go,charCode:function(e){return e.type==="keypress"?Oi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Oi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Id=vt(Dd),Fd=V({},Di,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ra=vt(Fd),Ad=V({},Ur,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Go}),$d=vt(Ad),Ud=V({},bn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Bd=vt(Ud),Vd=V({},Di,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Hd=vt(Vd),qd=[9,13,27,32],Zo=z&&"CompositionEvent"in window,Vr=null;z&&"documentMode"in document&&(Vr=document.documentMode);var Wd=z&&"TextEvent"in window&&!Vr,ia=z&&(!Zo||Vr&&8<Vr&&11>=Vr),oa=" ",la=!1;function sa(e,t){switch(e){case"keyup":return qd.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function aa(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Jn=!1;function Qd(e,t){switch(e){case"compositionend":return aa(t);case"keypress":return t.which!==32?null:(la=!0,oa);case"textInput":return e=t.data,e===oa&&la?null:e;default:return null}}function Yd(e,t){if(Jn)return e==="compositionend"||!Zo&&sa(e,t)?(e=Js(),Li=Wo=cn=null,Jn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return ia&&t.locale!=="ko"?null:t.data;default:return null}}var Kd={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ua(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Kd[e.type]:t==="textarea"}function ca(e,t,n,r){b(r),t=Ui(t,"onChange"),0<t.length&&(n=new Qo("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Hr=null,qr=null;function Xd(e){Ra(e,0)}function Ii(e){var t=ir(e);if(yi(t))return e}function Gd(e,t){if(e==="change")return t}var da=!1;if(z){var bo;if(z){var Jo="oninput"in document;if(!Jo){var fa=document.createElement("div");fa.setAttribute("oninput","return;"),Jo=typeof fa.oninput=="function"}bo=Jo}else bo=!1;da=bo&&(!document.documentMode||9<document.documentMode)}function pa(){Hr&&(Hr.detachEvent("onpropertychange",ma),qr=Hr=null)}function ma(e){if(e.propertyName==="value"&&Ii(qr)){var t=[];ca(t,qr,e,Pr(e)),Qt(Xd,t)}}function Zd(e,t,n){e==="focusin"?(pa(),Hr=t,qr=n,Hr.attachEvent("onpropertychange",ma)):e==="focusout"&&pa()}function bd(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ii(qr)}function Jd(e,t){if(e==="click")return Ii(t)}function ef(e,t){if(e==="input"||e==="change")return Ii(t)}function tf(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Lt=typeof Object.is=="function"?Object.is:tf;function Wr(e,t){if(Lt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!j.call(t,o)||!Lt(e[o],t[o]))return!1}return!0}function ha(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function va(e,t){var n=ha(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ha(n)}}function ya(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ya(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ga(){for(var e=window,t=st();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=st(e.document)}return t}function el(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function nf(e){var t=ga(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ya(n.ownerDocument.documentElement,n)){if(r!==null&&el(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,l=Math.min(r.start,o);r=r.end===void 0?l:Math.min(r.end,o),!e.extend&&l>r&&(o=r,r=l,l=o),o=va(n,l);var s=va(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),l>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var rf=z&&"documentMode"in document&&11>=document.documentMode,er=null,tl=null,Qr=null,nl=!1;function _a(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;nl||er==null||er!==st(r)||(r=er,"selectionStart"in r&&el(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Qr&&Wr(Qr,r)||(Qr=r,r=Ui(tl,"onSelect"),0<r.length&&(t=new Qo("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=er)))}function Fi(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var tr={animationend:Fi("Animation","AnimationEnd"),animationiteration:Fi("Animation","AnimationIteration"),animationstart:Fi("Animation","AnimationStart"),transitionend:Fi("Transition","TransitionEnd")},rl={},wa={};z&&(wa=document.createElement("div").style,"AnimationEvent"in window||(delete tr.animationend.animation,delete tr.animationiteration.animation,delete tr.animationstart.animation),"TransitionEvent"in window||delete tr.transitionend.transition);function Ai(e){if(rl[e])return rl[e];if(!tr[e])return e;var t=tr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in wa)return rl[e]=t[n];return e}var xa=Ai("animationend"),Sa=Ai("animationiteration"),ka=Ai("animationstart"),Ea=Ai("transitionend"),Ca=new Map,ja="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function dn(e,t){Ca.set(e,t),y(t,[e])}for(var il=0;il<ja.length;il++){var ol=ja[il],of=ol.toLowerCase(),lf=ol[0].toUpperCase()+ol.slice(1);dn(of,"on"+lf)}dn(xa,"onAnimationEnd"),dn(Sa,"onAnimationIteration"),dn(ka,"onAnimationStart"),dn("dblclick","onDoubleClick"),dn("focusin","onFocus"),dn("focusout","onBlur"),dn(Ea,"onTransitionEnd"),S("onMouseEnter",["mouseout","mouseover"]),S("onMouseLeave",["mouseout","mouseover"]),S("onPointerEnter",["pointerout","pointerover"]),S("onPointerLeave",["pointerout","pointerover"]),y("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),y("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),y("onBeforeInput",["compositionend","keypress","textInput","paste"]),y("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),y("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),y("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yr="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),sf=new Set("cancel close invalid load scroll toggle".split(" ").concat(Yr));function Na(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,id(r,t,void 0,e),e.currentTarget=null}function Ra(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var l=void 0;if(t)for(var s=r.length-1;0<=s;s--){var d=r[s],f=d.instance,w=d.currentTarget;if(d=d.listener,f!==l&&o.isPropagationStopped())break e;Na(o,d,w),l=f}else for(s=0;s<r.length;s++){if(d=r[s],f=d.instance,w=d.currentTarget,d=d.listener,f!==l&&o.isPropagationStopped())break e;Na(o,d,w),l=f}}}if(Si)throw e=Io,Si=!1,Io=null,e}function je(e,t){var n=t[pl];n===void 0&&(n=t[pl]=new Set);var r=e+"__bubble";n.has(r)||(Ta(t,e,2,!1),n.add(r))}function ll(e,t,n){var r=0;t&&(r|=4),Ta(n,e,r,t)}var $i="_reactListening"+Math.random().toString(36).slice(2);function Kr(e){if(!e[$i]){e[$i]=!0,g.forEach(function(n){n!=="selectionchange"&&(sf.has(n)||ll(n,!1,e),ll(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[$i]||(t[$i]=!0,ll("selectionchange",!1,t))}}function Ta(e,t,n,r){switch(bs(t)){case 1:var o=wd;break;case 4:o=xd;break;default:o=Ho}n=o.bind(null,t,n,e),o=void 0,!Gn||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function sl(e,t,n,r,o){var l=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var d=r.stateNode.containerInfo;if(d===o||d.nodeType===8&&d.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var f=s.tag;if((f===3||f===4)&&(f=s.stateNode.containerInfo,f===o||f.nodeType===8&&f.parentNode===o))return;s=s.return}for(;d!==null;){if(s=zn(d),s===null)return;if(f=s.tag,f===5||f===6){r=l=s;continue e}d=d.parentNode}}r=r.return}Qt(function(){var w=l,T=Pr(n),P=[];e:{var R=Ca.get(e);if(R!==void 0){var B=Qo,q=e;switch(e){case"keypress":if(Oi(n)===0)break e;case"keydown":case"keyup":B=Id;break;case"focusin":q="focus",B=Xo;break;case"focusout":q="blur",B=Xo;break;case"beforeblur":case"afterblur":B=Xo;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":B=ta;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":B=Ed;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":B=$d;break;case xa:case Sa:case ka:B=Nd;break;case Ea:B=Bd;break;case"scroll":B=Sd;break;case"wheel":B=Hd;break;case"copy":case"cut":case"paste":B=Td;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":B=ra}var Q=(t&4)!==0,De=!Q&&e==="scroll",v=Q?R!==null?R+"Capture":null:R;Q=[];for(var p=w,_;p!==null;){_=p;var M=_.stateNode;if(_.tag===5&&M!==null&&(_=M,v!==null&&(M=on(p,v),M!=null&&Q.push(Xr(p,M,_)))),De)break;p=p.return}0<Q.length&&(R=new B(R,q,null,n,T),P.push({event:R,listeners:Q}))}}if((t&7)===0){e:{if(R=e==="mouseover"||e==="pointerover",B=e==="mouseout"||e==="pointerout",R&&n!==Tr&&(q=n.relatedTarget||n.fromElement)&&(zn(q)||q[Yt]))break e;if((B||R)&&(R=T.window===T?T:(R=T.ownerDocument)?R.defaultView||R.parentWindow:window,B?(q=n.relatedTarget||n.toElement,B=w,q=q?zn(q):null,q!==null&&(De=Pn(q),q!==De||q.tag!==5&&q.tag!==6)&&(q=null)):(B=null,q=w),B!==q)){if(Q=ta,M="onMouseLeave",v="onMouseEnter",p="mouse",(e==="pointerout"||e==="pointerover")&&(Q=ra,M="onPointerLeave",v="onPointerEnter",p="pointer"),De=B==null?R:ir(B),_=q==null?R:ir(q),R=new Q(M,p+"leave",B,n,T),R.target=De,R.relatedTarget=_,M=null,zn(T)===w&&(Q=new Q(v,p+"enter",q,n,T),Q.target=_,Q.relatedTarget=De,M=Q),De=M,B&&q)t:{for(Q=B,v=q,p=0,_=Q;_;_=nr(_))p++;for(_=0,M=v;M;M=nr(M))_++;for(;0<p-_;)Q=nr(Q),p--;for(;0<_-p;)v=nr(v),_--;for(;p--;){if(Q===v||v!==null&&Q===v.alternate)break t;Q=nr(Q),v=nr(v)}Q=null}else Q=null;B!==null&&Pa(P,R,B,Q,!1),q!==null&&De!==null&&Pa(P,De,q,Q,!0)}}e:{if(R=w?ir(w):window,B=R.nodeName&&R.nodeName.toLowerCase(),B==="select"||B==="input"&&R.type==="file")var K=Gd;else if(ua(R))if(da)K=ef;else{K=bd;var G=Zd}else(B=R.nodeName)&&B.toLowerCase()==="input"&&(R.type==="checkbox"||R.type==="radio")&&(K=Jd);if(K&&(K=K(e,w))){ca(P,K,n,T);break e}G&&G(e,R,w),e==="focusout"&&(G=R._wrapperState)&&G.controlled&&R.type==="number"&&At(R,"number",R.value)}switch(G=w?ir(w):window,e){case"focusin":(ua(G)||G.contentEditable==="true")&&(er=G,tl=w,Qr=null);break;case"focusout":Qr=tl=er=null;break;case"mousedown":nl=!0;break;case"contextmenu":case"mouseup":case"dragend":nl=!1,_a(P,n,T);break;case"selectionchange":if(rf)break;case"keydown":case"keyup":_a(P,n,T)}var Z;if(Zo)e:{switch(e){case"compositionstart":var J="onCompositionStart";break e;case"compositionend":J="onCompositionEnd";break e;case"compositionupdate":J="onCompositionUpdate";break e}J=void 0}else Jn?sa(e,n)&&(J="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(J="onCompositionStart");J&&(ia&&n.locale!=="ko"&&(Jn||J!=="onCompositionStart"?J==="onCompositionEnd"&&Jn&&(Z=Js()):(cn=T,Wo="value"in cn?cn.value:cn.textContent,Jn=!0)),G=Ui(w,J),0<G.length&&(J=new na(J,e,null,n,T),P.push({event:J,listeners:G}),Z?J.data=Z:(Z=aa(n),Z!==null&&(J.data=Z)))),(Z=Wd?Qd(e,n):Yd(e,n))&&(w=Ui(w,"onBeforeInput"),0<w.length&&(T=new na("onBeforeInput","beforeinput",null,n,T),P.push({event:T,listeners:w}),T.data=Z))}Ra(P,t)})}function Xr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ui(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,l=o.stateNode;o.tag===5&&l!==null&&(o=l,l=on(e,n),l!=null&&r.unshift(Xr(e,l,o)),l=on(e,t),l!=null&&r.push(Xr(e,l,o))),e=e.return}return r}function nr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Pa(e,t,n,r,o){for(var l=t._reactName,s=[];n!==null&&n!==r;){var d=n,f=d.alternate,w=d.stateNode;if(f!==null&&f===r)break;d.tag===5&&w!==null&&(d=w,o?(f=on(n,l),f!=null&&s.unshift(Xr(n,f,d))):o||(f=on(n,l),f!=null&&s.push(Xr(n,f,d)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var af=/\r\n?/g,uf=/\u0000|\uFFFD/g;function za(e){return(typeof e=="string"?e:""+e).replace(af,`
|
|
38
38
|
`).replace(uf,"")}function Bi(e,t,n){if(t=za(t),za(e)!==t&&n)throw Error(u(425))}function Vi(){}var al=null,ul=null;function cl(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var dl=typeof setTimeout=="function"?setTimeout:void 0,cf=typeof clearTimeout=="function"?clearTimeout:void 0,La=typeof Promise=="function"?Promise:void 0,df=typeof queueMicrotask=="function"?queueMicrotask:typeof La<"u"?function(e){return La.resolve(null).then(e).catch(ff)}:dl;function ff(e){setTimeout(function(){throw e})}function fl(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),$r(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);$r(t)}function fn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Oa(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var rr=Math.random().toString(36).slice(2),Ut="__reactFiber$"+rr,Gr="__reactProps$"+rr,Yt="__reactContainer$"+rr,pl="__reactEvents$"+rr,pf="__reactListeners$"+rr,mf="__reactHandles$"+rr;function zn(e){var t=e[Ut];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Yt]||n[Ut]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Oa(e);e!==null;){if(n=e[Ut])return n;e=Oa(e)}return t}e=n,n=e.parentNode}return null}function Zr(e){return e=e[Ut]||e[Yt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ir(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(u(33))}function Hi(e){return e[Gr]||null}var ml=[],or=-1;function pn(e){return{current:e}}function Ne(e){0>or||(e.current=ml[or],ml[or]=null,or--)}function ke(e,t){or++,ml[or]=e.current,e.current=t}var mn={},Ge=pn(mn),at=pn(!1),Ln=mn;function lr(e,t){var n=e.type.contextTypes;if(!n)return mn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},l;for(l in n)o[l]=t[l];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function ut(e){return e=e.childContextTypes,e!=null}function qi(){Ne(at),Ne(Ge)}function Ma(e,t,n){if(Ge.current!==mn)throw Error(u(168));ke(Ge,t),ke(at,n)}function Da(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(u(108,fe(e)||"Unknown",o));return V({},n,r)}function Wi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||mn,Ln=Ge.current,ke(Ge,e),ke(at,at.current),!0}function Ia(e,t,n){var r=e.stateNode;if(!r)throw Error(u(169));n?(e=Da(e,t,Ln),r.__reactInternalMemoizedMergedChildContext=e,Ne(at),Ne(Ge),ke(Ge,e)):Ne(at),ke(at,n)}var Kt=null,Qi=!1,hl=!1;function Fa(e){Kt===null?Kt=[e]:Kt.push(e)}function hf(e){Qi=!0,Fa(e)}function hn(){if(!hl&&Kt!==null){hl=!0;var e=0,t=we;try{var n=Kt;for(we=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Kt=null,Qi=!1}catch(o){throw Kt!==null&&(Kt=Kt.slice(e+1)),$s(Fo,hn),o}finally{we=t,hl=!1}}return null}var sr=[],ar=0,Yi=null,Ki=0,St=[],kt=0,On=null,Xt=1,Gt="";function Mn(e,t){sr[ar++]=Ki,sr[ar++]=Yi,Yi=e,Ki=t}function Aa(e,t,n){St[kt++]=Xt,St[kt++]=Gt,St[kt++]=On,On=e;var r=Xt;e=Gt;var o=32-zt(r)-1;r&=~(1<<o),n+=1;var l=32-zt(t)+o;if(30<l){var s=o-o%5;l=(r&(1<<s)-1).toString(32),r>>=s,o-=s,Xt=1<<32-zt(t)+o|n<<o|r,Gt=l+e}else Xt=1<<l|n<<o|r,Gt=e}function vl(e){e.return!==null&&(Mn(e,1),Aa(e,1,0))}function yl(e){for(;e===Yi;)Yi=sr[--ar],sr[ar]=null,Ki=sr[--ar],sr[ar]=null;for(;e===On;)On=St[--kt],St[kt]=null,Gt=St[--kt],St[kt]=null,Xt=St[--kt],St[kt]=null}var yt=null,gt=null,Pe=!1,Ot=null;function $a(e,t){var n=Nt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Ua(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,yt=e,gt=fn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,yt=e,gt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=On!==null?{id:Xt,overflow:Gt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Nt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,yt=e,gt=null,!0):!1;default:return!1}}function gl(e){return(e.mode&1)!==0&&(e.flags&128)===0}function _l(e){if(Pe){var t=gt;if(t){var n=t;if(!Ua(e,t)){if(gl(e))throw Error(u(418));t=fn(n.nextSibling);var r=yt;t&&Ua(e,t)?$a(r,n):(e.flags=e.flags&-4097|2,Pe=!1,yt=e)}}else{if(gl(e))throw Error(u(418));e.flags=e.flags&-4097|2,Pe=!1,yt=e}}}function Ba(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;yt=e}function Xi(e){if(e!==yt)return!1;if(!Pe)return Ba(e),Pe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!cl(e.type,e.memoizedProps)),t&&(t=gt)){if(gl(e))throw Va(),Error(u(418));for(;t;)$a(e,t),t=fn(t.nextSibling)}if(Ba(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){gt=fn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}gt=null}}else gt=yt?fn(e.stateNode.nextSibling):null;return!0}function Va(){for(var e=gt;e;)e=fn(e.nextSibling)}function ur(){gt=yt=null,Pe=!1}function wl(e){Ot===null?Ot=[e]:Ot.push(e)}var vf=ge.ReactCurrentBatchConfig;function br(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(u(309));var r=n.stateNode}if(!r)throw Error(u(147,e));var o=r,l=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===l?t.ref:(t=function(s){var d=o.refs;s===null?delete d[l]:d[l]=s},t._stringRef=l,t)}if(typeof e!="string")throw Error(u(284));if(!n._owner)throw Error(u(290,e))}return e}function Gi(e,t){throw e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Ha(e){var t=e._init;return t(e._payload)}function qa(e){function t(v,p){if(e){var _=v.deletions;_===null?(v.deletions=[p],v.flags|=16):_.push(p)}}function n(v,p){if(!e)return null;for(;p!==null;)t(v,p),p=p.sibling;return null}function r(v,p){for(v=new Map;p!==null;)p.key!==null?v.set(p.key,p):v.set(p.index,p),p=p.sibling;return v}function o(v,p){return v=kn(v,p),v.index=0,v.sibling=null,v}function l(v,p,_){return v.index=_,e?(_=v.alternate,_!==null?(_=_.index,_<p?(v.flags|=2,p):_):(v.flags|=2,p)):(v.flags|=1048576,p)}function s(v){return e&&v.alternate===null&&(v.flags|=2),v}function d(v,p,_,M){return p===null||p.tag!==6?(p=ds(_,v.mode,M),p.return=v,p):(p=o(p,_),p.return=v,p)}function f(v,p,_,M){var K=_.type;return K===Re?T(v,p,_.props.children,M,_.key):p!==null&&(p.elementType===K||typeof K=="object"&&K!==null&&K.$$typeof===Xe&&Ha(K)===p.type)?(M=o(p,_.props),M.ref=br(v,p,_),M.return=v,M):(M=xo(_.type,_.key,_.props,null,v.mode,M),M.ref=br(v,p,_),M.return=v,M)}function w(v,p,_,M){return p===null||p.tag!==4||p.stateNode.containerInfo!==_.containerInfo||p.stateNode.implementation!==_.implementation?(p=fs(_,v.mode,M),p.return=v,p):(p=o(p,_.children||[]),p.return=v,p)}function T(v,p,_,M,K){return p===null||p.tag!==7?(p=Vn(_,v.mode,M,K),p.return=v,p):(p=o(p,_),p.return=v,p)}function P(v,p,_){if(typeof p=="string"&&p!==""||typeof p=="number")return p=ds(""+p,v.mode,_),p.return=v,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case xe:return _=xo(p.type,p.key,p.props,null,v.mode,_),_.ref=br(v,null,p),_.return=v,_;case pe:return p=fs(p,v.mode,_),p.return=v,p;case Xe:var M=p._init;return P(v,M(p._payload),_)}if(Ae(p)||X(p))return p=Vn(p,v.mode,_,null),p.return=v,p;Gi(v,p)}return null}function R(v,p,_,M){var K=p!==null?p.key:null;if(typeof _=="string"&&_!==""||typeof _=="number")return K!==null?null:d(v,p,""+_,M);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case xe:return _.key===K?f(v,p,_,M):null;case pe:return _.key===K?w(v,p,_,M):null;case Xe:return K=_._init,R(v,p,K(_._payload),M)}if(Ae(_)||X(_))return K!==null?null:T(v,p,_,M,null);Gi(v,_)}return null}function B(v,p,_,M,K){if(typeof M=="string"&&M!==""||typeof M=="number")return v=v.get(_)||null,d(p,v,""+M,K);if(typeof M=="object"&&M!==null){switch(M.$$typeof){case xe:return v=v.get(M.key===null?_:M.key)||null,f(p,v,M,K);case pe:return v=v.get(M.key===null?_:M.key)||null,w(p,v,M,K);case Xe:var G=M._init;return B(v,p,_,G(M._payload),K)}if(Ae(M)||X(M))return v=v.get(_)||null,T(p,v,M,K,null);Gi(p,M)}return null}function q(v,p,_,M){for(var K=null,G=null,Z=p,J=p=0,He=null;Z!==null&&J<_.length;J++){Z.index>J?(He=Z,Z=null):He=Z.sibling;var ye=R(v,Z,_[J],M);if(ye===null){Z===null&&(Z=He);break}e&&Z&&ye.alternate===null&&t(v,Z),p=l(ye,p,J),G===null?K=ye:G.sibling=ye,G=ye,Z=He}if(J===_.length)return n(v,Z),Pe&&Mn(v,J),K;if(Z===null){for(;J<_.length;J++)Z=P(v,_[J],M),Z!==null&&(p=l(Z,p,J),G===null?K=Z:G.sibling=Z,G=Z);return Pe&&Mn(v,J),K}for(Z=r(v,Z);J<_.length;J++)He=B(Z,v,J,_[J],M),He!==null&&(e&&He.alternate!==null&&Z.delete(He.key===null?J:He.key),p=l(He,p,J),G===null?K=He:G.sibling=He,G=He);return e&&Z.forEach(function(En){return t(v,En)}),Pe&&Mn(v,J),K}function Q(v,p,_,M){var K=X(_);if(typeof K!="function")throw Error(u(150));if(_=K.call(_),_==null)throw Error(u(151));for(var G=K=null,Z=p,J=p=0,He=null,ye=_.next();Z!==null&&!ye.done;J++,ye=_.next()){Z.index>J?(He=Z,Z=null):He=Z.sibling;var En=R(v,Z,ye.value,M);if(En===null){Z===null&&(Z=He);break}e&&Z&&En.alternate===null&&t(v,Z),p=l(En,p,J),G===null?K=En:G.sibling=En,G=En,Z=He}if(ye.done)return n(v,Z),Pe&&Mn(v,J),K;if(Z===null){for(;!ye.done;J++,ye=_.next())ye=P(v,ye.value,M),ye!==null&&(p=l(ye,p,J),G===null?K=ye:G.sibling=ye,G=ye);return Pe&&Mn(v,J),K}for(Z=r(v,Z);!ye.done;J++,ye=_.next())ye=B(Z,v,J,ye.value,M),ye!==null&&(e&&ye.alternate!==null&&Z.delete(ye.key===null?J:ye.key),p=l(ye,p,J),G===null?K=ye:G.sibling=ye,G=ye);return e&&Z.forEach(function(Xf){return t(v,Xf)}),Pe&&Mn(v,J),K}function De(v,p,_,M){if(typeof _=="object"&&_!==null&&_.type===Re&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case xe:e:{for(var K=_.key,G=p;G!==null;){if(G.key===K){if(K=_.type,K===Re){if(G.tag===7){n(v,G.sibling),p=o(G,_.props.children),p.return=v,v=p;break e}}else if(G.elementType===K||typeof K=="object"&&K!==null&&K.$$typeof===Xe&&Ha(K)===G.type){n(v,G.sibling),p=o(G,_.props),p.ref=br(v,G,_),p.return=v,v=p;break e}n(v,G);break}else t(v,G);G=G.sibling}_.type===Re?(p=Vn(_.props.children,v.mode,M,_.key),p.return=v,v=p):(M=xo(_.type,_.key,_.props,null,v.mode,M),M.ref=br(v,p,_),M.return=v,v=M)}return s(v);case pe:e:{for(G=_.key;p!==null;){if(p.key===G)if(p.tag===4&&p.stateNode.containerInfo===_.containerInfo&&p.stateNode.implementation===_.implementation){n(v,p.sibling),p=o(p,_.children||[]),p.return=v,v=p;break e}else{n(v,p);break}else t(v,p);p=p.sibling}p=fs(_,v.mode,M),p.return=v,v=p}return s(v);case Xe:return G=_._init,De(v,p,G(_._payload),M)}if(Ae(_))return q(v,p,_,M);if(X(_))return Q(v,p,_,M);Gi(v,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,p!==null&&p.tag===6?(n(v,p.sibling),p=o(p,_),p.return=v,v=p):(n(v,p),p=ds(_,v.mode,M),p.return=v,v=p),s(v)):n(v,p)}return De}var cr=qa(!0),Wa=qa(!1),Zi=pn(null),bi=null,dr=null,xl=null;function Sl(){xl=dr=bi=null}function kl(e){var t=Zi.current;Ne(Zi),e._currentValue=t}function El(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function fr(e,t){bi=e,xl=dr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(ct=!0),e.firstContext=null)}function Et(e){var t=e._currentValue;if(xl!==e)if(e={context:e,memoizedValue:t,next:null},dr===null){if(bi===null)throw Error(u(308));dr=e,bi.dependencies={lanes:0,firstContext:e}}else dr=dr.next=e;return t}var Dn=null;function Cl(e){Dn===null?Dn=[e]:Dn.push(e)}function Qa(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Cl(t)):(n.next=o.next,o.next=n),t.interleaved=n,Zt(e,r)}function Zt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var vn=!1;function jl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ya(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function bt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function yn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(ve&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Zt(e,n)}return o=r.interleaved,o===null?(t.next=t,Cl(r)):(t.next=o.next,o.next=t),r.interleaved=t,Zt(e,n)}function Ji(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Uo(e,n)}}function Ka(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,l=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};l===null?o=l=s:l=l.next=s,n=n.next}while(n!==null);l===null?o=l=t:l=l.next=t}else o=l=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:l,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function eo(e,t,n,r){var o=e.updateQueue;vn=!1;var l=o.firstBaseUpdate,s=o.lastBaseUpdate,d=o.shared.pending;if(d!==null){o.shared.pending=null;var f=d,w=f.next;f.next=null,s===null?l=w:s.next=w,s=f;var T=e.alternate;T!==null&&(T=T.updateQueue,d=T.lastBaseUpdate,d!==s&&(d===null?T.firstBaseUpdate=w:d.next=w,T.lastBaseUpdate=f))}if(l!==null){var P=o.baseState;s=0,T=w=f=null,d=l;do{var R=d.lane,B=d.eventTime;if((r&R)===R){T!==null&&(T=T.next={eventTime:B,lane:0,tag:d.tag,payload:d.payload,callback:d.callback,next:null});e:{var q=e,Q=d;switch(R=t,B=n,Q.tag){case 1:if(q=Q.payload,typeof q=="function"){P=q.call(B,P,R);break e}P=q;break e;case 3:q.flags=q.flags&-65537|128;case 0:if(q=Q.payload,R=typeof q=="function"?q.call(B,P,R):q,R==null)break e;P=V({},P,R);break e;case 2:vn=!0}}d.callback!==null&&d.lane!==0&&(e.flags|=64,R=o.effects,R===null?o.effects=[d]:R.push(d))}else B={eventTime:B,lane:R,tag:d.tag,payload:d.payload,callback:d.callback,next:null},T===null?(w=T=B,f=P):T=T.next=B,s|=R;if(d=d.next,d===null){if(d=o.shared.pending,d===null)break;R=d,d=R.next,R.next=null,o.lastBaseUpdate=R,o.shared.pending=null}}while(!0);if(T===null&&(f=P),o.baseState=f,o.firstBaseUpdate=w,o.lastBaseUpdate=T,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else l===null&&(o.shared.lanes=0);An|=s,e.lanes=s,e.memoizedState=P}}function Xa(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(u(191,o));o.call(r)}}}var Jr={},Bt=pn(Jr),ei=pn(Jr),ti=pn(Jr);function In(e){if(e===Jr)throw Error(u(174));return e}function Nl(e,t){switch(ke(ti,t),ke(ei,e),ke(Bt,Jr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:nn(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=nn(t,e)}Ne(Bt),ke(Bt,t)}function pr(){Ne(Bt),Ne(ei),Ne(ti)}function Ga(e){In(ti.current);var t=In(Bt.current),n=nn(t,e.type);t!==n&&(ke(ei,e),ke(Bt,n))}function Rl(e){ei.current===e&&(Ne(Bt),Ne(ei))}var ze=pn(0);function to(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Tl=[];function Pl(){for(var e=0;e<Tl.length;e++)Tl[e]._workInProgressVersionPrimary=null;Tl.length=0}var no=ge.ReactCurrentDispatcher,zl=ge.ReactCurrentBatchConfig,Fn=0,Le=null,$e=null,Be=null,ro=!1,ni=!1,ri=0,yf=0;function Ze(){throw Error(u(321))}function Ll(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Lt(e[n],t[n]))return!1;return!0}function Ol(e,t,n,r,o,l){if(Fn=l,Le=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,no.current=e===null||e.memoizedState===null?xf:Sf,e=n(r,o),ni){l=0;do{if(ni=!1,ri=0,25<=l)throw Error(u(301));l+=1,Be=$e=null,t.updateQueue=null,no.current=kf,e=n(r,o)}while(ni)}if(no.current=lo,t=$e!==null&&$e.next!==null,Fn=0,Be=$e=Le=null,ro=!1,t)throw Error(u(300));return e}function Ml(){var e=ri!==0;return ri=0,e}function Vt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Be===null?Le.memoizedState=Be=e:Be=Be.next=e,Be}function Ct(){if($e===null){var e=Le.alternate;e=e!==null?e.memoizedState:null}else e=$e.next;var t=Be===null?Le.memoizedState:Be.next;if(t!==null)Be=t,$e=e;else{if(e===null)throw Error(u(310));$e=e,e={memoizedState:$e.memoizedState,baseState:$e.baseState,baseQueue:$e.baseQueue,queue:$e.queue,next:null},Be===null?Le.memoizedState=Be=e:Be=Be.next=e}return Be}function ii(e,t){return typeof t=="function"?t(e):t}function Dl(e){var t=Ct(),n=t.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=e;var r=$e,o=r.baseQueue,l=n.pending;if(l!==null){if(o!==null){var s=o.next;o.next=l.next,l.next=s}r.baseQueue=o=l,n.pending=null}if(o!==null){l=o.next,r=r.baseState;var d=s=null,f=null,w=l;do{var T=w.lane;if((Fn&T)===T)f!==null&&(f=f.next={lane:0,action:w.action,hasEagerState:w.hasEagerState,eagerState:w.eagerState,next:null}),r=w.hasEagerState?w.eagerState:e(r,w.action);else{var P={lane:T,action:w.action,hasEagerState:w.hasEagerState,eagerState:w.eagerState,next:null};f===null?(d=f=P,s=r):f=f.next=P,Le.lanes|=T,An|=T}w=w.next}while(w!==null&&w!==l);f===null?s=r:f.next=d,Lt(r,t.memoizedState)||(ct=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=f,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do l=o.lane,Le.lanes|=l,An|=l,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Il(e){var t=Ct(),n=t.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,l=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do l=e(l,s.action),s=s.next;while(s!==o);Lt(l,t.memoizedState)||(ct=!0),t.memoizedState=l,t.baseQueue===null&&(t.baseState=l),n.lastRenderedState=l}return[l,r]}function Za(){}function ba(e,t){var n=Le,r=Ct(),o=t(),l=!Lt(r.memoizedState,o);if(l&&(r.memoizedState=o,ct=!0),r=r.queue,Fl(tu.bind(null,n,r,e),[e]),r.getSnapshot!==t||l||Be!==null&&Be.memoizedState.tag&1){if(n.flags|=2048,oi(9,eu.bind(null,n,r,o,t),void 0,null),Ve===null)throw Error(u(349));(Fn&30)!==0||Ja(n,t,o)}return o}function Ja(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Le.updateQueue,t===null?(t={lastEffect:null,stores:null},Le.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function eu(e,t,n,r){t.value=n,t.getSnapshot=r,nu(t)&&ru(e)}function tu(e,t,n){return n(function(){nu(t)&&ru(e)})}function nu(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Lt(e,n)}catch{return!0}}function ru(e){var t=Zt(e,1);t!==null&&Ft(t,e,1,-1)}function iu(e){var t=Vt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ii,lastRenderedState:e},t.queue=e,e=e.dispatch=wf.bind(null,Le,e),[t.memoizedState,e]}function oi(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Le.updateQueue,t===null?(t={lastEffect:null,stores:null},Le.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function ou(){return Ct().memoizedState}function io(e,t,n,r){var o=Vt();Le.flags|=e,o.memoizedState=oi(1|t,n,void 0,r===void 0?null:r)}function oo(e,t,n,r){var o=Ct();r=r===void 0?null:r;var l=void 0;if($e!==null){var s=$e.memoizedState;if(l=s.destroy,r!==null&&Ll(r,s.deps)){o.memoizedState=oi(t,n,l,r);return}}Le.flags|=e,o.memoizedState=oi(1|t,n,l,r)}function lu(e,t){return io(8390656,8,e,t)}function Fl(e,t){return oo(2048,8,e,t)}function su(e,t){return oo(4,2,e,t)}function au(e,t){return oo(4,4,e,t)}function uu(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function cu(e,t,n){return n=n!=null?n.concat([e]):null,oo(4,4,uu.bind(null,t,e),n)}function Al(){}function du(e,t){var n=Ct();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ll(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function fu(e,t){var n=Ct();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ll(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function pu(e,t,n){return(Fn&21)===0?(e.baseState&&(e.baseState=!1,ct=!0),e.memoizedState=n):(Lt(n,t)||(n=Hs(),Le.lanes|=n,An|=n,e.baseState=!0),t)}function gf(e,t){var n=we;we=n!==0&&4>n?n:4,e(!0);var r=zl.transition;zl.transition={};try{e(!1),t()}finally{we=n,zl.transition=r}}function mu(){return Ct().memoizedState}function _f(e,t,n){var r=xn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},hu(e))vu(t,n);else if(n=Qa(e,t,n,r),n!==null){var o=rt();Ft(n,e,r,o),yu(n,t,r)}}function wf(e,t,n){var r=xn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(hu(e))vu(t,o);else{var l=e.alternate;if(e.lanes===0&&(l===null||l.lanes===0)&&(l=t.lastRenderedReducer,l!==null))try{var s=t.lastRenderedState,d=l(s,n);if(o.hasEagerState=!0,o.eagerState=d,Lt(d,s)){var f=t.interleaved;f===null?(o.next=o,Cl(t)):(o.next=f.next,f.next=o),t.interleaved=o;return}}catch{}finally{}n=Qa(e,t,o,r),n!==null&&(o=rt(),Ft(n,e,r,o),yu(n,t,r))}}function hu(e){var t=e.alternate;return e===Le||t!==null&&t===Le}function vu(e,t){ni=ro=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function yu(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Uo(e,n)}}var lo={readContext:Et,useCallback:Ze,useContext:Ze,useEffect:Ze,useImperativeHandle:Ze,useInsertionEffect:Ze,useLayoutEffect:Ze,useMemo:Ze,useReducer:Ze,useRef:Ze,useState:Ze,useDebugValue:Ze,useDeferredValue:Ze,useTransition:Ze,useMutableSource:Ze,useSyncExternalStore:Ze,useId:Ze,unstable_isNewReconciler:!1},xf={readContext:Et,useCallback:function(e,t){return Vt().memoizedState=[e,t===void 0?null:t],e},useContext:Et,useEffect:lu,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,io(4194308,4,uu.bind(null,t,e),n)},useLayoutEffect:function(e,t){return io(4194308,4,e,t)},useInsertionEffect:function(e,t){return io(4,2,e,t)},useMemo:function(e,t){var n=Vt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Vt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=_f.bind(null,Le,e),[r.memoizedState,e]},useRef:function(e){var t=Vt();return e={current:e},t.memoizedState=e},useState:iu,useDebugValue:Al,useDeferredValue:function(e){return Vt().memoizedState=e},useTransition:function(){var e=iu(!1),t=e[0];return e=gf.bind(null,e[1]),Vt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Le,o=Vt();if(Pe){if(n===void 0)throw Error(u(407));n=n()}else{if(n=t(),Ve===null)throw Error(u(349));(Fn&30)!==0||Ja(r,t,n)}o.memoizedState=n;var l={value:n,getSnapshot:t};return o.queue=l,lu(tu.bind(null,r,l,e),[e]),r.flags|=2048,oi(9,eu.bind(null,r,l,n,t),void 0,null),n},useId:function(){var e=Vt(),t=Ve.identifierPrefix;if(Pe){var n=Gt,r=Xt;n=(r&~(1<<32-zt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ri++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=yf++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Sf={readContext:Et,useCallback:du,useContext:Et,useEffect:Fl,useImperativeHandle:cu,useInsertionEffect:su,useLayoutEffect:au,useMemo:fu,useReducer:Dl,useRef:ou,useState:function(){return Dl(ii)},useDebugValue:Al,useDeferredValue:function(e){var t=Ct();return pu(t,$e.memoizedState,e)},useTransition:function(){var e=Dl(ii)[0],t=Ct().memoizedState;return[e,t]},useMutableSource:Za,useSyncExternalStore:ba,useId:mu,unstable_isNewReconciler:!1},kf={readContext:Et,useCallback:du,useContext:Et,useEffect:Fl,useImperativeHandle:cu,useInsertionEffect:su,useLayoutEffect:au,useMemo:fu,useReducer:Il,useRef:ou,useState:function(){return Il(ii)},useDebugValue:Al,useDeferredValue:function(e){var t=Ct();return $e===null?t.memoizedState=e:pu(t,$e.memoizedState,e)},useTransition:function(){var e=Il(ii)[0],t=Ct().memoizedState;return[e,t]},useMutableSource:Za,useSyncExternalStore:ba,useId:mu,unstable_isNewReconciler:!1};function Mt(e,t){if(e&&e.defaultProps){t=V({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function $l(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:V({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var so={isMounted:function(e){return(e=e._reactInternals)?Pn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=rt(),o=xn(e),l=bt(r,o);l.payload=t,n!=null&&(l.callback=n),t=yn(e,l,o),t!==null&&(Ft(t,e,o,r),Ji(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=rt(),o=xn(e),l=bt(r,o);l.tag=1,l.payload=t,n!=null&&(l.callback=n),t=yn(e,l,o),t!==null&&(Ft(t,e,o,r),Ji(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=rt(),r=xn(e),o=bt(n,r);o.tag=2,t!=null&&(o.callback=t),t=yn(e,o,r),t!==null&&(Ft(t,e,r,n),Ji(t,e,r))}};function gu(e,t,n,r,o,l,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,l,s):t.prototype&&t.prototype.isPureReactComponent?!Wr(n,r)||!Wr(o,l):!0}function _u(e,t,n){var r=!1,o=mn,l=t.contextType;return typeof l=="object"&&l!==null?l=Et(l):(o=ut(t)?Ln:Ge.current,r=t.contextTypes,l=(r=r!=null)?lr(e,o):mn),t=new t(n,l),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=so,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=l),t}function wu(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&so.enqueueReplaceState(t,t.state,null)}function Ul(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},jl(e);var l=t.contextType;typeof l=="object"&&l!==null?o.context=Et(l):(l=ut(t)?Ln:Ge.current,o.context=lr(e,l)),o.state=e.memoizedState,l=t.getDerivedStateFromProps,typeof l=="function"&&($l(e,t,l,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&so.enqueueReplaceState(o,o.state,null),eo(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function mr(e,t){try{var n="",r=t;do n+=ae(r),r=r.return;while(r);var o=n}catch(l){o=`
|
|
39
39
|
Error generating stack: `+l.message+`
|
|
40
|
-
`+l.stack}return{value:e,source:t,stack:o,digest:null}}function Bl(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Vl(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Ef=typeof WeakMap=="function"?WeakMap:Map;function xu(e,t,n){n=bt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ho||(ho=!0,rs=r),Vl(e,t)},n}function Su(e,t,n){n=bt(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Vl(e,t)}}var l=e.stateNode;return l!==null&&typeof l.componentDidCatch=="function"&&(n.callback=function(){Vl(e,t),typeof r!="function"&&(_n===null?_n=new Set([this]):_n.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function ku(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ef;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=Af.bind(null,e,t,n),t.then(e,e))}function Eu(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Cu(e,t,n,r,o){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=bt(-1,1),t.tag=2,yn(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var Cf=ge.ReactCurrentOwner,ct=!1;function nt(e,t,n,r){t.child=e===null?Wa(t,null,n,r):cr(t,e.child,n,r)}function ju(e,t,n,r,o){n=n.render;var l=t.ref;return fr(t,o),r=Ol(e,t,n,r,l,o),n=Ml(),e!==null&&!ct?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Jt(e,t,o)):(Pe&&n&&vl(t),t.flags|=1,nt(e,t,r,o),t.child)}function Nu(e,t,n,r,o){if(e===null){var l=n.type;return typeof l=="function"&&!cs(l)&&l.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=l,Ru(e,t,l,r,o)):(e=xo(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(l=e.child,(e.lanes&o)===0){var s=l.memoizedProps;if(n=n.compare,n=n!==null?n:Wr,n(s,r)&&e.ref===t.ref)return Jt(e,t,o)}return t.flags|=1,e=kn(l,r),e.ref=t.ref,e.return=t,t.child=e}function Ru(e,t,n,r,o){if(e!==null){var l=e.memoizedProps;if(Wr(l,r)&&e.ref===t.ref)if(ct=!1,t.pendingProps=r=l,(e.lanes&o)!==0)(e.flags&131072)!==0&&(ct=!0);else return t.lanes=e.lanes,Jt(e,t,o)}return Hl(e,t,n,r,o)}function Tu(e,t,n){var r=t.pendingProps,o=r.children,l=e!==null?e.memoizedState:null;if(r.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ke(vr,_t),_t|=n;else{if((n&1073741824)===0)return e=l!==null?l.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ke(vr,_t),_t|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=l!==null?l.baseLanes:n,ke(vr,_t),_t|=r}else l!==null?(r=l.baseLanes|n,t.memoizedState=null):r=n,ke(vr,_t),_t|=r;return nt(e,t,o,n),t.child}function Pu(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Hl(e,t,n,r,o){var l=ut(n)?Ln:Ge.current;return l=lr(t,l),fr(t,o),n=Ol(e,t,n,r,l,o),r=Ml(),e!==null&&!ct?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Jt(e,t,o)):(Pe&&r&&vl(t),t.flags|=1,nt(e,t,n,o),t.child)}function zu(e,t,n,r,o){if(ut(n)){var l=!0;Wi(t)}else l=!1;if(fr(t,o),t.stateNode===null)uo(e,t),_u(t,n,r),Ul(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,d=t.memoizedProps;s.props=d;var f=s.context,w=n.contextType;typeof w=="object"&&w!==null?w=Et(w):(w=ut(n)?Ln:Ge.current,w=lr(t,w));var T=n.getDerivedStateFromProps,P=typeof T=="function"||typeof s.getSnapshotBeforeUpdate=="function";P||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(d!==r||f!==w)&&wu(t,s,r,w),vn=!1;var R=t.memoizedState;s.state=R,eo(t,r,s,o),f=t.memoizedState,d!==r||R!==f||at.current||vn?(typeof T=="function"&&($l(t,n,T,r),f=t.memoizedState),(d=vn||gu(t,n,d,r,R,f,w))?(P||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=f),s.props=r,s.state=f,s.context=w,r=d):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,Ya(e,t),d=t.memoizedProps,w=t.type===t.elementType?d:Mt(t.type,d),s.props=w,P=t.pendingProps,R=s.context,f=n.contextType,typeof f=="object"&&f!==null?f=Et(f):(f=ut(n)?Ln:Ge.current,f=lr(t,f));var B=n.getDerivedStateFromProps;(T=typeof B=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(d!==P||R!==f)&&wu(t,s,r,f),vn=!1,R=t.memoizedState,s.state=R,eo(t,r,s,o);var q=t.memoizedState;d!==P||R!==q||at.current||vn?(typeof B=="function"&&($l(t,n,B,r),q=t.memoizedState),(w=vn||gu(t,n,w,r,R,q,f)||!1)?(T||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,q,f),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,q,f)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||d===e.memoizedProps&&R===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&R===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=q),s.props=r,s.state=q,s.context=f,r=w):(typeof s.componentDidUpdate!="function"||d===e.memoizedProps&&R===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&R===e.memoizedState||(t.flags|=1024),r=!1)}return ql(e,t,n,r,l,o)}function ql(e,t,n,r,o,l){Pu(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&Ia(t,n,!1),Jt(e,t,l);r=t.stateNode,Cf.current=t;var d=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=cr(t,e.child,null,l),t.child=cr(t,null,d,l)):nt(e,t,d,l),t.memoizedState=r.state,o&&Ia(t,n,!0),t.child}function Lu(e){var t=e.stateNode;t.pendingContext?Ma(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ma(e,t.context,!1),Nl(e,t.containerInfo)}function Ou(e,t,n,r,o){return ur(),wl(o),t.flags|=256,nt(e,t,n,r),t.child}var Wl={dehydrated:null,treeContext:null,retryLane:0};function Ql(e){return{baseLanes:e,cachePool:null,transitions:null}}function Mu(e,t,n){var r=t.pendingProps,o=ze.current,l=!1,s=(t.flags&128)!==0,d;if((d=s)||(d=e!==null&&e.memoizedState===null?!1:(o&2)!==0),d?(l=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),ke(ze,o&1),e===null)return _l(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(s=r.children,e=r.fallback,l?(r=t.mode,l=t.child,s={mode:"hidden",children:s},(r&1)===0&&l!==null?(l.childLanes=0,l.pendingProps=s):l=So(s,r,0,null),e=Vn(e,r,n,null),l.return=t,e.return=t,l.sibling=e,t.child=l,t.child.memoizedState=Ql(n),t.memoizedState=Wl,e):Yl(t,s));if(o=e.memoizedState,o!==null&&(d=o.dehydrated,d!==null))return jf(e,t,s,r,d,o,n);if(l){l=r.fallback,s=t.mode,o=e.child,d=o.sibling;var f={mode:"hidden",children:r.children};return(s&1)===0&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=f,t.deletions=null):(r=kn(o,f),r.subtreeFlags=o.subtreeFlags&14680064),d!==null?l=kn(d,l):(l=Vn(l,s,n,null),l.flags|=2),l.return=t,r.return=t,r.sibling=l,t.child=r,r=l,l=t.child,s=e.child.memoizedState,s=s===null?Ql(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},l.memoizedState=s,l.childLanes=e.childLanes&~n,t.memoizedState=Wl,r}return l=e.child,e=l.sibling,r=kn(l,{mode:"visible",children:r.children}),(t.mode&1)===0&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Yl(e,t){return t=So({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ao(e,t,n,r){return r!==null&&wl(r),cr(t,e.child,null,n),e=Yl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function jf(e,t,n,r,o,l,s){if(n)return t.flags&256?(t.flags&=-257,r=Bl(Error(u(422))),ao(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(l=r.fallback,o=t.mode,r=So({mode:"visible",children:r.children},o,0,null),l=Vn(l,o,s,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,(t.mode&1)!==0&&cr(t,e.child,null,s),t.child.memoizedState=Ql(s),t.memoizedState=Wl,l);if((t.mode&1)===0)return ao(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var d=r.dgst;return r=d,l=Error(u(419)),r=Bl(l,r,void 0),ao(e,t,s,r)}if(d=(s&e.childLanes)!==0,ct||d){if(r=Ve,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=(o&(r.suspendedLanes|s))!==0?0:o,o!==0&&o!==l.retryLane&&(l.retryLane=o,Zt(e,o),Ft(r,e,o,-1))}return us(),r=Bl(Error(u(421))),ao(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=$f.bind(null,e),o._reactRetry=t,null):(e=l.treeContext,gt=fn(o.nextSibling),yt=t,Pe=!0,Ot=null,e!==null&&(St[kt++]=Xt,St[kt++]=Gt,St[kt++]=On,Xt=e.id,Gt=e.overflow,On=t),t=Yl(t,r.children),t.flags|=4096,t)}function Du(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),El(e.return,t,n)}function Kl(e,t,n,r,o){var l=e.memoizedState;l===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(l.isBackwards=t,l.rendering=null,l.renderingStartTime=0,l.last=r,l.tail=n,l.tailMode=o)}function Iu(e,t,n){var r=t.pendingProps,o=r.revealOrder,l=r.tail;if(nt(e,t,r.children,n),r=ze.current,(r&2)!==0)r=r&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Du(e,n,t);else if(e.tag===19)Du(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ke(ze,r),(t.mode&1)===0)t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&to(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Kl(t,!1,o,n,l);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&to(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Kl(t,!0,n,null,l);break;case"together":Kl(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function uo(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Jt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),An|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,n=kn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=kn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Nf(e,t,n){switch(t.tag){case 3:Lu(t),ur();break;case 5:Ga(t);break;case 1:ut(t.type)&&Wi(t);break;case 4:Nl(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;ke(Zi,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ke(ze,ze.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?Mu(e,t,n):(ke(ze,ze.current&1),e=Jt(e,t,n),e!==null?e.sibling:null);ke(ze,ze.current&1);break;case 19:if(r=(n&t.childLanes)!==0,(e.flags&128)!==0){if(r)return Iu(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ke(ze,ze.current),r)break;return null;case 22:case 23:return t.lanes=0,Tu(e,t,n)}return Jt(e,t,n)}var Fu,Xl,Au,$u;Fu=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Xl=function(){},Au=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,In(Bt.current);var l=null;switch(n){case"input":o=Yn(e,o),r=Yn(e,r),l=[];break;case"select":o=V({},o,{value:void 0}),r=V({},r,{value:void 0}),l=[];break;case"textarea":o=tn(e,o),r=tn(e,r),l=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Vi)}Nr(n,r);var s;n=null;for(w in o)if(!r.hasOwnProperty(w)&&o.hasOwnProperty(w)&&o[w]!=null)if(w==="style"){var d=o[w];for(s in d)d.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else w!=="dangerouslySetInnerHTML"&&w!=="children"&&w!=="suppressContentEditableWarning"&&w!=="suppressHydrationWarning"&&w!=="autoFocus"&&(m.hasOwnProperty(w)?l||(l=[]):(l=l||[]).push(w,null));for(w in r){var f=r[w];if(d=o!=null?o[w]:void 0,r.hasOwnProperty(w)&&f!==d&&(f!=null||d!=null))if(w==="style")if(d){for(s in d)!d.hasOwnProperty(s)||f&&f.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in f)f.hasOwnProperty(s)&&d[s]!==f[s]&&(n||(n={}),n[s]=f[s])}else n||(l||(l=[]),l.push(w,n)),n=f;else w==="dangerouslySetInnerHTML"?(f=f?f.__html:void 0,d=d?d.__html:void 0,f!=null&&d!==f&&(l=l||[]).push(w,f)):w==="children"?typeof f!="string"&&typeof f!="number"||(l=l||[]).push(w,""+f):w!=="suppressContentEditableWarning"&&w!=="suppressHydrationWarning"&&(m.hasOwnProperty(w)?(f!=null&&w==="onScroll"&&je("scroll",e),l||d===f||(l=[])):(l=l||[]).push(w,f))}n&&(l=l||[]).push("style",n);var w=l;(t.updateQueue=w)&&(t.flags|=4)}},$u=function(e,t,n,r){n!==r&&(t.flags|=4)};function li(e,t){if(!Pe)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function be(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Rf(e,t,n){var r=t.pendingProps;switch(yl(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return be(t),null;case 1:return ut(t.type)&&qi(),be(t),null;case 3:return r=t.stateNode,pr(),Ne(at),Ne(Ge),Pl(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Xi(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ot!==null&&(ls(Ot),Ot=null))),Xl(e,t),be(t),null;case 5:Rl(t);var o=In(ti.current);if(n=t.type,e!==null&&t.stateNode!=null)Au(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(u(166));return be(t),null}if(e=In(Bt.current),Xi(t)){r=t.stateNode,n=t.type;var l=t.memoizedProps;switch(r[Ut]=t,r[Gr]=l,e=(t.mode&1)!==0,n){case"dialog":je("cancel",r),je("close",r);break;case"iframe":case"object":case"embed":je("load",r);break;case"video":case"audio":for(o=0;o<Yr.length;o++)je(Yr[o],r);break;case"source":je("error",r);break;case"img":case"image":case"link":je("error",r),je("load",r);break;case"details":je("toggle",r);break;case"input":Er(r,l),je("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!l.multiple},je("invalid",r);break;case"textarea":Wt(r,l),je("invalid",r)}Nr(n,l),o=null;for(var s in l)if(l.hasOwnProperty(s)){var d=l[s];s==="children"?typeof d=="string"?r.textContent!==d&&(l.suppressHydrationWarning!==!0&&Bi(r.textContent,d,e),o=["children",d]):typeof d=="number"&&r.textContent!==""+d&&(l.suppressHydrationWarning!==!0&&Bi(r.textContent,d,e),o=["children",""+d]):m.hasOwnProperty(s)&&d!=null&&s==="onScroll"&&je("scroll",r)}switch(n){case"input":tt(r),jr(r,l,!0);break;case"textarea":tt(r),gi(r);break;case"select":case"option":break;default:typeof l.onClick=="function"&&(r.onclick=Vi)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Se(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Ut]=t,e[Gr]=r,Fu(e,t,!1,!1),t.stateNode=e;e:{switch(s=Rr(n,r),n){case"dialog":je("cancel",e),je("close",e),o=r;break;case"iframe":case"object":case"embed":je("load",e),o=r;break;case"video":case"audio":for(o=0;o<Yr.length;o++)je(Yr[o],e);o=r;break;case"source":je("error",e),o=r;break;case"img":case"image":case"link":je("error",e),je("load",e),o=r;break;case"details":je("toggle",e),o=r;break;case"input":Er(e,r),o=Yn(e,r),je("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=V({},r,{value:void 0}),je("invalid",e);break;case"textarea":Wt(e,r),o=tn(e,r),je("invalid",e);break;default:o=r}Nr(n,o),d=o;for(l in d)if(d.hasOwnProperty(l)){var f=d[l];l==="style"?wi(e,f):l==="dangerouslySetInnerHTML"?(f=f?f.__html:void 0,f!=null&&qe(e,f)):l==="children"?typeof f=="string"?(n!=="textarea"||f!=="")&&Rn(e,f):typeof f=="number"&&Rn(e,""+f):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(m.hasOwnProperty(l)?f!=null&&l==="onScroll"&&je("scroll",e):f!=null&&le(e,l,f,s))}switch(n){case"input":tt(e),jr(e,r,!1);break;case"textarea":tt(e),gi(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ue(r.value));break;case"select":e.multiple=!!r.multiple,l=r.value,l!=null?Pt(e,!!r.multiple,l,!1):r.defaultValue!=null&&Pt(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Vi)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return be(t),null;case 6:if(e&&t.stateNode!=null)$u(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(u(166));if(n=In(ti.current),In(Bt.current),Xi(t)){if(r=t.stateNode,n=t.memoizedProps,r[Ut]=t,(l=r.nodeValue!==n)&&(e=yt,e!==null))switch(e.tag){case 3:Bi(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Bi(r.nodeValue,n,(e.mode&1)!==0)}l&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Ut]=t,t.stateNode=r}return be(t),null;case 13:if(Ne(ze),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Pe&>!==null&&(t.mode&1)!==0&&(t.flags&128)===0)Va(),ur(),t.flags|=98560,l=!1;else if(l=Xi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!l)throw Error(u(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(u(317));l[Ut]=t}else ur(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;be(t),l=!1}else Ot!==null&&(ls(Ot),Ot=null),l=!0;if(!l)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(ze.current&1)!==0?Ue===0&&(Ue=3):us())),t.updateQueue!==null&&(t.flags|=4),be(t),null);case 4:return pr(),Xl(e,t),e===null&&Kr(t.stateNode.containerInfo),be(t),null;case 10:return kl(t.type._context),be(t),null;case 17:return ut(t.type)&&qi(),be(t),null;case 19:if(Ne(ze),l=t.memoizedState,l===null)return be(t),null;if(r=(t.flags&128)!==0,s=l.rendering,s===null)if(r)li(l,!1);else{if(Ue!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=to(e),s!==null){for(t.flags|=128,li(l,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)l=n,e=r,l.flags&=14680066,s=l.alternate,s===null?(l.childLanes=0,l.lanes=e,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=s.childLanes,l.lanes=s.lanes,l.child=s.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=s.memoizedProps,l.memoizedState=s.memoizedState,l.updateQueue=s.updateQueue,l.type=s.type,e=s.dependencies,l.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ke(ze,ze.current&1|2),t.child}e=e.sibling}l.tail!==null&&Me()>yr&&(t.flags|=128,r=!0,li(l,!1),t.lanes=4194304)}else{if(!r)if(e=to(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),li(l,!0),l.tail===null&&l.tailMode==="hidden"&&!s.alternate&&!Pe)return be(t),null}else 2*Me()-l.renderingStartTime>yr&&n!==1073741824&&(t.flags|=128,r=!0,li(l,!1),t.lanes=4194304);l.isBackwards?(s.sibling=t.child,t.child=s):(n=l.last,n!==null?n.sibling=s:t.child=s,l.last=s)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=Me(),t.sibling=null,n=ze.current,ke(ze,r?n&1|2:n&1),t):(be(t),null);case 22:case 23:return as(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(_t&1073741824)!==0&&(be(t),t.subtreeFlags&6&&(t.flags|=8192)):be(t),null;case 24:return null;case 25:return null}throw Error(u(156,t.tag))}function Tf(e,t){switch(yl(t),t.tag){case 1:return ut(t.type)&&qi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return pr(),Ne(at),Ne(Ge),Pl(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Rl(t),null;case 13:if(Ne(ze),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));ur()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ne(ze),null;case 4:return pr(),null;case 10:return kl(t.type._context),null;case 22:case 23:return as(),null;case 24:return null;default:return null}}var co=!1,Je=!1,Pf=typeof WeakSet=="function"?WeakSet:Set,H=null;function hr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Oe(e,t,r)}else n.current=null}function Gl(e,t,n){try{n()}catch(r){Oe(e,t,r)}}var Uu=!1;function zf(e,t){if(al=Pi,e=ga(),el(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,l=r.focusNode;r=r.focusOffset;try{n.nodeType,l.nodeType}catch{n=null;break e}var s=0,d=-1,f=-1,w=0,T=0,P=e,R=null;t:for(;;){for(var B;P!==n||o!==0&&P.nodeType!==3||(d=s+o),P!==l||r!==0&&P.nodeType!==3||(f=s+r),P.nodeType===3&&(s+=P.nodeValue.length),(B=P.firstChild)!==null;)R=P,P=B;for(;;){if(P===e)break t;if(R===n&&++w===o&&(d=s),R===l&&++T===r&&(f=s),(B=P.nextSibling)!==null)break;P=R,R=P.parentNode}P=B}n=d===-1||f===-1?null:{start:d,end:f}}else n=null}n=n||{start:0,end:0}}else n=null;for(ul={focusedElem:e,selectionRange:n},Pi=!1,H=t;H!==null;)if(t=H,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,H=e;else for(;H!==null;){t=H;try{var q=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(q!==null){var Q=q.memoizedProps,De=q.memoizedState,v=t.stateNode,p=v.getSnapshotBeforeUpdate(t.elementType===t.type?Q:Mt(t.type,Q),De);v.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var _=t.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(u(163))}}catch(M){Oe(t,t.return,M)}if(e=t.sibling,e!==null){e.return=t.return,H=e;break}H=t.return}return q=Uu,Uu=!1,q}function si(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var l=o.destroy;o.destroy=void 0,l!==void 0&&Gl(t,n,l)}o=o.next}while(o!==r)}}function fo(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Zl(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Bu(e){var t=e.alternate;t!==null&&(e.alternate=null,Bu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ut],delete t[Gr],delete t[pl],delete t[pf],delete t[mf])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Vu(e){return e.tag===5||e.tag===3||e.tag===4}function Hu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Vu(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function bl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Vi));else if(r!==4&&(e=e.child,e!==null))for(bl(e,t,n),e=e.sibling;e!==null;)bl(e,t,n),e=e.sibling}function Jl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Jl(e,t,n),e=e.sibling;e!==null;)Jl(e,t,n),e=e.sibling}var We=null,Dt=!1;function gn(e,t,n){for(n=n.child;n!==null;)qu(e,t,n),n=n.sibling}function qu(e,t,n){if($t&&typeof $t.onCommitFiberUnmount=="function")try{$t.onCommitFiberUnmount(Ei,n)}catch{}switch(n.tag){case 5:Je||hr(n,t);case 6:var r=We,o=Dt;We=null,gn(e,t,n),We=r,Dt=o,We!==null&&(Dt?(e=We,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):We.removeChild(n.stateNode));break;case 18:We!==null&&(Dt?(e=We,n=n.stateNode,e.nodeType===8?fl(e.parentNode,n):e.nodeType===1&&fl(e,n),$r(e)):fl(We,n.stateNode));break;case 4:r=We,o=Dt,We=n.stateNode.containerInfo,Dt=!0,gn(e,t,n),We=r,Dt=o;break;case 0:case 11:case 14:case 15:if(!Je&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var l=o,s=l.destroy;l=l.tag,s!==void 0&&((l&2)!==0||(l&4)!==0)&&Gl(n,t,s),o=o.next}while(o!==r)}gn(e,t,n);break;case 1:if(!Je&&(hr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(d){Oe(n,t,d)}gn(e,t,n);break;case 21:gn(e,t,n);break;case 22:n.mode&1?(Je=(r=Je)||n.memoizedState!==null,gn(e,t,n),Je=r):gn(e,t,n);break;default:gn(e,t,n)}}function Wu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Pf),t.forEach(function(r){var o=Uf.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function It(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var l=e,s=t,d=s;e:for(;d!==null;){switch(d.tag){case 5:We=d.stateNode,Dt=!1;break e;case 3:We=d.stateNode.containerInfo,Dt=!0;break e;case 4:We=d.stateNode.containerInfo,Dt=!0;break e}d=d.return}if(We===null)throw Error(u(160));qu(l,s,o),We=null,Dt=!1;var f=o.alternate;f!==null&&(f.return=null),o.return=null}catch(w){Oe(o,t,w)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Qu(t,e),t=t.sibling}function Qu(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(It(t,e),Ht(e),r&4){try{si(3,e,e.return),fo(3,e)}catch(Q){Oe(e,e.return,Q)}try{si(5,e,e.return)}catch(Q){Oe(e,e.return,Q)}}break;case 1:It(t,e),Ht(e),r&512&&n!==null&&hr(n,n.return);break;case 5:if(It(t,e),Ht(e),r&512&&n!==null&&hr(n,n.return),e.flags&32){var o=e.stateNode;try{Rn(o,"")}catch(Q){Oe(e,e.return,Q)}}if(r&4&&(o=e.stateNode,o!=null)){var l=e.memoizedProps,s=n!==null?n.memoizedProps:l,d=e.type,f=e.updateQueue;if(e.updateQueue=null,f!==null)try{d==="input"&&l.type==="radio"&&l.name!=null&&Cr(o,l),Rr(d,s);var w=Rr(d,l);for(s=0;s<f.length;s+=2){var T=f[s],P=f[s+1];T==="style"?wi(o,P):T==="dangerouslySetInnerHTML"?qe(o,P):T==="children"?Rn(o,P):le(o,T,P,w)}switch(d){case"input":Kn(o,l);break;case"textarea":Nn(o,l);break;case"select":var R=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!l.multiple;var B=l.value;B!=null?Pt(o,!!l.multiple,B,!1):R!==!!l.multiple&&(l.defaultValue!=null?Pt(o,!!l.multiple,l.defaultValue,!0):Pt(o,!!l.multiple,l.multiple?[]:"",!1))}o[Gr]=l}catch(Q){Oe(e,e.return,Q)}}break;case 6:if(It(t,e),Ht(e),r&4){if(e.stateNode===null)throw Error(u(162));o=e.stateNode,l=e.memoizedProps;try{o.nodeValue=l}catch(Q){Oe(e,e.return,Q)}}break;case 3:if(It(t,e),Ht(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{$r(t.containerInfo)}catch(Q){Oe(e,e.return,Q)}break;case 4:It(t,e),Ht(e);break;case 13:It(t,e),Ht(e),o=e.child,o.flags&8192&&(l=o.memoizedState!==null,o.stateNode.isHidden=l,!l||o.alternate!==null&&o.alternate.memoizedState!==null||(ns=Me())),r&4&&Wu(e);break;case 22:if(T=n!==null&&n.memoizedState!==null,e.mode&1?(Je=(w=Je)||T,It(t,e),Je=w):It(t,e),Ht(e),r&8192){if(w=e.memoizedState!==null,(e.stateNode.isHidden=w)&&!T&&(e.mode&1)!==0)for(H=e,T=e.child;T!==null;){for(P=H=T;H!==null;){switch(R=H,B=R.child,R.tag){case 0:case 11:case 14:case 15:si(4,R,R.return);break;case 1:hr(R,R.return);var q=R.stateNode;if(typeof q.componentWillUnmount=="function"){r=R,n=R.return;try{t=r,q.props=t.memoizedProps,q.state=t.memoizedState,q.componentWillUnmount()}catch(Q){Oe(r,n,Q)}}break;case 5:hr(R,R.return);break;case 22:if(R.memoizedState!==null){Xu(P);continue}}B!==null?(B.return=R,H=B):Xu(P)}T=T.sibling}e:for(T=null,P=e;;){if(P.tag===5){if(T===null){T=P;try{o=P.stateNode,w?(l=o.style,typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"):(d=P.stateNode,f=P.memoizedProps.style,s=f!=null&&f.hasOwnProperty("display")?f.display:null,d.style.display=_i("display",s))}catch(Q){Oe(e,e.return,Q)}}}else if(P.tag===6){if(T===null)try{P.stateNode.nodeValue=w?"":P.memoizedProps}catch(Q){Oe(e,e.return,Q)}}else if((P.tag!==22&&P.tag!==23||P.memoizedState===null||P===e)&&P.child!==null){P.child.return=P,P=P.child;continue}if(P===e)break e;for(;P.sibling===null;){if(P.return===null||P.return===e)break e;T===P&&(T=null),P=P.return}T===P&&(T=null),P.sibling.return=P.return,P=P.sibling}}break;case 19:It(t,e),Ht(e),r&4&&Wu(e);break;case 21:break;default:It(t,e),Ht(e)}}function Ht(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Vu(n)){var r=n;break e}n=n.return}throw Error(u(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Rn(o,""),r.flags&=-33);var l=Hu(e);Jl(e,l,o);break;case 3:case 4:var s=r.stateNode.containerInfo,d=Hu(e);bl(e,d,s);break;default:throw Error(u(161))}}catch(f){Oe(e,e.return,f)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Lf(e,t,n){H=e,Yu(e)}function Yu(e,t,n){for(var r=(e.mode&1)!==0;H!==null;){var o=H,l=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||co;if(!s){var d=o.alternate,f=d!==null&&d.memoizedState!==null||Je;d=co;var w=Je;if(co=s,(Je=f)&&!w)for(H=o;H!==null;)s=H,f=s.child,s.tag===22&&s.memoizedState!==null?Gu(o):f!==null?(f.return=s,H=f):Gu(o);for(;l!==null;)H=l,Yu(l),l=l.sibling;H=o,co=d,Je=w}Ku(e)}else(o.subtreeFlags&8772)!==0&&l!==null?(l.return=o,H=l):Ku(e)}}function Ku(e){for(;H!==null;){var t=H;if((t.flags&8772)!==0){var n=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:Je||fo(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Je)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:Mt(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var l=t.updateQueue;l!==null&&Xa(t,l,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Xa(t,s,n)}break;case 5:var d=t.stateNode;if(n===null&&t.flags&4){n=d;var f=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":f.autoFocus&&n.focus();break;case"img":f.src&&(n.src=f.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var w=t.alternate;if(w!==null){var T=w.memoizedState;if(T!==null){var P=T.dehydrated;P!==null&&$r(P)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(u(163))}Je||t.flags&512&&Zl(t)}catch(R){Oe(t,t.return,R)}}if(t===e){H=null;break}if(n=t.sibling,n!==null){n.return=t.return,H=n;break}H=t.return}}function Xu(e){for(;H!==null;){var t=H;if(t===e){H=null;break}var n=t.sibling;if(n!==null){n.return=t.return,H=n;break}H=t.return}}function Gu(e){for(;H!==null;){var t=H;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{fo(4,t)}catch(f){Oe(t,n,f)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(f){Oe(t,o,f)}}var l=t.return;try{Zl(t)}catch(f){Oe(t,l,f)}break;case 5:var s=t.return;try{Zl(t)}catch(f){Oe(t,s,f)}}}catch(f){Oe(t,t.return,f)}if(t===e){H=null;break}var d=t.sibling;if(d!==null){d.return=t.return,H=d;break}H=t.return}}var Of=Math.ceil,po=ge.ReactCurrentDispatcher,es=ge.ReactCurrentOwner,jt=ge.ReactCurrentBatchConfig,ve=0,Ve=null,Fe=null,Qe=0,_t=0,vr=pn(0),Ue=0,ai=null,An=0,mo=0,ts=0,ui=null,dt=null,ns=0,yr=1/0,en=null,ho=!1,rs=null,_n=null,vo=!1,wn=null,yo=0,ci=0,is=null,go=-1,_o=0;function rt(){return(ve&6)!==0?Me():go!==-1?go:go=Me()}function xn(e){return(e.mode&1)===0?1:(ve&2)!==0&&Qe!==0?Qe&-Qe:vf.transition!==null?(_o===0&&(_o=Hs()),_o):(e=we,e!==0||(e=window.event,e=e===void 0?16:bs(e.type)),e)}function Ft(e,t,n,r){if(50<ci)throw ci=0,is=null,Error(u(185));Mr(e,n,r),((ve&2)===0||e!==Ve)&&(e===Ve&&((ve&2)===0&&(mo|=n),Ue===4&&Sn(e,Qe)),ft(e,r),n===1&&ve===0&&(t.mode&1)===0&&(yr=Me()+500,Qi&&hn()))}function ft(e,t){var n=e.callbackNode;hd(e,t);var r=Ni(e,e===Ve?Qe:0);if(r===0)n!==null&&Us(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Us(n),t===1)e.tag===0?hf(bu.bind(null,e)):Fa(bu.bind(null,e)),df(function(){(ve&6)===0&&hn()}),n=null;else{switch(qs(r)){case 1:n=Fo;break;case 4:n=Bs;break;case 16:n=ki;break;case 536870912:n=Vs;break;default:n=ki}n=lc(n,Zu.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Zu(e,t){if(go=-1,_o=0,(ve&6)!==0)throw Error(u(327));var n=e.callbackNode;if(gr()&&e.callbackNode!==n)return null;var r=Ni(e,e===Ve?Qe:0);if(r===0)return null;if((r&30)!==0||(r&e.expiredLanes)!==0||t)t=wo(e,r);else{t=r;var o=ve;ve|=2;var l=ec();(Ve!==e||Qe!==t)&&(en=null,yr=Me()+500,Un(e,t));do try{If();break}catch(d){Ju(e,d)}while(!0);Sl(),po.current=l,ve=o,Fe!==null?t=0:(Ve=null,Qe=0,t=Ue)}if(t!==0){if(t===2&&(o=Ao(e),o!==0&&(r=o,t=os(e,o))),t===1)throw n=ai,Un(e,0),Sn(e,r),ft(e,Me()),n;if(t===6)Sn(e,r);else{if(o=e.current.alternate,(r&30)===0&&!Mf(o)&&(t=wo(e,r),t===2&&(l=Ao(e),l!==0&&(r=l,t=os(e,l))),t===1))throw n=ai,Un(e,0),Sn(e,r),ft(e,Me()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(u(345));case 2:Bn(e,dt,en);break;case 3:if(Sn(e,r),(r&130023424)===r&&(t=ns+500-Me(),10<t)){if(Ni(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){rt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=dl(Bn.bind(null,e,dt,en),t);break}Bn(e,dt,en);break;case 4:if(Sn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-zt(r);l=1<<s,s=t[s],s>o&&(o=s),r&=~l}if(r=o,r=Me()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Of(r/1960))-r,10<r){e.timeoutHandle=dl(Bn.bind(null,e,dt,en),r);break}Bn(e,dt,en);break;case 5:Bn(e,dt,en);break;default:throw Error(u(329))}}}return ft(e,Me()),e.callbackNode===n?Zu.bind(null,e):null}function os(e,t){var n=ui;return e.current.memoizedState.isDehydrated&&(Un(e,t).flags|=256),e=wo(e,t),e!==2&&(t=dt,dt=n,t!==null&&ls(t)),e}function ls(e){dt===null?dt=e:dt.push.apply(dt,e)}function Mf(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],l=o.getSnapshot;o=o.value;try{if(!Lt(l(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Sn(e,t){for(t&=~ts,t&=~mo,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-zt(t),r=1<<n;e[n]=-1,t&=~r}}function bu(e){if((ve&6)!==0)throw Error(u(327));gr();var t=Ni(e,0);if((t&1)===0)return ft(e,Me()),null;var n=wo(e,t);if(e.tag!==0&&n===2){var r=Ao(e);r!==0&&(t=r,n=os(e,r))}if(n===1)throw n=ai,Un(e,0),Sn(e,t),ft(e,Me()),n;if(n===6)throw Error(u(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Bn(e,dt,en),ft(e,Me()),null}function ss(e,t){var n=ve;ve|=1;try{return e(t)}finally{ve=n,ve===0&&(yr=Me()+500,Qi&&hn())}}function $n(e){wn!==null&&wn.tag===0&&(ve&6)===0&&gr();var t=ve;ve|=1;var n=jt.transition,r=we;try{if(jt.transition=null,we=1,e)return e()}finally{we=r,jt.transition=n,ve=t,(ve&6)===0&&hn()}}function as(){_t=vr.current,Ne(vr)}function Un(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,cf(n)),Fe!==null)for(n=Fe.return;n!==null;){var r=n;switch(yl(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&qi();break;case 3:pr(),Ne(at),Ne(Ge),Pl();break;case 5:Rl(r);break;case 4:pr();break;case 13:Ne(ze);break;case 19:Ne(ze);break;case 10:kl(r.type._context);break;case 22:case 23:as()}n=n.return}if(Ve=e,Fe=e=kn(e.current,null),Qe=_t=t,Ue=0,ai=null,ts=mo=An=0,dt=ui=null,Dn!==null){for(t=0;t<Dn.length;t++)if(n=Dn[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,l=n.pending;if(l!==null){var s=l.next;l.next=o,r.next=s}n.pending=r}Dn=null}return e}function Ju(e,t){do{var n=Fe;try{if(Sl(),no.current=lo,ro){for(var r=Le.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}ro=!1}if(Fn=0,Be=$e=Le=null,ni=!1,ri=0,es.current=null,n===null||n.return===null){Ue=1,ai=t,Fe=null;break}e:{var l=e,s=n.return,d=n,f=t;if(t=Qe,d.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){var w=f,T=d,P=T.tag;if((T.mode&1)===0&&(P===0||P===11||P===15)){var R=T.alternate;R?(T.updateQueue=R.updateQueue,T.memoizedState=R.memoizedState,T.lanes=R.lanes):(T.updateQueue=null,T.memoizedState=null)}var B=Eu(s);if(B!==null){B.flags&=-257,Cu(B,s,d,l,t),B.mode&1&&ku(l,w,t),t=B,f=w;var q=t.updateQueue;if(q===null){var Q=new Set;Q.add(f),t.updateQueue=Q}else q.add(f);break e}else{if((t&1)===0){ku(l,w,t),us();break e}f=Error(u(426))}}else if(Pe&&d.mode&1){var De=Eu(s);if(De!==null){(De.flags&65536)===0&&(De.flags|=256),Cu(De,s,d,l,t),wl(mr(f,d));break e}}l=f=mr(f,d),Ue!==4&&(Ue=2),ui===null?ui=[l]:ui.push(l),l=s;do{switch(l.tag){case 3:l.flags|=65536,t&=-t,l.lanes|=t;var v=xu(l,f,t);Ka(l,v);break e;case 1:d=f;var p=l.type,_=l.stateNode;if((l.flags&128)===0&&(typeof p.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(_n===null||!_n.has(_)))){l.flags|=65536,t&=-t,l.lanes|=t;var M=Su(l,d,t);Ka(l,M);break e}}l=l.return}while(l!==null)}nc(n)}catch(K){t=K,Fe===n&&n!==null&&(Fe=n=n.return);continue}break}while(!0)}function ec(){var e=po.current;return po.current=lo,e===null?lo:e}function us(){(Ue===0||Ue===3||Ue===2)&&(Ue=4),Ve===null||(An&268435455)===0&&(mo&268435455)===0||Sn(Ve,Qe)}function wo(e,t){var n=ve;ve|=2;var r=ec();(Ve!==e||Qe!==t)&&(en=null,Un(e,t));do try{Df();break}catch(o){Ju(e,o)}while(!0);if(Sl(),ve=n,po.current=r,Fe!==null)throw Error(u(261));return Ve=null,Qe=0,Ue}function Df(){for(;Fe!==null;)tc(Fe)}function If(){for(;Fe!==null&&!ld();)tc(Fe)}function tc(e){var t=oc(e.alternate,e,_t);e.memoizedProps=e.pendingProps,t===null?nc(e):Fe=t,es.current=null}function nc(e){var t=e;do{var n=t.alternate;if(e=t.return,(t.flags&32768)===0){if(n=Rf(n,t,_t),n!==null){Fe=n;return}}else{if(n=Tf(n,t),n!==null){n.flags&=32767,Fe=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ue=6,Fe=null;return}}if(t=t.sibling,t!==null){Fe=t;return}Fe=t=e}while(t!==null);Ue===0&&(Ue=5)}function Bn(e,t,n){var r=we,o=jt.transition;try{jt.transition=null,we=1,Ff(e,t,n,r)}finally{jt.transition=o,we=r}return null}function Ff(e,t,n,r){do gr();while(wn!==null);if((ve&6)!==0)throw Error(u(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(u(177));e.callbackNode=null,e.callbackPriority=0;var l=n.lanes|n.childLanes;if(vd(e,l),e===Ve&&(Fe=Ve=null,Qe=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||vo||(vo=!0,lc(ki,function(){return gr(),null})),l=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||l){l=jt.transition,jt.transition=null;var s=we;we=1;var d=ve;ve|=4,es.current=null,zf(e,n),Qu(n,e),nf(ul),Pi=!!al,ul=al=null,e.current=n,Lf(n),sd(),ve=d,we=s,jt.transition=l}else e.current=n;if(vo&&(vo=!1,wn=e,yo=o),l=e.pendingLanes,l===0&&(_n=null),cd(n.stateNode),ft(e,Me()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(ho)throw ho=!1,e=rs,rs=null,e;return(yo&1)!==0&&e.tag!==0&&gr(),l=e.pendingLanes,(l&1)!==0?e===is?ci++:(ci=0,is=e):ci=0,hn(),null}function gr(){if(wn!==null){var e=qs(yo),t=jt.transition,n=we;try{if(jt.transition=null,we=16>e?16:e,wn===null)var r=!1;else{if(e=wn,wn=null,yo=0,(ve&6)!==0)throw Error(u(331));var o=ve;for(ve|=4,H=e.current;H!==null;){var l=H,s=l.child;if((H.flags&16)!==0){var d=l.deletions;if(d!==null){for(var f=0;f<d.length;f++){var w=d[f];for(H=w;H!==null;){var T=H;switch(T.tag){case 0:case 11:case 15:si(8,T,l)}var P=T.child;if(P!==null)P.return=T,H=P;else for(;H!==null;){T=H;var R=T.sibling,B=T.return;if(Bu(T),T===w){H=null;break}if(R!==null){R.return=B,H=R;break}H=B}}}var q=l.alternate;if(q!==null){var Q=q.child;if(Q!==null){q.child=null;do{var De=Q.sibling;Q.sibling=null,Q=De}while(Q!==null)}}H=l}}if((l.subtreeFlags&2064)!==0&&s!==null)s.return=l,H=s;else e:for(;H!==null;){if(l=H,(l.flags&2048)!==0)switch(l.tag){case 0:case 11:case 15:si(9,l,l.return)}var v=l.sibling;if(v!==null){v.return=l.return,H=v;break e}H=l.return}}var p=e.current;for(H=p;H!==null;){s=H;var _=s.child;if((s.subtreeFlags&2064)!==0&&_!==null)_.return=s,H=_;else e:for(s=p;H!==null;){if(d=H,(d.flags&2048)!==0)try{switch(d.tag){case 0:case 11:case 15:fo(9,d)}}catch(K){Oe(d,d.return,K)}if(d===s){H=null;break e}var M=d.sibling;if(M!==null){M.return=d.return,H=M;break e}H=d.return}}if(ve=o,hn(),$t&&typeof $t.onPostCommitFiberRoot=="function")try{$t.onPostCommitFiberRoot(Ei,e)}catch{}r=!0}return r}finally{we=n,jt.transition=t}}return!1}function rc(e,t,n){t=mr(n,t),t=xu(e,t,1),e=yn(e,t,1),t=rt(),e!==null&&(Mr(e,1,t),ft(e,t))}function Oe(e,t,n){if(e.tag===3)rc(e,e,n);else for(;t!==null;){if(t.tag===3){rc(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(_n===null||!_n.has(r))){e=mr(n,e),e=Su(t,e,1),t=yn(t,e,1),e=rt(),t!==null&&(Mr(t,1,e),ft(t,e));break}}t=t.return}}function Af(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=rt(),e.pingedLanes|=e.suspendedLanes&n,Ve===e&&(Qe&n)===n&&(Ue===4||Ue===3&&(Qe&130023424)===Qe&&500>Me()-ns?Un(e,0):ts|=n),ft(e,t)}function ic(e,t){t===0&&((e.mode&1)===0?t=1:(t=ji,ji<<=1,(ji&130023424)===0&&(ji=4194304)));var n=rt();e=Zt(e,t),e!==null&&(Mr(e,t,n),ft(e,n))}function $f(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ic(e,n)}function Uf(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(u(314))}r!==null&&r.delete(t),ic(e,n)}var oc;oc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||at.current)ct=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return ct=!1,Nf(e,t,n);ct=(e.flags&131072)!==0}else ct=!1,Pe&&(t.flags&1048576)!==0&&Aa(t,Ki,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;uo(e,t),e=t.pendingProps;var o=lr(t,Ge.current);fr(t,n),o=Ol(null,t,r,e,o,n);var l=Ml();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ut(r)?(l=!0,Wi(t)):l=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,jl(t),o.updater=so,t.stateNode=o,o._reactInternals=t,Ul(t,r,e,n),t=ql(null,t,r,!0,l,n)):(t.tag=0,Pe&&l&&vl(t),nt(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(uo(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Vf(r),e=Mt(r,e),o){case 0:t=Hl(null,t,r,e,n);break e;case 1:t=zu(null,t,r,e,n);break e;case 11:t=ju(null,t,r,e,n);break e;case 14:t=Nu(null,t,r,Mt(r.type,e),n);break e}throw Error(u(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Mt(r,o),Hl(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Mt(r,o),zu(e,t,r,o,n);case 3:e:{if(Lu(t),e===null)throw Error(u(387));r=t.pendingProps,l=t.memoizedState,o=l.element,Ya(e,t),eo(t,r,null,n);var s=t.memoizedState;if(r=s.element,l.isDehydrated)if(l={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=l,t.memoizedState=l,t.flags&256){o=mr(Error(u(423)),t),t=Ou(e,t,r,n,o);break e}else if(r!==o){o=mr(Error(u(424)),t),t=Ou(e,t,r,n,o);break e}else for(gt=fn(t.stateNode.containerInfo.firstChild),yt=t,Pe=!0,Ot=null,n=Wa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ur(),r===o){t=Jt(e,t,n);break e}nt(e,t,r,n)}t=t.child}return t;case 5:return Ga(t),e===null&&_l(t),r=t.type,o=t.pendingProps,l=e!==null?e.memoizedProps:null,s=o.children,cl(r,o)?s=null:l!==null&&cl(r,l)&&(t.flags|=32),Pu(e,t),nt(e,t,s,n),t.child;case 6:return e===null&&_l(t),null;case 13:return Mu(e,t,n);case 4:return Nl(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=cr(t,null,r,n):nt(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Mt(r,o),ju(e,t,r,o,n);case 7:return nt(e,t,t.pendingProps,n),t.child;case 8:return nt(e,t,t.pendingProps.children,n),t.child;case 12:return nt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,l=t.memoizedProps,s=o.value,ke(Zi,r._currentValue),r._currentValue=s,l!==null)if(Lt(l.value,s)){if(l.children===o.children&&!at.current){t=Jt(e,t,n);break e}}else for(l=t.child,l!==null&&(l.return=t);l!==null;){var d=l.dependencies;if(d!==null){s=l.child;for(var f=d.firstContext;f!==null;){if(f.context===r){if(l.tag===1){f=bt(-1,n&-n),f.tag=2;var w=l.updateQueue;if(w!==null){w=w.shared;var T=w.pending;T===null?f.next=f:(f.next=T.next,T.next=f),w.pending=f}}l.lanes|=n,f=l.alternate,f!==null&&(f.lanes|=n),El(l.return,n,t),d.lanes|=n;break}f=f.next}}else if(l.tag===10)s=l.type===t.type?null:l.child;else if(l.tag===18){if(s=l.return,s===null)throw Error(u(341));s.lanes|=n,d=s.alternate,d!==null&&(d.lanes|=n),El(s,n,t),s=l.sibling}else s=l.child;if(s!==null)s.return=l;else for(s=l;s!==null;){if(s===t){s=null;break}if(l=s.sibling,l!==null){l.return=s.return,s=l;break}s=s.return}l=s}nt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,fr(t,n),o=Et(o),r=r(o),t.flags|=1,nt(e,t,r,n),t.child;case 14:return r=t.type,o=Mt(r,t.pendingProps),o=Mt(r.type,o),Nu(e,t,r,o,n);case 15:return Ru(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Mt(r,o),uo(e,t),t.tag=1,ut(r)?(e=!0,Wi(t)):e=!1,fr(t,n),_u(t,r,o),Ul(t,r,o,n),ql(null,t,r,!0,e,n);case 19:return Iu(e,t,n);case 22:return Tu(e,t,n)}throw Error(u(156,t.tag))};function lc(e,t){return $s(e,t)}function Bf(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Nt(e,t,n,r){return new Bf(e,t,n,r)}function cs(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Vf(e){if(typeof e=="function")return cs(e)?1:0;if(e!=null){if(e=e.$$typeof,e===it)return 11;if(e===lt)return 14}return 2}function kn(e,t){var n=e.alternate;return n===null?(n=Nt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function xo(e,t,n,r,o,l){var s=2;if(r=e,typeof e=="function")cs(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Re:return Vn(n.children,o,l,t);case Ee:s=8,o|=8;break;case te:return e=Nt(12,n,t,o|2),e.elementType=te,e.lanes=l,e;case Te:return e=Nt(13,n,t,o),e.elementType=Te,e.lanes=l,e;case ot:return e=Nt(19,n,t,o),e.elementType=ot,e.lanes=l,e;case Ce:return So(n,o,l,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ye:s=10;break e;case Ke:s=9;break e;case it:s=11;break e;case lt:s=14;break e;case Xe:s=16,r=null;break e}throw Error(u(130,e==null?e:typeof e,""))}return t=Nt(s,n,t,o),t.elementType=e,t.type=r,t.lanes=l,t}function Vn(e,t,n,r){return e=Nt(7,e,r,t),e.lanes=n,e}function So(e,t,n,r){return e=Nt(22,e,r,t),e.elementType=Ce,e.lanes=n,e.stateNode={isHidden:!1},e}function ds(e,t,n){return e=Nt(6,e,null,t),e.lanes=n,e}function fs(e,t,n){return t=Nt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Hf(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=$o(0),this.expirationTimes=$o(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$o(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function ps(e,t,n,r,o,l,s,d,f){return e=new Hf(e,t,n,d,f),t===1?(t=1,l===!0&&(t|=8)):t=0,l=Nt(3,null,null,t),e.current=l,l.stateNode=e,l.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},jl(l),e}function qf(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:pe,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function sc(e){if(!e)return mn;e=e._reactInternals;e:{if(Pn(e)!==e||e.tag!==1)throw Error(u(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(ut(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(u(171))}if(e.tag===1){var n=e.type;if(ut(n))return Da(e,n,t)}return t}function ac(e,t,n,r,o,l,s,d,f){return e=ps(n,r,!0,e,o,l,s,d,f),e.context=sc(null),n=e.current,r=rt(),o=xn(n),l=bt(r,o),l.callback=t??null,yn(n,l,o),e.current.lanes=o,Mr(e,o,r),ft(e,r),e}function ko(e,t,n,r){var o=t.current,l=rt(),s=xn(o);return n=sc(n),t.context===null?t.context=n:t.pendingContext=n,t=bt(l,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=yn(o,t,s),e!==null&&(Ft(e,o,s,l),Ji(e,o,s)),s}function Eo(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function uc(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ms(e,t){uc(e,t),(e=e.alternate)&&uc(e,t)}function Wf(){return null}var cc=typeof reportError=="function"?reportError:function(e){console.error(e)};function hs(e){this._internalRoot=e}Co.prototype.render=hs.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));ko(e,t,null,null)},Co.prototype.unmount=hs.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;$n(function(){ko(null,e,null,null)}),t[Yt]=null}};function Co(e){this._internalRoot=e}Co.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ys();e={blockedOn:null,target:e,priority:t};for(var n=0;n<un.length&&t!==0&&t<un[n].priority;n++);un.splice(n,0,e),n===0&&Gs(e)}};function vs(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function jo(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function dc(){}function Qf(e,t,n,r,o){if(o){if(typeof r=="function"){var l=r;r=function(){var w=Eo(s);l.call(w)}}var s=ac(t,r,e,0,null,!1,!1,"",dc);return e._reactRootContainer=s,e[Yt]=s.current,Kr(e.nodeType===8?e.parentNode:e),$n(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var d=r;r=function(){var w=Eo(f);d.call(w)}}var f=ps(e,0,!1,null,null,!1,!1,"",dc);return e._reactRootContainer=f,e[Yt]=f.current,Kr(e.nodeType===8?e.parentNode:e),$n(function(){ko(t,f,n,r)}),f}function No(e,t,n,r,o){var l=n._reactRootContainer;if(l){var s=l;if(typeof o=="function"){var d=o;o=function(){var f=Eo(s);d.call(f)}}ko(t,s,e,o)}else s=Qf(n,t,e,o,r);return Eo(s)}Ws=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Or(t.pendingLanes);n!==0&&(Uo(t,n|1),ft(t,Me()),(ve&6)===0&&(yr=Me()+500,hn()))}break;case 13:$n(function(){var r=Zt(e,1);if(r!==null){var o=rt();Ft(r,e,1,o)}}),ms(e,1)}},Bo=function(e){if(e.tag===13){var t=Zt(e,134217728);if(t!==null){var n=rt();Ft(t,e,134217728,n)}ms(e,134217728)}},Qs=function(e){if(e.tag===13){var t=xn(e),n=Zt(e,t);if(n!==null){var r=rt();Ft(n,e,t,r)}ms(e,t)}},Ys=function(){return we},Ks=function(e,t){var n=we;try{return we=e,t()}finally{we=n}},Xn=function(e,t,n){switch(t){case"input":if(Kn(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=Hi(r);if(!o)throw Error(u(90));yi(r),Kn(r,o)}}}break;case"textarea":Nn(e,n);break;case"select":t=n.value,t!=null&&Pt(e,!!n.multiple,t,!1)}},me=ss,he=$n;var Yf={usingClientEntryPoint:!1,Events:[Zr,ir,Hi,b,Y,ss]},di={findFiberByHostInstance:zn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Kf={bundleType:di.bundleType,version:di.version,rendererPackageName:di.rendererPackageName,rendererConfig:di.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ge.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Fs(e),e===null?null:e.stateNode},findFiberByHostInstance:di.findFiberByHostInstance||Wf,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ro=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ro.isDisabled&&Ro.supportsFiber)try{Ei=Ro.inject(Kf),$t=Ro}catch{}}return pt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Yf,pt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!vs(t))throw Error(u(200));return qf(e,t,null,n)},pt.createRoot=function(e,t){if(!vs(e))throw Error(u(299));var n=!1,r="",o=cc;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=ps(e,1,!1,null,null,n,!1,r,o),e[Yt]=t.current,Kr(e.nodeType===8?e.parentNode:e),new hs(t)},pt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=Fs(t),e=e===null?null:e.stateNode,e},pt.flushSync=function(e){return $n(e)},pt.hydrate=function(e,t,n){if(!jo(t))throw Error(u(200));return No(null,e,t,!0,n)},pt.hydrateRoot=function(e,t,n){if(!vs(e))throw Error(u(405));var r=n!=null&&n.hydratedSources||null,o=!1,l="",s=cc;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=ac(t,null,e,1,n??null,o,!1,l,s),e[Yt]=t.current,Kr(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new Co(t)},pt.render=function(e,t,n){if(!jo(t))throw Error(u(200));return No(null,e,t,!1,n)},pt.unmountComponentAtNode=function(e){if(!jo(e))throw Error(u(40));return e._reactRootContainer?($n(function(){No(null,null,e,!1,function(){e._reactRootContainer=null,e[Yt]=null})}),!0):!1},pt.unstable_batchedUpdates=ss,pt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!jo(n))throw Error(u(200));if(e==null||e._reactInternals===void 0)throw Error(u(38));return No(e,t,n,!1,r)},pt.version="18.3.1-next-f1338f8080-20240426",pt}var _c;function Vc(){if(_c)return ws.exports;_c=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(c){console.error(c)}}return i(),ws.exports=rp(),ws.exports}var wc;function ip(){if(wc)return To;wc=1;var i=Vc();return To.createRoot=i.createRoot,To.hydrateRoot=i.hydrateRoot,To}var op=ip();const lp=1e4,sp=12e4,ap=new Set(["room.create","room.invite","room.revoke","room.message","room.close","room.recover","room.recover.confirm"]),up=new Set(["room.list","room.show","room.participants","room.history"]);let cp=0;class wt extends Error{constructor(u,g,m,y){super(g,y);ys(this,"code");ys(this,"outcomeUnknown");this.name="RpcError",this.code=u,this.outcomeUnknown=m}}function dp(i){return ap.has(i)?sp:lp}async function fp(i,c,u={}){var D,C,U;const g=u.fetch??globalThis.fetch,m=`web-${Date.now().toString(36)}-${(++cp).toString(36)}`,y=!up.has(i),S=new AbortController;let z=!1;const j=()=>{var L;return S.abort((L=u.signal)==null?void 0:L.reason)};(D=u.signal)==null||D.addEventListener("abort",j,{once:!0}),(C=u.signal)!=null&&C.aborted&&j();const E=setTimeout(()=>{z=!0,S.abort()},u.timeoutMs??dp(i));try{const L=await g("/rpc",{method:"POST",headers:{"content-type":"application/json"},credentials:"same-origin",body:JSON.stringify({version:1,id:m,method:i,params:c}),signal:S.signal});let W;try{W=await L.json()}catch(I){throw new wt("invalid_response","daemon returned invalid JSON",y,{cause:I})}if(!pp(W,m))throw new wt("invalid_response","daemon returned an invalid or uncorrelated RPC response",y);if("error"in W)throw new wt(W.error.code,W.error.message,!1);if(!L.ok)throw new wt("invalid_response",`daemon returned a result envelope with HTTP ${L.status}`,y);return W.result}catch(L){throw L instanceof wt?L:z?new wt("timeout","daemon did not answer before the RPC deadline",y,{cause:L}):S.signal.aborted?new wt("aborted","RPC request was aborted",y,{cause:L}):new wt("daemon_unavailable","cowork daemon is unavailable",y,{cause:L})}finally{clearTimeout(E),(U=u.signal)==null||U.removeEventListener("abort",j)}}function pp(i,c){if(!xc(i)||i.version!==1||i.id!==c)return!1;const u=Object.keys(i);return"result"in i?!("error"in i)&&u.length===3&&u.every(g=>g==="version"||g==="id"||g==="result"):u.length===3&&u.every(g=>g==="version"||g==="id"||g==="error")&&xc(i.error)&&Object.keys(i.error).length===2&&typeof i.error.code=="string"&&typeof i.error.message=="string"}function xc(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}const Sc=64;function Mo(i){return i.trim().normalize("NFC")}function zs(i){if(/[\p{Cc}\p{Cf}]/u.test(i))return"Name cannot contain control or format characters.";const c=Mo(i),u=Array.from(c).length;if(u<1)return"Name is required.";if(u>Sc)return`Name must be at most ${Sc} characters.`}function mp(i){return typeof i=="string"&&i===Mo(i)&&zs(i)===void 0}const hp=new Set(["provisioning","active","closing","closed"]),vp=new Set(["one_time","public"]),yp=new Set(["live","consumed","revoked","replacement_required","receipt_pending"]),gp=new Set(["queued","send_failed","skipped_removed"]),kc=new Set(["queued","send_failed"]),_p=/^[0-7][0-9a-hjkmnp-tv-z]{25}$/,zo=262144,wp=2*1024*1024,xp=255,Sp=255,jn=256,Cn=["version","room_id","seq","record_id","at","kind"],Hc=["version","room_id","room_name","identity_name","identity_cid","mission","state","invites","seats","created_at"],kp=[...Hc,"role_briefings","rest_roles","anonymous","quiet_membership","membership_epoch"];function pi(i){if(!Tt(i)||i.version!==1&&i.version!==2)return!1;const c=i.version===2;if(!et(i,c?kp:Hc,["status","activated_at","closed_at"])||!Rt(i.room_id)||!mp(i.room_name)||!Ie(i.identity_name)||typeof i.identity_cid!="string"||!zp(i.mission,c)||!hp.has(i.state)||!qt(i.status)||!Array.isArray(i.invites)||!i.invites.every(Ls)||!Array.isArray(i.seats)||!i.seats.every(y=>Qc(y,c))||!Sr(i.created_at)||!wr(i.activated_at)||!wr(i.closed_at)||c&&(!Lp(i.role_briefings)||!Op(i.rest_roles)||typeof i.anonymous!="boolean"||typeof i.quiet_membership!="boolean"||!xr(i.membership_epoch))||new Set(i.invites.map(y=>y.invite_id)).size!==i.invites.length||!c&&new Set(i.seats.map(y=>y.identity)).size!==i.seats.length)return!1;if(c){const y=i.seats;if(new Set(y.map(E=>E.participant_id)).size!==y.length)return!1;const S=new Set,z=new Set;for(const E of y){if(E.state==="pending"||E.state==="active"){if(S.has(E.identity))return!1;S.add(E.identity)}if(i.anonymous?E.alias===void 0:E.alias!==void 0)return!1;if(E.state==="removed"){if(E.removed_at===void 0||E.removed_epoch===void 0||E.removed_epoch>Number(i.membership_epoch))return!1}else if(E.removed_at!==void 0||E.removed_epoch!==void 0||E.bounced_at!==void 0)return!1;if(E.state==="active"&&E.alias!==void 0){if(z.has(E.alias))return!1;z.add(E.alias)}}const j=new Map(y.map(E=>[E.participant_id,E]));for(const E of y){if(E.replaces_seat===void 0)continue;const D=j.get(E.replaces_seat);if(!D||D===E||D.state!=="removed"||D.role!==E.role||i.anonymous&&D.alias!==E.alias)return!1}}const g=i.state==="provisioning"&&i.status==="packet_pending"&&(i.identity_name===`cowork-room-${i.room_id}`||i.identity_name===`ours-cowork-room:${i.room_name}`)&&i.invites.length===0&&i.seats.length===0&&i.activated_at===void 0&&i.closed_at===void 0;if(i.identity_cid===""&&!g||i.identity_cid!==""&&i.status==="packet_pending")return!1;const m=new Set;for(const y of i.invites){if(y.recovery_of===void 0)continue;const S=i.invites.find(j=>j.invite_id===y.recovery_of),z=y.state==="receipt_pending"?(S==null?void 0:S.state)==="replacement_required":y.state==="live"||y.state==="consumed"||y.state==="replacement_required"?(S==null?void 0:S.state)==="revoked":y.state==="revoked"?y.recovery_confirmed===!0?(S==null?void 0:S.state)==="revoked":(S==null?void 0:S.state)==="replacement_required"||(S==null?void 0:S.state)==="revoked":!1;if(!S||S.invite_id===y.invite_id||!z||S.mode!==y.mode||S.role!==y.role||S.min_accepts!==y.min_accepts)return!1;if(y.state==="receipt_pending"){if(m.has(y.recovery_of))return!1;m.add(y.recovery_of)}}for(const y of i.invites){const S=new Set([y.invite_id]);let z=y;for(;z.recovery_of!==void 0;){if(S.has(z.recovery_of))return!1;S.add(z.recovery_of);const j=i.invites.find(E=>E.invite_id===z.recovery_of);if(!j)return!1;z=j}}return!0}function Ep(i){return Array.isArray(i)&&i.every(pi)}function Ec(i){if(!Array.isArray(i)||!i.every(m=>Qc(m)))return!1;const c=i.filter(m=>m.participant_id!==void 0).length;if(c!==0&&c!==i.length)return!1;if(!(c===i.length))return new Set(i.map(m=>m.identity)).size===i.length;if(new Set(i.map(m=>m.participant_id)).size!==i.length)return!1;const g=i.filter(m=>m.state==="pending"||m.state==="active");return new Set(g.map(m=>m.identity)).size===g.length}function qc(i){return Tt(i)&&Ie(i.room_id)&&Ls(i.invite)&&Ie(i.blob)&&typeof i.reusable=="boolean"&&qt(i.recovery_of)}function Cp(i){return Array.isArray(i)&&i.every(qc)}function jp(i,c){if(!qc(i)||i.room_id!==c.room_id||i.invite.mode!==c.mode||i.invite.role!==c.role||i.invite.min_accepts!==c.min_accepts||i.invite.accepted_cids.length!==0||i.invite.state!=="live"||i.invite.recovery_of!==void 0||i.invite.recovery_confirmed!==void 0||i.recovery_of!==void 0||i.reusable!==(c.mode==="public"))throw new Error("daemon returned an invalid invite receipt for this create request");return i}function Np(i,c){Cp(i)||Cc();const u=new Set,g=new Set;for(const m of i){const y=c.invites.find(S=>S.invite_id===m.recovery_of);(m.room_id!==c.room_id||m.recovery_of===void 0||m.invite.recovery_of!==m.recovery_of||m.invite.state!=="receipt_pending"||m.invite.recovery_confirmed!==!1||m.invite.accepted_cids.length!==0||m.reusable!==(m.invite.mode==="public")||!y||y.state!=="replacement_required"||y.mode!==m.invite.mode||y.role!==m.invite.role||y.min_accepts!==m.invite.min_accepts||y.invite_id===m.invite.invite_id||c.invites.some(S=>S.invite_id===m.invite.invite_id)||u.has(m.invite.invite_id)||g.has(m.recovery_of))&&Cc(),u.add(m.invite.invite_id),g.add(m.recovery_of)}return i}function Rp(i,c){const u=new Set(["live","consumed","replacement_required","revoked"]);if(!Ls(i)||c.recovery_of===void 0||i.invite_id!==c.invite.invite_id||i.recovery_of!==c.recovery_of||i.recovery_confirmed!==!0||!u.has(i.state)||i.mode!==c.invite.mode||i.role!==c.invite.role||i.min_accepts!==c.invite.min_accepts)throw new Error("daemon returned an invalid recovery confirmation for the displayed old/new pointer");return i}function Cc(){throw new Error("daemon returned an invalid recovery receipt for this room state")}function Wc(i){if(!$p(i))return!1;switch(i.kind){case"message":return et(i,[...Cn,"message_id","author","category","text","recipient_identities"],["author_alias","briefing_role","briefing_version","membership","source_msg_id","source_wire_id"])&&Rt(i.message_id)&&jc(i.author)&&(i.author_alias===void 0||Nc(i.author_alias))&&Dp(i)&&xt(i.text,zo)&&js(i.recipient_identities)&&(i.source_msg_id===void 0||xr(i.source_msg_id))&&qt(i.source_wire_id);case"relay_intent":return et(i,[...Cn,"recipient_identity"],["message_id","file_id"])&&Rc(i)&&Ie(i.recipient_identity);case"relay_result":return et(i,[...Cn,"intent_record_id","recipient_identity","status"],["message_id","file_id","wire_id","metadata_wire_id"])&&Ie(i.intent_record_id)&&Rc(i)&&Ie(i.recipient_identity)&&gp.has(i.status)&&qt(i.wire_id)&&qt(i.metadata_wire_id);case"file":{const c=Ap(i.data_base64);return et(i,[...Cn,"file_id","author","filename","mime","size","sha256","data_base64","recipient_identities","source_file_id"],["author_alias","source_wire_id"])&&Rt(i.file_id)&&jc(i.author)&&(i.author_alias===void 0||Nc(i.author_alias))&&Ip(i.filename)&&Fp(i.mime,Sp)&&xr(i.size)&&i.size<=wp&&typeof i.sha256=="string"&&/^[0-9a-f]{64}$/.test(i.sha256)&&c===i.size&&js(i.recipient_identities)&&xr(i.source_file_id)&&qt(i.source_wire_id)}case"membership_intent":return et(i,[...Cn,"action","participant_id","recipient_identity","role","epoch","notify"],["alias"])&&i.action==="remove"&&Rt(i.participant_id)&&Ie(i.recipient_identity)&&xt(i.role,jn)&&qt(i.alias)&&Qn(i.epoch)&&typeof i.notify=="boolean";case"membership_result":return et(i,[...Cn,"intent_record_id","participant_id","status","notified","key_material_retained"],["uncertain_after_restart"])&&Ie(i.intent_record_id)&&Rt(i.participant_id)&&kc.has(i.status)&&typeof i.notified=="boolean"&&i.key_material_retained===!0&&(i.uncertain_after_restart===void 0||i.uncertain_after_restart===!0);case"close_notice_intent":return et(i,[...Cn,"recipient_identity"])&&Ie(i.recipient_identity);case"close_notice_result":return et(i,[...Cn,"intent_record_id","recipient_identity","status","notified","key_material_retained"],["uncertain_after_restart"])&&Ie(i.intent_record_id)&&Ie(i.recipient_identity)&&kc.has(i.status)&&typeof i.notified=="boolean"&&i.key_material_retained===!0&&(i.uncertain_after_restart===void 0||i.uncertain_after_restart===!0);default:return!1}}function Tp(i){return Array.isArray(i)&&i.every(Wc)}function Pp(i){return Tt(i)&&Object.keys(i).length===4&&i.version===1&&Ie(i.room_id)&&i.deleted===!0&&i.scope==="this_host"}function zp(i,c=!1){return Tt(i)&&et(i,c?["goal","briefing","briefing_version"]:["goal","briefing"])&&xt(i.goal,zo)&&xt(i.briefing,zo)&&(!c||Qn(i.briefing_version))}function Qc(i,c){if(!Tt(i))return!1;const u=c??Object.hasOwn(i,"participant_id");return!et(i,u?["identity","display_name","role","invite_id","participant_id","state"]:["identity","display_name","role","invite_id","accepted_at"],u?["accepted_at","requested_at","invite_sha256","alias","removed_at","removed_epoch","replaces_seat","bounced_at"]:[])||!Ie(i.identity)||!Ie(i.display_name)||!xt(i.role,jn)||!Ie(i.invite_id)?!1:u?!(Rt(i.participant_id)&&(i.state==="pending"||i.state==="active"||i.state==="removed")&&wr(i.accepted_at)&&wr(i.requested_at)&&(i.invite_sha256===void 0||typeof i.invite_sha256=="string"&&/^[0-9a-f]{64}$/.test(i.invite_sha256))&&qt(i.alias)&&wr(i.removed_at)&&(i.removed_epoch===void 0||xr(i.removed_epoch))&&(i.replaces_seat===void 0||Rt(i.replaces_seat))&&wr(i.bounced_at))||i.requested_at===void 0!=(i.invite_sha256===void 0)?!1:i.state==="pending"?i.requested_at!==void 0&&i.accepted_at===void 0&&i.removed_at===void 0&&i.removed_epoch===void 0&&i.bounced_at===void 0:i.state==="active"?i.accepted_at!==void 0&&i.removed_at===void 0&&i.removed_epoch===void 0&&i.bounced_at===void 0:i.removed_at!==void 0&&i.removed_epoch!==void 0&&(i.accepted_at!==void 0||i.requested_at!==void 0):Sr(i.accepted_at)}function Lp(i){return Tt(i)&&Object.entries(i).every(([c,u])=>xt(c,jn)&&Tt(u)&&et(u,["text","version","updated_at"])&&xt(u.text,zo)&&Qn(u.version)&&Sr(u.updated_at))}function Op(i){return Array.isArray(i)&&i.every(c=>xt(c,jn)&&c.length>0&&c!=="room")&&new Set(i).size===i.length}function Ls(i){if(!Tt(i)||!et(i,["invite_id","mode","role","min_accepts","accepted_cids","state","created_at"],["recovery_of","recovery_confirmed","replaces_seat"])||!Ie(i.invite_id)||!vp.has(i.mode)||!xt(i.role,jn)||!Qn(i.min_accepts)||!js(i.accepted_cids)||!yp.has(i.state)||!qt(i.recovery_of)||i.recovery_confirmed!==void 0&&typeof i.recovery_confirmed!="boolean"||i.replaces_seat!==void 0&&!Rt(i.replaces_seat)||!Sr(i.created_at))return!1;const c=i;return!(c.mode==="one_time"&&c.min_accepts!==1||c.recovery_of===void 0&&c.recovery_confirmed!==void 0||c.recovery_of!==void 0&&c.recovery_confirmed===void 0||c.state==="receipt_pending"&&(c.recovery_of===void 0||c.recovery_confirmed!==!1||c.accepted_cids.length>0)||c.recovery_of!==void 0&&(c.state==="live"||c.state==="consumed"||c.state==="replacement_required")&&c.recovery_confirmed!==!0)}function jc(i){return Tt(i)&&et(i,["identity","display_name","role"])&&Ie(i.identity)&&Ie(i.display_name)&&xt(i.role,jn)}function Nc(i){return Tt(i)&&et(i,["participant_id","alias"])&&Rt(i.participant_id)&&Ie(i.alias)}function Mp(i){return Tt(i)&&et(i,["action","epoch"],["alias","role"])&&i.action==="remove"&&qt(i.alias)&&(i.role===void 0||xt(i.role,jn))&&xr(i.epoch)}function Dp(i){switch(i.category){case"briefing":return i.briefing_role===void 0&&(i.briefing_version===void 0||Qn(i.briefing_version))&&i.membership===void 0;case"role_briefing":return xt(i.briefing_role,jn)&&Qn(i.briefing_version)&&i.membership===void 0;case"chat":return i.briefing_role===void 0&&i.briefing_version===void 0&&i.membership===void 0;case"membership":return i.briefing_role===void 0&&i.briefing_version===void 0&&Mp(i.membership);default:return!1}}function Rc(i){const c=i.message_id===void 0?!1:Rt(i.message_id),u=i.file_id===void 0?!1:Rt(i.file_id);return c!==u}function Ip(i){return xt(i,xp)&&i!=="."&&i!==".."&&!/[\x00/\\]/.test(i)}function Fp(i,c){return typeof i=="string"&&new TextEncoder().encode(i).byteLength<=c}function Ap(i){if(typeof i!="string"||!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(i))return;if(i.length===0)return 0;const c=i.endsWith("==")?2:i.endsWith("=")?1:0;return i.length/4*3-c}function $p(i){return Tt(i)&&i.version===1&&Rt(i.room_id)&&Qn(i.seq)&&i.record_id===`${i.room_id}:${i.seq}`&&Sr(i.at)&&typeof i.kind=="string"}function et(i,c,u=[]){const g=new Set([...c,...u]),m=Object.keys(i);return c.every(y=>Object.hasOwn(i,y))&&m.every(y=>g.has(y))}function Rt(i){return typeof i=="string"&&_p.test(i)}function xt(i,c){return typeof i=="string"&&new TextEncoder().encode(i).byteLength>=1&&new TextEncoder().encode(i).byteLength<=c}function js(i){return Up(i)&&new Set(i).size===i.length}function Sr(i){if(typeof i!="string")return!1;const c=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.\d+)?(?:Z|[+-](\d{2}):(\d{2}))$/.exec(i);if(!c)return!1;const[,u,g,m,y,S,z,j,E]=c,D=Number(u),C=Number(g),U=Number(m),L=Number(y),W=Number(S),I=Number(z),O=j===void 0?0:Number(j),oe=E===void 0?0:Number(E);if(C<1||C>12||L>23||W>59||I>59||O>23||oe>59)return!1;const le=[31,D%4===0&&(D%100!==0||D%400===0)?29:28,31,30,31,30,31,31,30,31,30,31];return U>=1&&U<=le[C-1]}function wr(i){return i===void 0||Sr(i)}function Tt(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function Ie(i){return typeof i=="string"&&i.length>0}function qt(i){return i===void 0||Ie(i)}function Up(i){return Array.isArray(i)&&i.every(Ie)}function Qn(i){return Number.isSafeInteger(i)&&Number(i)>0}function xr(i){return Number.isSafeInteger(i)&&Number(i)>=0}const qn=500;function vi(i,c){const u=new Map;for(const g of i)u.set(g.seq,g);for(const g of c)u.set(g.seq,g);return[...u.values()].sort((g,m)=>g.seq-m.seq)}function Bp(i){return vi([],i).filter(c=>c.kind==="message"||c.kind==="file").map(c=>c.kind==="file"?Yc(c):c.category==="briefing"?{type:"briefing",seq:c.seq,recordId:c.record_id,at:c.at,author:c.author,text:c.text}:{type:"message",speaker:c.author.role==="room"?"room":"participant",seq:c.seq,recordId:c.record_id,at:c.at,author:c.author,text:c.text})}function Vp(i){return vi([],i).filter(c=>c.kind!=="message"&&c.kind!=="file")}function Hp(i,c){return vi([],i.filter(u=>u.room_id===c)).filter(u=>u.kind==="file").map(Yc)}function qp(i,c){const u=new Map;for(const g of Hp(i,c)){const m=u.get(g.filename)??[];m.push(g),u.set(g.filename,m)}return[...u.entries()].map(([g,m])=>{const y=m.sort((S,z)=>S.seq-z.seq).map((S,z)=>({...S,version:z+1})).reverse();return{groupId:y[0].fileId,filename:g,latest:y[0],versions:y}}).sort((g,m)=>m.latest.seq-g.latest.seq)}function mt(i,c=!0){if(!c)return ks(!1);switch(i){case"provisioning":return Tc(!1);case"active":return Tc(!0);case"closing":return ks(!1);case"closed":return{...ks(!1),canDelete:!0}}}function Os(i){return i.invites.reduce((c,u)=>u.state==="revoked"?c:c+Math.max(0,u.min_accepts-u.accepted_cids.length),0)}function Wp(i,c=qn){const u=Math.max(0,Math.floor(c));return i.slice(Math.max(0,i.length-u))}function Ns(i,c,u=qn){return Math.min(Math.max(0,c),Math.max(0,i)+Math.max(0,u))}function ks(i){return{canEditSettings:i,canCreateInvite:i,canRevokeInvite:i,canRecoverInvite:i,canMessage:i,canClose:i,canDelete:i}}function Tc(i){return{canEditSettings:!0,canCreateInvite:!0,canRevokeInvite:!0,canRecoverInvite:!0,canMessage:i,canClose:!0,canDelete:!1}}function Yc(i){return{type:"file",seq:i.seq,recordId:i.record_id,fileId:i.file_id,at:i.at,author:i.author,filename:i.filename,mime:i.mime,size:i.size,sha256:i.sha256,dataBase64:i.data_base64}}var Qp=Vc();const Yp={provisioning:"Provisioning",active:"Active",closing:"Closing",closed:"Closed"};function Ms(i){return i.room_name}function Kp({rooms:i,selectedRoomId:c,connected:u,open:g,sheet:m,onClose:y,onCreate:S,onSelect:z}){const j=i.filter(C=>C.state!=="closed"),E=i.filter(C=>C.state==="closed"),D=m&&!g;return a.jsxs("aside",{className:`room-rail${g?" room-rail--open":""}`,"aria-label":"Mission rooms","aria-hidden":D||void 0,hidden:D,children:[a.jsxs("div",{className:"rail-brand",children:[a.jsx("div",{className:"brand-mark","aria-hidden":"true",children:"O"}),a.jsxs("div",{children:[a.jsx("strong",{children:"ours cowork"}),a.jsx("span",{children:"operations console"})]}),a.jsx("button",{className:"icon-button rail-close",type:"button",onClick:y,"aria-label":"Close rooms",children:"×"})]}),a.jsxs("button",{className:"primary-button create-button",type:"button",onClick:C=>S(C.currentTarget),disabled:u!==!0,children:[a.jsx("span",{"aria-hidden":"true",children:"+"})," Create room"]}),a.jsxs("div",{className:`connection-state connection-state--${u===!1?"offline":u?"online":"pending"}`,children:[a.jsx("span",{className:"state-dot","aria-hidden":"true"}),u===!1?"Disconnected":u?"Connected":"Connecting"]}),a.jsx(Pc,{label:"Open rooms",rooms:j,selectedRoomId:c,onSelect:z}),a.jsx(Pc,{label:"Closed rooms",rooms:E,selectedRoomId:c,onSelect:z}),a.jsx("p",{className:"local-boundary",children:"Local daemon · 127.0.0.1"})]})}function Pc({label:i,rooms:c,selectedRoomId:u,onSelect:g}){return a.jsxs("section",{className:"room-group","aria-label":i,children:[a.jsxs("div",{className:"room-group__heading",children:[a.jsx("h2",{children:i}),a.jsx("span",{children:c.length})]}),c.length===0?a.jsxs("p",{className:"empty-group",children:["No ",i.toLowerCase()]}):a.jsx("ul",{className:"room-list",children:c.map(m=>{const y=m.room_id===u;return a.jsx("li",{children:a.jsxs("button",{className:"room-card",type:"button","aria-current":y?"page":void 0,onClick:()=>g(m.room_id),children:[a.jsx("span",{className:"room-card__title",children:Ms(m)}),a.jsxs("span",{className:"room-card__state",children:[a.jsx("span",{className:`lifecycle-dot lifecycle-dot--${m.state}`,"aria-hidden":"true"}),Yp[m.state]]}),a.jsxs("span",{className:"room-card__summary",children:[m.seats.length," accepted · ",Os(m)," needed"]})]})},m.room_id)})})]})}const mi=262144;function Xp({open:i,connected:c,restoreFocus:u,fallbackFocus:g,onClose:m,onCreate:y}){const[S,z]=k.useState(""),[j,E]=k.useState(""),[D,C]=k.useState(""),[U,L]=k.useState(!1),[W,I]=k.useState(),O=k.useRef(!1);if(!i)return null;const oe=zs(S),ee=zc("Goal",j),le=zc("Briefing",D);async function ge(xe){if(xe.preventDefault(),!(!c||oe||ee||le||O.current)){O.current=!0,L(!0),I(void 0);try{await y(Mo(S),j.trim(),D.trim()),z(""),E(""),C("")}catch(pe){I(pe instanceof wt&&pe.outcomeUnknown?`The create request did not receive a confirmation, so its outcome is unknown. Your fields are retained. ${pe.message}`:pe instanceof Error?pe.message:"Room creation failed.")}finally{O.current=!1,L(!1)}}}return a.jsx(kr,{title:"Create mission room",open:i,restoreFocus:u,fallbackFocus:g,onClose:m,locked:U,children:a.jsxs("form",{className:"dialog-form",onSubmit:ge,children:[a.jsx("p",{className:"dialog-intro",children:"Define the shared objective. Invitation requirements are added after the room is created."}),a.jsx(hi,{label:"Name",value:S,onChange:z,error:oe,autoFocus:!0}),a.jsx(Lo,{label:"Goal",value:j,onChange:E,error:ee,rows:3,trimForBytes:!0}),a.jsx(Lo,{label:"Briefing",value:D,onChange:C,error:le,rows:6,trimForBytes:!0}),!c&&a.jsx("p",{className:"form-error",role:"status",children:"Create is unavailable because the daemon disconnected. Your fields are retained and no request was sent."}),W&&a.jsx("p",{className:"form-error",role:"alert",children:W}),a.jsxs("div",{className:"dialog-actions",children:[a.jsx("button",{className:"secondary-button",type:"button",onClick:m,disabled:U,children:"Cancel"}),a.jsx("button",{className:"primary-button",type:"submit",disabled:!c||U||!!(oe||ee||le),children:U?"Creating room…":"Create mission room"})]})]})})}function Gp({room:i,open:c,connected:u,capable:g,restoreFocus:m,onClose:y,onSave:S}){const[z,j]=k.useState(i.room_name),[E,D]=k.useState(i.mission.goal),[C,U]=k.useState(i.mission.briefing),[L,W]=k.useState(i.status??""),[I,O]=k.useState(!1),[oe,ee]=k.useState(),le=k.useRef(!1);if(k.useEffect(()=>{c&&(j(i.room_name),D(i.mission.goal),U(i.mission.briefing),W(i.status??""),ee(void 0))},[c,i.mission.briefing,i.mission.goal,i.room_id,i.room_name,i.status]),!c)return null;const ge=zs(z),xe=Lc("Goal",E),pe=Lc("Briefing",C),Re=i.status&&!L?"An existing status cannot be cleared.":void 0,Ee={},te=Mo(z);te!==i.room_name&&(Ee.name=te),E!==i.mission.goal&&(Ee.goal=E),C!==i.mission.briefing&&(Ee.briefing=C),L!==(i.status??"")&&(Ee.status=L);const Ye=Object.keys(Ee).length>0;async function Ke(it){if(it.preventDefault(),!(!u||!g||!Ye||ge||xe||pe||Re||le.current)){le.current=!0,O(!0),ee(void 0);try{await S(Ee)}catch(Te){ee(Te instanceof wt&&Te.outcomeUnknown?`The settings request did not receive a confirmation, so its outcome is unknown. Your fields are retained. ${Te.message}`:Te instanceof Error?Te.message:"Settings update failed.")}finally{le.current=!1,O(!1)}}}return a.jsx(kr,{title:"Room settings",open:c,restoreFocus:m,onClose:y,locked:I,children:a.jsxs("form",{className:"dialog-form",onSubmit:Ke,children:[a.jsx(hi,{label:"Name",value:z,onChange:j,error:ge,autoFocus:!0}),a.jsx(Lo,{label:"Goal",value:E,onChange:D,error:xe,rows:3}),a.jsx(Lo,{label:"Briefing",value:C,onChange:U,error:pe,rows:5}),a.jsx(hi,{label:"Status (optional)",value:L,onChange:W,error:Re}),(!u||!g)&&a.jsx("p",{className:"form-error",role:"status",children:"Settings are unavailable because the connection or room lifecycle changed. Your fields are retained and no request was sent."}),oe&&a.jsx("p",{className:"form-error",role:"alert",children:oe}),a.jsxs("div",{className:"dialog-actions",children:[a.jsx("button",{className:"secondary-button",type:"button",onClick:y,disabled:I,children:"Cancel"}),a.jsx("button",{className:"primary-button",type:"submit",disabled:!u||!g||I||!Ye||!!(ge||xe||pe||Re),children:I?"Saving…":"Save settings"})]})]})})}function Zp({room:i,open:c,connected:u,capable:g,restoreFocus:m,onClose:y,onConfirm:S}){const[z,j]=k.useState(""),[E,D]=k.useState(!1),[C,U]=k.useState(),L=k.useRef(!1);if(!c)return null;const W=Ms(i),O=(z===W||z===i.room_id)&&u&&g;async function oe(ee){if(ee.preventDefault(),!(!O||L.current)){L.current=!0,D(!0),U(void 0);try{await S()}catch(le){U(Kc(le,"close","Your confirmation is retained."))}finally{L.current=!1,D(!1)}}}return a.jsx(kr,{title:"Close room",open:c,restoreFocus:m,onClose:y,locked:E,children:a.jsxs("form",{className:"dialog-form",onSubmit:oe,children:[a.jsx("p",{className:"dialog-intro",children:"Closing is forward-only. Live packet state is removed, while the plaintext local archive remains readable on this host."}),a.jsxs("p",{className:"destructive-target",children:["Type ",a.jsx("strong",{children:W})," or the exact room ID ",a.jsx("code",{children:i.room_id})," to continue."]}),a.jsx(hi,{label:"Type room title or ID to close",value:z,onChange:j}),(!u||!g)&&a.jsx("p",{className:"form-error",role:"status",children:"Close is unavailable because the connection or room lifecycle changed. No request was sent."}),C&&a.jsx("p",{className:"form-error",role:"alert",children:C}),a.jsxs("div",{className:"dialog-actions",children:[a.jsx("button",{className:"secondary-button",type:"button",onClick:y,disabled:E,children:"Cancel"}),a.jsx("button",{className:"danger-button",type:"submit",disabled:!O||E,children:E?"Closing room…":"Close room permanently"})]})]})})}function bp({room:i,open:c,connected:u,capable:g,restoreFocus:m,onClose:y,onConfirm:S}){const[z,j]=k.useState(""),[E,D]=k.useState(!1),[C,U]=k.useState(),L=k.useRef(!1);if(!c)return null;const I=z===i.room_id&&u&&g;async function O(oe){if(oe.preventDefault(),!(!I||L.current)){L.current=!0,D(!0),U(void 0);try{await S()}catch(ee){U(Kc(ee,"delete","Your confirmation is retained."))}finally{L.current=!1,D(!1)}}}return a.jsx(kr,{title:"Delete room",open:c,restoreFocus:m,onClose:y,locked:E,children:a.jsxs("form",{className:"dialog-form",onSubmit:O,children:[a.jsx("p",{className:"dialog-intro",children:"This deletes the plaintext local archive and room metadata from this host. It does not purge remote copies or backups and does not securely erase storage or keys."}),a.jsxs("p",{className:"destructive-target",children:["Type the exact room ID ",a.jsx("code",{children:i.room_id})," to continue."]}),a.jsx(hi,{label:"Type exact room ID to delete",value:z,onChange:j}),(!u||!g)&&a.jsx("p",{className:"form-error",role:"status",children:"Delete is unavailable because the connection or room lifecycle changed. No request was sent."}),C&&a.jsx("p",{className:"form-error",role:"alert",children:C}),a.jsxs("div",{className:"dialog-actions",children:[a.jsx("button",{className:"secondary-button",type:"button",onClick:y,disabled:E,children:"Cancel"}),a.jsx("button",{className:"danger-button",type:"submit",disabled:!I||E,children:E?"Deleting room…":"Delete local archive"})]})]})})}function Lo({label:i,value:c,onChange:u,error:g,rows:m,autoFocus:y=!1,trimForBytes:S=!1}){const z=k.useId(),j=`${z}-error`;return a.jsxs("div",{className:"field",children:[a.jsx("label",{htmlFor:z,children:i}),a.jsx("textarea",{id:z,value:c,rows:m,onChange:E=>u(E.target.value),"aria-invalid":!!g,"aria-describedby":g?j:void 0,autoFocus:y,"data-autofocus":y?"true":void 0}),g?a.jsx("small",{id:j,className:"field-error",children:g}):a.jsxs("small",{children:[Oo(S?c.trim():c)," / ",mi," bytes"]})]})}function hi({label:i,value:c,onChange:u,error:g,autoFocus:m=!1}){const y=k.useId(),S=`${y}-error`;return a.jsxs("div",{className:"field",children:[a.jsx("label",{htmlFor:y,children:i}),a.jsx("input",{id:y,value:c,onChange:z=>u(z.target.value),"aria-invalid":!!g,"aria-describedby":g?S:void 0,autoFocus:m,"data-autofocus":m?"true":void 0}),g&&a.jsx("small",{id:S,className:"field-error",children:g})]})}function kr({title:i,open:c,restoreFocus:u,fallbackFocus:g,onClose:m,locked:y,children:S}){const z=k.useId(),j=k.useRef(null),E=k.useRef(m),D=k.useRef(y);return E.current=m,D.current=y,k.useEffect(()=>{var I;if(!c)return;const C=u??(document.activeElement instanceof HTMLElement?document.activeElement:null),U=j.current,L=()=>[...(U==null?void 0:U.querySelectorAll('button:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'))??[]];(I=L().find(O=>O.dataset.autofocus==="true")??L()[0])==null||I.focus();const W=O=>{if(O.key==="Escape"&&!D.current){O.preventDefault(),E.current();return}if(O.key!=="Tab")return;const oe=L();if(!oe.length)return;const ee=oe[0],le=oe[oe.length-1];if(!oe.includes(document.activeElement)){O.preventDefault(),(O.shiftKey?le:ee).focus();return}O.shiftKey&&document.activeElement===ee?(O.preventDefault(),le.focus()):!O.shiftKey&&document.activeElement===le&&(O.preventDefault(),ee.focus())};return document.addEventListener("keydown",W),()=>{document.removeEventListener("keydown",W);const O=Oc(C)?C:(g==null?void 0:g())??document.querySelector('[data-modal-fallback="true"]');Oc(O)&&O.focus()}},[g,c,u]),Qp.createPortal(a.jsx("div",{className:"modal-backdrop",onMouseDown:C=>{!y&&C.target===C.currentTarget&&m()},children:a.jsxs("div",{ref:j,className:"modal",role:"dialog","aria-modal":"true","aria-labelledby":z,children:[a.jsxs("header",{children:[a.jsx("h2",{id:z,children:i}),a.jsx("button",{className:"icon-button",type:"button",onClick:m,disabled:y,"aria-label":`Close ${i}`,children:"×"})]}),S]})}),document.body)}function zc(i,c){const u=c.trim();if(!u)return`${i} is required.`;if(Oo(u)>mi)return`${i} must be at most ${mi} UTF-8 bytes.`}function Lc(i,c){if(Oo(c)<1)return`${i} is required.`;if(Oo(c)>mi)return`${i} must be at most ${mi} UTF-8 bytes.`}function Oo(i){return new TextEncoder().encode(i).byteLength}function Oc(i){return!!(i!=null&&i.isConnected&&!i.matches(':disabled, [aria-disabled="true"]')&&!i.closest('[hidden], [aria-hidden="true"]'))}function Kc(i,c,u){return i instanceof wt&&i.outcomeUnknown?`The ${c} request did not receive a confirmation, so its outcome is unknown. ${u} ${i.message}`:i instanceof Error?i.message:`Room ${c} failed.`}function Jp({room:i,connected:c,onCreate:u,onRevoke:g,onRecover:m}){const[y,S]=k.useState(""),[z,j]=k.useState("one_time"),[E,D]=k.useState("1"),[C,U]=k.useState(!1),[L,W]=k.useState(),[I,O]=k.useState(),oe=k.useRef(!1),ee=mt(i.state,c),le=Number(E),ge=new TextEncoder().encode(y.trim()).byteLength,xe=ge<1?"Role is required.":ge>256?"Role must be at most 256 UTF-8 bytes.":void 0,pe=z==="public"&&(!Number.isSafeInteger(le)||le<1)?"Minimum acceptances must be a positive whole number.":void 0;async function Re(te){te.preventDefault(),!(!ee.canCreateInvite||xe||pe||oe.current)&&await Ee(async()=>{await u({mode:z,role:y.trim(),min_accepts:z==="one_time"?1:le}),S("")},"Invite creation")}async function Ee(te,Ye){oe.current=!0,U(!0),W(void 0);try{await te()}catch(Ke){W(Xc(Ke,Ye))}finally{oe.current=!1,U(!1)}}return a.jsxs(a.Fragment,{children:[a.jsxs("form",{className:"invite-form",onSubmit:Re,children:[a.jsxs("div",{className:"field",children:[a.jsx("label",{htmlFor:"invite-role",children:"Role"}),a.jsx("input",{id:"invite-role",value:y,onChange:te=>S(te.target.value),"aria-invalid":!!xe}),xe&&a.jsx("small",{className:"field-error",children:xe})]}),a.jsxs("div",{className:"field",children:[a.jsx("label",{htmlFor:"invite-mode",children:"Mode"}),a.jsxs("select",{id:"invite-mode",value:z,onChange:te=>j(te.target.value),children:[a.jsx("option",{value:"one_time",children:"One-time"}),a.jsx("option",{value:"public",children:"Public"})]})]}),z==="public"&&a.jsxs("div",{className:"field",children:[a.jsx("label",{htmlFor:"invite-minimum",children:"Minimum acceptances"}),a.jsx("input",{id:"invite-minimum",inputMode:"numeric",value:E,onChange:te=>D(te.target.value),"aria-invalid":!!pe}),pe&&a.jsx("small",{className:"field-error",children:pe})]}),a.jsx("button",{className:"primary-button",type:"submit",disabled:!ee.canCreateInvite||C||!!(xe||pe),children:"Create invite"})]}),L&&a.jsx("p",{className:"form-error",role:"alert",children:L}),a.jsx("div",{className:"invite-list",children:i.invites.map(te=>a.jsxs("article",{className:"invite-card",children:[a.jsxs("header",{children:[a.jsx("strong",{children:te.role}),a.jsx("span",{className:`state-text state-text--${te.state}`,children:nm(te.state)})]}),a.jsxs("p",{children:[te.mode==="public"?"Public":"One-time"," · ",te.accepted_cids.length," of ",te.min_accepts," accepted"]}),a.jsx("code",{children:te.invite_id}),te.recovery_of&&a.jsxs("p",{children:["Recovery lineage: ",a.jsx("code",{children:te.recovery_of})," → ",a.jsx("code",{children:te.invite_id})," (",te.recovery_confirmed?"confirmed":"awaiting confirmation",")"]}),a.jsx("button",{className:"quiet-button",type:"button",disabled:!ee.canRevokeInvite||C||!tm(te),onClick:()=>O(te),children:"Revoke"})]},te.invite_id))}),i.invites.some(te=>te.state==="replacement_required")&&a.jsxs("div",{className:"recovery-callout",children:[a.jsx("p",{children:"The original invite secret is lost and cannot be recovered. Mint replacements, save every returned secret, then confirm each exact old/new pair. Repeating recovery rotates any unconfirmed replacement."}),a.jsx("button",{className:"secondary-button",type:"button",disabled:!ee.canRecoverInvite||C,onClick:()=>{ee.canRecoverInvite&&Ee(m,"Invite recovery")},children:"Recover missing invites"})]}),I&&a.jsx(kr,{title:"Revoke invite",open:!0,onClose:()=>O(void 0),locked:C,children:a.jsxs("div",{className:"dialog-form",children:[a.jsxs("p",{children:["Revoke the ",a.jsx("strong",{children:I.role})," invite ",a.jsx("code",{children:Gc(I.invite_id)}),"? It can no longer admit participants."]}),!ee.canRevokeInvite&&a.jsx("p",{className:"form-error",role:"status",children:"Revocation is unavailable because the connection or room lifecycle changed. No request was sent."}),a.jsxs("div",{className:"dialog-actions",children:[a.jsx("button",{className:"secondary-button",type:"button",onClick:()=>O(void 0),disabled:C,children:"Cancel"}),a.jsx("button",{className:"danger-button",type:"button",disabled:C||!ee.canRevokeInvite,onClick:()=>{ee.canRevokeInvite&&Ee(async()=>{await g(I.invite_id),O(void 0)},"Invite revocation")},children:"Revoke invite"})]})]})})]})}function em({vault:i,connected:c=!0,canConfirm:u=()=>!0,onClose:g,onConfirm:m}){const[y,S]=k.useState(""),[z,j]=k.useState(!1),[E,D]=k.useState(),C=k.useRef(!1);async function U(L){if(!(!c||!u(L)||C.current)){C.current=!0,j(!0),D(void 0);try{await m(L)}catch(W){D(Xc(W,"Recovery confirmation"))}finally{C.current=!1,j(!1)}}}return a.jsx(kr,{title:i.receipts.some(L=>L.recovery_of)?"Recovered invite receipts":"Invite receipt",open:!0,onClose:g,locked:z,children:a.jsxs("div",{className:"dialog-form",children:[a.jsxs("p",{className:"dialog-intro",children:["Room ",a.jsx("code",{children:i.room_id}),". Copy and save ",i.receipts.length===1?"this secret":"every secret"," now. It is not stored by cowork and disappears when this dialog closes."]}),i.receipts.map(L=>a.jsxs("section",{className:"receipt",children:[a.jsxs("p",{children:[a.jsx("strong",{children:L.invite.role})," · ",L.invite.mode==="public"?"Public":"One-time"]}),L.recovery_of&&a.jsxs("p",{children:["Old ",a.jsx("code",{children:L.recovery_of}),a.jsx("br",{}),"New ",a.jsx("code",{children:L.invite.invite_id})]}),a.jsx("pre",{children:L.blob}),a.jsx("button",{className:"secondary-button",type:"button",onClick:async()=>{try{await navigator.clipboard.writeText(L.blob),S(`Copied ${Gc(L.invite.invite_id)}`)}catch{S("Copy failed. Select and copy the secret manually.")}},children:"Copy invite"}),L.recovery_of&&a.jsx("button",{className:"primary-button",type:"button",disabled:z||!c||!u(L),"aria-label":`Confirm ${L.recovery_of} to ${L.invite.invite_id}`,onClick:()=>U(L),children:"Confirm old/new pair"})]},`${L.recovery_of??"new"}:${L.invite.invite_id}`)),i.receipts.some(L=>L.recovery_of&&(!c||!u(L)))&&a.jsx("p",{className:"form-error",role:"status",children:"Recovery confirmation is unavailable because the connection or exact room lineage changed. The receipt is retained and no request was sent."}),E&&a.jsx("p",{className:"form-error",role:"alert",children:E}),a.jsx("p",{role:"status","aria-live":"polite",children:y}),a.jsx("div",{className:"dialog-actions",children:a.jsx("button",{className:"primary-button",type:"button",disabled:z,onClick:g,children:"Done"})})]})})}function Xc(i,c){return i instanceof wt&&i.outcomeUnknown?`${c} has an unknown outcome. The current state is preserved; check refreshed durable state before deciding whether to act again. ${i.message}`:i instanceof Error?i.message:`${c} failed.`}function tm(i){return i.state==="live"||i.state==="replacement_required"||i.state==="receipt_pending"}function Gc(i){return i.length<=14?i:`${i.slice(0,8)}…${i.slice(-4)}`}function nm(i){return i.replaceAll("_"," ")}function rm({room:i,participants:c=[],archiveCount:u=0,connected:g=!1,tab:m,open:y,drawer:S,panelRef:z,onTab:j,onClose:E,onCreateInvite:D=Es,onRevokeInvite:C=Es,onRecoverInvites:U=Es,onRequestClose:L=Mc,onRequestDelete:W=Mc}){const I=S&&!y;return a.jsxs("aside",{ref:z,className:`room-context${y?" room-context--open":""}`,"aria-label":"Room context","aria-hidden":I||void 0,hidden:I,tabIndex:-1,children:[a.jsxs("header",{className:"context-header",children:[a.jsxs("div",{children:[a.jsx("p",{className:"eyebrow",children:"Room context"}),a.jsx("h2",{children:i?"Mission details":"No room selected"})]}),a.jsx("button",{className:"icon-button context-close",type:"button",onClick:E,"aria-label":"Close context",children:"×"})]}),i&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"context-tabs",role:"tablist","aria-label":"Room context views",children:[a.jsx("button",{type:"button",role:"tab","aria-selected":m==="state",onClick:()=>j("state"),children:"State"}),a.jsx("button",{type:"button",role:"tab","aria-selected":m==="participants",onClick:()=>j("participants"),children:"Participants"}),a.jsx("button",{type:"button",role:"tab","aria-selected":m==="invite",onClick:()=>j("invite"),children:"Invite"})]}),m==="state"?a.jsx(im,{room:i,archiveCount:u,connected:g,onRequestClose:L,onRequestDelete:W}):m==="participants"?a.jsx(om,{room:i,participants:c}):a.jsxs("div",{className:"context-body",role:"tabpanel","aria-label":"Invites",children:[a.jsxs("div",{className:"setup-callout",children:[a.jsx("span",{"aria-hidden":"true",children:"↗"}),a.jsxs("div",{children:[a.jsx("h3",{children:"Build the room roster"}),a.jsx("p",{children:"Add invitation requirements one at a time. Each confirmed requirement is durable and can be retried independently."})]})]}),a.jsxs("dl",{className:"state-grid state-grid--compact",children:[a.jsxs("div",{children:[a.jsx("dt",{children:"Requirements"}),a.jsx("dd",{children:i.invites.length})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"Still needed"}),a.jsx("dd",{children:Os(i)})]})]}),a.jsx(Jp,{room:i,connected:g,onCreate:D,onRevoke:C,onRecover:U},i.room_id)]})]})]})}function im({room:i,archiveCount:c,connected:u,onRequestClose:g,onRequestDelete:m}){const y=mt(i.state,u);return a.jsxs("div",{className:"context-body",role:"tabpanel","aria-label":"State",children:[a.jsxs("dl",{className:"state-grid",children:[a.jsxs("div",{children:[a.jsx("dt",{children:"Lifecycle"}),a.jsx("dd",{className:`state-text state-text--${i.state}`,children:Zc(i.state)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"Accepted seats"}),a.jsx("dd",{children:i.seats.length})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"Unmet requirements"}),a.jsx("dd",{children:Os(i)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"Archive"}),a.jsxs("dd",{children:[c," records"]})]})]}),a.jsx(_r,{label:"Room name",value:i.room_name}),i.status&&a.jsx(_r,{label:"Status",value:i.status}),a.jsx(_r,{label:"Room ID",value:i.room_id,mono:!0}),a.jsx(_r,{label:"Identity CID",value:i.identity_cid||"Pending",mono:!0}),a.jsx(_r,{label:"Created",value:Rs(i.created_at)}),i.closed_at&&a.jsx(_r,{label:"Closed",value:Rs(i.closed_at)}),a.jsxs("div",{className:"management-actions",children:[y.canClose&&a.jsx("button",{className:"danger-button",type:"button",onClick:S=>g(S.currentTarget),children:"Close room"}),y.canDelete&&a.jsx("button",{className:"danger-button",type:"button",onClick:S=>m(S.currentTarget),children:"Delete room"})]})]})}function om({room:i,participants:c}){return a.jsxs("div",{className:"context-body",role:"tabpanel","aria-label":"Participants",children:[a.jsx("p",{className:`state-text state-text--${i.state}`,children:Zc(i.state)}),a.jsxs("p",{children:[c.length," ",c.length===1?"seat":"seats"]}),i.invites.map(u=>a.jsxs("p",{children:[a.jsx("strong",{children:u.role}),": ",u.accepted_cids.length," of ",u.min_accepts," accepted"]},u.invite_id)),a.jsxs("div",{className:"participant-list",children:[c.map(u=>a.jsxs("article",{className:"participant-card",children:[a.jsx("strong",{children:u.display_name}),a.jsxs("span",{children:[u.role,u.state==="pending"?" · pending":""]}),a.jsx("code",{className:"mono",children:u.identity}),a.jsxs("small",{children:["via ",u.invite_id," · ",Rs(u.accepted_at??u.requested_at)]})]},u.participant_id??u.identity)),c.length===0&&a.jsx("p",{className:"context-note",children:"No participants admitted yet."})]})]})}function _r({label:i,value:c,mono:u=!1}){return a.jsxs("div",{className:"detail-row",children:[a.jsx("span",{children:i}),a.jsx("strong",{className:u?"mono":void 0,children:c})]})}function Rs(i){const c=new Date(i);return Number.isNaN(c.valueOf())?i:c.toLocaleString()}function Zc(i){return`${i.charAt(0).toUpperCase()}${i.slice(1).replaceAll("_"," ")}`}async function Es(){throw new Error("Invite management is unavailable.")}function Mc(){}function Dc({records:i,mode:c}){const u=k.useMemo(()=>c==="events"?Vp(i):vi([],i),[c,i]);return u.length===0?a.jsxs("p",{className:"timeline-empty",children:["No ",c==="events"?"operational events":"archive records"," loaded."]}):a.jsx("ul",{className:"record-list","aria-label":c==="events"?"Operational events":"Complete archive",children:u.map(g=>{const m=lm(g);return a.jsxs("li",{className:"record-row",children:[a.jsxs("header",{children:[a.jsxs("code",{children:["#",g.seq]}),a.jsx("strong",{children:g.kind.replaceAll("_"," ")}),"status"in g&&a.jsx("span",{className:`record-status record-status--${g.status}`,children:g.status}),a.jsx("time",{dateTime:g.at,children:sm(g.at)})]}),g.kind==="message"&&a.jsx("p",{children:g.text}),a.jsx("pre",{children:JSON.stringify(m,null,2)})]},g.record_id)})})}function lm(i){const{version:c,room_id:u,seq:g,record_id:m,at:y,text:S,...z}=i.kind==="message"?i:{...i,text:void 0};return Object.fromEntries(Object.entries(z).filter(([,j])=>j!==void 0))}function sm(i){const c=new Date(i);return Number.isNaN(c.valueOf())?i:c.toLocaleString()}const bc="File integrity check failed; download blocked.",am="application/octet-stream";class Wn extends Error{constructor(){super(bc),this.name="FileIntegrityError"}}async function um(i){const c=fm(i.dataBase64);if(c.byteLength!==i.size)throw new Wn;let u;try{const m=new Uint8Array(c.byteLength);m.set(c),u=await globalThis.crypto.subtle.digest("SHA-256",m.buffer)}catch{throw new Wn}if([...new Uint8Array(u)].map(m=>m.toString(16).padStart(2,"0")).join("")!==i.sha256)throw new Wn;return c}function cm(i){const c=i.replace(/[\\/]/gu,"_").replace(/[\p{Cc}\p{Cf}]/gu,"_").replace(/[ .]+$/gu,u=>"_".repeat(u.length));return c.length>0?c:"download"}async function dm(i,c=pm()){const u=await um(i),g=new Uint8Array(u.byteLength);g.set(u);const m=c.createObjectURL(new Blob([g.buffer],{type:am}));try{const y=c.createAnchor();y.href=m,y.download=cm(i.filename),y.hidden=!0,y.click()}finally{c.schedule(()=>c.revokeObjectURL(m))}}function fm(i){if(!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(i))throw new Wn;let c;try{c=atob(i)}catch{throw new Wn}if(btoa(c)!==i)throw new Wn;return Uint8Array.from(c,u=>u.charCodeAt(0))}function pm(){return{createObjectURL:i=>URL.createObjectURL(i),revokeObjectURL:i=>URL.revokeObjectURL(i),createAnchor:()=>document.createElement("a"),schedule:i=>setTimeout(i,0)}}function mm({file:i}){return a.jsxs("article",{className:"file-attachment",children:[a.jsx("div",{className:"file-attachment__glyph","aria-hidden":"true",children:"↓"}),a.jsxs("div",{className:"file-attachment__body",children:[a.jsx("strong",{className:"file-name",dir:"auto",children:i.filename}),a.jsx("span",{children:Ts(i.size)})]}),a.jsx(Jc,{file:i})]})}function Jc({file:i}){const[c,u]=k.useState(!1),[g,m]=k.useState("");async function y(){if(!c){u(!0),m("");try{await dm(i)}catch(S){m(S instanceof Wn?bc:"Download failed.")}finally{u(!1)}}}return a.jsxs("div",{className:"file-download",children:[a.jsx("button",{className:"secondary-button file-download__button",type:"button",disabled:c,"aria-label":`Download ${i.filename}`,onClick:()=>void y(),children:c?"Preparing download":"Download"}),a.jsx("span",{className:"file-download__status",role:"status","aria-live":"polite",children:g})]})}function Ts(i){if(i<1024)return`${i} B`;const c=["KB","MB"];let u=i,g=-1;do u/=1024,g+=1;while(u>=1024&&g<c.length-1);return`${u>=10||Number.isInteger(u)?u.toFixed(0):u.toFixed(1)} ${c[g]}`}function hm({roomId:i,records:c,historyReady:u,visible:g}){const m=k.useMemo(()=>Bp(c),[c]),[y,S]=k.useState(qn),[z,j]=k.useState(""),E=k.useRef({maxSeq:0,ready:!1});k.useEffect(()=>{S(qn)},[i]),k.useEffect(()=>{var I,O;const C=((I=m.at(-1))==null?void 0:I.seq)??0,U=E.current;if(U.roomId!==i||!u||!U.ready){E.current={roomId:i,maxSeq:C,ready:u},j("");return}const L=m.filter(oe=>oe.seq>U.maxSeq),W=L.length;E.current={roomId:i,maxSeq:Math.max(U.maxSeq,C),ready:!0},j(g&&W>0?W===1?`1 new ${((O=L[0])==null?void 0:O.type)==="file"?"attachment":"message"}`:`${W} new room items`:"")},[u,i,m,g]);const D=Wp(m,y);return a.jsxs("div",{className:"chat-timeline",children:[m.length===0&&a.jsx("p",{className:"timeline-empty",children:"No archived communication yet."}),m.length>D.length&&a.jsx("button",{className:"quiet-button show-earlier",type:"button",onClick:()=>S(C=>Ns(C,m.length)),children:"Show 500 earlier"}),a.jsx("ul",{className:"chat-list","aria-label":"Room communication",children:D.map(C=>C.type==="briefing"?a.jsxs("li",{className:"chat-row chat-row--briefing",children:[a.jsxs("div",{className:"chat-row__meta",children:[a.jsx("strong",{children:"Mission briefing"}),a.jsx(Cs,{seq:C.seq,at:C.at})]}),a.jsx("p",{className:"chat-row__text",children:C.text})]},C.recordId):C.type==="file"?a.jsxs("li",{className:"chat-row chat-row--file",children:[a.jsxs("div",{className:"chat-row__meta",children:[a.jsx("strong",{children:C.author.display_name}),a.jsx("span",{children:C.author.role}),a.jsx(Cs,{seq:C.seq,at:C.at})]}),a.jsx(mm,{file:C})]},C.recordId):a.jsxs("li",{className:`chat-row chat-row--${C.speaker}`,children:[a.jsxs("div",{className:"chat-row__meta",children:[a.jsx("strong",{children:C.author.display_name}),a.jsx("span",{children:C.speaker==="room"?"Room voice":C.author.role}),a.jsx(Cs,{seq:C.seq,at:C.at})]}),a.jsx("p",{className:"chat-row__text",children:C.text})]},C.recordId))}),a.jsx("p",{className:"visually-hidden",role:"status","aria-label":"New room items","aria-live":"polite","aria-atomic":"true",children:z})]})}function Cs({seq:i,at:c}){const u=new Date(c);return a.jsxs(a.Fragment,{children:[a.jsxs("code",{children:["#",i]}),a.jsx("time",{dateTime:c,children:Number.isNaN(u.valueOf())?c:u.toLocaleString()})]})}function vm({roomId:i,records:c}){const u=k.useMemo(()=>qp(c,i),[c,i]),[g,m]=k.useState(qn),[y,S]=k.useState(new Set),[z,j]=k.useState({});if(k.useEffect(()=>{m(qn),S(new Set),j({})},[i]),u.length===0)return a.jsx("p",{className:"timeline-empty",children:"No archived files yet."});const E=u.slice(0,g);return a.jsxs("div",{className:"files-view",children:[a.jsx("ul",{className:"file-group-list","aria-label":"Room files",children:E.map(D=>{const C=y.has(D.groupId),U=`file-versions-${D.groupId}`,L=z[D.groupId]??qn,W=D.versions.slice(0,L);return a.jsxs("li",{className:"file-group",children:[a.jsxs("button",{className:"file-group__toggle",type:"button","aria-expanded":C,"aria-controls":U,"aria-label":`${C?"Collapse":"Expand"} versions for ${D.filename}`,onClick:()=>S(I=>{const O=new Set(I);return O.has(D.groupId)?O.delete(D.groupId):O.add(D.groupId),O}),children:[a.jsx("span",{className:"file-group__chevron","aria-hidden":"true",children:"›"}),a.jsx("span",{className:"file-group__title file-name",dir:"auto",children:D.filename}),a.jsxs("span",{className:"file-group__count",children:[D.versions.length," ",D.versions.length===1?"version":"versions"]}),a.jsxs("span",{className:"file-group__latest",children:["Latest: ",D.latest.author.display_name," · ",a.jsx(Ic,{at:D.latest.at})," · ",Ts(D.latest.size)]})]}),C&&a.jsxs("div",{className:"file-version-panel",id:U,children:[a.jsx("ol",{className:"file-version-list","aria-label":`Versions of ${D.filename}`,children:W.map(I=>a.jsxs("li",{className:"file-version",children:[a.jsxs("div",{className:"file-version__details",children:[a.jsxs("strong",{children:["Version ",I.version]}),a.jsxs("span",{children:[I.author.display_name," · ",I.author.role]}),a.jsxs("span",{children:[a.jsx(Ic,{at:I.at})," · ",Ts(I.size)]}),a.jsx("span",{className:"file-version__mime",children:I.mime})]}),a.jsx(Jc,{file:I})]},I.recordId))}),D.versions.length>W.length&&a.jsx("button",{className:"quiet-button show-earlier",type:"button",onClick:()=>j(I=>({...I,[D.groupId]:Ns(L,D.versions.length)})),children:"Show 500 older versions"})]})]},D.latest.recordId)})}),u.length>E.length&&a.jsx("button",{className:"quiet-button show-earlier",type:"button",onClick:()=>m(D=>Ns(D,u.length)),children:"Show 500 earlier"})]})}function Ic({at:i}){const c=new Date(i);return a.jsx("time",{dateTime:i,children:Number.isNaN(c.valueOf())?i:c.toLocaleString()})}const Fc=262144;function ym({roomState:i,connected:c,state:u,onDraftChange:g,onSend:m}){const{draft:y,pending:S,error:z}=u,j=i==="active"&&c,E=gm(y)>Fc?`Message must be at most ${Fc} UTF-8 bytes.`:void 0,D=j&&!S&&y.length>0&&!E;async function C(W){W==null||W.preventDefault(),D&&await m(y)}function U(W){W.key!=="Enter"||W.shiftKey||(W.preventDefault(),C())}const L=c?i!=="active"?`Messaging is unavailable while the room is ${i}.`:void 0:"Disconnected. Drafts remain local until the daemon is available.";return a.jsxs("form",{className:"room-composer",onSubmit:C,children:[a.jsx("label",{className:"visually-hidden",htmlFor:"room-message",children:"Message the room"}),a.jsx("textarea",{id:"room-message",rows:3,value:y,disabled:!j||S,placeholder:"Message as the room identity",onChange:W=>g(W.target.value),onKeyDown:U,"aria-describedby":"composer-help","aria-invalid":!!E}),a.jsxs("div",{className:"composer-footer",children:[a.jsx("small",{id:"composer-help",children:E??L??"Enter to send · Shift+Enter for a new line"}),a.jsx("button",{className:"primary-button",type:"submit",disabled:!D,children:S?"Sending…":"Send message"})]}),z&&a.jsx("p",{className:"form-error",role:"alert",children:z})]})}function gm(i){return new TextEncoder().encode(i).byteLength}const Hn=["communication","files","events","archive"];function _m({room:i,records:c=[],historyReady:u=!1,connected:g,visible:m=!0,composerState:y,onComposerDraft:S,onOpenRooms:z,onOpenContext:j,onSettings:E,onSendMessage:D=Sm}){const[C,U]=k.useState("communication"),L=k.useRef({});if(!i)return a.jsxs("main",{className:"workspace workspace--empty",children:[a.jsx("button",{className:"icon-button mobile-rooms",type:"button",onClick:z,"aria-label":"Open rooms",children:"☰"}),a.jsxs("div",{className:"empty-workspace",children:[a.jsx("span",{className:"empty-workspace__glyph","aria-hidden":"true",children:"⌁"}),a.jsx("p",{className:"eyebrow",children:"Mission control"}),a.jsx("h1",{children:"Select a room"}),a.jsx("p",{children:"Choose a mission room to inspect its state and coordinate its work."})]})]});const W=mt(i.state,g);return a.jsxs("main",{className:"workspace",children:[a.jsxs("header",{className:"workspace-header",children:[a.jsx("button",{className:"icon-button mobile-rooms",type:"button",onClick:z,"aria-label":"Open rooms",children:"☰"}),a.jsxs("div",{className:"workspace-identity",children:[a.jsx("p",{className:"eyebrow",children:"Mission room"}),a.jsx("h1",{children:Ms(i)})]}),a.jsx("span",{className:`lifecycle-badge lifecycle-badge--${i.state}`,children:xm(i.state)}),a.jsx("button",{className:"secondary-button context-toggle",type:"button",onClick:j,"data-modal-fallback":"true",children:"Context"})]}),a.jsxs("div",{className:"mission-strip",children:[a.jsx("span",{children:"Goal"}),a.jsx("p",{children:i.mission.goal}),a.jsx("button",{className:"quiet-button",type:"button",onClick:I=>E(I.currentTarget),disabled:!W.canEditSettings,children:"Room settings"})]}),a.jsx("nav",{className:"workspace-tabs","aria-label":"Room workspace",role:"tablist",children:Hn.map(I=>a.jsx("button",{ref:O=>{L.current[I]=O??void 0},id:`workspace-tab-${I}`,type:"button",role:"tab","aria-controls":`workspace-panel-${I}`,"aria-selected":C===I,tabIndex:C===I?0:-1,onClick:()=>U(I),onKeyDown:O=>{var ge;const oe=Hn.indexOf(I),ee=O.key==="ArrowRight"?(oe+1)%Hn.length:O.key==="ArrowLeft"?(oe-1+Hn.length)%Hn.length:O.key==="Home"?0:O.key==="End"?Hn.length-1:void 0;if(ee===void 0)return;O.preventDefault();const le=Hn[ee];U(le),(ge=L.current[le])==null||ge.focus()},children:I[0].toUpperCase()+I.slice(1)},I))}),a.jsxs("section",{className:"workspace-content",id:`workspace-panel-${C}`,role:"tabpanel","aria-labelledby":`workspace-tab-${C}`,"aria-label":`${C} panel`,tabIndex:0,children:[C==="communication"&&a.jsx(wm,{room:i,records:c,historyReady:u,connected:g,visible:m,composerState:y??km,onComposerDraft:S??Em,onSendMessage:D}),C==="files"&&a.jsx(vm,{roomId:i.room_id,records:c}),C==="events"&&a.jsx(Dc,{records:c,mode:"events"}),C==="archive"&&a.jsx(Dc,{records:c,mode:"archive"})]})]})}function wm({room:i,records:c,historyReady:u,connected:g,visible:m,composerState:y,onComposerDraft:S,onSendMessage:z}){const j=c.some(E=>E.kind==="message"&&E.category==="briefing");return a.jsxs("div",{className:"communication-shell",children:[!j&&a.jsxs("article",{className:"briefing-card",children:[a.jsx("p",{className:"eyebrow",children:"Mission briefing"}),a.jsx("p",{children:i.mission.briefing})]}),i.state!=="active"&&a.jsx("p",{className:`lifecycle-separator lifecycle-separator--${i.state}`,children:i.state==="provisioning"?"Room setup in progress · messaging begins after activation":i.state==="closing"?"Room closure in progress · mutations are disabled":"Room closed · read-only local archive"}),a.jsx(hm,{roomId:i.room_id,records:c,historyReady:u,visible:m}),a.jsx(ym,{roomState:i.state,connected:g,state:y,onDraftChange:S,onSend:z})]})}function xm(i){return i==="provisioning"?"Provisioning":i[0].toUpperCase()+i.slice(1)}async function Sm(){throw new Error("Room messaging is unavailable.")}const km={draft:"",pending:!1};function Em(){}function Ac(i){if(!Number.isFinite(i.intervalMs)||i.intervalMs<=0)throw new TypeError("poll interval must be positive");let c=!1,u=0;const g=i.clock??{setInterval:globalThis.setInterval.bind(globalThis),clearInterval:globalThis.clearInterval.bind(globalThis)};let m,y;function S(j){if(!c||u!==j||!i.visible())return Promise.resolve();if((y==null?void 0:y.generation)===j)return y.dirty=!0,y.promise;const E={generation:j,controller:new AbortController,dirty:!1,promise:Promise.resolve()};return y=E,E.promise=z(E),E.promise}async function z(j){try{do{j.dirty=!1;try{await i.run(j.controller.signal)}catch(E){if(!c||u!==j.generation||j.controller.signal.aborted)return;throw E}}while(j.dirty&&c&&u===j.generation&&i.visible())}finally{y===j&&(y=void 0)}}return{start(){if(c)return;c=!0;const j=++u;m=g.setInterval(()=>{S(j).catch(()=>{})},i.intervalMs)},refresh(){return S(u)},stop(){if(!c)return;c=!1,u+=1,m!==void 0&&g.clearInterval(m),m=void 0;const j=y;y=void 0,j==null||j.controller.abort()}}}const Cm={call:(i,c,u)=>fp(i,c,{signal:u==null?void 0:u.signal})};function jm({rpc:i=Cm,clock:c}){var Xn;const[u,g]=k.useState([]),[m,y]=k.useState(()=>$c(location.hash)),[S,z]=k.useState(),[j,E]=k.useState([]),[D,C]=k.useState({}),[U,L]=k.useState({}),[W,I]=k.useState({}),[O,oe]=k.useState(null),[ee,le]=k.useState(),[ge,xe]=k.useState(),[pe,Re]=k.useState(!1),[Ee,te]=k.useState(!1),[Ye,Ke]=k.useState(!1),[it,Te]=k.useState(!1),[ot,lt]=k.useState([]),[Xe,Ce]=k.useState("state"),[$,X]=k.useState(!1),[V,h]=k.useState(!1),N=Bc("(max-width: 999px)"),ne=Bc("(max-width: 759px)"),re=k.useRef(),ae=k.useRef(),ie=k.useRef(0),fe=k.useRef({}),ue=k.useRef({}),se=k.useRef([]),_e=k.useRef(new Set),tt=k.useRef(null),yi=k.useRef(),st=k.useRef(m),Yn=k.useRef(),Er=k.useRef(),Cr=k.useRef(),Kn=k.useRef(),jr=k.useRef(null),At=k.useCallback(x=>{tt.current=x,oe(x)},[]),Ae=k.useCallback(x=>{x&&_e.current.has(x.room_id)||(yi.current=x,z(x))},[]),Pt=k.useCallback(x=>{const A=x.filter(F=>!_e.current.has(F.room_id));se.current=A,g(A)},[]),tn=k.useCallback(x=>{if(_e.current.has(x.room_id))return;const A=se.current.some(F=>F.room_id===x.room_id)?se.current.map(F=>F.room_id===x.room_id?x:F):[...se.current,x];se.current=A,g(A)},[]),Wt=k.useCallback((x,A)=>{if(_e.current.has(x))return;const F=A(ue.current[x]??Po);ue.current={...ue.current,[x]:F},I(ue.current)},[]),Nn=k.useCallback(()=>!document.hidden,[]),gi=k.useCallback(()=>jr.current??void 0,[]),Se=k.useCallback((x,A)=>{const F=x instanceof Error?x.message:"Unexpected daemon error.";xe(A?`${A}: ${F}`:F)},[]),nn=k.useCallback(async(x,A={})=>{var me;if(_e.current.has(x))return;let F=fe.current[x]??[],b=((me=F.at(-1))==null?void 0:me.seq)??0;const Y=()=>{var he;return!((he=A.signal)!=null&&he.aborted)&&!_e.current.has(x)&&(A.generation===void 0||ie.current===A.generation)};for(;Y();){const he=await i.call("room.history",{room_id:x,after:b,limit:200},A.signal?{signal:A.signal}:void 0);if(!Y())return;if(!Tp(he)||he.some((ht,Qt)=>ht.room_id!==x||ht.seq!==b+Qt+1))throw new Error("daemon returned an invalid history page");if(he.length>0){if(!Y())return;F=vi(fe.current[x]??F,he),fe.current={...fe.current,[x]:F},C(fe.current)}if(he.length===0){if(!Y())return;L(ht=>_e.current.has(x)||ht[x]?ht:{...ht,[x]:!0});return}b+=he.length}},[i]);k.useEffect(()=>{const x=Ac({intervalMs:5e3,visible:Nn,clock:c,run:async F=>{const b=st.current;try{const Y=await i.call("room.list",{},{signal:F});if(!Ep(Y))throw new Error("daemon returned an invalid room list");const me=Y.filter(he=>!_e.current.has(he.room_id));Pt(me),At(!0),xe(he=>he!=null&&he.startsWith("Disconnected:")?void 0:he),b&&st.current===b&&!me.some(he=>he.room_id===b)&&(st.current=void 0,y(void 0),Ae(void 0),E([]),le(`Room “${b}” is no longer available. No local data was changed.`),location.hash&&history.replaceState(null,"",`${location.pathname}${location.search}#/`))}catch(Y){if(F.aborted)return;At(!1);const me=Y instanceof Error?Y.message:"cowork daemon is unavailable";xe(`Disconnected: ${me}. Loaded room data is preserved.`)}}});re.current=x,x.start(),x.refresh();const A=()=>{document.hidden||x.refresh()};return document.addEventListener("visibilitychange",A),()=>{document.removeEventListener("visibilitychange",A),re.current=void 0,x.stop()}},[c,Pt,i,At,Ae,Nn]),k.useEffect(()=>{const x=()=>{const A=$c(location.hash),F=A&&!_e.current.has(A)?A:void 0;st.current=F,y(F),E([]),A&&!F&&history.replaceState(null,"",`${location.pathname}${location.search}#/`)};return window.addEventListener("hashchange",x),()=>window.removeEventListener("hashchange",x)},[]),k.useEffect(()=>{const x=++ie.current;if(!m){Ae(void 0),E([]);return}if(_e.current.has(m)){st.current=void 0,y(void 0),Ae(void 0),E([]),location.hash&&history.replaceState(null,"",`${location.pathname}${location.search}#/`);return}const A=u.find(Y=>Y.room_id===m);A&&Ae(A);const F=Ac({intervalMs:2e3,visible:Nn,clock:c,run:async Y=>{try{const[me,he,ht]=await Promise.allSettled([i.call("room.show",{room_id:m},{signal:Y}),i.call("room.participants",{room_id:m},{signal:Y}),nn(m,{generation:x,signal:Y})]);if(Y.aborted||ie.current!==x||_e.current.has(m))return;if(me.status==="rejected")throw me.reason;const Qt=me.value;if(!pi(Qt))throw new Error("daemon returned invalid room details");if(ie.current!==x||_e.current.has(m)||Qt.room_id!==m)return;if(Ae(Qt),he.status==="fulfilled"&&Ec(he.value)){const on=he.value;E(Gn=>_e.current.has(m)||ie.current!==x||Nm(Gn,on)?Gn:on)}he.status==="fulfilled"&&!Ec(he.value)?Se(new Error("daemon returned invalid participant details"),"Participant refresh failed"):he.status==="rejected"&&!Y.aborted&&Se(he.reason,"Participant refresh failed"),ht.status==="rejected"&&!Y.aborted&&Se(ht.reason,"History refresh failed"),tn(Qt),At(!0)}catch(me){if(Y.aborted||ie.current!==x)return;At(!1),Se(me,"Disconnected")}}});ae.current=F,F.start(),F.refresh();const b=()=>{document.hidden||F.refresh()};return document.addEventListener("visibilitychange",b),()=>{document.removeEventListener("visibilitychange",b),ae.current===F&&(ae.current=void 0),F.stop()}},[c,nn,tn,Se,i,m,At,Ae,Nn]);const rn=k.useCallback(x=>{if(_e.current.has(x)){st.current=void 0,y(void 0),Ae(void 0),E([]),history.replaceState(null,"",`${location.pathname}${location.search}#/`);return}st.current=x,y(x),E([]),le(void 0),Ke(!1),Te(!1),X(!1);const A=`#/rooms/${encodeURIComponent(x)}`;location.hash!==A&&(location.hash=A)},[Ae]),qe=k.useCallback(()=>{var x,A;(x=re.current)==null||x.refresh(),(A=ae.current)==null||A.refresh()},[]),Rn=k.useCallback(async(x,A,F)=>{if(tt.current!==!0)throw new Error("The daemon is disconnected. Your fields are retained.");try{const b=await i.call("room.create",{name:x,goal:A.trim(),briefing:F.trim()});if(!pi(b))throw new Error("daemon returned invalid created room details");Re(!1),Ce("invite"),h(!0),rn(b.room_id),qe()}catch(b){throw Se(b,"Create room failed"),b}},[qe,Se,i,rn]),Tn=k.useCallback(async(x,A)=>{if(Object.keys(A).length===0)return;const F=se.current.find(b=>b.room_id===x);if(tt.current!==!0)throw new Error("The daemon is disconnected. Your fields are retained.");if(!F||!mt(F.state,!0).canEditSettings)throw new Error("Room settings are unavailable in the current lifecycle. Your fields are retained.");try{const b=await i.call("room.settings",{room_id:x,...A});if(!pi(b)||b.room_id!==x)throw new Error("daemon returned invalid updated room details");te(!1),qe()}catch(b){throw Se(b,"Settings update failed"),b}},[qe,Se,i]),de=k.useMemo(()=>(S==null?void 0:S.room_id)===m?S:u.find(x=>x.room_id===m),[u,S,m]),_i=k.useCallback(async(x,A)=>{const F=se.current.find(b=>b.room_id===x);if(tt.current!==!0)throw new Error("The daemon is disconnected. The invite form is retained.");if(!F||!mt(F.state,!0).canCreateInvite)throw new Error("Invites are unavailable in the current room lifecycle. The form is retained.");try{const b={room_id:x,...A},Y=await i.call("room.invite",b),me=jp(Y,b);lt(he=>[...he,{room_id:x,receipts:[me]}]),qe()}catch(b){throw Se(b,"Create invite failed"),b}},[qe,Se,i]),wi=k.useCallback(async(x,A)=>{const F=se.current.find(Y=>Y.room_id===x),b=F==null?void 0:F.invites.find(Y=>Y.invite_id===A);if(tt.current!==!0)throw new Error("The daemon is disconnected. The revoke confirmation is retained.");if(!F||!mt(F.state,!0).canRevokeInvite||!b||!Tm(b.state))throw new Error("This invite can no longer be revoked. The confirmation is retained.");try{const Y=await i.call("room.revoke",{room_id:x,invite_id:A});return qe(),Y}catch(Y){throw Se(Y,"Revoke invite failed"),Y}},[qe,Se,i]),Do=k.useCallback(async x=>{const A=se.current.find(F=>F.room_id===x);if(tt.current!==!0)throw new Error("The daemon is disconnected. Recovery was not started.");if(!A||!mt(A.state,!0).canRecoverInvite||!A.invites.some(F=>F.state==="replacement_required"))throw new Error("Invite recovery is unavailable in the current room state.");try{const F=await i.call("room.recover",{room_id:A.room_id}),b=Np(F,A);b.length>0&<(Y=>[...Y,{room_id:A.room_id,receipts:b}]),qe()}catch(F){throw Se(F,"Recover invites failed"),F}},[qe,Se,i]),Nr=k.useCallback(async x=>{if(!x.recovery_of)throw new Error("Recovery receipt has no old invite pointer.");const A=se.current.find(F=>F.room_id===x.room_id);if(tt.current!==!0)throw new Error("The daemon is disconnected. The recovery receipt is retained.");if(!A||!Uc(A,x))throw new Error("The exact recovery lineage is no longer confirmable. The receipt is retained.");try{const F=await i.call("room.recover.confirm",{room_id:x.room_id,recovery_of:x.recovery_of,invite_id:x.invite.invite_id});Rp(F,x),qe()}catch(F){throw Se(F,"Confirm recovery failed"),F}},[qe,Se,i]),Rr=k.useCallback(async(x,A)=>{const F=ue.current[x]??Po;if(F.pending||F.draft!==A)return;const b=se.current.find(Y=>Y.room_id===x);if(tt.current!==!0||!b||!mt(b.state,!0).canMessage){Wt(x,Y=>({...Y,error:"Messaging is unavailable because the connection or room lifecycle changed. Your draft is retained."}));return}Wt(x,Y=>({...Y,pending:!0,error:void 0}));try{const Y=await i.call("room.message",{room_id:x,text:A});if(!Wc(Y)||Y.kind!=="message"||Y.room_id!==x||Y.category!=="chat"||Y.text!==A||Y.author.identity!==b.identity_cid||Y.author.display_name!==b.identity_name||Y.author.role!=="room")throw new Error("daemon returned invalid message confirmation");if(_e.current.has(x))return;Wt(x,me=>({draft:me.draft===A?"":me.draft,pending:!1})),nn(x).catch(me=>Se(me,"History refresh failed"))}catch(Y){Wt(x,me=>({...me,pending:!1,error:Rm(Y)}))}},[nn,Se,i,Wt]),Tr=k.useCallback(async x=>{const A=se.current.find(F=>F.room_id===x);if(tt.current!==!0)throw new Error("The daemon is disconnected. The room was not closed.");if(!A||!mt(A.state,!0).canClose)throw new Error("This room cannot be closed from its current state.");try{const F=await i.call("room.close",{room_id:x});if(!pi(F)||F.room_id!==x||F.state!=="closed")throw new Error("daemon returned invalid closed room details");st.current===x&&Ae(F),tn(F),Ke(!1),qe()}catch(F){throw Se(F,"Close room failed"),F}},[qe,tn,Se,i,Ae]),Pr=k.useCallback(async x=>{var F,b;const A=se.current.find(Y=>Y.room_id===x);if(tt.current!==!0)throw new Error("The daemon is disconnected. The room was not deleted.");if(!A||!mt(A.state,!0).canDelete)throw new Error("Only a closed room can be deleted.");try{const Y=await i.call("room.delete",{room_id:x,confirm:!0});if(!Pp(Y)||Y.room_id!==x)throw new Error("daemon returned invalid deletion confirmation");_e.current.add(x),ie.current+=1,(F=ae.current)==null||F.stop(),Pt(se.current.filter(me=>me.room_id!==x)),Ae(void 0),y(void 0),st.current=void 0,E([]),fe.current=Object.fromEntries(Object.entries(fe.current).filter(([me])=>me!==x)),C(fe.current),ue.current=Object.fromEntries(Object.entries(ue.current).filter(([me])=>me!==x)),I(ue.current),L(me=>Object.fromEntries(Object.entries(me).filter(([he])=>he!==x))),Te(!1),h(!1),le(`Room “${x}” was deleted from this host. Remote copies and backups were not purged.`),history.replaceState(null,"",`${location.pathname}${location.search}#/`),(b=re.current)==null||b.refresh()}catch(Y){throw Se(Y,"Delete room failed"),Y}},[Pt,Se,i,Ae]);return a.jsxs("div",{className:"cowork-app",children:[a.jsx(Kp,{rooms:u,selectedRoomId:m,connected:O,open:$,sheet:ne,onClose:()=>X(!1),onCreate:x=>{Yn.current=x,Re(!0)},onSelect:rn}),a.jsx(_m,{room:de,records:de?D[de.room_id]??[]:[],historyReady:!!(de&&U[de.room_id]),connected:O===!0,visible:!document.hidden,composerState:de?W[de.room_id]??Po:Po,onComposerDraft:de?x=>Wt(de.room_id,A=>({...A,draft:x})):void 0,onOpenRooms:()=>X(!0),onOpenContext:()=>h(!0),onSettings:x=>{Er.current=x,te(!0)},onSendMessage:de?x=>Rr(de.room_id,x):void 0}),a.jsx(rm,{room:de,participants:j,archiveCount:de?((Xn=D[de.room_id])==null?void 0:Xn.length)??0:0,connected:O===!0,tab:Xe,open:V,drawer:N,panelRef:jr,onTab:Ce,onClose:()=>h(!1),onCreateInvite:de?x=>_i(de.room_id,x):void 0,onRevokeInvite:de?x=>wi(de.room_id,x):void 0,onRecoverInvites:de?()=>Do(de.room_id):void 0,onRequestClose:x=>{Cr.current=x,Ke(!0)},onRequestDelete:x=>{Kn.current=x,Te(!0)}}),(ne&&$||N&&V)&&a.jsx("button",{className:"responsive-scrim",type:"button","aria-label":"Close open panel",onClick:()=>{X(!1),h(!1)}}),O===!1&&a.jsxs("div",{className:"disconnect-banner",role:"status",children:[a.jsx("strong",{children:"Disconnected"}),a.jsx("span",{children:"Loaded data remains visible. Mutations are disabled until the daemon answers."})]}),ge&&a.jsxs("div",{className:"error-banner",role:"alert",children:[a.jsx("span",{children:ge}),a.jsx("button",{type:"button",onClick:()=>xe(void 0),"aria-label":"Dismiss error",children:"×"})]}),ee&&a.jsxs("div",{className:"notice-banner",role:"status",children:[a.jsx("span",{children:ee}),a.jsx("button",{type:"button",onClick:()=>le(void 0),"aria-label":"Dismiss notice",children:"×"})]}),a.jsx(Xp,{open:pe,connected:O===!0,restoreFocus:Yn.current,fallbackFocus:gi,onClose:()=>Re(!1),onCreate:Rn}),de&&Ee&&a.jsx(Gp,{room:de,open:!0,connected:O===!0,capable:mt(de.state,O===!0).canEditSettings,restoreFocus:Er.current,onClose:()=>te(!1),onSave:x=>Tn(de.room_id,x)},de.room_id),de&&Ye&&a.jsx(Zp,{room:de,open:!0,connected:O===!0,capable:mt(de.state,O===!0).canClose,restoreFocus:Cr.current,onClose:()=>Ke(!1),onConfirm:()=>Tr(de.room_id)},`close:${de.room_id}`),de&&it&&a.jsx(bp,{room:de,open:!0,connected:O===!0,capable:mt(de.state,O===!0).canDelete,restoreFocus:Kn.current,onClose:()=>Te(!1),onConfirm:()=>Pr(de.room_id)},`delete:${de.room_id}`),ot[0]&&a.jsx(em,{vault:ot[0],connected:O===!0,canConfirm:x=>{const A=u.find(F=>F.room_id===x.room_id);return!!(A&&Uc(A,x))},onClose:()=>lt(x=>x.slice(1)),onConfirm:Nr})]})}function $c(i){const c=/^#\/rooms\/([^/?#]+)$/.exec(i);if(c!=null&&c[1])try{return decodeURIComponent(c[1])}catch{return}}function Nm(i,c){return i.length===c.length&&i.every((u,g)=>JSON.stringify(u)===JSON.stringify(c[g]))}const Po={draft:"",pending:!1};function Rm(i){return i instanceof wt&&i.outcomeUnknown?`The message request did not receive a confirmation, so its outcome is unknown. Your draft is retained. ${i.message}`:i instanceof Error?i.message:"Message send failed."}function Tm(i){return i==="live"||i==="replacement_required"||i==="receipt_pending"}function Uc(i,c){if(!mt(i.state,!0).canRecoverInvite||c.recovery_of===void 0)return!1;const u=i.invites.find(m=>m.invite_id===c.recovery_of);if(!u||u.mode!==c.invite.mode||u.role!==c.invite.role||u.min_accepts!==c.invite.min_accepts)return!1;const g=i.invites.find(m=>m.invite_id===c.invite.invite_id);return g?g.recovery_of!==u.invite_id||g.mode!==u.mode||g.role!==u.role||g.min_accepts!==u.min_accepts?!1:g.state==="receipt_pending"?u.state==="replacement_required"&&g.recovery_confirmed===!1&&g.accepted_cids.length===0:u.state==="revoked"&&g.recovery_confirmed===!0&&(g.state==="live"||g.state==="consumed"||g.state==="replacement_required"||g.state==="revoked"):u.state==="replacement_required"}function Bc(i){const c=k.useMemo(()=>typeof window.matchMedia=="function"?window.matchMedia(i):void 0,[i]),[u,g]=k.useState(()=>(c==null?void 0:c.matches)??!1);return k.useEffect(()=>{if(!c)return;const m=y=>g(y.matches);return g(c.matches),c.addEventListener("change",m),()=>c.removeEventListener("change",m)},[c]),u}const ed=document.getElementById("root");if(!ed)throw new Error("missing root element");op.createRoot(ed).render(a.jsx(k.StrictMode,{children:a.jsx(jm,{})}));
|
|
40
|
+
`+l.stack}return{value:e,source:t,stack:o,digest:null}}function Bl(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Vl(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Ef=typeof WeakMap=="function"?WeakMap:Map;function xu(e,t,n){n=bt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ho||(ho=!0,rs=r),Vl(e,t)},n}function Su(e,t,n){n=bt(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Vl(e,t)}}var l=e.stateNode;return l!==null&&typeof l.componentDidCatch=="function"&&(n.callback=function(){Vl(e,t),typeof r!="function"&&(_n===null?_n=new Set([this]):_n.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function ku(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ef;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=Af.bind(null,e,t,n),t.then(e,e))}function Eu(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Cu(e,t,n,r,o){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=bt(-1,1),t.tag=2,yn(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var Cf=ge.ReactCurrentOwner,ct=!1;function nt(e,t,n,r){t.child=e===null?Wa(t,null,n,r):cr(t,e.child,n,r)}function ju(e,t,n,r,o){n=n.render;var l=t.ref;return fr(t,o),r=Ol(e,t,n,r,l,o),n=Ml(),e!==null&&!ct?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Jt(e,t,o)):(Pe&&n&&vl(t),t.flags|=1,nt(e,t,r,o),t.child)}function Nu(e,t,n,r,o){if(e===null){var l=n.type;return typeof l=="function"&&!cs(l)&&l.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=l,Ru(e,t,l,r,o)):(e=xo(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(l=e.child,(e.lanes&o)===0){var s=l.memoizedProps;if(n=n.compare,n=n!==null?n:Wr,n(s,r)&&e.ref===t.ref)return Jt(e,t,o)}return t.flags|=1,e=kn(l,r),e.ref=t.ref,e.return=t,t.child=e}function Ru(e,t,n,r,o){if(e!==null){var l=e.memoizedProps;if(Wr(l,r)&&e.ref===t.ref)if(ct=!1,t.pendingProps=r=l,(e.lanes&o)!==0)(e.flags&131072)!==0&&(ct=!0);else return t.lanes=e.lanes,Jt(e,t,o)}return Hl(e,t,n,r,o)}function Tu(e,t,n){var r=t.pendingProps,o=r.children,l=e!==null?e.memoizedState:null;if(r.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ke(vr,_t),_t|=n;else{if((n&1073741824)===0)return e=l!==null?l.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ke(vr,_t),_t|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=l!==null?l.baseLanes:n,ke(vr,_t),_t|=r}else l!==null?(r=l.baseLanes|n,t.memoizedState=null):r=n,ke(vr,_t),_t|=r;return nt(e,t,o,n),t.child}function Pu(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Hl(e,t,n,r,o){var l=ut(n)?Ln:Ge.current;return l=lr(t,l),fr(t,o),n=Ol(e,t,n,r,l,o),r=Ml(),e!==null&&!ct?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Jt(e,t,o)):(Pe&&r&&vl(t),t.flags|=1,nt(e,t,n,o),t.child)}function zu(e,t,n,r,o){if(ut(n)){var l=!0;Wi(t)}else l=!1;if(fr(t,o),t.stateNode===null)uo(e,t),_u(t,n,r),Ul(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,d=t.memoizedProps;s.props=d;var f=s.context,w=n.contextType;typeof w=="object"&&w!==null?w=Et(w):(w=ut(n)?Ln:Ge.current,w=lr(t,w));var T=n.getDerivedStateFromProps,P=typeof T=="function"||typeof s.getSnapshotBeforeUpdate=="function";P||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(d!==r||f!==w)&&wu(t,s,r,w),vn=!1;var R=t.memoizedState;s.state=R,eo(t,r,s,o),f=t.memoizedState,d!==r||R!==f||at.current||vn?(typeof T=="function"&&($l(t,n,T,r),f=t.memoizedState),(d=vn||gu(t,n,d,r,R,f,w))?(P||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=f),s.props=r,s.state=f,s.context=w,r=d):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,Ya(e,t),d=t.memoizedProps,w=t.type===t.elementType?d:Mt(t.type,d),s.props=w,P=t.pendingProps,R=s.context,f=n.contextType,typeof f=="object"&&f!==null?f=Et(f):(f=ut(n)?Ln:Ge.current,f=lr(t,f));var B=n.getDerivedStateFromProps;(T=typeof B=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(d!==P||R!==f)&&wu(t,s,r,f),vn=!1,R=t.memoizedState,s.state=R,eo(t,r,s,o);var q=t.memoizedState;d!==P||R!==q||at.current||vn?(typeof B=="function"&&($l(t,n,B,r),q=t.memoizedState),(w=vn||gu(t,n,w,r,R,q,f)||!1)?(T||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,q,f),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,q,f)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||d===e.memoizedProps&&R===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&R===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=q),s.props=r,s.state=q,s.context=f,r=w):(typeof s.componentDidUpdate!="function"||d===e.memoizedProps&&R===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&R===e.memoizedState||(t.flags|=1024),r=!1)}return ql(e,t,n,r,l,o)}function ql(e,t,n,r,o,l){Pu(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&Ia(t,n,!1),Jt(e,t,l);r=t.stateNode,Cf.current=t;var d=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=cr(t,e.child,null,l),t.child=cr(t,null,d,l)):nt(e,t,d,l),t.memoizedState=r.state,o&&Ia(t,n,!0),t.child}function Lu(e){var t=e.stateNode;t.pendingContext?Ma(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ma(e,t.context,!1),Nl(e,t.containerInfo)}function Ou(e,t,n,r,o){return ur(),wl(o),t.flags|=256,nt(e,t,n,r),t.child}var Wl={dehydrated:null,treeContext:null,retryLane:0};function Ql(e){return{baseLanes:e,cachePool:null,transitions:null}}function Mu(e,t,n){var r=t.pendingProps,o=ze.current,l=!1,s=(t.flags&128)!==0,d;if((d=s)||(d=e!==null&&e.memoizedState===null?!1:(o&2)!==0),d?(l=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),ke(ze,o&1),e===null)return _l(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(s=r.children,e=r.fallback,l?(r=t.mode,l=t.child,s={mode:"hidden",children:s},(r&1)===0&&l!==null?(l.childLanes=0,l.pendingProps=s):l=So(s,r,0,null),e=Vn(e,r,n,null),l.return=t,e.return=t,l.sibling=e,t.child=l,t.child.memoizedState=Ql(n),t.memoizedState=Wl,e):Yl(t,s));if(o=e.memoizedState,o!==null&&(d=o.dehydrated,d!==null))return jf(e,t,s,r,d,o,n);if(l){l=r.fallback,s=t.mode,o=e.child,d=o.sibling;var f={mode:"hidden",children:r.children};return(s&1)===0&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=f,t.deletions=null):(r=kn(o,f),r.subtreeFlags=o.subtreeFlags&14680064),d!==null?l=kn(d,l):(l=Vn(l,s,n,null),l.flags|=2),l.return=t,r.return=t,r.sibling=l,t.child=r,r=l,l=t.child,s=e.child.memoizedState,s=s===null?Ql(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},l.memoizedState=s,l.childLanes=e.childLanes&~n,t.memoizedState=Wl,r}return l=e.child,e=l.sibling,r=kn(l,{mode:"visible",children:r.children}),(t.mode&1)===0&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Yl(e,t){return t=So({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ao(e,t,n,r){return r!==null&&wl(r),cr(t,e.child,null,n),e=Yl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function jf(e,t,n,r,o,l,s){if(n)return t.flags&256?(t.flags&=-257,r=Bl(Error(u(422))),ao(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(l=r.fallback,o=t.mode,r=So({mode:"visible",children:r.children},o,0,null),l=Vn(l,o,s,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,(t.mode&1)!==0&&cr(t,e.child,null,s),t.child.memoizedState=Ql(s),t.memoizedState=Wl,l);if((t.mode&1)===0)return ao(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var d=r.dgst;return r=d,l=Error(u(419)),r=Bl(l,r,void 0),ao(e,t,s,r)}if(d=(s&e.childLanes)!==0,ct||d){if(r=Ve,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=(o&(r.suspendedLanes|s))!==0?0:o,o!==0&&o!==l.retryLane&&(l.retryLane=o,Zt(e,o),Ft(r,e,o,-1))}return us(),r=Bl(Error(u(421))),ao(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=$f.bind(null,e),o._reactRetry=t,null):(e=l.treeContext,gt=fn(o.nextSibling),yt=t,Pe=!0,Ot=null,e!==null&&(St[kt++]=Xt,St[kt++]=Gt,St[kt++]=On,Xt=e.id,Gt=e.overflow,On=t),t=Yl(t,r.children),t.flags|=4096,t)}function Du(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),El(e.return,t,n)}function Kl(e,t,n,r,o){var l=e.memoizedState;l===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(l.isBackwards=t,l.rendering=null,l.renderingStartTime=0,l.last=r,l.tail=n,l.tailMode=o)}function Iu(e,t,n){var r=t.pendingProps,o=r.revealOrder,l=r.tail;if(nt(e,t,r.children,n),r=ze.current,(r&2)!==0)r=r&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Du(e,n,t);else if(e.tag===19)Du(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ke(ze,r),(t.mode&1)===0)t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&to(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Kl(t,!1,o,n,l);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&to(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Kl(t,!0,n,null,l);break;case"together":Kl(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function uo(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Jt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),An|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,n=kn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=kn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Nf(e,t,n){switch(t.tag){case 3:Lu(t),ur();break;case 5:Ga(t);break;case 1:ut(t.type)&&Wi(t);break;case 4:Nl(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;ke(Zi,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ke(ze,ze.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?Mu(e,t,n):(ke(ze,ze.current&1),e=Jt(e,t,n),e!==null?e.sibling:null);ke(ze,ze.current&1);break;case 19:if(r=(n&t.childLanes)!==0,(e.flags&128)!==0){if(r)return Iu(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ke(ze,ze.current),r)break;return null;case 22:case 23:return t.lanes=0,Tu(e,t,n)}return Jt(e,t,n)}var Fu,Xl,Au,$u;Fu=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Xl=function(){},Au=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,In(Bt.current);var l=null;switch(n){case"input":o=Yn(e,o),r=Yn(e,r),l=[];break;case"select":o=V({},o,{value:void 0}),r=V({},r,{value:void 0}),l=[];break;case"textarea":o=tn(e,o),r=tn(e,r),l=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Vi)}Nr(n,r);var s;n=null;for(w in o)if(!r.hasOwnProperty(w)&&o.hasOwnProperty(w)&&o[w]!=null)if(w==="style"){var d=o[w];for(s in d)d.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else w!=="dangerouslySetInnerHTML"&&w!=="children"&&w!=="suppressContentEditableWarning"&&w!=="suppressHydrationWarning"&&w!=="autoFocus"&&(m.hasOwnProperty(w)?l||(l=[]):(l=l||[]).push(w,null));for(w in r){var f=r[w];if(d=o!=null?o[w]:void 0,r.hasOwnProperty(w)&&f!==d&&(f!=null||d!=null))if(w==="style")if(d){for(s in d)!d.hasOwnProperty(s)||f&&f.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in f)f.hasOwnProperty(s)&&d[s]!==f[s]&&(n||(n={}),n[s]=f[s])}else n||(l||(l=[]),l.push(w,n)),n=f;else w==="dangerouslySetInnerHTML"?(f=f?f.__html:void 0,d=d?d.__html:void 0,f!=null&&d!==f&&(l=l||[]).push(w,f)):w==="children"?typeof f!="string"&&typeof f!="number"||(l=l||[]).push(w,""+f):w!=="suppressContentEditableWarning"&&w!=="suppressHydrationWarning"&&(m.hasOwnProperty(w)?(f!=null&&w==="onScroll"&&je("scroll",e),l||d===f||(l=[])):(l=l||[]).push(w,f))}n&&(l=l||[]).push("style",n);var w=l;(t.updateQueue=w)&&(t.flags|=4)}},$u=function(e,t,n,r){n!==r&&(t.flags|=4)};function li(e,t){if(!Pe)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function be(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Rf(e,t,n){var r=t.pendingProps;switch(yl(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return be(t),null;case 1:return ut(t.type)&&qi(),be(t),null;case 3:return r=t.stateNode,pr(),Ne(at),Ne(Ge),Pl(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Xi(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ot!==null&&(ls(Ot),Ot=null))),Xl(e,t),be(t),null;case 5:Rl(t);var o=In(ti.current);if(n=t.type,e!==null&&t.stateNode!=null)Au(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(u(166));return be(t),null}if(e=In(Bt.current),Xi(t)){r=t.stateNode,n=t.type;var l=t.memoizedProps;switch(r[Ut]=t,r[Gr]=l,e=(t.mode&1)!==0,n){case"dialog":je("cancel",r),je("close",r);break;case"iframe":case"object":case"embed":je("load",r);break;case"video":case"audio":for(o=0;o<Yr.length;o++)je(Yr[o],r);break;case"source":je("error",r);break;case"img":case"image":case"link":je("error",r),je("load",r);break;case"details":je("toggle",r);break;case"input":Er(r,l),je("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!l.multiple},je("invalid",r);break;case"textarea":Wt(r,l),je("invalid",r)}Nr(n,l),o=null;for(var s in l)if(l.hasOwnProperty(s)){var d=l[s];s==="children"?typeof d=="string"?r.textContent!==d&&(l.suppressHydrationWarning!==!0&&Bi(r.textContent,d,e),o=["children",d]):typeof d=="number"&&r.textContent!==""+d&&(l.suppressHydrationWarning!==!0&&Bi(r.textContent,d,e),o=["children",""+d]):m.hasOwnProperty(s)&&d!=null&&s==="onScroll"&&je("scroll",r)}switch(n){case"input":tt(r),jr(r,l,!0);break;case"textarea":tt(r),gi(r);break;case"select":case"option":break;default:typeof l.onClick=="function"&&(r.onclick=Vi)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Se(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Ut]=t,e[Gr]=r,Fu(e,t,!1,!1),t.stateNode=e;e:{switch(s=Rr(n,r),n){case"dialog":je("cancel",e),je("close",e),o=r;break;case"iframe":case"object":case"embed":je("load",e),o=r;break;case"video":case"audio":for(o=0;o<Yr.length;o++)je(Yr[o],e);o=r;break;case"source":je("error",e),o=r;break;case"img":case"image":case"link":je("error",e),je("load",e),o=r;break;case"details":je("toggle",e),o=r;break;case"input":Er(e,r),o=Yn(e,r),je("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=V({},r,{value:void 0}),je("invalid",e);break;case"textarea":Wt(e,r),o=tn(e,r),je("invalid",e);break;default:o=r}Nr(n,o),d=o;for(l in d)if(d.hasOwnProperty(l)){var f=d[l];l==="style"?wi(e,f):l==="dangerouslySetInnerHTML"?(f=f?f.__html:void 0,f!=null&&qe(e,f)):l==="children"?typeof f=="string"?(n!=="textarea"||f!=="")&&Rn(e,f):typeof f=="number"&&Rn(e,""+f):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(m.hasOwnProperty(l)?f!=null&&l==="onScroll"&&je("scroll",e):f!=null&&le(e,l,f,s))}switch(n){case"input":tt(e),jr(e,r,!1);break;case"textarea":tt(e),gi(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ue(r.value));break;case"select":e.multiple=!!r.multiple,l=r.value,l!=null?Pt(e,!!r.multiple,l,!1):r.defaultValue!=null&&Pt(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Vi)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return be(t),null;case 6:if(e&&t.stateNode!=null)$u(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(u(166));if(n=In(ti.current),In(Bt.current),Xi(t)){if(r=t.stateNode,n=t.memoizedProps,r[Ut]=t,(l=r.nodeValue!==n)&&(e=yt,e!==null))switch(e.tag){case 3:Bi(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Bi(r.nodeValue,n,(e.mode&1)!==0)}l&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Ut]=t,t.stateNode=r}return be(t),null;case 13:if(Ne(ze),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Pe&>!==null&&(t.mode&1)!==0&&(t.flags&128)===0)Va(),ur(),t.flags|=98560,l=!1;else if(l=Xi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!l)throw Error(u(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(u(317));l[Ut]=t}else ur(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;be(t),l=!1}else Ot!==null&&(ls(Ot),Ot=null),l=!0;if(!l)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(ze.current&1)!==0?Ue===0&&(Ue=3):us())),t.updateQueue!==null&&(t.flags|=4),be(t),null);case 4:return pr(),Xl(e,t),e===null&&Kr(t.stateNode.containerInfo),be(t),null;case 10:return kl(t.type._context),be(t),null;case 17:return ut(t.type)&&qi(),be(t),null;case 19:if(Ne(ze),l=t.memoizedState,l===null)return be(t),null;if(r=(t.flags&128)!==0,s=l.rendering,s===null)if(r)li(l,!1);else{if(Ue!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=to(e),s!==null){for(t.flags|=128,li(l,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)l=n,e=r,l.flags&=14680066,s=l.alternate,s===null?(l.childLanes=0,l.lanes=e,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=s.childLanes,l.lanes=s.lanes,l.child=s.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=s.memoizedProps,l.memoizedState=s.memoizedState,l.updateQueue=s.updateQueue,l.type=s.type,e=s.dependencies,l.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ke(ze,ze.current&1|2),t.child}e=e.sibling}l.tail!==null&&Me()>yr&&(t.flags|=128,r=!0,li(l,!1),t.lanes=4194304)}else{if(!r)if(e=to(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),li(l,!0),l.tail===null&&l.tailMode==="hidden"&&!s.alternate&&!Pe)return be(t),null}else 2*Me()-l.renderingStartTime>yr&&n!==1073741824&&(t.flags|=128,r=!0,li(l,!1),t.lanes=4194304);l.isBackwards?(s.sibling=t.child,t.child=s):(n=l.last,n!==null?n.sibling=s:t.child=s,l.last=s)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=Me(),t.sibling=null,n=ze.current,ke(ze,r?n&1|2:n&1),t):(be(t),null);case 22:case 23:return as(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(_t&1073741824)!==0&&(be(t),t.subtreeFlags&6&&(t.flags|=8192)):be(t),null;case 24:return null;case 25:return null}throw Error(u(156,t.tag))}function Tf(e,t){switch(yl(t),t.tag){case 1:return ut(t.type)&&qi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return pr(),Ne(at),Ne(Ge),Pl(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Rl(t),null;case 13:if(Ne(ze),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));ur()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ne(ze),null;case 4:return pr(),null;case 10:return kl(t.type._context),null;case 22:case 23:return as(),null;case 24:return null;default:return null}}var co=!1,Je=!1,Pf=typeof WeakSet=="function"?WeakSet:Set,H=null;function hr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Oe(e,t,r)}else n.current=null}function Gl(e,t,n){try{n()}catch(r){Oe(e,t,r)}}var Uu=!1;function zf(e,t){if(al=Pi,e=ga(),el(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,l=r.focusNode;r=r.focusOffset;try{n.nodeType,l.nodeType}catch{n=null;break e}var s=0,d=-1,f=-1,w=0,T=0,P=e,R=null;t:for(;;){for(var B;P!==n||o!==0&&P.nodeType!==3||(d=s+o),P!==l||r!==0&&P.nodeType!==3||(f=s+r),P.nodeType===3&&(s+=P.nodeValue.length),(B=P.firstChild)!==null;)R=P,P=B;for(;;){if(P===e)break t;if(R===n&&++w===o&&(d=s),R===l&&++T===r&&(f=s),(B=P.nextSibling)!==null)break;P=R,R=P.parentNode}P=B}n=d===-1||f===-1?null:{start:d,end:f}}else n=null}n=n||{start:0,end:0}}else n=null;for(ul={focusedElem:e,selectionRange:n},Pi=!1,H=t;H!==null;)if(t=H,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,H=e;else for(;H!==null;){t=H;try{var q=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(q!==null){var Q=q.memoizedProps,De=q.memoizedState,v=t.stateNode,p=v.getSnapshotBeforeUpdate(t.elementType===t.type?Q:Mt(t.type,Q),De);v.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var _=t.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(u(163))}}catch(M){Oe(t,t.return,M)}if(e=t.sibling,e!==null){e.return=t.return,H=e;break}H=t.return}return q=Uu,Uu=!1,q}function si(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var l=o.destroy;o.destroy=void 0,l!==void 0&&Gl(t,n,l)}o=o.next}while(o!==r)}}function fo(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Zl(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Bu(e){var t=e.alternate;t!==null&&(e.alternate=null,Bu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ut],delete t[Gr],delete t[pl],delete t[pf],delete t[mf])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Vu(e){return e.tag===5||e.tag===3||e.tag===4}function Hu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Vu(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function bl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Vi));else if(r!==4&&(e=e.child,e!==null))for(bl(e,t,n),e=e.sibling;e!==null;)bl(e,t,n),e=e.sibling}function Jl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Jl(e,t,n),e=e.sibling;e!==null;)Jl(e,t,n),e=e.sibling}var We=null,Dt=!1;function gn(e,t,n){for(n=n.child;n!==null;)qu(e,t,n),n=n.sibling}function qu(e,t,n){if($t&&typeof $t.onCommitFiberUnmount=="function")try{$t.onCommitFiberUnmount(Ei,n)}catch{}switch(n.tag){case 5:Je||hr(n,t);case 6:var r=We,o=Dt;We=null,gn(e,t,n),We=r,Dt=o,We!==null&&(Dt?(e=We,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):We.removeChild(n.stateNode));break;case 18:We!==null&&(Dt?(e=We,n=n.stateNode,e.nodeType===8?fl(e.parentNode,n):e.nodeType===1&&fl(e,n),$r(e)):fl(We,n.stateNode));break;case 4:r=We,o=Dt,We=n.stateNode.containerInfo,Dt=!0,gn(e,t,n),We=r,Dt=o;break;case 0:case 11:case 14:case 15:if(!Je&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var l=o,s=l.destroy;l=l.tag,s!==void 0&&((l&2)!==0||(l&4)!==0)&&Gl(n,t,s),o=o.next}while(o!==r)}gn(e,t,n);break;case 1:if(!Je&&(hr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(d){Oe(n,t,d)}gn(e,t,n);break;case 21:gn(e,t,n);break;case 22:n.mode&1?(Je=(r=Je)||n.memoizedState!==null,gn(e,t,n),Je=r):gn(e,t,n);break;default:gn(e,t,n)}}function Wu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Pf),t.forEach(function(r){var o=Uf.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function It(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var l=e,s=t,d=s;e:for(;d!==null;){switch(d.tag){case 5:We=d.stateNode,Dt=!1;break e;case 3:We=d.stateNode.containerInfo,Dt=!0;break e;case 4:We=d.stateNode.containerInfo,Dt=!0;break e}d=d.return}if(We===null)throw Error(u(160));qu(l,s,o),We=null,Dt=!1;var f=o.alternate;f!==null&&(f.return=null),o.return=null}catch(w){Oe(o,t,w)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Qu(t,e),t=t.sibling}function Qu(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(It(t,e),Ht(e),r&4){try{si(3,e,e.return),fo(3,e)}catch(Q){Oe(e,e.return,Q)}try{si(5,e,e.return)}catch(Q){Oe(e,e.return,Q)}}break;case 1:It(t,e),Ht(e),r&512&&n!==null&&hr(n,n.return);break;case 5:if(It(t,e),Ht(e),r&512&&n!==null&&hr(n,n.return),e.flags&32){var o=e.stateNode;try{Rn(o,"")}catch(Q){Oe(e,e.return,Q)}}if(r&4&&(o=e.stateNode,o!=null)){var l=e.memoizedProps,s=n!==null?n.memoizedProps:l,d=e.type,f=e.updateQueue;if(e.updateQueue=null,f!==null)try{d==="input"&&l.type==="radio"&&l.name!=null&&Cr(o,l),Rr(d,s);var w=Rr(d,l);for(s=0;s<f.length;s+=2){var T=f[s],P=f[s+1];T==="style"?wi(o,P):T==="dangerouslySetInnerHTML"?qe(o,P):T==="children"?Rn(o,P):le(o,T,P,w)}switch(d){case"input":Kn(o,l);break;case"textarea":Nn(o,l);break;case"select":var R=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!l.multiple;var B=l.value;B!=null?Pt(o,!!l.multiple,B,!1):R!==!!l.multiple&&(l.defaultValue!=null?Pt(o,!!l.multiple,l.defaultValue,!0):Pt(o,!!l.multiple,l.multiple?[]:"",!1))}o[Gr]=l}catch(Q){Oe(e,e.return,Q)}}break;case 6:if(It(t,e),Ht(e),r&4){if(e.stateNode===null)throw Error(u(162));o=e.stateNode,l=e.memoizedProps;try{o.nodeValue=l}catch(Q){Oe(e,e.return,Q)}}break;case 3:if(It(t,e),Ht(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{$r(t.containerInfo)}catch(Q){Oe(e,e.return,Q)}break;case 4:It(t,e),Ht(e);break;case 13:It(t,e),Ht(e),o=e.child,o.flags&8192&&(l=o.memoizedState!==null,o.stateNode.isHidden=l,!l||o.alternate!==null&&o.alternate.memoizedState!==null||(ns=Me())),r&4&&Wu(e);break;case 22:if(T=n!==null&&n.memoizedState!==null,e.mode&1?(Je=(w=Je)||T,It(t,e),Je=w):It(t,e),Ht(e),r&8192){if(w=e.memoizedState!==null,(e.stateNode.isHidden=w)&&!T&&(e.mode&1)!==0)for(H=e,T=e.child;T!==null;){for(P=H=T;H!==null;){switch(R=H,B=R.child,R.tag){case 0:case 11:case 14:case 15:si(4,R,R.return);break;case 1:hr(R,R.return);var q=R.stateNode;if(typeof q.componentWillUnmount=="function"){r=R,n=R.return;try{t=r,q.props=t.memoizedProps,q.state=t.memoizedState,q.componentWillUnmount()}catch(Q){Oe(r,n,Q)}}break;case 5:hr(R,R.return);break;case 22:if(R.memoizedState!==null){Xu(P);continue}}B!==null?(B.return=R,H=B):Xu(P)}T=T.sibling}e:for(T=null,P=e;;){if(P.tag===5){if(T===null){T=P;try{o=P.stateNode,w?(l=o.style,typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"):(d=P.stateNode,f=P.memoizedProps.style,s=f!=null&&f.hasOwnProperty("display")?f.display:null,d.style.display=_i("display",s))}catch(Q){Oe(e,e.return,Q)}}}else if(P.tag===6){if(T===null)try{P.stateNode.nodeValue=w?"":P.memoizedProps}catch(Q){Oe(e,e.return,Q)}}else if((P.tag!==22&&P.tag!==23||P.memoizedState===null||P===e)&&P.child!==null){P.child.return=P,P=P.child;continue}if(P===e)break e;for(;P.sibling===null;){if(P.return===null||P.return===e)break e;T===P&&(T=null),P=P.return}T===P&&(T=null),P.sibling.return=P.return,P=P.sibling}}break;case 19:It(t,e),Ht(e),r&4&&Wu(e);break;case 21:break;default:It(t,e),Ht(e)}}function Ht(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Vu(n)){var r=n;break e}n=n.return}throw Error(u(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Rn(o,""),r.flags&=-33);var l=Hu(e);Jl(e,l,o);break;case 3:case 4:var s=r.stateNode.containerInfo,d=Hu(e);bl(e,d,s);break;default:throw Error(u(161))}}catch(f){Oe(e,e.return,f)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Lf(e,t,n){H=e,Yu(e)}function Yu(e,t,n){for(var r=(e.mode&1)!==0;H!==null;){var o=H,l=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||co;if(!s){var d=o.alternate,f=d!==null&&d.memoizedState!==null||Je;d=co;var w=Je;if(co=s,(Je=f)&&!w)for(H=o;H!==null;)s=H,f=s.child,s.tag===22&&s.memoizedState!==null?Gu(o):f!==null?(f.return=s,H=f):Gu(o);for(;l!==null;)H=l,Yu(l),l=l.sibling;H=o,co=d,Je=w}Ku(e)}else(o.subtreeFlags&8772)!==0&&l!==null?(l.return=o,H=l):Ku(e)}}function Ku(e){for(;H!==null;){var t=H;if((t.flags&8772)!==0){var n=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:Je||fo(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Je)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:Mt(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var l=t.updateQueue;l!==null&&Xa(t,l,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Xa(t,s,n)}break;case 5:var d=t.stateNode;if(n===null&&t.flags&4){n=d;var f=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":f.autoFocus&&n.focus();break;case"img":f.src&&(n.src=f.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var w=t.alternate;if(w!==null){var T=w.memoizedState;if(T!==null){var P=T.dehydrated;P!==null&&$r(P)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(u(163))}Je||t.flags&512&&Zl(t)}catch(R){Oe(t,t.return,R)}}if(t===e){H=null;break}if(n=t.sibling,n!==null){n.return=t.return,H=n;break}H=t.return}}function Xu(e){for(;H!==null;){var t=H;if(t===e){H=null;break}var n=t.sibling;if(n!==null){n.return=t.return,H=n;break}H=t.return}}function Gu(e){for(;H!==null;){var t=H;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{fo(4,t)}catch(f){Oe(t,n,f)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(f){Oe(t,o,f)}}var l=t.return;try{Zl(t)}catch(f){Oe(t,l,f)}break;case 5:var s=t.return;try{Zl(t)}catch(f){Oe(t,s,f)}}}catch(f){Oe(t,t.return,f)}if(t===e){H=null;break}var d=t.sibling;if(d!==null){d.return=t.return,H=d;break}H=t.return}}var Of=Math.ceil,po=ge.ReactCurrentDispatcher,es=ge.ReactCurrentOwner,jt=ge.ReactCurrentBatchConfig,ve=0,Ve=null,Fe=null,Qe=0,_t=0,vr=pn(0),Ue=0,ai=null,An=0,mo=0,ts=0,ui=null,dt=null,ns=0,yr=1/0,en=null,ho=!1,rs=null,_n=null,vo=!1,wn=null,yo=0,ci=0,is=null,go=-1,_o=0;function rt(){return(ve&6)!==0?Me():go!==-1?go:go=Me()}function xn(e){return(e.mode&1)===0?1:(ve&2)!==0&&Qe!==0?Qe&-Qe:vf.transition!==null?(_o===0&&(_o=Hs()),_o):(e=we,e!==0||(e=window.event,e=e===void 0?16:bs(e.type)),e)}function Ft(e,t,n,r){if(50<ci)throw ci=0,is=null,Error(u(185));Mr(e,n,r),((ve&2)===0||e!==Ve)&&(e===Ve&&((ve&2)===0&&(mo|=n),Ue===4&&Sn(e,Qe)),ft(e,r),n===1&&ve===0&&(t.mode&1)===0&&(yr=Me()+500,Qi&&hn()))}function ft(e,t){var n=e.callbackNode;hd(e,t);var r=Ni(e,e===Ve?Qe:0);if(r===0)n!==null&&Us(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Us(n),t===1)e.tag===0?hf(bu.bind(null,e)):Fa(bu.bind(null,e)),df(function(){(ve&6)===0&&hn()}),n=null;else{switch(qs(r)){case 1:n=Fo;break;case 4:n=Bs;break;case 16:n=ki;break;case 536870912:n=Vs;break;default:n=ki}n=lc(n,Zu.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Zu(e,t){if(go=-1,_o=0,(ve&6)!==0)throw Error(u(327));var n=e.callbackNode;if(gr()&&e.callbackNode!==n)return null;var r=Ni(e,e===Ve?Qe:0);if(r===0)return null;if((r&30)!==0||(r&e.expiredLanes)!==0||t)t=wo(e,r);else{t=r;var o=ve;ve|=2;var l=ec();(Ve!==e||Qe!==t)&&(en=null,yr=Me()+500,Un(e,t));do try{If();break}catch(d){Ju(e,d)}while(!0);Sl(),po.current=l,ve=o,Fe!==null?t=0:(Ve=null,Qe=0,t=Ue)}if(t!==0){if(t===2&&(o=Ao(e),o!==0&&(r=o,t=os(e,o))),t===1)throw n=ai,Un(e,0),Sn(e,r),ft(e,Me()),n;if(t===6)Sn(e,r);else{if(o=e.current.alternate,(r&30)===0&&!Mf(o)&&(t=wo(e,r),t===2&&(l=Ao(e),l!==0&&(r=l,t=os(e,l))),t===1))throw n=ai,Un(e,0),Sn(e,r),ft(e,Me()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(u(345));case 2:Bn(e,dt,en);break;case 3:if(Sn(e,r),(r&130023424)===r&&(t=ns+500-Me(),10<t)){if(Ni(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){rt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=dl(Bn.bind(null,e,dt,en),t);break}Bn(e,dt,en);break;case 4:if(Sn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-zt(r);l=1<<s,s=t[s],s>o&&(o=s),r&=~l}if(r=o,r=Me()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Of(r/1960))-r,10<r){e.timeoutHandle=dl(Bn.bind(null,e,dt,en),r);break}Bn(e,dt,en);break;case 5:Bn(e,dt,en);break;default:throw Error(u(329))}}}return ft(e,Me()),e.callbackNode===n?Zu.bind(null,e):null}function os(e,t){var n=ui;return e.current.memoizedState.isDehydrated&&(Un(e,t).flags|=256),e=wo(e,t),e!==2&&(t=dt,dt=n,t!==null&&ls(t)),e}function ls(e){dt===null?dt=e:dt.push.apply(dt,e)}function Mf(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],l=o.getSnapshot;o=o.value;try{if(!Lt(l(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Sn(e,t){for(t&=~ts,t&=~mo,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-zt(t),r=1<<n;e[n]=-1,t&=~r}}function bu(e){if((ve&6)!==0)throw Error(u(327));gr();var t=Ni(e,0);if((t&1)===0)return ft(e,Me()),null;var n=wo(e,t);if(e.tag!==0&&n===2){var r=Ao(e);r!==0&&(t=r,n=os(e,r))}if(n===1)throw n=ai,Un(e,0),Sn(e,t),ft(e,Me()),n;if(n===6)throw Error(u(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Bn(e,dt,en),ft(e,Me()),null}function ss(e,t){var n=ve;ve|=1;try{return e(t)}finally{ve=n,ve===0&&(yr=Me()+500,Qi&&hn())}}function $n(e){wn!==null&&wn.tag===0&&(ve&6)===0&&gr();var t=ve;ve|=1;var n=jt.transition,r=we;try{if(jt.transition=null,we=1,e)return e()}finally{we=r,jt.transition=n,ve=t,(ve&6)===0&&hn()}}function as(){_t=vr.current,Ne(vr)}function Un(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,cf(n)),Fe!==null)for(n=Fe.return;n!==null;){var r=n;switch(yl(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&qi();break;case 3:pr(),Ne(at),Ne(Ge),Pl();break;case 5:Rl(r);break;case 4:pr();break;case 13:Ne(ze);break;case 19:Ne(ze);break;case 10:kl(r.type._context);break;case 22:case 23:as()}n=n.return}if(Ve=e,Fe=e=kn(e.current,null),Qe=_t=t,Ue=0,ai=null,ts=mo=An=0,dt=ui=null,Dn!==null){for(t=0;t<Dn.length;t++)if(n=Dn[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,l=n.pending;if(l!==null){var s=l.next;l.next=o,r.next=s}n.pending=r}Dn=null}return e}function Ju(e,t){do{var n=Fe;try{if(Sl(),no.current=lo,ro){for(var r=Le.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}ro=!1}if(Fn=0,Be=$e=Le=null,ni=!1,ri=0,es.current=null,n===null||n.return===null){Ue=1,ai=t,Fe=null;break}e:{var l=e,s=n.return,d=n,f=t;if(t=Qe,d.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){var w=f,T=d,P=T.tag;if((T.mode&1)===0&&(P===0||P===11||P===15)){var R=T.alternate;R?(T.updateQueue=R.updateQueue,T.memoizedState=R.memoizedState,T.lanes=R.lanes):(T.updateQueue=null,T.memoizedState=null)}var B=Eu(s);if(B!==null){B.flags&=-257,Cu(B,s,d,l,t),B.mode&1&&ku(l,w,t),t=B,f=w;var q=t.updateQueue;if(q===null){var Q=new Set;Q.add(f),t.updateQueue=Q}else q.add(f);break e}else{if((t&1)===0){ku(l,w,t),us();break e}f=Error(u(426))}}else if(Pe&&d.mode&1){var De=Eu(s);if(De!==null){(De.flags&65536)===0&&(De.flags|=256),Cu(De,s,d,l,t),wl(mr(f,d));break e}}l=f=mr(f,d),Ue!==4&&(Ue=2),ui===null?ui=[l]:ui.push(l),l=s;do{switch(l.tag){case 3:l.flags|=65536,t&=-t,l.lanes|=t;var v=xu(l,f,t);Ka(l,v);break e;case 1:d=f;var p=l.type,_=l.stateNode;if((l.flags&128)===0&&(typeof p.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(_n===null||!_n.has(_)))){l.flags|=65536,t&=-t,l.lanes|=t;var M=Su(l,d,t);Ka(l,M);break e}}l=l.return}while(l!==null)}nc(n)}catch(K){t=K,Fe===n&&n!==null&&(Fe=n=n.return);continue}break}while(!0)}function ec(){var e=po.current;return po.current=lo,e===null?lo:e}function us(){(Ue===0||Ue===3||Ue===2)&&(Ue=4),Ve===null||(An&268435455)===0&&(mo&268435455)===0||Sn(Ve,Qe)}function wo(e,t){var n=ve;ve|=2;var r=ec();(Ve!==e||Qe!==t)&&(en=null,Un(e,t));do try{Df();break}catch(o){Ju(e,o)}while(!0);if(Sl(),ve=n,po.current=r,Fe!==null)throw Error(u(261));return Ve=null,Qe=0,Ue}function Df(){for(;Fe!==null;)tc(Fe)}function If(){for(;Fe!==null&&!ld();)tc(Fe)}function tc(e){var t=oc(e.alternate,e,_t);e.memoizedProps=e.pendingProps,t===null?nc(e):Fe=t,es.current=null}function nc(e){var t=e;do{var n=t.alternate;if(e=t.return,(t.flags&32768)===0){if(n=Rf(n,t,_t),n!==null){Fe=n;return}}else{if(n=Tf(n,t),n!==null){n.flags&=32767,Fe=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ue=6,Fe=null;return}}if(t=t.sibling,t!==null){Fe=t;return}Fe=t=e}while(t!==null);Ue===0&&(Ue=5)}function Bn(e,t,n){var r=we,o=jt.transition;try{jt.transition=null,we=1,Ff(e,t,n,r)}finally{jt.transition=o,we=r}return null}function Ff(e,t,n,r){do gr();while(wn!==null);if((ve&6)!==0)throw Error(u(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(u(177));e.callbackNode=null,e.callbackPriority=0;var l=n.lanes|n.childLanes;if(vd(e,l),e===Ve&&(Fe=Ve=null,Qe=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||vo||(vo=!0,lc(ki,function(){return gr(),null})),l=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||l){l=jt.transition,jt.transition=null;var s=we;we=1;var d=ve;ve|=4,es.current=null,zf(e,n),Qu(n,e),nf(ul),Pi=!!al,ul=al=null,e.current=n,Lf(n),sd(),ve=d,we=s,jt.transition=l}else e.current=n;if(vo&&(vo=!1,wn=e,yo=o),l=e.pendingLanes,l===0&&(_n=null),cd(n.stateNode),ft(e,Me()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(ho)throw ho=!1,e=rs,rs=null,e;return(yo&1)!==0&&e.tag!==0&&gr(),l=e.pendingLanes,(l&1)!==0?e===is?ci++:(ci=0,is=e):ci=0,hn(),null}function gr(){if(wn!==null){var e=qs(yo),t=jt.transition,n=we;try{if(jt.transition=null,we=16>e?16:e,wn===null)var r=!1;else{if(e=wn,wn=null,yo=0,(ve&6)!==0)throw Error(u(331));var o=ve;for(ve|=4,H=e.current;H!==null;){var l=H,s=l.child;if((H.flags&16)!==0){var d=l.deletions;if(d!==null){for(var f=0;f<d.length;f++){var w=d[f];for(H=w;H!==null;){var T=H;switch(T.tag){case 0:case 11:case 15:si(8,T,l)}var P=T.child;if(P!==null)P.return=T,H=P;else for(;H!==null;){T=H;var R=T.sibling,B=T.return;if(Bu(T),T===w){H=null;break}if(R!==null){R.return=B,H=R;break}H=B}}}var q=l.alternate;if(q!==null){var Q=q.child;if(Q!==null){q.child=null;do{var De=Q.sibling;Q.sibling=null,Q=De}while(Q!==null)}}H=l}}if((l.subtreeFlags&2064)!==0&&s!==null)s.return=l,H=s;else e:for(;H!==null;){if(l=H,(l.flags&2048)!==0)switch(l.tag){case 0:case 11:case 15:si(9,l,l.return)}var v=l.sibling;if(v!==null){v.return=l.return,H=v;break e}H=l.return}}var p=e.current;for(H=p;H!==null;){s=H;var _=s.child;if((s.subtreeFlags&2064)!==0&&_!==null)_.return=s,H=_;else e:for(s=p;H!==null;){if(d=H,(d.flags&2048)!==0)try{switch(d.tag){case 0:case 11:case 15:fo(9,d)}}catch(K){Oe(d,d.return,K)}if(d===s){H=null;break e}var M=d.sibling;if(M!==null){M.return=d.return,H=M;break e}H=d.return}}if(ve=o,hn(),$t&&typeof $t.onPostCommitFiberRoot=="function")try{$t.onPostCommitFiberRoot(Ei,e)}catch{}r=!0}return r}finally{we=n,jt.transition=t}}return!1}function rc(e,t,n){t=mr(n,t),t=xu(e,t,1),e=yn(e,t,1),t=rt(),e!==null&&(Mr(e,1,t),ft(e,t))}function Oe(e,t,n){if(e.tag===3)rc(e,e,n);else for(;t!==null;){if(t.tag===3){rc(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(_n===null||!_n.has(r))){e=mr(n,e),e=Su(t,e,1),t=yn(t,e,1),e=rt(),t!==null&&(Mr(t,1,e),ft(t,e));break}}t=t.return}}function Af(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=rt(),e.pingedLanes|=e.suspendedLanes&n,Ve===e&&(Qe&n)===n&&(Ue===4||Ue===3&&(Qe&130023424)===Qe&&500>Me()-ns?Un(e,0):ts|=n),ft(e,t)}function ic(e,t){t===0&&((e.mode&1)===0?t=1:(t=ji,ji<<=1,(ji&130023424)===0&&(ji=4194304)));var n=rt();e=Zt(e,t),e!==null&&(Mr(e,t,n),ft(e,n))}function $f(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ic(e,n)}function Uf(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(u(314))}r!==null&&r.delete(t),ic(e,n)}var oc;oc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||at.current)ct=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return ct=!1,Nf(e,t,n);ct=(e.flags&131072)!==0}else ct=!1,Pe&&(t.flags&1048576)!==0&&Aa(t,Ki,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;uo(e,t),e=t.pendingProps;var o=lr(t,Ge.current);fr(t,n),o=Ol(null,t,r,e,o,n);var l=Ml();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ut(r)?(l=!0,Wi(t)):l=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,jl(t),o.updater=so,t.stateNode=o,o._reactInternals=t,Ul(t,r,e,n),t=ql(null,t,r,!0,l,n)):(t.tag=0,Pe&&l&&vl(t),nt(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(uo(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Vf(r),e=Mt(r,e),o){case 0:t=Hl(null,t,r,e,n);break e;case 1:t=zu(null,t,r,e,n);break e;case 11:t=ju(null,t,r,e,n);break e;case 14:t=Nu(null,t,r,Mt(r.type,e),n);break e}throw Error(u(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Mt(r,o),Hl(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Mt(r,o),zu(e,t,r,o,n);case 3:e:{if(Lu(t),e===null)throw Error(u(387));r=t.pendingProps,l=t.memoizedState,o=l.element,Ya(e,t),eo(t,r,null,n);var s=t.memoizedState;if(r=s.element,l.isDehydrated)if(l={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=l,t.memoizedState=l,t.flags&256){o=mr(Error(u(423)),t),t=Ou(e,t,r,n,o);break e}else if(r!==o){o=mr(Error(u(424)),t),t=Ou(e,t,r,n,o);break e}else for(gt=fn(t.stateNode.containerInfo.firstChild),yt=t,Pe=!0,Ot=null,n=Wa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ur(),r===o){t=Jt(e,t,n);break e}nt(e,t,r,n)}t=t.child}return t;case 5:return Ga(t),e===null&&_l(t),r=t.type,o=t.pendingProps,l=e!==null?e.memoizedProps:null,s=o.children,cl(r,o)?s=null:l!==null&&cl(r,l)&&(t.flags|=32),Pu(e,t),nt(e,t,s,n),t.child;case 6:return e===null&&_l(t),null;case 13:return Mu(e,t,n);case 4:return Nl(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=cr(t,null,r,n):nt(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Mt(r,o),ju(e,t,r,o,n);case 7:return nt(e,t,t.pendingProps,n),t.child;case 8:return nt(e,t,t.pendingProps.children,n),t.child;case 12:return nt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,l=t.memoizedProps,s=o.value,ke(Zi,r._currentValue),r._currentValue=s,l!==null)if(Lt(l.value,s)){if(l.children===o.children&&!at.current){t=Jt(e,t,n);break e}}else for(l=t.child,l!==null&&(l.return=t);l!==null;){var d=l.dependencies;if(d!==null){s=l.child;for(var f=d.firstContext;f!==null;){if(f.context===r){if(l.tag===1){f=bt(-1,n&-n),f.tag=2;var w=l.updateQueue;if(w!==null){w=w.shared;var T=w.pending;T===null?f.next=f:(f.next=T.next,T.next=f),w.pending=f}}l.lanes|=n,f=l.alternate,f!==null&&(f.lanes|=n),El(l.return,n,t),d.lanes|=n;break}f=f.next}}else if(l.tag===10)s=l.type===t.type?null:l.child;else if(l.tag===18){if(s=l.return,s===null)throw Error(u(341));s.lanes|=n,d=s.alternate,d!==null&&(d.lanes|=n),El(s,n,t),s=l.sibling}else s=l.child;if(s!==null)s.return=l;else for(s=l;s!==null;){if(s===t){s=null;break}if(l=s.sibling,l!==null){l.return=s.return,s=l;break}s=s.return}l=s}nt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,fr(t,n),o=Et(o),r=r(o),t.flags|=1,nt(e,t,r,n),t.child;case 14:return r=t.type,o=Mt(r,t.pendingProps),o=Mt(r.type,o),Nu(e,t,r,o,n);case 15:return Ru(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Mt(r,o),uo(e,t),t.tag=1,ut(r)?(e=!0,Wi(t)):e=!1,fr(t,n),_u(t,r,o),Ul(t,r,o,n),ql(null,t,r,!0,e,n);case 19:return Iu(e,t,n);case 22:return Tu(e,t,n)}throw Error(u(156,t.tag))};function lc(e,t){return $s(e,t)}function Bf(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Nt(e,t,n,r){return new Bf(e,t,n,r)}function cs(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Vf(e){if(typeof e=="function")return cs(e)?1:0;if(e!=null){if(e=e.$$typeof,e===it)return 11;if(e===lt)return 14}return 2}function kn(e,t){var n=e.alternate;return n===null?(n=Nt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function xo(e,t,n,r,o,l){var s=2;if(r=e,typeof e=="function")cs(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Re:return Vn(n.children,o,l,t);case Ee:s=8,o|=8;break;case te:return e=Nt(12,n,t,o|2),e.elementType=te,e.lanes=l,e;case Te:return e=Nt(13,n,t,o),e.elementType=Te,e.lanes=l,e;case ot:return e=Nt(19,n,t,o),e.elementType=ot,e.lanes=l,e;case Ce:return So(n,o,l,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ye:s=10;break e;case Ke:s=9;break e;case it:s=11;break e;case lt:s=14;break e;case Xe:s=16,r=null;break e}throw Error(u(130,e==null?e:typeof e,""))}return t=Nt(s,n,t,o),t.elementType=e,t.type=r,t.lanes=l,t}function Vn(e,t,n,r){return e=Nt(7,e,r,t),e.lanes=n,e}function So(e,t,n,r){return e=Nt(22,e,r,t),e.elementType=Ce,e.lanes=n,e.stateNode={isHidden:!1},e}function ds(e,t,n){return e=Nt(6,e,null,t),e.lanes=n,e}function fs(e,t,n){return t=Nt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Hf(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=$o(0),this.expirationTimes=$o(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$o(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function ps(e,t,n,r,o,l,s,d,f){return e=new Hf(e,t,n,d,f),t===1?(t=1,l===!0&&(t|=8)):t=0,l=Nt(3,null,null,t),e.current=l,l.stateNode=e,l.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},jl(l),e}function qf(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:pe,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function sc(e){if(!e)return mn;e=e._reactInternals;e:{if(Pn(e)!==e||e.tag!==1)throw Error(u(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(ut(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(u(171))}if(e.tag===1){var n=e.type;if(ut(n))return Da(e,n,t)}return t}function ac(e,t,n,r,o,l,s,d,f){return e=ps(n,r,!0,e,o,l,s,d,f),e.context=sc(null),n=e.current,r=rt(),o=xn(n),l=bt(r,o),l.callback=t??null,yn(n,l,o),e.current.lanes=o,Mr(e,o,r),ft(e,r),e}function ko(e,t,n,r){var o=t.current,l=rt(),s=xn(o);return n=sc(n),t.context===null?t.context=n:t.pendingContext=n,t=bt(l,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=yn(o,t,s),e!==null&&(Ft(e,o,s,l),Ji(e,o,s)),s}function Eo(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function uc(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ms(e,t){uc(e,t),(e=e.alternate)&&uc(e,t)}function Wf(){return null}var cc=typeof reportError=="function"?reportError:function(e){console.error(e)};function hs(e){this._internalRoot=e}Co.prototype.render=hs.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));ko(e,t,null,null)},Co.prototype.unmount=hs.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;$n(function(){ko(null,e,null,null)}),t[Yt]=null}};function Co(e){this._internalRoot=e}Co.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ys();e={blockedOn:null,target:e,priority:t};for(var n=0;n<un.length&&t!==0&&t<un[n].priority;n++);un.splice(n,0,e),n===0&&Gs(e)}};function vs(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function jo(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function dc(){}function Qf(e,t,n,r,o){if(o){if(typeof r=="function"){var l=r;r=function(){var w=Eo(s);l.call(w)}}var s=ac(t,r,e,0,null,!1,!1,"",dc);return e._reactRootContainer=s,e[Yt]=s.current,Kr(e.nodeType===8?e.parentNode:e),$n(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var d=r;r=function(){var w=Eo(f);d.call(w)}}var f=ps(e,0,!1,null,null,!1,!1,"",dc);return e._reactRootContainer=f,e[Yt]=f.current,Kr(e.nodeType===8?e.parentNode:e),$n(function(){ko(t,f,n,r)}),f}function No(e,t,n,r,o){var l=n._reactRootContainer;if(l){var s=l;if(typeof o=="function"){var d=o;o=function(){var f=Eo(s);d.call(f)}}ko(t,s,e,o)}else s=Qf(n,t,e,o,r);return Eo(s)}Ws=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Or(t.pendingLanes);n!==0&&(Uo(t,n|1),ft(t,Me()),(ve&6)===0&&(yr=Me()+500,hn()))}break;case 13:$n(function(){var r=Zt(e,1);if(r!==null){var o=rt();Ft(r,e,1,o)}}),ms(e,1)}},Bo=function(e){if(e.tag===13){var t=Zt(e,134217728);if(t!==null){var n=rt();Ft(t,e,134217728,n)}ms(e,134217728)}},Qs=function(e){if(e.tag===13){var t=xn(e),n=Zt(e,t);if(n!==null){var r=rt();Ft(n,e,t,r)}ms(e,t)}},Ys=function(){return we},Ks=function(e,t){var n=we;try{return we=e,t()}finally{we=n}},Xn=function(e,t,n){switch(t){case"input":if(Kn(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=Hi(r);if(!o)throw Error(u(90));yi(r),Kn(r,o)}}}break;case"textarea":Nn(e,n);break;case"select":t=n.value,t!=null&&Pt(e,!!n.multiple,t,!1)}},me=ss,he=$n;var Yf={usingClientEntryPoint:!1,Events:[Zr,ir,Hi,b,Y,ss]},di={findFiberByHostInstance:zn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Kf={bundleType:di.bundleType,version:di.version,rendererPackageName:di.rendererPackageName,rendererConfig:di.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ge.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Fs(e),e===null?null:e.stateNode},findFiberByHostInstance:di.findFiberByHostInstance||Wf,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ro=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ro.isDisabled&&Ro.supportsFiber)try{Ei=Ro.inject(Kf),$t=Ro}catch{}}return pt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Yf,pt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!vs(t))throw Error(u(200));return qf(e,t,null,n)},pt.createRoot=function(e,t){if(!vs(e))throw Error(u(299));var n=!1,r="",o=cc;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=ps(e,1,!1,null,null,n,!1,r,o),e[Yt]=t.current,Kr(e.nodeType===8?e.parentNode:e),new hs(t)},pt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=Fs(t),e=e===null?null:e.stateNode,e},pt.flushSync=function(e){return $n(e)},pt.hydrate=function(e,t,n){if(!jo(t))throw Error(u(200));return No(null,e,t,!0,n)},pt.hydrateRoot=function(e,t,n){if(!vs(e))throw Error(u(405));var r=n!=null&&n.hydratedSources||null,o=!1,l="",s=cc;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=ac(t,null,e,1,n??null,o,!1,l,s),e[Yt]=t.current,Kr(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new Co(t)},pt.render=function(e,t,n){if(!jo(t))throw Error(u(200));return No(null,e,t,!1,n)},pt.unmountComponentAtNode=function(e){if(!jo(e))throw Error(u(40));return e._reactRootContainer?($n(function(){No(null,null,e,!1,function(){e._reactRootContainer=null,e[Yt]=null})}),!0):!1},pt.unstable_batchedUpdates=ss,pt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!jo(n))throw Error(u(200));if(e==null||e._reactInternals===void 0)throw Error(u(38));return No(e,t,n,!1,r)},pt.version="18.3.1-next-f1338f8080-20240426",pt}var _c;function Vc(){if(_c)return ws.exports;_c=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(c){console.error(c)}}return i(),ws.exports=rp(),ws.exports}var wc;function ip(){if(wc)return To;wc=1;var i=Vc();return To.createRoot=i.createRoot,To.hydrateRoot=i.hydrateRoot,To}var op=ip();const lp=1e4,sp=12e4,ap=new Set(["room.create","room.invite","room.revoke","room.message","room.close","room.recover","room.recover.confirm"]),up=new Set(["room.list","room.show","room.participants","room.history"]);let cp=0;class wt extends Error{constructor(u,g,m,y){super(g,y);ys(this,"code");ys(this,"outcomeUnknown");this.name="RpcError",this.code=u,this.outcomeUnknown=m}}function dp(i){return ap.has(i)?sp:lp}async function fp(i,c,u={}){var D,C,U;const g=u.fetch??globalThis.fetch,m=`web-${Date.now().toString(36)}-${(++cp).toString(36)}`,y=!up.has(i),S=new AbortController;let z=!1;const j=()=>{var L;return S.abort((L=u.signal)==null?void 0:L.reason)};(D=u.signal)==null||D.addEventListener("abort",j,{once:!0}),(C=u.signal)!=null&&C.aborted&&j();const E=setTimeout(()=>{z=!0,S.abort()},u.timeoutMs??dp(i));try{const L=await g("/rpc",{method:"POST",headers:{"content-type":"application/json"},credentials:"same-origin",body:JSON.stringify({version:1,id:m,method:i,params:c}),signal:S.signal});let W;try{W=await L.json()}catch(I){throw new wt("invalid_response","daemon returned invalid JSON",y,{cause:I})}if(!pp(W,m))throw new wt("invalid_response","daemon returned an invalid or uncorrelated RPC response",y);if("error"in W)throw new wt(W.error.code,W.error.message,!1);if(!L.ok)throw new wt("invalid_response",`daemon returned a result envelope with HTTP ${L.status}`,y);return W.result}catch(L){throw L instanceof wt?L:z?new wt("timeout","daemon did not answer before the RPC deadline",y,{cause:L}):S.signal.aborted?new wt("aborted","RPC request was aborted",y,{cause:L}):new wt("daemon_unavailable","cowork daemon is unavailable",y,{cause:L})}finally{clearTimeout(E),(U=u.signal)==null||U.removeEventListener("abort",j)}}function pp(i,c){if(!xc(i)||i.version!==1||i.id!==c)return!1;const u=Object.keys(i);return"result"in i?!("error"in i)&&u.length===3&&u.every(g=>g==="version"||g==="id"||g==="result"):u.length===3&&u.every(g=>g==="version"||g==="id"||g==="error")&&xc(i.error)&&Object.keys(i.error).length===2&&typeof i.error.code=="string"&&typeof i.error.message=="string"}function xc(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}const Sc=64;function Mo(i){return i.trim().normalize("NFC")}function zs(i){if(/[\p{Cc}\p{Cf}]/u.test(i))return"Name cannot contain control or format characters.";const c=Mo(i),u=Array.from(c).length;if(u<1)return"Name is required.";if(u>Sc)return`Name must be at most ${Sc} characters.`}function mp(i){return typeof i=="string"&&i===Mo(i)&&zs(i)===void 0}const hp=new Set(["provisioning","active","closing","closed"]),vp=new Set(["one_time","public"]),yp=new Set(["live","consumed","revoked","replacement_required","receipt_pending"]),gp=new Set(["queued","send_failed","skipped_removed"]),kc=new Set(["queued","send_failed"]),_p=/^[0-7][0-9a-hjkmnp-tv-z]{25}$/,zo=262144,wp=2*1024*1024,xp=255,Sp=255,jn=256,Cn=["version","room_id","seq","record_id","at","kind"],Hc=["version","room_id","room_name","identity_name","identity_cid","mission","state","invites","seats","created_at"],kp=[...Hc,"role_briefings","rest_roles","anonymous","quiet_membership","membership_epoch"];function pi(i){if(!Tt(i)||i.version!==1&&i.version!==2)return!1;const c=i.version===2;if(!et(i,c?kp:Hc,["status","activated_at","closed_at"])||!Rt(i.room_id)||!mp(i.room_name)||!Ie(i.identity_name)||typeof i.identity_cid!="string"||!Lp(i.mission,c)||!hp.has(i.state)||!qt(i.status)||!Array.isArray(i.invites)||!i.invites.every(Ls)||!Array.isArray(i.seats)||!i.seats.every(y=>Qc(y,c))||!Sr(i.created_at)||!wr(i.activated_at)||!wr(i.closed_at)||c&&(!Op(i.role_briefings)||!Mp(i.rest_roles)||typeof i.anonymous!="boolean"||typeof i.quiet_membership!="boolean"||!xr(i.membership_epoch))||new Set(i.invites.map(y=>y.invite_id)).size!==i.invites.length||!c&&new Set(i.seats.map(y=>y.identity)).size!==i.seats.length)return!1;if(c){const y=i.seats;if(new Set(y.map(E=>E.participant_id)).size!==y.length)return!1;const S=new Set,z=new Set;for(const E of y){if(E.state==="pending"||E.state==="active"){if(S.has(E.identity))return!1;S.add(E.identity)}if(i.anonymous?E.alias===void 0:E.alias!==void 0)return!1;if(E.state==="removed"){if(E.removed_at===void 0||E.removed_epoch===void 0||E.removed_epoch>Number(i.membership_epoch))return!1}else if(E.removed_at!==void 0||E.removed_epoch!==void 0||E.bounced_at!==void 0)return!1;if(E.state==="active"&&E.alias!==void 0){if(z.has(E.alias))return!1;z.add(E.alias)}}const j=new Map(y.map(E=>[E.participant_id,E]));for(const E of y){if(E.replaces_seat===void 0)continue;const D=j.get(E.replaces_seat);if(!D||D===E||D.state!=="removed"||D.role!==E.role||i.anonymous&&D.alias!==E.alias)return!1}}const g=i.state==="provisioning"&&i.status==="packet_pending"&&Ep(i.room_id,i.room_name,i.identity_name)&&i.invites.length===0&&i.seats.length===0&&i.activated_at===void 0&&i.closed_at===void 0;if(i.identity_cid===""&&!g||i.identity_cid!==""&&i.status==="packet_pending")return!1;const m=new Set;for(const y of i.invites){if(y.recovery_of===void 0)continue;const S=i.invites.find(j=>j.invite_id===y.recovery_of),z=y.state==="receipt_pending"?(S==null?void 0:S.state)==="replacement_required":y.state==="live"||y.state==="consumed"||y.state==="replacement_required"?(S==null?void 0:S.state)==="revoked":y.state==="revoked"?y.recovery_confirmed===!0?(S==null?void 0:S.state)==="revoked":(S==null?void 0:S.state)==="replacement_required"||(S==null?void 0:S.state)==="revoked":!1;if(!S||S.invite_id===y.invite_id||!z||S.mode!==y.mode||S.role!==y.role||S.min_accepts!==y.min_accepts)return!1;if(y.state==="receipt_pending"){if(m.has(y.recovery_of))return!1;m.add(y.recovery_of)}}for(const y of i.invites){const S=new Set([y.invite_id]);let z=y;for(;z.recovery_of!==void 0;){if(S.has(z.recovery_of))return!1;S.add(z.recovery_of);const j=i.invites.find(E=>E.invite_id===z.recovery_of);if(!j)return!1;z=j}}return!0}function Ep(i,c,u){if(u===`cowork-room-${i}`||u===`ours-cowork-room:${c}`||u===`ours-cowork-${i}`)return!0;const g=`-${i}`;if(!u.startsWith("ours-cowork-")||!u.endsWith(g))return!1;const m=u.slice(12,-g.length);return m.length>=1&&m.length<=40&&/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(m)&&u.length<=96}function Cp(i){return Array.isArray(i)&&i.every(pi)}function Ec(i){if(!Array.isArray(i)||!i.every(m=>Qc(m)))return!1;const c=i.filter(m=>m.participant_id!==void 0).length;if(c!==0&&c!==i.length)return!1;if(!(c===i.length))return new Set(i.map(m=>m.identity)).size===i.length;if(new Set(i.map(m=>m.participant_id)).size!==i.length)return!1;const g=i.filter(m=>m.state==="pending"||m.state==="active");return new Set(g.map(m=>m.identity)).size===g.length}function qc(i){return Tt(i)&&Ie(i.room_id)&&Ls(i.invite)&&Ie(i.blob)&&typeof i.reusable=="boolean"&&qt(i.recovery_of)}function jp(i){return Array.isArray(i)&&i.every(qc)}function Np(i,c){if(!qc(i)||i.room_id!==c.room_id||i.invite.mode!==c.mode||i.invite.role!==c.role||i.invite.min_accepts!==c.min_accepts||i.invite.accepted_cids.length!==0||i.invite.state!=="live"||i.invite.recovery_of!==void 0||i.invite.recovery_confirmed!==void 0||i.recovery_of!==void 0||i.reusable!==(c.mode==="public"))throw new Error("daemon returned an invalid invite receipt for this create request");return i}function Rp(i,c){jp(i)||Cc();const u=new Set,g=new Set;for(const m of i){const y=c.invites.find(S=>S.invite_id===m.recovery_of);(m.room_id!==c.room_id||m.recovery_of===void 0||m.invite.recovery_of!==m.recovery_of||m.invite.state!=="receipt_pending"||m.invite.recovery_confirmed!==!1||m.invite.accepted_cids.length!==0||m.reusable!==(m.invite.mode==="public")||!y||y.state!=="replacement_required"||y.mode!==m.invite.mode||y.role!==m.invite.role||y.min_accepts!==m.invite.min_accepts||y.invite_id===m.invite.invite_id||c.invites.some(S=>S.invite_id===m.invite.invite_id)||u.has(m.invite.invite_id)||g.has(m.recovery_of))&&Cc(),u.add(m.invite.invite_id),g.add(m.recovery_of)}return i}function Tp(i,c){const u=new Set(["live","consumed","replacement_required","revoked"]);if(!Ls(i)||c.recovery_of===void 0||i.invite_id!==c.invite.invite_id||i.recovery_of!==c.recovery_of||i.recovery_confirmed!==!0||!u.has(i.state)||i.mode!==c.invite.mode||i.role!==c.invite.role||i.min_accepts!==c.invite.min_accepts)throw new Error("daemon returned an invalid recovery confirmation for the displayed old/new pointer");return i}function Cc(){throw new Error("daemon returned an invalid recovery receipt for this room state")}function Wc(i){if(!Up(i))return!1;switch(i.kind){case"message":return et(i,[...Cn,"message_id","author","category","text","recipient_identities"],["author_alias","briefing_role","briefing_version","membership","source_msg_id","source_wire_id"])&&Rt(i.message_id)&&jc(i.author)&&(i.author_alias===void 0||Nc(i.author_alias))&&Ip(i)&&xt(i.text,zo)&&js(i.recipient_identities)&&(i.source_msg_id===void 0||xr(i.source_msg_id))&&qt(i.source_wire_id);case"relay_intent":return et(i,[...Cn,"recipient_identity"],["message_id","file_id"])&&Rc(i)&&Ie(i.recipient_identity);case"relay_result":return et(i,[...Cn,"intent_record_id","recipient_identity","status"],["message_id","file_id","wire_id","metadata_wire_id"])&&Ie(i.intent_record_id)&&Rc(i)&&Ie(i.recipient_identity)&&gp.has(i.status)&&qt(i.wire_id)&&qt(i.metadata_wire_id);case"file":{const c=$p(i.data_base64);return et(i,[...Cn,"file_id","author","filename","mime","size","sha256","data_base64","recipient_identities","source_file_id"],["author_alias","source_wire_id"])&&Rt(i.file_id)&&jc(i.author)&&(i.author_alias===void 0||Nc(i.author_alias))&&Fp(i.filename)&&Ap(i.mime,Sp)&&xr(i.size)&&i.size<=wp&&typeof i.sha256=="string"&&/^[0-9a-f]{64}$/.test(i.sha256)&&c===i.size&&js(i.recipient_identities)&&xr(i.source_file_id)&&qt(i.source_wire_id)}case"membership_intent":return et(i,[...Cn,"action","participant_id","recipient_identity","role","epoch","notify"],["alias"])&&i.action==="remove"&&Rt(i.participant_id)&&Ie(i.recipient_identity)&&xt(i.role,jn)&&qt(i.alias)&&Qn(i.epoch)&&typeof i.notify=="boolean";case"membership_result":return et(i,[...Cn,"intent_record_id","participant_id","status","notified","key_material_retained"],["uncertain_after_restart"])&&Ie(i.intent_record_id)&&Rt(i.participant_id)&&kc.has(i.status)&&typeof i.notified=="boolean"&&i.key_material_retained===!0&&(i.uncertain_after_restart===void 0||i.uncertain_after_restart===!0);case"close_notice_intent":return et(i,[...Cn,"recipient_identity"])&&Ie(i.recipient_identity);case"close_notice_result":return et(i,[...Cn,"intent_record_id","recipient_identity","status","notified","key_material_retained"],["uncertain_after_restart"])&&Ie(i.intent_record_id)&&Ie(i.recipient_identity)&&kc.has(i.status)&&typeof i.notified=="boolean"&&i.key_material_retained===!0&&(i.uncertain_after_restart===void 0||i.uncertain_after_restart===!0);default:return!1}}function Pp(i){return Array.isArray(i)&&i.every(Wc)}function zp(i){return Tt(i)&&Object.keys(i).length===4&&i.version===1&&Ie(i.room_id)&&i.deleted===!0&&i.scope==="this_host"}function Lp(i,c=!1){return Tt(i)&&et(i,c?["goal","briefing","briefing_version"]:["goal","briefing"])&&xt(i.goal,zo)&&xt(i.briefing,zo)&&(!c||Qn(i.briefing_version))}function Qc(i,c){if(!Tt(i))return!1;const u=c??Object.hasOwn(i,"participant_id");return!et(i,u?["identity","display_name","role","invite_id","participant_id","state"]:["identity","display_name","role","invite_id","accepted_at"],u?["accepted_at","requested_at","invite_sha256","alias","removed_at","removed_epoch","replaces_seat","bounced_at"]:[])||!Ie(i.identity)||!Ie(i.display_name)||!xt(i.role,jn)||!Ie(i.invite_id)?!1:u?!(Rt(i.participant_id)&&(i.state==="pending"||i.state==="active"||i.state==="removed")&&wr(i.accepted_at)&&wr(i.requested_at)&&(i.invite_sha256===void 0||typeof i.invite_sha256=="string"&&/^[0-9a-f]{64}$/.test(i.invite_sha256))&&qt(i.alias)&&wr(i.removed_at)&&(i.removed_epoch===void 0||xr(i.removed_epoch))&&(i.replaces_seat===void 0||Rt(i.replaces_seat))&&wr(i.bounced_at))||i.requested_at===void 0!=(i.invite_sha256===void 0)?!1:i.state==="pending"?i.requested_at!==void 0&&i.accepted_at===void 0&&i.removed_at===void 0&&i.removed_epoch===void 0&&i.bounced_at===void 0:i.state==="active"?i.accepted_at!==void 0&&i.removed_at===void 0&&i.removed_epoch===void 0&&i.bounced_at===void 0:i.removed_at!==void 0&&i.removed_epoch!==void 0&&(i.accepted_at!==void 0||i.requested_at!==void 0):Sr(i.accepted_at)}function Op(i){return Tt(i)&&Object.entries(i).every(([c,u])=>xt(c,jn)&&Tt(u)&&et(u,["text","version","updated_at"])&&xt(u.text,zo)&&Qn(u.version)&&Sr(u.updated_at))}function Mp(i){return Array.isArray(i)&&i.every(c=>xt(c,jn)&&c.length>0&&c!=="room")&&new Set(i).size===i.length}function Ls(i){if(!Tt(i)||!et(i,["invite_id","mode","role","min_accepts","accepted_cids","state","created_at"],["recovery_of","recovery_confirmed","replaces_seat"])||!Ie(i.invite_id)||!vp.has(i.mode)||!xt(i.role,jn)||!Qn(i.min_accepts)||!js(i.accepted_cids)||!yp.has(i.state)||!qt(i.recovery_of)||i.recovery_confirmed!==void 0&&typeof i.recovery_confirmed!="boolean"||i.replaces_seat!==void 0&&!Rt(i.replaces_seat)||!Sr(i.created_at))return!1;const c=i;return!(c.mode==="one_time"&&c.min_accepts!==1||c.recovery_of===void 0&&c.recovery_confirmed!==void 0||c.recovery_of!==void 0&&c.recovery_confirmed===void 0||c.state==="receipt_pending"&&(c.recovery_of===void 0||c.recovery_confirmed!==!1||c.accepted_cids.length>0)||c.recovery_of!==void 0&&(c.state==="live"||c.state==="consumed"||c.state==="replacement_required")&&c.recovery_confirmed!==!0)}function jc(i){return Tt(i)&&et(i,["identity","display_name","role"])&&Ie(i.identity)&&Ie(i.display_name)&&xt(i.role,jn)}function Nc(i){return Tt(i)&&et(i,["participant_id","alias"])&&Rt(i.participant_id)&&Ie(i.alias)}function Dp(i){return Tt(i)&&et(i,["action","epoch"],["alias","role"])&&i.action==="remove"&&qt(i.alias)&&(i.role===void 0||xt(i.role,jn))&&xr(i.epoch)}function Ip(i){switch(i.category){case"briefing":return i.briefing_role===void 0&&(i.briefing_version===void 0||Qn(i.briefing_version))&&i.membership===void 0;case"role_briefing":return xt(i.briefing_role,jn)&&Qn(i.briefing_version)&&i.membership===void 0;case"chat":return i.briefing_role===void 0&&i.briefing_version===void 0&&i.membership===void 0;case"membership":return i.briefing_role===void 0&&i.briefing_version===void 0&&Dp(i.membership);default:return!1}}function Rc(i){const c=i.message_id===void 0?!1:Rt(i.message_id),u=i.file_id===void 0?!1:Rt(i.file_id);return c!==u}function Fp(i){return xt(i,xp)&&i!=="."&&i!==".."&&!/[\x00/\\]/.test(i)}function Ap(i,c){return typeof i=="string"&&new TextEncoder().encode(i).byteLength<=c}function $p(i){if(typeof i!="string"||!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(i))return;if(i.length===0)return 0;const c=i.endsWith("==")?2:i.endsWith("=")?1:0;return i.length/4*3-c}function Up(i){return Tt(i)&&i.version===1&&Rt(i.room_id)&&Qn(i.seq)&&i.record_id===`${i.room_id}:${i.seq}`&&Sr(i.at)&&typeof i.kind=="string"}function et(i,c,u=[]){const g=new Set([...c,...u]),m=Object.keys(i);return c.every(y=>Object.hasOwn(i,y))&&m.every(y=>g.has(y))}function Rt(i){return typeof i=="string"&&_p.test(i)}function xt(i,c){return typeof i=="string"&&new TextEncoder().encode(i).byteLength>=1&&new TextEncoder().encode(i).byteLength<=c}function js(i){return Bp(i)&&new Set(i).size===i.length}function Sr(i){if(typeof i!="string")return!1;const c=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.\d+)?(?:Z|[+-](\d{2}):(\d{2}))$/.exec(i);if(!c)return!1;const[,u,g,m,y,S,z,j,E]=c,D=Number(u),C=Number(g),U=Number(m),L=Number(y),W=Number(S),I=Number(z),O=j===void 0?0:Number(j),oe=E===void 0?0:Number(E);if(C<1||C>12||L>23||W>59||I>59||O>23||oe>59)return!1;const le=[31,D%4===0&&(D%100!==0||D%400===0)?29:28,31,30,31,30,31,31,30,31,30,31];return U>=1&&U<=le[C-1]}function wr(i){return i===void 0||Sr(i)}function Tt(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function Ie(i){return typeof i=="string"&&i.length>0}function qt(i){return i===void 0||Ie(i)}function Bp(i){return Array.isArray(i)&&i.every(Ie)}function Qn(i){return Number.isSafeInteger(i)&&Number(i)>0}function xr(i){return Number.isSafeInteger(i)&&Number(i)>=0}const qn=500;function vi(i,c){const u=new Map;for(const g of i)u.set(g.seq,g);for(const g of c)u.set(g.seq,g);return[...u.values()].sort((g,m)=>g.seq-m.seq)}function Vp(i){return vi([],i).filter(c=>c.kind==="message"||c.kind==="file").map(c=>c.kind==="file"?Yc(c):c.category==="briefing"?{type:"briefing",seq:c.seq,recordId:c.record_id,at:c.at,author:c.author,text:c.text}:{type:"message",speaker:c.author.role==="room"?"room":"participant",seq:c.seq,recordId:c.record_id,at:c.at,author:c.author,text:c.text})}function Hp(i){return vi([],i).filter(c=>c.kind!=="message"&&c.kind!=="file")}function qp(i,c){return vi([],i.filter(u=>u.room_id===c)).filter(u=>u.kind==="file").map(Yc)}function Wp(i,c){const u=new Map;for(const g of qp(i,c)){const m=u.get(g.filename)??[];m.push(g),u.set(g.filename,m)}return[...u.entries()].map(([g,m])=>{const y=m.sort((S,z)=>S.seq-z.seq).map((S,z)=>({...S,version:z+1})).reverse();return{groupId:y[0].fileId,filename:g,latest:y[0],versions:y}}).sort((g,m)=>m.latest.seq-g.latest.seq)}function mt(i,c=!0){if(!c)return ks(!1);switch(i){case"provisioning":return Tc(!1);case"active":return Tc(!0);case"closing":return ks(!1);case"closed":return{...ks(!1),canDelete:!0}}}function Os(i){return i.invites.reduce((c,u)=>u.state==="revoked"?c:c+Math.max(0,u.min_accepts-u.accepted_cids.length),0)}function Qp(i,c=qn){const u=Math.max(0,Math.floor(c));return i.slice(Math.max(0,i.length-u))}function Ns(i,c,u=qn){return Math.min(Math.max(0,c),Math.max(0,i)+Math.max(0,u))}function ks(i){return{canEditSettings:i,canCreateInvite:i,canRevokeInvite:i,canRecoverInvite:i,canMessage:i,canClose:i,canDelete:i}}function Tc(i){return{canEditSettings:!0,canCreateInvite:!0,canRevokeInvite:!0,canRecoverInvite:!0,canMessage:i,canClose:!0,canDelete:!1}}function Yc(i){return{type:"file",seq:i.seq,recordId:i.record_id,fileId:i.file_id,at:i.at,author:i.author,filename:i.filename,mime:i.mime,size:i.size,sha256:i.sha256,dataBase64:i.data_base64}}var Yp=Vc();const Kp={provisioning:"Provisioning",active:"Active",closing:"Closing",closed:"Closed"};function Ms(i){return i.room_name}function Xp({rooms:i,selectedRoomId:c,connected:u,open:g,sheet:m,onClose:y,onCreate:S,onSelect:z}){const j=i.filter(C=>C.state!=="closed"),E=i.filter(C=>C.state==="closed"),D=m&&!g;return a.jsxs("aside",{className:`room-rail${g?" room-rail--open":""}`,"aria-label":"Mission rooms","aria-hidden":D||void 0,hidden:D,children:[a.jsxs("div",{className:"rail-brand",children:[a.jsx("div",{className:"brand-mark","aria-hidden":"true",children:"O"}),a.jsxs("div",{children:[a.jsx("strong",{children:"ours cowork"}),a.jsx("span",{children:"operations console"})]}),a.jsx("button",{className:"icon-button rail-close",type:"button",onClick:y,"aria-label":"Close rooms",children:"×"})]}),a.jsxs("button",{className:"primary-button create-button",type:"button",onClick:C=>S(C.currentTarget),disabled:u!==!0,children:[a.jsx("span",{"aria-hidden":"true",children:"+"})," Create room"]}),a.jsxs("div",{className:`connection-state connection-state--${u===!1?"offline":u?"online":"pending"}`,children:[a.jsx("span",{className:"state-dot","aria-hidden":"true"}),u===!1?"Disconnected":u?"Connected":"Connecting"]}),a.jsx(Pc,{label:"Open rooms",rooms:j,selectedRoomId:c,onSelect:z}),a.jsx(Pc,{label:"Closed rooms",rooms:E,selectedRoomId:c,onSelect:z}),a.jsx("p",{className:"local-boundary",children:"Local daemon · 127.0.0.1"})]})}function Pc({label:i,rooms:c,selectedRoomId:u,onSelect:g}){return a.jsxs("section",{className:"room-group","aria-label":i,children:[a.jsxs("div",{className:"room-group__heading",children:[a.jsx("h2",{children:i}),a.jsx("span",{children:c.length})]}),c.length===0?a.jsxs("p",{className:"empty-group",children:["No ",i.toLowerCase()]}):a.jsx("ul",{className:"room-list",children:c.map(m=>{const y=m.room_id===u;return a.jsx("li",{children:a.jsxs("button",{className:"room-card",type:"button","aria-current":y?"page":void 0,onClick:()=>g(m.room_id),children:[a.jsx("span",{className:"room-card__title",children:Ms(m)}),a.jsxs("span",{className:"room-card__state",children:[a.jsx("span",{className:`lifecycle-dot lifecycle-dot--${m.state}`,"aria-hidden":"true"}),Kp[m.state]]}),a.jsxs("span",{className:"room-card__summary",children:[m.seats.length," accepted · ",Os(m)," needed"]})]})},m.room_id)})})]})}const mi=262144;function Gp({open:i,connected:c,restoreFocus:u,fallbackFocus:g,onClose:m,onCreate:y}){const[S,z]=k.useState(""),[j,E]=k.useState(""),[D,C]=k.useState(""),[U,L]=k.useState(!1),[W,I]=k.useState(),O=k.useRef(!1);if(!i)return null;const oe=zs(S),ee=zc("Goal",j),le=zc("Briefing",D);async function ge(xe){if(xe.preventDefault(),!(!c||oe||ee||le||O.current)){O.current=!0,L(!0),I(void 0);try{await y(Mo(S),j.trim(),D.trim()),z(""),E(""),C("")}catch(pe){I(pe instanceof wt&&pe.outcomeUnknown?`The create request did not receive a confirmation, so its outcome is unknown. Your fields are retained. ${pe.message}`:pe instanceof Error?pe.message:"Room creation failed.")}finally{O.current=!1,L(!1)}}}return a.jsx(kr,{title:"Create mission room",open:i,restoreFocus:u,fallbackFocus:g,onClose:m,locked:U,children:a.jsxs("form",{className:"dialog-form",onSubmit:ge,children:[a.jsx("p",{className:"dialog-intro",children:"Define the shared objective. Invitation requirements are added after the room is created."}),a.jsx(hi,{label:"Name",value:S,onChange:z,error:oe,autoFocus:!0}),a.jsx(Lo,{label:"Goal",value:j,onChange:E,error:ee,rows:3,trimForBytes:!0}),a.jsx(Lo,{label:"Briefing",value:D,onChange:C,error:le,rows:6,trimForBytes:!0}),!c&&a.jsx("p",{className:"form-error",role:"status",children:"Create is unavailable because the daemon disconnected. Your fields are retained and no request was sent."}),W&&a.jsx("p",{className:"form-error",role:"alert",children:W}),a.jsxs("div",{className:"dialog-actions",children:[a.jsx("button",{className:"secondary-button",type:"button",onClick:m,disabled:U,children:"Cancel"}),a.jsx("button",{className:"primary-button",type:"submit",disabled:!c||U||!!(oe||ee||le),children:U?"Creating room…":"Create mission room"})]})]})})}function Zp({room:i,open:c,connected:u,capable:g,restoreFocus:m,onClose:y,onSave:S}){const[z,j]=k.useState(i.room_name),[E,D]=k.useState(i.mission.goal),[C,U]=k.useState(i.mission.briefing),[L,W]=k.useState(i.status??""),[I,O]=k.useState(!1),[oe,ee]=k.useState(),le=k.useRef(!1);if(k.useEffect(()=>{c&&(j(i.room_name),D(i.mission.goal),U(i.mission.briefing),W(i.status??""),ee(void 0))},[c,i.mission.briefing,i.mission.goal,i.room_id,i.room_name,i.status]),!c)return null;const ge=zs(z),xe=Lc("Goal",E),pe=Lc("Briefing",C),Re=i.status&&!L?"An existing status cannot be cleared.":void 0,Ee={},te=Mo(z);te!==i.room_name&&(Ee.name=te),E!==i.mission.goal&&(Ee.goal=E),C!==i.mission.briefing&&(Ee.briefing=C),L!==(i.status??"")&&(Ee.status=L);const Ye=Object.keys(Ee).length>0;async function Ke(it){if(it.preventDefault(),!(!u||!g||!Ye||ge||xe||pe||Re||le.current)){le.current=!0,O(!0),ee(void 0);try{await S(Ee)}catch(Te){ee(Te instanceof wt&&Te.outcomeUnknown?`The settings request did not receive a confirmation, so its outcome is unknown. Your fields are retained. ${Te.message}`:Te instanceof Error?Te.message:"Settings update failed.")}finally{le.current=!1,O(!1)}}}return a.jsx(kr,{title:"Room settings",open:c,restoreFocus:m,onClose:y,locked:I,children:a.jsxs("form",{className:"dialog-form",onSubmit:Ke,children:[a.jsx(hi,{label:"Name",value:z,onChange:j,error:ge,autoFocus:!0}),a.jsx(Lo,{label:"Goal",value:E,onChange:D,error:xe,rows:3}),a.jsx(Lo,{label:"Briefing",value:C,onChange:U,error:pe,rows:5}),a.jsx(hi,{label:"Status (optional)",value:L,onChange:W,error:Re}),(!u||!g)&&a.jsx("p",{className:"form-error",role:"status",children:"Settings are unavailable because the connection or room lifecycle changed. Your fields are retained and no request was sent."}),oe&&a.jsx("p",{className:"form-error",role:"alert",children:oe}),a.jsxs("div",{className:"dialog-actions",children:[a.jsx("button",{className:"secondary-button",type:"button",onClick:y,disabled:I,children:"Cancel"}),a.jsx("button",{className:"primary-button",type:"submit",disabled:!u||!g||I||!Ye||!!(ge||xe||pe||Re),children:I?"Saving…":"Save settings"})]})]})})}function bp({room:i,open:c,connected:u,capable:g,restoreFocus:m,onClose:y,onConfirm:S}){const[z,j]=k.useState(""),[E,D]=k.useState(!1),[C,U]=k.useState(),L=k.useRef(!1);if(!c)return null;const W=Ms(i),O=(z===W||z===i.room_id)&&u&&g;async function oe(ee){if(ee.preventDefault(),!(!O||L.current)){L.current=!0,D(!0),U(void 0);try{await S()}catch(le){U(Kc(le,"close","Your confirmation is retained."))}finally{L.current=!1,D(!1)}}}return a.jsx(kr,{title:"Close room",open:c,restoreFocus:m,onClose:y,locked:E,children:a.jsxs("form",{className:"dialog-form",onSubmit:oe,children:[a.jsx("p",{className:"dialog-intro",children:"Closing is forward-only. Live packet state is removed, while the plaintext local archive remains readable on this host."}),a.jsxs("p",{className:"destructive-target",children:["Type ",a.jsx("strong",{children:W})," or the exact room ID ",a.jsx("code",{children:i.room_id})," to continue."]}),a.jsx(hi,{label:"Type room title or ID to close",value:z,onChange:j}),(!u||!g)&&a.jsx("p",{className:"form-error",role:"status",children:"Close is unavailable because the connection or room lifecycle changed. No request was sent."}),C&&a.jsx("p",{className:"form-error",role:"alert",children:C}),a.jsxs("div",{className:"dialog-actions",children:[a.jsx("button",{className:"secondary-button",type:"button",onClick:y,disabled:E,children:"Cancel"}),a.jsx("button",{className:"danger-button",type:"submit",disabled:!O||E,children:E?"Closing room…":"Close room permanently"})]})]})})}function Jp({room:i,open:c,connected:u,capable:g,restoreFocus:m,onClose:y,onConfirm:S}){const[z,j]=k.useState(""),[E,D]=k.useState(!1),[C,U]=k.useState(),L=k.useRef(!1);if(!c)return null;const I=z===i.room_id&&u&&g;async function O(oe){if(oe.preventDefault(),!(!I||L.current)){L.current=!0,D(!0),U(void 0);try{await S()}catch(ee){U(Kc(ee,"delete","Your confirmation is retained."))}finally{L.current=!1,D(!1)}}}return a.jsx(kr,{title:"Delete room",open:c,restoreFocus:m,onClose:y,locked:E,children:a.jsxs("form",{className:"dialog-form",onSubmit:O,children:[a.jsx("p",{className:"dialog-intro",children:"This deletes the plaintext local archive and room metadata from this host. It does not purge remote copies or backups and does not securely erase storage or keys."}),a.jsxs("p",{className:"destructive-target",children:["Type the exact room ID ",a.jsx("code",{children:i.room_id})," to continue."]}),a.jsx(hi,{label:"Type exact room ID to delete",value:z,onChange:j}),(!u||!g)&&a.jsx("p",{className:"form-error",role:"status",children:"Delete is unavailable because the connection or room lifecycle changed. No request was sent."}),C&&a.jsx("p",{className:"form-error",role:"alert",children:C}),a.jsxs("div",{className:"dialog-actions",children:[a.jsx("button",{className:"secondary-button",type:"button",onClick:y,disabled:E,children:"Cancel"}),a.jsx("button",{className:"danger-button",type:"submit",disabled:!I||E,children:E?"Deleting room…":"Delete local archive"})]})]})})}function Lo({label:i,value:c,onChange:u,error:g,rows:m,autoFocus:y=!1,trimForBytes:S=!1}){const z=k.useId(),j=`${z}-error`;return a.jsxs("div",{className:"field",children:[a.jsx("label",{htmlFor:z,children:i}),a.jsx("textarea",{id:z,value:c,rows:m,onChange:E=>u(E.target.value),"aria-invalid":!!g,"aria-describedby":g?j:void 0,autoFocus:y,"data-autofocus":y?"true":void 0}),g?a.jsx("small",{id:j,className:"field-error",children:g}):a.jsxs("small",{children:[Oo(S?c.trim():c)," / ",mi," bytes"]})]})}function hi({label:i,value:c,onChange:u,error:g,autoFocus:m=!1}){const y=k.useId(),S=`${y}-error`;return a.jsxs("div",{className:"field",children:[a.jsx("label",{htmlFor:y,children:i}),a.jsx("input",{id:y,value:c,onChange:z=>u(z.target.value),"aria-invalid":!!g,"aria-describedby":g?S:void 0,autoFocus:m,"data-autofocus":m?"true":void 0}),g&&a.jsx("small",{id:S,className:"field-error",children:g})]})}function kr({title:i,open:c,restoreFocus:u,fallbackFocus:g,onClose:m,locked:y,children:S}){const z=k.useId(),j=k.useRef(null),E=k.useRef(m),D=k.useRef(y);return E.current=m,D.current=y,k.useEffect(()=>{var I;if(!c)return;const C=u??(document.activeElement instanceof HTMLElement?document.activeElement:null),U=j.current,L=()=>[...(U==null?void 0:U.querySelectorAll('button:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'))??[]];(I=L().find(O=>O.dataset.autofocus==="true")??L()[0])==null||I.focus();const W=O=>{if(O.key==="Escape"&&!D.current){O.preventDefault(),E.current();return}if(O.key!=="Tab")return;const oe=L();if(!oe.length)return;const ee=oe[0],le=oe[oe.length-1];if(!oe.includes(document.activeElement)){O.preventDefault(),(O.shiftKey?le:ee).focus();return}O.shiftKey&&document.activeElement===ee?(O.preventDefault(),le.focus()):!O.shiftKey&&document.activeElement===le&&(O.preventDefault(),ee.focus())};return document.addEventListener("keydown",W),()=>{document.removeEventListener("keydown",W);const O=Oc(C)?C:(g==null?void 0:g())??document.querySelector('[data-modal-fallback="true"]');Oc(O)&&O.focus()}},[g,c,u]),Yp.createPortal(a.jsx("div",{className:"modal-backdrop",onMouseDown:C=>{!y&&C.target===C.currentTarget&&m()},children:a.jsxs("div",{ref:j,className:"modal",role:"dialog","aria-modal":"true","aria-labelledby":z,children:[a.jsxs("header",{children:[a.jsx("h2",{id:z,children:i}),a.jsx("button",{className:"icon-button",type:"button",onClick:m,disabled:y,"aria-label":`Close ${i}`,children:"×"})]}),S]})}),document.body)}function zc(i,c){const u=c.trim();if(!u)return`${i} is required.`;if(Oo(u)>mi)return`${i} must be at most ${mi} UTF-8 bytes.`}function Lc(i,c){if(Oo(c)<1)return`${i} is required.`;if(Oo(c)>mi)return`${i} must be at most ${mi} UTF-8 bytes.`}function Oo(i){return new TextEncoder().encode(i).byteLength}function Oc(i){return!!(i!=null&&i.isConnected&&!i.matches(':disabled, [aria-disabled="true"]')&&!i.closest('[hidden], [aria-hidden="true"]'))}function Kc(i,c,u){return i instanceof wt&&i.outcomeUnknown?`The ${c} request did not receive a confirmation, so its outcome is unknown. ${u} ${i.message}`:i instanceof Error?i.message:`Room ${c} failed.`}function em({room:i,connected:c,onCreate:u,onRevoke:g,onRecover:m}){const[y,S]=k.useState(""),[z,j]=k.useState("one_time"),[E,D]=k.useState("1"),[C,U]=k.useState(!1),[L,W]=k.useState(),[I,O]=k.useState(),oe=k.useRef(!1),ee=mt(i.state,c),le=Number(E),ge=new TextEncoder().encode(y.trim()).byteLength,xe=ge<1?"Role is required.":ge>256?"Role must be at most 256 UTF-8 bytes.":void 0,pe=z==="public"&&(!Number.isSafeInteger(le)||le<1)?"Minimum acceptances must be a positive whole number.":void 0;async function Re(te){te.preventDefault(),!(!ee.canCreateInvite||xe||pe||oe.current)&&await Ee(async()=>{await u({mode:z,role:y.trim(),min_accepts:z==="one_time"?1:le}),S("")},"Invite creation")}async function Ee(te,Ye){oe.current=!0,U(!0),W(void 0);try{await te()}catch(Ke){W(Xc(Ke,Ye))}finally{oe.current=!1,U(!1)}}return a.jsxs(a.Fragment,{children:[a.jsxs("form",{className:"invite-form",onSubmit:Re,children:[a.jsxs("div",{className:"field",children:[a.jsx("label",{htmlFor:"invite-role",children:"Role"}),a.jsx("input",{id:"invite-role",value:y,onChange:te=>S(te.target.value),"aria-invalid":!!xe}),xe&&a.jsx("small",{className:"field-error",children:xe})]}),a.jsxs("div",{className:"field",children:[a.jsx("label",{htmlFor:"invite-mode",children:"Mode"}),a.jsxs("select",{id:"invite-mode",value:z,onChange:te=>j(te.target.value),children:[a.jsx("option",{value:"one_time",children:"One-time"}),a.jsx("option",{value:"public",children:"Public"})]})]}),z==="public"&&a.jsxs("div",{className:"field",children:[a.jsx("label",{htmlFor:"invite-minimum",children:"Minimum acceptances"}),a.jsx("input",{id:"invite-minimum",inputMode:"numeric",value:E,onChange:te=>D(te.target.value),"aria-invalid":!!pe}),pe&&a.jsx("small",{className:"field-error",children:pe})]}),a.jsx("button",{className:"primary-button",type:"submit",disabled:!ee.canCreateInvite||C||!!(xe||pe),children:"Create invite"})]}),L&&a.jsx("p",{className:"form-error",role:"alert",children:L}),a.jsx("div",{className:"invite-list",children:i.invites.map(te=>a.jsxs("article",{className:"invite-card",children:[a.jsxs("header",{children:[a.jsx("strong",{children:te.role}),a.jsx("span",{className:`state-text state-text--${te.state}`,children:rm(te.state)})]}),a.jsxs("p",{children:[te.mode==="public"?"Public":"One-time"," · ",te.accepted_cids.length," of ",te.min_accepts," accepted"]}),a.jsx("code",{children:te.invite_id}),te.recovery_of&&a.jsxs("p",{children:["Recovery lineage: ",a.jsx("code",{children:te.recovery_of})," → ",a.jsx("code",{children:te.invite_id})," (",te.recovery_confirmed?"confirmed":"awaiting confirmation",")"]}),a.jsx("button",{className:"quiet-button",type:"button",disabled:!ee.canRevokeInvite||C||!nm(te),onClick:()=>O(te),children:"Revoke"})]},te.invite_id))}),i.invites.some(te=>te.state==="replacement_required")&&a.jsxs("div",{className:"recovery-callout",children:[a.jsx("p",{children:"The original invite secret is lost and cannot be recovered. Mint replacements, save every returned secret, then confirm each exact old/new pair. Repeating recovery rotates any unconfirmed replacement."}),a.jsx("button",{className:"secondary-button",type:"button",disabled:!ee.canRecoverInvite||C,onClick:()=>{ee.canRecoverInvite&&Ee(m,"Invite recovery")},children:"Recover missing invites"})]}),I&&a.jsx(kr,{title:"Revoke invite",open:!0,onClose:()=>O(void 0),locked:C,children:a.jsxs("div",{className:"dialog-form",children:[a.jsxs("p",{children:["Revoke the ",a.jsx("strong",{children:I.role})," invite ",a.jsx("code",{children:Gc(I.invite_id)}),"? It can no longer admit participants."]}),!ee.canRevokeInvite&&a.jsx("p",{className:"form-error",role:"status",children:"Revocation is unavailable because the connection or room lifecycle changed. No request was sent."}),a.jsxs("div",{className:"dialog-actions",children:[a.jsx("button",{className:"secondary-button",type:"button",onClick:()=>O(void 0),disabled:C,children:"Cancel"}),a.jsx("button",{className:"danger-button",type:"button",disabled:C||!ee.canRevokeInvite,onClick:()=>{ee.canRevokeInvite&&Ee(async()=>{await g(I.invite_id),O(void 0)},"Invite revocation")},children:"Revoke invite"})]})]})})]})}function tm({vault:i,connected:c=!0,canConfirm:u=()=>!0,onClose:g,onConfirm:m}){const[y,S]=k.useState(""),[z,j]=k.useState(!1),[E,D]=k.useState(),C=k.useRef(!1);async function U(L){if(!(!c||!u(L)||C.current)){C.current=!0,j(!0),D(void 0);try{await m(L)}catch(W){D(Xc(W,"Recovery confirmation"))}finally{C.current=!1,j(!1)}}}return a.jsx(kr,{title:i.receipts.some(L=>L.recovery_of)?"Recovered invite receipts":"Invite receipt",open:!0,onClose:g,locked:z,children:a.jsxs("div",{className:"dialog-form",children:[a.jsxs("p",{className:"dialog-intro",children:["Room ",a.jsx("code",{children:i.room_id}),". Copy and save ",i.receipts.length===1?"this secret":"every secret"," now. It is not stored by cowork and disappears when this dialog closes."]}),i.receipts.map(L=>a.jsxs("section",{className:"receipt",children:[a.jsxs("p",{children:[a.jsx("strong",{children:L.invite.role})," · ",L.invite.mode==="public"?"Public":"One-time"]}),L.recovery_of&&a.jsxs("p",{children:["Old ",a.jsx("code",{children:L.recovery_of}),a.jsx("br",{}),"New ",a.jsx("code",{children:L.invite.invite_id})]}),a.jsx("pre",{children:L.blob}),a.jsx("button",{className:"secondary-button",type:"button",onClick:async()=>{try{await navigator.clipboard.writeText(L.blob),S(`Copied ${Gc(L.invite.invite_id)}`)}catch{S("Copy failed. Select and copy the secret manually.")}},children:"Copy invite"}),L.recovery_of&&a.jsx("button",{className:"primary-button",type:"button",disabled:z||!c||!u(L),"aria-label":`Confirm ${L.recovery_of} to ${L.invite.invite_id}`,onClick:()=>U(L),children:"Confirm old/new pair"})]},`${L.recovery_of??"new"}:${L.invite.invite_id}`)),i.receipts.some(L=>L.recovery_of&&(!c||!u(L)))&&a.jsx("p",{className:"form-error",role:"status",children:"Recovery confirmation is unavailable because the connection or exact room lineage changed. The receipt is retained and no request was sent."}),E&&a.jsx("p",{className:"form-error",role:"alert",children:E}),a.jsx("p",{role:"status","aria-live":"polite",children:y}),a.jsx("div",{className:"dialog-actions",children:a.jsx("button",{className:"primary-button",type:"button",disabled:z,onClick:g,children:"Done"})})]})})}function Xc(i,c){return i instanceof wt&&i.outcomeUnknown?`${c} has an unknown outcome. The current state is preserved; check refreshed durable state before deciding whether to act again. ${i.message}`:i instanceof Error?i.message:`${c} failed.`}function nm(i){return i.state==="live"||i.state==="replacement_required"||i.state==="receipt_pending"}function Gc(i){return i.length<=14?i:`${i.slice(0,8)}…${i.slice(-4)}`}function rm(i){return i.replaceAll("_"," ")}function im({room:i,participants:c=[],archiveCount:u=0,connected:g=!1,tab:m,open:y,drawer:S,panelRef:z,onTab:j,onClose:E,onCreateInvite:D=Es,onRevokeInvite:C=Es,onRecoverInvites:U=Es,onRequestClose:L=Mc,onRequestDelete:W=Mc}){const I=S&&!y;return a.jsxs("aside",{ref:z,className:`room-context${y?" room-context--open":""}`,"aria-label":"Room context","aria-hidden":I||void 0,hidden:I,tabIndex:-1,children:[a.jsxs("header",{className:"context-header",children:[a.jsxs("div",{children:[a.jsx("p",{className:"eyebrow",children:"Room context"}),a.jsx("h2",{children:i?"Mission details":"No room selected"})]}),a.jsx("button",{className:"icon-button context-close",type:"button",onClick:E,"aria-label":"Close context",children:"×"})]}),i&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"context-tabs",role:"tablist","aria-label":"Room context views",children:[a.jsx("button",{type:"button",role:"tab","aria-selected":m==="state",onClick:()=>j("state"),children:"State"}),a.jsx("button",{type:"button",role:"tab","aria-selected":m==="participants",onClick:()=>j("participants"),children:"Participants"}),a.jsx("button",{type:"button",role:"tab","aria-selected":m==="invite",onClick:()=>j("invite"),children:"Invite"})]}),m==="state"?a.jsx(om,{room:i,archiveCount:u,connected:g,onRequestClose:L,onRequestDelete:W}):m==="participants"?a.jsx(lm,{room:i,participants:c}):a.jsxs("div",{className:"context-body",role:"tabpanel","aria-label":"Invites",children:[a.jsxs("div",{className:"setup-callout",children:[a.jsx("span",{"aria-hidden":"true",children:"↗"}),a.jsxs("div",{children:[a.jsx("h3",{children:"Build the room roster"}),a.jsx("p",{children:"Add invitation requirements one at a time. Each confirmed requirement is durable and can be retried independently."})]})]}),a.jsxs("dl",{className:"state-grid state-grid--compact",children:[a.jsxs("div",{children:[a.jsx("dt",{children:"Requirements"}),a.jsx("dd",{children:i.invites.length})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"Still needed"}),a.jsx("dd",{children:Os(i)})]})]}),a.jsx(em,{room:i,connected:g,onCreate:D,onRevoke:C,onRecover:U},i.room_id)]})]})]})}function om({room:i,archiveCount:c,connected:u,onRequestClose:g,onRequestDelete:m}){const y=mt(i.state,u);return a.jsxs("div",{className:"context-body",role:"tabpanel","aria-label":"State",children:[a.jsxs("dl",{className:"state-grid",children:[a.jsxs("div",{children:[a.jsx("dt",{children:"Lifecycle"}),a.jsx("dd",{className:`state-text state-text--${i.state}`,children:Zc(i.state)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"Accepted seats"}),a.jsx("dd",{children:i.seats.length})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"Unmet requirements"}),a.jsx("dd",{children:Os(i)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"Archive"}),a.jsxs("dd",{children:[c," records"]})]})]}),a.jsx(_r,{label:"Room name",value:i.room_name}),i.status&&a.jsx(_r,{label:"Status",value:i.status}),a.jsx(_r,{label:"Room ID",value:i.room_id,mono:!0}),a.jsx(_r,{label:"Identity CID",value:i.identity_cid||"Pending",mono:!0}),a.jsx(_r,{label:"Created",value:Rs(i.created_at)}),i.closed_at&&a.jsx(_r,{label:"Closed",value:Rs(i.closed_at)}),a.jsxs("div",{className:"management-actions",children:[y.canClose&&a.jsx("button",{className:"danger-button",type:"button",onClick:S=>g(S.currentTarget),children:"Close room"}),y.canDelete&&a.jsx("button",{className:"danger-button",type:"button",onClick:S=>m(S.currentTarget),children:"Delete room"})]})]})}function lm({room:i,participants:c}){return a.jsxs("div",{className:"context-body",role:"tabpanel","aria-label":"Participants",children:[a.jsx("p",{className:`state-text state-text--${i.state}`,children:Zc(i.state)}),a.jsxs("p",{children:[c.length," ",c.length===1?"seat":"seats"]}),i.invites.map(u=>a.jsxs("p",{children:[a.jsx("strong",{children:u.role}),": ",u.accepted_cids.length," of ",u.min_accepts," accepted"]},u.invite_id)),a.jsxs("div",{className:"participant-list",children:[c.map(u=>a.jsxs("article",{className:"participant-card",children:[a.jsx("strong",{children:u.display_name}),a.jsxs("span",{children:[u.role,u.state==="pending"?" · pending":""]}),a.jsx("code",{className:"mono",children:u.identity}),a.jsxs("small",{children:["via ",u.invite_id," · ",Rs(u.accepted_at??u.requested_at)]})]},u.participant_id??u.identity)),c.length===0&&a.jsx("p",{className:"context-note",children:"No participants admitted yet."})]})]})}function _r({label:i,value:c,mono:u=!1}){return a.jsxs("div",{className:"detail-row",children:[a.jsx("span",{children:i}),a.jsx("strong",{className:u?"mono":void 0,children:c})]})}function Rs(i){const c=new Date(i);return Number.isNaN(c.valueOf())?i:c.toLocaleString()}function Zc(i){return`${i.charAt(0).toUpperCase()}${i.slice(1).replaceAll("_"," ")}`}async function Es(){throw new Error("Invite management is unavailable.")}function Mc(){}function Dc({records:i,mode:c}){const u=k.useMemo(()=>c==="events"?Hp(i):vi([],i),[c,i]);return u.length===0?a.jsxs("p",{className:"timeline-empty",children:["No ",c==="events"?"operational events":"archive records"," loaded."]}):a.jsx("ul",{className:"record-list","aria-label":c==="events"?"Operational events":"Complete archive",children:u.map(g=>{const m=sm(g);return a.jsxs("li",{className:"record-row",children:[a.jsxs("header",{children:[a.jsxs("code",{children:["#",g.seq]}),a.jsx("strong",{children:g.kind.replaceAll("_"," ")}),"status"in g&&a.jsx("span",{className:`record-status record-status--${g.status}`,children:g.status}),a.jsx("time",{dateTime:g.at,children:am(g.at)})]}),g.kind==="message"&&a.jsx("p",{children:g.text}),a.jsx("pre",{children:JSON.stringify(m,null,2)})]},g.record_id)})})}function sm(i){const{version:c,room_id:u,seq:g,record_id:m,at:y,text:S,...z}=i.kind==="message"?i:{...i,text:void 0};return Object.fromEntries(Object.entries(z).filter(([,j])=>j!==void 0))}function am(i){const c=new Date(i);return Number.isNaN(c.valueOf())?i:c.toLocaleString()}const bc="File integrity check failed; download blocked.",um="application/octet-stream";class Wn extends Error{constructor(){super(bc),this.name="FileIntegrityError"}}async function cm(i){const c=pm(i.dataBase64);if(c.byteLength!==i.size)throw new Wn;let u;try{const m=new Uint8Array(c.byteLength);m.set(c),u=await globalThis.crypto.subtle.digest("SHA-256",m.buffer)}catch{throw new Wn}if([...new Uint8Array(u)].map(m=>m.toString(16).padStart(2,"0")).join("")!==i.sha256)throw new Wn;return c}function dm(i){const c=i.replace(/[\\/]/gu,"_").replace(/[\p{Cc}\p{Cf}]/gu,"_").replace(/[ .]+$/gu,u=>"_".repeat(u.length));return c.length>0?c:"download"}async function fm(i,c=mm()){const u=await cm(i),g=new Uint8Array(u.byteLength);g.set(u);const m=c.createObjectURL(new Blob([g.buffer],{type:um}));try{const y=c.createAnchor();y.href=m,y.download=dm(i.filename),y.hidden=!0,y.click()}finally{c.schedule(()=>c.revokeObjectURL(m))}}function pm(i){if(!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(i))throw new Wn;let c;try{c=atob(i)}catch{throw new Wn}if(btoa(c)!==i)throw new Wn;return Uint8Array.from(c,u=>u.charCodeAt(0))}function mm(){return{createObjectURL:i=>URL.createObjectURL(i),revokeObjectURL:i=>URL.revokeObjectURL(i),createAnchor:()=>document.createElement("a"),schedule:i=>setTimeout(i,0)}}function hm({file:i}){return a.jsxs("article",{className:"file-attachment",children:[a.jsx("div",{className:"file-attachment__glyph","aria-hidden":"true",children:"↓"}),a.jsxs("div",{className:"file-attachment__body",children:[a.jsx("strong",{className:"file-name",dir:"auto",children:i.filename}),a.jsx("span",{children:Ts(i.size)})]}),a.jsx(Jc,{file:i})]})}function Jc({file:i}){const[c,u]=k.useState(!1),[g,m]=k.useState("");async function y(){if(!c){u(!0),m("");try{await fm(i)}catch(S){m(S instanceof Wn?bc:"Download failed.")}finally{u(!1)}}}return a.jsxs("div",{className:"file-download",children:[a.jsx("button",{className:"secondary-button file-download__button",type:"button",disabled:c,"aria-label":`Download ${i.filename}`,onClick:()=>void y(),children:c?"Preparing download":"Download"}),a.jsx("span",{className:"file-download__status",role:"status","aria-live":"polite",children:g})]})}function Ts(i){if(i<1024)return`${i} B`;const c=["KB","MB"];let u=i,g=-1;do u/=1024,g+=1;while(u>=1024&&g<c.length-1);return`${u>=10||Number.isInteger(u)?u.toFixed(0):u.toFixed(1)} ${c[g]}`}function vm({roomId:i,records:c,historyReady:u,visible:g}){const m=k.useMemo(()=>Vp(c),[c]),[y,S]=k.useState(qn),[z,j]=k.useState(""),E=k.useRef({maxSeq:0,ready:!1});k.useEffect(()=>{S(qn)},[i]),k.useEffect(()=>{var I,O;const C=((I=m.at(-1))==null?void 0:I.seq)??0,U=E.current;if(U.roomId!==i||!u||!U.ready){E.current={roomId:i,maxSeq:C,ready:u},j("");return}const L=m.filter(oe=>oe.seq>U.maxSeq),W=L.length;E.current={roomId:i,maxSeq:Math.max(U.maxSeq,C),ready:!0},j(g&&W>0?W===1?`1 new ${((O=L[0])==null?void 0:O.type)==="file"?"attachment":"message"}`:`${W} new room items`:"")},[u,i,m,g]);const D=Qp(m,y);return a.jsxs("div",{className:"chat-timeline",children:[m.length===0&&a.jsx("p",{className:"timeline-empty",children:"No archived communication yet."}),m.length>D.length&&a.jsx("button",{className:"quiet-button show-earlier",type:"button",onClick:()=>S(C=>Ns(C,m.length)),children:"Show 500 earlier"}),a.jsx("ul",{className:"chat-list","aria-label":"Room communication",children:D.map(C=>C.type==="briefing"?a.jsxs("li",{className:"chat-row chat-row--briefing",children:[a.jsxs("div",{className:"chat-row__meta",children:[a.jsx("strong",{children:"Mission briefing"}),a.jsx(Cs,{seq:C.seq,at:C.at})]}),a.jsx("p",{className:"chat-row__text",children:C.text})]},C.recordId):C.type==="file"?a.jsxs("li",{className:"chat-row chat-row--file",children:[a.jsxs("div",{className:"chat-row__meta",children:[a.jsx("strong",{children:C.author.display_name}),a.jsx("span",{children:C.author.role}),a.jsx(Cs,{seq:C.seq,at:C.at})]}),a.jsx(hm,{file:C})]},C.recordId):a.jsxs("li",{className:`chat-row chat-row--${C.speaker}`,children:[a.jsxs("div",{className:"chat-row__meta",children:[a.jsx("strong",{children:C.author.display_name}),a.jsx("span",{children:C.speaker==="room"?"Room voice":C.author.role}),a.jsx(Cs,{seq:C.seq,at:C.at})]}),a.jsx("p",{className:"chat-row__text",children:C.text})]},C.recordId))}),a.jsx("p",{className:"visually-hidden",role:"status","aria-label":"New room items","aria-live":"polite","aria-atomic":"true",children:z})]})}function Cs({seq:i,at:c}){const u=new Date(c);return a.jsxs(a.Fragment,{children:[a.jsxs("code",{children:["#",i]}),a.jsx("time",{dateTime:c,children:Number.isNaN(u.valueOf())?c:u.toLocaleString()})]})}function ym({roomId:i,records:c}){const u=k.useMemo(()=>Wp(c,i),[c,i]),[g,m]=k.useState(qn),[y,S]=k.useState(new Set),[z,j]=k.useState({});if(k.useEffect(()=>{m(qn),S(new Set),j({})},[i]),u.length===0)return a.jsx("p",{className:"timeline-empty",children:"No archived files yet."});const E=u.slice(0,g);return a.jsxs("div",{className:"files-view",children:[a.jsx("ul",{className:"file-group-list","aria-label":"Room files",children:E.map(D=>{const C=y.has(D.groupId),U=`file-versions-${D.groupId}`,L=z[D.groupId]??qn,W=D.versions.slice(0,L);return a.jsxs("li",{className:"file-group",children:[a.jsxs("button",{className:"file-group__toggle",type:"button","aria-expanded":C,"aria-controls":U,"aria-label":`${C?"Collapse":"Expand"} versions for ${D.filename}`,onClick:()=>S(I=>{const O=new Set(I);return O.has(D.groupId)?O.delete(D.groupId):O.add(D.groupId),O}),children:[a.jsx("span",{className:"file-group__chevron","aria-hidden":"true",children:"›"}),a.jsx("span",{className:"file-group__title file-name",dir:"auto",children:D.filename}),a.jsxs("span",{className:"file-group__count",children:[D.versions.length," ",D.versions.length===1?"version":"versions"]}),a.jsxs("span",{className:"file-group__latest",children:["Latest: ",D.latest.author.display_name," · ",a.jsx(Ic,{at:D.latest.at})," · ",Ts(D.latest.size)]})]}),C&&a.jsxs("div",{className:"file-version-panel",id:U,children:[a.jsx("ol",{className:"file-version-list","aria-label":`Versions of ${D.filename}`,children:W.map(I=>a.jsxs("li",{className:"file-version",children:[a.jsxs("div",{className:"file-version__details",children:[a.jsxs("strong",{children:["Version ",I.version]}),a.jsxs("span",{children:[I.author.display_name," · ",I.author.role]}),a.jsxs("span",{children:[a.jsx(Ic,{at:I.at})," · ",Ts(I.size)]}),a.jsx("span",{className:"file-version__mime",children:I.mime})]}),a.jsx(Jc,{file:I})]},I.recordId))}),D.versions.length>W.length&&a.jsx("button",{className:"quiet-button show-earlier",type:"button",onClick:()=>j(I=>({...I,[D.groupId]:Ns(L,D.versions.length)})),children:"Show 500 older versions"})]})]},D.latest.recordId)})}),u.length>E.length&&a.jsx("button",{className:"quiet-button show-earlier",type:"button",onClick:()=>m(D=>Ns(D,u.length)),children:"Show 500 earlier"})]})}function Ic({at:i}){const c=new Date(i);return a.jsx("time",{dateTime:i,children:Number.isNaN(c.valueOf())?i:c.toLocaleString()})}const Fc=262144;function gm({roomState:i,connected:c,state:u,onDraftChange:g,onSend:m}){const{draft:y,pending:S,error:z}=u,j=i==="active"&&c,E=_m(y)>Fc?`Message must be at most ${Fc} UTF-8 bytes.`:void 0,D=j&&!S&&y.length>0&&!E;async function C(W){W==null||W.preventDefault(),D&&await m(y)}function U(W){W.key!=="Enter"||W.shiftKey||(W.preventDefault(),C())}const L=c?i!=="active"?`Messaging is unavailable while the room is ${i}.`:void 0:"Disconnected. Drafts remain local until the daemon is available.";return a.jsxs("form",{className:"room-composer",onSubmit:C,children:[a.jsx("label",{className:"visually-hidden",htmlFor:"room-message",children:"Message the room"}),a.jsx("textarea",{id:"room-message",rows:3,value:y,disabled:!j||S,placeholder:"Message as the room identity",onChange:W=>g(W.target.value),onKeyDown:U,"aria-describedby":"composer-help","aria-invalid":!!E}),a.jsxs("div",{className:"composer-footer",children:[a.jsx("small",{id:"composer-help",children:E??L??"Enter to send · Shift+Enter for a new line"}),a.jsx("button",{className:"primary-button",type:"submit",disabled:!D,children:S?"Sending…":"Send message"})]}),z&&a.jsx("p",{className:"form-error",role:"alert",children:z})]})}function _m(i){return new TextEncoder().encode(i).byteLength}const Hn=["communication","files","events","archive"];function wm({room:i,records:c=[],historyReady:u=!1,connected:g,visible:m=!0,composerState:y,onComposerDraft:S,onOpenRooms:z,onOpenContext:j,onSettings:E,onSendMessage:D=km}){const[C,U]=k.useState("communication"),L=k.useRef({});if(!i)return a.jsxs("main",{className:"workspace workspace--empty",children:[a.jsx("button",{className:"icon-button mobile-rooms",type:"button",onClick:z,"aria-label":"Open rooms",children:"☰"}),a.jsxs("div",{className:"empty-workspace",children:[a.jsx("span",{className:"empty-workspace__glyph","aria-hidden":"true",children:"⌁"}),a.jsx("p",{className:"eyebrow",children:"Mission control"}),a.jsx("h1",{children:"Select a room"}),a.jsx("p",{children:"Choose a mission room to inspect its state and coordinate its work."})]})]});const W=mt(i.state,g);return a.jsxs("main",{className:"workspace",children:[a.jsxs("header",{className:"workspace-header",children:[a.jsx("button",{className:"icon-button mobile-rooms",type:"button",onClick:z,"aria-label":"Open rooms",children:"☰"}),a.jsxs("div",{className:"workspace-identity",children:[a.jsx("p",{className:"eyebrow",children:"Mission room"}),a.jsx("h1",{children:Ms(i)})]}),a.jsx("span",{className:`lifecycle-badge lifecycle-badge--${i.state}`,children:Sm(i.state)}),a.jsx("button",{className:"secondary-button context-toggle",type:"button",onClick:j,"data-modal-fallback":"true",children:"Context"})]}),a.jsxs("div",{className:"mission-strip",children:[a.jsx("span",{children:"Goal"}),a.jsx("p",{children:i.mission.goal}),a.jsx("button",{className:"quiet-button",type:"button",onClick:I=>E(I.currentTarget),disabled:!W.canEditSettings,children:"Room settings"})]}),a.jsx("nav",{className:"workspace-tabs","aria-label":"Room workspace",role:"tablist",children:Hn.map(I=>a.jsx("button",{ref:O=>{L.current[I]=O??void 0},id:`workspace-tab-${I}`,type:"button",role:"tab","aria-controls":`workspace-panel-${I}`,"aria-selected":C===I,tabIndex:C===I?0:-1,onClick:()=>U(I),onKeyDown:O=>{var ge;const oe=Hn.indexOf(I),ee=O.key==="ArrowRight"?(oe+1)%Hn.length:O.key==="ArrowLeft"?(oe-1+Hn.length)%Hn.length:O.key==="Home"?0:O.key==="End"?Hn.length-1:void 0;if(ee===void 0)return;O.preventDefault();const le=Hn[ee];U(le),(ge=L.current[le])==null||ge.focus()},children:I[0].toUpperCase()+I.slice(1)},I))}),a.jsxs("section",{className:"workspace-content",id:`workspace-panel-${C}`,role:"tabpanel","aria-labelledby":`workspace-tab-${C}`,"aria-label":`${C} panel`,tabIndex:0,children:[C==="communication"&&a.jsx(xm,{room:i,records:c,historyReady:u,connected:g,visible:m,composerState:y??Em,onComposerDraft:S??Cm,onSendMessage:D}),C==="files"&&a.jsx(ym,{roomId:i.room_id,records:c}),C==="events"&&a.jsx(Dc,{records:c,mode:"events"}),C==="archive"&&a.jsx(Dc,{records:c,mode:"archive"})]})]})}function xm({room:i,records:c,historyReady:u,connected:g,visible:m,composerState:y,onComposerDraft:S,onSendMessage:z}){const j=c.some(E=>E.kind==="message"&&E.category==="briefing");return a.jsxs("div",{className:"communication-shell",children:[!j&&a.jsxs("article",{className:"briefing-card",children:[a.jsx("p",{className:"eyebrow",children:"Mission briefing"}),a.jsx("p",{children:i.mission.briefing})]}),i.state!=="active"&&a.jsx("p",{className:`lifecycle-separator lifecycle-separator--${i.state}`,children:i.state==="provisioning"?"Room setup in progress · messaging begins after activation":i.state==="closing"?"Room closure in progress · mutations are disabled":"Room closed · read-only local archive"}),a.jsx(vm,{roomId:i.room_id,records:c,historyReady:u,visible:m}),a.jsx(gm,{roomState:i.state,connected:g,state:y,onDraftChange:S,onSend:z})]})}function Sm(i){return i==="provisioning"?"Provisioning":i[0].toUpperCase()+i.slice(1)}async function km(){throw new Error("Room messaging is unavailable.")}const Em={draft:"",pending:!1};function Cm(){}function Ac(i){if(!Number.isFinite(i.intervalMs)||i.intervalMs<=0)throw new TypeError("poll interval must be positive");let c=!1,u=0;const g=i.clock??{setInterval:globalThis.setInterval.bind(globalThis),clearInterval:globalThis.clearInterval.bind(globalThis)};let m,y;function S(j){if(!c||u!==j||!i.visible())return Promise.resolve();if((y==null?void 0:y.generation)===j)return y.dirty=!0,y.promise;const E={generation:j,controller:new AbortController,dirty:!1,promise:Promise.resolve()};return y=E,E.promise=z(E),E.promise}async function z(j){try{do{j.dirty=!1;try{await i.run(j.controller.signal)}catch(E){if(!c||u!==j.generation||j.controller.signal.aborted)return;throw E}}while(j.dirty&&c&&u===j.generation&&i.visible())}finally{y===j&&(y=void 0)}}return{start(){if(c)return;c=!0;const j=++u;m=g.setInterval(()=>{S(j).catch(()=>{})},i.intervalMs)},refresh(){return S(u)},stop(){if(!c)return;c=!1,u+=1,m!==void 0&&g.clearInterval(m),m=void 0;const j=y;y=void 0,j==null||j.controller.abort()}}}const jm={call:(i,c,u)=>fp(i,c,{signal:u==null?void 0:u.signal})};function Nm({rpc:i=jm,clock:c}){var Xn;const[u,g]=k.useState([]),[m,y]=k.useState(()=>$c(location.hash)),[S,z]=k.useState(),[j,E]=k.useState([]),[D,C]=k.useState({}),[U,L]=k.useState({}),[W,I]=k.useState({}),[O,oe]=k.useState(null),[ee,le]=k.useState(),[ge,xe]=k.useState(),[pe,Re]=k.useState(!1),[Ee,te]=k.useState(!1),[Ye,Ke]=k.useState(!1),[it,Te]=k.useState(!1),[ot,lt]=k.useState([]),[Xe,Ce]=k.useState("state"),[$,X]=k.useState(!1),[V,h]=k.useState(!1),N=Bc("(max-width: 999px)"),ne=Bc("(max-width: 759px)"),re=k.useRef(),ae=k.useRef(),ie=k.useRef(0),fe=k.useRef({}),ue=k.useRef({}),se=k.useRef([]),_e=k.useRef(new Set),tt=k.useRef(null),yi=k.useRef(),st=k.useRef(m),Yn=k.useRef(),Er=k.useRef(),Cr=k.useRef(),Kn=k.useRef(),jr=k.useRef(null),At=k.useCallback(x=>{tt.current=x,oe(x)},[]),Ae=k.useCallback(x=>{x&&_e.current.has(x.room_id)||(yi.current=x,z(x))},[]),Pt=k.useCallback(x=>{const A=x.filter(F=>!_e.current.has(F.room_id));se.current=A,g(A)},[]),tn=k.useCallback(x=>{if(_e.current.has(x.room_id))return;const A=se.current.some(F=>F.room_id===x.room_id)?se.current.map(F=>F.room_id===x.room_id?x:F):[...se.current,x];se.current=A,g(A)},[]),Wt=k.useCallback((x,A)=>{if(_e.current.has(x))return;const F=A(ue.current[x]??Po);ue.current={...ue.current,[x]:F},I(ue.current)},[]),Nn=k.useCallback(()=>!document.hidden,[]),gi=k.useCallback(()=>jr.current??void 0,[]),Se=k.useCallback((x,A)=>{const F=x instanceof Error?x.message:"Unexpected daemon error.";xe(A?`${A}: ${F}`:F)},[]),nn=k.useCallback(async(x,A={})=>{var me;if(_e.current.has(x))return;let F=fe.current[x]??[],b=((me=F.at(-1))==null?void 0:me.seq)??0;const Y=()=>{var he;return!((he=A.signal)!=null&&he.aborted)&&!_e.current.has(x)&&(A.generation===void 0||ie.current===A.generation)};for(;Y();){const he=await i.call("room.history",{room_id:x,after:b,limit:200},A.signal?{signal:A.signal}:void 0);if(!Y())return;if(!Pp(he)||he.some((ht,Qt)=>ht.room_id!==x||ht.seq!==b+Qt+1))throw new Error("daemon returned an invalid history page");if(he.length>0){if(!Y())return;F=vi(fe.current[x]??F,he),fe.current={...fe.current,[x]:F},C(fe.current)}if(he.length===0){if(!Y())return;L(ht=>_e.current.has(x)||ht[x]?ht:{...ht,[x]:!0});return}b+=he.length}},[i]);k.useEffect(()=>{const x=Ac({intervalMs:5e3,visible:Nn,clock:c,run:async F=>{const b=st.current;try{const Y=await i.call("room.list",{},{signal:F});if(!Cp(Y))throw new Error("daemon returned an invalid room list");const me=Y.filter(he=>!_e.current.has(he.room_id));Pt(me),At(!0),xe(he=>he!=null&&he.startsWith("Disconnected:")?void 0:he),b&&st.current===b&&!me.some(he=>he.room_id===b)&&(st.current=void 0,y(void 0),Ae(void 0),E([]),le(`Room “${b}” is no longer available. No local data was changed.`),location.hash&&history.replaceState(null,"",`${location.pathname}${location.search}#/`))}catch(Y){if(F.aborted)return;At(!1);const me=Y instanceof Error?Y.message:"cowork daemon is unavailable";xe(`Disconnected: ${me}. Loaded room data is preserved.`)}}});re.current=x,x.start(),x.refresh();const A=()=>{document.hidden||x.refresh()};return document.addEventListener("visibilitychange",A),()=>{document.removeEventListener("visibilitychange",A),re.current=void 0,x.stop()}},[c,Pt,i,At,Ae,Nn]),k.useEffect(()=>{const x=()=>{const A=$c(location.hash),F=A&&!_e.current.has(A)?A:void 0;st.current=F,y(F),E([]),A&&!F&&history.replaceState(null,"",`${location.pathname}${location.search}#/`)};return window.addEventListener("hashchange",x),()=>window.removeEventListener("hashchange",x)},[]),k.useEffect(()=>{const x=++ie.current;if(!m){Ae(void 0),E([]);return}if(_e.current.has(m)){st.current=void 0,y(void 0),Ae(void 0),E([]),location.hash&&history.replaceState(null,"",`${location.pathname}${location.search}#/`);return}const A=u.find(Y=>Y.room_id===m);A&&Ae(A);const F=Ac({intervalMs:2e3,visible:Nn,clock:c,run:async Y=>{try{const[me,he,ht]=await Promise.allSettled([i.call("room.show",{room_id:m},{signal:Y}),i.call("room.participants",{room_id:m},{signal:Y}),nn(m,{generation:x,signal:Y})]);if(Y.aborted||ie.current!==x||_e.current.has(m))return;if(me.status==="rejected")throw me.reason;const Qt=me.value;if(!pi(Qt))throw new Error("daemon returned invalid room details");if(ie.current!==x||_e.current.has(m)||Qt.room_id!==m)return;if(Ae(Qt),he.status==="fulfilled"&&Ec(he.value)){const on=he.value;E(Gn=>_e.current.has(m)||ie.current!==x||Rm(Gn,on)?Gn:on)}he.status==="fulfilled"&&!Ec(he.value)?Se(new Error("daemon returned invalid participant details"),"Participant refresh failed"):he.status==="rejected"&&!Y.aborted&&Se(he.reason,"Participant refresh failed"),ht.status==="rejected"&&!Y.aborted&&Se(ht.reason,"History refresh failed"),tn(Qt),At(!0)}catch(me){if(Y.aborted||ie.current!==x)return;At(!1),Se(me,"Disconnected")}}});ae.current=F,F.start(),F.refresh();const b=()=>{document.hidden||F.refresh()};return document.addEventListener("visibilitychange",b),()=>{document.removeEventListener("visibilitychange",b),ae.current===F&&(ae.current=void 0),F.stop()}},[c,nn,tn,Se,i,m,At,Ae,Nn]);const rn=k.useCallback(x=>{if(_e.current.has(x)){st.current=void 0,y(void 0),Ae(void 0),E([]),history.replaceState(null,"",`${location.pathname}${location.search}#/`);return}st.current=x,y(x),E([]),le(void 0),Ke(!1),Te(!1),X(!1);const A=`#/rooms/${encodeURIComponent(x)}`;location.hash!==A&&(location.hash=A)},[Ae]),qe=k.useCallback(()=>{var x,A;(x=re.current)==null||x.refresh(),(A=ae.current)==null||A.refresh()},[]),Rn=k.useCallback(async(x,A,F)=>{if(tt.current!==!0)throw new Error("The daemon is disconnected. Your fields are retained.");try{const b=await i.call("room.create",{name:x,goal:A.trim(),briefing:F.trim()});if(!pi(b))throw new Error("daemon returned invalid created room details");Re(!1),Ce("invite"),h(!0),rn(b.room_id),qe()}catch(b){throw Se(b,"Create room failed"),b}},[qe,Se,i,rn]),Tn=k.useCallback(async(x,A)=>{if(Object.keys(A).length===0)return;const F=se.current.find(b=>b.room_id===x);if(tt.current!==!0)throw new Error("The daemon is disconnected. Your fields are retained.");if(!F||!mt(F.state,!0).canEditSettings)throw new Error("Room settings are unavailable in the current lifecycle. Your fields are retained.");try{const b=await i.call("room.settings",{room_id:x,...A});if(!pi(b)||b.room_id!==x)throw new Error("daemon returned invalid updated room details");te(!1),qe()}catch(b){throw Se(b,"Settings update failed"),b}},[qe,Se,i]),de=k.useMemo(()=>(S==null?void 0:S.room_id)===m?S:u.find(x=>x.room_id===m),[u,S,m]),_i=k.useCallback(async(x,A)=>{const F=se.current.find(b=>b.room_id===x);if(tt.current!==!0)throw new Error("The daemon is disconnected. The invite form is retained.");if(!F||!mt(F.state,!0).canCreateInvite)throw new Error("Invites are unavailable in the current room lifecycle. The form is retained.");try{const b={room_id:x,...A},Y=await i.call("room.invite",b),me=Np(Y,b);lt(he=>[...he,{room_id:x,receipts:[me]}]),qe()}catch(b){throw Se(b,"Create invite failed"),b}},[qe,Se,i]),wi=k.useCallback(async(x,A)=>{const F=se.current.find(Y=>Y.room_id===x),b=F==null?void 0:F.invites.find(Y=>Y.invite_id===A);if(tt.current!==!0)throw new Error("The daemon is disconnected. The revoke confirmation is retained.");if(!F||!mt(F.state,!0).canRevokeInvite||!b||!Pm(b.state))throw new Error("This invite can no longer be revoked. The confirmation is retained.");try{const Y=await i.call("room.revoke",{room_id:x,invite_id:A});return qe(),Y}catch(Y){throw Se(Y,"Revoke invite failed"),Y}},[qe,Se,i]),Do=k.useCallback(async x=>{const A=se.current.find(F=>F.room_id===x);if(tt.current!==!0)throw new Error("The daemon is disconnected. Recovery was not started.");if(!A||!mt(A.state,!0).canRecoverInvite||!A.invites.some(F=>F.state==="replacement_required"))throw new Error("Invite recovery is unavailable in the current room state.");try{const F=await i.call("room.recover",{room_id:A.room_id}),b=Rp(F,A);b.length>0&<(Y=>[...Y,{room_id:A.room_id,receipts:b}]),qe()}catch(F){throw Se(F,"Recover invites failed"),F}},[qe,Se,i]),Nr=k.useCallback(async x=>{if(!x.recovery_of)throw new Error("Recovery receipt has no old invite pointer.");const A=se.current.find(F=>F.room_id===x.room_id);if(tt.current!==!0)throw new Error("The daemon is disconnected. The recovery receipt is retained.");if(!A||!Uc(A,x))throw new Error("The exact recovery lineage is no longer confirmable. The receipt is retained.");try{const F=await i.call("room.recover.confirm",{room_id:x.room_id,recovery_of:x.recovery_of,invite_id:x.invite.invite_id});Tp(F,x),qe()}catch(F){throw Se(F,"Confirm recovery failed"),F}},[qe,Se,i]),Rr=k.useCallback(async(x,A)=>{const F=ue.current[x]??Po;if(F.pending||F.draft!==A)return;const b=se.current.find(Y=>Y.room_id===x);if(tt.current!==!0||!b||!mt(b.state,!0).canMessage){Wt(x,Y=>({...Y,error:"Messaging is unavailable because the connection or room lifecycle changed. Your draft is retained."}));return}Wt(x,Y=>({...Y,pending:!0,error:void 0}));try{const Y=await i.call("room.message",{room_id:x,text:A});if(!Wc(Y)||Y.kind!=="message"||Y.room_id!==x||Y.category!=="chat"||Y.text!==A||Y.author.identity!==b.identity_cid||Y.author.display_name!==b.identity_name||Y.author.role!=="room")throw new Error("daemon returned invalid message confirmation");if(_e.current.has(x))return;Wt(x,me=>({draft:me.draft===A?"":me.draft,pending:!1})),nn(x).catch(me=>Se(me,"History refresh failed"))}catch(Y){Wt(x,me=>({...me,pending:!1,error:Tm(Y)}))}},[nn,Se,i,Wt]),Tr=k.useCallback(async x=>{const A=se.current.find(F=>F.room_id===x);if(tt.current!==!0)throw new Error("The daemon is disconnected. The room was not closed.");if(!A||!mt(A.state,!0).canClose)throw new Error("This room cannot be closed from its current state.");try{const F=await i.call("room.close",{room_id:x});if(!pi(F)||F.room_id!==x||F.state!=="closed")throw new Error("daemon returned invalid closed room details");st.current===x&&Ae(F),tn(F),Ke(!1),qe()}catch(F){throw Se(F,"Close room failed"),F}},[qe,tn,Se,i,Ae]),Pr=k.useCallback(async x=>{var F,b;const A=se.current.find(Y=>Y.room_id===x);if(tt.current!==!0)throw new Error("The daemon is disconnected. The room was not deleted.");if(!A||!mt(A.state,!0).canDelete)throw new Error("Only a closed room can be deleted.");try{const Y=await i.call("room.delete",{room_id:x,confirm:!0});if(!zp(Y)||Y.room_id!==x)throw new Error("daemon returned invalid deletion confirmation");_e.current.add(x),ie.current+=1,(F=ae.current)==null||F.stop(),Pt(se.current.filter(me=>me.room_id!==x)),Ae(void 0),y(void 0),st.current=void 0,E([]),fe.current=Object.fromEntries(Object.entries(fe.current).filter(([me])=>me!==x)),C(fe.current),ue.current=Object.fromEntries(Object.entries(ue.current).filter(([me])=>me!==x)),I(ue.current),L(me=>Object.fromEntries(Object.entries(me).filter(([he])=>he!==x))),Te(!1),h(!1),le(`Room “${x}” was deleted from this host. Remote copies and backups were not purged.`),history.replaceState(null,"",`${location.pathname}${location.search}#/`),(b=re.current)==null||b.refresh()}catch(Y){throw Se(Y,"Delete room failed"),Y}},[Pt,Se,i,Ae]);return a.jsxs("div",{className:"cowork-app",children:[a.jsx(Xp,{rooms:u,selectedRoomId:m,connected:O,open:$,sheet:ne,onClose:()=>X(!1),onCreate:x=>{Yn.current=x,Re(!0)},onSelect:rn}),a.jsx(wm,{room:de,records:de?D[de.room_id]??[]:[],historyReady:!!(de&&U[de.room_id]),connected:O===!0,visible:!document.hidden,composerState:de?W[de.room_id]??Po:Po,onComposerDraft:de?x=>Wt(de.room_id,A=>({...A,draft:x})):void 0,onOpenRooms:()=>X(!0),onOpenContext:()=>h(!0),onSettings:x=>{Er.current=x,te(!0)},onSendMessage:de?x=>Rr(de.room_id,x):void 0}),a.jsx(im,{room:de,participants:j,archiveCount:de?((Xn=D[de.room_id])==null?void 0:Xn.length)??0:0,connected:O===!0,tab:Xe,open:V,drawer:N,panelRef:jr,onTab:Ce,onClose:()=>h(!1),onCreateInvite:de?x=>_i(de.room_id,x):void 0,onRevokeInvite:de?x=>wi(de.room_id,x):void 0,onRecoverInvites:de?()=>Do(de.room_id):void 0,onRequestClose:x=>{Cr.current=x,Ke(!0)},onRequestDelete:x=>{Kn.current=x,Te(!0)}}),(ne&&$||N&&V)&&a.jsx("button",{className:"responsive-scrim",type:"button","aria-label":"Close open panel",onClick:()=>{X(!1),h(!1)}}),O===!1&&a.jsxs("div",{className:"disconnect-banner",role:"status",children:[a.jsx("strong",{children:"Disconnected"}),a.jsx("span",{children:"Loaded data remains visible. Mutations are disabled until the daemon answers."})]}),ge&&a.jsxs("div",{className:"error-banner",role:"alert",children:[a.jsx("span",{children:ge}),a.jsx("button",{type:"button",onClick:()=>xe(void 0),"aria-label":"Dismiss error",children:"×"})]}),ee&&a.jsxs("div",{className:"notice-banner",role:"status",children:[a.jsx("span",{children:ee}),a.jsx("button",{type:"button",onClick:()=>le(void 0),"aria-label":"Dismiss notice",children:"×"})]}),a.jsx(Gp,{open:pe,connected:O===!0,restoreFocus:Yn.current,fallbackFocus:gi,onClose:()=>Re(!1),onCreate:Rn}),de&&Ee&&a.jsx(Zp,{room:de,open:!0,connected:O===!0,capable:mt(de.state,O===!0).canEditSettings,restoreFocus:Er.current,onClose:()=>te(!1),onSave:x=>Tn(de.room_id,x)},de.room_id),de&&Ye&&a.jsx(bp,{room:de,open:!0,connected:O===!0,capable:mt(de.state,O===!0).canClose,restoreFocus:Cr.current,onClose:()=>Ke(!1),onConfirm:()=>Tr(de.room_id)},`close:${de.room_id}`),de&&it&&a.jsx(Jp,{room:de,open:!0,connected:O===!0,capable:mt(de.state,O===!0).canDelete,restoreFocus:Kn.current,onClose:()=>Te(!1),onConfirm:()=>Pr(de.room_id)},`delete:${de.room_id}`),ot[0]&&a.jsx(tm,{vault:ot[0],connected:O===!0,canConfirm:x=>{const A=u.find(F=>F.room_id===x.room_id);return!!(A&&Uc(A,x))},onClose:()=>lt(x=>x.slice(1)),onConfirm:Nr})]})}function $c(i){const c=/^#\/rooms\/([^/?#]+)$/.exec(i);if(c!=null&&c[1])try{return decodeURIComponent(c[1])}catch{return}}function Rm(i,c){return i.length===c.length&&i.every((u,g)=>JSON.stringify(u)===JSON.stringify(c[g]))}const Po={draft:"",pending:!1};function Tm(i){return i instanceof wt&&i.outcomeUnknown?`The message request did not receive a confirmation, so its outcome is unknown. Your draft is retained. ${i.message}`:i instanceof Error?i.message:"Message send failed."}function Pm(i){return i==="live"||i==="replacement_required"||i==="receipt_pending"}function Uc(i,c){if(!mt(i.state,!0).canRecoverInvite||c.recovery_of===void 0)return!1;const u=i.invites.find(m=>m.invite_id===c.recovery_of);if(!u||u.mode!==c.invite.mode||u.role!==c.invite.role||u.min_accepts!==c.invite.min_accepts)return!1;const g=i.invites.find(m=>m.invite_id===c.invite.invite_id);return g?g.recovery_of!==u.invite_id||g.mode!==u.mode||g.role!==u.role||g.min_accepts!==u.min_accepts?!1:g.state==="receipt_pending"?u.state==="replacement_required"&&g.recovery_confirmed===!1&&g.accepted_cids.length===0:u.state==="revoked"&&g.recovery_confirmed===!0&&(g.state==="live"||g.state==="consumed"||g.state==="replacement_required"||g.state==="revoked"):u.state==="replacement_required"}function Bc(i){const c=k.useMemo(()=>typeof window.matchMedia=="function"?window.matchMedia(i):void 0,[i]),[u,g]=k.useState(()=>(c==null?void 0:c.matches)??!1);return k.useEffect(()=>{if(!c)return;const m=y=>g(y.matches);return g(c.matches),c.addEventListener("change",m),()=>c.removeEventListener("change",m)},[c]),u}const ed=document.getElementById("root");if(!ed)throw new Error("missing root element");op.createRoot(ed).render(a.jsx(k.StrictMode,{children:a.jsx(Nm,{})}));
|
package/docs/01-prerequisites.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Prerequisites
|
|
2
2
|
|
|
3
|
-
ours-cowork requires Node.js 20 or newer and one already-running shared ours daemon. Install the operator lifecycle with `npm install --global @ours.network/cli@2.0.1`, then use `ours daemon start` or `ours daemon install-service --yes`. The shared daemon owns broker connectivity and global identity state; cowork attaches through `@ours.network/sdk` 3.0
|
|
3
|
+
ours-cowork requires Node.js 20 or newer and one already-running shared ours daemon. Install the operator lifecycle with `npm install --global @ours.network/cli@2.0.1`, then use `ours daemon start` or `ours daemon install-service --yes`. The shared daemon owns broker connectivity and global identity state; cowork attaches through `@ours.network/sdk` 3.3.0 and never starts a runtime of its own.
|
|
4
4
|
|
|
5
5
|
The selected SDK and CLI must include the external-history storage epoch: structured `listIncomingMessages`/`getHistoryItem`/`getMessages` and `listIncomingFiles`/`fetchFile`/selected `getFiles` APIs backed by per-identity history and immutable blobs. A package with the same nominal version but the older packet-inbox contract is not compatible.
|
|
6
6
|
|
package/docs/06-invites.md
CHANGED
|
@@ -10,7 +10,19 @@ ours-cowork room revoke <room-id> <invite-id>
|
|
|
10
10
|
|
|
11
11
|
The invite blob is returned only in an invite or recovery receipt. Store or transmit that receipt as needed; durable room metadata intentionally does not store the blob.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Current SDK rooms expose the core's authenticated inviter-side mapping from an
|
|
14
|
+
established contact CID to the existing invite ID used by that handshake. Cowork
|
|
15
|
+
may therefore keep multiple invitations live concurrently: each established
|
|
16
|
+
contact is admitted only through that exact live invite ID and inherits that
|
|
17
|
+
invite's role and requirement. Missing, unknown, revoked, or
|
|
18
|
+
unconfirmed-recovery provenance never admits a seat. This is local read-only
|
|
19
|
+
metadata: it does not change the invite wire format and the redeemer does not
|
|
20
|
+
echo an invite ID back through `addContact`.
|
|
21
|
+
|
|
22
|
+
For compatibility, an older SDK that omits the `origins` field retains the
|
|
23
|
+
single-live restriction. Legacy contacts without a stored origin remain unseated
|
|
24
|
+
after upgrade; Cowork does not guess their role. Upgrade the ours SDK before
|
|
25
|
+
relying on concurrent invitations.
|
|
14
26
|
|
|
15
27
|
The web console shows each returned invite secret once in a blocking receipt. Copy and save it before choosing Done: closing the receipt discards the browser copy. The secret is not placed in the URL, browser storage, logs, or room metadata. One-time and public receipts use the same handling.
|
|
16
28
|
|
|
@@ -41,6 +41,13 @@ Daemon history responses are capped at 3 MiB of JSON so one 2 MiB file record (a
|
|
|
41
41
|
|
|
42
42
|
Participant messages and files are accepted only from durable seats in an active room. A file is opaque binary data: cowork neither interprets its MIME metadata nor executes its contents. Its filename must be a path-free name of at most 255 UTF-8 bytes (not `.`, `..`, or a name containing `/`, `\\`, or NUL); MIME metadata may be empty and is limited to 255 UTF-8 bytes. Zero-byte files are valid. The maximum file size is 2 MiB (2,097,152 bytes), and a larger file is rejected explicitly.
|
|
43
43
|
|
|
44
|
+
Every participant-facing version-one room envelope includes the authenticated
|
|
45
|
+
top-level `room_name`, including messages, file metadata, and the
|
|
46
|
+
`room_not_member` notice. It is the room's validated presentation name (trimmed,
|
|
47
|
+
Unicode NFC, 1–64 characters, with control and format characters rejected), so
|
|
48
|
+
clients can render the task/room title without deriving it from the SDK identity
|
|
49
|
+
name, slug, or room ID.
|
|
50
|
+
|
|
44
51
|
Incoming message listings contain authorization metadata but no body. Cowork resolves each selected wire ID through persistent SDK history, verifies that the history row matches the listing, archives the message and complete recipient-intent fan-out, and then asks the SDK to read one oldest unread row. If an older introduction becomes unread between listing and acknowledgement, that authoritative row is archived through the same intake path before cowork retries the expected row. There is no defer operation; an empty acknowledgement means another reader already advanced the expected row.
|
|
45
52
|
|
|
46
53
|
For a file, cowork reads the identity-scoped immutable blob while the item is still unread and verifies its length and SHA-256 against SDK metadata. It then durably archives the exact bytes as canonical base64 together with the reply reference and every per-recipient relay intent before selecting that exact 64-hex wire ID with `getFiles`. Each other active seat receives two SDK items: an authenticated `room_file` metadata envelope and a binary file containing the original bytes. The SDK receives bytes, never a local filesystem path, so there is no staging-file or path-permission dependency. A seat removed after fan-out is skipped terminally without receiving metadata or bytes. A crash can redrive an unfinished recipient from the cowork archive; an already terminal recipient is not retried.
|
package/docs/11-web-console.md
CHANGED
|
@@ -25,7 +25,7 @@ Every room operation is carried by the single route `POST /rpc` with the envelop
|
|
|
25
25
|
|
|
26
26
|
1. Choose Create room and enter the friendly Name, Goal, and Briefing. The name is shown in the room list, workspace header, and room details.
|
|
27
27
|
2. Submit once. The new room is selected and its Invite panel opens.
|
|
28
|
-
3. Add one
|
|
28
|
+
3. Add one or more invitation requirements. Choose one-time or public mode and set the minimum acceptances for a public invite. Each contact is admitted into the exact role authenticated by the invite it redeemed. An older SDK without invite provenance will ask you to revoke or consume the current invite before creating another.
|
|
29
29
|
4. Copy every invite from its blocking receipt before choosing Done. The secret is shown once and is not retained in browser storage, the URL, logs, or durable room metadata.
|
|
30
30
|
|
|
31
31
|
The room activates after its durable invitation requirements are satisfied. Participants shows admitted identities and their invite roles.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ours.network/cowork",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Durable ours mission rooms on the shared ours daemon.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "FSL-1.1-Apache-2.0",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"test:release": "node --test tests/static-gates.test.mjs"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@ours.network/sdk": "3.0
|
|
29
|
+
"@ours.network/sdk": "3.3.0",
|
|
30
30
|
"react": "18.3.1",
|
|
31
31
|
"react-dom": "18.3.1",
|
|
32
32
|
"zod": "^3.23.8"
|