diff --git a/.eslintignore b/.eslintignore index e57be2186..8f9434ed3 100644 --- a/.eslintignore +++ b/.eslintignore @@ -48,3 +48,4 @@ package-lock.json /suites/react-stockcharts /suites-experimental/responsive-design/build-dev/ +/suites-experimental/stormbox-react/ diff --git a/.prettierignore b/.prettierignore index 0b1b6168e..40d154c13 100644 --- a/.prettierignore +++ b/.prettierignore @@ -48,3 +48,4 @@ package-lock.json /suites/react-stockcharts /suites-experimental/responsive-design/build-dev/ /suites-experimental/responsive-design/**/*.generated.css +/suites-experimental/stormbox-react/ diff --git a/suites-experimental/stormbox-react/.gitignore b/suites-experimental/stormbox-react/.gitignore new file mode 100644 index 000000000..07e6e472c --- /dev/null +++ b/suites-experimental/stormbox-react/.gitignore @@ -0,0 +1 @@ +/node_modules diff --git a/suites-experimental/stormbox-react/LICENSE b/suites-experimental/stormbox-react/LICENSE new file mode 100644 index 000000000..d0a1fa148 --- /dev/null +++ b/suites-experimental/stormbox-react/LICENSE @@ -0,0 +1,373 @@ +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at https://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. diff --git a/suites-experimental/stormbox-react/README.md b/suites-experimental/stormbox-react/README.md new file mode 100644 index 000000000..f9af28b03 --- /dev/null +++ b/suites-experimental/stormbox-react/README.md @@ -0,0 +1,109 @@ +# Stormbox-React + +A React clone of the Stormbox webmail front end (Vue 3, Thunderbird) and no +server: the mailbox is generated in the page from a fixed seed, so every +run renders the same folders, messages and dates. + + npm install + npm run dev # development React + npm run build # production build into dist/, plus dist/resources.txt + npm run preview # serve dist/ (use this for timing outside Speedometer) + npm run typecheck + +The committed `dist/` is what the suite runs; rebuild and commit it after +changing `src/`. Run it with `/?developerMode&suites=Stormbox-React`. + +The suite loads `dist/index.html?animations=off`, which removes CSS +transitions and the reading pane's 310ms wait for the folder list, so the +800px viewport's responsive layout (opening a message hides the folder list) +happens within the interaction that triggers it. + +Steps, each interaction followed by a task yield: + +- `SwitchFolders`: large folders, nested subfolders and the Starred tag view. +- `ScrollMessageList`: the virtualized Inbox, a viewport at a time, then in + strides. +- `ReadMessages`: opens a message, then the next 15 with J. HTML bodies go + through DOMPurify, dark-mode adaptation and a sandboxed srcdoc iframe. +- `StarAndTagMessages`: the row overlay's star, and its tag popover. +- `BulkActions`: select all 1,200 Inbox messages, mark read, star, tag. +- `QuickFilter`: types and erases a filter over the Inbox. +- `ArchiveAndDelete`: checkbox selections archived and deleted, then Trash + emptied. +- `ComposeAndSend`: replies (Squire with the quoted message) and new + messages with a recipient pill, all sent. +- `ToggleTheme`: light and dark with an HTML newsletter open. + +## Scope + +The Mail space is cloned: + +- Top bar (quick filter, theme toggle, app drawer, account menu), spaces + rail and the folder list with nested and starred folders, the Tags + section and storage bar. +- The virtualized message list (`@tanstack/react-virtual`, 64px rows, + 96px card rows under 480px) with Stormbox's header tiers, Unread and + Starred filters, the Quick Filter, anchored multi-select (checkbox, + Shift/Cmd-click, Shift+Arrow, Cmd+A), bulk actions with overflow, the + row hover overlay (tag, star, archive, delete), the tag menu as dropdown + and popover, drag and drop onto folders and tags, and keyboard + navigation. +- The reading pane: HTML bodies through DOMPurify, Stormbox's dark-mode + adaptation and a sandboxed `srcdoc` iframe with fit-to-width zoom; + plain-text bodies linkified with nested quote bars; attachments bar, + tag chips, scheduled-send banner, maximize. +- The composer: From picker, recipient pills with autocomplete over a + 400-contact address book, Cc/Bcc, the Squire rich text editor with its + toolbar overflow, Send and Send Later, minimize-to-dock, the close + prompt, reply / reply all / forward, and opening drafts. +- Stormbox's responsive layout: below 1024px an open message hides the + folder list, below 640px a single column. +- The web shortcut scheme (C, R, Shift+R, F, A, M, S, T, 0–9, Delete, + J/K/N/P, `/`, Ctrl/Cmd+K, Escape). + +Not cloned: Contacts (the rail button shows a placeholder), settings, the +folder and tag managers, onboarding, multiple message columns, sender +favicons (they come from a server-side proxy) and file attachments. + +## What is shared with Stormbox + +- `src/utils/` holds Stormbox's framework-independent modules copied + verbatim: HTML sanitizing and srcdoc building, dark-mode email + adaptation, plain-text rendering, address parsing, tag model, folder + presentation, sender avatars. Beyond import paths, only + `message-row-presentation.ts` and `compose-quote.ts` changed, to format + dates against the fixed clock in `src/clock.ts`. +- `src/styles/styles.css` and `app.css` are Stormbox's global and shell + stylesheets. `components.css` is generated from the components' Vue + ` +`}function Dn(e,t){let n=[],r=e.subject.match(/\d+/)?.[0]??String(e.id);if(n.push(`

${vn(lt(e.body_seed))}

`),tt(t,.6)){let e=[],r=I(t,4,12);for(let n=0;n${e.join(` +`)}`)}return n.push(`

${vn(ct(t,1,3))}

`),n.push(`

Reply to this email directly, view it on Forge, or unsubscribe.

`),n.join(` +`)}function On(e,t){return`

${vn(e.subject)}

${vn(lt(e.body_seed))}

CLAIM NOW

${vn(ct(t,3,5))}

`}var kn=new Map;function An(e){if(e.body)return e.body;let t=kn.get(e.id);if(t)return t;let n=et(nt(e.body_seed,2)),r;switch(e.body_kind){case`text`:r={text:Cn(e,n),attachments:[]};break;case`html`:r={html:wn(e,n),attachments:[]};break;case`newsletter`:r={html:En(e,n),attachments:[]};break;case`notification`:r={html:Dn(e,n),attachments:[]};break;case`junk`:r={html:On(e,n),attachments:[]};break;case`draft`:r={html:Tn(e,n),attachments:[]};break;default:r={text:``,attachments:[]}}return r.attachments=Sn(e,n),kn.set(e.id,r),r}function jn(e){let t=String(e??``).trim().normalize(`NFC`);if(!t)return``;let n=t.lastIndexOf(`@`);return n<=0||n===t.length-1?t.toLowerCase():`${t.slice(0,n).toLowerCase()}@${Mn(t.slice(n+1))}`}function Mn(e){let t=e.trim().toLowerCase();if(!t||t.startsWith(`[`)||/[/?#:@\\]/.test(t))return t;try{let{hostname:e}=new URL(`https://${t}`);return e||t}catch{return t}}function Nn(e){return e===` `||e===` `||e===`\r`||e===` +`}function Pn(e){return e===void 0?!1:e.codePointAt(0)>127?!0:/[A-Za-z0-9!#$%&'*+\-/=?^_`{|}~]/.test(e)}function Fn(e){for(;;){for(;Nn(e.src[e.i]);)e.i+=1;if(e.src[e.i]!==`(`)return!0;let t=0;do{let n=e.src[e.i];if(n===void 0)return!1;if(n===`\\`){e.i+=2;continue}n===`(`?t+=1:n===`)`&&--t,e.i+=1}while(t>0)}}function In(e,t){let n=e.charCodeAt(t);if(n<32)return n===9;if(n===127)return!1;if(n>=55296&&n<=56319){let n=e.charCodeAt(t+1);return n>=56320&&n<=57343}if(n>=56320&&n<=57343){let n=e.charCodeAt(t-1);return n>=55296&&n<=56319}return!0}function Ln(e){let t=e.i;e.i+=1;let n=``;for(;;){let r=e.src[e.i];if(r===void 0)return e.i=t,null;if(r===`\\`){let r=e.src[e.i+1];if(r===void 0||!In(e.src,e.i+1))return e.i=t,null;n+=r,e.i+=2;continue}if(r===`"`)return e.i+=1,{value:n,raw:e.src.slice(t,e.i)};if(!In(e.src,e.i))return e.i=t,null;n+=r,e.i+=1}}function Rn(e){let t=e.i;for(;Pn(e.src[e.i]);)e.i+=1;return e.src.slice(t,e.i)}function zn(e){let t=e.i;if(!Pn(e.src[e.i]))return``;for(;;){if(Rn(e),e.src[e.i]===`.`&&Pn(e.src[e.i+1])){e.i+=1;continue}return e.src.slice(t,e.i)}}function Bn(e){let t={src:e.src,i:e.i};for(;t.in||t.length===0,i=e.src[e.i];if(i===`"`){let n=Ln(e);if(!n)return null;t.push({text:n.value,spaced:r});continue}if(i===`.`){e.i+=1,t.push({text:`.`,spaced:r});continue}if(Pn(i)){t.push({text:Rn(e),spaced:r});continue}return t}}function Un(e){return e.map((e,t)=>t>0&&e.spaced?` ${e.text}`:e.text).join(``).trim().normalize(`NFC`)}function Wn(e){if(!Fn(e))return null;let t;if(e.src[e.i]===`"`){let n=Ln(e);if(!n)return null;t=n.raw}else t=zn(e);if(!t||!Fn(e)||e.src[e.i]!==`@`||(e.i+=1,!Fn(e)))return null;let n;if(e.src[e.i]===`[`){let t=Vn(e);if(t.kind!==`valid`)return null;n=t.value}else n=zn(e);return n?`${t}@${n}`.normalize(`NFC`):null}function Gn(e,t){if(e.lastAngle===void 0&&(e.lastAngle=e.src.lastIndexOf(`>`)),e.lastAngle<=e.i)return-1;let n={src:e.src,i:e.i+1};for(;n.i`)return n.i;if(e===`,`&&!t)return-1;if(e===`"`){if(!Ln(n))return-1;continue}if(e===`(`&&!t){if(!Fn(n))return-1;continue}if(e===`[`&&!t){if(Vn(n).kind===`unterminated`)return-1;continue}n.i+=1}return-1}function Kn(e,t){let n=-1;for(;;){let r=e.src[e.i];if(r===void 0){t&&(e.noGroupTerminator=!0,n>=0&&(e.i=n));return}if(r===`,`){if(!t||e.noGroupTerminator)return;n<0&&(n=e.i)}if(r===`;`){t&&(e.i+=1);return}if(r===`"`){if(!Ln(e)){e.i=e.src.length;return}continue}if(r===`(`){if(!Fn(e))return;continue}if(r===`[`){if(Vn(e).kind===`unterminated`){e.i=e.src.length;return}continue}if(r===`<`){let n=Gn(e,t);if(n>=0){e.i=n+1;continue}}e.i+=1}}var qn={addresses:null,wasGroup:!1},Jn={addresses:null,wasGroup:!0};function Yn(e){return{addresses:e,wasGroup:!1}}function Xn(e,t){let n=e.i,r=Hn(e);if(r===null||!Fn(e))return qn;let i=e.src[e.i];if(i===`<`){e.i+=1;let t=Wn(e);if(t===null||!Fn(e)||e.src[e.i]!==`>`||(e.i+=1,!Fn(e)))return qn;let n=Un(r);return Yn([{...n?{name:n}:{},email:t}])}if(i===`:`&&t===0){e.i+=1;let t=Zn(e);return t===null?Jn:{addresses:t,wasGroup:!0}}if(r.length===0)return qn;e.i=n;let a=Wn(e);return a===null||!Fn(e)?qn:Yn([{email:a}])}function Zn(e){let t=[];for(;;){if(!Fn(e))return null;let n=e.src[e.i];if(n===void 0)return null;if(n===`;`)return e.i+=1,Fn(e)?t:null;if(n===`,`){e.i+=1;continue}let r=Xn(e,1);if(r.addresses===null||!Fn(e))return null;let i=e.src[e.i];if(i!==`,`&&i!==`;`)return null;t.push(...r.addresses)}}function Qn(e){let t=[];if(!e)return t;let n={src:e,i:0};for(;n.ie.length===2?e:` `).replace(/[\u0000-\u0008\u000A-\u001F\u007F]/g,` `).trim();return t?`${/[",;:<>()[\]\\@]|\s\s|[^\S ]/.test(t)?`"${t.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"`:t} <${e.email}>`:e.email}function tr(e){return e.map(er).join(`, `)}function nr(e){let t={src:e,i:0};for(;t.i`)return!0}return!1}function ir(e){let t=(e??``).trim();return/^re:/i.test(t)?t:t?`Re: ${t}`:`Re: (no subject)`}function ar(e){let t=(e??``).trim();return/^fwd:/i.test(t)?t:t?`Fwd: ${t}`:`Fwd: (no subject)`}function or({from:e,date:t,subject:n}){let r=t?new Date(Number(t)).toLocaleString(ft,{timeZone:`UTC`}):``;return[e?`From: ${e}`:null,r?`Date: ${r}`:null,n?`Subject: ${n}`:null].filter(Boolean).join(` +`)}function sr({from:e,date:t,subject:n,html:r,text:i}){let a=or({from:e,date:t,subject:n}),o=(r??``).trim()||cr(i??``).replace(/\n/g,`
`);return!a&&!o?``:`

${a.split(` +`).map(e=>cr(e)).join(`
`)}
${o}
`}function cr(e){return e.replace(/&/g,`&`).replace(//g,`>`).replace(/"/g,`"`)}var lr=[`to`,`cc`,`bcc`],ur=0,dr=dt;function fr(){return dr+=6e4,dr}function pr(e){return!(`invalid`in e)}function mr(e){let t=e.draft.subject.trim();if(t)return t;let n=[...e.draft.to,...e.draft.cc,...e.draft.bcc].find(pr);return n?.name?.trim()||n?.email||`New message`}function hr(e){let{draft:t}=e;return t.to.length+t.cc.length+t.bcc.length>0||t.subject.trim()!==``||t.text.replace(/\u00a0/g,` `).trim()!==``}function gr(e){return e.replace(/&/g,`&`).replace(//g,`>`).replace(/\n/g,`
`)}function _r(e){return $n(e).addresses}function vr(){return{fromIdx:0,to:[],cc:[],bcc:[],subject:``,html:``,text:``}}function yr(e,t,n,r={}){let i=t[e.fromIdx]??t[0],a=i.name?{name:i.name,email:i.email}:{email:i.email},o=e.to.filter(pr),s=e.cc.filter(pr),c=fr();return{folder_id:n,from_text:er(a),to_text:o.map(er).join(`, `),cc:s,subject:e.subject,preview:e.text.replace(/\s+/g,` `).trim().slice(0,180),received_at:c,sent_at:c,is_seen:1,is_flagged:0,is_draft:+(n===2),has_attachment:0,keywords_json:`{}`,scheduled_undo_status:null,body_kind:`html`,body_seed:0,body:{html:e.html||`


`,text:e.text,attachments:[]},...r}}var br=Mt((e,t)=>{function n(n,r){e({sessions:t().sessions.map(e=>e.id===n?r(e):e)})}function r(n){e({sessions:t().sessions.filter(e=>e.id!==n)})}function i(e){return t().sessions.find(t=>t.id===e)}function a(e){let n=z.getState();e.sourceDraftId!=null&&n.removeMessage(e.sourceDraftId),n.addMessage(yr(e.draft,t().identities,2))}return{sessions:[],identities:mt,open(n={}){ur+=1;let r=`compose-${ur}`,i={id:r,presentation:`expanded`,draft:{...vr(),to:n.to??[],cc:n.cc??[],subject:n.subject??``,html:n.html??``},draftEpoch:1,editorHtmlBody:n.html??``,closePromptOpen:!1,sourceDraftId:n.sourceDraftId??null};return e({sessions:[...t().sessions.map(e=>e.presentation===`expanded`?{...e,presentation:`minimized`}:e),i]}),r},minimize(e){n(e,e=>({...e,presentation:`minimized`,closePromptOpen:!1}))},restore(n){e({sessions:t().sessions.map(e=>e.id===n?{...e,presentation:`expanded`}:e.presentation===`expanded`?{...e,presentation:`minimized`}:e)})},close(e){r(e)},requestClose(e){let a=i(e);if(a){if(!hr(a)){r(e);return}t().restore(e),n(e,e=>({...e,closePromptOpen:!0}))}},cancelClose(e){n(e,e=>({...e,closePromptOpen:!1}))},closeWithoutSaving(e){r(e)},saveAndClose(e){let t=i(e);t&&(a(t),r(e),z.getState().showToast(`Draft saved.`))},discardDraft(e){let t=i(e);t&&(t.sourceDraftId!=null&&z.getState().removeMessage(t.sourceDraftId),r(e))},updateDraft(e,t){n(e,e=>({...e,draft:{...e.draft,...t}}))},send(e,n=null){let a=i(e);if(!a)return;let o=z.getState(),s=[...a.draft.to,...a.draft.cc,...a.draft.bcc];if(s.length===0||s.some(e=>!pr(e))){o.showToast(s.length===0?`Add at least one recipient before sending.`:`Fix the invalid recipients before sending.`);return}a.sourceDraftId!=null&&o.removeMessage(a.sourceDraftId),n?(o.addMessage(yr(a.draft,t().identities,3,{sent_at:n.targetAt,scheduled_undo_status:`pending`})),o.showToast(`Message scheduled for ${n.label}.`)):(o.addMessage(yr(a.draft,t().identities,4)),o.showToast(`Message sent.`)),r(e)},prepareReply(e,n){let r=new Set(t().identities.map(e=>jn(e.email))),i=e=>e.filter(e=>!r.has(jn(e.email))),a=_r(e.from_text),o=a.length>0&&a.every(e=>r.has(jn(e.email))),s=_r(e.to_text),c=i(o?s:a);c.length===0&&(c=a);let l=new Set(c.map(e=>jn(e.email))),u=[];if(n)for(let t of i([...s,...e.cc])){let e=jn(t.email);l.has(e)||(l.add(e),u.push(t))}let d=An(e),f=sr({from:e.from_text,date:e.received_at,subject:e.subject,html:d.html,text:d.text});t().open({to:c,cc:u,subject:ir(e.subject),html:`


${f}`})},prepareForward(e){let n=An(e),r=[`Subject: ${e.subject}`,`Date: ${new Date(e.received_at).toUTCString()}`,`From: ${e.from_text}`,`To: ${e.to_text}`].map(e=>e.replace(/&/g,`&`).replace(//g,`>`)).join(`
`),i=n.html??gr(n.text??``);t().open({subject:ar(e.subject),html:`


-------- Forwarded Message --------
${r}

${i}
`})},openDraft(e){let n=An(e);t().open({to:_r(e.to_text),cc:e.cc,subject:e.subject,html:n.html??gr(n.text??``),sourceDraftId:e.id})}}}),xr=1920;function Sr(){return typeof location>`u`?`dark`:new URLSearchParams(location.search).get(`theme`)===`light`?`light`:`dark`}var Cr=Mt((e,t)=>({theme:Sr(),space:`mail`,quickFilter:``,folderListWidth:240,messageColumnWidth:360,quickFilterFocusRequest:0,setTheme:t=>e({theme:t}),toggleTheme:()=>e({theme:t().theme===`dark`?`light`:`dark`}),setSpace:t=>e({space:t,quickFilter:``}),setQuickFilter:t=>e({quickFilter:t}),setFolderListWidth:t=>e({folderListWidth:t}),setMessageColumnWidth:t=>e({messageColumnWidth:t}),requestQuickFilterFocus:()=>e({quickFilterFocusRequest:t().quickFilterFocusRequest+1})}));function wr(e,t,n){return Math.max(t,Math.min(e,Math.max(t,n)))}function Tr(e){let[t,n]=(0,C.useState)(!1),r=(0,C.useRef)(e);r.current=e;let i=(0,C.useRef)(null),a=(0,C.useCallback)(e=>{let t=i.current;if(!t)return;let n=r.current;n.set(wr(t.startWidth+e.clientX-t.startX,n.min(),n.max()))},[]),o=(0,C.useCallback)(()=>{i.current&&(i.current=null,n(!1),document.body.classList.remove(`is-column-resizing`),window.removeEventListener(`pointermove`,a),window.removeEventListener(`pointerup`,o),window.removeEventListener(`pointercancel`,o))},[a]),s=(0,C.useCallback)(e=>{e.button===0&&(e.preventDefault(),i.current={startX:e.clientX,startWidth:r.current.get()},n(!0),document.body.classList.add(`is-column-resizing`),window.addEventListener(`pointermove`,a),window.addEventListener(`pointerup`,o,{once:!0}),window.addEventListener(`pointercancel`,o,{once:!0}))},[a,o]),c=(0,C.useCallback)(e=>{if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`)return;e.preventDefault();let t=r.current,n=e.shiftKey?40:10,i=e.key===`ArrowRight`?1:-1;t.set(wr(t.get()+i*n,t.min(),t.max()))},[]);return(0,C.useEffect)(()=>o,[o]),{active:t,onPointerDown:s,onKeyDown:c}}function Er(){return typeof navigator>`u`?!1:/Mac|iPhone|iPad|iPod/.test(navigator.platform)}function Dr(){return Er()?`⌘`:`Ctrl`}function Or(){return Er()?`Meta`:`Control`}function kr(e){return Er()?e.metaKey:e.ctrlKey}function Ar(e){return e.isComposing||e.keyCode===229}function jr(e){if(!(e instanceof Element)||e.closest(`iframe`))return!1;let t=e.closest(`input, textarea, select, [contenteditable="true"]`);return!(!t||t instanceof HTMLInputElement&&t.type===`checkbox`)}function Mr(e,t){let n=t.key.length===1?t.key.toLowerCase():t.key;return!((e.key.length===1?e.key.toLowerCase():e.key)!==n||!!t.mod!==kr(e)||!!t.shift!==e.shiftKey||!!t.alt!==e.altKey)}var Nr=null;function Pr(e){return Nr=e,()=>{Nr===e&&(Nr=null)}}function Fr(){let{selection:e,open:t}=z.getState();return e.ids.size>0?[...e.ids]:t.id==null?[]:[t.id]}var Ir={j:`next`,k:`previous`,n:`nextUnread`,p:`previousUnread`};function Lr({enabled:e}){let t=(0,C.useRef)(e);t.current=e,(0,C.useEffect)(()=>{function e(e){if(!t.current||e.defaultPrevented||Ar(e))return;let n=br.getState(),r=n.sessions.find(e=>e.presentation===`expanded`);if(r){if(e.key!==`Escape`||document.activeElement?.matches?.(`.compose-dialog [role="combobox"][aria-expanded="true"]`)||document.querySelector(`.compose-dialog--expanded details[data-dropdown-group][open]`))return;e.preventDefault(),n.requestClose(r.id);return}if(e.target instanceof Element&&e.target.closest(`[data-message-control]`)&&[`Enter`,` `,`Escape`,`F2`,`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key))return;let i=Er()?e.metaKey:e.ctrlKey,a=jr(e.target),o=e.key.length===1?e.key.toLowerCase():e.key;if(o===`/`&&!i&&!a||o===`k`&&i){e.preventDefault(),Cr.getState().requestQuickFilterFocus();return}if(Cr.getState().space!==`mail`||a||e.target instanceof Element&&e.target.closest(`[data-tag-picker-popover], details.tag-picker-dropdown[open]`)||e.altKey||i&&o!==`a`)return;let s=z.getState();if(o===`a`&&i){if(!Nr)return;e.preventDefault(),Nr.selectAll();return}if(e.shiftKey&&o!==`r`&&o!==`Delete`&&o!==`Backspace`)return;switch(o){case`c`:e.preventDefault(),n.open();return;case`r`:case`f`:{let{open:t,messages:r}=s,i=t.id==null?null:r.get(t.id);if(!i||i.scheduled_undo_status===`pending`||s.selection.ids.size>0)return;e.preventDefault(),o===`f`?n.prepareForward(i):n.prepareReply(i,e.shiftKey);return}case`a`:case`m`:case`s`:case`Delete`:case`Backspace`:{if(o===`Backspace`&&!Er())return;let t=Fr();if(t.length===0)return;e.preventDefault(),o===`a`?s.archiveMessages(t):o===`m`?s.toggleManySeen(t):o===`s`?s.toggleManyFlagged(t):s.destroyMessages(t);return}case`t`:if(Fr().length===0||!Nr)return;e.preventDefault(),Nr.openTagMenu();return;case`Escape`:if(s.selection.ids.size===0||document.querySelector(`details.app-dropdown[open]`))return;e.preventDefault(),s.clearSelection();return;default:}if(/^[0-9]$/.test(o)){let t=Fr();if(t.length===0)return;if(e.preventDefault(),o===`0`){s.clearTagsMany(t);return}let n=Ft[Number(o)-1];if(!n)return;let r=n.keyword.toLowerCase(),i=t.every(e=>{let t=s.messages.get(e)?.keywords_json??`{}`;return!!JSON.parse(t)[r]});s.setTagsMany(t,i?{remove:[r]}:{add:[r]});return}let c=Ir[o];c&&Nr&&(e.preventDefault(),Nr.navigate(c))}return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},[])}var Rr=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),B=o(((e,t)=>{t.exports=Rr()}))();function zr({svg:e,className:t}){return(0,B.jsx)(`span`,{className:t,"aria-hidden":`true`,dangerouslySetInnerHTML:{__html:e}})}function Br({size:e=`compact`,variant:t=`filled`,formAction:n=`none`,iconLeft:r,iconRight:i,className:a,children:o,...s}){let c=[`base`,`primary`,t,`app-button`,e===`compact`?`app-button--compact`:``,a??``].filter(Boolean).join(` `);return(0,B.jsxs)(`button`,{...s,className:c,type:n===`none`?`button`:n,"data-testid":`button`,children:[r?(0,B.jsx)(`span`,{className:`icon`,children:r}):null,(0,B.jsx)(`span`,{className:`text`,children:o}),i?(0,B.jsx)(`span`,{className:`icon`,children:i}):null]})}var Vr=(0,C.forwardRef)(({danger:e=!1,className:t,children:n,...r},i)=>(0,B.jsx)(`button`,{...r,ref:i,type:`button`,className:[`app-icon-button`,e?`app-icon-button--danger`:``,t??``].filter(Boolean).join(` `),children:n}));function Hr({active:e=!1,className:t,children:n,...r}){return(0,B.jsx)(`button`,{...r,type:`button`,className:[`app-toggle-button`,e?`is-active`:``,t??``].filter(Boolean).join(` `),"aria-pressed":e,children:n})}function Ur({maximized:e,surface:t,onToggle:n,className:r}){let i=`${e?`Restore`:`Maximize`} ${t}`;return(0,B.jsx)(Vr,{className:r,"aria-label":i,title:i,onMouseDown:e=>e.preventDefault(),onClick:n,children:e?(0,B.jsx)(De,{size:18,strokeWidth:1.65,"aria-hidden":`true`}):(0,B.jsx)(j,{size:18,strokeWidth:1.65,"aria-hidden":`true`})})}function Wr(e){let t=e instanceof Element?e:e?.currentTarget;if(!(t instanceof Element))return;let n=t.closest(`details`);n instanceof HTMLDetailsElement&&(n.open=!1)}function Gr({group:e=`app`,disabled:t=!1,className:n,onToggle:r,children:i,...a}){let o=(0,C.useRef)(null),s=(0,C.useCallback)(e=>{let t=o.current;t?.open&&(e.target instanceof Node&&t.contains(e.target)||(t.open=!1))},[]),c=(0,C.useCallback)(e=>{let t=o.current;!t?.open||e.key!==`Escape`||(e.preventDefault(),e.stopPropagation(),t.open=!1,t.contains(document.activeElement)&&t.querySelector(`summary`)?.focus())},[]),l=(0,C.useCallback)(()=>{document.removeEventListener(`pointerdown`,s,!0),document.removeEventListener(`keydown`,c,!0)},[s,c]);(0,C.useEffect)(()=>l,[l]);function u(t){let n=o.current;n&&(n.open?(document.addEventListener(`pointerdown`,s,!0),document.addEventListener(`keydown`,c,!0),document.querySelectorAll(`details[data-dropdown-group="${e}"]`).forEach(e=>{e!==n&&e.open&&(e.open=!1)})):l()),r?.(t)}function d(e){t&&(e.preventDefault(),e.stopPropagation())}return(0,B.jsx)(`details`,{...a,ref:o,className:[`app-dropdown`,t?`app-dropdown--disabled`:``,n??``].filter(Boolean).join(` `),"data-dropdown-group":e,onToggle:u,onClickCapture:d,children:i})}function Kr(e,t,n){if(n.key===`Tab`){let t=e?.closest(`details`);t instanceof HTMLDetailsElement&&t.open&&(t.open=!1,t.querySelector(`summary`)?.focus());return}if(![`ArrowDown`,`ArrowUp`,`Home`,`End`].includes(n.key))return;let r=Array.from(e?.querySelectorAll(t)??[]);if(r.length===0)return;n.preventDefault();let i=r.indexOf(document.activeElement),a;switch(n.key){case`ArrowDown`:a=i<0?0:Math.min(r.length-1,i+1);break;case`ArrowUp`:a=i<0?r.length-1:Math.max(0,i-1);break;case`Home`:a=0;break;default:a=r.length-1}r[a]?.focus()}var qr=` + + + +`,Jr=` + + + +`,Yr=` + + + +`,Xr=` + + + + +`;function Zr(e){if(e==null||Number.isNaN(e))return null;if(e<=0)return`0 B`;for(let t of[{threshold:1024**3,label:`GB`,divisor:1024**3},{threshold:1024**2,label:`MB`,divisor:1024**2},{threshold:1024,label:`KB`,divisor:1024}])if(e>=t.threshold)return`${Math.floor(e/t.divisor)} ${t.label}`;return`${e} B`}function Qr({active:e,unreadCount:t,folderListHidden:n,sidebarLabel:r,onChange:i,onToggleFolderList:a,inert:o}){let s=`${n?`Show`:`Hide`} ${r}`;return(0,B.jsxs)(`nav`,{className:`app-spaces`,"aria-label":`Spaces`,inert:o,"aria-hidden":o||void 0,children:[(0,B.jsxs)(Hr,{className:`app-spaces__item`,active:e===`mail`,onClick:()=>i(`mail`),"aria-label":`Mail`,title:`Mail`,children:[(0,B.jsx)(_e,{size:20,strokeWidth:1.75}),t>0?(0,B.jsx)(`span`,{className:`app-spaces__badge`,"aria-hidden":`true`,children:t>9999?`9999+`:t}):null]}),(0,B.jsx)(Hr,{className:`app-spaces__item`,active:e===`contacts`,onClick:()=>i(`contacts`),"aria-label":`Contacts`,title:`Contacts`,children:(0,B.jsx)(ze,{size:20,strokeWidth:1.75})}),(0,B.jsxs)(`div`,{className:`app-spaces__bottom-actions`,children:[(0,B.jsx)(Hr,{className:`app-spaces__item app-spaces__settings`,"aria-label":`Settings`,title:`Settings`,"data-settings-gear":!0,children:(0,B.jsx)(Ee,{size:20,strokeWidth:1.75,"aria-hidden":`true`})}),(0,B.jsx)(Hr,{className:`app-spaces__item`,active:!n,"aria-label":s,title:s,"data-folder-list-toggle":!0,onClick:a,children:(0,B.jsx)(`span`,{className:`app-spaces__folder-toggle-icon${n?` is-hidden`:``}`,"aria-hidden":`true`,children:(0,B.jsx)(`span`,{})})})]})]})}function $r(e){(0,C.useEffect)(()=>{function t(t){let n=e.current;n?.open&&t.target instanceof Node&&!n.contains(t.target)&&(n.open=!1)}return document.addEventListener(`pointerdown`,t),()=>document.removeEventListener(`pointerdown`,t)},[e])}function ei(){let e=(0,C.useRef)(null);$r(e);let t=pt.email,n=mn(t),r=hn(t),i=()=>{e.current&&(e.current.open=!1)};return(0,B.jsxs)(`details`,{ref:e,className:`account-menu`,children:[(0,B.jsx)(`summary`,{className:`account-menu__button`,"aria-label":`Open account menu`,children:(0,B.jsx)(`span`,{className:`account-menu__avatar`,style:r,"aria-hidden":`true`,children:n})}),(0,B.jsxs)(`div`,{className:`account-menu__popover`,role:`menu`,children:[(0,B.jsxs)(`div`,{className:`account-menu__identity`,children:[(0,B.jsx)(`span`,{className:`account-menu__avatar account-menu__avatar--large`,style:r,"aria-hidden":`true`,children:n}),(0,B.jsx)(`span`,{className:`account-menu__email`,children:t})]}),(0,B.jsxs)(`button`,{className:`account-menu__item`,type:`button`,role:`menuitem`,onClick:i,children:[(0,B.jsx)(Ee,{size:16,strokeWidth:1.75,"aria-hidden":`true`}),(0,B.jsx)(`span`,{children:`Settings`})]}),(0,B.jsxs)(`a`,{className:`account-menu__item`,href:`#account`,role:`menuitem`,onClick:i,children:[(0,B.jsx)(re,{size:16,strokeWidth:1.75,"aria-hidden":`true`}),(0,B.jsx)(`span`,{children:`Account Settings`})]}),(0,B.jsxs)(`a`,{className:`account-menu__item`,href:`#support`,role:`menuitem`,onClick:i,children:[(0,B.jsx)(zr,{className:`account-menu__support-icon`,svg:Xr}),(0,B.jsx)(`span`,{children:`Contact Support`})]}),(0,B.jsxs)(`button`,{className:`account-menu__item`,type:`button`,role:`menuitem`,onClick:i,children:[(0,B.jsx)(he,{size:16,strokeWidth:1.75,"aria-hidden":`true`}),(0,B.jsx)(`span`,{children:`Log Out`})]})]})]})}var ti=[{id:`appointment`,name:`Appointment`,glyph:qr},{id:`send`,name:`Send`,glyph:Yr}];function ni(){let e=(0,C.useRef)(null);$r(e);let t=()=>{e.current?.open&&(e.current.open=!1)};return(0,B.jsxs)(`details`,{ref:e,className:`app-drawer`,onKeyDown:e=>{e.key===`Escape`&&t()},children:[(0,B.jsx)(`summary`,{className:`quick-filter__action app-drawer__button`,"aria-label":`Open app drawer`,title:`Apps`,children:(0,B.jsx)(ce,{size:18,strokeWidth:1.75,"aria-hidden":`true`})}),(0,B.jsxs)(`div`,{className:`app-drawer__popover`,role:`menu`,"aria-label":`Thunderbird Pro apps`,children:[(0,B.jsxs)(`button`,{className:`app-drawer__tile app-drawer__tile--current`,type:`button`,role:`menuitem`,"aria-current":`page`,onClick:t,children:[(0,B.jsx)(zr,{className:`app-drawer__icon`,svg:Jr}),(0,B.jsx)(`span`,{className:`app-drawer__label`,children:`Mail`})]}),ti.map(e=>(0,B.jsxs)(`a`,{className:`app-drawer__tile`,href:`#${e.id}`,role:`menuitem`,onClick:t,children:[(0,B.jsx)(zr,{className:`app-drawer__icon`,svg:e.glyph}),(0,B.jsx)(`span`,{className:`app-drawer__label`,children:e.name})]},e.id))]})]})}var ri=30*1024**3,ii=Math.round(ri*.37);function ai(){let e=Math.round(ii/ri*100),t=`${e}% of ${Zr(ri)}`;return(0,B.jsxs)(`div`,{className:`storage-usage`,role:`status`,"aria-label":t,children:[(0,B.jsx)(`div`,{className:`storage-usage__track`,"aria-hidden":`true`,children:(0,B.jsx)(`div`,{className:`storage-usage__fill`,style:{width:`${e}%`}})}),(0,B.jsx)(`p`,{className:`storage-usage__label`,children:t})]})}var oi=` + + + + +`,si=` + + + + +`,ci=` + + + + +`,li=` + + + + +`,ui=` + + + + +`,di=` + + + +`,fi=` + + + + +`,pi=` + + + + +`,mi={inbox:ci,sent:fi,drafts:si,scheduled:di,archive:oi,trash:` + + + + +`,junk:pi},hi={inbox:`#1a73e8`,sent:`#188038`,drafts:`#7e22ce`,scheduled:`#0e7490`,archive:`#8b5a2b`,trash:`#5f6368`,junk:`#d93025`,important:`#f9ab00`,flagged:`#c5221f`,all:`#5f6368`},gi={newsletters:{icon:li,color:`#7378a6`},feeds:{icon:ui,color:`#f97316`}};function _i(e){return String(e??``).trim().toLowerCase()}function vi(e){let t=e.role??null,n=gi[_i(e.name)];return{icon:(t&&mi[t])??n?.icon??` + + + + +`,color:(t&&hi[t])??n?.color??`var(--folder-icon-color)`}}function yi(e){let t=e.role===`scheduled`?e.total_emails:e.unread_emails;return Math.max(0,Number(t)||0)}function bi(e){switch(e.role){case`inbox`:return 0;case`drafts`:return 1;case`scheduled`:return 2;case`sent`:return 3;case`archive`:return 4;case`junk`:return 5;case`trash`:return 6;default:return 100}}function xi(e){return e.role!=null&&mi[e.role]!=null}function Si(e,t){return bi(e)-bi(t)||Number(t.is_starred??0)-Number(e.is_starred??0)||String(e.name??``).localeCompare(String(t.name??``))}var Ci=`application/x-stormbox-message-ids`,wi=Mt(e=>({dragging:!1,draggedIds:[],sourceViewId:null,startDrag(t,{messageId:n,selectedIds:r,sourceViewId:i}){let a=r.has(n)?[...r]:[n];t.dataTransfer.effectAllowed=`copyMove`,t.dataTransfer.setData(Ci,JSON.stringify({ids:a,sourceViewId:i})),t.dataTransfer.setData(`text/plain`,a.length===1?`1 message`:`${a.length} messages`),e({dragging:!0,draggedIds:a,sourceViewId:i})},endDrag(){e({dragging:!1,draggedIds:[],sourceViewId:null})}}));function Ti(e){let t=e.dataTransfer.getData(Ci);if(t)try{let e=JSON.parse(t);if(Array.isArray(e.ids))return{ids:e.ids.map(Number),sourceViewId:e.sourceViewId??null}}catch{return null}let n=wi.getState();return n.dragging?{ids:n.draggedIds,sourceViewId:n.sourceViewId}:null}function Ei(e,t,n){let r=new Map(e.map(e=>[e.id,e])),i=new Map;for(let t of e){let e=t.parent_id==null?null:r.get(t.parent_id),n=t.is_starred===1&&e!=null,a=e!=null&&!n?t.parent_id:`ROOT`;i.has(a)||i.set(a,[]),i.get(a).push(t)}for(let e of i.values())e.sort(Si);function a(e,r){let o=vi(e),s=t.get(e.id)??0,c=n.get(e.id)??0,l=(i.get(e.id)??[]).map(e=>a(e,r+1)),u=yi({role:e.role,unread_emails:s,total_emails:c});return{...e,depth:r,icon:o.icon,tone:o.color,children:l,unread_emails:s,total_emails:c,subtree_unread:l.reduce((e,t)=>e+t.subtree_unread,u)}}return(i.get(`ROOT`)??[]).map(e=>a(e,0))}var Di=(0,C.memo)(function e({folder:t,current:n,expanded:r,dragOverId:i,dragging:a,dragSourceId:o,onPick:s,onToggle:c,onDragTarget:l,onDropOn:u}){let d=t.children.length>0,f=d&&!r.has(t.id),p=f?t.subtree_unread:yi({role:t.role,unread_emails:t.unread_emails,total_emails:t.total_emails}),m=a&&i===t.id?o===t.id?`invalid`:`move`:null,h={paddingLeft:`${10+t.depth*16}px`,"--folder-tone":t.tone};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:[`folder-node`,n===t.id?`is-current`:``,t.tone?`has-tone`:``,m===`move`?`is-drop-valid`:``,m===`invalid`?`is-drop-invalid`:``].filter(Boolean).join(` `),style:h,"data-folder-id":t.id,onDragEnter:e=>{e.preventDefault(),l(t.id)},onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect=o===t.id?`none`:`move`},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||i===t.id&&l(null)},onDrop:e=>u(t.id,e),children:[d?(0,B.jsx)(`button`,{type:`button`,className:`folder-node__toggle${f?` is-collapsed`:``}`,"aria-expanded":!f,"aria-label":f?`Expand folder`:`Collapse folder`,onClick:()=>c(t.id),children:(0,B.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`12`,height:`12`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:`M6 4l4 4-4 4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`})})}):(0,B.jsx)(`span`,{className:`folder-node__toggle folder-node__toggle--spacer`,"aria-hidden":`true`}),(0,B.jsxs)(`button`,{type:`button`,className:`folder-node__button`,onClick:()=>s(t.id),children:[(0,B.jsxs)(`span`,{className:`folder-node__icon-wrap`,children:[(0,B.jsx)(`span`,{className:`folder-node__icon`,"aria-hidden":`true`,dangerouslySetInnerHTML:{__html:t.icon}}),t.is_starred===1?(0,B.jsx)(Oe,{className:`folder-node__star`,size:10,strokeWidth:2,"aria-label":`Starred folder`}):null]}),(0,B.jsx)(`span`,{className:`folder-node__name`,children:t.name||`(unnamed)`}),p>0?(0,B.jsx)(`span`,{className:`folder-node__count`,children:p>99999?`99999+`:p}):null]})]}),d&&!f?t.children.map(t=>(0,B.jsx)(e,{folder:t,current:n,expanded:r,dragOverId:i,dragging:a,dragSourceId:o,onPick:s,onToggle:c,onDragTarget:l,onDropOn:u},t.id)):null]})});function Oi({keyword:e,name:t,color:n,count:r,current:i,dropActive:a,onPick:o,onDragTarget:s,onDropOn:c}){return(0,B.jsx)(`div`,{className:[`tag-view-node`,i?`is-current`:``,a?`is-drop-valid`:``].filter(Boolean).join(` `),style:n?{"--tag-color":n}:void 0,"data-tag-view":e,onDragEnter:t=>{t.preventDefault(),s(e)},onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect=`copy`},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||s(null)},onDrop:t=>c(e,t),children:(0,B.jsxs)(`button`,{type:`button`,className:`tag-view-node__button`,"aria-current":i?`page`:void 0,onClick:()=>o(e),children:[(0,B.jsx)(`span`,{className:`tag-view-node__icon-wrap`,"aria-hidden":`true`,children:n===null?(0,B.jsx)(Oe,{className:`tag-view-node__star`,size:14,strokeWidth:2}):(0,B.jsx)(`span`,{className:`tag-view-node__dot`})}),(0,B.jsx)(`span`,{className:`tag-view-node__name`,children:t}),r>0?(0,B.jsx)(`span`,{className:`tag-view-node__count`,children:r>99999?`99999+`:r}):null]})})}function ki(){let e=z(e=>e.folders),t=z(e=>e.messages),n=z(e=>e.currentViewId),r=z(e=>e.selectFolder),{dragging:i,sourceViewId:a,endDrag:o}=wi(),[s,c]=(0,C.useState)(()=>new Set),[l,u]=(0,C.useState)(null),[d,f]=(0,C.useState)(null),p=$t({messages:t}),m=(0,C.useMemo)(()=>Ei(e,p.unread,p.total),[e,p]),h=m.filter(xi),g=m.filter(e=>!xi(e)),_=g.filter(e=>e.is_starred===1),v=g.filter(e=>e.is_starred!==1),y=(0,C.useCallback)(e=>{c(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),b=(0,C.useCallback)((e,t)=>{t.preventDefault(),u(null);let n=Ti(t);n&&n.ids.length>0&&n.sourceViewId!==e&&z.getState().moveMessages(n.ids,e),o()},[o]),x=(0,C.useCallback)((e,t)=>{t.preventDefault(),f(null);let n=Ti(t);if(n&&n.ids.length>0){let t=z.getState();e===`$flagged`?t.markManyFlagged(n.ids,!0):t.setTagsMany(n.ids,{add:[e]})}o()},[o]),S=(0,C.useCallback)(e=>r(qt(e)),[r]),w=[{keyword:Wt,name:`Starred`,color:null},...Ft.map(e=>({keyword:e.keyword.toLowerCase(),name:e.name,color:e.color}))],T=Kt(n)?R(n):null,E={current:n,expanded:s,dragOverId:l,dragging:i,dragSourceId:a,onPick:r,onToggle:y,onDragTarget:u,onDropOn:b};return(0,B.jsxs)(`nav`,{className:`folder-tree`,"aria-label":`Mailboxes`,children:[h.map(e=>(0,B.jsx)(Di,{folder:e,...E},e.id)),(0,B.jsxs)(`div`,{className:`folder-tree__heading-row`,children:[(0,B.jsx)(`h3`,{className:`folder-tree__heading`,children:`Folders`}),(0,B.jsx)(`span`,{className:`folder-tree__heading-actions`,children:(0,B.jsx)(`button`,{type:`button`,className:`folder-tree__manage`,"data-manage-folders":!0,title:`Manage Folders`,"aria-label":`Manage Folders`,children:(0,B.jsx)(Te,{size:16,strokeWidth:1.75,"aria-hidden":`true`})})})]}),_.map(e=>(0,B.jsx)(Di,{folder:e,...E},e.id)),v.map(e=>(0,B.jsx)(Di,{folder:e,...E},e.id)),(0,B.jsxs)(`div`,{className:`folder-tree__heading-row`,"data-tag-views":!0,children:[(0,B.jsx)(`h3`,{className:`folder-tree__heading`,children:`Tags`}),(0,B.jsx)(`span`,{className:`folder-tree__heading-actions`,children:(0,B.jsx)(`button`,{type:`button`,className:`folder-tree__manage`,"data-manage-tags":!0,title:`Manage Tags`,"aria-label":`Manage Tags`,children:(0,B.jsx)(Te,{size:16,strokeWidth:1.75,"aria-hidden":`true`})})})]}),w.map(e=>(0,B.jsx)(Oi,{keyword:e.keyword,name:e.name,color:e.color,count:p.tags.get(e.keyword)??0,current:T===e.keyword,dropActive:i&&d===e.keyword,onPick:S,onDragTarget:f,onDropOn:x},e.keyword))]})}var Ai=m();function ji(e,t,n){let r=Array(e);return new Proxy(r,{get(r,i,a){if(typeof i==`string`){let a=i.charCodeAt(0);if(a>=48&&a<=57){let a=+i;if(Number.isInteger(a)&&a>=0&&ar[t]!==e)?(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i):i}return o.updateDeps=e=>{r=e},o}function Ni(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var Pi=(e,t)=>Math.abs(e-t)<1.01,Fi=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},Ii,Li=()=>{if(Ii!==void 0)return Ii;if(typeof navigator>`u`)return Ii=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Ii=!0;let e=navigator.maxTouchPoints;return Ii=navigator.platform===`MacIntel`&&e!==void 0&&e>0},Ri=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},zi=e=>e,Bi=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(Ri(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(Ri(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},Hi={passive:!0},Ui=typeof window>`u`?!0:`onscrollend`in window,Wi=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&Ui,o=0,s=a?null:Fi(i,()=>t(o,!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,Hi),a&&r.addEventListener(`scrollend`,u,Hi),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u)}},Gi=(e,t)=>Wi(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),Ki=(e,t,n)=>{if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},qi=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})},Ji=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}return}this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:zi,rangeExtractor:Bi,onChange:()=>{},measureElement:Ki,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,a=t.count,o=this.getMeasurements(),s=e>0?o[0]?.key??n.getItemKey(0):null,c=e>0?o[e-1]?.key??n.getItemKey(e-1):null;if(a!==e||e>0&&a>0&&(t.getItemKey(0)!==s||t.getItemKey(a-1)!==c)){let s=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??o[0]:null;s&&(r=[s.key,this.getScrollOffset()-s.start]);let l=t.followOnAppend===!0?`auto`:t.followOnAppend||null;l&&a>e&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(a-1)!==c)&&(i=l)}}this.options=t,(r||i)&&(this.pendingScrollAnchor=[r?.[0]??null,r?.[1]??0,i])},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=Mi(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.scrollElement&&`ownerDocument`in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset(){this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,!(!Li()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,Hi),e.addEventListener(`touchend`,n,Hi),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let t=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled){let[e,n,r]=t;if(e!==null){let{count:t,getItemKey:r}=this.options,i=0;for(;i{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{let n=new Map,r=new Map;for(let i=t-1;i>=0;i--){let t=e[i];if(n.has(t.lane))continue;let a=r.get(t.lane);if(a==null||t.end>a.end?r.set(t.lane,t):t.ende.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=Mi(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(e,t,n,r,i,a,o)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o}),{key:!1}),this.getMeasurements=Mi(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o},s)=>{let c=this.itemSizeCache;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let l=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=this.options.gap,a=e*2,o=this._flatMeasurements;if(!o||o.length0&&e.set(o.subarray(0,l*2)),o=e,this._flatMeasurements=o}let s;if(l===0)s=t+n;else{let e=l-1;s=o[e*2]+o[e*2+1]+i}for(let t=l;t1){s=a;let e=d[s],r=e===void 0?void 0:u[e];l=r?r.end+this.options.gap:t+n}else{let e=this.options.lanes===1?u[i-1]:this.getFurthestMeasurement(u,i);l=e?e.end+this.options.gap:t+n,s=e?e.lane:i%this.options.lanes,this.options.lanes>1&&f&&this.laneAssignments.set(i,s)}let p=c.get(e),m=typeof p==`number`?p:this.options.estimateSize(i),h=l+m;u[i]={index:i,start:l,size:m,end:h,key:e,lane:s},d[s]=i}return this.measurementsCache=u,u},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Mi(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>this.range=e.length>0&&t>0?Xi({measurements:e,outerSize:t,scrollOffset:n,lanes:r,flat:r===1&&this._flatMeasurements!=null?this._flatMeasurements:null}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Mi(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(e<0||e>=this.options.count)return;let n,r,i,a=this._flatMeasurements;if(this.options.lanes===1&&a!==null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=t-(this.itemSizeCache.get(i)??n);if(o!==0){let a=this.options.anchorTo===`end`&&this.scrollState?.behavior!==`smooth`&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,s=a?this.getTotalSize():0,c=this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?r[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;rthis.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._flatMeasurements,r=this.options.lanes===1&&n!=null;return Ni(t[Yi(0,t.length-1,r?e=>n[e*2]:e=>Ni(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`)if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t];if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e=`auto`}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:`end`,behavior:e});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._flatMeasurements;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){e!==0&&(Li()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=e:this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&Pi(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior=`auto`),this._scrollToOffset(t,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}},Yi=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(ar)t=i-1;else return i}return e>0?e-1:0};function Xi({measurements:e,outerSize:t,scrollOffset:n,lanes:r,flat:i}){let a=e.length-1,o=i?e=>i[e*2]:t=>e[t].start,s=i?e=>i[e*2]+i[e*2+1]:t=>e[t].end;if(e.length<=r)return{startIndex:0,endIndex:a};let c=Yi(0,a,o,n),l=c;if(r===1)for(;l1){let i=Array(r).fill(0);for(;le=0&&o.some(e=>e>=n);){let t=e[c];o[t.lane]=t.start,c--}c=Math.max(0,c-c%r),l=Math.min(a,l+(r-1-l%r))}return{startIndex:c,endIndex:l}}var Zi=typeof document<`u`?C.useLayoutEffect:C.useEffect;function Qi({useFlushSync:e=!0,...t}){let n=C.useReducer(e=>e+1,0)[1],r={...t,onChange:(r,i)=>{var a;e&&i?(0,Ai.flushSync)(n):n(),(a=t.onChange)==null||a.call(t,r,i)}},[i]=C.useState(()=>new Ji(r));return i.setOptions(r),Zi(()=>i._didMount(),[]),Zi(()=>i._willUpdate()),i}function $i(e){return Qi({observeElementRect:Vi,observeElementOffset:Gi,scrollToFn:qi,...e})}function ea(e){let t=e?.role;return t===`sent`||t===`drafts`}function ta(e,t){return t?e?.to_text:e?.from_text}function na(e,t){let n=ta(e,t);return n?pn(n):t?`(no recipient)`:`(no sender)`}function ra(e,t){return t===`received`?e.received_at:e.sent_at??e.received_at}function V(e){if(!e)return``;let t=new Date(Number(e));if(Number.isNaN(t.valueOf()))return``;let n=new Date(dt);if(t.getUTCFullYear()===n.getUTCFullYear()&&t.getUTCMonth()===n.getUTCMonth()&&t.getUTCDate()===n.getUTCDate())return t.toLocaleTimeString(ft,{hour:`2-digit`,minute:`2-digit`,timeZone:`UTC`});let r=t.getUTCFullYear()===n.getUTCFullYear();return t.toLocaleDateString(ft,r?{month:`short`,day:`numeric`,timeZone:`UTC`}:{year:`numeric`,month:`short`,day:`numeric`,timeZone:`UTC`})}function ia(e){return String(e??``).trim().toLowerCase()}function aa(e,t){return t?[e?.from_text,e?.to_text,e?.subject].some(e=>ia(e).includes(t)):!0}var oa=3,sa=`M6 .496A.691.691 0 0 0 5.51.7L.699 5.51a.692.692 0 0 0 0 .981l4.81 4.811c.272.271.71.271.981 0l4.81-4.81c.23-.205.203-.491.2-.682V1.192A.69.69 0 0 0 10.808.5C9.553.501 7.237.501 6 .496Z`,ca=`M6-.004a1.2 1.2 0 0 0-.844.35l-4.81 4.81a1.202 1.202 0 0 0 0 1.688l4.81 4.81a1.202 1.202 0 0 0 1.688 0l4.789-4.79c.416-.372.37-.911.367-1.063V1.19A1.2 1.2 0 0 0 10.808 0 1272.319 1272.319 0 0 1 6-.005zm-.002 1H6c1.238.005 3.553.005 4.808.004.116 0 .192.076.192.192v4.624c.003.231.01.264-.032.301a.53.53 0 0 0-.021.02l-4.81 4.81c-.082.082-.21.097-.274 0l-4.81-4.81a.184.184 0 0 1 0-.274l4.81-4.81a.216.216 0 0 1 .135-.057zM9 2a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z`;function la({tags:e,title:t,...n}){let r=e.slice(0,oa),i=e.length-r.length;return(0,B.jsx)(`span`,{className:`tag-stack`,"aria-hidden":`true`,title:t,...n,children:r.length>0?(0,B.jsxs)(B.Fragment,{children:[r.map(e=>(0,B.jsxs)(`svg`,{className:`tag-stack__icon`,style:e.color?{"--tag-color":e.color}:void 0,"data-tag-keyword":e.keyword,viewBox:`0 0 12 12`,width:`16`,height:`16`,children:[(0,B.jsx)(`path`,{className:`tag-stack__body`,d:sa}),(0,B.jsx)(`path`,{className:`tag-stack__outline`,d:ca})]},e.keyword)),i>0?(0,B.jsxs)(`span`,{className:`tag-stack__more`,children:[`+`,i]}):null]}):(0,B.jsxs)(`svg`,{className:`tag-stack__icon tag-stack__icon--empty`,viewBox:`0 0 12 12`,width:`16`,height:`16`,children:[(0,B.jsx)(`path`,{className:`tag-stack__body`,d:sa}),(0,B.jsx)(`path`,{className:`tag-stack__outline`,d:ca})]})})}function ua({tag:e,removable:t=!1,onRemove:n}){let r=e.defined?e.name:`${e.name} (keyword without a tag definition)`;return(0,B.jsxs)(`span`,{className:[`tag-chip`,e.defined?``:`tag-chip--undefined`,t?`tag-chip--removable`:``].filter(Boolean).join(` `),style:e.color?{"--tag-color":e.color}:void 0,"data-tag-keyword":e.keyword,children:[(0,B.jsxs)(`span`,{className:`tag-chip__body`,title:r,children:[(0,B.jsx)(`span`,{className:`tag-chip__dot`,"aria-hidden":`true`}),(0,B.jsx)(`span`,{className:`tag-chip__name`,children:e.name})]}),t?(0,B.jsx)(`button`,{className:`tag-chip__remove`,type:`button`,title:`Remove tag ${e.name}`,"aria-label":`Remove tag ${e.name}`,onClick:t=>{t.stopPropagation(),n?.(e)},children:(0,B.jsx)(Be,{size:11,strokeWidth:2.25,"aria-hidden":`true`})}):null]})}var da=`[role="menuitemcheckbox"], [role="menuitem"]`,fa=(0,C.forwardRef)(function({targets:e,definitions:t,label:n=`Tags`,onToggle:r,onClear:i,onManage:a,onClose:o},s){let c=(0,C.useRef)(null),l=(0,C.useMemo)(()=>Ut(e,t),[e,t]),u=t.map((e,t)=>{let n=It(e.keyword);return{keyword:n,name:e.name,color:e.color,presence:l.presence(n),digit:t<9?t+1:null}}),d=new Set(t.map(e=>It(e.keyword))),f=l.keywords.filter(e=>!d.has(e)).map(e=>({keyword:e,name:e,color:null,presence:l.presence(e),digit:null})),p=l.keywords.length>0,m=e=>r(e.keyword,e.presence!==`all`);(0,C.useImperativeHandle)(s,()=>({focusFirst:()=>c.current?.querySelector(da)?.focus()}),[]);function h(e){let t=!e.ctrlKey&&!e.metaKey&&!e.altKey;if(t&&(e.key===`t`||e.key===`T`)){e.preventDefault(),e.stopPropagation(),o?.();return}if(t&&/^[0-9]$/.test(e.key)){e.preventDefault(),e.stopPropagation();let t=Number(e.key);if(t===0){p&&i();return}let n=u[t-1];n&&m(n);return}Kr(c.current,da,e)}let g=e=>e===`all`?(0,B.jsx)(te,{size:14,strokeWidth:2.5}):e===`some`?(0,B.jsx)(N,{size:14,strokeWidth:2.5}):null,_=e=>e===`all`?`true`:e===`some`?`mixed`:`false`;return(0,B.jsxs)(`div`,{ref:c,className:`tag-picker`,role:`menu`,"aria-label":n,onKeyDown:h,children:[p?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`button`,{className:`app-dropdown__item tag-picker__item tag-picker__clear`,type:`button`,role:`menuitem`,tabIndex:-1,"aria-keyshortcuts":`0`,"data-tag-picker-clear":!0,onClick:i,children:[(0,B.jsx)(`span`,{className:`tag-picker__check`,"aria-hidden":`true`,children:(0,B.jsx)(Be,{size:14,strokeWidth:2})}),(0,B.jsx)(`span`,{className:`tag-picker__name`,children:`Remove All Tags`}),(0,B.jsx)(`kbd`,{className:`tag-picker__digit`,"aria-hidden":`true`,children:`0`})]}),(0,B.jsx)(`div`,{className:`tag-picker__separator`,role:`separator`})]}):null,u.length>0?(0,B.jsx)(`div`,{role:`group`,"aria-label":`Tags`,children:u.map(e=>(0,B.jsxs)(`button`,{className:`app-dropdown__item tag-picker__item`,type:`button`,role:`menuitemcheckbox`,tabIndex:-1,"aria-checked":_(e.presence),"aria-keyshortcuts":e.digit===null?void 0:String(e.digit),"data-tag-keyword":e.keyword,style:e.color?{"--tag-color":e.color}:void 0,onClick:()=>m(e),children:[(0,B.jsx)(`span`,{className:`tag-picker__check`,"aria-hidden":`true`,children:g(e.presence)}),(0,B.jsx)(`span`,{className:`tag-picker__dot`,"aria-hidden":`true`}),(0,B.jsx)(`span`,{className:`tag-picker__name`,children:e.name}),e.digit===null?null:(0,B.jsx)(`kbd`,{className:`tag-picker__digit`,"aria-hidden":`true`,children:e.digit})]},e.keyword))}):null,f.length>0?(0,B.jsxs)(B.Fragment,{children:[u.length>0?(0,B.jsx)(`div`,{className:`tag-picker__separator`,role:`separator`}):null,(0,B.jsxs)(`div`,{role:`group`,"aria-label":`Other keywords`,children:[(0,B.jsx)(`div`,{className:`app-dropdown__heading tag-picker__heading`,"aria-hidden":`true`,children:`Other keywords`}),f.map(e=>(0,B.jsxs)(`button`,{className:`app-dropdown__item tag-picker__item tag-picker__item--undefined`,type:`button`,role:`menuitemcheckbox`,tabIndex:-1,"aria-checked":_(e.presence),"data-tag-keyword":e.keyword,title:`${e.keyword} has no tag definition`,onClick:()=>m(e),children:[(0,B.jsx)(`span`,{className:`tag-picker__check`,"aria-hidden":`true`,children:g(e.presence)}),(0,B.jsx)(`span`,{className:`tag-picker__dot`,"aria-hidden":`true`}),(0,B.jsx)(`span`,{className:`tag-picker__name`,children:e.name})]},e.keyword))]})]}):null,u.length===0&&f.length===0?(0,B.jsx)(`p`,{className:`tag-picker__empty`,role:`none`,children:`No tags defined yet.`}):null,(0,B.jsx)(`div`,{className:`tag-picker__separator`,role:`separator`}),(0,B.jsxs)(`button`,{className:`app-dropdown__item tag-picker__item tag-picker__manage`,type:`button`,role:`menuitem`,tabIndex:-1,"data-tag-picker-manage":!0,onClick:a,children:[(0,B.jsx)(`span`,{className:`tag-picker__check`,"aria-hidden":`true`,children:(0,B.jsx)(Te,{size:14,strokeWidth:1.75})}),(0,B.jsx)(`span`,{className:`tag-picker__name`,children:`Manage Tags…`})]})]})});function pa({targets:e,definitions:t,label:n=`Tag`,title:r,triggerClass:i=``,onToggle:a,onClear:o,onManage:s,trigger:c}){let l=(0,C.useRef)(null),u=(0,C.useRef)(null);return(0,B.jsxs)(Gr,{className:`tag-picker-dropdown`,onToggle:e=>{e.currentTarget.open&&requestAnimationFrame(()=>u.current?.focusFirst())},children:[(0,B.jsx)(`summary`,{ref:l,className:`app-dropdown__summary tag-picker-dropdown__trigger ${i}`,"aria-haspopup":`menu`,"aria-label":n,title:r??n,"data-tag-picker-trigger":!0,children:c??(0,B.jsx)(je,{size:16,strokeWidth:1.75,"aria-hidden":`true`})}),(0,B.jsx)(`div`,{className:`app-dropdown__menu tag-picker-dropdown__menu`,children:(0,B.jsx)(fa,{ref:u,targets:e,definitions:t,onToggle:a,onClear:o,onManage:e=>{Wr(e),s(e)},onClose:()=>{let e=l.current?.closest(`details`);e instanceof HTMLDetailsElement&&(e.open=!1),l.current?.focus()}})})]})}var ma=260,ha=6,ga=8;function _a({anchor:e,targets:t,definitions:n,label:r=`Tags`,trigger:i=null,returnFocus:a=null,onClose:o,onToggle:s,onClear:c,onManage:l}){let u=(0,C.useRef)(null),d=(0,C.useRef)(null),[f,p]=(0,C.useState)(0),m=(0,C.useRef)(null),h=(0,C.useRef)(o);h.current=o;let g=(0,C.useRef)(i);g.current=i;let _=e!=null,v=(0,C.useCallback)(()=>{let e=u.current,t=e?.querySelector(`.tag-picker`);!e||!t||p(t.scrollHeight+e.offsetHeight-t.clientHeight)},[]);if((0,C.useLayoutEffect)(()=>{_&&v()},[_,t,n,v]),(0,C.useEffect)(()=>{if(!_)return;let e=document.activeElement;m.current=a??g.current??(e instanceof HTMLElement&&e!==document.body?e:null),d.current?.focusFirst();let t=e=>{let t=u.current;!t||!(e.target instanceof Node)||t.contains(e.target)||g.current?.contains(e.target)||h.current()},n=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),h.current())},r=e=>{e.target instanceof Node&&u.current?.contains(e.target)||h.current()};return document.addEventListener(`pointerdown`,t,!0),document.addEventListener(`keydown`,n,!0),document.addEventListener(`scroll`,r,{capture:!0,passive:!0}),window.addEventListener(`resize`,r,{passive:!0}),()=>{document.removeEventListener(`pointerdown`,t,!0),document.removeEventListener(`keydown`,n,!0),document.removeEventListener(`scroll`,r,!0),window.removeEventListener(`resize`,r),p(0);let e=m.current;m.current=null,e?.isConnected&&e.focus()}},[_]),!e)return null;let y=window.innerWidth,b=window.innerHeight,x=e.left+e.width-ma;x=Math.max(ga,Math.min(x,y-ma-ga));let S=e.top+e.height+ha,w=b-ga-S,T=e.top-ha-ga,E=S,D=w;return f>w&&(f<=T||T>w)&&(D=T,E=e.top-ha-Math.min(f,T)),(0,Ai.createPortal)((0,B.jsx)(`div`,{ref:u,className:`app-dropdown__menu tag-picker-popover`,style:{position:`fixed`,top:`${Math.max(ga,E)}px`,left:`${x}px`,width:`${ma}px`,maxHeight:`${Math.max(0,D)}px`},role:`dialog`,"aria-label":r,"data-tag-picker-popover":!0,onKeyDown:e=>{e.key===`Tab`&&(e.preventDefault(),o())},children:(0,B.jsx)(fa,{ref:d,targets:t,definitions:n,label:r,onToggle:s,onClear:c,onManage:l,onClose:o})}),document.body)}var va=(0,C.memo)(function({message:e,index:t,start:n,size:r,domIdPrefix:i,focused:a,cursor:o,selected:s,dragging:c,showsRecipients:l,sort:u,hoverActions:d,archiveAction:f,deleteAction:p,draggable:m,tagMenuOpen:h,tagDefinitions:g,handlers:_}){let v=e.is_seen===0,y=e.is_flagged===1,b=(0,C.useMemo)(()=>Vt(e.keywords_json,g),[e.keywords_json,g]),x=b.length===0?`Tag`:`Tags: ${b.map(e=>e.name).join(`, `)}`,S=ta(e,l),w=(0,C.useMemo)(()=>cn(S,``),[S]),T=na(e,l),E=V(ra(e,u)),D=e.subject||`(no subject)`,ee=[T,D,E,v?`Unread`:``,y?`Starred`:``,e.has_attachment===1?`Has attachments`:``,b.length>0?x:``].filter(Boolean).join(`, `),O=e.scheduled_undo_status===`pending`,k=[a?`is-focused`:``,o?`is-cursor`:``,s?`is-selected`:``,c?`is-dragging`:``,v?`is-unread`:``].filter(Boolean).join(` `);return(0,B.jsx)(`li`,{id:`${i}${e.id}`,"data-index":t,"data-message-id":e.id,role:`row`,"aria-rowindex":t+1,"aria-label":ee,"aria-selected":s,className:k||void 0,style:{position:`absolute`,top:`0px`,left:`0px`,right:`0px`,transform:`translateY(${n}px)`,height:`${r}px`},children:(0,B.jsxs)(`div`,{className:[`msg-list__item`,d?`msg-list__item--hover-actions`:``,h?`has-tag-menu`:``].filter(Boolean).join(` `),role:`gridcell`,draggable:m&&!O,onClick:e=>_.rowClick(t,e),onDragStart:t=>_.dragStart(e,t),onDragEnd:_.dragEnd,children:[(0,B.jsx)(`button`,{type:`button`,className:`msg-list__open`,"data-message-control":!0,tabIndex:-1,"aria-label":`Open message: ${D}, ${T}`}),(0,B.jsxs)(`div`,{className:`msg-list__state`,children:[(0,B.jsx)(`label`,{className:`msg-list__check`,draggable:!1,onClick:e=>e.stopPropagation(),children:(0,B.jsx)(`input`,{type:`checkbox`,"data-message-control":!0,tabIndex:-1,"aria-label":`Select message: ${D}, ${T}`,checked:s,onChange:()=>{},onClick:e=>_.checkboxClick(t,e)})}),v?(0,B.jsx)(`span`,{className:`msg-list__unread-dot`,"aria-hidden":`true`}):null]}),(0,B.jsx)(`div`,{className:`msg-list__avatar`,style:w.style,"aria-hidden":`true`,children:(0,B.jsx)(`span`,{children:w.initials})}),(0,B.jsxs)(`div`,{className:`msg-list__content`,children:[(0,B.jsxs)(`div`,{className:`msg-list__summary`,children:[(0,B.jsx)(`span`,{className:`msg-list__from`,children:T}),(0,B.jsx)(`span`,{className:`msg-list__subject`,children:D}),(0,B.jsxs)(`span`,{className:`msg-list__icons`,children:[y&&!d?(0,B.jsx)(Oe,{size:13,strokeWidth:2,className:`msg-list__star`}):null,e.has_attachment===1?(0,B.jsx)(ve,{size:13,strokeWidth:1.75,className:`msg-list__attach`}):null,!d&&b.length>0?(0,B.jsx)(la,{tags:b,title:x,"data-row-tags":!0}):null]}),(0,B.jsx)(`span`,{className:`msg-list__date`,children:E}),d?(0,B.jsxs)(`div`,{className:`msg-list__actions`,draggable:!1,onClick:e=>e.stopPropagation(),children:[(0,B.jsx)(`button`,{type:`button`,className:`msg-list__action msg-list__action--tag${b.length>0?` is-tagged`:``}`,tabIndex:-1,"data-message-control":!0,title:x,"aria-label":x,"aria-haspopup":`dialog`,"aria-expanded":h,"data-row-tags":!0,onClick:t=>_.tag(e,t),children:(0,B.jsx)(la,{tags:b})}),(0,B.jsx)(`button`,{type:`button`,className:`msg-list__action msg-list__action--star${y?` msg-list__action--starred`:``}`,tabIndex:-1,"data-message-control":!0,title:y?`Unstar`:`Star`,"aria-label":y?`Unstar`:`Star`,"aria-pressed":y,onClick:()=>_.star(e),children:(0,B.jsx)(Oe,{size:17,strokeWidth:1.75,fill:y?`#facc15`:`none`})}),f?(0,B.jsx)(`button`,{type:`button`,className:`msg-list__action`,tabIndex:-1,"data-message-control":!0,title:`Archive`,"aria-label":`Archive`,onClick:()=>_.archive(e.id),children:(0,B.jsx)(`span`,{className:`msg-list__action-icon--folder`,"aria-hidden":`true`,dangerouslySetInnerHTML:{__html:oi}})}):null,p?(0,B.jsx)(`button`,{type:`button`,className:`msg-list__action msg-list__action--danger`,tabIndex:-1,"data-message-control":!0,title:`Delete`,"aria-label":`Delete`,onClick:()=>_.remove(e.id),children:(0,B.jsx)(Ie,{size:18,strokeWidth:1.65})}):null]}):null]}),e.preview?(0,B.jsx)(`p`,{className:`msg-list__preview`,children:e.preview}):null]})]})})});function ya({folder:e,anyStarred:t,anyScheduled:n,handlers:r}){let i=e?.role,a=[];return i===`junk`&&a.push({id:`whitelist`,label:`Not junk`,title:`Whitelist senders and move to Inbox`,ariaLabel:`Not junk — whitelist senders and move the selected messages to Inbox`,icon:null,variant:`whitelist`,slots:3,overflowRank:6,run:r.whitelist}),!n&&i!==`archive`&&a.push({id:`archive`,label:`Archive`,title:`Archive`,ariaLabel:`Archive`,icon:null,rawIcon:oi,variant:`default`,slots:1,overflowRank:5,run:r.archive}),!n&&i!==`junk`&&a.push({id:`junk`,label:`Mark as junk`,title:`Junk`,ariaLabel:`Mark as junk`,icon:null,rawIcon:pi,variant:`default`,slots:1,overflowRank:2,run:r.junk}),n?a.push({id:`cancel-send`,label:`Cancel send`,title:`Cancel send`,ariaLabel:`Cancel send — return the selected messages to Drafts`,icon:Ie,variant:`danger`,slots:1,overflowRank:null,run:r.cancelSend}):(a.push({id:`delete`,label:`Delete`,title:`Delete`,ariaLabel:`Delete`,icon:Ie,variant:`danger`,slots:1,overflowRank:null,run:r.delete}),a.push({id:`toggle-star`,label:t?`Unstar`:`Star`,title:t?`Unstar`:`Star`,ariaLabel:t?`Unstar`:`Star`,icon:Oe,variant:`star`,pressed:t,slots:1,overflowRank:4,run:r.toggleStar}),a.push({id:`tag`,label:`Tag…`,title:`Tag`,ariaLabel:`Tag selected messages`,icon:je,variant:`tag`,slots:1,overflowRank:3,run:r.tag})),a.push({id:`mark-read`,label:`Mark as read`,title:`Mark as read`,ariaLabel:`Mark as read`,icon:ge,variant:`default`,slots:1,overflowRank:1,run:r.markRead}),a.push({id:`mark-unread`,label:`Mark as unread`,title:`Mark as unread`,ariaLabel:`Mark as unread`,icon:_e,variant:`default`,slots:1,overflowRank:0,run:r.markUnread}),a}function ba(e,t){if(t==null)return{inline:[...e],overflow:[]};let n=new Set,r=0;for(let t of e)t.overflowRank===null&&(n.add(t),r+=t.slots);let i=e.filter(e=>e.overflowRank!==null).sort((e,t)=>(t.overflowRank??0)-(e.overflowRank??0));for(let e of i)r+e.slots>t||(n.add(e),r+=e.slots);return{inline:e.filter(e=>n.has(e)),overflow:e.filter(e=>!n.has(e))}}function xa({items:e,renderTag:t}){return(0,B.jsx)(B.Fragment,{children:e.map(e=>{if(e.variant===`tag`)return(0,B.jsx)(`span`,{style:{display:`contents`},children:t(e)},e.id);let n=e.icon;return(0,B.jsxs)(`button`,{className:[`msg-list__bulk-action`,e.variant===`danger`?`msg-list__bulk-action--danger`:``,e.variant===`star`?`msg-list__bulk-action--star`:``,e.variant===`star`&&e.pressed?`msg-list__bulk-action--starred`:``,e.variant===`whitelist`?`msg-list__bulk-action--whitelist`:``].filter(Boolean).join(` `),type:`button`,disabled:e.disabled,title:e.title,"aria-label":e.ariaLabel,"aria-pressed":e.variant===`star`?e.pressed:void 0,"data-bulk-action":e.id,onClick:()=>e.run(),children:[e.variant===`whitelist`?e.label:null,e.variant!==`whitelist`&&e.rawIcon?(0,B.jsx)(`span`,{className:`msg-list__bulk-icon msg-list__bulk-icon--folder`,"aria-hidden":`true`,dangerouslySetInnerHTML:{__html:e.rawIcon}}):null,e.variant!==`whitelist`&&!e.rawIcon&&n?(0,B.jsx)(n,{size:e.variant===`star`?17:e.variant===`danger`?18:16,strokeWidth:e.variant===`danger`?1.65:1.75,fill:e.variant===`star`?e.pressed?`currentColor`:`none`:void 0}):null]},e.id)})})}var Sa=`[role="menuitem"]:not([aria-disabled="true"])`;function Ca({groups:e,label:t=`More actions`}){let n=(0,C.useRef)(null),r=(0,C.useRef)(null);return(0,B.jsxs)(Gr,{className:`msg-list__more`,onToggle:e=>{e.currentTarget.open&&requestAnimationFrame(()=>r.current?.querySelector(Sa)?.focus())},children:[(0,B.jsx)(`summary`,{ref:n,className:`app-dropdown__summary msg-list__more-trigger`,"aria-haspopup":`menu`,"aria-label":t,title:t,"data-more-menu":!0,children:(0,B.jsx)(se,{size:18,strokeWidth:1.75,"aria-hidden":`true`})}),(0,B.jsx)(`div`,{ref:r,className:`app-dropdown__menu msg-list__more-menu`,role:`menu`,"aria-label":t,onKeyDown:e=>Kr(r.current,Sa,e),children:e.map((e,t)=>(0,B.jsxs)(`div`,{style:{display:`contents`},children:[t>0?(0,B.jsx)(`div`,{className:`msg-list__more-separator`,role:`separator`}):null,(0,B.jsxs)(`div`,{role:`group`,"aria-label":e.label,children:[e.label?(0,B.jsx)(`div`,{className:`app-dropdown__heading msg-list__more-heading`,title:e.label,"aria-hidden":`true`,children:e.label}):null,e.items.map(e=>{let t=e.icon;return(0,B.jsxs)(`button`,{className:`app-dropdown__item msg-list__more-item${e.danger?` msg-list__more-item--danger`:``}`,type:`button`,tabIndex:-1,role:`menuitem`,"aria-disabled":e.disabled?`true`:void 0,"data-more-item":e.id,onClick:t=>{e.disabled||(Wr(t),n.current?.focus(),e.run())},children:[(0,B.jsx)(`span`,{className:`msg-list__more-icon`,"aria-hidden":`true`,children:e.rawIcon?(0,B.jsx)(`span`,{className:`msg-list__more-icon-raw`,dangerouslySetInnerHTML:{__html:e.rawIcon}}):t?(0,B.jsx)(t,{size:16,strokeWidth:1.75}):null}),(0,B.jsx)(`span`,{className:`msg-list__more-label`,children:e.label})]},e.id)})]})]},e.id))})]})}function wa({className:e,allSelected:t,disabled:n,itemLabel:r,singularItemLabel:i,selectedCount:a,showTotalCount:o,totalCount:s,headerTier:c,onClearSelection:l,onToggleAll:u,selectionActions:d,normalActions:f,trailing:p}){let m=(0,C.useRef)(null),h=a>0&&!t;(0,C.useEffect)(()=>{m.current&&(m.current.indeterminate=h)},[h]);let g=n||s===0;return(0,B.jsxs)(`header`,{className:`selectable-list-header ${e??``}`,"data-header-tier":c,children:[(0,B.jsx)(`label`,{className:`selectable-list-header__select-all msg-list__select-all${g?` is-disabled`:``}`,title:g?`No ${r} to select`:t?`Deselect all ${r}`:`Select all ${r}`,children:(0,B.jsx)(`input`,{ref:m,type:`checkbox`,checked:t,disabled:g,onChange:u,"aria-label":`Select all messages`})}),a>0?(0,B.jsxs)(`div`,{className:`selectable-list-header__selection-actions msg-list__bulk-actions`,role:`group`,"aria-label":`Selection actions`,children:[d,(0,B.jsx)(`button`,{className:`selectable-list-header__clear msg-list__bulk-action msg-list__bulk-action--ghost`,type:`button`,title:`Clear selection`,"aria-label":`Clear selection`,onClick:l,children:(0,B.jsx)(Be,{size:16,strokeWidth:1.75,"aria-hidden":`true`})})]}):(0,B.jsx)(`div`,{className:`selectable-list-header__normal-actions`,children:f}),(0,B.jsx)(`span`,{className:`selectable-list-header__count${a===0?` selectable-list-header__count--total`:``} msg-list__count`,"aria-live":`polite`,children:a>0?`${a} selected`:o&&s>0?`${s} ${s===1?i:r}`:null}),p]})}var Ta=480,Ea=64,Da=96,Oa=520,ka=440,Aa=340,ja=232,Ma=38,Na=`msg-row-`,Pa=`msg-listbox`,Fa=new Set,Ia=Ft,La=new Map;function Ra(e){return e===`sent`||e===`drafts`||e===`scheduled`?`sent`:`received`}function za(e){if(!e||e.getClientRects().length===0)return null;let t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}}function Ba({quickFilterQuery:e}){let t=z(e=>e.currentViewId),n=z(e=>e.folders),r=z(e=>e.messages),i=z(e=>e.folderIds),a=z(e=>e.selection),o=z(e=>e.focused),s=z(e=>e.open),c=z(e=>e.folderPickCount),l=wi(e=>e.draggedIds),u=an({folders:n},t),d=Kt(t),f=d?Ia.find(e=>e.keyword===R(t))?.name??`Starred`:u?.name??`Mail`,p=`${f} messages, column 1`,m=Zt({messages:r,folderIds:i},t),h=a.viewId===t?a.ids:Fa,g=o.viewId===t?o.id:null,_=s.viewId===t?s.id:null,[v,y]=(0,C.useState)(!1),[b,x]=(0,C.useState)(!1),S=ia(e),w=S.length>0,T=v||b||w,E=(0,C.useCallback)((e,t)=>t&&(e.id===_||h.has(e.id))?!0:!(v&&e.is_seen!==0||b&&e.is_flagged!==1||w&&!aa(e,S)),[_,h,v,b,w,S]),D=(0,C.useMemo)(()=>T?m.filter(e=>E(e,!0)):m,[m,T,E]),ee=(0,C.useMemo)(()=>T?m.filter(e=>E(e,!1)):m,[m,T,E]),O=D.length;function k(e){if(_==null)return;let t=m.find(e=>e.id===_);t&&!(e.unread&&t.is_seen!==0)&&!(e.flagged&&t.is_flagged!==1)&&!(e.needle&&!aa(t,e.needle))||z.getState().selectMessage(null)}let te=(0,C.useRef)(S);(0,C.useEffect)(()=>{te.current!==S&&(te.current=S,k({unread:v,flagged:b,needle:S}))},[S]);let A=(0,C.useRef)(-1),ne=h.size,re=ne>0,ae=(0,C.useCallback)(e=>{z.getState().setSelection(t,e)},[t]),oe=(0,C.useCallback)(e=>{let n=D[e];return n?(z.getState().setFocusedMessage(n.id,t),n.id):null},[D,t]),se=(0,C.useCallback)(e=>{let t=D[e];if(!t)return;let n=new Set(h);n.has(t.id)?n.delete(t.id):n.add(t.id),A.current=e,ae(n)},[D,h,ae]),j=(0,C.useCallback)((e,t=e)=>{if(e<0||e>=D.length)return;let n=A.current>=0,r=n?A.current:Math.max(0,Math.min(D.length-1,t)),i=Math.min(e,r),a=Math.max(e,r),o=new Set;for(let e=i;e<=a;e+=1)o.add(D[e].id);ae(o),n||(A.current=r)},[D,ae]),ce=(0,C.useCallback)(()=>{h.size>0&&ae(new Set),A.current=-1},[h,ae]),M=(0,C.useCallback)(e=>{z.getState().selectMessage(e,e==null?void 0:t)},[t]),le=(0,C.useCallback)(()=>{let e=new Set;for(let t of ee)e.add(t.id);ae(e),e.size>0&&(A.current=0)},[ee,ae]),ue=ee.length>0&&ee.every(e=>h.has(e.id)),de=(0,C.useRef)(null),fe=(0,C.useRef)(null),[pe,me]=(0,C.useState)(0),he=pe>0&&pe{let e=de.current;if(!e)return;me(e.clientWidth);let t=new ResizeObserver(([e])=>me(e.contentRect.width));return t.observe(e),()=>t.disconnect()},[]);let ge=$i({count:O,getScrollElement:()=>fe.current,estimateSize:()=>he?Da:Ea,overscan:8,getItemKey:e=>D[e]?.id??`_ph_${e}`});(0,C.useLayoutEffect)(()=>{ge.measure()},[he,ge]);let _e=(0,C.useRef)(!1),N=(0,C.useCallback)(()=>{_e.current||(_e.current=!0,requestAnimationFrame(()=>{_e.current=!1,fe.current&&La.set(t,fe.current.scrollTop)}))},[t]),P=(0,C.useRef)(null);(0,C.useLayoutEffect)(()=>{let e=P.current;if(P.current={viewId:t,pick:c},e&&e.viewId===t&&e.pick===c)return;ge.measure();let n=fe.current;if(e&&e.viewId===t){La.set(t,0),n&&(n.scrollTop=0);return}n&&(n.scrollTop=La.get(t)??0)},[t,c,ge]),(0,C.useEffect)(()=>{if(g==null||!fe.current)return;let e=D.findIndex(e=>e.id===g);e>=0&&ge.scrollToIndex(e,{align:`auto`})},[g]);let ve=ge.getVirtualItems(),ye=()=>ve[0]?.index??0,be=pe>0,xe=!be||pe>=Oa,F=!be||pe>=ka,Ce=!re&&(!be||pe>=Aa),we=!Ce&&!re?`compact`:F?xe?`full`:`no-count`:`icon-filters`,Te=be?Math.max(1,Math.floor((pe-ja)/Ma)):null,Ee=z.getState,De=(0,C.useMemo)(()=>m.filter(e=>h.has(e.id)),[m,h]),ke=De.some(e=>e.is_flagged===1),Ae=De.some(e=>e.scheduled_undo_status===`pending`),je=()=>[...h],[Me,Ne]=(0,C.useState)(null),Pe=(0,C.useCallback)(()=>{Ne(null)},[]),Fe=(0,C.useCallback)(()=>{let e=de.current?.querySelector(`[data-more-menu]`)??de.current?.querySelector(`.msg-list__header`)??null,t=za(e);t&&Ne({ids:[...h],targets:De,anchor:t,trigger:e,returnFocus:e})},[h,De]),Ie=ba(ya({folder:u,anyStarred:ke,anyScheduled:Ae,handlers:{archive:()=>Ee().archiveMessages(je()),junk:()=>Ee().junkMessages(je()),delete:()=>Ee().destroyMessages(je()),cancelSend:()=>De.filter(e=>e.scheduled_undo_status===`pending`).forEach(e=>Ee().cancelScheduledSend(e.id)),toggleStar:()=>Ee().toggleManyFlagged(je()),tag:Fe,markRead:()=>Ee().markManySeen(je(),!0),markUnread:()=>Ee().markManySeen(je(),!1),whitelist:()=>Ee().notJunk(je())}}),Te),Le=(0,C.useCallback)(()=>{},[]),Re=[];re&&Ie.overflow.length>0&&Re.push({id:`selection`,items:Ie.overflow.map(e=>({id:e.id,label:e.label,icon:e.icon,rawIcon:e.rawIcon,disabled:e.disabled,danger:e.variant===`danger`,run:e.run}))}),Ce||Re.push({id:`column`,label:re?f:void 0,items:[{id:`refresh`,label:`Refresh`,icon:Se,run:Le}]});let ze=(0,C.useCallback)(e=>{let t=D;if(t.length===0)return;if(e===`first`){M(t[0].id);return}if(e===`last`){M(t[t.length-1].id);return}let n=e===`next`||e===`nextUnread`?1:-1,r=e===`nextUnread`||e===`previousUnread`,i=g==null?-1:t.findIndex(e=>e.id===g);i<0&&(i=n>0?-1:t.length);for(let e=i+n;e>=0&&e{if(h.size>0){let e=(de.current?.querySelector(`[data-tag-picker-trigger]`))?.closest(`details`);if(e){e.open=!0;return}Fe();return}if(_==null)return;let e=m.find(e=>e.id===_);if(!e||e.scheduled_undo_status===`pending`)return;let t=document.getElementById(`${Na}${_}`)?.querySelector(`.msg-list__action--tag`)??null,n=za(t)??za(de.current?.querySelector(`.msg-list__header`));n&&Ne({ids:[_],targets:[e],anchor:n,trigger:t,returnFocus:fe.current})},[h,_,m,Fe]);(0,C.useEffect)(()=>Pr({navigate:ze,selectAll:le,openTagMenu:Be,containsFocus:()=>de.current?.contains(document.activeElement)===!0}),[ze,le,Be]);function Ve(e){return[...e.querySelectorAll(`[data-message-control]`)].filter(e=>getComputedStyle(e).display!==`none`&&getComputedStyle(e).visibility!==`hidden`).sort((e,t)=>Number(t.matches(`input`))-Number(e.matches(`input`)))}function He(e){if(e.defaultPrevented)return;if((e.metaKey||e.ctrlKey)&&(e.key===`a`||e.key===`A`)){e.preventDefault(),le();return}if(e.altKey||e.metaKey||e.ctrlKey)return;let n=(e.target instanceof Element?e.target:null)?.closest(`[data-message-control]`)??null,r=n?.closest(`[role="row"]`)??null;if(n&&r){if(e.key===`Tab`){fe.current?.focus({preventScroll:!0});return}if(e.key===`Escape`||e.key===`F2`){e.preventDefault(),oe(Number(r.dataset.index)),fe.current?.focus({preventScroll:!0});return}if([`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key)){e.preventDefault();let t=Ve(r),i=t.indexOf(n),a=e.key===`Home`?0:e.key===`End`?t.length-1:i+(e.key===`ArrowRight`?1:-1);t[Math.max(0,Math.min(t.length-1,a))]?.focus({preventScroll:!0});return}if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;oe(Number(r.dataset.index)),fe.current?.focus({preventScroll:!0})}else if(e.key===`F2`||e.key===`ArrowRight`||e.key===`Enter`){let t=Array.from(fe.current?.querySelectorAll(`[role="row"]`)??[]),n=fe.current?.getBoundingClientRect(),r=e=>{let t=e.getBoundingClientRect();return n!=null&&t.bottom>n.top&&t.tope.id===g);t>=0&&(e.preventDefault(),se(t));return}if(e.key===`ArrowDown`||e.key===`ArrowUp`){let n=D.length;if(!n)return;e.preventDefault();let r=e.key===`ArrowDown`?1:-1,i=g==null?-1:D.findIndex(e=>e.id===g),a;a=i>=0?i:A.current>=0?A.current:r>0?-1:n;let o=Math.max(0,Math.min(n-1,a+r));e.shiftKey?(j(o),z.getState().setFocusedMessage(D[o].id,t)):M(D[o].id)}}function Ue(e){(e.type===`contextmenu`?e.button===2:e.detail>0)&&e.target instanceof Element&&e.target.closest(`[data-message-control], .msg-list__check`)&&fe.current?.focus({preventScroll:!0})}let We=(0,C.useRef)(null);We.current={rowClick(e,t){if(fe.current?.focus({preventScroll:!0}),t.shiftKey||t.ctrlKey||t.metaKey){t.preventDefault(),t.shiftKey?j(e,ye()):se(e);return}let n=re,r=oe(e);if(r!=null){if(n&&ce(),!n&&r===_){M(null);return}M(r)}},checkboxClick(e,t){t.stopPropagation(),t.shiftKey?j(e,ye()):se(e)},dragStart(e,n){fe.current?.focus({preventScroll:!0}),wi.getState().startDrag(n,{messageId:e.id,selectedIds:h,sourceViewId:t})},dragEnd(){wi.getState().endDrag()},star(e){Ee().markManyFlagged([e.id],e.is_flagged!==1)},tag(e,t){let n=t.currentTarget instanceof HTMLElement?t.currentTarget:null;if(Me&&Me.ids.length===1&&Me.ids[0]===e.id){Pe();return}let r=za(n);r&&Ne({ids:[e.id],targets:[e],anchor:r,trigger:n,returnFocus:t.detail===0?n:fe.current})},archive(e){Ee().archiveMessages([e])},remove(e){Ee().destroyMessages([e])}};let Ge=(0,C.useMemo)(()=>({rowClick:(e,t)=>We.current.rowClick(e,t),checkboxClick:(e,t)=>We.current.checkboxClick(e,t),dragStart:(e,t)=>We.current.dragStart(e,t),dragEnd:()=>We.current.dragEnd(),star:e=>We.current.star(e),tag:(e,t)=>We.current.tag(e,t),archive:e=>We.current.archive(e),remove:e=>We.current.remove(e)}),[]),Ke=Me&&Me.ids.length===1&&Me.trigger?.classList.contains(`msg-list__action--tag`)?Me.ids[0]:null,qe=(0,C.useMemo)(()=>Me?Me.ids.map(e=>r.get(e)??Me.targets.find(t=>t.id===e)):[],[Me,r]),Je=wi(e=>e.sourceViewId),Ye=wi(e=>e.dragging),[Xe,Ze]=(0,C.useState)(!1),Qe=Ye&&Xe&&Je!==t&&!d?`move`:null;function $e(e){if(Ze(!1),d||typeof t!=`number`)return;let n=Ti(e);!n||n.sourceViewId===t||(e.preventDefault(),Ee().moveMessages(n.ids,t),wi.getState().endDrag())}let et=ea(u),I=Ra(u?.role),L=u?.role===`archive`,tt=`No ${[v?`unread`:null,b?`starred`:null].filter(Boolean).join(` `)}${v||b?` `:``}messages in ${f}.`,nt=(0,C.useMemo)(()=>new Set(l),[l]);return(0,B.jsxs)(`section`,{ref:de,className:[`msg-list`,`msg-columns__column`,`msg-columns__column--last`,he?`msg-list--card`:``,`msg-list--primary`,Qe===`move`?`is-drop-valid`:``].filter(Boolean).join(` `),role:`region`,"aria-label":p,onDragEnter:()=>Ze(!0),onDragOver:e=>{Je!==t&&!d&&e.preventDefault()},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||Ze(!1)},onDrop:$e,children:[(0,B.jsx)(wa,{className:`msg-list__header`,headerTier:we,allSelected:ue,disabled:!1,itemLabel:`messages`,singularItemLabel:`message`,selectedCount:ne,showTotalCount:xe,totalCount:O,onClearSelection:ce,onToggleAll:()=>re?ce():le(),selectionActions:(0,B.jsx)(xa,{items:Ie.inline,renderTag:e=>(0,B.jsx)(pa,{targets:De,definitions:Ia,label:e.ariaLabel,title:e.title,triggerClass:`msg-list__bulk-action msg-list__bulk-action--tag`,onToggle:(e,t)=>Ee().setTagsMany([...h],t?{add:[e]}:{remove:[e]}),onClear:()=>Ee().clearTagsMany([...h]),onManage:()=>{}})}),normalActions:(0,B.jsxs)(`div`,{className:[`msg-list__filters`,F?``:`msg-list__filters--icons`,`msg-list__filters--lead`].filter(Boolean).join(` `),role:`group`,"aria-label":`Message filters`,children:[(0,B.jsx)(`button`,{className:`msg-list__filter${v?` is-active`:``}`,type:`button`,"aria-pressed":v,"aria-label":`Unread`,title:`Unread`,onClick:()=>{let e=!v;y(e),k({unread:e,flagged:b,needle:S})},children:F?`Unread`:(0,B.jsx)(ie,{size:10,strokeWidth:2,fill:`currentColor`,"aria-hidden":`true`})}),(0,B.jsx)(`button`,{className:`msg-list__filter msg-list__filter--starred${b?` is-active`:``}`,type:`button`,"aria-pressed":b,"aria-label":`Starred`,title:`Starred`,onClick:()=>{let e=!b;x(e),k({unread:v,flagged:e,needle:S})},children:F?`Starred`:(0,B.jsx)(Oe,{size:16,strokeWidth:1.75,"aria-hidden":`true`})})]}),trailing:(0,B.jsxs)(B.Fragment,{children:[Ce?(0,B.jsx)(`button`,{className:`msg-list__refresh`,type:`button`,"aria-label":`Refresh`,title:`Refresh`,onClick:Le,children:(0,B.jsx)(Se,{size:16,strokeWidth:1.75,"aria-hidden":`true`})}):null,Re.length>0?(0,B.jsx)(Ca,{groups:Re,label:`More actions for column 1`}):null]})}),(0,B.jsx)(`p`,{className:`msg-list__coverage is-idle`,role:`status`,"aria-hidden":`true`,"data-tag-view-coverage":!0}),(0,B.jsx)(`span`,{id:`${Pa}-instructions`,hidden:!0,children:`Use Up and Down arrows to navigate messages, Space to select, and Enter to toggle the message preview. Press Right Arrow or F2 for message controls, then Left and Right arrows to move between them. Escape returns to message navigation. Tab leaves the message list.`}),O>0?(0,B.jsx)(`div`,{id:Pa,ref:fe,className:`msg-list__scroller`,tabIndex:0,role:`grid`,"aria-multiselectable":`true`,"aria-rowcount":O,"aria-colcount":1,"aria-describedby":`${Pa}-instructions`,"aria-label":`Messages`,"aria-activedescendant":g!=null&&ve.some(e=>D[e.index]?.id===g)?`${Na}${g}`:void 0,onScroll:N,onKeyDown:He,onClickCapture:Ue,onContextMenuCapture:Ue,children:(0,B.jsx)(`ol`,{className:`msg-list__items`,role:`presentation`,style:{height:`${ge.getTotalSize()}px`},children:ve.map(e=>{let t=D[e.index];return t?(0,B.jsx)(va,{message:t,index:e.index,start:e.start,size:e.size,domIdPrefix:Na,focused:_===t.id,cursor:g===t.id,selected:h.has(t.id),dragging:nt.has(t.id),showsRecipients:et,sort:I,hoverActions:t.scheduled_undo_status!==`pending`,archiveAction:!L,deleteAction:!0,draggable:!d,tagMenuOpen:Ke===t.id,tagDefinitions:Ia,handlers:Ge},e.key):null})})}):w?(0,B.jsx)(`div`,{className:`msg-list__placeholder`,children:(0,B.jsxs)(`p`,{children:[`No messages matching "`,e.trim(),`" in `,f,`.`]})}):v||b?(0,B.jsx)(`div`,{className:`msg-list__placeholder`,children:(0,B.jsx)(`p`,{children:tt})}):d?(0,B.jsx)(`div`,{className:`msg-list__placeholder`,children:(0,B.jsxs)(`p`,{children:[`No messages are tagged `,f,`.`]})}):(0,B.jsx)(`div`,{className:`msg-list__placeholder`,children:(0,B.jsxs)(`p`,{children:[f,` is empty.`]})}),(0,B.jsx)(_a,{anchor:Me?.anchor??null,targets:qe,definitions:Ia,trigger:Me?.trigger??null,returnFocus:Me?.returnFocus??null,onClose:Pe,onToggle:(e,t)=>Ee().setTagsMany(Me?.ids??[],t?{add:[e]}:{remove:[e]}),onClear:()=>Ee().clearTagsMany(Me?.ids??[]),onManage:Pe})]})}function Va(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n`u`?null:To(BigInt.prototype.toString),bo=typeof Symbol>`u`?null:To(Symbol.prototype.toString),xo=To(Object.prototype.hasOwnProperty),So=To(Object.prototype.toString),Co=To(RegExp.prototype.test),wo=Eo(TypeError);function To(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return no(e,t,n)}}function Eo(e){return function(){return ro(e,[...arguments])}}function H(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:uo;if(Ja&&Ja(e,null),!lo(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(Ya(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Do(e){for(let t=0;t/g),Uo=$a(/\${[\w\W]*/g),Wo=$a(/^data-[\-\w.\u00B7-\uFFFF]+$/),Go=$a(/^aria-[\-\w]+$/),Ko=$a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),qo=$a(/^(?:\w+script|data):/i),Jo=$a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Yo=$a(/^html$/i),Xo=$a(/^[a-z][.\w]*(-[.\w]+)+$/i),Zo={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Qo=function(){return typeof window>`u`?null:window},$o=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},es=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function ts(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Qo(),t=e=>ts(e);if(t.version=`3.4.7`,t.removed=[],!e||!e.document||e.document.nodeType!==Zo.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=Ao(d,`cloneNode`),p=Ao(d,`remove`),m=Ao(d,`nextSibling`),h=Ao(d,`childNodes`),g=Ao(d,`parentNode`),_=Ao(d,`shadowRoot`),v=Ao(d,`attributes`),y=o&&o.prototype?Ao(o.prototype,`nodeType`):null,b=o&&o.prototype?Ao(o.prototype,`nodeName`):null;if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let x,S=``,C=n,w=C.implementation,T=C.createNodeIterator,E=C.createDocumentFragment,D=C.getElementsByTagName,ee=r.importNode,O=es();t.isSupported=typeof qa==`function`&&typeof g==`function`&&w&&w.createHTMLDocument!==void 0;let k=Vo,te=Ho,A=Uo,ne=Wo,re=Go,ie=qo,ae=Jo,oe=Xo,se=Ko,j=null,ce=H({},[...Mo,...No,...Po,...Io,...Ro]),M=null,le=H({},[...zo,...Bo,...U,...W]),ue=Object.seal(eo(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),de=null,fe=null,pe=Object.seal(eo(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),me=!0,he=!0,ge=!1,_e=!0,N=!1,P=!0,ve=!1,ye=!1,be=!1,xe=!1,Se=!1,F=!1,Ce=!0,we=!1,Te=`user-content-`,Ee=!0,De=!1,Oe={},ke=null,Ae=H({},[`annotation-xml`,`audio`,`colgroup`,`desc`,`foreignobject`,`head`,`iframe`,`math`,`mi`,`mn`,`mo`,`ms`,`mtext`,`noembed`,`noframes`,`noscript`,`plaintext`,`script`,`style`,`svg`,`template`,`thead`,`title`,`video`,`xmp`]),je=null,Me=H({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ne=null,Pe=H({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Fe=`http://www.w3.org/1998/Math/MathML`,Ie=`http://www.w3.org/2000/svg`,Le=`http://www.w3.org/1999/xhtml`,Re=Le,ze=!1,Be=null,Ve=H({},[Fe,Ie,Le],fo),He=H({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Ue=H({},[`annotation-xml`]),We=H({},[`title`,`style`,`font`,`a`,`script`]),Ge=null,Ke=[`application/xhtml+xml`,`text/html`],qe=null,Je=null,Ye=n.createElement(`form`),Xe=function(e){return e instanceof RegExp||e instanceof Function},Ze=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Je&&Je===e)return;(!e||typeof e!=`object`)&&(e={}),e=Oo(e),Ge=Ke.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,qe=Ge===`application/xhtml+xml`?fo:uo,j=xo(e,`ALLOWED_TAGS`)&&lo(e.ALLOWED_TAGS)?H({},e.ALLOWED_TAGS,qe):ce,M=xo(e,`ALLOWED_ATTR`)&&lo(e.ALLOWED_ATTR)?H({},e.ALLOWED_ATTR,qe):le,Be=xo(e,`ALLOWED_NAMESPACES`)&&lo(e.ALLOWED_NAMESPACES)?H({},e.ALLOWED_NAMESPACES,fo):Ve,Ne=xo(e,`ADD_URI_SAFE_ATTR`)&&lo(e.ADD_URI_SAFE_ATTR)?H(Oo(Pe),e.ADD_URI_SAFE_ATTR,qe):Pe,je=xo(e,`ADD_DATA_URI_TAGS`)&&lo(e.ADD_DATA_URI_TAGS)?H(Oo(Me),e.ADD_DATA_URI_TAGS,qe):Me,ke=xo(e,`FORBID_CONTENTS`)&&lo(e.FORBID_CONTENTS)?H({},e.FORBID_CONTENTS,qe):Ae,de=xo(e,`FORBID_TAGS`)&&lo(e.FORBID_TAGS)?H({},e.FORBID_TAGS,qe):Oo({}),fe=xo(e,`FORBID_ATTR`)&&lo(e.FORBID_ATTR)?H({},e.FORBID_ATTR,qe):Oo({}),Oe=xo(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Oo(e.USE_PROFILES):e.USE_PROFILES:!1,me=e.ALLOW_ARIA_ATTR!==!1,he=e.ALLOW_DATA_ATTR!==!1,ge=e.ALLOW_UNKNOWN_PROTOCOLS||!1,_e=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,N=e.SAFE_FOR_TEMPLATES||!1,P=e.SAFE_FOR_XML!==!1,ve=e.WHOLE_DOCUMENT||!1,xe=e.RETURN_DOM||!1,Se=e.RETURN_DOM_FRAGMENT||!1,F=e.RETURN_TRUSTED_TYPE||!1,be=e.FORCE_BODY||!1,Ce=e.SANITIZE_DOM!==!1,we=e.SANITIZE_NAMED_PROPS||!1,Ee=e.KEEP_CONTENT!==!1,De=e.IN_PLACE||!1,se=jo(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Ko,Re=typeof e.NAMESPACE==`string`?e.NAMESPACE:Le,He=xo(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?Oo(e.MATHML_TEXT_INTEGRATION_POINTS):H({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Ue=xo(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?Oo(e.HTML_INTEGRATION_POINTS):H({},[`annotation-xml`]);let t=xo(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?Oo(e.CUSTOM_ELEMENT_HANDLING):eo(null);if(ue=eo(null),xo(t,`tagNameCheck`)&&Xe(t.tagNameCheck)&&(ue.tagNameCheck=t.tagNameCheck),xo(t,`attributeNameCheck`)&&Xe(t.attributeNameCheck)&&(ue.attributeNameCheck=t.attributeNameCheck),xo(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(ue.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),N&&(he=!1),Se&&(xe=!0),Oe&&(j=H({},Ro),M=eo(null),Oe.html===!0&&(H(j,Mo),H(M,zo)),Oe.svg===!0&&(H(j,No),H(M,Bo),H(M,W)),Oe.svgFilters===!0&&(H(j,Po),H(M,Bo),H(M,W)),Oe.mathMl===!0&&(H(j,Io),H(M,U),H(M,W))),pe.tagCheck=null,pe.attributeCheck=null,xo(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?pe.tagCheck=e.ADD_TAGS:lo(e.ADD_TAGS)&&(j===ce&&(j=Oo(j)),H(j,e.ADD_TAGS,qe))),xo(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?pe.attributeCheck=e.ADD_ATTR:lo(e.ADD_ATTR)&&(M===le&&(M=Oo(M)),H(M,e.ADD_ATTR,qe))),xo(e,`ADD_URI_SAFE_ATTR`)&&lo(e.ADD_URI_SAFE_ATTR)&&H(Ne,e.ADD_URI_SAFE_ATTR,qe),xo(e,`FORBID_CONTENTS`)&&lo(e.FORBID_CONTENTS)&&(ke===Ae&&(ke=Oo(ke)),H(ke,e.FORBID_CONTENTS,qe)),xo(e,`ADD_FORBID_CONTENTS`)&&lo(e.ADD_FORBID_CONTENTS)&&(ke===Ae&&(ke=Oo(ke)),H(ke,e.ADD_FORBID_CONTENTS,qe)),Ee&&(j[`#text`]=!0),ve&&H(j,[`html`,`head`,`body`]),j.table&&(H(j,[`tbody`]),delete de.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw wo(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw wo(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);x=e.TRUSTED_TYPES_POLICY,S=x.createHTML(``)}else x===void 0&&(x=$o(u,i)),x!==null&&typeof S==`string`&&(S=x.createHTML(``));(O.uponSanitizeElement.length>0||O.uponSanitizeAttribute.length>0)&&j===ce&&(j=Oo(j)),O.uponSanitizeAttribute.length>0&&M===le&&(M=Oo(M)),Qa&&Qa(e),Je=e},Qe=H({},[...No,...Po,...Fo]),$e=H({},[...Io,...Lo]),et=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:Re,tagName:`template`});let n=uo(e.tagName),r=uo(t.tagName);return Be[e.namespaceURI]?e.namespaceURI===Ie?t.namespaceURI===Le?n===`svg`:t.namespaceURI===Fe?n===`svg`&&(r===`annotation-xml`||He[r]):!!Qe[n]:e.namespaceURI===Fe?t.namespaceURI===Le?n===`math`:t.namespaceURI===Ie?n===`math`&&Ue[r]:!!$e[n]:e.namespaceURI===Le?t.namespaceURI===Ie&&!Ue[r]||t.namespaceURI===Fe&&!He[r]?!1:!$e[n]&&(We[n]||!Qe[n]):!!(Ge===`application/xhtml+xml`&&Be[e.namespaceURI]):!1},I=function(e){so(t.removed,{element:e});try{g(e).removeChild(e)}catch{p(e)}},L=function(e,n){try{so(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{so(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(xe||Se)try{I(n)}catch{}else try{n.setAttribute(e,``)}catch{}},tt=function(e){let t=null,r=null;if(be)e=``+e;else{let t=po(e,/^[\r\n\t ]+/);r=t&&t[0]}Ge===`application/xhtml+xml`&&Re===Le&&(e=``+e+``);let i=x?x.createHTML(e):e;if(Re===Le)try{t=new l().parseFromString(i,Ge)}catch{}if(!t||!t.documentElement){t=w.createDocument(Re,`template`,null);try{t.documentElement.innerHTML=ze?S:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Re===Le?D.call(t,ve?`html`:`body`)[0]:ve?t.documentElement:a},nt=function(e){return T.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},rt=function(e){e.normalize();let t=T.call(e.ownerDocument||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),n=t.nextNode();for(;n;){let e=n.data;io([k,te,A],t=>{e=mo(e,t,` `)}),n.data=e,n=t.nextNode()}},it=function(e){let t=b?b(e):null;return typeof t!=`string`||qe(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==v(e)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==y(e)||e.childNodes!==h(e)},at=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===Zo.documentFragment}catch{return!1}},ot=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function st(e,n,r){io(e,e=>{e.call(t,n,r,Je)})}let ct=function(e){let n=null;if(st(O.beforeSanitizeElements,e,null),it(e))return I(e),!0;let r=qe(e.nodeName);if(st(O.uponSanitizeElement,e,{tagName:r,allowedTags:j}),P&&e.hasChildNodes()&&!ot(e.firstElementChild)&&Co(/<[/\w!]/g,e.innerHTML)&&Co(/<[/\w!]/g,e.textContent)||P&&e.namespaceURI===Le&&r===`style`&&ot(e.firstElementChild)||e.nodeType===Zo.progressingInstruction||P&&e.nodeType===Zo.comment&&Co(/<[/\w]/g,e.data))return I(e),!0;if(de[r]||!(pe.tagCheck instanceof Function&&pe.tagCheck(r))&&!j[r]){if(!de[r]&&dt(r)&&(ue.tagNameCheck instanceof RegExp&&Co(ue.tagNameCheck,r)||ue.tagNameCheck instanceof Function&&ue.tagNameCheck(r)))return!1;if(Ee&&!ke[r]){let t=g(e),n=h(e);if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=f(n[i],!0);t.insertBefore(r,m(e))}}}return I(e),!0}return(y?y(e):e.nodeType)===Zo.element&&!et(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&Co(/<\/no(script|embed|frames)/i,e.innerHTML)?(I(e),!0):(N&&e.nodeType===Zo.text&&(n=e.textContent,io([k,te,A],e=>{n=mo(n,e,` `)}),e.textContent!==n&&(so(t.removed,{element:e.cloneNode()}),e.textContent=n)),st(O.afterSanitizeElements,e,null),!1)},lt=function(e,t,r){if(fe[t]||Ce&&(t===`id`||t===`name`)&&(r in n||r in Ye))return!1;let i=M[t]||pe.attributeCheck instanceof Function&&pe.attributeCheck(t,e);if(!(he&&!fe[t]&&Co(ne,t))&&!(me&&Co(re,t))){if(!i||fe[t]){if(!(dt(e)&&(ue.tagNameCheck instanceof RegExp&&Co(ue.tagNameCheck,e)||ue.tagNameCheck instanceof Function&&ue.tagNameCheck(e))&&(ue.attributeNameCheck instanceof RegExp&&Co(ue.attributeNameCheck,t)||ue.attributeNameCheck instanceof Function&&ue.attributeNameCheck(t,e))||t===`is`&&ue.allowCustomizedBuiltInElements&&(ue.tagNameCheck instanceof RegExp&&Co(ue.tagNameCheck,r)||ue.tagNameCheck instanceof Function&&ue.tagNameCheck(r))))return!1}else if(!Ne[t]&&!Co(se,mo(r,ae,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&ho(r,`data:`)===0&&je[e])&&!(ge&&!Co(ie,mo(r,ae,``)))&&r)return!1}return!0},ut=H({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),dt=function(e){return!ut[uo(e)]&&Co(oe,e)},ft=function(e){st(O.beforeSanitizeAttributes,e,null);let n=e.attributes;if(!n||it(e))return;let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:M,forceKeepAttr:void 0},i=n.length;for(;i--;){let a=n[i],o=a.name,s=a.namespaceURI,c=a.value,l=qe(o),d=c,f=o===`value`?d:go(d);if(r.attrName=l,r.attrValue=f,r.keepAttr=!0,r.forceKeepAttr=void 0,st(O.uponSanitizeAttribute,e,r),f=r.attrValue,we&&(l===`id`||l===`name`)&&ho(f,Te)!==0&&(L(o,e),f=Te+f),P&&Co(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){L(o,e);continue}if(l===`attributename`&&po(f,`href`)){L(o,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){L(o,e);continue}if(!_e&&Co(/\/>/i,f)){L(o,e);continue}N&&io([k,te,A],e=>{f=mo(f,e,` `)});let p=qe(e.nodeName);if(!lt(p,l,f)){L(o,e);continue}if(x&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!s)switch(u.getAttributeType(p,l)){case`TrustedHTML`:f=x.createHTML(f);break;case`TrustedScriptURL`:f=x.createScriptURL(f);break}if(f!==d)try{s?e.setAttributeNS(s,o,f):e.setAttribute(o,f),it(e)?I(e):oo(t.removed)}catch{L(o,e)}}st(O.afterSanitizeAttributes,e,null)},pt=function(e){let t=null,n=nt(e);for(st(O.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(st(O.uponSanitizeShadowNode,t,null),ct(t),ft(t),at(t.content)&&pt(t.content),(y?y(t):t.nodeType)===Zo.element){let e=_?_(t):t.shadowRoot;at(e)&&(mt(e),pt(e))}st(O.afterSanitizeShadowDOM,e,null)},mt=function(e){let t=y?y(e):e.nodeType;if(t===Zo.element){let t=_?_(e):e.shadowRoot;at(t)&&(mt(t),pt(t))}let n=h?h(e):e.childNodes;if(!n)return;let r=[];io(n,e=>{so(r,e)});for(let e of r)mt(e);if(t===Zo.element){let t=b?b(e):null;if(typeof t==`string`&&qe(t)===`template`){let t=e.content;at(t)&&mt(t)}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(ze=!e,ze&&(e=``),typeof e!=`string`&&!ot(e)&&(e=ko(e),typeof e!=`string`))throw wo(`dirty is not a string, aborting`);if(!t.isSupported)return e;if(ye||Ze(n),t.removed=[],typeof e==`string`&&(De=!1),De){let t=b?b(e):e.nodeName;if(typeof t==`string`){let e=qe(t);if(!j[e]||de[e])throw wo(`root node is forbidden and cannot be sanitized in-place`)}if(it(e))throw wo(`root node is clobbered and cannot be sanitized in-place`);mt(e)}else if(ot(e))i=tt(``),a=i.ownerDocument.importNode(e,!0),a.nodeType===Zo.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),mt(a);else{if(!xe&&!N&&!ve&&e.indexOf(`<`)===-1)return x&&F?x.createHTML(e):e;if(i=tt(e),!i)return xe?null:F?S:``}i&&be&&I(i.firstChild);let c=nt(De?e:i);for(;o=c.nextNode();)ct(o),ft(o),at(o.content)&&pt(o.content);if(De)return N&&rt(e),e;if(xe){if(N&&rt(i),Se)for(s=E.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(M.shadowroot||M.shadowrootmode)&&(s=ee.call(r,s,!0)),s}let l=ve?i.outerHTML:i.innerHTML;return ve&&j[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Co(Yo,i.ownerDocument.doctype.name)&&(l=` +`+l),N&&io([k,te,A],e=>{l=mo(l,e,` `)}),x&&F?x.createHTML(l):l},t.setConfig=function(){Ze(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),ye=!0},t.clearConfig=function(){Je=null,ye=!1},t.isValidAttribute=function(e,t,n){return Je||Ze({}),lt(qe(e),qe(t),n)},t.addHook=function(e,t){typeof t==`function`&&so(O[e],t)},t.removeHook=function(e,t){if(t!==void 0){let n=ao(O[e],t);return n===-1?void 0:co(O[e],n,1)[0]}return oo(O[e])},t.removeHooks=function(e){O[e]=[]},t.removeAllHooks=function(){O=es()},t}var ns=ts(),rs=` + + + + +`,is=` + + + + +`,as=` + + + + +`;function os(e){return(0,C.useSyncExternalStore)(t=>{let n=window.matchMedia(e);return n.addEventListener(`change`,t),()=>n.removeEventListener(`change`,t)},()=>window.matchMedia(e).matches)}var ss=new Set([`image/png`,`image/jpeg`,`image/jpg`,`image/gif`,`image/webp`,`image/bmp`,`image/avif`,`image/x-icon`,`image/vnd.microsoft.icon`]);function cs(e){return!!e&&ss.has(e.trim().toLowerCase())}var ls=/^(?:(?:https?|mailto|tel|cid):|[^a-z]|[a-z+.-]+(?:[^a-z+.\-:]|$))/i,us=new Set([`text`,`link`,`vlink`,`alink`]);function ds(e){return e.trim().replace(/^<\s*/,``).replace(/\s*>$/,``).trim()}function fs(e){try{return decodeURIComponent(e)}catch{return e}}function ps(e){return e==null?``:ds(fs(ds(String(e).trim().replace(/^cid:/i,``)))).toLowerCase()}function ms(e){let t=String(e??``).trim();return/^cid:/i.test(t)?ps(t.slice(4)):``}var hs=[`src`,`poster`,`xlink:href`];function gs(e){return(/^data:([^;,]*)/i.exec(e.trim())?.[1]??``).trim().toLowerCase()}function _s(e,t=null){return e?vs(e,t,!0):``}function vs(e,t,n){let r=t;ns.addHook(`afterSanitizeAttributes`,e=>{if(!(!e||e.nodeType!==1||typeof e.getAttribute!=`function`)){if(e.nodeName===`IMG`&&r&&r.size>0){let t=e.getAttribute(`src`);if(t){let n=ms(t),i=r.get(n);i&&e.setAttribute(`src`,i)}}for(let t of hs){let n=e.getAttribute(t);if(!n)continue;let r=n.trim();/^data:/i.test(r)&&!cs(gs(r))&&e.removeAttribute(t)}}});try{return ns.sanitize(e,{ALLOWED_URI_REGEXP:ls,...n?{WHOLE_DOCUMENT:!0,FORBID_TAGS:[`base`,`link`,`meta`],ADD_ATTR:(e,t)=>t.toLowerCase()===`body`&&us.has(e.toLowerCase())}:{}})}finally{ns.removeHook(`afterSanitizeAttributes`)}}var ys=[`default-src 'none'`,`img-src data: blob: http: https: cid:`,`style-src 'unsafe-inline'`,`font-src data: http: https:`,`media-src data: blob: http: https:`,`base-uri 'none'`,`form-action 'none'`,`frame-src 'none'`].join(`; `),bs={light:{background:`#fcfcfd`,color:`#111827`},dark:{background:`#111113`,color:`#e6e8ef`}};function xs(e=`light`){return` + html { + margin: 0; + padding: 0; + background: transparent; + color: ${(Object.prototype.hasOwnProperty.call(bs,e)?bs[e]:bs.light).color}; + /* The host (.message-view__body) is the sole scroll container for + * the open message. The iframe document must never grow its own + * scrollbars: we already size the iframe element to the document's + * scroll height (post-zoom) from MessageView.vue, so any residual + * iframe-level scrollbar would be visual noise stacked beside the + * host's scrollbar, not a navigation affordance. */ + overflow: hidden; + } + body { + margin: 0; + padding: 0; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; + overflow-wrap: anywhere; + overflow: hidden; + } + img, video, canvas, svg { + max-width: 100%; + height: auto; + } + table { + max-width: 100%; + } + div, section, article, main, header, footer, aside, table, tbody, thead, tfoot, tr, td, th { + max-width: 100%; + } +`}function Ss(e,t={}){let n=t.colorScheme===`dark`?`dark`:`light`,r=e||``,i=xs(n);if(/^\s*)/i.test(r)&&typeof DOMParser==`function`){let e=new DOMParser().parseFromString(r,`text/html`),t=e.head,a=e.createElement(`meta`);a.setAttribute(`charset`,`utf-8`);let o=e.createElement(`meta`);o.setAttribute(`name`,`viewport`),o.setAttribute(`content`,`width=device-width, initial-scale=1`);let s=e.createElement(`meta`);s.setAttribute(`http-equiv`,`Content-Security-Policy`),s.setAttribute(`content`,ys);let c=e.createElement(`style`);c.textContent=i;let l=e.createDocumentFragment();return l.append(a,o,s,c),t.insertBefore(l,t.firstChild),e.documentElement.style.colorScheme=n,`\n${e.documentElement.outerHTML}`}return` + + + + + + + +${r} +`}var Cs=`allow-same-origin allow-popups allow-popups-to-escape-sandbox`,ws={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Ts=.2125,Es=.7154,Ds=.0721;function Os(e){return Number.isNaN(e)?0:Math.max(0,Math.min(255,Math.round(e)))}function ks(e){return Number.isNaN(e)?1:Math.max(0,Math.min(1,e))}function As(e){let t=e.slice(1);return/^[0-9a-f]+$/i.test(t)?t.length===3||t.length===4?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?parseInt(t[3]+t[3],16)/255:1}:t.length===6||t.length===8?{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16),a:t.length===8?parseInt(t.slice(6,8),16)/255:1}:null:null}function js(e){let t=e.trim();return t.endsWith(`%`)?Os(parseFloat(t)/100*255):Os(parseFloat(t))}function Ms(e){if(e==null)return 1;let t=e.trim();return t===``?1:t.endsWith(`%`)?ks(parseFloat(t)/100):ks(parseFloat(t))}function Ns(e){let t=e.indexOf(`(`);if(t<0||!e.endsWith(`)`))return null;let n=e.slice(t+1,-1).trim(),[r,i]=n.includes(`/`)?Ps(n,`/`):[n,void 0],a=r.includes(`,`)?r.split(`,`):r.split(/\s+/).filter(Boolean),o=i??(r.includes(`,`)&&a.length===4?a[3]:void 0),s=a.slice(0,3);return s.length<3?null:{r:js(s[0]),g:js(s[1]),b:js(s[2]),a:Ms(o)}}function Ps(e,t){let n=e.indexOf(t);return[e.slice(0,n),e.slice(n+1)]}function Fs(e,t,n){let r=n;return r<0&&(r+=1),r>1&&--r,r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function Is(e){let t=e.indexOf(`(`);if(t<0||!e.endsWith(`)`))return null;let n=e.slice(t+1,-1).trim(),[r,i]=n.includes(`/`)?Ps(n,`/`):[n,void 0],a=r.includes(`,`)?r.split(`,`):r.split(/\s+/).filter(Boolean);if(a.length<3)return null;let o=(parseFloat(a[0])%360+360)%360/360,s=Math.max(0,Math.min(1,parseFloat(a[1])/100)),c=Math.max(0,Math.min(1,parseFloat(a[2])/100)),l=i??(r.includes(`,`)?a[3]:void 0),u=Ls(o,s,c);return{r:u.r,g:u.g,b:u.b,a:Ms(l)}}function Ls(e,t,n){let r,i,a;if(t===0)r=i=a=n;else{let o=n<.5?n*(1+t):n+t-n*t,s=2*n-o;r=Fs(s,o,e+1/3),i=Fs(s,o,e),a=Fs(s,o,e-1/3)}return{r:Os(r*255),g:Os(i*255),b:Os(a*255)}}function Rs({r:e,g:t,b:n}){let r=e/255,i=t/255,a=n/255,o=Math.max(r,i,a),s=Math.min(r,i,a),c=(o+s)/2,l=o-s;if(l===0)return{h:0,s:0,l:c};let u=c>.5?l/(2-o-s):l/(o+s),d;return d=o===r?(i-a)/l+(i=n)return Bs(r);let{h:i,s:a,l:o}=Rs(r),s=o,c=.97,l=Ls(i,a,c);for(let e=0;e<24;e+=1){let e=(s+c)/2,r=Ls(i,a,e);Us(Bs(r),t)>=n?(l=r,c=e):s=e}return Bs(l)}var Js=200,Ys=3.5,Xs=bs.dark.background,Zs=32,Qs=[`:not(button)[style]`,`:not(button)[bgcolor]`,`:not(button)[color]`].join(`,`);function $s(e){return e.includes(`gradient`)}function ec(e){let t=e.getPropertyValue(`color`),n=e.getPropertyValue(`background`),r=e.getPropertyValue(`background-color`),i=e.getPropertyValue(`background-image`);if(!t&&!n&&!r&&!i)return!1;let a=!1,o=t=>{e.getPropertyValue(t)&&(e.removeProperty(t),a=!0)},s=()=>{if(!t||Hs(t)>Js)return;if(Ks(t)Hs(e)>Js||!!t&&Us(t,e)`${e.cssText}\n`).join(``)}function rc(e){if(!e.trim()||typeof CSSStyleSheet>`u`)return e;let t;try{t=new CSSStyleSheet,t.replaceSync(e)}catch{return e}return tc(t.cssRules)?nc(t):e}var ic=/prefers-color-scheme\s*:\s*dark/i,ac=/filter\s*:[^;"']*invert\s*\(/i,oc=/color-scheme\s*:[^;]*dark/i;function sc(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-color-scheme: dark)`).matches}function cc(e,t){if(ic.test(t)&&sc())return!0;for(let t of e.querySelectorAll(`meta[name]`))if((t.getAttribute(`name`)??``).toLowerCase()===`color-scheme`&&(t.getAttribute(`content`)??``).toLowerCase().includes(`dark`))return!0;let n=e.nodeType===9?e:null,r=n?[n.documentElement,n.body,...Array.from(n.body.children)]:Array.from(e.children);for(let e of r){if(!e)continue;let t=e.getAttribute(`style`)??``;if(oc.test(t)||ac.test(t))return!0}return!1}function lc(e,t,n=null){if(cc(e,t))return!1;if(n)for(let e of[`background`,`bgcolor`,`text`,`link`,`vlink`,`alink`])n.removeAttribute(e);for(let t of e.querySelectorAll(Qs))t.removeAttribute(`bgcolor`),t.removeAttribute(`color`),t.hasAttribute(`style`)&&ec(t.style);for(let t of e.querySelectorAll(`text[fill]`)){let e=t.getAttribute(`fill`);Gs(e)&&Hs(e)<=Js&&t.setAttribute(`fill`,`currentColor`)}for(let t of e.querySelectorAll(`style`)){let e=t.textContent??``,n=rc(e);n!==e&&(t.textContent=n)}return!0}function uc(e){if(!e||typeof document>`u`)return e;try{if(/^\s*)/i.test(e)&&typeof DOMParser==`function`){let t=new DOMParser().parseFromString(e,`text/html`);return lc(t,e,t.body)?t.documentElement.outerHTML:e}let t=document.createElement(`template`);t.innerHTML=e;let n=t.content;return lc(n,e)?t.innerHTML:e}catch{return e}}var dc=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`,fc=`ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2`,pc=`numeric`,mc=`ascii`,hc=`alpha`,gc=`asciinumeric`,_c=`alphanumeric`,vc=`domain`,yc=`emoji`,bc=`scheme`,xc=`slashscheme`,Sc=`whitespace`;function Cc(e,t){return e in t||(t[e]=[]),t[e]}function wc(e,t,n){t[pc]&&(t[gc]=!0,t[_c]=!0),t[mc]&&(t[gc]=!0,t[hc]=!0),t[gc]&&(t[_c]=!0),t[hc]&&(t[_c]=!0),t[_c]&&(t[vc]=!0),t[yc]&&(t[vc]=!0);for(let r in t){let t=Cc(r,n);t.indexOf(e)<0&&t.push(e)}}function Tc(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function Ec(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}Ec.groups={},Ec.prototype={accepts(){return!!this.t},go(e){let t=this,n=t.j[e];if(n)return n;for(let n=0;ne.ta(t,n,r,i),Dc=(e,t,n,r,i)=>e.tr(t,n,r,i),Oc=(e,t,n,r,i)=>e.ts(t,n,r,i),K=(e,t,n,r,i)=>e.tt(t,n,r,i),kc=`WORD`,Ac=`UWORD`,jc=`ASCIINUMERICAL`,Mc=`ALPHANUMERICAL`,Nc=`LOCALHOST`,Pc=`TLD`,Fc=`UTLD`,Ic=`SCHEME`,Lc=`SLASH_SCHEME`,Rc=`NUM`,zc=`WS`,Bc=`NL`,Vc=`OPENBRACE`,Hc=`CLOSEBRACE`,Uc=`OPENBRACKET`,Wc=`CLOSEBRACKET`,Gc=`OPENPAREN`,Kc=`CLOSEPAREN`,qc=`OPENANGLEBRACKET`,Jc=`CLOSEANGLEBRACKET`,Yc=`FULLWIDTHLEFTPAREN`,Xc=`FULLWIDTHRIGHTPAREN`,Zc=`LEFTCORNERBRACKET`,Qc=`RIGHTCORNERBRACKET`,$c=`LEFTWHITECORNERBRACKET`,el=`RIGHTWHITECORNERBRACKET`,tl=`FULLWIDTHLESSTHAN`,nl=`FULLWIDTHGREATERTHAN`,rl=`AMPERSAND`,il=`APOSTROPHE`,al=`ASTERISK`,ol=`AT`,sl=`BACKSLASH`,cl=`BACKTICK`,ll=`CARET`,ul=`COLON`,dl=`COMMA`,fl=`DOLLAR`,pl=`DOT`,ml=`EQUALS`,hl=`EXCLAMATION`,gl=`HYPHEN`,_l=`PERCENT`,vl=`PIPE`,yl=`PLUS`,bl=`POUND`,xl=`QUERY`,Sl=`QUOTE`,Cl=`FULLWIDTHMIDDLEDOT`,wl=`SEMI`,Tl=`SLASH`,El=`TILDE`,Dl=`UNDERSCORE`,Ol=`EMOJI`,kl=`SYM`,Al=Object.freeze({__proto__:null,ALPHANUMERICAL:Mc,AMPERSAND:rl,APOSTROPHE:il,ASCIINUMERICAL:jc,ASTERISK:al,AT:ol,BACKSLASH:sl,BACKTICK:cl,CARET:ll,CLOSEANGLEBRACKET:Jc,CLOSEBRACE:Hc,CLOSEBRACKET:Wc,CLOSEPAREN:Kc,COLON:ul,COMMA:dl,DOLLAR:fl,DOT:pl,EMOJI:Ol,EQUALS:ml,EXCLAMATION:hl,FULLWIDTHGREATERTHAN:nl,FULLWIDTHLEFTPAREN:Yc,FULLWIDTHLESSTHAN:tl,FULLWIDTHMIDDLEDOT:Cl,FULLWIDTHRIGHTPAREN:Xc,HYPHEN:gl,LEFTCORNERBRACKET:Zc,LEFTWHITECORNERBRACKET:$c,LOCALHOST:Nc,NL:Bc,NUM:Rc,OPENANGLEBRACKET:qc,OPENBRACE:Vc,OPENBRACKET:Uc,OPENPAREN:Gc,PERCENT:_l,PIPE:vl,PLUS:yl,POUND:bl,QUERY:xl,QUOTE:Sl,RIGHTCORNERBRACKET:Qc,RIGHTWHITECORNERBRACKET:el,SCHEME:Ic,SEMI:wl,SLASH:Tl,SLASH_SCHEME:Lc,SYM:kl,TILDE:El,TLD:Pc,UNDERSCORE:Dl,UTLD:Fc,UWORD:Ac,WORD:kc,WS:zc}),jl=/[a-z]/,Ml=/\p{L}/u,Nl=/\p{Emoji}/u,Pl=/\d/,Fl=/\s/,Il=`\r`,Ll=` +`,Rl=`️`,zl=`‍`,Bl=``,Vl=null,Hl=null;function Ul(e=[]){let t={};Ec.groups=t;let n=new Ec;Vl??=ql(dc),Hl??=ql(fc),K(n,`'`,il),K(n,`{`,Vc),K(n,`}`,Hc),K(n,`[`,Uc),K(n,`]`,Wc),K(n,`(`,Gc),K(n,`)`,Kc),K(n,`<`,qc),K(n,`>`,Jc),K(n,`(`,Yc),K(n,`)`,Xc),K(n,`「`,Zc),K(n,`」`,Qc),K(n,`『`,$c),K(n,`』`,el),K(n,`<`,tl),K(n,`>`,nl),K(n,`&`,rl),K(n,`*`,al),K(n,`@`,ol),K(n,"`",cl),K(n,`^`,ll),K(n,`:`,ul),K(n,`,`,dl),K(n,`$`,fl),K(n,`.`,pl),K(n,`=`,ml),K(n,`!`,hl),K(n,`-`,gl),K(n,`%`,_l),K(n,`|`,vl),K(n,`+`,yl),K(n,`#`,bl),K(n,`?`,xl),K(n,`"`,Sl),K(n,`/`,Tl),K(n,`;`,wl),K(n,`~`,El),K(n,`_`,Dl),K(n,`\\`,sl),K(n,`・`,Cl);let r=Dc(n,Pl,Rc,{[pc]:!0});Dc(r,Pl,r);let i=Dc(r,jl,jc,{[gc]:!0}),a=Dc(r,Ml,Mc,{[_c]:!0}),o=Dc(n,jl,kc,{[mc]:!0});Dc(o,Pl,i),Dc(o,jl,o),Dc(i,Pl,i),Dc(i,jl,i);let s=Dc(n,Ml,Ac,{[hc]:!0});Dc(s,jl),Dc(s,Pl,a),Dc(s,Ml,s),Dc(a,Pl,a),Dc(a,jl),Dc(a,Ml,a);let c=K(n,Ll,Bc,{[Sc]:!0}),l=K(n,Il,zc,{[Sc]:!0}),u=Dc(n,Fl,zc,{[Sc]:!0});K(n,Bl,u),K(l,Ll,c),K(l,Bl,u),Dc(l,Fl,u),K(u,Il),K(u,Ll),Dc(u,Fl,u),K(u,Bl,u);let d=Dc(n,Nl,Ol,{[yc]:!0});K(d,`#`),Dc(d,Nl,d),K(d,Rl,d);let f=K(d,zl);K(f,`#`),Dc(f,Nl,d);let p=[[jl,o],[Pl,i]],m=[[jl,null],[Ml,s],[Pl,a]];for(let e=0;ee[0]>t[0]?1:-1);for(let t=0;t=0?i[vc]=!0:jl.test(r)?Pl.test(r)?i[gc]=!0:i[mc]=!0:i[pc]=!0,Oc(n,r,r,i)}return Oc(n,`localhost`,Nc,{ascii:!0}),n.jd=new Ec(kl),{start:n,tokens:Object.assign({groups:t},Al)}}function Wl(e,t){let n=Gl(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],a=0,o=0;for(;o=0&&(d+=n[o].length,f++),l+=n[o].length,a+=n[o].length,o++;a-=d,o-=f,l-=d,i.push({t:u.t,v:t.slice(a-l,a),s:a-l,e:a})}return i}function Gl(e){let t=[],n=e.length,r=0;for(;r56319||r+1===n||(a=e.charCodeAt(r+1))<56320||a>57343?e[r]:e.slice(r,r+2);t.push(o),r+=o.length}return t}function Kl(e,t,n,r,i){let a,o=t.length;for(let n=0;n=0;)i++;if(i>0){t.push(n.join(``));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}var Jl={defaultProtocol:`http`,events:null,format:Xl,formatHref:Xl,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Yl(e,t=null){let n=Object.assign({},Jl);e&&(n=Object.assign(n,e instanceof Yl?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;en?r.substring(0,n)+`…`:r},toFormattedHref(e){return e.get(`formatHref`,this.toHref(e.get(`defaultProtocol`)),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=Jl.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get(`validate`,this.toString(),this)},render(e){let t=this,n=this.toHref(e.get(`defaultProtocol`)),r=e.get(`formatHref`,n,this),i=e.get(`tagName`,n,t),a=this.toFormattedString(e),o={},s=e.get(`className`,n,t),c=e.get(`target`,n,t),l=e.get(`rel`,n,t),u=e.getObj(`attributes`,n,t),d=e.getObj(`events`,n,t);return o.href=r,s&&(o.class=s),c&&(o.target=c),l&&(o.rel=l),u&&Object.assign(o,u),{tagName:i,attributes:o,content:a,eventListeners:d}}};function Ql(e,t){class n extends Zl{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}var $l=Ql(`email`,{isLink:!0,toHref(){return`mailto:`+this.toString()}}),eu=Ql(`text`),tu=Ql(`nl`),nu=Ql(`url`,{isLink:!0,toHref(e=Jl.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==Nc&&e[1].t===ul}}),q=e=>new Ec(e);function ru({groups:e}){let t=e.domain.concat([rl,al,ol,sl,cl,ll,fl,ml,gl,Rc,_l,vl,yl,bl,Tl,kl,El,Dl]),n=[il,ul,dl,pl,hl,_l,xl,Sl,wl,qc,Jc,Vc,Hc,Wc,Uc,Gc,Kc,Yc,Xc,Zc,Qc,$c,el,tl,nl],r=[rl,il,al,sl,cl,ll,fl,ml,gl,Vc,Hc,_l,vl,yl,bl,xl,Tl,kl,El,Dl],i=q(),a=K(i,El);G(a,r,a),G(a,e.domain,a);let o=q(),s=q(),c=q();G(i,e.domain,o),G(i,e.scheme,s),G(i,e.slashscheme,c),G(o,r,a),G(o,e.domain,o);let l=K(o,ol);K(a,ol,l),K(s,ol,l),K(c,ol,l);let u=K(a,pl);G(u,r,a),G(u,e.domain,a);let d=q();G(l,e.domain,d),G(d,e.domain,d);let f=K(d,pl);G(f,e.domain,d);let p=q($l);G(f,e.tld,p),G(f,e.utld,p),K(l,Nc,p);let m=K(d,gl);K(m,gl,m),G(m,e.domain,d),G(p,e.domain,d),K(p,pl,f),K(p,gl,m);let h=K(o,gl),g=K(o,pl);K(h,gl,h),G(h,e.domain,o),G(g,r,a),G(g,e.domain,o);let _=q(nu);G(g,e.tld,_),G(g,e.utld,_),G(_,e.domain,o),G(_,r,a),K(_,pl,g),K(_,gl,h),K(_,ol,l);let v=K(_,ul),y=q(nu);G(v,e.numeric,y);let b=q(nu),x=q();G(b,t,b),G(b,n,x),G(x,t,b),G(x,n,x),K(_,Tl,b),K(y,Tl,b);let S=K(s,ul),C=K(K(K(c,ul),Tl),Tl);G(s,e.domain,o),K(s,pl,g),K(s,gl,h),G(c,e.domain,o),K(c,pl,g),K(c,gl,h),G(S,e.domain,b),K(S,Tl,b),K(S,xl,b),G(C,e.domain,b),G(C,t,b),K(C,Tl,b);let w=[[Vc,Hc],[Uc,Wc],[Gc,Kc],[qc,Jc],[Yc,Xc],[Zc,Qc],[$c,el],[tl,nl]];for(let e=0;e=0&&f++,i++,u++;if(f<0)i-=u,i0&&(a.push(au(eu,t,o)),o=[]),i-=f,u-=f;let e=d.t,r=n.slice(i-u,i);a.push(au(e,t,r))}}return o.length>0&&a.push(au(eu,t,o)),a}function au(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}var J={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function ou(){J.scanner=Ul(J.customSchemes);for(let e=0;e/g,`>`)}function lu(e){return e.replace(/"/g,`"`)}function uu(e){let t=[];for(let n in e){let r=e[n]+``;t.push(`${n}="${lu(r)}"`)}return t.join(` `)}function du({tagName:e,attributes:t,content:n}){return`<${e} ${uu(t)}>${cu(n)}`}function fu(e,t={}){t=new Yl(t,du);let n=su(e),r=[];for(let e=0;e +`):!i.isLink||!t.check(i)?r.push(cu(i.toString())):r.push(t.render(i))}return r.join(``)}String.prototype.linkify||Object.defineProperty(String.prototype,"linkify",{writable:!1,value:function(e){return fu(this,e)}});var pu={defaultProtocol:`https`,target:`_blank`,rel:`noopener noreferrer`,nl2br:!1},mu=/^[ \t]*>[ \t]?/;function hu(e){let t=0,n=e,r=mu.exec(n);for(;r!==null;)t+=1,n=n.slice(r[0].length),r=mu.exec(n);return{depth:t,content:n}}function gu(e){return`pt-quote pt-quote--l${(e-1)%5+1}`}function _u(e,t,n){let r=``,i=[],a=t,o=()=>{i.length&&(r+=i.join(` +`),i=[])};for(;a${t}`,a=i}}return o(),[r,a]}function vu(e){return e?_u(String(e).replace(/\r\n?/g,` +`).split(` +`).map(hu),0,0)[0]:``}var yu=400,bu=120;function xu(e){if(!e)return``;let t=new Date(Number(e));return Number.isNaN(t.valueOf())?``:t.toLocaleString(ft,{timeZone:`UTC`})}function Su(e){let t=e-dt,n=new Intl.RelativeTimeFormat(ft,{numeric:`auto`}),r=Math.round(t/6e4);if(Math.abs(r)<60)return n.format(r,`minute`);let i=Math.round(t/36e5);return Math.abs(i)<48?n.format(i,`hour`):n.format(Math.round(t/864e5),`day`)}function Cu(){let[e,t]=(0,C.useState)(0),n=(0,C.useRef)(null);return[(0,C.useCallback)(e=>{if(n.current?.disconnect(),n.current=null,!e){t(0);return}let r=new ResizeObserver(([n])=>{let r=n.borderBoxSize?.[0];t(r?r.blockSize:e.offsetHeight)});r.observe(e),n.current=r},[]),e]}function wu({attachments:e,contextKey:t}){let[n,r]=(0,C.useState)(!0),[i,a]=(0,C.useState)(!1),o=(0,C.useRef)(null),s=(0,C.useRef)(null),c=(0,C.useRef)(null),[l,u]=(0,C.useState)({heading:0,firstRow:0});return(0,C.useLayoutEffect)(()=>{r(!0),s.current&&(s.current.scrollTop=0)},[t]),(0,C.useLayoutEffect)(()=>{let t=o.current,n=s.current;if(!t||!n)return;let i=c.current?.offsetHeight??0,l=n.firstElementChild?.offsetHeight??0;u(e=>e.heading===i&&e.firstRow===l?e:{heading:i,firstRow:l});let d=t.clientHeight-i,f=e.length>1&&n.scrollHeight>d+1;a(f),f||r(!0)},[e,t]),e.length===0?null:(0,B.jsxs)(`section`,{ref:o,className:`message-attachment-bar${n?``:` message-attachment-bar--collapsed`}`,style:{"--attachment-heading-height":`${l.heading}px`,"--attachment-first-row-height":`${l.firstRow}px`},"aria-label":`Attachments`,tabIndex:-1,children:[(0,B.jsxs)(`div`,{ref:c,className:`message-attachment-bar__heading`,children:[(0,B.jsxs)(`h3`,{children:[`Attachments `,(0,B.jsxs)(`span`,{"aria-hidden":`true`,children:[`(`,e.length,`)`]})]}),(0,B.jsxs)(`button`,{className:`message-attachment-bar__toggle`,style:i?void 0:{display:`none`},type:`button`,"aria-expanded":n,"aria-label":`${n?`Collapse`:`Expand`} attachment list`,onClick:()=>r(e=>!e),children:[n?(0,B.jsx)(ne,{size:14,strokeWidth:1.75,"aria-hidden":`true`}):(0,B.jsx)(A,{size:14,strokeWidth:1.75,"aria-hidden":`true`}),n?`Collapse`:`Expand`]})]}),(0,B.jsx)(`ul`,{ref:s,className:`message-attachment-bar__list`,children:e.map((e,t)=>{let r=!n&&t>0;return(0,B.jsxs)(`li`,{className:`message-attachment-row${r?` message-attachment-row--collapsed`:``}`,inert:r,"aria-hidden":r||void 0,children:[(0,B.jsx)(ve,{size:15,strokeWidth:1.75,className:`message-attachment-row__icon`,"aria-hidden":`true`}),(0,B.jsxs)(`div`,{className:`message-attachment-row__description`,children:[(0,B.jsx)(`span`,{className:`message-attachment-row__name`,title:e.name,children:e.name}),(0,B.jsx)(`span`,{className:`message-attachment-row__metadata`,children:`${e.mime_type} · ${Zr(e.size)}`})]}),(0,B.jsx)(`div`,{className:`message-attachment-row__actions`,children:(0,B.jsx)(Vr,{title:`Download ${e.name}`,"aria-label":`Download ${e.name}`,children:(0,B.jsx)(oe,{size:16,strokeWidth:1.75})})})]},`${e.name}-${t}`)})})]})}function Tu({maximized:e,onToggleMaximized:t}){let n=z(e=>e.open),r=z(e=>e.open.id==null?null:e.messages.get(e.open.id)??null),i=z(e=>e.folders),a=Cr(e=>e.theme),o=os(`(max-width: 639px)`),s=(0,C.useRef)(null),[c,l]=Cu(),[u,d]=Cu(),[f,p]=Cu(),m=(0,C.useRef)(null),h=(0,C.useRef)(null),g=(0,C.useRef)(null),_=(0,C.useRef)(null),v=(0,C.useRef)(null),[y,b]=(0,C.useState)(bu),[x,S]=(0,C.useState)(!1),[w,T]=(0,C.useState)(!1),[E,D]=(0,C.useState)(null),O=(0,C.useRef)(null),k=(0,C.useId)(),te=(0,C.useRef)(null);(0,C.useEffect)(()=>{S(!1),T(!1),D(null),te.current&&(te.current.scrollTop=0)},[r?.id??null]),(0,C.useEffect)(()=>{if(!r||r.is_draft!==1)return;br.getState().openDraft(r);let e=z.getState();e.selectMessage(null),e.clearSelection()},[r]);let ne=r?An(r):null,re=a,ie=re===`dark`&&x?`light`:re,oe=bs[ie].background,se=(0,C.useMemo)(()=>!ne?.text||ne.html?``:ns.sanitize(vu(ne.text),{ALLOWED_URI_REGEXP:ls,ADD_ATTR:[`target`]}),[ne]),j=(0,C.useMemo)(()=>{if(!ne?.html)return``;let e=_s(ne.html,null);return Ss(ie===`dark`?uc(e):e,{colorScheme:ie})},[ne,ie]),ce=(0,C.useCallback)(()=>{_.current=null,v.current?.(),v.current=null},[]);(0,C.useLayoutEffect)(()=>{ce(),b(bu)},[j,ce]),(0,C.useEffect)(()=>ce,[ce]);let M=(0,C.useCallback)(()=>{ce();let e=g.current,t=e?.contentDocument;if(!e||!t?.body)return;t.querySelectorAll(`a[href]`).forEach(e=>{e.setAttribute(`target`,`_blank`),e.setAttribute(`rel`,`noopener noreferrer`)});let n=!0,r=!1,i=t.documentElement,a=t.body,o=()=>{if(!n)return;let e=h.current?.clientWidth??0;if(e<=0)return;i.style.zoom=``;let r=Math.max(i.scrollWidth,a.scrollWidth,1),o=t.defaultView,s=o?.getComputedStyle(a),c=o?.getComputedStyle(i),l=[s?.marginBottom,c?.paddingBottom,c?.borderBottomWidth,c?.marginBottom].reduce((e,t)=>e+Math.max(0,Number.parseFloat(t??``)||0),0),u=Math.max(0,a.getBoundingClientRect().top+(o?.scrollY??0)),d=Math.max(u+Math.max(a.offsetHeight,a.scrollHeight)+l,bu),f=Math.max(r,yu),p=f>e?e/f:1;i.style.zoom=p===1?``:String(p),b(Math.max(bu,Math.ceil(d*p)))};_.current=o;let s=()=>{r||(r=!0,requestAnimationFrame(()=>{r=!1,o()}))};o();let c=[],l=requestAnimationFrame(o);c.push(()=>cancelAnimationFrame(l));for(let e of[150,600]){let t=window.setTimeout(o,e);c.push(()=>clearTimeout(t))}t.fonts?.ready.then(o).catch(()=>{});let u=null;h.current&&(u=new ResizeObserver(s),u.observe(h.current)),v.current=()=>{n=!1,u?.disconnect();for(let e of c)e()}},[ce]),le=z.getState,ue=br.getState,de=an({folders:i},typeof n.viewId==`number`?n.viewId:r?.folder_id??null),fe=de?.role===`junk`,pe=de?.role===`archive`,me=r?.scheduled_undo_status===`pending`,he=(0,C.useMemo)(()=>r?Vt(r.keywords_json,Ft):[],[r]),ge=he.length===0?`Tag`:`Tags: ${he.map(e=>e.name).join(`, `)}`,_e=(0,C.useMemo)(()=>r?[r]:[],[r]);function N(n){!e||n.key!==`Escape`||n.defaultPrevented||E||s.current?.querySelector(`[role="dialog"], details[open]`)||(n.preventDefault(),t())}let ve=(0,C.useCallback)(e=>{s.current=e,c(e)},[c]),ye={"--message-view-height":l>0?`${l}px`:void 0,"--message-toolbar-height":`${d}px`,"--message-banner-height":`${p}px`,"--message-attachment-bar-height":`0px`};if(!r)return(0,B.jsx)(`section`,{ref:ve,className:`message-view`,style:ye,"aria-label":`Message detail`,tabIndex:-1,children:(0,B.jsx)(`div`,{className:`message-view__empty`,children:(0,B.jsx)(`p`,{children:`Select a message to read it.`})})});let be=!o||w,xe=be?r.from_text||`(no sender)`:pn(r.from_text),Se=tr(r.cc),F=[r.id],Ce=w?`Hide message details`:`Show message details`;return(0,B.jsx)(`section`,{ref:ve,className:`message-view`,style:ye,"aria-label":`Message detail`,tabIndex:-1,onKeyDown:N,children:(0,B.jsxs)(`article`,{className:`message-view__article`,children:[(0,B.jsxs)(`header`,{ref:u,className:`message-view__header`,children:[(0,B.jsx)(Vr,{className:`message-view__action message-view__action--back`,title:`Back`,"aria-label":`Back`,onClick:()=>{le().selectMessage(null),le().clearSelection()},children:(0,B.jsx)(ee,{className:`message-view__toolbar-icon`,size:18,strokeWidth:1.65})}),fe?(0,B.jsx)(`button`,{className:`message-view__action message-view__action--whitelist`,type:`button`,title:`Whitelist sender and move to Inbox`,"aria-label":`Not junk — whitelist sender and move to Inbox`,onClick:()=>le().notJunk(F),children:(0,B.jsx)(`span`,{className:`message-view__whitelist-label`,children:`Not junk`})}):null,me?null:(0,B.jsxs)(B.Fragment,{children:[pe?null:(0,B.jsx)(Vr,{className:`message-view__action`,title:`Archive (A)`,"aria-label":`Archive`,onClick:()=>le().archiveMessages(F),children:(0,B.jsx)(zr,{className:`message-view__toolbar-icon message-view__toolbar-icon--folder`,svg:oi})}),fe?null:(0,B.jsx)(Vr,{className:`message-view__action`,title:`Junk`,"aria-label":`Mark as junk`,onClick:()=>le().junkMessages(F),children:(0,B.jsx)(zr,{className:`message-view__toolbar-icon message-view__toolbar-icon--folder`,svg:pi})}),(0,B.jsx)(Vr,{className:`message-view__action`,danger:!0,title:`Delete (Delete)`,"aria-label":`Delete`,onClick:()=>le().destroyMessages(F),children:(0,B.jsx)(Ie,{className:`message-view__toolbar-icon`,size:18,strokeWidth:1.65})}),(0,B.jsx)(Vr,{className:`message-view__action`,title:`Reply (R)`,"aria-label":`Reply`,onClick:()=>ue().prepareReply(r,!1),children:(0,B.jsx)(zr,{className:`message-view__toolbar-icon message-view__toolbar-icon--shape`,svg:is})}),(0,B.jsx)(Vr,{className:`message-view__action`,title:`Reply All (Shift+R)`,"aria-label":`Reply All`,onClick:()=>ue().prepareReply(r,!0),children:(0,B.jsx)(zr,{className:`message-view__toolbar-icon message-view__toolbar-icon--shape`,svg:as})}),(0,B.jsx)(Vr,{className:`message-view__action`,title:`Forward (F)`,"aria-label":`Forward`,onClick:()=>ue().prepareForward(r),children:(0,B.jsx)(zr,{className:`message-view__toolbar-icon message-view__toolbar-icon--shape`,svg:rs})}),(0,B.jsx)(Vr,{ref:O,className:`message-view__action message-view__action--tags`,title:`${ge} (T)`,"aria-label":ge,"aria-haspopup":`dialog`,"aria-expanded":E!==null,"data-tag-picker-trigger":!0,onClick:()=>{if(E){D(null);return}let e=O.current?.getBoundingClientRect();e&&D({top:e.top,left:e.left,width:e.width,height:e.height})},children:(0,B.jsx)(la,{tags:he})})]}),(0,B.jsx)(_a,{anchor:E,targets:_e,definitions:Ft,trigger:O.current,label:`Tags`,onClose:()=>D(null),onToggle:(e,t)=>le().setTagsMany(F,t?{add:[e]}:{remove:[e]}),onClear:()=>le().clearTagsMany(F),onManage:()=>D(null)}),(0,B.jsxs)(`div`,{className:`message-view__view-actions`,children:[re===`dark`&&j?(0,B.jsx)(Vr,{className:`message-view__action message-view__action--view-mode`,"aria-pressed":x,title:x?`View this message in dark mode`:`View this message in light mode`,"aria-label":x?`View this message in dark mode`:`View this message in light mode`,onClick:()=>S(e=>!e),children:x?(0,B.jsx)(P,{size:16,strokeWidth:1.75}):(0,B.jsx)(Ae,{size:16,strokeWidth:1.75})}):null,(0,B.jsx)(Ur,{className:`message-view__action message-view__action--maximize`,maximized:e,surface:`message view`,onToggle:t})]})]}),me?(0,B.jsxs)(`div`,{ref:f,className:`message-view__scheduled`,role:`status`,children:[(0,B.jsx)(ae,{size:16,strokeWidth:1.75,"aria-hidden":`true`}),(0,B.jsx)(`span`,{className:`message-view__scheduled-text`,children:`Scheduled to send ${xu(r.sent_at)} (${Su(r.sent_at)}).`}),(0,B.jsx)(`button`,{className:`message-view__scheduled-cancel`,type:`button`,onClick:()=>le().cancelScheduledSend(r.id),children:`Cancel send`})]}):null,(0,B.jsxs)(`section`,{className:`message-view__details${w?` message-view__details--expanded`:``}`,"aria-label":`Message header`,children:[(0,B.jsx)(Vr,{className:`message-view__details-toggle`,style:o?void 0:{display:`none`},"aria-expanded":w,"aria-controls":k,"aria-label":Ce,title:Ce,onClick:()=>{T(e=>!e),te.current&&(te.current.scrollTop=0)},children:(0,B.jsx)(A,{size:18,strokeWidth:1.75,"aria-hidden":`true`})}),(0,B.jsxs)(`dl`,{id:k,ref:te,className:`message-view__metadata`,tabIndex:o?0:void 0,"aria-label":o?`Message details`:void 0,children:[(0,B.jsxs)(`div`,{className:`message-view__metadata-row`,children:[(0,B.jsx)(`dt`,{children:`From`}),(0,B.jsx)(`dd`,{children:xe})]}),r.to_text?(0,B.jsxs)(`div`,{className:`message-view__metadata-row`,style:be?void 0:{display:`none`},children:[(0,B.jsx)(`dt`,{children:`To`}),(0,B.jsx)(`dd`,{children:r.to_text})]}):null,Se?(0,B.jsxs)(`div`,{className:`message-view__metadata-row`,style:be?void 0:{display:`none`},children:[(0,B.jsx)(`dt`,{children:`Cc`}),(0,B.jsx)(`dd`,{children:Se})]}):null,(0,B.jsxs)(`div`,{className:`message-view__metadata-row message-view__title`,children:[(0,B.jsx)(`dt`,{children:`Subject`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`h2`,{children:r.subject||`(no subject)`})})]}),(0,B.jsxs)(`div`,{className:`message-view__metadata-row`,style:be?void 0:{display:`none`},children:[(0,B.jsx)(`dt`,{children:me?`Send at`:`Date`}),(0,B.jsx)(`dd`,{className:`message-view__date`,children:xu(me?r.sent_at:r.received_at)})]}),he.length>0?(0,B.jsxs)(`div`,{className:`message-view__metadata-row message-view__tags-row`,style:be?void 0:{display:`none`},children:[(0,B.jsx)(`dt`,{children:`Tags`}),(0,B.jsx)(`dd`,{className:`message-view__tags`,"data-message-tags":!0,children:he.map(e=>(0,B.jsx)(ua,{tag:e,removable:!me,onRemove:()=>le().setTagsMany(F,{remove:[e.keyword]})},e.keyword))})]}):null]})]}),(0,B.jsx)(`div`,{ref:m,className:`message-view__body`,tabIndex:0,"aria-label":`Message body`,children:j?(0,B.jsx)(`div`,{ref:h,className:`message-view__html-shell`,children:(0,B.jsx)(`iframe`,{ref:g,className:`message-view__html-frame`,srcDoc:j,sandbox:Cs,style:{height:`${y}px`,backgroundColor:oe},title:`Message body`,onLoad:M})}):se?(0,B.jsx)(`div`,{className:`message-view__text`,dangerouslySetInnerHTML:{__html:se}}):(0,B.jsx)(`p`,{className:`message-view__placeholder`,children:`This message has no content.`})}),(0,B.jsx)(wu,{attachments:ne?.attachments??[],contextKey:r.id})]})})}function Eu(e){return{name:e.name,email:e.email,organization:e.organization??null,source:`contact`,last_sent_at:e.last_sent_at,send_count:e.send_count}}function Du(e,t){if(e.email.toLowerCase().startsWith(t))return!0;for(let n of e.name.toLowerCase().split(/\s+/))if(n.startsWith(t))return!0;return!!e.organization?.toLowerCase().split(/\s+/).some(e=>e.startsWith(t))}async function Ou(e,t,n){let r=e.trim().toLowerCase(),i=new Set(n.map(e=>jn(e))),{contacts:a}=z.getState();return a.filter(e=>!i.has(jn(e.email))&&Du(e,r)).sort((e,t)=>t.send_count-e.send_count||t.last_sent_at-e.last_sent_at||e.name.localeCompare(t.name)).slice(0,t).map(Eu)}async function ku(){let{contacts:e}=z.getState();return[...e].sort((e,t)=>e.name.localeCompare(t.name)).map(Eu)}var Au=10,ju=120;function Mu(e){return`invalid`in e?e.text:er(e)}function Nu(e){return`invalid`in e?e.text:e.name?.trim()||e.email}function Pu(e){if(`invalid`in e)return`${e.text} — not a valid address`;let t=e.name?.trim();return t?`${t} <${e.email}>`:e.email}function Fu(e){let t=[],n=Number(e.last_sent_at);if(Number.isFinite(n)&&n>0){let e=Math.floor((dt-n)/864e5);e<1?t.push(`today`):e<7?t.push(`${e}d ago`):e<30?t.push(`${Math.floor(e/7)}w ago`):e<365?t.push(`${Math.floor(e/30)}mo ago`):t.push(`${Math.floor(e/365)}y ago`)}let r=Number(e.send_count);return Number.isFinite(r)&&r>1&&t.push(`${r} sends`),t.length>0?t.join(` · `):null}function Iu({text:e,typed:t}){let n=t.trim().toLowerCase(),r=n?e.toLowerCase().indexOf(n):-1;return r<0?(0,B.jsx)(B.Fragment,{children:e}):(0,B.jsxs)(B.Fragment,{children:[e.slice(0,r),(0,B.jsx)(`span`,{className:`ac-match`,children:e.slice(r,r+n.length)}),e.slice(r+n.length)]})}function Lu({label:e,inputId:t,entries:n,taken:r,query:i,browseAll:a,onEntriesChange:o}){let[s,c]=(0,C.useState)(``),[l,u]=(0,C.useState)([]),[d,f]=(0,C.useState)(-1),[p,m]=(0,C.useState)(!1),[h,g]=(0,C.useState)(!1),[_,v]=(0,C.useState)(null),[y,b]=(0,C.useState)(null),x=(0,C.useRef)(null),S=(0,C.useRef)(null),w=(0,C.useRef)(null),T=(0,C.useRef)(0),E=(0,C.useRef)(s);E.current=s;let D=(0,C.useRef)(n);D.current=n;let ee=(0,C.useRef)(null),O=(0,C.useMemo)(()=>new Set([...n.filter(e=>!(`invalid`in e)).map(e=>jn(e.email)),...r.map(e=>jn(e))]),[n,r]),k=(0,C.useRef)(O);k.current=O;let te=p&&l.length>0,A=te||_!==null,ne=`${t}-listbox`,re=e=>`${t}-option-${e}`,ie=h?l.length===1?`1 contact`:`${l.length} contacts`:l.length===1?`1 suggestion`:`${l.length} suggestions`,ae=te?h?`Showing ${l.length} contacts`:l.length===1?`1 suggestion available`:`${l.length} suggestions available`:y??``;(0,C.useEffect)(()=>()=>{w.current&&clearTimeout(w.current)},[]),(0,C.useEffect)(()=>{if(ee.current==null)return;let e=ee.current;ee.current=null;let t=S.current?.querySelectorAll(`.pill__remove`),n=t?.[Math.min(e,(t?.length??0)-1)];n?n.focus():x.current?.focus()},[n]);let oe=(0,C.useCallback)(()=>{w.current&&clearTimeout(w.current),w.current=null,T.current+=1,m(!1),f(-1),u([]),g(!1),b(null),v(null)},[]),se=e=>e.filter(e=>!k.current.has(jn(e.email))),j=(0,C.useCallback)(async e=>{let t=T.current+=1,n=[],r=!0;try{n=await i(e,Au,[...k.current])}catch{r=!1}if(t!==T.current)return;let a=se(n).slice(0,Au);u(a),f(a.length>0?0:-1),g(!1),v(a.length===0&&r?e:null),m(a.length>0),b(a.length>0?null:r?`No suggestions for ${e}`:`Suggestions are unavailable`)},[i]),ce=(0,C.useCallback)(async()=>{w.current&&clearTimeout(w.current);let e=T.current+=1,t=[],n=!0;try{t=await a()}catch{n=!1}if(e!==T.current)return!1;let r=se(t);return u(r),f(r.length>0?0:-1),g(!0),v(null),b(r.length>0?null:n?`No contacts to show`:`Contacts are unavailable`),m(r.length>0),!0},[a]),M=(0,C.useCallback)(e=>{w.current&&clearTimeout(w.current);let t=e.trim();if(t.length<1){oe();return}w.current=setTimeout(()=>{w.current=null,j(t)},ju)},[oe,j]),le=(0,C.useCallback)((e=E.current)=>{let t=e.trim();if(!t)return!1;let n=D.current,r=Qn(t);if(r.length===0)return c(``),/^[\s,;]+$/.test(t)?!1:(oe(),o([...n,{text:t,invalid:!0}]),!0);let i=[...n];for(let e of r){if(`rejected`in e){i.push({text:e.rejected,invalid:!0});continue}let t=jn(e.address.email);k.current.has(t)||i.some(e=>!(`invalid`in e)&&jn(e.email)===t)||i.push(e.address)}return c(``),oe(),o(i),!0},[oe,o]);function ue(e){let t=e.name?.trim();le(er({...t?{name:t}:{},email:e.email})),x.current?.focus()}function de(e){let t=n[e];if(!t)return;let r=Mu(t),i=s.trim(),a=i?`${r}, ${i}`:r;c(a),o(n.filter((t,n)=>n!==e)),x.current?.focus(),M(a)}function fe(e){ee.current=e,o(n.filter((t,n)=>n!==e))}function pe(e){requestAnimationFrame(()=>document.getElementById(re(e))?.scrollIntoView({block:`nearest`}))}function me(e){e!==E.current&&(E.current=e,c(e),M(e))}function he(e){if(!Ar(e.nativeEvent))switch(e.key){case`ArrowDown`:case`ArrowUp`:{if(l.length===0){if(e.key!==`ArrowDown`)return;e.preventDefault();let t=s.trim();t.length>=1?j(t):ce().then(e=>{e&&x.current?.focus()});return}e.preventDefault(),m(!0);let t=e.key===`ArrowDown`?1:-1,n=l.length,r=d<0?t===1?0:n-1:(d+t+n)%n;f(r),pe(r);return}case`Enter`:{if(e.ctrlKey||e.metaKey)return;e.preventDefault();let t=l[d]??l[0];t?ue(t):le();return}case`Tab`:{let e=l[d]??l[0];e?ue(e):le();return}case`,`:case`;`:{let t=x.current?.selectionStart;if(nr(typeof t==`number`?s.slice(0,t):s))return;e.preventDefault(),le();return}case`Escape`:A&&(e.stopPropagation(),e.preventDefault(),oe());return;case`Backspace`:if(s.length>0||n.length===0)return;e.preventDefault(),de(n.length-1);return;default:}}function ge(e){let t=e.clipboardData?.getData(`text/plain`);t&&(e.preventDefault(),le((s.trim()?`${s.trim()}, ${t}`:t).replace(/[\r\n]+/g,`, `)))}return(0,B.jsxs)(`div`,{className:`recipient-input${A?` recipient-input--focused`:``}`,children:[(0,B.jsxs)(`div`,{ref:S,className:`recipient-input__field`,onClick:()=>x.current?.focus(),children:[n.length>0?(0,B.jsx)(`ul`,{className:`pills`,role:`list`,children:n.map((e,t)=>{let n=`invalid`in e;return(0,B.jsxs)(`li`,{className:`pill${n?` pill--invalid`:``}`,role:`listitem`,children:[(0,B.jsxs)(`button`,{type:`button`,className:`pill__label`,"aria-invalid":n?`true`:void 0,"aria-label":`${Pu(e)}. Activate to edit.`,title:Pu(e),onClick:e=>{e.stopPropagation(),de(t)},children:[n?(0,B.jsx)(`span`,{className:`pill__warning`,"aria-hidden":`true`,children:`⚠`}):(0,B.jsx)(`span`,{className:`pill__avatar`,"aria-hidden":`true`,style:hn(e.email),children:mn(e.name?.trim()||e.email)}),(0,B.jsx)(`span`,{className:`pill__text`,children:Nu(e)})]}),(0,B.jsx)(`button`,{type:`button`,className:`pill__remove`,"aria-label":`Remove ${Pu(e)}`,onClick:e=>{e.stopPropagation(),fe(t)},children:`×`})]},`${Mu(e)}-${t}`)})}):null,(0,B.jsx)(`input`,{id:t,ref:x,value:s,type:`text`,className:`recipient-input__text`,role:`combobox`,autoComplete:`off`,"aria-autocomplete":`list`,"aria-expanded":A,"aria-controls":ne,"aria-activedescendant":d>=0?re(d):void 0,onInput:e=>me(e.currentTarget.value),onChange:e=>me(e.target.value),onKeyDown:he,onBlur:()=>{le(),oe()},onPaste:ge})]}),(0,B.jsxs)(`div`,{className:`autocomplete`,style:A?void 0:{display:`none`},children:[(0,B.jsx)(`ul`,{id:ne,className:`autocomplete__options`,role:`listbox`,"aria-label":`${e} suggestions`,children:l.map((e,t)=>{let n=e.name?.trim(),r=Fu(e);return(0,B.jsxs)(`li`,{id:re(t),className:`autocomplete__option${t===d?` autocomplete__option--active`:``}`,role:`option`,"aria-selected":t===d,"aria-label":n?`${n} <${e.email}>`:e.email,onMouseDown:e=>e.preventDefault(),onClick:()=>ue(e),children:[(0,B.jsx)(`span`,{className:`ac-avatar`,"aria-hidden":`true`,style:hn(e.email),children:mn(n||e.email)}),(0,B.jsxs)(`span`,{className:`ac-lines`,children:[n?(0,B.jsx)(`span`,{className:`ac-name`,children:(0,B.jsx)(Iu,{text:n,typed:s})}):null,(0,B.jsx)(`span`,{className:`ac-email${n?``:` ac-email--primary`}`,children:(0,B.jsx)(Iu,{text:e.email,typed:s})})]}),r?(0,B.jsx)(`span`,{className:`ac-meta`,"aria-hidden":`true`,children:r}):null]},`${e.email}-${e.source}`)})}),_===null?null:(0,B.jsxs)(`div`,{className:`autocomplete__empty`,"aria-hidden":`true`,children:[(0,B.jsxs)(`span`,{className:`autocomplete__empty-text`,children:[`No matches for “`,_,`”`]}),(0,B.jsxs)(`span`,{className:`ac-key-hint`,children:[(0,B.jsx)(`kbd`,{children:`↵`}),` add it as typed`]})]}),h?null:(0,B.jsx)(`p`,{className:`autocomplete__browse`,children:(0,B.jsx)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:()=>{ce().then(e=>{e&&x.current?.focus()})},children:`Browse all contacts`})}),l.length>0?(0,B.jsxs)(`div`,{className:`autocomplete__keys`,"aria-hidden":`true`,children:[(0,B.jsxs)(`span`,{className:`ac-key-hint`,children:[(0,B.jsx)(`kbd`,{children:`↑↓`}),` navigate`]}),(0,B.jsxs)(`span`,{className:`ac-key-hint`,children:[(0,B.jsx)(`kbd`,{children:`↵`}),` add`]}),(0,B.jsx)(`span`,{className:`autocomplete__count`,children:ie})]}):null]}),(0,B.jsx)(`p`,{id:`${t}-status`,className:`sr-only`,role:`status`,children:ae})]})}var Ru=()=>!0,zu=class{constructor(e,t,n){this.root=e,this.currentNode=e,this.nodeType=t,this.filter=n||Ru}isAcceptableNode(e){let t=e.nodeType;return!!((t===Node.ELEMENT_NODE?1:t===Node.TEXT_NODE?4:0)&this.nodeType)&&this.filter(e)}nextNode(){let e=this.root,t=this.currentNode,n;for(;;){for(n=t.firstChild;!n&&t&&t!==e;)n=t.nextSibling,n||(t=t.parentNode);if(!n)return null;if(this.isAcceptableNode(n))return this.currentNode=n,n;t=n}}previousNode(){let e=this.root,t=this.currentNode,n;for(;;){if(t===e)return null;if(n=t.previousSibling,n)for(;t=n.lastChild;)n=t;else n=t.parentNode;if(!n)return null;if(this.isAcceptableNode(n))return this.currentNode=n,n;t=n}}previousPONode(){let e=this.root,t=this.currentNode,n;for(;;){for(n=t.lastChild;!n&&t&&t!==e;)n=t.previousSibling,n||(t=t.parentNode);if(!n)return null;if(this.isAcceptableNode(n))return this.currentNode=n,n;t=n}}},Bu=navigator.userAgent,Vu=/Mac OS X/.test(Bu),Hu=/Windows NT/.test(Bu),Uu=/iP(?:ad|hone|od)/.test(Bu)||Vu&&!!navigator.maxTouchPoints;/Android/.test(Bu);var Wu=/Gecko\//.test(Bu),Gu=/Edge\//.test(Bu),Ku=!Gu&&/WebKit\//.test(Bu),qu=Vu||Uu?`Meta-`:`Ctrl-`,Ju=Ku,Yu=`onbeforeinput`in document&&`inputType`in new InputEvent(`input`),Xu=/[^ \t\r\n\u200B]/,Zu=/^(?:#text|A(?:BBR|CRONYM)?|B(?:R|D[IO])?|C(?:ITE|ODE)|D(?:ATA|EL|FN)|EM|FONT|HR|I(?:FRAME|MG|NPUT|NS)?|KBD|Q|R(?:P|T|UBY)|S(?:AMP|MALL|PAN|TR(?:IKE|ONG)|U[BP])?|TIME|U|VAR|WBR)$/,Qu=new Set([`BR`,`HR`,`IFRAME`,`IMG`,`INPUT`]),Y=0,X=1,$u=2,ed=3,td=new WeakMap,nd=()=>{td=new WeakMap},rd=e=>Qu.has(e.nodeName),id=e=>{switch(e.nodeType){case 3:return X;case 1:case 11:if(td.has(e))return td.get(e);break;default:return Y}let t;return t=Array.from(e.childNodes).every(Z)?Zu.test(e.nodeName)?X:$u:ed,td.set(e,t),t},Z=e=>id(e)===X,ad=e=>id(e)===$u,od=e=>id(e)===ed,Q=(e,t,n)=>{let r=document.createElement(e);if(t instanceof Array&&(n=t,t=null),t)for(let e in t){let n=t[e];n!==void 0&&r.setAttribute(e,n)}return n&&n.forEach(e=>r.appendChild(e)),r},sd=(e,t)=>rd(e)||e.nodeType!==t.nodeType||e.nodeName!==t.nodeName?!1:e instanceof HTMLElement&&t instanceof HTMLElement?e.nodeName!==`A`&&e.className===t.className&&e.style.cssText===t.style.cssText:!0,cd=(e,t,n)=>{if(e.nodeName!==t)return!1;for(let t in n)if(!(`getAttribute`in e)||e.getAttribute(t)!==n[t])return!1;return!0},ld=(e,t,n,r)=>{for(;e&&e!==t;){if(cd(e,n,r))return e;e=e.parentNode}return null},ud=(e,t)=>{let n=e.childNodes;for(;t&&e instanceof Element;)e=n[t-1],n=e.childNodes,t=n.length;return e},dd=(e,t)=>{let n=e;if(n instanceof Element){let e=n.childNodes;if(te instanceof Element||e instanceof DocumentFragment?e.childNodes.length:e instanceof CharacterData?e.length:0,pd=e=>{let t=document.createDocumentFragment(),n=e.firstChild;for(;n;)t.appendChild(n),n=e.firstChild;return t},md=e=>{let t=e.parentNode;return t&&t.removeChild(e),e},hd=(e,t)=>{let n=e.parentNode;n&&n.replaceChild(t,e)},gd=e=>e instanceof Element?e.nodeName===`BR`:Xu.test(e.data),_d=(e,t)=>{let n=e.parentNode;for(;Z(n);)n=n.parentNode;let r=new zu(n,5,gd);return r.currentNode=e,!!r.nextNode()||t&&!r.previousNode()},vd=(e,t)=>{let n=new zu(e,4),r,i;for(;r=n.nextNode();)for(;(i=r.data.indexOf(`​`))>-1&&(!t||r.parentNode!==t);)if(r.length===1){let e=r,t=e.parentNode;for(;t&&(t.removeChild(e),n.currentNode=t,!(!Z(t)||fd(t)));)e=t,t=e.parentNode;break}else r.deleteData(i,1)},yd=0,bd=1,xd=2,Sd=3,Cd=(e,t,n)=>{let r=document.createRange();if(r.selectNode(t),n){let t=e.compareBoundaryPoints(Sd,r)>-1,n=e.compareBoundaryPoints(bd,r)<1;return!t&&!n}else{let t=e.compareBoundaryPoints(yd,r)<1,n=e.compareBoundaryPoints(xd,r)>-1;return t&&n}},wd=e=>{let{startContainer:t,startOffset:n,endContainer:r,endOffset:i}=e;for(;!(t instanceof Text);){let e=t.childNodes[n];if(!e||rd(e)){if(n&&(e=t.childNodes[n-1],e instanceof Text)){let r=e,i;for(;!r.length&&(i=r.previousSibling)&&i instanceof Text;)r.remove(),r=i;t=r,n=r.data.length}break}t=e,n=0}if(i)for(;!(r instanceof Text);){let e=r.childNodes[i-1];if(!e||rd(e)){if(e&&e.nodeName===`BR`&&!_d(e,!1)){--i;continue}break}r=e,i=fd(r)}else for(;!(r instanceof Text);){let e=r.firstChild;if(!e||rd(e))break;r=e}e.setStart(t,n),e.setEnd(r,i)},Td=(e,t,n,r)=>{let i=e.startContainer,a=e.startOffset,o=e.endContainer,s=e.endOffset,c;for(t||=e.commonAncestorContainer,n||=t;!a&&i!==t&&i!==r;)c=i.parentNode,a=Array.from(c.childNodes).indexOf(i),i=c;for(;!(o===n||o===r||(o.nodeType!==3&&o.childNodes[s]&&o.childNodes[s].nodeName===`BR`&&!_d(o.childNodes[s],!1)&&(s+=1),s!==fd(o)));)c=o.parentNode,s=Array.from(c.childNodes).indexOf(o)+1,o=c;e.setStart(i,a),e.setEnd(o,s)},Ed=(e,t,n)=>{let r=ld(e.endContainer,n,t);if(r&&=r.parentNode){let t=e.cloneRange();Td(t,r,r,n),t.endContainer===r&&(e.setStart(t.endContainer,t.endOffset),e.setEnd(t.endContainer,t.endOffset))}return e},Dd=e=>{let t=null;if(e instanceof Text)return e;if(Z(e)){let n=e.firstChild;if(Ju)for(;n&&n instanceof Text&&!n.data;)e.removeChild(n),n=e.firstChild;n||(t=Ju?document.createTextNode(`​`):document.createTextNode(``))}else if((e instanceof Element||e instanceof DocumentFragment)&&!e.querySelector(`BR`)&&!Xu.test(e.textContent||``)){t=Q(`BR`);let n=e,r;for(;(r=n.lastElementChild)&&!Z(r);)n=r;e=n,e instanceof HTMLElement&&e.contentEditable===`true`&&(e=Q(`DIV`),n.appendChild(e))}if(t)try{e.appendChild(t)}catch{}return e},Od=(e,t)=>{let n=null;return/^(?:TABLE|TBODY|TR|TH|TD|P)/.test(e.nodeName)||(Array.from(e.childNodes).forEach(r=>{let i=r.nodeName===`BR`;!i&&Z(r)?(n||=Q(`DIV`),n.appendChild(r)):(i||n)&&(n||=Q(`DIV`),Dd(n),i?e.replaceChild(n,r):e.insertBefore(n,r),n=null),od(r)&&Od(r,t)}),n&&e.appendChild(Dd(n))),e},kd=(e,t,n,r)=>{if(!n.contains(e))throw Error(`split: stopNode does not contain node`);if(e instanceof Text&&e!==n){if(typeof t!=`number`)throw Error(`Offset must be a number to split text node!`);if(!e.parentNode)throw Error(`Cannot split text node with no parent!`);return kd(e.parentNode,e.splitText(t),n,r)}let i=typeof t==`number`?t{let n=e.childNodes,r=n.length,i=[];for(;r--;){let a=n[r],o=r?n[r-1]:null;if(o&&Z(a)&&sd(a,o))t.startContainer===a&&(t.startContainer=o,t.startOffset+=fd(o)),t.endContainer===a&&(t.endContainer=o,t.endOffset+=fd(o)),t.startContainer===e&&(t.startOffset>r?--t.startOffset:t.startOffset===r&&(t.startContainer=o,t.startOffset=fd(o))),t.endContainer===e&&(t.endOffset>r?--t.endOffset:t.endOffset===r&&(t.endContainer=o,t.endOffset=fd(o))),md(a),a instanceof Text?o.appendData(a.data):i.push(pd(a));else if(a instanceof Element){let e;for(;e=i.pop();)a.appendChild(e);Ad(a,t)}}},jd=(e,t)=>{let n=e instanceof Text?e.parentNode:e;if(n instanceof Element){let e={startContainer:t.startContainer,startOffset:t.startOffset,endContainer:t.endContainer,endOffset:t.endOffset};Ad(n,e),t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset)}},Md=(e,t,n,r)=>{let i=t,a,o;for(;(a=i.parentNode)&&a!==r&&a instanceof Element&&a.childNodes.length===1;)i=a;md(i),o=e.childNodes.length;let s=e.lastChild;s&&s.nodeName===`BR`&&(e.removeChild(s),--o),e.appendChild(pd(t)),n.setStart(e,o),n.collapse(!0),jd(e,n)},Nd=(e,t)=>{let n=e.previousSibling,r=e.firstChild,i=e.nodeName===`LI`;if(!(i&&(!r||!/^[OU]L$/.test(r.nodeName)))){if(n&&sd(n,e)){if(!od(n))if(i){let e=Q(`DIV`);e.appendChild(pd(n)),n.appendChild(e)}else return;md(e);let a=!od(e);n.appendChild(pd(e)),a&&Od(n,t),r&&Nd(r,t)}else if(i){let t=Q(`DIV`);e.insertBefore(t,r),Dd(t)}}},Pd={"font-weight":{regexp:/^bold|^700/i,replace(){return Q(`B`)}},"font-style":{regexp:/^italic/i,replace(){return Q(`I`)}},"font-family":{regexp:Xu,replace(e,t){let n=Q(`SPAN`,{class:e.fontFamily});return n.style.fontFamily=t,n}},"font-size":{regexp:Xu,replace(e,t){let n=Q(`SPAN`,{class:e.fontSize});return n.style.fontSize=t,n}},"text-decoration":{regexp:/^underline/i,replace(){return Q(`U`)}}},Fd=(e,t,n)=>{let r=e.style,i,a;for(let t in Pd){let o=Pd[t],s=r.getPropertyValue(t);if(s&&o.regexp.test(s)){let r=o.replace(n.classNames,s);if(r.nodeName===e.nodeName&&r.className===e.className)continue;a||=r,i&&i.appendChild(r),i=r,e.style.removeProperty(t)}}return a&&i&&(i.appendChild(pd(e)),e.style.cssText?e.appendChild(a):hd(e,a)),i||e},Id=e=>(t,n)=>{let r=Q(e),i=t.attributes;for(let e=0,t=i.length;e{let r=e,i=r.face,a=r.size,o=r.color,s=n.classNames,c,l,u,d,f;return i&&(c=Q(`SPAN`,{class:s.fontFamily}),c.style.fontFamily=i,f=c,d=c),a&&(l=Q(`SPAN`,{class:s.fontSize}),l.style.fontSize=Ld[a]+`px`,f||=l,d&&d.appendChild(l),d=l),o&&/^#?([\dA-F]{3}){1,2}$/i.test(o)&&(o.charAt(0)!==`#`&&(o=`#`+o),u=Q(`SPAN`,{class:s.color}),u.style.color=o,f||=u,d&&d.appendChild(u),d=u),(!f||!d)&&(f=d=Q(`SPAN`)),t.replaceChild(f,r),d.appendChild(pd(r)),d},TT:(e,t,n)=>{let r=Q(`SPAN`,{class:n.classNames.fontFamily,style:`font-family:menlo,consolas,"courier new",monospace`});return t.replaceChild(r,e),r.appendChild(pd(e)),r}},zd=/^(?:A(?:DDRESS|RTICLE|SIDE|UDIO)|BLOCKQUOTE|CAPTION|D(?:[DLT]|IV)|F(?:IGURE|IGCAPTION|OOTER)|H[1-6]|HEADER|L(?:ABEL|EGEND|I)|O(?:L|UTPUT)|P(?:RE)?|SECTION|T(?:ABLE|BODY|D|FOOT|H|HEAD|R)|COL(?:GROUP)?|UL)$/,Bd=/^(?:HEAD|META|STYLE)/,Vd=(e,t,n)=>{let r=e.childNodes,i=e;for(;Z(i);)i=i.parentNode;let a=new zu(i,5);for(let i=0,o=r.length;i{let t=e.childNodes,n=t.length;for(;n--;){let r=t[n];r instanceof Element&&!rd(r)?(Hd(r),Z(r)&&!r.firstChild&&e.removeChild(r)):r instanceof Text&&!r.data&&e.removeChild(r)}},Ud=(e,t,n)=>{let r=e.querySelectorAll(`BR`),i=[],a=r.length;for(let e=0;ee.split(`&`).join(`&`).split(`<`).join(`<`).split(`>`).join(`>`).split(`"`).join(`"`),Gd=(e,t)=>{let n=new zu(t,1,ad);return n.currentNode=e,n},Kd=(e,t)=>{let n=Gd(e,t).previousNode();return n===t?null:n},qd=(e,t)=>{let n=Gd(e,t).nextNode();return n===t?null:n},Jd=e=>!e.textContent&&!e.querySelector(`IMG`),Yd=(e,t)=>{let n=e.startContainer,r;return r=Z(n)?Kd(n,t):n!==t&&n instanceof HTMLElement&&ad(n)?n:qd(ud(n,e.startOffset),t),r&&Cd(e,r,!0)?r:null},Xd=(e,t)=>{let n=e.endContainer,r;if(Z(n))r=Kd(n,t);else if(n!==t&&n instanceof HTMLElement&&ad(n))r=n;else{let i=dd(n,e.endOffset);if(!i||!t.contains(i)){i=t;let e;for(;e=i.lastChild;)i=e}r=Kd(i,t)}return r&&Cd(e,r,!0)?r:null},Zd=e=>e instanceof Text?Xu.test(e.data):e.nodeName===`IMG`,Qd=(e,t)=>{let n=e.startContainer,r=e.startOffset,i;if(n instanceof Text){let e=n.data;for(let t=r;t>0;--t)if(e.charAt(t-1)!==`​`)return!1;i=n}else if(i=dd(n,r),i&&!t.contains(i)&&(i=null),!i&&(i=ud(n,r),i instanceof Text&&i.length))return!1;let a=Yd(e,t);if(!a)return!1;let o=new zu(a,5,Zd);return o.currentNode=i,!o.previousNode()},$d=(e,t)=>{let n=e.endContainer,r=e.endOffset,i;if(n instanceof Text){let e=n.data,t=e.length;for(let n=r;n{let n=Yd(e,t),r=Xd(e,t),i;n&&r&&(i=n.parentNode,e.setStart(i,Array.from(i.childNodes).indexOf(n)),i=r.parentNode,e.setEnd(i,Array.from(i.childNodes).indexOf(r)+1))};function tf(e,t,n,r){let i=document.createRange();return i.setStart(e,t),n&&typeof r==`number`?i.setEnd(n,r):i.setEnd(e,t),i}var nf=(e,t)=>{let{startContainer:n,startOffset:r,endContainer:i,endOffset:a}=e,o;if(n instanceof Text){let t=n.parentNode;if(o=t.childNodes,r===n.length)r=Array.from(o).indexOf(n)+1,e.collapsed&&(i=t,a=r);else{if(r){let e=n.splitText(r);i===n?(a-=r,i=e):i===t&&(a+=1),n=e}r=Array.from(o).indexOf(n)}n=t}else o=n.childNodes;let s=o.length;r===s?n.appendChild(t):n.insertBefore(t,o[r]),n===i&&(a+=o.length-s),e.setStart(n,r),e.setEnd(i,a)},rf=(e,t,n)=>{let r=document.createDocumentFragment();if(e.collapsed)return r;t||=e.commonAncestorContainer,t instanceof Text&&(t=t.parentNode);let i=e.startContainer,a=e.startOffset,o=kd(e.endContainer,e.endOffset,t,n),s=0,c=kd(i,a,t,n);for(;c&&c!==o;){let e=c.nextSibling;r.appendChild(c),c=e}return c=o&&o.previousSibling,c&&c instanceof Text&&o instanceof Text&&(s=c.length,c.appendData(o.data),md(o),o=c),e.setStart(i,a),o?e.setEnd(o,s):e.setEnd(t,t.childNodes.length),Dd(t),r},af=(e,t,n)=>{e.currentNode=n;let r;for(;r=e[t]();){if(r instanceof Text||rd(r))return r;if(!Z(r))return null}return null},of=(e,t)=>{let n=Yd(e,t),r=Xd(e,t),i=n!==r;n&&r&&(wd(e),Td(e,n,r,t));let a=rf(e,null,t);wd(e),i&&(r=Xd(e,t),n&&r&&n!==r&&Md(n,r,e,t)),n&&Dd(n);let o=t.firstChild;(!o||o.nodeName===`BR`)&&(Dd(t),t.firstChild&&e.selectNodeContents(t.firstChild)),e.collapse(!0);let s=e.startContainer,c=e.startOffset,l=new zu(t,5),u=s,d=c;(!(u instanceof Text)||d===u.data.length)&&(u=af(l,`nextNode`,u),d=0);let f=s,p=c-1;(!(f instanceof Text)||p===-1)&&(f=af(l,`previousPONode`,u||(s instanceof Text?s:s.childNodes[c]||s)),f instanceof Text&&(p=f.data.length));let m=null,h=0;return u instanceof Text&&u.data.charAt(d)===` `&&Qd(e,t)?(m=u,h=d):f instanceof Text&&f.data.charAt(p)===` `&&(u instanceof Text&&u.data.charAt(d)===` `||$d(e,t))&&(m=f,h=p),m&&m.replaceData(h,1,`\xA0`),e.setStart(s,c),e.collapse(!0),a},sf=(e,t,n)=>{let r=t.firstChild&&Z(t.firstChild),i;for(Od(t,n),i=t;i=qd(i,n);)Dd(i);e.collapsed||of(e,n),wd(e),e.collapse(!1);let a=ld(e.endContainer,n,`BLOCKQUOTE`)||n,o=Yd(e,n),s=null,c=qd(t,t),l=!r&&!!o&&Jd(o);if(o&&c&&!l&&!ld(c,t,`PRE`)&&!ld(c,t,`TABLE`)){Td(e,o,o,n),e.collapse(!0);let t=e.endContainer,r=e.endOffset;if(Ud(o,n,!1),Z(t)){let e=kd(t,r,Kd(t,n)||n,n);t=e.parentNode,r=Array.from(t.childNodes).indexOf(e)}if(r!==fd(t))for(s=document.createDocumentFragment();i=t.childNodes[r];)s.appendChild(i);Md(t,c,e,n),t===n?e.setEnd(n,fd(n)):(r=Array.from(t.parentNode.childNodes).indexOf(t)+1,t=t.parentNode,e.setEnd(t,r))}if(fd(t)){l&&o&&(e.setEndBefore(o),e.collapse(!1),md(o)),a.contains(e.endContainer)||(n.contains(e.endContainer)||(e.setEnd(n,fd(n)),e.collapse(!1)),a=ld(e.endContainer,n,`BLOCKQUOTE`)||n),Td(e,a,a,n);let r=kd(e.endContainer,e.endOffset,a,n),i=r?r.previousSibling:a.lastChild;a.insertBefore(t,r),r?e.setEndBefore(r):e.setEnd(a,fd(a)),o=Xd(e,n),wd(e);let s=e.endContainer,c=e.endOffset;r&&od(r)&&Nd(r,n),r=i&&i.nextSibling,r&&od(r)&&Nd(r,n),e.setEnd(s,c)}if(s&&o){let t=e.cloneRange();Dd(s),Md(o,s,t,n),e.setEnd(t.endContainer,t.endOffset)}wd(e)},cf=e=>{if(e.collapsed)return``;let t=e.startContainer,n=e.endContainer,r=new zu(e.commonAncestorContainer,5,t=>Cd(e,t,!0));r.currentNode=t;let i=t,a=``,o=!1,s;for((!(i instanceof Element)&&!(i instanceof Text)||!r.filter(i))&&(i=r.nextNode());i;)i instanceof Text?(s=i.data,s&&/\S/.test(s)&&(i===n&&(s=s.slice(0,e.endOffset)),i===t&&(s=s.slice(e.startOffset)),a+=s,o=!0)):(i.nodeName===`BR`||o&&!Z(i))&&(a+=` +`,o=!1),i=r.nextNode();return a=a.replace(/ /g,` `),a},lf=Array.prototype.indexOf,uf=(e,t,n,r,i,a,o)=>{let s=e.clipboardData;if(Gu||!s)return!1;let c=a?``:cf(t),l=Yd(t,n),u=Xd(t,n),d=n;l===u&&l?.contains(t.commonAncestorContainer)&&(d=l);let f;f=r?of(t,n):t.cloneContents();let p=t.commonAncestorContainer;for(p instanceof Text&&(p=p.parentNode);p&&p!==d;){let e=p.cloneNode(!1);e.appendChild(f),f=e,p=p.parentNode}let m;if(f.childNodes.length===1&&f.childNodes[0]instanceof Text)c=f.childNodes[0].data.replace(/ /g,` `),o=!0;else{let e=Q(`DIV`);e.appendChild(f),m=e.innerHTML,i&&(m=i(m))}return a&&m!==void 0&&(c=a(m)),Hu&&(c=c.replace(/\r?\n/g,`\r +`)),!o&&m&&c!==m&&(m=``+m,s.setData(`text/html`,m)),s.setData(`text/plain`,c),e.preventDefault(),!0},df=function(e){let t=this.getSelection(),n=this._root;if(t.collapsed){e.preventDefault();return}this.saveUndoState(t),uf(e,t,n,!0,this._config.willCutCopy,this._config.toPlainText,!1)||setTimeout(()=>{try{this._ensureBottomLine()}catch(e){this._config.didError(e)}},0),this.setSelection(t)},ff=function(e){uf(e,this.getSelection(),this._root,!1,this._config.willCutCopy,this._config.toPlainText,!1)},pf=function(e){this._isShiftDown=e.shiftKey},mf=function(e){let t=e.clipboardData,n=t?.items,r=this._isShiftDown,i=!1,a=!1,o=null,s=null;if(n){let c=n.length;for(;c--;){let e=n[c],t=e.type;t===`text/html`?s=e:t===`text/plain`||t===`text/uri-list`?o=e:t===`text/rtf`?i=!0:/^image\/.*/.test(t)&&(a=!0)}if(a&&!(i&&s)&&!o){e.preventDefault(),this.fireEvent(`pasteImage`,{clipboardData:t});return}if(!Gu){e.preventDefault(),s&&(!r||!o)?s.getAsString(e=>{this.insertHTML(e,!0)}):o&&o.getAsString(e=>{let t=this.getSelection();if(!t.collapsed&&Xu.test(t.toString())){let t=this.linkRegExp.exec(e);if(t&&t[0].length===e.length){let e=t[1]?/^(?:ht|f)tps?:/i.test(t[1])?t[1]:`http://`+t[1]:`mailto:`+t[0];this.makeLink(e);return}}this.insertPlainText(e,!0)});return}}let c=t?.types;if(!Gu&&c&&(lf.call(c,`text/html`)>-1||!Wu&&lf.call(c,`text/plain`)>-1&&lf.call(c,`text/rtf`)<0)){e.preventDefault();let n;!r&&(n=t.getData(`text/html`))?this.insertHTML(n,!0):((n=t.getData(`text/plain`))||(n=t.getData(`text/uri-list`)))&&this.insertPlainText(n,!0);return}let l=document.body,u=this.getSelection(),d=u.startContainer,f=u.startOffset,p=u.endContainer,m=u.endOffset,h=Q(`DIV`,{contenteditable:`true`,style:`position:fixed; overflow:hidden; top:0; right:100%; width:1px; height:1px;`});l.appendChild(h),u.selectNodeContents(h),this.setSelection(u),setTimeout(()=>{try{let e=``,t=h,n;for(;h=t;)t=h.nextSibling,md(h),n=h.firstChild,n&&n===h.lastChild&&n instanceof HTMLDivElement&&(h=n),e+=h.innerHTML;this.setSelection(tf(d,f,p,m)),e&&this.insertHTML(e,!0)}catch(e){this._config.didError(e)}},0)},hf=function(e){if(!e.dataTransfer)return;let t=e.dataTransfer.types,n=t.length,r=!1,i=!1;for(;n--;)switch(t[n]){case`text/plain`:r=!0;break;case`text/html`:i=!0;break;default:return}(i||r&&this.saveUndoState)&&this.saveUndoState()},gf=(e,t,n)=>{t.preventDefault(),e.splitBlock(t.shiftKey,n)},_f=(e,t)=>{try{t||=e.getSelection();let n=t.startContainer;n instanceof Text&&(n=n.parentNode);let r=n;for(;Z(r)&&(!r.textContent||r.textContent===`​`);)n=r,r=n.parentNode;n!==r&&(t.setStart(r,Array.from(r.childNodes).indexOf(n)),t.collapse(!0),r.removeChild(n),ad(r)||(r=Kd(r,e._root)||e._root),Dd(r),wd(t)),n===e._root&&(n=n.firstChild)&&n.nodeName===`BR`&&md(n),e._ensureBottomLine(),e.setSelection(t),e._updatePath(t,!0)}catch(t){e._config.didError(t)}},vf=(e,t)=>{let n;for(;(n=e.parentNode)&&!(n===t||n.isContentEditable);)e=n;md(e)},yf=(e,t,n)=>{if(ld(t,e._root,`A`))return;let r=t.data||``,i=Math.max(r.lastIndexOf(` `,n-1),r.lastIndexOf(`\xA0`,n-1))+1,a=r.slice(i,n),o=e.linkRegExp.exec(a);if(o){let n=e.getSelection();e._docWasChanged(),e._recordUndoState(n),e._getRangeAndRemoveBookmark(n);let a=i+o.index,s=a+o[0].length,c=n.startContainer===t,l=n.startOffset-s;a&&(t=t.splitText(a));let u=e._config.tagAttributes.a,d=Q(`A`,Object.assign({href:o[1]?/^(?:ht|f)tps?:/i.test(o[1])?o[1]:`http://`+o[1]:`mailto:`+o[0]},u));d.textContent=r.slice(a,s),t.parentNode.insertBefore(d,t),t.data=r.slice(s),c&&(n.setStart(t,l),n.setEnd(t,l)),e.setSelection(n)}},bf=(e,t,n)=>{let r=e._root;if(e._removeZWS(),e.saveUndoState(n),!n.collapsed)t.preventDefault(),of(n,r),_f(e,n);else if(Qd(n,r)){t.preventDefault();let i=Yd(n,r);if(!i)return;let a=i;Od(a.parentNode,r);let o=Kd(a,r);if(o){if(!o.isContentEditable){vf(o,r);return}for(Md(o,a,n,r),a=o.parentNode;a!==r&&!a.nextSibling;)a=a.parentNode;a!==r&&(a=a.nextSibling)&&Nd(a,r),e.setSelection(n)}else if(a){if(ld(a,r,`UL`)||ld(a,r,`OL`)){e.decreaseListLevel(n);return}else if(ld(a,r,`BLOCKQUOTE`)){e.removeQuote(n);return}e.setSelection(n),e._updatePath(n,!0)}}else{wd(n);let r=n.startContainer,i=n.startOffset,a=r.parentNode;r instanceof Text&&a instanceof HTMLAnchorElement&&i&&a.href.includes(r.data)?(r.deleteData(i-1,1),e.setSelection(n),e.removeLink(),t.preventDefault()):(e.setSelection(n),setTimeout(()=>{_f(e)},0))}},xf=(e,t,n)=>{let r=e._root,i,a,o,s,c,l;if(e._removeZWS(),e.saveUndoState(n),!n.collapsed)t.preventDefault(),of(n,r),_f(e,n);else if($d(n,r)){if(t.preventDefault(),i=Yd(n,r),!i)return;if(Od(i.parentNode,r),a=qd(i,r),a){if(!a.isContentEditable){vf(a,r);return}for(Md(i,a,n,r),a=i.parentNode;a!==r&&!a.nextSibling;)a=a.parentNode;a!==r&&(a=a.nextSibling)&&Nd(a,r),e.setSelection(n),e._updatePath(n,!0)}}else{if(o=n.cloneRange(),Td(n,r,r,r),s=n.endContainer,c=n.endOffset,s instanceof Element&&(l=s.childNodes[c],l&&l.nodeName===`IMG`)){t.preventDefault(),md(l),wd(n),_f(e,n);return}e.setSelection(o),setTimeout(()=>{_f(e)},0)}},Sf=(e,t,n)=>{let r=e._root;if(e._removeZWS(),n.collapsed&&Qd(n,r)){let i=Yd(n,r),a;for(;a=i.parentNode;){if(a.nodeName===`UL`||a.nodeName===`OL`){t.preventDefault(),e.increaseListLevel(n);break}i=a}}},Cf=(e,t,n)=>{let r=e._root;if(e._removeZWS(),n.collapsed&&Qd(n,r)){let i=n.startContainer;(ld(i,r,`UL`)||ld(i,r,`OL`))&&(t.preventDefault(),e.decreaseListLevel(n))}},wf=(e,t,n)=>{let r,i=e._root;if(e._recordUndoState(n),e._getRangeAndRemoveBookmark(n),!n.collapsed)of(n,i),e._ensureBottomLine(),e.setSelection(n),e._updatePath(n,!0);else if($d(n,i)){let r=Yd(n,i);if(r&&r.nodeName!==`PRE`){let i=r.textContent?.trimEnd().replace(`​`,``);if(i===`*`||i===`1.`){t.preventDefault(),e.insertPlainText(` `,!1),e._docWasChanged(),e.saveUndoState(n);let a=new zu(r,4),o;for(;o=a.nextNode();)md(o);i===`*`?e.makeUnorderedList():e.makeOrderedList();return}}}if(r=n.endContainer,n.endOffset===fd(r))do if(r.nodeName===`A`){n.setStartAfter(r);break}while(!r.nextSibling&&(r=r.parentNode)&&r!==i);if(e._config.addLinks){let t=n.cloneRange();wd(t);let r=t.startContainer,i=t.startOffset;setTimeout(()=>{yf(e,r,i)},0)}e.setSelection(n)},Tf=function(e){if(e.defaultPrevented||e.isComposing)return;let t=e.key,n=``,r=e.code;/^Digit\d$/.test(r)&&(t=r.slice(-1)),t!==`Backspace`&&t!==`Delete`&&(e.altKey&&(n+=`Alt-`),e.ctrlKey&&(n+=`Ctrl-`),e.metaKey&&(n+=`Meta-`),e.shiftKey&&(n+=`Shift-`)),Hu&&e.shiftKey&&t===`Delete`&&(n+=`Shift-`),t=n+t;let i=this.getSelection(),a=this._keyHandlers[t];a?a(this,e,i):!i.collapsed&&!e.ctrlKey&&!e.metaKey&&t.length===1&&(this.saveUndoState(i),of(i,this._root),this._ensureBottomLine(),this.setSelection(i),this._updatePath(i,!0))},Ef={Backspace:bf,Delete:xf,Tab:Sf,"Shift-Tab":Cf," ":wf,ArrowLeft(e){e._removeZWS()},ArrowRight(e,t,n){e._removeZWS();let r=e.getRoot();if($d(n,r)){wd(n);let i=n.endContainer;do if(i.nodeName===`CODE`){let r=i.nextSibling;if(!(r instanceof Text)||r.length===0){let e=document.createTextNode(`\xA0`);i.parentNode.insertBefore(e,r),r=e}n.setStart(r,1),e.setSelection(n),t.preventDefault();break}while(!i.nextSibling&&(i=i.parentNode)&&i!==r)}}};Yu||(Ef.Enter=gf,Ef[`Shift-Enter`]=gf),!Vu&&!Uu&&(Ef.PageUp=e=>{e.moveCursorToStart()},Ef.PageDown=e=>{e.moveCursorToEnd()});var Df=(e,t)=>(t||=null,(n,r)=>{r.preventDefault();let i=n.getSelection();n.hasFormat(e,null,i)?n.changeFormat(null,{tag:e},i):n.changeFormat({tag:e},t,i)});Ef[qu+`b`]=Df(`B`),Ef[qu+`i`]=Df(`I`),Ef[qu+`u`]=Df(`U`),Ef[qu+`Shift-7`]=Df(`S`),Ef[qu+`Shift-5`]=Df(`SUB`,{tag:`SUP`}),Ef[qu+`Shift-6`]=Df(`SUP`,{tag:`SUB`}),Ef[qu+`Shift-8`]=(e,t)=>{t.preventDefault();let n=e.getPath();/(?:^|>)UL/.test(n)?e.removeList():e.makeUnorderedList()},Ef[qu+`Shift-9`]=(e,t)=>{t.preventDefault();let n=e.getPath();/(?:^|>)OL/.test(n)?e.removeList():e.makeOrderedList()},Ef[qu+`[`]=(e,t)=>{t.preventDefault();let n=e.getPath();/(?:^|>)BLOCKQUOTE/.test(n)||!/(?:^|>)[OU]L/.test(n)?e.decreaseQuoteLevel():e.decreaseListLevel()},Ef[qu+`]`]=(e,t)=>{t.preventDefault();let n=e.getPath();/(?:^|>)BLOCKQUOTE/.test(n)||!/(?:^|>)[OU]L/.test(n)?e.increaseQuoteLevel():e.increaseListLevel()},Ef[qu+`d`]=(e,t)=>{t.preventDefault(),e.toggleCode()},Ef[qu+`z`]=(e,t)=>{t.preventDefault(),e.undo()},Ef[qu+`y`]=Ef[qu+`Shift-z`]=Ef[qu+`Shift-Z`]=(e,t)=>{t.preventDefault(),e.redo()};var Of=8,kf=40,Af=1200,jf=[{pos:`nw`,cursor:`nwse-resize`},{pos:`n`,cursor:`ns-resize`},{pos:`ne`,cursor:`nesw-resize`},{pos:`e`,cursor:`ew-resize`},{pos:`se`,cursor:`nwse-resize`},{pos:`s`,cursor:`ns-resize`},{pos:`sw`,cursor:`nesw-resize`},{pos:`w`,cursor:`ew-resize`}],Mf={ArrowUp:(e,t,n)=>{let r=Yd(t,n);if(r){let i=Kd(r,n);i&&(t.selectNodeContents(i),t.collapse(!1),e.setSelection(t).focus())}},ArrowDown:(e,t,n)=>{let r=Yd(t,n);if(r){let i=qd(r,n);i&&(t.selectNodeContents(i),t.collapse(!0),e.setSelection(t).focus())}},Delete:(e,t)=>{e.replaceWithBlankLine(t)},Backspace:(e,t)=>{e.replaceWithBlankLine(t)}},Nf=class{constructor(e,t){this._currentImage=null,this._resizeContainer=null,this._handles=null,this._currentHandle=null,this._startX=0,this._startY=0,this._startWidth=0,this._startHeight=0,this._maxWidth=Af,this._originalRatio=1,this._editor=t,this._root=e,document.addEventListener(`click`,this),t.addEventListener(`drop`,this)}destroy(){this._deselectImage(),this._editor.removeEventListener(`drop`,this),document.removeEventListener(`click`,this)}handleEvent(e){switch(e.type){case`click`:this._onClick(e);break;case`pointerdown`:this._onPointerDown(e);break;case`pointermove`:this._onPointerMove(e);break;case`pointercancel`:case`pointerup`:this._onPointerUp(e);break;case`keydown`:this._onKeyDown(e);break;case`drop`:this._deselectImage();break}}_onClick(e){let t=e.target;t.nodeName===`IMG`&&this._root.contains(t)?(e.stopPropagation(),this._selectImage(t)):this._currentImage&&this._handles&&!this._handles.some(e=>e.element===t)&&this._deselectImage()}_deselectImage(){this._currentImage&&=(document.removeEventListener(`keydown`,this,!0),this._currentHandle&&this._onPointerUp({preventDefault(){},target:this._currentHandle.element}),this._handles&&this._handles.forEach(({element:e})=>e.removeEventListener(`pointerdown`,this)),this._resizeContainer&&this._resizeContainer.remove(),this._currentImage.removeAttribute(`tabindex`),this._handles=null,this._resizeContainer=null,null)}_selectImage(e){if(this._currentImage===e)return;this._deselectImage(),this._root.blur();let t=jf.map(({pos:e,cursor:t})=>{let n=Of/2,r=``;switch(e){case`nw`:r=`left: -${n}px; top: -${n}px;`;break;case`n`:r=`left: calc(50% - ${n}px); top: -${n}px;`;break;case`ne`:r=`right: -${n}px; top: -${n}px;`;break;case`e`:r=`right: -${n}px; top: calc(50% - ${n}px);`;break;case`se`:r=`right: -${n}px; bottom: -${n}px;`;break;case`s`:r=`left: calc(50% - ${n}px); bottom: -${n}px;`;break;case`sw`:r=`left: -${n}px; bottom: -${n}px;`;break;case`w`:r=`left: -${n}px; top: calc(50% - ${n}px);`;break}let i=Q(`div`,{class:`squire-resize-handle squire-resize-handle-${e}`,style:` + position: absolute; + width: ${Of}px; + height: ${Of}px; + background: #0067b9; + border: 1px solid #fff; + cursor: ${t}; + pointer-events: auto; + touch-action: none; + box-shadow: 0 1px 3px rgba(0,0,0,0.3); + ${r} + `});return i.addEventListener(`pointerdown`,this),{element:i,cursor:t,position:e}}),n=Q(`div`,{class:`squire-image-resize-container`,style:`position: absolute; pointer-events: none; z-index: 1000;`},t.map(e=>e.element));this._currentImage=e,this._resizeContainer=n,this._handles=t,this._root.appendChild(this._resizeContainer);let r=e.naturalWidth;this._originalRatio=r/e.naturalHeight,this._maxWidth=Math.min(r*2,e.parentElement?e.parentElement.offsetWidth:Af,Af),this._positionResizeContainer(),e.tabIndex=-1,e.focus(),document.addEventListener(`keydown`,this,!0)}_positionResizeContainer(){let e=this._resizeContainer,t=this._root,n=this._currentImage;if(!e||!n)return;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect(),a=i.top-r.top+t.scrollTop,o=i.left-r.left+t.scrollLeft,s=i.width,c=i.height;e.style.top=a+`px`,e.style.left=o+`px`,e.style.width=s+`px`,e.style.height=c+`px`}_onPointerDown(e){if(this._currentHandle||!this._handles)return;let t=e.target,n=this._handles.find(e=>e.element===t)||null;if(!n)return;let r=this._currentImage;if(!r)return;e.preventDefault(),e.stopPropagation(),t.addEventListener(`pointermove`,this),t.addEventListener(`pointerup`,this),t.addEventListener(`pointercancel`,this),t.setPointerCapture(e.pointerId),this._currentHandle=n,this._startX=e.clientX,this._startY=e.clientY;let i=getComputedStyle(r);this._startWidth=parseFloat(i.width),this._startHeight=parseFloat(i.height),document.body.style.cursor=n.cursor}_onPointerMove(e){e.preventDefault();let t=this._currentHandle,n=this._currentImage;if(!t||!n)return;let r=e.clientX-this._startX,i=e.clientY-this._startY,a=this._maxWidth,o=this._originalRatio,s=this._startWidth,c=this._startHeight;switch(t.position){case`sw`:case`nw`:case`w`:s-=2*r;break;case`se`:case`ne`:case`e`:s+=2*r;break;case`n`:c-=i,s=c*o;break;case`s`:c+=i,s=c*o;break}sa&&(s=a);let l=n.style;l.width=s+`px`,l.height=`auto`,this._positionResizeContainer()}_onPointerUp(e){e.preventDefault();let t=e.target;t&&(t.removeEventListener(`pointermove`,this),t.removeEventListener(`pointerup`,this),t.removeEventListener(`pointercancel`,this)),this._currentHandle=null,document.body.style.cursor=``}_onKeyDown(e){e.preventDefault(),e.stopPropagation();let t=Mf[e.key];if(!t)return;let n=this._currentImage;if(!n)return;let r=this._editor,i=this._root;this._deselectImage();let a=r.getSelection();a.selectNode(n),t(r,a,i)}},Pf=class{constructor(e,t){this.customEvents=new Set([`pathChange`,`select`,`input`,`pasteImage`,`undoStateChange`]),this.startSelectionId=`squire-selection-start`,this.endSelectionId=`squire-selection-end`,this.linkRegExp=/\b(?:((?:(?:ht|f)tps?:\/\/|www\d{0,3}[.]|[a-z0-9][a-z0-9.\-]*[.][a-z]{2,}\/)(?:[^\s()<>]+|\([^\s()<>]+\))+(?:[^\s?&`!()\[\]{};:'".,<>«»“”‘’]|\([^\s()<>]+\)))|([\w\-.%+]+@(?:[\w\-]+\.)+[a-z]{2,}\b(?:[?][^&?\s]+=[^\s?&`!()\[\]{};:'".,<>«»“”‘’]+(?:&[^&?\s]+=[^\s?&`!()\[\]{};:'".,<>«»“”‘’]+)*)?))/i,this.tagAfterSplit={DT:`DD`,DD:`DT`,LI:`LI`,PRE:`PRE`},this._root=e,this._config=this._makeConfig(t),this._isFocused=!1,this._lastSelection=tf(e,0),this._willRestoreSelection=!1,this._mayHaveZWS=!1,this._lastAnchorNode=null,this._lastFocusNode=null,this._path=``,this._events=new Map,this._undoIndex=-1,this._undoStack=[],this._undoStackLength=0,this._isInUndoState=!1,this._ignoreChange=!1,this._ignoreAllChanges=!1,this.addEventListener(`selectionchange`,this._updatePathOnEvent),this.addEventListener(`blur`,this._enableRestoreSelection),this.addEventListener(`mousedown`,this._disableRestoreSelection),this.addEventListener(`touchstart`,this._disableRestoreSelection),this.addEventListener(`focus`,this._restoreSelection),this.addEventListener(`blur`,this._removeZWS),this._isShiftDown=!1,this.addEventListener(`cut`,df),this.addEventListener(`copy`,ff),this.addEventListener(`paste`,mf),this.addEventListener(`drop`,hf),this.addEventListener(`keydown`,pf),this.addEventListener(`keyup`,pf),this.addEventListener(`keydown`,Tf),this._keyHandlers=Object.create(Ef);let n=new MutationObserver(()=>this._docWasChanged());n.observe(e,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),this._mutation=n,e.setAttribute(`contenteditable`,`true`),this.addEventListener(`beforeinput`,this._beforeInput),this._imageResizer=new Nf(e,this),this.setHTML(``)}destroy(){this._events.forEach((e,t)=>{this.removeEventListener(t)}),this._mutation.disconnect(),this._imageResizer.destroy(),this._undoIndex=-1,this._undoStack=[],this._undoStackLength=0}_makeConfig(e){let t={blockTag:`DIV`,blockAttributes:null,tagAttributes:{},classNames:{color:`color`,fontFamily:`font`,fontSize:`size`,highlight:`highlight`},undo:{documentSizeThreshold:-1,undoLimit:-1},addLinks:!0,willCutCopy:null,toPlainText:null,sanitizeToDOMFragment:e=>{let t=DOMPurify.sanitize(e,{ALLOW_UNKNOWN_PROTOCOLS:!0,WHOLE_DOCUMENT:!1,RETURN_DOM:!0,RETURN_DOM_FRAGMENT:!0,FORCE_BODY:!1});return t?document.importNode(t,!0):document.createDocumentFragment()},didError:e=>console.log(e)};return e&&(Object.assign(t,e),t.blockTag=t.blockTag.toUpperCase()),t}setKeyHandler(e,t){return this._keyHandlers[e]=t,this}_beforeInput(e){switch(e.inputType){case`insertLineBreak`:e.preventDefault(),this.splitBlock(!0);break;case`insertParagraph`:e.preventDefault(),this.splitBlock(!1);break;case`insertOrderedList`:e.preventDefault(),this.makeOrderedList();break;case`insertUnoderedList`:e.preventDefault(),this.makeUnorderedList();break;case`historyUndo`:e.preventDefault(),this.undo();break;case`historyRedo`:e.preventDefault(),this.redo();break;case`formatBold`:e.preventDefault(),this.bold();break;case`formatItalic`:e.preventDefault(),this.italic();break;case`formatUnderline`:e.preventDefault(),this.underline();break;case`formatStrikeThrough`:e.preventDefault(),this.strikethrough();break;case`formatSuperscript`:e.preventDefault(),this.superscript();break;case`formatSubscript`:e.preventDefault(),this.subscript();break;case`formatJustifyFull`:case`formatJustifyCenter`:case`formatJustifyRight`:case`formatJustifyLeft`:{e.preventDefault();let t=e.inputType.slice(13).toLowerCase();t===`full`&&(t=`justify`),this.setTextAlignment(t);break}case`formatRemove`:e.preventDefault(),this.removeAllFormatting();break;case`formatSetBlockTextDirection`:{e.preventDefault();let t=e.data;t===`null`&&(t=null),this.setTextDirection(t);break}case`formatBackColor`:e.preventDefault(),this.setHighlightColor(e.data);break;case`formatFontColor`:e.preventDefault(),this.setTextColor(e.data);break;case`formatFontName`:e.preventDefault(),this.setFontFace(e.data);break}}handleEvent(e){this.fireEvent(e.type,e)}fireEvent(e,t){let n=this._events.get(e);if(/^(?:focus|blur)/.test(e)){let t=this._root===document.activeElement;if(e===`focus`){if(!t||this._isFocused)return this;this._isFocused=!0}else{if(t||!this._isFocused)return this;this._isFocused=!1}}if(n){let r=t instanceof Event?t:new CustomEvent(e,{detail:t});n=n.slice();for(let e of n)try{`handleEvent`in e?e.handleEvent(r):e.call(this,r)}catch(e){this._config.didError(e)}}return this}addEventListener(e,t){let n=this._events.get(e),r=this._root;return n||(n=[],this._events.set(e,n),this.customEvents.has(e)||(e===`selectionchange`&&(r=document),r.addEventListener(e,this,!0))),n.push(t),this}removeEventListener(e,t){let n=this._events.get(e),r=this._root;if(n){if(t){let e=n.length;for(;e--;)n[e]===t&&n.splice(e,1)}else n.length=0;n.length||(this._events.delete(e),this.customEvents.has(e)||(e===`selectionchange`&&(r=document),r.removeEventListener(e,this,!0)))}return this}focus(){return this._root.focus({preventScroll:!0}),this}blur(){return this._root.blur(),this}_enableRestoreSelection(){this._willRestoreSelection=!0}_disableRestoreSelection(){this._willRestoreSelection=!1}_restoreSelection(){this._willRestoreSelection&&this.setSelection(this._lastSelection)}_removeZWS(){this._mayHaveZWS&&=(vd(this._root),!1)}_saveRangeToBookmark(e){let t=Q(`INPUT`,{id:this.startSelectionId,type:`hidden`}),n=Q(`INPUT`,{id:this.endSelectionId,type:`hidden`}),r;nf(e,t),e.collapse(!1),nf(e,n),t.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING&&(t.id=this.endSelectionId,n.id=this.startSelectionId,r=t,t=n,n=r),e.setStartAfter(t),e.setEndBefore(n)}_getRangeAndRemoveBookmark(e){let t=this._root,n=t.querySelectorAll(`#`+this.startSelectionId),r=t.querySelectorAll(`#`+this.endSelectionId),i=n[0],a=r[0];if(i&&a&&i.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_FOLLOWING){let t=i.parentNode,n=a.parentNode,r=Array.from(t.childNodes).indexOf(i),o=Array.from(n.childNodes).indexOf(a);t===n&&--o,i.remove(),a.remove(),e||=document.createRange(),e.setStart(t,r),e.setEnd(n,o),jd(t,e),t!==n&&jd(n,e),e.collapsed&&(t=e.startContainer,t instanceof Text&&(n=t.childNodes[e.startOffset],(!n||!(n instanceof Text))&&(n=t.childNodes[e.startOffset-1]),n&&n instanceof Text&&(e.setStart(n,0),e.collapse(!0))))}for(let e=0;e`:``)+e.nodeName,t&&(r+=`#`+t),a.length&&(r+=`.`,r+=a.join(`.`)),o&&(r+=`[dir=`+o+`]`),i.contains(s.highlight)&&(r+=`[backgroundColor=`+e.style.backgroundColor.replace(/ /g,``)+`]`),i.contains(s.color)&&(r+=`[color=`+e.style.color.replace(/ /g,``)+`]`),i.contains(s.fontFamily)&&(r+=`[fontFamily=`+e.style.fontFamily.replace(/ /g,``)+`]`),i.contains(s.fontSize)&&(r+=`[fontSize=`+e.style.fontSize+`]`)}}return r}modifyDocument(e){let t=this._mutation;return t&&(t.takeRecords().length&&this._docWasChanged(),t.disconnect()),this._ignoreAllChanges=!0,e(),this._ignoreAllChanges=!1,t&&(t.observe(this._root,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),this._ignoreChange=!1),this}_docWasChanged(){if(nd(),this._mayHaveZWS=!0,!this._ignoreAllChanges){if(this._ignoreChange){this._ignoreChange=!1;return}this._isInUndoState&&(this._isInUndoState=!1,this.fireEvent(`undoStateChange`,{canUndo:!0,canRedo:!1})),this.fireEvent(`input`)}}_recordUndoState(e,t){let n=this._isInUndoState;if(!n||t){let r=this._undoIndex+1,i=this._undoStack,a=this._config.undo,o=a.documentSizeThreshold,s=a.undoLimit;if(r-1&&c.length*2>o&&s>-1&&r>s&&(i.splice(0,r-s),r=s,this._undoStackLength=s),i[r]=c,this._undoIndex=r,this._undoStackLength+=1,this._isInUndoState=!0}return this}saveUndoState(e){let t=!1;return e||(e=this.getSelection(),t=!0),this._recordUndoState(e,this._isInUndoState),this._getRangeAndRemoveBookmark(e),t&&this.setSelection(e),this}undo(){if(this._undoIndex!==0||!this._isInUndoState){this._recordUndoState(this.getSelection(),!1),--this._undoIndex,this._setRawHTML(this._undoStack[this._undoIndex]);let e=this._getRangeAndRemoveBookmark();e&&this.setSelection(e),this._isInUndoState=!0,this.fireEvent(`undoStateChange`,{canUndo:this._undoIndex!==0,canRedo:!0}),this.fireEvent(`input`)}return this.focus()}redo(){let e=this._undoIndex,t=this._undoStackLength;if(e+1{e&&(t=this.getSelection(),this._saveRangeToBookmark(t));let r=this._root.querySelector(`.squire-image-resize-container`);r&&r.remove(),n=this._getRawHTML().replace(/\u200B/g,``),r&&this._root.appendChild(r),e&&this._getRangeAndRemoveBookmark(t)}),n}setHTML(e){let t=this._config.sanitizeToDOMFragment(e,this),n=this._root;Vd(t,this._config),Ud(t,n,!1),Od(t,n);let r=t,i=r.firstChild;if(!i||i.nodeName===`BR`){let e=this.createDefaultBlock();i?r.replaceChild(e,i):r.appendChild(e)}else for(;r=qd(r,n);)Dd(r);for(this._ignoreChange=!0;i=n.lastChild;)n.removeChild(i);n.appendChild(t),this._undoIndex=-1,this._undoStack.length=0,this._undoStackLength=0,this._isInUndoState=!1;let a=this._getRangeAndRemoveBookmark()||tf(n.firstElementChild||n,0);return this.saveUndoState(a),this.setSelection(a),this._updatePath(a,!0),this}insertHTML(e,t){let n=this._config,r=n.sanitizeToDOMFragment(e,this),i=this.getSelection();this.saveUndoState(i);try{let a=this._root;n.addLinks&&this.addDetectedLinks(r,r),Vd(r,this._config),Ud(r,a,!1),Hd(r),r.normalize();let o=r;for(;o=qd(o,r);)Dd(o);let s=!0;if(t){let t=new CustomEvent(`willPaste`,{cancelable:!0,detail:{html:e,fragment:r}});this.fireEvent(`willPaste`,t),r=t.detail.fragment,s=!t.defaultPrevented}s&&(sf(i,r,a),i.collapse(!1),Ed(i,`A`,a),this._ensureBottomLine()),this.setSelection(i),this._updatePath(i,!0),t&&this.focus()}catch(e){this._config.didError(e)}return this}insertElement(e,t){if(t||=this.getSelection(),t.collapse(!0),Z(e))nf(t,e),t.setStartAfter(e);else{let n=this._root,r=Yd(t,n),i=r||n,a=null;for(;i!==n&&!i.nextSibling;)i=i.parentNode;if(i!==n){let e=i.parentNode;a=kd(e,i.nextSibling,n,n)}r&&Jd(r)&&md(r),n.insertBefore(e,a);let o=this.createDefaultBlock();n.insertBefore(o,a),t.setStart(o,0),t.setEnd(o,0),wd(t)}return this.focus(),this.setSelection(t),this._updatePath(t),this}insertImage(e,t){let n=Q(`IMG`,Object.assign({src:e},t));return this.insertElement(n),n}insertPlainText(e,t){let n=this.getSelection();if(n.collapsed&&ld(n.startContainer,this._root,`PRE`)){let r=n.startContainer,i=n.startOffset,a;if(!r||!(r instanceof Text)){let e=document.createTextNode(``);r.insertBefore(e,r.childNodes[i]),a=e,i=0}else a=r;let o=!0;if(t){let t=new CustomEvent(`willPaste`,{cancelable:!0,detail:{text:e}});this.fireEvent(`willPaste`,t),e=t.detail.text,o=!t.defaultPrevented}return o&&(a.insertData(i,e),n.setStart(a,i+e.length),n.collapse(!0)),this.setSelection(n),this}let r=e.split(` +`),i=this._config,a=i.blockTag,o=i.blockAttributes,s=``,c=`<`+a;for(let e in o)c+=` `+e+`="`+Wd(o[e])+`"`;c+=`>`;for(let e=0,t=r.length;e`)+s),r[e]=t}return this.insertHTML(r.join(``),t)}getSelectedText(e){return cf(e||this.getSelection())}getFontInfo(e){let t={color:void 0,backgroundColor:void 0,fontFamily:void 0,fontSize:void 0};e||=this.getSelection(),wd(e);let n=0,r=e.commonAncestorContainer;if(e.collapsed||r instanceof Text)for(r instanceof Text&&(r=r.parentNode);n<4&&r;){let e=r.style;if(e){let r=e.color;!t.color&&r&&(t.color=r,n+=1);let i=e.backgroundColor;!t.backgroundColor&&i&&(t.backgroundColor=i,n+=1);let a=e.fontFamily;!t.fontFamily&&a&&(t.fontFamily=a,n+=1);let o=e.fontSize;!t.fontSize&&o&&(t.fontSize=o,n+=1)}r=r.parentNode}return t}hasFormat(e,t,n){e=e.toUpperCase(),t||={},n||=this.getSelection(),!n.collapsed&&n.startContainer instanceof Text&&n.startOffset===n.startContainer.length&&n.startContainer.nextSibling&&n.setStartBefore(n.startContainer.nextSibling),!n.collapsed&&n.endContainer instanceof Text&&n.endOffset===0&&n.endContainer.previousSibling&&n.setEndAfter(n.endContainer.previousSibling);let r=this._root,i=n.commonAncestorContainer;if(ld(i,r,e,t))return!0;if(i instanceof Text)return!1;let a=new zu(i,4,e=>Cd(n,e,!0)),o=!1,s;for(;s=a.nextNode();){if(!ld(s,r,e,t))return!1;o=!0}return o}changeFormat(e,t,n,r){return n||=this.getSelection(),this.saveUndoState(n),t&&(n=this._removeFormat(t.tag.toUpperCase(),t.attributes||{},n,r)),e&&(n=this._addFormat(e.tag.toUpperCase(),e.attributes||{},n)),this.setSelection(n),this._updatePath(n,!0),this.focus()}_addFormat(e,t,n){let r=this._root;if(n.collapsed){let r=Dd(Q(e,t));nf(n,r);let i=r.firstChild||r,a=i instanceof Text?i.length:0;n.setStart(i,a),n.collapse(!0);let o=r;for(;Z(o);)o=o.parentNode;vd(o,r)}else{let i=new zu(n.commonAncestorContainer,5,e=>(e instanceof Text||e.nodeName===`BR`||e.nodeName===`IMG`)&&Cd(n,e,!0)),{startContainer:a,startOffset:o,endContainer:s,endOffset:c}=n;if(i.currentNode=a,!(a instanceof Element)&&!(a instanceof Text)||!i.filter(a)){let e=i.nextNode();if(!e)return n;a=e,o=0}do{let n=i.currentNode;if(!ld(n,r,e,t)){n===s&&n.length>c&&n.splitText(c),n===a&&o&&(n=n.splitText(o),s===a?(s=n,c-=o):s===a.parentNode&&(c+=1),a=n,o=0);let r=Q(e,t);hd(n,r),r.appendChild(n)}}while(i.nextNode());n=tf(a,o,s,c)}return n}_removeFormat(e,t,n,r){this._saveRangeToBookmark(n);let i;n.collapsed&&(i=Ju?document.createTextNode(`​`):document.createTextNode(``),nf(n,i));let a=n.commonAncestorContainer;for(;Z(a);)a=a.parentNode;let o=n.startContainer,s=n.startOffset,c=n.endContainer,l=n.endOffset,u=[],d=(e,t)=>{if(Cd(n,e,!1))return;let r,i;if(!Cd(n,e,!0)){!(e instanceof HTMLInputElement)&&(!(e instanceof Text)||e.data)&&u.push([t,e]);return}if(e instanceof Text)e===c&&l!==e.length&&u.push([t,e.splitText(l)]),e===o&&s&&(e.splitText(s),u.push([t,e]));else for(r=e.firstChild;r;r=i)i=r.nextSibling,d(r,t)},f=Array.from(a.getElementsByTagName(e)).filter(r=>Cd(n,r,!0)&&cd(r,e,t));if(r||f.forEach(e=>{d(e,e)}),u.forEach(([e,t])=>{e=e.cloneNode(!1),hd(t,e),e.appendChild(t)}),f.forEach(e=>{hd(e,pd(e))}),Ju&&i){i=i.parentNode;let e=i;for(;e&&Z(e);)e=e.parentNode;e&&vd(e,i)}return this._getRangeAndRemoveBookmark(n),i&&n.collapse(!1),jd(a,n),n}bold(){return this.changeFormat({tag:`B`})}removeBold(){return this.changeFormat(null,{tag:`B`})}italic(){return this.changeFormat({tag:`I`})}removeItalic(){return this.changeFormat(null,{tag:`I`})}underline(){return this.changeFormat({tag:`U`})}removeUnderline(){return this.changeFormat(null,{tag:`U`})}strikethrough(){return this.changeFormat({tag:`S`})}removeStrikethrough(){return this.changeFormat(null,{tag:`S`})}subscript(){return this.changeFormat({tag:`SUB`},{tag:`SUP`})}removeSubscript(){return this.changeFormat(null,{tag:`SUB`})}superscript(){return this.changeFormat({tag:`SUP`},{tag:`SUB`})}removeSuperscript(){return this.changeFormat(null,{tag:`SUP`})}makeLink(e,t){let n=this.getSelection();if(n.collapsed){let t=e.indexOf(`:`)+1;if(t)for(;e[t]===`/`;)t+=1;nf(n,document.createTextNode(e.slice(t)))}return t=Object.assign({href:e},this._config.tagAttributes.a,t),this.changeFormat({tag:`A`,attributes:t},{tag:`A`},n)}removeLink(){return this.changeFormat(null,{tag:`A`},this.getSelection(),!0)}addDetectedLinks(e,t){let n=new zu(e,4,e=>!ld(e,t||this._root,`A`)),r=this.linkRegExp,i=this._config.tagAttributes.a,a;for(;a=n.nextNode();){let e=a.parentNode,t=a.data,n;for(;n=r.exec(t);){let r=n.index,o=r+n[0].length;r&&e.insertBefore(document.createTextNode(t.slice(0,r)),a);let s=Q(`A`,Object.assign({href:n[1]?/^(?:ht|f)tps?:/i.test(n[1])?n[1]:`http://`+n[1]:`mailto:`+n[0]},i));s.textContent=t.slice(r,o),e.insertBefore(s,a),a.data=t=t.slice(o)}}return this}setFontFace(e){let t=this._config.classNames.fontFamily;return this.changeFormat(e?{tag:`SPAN`,attributes:{class:t,style:`font-family: `+e+`, sans-serif;`}}:null,{tag:`SPAN`,attributes:{class:t}})}setFontSize(e){let t=this._config.classNames.fontSize;return this.changeFormat(e?{tag:`SPAN`,attributes:{class:t,style:`font-size: `+(typeof e==`number`?e+`px`:e)}}:null,{tag:`SPAN`,attributes:{class:t}})}setTextColor(e){let t=this._config.classNames.color;return this.changeFormat(e?{tag:`SPAN`,attributes:{class:t,style:`color:`+e}}:null,{tag:`SPAN`,attributes:{class:t}})}setHighlightColor(e){let t=this._config.classNames.highlight;return this.changeFormat(e?{tag:`SPAN`,attributes:{class:t,style:`background-color:`+e}}:null,{tag:`SPAN`,attributes:{class:t}})}_ensureBottomLine(){let e=this._root,t=e.lastElementChild;(!t||t.nodeName!==this._config.blockTag||!ad(t))&&e.appendChild(this.createDefaultBlock())}createDefaultBlock(e){let t=this._config;return Dd(Q(t.blockTag,t.blockAttributes,e))}splitBlock(e,t){t||=this.getSelection();let n=this._root,r,i,a,o;if(this._recordUndoState(t),this._removeZWS(),this._getRangeAndRemoveBookmark(t),t.collapsed||of(t,n),this._config.addLinks){wd(t);let e=t.startContainer,n=t.startOffset;setTimeout(()=>{yf(this,e,n)},0)}if(r=Yd(t,n),r&&(i=ld(r,n,`PRE`))){wd(t),a=t.startContainer;let r=t.startOffset;return a instanceof Text||(a=document.createTextNode(``),i.insertBefore(a,i.firstChild),r=0),!e&&a instanceof Text&&(a.data.charAt(r-1)===` +`||Qd(t,n))&&(a.data.charAt(r)===` +`||$d(t,n))?(a.deleteData(r&&r-1,r?2:1),o=kd(a,r&&r-1,n,n),a=o.previousSibling,a.textContent||md(a),a=this.createDefaultBlock(),o.parentNode.insertBefore(a,o),o.textContent||md(o),t.setStart(a,0)):(a.insertData(r,` +`),a.nextSibling||i.appendChild(Q(`BR`)),a.length===r+1?t.setStartAfter(a):t.setStart(a,r+1)),t.collapse(!0),this.setSelection(t),this._updatePath(t,!0),this._docWasChanged(),this}if(!r||e||/^T[HD]$/.test(r.nodeName))return Ed(t,`A`,n),nf(t,Q(`BR`)),t.collapse(!1),this.setSelection(t),this._updatePath(t,!0),this;if((i=ld(r,n,`LI`))&&(r=i),Jd(r)){if(ld(r,n,`UL`)||ld(r,n,`OL`))return this.decreaseListLevel(t),this;if(ld(r,n,`BLOCKQUOTE`))return this.replaceWithBlankLine(t),this}a=t.startContainer;let s=t.startOffset,c=this.tagAfterSplit[r.nodeName];o=kd(a,s,r.parentNode,this._root);let l=this._config,u=null;for(c||(c=l.blockTag,u=l.blockAttributes),cd(o,c,u)||(r=Q(c,u),o.dir&&(r.dir=o.dir),hd(o,r),r.appendChild(pd(o)),o=r),vd(r),Hd(r),Dd(r);o instanceof Element;){let e=o.firstChild,t;if(o.nodeName===`A`&&(!o.textContent||o.textContent===`​`)){e=document.createTextNode(``),hd(o,e),o=e;break}for(;e&&e instanceof Text&&!e.data&&(t=e.nextSibling,!(!t||t.nodeName===`BR`));)md(e),e=t;if(!e||e.nodeName===`BR`||e instanceof Text)break;o=e}return t=tf(o,0),this.setSelection(t),this._updatePath(t,!0),this}forEachBlock(e,t,n){n||=this.getSelection(),t&&this.saveUndoState(n);let r=this._root,i=Yd(n,r),a=Xd(n,r);if(i&&a)do if(e(i)||i===a)break;while(i=qd(i,r));return t&&(this.setSelection(n),this._updatePath(n,!0)),this}modifyBlocks(e,t){t||=this.getSelection(),this._recordUndoState(t,this._isInUndoState);let n=this._root;ef(t,n),Td(t,n,n,n);let r=rf(t,n,n);if(!t.collapsed){let e=t.endContainer;if(e===n)t.collapse(!1);else{for(;e.parentNode!==n;)e=e.parentNode;t.setStartBefore(e),t.collapse(!0)}}return nf(t,e.call(this,r)),t.endOffset{let n=t.className.split(/\s+/).filter(e=>!!e&&!/^align/.test(e)).join(` `);e?(t.className=n+` align-`+e,t.style.textAlign=e):(t.className=n,t.style.textAlign=``)},!0),this.focus()}setTextDirection(e){return this.forEachBlock(t=>{e?t.dir=e:t.removeAttribute(`dir`)},!0),this.focus()}_getListSelection(e,t){let n=e.commonAncestorContainer,r=e.startContainer,i=e.endContainer;for(;n&&n!==t&&!/^[OU]L$/.test(n.nodeName);)n=n.parentNode;if(!n||n===t)return null;for(r===n&&(r=r.childNodes[e.startOffset]),i===n&&(i=i.childNodes[e.endOffset]);r&&r.parentNode!==n;)r=r.parentNode;for(;i&&i.parentNode!==n;)i=i.parentNode;return[n,r,i]}increaseListLevel(e){e||=this.getSelection();let t=this._root,n=this._getListSelection(e,t);if(!n)return this.focus();let[r,i,a]=n;if(!i||i===r.firstChild)return this.focus();this._recordUndoState(e,this._isInUndoState);let o=r.nodeName,s=i.previousSibling,c,l;s.nodeName!==o&&(c=this._config.tagAttributes[o.toLowerCase()],s=Q(o,c),r.insertBefore(s,i));do l=i===a?null:i.nextSibling,s.appendChild(i);while(i=l);return l=s.nextSibling,l&&Nd(l,t),this._getRangeAndRemoveBookmark(e),this.setSelection(e),this._updatePath(e,!0),this.focus()}decreaseListLevel(e){e||=this.getSelection();let t=this._root,n=this._getListSelection(e,t);if(!n)return this.focus();let[r,i,a]=n;i||=r.firstChild,a||=r.lastChild,this._recordUndoState(e,this._isInUndoState);let o,s=null;if(i){let e=r.parentNode;if(s=a.nextSibling?kd(r,a.nextSibling,e,t):r.nextSibling,e!==t&&e.nodeName===`LI`){for(e=e.parentNode;s;)o=s.nextSibling,a.appendChild(s),s=o;s=r.parentNode.nextSibling}let n=!/^[OU]L$/.test(e.nodeName);do o=i===a?null:i.nextSibling,r.removeChild(i),n&&i.nodeName===`LI`&&(i=this.createDefaultBlock([pd(i)])),e.insertBefore(i,s);while(i=o)}return r.firstChild||md(r),s&&Nd(s,t),this._getRangeAndRemoveBookmark(e),this.setSelection(e),this._updatePath(e,!0),this.focus()}_makeList(e,t){let n=Gd(e,this._root),r=this._config.tagAttributes,i=r[t.toLowerCase()],a=r.li,o;for(;o=n.nextNode();)if(o.parentNode instanceof HTMLLIElement&&(o=o.parentNode,n.currentNode=o.lastChild),o instanceof HTMLLIElement){o=o.parentNode;let e=o.nodeName;e!==t&&/^[OU]L$/.test(e)&&hd(o,Q(t,i,[pd(o)]))}else{let e=Q(`LI`,a);o.dir&&(e.dir=o.dir);let r=o.previousSibling;r&&r.nodeName===t?(r.appendChild(e),md(o)):hd(o,Q(t,i,[e])),e.appendChild(pd(o)),n.currentNode=e}return e}makeUnorderedList(){return this.modifyBlocks(e=>this._makeList(e,`UL`)),this.focus()}makeOrderedList(){return this.modifyBlocks(e=>this._makeList(e,`OL`)),this.focus()}removeList(){return this.modifyBlocks(e=>{let t=e.querySelectorAll(`UL, OL`),n=e.querySelectorAll(`LI`),r=this._root;for(let e=0,n=t.length;eQ(`BLOCKQUOTE`,this._config.tagAttributes.blockquote,[e]),e),this.focus()}decreaseQuoteLevel(e){return this.modifyBlocks(e=>(Array.from(e.querySelectorAll(`blockquote`)).filter(t=>!ld(t.parentNode,e,`BLOCKQUOTE`)).forEach(e=>{hd(e,pd(e))}),e),e),this.focus()}removeQuote(e){return this.modifyBlocks(e=>(Array.from(e.querySelectorAll(`blockquote`)).forEach(e=>{hd(e,pd(e))}),e),e),this.focus()}replaceWithBlankLine(e){return this.modifyBlocks(()=>this.createDefaultBlock([Q(`INPUT`,{id:this.startSelectionId,type:`hidden`}),Q(`INPUT`,{id:this.endSelectionId,type:`hidden`})]),e),this.focus()}code(){let e=this.getSelection();return e.collapsed||od(e.commonAncestorContainer)?(this.modifyBlocks(e=>{let t=this._root,n=document.createDocumentFragment(),r=Gd(e,t),i;for(;i=r.nextNode();){let e=i.querySelectorAll(`BR`),t=[],r=e.length;for(let n=0;n{let t=this._root,n=e.querySelectorAll(`PRE`),r=n.length;for(;r--;){let e=n[r],i=new zu(e,4),a;for(;a=i.nextNode();){let e=a.data;e=e.replace(/ (?= )/g,`\xA0`);let t=document.createDocumentFragment(),n;for(;(n=e.indexOf(` +`))>-1;)t.appendChild(document.createTextNode(e.slice(0,n))),t.appendChild(Q(`BR`)),e=e.slice(n+1);a.parentNode.insertBefore(t,a),a.data=e}Od(e,t),hd(e,pd(e))}return e},e),this.focus()):this.changeFormat(null,{tag:`CODE`},e),this}toggleCode(){return this.hasFormat(`PRE`)||this.hasFormat(`CODE`)?this.removeCode():this.code(),this}_removeFormatting(e,t){for(let n=e.firstChild,r;n;n=r){if(r=n.nextSibling,Z(n)){if(n instanceof Text||n.nodeName===`BR`||n.nodeName===`IMG`){t.appendChild(n);continue}}else if(ad(n)){t.appendChild(this.createDefaultBlock([this._removeFormatting(n,document.createDocumentFragment())]));continue}this._removeFormatting(n,t)}return t}removeAllFormatting(e){if(e||=this.getSelection(),e.collapsed)return this.focus();let t=this._root,n=e.commonAncestorContainer;for(;n&&!ad(n);)n=n.parentNode;if(n||=(ef(e,t),t),n instanceof Text)return this.focus();this.saveUndoState(e),Td(e,n,n,t);let r=e.startContainer,i=e.startOffset,a=e.endContainer,o=e.endOffset,s=document.createDocumentFragment(),c=document.createDocumentFragment(),l=kd(a,o,n,t),u=kd(r,i,n,t),d;for(;u!==l;)d=u.nextSibling,s.appendChild(u),u=d;if(this._removeFormatting(s,c),c.normalize(),u=c.firstChild,d=c.lastChild,u){n.insertBefore(c,l);let e=Array.from(n.childNodes);i=e.indexOf(u),o=d?e.indexOf(d)+1:0}else l&&(i=Array.from(n.childNodes).indexOf(l),o=i);return e.setStart(n,i),e.setEnd(n,o),jd(n,e),wd(e),this.setSelection(e),this._updatePath(e,!0),this.focus()}},Ff={ADD_DATA_URI_TAGS:[`img`],ALLOW_UNKNOWN_PROTOCOLS:!0,FORCE_BODY:!1,RETURN_DOM:!0,RETURN_DOM_FRAGMENT:!0,WHOLE_DOCUMENT:!1};function If(e){let t=ns.sanitize(e,Ff);return t?document.importNode(t,!0):document.createDocumentFragment()}var Lf=new Set(`ADDRESS.ARTICLE.ASIDE.BLOCKQUOTE.DD.DIV.DL.DT.FIGCAPTION.FIGURE.FOOTER.H1.H2.H3.H4.H5.H6.HEADER.LI.OL.P.PRE.SECTION.TABLE.TBODY.TD.TFOOT.TH.THEAD.TR.UL`.split(`.`));function Rf(e){let t=``,n=()=>{t&&!t.endsWith(` +`)&&(t+=` +`)},r=e=>{if(e.nodeType===Node.TEXT_NODE){t+=e.nodeValue??``;return}if(e.nodeType!==Node.ELEMENT_NODE&&e.nodeType!==Node.DOCUMENT_FRAGMENT_NODE)return;if(e.nodeName===`BR`){t+=` +`;return}let i=e.nodeType===Node.ELEMENT_NODE&&Lf.has(e.nodeName);i&&n(),e.childNodes.forEach(r),i&&n()};return e.childNodes.forEach(r),t.replace(/\n+$/u,``)}var zf=`14px`,Bf=`#e5e7eb`,$=`#fef3c7`,Vf=[`style`,`font`,`insert`,`lists`,`alignment`],Hf=new Set(`ADDRESS.ARTICLE.ASIDE.BLOCKQUOTE.DD.DIV.DL.DT.FIGURE.FIGCAPTION.FOOTER.H1.H2.H3.H4.H5.H6.HEADER.LI.OL.P.PRE.SECTION.TABLE.TBODY.TD.TFOOT.TH.THEAD.TR.UL`.split(`.`)),Uf=[{label:`Sans`,value:`Arial, sans-serif`},{label:`Serif`,value:`Georgia, serif`},{label:`Mono`,value:`"Courier New", monospace`},{label:`Verdana`,value:`Verdana, sans-serif`},{label:`Times`,value:`"Times New Roman", serif`}],Wf=[{label:`Small`,value:`12px`},{label:`Normal`,value:zf},{label:`Large`,value:`18px`},{label:`Huge`,value:`24px`}],Gf=[{label:`Default`,value:``},...Uf],Kf=[{label:`Align left`,value:`left`,icon:Fe},{label:`Align center`,value:`center`,icon:Ne},{label:`Align right`,value:`right`,icon:Me},{label:`Align justify`,value:`justify`,icon:Pe}],qf=`button, summary, input, select`,Jf={bold:!1,italic:!1,underline:!1,strikethrough:!1,subscript:!1,superscript:!1,code:!1,link:!1,unorderedList:!1,orderedList:!1,quote:!1,canUndo:!1,canRedo:!1,fontFamily:``,fontSize:zf,textColor:Bf,highlightColor:$,alignment:`left`,direction:`ltr`};function Yf(e,t){if(/^#[0-9a-f]{6}$/i.test(e||``))return e;let n=(e||``).match(/^rgb\(\s*(\d+),\s*(\d+),\s*(\d+)\s*\)$/i);return n?`#${n.slice(1).map(e=>Number(e).toString(16).padStart(2,`0`)).join(``)}`:t}function Xf(e){let t=(e||``).split(`,`)[0].replace(/["']/g,``).trim().toLowerCase();return Uf.find(e=>e.value.split(`,`)[0].replace(/["']/g,``).trim().toLowerCase()===t)?.value||``}function Zf(e){if(!e)return null;let t=e=>{let t=e instanceof Element?e:e.parentElement;return t&&getComputedStyle(t).fontSize||zf},n=e.commonAncestorContainer;if(e.collapsed||n instanceof Text)return t(e.startContainer);let r=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT),i=null,a;for(;a=r.nextNode();){if(!(a instanceof Text)&&a.nodeName!==`BR`&&a.nodeName!==`IMG`||!e.intersectsNode(a)||a instanceof Text&&(!a.length||a===e.startContainer&&e.startOffset===a.length||a===e.endContainer&&e.endOffset===0))continue;let n=t(a);if(i!==null&&i!==n)return null;i=n}return i}function Qf(e,t){return RegExp(`(?:^|>)${t}(?:$|[.#\\[])`).test(e)||RegExp(`(?:^|>)${t}(?:>|$)`).test(e)}function $f(e){if(!e)return 0;let t=window.getComputedStyle(e);return(e.getBoundingClientRect().width||(e instanceof HTMLElement?e.offsetWidth:0))+Number.parseFloat(t.marginLeft||`0`)+Number.parseFloat(t.marginRight||`0`)}var ep=(0,C.forwardRef)(function({contentKey:e,initialHtml:t,accessibleLabel:n=`Rich text editor`,onUpdate:r},i){let a=(0,C.useRef)(null),o=(0,C.useRef)(null),s=(0,C.useRef)(null),c=(0,C.useRef)(null),l=(0,C.useRef)(null),u=(0,C.useRef)(new Map),d=(0,C.useRef)(null),f=(0,C.useRef)(r);f.current=r;let[p,m]=(0,C.useState)(Jf),h=(0,C.useRef)(p);h.current=p;let[g,_]=(0,C.useState)([...Vf]),[v,y]=(0,C.useState)({open:!1,hasLink:!1,url:``,error:null}),b=Dr(),x=Or(),S=(0,C.useCallback)(()=>{let e=c.current,t=a.current;return!e||!t?{html:``,text:``}:{html:e.getHTML(),text:Rf(t).replace(/​/gu,``).replace(/\n+$/u,``)}},[]),w=(0,C.useCallback)(()=>{try{l.current=c.current?.getSelection().cloneRange()??null}catch{l.current=null}},[]),T=(0,C.useCallback)(()=>{let e=c.current;if(!(!e||!l.current))try{e.setSelection(l.current)}catch{l.current=null}},[]),E=(0,C.useCallback)((e=null)=>{let t=c.current;if(!t)return;let n=null;try{n=t.getSelection()}catch{n=null}let r=e??t.getPath(),i=e=>r&&r!==`(selection)`?Qf(r,e):!!n&&!!t.hasFormat(e,null,n),a=n?t.getFontInfo(n):{},o=null,s=null,l=!1;n&&t.forEachBlock(e=>{let t=getComputedStyle(e),n=t.direction===`rtl`?`rtl`:`ltr`,r=t.textAlign.replace(/^-(?:moz|webkit)-/,``),i=r;return!r||r===`start`||r===`auto`?i=n===`rtl`?`right`:`left`:r===`end`&&(i=n===`rtl`?`left`:`right`),o=!l||o===i?i:null,s=!l||s===n?n:null,l=!0,o===null&&s===null},!1,n);let u=h.current;m({...u,bold:i(`B`),italic:i(`I`),underline:i(`U`),strikethrough:i(`S`),subscript:i(`SUB`),superscript:i(`SUP`),code:i(`CODE`)||i(`PRE`),link:i(`A`),unorderedList:i(`UL`),orderedList:i(`OL`),quote:/(?:^|>)BLOCKQUOTE/.test(r),fontFamily:Xf(a.fontFamily),fontSize:Zf(n),textColor:Yf(a.color,u.textColor||Bf),highlightColor:Yf(a.backgroundColor,u.highlightColor||$),alignment:o,direction:s})},[]),D=(0,C.useCallback)(()=>{f.current(S())},[S]),ee=(0,C.useCallback)(()=>{let e=c.current;if(!e)return;let t=e.getRoot(),n=null;Array.from(t.childNodes).forEach(e=>{if(!(!(e.nodeType===Node.ELEMENT_NODE&&Hf.has(e.nodeName))&&(e.nodeType===Node.TEXT_NODE?e.data.length>0:e.nodeType===Node.ELEMENT_NODE))){n=null;return}n||(n=document.createElement(`div`),t.insertBefore(n,e)),n.appendChild(e)})},[]),k=(0,C.useCallback)((e,{restore:t=!0}={})=>{let n=c.current;n&&(t&&(n.focus(),T()),ee(),e(n),D(),w(),E(),t&&n.focus())},[ee,w,T,D,E]),A=(0,C.useCallback)((e,t,n=null,r=e.getSelection())=>{ee(),e.hasFormat(t,null,r)?e.changeFormat(null,{tag:t},r):e.changeFormat({tag:t},n,r)},[ee]),ne=(e,t=null)=>{k(n=>A(n,e,t,n.getSelection()))},re=e=>{k(t=>{t.hasFormat(e)?t.removeList():e===`UL`?t.makeUnorderedList():t.makeOrderedList()})},ie=e=>{k(t=>e>0?t.increaseQuoteLevel():t.decreaseQuoteLevel())},ae=(0,C.useCallback)(e=>{let t=c.current;if(!t)return;w(),e&&Wr(e);let n=(l.current??t.getSelection()).startContainer,r=(n.nodeType===Node.ELEMENT_NODE?n:n.parentElement)?.closest(`a`),i=t.getSelectedText().trim();y({open:!0,hasLink:r!==null,url:r?.getAttribute(`href`)??(/^https?:\/\//i.test(i)||/^mailto:/i.test(i)?i:``),error:null}),requestAnimationFrame(()=>{s.current?.focus(),s.current?.select()})},[w]);(0,C.useLayoutEffect)(()=>{let e=a.current;if(!e)return;let n=new Pf(e,{sanitizeToDOMFragment:If});c.current=n,n.setHTML(t||`


`);let r=()=>{D(),w(),E()},i=e=>{w(),E(e.detail?.path??null)},o=()=>{w(),E()};n.addEventListener(`input`,r),n.addEventListener(`pathChange`,i),n.addEventListener(`select`,o),n.addEventListener(`cursor`,o),n.addEventListener(`undoStateChange`,e=>{let t=e.detail;m(e=>({...e,canUndo:!!t?.canUndo,canRedo:!!t?.canRedo}))});let s=(e,t)=>{n.setKeyHandler(e,(e,n,r)=>{n.preventDefault(),t(e,r),ee(),D(),l.current=r.cloneRange(),E()})};return[`Ctrl-b`,`Ctrl-B`,`Meta-b`,`Meta-B`].forEach(e=>s(e,(e,t)=>A(e,`B`,null,t))),[`Ctrl-i`,`Ctrl-I`,`Meta-i`,`Meta-I`].forEach(e=>s(e,(e,t)=>A(e,`I`,null,t))),[`Ctrl-u`,`Ctrl-U`,`Meta-u`,`Meta-U`].forEach(e=>s(e,(e,t)=>A(e,`U`,null,t))),[`Ctrl-z`,`Meta-z`].forEach(e=>s(e,e=>e.undo())),[`Ctrl-y`,`Meta-y`,`Ctrl-Shift-z`,`Ctrl-Shift-Z`,`Meta-Shift-z`,`Meta-Shift-Z`].forEach(e=>s(e,e=>e.redo())),[`Ctrl-k`,`Meta-k`].forEach(e=>{n.setKeyHandler(e,(e,t,n)=>{t.preventDefault(),l.current=n.cloneRange(),ae()})}),D(),E(),()=>{n.destroy(),c.current=null,l.current=null}},[e]),(0,C.useImperativeHandle)(i,()=>({focus:()=>c.current?.focus(),getContent:S}),[S]);let oe=(0,C.useCallback)(()=>{let e=o.current;if(!e)return;e.querySelectorAll(`[data-toolbar-group]`).forEach(e=>{let t=e.dataset.toolbarGroup,n=$f(e);t&&n>0&&u.current.set(t,n)});let t=e.clientWidth||e.getBoundingClientRect().width;if(!t)return;let n=$f(e.querySelector(`.toolbar-more`))||70,r=[...Vf],i=()=>n+r.length*4+r.reduce((e,t)=>e+(u.current.get(t)??0),0);for(;r.length>1&&i()>t;)r.pop();_(e=>e.join(`|`)===r.join(`|`)?e:r)},[]);(0,C.useLayoutEffect)(()=>{oe();let e=o.current;if(!e)return;let t=new ResizeObserver(()=>oe());return t.observe(e),window.addEventListener(`resize`,oe),()=>{t.disconnect(),window.removeEventListener(`resize`,oe)}},[oe]);let se=(0,C.useCallback)(()=>{let e=o.current;return e?[...e.querySelectorAll(qf)].filter(e=>!e.closest(`.app-dropdown__menu`)):[]},[]),j=(0,C.useCallback)(()=>{let e=se();(!d.current||!e.includes(d.current))&&(d.current=e[0]??null),e.forEach(e=>{let t=e===d.current?0:-1;e.tabIndex!==t&&(e.tabIndex=t)})},[se]);(0,C.useLayoutEffect)(()=>{j()});function ce(e){let t=e.target;!(t instanceof HTMLElement)||!se().includes(t)||(d.current=t,j())}function de(e){let t=se(),n=t.indexOf(e.target);if(n===-1)return;let r;switch(e.key){case`ArrowRight`:r=(n+1)%t.length;break;case`ArrowLeft`:r=(n-1+t.length)%t.length;break;case`Home`:r=0;break;case`End`:r=t.length-1;break;default:return}e.preventDefault(),t[r].focus()}(0,C.useEffect)(()=>{y({open:!1,hasLink:!1,url:``,error:null})},[e]);function he(e){e.preventDefault();let t=v.url.trim(),n=!1;try{let e=new URL(t).protocol.toLowerCase();n=e===`http:`||e===`https:`||e===`mailto:`}catch{n=!1}if(!n){y(e=>({...e,error:`Enter an HTTP, HTTPS, or mailto URL.`})),s.current?.focus();return}k(e=>e.makeLink(t)),y(e=>({...e,open:!1,error:null}))}function ge(){y(e=>({...e,open:!1,error:null})),c.current?.focus(),T()}let _e=e=>g.includes(e),N=e=>e.preventDefault(),P=Uf.find(e=>e.value===p.fontFamily)?.label??`Font`,ve=Wf.find(e=>e.value===p.fontSize)?.label??`Size`,ye=e=>e?(0,B.jsx)(te,{size:15,"aria-hidden":`true`}):(0,B.jsx)(`span`,{"aria-hidden":`true`});return(0,B.jsxs)(`div`,{className:`rich-text-editor`,children:[(0,B.jsxs)(`div`,{ref:o,className:`compose-toolbar`,role:`toolbar`,"aria-label":`Rich text formatting`,onPointerDownCapture:w,onFocus:ce,onKeyDown:de,children:[_e(`style`)?(0,B.jsxs)(`div`,{className:`toolbar-group`,"data-toolbar-group":`style`,children:[(0,B.jsx)(`button`,{type:`button`,className:`toolbar-button${p.bold?` active`:``}`,"aria-label":`Bold`,"aria-keyshortcuts":`${x}+B`,title:`Bold (${b}+B)`,onMouseDown:N,onClick:()=>ne(`B`),children:(0,B.jsx)(O,{size:15})}),(0,B.jsx)(`button`,{type:`button`,className:`toolbar-button${p.italic?` active`:``}`,"aria-label":`Italic`,"aria-keyshortcuts":`${x}+I`,title:`Italic (${b}+I)`,onMouseDown:N,onClick:()=>ne(`I`),children:(0,B.jsx)(ue,{size:15})}),(0,B.jsx)(`button`,{type:`button`,className:`toolbar-button${p.underline?` active`:``}`,"aria-label":`Underline`,"aria-keyshortcuts":`${x}+U`,title:`Underline (${b}+U)`,onMouseDown:N,onClick:()=>ne(`U`),children:(0,B.jsx)(Le,{size:15})}),(0,B.jsx)(`button`,{type:`button`,className:`toolbar-button${p.strikethrough?` active`:``}`,"aria-label":`Strikethrough`,title:`Strikethrough`,onMouseDown:N,onClick:()=>ne(`S`),children:(0,B.jsx)(ke,{size:15})})]}):null,_e(`font`)?(0,B.jsxs)(`div`,{className:`toolbar-group`,"data-toolbar-group":`font`,children:[(0,B.jsxs)(Gr,{className:`toolbar-dropdown`,children:[(0,B.jsx)(`summary`,{className:`app-dropdown__summary toolbar-button toolbar-more__summary`,"aria-label":`Font family`,title:`Font family`,onMouseDown:N,children:P}),(0,B.jsx)(`div`,{className:`app-dropdown__menu toolbar-more__menu`,role:`menu`,"aria-label":`Font family`,children:Gf.map(e=>(0,B.jsxs)(`button`,{type:`button`,className:`app-dropdown__item toolbar-menu-button`,role:`menuitemradio`,"aria-checked":p.fontFamily===e.value,onMouseDown:N,onClick:t=>{Wr(t),k(t=>t.setFontFace(e.value||null))},children:[ye(p.fontFamily===e.value),(0,B.jsx)(`span`,{style:e.value?{fontFamily:e.value}:void 0,children:e.label})]},e.value))})]}),(0,B.jsxs)(Gr,{className:`toolbar-dropdown`,children:[(0,B.jsx)(`summary`,{className:`app-dropdown__summary toolbar-button toolbar-more__summary`,"aria-label":`Font size`,title:`Font size`,onMouseDown:N,children:ve}),(0,B.jsx)(`div`,{className:`app-dropdown__menu toolbar-more__menu`,role:`menu`,"aria-label":`Font size`,children:Wf.map(e=>(0,B.jsxs)(`button`,{type:`button`,className:`app-dropdown__item toolbar-menu-button`,role:`menuitemradio`,"aria-checked":p.fontSize===e.value,onMouseDown:N,onClick:t=>{Wr(t),k(t=>t.setFontSize(e.value||null))},children:[ye(p.fontSize===e.value),(0,B.jsx)(`span`,{children:e.label})]},e.value))})]}),(0,B.jsxs)(`label`,{className:`toolbar-color`,title:`Text color`,children:[(0,B.jsx)(`span`,{children:`A`}),(0,B.jsx)(`input`,{type:`color`,value:p.textColor,"aria-label":`Text color`,onMouseDown:w,onChange:e=>k(t=>t.setTextColor(e.target.value||null))})]}),(0,B.jsxs)(`label`,{className:`toolbar-color`,title:`Highlight color`,children:[(0,B.jsx)(M,{size:15}),(0,B.jsx)(`input`,{type:`color`,value:p.highlightColor,"aria-label":`Highlight color`,onMouseDown:w,onChange:e=>k(t=>t.setHighlightColor(e.target.value||null))})]})]}):null,_e(`insert`)?(0,B.jsxs)(`div`,{className:`toolbar-group`,"data-toolbar-group":`insert`,children:[(0,B.jsx)(`button`,{type:`button`,className:`toolbar-button`,"aria-label":`Insert image`,title:`Insert image`,onMouseDown:N,children:(0,B.jsx)(le,{size:15})}),(0,B.jsx)(`button`,{type:`button`,className:`toolbar-button${p.link?` active`:``}`,"aria-label":`Insert or remove link`,"aria-keyshortcuts":`${x}+K`,title:`Insert or remove link (${b}+K)`,onMouseDown:N,onClick:()=>ae(),children:(0,B.jsx)(fe,{size:15})})]}):null,_e(`lists`)?(0,B.jsxs)(`div`,{className:`toolbar-group`,"data-toolbar-group":`lists`,children:[(0,B.jsx)(`button`,{type:`button`,className:`toolbar-button${p.unorderedList?` active`:``}`,"aria-label":`Bulleted list`,title:`Bulleted list`,onMouseDown:N,onClick:()=>re(`UL`),children:(0,B.jsx)(me,{size:15})}),(0,B.jsx)(`button`,{type:`button`,className:`toolbar-button${p.orderedList?` active`:``}`,"aria-label":`Numbered list`,title:`Numbered list`,onMouseDown:N,onClick:()=>re(`OL`),children:(0,B.jsx)(pe,{size:15})}),(0,B.jsx)(`button`,{type:`button`,className:`toolbar-button${p.quote?` active`:``}`,"aria-label":`Quote`,title:`Quote`,onMouseDown:N,onClick:()=>ie(1),children:(0,B.jsx)(be,{size:15,className:`icon-mirrored`})}),(0,B.jsx)(`button`,{type:`button`,className:`toolbar-button`,"aria-label":`Unquote`,title:`Unquote`,onMouseDown:N,onClick:()=>ie(-1),children:(0,B.jsx)(be,{size:15})})]}):null,_e(`alignment`)?(0,B.jsx)(`div`,{className:`toolbar-group`,"data-toolbar-group":`alignment`,children:Kf.map(e=>{let t=e.icon;return(0,B.jsx)(`button`,{type:`button`,className:`toolbar-button`,"aria-label":e.label,title:e.label,onMouseDown:N,onClick:()=>k(t=>t.setTextAlignment(e.value)),children:(0,B.jsx)(t,{size:15})},e.value)})}):null,(0,B.jsxs)(Gr,{className:`toolbar-more`,children:[(0,B.jsx)(`summary`,{className:`app-dropdown__summary toolbar-button toolbar-more__summary`,onMouseDown:N,children:`More`}),(0,B.jsxs)(`div`,{className:`app-dropdown__menu toolbar-more__menu`,role:`menu`,"aria-label":`More formatting options`,children:[_e(`font`)?null:(0,B.jsxs)(`div`,{className:`toolbar-menu-section`,role:`group`,"aria-label":`Font formatting`,children:[(0,B.jsx)(`span`,{className:`app-dropdown__heading toolbar-menu-heading`,"aria-hidden":`true`,children:`Font`}),Gf.map(e=>(0,B.jsxs)(`button`,{type:`button`,className:`app-dropdown__item toolbar-menu-button`,role:`menuitemradio`,"aria-checked":p.fontFamily===e.value,"aria-label":`Font: ${e.label}`,onMouseDown:N,onClick:()=>k(t=>t.setFontFace(e.value||null)),children:[ye(p.fontFamily===e.value),(0,B.jsx)(`span`,{style:e.value?{fontFamily:e.value}:void 0,children:e.label})]},`font-${e.value}`)),(0,B.jsx)(`span`,{className:`app-dropdown__heading toolbar-menu-heading`,"aria-hidden":`true`,children:`Size`}),Wf.map(e=>(0,B.jsxs)(`button`,{type:`button`,className:`app-dropdown__item toolbar-menu-button`,role:`menuitemradio`,"aria-checked":p.fontSize===e.value,"aria-label":`Size: ${e.label}`,onMouseDown:N,onClick:()=>k(t=>t.setFontSize(e.value||null)),children:[ye(p.fontSize===e.value),(0,B.jsx)(`span`,{children:e.label})]},`size-${e.value}`)),(0,B.jsxs)(`label`,{className:`toolbar-menu-field`,children:[(0,B.jsx)(`span`,{children:`Text color`}),(0,B.jsx)(`input`,{type:`color`,value:p.textColor,"aria-label":`Text color`,onMouseDown:w,onChange:e=>k(t=>t.setTextColor(e.target.value||null))})]}),(0,B.jsxs)(`label`,{className:`toolbar-menu-field`,children:[(0,B.jsx)(`span`,{children:`Highlight`}),(0,B.jsx)(`input`,{type:`color`,value:p.highlightColor,"aria-label":`Highlight color`,onMouseDown:w,onChange:e=>k(t=>t.setHighlightColor(e.target.value||null))})]})]}),_e(`insert`)?null:(0,B.jsxs)(`div`,{className:`toolbar-menu-section`,role:`group`,"aria-label":`Insert`,children:[(0,B.jsxs)(`button`,{type:`button`,className:`app-dropdown__item toolbar-menu-button`,role:`menuitem`,onMouseDown:N,children:[(0,B.jsx)(le,{size:15}),(0,B.jsx)(`span`,{children:`Insert image`})]}),(0,B.jsxs)(`button`,{type:`button`,className:`app-dropdown__item toolbar-menu-button`,role:`menuitem`,"aria-label":`Insert or remove link`,onMouseDown:N,onClick:e=>ae(e),children:[(0,B.jsx)(fe,{size:15}),(0,B.jsx)(`span`,{children:`Link`})]})]}),_e(`lists`)?null:(0,B.jsxs)(`div`,{className:`toolbar-menu-section`,role:`group`,"aria-label":`Lists and quoting`,children:[(0,B.jsxs)(`button`,{type:`button`,className:`app-dropdown__item toolbar-menu-button`,role:`menuitemcheckbox`,"aria-checked":p.unorderedList,onMouseDown:N,onClick:()=>re(`UL`),children:[ye(p.unorderedList),(0,B.jsx)(`span`,{children:`Bulleted list`})]}),(0,B.jsxs)(`button`,{type:`button`,className:`app-dropdown__item toolbar-menu-button`,role:`menuitemcheckbox`,"aria-checked":p.orderedList,onMouseDown:N,onClick:()=>re(`OL`),children:[ye(p.orderedList),(0,B.jsx)(`span`,{children:`Numbered list`})]}),(0,B.jsxs)(`button`,{type:`button`,className:`app-dropdown__item toolbar-menu-button`,role:`menuitem`,onMouseDown:N,onClick:()=>ie(1),children:[(0,B.jsx)(be,{size:15,className:`icon-mirrored`}),(0,B.jsx)(`span`,{children:`Quote`})]}),(0,B.jsxs)(`button`,{type:`button`,className:`app-dropdown__item toolbar-menu-button`,role:`menuitem`,onMouseDown:N,onClick:()=>ie(-1),children:[(0,B.jsx)(be,{size:15}),(0,B.jsx)(`span`,{children:`Unquote`})]})]}),_e(`alignment`)?null:(0,B.jsx)(`div`,{className:`toolbar-menu-section`,role:`group`,"aria-label":`Alignment`,children:Kf.map(e=>(0,B.jsxs)(`button`,{type:`button`,className:`app-dropdown__item toolbar-menu-button`,role:`menuitemradio`,"aria-checked":p.alignment===e.value,onMouseDown:N,onClick:()=>k(t=>t.setTextAlignment(e.value)),children:[ye(p.alignment===e.value),(0,B.jsx)(`span`,{children:e.label})]},e.value))}),(0,B.jsxs)(`div`,{className:`toolbar-menu-section`,role:`group`,"aria-label":`More formatting`,children:[(0,B.jsxs)(`button`,{type:`button`,className:`app-dropdown__item toolbar-menu-button`,role:`menuitemradio`,"aria-checked":p.direction===`ltr`,onMouseDown:N,onClick:()=>k(e=>e.setTextDirection(`ltr`)),children:[ye(p.direction===`ltr`),(0,B.jsx)(`span`,{children:`Left-to-right`})]}),(0,B.jsxs)(`button`,{type:`button`,className:`app-dropdown__item toolbar-menu-button`,role:`menuitemradio`,"aria-checked":p.direction===`rtl`,onMouseDown:N,onClick:()=>k(e=>e.setTextDirection(`rtl`)),children:[ye(p.direction===`rtl`),(0,B.jsx)(`span`,{children:`Right-to-left`})]}),(0,B.jsxs)(`button`,{type:`button`,className:`app-dropdown__item toolbar-menu-button`,role:`menuitemcheckbox`,"aria-checked":p.subscript,onMouseDown:N,onClick:()=>ne(`SUB`,{tag:`SUP`}),children:[ye(p.subscript),(0,B.jsx)(`span`,{children:`Subscript`})]}),(0,B.jsxs)(`button`,{type:`button`,className:`app-dropdown__item toolbar-menu-button`,role:`menuitemcheckbox`,"aria-checked":p.superscript,onMouseDown:N,onClick:()=>ne(`SUP`,{tag:`SUB`}),children:[ye(p.superscript),(0,B.jsx)(`span`,{children:`Superscript`})]}),(0,B.jsxs)(`button`,{type:`button`,className:`app-dropdown__item toolbar-menu-button`,role:`menuitemcheckbox`,"aria-checked":p.code,onMouseDown:N,onClick:()=>k(e=>e.toggleCode()),children:[ye(p.code),(0,B.jsx)(`span`,{children:`Code`})]}),(0,B.jsxs)(`button`,{type:`button`,className:`app-dropdown__item toolbar-menu-button`,role:`menuitem`,onMouseDown:N,onClick:()=>k(e=>e.removeAllFormatting()),children:[(0,B.jsx)(F,{size:15}),(0,B.jsx)(`span`,{children:`Clear formatting`})]}),(0,B.jsxs)(`button`,{type:`button`,className:`app-dropdown__item toolbar-menu-button`,disabled:!p.canUndo,role:`menuitem`,"aria-label":`Undo`,onMouseDown:N,onClick:()=>k(e=>e.undo()),children:[(0,B.jsx)(Re,{size:15}),(0,B.jsx)(`span`,{children:`Undo`})]}),(0,B.jsxs)(`button`,{type:`button`,className:`app-dropdown__item toolbar-menu-button`,disabled:!p.canRedo,role:`menuitem`,"aria-label":`Redo`,onMouseDown:N,onClick:()=>k(e=>e.redo()),children:[(0,B.jsx)(xe,{size:15}),(0,B.jsx)(`span`,{children:`Redo`})]})]})]})]})]}),v.open?(0,B.jsxs)(`form`,{className:`editor-link-form`,onSubmit:he,onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),ge())},children:[(0,B.jsxs)(`label`,{className:`editor-link-form__field`,children:[(0,B.jsx)(`span`,{children:`Link URL`}),(0,B.jsx)(`input`,{ref:s,value:v.url,onChange:e=>y(t=>({...t,url:e.target.value})),type:`url`,inputMode:`url`,autoComplete:`url`,placeholder:`https://example.com`,"aria-invalid":v.error?`true`:void 0})]}),v.error?(0,B.jsx)(`p`,{className:`editor-link-form__error`,role:`alert`,children:v.error}):null,(0,B.jsxs)(`div`,{className:`editor-link-form__actions`,children:[(0,B.jsx)(Br,{variant:`outline`,onClick:ge,children:`Cancel`}),v.hasLink?(0,B.jsx)(Br,{variant:`outline`,onClick:()=>{k(e=>e.removeLink()),y(e=>({...e,open:!1}))},children:`Remove link`}):null,(0,B.jsx)(Br,{formAction:`submit`,children:`Apply link`})]})]}):null,(0,B.jsx)(`div`,{className:`editor-wrap`,tabIndex:-1,children:(0,B.jsx)(`div`,{ref:a,className:`editor`,contentEditable:!0,suppressContentEditableWarning:!0,role:`textbox`,"aria-label":n,"aria-multiline":`true`})})]})}),tp={to:`To`,cc:`Cc`,bcc:`Bcc`};function np(){let e=864e5,t=Math.floor(dt/e)*e,n=(8-new Date(dt).getUTCDay())%7||7;return[{id:`later-today`,label:`Later today`,targetAt:dt+3*36e5},{id:`tomorrow-morning`,label:`Tomorrow morning`,targetAt:t+e+8*36e5},{id:`tomorrow-afternoon`,label:`Tomorrow afternoon`,targetAt:t+e+13*36e5},{id:`monday-morning`,label:`Monday morning`,targetAt:t+n*e+8*36e5}]}function rp(e){return new Date(e).toLocaleString(ft,{weekday:`short`,month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`,timeZone:`UTC`})}function ip(e){return e?e.name?`${e.name} <${e.email}>`:e.email:``}function ap({session:e}){let t=br.getState,n=br(e=>e.identities),r=e.presentation===`expanded`,[i,a]=(0,C.useState)(!1),[o,s]=(0,C.useState)(e.draft.cc.length>0),[c,l]=(0,C.useState)(e.draft.bcc.length>0),[u,d]=(0,C.useState)(null),f=(0,C.useRef)(null),p=(0,C.useRef)(null),m=(0,C.useRef)(null),{draft:h}=e,g=(0,C.useMemo)(np,[]),_=t=>r?`compose-${t}`:`compose-${e.id}-${t}`,v=r?`compose-title`:`compose-${e.id}-title`,y=r?`compose-from-label`:`compose-${e.id}-from-label`,b=r?`compose-subject`:`compose-${e.id}-subject`,x=hr(e),S=x?`Close options`:`Close`,w=n[h.fromIdx];(0,C.useEffect)(()=>{r&&requestAnimationFrame(()=>{e.draft.to.length===0?document.getElementById(_(`to`))?.focus():f.current?.focus()})},[r,e.id,e.draftEpoch]);let T=(0,C.useCallback)(n=>{t().updateDraft(e.id,{html:n.html,text:n.text})},[t,e.id]),E=(0,C.useCallback)((n,r)=>{t().updateDraft(e.id,{[n]:r})},[t,e.id]);function D(e){return lr.filter(t=>t!==e).flatMap(e=>h[e].filter(pr).map(e=>e.email))}function ee(e){e===`cc`?s(!0):l(!0),requestAnimationFrame(()=>document.getElementById(_(e))?.focus())}function O(t,n){if(t===`to`)return;let r=n.currentTarget,i=n.relatedTarget;i&&r.contains(i)||setTimeout(()=>{let n=br.getState().sessions.find(t=>t.id===e.id);!n||n.draft[t].length>0||(t===`cc`?s(!1):l(!1))})}function k(){t().send(e.id,u?{targetAt:u.targetAt,label:rp(u.targetAt)}:null)}function ne(t){t.defaultPrevented||Ar(t.nativeEvent)||Mr(t.nativeEvent,{key:`Enter`,mod:!0})&&(t.preventDefault(),!e.closePromptOpen&&k())}let re=[`to`,...o?[`cc`]:[],...c?[`bcc`]:[]];return(0,B.jsx)(`div`,{ref:p,className:`compose-dialog${r?` compose-dialog--expanded`:``}${i?` compose-dialog--maximized`:``}`,style:r?void 0:{display:`none`},role:`dialog`,"aria-modal":`true`,"aria-labelledby":v,tabIndex:-1,onKeyDown:ne,children:(0,B.jsxs)(`div`,{className:`compose-dialog__card`,children:[(0,B.jsxs)(`header`,{children:[(0,B.jsx)(`h2`,{id:v,title:h.subject||`New Message`,children:h.subject||`New Message`}),(0,B.jsxs)(`div`,{className:`compose-dialog__window-actions`,children:[(0,B.jsx)(Vr,{className:`icon--minimize`,title:`Minimize`,"aria-label":`Minimize`,onClick:()=>t().minimize(e.id),children:(0,B.jsx)(N,{size:18,strokeWidth:1.65,"aria-hidden":`true`})}),(0,B.jsx)(Ur,{maximized:i,surface:`composer`,onToggle:()=>a(e=>!e)}),(0,B.jsxs)(Gr,{className:`compose-close-menu`,children:[(0,B.jsx)(`summary`,{ref:m,className:`compose-close-menu__trigger`,role:`button`,"aria-haspopup":`menu`,title:S,"aria-label":S,onClick:n=>{x||(n.preventDefault(),t().close(e.id))},children:(0,B.jsx)(Be,{size:18,strokeWidth:1.65,"aria-hidden":`true`})}),(0,B.jsxs)(`div`,{className:`app-dropdown__menu compose-close-menu__menu`,role:`menu`,"aria-label":`Close options`,children:[(0,B.jsxs)(`button`,{type:`button`,className:`app-dropdown__item compose-close-menu__discard`,role:`menuitem`,onClick:n=>{Wr(n),t().discardDraft(e.id)},children:[(0,B.jsx)(Ie,{size:15,"aria-hidden":`true`}),(0,B.jsx)(`span`,{children:`Discard`})]}),(0,B.jsxs)(`button`,{type:`button`,className:`app-dropdown__item`,role:`menuitem`,onClick:n=>{Wr(n),t().saveAndClose(e.id)},children:[(0,B.jsx)(Ce,{size:15,"aria-hidden":`true`}),(0,B.jsx)(`span`,{children:`Save Draft`})]})]})]})]})]}),(0,B.jsxs)(`div`,{className:`compose-dialog__body`,children:[(0,B.jsxs)(`div`,{className:`row`,children:[(0,B.jsx)(`label`,{id:y,children:`From`}),(0,B.jsxs)(Gr,{className:`from-picker`,"data-compose-from":!0,children:[(0,B.jsxs)(`summary`,{className:`app-dropdown__summary from-picker__summary`,"aria-labelledby":y,children:[w?(0,B.jsx)(`span`,{className:`from-picker__avatar`,"aria-hidden":`true`,style:hn(w.email),children:mn(w.name?.trim()||w.email)}):null,(0,B.jsx)(`span`,{className:`from-picker__summary-text`,children:ip(w)})]}),(0,B.jsx)(`div`,{className:`app-dropdown__menu from-picker__menu`,role:`menu`,"aria-label":`From identity`,children:n.map((n,r)=>(0,B.jsxs)(`button`,{type:`button`,className:`app-dropdown__item from-picker__option`,role:`menuitemradio`,"aria-checked":r===h.fromIdx,onClick:n=>{Wr(n),t().updateDraft(e.id,{fromIdx:r})},children:[(0,B.jsx)(`span`,{className:`from-picker__avatar`,"aria-hidden":`true`,style:hn(n.email),children:mn(n.name?.trim()||n.email)}),(0,B.jsxs)(`span`,{className:`from-picker__lines`,children:[n.name?(0,B.jsx)(`span`,{className:`from-picker__name`,children:n.name}):null,(0,B.jsx)(`span`,{className:`from-picker__email${n.name?``:` from-picker__email--primary`}`,children:n.email})]}),r===h.fromIdx?(0,B.jsx)(te,{size:15,className:`from-picker__check`}):null]},n.id))})]})]}),re.map(t=>(0,B.jsxs)(`div`,{className:`row row--recipient${t===`to`?` row--to`:``}`,onBlur:e=>O(t,e),children:[(0,B.jsx)(`label`,{htmlFor:_(t),children:tp[t]}),(0,B.jsx)(Lu,{inputId:_(t),label:tp[t],entries:h[t],taken:D(t),query:Ou,browseAll:ku,onEntriesChange:e=>E(t,e)},`${e.id}-${t}-${e.draftEpoch}`),t===`to`?(0,B.jsxs)(`div`,{className:`recipient-cc-toggles`,children:[o?null:(0,B.jsx)(`button`,{type:`button`,className:`recipient-toggle`,onClick:()=>ee(`cc`),children:`Cc`}),c?null:(0,B.jsx)(`button`,{type:`button`,className:`recipient-toggle`,onClick:()=>ee(`bcc`),children:`Bcc`})]}):null]},t)),(0,B.jsxs)(`div`,{className:`row`,children:[(0,B.jsx)(`label`,{htmlFor:b,children:`Subject`}),(0,B.jsx)(`input`,{id:b,type:`text`,value:h.subject,onInput:n=>t().updateDraft(e.id,{subject:n.currentTarget.value}),onChange:n=>t().updateDraft(e.id,{subject:n.target.value})})]}),(0,B.jsx)(ep,{ref:f,contentKey:e.id,initialHtml:e.editorHtmlBody,accessibleLabel:`Message body`,onUpdate:T}),(0,B.jsxs)(`footer`,{children:[(0,B.jsx)(Br,{variant:`outline`,"aria-label":`Attach files`,title:`Attach files`,iconLeft:(0,B.jsx)(ve,{size:17,"aria-hidden":`true`}),children:`Attach`}),(0,B.jsxs)(`div`,{className:`compose-send-split`,children:[(0,B.jsx)(Br,{className:`compose-send`,disabled:e.closePromptOpen,onClick:k,iconLeft:(0,B.jsx)(we,{size:16,strokeWidth:2,"aria-hidden":`true`}),children:`Send`}),(0,B.jsxs)(Gr,{className:`compose-schedule-menu`,children:[(0,B.jsxs)(`summary`,{className:`compose-schedule-menu__trigger${u?` compose-schedule-menu__trigger--selected`:``}`,role:`button`,"aria-haspopup":`menu`,"aria-label":u?`Schedule send: ${u.label}`:`Schedule send`,title:u?`${u.label} — ${rp(u.targetAt)}`:`Schedule send`,children:[u?(0,B.jsx)(`span`,{className:`compose-schedule-menu__selection`,children:u.label}):null,(0,B.jsx)(A,{size:16,strokeWidth:2,"aria-hidden":`true`})]}),(0,B.jsxs)(`div`,{className:`app-dropdown__menu compose-schedule-menu__menu`,role:`menu`,"aria-label":`Schedule send`,children:[u?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`button`,{type:`button`,className:`app-dropdown__item compose-schedule-menu__item`,role:`menuitem`,onClick:e=>{Wr(e),d(null)},children:[(0,B.jsx)(`span`,{className:`compose-schedule-menu__label`,children:`Send now`}),(0,B.jsx)(`span`,{className:`compose-schedule-menu__secondary`,children:`Immediately`})]}),(0,B.jsx)(`div`,{className:`compose-schedule-menu__separator`,role:`separator`})]}):null,g.map(e=>(0,B.jsxs)(`button`,{type:`button`,className:`app-dropdown__item compose-schedule-menu__item`,role:`menuitem`,title:rp(e.targetAt),onClick:t=>{Wr(t),d(e)},children:[(0,B.jsx)(`span`,{className:`compose-schedule-menu__label`,children:e.label}),(0,B.jsx)(`span`,{className:`compose-schedule-menu__secondary`,children:rp(e.targetAt)})]},e.id))]})]})]})]})]}),e.closePromptOpen?(0,B.jsx)(`div`,{className:`compose-confirm-backdrop`,children:(0,B.jsxs)(`section`,{className:`compose-confirm`,role:`alertdialog`,"aria-modal":`true`,"aria-labelledby":`compose-close-title`,"aria-describedby":`compose-close-description`,tabIndex:-1,children:[(0,B.jsx)(`h3`,{id:`compose-close-title`,children:`Save this draft?`}),(0,B.jsx)(`p`,{id:`compose-close-description`,children:`Save your latest changes before closing this compose window.`}),(0,B.jsxs)(`div`,{className:`compose-confirm__actions`,children:[(0,B.jsx)(Br,{variant:`outline`,onClick:()=>t().cancelClose(e.id),children:`Cancel`}),(0,B.jsx)(Br,{variant:`outline`,onClick:()=>t().closeWithoutSaving(e.id),children:`Don't Save`}),(0,B.jsx)(Br,{onClick:()=>t().saveAndClose(e.id),children:`Save draft`})]})]})}):null]})})}function op(){let e=br(e=>e.sessions),t=e.filter(e=>e.presentation===`minimized`),n=br.getState;return(0,B.jsxs)(B.Fragment,{children:[e.map(e=>(0,B.jsx)(ap,{session:e},e.id)),t.length>0?(0,B.jsx)(`div`,{className:`compose-dock`,"aria-label":`Minimized compose windows`,children:t.map(e=>(0,B.jsxs)(`div`,{className:`compose-dock__item`,"data-session-id":e.id,children:[(0,B.jsx)(`button`,{type:`button`,className:`compose-dock__restore`,"aria-label":`Restore ${mr(e)}`,onClick:()=>n().restore(e.id),children:(0,B.jsx)(`span`,{className:`compose-dock__text`,children:(0,B.jsx)(`span`,{className:`compose-dock__title`,children:mr(e)})})}),(0,B.jsx)(`button`,{type:`button`,className:`compose-dock__close`,"aria-label":`Close ${mr(e)}`,onClick:()=>n().requestClose(e.id),children:`×`})]},e.id))}):null]})}var sp=4e3;function cp(){let e=z(e=>e.toasts),t=z(e=>e.dismissToast);return(0,C.useEffect)(()=>{if(e.length===0)return;let n=e[0],r=window.setTimeout(()=>t(n.id),sp);return()=>clearTimeout(r)},[e,t]),e.length===0?null:(0,B.jsx)(`div`,{className:`store-error-toast`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,children:e.map(e=>(0,B.jsxs)(`div`,{className:`store-error-toast__item store-error-toast__item--success`,children:[(0,B.jsx)(`span`,{className:`store-error-toast__message`,children:e.text}),(0,B.jsx)(`button`,{className:`store-error-toast__dismiss`,type:`button`,"aria-label":`Dismiss notification`,title:`Dismiss`,onClick:()=>t(e.id),children:(0,B.jsx)(Be,{size:14,strokeWidth:2,"aria-hidden":`true`})})]},e.id))})}var lp=typeof location<`u`&&new URLSearchParams(location.search).get(`animations`)===`off`,up=56,dp=6,fp=1024,pp=640,mp=lp?0:360,hp=50,gp=180,_p=420,vp=240;function yp(){let[e,t]=(0,C.useState)(()=>window.innerWidth);return(0,C.useEffect)(()=>{let e=()=>t(window.innerWidth);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function bp(){let e=Cr(e=>e.theme),t=Cr(e=>e.space),n=Cr(e=>e.quickFilter),r=Cr(e=>e.folderListWidth),i=Cr(e=>e.messageColumnWidth),a=Cr(e=>e.quickFilterFocusRequest),o=z(e=>e.open.id),s=z(e=>e.selection.ids.size),c=z(e=>e.messages),l=br(e=>e.sessions.some(e=>e.presentation===`expanded`)),u=yp(),d=(0,C.useRef)(null),f=(0,C.useRef)(null),[p,m]=(0,C.useState)(!1),h=(0,C.useRef)(!1),[g,_]=(0,C.useState)(!1),v=o!=null&&s===0,y=u{let t=document.documentElement;t.classList.toggle(`dark`,e===`dark`),t.classList.toggle(`light`,e===`light`),t.style.colorScheme=e},[e]),(0,C.useEffect)(()=>{a!==0&&(f.current?.focus(),f.current?.select())},[a]),(0,C.useEffect)(()=>{_(!1)},[o]),(0,C.useEffect)(()=>{S||_(!1)},[S]),(0,C.useLayoutEffect)(()=>{let e=y||u{T.current=null,w(!0)},Math.max(0,mp-hp))},[v,u,t]),(0,C.useEffect)(()=>()=>{T.current!=null&&clearTimeout(T.current)},[]);let D=(0,C.useCallback)(()=>{m(e=>!e),h.current=!1},[]),ee=i+!!S*6;function O(){let e=d.current?.clientWidth||window.innerWidth,t=Math.max(0,e-up-(p?0:dp)),n=S?286+vp:280;return Math.min(_p,t-n)}let te=Tr({get:()=>Cr.getState().folderListWidth,set:e=>Cr.getState().setFolderListWidth(e),min:()=>gp,max:O}),A=Tr({get:()=>Cr.getState().messageColumnWidth,set:e=>Cr.getState().setMessageColumnWidth(e),min:()=>280,max:()=>xr}),ne={"--folder-list-width":`${r}px`,"--message-columns-width":`${ee}px`,"--message-list-min-width":`280px`,"--message-view-min-width":`${vp}px`,"--column-resizer-width":`${dp}px`,"--folder-list-transition-ms":`${mp}ms`},re=[`shell`,t===`mail`&&!S?`shell--message-view-hidden`:``,t===`mail`&&!x?`shell--message-list-hidden`:``,g?`shell--message-view-maximized`:``,p?`shell--folder-list-hidden`:``,t===`contacts`?`shell--contacts`:``,te.active||A.active?`shell--column-resizing`:``].filter(Boolean).join(` `),ie=t===`contacts`?`address book list`:`folder list`,ae=t===`contacts`?`Filter contacts or identities`:`Filter messages`,oe=e===`dark`?`Switch to light mode`:`Switch to dark mode`;function se(e){e!==Cr.getState().quickFilter&&(t===`mail`&&z.getState().open.id!=null&&z.getState().selectMessage(null),Cr.getState().setQuickFilter(e))}return(0,B.jsxs)(`div`,{ref:d,className:re,style:ne,children:[(0,B.jsxs)(`header`,{className:`quick-filter`,inert:g,"aria-hidden":g||void 0,children:[(0,B.jsxs)(`div`,{className:`quick-filter__brand`,children:[(0,B.jsx)(zr,{className:`quick-filter__glyph`,svg:He}),(0,B.jsx)(`span`,{className:`quick-filter__wordmark`,children:`Mail`})]}),(0,B.jsxs)(`div`,{className:`quick-filter__search`,role:`search`,children:[(0,B.jsx)(`input`,{ref:f,className:`quick-filter__input${n.length===0?` quick-filter__input--empty`:``}`,type:`search`,value:n,"aria-label":t===`contacts`?`Filter contacts or identities by name or email address`:`Quick Filter messages by from, to, or subject`,"aria-keyshortcuts":`/ Control+K`,placeholder:ae,autoComplete:`off`,spellCheck:!1,onInput:e=>se(e.currentTarget.value),onChange:e=>se(e.target.value)}),n.length===0?(0,B.jsx)(`kbd`,{className:`quick-filter__shortcut`,"aria-hidden":`true`,children:`/`}):(0,B.jsx)(`button`,{className:`quick-filter__clear`,type:`button`,"aria-label":`Clear Quick Filter`,title:`Clear Quick Filter`,onClick:()=>se(``),children:(0,B.jsx)(Be,{size:17,strokeWidth:2.25,"aria-hidden":`true`})})]}),(0,B.jsxs)(`div`,{className:`quick-filter__actions`,children:[(0,B.jsx)(`a`,{className:`quick-filter__action`,href:`#report-bug`,"aria-label":`Report a bug`,title:`Report a bug`,children:(0,B.jsx)(k,{size:18,strokeWidth:1.75,"aria-hidden":`true`})}),(0,B.jsx)(`a`,{className:`quick-filter__action`,href:`#feedback`,"aria-label":`Give feedback`,title:`Give feedback`,children:(0,B.jsx)(de,{size:18,strokeWidth:1.75,"aria-hidden":`true`})}),(0,B.jsx)(`button`,{className:`quick-filter__action theme-toggle`,type:`button`,"aria-label":oe,title:oe,onClick:()=>Cr.getState().toggleTheme(),children:e===`dark`?(0,B.jsx)(Ae,{size:18,strokeWidth:1.75,"aria-hidden":`true`}):(0,B.jsx)(P,{size:18,strokeWidth:1.75,"aria-hidden":`true`})}),(0,B.jsx)(ni,{}),(0,B.jsx)(ei,{})]})]}),(0,B.jsx)(Qr,{inert:g,active:t,unreadCount:E,folderListHidden:p,sidebarLabel:ie,onChange:e=>Cr.getState().setSpace(e),onToggleFolderList:D}),(0,B.jsx)(`div`,{className:`sidebar-slot${p?` sidebar-slot--hidden`:``}`,"aria-hidden":p||g||void 0,inert:p||g,children:t===`mail`?(0,B.jsxs)(`aside`,{className:`sidebar`,children:[(0,B.jsx)(`header`,{className:`sidebar__header`,children:(0,B.jsx)(Br,{className:`sidebar__compose`,onClick:()=>br.getState().open(),iconLeft:(0,B.jsx)(ye,{size:16,strokeWidth:2}),children:`New Message`})}),(0,B.jsx)(`div`,{className:`sidebar__account`,children:(0,B.jsx)(`span`,{className:`sidebar__account-name`,children:pt.email})}),(0,B.jsx)(ki,{}),(0,B.jsx)(`footer`,{className:`sidebar__footer`,children:(0,B.jsx)(ai,{})})]}):(0,B.jsx)(`div`,{className:`sidebar sidebar--contacts`})}),(0,B.jsx)(`div`,{className:`column-resizer column-resizer--folder-list${te.active?` is-active`:``}${p?` column-resizer--hidden`:``}`,role:`separator`,"aria-label":`Resize ${ie}`,"aria-orientation":`vertical`,"aria-valuemin":gp,"aria-valuenow":r,"aria-hidden":p||g||void 0,inert:g,tabIndex:p||g?-1:0,onPointerDown:te.onPointerDown,onKeyDown:te.onKeyDown}),t===`mail`?(0,B.jsxs)(B.Fragment,{children:[x?(0,B.jsxs)(`div`,{className:`msg-columns${A.active?` msg-columns--resizing`:``}`,inert:g,"aria-hidden":g||void 0,style:{"--message-column-resizer-width":`6px`,"--message-column-min-width":`280px`,"--message-column-width":`${i}px`},children:[(0,B.jsx)(Ba,{quickFilterQuery:n}),S?(0,B.jsx)(`div`,{className:`column-resizer msg-columns__resizer${A.active?` is-active`:``}`,role:`separator`,"aria-label":`Resize message list`,"aria-orientation":`vertical`,"aria-valuemin":280,"aria-valuemax":xr,"aria-valuenow":i,tabIndex:0,onPointerDown:A.onPointerDown,onKeyDown:A.onKeyDown}):null]}):null,S?(0,B.jsx)(Tu,{maximized:g,onToggleMaximized:()=>_(e=>!e)}):null]}):(0,B.jsx)(`section`,{className:`contacts contacts--placeholder`,"aria-label":`Contacts`,children:(0,B.jsx)(`p`,{children:`Contacts are not part of this clone.`})}),(0,B.jsx)(op,{}),(0,B.jsx)(cp,{})]})}lp&&document.documentElement.classList.add(`no-motion`),(0,Ve.createRoot)(document.getElementById(`app`)).render((0,B.jsx)(bp,{})); +//# sourceMappingURL=index-DIr-gxPn.js.map \ No newline at end of file diff --git a/suites-experimental/stormbox-react/dist/assets/index-DIr-gxPn.js.map b/suites-experimental/stormbox-react/dist/assets/index-DIr-gxPn.js.map new file mode 100644 index 000000000..48652638c --- /dev/null +++ b/suites-experimental/stormbox-react/dist/assets/index-DIr-gxPn.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index-DIr-gxPn.js","names":["__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","X","create","memo","memo","tt","Text"],"sources":["../../node_modules/scheduler/cjs/scheduler.production.js","../../node_modules/scheduler/index.js","../../node_modules/react/cjs/react.production.js","../../node_modules/react/index.js","../../node_modules/react-dom/cjs/react-dom.production.js","../../node_modules/react-dom/index.js","../../node_modules/react-dom/cjs/react-dom-client.production.js","../../node_modules/react-dom/client.js","../../node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.mjs","../../node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.mjs","../../node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.mjs","../../node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.mjs","../../node_modules/lucide-react/dist/esm/defaultAttributes.mjs","../../node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.mjs","../../node_modules/lucide-react/dist/esm/context.mjs","../../node_modules/lucide-react/dist/esm/Icon.mjs","../../node_modules/lucide-react/dist/esm/createLucideIcon.mjs","../../node_modules/lucide-react/dist/esm/icons/arrow-left.mjs","../../node_modules/lucide-react/dist/esm/icons/bold.mjs","../../node_modules/lucide-react/dist/esm/icons/bug.mjs","../../node_modules/lucide-react/dist/esm/icons/check.mjs","../../node_modules/lucide-react/dist/esm/icons/chevron-down.mjs","../../node_modules/lucide-react/dist/esm/icons/chevron-up.mjs","../../node_modules/lucide-react/dist/esm/icons/circle-user-round.mjs","../../node_modules/lucide-react/dist/esm/icons/circle.mjs","../../node_modules/lucide-react/dist/esm/icons/clock.mjs","../../node_modules/lucide-react/dist/esm/icons/download.mjs","../../node_modules/lucide-react/dist/esm/icons/ellipsis.mjs","../../node_modules/lucide-react/dist/esm/icons/expand.mjs","../../node_modules/lucide-react/dist/esm/icons/grip.mjs","../../node_modules/lucide-react/dist/esm/icons/highlighter.mjs","../../node_modules/lucide-react/dist/esm/icons/image.mjs","../../node_modules/lucide-react/dist/esm/icons/italic.mjs","../../node_modules/lucide-react/dist/esm/icons/lightbulb.mjs","../../node_modules/lucide-react/dist/esm/icons/link.mjs","../../node_modules/lucide-react/dist/esm/icons/list-ordered.mjs","../../node_modules/lucide-react/dist/esm/icons/list.mjs","../../node_modules/lucide-react/dist/esm/icons/log-out.mjs","../../node_modules/lucide-react/dist/esm/icons/mail-open.mjs","../../node_modules/lucide-react/dist/esm/icons/mail.mjs","../../node_modules/lucide-react/dist/esm/icons/minus.mjs","../../node_modules/lucide-react/dist/esm/icons/moon.mjs","../../node_modules/lucide-react/dist/esm/icons/paperclip.mjs","../../node_modules/lucide-react/dist/esm/icons/plus.mjs","../../node_modules/lucide-react/dist/esm/icons/quote.mjs","../../node_modules/lucide-react/dist/esm/icons/redo-2.mjs","../../node_modules/lucide-react/dist/esm/icons/refresh-cw.mjs","../../node_modules/lucide-react/dist/esm/icons/remove-formatting.mjs","../../node_modules/lucide-react/dist/esm/icons/save.mjs","../../node_modules/lucide-react/dist/esm/icons/send.mjs","../../node_modules/lucide-react/dist/esm/icons/settings-2.mjs","../../node_modules/lucide-react/dist/esm/icons/settings.mjs","../../node_modules/lucide-react/dist/esm/icons/shrink.mjs","../../node_modules/lucide-react/dist/esm/icons/star.mjs","../../node_modules/lucide-react/dist/esm/icons/strikethrough.mjs","../../node_modules/lucide-react/dist/esm/icons/sun.mjs","../../node_modules/lucide-react/dist/esm/icons/tag.mjs","../../node_modules/lucide-react/dist/esm/icons/text-align-end.mjs","../../node_modules/lucide-react/dist/esm/icons/text-align-center.mjs","../../node_modules/lucide-react/dist/esm/icons/text-align-justify.mjs","../../node_modules/lucide-react/dist/esm/icons/text-align-start.mjs","../../node_modules/lucide-react/dist/esm/icons/trash-2.mjs","../../node_modules/lucide-react/dist/esm/icons/underline.mjs","../../node_modules/lucide-react/dist/esm/icons/undo-2.mjs","../../node_modules/lucide-react/dist/esm/icons/users.mjs","../../node_modules/lucide-react/dist/esm/icons/x.mjs","../../src/data/corpus.ts","../../src/data/random.ts","../../src/data/text.ts","../../src/clock.ts","../../src/data/mailbox.ts","../../node_modules/zustand/esm/vanilla.mjs","../../node_modules/zustand/esm/react.mjs","../../src/utils/message-tags.ts","../../src/store/mail-store.ts","../../src/utils/sender-avatar.ts","../../src/data/bodies.ts","../../src/utils/address-key.ts","../../src/utils/address-parse.ts","../../src/utils/compose-quote.ts","../../src/store/compose-store.ts","../../src/store/ui-store.ts","../../src/hooks/useColumnResize.ts","../../src/utils/keyboard.ts","../../src/hooks/useShortcuts.ts","../../node_modules/react/cjs/react-jsx-runtime.production.js","../../node_modules/react/jsx-runtime.js","../../src/components/base.tsx","../../src/utils/format-bytes.ts","../../src/components/Shell.tsx","../../src/utils/folder-presentation.ts","../../src/hooks/useMessageDrag.ts","../../src/components/FolderTree.tsx","../../node_modules/@tanstack/virtual-core/dist/esm/lazy-measurements.js","../../node_modules/@tanstack/virtual-core/dist/esm/utils.js","../../node_modules/@tanstack/virtual-core/dist/esm/index.js","../../node_modules/@tanstack/react-virtual/dist/esm/index.js","../../src/utils/message-row-presentation.ts","../../src/utils/quick-filter.ts","../../src/components/Tags.tsx","../../src/components/MessageListRow.tsx","../../src/components/ListHeader.tsx","../../src/components/MessageList.tsx","../../node_modules/dompurify/dist/purify.es.mjs","../../src/hooks/useMediaQuery.ts","../../src/utils/raster-images.ts","../../src/utils/message-html.ts","../../src/utils/color.ts","../../src/utils/dark-email.ts","../../node_modules/linkifyjs/dist/linkify.mjs","../../node_modules/linkify-string/dist/linkify-string.mjs","../../src/utils/plaintext-html.ts","../../src/components/MessageView.tsx","../../src/store/contacts.ts","../../src/components/RecipientInput.tsx","../../node_modules/squire-rte/dist/squire.mjs","../../src/utils/rich-text.ts","../../src/components/RichTextEditor.tsx","../../src/components/Compose.tsx","../../src/components/Toasts.tsx","../../src/motion.ts","../../src/App.tsx","../../src/main.tsx"],"sourcesContent":["/**\n * @license React\n * scheduler.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nfunction push(heap, node) {\n var index = heap.length;\n heap.push(node);\n a: for (; 0 < index; ) {\n var parentIndex = (index - 1) >>> 1,\n parent = heap[parentIndex];\n if (0 < compare(parent, node))\n (heap[parentIndex] = node), (heap[index] = parent), (index = parentIndex);\n else break a;\n }\n}\nfunction peek(heap) {\n return 0 === heap.length ? null : heap[0];\n}\nfunction pop(heap) {\n if (0 === heap.length) return null;\n var first = heap[0],\n last = heap.pop();\n if (last !== first) {\n heap[0] = last;\n a: for (\n var index = 0, length = heap.length, halfLength = length >>> 1;\n index < halfLength;\n\n ) {\n var leftIndex = 2 * (index + 1) - 1,\n left = heap[leftIndex],\n rightIndex = leftIndex + 1,\n right = heap[rightIndex];\n if (0 > compare(left, last))\n rightIndex < length && 0 > compare(right, left)\n ? ((heap[index] = right),\n (heap[rightIndex] = last),\n (index = rightIndex))\n : ((heap[index] = left),\n (heap[leftIndex] = last),\n (index = leftIndex));\n else if (rightIndex < length && 0 > compare(right, last))\n (heap[index] = right), (heap[rightIndex] = last), (index = rightIndex);\n else break a;\n }\n }\n return first;\n}\nfunction compare(a, b) {\n var diff = a.sortIndex - b.sortIndex;\n return 0 !== diff ? diff : a.id - b.id;\n}\nexports.unstable_now = void 0;\nif (\"object\" === typeof performance && \"function\" === typeof performance.now) {\n var localPerformance = performance;\n exports.unstable_now = function () {\n return localPerformance.now();\n };\n} else {\n var localDate = Date,\n initialTime = localDate.now();\n exports.unstable_now = function () {\n return localDate.now() - initialTime;\n };\n}\nvar taskQueue = [],\n timerQueue = [],\n taskIdCounter = 1,\n currentTask = null,\n currentPriorityLevel = 3,\n isPerformingWork = !1,\n isHostCallbackScheduled = !1,\n isHostTimeoutScheduled = !1,\n needsPaint = !1,\n localSetTimeout = \"function\" === typeof setTimeout ? setTimeout : null,\n localClearTimeout = \"function\" === typeof clearTimeout ? clearTimeout : null,\n localSetImmediate = \"undefined\" !== typeof setImmediate ? setImmediate : null;\nfunction advanceTimers(currentTime) {\n for (var timer = peek(timerQueue); null !== timer; ) {\n if (null === timer.callback) pop(timerQueue);\n else if (timer.startTime <= currentTime)\n pop(timerQueue),\n (timer.sortIndex = timer.expirationTime),\n push(taskQueue, timer);\n else break;\n timer = peek(timerQueue);\n }\n}\nfunction handleTimeout(currentTime) {\n isHostTimeoutScheduled = !1;\n advanceTimers(currentTime);\n if (!isHostCallbackScheduled)\n if (null !== peek(taskQueue))\n (isHostCallbackScheduled = !0),\n isMessageLoopRunning ||\n ((isMessageLoopRunning = !0), schedulePerformWorkUntilDeadline());\n else {\n var firstTimer = peek(timerQueue);\n null !== firstTimer &&\n requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);\n }\n}\nvar isMessageLoopRunning = !1,\n taskTimeoutID = -1,\n frameInterval = 5,\n startTime = -1;\nfunction shouldYieldToHost() {\n return needsPaint\n ? !0\n : exports.unstable_now() - startTime < frameInterval\n ? !1\n : !0;\n}\nfunction performWorkUntilDeadline() {\n needsPaint = !1;\n if (isMessageLoopRunning) {\n var currentTime = exports.unstable_now();\n startTime = currentTime;\n var hasMoreWork = !0;\n try {\n a: {\n isHostCallbackScheduled = !1;\n isHostTimeoutScheduled &&\n ((isHostTimeoutScheduled = !1),\n localClearTimeout(taskTimeoutID),\n (taskTimeoutID = -1));\n isPerformingWork = !0;\n var previousPriorityLevel = currentPriorityLevel;\n try {\n b: {\n advanceTimers(currentTime);\n for (\n currentTask = peek(taskQueue);\n null !== currentTask &&\n !(\n currentTask.expirationTime > currentTime && shouldYieldToHost()\n );\n\n ) {\n var callback = currentTask.callback;\n if (\"function\" === typeof callback) {\n currentTask.callback = null;\n currentPriorityLevel = currentTask.priorityLevel;\n var continuationCallback = callback(\n currentTask.expirationTime <= currentTime\n );\n currentTime = exports.unstable_now();\n if (\"function\" === typeof continuationCallback) {\n currentTask.callback = continuationCallback;\n advanceTimers(currentTime);\n hasMoreWork = !0;\n break b;\n }\n currentTask === peek(taskQueue) && pop(taskQueue);\n advanceTimers(currentTime);\n } else pop(taskQueue);\n currentTask = peek(taskQueue);\n }\n if (null !== currentTask) hasMoreWork = !0;\n else {\n var firstTimer = peek(timerQueue);\n null !== firstTimer &&\n requestHostTimeout(\n handleTimeout,\n firstTimer.startTime - currentTime\n );\n hasMoreWork = !1;\n }\n }\n break a;\n } finally {\n (currentTask = null),\n (currentPriorityLevel = previousPriorityLevel),\n (isPerformingWork = !1);\n }\n hasMoreWork = void 0;\n }\n } finally {\n hasMoreWork\n ? schedulePerformWorkUntilDeadline()\n : (isMessageLoopRunning = !1);\n }\n }\n}\nvar schedulePerformWorkUntilDeadline;\nif (\"function\" === typeof localSetImmediate)\n schedulePerformWorkUntilDeadline = function () {\n localSetImmediate(performWorkUntilDeadline);\n };\nelse if (\"undefined\" !== typeof MessageChannel) {\n var channel = new MessageChannel(),\n port = channel.port2;\n channel.port1.onmessage = performWorkUntilDeadline;\n schedulePerformWorkUntilDeadline = function () {\n port.postMessage(null);\n };\n} else\n schedulePerformWorkUntilDeadline = function () {\n localSetTimeout(performWorkUntilDeadline, 0);\n };\nfunction requestHostTimeout(callback, ms) {\n taskTimeoutID = localSetTimeout(function () {\n callback(exports.unstable_now());\n }, ms);\n}\nexports.unstable_IdlePriority = 5;\nexports.unstable_ImmediatePriority = 1;\nexports.unstable_LowPriority = 4;\nexports.unstable_NormalPriority = 3;\nexports.unstable_Profiling = null;\nexports.unstable_UserBlockingPriority = 2;\nexports.unstable_cancelCallback = function (task) {\n task.callback = null;\n};\nexports.unstable_forceFrameRate = function (fps) {\n 0 > fps || 125 < fps\n ? console.error(\n \"forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported\"\n )\n : (frameInterval = 0 < fps ? Math.floor(1e3 / fps) : 5);\n};\nexports.unstable_getCurrentPriorityLevel = function () {\n return currentPriorityLevel;\n};\nexports.unstable_next = function (eventHandler) {\n switch (currentPriorityLevel) {\n case 1:\n case 2:\n case 3:\n var priorityLevel = 3;\n break;\n default:\n priorityLevel = currentPriorityLevel;\n }\n var previousPriorityLevel = currentPriorityLevel;\n currentPriorityLevel = priorityLevel;\n try {\n return eventHandler();\n } finally {\n currentPriorityLevel = previousPriorityLevel;\n }\n};\nexports.unstable_requestPaint = function () {\n needsPaint = !0;\n};\nexports.unstable_runWithPriority = function (priorityLevel, eventHandler) {\n switch (priorityLevel) {\n case 1:\n case 2:\n case 3:\n case 4:\n case 5:\n break;\n default:\n priorityLevel = 3;\n }\n var previousPriorityLevel = currentPriorityLevel;\n currentPriorityLevel = priorityLevel;\n try {\n return eventHandler();\n } finally {\n currentPriorityLevel = previousPriorityLevel;\n }\n};\nexports.unstable_scheduleCallback = function (\n priorityLevel,\n callback,\n options\n) {\n var currentTime = exports.unstable_now();\n \"object\" === typeof options && null !== options\n ? ((options = options.delay),\n (options =\n \"number\" === typeof options && 0 < options\n ? currentTime + options\n : currentTime))\n : (options = currentTime);\n switch (priorityLevel) {\n case 1:\n var timeout = -1;\n break;\n case 2:\n timeout = 250;\n break;\n case 5:\n timeout = 1073741823;\n break;\n case 4:\n timeout = 1e4;\n break;\n default:\n timeout = 5e3;\n }\n timeout = options + timeout;\n priorityLevel = {\n id: taskIdCounter++,\n callback: callback,\n priorityLevel: priorityLevel,\n startTime: options,\n expirationTime: timeout,\n sortIndex: -1\n };\n options > currentTime\n ? ((priorityLevel.sortIndex = options),\n push(timerQueue, priorityLevel),\n null === peek(taskQueue) &&\n priorityLevel === peek(timerQueue) &&\n (isHostTimeoutScheduled\n ? (localClearTimeout(taskTimeoutID), (taskTimeoutID = -1))\n : (isHostTimeoutScheduled = !0),\n requestHostTimeout(handleTimeout, options - currentTime)))\n : ((priorityLevel.sortIndex = timeout),\n push(taskQueue, priorityLevel),\n isHostCallbackScheduled ||\n isPerformingWork ||\n ((isHostCallbackScheduled = !0),\n isMessageLoopRunning ||\n ((isMessageLoopRunning = !0), schedulePerformWorkUntilDeadline())));\n return priorityLevel;\n};\nexports.unstable_shouldYield = shouldYieldToHost;\nexports.unstable_wrapCallback = function (callback) {\n var parentPriorityLevel = currentPriorityLevel;\n return function () {\n var previousPriorityLevel = currentPriorityLevel;\n currentPriorityLevel = parentPriorityLevel;\n try {\n return callback.apply(this, arguments);\n } finally {\n currentPriorityLevel = previousPriorityLevel;\n }\n };\n};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n","/**\n * @license React\n * react.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_VIEW_TRANSITION_TYPE = Symbol.for(\"react.view_transition\"),\n MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nfunction getIteratorFn(maybeIterable) {\n if (null === maybeIterable || \"object\" !== typeof maybeIterable) return null;\n maybeIterable =\n (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||\n maybeIterable[\"@@iterator\"];\n return \"function\" === typeof maybeIterable ? maybeIterable : null;\n}\nvar ReactNoopUpdateQueue = {\n isMounted: function () {\n return !1;\n },\n enqueueForceUpdate: function () {},\n enqueueReplaceState: function () {},\n enqueueSetState: function () {}\n },\n assign = Object.assign,\n emptyObject = {};\nfunction Component(props, context, updater) {\n this.props = props;\n this.context = context;\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n}\nComponent.prototype.isReactComponent = {};\nComponent.prototype.setState = function (partialState, callback) {\n if (\n \"object\" !== typeof partialState &&\n \"function\" !== typeof partialState &&\n null != partialState\n )\n throw Error(\n \"takes an object of state variables to update or a function which returns an object of state variables.\"\n );\n this.updater.enqueueSetState(this, partialState, callback, \"setState\");\n};\nComponent.prototype.forceUpdate = function (callback) {\n this.updater.enqueueForceUpdate(this, callback, \"forceUpdate\");\n};\nfunction ComponentDummy() {}\nComponentDummy.prototype = Component.prototype;\nfunction PureComponent(props, context, updater) {\n this.props = props;\n this.context = context;\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n}\nvar pureComponentPrototype = (PureComponent.prototype = new ComponentDummy());\npureComponentPrototype.constructor = PureComponent;\nassign(pureComponentPrototype, Component.prototype);\npureComponentPrototype.isPureReactComponent = !0;\nvar isArrayImpl = Array.isArray;\nfunction noop() {}\nvar ReactSharedInternals = { H: null, A: null, T: null, S: null },\n hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction ReactElement(type, key, props) {\n var refProp = props.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== refProp ? refProp : null,\n props: props\n };\n}\nfunction cloneAndReplaceKey(oldElement, newKey) {\n return ReactElement(oldElement.type, newKey, oldElement.props);\n}\nfunction isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n}\nfunction escape(key) {\n var escaperLookup = { \"=\": \"=0\", \":\": \"=2\" };\n return (\n \"$\" +\n key.replace(/[=:]/g, function (match) {\n return escaperLookup[match];\n })\n );\n}\nvar userProvidedKeyEscapeRegex = /\\/+/g;\nfunction getElementKey(element, index) {\n return \"object\" === typeof element && null !== element && null != element.key\n ? escape(\"\" + element.key)\n : index.toString(36);\n}\nfunction resolveThenable(thenable) {\n switch (thenable.status) {\n case \"fulfilled\":\n return thenable.value;\n case \"rejected\":\n throw thenable.reason;\n default:\n switch (\n (\"string\" === typeof thenable.status\n ? thenable.then(noop, noop)\n : ((thenable.status = \"pending\"),\n thenable.then(\n function (fulfilledValue) {\n \"pending\" === thenable.status &&\n ((thenable.status = \"fulfilled\"),\n (thenable.value = fulfilledValue));\n },\n function (error) {\n \"pending\" === thenable.status &&\n ((thenable.status = \"rejected\"), (thenable.reason = error));\n }\n )),\n thenable.status)\n ) {\n case \"fulfilled\":\n return thenable.value;\n case \"rejected\":\n throw thenable.reason;\n }\n }\n throw thenable;\n}\nfunction mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {\n var type = typeof children;\n if (\"undefined\" === type || \"boolean\" === type) children = null;\n var invokeCallback = !1;\n if (null === children) invokeCallback = !0;\n else\n switch (type) {\n case \"bigint\":\n case \"string\":\n case \"number\":\n invokeCallback = !0;\n break;\n case \"object\":\n switch (children.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n invokeCallback = !0;\n break;\n case REACT_LAZY_TYPE:\n return (\n (invokeCallback = children._init),\n mapIntoArray(\n invokeCallback(children._payload),\n array,\n escapedPrefix,\n nameSoFar,\n callback\n )\n );\n }\n }\n if (invokeCallback)\n return (\n (callback = callback(children)),\n (invokeCallback =\n \"\" === nameSoFar ? \".\" + getElementKey(children, 0) : nameSoFar),\n isArrayImpl(callback)\n ? ((escapedPrefix = \"\"),\n null != invokeCallback &&\n (escapedPrefix =\n invokeCallback.replace(userProvidedKeyEscapeRegex, \"$&/\") + \"/\"),\n mapIntoArray(callback, array, escapedPrefix, \"\", function (c) {\n return c;\n }))\n : null != callback &&\n (isValidElement(callback) &&\n (callback = cloneAndReplaceKey(\n callback,\n escapedPrefix +\n (null == callback.key ||\n (children && children.key === callback.key)\n ? \"\"\n : (\"\" + callback.key).replace(\n userProvidedKeyEscapeRegex,\n \"$&/\"\n ) + \"/\") +\n invokeCallback\n )),\n array.push(callback)),\n 1\n );\n invokeCallback = 0;\n var nextNamePrefix = \"\" === nameSoFar ? \".\" : nameSoFar + \":\";\n if (isArrayImpl(children))\n for (var i = 0; i < children.length; i++)\n (nameSoFar = children[i]),\n (type = nextNamePrefix + getElementKey(nameSoFar, i)),\n (invokeCallback += mapIntoArray(\n nameSoFar,\n array,\n escapedPrefix,\n type,\n callback\n ));\n else if (((i = getIteratorFn(children)), \"function\" === typeof i))\n for (\n children = i.call(children), i = 0;\n !(nameSoFar = children.next()).done;\n\n )\n (nameSoFar = nameSoFar.value),\n (type = nextNamePrefix + getElementKey(nameSoFar, i++)),\n (invokeCallback += mapIntoArray(\n nameSoFar,\n array,\n escapedPrefix,\n type,\n callback\n ));\n else if (\"object\" === type) {\n if (\"function\" === typeof children.then)\n return mapIntoArray(\n resolveThenable(children),\n array,\n escapedPrefix,\n nameSoFar,\n callback\n );\n array = String(children);\n throw Error(\n \"Objects are not valid as a React child (found: \" +\n (\"[object Object]\" === array\n ? \"object with keys {\" + Object.keys(children).join(\", \") + \"}\"\n : array) +\n \"). If you meant to render a collection of children, use an array instead.\"\n );\n }\n return invokeCallback;\n}\nfunction mapChildren(children, func, context) {\n if (null == children) return children;\n var result = [],\n count = 0;\n mapIntoArray(children, result, \"\", \"\", function (child) {\n return func.call(context, child, count++);\n });\n return result;\n}\nfunction lazyInitializer(payload) {\n if (-1 === payload._status) {\n var ctor = payload._result,\n thenable = ctor();\n thenable.then(\n function (moduleObject) {\n if (0 === payload._status || -1 === payload._status)\n (payload._status = 1),\n (payload._result = moduleObject),\n void 0 === thenable.status &&\n ((thenable.status = \"fulfilled\"),\n (thenable.value = moduleObject));\n },\n function (error) {\n if (0 === payload._status || -1 === payload._status)\n (payload._status = 2),\n (payload._result = error),\n void 0 === thenable.status &&\n ((thenable.status = \"rejected\"), (thenable.reason = error));\n }\n );\n -1 === payload._status &&\n ((payload._status = 0), (payload._result = thenable));\n }\n if (1 === payload._status) return payload._result.default;\n throw payload._result;\n}\nvar reportGlobalError =\n \"function\" === typeof reportError\n ? reportError\n : function (error) {\n if (\n \"object\" === typeof window &&\n \"function\" === typeof window.ErrorEvent\n ) {\n var event = new window.ErrorEvent(\"error\", {\n bubbles: !0,\n cancelable: !0,\n message:\n \"object\" === typeof error &&\n null !== error &&\n \"string\" === typeof error.message\n ? String(error.message)\n : String(error),\n error: error\n });\n if (!window.dispatchEvent(event)) return;\n } else if (\n \"object\" === typeof process &&\n \"function\" === typeof process.emit\n ) {\n process.emit(\"uncaughtException\", error);\n return;\n }\n console.error(error);\n };\nfunction startTransition(scope) {\n var prevTransition = ReactSharedInternals.T,\n currentTransition = {};\n currentTransition.types =\n null !== prevTransition ? prevTransition.types : null;\n ReactSharedInternals.T = currentTransition;\n try {\n var returnValue = scope(),\n onStartTransitionFinish = ReactSharedInternals.S;\n null !== onStartTransitionFinish &&\n onStartTransitionFinish(currentTransition, returnValue);\n \"object\" === typeof returnValue &&\n null !== returnValue &&\n \"function\" === typeof returnValue.then &&\n returnValue.then(noop, reportGlobalError);\n } catch (error) {\n reportGlobalError(error);\n } finally {\n null !== prevTransition &&\n null !== currentTransition.types &&\n (prevTransition.types = currentTransition.types),\n (ReactSharedInternals.T = prevTransition);\n }\n}\nfunction addTransitionType(type) {\n var transition = ReactSharedInternals.T;\n if (null !== transition) {\n var transitionTypes = transition.types;\n null === transitionTypes\n ? (transition.types = [type])\n : -1 === transitionTypes.indexOf(type) && transitionTypes.push(type);\n } else startTransition(addTransitionType.bind(null, type));\n}\nvar Children = {\n map: mapChildren,\n forEach: function (children, forEachFunc, forEachContext) {\n mapChildren(\n children,\n function () {\n forEachFunc.apply(this, arguments);\n },\n forEachContext\n );\n },\n count: function (children) {\n var n = 0;\n mapChildren(children, function () {\n n++;\n });\n return n;\n },\n toArray: function (children) {\n return (\n mapChildren(children, function (child) {\n return child;\n }) || []\n );\n },\n only: function (children) {\n if (!isValidElement(children))\n throw Error(\n \"React.Children.only expected to receive a single React element child.\"\n );\n return children;\n }\n};\nexports.Activity = REACT_ACTIVITY_TYPE;\nexports.Children = Children;\nexports.Component = Component;\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.Profiler = REACT_PROFILER_TYPE;\nexports.PureComponent = PureComponent;\nexports.StrictMode = REACT_STRICT_MODE_TYPE;\nexports.Suspense = REACT_SUSPENSE_TYPE;\nexports.ViewTransition = REACT_VIEW_TRANSITION_TYPE;\nexports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =\n ReactSharedInternals;\nexports.__COMPILER_RUNTIME = {\n __proto__: null,\n c: function (size) {\n return ReactSharedInternals.H.useMemoCache(size);\n }\n};\nexports.addTransitionType = addTransitionType;\nexports.cache = function (fn) {\n return function () {\n return fn.apply(null, arguments);\n };\n};\nexports.cacheSignal = function () {\n return null;\n};\nexports.cloneElement = function (element, config, children) {\n if (null === element || void 0 === element)\n throw Error(\n \"The argument must be a React element, but you passed \" + element + \".\"\n );\n var props = assign({}, element.props),\n key = element.key;\n if (null != config)\n for (propName in (void 0 !== config.key && (key = \"\" + config.key), config))\n !hasOwnProperty.call(config, propName) ||\n \"key\" === propName ||\n \"__self\" === propName ||\n \"__source\" === propName ||\n (\"ref\" === propName && void 0 === config.ref) ||\n (props[propName] = config[propName]);\n var propName = arguments.length - 2;\n if (1 === propName) props.children = children;\n else if (1 < propName) {\n for (var childArray = Array(propName), i = 0; i < propName; i++)\n childArray[i] = arguments[i + 2];\n props.children = childArray;\n }\n return ReactElement(element.type, key, props);\n};\nexports.createContext = function (defaultValue) {\n defaultValue = {\n $$typeof: REACT_CONTEXT_TYPE,\n _currentValue: defaultValue,\n _currentValue2: defaultValue,\n _threadCount: 0,\n Provider: null,\n Consumer: null\n };\n defaultValue.Provider = defaultValue;\n defaultValue.Consumer = {\n $$typeof: REACT_CONSUMER_TYPE,\n _context: defaultValue\n };\n return defaultValue;\n};\nexports.createElement = function (type, config, children) {\n var propName,\n props = {},\n key = null;\n if (null != config)\n for (propName in (void 0 !== config.key && (key = \"\" + config.key), config))\n hasOwnProperty.call(config, propName) &&\n \"key\" !== propName &&\n \"__self\" !== propName &&\n \"__source\" !== propName &&\n (props[propName] = config[propName]);\n var childrenLength = arguments.length - 2;\n if (1 === childrenLength) props.children = children;\n else if (1 < childrenLength) {\n for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++)\n childArray[i] = arguments[i + 2];\n props.children = childArray;\n }\n if (type && type.defaultProps)\n for (propName in ((childrenLength = type.defaultProps), childrenLength))\n void 0 === props[propName] &&\n (props[propName] = childrenLength[propName]);\n return ReactElement(type, key, props);\n};\nexports.createRef = function () {\n return { current: null };\n};\nexports.forwardRef = function (render) {\n return { $$typeof: REACT_FORWARD_REF_TYPE, render: render };\n};\nexports.isValidElement = isValidElement;\nexports.lazy = function (ctor) {\n return {\n $$typeof: REACT_LAZY_TYPE,\n _payload: { _status: -1, _result: ctor },\n _init: lazyInitializer\n };\n};\nexports.memo = function (type, compare) {\n return {\n $$typeof: REACT_MEMO_TYPE,\n type: type,\n compare: void 0 === compare ? null : compare\n };\n};\nexports.startTransition = startTransition;\nexports.unstable_useCacheRefresh = function () {\n return ReactSharedInternals.H.useCacheRefresh();\n};\nexports.use = function (usable) {\n return ReactSharedInternals.H.use(usable);\n};\nexports.useActionState = function (action, initialState, permalink) {\n return ReactSharedInternals.H.useActionState(action, initialState, permalink);\n};\nexports.useCallback = function (callback, deps) {\n return ReactSharedInternals.H.useCallback(callback, deps);\n};\nexports.useContext = function (Context) {\n return ReactSharedInternals.H.useContext(Context);\n};\nexports.useDebugValue = function () {};\nexports.useDeferredValue = function (value, initialValue) {\n return ReactSharedInternals.H.useDeferredValue(value, initialValue);\n};\nexports.useEffect = function (create, deps) {\n return ReactSharedInternals.H.useEffect(create, deps);\n};\nexports.useEffectEvent = function (callback) {\n return ReactSharedInternals.H.useEffectEvent(callback);\n};\nexports.useId = function () {\n return ReactSharedInternals.H.useId();\n};\nexports.useImperativeHandle = function (ref, create, deps) {\n return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);\n};\nexports.useInsertionEffect = function (create, deps) {\n return ReactSharedInternals.H.useInsertionEffect(create, deps);\n};\nexports.useLayoutEffect = function (create, deps) {\n return ReactSharedInternals.H.useLayoutEffect(create, deps);\n};\nexports.useMemo = function (create, deps) {\n return ReactSharedInternals.H.useMemo(create, deps);\n};\nexports.useOptimistic = function (passthrough, reducer) {\n return ReactSharedInternals.H.useOptimistic(passthrough, reducer);\n};\nexports.useReducer = function (reducer, initialArg, init) {\n return ReactSharedInternals.H.useReducer(reducer, initialArg, init);\n};\nexports.useRef = function (initialValue) {\n return ReactSharedInternals.H.useRef(initialValue);\n};\nexports.useState = function (initialState) {\n return ReactSharedInternals.H.useState(initialState);\n};\nexports.useSyncExternalStore = function (\n subscribe,\n getSnapshot,\n getServerSnapshot\n) {\n return ReactSharedInternals.H.useSyncExternalStore(\n subscribe,\n getSnapshot,\n getServerSnapshot\n );\n};\nexports.useTransition = function () {\n return ReactSharedInternals.H.useTransition();\n};\nexports.version = \"19.3.1\";\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react.production.js');\n} else {\n module.exports = require('./cjs/react.development.js');\n}\n","/**\n * @license React\n * react-dom.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\");\nfunction formatProdErrorMessage(code) {\n var url = \"https://react.dev/errors/\" + code;\n if (1 < arguments.length) {\n url += \"?args[]=\" + encodeURIComponent(arguments[1]);\n for (var i = 2; i < arguments.length; i++)\n url += \"&args[]=\" + encodeURIComponent(arguments[i]);\n }\n return (\n \"Minified React error #\" +\n code +\n \"; visit \" +\n url +\n \" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"\n );\n}\nfunction noop() {}\nvar Internals = {\n d: {\n f: noop,\n r: function () {\n throw Error(formatProdErrorMessage(522));\n },\n D: noop,\n C: noop,\n L: noop,\n m: noop,\n X: noop,\n S: noop,\n M: noop\n },\n p: 0,\n findDOMNode: null\n },\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_RECOVERABLE_TYPE = Symbol.for(\"react.recoverable\"),\n REACT_OPTIMISTIC_KEY = Symbol.for(\"react.optimistic_key\");\nfunction createPortal$1(children, containerInfo, implementation) {\n var key =\n 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;\n return {\n $$typeof: REACT_PORTAL_TYPE,\n key:\n null == key\n ? null\n : key === REACT_OPTIMISTIC_KEY\n ? REACT_OPTIMISTIC_KEY\n : \"\" + key,\n children: children,\n containerInfo: containerInfo,\n implementation: implementation\n };\n}\nvar ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;\nfunction getCrossOriginStringAs(as, input) {\n if (\"font\" === as) return \"\";\n if (\"string\" === typeof input)\n return \"use-credentials\" === input ? input : \"\";\n}\nexports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =\n Internals;\nexports.browser = function (reason) {\n return { $$typeof: REACT_RECOVERABLE_TYPE, _reason: reason };\n};\nexports.createPortal = function (children, container) {\n var key =\n 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;\n if (\n !container ||\n (1 !== container.nodeType &&\n 9 !== container.nodeType &&\n 11 !== container.nodeType)\n )\n throw Error(formatProdErrorMessage(299));\n return createPortal$1(children, container, null, key);\n};\nexports.flushSync = function (fn) {\n var previousTransition = ReactSharedInternals.T,\n previousUpdatePriority = Internals.p;\n try {\n if (((ReactSharedInternals.T = null), (Internals.p = 2), fn)) return fn();\n } finally {\n (ReactSharedInternals.T = previousTransition),\n (Internals.p = previousUpdatePriority),\n Internals.d.f();\n }\n};\nexports.preconnect = function (href, options) {\n \"string\" === typeof href &&\n (options\n ? ((options = options.crossOrigin),\n (options =\n \"string\" === typeof options\n ? \"use-credentials\" === options\n ? options\n : \"\"\n : void 0))\n : (options = null),\n Internals.d.C(href, options));\n};\nexports.prefetchDNS = function (href) {\n \"string\" === typeof href && Internals.d.D(href);\n};\nexports.preinit = function (href, options) {\n if (\"string\" === typeof href && options && \"string\" === typeof options.as) {\n var as = options.as,\n crossOrigin = getCrossOriginStringAs(as, options.crossOrigin),\n integrity =\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n fetchPriority =\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0;\n \"style\" === as\n ? Internals.d.S(\n href,\n \"string\" === typeof options.precedence ? options.precedence : void 0,\n {\n crossOrigin: crossOrigin,\n integrity: integrity,\n fetchPriority: fetchPriority\n }\n )\n : \"script\" === as &&\n Internals.d.X(href, {\n crossOrigin: crossOrigin,\n integrity: integrity,\n fetchPriority: fetchPriority,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0\n });\n }\n};\nexports.preinitModule = function (href, options) {\n if (\"string\" === typeof href)\n if (\"object\" === typeof options && null !== options) {\n if (null == options.as || \"script\" === options.as) {\n var crossOrigin = getCrossOriginStringAs(\n options.as,\n options.crossOrigin\n );\n Internals.d.M(href, {\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0,\n fetchPriority:\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0\n });\n }\n } else null == options && Internals.d.M(href);\n};\nexports.preload = function (href, options) {\n if (\n \"string\" === typeof href &&\n \"object\" === typeof options &&\n null !== options &&\n \"string\" === typeof options.as\n ) {\n var as = options.as,\n crossOrigin = getCrossOriginStringAs(as, options.crossOrigin);\n Internals.d.L(href, as, {\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0,\n type: \"string\" === typeof options.type ? options.type : void 0,\n fetchPriority:\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0,\n referrerPolicy:\n \"string\" === typeof options.referrerPolicy\n ? options.referrerPolicy\n : void 0,\n imageSrcSet:\n \"string\" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,\n imageSizes:\n \"string\" === typeof options.imageSizes ? options.imageSizes : void 0,\n media: \"string\" === typeof options.media ? options.media : void 0\n });\n }\n};\nexports.preloadModule = function (href, options) {\n if (\"string\" === typeof href)\n if (options) {\n var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);\n Internals.d.m(href, {\n as:\n \"string\" === typeof options.as && \"script\" !== options.as\n ? options.as\n : void 0,\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0,\n fetchPriority:\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0\n });\n } else Internals.d.m(href);\n};\nexports.requestFormReset = function (form) {\n Internals.d.r(form);\n};\nexports.unstable_batchedUpdates = function (fn, a) {\n return fn(a);\n};\nexports.useFormState = function (action, initialState, permalink) {\n return ReactSharedInternals.H.useFormState(action, initialState, permalink);\n};\nexports.useFormStatus = function () {\n return ReactSharedInternals.H.useHostTransitionStatus();\n};\nexports.version = \"19.3.1\";\n","'use strict';\n\nfunction checkDCE() {\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\n if (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'\n ) {\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n // This branch is unreachable because this function is only called\n // in production, but the condition is true only in development.\n // Therefore if the branch is still here, dead code elimination wasn't\n // properly applied.\n // Don't change the message. React DevTools relies on it. Also make sure\n // this message doesn't occur elsewhere in this function, or it will cause\n // a false positive.\n throw new Error('^_^');\n }\n try {\n // Verify that the code above has been dead code eliminated (DCE'd).\n __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);\n } catch (err) {\n // DevTools shouldn't crash React, no matter what.\n // We should still report in case we break this code.\n console.error(err);\n }\n}\n\nif (process.env.NODE_ENV === 'production') {\n // DCE check should happen before ReactDOM bundle executes so that\n // DevTools can report bad minification during injection.\n checkDCE();\n module.exports = require('./cjs/react-dom.production.js');\n} else {\n module.exports = require('./cjs/react-dom.development.js');\n}\n","/**\n * @license React\n * react-dom-client.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/*\n Modernizr 3.0.0pre (Custom Build) | MIT\n*/\n\"use strict\";\nvar Scheduler = require(\"scheduler\"),\n React = require(\"react\"),\n ReactDOM = require(\"react-dom\");\nfunction formatProdErrorMessage(code) {\n var url = \"https://react.dev/errors/\" + code;\n if (1 < arguments.length) {\n url += \"?args[]=\" + encodeURIComponent(arguments[1]);\n for (var i = 2; i < arguments.length; i++)\n url += \"&args[]=\" + encodeURIComponent(arguments[i]);\n }\n return (\n \"Minified React error #\" +\n code +\n \"; visit \" +\n url +\n \" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"\n );\n}\nfunction isValidContainer(node) {\n return !(\n !node ||\n (1 !== node.nodeType && 9 !== node.nodeType && 11 !== node.nodeType)\n );\n}\nfunction getNearestMountedFiber(fiber) {\n for (var node = fiber, nextNode = node; nextNode && !nextNode.alternate; )\n (node = nextNode),\n 0 !== (node.flags & 4098) && (fiber = node.return),\n (nextNode = node.return);\n for (; node.return; ) node = node.return;\n return 3 === node.tag ? fiber : null;\n}\nfunction getSuspenseInstanceFromFiber(fiber) {\n if (13 === fiber.tag) {\n var suspenseState = fiber.memoizedState;\n null === suspenseState &&\n ((fiber = fiber.alternate),\n null !== fiber && (suspenseState = fiber.memoizedState));\n if (null !== suspenseState) return suspenseState.dehydrated;\n }\n return null;\n}\nfunction getActivityInstanceFromFiber(fiber) {\n if (31 === fiber.tag) {\n var activityState = fiber.memoizedState;\n null === activityState &&\n ((fiber = fiber.alternate),\n null !== fiber && (activityState = fiber.memoizedState));\n if (null !== activityState) return activityState.dehydrated;\n }\n return null;\n}\nfunction assertIsMounted(fiber) {\n if (getNearestMountedFiber(fiber) !== fiber)\n throw Error(formatProdErrorMessage(188));\n}\nfunction findCurrentFiberUsingSlowPath(fiber) {\n var alternate = fiber.alternate;\n if (!alternate) {\n alternate = getNearestMountedFiber(fiber);\n if (null === alternate) throw Error(formatProdErrorMessage(188));\n return alternate !== fiber ? null : fiber;\n }\n for (var a = fiber, b = alternate; ; ) {\n var parentA = a.return;\n if (null === parentA) break;\n var parentB = parentA.alternate;\n if (null === parentB) {\n b = parentA.return;\n if (null !== b) {\n a = b;\n continue;\n }\n break;\n }\n if (parentA.child === parentB.child) {\n for (parentB = parentA.child; parentB; ) {\n if (parentB === a) return assertIsMounted(parentA), fiber;\n if (parentB === b) return assertIsMounted(parentA), alternate;\n parentB = parentB.sibling;\n }\n throw Error(formatProdErrorMessage(188));\n }\n if (a.return !== b.return) (a = parentA), (b = parentB);\n else {\n for (var didFindChild = !1, child$0 = parentA.child; child$0; ) {\n if (child$0 === a) {\n didFindChild = !0;\n a = parentA;\n b = parentB;\n break;\n }\n if (child$0 === b) {\n didFindChild = !0;\n b = parentA;\n a = parentB;\n break;\n }\n child$0 = child$0.sibling;\n }\n if (!didFindChild) {\n for (child$0 = parentB.child; child$0; ) {\n if (child$0 === a) {\n didFindChild = !0;\n a = parentB;\n b = parentA;\n break;\n }\n if (child$0 === b) {\n didFindChild = !0;\n b = parentB;\n a = parentA;\n break;\n }\n child$0 = child$0.sibling;\n }\n if (!didFindChild) throw Error(formatProdErrorMessage(189));\n }\n }\n if (a.alternate !== b) throw Error(formatProdErrorMessage(190));\n }\n if (3 !== a.tag) throw Error(formatProdErrorMessage(188));\n return a.stateNode.current === a ? fiber : alternate;\n}\nfunction findCurrentHostFiberImpl(node) {\n var tag = node.tag;\n if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node;\n for (node = node.child; null !== node; ) {\n tag = findCurrentHostFiberImpl(node);\n if (null !== tag) return tag;\n node = node.sibling;\n }\n return null;\n}\nfunction traverseVisibleInstancesAndTextInstances(\n child,\n searchWithinHosts,\n fn,\n a,\n b,\n c\n) {\n for (; null !== child; ) {\n if (\n ((5 === child.tag || 27 === child.tag || 6 === child.tag) &&\n fn(child, a, b, c)) ||\n ((22 !== child.tag || null === child.memoizedState) &&\n (searchWithinHosts || (5 !== child.tag && 27 !== child.tag)) &&\n traverseVisibleInstancesAndTextInstances(\n child.child,\n searchWithinHosts,\n fn,\n a,\n b,\n c\n ))\n )\n return !0;\n child = child.sibling;\n }\n return !1;\n}\nfunction getFragmentParentInstanceOrContainerFiber(fiber) {\n for (fiber = fiber.return; null !== fiber; ) {\n if (3 === fiber.tag || 5 === fiber.tag || 27 === fiber.tag) return fiber;\n fiber = fiber.return;\n }\n return null;\n}\nfunction fiberIsPortaledIntoHost(fiber) {\n var foundPortalParent = !1;\n for (fiber = fiber.return; null !== fiber; ) {\n 4 === fiber.tag && (foundPortalParent = !0);\n if (3 === fiber.tag || 5 === fiber.tag || 27 === fiber.tag) break;\n fiber = fiber.return;\n }\n return foundPortalParent;\n}\nfunction getFragmentInstanceOrTextInstanceSiblings(fiber) {\n var result = [null, null],\n parentHostFiber = getFragmentParentInstanceOrContainerFiber(fiber);\n if (null === parentHostFiber) return result;\n findFragmentInstanceOrTextInstanceSiblings(\n result,\n fiber,\n parentHostFiber.child,\n { foundSelf: !1 }\n );\n return result;\n}\nfunction findFragmentInstanceOrTextInstanceSiblings(\n result,\n self,\n child,\n state\n) {\n for (; null !== child; ) {\n if (child === self) state.foundSelf = !0;\n else if (5 === child.tag || 27 === child.tag || 6 === child.tag) {\n if (state.foundSelf) return (result[1] = child), !0;\n result[0] = child;\n } else if (\n (22 !== child.tag || null === child.memoizedState) &&\n findFragmentInstanceOrTextInstanceSiblings(\n result,\n self,\n child.child,\n state\n )\n )\n return !0;\n child = child.sibling;\n }\n return !1;\n}\nfunction getInstanceFromHostFiber(fiber) {\n switch (fiber.tag) {\n case 5:\n case 27:\n case 6:\n return fiber.stateNode;\n case 3:\n return fiber.stateNode.containerInfo;\n default:\n throw Error(formatProdErrorMessage(559));\n }\n}\nvar searchTarget = null,\n searchBoundary = null;\nfunction isFiberPrecedingCheck(child, target, boundary) {\n return child === boundary\n ? !0\n : child === target\n ? ((searchTarget = child), !0)\n : !1;\n}\nfunction isFiberFollowingCheck(child, target, boundary) {\n return child === boundary\n ? ((searchBoundary = child), !1)\n : child === target\n ? (null !== searchBoundary && (searchTarget = child), !0)\n : !1;\n}\nfunction getParentForFragmentAncestors(inst) {\n if (null === inst) return null;\n do inst = null === inst ? null : inst.return;\n while (inst && 5 !== inst.tag && 27 !== inst.tag && 3 !== inst.tag);\n return inst ? inst : null;\n}\nfunction getLowestCommonAncestor(instA, instB, getParent) {\n for (var depthA = 0, tempA = instA; tempA; tempA = getParent(tempA)) depthA++;\n tempA = 0;\n for (var tempB = instB; tempB; tempB = getParent(tempB)) tempA++;\n for (; 0 < depthA - tempA; ) (instA = getParent(instA)), depthA--;\n for (; 0 < tempA - depthA; ) (instB = getParent(instB)), tempA--;\n for (; depthA--; ) {\n if (instA === instB || (null !== instB && instA === instB.alternate))\n return instA;\n instA = getParent(instA);\n instB = getParent(instB);\n }\n return null;\n}\nvar assign = Object.assign,\n REACT_LEGACY_ELEMENT_TYPE = Symbol.for(\"react.element\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\");\nSymbol.for(\"react.scope\");\nvar REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_LEGACY_HIDDEN_TYPE = Symbol.for(\"react.legacy_hidden\");\nSymbol.for(\"react.tracing_marker\");\nvar REACT_MEMO_CACHE_SENTINEL = Symbol.for(\"react.memo_cache_sentinel\"),\n REACT_VIEW_TRANSITION_TYPE = Symbol.for(\"react.view_transition\"),\n REACT_RECOVERABLE_TYPE = Symbol.for(\"react.recoverable\"),\n MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nfunction getIteratorFn(maybeIterable) {\n if (null === maybeIterable || \"object\" !== typeof maybeIterable) return null;\n maybeIterable =\n (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||\n maybeIterable[\"@@iterator\"];\n return \"function\" === typeof maybeIterable ? maybeIterable : null;\n}\nvar REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\");\nfunction getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n case REACT_VIEW_TRANSITION_TYPE:\n return \"ViewTransition\";\n }\n if (\"object\" === typeof type)\n switch (type.$$typeof) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n}\nvar isArrayImpl = Array.isArray,\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n ReactDOMSharedInternals =\n ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n sharedNotPendingObject = {\n pending: !1,\n data: null,\n method: null,\n action: null\n },\n valueStack = [],\n index = -1;\nfunction createCursor(defaultValue) {\n return { current: defaultValue };\n}\nfunction pop(cursor) {\n 0 > index ||\n ((cursor.current = valueStack[index]), (valueStack[index] = null), index--);\n}\nfunction push(cursor, value) {\n index++;\n valueStack[index] = cursor.current;\n cursor.current = value;\n}\nvar contextStackCursor = createCursor(null),\n contextFiberStackCursor = createCursor(null),\n rootInstanceStackCursor = createCursor(null),\n hostTransitionProviderCursor = createCursor(null);\nfunction pushHostContainer(fiber, nextRootInstance) {\n push(rootInstanceStackCursor, nextRootInstance);\n push(contextFiberStackCursor, fiber);\n push(contextStackCursor, null);\n switch (nextRootInstance.nodeType) {\n case 9:\n case 11:\n fiber = (fiber = nextRootInstance.documentElement)\n ? (fiber = fiber.namespaceURI)\n ? getOwnHostContext(fiber)\n : 0\n : 0;\n break;\n default:\n if (\n ((fiber = nextRootInstance.tagName),\n (nextRootInstance = nextRootInstance.namespaceURI))\n )\n (nextRootInstance = getOwnHostContext(nextRootInstance)),\n (fiber = getChildHostContextProd(nextRootInstance, fiber));\n else\n switch (fiber) {\n case \"svg\":\n fiber = 1;\n break;\n case \"math\":\n fiber = 2;\n break;\n default:\n fiber = 0;\n }\n }\n pop(contextStackCursor);\n push(contextStackCursor, fiber);\n}\nfunction popHostContainer() {\n pop(contextStackCursor);\n pop(contextFiberStackCursor);\n pop(rootInstanceStackCursor);\n}\nfunction pushHostContext(fiber) {\n var stateHook = fiber.memoizedState;\n null !== stateHook &&\n ((HostTransitionContext._currentValue = stateHook.memoizedState),\n push(hostTransitionProviderCursor, fiber));\n stateHook = contextStackCursor.current;\n var JSCompiler_inline_result = getChildHostContextProd(stateHook, fiber.type);\n stateHook !== JSCompiler_inline_result &&\n (push(contextFiberStackCursor, fiber),\n push(contextStackCursor, JSCompiler_inline_result));\n}\nfunction popHostContext(fiber) {\n contextFiberStackCursor.current === fiber &&\n (pop(contextStackCursor), pop(contextFiberStackCursor));\n hostTransitionProviderCursor.current === fiber &&\n (pop(hostTransitionProviderCursor),\n (HostTransitionContext._currentValue = sharedNotPendingObject));\n}\nvar prefix, suffix;\nfunction describeBuiltInComponentFrame(name) {\n if (void 0 === prefix)\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = (match && match[1]) || \"\";\n suffix =\n -1 < x.stack.indexOf(\"\\n at\")\n ? \" ()\"\n : -1 < x.stack.indexOf(\"@\")\n ? \"@unknown:0:0\"\n : \"\";\n }\n return \"\\n\" + prefix + name + suffix;\n}\nvar reentry = !1;\nfunction describeNativeComponentFrame(fn, construct) {\n if (!fn || reentry) return \"\";\n reentry = !0;\n var previousPrepareStackTrace = Error.prepareStackTrace;\n Error.prepareStackTrace = void 0;\n try {\n var RunInRootFrame = {\n DetermineComponentFrameRoot: function () {\n try {\n if (construct) {\n var Fake = function () {\n throw Error();\n };\n Object.defineProperty(Fake.prototype, \"props\", {\n set: function () {\n throw Error();\n }\n });\n if (\"object\" === typeof Reflect && Reflect.construct) {\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n var control = x;\n }\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x$1) {\n control = x$1;\n }\n Fake = !1;\n try {\n var prevProps = Object.getOwnPropertyDescriptor(\n fn.prototype,\n \"props\"\n );\n Object.defineProperty(fn.prototype, \"props\", {\n configurable: !0,\n set: function () {\n throw Error();\n }\n });\n Fake = !0;\n new fn();\n } finally {\n Fake &&\n (void 0 !== prevProps\n ? Object.defineProperty(fn.prototype, \"props\", prevProps)\n : delete fn.prototype.props);\n }\n }\n } else {\n try {\n throw Error();\n } catch (x$2) {\n control = x$2;\n }\n (Fake = fn()) &&\n \"function\" === typeof Fake.catch &&\n Fake.catch(function () {});\n }\n } catch (sample) {\n if (sample && control && \"string\" === typeof sample.stack)\n return [sample.stack, control.stack];\n }\n return [null, null];\n }\n };\n RunInRootFrame.DetermineComponentFrameRoot.displayName =\n \"DetermineComponentFrameRoot\";\n var namePropDescriptor = Object.getOwnPropertyDescriptor(\n RunInRootFrame.DetermineComponentFrameRoot,\n \"name\"\n );\n namePropDescriptor &&\n namePropDescriptor.configurable &&\n Object.defineProperty(\n RunInRootFrame.DetermineComponentFrameRoot,\n \"name\",\n { value: \"DetermineComponentFrameRoot\" }\n );\n var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(),\n sampleStack = _RunInRootFrame$Deter[0],\n controlStack = _RunInRootFrame$Deter[1];\n if (sampleStack && controlStack) {\n var sampleLines = sampleStack.split(\"\\n\"),\n controlLines = controlStack.split(\"\\n\");\n for (\n namePropDescriptor = RunInRootFrame = 0;\n RunInRootFrame < sampleLines.length &&\n !sampleLines[RunInRootFrame].includes(\"DetermineComponentFrameRoot\");\n\n )\n RunInRootFrame++;\n for (\n ;\n namePropDescriptor < controlLines.length &&\n !controlLines[namePropDescriptor].includes(\n \"DetermineComponentFrameRoot\"\n );\n\n )\n namePropDescriptor++;\n if (\n RunInRootFrame === sampleLines.length ||\n namePropDescriptor === controlLines.length\n )\n for (\n RunInRootFrame = sampleLines.length - 1,\n namePropDescriptor = controlLines.length - 1;\n 1 <= RunInRootFrame &&\n 0 <= namePropDescriptor &&\n sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor];\n\n )\n namePropDescriptor--;\n for (\n ;\n 1 <= RunInRootFrame && 0 <= namePropDescriptor;\n RunInRootFrame--, namePropDescriptor--\n )\n if (sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]) {\n if (1 !== RunInRootFrame || 1 !== namePropDescriptor) {\n do\n if (\n (RunInRootFrame--,\n namePropDescriptor--,\n 0 > namePropDescriptor ||\n sampleLines[RunInRootFrame] !==\n controlLines[namePropDescriptor])\n ) {\n var frame =\n \"\\n\" +\n sampleLines[RunInRootFrame].replace(\" at new \", \" at \");\n fn.displayName &&\n frame.includes(\"\") &&\n (frame = frame.replace(\"\", fn.displayName));\n return frame;\n }\n while (1 <= RunInRootFrame && 0 <= namePropDescriptor);\n }\n break;\n }\n }\n } finally {\n (reentry = !1), (Error.prepareStackTrace = previousPrepareStackTrace);\n }\n return (previousPrepareStackTrace = fn ? fn.displayName || fn.name : \"\")\n ? describeBuiltInComponentFrame(previousPrepareStackTrace)\n : \"\";\n}\nfunction describeFiber(fiber, childFiber) {\n switch (fiber.tag) {\n case 26:\n case 27:\n case 5:\n return describeBuiltInComponentFrame(fiber.type);\n case 16:\n return describeBuiltInComponentFrame(\"Lazy\");\n case 13:\n return fiber.child !== childFiber && null !== childFiber\n ? describeBuiltInComponentFrame(\"Suspense Fallback\")\n : describeBuiltInComponentFrame(\"Suspense\");\n case 19:\n return describeBuiltInComponentFrame(\"SuspenseList\");\n case 0:\n case 15:\n return describeNativeComponentFrame(fiber.type, !1);\n case 11:\n return describeNativeComponentFrame(fiber.type.render, !1);\n case 1:\n return describeNativeComponentFrame(fiber.type, !0);\n case 31:\n return describeBuiltInComponentFrame(\"Activity\");\n case 30:\n return describeBuiltInComponentFrame(\"ViewTransition\");\n default:\n return \"\";\n }\n}\nfunction getStackByFiberInDevAndProd(workInProgress) {\n try {\n var info = \"\",\n previous = null;\n do\n (info += describeFiber(workInProgress, previous)),\n (previous = workInProgress),\n (workInProgress = workInProgress.return);\n while (workInProgress);\n return info;\n } catch (x) {\n return \"\\nError generating stack: \" + x.message + \"\\n\" + x.stack;\n }\n}\nvar hasOwnProperty = Object.prototype.hasOwnProperty,\n scheduleCallback$3 = Scheduler.unstable_scheduleCallback,\n cancelCallback$1 = Scheduler.unstable_cancelCallback,\n shouldYield = Scheduler.unstable_shouldYield,\n requestPaint = Scheduler.unstable_requestPaint,\n now = Scheduler.unstable_now,\n getCurrentPriorityLevel = Scheduler.unstable_getCurrentPriorityLevel,\n ImmediatePriority = Scheduler.unstable_ImmediatePriority,\n UserBlockingPriority = Scheduler.unstable_UserBlockingPriority,\n NormalPriority$1 = Scheduler.unstable_NormalPriority,\n LowPriority = Scheduler.unstable_LowPriority,\n IdlePriority = Scheduler.unstable_IdlePriority,\n log$1 = Scheduler.log,\n unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue,\n rendererID = null,\n injectedHook = null;\nfunction setIsStrictModeForDevtools(newIsStrictMode) {\n \"function\" === typeof log$1 && unstable_setDisableYieldValue(newIsStrictMode);\n if (injectedHook && \"function\" === typeof injectedHook.setStrictMode)\n try {\n injectedHook.setStrictMode(rendererID, newIsStrictMode);\n } catch (err) {}\n}\nvar clz32 = Math.clz32 ? Math.clz32 : clz32Fallback,\n log = Math.log,\n LN2 = Math.LN2;\nfunction clz32Fallback(x) {\n x >>>= 0;\n return 0 === x ? 32 : (31 - ((log(x) / LN2) | 0)) | 0;\n}\nvar nextTransitionUpdateLane = 256,\n nextTransitionDeferredLane = 262144,\n nextRetryLane = 4194304;\nfunction getHighestPriorityLanes(lanes) {\n var pendingSyncLanes = lanes & 42;\n if (0 !== pendingSyncLanes) return pendingSyncLanes;\n switch (lanes & -lanes) {\n case 1:\n return 1;\n case 2:\n return 2;\n case 4:\n return 4;\n case 8:\n return 8;\n case 16:\n return 16;\n case 32:\n return 32;\n case 64:\n return 64;\n case 128:\n return 128;\n case 256:\n case 512:\n case 1024:\n case 2048:\n case 4096:\n case 8192:\n case 16384:\n case 32768:\n case 65536:\n case 131072:\n return lanes & -lanes;\n case 262144:\n case 524288:\n case 1048576:\n case 2097152:\n return lanes & 3932160;\n case 4194304:\n case 8388608:\n case 16777216:\n case 33554432:\n return lanes & 62914560;\n case 67108864:\n return 67108864;\n case 134217728:\n return 134217728;\n case 268435456:\n return 268435456;\n case 536870912:\n return 536870912;\n case 1073741824:\n return 0;\n default:\n return lanes;\n }\n}\nfunction getNextLanes(root, wipLanes, rootHasPendingCommit) {\n var pendingLanes = root.pendingLanes;\n if (0 === pendingLanes) return 0;\n var nextLanes = 0,\n suspendedLanes = root.suspendedLanes,\n pingedLanes = root.pingedLanes;\n root = root.warmLanes;\n var nonIdlePendingLanes = pendingLanes & 134217727;\n 0 !== nonIdlePendingLanes\n ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes),\n 0 !== pendingLanes\n ? (nextLanes = getHighestPriorityLanes(pendingLanes))\n : ((pingedLanes &= nonIdlePendingLanes),\n 0 !== pingedLanes\n ? (nextLanes = getHighestPriorityLanes(pingedLanes))\n : rootHasPendingCommit ||\n ((rootHasPendingCommit = nonIdlePendingLanes & ~root),\n 0 !== rootHasPendingCommit &&\n (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))))\n : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes),\n 0 !== nonIdlePendingLanes\n ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes))\n : 0 !== pingedLanes\n ? (nextLanes = getHighestPriorityLanes(pingedLanes))\n : rootHasPendingCommit ||\n ((rootHasPendingCommit = pendingLanes & ~root),\n 0 !== rootHasPendingCommit &&\n (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))));\n return 0 === nextLanes\n ? 0\n : 0 !== wipLanes &&\n wipLanes !== nextLanes &&\n 0 === (wipLanes & suspendedLanes) &&\n ((suspendedLanes = nextLanes & -nextLanes),\n (rootHasPendingCommit = wipLanes & -wipLanes),\n suspendedLanes >= rootHasPendingCommit ||\n (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194048)))\n ? wipLanes\n : nextLanes;\n}\nfunction checkIfRootIsPrerendering(root, renderLanes) {\n return (\n 0 ===\n (root.pendingLanes &\n ~(root.suspendedLanes & ~root.pingedLanes) &\n renderLanes)\n );\n}\nfunction getEntangledLanes(root, renderLanes) {\n 0 !== (renderLanes & 8) && (renderLanes |= renderLanes & 32);\n var allEntangledLanes = root.entangledLanes;\n if (0 !== allEntangledLanes)\n for (\n root = root.entanglements, allEntangledLanes &= renderLanes;\n 0 < allEntangledLanes;\n\n ) {\n var index$4 = 31 - clz32(allEntangledLanes),\n lane = 1 << index$4;\n renderLanes |= root[index$4];\n allEntangledLanes &= ~lane;\n }\n return renderLanes;\n}\nfunction computeExpirationTime(lane, currentTime) {\n switch (lane) {\n case 1:\n case 2:\n case 4:\n case 8:\n case 64:\n return currentTime + 250;\n case 16:\n case 32:\n case 128:\n case 256:\n case 512:\n case 1024:\n case 2048:\n case 4096:\n case 8192:\n case 16384:\n case 32768:\n case 65536:\n case 131072:\n case 262144:\n case 524288:\n case 1048576:\n case 2097152:\n return currentTime + 5e3;\n case 4194304:\n case 8388608:\n case 16777216:\n case 33554432:\n return -1;\n case 67108864:\n case 134217728:\n case 268435456:\n case 536870912:\n case 1073741824:\n return -1;\n default:\n return -1;\n }\n}\nfunction claimNextRetryLane() {\n var lane = nextRetryLane;\n nextRetryLane <<= 1;\n 0 === (nextRetryLane & 62914560) && (nextRetryLane = 4194304);\n return lane;\n}\nfunction createLaneMap(initial) {\n for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial);\n return laneMap;\n}\nfunction markRootUpdated$1(root, updateLane) {\n root.pendingLanes |= updateLane;\n 268435456 !== updateLane &&\n ((root.suspendedLanes = 0), (root.pingedLanes = 0), (root.warmLanes = 0));\n}\nfunction markRootFinished(\n root,\n finishedLanes,\n remainingLanes,\n spawnedLane,\n updatedLanes,\n suspendedRetryLanes\n) {\n var previouslyPendingLanes = root.pendingLanes;\n root.pendingLanes = remainingLanes;\n root.suspendedLanes = 0;\n root.pingedLanes = 0;\n root.warmLanes = 0;\n root.expiredLanes &= remainingLanes;\n root.entangledLanes &= remainingLanes;\n root.errorRecoveryDisabledLanes &= remainingLanes;\n root.shellSuspendCounter = 0;\n var entanglements = root.entanglements,\n expirationTimes = root.expirationTimes,\n hiddenUpdates = root.hiddenUpdates;\n for (\n remainingLanes = previouslyPendingLanes & ~remainingLanes;\n 0 < remainingLanes;\n\n ) {\n var index$7 = 31 - clz32(remainingLanes),\n lane = 1 << index$7;\n entanglements[index$7] = 0;\n expirationTimes[index$7] = -1;\n var hiddenUpdatesForLane = hiddenUpdates[index$7];\n if (null !== hiddenUpdatesForLane)\n for (\n hiddenUpdates[index$7] = null, index$7 = 0;\n index$7 < hiddenUpdatesForLane.length;\n index$7++\n ) {\n var update = hiddenUpdatesForLane[index$7];\n null !== update && (update.lane &= -536870913);\n }\n remainingLanes &= ~lane;\n }\n 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0);\n 0 !== suspendedRetryLanes &&\n 0 === updatedLanes &&\n 0 !== root.tag &&\n (root.suspendedLanes |=\n suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes));\n}\nfunction markSpawnedDeferredLane(root, spawnedLane, entangledLanes) {\n root.pendingLanes |= spawnedLane;\n root.suspendedLanes &= ~spawnedLane;\n var spawnedLaneIndex = 31 - clz32(spawnedLane);\n root.entangledLanes |= spawnedLane;\n root.entanglements[spawnedLaneIndex] =\n root.entanglements[spawnedLaneIndex] |\n 1073741824 |\n (entangledLanes & 261930);\n}\nfunction markRootEntangled(root, entangledLanes) {\n var rootEntangledLanes = (root.entangledLanes |= entangledLanes);\n for (root = root.entanglements; rootEntangledLanes; ) {\n var index$8 = 31 - clz32(rootEntangledLanes),\n lane = 1 << index$8;\n (lane & entangledLanes) | (root[index$8] & entangledLanes) &&\n (root[index$8] |= entangledLanes);\n rootEntangledLanes &= ~lane;\n }\n}\nfunction getBumpedLaneForHydration(root, renderLanes) {\n var renderLane = renderLanes & -renderLanes;\n renderLane =\n 0 !== (renderLane & 42) ? 1 : getBumpedLaneForHydrationByLane(renderLane);\n return 0 !== (renderLane & (root.suspendedLanes | renderLanes))\n ? 0\n : renderLane;\n}\nfunction getBumpedLaneForHydrationByLane(lane) {\n switch (lane) {\n case 2:\n lane = 1;\n break;\n case 8:\n lane = 4;\n break;\n case 32:\n lane = 16;\n break;\n case 256:\n case 512:\n case 1024:\n case 2048:\n case 4096:\n case 8192:\n case 16384:\n case 32768:\n case 65536:\n case 131072:\n case 262144:\n case 524288:\n case 1048576:\n case 2097152:\n case 4194304:\n case 8388608:\n case 16777216:\n case 33554432:\n lane = 128;\n break;\n case 268435456:\n lane = 134217728;\n break;\n default:\n lane = 0;\n }\n return lane;\n}\nfunction lanesToEventPriority(lanes) {\n lanes &= -lanes;\n return 2 < lanes\n ? 8 < lanes\n ? 0 !== (lanes & 134217727)\n ? 32\n : 268435456\n : 8\n : 2;\n}\nfunction resolveUpdatePriority() {\n var updatePriority = ReactDOMSharedInternals.p;\n if (0 !== updatePriority) return updatePriority;\n updatePriority = window.event;\n return void 0 === updatePriority ? 32 : getEventPriority(updatePriority.type);\n}\nfunction runWithPriority(priority, fn) {\n var previousPriority = ReactDOMSharedInternals.p;\n try {\n return (ReactDOMSharedInternals.p = priority), fn();\n } finally {\n ReactDOMSharedInternals.p = previousPriority;\n }\n}\nvar randomKey = Math.random().toString(36).slice(2),\n internalInstanceKey = \"__reactFiber$\" + randomKey,\n internalPropsKey = \"__reactProps$\" + randomKey,\n internalContainerInstanceKey = \"__reactContainer$\" + randomKey,\n internalEventHandlersKey = \"__reactEvents$\" + randomKey,\n internalEventHandlerListenersKey = \"__reactListeners$\" + randomKey,\n internalEventHandlesSetKey = \"__reactHandles$\" + randomKey,\n internalRootNodeResourcesKey = \"__reactResources$\" + randomKey,\n internalHoistableMarker = \"__reactMarker$\" + randomKey,\n internalLoadPendingKey = \"__reactLoad$\" + randomKey;\nfunction detachDeletedInstance(node) {\n delete node[internalInstanceKey];\n delete node[internalPropsKey];\n delete node[internalEventHandlerListenersKey];\n delete node[internalEventHandlesSetKey];\n}\nfunction getClosestInstanceFromNode(targetNode) {\n var targetInst;\n if ((targetInst = targetNode[internalInstanceKey])) return targetInst;\n for (var parentNode = targetNode.parentNode; parentNode; ) {\n if (\n (targetInst =\n parentNode[internalContainerInstanceKey] ||\n parentNode[internalInstanceKey])\n ) {\n parentNode = targetInst.alternate;\n if (\n null !== targetInst.child ||\n (null !== parentNode && null !== parentNode.child)\n )\n for (\n targetNode = getParentHydrationBoundary(targetNode);\n null !== targetNode;\n\n ) {\n if ((parentNode = targetNode[internalInstanceKey])) return parentNode;\n targetNode = getParentHydrationBoundary(targetNode);\n }\n return targetInst;\n }\n targetNode = parentNode;\n parentNode = targetNode.parentNode;\n }\n return null;\n}\nfunction getInstanceFromNode(node) {\n if (\n (node = node[internalInstanceKey] || node[internalContainerInstanceKey])\n ) {\n var tag = node.tag;\n if (\n 5 === tag ||\n 6 === tag ||\n 13 === tag ||\n 31 === tag ||\n 26 === tag ||\n 27 === tag ||\n 3 === tag\n )\n return node;\n }\n return null;\n}\nfunction getNodeFromInstance(inst) {\n var tag = inst.tag;\n if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return inst.stateNode;\n throw Error(formatProdErrorMessage(33));\n}\nfunction getResourcesFromRoot(root) {\n var resources = root[internalRootNodeResourcesKey];\n resources ||\n (resources = root[internalRootNodeResourcesKey] =\n { hoistableStyles: new Map(), hoistableScripts: new Map() });\n return resources;\n}\nfunction markNodeAsHoistable(node) {\n node[internalHoistableMarker] = !0;\n}\nfunction clearPendingLoadOnNode(node) {\n node[internalLoadPendingKey] = void 0;\n}\nvar allNativeEvents = new Set(),\n registrationNameDependencies = {};\nfunction registerTwoPhaseEvent(registrationName, dependencies) {\n registerDirectEvent(registrationName, dependencies);\n registerDirectEvent(registrationName + \"Capture\", dependencies);\n}\nfunction registerDirectEvent(registrationName, dependencies) {\n registrationNameDependencies[registrationName] = dependencies;\n for (\n registrationName = 0;\n registrationName < dependencies.length;\n registrationName++\n )\n allNativeEvents.add(dependencies[registrationName]);\n}\nvar VALID_ATTRIBUTE_NAME_REGEX = RegExp(\n \"^[:A-Z_a-z\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD][:A-Z_a-z\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD\\\\-.0-9\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040]*$\"\n ),\n illegalAttributeNameCache = {},\n validatedAttributeNameCache = {};\nfunction isAttributeNameSafe(attributeName) {\n if (hasOwnProperty.call(validatedAttributeNameCache, attributeName))\n return !0;\n if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) return !1;\n if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName))\n return (validatedAttributeNameCache[attributeName] = !0);\n illegalAttributeNameCache[attributeName] = !0;\n return !1;\n}\nvar viewTransitionMutationContext = !1;\nfunction pushMutationContext() {\n var prev = viewTransitionMutationContext;\n viewTransitionMutationContext = !1;\n return prev;\n}\nfunction setValueForAttribute(node, name, value) {\n if (isAttributeNameSafe(name))\n if (null === value) node.removeAttribute(name);\n else {\n switch (typeof value) {\n case \"undefined\":\n case \"function\":\n case \"symbol\":\n node.removeAttribute(name);\n return;\n case \"boolean\":\n var prefix$10 = name.toLowerCase().slice(0, 5);\n if (\"data-\" !== prefix$10 && \"aria-\" !== prefix$10) {\n node.removeAttribute(name);\n return;\n }\n }\n node.setAttribute(name, value);\n }\n}\nfunction setValueForKnownAttribute(node, name, value) {\n if (null === value) node.removeAttribute(name);\n else {\n switch (typeof value) {\n case \"undefined\":\n case \"function\":\n case \"symbol\":\n case \"boolean\":\n node.removeAttribute(name);\n return;\n }\n node.setAttribute(name, value);\n }\n}\nfunction setValueForNamespacedAttribute(node, namespace, name, value) {\n if (null === value) node.removeAttribute(name);\n else {\n switch (typeof value) {\n case \"undefined\":\n case \"function\":\n case \"symbol\":\n case \"boolean\":\n node.removeAttribute(name);\n return;\n }\n node.setAttributeNS(namespace, name, value);\n }\n}\nfunction getToStringValue(value) {\n switch (typeof value) {\n case \"bigint\":\n case \"boolean\":\n case \"number\":\n case \"string\":\n case \"undefined\":\n return value;\n case \"object\":\n return value;\n default:\n return \"\";\n }\n}\nfunction isCheckable(elem) {\n var type = elem.type;\n return (\n (elem = elem.nodeName) &&\n \"input\" === elem.toLowerCase() &&\n (\"checkbox\" === type || \"radio\" === type)\n );\n}\nfunction trackValueOnNode(node, valueField, currentValue) {\n var descriptor = Object.getOwnPropertyDescriptor(\n node.constructor.prototype,\n valueField\n );\n if (\n !node.hasOwnProperty(valueField) &&\n \"undefined\" !== typeof descriptor &&\n \"function\" === typeof descriptor.get &&\n \"function\" === typeof descriptor.set\n ) {\n var get = descriptor.get,\n set = descriptor.set;\n Object.defineProperty(node, valueField, {\n configurable: !0,\n get: function () {\n return get.call(this);\n },\n set: function (value) {\n currentValue = \"\" + value;\n set.call(this, value);\n }\n });\n Object.defineProperty(node, valueField, {\n enumerable: descriptor.enumerable\n });\n return {\n getValue: function () {\n return currentValue;\n },\n setValue: function (value) {\n currentValue = \"\" + value;\n },\n stopTracking: function () {\n node._valueTracker = null;\n delete node[valueField];\n }\n };\n }\n}\nfunction track(node) {\n if (!node._valueTracker) {\n var valueField = isCheckable(node) ? \"checked\" : \"value\";\n node._valueTracker = trackValueOnNode(\n node,\n valueField,\n \"\" + node[valueField]\n );\n }\n}\nfunction updateValueIfChanged(node) {\n if (!node) return !1;\n var tracker = node._valueTracker;\n if (!tracker) return !0;\n var lastValue = tracker.getValue();\n var value = \"\";\n node &&\n (value = isCheckable(node)\n ? node.checked\n ? \"true\"\n : \"false\"\n : node.value);\n node = value;\n return node !== lastValue ? (tracker.setValue(node), !0) : !1;\n}\nvar escapeSelectorAttributeValueInsideDoubleQuotesRegex = /[\\n\"\\\\]/g;\nfunction escapeSelectorAttributeValueInsideDoubleQuotes(value) {\n return value.replace(\n escapeSelectorAttributeValueInsideDoubleQuotesRegex,\n function (ch) {\n return \"\\\\\" + ch.charCodeAt(0).toString(16) + \" \";\n }\n );\n}\nfunction updateInput(\n element,\n value,\n defaultValue,\n lastDefaultValue,\n checked,\n defaultChecked,\n type,\n name\n) {\n element.name = \"\";\n null != type &&\n \"function\" !== typeof type &&\n \"symbol\" !== typeof type &&\n \"boolean\" !== typeof type\n ? (element.type = type)\n : element.removeAttribute(\"type\");\n if (null != value)\n if (\"number\" === type) {\n if ((0 === value && \"\" === element.value) || element.value != value)\n element.value = \"\" + getToStringValue(value);\n } else\n element.value !== \"\" + getToStringValue(value) &&\n (element.value = \"\" + getToStringValue(value));\n else\n (\"submit\" !== type && \"reset\" !== type) || element.removeAttribute(\"value\");\n null != value\n ? \"number\" === type && element.value == value\n ? setDefaultValue(element, getToStringValue(element.value))\n : setDefaultValue(element, getToStringValue(value))\n : null != defaultValue\n ? setDefaultValue(element, getToStringValue(defaultValue))\n : null != lastDefaultValue && element.removeAttribute(\"value\");\n null == checked &&\n null != defaultChecked &&\n (element.defaultChecked = !!defaultChecked);\n null != checked &&\n (element.checked =\n checked && \"function\" !== typeof checked && \"symbol\" !== typeof checked);\n null != name &&\n \"function\" !== typeof name &&\n \"symbol\" !== typeof name &&\n \"boolean\" !== typeof name\n ? (element.name = \"\" + getToStringValue(name))\n : element.removeAttribute(\"name\");\n}\nfunction initInput(\n element,\n value,\n defaultValue,\n checked,\n defaultChecked,\n type,\n name,\n isHydrating\n) {\n null != type &&\n \"function\" !== typeof type &&\n \"symbol\" !== typeof type &&\n \"boolean\" !== typeof type &&\n (element.type = type);\n if (null != value || null != defaultValue) {\n if (\n !(\n (\"submit\" !== type && \"reset\" !== type) ||\n (void 0 !== value && null !== value)\n )\n ) {\n track(element);\n return;\n }\n defaultValue =\n null != defaultValue ? \"\" + getToStringValue(defaultValue) : \"\";\n value = null != value ? \"\" + getToStringValue(value) : defaultValue;\n isHydrating || value === element.value || (element.value = value);\n element.defaultValue = value;\n }\n checked = null != checked ? checked : defaultChecked;\n checked =\n \"function\" !== typeof checked && \"symbol\" !== typeof checked && !!checked;\n element.checked = isHydrating ? element.checked : !!checked;\n element.defaultChecked = !!checked;\n null != name &&\n \"function\" !== typeof name &&\n \"symbol\" !== typeof name &&\n \"boolean\" !== typeof name &&\n (element.name = name);\n track(element);\n}\nfunction setDefaultValue(node, value) {\n node.defaultValue !== \"\" + value && (node.defaultValue = \"\" + value);\n}\nfunction updateOptions(node, multiple, propValue, setDefaultSelected) {\n node = node.options;\n if (multiple) {\n multiple = {};\n for (var i = 0; i < propValue.length; i++)\n multiple[\"$\" + propValue[i]] = !0;\n for (propValue = 0; propValue < node.length; propValue++)\n (i = multiple.hasOwnProperty(\"$\" + node[propValue].value)),\n node[propValue].selected !== i && (node[propValue].selected = i),\n i && setDefaultSelected && (node[propValue].defaultSelected = !0);\n } else {\n propValue = \"\" + getToStringValue(propValue);\n multiple = null;\n for (i = 0; i < node.length; i++) {\n if (node[i].value === propValue) {\n node[i].selected = !0;\n setDefaultSelected && (node[i].defaultSelected = !0);\n return;\n }\n null !== multiple || node[i].disabled || (multiple = node[i]);\n }\n null !== multiple && (multiple.selected = !0);\n }\n}\nfunction updateTextarea(element, value, defaultValue) {\n if (\n null != value &&\n ((value = \"\" + getToStringValue(value)),\n value !== element.value && (element.value = value),\n null == defaultValue)\n ) {\n element.defaultValue !== value && (element.defaultValue = value);\n return;\n }\n element.defaultValue =\n null != defaultValue ? \"\" + getToStringValue(defaultValue) : \"\";\n}\nfunction initTextarea(element, value, defaultValue, children) {\n if (null == value) {\n if (null != children) {\n if (null != defaultValue) throw Error(formatProdErrorMessage(92));\n if (isArrayImpl(children)) {\n if (1 < children.length) throw Error(formatProdErrorMessage(93));\n children = children[0];\n }\n defaultValue = children;\n }\n null == defaultValue && (defaultValue = \"\");\n value = defaultValue;\n }\n defaultValue = getToStringValue(value);\n element.defaultValue = defaultValue;\n children = element.textContent;\n children === defaultValue &&\n \"\" !== children &&\n null !== children &&\n (element.value = children);\n track(element);\n}\nfunction setTextContent(node, text) {\n if (text) {\n var firstChild = node.firstChild;\n if (\n firstChild &&\n firstChild === node.lastChild &&\n 3 === firstChild.nodeType\n ) {\n firstChild.nodeValue = text;\n return;\n }\n }\n node.textContent = text;\n}\nvar unitlessNumbers = new Set(\n \"animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp\".split(\n \" \"\n )\n);\nfunction setValueForStyle(style, styleName, value) {\n var isCustomProperty = 0 === styleName.indexOf(\"--\");\n null == value || \"boolean\" === typeof value || \"\" === value\n ? isCustomProperty\n ? style.setProperty(styleName, \"\")\n : \"float\" === styleName\n ? (style.cssFloat = \"\")\n : (style[styleName] = \"\")\n : isCustomProperty\n ? style.setProperty(styleName, value)\n : \"number\" !== typeof value ||\n 0 === value ||\n unitlessNumbers.has(styleName)\n ? \"float\" === styleName\n ? (style.cssFloat = value)\n : (style[styleName] = (\"\" + value).trim())\n : (style[styleName] = value + \"px\");\n}\nfunction setValueForStyles(node, styles, prevStyles) {\n if (null != styles && \"object\" !== typeof styles)\n throw Error(formatProdErrorMessage(62));\n node = node.style;\n if (null != prevStyles) {\n for (var styleName in prevStyles)\n !prevStyles.hasOwnProperty(styleName) ||\n (null != styles && styles.hasOwnProperty(styleName)) ||\n (0 === styleName.indexOf(\"--\")\n ? node.setProperty(styleName, \"\")\n : \"float\" === styleName\n ? (node.cssFloat = \"\")\n : (node[styleName] = \"\"),\n (viewTransitionMutationContext = !0));\n for (var styleName$16 in styles)\n (styleName = styles[styleName$16]),\n styles.hasOwnProperty(styleName$16) &&\n prevStyles[styleName$16] !== styleName &&\n (setValueForStyle(node, styleName$16, styleName),\n (viewTransitionMutationContext = !0));\n } else\n for (var styleName$17 in styles)\n styles.hasOwnProperty(styleName$17) &&\n setValueForStyle(node, styleName$17, styles[styleName$17]);\n}\nfunction isCustomElement(tagName) {\n if (-1 === tagName.indexOf(\"-\")) return !1;\n switch (tagName) {\n case \"annotation-xml\":\n case \"color-profile\":\n case \"font-face\":\n case \"font-face-src\":\n case \"font-face-uri\":\n case \"font-face-format\":\n case \"font-face-name\":\n case \"missing-glyph\":\n return !1;\n default:\n return !0;\n }\n}\nvar aliases = new Map([\n [\"acceptCharset\", \"accept-charset\"],\n [\"htmlFor\", \"for\"],\n [\"httpEquiv\", \"http-equiv\"],\n [\"crossOrigin\", \"crossorigin\"],\n [\"accentHeight\", \"accent-height\"],\n [\"alignmentBaseline\", \"alignment-baseline\"],\n [\"arabicForm\", \"arabic-form\"],\n [\"baselineShift\", \"baseline-shift\"],\n [\"capHeight\", \"cap-height\"],\n [\"clipPath\", \"clip-path\"],\n [\"clipRule\", \"clip-rule\"],\n [\"colorInterpolation\", \"color-interpolation\"],\n [\"colorInterpolationFilters\", \"color-interpolation-filters\"],\n [\"colorProfile\", \"color-profile\"],\n [\"colorRendering\", \"color-rendering\"],\n [\"dominantBaseline\", \"dominant-baseline\"],\n [\"enableBackground\", \"enable-background\"],\n [\"fillOpacity\", \"fill-opacity\"],\n [\"fillRule\", \"fill-rule\"],\n [\"floodColor\", \"flood-color\"],\n [\"floodOpacity\", \"flood-opacity\"],\n [\"fontFamily\", \"font-family\"],\n [\"fontSize\", \"font-size\"],\n [\"fontSizeAdjust\", \"font-size-adjust\"],\n [\"fontStretch\", \"font-stretch\"],\n [\"fontStyle\", \"font-style\"],\n [\"fontVariant\", \"font-variant\"],\n [\"fontWeight\", \"font-weight\"],\n [\"glyphName\", \"glyph-name\"],\n [\"glyphOrientationHorizontal\", \"glyph-orientation-horizontal\"],\n [\"glyphOrientationVertical\", \"glyph-orientation-vertical\"],\n [\"horizAdvX\", \"horiz-adv-x\"],\n [\"horizOriginX\", \"horiz-origin-x\"],\n [\"imageRendering\", \"image-rendering\"],\n [\"letterSpacing\", \"letter-spacing\"],\n [\"lightingColor\", \"lighting-color\"],\n [\"markerEnd\", \"marker-end\"],\n [\"markerMid\", \"marker-mid\"],\n [\"markerStart\", \"marker-start\"],\n [\"maskType\", \"mask-type\"],\n [\"overlinePosition\", \"overline-position\"],\n [\"overlineThickness\", \"overline-thickness\"],\n [\"paintOrder\", \"paint-order\"],\n [\"panose-1\", \"panose-1\"],\n [\"pointerEvents\", \"pointer-events\"],\n [\"renderingIntent\", \"rendering-intent\"],\n [\"shapeRendering\", \"shape-rendering\"],\n [\"stopColor\", \"stop-color\"],\n [\"stopOpacity\", \"stop-opacity\"],\n [\"strikethroughPosition\", \"strikethrough-position\"],\n [\"strikethroughThickness\", \"strikethrough-thickness\"],\n [\"strokeDasharray\", \"stroke-dasharray\"],\n [\"strokeDashoffset\", \"stroke-dashoffset\"],\n [\"strokeLinecap\", \"stroke-linecap\"],\n [\"strokeLinejoin\", \"stroke-linejoin\"],\n [\"strokeMiterlimit\", \"stroke-miterlimit\"],\n [\"strokeOpacity\", \"stroke-opacity\"],\n [\"strokeWidth\", \"stroke-width\"],\n [\"textAnchor\", \"text-anchor\"],\n [\"textDecoration\", \"text-decoration\"],\n [\"textRendering\", \"text-rendering\"],\n [\"transformOrigin\", \"transform-origin\"],\n [\"underlinePosition\", \"underline-position\"],\n [\"underlineThickness\", \"underline-thickness\"],\n [\"unicodeBidi\", \"unicode-bidi\"],\n [\"unicodeRange\", \"unicode-range\"],\n [\"unitsPerEm\", \"units-per-em\"],\n [\"vAlphabetic\", \"v-alphabetic\"],\n [\"vHanging\", \"v-hanging\"],\n [\"vIdeographic\", \"v-ideographic\"],\n [\"vMathematical\", \"v-mathematical\"],\n [\"vectorEffect\", \"vector-effect\"],\n [\"vertAdvY\", \"vert-adv-y\"],\n [\"vertOriginX\", \"vert-origin-x\"],\n [\"vertOriginY\", \"vert-origin-y\"],\n [\"wordSpacing\", \"word-spacing\"],\n [\"writingMode\", \"writing-mode\"],\n [\"xmlnsXlink\", \"xmlns:xlink\"],\n [\"xHeight\", \"x-height\"]\n ]),\n isJavaScriptProtocol =\n /^[\\u0000-\\u001F ]*j[\\r\\n\\t]*a[\\r\\n\\t]*v[\\r\\n\\t]*a[\\r\\n\\t]*s[\\r\\n\\t]*c[\\r\\n\\t]*r[\\r\\n\\t]*i[\\r\\n\\t]*p[\\r\\n\\t]*t[\\r\\n\\t]*:/i;\nfunction sanitizeURL(url) {\n return isJavaScriptProtocol.test(\"\" + url)\n ? \"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')\"\n : url;\n}\nfunction noop$1() {}\nvar currentReplayingEvent = null;\nfunction getEventTarget(nativeEvent) {\n nativeEvent = nativeEvent.target || nativeEvent.srcElement || window;\n nativeEvent.correspondingUseElement &&\n (nativeEvent = nativeEvent.correspondingUseElement);\n return 3 === nativeEvent.nodeType ? nativeEvent.parentNode : nativeEvent;\n}\nvar restoreTarget = null,\n restoreQueue = null;\nfunction restoreStateOfTarget(target) {\n var internalInstance = getInstanceFromNode(target);\n if (internalInstance && (target = internalInstance.stateNode)) {\n var props = target[internalPropsKey] || null;\n a: switch (((target = internalInstance.stateNode), internalInstance.type)) {\n case \"input\":\n updateInput(\n target,\n props.value,\n props.defaultValue,\n props.defaultValue,\n props.checked,\n props.defaultChecked,\n props.type,\n props.name\n );\n internalInstance = props.name;\n if (\"radio\" === props.type && null != internalInstance) {\n for (props = target; props.parentNode; ) props = props.parentNode;\n props = props.querySelectorAll(\n 'input[name=\"' +\n escapeSelectorAttributeValueInsideDoubleQuotes(\n \"\" + internalInstance\n ) +\n '\"][type=\"radio\"]'\n );\n for (\n internalInstance = 0;\n internalInstance < props.length;\n internalInstance++\n ) {\n var otherNode = props[internalInstance];\n if (otherNode !== target && otherNode.form === target.form) {\n var otherProps = otherNode[internalPropsKey] || null;\n if (!otherProps) throw Error(formatProdErrorMessage(90));\n updateInput(\n otherNode,\n otherProps.value,\n otherProps.defaultValue,\n otherProps.defaultValue,\n otherProps.checked,\n otherProps.defaultChecked,\n otherProps.type,\n otherProps.name\n );\n }\n }\n for (\n internalInstance = 0;\n internalInstance < props.length;\n internalInstance++\n )\n (otherNode = props[internalInstance]),\n otherNode.form === target.form && updateValueIfChanged(otherNode);\n }\n break a;\n case \"textarea\":\n updateTextarea(target, props.value, props.defaultValue);\n break a;\n case \"select\":\n (internalInstance = props.value),\n null != internalInstance &&\n updateOptions(target, !!props.multiple, internalInstance, !1);\n }\n }\n}\nvar isInsideEventHandler = !1;\nfunction batchedUpdates$1(fn, a, b) {\n if (isInsideEventHandler) return fn(a, b);\n isInsideEventHandler = !0;\n try {\n var JSCompiler_inline_result = fn(a);\n return JSCompiler_inline_result;\n } finally {\n if (\n ((isInsideEventHandler = !1),\n null !== restoreTarget || null !== restoreQueue)\n )\n if (\n (flushSyncWork$1(),\n restoreTarget &&\n ((a = restoreTarget),\n (fn = restoreQueue),\n (restoreQueue = restoreTarget = null),\n restoreStateOfTarget(a),\n fn))\n )\n for (a = 0; a < fn.length; a++) restoreStateOfTarget(fn[a]);\n }\n}\nfunction getListener(inst, registrationName) {\n var stateNode = inst.stateNode;\n if (null === stateNode) return null;\n var props = stateNode[internalPropsKey] || null;\n if (null === props) return null;\n stateNode = props[registrationName];\n a: switch (registrationName) {\n case \"onClick\":\n case \"onClickCapture\":\n case \"onDoubleClick\":\n case \"onDoubleClickCapture\":\n case \"onMouseDown\":\n case \"onMouseDownCapture\":\n case \"onMouseMove\":\n case \"onMouseMoveCapture\":\n case \"onMouseUp\":\n case \"onMouseUpCapture\":\n case \"onMouseEnter\":\n (props = !props.disabled) ||\n ((inst = inst.type),\n (props = !(\n \"button\" === inst ||\n \"input\" === inst ||\n \"select\" === inst ||\n \"textarea\" === inst\n )));\n inst = !props;\n break a;\n default:\n inst = !1;\n }\n if (inst) return null;\n if (stateNode && \"function\" !== typeof stateNode)\n throw Error(\n formatProdErrorMessage(231, registrationName, typeof stateNode)\n );\n return stateNode;\n}\nvar canUseDOM = !(\n \"undefined\" === typeof window ||\n \"undefined\" === typeof window.document ||\n \"undefined\" === typeof window.document.createElement\n ),\n passiveBrowserEventsSupported = !1;\nif (canUseDOM)\n try {\n var options = {};\n Object.defineProperty(options, \"passive\", {\n get: function () {\n passiveBrowserEventsSupported = !0;\n }\n });\n window.addEventListener(\"test\", options, options);\n window.removeEventListener(\"test\", options, options);\n } catch (e) {\n passiveBrowserEventsSupported = !1;\n }\nvar root = null,\n startText = null,\n fallbackText = null;\nfunction getData() {\n if (fallbackText) return fallbackText;\n var start,\n startValue = startText,\n startLength = startValue.length,\n end,\n endValue = \"value\" in root ? root.value : root.textContent,\n endLength = endValue.length;\n for (\n start = 0;\n start < startLength && startValue[start] === endValue[start];\n start++\n );\n var minEnd = startLength - start;\n for (\n end = 1;\n end <= minEnd &&\n startValue[startLength - end] === endValue[endLength - end];\n end++\n );\n return (fallbackText = endValue.slice(start, 1 < end ? 1 - end : void 0));\n}\nfunction getEventCharCode(nativeEvent) {\n var keyCode = nativeEvent.keyCode;\n \"charCode\" in nativeEvent\n ? ((nativeEvent = nativeEvent.charCode),\n 0 === nativeEvent && 13 === keyCode && (nativeEvent = 13))\n : (nativeEvent = keyCode);\n 10 === nativeEvent && (nativeEvent = 13);\n return 32 <= nativeEvent || 13 === nativeEvent ? nativeEvent : 0;\n}\nfunction functionThatReturnsTrue() {\n return !0;\n}\nfunction functionThatReturnsFalse() {\n return !1;\n}\nfunction createSyntheticEvent(Interface) {\n function SyntheticBaseEvent(\n reactName,\n reactEventType,\n targetInst,\n nativeEvent,\n nativeEventTarget\n ) {\n this._reactName = reactName;\n this._targetInst = targetInst;\n this.type = reactEventType;\n this.nativeEvent = nativeEvent;\n this.target = nativeEventTarget;\n this.currentTarget = null;\n for (var propName in Interface)\n Interface.hasOwnProperty(propName) &&\n ((reactName = Interface[propName]),\n (this[propName] = reactName\n ? reactName(nativeEvent)\n : nativeEvent[propName]));\n this.isDefaultPrevented = (\n null != nativeEvent.defaultPrevented\n ? nativeEvent.defaultPrevented\n : !1 === nativeEvent.returnValue\n )\n ? functionThatReturnsTrue\n : functionThatReturnsFalse;\n this.isPropagationStopped = functionThatReturnsFalse;\n return this;\n }\n assign(SyntheticBaseEvent.prototype, {\n preventDefault: function () {\n this.defaultPrevented = !0;\n var event = this.nativeEvent;\n event &&\n (event.preventDefault\n ? event.preventDefault()\n : \"unknown\" !== typeof event.returnValue && (event.returnValue = !1),\n (this.isDefaultPrevented = functionThatReturnsTrue));\n },\n stopPropagation: function () {\n var event = this.nativeEvent;\n event &&\n (event.stopPropagation\n ? event.stopPropagation()\n : \"unknown\" !== typeof event.cancelBubble &&\n (event.cancelBubble = !0),\n (this.isPropagationStopped = functionThatReturnsTrue));\n },\n persist: function () {},\n isPersistent: functionThatReturnsTrue\n });\n return SyntheticBaseEvent;\n}\nvar EventInterface = {\n eventPhase: 0,\n bubbles: 0,\n cancelable: 0,\n timeStamp: function (event) {\n return event.timeStamp || Date.now();\n },\n defaultPrevented: 0,\n isTrusted: 0\n },\n SyntheticEvent = createSyntheticEvent(EventInterface),\n UIEventInterface = assign({}, EventInterface, { view: 0, detail: 0 }),\n SyntheticUIEvent = createSyntheticEvent(UIEventInterface),\n lastMovementX,\n lastMovementY,\n lastMouseEvent,\n MouseEventInterface = assign({}, UIEventInterface, {\n screenX: 0,\n screenY: 0,\n clientX: 0,\n clientY: 0,\n pageX: 0,\n pageY: 0,\n ctrlKey: 0,\n shiftKey: 0,\n altKey: 0,\n metaKey: 0,\n getModifierState: getEventModifierState,\n button: 0,\n buttons: 0,\n relatedTarget: function (event) {\n return void 0 === event.relatedTarget\n ? event.fromElement === event.srcElement\n ? event.toElement\n : event.fromElement\n : event.relatedTarget;\n },\n movementX: function (event) {\n if (\"movementX\" in event) return event.movementX;\n event !== lastMouseEvent &&\n (lastMouseEvent && \"mousemove\" === event.type\n ? ((lastMovementX = event.screenX - lastMouseEvent.screenX),\n (lastMovementY = event.screenY - lastMouseEvent.screenY))\n : (lastMovementY = lastMovementX = 0),\n (lastMouseEvent = event));\n return lastMovementX;\n },\n movementY: function (event) {\n return \"movementY\" in event ? event.movementY : lastMovementY;\n }\n }),\n SyntheticMouseEvent = createSyntheticEvent(MouseEventInterface),\n DragEventInterface = assign({}, MouseEventInterface, { dataTransfer: 0 }),\n SyntheticDragEvent = createSyntheticEvent(DragEventInterface),\n FocusEventInterface = assign({}, UIEventInterface, { relatedTarget: 0 }),\n SyntheticFocusEvent = createSyntheticEvent(FocusEventInterface),\n AnimationEventInterface = assign({}, EventInterface, {\n animationName: 0,\n elapsedTime: 0,\n pseudoElement: 0\n }),\n SyntheticAnimationEvent = createSyntheticEvent(AnimationEventInterface),\n ClipboardEventInterface = assign({}, EventInterface, {\n clipboardData: function (event) {\n return \"clipboardData\" in event\n ? event.clipboardData\n : window.clipboardData;\n }\n }),\n SyntheticClipboardEvent = createSyntheticEvent(ClipboardEventInterface),\n CompositionEventInterface = assign({}, EventInterface, { data: 0 }),\n SyntheticCompositionEvent = createSyntheticEvent(CompositionEventInterface),\n normalizeKey = {\n Esc: \"Escape\",\n Spacebar: \" \",\n Left: \"ArrowLeft\",\n Up: \"ArrowUp\",\n Right: \"ArrowRight\",\n Down: \"ArrowDown\",\n Del: \"Delete\",\n Win: \"OS\",\n Menu: \"ContextMenu\",\n Apps: \"ContextMenu\",\n Scroll: \"ScrollLock\",\n MozPrintableKey: \"Unidentified\"\n },\n translateToKey = {\n 8: \"Backspace\",\n 9: \"Tab\",\n 12: \"Clear\",\n 13: \"Enter\",\n 16: \"Shift\",\n 17: \"Control\",\n 18: \"Alt\",\n 19: \"Pause\",\n 20: \"CapsLock\",\n 27: \"Escape\",\n 32: \" \",\n 33: \"PageUp\",\n 34: \"PageDown\",\n 35: \"End\",\n 36: \"Home\",\n 37: \"ArrowLeft\",\n 38: \"ArrowUp\",\n 39: \"ArrowRight\",\n 40: \"ArrowDown\",\n 45: \"Insert\",\n 46: \"Delete\",\n 112: \"F1\",\n 113: \"F2\",\n 114: \"F3\",\n 115: \"F4\",\n 116: \"F5\",\n 117: \"F6\",\n 118: \"F7\",\n 119: \"F8\",\n 120: \"F9\",\n 121: \"F10\",\n 122: \"F11\",\n 123: \"F12\",\n 144: \"NumLock\",\n 145: \"ScrollLock\",\n 224: \"Meta\"\n },\n modifierKeyToProp = {\n Alt: \"altKey\",\n Control: \"ctrlKey\",\n Meta: \"metaKey\",\n Shift: \"shiftKey\"\n };\nfunction modifierStateGetter(keyArg) {\n var nativeEvent = this.nativeEvent;\n return nativeEvent.getModifierState\n ? nativeEvent.getModifierState(keyArg)\n : (keyArg = modifierKeyToProp[keyArg])\n ? !!nativeEvent[keyArg]\n : !1;\n}\nfunction getEventModifierState() {\n return modifierStateGetter;\n}\nvar KeyboardEventInterface = assign({}, UIEventInterface, {\n key: function (nativeEvent) {\n if (nativeEvent.key) {\n var key = normalizeKey[nativeEvent.key] || nativeEvent.key;\n if (\"Unidentified\" !== key) return key;\n }\n return \"keypress\" === nativeEvent.type\n ? ((nativeEvent = getEventCharCode(nativeEvent)),\n 13 === nativeEvent ? \"Enter\" : String.fromCharCode(nativeEvent))\n : \"keydown\" === nativeEvent.type || \"keyup\" === nativeEvent.type\n ? translateToKey[nativeEvent.keyCode] || \"Unidentified\"\n : \"\";\n },\n code: 0,\n location: 0,\n ctrlKey: 0,\n shiftKey: 0,\n altKey: 0,\n metaKey: 0,\n repeat: 0,\n locale: 0,\n getModifierState: getEventModifierState,\n charCode: function (event) {\n return \"keypress\" === event.type ? getEventCharCode(event) : 0;\n },\n keyCode: function (event) {\n return \"keydown\" === event.type || \"keyup\" === event.type\n ? event.keyCode\n : 0;\n },\n which: function (event) {\n return \"keypress\" === event.type\n ? getEventCharCode(event)\n : \"keydown\" === event.type || \"keyup\" === event.type\n ? event.keyCode\n : 0;\n }\n }),\n SyntheticKeyboardEvent = createSyntheticEvent(KeyboardEventInterface),\n PointerEventInterface = assign({}, MouseEventInterface, {\n pointerId: 0,\n width: 0,\n height: 0,\n pressure: 0,\n tangentialPressure: 0,\n tiltX: 0,\n tiltY: 0,\n twist: 0,\n pointerType: 0,\n isPrimary: 0\n }),\n SyntheticPointerEvent = createSyntheticEvent(PointerEventInterface),\n SubmitEventInterface = assign({}, EventInterface, { submitter: 0 }),\n SyntheticSubmitEvent = createSyntheticEvent(SubmitEventInterface),\n TouchEventInterface = assign({}, UIEventInterface, {\n touches: 0,\n targetTouches: 0,\n changedTouches: 0,\n altKey: 0,\n metaKey: 0,\n ctrlKey: 0,\n shiftKey: 0,\n getModifierState: getEventModifierState\n }),\n SyntheticTouchEvent = createSyntheticEvent(TouchEventInterface),\n TransitionEventInterface = assign({}, EventInterface, {\n propertyName: 0,\n elapsedTime: 0,\n pseudoElement: 0\n }),\n SyntheticTransitionEvent = createSyntheticEvent(TransitionEventInterface),\n WheelEventInterface = assign({}, MouseEventInterface, {\n deltaX: function (event) {\n return \"deltaX\" in event\n ? event.deltaX\n : \"wheelDeltaX\" in event\n ? -event.wheelDeltaX\n : 0;\n },\n deltaY: function (event) {\n return \"deltaY\" in event\n ? event.deltaY\n : \"wheelDeltaY\" in event\n ? -event.wheelDeltaY\n : \"wheelDelta\" in event\n ? -event.wheelDelta\n : 0;\n },\n deltaZ: 0,\n deltaMode: 0\n }),\n SyntheticWheelEvent = createSyntheticEvent(WheelEventInterface),\n ToggleEventInterface = assign({}, EventInterface, {\n newState: 0,\n oldState: 0,\n source: 0\n }),\n SyntheticToggleEvent = createSyntheticEvent(ToggleEventInterface),\n END_KEYCODES = [9, 13, 27, 32],\n canUseCompositionEvent = canUseDOM && \"CompositionEvent\" in window,\n documentMode = null;\ncanUseDOM &&\n \"documentMode\" in document &&\n (documentMode = document.documentMode);\nvar canUseTextInputEvent = canUseDOM && \"TextEvent\" in window && !documentMode,\n useFallbackCompositionData =\n canUseDOM &&\n (!canUseCompositionEvent ||\n (documentMode && 8 < documentMode && 11 >= documentMode)),\n SPACEBAR_CHAR = String.fromCharCode(32),\n hasSpaceKeypress = !1;\nfunction isFallbackCompositionEnd(domEventName, nativeEvent) {\n switch (domEventName) {\n case \"keyup\":\n return -1 !== END_KEYCODES.indexOf(nativeEvent.keyCode);\n case \"keydown\":\n return 229 !== nativeEvent.keyCode;\n case \"keypress\":\n case \"mousedown\":\n case \"focusout\":\n return !0;\n default:\n return !1;\n }\n}\nfunction getDataFromCustomEvent(nativeEvent) {\n nativeEvent = nativeEvent.detail;\n return \"object\" === typeof nativeEvent && \"data\" in nativeEvent\n ? nativeEvent.data\n : null;\n}\nvar isComposing = !1;\nfunction getNativeBeforeInputChars(domEventName, nativeEvent) {\n switch (domEventName) {\n case \"compositionend\":\n return getDataFromCustomEvent(nativeEvent);\n case \"keypress\":\n if (32 !== nativeEvent.which) return null;\n hasSpaceKeypress = !0;\n return SPACEBAR_CHAR;\n case \"textInput\":\n return (\n (domEventName = nativeEvent.data),\n domEventName === SPACEBAR_CHAR && hasSpaceKeypress ? null : domEventName\n );\n default:\n return null;\n }\n}\nfunction getFallbackBeforeInputChars(domEventName, nativeEvent) {\n if (isComposing)\n return \"compositionend\" === domEventName ||\n (!canUseCompositionEvent &&\n isFallbackCompositionEnd(domEventName, nativeEvent))\n ? ((domEventName = getData()),\n (fallbackText = startText = root = null),\n (isComposing = !1),\n domEventName)\n : null;\n switch (domEventName) {\n case \"paste\":\n return null;\n case \"keypress\":\n if (\n !(nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) ||\n (nativeEvent.ctrlKey && nativeEvent.altKey)\n ) {\n if (nativeEvent.char && 1 < nativeEvent.char.length)\n return nativeEvent.char;\n if (nativeEvent.which) return String.fromCharCode(nativeEvent.which);\n }\n return null;\n case \"compositionend\":\n return useFallbackCompositionData && \"ko\" !== nativeEvent.locale\n ? null\n : nativeEvent.data;\n default:\n return null;\n }\n}\nvar supportedInputTypes = {\n color: !0,\n date: !0,\n datetime: !0,\n \"datetime-local\": !0,\n email: !0,\n month: !0,\n number: !0,\n password: !0,\n range: !0,\n search: !0,\n tel: !0,\n text: !0,\n time: !0,\n url: !0,\n week: !0\n};\nfunction isTextInputElement(elem) {\n var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();\n return \"input\" === nodeName\n ? !!supportedInputTypes[elem.type]\n : \"textarea\" === nodeName\n ? !0\n : !1;\n}\nfunction createAndAccumulateChangeEvent(\n dispatchQueue,\n inst,\n nativeEvent,\n target\n) {\n restoreTarget\n ? restoreQueue\n ? restoreQueue.push(target)\n : (restoreQueue = [target])\n : (restoreTarget = target);\n inst = accumulateTwoPhaseListeners(inst, \"onChange\");\n 0 < inst.length &&\n ((nativeEvent = new SyntheticEvent(\n \"onChange\",\n \"change\",\n null,\n nativeEvent,\n target\n )),\n dispatchQueue.push({ event: nativeEvent, listeners: inst }));\n}\nvar activeElement$1 = null,\n activeElementInst$1 = null;\nfunction runEventInBatch(dispatchQueue) {\n processDispatchQueue(dispatchQueue, 0);\n}\nfunction getInstIfValueChanged(targetInst) {\n var targetNode = getNodeFromInstance(targetInst);\n if (updateValueIfChanged(targetNode)) return targetInst;\n}\nfunction getTargetInstForChangeEvent(domEventName, targetInst) {\n if (\"change\" === domEventName) return targetInst;\n}\nvar isInputEventSupported = !1;\nif (canUseDOM) {\n var JSCompiler_inline_result$jscomp$318;\n if (canUseDOM) {\n var isSupported$jscomp$inline_474 = \"oninput\" in document;\n if (!isSupported$jscomp$inline_474) {\n var element$jscomp$inline_475 = document.createElement(\"div\");\n element$jscomp$inline_475.setAttribute(\"oninput\", \"return;\");\n isSupported$jscomp$inline_474 =\n \"function\" === typeof element$jscomp$inline_475.oninput;\n }\n JSCompiler_inline_result$jscomp$318 = isSupported$jscomp$inline_474;\n } else JSCompiler_inline_result$jscomp$318 = !1;\n isInputEventSupported =\n JSCompiler_inline_result$jscomp$318 &&\n (!document.documentMode || 9 < document.documentMode);\n}\nfunction stopWatchingForValueChange() {\n activeElement$1 &&\n (activeElement$1.detachEvent(\"onpropertychange\", handlePropertyChange),\n (activeElementInst$1 = activeElement$1 = null));\n}\nfunction handlePropertyChange(nativeEvent) {\n if (\n \"value\" === nativeEvent.propertyName &&\n getInstIfValueChanged(activeElementInst$1)\n ) {\n var dispatchQueue = [];\n createAndAccumulateChangeEvent(\n dispatchQueue,\n activeElementInst$1,\n nativeEvent,\n getEventTarget(nativeEvent)\n );\n batchedUpdates$1(runEventInBatch, dispatchQueue);\n }\n}\nfunction handleEventsForInputEventPolyfill(domEventName, target, targetInst) {\n \"focusin\" === domEventName\n ? (stopWatchingForValueChange(),\n (activeElement$1 = target),\n (activeElementInst$1 = targetInst),\n activeElement$1.attachEvent(\"onpropertychange\", handlePropertyChange))\n : \"focusout\" === domEventName && stopWatchingForValueChange();\n}\nfunction getTargetInstForInputEventPolyfill(domEventName) {\n if (\n \"selectionchange\" === domEventName ||\n \"keyup\" === domEventName ||\n \"keydown\" === domEventName\n )\n return getInstIfValueChanged(activeElementInst$1);\n}\nfunction getTargetInstForClickEvent(domEventName, targetInst) {\n if (\"click\" === domEventName) return getInstIfValueChanged(targetInst);\n}\nfunction getTargetInstForInputOrChangeEvent(domEventName, targetInst) {\n if (\"input\" === domEventName || \"change\" === domEventName)\n return getInstIfValueChanged(targetInst);\n}\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is;\nfunction shallowEqual(objA, objB) {\n if (objectIs(objA, objB)) return !0;\n if (\n \"object\" !== typeof objA ||\n null === objA ||\n \"object\" !== typeof objB ||\n null === objB\n )\n return !1;\n var keysA = Object.keys(objA),\n keysB = Object.keys(objB);\n if (keysA.length !== keysB.length) return !1;\n for (keysB = 0; keysB < keysA.length; keysB++) {\n var currentKey = keysA[keysB];\n if (\n !hasOwnProperty.call(objB, currentKey) ||\n !objectIs(objA[currentKey], objB[currentKey])\n )\n return !1;\n }\n return !0;\n}\nfunction getActiveElement(doc) {\n doc = doc || (\"undefined\" !== typeof document ? document : void 0);\n if (\"undefined\" === typeof doc) return null;\n try {\n return doc.activeElement || doc.body;\n } catch (e$20) {\n return doc.body;\n }\n}\nfunction getLeafNode(node) {\n for (; node && node.firstChild; ) node = node.firstChild;\n return node;\n}\nfunction getNodeForCharacterOffset(root, offset) {\n var node = getLeafNode(root);\n root = 0;\n for (var nodeEnd; node; ) {\n if (3 === node.nodeType) {\n nodeEnd = root + node.textContent.length;\n if (root <= offset && nodeEnd >= offset)\n return { node: node, offset: offset - root };\n root = nodeEnd;\n }\n a: {\n for (; node; ) {\n if (node.nextSibling) {\n node = node.nextSibling;\n break a;\n }\n node = node.parentNode;\n }\n node = void 0;\n }\n node = getLeafNode(node);\n }\n}\nfunction containsNode(outerNode, innerNode) {\n return outerNode && innerNode\n ? outerNode === innerNode\n ? !0\n : outerNode && 3 === outerNode.nodeType\n ? !1\n : innerNode && 3 === innerNode.nodeType\n ? containsNode(outerNode, innerNode.parentNode)\n : \"contains\" in outerNode\n ? outerNode.contains(innerNode)\n : outerNode.compareDocumentPosition\n ? !!(outerNode.compareDocumentPosition(innerNode) & 16)\n : !1\n : !1;\n}\nfunction getActiveElementDeep(containerInfo) {\n containerInfo =\n null != containerInfo &&\n null != containerInfo.ownerDocument &&\n null != containerInfo.ownerDocument.defaultView\n ? containerInfo.ownerDocument.defaultView\n : window;\n for (\n var element = getActiveElement(containerInfo.document);\n element instanceof containerInfo.HTMLIFrameElement;\n\n ) {\n try {\n var JSCompiler_inline_result =\n \"string\" === typeof element.contentWindow.location.href;\n } catch (err) {\n JSCompiler_inline_result = !1;\n }\n if (JSCompiler_inline_result) containerInfo = element.contentWindow;\n else break;\n element = getActiveElement(containerInfo.document);\n }\n return element;\n}\nfunction hasSelectionCapabilities(elem) {\n var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();\n return (\n nodeName &&\n ((\"input\" === nodeName &&\n (\"text\" === elem.type ||\n \"search\" === elem.type ||\n \"tel\" === elem.type ||\n \"url\" === elem.type ||\n \"password\" === elem.type)) ||\n \"textarea\" === nodeName ||\n \"true\" === elem.contentEditable)\n );\n}\nvar skipSelectionChangeEvent =\n canUseDOM && \"documentMode\" in document && 11 >= document.documentMode,\n activeElement = null,\n activeElementInst = null,\n lastSelection = null,\n mouseDown = !1;\nfunction constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget) {\n var doc =\n nativeEventTarget.window === nativeEventTarget\n ? nativeEventTarget.document\n : 9 === nativeEventTarget.nodeType\n ? nativeEventTarget\n : nativeEventTarget.ownerDocument;\n mouseDown ||\n null == activeElement ||\n activeElement !== getActiveElement(doc) ||\n ((doc = activeElement),\n \"selectionStart\" in doc && hasSelectionCapabilities(doc)\n ? (doc = { start: doc.selectionStart, end: doc.selectionEnd })\n : ((doc = (\n (doc.ownerDocument && doc.ownerDocument.defaultView) ||\n window\n ).getSelection()),\n (doc = {\n anchorNode: doc.anchorNode,\n anchorOffset: doc.anchorOffset,\n focusNode: doc.focusNode,\n focusOffset: doc.focusOffset\n })),\n (lastSelection && shallowEqual(lastSelection, doc)) ||\n ((lastSelection = doc),\n (doc = accumulateTwoPhaseListeners(activeElementInst, \"onSelect\")),\n 0 < doc.length &&\n ((nativeEvent = new SyntheticEvent(\n \"onSelect\",\n \"select\",\n null,\n nativeEvent,\n nativeEventTarget\n )),\n dispatchQueue.push({ event: nativeEvent, listeners: doc }),\n (nativeEvent.target = activeElement))));\n}\nfunction makePrefixMap(styleProp, eventName) {\n var prefixes = {};\n prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();\n prefixes[\"Webkit\" + styleProp] = \"webkit\" + eventName;\n prefixes[\"Moz\" + styleProp] = \"moz\" + eventName;\n return prefixes;\n}\nvar vendorPrefixes = {\n animationend: makePrefixMap(\"Animation\", \"AnimationEnd\"),\n animationiteration: makePrefixMap(\"Animation\", \"AnimationIteration\"),\n animationstart: makePrefixMap(\"Animation\", \"AnimationStart\"),\n transitionrun: makePrefixMap(\"Transition\", \"TransitionRun\"),\n transitionstart: makePrefixMap(\"Transition\", \"TransitionStart\"),\n transitioncancel: makePrefixMap(\"Transition\", \"TransitionCancel\"),\n transitionend: makePrefixMap(\"Transition\", \"TransitionEnd\")\n },\n prefixedEventNames = {},\n style = {};\ncanUseDOM &&\n ((style = document.createElement(\"div\").style),\n \"AnimationEvent\" in window ||\n (delete vendorPrefixes.animationend.animation,\n delete vendorPrefixes.animationiteration.animation,\n delete vendorPrefixes.animationstart.animation),\n \"TransitionEvent\" in window ||\n delete vendorPrefixes.transitionend.transition);\nfunction getVendorPrefixedEventName(eventName) {\n if (prefixedEventNames[eventName]) return prefixedEventNames[eventName];\n if (!vendorPrefixes[eventName]) return eventName;\n var prefixMap = vendorPrefixes[eventName],\n styleProp;\n for (styleProp in prefixMap)\n if (prefixMap.hasOwnProperty(styleProp) && styleProp in style)\n return (prefixedEventNames[eventName] = prefixMap[styleProp]);\n return eventName;\n}\nvar ANIMATION_END = getVendorPrefixedEventName(\"animationend\"),\n ANIMATION_ITERATION = getVendorPrefixedEventName(\"animationiteration\"),\n ANIMATION_START = getVendorPrefixedEventName(\"animationstart\"),\n TRANSITION_RUN = getVendorPrefixedEventName(\"transitionrun\"),\n TRANSITION_START = getVendorPrefixedEventName(\"transitionstart\"),\n TRANSITION_CANCEL = getVendorPrefixedEventName(\"transitioncancel\"),\n TRANSITION_END = getVendorPrefixedEventName(\"transitionend\"),\n topLevelEventsToReactNames = new Map(),\n simpleEventPluginEvents =\n \"abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(\n \" \"\n );\nsimpleEventPluginEvents.push(\"scrollEnd\");\nfunction registerSimpleEvent(domEventName, reactName) {\n topLevelEventsToReactNames.set(domEventName, reactName);\n registerTwoPhaseEvent(reactName, [domEventName]);\n}\nvar globalClientIdCounter$1 = 0;\nfunction getViewTransitionName(props, instance) {\n if (null != props.name && \"auto\" !== props.name) return props.name;\n if (null !== instance.autoName) return instance.autoName;\n props = pendingEffectsRoot.identifierPrefix;\n var globalClientId = globalClientIdCounter$1++;\n props = \"_\" + props + \"t_\" + globalClientId.toString(32) + \"_\";\n return (instance.autoName = props);\n}\nfunction getClassNameByType(classByType) {\n if (null == classByType || \"string\" === typeof classByType)\n return classByType;\n var className = null,\n activeTypes = pendingTransitionTypes;\n if (null !== activeTypes)\n for (var i = 0; i < activeTypes.length; i++) {\n var match = classByType[activeTypes[i]];\n if (null != match) {\n if (\"none\" === match) return \"none\";\n className = null == className ? match : className + (\" \" + match);\n }\n }\n return null == className ? classByType.default : className;\n}\nfunction getViewTransitionClassName(defaultClass, eventClass) {\n defaultClass = getClassNameByType(defaultClass);\n eventClass = getClassNameByType(eventClass);\n return null == eventClass\n ? \"auto\" === defaultClass\n ? null\n : defaultClass\n : \"auto\" === eventClass\n ? null\n : eventClass;\n}\nvar reportGlobalError =\n \"function\" === typeof reportError\n ? reportError\n : function (error) {\n if (\n \"object\" === typeof window &&\n \"function\" === typeof window.ErrorEvent\n ) {\n var event = new window.ErrorEvent(\"error\", {\n bubbles: !0,\n cancelable: !0,\n message:\n \"object\" === typeof error &&\n null !== error &&\n \"string\" === typeof error.message\n ? String(error.message)\n : String(error),\n error: error\n });\n if (!window.dispatchEvent(event)) return;\n } else if (\n \"object\" === typeof process &&\n \"function\" === typeof process.emit\n ) {\n process.emit(\"uncaughtException\", error);\n return;\n }\n console.error(error);\n },\n concurrentQueues = [],\n concurrentQueuesIndex = 0,\n concurrentlyUpdatedLanes = 0;\nfunction finishQueueingConcurrentUpdates() {\n for (\n var endIndex = concurrentQueuesIndex,\n i = (concurrentlyUpdatedLanes = concurrentQueuesIndex = 0);\n i < endIndex;\n\n ) {\n var fiber = concurrentQueues[i];\n concurrentQueues[i++] = null;\n var queue = concurrentQueues[i];\n concurrentQueues[i++] = null;\n var update = concurrentQueues[i];\n concurrentQueues[i++] = null;\n var lane = concurrentQueues[i];\n concurrentQueues[i++] = null;\n if (null !== queue && null !== update) {\n var pending = queue.pending;\n null === pending\n ? (update.next = update)\n : ((update.next = pending.next), (pending.next = update));\n queue.pending = update;\n }\n 0 !== lane && markUpdateLaneFromFiberToRoot(fiber, update, lane);\n }\n}\nfunction enqueueUpdate$1(fiber, queue, update, lane) {\n concurrentQueues[concurrentQueuesIndex++] = fiber;\n concurrentQueues[concurrentQueuesIndex++] = queue;\n concurrentQueues[concurrentQueuesIndex++] = update;\n concurrentQueues[concurrentQueuesIndex++] = lane;\n concurrentlyUpdatedLanes |= lane;\n fiber.lanes |= lane;\n fiber = fiber.alternate;\n null !== fiber && (fiber.lanes |= lane);\n}\nfunction enqueueConcurrentHookUpdate(fiber, queue, update, lane) {\n enqueueUpdate$1(fiber, queue, update, lane);\n return getRootForUpdatedFiber(fiber);\n}\nfunction enqueueConcurrentRenderForLane(fiber, lane) {\n enqueueUpdate$1(fiber, null, null, lane);\n return getRootForUpdatedFiber(fiber);\n}\nfunction markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) {\n sourceFiber.lanes |= lane;\n var alternate = sourceFiber.alternate;\n null !== alternate && (alternate.lanes |= lane);\n for (var isHidden = !1, parent = sourceFiber.return; null !== parent; )\n (parent.childLanes |= lane),\n (alternate = parent.alternate),\n null !== alternate && (alternate.childLanes |= lane),\n 22 === parent.tag &&\n ((sourceFiber = parent.stateNode),\n null === sourceFiber || sourceFiber._visibility & 1 || (isHidden = !0)),\n (sourceFiber = parent),\n (parent = parent.return);\n return 3 === sourceFiber.tag\n ? ((parent = sourceFiber.stateNode),\n isHidden &&\n null !== update &&\n ((isHidden = 31 - clz32(lane)),\n (sourceFiber = parent.hiddenUpdates),\n (alternate = sourceFiber[isHidden]),\n null === alternate\n ? (sourceFiber[isHidden] = [update])\n : alternate.push(update),\n (update.lane = lane | 536870912)),\n parent)\n : null;\n}\nfunction getRootForUpdatedFiber(sourceFiber) {\n if (50 < nestedUpdateCount)\n throw (\n ((nestedUpdateCount = 0),\n (rootWithNestedUpdates = null),\n Error(formatProdErrorMessage(185)))\n );\n for (var parent = sourceFiber.return; null !== parent; )\n (sourceFiber = parent), (parent = sourceFiber.return);\n return 3 === sourceFiber.tag ? sourceFiber.stateNode : null;\n}\nvar emptyContextObject = {};\nfunction FiberNode(tag, pendingProps, key, mode) {\n this.tag = tag;\n this.key = key;\n this.sibling =\n this.child =\n this.return =\n this.stateNode =\n this.type =\n this.elementType =\n null;\n this.index = 0;\n this.refCleanup = this.ref = null;\n this.pendingProps = pendingProps;\n this.dependencies =\n this.memoizedState =\n this.updateQueue =\n this.memoizedProps =\n null;\n this.mode = mode;\n this.subtreeFlags = this.flags = 0;\n this.deletions = null;\n this.childLanes = this.lanes = 0;\n this.alternate = null;\n}\nfunction createFiberImplClass(tag, pendingProps, key, mode) {\n return new FiberNode(tag, pendingProps, key, mode);\n}\nfunction shouldConstruct(Component) {\n Component = Component.prototype;\n return !(!Component || !Component.isReactComponent);\n}\nfunction createWorkInProgress(current, pendingProps) {\n var workInProgress = current.alternate;\n null === workInProgress\n ? ((workInProgress = createFiberImplClass(\n current.tag,\n pendingProps,\n current.key,\n current.mode\n )),\n (workInProgress.elementType = current.elementType),\n (workInProgress.type = current.type),\n (workInProgress.stateNode = current.stateNode),\n (workInProgress.alternate = current),\n (current.alternate = workInProgress))\n : ((workInProgress.pendingProps = pendingProps),\n (workInProgress.type = current.type),\n (workInProgress.flags = 0),\n (workInProgress.subtreeFlags = 0),\n (workInProgress.deletions = null));\n workInProgress.flags = current.flags & 1206910976;\n workInProgress.childLanes = current.childLanes;\n workInProgress.lanes = current.lanes;\n workInProgress.child = current.child;\n workInProgress.memoizedProps = current.memoizedProps;\n workInProgress.memoizedState = current.memoizedState;\n workInProgress.updateQueue = current.updateQueue;\n pendingProps = current.dependencies;\n workInProgress.dependencies =\n null === pendingProps\n ? null\n : { lanes: pendingProps.lanes, firstContext: pendingProps.firstContext };\n workInProgress.sibling = current.sibling;\n workInProgress.index = current.index;\n workInProgress.ref = current.ref;\n workInProgress.refCleanup = current.refCleanup;\n return workInProgress;\n}\nfunction resetWorkInProgress(workInProgress, renderLanes) {\n workInProgress.flags &= 1206910978;\n var current = workInProgress.alternate;\n null === current\n ? ((workInProgress.childLanes = 0),\n (workInProgress.lanes = renderLanes),\n (workInProgress.child = null),\n (workInProgress.subtreeFlags = 0),\n (workInProgress.memoizedProps = null),\n (workInProgress.memoizedState = null),\n (workInProgress.updateQueue = null),\n (workInProgress.dependencies = null),\n (workInProgress.stateNode = null))\n : ((workInProgress.childLanes = current.childLanes),\n (workInProgress.lanes = current.lanes),\n (workInProgress.child = current.child),\n (workInProgress.subtreeFlags = 0),\n (workInProgress.deletions = null),\n (workInProgress.memoizedProps = current.memoizedProps),\n (workInProgress.memoizedState = current.memoizedState),\n (workInProgress.updateQueue = current.updateQueue),\n (workInProgress.type = current.type),\n (renderLanes = current.dependencies),\n (workInProgress.dependencies =\n null === renderLanes\n ? null\n : {\n lanes: renderLanes.lanes,\n firstContext: renderLanes.firstContext\n }));\n return workInProgress;\n}\nfunction createFiberFromTypeAndProps(\n type,\n key,\n pendingProps,\n owner,\n mode,\n lanes\n) {\n var fiberTag = 0;\n owner = type;\n if (\"function\" === typeof owner) shouldConstruct(owner) && (fiberTag = 1);\n else if (\"string\" === typeof owner)\n fiberTag = isHostHoistableType(\n type,\n pendingProps,\n contextStackCursor.current\n )\n ? 26\n : \"html\" === type || \"head\" === type || \"body\" === type\n ? 27\n : 5;\n else\n a: switch (owner) {\n case REACT_ACTIVITY_TYPE:\n return (\n (type = createFiberImplClass(31, pendingProps, key, mode)),\n (type.elementType = REACT_ACTIVITY_TYPE),\n (type.lanes = lanes),\n type\n );\n case REACT_FRAGMENT_TYPE:\n return createFiberFromFragment(pendingProps.children, mode, lanes, key);\n case REACT_STRICT_MODE_TYPE:\n fiberTag = 8;\n mode |= 24;\n break;\n case REACT_PROFILER_TYPE:\n return (\n (type = createFiberImplClass(12, pendingProps, key, mode | 2)),\n (type.elementType = REACT_PROFILER_TYPE),\n (type.lanes = lanes),\n type\n );\n case REACT_SUSPENSE_TYPE:\n return (\n (type = createFiberImplClass(13, pendingProps, key, mode)),\n (type.elementType = REACT_SUSPENSE_TYPE),\n (type.lanes = lanes),\n type\n );\n case REACT_SUSPENSE_LIST_TYPE:\n return (\n (type = createFiberImplClass(19, pendingProps, key, mode)),\n (type.elementType = REACT_SUSPENSE_LIST_TYPE),\n (type.lanes = lanes),\n type\n );\n case REACT_LEGACY_HIDDEN_TYPE:\n case REACT_VIEW_TRANSITION_TYPE:\n return (\n (type = mode | 32),\n (type = createFiberImplClass(30, pendingProps, key, type)),\n (type.elementType = REACT_VIEW_TRANSITION_TYPE),\n (type.lanes = lanes),\n (type.stateNode = {\n autoName: null,\n paired: null,\n clones: null,\n ref: null\n }),\n type\n );\n default:\n if (\"object\" === typeof owner && null !== owner)\n switch (owner.$$typeof) {\n case REACT_CONTEXT_TYPE:\n fiberTag = 10;\n break a;\n case REACT_CONSUMER_TYPE:\n fiberTag = 9;\n break a;\n case REACT_FORWARD_REF_TYPE:\n fiberTag = 11;\n break a;\n case REACT_MEMO_TYPE:\n fiberTag = 14;\n break a;\n case REACT_LAZY_TYPE:\n fiberTag = 16;\n owner = null;\n break a;\n }\n fiberTag = 29;\n pendingProps = Error(\n formatProdErrorMessage(130, null === type ? \"null\" : typeof type, \"\")\n );\n owner = null;\n }\n key = createFiberImplClass(fiberTag, pendingProps, key, mode);\n key.elementType = type;\n key.type = owner;\n key.lanes = lanes;\n return key;\n}\nfunction createFiberFromFragment(elements, mode, lanes, key) {\n elements = createFiberImplClass(7, elements, key, mode);\n elements.lanes = lanes;\n return elements;\n}\nfunction createFiberFromText(content, mode, lanes) {\n content = createFiberImplClass(6, content, null, mode);\n content.lanes = lanes;\n return content;\n}\nfunction createFiberFromDehydratedFragment(dehydratedNode) {\n var fiber = createFiberImplClass(18, null, null, 0);\n fiber.stateNode = dehydratedNode;\n return fiber;\n}\nfunction createFiberFromPortal(portal, mode, lanes) {\n mode = createFiberImplClass(\n 4,\n null !== portal.children ? portal.children : [],\n portal.key,\n mode\n );\n mode.lanes = lanes;\n mode.stateNode = {\n containerInfo: portal.containerInfo,\n pendingChildren: null,\n implementation: portal.implementation\n };\n return mode;\n}\nvar CapturedStacks = new WeakMap();\nfunction createCapturedValueAtFiber(value, source) {\n if (\"object\" === typeof value && null !== value) {\n var existing = CapturedStacks.get(value);\n if (void 0 !== existing) return existing;\n source = {\n value: value,\n source: source,\n stack: getStackByFiberInDevAndProd(source)\n };\n CapturedStacks.set(value, source);\n return source;\n }\n return {\n value: value,\n source: source,\n stack: getStackByFiberInDevAndProd(source)\n };\n}\nvar forkStack = [],\n forkStackIndex = 0,\n treeForkProvider = null,\n treeForkCount = 0,\n idStack = [],\n idStackIndex = 0,\n treeContextProvider = null,\n treeContextId = 1,\n treeContextOverflow = \"\";\nfunction pushTreeFork(workInProgress, totalChildren) {\n forkStack[forkStackIndex++] = treeForkCount;\n forkStack[forkStackIndex++] = treeForkProvider;\n treeForkProvider = workInProgress;\n treeForkCount = totalChildren;\n}\nfunction pushTreeId(workInProgress, totalChildren, index) {\n idStack[idStackIndex++] = treeContextId;\n idStack[idStackIndex++] = treeContextOverflow;\n idStack[idStackIndex++] = treeContextProvider;\n treeContextProvider = workInProgress;\n var baseIdWithLeadingBit = treeContextId;\n workInProgress = treeContextOverflow;\n var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1;\n baseIdWithLeadingBit &= ~(1 << baseLength);\n index += 1;\n var length = 32 - clz32(totalChildren) + baseLength;\n if (30 < length) {\n var numberOfOverflowBits = baseLength - (baseLength % 5);\n length = (\n baseIdWithLeadingBit &\n ((1 << numberOfOverflowBits) - 1)\n ).toString(32);\n baseIdWithLeadingBit >>= numberOfOverflowBits;\n baseLength -= numberOfOverflowBits;\n treeContextId =\n (1 << (32 - clz32(totalChildren) + baseLength)) |\n (index << baseLength) |\n baseIdWithLeadingBit;\n treeContextOverflow = length + workInProgress;\n } else\n (treeContextId =\n (1 << length) | (index << baseLength) | baseIdWithLeadingBit),\n (treeContextOverflow = workInProgress);\n}\nfunction pushMaterializedTreeId(workInProgress) {\n null !== workInProgress.return &&\n (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0));\n}\nfunction popTreeContext(workInProgress) {\n for (; workInProgress === treeForkProvider; )\n (treeForkProvider = forkStack[--forkStackIndex]),\n (forkStack[forkStackIndex] = null),\n (treeForkCount = forkStack[--forkStackIndex]),\n (forkStack[forkStackIndex] = null);\n for (; workInProgress === treeContextProvider; )\n (treeContextProvider = idStack[--idStackIndex]),\n (idStack[idStackIndex] = null),\n (treeContextOverflow = idStack[--idStackIndex]),\n (idStack[idStackIndex] = null),\n (treeContextId = idStack[--idStackIndex]),\n (idStack[idStackIndex] = null);\n}\nfunction restoreSuspendedTreeContext(workInProgress, suspendedContext) {\n idStack[idStackIndex++] = treeContextId;\n idStack[idStackIndex++] = treeContextOverflow;\n idStack[idStackIndex++] = treeContextProvider;\n treeContextId = suspendedContext.id;\n treeContextOverflow = suspendedContext.overflow;\n treeContextProvider = workInProgress;\n}\nvar hydrationParentFiber = null,\n nextHydratableInstance = null,\n isHydrating = !1,\n hydrationErrors = null,\n rootOrSingletonContext = !1,\n HydrationMismatchException = Error(formatProdErrorMessage(519));\nfunction throwOnHydrationMismatch(fiber) {\n var error = Error(\n formatProdErrorMessage(\n 418,\n 1 < arguments.length && void 0 !== arguments[1] && arguments[1]\n ? \"text\"\n : \"HTML\",\n \"\"\n )\n );\n queueHydrationError(createCapturedValueAtFiber(error, fiber));\n throw HydrationMismatchException;\n}\nfunction prepareToHydrateHostInstance(fiber) {\n var instance = fiber.stateNode,\n type = fiber.type,\n props = fiber.memoizedProps;\n instance[internalInstanceKey] = fiber;\n instance[internalPropsKey] = props;\n switch (type) {\n case \"dialog\":\n listenToNonDelegatedEvent(\"cancel\", instance);\n listenToNonDelegatedEvent(\"close\", instance);\n break;\n case \"iframe\":\n case \"object\":\n case \"embed\":\n listenToNonDelegatedEvent(\"load\", instance);\n break;\n case \"video\":\n case \"audio\":\n for (type = 0; type < mediaEventTypes.length; type++)\n listenToNonDelegatedEvent(mediaEventTypes[type], instance);\n break;\n case \"source\":\n listenToNonDelegatedEvent(\"error\", instance);\n break;\n case \"img\":\n case \"image\":\n case \"link\":\n listenToNonDelegatedEvent(\"error\", instance);\n listenToNonDelegatedEvent(\"load\", instance);\n break;\n case \"details\":\n listenToNonDelegatedEvent(\"toggle\", instance);\n break;\n case \"input\":\n listenToNonDelegatedEvent(\"invalid\", instance);\n initInput(\n instance,\n props.value,\n props.defaultValue,\n props.checked,\n props.defaultChecked,\n props.type,\n props.name,\n !0\n );\n break;\n case \"select\":\n listenToNonDelegatedEvent(\"invalid\", instance);\n break;\n case \"textarea\":\n listenToNonDelegatedEvent(\"invalid\", instance),\n initTextarea(instance, props.value, props.defaultValue, props.children);\n }\n type = props.children;\n (\"string\" !== typeof type &&\n \"number\" !== typeof type &&\n \"bigint\" !== typeof type) ||\n instance.textContent === \"\" + type ||\n !0 === props.suppressHydrationWarning ||\n checkForUnmatchedText(instance.textContent, type)\n ? (null != props.popover &&\n (listenToNonDelegatedEvent(\"beforetoggle\", instance),\n listenToNonDelegatedEvent(\"toggle\", instance)),\n null != props.onScroll && listenToNonDelegatedEvent(\"scroll\", instance),\n null != props.onScrollEnd &&\n listenToNonDelegatedEvent(\"scrollend\", instance),\n null != props.onClick && (instance.onclick = noop$1),\n (instance = !0))\n : (instance = !1);\n instance || throwOnHydrationMismatch(fiber, !0);\n}\nfunction popToNextHostParent(fiber) {\n for (hydrationParentFiber = fiber.return; hydrationParentFiber; )\n switch (hydrationParentFiber.tag) {\n case 5:\n case 31:\n case 13:\n rootOrSingletonContext = !1;\n return;\n case 27:\n case 3:\n rootOrSingletonContext = !0;\n return;\n default:\n hydrationParentFiber = hydrationParentFiber.return;\n }\n}\nfunction popHydrationState(fiber) {\n if (fiber !== hydrationParentFiber) return !1;\n if (!isHydrating) return popToNextHostParent(fiber), (isHydrating = !0), !1;\n var tag = fiber.tag,\n JSCompiler_temp;\n if ((JSCompiler_temp = 3 !== tag && 27 !== tag)) {\n if ((JSCompiler_temp = 5 === tag))\n (JSCompiler_temp = fiber.type),\n (JSCompiler_temp =\n !(\"form\" !== JSCompiler_temp && \"button\" !== JSCompiler_temp) ||\n shouldSetTextContent(fiber.type, fiber.memoizedProps));\n JSCompiler_temp = !JSCompiler_temp;\n }\n JSCompiler_temp && nextHydratableInstance && throwOnHydrationMismatch(fiber);\n popToNextHostParent(fiber);\n if (13 === tag) {\n fiber = fiber.memoizedState;\n fiber = null !== fiber ? fiber.dehydrated : null;\n if (!fiber) throw Error(formatProdErrorMessage(317));\n nextHydratableInstance =\n getNextHydratableInstanceAfterHydrationBoundary(fiber);\n } else if (31 === tag) {\n fiber = fiber.memoizedState;\n fiber = null !== fiber ? fiber.dehydrated : null;\n if (!fiber) throw Error(formatProdErrorMessage(317));\n nextHydratableInstance =\n getNextHydratableInstanceAfterHydrationBoundary(fiber);\n } else\n 27 === tag\n ? ((tag = nextHydratableInstance),\n isSingletonScope(fiber.type)\n ? ((fiber = previousHydratableOnEnteringScopedSingleton),\n (previousHydratableOnEnteringScopedSingleton = null),\n (nextHydratableInstance = fiber))\n : (nextHydratableInstance = tag))\n : (nextHydratableInstance = hydrationParentFiber\n ? getNextHydratable(fiber.stateNode.nextSibling)\n : null);\n return !0;\n}\nfunction resetHydrationState() {\n nextHydratableInstance = hydrationParentFiber = null;\n isHydrating = !1;\n}\nfunction upgradeHydrationErrorsToRecoverable() {\n var queuedErrors = hydrationErrors;\n null !== queuedErrors &&\n (null === workInProgressRootRecoverableErrors\n ? (workInProgressRootRecoverableErrors = queuedErrors)\n : workInProgressRootRecoverableErrors.push.apply(\n workInProgressRootRecoverableErrors,\n queuedErrors\n ),\n (hydrationErrors = null));\n return queuedErrors;\n}\nfunction queueHydrationError(error) {\n null === hydrationErrors\n ? (hydrationErrors = [error])\n : hydrationErrors.push(error);\n}\nvar valueCursor = createCursor(null),\n currentlyRenderingFiber$1 = null,\n lastContextDependency = null;\nfunction pushProvider(providerFiber, context, nextValue) {\n push(valueCursor, context._currentValue);\n context._currentValue = nextValue;\n}\nfunction popProvider(context) {\n context._currentValue = valueCursor.current;\n pop(valueCursor);\n}\nfunction scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) {\n for (; null !== parent; ) {\n var alternate = parent.alternate;\n (parent.childLanes & renderLanes) !== renderLanes\n ? ((parent.childLanes |= renderLanes),\n null !== alternate && (alternate.childLanes |= renderLanes))\n : null !== alternate &&\n (alternate.childLanes & renderLanes) !== renderLanes &&\n (alternate.childLanes |= renderLanes);\n if (parent === propagationRoot) break;\n parent = parent.return;\n }\n}\nfunction propagateContextChanges(\n workInProgress,\n contexts,\n renderLanes,\n forcePropagateEntireTree\n) {\n var fiber = workInProgress.child;\n null !== fiber && (fiber.return = workInProgress);\n for (; null !== fiber; ) {\n var list = fiber.dependencies;\n if (null !== list) {\n var nextFiber = fiber.child;\n list = list.firstContext;\n a: for (; null !== list; ) {\n var dependency = list;\n list = fiber;\n for (var i = 0; i < contexts.length; i++)\n if (dependency.context === contexts[i]) {\n list.lanes |= renderLanes;\n dependency = list.alternate;\n null !== dependency && (dependency.lanes |= renderLanes);\n scheduleContextWorkOnParentPath(\n list.return,\n renderLanes,\n workInProgress\n );\n forcePropagateEntireTree || (nextFiber = null);\n break a;\n }\n list = dependency.next;\n }\n } else if (18 === fiber.tag) {\n nextFiber = fiber.return;\n if (null === nextFiber) throw Error(formatProdErrorMessage(341));\n nextFiber.lanes |= renderLanes;\n list = nextFiber.alternate;\n null !== list && (list.lanes |= renderLanes);\n scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress);\n nextFiber = null;\n } else\n 13 === fiber.tag &&\n null !== fiber.memoizedState &&\n null === fiber.memoizedState.dehydrated\n ? ((fiber.lanes |= renderLanes),\n (nextFiber = fiber.alternate),\n null !== nextFiber && (nextFiber.lanes |= renderLanes),\n scheduleContextWorkOnParentPath(\n fiber.return,\n renderLanes,\n workInProgress\n ),\n (nextFiber = fiber.child),\n (nextFiber = null !== nextFiber ? nextFiber.sibling : null))\n : (nextFiber = fiber.child);\n if (null !== nextFiber) nextFiber.return = fiber;\n else\n for (nextFiber = fiber; null !== nextFiber; ) {\n if (nextFiber === workInProgress) {\n nextFiber = null;\n break;\n }\n fiber = nextFiber.sibling;\n if (null !== fiber) {\n fiber.return = nextFiber.return;\n nextFiber = fiber;\n break;\n }\n nextFiber = nextFiber.return;\n }\n fiber = nextFiber;\n }\n}\nfunction propagateParentContextChanges(\n current,\n workInProgress,\n renderLanes,\n forcePropagateEntireTree\n) {\n current = null;\n for (\n var parent = workInProgress, isInsidePropagationBailout = !1;\n null !== parent;\n\n ) {\n if (!isInsidePropagationBailout)\n if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0;\n else if (0 !== (parent.flags & 262144)) break;\n if (10 === parent.tag) {\n var currentParent = parent.alternate;\n if (null === currentParent) throw Error(formatProdErrorMessage(387));\n currentParent = currentParent.memoizedProps;\n if (null !== currentParent) {\n var context = parent.type;\n objectIs(parent.pendingProps.value, currentParent.value) ||\n (null !== current ? current.push(context) : (current = [context]));\n }\n } else if (parent === hostTransitionProviderCursor.current) {\n currentParent = parent.alternate;\n if (null === currentParent) throw Error(formatProdErrorMessage(387));\n currentParent.memoizedState.memoizedState !==\n parent.memoizedState.memoizedState &&\n (null !== current\n ? current.push(HostTransitionContext)\n : (current = [HostTransitionContext]));\n }\n parent = parent.return;\n }\n null !== current &&\n propagateContextChanges(\n workInProgress,\n current,\n renderLanes,\n forcePropagateEntireTree\n );\n workInProgress.flags |= 262144;\n return null !== current;\n}\nfunction checkIfContextChanged(currentDependencies) {\n for (\n currentDependencies = currentDependencies.firstContext;\n null !== currentDependencies;\n\n ) {\n if (\n !objectIs(\n currentDependencies.context._currentValue,\n currentDependencies.memoizedValue\n )\n )\n return !0;\n currentDependencies = currentDependencies.next;\n }\n return !1;\n}\nfunction prepareToReadContext(workInProgress) {\n currentlyRenderingFiber$1 = workInProgress;\n lastContextDependency = null;\n workInProgress = workInProgress.dependencies;\n null !== workInProgress && (workInProgress.firstContext = null);\n}\nfunction readContext(context) {\n return readContextForConsumer(currentlyRenderingFiber$1, context);\n}\nfunction readContextDuringReconciliation(consumer, context) {\n null === currentlyRenderingFiber$1 && prepareToReadContext(consumer);\n return readContextForConsumer(consumer, context);\n}\nfunction readContextForConsumer(consumer, context) {\n var value = context._currentValue;\n context = { context: context, memoizedValue: value, next: null };\n if (null === lastContextDependency) {\n if (null === consumer) throw Error(formatProdErrorMessage(308));\n lastContextDependency = context;\n consumer.dependencies = { lanes: 0, firstContext: context };\n consumer.flags |= 524288;\n } else lastContextDependency = lastContextDependency.next = context;\n return value;\n}\nvar AbortControllerLocal =\n \"undefined\" !== typeof AbortController\n ? AbortController\n : function () {\n var listeners = [],\n signal = (this.signal = {\n aborted: !1,\n addEventListener: function (type, listener) {\n listeners.push(listener);\n }\n });\n this.abort = function () {\n signal.aborted = !0;\n listeners.forEach(function (listener) {\n return listener();\n });\n };\n },\n scheduleCallback$2 = Scheduler.unstable_scheduleCallback,\n NormalPriority = Scheduler.unstable_NormalPriority,\n CacheContext = {\n $$typeof: REACT_CONTEXT_TYPE,\n Consumer: null,\n Provider: null,\n _currentValue: null,\n _currentValue2: null,\n _threadCount: 0\n };\nfunction createCache() {\n return {\n controller: new AbortControllerLocal(),\n data: new Map(),\n refCount: 0\n };\n}\nfunction releaseCache(cache) {\n cache.refCount--;\n 0 === cache.refCount &&\n scheduleCallback$2(NormalPriority, function () {\n cache.controller.abort();\n });\n}\nfunction queueTransitionTypes(root, transitionTypes) {\n if (0 !== (root.pendingLanes & 4194048)) {\n var queued = root.transitionTypes;\n null === queued && (queued = root.transitionTypes = []);\n for (root = 0; root < transitionTypes.length; root++) {\n var transitionType = transitionTypes[root];\n -1 === queued.indexOf(transitionType) && queued.push(transitionType);\n }\n }\n}\nvar entangledTransitionTypes = null;\nfunction claimQueuedTransitionTypes(root) {\n var claimed = root.transitionTypes;\n root.transitionTypes = null;\n return claimed;\n}\nvar currentEntangledListeners = null,\n currentEntangledPendingCount = 0,\n currentEntangledLane = 0,\n currentEntangledActionThenable = null;\nfunction entangleAsyncAction(transition, thenable) {\n if (null === currentEntangledListeners) {\n var entangledListeners = (currentEntangledListeners = []);\n currentEntangledPendingCount = 0;\n currentEntangledLane = requestTransitionLane();\n currentEntangledActionThenable = {\n status: \"pending\",\n value: void 0,\n then: function (resolve) {\n entangledListeners.push(resolve);\n }\n };\n }\n currentEntangledPendingCount++;\n thenable.then(pingEngtangledActionScope, pingEngtangledActionScope);\n return thenable;\n}\nfunction pingEngtangledActionScope() {\n if (\n 0 === --currentEntangledPendingCount &&\n ((entangledTransitionTypes = null), null !== currentEntangledListeners)\n ) {\n null !== currentEntangledActionThenable &&\n (currentEntangledActionThenable.status = \"fulfilled\");\n var listeners = currentEntangledListeners;\n currentEntangledListeners = null;\n currentEntangledLane = 0;\n currentEntangledActionThenable = null;\n for (var i = 0; i < listeners.length; i++) (0, listeners[i])();\n }\n}\nfunction chainThenableValue(thenable, result) {\n var listeners = [],\n thenableWithOverride = {\n status: \"pending\",\n value: null,\n reason: null,\n then: function (resolve) {\n listeners.push(resolve);\n }\n };\n thenable.then(\n function () {\n thenableWithOverride.status = \"fulfilled\";\n thenableWithOverride.value = result;\n for (var i = 0; i < listeners.length; i++) (0, listeners[i])(result);\n },\n function (error) {\n thenableWithOverride.status = \"rejected\";\n thenableWithOverride.reason = error;\n for (error = 0; error < listeners.length; error++)\n (0, listeners[error])(void 0);\n }\n );\n return thenableWithOverride;\n}\nvar prevOnStartTransitionFinish = ReactSharedInternals.S;\nReactSharedInternals.S = function (transition, returnValue) {\n globalMostRecentTransitionTime = now();\n \"object\" === typeof returnValue &&\n null !== returnValue &&\n \"function\" === typeof returnValue.then &&\n entangleAsyncAction(transition, returnValue);\n if (null !== entangledTransitionTypes)\n for (var root$28 = firstScheduledRoot; null !== root$28; )\n queueTransitionTypes(root$28, entangledTransitionTypes),\n (root$28 = root$28.next);\n root$28 = transition.types;\n if (null !== root$28) {\n for (var root$29 = firstScheduledRoot; null !== root$29; )\n queueTransitionTypes(root$29, root$28), (root$29 = root$29.next);\n if (0 !== currentEntangledLane) {\n root$29 = entangledTransitionTypes;\n null === root$29 && (root$29 = entangledTransitionTypes = []);\n for (var i = 0; i < root$28.length; i++) {\n var transitionType = root$28[i];\n -1 === root$29.indexOf(transitionType) && root$29.push(transitionType);\n }\n }\n }\n null !== prevOnStartTransitionFinish &&\n prevOnStartTransitionFinish(transition, returnValue);\n};\nvar resumedCache = createCursor(null);\nfunction peekCacheFromPool() {\n var cacheResumedFromPreviousRender = resumedCache.current;\n return null !== cacheResumedFromPreviousRender\n ? cacheResumedFromPreviousRender\n : workInProgressRoot.pooledCache;\n}\nfunction pushTransition(offscreenWorkInProgress, prevCachePool) {\n null === prevCachePool\n ? push(resumedCache, resumedCache.current)\n : push(resumedCache, prevCachePool.pool);\n}\nfunction getSuspendedCache() {\n var cacheFromPool = peekCacheFromPool();\n return null === cacheFromPool\n ? null\n : { parent: CacheContext._currentValue, pool: cacheFromPool };\n}\nvar SuspenseException = Error(formatProdErrorMessage(460)),\n SuspenseyCommitException = Error(formatProdErrorMessage(474)),\n SuspenseActionException = Error(formatProdErrorMessage(542)),\n noopSuspenseyCommitThenable = { then: function () {} };\nfunction isThenableResolved(thenable) {\n thenable = thenable.status;\n return \"fulfilled\" === thenable || \"rejected\" === thenable;\n}\nfunction trackUsedThenable(thenableState, thenable, index) {\n index = thenableState[index];\n void 0 === index\n ? thenableState.push(thenable)\n : index !== thenable && (thenable.then(noop$1, noop$1), (thenable = index));\n switch (thenable.status) {\n case \"fulfilled\":\n return thenable.value;\n case \"rejected\":\n thenableState = thenable.reason;\n checkIfUseWrappedInAsyncCatch(thenableState);\n if (void 0 === thenableState && !(\"reason\" in thenable))\n throw Error(formatProdErrorMessage(600));\n throw thenableState;\n default:\n if (\"string\" === typeof thenable.status) thenable.then(noop$1, noop$1);\n else {\n thenableState = workInProgressRoot;\n if (null !== thenableState && 100 < thenableState.shellSuspendCounter)\n throw Error(formatProdErrorMessage(482));\n thenableState = thenable;\n thenableState.status = \"pending\";\n thenableState.then(\n function (fulfilledValue) {\n if (\"pending\" === thenable.status) {\n var fulfilledThenable = thenable;\n fulfilledThenable.status = \"fulfilled\";\n fulfilledThenable.value = fulfilledValue;\n }\n },\n function (error) {\n if (\"pending\" === thenable.status) {\n var rejectedThenable = thenable;\n rejectedThenable.status = \"rejected\";\n rejectedThenable.reason = error;\n }\n }\n );\n }\n switch (thenable.status) {\n case \"fulfilled\":\n return thenable.value;\n case \"rejected\":\n throw (\n ((thenableState = thenable.reason),\n checkIfUseWrappedInAsyncCatch(thenableState),\n thenableState)\n );\n }\n suspendedThenable = thenable;\n throw SuspenseException;\n }\n}\nfunction resolveLazy(lazyType) {\n try {\n var init = lazyType._init;\n return init(lazyType._payload);\n } catch (x) {\n if (null !== x && \"object\" === typeof x && \"function\" === typeof x.then)\n throw ((suspendedThenable = x), SuspenseException);\n throw x;\n }\n}\nvar suspendedThenable = null;\nfunction getSuspendedThenable() {\n if (null === suspendedThenable) throw Error(formatProdErrorMessage(459));\n var thenable = suspendedThenable;\n suspendedThenable = null;\n return thenable;\n}\nfunction checkIfUseWrappedInAsyncCatch(rejectedReason) {\n if (\n rejectedReason === SuspenseException ||\n rejectedReason === SuspenseActionException\n )\n throw Error(formatProdErrorMessage(483));\n}\nvar thenableState$1 = null,\n thenableIndexCounter$1 = 0;\nfunction unwrapThenable(thenable) {\n var index = thenableIndexCounter$1;\n thenableIndexCounter$1 += 1;\n null === thenableState$1 && (thenableState$1 = []);\n return trackUsedThenable(thenableState$1, thenable, index);\n}\nfunction coerceRef(workInProgress, element) {\n element = element.props.ref;\n workInProgress.ref = void 0 !== element ? element : null;\n}\nfunction throwOnInvalidObjectTypeImpl(returnFiber, newChild) {\n if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE)\n throw Error(formatProdErrorMessage(525));\n returnFiber = Object.prototype.toString.call(newChild);\n throw Error(\n formatProdErrorMessage(\n 31,\n \"[object Object]\" === returnFiber\n ? \"object with keys {\" + Object.keys(newChild).join(\", \") + \"}\"\n : returnFiber\n )\n );\n}\nfunction createChildReconciler(shouldTrackSideEffects) {\n function deleteChild(returnFiber, childToDelete) {\n if (shouldTrackSideEffects) {\n var deletions = returnFiber.deletions;\n null === deletions\n ? ((returnFiber.deletions = [childToDelete]), (returnFiber.flags |= 16))\n : deletions.push(childToDelete);\n }\n }\n function deleteRemainingChildren(returnFiber, currentFirstChild) {\n if (!shouldTrackSideEffects) return null;\n for (; null !== currentFirstChild; )\n deleteChild(returnFiber, currentFirstChild),\n (currentFirstChild = currentFirstChild.sibling);\n return null;\n }\n function mapRemainingChildren(currentFirstChild) {\n for (var existingChildren = new Map(); null !== currentFirstChild; )\n null === currentFirstChild.key\n ? existingChildren.set(currentFirstChild.index, currentFirstChild)\n : existingChildren.set(currentFirstChild.key, currentFirstChild),\n (currentFirstChild = currentFirstChild.sibling);\n return existingChildren;\n }\n function useFiber(fiber, pendingProps) {\n fiber = createWorkInProgress(fiber, pendingProps);\n fiber.index = 0;\n fiber.sibling = null;\n return fiber;\n }\n function placeChild(newFiber, lastPlacedIndex, newIndex) {\n newFiber.index = newIndex;\n if (!shouldTrackSideEffects)\n return (newFiber.flags |= 1048576), lastPlacedIndex;\n newIndex = newFiber.alternate;\n if (null !== newIndex)\n return (\n (newIndex = newIndex.index),\n newIndex < lastPlacedIndex\n ? ((newFiber.flags |= 2), lastPlacedIndex)\n : newIndex\n );\n newFiber.flags |= 134217730;\n return lastPlacedIndex;\n }\n function placeSingleChild(newFiber) {\n shouldTrackSideEffects &&\n null === newFiber.alternate &&\n (newFiber.flags |= 134217730);\n return newFiber;\n }\n function updateTextNode(returnFiber, current, textContent, lanes) {\n if (null === current || 6 !== current.tag)\n return (\n (current = createFiberFromText(textContent, returnFiber.mode, lanes)),\n (current.return = returnFiber),\n current\n );\n current = useFiber(current, textContent);\n current.return = returnFiber;\n return current;\n }\n function updateElement(returnFiber, current, element, lanes) {\n var elementType = element.type;\n if (elementType === REACT_FRAGMENT_TYPE)\n return (\n (returnFiber = updateFragment(\n returnFiber,\n current,\n element.props.children,\n lanes,\n element.key\n )),\n coerceRef(returnFiber, element),\n returnFiber\n );\n if (\n null !== current &&\n (current.elementType === elementType ||\n (\"object\" === typeof elementType &&\n null !== elementType &&\n elementType.$$typeof === REACT_LAZY_TYPE &&\n resolveLazy(elementType) === current.type))\n )\n return (\n (current = useFiber(current, element.props)),\n coerceRef(current, element),\n (current.return = returnFiber),\n current\n );\n current = createFiberFromTypeAndProps(\n element.type,\n element.key,\n element.props,\n null,\n returnFiber.mode,\n lanes\n );\n coerceRef(current, element);\n current.return = returnFiber;\n return current;\n }\n function updatePortal(returnFiber, current, portal, lanes) {\n if (\n null === current ||\n 4 !== current.tag ||\n current.stateNode.containerInfo !== portal.containerInfo ||\n current.stateNode.implementation !== portal.implementation\n )\n return (\n (current = createFiberFromPortal(portal, returnFiber.mode, lanes)),\n (current.return = returnFiber),\n current\n );\n current = useFiber(current, portal.children || []);\n current.return = returnFiber;\n return current;\n }\n function updateFragment(returnFiber, current, fragment, lanes, key) {\n if (null === current || 7 !== current.tag)\n return (\n (current = createFiberFromFragment(\n fragment,\n returnFiber.mode,\n lanes,\n key\n )),\n (current.return = returnFiber),\n current\n );\n current = useFiber(current, fragment);\n current.return = returnFiber;\n return current;\n }\n function createChild(returnFiber, newChild, lanes) {\n if (\n (\"string\" === typeof newChild && \"\" !== newChild) ||\n \"number\" === typeof newChild ||\n \"bigint\" === typeof newChild\n )\n return (\n (newChild = createFiberFromText(\n \"\" + newChild,\n returnFiber.mode,\n lanes\n )),\n (newChild.return = returnFiber),\n newChild\n );\n if (\"object\" === typeof newChild && null !== newChild) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return (\n (lanes = createFiberFromTypeAndProps(\n newChild.type,\n newChild.key,\n newChild.props,\n null,\n returnFiber.mode,\n lanes\n )),\n coerceRef(lanes, newChild),\n (lanes.return = returnFiber),\n lanes\n );\n case REACT_PORTAL_TYPE:\n return (\n (newChild = createFiberFromPortal(\n newChild,\n returnFiber.mode,\n lanes\n )),\n (newChild.return = returnFiber),\n newChild\n );\n case REACT_LAZY_TYPE:\n return (\n (newChild = resolveLazy(newChild)),\n createChild(returnFiber, newChild, lanes)\n );\n }\n if (isArrayImpl(newChild) || getIteratorFn(newChild))\n return (\n (newChild = createFiberFromFragment(\n newChild,\n returnFiber.mode,\n lanes,\n null\n )),\n (newChild.return = returnFiber),\n newChild\n );\n if (\"function\" === typeof newChild.then)\n return createChild(returnFiber, unwrapThenable(newChild), lanes);\n if (newChild.$$typeof === REACT_CONTEXT_TYPE)\n return createChild(\n returnFiber,\n readContextDuringReconciliation(returnFiber, newChild),\n lanes\n );\n throwOnInvalidObjectTypeImpl(returnFiber, newChild);\n }\n return null;\n }\n function updateSlot(returnFiber, oldFiber, newChild, lanes) {\n var key = null !== oldFiber ? oldFiber.key : null;\n if (\n (\"string\" === typeof newChild && \"\" !== newChild) ||\n \"number\" === typeof newChild ||\n \"bigint\" === typeof newChild\n )\n return null !== key\n ? null\n : updateTextNode(returnFiber, oldFiber, \"\" + newChild, lanes);\n if (\"object\" === typeof newChild && null !== newChild) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return newChild.key === key\n ? updateElement(returnFiber, oldFiber, newChild, lanes)\n : null;\n case REACT_PORTAL_TYPE:\n return newChild.key === key\n ? updatePortal(returnFiber, oldFiber, newChild, lanes)\n : null;\n case REACT_LAZY_TYPE:\n return (\n (newChild = resolveLazy(newChild)),\n updateSlot(returnFiber, oldFiber, newChild, lanes)\n );\n }\n if (isArrayImpl(newChild) || getIteratorFn(newChild))\n return null !== key\n ? null\n : updateFragment(returnFiber, oldFiber, newChild, lanes, null);\n if (\"function\" === typeof newChild.then)\n return updateSlot(\n returnFiber,\n oldFiber,\n unwrapThenable(newChild),\n lanes\n );\n if (newChild.$$typeof === REACT_CONTEXT_TYPE)\n return updateSlot(\n returnFiber,\n oldFiber,\n readContextDuringReconciliation(returnFiber, newChild),\n lanes\n );\n throwOnInvalidObjectTypeImpl(returnFiber, newChild);\n }\n return null;\n }\n function updateFromMap(\n existingChildren,\n returnFiber,\n newIdx,\n newChild,\n lanes\n ) {\n if (\n (\"string\" === typeof newChild && \"\" !== newChild) ||\n \"number\" === typeof newChild ||\n \"bigint\" === typeof newChild\n )\n return (\n (existingChildren = existingChildren.get(newIdx) || null),\n updateTextNode(returnFiber, existingChildren, \"\" + newChild, lanes)\n );\n if (\"object\" === typeof newChild && null !== newChild) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return (\n (existingChildren =\n existingChildren.get(\n null === newChild.key ? newIdx : newChild.key\n ) || null),\n updateElement(returnFiber, existingChildren, newChild, lanes)\n );\n case REACT_PORTAL_TYPE:\n return (\n (existingChildren =\n existingChildren.get(\n null === newChild.key ? newIdx : newChild.key\n ) || null),\n updatePortal(returnFiber, existingChildren, newChild, lanes)\n );\n case REACT_LAZY_TYPE:\n return (\n (newChild = resolveLazy(newChild)),\n updateFromMap(\n existingChildren,\n returnFiber,\n newIdx,\n newChild,\n lanes\n )\n );\n }\n if (isArrayImpl(newChild) || getIteratorFn(newChild))\n return (\n (existingChildren = existingChildren.get(newIdx) || null),\n updateFragment(returnFiber, existingChildren, newChild, lanes, null)\n );\n if (\"function\" === typeof newChild.then)\n return updateFromMap(\n existingChildren,\n returnFiber,\n newIdx,\n unwrapThenable(newChild),\n lanes\n );\n if (newChild.$$typeof === REACT_CONTEXT_TYPE)\n return updateFromMap(\n existingChildren,\n returnFiber,\n newIdx,\n readContextDuringReconciliation(returnFiber, newChild),\n lanes\n );\n throwOnInvalidObjectTypeImpl(returnFiber, newChild);\n }\n return null;\n }\n function reconcileChildrenArray(\n returnFiber,\n currentFirstChild,\n newChildren,\n lanes\n ) {\n for (\n var resultingFirstChild = null,\n previousNewFiber = null,\n oldFiber = currentFirstChild,\n newIdx = (currentFirstChild = 0),\n nextOldFiber = null;\n null !== oldFiber && newIdx < newChildren.length;\n newIdx++\n ) {\n oldFiber.index > newIdx\n ? ((nextOldFiber = oldFiber), (oldFiber = null))\n : (nextOldFiber = oldFiber.sibling);\n var newFiber = updateSlot(\n returnFiber,\n oldFiber,\n newChildren[newIdx],\n lanes\n );\n if (null === newFiber) {\n null === oldFiber && (oldFiber = nextOldFiber);\n break;\n }\n shouldTrackSideEffects &&\n oldFiber &&\n null === newFiber.alternate &&\n deleteChild(returnFiber, oldFiber);\n currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);\n null === previousNewFiber\n ? (resultingFirstChild = newFiber)\n : (previousNewFiber.sibling = newFiber);\n previousNewFiber = newFiber;\n oldFiber = nextOldFiber;\n }\n if (newIdx === newChildren.length)\n return (\n deleteRemainingChildren(returnFiber, oldFiber),\n isHydrating && pushTreeFork(returnFiber, newIdx),\n resultingFirstChild\n );\n if (null === oldFiber) {\n for (; newIdx < newChildren.length; newIdx++)\n (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)),\n null !== oldFiber &&\n ((currentFirstChild = placeChild(\n oldFiber,\n currentFirstChild,\n newIdx\n )),\n null === previousNewFiber\n ? (resultingFirstChild = oldFiber)\n : (previousNewFiber.sibling = oldFiber),\n (previousNewFiber = oldFiber));\n isHydrating && pushTreeFork(returnFiber, newIdx);\n return resultingFirstChild;\n }\n for (\n oldFiber = mapRemainingChildren(oldFiber);\n newIdx < newChildren.length;\n newIdx++\n )\n (nextOldFiber = updateFromMap(\n oldFiber,\n returnFiber,\n newIdx,\n newChildren[newIdx],\n lanes\n )),\n null !== nextOldFiber &&\n (shouldTrackSideEffects &&\n ((newFiber = nextOldFiber.alternate),\n null !== newFiber &&\n oldFiber.delete(null === newFiber.key ? newIdx : newFiber.key)),\n (currentFirstChild = placeChild(\n nextOldFiber,\n currentFirstChild,\n newIdx\n )),\n null === previousNewFiber\n ? (resultingFirstChild = nextOldFiber)\n : (previousNewFiber.sibling = nextOldFiber),\n (previousNewFiber = nextOldFiber));\n shouldTrackSideEffects &&\n oldFiber.forEach(function (child) {\n return deleteChild(returnFiber, child);\n });\n isHydrating && pushTreeFork(returnFiber, newIdx);\n return resultingFirstChild;\n }\n function reconcileChildrenIterator(\n returnFiber,\n currentFirstChild,\n newChildren,\n lanes\n ) {\n if (null == newChildren) throw Error(formatProdErrorMessage(151));\n for (\n var resultingFirstChild = null,\n previousNewFiber = null,\n oldFiber = currentFirstChild,\n newIdx = (currentFirstChild = 0),\n nextOldFiber = null,\n step = newChildren.next();\n null !== oldFiber && !step.done;\n newIdx++, step = newChildren.next()\n ) {\n oldFiber.index > newIdx\n ? ((nextOldFiber = oldFiber), (oldFiber = null))\n : (nextOldFiber = oldFiber.sibling);\n var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes);\n if (null === newFiber) {\n null === oldFiber && (oldFiber = nextOldFiber);\n break;\n }\n shouldTrackSideEffects &&\n oldFiber &&\n null === newFiber.alternate &&\n deleteChild(returnFiber, oldFiber);\n currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);\n null === previousNewFiber\n ? (resultingFirstChild = newFiber)\n : (previousNewFiber.sibling = newFiber);\n previousNewFiber = newFiber;\n oldFiber = nextOldFiber;\n }\n if (step.done)\n return (\n deleteRemainingChildren(returnFiber, oldFiber),\n isHydrating && pushTreeFork(returnFiber, newIdx),\n resultingFirstChild\n );\n if (null === oldFiber) {\n for (; !step.done; newIdx++, step = newChildren.next())\n (step = createChild(returnFiber, step.value, lanes)),\n null !== step &&\n ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)),\n null === previousNewFiber\n ? (resultingFirstChild = step)\n : (previousNewFiber.sibling = step),\n (previousNewFiber = step));\n isHydrating && pushTreeFork(returnFiber, newIdx);\n return resultingFirstChild;\n }\n for (\n oldFiber = mapRemainingChildren(oldFiber);\n !step.done;\n newIdx++, step = newChildren.next()\n )\n (step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes)),\n null !== step &&\n (shouldTrackSideEffects &&\n ((nextOldFiber = step.alternate),\n null !== nextOldFiber &&\n oldFiber.delete(\n null === nextOldFiber.key ? newIdx : nextOldFiber.key\n )),\n (currentFirstChild = placeChild(step, currentFirstChild, newIdx)),\n null === previousNewFiber\n ? (resultingFirstChild = step)\n : (previousNewFiber.sibling = step),\n (previousNewFiber = step));\n shouldTrackSideEffects &&\n oldFiber.forEach(function (child) {\n return deleteChild(returnFiber, child);\n });\n isHydrating && pushTreeFork(returnFiber, newIdx);\n return resultingFirstChild;\n }\n function reconcileChildFibersImpl(\n returnFiber,\n currentFirstChild,\n newChild,\n lanes\n ) {\n \"object\" === typeof newChild &&\n null !== newChild &&\n newChild.type === REACT_FRAGMENT_TYPE &&\n null === newChild.key &&\n void 0 === newChild.props.ref &&\n (newChild = newChild.props.children);\n if (\"object\" === typeof newChild && null !== newChild) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n a: {\n for (var key = newChild.key; null !== currentFirstChild; ) {\n if (currentFirstChild.key === key) {\n key = newChild.type;\n if (key === REACT_FRAGMENT_TYPE) {\n if (7 === currentFirstChild.tag) {\n deleteRemainingChildren(\n returnFiber,\n currentFirstChild.sibling\n );\n lanes = useFiber(\n currentFirstChild,\n newChild.props.children\n );\n coerceRef(lanes, newChild);\n lanes.return = returnFiber;\n returnFiber = lanes;\n break a;\n }\n } else if (\n currentFirstChild.elementType === key ||\n (\"object\" === typeof key &&\n null !== key &&\n key.$$typeof === REACT_LAZY_TYPE &&\n resolveLazy(key) === currentFirstChild.type)\n ) {\n deleteRemainingChildren(\n returnFiber,\n currentFirstChild.sibling\n );\n lanes = useFiber(currentFirstChild, newChild.props);\n coerceRef(lanes, newChild);\n lanes.return = returnFiber;\n returnFiber = lanes;\n break a;\n }\n deleteRemainingChildren(returnFiber, currentFirstChild);\n break;\n } else deleteChild(returnFiber, currentFirstChild);\n currentFirstChild = currentFirstChild.sibling;\n }\n newChild.type === REACT_FRAGMENT_TYPE\n ? ((lanes = createFiberFromFragment(\n newChild.props.children,\n returnFiber.mode,\n lanes,\n newChild.key\n )),\n coerceRef(lanes, newChild),\n (lanes.return = returnFiber),\n (returnFiber = lanes))\n : ((lanes = createFiberFromTypeAndProps(\n newChild.type,\n newChild.key,\n newChild.props,\n null,\n returnFiber.mode,\n lanes\n )),\n coerceRef(lanes, newChild),\n (lanes.return = returnFiber),\n (returnFiber = lanes));\n }\n return placeSingleChild(returnFiber);\n case REACT_PORTAL_TYPE:\n a: {\n for (key = newChild.key; null !== currentFirstChild; ) {\n if (currentFirstChild.key === key)\n if (\n 4 === currentFirstChild.tag &&\n currentFirstChild.stateNode.containerInfo ===\n newChild.containerInfo &&\n currentFirstChild.stateNode.implementation ===\n newChild.implementation\n ) {\n deleteRemainingChildren(\n returnFiber,\n currentFirstChild.sibling\n );\n lanes = useFiber(currentFirstChild, newChild.children || []);\n lanes.return = returnFiber;\n returnFiber = lanes;\n break a;\n } else {\n deleteRemainingChildren(returnFiber, currentFirstChild);\n break;\n }\n else deleteChild(returnFiber, currentFirstChild);\n currentFirstChild = currentFirstChild.sibling;\n }\n lanes = createFiberFromPortal(newChild, returnFiber.mode, lanes);\n lanes.return = returnFiber;\n returnFiber = lanes;\n }\n return placeSingleChild(returnFiber);\n case REACT_LAZY_TYPE:\n return (\n (newChild = resolveLazy(newChild)),\n reconcileChildFibersImpl(\n returnFiber,\n currentFirstChild,\n newChild,\n lanes\n )\n );\n }\n if (isArrayImpl(newChild))\n return reconcileChildrenArray(\n returnFiber,\n currentFirstChild,\n newChild,\n lanes\n );\n if (getIteratorFn(newChild)) {\n key = getIteratorFn(newChild);\n if (\"function\" !== typeof key) throw Error(formatProdErrorMessage(150));\n newChild = key.call(newChild);\n return reconcileChildrenIterator(\n returnFiber,\n currentFirstChild,\n newChild,\n lanes\n );\n }\n if (\"function\" === typeof newChild.then)\n return reconcileChildFibersImpl(\n returnFiber,\n currentFirstChild,\n unwrapThenable(newChild),\n lanes\n );\n if (newChild.$$typeof === REACT_CONTEXT_TYPE)\n return reconcileChildFibersImpl(\n returnFiber,\n currentFirstChild,\n readContextDuringReconciliation(returnFiber, newChild),\n lanes\n );\n throwOnInvalidObjectTypeImpl(returnFiber, newChild);\n }\n return (\"string\" === typeof newChild && \"\" !== newChild) ||\n \"number\" === typeof newChild ||\n \"bigint\" === typeof newChild\n ? ((newChild = \"\" + newChild),\n null !== currentFirstChild && 6 === currentFirstChild.tag\n ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling),\n (lanes = useFiber(currentFirstChild, newChild)),\n (lanes.return = returnFiber),\n (returnFiber = lanes))\n : (deleteRemainingChildren(returnFiber, currentFirstChild),\n (lanes = createFiberFromText(newChild, returnFiber.mode, lanes)),\n (lanes.return = returnFiber),\n (returnFiber = lanes)),\n placeSingleChild(returnFiber))\n : deleteRemainingChildren(returnFiber, currentFirstChild);\n }\n return function (returnFiber, currentFirstChild, newChild, lanes) {\n try {\n thenableIndexCounter$1 = 0;\n var firstChildFiber = reconcileChildFibersImpl(\n returnFiber,\n currentFirstChild,\n newChild,\n lanes\n );\n thenableState$1 = null;\n return firstChildFiber;\n } catch (x) {\n if (x === SuspenseException || x === SuspenseActionException) throw x;\n var fiber = createFiberImplClass(29, x, null, returnFiber.mode);\n fiber.lanes = lanes;\n fiber.return = returnFiber;\n return fiber;\n } finally {\n }\n };\n}\nvar reconcileChildFibers = createChildReconciler(!0),\n mountChildFibers = createChildReconciler(!1),\n hasForceUpdate = !1;\nfunction initializeUpdateQueue(fiber) {\n fiber.updateQueue = {\n baseState: fiber.memoizedState,\n firstBaseUpdate: null,\n lastBaseUpdate: null,\n shared: { pending: null, lanes: 0, hiddenCallbacks: null },\n callbacks: null\n };\n}\nfunction cloneUpdateQueue(current, workInProgress) {\n current = current.updateQueue;\n workInProgress.updateQueue === current &&\n (workInProgress.updateQueue = {\n baseState: current.baseState,\n firstBaseUpdate: current.firstBaseUpdate,\n lastBaseUpdate: current.lastBaseUpdate,\n shared: current.shared,\n callbacks: null\n });\n}\nfunction createUpdate(lane) {\n return { lane: lane, tag: 0, payload: null, callback: null, next: null };\n}\nfunction enqueueUpdate(fiber, update, lane) {\n var updateQueue = fiber.updateQueue;\n if (null === updateQueue) return null;\n updateQueue = updateQueue.shared;\n if (0 !== (executionContext & 2)) {\n var pending = updateQueue.pending;\n null === pending\n ? (update.next = update)\n : ((update.next = pending.next), (pending.next = update));\n updateQueue.pending = update;\n update = getRootForUpdatedFiber(fiber);\n markUpdateLaneFromFiberToRoot(fiber, null, lane);\n return update;\n }\n enqueueUpdate$1(fiber, updateQueue, update, lane);\n return getRootForUpdatedFiber(fiber);\n}\nfunction entangleTransitions(root, fiber, lane) {\n fiber = fiber.updateQueue;\n if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194048))) {\n var queueLanes = fiber.lanes;\n queueLanes &= root.pendingLanes;\n lane |= queueLanes;\n fiber.lanes = lane;\n markRootEntangled(root, lane);\n }\n}\nfunction enqueueCapturedUpdate(workInProgress, capturedUpdate) {\n var queue = workInProgress.updateQueue,\n current = workInProgress.alternate;\n if (\n null !== current &&\n ((current = current.updateQueue), queue === current)\n ) {\n var newFirst = null,\n newLast = null;\n queue = queue.firstBaseUpdate;\n if (null !== queue) {\n do {\n var clone = {\n lane: queue.lane,\n tag: queue.tag,\n payload: queue.payload,\n callback: null,\n next: null\n };\n null === newLast\n ? (newFirst = newLast = clone)\n : (newLast = newLast.next = clone);\n queue = queue.next;\n } while (null !== queue);\n null === newLast\n ? (newFirst = newLast = capturedUpdate)\n : (newLast = newLast.next = capturedUpdate);\n } else newFirst = newLast = capturedUpdate;\n queue = {\n baseState: current.baseState,\n firstBaseUpdate: newFirst,\n lastBaseUpdate: newLast,\n shared: current.shared,\n callbacks: current.callbacks\n };\n workInProgress.updateQueue = queue;\n return;\n }\n workInProgress = queue.lastBaseUpdate;\n null === workInProgress\n ? (queue.firstBaseUpdate = capturedUpdate)\n : (workInProgress.next = capturedUpdate);\n queue.lastBaseUpdate = capturedUpdate;\n}\nvar didReadFromEntangledAsyncAction = !1;\nfunction suspendIfUpdateReadFromEntangledAsyncAction() {\n if (didReadFromEntangledAsyncAction) {\n var entangledActionThenable = currentEntangledActionThenable;\n if (null !== entangledActionThenable) throw entangledActionThenable;\n }\n}\nfunction processUpdateQueue(\n workInProgress$jscomp$0,\n props,\n instance$jscomp$0,\n renderLanes\n) {\n didReadFromEntangledAsyncAction = !1;\n var queue = workInProgress$jscomp$0.updateQueue;\n hasForceUpdate = !1;\n var firstBaseUpdate = queue.firstBaseUpdate,\n lastBaseUpdate = queue.lastBaseUpdate,\n pendingQueue = queue.shared.pending;\n if (null !== pendingQueue) {\n queue.shared.pending = null;\n var lastPendingUpdate = pendingQueue,\n firstPendingUpdate = lastPendingUpdate.next;\n lastPendingUpdate.next = null;\n null === lastBaseUpdate\n ? (firstBaseUpdate = firstPendingUpdate)\n : (lastBaseUpdate.next = firstPendingUpdate);\n lastBaseUpdate = lastPendingUpdate;\n var current = workInProgress$jscomp$0.alternate;\n null !== current &&\n ((current = current.updateQueue),\n (pendingQueue = current.lastBaseUpdate),\n pendingQueue !== lastBaseUpdate &&\n (null === pendingQueue\n ? (current.firstBaseUpdate = firstPendingUpdate)\n : (pendingQueue.next = firstPendingUpdate),\n (current.lastBaseUpdate = lastPendingUpdate)));\n }\n if (null !== firstBaseUpdate) {\n var newState = queue.baseState;\n lastBaseUpdate = 0;\n current = firstPendingUpdate = lastPendingUpdate = null;\n pendingQueue = firstBaseUpdate;\n do {\n var updateLane = pendingQueue.lane & -536870913,\n isHiddenUpdate = updateLane !== pendingQueue.lane;\n if (\n isHiddenUpdate\n ? (workInProgressRootRenderLanes & updateLane) === updateLane\n : (renderLanes & updateLane) === updateLane\n ) {\n 0 !== updateLane &&\n updateLane === currentEntangledLane &&\n (didReadFromEntangledAsyncAction = !0);\n null !== current &&\n (current = current.next =\n {\n lane: 0,\n tag: pendingQueue.tag,\n payload: pendingQueue.payload,\n callback: null,\n next: null\n });\n a: {\n var workInProgress = workInProgress$jscomp$0,\n update = pendingQueue;\n updateLane = props;\n var instance = instance$jscomp$0;\n switch (update.tag) {\n case 1:\n workInProgress = update.payload;\n if (\"function\" === typeof workInProgress) {\n newState = workInProgress.call(instance, newState, updateLane);\n break a;\n }\n newState = workInProgress;\n break a;\n case 3:\n workInProgress.flags = (workInProgress.flags & -65537) | 128;\n case 0:\n workInProgress = update.payload;\n updateLane =\n \"function\" === typeof workInProgress\n ? workInProgress.call(instance, newState, updateLane)\n : workInProgress;\n if (null === updateLane || void 0 === updateLane) break a;\n newState = assign({}, newState, updateLane);\n break a;\n case 2:\n hasForceUpdate = !0;\n }\n }\n updateLane = pendingQueue.callback;\n null !== updateLane &&\n ((workInProgress$jscomp$0.flags |= 64),\n isHiddenUpdate && (workInProgress$jscomp$0.flags |= 8192),\n (isHiddenUpdate = queue.callbacks),\n null === isHiddenUpdate\n ? (queue.callbacks = [updateLane])\n : isHiddenUpdate.push(updateLane));\n } else\n (isHiddenUpdate = {\n lane: updateLane,\n tag: pendingQueue.tag,\n payload: pendingQueue.payload,\n callback: pendingQueue.callback,\n next: null\n }),\n null === current\n ? ((firstPendingUpdate = current = isHiddenUpdate),\n (lastPendingUpdate = newState))\n : (current = current.next = isHiddenUpdate),\n (lastBaseUpdate |= updateLane);\n pendingQueue = pendingQueue.next;\n if (null === pendingQueue)\n if (((pendingQueue = queue.shared.pending), null === pendingQueue))\n break;\n else\n (isHiddenUpdate = pendingQueue),\n (pendingQueue = isHiddenUpdate.next),\n (isHiddenUpdate.next = null),\n (queue.lastBaseUpdate = isHiddenUpdate),\n (queue.shared.pending = null);\n } while (1);\n null === current && (lastPendingUpdate = newState);\n queue.baseState = lastPendingUpdate;\n queue.firstBaseUpdate = firstPendingUpdate;\n queue.lastBaseUpdate = current;\n null === firstBaseUpdate && (queue.shared.lanes = 0);\n workInProgressRootSkippedLanes |= lastBaseUpdate;\n workInProgress$jscomp$0.lanes = lastBaseUpdate;\n workInProgress$jscomp$0.memoizedState = newState;\n }\n}\nfunction callCallback(callback, context) {\n if (\"function\" !== typeof callback)\n throw Error(formatProdErrorMessage(191, callback));\n callback.call(context);\n}\nfunction commitCallbacks(updateQueue, context) {\n var callbacks = updateQueue.callbacks;\n if (null !== callbacks)\n for (\n updateQueue.callbacks = null, updateQueue = 0;\n updateQueue < callbacks.length;\n updateQueue++\n )\n callCallback(callbacks[updateQueue], context);\n}\nvar currentTreeHiddenStackCursor = createCursor(null),\n prevEntangledRenderLanesCursor = createCursor(0);\nfunction pushHiddenContext(fiber, context) {\n fiber = entangledRenderLanes;\n push(prevEntangledRenderLanesCursor, fiber);\n push(currentTreeHiddenStackCursor, context);\n entangledRenderLanes = fiber | context.baseLanes;\n}\nfunction reuseHiddenContextOnStack() {\n push(prevEntangledRenderLanesCursor, entangledRenderLanes);\n push(currentTreeHiddenStackCursor, currentTreeHiddenStackCursor.current);\n}\nfunction popHiddenContext() {\n entangledRenderLanes = prevEntangledRenderLanesCursor.current;\n pop(currentTreeHiddenStackCursor);\n pop(prevEntangledRenderLanesCursor);\n}\nvar suspenseHandlerStackCursor = createCursor(null),\n shellBoundary = null;\nfunction pushPrimaryTreeSuspenseHandler(handler) {\n var current = handler.alternate;\n push(suspenseStackCursor, suspenseStackCursor.current & 1);\n push(suspenseHandlerStackCursor, handler);\n null === shellBoundary &&\n (null === current || null !== currentTreeHiddenStackCursor.current\n ? (shellBoundary = handler)\n : null !== current.memoizedState && (shellBoundary = handler));\n}\nfunction pushDehydratedActivitySuspenseHandler(fiber) {\n push(suspenseStackCursor, suspenseStackCursor.current);\n push(suspenseHandlerStackCursor, fiber);\n null === shellBoundary && (shellBoundary = fiber);\n}\nfunction pushOffscreenSuspenseHandler(fiber) {\n 22 === fiber.tag\n ? (push(suspenseStackCursor, suspenseStackCursor.current),\n push(suspenseHandlerStackCursor, fiber),\n null === shellBoundary && (shellBoundary = fiber))\n : reuseSuspenseHandlerOnStack();\n}\nfunction reuseSuspenseHandlerOnStack() {\n push(suspenseStackCursor, suspenseStackCursor.current);\n push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current);\n}\nfunction popSuspenseHandler(fiber) {\n pop(suspenseHandlerStackCursor);\n shellBoundary === fiber && (shellBoundary = null);\n pop(suspenseStackCursor);\n}\nvar suspenseStackCursor = createCursor(0);\nfunction pushSuspenseListContext(fiber, newContext) {\n push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current);\n push(suspenseStackCursor, newContext);\n}\nfunction popSuspenseListContext(fiber) {\n pop(suspenseStackCursor);\n pop(suspenseHandlerStackCursor);\n shellBoundary === fiber && (shellBoundary = null);\n}\nfunction findFirstSuspended(row) {\n for (var node = row; null !== node; ) {\n if (13 === node.tag) {\n var state = node.memoizedState;\n if (\n null !== state &&\n ((state = state.dehydrated),\n null === state ||\n isSuspenseInstancePending(state) ||\n isSuspenseInstanceFallback(state))\n )\n return node;\n } else if (\n 19 === node.tag &&\n \"independent\" !== node.memoizedProps.revealOrder\n ) {\n if (0 !== (node.flags & 128)) return node;\n } else if (null !== node.child) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n if (node === row) break;\n for (; null === node.sibling; ) {\n if (null === node.return || node.return === row) return null;\n node = node.return;\n }\n node.sibling.return = node.return;\n node = node.sibling;\n }\n return null;\n}\nvar renderLanes = 0,\n currentlyRenderingFiber = null,\n currentHook = null,\n workInProgressHook = null,\n didScheduleRenderPhaseUpdate = !1,\n didScheduleRenderPhaseUpdateDuringThisPass = !1,\n shouldDoubleInvokeUserFnsInHooksDEV = !1,\n localIdCounter = 0,\n thenableIndexCounter = 0,\n thenableState = null,\n globalClientIdCounter = 0;\nfunction throwInvalidHookError() {\n throw Error(formatProdErrorMessage(321));\n}\nfunction areHookInputsEqual(nextDeps, prevDeps) {\n if (null === prevDeps) return !1;\n for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++)\n if (!objectIs(nextDeps[i], prevDeps[i])) return !1;\n return !0;\n}\nfunction renderWithHooks(\n current,\n workInProgress,\n Component,\n props,\n secondArg,\n nextRenderLanes\n) {\n renderLanes = nextRenderLanes;\n currentlyRenderingFiber = workInProgress;\n workInProgress.memoizedState = null;\n workInProgress.updateQueue = null;\n workInProgress.lanes = 0;\n ReactSharedInternals.H =\n null === current || null === current.memoizedState\n ? HooksDispatcherOnMount\n : HooksDispatcherOnUpdate;\n shouldDoubleInvokeUserFnsInHooksDEV = !1;\n nextRenderLanes = Component(props, secondArg);\n shouldDoubleInvokeUserFnsInHooksDEV = !1;\n didScheduleRenderPhaseUpdateDuringThisPass &&\n (nextRenderLanes = renderWithHooksAgain(\n workInProgress,\n Component,\n props,\n secondArg\n ));\n finishRenderingHooks(current);\n return nextRenderLanes;\n}\nfunction finishRenderingHooks(current) {\n ReactSharedInternals.H = ContextOnlyDispatcher;\n var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next;\n renderLanes = 0;\n workInProgressHook = currentHook = currentlyRenderingFiber = null;\n didScheduleRenderPhaseUpdate = !1;\n thenableIndexCounter = 0;\n thenableState = null;\n if (didRenderTooFewHooks) throw Error(formatProdErrorMessage(300));\n null === current ||\n didReceiveUpdate ||\n ((current = current.dependencies),\n null !== current &&\n checkIfContextChanged(current) &&\n (didReceiveUpdate = !0));\n}\nfunction renderWithHooksAgain(workInProgress, Component, props, secondArg) {\n currentlyRenderingFiber = workInProgress;\n var numberOfReRenders = 0;\n do {\n didScheduleRenderPhaseUpdateDuringThisPass && (thenableState = null);\n thenableIndexCounter = 0;\n didScheduleRenderPhaseUpdateDuringThisPass = !1;\n if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage(301));\n numberOfReRenders += 1;\n workInProgressHook = currentHook = null;\n if (null != workInProgress.updateQueue) {\n var children = workInProgress.updateQueue;\n children.lastEffect = null;\n children.events = null;\n children.stores = null;\n null != children.memoCache && (children.memoCache.index = 0);\n }\n ReactSharedInternals.H = HooksDispatcherOnRerender;\n children = Component(props, secondArg);\n } while (didScheduleRenderPhaseUpdateDuringThisPass);\n return children;\n}\nfunction TransitionAwareHostComponent() {\n var dispatcher = ReactSharedInternals.H,\n maybeThenable = dispatcher.useState()[0];\n maybeThenable =\n \"function\" === typeof maybeThenable.then\n ? useThenable(maybeThenable)\n : maybeThenable;\n dispatcher = dispatcher.useState()[0];\n (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher &&\n (currentlyRenderingFiber.flags |= 1024);\n return maybeThenable;\n}\nfunction checkDidRenderIdHook() {\n var didRenderIdHook = 0 !== localIdCounter;\n localIdCounter = 0;\n return didRenderIdHook;\n}\nfunction bailoutHooks(current, workInProgress, lanes) {\n workInProgress.updateQueue = current.updateQueue;\n workInProgress.flags &= -2053;\n current.lanes &= ~lanes;\n}\nfunction resetHooksOnUnwind(workInProgress) {\n if (didScheduleRenderPhaseUpdate) {\n for (\n workInProgress = workInProgress.memoizedState;\n null !== workInProgress;\n\n ) {\n var queue = workInProgress.queue;\n null !== queue && (queue.pending = null);\n workInProgress = workInProgress.next;\n }\n didScheduleRenderPhaseUpdate = !1;\n }\n renderLanes = 0;\n workInProgressHook = currentHook = currentlyRenderingFiber = null;\n didScheduleRenderPhaseUpdateDuringThisPass = !1;\n thenableIndexCounter = localIdCounter = 0;\n thenableState = null;\n}\nfunction mountWorkInProgressHook() {\n var hook = {\n memoizedState: null,\n baseState: null,\n baseQueue: null,\n queue: null,\n next: null\n };\n null === workInProgressHook\n ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook)\n : (workInProgressHook = workInProgressHook.next = hook);\n return workInProgressHook;\n}\nfunction updateWorkInProgressHook() {\n if (null === currentHook) {\n var nextCurrentHook = currentlyRenderingFiber.alternate;\n nextCurrentHook =\n null !== nextCurrentHook ? nextCurrentHook.memoizedState : null;\n } else nextCurrentHook = currentHook.next;\n var nextWorkInProgressHook =\n null === workInProgressHook\n ? currentlyRenderingFiber.memoizedState\n : workInProgressHook.next;\n if (null !== nextWorkInProgressHook)\n (workInProgressHook = nextWorkInProgressHook),\n (currentHook = nextCurrentHook);\n else {\n if (null === nextCurrentHook) {\n if (null === currentlyRenderingFiber.alternate)\n throw Error(formatProdErrorMessage(467));\n throw Error(formatProdErrorMessage(310));\n }\n currentHook = nextCurrentHook;\n nextCurrentHook = {\n memoizedState: currentHook.memoizedState,\n baseState: currentHook.baseState,\n baseQueue: currentHook.baseQueue,\n queue: currentHook.queue,\n next: null\n };\n null === workInProgressHook\n ? (currentlyRenderingFiber.memoizedState = workInProgressHook =\n nextCurrentHook)\n : (workInProgressHook = workInProgressHook.next = nextCurrentHook);\n }\n return workInProgressHook;\n}\nfunction createFunctionComponentUpdateQueue() {\n return { lastEffect: null, events: null, stores: null, memoCache: null };\n}\nfunction useThenable(thenable) {\n var index = thenableIndexCounter;\n thenableIndexCounter += 1;\n null === thenableState && (thenableState = []);\n thenable = trackUsedThenable(thenableState, thenable, index);\n index = currentlyRenderingFiber;\n null ===\n (null === workInProgressHook\n ? index.memoizedState\n : workInProgressHook.next) &&\n ((index = index.alternate),\n (ReactSharedInternals.H =\n null === index || null === index.memoizedState\n ? HooksDispatcherOnMount\n : HooksDispatcherOnUpdate));\n return thenable;\n}\nfunction use(usable) {\n if (null !== usable && \"object\" === typeof usable) {\n if (\"function\" === typeof usable.then) return useThenable(usable);\n if (usable.$$typeof === REACT_RECOVERABLE_TYPE) return;\n if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable);\n }\n throw Error(formatProdErrorMessage(438, String(usable)));\n}\nfunction useMemoCache(size) {\n var memoCache = null,\n updateQueue = currentlyRenderingFiber.updateQueue;\n null !== updateQueue && (memoCache = updateQueue.memoCache);\n if (null == memoCache) {\n var current = currentlyRenderingFiber.alternate;\n null !== current &&\n ((current = current.updateQueue),\n null !== current &&\n ((current = current.memoCache),\n null != current &&\n (memoCache = {\n data: current.data.map(function (array) {\n return array.slice();\n }),\n index: 0\n })));\n }\n null == memoCache && (memoCache = { data: [], index: 0 });\n null === updateQueue &&\n ((updateQueue = createFunctionComponentUpdateQueue()),\n (currentlyRenderingFiber.updateQueue = updateQueue));\n updateQueue.memoCache = memoCache;\n updateQueue = memoCache.data[memoCache.index];\n if (void 0 === updateQueue)\n for (\n updateQueue = memoCache.data[memoCache.index] = Array(size), current = 0;\n current < size;\n current++\n )\n updateQueue[current] = REACT_MEMO_CACHE_SENTINEL;\n memoCache.index++;\n return updateQueue;\n}\nfunction basicStateReducer(state, action) {\n return \"function\" === typeof action ? action(state) : action;\n}\nfunction updateReducer(reducer) {\n var hook = updateWorkInProgressHook();\n return updateReducerImpl(hook, currentHook, reducer);\n}\nfunction updateReducerImpl(hook, current, reducer) {\n var queue = hook.queue;\n if (null === queue) throw Error(formatProdErrorMessage(311));\n queue.lastRenderedReducer = reducer;\n var baseQueue = hook.baseQueue,\n pendingQueue = queue.pending;\n if (null !== pendingQueue) {\n if (null !== baseQueue) {\n var baseFirst = baseQueue.next;\n baseQueue.next = pendingQueue.next;\n pendingQueue.next = baseFirst;\n }\n current.baseQueue = baseQueue = pendingQueue;\n queue.pending = null;\n }\n pendingQueue = hook.baseState;\n if (null === baseQueue) hook.memoizedState = pendingQueue;\n else {\n current = baseQueue.next;\n var newBaseQueueFirst = (baseFirst = null),\n newBaseQueueLast = null,\n update = current,\n didReadFromEntangledAsyncAction$64 = !1;\n do {\n var updateLane = update.lane & -536870913;\n if (\n updateLane !== update.lane\n ? (workInProgressRootRenderLanes & updateLane) === updateLane\n : (renderLanes & updateLane) === updateLane\n ) {\n var revertLane = update.revertLane;\n if (0 === revertLane)\n null !== newBaseQueueLast &&\n (newBaseQueueLast = newBaseQueueLast.next =\n {\n lane: 0,\n revertLane: 0,\n gesture: null,\n action: update.action,\n hasEagerState: update.hasEagerState,\n eagerState: update.eagerState,\n next: null\n }),\n updateLane === currentEntangledLane &&\n (didReadFromEntangledAsyncAction$64 = !0);\n else if ((renderLanes & revertLane) === revertLane) {\n update = update.next;\n revertLane === currentEntangledLane &&\n (didReadFromEntangledAsyncAction$64 = !0);\n continue;\n } else\n (updateLane = {\n lane: 0,\n revertLane: update.revertLane,\n gesture: null,\n action: update.action,\n hasEagerState: update.hasEagerState,\n eagerState: update.eagerState,\n next: null\n }),\n null === newBaseQueueLast\n ? ((newBaseQueueFirst = newBaseQueueLast = updateLane),\n (baseFirst = pendingQueue))\n : (newBaseQueueLast = newBaseQueueLast.next = updateLane),\n (currentlyRenderingFiber.lanes |= revertLane),\n (workInProgressRootSkippedLanes |= revertLane);\n updateLane = update.action;\n shouldDoubleInvokeUserFnsInHooksDEV &&\n reducer(pendingQueue, updateLane);\n pendingQueue = update.hasEagerState\n ? update.eagerState\n : reducer(pendingQueue, updateLane);\n } else\n (revertLane = {\n lane: updateLane,\n revertLane: update.revertLane,\n gesture: update.gesture,\n action: update.action,\n hasEagerState: update.hasEagerState,\n eagerState: update.eagerState,\n next: null\n }),\n null === newBaseQueueLast\n ? ((newBaseQueueFirst = newBaseQueueLast = revertLane),\n (baseFirst = pendingQueue))\n : (newBaseQueueLast = newBaseQueueLast.next = revertLane),\n (currentlyRenderingFiber.lanes |= updateLane),\n (workInProgressRootSkippedLanes |= updateLane);\n update = update.next;\n } while (null !== update && update !== current);\n null === newBaseQueueLast\n ? (baseFirst = pendingQueue)\n : (newBaseQueueLast.next = newBaseQueueFirst);\n if (\n !objectIs(pendingQueue, hook.memoizedState) &&\n ((didReceiveUpdate = !0),\n didReadFromEntangledAsyncAction$64 &&\n ((reducer = currentEntangledActionThenable), null !== reducer))\n )\n throw reducer;\n hook.memoizedState = pendingQueue;\n hook.baseState = baseFirst;\n hook.baseQueue = newBaseQueueLast;\n queue.lastRenderedState = pendingQueue;\n }\n null === baseQueue && (queue.lanes = 0);\n return [hook.memoizedState, queue.dispatch];\n}\nfunction rerenderReducer(reducer) {\n var hook = updateWorkInProgressHook(),\n queue = hook.queue;\n if (null === queue) throw Error(formatProdErrorMessage(311));\n queue.lastRenderedReducer = reducer;\n var dispatch = queue.dispatch,\n lastRenderPhaseUpdate = queue.pending,\n newState = hook.memoizedState;\n if (null !== lastRenderPhaseUpdate) {\n queue.pending = null;\n var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next);\n do (newState = reducer(newState, update.action)), (update = update.next);\n while (update !== lastRenderPhaseUpdate);\n objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0);\n hook.memoizedState = newState;\n null === hook.baseQueue && (hook.baseState = newState);\n queue.lastRenderedState = newState;\n }\n return [newState, dispatch];\n}\nfunction updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {\n var fiber = currentlyRenderingFiber,\n hook = updateWorkInProgressHook(),\n isHydrating$jscomp$0 = isHydrating;\n if (isHydrating$jscomp$0) {\n if (void 0 === getServerSnapshot) throw Error(formatProdErrorMessage(407));\n getServerSnapshot = getServerSnapshot();\n } else getServerSnapshot = getSnapshot();\n var snapshotChanged = !objectIs(\n (currentHook || hook).memoizedState,\n getServerSnapshot\n );\n snapshotChanged &&\n ((hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0));\n hook = hook.queue;\n updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [\n subscribe\n ]);\n subscribe =\n hook.getSnapshot !== getSnapshot ||\n snapshotChanged ||\n (null !== workInProgressHook &&\n 0 !== (workInProgressHook.memoizedState.tag & 1));\n pushSimpleEffect(\n subscribe ? 9 : 8,\n { destroy: void 0 },\n updateStoreInstance.bind(null, fiber, hook, getServerSnapshot, getSnapshot),\n null\n );\n if (subscribe) {\n fiber.flags |= 2048;\n if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349));\n isHydrating$jscomp$0 ||\n 0 !== (renderLanes & 127) ||\n pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot);\n }\n return getServerSnapshot;\n}\nfunction pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) {\n fiber.flags |= 16384;\n fiber = { getSnapshot: getSnapshot, value: renderedSnapshot };\n getSnapshot = currentlyRenderingFiber.updateQueue;\n null === getSnapshot\n ? ((getSnapshot = createFunctionComponentUpdateQueue()),\n (currentlyRenderingFiber.updateQueue = getSnapshot),\n (getSnapshot.stores = [fiber]))\n : ((renderedSnapshot = getSnapshot.stores),\n null === renderedSnapshot\n ? (getSnapshot.stores = [fiber])\n : renderedSnapshot.push(fiber));\n}\nfunction updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) {\n inst.value = nextSnapshot;\n inst.getSnapshot = getSnapshot;\n checkIfSnapshotChanged(inst) && forceStoreRerender(fiber);\n}\nfunction subscribeToStore(fiber, inst, subscribe) {\n return subscribe(function () {\n checkIfSnapshotChanged(inst) && forceStoreRerender(fiber);\n });\n}\nfunction checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n inst = inst.value;\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(inst, nextValue);\n } catch (error) {\n return !0;\n }\n}\nfunction forceStoreRerender(fiber) {\n var root = enqueueConcurrentRenderForLane(fiber, 2);\n null !== root && scheduleUpdateOnFiber(root, fiber, 2);\n}\nfunction mountStateImpl(initialState) {\n var hook = mountWorkInProgressHook();\n if (\"function\" === typeof initialState) {\n var initialStateInitializer = initialState;\n initialState = initialStateInitializer();\n if (shouldDoubleInvokeUserFnsInHooksDEV) {\n setIsStrictModeForDevtools(!0);\n try {\n initialStateInitializer();\n } finally {\n setIsStrictModeForDevtools(!1);\n }\n }\n }\n hook.memoizedState = hook.baseState = initialState;\n hook.queue = {\n pending: null,\n lanes: 0,\n dispatch: null,\n lastRenderedReducer: basicStateReducer,\n lastRenderedState: initialState\n };\n return hook;\n}\nfunction updateOptimisticImpl(hook, current, passthrough, reducer) {\n hook.baseState = passthrough;\n return updateReducerImpl(\n hook,\n currentHook,\n \"function\" === typeof reducer ? reducer : basicStateReducer\n );\n}\nfunction dispatchActionState(\n fiber,\n actionQueue,\n setPendingState,\n setState,\n payload\n) {\n if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485));\n fiber = actionQueue.action;\n if (null !== fiber) {\n var actionNode = {\n payload: payload,\n action: fiber,\n next: null,\n isTransition: !0,\n status: \"pending\",\n value: null,\n reason: null,\n listeners: [],\n then: function (listener) {\n actionNode.listeners.push(listener);\n }\n };\n null !== ReactSharedInternals.T\n ? setPendingState(!0)\n : (actionNode.isTransition = !1);\n setState(actionNode);\n setPendingState = actionQueue.pending;\n null === setPendingState\n ? ((actionNode.next = actionQueue.pending = actionNode),\n runActionStateAction(actionQueue, actionNode))\n : ((actionNode.next = setPendingState.next),\n (actionQueue.pending = setPendingState.next = actionNode));\n }\n}\nfunction runActionStateAction(actionQueue, node) {\n var action = node.action,\n payload = node.payload,\n prevState = actionQueue.state;\n if (node.isTransition) {\n var prevTransition = ReactSharedInternals.T,\n currentTransition = {};\n currentTransition.types =\n null !== prevTransition ? prevTransition.types : null;\n ReactSharedInternals.T = currentTransition;\n try {\n var returnValue = action(prevState, payload),\n onStartTransitionFinish = ReactSharedInternals.S;\n null !== onStartTransitionFinish &&\n onStartTransitionFinish(currentTransition, returnValue);\n handleActionReturnValue(actionQueue, node, returnValue);\n } catch (error) {\n onActionError(actionQueue, node, error);\n } finally {\n null !== prevTransition &&\n null !== currentTransition.types &&\n (prevTransition.types = currentTransition.types),\n (ReactSharedInternals.T = prevTransition);\n }\n } else\n try {\n (prevTransition = action(prevState, payload)),\n handleActionReturnValue(actionQueue, node, prevTransition);\n } catch (error$70) {\n onActionError(actionQueue, node, error$70);\n }\n}\nfunction handleActionReturnValue(actionQueue, node, returnValue) {\n null !== returnValue &&\n \"object\" === typeof returnValue &&\n \"function\" === typeof returnValue.then\n ? returnValue.then(\n function (nextState) {\n onActionSuccess(actionQueue, node, nextState);\n },\n function (error) {\n return onActionError(actionQueue, node, error);\n }\n )\n : onActionSuccess(actionQueue, node, returnValue);\n}\nfunction onActionSuccess(actionQueue, actionNode, nextState) {\n actionNode.status = \"fulfilled\";\n actionNode.value = nextState;\n notifyActionListeners(actionNode);\n actionQueue.state = nextState;\n actionNode = actionQueue.pending;\n null !== actionNode &&\n ((nextState = actionNode.next),\n nextState === actionNode\n ? (actionQueue.pending = null)\n : ((nextState = nextState.next),\n (actionNode.next = nextState),\n runActionStateAction(actionQueue, nextState)));\n}\nfunction onActionError(actionQueue, actionNode, error) {\n var last = actionQueue.pending;\n actionQueue.pending = null;\n if (null !== last) {\n last = last.next;\n do\n (actionNode.status = \"rejected\"),\n (actionNode.reason = error),\n notifyActionListeners(actionNode),\n (actionNode = actionNode.next);\n while (actionNode !== last);\n }\n actionQueue.action = null;\n}\nfunction notifyActionListeners(actionNode) {\n actionNode = actionNode.listeners;\n for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])();\n}\nfunction actionStateReducer(oldState, newState) {\n return newState;\n}\nfunction mountActionState(action, initialStateProp) {\n if (isHydrating) {\n var ssrFormState = workInProgressRoot.formState;\n if (null !== ssrFormState) {\n a: {\n var JSCompiler_inline_result = currentlyRenderingFiber;\n if (isHydrating) {\n if (nextHydratableInstance) {\n b: {\n var JSCompiler_inline_result$jscomp$0 = nextHydratableInstance;\n for (\n var inRootOrSingleton = rootOrSingletonContext;\n 8 !== JSCompiler_inline_result$jscomp$0.nodeType;\n\n ) {\n if (!inRootOrSingleton) {\n JSCompiler_inline_result$jscomp$0 = null;\n break b;\n }\n JSCompiler_inline_result$jscomp$0 = getNextHydratable(\n JSCompiler_inline_result$jscomp$0.nextSibling\n );\n if (null === JSCompiler_inline_result$jscomp$0) {\n JSCompiler_inline_result$jscomp$0 = null;\n break b;\n }\n }\n inRootOrSingleton = JSCompiler_inline_result$jscomp$0.data;\n JSCompiler_inline_result$jscomp$0 =\n \"F!\" === inRootOrSingleton || \"F\" === inRootOrSingleton\n ? JSCompiler_inline_result$jscomp$0\n : null;\n }\n if (JSCompiler_inline_result$jscomp$0) {\n nextHydratableInstance = getNextHydratable(\n JSCompiler_inline_result$jscomp$0.nextSibling\n );\n JSCompiler_inline_result =\n \"F!\" === JSCompiler_inline_result$jscomp$0.data;\n break a;\n }\n }\n throwOnHydrationMismatch(JSCompiler_inline_result);\n }\n JSCompiler_inline_result = !1;\n }\n JSCompiler_inline_result && (initialStateProp = ssrFormState[0]);\n }\n }\n ssrFormState = mountWorkInProgressHook();\n ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp;\n JSCompiler_inline_result = {\n pending: null,\n lanes: 0,\n dispatch: null,\n lastRenderedReducer: actionStateReducer,\n lastRenderedState: initialStateProp\n };\n ssrFormState.queue = JSCompiler_inline_result;\n ssrFormState = dispatchSetState.bind(\n null,\n currentlyRenderingFiber,\n JSCompiler_inline_result\n );\n JSCompiler_inline_result.dispatch = ssrFormState;\n JSCompiler_inline_result = mountStateImpl(!1);\n inRootOrSingleton = dispatchOptimisticSetState.bind(\n null,\n currentlyRenderingFiber,\n !1,\n JSCompiler_inline_result.queue\n );\n JSCompiler_inline_result = mountWorkInProgressHook();\n JSCompiler_inline_result$jscomp$0 = {\n state: initialStateProp,\n dispatch: null,\n action: action,\n pending: null\n };\n JSCompiler_inline_result.queue = JSCompiler_inline_result$jscomp$0;\n ssrFormState = dispatchActionState.bind(\n null,\n currentlyRenderingFiber,\n JSCompiler_inline_result$jscomp$0,\n inRootOrSingleton,\n ssrFormState\n );\n JSCompiler_inline_result$jscomp$0.dispatch = ssrFormState;\n JSCompiler_inline_result.memoizedState = action;\n return [initialStateProp, ssrFormState, !1];\n}\nfunction updateActionState(action) {\n var stateHook = updateWorkInProgressHook();\n return updateActionStateImpl(stateHook, currentHook, action);\n}\nfunction updateActionStateImpl(stateHook, currentStateHook, action) {\n currentStateHook = updateReducerImpl(\n stateHook,\n currentStateHook,\n actionStateReducer\n )[0];\n stateHook = updateReducer(basicStateReducer)[0];\n if (\n \"object\" === typeof currentStateHook &&\n null !== currentStateHook &&\n \"function\" === typeof currentStateHook.then\n )\n try {\n var state = useThenable(currentStateHook);\n } catch (x) {\n if (x === SuspenseException) throw SuspenseActionException;\n throw x;\n }\n else state = currentStateHook;\n currentStateHook = updateWorkInProgressHook();\n var actionQueue = currentStateHook.queue,\n dispatch = actionQueue.dispatch;\n action !== currentStateHook.memoizedState &&\n ((currentlyRenderingFiber.flags |= 2048),\n pushSimpleEffect(\n 9,\n { destroy: void 0 },\n actionStateActionEffect.bind(null, actionQueue, action),\n null\n ));\n return [state, dispatch, stateHook];\n}\nfunction actionStateActionEffect(actionQueue, action) {\n actionQueue.action = action;\n}\nfunction rerenderActionState(action) {\n var stateHook = updateWorkInProgressHook(),\n currentStateHook = currentHook;\n if (null !== currentStateHook)\n return updateActionStateImpl(stateHook, currentStateHook, action);\n updateWorkInProgressHook();\n stateHook = stateHook.memoizedState;\n currentStateHook = updateWorkInProgressHook();\n var dispatch = currentStateHook.queue.dispatch;\n currentStateHook.memoizedState = action;\n return [stateHook, dispatch, !1];\n}\nfunction pushSimpleEffect(tag, inst, create, deps) {\n tag = { tag: tag, create: create, deps: deps, inst: inst, next: null };\n inst = currentlyRenderingFiber.updateQueue;\n null === inst &&\n ((inst = createFunctionComponentUpdateQueue()),\n (currentlyRenderingFiber.updateQueue = inst));\n create = inst.lastEffect;\n null === create\n ? (inst.lastEffect = tag.next = tag)\n : ((deps = create.next),\n (create.next = tag),\n (tag.next = deps),\n (inst.lastEffect = tag));\n return tag;\n}\nfunction updateRef() {\n return updateWorkInProgressHook().memoizedState;\n}\nfunction mountEffectImpl(fiberFlags, hookFlags, create, deps) {\n var hook = mountWorkInProgressHook();\n currentlyRenderingFiber.flags |= fiberFlags;\n hook.memoizedState = pushSimpleEffect(\n 1 | hookFlags,\n { destroy: void 0 },\n create,\n void 0 === deps ? null : deps\n );\n}\nfunction updateEffectImpl(fiberFlags, hookFlags, create, deps) {\n var hook = updateWorkInProgressHook();\n deps = void 0 === deps ? null : deps;\n var inst = hook.memoizedState.inst;\n null !== currentHook &&\n null !== deps &&\n areHookInputsEqual(deps, currentHook.memoizedState.deps)\n ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps))\n : ((currentlyRenderingFiber.flags |= fiberFlags),\n (hook.memoizedState = pushSimpleEffect(\n 1 | hookFlags,\n inst,\n create,\n deps\n )));\n}\nfunction mountEffect(create, deps) {\n mountEffectImpl(8390656, 8, create, deps);\n}\nfunction updateEffect(create, deps) {\n updateEffectImpl(2048, 8, create, deps);\n}\nfunction useEffectEventImpl(payload) {\n currentlyRenderingFiber.flags |= 4;\n var componentUpdateQueue = currentlyRenderingFiber.updateQueue;\n if (null === componentUpdateQueue)\n (componentUpdateQueue = createFunctionComponentUpdateQueue()),\n (currentlyRenderingFiber.updateQueue = componentUpdateQueue),\n (componentUpdateQueue.events = [payload]);\n else {\n var events = componentUpdateQueue.events;\n null === events\n ? (componentUpdateQueue.events = [payload])\n : events.push(payload);\n }\n}\nfunction updateEvent(callback) {\n var ref = updateWorkInProgressHook().memoizedState;\n useEffectEventImpl({ ref: ref, nextImpl: callback });\n return function () {\n if (0 !== (executionContext & 2)) throw Error(formatProdErrorMessage(440));\n return ref.impl.apply(void 0, arguments);\n };\n}\nfunction updateInsertionEffect(create, deps) {\n return updateEffectImpl(4, 2, create, deps);\n}\nfunction updateLayoutEffect(create, deps) {\n return updateEffectImpl(4, 4, create, deps);\n}\nfunction imperativeHandleEffect(create, ref) {\n if (\"function\" === typeof ref) {\n create = create();\n var refCleanup = ref(create);\n return function () {\n \"function\" === typeof refCleanup ? refCleanup() : ref(null);\n };\n }\n if (null !== ref && void 0 !== ref)\n return (\n (create = create()),\n (ref.current = create),\n function () {\n ref.current = null;\n }\n );\n}\nfunction updateImperativeHandle(ref, create, deps) {\n deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;\n updateEffectImpl(4, 4, imperativeHandleEffect.bind(null, create, ref), deps);\n}\nfunction mountDebugValue() {}\nfunction updateCallback(callback, deps) {\n var hook = updateWorkInProgressHook();\n deps = void 0 === deps ? null : deps;\n var prevState = hook.memoizedState;\n if (null !== deps && areHookInputsEqual(deps, prevState[1]))\n return prevState[0];\n hook.memoizedState = [callback, deps];\n return callback;\n}\nfunction updateMemo(nextCreate, deps) {\n var hook = updateWorkInProgressHook();\n deps = void 0 === deps ? null : deps;\n var prevState = hook.memoizedState;\n if (null !== deps && areHookInputsEqual(deps, prevState[1]))\n return prevState[0];\n prevState = nextCreate();\n if (shouldDoubleInvokeUserFnsInHooksDEV) {\n setIsStrictModeForDevtools(!0);\n try {\n nextCreate();\n } finally {\n setIsStrictModeForDevtools(!1);\n }\n }\n hook.memoizedState = [prevState, deps];\n return prevState;\n}\nfunction mountDeferredValueImpl(hook, value, initialValue) {\n if (\n void 0 === initialValue ||\n (0 !== (renderLanes & 1073741824) &&\n 0 === (workInProgressRootRenderLanes & 261930))\n )\n return (hook.memoizedState = value);\n hook.memoizedState = initialValue;\n hook = requestDeferredLane();\n currentlyRenderingFiber.lanes |= hook;\n workInProgressRootSkippedLanes |= hook;\n return initialValue;\n}\nfunction updateDeferredValueImpl(hook, prevValue, value, initialValue) {\n if (objectIs(value, prevValue)) return value;\n if (null !== currentTreeHiddenStackCursor.current)\n return (\n (hook = mountDeferredValueImpl(hook, value, initialValue)),\n objectIs(hook, prevValue) || (didReceiveUpdate = !0),\n hook\n );\n if (\n 0 === (renderLanes & 106) ||\n (0 !== (renderLanes & 1073741824) &&\n 0 === (workInProgressRootRenderLanes & 261930))\n )\n return (didReceiveUpdate = !0), (hook.memoizedState = value);\n hook = requestDeferredLane();\n currentlyRenderingFiber.lanes |= hook;\n workInProgressRootSkippedLanes |= hook;\n return prevValue;\n}\nfunction startTransition(fiber, queue, pendingState, finishedState, callback) {\n var previousPriority = ReactDOMSharedInternals.p;\n ReactDOMSharedInternals.p =\n 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8;\n var prevTransition = ReactSharedInternals.T,\n currentTransition = {};\n currentTransition.types =\n null !== prevTransition ? prevTransition.types : null;\n ReactSharedInternals.T = currentTransition;\n dispatchOptimisticSetState(fiber, !1, queue, pendingState);\n try {\n var returnValue = callback(),\n onStartTransitionFinish = ReactSharedInternals.S;\n null !== onStartTransitionFinish &&\n onStartTransitionFinish(currentTransition, returnValue);\n if (\n null !== returnValue &&\n \"object\" === typeof returnValue &&\n \"function\" === typeof returnValue.then\n ) {\n var thenableForFinishedState = chainThenableValue(\n returnValue,\n finishedState\n );\n dispatchSetStateInternal(\n fiber,\n queue,\n thenableForFinishedState,\n requestUpdateLane(fiber)\n );\n } else\n dispatchSetStateInternal(\n fiber,\n queue,\n finishedState,\n requestUpdateLane(fiber)\n );\n } catch (error) {\n dispatchSetStateInternal(\n fiber,\n queue,\n { then: function () {}, status: \"rejected\", reason: error },\n requestUpdateLane()\n );\n } finally {\n (ReactDOMSharedInternals.p = previousPriority),\n null !== prevTransition &&\n null !== currentTransition.types &&\n (prevTransition.types = currentTransition.types),\n (ReactSharedInternals.T = prevTransition);\n }\n}\nfunction noop() {}\nfunction startHostTransition(formFiber, pendingState, action, formData) {\n if (5 !== formFiber.tag) throw Error(formatProdErrorMessage(476));\n var queue = ensureFormComponentIsStateful(formFiber).queue;\n startTransition(\n formFiber,\n queue,\n pendingState,\n sharedNotPendingObject,\n null === action\n ? noop\n : function () {\n requestFormReset$1(formFiber);\n return action(formData);\n }\n );\n}\nfunction ensureFormComponentIsStateful(formFiber) {\n var existingStateHook = formFiber.memoizedState;\n if (null !== existingStateHook) return existingStateHook;\n existingStateHook = {\n memoizedState: sharedNotPendingObject,\n baseState: sharedNotPendingObject,\n baseQueue: null,\n queue: {\n pending: null,\n lanes: 0,\n dispatch: null,\n lastRenderedReducer: basicStateReducer,\n lastRenderedState: sharedNotPendingObject\n },\n next: null\n };\n var initialResetState = {};\n existingStateHook.next = {\n memoizedState: initialResetState,\n baseState: initialResetState,\n baseQueue: null,\n queue: {\n pending: null,\n lanes: 0,\n dispatch: null,\n lastRenderedReducer: basicStateReducer,\n lastRenderedState: initialResetState\n },\n next: null\n };\n formFiber.memoizedState = existingStateHook;\n formFiber = formFiber.alternate;\n null !== formFiber && (formFiber.memoizedState = existingStateHook);\n return existingStateHook;\n}\nfunction requestFormReset$1(formFiber) {\n var stateHook = ensureFormComponentIsStateful(formFiber);\n null === stateHook.next && (stateHook = formFiber.alternate.memoizedState);\n dispatchSetStateInternal(\n formFiber,\n stateHook.next.queue,\n {},\n requestUpdateLane()\n );\n}\nfunction useHostTransitionStatus() {\n return readContext(HostTransitionContext);\n}\nfunction updateId() {\n return updateWorkInProgressHook().memoizedState;\n}\nfunction updateRefresh() {\n return updateWorkInProgressHook().memoizedState;\n}\nfunction refreshCache(fiber) {\n for (var provider = fiber.return; null !== provider; ) {\n switch (provider.tag) {\n case 24:\n case 3:\n var lane = requestUpdateLane();\n fiber = createUpdate(lane);\n var root$73 = enqueueUpdate(provider, fiber, lane);\n null !== root$73 &&\n (scheduleUpdateOnFiber(root$73, provider, lane),\n entangleTransitions(root$73, provider, lane));\n provider = { cache: createCache() };\n fiber.payload = provider;\n return;\n }\n provider = provider.return;\n }\n}\nfunction dispatchReducerAction(fiber, queue, action) {\n var lane = requestUpdateLane();\n action = {\n lane: lane,\n revertLane: 0,\n gesture: null,\n action: action,\n hasEagerState: !1,\n eagerState: null,\n next: null\n };\n isRenderPhaseUpdate(fiber)\n ? enqueueRenderPhaseUpdate(queue, action)\n : ((action = enqueueConcurrentHookUpdate(fiber, queue, action, lane)),\n null !== action &&\n (scheduleUpdateOnFiber(action, fiber, lane),\n entangleTransitionUpdate(action, queue, lane)));\n}\nfunction dispatchSetState(fiber, queue, action) {\n var lane = requestUpdateLane();\n dispatchSetStateInternal(fiber, queue, action, lane);\n}\nfunction dispatchSetStateInternal(fiber, queue, action, lane) {\n var update = {\n lane: lane,\n revertLane: 0,\n gesture: null,\n action: action,\n hasEagerState: !1,\n eagerState: null,\n next: null\n };\n if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update);\n else {\n var alternate = fiber.alternate;\n if (\n 0 === fiber.lanes &&\n (null === alternate || 0 === alternate.lanes) &&\n ((alternate = queue.lastRenderedReducer), null !== alternate)\n )\n try {\n var currentState = queue.lastRenderedState,\n eagerState = alternate(currentState, action);\n update.hasEagerState = !0;\n update.eagerState = eagerState;\n if (objectIs(eagerState, currentState))\n return (\n enqueueUpdate$1(fiber, queue, update, 0),\n null === workInProgressRoot && finishQueueingConcurrentUpdates(),\n !1\n );\n } catch (error) {\n } finally {\n }\n action = enqueueConcurrentHookUpdate(fiber, queue, update, lane);\n if (null !== action)\n return (\n scheduleUpdateOnFiber(action, fiber, lane),\n entangleTransitionUpdate(action, queue, lane),\n !0\n );\n }\n return !1;\n}\nfunction dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) {\n action = {\n lane: 2,\n revertLane: requestTransitionLane(),\n gesture: null,\n action: action,\n hasEagerState: !1,\n eagerState: null,\n next: null\n };\n if (isRenderPhaseUpdate(fiber)) {\n if (throwIfDuringRender) throw Error(formatProdErrorMessage(479));\n } else\n (throwIfDuringRender = enqueueConcurrentHookUpdate(\n fiber,\n queue,\n action,\n 2\n )),\n null !== throwIfDuringRender &&\n scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2);\n}\nfunction isRenderPhaseUpdate(fiber) {\n var alternate = fiber.alternate;\n return (\n fiber === currentlyRenderingFiber ||\n (null !== alternate && alternate === currentlyRenderingFiber)\n );\n}\nfunction enqueueRenderPhaseUpdate(queue, update) {\n didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate =\n !0;\n var pending = queue.pending;\n null === pending\n ? (update.next = update)\n : ((update.next = pending.next), (pending.next = update));\n queue.pending = update;\n}\nfunction entangleTransitionUpdate(root, queue, lane) {\n if (0 !== (lane & 4194048)) {\n var queueLanes = queue.lanes;\n queueLanes &= root.pendingLanes;\n lane |= queueLanes;\n queue.lanes = lane;\n markRootEntangled(root, lane);\n }\n}\nvar ContextOnlyDispatcher = {\n readContext: readContext,\n use: use,\n useCallback: throwInvalidHookError,\n useContext: throwInvalidHookError,\n useEffect: throwInvalidHookError,\n useImperativeHandle: throwInvalidHookError,\n useLayoutEffect: throwInvalidHookError,\n useInsertionEffect: throwInvalidHookError,\n useMemo: throwInvalidHookError,\n useReducer: throwInvalidHookError,\n useRef: throwInvalidHookError,\n useState: throwInvalidHookError,\n useDebugValue: throwInvalidHookError,\n useDeferredValue: throwInvalidHookError,\n useTransition: throwInvalidHookError,\n useSyncExternalStore: throwInvalidHookError,\n useId: throwInvalidHookError,\n useHostTransitionStatus: throwInvalidHookError,\n useFormState: throwInvalidHookError,\n useActionState: throwInvalidHookError,\n useOptimistic: throwInvalidHookError,\n useMemoCache: throwInvalidHookError,\n useCacheRefresh: throwInvalidHookError,\n useEffectEvent: throwInvalidHookError\n },\n HooksDispatcherOnMount = {\n readContext: readContext,\n use: use,\n useCallback: function (callback, deps) {\n mountWorkInProgressHook().memoizedState = [\n callback,\n void 0 === deps ? null : deps\n ];\n return callback;\n },\n useContext: readContext,\n useEffect: mountEffect,\n useImperativeHandle: function (ref, create, deps) {\n deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;\n mountEffectImpl(\n 4194308,\n 4,\n imperativeHandleEffect.bind(null, create, ref),\n deps\n );\n },\n useLayoutEffect: function (create, deps) {\n return mountEffectImpl(4194308, 4, create, deps);\n },\n useInsertionEffect: function (create, deps) {\n mountEffectImpl(4, 2, create, deps);\n },\n useMemo: function (nextCreate, deps) {\n var hook = mountWorkInProgressHook();\n deps = void 0 === deps ? null : deps;\n var nextValue = nextCreate();\n if (shouldDoubleInvokeUserFnsInHooksDEV) {\n setIsStrictModeForDevtools(!0);\n try {\n nextCreate();\n } finally {\n setIsStrictModeForDevtools(!1);\n }\n }\n hook.memoizedState = [nextValue, deps];\n return nextValue;\n },\n useReducer: function (reducer, initialArg, init) {\n var hook = mountWorkInProgressHook();\n if (void 0 !== init) {\n var initialState = init(initialArg);\n if (shouldDoubleInvokeUserFnsInHooksDEV) {\n setIsStrictModeForDevtools(!0);\n try {\n init(initialArg);\n } finally {\n setIsStrictModeForDevtools(!1);\n }\n }\n } else initialState = initialArg;\n hook.memoizedState = hook.baseState = initialState;\n reducer = {\n pending: null,\n lanes: 0,\n dispatch: null,\n lastRenderedReducer: reducer,\n lastRenderedState: initialState\n };\n hook.queue = reducer;\n reducer = reducer.dispatch = dispatchReducerAction.bind(\n null,\n currentlyRenderingFiber,\n reducer\n );\n return [hook.memoizedState, reducer];\n },\n useRef: function (initialValue) {\n var hook = mountWorkInProgressHook();\n initialValue = { current: initialValue };\n return (hook.memoizedState = initialValue);\n },\n useState: function (initialState) {\n initialState = mountStateImpl(initialState);\n var queue = initialState.queue,\n dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue);\n queue.dispatch = dispatch;\n return [initialState.memoizedState, dispatch];\n },\n useDebugValue: mountDebugValue,\n useDeferredValue: function (value, initialValue) {\n var hook = mountWorkInProgressHook();\n return mountDeferredValueImpl(hook, value, initialValue);\n },\n useTransition: function () {\n var stateHook = mountStateImpl(!1);\n stateHook = startTransition.bind(\n null,\n currentlyRenderingFiber,\n stateHook.queue,\n !0,\n !1\n );\n mountWorkInProgressHook().memoizedState = stateHook;\n return [!1, stateHook];\n },\n useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) {\n var fiber = currentlyRenderingFiber,\n hook = mountWorkInProgressHook();\n if (isHydrating) {\n if (void 0 === getServerSnapshot)\n throw Error(formatProdErrorMessage(407));\n getServerSnapshot = getServerSnapshot();\n } else {\n getServerSnapshot = getSnapshot();\n if (null === workInProgressRoot)\n throw Error(formatProdErrorMessage(349));\n 0 !== (workInProgressRootRenderLanes & 127) ||\n pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot);\n }\n hook.memoizedState = getServerSnapshot;\n var inst = { value: getServerSnapshot, getSnapshot: getSnapshot };\n hook.queue = inst;\n mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [\n subscribe\n ]);\n fiber.flags |= 2048;\n pushSimpleEffect(\n 9,\n { destroy: void 0 },\n updateStoreInstance.bind(\n null,\n fiber,\n inst,\n getServerSnapshot,\n getSnapshot\n ),\n null\n );\n return getServerSnapshot;\n },\n useId: function () {\n var hook = mountWorkInProgressHook(),\n identifierPrefix = workInProgressRoot.identifierPrefix;\n if (isHydrating) {\n var JSCompiler_inline_result = treeContextOverflow;\n var idWithLeadingBit = treeContextId;\n JSCompiler_inline_result =\n (\n idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1))\n ).toString(32) + JSCompiler_inline_result;\n identifierPrefix =\n \"_\" + identifierPrefix + \"R_\" + JSCompiler_inline_result;\n JSCompiler_inline_result = localIdCounter++;\n 0 < JSCompiler_inline_result &&\n (identifierPrefix += \"H\" + JSCompiler_inline_result.toString(32));\n identifierPrefix += \"_\";\n } else\n (JSCompiler_inline_result = globalClientIdCounter++),\n (identifierPrefix =\n \"_\" +\n identifierPrefix +\n \"r_\" +\n JSCompiler_inline_result.toString(32) +\n \"_\");\n return (hook.memoizedState = identifierPrefix);\n },\n useHostTransitionStatus: useHostTransitionStatus,\n useFormState: mountActionState,\n useActionState: mountActionState,\n useOptimistic: function (passthrough) {\n var hook = mountWorkInProgressHook();\n hook.memoizedState = hook.baseState = passthrough;\n var queue = {\n pending: null,\n lanes: 0,\n dispatch: null,\n lastRenderedReducer: null,\n lastRenderedState: null\n };\n hook.queue = queue;\n hook = dispatchOptimisticSetState.bind(\n null,\n currentlyRenderingFiber,\n !0,\n queue\n );\n queue.dispatch = hook;\n return [passthrough, hook];\n },\n useMemoCache: useMemoCache,\n useCacheRefresh: function () {\n return (mountWorkInProgressHook().memoizedState = refreshCache.bind(\n null,\n currentlyRenderingFiber\n ));\n },\n useEffectEvent: function (callback) {\n var hook = mountWorkInProgressHook(),\n ref = { impl: callback };\n hook.memoizedState = ref;\n return function () {\n if (0 !== (executionContext & 2))\n throw Error(formatProdErrorMessage(440));\n return ref.impl.apply(void 0, arguments);\n };\n }\n },\n HooksDispatcherOnUpdate = {\n readContext: readContext,\n use: use,\n useCallback: updateCallback,\n useContext: readContext,\n useEffect: updateEffect,\n useImperativeHandle: updateImperativeHandle,\n useInsertionEffect: updateInsertionEffect,\n useLayoutEffect: updateLayoutEffect,\n useMemo: updateMemo,\n useReducer: updateReducer,\n useRef: updateRef,\n useState: function () {\n return updateReducer(basicStateReducer);\n },\n useDebugValue: mountDebugValue,\n useDeferredValue: function (value, initialValue) {\n var hook = updateWorkInProgressHook();\n return updateDeferredValueImpl(\n hook,\n currentHook.memoizedState,\n value,\n initialValue\n );\n },\n useTransition: function () {\n var booleanOrThenable = updateReducer(basicStateReducer)[0],\n start = updateWorkInProgressHook().memoizedState;\n return [\n \"boolean\" === typeof booleanOrThenable\n ? booleanOrThenable\n : useThenable(booleanOrThenable),\n start\n ];\n },\n useSyncExternalStore: updateSyncExternalStore,\n useId: updateId,\n useHostTransitionStatus: useHostTransitionStatus,\n useFormState: updateActionState,\n useActionState: updateActionState,\n useOptimistic: function (passthrough, reducer) {\n var hook = updateWorkInProgressHook();\n return updateOptimisticImpl(hook, currentHook, passthrough, reducer);\n },\n useMemoCache: useMemoCache,\n useCacheRefresh: updateRefresh,\n useEffectEvent: updateEvent\n },\n HooksDispatcherOnRerender = {\n readContext: readContext,\n use: use,\n useCallback: updateCallback,\n useContext: readContext,\n useEffect: updateEffect,\n useImperativeHandle: updateImperativeHandle,\n useInsertionEffect: updateInsertionEffect,\n useLayoutEffect: updateLayoutEffect,\n useMemo: updateMemo,\n useReducer: rerenderReducer,\n useRef: updateRef,\n useState: function () {\n return rerenderReducer(basicStateReducer);\n },\n useDebugValue: mountDebugValue,\n useDeferredValue: function (value, initialValue) {\n var hook = updateWorkInProgressHook();\n return null === currentHook\n ? mountDeferredValueImpl(hook, value, initialValue)\n : updateDeferredValueImpl(\n hook,\n currentHook.memoizedState,\n value,\n initialValue\n );\n },\n useTransition: function () {\n var booleanOrThenable = rerenderReducer(basicStateReducer)[0],\n start = updateWorkInProgressHook().memoizedState;\n return [\n \"boolean\" === typeof booleanOrThenable\n ? booleanOrThenable\n : useThenable(booleanOrThenable),\n start\n ];\n },\n useSyncExternalStore: updateSyncExternalStore,\n useId: updateId,\n useHostTransitionStatus: useHostTransitionStatus,\n useFormState: rerenderActionState,\n useActionState: rerenderActionState,\n useOptimistic: function (passthrough, reducer) {\n var hook = updateWorkInProgressHook();\n if (null !== currentHook)\n return updateOptimisticImpl(hook, currentHook, passthrough, reducer);\n hook.baseState = passthrough;\n return [passthrough, hook.queue.dispatch];\n },\n useMemoCache: useMemoCache,\n useCacheRefresh: updateRefresh,\n useEffectEvent: updateEvent\n };\nfunction applyDerivedStateFromProps(\n workInProgress,\n ctor,\n getDerivedStateFromProps,\n nextProps\n) {\n ctor = workInProgress.memoizedState;\n getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor);\n getDerivedStateFromProps =\n null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps\n ? ctor\n : assign({}, ctor, getDerivedStateFromProps);\n workInProgress.memoizedState = getDerivedStateFromProps;\n 0 === workInProgress.lanes &&\n (workInProgress.updateQueue.baseState = getDerivedStateFromProps);\n}\nvar classComponentUpdater = {\n enqueueSetState: function (inst, payload, callback) {\n inst = inst._reactInternals;\n var lane = requestUpdateLane(),\n update = createUpdate(lane);\n update.payload = payload;\n void 0 !== callback && null !== callback && (update.callback = callback);\n payload = enqueueUpdate(inst, update, lane);\n null !== payload &&\n (scheduleUpdateOnFiber(payload, inst, lane),\n entangleTransitions(payload, inst, lane));\n },\n enqueueReplaceState: function (inst, payload, callback) {\n inst = inst._reactInternals;\n var lane = requestUpdateLane(),\n update = createUpdate(lane);\n update.tag = 1;\n update.payload = payload;\n void 0 !== callback && null !== callback && (update.callback = callback);\n payload = enqueueUpdate(inst, update, lane);\n null !== payload &&\n (scheduleUpdateOnFiber(payload, inst, lane),\n entangleTransitions(payload, inst, lane));\n },\n enqueueForceUpdate: function (inst, callback) {\n inst = inst._reactInternals;\n var lane = requestUpdateLane(),\n update = createUpdate(lane);\n update.tag = 2;\n void 0 !== callback && null !== callback && (update.callback = callback);\n callback = enqueueUpdate(inst, update, lane);\n null !== callback &&\n (scheduleUpdateOnFiber(callback, inst, lane),\n entangleTransitions(callback, inst, lane));\n }\n};\nfunction checkShouldComponentUpdate(\n workInProgress,\n ctor,\n oldProps,\n newProps,\n oldState,\n newState,\n nextContext\n) {\n workInProgress = workInProgress.stateNode;\n return \"function\" === typeof workInProgress.shouldComponentUpdate\n ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext)\n : ctor.prototype && ctor.prototype.isPureReactComponent\n ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState)\n : !0;\n}\nfunction callComponentWillReceiveProps(\n workInProgress,\n instance,\n newProps,\n nextContext\n) {\n workInProgress = instance.state;\n \"function\" === typeof instance.componentWillReceiveProps &&\n instance.componentWillReceiveProps(newProps, nextContext);\n \"function\" === typeof instance.UNSAFE_componentWillReceiveProps &&\n instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);\n instance.state !== workInProgress &&\n classComponentUpdater.enqueueReplaceState(instance, instance.state, null);\n}\nfunction resolveClassComponentProps(Component, baseProps) {\n var newProps = baseProps;\n if (\"ref\" in baseProps) {\n newProps = {};\n for (var propName in baseProps)\n \"ref\" !== propName && (newProps[propName] = baseProps[propName]);\n }\n if ((Component = Component.defaultProps)) {\n newProps === baseProps && (newProps = assign({}, newProps));\n for (var propName$77 in Component)\n void 0 === newProps[propName$77] &&\n (newProps[propName$77] = Component[propName$77]);\n }\n return newProps;\n}\nfunction defaultOnUncaughtError(error) {\n reportGlobalError(error);\n}\nfunction defaultOnCaughtError(error) {\n console.error(error);\n}\nfunction defaultOnRecoverableError(error) {\n reportGlobalError(error);\n}\nfunction logUncaughtError(root, errorInfo) {\n try {\n var onUncaughtError = root.onUncaughtError;\n onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack });\n } catch (e$78) {\n setTimeout(function () {\n throw e$78;\n });\n }\n}\nfunction logCaughtError(root, boundary, errorInfo) {\n try {\n var onCaughtError = root.onCaughtError;\n onCaughtError(errorInfo.value, {\n componentStack: errorInfo.stack,\n errorBoundary: 1 === boundary.tag ? boundary.stateNode : null\n });\n } catch (e$79) {\n setTimeout(function () {\n throw e$79;\n });\n }\n}\nfunction createRootErrorUpdate(root, errorInfo, lane) {\n lane = createUpdate(lane);\n lane.tag = 3;\n lane.payload = { element: null };\n lane.callback = function () {\n logUncaughtError(root, errorInfo);\n };\n return lane;\n}\nfunction createClassErrorUpdate(lane) {\n lane = createUpdate(lane);\n lane.tag = 3;\n return lane;\n}\nfunction initializeClassErrorUpdate(update, root, fiber, errorInfo) {\n var getDerivedStateFromError = fiber.type.getDerivedStateFromError;\n if (\"function\" === typeof getDerivedStateFromError) {\n var error = errorInfo.value;\n update.payload = function () {\n return getDerivedStateFromError(error);\n };\n update.callback = function () {\n logCaughtError(root, fiber, errorInfo);\n };\n }\n var inst = fiber.stateNode;\n null !== inst &&\n \"function\" === typeof inst.componentDidCatch &&\n (update.callback = function () {\n logCaughtError(root, fiber, errorInfo);\n \"function\" !== typeof getDerivedStateFromError &&\n (null === legacyErrorBoundariesThatAlreadyFailed\n ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this]))\n : legacyErrorBoundariesThatAlreadyFailed.add(this));\n var stack = errorInfo.stack;\n this.componentDidCatch(errorInfo.value, {\n componentStack: null !== stack ? stack : \"\"\n });\n });\n}\nfunction throwException(\n root,\n returnFiber,\n sourceFiber,\n value,\n rootRenderLanes\n) {\n sourceFiber.flags |= 32768;\n if (\n null !== value &&\n \"object\" === typeof value &&\n \"function\" === typeof value.then\n ) {\n returnFiber = sourceFiber.alternate;\n null !== returnFiber &&\n propagateParentContextChanges(\n returnFiber,\n sourceFiber,\n rootRenderLanes,\n !0\n );\n sourceFiber = suspenseHandlerStackCursor.current;\n if (null !== sourceFiber) {\n switch (sourceFiber.tag) {\n case 31:\n case 13:\n case 19:\n return (\n null === shellBoundary\n ? renderDidSuspendDelayIfPossible()\n : null === sourceFiber.alternate &&\n 0 === workInProgressRootExitStatus &&\n (workInProgressRootExitStatus = 3),\n (sourceFiber.flags &= -257),\n (sourceFiber.flags |= 65536),\n (sourceFiber.lanes = rootRenderLanes),\n value === noopSuspenseyCommitThenable\n ? (sourceFiber.flags |= 16384)\n : ((returnFiber = sourceFiber.updateQueue),\n null === returnFiber\n ? (sourceFiber.updateQueue = new Set([value]))\n : returnFiber.add(value),\n attachPingListener(root, value, rootRenderLanes)),\n !1\n );\n case 22:\n return (\n (sourceFiber.flags |= 65536),\n value === noopSuspenseyCommitThenable\n ? (sourceFiber.flags |= 16384)\n : ((returnFiber = sourceFiber.updateQueue),\n null === returnFiber\n ? ((returnFiber = {\n transitions: null,\n markerInstances: null,\n retryQueue: new Set([value])\n }),\n (sourceFiber.updateQueue = returnFiber))\n : ((sourceFiber = returnFiber.retryQueue),\n null === sourceFiber\n ? (returnFiber.retryQueue = new Set([value]))\n : sourceFiber.add(value)),\n attachPingListener(root, value, rootRenderLanes)),\n !1\n );\n }\n throw Error(formatProdErrorMessage(435, sourceFiber.tag));\n }\n attachPingListener(root, value, rootRenderLanes);\n renderDidSuspendDelayIfPossible();\n return !1;\n }\n if (isHydrating)\n return (\n (returnFiber = suspenseHandlerStackCursor.current),\n null !== returnFiber\n ? (0 === (returnFiber.flags & 65536) && (returnFiber.flags |= 256),\n (returnFiber.flags |= 65536),\n (returnFiber.lanes = rootRenderLanes),\n value !== HydrationMismatchException &&\n ((root = Error(formatProdErrorMessage(422), { cause: value })),\n queueHydrationError(createCapturedValueAtFiber(root, sourceFiber))))\n : (value !== HydrationMismatchException &&\n ((returnFiber = Error(formatProdErrorMessage(423), {\n cause: value\n })),\n queueHydrationError(\n createCapturedValueAtFiber(returnFiber, sourceFiber)\n )),\n (root = root.current.alternate),\n (root.flags |= 65536),\n (rootRenderLanes &= -rootRenderLanes),\n (root.lanes |= rootRenderLanes),\n (value = createCapturedValueAtFiber(value, sourceFiber)),\n (rootRenderLanes = createRootErrorUpdate(\n root.stateNode,\n value,\n rootRenderLanes\n )),\n enqueueCapturedUpdate(root, rootRenderLanes),\n 4 !== workInProgressRootExitStatus &&\n (workInProgressRootExitStatus = 2)),\n !1\n );\n var wrapperError = Error(formatProdErrorMessage(520), { cause: value });\n wrapperError = createCapturedValueAtFiber(wrapperError, sourceFiber);\n null === workInProgressRootConcurrentErrors\n ? (workInProgressRootConcurrentErrors = [wrapperError])\n : workInProgressRootConcurrentErrors.push(wrapperError);\n 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2);\n if (null === returnFiber) return !0;\n value = createCapturedValueAtFiber(value, sourceFiber);\n sourceFiber = returnFiber;\n do {\n switch (sourceFiber.tag) {\n case 3:\n return (\n (sourceFiber.flags |= 65536),\n (root = rootRenderLanes & -rootRenderLanes),\n (sourceFiber.lanes |= root),\n (root = createRootErrorUpdate(sourceFiber.stateNode, value, root)),\n enqueueCapturedUpdate(sourceFiber, root),\n !1\n );\n case 1:\n returnFiber = sourceFiber.type;\n wrapperError = sourceFiber.stateNode;\n if (\n 0 === (sourceFiber.flags & 128) &&\n (\"function\" === typeof returnFiber.getDerivedStateFromError ||\n (null !== wrapperError &&\n \"function\" === typeof wrapperError.componentDidCatch &&\n (null === legacyErrorBoundariesThatAlreadyFailed ||\n !legacyErrorBoundariesThatAlreadyFailed.has(wrapperError))))\n )\n return (\n (sourceFiber.flags |= 65536),\n (rootRenderLanes &= -rootRenderLanes),\n (sourceFiber.lanes |= rootRenderLanes),\n (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)),\n initializeClassErrorUpdate(\n rootRenderLanes,\n root,\n sourceFiber,\n value\n ),\n enqueueCapturedUpdate(sourceFiber, rootRenderLanes),\n !1\n );\n break;\n case 22:\n if (null !== sourceFiber.memoizedState)\n return (sourceFiber.flags |= 65536), !1;\n }\n sourceFiber = sourceFiber.return;\n } while (null !== sourceFiber);\n return !1;\n}\nvar SelectiveHydrationException = Error(formatProdErrorMessage(461)),\n didReceiveUpdate = !1;\nfunction reconcileChildren(current, workInProgress, nextChildren, renderLanes) {\n workInProgress.child =\n null === current\n ? mountChildFibers(workInProgress, null, nextChildren, renderLanes)\n : reconcileChildFibers(\n workInProgress,\n current.child,\n nextChildren,\n renderLanes\n );\n}\nfunction updateForwardRef(\n current,\n workInProgress,\n Component,\n nextProps,\n renderLanes\n) {\n Component = Component.render;\n var ref = workInProgress.ref;\n if (\"ref\" in nextProps) {\n var propsWithoutRef = {};\n for (var key in nextProps)\n \"ref\" !== key && (propsWithoutRef[key] = nextProps[key]);\n } else propsWithoutRef = nextProps;\n prepareToReadContext(workInProgress);\n nextProps = renderWithHooks(\n current,\n workInProgress,\n Component,\n propsWithoutRef,\n ref,\n renderLanes\n );\n key = checkDidRenderIdHook();\n if (null !== current && !didReceiveUpdate)\n return (\n bailoutHooks(current, workInProgress, renderLanes),\n bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)\n );\n isHydrating && key && pushMaterializedTreeId(workInProgress);\n workInProgress.flags |= 1;\n reconcileChildren(current, workInProgress, nextProps, renderLanes);\n return workInProgress.child;\n}\nfunction updateMemoComponent(\n current,\n workInProgress,\n Component,\n nextProps,\n renderLanes\n) {\n if (null === current) {\n var type = Component.type;\n if (\n \"function\" === typeof type &&\n !shouldConstruct(type) &&\n void 0 === type.defaultProps &&\n null === Component.compare\n )\n return (\n (workInProgress.tag = 15),\n (workInProgress.type = type),\n updateSimpleMemoComponent(\n current,\n workInProgress,\n type,\n nextProps,\n renderLanes\n )\n );\n current = createFiberFromTypeAndProps(\n Component.type,\n null,\n nextProps,\n workInProgress,\n workInProgress.mode,\n renderLanes\n );\n current.ref = workInProgress.ref;\n current.return = workInProgress;\n return (workInProgress.child = current);\n }\n type = current.child;\n if (!checkScheduledUpdateOrContext(current, renderLanes)) {\n var prevProps = type.memoizedProps;\n Component = Component.compare;\n Component = null !== Component ? Component : shallowEqual;\n if (Component(prevProps, nextProps) && current.ref === workInProgress.ref)\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);\n }\n workInProgress.flags |= 1;\n current = createWorkInProgress(type, nextProps);\n current.ref = workInProgress.ref;\n current.return = workInProgress;\n return (workInProgress.child = current);\n}\nfunction updateSimpleMemoComponent(\n current,\n workInProgress,\n Component,\n nextProps,\n renderLanes\n) {\n if (null !== current) {\n var prevProps = current.memoizedProps;\n if (\n shallowEqual(prevProps, nextProps) &&\n current.ref === workInProgress.ref\n )\n if (\n ((didReceiveUpdate = !1),\n (workInProgress.pendingProps = nextProps = prevProps),\n checkScheduledUpdateOrContext(current, renderLanes))\n )\n 0 !== (current.flags & 131072) && (didReceiveUpdate = !0);\n else\n return (\n (workInProgress.lanes = current.lanes),\n bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)\n );\n }\n return updateFunctionComponent(\n current,\n workInProgress,\n Component,\n nextProps,\n renderLanes\n );\n}\nfunction updateOffscreenComponent(\n current,\n workInProgress,\n renderLanes,\n nextProps\n) {\n var nextChildren = nextProps.children,\n prevState = null !== current ? current.memoizedState : null;\n null === current &&\n null === workInProgress.stateNode &&\n (workInProgress.stateNode = {\n _visibility: 1,\n _pendingMarkers: null,\n _retryCache: null,\n _transitions: null\n });\n if (\"hidden\" === nextProps.mode) {\n if (0 !== (workInProgress.flags & 128)) {\n prevState =\n null !== prevState ? prevState.baseLanes | renderLanes : renderLanes;\n if (null !== current) {\n nextProps = workInProgress.child = current.child;\n for (nextChildren = 0; null !== nextProps; )\n (nextChildren =\n nextChildren | nextProps.lanes | nextProps.childLanes),\n (nextProps = nextProps.sibling);\n nextProps = nextChildren & ~prevState;\n } else (nextProps = 0), (workInProgress.child = null);\n return deferHiddenOffscreenComponent(\n current,\n workInProgress,\n prevState,\n renderLanes,\n nextProps\n );\n }\n if (0 !== (renderLanes & 536870912))\n (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }),\n null !== current &&\n pushTransition(\n workInProgress,\n null !== prevState ? prevState.cachePool : null\n ),\n null !== prevState\n ? pushHiddenContext(workInProgress, prevState)\n : reuseHiddenContextOnStack(),\n pushOffscreenSuspenseHandler(workInProgress);\n else\n return (\n (nextProps = workInProgress.lanes = 536870912),\n deferHiddenOffscreenComponent(\n current,\n workInProgress,\n null !== prevState ? prevState.baseLanes | renderLanes : renderLanes,\n renderLanes,\n nextProps\n )\n );\n } else\n null !== prevState\n ? (pushTransition(workInProgress, prevState.cachePool),\n pushHiddenContext(workInProgress, prevState),\n reuseSuspenseHandlerOnStack(),\n (workInProgress.memoizedState = null))\n : (null !== current && pushTransition(workInProgress, null),\n reuseHiddenContextOnStack(),\n reuseSuspenseHandlerOnStack());\n reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n return workInProgress.child;\n}\nfunction bailoutOffscreenComponent(current, workInProgress) {\n (null !== current && 22 === current.tag) ||\n null !== workInProgress.stateNode ||\n (workInProgress.stateNode = {\n _visibility: 1,\n _pendingMarkers: null,\n _retryCache: null,\n _transitions: null\n });\n return workInProgress.sibling;\n}\nfunction deferHiddenOffscreenComponent(\n current,\n workInProgress,\n nextBaseLanes,\n renderLanes,\n remainingChildLanes\n) {\n var JSCompiler_inline_result = peekCacheFromPool();\n JSCompiler_inline_result =\n null === JSCompiler_inline_result\n ? null\n : { parent: CacheContext._currentValue, pool: JSCompiler_inline_result };\n workInProgress.memoizedState = {\n baseLanes: nextBaseLanes,\n cachePool: JSCompiler_inline_result\n };\n null !== current && pushTransition(workInProgress, null);\n reuseHiddenContextOnStack();\n pushOffscreenSuspenseHandler(workInProgress);\n null !== current &&\n propagateParentContextChanges(current, workInProgress, renderLanes, !0);\n workInProgress.childLanes = remainingChildLanes;\n return null;\n}\nfunction mountActivityChildren(workInProgress, nextProps) {\n nextProps = mountWorkInProgressOffscreenFiber(\n { mode: nextProps.mode, children: nextProps.children },\n workInProgress.mode\n );\n nextProps.ref = workInProgress.ref;\n workInProgress.child = nextProps;\n nextProps.return = workInProgress;\n return nextProps;\n}\nfunction retryActivityComponentWithoutHydrating(\n current,\n workInProgress,\n renderLanes\n) {\n reconcileChildFibers(workInProgress, current.child, null, renderLanes);\n current = mountActivityChildren(workInProgress, workInProgress.pendingProps);\n current.flags |= 2;\n popSuspenseHandler(workInProgress);\n workInProgress.memoizedState = null;\n return current;\n}\nfunction updateActivityComponent(current, workInProgress, renderLanes) {\n var nextProps = workInProgress.pendingProps,\n didSuspend = 0 !== (workInProgress.flags & 128);\n workInProgress.flags &= -129;\n if (null === current) {\n if (isHydrating) {\n if (\"hidden\" === nextProps.mode)\n return (\n (current = mountActivityChildren(workInProgress, nextProps)),\n (workInProgress.lanes = 536870912),\n (current.memoizedState = { baseLanes: 0, cachePool: null }),\n bailoutOffscreenComponent(null, current)\n );\n pushDehydratedActivitySuspenseHandler(workInProgress);\n (current = nextHydratableInstance)\n ? ((current = canHydrateHydrationBoundary(\n current,\n rootOrSingletonContext\n )),\n (current = null !== current && \"&\" === current.data ? current : null),\n null !== current &&\n ((workInProgress.memoizedState = {\n dehydrated: current,\n treeContext:\n null !== treeContextProvider\n ? { id: treeContextId, overflow: treeContextOverflow }\n : null,\n retryLane: 536870912,\n hydrationErrors: null\n }),\n (renderLanes = createFiberFromDehydratedFragment(current)),\n (renderLanes.return = workInProgress),\n (workInProgress.child = renderLanes),\n (hydrationParentFiber = workInProgress),\n (nextHydratableInstance = null)))\n : (current = null);\n if (null === current) throw throwOnHydrationMismatch(workInProgress);\n workInProgress.lanes = 536870912;\n return null;\n }\n return mountActivityChildren(workInProgress, nextProps);\n }\n var prevState = current.memoizedState;\n if (null !== prevState) {\n var dehydrated = prevState.dehydrated;\n pushDehydratedActivitySuspenseHandler(workInProgress);\n if (didSuspend)\n if (workInProgress.flags & 256)\n (workInProgress.flags &= -257),\n (workInProgress = retryActivityComponentWithoutHydrating(\n current,\n workInProgress,\n renderLanes\n ));\n else if (null !== workInProgress.memoizedState)\n (workInProgress.child = current.child),\n (workInProgress.flags |= 128),\n (workInProgress = null);\n else throw Error(formatProdErrorMessage(558));\n else if (\n (didReceiveUpdate ||\n propagateParentContextChanges(current, workInProgress, renderLanes, !1),\n (didSuspend = 0 !== (renderLanes & current.childLanes)),\n didReceiveUpdate || didSuspend)\n ) {\n if (null === currentTreeHiddenStackCursor.current) {\n nextProps = workInProgressRoot;\n if (\n null !== nextProps &&\n ((dehydrated = getBumpedLaneForHydration(nextProps, renderLanes)),\n 0 !== dehydrated && dehydrated !== prevState.retryLane)\n )\n throw (\n ((prevState.retryLane = dehydrated),\n enqueueConcurrentRenderForLane(current, dehydrated),\n scheduleUpdateOnFiber(nextProps, current, dehydrated),\n SelectiveHydrationException)\n );\n renderDidSuspendDelayIfPossible();\n }\n workInProgress = retryActivityComponentWithoutHydrating(\n current,\n workInProgress,\n renderLanes\n );\n } else\n (current = prevState.treeContext),\n (nextHydratableInstance = getNextHydratable(dehydrated.nextSibling)),\n (hydrationParentFiber = workInProgress),\n (isHydrating = !0),\n (hydrationErrors = null),\n (rootOrSingletonContext = !1),\n null !== current &&\n restoreSuspendedTreeContext(workInProgress, current),\n (workInProgress = mountActivityChildren(workInProgress, nextProps)),\n (workInProgress.flags |= 134221824);\n return workInProgress;\n }\n current = createWorkInProgress(current.child, {\n mode: nextProps.mode,\n children: nextProps.children\n });\n current.ref = workInProgress.ref;\n workInProgress.child = current;\n current.return = workInProgress;\n return current;\n}\nfunction markRef(current, workInProgress) {\n var ref = workInProgress.ref;\n if (null === ref)\n null !== current &&\n null !== current.ref &&\n (workInProgress.flags |= 4194816);\n else {\n if (\"function\" !== typeof ref && \"object\" !== typeof ref)\n throw Error(formatProdErrorMessage(284));\n if (null === current || current.ref !== ref)\n workInProgress.flags |= 4194816;\n }\n}\nfunction updateFunctionComponent(\n current,\n workInProgress,\n Component,\n nextProps,\n renderLanes\n) {\n prepareToReadContext(workInProgress);\n Component = renderWithHooks(\n current,\n workInProgress,\n Component,\n nextProps,\n void 0,\n renderLanes\n );\n nextProps = checkDidRenderIdHook();\n if (null !== current && !didReceiveUpdate)\n return (\n bailoutHooks(current, workInProgress, renderLanes),\n bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)\n );\n isHydrating && nextProps && pushMaterializedTreeId(workInProgress);\n workInProgress.flags |= 1;\n reconcileChildren(current, workInProgress, Component, renderLanes);\n return workInProgress.child;\n}\nfunction replayFunctionComponent(\n current,\n workInProgress,\n nextProps,\n Component,\n secondArg,\n renderLanes\n) {\n prepareToReadContext(workInProgress);\n workInProgress.updateQueue = null;\n nextProps = renderWithHooksAgain(\n workInProgress,\n Component,\n nextProps,\n secondArg\n );\n finishRenderingHooks(current);\n Component = checkDidRenderIdHook();\n if (null !== current && !didReceiveUpdate)\n return (\n bailoutHooks(current, workInProgress, renderLanes),\n bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)\n );\n isHydrating && Component && pushMaterializedTreeId(workInProgress);\n workInProgress.flags |= 1;\n reconcileChildren(current, workInProgress, nextProps, renderLanes);\n return workInProgress.child;\n}\nfunction updateClassComponent(\n current,\n workInProgress,\n Component,\n nextProps,\n renderLanes\n) {\n prepareToReadContext(workInProgress);\n if (null === workInProgress.stateNode) {\n var context = emptyContextObject,\n contextType = Component.contextType;\n \"object\" === typeof contextType &&\n null !== contextType &&\n (context = readContext(contextType));\n context = new Component(nextProps, context);\n workInProgress.memoizedState =\n null !== context.state && void 0 !== context.state ? context.state : null;\n context.updater = classComponentUpdater;\n workInProgress.stateNode = context;\n context._reactInternals = workInProgress;\n context = workInProgress.stateNode;\n context.props = nextProps;\n context.state = workInProgress.memoizedState;\n context.refs = {};\n initializeUpdateQueue(workInProgress);\n contextType = Component.contextType;\n context.context =\n \"object\" === typeof contextType && null !== contextType\n ? readContext(contextType)\n : emptyContextObject;\n context.state = workInProgress.memoizedState;\n contextType = Component.getDerivedStateFromProps;\n \"function\" === typeof contextType &&\n (applyDerivedStateFromProps(\n workInProgress,\n Component,\n contextType,\n nextProps\n ),\n (context.state = workInProgress.memoizedState));\n \"function\" === typeof Component.getDerivedStateFromProps ||\n \"function\" === typeof context.getSnapshotBeforeUpdate ||\n (\"function\" !== typeof context.UNSAFE_componentWillMount &&\n \"function\" !== typeof context.componentWillMount) ||\n ((contextType = context.state),\n \"function\" === typeof context.componentWillMount &&\n context.componentWillMount(),\n \"function\" === typeof context.UNSAFE_componentWillMount &&\n context.UNSAFE_componentWillMount(),\n contextType !== context.state &&\n classComponentUpdater.enqueueReplaceState(context, context.state, null),\n processUpdateQueue(workInProgress, nextProps, context, renderLanes),\n suspendIfUpdateReadFromEntangledAsyncAction(),\n (context.state = workInProgress.memoizedState));\n \"function\" === typeof context.componentDidMount &&\n (workInProgress.flags |= 4194308);\n nextProps = !0;\n } else if (null === current) {\n context = workInProgress.stateNode;\n var unresolvedOldProps = workInProgress.memoizedProps,\n oldProps = resolveClassComponentProps(Component, unresolvedOldProps);\n context.props = oldProps;\n var oldContext = context.context,\n contextType$jscomp$0 = Component.contextType;\n contextType = emptyContextObject;\n \"object\" === typeof contextType$jscomp$0 &&\n null !== contextType$jscomp$0 &&\n (contextType = readContext(contextType$jscomp$0));\n var getDerivedStateFromProps = Component.getDerivedStateFromProps;\n contextType$jscomp$0 =\n \"function\" === typeof getDerivedStateFromProps ||\n \"function\" === typeof context.getSnapshotBeforeUpdate;\n unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps;\n contextType$jscomp$0 ||\n (\"function\" !== typeof context.UNSAFE_componentWillReceiveProps &&\n \"function\" !== typeof context.componentWillReceiveProps) ||\n ((unresolvedOldProps || oldContext !== contextType) &&\n callComponentWillReceiveProps(\n workInProgress,\n context,\n nextProps,\n contextType\n ));\n hasForceUpdate = !1;\n var oldState = workInProgress.memoizedState;\n context.state = oldState;\n processUpdateQueue(workInProgress, nextProps, context, renderLanes);\n suspendIfUpdateReadFromEntangledAsyncAction();\n oldContext = workInProgress.memoizedState;\n unresolvedOldProps || oldState !== oldContext || hasForceUpdate\n ? (\"function\" === typeof getDerivedStateFromProps &&\n (applyDerivedStateFromProps(\n workInProgress,\n Component,\n getDerivedStateFromProps,\n nextProps\n ),\n (oldContext = workInProgress.memoizedState)),\n (oldProps =\n hasForceUpdate ||\n checkShouldComponentUpdate(\n workInProgress,\n Component,\n oldProps,\n nextProps,\n oldState,\n oldContext,\n contextType\n ))\n ? (contextType$jscomp$0 ||\n (\"function\" !== typeof context.UNSAFE_componentWillMount &&\n \"function\" !== typeof context.componentWillMount) ||\n (\"function\" === typeof context.componentWillMount &&\n context.componentWillMount(),\n \"function\" === typeof context.UNSAFE_componentWillMount &&\n context.UNSAFE_componentWillMount()),\n \"function\" === typeof context.componentDidMount &&\n (workInProgress.flags |= 4194308))\n : (\"function\" === typeof context.componentDidMount &&\n (workInProgress.flags |= 4194308),\n (workInProgress.memoizedProps = nextProps),\n (workInProgress.memoizedState = oldContext)),\n (context.props = nextProps),\n (context.state = oldContext),\n (context.context = contextType),\n (nextProps = oldProps))\n : (\"function\" === typeof context.componentDidMount &&\n (workInProgress.flags |= 4194308),\n (nextProps = !1));\n } else {\n context = workInProgress.stateNode;\n cloneUpdateQueue(current, workInProgress);\n contextType = workInProgress.memoizedProps;\n contextType$jscomp$0 = resolveClassComponentProps(Component, contextType);\n context.props = contextType$jscomp$0;\n getDerivedStateFromProps = workInProgress.pendingProps;\n oldState = context.context;\n oldContext = Component.contextType;\n oldProps = emptyContextObject;\n \"object\" === typeof oldContext &&\n null !== oldContext &&\n (oldProps = readContext(oldContext));\n unresolvedOldProps = Component.getDerivedStateFromProps;\n (oldContext =\n \"function\" === typeof unresolvedOldProps ||\n \"function\" === typeof context.getSnapshotBeforeUpdate) ||\n (\"function\" !== typeof context.UNSAFE_componentWillReceiveProps &&\n \"function\" !== typeof context.componentWillReceiveProps) ||\n ((contextType !== getDerivedStateFromProps || oldState !== oldProps) &&\n callComponentWillReceiveProps(\n workInProgress,\n context,\n nextProps,\n oldProps\n ));\n hasForceUpdate = !1;\n oldState = workInProgress.memoizedState;\n context.state = oldState;\n processUpdateQueue(workInProgress, nextProps, context, renderLanes);\n suspendIfUpdateReadFromEntangledAsyncAction();\n var newState = workInProgress.memoizedState;\n contextType !== getDerivedStateFromProps ||\n oldState !== newState ||\n hasForceUpdate ||\n (null !== current &&\n null !== current.dependencies &&\n checkIfContextChanged(current.dependencies))\n ? (\"function\" === typeof unresolvedOldProps &&\n (applyDerivedStateFromProps(\n workInProgress,\n Component,\n unresolvedOldProps,\n nextProps\n ),\n (newState = workInProgress.memoizedState)),\n (contextType$jscomp$0 =\n hasForceUpdate ||\n checkShouldComponentUpdate(\n workInProgress,\n Component,\n contextType$jscomp$0,\n nextProps,\n oldState,\n newState,\n oldProps\n ) ||\n (null !== current &&\n null !== current.dependencies &&\n checkIfContextChanged(current.dependencies)))\n ? (oldContext ||\n (\"function\" !== typeof context.UNSAFE_componentWillUpdate &&\n \"function\" !== typeof context.componentWillUpdate) ||\n (\"function\" === typeof context.componentWillUpdate &&\n context.componentWillUpdate(nextProps, newState, oldProps),\n \"function\" === typeof context.UNSAFE_componentWillUpdate &&\n context.UNSAFE_componentWillUpdate(\n nextProps,\n newState,\n oldProps\n )),\n \"function\" === typeof context.componentDidUpdate &&\n (workInProgress.flags |= 4),\n \"function\" === typeof context.getSnapshotBeforeUpdate &&\n (workInProgress.flags |= 1024))\n : (\"function\" !== typeof context.componentDidUpdate ||\n (contextType === current.memoizedProps &&\n oldState === current.memoizedState) ||\n (workInProgress.flags |= 4),\n \"function\" !== typeof context.getSnapshotBeforeUpdate ||\n (contextType === current.memoizedProps &&\n oldState === current.memoizedState) ||\n (workInProgress.flags |= 1024),\n (workInProgress.memoizedProps = nextProps),\n (workInProgress.memoizedState = newState)),\n (context.props = nextProps),\n (context.state = newState),\n (context.context = oldProps),\n (nextProps = contextType$jscomp$0))\n : (\"function\" !== typeof context.componentDidUpdate ||\n (contextType === current.memoizedProps &&\n oldState === current.memoizedState) ||\n (workInProgress.flags |= 4),\n \"function\" !== typeof context.getSnapshotBeforeUpdate ||\n (contextType === current.memoizedProps &&\n oldState === current.memoizedState) ||\n (workInProgress.flags |= 1024),\n (nextProps = !1));\n }\n context = nextProps;\n markRef(current, workInProgress);\n nextProps = 0 !== (workInProgress.flags & 128);\n context || nextProps\n ? ((context = workInProgress.stateNode),\n (Component =\n nextProps && \"function\" !== typeof Component.getDerivedStateFromError\n ? null\n : context.render()),\n (workInProgress.flags |= 1),\n null !== current && nextProps\n ? ((workInProgress.child = reconcileChildFibers(\n workInProgress,\n current.child,\n null,\n renderLanes\n )),\n (workInProgress.child = reconcileChildFibers(\n workInProgress,\n null,\n Component,\n renderLanes\n )))\n : reconcileChildren(current, workInProgress, Component, renderLanes),\n (workInProgress.memoizedState = context.state),\n (current = workInProgress.child))\n : (current = bailoutOnAlreadyFinishedWork(\n current,\n workInProgress,\n renderLanes\n ));\n return current;\n}\nfunction mountHostRootWithoutHydrating(\n current,\n workInProgress,\n nextChildren,\n renderLanes\n) {\n resetHydrationState();\n workInProgress.flags |= 256;\n reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n return workInProgress.child;\n}\nvar SUSPENDED_MARKER = {\n dehydrated: null,\n treeContext: null,\n retryLane: 0,\n hydrationErrors: null\n};\nfunction mountSuspenseOffscreenState(renderLanes) {\n return { baseLanes: renderLanes, cachePool: getSuspendedCache() };\n}\nfunction getRemainingWorkInPrimaryTree(\n current,\n primaryTreeDidDefer,\n renderLanes\n) {\n current = null !== current ? current.childLanes & ~renderLanes : 0;\n primaryTreeDidDefer && (current |= workInProgressDeferredLane);\n return current;\n}\nfunction updateSuspenseComponent(current, workInProgress, renderLanes) {\n var nextProps = workInProgress.pendingProps,\n showFallback = !1,\n didSuspend = 0 !== (workInProgress.flags & 128),\n JSCompiler_temp;\n (JSCompiler_temp = didSuspend) ||\n (JSCompiler_temp =\n null !== current && null === current.memoizedState\n ? !1\n : 0 !== (suspenseStackCursor.current & 2));\n JSCompiler_temp && ((showFallback = !0), (workInProgress.flags &= -129));\n JSCompiler_temp = 0 !== (workInProgress.flags & 32);\n workInProgress.flags &= -33;\n if (null === current) {\n if (isHydrating) {\n showFallback\n ? pushPrimaryTreeSuspenseHandler(workInProgress)\n : reuseSuspenseHandlerOnStack();\n (current = nextHydratableInstance)\n ? ((current = canHydrateHydrationBoundary(\n current,\n rootOrSingletonContext\n )),\n (current = null !== current && \"&\" !== current.data ? current : null),\n null !== current &&\n ((workInProgress.memoizedState = {\n dehydrated: current,\n treeContext:\n null !== treeContextProvider\n ? { id: treeContextId, overflow: treeContextOverflow }\n : null,\n retryLane: 536870912,\n hydrationErrors: null\n }),\n (renderLanes = createFiberFromDehydratedFragment(current)),\n (renderLanes.return = workInProgress),\n (workInProgress.child = renderLanes),\n (hydrationParentFiber = workInProgress),\n (nextHydratableInstance = null)))\n : (current = null);\n if (null === current) throw throwOnHydrationMismatch(workInProgress);\n isSuspenseInstanceFallback(current)\n ? (workInProgress.lanes = 32)\n : (workInProgress.lanes = 536870912);\n return null;\n }\n didSuspend = nextProps.children;\n nextProps = nextProps.fallback;\n if (showFallback)\n return (\n reuseSuspenseHandlerOnStack(),\n (showFallback = workInProgress.mode),\n (didSuspend = mountWorkInProgressOffscreenFiber(\n { mode: \"hidden\", children: didSuspend },\n showFallback\n )),\n (nextProps = createFiberFromFragment(\n nextProps,\n showFallback,\n renderLanes,\n null\n )),\n (didSuspend.return = workInProgress),\n (nextProps.return = workInProgress),\n (didSuspend.sibling = nextProps),\n (workInProgress.child = didSuspend),\n (nextProps = workInProgress.child),\n (nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes)),\n (nextProps.childLanes = getRemainingWorkInPrimaryTree(\n current,\n JSCompiler_temp,\n renderLanes\n )),\n (workInProgress.memoizedState = SUSPENDED_MARKER),\n bailoutOffscreenComponent(null, nextProps)\n );\n pushPrimaryTreeSuspenseHandler(workInProgress);\n return mountSuspensePrimaryChildren(workInProgress, didSuspend);\n }\n var prevState = current.memoizedState;\n if (null !== prevState) {\n var dehydrated$96 = prevState.dehydrated;\n if (null !== dehydrated$96)\n return updateDehydratedSuspenseComponent(\n current,\n workInProgress,\n didSuspend,\n JSCompiler_temp,\n nextProps,\n dehydrated$96,\n prevState,\n renderLanes\n );\n }\n if (showFallback)\n return (\n reuseSuspenseHandlerOnStack(),\n (showFallback = nextProps.fallback),\n (didSuspend = workInProgress.mode),\n (prevState = current.child),\n (dehydrated$96 = prevState.sibling),\n (nextProps = createWorkInProgress(prevState, {\n mode: \"hidden\",\n children: nextProps.children\n })),\n (nextProps.subtreeFlags = prevState.subtreeFlags & 1206910976),\n null !== dehydrated$96\n ? (showFallback = createWorkInProgress(dehydrated$96, showFallback))\n : ((showFallback = createFiberFromFragment(\n showFallback,\n didSuspend,\n renderLanes,\n null\n )),\n (showFallback.flags |= 2)),\n (showFallback.return = workInProgress),\n (nextProps.return = workInProgress),\n (nextProps.sibling = showFallback),\n (workInProgress.child = nextProps),\n bailoutOffscreenComponent(null, nextProps),\n (nextProps = workInProgress.child),\n (showFallback = current.child.memoizedState),\n null === showFallback\n ? (showFallback = mountSuspenseOffscreenState(renderLanes))\n : ((didSuspend = showFallback.cachePool),\n null !== didSuspend\n ? ((prevState = CacheContext._currentValue),\n (didSuspend =\n didSuspend.parent !== prevState\n ? { parent: prevState, pool: prevState }\n : didSuspend))\n : (didSuspend = getSuspendedCache()),\n (showFallback = {\n baseLanes: showFallback.baseLanes | renderLanes,\n cachePool: didSuspend\n })),\n (nextProps.memoizedState = showFallback),\n (nextProps.childLanes = getRemainingWorkInPrimaryTree(\n current,\n JSCompiler_temp,\n renderLanes\n )),\n (workInProgress.memoizedState = SUSPENDED_MARKER),\n bailoutOffscreenComponent(current.child, nextProps)\n );\n pushPrimaryTreeSuspenseHandler(workInProgress);\n renderLanes = current.child;\n current = renderLanes.sibling;\n renderLanes = createWorkInProgress(renderLanes, {\n mode: \"visible\",\n children: nextProps.children\n });\n renderLanes.return = workInProgress;\n renderLanes.sibling = null;\n null !== current &&\n ((JSCompiler_temp = workInProgress.deletions),\n null === JSCompiler_temp\n ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16))\n : JSCompiler_temp.push(current));\n workInProgress.child = renderLanes;\n workInProgress.memoizedState = null;\n return renderLanes;\n}\nfunction mountSuspensePrimaryChildren(workInProgress, primaryChildren) {\n primaryChildren = mountWorkInProgressOffscreenFiber(\n { mode: \"visible\", children: primaryChildren },\n workInProgress.mode\n );\n primaryChildren.return = workInProgress;\n return (workInProgress.child = primaryChildren);\n}\nfunction mountWorkInProgressOffscreenFiber(offscreenProps, mode) {\n offscreenProps = createFiberImplClass(22, offscreenProps, null, mode);\n offscreenProps.lanes = 0;\n return offscreenProps;\n}\nfunction retrySuspenseComponentWithoutHydrating(\n current,\n workInProgress,\n renderLanes\n) {\n reconcileChildFibers(workInProgress, current.child, null, renderLanes);\n current = mountSuspensePrimaryChildren(\n workInProgress,\n workInProgress.pendingProps.children\n );\n current.flags |= 2;\n workInProgress.memoizedState = null;\n return current;\n}\nfunction updateDehydratedSuspenseComponent(\n current,\n workInProgress,\n didSuspend,\n didPrimaryChildrenDefer,\n nextProps,\n suspenseInstance,\n suspenseState,\n renderLanes\n) {\n if (didSuspend) {\n if (workInProgress.flags & 256)\n return (\n pushPrimaryTreeSuspenseHandler(workInProgress),\n (workInProgress.flags &= -257),\n retrySuspenseComponentWithoutHydrating(\n current,\n workInProgress,\n renderLanes\n )\n );\n if (null !== workInProgress.memoizedState)\n return (\n reuseSuspenseHandlerOnStack(),\n (workInProgress.child = current.child),\n (workInProgress.flags |= 128),\n null\n );\n reuseSuspenseHandlerOnStack();\n suspenseInstance = nextProps.fallback;\n suspenseState = workInProgress.mode;\n nextProps = mountWorkInProgressOffscreenFiber(\n { mode: \"visible\", children: nextProps.children },\n suspenseState\n );\n suspenseInstance = createFiberFromFragment(\n suspenseInstance,\n suspenseState,\n renderLanes,\n null\n );\n suspenseInstance.flags |= 2;\n nextProps.return = workInProgress;\n suspenseInstance.return = workInProgress;\n nextProps.sibling = suspenseInstance;\n workInProgress.child = nextProps;\n reconcileChildFibers(workInProgress, current.child, null, renderLanes);\n nextProps = workInProgress.child;\n nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes);\n nextProps.childLanes = getRemainingWorkInPrimaryTree(\n current,\n didPrimaryChildrenDefer,\n renderLanes\n );\n workInProgress.memoizedState = SUSPENDED_MARKER;\n return bailoutOffscreenComponent(null, nextProps);\n }\n pushPrimaryTreeSuspenseHandler(workInProgress);\n if (isSuspenseInstanceFallback(suspenseInstance)) {\n didPrimaryChildrenDefer =\n suspenseInstance.nextSibling && suspenseInstance.nextSibling.dataset;\n if (didPrimaryChildrenDefer) var digest = didPrimaryChildrenDefer.dgst;\n didPrimaryChildrenDefer = digest;\n \"\" !== didPrimaryChildrenDefer &&\n ((nextProps = Error(formatProdErrorMessage(419))),\n (nextProps.stack = \"\"),\n (nextProps.digest = didPrimaryChildrenDefer),\n queueHydrationError({ value: nextProps, source: null, stack: null }));\n return retrySuspenseComponentWithoutHydrating(\n current,\n workInProgress,\n renderLanes\n );\n }\n didReceiveUpdate ||\n propagateParentContextChanges(current, workInProgress, renderLanes, !1);\n didPrimaryChildrenDefer = 0 !== (renderLanes & current.childLanes);\n if (didReceiveUpdate || didPrimaryChildrenDefer) {\n if (null !== currentTreeHiddenStackCursor.current)\n return retrySuspenseComponentWithoutHydrating(\n current,\n workInProgress,\n renderLanes\n );\n didPrimaryChildrenDefer = workInProgressRoot;\n if (\n null !== didPrimaryChildrenDefer &&\n ((nextProps = getBumpedLaneForHydration(\n didPrimaryChildrenDefer,\n renderLanes\n )),\n 0 !== nextProps && nextProps !== suspenseState.retryLane)\n )\n throw (\n ((suspenseState.retryLane = nextProps),\n enqueueConcurrentRenderForLane(current, nextProps),\n scheduleUpdateOnFiber(didPrimaryChildrenDefer, current, nextProps),\n SelectiveHydrationException)\n );\n isSuspenseInstancePending(suspenseInstance) ||\n renderDidSuspendDelayIfPossible();\n return retrySuspenseComponentWithoutHydrating(\n current,\n workInProgress,\n renderLanes\n );\n }\n if (isSuspenseInstancePending(suspenseInstance))\n return (\n (workInProgress.flags |= 192),\n (workInProgress.child = current.child),\n null\n );\n current = suspenseState.treeContext;\n nextHydratableInstance = getNextHydratable(suspenseInstance.nextSibling);\n hydrationParentFiber = workInProgress;\n isHydrating = !0;\n hydrationErrors = null;\n rootOrSingletonContext = !1;\n null !== current && restoreSuspendedTreeContext(workInProgress, current);\n workInProgress = mountSuspensePrimaryChildren(\n workInProgress,\n nextProps.children\n );\n workInProgress.flags |= 134221824;\n return workInProgress;\n}\nfunction scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) {\n fiber.lanes |= renderLanes;\n var alternate = fiber.alternate;\n null !== alternate && (alternate.lanes |= renderLanes);\n scheduleContextWorkOnParentPath(fiber.return, renderLanes, propagationRoot);\n}\nfunction findLastContentRow(firstChild) {\n for (var lastContentRow = null; null !== firstChild; ) {\n var currentRow = firstChild.alternate;\n null !== currentRow &&\n null === findFirstSuspended(currentRow) &&\n (lastContentRow = firstChild);\n firstChild = firstChild.sibling;\n }\n return lastContentRow;\n}\nfunction initSuspenseListRenderState(\n workInProgress,\n isBackwards,\n tail,\n lastContentRow,\n tailMode,\n treeForkCount\n) {\n var renderState = workInProgress.memoizedState;\n null === renderState\n ? (workInProgress.memoizedState = {\n isBackwards: isBackwards,\n rendering: null,\n renderingStartTime: 0,\n last: lastContentRow,\n tail: tail,\n tailMode: tailMode,\n treeForkCount: treeForkCount\n })\n : ((renderState.isBackwards = isBackwards),\n (renderState.rendering = null),\n (renderState.renderingStartTime = 0),\n (renderState.last = lastContentRow),\n (renderState.tail = tail),\n (renderState.tailMode = tailMode),\n (renderState.treeForkCount = treeForkCount));\n}\nfunction reverseChildren(fiber) {\n var row = fiber.child;\n for (fiber.child = null; null !== row; ) {\n var nextRow = row.sibling;\n row.sibling = fiber.child;\n fiber.child = row;\n row = nextRow;\n }\n}\nfunction updateSuspenseListComponent(current, workInProgress, renderLanes) {\n var nextProps = workInProgress.pendingProps,\n revealOrder = nextProps.revealOrder,\n tailMode = nextProps.tail;\n nextProps = nextProps.children;\n var suspenseContext = suspenseStackCursor.current;\n if (workInProgress.flags & 128)\n return pushSuspenseListContext(workInProgress, suspenseContext), null;\n var shouldForceFallback = 0 !== (suspenseContext & 2);\n shouldForceFallback\n ? ((suspenseContext = (suspenseContext & 1) | 2),\n (workInProgress.flags |= 128))\n : (suspenseContext &= 1);\n pushSuspenseListContext(workInProgress, suspenseContext);\n \"backwards\" === revealOrder && null !== current\n ? (reverseChildren(current),\n reconcileChildren(current, workInProgress, nextProps, renderLanes),\n reverseChildren(current))\n : reconcileChildren(current, workInProgress, nextProps, renderLanes);\n nextProps = isHydrating ? treeForkCount : 0;\n if (!shouldForceFallback && null !== current && 0 !== (current.flags & 128))\n a: for (current = workInProgress.child; null !== current; ) {\n if (13 === current.tag)\n null !== current.memoizedState &&\n scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress);\n else if (19 === current.tag)\n scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress);\n else if (null !== current.child) {\n current.child.return = current;\n current = current.child;\n continue;\n }\n if (current === workInProgress) break a;\n for (; null === current.sibling; ) {\n if (null === current.return || current.return === workInProgress)\n break a;\n current = current.return;\n }\n current.sibling.return = current.return;\n current = current.sibling;\n }\n switch (revealOrder) {\n case \"backwards\":\n renderLanes = findLastContentRow(workInProgress.child);\n null === renderLanes\n ? ((revealOrder = workInProgress.child), (workInProgress.child = null))\n : ((revealOrder = renderLanes.sibling),\n (renderLanes.sibling = null),\n reverseChildren(workInProgress));\n initSuspenseListRenderState(\n workInProgress,\n !0,\n revealOrder,\n null,\n tailMode,\n nextProps\n );\n break;\n case \"unstable_legacy-backwards\":\n renderLanes = null;\n revealOrder = workInProgress.child;\n for (workInProgress.child = null; null !== revealOrder; ) {\n current = revealOrder.alternate;\n if (null !== current && null === findFirstSuspended(current)) {\n workInProgress.child = revealOrder;\n break;\n }\n current = revealOrder.sibling;\n revealOrder.sibling = renderLanes;\n renderLanes = revealOrder;\n revealOrder = current;\n }\n initSuspenseListRenderState(\n workInProgress,\n !0,\n renderLanes,\n null,\n tailMode,\n nextProps\n );\n break;\n case \"together\":\n initSuspenseListRenderState(\n workInProgress,\n !1,\n null,\n null,\n void 0,\n nextProps\n );\n break;\n case \"independent\":\n workInProgress.memoizedState = null;\n break;\n default:\n (renderLanes = findLastContentRow(workInProgress.child)),\n null === renderLanes\n ? ((revealOrder = workInProgress.child),\n (workInProgress.child = null))\n : ((revealOrder = renderLanes.sibling), (renderLanes.sibling = null)),\n initSuspenseListRenderState(\n workInProgress,\n !1,\n revealOrder,\n renderLanes,\n tailMode,\n nextProps\n );\n }\n return workInProgress.child;\n}\nfunction updateContextProvider(current, workInProgress, renderLanes) {\n var newProps = workInProgress.pendingProps;\n pushProvider(workInProgress, workInProgress.type, newProps.value);\n reconcileChildren(current, workInProgress, newProps.children, renderLanes);\n return workInProgress.child;\n}\nfunction bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) {\n null !== current && (workInProgress.dependencies = current.dependencies);\n workInProgressRootSkippedLanes |= workInProgress.lanes;\n if (0 === (renderLanes & workInProgress.childLanes))\n if (null !== current) {\n if (\n (propagateParentContextChanges(\n current,\n workInProgress,\n renderLanes,\n !1\n ),\n 0 === (renderLanes & workInProgress.childLanes))\n )\n return null;\n } else return null;\n if (null !== current && workInProgress.child !== current.child)\n throw Error(formatProdErrorMessage(153));\n if (null !== workInProgress.child) {\n current = workInProgress.child;\n renderLanes = createWorkInProgress(current, current.pendingProps);\n workInProgress.child = renderLanes;\n for (renderLanes.return = workInProgress; null !== current.sibling; )\n (current = current.sibling),\n (renderLanes = renderLanes.sibling =\n createWorkInProgress(current, current.pendingProps)),\n (renderLanes.return = workInProgress);\n renderLanes.sibling = null;\n }\n return workInProgress.child;\n}\nfunction checkScheduledUpdateOrContext(current, renderLanes) {\n if (0 !== (current.lanes & renderLanes)) return !0;\n current = current.dependencies;\n return null !== current && checkIfContextChanged(current) ? !0 : !1;\n}\nfunction attemptEarlyBailoutIfNoScheduledUpdate(\n current,\n workInProgress,\n renderLanes\n) {\n switch (workInProgress.tag) {\n case 3:\n pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);\n pushProvider(workInProgress, CacheContext, current.memoizedState.cache);\n resetHydrationState();\n break;\n case 27:\n case 5:\n pushHostContext(workInProgress);\n break;\n case 4:\n pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);\n break;\n case 10:\n pushProvider(\n workInProgress,\n workInProgress.type,\n workInProgress.memoizedProps.value\n );\n break;\n case 31:\n if (null !== workInProgress.memoizedState)\n return (\n (workInProgress.flags |= 128),\n pushDehydratedActivitySuspenseHandler(workInProgress),\n null\n );\n break;\n case 13:\n var state$108 = workInProgress.memoizedState;\n if (null !== state$108) {\n if (null !== state$108.dehydrated)\n return (\n pushPrimaryTreeSuspenseHandler(workInProgress),\n (workInProgress.flags |= 128),\n null\n );\n state$108 = propagateParentContextChanges(\n current,\n workInProgress,\n renderLanes,\n !1\n );\n var primaryChildLanes = workInProgress.child.childLanes;\n if (state$108 || 0 !== (renderLanes & primaryChildLanes))\n return updateSuspenseComponent(current, workInProgress, renderLanes);\n pushPrimaryTreeSuspenseHandler(workInProgress);\n current = bailoutOnAlreadyFinishedWork(\n current,\n workInProgress,\n renderLanes\n );\n return null !== current ? current.sibling : null;\n }\n pushPrimaryTreeSuspenseHandler(workInProgress);\n break;\n case 19:\n if (workInProgress.flags & 128)\n return updateSuspenseListComponent(\n current,\n workInProgress,\n renderLanes\n );\n primaryChildLanes = 0 !== (current.flags & 128);\n state$108 = 0 !== (renderLanes & workInProgress.childLanes);\n state$108 ||\n (propagateParentContextChanges(\n current,\n workInProgress,\n renderLanes,\n !1\n ),\n (state$108 = 0 !== (renderLanes & workInProgress.childLanes)));\n if (primaryChildLanes) {\n if (state$108)\n return updateSuspenseListComponent(\n current,\n workInProgress,\n renderLanes\n );\n workInProgress.flags |= 128;\n }\n primaryChildLanes = workInProgress.memoizedState;\n null !== primaryChildLanes &&\n ((primaryChildLanes.rendering = null),\n (primaryChildLanes.tail = null),\n (primaryChildLanes.lastEffect = null));\n pushSuspenseListContext(workInProgress, suspenseStackCursor.current);\n if (state$108) break;\n else return null;\n case 22:\n return (\n (workInProgress.lanes = 0),\n updateOffscreenComponent(\n current,\n workInProgress,\n renderLanes,\n workInProgress.pendingProps\n )\n );\n case 24:\n pushProvider(workInProgress, CacheContext, current.memoizedState.cache);\n }\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);\n}\nfunction beginWork(current, workInProgress, renderLanes) {\n if (null !== current)\n if (current.memoizedProps !== workInProgress.pendingProps)\n didReceiveUpdate = !0;\n else {\n if (\n !checkScheduledUpdateOrContext(current, renderLanes) &&\n 0 === (workInProgress.flags & 128)\n )\n return (\n (didReceiveUpdate = !1),\n attemptEarlyBailoutIfNoScheduledUpdate(\n current,\n workInProgress,\n renderLanes\n )\n );\n didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1;\n }\n else\n (didReceiveUpdate = !1),\n isHydrating &&\n 0 !== (workInProgress.flags & 1048576) &&\n pushTreeId(workInProgress, treeForkCount, workInProgress.index);\n workInProgress.lanes = 0;\n switch (workInProgress.tag) {\n case 16:\n a: {\n var props = workInProgress.pendingProps;\n current = resolveLazy(workInProgress.elementType);\n workInProgress.type = current;\n if (\"function\" === typeof current)\n shouldConstruct(current)\n ? ((props = resolveClassComponentProps(current, props)),\n (workInProgress.tag = 1),\n (workInProgress = updateClassComponent(\n null,\n workInProgress,\n current,\n props,\n renderLanes\n )))\n : ((workInProgress.tag = 0),\n (workInProgress = updateFunctionComponent(\n null,\n workInProgress,\n current,\n props,\n renderLanes\n )));\n else {\n if (void 0 !== current && null !== current) {\n var $$typeof = current.$$typeof;\n if ($$typeof === REACT_FORWARD_REF_TYPE) {\n workInProgress.tag = 11;\n workInProgress = updateForwardRef(\n null,\n workInProgress,\n current,\n props,\n renderLanes\n );\n break a;\n } else if ($$typeof === REACT_MEMO_TYPE) {\n workInProgress.tag = 14;\n workInProgress = updateMemoComponent(\n null,\n workInProgress,\n current,\n props,\n renderLanes\n );\n break a;\n } else if ($$typeof === REACT_CONTEXT_TYPE) {\n workInProgress.tag = 10;\n workInProgress.type = current;\n workInProgress = updateContextProvider(\n null,\n workInProgress,\n renderLanes\n );\n break a;\n }\n }\n workInProgress = getComponentNameFromType(current) || current;\n throw Error(formatProdErrorMessage(306, workInProgress, \"\"));\n }\n }\n return workInProgress;\n case 0:\n return updateFunctionComponent(\n current,\n workInProgress,\n workInProgress.type,\n workInProgress.pendingProps,\n renderLanes\n );\n case 1:\n return (\n (props = workInProgress.type),\n ($$typeof = resolveClassComponentProps(\n props,\n workInProgress.pendingProps\n )),\n updateClassComponent(\n current,\n workInProgress,\n props,\n $$typeof,\n renderLanes\n )\n );\n case 3:\n a: {\n pushHostContainer(\n workInProgress,\n workInProgress.stateNode.containerInfo\n );\n if (null === current) throw Error(formatProdErrorMessage(387));\n props = workInProgress.pendingProps;\n var prevState = workInProgress.memoizedState;\n $$typeof = prevState.element;\n cloneUpdateQueue(current, workInProgress);\n processUpdateQueue(workInProgress, props, null, renderLanes);\n var nextState = workInProgress.memoizedState;\n props = nextState.cache;\n pushProvider(workInProgress, CacheContext, props);\n props !== prevState.cache &&\n propagateContextChanges(\n workInProgress,\n [CacheContext],\n renderLanes,\n !0\n );\n suspendIfUpdateReadFromEntangledAsyncAction();\n props = nextState.element;\n if (prevState.isDehydrated)\n if (\n ((prevState = {\n element: props,\n isDehydrated: !1,\n cache: nextState.cache\n }),\n (workInProgress.updateQueue.baseState = prevState),\n (workInProgress.memoizedState = prevState),\n workInProgress.flags & 256)\n ) {\n workInProgress = mountHostRootWithoutHydrating(\n current,\n workInProgress,\n props,\n renderLanes\n );\n break a;\n } else if (props !== $$typeof) {\n $$typeof = createCapturedValueAtFiber(\n Error(formatProdErrorMessage(424)),\n workInProgress\n );\n queueHydrationError($$typeof);\n workInProgress = mountHostRootWithoutHydrating(\n current,\n workInProgress,\n props,\n renderLanes\n );\n break a;\n } else {\n current = workInProgress.stateNode.containerInfo;\n switch (current.nodeType) {\n case 9:\n current = current.body;\n break;\n default:\n current =\n \"HTML\" === current.nodeName\n ? current.ownerDocument.body\n : current;\n }\n nextHydratableInstance = getNextHydratable(current.firstChild);\n hydrationParentFiber = workInProgress;\n isHydrating = !0;\n hydrationErrors = null;\n rootOrSingletonContext = !0;\n renderLanes = mountChildFibers(\n workInProgress,\n null,\n props,\n renderLanes\n );\n for (workInProgress.child = renderLanes; renderLanes; )\n (renderLanes.flags = (renderLanes.flags & -3) | 134221824),\n (renderLanes = renderLanes.sibling);\n }\n else {\n resetHydrationState();\n if (props === $$typeof) {\n workInProgress = bailoutOnAlreadyFinishedWork(\n current,\n workInProgress,\n renderLanes\n );\n break a;\n }\n reconcileChildren(current, workInProgress, props, renderLanes);\n }\n workInProgress = workInProgress.child;\n }\n return workInProgress;\n case 26:\n return (\n markRef(current, workInProgress),\n null === current\n ? (renderLanes = getResource(\n workInProgress.type,\n null,\n workInProgress.pendingProps,\n null\n ))\n ? (workInProgress.memoizedState = renderLanes)\n : isHydrating ||\n (workInProgress.stateNode = createHoistableInstance(\n workInProgress.type,\n workInProgress.pendingProps,\n rootInstanceStackCursor.current,\n workInProgress\n ))\n : (workInProgress.memoizedState = getResource(\n workInProgress.type,\n current.memoizedProps,\n workInProgress.pendingProps,\n current.memoizedState\n )),\n null\n );\n case 27:\n return (\n pushHostContext(workInProgress),\n null === current &&\n isHydrating &&\n ((props = workInProgress.stateNode =\n resolveSingletonInstance(\n workInProgress.type,\n workInProgress.pendingProps,\n rootInstanceStackCursor.current\n )),\n (hydrationParentFiber = workInProgress),\n (rootOrSingletonContext = !0),\n ($$typeof = nextHydratableInstance),\n isSingletonScope(workInProgress.type)\n ? ((previousHydratableOnEnteringScopedSingleton = $$typeof),\n (nextHydratableInstance = getNextHydratable(props.firstChild)))\n : (nextHydratableInstance = $$typeof)),\n reconcileChildren(\n current,\n workInProgress,\n workInProgress.pendingProps.children,\n renderLanes\n ),\n markRef(current, workInProgress),\n null === current && (workInProgress.flags |= 4194304),\n workInProgress.child\n );\n case 5:\n if (null === current && isHydrating) {\n if (($$typeof = props = nextHydratableInstance))\n (props = canHydrateInstance(\n props,\n workInProgress.type,\n workInProgress.pendingProps,\n rootOrSingletonContext\n )),\n null !== props\n ? ((workInProgress.stateNode = props),\n (hydrationParentFiber = workInProgress),\n (nextHydratableInstance = getNextHydratable(props.firstChild)),\n (rootOrSingletonContext = !1),\n ($$typeof = !0))\n : ($$typeof = !1);\n $$typeof || throwOnHydrationMismatch(workInProgress);\n }\n pushHostContext(workInProgress);\n $$typeof = workInProgress.type;\n prevState = workInProgress.pendingProps;\n nextState = null !== current ? current.memoizedProps : null;\n props = prevState.children;\n shouldSetTextContent($$typeof, prevState)\n ? (props = null)\n : null !== nextState &&\n shouldSetTextContent($$typeof, nextState) &&\n (workInProgress.flags |= 32);\n null !== workInProgress.memoizedState &&\n (($$typeof = renderWithHooks(\n current,\n workInProgress,\n TransitionAwareHostComponent,\n null,\n null,\n renderLanes\n )),\n (HostTransitionContext._currentValue = $$typeof));\n markRef(current, workInProgress);\n reconcileChildren(current, workInProgress, props, renderLanes);\n return workInProgress.child;\n case 6:\n if (null === current && isHydrating) {\n if ((current = renderLanes = nextHydratableInstance))\n (renderLanes = canHydrateTextInstance(\n renderLanes,\n workInProgress.pendingProps,\n rootOrSingletonContext\n )),\n null !== renderLanes\n ? ((workInProgress.stateNode = renderLanes),\n (hydrationParentFiber = workInProgress),\n (nextHydratableInstance = null),\n (current = !0))\n : (current = !1);\n current || throwOnHydrationMismatch(workInProgress);\n }\n return null;\n case 13:\n return updateSuspenseComponent(current, workInProgress, renderLanes);\n case 4:\n return (\n pushHostContainer(\n workInProgress,\n workInProgress.stateNode.containerInfo\n ),\n (props = workInProgress.pendingProps),\n null === current\n ? (workInProgress.child = reconcileChildFibers(\n workInProgress,\n null,\n props,\n renderLanes\n ))\n : reconcileChildren(current, workInProgress, props, renderLanes),\n workInProgress.child\n );\n case 11:\n return updateForwardRef(\n current,\n workInProgress,\n workInProgress.type,\n workInProgress.pendingProps,\n renderLanes\n );\n case 7:\n return (\n (props = workInProgress.pendingProps),\n markRef(current, workInProgress),\n reconcileChildren(current, workInProgress, props, renderLanes),\n workInProgress.child\n );\n case 8:\n return (\n reconcileChildren(\n current,\n workInProgress,\n workInProgress.pendingProps.children,\n renderLanes\n ),\n workInProgress.child\n );\n case 12:\n return (\n reconcileChildren(\n current,\n workInProgress,\n workInProgress.pendingProps.children,\n renderLanes\n ),\n workInProgress.child\n );\n case 10:\n return updateContextProvider(current, workInProgress, renderLanes);\n case 9:\n return (\n ($$typeof = workInProgress.type._context),\n (props = workInProgress.pendingProps.children),\n prepareToReadContext(workInProgress),\n ($$typeof = readContext($$typeof)),\n (props = props($$typeof)),\n (workInProgress.flags |= 1),\n reconcileChildren(current, workInProgress, props, renderLanes),\n workInProgress.child\n );\n case 14:\n return updateMemoComponent(\n current,\n workInProgress,\n workInProgress.type,\n workInProgress.pendingProps,\n renderLanes\n );\n case 15:\n return updateSimpleMemoComponent(\n current,\n workInProgress,\n workInProgress.type,\n workInProgress.pendingProps,\n renderLanes\n );\n case 19:\n return updateSuspenseListComponent(current, workInProgress, renderLanes);\n case 31:\n return updateActivityComponent(current, workInProgress, renderLanes);\n case 22:\n return updateOffscreenComponent(\n current,\n workInProgress,\n renderLanes,\n workInProgress.pendingProps\n );\n case 24:\n return (\n prepareToReadContext(workInProgress),\n (props = readContext(CacheContext)),\n null === current\n ? (($$typeof = peekCacheFromPool()),\n null === $$typeof &&\n (($$typeof = workInProgressRoot),\n (prevState = createCache()),\n ($$typeof.pooledCache = prevState),\n prevState.refCount++,\n null !== prevState && ($$typeof.pooledCacheLanes |= renderLanes),\n ($$typeof = prevState)),\n (workInProgress.memoizedState = { parent: props, cache: $$typeof }),\n initializeUpdateQueue(workInProgress),\n pushProvider(workInProgress, CacheContext, $$typeof))\n : (0 !== (current.lanes & renderLanes) &&\n (cloneUpdateQueue(current, workInProgress),\n processUpdateQueue(workInProgress, null, null, renderLanes),\n suspendIfUpdateReadFromEntangledAsyncAction()),\n ($$typeof = current.memoizedState),\n (prevState = workInProgress.memoizedState),\n $$typeof.parent !== props\n ? (($$typeof = { parent: props, cache: props }),\n (workInProgress.memoizedState = $$typeof),\n 0 === workInProgress.lanes &&\n (workInProgress.memoizedState =\n workInProgress.updateQueue.baseState =\n $$typeof),\n pushProvider(workInProgress, CacheContext, props))\n : ((props = prevState.cache),\n pushProvider(workInProgress, CacheContext, props),\n props !== $$typeof.cache &&\n propagateContextChanges(\n workInProgress,\n [CacheContext],\n renderLanes,\n !0\n ))),\n reconcileChildren(\n current,\n workInProgress,\n workInProgress.pendingProps.children,\n renderLanes\n ),\n workInProgress.child\n );\n case 30:\n return (\n null === workInProgress.stateNode &&\n (workInProgress.stateNode = {\n autoName: null,\n paired: null,\n clones: null,\n ref: null\n }),\n (props = workInProgress.pendingProps),\n null != props.name && \"auto\" !== props.name\n ? (workInProgress.flags |= null === current ? 18882560 : 18874368)\n : isHydrating && pushMaterializedTreeId(workInProgress),\n null !== current && current.memoizedProps.name !== props.name\n ? (workInProgress.flags |= 4194816)\n : markRef(current, workInProgress),\n reconcileChildren(current, workInProgress, props.children, renderLanes),\n workInProgress.child\n );\n case 29:\n throw workInProgress.pendingProps;\n }\n throw Error(formatProdErrorMessage(156, workInProgress.tag));\n}\nfunction markUpdate(workInProgress) {\n workInProgress.flags |= 4;\n}\nfunction preloadInstanceAndSuspendIfNeeded(\n workInProgress,\n type,\n oldProps,\n newProps,\n renderLanes\n) {\n var JSCompiler_temp;\n if ((JSCompiler_temp = 0 !== (workInProgress.mode & 32)))\n JSCompiler_temp =\n null === oldProps\n ? maySuspendCommit(type, newProps)\n : maySuspendCommit(type, newProps) &&\n (newProps.src !== oldProps.src ||\n newProps.srcSet !== oldProps.srcSet);\n if (JSCompiler_temp) {\n if (\n ((workInProgress.flags |= 16777216),\n (renderLanes & 335544128) === renderLanes)\n )\n if (workInProgress.stateNode.complete) workInProgress.flags |= 8192;\n else if (shouldRemainOnPreviousScreen()) workInProgress.flags |= 8192;\n else\n throw (\n ((suspendedThenable = noopSuspenseyCommitThenable),\n SuspenseyCommitException)\n );\n } else workInProgress.flags &= -16777217;\n}\nfunction preloadResourceAndSuspendIfNeeded(workInProgress, resource) {\n if (\"stylesheet\" !== resource.type || 0 !== (resource.state.loading & 4))\n workInProgress.flags &= -16777217;\n else if (((workInProgress.flags |= 16777216), !preloadResource(resource)))\n if (shouldRemainOnPreviousScreen()) workInProgress.flags |= 8192;\n else\n throw (\n ((suspendedThenable = noopSuspenseyCommitThenable),\n SuspenseyCommitException)\n );\n}\nfunction scheduleRetryEffect(workInProgress, retryQueue) {\n null !== retryQueue && (workInProgress.flags |= 4);\n workInProgress.flags & 16384 &&\n ((retryQueue =\n 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912),\n (workInProgress.lanes |= retryQueue),\n (workInProgressSuspendedRetryLanes |= retryQueue));\n}\nfunction cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {\n if (!isHydrating)\n switch (renderState.tailMode) {\n case \"visible\":\n break;\n case \"collapsed\":\n for (\n var tailNode = renderState.tail, lastTailNode = null;\n null !== tailNode;\n\n )\n null !== tailNode.alternate && (lastTailNode = tailNode),\n (tailNode = tailNode.sibling);\n null === lastTailNode\n ? hasRenderedATailFallback || null === renderState.tail\n ? (renderState.tail = null)\n : (renderState.tail.sibling = null)\n : (lastTailNode.sibling = null);\n break;\n default:\n hasRenderedATailFallback = renderState.tail;\n for (tailNode = null; null !== hasRenderedATailFallback; )\n null !== hasRenderedATailFallback.alternate &&\n (tailNode = hasRenderedATailFallback),\n (hasRenderedATailFallback = hasRenderedATailFallback.sibling);\n null === tailNode\n ? (renderState.tail = null)\n : (tailNode.sibling = null);\n }\n}\nfunction bubbleProperties(completedWork) {\n var didBailout =\n null !== completedWork.alternate &&\n completedWork.alternate.child === completedWork.child,\n newChildLanes = 0,\n subtreeFlags = 0;\n if (didBailout)\n for (var child$113 = completedWork.child; null !== child$113; )\n (newChildLanes |= child$113.lanes | child$113.childLanes),\n (subtreeFlags |= child$113.subtreeFlags & 1206910976),\n (subtreeFlags |= child$113.flags & 1206910976),\n (child$113.return = completedWork),\n (child$113 = child$113.sibling);\n else\n for (child$113 = completedWork.child; null !== child$113; )\n (newChildLanes |= child$113.lanes | child$113.childLanes),\n (subtreeFlags |= child$113.subtreeFlags),\n (subtreeFlags |= child$113.flags),\n (child$113.return = completedWork),\n (child$113 = child$113.sibling);\n completedWork.subtreeFlags |= subtreeFlags;\n completedWork.childLanes = newChildLanes;\n return didBailout;\n}\nfunction completeWork(current, workInProgress, renderLanes) {\n var newProps = workInProgress.pendingProps;\n popTreeContext(workInProgress);\n switch (workInProgress.tag) {\n case 16:\n case 15:\n case 0:\n case 11:\n case 7:\n case 8:\n case 12:\n case 9:\n case 14:\n return bubbleProperties(workInProgress), null;\n case 1:\n return bubbleProperties(workInProgress), null;\n case 3:\n renderLanes = workInProgress.stateNode;\n newProps = null;\n null !== current && (newProps = current.memoizedState.cache);\n workInProgress.memoizedState.cache !== newProps &&\n (workInProgress.flags |= 2048);\n popProvider(CacheContext);\n popHostContainer();\n renderLanes.pendingContext &&\n ((renderLanes.context = renderLanes.pendingContext),\n (renderLanes.pendingContext = null));\n if (null === current || null === current.child)\n popHydrationState(workInProgress)\n ? markUpdate(workInProgress)\n : null === current ||\n (current.memoizedState.isDehydrated &&\n 0 === (workInProgress.flags & 256)) ||\n ((workInProgress.flags |= 1024),\n upgradeHydrationErrorsToRecoverable());\n bubbleProperties(workInProgress);\n return null;\n case 26:\n var type = workInProgress.type,\n nextResource = workInProgress.memoizedState;\n null === current\n ? (markUpdate(workInProgress),\n null !== nextResource\n ? (bubbleProperties(workInProgress),\n preloadResourceAndSuspendIfNeeded(workInProgress, nextResource))\n : (bubbleProperties(workInProgress),\n preloadInstanceAndSuspendIfNeeded(\n workInProgress,\n type,\n null,\n newProps,\n renderLanes\n )))\n : nextResource\n ? nextResource !== current.memoizedState\n ? (markUpdate(workInProgress),\n bubbleProperties(workInProgress),\n preloadResourceAndSuspendIfNeeded(workInProgress, nextResource))\n : (bubbleProperties(workInProgress),\n (workInProgress.flags &= -16777217))\n : ((current = current.memoizedProps),\n current !== newProps && markUpdate(workInProgress),\n bubbleProperties(workInProgress),\n preloadInstanceAndSuspendIfNeeded(\n workInProgress,\n type,\n current,\n newProps,\n renderLanes\n ));\n return null;\n case 27:\n popHostContext(workInProgress);\n renderLanes = rootInstanceStackCursor.current;\n type = workInProgress.type;\n if (null !== current && null != workInProgress.stateNode)\n current.memoizedProps !== newProps && markUpdate(workInProgress);\n else {\n if (!newProps) {\n if (null === workInProgress.stateNode)\n throw Error(formatProdErrorMessage(166));\n bubbleProperties(workInProgress);\n workInProgress.subtreeFlags &= -33554433;\n return null;\n }\n current = contextStackCursor.current;\n popHydrationState(workInProgress)\n ? prepareToHydrateHostInstance(workInProgress, current)\n : ((current = resolveSingletonInstance(type, newProps, renderLanes)),\n (workInProgress.stateNode = current),\n markUpdate(workInProgress));\n }\n bubbleProperties(workInProgress);\n workInProgress.subtreeFlags &= -33554433;\n return null;\n case 5:\n popHostContext(workInProgress);\n type = workInProgress.type;\n if (null !== current && null != workInProgress.stateNode)\n current.memoizedProps !== newProps && markUpdate(workInProgress);\n else {\n if (!newProps) {\n if (null === workInProgress.stateNode)\n throw Error(formatProdErrorMessage(166));\n bubbleProperties(workInProgress);\n workInProgress.subtreeFlags &= -33554433;\n return null;\n }\n nextResource = contextStackCursor.current;\n if (popHydrationState(workInProgress))\n prepareToHydrateHostInstance(workInProgress, nextResource);\n else {\n var ownerDocument = getOwnerDocumentFromRootContainer(\n rootInstanceStackCursor.current\n );\n switch (nextResource) {\n case 1:\n nextResource = ownerDocument.createElementNS(\n \"http://www.w3.org/2000/svg\",\n type\n );\n break;\n case 2:\n nextResource = ownerDocument.createElementNS(\n \"http://www.w3.org/1998/Math/MathML\",\n type\n );\n break;\n default:\n switch (type) {\n case \"svg\":\n nextResource = ownerDocument.createElementNS(\n \"http://www.w3.org/2000/svg\",\n type\n );\n break;\n case \"math\":\n nextResource = ownerDocument.createElementNS(\n \"http://www.w3.org/1998/Math/MathML\",\n type\n );\n break;\n case \"script\":\n nextResource = ownerDocument.createElement(\"div\");\n nextResource.innerHTML = \" + + + +
+ + diff --git a/suites-experimental/stormbox-react/dist/resources.txt b/suites-experimental/stormbox-react/dist/resources.txt new file mode 100644 index 000000000..b3976c30a --- /dev/null +++ b/suites-experimental/stormbox-react/dist/resources.txt @@ -0,0 +1,13 @@ +assets/Inter-Bold-CuhepTt8.woff2 +assets/Inter-Medium-P1cOs5ep.woff2 +assets/Inter-Regular-CKDp9E3C.woff2 +assets/Inter-SemiBold-Ctx7G98q.woff2 +assets/Metropolis-Bold-BZLKi5Gb.woff2 +assets/Metropolis-Light-zcEanPsD.woff2 +assets/Metropolis-Regular-DKepXnDq.woff2 +assets/Metropolis-SemiBold-D_dLm6Ff.woff2 +assets/index-AWVjlOug.css +assets/index-DIr-gxPn.js +assets/index-DIr-gxPn.js.map +favicon-32.png +index.html diff --git a/suites-experimental/stormbox-react/index.html b/suites-experimental/stormbox-react/index.html new file mode 100644 index 000000000..b79d9156a --- /dev/null +++ b/suites-experimental/stormbox-react/index.html @@ -0,0 +1,13 @@ + + + + + + Thundermail - alex.morgan@example.org + + + +
+ + + diff --git a/suites-experimental/stormbox-react/package-lock.json b/suites-experimental/stormbox-react/package-lock.json new file mode 100644 index 000000000..cb4f50ff7 --- /dev/null +++ b/suites-experimental/stormbox-react/package-lock.json @@ -0,0 +1,1120 @@ +{ + "name": "stormbox-react", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "stormbox-react", + "version": "0.0.0", + "dependencies": { + "@tanstack/react-virtual": "3.13.26", + "dompurify": "3.4.7", + "linkify-string": "4.3.3", + "linkifyjs": "4.3.3", + "lucide-react": "1.16.0", + "react": "19.3.1", + "react-dom": "19.3.1", + "squire-rte": "2.4.6", + "zustand": "5.0.15" + }, + "devDependencies": { + "@types/react": "19.3.0", + "@types/react-dom": "19.3.0", + "@vitejs/plugin-react": "6.1.2", + "typescript": "6.0.3", + "vite": "8.0.16" + } + }, + "node_modules/@emnapi/core": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.10.0.tgz", + "integrity": "sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/wasi-threads": "1.2.1", + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.10.0.tgz", + "integrity": "sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/wasi-threads": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz", + "integrity": "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@napi-rs/wasm-runtime": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.2.5.tgz", + "integrity": "sha512-HshSvXzmBxNzqejd3k/KemgQ3hdREUYFRRrgxOZ+gPljDIsO2SDZrVZMd4Z/HsxudQbE62OVyVFE8z9BCurfjA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@tybys/wasm-util": "^0.10.3" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=23.5.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "peerDependencies": { + "@emnapi/core": "^1.7.1 || ^2.0.0-alpha.4", + "@emnapi/runtime": "^1.7.1 || ^2.0.0-alpha.4" + } + }, + "node_modules/@oxc-project/types": { + "version": "0.133.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.133.0.tgz", + "integrity": "sha512-KzkdCd6Uxqnf6l3HOw1xfatAlUURA0g14cvBYFyJ5SaNOQbOUvBr9PKArcPcrNIeRsBdgcUzOGrhKveVpvOIGA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/Boshen" + } + }, + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.3.tgz", + "integrity": "sha512-454rs7jHngixp/NMxd5srYD57OnzSlZ/eFTETjORQHLwJG1lRtmNOJcBerZlfu4GjKqeq8aCCIQrMdHyhI51Hw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.0.3.tgz", + "integrity": "sha512-PcAhP+ynjURNyy8SKGl5DQP94aGuB/7JrXJb/t7P+hanXvQVMWzUvRRhBAcg/lNRadBhoUPqSoP4xw5tR/KBEA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.0.3.tgz", + "integrity": "sha512-9YpfeUvSE2RS7wysJ81uOZkXJz7f7Q55H2Gvp3VEw/EsahqDtrphrZ0EwDLK5vvKOzaCrBsjF8JmnMLcUt78Gg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.0.3.tgz", + "integrity": "sha512-yB1IlAsSNHncV6SCTL27/MVGR5htvQsoGxIv5KMGXALp+Ll1wYsn+x98M9MW7qa+NdSbvrrY7ANI4wLJ0n1e6g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.0.3.tgz", + "integrity": "sha512-Yi30IVAAfLUCy2MseFjbB1jAMDl1VMCAas5StnYp8da9+CKvMd2H2cbEjWcw5NPaPqzvYkVIaF1nNUG+b7u/sw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.0.3.tgz", + "integrity": "sha512-jsO7R8To+AdlYgUmN5sHSCZbfhtMBkO0WUx8iORQnPcMMdgr7qM2DQmMwgabs3GhNztdmoKkMKQFHD6DTMCIQw==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.0.3.tgz", + "integrity": "sha512-VWkUHwWriDciit80wleYwKILoR/KMvxh/IdwS/paX+ZgpuRpCrKLUdadJbc0NpBEiyhpYawsJ73j9aCvOH+f7Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.0.3.tgz", + "integrity": "sha512-5f1laC0SlIR0yDbFCd8acUhvJIag6N3zC5P7oUPN6wX0aOma+uKJ0wBDH5aq7I1PVI2ttTlhJwzwRIBnLiSGEg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.0.3.tgz", + "integrity": "sha512-Iq4ko0r4XsgbrF/LunNgHtAGLRRVE2kXonAXQ/MV0mC6jQpMOhW1SvtZja2EhC/kd05++bP78dsqBeIQyYJ6Yg==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.0.3.tgz", + "integrity": "sha512-B8m6tD5+/N5FeNQFbKlLA/2yVq9ycQP1SeedyEYYKWBNR3ZQbkvIUcNnDNM03lO1l5F2roiiFJGgvoLLyZXtSg==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.0.3.tgz", + "integrity": "sha512-pSdpdUJHkuCxun9LE7jvgUB9qsRgaiyNNCX7m/AvHTcq67AiT/Yhoxvw5zPfhrM8k/BfP8ce/hMOpthKDpEUow==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.0.3.tgz", + "integrity": "sha512-OXXS3RKJgX2uLwM+gYyuH5omcH8fL1LJs96pZGgtetVCahON57+d4SJHzTgZiOjxgGkSnpXpOsWuPDGAKAigEg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-wasm32-wasi": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.0.3.tgz", + "integrity": "sha512-JTtb8BWFynicNSoPrehsCzBtOKjZ6jhMiPFEmOiuXg1Fl8dn2KHQob+GuPSGR0dryQa1PQJbzjF3dqO/whhjLg==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "1.10.0", + "@emnapi/runtime": "1.10.0", + "@napi-rs/wasm-runtime": "^1.1.4" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.0.3.tgz", + "integrity": "sha512-gEdFFEN70A/jxb2svrWsN3aDL7OUtmvlOy+6fa2jxG8K0wQ1ZbdeLGnidov6Yu5/733dI5ySfzFlQ/cb0bSz1g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.0.3.tgz", + "integrity": "sha512-eXB7CHuaQdqmJcc3koCNtNPmT/bj2gc999kUFgBxG8Ac0NdgXc4rkCHhqrgrhN3zddvvvrgzj1e90SuSfmyIXA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", + "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tanstack/react-virtual": { + "version": "3.13.26", + "resolved": "https://registry.npmjs.org/@tanstack/react-virtual/-/react-virtual-3.13.26.tgz", + "integrity": "sha512-DosdgjOxCLahkn0o+ilmZYwEjo1glfMGuRT/j3PQ18yr5XqA8N/BCaL9IJ3B5TRl+nnzyK2IOFgAILwzN3a9xQ==", + "license": "MIT", + "dependencies": { + "@tanstack/virtual-core": "3.16.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/@tanstack/virtual-core": { + "version": "3.16.0", + "resolved": "https://registry.npmjs.org/@tanstack/virtual-core/-/virtual-core-3.16.0.tgz", + "integrity": "sha512-Er2N7q3WOiH6y2JLxsxNX+u2/sLqSsL0bxFgDjuiPiA7vKhZRm+IzcS17vRee3GNXr64UsesA5CAp9yTiIYw9A==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + } + }, + "node_modules/@tybys/wasm-util": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.4.tgz", + "integrity": "sha512-W3c4gRigFS0T/Ma4qIYF3GDAc5AQdHb1yL5znJT1Zv1YaD9Kitx656wBjvr19qbiosmZT8lWDM5BEMynUqX65A==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@types/react": { + "version": "19.3.0", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.3.0.tgz", + "integrity": "sha512-N0rFCuH9YoxG9/m61l9MfpJKfmLOVU0em7ipIz6TRgSSkvReLB9vL85GB+yr8Bs5leqpvg96JSwF4ZS1s4viQg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "csstype": "^3.2.2" + } + }, + "node_modules/@types/react-dom": { + "version": "19.3.0", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.3.0.tgz", + "integrity": "sha512-ZI7bU42mZXXKHn/qNLEw2IrbiINU7X5+vfgdixBHkCNpYWXjKgfQ/P+uyGb5CjOLB9UcnTeg3rylQtV2hym44Q==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^19.3.0" + } + }, + "node_modules/@types/trusted-types": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", + "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", + "license": "MIT", + "optional": true + }, + "node_modules/@vitejs/plugin-react": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-6.1.2.tgz", + "integrity": "sha512-fhJNGUdscQa4HkI0xFxwonWyhnVReCPDbXI7FH7jmzpnVCrFQI7PRrhWecO263610vOrs9tr2Y4xcf8uAdFxbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rolldown/pluginutils": "^1.0.1" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "peerDependencies": { + "@rolldown/plugin-babel": "^0.1.7 || ^0.2.0", + "babel-plugin-react-compiler": "^1.0.0", + "oxc-transform-react": "^0.152.0", + "vite": "^8.0.0" + }, + "peerDependenciesMeta": { + "@rolldown/plugin-babel": { + "optional": true + }, + "babel-plugin-react-compiler": { + "optional": true + }, + "oxc-transform-react": { + "optional": true + } + } + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/dompurify": { + "version": "3.4.7", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.4.7.tgz", + "integrity": "sha512-2jBxDJY4RR06tQNy4w5FlFH7kfxsQZlufd0sbv+chfHCxeJwrFw2baUDsSwvBISD4K4RDbd0PTfy3uNXsR6siA==", + "license": "(MPL-2.0 OR Apache-2.0)", + "optionalDependencies": { + "@types/trusted-types": "^2.0.7" + } + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/lightningcss": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz", + "integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.33.0", + "lightningcss-darwin-arm64": "1.33.0", + "lightningcss-darwin-x64": "1.33.0", + "lightningcss-freebsd-x64": "1.33.0", + "lightningcss-linux-arm-gnueabihf": "1.33.0", + "lightningcss-linux-arm64-gnu": "1.33.0", + "lightningcss-linux-arm64-musl": "1.33.0", + "lightningcss-linux-x64-gnu": "1.33.0", + "lightningcss-linux-x64-musl": "1.33.0", + "lightningcss-win32-arm64-msvc": "1.33.0", + "lightningcss-win32-x64-msvc": "1.33.0" + } + }, + "node_modules/lightningcss-android-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.33.0.tgz", + "integrity": "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.33.0.tgz", + "integrity": "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.33.0.tgz", + "integrity": "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-freebsd-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.33.0.tgz", + "integrity": "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.33.0.tgz", + "integrity": "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.33.0.tgz", + "integrity": "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.33.0.tgz", + "integrity": "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.33.0.tgz", + "integrity": "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.33.0.tgz", + "integrity": "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.33.0.tgz", + "integrity": "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.33.0.tgz", + "integrity": "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/linkify-string": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/linkify-string/-/linkify-string-4.3.3.tgz", + "integrity": "sha512-k8BwpKz6t4jigzoi5hKUbji0M4kUqhQ7LXIKFRxb2VvG5m0+4YSck+VFLhOxxeiuVu3pLDuSVNRq9+IQKroFIw==", + "license": "MIT", + "peerDependencies": { + "linkifyjs": "==4.3.3" + } + }, + "node_modules/linkifyjs": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/linkifyjs/-/linkifyjs-4.3.3.tgz", + "integrity": "sha512-P8aEP5U/D1/IlTY2OeYsErdwh9bGuLE30NcXtKEjgdHcahveQoQwM2yZNsioQHsWFz0P7KKudisbrzCgR0sDHg==", + "license": "MIT" + }, + "node_modules/lucide-react": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-1.16.0.tgz", + "integrity": "sha512-dYwyPzb4MEKpGUmNYk3WKWPnMrHs3FKM+q94kAnJrcDIqqn1hq2xY8scaS2ovsOCM5D51ey2gaRG3PBb1vgoYQ==", + "license": "ISC", + "peerDependencies": { + "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/nanoid": { + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.31.tgz", + "integrity": "sha512-YUbWYCgErwnMAVkjUnYa+KlMBzGpHwiIt/DE7f0G33AuX2LH9UcTk6KgWxd3zRU+pN3u/C+Xl3EnMLM4Hea7Sg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.20", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/react": { + "version": "19.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-19.3.1.tgz", + "integrity": "sha512-QNhWdt7nrgVWWQG58QuGsAR3jv3Hbe4mb4vz7w2csnHavciZJgda1CPNaldF6eVxv90ud3jUXpKlHL69gO38yw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "19.3.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.3.1.tgz", + "integrity": "sha512-Y0bARz53lhEC1NMCASs0/j+faB/zqt3R8hpvg1e8+61ZVJ4UL0UdC4cBbXfZMcIuhrfgeILTLe+ZeBCavQPtKQ==", + "license": "MIT", + "dependencies": { + "scheduler": "^0.28.0" + }, + "peerDependencies": { + "react": "^19.3.1" + } + }, + "node_modules/rolldown": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.3.tgz", + "integrity": "sha512-i00lAJ2ks1BYr7rjNjKC7BcqAS7nVfiT3QX1SI5aY+AFHblCmaUf9OE9dbdzDvW6dJxbi2ZCZiy9v3CcwOiX3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oxc-project/types": "=0.133.0", + "@rolldown/pluginutils": "^1.0.0" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm64": "1.0.3", + "@rolldown/binding-darwin-arm64": "1.0.3", + "@rolldown/binding-darwin-x64": "1.0.3", + "@rolldown/binding-freebsd-x64": "1.0.3", + "@rolldown/binding-linux-arm-gnueabihf": "1.0.3", + "@rolldown/binding-linux-arm64-gnu": "1.0.3", + "@rolldown/binding-linux-arm64-musl": "1.0.3", + "@rolldown/binding-linux-ppc64-gnu": "1.0.3", + "@rolldown/binding-linux-s390x-gnu": "1.0.3", + "@rolldown/binding-linux-x64-gnu": "1.0.3", + "@rolldown/binding-linux-x64-musl": "1.0.3", + "@rolldown/binding-openharmony-arm64": "1.0.3", + "@rolldown/binding-wasm32-wasi": "1.0.3", + "@rolldown/binding-win32-arm64-msvc": "1.0.3", + "@rolldown/binding-win32-x64-msvc": "1.0.3" + } + }, + "node_modules/scheduler": { + "version": "0.28.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.28.0.tgz", + "integrity": "sha512-juorfCmIkIw8tT+p5BXSm6PJjQF/ycEYmKyzURCIt/RaZIhL+PulbQ9Yu2z1HdOJDdqDTlxA1+xKBmHXJsczAw==", + "license": "MIT" + }, + "node_modules/source-map-js": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz", + "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/squire-rte": { + "version": "2.4.6", + "resolved": "https://registry.npmjs.org/squire-rte/-/squire-rte-2.4.6.tgz", + "integrity": "sha512-XHaD9c0/FkkznzZ4xq+zWh0De/e5wb3fD//365yEpAKJD0kpERMtTJ5X0K7usfnp0Bcx/Vnx88hdc9PP71RsSg==", + "license": "MIT" + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD", + "optional": true + }, + "node_modules/typescript": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", + "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/vite": { + "version": "8.0.16", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.0.16.tgz", + "integrity": "sha512-h9bXPmJichP5fLmVQo3PyaGSDE2n3aPuomeAlVRm0JLmt4rY6zmPKd59HYI4LNW8oTK7tlTsuC7l/m7awx9Jcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "lightningcss": "^1.32.0", + "picomatch": "^4.0.4", + "postcss": "^8.5.15", + "rolldown": "1.0.3", + "tinyglobby": "^0.2.17" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.1.18", + "esbuild": "^0.27.0 || ^0.28.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "@vitejs/devtools": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/zustand": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-5.0.15.tgz", + "integrity": "sha512-MpSEjRiBkA9crSYeOUH32rJC7SVqAbm0Fqcqge/bUi2PPoLcBWKOsG+C8mevmpr8TwXHBVkChbbJiyvkE+i/3A==", + "license": "MIT", + "engines": { + "node": ">=12.20.0" + }, + "peerDependencies": { + "@types/react": ">=18.0.0", + "immer": ">=9.0.6", + "react": ">=18.0.0", + "use-sync-external-store": ">=1.2.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "immer": { + "optional": true + }, + "react": { + "optional": true + }, + "use-sync-external-store": { + "optional": true + } + } + } + } +} diff --git a/suites-experimental/stormbox-react/package.json b/suites-experimental/stormbox-react/package.json new file mode 100644 index 000000000..df053cac3 --- /dev/null +++ b/suites-experimental/stormbox-react/package.json @@ -0,0 +1,31 @@ +{ + "name": "stormbox-react", + "private": true, + "version": "0.0.0", + "description": "Standalone React clone of the Stormbox webmail front end, with generated local data, for browser performance testing", + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build && node scripts/generate-resources.mjs", + "preview": "vite preview", + "typecheck": "tsc --noEmit" + }, + "dependencies": { + "@tanstack/react-virtual": "3.13.26", + "dompurify": "3.4.7", + "linkify-string": "4.3.3", + "linkifyjs": "4.3.3", + "lucide-react": "1.16.0", + "react": "19.3.1", + "react-dom": "19.3.1", + "squire-rte": "2.4.6", + "zustand": "5.0.15" + }, + "devDependencies": { + "@types/react": "19.3.0", + "@types/react-dom": "19.3.0", + "@vitejs/plugin-react": "6.1.2", + "typescript": "6.0.3", + "vite": "8.0.16" + } +} diff --git a/suites-experimental/stormbox-react/public/favicon-32.png b/suites-experimental/stormbox-react/public/favicon-32.png new file mode 100644 index 000000000..f5817a2ac Binary files /dev/null and b/suites-experimental/stormbox-react/public/favicon-32.png differ diff --git a/suites-experimental/stormbox-react/scripts/generate-resources.mjs b/suites-experimental/stormbox-react/scripts/generate-resources.mjs new file mode 100644 index 000000000..1edc5ba1a --- /dev/null +++ b/suites-experimental/stormbox-react/scripts/generate-resources.mjs @@ -0,0 +1,5 @@ +// Writes dist/resources.txt, the manifest the Stormbox-React suite entry +// in suites-experimental/suites.mjs declares. Run by "npm run build". +import { generateResourcesFile } from "../../../resources/shared/generate-resources.mjs"; + +generateResourcesFile(new URL("../dist", import.meta.url).pathname); diff --git a/suites-experimental/stormbox-react/scripts/port-vue-styles.mjs b/suites-experimental/stormbox-react/scripts/port-vue-styles.mjs new file mode 100644 index 000000000..6d644ee52 --- /dev/null +++ b/suites-experimental/stormbox-react/scripts/port-vue-styles.mjs @@ -0,0 +1,147 @@ +// Regenerates src/styles/components.css from Stormbox's Vue components. +// +// node scripts/port-vue-styles.mjs [path/to/stormbox] +// +// Vue's scoped CSS appends a [data-v-*] attribute to the last compound of +// each selector (or the compound before :deep()), raising its specificity +// by one attribute. That bump decides several contests with the global +// stylesheet, so it is reproduced here with an always-matching +// :is([class],:not([class])) instead of the attribute. +import fs from 'node:fs'; +import os from 'node:os'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..'); +const stormbox = path.resolve(process.argv[2] ?? path.join(os.homedir(), 'src', 'stormbox')); +const components = path.join(stormbox, 'src', 'components'); +const FILES = [ + 'AppButton', 'AppIconButton', 'AppToggleButton', 'AppDropdown', 'AppSpaces', 'StorageUsageBar', 'AccountAvatarMenu', + 'AppDrawer', 'FolderTree', 'FolderNode', 'TagViewNode', 'MessageColumns', 'MessageList', 'SelectableListHeader', + 'MessageBulkActions', 'MessageListMoreMenu', 'MessageListRow', 'MessageTagStack', 'MessageTagChip', 'TagPickerPanel', + 'TagPickerDropdown', 'TagPickerPopover', 'MessageView', 'MessageAttachmentBar', 'ComposeManager', 'ComposeDialog', + 'RecipientInput', 'RichTextEditor', 'StoreErrorToast', +]; +// Selectors whose names are generic enough to collide once they are global. +// Vue scoping also keeps a parent's tag selectors off a child component's +// elements; `.row input` must not reach the recipient field's input. +const PREFIXES = { + ComposeDialog: [ + [/^\.row input$/, '.row > input'], + [/^(\.row\b|footer\b)/, '.compose-dialog__card $1'], + ], +}; +const BUMP = ':is([class],:not([class]))'; + +function splitTopLevel(text, separator) { + const parts = []; + let depth = 0; + let quote = null; + let start = 0; + for (let i = 0; i < text.length; i += 1) { + const c = text[i]; + if (quote) { if (c === quote) quote = null; continue; } + if (c === '"' || c === "'") quote = c; + else if (c === '(' || c === '[') depth += 1; + else if (c === ')' || c === ']') depth -= 1; + else if (c === separator && depth === 0) { parts.push(text.slice(start, i)); start = i + 1; } + } + parts.push(text.slice(start)); + return parts; +} + +/** Index just past the last compound selector, before a trailing ::pseudo-element. */ +function bumpIndex(selector) { + let depth = 0; + let pseudoElement = -1; + for (let i = 0; i < selector.length; i += 1) { + const c = selector[i]; + if (c === '(' || c === '[') depth += 1; + else if (c === ')' || c === ']') depth -= 1; + else if (depth === 0 && /[\s>+~]/.test(c)) pseudoElement = -1; + else if (depth === 0 && c === ':' && selector[i + 1] === ':' && pseudoElement < 0) pseudoElement = i; + } + return pseudoElement >= 0 ? pseudoElement : selector.length; +} + +function unwrap(text, fn) { + let out = ''; + let i = 0; + const token = `${fn}(`; + while (i < text.length) { + const j = text.indexOf(token, i); + if (j < 0) { out += text.slice(i); break; } + out += text.slice(i, j); + let k = j + token.length; + let depth = 1; + while (k < text.length && depth > 0) { + if (text[k] === '(') depth += 1; + else if (text[k] === ')') depth -= 1; + k += 1; + } + out += text.slice(j + token.length, k - 1); + i = k; + } + return out; +} + +function scopeSelector(raw, prefixes) { + let selector = raw.trim(); + for (const [pattern, replacement] of prefixes) selector = selector.replace(pattern, replacement); + if (selector.includes(':global(')) return unwrap(selector, ':global'); + const deep = selector.indexOf(':deep('); + if (deep >= 0) { + const before = selector.slice(0, deep).replace(/\s+$/, ''); + const after = unwrap(selector.slice(deep), ':deep'); + return before ? `${before}${BUMP} ${after}` : `${BUMP} ${after}`; + } + const at = bumpIndex(selector); + return selector.slice(0, at) + BUMP + selector.slice(at); +} + +function transform(css, scoped, prefixes) { + let out = ''; + let i = 0; + while (i < css.length) { + const open = css.indexOf('{', i); + if (open < 0) { out += css.slice(i); break; } + const head = css.slice(i, open); + let depth = 1; + let k = open + 1; + while (k < css.length && depth > 0) { + if (css[k] === '{') depth += 1; + else if (css[k] === '}') depth -= 1; + k += 1; + } + const body = css.slice(open + 1, k - 1); + const trimmed = head.trim(); + if (trimmed.startsWith('@')) { + out += /^@(-webkit-)?keyframes/.test(trimmed) + ? `${head}{${body}}` + : `${head}{${transform(body, scoped, prefixes)}}`; + } else { + const leading = head.match(/^\s*/)[0]; + const selectors = splitTopLevel(trimmed, ',') + .map((selector) => (scoped ? scopeSelector(selector, prefixes) : unwrap(selector.trim(), ':global'))); + out += `${leading}${selectors.join(',\n')} {${body}}`; + } + i = k; + } + return out; +} + +let output = `/* Generated by scripts/port-vue-styles.mjs from Stormbox's Vue components + (MPL-2.0). Do not edit; edit the script or src/styles/local.css. */\n`; +for (const name of FILES) { + const source = fs.readFileSync(path.join(components, `${name}.vue`), 'utf8'); + const re = /]*)>([\s\S]*?)<\/style>/g; + let match; + output += `\n/* ---- ${name} ---- */\n`; + while ((match = re.exec(source))) { + const scoped = /\bscoped\b/.test(match[1]); + const css = match[2].replace(/\/\*[\s\S]*?\*\//g, ''); + output += `${transform(css, scoped, PREFIXES[name] ?? []).trim()}\n`; + } +} +fs.writeFileSync(path.join(root, 'src', 'styles', 'components.css'), output); +console.log(`Wrote src/styles/components.css (${output.length} bytes)`); diff --git a/suites-experimental/stormbox-react/src/App.tsx b/suites-experimental/stormbox-react/src/App.tsx new file mode 100644 index 000000000..e906cdd2a --- /dev/null +++ b/suites-experimental/stormbox-react/src/App.tsx @@ -0,0 +1,342 @@ +import { + useCallback, useEffect, useLayoutEffect, useRef, useState, +} from 'react'; +import type { CSSProperties } from 'react'; +import { + Bug, Lightbulb, Moon, Plus, Sun, X, +} from 'lucide-react'; + +import mailGlyph from './assets/icons/tb-mail-glyph.svg?raw'; +import { ACCOUNT } from './data/mailbox'; +import { INBOX_FOLDER_ID, folderCounts, useMailStore } from './store/mail-store'; +import { useComposeStore } from './store/compose-store'; +import { + MESSAGE_COLUMN_MAX_WIDTH, MESSAGE_COLUMN_MIN_WIDTH, MESSAGE_COLUMN_RESIZER_WIDTH, useUiStore, +} from './store/ui-store'; +import { useColumnResize } from './hooks/useColumnResize'; +import { useShortcuts } from './hooks/useShortcuts'; +import { AppButton, RawIcon } from './components/base'; +import { + AccountAvatarMenu, AppDrawer, AppSpaces, StorageUsageBar, +} from './components/Shell'; +import { FolderTree } from './components/FolderTree'; +import { MessageList } from './components/MessageList'; +import { MessageView } from './components/MessageView'; +import { ComposeManager } from './components/Compose'; +import { Toasts } from './components/Toasts'; +import { ANIMATIONS_OFF } from './motion'; + +const SPACE_RAIL_WIDTH = 56; +const RESIZER_WIDTH = 6; +const COMPACT_READING_WIDTH = 1024; +const SINGLE_COLUMN_WIDTH = 640; +const FOLDER_LIST_TRANSITION_MS = ANIMATIONS_OFF ? 0 : 360; +const MESSAGE_VIEW_PRELOAD_MS = 50; +const FOLDER_LIST_MIN_WIDTH = 180; +const FOLDER_LIST_MAX_WIDTH = 420; +const MESSAGE_VIEW_MIN_WIDTH = 240; + +function useWindowWidth(): number { + const [width, setWidth] = useState(() => window.innerWidth); + useEffect(() => { + const onResize = () => setWidth(window.innerWidth); + window.addEventListener('resize', onResize); + return () => window.removeEventListener('resize', onResize); + }, []); + return width; +} + +export function App() { + const theme = useUiStore((s) => s.theme); + const space = useUiStore((s) => s.space); + const quickFilter = useUiStore((s) => s.quickFilter); + const folderListWidth = useUiStore((s) => s.folderListWidth); + const messageColumnWidth = useUiStore((s) => s.messageColumnWidth); + const quickFilterFocusRequest = useUiStore((s) => s.quickFilterFocusRequest); + const openId = useMailStore((s) => s.open.id); + const selectionSize = useMailStore((s) => s.selection.ids.size); + const messages = useMailStore((s) => s.messages); + const composeExpanded = useComposeStore((s) => s.sessions.some((session) => session.presentation === 'expanded')); + const windowWidth = useWindowWidth(); + const shellRef = useRef(null); + const quickFilterRef = useRef(null); + + const [folderListHidden, setFolderListHidden] = useState(false); + const responsiveHiddenRef = useRef(false); + const [maximized, setMaximized] = useState(false); + const showMessageView = openId != null && selectionSize === 0; + const singleColumn = windowWidth < SINGLE_COLUMN_WIDTH; + const singleMailColumn = space === 'mail' && showMessageView && singleColumn; + const displayedMessageList = !(space === 'mail' && singleMailColumn); + const [displayedMessageView, setDisplayedMessageView] = useState( + showMessageView && !(space === 'mail' && windowWidth < COMPACT_READING_WIDTH), + ); + const timerRef = useRef(null); + const inboxUnread = folderCounts({ messages }).unread.get(INBOX_FOLDER_ID) ?? 0; + + useShortcuts({ enabled: !maximized || composeExpanded }); + + // Theme classes on : services-ui and the stylesheets key off them. + useLayoutEffect(() => { + const root = document.documentElement; + root.classList.toggle('dark', theme === 'dark'); + root.classList.toggle('light', theme === 'light'); + root.style.colorScheme = theme; + }, [theme]); + + useEffect(() => { + if (quickFilterFocusRequest === 0) return; + quickFilterRef.current?.focus(); + quickFilterRef.current?.select(); + }, [quickFilterFocusRequest]); + + useEffect(() => { + setMaximized(false); + }, [openId]); + + useEffect(() => { + if (!displayedMessageView) setMaximized(false); + }, [displayedMessageView]); + + // R-10.2: the compact layouts hide the folder list beside an open + // message, and the reading pane waits for the folder list to slide away. + useLayoutEffect(() => { + const compact = windowWidth < COMPACT_READING_WIDTH; + const detailVisible = space === 'mail' ? showMessageView : false; + const shouldHide = singleColumn || (compact && detailVisible); + let willHide = false; + if (shouldHide) { + if (!folderListHidden) { + responsiveHiddenRef.current = true; + willHide = true; + setFolderListHidden(true); + } + } else if (responsiveHiddenRef.current) { + setFolderListHidden(false); + responsiveHiddenRef.current = false; + } + if (timerRef.current != null) { + clearTimeout(timerRef.current); + timerRef.current = null; + } + if (!showMessageView) { + setDisplayedMessageView(false); + return; + } + if (!(space === 'mail' && willHide && !singleMailColumn) || FOLDER_LIST_TRANSITION_MS === 0) { + setDisplayedMessageView(true); + return; + } + setDisplayedMessageView(false); + timerRef.current = window.setTimeout(() => { + timerRef.current = null; + setDisplayedMessageView(true); + }, Math.max(0, FOLDER_LIST_TRANSITION_MS - MESSAGE_VIEW_PRELOAD_MS)); + // Re-evaluated when the inputs of the layout change, as in App.vue. + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [showMessageView, windowWidth, space]); + + useEffect(() => () => { + if (timerRef.current != null) clearTimeout(timerRef.current); + }, []); + + const toggleFolderList = useCallback(() => { + setFolderListHidden((hidden) => !hidden); + responsiveHiddenRef.current = false; + }, []); + + const messageColumnsWidth = messageColumnWidth + (displayedMessageView ? 1 : 0) * MESSAGE_COLUMN_RESIZER_WIDTH; + + function maxFolderListWidth() { + const shellWidth = shellRef.current?.clientWidth || window.innerWidth; + const available = Math.max(0, shellWidth - SPACE_RAIL_WIDTH - (folderListHidden ? 0 : RESIZER_WIDTH)); + const reserve = displayedMessageView + ? MESSAGE_COLUMN_MIN_WIDTH + MESSAGE_COLUMN_RESIZER_WIDTH + MESSAGE_VIEW_MIN_WIDTH + : MESSAGE_COLUMN_MIN_WIDTH; + return Math.min(FOLDER_LIST_MAX_WIDTH, available - reserve); + } + + const folderResize = useColumnResize({ + get: () => useUiStore.getState().folderListWidth, + set: (width) => useUiStore.getState().setFolderListWidth(width), + min: () => FOLDER_LIST_MIN_WIDTH, + max: maxFolderListWidth, + }); + const columnResize = useColumnResize({ + get: () => useUiStore.getState().messageColumnWidth, + set: (width) => useUiStore.getState().setMessageColumnWidth(width), + min: () => MESSAGE_COLUMN_MIN_WIDTH, + max: () => MESSAGE_COLUMN_MAX_WIDTH, + }); + + const shellStyle = { + '--folder-list-width': `${folderListWidth}px`, + '--message-columns-width': `${messageColumnsWidth}px`, + '--message-list-min-width': `${MESSAGE_COLUMN_MIN_WIDTH}px`, + '--message-view-min-width': `${MESSAGE_VIEW_MIN_WIDTH}px`, + '--column-resizer-width': `${RESIZER_WIDTH}px`, + '--folder-list-transition-ms': `${FOLDER_LIST_TRANSITION_MS}ms`, + } as CSSProperties; + + const shellClasses = [ + 'shell', + space === 'mail' && !displayedMessageView ? 'shell--message-view-hidden' : '', + space === 'mail' && !displayedMessageList ? 'shell--message-list-hidden' : '', + maximized ? 'shell--message-view-maximized' : '', + folderListHidden ? 'shell--folder-list-hidden' : '', + space === 'contacts' ? 'shell--contacts' : '', + folderResize.active || columnResize.active ? 'shell--column-resizing' : '', + ].filter(Boolean).join(' '); + + const sidebarLabel = space === 'contacts' ? 'address book list' : 'folder list'; + const quickFilterPlaceholder = space === 'contacts' ? 'Filter contacts or identities' : 'Filter messages'; + const themeToggleLabel = theme === 'dark' ? 'Switch to light mode' : 'Switch to dark mode'; + + function setQuickFilter(next: string) { + if (next === useUiStore.getState().quickFilter) return; + if (space === 'mail' && useMailStore.getState().open.id != null) useMailStore.getState().selectMessage(null); + useUiStore.getState().setQuickFilter(next); + } + + return ( +
+
+
+ + Mail +
+
+ setQuickFilter(event.currentTarget.value)} + onChange={(event) => setQuickFilter(event.target.value)} + /> + {quickFilter.length === 0 ? : ( + + )} +
+
+ + + + + + + +
+
+ + useUiStore.getState().setSpace(next)} + onToggleFolderList={toggleFolderList} + /> + +
+ {space === 'mail' ? ( + + ) : ( +
+ )} +
+ +
+ + {space === 'mail' ? ( + <> + {displayedMessageList ? ( +
+ + {displayedMessageView ? ( +
+ ) : null} +
+ ) : null} + {displayedMessageView ? ( + setMaximized((value) => !value)} /> + ) : null} + + ) : ( +
+

Contacts are not part of this clone.

+
+ )} + + + +
+ ); +} diff --git a/suites-experimental/stormbox-react/src/assets/fonts/Inter/Inter-Bold.woff2 b/suites-experimental/stormbox-react/src/assets/fonts/Inter/Inter-Bold.woff2 new file mode 100644 index 000000000..2846f29cc Binary files /dev/null and b/suites-experimental/stormbox-react/src/assets/fonts/Inter/Inter-Bold.woff2 differ diff --git a/suites-experimental/stormbox-react/src/assets/fonts/Inter/Inter-Medium.woff2 b/suites-experimental/stormbox-react/src/assets/fonts/Inter/Inter-Medium.woff2 new file mode 100644 index 000000000..f92498a2e Binary files /dev/null and b/suites-experimental/stormbox-react/src/assets/fonts/Inter/Inter-Medium.woff2 differ diff --git a/suites-experimental/stormbox-react/src/assets/fonts/Inter/Inter-Regular.woff2 b/suites-experimental/stormbox-react/src/assets/fonts/Inter/Inter-Regular.woff2 new file mode 100644 index 000000000..6c2b6893d Binary files /dev/null and b/suites-experimental/stormbox-react/src/assets/fonts/Inter/Inter-Regular.woff2 differ diff --git a/suites-experimental/stormbox-react/src/assets/fonts/Inter/Inter-SemiBold.woff2 b/suites-experimental/stormbox-react/src/assets/fonts/Inter/Inter-SemiBold.woff2 new file mode 100644 index 000000000..611e90c95 Binary files /dev/null and b/suites-experimental/stormbox-react/src/assets/fonts/Inter/Inter-SemiBold.woff2 differ diff --git a/suites-experimental/stormbox-react/src/assets/fonts/Metropolis/Metropolis-Bold.woff2 b/suites-experimental/stormbox-react/src/assets/fonts/Metropolis/Metropolis-Bold.woff2 new file mode 100644 index 000000000..9648b0cb5 Binary files /dev/null and b/suites-experimental/stormbox-react/src/assets/fonts/Metropolis/Metropolis-Bold.woff2 differ diff --git a/suites-experimental/stormbox-react/src/assets/fonts/Metropolis/Metropolis-Light.woff2 b/suites-experimental/stormbox-react/src/assets/fonts/Metropolis/Metropolis-Light.woff2 new file mode 100644 index 000000000..f0ff6f346 Binary files /dev/null and b/suites-experimental/stormbox-react/src/assets/fonts/Metropolis/Metropolis-Light.woff2 differ diff --git a/suites-experimental/stormbox-react/src/assets/fonts/Metropolis/Metropolis-Regular.woff2 b/suites-experimental/stormbox-react/src/assets/fonts/Metropolis/Metropolis-Regular.woff2 new file mode 100644 index 000000000..f50bf3422 Binary files /dev/null and b/suites-experimental/stormbox-react/src/assets/fonts/Metropolis/Metropolis-Regular.woff2 differ diff --git a/suites-experimental/stormbox-react/src/assets/fonts/Metropolis/Metropolis-SemiBold.woff2 b/suites-experimental/stormbox-react/src/assets/fonts/Metropolis/Metropolis-SemiBold.woff2 new file mode 100644 index 000000000..fad6dfdec Binary files /dev/null and b/suites-experimental/stormbox-react/src/assets/fonts/Metropolis/Metropolis-SemiBold.woff2 differ diff --git a/suites-experimental/stormbox-react/src/assets/icons/app-tile-appointment.svg b/suites-experimental/stormbox-react/src/assets/icons/app-tile-appointment.svg new file mode 100644 index 000000000..63acc3f71 --- /dev/null +++ b/suites-experimental/stormbox-react/src/assets/icons/app-tile-appointment.svg @@ -0,0 +1,4 @@ + + + + diff --git a/suites-experimental/stormbox-react/src/assets/icons/app-tile-mail.svg b/suites-experimental/stormbox-react/src/assets/icons/app-tile-mail.svg new file mode 100644 index 000000000..64282e1bb --- /dev/null +++ b/suites-experimental/stormbox-react/src/assets/icons/app-tile-mail.svg @@ -0,0 +1,4 @@ + + + + diff --git a/suites-experimental/stormbox-react/src/assets/icons/app-tile-send.svg b/suites-experimental/stormbox-react/src/assets/icons/app-tile-send.svg new file mode 100644 index 000000000..87dfcb54c --- /dev/null +++ b/suites-experimental/stormbox-react/src/assets/icons/app-tile-send.svg @@ -0,0 +1,4 @@ + + + + diff --git a/suites-experimental/stormbox-react/src/assets/icons/tb-folder-archive.svg b/suites-experimental/stormbox-react/src/assets/icons/tb-folder-archive.svg new file mode 100644 index 000000000..a40b9f18a --- /dev/null +++ b/suites-experimental/stormbox-react/src/assets/icons/tb-folder-archive.svg @@ -0,0 +1,7 @@ + + + + + diff --git a/suites-experimental/stormbox-react/src/assets/icons/tb-folder-draft.svg b/suites-experimental/stormbox-react/src/assets/icons/tb-folder-draft.svg new file mode 100644 index 000000000..0814caa9b --- /dev/null +++ b/suites-experimental/stormbox-react/src/assets/icons/tb-folder-draft.svg @@ -0,0 +1,7 @@ + + + + + diff --git a/suites-experimental/stormbox-react/src/assets/icons/tb-folder-inbox.svg b/suites-experimental/stormbox-react/src/assets/icons/tb-folder-inbox.svg new file mode 100644 index 000000000..8a2153c19 --- /dev/null +++ b/suites-experimental/stormbox-react/src/assets/icons/tb-folder-inbox.svg @@ -0,0 +1,7 @@ + + + + + diff --git a/suites-experimental/stormbox-react/src/assets/icons/tb-folder-newsletter.svg b/suites-experimental/stormbox-react/src/assets/icons/tb-folder-newsletter.svg new file mode 100644 index 000000000..bbc88dfbf --- /dev/null +++ b/suites-experimental/stormbox-react/src/assets/icons/tb-folder-newsletter.svg @@ -0,0 +1,7 @@ + + + + + diff --git a/suites-experimental/stormbox-react/src/assets/icons/tb-folder-rss.svg b/suites-experimental/stormbox-react/src/assets/icons/tb-folder-rss.svg new file mode 100644 index 000000000..49e8085d7 --- /dev/null +++ b/suites-experimental/stormbox-react/src/assets/icons/tb-folder-rss.svg @@ -0,0 +1,7 @@ + + + + + diff --git a/suites-experimental/stormbox-react/src/assets/icons/tb-folder-scheduled.svg b/suites-experimental/stormbox-react/src/assets/icons/tb-folder-scheduled.svg new file mode 100644 index 000000000..504e685a2 --- /dev/null +++ b/suites-experimental/stormbox-react/src/assets/icons/tb-folder-scheduled.svg @@ -0,0 +1,4 @@ + + + + diff --git a/suites-experimental/stormbox-react/src/assets/icons/tb-folder-sent.svg b/suites-experimental/stormbox-react/src/assets/icons/tb-folder-sent.svg new file mode 100644 index 000000000..dd1615065 --- /dev/null +++ b/suites-experimental/stormbox-react/src/assets/icons/tb-folder-sent.svg @@ -0,0 +1,7 @@ + + + + + diff --git a/suites-experimental/stormbox-react/src/assets/icons/tb-folder-spam.svg b/suites-experimental/stormbox-react/src/assets/icons/tb-folder-spam.svg new file mode 100644 index 000000000..b15e1534e --- /dev/null +++ b/suites-experimental/stormbox-react/src/assets/icons/tb-folder-spam.svg @@ -0,0 +1,7 @@ + + + + + diff --git a/suites-experimental/stormbox-react/src/assets/icons/tb-folder-trash.svg b/suites-experimental/stormbox-react/src/assets/icons/tb-folder-trash.svg new file mode 100644 index 000000000..a82f19a87 --- /dev/null +++ b/suites-experimental/stormbox-react/src/assets/icons/tb-folder-trash.svg @@ -0,0 +1,7 @@ + + + + + diff --git a/suites-experimental/stormbox-react/src/assets/icons/tb-folder.svg b/suites-experimental/stormbox-react/src/assets/icons/tb-folder.svg new file mode 100644 index 000000000..330c912a3 --- /dev/null +++ b/suites-experimental/stormbox-react/src/assets/icons/tb-folder.svg @@ -0,0 +1,7 @@ + + + + + diff --git a/suites-experimental/stormbox-react/src/assets/icons/tb-forward.svg b/suites-experimental/stormbox-react/src/assets/icons/tb-forward.svg new file mode 100644 index 000000000..3525ee653 --- /dev/null +++ b/suites-experimental/stormbox-react/src/assets/icons/tb-forward.svg @@ -0,0 +1,7 @@ + + + + + diff --git a/suites-experimental/stormbox-react/src/assets/icons/tb-mail-glyph.svg b/suites-experimental/stormbox-react/src/assets/icons/tb-mail-glyph.svg new file mode 100644 index 000000000..8783516ab --- /dev/null +++ b/suites-experimental/stormbox-react/src/assets/icons/tb-mail-glyph.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/suites-experimental/stormbox-react/src/assets/icons/tb-reply-all.svg b/suites-experimental/stormbox-react/src/assets/icons/tb-reply-all.svg new file mode 100644 index 000000000..9431f02ec --- /dev/null +++ b/suites-experimental/stormbox-react/src/assets/icons/tb-reply-all.svg @@ -0,0 +1,7 @@ + + + + + diff --git a/suites-experimental/stormbox-react/src/assets/icons/tb-reply.svg b/suites-experimental/stormbox-react/src/assets/icons/tb-reply.svg new file mode 100644 index 000000000..d4f1d0c63 --- /dev/null +++ b/suites-experimental/stormbox-react/src/assets/icons/tb-reply.svg @@ -0,0 +1,7 @@ + + + + + diff --git a/suites-experimental/stormbox-react/src/assets/icons/tb-support.svg b/suites-experimental/stormbox-react/src/assets/icons/tb-support.svg new file mode 100644 index 000000000..5f4e4a10e --- /dev/null +++ b/suites-experimental/stormbox-react/src/assets/icons/tb-support.svg @@ -0,0 +1,7 @@ + + + + + diff --git a/suites-experimental/stormbox-react/src/clock.ts b/suites-experimental/stormbox-react/src/clock.ts new file mode 100644 index 000000000..e82683bc0 --- /dev/null +++ b/suites-experimental/stormbox-react/src/clock.ts @@ -0,0 +1,4 @@ +/** The mailbox clock and locale, fixed so every run renders identical text. */ +export const NOW = Date.UTC(2026, 9, 21, 15, 30); +export const LOCALE = 'en-US'; +export const TIME_ZONE = 'UTC'; diff --git a/suites-experimental/stormbox-react/src/components/Compose.tsx b/suites-experimental/stormbox-react/src/components/Compose.tsx new file mode 100644 index 000000000..3d0961fc4 --- /dev/null +++ b/suites-experimental/stormbox-react/src/components/Compose.tsx @@ -0,0 +1,349 @@ +import { + useCallback, useEffect, useMemo, useRef, useState, +} from 'react'; +import type { FocusEvent, KeyboardEvent, MouseEvent } from 'react'; +import { + Check, ChevronDown, Minus, Paperclip, Save, Send as SendIcon, Trash2, X, +} from 'lucide-react'; + +import { LOCALE, NOW, TIME_ZONE } from '../clock'; +import type { Identity } from '../data/mailbox'; +import { + RECIPIENT_FIELDS, isSessionMeaningfullyNonEmpty, isValidRecipient, sessionLabel, useComposeStore, + type ComposeSession, type RecipientEntry, type RecipientField, +} from '../store/compose-store'; +import { autocompleteContacts, browseContacts } from '../store/contacts'; +import { isComposingKeyEvent, matchesShortcut } from '../utils/keyboard'; +import { senderAvatarStyle, senderInitials } from '../utils/sender-avatar'; +import { + AppButton, AppDropdown, AppIconButton, MaximizeButton, closeContainingDropdown, +} from './base'; +import { RecipientInput } from './RecipientInput'; +import { RichTextEditor, type EditorContent, type RichTextEditorHandle } from './RichTextEditor'; + +const RECIPIENT_LABELS: Record = { to: 'To', cc: 'Cc', bcc: 'Bcc' }; + +interface SchedulePreset { + id: string; + label: string; + targetAt: number; +} + +/** Send Later presets relative to the mailbox clock (UTC). */ +function schedulePresets(): SchedulePreset[] { + const day = 86_400_000; + const startOfDay = Math.floor(NOW / day) * day; + const weekday = new Date(NOW).getUTCDay(); + const untilMonday = ((8 - weekday) % 7) || 7; + return [ + { id: 'later-today', label: 'Later today', targetAt: NOW + 3 * 3_600_000 }, + { id: 'tomorrow-morning', label: 'Tomorrow morning', targetAt: startOfDay + day + 8 * 3_600_000 }, + { id: 'tomorrow-afternoon', label: 'Tomorrow afternoon', targetAt: startOfDay + day + 13 * 3_600_000 }, + { id: 'monday-morning', label: 'Monday morning', targetAt: startOfDay + untilMonday * day + 8 * 3_600_000 }, + ]; +} + +function formatScheduleTarget(at: number): string { + return new Date(at).toLocaleString(LOCALE, { weekday: 'short', month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit', timeZone: TIME_ZONE }); +} + +function identityLabel(identity: Identity | undefined): string { + if (!identity) return ''; + return identity.name ? `${identity.name} <${identity.email}>` : identity.email; +} + +function ComposeDialog({ session }: { session: ComposeSession }) { + const compose = useComposeStore.getState; + const identities = useComposeStore((s) => s.identities); + const expanded = session.presentation === 'expanded'; + const [maximized, setMaximized] = useState(false); + const [showCc, setShowCc] = useState(session.draft.cc.length > 0); + const [showBcc, setShowBcc] = useState(session.draft.bcc.length > 0); + const [staged, setStaged] = useState(null); + const editorRef = useRef(null); + const dialogRef = useRef(null); + const closeMenuTriggerRef = useRef(null); + const { draft } = session; + const presets = useMemo(schedulePresets, []); + + const fieldId = (field: RecipientField) => (expanded ? `compose-${field}` : `compose-${session.id}-${field}`); + const titleId = expanded ? 'compose-title' : `compose-${session.id}-title`; + const fromLabelId = expanded ? 'compose-from-label' : `compose-${session.id}-from-label`; + const subjectId = expanded ? 'compose-subject' : `compose-${session.id}-subject`; + const nonEmpty = isSessionMeaningfullyNonEmpty(session); + const closeLabel = nonEmpty ? 'Close options' : 'Close'; + const fromIdentity = identities[draft.fromIdx]; + + // Writing starts in To for a fresh message, in the body for a reply. + useEffect(() => { + if (!expanded) return; + requestAnimationFrame(() => { + if (session.draft.to.length === 0) document.getElementById(fieldId('to'))?.focus(); + else editorRef.current?.focus(); + }); + // Runs when the session expands or a new draft epoch arrives. + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [expanded, session.id, session.draftEpoch]); + + const onEditorUpdate = useCallback((content: EditorContent) => { + compose().updateDraft(session.id, { html: content.html, text: content.text }); + }, [compose, session.id]); + + const setEntries = useCallback((field: RecipientField, entries: RecipientEntry[]) => { + compose().updateDraft(session.id, { [field]: entries }); + }, [compose, session.id]); + + function takenElsewhere(field: RecipientField): string[] { + return RECIPIENT_FIELDS.filter((other) => other !== field) + .flatMap((other) => draft[other].filter(isValidRecipient).map((address) => address.email)); + } + + function revealField(field: 'cc' | 'bcc') { + if (field === 'cc') setShowCc(true); + else setShowBcc(true); + requestAnimationFrame(() => document.getElementById(fieldId(field))?.focus()); + } + + function onRecipientFocusOut(field: RecipientField, event: FocusEvent) { + if (field === 'to') return; + const row = event.currentTarget; + const next = event.relatedTarget as Node | null; + if (next && row.contains(next)) return; + setTimeout(() => { + const current = useComposeStore.getState().sessions.find((s) => s.id === session.id); + if (!current || current.draft[field].length > 0) return; + if (field === 'cc') setShowCc(false); + else setShowBcc(false); + }); + } + + function send() { + compose().send(session.id, staged ? { targetAt: staged.targetAt, label: formatScheduleTarget(staged.targetAt) } : null); + } + + function onDialogKeyDown(event: KeyboardEvent) { + if (event.defaultPrevented || isComposingKeyEvent(event.nativeEvent)) return; + if (!matchesShortcut(event.nativeEvent, { key: 'Enter', mod: true })) return; + event.preventDefault(); + if (session.closePromptOpen) return; + send(); + } + + const visibleFields: RecipientField[] = ['to', ...(showCc ? ['cc' as const] : []), ...(showBcc ? ['bcc' as const] : [])]; + + return ( +
+
+
+

{draft.subject || 'New Message'}

+
+ compose().minimize(session.id)}> + + setMaximized((value) => !value)} /> + + { + if (nonEmpty) return; + event.preventDefault(); + compose().close(session.id); + }} + > + +
+ + +
+
+
+
+ +
+
+ + + + {fromIdentity ? ( + + ) : null} + {identityLabel(fromIdentity)} + +
+ {identities.map((identity, idx) => ( + + ))} +
+
+
+ + {visibleFields.map((field) => ( +
onRecipientFocusOut(field, event)}> + + setEntries(field, entries)} + /> + {field === 'to' ? ( +
+ {!showCc ? : null} + {!showBcc ? : null} +
+ ) : null} +
+ ))} + +
+ + compose().updateDraft(session.id, { subject: event.currentTarget.value })} + onChange={(event) => compose().updateDraft(session.id, { subject: event.target.value })} + /> +
+ + + +
+ +
+ + + + {staged ? {staged.label} : null} + +
+ {staged ? ( + <> + +
+ + ) : null} + {presets.map((preset) => ( + + ))} +
+ +
+
+
+ + {session.closePromptOpen ? ( +
+
+

Save this draft?

+

Save your latest changes before closing this compose window.

+
+ compose().cancelClose(session.id)}>Cancel + compose().closeWithoutSaving(session.id)}>Don't Save + compose().saveAndClose(session.id)}>Save draft +
+
+
+ ) : null} +
+
+ ); +} + +export function ComposeManager() { + const sessions = useComposeStore((s) => s.sessions); + const minimized = sessions.filter((session) => session.presentation === 'minimized'); + const compose = useComposeStore.getState; + return ( + <> + {sessions.map((session) => )} + {minimized.length > 0 ? ( +
+ {minimized.map((session) => ( +
+ + +
+ ))} +
+ ) : null} + + ); +} diff --git a/suites-experimental/stormbox-react/src/components/FolderTree.tsx b/suites-experimental/stormbox-react/src/components/FolderTree.tsx new file mode 100644 index 000000000..d6d11c448 --- /dev/null +++ b/suites-experimental/stormbox-react/src/components/FolderTree.tsx @@ -0,0 +1,291 @@ +import { memo, useCallback, useMemo, useState } from 'react'; +import type { CSSProperties, DragEvent } from 'react'; +import { Settings2, Star } from 'lucide-react'; + +import { DEFAULT_MESSAGE_TAGS } from '../utils/message-tags'; +import { + folderBadgeCount, folderCompare, folderPresentation, isMainFolder, +} from '../utils/folder-presentation'; +import type { Folder, ViewId } from '../types'; +import { + STARRED_KEYWORD, folderCounts, isTagViewId, tagViewIdFor, tagViewKeyword, useMailStore, +} from '../store/mail-store'; +import { readMessageDrag, useMessageDrag } from '../hooks/useMessageDrag'; + +interface TreeNode extends Folder { + depth: number; + icon: string; + tone: string; + children: TreeNode[]; + unread_emails: number; + total_emails: number; + subtree_unread: number; +} + +function buildTree(folders: Folder[], unread: Map, total: Map): TreeNode[] { + const byId = new Map(folders.map((folder) => [folder.id, folder])); + const byParent = new Map(); + for (const folder of folders) { + const parent = folder.parent_id != null ? byId.get(folder.parent_id) : null; + const promotedByStar = folder.is_starred === 1 && parent != null; + const key = parent != null && !promotedByStar ? folder.parent_id! : 'ROOT'; + if (!byParent.has(key)) byParent.set(key, []); + byParent.get(key)!.push(folder); + } + for (const list of byParent.values()) list.sort(folderCompare); + function build(folder: Folder, depth: number): TreeNode { + const presentation = folderPresentation(folder); + const unreadCount = unread.get(folder.id) ?? 0; + const totalCount = total.get(folder.id) ?? 0; + const children = (byParent.get(folder.id) ?? []).map((child) => build(child, depth + 1)); + const own = folderBadgeCount({ role: folder.role, unread_emails: unreadCount, total_emails: totalCount }); + return { + ...folder, + depth, + icon: presentation.icon, + tone: presentation.color, + children, + unread_emails: unreadCount, + total_emails: totalCount, + subtree_unread: children.reduce((sum, child) => sum + child.subtree_unread, own), + }; + } + return (byParent.get('ROOT') ?? []).map((folder) => build(folder, 0)); +} + +type DropState = 'move' | 'invalid' | null; + +interface FolderNodeProps { + folder: TreeNode; + current: ViewId; + expanded: Set; + dragOverId: number | null; + dragging: boolean; + dragSourceId: ViewId | null; + onPick: (id: number) => void; + onToggle: (id: number) => void; + onDragTarget: (id: number | null) => void; + onDropOn: (id: number, event: DragEvent) => void; +} + +const FolderNode = memo(function FolderNode({ + folder, current, expanded, dragOverId, dragging, dragSourceId, onPick, onToggle, onDragTarget, onDropOn, +}: FolderNodeProps) { + const hasChildren = folder.children.length > 0; + const collapsed = hasChildren && !expanded.has(folder.id); + const unread = collapsed + ? folder.subtree_unread + : folderBadgeCount({ role: folder.role, unread_emails: folder.unread_emails, total_emails: folder.total_emails }); + const dropState: DropState = dragging && dragOverId === folder.id + ? (dragSourceId === folder.id ? 'invalid' : 'move') + : null; + const style = { + paddingLeft: `${10 + folder.depth * 16}px`, + '--folder-tone': folder.tone, + } as CSSProperties; + const classes = [ + 'folder-node', + current === folder.id ? 'is-current' : '', + folder.tone ? 'has-tone' : '', + dropState === 'move' ? 'is-drop-valid' : '', + dropState === 'invalid' ? 'is-drop-invalid' : '', + ].filter(Boolean).join(' '); + return ( + <> +
{ event.preventDefault(); onDragTarget(folder.id); }} + onDragOver={(event) => { + event.preventDefault(); + event.dataTransfer.dropEffect = dragSourceId === folder.id ? 'none' : 'move'; + }} + onDragLeave={(event) => { + if (event.currentTarget.contains(event.relatedTarget as Node | null)) return; + if (dragOverId === folder.id) onDragTarget(null); + }} + onDrop={(event) => onDropOn(folder.id, event)} + > + {hasChildren ? ( + + ) : ( +
+ {hasChildren && !collapsed ? folder.children.map((child) => ( + + )) : null} + + ); +}); + +function TagViewNode({ + keyword, name, color, count, current, dropActive, onPick, onDragTarget, onDropOn, +}: { + keyword: string; + name: string; + color: string | null; + count: number; + current: boolean; + dropActive: boolean; + onPick: (keyword: string) => void; + onDragTarget: (keyword: string | null) => void; + onDropOn: (keyword: string, event: DragEvent) => void; +}) { + return ( +
{ event.preventDefault(); onDragTarget(keyword); }} + onDragOver={(event) => { event.preventDefault(); event.dataTransfer.dropEffect = 'copy'; }} + onDragLeave={(event) => { + if (event.currentTarget.contains(event.relatedTarget as Node | null)) return; + onDragTarget(null); + }} + onDrop={(event) => onDropOn(keyword, event)} + > + +
+ ); +} + +export function FolderTree() { + const folders = useMailStore((s) => s.folders); + const messages = useMailStore((s) => s.messages); + const current = useMailStore((s) => s.currentViewId); + const selectFolder = useMailStore((s) => s.selectFolder); + const { dragging, sourceViewId, endDrag } = useMessageDrag(); + const [expanded, setExpanded] = useState>(() => new Set()); + const [dragOverId, setDragOverId] = useState(null); + const [dragOverTag, setDragOverTag] = useState(null); + + const counts = folderCounts({ messages }); + const tree = useMemo(() => buildTree(folders, counts.unread, counts.total), [folders, counts]); + const mainFolders = tree.filter(isMainFolder); + const userFolders = tree.filter((folder) => !isMainFolder(folder)); + const starred = userFolders.filter((folder) => folder.is_starred === 1); + const unstarred = userFolders.filter((folder) => folder.is_starred !== 1); + + const onToggle = useCallback((id: number) => { + setExpanded((previous) => { + const next = new Set(previous); + if (next.has(id)) next.delete(id); + else next.add(id); + return next; + }); + }, []); + + const onDropOn = useCallback((id: number, event: DragEvent) => { + event.preventDefault(); + setDragOverId(null); + const payload = readMessageDrag(event); + if (payload && payload.ids.length > 0 && payload.sourceViewId !== id) { + useMailStore.getState().moveMessages(payload.ids, id); + } + endDrag(); + }, [endDrag]); + + const onTagDrop = useCallback((keyword: string, event: DragEvent) => { + event.preventDefault(); + setDragOverTag(null); + const payload = readMessageDrag(event); + if (payload && payload.ids.length > 0) { + const store = useMailStore.getState(); + if (keyword === STARRED_KEYWORD) store.markManyFlagged(payload.ids, true); + else store.setTagsMany(payload.ids, { add: [keyword] }); + } + endDrag(); + }, [endDrag]); + + const pickTag = useCallback((keyword: string) => selectFolder(tagViewIdFor(keyword)), [selectFolder]); + + const tagRows = [ + { keyword: STARRED_KEYWORD, name: 'Starred', color: null as string | null }, + ...DEFAULT_MESSAGE_TAGS.map((tag) => ({ keyword: tag.keyword.toLowerCase(), name: tag.name, color: tag.color as string | null })), + ]; + const currentTag = isTagViewId(current) ? tagViewKeyword(current) : null; + + const nodeProps = { + current, expanded, dragOverId, dragging, dragSourceId: sourceViewId, onPick: selectFolder, onToggle, onDragTarget: setDragOverId, onDropOn, + }; + + return ( + + ); +} diff --git a/suites-experimental/stormbox-react/src/components/ListHeader.tsx b/suites-experimental/stormbox-react/src/components/ListHeader.tsx new file mode 100644 index 000000000..71942c49f --- /dev/null +++ b/suites-experimental/stormbox-react/src/components/ListHeader.tsx @@ -0,0 +1,302 @@ +import { useEffect, useRef } from 'react'; +import type { ComponentType, ReactNode } from 'react'; +import { + Ellipsis, Mail, MailOpen, Star, Tag, Trash2, X, +} from 'lucide-react'; + +import archiveIcon from '../assets/icons/tb-folder-archive.svg?raw'; +import junkIcon from '../assets/icons/tb-folder-spam.svg?raw'; +import type { Folder } from '../types'; +import { AppDropdown, closeContainingDropdown, menuKeyDown } from './base'; + +type IconComponent = ComponentType<{ size?: number; strokeWidth?: number; fill?: string }>; + +export type BulkActionId = + | 'whitelist' | 'archive' | 'junk' | 'delete' | 'cancel-send' | 'toggle-star' | 'tag' | 'mark-read' | 'mark-unread'; + +export interface BulkActionItem { + id: BulkActionId; + label: string; + title: string; + ariaLabel: string; + icon: IconComponent | null; + rawIcon?: string; + variant: 'default' | 'danger' | 'star' | 'whitelist' | 'tag'; + pressed?: boolean; + disabled?: boolean; + slots: number; + overflowRank: number | null; + run: () => void; +} + +export interface BulkActionHandlers { + archive: () => void; + junk: () => void; + delete: () => void; + cancelSend: () => void; + toggleStar: () => void; + tag: () => void; + markRead: () => void; + markUnread: () => void; + whitelist: () => void; +} + +/** The bulk actions for a checkbox selection, in display order (see Stormbox useBulkActionItems). */ +export function bulkActionItems({ + folder, anyStarred, anyScheduled, handlers, +}: { + folder: Folder | null; + anyStarred: boolean; + anyScheduled: boolean; + handlers: BulkActionHandlers; +}): BulkActionItem[] { + const role = folder?.role; + const items: BulkActionItem[] = []; + if (role === 'junk') { + items.push({ + id: 'whitelist', label: 'Not junk', title: 'Whitelist senders and move to Inbox', + ariaLabel: 'Not junk — whitelist senders and move the selected messages to Inbox', + icon: null, variant: 'whitelist', slots: 3, overflowRank: 6, run: handlers.whitelist, + }); + } + if (!anyScheduled && role !== 'archive') { + items.push({ + id: 'archive', label: 'Archive', title: 'Archive', ariaLabel: 'Archive', icon: null, rawIcon: archiveIcon, + variant: 'default', slots: 1, overflowRank: 5, run: handlers.archive, + }); + } + if (!anyScheduled && role !== 'junk') { + items.push({ + id: 'junk', label: 'Mark as junk', title: 'Junk', ariaLabel: 'Mark as junk', icon: null, rawIcon: junkIcon, + variant: 'default', slots: 1, overflowRank: 2, run: handlers.junk, + }); + } + if (anyScheduled) { + items.push({ + id: 'cancel-send', label: 'Cancel send', title: 'Cancel send', + ariaLabel: 'Cancel send — return the selected messages to Drafts', + icon: Trash2, variant: 'danger', slots: 1, overflowRank: null, run: handlers.cancelSend, + }); + } else { + items.push({ + id: 'delete', label: 'Delete', title: 'Delete', ariaLabel: 'Delete', icon: Trash2, + variant: 'danger', slots: 1, overflowRank: null, run: handlers.delete, + }); + items.push({ + id: 'toggle-star', label: anyStarred ? 'Unstar' : 'Star', title: anyStarred ? 'Unstar' : 'Star', + ariaLabel: anyStarred ? 'Unstar' : 'Star', icon: Star, variant: 'star', pressed: anyStarred, + slots: 1, overflowRank: 4, run: handlers.toggleStar, + }); + items.push({ + id: 'tag', label: 'Tag…', title: 'Tag', ariaLabel: 'Tag selected messages', icon: Tag, + variant: 'tag', slots: 1, overflowRank: 3, run: handlers.tag, + }); + } + items.push({ + id: 'mark-read', label: 'Mark as read', title: 'Mark as read', ariaLabel: 'Mark as read', icon: MailOpen, + variant: 'default', slots: 1, overflowRank: 1, run: handlers.markRead, + }); + items.push({ + id: 'mark-unread', label: 'Mark as unread', title: 'Mark as unread', ariaLabel: 'Mark as unread', icon: Mail, + variant: 'default', slots: 1, overflowRank: 0, run: handlers.markUnread, + }); + return items; +} + +/** Keep actions by descending overflow rank while they fit `capacity` slots. */ +export function splitBulkActions(items: readonly BulkActionItem[], capacity: number | null) { + if (capacity == null) return { inline: [...items], overflow: [] as BulkActionItem[] }; + const inline = new Set(); + let used = 0; + for (const item of items) { + if (item.overflowRank === null) { + inline.add(item); + used += item.slots; + } + } + const candidates = items.filter((item) => item.overflowRank !== null).sort((a, b) => (b.overflowRank ?? 0) - (a.overflowRank ?? 0)); + for (const item of candidates) { + if (used + item.slots > capacity) continue; + inline.add(item); + used += item.slots; + } + return { inline: items.filter((item) => inline.has(item)), overflow: items.filter((item) => !inline.has(item)) }; +} + +export function MessageBulkActions({ items, renderTag }: { items: readonly BulkActionItem[]; renderTag: (item: BulkActionItem) => ReactNode }) { + return ( + <> + {items.map((item) => { + if (item.variant === 'tag') return {renderTag(item)}; + const Icon = item.icon; + return ( + + ); + })} + + ); +} + +export interface MoreMenuItem { + id: string; + label: string; + icon?: IconComponent | null; + rawIcon?: string; + disabled?: boolean; + danger?: boolean; + run: () => void; +} + +export interface MoreMenuGroup { + id: string; + label?: string; + items: MoreMenuItem[]; +} + +const MORE_ITEM_SELECTOR = '[role="menuitem"]:not([aria-disabled="true"])'; + +export function MessageListMoreMenu({ groups, label = 'More actions' }: { groups: MoreMenuGroup[]; label?: string }) { + const triggerRef = useRef(null); + const menuRef = useRef(null); + return ( + { + if (event.currentTarget.open) { + requestAnimationFrame(() => menuRef.current?.querySelector(MORE_ITEM_SELECTOR)?.focus()); + } + }} + > + + +
menuKeyDown(menuRef.current, MORE_ITEM_SELECTOR, event)}> + {groups.map((group, index) => ( +
+ {index > 0 ?
: null} +
+ {group.label ? : null} + {group.items.map((item) => { + const Icon = item.icon; + return ( + + ); + })} +
+
+ ))} +
+ + ); +} + +export function SelectableListHeader({ + className, allSelected, disabled, itemLabel, singularItemLabel, selectedCount, showTotalCount, totalCount, headerTier, + onClearSelection, onToggleAll, selectionActions, normalActions, trailing, +}: { + className?: string; + allSelected: boolean; + disabled: boolean; + itemLabel: string; + singularItemLabel: string; + selectedCount: number; + showTotalCount: boolean; + totalCount: number; + headerTier: string; + onClearSelection: () => void; + onToggleAll: () => void; + selectionActions: ReactNode; + normalActions: ReactNode; + trailing: ReactNode; +}) { + const selectAllRef = useRef(null); + const indeterminate = selectedCount > 0 && !allSelected; + useEffect(() => { + if (selectAllRef.current) selectAllRef.current.indeterminate = indeterminate; + }, [indeterminate]); + const empty = disabled || totalCount === 0; + return ( +
+ + {selectedCount > 0 ? ( +
+ {selectionActions} + +
+ ) : ( +
{normalActions}
+ )} + + {selectedCount > 0 + ? `${selectedCount} selected` + : (showTotalCount && totalCount > 0 ? `${totalCount} ${totalCount === 1 ? singularItemLabel : itemLabel}` : null)} + + {trailing} +
+ ); +} diff --git a/suites-experimental/stormbox-react/src/components/MessageList.tsx b/suites-experimental/stormbox-react/src/components/MessageList.tsx new file mode 100644 index 000000000..7d9d48335 --- /dev/null +++ b/suites-experimental/stormbox-react/src/components/MessageList.tsx @@ -0,0 +1,734 @@ +import { + useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, +} from 'react'; +import type { DragEvent, KeyboardEvent, MouseEvent } from 'react'; +import { useVirtualizer } from '@tanstack/react-virtual'; +import { Circle, RefreshCw, Star } from 'lucide-react'; + +import type { JmapViewSort, Message, ViewId } from '../types'; +import { + folderById, isTagViewId, tagViewKeyword, useMailStore, viewRows, +} from '../store/mail-store'; +import { readMessageDrag, useMessageDrag } from '../hooks/useMessageDrag'; +import { DEFAULT_MESSAGE_TAGS } from '../utils/message-tags'; +import { folderShowsRecipients } from '../utils/message-row-presentation'; +import { messageMatchesQuickFilter, normalizeFilterText } from '../utils/quick-filter'; +import { MessageListRow, type RowHandlers } from './MessageListRow'; +import { + MessageBulkActions, MessageListMoreMenu, SelectableListHeader, bulkActionItems, splitBulkActions, + type MoreMenuGroup, +} from './ListHeader'; +import { TagPickerDropdown, TagPickerPopover, type PopoverAnchor } from './Tags'; +import { registerListCommands, type ListNavigationCommand } from '../hooks/useShortcuts'; + +const CARD_LAYOUT_WIDTH = 480; +const ROW_HEIGHT = 64; +const CARD_ROW_HEIGHT = 96; +const HEADER_COUNT_MIN_WIDTH = 520; +const HEADER_FILTER_LABELS_MIN_WIDTH = 440; +const HEADER_INLINE_CONTROLS_MIN_WIDTH = 340; +const BULK_ROW_FIXED_WIDTH = 232; +const BULK_ACTION_SLOT_WIDTH = 38; +const ROW_DOM_ID_PREFIX = 'msg-row-'; +const GRID_ID = 'msg-listbox'; + +const EMPTY_SELECTION: Set = new Set(); +const TAG_DEFINITIONS = DEFAULT_MESSAGE_TAGS; + +/** Scroll position per view, kept across folder switches for the page's lifetime. */ +const scrollTops = new Map(); + +function sortForFolder(role: string | null | undefined): JmapViewSort { + return role === 'sent' || role === 'drafts' || role === 'scheduled' ? 'sent' : 'received'; +} + +interface TagPopoverState { + ids: number[]; + targets: Message[]; + anchor: PopoverAnchor; + trigger: HTMLElement | null; + returnFocus: HTMLElement | null; +} + +function anchorOf(element: Element | null | undefined): PopoverAnchor | null { + if (!element || element.getClientRects().length === 0) return null; + const rect = element.getBoundingClientRect(); + return { top: rect.top, left: rect.left, width: rect.width, height: rect.height }; +} + +export function MessageList({ quickFilterQuery }: { quickFilterQuery: string }) { + const viewId = useMailStore((s) => s.currentViewId); + const folders = useMailStore((s) => s.folders); + const messages = useMailStore((s) => s.messages); + const folderIds = useMailStore((s) => s.folderIds); + const selection = useMailStore((s) => s.selection); + const focused = useMailStore((s) => s.focused); + const open = useMailStore((s) => s.open); + const folderPickCount = useMailStore((s) => s.folderPickCount); + const draggedIds = useMessageDrag((s) => s.draggedIds); + + const folder = folderById({ folders }, viewId); + const isTagView = isTagViewId(viewId); + const folderName = isTagView + ? (TAG_DEFINITIONS.find((tag) => tag.keyword === tagViewKeyword(viewId))?.name ?? 'Starred') + : (folder?.name ?? 'Mail'); + const regionLabel = `${folderName} messages, column 1`; + + const rows = viewRows({ messages, folderIds }, viewId); + const selectedIds = selection.viewId === viewId ? selection.ids : EMPTY_SELECTION; + const focusedMessageId = focused.viewId === viewId ? focused.id : null; + const openMessageId = open.viewId === viewId ? open.id : null; + + // ----- dense local filters (Unread, Starred, Quick Filter) --------------- + const [unreadOnly, setUnreadOnly] = useState(false); + const [flaggedOnly, setFlaggedOnly] = useState(false); + const needle = normalizeFilterText(quickFilterQuery); + const quickFilterActive = needle.length > 0; + const denseFilterActive = unreadOnly || flaggedOnly || quickFilterActive; + + const passes = useCallback((row: Message, includeSticky: boolean) => { + if (includeSticky && (row.id === openMessageId || selectedIds.has(row.id))) return true; + if (unreadOnly && row.is_seen !== 0) return false; + if (flaggedOnly && row.is_flagged !== 1) return false; + if (quickFilterActive && !messageMatchesQuickFilter(row, needle)) return false; + return true; + }, [openMessageId, selectedIds, unreadOnly, flaggedOnly, quickFilterActive, needle]); + + const visibleMessages = useMemo( + () => (denseFilterActive ? rows.filter((row) => passes(row, true)) : rows), + [rows, denseFilterActive, passes], + ); + const selectAllTargets = useMemo( + () => (denseFilterActive ? rows.filter((row) => passes(row, false)) : rows), + [rows, denseFilterActive, passes], + ); + const rowCount = visibleMessages.length; + + function closeOpenMessageIfFilteredOut(next: { unread: boolean; flagged: boolean; needle: string }) { + if (openMessageId == null) return; + const row = rows.find((candidate) => candidate.id === openMessageId); + const ok = row + && !(next.unread && row.is_seen !== 0) + && !(next.flagged && row.is_flagged !== 1) + && !(next.needle && !messageMatchesQuickFilter(row, next.needle)); + if (!ok) useMailStore.getState().selectMessage(null); + } + + const previousNeedle = useRef(needle); + useEffect(() => { + if (previousNeedle.current !== needle) { + previousNeedle.current = needle; + closeOpenMessageIfFilteredOut({ unread: unreadOnly, flagged: flaggedOnly, needle }); + } + // Runs only when the quick filter text changes. + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [needle]); + + // ----- selection (Fastmail/Overture anchored model) ---------------------- + const anchorRef = useRef(-1); + const selectionCount = selectedIds.size; + const hasSelection = selectionCount > 0; + + const writeSelection = useCallback((ids: Set) => { + useMailStore.getState().setSelection(viewId, ids); + }, [viewId]); + + const setFocused = useCallback((index: number): number | null => { + const row = visibleMessages[index]; + if (!row) return null; + useMailStore.getState().setFocusedMessage(row.id, viewId); + return row.id; + }, [visibleMessages, viewId]); + + const toggleAt = useCallback((index: number) => { + const row = visibleMessages[index]; + if (!row) return; + const next = new Set(selectedIds); + if (next.has(row.id)) next.delete(row.id); + else next.add(row.id); + anchorRef.current = index; + writeSelection(next); + }, [visibleMessages, selectedIds, writeSelection]); + + const extendRange = useCallback((index: number, fallbackAnchor = index) => { + if (index < 0 || index >= visibleMessages.length) return; + const hadAnchor = anchorRef.current >= 0; + const anchor = hadAnchor ? anchorRef.current : Math.max(0, Math.min(visibleMessages.length - 1, fallbackAnchor)); + const lo = Math.min(index, anchor); + const hi = Math.max(index, anchor); + const next = new Set(); + for (let i = lo; i <= hi; i += 1) next.add(visibleMessages[i].id); + writeSelection(next); + if (!hadAnchor) anchorRef.current = anchor; + }, [visibleMessages, writeSelection]); + + const selectNone = useCallback(() => { + if (selectedIds.size > 0) writeSelection(new Set()); + anchorRef.current = -1; + }, [selectedIds, writeSelection]); + + const openMessage = useCallback((id: number | null) => { + useMailStore.getState().selectMessage(id, id == null ? undefined : viewId); + }, [viewId]); + + const selectAllForCurrentFilter = useCallback(() => { + const next = new Set(); + for (const row of selectAllTargets) next.add(row.id); + writeSelection(next); + if (next.size > 0) anchorRef.current = 0; + }, [selectAllTargets, writeSelection]); + + const allLoadedSelected = selectAllTargets.length > 0 && selectAllTargets.every((row) => selectedIds.has(row.id)); + + // ----- viewport ---------------------------------------------------------- + const listRef = useRef(null); + const scrollRef = useRef(null); + const [listWidth, setListWidth] = useState(0); + const cardLayout = listWidth > 0 && listWidth < CARD_LAYOUT_WIDTH; + + useLayoutEffect(() => { + const el = listRef.current; + if (!el) return undefined; + setListWidth(el.clientWidth); + const observer = new ResizeObserver(([entry]) => setListWidth(entry.contentRect.width)); + observer.observe(el); + return () => observer.disconnect(); + }, []); + + const virtualizer = useVirtualizer({ + count: rowCount, + getScrollElement: () => scrollRef.current, + estimateSize: () => (cardLayout ? CARD_ROW_HEIGHT : ROW_HEIGHT), + overscan: 8, + getItemKey: (index) => visibleMessages[index]?.id ?? `_ph_${index}`, + }); + + useLayoutEffect(() => { + virtualizer.measure(); + }, [cardLayout, virtualizer]); + + const scrollWriteScheduled = useRef(false); + const onScroll = useCallback(() => { + if (scrollWriteScheduled.current) return; + scrollWriteScheduled.current = true; + requestAnimationFrame(() => { + scrollWriteScheduled.current = false; + if (scrollRef.current) scrollTops.set(viewId, scrollRef.current.scrollTop); + }); + }, [viewId]); + + // A folder change restores that folder's scroll position; re-picking the + // current folder scrolls it back to the top. + const lastView = useRef<{ viewId: ViewId; pick: number } | null>(null); + useLayoutEffect(() => { + const previous = lastView.current; + lastView.current = { viewId, pick: folderPickCount }; + if (previous && previous.viewId === viewId && previous.pick === folderPickCount) return; + virtualizer.measure(); + const el = scrollRef.current; + if (previous && previous.viewId === viewId) { + scrollTops.set(viewId, 0); + if (el) el.scrollTop = 0; + return; + } + if (el) el.scrollTop = scrollTops.get(viewId) ?? 0; + }, [viewId, folderPickCount, virtualizer]); + + // Every path that moves the cursor funnels through the store's focused id. + useEffect(() => { + if (focusedMessageId == null || !scrollRef.current) return; + const index = visibleMessages.findIndex((row) => row.id === focusedMessageId); + if (index >= 0) virtualizer.scrollToIndex(index, { align: 'auto' }); + // Follows the cursor only, not every row change. + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [focusedMessageId]); + + const virtualItems = virtualizer.getVirtualItems(); + const firstVisibleIndex = () => virtualItems[0]?.index ?? 0; + + // ----- header tiers ------------------------------------------------------- + const measured = listWidth > 0; + const showsCount = !measured || listWidth >= HEADER_COUNT_MIN_WIDTH; + const filterLabels = !measured || listWidth >= HEADER_FILTER_LABELS_MIN_WIDTH; + const inlineControls = !hasSelection && (!measured || listWidth >= HEADER_INLINE_CONTROLS_MIN_WIDTH); + const headerTier = !inlineControls && !hasSelection ? 'compact' : !filterLabels ? 'icon-filters' : !showsCount ? 'no-count' : 'full'; + const bulkCapacity = measured + ? Math.max(1, Math.floor((listWidth - BULK_ROW_FIXED_WIDTH) / BULK_ACTION_SLOT_WIDTH)) + : null; + + // ----- actions ------------------------------------------------------------ + const store = useMailStore.getState; + const selectedRows = useMemo(() => rows.filter((row) => selectedIds.has(row.id)), [rows, selectedIds]); + const anyStarred = selectedRows.some((row) => row.is_flagged === 1); + const anyScheduled = selectedRows.some((row) => row.scheduled_undo_status === 'pending'); + const selectedList = () => [...selectedIds]; + + const [tagPopover, setTagPopover] = useState(null); + + const closeTagPopover = useCallback(() => { + setTagPopover(null); + }, []); + + const openBulkTagPicker = useCallback(() => { + const trigger = listRef.current?.querySelector('[data-more-menu]') + ?? listRef.current?.querySelector('.msg-list__header') ?? null; + const anchor = anchorOf(trigger); + if (!anchor) return; + setTagPopover({ ids: [...selectedIds], targets: selectedRows, anchor, trigger, returnFocus: trigger }); + }, [selectedIds, selectedRows]); + + const items = bulkActionItems({ + folder, + anyStarred, + anyScheduled, + handlers: { + archive: () => store().archiveMessages(selectedList()), + junk: () => store().junkMessages(selectedList()), + delete: () => store().destroyMessages(selectedList()), + cancelSend: () => selectedRows.filter((row) => row.scheduled_undo_status === 'pending').forEach((row) => store().cancelScheduledSend(row.id)), + toggleStar: () => store().toggleManyFlagged(selectedList()), + tag: openBulkTagPicker, + markRead: () => store().markManySeen(selectedList(), true), + markUnread: () => store().markManySeen(selectedList(), false), + whitelist: () => store().notJunk(selectedList()), + }, + }); + const bulkActions = splitBulkActions(items, bulkCapacity); + + const refresh = useCallback(() => {}, []); + + const moreMenuGroups: MoreMenuGroup[] = []; + if (hasSelection && bulkActions.overflow.length > 0) { + moreMenuGroups.push({ + id: 'selection', + items: bulkActions.overflow.map((item) => ({ + id: item.id, label: item.label, icon: item.icon, rawIcon: item.rawIcon, disabled: item.disabled, danger: item.variant === 'danger', run: item.run, + })), + }); + } + if (!inlineControls) { + moreMenuGroups.push({ + id: 'column', + label: hasSelection ? folderName : undefined, + items: [{ id: 'refresh', label: 'Refresh', icon: RefreshCw, run: refresh }], + }); + } + + // ----- navigation ----------------------------------------------------------- + const navigate = useCallback((command: ListNavigationCommand) => { + const list = visibleMessages; + if (list.length === 0) return; + if (command === 'first') { openMessage(list[0].id); return; } + if (command === 'last') { openMessage(list[list.length - 1].id); return; } + const direction = command === 'next' || command === 'nextUnread' ? 1 : -1; + const unread = command === 'nextUnread' || command === 'previousUnread'; + let index = focusedMessageId == null ? -1 : list.findIndex((row) => row.id === focusedMessageId); + if (index < 0) index = direction > 0 ? -1 : list.length; + for (let next = index + direction; next >= 0 && next < list.length; next += direction) { + if (unread && list[next].is_seen === 1) continue; + openMessage(list[next].id); + return; + } + }, [visibleMessages, focusedMessageId, openMessage]); + + const openTagMenuForTargets = useCallback(() => { + if (selectedIds.size > 0) { + const inline = listRef.current?.querySelector('[data-tag-picker-trigger]'); + const details = inline?.closest('details'); + if (details) { + details.open = true; + return; + } + openBulkTagPicker(); + return; + } + if (openMessageId == null) return; + const row = rows.find((candidate) => candidate.id === openMessageId); + if (!row || row.scheduled_undo_status === 'pending') return; + const trigger = document.getElementById(`${ROW_DOM_ID_PREFIX}${openMessageId}`)?.querySelector('.msg-list__action--tag') ?? null; + const anchor = anchorOf(trigger) ?? anchorOf(listRef.current?.querySelector('.msg-list__header')); + if (!anchor) return; + setTagPopover({ ids: [openMessageId], targets: [row], anchor, trigger, returnFocus: scrollRef.current }); + }, [selectedIds, openMessageId, rows, openBulkTagPicker]); + + useEffect(() => registerListCommands({ + navigate, + selectAll: selectAllForCurrentFilter, + openTagMenu: openTagMenuForTargets, + containsFocus: () => listRef.current?.contains(document.activeElement) === true, + }), [navigate, selectAllForCurrentFilter, openTagMenuForTargets]); + + function rowControls(row: Element): HTMLElement[] { + return [...row.querySelectorAll('[data-message-control]')] + .filter((control) => getComputedStyle(control).display !== 'none' && getComputedStyle(control).visibility !== 'hidden') + .sort((a, b) => Number(b.matches('input')) - Number(a.matches('input'))); + } + + function handleKeyDown(event: KeyboardEvent) { + if (event.defaultPrevented) return; + if ((event.metaKey || event.ctrlKey) && (event.key === 'a' || event.key === 'A')) { + event.preventDefault(); + selectAllForCurrentFilter(); + return; + } + if (event.altKey || event.metaKey || event.ctrlKey) return; + const target = event.target instanceof Element ? event.target : null; + const control = target?.closest('[data-message-control]') ?? null; + const row = control?.closest('[role="row"]') ?? null; + if (control && row) { + if (event.key === 'Tab') { + scrollRef.current?.focus({ preventScroll: true }); + return; + } + if (event.key === 'Escape' || event.key === 'F2') { + event.preventDefault(); + setFocused(Number(row.dataset.index)); + scrollRef.current?.focus({ preventScroll: true }); + return; + } + if (['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key)) { + event.preventDefault(); + const controls = rowControls(row); + const index = controls.indexOf(control); + const next = event.key === 'Home' ? 0 : event.key === 'End' ? controls.length - 1 : index + (event.key === 'ArrowRight' ? 1 : -1); + controls[Math.max(0, Math.min(controls.length - 1, next))]?.focus({ preventScroll: true }); + return; + } + if (event.key !== 'ArrowDown' && event.key !== 'ArrowUp') return; + setFocused(Number(row.dataset.index)); + scrollRef.current?.focus({ preventScroll: true }); + } else if (event.key === 'F2' || event.key === 'ArrowRight' || event.key === 'Enter') { + const rowEls = Array.from(scrollRef.current?.querySelectorAll('[role="row"]') ?? []); + const viewport = scrollRef.current?.getBoundingClientRect(); + const inViewport = (el: HTMLElement) => { + const bounds = el.getBoundingClientRect(); + return viewport != null && bounds.bottom > viewport.top && bounds.top < viewport.bottom; + }; + const cursorRow = focusedMessageId != null ? document.getElementById(`${ROW_DOM_ID_PREFIX}${focusedMessageId}`) : null; + const activeRow = cursorRow && inViewport(cursorRow) ? cursorRow : rowEls.find(inViewport) ?? cursorRow ?? rowEls[0]; + if (!activeRow) return; + event.preventDefault(); + setFocused(Number(activeRow.dataset.index)); + if (event.key === 'Enter') activeRow.querySelector('.msg-list__open')?.click(); + else rowControls(activeRow)[0]?.focus(); + return; + } + if ((event.key === 'Home' || event.key === 'End') && !event.shiftKey) { + event.preventDefault(); + navigate(event.key === 'Home' ? 'first' : 'last'); + return; + } + if (event.key === 'Escape') { + if (hasSelection) { + event.preventDefault(); + selectNone(); + } + return; + } + if (event.key === ' ' || event.key === 'Spacebar') { + const index = focusedMessageId == null ? -1 : visibleMessages.findIndex((r) => r.id === focusedMessageId); + if (index >= 0) { + event.preventDefault(); + toggleAt(index); + } + return; + } + if (event.key === 'ArrowDown' || event.key === 'ArrowUp') { + const length = visibleMessages.length; + if (!length) return; + event.preventDefault(); + const direction = event.key === 'ArrowDown' ? 1 : -1; + const focusedIndex = focusedMessageId == null ? -1 : visibleMessages.findIndex((r) => r.id === focusedMessageId); + let from: number; + if (focusedIndex >= 0) from = focusedIndex; + else if (anchorRef.current >= 0) from = anchorRef.current; + else from = direction > 0 ? -1 : length; + const next = Math.max(0, Math.min(length - 1, from + direction)); + if (event.shiftKey) { + extendRange(next); + useMailStore.getState().setFocusedMessage(visibleMessages[next].id, viewId); + } else { + openMessage(visibleMessages[next].id); + } + } + } + + function onControlPointerInteraction(event: MouseEvent) { + if ((event.type === 'contextmenu' ? event.button === 2 : event.detail > 0) && event.target instanceof Element + && event.target.closest('[data-message-control], .msg-list__check')) { + scrollRef.current?.focus({ preventScroll: true }); + } + } + + // Row handlers go through a ref so memoized rows keep stable callbacks. + const handlerRef = useRef(null); + handlerRef.current = { + rowClick(index, event) { + scrollRef.current?.focus({ preventScroll: true }); + if (event.shiftKey || event.ctrlKey || event.metaKey) { + event.preventDefault(); + if (event.shiftKey) extendRange(index, firstVisibleIndex()); + else toggleAt(index); + return; + } + const hadSelection = hasSelection; + const id = setFocused(index); + if (id == null) return; + if (hadSelection) selectNone(); + if (!hadSelection && id === openMessageId) { + openMessage(null); + return; + } + openMessage(id); + }, + checkboxClick(index, event) { + event.stopPropagation(); + if (event.shiftKey) extendRange(index, firstVisibleIndex()); + else toggleAt(index); + }, + dragStart(message, event) { + scrollRef.current?.focus({ preventScroll: true }); + useMessageDrag.getState().startDrag(event, { messageId: message.id, selectedIds, sourceViewId: viewId }); + }, + dragEnd() { + useMessageDrag.getState().endDrag(); + }, + star(message) { + store().markManyFlagged([message.id], message.is_flagged !== 1); + }, + tag(message, event) { + const trigger = event.currentTarget instanceof HTMLElement ? event.currentTarget : null; + if (tagPopover && tagPopover.ids.length === 1 && tagPopover.ids[0] === message.id) { + closeTagPopover(); + return; + } + const anchor = anchorOf(trigger); + if (!anchor) return; + setTagPopover({ ids: [message.id], targets: [message], anchor, trigger, returnFocus: event.detail === 0 ? trigger : scrollRef.current }); + }, + archive(id) { + store().archiveMessages([id]); + }, + remove(id) { + store().destroyMessages([id]); + }, + }; + const rowHandlers = useMemo(() => ({ + rowClick: (index, event) => handlerRef.current!.rowClick(index, event), + checkboxClick: (index, event) => handlerRef.current!.checkboxClick(index, event), + dragStart: (message, event) => handlerRef.current!.dragStart(message, event), + dragEnd: () => handlerRef.current!.dragEnd(), + star: (message) => handlerRef.current!.star(message), + tag: (message, event) => handlerRef.current!.tag(message, event), + archive: (id) => handlerRef.current!.archive(id), + remove: (id) => handlerRef.current!.remove(id), + }), []); + + const tagMenuRowId = tagPopover && tagPopover.ids.length === 1 && tagPopover.trigger?.classList.contains('msg-list__action--tag') + ? tagPopover.ids[0] + : null; + const tagPopoverTargets = useMemo(() => { + if (!tagPopover) return []; + return tagPopover.ids.map((id) => messages.get(id) ?? tagPopover.targets.find((row) => row.id === id)); + }, [tagPopover, messages]); + + // ----- drop target: rows dragged from another view land in this folder ---- + const dragSource = useMessageDrag((s) => s.sourceViewId); + const dragging = useMessageDrag((s) => s.dragging); + const [dropHover, setDropHover] = useState(false); + const dropState = dragging && dropHover && dragSource !== viewId && !isTagView ? 'move' : null; + function onListDrop(event: DragEvent) { + setDropHover(false); + if (isTagView || typeof viewId !== 'number') return; + const payload = readMessageDrag(event); + if (!payload || payload.sourceViewId === viewId) return; + event.preventDefault(); + store().moveMessages(payload.ids, viewId); + useMessageDrag.getState().endDrag(); + } + + const showsRecipients = folderShowsRecipients(folder); + const sort = sortForFolder(folder?.role); + const isArchiveFolder = folder?.role === 'archive'; + const filteredEmptyText = `No ${[unreadOnly ? 'unread' : null, flaggedOnly ? 'starred' : null].filter(Boolean).join(' ')}${unreadOnly || flaggedOnly ? ' ' : ''}messages in ${folderName}.`; + const draggedSet = useMemo(() => new Set(draggedIds), [draggedIds]); + + return ( +
setDropHover(true)} + onDragOver={(event) => { if (dragSource !== viewId && !isTagView) event.preventDefault(); }} + onDragLeave={(event) => { + if (event.currentTarget.contains(event.relatedTarget as Node | null)) return; + setDropHover(false); + }} + onDrop={onListDrop} + > + (hasSelection ? selectNone() : selectAllForCurrentFilter())} + selectionActions={( + ( + store().setTagsMany([...selectedIds], on ? { add: [keyword] } : { remove: [keyword] })} + onClear={() => store().clearTagsMany([...selectedIds])} + onManage={() => {}} + /> + )} + /> + )} + normalActions={( +
+ + +
+ )} + trailing={( + <> + {inlineControls ? ( + + ) : null} + {moreMenuGroups.length > 0 ? : null} + + )} + /> + +
visibleMessages[item.index]?.id === focusedMessageId) + ? `${ROW_DOM_ID_PREFIX}${focusedMessageId}` + : undefined} + onScroll={onScroll} + onKeyDown={handleKeyDown} + onClickCapture={onControlPointerInteraction} + onContextMenuCapture={onControlPointerInteraction} + > +
    + {virtualItems.map((item) => { + const message = visibleMessages[item.index]; + if (!message) return null; + return ( + + ); + })} +
+
+ ) : quickFilterActive ? ( +

No messages matching "{quickFilterQuery.trim()}" in {folderName}.

+ ) : unreadOnly || flaggedOnly ? ( +

{filteredEmptyText}

+ ) : isTagView ? ( +

No messages are tagged {folderName}.

+ ) : ( +

{folderName} is empty.

+ )} + + store().setTagsMany(tagPopover?.ids ?? [], on ? { add: [keyword] } : { remove: [keyword] })} + onClear={() => store().clearTagsMany(tagPopover?.ids ?? [])} + onManage={closeTagPopover} + /> +
+ ); +} diff --git a/suites-experimental/stormbox-react/src/components/MessageListRow.tsx b/suites-experimental/stormbox-react/src/components/MessageListRow.tsx new file mode 100644 index 000000000..ce5882ef5 --- /dev/null +++ b/suites-experimental/stormbox-react/src/components/MessageListRow.tsx @@ -0,0 +1,185 @@ +import { memo, useMemo } from 'react'; +import type { DragEvent, MouseEvent } from 'react'; +import { Paperclip, Star, Trash2 } from 'lucide-react'; + +import archiveIcon from '../assets/icons/tb-folder-archive.svg?raw'; +import type { JmapViewSort, Message } from '../types'; +import { + correspondentLabel, fmtDate, rowCorrespondent, rowTimestamp, +} from '../utils/message-row-presentation'; +import { resolveMessageTags, type MessageTagDefinition } from '../utils/message-tags'; +import { senderAvatarFor } from '../utils/sender-avatar'; +import { MessageTagStack } from './Tags'; + +export interface RowHandlers { + rowClick: (index: number, event: MouseEvent) => void; + checkboxClick: (index: number, event: MouseEvent) => void; + dragStart: (message: Message, event: DragEvent) => void; + dragEnd: () => void; + star: (message: Message) => void; + tag: (message: Message, event: MouseEvent) => void; + archive: (id: number) => void; + remove: (id: number) => void; +} + +interface MessageListRowProps { + message: Message; + index: number; + start: number; + size: number; + domIdPrefix: string; + focused: boolean; + cursor: boolean; + selected: boolean; + dragging: boolean; + showsRecipients: boolean; + sort: JmapViewSort; + hoverActions: boolean; + archiveAction: boolean; + deleteAction: boolean; + draggable: boolean; + tagMenuOpen: boolean; + tagDefinitions: ReadonlyArray; + handlers: RowHandlers; +} + +/** One positioned message-list row; every interaction goes back to the list. */ +export const MessageListRow = memo(function MessageListRow({ + message, index, start, size, domIdPrefix, focused, cursor, selected, dragging, showsRecipients, sort, + hoverActions, archiveAction, deleteAction, draggable, tagMenuOpen, tagDefinitions, handlers, +}: MessageListRowProps) { + const isUnread = message.is_seen === 0; + const isFlagged = message.is_flagged === 1; + const tags = useMemo(() => resolveMessageTags(message.keywords_json, tagDefinitions), [message.keywords_json, tagDefinitions]); + const tagStackLabel = tags.length === 0 ? 'Tag' : `Tags: ${tags.map((tag) => tag.name).join(', ')}`; + const correspondent = rowCorrespondent(message, showsRecipients); + const avatar = useMemo(() => senderAvatarFor(correspondent, ''), [correspondent]); + const label = correspondentLabel(message, showsRecipients); + const dateText = fmtDate(rowTimestamp(message, sort)); + const subject = message.subject || '(no subject)'; + const rowLabel = [ + label, + subject, + dateText, + isUnread ? 'Unread' : '', + isFlagged ? 'Starred' : '', + message.has_attachment === 1 ? 'Has attachments' : '', + tags.length > 0 ? tagStackLabel : '', + ].filter(Boolean).join(', '); + const scheduled = message.scheduled_undo_status === 'pending'; + const classes = [ + focused ? 'is-focused' : '', + cursor ? 'is-cursor' : '', + selected ? 'is-selected' : '', + dragging ? 'is-dragging' : '', + isUnread ? 'is-unread' : '', + ].filter(Boolean).join(' '); + + return ( +
  • +
    handlers.rowClick(index, event)} + onDragStart={(event) => handlers.dragStart(message, event)} + onDragEnd={handlers.dragEnd} + > + + + {archiveAction ? ( + + ) : null} + {deleteAction ? ( + + ) : null} +
    + ) : null} +
  • + {message.preview ?

    {message.preview}

    : null} +
    +
    + + ); +}); diff --git a/suites-experimental/stormbox-react/src/components/MessageView.tsx b/suites-experimental/stormbox-react/src/components/MessageView.tsx new file mode 100644 index 000000000..c584029ef --- /dev/null +++ b/suites-experimental/stormbox-react/src/components/MessageView.tsx @@ -0,0 +1,523 @@ +import { + useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, +} from 'react'; +import type { CSSProperties, KeyboardEvent, RefCallback } from 'react'; +import DOMPurify from 'dompurify'; +import { + ArrowLeft, ChevronDown, ChevronUp, Clock, Download, Moon, Paperclip, Sun, Trash2, +} from 'lucide-react'; + +import archiveIcon from '../assets/icons/tb-folder-archive.svg?raw'; +import junkIcon from '../assets/icons/tb-folder-spam.svg?raw'; +import forwardIcon from '../assets/icons/tb-forward.svg?raw'; +import replyIcon from '../assets/icons/tb-reply.svg?raw'; +import replyAllIcon from '../assets/icons/tb-reply-all.svg?raw'; +import { LOCALE, NOW, TIME_ZONE } from '../clock'; +import { bodyFor } from '../data/bodies'; +import type { Attachment } from '../types'; +import { folderById, useMailStore } from '../store/mail-store'; +import { useComposeStore } from '../store/compose-store'; +import { useUiStore } from '../store/ui-store'; +import { useMediaQuery } from '../hooks/useMediaQuery'; +import { + ALLOWED_URI_REGEXP, BODY_THEME_COLORS, IFRAME_SANDBOX, buildMessageSrcDoc, sanitizeMessageDocument, +} from '../utils/message-html'; +import { adaptHtmlForDarkMode } from '../utils/dark-email'; +import { formatAddressList } from '../utils/address-parse'; +import { plaintextToHtml } from '../utils/plaintext-html'; +import { shortFrom } from '../utils/sender-avatar'; +import { formatBytes } from '../utils/format-bytes'; +import { DEFAULT_MESSAGE_TAGS, resolveMessageTags } from '../utils/message-tags'; +import { AppIconButton, MaximizeButton, RawIcon } from './base'; +import { MessageTagChip, MessageTagStack, TagPickerPopover, type PopoverAnchor } from './Tags'; + +const MIN_EMAIL_LAYOUT_WIDTH = 400; +const MIN_IFRAME_HEIGHT = 120; + +function fmtDate(ms: number | null | undefined): string { + if (!ms) return ''; + const d = new Date(Number(ms)); + return Number.isNaN(d.valueOf()) ? '' : d.toLocaleString(LOCALE, { timeZone: TIME_ZONE }); +} + +function describeTimeUntil(ms: number): string { + const diffMs = ms - NOW; + const rtf = new Intl.RelativeTimeFormat(LOCALE, { numeric: 'auto' }); + const minutes = Math.round(diffMs / 60_000); + if (Math.abs(minutes) < 60) return rtf.format(minutes, 'minute'); + const hours = Math.round(diffMs / 3_600_000); + if (Math.abs(hours) < 48) return rtf.format(hours, 'hour'); + return rtf.format(Math.round(diffMs / 86_400_000), 'day'); +} + +function useElementHeight(): [RefCallback, number] { + const [height, setHeight] = useState(0); + const observerRef = useRef(null); + const ref = useCallback((el: T | null) => { + observerRef.current?.disconnect(); + observerRef.current = null; + if (!el) { + setHeight(0); + return; + } + const observer = new ResizeObserver(([entry]) => { + const box = entry.borderBoxSize?.[0]; + setHeight(box ? box.blockSize : el.offsetHeight); + }); + observer.observe(el); + observerRef.current = observer; + }, []); + return [ref, height]; +} + +function AttachmentBar({ attachments, contextKey }: { attachments: Attachment[]; contextKey: number }) { + const [expanded, setExpanded] = useState(true); + const [hasOverflow, setHasOverflow] = useState(false); + const barRef = useRef(null); + const listRef = useRef(null); + const headingRef = useRef(null); + const [sizes, setSizes] = useState({ heading: 0, firstRow: 0 }); + + useLayoutEffect(() => { + setExpanded(true); + if (listRef.current) listRef.current.scrollTop = 0; + }, [contextKey]); + + useLayoutEffect(() => { + const bar = barRef.current; + const list = listRef.current; + if (!bar || !list) return; + const heading = headingRef.current?.offsetHeight ?? 0; + const firstRow = (list.firstElementChild as HTMLElement | null)?.offsetHeight ?? 0; + setSizes((previous) => (previous.heading === heading && previous.firstRow === firstRow ? previous : { heading, firstRow })); + const budget = bar.clientHeight - heading; + const overflow = attachments.length > 1 && list.scrollHeight > budget + 1; + setHasOverflow(overflow); + if (!overflow) setExpanded(true); + }, [attachments, contextKey]); + + if (attachments.length === 0) return null; + return ( +
    +
    +

    Attachments

    + +
    +
      + {attachments.map((attachment, index) => { + const collapsed = !expanded && index > 0; + return ( +
    • +
    • + ); + })} +
    +
    + ); +} + +export function MessageView({ maximized, onToggleMaximized }: { maximized: boolean; onToggleMaximized: () => void }) { + const open = useMailStore((s) => s.open); + const message = useMailStore((s) => (s.open.id != null ? s.messages.get(s.open.id) ?? null : null)); + const folders = useMailStore((s) => s.folders); + const theme = useUiStore((s) => s.theme); + const compactHeader = useMediaQuery('(max-width: 639px)'); + + const messageViewRef = useRef(null); + const [viewRef, viewHeight] = useElementHeight(); + const [toolbarRef, toolbarHeight] = useElementHeight(); + const [bannerRef, bannerHeight] = useElementHeight(); + const bodyScrollRef = useRef(null); + const htmlShellRef = useRef(null); + const iframeRef = useRef(null); + const fitRef = useRef<(() => void) | null>(null); + const cleanupRef = useRef<(() => void) | null>(null); + const [iframeHeight, setIframeHeight] = useState(MIN_IFRAME_HEIGHT); + const [forceLightBody, setForceLightBody] = useState(false); + const [headerExpanded, setHeaderExpanded] = useState(false); + const [tagMenuAnchor, setTagMenuAnchor] = useState(null); + const tagButtonRef = useRef(null); + const metadataId = useId(); + const metadataRef = useRef(null); + + const messageId = message?.id ?? null; + useEffect(() => { + setForceLightBody(false); + setHeaderExpanded(false); + setTagMenuAnchor(null); + if (metadataRef.current) metadataRef.current.scrollTop = 0; + }, [messageId]); + + // Opening a draft hands it to the composer (Stormbox prepareDraftFromMessage). + useEffect(() => { + if (!message || message.is_draft !== 1) return; + useComposeStore.getState().openDraft(message); + const mail = useMailStore.getState(); + mail.selectMessage(null); + mail.clearSelection(); + }, [message]); + + const body = message ? bodyFor(message) : null; + const effectiveScheme = theme; + const bodyScheme = effectiveScheme === 'dark' && forceLightBody ? 'light' : effectiveScheme; + const iframeBackground = BODY_THEME_COLORS[bodyScheme].background; + + const textHtml = useMemo(() => { + if (!body?.text || body.html) return ''; + return DOMPurify.sanitize(plaintextToHtml(body.text), { ALLOWED_URI_REGEXP, ADD_ATTR: ['target'] }) as string; + }, [body]); + + const srcDoc = useMemo(() => { + if (!body?.html) return ''; + const safeHtml = sanitizeMessageDocument(body.html, null); + const themed = bodyScheme === 'dark' ? adaptHtmlForDarkMode(safeHtml) : safeHtml; + return buildMessageSrcDoc(themed, { colorScheme: bodyScheme }); + }, [body, bodyScheme]); + + const teardown = useCallback(() => { + fitRef.current = null; + cleanupRef.current?.(); + cleanupRef.current = null; + }, []); + + useLayoutEffect(() => { + teardown(); + setIframeHeight(MIN_IFRAME_HEIGHT); + }, [srcDoc, teardown]); + + useEffect(() => teardown, [teardown]); + + const onIframeLoad = useCallback(() => { + teardown(); + const iframe = iframeRef.current; + const doc = iframe?.contentDocument; + if (!iframe || !doc?.body) return; + doc.querySelectorAll('a[href]').forEach((a) => { + a.setAttribute('target', '_blank'); + a.setAttribute('rel', 'noopener noreferrer'); + }); + let active = true; + let rafScheduled = false; + const docEl = doc.documentElement; + const bodyEl = doc.body; + const applyFit = () => { + if (!active) return; + const shellWidth = htmlShellRef.current?.clientWidth ?? 0; + if (shellWidth <= 0) return; + docEl.style.zoom = ''; + const contentWidth = Math.max(docEl.scrollWidth, bodyEl.scrollWidth, 1); + const view = doc.defaultView; + const bodyStyle = view?.getComputedStyle(bodyEl); + const rootStyle = view?.getComputedStyle(docEl); + const bottomSpace = [bodyStyle?.marginBottom, rootStyle?.paddingBottom, rootStyle?.borderBottomWidth, rootStyle?.marginBottom] + .reduce((total, value) => total + Math.max(0, Number.parseFloat(value ?? '') || 0), 0); + const bodyTop = Math.max(0, bodyEl.getBoundingClientRect().top + (view?.scrollY ?? 0)); + const contentHeight = Math.max(bodyTop + Math.max(bodyEl.offsetHeight, bodyEl.scrollHeight) + bottomSpace, MIN_IFRAME_HEIGHT); + const effectiveWidth = Math.max(contentWidth, MIN_EMAIL_LAYOUT_WIDTH); + const ratio = effectiveWidth > shellWidth ? shellWidth / effectiveWidth : 1; + docEl.style.zoom = ratio === 1 ? '' : String(ratio); + setIframeHeight(Math.max(MIN_IFRAME_HEIGHT, Math.ceil(contentHeight * ratio))); + }; + fitRef.current = applyFit; + const scheduleApplyFit = () => { + if (rafScheduled) return; + rafScheduled = true; + requestAnimationFrame(() => { + rafScheduled = false; + applyFit(); + }); + }; + applyFit(); + const cleanups: Array<() => void> = []; + const raf = requestAnimationFrame(applyFit); + cleanups.push(() => cancelAnimationFrame(raf)); + for (const delay of [150, 600]) { + const timer = window.setTimeout(applyFit, delay); + cleanups.push(() => clearTimeout(timer)); + } + doc.fonts?.ready.then(applyFit).catch(() => {}); + let observer: ResizeObserver | null = null; + if (htmlShellRef.current) { + observer = new ResizeObserver(scheduleApplyFit); + observer.observe(htmlShellRef.current); + } + cleanupRef.current = () => { + active = false; + observer?.disconnect(); + for (const cleanup of cleanups) cleanup(); + }; + }, [teardown]); + + const mail = useMailStore.getState; + const compose = useComposeStore.getState; + const openFolder = folderById({ folders }, typeof open.viewId === 'number' ? open.viewId : message?.folder_id ?? null); + const inJunk = openFolder?.role === 'junk'; + const inArchive = openFolder?.role === 'archive'; + const scheduled = message?.scheduled_undo_status === 'pending'; + const messageTags = useMemo( + () => (message ? resolveMessageTags(message.keywords_json, DEFAULT_MESSAGE_TAGS) : []), + [message], + ); + const tagStackLabel = messageTags.length === 0 ? 'Tag' : `Tags: ${messageTags.map((tag) => tag.name).join(', ')}`; + const tagTargets = useMemo(() => (message ? [message] : []), [message]); + + function onReadingKeyDown(event: KeyboardEvent) { + if (!maximized || event.key !== 'Escape' || event.defaultPrevented || tagMenuAnchor) return; + if (messageViewRef.current?.querySelector('[role="dialog"], details[open]')) return; + event.preventDefault(); + onToggleMaximized(); + } + + const setRefs = useCallback((el: HTMLElement | null) => { + messageViewRef.current = el; + viewRef(el); + }, [viewRef]); + + const style = { + '--message-view-height': viewHeight > 0 ? `${viewHeight}px` : undefined, + '--message-toolbar-height': `${toolbarHeight}px`, + '--message-banner-height': `${bannerHeight}px`, + '--message-attachment-bar-height': '0px', + } as CSSProperties; + + if (!message) { + return ( +
    +

    Select a message to read it.

    +
    + ); + } + + const metadataExpanded = !compactHeader || headerExpanded; + const senderText = metadataExpanded ? message.from_text || '(no sender)' : shortFrom(message.from_text); + const ccText = formatAddressList(message.cc); + const ids = [message.id]; + const headerDetailsLabel = headerExpanded ? 'Hide message details' : 'Show message details'; + + return ( +
    +
    +
    + { mail().selectMessage(null); mail().clearSelection(); }} + > + + + {inJunk ? ( + + ) : null} + {!scheduled ? ( + <> + {!inArchive ? ( + mail().archiveMessages(ids)}> + + + ) : null} + {!inJunk ? ( + mail().junkMessages(ids)}> + + + ) : null} + mail().destroyMessages(ids)}> + + + compose().prepareReply(message, false)}> + + + compose().prepareReply(message, true)}> + + + compose().prepareForward(message)}> + + + { + if (tagMenuAnchor) { + setTagMenuAnchor(null); + return; + } + const rect = tagButtonRef.current?.getBoundingClientRect(); + if (rect) setTagMenuAnchor({ top: rect.top, left: rect.left, width: rect.width, height: rect.height }); + }} + > + + + + ) : null} + setTagMenuAnchor(null)} + onToggle={(keyword, on) => mail().setTagsMany(ids, on ? { add: [keyword] } : { remove: [keyword] })} + onClear={() => mail().clearTagsMany(ids)} + onManage={() => setTagMenuAnchor(null)} + /> +
    + {effectiveScheme === 'dark' && srcDoc ? ( + setForceLightBody((value) => !value)} + > + {forceLightBody ? : } + + ) : null} + +
    +
    + {scheduled ? ( +
    +
    + ) : null} +
    + { + setHeaderExpanded((value) => !value); + if (metadataRef.current) metadataRef.current.scrollTop = 0; + }} + > + +
    +
    +
    From
    +
    {senderText}
    +
    + {message.to_text ? ( +
    +
    To
    +
    {message.to_text}
    +
    + ) : null} + {ccText ? ( +
    +
    Cc
    +
    {ccText}
    +
    + ) : null} +
    +
    Subject
    +

    {message.subject || '(no subject)'}

    +
    +
    +
    {scheduled ? 'Send at' : 'Date'}
    +
    {fmtDate(scheduled ? message.sent_at : message.received_at)}
    +
    + {messageTags.length > 0 ? ( +
    +
    Tags
    +
    + {messageTags.map((tag) => ( + mail().setTagsMany(ids, { remove: [tag.keyword] })} + /> + ))} +
    +
    + ) : null} +
    +
    +
    + {srcDoc ? ( +
    +